Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/files_markdown.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-08-26 18:22:18 +0300
committerRobin Appelman <robin@icewind.nl>2017-08-26 18:22:18 +0300
commit7514c06ee927d4fd642dd647789db05d75be59d4 (patch)
tree18a27c8739b0852252b079f39e82605e1f47fe55
parent0e90067ab0976f7b08b85fa1ee2ab105c29cf337 (diff)
switch to webpack for bundeling
-rw-r--r--.babelrc10
-rw-r--r--Makefile14
-rw-r--r--appinfo/app.php2
-rw-r--r--js/CheckboxPlugin.d.ts11
-rw-r--r--js/MermaidPlugin.d.ts3
-rw-r--r--js/PreviewPlugin.d.ts6
-rw-r--r--js/PreviewPlugin.js11
-rw-r--r--js/Renderer.d.ts9
-rw-r--r--js/Renderer.js87
-rw-r--r--js/SidebarPreview.d.ts9
-rw-r--r--js/editor.d.ts21
-rw-r--r--js/editor.js96178
-rw-r--r--js/editor.js.map1
-rw-r--r--package-lock.json (renamed from js/package-lock.json)1932
-rw-r--r--package.json (renamed from js/package.json)9
-rw-r--r--tsconfig.json (renamed from js/tsconfig.json)4
-rw-r--r--webpack.config.js39
17 files changed, 1948 insertions, 96398 deletions
diff --git a/.babelrc b/.babelrc
new file mode 100644
index 0000000..a97ca33
--- /dev/null
+++ b/.babelrc
@@ -0,0 +1,10 @@
+{
+ "presets": [
+ [
+ "es2015",
+ {
+ "modules": false
+ }
+ ]
+ ]
+} \ No newline at end of file
diff --git a/Makefile b/Makefile
index 0510ad3..e3a39b9 100644
--- a/Makefile
+++ b/Makefile
@@ -6,20 +6,20 @@ cert_dir=$(HOME)/.nextcloud/certificates
all: js/editor.js
-sources=$(wildcard js/*.ts) $(wildcard js/*/*.ts) js/tsconfig.json
+sources=$(wildcard js/*.ts) $(wildcard js/*/*.ts) tsconfig.json .babelrc webpack.config.js
.PHONY: watch
-watch: js/node_modules
- cd js && node_modules/.bin/watchify --debug editor.ts -p tsify -o editor.js
+watch: node_modules
+ node_modules/.bin/webpack --watch
clean:
rm -rf $(build_dir)
-js/node_modules: js/package.json
- cd js && npm install
+node_modules: package.json
+ npm install
-js/editor.js: $(sources) js/node_modules
- cd js && NODE_ENV=production node_modules/.bin/browserify editor.ts -t uglifyify -p tsify -o editor.js
+js/editor.js: $(sources) node_modules
+ NODE_ENV=production node_modules/.bin/webpack
appstore: clean js/node_modules
mkdir -p $(sign_dir)
diff --git a/appinfo/app.php b/appinfo/app.php
index 899483d..eb0ea8e 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -8,6 +8,6 @@ $eventDispatcher->addListener(
\OC::$server->getContentSecurityPolicyManager()->addDefaultPolicy($policy);
//load the required files
- OCP\Util::addscript('files_markdown', 'editor');
+ OCP\Util::addscript('files_markdown', '../build/editor');
OCP\Util::addStyle('files_markdown', 'preview');
});
diff --git a/js/CheckboxPlugin.d.ts b/js/CheckboxPlugin.d.ts
new file mode 100644
index 0000000..659413e
--- /dev/null
+++ b/js/CheckboxPlugin.d.ts
@@ -0,0 +1,11 @@
+/// <reference types="markdown-it" />
+import * as MarkdownIt from "markdown-it";
+export interface CheckboxPluginOptions {
+ divWrap: boolean;
+ divClass: string;
+ idPrefix: string;
+ readonly: boolean;
+ checkboxClass: string;
+}
+export declare function CheckBoxReplacer(md: MarkdownIt.MarkdownIt, userOptions: Partial<CheckboxPluginOptions>): MarkdownIt.Rule;
+export declare function CheckboxPlugin(md: MarkdownIt.MarkdownIt, options: CheckboxPluginOptions): void;
diff --git a/js/MermaidPlugin.d.ts b/js/MermaidPlugin.d.ts
new file mode 100644
index 0000000..e1848a3
--- /dev/null
+++ b/js/MermaidPlugin.d.ts
@@ -0,0 +1,3 @@
+/// <reference types="markdown-it" />
+import MarkdownIt = require("markdown-it");
+export declare const MermaidPlugin: (md: MarkdownIt.MarkdownIt) => void;
diff --git a/js/PreviewPlugin.d.ts b/js/PreviewPlugin.d.ts
new file mode 100644
index 0000000..8188714
--- /dev/null
+++ b/js/PreviewPlugin.d.ts
@@ -0,0 +1,6 @@
+import { Renderer } from './Renderer';
+export declare class PreviewPlugin {
+ renderer: Renderer;
+ init(): void;
+ preview: any;
+}
diff --git a/js/PreviewPlugin.js b/js/PreviewPlugin.js
deleted file mode 100644
index bd11feb..0000000
--- a/js/PreviewPlugin.js
+++ /dev/null
@@ -1,11 +0,0 @@
-"use strict";
-exports.__esModule = true;
-var Renderer_1 = require("./Renderer");
-var PreviewPlugin = (function () {
- function PreviewPlugin() {
- this.renderer = new Renderer_1.Renderer();
- this.preview = _.throttle(this.renderer.renderText.bind(this.renderer), 500);
- }
- return PreviewPlugin;
-}());
-exports.PreviewPlugin = PreviewPlugin;
diff --git a/js/Renderer.d.ts b/js/Renderer.d.ts
new file mode 100644
index 0000000..44ea752
--- /dev/null
+++ b/js/Renderer.d.ts
@@ -0,0 +1,9 @@
+/// <reference types="markdown-it" />
+import * as MarkdownIt from 'markdown-it';
+export declare class Renderer {
+ md: MarkdownIt.MarkdownIt;
+ constructor();
+ prepareText(text: string): string;
+ getUrl(path: string): string;
+ renderText(text: string, element: any): void;
+}
diff --git a/js/Renderer.js b/js/Renderer.js
deleted file mode 100644
index df8650e..0000000
--- a/js/Renderer.js
+++ /dev/null
@@ -1,87 +0,0 @@
-"use strict";
-exports.__esModule = true;
-var marked = require("marked");
-var hljs = require("highlight.js");
-require("./Nextcloud");
-var Renderer = (function () {
- function Renderer() {
- var _this = this;
- this.renderer = new marked.Renderer();
- var linkRenderer = this.renderer.link.bind(this.renderer);
- this.renderer.image = function (href, title, text) {
- var out = '<img src="' + _this.getUrl(href) + '" alt="' + text + '"';
- if (title) {
- out += ' title="' + title + '"';
- }
- out += '>';
- return out;
- };
- this.renderer.link = function (href, title, text) {
- var rendered = linkRenderer(href, title, text);
- var parser = document.createElement('a');
- parser.href = href;
- if (parser.hostname !== window.location.hostname) {
- return rendered.replace("href=", "target='_blank' rel='noopener' href=");
- }
- else {
- return rendered;
- }
- };
- this.renderer.code = function (code, language) {
- if (code.match(/^sequenceDiagram/) || code.match(/^graph/) || code.match(/^gantt/)) {
- return '<div class="mermaid">' + code + '</div>';
- }
- else {
- // Check whether the given language is valid for highlight.js.
- var validLang = !!(language && hljs.getLanguage(language));
- // Highlight only if the language is valid.
- var highlighted = validLang ? hljs.highlight(language, code).value : code;
- // Render the highlighted code with `hljs` class.
- return '<pre><code class="hljs ' + language + '">' + highlighted + '</code></pre>';
- }
- };
- marked.setOptions({
- renderer: this.renderer,
- headerPrefix: 'md-'
- });
- }
- Renderer.prototype.prepareText = function (text) {
- if (text.substr(0, 3) === '+++') {
- text = text.substr(3);
- text = text.substr(text.indexOf('+++') + 3);
- }
- return text;
- };
- Renderer.prototype.getUrl = function (path) {
- if (!path) {
- return path;
- }
- if (path.substr(0, 7) === 'http://' || path.substr(0, 8) === 'https://' || path.substr(0, 3) === '://') {
- return path;
- }
- else {
- if (path.substr(0, 1) !== '/') {
- if (OCA.Files_Texteditor.file && OCA.Files_Texteditor.file.dir) {
- path = OCA.Files_Texteditor.file.dir + '/' + path;
- }
- else if (OCA.Files.App && OCA.Files.App.fileList._currentDirectory) {
- path = OCA.Files.App.fileList._currentDirectory + '/' + path;
- }
- }
- return OC.linkToRemote('files' + path.replace(/\/\/+/g, '/'));
- }
- };
- Renderer.prototype.renderText = function (text, element) {
- var html = marked(this.prepareText(text));
- element.html(html);
- // renderMathInElement(element.get(0), {
- // delimiters: [
- // {left: "$$", right: "$$", display: true},
- // {left: "$", right: "$", display: false}
- // ]
- // });
- // mermaid.init();
- };
- return Renderer;
-}());
-exports.Renderer = Renderer;
diff --git a/js/SidebarPreview.d.ts b/js/SidebarPreview.d.ts
new file mode 100644
index 0000000..b517fc9
--- /dev/null
+++ b/js/SidebarPreview.d.ts
@@ -0,0 +1,9 @@
+/// <reference types="jquery" />
+import { PreviewPlugin } from "./PreviewPlugin";
+export declare class SidebarPreview implements SidebarPreviewPlugin {
+ private previewPlugin;
+ constructor(previewPlugin: PreviewPlugin);
+ attach(manager: any): void;
+ handlePreview: SidebarPreviewRender;
+ getFileContent(path: string): JQuery.jqXHR<any>;
+}
diff --git a/js/editor.d.ts b/js/editor.d.ts
index c37a8e6..e69de29 100644
--- a/js/editor.d.ts
+++ b/js/editor.d.ts
@@ -1,21 +0,0 @@
-/// <reference types="marked" />
-declare module "Renderer" {
- import * as marked from 'marked';
- import './Nextcloud';
- export class Renderer {
- renderer: marked.Renderer;
- constructor();
- prepareText(text: string): string;
- getUrl(path: string): string;
- renderText(text: string, element: any): void;
- }
-}
-declare module "PreviewPlugin" {
- import { Renderer } from "Renderer";
- export class PreviewPlugin {
- renderer: Renderer;
- preview: any;
- }
-}
-declare module "editor" {
-}
diff --git a/js/editor.js b/js/editor.js
deleted file mode 100644
index 23ef6a1..0000000
--- a/js/editor.js
+++ /dev/null
@@ -1,96178 +0,0 @@
-(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-"use strict";function CheckBoxReplacer(e,c){var r=0,n={divWrap:!1,divClass:"checkbox",idPrefix:"checkbox",readonly:!0,checkboxClass:""},t=$.extend(n,c),s=/\[(X|\s|\_|\-)\]\s(.*)/i,o=function(e,c,n){var s,o=[];t.divWrap&&((s=new n("checkbox_open","div",1)).attrs=[["class",t.divClass]],o.push(s));var a=t.idPrefix+r;return r+=1,s=new n("checkbox_input","input",0),s.attrs=[["type","checkbox"],["id",a]],!0===e&&s.attrs.push(["checked","true"]),t.readonly&&s.attrs.push(["disabled","disabled"]),t.checkboxClass&&s.attrs.push(["class",t.checkboxClass]),o.push(s),s=new n("label_open","label",1),s.attrs=[["for",a]],o.push(s),s=new n("text","",0),s.content=c,o.push(s),o.push(new n("label_close","label",-1)),t.divWrap&&o.push(new n("checkbox_close","div",-1)),o},a=function(e,c){var r=e.content.match(s);if(null===r)return[e];var n=r[1],t=r[2];return o("X"===n||"x"===n,t,c)};return function(e){for(var c=0,r=e.tokens;c<r.length;c++){var n=r[c];"inline"===n.type&&(n.children=[].concat.apply(this,n.children.map(function(c){return a(c,e.Token)})))}}}function CheckboxPlugin(e,c){e.core.ruler.push("checkbox",CheckBoxReplacer(e,c))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.CheckBoxReplacer=CheckBoxReplacer,exports.CheckboxPlugin=CheckboxPlugin;
-
-},{}],2:[function(require,module,exports){
-"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var mermaid=require("mermaid"),d3=require("d3");window.d3=d3,mermaid.mermaidAPI.initialize({startOnLoad:!0,logLevel:3});var chartCounter=0,mermaidChart=function(r){var e=null;if(mermaid.parseError=function(r){e=r},mermaid.parse(r)||null===e){var a=document.createElement("div");document.body.appendChild(a);var i=mermaid.mermaidAPI.render("chart_"+chartCounter++,r,function(){},a);return document.body.removeChild(a),i?'<div class="mermaid">'+i+"</div>":"<pre>Error creating graph</pre>"}return"<pre>"+e+"</pre>"};exports.MermaidPlugin=function(r){var e=r.renderer.rules.fence.bind(r.renderer.rules);r.renderer.rules.fence=function(r,a,i,n,t){var d=r[a],m=d.content.trim();if("mermaid"===d.info)return mermaidChart(m);var u=m.split(/\n/)[0].trim();return"gantt"===u||"sequenceDiagram"===u||u.match(/^graph (?:TB|BT|RL|LR|TD);?$/)?mermaidChart(m):e(r,a,i,n,t)}};
-
-},{"d3":8,"mermaid":401}],3:[function(require,module,exports){
-"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Renderer_1=require("./Renderer"),PreviewPlugin=function(){function e(){this.renderer=new Renderer_1.Renderer,this.preview=_.throttle(this.renderer.renderText.bind(this.renderer),500)}return e.prototype.init=function(){},e}();exports.PreviewPlugin=PreviewPlugin;
-
-},{"./Renderer":4}],4:[function(require,module,exports){
-"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MarkdownIt=require("markdown-it"),KaTeXPlugin=require("markdown-it-katex"),HighlightPlugin=require("markdown-it-highlightjs"),MermaidPlugin_1=require("./MermaidPlugin"),iterator=require("markdown-it-for-inline"),CheckboxPlugin_1=require("./CheckboxPlugin"),AnchorPlugin=require("markdown-it-anchor"),slugify=require("slugify"),TOCPlugin=require("markdown-it-table-of-contents");OC.addStyle("files_markdown","../js/node_modules/katex/dist/katex.min"),OC.addStyle("files_markdown","../js/node_modules/highlight.js/styles/github"),OC.addStyle("files_markdown","../js/node_modules/mermaid/dist/mermaid.forest.min");var slugifyHeading=function(e){return"editor/"+slugify(e).toLowerCase()},Renderer=function(){function e(){var e=this;this.md=new MarkdownIt,this.md.use(KaTeXPlugin),this.md.use(HighlightPlugin),this.md.use(MermaidPlugin_1.MermaidPlugin),this.md.use(CheckboxPlugin_1.CheckboxPlugin,{checkboxClass:"checkbox"}),this.md.use(AnchorPlugin,{slugify:slugifyHeading}),this.md.use(TOCPlugin,{slugify:slugifyHeading}),this.md.use(iterator,"url_new_win","link_open",function(e,i){e[i].attrPush(["target","_blank"]),e[i].attrPush(["rel","noopener"])}),this.md.use(iterator,"internal_image_link","image",function(i,r){i[r].attrSet("src",e.getUrl(i[r].attrGet("src")))})}return e.prototype.prepareText=function(e){return"+++"===e.substr(0,3)&&(e=(e=e.substr(3)).substr(e.indexOf("+++")+3)),e},e.prototype.getUrl=function(e){return e?"http://"===e.substr(0,7)||"https://"===e.substr(0,8)||"://"===e.substr(0,3)?e:("/"!==e.substr(0,1)&&(OCA.Files_Texteditor.file&&OCA.Files_Texteditor.file.dir?e=OCA.Files_Texteditor.file.dir+"/"+e:OCA.Files.App&&OCA.Files.App.fileList._currentDirectory&&(e=OCA.Files.App.fileList._currentDirectory+"/"+e)),OC.linkToRemote("files"+e.replace(/\/\/+/g,"/"))):e},e.prototype.renderText=function(e,i){var r=this.md.render(this.prepareText(e));i.html(r)},e}();exports.Renderer=Renderer;
-
-},{"./CheckboxPlugin":1,"./MermaidPlugin":2,"markdown-it":320,"markdown-it-anchor":293,"markdown-it-for-inline":294,"markdown-it-highlightjs":295,"markdown-it-katex":296,"markdown-it-table-of-contents":319,"slugify":408}],5:[function(require,module,exports){
-"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var SidebarPreview=function(){function e(e){var t=this;this.handlePreview=function(e,i,r,n){var a=(r.parent().width()+50)/(16/9);t.getFileContent(e.getFullPath()).then(function(e){i.removeClass("icon-loading icon-32"),r.addClass("large"),r.addClass("text");var n=$('<div id="preview" class="text-markdown"/>');t.previewPlugin.preview(e,n),i.children(".stretcher").remove(),i.append(n),r.css("max-height",a)},function(){n()})},this.previewPlugin=e}return e.prototype.attach=function(e){e.addPreviewHandler("text/markdown",this.handlePreview)},e.prototype.getFileContent=function(e){var t=OC.linkToRemoteBase("files"+e);return $.get(t)},e}();exports.SidebarPreview=SidebarPreview;
-
-},{}],6:[function(require,module,exports){
-"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PreviewPlugin_1=require("./PreviewPlugin"),SidebarPreview_1=require("./SidebarPreview"),previewPlugin=new PreviewPlugin_1.PreviewPlugin;$(document).ready(function(){OCA.Files_Texteditor&&OCA.Files_Texteditor.registerPreviewPlugin&&OCA.Files_Texteditor.registerPreviewPlugin("text/markdown",previewPlugin)}),OC.Plugins.register("OCA.Files.SidebarPreviewManager",new SidebarPreview_1.SidebarPreview(previewPlugin));
-
-},{"./PreviewPlugin":3,"./SidebarPreview":5}],7:[function(require,module,exports){
-
-},{}],8:[function(require,module,exports){
-!function() {
- var d3 = {
- version: "3.5.17"
- };
- var d3_arraySlice = [].slice, d3_array = function(list) {
- return d3_arraySlice.call(list);
- };
- var d3_document = this.document;
- function d3_documentElement(node) {
- return node && (node.ownerDocument || node.document || node).documentElement;
- }
- function d3_window(node) {
- return node && (node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView);
- }
- if (d3_document) {
- try {
- d3_array(d3_document.documentElement.childNodes)[0].nodeType;
- } catch (e) {
- d3_array = function(list) {
- var i = list.length, array = new Array(i);
- while (i--) array[i] = list[i];
- return array;
- };
- }
- }
- if (!Date.now) Date.now = function() {
- return +new Date();
- };
- if (d3_document) {
- try {
- d3_document.createElement("DIV").style.setProperty("opacity", 0, "");
- } catch (error) {
- var d3_element_prototype = this.Element.prototype, d3_element_setAttribute = d3_element_prototype.setAttribute, d3_element_setAttributeNS = d3_element_prototype.setAttributeNS, d3_style_prototype = this.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty;
- d3_element_prototype.setAttribute = function(name, value) {
- d3_element_setAttribute.call(this, name, value + "");
- };
- d3_element_prototype.setAttributeNS = function(space, local, value) {
- d3_element_setAttributeNS.call(this, space, local, value + "");
- };
- d3_style_prototype.setProperty = function(name, value, priority) {
- d3_style_setProperty.call(this, name, value + "", priority);
- };
- }
- }
- d3.ascending = d3_ascending;
- function d3_ascending(a, b) {
- return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
- }
- d3.descending = function(a, b) {
- return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
- };
- d3.min = function(array, f) {
- var i = -1, n = array.length, a, b;
- if (arguments.length === 1) {
- while (++i < n) if ((b = array[i]) != null && b >= b) {
- a = b;
- break;
- }
- while (++i < n) if ((b = array[i]) != null && a > b) a = b;
- } else {
- while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
- a = b;
- break;
- }
- while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;
- }
- return a;
- };
- d3.max = function(array, f) {
- var i = -1, n = array.length, a, b;
- if (arguments.length === 1) {
- while (++i < n) if ((b = array[i]) != null && b >= b) {
- a = b;
- break;
- }
- while (++i < n) if ((b = array[i]) != null && b > a) a = b;
- } else {
- while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
- a = b;
- break;
- }
- while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;
- }
- return a;
- };
- d3.extent = function(array, f) {
- var i = -1, n = array.length, a, b, c;
- if (arguments.length === 1) {
- while (++i < n) if ((b = array[i]) != null && b >= b) {
- a = c = b;
- break;
- }
- while (++i < n) if ((b = array[i]) != null) {
- if (a > b) a = b;
- if (c < b) c = b;
- }
- } else {
- while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
- a = c = b;
- break;
- }
- while (++i < n) if ((b = f.call(array, array[i], i)) != null) {
- if (a > b) a = b;
- if (c < b) c = b;
- }
- }
- return [ a, c ];
- };
- function d3_number(x) {
- return x === null ? NaN : +x;
- }
- function d3_numeric(x) {
- return !isNaN(x);
- }
- d3.sum = function(array, f) {
- var s = 0, n = array.length, a, i = -1;
- if (arguments.length === 1) {
- while (++i < n) if (d3_numeric(a = +array[i])) s += a;
- } else {
- while (++i < n) if (d3_numeric(a = +f.call(array, array[i], i))) s += a;
- }
- return s;
- };
- d3.mean = function(array, f) {
- var s = 0, n = array.length, a, i = -1, j = n;
- if (arguments.length === 1) {
- while (++i < n) if (d3_numeric(a = d3_number(array[i]))) s += a; else --j;
- } else {
- while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) s += a; else --j;
- }
- if (j) return s / j;
- };
- d3.quantile = function(values, p) {
- var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h;
- return e ? v + e * (values[h] - v) : v;
- };
- d3.median = function(array, f) {
- var numbers = [], n = array.length, a, i = -1;
- if (arguments.length === 1) {
- while (++i < n) if (d3_numeric(a = d3_number(array[i]))) numbers.push(a);
- } else {
- while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) numbers.push(a);
- }
- if (numbers.length) return d3.quantile(numbers.sort(d3_ascending), .5);
- };
- d3.variance = function(array, f) {
- var n = array.length, m = 0, a, d, s = 0, i = -1, j = 0;
- if (arguments.length === 1) {
- while (++i < n) {
- if (d3_numeric(a = d3_number(array[i]))) {
- d = a - m;
- m += d / ++j;
- s += d * (a - m);
- }
- }
- } else {
- while (++i < n) {
- if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) {
- d = a - m;
- m += d / ++j;
- s += d * (a - m);
- }
- }
- }
- if (j > 1) return s / (j - 1);
- };
- d3.deviation = function() {
- var v = d3.variance.apply(this, arguments);
- return v ? Math.sqrt(v) : v;
- };
- function d3_bisector(compare) {
- return {
- left: function(a, x, lo, hi) {
- if (arguments.length < 3) lo = 0;
- if (arguments.length < 4) hi = a.length;
- while (lo < hi) {
- var mid = lo + hi >>> 1;
- if (compare(a[mid], x) < 0) lo = mid + 1; else hi = mid;
- }
- return lo;
- },
- right: function(a, x, lo, hi) {
- if (arguments.length < 3) lo = 0;
- if (arguments.length < 4) hi = a.length;
- while (lo < hi) {
- var mid = lo + hi >>> 1;
- if (compare(a[mid], x) > 0) hi = mid; else lo = mid + 1;
- }
- return lo;
- }
- };
- }
- var d3_bisect = d3_bisector(d3_ascending);
- d3.bisectLeft = d3_bisect.left;
- d3.bisect = d3.bisectRight = d3_bisect.right;
- d3.bisector = function(f) {
- return d3_bisector(f.length === 1 ? function(d, x) {
- return d3_ascending(f(d), x);
- } : f);
- };
- d3.shuffle = function(array, i0, i1) {
- if ((m = arguments.length) < 3) {
- i1 = array.length;
- if (m < 2) i0 = 0;
- }
- var m = i1 - i0, t, i;
- while (m) {
- i = Math.random() * m-- | 0;
- t = array[m + i0], array[m + i0] = array[i + i0], array[i + i0] = t;
- }
- return array;
- };
- d3.permute = function(array, indexes) {
- var i = indexes.length, permutes = new Array(i);
- while (i--) permutes[i] = array[indexes[i]];
- return permutes;
- };
- d3.pairs = function(array) {
- var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n);
- while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ];
- return pairs;
- };
- d3.transpose = function(matrix) {
- if (!(n = matrix.length)) return [];
- for (var i = -1, m = d3.min(matrix, d3_transposeLength), transpose = new Array(m); ++i < m; ) {
- for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n; ) {
- row[j] = matrix[j][i];
- }
- }
- return transpose;
- };
- function d3_transposeLength(d) {
- return d.length;
- }
- d3.zip = function() {
- return d3.transpose(arguments);
- };
- d3.keys = function(map) {
- var keys = [];
- for (var key in map) keys.push(key);
- return keys;
- };
- d3.values = function(map) {
- var values = [];
- for (var key in map) values.push(map[key]);
- return values;
- };
- d3.entries = function(map) {
- var entries = [];
- for (var key in map) entries.push({
- key: key,
- value: map[key]
- });
- return entries;
- };
- d3.merge = function(arrays) {
- var n = arrays.length, m, i = -1, j = 0, merged, array;
- while (++i < n) j += arrays[i].length;
- merged = new Array(j);
- while (--n >= 0) {
- array = arrays[n];
- m = array.length;
- while (--m >= 0) {
- merged[--j] = array[m];
- }
- }
- return merged;
- };
- var abs = Math.abs;
- d3.range = function(start, stop, step) {
- if (arguments.length < 3) {
- step = 1;
- if (arguments.length < 2) {
- stop = start;
- start = 0;
- }
- }
- if ((stop - start) / step === Infinity) throw new Error("infinite range");
- var range = [], k = d3_range_integerScale(abs(step)), i = -1, j;
- start *= k, stop *= k, step *= k;
- if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k); else while ((j = start + step * ++i) < stop) range.push(j / k);
- return range;
- };
- function d3_range_integerScale(x) {
- var k = 1;
- while (x * k % 1) k *= 10;
- return k;
- }
- function d3_class(ctor, properties) {
- for (var key in properties) {
- Object.defineProperty(ctor.prototype, key, {
- value: properties[key],
- enumerable: false
- });
- }
- }
- d3.map = function(object, f) {
- var map = new d3_Map();
- if (object instanceof d3_Map) {
- object.forEach(function(key, value) {
- map.set(key, value);
- });
- } else if (Array.isArray(object)) {
- var i = -1, n = object.length, o;
- if (arguments.length === 1) while (++i < n) map.set(i, object[i]); else while (++i < n) map.set(f.call(object, o = object[i], i), o);
- } else {
- for (var key in object) map.set(key, object[key]);
- }
- return map;
- };
- function d3_Map() {
- this._ = Object.create(null);
- }
- var d3_map_proto = "__proto__", d3_map_zero = "\x00";
- d3_class(d3_Map, {
- has: d3_map_has,
- get: function(key) {
- return this._[d3_map_escape(key)];
- },
- set: function(key, value) {
- return this._[d3_map_escape(key)] = value;
- },
- remove: d3_map_remove,
- keys: d3_map_keys,
- values: function() {
- var values = [];
- for (var key in this._) values.push(this._[key]);
- return values;
- },
- entries: function() {
- var entries = [];
- for (var key in this._) entries.push({
- key: d3_map_unescape(key),
- value: this._[key]
- });
- return entries;
- },
- size: d3_map_size,
- empty: d3_map_empty,
- forEach: function(f) {
- for (var key in this._) f.call(this, d3_map_unescape(key), this._[key]);
- }
- });
- function d3_map_escape(key) {
- return (key += "") === d3_map_proto || key[0] === d3_map_zero ? d3_map_zero + key : key;
- }
- function d3_map_unescape(key) {
- return (key += "")[0] === d3_map_zero ? key.slice(1) : key;
- }
- function d3_map_has(key) {
- return d3_map_escape(key) in this._;
- }
- function d3_map_remove(key) {
- return (key = d3_map_escape(key)) in this._ && delete this._[key];
- }
- function d3_map_keys() {
- var keys = [];
- for (var key in this._) keys.push(d3_map_unescape(key));
- return keys;
- }
- function d3_map_size() {
- var size = 0;
- for (var key in this._) ++size;
- return size;
- }
- function d3_map_empty() {
- for (var key in this._) return false;
- return true;
- }
- d3.nest = function() {
- var nest = {}, keys = [], sortKeys = [], sortValues, rollup;
- function map(mapType, array, depth) {
- if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array;
- var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values;
- while (++i < n) {
- if (values = valuesByKey.get(keyValue = key(object = array[i]))) {
- values.push(object);
- } else {
- valuesByKey.set(keyValue, [ object ]);
- }
- }
- if (mapType) {
- object = mapType();
- setter = function(keyValue, values) {
- object.set(keyValue, map(mapType, values, depth));
- };
- } else {
- object = {};
- setter = function(keyValue, values) {
- object[keyValue] = map(mapType, values, depth);
- };
- }
- valuesByKey.forEach(setter);
- return object;
- }
- function entries(map, depth) {
- if (depth >= keys.length) return map;
- var array = [], sortKey = sortKeys[depth++];
- map.forEach(function(key, keyMap) {
- array.push({
- key: key,
- values: entries(keyMap, depth)
- });
- });
- return sortKey ? array.sort(function(a, b) {
- return sortKey(a.key, b.key);
- }) : array;
- }
- nest.map = function(array, mapType) {
- return map(mapType, array, 0);
- };
- nest.entries = function(array) {
- return entries(map(d3.map, array, 0), 0);
- };
- nest.key = function(d) {
- keys.push(d);
- return nest;
- };
- nest.sortKeys = function(order) {
- sortKeys[keys.length - 1] = order;
- return nest;
- };
- nest.sortValues = function(order) {
- sortValues = order;
- return nest;
- };
- nest.rollup = function(f) {
- rollup = f;
- return nest;
- };
- return nest;
- };
- d3.set = function(array) {
- var set = new d3_Set();
- if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]);
- return set;
- };
- function d3_Set() {
- this._ = Object.create(null);
- }
- d3_class(d3_Set, {
- has: d3_map_has,
- add: function(key) {
- this._[d3_map_escape(key += "")] = true;
- return key;
- },
- remove: d3_map_remove,
- values: d3_map_keys,
- size: d3_map_size,
- empty: d3_map_empty,
- forEach: function(f) {
- for (var key in this._) f.call(this, d3_map_unescape(key));
- }
- });
- d3.behavior = {};
- function d3_identity(d) {
- return d;
- }
- d3.rebind = function(target, source) {
- var i = 1, n = arguments.length, method;
- while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]);
- return target;
- };
- function d3_rebind(target, source, method) {
- return function() {
- var value = method.apply(source, arguments);
- return value === source ? target : value;
- };
- }
- function d3_vendorSymbol(object, name) {
- if (name in object) return name;
- name = name.charAt(0).toUpperCase() + name.slice(1);
- for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) {
- var prefixName = d3_vendorPrefixes[i] + name;
- if (prefixName in object) return prefixName;
- }
- }
- var d3_vendorPrefixes = [ "webkit", "ms", "moz", "Moz", "o", "O" ];
- function d3_noop() {}
- d3.dispatch = function() {
- var dispatch = new d3_dispatch(), i = -1, n = arguments.length;
- while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
- return dispatch;
- };
- function d3_dispatch() {}
- d3_dispatch.prototype.on = function(type, listener) {
- var i = type.indexOf("."), name = "";
- if (i >= 0) {
- name = type.slice(i + 1);
- type = type.slice(0, i);
- }
- if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener);
- if (arguments.length === 2) {
- if (listener == null) for (type in this) {
- if (this.hasOwnProperty(type)) this[type].on(name, null);
- }
- return this;
- }
- };
- function d3_dispatch_event(dispatch) {
- var listeners = [], listenerByName = new d3_Map();
- function event() {
- var z = listeners, i = -1, n = z.length, l;
- while (++i < n) if (l = z[i].on) l.apply(this, arguments);
- return dispatch;
- }
- event.on = function(name, listener) {
- var l = listenerByName.get(name), i;
- if (arguments.length < 2) return l && l.on;
- if (l) {
- l.on = null;
- listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1));
- listenerByName.remove(name);
- }
- if (listener) listeners.push(listenerByName.set(name, {
- on: listener
- }));
- return dispatch;
- };
- return event;
- }
- d3.event = null;
- function d3_eventPreventDefault() {
- d3.event.preventDefault();
- }
- function d3_eventSource() {
- var e = d3.event, s;
- while (s = e.sourceEvent) e = s;
- return e;
- }
- function d3_eventDispatch(target) {
- var dispatch = new d3_dispatch(), i = 0, n = arguments.length;
- while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
- dispatch.of = function(thiz, argumentz) {
- return function(e1) {
- try {
- var e0 = e1.sourceEvent = d3.event;
- e1.target = target;
- d3.event = e1;
- dispatch[e1.type].apply(thiz, argumentz);
- } finally {
- d3.event = e0;
- }
- };
- };
- return dispatch;
- }
- d3.requote = function(s) {
- return s.replace(d3_requote_re, "\\$&");
- };
- var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
- var d3_subclass = {}.__proto__ ? function(object, prototype) {
- object.__proto__ = prototype;
- } : function(object, prototype) {
- for (var property in prototype) object[property] = prototype[property];
- };
- function d3_selection(groups) {
- d3_subclass(groups, d3_selectionPrototype);
- return groups;
- }
- var d3_select = function(s, n) {
- return n.querySelector(s);
- }, d3_selectAll = function(s, n) {
- return n.querySelectorAll(s);
- }, d3_selectMatches = function(n, s) {
- var d3_selectMatcher = n.matches || n[d3_vendorSymbol(n, "matchesSelector")];
- d3_selectMatches = function(n, s) {
- return d3_selectMatcher.call(n, s);
- };
- return d3_selectMatches(n, s);
- };
- if (typeof Sizzle === "function") {
- d3_select = function(s, n) {
- return Sizzle(s, n)[0] || null;
- };
- d3_selectAll = Sizzle;
- d3_selectMatches = Sizzle.matchesSelector;
- }
- d3.selection = function() {
- return d3.select(d3_document.documentElement);
- };
- var d3_selectionPrototype = d3.selection.prototype = [];
- d3_selectionPrototype.select = function(selector) {
- var subgroups = [], subgroup, subnode, group, node;
- selector = d3_selection_selector(selector);
- for (var j = -1, m = this.length; ++j < m; ) {
- subgroups.push(subgroup = []);
- subgroup.parentNode = (group = this[j]).parentNode;
- for (var i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) {
- subgroup.push(subnode = selector.call(node, node.__data__, i, j));
- if (subnode && "__data__" in node) subnode.__data__ = node.__data__;
- } else {
- subgroup.push(null);
- }
- }
- }
- return d3_selection(subgroups);
- };
- function d3_selection_selector(selector) {
- return typeof selector === "function" ? selector : function() {
- return d3_select(selector, this);
- };
- }
- d3_selectionPrototype.selectAll = function(selector) {
- var subgroups = [], subgroup, node;
- selector = d3_selection_selectorAll(selector);
- for (var j = -1, m = this.length; ++j < m; ) {
- for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) {
- subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j)));
- subgroup.parentNode = node;
- }
- }
- }
- return d3_selection(subgroups);
- };
- function d3_selection_selectorAll(selector) {
- return typeof selector === "function" ? selector : function() {
- return d3_selectAll(selector, this);
- };
- }
- var d3_nsXhtml = "http://www.w3.org/1999/xhtml";
- var d3_nsPrefix = {
- svg: "http://www.w3.org/2000/svg",
- xhtml: d3_nsXhtml,
- xlink: "http://www.w3.org/1999/xlink",
- xml: "http://www.w3.org/XML/1998/namespace",
- xmlns: "http://www.w3.org/2000/xmlns/"
- };
- d3.ns = {
- prefix: d3_nsPrefix,
- qualify: function(name) {
- var i = name.indexOf(":"), prefix = name;
- if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
- return d3_nsPrefix.hasOwnProperty(prefix) ? {
- space: d3_nsPrefix[prefix],
- local: name
- } : name;
- }
- };
- d3_selectionPrototype.attr = function(name, value) {
- if (arguments.length < 2) {
- if (typeof name === "string") {
- var node = this.node();
- name = d3.ns.qualify(name);
- return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name);
- }
- for (value in name) this.each(d3_selection_attr(value, name[value]));
- return this;
- }
- return this.each(d3_selection_attr(name, value));
- };
- function d3_selection_attr(name, value) {
- name = d3.ns.qualify(name);
- function attrNull() {
- this.removeAttribute(name);
- }
- function attrNullNS() {
- this.removeAttributeNS(name.space, name.local);
- }
- function attrConstant() {
- this.setAttribute(name, value);
- }
- function attrConstantNS() {
- this.setAttributeNS(name.space, name.local, value);
- }
- function attrFunction() {
- var x = value.apply(this, arguments);
- if (x == null) this.removeAttribute(name); else this.setAttribute(name, x);
- }
- function attrFunctionNS() {
- var x = value.apply(this, arguments);
- if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x);
- }
- return value == null ? name.local ? attrNullNS : attrNull : typeof value === "function" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant;
- }
- function d3_collapse(s) {
- return s.trim().replace(/\s+/g, " ");
- }
- d3_selectionPrototype.classed = function(name, value) {
- if (arguments.length < 2) {
- if (typeof name === "string") {
- var node = this.node(), n = (name = d3_selection_classes(name)).length, i = -1;
- if (value = node.classList) {
- while (++i < n) if (!value.contains(name[i])) return false;
- } else {
- value = node.getAttribute("class");
- while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false;
- }
- return true;
- }
- for (value in name) this.each(d3_selection_classed(value, name[value]));
- return this;
- }
- return this.each(d3_selection_classed(name, value));
- };
- function d3_selection_classedRe(name) {
- return new RegExp("(?:^|\\s+)" + d3.requote(name) + "(?:\\s+|$)", "g");
- }
- function d3_selection_classes(name) {
- return (name + "").trim().split(/^|\s+/);
- }
- function d3_selection_classed(name, value) {
- name = d3_selection_classes(name).map(d3_selection_classedName);
- var n = name.length;
- function classedConstant() {
- var i = -1;
- while (++i < n) name[i](this, value);
- }
- function classedFunction() {
- var i = -1, x = value.apply(this, arguments);
- while (++i < n) name[i](this, x);
- }
- return typeof value === "function" ? classedFunction : classedConstant;
- }
- function d3_selection_classedName(name) {
- var re = d3_selection_classedRe(name);
- return function(node, value) {
- if (c = node.classList) return value ? c.add(name) : c.remove(name);
- var c = node.getAttribute("class") || "";
- if (value) {
- re.lastIndex = 0;
- if (!re.test(c)) node.setAttribute("class", d3_collapse(c + " " + name));
- } else {
- node.setAttribute("class", d3_collapse(c.replace(re, " ")));
- }
- };
- }
- d3_selectionPrototype.style = function(name, value, priority) {
- var n = arguments.length;
- if (n < 3) {
- if (typeof name !== "string") {
- if (n < 2) value = "";
- for (priority in name) this.each(d3_selection_style(priority, name[priority], value));
- return this;
- }
- if (n < 2) {
- var node = this.node();
- return d3_window(node).getComputedStyle(node, null).getPropertyValue(name);
- }
- priority = "";
- }
- return this.each(d3_selection_style(name, value, priority));
- };
- function d3_selection_style(name, value, priority) {
- function styleNull() {
- this.style.removeProperty(name);
- }
- function styleConstant() {
- this.style.setProperty(name, value, priority);
- }
- function styleFunction() {
- var x = value.apply(this, arguments);
- if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority);
- }
- return value == null ? styleNull : typeof value === "function" ? styleFunction : styleConstant;
- }
- d3_selectionPrototype.property = function(name, value) {
- if (arguments.length < 2) {
- if (typeof name === "string") return this.node()[name];
- for (value in name) this.each(d3_selection_property(value, name[value]));
- return this;
- }
- return this.each(d3_selection_property(name, value));
- };
- function d3_selection_property(name, value) {
- function propertyNull() {
- delete this[name];
- }
- function propertyConstant() {
- this[name] = value;
- }
- function propertyFunction() {
- var x = value.apply(this, arguments);
- if (x == null) delete this[name]; else this[name] = x;
- }
- return value == null ? propertyNull : typeof value === "function" ? propertyFunction : propertyConstant;
- }
- d3_selectionPrototype.text = function(value) {
- return arguments.length ? this.each(typeof value === "function" ? function() {
- var v = value.apply(this, arguments);
- this.textContent = v == null ? "" : v;
- } : value == null ? function() {
- this.textContent = "";
- } : function() {
- this.textContent = value;
- }) : this.node().textContent;
- };
- d3_selectionPrototype.html = function(value) {
- return arguments.length ? this.each(typeof value === "function" ? function() {
- var v = value.apply(this, arguments);
- this.innerHTML = v == null ? "" : v;
- } : value == null ? function() {
- this.innerHTML = "";
- } : function() {
- this.innerHTML = value;
- }) : this.node().innerHTML;
- };
- d3_selectionPrototype.append = function(name) {
- name = d3_selection_creator(name);
- return this.select(function() {
- return this.appendChild(name.apply(this, arguments));
- });
- };
- function d3_selection_creator(name) {
- function create() {
- var document = this.ownerDocument, namespace = this.namespaceURI;
- return namespace === d3_nsXhtml && document.documentElement.namespaceURI === d3_nsXhtml ? document.createElement(name) : document.createElementNS(namespace, name);
- }
- function createNS() {
- return this.ownerDocument.createElementNS(name.space, name.local);
- }
- return typeof name === "function" ? name : (name = d3.ns.qualify(name)).local ? createNS : create;
- }
- d3_selectionPrototype.insert = function(name, before) {
- name = d3_selection_creator(name);
- before = d3_selection_selector(before);
- return this.select(function() {
- return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments) || null);
- });
- };
- d3_selectionPrototype.remove = function() {
- return this.each(d3_selectionRemove);
- };
- function d3_selectionRemove() {
- var parent = this.parentNode;
- if (parent) parent.removeChild(this);
- }
- d3_selectionPrototype.data = function(value, key) {
- var i = -1, n = this.length, group, node;
- if (!arguments.length) {
- value = new Array(n = (group = this[0]).length);
- while (++i < n) {
- if (node = group[i]) {
- value[i] = node.__data__;
- }
- }
- return value;
- }
- function bind(group, groupData) {
- var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData;
- if (key) {
- var nodeByKeyValue = new d3_Map(), keyValues = new Array(n), keyValue;
- for (i = -1; ++i < n; ) {
- if (node = group[i]) {
- if (nodeByKeyValue.has(keyValue = key.call(node, node.__data__, i))) {
- exitNodes[i] = node;
- } else {
- nodeByKeyValue.set(keyValue, node);
- }
- keyValues[i] = keyValue;
- }
- }
- for (i = -1; ++i < m; ) {
- if (!(node = nodeByKeyValue.get(keyValue = key.call(groupData, nodeData = groupData[i], i)))) {
- enterNodes[i] = d3_selection_dataNode(nodeData);
- } else if (node !== true) {
- updateNodes[i] = node;
- node.__data__ = nodeData;
- }
- nodeByKeyValue.set(keyValue, true);
- }
- for (i = -1; ++i < n; ) {
- if (i in keyValues && nodeByKeyValue.get(keyValues[i]) !== true) {
- exitNodes[i] = group[i];
- }
- }
- } else {
- for (i = -1; ++i < n0; ) {
- node = group[i];
- nodeData = groupData[i];
- if (node) {
- node.__data__ = nodeData;
- updateNodes[i] = node;
- } else {
- enterNodes[i] = d3_selection_dataNode(nodeData);
- }
- }
- for (;i < m; ++i) {
- enterNodes[i] = d3_selection_dataNode(groupData[i]);
- }
- for (;i < n; ++i) {
- exitNodes[i] = group[i];
- }
- }
- enterNodes.update = updateNodes;
- enterNodes.parentNode = updateNodes.parentNode = exitNodes.parentNode = group.parentNode;
- enter.push(enterNodes);
- update.push(updateNodes);
- exit.push(exitNodes);
- }
- var enter = d3_selection_enter([]), update = d3_selection([]), exit = d3_selection([]);
- if (typeof value === "function") {
- while (++i < n) {
- bind(group = this[i], value.call(group, group.parentNode.__data__, i));
- }
- } else {
- while (++i < n) {
- bind(group = this[i], value);
- }
- }
- update.enter = function() {
- return enter;
- };
- update.exit = function() {
- return exit;
- };
- return update;
- };
- function d3_selection_dataNode(data) {
- return {
- __data__: data
- };
- }
- d3_selectionPrototype.datum = function(value) {
- return arguments.length ? this.property("__data__", value) : this.property("__data__");
- };
- d3_selectionPrototype.filter = function(filter) {
- var subgroups = [], subgroup, group, node;
- if (typeof filter !== "function") filter = d3_selection_filter(filter);
- for (var j = 0, m = this.length; j < m; j++) {
- subgroups.push(subgroup = []);
- subgroup.parentNode = (group = this[j]).parentNode;
- for (var i = 0, n = group.length; i < n; i++) {
- if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {
- subgroup.push(node);
- }
- }
- }
- return d3_selection(subgroups);
- };
- function d3_selection_filter(selector) {
- return function() {
- return d3_selectMatches(this, selector);
- };
- }
- d3_selectionPrototype.order = function() {
- for (var j = -1, m = this.length; ++j < m; ) {
- for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0; ) {
- if (node = group[i]) {
- if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next);
- next = node;
- }
- }
- }
- return this;
- };
- d3_selectionPrototype.sort = function(comparator) {
- comparator = d3_selection_sortComparator.apply(this, arguments);
- for (var j = -1, m = this.length; ++j < m; ) this[j].sort(comparator);
- return this.order();
- };
- function d3_selection_sortComparator(comparator) {
- if (!arguments.length) comparator = d3_ascending;
- return function(a, b) {
- return a && b ? comparator(a.__data__, b.__data__) : !a - !b;
- };
- }
- d3_selectionPrototype.each = function(callback) {
- return d3_selection_each(this, function(node, i, j) {
- callback.call(node, node.__data__, i, j);
- });
- };
- function d3_selection_each(groups, callback) {
- for (var j = 0, m = groups.length; j < m; j++) {
- for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) {
- if (node = group[i]) callback(node, i, j);
- }
- }
- return groups;
- }
- d3_selectionPrototype.call = function(callback) {
- var args = d3_array(arguments);
- callback.apply(args[0] = this, args);
- return this;
- };
- d3_selectionPrototype.empty = function() {
- return !this.node();
- };
- d3_selectionPrototype.node = function() {
- for (var j = 0, m = this.length; j < m; j++) {
- for (var group = this[j], i = 0, n = group.length; i < n; i++) {
- var node = group[i];
- if (node) return node;
- }
- }
- return null;
- };
- d3_selectionPrototype.size = function() {
- var n = 0;
- d3_selection_each(this, function() {
- ++n;
- });
- return n;
- };
- function d3_selection_enter(selection) {
- d3_subclass(selection, d3_selection_enterPrototype);
- return selection;
- }
- var d3_selection_enterPrototype = [];
- d3.selection.enter = d3_selection_enter;
- d3.selection.enter.prototype = d3_selection_enterPrototype;
- d3_selection_enterPrototype.append = d3_selectionPrototype.append;
- d3_selection_enterPrototype.empty = d3_selectionPrototype.empty;
- d3_selection_enterPrototype.node = d3_selectionPrototype.node;
- d3_selection_enterPrototype.call = d3_selectionPrototype.call;
- d3_selection_enterPrototype.size = d3_selectionPrototype.size;
- d3_selection_enterPrototype.select = function(selector) {
- var subgroups = [], subgroup, subnode, upgroup, group, node;
- for (var j = -1, m = this.length; ++j < m; ) {
- upgroup = (group = this[j]).update;
- subgroups.push(subgroup = []);
- subgroup.parentNode = group.parentNode;
- for (var i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) {
- subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i, j));
- subnode.__data__ = node.__data__;
- } else {
- subgroup.push(null);
- }
- }
- }
- return d3_selection(subgroups);
- };
- d3_selection_enterPrototype.insert = function(name, before) {
- if (arguments.length < 2) before = d3_selection_enterInsertBefore(this);
- return d3_selectionPrototype.insert.call(this, name, before);
- };
- function d3_selection_enterInsertBefore(enter) {
- var i0, j0;
- return function(d, i, j) {
- var group = enter[j].update, n = group.length, node;
- if (j != j0) j0 = j, i0 = 0;
- if (i >= i0) i0 = i + 1;
- while (!(node = group[i0]) && ++i0 < n) ;
- return node;
- };
- }
- d3.select = function(node) {
- var group;
- if (typeof node === "string") {
- group = [ d3_select(node, d3_document) ];
- group.parentNode = d3_document.documentElement;
- } else {
- group = [ node ];
- group.parentNode = d3_documentElement(node);
- }
- return d3_selection([ group ]);
- };
- d3.selectAll = function(nodes) {
- var group;
- if (typeof nodes === "string") {
- group = d3_array(d3_selectAll(nodes, d3_document));
- group.parentNode = d3_document.documentElement;
- } else {
- group = d3_array(nodes);
- group.parentNode = null;
- }
- return d3_selection([ group ]);
- };
- d3_selectionPrototype.on = function(type, listener, capture) {
- var n = arguments.length;
- if (n < 3) {
- if (typeof type !== "string") {
- if (n < 2) listener = false;
- for (capture in type) this.each(d3_selection_on(capture, type[capture], listener));
- return this;
- }
- if (n < 2) return (n = this.node()["__on" + type]) && n._;
- capture = false;
- }
- return this.each(d3_selection_on(type, listener, capture));
- };
- function d3_selection_on(type, listener, capture) {
- var name = "__on" + type, i = type.indexOf("."), wrap = d3_selection_onListener;
- if (i > 0) type = type.slice(0, i);
- var filter = d3_selection_onFilters.get(type);
- if (filter) type = filter, wrap = d3_selection_onFilter;
- function onRemove() {
- var l = this[name];
- if (l) {
- this.removeEventListener(type, l, l.$);
- delete this[name];
- }
- }
- function onAdd() {
- var l = wrap(listener, d3_array(arguments));
- onRemove.call(this);
- this.addEventListener(type, this[name] = l, l.$ = capture);
- l._ = listener;
- }
- function removeAll() {
- var re = new RegExp("^__on([^.]+)" + d3.requote(type) + "$"), match;
- for (var name in this) {
- if (match = name.match(re)) {
- var l = this[name];
- this.removeEventListener(match[1], l, l.$);
- delete this[name];
- }
- }
- }
- return i ? listener ? onAdd : onRemove : listener ? d3_noop : removeAll;
- }
- var d3_selection_onFilters = d3.map({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
- });
- if (d3_document) {
- d3_selection_onFilters.forEach(function(k) {
- if ("on" + k in d3_document) d3_selection_onFilters.remove(k);
- });
- }
- function d3_selection_onListener(listener, argumentz) {
- return function(e) {
- var o = d3.event;
- d3.event = e;
- argumentz[0] = this.__data__;
- try {
- listener.apply(this, argumentz);
- } finally {
- d3.event = o;
- }
- };
- }
- function d3_selection_onFilter(listener, argumentz) {
- var l = d3_selection_onListener(listener, argumentz);
- return function(e) {
- var target = this, related = e.relatedTarget;
- if (!related || related !== target && !(related.compareDocumentPosition(target) & 8)) {
- l.call(target, e);
- }
- };
- }
- var d3_event_dragSelect, d3_event_dragId = 0;
- function d3_event_dragSuppress(node) {
- var name = ".dragsuppress-" + ++d3_event_dragId, click = "click" + name, w = d3.select(d3_window(node)).on("touchmove" + name, d3_eventPreventDefault).on("dragstart" + name, d3_eventPreventDefault).on("selectstart" + name, d3_eventPreventDefault);
- if (d3_event_dragSelect == null) {
- d3_event_dragSelect = "onselectstart" in node ? false : d3_vendorSymbol(node.style, "userSelect");
- }
- if (d3_event_dragSelect) {
- var style = d3_documentElement(node).style, select = style[d3_event_dragSelect];
- style[d3_event_dragSelect] = "none";
- }
- return function(suppressClick) {
- w.on(name, null);
- if (d3_event_dragSelect) style[d3_event_dragSelect] = select;
- if (suppressClick) {
- var off = function() {
- w.on(click, null);
- };
- w.on(click, function() {
- d3_eventPreventDefault();
- off();
- }, true);
- setTimeout(off, 0);
- }
- };
- }
- d3.mouse = function(container) {
- return d3_mousePoint(container, d3_eventSource());
- };
- var d3_mouse_bug44083 = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0;
- function d3_mousePoint(container, e) {
- if (e.changedTouches) e = e.changedTouches[0];
- var svg = container.ownerSVGElement || container;
- if (svg.createSVGPoint) {
- var point = svg.createSVGPoint();
- if (d3_mouse_bug44083 < 0) {
- var window = d3_window(container);
- if (window.scrollX || window.scrollY) {
- svg = d3.select("body").append("svg").style({
- position: "absolute",
- top: 0,
- left: 0,
- margin: 0,
- padding: 0,
- border: "none"
- }, "important");
- var ctm = svg[0][0].getScreenCTM();
- d3_mouse_bug44083 = !(ctm.f || ctm.e);
- svg.remove();
- }
- }
- if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX,
- point.y = e.clientY;
- point = point.matrixTransform(container.getScreenCTM().inverse());
- return [ point.x, point.y ];
- }
- var rect = container.getBoundingClientRect();
- return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ];
- }
- d3.touch = function(container, touches, identifier) {
- if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches;
- if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) {
- if ((touch = touches[i]).identifier === identifier) {
- return d3_mousePoint(container, touch);
- }
- }
- };
- d3.behavior.drag = function() {
- var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_window, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_identity, "touchmove", "touchend");
- function drag() {
- this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart);
- }
- function dragstart(id, position, subject, move, end) {
- return function() {
- var that = this, target = d3.event.target.correspondingElement || d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject(target)).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(target), position0 = position(parent, dragId);
- if (origin) {
- dragOffset = origin.apply(that, arguments);
- dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ];
- } else {
- dragOffset = [ 0, 0 ];
- }
- dispatch({
- type: "dragstart"
- });
- function moved() {
- var position1 = position(parent, dragId), dx, dy;
- if (!position1) return;
- dx = position1[0] - position0[0];
- dy = position1[1] - position0[1];
- dragged |= dx | dy;
- position0 = position1;
- dispatch({
- type: "drag",
- x: position1[0] + dragOffset[0],
- y: position1[1] + dragOffset[1],
- dx: dx,
- dy: dy
- });
- }
- function ended() {
- if (!position(parent, dragId)) return;
- dragSubject.on(move + dragName, null).on(end + dragName, null);
- dragRestore(dragged);
- dispatch({
- type: "dragend"
- });
- }
- };
- }
- drag.origin = function(x) {
- if (!arguments.length) return origin;
- origin = x;
- return drag;
- };
- return d3.rebind(drag, event, "on");
- };
- function d3_behavior_dragTouchId() {
- return d3.event.changedTouches[0].identifier;
- }
- d3.touches = function(container, touches) {
- if (arguments.length < 2) touches = d3_eventSource().touches;
- return touches ? d3_array(touches).map(function(touch) {
- var point = d3_mousePoint(container, touch);
- point.identifier = touch.identifier;
- return point;
- }) : [];
- };
- var ε = 1e-6, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π;
- function d3_sgn(x) {
- return x > 0 ? 1 : x < 0 ? -1 : 0;
- }
- function d3_cross2d(a, b, c) {
- return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
- }
- function d3_acos(x) {
- return x > 1 ? 0 : x < -1 ? π : Math.acos(x);
- }
- function d3_asin(x) {
- return x > 1 ? halfπ : x < -1 ? -halfπ : Math.asin(x);
- }
- function d3_sinh(x) {
- return ((x = Math.exp(x)) - 1 / x) / 2;
- }
- function d3_cosh(x) {
- return ((x = Math.exp(x)) + 1 / x) / 2;
- }
- function d3_tanh(x) {
- return ((x = Math.exp(2 * x)) - 1) / (x + 1);
- }
- function d3_haversin(x) {
- return (x = Math.sin(x / 2)) * x;
- }
- var ρ = Math.SQRT2, ρ2 = 2, ρ4 = 4;
- d3.interpolateZoom = function(p0, p1) {
- var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2], dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, i, S;
- if (d2 < ε2) {
- S = Math.log(w1 / w0) / ρ;
- i = function(t) {
- return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(ρ * t * S) ];
- };
- } else {
- var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + ρ4 * d2) / (2 * w0 * ρ2 * d1), b1 = (w1 * w1 - w0 * w0 - ρ4 * d2) / (2 * w1 * ρ2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
- S = (r1 - r0) / ρ;
- i = function(t) {
- var s = t * S, coshr0 = d3_cosh(r0), u = w0 / (ρ2 * d1) * (coshr0 * d3_tanh(ρ * s + r0) - d3_sinh(r0));
- return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / d3_cosh(ρ * s + r0) ];
- };
- }
- i.duration = S * 1e3;
- return i;
- };
- d3.behavior.zoom = function() {
- var view = {
- x: 0,
- y: 0,
- k: 1
- }, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, duration = 250, zooming = 0, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", mousewheelTimer, touchstart = "touchstart.zoom", touchtime, event = d3_eventDispatch(zoom, "zoomstart", "zoom", "zoomend"), x0, x1, y0, y1;
- if (!d3_behavior_zoomWheel) {
- d3_behavior_zoomWheel = "onwheel" in d3_document ? (d3_behavior_zoomDelta = function() {
- return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1);
- }, "wheel") : "onmousewheel" in d3_document ? (d3_behavior_zoomDelta = function() {
- return d3.event.wheelDelta;
- }, "mousewheel") : (d3_behavior_zoomDelta = function() {
- return -d3.event.detail;
- }, "MozMousePixelScroll");
- }
- function zoom(g) {
- g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted);
- }
- zoom.event = function(g) {
- g.each(function() {
- var dispatch = event.of(this, arguments), view1 = view;
- if (d3_transitionInheritId) {
- d3.select(this).transition().each("start.zoom", function() {
- view = this.__chart__ || {
- x: 0,
- y: 0,
- k: 1
- };
- zoomstarted(dispatch);
- }).tween("zoom:zoom", function() {
- var dx = size[0], dy = size[1], cx = center0 ? center0[0] : dx / 2, cy = center0 ? center0[1] : dy / 2, i = d3.interpolateZoom([ (cx - view.x) / view.k, (cy - view.y) / view.k, dx / view.k ], [ (cx - view1.x) / view1.k, (cy - view1.y) / view1.k, dx / view1.k ]);
- return function(t) {
- var l = i(t), k = dx / l[2];
- this.__chart__ = view = {
- x: cx - l[0] * k,
- y: cy - l[1] * k,
- k: k
- };
- zoomed(dispatch);
- };
- }).each("interrupt.zoom", function() {
- zoomended(dispatch);
- }).each("end.zoom", function() {
- zoomended(dispatch);
- });
- } else {
- this.__chart__ = view;
- zoomstarted(dispatch);
- zoomed(dispatch);
- zoomended(dispatch);
- }
- });
- };
- zoom.translate = function(_) {
- if (!arguments.length) return [ view.x, view.y ];
- view = {
- x: +_[0],
- y: +_[1],
- k: view.k
- };
- rescale();
- return zoom;
- };
- zoom.scale = function(_) {
- if (!arguments.length) return view.k;
- view = {
- x: view.x,
- y: view.y,
- k: null
- };
- scaleTo(+_);
- rescale();
- return zoom;
- };
- zoom.scaleExtent = function(_) {
- if (!arguments.length) return scaleExtent;
- scaleExtent = _ == null ? d3_behavior_zoomInfinity : [ +_[0], +_[1] ];
- return zoom;
- };
- zoom.center = function(_) {
- if (!arguments.length) return center;
- center = _ && [ +_[0], +_[1] ];
- return zoom;
- };
- zoom.size = function(_) {
- if (!arguments.length) return size;
- size = _ && [ +_[0], +_[1] ];
- return zoom;
- };
- zoom.duration = function(_) {
- if (!arguments.length) return duration;
- duration = +_;
- return zoom;
- };
- zoom.x = function(z) {
- if (!arguments.length) return x1;
- x1 = z;
- x0 = z.copy();
- view = {
- x: 0,
- y: 0,
- k: 1
- };
- return zoom;
- };
- zoom.y = function(z) {
- if (!arguments.length) return y1;
- y1 = z;
- y0 = z.copy();
- view = {
- x: 0,
- y: 0,
- k: 1
- };
- return zoom;
- };
- function location(p) {
- return [ (p[0] - view.x) / view.k, (p[1] - view.y) / view.k ];
- }
- function point(l) {
- return [ l[0] * view.k + view.x, l[1] * view.k + view.y ];
- }
- function scaleTo(s) {
- view.k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], s));
- }
- function translateTo(p, l) {
- l = point(l);
- view.x += p[0] - l[0];
- view.y += p[1] - l[1];
- }
- function zoomTo(that, p, l, k) {
- that.__chart__ = {
- x: view.x,
- y: view.y,
- k: view.k
- };
- scaleTo(Math.pow(2, k));
- translateTo(center0 = p, l);
- that = d3.select(that);
- if (duration > 0) that = that.transition().duration(duration);
- that.call(zoom.event);
- }
- function rescale() {
- if (x1) x1.domain(x0.range().map(function(x) {
- return (x - view.x) / view.k;
- }).map(x0.invert));
- if (y1) y1.domain(y0.range().map(function(y) {
- return (y - view.y) / view.k;
- }).map(y0.invert));
- }
- function zoomstarted(dispatch) {
- if (!zooming++) dispatch({
- type: "zoomstart"
- });
- }
- function zoomed(dispatch) {
- rescale();
- dispatch({
- type: "zoom",
- scale: view.k,
- translate: [ view.x, view.y ]
- });
- }
- function zoomended(dispatch) {
- if (!--zooming) dispatch({
- type: "zoomend"
- }), center0 = null;
- }
- function mousedowned() {
- var that = this, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window(that)).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress(that);
- d3_selection_interrupt.call(that);
- zoomstarted(dispatch);
- function moved() {
- dragged = 1;
- translateTo(d3.mouse(that), location0);
- zoomed(dispatch);
- }
- function ended() {
- subject.on(mousemove, null).on(mouseup, null);
- dragRestore(dragged);
- zoomended(dispatch);
- }
- }
- function touchstarted() {
- var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = ".zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove" + zoomName, touchend = "touchend" + zoomName, targets = [], subject = d3.select(that), dragRestore = d3_event_dragSuppress(that);
- started();
- zoomstarted(dispatch);
- subject.on(mousedown, null).on(touchstart, started);
- function relocate() {
- var touches = d3.touches(that);
- scale0 = view.k;
- touches.forEach(function(t) {
- if (t.identifier in locations0) locations0[t.identifier] = location(t);
- });
- return touches;
- }
- function started() {
- var target = d3.event.target;
- d3.select(target).on(touchmove, moved).on(touchend, ended);
- targets.push(target);
- var changed = d3.event.changedTouches;
- for (var i = 0, n = changed.length; i < n; ++i) {
- locations0[changed[i].identifier] = null;
- }
- var touches = relocate(), now = Date.now();
- if (touches.length === 1) {
- if (now - touchtime < 500) {
- var p = touches[0];
- zoomTo(that, p, locations0[p.identifier], Math.floor(Math.log(view.k) / Math.LN2) + 1);
- d3_eventPreventDefault();
- }
- touchtime = now;
- } else if (touches.length > 1) {
- var p = touches[0], q = touches[1], dx = p[0] - q[0], dy = p[1] - q[1];
- distance0 = dx * dx + dy * dy;
- }
- }
- function moved() {
- var touches = d3.touches(that), p0, l0, p1, l1;
- d3_selection_interrupt.call(that);
- for (var i = 0, n = touches.length; i < n; ++i, l1 = null) {
- p1 = touches[i];
- if (l1 = locations0[p1.identifier]) {
- if (l0) break;
- p0 = p1, l0 = l1;
- }
- }
- if (l1) {
- var distance1 = (distance1 = p1[0] - p0[0]) * distance1 + (distance1 = p1[1] - p0[1]) * distance1, scale1 = distance0 && Math.sqrt(distance1 / distance0);
- p0 = [ (p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2 ];
- l0 = [ (l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2 ];
- scaleTo(scale1 * scale0);
- }
- touchtime = null;
- translateTo(p0, l0);
- zoomed(dispatch);
- }
- function ended() {
- if (d3.event.touches.length) {
- var changed = d3.event.changedTouches;
- for (var i = 0, n = changed.length; i < n; ++i) {
- delete locations0[changed[i].identifier];
- }
- for (var identifier in locations0) {
- return void relocate();
- }
- }
- d3.selectAll(targets).on(zoomName, null);
- subject.on(mousedown, mousedowned).on(touchstart, touchstarted);
- dragRestore();
- zoomended(dispatch);
- }
- }
- function mousewheeled() {
- var dispatch = event.of(this, arguments);
- if (mousewheelTimer) clearTimeout(mousewheelTimer); else d3_selection_interrupt.call(this),
- translate0 = location(center0 = center || d3.mouse(this)), zoomstarted(dispatch);
- mousewheelTimer = setTimeout(function() {
- mousewheelTimer = null;
- zoomended(dispatch);
- }, 50);
- d3_eventPreventDefault();
- scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k);
- translateTo(center0, translate0);
- zoomed(dispatch);
- }
- function dblclicked() {
- var p = d3.mouse(this), k = Math.log(view.k) / Math.LN2;
- zoomTo(this, p, location(p), d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1);
- }
- return d3.rebind(zoom, event, "on");
- };
- var d3_behavior_zoomInfinity = [ 0, Infinity ], d3_behavior_zoomDelta, d3_behavior_zoomWheel;
- d3.color = d3_color;
- function d3_color() {}
- d3_color.prototype.toString = function() {
- return this.rgb() + "";
- };
- d3.hsl = d3_hsl;
- function d3_hsl(h, s, l) {
- return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : new d3_hsl(h, s, l);
- }
- var d3_hslPrototype = d3_hsl.prototype = new d3_color();
- d3_hslPrototype.brighter = function(k) {
- k = Math.pow(.7, arguments.length ? k : 1);
- return new d3_hsl(this.h, this.s, this.l / k);
- };
- d3_hslPrototype.darker = function(k) {
- k = Math.pow(.7, arguments.length ? k : 1);
- return new d3_hsl(this.h, this.s, k * this.l);
- };
- d3_hslPrototype.rgb = function() {
- return d3_hsl_rgb(this.h, this.s, this.l);
- };
- function d3_hsl_rgb(h, s, l) {
- var m1, m2;
- h = isNaN(h) ? 0 : (h %= 360) < 0 ? h + 360 : h;
- s = isNaN(s) ? 0 : s < 0 ? 0 : s > 1 ? 1 : s;
- l = l < 0 ? 0 : l > 1 ? 1 : l;
- m2 = l <= .5 ? l * (1 + s) : l + s - l * s;
- m1 = 2 * l - m2;
- function v(h) {
- if (h > 360) h -= 360; else if (h < 0) h += 360;
- if (h < 60) return m1 + (m2 - m1) * h / 60;
- if (h < 180) return m2;
- if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60;
- return m1;
- }
- function vv(h) {
- return Math.round(v(h) * 255);
- }
- return new d3_rgb(vv(h + 120), vv(h), vv(h - 120));
- }
- d3.hcl = d3_hcl;
- function d3_hcl(h, c, l) {
- return this instanceof d3_hcl ? void (this.h = +h, this.c = +c, this.l = +l) : arguments.length < 2 ? h instanceof d3_hcl ? new d3_hcl(h.h, h.c, h.l) : h instanceof d3_lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : new d3_hcl(h, c, l);
- }
- var d3_hclPrototype = d3_hcl.prototype = new d3_color();
- d3_hclPrototype.brighter = function(k) {
- return new d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)));
- };
- d3_hclPrototype.darker = function(k) {
- return new d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)));
- };
- d3_hclPrototype.rgb = function() {
- return d3_hcl_lab(this.h, this.c, this.l).rgb();
- };
- function d3_hcl_lab(h, c, l) {
- if (isNaN(h)) h = 0;
- if (isNaN(c)) c = 0;
- return new d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c);
- }
- d3.lab = d3_lab;
- function d3_lab(l, a, b) {
- return this instanceof d3_lab ? void (this.l = +l, this.a = +a, this.b = +b) : arguments.length < 2 ? l instanceof d3_lab ? new d3_lab(l.l, l.a, l.b) : l instanceof d3_hcl ? d3_hcl_lab(l.h, l.c, l.l) : d3_rgb_lab((l = d3_rgb(l)).r, l.g, l.b) : new d3_lab(l, a, b);
- }
- var d3_lab_K = 18;
- var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883;
- var d3_labPrototype = d3_lab.prototype = new d3_color();
- d3_labPrototype.brighter = function(k) {
- return new d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
- };
- d3_labPrototype.darker = function(k) {
- return new d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
- };
- d3_labPrototype.rgb = function() {
- return d3_lab_rgb(this.l, this.a, this.b);
- };
- function d3_lab_rgb(l, a, b) {
- var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200;
- x = d3_lab_xyz(x) * d3_lab_X;
- y = d3_lab_xyz(y) * d3_lab_Y;
- z = d3_lab_xyz(z) * d3_lab_Z;
- return new d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z));
- }
- function d3_lab_hcl(l, a, b) {
- return l > 0 ? new d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : new d3_hcl(NaN, NaN, l);
- }
- function d3_lab_xyz(x) {
- return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037;
- }
- function d3_xyz_lab(x) {
- return x > .008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29;
- }
- function d3_xyz_rgb(r) {
- return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055));
- }
- d3.rgb = d3_rgb;
- function d3_rgb(r, g, b) {
- return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : new d3_rgb(r, g, b);
- }
- function d3_rgbNumber(value) {
- return new d3_rgb(value >> 16, value >> 8 & 255, value & 255);
- }
- function d3_rgbString(value) {
- return d3_rgbNumber(value) + "";
- }
- var d3_rgbPrototype = d3_rgb.prototype = new d3_color();
- d3_rgbPrototype.brighter = function(k) {
- k = Math.pow(.7, arguments.length ? k : 1);
- var r = this.r, g = this.g, b = this.b, i = 30;
- if (!r && !g && !b) return new d3_rgb(i, i, i);
- if (r && r < i) r = i;
- if (g && g < i) g = i;
- if (b && b < i) b = i;
- return new d3_rgb(Math.min(255, r / k), Math.min(255, g / k), Math.min(255, b / k));
- };
- d3_rgbPrototype.darker = function(k) {
- k = Math.pow(.7, arguments.length ? k : 1);
- return new d3_rgb(k * this.r, k * this.g, k * this.b);
- };
- d3_rgbPrototype.hsl = function() {
- return d3_rgb_hsl(this.r, this.g, this.b);
- };
- d3_rgbPrototype.toString = function() {
- return "#" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b);
- };
- function d3_rgb_hex(v) {
- return v < 16 ? "0" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16);
- }
- function d3_rgb_parse(format, rgb, hsl) {
- var r = 0, g = 0, b = 0, m1, m2, color;
- m1 = /([a-z]+)\((.*)\)/.exec(format = format.toLowerCase());
- if (m1) {
- m2 = m1[2].split(",");
- switch (m1[1]) {
- case "hsl":
- {
- return hsl(parseFloat(m2[0]), parseFloat(m2[1]) / 100, parseFloat(m2[2]) / 100);
- }
-
- case "rgb":
- {
- return rgb(d3_rgb_parseNumber(m2[0]), d3_rgb_parseNumber(m2[1]), d3_rgb_parseNumber(m2[2]));
- }
- }
- }
- if (color = d3_rgb_names.get(format)) {
- return rgb(color.r, color.g, color.b);
- }
- if (format != null && format.charAt(0) === "#" && !isNaN(color = parseInt(format.slice(1), 16))) {
- if (format.length === 4) {
- r = (color & 3840) >> 4;
- r = r >> 4 | r;
- g = color & 240;
- g = g >> 4 | g;
- b = color & 15;
- b = b << 4 | b;
- } else if (format.length === 7) {
- r = (color & 16711680) >> 16;
- g = (color & 65280) >> 8;
- b = color & 255;
- }
- }
- return rgb(r, g, b);
- }
- function d3_rgb_hsl(r, g, b) {
- var min = Math.min(r /= 255, g /= 255, b /= 255), max = Math.max(r, g, b), d = max - min, h, s, l = (max + min) / 2;
- if (d) {
- s = l < .5 ? d / (max + min) : d / (2 - max - min);
- if (r == max) h = (g - b) / d + (g < b ? 6 : 0); else if (g == max) h = (b - r) / d + 2; else h = (r - g) / d + 4;
- h *= 60;
- } else {
- h = NaN;
- s = l > 0 && l < 1 ? 0 : h;
- }
- return new d3_hsl(h, s, l);
- }
- function d3_rgb_lab(r, g, b) {
- r = d3_rgb_xyz(r);
- g = d3_rgb_xyz(g);
- b = d3_rgb_xyz(b);
- var x = d3_xyz_lab((.4124564 * r + .3575761 * g + .1804375 * b) / d3_lab_X), y = d3_xyz_lab((.2126729 * r + .7151522 * g + .072175 * b) / d3_lab_Y), z = d3_xyz_lab((.0193339 * r + .119192 * g + .9503041 * b) / d3_lab_Z);
- return d3_lab(116 * y - 16, 500 * (x - y), 200 * (y - z));
- }
- function d3_rgb_xyz(r) {
- return (r /= 255) <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4);
- }
- function d3_rgb_parseNumber(c) {
- var f = parseFloat(c);
- return c.charAt(c.length - 1) === "%" ? Math.round(f * 2.55) : f;
- }
- var d3_rgb_names = d3.map({
- aliceblue: 15792383,
- antiquewhite: 16444375,
- aqua: 65535,
- aquamarine: 8388564,
- azure: 15794175,
- beige: 16119260,
- bisque: 16770244,
- black: 0,
- blanchedalmond: 16772045,
- blue: 255,
- blueviolet: 9055202,
- brown: 10824234,
- burlywood: 14596231,
- cadetblue: 6266528,
- chartreuse: 8388352,
- chocolate: 13789470,
- coral: 16744272,
- cornflowerblue: 6591981,
- cornsilk: 16775388,
- crimson: 14423100,
- cyan: 65535,
- darkblue: 139,
- darkcyan: 35723,
- darkgoldenrod: 12092939,
- darkgray: 11119017,
- darkgreen: 25600,
- darkgrey: 11119017,
- darkkhaki: 12433259,
- darkmagenta: 9109643,
- darkolivegreen: 5597999,
- darkorange: 16747520,
- darkorchid: 10040012,
- darkred: 9109504,
- darksalmon: 15308410,
- darkseagreen: 9419919,
- darkslateblue: 4734347,
- darkslategray: 3100495,
- darkslategrey: 3100495,
- darkturquoise: 52945,
- darkviolet: 9699539,
- deeppink: 16716947,
- deepskyblue: 49151,
- dimgray: 6908265,
- dimgrey: 6908265,
- dodgerblue: 2003199,
- firebrick: 11674146,
- floralwhite: 16775920,
- forestgreen: 2263842,
- fuchsia: 16711935,
- gainsboro: 14474460,
- ghostwhite: 16316671,
- gold: 16766720,
- goldenrod: 14329120,
- gray: 8421504,
- green: 32768,
- greenyellow: 11403055,
- grey: 8421504,
- honeydew: 15794160,
- hotpink: 16738740,
- indianred: 13458524,
- indigo: 4915330,
- ivory: 16777200,
- khaki: 15787660,
- lavender: 15132410,
- lavenderblush: 16773365,
- lawngreen: 8190976,
- lemonchiffon: 16775885,
- lightblue: 11393254,
- lightcoral: 15761536,
- lightcyan: 14745599,
- lightgoldenrodyellow: 16448210,
- lightgray: 13882323,
- lightgreen: 9498256,
- lightgrey: 13882323,
- lightpink: 16758465,
- lightsalmon: 16752762,
- lightseagreen: 2142890,
- lightskyblue: 8900346,
- lightslategray: 7833753,
- lightslategrey: 7833753,
- lightsteelblue: 11584734,
- lightyellow: 16777184,
- lime: 65280,
- limegreen: 3329330,
- linen: 16445670,
- magenta: 16711935,
- maroon: 8388608,
- mediumaquamarine: 6737322,
- mediumblue: 205,
- mediumorchid: 12211667,
- mediumpurple: 9662683,
- mediumseagreen: 3978097,
- mediumslateblue: 8087790,
- mediumspringgreen: 64154,
- mediumturquoise: 4772300,
- mediumvioletred: 13047173,
- midnightblue: 1644912,
- mintcream: 16121850,
- mistyrose: 16770273,
- moccasin: 16770229,
- navajowhite: 16768685,
- navy: 128,
- oldlace: 16643558,
- olive: 8421376,
- olivedrab: 7048739,
- orange: 16753920,
- orangered: 16729344,
- orchid: 14315734,
- palegoldenrod: 15657130,
- palegreen: 10025880,
- paleturquoise: 11529966,
- palevioletred: 14381203,
- papayawhip: 16773077,
- peachpuff: 16767673,
- peru: 13468991,
- pink: 16761035,
- plum: 14524637,
- powderblue: 11591910,
- purple: 8388736,
- rebeccapurple: 6697881,
- red: 16711680,
- rosybrown: 12357519,
- royalblue: 4286945,
- saddlebrown: 9127187,
- salmon: 16416882,
- sandybrown: 16032864,
- seagreen: 3050327,
- seashell: 16774638,
- sienna: 10506797,
- silver: 12632256,
- skyblue: 8900331,
- slateblue: 6970061,
- slategray: 7372944,
- slategrey: 7372944,
- snow: 16775930,
- springgreen: 65407,
- steelblue: 4620980,
- tan: 13808780,
- teal: 32896,
- thistle: 14204888,
- tomato: 16737095,
- turquoise: 4251856,
- violet: 15631086,
- wheat: 16113331,
- white: 16777215,
- whitesmoke: 16119285,
- yellow: 16776960,
- yellowgreen: 10145074
- });
- d3_rgb_names.forEach(function(key, value) {
- d3_rgb_names.set(key, d3_rgbNumber(value));
- });
- function d3_functor(v) {
- return typeof v === "function" ? v : function() {
- return v;
- };
- }
- d3.functor = d3_functor;
- d3.xhr = d3_xhrType(d3_identity);
- function d3_xhrType(response) {
- return function(url, mimeType, callback) {
- if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType,
- mimeType = null;
- return d3_xhr(url, mimeType, response, callback);
- };
- }
- function d3_xhr(url, mimeType, response, callback) {
- var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null;
- if (this.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest();
- "onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() {
- request.readyState > 3 && respond();
- };
- function respond() {
- var status = request.status, result;
- if (!status && d3_xhrHasResponse(request) || status >= 200 && status < 300 || status === 304) {
- try {
- result = response.call(xhr, request);
- } catch (e) {
- dispatch.error.call(xhr, e);
- return;
- }
- dispatch.load.call(xhr, result);
- } else {
- dispatch.error.call(xhr, request);
- }
- }
- request.onprogress = function(event) {
- var o = d3.event;
- d3.event = event;
- try {
- dispatch.progress.call(xhr, request);
- } finally {
- d3.event = o;
- }
- };
- xhr.header = function(name, value) {
- name = (name + "").toLowerCase();
- if (arguments.length < 2) return headers[name];
- if (value == null) delete headers[name]; else headers[name] = value + "";
- return xhr;
- };
- xhr.mimeType = function(value) {
- if (!arguments.length) return mimeType;
- mimeType = value == null ? null : value + "";
- return xhr;
- };
- xhr.responseType = function(value) {
- if (!arguments.length) return responseType;
- responseType = value;
- return xhr;
- };
- xhr.response = function(value) {
- response = value;
- return xhr;
- };
- [ "get", "post" ].forEach(function(method) {
- xhr[method] = function() {
- return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments)));
- };
- });
- xhr.send = function(method, data, callback) {
- if (arguments.length === 2 && typeof data === "function") callback = data, data = null;
- request.open(method, url, true);
- if (mimeType != null && !("accept" in headers)) headers["accept"] = mimeType + ",*/*";
- if (request.setRequestHeader) for (var name in headers) request.setRequestHeader(name, headers[name]);
- if (mimeType != null && request.overrideMimeType) request.overrideMimeType(mimeType);
- if (responseType != null) request.responseType = responseType;
- if (callback != null) xhr.on("error", callback).on("load", function(request) {
- callback(null, request);
- });
- dispatch.beforesend.call(xhr, request);
- request.send(data == null ? null : data);
- return xhr;
- };
- xhr.abort = function() {
- request.abort();
- return xhr;
- };
- d3.rebind(xhr, dispatch, "on");
- return callback == null ? xhr : xhr.get(d3_xhr_fixCallback(callback));
- }
- function d3_xhr_fixCallback(callback) {
- return callback.length === 1 ? function(error, request) {
- callback(error == null ? request : null);
- } : callback;
- }
- function d3_xhrHasResponse(request) {
- var type = request.responseType;
- return type && type !== "text" ? request.response : request.responseText;
- }
- d3.dsv = function(delimiter, mimeType) {
- var reFormat = new RegExp('["' + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0);
- function dsv(url, row, callback) {
- if (arguments.length < 3) callback = row, row = null;
- var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback);
- xhr.row = function(_) {
- return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row;
- };
- return xhr;
- }
- function response(request) {
- return dsv.parse(request.responseText);
- }
- function typedResponse(f) {
- return function(request) {
- return dsv.parse(request.responseText, f);
- };
- }
- dsv.parse = function(text, f) {
- var o;
- return dsv.parseRows(text, function(row, i) {
- if (o) return o(row, i - 1);
- var a = new Function("d", "return {" + row.map(function(name, i) {
- return JSON.stringify(name) + ": d[" + i + "]";
- }).join(",") + "}");
- o = f ? function(row, i) {
- return f(a(row), i);
- } : a;
- });
- };
- dsv.parseRows = function(text, f) {
- var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol;
- function token() {
- if (I >= N) return EOF;
- if (eol) return eol = false, EOL;
- var j = I;
- if (text.charCodeAt(j) === 34) {
- var i = j;
- while (i++ < N) {
- if (text.charCodeAt(i) === 34) {
- if (text.charCodeAt(i + 1) !== 34) break;
- ++i;
- }
- }
- I = i + 2;
- var c = text.charCodeAt(i + 1);
- if (c === 13) {
- eol = true;
- if (text.charCodeAt(i + 2) === 10) ++I;
- } else if (c === 10) {
- eol = true;
- }
- return text.slice(j + 1, i).replace(/""/g, '"');
- }
- while (I < N) {
- var c = text.charCodeAt(I++), k = 1;
- if (c === 10) eol = true; else if (c === 13) {
- eol = true;
- if (text.charCodeAt(I) === 10) ++I, ++k;
- } else if (c !== delimiterCode) continue;
- return text.slice(j, I - k);
- }
- return text.slice(j);
- }
- while ((t = token()) !== EOF) {
- var a = [];
- while (t !== EOL && t !== EOF) {
- a.push(t);
- t = token();
- }
- if (f && (a = f(a, n++)) == null) continue;
- rows.push(a);
- }
- return rows;
- };
- dsv.format = function(rows) {
- if (Array.isArray(rows[0])) return dsv.formatRows(rows);
- var fieldSet = new d3_Set(), fields = [];
- rows.forEach(function(row) {
- for (var field in row) {
- if (!fieldSet.has(field)) {
- fields.push(fieldSet.add(field));
- }
- }
- });
- return [ fields.map(formatValue).join(delimiter) ].concat(rows.map(function(row) {
- return fields.map(function(field) {
- return formatValue(row[field]);
- }).join(delimiter);
- })).join("\n");
- };
- dsv.formatRows = function(rows) {
- return rows.map(formatRow).join("\n");
- };
- function formatRow(row) {
- return row.map(formatValue).join(delimiter);
- }
- function formatValue(text) {
- return reFormat.test(text) ? '"' + text.replace(/\"/g, '""') + '"' : text;
- }
- return dsv;
- };
- d3.csv = d3.dsv(",", "text/csv");
- d3.tsv = d3.dsv(" ", "text/tab-separated-values");
- var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_frame = this[d3_vendorSymbol(this, "requestAnimationFrame")] || function(callback) {
- setTimeout(callback, 17);
- };
- d3.timer = function() {
- d3_timer.apply(this, arguments);
- };
- function d3_timer(callback, delay, then) {
- var n = arguments.length;
- if (n < 2) delay = 0;
- if (n < 3) then = Date.now();
- var time = then + delay, timer = {
- c: callback,
- t: time,
- n: null
- };
- if (d3_timer_queueTail) d3_timer_queueTail.n = timer; else d3_timer_queueHead = timer;
- d3_timer_queueTail = timer;
- if (!d3_timer_interval) {
- d3_timer_timeout = clearTimeout(d3_timer_timeout);
- d3_timer_interval = 1;
- d3_timer_frame(d3_timer_step);
- }
- return timer;
- }
- function d3_timer_step() {
- var now = d3_timer_mark(), delay = d3_timer_sweep() - now;
- if (delay > 24) {
- if (isFinite(delay)) {
- clearTimeout(d3_timer_timeout);
- d3_timer_timeout = setTimeout(d3_timer_step, delay);
- }
- d3_timer_interval = 0;
- } else {
- d3_timer_interval = 1;
- d3_timer_frame(d3_timer_step);
- }
- }
- d3.timer.flush = function() {
- d3_timer_mark();
- d3_timer_sweep();
- };
- function d3_timer_mark() {
- var now = Date.now(), timer = d3_timer_queueHead;
- while (timer) {
- if (now >= timer.t && timer.c(now - timer.t)) timer.c = null;
- timer = timer.n;
- }
- return now;
- }
- function d3_timer_sweep() {
- var t0, t1 = d3_timer_queueHead, time = Infinity;
- while (t1) {
- if (t1.c) {
- if (t1.t < time) time = t1.t;
- t1 = (t0 = t1).n;
- } else {
- t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n;
- }
- }
- d3_timer_queueTail = t0;
- return time;
- }
- function d3_format_precision(x, p) {
- return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1);
- }
- d3.round = function(x, n) {
- return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x);
- };
- var d3_formatPrefixes = [ "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" ].map(d3_formatPrefix);
- d3.formatPrefix = function(value, precision) {
- var i = 0;
- if (value = +value) {
- if (value < 0) value *= -1;
- if (precision) value = d3.round(value, d3_format_precision(value, precision));
- i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10);
- i = Math.max(-24, Math.min(24, Math.floor((i - 1) / 3) * 3));
- }
- return d3_formatPrefixes[8 + i / 3];
- };
- function d3_formatPrefix(d, i) {
- var k = Math.pow(10, abs(8 - i) * 3);
- return {
- scale: i > 8 ? function(d) {
- return d / k;
- } : function(d) {
- return d * k;
- },
- symbol: d
- };
- }
- function d3_locale_numberFormat(locale) {
- var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping && locale_thousands ? function(value, width) {
- var i = value.length, t = [], j = 0, g = locale_grouping[0], length = 0;
- while (i > 0 && g > 0) {
- if (length + g + 1 > width) g = Math.max(1, width - length);
- t.push(value.substring(i -= g, i + g));
- if ((length += g + 1) > width) break;
- g = locale_grouping[j = (j + 1) % locale_grouping.length];
- }
- return t.reverse().join(locale_thousands);
- } : d3_identity;
- return function(specifier) {
- var match = d3_format_re.exec(specifier), fill = match[1] || " ", align = match[2] || ">", sign = match[3] || "-", symbol = match[4] || "", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, prefix = "", suffix = "", integer = false, exponent = true;
- if (precision) precision = +precision.substring(1);
- if (zfill || fill === "0" && align === "=") {
- zfill = fill = "0";
- align = "=";
- }
- switch (type) {
- case "n":
- comma = true;
- type = "g";
- break;
-
- case "%":
- scale = 100;
- suffix = "%";
- type = "f";
- break;
-
- case "p":
- scale = 100;
- suffix = "%";
- type = "r";
- break;
-
- case "b":
- case "o":
- case "x":
- case "X":
- if (symbol === "#") prefix = "0" + type.toLowerCase();
-
- case "c":
- exponent = false;
-
- case "d":
- integer = true;
- precision = 0;
- break;
-
- case "s":
- scale = -1;
- type = "r";
- break;
- }
- if (symbol === "$") prefix = locale_currency[0], suffix = locale_currency[1];
- if (type == "r" && !precision) type = "g";
- if (precision != null) {
- if (type == "g") precision = Math.max(1, Math.min(21, precision)); else if (type == "e" || type == "f") precision = Math.max(0, Math.min(20, precision));
- }
- type = d3_format_types.get(type) || d3_format_typeDefault;
- var zcomma = zfill && comma;
- return function(value) {
- var fullSuffix = suffix;
- if (integer && value % 1) return "";
- var negative = value < 0 || value === 0 && 1 / value < 0 ? (value = -value, "-") : sign === "-" ? "" : sign;
- if (scale < 0) {
- var unit = d3.formatPrefix(value, precision);
- value = unit.scale(value);
- fullSuffix = unit.symbol + suffix;
- } else {
- value *= scale;
- }
- value = type(value, precision);
- var i = value.lastIndexOf("."), before, after;
- if (i < 0) {
- var j = exponent ? value.lastIndexOf("e") : -1;
- if (j < 0) before = value, after = ""; else before = value.substring(0, j), after = value.substring(j);
- } else {
- before = value.substring(0, i);
- after = locale_decimal + value.substring(i + 1);
- }
- if (!zfill && comma) before = formatGroup(before, Infinity);
- var length = prefix.length + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : "";
- if (zcomma) before = formatGroup(padding + before, padding.length ? width - after.length : Infinity);
- negative += prefix;
- value = before + after;
- return (align === "<" ? negative + value + padding : align === ">" ? padding + negative + value : align === "^" ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) : negative + (zcomma ? value : padding + value)) + fullSuffix;
- };
- };
- }
- var d3_format_re = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i;
- var d3_format_types = d3.map({
- b: function(x) {
- return x.toString(2);
- },
- c: function(x) {
- return String.fromCharCode(x);
- },
- o: function(x) {
- return x.toString(8);
- },
- x: function(x) {
- return x.toString(16);
- },
- X: function(x) {
- return x.toString(16).toUpperCase();
- },
- g: function(x, p) {
- return x.toPrecision(p);
- },
- e: function(x, p) {
- return x.toExponential(p);
- },
- f: function(x, p) {
- return x.toFixed(p);
- },
- r: function(x, p) {
- return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p))));
- }
- });
- function d3_format_typeDefault(x) {
- return x + "";
- }
- var d3_time = d3.time = {}, d3_date = Date;
- function d3_date_utc() {
- this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]);
- }
- d3_date_utc.prototype = {
- getDate: function() {
- return this._.getUTCDate();
- },
- getDay: function() {
- return this._.getUTCDay();
- },
- getFullYear: function() {
- return this._.getUTCFullYear();
- },
- getHours: function() {
- return this._.getUTCHours();
- },
- getMilliseconds: function() {
- return this._.getUTCMilliseconds();
- },
- getMinutes: function() {
- return this._.getUTCMinutes();
- },
- getMonth: function() {
- return this._.getUTCMonth();
- },
- getSeconds: function() {
- return this._.getUTCSeconds();
- },
- getTime: function() {
- return this._.getTime();
- },
- getTimezoneOffset: function() {
- return 0;
- },
- valueOf: function() {
- return this._.valueOf();
- },
- setDate: function() {
- d3_time_prototype.setUTCDate.apply(this._, arguments);
- },
- setDay: function() {
- d3_time_prototype.setUTCDay.apply(this._, arguments);
- },
- setFullYear: function() {
- d3_time_prototype.setUTCFullYear.apply(this._, arguments);
- },
- setHours: function() {
- d3_time_prototype.setUTCHours.apply(this._, arguments);
- },
- setMilliseconds: function() {
- d3_time_prototype.setUTCMilliseconds.apply(this._, arguments);
- },
- setMinutes: function() {
- d3_time_prototype.setUTCMinutes.apply(this._, arguments);
- },
- setMonth: function() {
- d3_time_prototype.setUTCMonth.apply(this._, arguments);
- },
- setSeconds: function() {
- d3_time_prototype.setUTCSeconds.apply(this._, arguments);
- },
- setTime: function() {
- d3_time_prototype.setTime.apply(this._, arguments);
- }
- };
- var d3_time_prototype = Date.prototype;
- function d3_time_interval(local, step, number) {
- function round(date) {
- var d0 = local(date), d1 = offset(d0, 1);
- return date - d0 < d1 - date ? d0 : d1;
- }
- function ceil(date) {
- step(date = local(new d3_date(date - 1)), 1);
- return date;
- }
- function offset(date, k) {
- step(date = new d3_date(+date), k);
- return date;
- }
- function range(t0, t1, dt) {
- var time = ceil(t0), times = [];
- if (dt > 1) {
- while (time < t1) {
- if (!(number(time) % dt)) times.push(new Date(+time));
- step(time, 1);
- }
- } else {
- while (time < t1) times.push(new Date(+time)), step(time, 1);
- }
- return times;
- }
- function range_utc(t0, t1, dt) {
- try {
- d3_date = d3_date_utc;
- var utc = new d3_date_utc();
- utc._ = t0;
- return range(utc, t1, dt);
- } finally {
- d3_date = Date;
- }
- }
- local.floor = local;
- local.round = round;
- local.ceil = ceil;
- local.offset = offset;
- local.range = range;
- var utc = local.utc = d3_time_interval_utc(local);
- utc.floor = utc;
- utc.round = d3_time_interval_utc(round);
- utc.ceil = d3_time_interval_utc(ceil);
- utc.offset = d3_time_interval_utc(offset);
- utc.range = range_utc;
- return local;
- }
- function d3_time_interval_utc(method) {
- return function(date, k) {
- try {
- d3_date = d3_date_utc;
- var utc = new d3_date_utc();
- utc._ = date;
- return method(utc, k)._;
- } finally {
- d3_date = Date;
- }
- };
- }
- d3_time.year = d3_time_interval(function(date) {
- date = d3_time.day(date);
- date.setMonth(0, 1);
- return date;
- }, function(date, offset) {
- date.setFullYear(date.getFullYear() + offset);
- }, function(date) {
- return date.getFullYear();
- });
- d3_time.years = d3_time.year.range;
- d3_time.years.utc = d3_time.year.utc.range;
- d3_time.day = d3_time_interval(function(date) {
- var day = new d3_date(2e3, 0);
- day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
- return day;
- }, function(date, offset) {
- date.setDate(date.getDate() + offset);
- }, function(date) {
- return date.getDate() - 1;
- });
- d3_time.days = d3_time.day.range;
- d3_time.days.utc = d3_time.day.utc.range;
- d3_time.dayOfYear = function(date) {
- var year = d3_time.year(date);
- return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5);
- };
- [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ].forEach(function(day, i) {
- i = 7 - i;
- var interval = d3_time[day] = d3_time_interval(function(date) {
- (date = d3_time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7);
- return date;
- }, function(date, offset) {
- date.setDate(date.getDate() + Math.floor(offset) * 7);
- }, function(date) {
- var day = d3_time.year(date).getDay();
- return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7) - (day !== i);
- });
- d3_time[day + "s"] = interval.range;
- d3_time[day + "s"].utc = interval.utc.range;
- d3_time[day + "OfYear"] = function(date) {
- var day = d3_time.year(date).getDay();
- return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7);
- };
- });
- d3_time.week = d3_time.sunday;
- d3_time.weeks = d3_time.sunday.range;
- d3_time.weeks.utc = d3_time.sunday.utc.range;
- d3_time.weekOfYear = d3_time.sundayOfYear;
- function d3_locale_timeFormat(locale) {
- var locale_dateTime = locale.dateTime, locale_date = locale.date, locale_time = locale.time, locale_periods = locale.periods, locale_days = locale.days, locale_shortDays = locale.shortDays, locale_months = locale.months, locale_shortMonths = locale.shortMonths;
- function d3_time_format(template) {
- var n = template.length;
- function format(date) {
- var string = [], i = -1, j = 0, c, p, f;
- while (++i < n) {
- if (template.charCodeAt(i) === 37) {
- string.push(template.slice(j, i));
- if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i);
- if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p);
- string.push(c);
- j = i + 1;
- }
- }
- string.push(template.slice(j, i));
- return string.join("");
- }
- format.parse = function(string) {
- var d = {
- y: 1900,
- m: 0,
- d: 1,
- H: 0,
- M: 0,
- S: 0,
- L: 0,
- Z: null
- }, i = d3_time_parse(d, template, string, 0);
- if (i != string.length) return null;
- if ("p" in d) d.H = d.H % 12 + d.p * 12;
- var localZ = d.Z != null && d3_date !== d3_date_utc, date = new (localZ ? d3_date_utc : d3_date)();
- if ("j" in d) date.setFullYear(d.y, 0, d.j); else if ("W" in d || "U" in d) {
- if (!("w" in d)) d.w = "W" in d ? 1 : 0;
- date.setFullYear(d.y, 0, 1);
- date.setFullYear(d.y, 0, "W" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7);
- } else date.setFullYear(d.y, d.m, d.d);
- date.setHours(d.H + (d.Z / 100 | 0), d.M + d.Z % 100, d.S, d.L);
- return localZ ? date._ : date;
- };
- format.toString = function() {
- return template;
- };
- return format;
- }
- function d3_time_parse(date, template, string, j) {
- var c, p, t, i = 0, n = template.length, m = string.length;
- while (i < n) {
- if (j >= m) return -1;
- c = template.charCodeAt(i++);
- if (c === 37) {
- t = template.charAt(i++);
- p = d3_time_parsers[t in d3_time_formatPads ? template.charAt(i++) : t];
- if (!p || (j = p(date, string, j)) < 0) return -1;
- } else if (c != string.charCodeAt(j++)) {
- return -1;
- }
- }
- return j;
- }
- d3_time_format.utc = function(template) {
- var local = d3_time_format(template);
- function format(date) {
- try {
- d3_date = d3_date_utc;
- var utc = new d3_date();
- utc._ = date;
- return local(utc);
- } finally {
- d3_date = Date;
- }
- }
- format.parse = function(string) {
- try {
- d3_date = d3_date_utc;
- var date = local.parse(string);
- return date && date._;
- } finally {
- d3_date = Date;
- }
- };
- format.toString = local.toString;
- return format;
- };
- d3_time_format.multi = d3_time_format.utc.multi = d3_time_formatMulti;
- var d3_time_periodLookup = d3.map(), d3_time_dayRe = d3_time_formatRe(locale_days), d3_time_dayLookup = d3_time_formatLookup(locale_days), d3_time_dayAbbrevRe = d3_time_formatRe(locale_shortDays), d3_time_dayAbbrevLookup = d3_time_formatLookup(locale_shortDays), d3_time_monthRe = d3_time_formatRe(locale_months), d3_time_monthLookup = d3_time_formatLookup(locale_months), d3_time_monthAbbrevRe = d3_time_formatRe(locale_shortMonths), d3_time_monthAbbrevLookup = d3_time_formatLookup(locale_shortMonths);
- locale_periods.forEach(function(p, i) {
- d3_time_periodLookup.set(p.toLowerCase(), i);
- });
- var d3_time_formats = {
- a: function(d) {
- return locale_shortDays[d.getDay()];
- },
- A: function(d) {
- return locale_days[d.getDay()];
- },
- b: function(d) {
- return locale_shortMonths[d.getMonth()];
- },
- B: function(d) {
- return locale_months[d.getMonth()];
- },
- c: d3_time_format(locale_dateTime),
- d: function(d, p) {
- return d3_time_formatPad(d.getDate(), p, 2);
- },
- e: function(d, p) {
- return d3_time_formatPad(d.getDate(), p, 2);
- },
- H: function(d, p) {
- return d3_time_formatPad(d.getHours(), p, 2);
- },
- I: function(d, p) {
- return d3_time_formatPad(d.getHours() % 12 || 12, p, 2);
- },
- j: function(d, p) {
- return d3_time_formatPad(1 + d3_time.dayOfYear(d), p, 3);
- },
- L: function(d, p) {
- return d3_time_formatPad(d.getMilliseconds(), p, 3);
- },
- m: function(d, p) {
- return d3_time_formatPad(d.getMonth() + 1, p, 2);
- },
- M: function(d, p) {
- return d3_time_formatPad(d.getMinutes(), p, 2);
- },
- p: function(d) {
- return locale_periods[+(d.getHours() >= 12)];
- },
- S: function(d, p) {
- return d3_time_formatPad(d.getSeconds(), p, 2);
- },
- U: function(d, p) {
- return d3_time_formatPad(d3_time.sundayOfYear(d), p, 2);
- },
- w: function(d) {
- return d.getDay();
- },
- W: function(d, p) {
- return d3_time_formatPad(d3_time.mondayOfYear(d), p, 2);
- },
- x: d3_time_format(locale_date),
- X: d3_time_format(locale_time),
- y: function(d, p) {
- return d3_time_formatPad(d.getFullYear() % 100, p, 2);
- },
- Y: function(d, p) {
- return d3_time_formatPad(d.getFullYear() % 1e4, p, 4);
- },
- Z: d3_time_zone,
- "%": function() {
- return "%";
- }
- };
- var d3_time_parsers = {
- a: d3_time_parseWeekdayAbbrev,
- A: d3_time_parseWeekday,
- b: d3_time_parseMonthAbbrev,
- B: d3_time_parseMonth,
- c: d3_time_parseLocaleFull,
- d: d3_time_parseDay,
- e: d3_time_parseDay,
- H: d3_time_parseHour24,
- I: d3_time_parseHour24,
- j: d3_time_parseDayOfYear,
- L: d3_time_parseMilliseconds,
- m: d3_time_parseMonthNumber,
- M: d3_time_parseMinutes,
- p: d3_time_parseAmPm,
- S: d3_time_parseSeconds,
- U: d3_time_parseWeekNumberSunday,
- w: d3_time_parseWeekdayNumber,
- W: d3_time_parseWeekNumberMonday,
- x: d3_time_parseLocaleDate,
- X: d3_time_parseLocaleTime,
- y: d3_time_parseYear,
- Y: d3_time_parseFullYear,
- Z: d3_time_parseZone,
- "%": d3_time_parseLiteralPercent
- };
- function d3_time_parseWeekdayAbbrev(date, string, i) {
- d3_time_dayAbbrevRe.lastIndex = 0;
- var n = d3_time_dayAbbrevRe.exec(string.slice(i));
- return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
- function d3_time_parseWeekday(date, string, i) {
- d3_time_dayRe.lastIndex = 0;
- var n = d3_time_dayRe.exec(string.slice(i));
- return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
- function d3_time_parseMonthAbbrev(date, string, i) {
- d3_time_monthAbbrevRe.lastIndex = 0;
- var n = d3_time_monthAbbrevRe.exec(string.slice(i));
- return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
- function d3_time_parseMonth(date, string, i) {
- d3_time_monthRe.lastIndex = 0;
- var n = d3_time_monthRe.exec(string.slice(i));
- return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
- function d3_time_parseLocaleFull(date, string, i) {
- return d3_time_parse(date, d3_time_formats.c.toString(), string, i);
- }
- function d3_time_parseLocaleDate(date, string, i) {
- return d3_time_parse(date, d3_time_formats.x.toString(), string, i);
- }
- function d3_time_parseLocaleTime(date, string, i) {
- return d3_time_parse(date, d3_time_formats.X.toString(), string, i);
- }
- function d3_time_parseAmPm(date, string, i) {
- var n = d3_time_periodLookup.get(string.slice(i, i += 2).toLowerCase());
- return n == null ? -1 : (date.p = n, i);
- }
- return d3_time_format;
- }
- var d3_time_formatPads = {
- "-": "",
- _: " ",
- "0": "0"
- }, d3_time_numberRe = /^\s*\d+/, d3_time_percentRe = /^%/;
- function d3_time_formatPad(value, fill, width) {
- var sign = value < 0 ? "-" : "", string = (sign ? -value : value) + "", length = string.length;
- return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
- }
- function d3_time_formatRe(names) {
- return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i");
- }
- function d3_time_formatLookup(names) {
- var map = new d3_Map(), i = -1, n = names.length;
- while (++i < n) map.set(names[i].toLowerCase(), i);
- return map;
- }
- function d3_time_parseWeekdayNumber(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 1));
- return n ? (date.w = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseWeekNumberSunday(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i));
- return n ? (date.U = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseWeekNumberMonday(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i));
- return n ? (date.W = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseFullYear(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 4));
- return n ? (date.y = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseYear(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1;
- }
- function d3_time_parseZone(date, string, i) {
- return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string,
- i + 5) : -1;
- }
- function d3_time_expandYear(d) {
- return d + (d > 68 ? 1900 : 2e3);
- }
- function d3_time_parseMonthNumber(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.m = n[0] - 1, i + n[0].length) : -1;
- }
- function d3_time_parseDay(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.d = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseDayOfYear(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 3));
- return n ? (date.j = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseHour24(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.H = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseMinutes(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.M = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseSeconds(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.S = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseMilliseconds(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 3));
- return n ? (date.L = +n[0], i + n[0].length) : -1;
- }
- function d3_time_zone(d) {
- var z = d.getTimezoneOffset(), zs = z > 0 ? "-" : "+", zh = abs(z) / 60 | 0, zm = abs(z) % 60;
- return zs + d3_time_formatPad(zh, "0", 2) + d3_time_formatPad(zm, "0", 2);
- }
- function d3_time_parseLiteralPercent(date, string, i) {
- d3_time_percentRe.lastIndex = 0;
- var n = d3_time_percentRe.exec(string.slice(i, i + 1));
- return n ? i + n[0].length : -1;
- }
- function d3_time_formatMulti(formats) {
- var n = formats.length, i = -1;
- while (++i < n) formats[i][0] = this(formats[i][0]);
- return function(date) {
- var i = 0, f = formats[i];
- while (!f[1](date)) f = formats[++i];
- return f[0](date);
- };
- }
- d3.locale = function(locale) {
- return {
- numberFormat: d3_locale_numberFormat(locale),
- timeFormat: d3_locale_timeFormat(locale)
- };
- };
- var d3_locale_enUS = d3.locale({
- decimal: ".",
- thousands: ",",
- grouping: [ 3 ],
- currency: [ "$", "" ],
- dateTime: "%a %b %e %X %Y",
- date: "%m/%d/%Y",
- time: "%H:%M:%S",
- periods: [ "AM", "PM" ],
- days: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
- shortDays: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
- months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ],
- shortMonths: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]
- });
- d3.format = d3_locale_enUS.numberFormat;
- d3.geo = {};
- function d3_adder() {}
- d3_adder.prototype = {
- s: 0,
- t: 0,
- add: function(y) {
- d3_adderSum(y, this.t, d3_adderTemp);
- d3_adderSum(d3_adderTemp.s, this.s, this);
- if (this.s) this.t += d3_adderTemp.t; else this.s = d3_adderTemp.t;
- },
- reset: function() {
- this.s = this.t = 0;
- },
- valueOf: function() {
- return this.s;
- }
- };
- var d3_adderTemp = new d3_adder();
- function d3_adderSum(a, b, o) {
- var x = o.s = a + b, bv = x - a, av = x - bv;
- o.t = a - av + (b - bv);
- }
- d3.geo.stream = function(object, listener) {
- if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) {
- d3_geo_streamObjectType[object.type](object, listener);
- } else {
- d3_geo_streamGeometry(object, listener);
- }
- };
- function d3_geo_streamGeometry(geometry, listener) {
- if (geometry && d3_geo_streamGeometryType.hasOwnProperty(geometry.type)) {
- d3_geo_streamGeometryType[geometry.type](geometry, listener);
- }
- }
- var d3_geo_streamObjectType = {
- Feature: function(feature, listener) {
- d3_geo_streamGeometry(feature.geometry, listener);
- },
- FeatureCollection: function(object, listener) {
- var features = object.features, i = -1, n = features.length;
- while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener);
- }
- };
- var d3_geo_streamGeometryType = {
- Sphere: function(object, listener) {
- listener.sphere();
- },
- Point: function(object, listener) {
- object = object.coordinates;
- listener.point(object[0], object[1], object[2]);
- },
- MultiPoint: function(object, listener) {
- var coordinates = object.coordinates, i = -1, n = coordinates.length;
- while (++i < n) object = coordinates[i], listener.point(object[0], object[1], object[2]);
- },
- LineString: function(object, listener) {
- d3_geo_streamLine(object.coordinates, listener, 0);
- },
- MultiLineString: function(object, listener) {
- var coordinates = object.coordinates, i = -1, n = coordinates.length;
- while (++i < n) d3_geo_streamLine(coordinates[i], listener, 0);
- },
- Polygon: function(object, listener) {
- d3_geo_streamPolygon(object.coordinates, listener);
- },
- MultiPolygon: function(object, listener) {
- var coordinates = object.coordinates, i = -1, n = coordinates.length;
- while (++i < n) d3_geo_streamPolygon(coordinates[i], listener);
- },
- GeometryCollection: function(object, listener) {
- var geometries = object.geometries, i = -1, n = geometries.length;
- while (++i < n) d3_geo_streamGeometry(geometries[i], listener);
- }
- };
- function d3_geo_streamLine(coordinates, listener, closed) {
- var i = -1, n = coordinates.length - closed, coordinate;
- listener.lineStart();
- while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1], coordinate[2]);
- listener.lineEnd();
- }
- function d3_geo_streamPolygon(coordinates, listener) {
- var i = -1, n = coordinates.length;
- listener.polygonStart();
- while (++i < n) d3_geo_streamLine(coordinates[i], listener, 1);
- listener.polygonEnd();
- }
- d3.geo.area = function(object) {
- d3_geo_areaSum = 0;
- d3.geo.stream(object, d3_geo_area);
- return d3_geo_areaSum;
- };
- var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder();
- var d3_geo_area = {
- sphere: function() {
- d3_geo_areaSum += 4 * π;
- },
- point: d3_noop,
- lineStart: d3_noop,
- lineEnd: d3_noop,
- polygonStart: function() {
- d3_geo_areaRingSum.reset();
- d3_geo_area.lineStart = d3_geo_areaRingStart;
- },
- polygonEnd: function() {
- var area = 2 * d3_geo_areaRingSum;
- d3_geo_areaSum += area < 0 ? 4 * π + area : area;
- d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop;
- }
- };
- function d3_geo_areaRingStart() {
- var λ00, φ00, λ0, cosφ0, sinφ0;
- d3_geo_area.point = function(λ, φ) {
- d3_geo_area.point = nextPoint;
- λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4),
- sinφ0 = Math.sin(φ);
- };
- function nextPoint(λ, φ) {
- λ *= d3_radians;
- φ = φ * d3_radians / 2 + π / 4;
- var dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(adλ), v = k * sdλ * Math.sin(adλ);
- d3_geo_areaRingSum.add(Math.atan2(v, u));
- λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ;
- }
- d3_geo_area.lineEnd = function() {
- nextPoint(λ00, φ00);
- };
- }
- function d3_geo_cartesian(spherical) {
- var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ);
- return [ cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ) ];
- }
- function d3_geo_cartesianDot(a, b) {
- return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
- }
- function d3_geo_cartesianCross(a, b) {
- return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ];
- }
- function d3_geo_cartesianAdd(a, b) {
- a[0] += b[0];
- a[1] += b[1];
- a[2] += b[2];
- }
- function d3_geo_cartesianScale(vector, k) {
- return [ vector[0] * k, vector[1] * k, vector[2] * k ];
- }
- function d3_geo_cartesianNormalize(d) {
- var l = Math.sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
- d[0] /= l;
- d[1] /= l;
- d[2] /= l;
- }
- function d3_geo_spherical(cartesian) {
- return [ Math.atan2(cartesian[1], cartesian[0]), d3_asin(cartesian[2]) ];
- }
- function d3_geo_sphericalEqual(a, b) {
- return abs(a[0] - b[0]) < ε && abs(a[1] - b[1]) < ε;
- }
- d3.geo.bounds = function() {
- var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range;
- var bound = {
- point: point,
- lineStart: lineStart,
- lineEnd: lineEnd,
- polygonStart: function() {
- bound.point = ringPoint;
- bound.lineStart = ringStart;
- bound.lineEnd = ringEnd;
- dλSum = 0;
- d3_geo_area.polygonStart();
- },
- polygonEnd: function() {
- d3_geo_area.polygonEnd();
- bound.point = point;
- bound.lineStart = lineStart;
- bound.lineEnd = lineEnd;
- if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90;
- range[0] = λ0, range[1] = λ1;
- }
- };
- function point(λ, φ) {
- ranges.push(range = [ λ0 = λ, λ1 = λ ]);
- if (φ < φ0) φ0 = φ;
- if (φ > φ1) φ1 = φ;
- }
- function linePoint(λ, φ) {
- var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]);
- if (p0) {
- var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal);
- d3_geo_cartesianNormalize(inflection);
- inflection = d3_geo_spherical(inflection);
- var dλ = λ - λ_, s = dλ > 0 ? 1 : -1, λi = inflection[0] * d3_degrees * s, antimeridian = abs(dλ) > 180;
- if (antimeridian ^ (s * λ_ < λi && λi < s * λ)) {
- var φi = inflection[1] * d3_degrees;
- if (φi > φ1) φ1 = φi;
- } else if (λi = (λi + 360) % 360 - 180, antimeridian ^ (s * λ_ < λi && λi < s * λ)) {
- var φi = -inflection[1] * d3_degrees;
- if (φi < φ0) φ0 = φi;
- } else {
- if (φ < φ0) φ0 = φ;
- if (φ > φ1) φ1 = φ;
- }
- if (antimeridian) {
- if (λ < λ_) {
- if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;
- } else {
- if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;
- }
- } else {
- if (λ1 >= λ0) {
- if (λ < λ0) λ0 = λ;
- if (λ > λ1) λ1 = λ;
- } else {
- if (λ > λ_) {
- if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;
- } else {
- if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;
- }
- }
- }
- } else {
- point(λ, φ);
- }
- p0 = p, λ_ = λ;
- }
- function lineStart() {
- bound.point = linePoint;
- }
- function lineEnd() {
- range[0] = λ0, range[1] = λ1;
- bound.point = point;
- p0 = null;
- }
- function ringPoint(λ, φ) {
- if (p0) {
- var dλ = λ - λ_;
- dλSum += abs(dλ) > 180 ? dλ + (dλ > 0 ? 360 : -360) : dλ;
- } else λ__ = λ, φ__ = φ;
- d3_geo_area.point(λ, φ);
- linePoint(λ, φ);
- }
- function ringStart() {
- d3_geo_area.lineStart();
- }
- function ringEnd() {
- ringPoint(λ__, φ__);
- d3_geo_area.lineEnd();
- if (abs(dλSum) > ε) λ0 = -(λ1 = 180);
- range[0] = λ0, range[1] = λ1;
- p0 = null;
- }
- function angle(λ0, λ1) {
- return (λ1 -= λ0) < 0 ? λ1 + 360 : λ1;
- }
- function compareRanges(a, b) {
- return a[0] - b[0];
- }
- function withinRange(x, range) {
- return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;
- }
- return function(feature) {
- φ1 = λ1 = -(λ0 = φ0 = Infinity);
- ranges = [];
- d3.geo.stream(feature, bound);
- var n = ranges.length;
- if (n) {
- ranges.sort(compareRanges);
- for (var i = 1, a = ranges[0], b, merged = [ a ]; i < n; ++i) {
- b = ranges[i];
- if (withinRange(b[0], a) || withinRange(b[1], a)) {
- if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];
- if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];
- } else {
- merged.push(a = b);
- }
- }
- var best = -Infinity, dλ;
- for (var n = merged.length - 1, i = 0, a = merged[n], b; i <= n; a = b, ++i) {
- b = merged[i];
- if ((dλ = angle(a[1], b[0])) > best) best = dλ, λ0 = b[0], λ1 = a[1];
- }
- }
- ranges = range = null;
- return λ0 === Infinity || φ0 === Infinity ? [ [ NaN, NaN ], [ NaN, NaN ] ] : [ [ λ0, φ0 ], [ λ1, φ1 ] ];
- };
- }();
- d3.geo.centroid = function(object) {
- d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;
- d3.geo.stream(object, d3_geo_centroid);
- var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z;
- if (m < ε2) {
- x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1;
- if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0;
- m = x * x + y * y + z * z;
- if (m < ε2) return [ NaN, NaN ];
- }
- return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ];
- };
- var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2;
- var d3_geo_centroid = {
- sphere: d3_noop,
- point: d3_geo_centroidPoint,
- lineStart: d3_geo_centroidLineStart,
- lineEnd: d3_geo_centroidLineEnd,
- polygonStart: function() {
- d3_geo_centroid.lineStart = d3_geo_centroidRingStart;
- },
- polygonEnd: function() {
- d3_geo_centroid.lineStart = d3_geo_centroidLineStart;
- }
- };
- function d3_geo_centroidPoint(λ, φ) {
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians);
- d3_geo_centroidPointXYZ(cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ));
- }
- function d3_geo_centroidPointXYZ(x, y, z) {
- ++d3_geo_centroidW0;
- d3_geo_centroidX0 += (x - d3_geo_centroidX0) / d3_geo_centroidW0;
- d3_geo_centroidY0 += (y - d3_geo_centroidY0) / d3_geo_centroidW0;
- d3_geo_centroidZ0 += (z - d3_geo_centroidZ0) / d3_geo_centroidW0;
- }
- function d3_geo_centroidLineStart() {
- var x0, y0, z0;
- d3_geo_centroid.point = function(λ, φ) {
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians);
- x0 = cosφ * Math.cos(λ);
- y0 = cosφ * Math.sin(λ);
- z0 = Math.sin(φ);
- d3_geo_centroid.point = nextPoint;
- d3_geo_centroidPointXYZ(x0, y0, z0);
- };
- function nextPoint(λ, φ) {
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), w = Math.atan2(Math.sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);
- d3_geo_centroidW1 += w;
- d3_geo_centroidX1 += w * (x0 + (x0 = x));
- d3_geo_centroidY1 += w * (y0 + (y0 = y));
- d3_geo_centroidZ1 += w * (z0 + (z0 = z));
- d3_geo_centroidPointXYZ(x0, y0, z0);
- }
- }
- function d3_geo_centroidLineEnd() {
- d3_geo_centroid.point = d3_geo_centroidPoint;
- }
- function d3_geo_centroidRingStart() {
- var λ00, φ00, x0, y0, z0;
- d3_geo_centroid.point = function(λ, φ) {
- λ00 = λ, φ00 = φ;
- d3_geo_centroid.point = nextPoint;
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians);
- x0 = cosφ * Math.cos(λ);
- y0 = cosφ * Math.sin(λ);
- z0 = Math.sin(φ);
- d3_geo_centroidPointXYZ(x0, y0, z0);
- };
- d3_geo_centroid.lineEnd = function() {
- nextPoint(λ00, φ00);
- d3_geo_centroid.lineEnd = d3_geo_centroidLineEnd;
- d3_geo_centroid.point = d3_geo_centroidPoint;
- };
- function nextPoint(λ, φ) {
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = Math.sqrt(cx * cx + cy * cy + cz * cz), u = x0 * x + y0 * y + z0 * z, v = m && -d3_acos(u) / m, w = Math.atan2(m, u);
- d3_geo_centroidX2 += v * cx;
- d3_geo_centroidY2 += v * cy;
- d3_geo_centroidZ2 += v * cz;
- d3_geo_centroidW1 += w;
- d3_geo_centroidX1 += w * (x0 + (x0 = x));
- d3_geo_centroidY1 += w * (y0 + (y0 = y));
- d3_geo_centroidZ1 += w * (z0 + (z0 = z));
- d3_geo_centroidPointXYZ(x0, y0, z0);
- }
- }
- function d3_geo_compose(a, b) {
- function compose(x, y) {
- return x = a(x, y), b(x[0], x[1]);
- }
- if (a.invert && b.invert) compose.invert = function(x, y) {
- return x = b.invert(x, y), x && a.invert(x[0], x[1]);
- };
- return compose;
- }
- function d3_true() {
- return true;
- }
- function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) {
- var subject = [], clip = [];
- segments.forEach(function(segment) {
- if ((n = segment.length - 1) <= 0) return;
- var n, p0 = segment[0], p1 = segment[n];
- if (d3_geo_sphericalEqual(p0, p1)) {
- listener.lineStart();
- for (var i = 0; i < n; ++i) listener.point((p0 = segment[i])[0], p0[1]);
- listener.lineEnd();
- return;
- }
- var a = new d3_geo_clipPolygonIntersection(p0, segment, null, true), b = new d3_geo_clipPolygonIntersection(p0, null, a, false);
- a.o = b;
- subject.push(a);
- clip.push(b);
- a = new d3_geo_clipPolygonIntersection(p1, segment, null, false);
- b = new d3_geo_clipPolygonIntersection(p1, null, a, true);
- a.o = b;
- subject.push(a);
- clip.push(b);
- });
- clip.sort(compare);
- d3_geo_clipPolygonLinkCircular(subject);
- d3_geo_clipPolygonLinkCircular(clip);
- if (!subject.length) return;
- for (var i = 0, entry = clipStartInside, n = clip.length; i < n; ++i) {
- clip[i].e = entry = !entry;
- }
- var start = subject[0], points, point;
- while (1) {
- var current = start, isSubject = true;
- while (current.v) if ((current = current.n) === start) return;
- points = current.z;
- listener.lineStart();
- do {
- current.v = current.o.v = true;
- if (current.e) {
- if (isSubject) {
- for (var i = 0, n = points.length; i < n; ++i) listener.point((point = points[i])[0], point[1]);
- } else {
- interpolate(current.x, current.n.x, 1, listener);
- }
- current = current.n;
- } else {
- if (isSubject) {
- points = current.p.z;
- for (var i = points.length - 1; i >= 0; --i) listener.point((point = points[i])[0], point[1]);
- } else {
- interpolate(current.x, current.p.x, -1, listener);
- }
- current = current.p;
- }
- current = current.o;
- points = current.z;
- isSubject = !isSubject;
- } while (!current.v);
- listener.lineEnd();
- }
- }
- function d3_geo_clipPolygonLinkCircular(array) {
- if (!(n = array.length)) return;
- var n, i = 0, a = array[0], b;
- while (++i < n) {
- a.n = b = array[i];
- b.p = a;
- a = b;
- }
- a.n = b = array[0];
- b.p = a;
- }
- function d3_geo_clipPolygonIntersection(point, points, other, entry) {
- this.x = point;
- this.z = points;
- this.o = other;
- this.e = entry;
- this.v = false;
- this.n = this.p = null;
- }
- function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) {
- return function(rotate, listener) {
- var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]);
- var clip = {
- point: point,
- lineStart: lineStart,
- lineEnd: lineEnd,
- polygonStart: function() {
- clip.point = pointRing;
- clip.lineStart = ringStart;
- clip.lineEnd = ringEnd;
- segments = [];
- polygon = [];
- },
- polygonEnd: function() {
- clip.point = point;
- clip.lineStart = lineStart;
- clip.lineEnd = lineEnd;
- segments = d3.merge(segments);
- var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon);
- if (segments.length) {
- if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
- d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener);
- } else if (clipStartInside) {
- if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
- listener.lineStart();
- interpolate(null, null, 1, listener);
- listener.lineEnd();
- }
- if (polygonStarted) listener.polygonEnd(), polygonStarted = false;
- segments = polygon = null;
- },
- sphere: function() {
- listener.polygonStart();
- listener.lineStart();
- interpolate(null, null, 1, listener);
- listener.lineEnd();
- listener.polygonEnd();
- }
- };
- function point(λ, φ) {
- var point = rotate(λ, φ);
- if (pointVisible(λ = point[0], φ = point[1])) listener.point(λ, φ);
- }
- function pointLine(λ, φ) {
- var point = rotate(λ, φ);
- line.point(point[0], point[1]);
- }
- function lineStart() {
- clip.point = pointLine;
- line.lineStart();
- }
- function lineEnd() {
- clip.point = point;
- line.lineEnd();
- }
- var segments;
- var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygonStarted = false, polygon, ring;
- function pointRing(λ, φ) {
- ring.push([ λ, φ ]);
- var point = rotate(λ, φ);
- ringListener.point(point[0], point[1]);
- }
- function ringStart() {
- ringListener.lineStart();
- ring = [];
- }
- function ringEnd() {
- pointRing(ring[0][0], ring[0][1]);
- ringListener.lineEnd();
- var clean = ringListener.clean(), ringSegments = buffer.buffer(), segment, n = ringSegments.length;
- ring.pop();
- polygon.push(ring);
- ring = null;
- if (!n) return;
- if (clean & 1) {
- segment = ringSegments[0];
- var n = segment.length - 1, i = -1, point;
- if (n > 0) {
- if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
- listener.lineStart();
- while (++i < n) listener.point((point = segment[i])[0], point[1]);
- listener.lineEnd();
- }
- return;
- }
- if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
- segments.push(ringSegments.filter(d3_geo_clipSegmentLength1));
- }
- return clip;
- };
- }
- function d3_geo_clipSegmentLength1(segment) {
- return segment.length > 1;
- }
- function d3_geo_clipBufferListener() {
- var lines = [], line;
- return {
- lineStart: function() {
- lines.push(line = []);
- },
- point: function(λ, φ) {
- line.push([ λ, φ ]);
- },
- lineEnd: d3_noop,
- buffer: function() {
- var buffer = lines;
- lines = [];
- line = null;
- return buffer;
- },
- rejoin: function() {
- if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));
- }
- };
- }
- function d3_geo_clipSort(a, b) {
- return ((a = a.x)[0] < 0 ? a[1] - halfπ - ε : halfπ - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfπ - ε : halfπ - b[1]);
- }
- var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -π, -π / 2 ]);
- function d3_geo_clipAntimeridianLine(listener) {
- var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean;
- return {
- lineStart: function() {
- listener.lineStart();
- clean = 1;
- },
- point: function(λ1, φ1) {
- var sλ1 = λ1 > 0 ? π : -π, dλ = abs(λ1 - λ0);
- if (abs(dλ - π) < ε) {
- listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? halfπ : -halfπ);
- listener.point(sλ0, φ0);
- listener.lineEnd();
- listener.lineStart();
- listener.point(sλ1, φ0);
- listener.point(λ1, φ0);
- clean = 0;
- } else if (sλ0 !== sλ1 && dλ >= π) {
- if (abs(λ0 - sλ0) < ε) λ0 -= sλ0 * ε;
- if (abs(λ1 - sλ1) < ε) λ1 -= sλ1 * ε;
- φ0 = d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1);
- listener.point(sλ0, φ0);
- listener.lineEnd();
- listener.lineStart();
- listener.point(sλ1, φ0);
- clean = 0;
- }
- listener.point(λ0 = λ1, φ0 = φ1);
- sλ0 = sλ1;
- },
- lineEnd: function() {
- listener.lineEnd();
- λ0 = φ0 = NaN;
- },
- clean: function() {
- return 2 - clean;
- }
- };
- }
- function d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1) {
- var cosφ0, cosφ1, sinλ0_λ1 = Math.sin(λ0 - λ1);
- return abs(sinλ0_λ1) > ε ? Math.atan((Math.sin(φ0) * (cosφ1 = Math.cos(φ1)) * Math.sin(λ1) - Math.sin(φ1) * (cosφ0 = Math.cos(φ0)) * Math.sin(λ0)) / (cosφ0 * cosφ1 * sinλ0_λ1)) : (φ0 + φ1) / 2;
- }
- function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) {
- var φ;
- if (from == null) {
- φ = direction * halfπ;
- listener.point(-π, φ);
- listener.point(0, φ);
- listener.point(π, φ);
- listener.point(π, 0);
- listener.point(π, -φ);
- listener.point(0, -φ);
- listener.point(-π, -φ);
- listener.point(-π, 0);
- listener.point(-π, φ);
- } else if (abs(from[0] - to[0]) > ε) {
- var s = from[0] < to[0] ? π : -π;
- φ = direction * s / 2;
- listener.point(-s, φ);
- listener.point(0, φ);
- listener.point(s, φ);
- } else {
- listener.point(to[0], to[1]);
- }
- }
- function d3_geo_pointInPolygon(point, polygon) {
- var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0;
- d3_geo_areaRingSum.reset();
- for (var i = 0, n = polygon.length; i < n; ++i) {
- var ring = polygon[i], m = ring.length;
- if (!m) continue;
- var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1;
- while (true) {
- if (j === m) j = 0;
- point = ring[j];
- var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, antimeridian = adλ > π, k = sinφ0 * sinφ;
- d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ)));
- polarAngle += antimeridian ? dλ + sdλ * τ : dλ;
- if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) {
- var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point));
- d3_geo_cartesianNormalize(arc);
- var intersection = d3_geo_cartesianCross(meridianNormal, arc);
- d3_geo_cartesianNormalize(intersection);
- var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]);
- if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) {
- winding += antimeridian ^ dλ >= 0 ? 1 : -1;
- }
- }
- if (!j++) break;
- λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point;
- }
- }
- return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < -ε) ^ winding & 1;
- }
- function d3_geo_clipCircle(radius) {
- var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians);
- return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]);
- function visible(λ, φ) {
- return Math.cos(λ) * Math.cos(φ) > cr;
- }
- function clipLine(listener) {
- var point0, c0, v0, v00, clean;
- return {
- lineStart: function() {
- v00 = v0 = false;
- clean = 1;
- },
- point: function(λ, φ) {
- var point1 = [ λ, φ ], point2, v = visible(λ, φ), c = smallRadius ? v ? 0 : code(λ, φ) : v ? code(λ + (λ < 0 ? π : -π), φ) : 0;
- if (!point0 && (v00 = v0 = v)) listener.lineStart();
- if (v !== v0) {
- point2 = intersect(point0, point1);
- if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) {
- point1[0] += ε;
- point1[1] += ε;
- v = visible(point1[0], point1[1]);
- }
- }
- if (v !== v0) {
- clean = 0;
- if (v) {
- listener.lineStart();
- point2 = intersect(point1, point0);
- listener.point(point2[0], point2[1]);
- } else {
- point2 = intersect(point0, point1);
- listener.point(point2[0], point2[1]);
- listener.lineEnd();
- }
- point0 = point2;
- } else if (notHemisphere && point0 && smallRadius ^ v) {
- var t;
- if (!(c & c0) && (t = intersect(point1, point0, true))) {
- clean = 0;
- if (smallRadius) {
- listener.lineStart();
- listener.point(t[0][0], t[0][1]);
- listener.point(t[1][0], t[1][1]);
- listener.lineEnd();
- } else {
- listener.point(t[1][0], t[1][1]);
- listener.lineEnd();
- listener.lineStart();
- listener.point(t[0][0], t[0][1]);
- }
- }
- }
- if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) {
- listener.point(point1[0], point1[1]);
- }
- point0 = point1, v0 = v, c0 = c;
- },
- lineEnd: function() {
- if (v0) listener.lineEnd();
- point0 = null;
- },
- clean: function() {
- return clean | (v00 && v0) << 1;
- }
- };
- }
- function intersect(a, b, two) {
- var pa = d3_geo_cartesian(a), pb = d3_geo_cartesian(b);
- var n1 = [ 1, 0, 0 ], n2 = d3_geo_cartesianCross(pa, pb), n2n2 = d3_geo_cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2;
- if (!determinant) return !two && a;
- var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = d3_geo_cartesianCross(n1, n2), A = d3_geo_cartesianScale(n1, c1), B = d3_geo_cartesianScale(n2, c2);
- d3_geo_cartesianAdd(A, B);
- var u = n1xn2, w = d3_geo_cartesianDot(A, u), uu = d3_geo_cartesianDot(u, u), t2 = w * w - uu * (d3_geo_cartesianDot(A, A) - 1);
- if (t2 < 0) return;
- var t = Math.sqrt(t2), q = d3_geo_cartesianScale(u, (-w - t) / uu);
- d3_geo_cartesianAdd(q, A);
- q = d3_geo_spherical(q);
- if (!two) return q;
- var λ0 = a[0], λ1 = b[0], φ0 = a[1], φ1 = b[1], z;
- if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z;
- var δλ = λ1 - λ0, polar = abs(δλ - π) < ε, meridian = polar || δλ < ε;
- if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z;
- if (meridian ? polar ? φ0 + φ1 > 0 ^ q[1] < (abs(q[0] - λ0) < ε ? φ0 : φ1) : φ0 <= q[1] && q[1] <= φ1 : δλ > π ^ (λ0 <= q[0] && q[0] <= λ1)) {
- var q1 = d3_geo_cartesianScale(u, (-w + t) / uu);
- d3_geo_cartesianAdd(q1, A);
- return [ q, d3_geo_spherical(q1) ];
- }
- }
- function code(λ, φ) {
- var r = smallRadius ? radius : π - radius, code = 0;
- if (λ < -r) code |= 1; else if (λ > r) code |= 2;
- if (φ < -r) code |= 4; else if (φ > r) code |= 8;
- return code;
- }
- }
- function d3_geom_clipLine(x0, y0, x1, y1) {
- return function(line) {
- var a = line.a, b = line.b, ax = a.x, ay = a.y, bx = b.x, by = b.y, t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r;
- r = x0 - ax;
- if (!dx && r > 0) return;
- r /= dx;
- if (dx < 0) {
- if (r < t0) return;
- if (r < t1) t1 = r;
- } else if (dx > 0) {
- if (r > t1) return;
- if (r > t0) t0 = r;
- }
- r = x1 - ax;
- if (!dx && r < 0) return;
- r /= dx;
- if (dx < 0) {
- if (r > t1) return;
- if (r > t0) t0 = r;
- } else if (dx > 0) {
- if (r < t0) return;
- if (r < t1) t1 = r;
- }
- r = y0 - ay;
- if (!dy && r > 0) return;
- r /= dy;
- if (dy < 0) {
- if (r < t0) return;
- if (r < t1) t1 = r;
- } else if (dy > 0) {
- if (r > t1) return;
- if (r > t0) t0 = r;
- }
- r = y1 - ay;
- if (!dy && r < 0) return;
- r /= dy;
- if (dy < 0) {
- if (r > t1) return;
- if (r > t0) t0 = r;
- } else if (dy > 0) {
- if (r < t0) return;
- if (r < t1) t1 = r;
- }
- if (t0 > 0) line.a = {
- x: ax + t0 * dx,
- y: ay + t0 * dy
- };
- if (t1 < 1) line.b = {
- x: ax + t1 * dx,
- y: ay + t1 * dy
- };
- return line;
- };
- }
- var d3_geo_clipExtentMAX = 1e9;
- d3.geo.clipExtent = function() {
- var x0, y0, x1, y1, stream, clip, clipExtent = {
- stream: function(output) {
- if (stream) stream.valid = false;
- stream = clip(output);
- stream.valid = true;
- return stream;
- },
- extent: function(_) {
- if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];
- clip = d3_geo_clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]);
- if (stream) stream.valid = false, stream = null;
- return clipExtent;
- }
- };
- return clipExtent.extent([ [ 0, 0 ], [ 960, 500 ] ]);
- };
- function d3_geo_clipExtent(x0, y0, x1, y1) {
- return function(listener) {
- var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), clipLine = d3_geom_clipLine(x0, y0, x1, y1), segments, polygon, ring;
- var clip = {
- point: point,
- lineStart: lineStart,
- lineEnd: lineEnd,
- polygonStart: function() {
- listener = bufferListener;
- segments = [];
- polygon = [];
- clean = true;
- },
- polygonEnd: function() {
- listener = listener_;
- segments = d3.merge(segments);
- var clipStartInside = insidePolygon([ x0, y1 ]), inside = clean && clipStartInside, visible = segments.length;
- if (inside || visible) {
- listener.polygonStart();
- if (inside) {
- listener.lineStart();
- interpolate(null, null, 1, listener);
- listener.lineEnd();
- }
- if (visible) {
- d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener);
- }
- listener.polygonEnd();
- }
- segments = polygon = ring = null;
- }
- };
- function insidePolygon(p) {
- var wn = 0, n = polygon.length, y = p[1];
- for (var i = 0; i < n; ++i) {
- for (var j = 1, v = polygon[i], m = v.length, a = v[0], b; j < m; ++j) {
- b = v[j];
- if (a[1] <= y) {
- if (b[1] > y && d3_cross2d(a, b, p) > 0) ++wn;
- } else {
- if (b[1] <= y && d3_cross2d(a, b, p) < 0) --wn;
- }
- a = b;
- }
- }
- return wn !== 0;
- }
- function interpolate(from, to, direction, listener) {
- var a = 0, a1 = 0;
- if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoints(from, to) < 0 ^ direction > 0) {
- do {
- listener.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);
- } while ((a = (a + direction + 4) % 4) !== a1);
- } else {
- listener.point(to[0], to[1]);
- }
- }
- function pointVisible(x, y) {
- return x0 <= x && x <= x1 && y0 <= y && y <= y1;
- }
- function point(x, y) {
- if (pointVisible(x, y)) listener.point(x, y);
- }
- var x__, y__, v__, x_, y_, v_, first, clean;
- function lineStart() {
- clip.point = linePoint;
- if (polygon) polygon.push(ring = []);
- first = true;
- v_ = false;
- x_ = y_ = NaN;
- }
- function lineEnd() {
- if (segments) {
- linePoint(x__, y__);
- if (v__ && v_) bufferListener.rejoin();
- segments.push(bufferListener.buffer());
- }
- clip.point = point;
- if (v_) listener.lineEnd();
- }
- function linePoint(x, y) {
- x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x));
- y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y));
- var v = pointVisible(x, y);
- if (polygon) ring.push([ x, y ]);
- if (first) {
- x__ = x, y__ = y, v__ = v;
- first = false;
- if (v) {
- listener.lineStart();
- listener.point(x, y);
- }
- } else {
- if (v && v_) listener.point(x, y); else {
- var l = {
- a: {
- x: x_,
- y: y_
- },
- b: {
- x: x,
- y: y
- }
- };
- if (clipLine(l)) {
- if (!v_) {
- listener.lineStart();
- listener.point(l.a.x, l.a.y);
- }
- listener.point(l.b.x, l.b.y);
- if (!v) listener.lineEnd();
- clean = false;
- } else if (v) {
- listener.lineStart();
- listener.point(x, y);
- clean = false;
- }
- }
- }
- x_ = x, y_ = y, v_ = v;
- }
- return clip;
- };
- function corner(p, direction) {
- return abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2;
- }
- function compare(a, b) {
- return comparePoints(a.x, b.x);
- }
- function comparePoints(a, b) {
- var ca = corner(a, 1), cb = corner(b, 1);
- return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0];
- }
- }
- function d3_geo_conic(projectAt) {
- var φ0 = 0, φ1 = π / 3, m = d3_geo_projectionMutator(projectAt), p = m(φ0, φ1);
- p.parallels = function(_) {
- if (!arguments.length) return [ φ0 / π * 180, φ1 / π * 180 ];
- return m(φ0 = _[0] * π / 180, φ1 = _[1] * π / 180);
- };
- return p;
- }
- function d3_geo_conicEqualArea(φ0, φ1) {
- var sinφ0 = Math.sin(φ0), n = (sinφ0 + Math.sin(φ1)) / 2, C = 1 + sinφ0 * (2 * n - sinφ0), ρ0 = Math.sqrt(C) / n;
- function forward(λ, φ) {
- var ρ = Math.sqrt(C - 2 * n * Math.sin(φ)) / n;
- return [ ρ * Math.sin(λ *= n), ρ0 - ρ * Math.cos(λ) ];
- }
- forward.invert = function(x, y) {
- var ρ0_y = ρ0 - y;
- return [ Math.atan2(x, ρ0_y) / n, d3_asin((C - (x * x + ρ0_y * ρ0_y) * n * n) / (2 * n)) ];
- };
- return forward;
- }
- (d3.geo.conicEqualArea = function() {
- return d3_geo_conic(d3_geo_conicEqualArea);
- }).raw = d3_geo_conicEqualArea;
- d3.geo.albers = function() {
- return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070);
- };
- d3.geo.albersUsa = function() {
- var lower48 = d3.geo.albers();
- var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]);
- var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]);
- var point, pointStream = {
- point: function(x, y) {
- point = [ x, y ];
- }
- }, lower48Point, alaskaPoint, hawaiiPoint;
- function albersUsa(coordinates) {
- var x = coordinates[0], y = coordinates[1];
- point = null;
- (lower48Point(x, y), point) || (alaskaPoint(x, y), point) || hawaiiPoint(x, y);
- return point;
- }
- albersUsa.invert = function(coordinates) {
- var k = lower48.scale(), t = lower48.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
- return (y >= .12 && y < .234 && x >= -.425 && x < -.214 ? alaska : y >= .166 && y < .234 && x >= -.214 && x < -.115 ? hawaii : lower48).invert(coordinates);
- };
- albersUsa.stream = function(stream) {
- var lower48Stream = lower48.stream(stream), alaskaStream = alaska.stream(stream), hawaiiStream = hawaii.stream(stream);
- return {
- point: function(x, y) {
- lower48Stream.point(x, y);
- alaskaStream.point(x, y);
- hawaiiStream.point(x, y);
- },
- sphere: function() {
- lower48Stream.sphere();
- alaskaStream.sphere();
- hawaiiStream.sphere();
- },
- lineStart: function() {
- lower48Stream.lineStart();
- alaskaStream.lineStart();
- hawaiiStream.lineStart();
- },
- lineEnd: function() {
- lower48Stream.lineEnd();
- alaskaStream.lineEnd();
- hawaiiStream.lineEnd();
- },
- polygonStart: function() {
- lower48Stream.polygonStart();
- alaskaStream.polygonStart();
- hawaiiStream.polygonStart();
- },
- polygonEnd: function() {
- lower48Stream.polygonEnd();
- alaskaStream.polygonEnd();
- hawaiiStream.polygonEnd();
- }
- };
- };
- albersUsa.precision = function(_) {
- if (!arguments.length) return lower48.precision();
- lower48.precision(_);
- alaska.precision(_);
- hawaii.precision(_);
- return albersUsa;
- };
- albersUsa.scale = function(_) {
- if (!arguments.length) return lower48.scale();
- lower48.scale(_);
- alaska.scale(_ * .35);
- hawaii.scale(_);
- return albersUsa.translate(lower48.translate());
- };
- albersUsa.translate = function(_) {
- if (!arguments.length) return lower48.translate();
- var k = lower48.scale(), x = +_[0], y = +_[1];
- lower48Point = lower48.translate(_).clipExtent([ [ x - .455 * k, y - .238 * k ], [ x + .455 * k, y + .238 * k ] ]).stream(pointStream).point;
- alaskaPoint = alaska.translate([ x - .307 * k, y + .201 * k ]).clipExtent([ [ x - .425 * k + ε, y + .12 * k + ε ], [ x - .214 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;
- hawaiiPoint = hawaii.translate([ x - .205 * k, y + .212 * k ]).clipExtent([ [ x - .214 * k + ε, y + .166 * k + ε ], [ x - .115 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;
- return albersUsa;
- };
- return albersUsa.scale(1070);
- };
- var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = {
- point: d3_noop,
- lineStart: d3_noop,
- lineEnd: d3_noop,
- polygonStart: function() {
- d3_geo_pathAreaPolygon = 0;
- d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart;
- },
- polygonEnd: function() {
- d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop;
- d3_geo_pathAreaSum += abs(d3_geo_pathAreaPolygon / 2);
- }
- };
- function d3_geo_pathAreaRingStart() {
- var x00, y00, x0, y0;
- d3_geo_pathArea.point = function(x, y) {
- d3_geo_pathArea.point = nextPoint;
- x00 = x0 = x, y00 = y0 = y;
- };
- function nextPoint(x, y) {
- d3_geo_pathAreaPolygon += y0 * x - x0 * y;
- x0 = x, y0 = y;
- }
- d3_geo_pathArea.lineEnd = function() {
- nextPoint(x00, y00);
- };
- }
- var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1;
- var d3_geo_pathBounds = {
- point: d3_geo_pathBoundsPoint,
- lineStart: d3_noop,
- lineEnd: d3_noop,
- polygonStart: d3_noop,
- polygonEnd: d3_noop
- };
- function d3_geo_pathBoundsPoint(x, y) {
- if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x;
- if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x;
- if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y;
- if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y;
- }
- function d3_geo_pathBuffer() {
- var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = [];
- var stream = {
- point: point,
- lineStart: function() {
- stream.point = pointLineStart;
- },
- lineEnd: lineEnd,
- polygonStart: function() {
- stream.lineEnd = lineEndPolygon;
- },
- polygonEnd: function() {
- stream.lineEnd = lineEnd;
- stream.point = point;
- },
- pointRadius: function(_) {
- pointCircle = d3_geo_pathBufferCircle(_);
- return stream;
- },
- result: function() {
- if (buffer.length) {
- var result = buffer.join("");
- buffer = [];
- return result;
- }
- }
- };
- function point(x, y) {
- buffer.push("M", x, ",", y, pointCircle);
- }
- function pointLineStart(x, y) {
- buffer.push("M", x, ",", y);
- stream.point = pointLine;
- }
- function pointLine(x, y) {
- buffer.push("L", x, ",", y);
- }
- function lineEnd() {
- stream.point = point;
- }
- function lineEndPolygon() {
- buffer.push("Z");
- }
- return stream;
- }
- function d3_geo_pathBufferCircle(radius) {
- return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + "z";
- }
- var d3_geo_pathCentroid = {
- point: d3_geo_pathCentroidPoint,
- lineStart: d3_geo_pathCentroidLineStart,
- lineEnd: d3_geo_pathCentroidLineEnd,
- polygonStart: function() {
- d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart;
- },
- polygonEnd: function() {
- d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;
- d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart;
- d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd;
- }
- };
- function d3_geo_pathCentroidPoint(x, y) {
- d3_geo_centroidX0 += x;
- d3_geo_centroidY0 += y;
- ++d3_geo_centroidZ0;
- }
- function d3_geo_pathCentroidLineStart() {
- var x0, y0;
- d3_geo_pathCentroid.point = function(x, y) {
- d3_geo_pathCentroid.point = nextPoint;
- d3_geo_pathCentroidPoint(x0 = x, y0 = y);
- };
- function nextPoint(x, y) {
- var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);
- d3_geo_centroidX1 += z * (x0 + x) / 2;
- d3_geo_centroidY1 += z * (y0 + y) / 2;
- d3_geo_centroidZ1 += z;
- d3_geo_pathCentroidPoint(x0 = x, y0 = y);
- }
- }
- function d3_geo_pathCentroidLineEnd() {
- d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;
- }
- function d3_geo_pathCentroidRingStart() {
- var x00, y00, x0, y0;
- d3_geo_pathCentroid.point = function(x, y) {
- d3_geo_pathCentroid.point = nextPoint;
- d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y);
- };
- function nextPoint(x, y) {
- var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);
- d3_geo_centroidX1 += z * (x0 + x) / 2;
- d3_geo_centroidY1 += z * (y0 + y) / 2;
- d3_geo_centroidZ1 += z;
- z = y0 * x - x0 * y;
- d3_geo_centroidX2 += z * (x0 + x);
- d3_geo_centroidY2 += z * (y0 + y);
- d3_geo_centroidZ2 += z * 3;
- d3_geo_pathCentroidPoint(x0 = x, y0 = y);
- }
- d3_geo_pathCentroid.lineEnd = function() {
- nextPoint(x00, y00);
- };
- }
- function d3_geo_pathContext(context) {
- var pointRadius = 4.5;
- var stream = {
- point: point,
- lineStart: function() {
- stream.point = pointLineStart;
- },
- lineEnd: lineEnd,
- polygonStart: function() {
- stream.lineEnd = lineEndPolygon;
- },
- polygonEnd: function() {
- stream.lineEnd = lineEnd;
- stream.point = point;
- },
- pointRadius: function(_) {
- pointRadius = _;
- return stream;
- },
- result: d3_noop
- };
- function point(x, y) {
- context.moveTo(x + pointRadius, y);
- context.arc(x, y, pointRadius, 0, τ);
- }
- function pointLineStart(x, y) {
- context.moveTo(x, y);
- stream.point = pointLine;
- }
- function pointLine(x, y) {
- context.lineTo(x, y);
- }
- function lineEnd() {
- stream.point = point;
- }
- function lineEndPolygon() {
- context.closePath();
- }
- return stream;
- }
- function d3_geo_resample(project) {
- var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16;
- function resample(stream) {
- return (maxDepth ? resampleRecursive : resampleNone)(stream);
- }
- function resampleNone(stream) {
- return d3_geo_transformPoint(stream, function(x, y) {
- x = project(x, y);
- stream.point(x[0], x[1]);
- });
- }
- function resampleRecursive(stream) {
- var λ00, φ00, x00, y00, a00, b00, c00, λ0, x0, y0, a0, b0, c0;
- var resample = {
- point: point,
- lineStart: lineStart,
- lineEnd: lineEnd,
- polygonStart: function() {
- stream.polygonStart();
- resample.lineStart = ringStart;
- },
- polygonEnd: function() {
- stream.polygonEnd();
- resample.lineStart = lineStart;
- }
- };
- function point(x, y) {
- x = project(x, y);
- stream.point(x[0], x[1]);
- }
- function lineStart() {
- x0 = NaN;
- resample.point = linePoint;
- stream.lineStart();
- }
- function linePoint(λ, φ) {
- var c = d3_geo_cartesian([ λ, φ ]), p = project(λ, φ);
- resampleLineTo(x0, y0, λ0, a0, b0, c0, x0 = p[0], y0 = p[1], λ0 = λ, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);
- stream.point(x0, y0);
- }
- function lineEnd() {
- resample.point = point;
- stream.lineEnd();
- }
- function ringStart() {
- lineStart();
- resample.point = ringPoint;
- resample.lineEnd = ringEnd;
- }
- function ringPoint(λ, φ) {
- linePoint(λ00 = λ, φ00 = φ), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;
- resample.point = linePoint;
- }
- function ringEnd() {
- resampleLineTo(x0, y0, λ0, a0, b0, c0, x00, y00, λ00, a00, b00, c00, maxDepth, stream);
- resample.lineEnd = lineEnd;
- lineEnd();
- }
- return resample;
- }
- function resampleLineTo(x0, y0, λ0, a0, b0, c0, x1, y1, λ1, a1, b1, c1, depth, stream) {
- var dx = x1 - x0, dy = y1 - y0, d2 = dx * dx + dy * dy;
- if (d2 > 4 * δ2 && depth--) {
- var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = Math.sqrt(a * a + b * b + c * c), φ2 = Math.asin(c /= m), λ2 = abs(abs(c) - 1) < ε || abs(λ0 - λ1) < ε ? (λ0 + λ1) / 2 : Math.atan2(b, a), p = project(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x2 - x0, dy2 = y2 - y0, dz = dy * dx2 - dx * dy2;
- if (dz * dz / d2 > δ2 || abs((dx * dx2 + dy * dy2) / d2 - .5) > .3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {
- resampleLineTo(x0, y0, λ0, a0, b0, c0, x2, y2, λ2, a /= m, b /= m, c, depth, stream);
- stream.point(x2, y2);
- resampleLineTo(x2, y2, λ2, a, b, c, x1, y1, λ1, a1, b1, c1, depth, stream);
- }
- }
- }
- resample.precision = function(_) {
- if (!arguments.length) return Math.sqrt(δ2);
- maxDepth = (δ2 = _ * _) > 0 && 16;
- return resample;
- };
- return resample;
- }
- d3.geo.path = function() {
- var pointRadius = 4.5, projection, context, projectStream, contextStream, cacheStream;
- function path(object) {
- if (object) {
- if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments));
- if (!cacheStream || !cacheStream.valid) cacheStream = projectStream(contextStream);
- d3.geo.stream(object, cacheStream);
- }
- return contextStream.result();
- }
- path.area = function(object) {
- d3_geo_pathAreaSum = 0;
- d3.geo.stream(object, projectStream(d3_geo_pathArea));
- return d3_geo_pathAreaSum;
- };
- path.centroid = function(object) {
- d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;
- d3.geo.stream(object, projectStream(d3_geo_pathCentroid));
- return d3_geo_centroidZ2 ? [ d3_geo_centroidX2 / d3_geo_centroidZ2, d3_geo_centroidY2 / d3_geo_centroidZ2 ] : d3_geo_centroidZ1 ? [ d3_geo_centroidX1 / d3_geo_centroidZ1, d3_geo_centroidY1 / d3_geo_centroidZ1 ] : d3_geo_centroidZ0 ? [ d3_geo_centroidX0 / d3_geo_centroidZ0, d3_geo_centroidY0 / d3_geo_centroidZ0 ] : [ NaN, NaN ];
- };
- path.bounds = function(object) {
- d3_geo_pathBoundsX1 = d3_geo_pathBoundsY1 = -(d3_geo_pathBoundsX0 = d3_geo_pathBoundsY0 = Infinity);
- d3.geo.stream(object, projectStream(d3_geo_pathBounds));
- return [ [ d3_geo_pathBoundsX0, d3_geo_pathBoundsY0 ], [ d3_geo_pathBoundsX1, d3_geo_pathBoundsY1 ] ];
- };
- path.projection = function(_) {
- if (!arguments.length) return projection;
- projectStream = (projection = _) ? _.stream || d3_geo_pathProjectStream(_) : d3_identity;
- return reset();
- };
- path.context = function(_) {
- if (!arguments.length) return context;
- contextStream = (context = _) == null ? new d3_geo_pathBuffer() : new d3_geo_pathContext(_);
- if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius);
- return reset();
- };
- path.pointRadius = function(_) {
- if (!arguments.length) return pointRadius;
- pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_);
- return path;
- };
- function reset() {
- cacheStream = null;
- return path;
- }
- return path.projection(d3.geo.albersUsa()).context(null);
- };
- function d3_geo_pathProjectStream(project) {
- var resample = d3_geo_resample(function(x, y) {
- return project([ x * d3_degrees, y * d3_degrees ]);
- });
- return function(stream) {
- return d3_geo_projectionRadians(resample(stream));
- };
- }
- d3.geo.transform = function(methods) {
- return {
- stream: function(stream) {
- var transform = new d3_geo_transform(stream);
- for (var k in methods) transform[k] = methods[k];
- return transform;
- }
- };
- };
- function d3_geo_transform(stream) {
- this.stream = stream;
- }
- d3_geo_transform.prototype = {
- point: function(x, y) {
- this.stream.point(x, y);
- },
- sphere: function() {
- this.stream.sphere();
- },
- lineStart: function() {
- this.stream.lineStart();
- },
- lineEnd: function() {
- this.stream.lineEnd();
- },
- polygonStart: function() {
- this.stream.polygonStart();
- },
- polygonEnd: function() {
- this.stream.polygonEnd();
- }
- };
- function d3_geo_transformPoint(stream, point) {
- return {
- point: point,
- sphere: function() {
- stream.sphere();
- },
- lineStart: function() {
- stream.lineStart();
- },
- lineEnd: function() {
- stream.lineEnd();
- },
- polygonStart: function() {
- stream.polygonStart();
- },
- polygonEnd: function() {
- stream.polygonEnd();
- }
- };
- }
- d3.geo.projection = d3_geo_projection;
- d3.geo.projectionMutator = d3_geo_projectionMutator;
- function d3_geo_projection(project) {
- return d3_geo_projectionMutator(function() {
- return project;
- })();
- }
- function d3_geo_projectionMutator(projectAt) {
- var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) {
- x = project(x, y);
- return [ x[0] * k + δx, δy - x[1] * k ];
- }), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream;
- function projection(point) {
- point = projectRotate(point[0] * d3_radians, point[1] * d3_radians);
- return [ point[0] * k + δx, δy - point[1] * k ];
- }
- function invert(point) {
- point = projectRotate.invert((point[0] - δx) / k, (δy - point[1]) / k);
- return point && [ point[0] * d3_degrees, point[1] * d3_degrees ];
- }
- projection.stream = function(output) {
- if (stream) stream.valid = false;
- stream = d3_geo_projectionRadians(preclip(rotate, projectResample(postclip(output))));
- stream.valid = true;
- return stream;
- };
- projection.clipAngle = function(_) {
- if (!arguments.length) return clipAngle;
- preclip = _ == null ? (clipAngle = _, d3_geo_clipAntimeridian) : d3_geo_clipCircle((clipAngle = +_) * d3_radians);
- return invalidate();
- };
- projection.clipExtent = function(_) {
- if (!arguments.length) return clipExtent;
- clipExtent = _;
- postclip = _ ? d3_geo_clipExtent(_[0][0], _[0][1], _[1][0], _[1][1]) : d3_identity;
- return invalidate();
- };
- projection.scale = function(_) {
- if (!arguments.length) return k;
- k = +_;
- return reset();
- };
- projection.translate = function(_) {
- if (!arguments.length) return [ x, y ];
- x = +_[0];
- y = +_[1];
- return reset();
- };
- projection.center = function(_) {
- if (!arguments.length) return [ λ * d3_degrees, φ * d3_degrees ];
- λ = _[0] % 360 * d3_radians;
- φ = _[1] % 360 * d3_radians;
- return reset();
- };
- projection.rotate = function(_) {
- if (!arguments.length) return [ δλ * d3_degrees, δφ * d3_degrees, δγ * d3_degrees ];
- δλ = _[0] % 360 * d3_radians;
- δφ = _[1] % 360 * d3_radians;
- δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0;
- return reset();
- };
- d3.rebind(projection, projectResample, "precision");
- function reset() {
- projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project);
- var center = project(λ, φ);
- δx = x - center[0] * k;
- δy = y + center[1] * k;
- return invalidate();
- }
- function invalidate() {
- if (stream) stream.valid = false, stream = null;
- return projection;
- }
- return function() {
- project = projectAt.apply(this, arguments);
- projection.invert = project.invert && invert;
- return reset();
- };
- }
- function d3_geo_projectionRadians(stream) {
- return d3_geo_transformPoint(stream, function(x, y) {
- stream.point(x * d3_radians, y * d3_radians);
- });
- }
- function d3_geo_equirectangular(λ, φ) {
- return [ λ, φ ];
- }
- (d3.geo.equirectangular = function() {
- return d3_geo_projection(d3_geo_equirectangular);
- }).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular;
- d3.geo.rotation = function(rotate) {
- rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0);
- function forward(coordinates) {
- coordinates = rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians);
- return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;
- }
- forward.invert = function(coordinates) {
- coordinates = rotate.invert(coordinates[0] * d3_radians, coordinates[1] * d3_radians);
- return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;
- };
- return forward;
- };
- function d3_geo_identityRotation(λ, φ) {
- return [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];
- }
- d3_geo_identityRotation.invert = d3_geo_equirectangular;
- function d3_geo_rotation(δλ, δφ, δγ) {
- return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation;
- }
- function d3_geo_forwardRotationλ(δλ) {
- return function(λ, φ) {
- return λ += δλ, [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];
- };
- }
- function d3_geo_rotationλ(δλ) {
- var rotation = d3_geo_forwardRotationλ(δλ);
- rotation.invert = d3_geo_forwardRotationλ(-δλ);
- return rotation;
- }
- function d3_geo_rotationφγ(δφ, δγ) {
- var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ);
- function rotation(λ, φ) {
- var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ;
- return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ];
- }
- rotation.invert = function(λ, φ) {
- var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ;
- return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ];
- };
- return rotation;
- }
- d3.geo.circle = function() {
- var origin = [ 0, 0 ], angle, precision = 6, interpolate;
- function circle() {
- var center = typeof origin === "function" ? origin.apply(this, arguments) : origin, rotate = d3_geo_rotation(-center[0] * d3_radians, -center[1] * d3_radians, 0).invert, ring = [];
- interpolate(null, null, 1, {
- point: function(x, y) {
- ring.push(x = rotate(x, y));
- x[0] *= d3_degrees, x[1] *= d3_degrees;
- }
- });
- return {
- type: "Polygon",
- coordinates: [ ring ]
- };
- }
- circle.origin = function(x) {
- if (!arguments.length) return origin;
- origin = x;
- return circle;
- };
- circle.angle = function(x) {
- if (!arguments.length) return angle;
- interpolate = d3_geo_circleInterpolate((angle = +x) * d3_radians, precision * d3_radians);
- return circle;
- };
- circle.precision = function(_) {
- if (!arguments.length) return precision;
- interpolate = d3_geo_circleInterpolate(angle * d3_radians, (precision = +_) * d3_radians);
- return circle;
- };
- return circle.angle(90);
- };
- function d3_geo_circleInterpolate(radius, precision) {
- var cr = Math.cos(radius), sr = Math.sin(radius);
- return function(from, to, direction, listener) {
- var step = direction * precision;
- if (from != null) {
- from = d3_geo_circleAngle(cr, from);
- to = d3_geo_circleAngle(cr, to);
- if (direction > 0 ? from < to : from > to) from += direction * τ;
- } else {
- from = radius + direction * τ;
- to = radius - .5 * step;
- }
- for (var point, t = from; direction > 0 ? t > to : t < to; t -= step) {
- listener.point((point = d3_geo_spherical([ cr, -sr * Math.cos(t), -sr * Math.sin(t) ]))[0], point[1]);
- }
- };
- }
- function d3_geo_circleAngle(cr, point) {
- var a = d3_geo_cartesian(point);
- a[0] -= cr;
- d3_geo_cartesianNormalize(a);
- var angle = d3_acos(-a[1]);
- return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI);
- }
- d3.geo.distance = function(a, b) {
- var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t;
- return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ);
- };
- d3.geo.graticule = function() {
- var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5;
- function graticule() {
- return {
- type: "MultiLineString",
- coordinates: lines()
- };
- }
- function lines() {
- return d3.range(Math.ceil(X0 / DX) * DX, X1, DX).map(X).concat(d3.range(Math.ceil(Y0 / DY) * DY, Y1, DY).map(Y)).concat(d3.range(Math.ceil(x0 / dx) * dx, x1, dx).filter(function(x) {
- return abs(x % DX) > ε;
- }).map(x)).concat(d3.range(Math.ceil(y0 / dy) * dy, y1, dy).filter(function(y) {
- return abs(y % DY) > ε;
- }).map(y));
- }
- graticule.lines = function() {
- return lines().map(function(coordinates) {
- return {
- type: "LineString",
- coordinates: coordinates
- };
- });
- };
- graticule.outline = function() {
- return {
- type: "Polygon",
- coordinates: [ X(X0).concat(Y(Y1).slice(1), X(X1).reverse().slice(1), Y(Y0).reverse().slice(1)) ]
- };
- };
- graticule.extent = function(_) {
- if (!arguments.length) return graticule.minorExtent();
- return graticule.majorExtent(_).minorExtent(_);
- };
- graticule.majorExtent = function(_) {
- if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ];
- X0 = +_[0][0], X1 = +_[1][0];
- Y0 = +_[0][1], Y1 = +_[1][1];
- if (X0 > X1) _ = X0, X0 = X1, X1 = _;
- if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;
- return graticule.precision(precision);
- };
- graticule.minorExtent = function(_) {
- if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];
- x0 = +_[0][0], x1 = +_[1][0];
- y0 = +_[0][1], y1 = +_[1][1];
- if (x0 > x1) _ = x0, x0 = x1, x1 = _;
- if (y0 > y1) _ = y0, y0 = y1, y1 = _;
- return graticule.precision(precision);
- };
- graticule.step = function(_) {
- if (!arguments.length) return graticule.minorStep();
- return graticule.majorStep(_).minorStep(_);
- };
- graticule.majorStep = function(_) {
- if (!arguments.length) return [ DX, DY ];
- DX = +_[0], DY = +_[1];
- return graticule;
- };
- graticule.minorStep = function(_) {
- if (!arguments.length) return [ dx, dy ];
- dx = +_[0], dy = +_[1];
- return graticule;
- };
- graticule.precision = function(_) {
- if (!arguments.length) return precision;
- precision = +_;
- x = d3_geo_graticuleX(y0, y1, 90);
- y = d3_geo_graticuleY(x0, x1, precision);
- X = d3_geo_graticuleX(Y0, Y1, 90);
- Y = d3_geo_graticuleY(X0, X1, precision);
- return graticule;
- };
- return graticule.majorExtent([ [ -180, -90 + ε ], [ 180, 90 - ε ] ]).minorExtent([ [ -180, -80 - ε ], [ 180, 80 + ε ] ]);
- };
- function d3_geo_graticuleX(y0, y1, dy) {
- var y = d3.range(y0, y1 - ε, dy).concat(y1);
- return function(x) {
- return y.map(function(y) {
- return [ x, y ];
- });
- };
- }
- function d3_geo_graticuleY(x0, x1, dx) {
- var x = d3.range(x0, x1 - ε, dx).concat(x1);
- return function(y) {
- return x.map(function(x) {
- return [ x, y ];
- });
- };
- }
- function d3_source(d) {
- return d.source;
- }
- function d3_target(d) {
- return d.target;
- }
- d3.geo.greatArc = function() {
- var source = d3_source, source_, target = d3_target, target_;
- function greatArc() {
- return {
- type: "LineString",
- coordinates: [ source_ || source.apply(this, arguments), target_ || target.apply(this, arguments) ]
- };
- }
- greatArc.distance = function() {
- return d3.geo.distance(source_ || source.apply(this, arguments), target_ || target.apply(this, arguments));
- };
- greatArc.source = function(_) {
- if (!arguments.length) return source;
- source = _, source_ = typeof _ === "function" ? null : _;
- return greatArc;
- };
- greatArc.target = function(_) {
- if (!arguments.length) return target;
- target = _, target_ = typeof _ === "function" ? null : _;
- return greatArc;
- };
- greatArc.precision = function() {
- return arguments.length ? greatArc : 0;
- };
- return greatArc;
- };
- d3.geo.interpolate = function(source, target) {
- return d3_geo_interpolate(source[0] * d3_radians, source[1] * d3_radians, target[0] * d3_radians, target[1] * d3_radians);
- };
- function d3_geo_interpolate(x0, y0, x1, y1) {
- var cy0 = Math.cos(y0), sy0 = Math.sin(y0), cy1 = Math.cos(y1), sy1 = Math.sin(y1), kx0 = cy0 * Math.cos(x0), ky0 = cy0 * Math.sin(x0), kx1 = cy1 * Math.cos(x1), ky1 = cy1 * Math.sin(x1), d = 2 * Math.asin(Math.sqrt(d3_haversin(y1 - y0) + cy0 * cy1 * d3_haversin(x1 - x0))), k = 1 / Math.sin(d);
- var interpolate = d ? function(t) {
- var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1;
- return [ Math.atan2(y, x) * d3_degrees, Math.atan2(z, Math.sqrt(x * x + y * y)) * d3_degrees ];
- } : function() {
- return [ x0 * d3_degrees, y0 * d3_degrees ];
- };
- interpolate.distance = d;
- return interpolate;
- }
- d3.geo.length = function(object) {
- d3_geo_lengthSum = 0;
- d3.geo.stream(object, d3_geo_length);
- return d3_geo_lengthSum;
- };
- var d3_geo_lengthSum;
- var d3_geo_length = {
- sphere: d3_noop,
- point: d3_noop,
- lineStart: d3_geo_lengthLineStart,
- lineEnd: d3_noop,
- polygonStart: d3_noop,
- polygonEnd: d3_noop
- };
- function d3_geo_lengthLineStart() {
- var λ0, sinφ0, cosφ0;
- d3_geo_length.point = function(λ, φ) {
- λ0 = λ * d3_radians, sinφ0 = Math.sin(φ *= d3_radians), cosφ0 = Math.cos(φ);
- d3_geo_length.point = nextPoint;
- };
- d3_geo_length.lineEnd = function() {
- d3_geo_length.point = d3_geo_length.lineEnd = d3_noop;
- };
- function nextPoint(λ, φ) {
- var sinφ = Math.sin(φ *= d3_radians), cosφ = Math.cos(φ), t = abs((λ *= d3_radians) - λ0), cosΔλ = Math.cos(t);
- d3_geo_lengthSum += Math.atan2(Math.sqrt((t = cosφ * Math.sin(t)) * t + (t = cosφ0 * sinφ - sinφ0 * cosφ * cosΔλ) * t), sinφ0 * sinφ + cosφ0 * cosφ * cosΔλ);
- λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ;
- }
- }
- function d3_geo_azimuthal(scale, angle) {
- function azimuthal(λ, φ) {
- var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ);
- return [ k * cosφ * Math.sin(λ), k * Math.sin(φ) ];
- }
- azimuthal.invert = function(x, y) {
- var ρ = Math.sqrt(x * x + y * y), c = angle(ρ), sinc = Math.sin(c), cosc = Math.cos(c);
- return [ Math.atan2(x * sinc, ρ * cosc), Math.asin(ρ && y * sinc / ρ) ];
- };
- return azimuthal;
- }
- var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(function(cosλcosφ) {
- return Math.sqrt(2 / (1 + cosλcosφ));
- }, function(ρ) {
- return 2 * Math.asin(ρ / 2);
- });
- (d3.geo.azimuthalEqualArea = function() {
- return d3_geo_projection(d3_geo_azimuthalEqualArea);
- }).raw = d3_geo_azimuthalEqualArea;
- var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(function(cosλcosφ) {
- var c = Math.acos(cosλcosφ);
- return c && c / Math.sin(c);
- }, d3_identity);
- (d3.geo.azimuthalEquidistant = function() {
- return d3_geo_projection(d3_geo_azimuthalEquidistant);
- }).raw = d3_geo_azimuthalEquidistant;
- function d3_geo_conicConformal(φ0, φ1) {
- var cosφ0 = Math.cos(φ0), t = function(φ) {
- return Math.tan(π / 4 + φ / 2);
- }, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n;
- if (!n) return d3_geo_mercator;
- function forward(λ, φ) {
- if (F > 0) {
- if (φ < -halfπ + ε) φ = -halfπ + ε;
- } else {
- if (φ > halfπ - ε) φ = halfπ - ε;
- }
- var ρ = F / Math.pow(t(φ), n);
- return [ ρ * Math.sin(n * λ), F - ρ * Math.cos(n * λ) ];
- }
- forward.invert = function(x, y) {
- var ρ0_y = F - y, ρ = d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y);
- return [ Math.atan2(x, ρ0_y) / n, 2 * Math.atan(Math.pow(F / ρ, 1 / n)) - halfπ ];
- };
- return forward;
- }
- (d3.geo.conicConformal = function() {
- return d3_geo_conic(d3_geo_conicConformal);
- }).raw = d3_geo_conicConformal;
- function d3_geo_conicEquidistant(φ0, φ1) {
- var cosφ0 = Math.cos(φ0), n = φ0 === φ1 ? Math.sin(φ0) : (cosφ0 - Math.cos(φ1)) / (φ1 - φ0), G = cosφ0 / n + φ0;
- if (abs(n) < ε) return d3_geo_equirectangular;
- function forward(λ, φ) {
- var ρ = G - φ;
- return [ ρ * Math.sin(n * λ), G - ρ * Math.cos(n * λ) ];
- }
- forward.invert = function(x, y) {
- var ρ0_y = G - y;
- return [ Math.atan2(x, ρ0_y) / n, G - d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y) ];
- };
- return forward;
- }
- (d3.geo.conicEquidistant = function() {
- return d3_geo_conic(d3_geo_conicEquidistant);
- }).raw = d3_geo_conicEquidistant;
- var d3_geo_gnomonic = d3_geo_azimuthal(function(cosλcosφ) {
- return 1 / cosλcosφ;
- }, Math.atan);
- (d3.geo.gnomonic = function() {
- return d3_geo_projection(d3_geo_gnomonic);
- }).raw = d3_geo_gnomonic;
- function d3_geo_mercator(λ, φ) {
- return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ];
- }
- d3_geo_mercator.invert = function(x, y) {
- return [ x, 2 * Math.atan(Math.exp(y)) - halfπ ];
- };
- function d3_geo_mercatorProjection(project) {
- var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto;
- m.scale = function() {
- var v = scale.apply(m, arguments);
- return v === m ? clipAuto ? m.clipExtent(null) : m : v;
- };
- m.translate = function() {
- var v = translate.apply(m, arguments);
- return v === m ? clipAuto ? m.clipExtent(null) : m : v;
- };
- m.clipExtent = function(_) {
- var v = clipExtent.apply(m, arguments);
- if (v === m) {
- if (clipAuto = _ == null) {
- var k = π * scale(), t = translate();
- clipExtent([ [ t[0] - k, t[1] - k ], [ t[0] + k, t[1] + k ] ]);
- }
- } else if (clipAuto) {
- v = null;
- }
- return v;
- };
- return m.clipExtent(null);
- }
- (d3.geo.mercator = function() {
- return d3_geo_mercatorProjection(d3_geo_mercator);
- }).raw = d3_geo_mercator;
- var d3_geo_orthographic = d3_geo_azimuthal(function() {
- return 1;
- }, Math.asin);
- (d3.geo.orthographic = function() {
- return d3_geo_projection(d3_geo_orthographic);
- }).raw = d3_geo_orthographic;
- var d3_geo_stereographic = d3_geo_azimuthal(function(cosλcosφ) {
- return 1 / (1 + cosλcosφ);
- }, function(ρ) {
- return 2 * Math.atan(ρ);
- });
- (d3.geo.stereographic = function() {
- return d3_geo_projection(d3_geo_stereographic);
- }).raw = d3_geo_stereographic;
- function d3_geo_transverseMercator(λ, φ) {
- return [ Math.log(Math.tan(π / 4 + φ / 2)), -λ ];
- }
- d3_geo_transverseMercator.invert = function(x, y) {
- return [ -y, 2 * Math.atan(Math.exp(x)) - halfπ ];
- };
- (d3.geo.transverseMercator = function() {
- var projection = d3_geo_mercatorProjection(d3_geo_transverseMercator), center = projection.center, rotate = projection.rotate;
- projection.center = function(_) {
- return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]);
- };
- projection.rotate = function(_) {
- return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(),
- [ _[0], _[1], _[2] - 90 ]);
- };
- return rotate([ 0, 0, 90 ]);
- }).raw = d3_geo_transverseMercator;
- d3.geom = {};
- function d3_geom_pointX(d) {
- return d[0];
- }
- function d3_geom_pointY(d) {
- return d[1];
- }
- d3.geom.hull = function(vertices) {
- var x = d3_geom_pointX, y = d3_geom_pointY;
- if (arguments.length) return hull(vertices);
- function hull(data) {
- if (data.length < 3) return [];
- var fx = d3_functor(x), fy = d3_functor(y), i, n = data.length, points = [], flippedPoints = [];
- for (i = 0; i < n; i++) {
- points.push([ +fx.call(this, data[i], i), +fy.call(this, data[i], i), i ]);
- }
- points.sort(d3_geom_hullOrder);
- for (i = 0; i < n; i++) flippedPoints.push([ points[i][0], -points[i][1] ]);
- var upper = d3_geom_hullUpper(points), lower = d3_geom_hullUpper(flippedPoints);
- var skipLeft = lower[0] === upper[0], skipRight = lower[lower.length - 1] === upper[upper.length - 1], polygon = [];
- for (i = upper.length - 1; i >= 0; --i) polygon.push(data[points[upper[i]][2]]);
- for (i = +skipLeft; i < lower.length - skipRight; ++i) polygon.push(data[points[lower[i]][2]]);
- return polygon;
- }
- hull.x = function(_) {
- return arguments.length ? (x = _, hull) : x;
- };
- hull.y = function(_) {
- return arguments.length ? (y = _, hull) : y;
- };
- return hull;
- };
- function d3_geom_hullUpper(points) {
- var n = points.length, hull = [ 0, 1 ], hs = 2;
- for (var i = 2; i < n; i++) {
- while (hs > 1 && d3_cross2d(points[hull[hs - 2]], points[hull[hs - 1]], points[i]) <= 0) --hs;
- hull[hs++] = i;
- }
- return hull.slice(0, hs);
- }
- function d3_geom_hullOrder(a, b) {
- return a[0] - b[0] || a[1] - b[1];
- }
- d3.geom.polygon = function(coordinates) {
- d3_subclass(coordinates, d3_geom_polygonPrototype);
- return coordinates;
- };
- var d3_geom_polygonPrototype = d3.geom.polygon.prototype = [];
- d3_geom_polygonPrototype.area = function() {
- var i = -1, n = this.length, a, b = this[n - 1], area = 0;
- while (++i < n) {
- a = b;
- b = this[i];
- area += a[1] * b[0] - a[0] * b[1];
- }
- return area * .5;
- };
- d3_geom_polygonPrototype.centroid = function(k) {
- var i = -1, n = this.length, x = 0, y = 0, a, b = this[n - 1], c;
- if (!arguments.length) k = -1 / (6 * this.area());
- while (++i < n) {
- a = b;
- b = this[i];
- c = a[0] * b[1] - b[0] * a[1];
- x += (a[0] + b[0]) * c;
- y += (a[1] + b[1]) * c;
- }
- return [ x * k, y * k ];
- };
- d3_geom_polygonPrototype.clip = function(subject) {
- var input, closed = d3_geom_polygonClosed(subject), i = -1, n = this.length - d3_geom_polygonClosed(this), j, m, a = this[n - 1], b, c, d;
- while (++i < n) {
- input = subject.slice();
- subject.length = 0;
- b = this[i];
- c = input[(m = input.length - closed) - 1];
- j = -1;
- while (++j < m) {
- d = input[j];
- if (d3_geom_polygonInside(d, a, b)) {
- if (!d3_geom_polygonInside(c, a, b)) {
- subject.push(d3_geom_polygonIntersect(c, d, a, b));
- }
- subject.push(d);
- } else if (d3_geom_polygonInside(c, a, b)) {
- subject.push(d3_geom_polygonIntersect(c, d, a, b));
- }
- c = d;
- }
- if (closed) subject.push(subject[0]);
- a = b;
- }
- return subject;
- };
- function d3_geom_polygonInside(p, a, b) {
- return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]);
- }
- function d3_geom_polygonIntersect(c, d, a, b) {
- var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21);
- return [ x1 + ua * x21, y1 + ua * y21 ];
- }
- function d3_geom_polygonClosed(coordinates) {
- var a = coordinates[0], b = coordinates[coordinates.length - 1];
- return !(a[0] - b[0] || a[1] - b[1]);
- }
- var d3_geom_voronoiEdges, d3_geom_voronoiCells, d3_geom_voronoiBeaches, d3_geom_voronoiBeachPool = [], d3_geom_voronoiFirstCircle, d3_geom_voronoiCircles, d3_geom_voronoiCirclePool = [];
- function d3_geom_voronoiBeach() {
- d3_geom_voronoiRedBlackNode(this);
- this.edge = this.site = this.circle = null;
- }
- function d3_geom_voronoiCreateBeach(site) {
- var beach = d3_geom_voronoiBeachPool.pop() || new d3_geom_voronoiBeach();
- beach.site = site;
- return beach;
- }
- function d3_geom_voronoiDetachBeach(beach) {
- d3_geom_voronoiDetachCircle(beach);
- d3_geom_voronoiBeaches.remove(beach);
- d3_geom_voronoiBeachPool.push(beach);
- d3_geom_voronoiRedBlackNode(beach);
- }
- function d3_geom_voronoiRemoveBeach(beach) {
- var circle = beach.circle, x = circle.x, y = circle.cy, vertex = {
- x: x,
- y: y
- }, previous = beach.P, next = beach.N, disappearing = [ beach ];
- d3_geom_voronoiDetachBeach(beach);
- var lArc = previous;
- while (lArc.circle && abs(x - lArc.circle.x) < ε && abs(y - lArc.circle.cy) < ε) {
- previous = lArc.P;
- disappearing.unshift(lArc);
- d3_geom_voronoiDetachBeach(lArc);
- lArc = previous;
- }
- disappearing.unshift(lArc);
- d3_geom_voronoiDetachCircle(lArc);
- var rArc = next;
- while (rArc.circle && abs(x - rArc.circle.x) < ε && abs(y - rArc.circle.cy) < ε) {
- next = rArc.N;
- disappearing.push(rArc);
- d3_geom_voronoiDetachBeach(rArc);
- rArc = next;
- }
- disappearing.push(rArc);
- d3_geom_voronoiDetachCircle(rArc);
- var nArcs = disappearing.length, iArc;
- for (iArc = 1; iArc < nArcs; ++iArc) {
- rArc = disappearing[iArc];
- lArc = disappearing[iArc - 1];
- d3_geom_voronoiSetEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);
- }
- lArc = disappearing[0];
- rArc = disappearing[nArcs - 1];
- rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, rArc.site, null, vertex);
- d3_geom_voronoiAttachCircle(lArc);
- d3_geom_voronoiAttachCircle(rArc);
- }
- function d3_geom_voronoiAddBeach(site) {
- var x = site.x, directrix = site.y, lArc, rArc, dxl, dxr, node = d3_geom_voronoiBeaches._;
- while (node) {
- dxl = d3_geom_voronoiLeftBreakPoint(node, directrix) - x;
- if (dxl > ε) node = node.L; else {
- dxr = x - d3_geom_voronoiRightBreakPoint(node, directrix);
- if (dxr > ε) {
- if (!node.R) {
- lArc = node;
- break;
- }
- node = node.R;
- } else {
- if (dxl > -ε) {
- lArc = node.P;
- rArc = node;
- } else if (dxr > -ε) {
- lArc = node;
- rArc = node.N;
- } else {
- lArc = rArc = node;
- }
- break;
- }
- }
- }
- var newArc = d3_geom_voronoiCreateBeach(site);
- d3_geom_voronoiBeaches.insert(lArc, newArc);
- if (!lArc && !rArc) return;
- if (lArc === rArc) {
- d3_geom_voronoiDetachCircle(lArc);
- rArc = d3_geom_voronoiCreateBeach(lArc.site);
- d3_geom_voronoiBeaches.insert(newArc, rArc);
- newArc.edge = rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);
- d3_geom_voronoiAttachCircle(lArc);
- d3_geom_voronoiAttachCircle(rArc);
- return;
- }
- if (!rArc) {
- newArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);
- return;
- }
- d3_geom_voronoiDetachCircle(lArc);
- d3_geom_voronoiDetachCircle(rArc);
- var lSite = lArc.site, ax = lSite.x, ay = lSite.y, bx = site.x - ax, by = site.y - ay, rSite = rArc.site, cx = rSite.x - ax, cy = rSite.y - ay, d = 2 * (bx * cy - by * cx), hb = bx * bx + by * by, hc = cx * cx + cy * cy, vertex = {
- x: (cy * hb - by * hc) / d + ax,
- y: (bx * hc - cx * hb) / d + ay
- };
- d3_geom_voronoiSetEdgeEnd(rArc.edge, lSite, rSite, vertex);
- newArc.edge = d3_geom_voronoiCreateEdge(lSite, site, null, vertex);
- rArc.edge = d3_geom_voronoiCreateEdge(site, rSite, null, vertex);
- d3_geom_voronoiAttachCircle(lArc);
- d3_geom_voronoiAttachCircle(rArc);
- }
- function d3_geom_voronoiLeftBreakPoint(arc, directrix) {
- var site = arc.site, rfocx = site.x, rfocy = site.y, pby2 = rfocy - directrix;
- if (!pby2) return rfocx;
- var lArc = arc.P;
- if (!lArc) return -Infinity;
- site = lArc.site;
- var lfocx = site.x, lfocy = site.y, plby2 = lfocy - directrix;
- if (!plby2) return lfocx;
- var hl = lfocx - rfocx, aby2 = 1 / pby2 - 1 / plby2, b = hl / plby2;
- if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;
- return (rfocx + lfocx) / 2;
- }
- function d3_geom_voronoiRightBreakPoint(arc, directrix) {
- var rArc = arc.N;
- if (rArc) return d3_geom_voronoiLeftBreakPoint(rArc, directrix);
- var site = arc.site;
- return site.y === directrix ? site.x : Infinity;
- }
- function d3_geom_voronoiCell(site) {
- this.site = site;
- this.edges = [];
- }
- d3_geom_voronoiCell.prototype.prepare = function() {
- var halfEdges = this.edges, iHalfEdge = halfEdges.length, edge;
- while (iHalfEdge--) {
- edge = halfEdges[iHalfEdge].edge;
- if (!edge.b || !edge.a) halfEdges.splice(iHalfEdge, 1);
- }
- halfEdges.sort(d3_geom_voronoiHalfEdgeOrder);
- return halfEdges.length;
- };
- function d3_geom_voronoiCloseCells(extent) {
- var x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], x2, y2, x3, y3, cells = d3_geom_voronoiCells, iCell = cells.length, cell, iHalfEdge, halfEdges, nHalfEdges, start, end;
- while (iCell--) {
- cell = cells[iCell];
- if (!cell || !cell.prepare()) continue;
- halfEdges = cell.edges;
- nHalfEdges = halfEdges.length;
- iHalfEdge = 0;
- while (iHalfEdge < nHalfEdges) {
- end = halfEdges[iHalfEdge].end(), x3 = end.x, y3 = end.y;
- start = halfEdges[++iHalfEdge % nHalfEdges].start(), x2 = start.x, y2 = start.y;
- if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) {
- halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? {
- x: x0,
- y: abs(x2 - x0) < ε ? y2 : y1
- } : abs(y3 - y1) < ε && x1 - x3 > ε ? {
- x: abs(y2 - y1) < ε ? x2 : x1,
- y: y1
- } : abs(x3 - x1) < ε && y3 - y0 > ε ? {
- x: x1,
- y: abs(x2 - x1) < ε ? y2 : y0
- } : abs(y3 - y0) < ε && x3 - x0 > ε ? {
- x: abs(y2 - y0) < ε ? x2 : x0,
- y: y0
- } : null), cell.site, null));
- ++nHalfEdges;
- }
- }
- }
- }
- function d3_geom_voronoiHalfEdgeOrder(a, b) {
- return b.angle - a.angle;
- }
- function d3_geom_voronoiCircle() {
- d3_geom_voronoiRedBlackNode(this);
- this.x = this.y = this.arc = this.site = this.cy = null;
- }
- function d3_geom_voronoiAttachCircle(arc) {
- var lArc = arc.P, rArc = arc.N;
- if (!lArc || !rArc) return;
- var lSite = lArc.site, cSite = arc.site, rSite = rArc.site;
- if (lSite === rSite) return;
- var bx = cSite.x, by = cSite.y, ax = lSite.x - bx, ay = lSite.y - by, cx = rSite.x - bx, cy = rSite.y - by;
- var d = 2 * (ax * cy - ay * cx);
- if (d >= -ε2) return;
- var ha = ax * ax + ay * ay, hc = cx * cx + cy * cy, x = (cy * ha - ay * hc) / d, y = (ax * hc - cx * ha) / d, cy = y + by;
- var circle = d3_geom_voronoiCirclePool.pop() || new d3_geom_voronoiCircle();
- circle.arc = arc;
- circle.site = cSite;
- circle.x = x + bx;
- circle.y = cy + Math.sqrt(x * x + y * y);
- circle.cy = cy;
- arc.circle = circle;
- var before = null, node = d3_geom_voronoiCircles._;
- while (node) {
- if (circle.y < node.y || circle.y === node.y && circle.x <= node.x) {
- if (node.L) node = node.L; else {
- before = node.P;
- break;
- }
- } else {
- if (node.R) node = node.R; else {
- before = node;
- break;
- }
- }
- }
- d3_geom_voronoiCircles.insert(before, circle);
- if (!before) d3_geom_voronoiFirstCircle = circle;
- }
- function d3_geom_voronoiDetachCircle(arc) {
- var circle = arc.circle;
- if (circle) {
- if (!circle.P) d3_geom_voronoiFirstCircle = circle.N;
- d3_geom_voronoiCircles.remove(circle);
- d3_geom_voronoiCirclePool.push(circle);
- d3_geom_voronoiRedBlackNode(circle);
- arc.circle = null;
- }
- }
- function d3_geom_voronoiClipEdges(extent) {
- var edges = d3_geom_voronoiEdges, clip = d3_geom_clipLine(extent[0][0], extent[0][1], extent[1][0], extent[1][1]), i = edges.length, e;
- while (i--) {
- e = edges[i];
- if (!d3_geom_voronoiConnectEdge(e, extent) || !clip(e) || abs(e.a.x - e.b.x) < ε && abs(e.a.y - e.b.y) < ε) {
- e.a = e.b = null;
- edges.splice(i, 1);
- }
- }
- }
- function d3_geom_voronoiConnectEdge(edge, extent) {
- var vb = edge.b;
- if (vb) return true;
- var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb;
- if (ry === ly) {
- if (fx < x0 || fx >= x1) return;
- if (lx > rx) {
- if (!va) va = {
- x: fx,
- y: y0
- }; else if (va.y >= y1) return;
- vb = {
- x: fx,
- y: y1
- };
- } else {
- if (!va) va = {
- x: fx,
- y: y1
- }; else if (va.y < y0) return;
- vb = {
- x: fx,
- y: y0
- };
- }
- } else {
- fm = (lx - rx) / (ry - ly);
- fb = fy - fm * fx;
- if (fm < -1 || fm > 1) {
- if (lx > rx) {
- if (!va) va = {
- x: (y0 - fb) / fm,
- y: y0
- }; else if (va.y >= y1) return;
- vb = {
- x: (y1 - fb) / fm,
- y: y1
- };
- } else {
- if (!va) va = {
- x: (y1 - fb) / fm,
- y: y1
- }; else if (va.y < y0) return;
- vb = {
- x: (y0 - fb) / fm,
- y: y0
- };
- }
- } else {
- if (ly < ry) {
- if (!va) va = {
- x: x0,
- y: fm * x0 + fb
- }; else if (va.x >= x1) return;
- vb = {
- x: x1,
- y: fm * x1 + fb
- };
- } else {
- if (!va) va = {
- x: x1,
- y: fm * x1 + fb
- }; else if (va.x < x0) return;
- vb = {
- x: x0,
- y: fm * x0 + fb
- };
- }
- }
- }
- edge.a = va;
- edge.b = vb;
- return true;
- }
- function d3_geom_voronoiEdge(lSite, rSite) {
- this.l = lSite;
- this.r = rSite;
- this.a = this.b = null;
- }
- function d3_geom_voronoiCreateEdge(lSite, rSite, va, vb) {
- var edge = new d3_geom_voronoiEdge(lSite, rSite);
- d3_geom_voronoiEdges.push(edge);
- if (va) d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, va);
- if (vb) d3_geom_voronoiSetEdgeEnd(edge, rSite, lSite, vb);
- d3_geom_voronoiCells[lSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, lSite, rSite));
- d3_geom_voronoiCells[rSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, rSite, lSite));
- return edge;
- }
- function d3_geom_voronoiCreateBorderEdge(lSite, va, vb) {
- var edge = new d3_geom_voronoiEdge(lSite, null);
- edge.a = va;
- edge.b = vb;
- d3_geom_voronoiEdges.push(edge);
- return edge;
- }
- function d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, vertex) {
- if (!edge.a && !edge.b) {
- edge.a = vertex;
- edge.l = lSite;
- edge.r = rSite;
- } else if (edge.l === rSite) {
- edge.b = vertex;
- } else {
- edge.a = vertex;
- }
- }
- function d3_geom_voronoiHalfEdge(edge, lSite, rSite) {
- var va = edge.a, vb = edge.b;
- this.edge = edge;
- this.site = lSite;
- this.angle = rSite ? Math.atan2(rSite.y - lSite.y, rSite.x - lSite.x) : edge.l === lSite ? Math.atan2(vb.x - va.x, va.y - vb.y) : Math.atan2(va.x - vb.x, vb.y - va.y);
- }
- d3_geom_voronoiHalfEdge.prototype = {
- start: function() {
- return this.edge.l === this.site ? this.edge.a : this.edge.b;
- },
- end: function() {
- return this.edge.l === this.site ? this.edge.b : this.edge.a;
- }
- };
- function d3_geom_voronoiRedBlackTree() {
- this._ = null;
- }
- function d3_geom_voronoiRedBlackNode(node) {
- node.U = node.C = node.L = node.R = node.P = node.N = null;
- }
- d3_geom_voronoiRedBlackTree.prototype = {
- insert: function(after, node) {
- var parent, grandpa, uncle;
- if (after) {
- node.P = after;
- node.N = after.N;
- if (after.N) after.N.P = node;
- after.N = node;
- if (after.R) {
- after = after.R;
- while (after.L) after = after.L;
- after.L = node;
- } else {
- after.R = node;
- }
- parent = after;
- } else if (this._) {
- after = d3_geom_voronoiRedBlackFirst(this._);
- node.P = null;
- node.N = after;
- after.P = after.L = node;
- parent = after;
- } else {
- node.P = node.N = null;
- this._ = node;
- parent = null;
- }
- node.L = node.R = null;
- node.U = parent;
- node.C = true;
- after = node;
- while (parent && parent.C) {
- grandpa = parent.U;
- if (parent === grandpa.L) {
- uncle = grandpa.R;
- if (uncle && uncle.C) {
- parent.C = uncle.C = false;
- grandpa.C = true;
- after = grandpa;
- } else {
- if (after === parent.R) {
- d3_geom_voronoiRedBlackRotateLeft(this, parent);
- after = parent;
- parent = after.U;
- }
- parent.C = false;
- grandpa.C = true;
- d3_geom_voronoiRedBlackRotateRight(this, grandpa);
- }
- } else {
- uncle = grandpa.L;
- if (uncle && uncle.C) {
- parent.C = uncle.C = false;
- grandpa.C = true;
- after = grandpa;
- } else {
- if (after === parent.L) {
- d3_geom_voronoiRedBlackRotateRight(this, parent);
- after = parent;
- parent = after.U;
- }
- parent.C = false;
- grandpa.C = true;
- d3_geom_voronoiRedBlackRotateLeft(this, grandpa);
- }
- }
- parent = after.U;
- }
- this._.C = false;
- },
- remove: function(node) {
- if (node.N) node.N.P = node.P;
- if (node.P) node.P.N = node.N;
- node.N = node.P = null;
- var parent = node.U, sibling, left = node.L, right = node.R, next, red;
- if (!left) next = right; else if (!right) next = left; else next = d3_geom_voronoiRedBlackFirst(right);
- if (parent) {
- if (parent.L === node) parent.L = next; else parent.R = next;
- } else {
- this._ = next;
- }
- if (left && right) {
- red = next.C;
- next.C = node.C;
- next.L = left;
- left.U = next;
- if (next !== right) {
- parent = next.U;
- next.U = node.U;
- node = next.R;
- parent.L = node;
- next.R = right;
- right.U = next;
- } else {
- next.U = parent;
- parent = next;
- node = next.R;
- }
- } else {
- red = node.C;
- node = next;
- }
- if (node) node.U = parent;
- if (red) return;
- if (node && node.C) {
- node.C = false;
- return;
- }
- do {
- if (node === this._) break;
- if (node === parent.L) {
- sibling = parent.R;
- if (sibling.C) {
- sibling.C = false;
- parent.C = true;
- d3_geom_voronoiRedBlackRotateLeft(this, parent);
- sibling = parent.R;
- }
- if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {
- if (!sibling.R || !sibling.R.C) {
- sibling.L.C = false;
- sibling.C = true;
- d3_geom_voronoiRedBlackRotateRight(this, sibling);
- sibling = parent.R;
- }
- sibling.C = parent.C;
- parent.C = sibling.R.C = false;
- d3_geom_voronoiRedBlackRotateLeft(this, parent);
- node = this._;
- break;
- }
- } else {
- sibling = parent.L;
- if (sibling.C) {
- sibling.C = false;
- parent.C = true;
- d3_geom_voronoiRedBlackRotateRight(this, parent);
- sibling = parent.L;
- }
- if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {
- if (!sibling.L || !sibling.L.C) {
- sibling.R.C = false;
- sibling.C = true;
- d3_geom_voronoiRedBlackRotateLeft(this, sibling);
- sibling = parent.L;
- }
- sibling.C = parent.C;
- parent.C = sibling.L.C = false;
- d3_geom_voronoiRedBlackRotateRight(this, parent);
- node = this._;
- break;
- }
- }
- sibling.C = true;
- node = parent;
- parent = parent.U;
- } while (!node.C);
- if (node) node.C = false;
- }
- };
- function d3_geom_voronoiRedBlackRotateLeft(tree, node) {
- var p = node, q = node.R, parent = p.U;
- if (parent) {
- if (parent.L === p) parent.L = q; else parent.R = q;
- } else {
- tree._ = q;
- }
- q.U = parent;
- p.U = q;
- p.R = q.L;
- if (p.R) p.R.U = p;
- q.L = p;
- }
- function d3_geom_voronoiRedBlackRotateRight(tree, node) {
- var p = node, q = node.L, parent = p.U;
- if (parent) {
- if (parent.L === p) parent.L = q; else parent.R = q;
- } else {
- tree._ = q;
- }
- q.U = parent;
- p.U = q;
- p.L = q.R;
- if (p.L) p.L.U = p;
- q.R = p;
- }
- function d3_geom_voronoiRedBlackFirst(node) {
- while (node.L) node = node.L;
- return node;
- }
- function d3_geom_voronoi(sites, bbox) {
- var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle;
- d3_geom_voronoiEdges = [];
- d3_geom_voronoiCells = new Array(sites.length);
- d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree();
- d3_geom_voronoiCircles = new d3_geom_voronoiRedBlackTree();
- while (true) {
- circle = d3_geom_voronoiFirstCircle;
- if (site && (!circle || site.y < circle.y || site.y === circle.y && site.x < circle.x)) {
- if (site.x !== x0 || site.y !== y0) {
- d3_geom_voronoiCells[site.i] = new d3_geom_voronoiCell(site);
- d3_geom_voronoiAddBeach(site);
- x0 = site.x, y0 = site.y;
- }
- site = sites.pop();
- } else if (circle) {
- d3_geom_voronoiRemoveBeach(circle.arc);
- } else {
- break;
- }
- }
- if (bbox) d3_geom_voronoiClipEdges(bbox), d3_geom_voronoiCloseCells(bbox);
- var diagram = {
- cells: d3_geom_voronoiCells,
- edges: d3_geom_voronoiEdges
- };
- d3_geom_voronoiBeaches = d3_geom_voronoiCircles = d3_geom_voronoiEdges = d3_geom_voronoiCells = null;
- return diagram;
- }
- function d3_geom_voronoiVertexOrder(a, b) {
- return b.y - a.y || b.x - a.x;
- }
- d3.geom.voronoi = function(points) {
- var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent;
- if (points) return voronoi(points);
- function voronoi(data) {
- var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[1][1];
- d3_geom_voronoi(sites(data), clipExtent).cells.forEach(function(cell, i) {
- var edges = cell.edges, site = cell.site, polygon = polygons[i] = edges.length ? edges.map(function(e) {
- var s = e.start();
- return [ s.x, s.y ];
- }) : site.x >= x0 && site.x <= x1 && site.y >= y0 && site.y <= y1 ? [ [ x0, y1 ], [ x1, y1 ], [ x1, y0 ], [ x0, y0 ] ] : [];
- polygon.point = data[i];
- });
- return polygons;
- }
- function sites(data) {
- return data.map(function(d, i) {
- return {
- x: Math.round(fx(d, i) / ε) * ε,
- y: Math.round(fy(d, i) / ε) * ε,
- i: i
- };
- });
- }
- voronoi.links = function(data) {
- return d3_geom_voronoi(sites(data)).edges.filter(function(edge) {
- return edge.l && edge.r;
- }).map(function(edge) {
- return {
- source: data[edge.l.i],
- target: data[edge.r.i]
- };
- });
- };
- voronoi.triangles = function(data) {
- var triangles = [];
- d3_geom_voronoi(sites(data)).cells.forEach(function(cell, i) {
- var site = cell.site, edges = cell.edges.sort(d3_geom_voronoiHalfEdgeOrder), j = -1, m = edges.length, e0, s0, e1 = edges[m - 1].edge, s1 = e1.l === site ? e1.r : e1.l;
- while (++j < m) {
- e0 = e1;
- s0 = s1;
- e1 = edges[j].edge;
- s1 = e1.l === site ? e1.r : e1.l;
- if (i < s0.i && i < s1.i && d3_geom_voronoiTriangleArea(site, s0, s1) < 0) {
- triangles.push([ data[i], data[s0.i], data[s1.i] ]);
- }
- }
- });
- return triangles;
- };
- voronoi.x = function(_) {
- return arguments.length ? (fx = d3_functor(x = _), voronoi) : x;
- };
- voronoi.y = function(_) {
- return arguments.length ? (fy = d3_functor(y = _), voronoi) : y;
- };
- voronoi.clipExtent = function(_) {
- if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent;
- clipExtent = _ == null ? d3_geom_voronoiClipExtent : _;
- return voronoi;
- };
- voronoi.size = function(_) {
- if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent && clipExtent[1];
- return voronoi.clipExtent(_ && [ [ 0, 0 ], _ ]);
- };
- return voronoi;
- };
- var d3_geom_voronoiClipExtent = [ [ -1e6, -1e6 ], [ 1e6, 1e6 ] ];
- function d3_geom_voronoiTriangleArea(a, b, c) {
- return (a.x - c.x) * (b.y - a.y) - (a.x - b.x) * (c.y - a.y);
- }
- d3.geom.delaunay = function(vertices) {
- return d3.geom.voronoi().triangles(vertices);
- };
- d3.geom.quadtree = function(points, x1, y1, x2, y2) {
- var x = d3_geom_pointX, y = d3_geom_pointY, compat;
- if (compat = arguments.length) {
- x = d3_geom_quadtreeCompatX;
- y = d3_geom_quadtreeCompatY;
- if (compat === 3) {
- y2 = y1;
- x2 = x1;
- y1 = x1 = 0;
- }
- return quadtree(points);
- }
- function quadtree(data) {
- var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_;
- if (x1 != null) {
- x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2;
- } else {
- x2_ = y2_ = -(x1_ = y1_ = Infinity);
- xs = [], ys = [];
- n = data.length;
- if (compat) for (i = 0; i < n; ++i) {
- d = data[i];
- if (d.x < x1_) x1_ = d.x;
- if (d.y < y1_) y1_ = d.y;
- if (d.x > x2_) x2_ = d.x;
- if (d.y > y2_) y2_ = d.y;
- xs.push(d.x);
- ys.push(d.y);
- } else for (i = 0; i < n; ++i) {
- var x_ = +fx(d = data[i], i), y_ = +fy(d, i);
- if (x_ < x1_) x1_ = x_;
- if (y_ < y1_) y1_ = y_;
- if (x_ > x2_) x2_ = x_;
- if (y_ > y2_) y2_ = y_;
- xs.push(x_);
- ys.push(y_);
- }
- }
- var dx = x2_ - x1_, dy = y2_ - y1_;
- if (dx > dy) y2_ = y1_ + dx; else x2_ = x1_ + dy;
- function insert(n, d, x, y, x1, y1, x2, y2) {
- if (isNaN(x) || isNaN(y)) return;
- if (n.leaf) {
- var nx = n.x, ny = n.y;
- if (nx != null) {
- if (abs(nx - x) + abs(ny - y) < .01) {
- insertChild(n, d, x, y, x1, y1, x2, y2);
- } else {
- var nPoint = n.point;
- n.x = n.y = n.point = null;
- insertChild(n, nPoint, nx, ny, x1, y1, x2, y2);
- insertChild(n, d, x, y, x1, y1, x2, y2);
- }
- } else {
- n.x = x, n.y = y, n.point = d;
- }
- } else {
- insertChild(n, d, x, y, x1, y1, x2, y2);
- }
- }
- function insertChild(n, d, x, y, x1, y1, x2, y2) {
- var xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym, i = below << 1 | right;
- n.leaf = false;
- n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode());
- if (right) x1 = xm; else x2 = xm;
- if (below) y1 = ym; else y2 = ym;
- insert(n, d, x, y, x1, y1, x2, y2);
- }
- var root = d3_geom_quadtreeNode();
- root.add = function(d) {
- insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_);
- };
- root.visit = function(f) {
- d3_geom_quadtreeVisit(f, root, x1_, y1_, x2_, y2_);
- };
- root.find = function(point) {
- return d3_geom_quadtreeFind(root, point[0], point[1], x1_, y1_, x2_, y2_);
- };
- i = -1;
- if (x1 == null) {
- while (++i < n) {
- insert(root, data[i], xs[i], ys[i], x1_, y1_, x2_, y2_);
- }
- --i;
- } else data.forEach(root.add);
- xs = ys = data = d = null;
- return root;
- }
- quadtree.x = function(_) {
- return arguments.length ? (x = _, quadtree) : x;
- };
- quadtree.y = function(_) {
- return arguments.length ? (y = _, quadtree) : y;
- };
- quadtree.extent = function(_) {
- if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ];
- if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0],
- y2 = +_[1][1];
- return quadtree;
- };
- quadtree.size = function(_) {
- if (!arguments.length) return x1 == null ? null : [ x2 - x1, y2 - y1 ];
- if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = y1 = 0, x2 = +_[0], y2 = +_[1];
- return quadtree;
- };
- return quadtree;
- };
- function d3_geom_quadtreeCompatX(d) {
- return d.x;
- }
- function d3_geom_quadtreeCompatY(d) {
- return d.y;
- }
- function d3_geom_quadtreeNode() {
- return {
- leaf: true,
- nodes: [],
- point: null,
- x: null,
- y: null
- };
- }
- function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) {
- if (!f(node, x1, y1, x2, y2)) {
- var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, children = node.nodes;
- if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy);
- if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy);
- if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2);
- if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2);
- }
- }
- function d3_geom_quadtreeFind(root, x, y, x0, y0, x3, y3) {
- var minDistance2 = Infinity, closestPoint;
- (function find(node, x1, y1, x2, y2) {
- if (x1 > x3 || y1 > y3 || x2 < x0 || y2 < y0) return;
- if (point = node.point) {
- var point, dx = x - node.x, dy = y - node.y, distance2 = dx * dx + dy * dy;
- if (distance2 < minDistance2) {
- var distance = Math.sqrt(minDistance2 = distance2);
- x0 = x - distance, y0 = y - distance;
- x3 = x + distance, y3 = y + distance;
- closestPoint = point;
- }
- }
- var children = node.nodes, xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym;
- for (var i = below << 1 | right, j = i + 4; i < j; ++i) {
- if (node = children[i & 3]) switch (i & 3) {
- case 0:
- find(node, x1, y1, xm, ym);
- break;
-
- case 1:
- find(node, xm, y1, x2, ym);
- break;
-
- case 2:
- find(node, x1, ym, xm, y2);
- break;
-
- case 3:
- find(node, xm, ym, x2, y2);
- break;
- }
- }
- })(root, x0, y0, x3, y3);
- return closestPoint;
- }
- d3.interpolateRgb = d3_interpolateRgb;
- function d3_interpolateRgb(a, b) {
- a = d3.rgb(a);
- b = d3.rgb(b);
- var ar = a.r, ag = a.g, ab = a.b, br = b.r - ar, bg = b.g - ag, bb = b.b - ab;
- return function(t) {
- return "#" + d3_rgb_hex(Math.round(ar + br * t)) + d3_rgb_hex(Math.round(ag + bg * t)) + d3_rgb_hex(Math.round(ab + bb * t));
- };
- }
- d3.interpolateObject = d3_interpolateObject;
- function d3_interpolateObject(a, b) {
- var i = {}, c = {}, k;
- for (k in a) {
- if (k in b) {
- i[k] = d3_interpolate(a[k], b[k]);
- } else {
- c[k] = a[k];
- }
- }
- for (k in b) {
- if (!(k in a)) {
- c[k] = b[k];
- }
- }
- return function(t) {
- for (k in i) c[k] = i[k](t);
- return c;
- };
- }
- d3.interpolateNumber = d3_interpolateNumber;
- function d3_interpolateNumber(a, b) {
- a = +a, b = +b;
- return function(t) {
- return a * (1 - t) + b * t;
- };
- }
- d3.interpolateString = d3_interpolateString;
- function d3_interpolateString(a, b) {
- var bi = d3_interpolate_numberA.lastIndex = d3_interpolate_numberB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = [];
- a = a + "", b = b + "";
- while ((am = d3_interpolate_numberA.exec(a)) && (bm = d3_interpolate_numberB.exec(b))) {
- if ((bs = bm.index) > bi) {
- bs = b.slice(bi, bs);
- if (s[i]) s[i] += bs; else s[++i] = bs;
- }
- if ((am = am[0]) === (bm = bm[0])) {
- if (s[i]) s[i] += bm; else s[++i] = bm;
- } else {
- s[++i] = null;
- q.push({
- i: i,
- x: d3_interpolateNumber(am, bm)
- });
- }
- bi = d3_interpolate_numberB.lastIndex;
- }
- if (bi < b.length) {
- bs = b.slice(bi);
- if (s[i]) s[i] += bs; else s[++i] = bs;
- }
- return s.length < 2 ? q[0] ? (b = q[0].x, function(t) {
- return b(t) + "";
- }) : function() {
- return b;
- } : (b = q.length, function(t) {
- for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
- return s.join("");
- });
- }
- var d3_interpolate_numberA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, d3_interpolate_numberB = new RegExp(d3_interpolate_numberA.source, "g");
- d3.interpolate = d3_interpolate;
- function d3_interpolate(a, b) {
- var i = d3.interpolators.length, f;
- while (--i >= 0 && !(f = d3.interpolators[i](a, b))) ;
- return f;
- }
- d3.interpolators = [ function(a, b) {
- var t = typeof b;
- return (t === "string" ? d3_rgb_names.has(b.toLowerCase()) || /^(#|rgb\(|hsl\()/i.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_color ? d3_interpolateRgb : Array.isArray(b) ? d3_interpolateArray : t === "object" && isNaN(b) ? d3_interpolateObject : d3_interpolateNumber)(a, b);
- } ];
- d3.interpolateArray = d3_interpolateArray;
- function d3_interpolateArray(a, b) {
- var x = [], c = [], na = a.length, nb = b.length, n0 = Math.min(a.length, b.length), i;
- for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i]));
- for (;i < na; ++i) c[i] = a[i];
- for (;i < nb; ++i) c[i] = b[i];
- return function(t) {
- for (i = 0; i < n0; ++i) c[i] = x[i](t);
- return c;
- };
- }
- var d3_ease_default = function() {
- return d3_identity;
- };
- var d3_ease = d3.map({
- linear: d3_ease_default,
- poly: d3_ease_poly,
- quad: function() {
- return d3_ease_quad;
- },
- cubic: function() {
- return d3_ease_cubic;
- },
- sin: function() {
- return d3_ease_sin;
- },
- exp: function() {
- return d3_ease_exp;
- },
- circle: function() {
- return d3_ease_circle;
- },
- elastic: d3_ease_elastic,
- back: d3_ease_back,
- bounce: function() {
- return d3_ease_bounce;
- }
- });
- var d3_ease_mode = d3.map({
- "in": d3_identity,
- out: d3_ease_reverse,
- "in-out": d3_ease_reflect,
- "out-in": function(f) {
- return d3_ease_reflect(d3_ease_reverse(f));
- }
- });
- d3.ease = function(name) {
- var i = name.indexOf("-"), t = i >= 0 ? name.slice(0, i) : name, m = i >= 0 ? name.slice(i + 1) : "in";
- t = d3_ease.get(t) || d3_ease_default;
- m = d3_ease_mode.get(m) || d3_identity;
- return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1))));
- };
- function d3_ease_clamp(f) {
- return function(t) {
- return t <= 0 ? 0 : t >= 1 ? 1 : f(t);
- };
- }
- function d3_ease_reverse(f) {
- return function(t) {
- return 1 - f(1 - t);
- };
- }
- function d3_ease_reflect(f) {
- return function(t) {
- return .5 * (t < .5 ? f(2 * t) : 2 - f(2 - 2 * t));
- };
- }
- function d3_ease_quad(t) {
- return t * t;
- }
- function d3_ease_cubic(t) {
- return t * t * t;
- }
- function d3_ease_cubicInOut(t) {
- if (t <= 0) return 0;
- if (t >= 1) return 1;
- var t2 = t * t, t3 = t2 * t;
- return 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75);
- }
- function d3_ease_poly(e) {
- return function(t) {
- return Math.pow(t, e);
- };
- }
- function d3_ease_sin(t) {
- return 1 - Math.cos(t * halfπ);
- }
- function d3_ease_exp(t) {
- return Math.pow(2, 10 * (t - 1));
- }
- function d3_ease_circle(t) {
- return 1 - Math.sqrt(1 - t * t);
- }
- function d3_ease_elastic(a, p) {
- var s;
- if (arguments.length < 2) p = .45;
- if (arguments.length) s = p / τ * Math.asin(1 / a); else a = 1, s = p / 4;
- return function(t) {
- return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * τ / p);
- };
- }
- function d3_ease_back(s) {
- if (!s) s = 1.70158;
- return function(t) {
- return t * t * ((s + 1) * t - s);
- };
- }
- function d3_ease_bounce(t) {
- return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375;
- }
- d3.interpolateHcl = d3_interpolateHcl;
- function d3_interpolateHcl(a, b) {
- a = d3.hcl(a);
- b = d3.hcl(b);
- var ah = a.h, ac = a.c, al = a.l, bh = b.h - ah, bc = b.c - ac, bl = b.l - al;
- if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac;
- if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;
- return function(t) {
- return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + "";
- };
- }
- d3.interpolateHsl = d3_interpolateHsl;
- function d3_interpolateHsl(a, b) {
- a = d3.hsl(a);
- b = d3.hsl(b);
- var ah = a.h, as = a.s, al = a.l, bh = b.h - ah, bs = b.s - as, bl = b.l - al;
- if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as;
- if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;
- return function(t) {
- return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + "";
- };
- }
- d3.interpolateLab = d3_interpolateLab;
- function d3_interpolateLab(a, b) {
- a = d3.lab(a);
- b = d3.lab(b);
- var al = a.l, aa = a.a, ab = a.b, bl = b.l - al, ba = b.a - aa, bb = b.b - ab;
- return function(t) {
- return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + "";
- };
- }
- d3.interpolateRound = d3_interpolateRound;
- function d3_interpolateRound(a, b) {
- b -= a;
- return function(t) {
- return Math.round(a + b * t);
- };
- }
- d3.transform = function(string) {
- var g = d3_document.createElementNS(d3.ns.prefix.svg, "g");
- return (d3.transform = function(string) {
- if (string != null) {
- g.setAttribute("transform", string);
- var t = g.transform.baseVal.consolidate();
- }
- return new d3_transform(t ? t.matrix : d3_transformIdentity);
- })(string);
- };
- function d3_transform(m) {
- var r0 = [ m.a, m.b ], r1 = [ m.c, m.d ], kx = d3_transformNormalize(r0), kz = d3_transformDot(r0, r1), ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0;
- if (r0[0] * r1[1] < r1[0] * r0[1]) {
- r0[0] *= -1;
- r0[1] *= -1;
- kx *= -1;
- kz *= -1;
- }
- this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_degrees;
- this.translate = [ m.e, m.f ];
- this.scale = [ kx, ky ];
- this.skew = ky ? Math.atan2(kz, ky) * d3_degrees : 0;
- }
- d3_transform.prototype.toString = function() {
- return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")";
- };
- function d3_transformDot(a, b) {
- return a[0] * b[0] + a[1] * b[1];
- }
- function d3_transformNormalize(a) {
- var k = Math.sqrt(d3_transformDot(a, a));
- if (k) {
- a[0] /= k;
- a[1] /= k;
- }
- return k;
- }
- function d3_transformCombine(a, b, k) {
- a[0] += k * b[0];
- a[1] += k * b[1];
- return a;
- }
- var d3_transformIdentity = {
- a: 1,
- b: 0,
- c: 0,
- d: 1,
- e: 0,
- f: 0
- };
- d3.interpolateTransform = d3_interpolateTransform;
- function d3_interpolateTransformPop(s) {
- return s.length ? s.pop() + "," : "";
- }
- function d3_interpolateTranslate(ta, tb, s, q) {
- if (ta[0] !== tb[0] || ta[1] !== tb[1]) {
- var i = s.push("translate(", null, ",", null, ")");
- q.push({
- i: i - 4,
- x: d3_interpolateNumber(ta[0], tb[0])
- }, {
- i: i - 2,
- x: d3_interpolateNumber(ta[1], tb[1])
- });
- } else if (tb[0] || tb[1]) {
- s.push("translate(" + tb + ")");
- }
- }
- function d3_interpolateRotate(ra, rb, s, q) {
- if (ra !== rb) {
- if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360;
- q.push({
- i: s.push(d3_interpolateTransformPop(s) + "rotate(", null, ")") - 2,
- x: d3_interpolateNumber(ra, rb)
- });
- } else if (rb) {
- s.push(d3_interpolateTransformPop(s) + "rotate(" + rb + ")");
- }
- }
- function d3_interpolateSkew(wa, wb, s, q) {
- if (wa !== wb) {
- q.push({
- i: s.push(d3_interpolateTransformPop(s) + "skewX(", null, ")") - 2,
- x: d3_interpolateNumber(wa, wb)
- });
- } else if (wb) {
- s.push(d3_interpolateTransformPop(s) + "skewX(" + wb + ")");
- }
- }
- function d3_interpolateScale(ka, kb, s, q) {
- if (ka[0] !== kb[0] || ka[1] !== kb[1]) {
- var i = s.push(d3_interpolateTransformPop(s) + "scale(", null, ",", null, ")");
- q.push({
- i: i - 4,
- x: d3_interpolateNumber(ka[0], kb[0])
- }, {
- i: i - 2,
- x: d3_interpolateNumber(ka[1], kb[1])
- });
- } else if (kb[0] !== 1 || kb[1] !== 1) {
- s.push(d3_interpolateTransformPop(s) + "scale(" + kb + ")");
- }
- }
- function d3_interpolateTransform(a, b) {
- var s = [], q = [];
- a = d3.transform(a), b = d3.transform(b);
- d3_interpolateTranslate(a.translate, b.translate, s, q);
- d3_interpolateRotate(a.rotate, b.rotate, s, q);
- d3_interpolateSkew(a.skew, b.skew, s, q);
- d3_interpolateScale(a.scale, b.scale, s, q);
- a = b = null;
- return function(t) {
- var i = -1, n = q.length, o;
- while (++i < n) s[(o = q[i]).i] = o.x(t);
- return s.join("");
- };
- }
- function d3_uninterpolateNumber(a, b) {
- b = (b -= a = +a) || 1 / b;
- return function(x) {
- return (x - a) / b;
- };
- }
- function d3_uninterpolateClamp(a, b) {
- b = (b -= a = +a) || 1 / b;
- return function(x) {
- return Math.max(0, Math.min(1, (x - a) / b));
- };
- }
- d3.layout = {};
- d3.layout.bundle = function() {
- return function(links) {
- var paths = [], i = -1, n = links.length;
- while (++i < n) paths.push(d3_layout_bundlePath(links[i]));
- return paths;
- };
- };
- function d3_layout_bundlePath(link) {
- var start = link.source, end = link.target, lca = d3_layout_bundleLeastCommonAncestor(start, end), points = [ start ];
- while (start !== lca) {
- start = start.parent;
- points.push(start);
- }
- var k = points.length;
- while (end !== lca) {
- points.splice(k, 0, end);
- end = end.parent;
- }
- return points;
- }
- function d3_layout_bundleAncestors(node) {
- var ancestors = [], parent = node.parent;
- while (parent != null) {
- ancestors.push(node);
- node = parent;
- parent = parent.parent;
- }
- ancestors.push(node);
- return ancestors;
- }
- function d3_layout_bundleLeastCommonAncestor(a, b) {
- if (a === b) return a;
- var aNodes = d3_layout_bundleAncestors(a), bNodes = d3_layout_bundleAncestors(b), aNode = aNodes.pop(), bNode = bNodes.pop(), sharedNode = null;
- while (aNode === bNode) {
- sharedNode = aNode;
- aNode = aNodes.pop();
- bNode = bNodes.pop();
- }
- return sharedNode;
- }
- d3.layout.chord = function() {
- var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords;
- function relayout() {
- var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j;
- chords = [];
- groups = [];
- k = 0, i = -1;
- while (++i < n) {
- x = 0, j = -1;
- while (++j < n) {
- x += matrix[i][j];
- }
- groupSums.push(x);
- subgroupIndex.push(d3.range(n));
- k += x;
- }
- if (sortGroups) {
- groupIndex.sort(function(a, b) {
- return sortGroups(groupSums[a], groupSums[b]);
- });
- }
- if (sortSubgroups) {
- subgroupIndex.forEach(function(d, i) {
- d.sort(function(a, b) {
- return sortSubgroups(matrix[i][a], matrix[i][b]);
- });
- });
- }
- k = (τ - padding * n) / k;
- x = 0, i = -1;
- while (++i < n) {
- x0 = x, j = -1;
- while (++j < n) {
- var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k;
- subgroups[di + "-" + dj] = {
- index: di,
- subindex: dj,
- startAngle: a0,
- endAngle: a1,
- value: v
- };
- }
- groups[di] = {
- index: di,
- startAngle: x0,
- endAngle: x,
- value: groupSums[di]
- };
- x += padding;
- }
- i = -1;
- while (++i < n) {
- j = i - 1;
- while (++j < n) {
- var source = subgroups[i + "-" + j], target = subgroups[j + "-" + i];
- if (source.value || target.value) {
- chords.push(source.value < target.value ? {
- source: target,
- target: source
- } : {
- source: source,
- target: target
- });
- }
- }
- }
- if (sortChords) resort();
- }
- function resort() {
- chords.sort(function(a, b) {
- return sortChords((a.source.value + a.target.value) / 2, (b.source.value + b.target.value) / 2);
- });
- }
- chord.matrix = function(x) {
- if (!arguments.length) return matrix;
- n = (matrix = x) && matrix.length;
- chords = groups = null;
- return chord;
- };
- chord.padding = function(x) {
- if (!arguments.length) return padding;
- padding = x;
- chords = groups = null;
- return chord;
- };
- chord.sortGroups = function(x) {
- if (!arguments.length) return sortGroups;
- sortGroups = x;
- chords = groups = null;
- return chord;
- };
- chord.sortSubgroups = function(x) {
- if (!arguments.length) return sortSubgroups;
- sortSubgroups = x;
- chords = null;
- return chord;
- };
- chord.sortChords = function(x) {
- if (!arguments.length) return sortChords;
- sortChords = x;
- if (chords) resort();
- return chord;
- };
- chord.chords = function() {
- if (!chords) relayout();
- return chords;
- };
- chord.groups = function() {
- if (!groups) relayout();
- return groups;
- };
- return chord;
- };
- d3.layout.force = function() {
- var force = {}, event = d3.dispatch("start", "tick", "end"), timer, size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges;
- function repulse(node) {
- return function(quad, x1, _, x2) {
- if (quad.point !== node) {
- var dx = quad.cx - node.x, dy = quad.cy - node.y, dw = x2 - x1, dn = dx * dx + dy * dy;
- if (dw * dw / theta2 < dn) {
- if (dn < chargeDistance2) {
- var k = quad.charge / dn;
- node.px -= dx * k;
- node.py -= dy * k;
- }
- return true;
- }
- if (quad.point && dn && dn < chargeDistance2) {
- var k = quad.pointCharge / dn;
- node.px -= dx * k;
- node.py -= dy * k;
- }
- }
- return !quad.charge;
- };
- }
- force.tick = function() {
- if ((alpha *= .99) < .005) {
- timer = null;
- event.end({
- type: "end",
- alpha: alpha = 0
- });
- return true;
- }
- var n = nodes.length, m = links.length, q, i, o, s, t, l, k, x, y;
- for (i = 0; i < m; ++i) {
- o = links[i];
- s = o.source;
- t = o.target;
- x = t.x - s.x;
- y = t.y - s.y;
- if (l = x * x + y * y) {
- l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l;
- x *= l;
- y *= l;
- t.x -= x * (k = s.weight + t.weight ? s.weight / (s.weight + t.weight) : .5);
- t.y -= y * k;
- s.x += x * (k = 1 - k);
- s.y += y * k;
- }
- }
- if (k = alpha * gravity) {
- x = size[0] / 2;
- y = size[1] / 2;
- i = -1;
- if (k) while (++i < n) {
- o = nodes[i];
- o.x += (x - o.x) * k;
- o.y += (y - o.y) * k;
- }
- }
- if (charge) {
- d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges);
- i = -1;
- while (++i < n) {
- if (!(o = nodes[i]).fixed) {
- q.visit(repulse(o));
- }
- }
- }
- i = -1;
- while (++i < n) {
- o = nodes[i];
- if (o.fixed) {
- o.x = o.px;
- o.y = o.py;
- } else {
- o.x -= (o.px - (o.px = o.x)) * friction;
- o.y -= (o.py - (o.py = o.y)) * friction;
- }
- }
- event.tick({
- type: "tick",
- alpha: alpha
- });
- };
- force.nodes = function(x) {
- if (!arguments.length) return nodes;
- nodes = x;
- return force;
- };
- force.links = function(x) {
- if (!arguments.length) return links;
- links = x;
- return force;
- };
- force.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return force;
- };
- force.linkDistance = function(x) {
- if (!arguments.length) return linkDistance;
- linkDistance = typeof x === "function" ? x : +x;
- return force;
- };
- force.distance = force.linkDistance;
- force.linkStrength = function(x) {
- if (!arguments.length) return linkStrength;
- linkStrength = typeof x === "function" ? x : +x;
- return force;
- };
- force.friction = function(x) {
- if (!arguments.length) return friction;
- friction = +x;
- return force;
- };
- force.charge = function(x) {
- if (!arguments.length) return charge;
- charge = typeof x === "function" ? x : +x;
- return force;
- };
- force.chargeDistance = function(x) {
- if (!arguments.length) return Math.sqrt(chargeDistance2);
- chargeDistance2 = x * x;
- return force;
- };
- force.gravity = function(x) {
- if (!arguments.length) return gravity;
- gravity = +x;
- return force;
- };
- force.theta = function(x) {
- if (!arguments.length) return Math.sqrt(theta2);
- theta2 = x * x;
- return force;
- };
- force.alpha = function(x) {
- if (!arguments.length) return alpha;
- x = +x;
- if (alpha) {
- if (x > 0) {
- alpha = x;
- } else {
- timer.c = null, timer.t = NaN, timer = null;
- event.end({
- type: "end",
- alpha: alpha = 0
- });
- }
- } else if (x > 0) {
- event.start({
- type: "start",
- alpha: alpha = x
- });
- timer = d3_timer(force.tick);
- }
- return force;
- };
- force.start = function() {
- var i, n = nodes.length, m = links.length, w = size[0], h = size[1], neighbors, o;
- for (i = 0; i < n; ++i) {
- (o = nodes[i]).index = i;
- o.weight = 0;
- }
- for (i = 0; i < m; ++i) {
- o = links[i];
- if (typeof o.source == "number") o.source = nodes[o.source];
- if (typeof o.target == "number") o.target = nodes[o.target];
- ++o.source.weight;
- ++o.target.weight;
- }
- for (i = 0; i < n; ++i) {
- o = nodes[i];
- if (isNaN(o.x)) o.x = position("x", w);
- if (isNaN(o.y)) o.y = position("y", h);
- if (isNaN(o.px)) o.px = o.x;
- if (isNaN(o.py)) o.py = o.y;
- }
- distances = [];
- if (typeof linkDistance === "function") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); else for (i = 0; i < m; ++i) distances[i] = linkDistance;
- strengths = [];
- if (typeof linkStrength === "function") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); else for (i = 0; i < m; ++i) strengths[i] = linkStrength;
- charges = [];
- if (typeof charge === "function") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge;
- function position(dimension, size) {
- if (!neighbors) {
- neighbors = new Array(n);
- for (j = 0; j < n; ++j) {
- neighbors[j] = [];
- }
- for (j = 0; j < m; ++j) {
- var o = links[j];
- neighbors[o.source.index].push(o.target);
- neighbors[o.target.index].push(o.source);
- }
- }
- var candidates = neighbors[i], j = -1, l = candidates.length, x;
- while (++j < l) if (!isNaN(x = candidates[j][dimension])) return x;
- return Math.random() * size;
- }
- return force.resume();
- };
- force.resume = function() {
- return force.alpha(.1);
- };
- force.stop = function() {
- return force.alpha(0);
- };
- force.drag = function() {
- if (!drag) drag = d3.behavior.drag().origin(d3_identity).on("dragstart.force", d3_layout_forceDragstart).on("drag.force", dragmove).on("dragend.force", d3_layout_forceDragend);
- if (!arguments.length) return drag;
- this.on("mouseover.force", d3_layout_forceMouseover).on("mouseout.force", d3_layout_forceMouseout).call(drag);
- };
- function dragmove(d) {
- d.px = d3.event.x, d.py = d3.event.y;
- force.resume();
- }
- return d3.rebind(force, event, "on");
- };
- function d3_layout_forceDragstart(d) {
- d.fixed |= 2;
- }
- function d3_layout_forceDragend(d) {
- d.fixed &= ~6;
- }
- function d3_layout_forceMouseover(d) {
- d.fixed |= 4;
- d.px = d.x, d.py = d.y;
- }
- function d3_layout_forceMouseout(d) {
- d.fixed &= ~4;
- }
- function d3_layout_forceAccumulate(quad, alpha, charges) {
- var cx = 0, cy = 0;
- quad.charge = 0;
- if (!quad.leaf) {
- var nodes = quad.nodes, n = nodes.length, i = -1, c;
- while (++i < n) {
- c = nodes[i];
- if (c == null) continue;
- d3_layout_forceAccumulate(c, alpha, charges);
- quad.charge += c.charge;
- cx += c.charge * c.cx;
- cy += c.charge * c.cy;
- }
- }
- if (quad.point) {
- if (!quad.leaf) {
- quad.point.x += Math.random() - .5;
- quad.point.y += Math.random() - .5;
- }
- var k = alpha * charges[quad.point.index];
- quad.charge += quad.pointCharge = k;
- cx += k * quad.point.x;
- cy += k * quad.point.y;
- }
- quad.cx = cx / quad.charge;
- quad.cy = cy / quad.charge;
- }
- var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1, d3_layout_forceChargeDistance2 = Infinity;
- d3.layout.hierarchy = function() {
- var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue;
- function hierarchy(root) {
- var stack = [ root ], nodes = [], node;
- root.depth = 0;
- while ((node = stack.pop()) != null) {
- nodes.push(node);
- if ((childs = children.call(hierarchy, node, node.depth)) && (n = childs.length)) {
- var n, childs, child;
- while (--n >= 0) {
- stack.push(child = childs[n]);
- child.parent = node;
- child.depth = node.depth + 1;
- }
- if (value) node.value = 0;
- node.children = childs;
- } else {
- if (value) node.value = +value.call(hierarchy, node, node.depth) || 0;
- delete node.children;
- }
- }
- d3_layout_hierarchyVisitAfter(root, function(node) {
- var childs, parent;
- if (sort && (childs = node.children)) childs.sort(sort);
- if (value && (parent = node.parent)) parent.value += node.value;
- });
- return nodes;
- }
- hierarchy.sort = function(x) {
- if (!arguments.length) return sort;
- sort = x;
- return hierarchy;
- };
- hierarchy.children = function(x) {
- if (!arguments.length) return children;
- children = x;
- return hierarchy;
- };
- hierarchy.value = function(x) {
- if (!arguments.length) return value;
- value = x;
- return hierarchy;
- };
- hierarchy.revalue = function(root) {
- if (value) {
- d3_layout_hierarchyVisitBefore(root, function(node) {
- if (node.children) node.value = 0;
- });
- d3_layout_hierarchyVisitAfter(root, function(node) {
- var parent;
- if (!node.children) node.value = +value.call(hierarchy, node, node.depth) || 0;
- if (parent = node.parent) parent.value += node.value;
- });
- }
- return root;
- };
- return hierarchy;
- };
- function d3_layout_hierarchyRebind(object, hierarchy) {
- d3.rebind(object, hierarchy, "sort", "children", "value");
- object.nodes = object;
- object.links = d3_layout_hierarchyLinks;
- return object;
- }
- function d3_layout_hierarchyVisitBefore(node, callback) {
- var nodes = [ node ];
- while ((node = nodes.pop()) != null) {
- callback(node);
- if ((children = node.children) && (n = children.length)) {
- var n, children;
- while (--n >= 0) nodes.push(children[n]);
- }
- }
- }
- function d3_layout_hierarchyVisitAfter(node, callback) {
- var nodes = [ node ], nodes2 = [];
- while ((node = nodes.pop()) != null) {
- nodes2.push(node);
- if ((children = node.children) && (n = children.length)) {
- var i = -1, n, children;
- while (++i < n) nodes.push(children[i]);
- }
- }
- while ((node = nodes2.pop()) != null) {
- callback(node);
- }
- }
- function d3_layout_hierarchyChildren(d) {
- return d.children;
- }
- function d3_layout_hierarchyValue(d) {
- return d.value;
- }
- function d3_layout_hierarchySort(a, b) {
- return b.value - a.value;
- }
- function d3_layout_hierarchyLinks(nodes) {
- return d3.merge(nodes.map(function(parent) {
- return (parent.children || []).map(function(child) {
- return {
- source: parent,
- target: child
- };
- });
- }));
- }
- d3.layout.partition = function() {
- var hierarchy = d3.layout.hierarchy(), size = [ 1, 1 ];
- function position(node, x, dx, dy) {
- var children = node.children;
- node.x = x;
- node.y = node.depth * dy;
- node.dx = dx;
- node.dy = dy;
- if (children && (n = children.length)) {
- var i = -1, n, c, d;
- dx = node.value ? dx / node.value : 0;
- while (++i < n) {
- position(c = children[i], x, d = c.value * dx, dy);
- x += d;
- }
- }
- }
- function depth(node) {
- var children = node.children, d = 0;
- if (children && (n = children.length)) {
- var i = -1, n;
- while (++i < n) d = Math.max(d, depth(children[i]));
- }
- return 1 + d;
- }
- function partition(d, i) {
- var nodes = hierarchy.call(this, d, i);
- position(nodes[0], 0, size[0], size[1] / depth(nodes[0]));
- return nodes;
- }
- partition.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return partition;
- };
- return d3_layout_hierarchyRebind(partition, hierarchy);
- };
- d3.layout.pie = function() {
- var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = τ, padAngle = 0;
- function pie(data) {
- var n = data.length, values = data.map(function(d, i) {
- return +value.call(pie, d, i);
- }), a = +(typeof startAngle === "function" ? startAngle.apply(this, arguments) : startAngle), da = (typeof endAngle === "function" ? endAngle.apply(this, arguments) : endAngle) - a, p = Math.min(Math.abs(da) / n, +(typeof padAngle === "function" ? padAngle.apply(this, arguments) : padAngle)), pa = p * (da < 0 ? -1 : 1), sum = d3.sum(values), k = sum ? (da - n * pa) / sum : 0, index = d3.range(n), arcs = [], v;
- if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) {
- return values[j] - values[i];
- } : function(i, j) {
- return sort(data[i], data[j]);
- });
- index.forEach(function(i) {
- arcs[i] = {
- data: data[i],
- value: v = values[i],
- startAngle: a,
- endAngle: a += v * k + pa,
- padAngle: p
- };
- });
- return arcs;
- }
- pie.value = function(_) {
- if (!arguments.length) return value;
- value = _;
- return pie;
- };
- pie.sort = function(_) {
- if (!arguments.length) return sort;
- sort = _;
- return pie;
- };
- pie.startAngle = function(_) {
- if (!arguments.length) return startAngle;
- startAngle = _;
- return pie;
- };
- pie.endAngle = function(_) {
- if (!arguments.length) return endAngle;
- endAngle = _;
- return pie;
- };
- pie.padAngle = function(_) {
- if (!arguments.length) return padAngle;
- padAngle = _;
- return pie;
- };
- return pie;
- };
- var d3_layout_pieSortByValue = {};
- d3.layout.stack = function() {
- var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY;
- function stack(data, index) {
- if (!(n = data.length)) return data;
- var series = data.map(function(d, i) {
- return values.call(stack, d, i);
- });
- var points = series.map(function(d) {
- return d.map(function(v, i) {
- return [ x.call(stack, v, i), y.call(stack, v, i) ];
- });
- });
- var orders = order.call(stack, points, index);
- series = d3.permute(series, orders);
- points = d3.permute(points, orders);
- var offsets = offset.call(stack, points, index);
- var m = series[0].length, n, i, j, o;
- for (j = 0; j < m; ++j) {
- out.call(stack, series[0][j], o = offsets[j], points[0][j][1]);
- for (i = 1; i < n; ++i) {
- out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]);
- }
- }
- return data;
- }
- stack.values = function(x) {
- if (!arguments.length) return values;
- values = x;
- return stack;
- };
- stack.order = function(x) {
- if (!arguments.length) return order;
- order = typeof x === "function" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault;
- return stack;
- };
- stack.offset = function(x) {
- if (!arguments.length) return offset;
- offset = typeof x === "function" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero;
- return stack;
- };
- stack.x = function(z) {
- if (!arguments.length) return x;
- x = z;
- return stack;
- };
- stack.y = function(z) {
- if (!arguments.length) return y;
- y = z;
- return stack;
- };
- stack.out = function(z) {
- if (!arguments.length) return out;
- out = z;
- return stack;
- };
- return stack;
- };
- function d3_layout_stackX(d) {
- return d.x;
- }
- function d3_layout_stackY(d) {
- return d.y;
- }
- function d3_layout_stackOut(d, y0, y) {
- d.y0 = y0;
- d.y = y;
- }
- var d3_layout_stackOrders = d3.map({
- "inside-out": function(data) {
- var n = data.length, i, j, max = data.map(d3_layout_stackMaxIndex), sums = data.map(d3_layout_stackReduceSum), index = d3.range(n).sort(function(a, b) {
- return max[a] - max[b];
- }), top = 0, bottom = 0, tops = [], bottoms = [];
- for (i = 0; i < n; ++i) {
- j = index[i];
- if (top < bottom) {
- top += sums[j];
- tops.push(j);
- } else {
- bottom += sums[j];
- bottoms.push(j);
- }
- }
- return bottoms.reverse().concat(tops);
- },
- reverse: function(data) {
- return d3.range(data.length).reverse();
- },
- "default": d3_layout_stackOrderDefault
- });
- var d3_layout_stackOffsets = d3.map({
- silhouette: function(data) {
- var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = [];
- for (j = 0; j < m; ++j) {
- for (i = 0, o = 0; i < n; i++) o += data[i][j][1];
- if (o > max) max = o;
- sums.push(o);
- }
- for (j = 0; j < m; ++j) {
- y0[j] = (max - sums[j]) / 2;
- }
- return y0;
- },
- wiggle: function(data) {
- var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = [];
- y0[0] = o = o0 = 0;
- for (j = 1; j < m; ++j) {
- for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1];
- for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) {
- for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) {
- s3 += (data[k][j][1] - data[k][j - 1][1]) / dx;
- }
- s2 += s3 * data[i][j][1];
- }
- y0[j] = o -= s1 ? s2 / s1 * dx : 0;
- if (o < o0) o0 = o;
- }
- for (j = 0; j < m; ++j) y0[j] -= o0;
- return y0;
- },
- expand: function(data) {
- var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = [];
- for (j = 0; j < m; ++j) {
- for (i = 0, o = 0; i < n; i++) o += data[i][j][1];
- if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k;
- }
- for (j = 0; j < m; ++j) y0[j] = 0;
- return y0;
- },
- zero: d3_layout_stackOffsetZero
- });
- function d3_layout_stackOrderDefault(data) {
- return d3.range(data.length);
- }
- function d3_layout_stackOffsetZero(data) {
- var j = -1, m = data[0].length, y0 = [];
- while (++j < m) y0[j] = 0;
- return y0;
- }
- function d3_layout_stackMaxIndex(array) {
- var i = 1, j = 0, v = array[0][1], k, n = array.length;
- for (;i < n; ++i) {
- if ((k = array[i][1]) > v) {
- j = i;
- v = k;
- }
- }
- return j;
- }
- function d3_layout_stackReduceSum(d) {
- return d.reduce(d3_layout_stackSum, 0);
- }
- function d3_layout_stackSum(p, d) {
- return p + d[1];
- }
- d3.layout.histogram = function() {
- var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges;
- function histogram(data, i) {
- var bins = [], values = data.map(valuer, this), range = ranger.call(this, values, i), thresholds = binner.call(this, range, values, i), bin, i = -1, n = values.length, m = thresholds.length - 1, k = frequency ? 1 : 1 / n, x;
- while (++i < m) {
- bin = bins[i] = [];
- bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]);
- bin.y = 0;
- }
- if (m > 0) {
- i = -1;
- while (++i < n) {
- x = values[i];
- if (x >= range[0] && x <= range[1]) {
- bin = bins[d3.bisect(thresholds, x, 1, m) - 1];
- bin.y += k;
- bin.push(data[i]);
- }
- }
- }
- return bins;
- }
- histogram.value = function(x) {
- if (!arguments.length) return valuer;
- valuer = x;
- return histogram;
- };
- histogram.range = function(x) {
- if (!arguments.length) return ranger;
- ranger = d3_functor(x);
- return histogram;
- };
- histogram.bins = function(x) {
- if (!arguments.length) return binner;
- binner = typeof x === "number" ? function(range) {
- return d3_layout_histogramBinFixed(range, x);
- } : d3_functor(x);
- return histogram;
- };
- histogram.frequency = function(x) {
- if (!arguments.length) return frequency;
- frequency = !!x;
- return histogram;
- };
- return histogram;
- };
- function d3_layout_histogramBinSturges(range, values) {
- return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1));
- }
- function d3_layout_histogramBinFixed(range, n) {
- var x = -1, b = +range[0], m = (range[1] - b) / n, f = [];
- while (++x <= n) f[x] = m * x + b;
- return f;
- }
- function d3_layout_histogramRange(values) {
- return [ d3.min(values), d3.max(values) ];
- }
- d3.layout.pack = function() {
- var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius;
- function pack(d, i) {
- var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === "function" ? radius : function() {
- return radius;
- };
- root.x = root.y = 0;
- d3_layout_hierarchyVisitAfter(root, function(d) {
- d.r = +r(d.value);
- });
- d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);
- if (padding) {
- var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2;
- d3_layout_hierarchyVisitAfter(root, function(d) {
- d.r += dr;
- });
- d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);
- d3_layout_hierarchyVisitAfter(root, function(d) {
- d.r -= dr;
- });
- }
- d3_layout_packTransform(root, w / 2, h / 2, radius ? 1 : 1 / Math.max(2 * root.r / w, 2 * root.r / h));
- return nodes;
- }
- pack.size = function(_) {
- if (!arguments.length) return size;
- size = _;
- return pack;
- };
- pack.radius = function(_) {
- if (!arguments.length) return radius;
- radius = _ == null || typeof _ === "function" ? _ : +_;
- return pack;
- };
- pack.padding = function(_) {
- if (!arguments.length) return padding;
- padding = +_;
- return pack;
- };
- return d3_layout_hierarchyRebind(pack, hierarchy);
- };
- function d3_layout_packSort(a, b) {
- return a.value - b.value;
- }
- function d3_layout_packInsert(a, b) {
- var c = a._pack_next;
- a._pack_next = b;
- b._pack_prev = a;
- b._pack_next = c;
- c._pack_prev = b;
- }
- function d3_layout_packSplice(a, b) {
- a._pack_next = b;
- b._pack_prev = a;
- }
- function d3_layout_packIntersects(a, b) {
- var dx = b.x - a.x, dy = b.y - a.y, dr = a.r + b.r;
- return .999 * dr * dr > dx * dx + dy * dy;
- }
- function d3_layout_packSiblings(node) {
- if (!(nodes = node.children) || !(n = nodes.length)) return;
- var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n;
- function bound(node) {
- xMin = Math.min(node.x - node.r, xMin);
- xMax = Math.max(node.x + node.r, xMax);
- yMin = Math.min(node.y - node.r, yMin);
- yMax = Math.max(node.y + node.r, yMax);
- }
- nodes.forEach(d3_layout_packLink);
- a = nodes[0];
- a.x = -a.r;
- a.y = 0;
- bound(a);
- if (n > 1) {
- b = nodes[1];
- b.x = b.r;
- b.y = 0;
- bound(b);
- if (n > 2) {
- c = nodes[2];
- d3_layout_packPlace(a, b, c);
- bound(c);
- d3_layout_packInsert(a, c);
- a._pack_prev = c;
- d3_layout_packInsert(c, b);
- b = a._pack_next;
- for (i = 3; i < n; i++) {
- d3_layout_packPlace(a, b, c = nodes[i]);
- var isect = 0, s1 = 1, s2 = 1;
- for (j = b._pack_next; j !== b; j = j._pack_next, s1++) {
- if (d3_layout_packIntersects(j, c)) {
- isect = 1;
- break;
- }
- }
- if (isect == 1) {
- for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) {
- if (d3_layout_packIntersects(k, c)) {
- break;
- }
- }
- }
- if (isect) {
- if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b);
- i--;
- } else {
- d3_layout_packInsert(a, c);
- b = c;
- bound(c);
- }
- }
- }
- }
- var cx = (xMin + xMax) / 2, cy = (yMin + yMax) / 2, cr = 0;
- for (i = 0; i < n; i++) {
- c = nodes[i];
- c.x -= cx;
- c.y -= cy;
- cr = Math.max(cr, c.r + Math.sqrt(c.x * c.x + c.y * c.y));
- }
- node.r = cr;
- nodes.forEach(d3_layout_packUnlink);
- }
- function d3_layout_packLink(node) {
- node._pack_next = node._pack_prev = node;
- }
- function d3_layout_packUnlink(node) {
- delete node._pack_next;
- delete node._pack_prev;
- }
- function d3_layout_packTransform(node, x, y, k) {
- var children = node.children;
- node.x = x += k * node.x;
- node.y = y += k * node.y;
- node.r *= k;
- if (children) {
- var i = -1, n = children.length;
- while (++i < n) d3_layout_packTransform(children[i], x, y, k);
- }
- }
- function d3_layout_packPlace(a, b, c) {
- var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y;
- if (db && (dx || dy)) {
- var da = b.r + c.r, dc = dx * dx + dy * dy;
- da *= da;
- db *= db;
- var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc);
- c.x = a.x + x * dx + y * dy;
- c.y = a.y + x * dy - y * dx;
- } else {
- c.x = a.x + db;
- c.y = a.y;
- }
- }
- d3.layout.tree = function() {
- var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = null;
- function tree(d, i) {
- var nodes = hierarchy.call(this, d, i), root0 = nodes[0], root1 = wrapTree(root0);
- d3_layout_hierarchyVisitAfter(root1, firstWalk), root1.parent.m = -root1.z;
- d3_layout_hierarchyVisitBefore(root1, secondWalk);
- if (nodeSize) d3_layout_hierarchyVisitBefore(root0, sizeNode); else {
- var left = root0, right = root0, bottom = root0;
- d3_layout_hierarchyVisitBefore(root0, function(node) {
- if (node.x < left.x) left = node;
- if (node.x > right.x) right = node;
- if (node.depth > bottom.depth) bottom = node;
- });
- var tx = separation(left, right) / 2 - left.x, kx = size[0] / (right.x + separation(right, left) / 2 + tx), ky = size[1] / (bottom.depth || 1);
- d3_layout_hierarchyVisitBefore(root0, function(node) {
- node.x = (node.x + tx) * kx;
- node.y = node.depth * ky;
- });
- }
- return nodes;
- }
- function wrapTree(root0) {
- var root1 = {
- A: null,
- children: [ root0 ]
- }, queue = [ root1 ], node1;
- while ((node1 = queue.pop()) != null) {
- for (var children = node1.children, child, i = 0, n = children.length; i < n; ++i) {
- queue.push((children[i] = child = {
- _: children[i],
- parent: node1,
- children: (child = children[i].children) && child.slice() || [],
- A: null,
- a: null,
- z: 0,
- m: 0,
- c: 0,
- s: 0,
- t: null,
- i: i
- }).a = child);
- }
- }
- return root1.children[0];
- }
- function firstWalk(v) {
- var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null;
- if (children.length) {
- d3_layout_treeShift(v);
- var midpoint = (children[0].z + children[children.length - 1].z) / 2;
- if (w) {
- v.z = w.z + separation(v._, w._);
- v.m = v.z - midpoint;
- } else {
- v.z = midpoint;
- }
- } else if (w) {
- v.z = w.z + separation(v._, w._);
- }
- v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
- }
- function secondWalk(v) {
- v._.x = v.z + v.parent.m;
- v.m += v.parent.m;
- }
- function apportion(v, w, ancestor) {
- if (w) {
- var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;
- while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) {
- vom = d3_layout_treeLeft(vom);
- vop = d3_layout_treeRight(vop);
- vop.a = v;
- shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
- if (shift > 0) {
- d3_layout_treeMove(d3_layout_treeAncestor(vim, v, ancestor), v, shift);
- sip += shift;
- sop += shift;
- }
- sim += vim.m;
- sip += vip.m;
- som += vom.m;
- sop += vop.m;
- }
- if (vim && !d3_layout_treeRight(vop)) {
- vop.t = vim;
- vop.m += sim - sop;
- }
- if (vip && !d3_layout_treeLeft(vom)) {
- vom.t = vip;
- vom.m += sip - som;
- ancestor = v;
- }
- }
- return ancestor;
- }
- function sizeNode(node) {
- node.x *= size[0];
- node.y = node.depth * size[1];
- }
- tree.separation = function(x) {
- if (!arguments.length) return separation;
- separation = x;
- return tree;
- };
- tree.size = function(x) {
- if (!arguments.length) return nodeSize ? null : size;
- nodeSize = (size = x) == null ? sizeNode : null;
- return tree;
- };
- tree.nodeSize = function(x) {
- if (!arguments.length) return nodeSize ? size : null;
- nodeSize = (size = x) == null ? null : sizeNode;
- return tree;
- };
- return d3_layout_hierarchyRebind(tree, hierarchy);
- };
- function d3_layout_treeSeparation(a, b) {
- return a.parent == b.parent ? 1 : 2;
- }
- function d3_layout_treeLeft(v) {
- var children = v.children;
- return children.length ? children[0] : v.t;
- }
- function d3_layout_treeRight(v) {
- var children = v.children, n;
- return (n = children.length) ? children[n - 1] : v.t;
- }
- function d3_layout_treeMove(wm, wp, shift) {
- var change = shift / (wp.i - wm.i);
- wp.c -= change;
- wp.s += shift;
- wm.c += change;
- wp.z += shift;
- wp.m += shift;
- }
- function d3_layout_treeShift(v) {
- var shift = 0, change = 0, children = v.children, i = children.length, w;
- while (--i >= 0) {
- w = children[i];
- w.z += shift;
- w.m += shift;
- shift += w.s + (change += w.c);
- }
- }
- function d3_layout_treeAncestor(vim, v, ancestor) {
- return vim.a.parent === v.parent ? vim.a : ancestor;
- }
- d3.layout.cluster = function() {
- var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false;
- function cluster(d, i) {
- var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0;
- d3_layout_hierarchyVisitAfter(root, function(node) {
- var children = node.children;
- if (children && children.length) {
- node.x = d3_layout_clusterX(children);
- node.y = d3_layout_clusterY(children);
- } else {
- node.x = previousNode ? x += separation(node, previousNode) : 0;
- node.y = 0;
- previousNode = node;
- }
- });
- var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2;
- d3_layout_hierarchyVisitAfter(root, nodeSize ? function(node) {
- node.x = (node.x - root.x) * size[0];
- node.y = (root.y - node.y) * size[1];
- } : function(node) {
- node.x = (node.x - x0) / (x1 - x0) * size[0];
- node.y = (1 - (root.y ? node.y / root.y : 1)) * size[1];
- });
- return nodes;
- }
- cluster.separation = function(x) {
- if (!arguments.length) return separation;
- separation = x;
- return cluster;
- };
- cluster.size = function(x) {
- if (!arguments.length) return nodeSize ? null : size;
- nodeSize = (size = x) == null;
- return cluster;
- };
- cluster.nodeSize = function(x) {
- if (!arguments.length) return nodeSize ? size : null;
- nodeSize = (size = x) != null;
- return cluster;
- };
- return d3_layout_hierarchyRebind(cluster, hierarchy);
- };
- function d3_layout_clusterY(children) {
- return 1 + d3.max(children, function(child) {
- return child.y;
- });
- }
- function d3_layout_clusterX(children) {
- return children.reduce(function(x, child) {
- return x + child.x;
- }, 0) / children.length;
- }
- function d3_layout_clusterLeft(node) {
- var children = node.children;
- return children && children.length ? d3_layout_clusterLeft(children[0]) : node;
- }
- function d3_layout_clusterRight(node) {
- var children = node.children, n;
- return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node;
- }
- d3.layout.treemap = function() {
- var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = "squarify", ratio = .5 * (1 + Math.sqrt(5));
- function scale(children, k) {
- var i = -1, n = children.length, child, area;
- while (++i < n) {
- area = (child = children[i]).value * (k < 0 ? 0 : k);
- child.area = isNaN(area) || area <= 0 ? 0 : area;
- }
- }
- function squarify(node) {
- var children = node.children;
- if (children && children.length) {
- var rect = pad(node), row = [], remaining = children.slice(), child, best = Infinity, score, u = mode === "slice" ? rect.dx : mode === "dice" ? rect.dy : mode === "slice-dice" ? node.depth & 1 ? rect.dy : rect.dx : Math.min(rect.dx, rect.dy), n;
- scale(remaining, rect.dx * rect.dy / node.value);
- row.area = 0;
- while ((n = remaining.length) > 0) {
- row.push(child = remaining[n - 1]);
- row.area += child.area;
- if (mode !== "squarify" || (score = worst(row, u)) <= best) {
- remaining.pop();
- best = score;
- } else {
- row.area -= row.pop().area;
- position(row, u, rect, false);
- u = Math.min(rect.dx, rect.dy);
- row.length = row.area = 0;
- best = Infinity;
- }
- }
- if (row.length) {
- position(row, u, rect, true);
- row.length = row.area = 0;
- }
- children.forEach(squarify);
- }
- }
- function stickify(node) {
- var children = node.children;
- if (children && children.length) {
- var rect = pad(node), remaining = children.slice(), child, row = [];
- scale(remaining, rect.dx * rect.dy / node.value);
- row.area = 0;
- while (child = remaining.pop()) {
- row.push(child);
- row.area += child.area;
- if (child.z != null) {
- position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length);
- row.length = row.area = 0;
- }
- }
- children.forEach(stickify);
- }
- }
- function worst(row, u) {
- var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length;
- while (++i < n) {
- if (!(r = row[i].area)) continue;
- if (r < rmin) rmin = r;
- if (r > rmax) rmax = r;
- }
- s *= s;
- u *= u;
- return s ? Math.max(u * rmax * ratio / s, s / (u * rmin * ratio)) : Infinity;
- }
- function position(row, u, rect, flush) {
- var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o;
- if (u == rect.dx) {
- if (flush || v > rect.dy) v = rect.dy;
- while (++i < n) {
- o = row[i];
- o.x = x;
- o.y = y;
- o.dy = v;
- x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0);
- }
- o.z = true;
- o.dx += rect.x + rect.dx - x;
- rect.y += v;
- rect.dy -= v;
- } else {
- if (flush || v > rect.dx) v = rect.dx;
- while (++i < n) {
- o = row[i];
- o.x = x;
- o.y = y;
- o.dx = v;
- y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0);
- }
- o.z = false;
- o.dy += rect.y + rect.dy - y;
- rect.x += v;
- rect.dx -= v;
- }
- }
- function treemap(d) {
- var nodes = stickies || hierarchy(d), root = nodes[0];
- root.x = root.y = 0;
- if (root.value) root.dx = size[0], root.dy = size[1]; else root.dx = root.dy = 0;
- if (stickies) hierarchy.revalue(root);
- scale([ root ], root.dx * root.dy / root.value);
- (stickies ? stickify : squarify)(root);
- if (sticky) stickies = nodes;
- return nodes;
- }
- treemap.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return treemap;
- };
- treemap.padding = function(x) {
- if (!arguments.length) return padding;
- function padFunction(node) {
- var p = x.call(treemap, node, node.depth);
- return p == null ? d3_layout_treemapPadNull(node) : d3_layout_treemapPad(node, typeof p === "number" ? [ p, p, p, p ] : p);
- }
- function padConstant(node) {
- return d3_layout_treemapPad(node, x);
- }
- var type;
- pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ],
- padConstant) : padConstant;
- return treemap;
- };
- treemap.round = function(x) {
- if (!arguments.length) return round != Number;
- round = x ? Math.round : Number;
- return treemap;
- };
- treemap.sticky = function(x) {
- if (!arguments.length) return sticky;
- sticky = x;
- stickies = null;
- return treemap;
- };
- treemap.ratio = function(x) {
- if (!arguments.length) return ratio;
- ratio = x;
- return treemap;
- };
- treemap.mode = function(x) {
- if (!arguments.length) return mode;
- mode = x + "";
- return treemap;
- };
- return d3_layout_hierarchyRebind(treemap, hierarchy);
- };
- function d3_layout_treemapPadNull(node) {
- return {
- x: node.x,
- y: node.y,
- dx: node.dx,
- dy: node.dy
- };
- }
- function d3_layout_treemapPad(node, padding) {
- var x = node.x + padding[3], y = node.y + padding[0], dx = node.dx - padding[1] - padding[3], dy = node.dy - padding[0] - padding[2];
- if (dx < 0) {
- x += dx / 2;
- dx = 0;
- }
- if (dy < 0) {
- y += dy / 2;
- dy = 0;
- }
- return {
- x: x,
- y: y,
- dx: dx,
- dy: dy
- };
- }
- d3.random = {
- normal: function(µ, σ) {
- var n = arguments.length;
- if (n < 2) σ = 1;
- if (n < 1) µ = 0;
- return function() {
- var x, y, r;
- do {
- x = Math.random() * 2 - 1;
- y = Math.random() * 2 - 1;
- r = x * x + y * y;
- } while (!r || r > 1);
- return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
- };
- },
- logNormal: function() {
- var random = d3.random.normal.apply(d3, arguments);
- return function() {
- return Math.exp(random());
- };
- },
- bates: function(m) {
- var random = d3.random.irwinHall(m);
- return function() {
- return random() / m;
- };
- },
- irwinHall: function(m) {
- return function() {
- for (var s = 0, j = 0; j < m; j++) s += Math.random();
- return s;
- };
- }
- };
- d3.scale = {};
- function d3_scaleExtent(domain) {
- var start = domain[0], stop = domain[domain.length - 1];
- return start < stop ? [ start, stop ] : [ stop, start ];
- }
- function d3_scaleRange(scale) {
- return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range());
- }
- function d3_scale_bilinear(domain, range, uninterpolate, interpolate) {
- var u = uninterpolate(domain[0], domain[1]), i = interpolate(range[0], range[1]);
- return function(x) {
- return i(u(x));
- };
- }
- function d3_scale_nice(domain, nice) {
- var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], dx;
- if (x1 < x0) {
- dx = i0, i0 = i1, i1 = dx;
- dx = x0, x0 = x1, x1 = dx;
- }
- domain[i0] = nice.floor(x0);
- domain[i1] = nice.ceil(x1);
- return domain;
- }
- function d3_scale_niceStep(step) {
- return step ? {
- floor: function(x) {
- return Math.floor(x / step) * step;
- },
- ceil: function(x) {
- return Math.ceil(x / step) * step;
- }
- } : d3_scale_niceIdentity;
- }
- var d3_scale_niceIdentity = {
- floor: d3_identity,
- ceil: d3_identity
- };
- function d3_scale_polylinear(domain, range, uninterpolate, interpolate) {
- var u = [], i = [], j = 0, k = Math.min(domain.length, range.length) - 1;
- if (domain[k] < domain[0]) {
- domain = domain.slice().reverse();
- range = range.slice().reverse();
- }
- while (++j <= k) {
- u.push(uninterpolate(domain[j - 1], domain[j]));
- i.push(interpolate(range[j - 1], range[j]));
- }
- return function(x) {
- var j = d3.bisect(domain, x, 1, k) - 1;
- return i[j](u[j](x));
- };
- }
- d3.scale.linear = function() {
- return d3_scale_linear([ 0, 1 ], [ 0, 1 ], d3_interpolate, false);
- };
- function d3_scale_linear(domain, range, interpolate, clamp) {
- var output, input;
- function rescale() {
- var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear, uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber;
- output = linear(domain, range, uninterpolate, interpolate);
- input = linear(range, domain, uninterpolate, d3_interpolate);
- return scale;
- }
- function scale(x) {
- return output(x);
- }
- scale.invert = function(y) {
- return input(y);
- };
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- domain = x.map(Number);
- return rescale();
- };
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- return rescale();
- };
- scale.rangeRound = function(x) {
- return scale.range(x).interpolate(d3_interpolateRound);
- };
- scale.clamp = function(x) {
- if (!arguments.length) return clamp;
- clamp = x;
- return rescale();
- };
- scale.interpolate = function(x) {
- if (!arguments.length) return interpolate;
- interpolate = x;
- return rescale();
- };
- scale.ticks = function(m) {
- return d3_scale_linearTicks(domain, m);
- };
- scale.tickFormat = function(m, format) {
- return d3_scale_linearTickFormat(domain, m, format);
- };
- scale.nice = function(m) {
- d3_scale_linearNice(domain, m);
- return rescale();
- };
- scale.copy = function() {
- return d3_scale_linear(domain, range, interpolate, clamp);
- };
- return rescale();
- }
- function d3_scale_linearRebind(scale, linear) {
- return d3.rebind(scale, linear, "range", "rangeRound", "interpolate", "clamp");
- }
- function d3_scale_linearNice(domain, m) {
- d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));
- d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));
- return domain;
- }
- function d3_scale_linearTickRange(domain, m) {
- if (m == null) m = 10;
- var extent = d3_scaleExtent(domain), span = extent[1] - extent[0], step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)), err = m / span * step;
- if (err <= .15) step *= 10; else if (err <= .35) step *= 5; else if (err <= .75) step *= 2;
- extent[0] = Math.ceil(extent[0] / step) * step;
- extent[1] = Math.floor(extent[1] / step) * step + step * .5;
- extent[2] = step;
- return extent;
- }
- function d3_scale_linearTicks(domain, m) {
- return d3.range.apply(d3, d3_scale_linearTickRange(domain, m));
- }
- function d3_scale_linearTickFormat(domain, m, format) {
- var range = d3_scale_linearTickRange(domain, m);
- if (format) {
- var match = d3_format_re.exec(format);
- match.shift();
- if (match[8] === "s") {
- var prefix = d3.formatPrefix(Math.max(abs(range[0]), abs(range[1])));
- if (!match[7]) match[7] = "." + d3_scale_linearPrecision(prefix.scale(range[2]));
- match[8] = "f";
- format = d3.format(match.join(""));
- return function(d) {
- return format(prefix.scale(d)) + prefix.symbol;
- };
- }
- if (!match[7]) match[7] = "." + d3_scale_linearFormatPrecision(match[8], range);
- format = match.join("");
- } else {
- format = ",." + d3_scale_linearPrecision(range[2]) + "f";
- }
- return d3.format(format);
- }
- var d3_scale_linearFormatSignificant = {
- s: 1,
- g: 1,
- p: 1,
- r: 1,
- e: 1
- };
- function d3_scale_linearPrecision(value) {
- return -Math.floor(Math.log(value) / Math.LN10 + .01);
- }
- function d3_scale_linearFormatPrecision(type, range) {
- var p = d3_scale_linearPrecision(range[2]);
- return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(abs(range[0]), abs(range[1])))) + +(type !== "e") : p - (type === "%") * 2;
- }
- d3.scale.log = function() {
- return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]);
- };
- function d3_scale_log(linear, base, positive, domain) {
- function log(x) {
- return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base);
- }
- function pow(x) {
- return positive ? Math.pow(base, x) : -Math.pow(base, -x);
- }
- function scale(x) {
- return linear(log(x));
- }
- scale.invert = function(x) {
- return pow(linear.invert(x));
- };
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- positive = x[0] >= 0;
- linear.domain((domain = x.map(Number)).map(log));
- return scale;
- };
- scale.base = function(_) {
- if (!arguments.length) return base;
- base = +_;
- linear.domain(domain.map(log));
- return scale;
- };
- scale.nice = function() {
- var niced = d3_scale_nice(domain.map(log), positive ? Math : d3_scale_logNiceNegative);
- linear.domain(niced);
- domain = niced.map(pow);
- return scale;
- };
- scale.ticks = function() {
- var extent = d3_scaleExtent(domain), ticks = [], u = extent[0], v = extent[1], i = Math.floor(log(u)), j = Math.ceil(log(v)), n = base % 1 ? 2 : base;
- if (isFinite(j - i)) {
- if (positive) {
- for (;i < j; i++) for (var k = 1; k < n; k++) ticks.push(pow(i) * k);
- ticks.push(pow(i));
- } else {
- ticks.push(pow(i));
- for (;i++ < j; ) for (var k = n - 1; k > 0; k--) ticks.push(pow(i) * k);
- }
- for (i = 0; ticks[i] < u; i++) {}
- for (j = ticks.length; ticks[j - 1] > v; j--) {}
- ticks = ticks.slice(i, j);
- }
- return ticks;
- };
- scale.tickFormat = function(n, format) {
- if (!arguments.length) return d3_scale_logFormat;
- if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== "function") format = d3.format(format);
- var k = Math.max(1, base * n / scale.ticks().length);
- return function(d) {
- var i = d / pow(Math.round(log(d)));
- if (i * base < base - .5) i *= base;
- return i <= k ? format(d) : "";
- };
- };
- scale.copy = function() {
- return d3_scale_log(linear.copy(), base, positive, domain);
- };
- return d3_scale_linearRebind(scale, linear);
- }
- var d3_scale_logFormat = d3.format(".0e"), d3_scale_logNiceNegative = {
- floor: function(x) {
- return -Math.ceil(-x);
- },
- ceil: function(x) {
- return -Math.floor(-x);
- }
- };
- d3.scale.pow = function() {
- return d3_scale_pow(d3.scale.linear(), 1, [ 0, 1 ]);
- };
- function d3_scale_pow(linear, exponent, domain) {
- var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent);
- function scale(x) {
- return linear(powp(x));
- }
- scale.invert = function(x) {
- return powb(linear.invert(x));
- };
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- linear.domain((domain = x.map(Number)).map(powp));
- return scale;
- };
- scale.ticks = function(m) {
- return d3_scale_linearTicks(domain, m);
- };
- scale.tickFormat = function(m, format) {
- return d3_scale_linearTickFormat(domain, m, format);
- };
- scale.nice = function(m) {
- return scale.domain(d3_scale_linearNice(domain, m));
- };
- scale.exponent = function(x) {
- if (!arguments.length) return exponent;
- powp = d3_scale_powPow(exponent = x);
- powb = d3_scale_powPow(1 / exponent);
- linear.domain(domain.map(powp));
- return scale;
- };
- scale.copy = function() {
- return d3_scale_pow(linear.copy(), exponent, domain);
- };
- return d3_scale_linearRebind(scale, linear);
- }
- function d3_scale_powPow(e) {
- return function(x) {
- return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e);
- };
- }
- d3.scale.sqrt = function() {
- return d3.scale.pow().exponent(.5);
- };
- d3.scale.ordinal = function() {
- return d3_scale_ordinal([], {
- t: "range",
- a: [ [] ]
- });
- };
- function d3_scale_ordinal(domain, ranger) {
- var index, range, rangeBand;
- function scale(x) {
- return range[((index.get(x) || (ranger.t === "range" ? index.set(x, domain.push(x)) : NaN)) - 1) % range.length];
- }
- function steps(start, step) {
- return d3.range(domain.length).map(function(i) {
- return start + step * i;
- });
- }
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- domain = [];
- index = new d3_Map();
- var i = -1, n = x.length, xi;
- while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi));
- return scale[ranger.t].apply(scale, ranger.a);
- };
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- rangeBand = 0;
- ranger = {
- t: "range",
- a: arguments
- };
- return scale;
- };
- scale.rangePoints = function(x, padding) {
- if (arguments.length < 2) padding = 0;
- var start = x[0], stop = x[1], step = domain.length < 2 ? (start = (start + stop) / 2,
- 0) : (stop - start) / (domain.length - 1 + padding);
- range = steps(start + step * padding / 2, step);
- rangeBand = 0;
- ranger = {
- t: "rangePoints",
- a: arguments
- };
- return scale;
- };
- scale.rangeRoundPoints = function(x, padding) {
- if (arguments.length < 2) padding = 0;
- var start = x[0], stop = x[1], step = domain.length < 2 ? (start = stop = Math.round((start + stop) / 2),
- 0) : (stop - start) / (domain.length - 1 + padding) | 0;
- range = steps(start + Math.round(step * padding / 2 + (stop - start - (domain.length - 1 + padding) * step) / 2), step);
- rangeBand = 0;
- ranger = {
- t: "rangeRoundPoints",
- a: arguments
- };
- return scale;
- };
- scale.rangeBands = function(x, padding, outerPadding) {
- if (arguments.length < 2) padding = 0;
- if (arguments.length < 3) outerPadding = padding;
- var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = (stop - start) / (domain.length - padding + 2 * outerPadding);
- range = steps(start + step * outerPadding, step);
- if (reverse) range.reverse();
- rangeBand = step * (1 - padding);
- ranger = {
- t: "rangeBands",
- a: arguments
- };
- return scale;
- };
- scale.rangeRoundBands = function(x, padding, outerPadding) {
- if (arguments.length < 2) padding = 0;
- if (arguments.length < 3) outerPadding = padding;
- var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = Math.floor((stop - start) / (domain.length - padding + 2 * outerPadding));
- range = steps(start + Math.round((stop - start - (domain.length - padding) * step) / 2), step);
- if (reverse) range.reverse();
- rangeBand = Math.round(step * (1 - padding));
- ranger = {
- t: "rangeRoundBands",
- a: arguments
- };
- return scale;
- };
- scale.rangeBand = function() {
- return rangeBand;
- };
- scale.rangeExtent = function() {
- return d3_scaleExtent(ranger.a[0]);
- };
- scale.copy = function() {
- return d3_scale_ordinal(domain, ranger);
- };
- return scale.domain(domain);
- }
- d3.scale.category10 = function() {
- return d3.scale.ordinal().range(d3_category10);
- };
- d3.scale.category20 = function() {
- return d3.scale.ordinal().range(d3_category20);
- };
- d3.scale.category20b = function() {
- return d3.scale.ordinal().range(d3_category20b);
- };
- d3.scale.category20c = function() {
- return d3.scale.ordinal().range(d3_category20c);
- };
- var d3_category10 = [ 2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175 ].map(d3_rgbString);
- var d3_category20 = [ 2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725 ].map(d3_rgbString);
- var d3_category20b = [ 3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654 ].map(d3_rgbString);
- var d3_category20c = [ 3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081 ].map(d3_rgbString);
- d3.scale.quantile = function() {
- return d3_scale_quantile([], []);
- };
- function d3_scale_quantile(domain, range) {
- var thresholds;
- function rescale() {
- var k = 0, q = range.length;
- thresholds = [];
- while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q);
- return scale;
- }
- function scale(x) {
- if (!isNaN(x = +x)) return range[d3.bisect(thresholds, x)];
- }
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- domain = x.map(d3_number).filter(d3_numeric).sort(d3_ascending);
- return rescale();
- };
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- return rescale();
- };
- scale.quantiles = function() {
- return thresholds;
- };
- scale.invertExtent = function(y) {
- y = range.indexOf(y);
- return y < 0 ? [ NaN, NaN ] : [ y > 0 ? thresholds[y - 1] : domain[0], y < thresholds.length ? thresholds[y] : domain[domain.length - 1] ];
- };
- scale.copy = function() {
- return d3_scale_quantile(domain, range);
- };
- return rescale();
- }
- d3.scale.quantize = function() {
- return d3_scale_quantize(0, 1, [ 0, 1 ]);
- };
- function d3_scale_quantize(x0, x1, range) {
- var kx, i;
- function scale(x) {
- return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))];
- }
- function rescale() {
- kx = range.length / (x1 - x0);
- i = range.length - 1;
- return scale;
- }
- scale.domain = function(x) {
- if (!arguments.length) return [ x0, x1 ];
- x0 = +x[0];
- x1 = +x[x.length - 1];
- return rescale();
- };
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- return rescale();
- };
- scale.invertExtent = function(y) {
- y = range.indexOf(y);
- y = y < 0 ? NaN : y / kx + x0;
- return [ y, y + 1 / kx ];
- };
- scale.copy = function() {
- return d3_scale_quantize(x0, x1, range);
- };
- return rescale();
- }
- d3.scale.threshold = function() {
- return d3_scale_threshold([ .5 ], [ 0, 1 ]);
- };
- function d3_scale_threshold(domain, range) {
- function scale(x) {
- if (x <= x) return range[d3.bisect(domain, x)];
- }
- scale.domain = function(_) {
- if (!arguments.length) return domain;
- domain = _;
- return scale;
- };
- scale.range = function(_) {
- if (!arguments.length) return range;
- range = _;
- return scale;
- };
- scale.invertExtent = function(y) {
- y = range.indexOf(y);
- return [ domain[y - 1], domain[y] ];
- };
- scale.copy = function() {
- return d3_scale_threshold(domain, range);
- };
- return scale;
- }
- d3.scale.identity = function() {
- return d3_scale_identity([ 0, 1 ]);
- };
- function d3_scale_identity(domain) {
- function identity(x) {
- return +x;
- }
- identity.invert = identity;
- identity.domain = identity.range = function(x) {
- if (!arguments.length) return domain;
- domain = x.map(identity);
- return identity;
- };
- identity.ticks = function(m) {
- return d3_scale_linearTicks(domain, m);
- };
- identity.tickFormat = function(m, format) {
- return d3_scale_linearTickFormat(domain, m, format);
- };
- identity.copy = function() {
- return d3_scale_identity(domain);
- };
- return identity;
- }
- d3.svg = {};
- function d3_zero() {
- return 0;
- }
- d3.svg.arc = function() {
- var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, cornerRadius = d3_zero, padRadius = d3_svg_arcAuto, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle, padAngle = d3_svg_arcPadAngle;
- function arc() {
- var r0 = Math.max(0, +innerRadius.apply(this, arguments)), r1 = Math.max(0, +outerRadius.apply(this, arguments)), a0 = startAngle.apply(this, arguments) - halfπ, a1 = endAngle.apply(this, arguments) - halfπ, da = Math.abs(a1 - a0), cw = a0 > a1 ? 0 : 1;
- if (r1 < r0) rc = r1, r1 = r0, r0 = rc;
- if (da >= τε) return circleSegment(r1, cw) + (r0 ? circleSegment(r0, 1 - cw) : "") + "Z";
- var rc, cr, rp, ap, p0 = 0, p1 = 0, x0, y0, x1, y1, x2, y2, x3, y3, path = [];
- if (ap = (+padAngle.apply(this, arguments) || 0) / 2) {
- rp = padRadius === d3_svg_arcAuto ? Math.sqrt(r0 * r0 + r1 * r1) : +padRadius.apply(this, arguments);
- if (!cw) p1 *= -1;
- if (r1) p1 = d3_asin(rp / r1 * Math.sin(ap));
- if (r0) p0 = d3_asin(rp / r0 * Math.sin(ap));
- }
- if (r1) {
- x0 = r1 * Math.cos(a0 + p1);
- y0 = r1 * Math.sin(a0 + p1);
- x1 = r1 * Math.cos(a1 - p1);
- y1 = r1 * Math.sin(a1 - p1);
- var l1 = Math.abs(a1 - a0 - 2 * p1) <= π ? 0 : 1;
- if (p1 && d3_svg_arcSweep(x0, y0, x1, y1) === cw ^ l1) {
- var h1 = (a0 + a1) / 2;
- x0 = r1 * Math.cos(h1);
- y0 = r1 * Math.sin(h1);
- x1 = y1 = null;
- }
- } else {
- x0 = y0 = 0;
- }
- if (r0) {
- x2 = r0 * Math.cos(a1 - p0);
- y2 = r0 * Math.sin(a1 - p0);
- x3 = r0 * Math.cos(a0 + p0);
- y3 = r0 * Math.sin(a0 + p0);
- var l0 = Math.abs(a0 - a1 + 2 * p0) <= π ? 0 : 1;
- if (p0 && d3_svg_arcSweep(x2, y2, x3, y3) === 1 - cw ^ l0) {
- var h0 = (a0 + a1) / 2;
- x2 = r0 * Math.cos(h0);
- y2 = r0 * Math.sin(h0);
- x3 = y3 = null;
- }
- } else {
- x2 = y2 = 0;
- }
- if (da > ε && (rc = Math.min(Math.abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments))) > .001) {
- cr = r0 < r1 ^ cw ? 0 : 1;
- var rc1 = rc, rc0 = rc;
- if (da < π) {
- var oc = x3 == null ? [ x2, y2 ] : x1 == null ? [ x0, y0 ] : d3_geom_polygonIntersect([ x0, y0 ], [ x3, y3 ], [ x1, y1 ], [ x2, y2 ]), ax = x0 - oc[0], ay = y0 - oc[1], bx = x1 - oc[0], by = y1 - oc[1], kc = 1 / Math.sin(Math.acos((ax * bx + ay * by) / (Math.sqrt(ax * ax + ay * ay) * Math.sqrt(bx * bx + by * by))) / 2), lc = Math.sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
- rc0 = Math.min(rc, (r0 - lc) / (kc - 1));
- rc1 = Math.min(rc, (r1 - lc) / (kc + 1));
- }
- if (x1 != null) {
- var t30 = d3_svg_arcCornerTangents(x3 == null ? [ x2, y2 ] : [ x3, y3 ], [ x0, y0 ], r1, rc1, cw), t12 = d3_svg_arcCornerTangents([ x1, y1 ], [ x2, y2 ], r1, rc1, cw);
- if (rc === rc1) {
- path.push("M", t30[0], "A", rc1, ",", rc1, " 0 0,", cr, " ", t30[1], "A", r1, ",", r1, " 0 ", 1 - cw ^ d3_svg_arcSweep(t30[1][0], t30[1][1], t12[1][0], t12[1][1]), ",", cw, " ", t12[1], "A", rc1, ",", rc1, " 0 0,", cr, " ", t12[0]);
- } else {
- path.push("M", t30[0], "A", rc1, ",", rc1, " 0 1,", cr, " ", t12[0]);
- }
- } else {
- path.push("M", x0, ",", y0);
- }
- if (x3 != null) {
- var t03 = d3_svg_arcCornerTangents([ x0, y0 ], [ x3, y3 ], r0, -rc0, cw), t21 = d3_svg_arcCornerTangents([ x2, y2 ], x1 == null ? [ x0, y0 ] : [ x1, y1 ], r0, -rc0, cw);
- if (rc === rc0) {
- path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t21[1], "A", r0, ",", r0, " 0 ", cw ^ d3_svg_arcSweep(t21[1][0], t21[1][1], t03[1][0], t03[1][1]), ",", 1 - cw, " ", t03[1], "A", rc0, ",", rc0, " 0 0,", cr, " ", t03[0]);
- } else {
- path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t03[0]);
- }
- } else {
- path.push("L", x2, ",", y2);
- }
- } else {
- path.push("M", x0, ",", y0);
- if (x1 != null) path.push("A", r1, ",", r1, " 0 ", l1, ",", cw, " ", x1, ",", y1);
- path.push("L", x2, ",", y2);
- if (x3 != null) path.push("A", r0, ",", r0, " 0 ", l0, ",", 1 - cw, " ", x3, ",", y3);
- }
- path.push("Z");
- return path.join("");
- }
- function circleSegment(r1, cw) {
- return "M0," + r1 + "A" + r1 + "," + r1 + " 0 1," + cw + " 0," + -r1 + "A" + r1 + "," + r1 + " 0 1," + cw + " 0," + r1;
- }
- arc.innerRadius = function(v) {
- if (!arguments.length) return innerRadius;
- innerRadius = d3_functor(v);
- return arc;
- };
- arc.outerRadius = function(v) {
- if (!arguments.length) return outerRadius;
- outerRadius = d3_functor(v);
- return arc;
- };
- arc.cornerRadius = function(v) {
- if (!arguments.length) return cornerRadius;
- cornerRadius = d3_functor(v);
- return arc;
- };
- arc.padRadius = function(v) {
- if (!arguments.length) return padRadius;
- padRadius = v == d3_svg_arcAuto ? d3_svg_arcAuto : d3_functor(v);
- return arc;
- };
- arc.startAngle = function(v) {
- if (!arguments.length) return startAngle;
- startAngle = d3_functor(v);
- return arc;
- };
- arc.endAngle = function(v) {
- if (!arguments.length) return endAngle;
- endAngle = d3_functor(v);
- return arc;
- };
- arc.padAngle = function(v) {
- if (!arguments.length) return padAngle;
- padAngle = d3_functor(v);
- return arc;
- };
- arc.centroid = function() {
- var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - halfπ;
- return [ Math.cos(a) * r, Math.sin(a) * r ];
- };
- return arc;
- };
- var d3_svg_arcAuto = "auto";
- function d3_svg_arcInnerRadius(d) {
- return d.innerRadius;
- }
- function d3_svg_arcOuterRadius(d) {
- return d.outerRadius;
- }
- function d3_svg_arcStartAngle(d) {
- return d.startAngle;
- }
- function d3_svg_arcEndAngle(d) {
- return d.endAngle;
- }
- function d3_svg_arcPadAngle(d) {
- return d && d.padAngle;
- }
- function d3_svg_arcSweep(x0, y0, x1, y1) {
- return (x0 - x1) * y0 - (y0 - y1) * x0 > 0 ? 0 : 1;
- }
- function d3_svg_arcCornerTangents(p0, p1, r1, rc, cw) {
- var x01 = p0[0] - p1[0], y01 = p0[1] - p1[1], lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x1 = p0[0] + ox, y1 = p0[1] + oy, x2 = p1[0] + ox, y2 = p1[1] + oy, x3 = (x1 + x2) / 2, y3 = (y1 + y2) / 2, dx = x2 - x1, dy = y2 - y1, d2 = dx * dx + dy * dy, r = r1 - rc, D = x1 * y2 - x2 * y1, d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x3, dy0 = cy0 - y3, dx1 = cx1 - x3, dy1 = cy1 - y3;
- if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
- return [ [ cx0 - ox, cy0 - oy ], [ cx0 * r1 / r, cy0 * r1 / r ] ];
- }
- function d3_svg_line(projection) {
- var x = d3_geom_pointX, y = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7;
- function line(data) {
- var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y);
- function segment() {
- segments.push("M", interpolate(projection(points), tension));
- }
- while (++i < n) {
- if (defined.call(this, d = data[i], i)) {
- points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]);
- } else if (points.length) {
- segment();
- points = [];
- }
- }
- if (points.length) segment();
- return segments.length ? segments.join("") : null;
- }
- line.x = function(_) {
- if (!arguments.length) return x;
- x = _;
- return line;
- };
- line.y = function(_) {
- if (!arguments.length) return y;
- y = _;
- return line;
- };
- line.defined = function(_) {
- if (!arguments.length) return defined;
- defined = _;
- return line;
- };
- line.interpolate = function(_) {
- if (!arguments.length) return interpolateKey;
- if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;
- return line;
- };
- line.tension = function(_) {
- if (!arguments.length) return tension;
- tension = _;
- return line;
- };
- return line;
- }
- d3.svg.line = function() {
- return d3_svg_line(d3_identity);
- };
- var d3_svg_lineInterpolators = d3.map({
- linear: d3_svg_lineLinear,
- "linear-closed": d3_svg_lineLinearClosed,
- step: d3_svg_lineStep,
- "step-before": d3_svg_lineStepBefore,
- "step-after": d3_svg_lineStepAfter,
- basis: d3_svg_lineBasis,
- "basis-open": d3_svg_lineBasisOpen,
- "basis-closed": d3_svg_lineBasisClosed,
- bundle: d3_svg_lineBundle,
- cardinal: d3_svg_lineCardinal,
- "cardinal-open": d3_svg_lineCardinalOpen,
- "cardinal-closed": d3_svg_lineCardinalClosed,
- monotone: d3_svg_lineMonotone
- });
- d3_svg_lineInterpolators.forEach(function(key, value) {
- value.key = key;
- value.closed = /-closed$/.test(key);
- });
- function d3_svg_lineLinear(points) {
- return points.length > 1 ? points.join("L") : points + "Z";
- }
- function d3_svg_lineLinearClosed(points) {
- return points.join("L") + "Z";
- }
- function d3_svg_lineStep(points) {
- var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
- while (++i < n) path.push("H", (p[0] + (p = points[i])[0]) / 2, "V", p[1]);
- if (n > 1) path.push("H", p[0]);
- return path.join("");
- }
- function d3_svg_lineStepBefore(points) {
- var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
- while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]);
- return path.join("");
- }
- function d3_svg_lineStepAfter(points) {
- var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
- while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]);
- return path.join("");
- }
- function d3_svg_lineCardinalOpen(points, tension) {
- return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, -1), d3_svg_lineCardinalTangents(points, tension));
- }
- function d3_svg_lineCardinalClosed(points, tension) {
- return points.length < 3 ? d3_svg_lineLinearClosed(points) : points[0] + d3_svg_lineHermite((points.push(points[0]),
- points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension));
- }
- function d3_svg_lineCardinal(points, tension) {
- return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension));
- }
- function d3_svg_lineHermite(points, tangents) {
- if (tangents.length < 1 || points.length != tangents.length && points.length != tangents.length + 2) {
- return d3_svg_lineLinear(points);
- }
- var quad = points.length != tangents.length, path = "", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1;
- if (quad) {
- path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1];
- p0 = points[1];
- pi = 2;
- }
- if (tangents.length > 1) {
- t = tangents[1];
- p = points[pi];
- pi++;
- path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1]) + "," + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1];
- for (var i = 2; i < tangents.length; i++, pi++) {
- p = points[pi];
- t = tangents[i];
- path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1];
- }
- }
- if (quad) {
- var lp = points[pi];
- path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1];
- }
- return path;
- }
- function d3_svg_lineCardinalTangents(points, tension) {
- var tangents = [], a = (1 - tension) / 2, p0, p1 = points[0], p2 = points[1], i = 1, n = points.length;
- while (++i < n) {
- p0 = p1;
- p1 = p2;
- p2 = points[i];
- tangents.push([ a * (p2[0] - p0[0]), a * (p2[1] - p0[1]) ]);
- }
- return tangents;
- }
- function d3_svg_lineBasis(points) {
- if (points.length < 3) return d3_svg_lineLinear(points);
- var i = 1, n = points.length, pi = points[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, ",", y0, "L", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];
- points.push(points[n - 1]);
- while (++i <= n) {
- pi = points[i];
- px.shift();
- px.push(pi[0]);
- py.shift();
- py.push(pi[1]);
- d3_svg_lineBasisBezier(path, px, py);
- }
- points.pop();
- path.push("L", pi);
- return path.join("");
- }
- function d3_svg_lineBasisOpen(points) {
- if (points.length < 4) return d3_svg_lineLinear(points);
- var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ];
- while (++i < 3) {
- pi = points[i];
- px.push(pi[0]);
- py.push(pi[1]);
- }
- path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py));
- --i;
- while (++i < n) {
- pi = points[i];
- px.shift();
- px.push(pi[0]);
- py.shift();
- py.push(pi[1]);
- d3_svg_lineBasisBezier(path, px, py);
- }
- return path.join("");
- }
- function d3_svg_lineBasisClosed(points) {
- var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = [];
- while (++i < 4) {
- pi = points[i % n];
- px.push(pi[0]);
- py.push(pi[1]);
- }
- path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];
- --i;
- while (++i < m) {
- pi = points[i % n];
- px.shift();
- px.push(pi[0]);
- py.shift();
- py.push(pi[1]);
- d3_svg_lineBasisBezier(path, px, py);
- }
- return path.join("");
- }
- function d3_svg_lineBundle(points, tension) {
- var n = points.length - 1;
- if (n) {
- var x0 = points[0][0], y0 = points[0][1], dx = points[n][0] - x0, dy = points[n][1] - y0, i = -1, p, t;
- while (++i <= n) {
- p = points[i];
- t = i / n;
- p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx);
- p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy);
- }
- }
- return d3_svg_lineBasis(points);
- }
- function d3_svg_lineDot4(a, b) {
- return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
- }
- var d3_svg_lineBasisBezier1 = [ 0, 2 / 3, 1 / 3, 0 ], d3_svg_lineBasisBezier2 = [ 0, 1 / 3, 2 / 3, 0 ], d3_svg_lineBasisBezier3 = [ 0, 1 / 6, 2 / 3, 1 / 6 ];
- function d3_svg_lineBasisBezier(path, x, y) {
- path.push("C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y));
- }
- function d3_svg_lineSlope(p0, p1) {
- return (p1[1] - p0[1]) / (p1[0] - p0[0]);
- }
- function d3_svg_lineFiniteDifferences(points) {
- var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1);
- while (++i < j) {
- m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2;
- }
- m[i] = d;
- return m;
- }
- function d3_svg_lineMonotoneTangents(points) {
- var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1;
- while (++i < j) {
- d = d3_svg_lineSlope(points[i], points[i + 1]);
- if (abs(d) < ε) {
- m[i] = m[i + 1] = 0;
- } else {
- a = m[i] / d;
- b = m[i + 1] / d;
- s = a * a + b * b;
- if (s > 9) {
- s = d * 3 / Math.sqrt(s);
- m[i] = s * a;
- m[i + 1] = s * b;
- }
- }
- }
- i = -1;
- while (++i <= j) {
- s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0]) / (6 * (1 + m[i] * m[i]));
- tangents.push([ s || 0, m[i] * s || 0 ]);
- }
- return tangents;
- }
- function d3_svg_lineMonotone(points) {
- return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points));
- }
- d3.svg.line.radial = function() {
- var line = d3_svg_line(d3_svg_lineRadial);
- line.radius = line.x, delete line.x;
- line.angle = line.y, delete line.y;
- return line;
- };
- function d3_svg_lineRadial(points) {
- var point, i = -1, n = points.length, r, a;
- while (++i < n) {
- point = points[i];
- r = point[0];
- a = point[1] - halfπ;
- point[0] = r * Math.cos(a);
- point[1] = r * Math.sin(a);
- }
- return points;
- }
- function d3_svg_area(projection) {
- var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = "L", tension = .7;
- function area(data) {
- var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() {
- return x;
- } : d3_functor(x1), fy1 = y0 === y1 ? function() {
- return y;
- } : d3_functor(y1), x, y;
- function segment() {
- segments.push("M", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), "Z");
- }
- while (++i < n) {
- if (defined.call(this, d = data[i], i)) {
- points0.push([ x = +fx0.call(this, d, i), y = +fy0.call(this, d, i) ]);
- points1.push([ +fx1.call(this, d, i), +fy1.call(this, d, i) ]);
- } else if (points0.length) {
- segment();
- points0 = [];
- points1 = [];
- }
- }
- if (points0.length) segment();
- return segments.length ? segments.join("") : null;
- }
- area.x = function(_) {
- if (!arguments.length) return x1;
- x0 = x1 = _;
- return area;
- };
- area.x0 = function(_) {
- if (!arguments.length) return x0;
- x0 = _;
- return area;
- };
- area.x1 = function(_) {
- if (!arguments.length) return x1;
- x1 = _;
- return area;
- };
- area.y = function(_) {
- if (!arguments.length) return y1;
- y0 = y1 = _;
- return area;
- };
- area.y0 = function(_) {
- if (!arguments.length) return y0;
- y0 = _;
- return area;
- };
- area.y1 = function(_) {
- if (!arguments.length) return y1;
- y1 = _;
- return area;
- };
- area.defined = function(_) {
- if (!arguments.length) return defined;
- defined = _;
- return area;
- };
- area.interpolate = function(_) {
- if (!arguments.length) return interpolateKey;
- if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;
- interpolateReverse = interpolate.reverse || interpolate;
- L = interpolate.closed ? "M" : "L";
- return area;
- };
- area.tension = function(_) {
- if (!arguments.length) return tension;
- tension = _;
- return area;
- };
- return area;
- }
- d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter;
- d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore;
- d3.svg.area = function() {
- return d3_svg_area(d3_identity);
- };
- d3.svg.area.radial = function() {
- var area = d3_svg_area(d3_svg_lineRadial);
- area.radius = area.x, delete area.x;
- area.innerRadius = area.x0, delete area.x0;
- area.outerRadius = area.x1, delete area.x1;
- area.angle = area.y, delete area.y;
- area.startAngle = area.y0, delete area.y0;
- area.endAngle = area.y1, delete area.y1;
- return area;
- };
- d3.svg.chord = function() {
- var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle;
- function chord(d, i) {
- var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i);
- return "M" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + "Z";
- }
- function subgroup(self, f, d, i) {
- var subgroup = f.call(self, d, i), r = radius.call(self, subgroup, i), a0 = startAngle.call(self, subgroup, i) - halfπ, a1 = endAngle.call(self, subgroup, i) - halfπ;
- return {
- r: r,
- a0: a0,
- a1: a1,
- p0: [ r * Math.cos(a0), r * Math.sin(a0) ],
- p1: [ r * Math.cos(a1), r * Math.sin(a1) ]
- };
- }
- function equals(a, b) {
- return a.a0 == b.a0 && a.a1 == b.a1;
- }
- function arc(r, p, a) {
- return "A" + r + "," + r + " 0 " + +(a > π) + ",1 " + p;
- }
- function curve(r0, p0, r1, p1) {
- return "Q 0,0 " + p1;
- }
- chord.radius = function(v) {
- if (!arguments.length) return radius;
- radius = d3_functor(v);
- return chord;
- };
- chord.source = function(v) {
- if (!arguments.length) return source;
- source = d3_functor(v);
- return chord;
- };
- chord.target = function(v) {
- if (!arguments.length) return target;
- target = d3_functor(v);
- return chord;
- };
- chord.startAngle = function(v) {
- if (!arguments.length) return startAngle;
- startAngle = d3_functor(v);
- return chord;
- };
- chord.endAngle = function(v) {
- if (!arguments.length) return endAngle;
- endAngle = d3_functor(v);
- return chord;
- };
- return chord;
- };
- function d3_svg_chordRadius(d) {
- return d.radius;
- }
- d3.svg.diagonal = function() {
- var source = d3_source, target = d3_target, projection = d3_svg_diagonalProjection;
- function diagonal(d, i) {
- var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, {
- x: p0.x,
- y: m
- }, {
- x: p3.x,
- y: m
- }, p3 ];
- p = p.map(projection);
- return "M" + p[0] + "C" + p[1] + " " + p[2] + " " + p[3];
- }
- diagonal.source = function(x) {
- if (!arguments.length) return source;
- source = d3_functor(x);
- return diagonal;
- };
- diagonal.target = function(x) {
- if (!arguments.length) return target;
- target = d3_functor(x);
- return diagonal;
- };
- diagonal.projection = function(x) {
- if (!arguments.length) return projection;
- projection = x;
- return diagonal;
- };
- return diagonal;
- };
- function d3_svg_diagonalProjection(d) {
- return [ d.x, d.y ];
- }
- d3.svg.diagonal.radial = function() {
- var diagonal = d3.svg.diagonal(), projection = d3_svg_diagonalProjection, projection_ = diagonal.projection;
- diagonal.projection = function(x) {
- return arguments.length ? projection_(d3_svg_diagonalRadialProjection(projection = x)) : projection;
- };
- return diagonal;
- };
- function d3_svg_diagonalRadialProjection(projection) {
- return function() {
- var d = projection.apply(this, arguments), r = d[0], a = d[1] - halfπ;
- return [ r * Math.cos(a), r * Math.sin(a) ];
- };
- }
- d3.svg.symbol = function() {
- var type = d3_svg_symbolType, size = d3_svg_symbolSize;
- function symbol(d, i) {
- return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle)(size.call(this, d, i));
- }
- symbol.type = function(x) {
- if (!arguments.length) return type;
- type = d3_functor(x);
- return symbol;
- };
- symbol.size = function(x) {
- if (!arguments.length) return size;
- size = d3_functor(x);
- return symbol;
- };
- return symbol;
- };
- function d3_svg_symbolSize() {
- return 64;
- }
- function d3_svg_symbolType() {
- return "circle";
- }
- function d3_svg_symbolCircle(size) {
- var r = Math.sqrt(size / π);
- return "M0," + r + "A" + r + "," + r + " 0 1,1 0," + -r + "A" + r + "," + r + " 0 1,1 0," + r + "Z";
- }
- var d3_svg_symbols = d3.map({
- circle: d3_svg_symbolCircle,
- cross: function(size) {
- var r = Math.sqrt(size / 5) / 2;
- return "M" + -3 * r + "," + -r + "H" + -r + "V" + -3 * r + "H" + r + "V" + -r + "H" + 3 * r + "V" + r + "H" + r + "V" + 3 * r + "H" + -r + "V" + r + "H" + -3 * r + "Z";
- },
- diamond: function(size) {
- var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)), rx = ry * d3_svg_symbolTan30;
- return "M0," + -ry + "L" + rx + ",0" + " 0," + ry + " " + -rx + ",0" + "Z";
- },
- square: function(size) {
- var r = Math.sqrt(size) / 2;
- return "M" + -r + "," + -r + "L" + r + "," + -r + " " + r + "," + r + " " + -r + "," + r + "Z";
- },
- "triangle-down": function(size) {
- var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;
- return "M0," + ry + "L" + rx + "," + -ry + " " + -rx + "," + -ry + "Z";
- },
- "triangle-up": function(size) {
- var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;
- return "M0," + -ry + "L" + rx + "," + ry + " " + -rx + "," + ry + "Z";
- }
- });
- d3.svg.symbolTypes = d3_svg_symbols.keys();
- var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians);
- d3_selectionPrototype.transition = function(name) {
- var id = d3_transitionInheritId || ++d3_transitionId, ns = d3_transitionNamespace(name), subgroups = [], subgroup, node, transition = d3_transitionInherit || {
- time: Date.now(),
- ease: d3_ease_cubicInOut,
- delay: 0,
- duration: 250
- };
- for (var j = -1, m = this.length; ++j < m; ) {
- subgroups.push(subgroup = []);
- for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) d3_transitionNode(node, i, ns, id, transition);
- subgroup.push(node);
- }
- }
- return d3_transition(subgroups, ns, id);
- };
- d3_selectionPrototype.interrupt = function(name) {
- return this.each(name == null ? d3_selection_interrupt : d3_selection_interruptNS(d3_transitionNamespace(name)));
- };
- var d3_selection_interrupt = d3_selection_interruptNS(d3_transitionNamespace());
- function d3_selection_interruptNS(ns) {
- return function() {
- var lock, activeId, active;
- if ((lock = this[ns]) && (active = lock[activeId = lock.active])) {
- active.timer.c = null;
- active.timer.t = NaN;
- if (--lock.count) delete lock[activeId]; else delete this[ns];
- lock.active += .5;
- active.event && active.event.interrupt.call(this, this.__data__, active.index);
- }
- };
- }
- function d3_transition(groups, ns, id) {
- d3_subclass(groups, d3_transitionPrototype);
- groups.namespace = ns;
- groups.id = id;
- return groups;
- }
- var d3_transitionPrototype = [], d3_transitionId = 0, d3_transitionInheritId, d3_transitionInherit;
- d3_transitionPrototype.call = d3_selectionPrototype.call;
- d3_transitionPrototype.empty = d3_selectionPrototype.empty;
- d3_transitionPrototype.node = d3_selectionPrototype.node;
- d3_transitionPrototype.size = d3_selectionPrototype.size;
- d3.transition = function(selection, name) {
- return selection && selection.transition ? d3_transitionInheritId ? selection.transition(name) : selection : d3.selection().transition(selection);
- };
- d3.transition.prototype = d3_transitionPrototype;
- d3_transitionPrototype.select = function(selector) {
- var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnode, node;
- selector = d3_selection_selector(selector);
- for (var j = -1, m = this.length; ++j < m; ) {
- subgroups.push(subgroup = []);
- for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
- if ((node = group[i]) && (subnode = selector.call(node, node.__data__, i, j))) {
- if ("__data__" in node) subnode.__data__ = node.__data__;
- d3_transitionNode(subnode, i, ns, id, node[ns][id]);
- subgroup.push(subnode);
- } else {
- subgroup.push(null);
- }
- }
- }
- return d3_transition(subgroups, ns, id);
- };
- d3_transitionPrototype.selectAll = function(selector) {
- var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnodes, node, subnode, transition;
- selector = d3_selection_selectorAll(selector);
- for (var j = -1, m = this.length; ++j < m; ) {
- for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) {
- transition = node[ns][id];
- subnodes = selector.call(node, node.__data__, i, j);
- subgroups.push(subgroup = []);
- for (var k = -1, o = subnodes.length; ++k < o; ) {
- if (subnode = subnodes[k]) d3_transitionNode(subnode, k, ns, id, transition);
- subgroup.push(subnode);
- }
- }
- }
- }
- return d3_transition(subgroups, ns, id);
- };
- d3_transitionPrototype.filter = function(filter) {
- var subgroups = [], subgroup, group, node;
- if (typeof filter !== "function") filter = d3_selection_filter(filter);
- for (var j = 0, m = this.length; j < m; j++) {
- subgroups.push(subgroup = []);
- for (var group = this[j], i = 0, n = group.length; i < n; i++) {
- if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {
- subgroup.push(node);
- }
- }
- }
- return d3_transition(subgroups, this.namespace, this.id);
- };
- d3_transitionPrototype.tween = function(name, tween) {
- var id = this.id, ns = this.namespace;
- if (arguments.length < 2) return this.node()[ns][id].tween.get(name);
- return d3_selection_each(this, tween == null ? function(node) {
- node[ns][id].tween.remove(name);
- } : function(node) {
- node[ns][id].tween.set(name, tween);
- });
- };
- function d3_transition_tween(groups, name, value, tween) {
- var id = groups.id, ns = groups.namespace;
- return d3_selection_each(groups, typeof value === "function" ? function(node, i, j) {
- node[ns][id].tween.set(name, tween(value.call(node, node.__data__, i, j)));
- } : (value = tween(value), function(node) {
- node[ns][id].tween.set(name, value);
- }));
- }
- d3_transitionPrototype.attr = function(nameNS, value) {
- if (arguments.length < 2) {
- for (value in nameNS) this.attr(value, nameNS[value]);
- return this;
- }
- var interpolate = nameNS == "transform" ? d3_interpolateTransform : d3_interpolate, name = d3.ns.qualify(nameNS);
- function attrNull() {
- this.removeAttribute(name);
- }
- function attrNullNS() {
- this.removeAttributeNS(name.space, name.local);
- }
- function attrTween(b) {
- return b == null ? attrNull : (b += "", function() {
- var a = this.getAttribute(name), i;
- return a !== b && (i = interpolate(a, b), function(t) {
- this.setAttribute(name, i(t));
- });
- });
- }
- function attrTweenNS(b) {
- return b == null ? attrNullNS : (b += "", function() {
- var a = this.getAttributeNS(name.space, name.local), i;
- return a !== b && (i = interpolate(a, b), function(t) {
- this.setAttributeNS(name.space, name.local, i(t));
- });
- });
- }
- return d3_transition_tween(this, "attr." + nameNS, value, name.local ? attrTweenNS : attrTween);
- };
- d3_transitionPrototype.attrTween = function(nameNS, tween) {
- var name = d3.ns.qualify(nameNS);
- function attrTween(d, i) {
- var f = tween.call(this, d, i, this.getAttribute(name));
- return f && function(t) {
- this.setAttribute(name, f(t));
- };
- }
- function attrTweenNS(d, i) {
- var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local));
- return f && function(t) {
- this.setAttributeNS(name.space, name.local, f(t));
- };
- }
- return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween);
- };
- d3_transitionPrototype.style = function(name, value, priority) {
- var n = arguments.length;
- if (n < 3) {
- if (typeof name !== "string") {
- if (n < 2) value = "";
- for (priority in name) this.style(priority, name[priority], value);
- return this;
- }
- priority = "";
- }
- function styleNull() {
- this.style.removeProperty(name);
- }
- function styleString(b) {
- return b == null ? styleNull : (b += "", function() {
- var a = d3_window(this).getComputedStyle(this, null).getPropertyValue(name), i;
- return a !== b && (i = d3_interpolate(a, b), function(t) {
- this.style.setProperty(name, i(t), priority);
- });
- });
- }
- return d3_transition_tween(this, "style." + name, value, styleString);
- };
- d3_transitionPrototype.styleTween = function(name, tween, priority) {
- if (arguments.length < 3) priority = "";
- function styleTween(d, i) {
- var f = tween.call(this, d, i, d3_window(this).getComputedStyle(this, null).getPropertyValue(name));
- return f && function(t) {
- this.style.setProperty(name, f(t), priority);
- };
- }
- return this.tween("style." + name, styleTween);
- };
- d3_transitionPrototype.text = function(value) {
- return d3_transition_tween(this, "text", value, d3_transition_text);
- };
- function d3_transition_text(b) {
- if (b == null) b = "";
- return function() {
- this.textContent = b;
- };
- }
- d3_transitionPrototype.remove = function() {
- var ns = this.namespace;
- return this.each("end.transition", function() {
- var p;
- if (this[ns].count < 2 && (p = this.parentNode)) p.removeChild(this);
- });
- };
- d3_transitionPrototype.ease = function(value) {
- var id = this.id, ns = this.namespace;
- if (arguments.length < 1) return this.node()[ns][id].ease;
- if (typeof value !== "function") value = d3.ease.apply(d3, arguments);
- return d3_selection_each(this, function(node) {
- node[ns][id].ease = value;
- });
- };
- d3_transitionPrototype.delay = function(value) {
- var id = this.id, ns = this.namespace;
- if (arguments.length < 1) return this.node()[ns][id].delay;
- return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
- node[ns][id].delay = +value.call(node, node.__data__, i, j);
- } : (value = +value, function(node) {
- node[ns][id].delay = value;
- }));
- };
- d3_transitionPrototype.duration = function(value) {
- var id = this.id, ns = this.namespace;
- if (arguments.length < 1) return this.node()[ns][id].duration;
- return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
- node[ns][id].duration = Math.max(1, value.call(node, node.__data__, i, j));
- } : (value = Math.max(1, value), function(node) {
- node[ns][id].duration = value;
- }));
- };
- d3_transitionPrototype.each = function(type, listener) {
- var id = this.id, ns = this.namespace;
- if (arguments.length < 2) {
- var inherit = d3_transitionInherit, inheritId = d3_transitionInheritId;
- try {
- d3_transitionInheritId = id;
- d3_selection_each(this, function(node, i, j) {
- d3_transitionInherit = node[ns][id];
- type.call(node, node.__data__, i, j);
- });
- } finally {
- d3_transitionInherit = inherit;
- d3_transitionInheritId = inheritId;
- }
- } else {
- d3_selection_each(this, function(node) {
- var transition = node[ns][id];
- (transition.event || (transition.event = d3.dispatch("start", "end", "interrupt"))).on(type, listener);
- });
- }
- return this;
- };
- d3_transitionPrototype.transition = function() {
- var id0 = this.id, id1 = ++d3_transitionId, ns = this.namespace, subgroups = [], subgroup, group, node, transition;
- for (var j = 0, m = this.length; j < m; j++) {
- subgroups.push(subgroup = []);
- for (var group = this[j], i = 0, n = group.length; i < n; i++) {
- if (node = group[i]) {
- transition = node[ns][id0];
- d3_transitionNode(node, i, ns, id1, {
- time: transition.time,
- ease: transition.ease,
- delay: transition.delay + transition.duration,
- duration: transition.duration
- });
- }
- subgroup.push(node);
- }
- }
- return d3_transition(subgroups, ns, id1);
- };
- function d3_transitionNamespace(name) {
- return name == null ? "__transition__" : "__transition_" + name + "__";
- }
- function d3_transitionNode(node, i, ns, id, inherit) {
- var lock = node[ns] || (node[ns] = {
- active: 0,
- count: 0
- }), transition = lock[id], time, timer, duration, ease, tweens;
- function schedule(elapsed) {
- var delay = transition.delay;
- timer.t = delay + time;
- if (delay <= elapsed) return start(elapsed - delay);
- timer.c = start;
- }
- function start(elapsed) {
- var activeId = lock.active, active = lock[activeId];
- if (active) {
- active.timer.c = null;
- active.timer.t = NaN;
- --lock.count;
- delete lock[activeId];
- active.event && active.event.interrupt.call(node, node.__data__, active.index);
- }
- for (var cancelId in lock) {
- if (+cancelId < id) {
- var cancel = lock[cancelId];
- cancel.timer.c = null;
- cancel.timer.t = NaN;
- --lock.count;
- delete lock[cancelId];
- }
- }
- timer.c = tick;
- d3_timer(function() {
- if (timer.c && tick(elapsed || 1)) {
- timer.c = null;
- timer.t = NaN;
- }
- return 1;
- }, 0, time);
- lock.active = id;
- transition.event && transition.event.start.call(node, node.__data__, i);
- tweens = [];
- transition.tween.forEach(function(key, value) {
- if (value = value.call(node, node.__data__, i)) {
- tweens.push(value);
- }
- });
- ease = transition.ease;
- duration = transition.duration;
- }
- function tick(elapsed) {
- var t = elapsed / duration, e = ease(t), n = tweens.length;
- while (n > 0) {
- tweens[--n].call(node, e);
- }
- if (t >= 1) {
- transition.event && transition.event.end.call(node, node.__data__, i);
- if (--lock.count) delete lock[id]; else delete node[ns];
- return 1;
- }
- }
- if (!transition) {
- time = inherit.time;
- timer = d3_timer(schedule, 0, time);
- transition = lock[id] = {
- tween: new d3_Map(),
- time: time,
- timer: timer,
- delay: inherit.delay,
- duration: inherit.duration,
- ease: inherit.ease,
- index: i
- };
- inherit = null;
- ++lock.count;
- }
- }
- d3.svg.axis = function() {
- var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_;
- function axis(g) {
- g.each(function() {
- var g = d3.select(this);
- var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy();
- var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick.order()).style("opacity", 1), tickSpacing = Math.max(innerTickSize, 0) + tickPadding, tickTransform;
- var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"),
- d3.transition(path));
- tickEnter.append("line");
- tickEnter.append("text");
- var lineEnter = tickEnter.select("line"), lineUpdate = tickUpdate.select("line"), text = tick.select("text").text(tickFormat), textEnter = tickEnter.select("text"), textUpdate = tickUpdate.select("text"), sign = orient === "top" || orient === "left" ? -1 : 1, x1, x2, y1, y2;
- if (orient === "bottom" || orient === "top") {
- tickTransform = d3_svg_axisX, x1 = "x", y1 = "y", x2 = "x2", y2 = "y2";
- text.attr("dy", sign < 0 ? "0em" : ".71em").style("text-anchor", "middle");
- pathUpdate.attr("d", "M" + range[0] + "," + sign * outerTickSize + "V0H" + range[1] + "V" + sign * outerTickSize);
- } else {
- tickTransform = d3_svg_axisY, x1 = "y", y1 = "x", x2 = "y2", y2 = "x2";
- text.attr("dy", ".32em").style("text-anchor", sign < 0 ? "end" : "start");
- pathUpdate.attr("d", "M" + sign * outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + sign * outerTickSize);
- }
- lineEnter.attr(y2, sign * innerTickSize);
- textEnter.attr(y1, sign * tickSpacing);
- lineUpdate.attr(x2, 0).attr(y2, sign * innerTickSize);
- textUpdate.attr(x1, 0).attr(y1, sign * tickSpacing);
- if (scale1.rangeBand) {
- var x = scale1, dx = x.rangeBand() / 2;
- scale0 = scale1 = function(d) {
- return x(d) + dx;
- };
- } else if (scale0.rangeBand) {
- scale0 = scale1;
- } else {
- tickExit.call(tickTransform, scale1, scale0);
- }
- tickEnter.call(tickTransform, scale0, scale1);
- tickUpdate.call(tickTransform, scale1, scale1);
- });
- }
- axis.scale = function(x) {
- if (!arguments.length) return scale;
- scale = x;
- return axis;
- };
- axis.orient = function(x) {
- if (!arguments.length) return orient;
- orient = x in d3_svg_axisOrients ? x + "" : d3_svg_axisDefaultOrient;
- return axis;
- };
- axis.ticks = function() {
- if (!arguments.length) return tickArguments_;
- tickArguments_ = d3_array(arguments);
- return axis;
- };
- axis.tickValues = function(x) {
- if (!arguments.length) return tickValues;
- tickValues = x;
- return axis;
- };
- axis.tickFormat = function(x) {
- if (!arguments.length) return tickFormat_;
- tickFormat_ = x;
- return axis;
- };
- axis.tickSize = function(x) {
- var n = arguments.length;
- if (!n) return innerTickSize;
- innerTickSize = +x;
- outerTickSize = +arguments[n - 1];
- return axis;
- };
- axis.innerTickSize = function(x) {
- if (!arguments.length) return innerTickSize;
- innerTickSize = +x;
- return axis;
- };
- axis.outerTickSize = function(x) {
- if (!arguments.length) return outerTickSize;
- outerTickSize = +x;
- return axis;
- };
- axis.tickPadding = function(x) {
- if (!arguments.length) return tickPadding;
- tickPadding = +x;
- return axis;
- };
- axis.tickSubdivide = function() {
- return arguments.length && axis;
- };
- return axis;
- };
- var d3_svg_axisDefaultOrient = "bottom", d3_svg_axisOrients = {
- top: 1,
- right: 1,
- bottom: 1,
- left: 1
- };
- function d3_svg_axisX(selection, x0, x1) {
- selection.attr("transform", function(d) {
- var v0 = x0(d);
- return "translate(" + (isFinite(v0) ? v0 : x1(d)) + ",0)";
- });
- }
- function d3_svg_axisY(selection, y0, y1) {
- selection.attr("transform", function(d) {
- var v0 = y0(d);
- return "translate(0," + (isFinite(v0) ? v0 : y1(d)) + ")";
- });
- }
- d3.svg.brush = function() {
- var event = d3_eventDispatch(brush, "brushstart", "brush", "brushend"), x = null, y = null, xExtent = [ 0, 0 ], yExtent = [ 0, 0 ], xExtentDomain, yExtentDomain, xClamp = true, yClamp = true, resizes = d3_svg_brushResizes[0];
- function brush(g) {
- g.each(function() {
- var g = d3.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", brushstart).on("touchstart.brush", brushstart);
- var background = g.selectAll(".background").data([ 0 ]);
- background.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair");
- g.selectAll(".extent").data([ 0 ]).enter().append("rect").attr("class", "extent").style("cursor", "move");
- var resize = g.selectAll(".resize").data(resizes, d3_identity);
- resize.exit().remove();
- resize.enter().append("g").attr("class", function(d) {
- return "resize " + d;
- }).style("cursor", function(d) {
- return d3_svg_brushCursor[d];
- }).append("rect").attr("x", function(d) {
- return /[ew]$/.test(d) ? -3 : null;
- }).attr("y", function(d) {
- return /^[ns]/.test(d) ? -3 : null;
- }).attr("width", 6).attr("height", 6).style("visibility", "hidden");
- resize.style("display", brush.empty() ? "none" : null);
- var gUpdate = d3.transition(g), backgroundUpdate = d3.transition(background), range;
- if (x) {
- range = d3_scaleRange(x);
- backgroundUpdate.attr("x", range[0]).attr("width", range[1] - range[0]);
- redrawX(gUpdate);
- }
- if (y) {
- range = d3_scaleRange(y);
- backgroundUpdate.attr("y", range[0]).attr("height", range[1] - range[0]);
- redrawY(gUpdate);
- }
- redraw(gUpdate);
- });
- }
- brush.event = function(g) {
- g.each(function() {
- var event_ = event.of(this, arguments), extent1 = {
- x: xExtent,
- y: yExtent,
- i: xExtentDomain,
- j: yExtentDomain
- }, extent0 = this.__chart__ || extent1;
- this.__chart__ = extent1;
- if (d3_transitionInheritId) {
- d3.select(this).transition().each("start.brush", function() {
- xExtentDomain = extent0.i;
- yExtentDomain = extent0.j;
- xExtent = extent0.x;
- yExtent = extent0.y;
- event_({
- type: "brushstart"
- });
- }).tween("brush:brush", function() {
- var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y);
- xExtentDomain = yExtentDomain = null;
- return function(t) {
- xExtent = extent1.x = xi(t);
- yExtent = extent1.y = yi(t);
- event_({
- type: "brush",
- mode: "resize"
- });
- };
- }).each("end.brush", function() {
- xExtentDomain = extent1.i;
- yExtentDomain = extent1.j;
- event_({
- type: "brush",
- mode: "resize"
- });
- event_({
- type: "brushend"
- });
- });
- } else {
- event_({
- type: "brushstart"
- });
- event_({
- type: "brush",
- mode: "resize"
- });
- event_({
- type: "brushend"
- });
- }
- });
- };
- function redraw(g) {
- g.selectAll(".resize").attr("transform", function(d) {
- return "translate(" + xExtent[+/e$/.test(d)] + "," + yExtent[+/^s/.test(d)] + ")";
- });
- }
- function redrawX(g) {
- g.select(".extent").attr("x", xExtent[0]);
- g.selectAll(".extent,.n>rect,.s>rect").attr("width", xExtent[1] - xExtent[0]);
- }
- function redrawY(g) {
- g.select(".extent").attr("y", yExtent[0]);
- g.selectAll(".extent,.e>rect,.w>rect").attr("height", yExtent[1] - yExtent[0]);
- }
- function brushstart() {
- var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(target), center, origin = d3.mouse(target), offset;
- var w = d3.select(d3_window(target)).on("keydown.brush", keydown).on("keyup.brush", keyup);
- if (d3.event.changedTouches) {
- w.on("touchmove.brush", brushmove).on("touchend.brush", brushend);
- } else {
- w.on("mousemove.brush", brushmove).on("mouseup.brush", brushend);
- }
- g.interrupt().selectAll("*").interrupt();
- if (dragging) {
- origin[0] = xExtent[0] - origin[0];
- origin[1] = yExtent[0] - origin[1];
- } else if (resizing) {
- var ex = +/w$/.test(resizing), ey = +/^n/.test(resizing);
- offset = [ xExtent[1 - ex] - origin[0], yExtent[1 - ey] - origin[1] ];
- origin[0] = xExtent[ex];
- origin[1] = yExtent[ey];
- } else if (d3.event.altKey) center = origin.slice();
- g.style("pointer-events", "none").selectAll(".resize").style("display", null);
- d3.select("body").style("cursor", eventTarget.style("cursor"));
- event_({
- type: "brushstart"
- });
- brushmove();
- function keydown() {
- if (d3.event.keyCode == 32) {
- if (!dragging) {
- center = null;
- origin[0] -= xExtent[1];
- origin[1] -= yExtent[1];
- dragging = 2;
- }
- d3_eventPreventDefault();
- }
- }
- function keyup() {
- if (d3.event.keyCode == 32 && dragging == 2) {
- origin[0] += xExtent[1];
- origin[1] += yExtent[1];
- dragging = 0;
- d3_eventPreventDefault();
- }
- }
- function brushmove() {
- var point = d3.mouse(target), moved = false;
- if (offset) {
- point[0] += offset[0];
- point[1] += offset[1];
- }
- if (!dragging) {
- if (d3.event.altKey) {
- if (!center) center = [ (xExtent[0] + xExtent[1]) / 2, (yExtent[0] + yExtent[1]) / 2 ];
- origin[0] = xExtent[+(point[0] < center[0])];
- origin[1] = yExtent[+(point[1] < center[1])];
- } else center = null;
- }
- if (resizingX && move1(point, x, 0)) {
- redrawX(g);
- moved = true;
- }
- if (resizingY && move1(point, y, 1)) {
- redrawY(g);
- moved = true;
- }
- if (moved) {
- redraw(g);
- event_({
- type: "brush",
- mode: dragging ? "move" : "resize"
- });
- }
- }
- function move1(point, scale, i) {
- var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], extent = i ? yExtent : xExtent, size = extent[1] - extent[0], min, max;
- if (dragging) {
- r0 -= position;
- r1 -= size + position;
- }
- min = (i ? yClamp : xClamp) ? Math.max(r0, Math.min(r1, point[i])) : point[i];
- if (dragging) {
- max = (min += position) + size;
- } else {
- if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min));
- if (position < min) {
- max = min;
- min = position;
- } else {
- max = position;
- }
- }
- if (extent[0] != min || extent[1] != max) {
- if (i) yExtentDomain = null; else xExtentDomain = null;
- extent[0] = min;
- extent[1] = max;
- return true;
- }
- }
- function brushend() {
- brushmove();
- g.style("pointer-events", "all").selectAll(".resize").style("display", brush.empty() ? "none" : null);
- d3.select("body").style("cursor", null);
- w.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null);
- dragRestore();
- event_({
- type: "brushend"
- });
- }
- }
- brush.x = function(z) {
- if (!arguments.length) return x;
- x = z;
- resizes = d3_svg_brushResizes[!x << 1 | !y];
- return brush;
- };
- brush.y = function(z) {
- if (!arguments.length) return y;
- y = z;
- resizes = d3_svg_brushResizes[!x << 1 | !y];
- return brush;
- };
- brush.clamp = function(z) {
- if (!arguments.length) return x && y ? [ xClamp, yClamp ] : x ? xClamp : y ? yClamp : null;
- if (x && y) xClamp = !!z[0], yClamp = !!z[1]; else if (x) xClamp = !!z; else if (y) yClamp = !!z;
- return brush;
- };
- brush.extent = function(z) {
- var x0, x1, y0, y1, t;
- if (!arguments.length) {
- if (x) {
- if (xExtentDomain) {
- x0 = xExtentDomain[0], x1 = xExtentDomain[1];
- } else {
- x0 = xExtent[0], x1 = xExtent[1];
- if (x.invert) x0 = x.invert(x0), x1 = x.invert(x1);
- if (x1 < x0) t = x0, x0 = x1, x1 = t;
- }
- }
- if (y) {
- if (yExtentDomain) {
- y0 = yExtentDomain[0], y1 = yExtentDomain[1];
- } else {
- y0 = yExtent[0], y1 = yExtent[1];
- if (y.invert) y0 = y.invert(y0), y1 = y.invert(y1);
- if (y1 < y0) t = y0, y0 = y1, y1 = t;
- }
- }
- return x && y ? [ [ x0, y0 ], [ x1, y1 ] ] : x ? [ x0, x1 ] : y && [ y0, y1 ];
- }
- if (x) {
- x0 = z[0], x1 = z[1];
- if (y) x0 = x0[0], x1 = x1[0];
- xExtentDomain = [ x0, x1 ];
- if (x.invert) x0 = x(x0), x1 = x(x1);
- if (x1 < x0) t = x0, x0 = x1, x1 = t;
- if (x0 != xExtent[0] || x1 != xExtent[1]) xExtent = [ x0, x1 ];
- }
- if (y) {
- y0 = z[0], y1 = z[1];
- if (x) y0 = y0[1], y1 = y1[1];
- yExtentDomain = [ y0, y1 ];
- if (y.invert) y0 = y(y0), y1 = y(y1);
- if (y1 < y0) t = y0, y0 = y1, y1 = t;
- if (y0 != yExtent[0] || y1 != yExtent[1]) yExtent = [ y0, y1 ];
- }
- return brush;
- };
- brush.clear = function() {
- if (!brush.empty()) {
- xExtent = [ 0, 0 ], yExtent = [ 0, 0 ];
- xExtentDomain = yExtentDomain = null;
- }
- return brush;
- };
- brush.empty = function() {
- return !!x && xExtent[0] == xExtent[1] || !!y && yExtent[0] == yExtent[1];
- };
- return d3.rebind(brush, event, "on");
- };
- var d3_svg_brushCursor = {
- n: "ns-resize",
- e: "ew-resize",
- s: "ns-resize",
- w: "ew-resize",
- nw: "nwse-resize",
- ne: "nesw-resize",
- se: "nwse-resize",
- sw: "nesw-resize"
- };
- var d3_svg_brushResizes = [ [ "n", "e", "s", "w", "nw", "ne", "se", "sw" ], [ "e", "w" ], [ "n", "s" ], [] ];
- var d3_time_format = d3_time.format = d3_locale_enUS.timeFormat;
- var d3_time_formatUtc = d3_time_format.utc;
- var d3_time_formatIso = d3_time_formatUtc("%Y-%m-%dT%H:%M:%S.%LZ");
- d3_time_format.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? d3_time_formatIsoNative : d3_time_formatIso;
- function d3_time_formatIsoNative(date) {
- return date.toISOString();
- }
- d3_time_formatIsoNative.parse = function(string) {
- var date = new Date(string);
- return isNaN(date) ? null : date;
- };
- d3_time_formatIsoNative.toString = d3_time_formatIso.toString;
- d3_time.second = d3_time_interval(function(date) {
- return new d3_date(Math.floor(date / 1e3) * 1e3);
- }, function(date, offset) {
- date.setTime(date.getTime() + Math.floor(offset) * 1e3);
- }, function(date) {
- return date.getSeconds();
- });
- d3_time.seconds = d3_time.second.range;
- d3_time.seconds.utc = d3_time.second.utc.range;
- d3_time.minute = d3_time_interval(function(date) {
- return new d3_date(Math.floor(date / 6e4) * 6e4);
- }, function(date, offset) {
- date.setTime(date.getTime() + Math.floor(offset) * 6e4);
- }, function(date) {
- return date.getMinutes();
- });
- d3_time.minutes = d3_time.minute.range;
- d3_time.minutes.utc = d3_time.minute.utc.range;
- d3_time.hour = d3_time_interval(function(date) {
- var timezone = date.getTimezoneOffset() / 60;
- return new d3_date((Math.floor(date / 36e5 - timezone) + timezone) * 36e5);
- }, function(date, offset) {
- date.setTime(date.getTime() + Math.floor(offset) * 36e5);
- }, function(date) {
- return date.getHours();
- });
- d3_time.hours = d3_time.hour.range;
- d3_time.hours.utc = d3_time.hour.utc.range;
- d3_time.month = d3_time_interval(function(date) {
- date = d3_time.day(date);
- date.setDate(1);
- return date;
- }, function(date, offset) {
- date.setMonth(date.getMonth() + offset);
- }, function(date) {
- return date.getMonth();
- });
- d3_time.months = d3_time.month.range;
- d3_time.months.utc = d3_time.month.utc.range;
- function d3_time_scale(linear, methods, format) {
- function scale(x) {
- return linear(x);
- }
- scale.invert = function(x) {
- return d3_time_scaleDate(linear.invert(x));
- };
- scale.domain = function(x) {
- if (!arguments.length) return linear.domain().map(d3_time_scaleDate);
- linear.domain(x);
- return scale;
- };
- function tickMethod(extent, count) {
- var span = extent[1] - extent[0], target = span / count, i = d3.bisect(d3_time_scaleSteps, target);
- return i == d3_time_scaleSteps.length ? [ methods.year, d3_scale_linearTickRange(extent.map(function(d) {
- return d / 31536e6;
- }), count)[2] ] : !i ? [ d3_time_scaleMilliseconds, d3_scale_linearTickRange(extent, count)[2] ] : methods[target / d3_time_scaleSteps[i - 1] < d3_time_scaleSteps[i] / target ? i - 1 : i];
- }
- scale.nice = function(interval, skip) {
- var domain = scale.domain(), extent = d3_scaleExtent(domain), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" && tickMethod(extent, interval);
- if (method) interval = method[0], skip = method[1];
- function skipped(date) {
- return !isNaN(date) && !interval.range(date, d3_time_scaleDate(+date + 1), skip).length;
- }
- return scale.domain(d3_scale_nice(domain, skip > 1 ? {
- floor: function(date) {
- while (skipped(date = interval.floor(date))) date = d3_time_scaleDate(date - 1);
- return date;
- },
- ceil: function(date) {
- while (skipped(date = interval.ceil(date))) date = d3_time_scaleDate(+date + 1);
- return date;
- }
- } : interval));
- };
- scale.ticks = function(interval, skip) {
- var extent = d3_scaleExtent(scale.domain()), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" ? tickMethod(extent, interval) : !interval.range && [ {
- range: interval
- }, skip ];
- if (method) interval = method[0], skip = method[1];
- return interval.range(extent[0], d3_time_scaleDate(+extent[1] + 1), skip < 1 ? 1 : skip);
- };
- scale.tickFormat = function() {
- return format;
- };
- scale.copy = function() {
- return d3_time_scale(linear.copy(), methods, format);
- };
- return d3_scale_linearRebind(scale, linear);
- }
- function d3_time_scaleDate(t) {
- return new Date(t);
- }
- var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ];
- var d3_time_scaleLocalMethods = [ [ d3_time.second, 1 ], [ d3_time.second, 5 ], [ d3_time.second, 15 ], [ d3_time.second, 30 ], [ d3_time.minute, 1 ], [ d3_time.minute, 5 ], [ d3_time.minute, 15 ], [ d3_time.minute, 30 ], [ d3_time.hour, 1 ], [ d3_time.hour, 3 ], [ d3_time.hour, 6 ], [ d3_time.hour, 12 ], [ d3_time.day, 1 ], [ d3_time.day, 2 ], [ d3_time.week, 1 ], [ d3_time.month, 1 ], [ d3_time.month, 3 ], [ d3_time.year, 1 ] ];
- var d3_time_scaleLocalFormat = d3_time_format.multi([ [ ".%L", function(d) {
- return d.getMilliseconds();
- } ], [ ":%S", function(d) {
- return d.getSeconds();
- } ], [ "%I:%M", function(d) {
- return d.getMinutes();
- } ], [ "%I %p", function(d) {
- return d.getHours();
- } ], [ "%a %d", function(d) {
- return d.getDay() && d.getDate() != 1;
- } ], [ "%b %d", function(d) {
- return d.getDate() != 1;
- } ], [ "%B", function(d) {
- return d.getMonth();
- } ], [ "%Y", d3_true ] ]);
- var d3_time_scaleMilliseconds = {
- range: function(start, stop, step) {
- return d3.range(Math.ceil(start / step) * step, +stop, step).map(d3_time_scaleDate);
- },
- floor: d3_identity,
- ceil: d3_identity
- };
- d3_time_scaleLocalMethods.year = d3_time.year;
- d3_time.scale = function() {
- return d3_time_scale(d3.scale.linear(), d3_time_scaleLocalMethods, d3_time_scaleLocalFormat);
- };
- var d3_time_scaleUtcMethods = d3_time_scaleLocalMethods.map(function(m) {
- return [ m[0].utc, m[1] ];
- });
- var d3_time_scaleUtcFormat = d3_time_formatUtc.multi([ [ ".%L", function(d) {
- return d.getUTCMilliseconds();
- } ], [ ":%S", function(d) {
- return d.getUTCSeconds();
- } ], [ "%I:%M", function(d) {
- return d.getUTCMinutes();
- } ], [ "%I %p", function(d) {
- return d.getUTCHours();
- } ], [ "%a %d", function(d) {
- return d.getUTCDay() && d.getUTCDate() != 1;
- } ], [ "%b %d", function(d) {
- return d.getUTCDate() != 1;
- } ], [ "%B", function(d) {
- return d.getUTCMonth();
- } ], [ "%Y", d3_true ] ]);
- d3_time_scaleUtcMethods.year = d3_time.year.utc;
- d3_time.scale.utc = function() {
- return d3_time_scale(d3.scale.linear(), d3_time_scaleUtcMethods, d3_time_scaleUtcFormat);
- };
- d3.text = d3_xhrType(function(request) {
- return request.responseText;
- });
- d3.json = function(url, callback) {
- return d3_xhr(url, "application/json", d3_json, callback);
- };
- function d3_json(request) {
- return JSON.parse(request.responseText);
- }
- d3.html = function(url, callback) {
- return d3_xhr(url, "text/html", d3_html, callback);
- };
- function d3_html(request) {
- var range = d3_document.createRange();
- range.selectNode(d3_document.body);
- return range.createContextualFragment(request.responseText);
- }
- d3.xml = d3_xhrType(function(request) {
- return request.responseXML;
- });
- if (typeof define === "function" && define.amd) this.d3 = d3, define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; else this.d3 = d3;
-}();
-},{}],9:[function(require,module,exports){
-/**
- * @license
- * Copyright (c) 2012-2013 Chris Pettitt
- *
- * 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.
- */
-module.exports = {
- graphlib: require("./lib/graphlib"),
- dagre: require("./lib/dagre"),
- intersect: require("./lib/intersect"),
- render: require("./lib/render"),
- util: require("./lib/util"),
- version: require("./lib/version")
-};
-
-},{"./lib/dagre":16,"./lib/graphlib":17,"./lib/intersect":18,"./lib/render":33,"./lib/util":35,"./lib/version":36}],10:[function(require,module,exports){
-var util = require("./util");
-
-module.exports = {
- "default": normal,
- "normal": normal,
- "vee": vee,
- "undirected": undirected
-};
-
-function normal(parent, id, edge, type) {
- var marker = parent.append("marker")
- .attr("id", id)
- .attr("viewBox", "0 0 10 10")
- .attr("refX", 9)
- .attr("refY", 5)
- .attr("markerUnits", "strokeWidth")
- .attr("markerWidth", 8)
- .attr("markerHeight", 6)
- .attr("orient", "auto");
-
- var path = marker.append("path")
- .attr("d", "M 0 0 L 10 5 L 0 10 z")
- .style("stroke-width", 1)
- .style("stroke-dasharray", "1,0");
- util.applyStyle(path, edge[type + "Style"]);
- if (edge[type + "Class"]) {
- path.attr("class", edge[type + "Class"]);
- }
-}
-
-function vee(parent, id, edge, type) {
- var marker = parent.append("marker")
- .attr("id", id)
- .attr("viewBox", "0 0 10 10")
- .attr("refX", 9)
- .attr("refY", 5)
- .attr("markerUnits", "strokeWidth")
- .attr("markerWidth", 8)
- .attr("markerHeight", 6)
- .attr("orient", "auto");
-
- var path = marker.append("path")
- .attr("d", "M 0 0 L 10 5 L 0 10 L 4 5 z")
- .style("stroke-width", 1)
- .style("stroke-dasharray", "1,0");
- util.applyStyle(path, edge[type + "Style"]);
- if (edge[type + "Class"]) {
- path.attr("class", edge[type + "Class"]);
- }
-}
-
-function undirected(parent, id, edge, type) {
- var marker = parent.append("marker")
- .attr("id", id)
- .attr("viewBox", "0 0 10 10")
- .attr("refX", 9)
- .attr("refY", 5)
- .attr("markerUnits", "strokeWidth")
- .attr("markerWidth", 8)
- .attr("markerHeight", 6)
- .attr("orient", "auto");
-
- var path = marker.append("path")
- .attr("d", "M 0 5 L 10 5")
- .style("stroke-width", 1)
- .style("stroke-dasharray", "1,0");
- util.applyStyle(path, edge[type + "Style"]);
- if (edge[type + "Class"]) {
- path.attr("class", edge[type + "Class"]);
- }
-}
-
-},{"./util":35}],11:[function(require,module,exports){
-var util = require("./util"),
- addLabel = require("./label/add-label");
-
-module.exports = createClusters;
-
-function createClusters(selection, g) {
- var clusters = g.nodes().filter(function(v) { return util.isSubgraph(g, v); }),
- svgClusters = selection.selectAll("g.cluster")
- .data(clusters, function(v) { return v; });
-
- svgClusters.selectAll("*").remove();
- svgClusters.enter()
- .append("g")
- .attr("class", "cluster")
- .attr("id",function(v){
- var node = g.node(v);
- return node.id;
- })
- .style("opacity", 0);
-
- util.applyTransition(svgClusters, g)
- .style("opacity", 1);
-
- svgClusters.each(function(v) {
- var node = g.node(v),
- thisGroup = d3.select(this);
- d3.select(this).append("rect");
- var labelGroup = thisGroup.append("g").attr("class", "label");
- addLabel(labelGroup, node, node.clusterLabelPos);
- });
-
- svgClusters.selectAll("rect").each(function(c) {
- var node = g.node(c);
- var domCluster = d3.select(this);
- util.applyStyle(domCluster, node.style);
- });
-
- util.applyTransition(svgClusters.exit(), g)
- .style("opacity", 0)
- .remove();
-
- return svgClusters;
-}
-
-},{"./label/add-label":26,"./util":35}],12:[function(require,module,exports){
-"use strict";
-
-var _ = require("./lodash"),
- addLabel = require("./label/add-label"),
- util = require("./util"),
- d3 = require("./d3");
-
-module.exports = createEdgeLabels;
-
-function createEdgeLabels(selection, g) {
- var svgEdgeLabels = selection.selectAll("g.edgeLabel")
- .data(g.edges(), function(e) { return util.edgeToId(e); })
- .classed("update", true);
-
- svgEdgeLabels.selectAll("*").remove();
- svgEdgeLabels.enter()
- .append("g")
- .classed("edgeLabel", true)
- .style("opacity", 0);
- svgEdgeLabels.each(function(e) {
- var edge = g.edge(e),
- label = addLabel(d3.select(this), g.edge(e), 0, 0).classed("label", true),
- bbox = label.node().getBBox();
-
- if (edge.labelId) { label.attr("id", edge.labelId); }
- if (!_.has(edge, "width")) { edge.width = bbox.width; }
- if (!_.has(edge, "height")) { edge.height = bbox.height; }
- });
-
- util.applyTransition(svgEdgeLabels.exit(), g)
- .style("opacity", 0)
- .remove();
-
- return svgEdgeLabels;
-}
-
-},{"./d3":15,"./label/add-label":26,"./lodash":29,"./util":35}],13:[function(require,module,exports){
-"use strict";
-
-var _ = require("./lodash"),
- intersectNode = require("./intersect/intersect-node"),
- util = require("./util"),
- d3 = require("./d3");
-module.exports = createEdgePaths;
-
-function createEdgePaths(selection, g, arrows) {
- var svgPaths = selection.selectAll("g.edgePath")
- .data(g.edges(), function(e) { return util.edgeToId(e); })
- .classed("update", true);
-
- enter(svgPaths, g);
- exit(svgPaths, g);
-
- util.applyTransition(svgPaths, g)
- .style("opacity", 1);
-
- // Save DOM element in the path group, and set ID and class
- svgPaths.each(function(e) {
- var domEdge = d3.select(this);
- var edge = g.edge(e);
- edge.elem = this;
-
- if (edge.id) {
- domEdge.attr("id", edge.id);
- }
-
- util.applyClass(domEdge, edge["class"],
- (domEdge.classed("update") ? "update " : "") + "edgePath");
- });
-
- svgPaths.selectAll("path.path")
- .each(function(e) {
- var edge = g.edge(e);
- edge.arrowheadId = _.uniqueId("arrowhead");
-
- var domEdge = d3.select(this)
- .attr("marker-end", function() {
- return "url(" + makeFragmentRef(location.href, edge.arrowheadId) + ")";
- })
- .style("fill", "none");
-
- util.applyTransition(domEdge, g)
- .attr("d", function(e) { return calcPoints(g, e); });
-
- util.applyStyle(domEdge, edge.style);
- });
-
- svgPaths.selectAll("defs *").remove();
- svgPaths.selectAll("defs")
- .each(function(e) {
- var edge = g.edge(e),
- arrowhead = arrows[edge.arrowhead];
- arrowhead(d3.select(this), edge.arrowheadId, edge, "arrowhead");
- });
-
- return svgPaths;
-}
-
-function makeFragmentRef(url, fragmentId) {
- var baseUrl = url.split("#")[0];
- return baseUrl + "#" + fragmentId;
-}
-
-function calcPoints(g, e) {
- var edge = g.edge(e),
- tail = g.node(e.v),
- head = g.node(e.w),
- points = edge.points.slice(1, edge.points.length - 1);
- points.unshift(intersectNode(tail, points[0]));
- points.push(intersectNode(head, points[points.length - 1]));
-
- return createLine(edge, points);
-}
-
-function createLine(edge, points) {
- var line = d3.svg.line()
- .x(function(d) { return d.x; })
- .y(function(d) { return d.y; });
-
- if (_.has(edge, "lineInterpolate")) {
- line.interpolate(edge.lineInterpolate);
- }
-
- if (_.has(edge, "lineTension")) {
- line.tension(Number(edge.lineTension));
- }
-
- return line(points);
-}
-
-function getCoords(elem) {
- var bbox = elem.getBBox(),
- matrix = elem.ownerSVGElement.getScreenCTM()
- .inverse()
- .multiply(elem.getScreenCTM())
- .translate(bbox.width / 2, bbox.height / 2);
- return { x: matrix.e, y: matrix.f };
-}
-
-function enter(svgPaths, g) {
- var svgPathsEnter = svgPaths.enter()
- .append("g")
- .attr("class", "edgePath")
- .style("opacity", 0);
- svgPathsEnter.append("path")
- .attr("class", "path")
- .attr("d", function(e) {
- var edge = g.edge(e),
- sourceElem = g.node(e.v).elem,
- points = _.range(edge.points.length).map(function() { return getCoords(sourceElem); });
- return createLine(edge, points);
- });
- svgPathsEnter.append("defs");
-}
-
-function exit(svgPaths, g) {
- var svgPathExit = svgPaths.exit();
- util.applyTransition(svgPathExit, g)
- .style("opacity", 0)
- .remove();
-
- util.applyTransition(svgPathExit.select("path.path"), g)
- .attr("d", function(e) {
- var source = g.node(e.v);
-
- if (source) {
- var points = _.range(this.getTotalLength()).map(function() { return source; });
- return createLine({}, points);
- } else {
- return d3.select(this).attr("d");
- }
- });
-}
-
-},{"./d3":15,"./intersect/intersect-node":22,"./lodash":29,"./util":35}],14:[function(require,module,exports){
-"use strict";
-
-var _ = require("./lodash"),
- addLabel = require("./label/add-label"),
- util = require("./util"),
- d3 = require("./d3");
-
-module.exports = createNodes;
-
-function createNodes(selection, g, shapes) {
- var simpleNodes = g.nodes().filter(function(v) { return !util.isSubgraph(g, v); });
- var svgNodes = selection.selectAll("g.node")
- .data(simpleNodes, function(v) { return v; })
- .classed("update", true);
-
- svgNodes.selectAll("*").remove();
- svgNodes.enter()
- .append("g")
- .attr("class", "node")
- .style("opacity", 0);
- svgNodes.each(function(v) {
- var node = g.node(v),
- thisGroup = d3.select(this),
- labelGroup = thisGroup.append("g").attr("class", "label"),
- labelDom = addLabel(labelGroup, node),
- shape = shapes[node.shape],
- bbox = _.pick(labelDom.node().getBBox(), "width", "height");
-
- node.elem = this;
-
- if (node.id) { thisGroup.attr("id", node.id); }
- if (node.labelId) { labelGroup.attr("id", node.labelId); }
- util.applyClass(thisGroup, node["class"],
- (thisGroup.classed("update") ? "update " : "") + "node");
-
- if (_.has(node, "width")) { bbox.width = node.width; }
- if (_.has(node, "height")) { bbox.height = node.height; }
-
- bbox.width += node.paddingLeft + node.paddingRight;
- bbox.height += node.paddingTop + node.paddingBottom;
- labelGroup.attr("transform", "translate(" +
- ((node.paddingLeft - node.paddingRight) / 2) + "," +
- ((node.paddingTop - node.paddingBottom) / 2) + ")");
-
- var shapeSvg = shape(d3.select(this), bbox, node);
- util.applyStyle(shapeSvg, node.style);
-
- var shapeBBox = shapeSvg.node().getBBox();
- node.width = shapeBBox.width;
- node.height = shapeBBox.height;
- });
-
- util.applyTransition(svgNodes.exit(), g)
- .style("opacity", 0)
- .remove();
-
- return svgNodes;
-}
-
-},{"./d3":15,"./label/add-label":26,"./lodash":29,"./util":35}],15:[function(require,module,exports){
-// Stub to get D3 either via NPM or from the global object
-// module.exports = window.d3;
-
-const d3 = require('d3')
-
-module.exports = d3
-
-},{"d3":8}],16:[function(require,module,exports){
-/* global window */
-
-// var dagre;
-
-// if (require) {
-// try {
-// dagre = require("dagre");
-// } catch (e) {}
-// }
-
-// if (!dagre) {
-// dagre = window.dagre;
-// }
-
-// module.exports = dagre;
-
-
-const dagre = require('dagre')
-
-module.exports = dagre
-
-},{"dagre":57}],17:[function(require,module,exports){
-/* global window */
-
-// var graphlib;
-
-// if (require) {
-// try {
-// graphlib = require("graphlib");
-// } catch (e) {}
-// }
-
-// if (!graphlib) {
-// graphlib = window.graphlib;
-// }
-
-// module.exports = graphlib;
-
-const graphlib = require('graphlib')
-
-module.exports = graphlib
-},{"graphlib":37}],18:[function(require,module,exports){
-module.exports = {
- node: require("./intersect-node"),
- circle: require("./intersect-circle"),
- ellipse: require("./intersect-ellipse"),
- polygon: require("./intersect-polygon"),
- rect: require("./intersect-rect")
-};
-
-},{"./intersect-circle":19,"./intersect-ellipse":20,"./intersect-node":22,"./intersect-polygon":23,"./intersect-rect":24}],19:[function(require,module,exports){
-var intersectEllipse = require("./intersect-ellipse");
-
-module.exports = intersectCircle;
-
-function intersectCircle(node, rx, point) {
- return intersectEllipse(node, rx, rx, point);
-}
-
-},{"./intersect-ellipse":20}],20:[function(require,module,exports){
-module.exports = intersectEllipse;
-
-function intersectEllipse(node, rx, ry, point) {
- // Formulae from: http://mathworld.wolfram.com/Ellipse-LineIntersection.html
-
- var cx = node.x;
- var cy = node.y;
-
- var px = cx - point.x;
- var py = cy - point.y;
-
- var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px);
-
- var dx = Math.abs(rx * ry * px / det);
- if (point.x < cx) {
- dx = -dx;
- }
- var dy = Math.abs(rx * ry * py / det);
- if (point.y < cy) {
- dy = -dy;
- }
-
- return {x: cx + dx, y: cy + dy};
-}
-
-
-},{}],21:[function(require,module,exports){
-module.exports = intersectLine;
-
-/*
- * Returns the point at which two lines, p and q, intersect or returns
- * undefined if they do not intersect.
- */
-function intersectLine(p1, p2, q1, q2) {
- // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,
- // p7 and p473.
-
- var a1, a2, b1, b2, c1, c2;
- var r1, r2 , r3, r4;
- var denom, offset, num;
- var x, y;
-
- // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +
- // b1 y + c1 = 0.
- a1 = p2.y - p1.y;
- b1 = p1.x - p2.x;
- c1 = (p2.x * p1.y) - (p1.x * p2.y);
-
- // Compute r3 and r4.
- r3 = ((a1 * q1.x) + (b1 * q1.y) + c1);
- r4 = ((a1 * q2.x) + (b1 * q2.y) + c1);
-
- // Check signs of r3 and r4. If both point 3 and point 4 lie on
- // same side of line 1, the line segments do not intersect.
- if ((r3 !== 0) && (r4 !== 0) && sameSign(r3, r4)) {
- return /*DONT_INTERSECT*/;
- }
-
- // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0
- a2 = q2.y - q1.y;
- b2 = q1.x - q2.x;
- c2 = (q2.x * q1.y) - (q1.x * q2.y);
-
- // Compute r1 and r2
- r1 = (a2 * p1.x) + (b2 * p1.y) + c2;
- r2 = (a2 * p2.x) + (b2 * p2.y) + c2;
-
- // Check signs of r1 and r2. If both point 1 and point 2 lie
- // on same side of second line segment, the line segments do
- // not intersect.
- if ((r1 !== 0) && (r2 !== 0) && (sameSign(r1, r2))) {
- return /*DONT_INTERSECT*/;
- }
-
- // Line segments intersect: compute intersection point.
- denom = (a1 * b2) - (a2 * b1);
- if (denom === 0) {
- return /*COLLINEAR*/;
- }
-
- offset = Math.abs(denom / 2);
-
- // The denom/2 is to get rounding instead of truncating. It
- // is added or subtracted to the numerator, depending upon the
- // sign of the numerator.
- num = (b1 * c2) - (b2 * c1);
- x = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom);
-
- num = (a2 * c1) - (a1 * c2);
- y = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom);
-
- return { x: x, y: y };
-}
-
-function sameSign(r1, r2) {
- return r1 * r2 > 0;
-}
-
-},{}],22:[function(require,module,exports){
-module.exports = intersectNode;
-
-function intersectNode(node, point) {
- return node.intersect(point);
-}
-
-},{}],23:[function(require,module,exports){
-var intersectLine = require("./intersect-line");
-
-module.exports = intersectPolygon;
-
-/*
- * Returns the point ({x, y}) at which the point argument intersects with the
- * node argument assuming that it has the shape specified by polygon.
- */
-function intersectPolygon(node, polyPoints, point) {
- var x1 = node.x;
- var y1 = node.y;
-
- var intersections = [];
-
- var minX = Number.POSITIVE_INFINITY,
- minY = Number.POSITIVE_INFINITY;
- polyPoints.forEach(function(entry) {
- minX = Math.min(minX, entry.x);
- minY = Math.min(minY, entry.y);
- });
-
- var left = x1 - node.width / 2 - minX;
- var top = y1 - node.height / 2 - minY;
-
- for (var i = 0; i < polyPoints.length; i++) {
- var p1 = polyPoints[i];
- var p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0];
- var intersect = intersectLine(node, point,
- {x: left + p1.x, y: top + p1.y}, {x: left + p2.x, y: top + p2.y});
- if (intersect) {
- intersections.push(intersect);
- }
- }
-
- if (!intersections.length) {
- console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", node);
- return node;
- }
-
- if (intersections.length > 1) {
- // More intersections, find the one nearest to edge end point
- intersections.sort(function(p, q) {
- var pdx = p.x - point.x,
- pdy = p.y - point.y,
- distp = Math.sqrt(pdx * pdx + pdy * pdy),
-
- qdx = q.x - point.x,
- qdy = q.y - point.y,
- distq = Math.sqrt(qdx * qdx + qdy * qdy);
-
- return (distp < distq) ? -1 : (distp === distq ? 0 : 1);
- });
- }
- return intersections[0];
-}
-
-},{"./intersect-line":21}],24:[function(require,module,exports){
-module.exports = intersectRect;
-
-function intersectRect(node, point) {
- var x = node.x;
- var y = node.y;
-
- // Rectangle intersection algorithm from:
- // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes
- var dx = point.x - x;
- var dy = point.y - y;
- var w = node.width / 2;
- var h = node.height / 2;
-
- var sx, sy;
- if (Math.abs(dy) * w > Math.abs(dx) * h) {
- // Intersection is top or bottom of rect.
- if (dy < 0) {
- h = -h;
- }
- sx = dy === 0 ? 0 : h * dx / dy;
- sy = h;
- } else {
- // Intersection is left or right of rect.
- if (dx < 0) {
- w = -w;
- }
- sx = w;
- sy = dx === 0 ? 0 : w * dy / dx;
- }
-
- return {x: x + sx, y: y + sy};
-}
-
-},{}],25:[function(require,module,exports){
-var util = require("../util");
-
-module.exports = addHtmlLabel;
-
-function addHtmlLabel(root, node) {
- var fo = root
- .append("foreignObject")
- .attr("width", "100000");
-
- var div = fo
- .append("xhtml:div");
- div.attr("xmlns", "http://www.w3.org/1999/xhtml");
-
- var label = node.label;
- switch(typeof label) {
- case "function":
- div.insert(label);
- break;
- case "object":
- // Currently we assume this is a DOM object.
- div.insert(function() { return label; });
- break;
- default: div.html(label);
- }
-
- util.applyStyle(div, node.labelStyle);
- div.style("display", "inline-block");
- // Fix for firefox
- div.style("white-space", "nowrap");
-
- var client = div[0][0].getBoundingClientRect();
- fo
- .attr("width", client.width)
- .attr("height", client.height);
-
- return fo;
-}
-
-},{"../util":35}],26:[function(require,module,exports){
-var addTextLabel = require("./add-text-label"),
- addHtmlLabel = require("./add-html-label"),
- addSVGLabel = require("./add-svg-label");
-
-module.exports = addLabel;
-
-function addLabel(root, node, location) {
- var label = node.label;
- var labelSvg = root.append("g");
-
- // Allow the label to be a string, a function that returns a DOM element, or
- // a DOM element itself.
- if (node.labelType === "svg") {
- addSVGLabel(labelSvg, node);
- } else if (typeof label !== "string" || node.labelType === "html") {
- addHtmlLabel(labelSvg, node);
- } else {
- addTextLabel(labelSvg, node);
- }
-
- var labelBBox = labelSvg.node().getBBox();
- var y;
- switch(location) {
- case "top":
- y = (-node.height / 2);
- break;
- case "bottom":
- y = (node.height / 2) - labelBBox.height;
- break;
- default:
- y = (-labelBBox.height / 2);
- }
- labelSvg.attr("transform",
- "translate(" + (-labelBBox.width / 2) + "," + y + ")");
-
- return labelSvg;
-}
-
-},{"./add-html-label":25,"./add-svg-label":27,"./add-text-label":28}],27:[function(require,module,exports){
-var util = require("../util");
-
-module.exports = addSVGLabel;
-
-function addSVGLabel(root, node) {
- var domNode = root;
-
- domNode.node().appendChild(node.label);
-
- util.applyStyle(domNode, node.labelStyle);
-
- return domNode;
-}
-
-},{"../util":35}],28:[function(require,module,exports){
-var util = require("../util");
-
-module.exports = addTextLabel;
-
-/*
- * Attaches a text label to the specified root. Handles escape sequences.
- */
-function addTextLabel(root, node) {
- var domNode = root.append("text");
-
- var lines = processEscapeSequences(node.label).split("\n");
- for (var i = 0; i < lines.length; i++) {
- domNode
- .append("tspan")
- .attr("xml:space", "preserve")
- .attr("dy", "1em")
- .attr("x", "1")
- .text(lines[i]);
- }
-
- util.applyStyle(domNode, node.labelStyle);
-
- return domNode;
-}
-
-function processEscapeSequences(text) {
- var newText = "",
- escaped = false,
- ch;
- for (var i = 0; i < text.length; ++i) {
- ch = text[i];
- if (escaped) {
- switch(ch) {
- case "n": newText += "\n"; break;
- default: newText += ch;
- }
- escaped = false;
- } else if (ch === "\\") {
- escaped = true;
- } else {
- newText += ch;
- }
- }
- return newText;
-}
-
-},{"../util":35}],29:[function(require,module,exports){
-/* global window */
-
-// var lodash;
-
-// if (require) {
-// try {
-// lodash = require("lodash");
-// } catch (e) {}
-// }
-
-// if (!lodash) {
-// lodash = window._;
-// }
-
-// module.exports = lodash;
-
-const lodash = require('lodash')
-
-module.exports = lodash
-
-},{"lodash":292}],30:[function(require,module,exports){
-"use strict";
-
-var util = require("./util"),
- d3 = require("./d3");
-
-module.exports = positionClusters;
-
-function positionClusters(selection, g) {
- var created = selection.filter(function() { return !d3.select(this).classed("update"); });
-
- function translate(v) {
- var node = g.node(v);
- return "translate(" + node.x + "," + node.y + ")";
- }
-
- created.attr("transform", translate);
-
- util.applyTransition(selection, g)
- .style("opacity", 1)
- .attr("transform", translate);
-
- util.applyTransition(created.selectAll("rect"), g)
- .attr("width", function(v) { return g.node(v).width; })
- .attr("height", function(v) { return g.node(v).height; })
- .attr("x", function(v) {
- var node = g.node(v);
- return -node.width / 2;
- })
- .attr("y", function(v) {
- var node = g.node(v);
- return -node.height / 2;
- });
-
-}
-
-},{"./d3":15,"./util":35}],31:[function(require,module,exports){
-"use strict";
-
-var util = require("./util"),
- d3 = require("./d3"),
- _ = require("./lodash");
-
-module.exports = positionEdgeLabels;
-
-function positionEdgeLabels(selection, g) {
- var created = selection.filter(function() { return !d3.select(this).classed("update"); });
-
- function translate(e) {
- var edge = g.edge(e);
- return _.has(edge, "x") ? "translate(" + edge.x + "," + edge.y + ")" : "";
- }
-
- created.attr("transform", translate);
-
- util.applyTransition(selection, g)
- .style("opacity", 1)
- .attr("transform", translate);
-}
-
-},{"./d3":15,"./lodash":29,"./util":35}],32:[function(require,module,exports){
-"use strict";
-
-var util = require("./util"),
- d3 = require("./d3");
-
-module.exports = positionNodes;
-
-function positionNodes(selection, g) {
- var created = selection.filter(function() { return !d3.select(this).classed("update"); });
-
- function translate(v) {
- var node = g.node(v);
- return "translate(" + node.x + "," + node.y + ")";
- }
-
- created.attr("transform", translate);
-
- util.applyTransition(selection, g)
- .style("opacity", 1)
- .attr("transform", translate);
-}
-
-},{"./d3":15,"./util":35}],33:[function(require,module,exports){
-var _ = require("./lodash"),
- layout = require("./dagre").layout;
-
-module.exports = render;
-
-// This design is based on http://bost.ocks.org/mike/chart/.
-function render() {
- var createNodes = require("./create-nodes"),
- createClusters = require("./create-clusters"),
- createEdgeLabels = require("./create-edge-labels"),
- createEdgePaths = require("./create-edge-paths"),
- positionNodes = require("./position-nodes"),
- positionEdgeLabels = require("./position-edge-labels"),
- positionClusters = require("./position-clusters"),
- shapes = require("./shapes"),
- arrows = require("./arrows");
-
- var fn = function(svg, g) {
- preProcessGraph(g);
-
- var outputGroup = createOrSelectGroup(svg, "output"),
- clustersGroup = createOrSelectGroup(outputGroup, "clusters"),
- edgePathsGroup = createOrSelectGroup(outputGroup, "edgePaths"),
- edgeLabels = createEdgeLabels(createOrSelectGroup(outputGroup, "edgeLabels"), g),
- nodes = createNodes(createOrSelectGroup(outputGroup, "nodes"), g, shapes);
-
- layout(g);
-
- positionNodes(nodes, g);
- positionEdgeLabels(edgeLabels, g);
- createEdgePaths(edgePathsGroup, g, arrows);
-
- var clusters = createClusters(clustersGroup, g);
- positionClusters(clusters, g);
-
- postProcessGraph(g);
- };
-
- fn.createNodes = function(value) {
- if (!arguments.length) return createNodes;
- createNodes = value;
- return fn;
- };
-
- fn.createClusters = function(value) {
- if (!arguments.length) return createClusters;
- createClusters = value;
- return fn;
- };
-
- fn.createEdgeLabels = function(value) {
- if (!arguments.length) return createEdgeLabels;
- createEdgeLabels = value;
- return fn;
- };
-
- fn.createEdgePaths = function(value) {
- if (!arguments.length) return createEdgePaths;
- createEdgePaths = value;
- return fn;
- };
-
- fn.shapes = function(value) {
- if (!arguments.length) return shapes;
- shapes = value;
- return fn;
- };
-
- fn.arrows = function(value) {
- if (!arguments.length) return arrows;
- arrows = value;
- return fn;
- };
-
- return fn;
-}
-
-var NODE_DEFAULT_ATTRS = {
- paddingLeft: 10,
- paddingRight: 10,
- paddingTop: 10,
- paddingBottom: 10,
- rx: 0,
- ry: 0,
- shape: "rect"
-};
-
-var EDGE_DEFAULT_ATTRS = {
- arrowhead: "normal",
- lineInterpolate: "linear"
-};
-
-function preProcessGraph(g) {
- g.nodes().forEach(function(v) {
- var node = g.node(v);
- if (!_.has(node, "label") && !g.children(v).length) { node.label = v; }
-
- if (_.has(node, "paddingX")) {
- _.defaults(node, {
- paddingLeft: node.paddingX,
- paddingRight: node.paddingX
- });
- }
-
- if (_.has(node, "paddingY")) {
- _.defaults(node, {
- paddingTop: node.paddingY,
- paddingBottom: node.paddingY
- });
- }
-
- if (_.has(node, "padding")) {
- _.defaults(node, {
- paddingLeft: node.padding,
- paddingRight: node.padding,
- paddingTop: node.padding,
- paddingBottom: node.padding
- });
- }
-
- _.defaults(node, NODE_DEFAULT_ATTRS);
-
- _.each(["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"], function(k) {
- node[k] = Number(node[k]);
- });
-
- // Save dimensions for restore during post-processing
- if (_.has(node, "width")) { node._prevWidth = node.width; }
- if (_.has(node, "height")) { node._prevHeight = node.height; }
- });
-
- g.edges().forEach(function(e) {
- var edge = g.edge(e);
- if (!_.has(edge, "label")) { edge.label = ""; }
- _.defaults(edge, EDGE_DEFAULT_ATTRS);
- });
-}
-
-function postProcessGraph(g) {
- _.each(g.nodes(), function(v) {
- var node = g.node(v);
-
- // Restore original dimensions
- if (_.has(node, "_prevWidth")) {
- node.width = node._prevWidth;
- } else {
- delete node.width;
- }
-
- if (_.has(node, "_prevHeight")) {
- node.height = node._prevHeight;
- } else {
- delete node.height;
- }
-
- delete node._prevWidth;
- delete node._prevHeight;
- });
-}
-
-function createOrSelectGroup(root, name) {
- var selection = root.select("g." + name);
- if (selection.empty()) {
- selection = root.append("g").attr("class", name);
- }
- return selection;
-}
-
-},{"./arrows":10,"./create-clusters":11,"./create-edge-labels":12,"./create-edge-paths":13,"./create-nodes":14,"./dagre":16,"./lodash":29,"./position-clusters":30,"./position-edge-labels":31,"./position-nodes":32,"./shapes":34}],34:[function(require,module,exports){
-"use strict";
-
-var intersectRect = require("./intersect/intersect-rect"),
- intersectEllipse = require("./intersect/intersect-ellipse"),
- intersectCircle = require("./intersect/intersect-circle"),
- intersectPolygon = require("./intersect/intersect-polygon");
-
-module.exports = {
- rect: rect,
- ellipse: ellipse,
- circle: circle,
- diamond: diamond
-};
-
-function rect(parent, bbox, node) {
- var shapeSvg = parent.insert("rect", ":first-child")
- .attr("rx", node.rx)
- .attr("ry", node.ry)
- .attr("x", -bbox.width / 2)
- .attr("y", -bbox.height / 2)
- .attr("width", bbox.width)
- .attr("height", bbox.height);
-
- node.intersect = function(point) {
- return intersectRect(node, point);
- };
-
- return shapeSvg;
-}
-
-function ellipse(parent, bbox, node) {
- var rx = bbox.width / 2,
- ry = bbox.height / 2,
- shapeSvg = parent.insert("ellipse", ":first-child")
- .attr("x", -bbox.width / 2)
- .attr("y", -bbox.height / 2)
- .attr("rx", rx)
- .attr("ry", ry);
-
- node.intersect = function(point) {
- return intersectEllipse(node, rx, ry, point);
- };
-
- return shapeSvg;
-}
-
-function circle(parent, bbox, node) {
- var r = Math.max(bbox.width, bbox.height) / 2,
- shapeSvg = parent.insert("circle", ":first-child")
- .attr("x", -bbox.width / 2)
- .attr("y", -bbox.height / 2)
- .attr("r", r);
-
- node.intersect = function(point) {
- return intersectCircle(node, r, point);
- };
-
- return shapeSvg;
-}
-
-// Circumscribe an ellipse for the bounding box with a diamond shape. I derived
-// the function to calculate the diamond shape from:
-// http://mathforum.org/kb/message.jspa?messageID=3750236
-function diamond(parent, bbox, node) {
- var w = (bbox.width * Math.SQRT2) / 2,
- h = (bbox.height * Math.SQRT2) / 2,
- points = [
- { x: 0, y: -h },
- { x: -w, y: 0 },
- { x: 0, y: h },
- { x: w, y: 0 }
- ],
- shapeSvg = parent.insert("polygon", ":first-child")
- .attr("points", points.map(function(p) { return p.x + "," + p.y; }).join(" "));
-
- node.intersect = function(p) {
- return intersectPolygon(node, points, p);
- };
-
- return shapeSvg;
-}
-
-},{"./intersect/intersect-circle":19,"./intersect/intersect-ellipse":20,"./intersect/intersect-polygon":23,"./intersect/intersect-rect":24}],35:[function(require,module,exports){
-var _ = require("./lodash");
-
-// Public utility functions
-module.exports = {
- isSubgraph: isSubgraph,
- edgeToId: edgeToId,
- applyStyle: applyStyle,
- applyClass: applyClass,
- applyTransition: applyTransition
-};
-
-/*
- * Returns true if the specified node in the graph is a subgraph node. A
- * subgraph node is one that contains other nodes.
- */
-function isSubgraph(g, v) {
- return !!g.children(v).length;
-}
-
-function edgeToId(e) {
- return escapeId(e.v) + ":" + escapeId(e.w) + ":" + escapeId(e.name);
-}
-
-var ID_DELIM = /:/g;
-function escapeId(str) {
- return str ? String(str).replace(ID_DELIM, "\\:") : "";
-}
-
-function applyStyle(dom, styleFn) {
- if (styleFn) {
- dom.attr("style", styleFn);
- }
-}
-
-function applyClass(dom, classFn, otherClasses) {
- if (classFn) {
- dom
- .attr("class", classFn)
- .attr("class", otherClasses + " " + dom.attr("class"));
- }
-}
-
-function applyTransition(selection, g) {
- var graph = g.graph();
-
- if (_.isPlainObject(graph)) {
- var transition = graph.transition;
- if (_.isFunction(transition)) {
- return transition(selection);
- }
- }
-
- return selection;
-}
-
-},{"./lodash":29}],36:[function(require,module,exports){
-module.exports = "0.1.6";
-
-},{}],37:[function(require,module,exports){
-/**
- * Copyright (c) 2014, Chris Pettitt
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-var lib = require("./lib");
-
-module.exports = {
- Graph: lib.Graph,
- json: require("./lib/json"),
- alg: require("./lib/alg"),
- version: lib.version
-};
-
-},{"./lib":53,"./lib/alg":44,"./lib/json":54}],38:[function(require,module,exports){
-var _ = require("../lodash");
-
-module.exports = components;
-
-function components(g) {
- var visited = {},
- cmpts = [],
- cmpt;
-
- function dfs(v) {
- if (_.has(visited, v)) return;
- visited[v] = true;
- cmpt.push(v);
- _.each(g.successors(v), dfs);
- _.each(g.predecessors(v), dfs);
- }
-
- _.each(g.nodes(), function(v) {
- cmpt = [];
- dfs(v);
- if (cmpt.length) {
- cmpts.push(cmpt);
- }
- });
-
- return cmpts;
-}
-
-},{"../lodash":55}],39:[function(require,module,exports){
-var _ = require("../lodash");
-
-module.exports = dfs;
-
-/*
- * A helper that preforms a pre- or post-order traversal on the input graph
- * and returns the nodes in the order they were visited. If the graph is
- * undirected then this algorithm will navigate using neighbors. If the graph
- * is directed then this algorithm will navigate using successors.
- *
- * Order must be one of "pre" or "post".
- */
-function dfs(g, vs, order) {
- if (!_.isArray(vs)) {
- vs = [vs];
- }
-
- var navigation = (g.isDirected() ? g.successors : g.neighbors).bind(g);
-
- var acc = [],
- visited = {};
- _.each(vs, function(v) {
- if (!g.hasNode(v)) {
- throw new Error("Graph does not have node: " + v);
- }
-
- doDfs(g, v, order === "post", visited, navigation, acc);
- });
- return acc;
-}
-
-function doDfs(g, v, postorder, visited, navigation, acc) {
- if (!_.has(visited, v)) {
- visited[v] = true;
-
- if (!postorder) { acc.push(v); }
- _.each(navigation(v), function(w) {
- doDfs(g, w, postorder, visited, navigation, acc);
- });
- if (postorder) { acc.push(v); }
- }
-}
-
-},{"../lodash":55}],40:[function(require,module,exports){
-var dijkstra = require("./dijkstra"),
- _ = require("../lodash");
-
-module.exports = dijkstraAll;
-
-function dijkstraAll(g, weightFunc, edgeFunc) {
- return _.transform(g.nodes(), function(acc, v) {
- acc[v] = dijkstra(g, v, weightFunc, edgeFunc);
- }, {});
-}
-
-},{"../lodash":55,"./dijkstra":41}],41:[function(require,module,exports){
-var _ = require("../lodash"),
- PriorityQueue = require("../data/priority-queue");
-
-module.exports = dijkstra;
-
-var DEFAULT_WEIGHT_FUNC = _.constant(1);
-
-function dijkstra(g, source, weightFn, edgeFn) {
- return runDijkstra(g, String(source),
- weightFn || DEFAULT_WEIGHT_FUNC,
- edgeFn || function(v) { return g.outEdges(v); });
-}
-
-function runDijkstra(g, source, weightFn, edgeFn) {
- var results = {},
- pq = new PriorityQueue(),
- v, vEntry;
-
- var updateNeighbors = function(edge) {
- var w = edge.v !== v ? edge.v : edge.w,
- wEntry = results[w],
- weight = weightFn(edge),
- distance = vEntry.distance + weight;
-
- if (weight < 0) {
- throw new Error("dijkstra does not allow negative edge weights. " +
- "Bad edge: " + edge + " Weight: " + weight);
- }
-
- if (distance < wEntry.distance) {
- wEntry.distance = distance;
- wEntry.predecessor = v;
- pq.decrease(w, distance);
- }
- };
-
- g.nodes().forEach(function(v) {
- var distance = v === source ? 0 : Number.POSITIVE_INFINITY;
- results[v] = { distance: distance };
- pq.add(v, distance);
- });
-
- while (pq.size() > 0) {
- v = pq.removeMin();
- vEntry = results[v];
- if (vEntry.distance === Number.POSITIVE_INFINITY) {
- break;
- }
-
- edgeFn(v).forEach(updateNeighbors);
- }
-
- return results;
-}
-
-},{"../data/priority-queue":51,"../lodash":55}],42:[function(require,module,exports){
-var _ = require("../lodash"),
- tarjan = require("./tarjan");
-
-module.exports = findCycles;
-
-function findCycles(g) {
- return _.filter(tarjan(g), function(cmpt) {
- return cmpt.length > 1 || (cmpt.length === 1 && g.hasEdge(cmpt[0], cmpt[0]));
- });
-}
-
-},{"../lodash":55,"./tarjan":49}],43:[function(require,module,exports){
-var _ = require("../lodash");
-
-module.exports = floydWarshall;
-
-var DEFAULT_WEIGHT_FUNC = _.constant(1);
-
-function floydWarshall(g, weightFn, edgeFn) {
- return runFloydWarshall(g,
- weightFn || DEFAULT_WEIGHT_FUNC,
- edgeFn || function(v) { return g.outEdges(v); });
-}
-
-function runFloydWarshall(g, weightFn, edgeFn) {
- var results = {},
- nodes = g.nodes();
-
- nodes.forEach(function(v) {
- results[v] = {};
- results[v][v] = { distance: 0 };
- nodes.forEach(function(w) {
- if (v !== w) {
- results[v][w] = { distance: Number.POSITIVE_INFINITY };
- }
- });
- edgeFn(v).forEach(function(edge) {
- var w = edge.v === v ? edge.w : edge.v,
- d = weightFn(edge);
- results[v][w] = { distance: d, predecessor: v };
- });
- });
-
- nodes.forEach(function(k) {
- var rowK = results[k];
- nodes.forEach(function(i) {
- var rowI = results[i];
- nodes.forEach(function(j) {
- var ik = rowI[k];
- var kj = rowK[j];
- var ij = rowI[j];
- var altDistance = ik.distance + kj.distance;
- if (altDistance < ij.distance) {
- ij.distance = altDistance;
- ij.predecessor = kj.predecessor;
- }
- });
- });
- });
-
- return results;
-}
-
-},{"../lodash":55}],44:[function(require,module,exports){
-module.exports = {
- components: require("./components"),
- dijkstra: require("./dijkstra"),
- dijkstraAll: require("./dijkstra-all"),
- findCycles: require("./find-cycles"),
- floydWarshall: require("./floyd-warshall"),
- isAcyclic: require("./is-acyclic"),
- postorder: require("./postorder"),
- preorder: require("./preorder"),
- prim: require("./prim"),
- tarjan: require("./tarjan"),
- topsort: require("./topsort")
-};
-
-},{"./components":38,"./dijkstra":41,"./dijkstra-all":40,"./find-cycles":42,"./floyd-warshall":43,"./is-acyclic":45,"./postorder":46,"./preorder":47,"./prim":48,"./tarjan":49,"./topsort":50}],45:[function(require,module,exports){
-var topsort = require("./topsort");
-
-module.exports = isAcyclic;
-
-function isAcyclic(g) {
- try {
- topsort(g);
- } catch (e) {
- if (e instanceof topsort.CycleException) {
- return false;
- }
- throw e;
- }
- return true;
-}
-
-},{"./topsort":50}],46:[function(require,module,exports){
-var dfs = require("./dfs");
-
-module.exports = postorder;
-
-function postorder(g, vs) {
- return dfs(g, vs, "post");
-}
-
-},{"./dfs":39}],47:[function(require,module,exports){
-var dfs = require("./dfs");
-
-module.exports = preorder;
-
-function preorder(g, vs) {
- return dfs(g, vs, "pre");
-}
-
-},{"./dfs":39}],48:[function(require,module,exports){
-var _ = require("../lodash"),
- Graph = require("../graph"),
- PriorityQueue = require("../data/priority-queue");
-
-module.exports = prim;
-
-function prim(g, weightFunc) {
- var result = new Graph(),
- parents = {},
- pq = new PriorityQueue(),
- v;
-
- function updateNeighbors(edge) {
- var w = edge.v === v ? edge.w : edge.v,
- pri = pq.priority(w);
- if (pri !== undefined) {
- var edgeWeight = weightFunc(edge);
- if (edgeWeight < pri) {
- parents[w] = v;
- pq.decrease(w, edgeWeight);
- }
- }
- }
-
- if (g.nodeCount() === 0) {
- return result;
- }
-
- _.each(g.nodes(), function(v) {
- pq.add(v, Number.POSITIVE_INFINITY);
- result.setNode(v);
- });
-
- // Start from an arbitrary node
- pq.decrease(g.nodes()[0], 0);
-
- var init = false;
- while (pq.size() > 0) {
- v = pq.removeMin();
- if (_.has(parents, v)) {
- result.setEdge(v, parents[v]);
- } else if (init) {
- throw new Error("Input graph is not connected: " + g);
- } else {
- init = true;
- }
-
- g.nodeEdges(v).forEach(updateNeighbors);
- }
-
- return result;
-}
-
-},{"../data/priority-queue":51,"../graph":52,"../lodash":55}],49:[function(require,module,exports){
-var _ = require("../lodash");
-
-module.exports = tarjan;
-
-function tarjan(g) {
- var index = 0,
- stack = [],
- visited = {}, // node id -> { onStack, lowlink, index }
- results = [];
-
- function dfs(v) {
- var entry = visited[v] = {
- onStack: true,
- lowlink: index,
- index: index++
- };
- stack.push(v);
-
- g.successors(v).forEach(function(w) {
- if (!_.has(visited, w)) {
- dfs(w);
- entry.lowlink = Math.min(entry.lowlink, visited[w].lowlink);
- } else if (visited[w].onStack) {
- entry.lowlink = Math.min(entry.lowlink, visited[w].index);
- }
- });
-
- if (entry.lowlink === entry.index) {
- var cmpt = [],
- w;
- do {
- w = stack.pop();
- visited[w].onStack = false;
- cmpt.push(w);
- } while (v !== w);
- results.push(cmpt);
- }
- }
-
- g.nodes().forEach(function(v) {
- if (!_.has(visited, v)) {
- dfs(v);
- }
- });
-
- return results;
-}
-
-},{"../lodash":55}],50:[function(require,module,exports){
-var _ = require("../lodash");
-
-module.exports = topsort;
-topsort.CycleException = CycleException;
-
-function topsort(g) {
- var visited = {},
- stack = {},
- results = [];
-
- function visit(node) {
- if (_.has(stack, node)) {
- throw new CycleException();
- }
-
- if (!_.has(visited, node)) {
- stack[node] = true;
- visited[node] = true;
- _.each(g.predecessors(node), visit);
- delete stack[node];
- results.push(node);
- }
- }
-
- _.each(g.sinks(), visit);
-
- if (_.size(visited) !== g.nodeCount()) {
- throw new CycleException();
- }
-
- return results;
-}
-
-function CycleException() {}
-
-},{"../lodash":55}],51:[function(require,module,exports){
-var _ = require("../lodash");
-
-module.exports = PriorityQueue;
-
-/**
- * A min-priority queue data structure. This algorithm is derived from Cormen,
- * et al., "Introduction to Algorithms". The basic idea of a min-priority
- * queue is that you can efficiently (in O(1) time) get the smallest key in
- * the queue. Adding and removing elements takes O(log n) time. A key can
- * have its priority decreased in O(log n) time.
- */
-function PriorityQueue() {
- this._arr = [];
- this._keyIndices = {};
-}
-
-/**
- * Returns the number of elements in the queue. Takes `O(1)` time.
- */
-PriorityQueue.prototype.size = function() {
- return this._arr.length;
-};
-
-/**
- * Returns the keys that are in the queue. Takes `O(n)` time.
- */
-PriorityQueue.prototype.keys = function() {
- return this._arr.map(function(x) { return x.key; });
-};
-
-/**
- * Returns `true` if **key** is in the queue and `false` if not.
- */
-PriorityQueue.prototype.has = function(key) {
- return _.has(this._keyIndices, key);
-};
-
-/**
- * Returns the priority for **key**. If **key** is not present in the queue
- * then this function returns `undefined`. Takes `O(1)` time.
- *
- * @param {Object} key
- */
-PriorityQueue.prototype.priority = function(key) {
- var index = this._keyIndices[key];
- if (index !== undefined) {
- return this._arr[index].priority;
- }
-};
-
-/**
- * Returns the key for the minimum element in this queue. If the queue is
- * empty this function throws an Error. Takes `O(1)` time.
- */
-PriorityQueue.prototype.min = function() {
- if (this.size() === 0) {
- throw new Error("Queue underflow");
- }
- return this._arr[0].key;
-};
-
-/**
- * Inserts a new key into the priority queue. If the key already exists in
- * the queue this function returns `false`; otherwise it will return `true`.
- * Takes `O(n)` time.
- *
- * @param {Object} key the key to add
- * @param {Number} priority the initial priority for the key
- */
-PriorityQueue.prototype.add = function(key, priority) {
- var keyIndices = this._keyIndices;
- key = String(key);
- if (!_.has(keyIndices, key)) {
- var arr = this._arr;
- var index = arr.length;
- keyIndices[key] = index;
- arr.push({key: key, priority: priority});
- this._decrease(index);
- return true;
- }
- return false;
-};
-
-/**
- * Removes and returns the smallest key in the queue. Takes `O(log n)` time.
- */
-PriorityQueue.prototype.removeMin = function() {
- this._swap(0, this._arr.length - 1);
- var min = this._arr.pop();
- delete this._keyIndices[min.key];
- this._heapify(0);
- return min.key;
-};
-
-/**
- * Decreases the priority for **key** to **priority**. If the new priority is
- * greater than the previous priority, this function will throw an Error.
- *
- * @param {Object} key the key for which to raise priority
- * @param {Number} priority the new priority for the key
- */
-PriorityQueue.prototype.decrease = function(key, priority) {
- var index = this._keyIndices[key];
- if (priority > this._arr[index].priority) {
- throw new Error("New priority is greater than current priority. " +
- "Key: " + key + " Old: " + this._arr[index].priority + " New: " + priority);
- }
- this._arr[index].priority = priority;
- this._decrease(index);
-};
-
-PriorityQueue.prototype._heapify = function(i) {
- var arr = this._arr;
- var l = 2 * i,
- r = l + 1,
- largest = i;
- if (l < arr.length) {
- largest = arr[l].priority < arr[largest].priority ? l : largest;
- if (r < arr.length) {
- largest = arr[r].priority < arr[largest].priority ? r : largest;
- }
- if (largest !== i) {
- this._swap(i, largest);
- this._heapify(largest);
- }
- }
-};
-
-PriorityQueue.prototype._decrease = function(index) {
- var arr = this._arr;
- var priority = arr[index].priority;
- var parent;
- while (index !== 0) {
- parent = index >> 1;
- if (arr[parent].priority < priority) {
- break;
- }
- this._swap(index, parent);
- index = parent;
- }
-};
-
-PriorityQueue.prototype._swap = function(i, j) {
- var arr = this._arr;
- var keyIndices = this._keyIndices;
- var origArrI = arr[i];
- var origArrJ = arr[j];
- arr[i] = origArrJ;
- arr[j] = origArrI;
- keyIndices[origArrJ.key] = i;
- keyIndices[origArrI.key] = j;
-};
-
-},{"../lodash":55}],52:[function(require,module,exports){
-"use strict";
-
-var _ = require("./lodash");
-
-module.exports = Graph;
-
-var DEFAULT_EDGE_NAME = "\x00",
- GRAPH_NODE = "\x00",
- EDGE_KEY_DELIM = "\x01";
-
-// Implementation notes:
-//
-// * Node id query functions should return string ids for the nodes
-// * Edge id query functions should return an "edgeObj", edge object, that is
-// composed of enough information to uniquely identify an edge: {v, w, name}.
-// * Internally we use an "edgeId", a stringified form of the edgeObj, to
-// reference edges. This is because we need a performant way to look these
-// edges up and, object properties, which have string keys, are the closest
-// we're going to get to a performant hashtable in JavaScript.
-
-function Graph(opts) {
- this._isDirected = _.has(opts, "directed") ? opts.directed : true;
- this._isMultigraph = _.has(opts, "multigraph") ? opts.multigraph : false;
- this._isCompound = _.has(opts, "compound") ? opts.compound : false;
-
- // Label for the graph itself
- this._label = undefined;
-
- // Defaults to be set when creating a new node
- this._defaultNodeLabelFn = _.constant(undefined);
-
- // Defaults to be set when creating a new edge
- this._defaultEdgeLabelFn = _.constant(undefined);
-
- // v -> label
- this._nodes = {};
-
- if (this._isCompound) {
- // v -> parent
- this._parent = {};
-
- // v -> children
- this._children = {};
- this._children[GRAPH_NODE] = {};
- }
-
- // v -> edgeObj
- this._in = {};
-
- // u -> v -> Number
- this._preds = {};
-
- // v -> edgeObj
- this._out = {};
-
- // v -> w -> Number
- this._sucs = {};
-
- // e -> edgeObj
- this._edgeObjs = {};
-
- // e -> label
- this._edgeLabels = {};
-}
-
-/* Number of nodes in the graph. Should only be changed by the implementation. */
-Graph.prototype._nodeCount = 0;
-
-/* Number of edges in the graph. Should only be changed by the implementation. */
-Graph.prototype._edgeCount = 0;
-
-
-/* === Graph functions ========= */
-
-Graph.prototype.isDirected = function() {
- return this._isDirected;
-};
-
-Graph.prototype.isMultigraph = function() {
- return this._isMultigraph;
-};
-
-Graph.prototype.isCompound = function() {
- return this._isCompound;
-};
-
-Graph.prototype.setGraph = function(label) {
- this._label = label;
- return this;
-};
-
-Graph.prototype.graph = function() {
- return this._label;
-};
-
-
-/* === Node functions ========== */
-
-Graph.prototype.setDefaultNodeLabel = function(newDefault) {
- if (!_.isFunction(newDefault)) {
- newDefault = _.constant(newDefault);
- }
- this._defaultNodeLabelFn = newDefault;
- return this;
-};
-
-Graph.prototype.nodeCount = function() {
- return this._nodeCount;
-};
-
-Graph.prototype.nodes = function() {
- return _.keys(this._nodes);
-};
-
-Graph.prototype.sources = function() {
- return _.filter(this.nodes(), _.bind(function(v) {
- return _.isEmpty(this._in[v]);
- }, this));
-};
-
-Graph.prototype.sinks = function() {
- return _.filter(this.nodes(), _.bind(function(v) {
- return _.isEmpty(this._out[v]);
- }, this));
-};
-
-Graph.prototype.setNodes = function(vs, value) {
- var args = arguments;
- _.each(vs, _.bind(function(v) {
- if (args.length > 1) {
- this.setNode(v, value);
- } else {
- this.setNode(v);
- }
- }, this));
- return this;
-};
-
-Graph.prototype.setNode = function(v, value) {
- if (_.has(this._nodes, v)) {
- if (arguments.length > 1) {
- this._nodes[v] = value;
- }
- return this;
- }
-
- this._nodes[v] = arguments.length > 1 ? value : this._defaultNodeLabelFn(v);
- if (this._isCompound) {
- this._parent[v] = GRAPH_NODE;
- this._children[v] = {};
- this._children[GRAPH_NODE][v] = true;
- }
- this._in[v] = {};
- this._preds[v] = {};
- this._out[v] = {};
- this._sucs[v] = {};
- ++this._nodeCount;
- return this;
-};
-
-Graph.prototype.node = function(v) {
- return this._nodes[v];
-};
-
-Graph.prototype.hasNode = function(v) {
- return _.has(this._nodes, v);
-};
-
-Graph.prototype.removeNode = function(v) {
- var self = this;
- if (_.has(this._nodes, v)) {
- var removeEdge = function(e) { self.removeEdge(self._edgeObjs[e]); };
- delete this._nodes[v];
- if (this._isCompound) {
- this._removeFromParentsChildList(v);
- delete this._parent[v];
- _.each(this.children(v), _.bind(function(child) {
- this.setParent(child);
- }, this));
- delete this._children[v];
- }
- _.each(_.keys(this._in[v]), removeEdge);
- delete this._in[v];
- delete this._preds[v];
- _.each(_.keys(this._out[v]), removeEdge);
- delete this._out[v];
- delete this._sucs[v];
- --this._nodeCount;
- }
- return this;
-};
-
-Graph.prototype.setParent = function(v, parent) {
- if (!this._isCompound) {
- throw new Error("Cannot set parent in a non-compound graph");
- }
-
- if (_.isUndefined(parent)) {
- parent = GRAPH_NODE;
- } else {
- // Coerce parent to string
- parent += "";
- for (var ancestor = parent;
- !_.isUndefined(ancestor);
- ancestor = this.parent(ancestor)) {
- if (ancestor === v) {
- throw new Error("Setting " + parent+ " as parent of " + v +
- " would create create a cycle");
- }
- }
-
- this.setNode(parent);
- }
-
- this.setNode(v);
- this._removeFromParentsChildList(v);
- this._parent[v] = parent;
- this._children[parent][v] = true;
- return this;
-};
-
-Graph.prototype._removeFromParentsChildList = function(v) {
- delete this._children[this._parent[v]][v];
-};
-
-Graph.prototype.parent = function(v) {
- if (this._isCompound) {
- var parent = this._parent[v];
- if (parent !== GRAPH_NODE) {
- return parent;
- }
- }
-};
-
-Graph.prototype.children = function(v) {
- if (_.isUndefined(v)) {
- v = GRAPH_NODE;
- }
-
- if (this._isCompound) {
- var children = this._children[v];
- if (children) {
- return _.keys(children);
- }
- } else if (v === GRAPH_NODE) {
- return this.nodes();
- } else if (this.hasNode(v)) {
- return [];
- }
-};
-
-Graph.prototype.predecessors = function(v) {
- var predsV = this._preds[v];
- if (predsV) {
- return _.keys(predsV);
- }
-};
-
-Graph.prototype.successors = function(v) {
- var sucsV = this._sucs[v];
- if (sucsV) {
- return _.keys(sucsV);
- }
-};
-
-Graph.prototype.neighbors = function(v) {
- var preds = this.predecessors(v);
- if (preds) {
- return _.union(preds, this.successors(v));
- }
-};
-
-Graph.prototype.filterNodes = function(filter) {
- var copy = new this.constructor({
- directed: this._isDirected,
- multigraph: this._isMultigraph,
- compound: this._isCompound
- });
-
- copy.setGraph(this.graph());
-
- _.each(this._nodes, _.bind(function(value, v) {
- if (filter(v)) {
- copy.setNode(v, value);
- }
- }, this));
-
- _.each(this._edgeObjs, _.bind(function(e) {
- if (copy.hasNode(e.v) && copy.hasNode(e.w)) {
- copy.setEdge(e, this.edge(e));
- }
- }, this));
-
- var self = this;
- var parents = {};
- function findParent(v) {
- var parent = self.parent(v);
- if (parent === undefined || copy.hasNode(parent)) {
- parents[v] = parent;
- return parent;
- } else if (parent in parents) {
- return parents[parent];
- } else {
- return findParent(parent);
- }
- }
-
- if (this._isCompound) {
- _.each(copy.nodes(), function(v) {
- copy.setParent(v, findParent(v));
- });
- }
-
- return copy;
-};
-
-/* === Edge functions ========== */
-
-Graph.prototype.setDefaultEdgeLabel = function(newDefault) {
- if (!_.isFunction(newDefault)) {
- newDefault = _.constant(newDefault);
- }
- this._defaultEdgeLabelFn = newDefault;
- return this;
-};
-
-Graph.prototype.edgeCount = function() {
- return this._edgeCount;
-};
-
-Graph.prototype.edges = function() {
- return _.values(this._edgeObjs);
-};
-
-Graph.prototype.setPath = function(vs, value) {
- var self = this,
- args = arguments;
- _.reduce(vs, function(v, w) {
- if (args.length > 1) {
- self.setEdge(v, w, value);
- } else {
- self.setEdge(v, w);
- }
- return w;
- });
- return this;
-};
-
-/*
- * setEdge(v, w, [value, [name]])
- * setEdge({ v, w, [name] }, [value])
- */
-Graph.prototype.setEdge = function() {
- var v, w, name, value,
- valueSpecified = false,
- arg0 = arguments[0];
-
- if (typeof arg0 === "object" && arg0 !== null && "v" in arg0) {
- v = arg0.v;
- w = arg0.w;
- name = arg0.name;
- if (arguments.length === 2) {
- value = arguments[1];
- valueSpecified = true;
- }
- } else {
- v = arg0;
- w = arguments[1];
- name = arguments[3];
- if (arguments.length > 2) {
- value = arguments[2];
- valueSpecified = true;
- }
- }
-
- v = "" + v;
- w = "" + w;
- if (!_.isUndefined(name)) {
- name = "" + name;
- }
-
- var e = edgeArgsToId(this._isDirected, v, w, name);
- if (_.has(this._edgeLabels, e)) {
- if (valueSpecified) {
- this._edgeLabels[e] = value;
- }
- return this;
- }
-
- if (!_.isUndefined(name) && !this._isMultigraph) {
- throw new Error("Cannot set a named edge when isMultigraph = false");
- }
-
- // It didn't exist, so we need to create it.
- // First ensure the nodes exist.
- this.setNode(v);
- this.setNode(w);
-
- this._edgeLabels[e] = valueSpecified ? value : this._defaultEdgeLabelFn(v, w, name);
-
- var edgeObj = edgeArgsToObj(this._isDirected, v, w, name);
- // Ensure we add undirected edges in a consistent way.
- v = edgeObj.v;
- w = edgeObj.w;
-
- Object.freeze(edgeObj);
- this._edgeObjs[e] = edgeObj;
- incrementOrInitEntry(this._preds[w], v);
- incrementOrInitEntry(this._sucs[v], w);
- this._in[w][e] = edgeObj;
- this._out[v][e] = edgeObj;
- this._edgeCount++;
- return this;
-};
-
-Graph.prototype.edge = function(v, w, name) {
- var e = (arguments.length === 1
- ? edgeObjToId(this._isDirected, arguments[0])
- : edgeArgsToId(this._isDirected, v, w, name));
- return this._edgeLabels[e];
-};
-
-Graph.prototype.hasEdge = function(v, w, name) {
- var e = (arguments.length === 1
- ? edgeObjToId(this._isDirected, arguments[0])
- : edgeArgsToId(this._isDirected, v, w, name));
- return _.has(this._edgeLabels, e);
-};
-
-Graph.prototype.removeEdge = function(v, w, name) {
- var e = (arguments.length === 1
- ? edgeObjToId(this._isDirected, arguments[0])
- : edgeArgsToId(this._isDirected, v, w, name)),
- edge = this._edgeObjs[e];
- if (edge) {
- v = edge.v;
- w = edge.w;
- delete this._edgeLabels[e];
- delete this._edgeObjs[e];
- decrementOrRemoveEntry(this._preds[w], v);
- decrementOrRemoveEntry(this._sucs[v], w);
- delete this._in[w][e];
- delete this._out[v][e];
- this._edgeCount--;
- }
- return this;
-};
-
-Graph.prototype.inEdges = function(v, u) {
- var inV = this._in[v];
- if (inV) {
- var edges = _.values(inV);
- if (!u) {
- return edges;
- }
- return _.filter(edges, function(edge) { return edge.v === u; });
- }
-};
-
-Graph.prototype.outEdges = function(v, w) {
- var outV = this._out[v];
- if (outV) {
- var edges = _.values(outV);
- if (!w) {
- return edges;
- }
- return _.filter(edges, function(edge) { return edge.w === w; });
- }
-};
-
-Graph.prototype.nodeEdges = function(v, w) {
- var inEdges = this.inEdges(v, w);
- if (inEdges) {
- return inEdges.concat(this.outEdges(v, w));
- }
-};
-
-function incrementOrInitEntry(map, k) {
- if (map[k]) {
- map[k]++;
- } else {
- map[k] = 1;
- }
-}
-
-function decrementOrRemoveEntry(map, k) {
- if (!--map[k]) { delete map[k]; }
-}
-
-function edgeArgsToId(isDirected, v_, w_, name) {
- var v = "" + v_;
- var w = "" + w_;
- if (!isDirected && v > w) {
- var tmp = v;
- v = w;
- w = tmp;
- }
- return v + EDGE_KEY_DELIM + w + EDGE_KEY_DELIM +
- (_.isUndefined(name) ? DEFAULT_EDGE_NAME : name);
-}
-
-function edgeArgsToObj(isDirected, v_, w_, name) {
- var v = "" + v_;
- var w = "" + w_;
- if (!isDirected && v > w) {
- var tmp = v;
- v = w;
- w = tmp;
- }
- var edgeObj = { v: v, w: w };
- if (name) {
- edgeObj.name = name;
- }
- return edgeObj;
-}
-
-function edgeObjToId(isDirected, edgeObj) {
- return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name);
-}
-
-},{"./lodash":55}],53:[function(require,module,exports){
-// Includes only the "core" of graphlib
-module.exports = {
- Graph: require("./graph"),
- version: require("./version")
-};
-
-},{"./graph":52,"./version":56}],54:[function(require,module,exports){
-var _ = require("./lodash"),
- Graph = require("./graph");
-
-module.exports = {
- write: write,
- read: read
-};
-
-function write(g) {
- var json = {
- options: {
- directed: g.isDirected(),
- multigraph: g.isMultigraph(),
- compound: g.isCompound()
- },
- nodes: writeNodes(g),
- edges: writeEdges(g)
- };
- if (!_.isUndefined(g.graph())) {
- json.value = _.clone(g.graph());
- }
- return json;
-}
-
-function writeNodes(g) {
- return _.map(g.nodes(), function(v) {
- var nodeValue = g.node(v),
- parent = g.parent(v),
- node = { v: v };
- if (!_.isUndefined(nodeValue)) {
- node.value = nodeValue;
- }
- if (!_.isUndefined(parent)) {
- node.parent = parent;
- }
- return node;
- });
-}
-
-function writeEdges(g) {
- return _.map(g.edges(), function(e) {
- var edgeValue = g.edge(e),
- edge = { v: e.v, w: e.w };
- if (!_.isUndefined(e.name)) {
- edge.name = e.name;
- }
- if (!_.isUndefined(edgeValue)) {
- edge.value = edgeValue;
- }
- return edge;
- });
-}
-
-function read(json) {
- var g = new Graph(json.options).setGraph(json.value);
- _.each(json.nodes, function(entry) {
- g.setNode(entry.v, entry.value);
- if (entry.parent) {
- g.setParent(entry.v, entry.parent);
- }
- });
- _.each(json.edges, function(entry) {
- g.setEdge({ v: entry.v, w: entry.w, name: entry.name }, entry.value);
- });
- return g;
-}
-
-},{"./graph":52,"./lodash":55}],55:[function(require,module,exports){
-/* global window */
-
-var lodash;
-
-if (typeof require === "function") {
- try {
- lodash = require("lodash");
- } catch (e) {}
-}
-
-if (!lodash) {
- lodash = window._;
-}
-
-module.exports = lodash;
-
-},{"lodash":292}],56:[function(require,module,exports){
-module.exports = '2.1.1';
-
-},{}],57:[function(require,module,exports){
-/*
-Copyright (c) 2012-2014 Chris Pettitt
-
-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.
-*/
-
-module.exports = {
- graphlib: require("./lib/graphlib"),
-
- layout: require("./lib/layout"),
- debug: require("./lib/debug"),
- util: {
- time: require("./lib/util").time,
- notime: require("./lib/util").notime
- },
- version: require("./lib/version")
-};
-
-},{"./lib/debug":62,"./lib/graphlib":63,"./lib/layout":65,"./lib/util":85,"./lib/version":86}],58:[function(require,module,exports){
-"use strict";
-
-var _ = require("./lodash"),
- greedyFAS = require("./greedy-fas");
-
-module.exports = {
- run: run,
- undo: undo
-};
-
-function run(g) {
- var fas = (g.graph().acyclicer === "greedy"
- ? greedyFAS(g, weightFn(g))
- : dfsFAS(g));
- _.each(fas, function(e) {
- var label = g.edge(e);
- g.removeEdge(e);
- label.forwardName = e.name;
- label.reversed = true;
- g.setEdge(e.w, e.v, label, _.uniqueId("rev"));
- });
-
- function weightFn(g) {
- return function(e) {
- return g.edge(e).weight;
- };
- }
-}
-
-function dfsFAS(g) {
- var fas = [],
- stack = {},
- visited = {};
-
- function dfs(v) {
- if (_.has(visited, v)) {
- return;
- }
- visited[v] = true;
- stack[v] = true;
- _.each(g.outEdges(v), function(e) {
- if (_.has(stack, e.w)) {
- fas.push(e);
- } else {
- dfs(e.w);
- }
- });
- delete stack[v];
- }
-
- _.each(g.nodes(), dfs);
- return fas;
-}
-
-function undo(g) {
- _.each(g.edges(), function(e) {
- var label = g.edge(e);
- if (label.reversed) {
- g.removeEdge(e);
-
- var forwardName = label.forwardName;
- delete label.reversed;
- delete label.forwardName;
- g.setEdge(e.w, e.v, label, forwardName);
- }
- });
-}
-
-},{"./greedy-fas":64,"./lodash":66}],59:[function(require,module,exports){
-var _ = require("./lodash"),
- util = require("./util");
-
-module.exports = addBorderSegments;
-
-function addBorderSegments(g) {
- function dfs(v) {
- var children = g.children(v),
- node = g.node(v);
- if (children.length) {
- _.each(children, dfs);
- }
-
- if (_.has(node, "minRank")) {
- node.borderLeft = [];
- node.borderRight = [];
- for (var rank = node.minRank, maxRank = node.maxRank + 1;
- rank < maxRank;
- ++rank) {
- addBorderNode(g, "borderLeft", "_bl", v, node, rank);
- addBorderNode(g, "borderRight", "_br", v, node, rank);
- }
- }
- }
-
- _.each(g.children(), dfs);
-}
-
-function addBorderNode(g, prop, prefix, sg, sgNode, rank) {
- var label = { width: 0, height: 0, rank: rank, borderType: prop },
- prev = sgNode[prop][rank - 1],
- curr = util.addDummyNode(g, "border", label, prefix);
- sgNode[prop][rank] = curr;
- g.setParent(curr, sg);
- if (prev) {
- g.setEdge(prev, curr, { weight: 1 });
- }
-}
-
-},{"./lodash":66,"./util":85}],60:[function(require,module,exports){
-"use strict";
-
-var _ = require("./lodash");
-
-module.exports = {
- adjust: adjust,
- undo: undo
-};
-
-function adjust(g) {
- var rankDir = g.graph().rankdir.toLowerCase();
- if (rankDir === "lr" || rankDir === "rl") {
- swapWidthHeight(g);
- }
-}
-
-function undo(g) {
- var rankDir = g.graph().rankdir.toLowerCase();
- if (rankDir === "bt" || rankDir === "rl") {
- reverseY(g);
- }
-
- if (rankDir === "lr" || rankDir === "rl") {
- swapXY(g);
- swapWidthHeight(g);
- }
-}
-
-function swapWidthHeight(g) {
- _.each(g.nodes(), function(v) { swapWidthHeightOne(g.node(v)); });
- _.each(g.edges(), function(e) { swapWidthHeightOne(g.edge(e)); });
-}
-
-function swapWidthHeightOne(attrs) {
- var w = attrs.width;
- attrs.width = attrs.height;
- attrs.height = w;
-}
-
-function reverseY(g) {
- _.each(g.nodes(), function(v) { reverseYOne(g.node(v)); });
-
- _.each(g.edges(), function(e) {
- var edge = g.edge(e);
- _.each(edge.points, reverseYOne);
- if (_.has(edge, "y")) {
- reverseYOne(edge);
- }
- });
-}
-
-function reverseYOne(attrs) {
- attrs.y = -attrs.y;
-}
-
-function swapXY(g) {
- _.each(g.nodes(), function(v) { swapXYOne(g.node(v)); });
-
- _.each(g.edges(), function(e) {
- var edge = g.edge(e);
- _.each(edge.points, swapXYOne);
- if (_.has(edge, "x")) {
- swapXYOne(edge);
- }
- });
-}
-
-function swapXYOne(attrs) {
- var x = attrs.x;
- attrs.x = attrs.y;
- attrs.y = x;
-}
-
-},{"./lodash":66}],61:[function(require,module,exports){
-/*
- * Simple doubly linked list implementation derived from Cormen, et al.,
- * "Introduction to Algorithms".
- */
-
-module.exports = List;
-
-function List() {
- var sentinel = {};
- sentinel._next = sentinel._prev = sentinel;
- this._sentinel = sentinel;
-}
-
-List.prototype.dequeue = function() {
- var sentinel = this._sentinel,
- entry = sentinel._prev;
- if (entry !== sentinel) {
- unlink(entry);
- return entry;
- }
-};
-
-List.prototype.enqueue = function(entry) {
- var sentinel = this._sentinel;
- if (entry._prev && entry._next) {
- unlink(entry);
- }
- entry._next = sentinel._next;
- sentinel._next._prev = entry;
- sentinel._next = entry;
- entry._prev = sentinel;
-};
-
-List.prototype.toString = function() {
- var strs = [],
- sentinel = this._sentinel,
- curr = sentinel._prev;
- while (curr !== sentinel) {
- strs.push(JSON.stringify(curr, filterOutLinks));
- curr = curr._prev;
- }
- return "[" + strs.join(", ") + "]";
-};
-
-function unlink(entry) {
- entry._prev._next = entry._next;
- entry._next._prev = entry._prev;
- delete entry._next;
- delete entry._prev;
-}
-
-function filterOutLinks(k, v) {
- if (k !== "_next" && k !== "_prev") {
- return v;
- }
-}
-
-},{}],62:[function(require,module,exports){
-var _ = require("./lodash"),
- util = require("./util"),
- Graph = require("./graphlib").Graph;
-
-module.exports = {
- debugOrdering: debugOrdering
-};
-
-/* istanbul ignore next */
-function debugOrdering(g) {
- var layerMatrix = util.buildLayerMatrix(g);
-
- var h = new Graph({ compound: true, multigraph: true }).setGraph({});
-
- _.each(g.nodes(), function(v) {
- h.setNode(v, { label: v });
- h.setParent(v, "layer" + g.node(v).rank);
- });
-
- _.each(g.edges(), function(e) {
- h.setEdge(e.v, e.w, {}, e.name);
- });
-
- _.each(layerMatrix, function(layer, i) {
- var layerV = "layer" + i;
- h.setNode(layerV, { rank: "same" });
- _.reduce(layer, function(u, v) {
- h.setEdge(u, v, { style: "invis" });
- return v;
- });
- });
-
- return h;
-}
-
-},{"./graphlib":63,"./lodash":66,"./util":85}],63:[function(require,module,exports){
-/* global window */
-
-var graphlib;
-
-if (typeof require === "function") {
- try {
- graphlib = require("graphlib");
- } catch (e) {}
-}
-
-if (!graphlib) {
- graphlib = window.graphlib;
-}
-
-module.exports = graphlib;
-
-},{"graphlib":89}],64:[function(require,module,exports){
-var _ = require("./lodash"),
- Graph = require("./graphlib").Graph,
- List = require("./data/list");
-
-/*
- * A greedy heuristic for finding a feedback arc set for a graph. A feedback
- * arc set is a set of edges that can be removed to make a graph acyclic.
- * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, "A fast and
- * effective heuristic for the feedback arc set problem." This implementation
- * adjusts that from the paper to allow for weighted edges.
- */
-module.exports = greedyFAS;
-
-var DEFAULT_WEIGHT_FN = _.constant(1);
-
-function greedyFAS(g, weightFn) {
- if (g.nodeCount() <= 1) {
- return [];
- }
- var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN);
- var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx);
-
- // Expand multi-edges
- return _.flatten(_.map(results, function(e) {
- return g.outEdges(e.v, e.w);
- }), true);
-}
-
-function doGreedyFAS(g, buckets, zeroIdx) {
- var results = [],
- sources = buckets[buckets.length - 1],
- sinks = buckets[0];
-
- var entry;
- while (g.nodeCount()) {
- while ((entry = sinks.dequeue())) { removeNode(g, buckets, zeroIdx, entry); }
- while ((entry = sources.dequeue())) { removeNode(g, buckets, zeroIdx, entry); }
- if (g.nodeCount()) {
- for (var i = buckets.length - 2; i > 0; --i) {
- entry = buckets[i].dequeue();
- if (entry) {
- results = results.concat(removeNode(g, buckets, zeroIdx, entry, true));
- break;
- }
- }
- }
- }
-
- return results;
-}
-
-function removeNode(g, buckets, zeroIdx, entry, collectPredecessors) {
- var results = collectPredecessors ? [] : undefined;
-
- _.each(g.inEdges(entry.v), function(edge) {
- var weight = g.edge(edge),
- uEntry = g.node(edge.v);
-
- if (collectPredecessors) {
- results.push({ v: edge.v, w: edge.w });
- }
-
- uEntry.out -= weight;
- assignBucket(buckets, zeroIdx, uEntry);
- });
-
- _.each(g.outEdges(entry.v), function(edge) {
- var weight = g.edge(edge),
- w = edge.w,
- wEntry = g.node(w);
- wEntry["in"] -= weight;
- assignBucket(buckets, zeroIdx, wEntry);
- });
-
- g.removeNode(entry.v);
-
- return results;
-}
-
-function buildState(g, weightFn) {
- var fasGraph = new Graph(),
- maxIn = 0,
- maxOut = 0;
-
- _.each(g.nodes(), function(v) {
- fasGraph.setNode(v, { v: v, "in": 0, out: 0 });
- });
-
- // Aggregate weights on nodes, but also sum the weights across multi-edges
- // into a single edge for the fasGraph.
- _.each(g.edges(), function(e) {
- var prevWeight = fasGraph.edge(e.v, e.w) || 0,
- weight = weightFn(e),
- edgeWeight = prevWeight + weight;
- fasGraph.setEdge(e.v, e.w, edgeWeight);
- maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight);
- maxIn = Math.max(maxIn, fasGraph.node(e.w)["in"] += weight);
- });
-
- var buckets = _.range(maxOut + maxIn + 3).map(function() { return new List(); });
- var zeroIdx = maxIn + 1;
-
- _.each(fasGraph.nodes(), function(v) {
- assignBucket(buckets, zeroIdx, fasGraph.node(v));
- });
-
- return { graph: fasGraph, buckets: buckets, zeroIdx: zeroIdx };
-}
-
-function assignBucket(buckets, zeroIdx, entry) {
- if (!entry.out) {
- buckets[0].enqueue(entry);
- } else if (!entry["in"]) {
- buckets[buckets.length - 1].enqueue(entry);
- } else {
- buckets[entry.out - entry["in"] + zeroIdx].enqueue(entry);
- }
-}
-
-},{"./data/list":61,"./graphlib":63,"./lodash":66}],65:[function(require,module,exports){
-"use strict";
-
-var _ = require("./lodash"),
- acyclic = require("./acyclic"),
- normalize = require("./normalize"),
- rank = require("./rank"),
- normalizeRanks = require("./util").normalizeRanks,
- parentDummyChains = require("./parent-dummy-chains"),
- removeEmptyRanks = require("./util").removeEmptyRanks,
- nestingGraph = require("./nesting-graph"),
- addBorderSegments = require("./add-border-segments"),
- coordinateSystem = require("./coordinate-system"),
- order = require("./order"),
- position = require("./position"),
- util = require("./util"),
- Graph = require("./graphlib").Graph;
-
-module.exports = layout;
-
-function layout(g, opts) {
- var time = opts && opts.debugTiming ? util.time : util.notime;
- time("layout", function() {
- var layoutGraph = time(" buildLayoutGraph",
- function() { return buildLayoutGraph(g); });
- time(" runLayout", function() { runLayout(layoutGraph, time); });
- time(" updateInputGraph", function() { updateInputGraph(g, layoutGraph); });
- });
-}
-
-function runLayout(g, time) {
- time(" makeSpaceForEdgeLabels", function() { makeSpaceForEdgeLabels(g); });
- time(" removeSelfEdges", function() { removeSelfEdges(g); });
- time(" acyclic", function() { acyclic.run(g); });
- time(" nestingGraph.run", function() { nestingGraph.run(g); });
- time(" rank", function() { rank(util.asNonCompoundGraph(g)); });
- time(" injectEdgeLabelProxies", function() { injectEdgeLabelProxies(g); });
- time(" removeEmptyRanks", function() { removeEmptyRanks(g); });
- time(" nestingGraph.cleanup", function() { nestingGraph.cleanup(g); });
- time(" normalizeRanks", function() { normalizeRanks(g); });
- time(" assignRankMinMax", function() { assignRankMinMax(g); });
- time(" removeEdgeLabelProxies", function() { removeEdgeLabelProxies(g); });
- time(" normalize.run", function() { normalize.run(g); });
- time(" parentDummyChains", function() { parentDummyChains(g); });
- time(" addBorderSegments", function() { addBorderSegments(g); });
- time(" order", function() { order(g); });
- time(" insertSelfEdges", function() { insertSelfEdges(g); });
- time(" adjustCoordinateSystem", function() { coordinateSystem.adjust(g); });
- time(" position", function() { position(g); });
- time(" positionSelfEdges", function() { positionSelfEdges(g); });
- time(" removeBorderNodes", function() { removeBorderNodes(g); });
- time(" normalize.undo", function() { normalize.undo(g); });
- time(" fixupEdgeLabelCoords", function() { fixupEdgeLabelCoords(g); });
- time(" undoCoordinateSystem", function() { coordinateSystem.undo(g); });
- time(" translateGraph", function() { translateGraph(g); });
- time(" assignNodeIntersects", function() { assignNodeIntersects(g); });
- time(" reversePoints", function() { reversePointsForReversedEdges(g); });
- time(" acyclic.undo", function() { acyclic.undo(g); });
-}
-
-/*
- * Copies final layout information from the layout graph back to the input
- * graph. This process only copies whitelisted attributes from the layout graph
- * to the input graph, so it serves as a good place to determine what
- * attributes can influence layout.
- */
-function updateInputGraph(inputGraph, layoutGraph) {
- _.each(inputGraph.nodes(), function(v) {
- var inputLabel = inputGraph.node(v),
- layoutLabel = layoutGraph.node(v);
-
- if (inputLabel) {
- inputLabel.x = layoutLabel.x;
- inputLabel.y = layoutLabel.y;
-
- if (layoutGraph.children(v).length) {
- inputLabel.width = layoutLabel.width;
- inputLabel.height = layoutLabel.height;
- }
- }
- });
-
- _.each(inputGraph.edges(), function(e) {
- var inputLabel = inputGraph.edge(e),
- layoutLabel = layoutGraph.edge(e);
-
- inputLabel.points = layoutLabel.points;
- if (_.has(layoutLabel, "x")) {
- inputLabel.x = layoutLabel.x;
- inputLabel.y = layoutLabel.y;
- }
- });
-
- inputGraph.graph().width = layoutGraph.graph().width;
- inputGraph.graph().height = layoutGraph.graph().height;
-}
-
-var graphNumAttrs = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"],
- graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" },
- graphAttrs = ["acyclicer", "ranker", "rankdir", "align"],
- nodeNumAttrs = ["width", "height"],
- nodeDefaults = { width: 0, height: 0 },
- edgeNumAttrs = ["minlen", "weight", "width", "height", "labeloffset"],
- edgeDefaults = {
- minlen: 1, weight: 1, width: 0, height: 0,
- labeloffset: 10, labelpos: "r"
- },
- edgeAttrs = ["labelpos"];
-
-/*
- * Constructs a new graph from the input graph, which can be used for layout.
- * This process copies only whitelisted attributes from the input graph to the
- * layout graph. Thus this function serves as a good place to determine what
- * attributes can influence layout.
- */
-function buildLayoutGraph(inputGraph) {
- var g = new Graph({ multigraph: true, compound: true }),
- graph = canonicalize(inputGraph.graph());
-
- g.setGraph(_.merge({},
- graphDefaults,
- selectNumberAttrs(graph, graphNumAttrs),
- _.pick(graph, graphAttrs)));
-
- _.each(inputGraph.nodes(), function(v) {
- var node = canonicalize(inputGraph.node(v));
- g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults));
- g.setParent(v, inputGraph.parent(v));
- });
-
- _.each(inputGraph.edges(), function(e) {
- var edge = canonicalize(inputGraph.edge(e));
- g.setEdge(e, _.merge({},
- edgeDefaults,
- selectNumberAttrs(edge, edgeNumAttrs),
- _.pick(edge, edgeAttrs)));
- });
-
- return g;
-}
-
-/*
- * This idea comes from the Gansner paper: to account for edge labels in our
- * layout we split each rank in half by doubling minlen and halving ranksep.
- * Then we can place labels at these mid-points between nodes.
- *
- * We also add some minimal padding to the width to push the label for the edge
- * away from the edge itself a bit.
- */
-function makeSpaceForEdgeLabels(g) {
- var graph = g.graph();
- graph.ranksep /= 2;
- _.each(g.edges(), function(e) {
- var edge = g.edge(e);
- edge.minlen *= 2;
- if (edge.labelpos.toLowerCase() !== "c") {
- if (graph.rankdir === "TB" || graph.rankdir === "BT") {
- edge.width += edge.labeloffset;
- } else {
- edge.height += edge.labeloffset;
- }
- }
- });
-}
-
-/*
- * Creates temporary dummy nodes that capture the rank in which each edge's
- * label is going to, if it has one of non-zero width and height. We do this
- * so that we can safely remove empty ranks while preserving balance for the
- * label's position.
- */
-function injectEdgeLabelProxies(g) {
- _.each(g.edges(), function(e) {
- var edge = g.edge(e);
- if (edge.width && edge.height) {
- var v = g.node(e.v),
- w = g.node(e.w),
- label = { rank: (w.rank - v.rank) / 2 + v.rank, e: e };
- util.addDummyNode(g, "edge-proxy", label, "_ep");
- }
- });
-}
-
-function assignRankMinMax(g) {
- var maxRank = 0;
- _.each(g.nodes(), function(v) {
- var node = g.node(v);
- if (node.borderTop) {
- node.minRank = g.node(node.borderTop).rank;
- node.maxRank = g.node(node.borderBottom).rank;
- maxRank = _.max(maxRank, node.maxRank);
- }
- });
- g.graph().maxRank = maxRank;
-}
-
-function removeEdgeLabelProxies(g) {
- _.each(g.nodes(), function(v) {
- var node = g.node(v);
- if (node.dummy === "edge-proxy") {
- g.edge(node.e).labelRank = node.rank;
- g.removeNode(v);
- }
- });
-}
-
-function translateGraph(g) {
- var minX = Number.POSITIVE_INFINITY,
- maxX = 0,
- minY = Number.POSITIVE_INFINITY,
- maxY = 0,
- graphLabel = g.graph(),
- marginX = graphLabel.marginx || 0,
- marginY = graphLabel.marginy || 0;
-
- function getExtremes(attrs) {
- var x = attrs.x,
- y = attrs.y,
- w = attrs.width,
- h = attrs.height;
- minX = Math.min(minX, x - w / 2);
- maxX = Math.max(maxX, x + w / 2);
- minY = Math.min(minY, y - h / 2);
- maxY = Math.max(maxY, y + h / 2);
- }
-
- _.each(g.nodes(), function(v) { getExtremes(g.node(v)); });
- _.each(g.edges(), function(e) {
- var edge = g.edge(e);
- if (_.has(edge, "x")) {
- getExtremes(edge);
- }
- });
-
- minX -= marginX;
- minY -= marginY;
-
- _.each(g.nodes(), function(v) {
- var node = g.node(v);
- node.x -= minX;
- node.y -= minY;
- });
-
- _.each(g.edges(), function(e) {
- var edge = g.edge(e);
- _.each(edge.points, function(p) {
- p.x -= minX;
- p.y -= minY;
- });
- if (_.has(edge, "x")) { edge.x -= minX; }
- if (_.has(edge, "y")) { edge.y -= minY; }
- });
-
- graphLabel.width = maxX - minX + marginX;
- graphLabel.height = maxY - minY + marginY;
-}
-
-function assignNodeIntersects(g) {
- _.each(g.edges(), function(e) {
- var edge = g.edge(e),
- nodeV = g.node(e.v),
- nodeW = g.node(e.w),
- p1, p2;
- if (!edge.points) {
- edge.points = [];
- p1 = nodeW;
- p2 = nodeV;
- } else {
- p1 = edge.points[0];
- p2 = edge.points[edge.points.length - 1];
- }
- edge.points.unshift(util.intersectRect(nodeV, p1));
- edge.points.push(util.intersectRect(nodeW, p2));
- });
-}
-
-function fixupEdgeLabelCoords(g) {
- _.each(g.edges(), function(e) {
- var edge = g.edge(e);
- if (_.has(edge, "x")) {
- if (edge.labelpos === "l" || edge.labelpos === "r") {
- edge.width -= edge.labeloffset;
- }
- switch (edge.labelpos) {
- case "l": edge.x -= edge.width / 2 + edge.labeloffset; break;
- case "r": edge.x += edge.width / 2 + edge.labeloffset; break;
- }
- }
- });
-}
-
-function reversePointsForReversedEdges(g) {
- _.each(g.edges(), function(e) {
- var edge = g.edge(e);
- if (edge.reversed) {
- edge.points.reverse();
- }
- });
-}
-
-function removeBorderNodes(g) {
- _.each(g.nodes(), function(v) {
- if (g.children(v).length) {
- var node = g.node(v),
- t = g.node(node.borderTop),
- b = g.node(node.borderBottom),
- l = g.node(_.last(node.borderLeft)),
- r = g.node(_.last(node.borderRight));
-
- node.width = Math.abs(r.x - l.x);
- node.height = Math.abs(b.y - t.y);
- node.x = l.x + node.width / 2;
- node.y = t.y + node.height / 2;
- }
- });
-
- _.each(g.nodes(), function(v) {
- if (g.node(v).dummy === "border") {
- g.removeNode(v);
- }
- });
-}
-
-function removeSelfEdges(g) {
- _.each(g.edges(), function(e) {
- if (e.v === e.w) {
- var node = g.node(e.v);
- if (!node.selfEdges) {
- node.selfEdges = [];
- }
- node.selfEdges.push({ e: e, label: g.edge(e) });
- g.removeEdge(e);
- }
- });
-}
-
-function insertSelfEdges(g) {
- var layers = util.buildLayerMatrix(g);
- _.each(layers, function(layer) {
- var orderShift = 0;
- _.each(layer, function(v, i) {
- var node = g.node(v);
- node.order = i + orderShift;
- _.each(node.selfEdges, function(selfEdge) {
- util.addDummyNode(g, "selfedge", {
- width: selfEdge.label.width,
- height: selfEdge.label.height,
- rank: node.rank,
- order: i + (++orderShift),
- e: selfEdge.e,
- label: selfEdge.label
- }, "_se");
- });
- delete node.selfEdges;
- });
- });
-}
-
-function positionSelfEdges(g) {
- _.each(g.nodes(), function(v) {
- var node = g.node(v);
- if (node.dummy === "selfedge") {
- var selfNode = g.node(node.e.v),
- x = selfNode.x + selfNode.width / 2,
- y = selfNode.y,
- dx = node.x - x,
- dy = selfNode.height / 2;
- g.setEdge(node.e, node.label);
- g.removeNode(v);
- node.label.points = [
- { x: x + 2 * dx / 3, y: y - dy },
- { x: x + 5 * dx / 6, y: y - dy },
- { x: x + dx , y: y },
- { x: x + 5 * dx / 6, y: y + dy },
- { x: x + 2 * dx / 3, y: y + dy },
- ];
- node.label.x = node.x;
- node.label.y = node.y;
- }
- });
-}
-
-function selectNumberAttrs(obj, attrs) {
- return _.mapValues(_.pick(obj, attrs), Number);
-}
-
-function canonicalize(attrs) {
- var newAttrs = {};
- _.each(attrs, function(v, k) {
- newAttrs[k.toLowerCase()] = v;
- });
- return newAttrs;
-}
-
-},{"./acyclic":58,"./add-border-segments":59,"./coordinate-system":60,"./graphlib":63,"./lodash":66,"./nesting-graph":67,"./normalize":68,"./order":73,"./parent-dummy-chains":78,"./position":80,"./rank":82,"./util":85}],66:[function(require,module,exports){
-arguments[4][55][0].apply(exports,arguments)
-},{"dup":55,"lodash":87}],67:[function(require,module,exports){
-var _ = require("./lodash"),
- util = require("./util");
-
-module.exports = {
- run: run,
- cleanup: cleanup
-};
-
-/*
- * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs,
- * adds appropriate edges to ensure that all cluster nodes are placed between
- * these boundries, and ensures that the graph is connected.
- *
- * In addition we ensure, through the use of the minlen property, that nodes
- * and subgraph border nodes to not end up on the same rank.
- *
- * Preconditions:
- *
- * 1. Input graph is a DAG
- * 2. Nodes in the input graph has a minlen attribute
- *
- * Postconditions:
- *
- * 1. Input graph is connected.
- * 2. Dummy nodes are added for the tops and bottoms of subgraphs.
- * 3. The minlen attribute for nodes is adjusted to ensure nodes do not
- * get placed on the same rank as subgraph border nodes.
- *
- * The nesting graph idea comes from Sander, "Layout of Compound Directed
- * Graphs."
- */
-function run(g) {
- var root = util.addDummyNode(g, "root", {}, "_root"),
- depths = treeDepths(g),
- height = _.max(depths) - 1,
- nodeSep = 2 * height + 1;
-
- g.graph().nestingRoot = root;
-
- // Multiply minlen by nodeSep to align nodes on non-border ranks.
- _.each(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; });
-
- // Calculate a weight that is sufficient to keep subgraphs vertically compact
- var weight = sumWeights(g) + 1;
-
- // Create border nodes and link them up
- _.each(g.children(), function(child) {
- dfs(g, root, nodeSep, weight, height, depths, child);
- });
-
- // Save the multiplier for node layers for later removal of empty border
- // layers.
- g.graph().nodeRankFactor = nodeSep;
-}
-
-function dfs(g, root, nodeSep, weight, height, depths, v) {
- var children = g.children(v);
- if (!children.length) {
- if (v !== root) {
- g.setEdge(root, v, { weight: 0, minlen: nodeSep });
- }
- return;
- }
-
- var top = util.addBorderNode(g, "_bt"),
- bottom = util.addBorderNode(g, "_bb"),
- label = g.node(v);
-
- g.setParent(top, v);
- label.borderTop = top;
- g.setParent(bottom, v);
- label.borderBottom = bottom;
-
- _.each(children, function(child) {
- dfs(g, root, nodeSep, weight, height, depths, child);
-
- var childNode = g.node(child),
- childTop = childNode.borderTop ? childNode.borderTop : child,
- childBottom = childNode.borderBottom ? childNode.borderBottom : child,
- thisWeight = childNode.borderTop ? weight : 2 * weight,
- minlen = childTop !== childBottom ? 1 : height - depths[v] + 1;
-
- g.setEdge(top, childTop, {
- weight: thisWeight,
- minlen: minlen,
- nestingEdge: true
- });
-
- g.setEdge(childBottom, bottom, {
- weight: thisWeight,
- minlen: minlen,
- nestingEdge: true
- });
- });
-
- if (!g.parent(v)) {
- g.setEdge(root, top, { weight: 0, minlen: height + depths[v] });
- }
-}
-
-function treeDepths(g) {
- var depths = {};
- function dfs(v, depth) {
- var children = g.children(v);
- if (children && children.length) {
- _.each(children, function(child) {
- dfs(child, depth + 1);
- });
- }
- depths[v] = depth;
- }
- _.each(g.children(), function(v) { dfs(v, 1); });
- return depths;
-}
-
-function sumWeights(g) {
- return _.reduce(g.edges(), function(acc, e) {
- return acc + g.edge(e).weight;
- }, 0);
-}
-
-function cleanup(g) {
- var graphLabel = g.graph();
- g.removeNode(graphLabel.nestingRoot);
- delete graphLabel.nestingRoot;
- _.each(g.edges(), function(e) {
- var edge = g.edge(e);
- if (edge.nestingEdge) {
- g.removeEdge(e);
- }
- });
-}
-
-},{"./lodash":66,"./util":85}],68:[function(require,module,exports){
-"use strict";
-
-var _ = require("./lodash"),
- util = require("./util");
-
-module.exports = {
- run: run,
- undo: undo
-};
-
-/*
- * Breaks any long edges in the graph into short segments that span 1 layer
- * each. This operation is undoable with the denormalize function.
- *
- * Pre-conditions:
- *
- * 1. The input graph is a DAG.
- * 2. Each node in the graph has a "rank" property.
- *
- * Post-condition:
- *
- * 1. All edges in the graph have a length of 1.
- * 2. Dummy nodes are added where edges have been split into segments.
- * 3. The graph is augmented with a "dummyChains" attribute which contains
- * the first dummy in each chain of dummy nodes produced.
- */
-function run(g) {
- g.graph().dummyChains = [];
- _.each(g.edges(), function(edge) { normalizeEdge(g, edge); });
-}
-
-function normalizeEdge(g, e) {
- var v = e.v,
- vRank = g.node(v).rank,
- w = e.w,
- wRank = g.node(w).rank,
- name = e.name,
- edgeLabel = g.edge(e),
- labelRank = edgeLabel.labelRank;
-
- if (wRank === vRank + 1) return;
-
- g.removeEdge(e);
-
- var dummy, attrs, i;
- for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) {
- edgeLabel.points = [];
- attrs = {
- width: 0, height: 0,
- edgeLabel: edgeLabel, edgeObj: e,
- rank: vRank
- };
- dummy = util.addDummyNode(g, "edge", attrs, "_d");
- if (vRank === labelRank) {
- attrs.width = edgeLabel.width;
- attrs.height = edgeLabel.height;
- attrs.dummy = "edge-label";
- attrs.labelpos = edgeLabel.labelpos;
- }
- g.setEdge(v, dummy, { weight: edgeLabel.weight }, name);
- if (i === 0) {
- g.graph().dummyChains.push(dummy);
- }
- v = dummy;
- }
-
- g.setEdge(v, w, { weight: edgeLabel.weight }, name);
-}
-
-function undo(g) {
- _.each(g.graph().dummyChains, function(v) {
- var node = g.node(v),
- origLabel = node.edgeLabel,
- w;
- g.setEdge(node.edgeObj, origLabel);
- while (node.dummy) {
- w = g.successors(v)[0];
- g.removeNode(v);
- origLabel.points.push({ x: node.x, y: node.y });
- if (node.dummy === "edge-label") {
- origLabel.x = node.x;
- origLabel.y = node.y;
- origLabel.width = node.width;
- origLabel.height = node.height;
- }
- v = w;
- node = g.node(v);
- }
- });
-}
-
-},{"./lodash":66,"./util":85}],69:[function(require,module,exports){
-var _ = require("../lodash");
-
-module.exports = addSubgraphConstraints;
-
-function addSubgraphConstraints(g, cg, vs) {
- var prev = {},
- rootPrev;
-
- _.each(vs, function(v) {
- var child = g.parent(v),
- parent,
- prevChild;
- while (child) {
- parent = g.parent(child);
- if (parent) {
- prevChild = prev[parent];
- prev[parent] = child;
- } else {
- prevChild = rootPrev;
- rootPrev = child;
- }
- if (prevChild && prevChild !== child) {
- cg.setEdge(prevChild, child);
- return;
- }
- child = parent;
- }
- });
-
- /*
- function dfs(v) {
- var children = v ? g.children(v) : g.children();
- if (children.length) {
- var min = Number.POSITIVE_INFINITY,
- subgraphs = [];
- _.each(children, function(child) {
- var childMin = dfs(child);
- if (g.children(child).length) {
- subgraphs.push({ v: child, order: childMin });
- }
- min = Math.min(min, childMin);
- });
- _.reduce(_.sortBy(subgraphs, "order"), function(prev, curr) {
- cg.setEdge(prev.v, curr.v);
- return curr;
- });
- return min;
- }
- return g.node(v).order;
- }
- dfs(undefined);
- */
-}
-
-},{"../lodash":66}],70:[function(require,module,exports){
-var _ = require("../lodash");
-
-module.exports = barycenter;
-
-function barycenter(g, movable) {
- return _.map(movable, function(v) {
- var inV = g.inEdges(v);
- if (!inV.length) {
- return { v: v };
- } else {
- var result = _.reduce(inV, function(acc, e) {
- var edge = g.edge(e),
- nodeU = g.node(e.v);
- return {
- sum: acc.sum + (edge.weight * nodeU.order),
- weight: acc.weight + edge.weight
- };
- }, { sum: 0, weight: 0 });
-
- return {
- v: v,
- barycenter: result.sum / result.weight,
- weight: result.weight
- };
- }
- });
-}
-
-
-},{"../lodash":66}],71:[function(require,module,exports){
-var _ = require("../lodash"),
- Graph = require("../graphlib").Graph;
-
-module.exports = buildLayerGraph;
-
-/*
- * Constructs a graph that can be used to sort a layer of nodes. The graph will
- * contain all base and subgraph nodes from the request layer in their original
- * hierarchy and any edges that are incident on these nodes and are of the type
- * requested by the "relationship" parameter.
- *
- * Nodes from the requested rank that do not have parents are assigned a root
- * node in the output graph, which is set in the root graph attribute. This
- * makes it easy to walk the hierarchy of movable nodes during ordering.
- *
- * Pre-conditions:
- *
- * 1. Input graph is a DAG
- * 2. Base nodes in the input graph have a rank attribute
- * 3. Subgraph nodes in the input graph has minRank and maxRank attributes
- * 4. Edges have an assigned weight
- *
- * Post-conditions:
- *
- * 1. Output graph has all nodes in the movable rank with preserved
- * hierarchy.
- * 2. Root nodes in the movable layer are made children of the node
- * indicated by the root attribute of the graph.
- * 3. Non-movable nodes incident on movable nodes, selected by the
- * relationship parameter, are included in the graph (without hierarchy).
- * 4. Edges incident on movable nodes, selected by the relationship
- * parameter, are added to the output graph.
- * 5. The weights for copied edges are aggregated as need, since the output
- * graph is not a multi-graph.
- */
-function buildLayerGraph(g, rank, relationship) {
- var root = createRootNode(g),
- result = new Graph({ compound: true }).setGraph({ root: root })
- .setDefaultNodeLabel(function(v) { return g.node(v); });
-
- _.each(g.nodes(), function(v) {
- var node = g.node(v),
- parent = g.parent(v);
-
- if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) {
- result.setNode(v);
- result.setParent(v, parent || root);
-
- // This assumes we have only short edges!
- _.each(g[relationship](v), function(e) {
- var u = e.v === v ? e.w : e.v,
- edge = result.edge(u, v),
- weight = !_.isUndefined(edge) ? edge.weight : 0;
- result.setEdge(u, v, { weight: g.edge(e).weight + weight });
- });
-
- if (_.has(node, "minRank")) {
- result.setNode(v, {
- borderLeft: node.borderLeft[rank],
- borderRight: node.borderRight[rank]
- });
- }
- }
- });
-
- return result;
-}
-
-function createRootNode(g) {
- var v;
- while (g.hasNode((v = _.uniqueId("_root"))));
- return v;
-}
-
-},{"../graphlib":63,"../lodash":66}],72:[function(require,module,exports){
-"use strict";
-
-var _ = require("../lodash");
-
-module.exports = crossCount;
-
-/*
- * A function that takes a layering (an array of layers, each with an array of
- * ordererd nodes) and a graph and returns a weighted crossing count.
- *
- * Pre-conditions:
- *
- * 1. Input graph must be simple (not a multigraph), directed, and include
- * only simple edges.
- * 2. Edges in the input graph must have assigned weights.
- *
- * Post-conditions:
- *
- * 1. The graph and layering matrix are left unchanged.
- *
- * This algorithm is derived from Barth, et al., "Bilayer Cross Counting."
- */
-function crossCount(g, layering) {
- var cc = 0;
- for (var i = 1; i < layering.length; ++i) {
- cc += twoLayerCrossCount(g, layering[i-1], layering[i]);
- }
- return cc;
-}
-
-function twoLayerCrossCount(g, northLayer, southLayer) {
- // Sort all of the edges between the north and south layers by their position
- // in the north layer and then the south. Map these edges to the position of
- // their head in the south layer.
- var southPos = _.zipObject(southLayer,
- _.map(southLayer, function (v, i) { return i; }));
- var southEntries = _.flatten(_.map(northLayer, function(v) {
- return _.chain(g.outEdges(v))
- .map(function(e) {
- return { pos: southPos[e.w], weight: g.edge(e).weight };
- })
- .sortBy("pos")
- .value();
- }), true);
-
- // Build the accumulator tree
- var firstIndex = 1;
- while (firstIndex < southLayer.length) firstIndex <<= 1;
- var treeSize = 2 * firstIndex - 1;
- firstIndex -= 1;
- var tree = _.map(new Array(treeSize), function() { return 0; });
-
- // Calculate the weighted crossings
- var cc = 0;
- _.each(southEntries.forEach(function(entry) {
- var index = entry.pos + firstIndex;
- tree[index] += entry.weight;
- var weightSum = 0;
- while (index > 0) {
- if (index % 2) {
- weightSum += tree[index + 1];
- }
- index = (index - 1) >> 1;
- tree[index] += entry.weight;
- }
- cc += entry.weight * weightSum;
- }));
-
- return cc;
-}
-
-},{"../lodash":66}],73:[function(require,module,exports){
-"use strict";
-
-var _ = require("../lodash"),
- initOrder = require("./init-order"),
- crossCount = require("./cross-count"),
- sortSubgraph = require("./sort-subgraph"),
- buildLayerGraph = require("./build-layer-graph"),
- addSubgraphConstraints = require("./add-subgraph-constraints"),
- Graph = require("../graphlib").Graph,
- util = require("../util");
-
-module.exports = order;
-
-/*
- * Applies heuristics to minimize edge crossings in the graph and sets the best
- * order solution as an order attribute on each node.
- *
- * Pre-conditions:
- *
- * 1. Graph must be DAG
- * 2. Graph nodes must be objects with a "rank" attribute
- * 3. Graph edges must have the "weight" attribute
- *
- * Post-conditions:
- *
- * 1. Graph nodes will have an "order" attribute based on the results of the
- * algorithm.
- */
-function order(g) {
- var maxRank = util.maxRank(g),
- downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), "inEdges"),
- upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), "outEdges");
-
- var layering = initOrder(g);
- assignOrder(g, layering);
-
- var bestCC = Number.POSITIVE_INFINITY,
- best;
-
- for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) {
- sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2);
-
- layering = util.buildLayerMatrix(g);
- var cc = crossCount(g, layering);
- if (cc < bestCC) {
- lastBest = 0;
- best = _.cloneDeep(layering);
- bestCC = cc;
- }
- }
-
- assignOrder(g, best);
-}
-
-function buildLayerGraphs(g, ranks, relationship) {
- return _.map(ranks, function(rank) {
- return buildLayerGraph(g, rank, relationship);
- });
-}
-
-function sweepLayerGraphs(layerGraphs, biasRight) {
- var cg = new Graph();
- _.each(layerGraphs, function(lg) {
- var root = lg.graph().root;
- var sorted = sortSubgraph(lg, root, cg, biasRight);
- _.each(sorted.vs, function(v, i) {
- lg.node(v).order = i;
- });
- addSubgraphConstraints(lg, cg, sorted.vs);
- });
-}
-
-function assignOrder(g, layering) {
- _.each(layering, function(layer) {
- _.each(layer, function(v, i) {
- g.node(v).order = i;
- });
- });
-}
-
-},{"../graphlib":63,"../lodash":66,"../util":85,"./add-subgraph-constraints":69,"./build-layer-graph":71,"./cross-count":72,"./init-order":74,"./sort-subgraph":76}],74:[function(require,module,exports){
-"use strict";
-
-var _ = require("../lodash");
-
-module.exports = initOrder;
-
-/*
- * Assigns an initial order value for each node by performing a DFS search
- * starting from nodes in the first rank. Nodes are assigned an order in their
- * rank as they are first visited.
- *
- * This approach comes from Gansner, et al., "A Technique for Drawing Directed
- * Graphs."
- *
- * Returns a layering matrix with an array per layer and each layer sorted by
- * the order of its nodes.
- */
-function initOrder(g) {
- var visited = {},
- simpleNodes = _.filter(g.nodes(), function(v) {
- return !g.children(v).length;
- }),
- maxRank = _.max(_.map(simpleNodes, function(v) { return g.node(v).rank; })),
- layers = _.map(_.range(maxRank + 1), function() { return []; });
-
- function dfs(v) {
- if (_.has(visited, v)) return;
- visited[v] = true;
- var node = g.node(v);
- layers[node.rank].push(v);
- _.each(g.successors(v), dfs);
- }
-
- var orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v).rank; });
- _.each(orderedVs, dfs);
-
- return layers;
-}
-
-},{"../lodash":66}],75:[function(require,module,exports){
-"use strict";
-
-var _ = require("../lodash");
-
-module.exports = resolveConflicts;
-
-/*
- * Given a list of entries of the form {v, barycenter, weight} and a
- * constraint graph this function will resolve any conflicts between the
- * constraint graph and the barycenters for the entries. If the barycenters for
- * an entry would violate a constraint in the constraint graph then we coalesce
- * the nodes in the conflict into a new node that respects the contraint and
- * aggregates barycenter and weight information.
- *
- * This implementation is based on the description in Forster, "A Fast and
- * Simple Hueristic for Constrained Two-Level Crossing Reduction," thought it
- * differs in some specific details.
- *
- * Pre-conditions:
- *
- * 1. Each entry has the form {v, barycenter, weight}, or if the node has
- * no barycenter, then {v}.
- *
- * Returns:
- *
- * A new list of entries of the form {vs, i, barycenter, weight}. The list
- * `vs` may either be a singleton or it may be an aggregation of nodes
- * ordered such that they do not violate constraints from the constraint
- * graph. The property `i` is the lowest original index of any of the
- * elements in `vs`.
- */
-function resolveConflicts(entries, cg) {
- var mappedEntries = {};
- _.each(entries, function(entry, i) {
- var tmp = mappedEntries[entry.v] = {
- indegree: 0,
- "in": [],
- out: [],
- vs: [entry.v],
- i: i
- };
- if (!_.isUndefined(entry.barycenter)) {
- tmp.barycenter = entry.barycenter;
- tmp.weight = entry.weight;
- }
- });
-
- _.each(cg.edges(), function(e) {
- var entryV = mappedEntries[e.v],
- entryW = mappedEntries[e.w];
- if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) {
- entryW.indegree++;
- entryV.out.push(mappedEntries[e.w]);
- }
- });
-
- var sourceSet = _.filter(mappedEntries, function(entry) {
- return !entry.indegree;
- });
-
- return doResolveConflicts(sourceSet);
-}
-
-function doResolveConflicts(sourceSet) {
- var entries = [];
-
- function handleIn(vEntry) {
- return function(uEntry) {
- if (uEntry.merged) {
- return;
- }
- if (_.isUndefined(uEntry.barycenter) ||
- _.isUndefined(vEntry.barycenter) ||
- uEntry.barycenter >= vEntry.barycenter) {
- mergeEntries(vEntry, uEntry);
- }
- };
- }
-
- function handleOut(vEntry) {
- return function(wEntry) {
- wEntry["in"].push(vEntry);
- if (--wEntry.indegree === 0) {
- sourceSet.push(wEntry);
- }
- };
- }
-
- while (sourceSet.length) {
- var entry = sourceSet.pop();
- entries.push(entry);
- _.each(entry["in"].reverse(), handleIn(entry));
- _.each(entry.out, handleOut(entry));
- }
-
- return _.chain(entries)
- .filter(function(entry) { return !entry.merged; })
- .map(function(entry) {
- return _.pick(entry, ["vs", "i", "barycenter", "weight"]);
- })
- .value();
-}
-
-function mergeEntries(target, source) {
- var sum = 0,
- weight = 0;
-
- if (target.weight) {
- sum += target.barycenter * target.weight;
- weight += target.weight;
- }
-
- if (source.weight) {
- sum += source.barycenter * source.weight;
- weight += source.weight;
- }
-
- target.vs = source.vs.concat(target.vs);
- target.barycenter = sum / weight;
- target.weight = weight;
- target.i = Math.min(source.i, target.i);
- source.merged = true;
-}
-
-},{"../lodash":66}],76:[function(require,module,exports){
-var _ = require("../lodash"),
- barycenter = require("./barycenter"),
- resolveConflicts = require("./resolve-conflicts"),
- sort = require("./sort");
-
-module.exports = sortSubgraph;
-
-function sortSubgraph(g, v, cg, biasRight) {
- var movable = g.children(v),
- node = g.node(v),
- bl = node ? node.borderLeft : undefined,
- br = node ? node.borderRight: undefined,
- subgraphs = {};
-
- if (bl) {
- movable = _.filter(movable, function(w) {
- return w !== bl && w !== br;
- });
- }
-
- var barycenters = barycenter(g, movable);
- _.each(barycenters, function(entry) {
- if (g.children(entry.v).length) {
- var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight);
- subgraphs[entry.v] = subgraphResult;
- if (_.has(subgraphResult, "barycenter")) {
- mergeBarycenters(entry, subgraphResult);
- }
- }
- });
-
- var entries = resolveConflicts(barycenters, cg);
- expandSubgraphs(entries, subgraphs);
-
- var result = sort(entries, biasRight);
-
- if (bl) {
- result.vs = _.flatten([bl, result.vs, br], true);
- if (g.predecessors(bl).length) {
- var blPred = g.node(g.predecessors(bl)[0]),
- brPred = g.node(g.predecessors(br)[0]);
- if (!_.has(result, "barycenter")) {
- result.barycenter = 0;
- result.weight = 0;
- }
- result.barycenter = (result.barycenter * result.weight +
- blPred.order + brPred.order) / (result.weight + 2);
- result.weight += 2;
- }
- }
-
- return result;
-}
-
-function expandSubgraphs(entries, subgraphs) {
- _.each(entries, function(entry) {
- entry.vs = _.flatten(entry.vs.map(function(v) {
- if (subgraphs[v]) {
- return subgraphs[v].vs;
- }
- return v;
- }), true);
- });
-}
-
-function mergeBarycenters(target, other) {
- if (!_.isUndefined(target.barycenter)) {
- target.barycenter = (target.barycenter * target.weight +
- other.barycenter * other.weight) /
- (target.weight + other.weight);
- target.weight += other.weight;
- } else {
- target.barycenter = other.barycenter;
- target.weight = other.weight;
- }
-}
-
-},{"../lodash":66,"./barycenter":70,"./resolve-conflicts":75,"./sort":77}],77:[function(require,module,exports){
-var _ = require("../lodash"),
- util = require("../util");
-
-module.exports = sort;
-
-function sort(entries, biasRight) {
- var parts = util.partition(entries, function(entry) {
- return _.has(entry, "barycenter");
- });
- var sortable = parts.lhs,
- unsortable = _.sortBy(parts.rhs, function(entry) { return -entry.i; }),
- vs = [],
- sum = 0,
- weight = 0,
- vsIndex = 0;
-
- sortable.sort(compareWithBias(!!biasRight));
-
- vsIndex = consumeUnsortable(vs, unsortable, vsIndex);
-
- _.each(sortable, function (entry) {
- vsIndex += entry.vs.length;
- vs.push(entry.vs);
- sum += entry.barycenter * entry.weight;
- weight += entry.weight;
- vsIndex = consumeUnsortable(vs, unsortable, vsIndex);
- });
-
- var result = { vs: _.flatten(vs, true) };
- if (weight) {
- result.barycenter = sum / weight;
- result.weight = weight;
- }
- return result;
-}
-
-function consumeUnsortable(vs, unsortable, index) {
- var last;
- while (unsortable.length && (last = _.last(unsortable)).i <= index) {
- unsortable.pop();
- vs.push(last.vs);
- index++;
- }
- return index;
-}
-
-function compareWithBias(bias) {
- return function(entryV, entryW) {
- if (entryV.barycenter < entryW.barycenter) {
- return -1;
- } else if (entryV.barycenter > entryW.barycenter) {
- return 1;
- }
-
- return !bias ? entryV.i - entryW.i : entryW.i - entryV.i;
- };
-}
-
-},{"../lodash":66,"../util":85}],78:[function(require,module,exports){
-var _ = require("./lodash");
-
-module.exports = parentDummyChains;
-
-function parentDummyChains(g) {
- var postorderNums = postorder(g);
-
- _.each(g.graph().dummyChains, function(v) {
- var node = g.node(v),
- edgeObj = node.edgeObj,
- pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w),
- path = pathData.path,
- lca = pathData.lca,
- pathIdx = 0,
- pathV = path[pathIdx],
- ascending = true;
-
- while (v !== edgeObj.w) {
- node = g.node(v);
-
- if (ascending) {
- while ((pathV = path[pathIdx]) !== lca &&
- g.node(pathV).maxRank < node.rank) {
- pathIdx++;
- }
-
- if (pathV === lca) {
- ascending = false;
- }
- }
-
- if (!ascending) {
- while (pathIdx < path.length - 1 &&
- g.node(pathV = path[pathIdx + 1]).minRank <= node.rank) {
- pathIdx++;
- }
- pathV = path[pathIdx];
- }
-
- g.setParent(v, pathV);
- v = g.successors(v)[0];
- }
- });
-}
-
-// Find a path from v to w through the lowest common ancestor (LCA). Return the
-// full path and the LCA.
-function findPath(g, postorderNums, v, w) {
- var vPath = [],
- wPath = [],
- low = Math.min(postorderNums[v].low, postorderNums[w].low),
- lim = Math.max(postorderNums[v].lim, postorderNums[w].lim),
- parent,
- lca;
-
- // Traverse up from v to find the LCA
- parent = v;
- do {
- parent = g.parent(parent);
- vPath.push(parent);
- } while (parent &&
- (postorderNums[parent].low > low || lim > postorderNums[parent].lim));
- lca = parent;
-
- // Traverse from w to LCA
- parent = w;
- while ((parent = g.parent(parent)) !== lca) {
- wPath.push(parent);
- }
-
- return { path: vPath.concat(wPath.reverse()), lca: lca };
-}
-
-function postorder(g) {
- var result = {},
- lim = 0;
-
- function dfs(v) {
- var low = lim;
- _.each(g.children(v), dfs);
- result[v] = { low: low, lim: lim++ };
- }
- _.each(g.children(), dfs);
-
- return result;
-}
-
-},{"./lodash":66}],79:[function(require,module,exports){
-"use strict";
-
-var _ = require("../lodash"),
- Graph = require("../graphlib").Graph,
- util = require("../util");
-
-/*
- * This module provides coordinate assignment based on Brandes and Köpf, "Fast
- * and Simple Horizontal Coordinate Assignment."
- */
-
-module.exports = {
- positionX: positionX,
- findType1Conflicts: findType1Conflicts,
- findType2Conflicts: findType2Conflicts,
- addConflict: addConflict,
- hasConflict: hasConflict,
- verticalAlignment: verticalAlignment,
- horizontalCompaction: horizontalCompaction,
- alignCoordinates: alignCoordinates,
- findSmallestWidthAlignment: findSmallestWidthAlignment,
- balance: balance
-};
-
-/*
- * Marks all edges in the graph with a type-1 conflict with the "type1Conflict"
- * property. A type-1 conflict is one where a non-inner segment crosses an
- * inner segment. An inner segment is an edge with both incident nodes marked
- * with the "dummy" property.
- *
- * This algorithm scans layer by layer, starting with the second, for type-1
- * conflicts between the current layer and the previous layer. For each layer
- * it scans the nodes from left to right until it reaches one that is incident
- * on an inner segment. It then scans predecessors to determine if they have
- * edges that cross that inner segment. At the end a final scan is done for all
- * nodes on the current rank to see if they cross the last visited inner
- * segment.
- *
- * This algorithm (safely) assumes that a dummy node will only be incident on a
- * single node in the layers being scanned.
- */
-function findType1Conflicts(g, layering) {
- var conflicts = {};
-
- function visitLayer(prevLayer, layer) {
- var
- // last visited node in the previous layer that is incident on an inner
- // segment.
- k0 = 0,
- // Tracks the last node in this layer scanned for crossings with a type-1
- // segment.
- scanPos = 0,
- prevLayerLength = prevLayer.length,
- lastNode = _.last(layer);
-
- _.each(layer, function(v, i) {
- var w = findOtherInnerSegmentNode(g, v),
- k1 = w ? g.node(w).order : prevLayerLength;
-
- if (w || v === lastNode) {
- _.each(layer.slice(scanPos, i +1), function(scanNode) {
- _.each(g.predecessors(scanNode), function(u) {
- var uLabel = g.node(u),
- uPos = uLabel.order;
- if ((uPos < k0 || k1 < uPos) &&
- !(uLabel.dummy && g.node(scanNode).dummy)) {
- addConflict(conflicts, u, scanNode);
- }
- });
- });
- scanPos = i + 1;
- k0 = k1;
- }
- });
-
- return layer;
- }
-
- _.reduce(layering, visitLayer);
- return conflicts;
-}
-
-function findType2Conflicts(g, layering) {
- var conflicts = {};
-
- function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) {
- var v;
- _.each(_.range(southPos, southEnd), function(i) {
- v = south[i];
- if (g.node(v).dummy) {
- _.each(g.predecessors(v), function(u) {
- var uNode = g.node(u);
- if (uNode.dummy &&
- (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) {
- addConflict(conflicts, u, v);
- }
- });
- }
- });
- }
-
-
- function visitLayer(north, south) {
- var prevNorthPos = -1,
- nextNorthPos,
- southPos = 0;
-
- _.each(south, function(v, southLookahead) {
- if (g.node(v).dummy === "border") {
- var predecessors = g.predecessors(v);
- if (predecessors.length) {
- nextNorthPos = g.node(predecessors[0]).order;
- scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos);
- southPos = southLookahead;
- prevNorthPos = nextNorthPos;
- }
- }
- scan(south, southPos, south.length, nextNorthPos, north.length);
- });
-
- return south;
- }
-
- _.reduce(layering, visitLayer);
- return conflicts;
-}
-
-function findOtherInnerSegmentNode(g, v) {
- if (g.node(v).dummy) {
- return _.find(g.predecessors(v), function(u) {
- return g.node(u).dummy;
- });
- }
-}
-
-function addConflict(conflicts, v, w) {
- if (v > w) {
- var tmp = v;
- v = w;
- w = tmp;
- }
-
- var conflictsV = conflicts[v];
- if (!conflictsV) {
- conflicts[v] = conflictsV = {};
- }
- conflictsV[w] = true;
-}
-
-function hasConflict(conflicts, v, w) {
- if (v > w) {
- var tmp = v;
- v = w;
- w = tmp;
- }
- return _.has(conflicts[v], w);
-}
-
-/*
- * Try to align nodes into vertical "blocks" where possible. This algorithm
- * attempts to align a node with one of its median neighbors. If the edge
- * connecting a neighbor is a type-1 conflict then we ignore that possibility.
- * If a previous node has already formed a block with a node after the node
- * we're trying to form a block with, we also ignore that possibility - our
- * blocks would be split in that scenario.
- */
-function verticalAlignment(g, layering, conflicts, neighborFn) {
- var root = {},
- align = {},
- pos = {};
-
- // We cache the position here based on the layering because the graph and
- // layering may be out of sync. The layering matrix is manipulated to
- // generate different extreme alignments.
- _.each(layering, function(layer) {
- _.each(layer, function(v, order) {
- root[v] = v;
- align[v] = v;
- pos[v] = order;
- });
- });
-
- _.each(layering, function(layer) {
- var prevIdx = -1;
- _.each(layer, function(v) {
- var ws = neighborFn(v);
- if (ws.length) {
- ws = _.sortBy(ws, function(w) { return pos[w]; });
- var mp = (ws.length - 1) / 2;
- for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) {
- var w = ws[i];
- if (align[v] === v &&
- prevIdx < pos[w] &&
- !hasConflict(conflicts, v, w)) {
- align[w] = v;
- align[v] = root[v] = root[w];
- prevIdx = pos[w];
- }
- }
- }
- });
- });
-
- return { root: root, align: align };
-}
-
-function horizontalCompaction(g, layering, root, align, reverseSep) {
- // This portion of the algorithm differs from BK due to a number of problems.
- // Instead of their algorithm we construct a new block graph and do two
- // sweeps. The first sweep places blocks with the smallest possible
- // coordinates. The second sweep removes unused space by moving blocks to the
- // greatest coordinates without violating separation.
- var xs = {},
- blockG = buildBlockGraph(g, layering, root, reverseSep);
-
- // First pass, assign smallest coordinates via DFS
- var visited = {};
- function pass1(v) {
- if (!_.has(visited, v)) {
- visited[v] = true;
- xs[v] = _.reduce(blockG.inEdges(v), function(max, e) {
- pass1(e.v);
- return Math.max(max, xs[e.v] + blockG.edge(e));
- }, 0);
- }
- }
- _.each(blockG.nodes(), pass1);
-
- var borderType = reverseSep ? "borderLeft" : "borderRight";
- function pass2(v) {
- if (visited[v] !== 2) {
- visited[v]++;
- var node = g.node(v);
- var min = _.reduce(blockG.outEdges(v), function(min, e) {
- pass2(e.w);
- return Math.min(min, xs[e.w] - blockG.edge(e));
- }, Number.POSITIVE_INFINITY);
- if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) {
- xs[v] = Math.max(xs[v], min);
- }
- }
- }
- _.each(blockG.nodes(), pass2);
-
- // Assign x coordinates to all nodes
- _.each(align, function(v) {
- xs[v] = xs[root[v]];
- });
-
- return xs;
-}
-
-
-function buildBlockGraph(g, layering, root, reverseSep) {
- var blockGraph = new Graph(),
- graphLabel = g.graph(),
- sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep);
-
- _.each(layering, function(layer) {
- var u;
- _.each(layer, function(v) {
- var vRoot = root[v];
- blockGraph.setNode(vRoot);
- if (u) {
- var uRoot = root[u],
- prevMax = blockGraph.edge(uRoot, vRoot);
- blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0));
- }
- u = v;
- });
- });
-
- return blockGraph;
-}
-
-/*
- * Returns the alignment that has the smallest width of the given alignments.
- */
-function findSmallestWidthAlignment(g, xss) {
- return _.min(xss, function(xs) {
- var min = _.min(xs, function(x, v) { return x - width(g, v) / 2; }),
- max = _.max(xs, function(x, v) { return x + width(g, v) / 2; });
- return max - min;
- });
-}
-
-/*
- * Align the coordinates of each of the layout alignments such that
- * left-biased alignments have their minimum coordinate at the same point as
- * the minimum coordinate of the smallest width alignment and right-biased
- * alignments have their maximum coordinate at the same point as the maximum
- * coordinate of the smallest width alignment.
- */
-function alignCoordinates(xss, alignTo) {
- var alignToMin = _.min(alignTo),
- alignToMax = _.max(alignTo);
-
- _.each(["u", "d"], function(vert) {
- _.each(["l", "r"], function(horiz) {
- var alignment = vert + horiz,
- xs = xss[alignment],
- delta;
- if (xs === alignTo) return;
-
- delta = horiz === "l" ? alignToMin - _.min(xs) : alignToMax - _.max(xs);
-
- if (delta) {
- xss[alignment] = _.mapValues(xs, function(x) { return x + delta; });
- }
- });
- });
-}
-
-function balance(xss, align) {
- return _.mapValues(xss.ul, function(ignore, v) {
- if (align) {
- return xss[align.toLowerCase()][v];
- } else {
- var xs = _.sortBy(_.pluck(xss, v));
- return (xs[1] + xs[2]) / 2;
- }
- });
-}
-
-function positionX(g) {
- var layering = util.buildLayerMatrix(g),
- conflicts = _.merge(findType1Conflicts(g, layering),
- findType2Conflicts(g, layering));
-
- var xss = {},
- adjustedLayering;
- _.each(["u", "d"], function(vert) {
- adjustedLayering = vert === "u" ? layering : _.values(layering).reverse();
- _.each(["l", "r"], function(horiz) {
- if (horiz === "r") {
- adjustedLayering = _.map(adjustedLayering, function(inner) {
- return _.values(inner).reverse();
- });
- }
-
- var neighborFn = _.bind(vert === "u" ? g.predecessors : g.successors, g);
- var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn);
- var xs = horizontalCompaction(g, adjustedLayering,
- align.root, align.align,
- horiz === "r");
- if (horiz === "r") {
- xs = _.mapValues(xs, function(x) { return -x; });
- }
- xss[vert + horiz] = xs;
- });
- });
-
- var smallestWidth = findSmallestWidthAlignment(g, xss);
- alignCoordinates(xss, smallestWidth);
- return balance(xss, g.graph().align);
-}
-
-function sep(nodeSep, edgeSep, reverseSep) {
- return function(g, v, w) {
- var vLabel = g.node(v),
- wLabel = g.node(w),
- sum = 0,
- delta;
-
- sum += vLabel.width / 2;
- if (_.has(vLabel, "labelpos")) {
- switch (vLabel.labelpos.toLowerCase()) {
- case "l": delta = -vLabel.width / 2; break;
- case "r": delta = vLabel.width / 2; break;
- }
- }
- if (delta) {
- sum += reverseSep ? delta : -delta;
- }
- delta = 0;
-
- sum += (vLabel.dummy ? edgeSep : nodeSep) / 2;
- sum += (wLabel.dummy ? edgeSep : nodeSep) / 2;
-
- sum += wLabel.width / 2;
- if (_.has(wLabel, "labelpos")) {
- switch (wLabel.labelpos.toLowerCase()) {
- case "l": delta = wLabel.width / 2; break;
- case "r": delta = -wLabel.width / 2; break;
- }
- }
- if (delta) {
- sum += reverseSep ? delta : -delta;
- }
- delta = 0;
-
- return sum;
- };
-}
-
-function width(g, v) {
- return g.node(v).width;
-}
-
-},{"../graphlib":63,"../lodash":66,"../util":85}],80:[function(require,module,exports){
-"use strict";
-
-var _ = require("../lodash"),
- util = require("../util"),
- positionX = require("./bk").positionX;
-
-module.exports = position;
-
-function position(g) {
- g = util.asNonCompoundGraph(g);
-
- positionY(g);
- _.each(positionX(g), function(x, v) {
- g.node(v).x = x;
- });
-}
-
-function positionY(g) {
- var layering = util.buildLayerMatrix(g),
- rankSep = g.graph().ranksep,
- prevY = 0;
- _.each(layering, function(layer) {
- var maxHeight = _.max(_.map(layer, function(v) { return g.node(v).height; }));
- _.each(layer, function(v) {
- g.node(v).y = prevY + maxHeight / 2;
- });
- prevY += maxHeight + rankSep;
- });
-}
-
-
-},{"../lodash":66,"../util":85,"./bk":79}],81:[function(require,module,exports){
-"use strict";
-
-var _ = require("../lodash"),
- Graph = require("../graphlib").Graph,
- slack = require("./util").slack;
-
-module.exports = feasibleTree;
-
-/*
- * Constructs a spanning tree with tight edges and adjusted the input node's
- * ranks to achieve this. A tight edge is one that is has a length that matches
- * its "minlen" attribute.
- *
- * The basic structure for this function is derived from Gansner, et al., "A
- * Technique for Drawing Directed Graphs."
- *
- * Pre-conditions:
- *
- * 1. Graph must be a DAG.
- * 2. Graph must be connected.
- * 3. Graph must have at least one node.
- * 5. Graph nodes must have been previously assigned a "rank" property that
- * respects the "minlen" property of incident edges.
- * 6. Graph edges must have a "minlen" property.
- *
- * Post-conditions:
- *
- * - Graph nodes will have their rank adjusted to ensure that all edges are
- * tight.
- *
- * Returns a tree (undirected graph) that is constructed using only "tight"
- * edges.
- */
-function feasibleTree(g) {
- var t = new Graph({ directed: false });
-
- // Choose arbitrary node from which to start our tree
- var start = g.nodes()[0],
- size = g.nodeCount();
- t.setNode(start, {});
-
- var edge, delta;
- while (tightTree(t, g) < size) {
- edge = findMinSlackEdge(t, g);
- delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge);
- shiftRanks(t, g, delta);
- }
-
- return t;
-}
-
-/*
- * Finds a maximal tree of tight edges and returns the number of nodes in the
- * tree.
- */
-function tightTree(t, g) {
- function dfs(v) {
- _.each(g.nodeEdges(v), function(e) {
- var edgeV = e.v,
- w = (v === edgeV) ? e.w : edgeV;
- if (!t.hasNode(w) && !slack(g, e)) {
- t.setNode(w, {});
- t.setEdge(v, w, {});
- dfs(w);
- }
- });
- }
-
- _.each(t.nodes(), dfs);
- return t.nodeCount();
-}
-
-/*
- * Finds the edge with the smallest slack that is incident on tree and returns
- * it.
- */
-function findMinSlackEdge(t, g) {
- return _.min(g.edges(), function(e) {
- if (t.hasNode(e.v) !== t.hasNode(e.w)) {
- return slack(g, e);
- }
- });
-}
-
-function shiftRanks(t, g, delta) {
- _.each(t.nodes(), function(v) {
- g.node(v).rank += delta;
- });
-}
-
-},{"../graphlib":63,"../lodash":66,"./util":84}],82:[function(require,module,exports){
-"use strict";
-
-var rankUtil = require("./util"),
- longestPath = rankUtil.longestPath,
- feasibleTree = require("./feasible-tree"),
- networkSimplex = require("./network-simplex");
-
-module.exports = rank;
-
-/*
- * Assigns a rank to each node in the input graph that respects the "minlen"
- * constraint specified on edges between nodes.
- *
- * This basic structure is derived from Gansner, et al., "A Technique for
- * Drawing Directed Graphs."
- *
- * Pre-conditions:
- *
- * 1. Graph must be a connected DAG
- * 2. Graph nodes must be objects
- * 3. Graph edges must have "weight" and "minlen" attributes
- *
- * Post-conditions:
- *
- * 1. Graph nodes will have a "rank" attribute based on the results of the
- * algorithm. Ranks can start at any index (including negative), we'll
- * fix them up later.
- */
-function rank(g) {
- switch(g.graph().ranker) {
- case "network-simplex": networkSimplexRanker(g); break;
- case "tight-tree": tightTreeRanker(g); break;
- case "longest-path": longestPathRanker(g); break;
- default: networkSimplexRanker(g);
- }
-}
-
-// A fast and simple ranker, but results are far from optimal.
-var longestPathRanker = longestPath;
-
-function tightTreeRanker(g) {
- longestPath(g);
- feasibleTree(g);
-}
-
-function networkSimplexRanker(g) {
- networkSimplex(g);
-}
-
-},{"./feasible-tree":81,"./network-simplex":83,"./util":84}],83:[function(require,module,exports){
-"use strict";
-
-var _ = require("../lodash"),
- feasibleTree = require("./feasible-tree"),
- slack = require("./util").slack,
- initRank = require("./util").longestPath,
- preorder = require("../graphlib").alg.preorder,
- postorder = require("../graphlib").alg.postorder,
- simplify = require("../util").simplify;
-
-module.exports = networkSimplex;
-
-// Expose some internals for testing purposes
-networkSimplex.initLowLimValues = initLowLimValues;
-networkSimplex.initCutValues = initCutValues;
-networkSimplex.calcCutValue = calcCutValue;
-networkSimplex.leaveEdge = leaveEdge;
-networkSimplex.enterEdge = enterEdge;
-networkSimplex.exchangeEdges = exchangeEdges;
-
-/*
- * The network simplex algorithm assigns ranks to each node in the input graph
- * and iteratively improves the ranking to reduce the length of edges.
- *
- * Preconditions:
- *
- * 1. The input graph must be a DAG.
- * 2. All nodes in the graph must have an object value.
- * 3. All edges in the graph must have "minlen" and "weight" attributes.
- *
- * Postconditions:
- *
- * 1. All nodes in the graph will have an assigned "rank" attribute that has
- * been optimized by the network simplex algorithm. Ranks start at 0.
- *
- *
- * A rough sketch of the algorithm is as follows:
- *
- * 1. Assign initial ranks to each node. We use the longest path algorithm,
- * which assigns ranks to the lowest position possible. In general this
- * leads to very wide bottom ranks and unnecessarily long edges.
- * 2. Construct a feasible tight tree. A tight tree is one such that all
- * edges in the tree have no slack (difference between length of edge
- * and minlen for the edge). This by itself greatly improves the assigned
- * rankings by shorting edges.
- * 3. Iteratively find edges that have negative cut values. Generally a
- * negative cut value indicates that the edge could be removed and a new
- * tree edge could be added to produce a more compact graph.
- *
- * Much of the algorithms here are derived from Gansner, et al., "A Technique
- * for Drawing Directed Graphs." The structure of the file roughly follows the
- * structure of the overall algorithm.
- */
-function networkSimplex(g) {
- g = simplify(g);
- initRank(g);
- var t = feasibleTree(g);
- initLowLimValues(t);
- initCutValues(t, g);
-
- var e, f;
- while ((e = leaveEdge(t))) {
- f = enterEdge(t, g, e);
- exchangeEdges(t, g, e, f);
- }
-}
-
-/*
- * Initializes cut values for all edges in the tree.
- */
-function initCutValues(t, g) {
- var vs = postorder(t, t.nodes());
- vs = vs.slice(0, vs.length - 1);
- _.each(vs, function(v) {
- assignCutValue(t, g, v);
- });
-}
-
-function assignCutValue(t, g, child) {
- var childLab = t.node(child),
- parent = childLab.parent;
- t.edge(child, parent).cutvalue = calcCutValue(t, g, child);
-}
-
-/*
- * Given the tight tree, its graph, and a child in the graph calculate and
- * return the cut value for the edge between the child and its parent.
- */
-function calcCutValue(t, g, child) {
- var childLab = t.node(child),
- parent = childLab.parent,
- // True if the child is on the tail end of the edge in the directed graph
- childIsTail = true,
- // The graph's view of the tree edge we're inspecting
- graphEdge = g.edge(child, parent),
- // The accumulated cut value for the edge between this node and its parent
- cutValue = 0;
-
- if (!graphEdge) {
- childIsTail = false;
- graphEdge = g.edge(parent, child);
- }
-
- cutValue = graphEdge.weight;
-
- _.each(g.nodeEdges(child), function(e) {
- var isOutEdge = e.v === child,
- other = isOutEdge ? e.w : e.v;
-
- if (other !== parent) {
- var pointsToHead = isOutEdge === childIsTail,
- otherWeight = g.edge(e).weight;
-
- cutValue += pointsToHead ? otherWeight : -otherWeight;
- if (isTreeEdge(t, child, other)) {
- var otherCutValue = t.edge(child, other).cutvalue;
- cutValue += pointsToHead ? -otherCutValue : otherCutValue;
- }
- }
- });
-
- return cutValue;
-}
-
-function initLowLimValues(tree, root) {
- if (arguments.length < 2) {
- root = tree.nodes()[0];
- }
- dfsAssignLowLim(tree, {}, 1, root);
-}
-
-function dfsAssignLowLim(tree, visited, nextLim, v, parent) {
- var low = nextLim,
- label = tree.node(v);
-
- visited[v] = true;
- _.each(tree.neighbors(v), function(w) {
- if (!_.has(visited, w)) {
- nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v);
- }
- });
-
- label.low = low;
- label.lim = nextLim++;
- if (parent) {
- label.parent = parent;
- } else {
- // TODO should be able to remove this when we incrementally update low lim
- delete label.parent;
- }
-
- return nextLim;
-}
-
-function leaveEdge(tree) {
- return _.find(tree.edges(), function(e) {
- return tree.edge(e).cutvalue < 0;
- });
-}
-
-function enterEdge(t, g, edge) {
- var v = edge.v,
- w = edge.w;
-
- // For the rest of this function we assume that v is the tail and w is the
- // head, so if we don't have this edge in the graph we should flip it to
- // match the correct orientation.
- if (!g.hasEdge(v, w)) {
- v = edge.w;
- w = edge.v;
- }
-
- var vLabel = t.node(v),
- wLabel = t.node(w),
- tailLabel = vLabel,
- flip = false;
-
- // If the root is in the tail of the edge then we need to flip the logic that
- // checks for the head and tail nodes in the candidates function below.
- if (vLabel.lim > wLabel.lim) {
- tailLabel = wLabel;
- flip = true;
- }
-
- var candidates = _.filter(g.edges(), function(edge) {
- return flip === isDescendant(t, t.node(edge.v), tailLabel) &&
- flip !== isDescendant(t, t.node(edge.w), tailLabel);
- });
-
- return _.min(candidates, function(edge) { return slack(g, edge); });
-}
-
-function exchangeEdges(t, g, e, f) {
- var v = e.v,
- w = e.w;
- t.removeEdge(v, w);
- t.setEdge(f.v, f.w, {});
- initLowLimValues(t);
- initCutValues(t, g);
- updateRanks(t, g);
-}
-
-function updateRanks(t, g) {
- var root = _.find(t.nodes(), function(v) { return !g.node(v).parent; }),
- vs = preorder(t, root);
- vs = vs.slice(1);
- _.each(vs, function(v) {
- var parent = t.node(v).parent,
- edge = g.edge(v, parent),
- flipped = false;
-
- if (!edge) {
- edge = g.edge(parent, v);
- flipped = true;
- }
-
- g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen);
- });
-}
-
-/*
- * Returns true if the edge is in the tree.
- */
-function isTreeEdge(tree, u, v) {
- return tree.hasEdge(u, v);
-}
-
-/*
- * Returns true if the specified node is descendant of the root node per the
- * assigned low and lim attributes in the tree.
- */
-function isDescendant(tree, vLabel, rootLabel) {
- return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim;
-}
-
-},{"../graphlib":63,"../lodash":66,"../util":85,"./feasible-tree":81,"./util":84}],84:[function(require,module,exports){
-"use strict";
-
-var _ = require("../lodash");
-
-module.exports = {
- longestPath: longestPath,
- slack: slack
-};
-
-/*
- * Initializes ranks for the input graph using the longest path algorithm. This
- * algorithm scales well and is fast in practice, it yields rather poor
- * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom
- * ranks wide and leaving edges longer than necessary. However, due to its
- * speed, this algorithm is good for getting an initial ranking that can be fed
- * into other algorithms.
- *
- * This algorithm does not normalize layers because it will be used by other
- * algorithms in most cases. If using this algorithm directly, be sure to
- * run normalize at the end.
- *
- * Pre-conditions:
- *
- * 1. Input graph is a DAG.
- * 2. Input graph node labels can be assigned properties.
- *
- * Post-conditions:
- *
- * 1. Each node will be assign an (unnormalized) "rank" property.
- */
-function longestPath(g) {
- var visited = {};
-
- function dfs(v) {
- var label = g.node(v);
- if (_.has(visited, v)) {
- return label.rank;
- }
- visited[v] = true;
-
- var rank = _.min(_.map(g.outEdges(v), function(e) {
- return dfs(e.w) - g.edge(e).minlen;
- }));
-
- if (rank === Number.POSITIVE_INFINITY) {
- rank = 0;
- }
-
- return (label.rank = rank);
- }
-
- _.each(g.sources(), dfs);
-}
-
-/*
- * Returns the amount of slack for the given edge. The slack is defined as the
- * difference between the length of the edge and its minimum length.
- */
-function slack(g, e) {
- return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen;
-}
-
-},{"../lodash":66}],85:[function(require,module,exports){
-"use strict";
-
-var _ = require("./lodash"),
- Graph = require("./graphlib").Graph;
-
-module.exports = {
- addDummyNode: addDummyNode,
- simplify: simplify,
- asNonCompoundGraph: asNonCompoundGraph,
- successorWeights: successorWeights,
- predecessorWeights: predecessorWeights,
- intersectRect: intersectRect,
- buildLayerMatrix: buildLayerMatrix,
- normalizeRanks: normalizeRanks,
- removeEmptyRanks: removeEmptyRanks,
- addBorderNode: addBorderNode,
- maxRank: maxRank,
- partition: partition,
- time: time,
- notime: notime
-};
-
-/*
- * Adds a dummy node to the graph and return v.
- */
-function addDummyNode(g, type, attrs, name) {
- var v;
- do {
- v = _.uniqueId(name);
- } while (g.hasNode(v));
-
- attrs.dummy = type;
- g.setNode(v, attrs);
- return v;
-}
-
-/*
- * Returns a new graph with only simple edges. Handles aggregation of data
- * associated with multi-edges.
- */
-function simplify(g) {
- var simplified = new Graph().setGraph(g.graph());
- _.each(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });
- _.each(g.edges(), function(e) {
- var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 },
- label = g.edge(e);
- simplified.setEdge(e.v, e.w, {
- weight: simpleLabel.weight + label.weight,
- minlen: Math.max(simpleLabel.minlen, label.minlen)
- });
- });
- return simplified;
-}
-
-function asNonCompoundGraph(g) {
- var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph());
- _.each(g.nodes(), function(v) {
- if (!g.children(v).length) {
- simplified.setNode(v, g.node(v));
- }
- });
- _.each(g.edges(), function(e) {
- simplified.setEdge(e, g.edge(e));
- });
- return simplified;
-}
-
-function successorWeights(g) {
- var weightMap = _.map(g.nodes(), function(v) {
- var sucs = {};
- _.each(g.outEdges(v), function(e) {
- sucs[e.w] = (sucs[e.w] || 0) + g.edge(e).weight;
- });
- return sucs;
- });
- return _.zipObject(g.nodes(), weightMap);
-}
-
-function predecessorWeights(g) {
- var weightMap = _.map(g.nodes(), function(v) {
- var preds = {};
- _.each(g.inEdges(v), function(e) {
- preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight;
- });
- return preds;
- });
- return _.zipObject(g.nodes(), weightMap);
-}
-
-/*
- * Finds where a line starting at point ({x, y}) would intersect a rectangle
- * ({x, y, width, height}) if it were pointing at the rectangle's center.
- */
-function intersectRect(rect, point) {
- var x = rect.x;
- var y = rect.y;
-
- // Rectangle intersection algorithm from:
- // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes
- var dx = point.x - x;
- var dy = point.y - y;
- var w = rect.width / 2;
- var h = rect.height / 2;
-
- if (!dx && !dy) {
- throw new Error("Not possible to find intersection inside of the rectangle");
- }
-
- var sx, sy;
- if (Math.abs(dy) * w > Math.abs(dx) * h) {
- // Intersection is top or bottom of rect.
- if (dy < 0) {
- h = -h;
- }
- sx = h * dx / dy;
- sy = h;
- } else {
- // Intersection is left or right of rect.
- if (dx < 0) {
- w = -w;
- }
- sx = w;
- sy = w * dy / dx;
- }
-
- return { x: x + sx, y: y + sy };
-}
-
-/*
- * Given a DAG with each node assigned "rank" and "order" properties, this
- * function will produce a matrix with the ids of each node.
- */
-function buildLayerMatrix(g) {
- var layering = _.map(_.range(maxRank(g) + 1), function() { return []; });
- _.each(g.nodes(), function(v) {
- var node = g.node(v),
- rank = node.rank;
- if (!_.isUndefined(rank)) {
- layering[rank][node.order] = v;
- }
- });
- return layering;
-}
-
-/*
- * Adjusts the ranks for all nodes in the graph such that all nodes v have
- * rank(v) >= 0 and at least one node w has rank(w) = 0.
- */
-function normalizeRanks(g) {
- var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));
- _.each(g.nodes(), function(v) {
- var node = g.node(v);
- if (_.has(node, "rank")) {
- node.rank -= min;
- }
- });
-}
-
-function removeEmptyRanks(g) {
- // Ranks may not start at 0, so we need to offset them
- var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));
-
- var layers = [];
- _.each(g.nodes(), function(v) {
- var rank = g.node(v).rank - offset;
- if (!layers[rank]) {
- layers[rank] = [];
- }
- layers[rank].push(v);
- });
-
- var delta = 0,
- nodeRankFactor = g.graph().nodeRankFactor;
- _.each(layers, function(vs, i) {
- if (_.isUndefined(vs) && i % nodeRankFactor !== 0) {
- --delta;
- } else if (delta) {
- _.each(vs, function(v) { g.node(v).rank += delta; });
- }
- });
-}
-
-function addBorderNode(g, prefix, rank, order) {
- var node = {
- width: 0,
- height: 0
- };
- if (arguments.length >= 4) {
- node.rank = rank;
- node.order = order;
- }
- return addDummyNode(g, "border", node, prefix);
-}
-
-function maxRank(g) {
- return _.max(_.map(g.nodes(), function(v) {
- var rank = g.node(v).rank;
- if (!_.isUndefined(rank)) {
- return rank;
- }
- }));
-}
-
-/*
- * Partition a collection into two groups: `lhs` and `rhs`. If the supplied
- * function returns true for an entry it goes into `lhs`. Otherwise it goes
- * into `rhs.
- */
-function partition(collection, fn) {
- var result = { lhs: [], rhs: [] };
- _.each(collection, function(value) {
- if (fn(value)) {
- result.lhs.push(value);
- } else {
- result.rhs.push(value);
- }
- });
- return result;
-}
-
-/*
- * Returns a new function that wraps `fn` with a timer. The wrapper logs the
- * time it takes to execute the function.
- */
-function time(name, fn) {
- var start = _.now();
- try {
- return fn();
- } finally {
- console.log(name + " time: " + (_.now() - start) + "ms");
- }
-}
-
-function notime(name, fn) {
- return fn();
-}
-
-},{"./graphlib":63,"./lodash":66}],86:[function(require,module,exports){
-module.exports = "0.7.4";
-
-},{}],87:[function(require,module,exports){
-(function (global){
-/**
- * @license
- * lodash 3.10.1 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern -d -o ./index.js`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-;(function() {
-
- /** Used as a safe reference for `undefined` in pre-ES5 environments. */
- var undefined;
-
- /** Used as the semantic version number. */
- var VERSION = '3.10.1';
-
- /** Used to compose bitmasks for wrapper metadata. */
- var BIND_FLAG = 1,
- BIND_KEY_FLAG = 2,
- CURRY_BOUND_FLAG = 4,
- CURRY_FLAG = 8,
- CURRY_RIGHT_FLAG = 16,
- PARTIAL_FLAG = 32,
- PARTIAL_RIGHT_FLAG = 64,
- ARY_FLAG = 128,
- REARG_FLAG = 256;
-
- /** Used as default options for `_.trunc`. */
- var DEFAULT_TRUNC_LENGTH = 30,
- DEFAULT_TRUNC_OMISSION = '...';
-
- /** Used to detect when a function becomes hot. */
- var HOT_COUNT = 150,
- HOT_SPAN = 16;
-
- /** Used as the size to enable large array optimizations. */
- var LARGE_ARRAY_SIZE = 200;
-
- /** Used to indicate the type of lazy iteratees. */
- var LAZY_FILTER_FLAG = 1,
- LAZY_MAP_FLAG = 2;
-
- /** Used as the `TypeError` message for "Functions" methods. */
- var FUNC_ERROR_TEXT = 'Expected a function';
-
- /** Used as the internal argument placeholder. */
- var PLACEHOLDER = '__lodash_placeholder__';
-
- /** `Object#toString` result references. */
- var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- errorTag = '[object Error]',
- funcTag = '[object Function]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- objectTag = '[object Object]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- weakMapTag = '[object WeakMap]';
-
- var arrayBufferTag = '[object ArrayBuffer]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
-
- /** Used to match empty string literals in compiled template source. */
- var reEmptyStringLeading = /\b__p \+= '';/g,
- reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
- reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
-
- /** Used to match HTML entities and HTML characters. */
- var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
- reUnescapedHtml = /[&<>"'`]/g,
- reHasEscapedHtml = RegExp(reEscapedHtml.source),
- reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
-
- /** Used to match template delimiters. */
- var reEscape = /<%-([\s\S]+?)%>/g,
- reEvaluate = /<%([\s\S]+?)%>/g,
- reInterpolate = /<%=([\s\S]+?)%>/g;
-
- /** Used to match property names within property paths. */
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
- reIsPlainProp = /^\w*$/,
- rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
-
- /**
- * Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns)
- * and those outlined by [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern).
- */
- var reRegExpChars = /^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,
- reHasRegExpChars = RegExp(reRegExpChars.source);
-
- /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */
- var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g;
-
- /** Used to match backslashes in property paths. */
- var reEscapeChar = /\\(\\)?/g;
-
- /** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
-
- /** Used to match `RegExp` flags from their coerced string values. */
- var reFlags = /\w*$/;
-
- /** Used to detect hexadecimal string values. */
- var reHasHexPrefix = /^0[xX]/;
-
- /** Used to detect host constructors (Safari > 5). */
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
- /** Used to detect unsigned integer values. */
- var reIsUint = /^\d+$/;
-
- /** Used to match latin-1 supplementary letters (excluding mathematical operators). */
- var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
-
- /** Used to ensure capturing order of template delimiters. */
- var reNoMatch = /($^)/;
-
- /** Used to match unescaped characters in compiled string literals. */
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
-
- /** Used to match words to create compound words. */
- var reWords = (function() {
- var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]',
- lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+';
-
- return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');
- }());
-
- /** Used to assign default `context` object properties. */
- var contextProps = [
- 'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array',
- 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number',
- 'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'isFinite',
- 'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',
- 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap'
- ];
-
- /** Used to make template sourceURLs easier to identify. */
- var templateCounter = -1;
-
- /** Used to identify `toStringTag` values of typed arrays. */
- var typedArrayTags = {};
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
- typedArrayTags[uint32Tag] = true;
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
- typedArrayTags[dateTag] = typedArrayTags[errorTag] =
- typedArrayTags[funcTag] = typedArrayTags[mapTag] =
- typedArrayTags[numberTag] = typedArrayTags[objectTag] =
- typedArrayTags[regexpTag] = typedArrayTags[setTag] =
- typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
-
- /** Used to identify `toStringTag` values supported by `_.clone`. */
- var cloneableTags = {};
- cloneableTags[argsTag] = cloneableTags[arrayTag] =
- cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
- cloneableTags[dateTag] = cloneableTags[float32Tag] =
- cloneableTags[float64Tag] = cloneableTags[int8Tag] =
- cloneableTags[int16Tag] = cloneableTags[int32Tag] =
- cloneableTags[numberTag] = cloneableTags[objectTag] =
- cloneableTags[regexpTag] = cloneableTags[stringTag] =
- cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
- cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
- cloneableTags[errorTag] = cloneableTags[funcTag] =
- cloneableTags[mapTag] = cloneableTags[setTag] =
- cloneableTags[weakMapTag] = false;
-
- /** Used to map latin-1 supplementary letters to basic latin letters. */
- var deburredLetters = {
- '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
- '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
- '\xc7': 'C', '\xe7': 'c',
- '\xd0': 'D', '\xf0': 'd',
- '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
- '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
- '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
- '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
- '\xd1': 'N', '\xf1': 'n',
- '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
- '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
- '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
- '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
- '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
- '\xc6': 'Ae', '\xe6': 'ae',
- '\xde': 'Th', '\xfe': 'th',
- '\xdf': 'ss'
- };
-
- /** Used to map characters to HTML entities. */
- var htmlEscapes = {
- '&': '&amp;',
- '<': '&lt;',
- '>': '&gt;',
- '"': '&quot;',
- "'": '&#39;',
- '`': '&#96;'
- };
-
- /** Used to map HTML entities to characters. */
- var htmlUnescapes = {
- '&amp;': '&',
- '&lt;': '<',
- '&gt;': '>',
- '&quot;': '"',
- '&#39;': "'",
- '&#96;': '`'
- };
-
- /** Used to determine if values are of the language type `Object`. */
- var objectTypes = {
- 'function': true,
- 'object': true
- };
-
- /** Used to escape characters for inclusion in compiled regexes. */
- var regexpEscapes = {
- '0': 'x30', '1': 'x31', '2': 'x32', '3': 'x33', '4': 'x34',
- '5': 'x35', '6': 'x36', '7': 'x37', '8': 'x38', '9': 'x39',
- 'A': 'x41', 'B': 'x42', 'C': 'x43', 'D': 'x44', 'E': 'x45', 'F': 'x46',
- 'a': 'x61', 'b': 'x62', 'c': 'x63', 'd': 'x64', 'e': 'x65', 'f': 'x66',
- 'n': 'x6e', 'r': 'x72', 't': 'x74', 'u': 'x75', 'v': 'x76', 'x': 'x78'
- };
-
- /** Used to escape characters for inclusion in compiled string literals. */
- var stringEscapes = {
- '\\': '\\',
- "'": "'",
- '\n': 'n',
- '\r': 'r',
- '\u2028': 'u2028',
- '\u2029': 'u2029'
- };
-
- /** Detect free variable `exports`. */
- var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
-
- /** Detect free variable `module`. */
- var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;
-
- /** Detect free variable `global` from Node.js. */
- var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
-
- /** Detect free variable `self`. */
- var freeSelf = objectTypes[typeof self] && self && self.Object && self;
-
- /** Detect free variable `window`. */
- var freeWindow = objectTypes[typeof window] && window && window.Object && window;
-
- /** Detect the popular CommonJS extension `module.exports`. */
- var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;
-
- /**
- * Used as a reference to the global object.
- *
- * The `this` value is used if it's the global object to avoid Greasemonkey's
- * restricted `window` object, otherwise the `window` object is used.
- */
- var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * The base implementation of `compareAscending` which compares values and
- * sorts them in ascending order without guaranteeing a stable sort.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {number} Returns the sort order indicator for `value`.
- */
- function baseCompareAscending(value, other) {
- if (value !== other) {
- var valIsNull = value === null,
- valIsUndef = value === undefined,
- valIsReflexive = value === value;
-
- var othIsNull = other === null,
- othIsUndef = other === undefined,
- othIsReflexive = other === other;
-
- if ((value > other && !othIsNull) || !valIsReflexive ||
- (valIsNull && !othIsUndef && othIsReflexive) ||
- (valIsUndef && othIsReflexive)) {
- return 1;
- }
- if ((value < other && !valIsNull) || !othIsReflexive ||
- (othIsNull && !valIsUndef && valIsReflexive) ||
- (othIsUndef && valIsReflexive)) {
- return -1;
- }
- }
- return 0;
- }
-
- /**
- * The base implementation of `_.findIndex` and `_.findLastIndex` without
- * support for callback shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to search.
- * @param {Function} predicate The function invoked per iteration.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseFindIndex(array, predicate, fromRight) {
- var length = array.length,
- index = fromRight ? length : -1;
-
- while ((fromRight ? index-- : ++index < length)) {
- if (predicate(array[index], index, array)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * The base implementation of `_.indexOf` without support for binary searches.
- *
- * @private
- * @param {Array} array The array to search.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseIndexOf(array, value, fromIndex) {
- if (value !== value) {
- return indexOfNaN(array, fromIndex);
- }
- var index = fromIndex - 1,
- length = array.length;
-
- while (++index < length) {
- if (array[index] === value) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * The base implementation of `_.isFunction` without support for environments
- * with incorrect `typeof` results.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- */
- function baseIsFunction(value) {
- // Avoid a Chakra JIT bug in compatibility modes of IE 11.
- // See https://github.com/jashkenas/underscore/issues/1621 for more details.
- return typeof value == 'function' || false;
- }
-
- /**
- * Converts `value` to a string if it's not one. An empty string is returned
- * for `null` or `undefined` values.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {string} Returns the string.
- */
- function baseToString(value) {
- return value == null ? '' : (value + '');
- }
-
- /**
- * Used by `_.trim` and `_.trimLeft` to get the index of the first character
- * of `string` that is not found in `chars`.
- *
- * @private
- * @param {string} string The string to inspect.
- * @param {string} chars The characters to find.
- * @returns {number} Returns the index of the first character not found in `chars`.
- */
- function charsLeftIndex(string, chars) {
- var index = -1,
- length = string.length;
-
- while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
- return index;
- }
-
- /**
- * Used by `_.trim` and `_.trimRight` to get the index of the last character
- * of `string` that is not found in `chars`.
- *
- * @private
- * @param {string} string The string to inspect.
- * @param {string} chars The characters to find.
- * @returns {number} Returns the index of the last character not found in `chars`.
- */
- function charsRightIndex(string, chars) {
- var index = string.length;
-
- while (index-- && chars.indexOf(string.charAt(index)) > -1) {}
- return index;
- }
-
- /**
- * Used by `_.sortBy` to compare transformed elements of a collection and stable
- * sort them in ascending order.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @returns {number} Returns the sort order indicator for `object`.
- */
- function compareAscending(object, other) {
- return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
- }
-
- /**
- * Used by `_.sortByOrder` to compare multiple properties of a value to another
- * and stable sort them.
- *
- * If `orders` is unspecified, all valuess are sorted in ascending order. Otherwise,
- * a value is sorted in ascending order if its corresponding order is "asc", and
- * descending if "desc".
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {boolean[]} orders The order to sort by for each property.
- * @returns {number} Returns the sort order indicator for `object`.
- */
- function compareMultiple(object, other, orders) {
- var index = -1,
- objCriteria = object.criteria,
- othCriteria = other.criteria,
- length = objCriteria.length,
- ordersLength = orders.length;
-
- while (++index < length) {
- var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
- if (result) {
- if (index >= ordersLength) {
- return result;
- }
- var order = orders[index];
- return result * ((order === 'asc' || order === true) ? 1 : -1);
- }
- }
- // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
- // that causes it, under certain circumstances, to provide the same value for
- // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
- // for more details.
- //
- // This also ensures a stable sort in V8 and other engines.
- // See https://code.google.com/p/v8/issues/detail?id=90 for more details.
- return object.index - other.index;
- }
-
- /**
- * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.
- *
- * @private
- * @param {string} letter The matched letter to deburr.
- * @returns {string} Returns the deburred letter.
- */
- function deburrLetter(letter) {
- return deburredLetters[letter];
- }
-
- /**
- * Used by `_.escape` to convert characters to HTML entities.
- *
- * @private
- * @param {string} chr The matched character to escape.
- * @returns {string} Returns the escaped character.
- */
- function escapeHtmlChar(chr) {
- return htmlEscapes[chr];
- }
-
- /**
- * Used by `_.escapeRegExp` to escape characters for inclusion in compiled regexes.
- *
- * @private
- * @param {string} chr The matched character to escape.
- * @param {string} leadingChar The capture group for a leading character.
- * @param {string} whitespaceChar The capture group for a whitespace character.
- * @returns {string} Returns the escaped character.
- */
- function escapeRegExpChar(chr, leadingChar, whitespaceChar) {
- if (leadingChar) {
- chr = regexpEscapes[chr];
- } else if (whitespaceChar) {
- chr = stringEscapes[chr];
- }
- return '\\' + chr;
- }
-
- /**
- * Used by `_.template` to escape characters for inclusion in compiled string literals.
- *
- * @private
- * @param {string} chr The matched character to escape.
- * @returns {string} Returns the escaped character.
- */
- function escapeStringChar(chr) {
- return '\\' + stringEscapes[chr];
- }
-
- /**
- * Gets the index at which the first occurrence of `NaN` is found in `array`.
- *
- * @private
- * @param {Array} array The array to search.
- * @param {number} fromIndex The index to search from.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {number} Returns the index of the matched `NaN`, else `-1`.
- */
- function indexOfNaN(array, fromIndex, fromRight) {
- var length = array.length,
- index = fromIndex + (fromRight ? 0 : -1);
-
- while ((fromRight ? index-- : ++index < length)) {
- var other = array[index];
- if (other !== other) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * Checks if `value` is object-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- */
- function isObjectLike(value) {
- return !!value && typeof value == 'object';
- }
-
- /**
- * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a
- * character code is whitespace.
- *
- * @private
- * @param {number} charCode The character code to inspect.
- * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`.
- */
- function isSpace(charCode) {
- return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||
- (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279)));
- }
-
- /**
- * Replaces all `placeholder` elements in `array` with an internal placeholder
- * and returns an array of their indexes.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {*} placeholder The placeholder to replace.
- * @returns {Array} Returns the new array of placeholder indexes.
- */
- function replaceHolders(array, placeholder) {
- var index = -1,
- length = array.length,
- resIndex = -1,
- result = [];
-
- while (++index < length) {
- if (array[index] === placeholder) {
- array[index] = PLACEHOLDER;
- result[++resIndex] = index;
- }
- }
- return result;
- }
-
- /**
- * An implementation of `_.uniq` optimized for sorted arrays without support
- * for callback shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The function invoked per iteration.
- * @returns {Array} Returns the new duplicate-value-free array.
- */
- function sortedUniq(array, iteratee) {
- var seen,
- index = -1,
- length = array.length,
- resIndex = -1,
- result = [];
-
- while (++index < length) {
- var value = array[index],
- computed = iteratee ? iteratee(value, index, array) : value;
-
- if (!index || seen !== computed) {
- seen = computed;
- result[++resIndex] = value;
- }
- }
- return result;
- }
-
- /**
- * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace
- * character of `string`.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {number} Returns the index of the first non-whitespace character.
- */
- function trimmedLeftIndex(string) {
- var index = -1,
- length = string.length;
-
- while (++index < length && isSpace(string.charCodeAt(index))) {}
- return index;
- }
-
- /**
- * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace
- * character of `string`.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {number} Returns the index of the last non-whitespace character.
- */
- function trimmedRightIndex(string) {
- var index = string.length;
-
- while (index-- && isSpace(string.charCodeAt(index))) {}
- return index;
- }
-
- /**
- * Used by `_.unescape` to convert HTML entities to characters.
- *
- * @private
- * @param {string} chr The matched character to unescape.
- * @returns {string} Returns the unescaped character.
- */
- function unescapeHtmlChar(chr) {
- return htmlUnescapes[chr];
- }
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Create a new pristine `lodash` function using the given `context` object.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {Object} [context=root] The context object.
- * @returns {Function} Returns a new `lodash` function.
- * @example
- *
- * _.mixin({ 'foo': _.constant('foo') });
- *
- * var lodash = _.runInContext();
- * lodash.mixin({ 'bar': lodash.constant('bar') });
- *
- * _.isFunction(_.foo);
- * // => true
- * _.isFunction(_.bar);
- * // => false
- *
- * lodash.isFunction(lodash.foo);
- * // => false
- * lodash.isFunction(lodash.bar);
- * // => true
- *
- * // using `context` to mock `Date#getTime` use in `_.now`
- * var mock = _.runInContext({
- * 'Date': function() {
- * return { 'getTime': getTimeMock };
- * }
- * });
- *
- * // or creating a suped-up `defer` in Node.js
- * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
- */
- function runInContext(context) {
- // Avoid issues with some ES3 environments that attempt to use values, named
- // after built-in constructors like `Object`, for the creation of literals.
- // ES5 clears this up by stating that literals must use built-in constructors.
- // See https://es5.github.io/#x11.1.5 for more details.
- context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;
-
- /** Native constructor references. */
- var Array = context.Array,
- Date = context.Date,
- Error = context.Error,
- Function = context.Function,
- Math = context.Math,
- Number = context.Number,
- Object = context.Object,
- RegExp = context.RegExp,
- String = context.String,
- TypeError = context.TypeError;
-
- /** Used for native method references. */
- var arrayProto = Array.prototype,
- objectProto = Object.prototype,
- stringProto = String.prototype;
-
- /** Used to resolve the decompiled source of functions. */
- var fnToString = Function.prototype.toString;
-
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
-
- /** Used to generate unique IDs. */
- var idCounter = 0;
-
- /**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
- var objToString = objectProto.toString;
-
- /** Used to restore the original `_` reference in `_.noConflict`. */
- var oldDash = root._;
-
- /** Used to detect if a method is native. */
- var reIsNative = RegExp('^' +
- fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
- );
-
- /** Native method references. */
- var ArrayBuffer = context.ArrayBuffer,
- clearTimeout = context.clearTimeout,
- parseFloat = context.parseFloat,
- pow = Math.pow,
- propertyIsEnumerable = objectProto.propertyIsEnumerable,
- Set = getNative(context, 'Set'),
- setTimeout = context.setTimeout,
- splice = arrayProto.splice,
- Uint8Array = context.Uint8Array,
- WeakMap = getNative(context, 'WeakMap');
-
- /* Native method references for those with the same name as other `lodash` methods. */
- var nativeCeil = Math.ceil,
- nativeCreate = getNative(Object, 'create'),
- nativeFloor = Math.floor,
- nativeIsArray = getNative(Array, 'isArray'),
- nativeIsFinite = context.isFinite,
- nativeKeys = getNative(Object, 'keys'),
- nativeMax = Math.max,
- nativeMin = Math.min,
- nativeNow = getNative(Date, 'now'),
- nativeParseInt = context.parseInt,
- nativeRandom = Math.random;
-
- /** Used as references for `-Infinity` and `Infinity`. */
- var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY,
- POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
-
- /** Used as references for the maximum length and index of an array. */
- var MAX_ARRAY_LENGTH = 4294967295,
- MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
- HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
-
- /**
- * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
- * of an array-like value.
- */
- var MAX_SAFE_INTEGER = 9007199254740991;
-
- /** Used to store function metadata. */
- var metaMap = WeakMap && new WeakMap;
-
- /** Used to lookup unminified function names. */
- var realNames = {};
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a `lodash` object which wraps `value` to enable implicit chaining.
- * Methods that operate on and return arrays, collections, and functions can
- * be chained together. Methods that retrieve a single value or may return a
- * primitive value will automatically end the chain returning the unwrapped
- * value. Explicit chaining may be enabled using `_.chain`. The execution of
- * chained methods is lazy, that is, execution is deferred until `_#value`
- * is implicitly or explicitly called.
- *
- * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
- * fusion is an optimization strategy which merge iteratee calls; this can help
- * to avoid the creation of intermediate data structures and greatly reduce the
- * number of iteratee executions.
- *
- * Chaining is supported in custom builds as long as the `_#value` method is
- * directly or indirectly included in the build.
- *
- * In addition to lodash methods, wrappers have `Array` and `String` methods.
- *
- * The wrapper `Array` methods are:
- * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,
- * `splice`, and `unshift`
- *
- * The wrapper `String` methods are:
- * `replace` and `split`
- *
- * The wrapper methods that support shortcut fusion are:
- * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,
- * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,
- * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,
- * and `where`
- *
- * The chainable wrapper methods are:
- * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,
- * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,
- * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`,
- * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`,
- * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`,
- * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
- * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,
- * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`,
- * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`,
- * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
- * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,
- * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`,
- * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`,
- * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`,
- * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
- * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
- * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith`
- *
- * The wrapper methods that are **not** chainable by default are:
- * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
- * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
- * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
- * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
- * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
- * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
- * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
- * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
- * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
- * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
- * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
- * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
- * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
- * `unescape`, `uniqueId`, `value`, and `words`
- *
- * The wrapper method `sample` will return a wrapped value when `n` is provided,
- * otherwise an unwrapped value is returned.
- *
- * @name _
- * @constructor
- * @category Chain
- * @param {*} value The value to wrap in a `lodash` instance.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var wrapped = _([1, 2, 3]);
- *
- * // returns an unwrapped value
- * wrapped.reduce(function(total, n) {
- * return total + n;
- * });
- * // => 6
- *
- * // returns a wrapped value
- * var squares = wrapped.map(function(n) {
- * return n * n;
- * });
- *
- * _.isArray(squares);
- * // => false
- *
- * _.isArray(squares.value());
- * // => true
- */
- function lodash(value) {
- if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
- if (value instanceof LodashWrapper) {
- return value;
- }
- if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
- return wrapperClone(value);
- }
- }
- return new LodashWrapper(value);
- }
-
- /**
- * The function whose prototype all chaining wrappers inherit from.
- *
- * @private
- */
- function baseLodash() {
- // No operation performed.
- }
-
- /**
- * The base constructor for creating `lodash` wrapper objects.
- *
- * @private
- * @param {*} value The value to wrap.
- * @param {boolean} [chainAll] Enable chaining for all wrapper methods.
- * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.
- */
- function LodashWrapper(value, chainAll, actions) {
- this.__wrapped__ = value;
- this.__actions__ = actions || [];
- this.__chain__ = !!chainAll;
- }
-
- /**
- * An object environment feature flags.
- *
- * @static
- * @memberOf _
- * @type Object
- */
- var support = lodash.support = {};
-
- /**
- * By default, the template delimiters used by lodash are like those in
- * embedded Ruby (ERB). Change the following template settings to use
- * alternative delimiters.
- *
- * @static
- * @memberOf _
- * @type Object
- */
- lodash.templateSettings = {
-
- /**
- * Used to detect `data` property values to be HTML-escaped.
- *
- * @memberOf _.templateSettings
- * @type RegExp
- */
- 'escape': reEscape,
-
- /**
- * Used to detect code to be evaluated.
- *
- * @memberOf _.templateSettings
- * @type RegExp
- */
- 'evaluate': reEvaluate,
-
- /**
- * Used to detect `data` property values to inject.
- *
- * @memberOf _.templateSettings
- * @type RegExp
- */
- 'interpolate': reInterpolate,
-
- /**
- * Used to reference the data object in the template text.
- *
- * @memberOf _.templateSettings
- * @type string
- */
- 'variable': '',
-
- /**
- * Used to import variables into the compiled template.
- *
- * @memberOf _.templateSettings
- * @type Object
- */
- 'imports': {
-
- /**
- * A reference to the `lodash` function.
- *
- * @memberOf _.templateSettings.imports
- * @type Function
- */
- '_': lodash
- }
- };
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
- *
- * @private
- * @param {*} value The value to wrap.
- */
- function LazyWrapper(value) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__dir__ = 1;
- this.__filtered__ = false;
- this.__iteratees__ = [];
- this.__takeCount__ = POSITIVE_INFINITY;
- this.__views__ = [];
- }
-
- /**
- * Creates a clone of the lazy wrapper object.
- *
- * @private
- * @name clone
- * @memberOf LazyWrapper
- * @returns {Object} Returns the cloned `LazyWrapper` object.
- */
- function lazyClone() {
- var result = new LazyWrapper(this.__wrapped__);
- result.__actions__ = arrayCopy(this.__actions__);
- result.__dir__ = this.__dir__;
- result.__filtered__ = this.__filtered__;
- result.__iteratees__ = arrayCopy(this.__iteratees__);
- result.__takeCount__ = this.__takeCount__;
- result.__views__ = arrayCopy(this.__views__);
- return result;
- }
-
- /**
- * Reverses the direction of lazy iteration.
- *
- * @private
- * @name reverse
- * @memberOf LazyWrapper
- * @returns {Object} Returns the new reversed `LazyWrapper` object.
- */
- function lazyReverse() {
- if (this.__filtered__) {
- var result = new LazyWrapper(this);
- result.__dir__ = -1;
- result.__filtered__ = true;
- } else {
- result = this.clone();
- result.__dir__ *= -1;
- }
- return result;
- }
-
- /**
- * Extracts the unwrapped value from its lazy wrapper.
- *
- * @private
- * @name value
- * @memberOf LazyWrapper
- * @returns {*} Returns the unwrapped value.
- */
- function lazyValue() {
- var array = this.__wrapped__.value(),
- dir = this.__dir__,
- isArr = isArray(array),
- isRight = dir < 0,
- arrLength = isArr ? array.length : 0,
- view = getView(0, arrLength, this.__views__),
- start = view.start,
- end = view.end,
- length = end - start,
- index = isRight ? end : (start - 1),
- iteratees = this.__iteratees__,
- iterLength = iteratees.length,
- resIndex = 0,
- takeCount = nativeMin(length, this.__takeCount__);
-
- if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) {
- return baseWrapperValue((isRight && isArr) ? array.reverse() : array, this.__actions__);
- }
- var result = [];
-
- outer:
- while (length-- && resIndex < takeCount) {
- index += dir;
-
- var iterIndex = -1,
- value = array[index];
-
- while (++iterIndex < iterLength) {
- var data = iteratees[iterIndex],
- iteratee = data.iteratee,
- type = data.type,
- computed = iteratee(value);
-
- if (type == LAZY_MAP_FLAG) {
- value = computed;
- } else if (!computed) {
- if (type == LAZY_FILTER_FLAG) {
- continue outer;
- } else {
- break outer;
- }
- }
- }
- result[resIndex++] = value;
- }
- return result;
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a cache object to store key/value pairs.
- *
- * @private
- * @static
- * @name Cache
- * @memberOf _.memoize
- */
- function MapCache() {
- this.__data__ = {};
- }
-
- /**
- * Removes `key` and its value from the cache.
- *
- * @private
- * @name delete
- * @memberOf _.memoize.Cache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`.
- */
- function mapDelete(key) {
- return this.has(key) && delete this.__data__[key];
- }
-
- /**
- * Gets the cached value for `key`.
- *
- * @private
- * @name get
- * @memberOf _.memoize.Cache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the cached value.
- */
- function mapGet(key) {
- return key == '__proto__' ? undefined : this.__data__[key];
- }
-
- /**
- * Checks if a cached value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf _.memoize.Cache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function mapHas(key) {
- return key != '__proto__' && hasOwnProperty.call(this.__data__, key);
- }
-
- /**
- * Sets `value` to `key` of the cache.
- *
- * @private
- * @name set
- * @memberOf _.memoize.Cache
- * @param {string} key The key of the value to cache.
- * @param {*} value The value to cache.
- * @returns {Object} Returns the cache object.
- */
- function mapSet(key, value) {
- if (key != '__proto__') {
- this.__data__[key] = value;
- }
- return this;
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- *
- * Creates a cache object to store unique values.
- *
- * @private
- * @param {Array} [values] The values to cache.
- */
- function SetCache(values) {
- var length = values ? values.length : 0;
-
- this.data = { 'hash': nativeCreate(null), 'set': new Set };
- while (length--) {
- this.push(values[length]);
- }
- }
-
- /**
- * Checks if `value` is in `cache` mimicking the return signature of
- * `_.indexOf` by returning `0` if the value is found, else `-1`.
- *
- * @private
- * @param {Object} cache The cache to search.
- * @param {*} value The value to search for.
- * @returns {number} Returns `0` if `value` is found, else `-1`.
- */
- function cacheIndexOf(cache, value) {
- var data = cache.data,
- result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
-
- return result ? 0 : -1;
- }
-
- /**
- * Adds `value` to the cache.
- *
- * @private
- * @name push
- * @memberOf SetCache
- * @param {*} value The value to cache.
- */
- function cachePush(value) {
- var data = this.data;
- if (typeof value == 'string' || isObject(value)) {
- data.set.add(value);
- } else {
- data.hash[value] = true;
- }
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a new array joining `array` with `other`.
- *
- * @private
- * @param {Array} array The array to join.
- * @param {Array} other The other array to join.
- * @returns {Array} Returns the new concatenated array.
- */
- function arrayConcat(array, other) {
- var index = -1,
- length = array.length,
- othIndex = -1,
- othLength = other.length,
- result = Array(length + othLength);
-
- while (++index < length) {
- result[index] = array[index];
- }
- while (++othIndex < othLength) {
- result[index++] = other[othIndex];
- }
- return result;
- }
-
- /**
- * Copies the values of `source` to `array`.
- *
- * @private
- * @param {Array} source The array to copy values from.
- * @param {Array} [array=[]] The array to copy values to.
- * @returns {Array} Returns `array`.
- */
- function arrayCopy(source, array) {
- var index = -1,
- length = source.length;
-
- array || (array = Array(length));
- while (++index < length) {
- array[index] = source[index];
- }
- return array;
- }
-
- /**
- * A specialized version of `_.forEach` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
- function arrayEach(array, iteratee) {
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- if (iteratee(array[index], index, array) === false) {
- break;
- }
- }
- return array;
- }
-
- /**
- * A specialized version of `_.forEachRight` for arrays without support for
- * callback shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
- function arrayEachRight(array, iteratee) {
- var length = array.length;
-
- while (length--) {
- if (iteratee(array[length], length, array) === false) {
- break;
- }
- }
- return array;
- }
-
- /**
- * A specialized version of `_.every` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- */
- function arrayEvery(array, predicate) {
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- if (!predicate(array[index], index, array)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * A specialized version of `baseExtremum` for arrays which invokes `iteratee`
- * with one argument: (value).
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} comparator The function used to compare values.
- * @param {*} exValue The initial extremum value.
- * @returns {*} Returns the extremum value.
- */
- function arrayExtremum(array, iteratee, comparator, exValue) {
- var index = -1,
- length = array.length,
- computed = exValue,
- result = computed;
-
- while (++index < length) {
- var value = array[index],
- current = +iteratee(value);
-
- if (comparator(current, computed)) {
- computed = current;
- result = value;
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `_.filter` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function arrayFilter(array, predicate) {
- var index = -1,
- length = array.length,
- resIndex = -1,
- result = [];
-
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result[++resIndex] = value;
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `_.map` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- */
- function arrayMap(array, iteratee) {
- var index = -1,
- length = array.length,
- result = Array(length);
-
- while (++index < length) {
- result[index] = iteratee(array[index], index, array);
- }
- return result;
- }
-
- /**
- * Appends the elements of `values` to `array`.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {Array} values The values to append.
- * @returns {Array} Returns `array`.
- */
- function arrayPush(array, values) {
- var index = -1,
- length = values.length,
- offset = array.length;
-
- while (++index < length) {
- array[offset + index] = values[index];
- }
- return array;
- }
-
- /**
- * A specialized version of `_.reduce` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {boolean} [initFromArray] Specify using the first element of `array`
- * as the initial value.
- * @returns {*} Returns the accumulated value.
- */
- function arrayReduce(array, iteratee, accumulator, initFromArray) {
- var index = -1,
- length = array.length;
-
- if (initFromArray && length) {
- accumulator = array[++index];
- }
- while (++index < length) {
- accumulator = iteratee(accumulator, array[index], index, array);
- }
- return accumulator;
- }
-
- /**
- * A specialized version of `_.reduceRight` for arrays without support for
- * callback shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {boolean} [initFromArray] Specify using the last element of `array`
- * as the initial value.
- * @returns {*} Returns the accumulated value.
- */
- function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
- var length = array.length;
- if (initFromArray && length) {
- accumulator = array[--length];
- }
- while (length--) {
- accumulator = iteratee(accumulator, array[length], length, array);
- }
- return accumulator;
- }
-
- /**
- * A specialized version of `_.some` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- */
- function arraySome(array, predicate) {
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- if (predicate(array[index], index, array)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * A specialized version of `_.sum` for arrays without support for callback
- * shorthands and `this` binding..
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {number} Returns the sum.
- */
- function arraySum(array, iteratee) {
- var length = array.length,
- result = 0;
-
- while (length--) {
- result += +iteratee(array[length]) || 0;
- }
- return result;
- }
-
- /**
- * Used by `_.defaults` to customize its `_.assign` use.
- *
- * @private
- * @param {*} objectValue The destination object property value.
- * @param {*} sourceValue The source object property value.
- * @returns {*} Returns the value to assign to the destination object.
- */
- function assignDefaults(objectValue, sourceValue) {
- return objectValue === undefined ? sourceValue : objectValue;
- }
-
- /**
- * Used by `_.template` to customize its `_.assign` use.
- *
- * **Note:** This function is like `assignDefaults` except that it ignores
- * inherited property values when checking if a property is `undefined`.
- *
- * @private
- * @param {*} objectValue The destination object property value.
- * @param {*} sourceValue The source object property value.
- * @param {string} key The key associated with the object and source values.
- * @param {Object} object The destination object.
- * @returns {*} Returns the value to assign to the destination object.
- */
- function assignOwnDefaults(objectValue, sourceValue, key, object) {
- return (objectValue === undefined || !hasOwnProperty.call(object, key))
- ? sourceValue
- : objectValue;
- }
-
- /**
- * A specialized version of `_.assign` for customizing assigned values without
- * support for argument juggling, multiple sources, and `this` binding `customizer`
- * functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {Function} customizer The function to customize assigned values.
- * @returns {Object} Returns `object`.
- */
- function assignWith(object, source, customizer) {
- var index = -1,
- props = keys(source),
- length = props.length;
-
- while (++index < length) {
- var key = props[index],
- value = object[key],
- result = customizer(value, source[key], key, object, source);
-
- if ((result === result ? (result !== value) : (value === value)) ||
- (value === undefined && !(key in object))) {
- object[key] = result;
- }
- }
- return object;
- }
-
- /**
- * The base implementation of `_.assign` without support for argument juggling,
- * multiple sources, and `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
- function baseAssign(object, source) {
- return source == null
- ? object
- : baseCopy(source, keys(source), object);
- }
-
- /**
- * The base implementation of `_.at` without support for string collections
- * and individual key arguments.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {number[]|string[]} props The property names or indexes of elements to pick.
- * @returns {Array} Returns the new array of picked elements.
- */
- function baseAt(collection, props) {
- var index = -1,
- isNil = collection == null,
- isArr = !isNil && isArrayLike(collection),
- length = isArr ? collection.length : 0,
- propsLength = props.length,
- result = Array(propsLength);
-
- while(++index < propsLength) {
- var key = props[index];
- if (isArr) {
- result[index] = isIndex(key, length) ? collection[key] : undefined;
- } else {
- result[index] = isNil ? undefined : collection[key];
- }
- }
- return result;
- }
-
- /**
- * Copies properties of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy properties from.
- * @param {Array} props The property names to copy.
- * @param {Object} [object={}] The object to copy properties to.
- * @returns {Object} Returns `object`.
- */
- function baseCopy(source, props, object) {
- object || (object = {});
-
- var index = -1,
- length = props.length;
-
- while (++index < length) {
- var key = props[index];
- object[key] = source[key];
- }
- return object;
- }
-
- /**
- * The base implementation of `_.callback` which supports specifying the
- * number of arguments to provide to `func`.
- *
- * @private
- * @param {*} [func=_.identity] The value to convert to a callback.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {number} [argCount] The number of arguments to provide to `func`.
- * @returns {Function} Returns the callback.
- */
- function baseCallback(func, thisArg, argCount) {
- var type = typeof func;
- if (type == 'function') {
- return thisArg === undefined
- ? func
- : bindCallback(func, thisArg, argCount);
- }
- if (func == null) {
- return identity;
- }
- if (type == 'object') {
- return baseMatches(func);
- }
- return thisArg === undefined
- ? property(func)
- : baseMatchesProperty(func, thisArg);
- }
-
- /**
- * The base implementation of `_.clone` without support for argument juggling
- * and `this` binding `customizer` functions.
- *
- * @private
- * @param {*} value The value to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @param {Function} [customizer] The function to customize cloning values.
- * @param {string} [key] The key of `value`.
- * @param {Object} [object] The object `value` belongs to.
- * @param {Array} [stackA=[]] Tracks traversed source objects.
- * @param {Array} [stackB=[]] Associates clones with source counterparts.
- * @returns {*} Returns the cloned value.
- */
- function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
- var result;
- if (customizer) {
- result = object ? customizer(value, key, object) : customizer(value);
- }
- if (result !== undefined) {
- return result;
- }
- if (!isObject(value)) {
- return value;
- }
- var isArr = isArray(value);
- if (isArr) {
- result = initCloneArray(value);
- if (!isDeep) {
- return arrayCopy(value, result);
- }
- } else {
- var tag = objToString.call(value),
- isFunc = tag == funcTag;
-
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
- result = initCloneObject(isFunc ? {} : value);
- if (!isDeep) {
- return baseAssign(result, value);
- }
- } else {
- return cloneableTags[tag]
- ? initCloneByTag(value, tag, isDeep)
- : (object ? value : {});
- }
- }
- // Check for circular references and return its corresponding clone.
- stackA || (stackA = []);
- stackB || (stackB = []);
-
- var length = stackA.length;
- while (length--) {
- if (stackA[length] == value) {
- return stackB[length];
- }
- }
- // Add the source value to the stack of traversed objects and associate it with its clone.
- stackA.push(value);
- stackB.push(result);
-
- // Recursively populate clone (susceptible to call stack limits).
- (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
- result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
- });
- return result;
- }
-
- /**
- * The base implementation of `_.create` without support for assigning
- * properties to the created object.
- *
- * @private
- * @param {Object} prototype The object to inherit from.
- * @returns {Object} Returns the new object.
- */
- var baseCreate = (function() {
- function object() {}
- return function(prototype) {
- if (isObject(prototype)) {
- object.prototype = prototype;
- var result = new object;
- object.prototype = undefined;
- }
- return result || {};
- };
- }());
-
- /**
- * The base implementation of `_.delay` and `_.defer` which accepts an index
- * of where to slice the arguments to provide to `func`.
- *
- * @private
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @param {Object} args The arguments provide to `func`.
- * @returns {number} Returns the timer id.
- */
- function baseDelay(func, wait, args) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return setTimeout(function() { func.apply(undefined, args); }, wait);
- }
-
- /**
- * The base implementation of `_.difference` which accepts a single array
- * of values to exclude.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Array} values The values to exclude.
- * @returns {Array} Returns the new array of filtered values.
- */
- function baseDifference(array, values) {
- var length = array ? array.length : 0,
- result = [];
-
- if (!length) {
- return result;
- }
- var index = -1,
- indexOf = getIndexOf(),
- isCommon = indexOf == baseIndexOf,
- cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
- valuesLength = values.length;
-
- if (cache) {
- indexOf = cacheIndexOf;
- isCommon = false;
- values = cache;
- }
- outer:
- while (++index < length) {
- var value = array[index];
-
- if (isCommon && value === value) {
- var valuesIndex = valuesLength;
- while (valuesIndex--) {
- if (values[valuesIndex] === value) {
- continue outer;
- }
- }
- result.push(value);
- }
- else if (indexOf(values, value, 0) < 0) {
- result.push(value);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.forEach` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array|Object|string} Returns `collection`.
- */
- var baseEach = createBaseEach(baseForOwn);
-
- /**
- * The base implementation of `_.forEachRight` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array|Object|string} Returns `collection`.
- */
- var baseEachRight = createBaseEach(baseForOwnRight, true);
-
- /**
- * The base implementation of `_.every` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`
- */
- function baseEvery(collection, predicate) {
- var result = true;
- baseEach(collection, function(value, index, collection) {
- result = !!predicate(value, index, collection);
- return result;
- });
- return result;
- }
-
- /**
- * Gets the extremum value of `collection` invoking `iteratee` for each value
- * in `collection` to generate the criterion by which the value is ranked.
- * The `iteratee` is invoked with three arguments: (value, index|key, collection).
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} comparator The function used to compare values.
- * @param {*} exValue The initial extremum value.
- * @returns {*} Returns the extremum value.
- */
- function baseExtremum(collection, iteratee, comparator, exValue) {
- var computed = exValue,
- result = computed;
-
- baseEach(collection, function(value, index, collection) {
- var current = +iteratee(value, index, collection);
- if (comparator(current, computed) || (current === exValue && current === result)) {
- computed = current;
- result = value;
- }
- });
- return result;
- }
-
- /**
- * The base implementation of `_.fill` without an iteratee call guard.
- *
- * @private
- * @param {Array} array The array to fill.
- * @param {*} value The value to fill `array` with.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns `array`.
- */
- function baseFill(array, value, start, end) {
- var length = array.length;
-
- start = start == null ? 0 : (+start || 0);
- if (start < 0) {
- start = -start > length ? 0 : (length + start);
- }
- end = (end === undefined || end > length) ? length : (+end || 0);
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : (end >>> 0);
- start >>>= 0;
-
- while (start < length) {
- array[start++] = value;
- }
- return array;
- }
-
- /**
- * The base implementation of `_.filter` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function baseFilter(collection, predicate) {
- var result = [];
- baseEach(collection, function(value, index, collection) {
- if (predicate(value, index, collection)) {
- result.push(value);
- }
- });
- return result;
- }
-
- /**
- * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
- * without support for callback shorthands and `this` binding, which iterates
- * over `collection` using the provided `eachFunc`.
- *
- * @private
- * @param {Array|Object|string} collection The collection to search.
- * @param {Function} predicate The function invoked per iteration.
- * @param {Function} eachFunc The function to iterate over `collection`.
- * @param {boolean} [retKey] Specify returning the key of the found element
- * instead of the element itself.
- * @returns {*} Returns the found element or its key, else `undefined`.
- */
- function baseFind(collection, predicate, eachFunc, retKey) {
- var result;
- eachFunc(collection, function(value, key, collection) {
- if (predicate(value, key, collection)) {
- result = retKey ? key : value;
- return false;
- }
- });
- return result;
- }
-
- /**
- * The base implementation of `_.flatten` with added support for restricting
- * flattening and specifying the start index.
- *
- * @private
- * @param {Array} array The array to flatten.
- * @param {boolean} [isDeep] Specify a deep flatten.
- * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
- * @param {Array} [result=[]] The initial result value.
- * @returns {Array} Returns the new flattened array.
- */
- function baseFlatten(array, isDeep, isStrict, result) {
- result || (result = []);
-
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- var value = array[index];
- if (isObjectLike(value) && isArrayLike(value) &&
- (isStrict || isArray(value) || isArguments(value))) {
- if (isDeep) {
- // Recursively flatten arrays (susceptible to call stack limits).
- baseFlatten(value, isDeep, isStrict, result);
- } else {
- arrayPush(result, value);
- }
- } else if (!isStrict) {
- result[result.length] = value;
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `baseForIn` and `baseForOwn` which iterates
- * over `object` properties returned by `keysFunc` invoking `iteratee` for
- * each property. Iteratee functions may exit iteration early by explicitly
- * returning `false`.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @returns {Object} Returns `object`.
- */
- var baseFor = createBaseFor();
-
- /**
- * This function is like `baseFor` except that it iterates over properties
- * in the opposite order.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @returns {Object} Returns `object`.
- */
- var baseForRight = createBaseFor(true);
-
- /**
- * The base implementation of `_.forIn` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function baseForIn(object, iteratee) {
- return baseFor(object, iteratee, keysIn);
- }
-
- /**
- * The base implementation of `_.forOwn` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function baseForOwn(object, iteratee) {
- return baseFor(object, iteratee, keys);
- }
-
- /**
- * The base implementation of `_.forOwnRight` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function baseForOwnRight(object, iteratee) {
- return baseForRight(object, iteratee, keys);
- }
-
- /**
- * The base implementation of `_.functions` which creates an array of
- * `object` function property names filtered from those provided.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Array} props The property names to filter.
- * @returns {Array} Returns the new array of filtered property names.
- */
- function baseFunctions(object, props) {
- var index = -1,
- length = props.length,
- resIndex = -1,
- result = [];
-
- while (++index < length) {
- var key = props[index];
- if (isFunction(object[key])) {
- result[++resIndex] = key;
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `get` without support for string paths
- * and default values.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} path The path of the property to get.
- * @param {string} [pathKey] The key representation of path.
- * @returns {*} Returns the resolved value.
- */
- function baseGet(object, path, pathKey) {
- if (object == null) {
- return;
- }
- if (pathKey !== undefined && pathKey in toObject(object)) {
- path = [pathKey];
- }
- var index = 0,
- length = path.length;
-
- while (object != null && index < length) {
- object = object[path[index++]];
- }
- return (index && index == length) ? object : undefined;
- }
-
- /**
- * The base implementation of `_.isEqual` without support for `this` binding
- * `customizer` functions.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {Function} [customizer] The function to customize comparing values.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA] Tracks traversed `value` objects.
- * @param {Array} [stackB] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- */
- function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
- if (value === other) {
- return true;
- }
- if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
- return value !== value && other !== other;
- }
- return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
- }
-
- /**
- * A specialized version of `baseIsEqual` for arrays and objects which performs
- * deep comparisons and tracks traversed objects enabling objects with circular
- * references to be compared.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Function} [customizer] The function to customize comparing objects.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA=[]] Tracks traversed `value` objects.
- * @param {Array} [stackB=[]] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
- var objIsArr = isArray(object),
- othIsArr = isArray(other),
- objTag = arrayTag,
- othTag = arrayTag;
-
- if (!objIsArr) {
- objTag = objToString.call(object);
- if (objTag == argsTag) {
- objTag = objectTag;
- } else if (objTag != objectTag) {
- objIsArr = isTypedArray(object);
- }
- }
- if (!othIsArr) {
- othTag = objToString.call(other);
- if (othTag == argsTag) {
- othTag = objectTag;
- } else if (othTag != objectTag) {
- othIsArr = isTypedArray(other);
- }
- }
- var objIsObj = objTag == objectTag,
- othIsObj = othTag == objectTag,
- isSameTag = objTag == othTag;
-
- if (isSameTag && !(objIsArr || objIsObj)) {
- return equalByTag(object, other, objTag);
- }
- if (!isLoose) {
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
- othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
-
- if (objIsWrapped || othIsWrapped) {
- return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
- }
- }
- if (!isSameTag) {
- return false;
- }
- // Assume cyclic values are equal.
- // For more information on detecting circular references see https://es5.github.io/#JO.
- stackA || (stackA = []);
- stackB || (stackB = []);
-
- var length = stackA.length;
- while (length--) {
- if (stackA[length] == object) {
- return stackB[length] == other;
- }
- }
- // Add `object` and `other` to the stack of traversed objects.
- stackA.push(object);
- stackB.push(other);
-
- var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
-
- stackA.pop();
- stackB.pop();
-
- return result;
- }
-
- /**
- * The base implementation of `_.isMatch` without support for callback
- * shorthands and `this` binding.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Array} matchData The propery names, values, and compare flags to match.
- * @param {Function} [customizer] The function to customize comparing objects.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- */
- function baseIsMatch(object, matchData, customizer) {
- var index = matchData.length,
- length = index,
- noCustomizer = !customizer;
-
- if (object == null) {
- return !length;
- }
- object = toObject(object);
- while (index--) {
- var data = matchData[index];
- if ((noCustomizer && data[2])
- ? data[1] !== object[data[0]]
- : !(data[0] in object)
- ) {
- return false;
- }
- }
- while (++index < length) {
- data = matchData[index];
- var key = data[0],
- objValue = object[key],
- srcValue = data[1];
-
- if (noCustomizer && data[2]) {
- if (objValue === undefined && !(key in object)) {
- return false;
- }
- } else {
- var result = customizer ? customizer(objValue, srcValue, key) : undefined;
- if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
- return false;
- }
- }
- }
- return true;
- }
-
- /**
- * The base implementation of `_.map` without support for callback shorthands
- * and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- */
- function baseMap(collection, iteratee) {
- var index = -1,
- result = isArrayLike(collection) ? Array(collection.length) : [];
-
- baseEach(collection, function(value, key, collection) {
- result[++index] = iteratee(value, key, collection);
- });
- return result;
- }
-
- /**
- * The base implementation of `_.matches` which does not clone `source`.
- *
- * @private
- * @param {Object} source The object of property values to match.
- * @returns {Function} Returns the new function.
- */
- function baseMatches(source) {
- var matchData = getMatchData(source);
- if (matchData.length == 1 && matchData[0][2]) {
- var key = matchData[0][0],
- value = matchData[0][1];
-
- return function(object) {
- if (object == null) {
- return false;
- }
- return object[key] === value && (value !== undefined || (key in toObject(object)));
- };
- }
- return function(object) {
- return baseIsMatch(object, matchData);
- };
- }
-
- /**
- * The base implementation of `_.matchesProperty` which does not clone `srcValue`.
- *
- * @private
- * @param {string} path The path of the property to get.
- * @param {*} srcValue The value to compare.
- * @returns {Function} Returns the new function.
- */
- function baseMatchesProperty(path, srcValue) {
- var isArr = isArray(path),
- isCommon = isKey(path) && isStrictComparable(srcValue),
- pathKey = (path + '');
-
- path = toPath(path);
- return function(object) {
- if (object == null) {
- return false;
- }
- var key = pathKey;
- object = toObject(object);
- if ((isArr || !isCommon) && !(key in object)) {
- object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
- if (object == null) {
- return false;
- }
- key = last(path);
- object = toObject(object);
- }
- return object[key] === srcValue
- ? (srcValue !== undefined || (key in object))
- : baseIsEqual(srcValue, object[key], undefined, true);
- };
- }
-
- /**
- * The base implementation of `_.merge` without support for argument juggling,
- * multiple sources, and `this` binding `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {Function} [customizer] The function to customize merged values.
- * @param {Array} [stackA=[]] Tracks traversed source objects.
- * @param {Array} [stackB=[]] Associates values with source counterparts.
- * @returns {Object} Returns `object`.
- */
- function baseMerge(object, source, customizer, stackA, stackB) {
- if (!isObject(object)) {
- return object;
- }
- var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
- props = isSrcArr ? undefined : keys(source);
-
- arrayEach(props || source, function(srcValue, key) {
- if (props) {
- key = srcValue;
- srcValue = source[key];
- }
- if (isObjectLike(srcValue)) {
- stackA || (stackA = []);
- stackB || (stackB = []);
- baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
- }
- else {
- var value = object[key],
- result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
- isCommon = result === undefined;
-
- if (isCommon) {
- result = srcValue;
- }
- if ((result !== undefined || (isSrcArr && !(key in object))) &&
- (isCommon || (result === result ? (result !== value) : (value === value)))) {
- object[key] = result;
- }
- }
- });
- return object;
- }
-
- /**
- * A specialized version of `baseMerge` for arrays and objects which performs
- * deep merges and tracks traversed objects enabling objects with circular
- * references to be merged.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {string} key The key of the value to merge.
- * @param {Function} mergeFunc The function to merge values.
- * @param {Function} [customizer] The function to customize merged values.
- * @param {Array} [stackA=[]] Tracks traversed source objects.
- * @param {Array} [stackB=[]] Associates values with source counterparts.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
- var length = stackA.length,
- srcValue = source[key];
-
- while (length--) {
- if (stackA[length] == srcValue) {
- object[key] = stackB[length];
- return;
- }
- }
- var value = object[key],
- result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
- isCommon = result === undefined;
-
- if (isCommon) {
- result = srcValue;
- if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
- result = isArray(value)
- ? value
- : (isArrayLike(value) ? arrayCopy(value) : []);
- }
- else if (isPlainObject(srcValue) || isArguments(srcValue)) {
- result = isArguments(value)
- ? toPlainObject(value)
- : (isPlainObject(value) ? value : {});
- }
- else {
- isCommon = false;
- }
- }
- // Add the source value to the stack of traversed objects and associate
- // it with its merged value.
- stackA.push(srcValue);
- stackB.push(result);
-
- if (isCommon) {
- // Recursively merge objects and arrays (susceptible to call stack limits).
- object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
- } else if (result === result ? (result !== value) : (value === value)) {
- object[key] = result;
- }
- }
-
- /**
- * The base implementation of `_.property` without support for deep paths.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @returns {Function} Returns the new function.
- */
- function baseProperty(key) {
- return function(object) {
- return object == null ? undefined : object[key];
- };
- }
-
- /**
- * A specialized version of `baseProperty` which supports deep paths.
- *
- * @private
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new function.
- */
- function basePropertyDeep(path) {
- var pathKey = (path + '');
- path = toPath(path);
- return function(object) {
- return baseGet(object, path, pathKey);
- };
- }
-
- /**
- * The base implementation of `_.pullAt` without support for individual
- * index arguments and capturing the removed elements.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {number[]} indexes The indexes of elements to remove.
- * @returns {Array} Returns `array`.
- */
- function basePullAt(array, indexes) {
- var length = array ? indexes.length : 0;
- while (length--) {
- var index = indexes[length];
- if (index != previous && isIndex(index)) {
- var previous = index;
- splice.call(array, index, 1);
- }
- }
- return array;
- }
-
- /**
- * The base implementation of `_.random` without support for argument juggling
- * and returning floating-point numbers.
- *
- * @private
- * @param {number} min The minimum possible value.
- * @param {number} max The maximum possible value.
- * @returns {number} Returns the random number.
- */
- function baseRandom(min, max) {
- return min + nativeFloor(nativeRandom() * (max - min + 1));
- }
-
- /**
- * The base implementation of `_.reduce` and `_.reduceRight` without support
- * for callback shorthands and `this` binding, which iterates over `collection`
- * using the provided `eachFunc`.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} accumulator The initial value.
- * @param {boolean} initFromCollection Specify using the first or last element
- * of `collection` as the initial value.
- * @param {Function} eachFunc The function to iterate over `collection`.
- * @returns {*} Returns the accumulated value.
- */
- function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
- eachFunc(collection, function(value, index, collection) {
- accumulator = initFromCollection
- ? (initFromCollection = false, value)
- : iteratee(accumulator, value, index, collection);
- });
- return accumulator;
- }
-
- /**
- * The base implementation of `setData` without support for hot loop detection.
- *
- * @private
- * @param {Function} func The function to associate metadata with.
- * @param {*} data The metadata.
- * @returns {Function} Returns `func`.
- */
- var baseSetData = !metaMap ? identity : function(func, data) {
- metaMap.set(func, data);
- return func;
- };
-
- /**
- * The base implementation of `_.slice` without an iteratee call guard.
- *
- * @private
- * @param {Array} array The array to slice.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns the slice of `array`.
- */
- function baseSlice(array, start, end) {
- var index = -1,
- length = array.length;
-
- start = start == null ? 0 : (+start || 0);
- if (start < 0) {
- start = -start > length ? 0 : (length + start);
- }
- end = (end === undefined || end > length) ? length : (+end || 0);
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : ((end - start) >>> 0);
- start >>>= 0;
-
- var result = Array(length);
- while (++index < length) {
- result[index] = array[index + start];
- }
- return result;
- }
-
- /**
- * The base implementation of `_.some` without support for callback shorthands
- * and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- */
- function baseSome(collection, predicate) {
- var result;
-
- baseEach(collection, function(value, index, collection) {
- result = predicate(value, index, collection);
- return !result;
- });
- return !!result;
- }
-
- /**
- * The base implementation of `_.sortBy` which uses `comparer` to define
- * the sort order of `array` and replaces criteria objects with their
- * corresponding values.
- *
- * @private
- * @param {Array} array The array to sort.
- * @param {Function} comparer The function to define sort order.
- * @returns {Array} Returns `array`.
- */
- function baseSortBy(array, comparer) {
- var length = array.length;
-
- array.sort(comparer);
- while (length--) {
- array[length] = array[length].value;
- }
- return array;
- }
-
- /**
- * The base implementation of `_.sortByOrder` without param guards.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
- * @param {boolean[]} orders The sort orders of `iteratees`.
- * @returns {Array} Returns the new sorted array.
- */
- function baseSortByOrder(collection, iteratees, orders) {
- var callback = getCallback(),
- index = -1;
-
- iteratees = arrayMap(iteratees, function(iteratee) { return callback(iteratee); });
-
- var result = baseMap(collection, function(value) {
- var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); });
- return { 'criteria': criteria, 'index': ++index, 'value': value };
- });
-
- return baseSortBy(result, function(object, other) {
- return compareMultiple(object, other, orders);
- });
- }
-
- /**
- * The base implementation of `_.sum` without support for callback shorthands
- * and `this` binding.
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {number} Returns the sum.
- */
- function baseSum(collection, iteratee) {
- var result = 0;
- baseEach(collection, function(value, index, collection) {
- result += +iteratee(value, index, collection) || 0;
- });
- return result;
- }
-
- /**
- * The base implementation of `_.uniq` without support for callback shorthands
- * and `this` binding.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The function invoked per iteration.
- * @returns {Array} Returns the new duplicate-value-free array.
- */
- function baseUniq(array, iteratee) {
- var index = -1,
- indexOf = getIndexOf(),
- length = array.length,
- isCommon = indexOf == baseIndexOf,
- isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
- seen = isLarge ? createCache() : null,
- result = [];
-
- if (seen) {
- indexOf = cacheIndexOf;
- isCommon = false;
- } else {
- isLarge = false;
- seen = iteratee ? [] : result;
- }
- outer:
- while (++index < length) {
- var value = array[index],
- computed = iteratee ? iteratee(value, index, array) : value;
-
- if (isCommon && value === value) {
- var seenIndex = seen.length;
- while (seenIndex--) {
- if (seen[seenIndex] === computed) {
- continue outer;
- }
- }
- if (iteratee) {
- seen.push(computed);
- }
- result.push(value);
- }
- else if (indexOf(seen, computed, 0) < 0) {
- if (iteratee || isLarge) {
- seen.push(computed);
- }
- result.push(value);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.values` and `_.valuesIn` which creates an
- * array of `object` property values corresponding to the property names
- * of `props`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} props The property names to get values for.
- * @returns {Object} Returns the array of property values.
- */
- function baseValues(object, props) {
- var index = -1,
- length = props.length,
- result = Array(length);
-
- while (++index < length) {
- result[index] = object[props[index]];
- }
- return result;
- }
-
- /**
- * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`,
- * and `_.takeWhile` without support for callback shorthands and `this` binding.
- *
- * @private
- * @param {Array} array The array to query.
- * @param {Function} predicate The function invoked per iteration.
- * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Array} Returns the slice of `array`.
- */
- function baseWhile(array, predicate, isDrop, fromRight) {
- var length = array.length,
- index = fromRight ? length : -1;
-
- while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
- return isDrop
- ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
- : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
- }
-
- /**
- * The base implementation of `wrapperValue` which returns the result of
- * performing a sequence of actions on the unwrapped `value`, where each
- * successive action is supplied the return value of the previous.
- *
- * @private
- * @param {*} value The unwrapped value.
- * @param {Array} actions Actions to peform to resolve the unwrapped value.
- * @returns {*} Returns the resolved value.
- */
- function baseWrapperValue(value, actions) {
- var result = value;
- if (result instanceof LazyWrapper) {
- result = result.value();
- }
- var index = -1,
- length = actions.length;
-
- while (++index < length) {
- var action = actions[index];
- result = action.func.apply(action.thisArg, arrayPush([result], action.args));
- }
- return result;
- }
-
- /**
- * Performs a binary search of `array` to determine the index at which `value`
- * should be inserted into `array` in order to maintain its sort order.
- *
- * @private
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {boolean} [retHighest] Specify returning the highest qualified index.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- */
- function binaryIndex(array, value, retHighest) {
- var low = 0,
- high = array ? array.length : low;
-
- if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
- while (low < high) {
- var mid = (low + high) >>> 1,
- computed = array[mid];
-
- if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return high;
- }
- return binaryIndexBy(array, value, identity, retHighest);
- }
-
- /**
- * This function is like `binaryIndex` except that it invokes `iteratee` for
- * `value` and each element of `array` to compute their sort ranking. The
- * iteratee is invoked with one argument; (value).
- *
- * @private
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {boolean} [retHighest] Specify returning the highest qualified index.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- */
- function binaryIndexBy(array, value, iteratee, retHighest) {
- value = iteratee(value);
-
- var low = 0,
- high = array ? array.length : 0,
- valIsNaN = value !== value,
- valIsNull = value === null,
- valIsUndef = value === undefined;
-
- while (low < high) {
- var mid = nativeFloor((low + high) / 2),
- computed = iteratee(array[mid]),
- isDef = computed !== undefined,
- isReflexive = computed === computed;
-
- if (valIsNaN) {
- var setLow = isReflexive || retHighest;
- } else if (valIsNull) {
- setLow = isReflexive && isDef && (retHighest || computed != null);
- } else if (valIsUndef) {
- setLow = isReflexive && (retHighest || isDef);
- } else if (computed == null) {
- setLow = false;
- } else {
- setLow = retHighest ? (computed <= value) : (computed < value);
- }
- if (setLow) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return nativeMin(high, MAX_ARRAY_INDEX);
- }
-
- /**
- * A specialized version of `baseCallback` which only supports `this` binding
- * and specifying the number of arguments to provide to `func`.
- *
- * @private
- * @param {Function} func The function to bind.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {number} [argCount] The number of arguments to provide to `func`.
- * @returns {Function} Returns the callback.
- */
- function bindCallback(func, thisArg, argCount) {
- if (typeof func != 'function') {
- return identity;
- }
- if (thisArg === undefined) {
- return func;
- }
- switch (argCount) {
- case 1: return function(value) {
- return func.call(thisArg, value);
- };
- case 3: return function(value, index, collection) {
- return func.call(thisArg, value, index, collection);
- };
- case 4: return function(accumulator, value, index, collection) {
- return func.call(thisArg, accumulator, value, index, collection);
- };
- case 5: return function(value, other, key, object, source) {
- return func.call(thisArg, value, other, key, object, source);
- };
- }
- return function() {
- return func.apply(thisArg, arguments);
- };
- }
-
- /**
- * Creates a clone of the given array buffer.
- *
- * @private
- * @param {ArrayBuffer} buffer The array buffer to clone.
- * @returns {ArrayBuffer} Returns the cloned array buffer.
- */
- function bufferClone(buffer) {
- var result = new ArrayBuffer(buffer.byteLength),
- view = new Uint8Array(result);
-
- view.set(new Uint8Array(buffer));
- return result;
- }
-
- /**
- * Creates an array that is the composition of partially applied arguments,
- * placeholders, and provided arguments into a single array of arguments.
- *
- * @private
- * @param {Array|Object} args The provided arguments.
- * @param {Array} partials The arguments to prepend to those provided.
- * @param {Array} holders The `partials` placeholder indexes.
- * @returns {Array} Returns the new array of composed arguments.
- */
- function composeArgs(args, partials, holders) {
- var holdersLength = holders.length,
- argsIndex = -1,
- argsLength = nativeMax(args.length - holdersLength, 0),
- leftIndex = -1,
- leftLength = partials.length,
- result = Array(leftLength + argsLength);
-
- while (++leftIndex < leftLength) {
- result[leftIndex] = partials[leftIndex];
- }
- while (++argsIndex < holdersLength) {
- result[holders[argsIndex]] = args[argsIndex];
- }
- while (argsLength--) {
- result[leftIndex++] = args[argsIndex++];
- }
- return result;
- }
-
- /**
- * This function is like `composeArgs` except that the arguments composition
- * is tailored for `_.partialRight`.
- *
- * @private
- * @param {Array|Object} args The provided arguments.
- * @param {Array} partials The arguments to append to those provided.
- * @param {Array} holders The `partials` placeholder indexes.
- * @returns {Array} Returns the new array of composed arguments.
- */
- function composeArgsRight(args, partials, holders) {
- var holdersIndex = -1,
- holdersLength = holders.length,
- argsIndex = -1,
- argsLength = nativeMax(args.length - holdersLength, 0),
- rightIndex = -1,
- rightLength = partials.length,
- result = Array(argsLength + rightLength);
-
- while (++argsIndex < argsLength) {
- result[argsIndex] = args[argsIndex];
- }
- var offset = argsIndex;
- while (++rightIndex < rightLength) {
- result[offset + rightIndex] = partials[rightIndex];
- }
- while (++holdersIndex < holdersLength) {
- result[offset + holders[holdersIndex]] = args[argsIndex++];
- }
- return result;
- }
-
- /**
- * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition` function.
- *
- * @private
- * @param {Function} setter The function to set keys and values of the accumulator object.
- * @param {Function} [initializer] The function to initialize the accumulator object.
- * @returns {Function} Returns the new aggregator function.
- */
- function createAggregator(setter, initializer) {
- return function(collection, iteratee, thisArg) {
- var result = initializer ? initializer() : {};
- iteratee = getCallback(iteratee, thisArg, 3);
-
- if (isArray(collection)) {
- var index = -1,
- length = collection.length;
-
- while (++index < length) {
- var value = collection[index];
- setter(result, value, iteratee(value, index, collection), collection);
- }
- } else {
- baseEach(collection, function(value, key, collection) {
- setter(result, value, iteratee(value, key, collection), collection);
- });
- }
- return result;
- };
- }
-
- /**
- * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
- *
- * @private
- * @param {Function} assigner The function to assign values.
- * @returns {Function} Returns the new assigner function.
- */
- function createAssigner(assigner) {
- return restParam(function(object, sources) {
- var index = -1,
- length = object == null ? 0 : sources.length,
- customizer = length > 2 ? sources[length - 2] : undefined,
- guard = length > 2 ? sources[2] : undefined,
- thisArg = length > 1 ? sources[length - 1] : undefined;
-
- if (typeof customizer == 'function') {
- customizer = bindCallback(customizer, thisArg, 5);
- length -= 2;
- } else {
- customizer = typeof thisArg == 'function' ? thisArg : undefined;
- length -= (customizer ? 1 : 0);
- }
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? undefined : customizer;
- length = 1;
- }
- while (++index < length) {
- var source = sources[index];
- if (source) {
- assigner(object, source, customizer);
- }
- }
- return object;
- });
- }
-
- /**
- * Creates a `baseEach` or `baseEachRight` function.
- *
- * @private
- * @param {Function} eachFunc The function to iterate over a collection.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
- function createBaseEach(eachFunc, fromRight) {
- return function(collection, iteratee) {
- var length = collection ? getLength(collection) : 0;
- if (!isLength(length)) {
- return eachFunc(collection, iteratee);
- }
- var index = fromRight ? length : -1,
- iterable = toObject(collection);
-
- while ((fromRight ? index-- : ++index < length)) {
- if (iteratee(iterable[index], index, iterable) === false) {
- break;
- }
- }
- return collection;
- };
- }
-
- /**
- * Creates a base function for `_.forIn` or `_.forInRight`.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
- function createBaseFor(fromRight) {
- return function(object, iteratee, keysFunc) {
- var iterable = toObject(object),
- props = keysFunc(object),
- length = props.length,
- index = fromRight ? length : -1;
-
- while ((fromRight ? index-- : ++index < length)) {
- var key = props[index];
- if (iteratee(iterable[key], key, iterable) === false) {
- break;
- }
- }
- return object;
- };
- }
-
- /**
- * Creates a function that wraps `func` and invokes it with the `this`
- * binding of `thisArg`.
- *
- * @private
- * @param {Function} func The function to bind.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @returns {Function} Returns the new bound function.
- */
- function createBindWrapper(func, thisArg) {
- var Ctor = createCtorWrapper(func);
-
- function wrapper() {
- var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
- return fn.apply(thisArg, arguments);
- }
- return wrapper;
- }
-
- /**
- * Creates a `Set` cache object to optimize linear searches of large arrays.
- *
- * @private
- * @param {Array} [values] The values to cache.
- * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
- */
- function createCache(values) {
- return (nativeCreate && Set) ? new SetCache(values) : null;
- }
-
- /**
- * Creates a function that produces compound words out of the words in a
- * given string.
- *
- * @private
- * @param {Function} callback The function to combine each word.
- * @returns {Function} Returns the new compounder function.
- */
- function createCompounder(callback) {
- return function(string) {
- var index = -1,
- array = words(deburr(string)),
- length = array.length,
- result = '';
-
- while (++index < length) {
- result = callback(result, array[index], index);
- }
- return result;
- };
- }
-
- /**
- * Creates a function that produces an instance of `Ctor` regardless of
- * whether it was invoked as part of a `new` expression or by `call` or `apply`.
- *
- * @private
- * @param {Function} Ctor The constructor to wrap.
- * @returns {Function} Returns the new wrapped function.
- */
- function createCtorWrapper(Ctor) {
- return function() {
- // Use a `switch` statement to work with class constructors.
- // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
- // for more details.
- var args = arguments;
- switch (args.length) {
- case 0: return new Ctor;
- case 1: return new Ctor(args[0]);
- case 2: return new Ctor(args[0], args[1]);
- case 3: return new Ctor(args[0], args[1], args[2]);
- case 4: return new Ctor(args[0], args[1], args[2], args[3]);
- case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
- case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
- case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
- }
- var thisBinding = baseCreate(Ctor.prototype),
- result = Ctor.apply(thisBinding, args);
-
- // Mimic the constructor's `return` behavior.
- // See https://es5.github.io/#x13.2.2 for more details.
- return isObject(result) ? result : thisBinding;
- };
- }
-
- /**
- * Creates a `_.curry` or `_.curryRight` function.
- *
- * @private
- * @param {boolean} flag The curry bit flag.
- * @returns {Function} Returns the new curry function.
- */
- function createCurry(flag) {
- function curryFunc(func, arity, guard) {
- if (guard && isIterateeCall(func, arity, guard)) {
- arity = undefined;
- }
- var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity);
- result.placeholder = curryFunc.placeholder;
- return result;
- }
- return curryFunc;
- }
-
- /**
- * Creates a `_.defaults` or `_.defaultsDeep` function.
- *
- * @private
- * @param {Function} assigner The function to assign values.
- * @param {Function} customizer The function to customize assigned values.
- * @returns {Function} Returns the new defaults function.
- */
- function createDefaults(assigner, customizer) {
- return restParam(function(args) {
- var object = args[0];
- if (object == null) {
- return object;
- }
- args.push(customizer);
- return assigner.apply(undefined, args);
- });
- }
-
- /**
- * Creates a `_.max` or `_.min` function.
- *
- * @private
- * @param {Function} comparator The function used to compare values.
- * @param {*} exValue The initial extremum value.
- * @returns {Function} Returns the new extremum function.
- */
- function createExtremum(comparator, exValue) {
- return function(collection, iteratee, thisArg) {
- if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
- iteratee = undefined;
- }
- iteratee = getCallback(iteratee, thisArg, 3);
- if (iteratee.length == 1) {
- collection = isArray(collection) ? collection : toIterable(collection);
- var result = arrayExtremum(collection, iteratee, comparator, exValue);
- if (!(collection.length && result === exValue)) {
- return result;
- }
- }
- return baseExtremum(collection, iteratee, comparator, exValue);
- };
- }
-
- /**
- * Creates a `_.find` or `_.findLast` function.
- *
- * @private
- * @param {Function} eachFunc The function to iterate over a collection.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new find function.
- */
- function createFind(eachFunc, fromRight) {
- return function(collection, predicate, thisArg) {
- predicate = getCallback(predicate, thisArg, 3);
- if (isArray(collection)) {
- var index = baseFindIndex(collection, predicate, fromRight);
- return index > -1 ? collection[index] : undefined;
- }
- return baseFind(collection, predicate, eachFunc);
- };
- }
-
- /**
- * Creates a `_.findIndex` or `_.findLastIndex` function.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new find function.
- */
- function createFindIndex(fromRight) {
- return function(array, predicate, thisArg) {
- if (!(array && array.length)) {
- return -1;
- }
- predicate = getCallback(predicate, thisArg, 3);
- return baseFindIndex(array, predicate, fromRight);
- };
- }
-
- /**
- * Creates a `_.findKey` or `_.findLastKey` function.
- *
- * @private
- * @param {Function} objectFunc The function to iterate over an object.
- * @returns {Function} Returns the new find function.
- */
- function createFindKey(objectFunc) {
- return function(object, predicate, thisArg) {
- predicate = getCallback(predicate, thisArg, 3);
- return baseFind(object, predicate, objectFunc, true);
- };
- }
-
- /**
- * Creates a `_.flow` or `_.flowRight` function.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new flow function.
- */
- function createFlow(fromRight) {
- return function() {
- var wrapper,
- length = arguments.length,
- index = fromRight ? length : -1,
- leftIndex = 0,
- funcs = Array(length);
-
- while ((fromRight ? index-- : ++index < length)) {
- var func = funcs[leftIndex++] = arguments[index];
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
- wrapper = new LodashWrapper([], true);
- }
- }
- index = wrapper ? -1 : length;
- while (++index < length) {
- func = funcs[index];
-
- var funcName = getFuncName(func),
- data = funcName == 'wrapper' ? getData(func) : undefined;
-
- if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
- wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
- } else {
- wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);
- }
- }
- return function() {
- var args = arguments,
- value = args[0];
-
- if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
- return wrapper.plant(value).value();
- }
- var index = 0,
- result = length ? funcs[index].apply(this, args) : value;
-
- while (++index < length) {
- result = funcs[index].call(this, result);
- }
- return result;
- };
- };
- }
-
- /**
- * Creates a function for `_.forEach` or `_.forEachRight`.
- *
- * @private
- * @param {Function} arrayFunc The function to iterate over an array.
- * @param {Function} eachFunc The function to iterate over a collection.
- * @returns {Function} Returns the new each function.
- */
- function createForEach(arrayFunc, eachFunc) {
- return function(collection, iteratee, thisArg) {
- return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
- ? arrayFunc(collection, iteratee)
- : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
- };
- }
-
- /**
- * Creates a function for `_.forIn` or `_.forInRight`.
- *
- * @private
- * @param {Function} objectFunc The function to iterate over an object.
- * @returns {Function} Returns the new each function.
- */
- function createForIn(objectFunc) {
- return function(object, iteratee, thisArg) {
- if (typeof iteratee != 'function' || thisArg !== undefined) {
- iteratee = bindCallback(iteratee, thisArg, 3);
- }
- return objectFunc(object, iteratee, keysIn);
- };
- }
-
- /**
- * Creates a function for `_.forOwn` or `_.forOwnRight`.
- *
- * @private
- * @param {Function} objectFunc The function to iterate over an object.
- * @returns {Function} Returns the new each function.
- */
- function createForOwn(objectFunc) {
- return function(object, iteratee, thisArg) {
- if (typeof iteratee != 'function' || thisArg !== undefined) {
- iteratee = bindCallback(iteratee, thisArg, 3);
- }
- return objectFunc(object, iteratee);
- };
- }
-
- /**
- * Creates a function for `_.mapKeys` or `_.mapValues`.
- *
- * @private
- * @param {boolean} [isMapKeys] Specify mapping keys instead of values.
- * @returns {Function} Returns the new map function.
- */
- function createObjectMapper(isMapKeys) {
- return function(object, iteratee, thisArg) {
- var result = {};
- iteratee = getCallback(iteratee, thisArg, 3);
-
- baseForOwn(object, function(value, key, object) {
- var mapped = iteratee(value, key, object);
- key = isMapKeys ? mapped : key;
- value = isMapKeys ? value : mapped;
- result[key] = value;
- });
- return result;
- };
- }
-
- /**
- * Creates a function for `_.padLeft` or `_.padRight`.
- *
- * @private
- * @param {boolean} [fromRight] Specify padding from the right.
- * @returns {Function} Returns the new pad function.
- */
- function createPadDir(fromRight) {
- return function(string, length, chars) {
- string = baseToString(string);
- return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);
- };
- }
-
- /**
- * Creates a `_.partial` or `_.partialRight` function.
- *
- * @private
- * @param {boolean} flag The partial bit flag.
- * @returns {Function} Returns the new partial function.
- */
- function createPartial(flag) {
- var partialFunc = restParam(function(func, partials) {
- var holders = replaceHolders(partials, partialFunc.placeholder);
- return createWrapper(func, flag, undefined, partials, holders);
- });
- return partialFunc;
- }
-
- /**
- * Creates a function for `_.reduce` or `_.reduceRight`.
- *
- * @private
- * @param {Function} arrayFunc The function to iterate over an array.
- * @param {Function} eachFunc The function to iterate over a collection.
- * @returns {Function} Returns the new each function.
- */
- function createReduce(arrayFunc, eachFunc) {
- return function(collection, iteratee, accumulator, thisArg) {
- var initFromArray = arguments.length < 3;
- return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
- ? arrayFunc(collection, iteratee, accumulator, initFromArray)
- : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
- };
- }
-
- /**
- * Creates a function that wraps `func` and invokes it with optional `this`
- * binding of, partial application, and currying.
- *
- * @private
- * @param {Function|string} func The function or method name to reference.
- * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to prepend to those provided to the new function.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [partialsRight] The arguments to append to those provided to the new function.
- * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
- var isAry = bitmask & ARY_FLAG,
- isBind = bitmask & BIND_FLAG,
- isBindKey = bitmask & BIND_KEY_FLAG,
- isCurry = bitmask & CURRY_FLAG,
- isCurryBound = bitmask & CURRY_BOUND_FLAG,
- isCurryRight = bitmask & CURRY_RIGHT_FLAG,
- Ctor = isBindKey ? undefined : createCtorWrapper(func);
-
- function wrapper() {
- // Avoid `arguments` object use disqualifying optimizations by
- // converting it to an array before providing it to other functions.
- var length = arguments.length,
- index = length,
- args = Array(length);
-
- while (index--) {
- args[index] = arguments[index];
- }
- if (partials) {
- args = composeArgs(args, partials, holders);
- }
- if (partialsRight) {
- args = composeArgsRight(args, partialsRight, holdersRight);
- }
- if (isCurry || isCurryRight) {
- var placeholder = wrapper.placeholder,
- argsHolders = replaceHolders(args, placeholder);
-
- length -= argsHolders.length;
- if (length < arity) {
- var newArgPos = argPos ? arrayCopy(argPos) : undefined,
- newArity = nativeMax(arity - length, 0),
- newsHolders = isCurry ? argsHolders : undefined,
- newHoldersRight = isCurry ? undefined : argsHolders,
- newPartials = isCurry ? args : undefined,
- newPartialsRight = isCurry ? undefined : args;
-
- bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
- bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
-
- if (!isCurryBound) {
- bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
- }
- var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
- result = createHybridWrapper.apply(undefined, newData);
-
- if (isLaziable(func)) {
- setData(result, newData);
- }
- result.placeholder = placeholder;
- return result;
- }
- }
- var thisBinding = isBind ? thisArg : this,
- fn = isBindKey ? thisBinding[func] : func;
-
- if (argPos) {
- args = reorder(args, argPos);
- }
- if (isAry && ary < args.length) {
- args.length = ary;
- }
- if (this && this !== root && this instanceof wrapper) {
- fn = Ctor || createCtorWrapper(func);
- }
- return fn.apply(thisBinding, args);
- }
- return wrapper;
- }
-
- /**
- * Creates the padding required for `string` based on the given `length`.
- * The `chars` string is truncated if the number of characters exceeds `length`.
- *
- * @private
- * @param {string} string The string to create padding for.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the pad for `string`.
- */
- function createPadding(string, length, chars) {
- var strLength = string.length;
- length = +length;
-
- if (strLength >= length || !nativeIsFinite(length)) {
- return '';
- }
- var padLength = length - strLength;
- chars = chars == null ? ' ' : (chars + '');
- return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);
- }
-
- /**
- * Creates a function that wraps `func` and invokes it with the optional `this`
- * binding of `thisArg` and the `partials` prepended to those provided to
- * the wrapper.
- *
- * @private
- * @param {Function} func The function to partially apply arguments to.
- * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {Array} partials The arguments to prepend to those provided to the new function.
- * @returns {Function} Returns the new bound function.
- */
- function createPartialWrapper(func, bitmask, thisArg, partials) {
- var isBind = bitmask & BIND_FLAG,
- Ctor = createCtorWrapper(func);
-
- function wrapper() {
- // Avoid `arguments` object use disqualifying optimizations by
- // converting it to an array before providing it `func`.
- var argsIndex = -1,
- argsLength = arguments.length,
- leftIndex = -1,
- leftLength = partials.length,
- args = Array(leftLength + argsLength);
-
- while (++leftIndex < leftLength) {
- args[leftIndex] = partials[leftIndex];
- }
- while (argsLength--) {
- args[leftIndex++] = arguments[++argsIndex];
- }
- var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
- return fn.apply(isBind ? thisArg : this, args);
- }
- return wrapper;
- }
-
- /**
- * Creates a `_.ceil`, `_.floor`, or `_.round` function.
- *
- * @private
- * @param {string} methodName The name of the `Math` method to use when rounding.
- * @returns {Function} Returns the new round function.
- */
- function createRound(methodName) {
- var func = Math[methodName];
- return function(number, precision) {
- precision = precision === undefined ? 0 : (+precision || 0);
- if (precision) {
- precision = pow(10, precision);
- return func(number * precision) / precision;
- }
- return func(number);
- };
- }
-
- /**
- * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
- *
- * @private
- * @param {boolean} [retHighest] Specify returning the highest qualified index.
- * @returns {Function} Returns the new index function.
- */
- function createSortedIndex(retHighest) {
- return function(array, value, iteratee, thisArg) {
- var callback = getCallback(iteratee);
- return (iteratee == null && callback === baseCallback)
- ? binaryIndex(array, value, retHighest)
- : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);
- };
- }
-
- /**
- * Creates a function that either curries or invokes `func` with optional
- * `this` binding and partially applied arguments.
- *
- * @private
- * @param {Function|string} func The function or method name to reference.
- * @param {number} bitmask The bitmask of flags.
- * The bitmask may be composed of the following flags:
- * 1 - `_.bind`
- * 2 - `_.bindKey`
- * 4 - `_.curry` or `_.curryRight` of a bound function
- * 8 - `_.curry`
- * 16 - `_.curryRight`
- * 32 - `_.partial`
- * 64 - `_.partialRight`
- * 128 - `_.rearg`
- * 256 - `_.ary`
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to be partially applied.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
- var isBindKey = bitmask & BIND_KEY_FLAG;
- if (!isBindKey && typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var length = partials ? partials.length : 0;
- if (!length) {
- bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
- partials = holders = undefined;
- }
- length -= (holders ? holders.length : 0);
- if (bitmask & PARTIAL_RIGHT_FLAG) {
- var partialsRight = partials,
- holdersRight = holders;
-
- partials = holders = undefined;
- }
- var data = isBindKey ? undefined : getData(func),
- newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
-
- if (data) {
- mergeData(newData, data);
- bitmask = newData[1];
- arity = newData[9];
- }
- newData[9] = arity == null
- ? (isBindKey ? 0 : func.length)
- : (nativeMax(arity - length, 0) || 0);
-
- if (bitmask == BIND_FLAG) {
- var result = createBindWrapper(newData[0], newData[2]);
- } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
- result = createPartialWrapper.apply(undefined, newData);
- } else {
- result = createHybridWrapper.apply(undefined, newData);
- }
- var setter = data ? baseSetData : setData;
- return setter(result, newData);
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for arrays with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Array} array The array to compare.
- * @param {Array} other The other array to compare.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Function} [customizer] The function to customize comparing arrays.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA] Tracks traversed `value` objects.
- * @param {Array} [stackB] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
- */
- function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
- var index = -1,
- arrLength = array.length,
- othLength = other.length;
-
- if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
- return false;
- }
- // Ignore non-index properties.
- while (++index < arrLength) {
- var arrValue = array[index],
- othValue = other[index],
- result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
-
- if (result !== undefined) {
- if (result) {
- continue;
- }
- return false;
- }
- // Recursively compare arrays (susceptible to call stack limits).
- if (isLoose) {
- if (!arraySome(other, function(othValue) {
- return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
- })) {
- return false;
- }
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for comparing objects of
- * the same `toStringTag`.
- *
- * **Note:** This function only supports comparing values with tags of
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {string} tag The `toStringTag` of the objects to compare.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function equalByTag(object, other, tag) {
- switch (tag) {
- case boolTag:
- case dateTag:
- // Coerce dates and booleans to numbers, dates to milliseconds and booleans
- // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
- return +object == +other;
-
- case errorTag:
- return object.name == other.name && object.message == other.message;
-
- case numberTag:
- // Treat `NaN` vs. `NaN` as equal.
- return (object != +object)
- ? other != +other
- : object == +other;
-
- case regexpTag:
- case stringTag:
- // Coerce regexes to strings and treat strings primitives and string
- // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
- return object == (other + '');
- }
- return false;
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for objects with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Function} [customizer] The function to customize comparing values.
- * @param {boolean} [isLoose] Specify performing partial comparisons.
- * @param {Array} [stackA] Tracks traversed `value` objects.
- * @param {Array} [stackB] Tracks traversed `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
- var objProps = keys(object),
- objLength = objProps.length,
- othProps = keys(other),
- othLength = othProps.length;
-
- if (objLength != othLength && !isLoose) {
- return false;
- }
- var index = objLength;
- while (index--) {
- var key = objProps[index];
- if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
- return false;
- }
- }
- var skipCtor = isLoose;
- while (++index < objLength) {
- key = objProps[index];
- var objValue = object[key],
- othValue = other[key],
- result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;
-
- // Recursively compare objects (susceptible to call stack limits).
- if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
- return false;
- }
- skipCtor || (skipCtor = key == 'constructor');
- }
- if (!skipCtor) {
- var objCtor = object.constructor,
- othCtor = other.constructor;
-
- // Non `Object` object instances with different constructors are not equal.
- if (objCtor != othCtor &&
- ('constructor' in object && 'constructor' in other) &&
- !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
- typeof othCtor == 'function' && othCtor instanceof othCtor)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Gets the appropriate "callback" function. If the `_.callback` method is
- * customized this function returns the custom method, otherwise it returns
- * the `baseCallback` function. If arguments are provided the chosen function
- * is invoked with them and its result is returned.
- *
- * @private
- * @returns {Function} Returns the chosen function or its result.
- */
- function getCallback(func, thisArg, argCount) {
- var result = lodash.callback || callback;
- result = result === callback ? baseCallback : result;
- return argCount ? result(func, thisArg, argCount) : result;
- }
-
- /**
- * Gets metadata for `func`.
- *
- * @private
- * @param {Function} func The function to query.
- * @returns {*} Returns the metadata for `func`.
- */
- var getData = !metaMap ? noop : function(func) {
- return metaMap.get(func);
- };
-
- /**
- * Gets the name of `func`.
- *
- * @private
- * @param {Function} func The function to query.
- * @returns {string} Returns the function name.
- */
- function getFuncName(func) {
- var result = func.name,
- array = realNames[result],
- length = array ? array.length : 0;
-
- while (length--) {
- var data = array[length],
- otherFunc = data.func;
- if (otherFunc == null || otherFunc == func) {
- return data.name;
- }
- }
- return result;
- }
-
- /**
- * Gets the appropriate "indexOf" function. If the `_.indexOf` method is
- * customized this function returns the custom method, otherwise it returns
- * the `baseIndexOf` function. If arguments are provided the chosen function
- * is invoked with them and its result is returned.
- *
- * @private
- * @returns {Function|number} Returns the chosen function or its result.
- */
- function getIndexOf(collection, target, fromIndex) {
- var result = lodash.indexOf || indexOf;
- result = result === indexOf ? baseIndexOf : result;
- return collection ? result(collection, target, fromIndex) : result;
- }
-
- /**
- * Gets the "length" property value of `object`.
- *
- * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
- * that affects Safari on at least iOS 8.1-8.3 ARM64.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {*} Returns the "length" value.
- */
- var getLength = baseProperty('length');
-
- /**
- * Gets the propery names, values, and compare flags of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the match data of `object`.
- */
- function getMatchData(object) {
- var result = pairs(object),
- length = result.length;
-
- while (length--) {
- result[length][2] = isStrictComparable(result[length][1]);
- }
- return result;
- }
-
- /**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
- function getNative(object, key) {
- var value = object == null ? undefined : object[key];
- return isNative(value) ? value : undefined;
- }
-
- /**
- * Gets the view, applying any `transforms` to the `start` and `end` positions.
- *
- * @private
- * @param {number} start The start of the view.
- * @param {number} end The end of the view.
- * @param {Array} transforms The transformations to apply to the view.
- * @returns {Object} Returns an object containing the `start` and `end`
- * positions of the view.
- */
- function getView(start, end, transforms) {
- var index = -1,
- length = transforms.length;
-
- while (++index < length) {
- var data = transforms[index],
- size = data.size;
-
- switch (data.type) {
- case 'drop': start += size; break;
- case 'dropRight': end -= size; break;
- case 'take': end = nativeMin(end, start + size); break;
- case 'takeRight': start = nativeMax(start, end - size); break;
- }
- }
- return { 'start': start, 'end': end };
- }
-
- /**
- * Initializes an array clone.
- *
- * @private
- * @param {Array} array The array to clone.
- * @returns {Array} Returns the initialized clone.
- */
- function initCloneArray(array) {
- var length = array.length,
- result = new array.constructor(length);
-
- // Add array properties assigned by `RegExp#exec`.
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
- result.index = array.index;
- result.input = array.input;
- }
- return result;
- }
-
- /**
- * Initializes an object clone.
- *
- * @private
- * @param {Object} object The object to clone.
- * @returns {Object} Returns the initialized clone.
- */
- function initCloneObject(object) {
- var Ctor = object.constructor;
- if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
- Ctor = Object;
- }
- return new Ctor;
- }
-
- /**
- * Initializes an object clone based on its `toStringTag`.
- *
- * **Note:** This function only supports cloning values with tags of
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
- *
- * @private
- * @param {Object} object The object to clone.
- * @param {string} tag The `toStringTag` of the object to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the initialized clone.
- */
- function initCloneByTag(object, tag, isDeep) {
- var Ctor = object.constructor;
- switch (tag) {
- case arrayBufferTag:
- return bufferClone(object);
-
- case boolTag:
- case dateTag:
- return new Ctor(+object);
-
- case float32Tag: case float64Tag:
- case int8Tag: case int16Tag: case int32Tag:
- case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
- var buffer = object.buffer;
- return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);
-
- case numberTag:
- case stringTag:
- return new Ctor(object);
-
- case regexpTag:
- var result = new Ctor(object.source, reFlags.exec(object));
- result.lastIndex = object.lastIndex;
- }
- return result;
- }
-
- /**
- * Invokes the method at `path` on `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the method to invoke.
- * @param {Array} args The arguments to invoke the method with.
- * @returns {*} Returns the result of the invoked method.
- */
- function invokePath(object, path, args) {
- if (object != null && !isKey(path, object)) {
- path = toPath(path);
- object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
- path = last(path);
- }
- var func = object == null ? object : object[path];
- return func == null ? undefined : func.apply(object, args);
- }
-
- /**
- * Checks if `value` is array-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- */
- function isArrayLike(value) {
- return value != null && isLength(getLength(value));
- }
-
- /**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
- function isIndex(value, length) {
- value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return value > -1 && value % 1 == 0 && value < length;
- }
-
- /**
- * Checks if the provided arguments are from an iteratee call.
- *
- * @private
- * @param {*} value The potential iteratee value argument.
- * @param {*} index The potential iteratee index or key argument.
- * @param {*} object The potential iteratee object argument.
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
- */
- function isIterateeCall(value, index, object) {
- if (!isObject(object)) {
- return false;
- }
- var type = typeof index;
- if (type == 'number'
- ? (isArrayLike(object) && isIndex(index, object.length))
- : (type == 'string' && index in object)) {
- var other = object[index];
- return value === value ? (value === other) : (other !== other);
- }
- return false;
- }
-
- /**
- * Checks if `value` is a property name and not a property path.
- *
- * @private
- * @param {*} value The value to check.
- * @param {Object} [object] The object to query keys on.
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
- */
- function isKey(value, object) {
- var type = typeof value;
- if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
- return true;
- }
- if (isArray(value)) {
- return false;
- }
- var result = !reIsDeepProp.test(value);
- return result || (object != null && value in toObject(object));
- }
-
- /**
- * Checks if `func` has a lazy counterpart.
- *
- * @private
- * @param {Function} func The function to check.
- * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
- */
- function isLaziable(func) {
- var funcName = getFuncName(func);
- if (!(funcName in LazyWrapper.prototype)) {
- return false;
- }
- var other = lodash[funcName];
- if (func === other) {
- return true;
- }
- var data = getData(other);
- return !!data && func === data[0];
- }
-
- /**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- */
- function isLength(value) {
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
-
- /**
- * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` if suitable for strict
- * equality comparisons, else `false`.
- */
- function isStrictComparable(value) {
- return value === value && !isObject(value);
- }
-
- /**
- * Merges the function metadata of `source` into `data`.
- *
- * Merging metadata reduces the number of wrappers required to invoke a function.
- * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
- * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`
- * augment function arguments, making the order in which they are executed important,
- * preventing the merging of metadata. However, we make an exception for a safe
- * common case where curried functions have `_.ary` and or `_.rearg` applied.
- *
- * @private
- * @param {Array} data The destination metadata.
- * @param {Array} source The source metadata.
- * @returns {Array} Returns `data`.
- */
- function mergeData(data, source) {
- var bitmask = data[1],
- srcBitmask = source[1],
- newBitmask = bitmask | srcBitmask,
- isCommon = newBitmask < ARY_FLAG;
-
- var isCombo =
- (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
- (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
- (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
-
- // Exit early if metadata can't be merged.
- if (!(isCommon || isCombo)) {
- return data;
- }
- // Use source `thisArg` if available.
- if (srcBitmask & BIND_FLAG) {
- data[2] = source[2];
- // Set when currying a bound function.
- newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
- }
- // Compose partial arguments.
- var value = source[3];
- if (value) {
- var partials = data[3];
- data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
- data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
- }
- // Compose partial right arguments.
- value = source[5];
- if (value) {
- partials = data[5];
- data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
- data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
- }
- // Use source `argPos` if available.
- value = source[7];
- if (value) {
- data[7] = arrayCopy(value);
- }
- // Use source `ary` if it's smaller.
- if (srcBitmask & ARY_FLAG) {
- data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
- }
- // Use source `arity` if one is not provided.
- if (data[9] == null) {
- data[9] = source[9];
- }
- // Use source `func` and merge bitmasks.
- data[0] = source[0];
- data[1] = newBitmask;
-
- return data;
- }
-
- /**
- * Used by `_.defaultsDeep` to customize its `_.merge` use.
- *
- * @private
- * @param {*} objectValue The destination object property value.
- * @param {*} sourceValue The source object property value.
- * @returns {*} Returns the value to assign to the destination object.
- */
- function mergeDefaults(objectValue, sourceValue) {
- return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults);
- }
-
- /**
- * A specialized version of `_.pick` which picks `object` properties specified
- * by `props`.
- *
- * @private
- * @param {Object} object The source object.
- * @param {string[]} props The property names to pick.
- * @returns {Object} Returns the new object.
- */
- function pickByArray(object, props) {
- object = toObject(object);
-
- var index = -1,
- length = props.length,
- result = {};
-
- while (++index < length) {
- var key = props[index];
- if (key in object) {
- result[key] = object[key];
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `_.pick` which picks `object` properties `predicate`
- * returns truthy for.
- *
- * @private
- * @param {Object} object The source object.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Object} Returns the new object.
- */
- function pickByCallback(object, predicate) {
- var result = {};
- baseForIn(object, function(value, key, object) {
- if (predicate(value, key, object)) {
- result[key] = value;
- }
- });
- return result;
- }
-
- /**
- * Reorder `array` according to the specified indexes where the element at
- * the first index is assigned as the first element, the element at
- * the second index is assigned as the second element, and so on.
- *
- * @private
- * @param {Array} array The array to reorder.
- * @param {Array} indexes The arranged array indexes.
- * @returns {Array} Returns `array`.
- */
- function reorder(array, indexes) {
- var arrLength = array.length,
- length = nativeMin(indexes.length, arrLength),
- oldArray = arrayCopy(array);
-
- while (length--) {
- var index = indexes[length];
- array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
- }
- return array;
- }
-
- /**
- * Sets metadata for `func`.
- *
- * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
- * period of time, it will trip its breaker and transition to an identity function
- * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)
- * for more details.
- *
- * @private
- * @param {Function} func The function to associate metadata with.
- * @param {*} data The metadata.
- * @returns {Function} Returns `func`.
- */
- var setData = (function() {
- var count = 0,
- lastCalled = 0;
-
- return function(key, value) {
- var stamp = now(),
- remaining = HOT_SPAN - (stamp - lastCalled);
-
- lastCalled = stamp;
- if (remaining > 0) {
- if (++count >= HOT_COUNT) {
- return key;
- }
- } else {
- count = 0;
- }
- return baseSetData(key, value);
- };
- }());
-
- /**
- * A fallback implementation of `Object.keys` which creates an array of the
- * own enumerable property names of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function shimKeys(object) {
- var props = keysIn(object),
- propsLength = props.length,
- length = propsLength && object.length;
-
- var allowIndexes = !!length && isLength(length) &&
- (isArray(object) || isArguments(object));
-
- var index = -1,
- result = [];
-
- while (++index < propsLength) {
- var key = props[index];
- if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * Converts `value` to an array-like object if it's not one.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {Array|Object} Returns the array-like object.
- */
- function toIterable(value) {
- if (value == null) {
- return [];
- }
- if (!isArrayLike(value)) {
- return values(value);
- }
- return isObject(value) ? value : Object(value);
- }
-
- /**
- * Converts `value` to an object if it's not one.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {Object} Returns the object.
- */
- function toObject(value) {
- return isObject(value) ? value : Object(value);
- }
-
- /**
- * Converts `value` to property path array if it's not one.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {Array} Returns the property path array.
- */
- function toPath(value) {
- if (isArray(value)) {
- return value;
- }
- var result = [];
- baseToString(value).replace(rePropName, function(match, number, quote, string) {
- result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
- });
- return result;
- }
-
- /**
- * Creates a clone of `wrapper`.
- *
- * @private
- * @param {Object} wrapper The wrapper to clone.
- * @returns {Object} Returns the cloned wrapper.
- */
- function wrapperClone(wrapper) {
- return wrapper instanceof LazyWrapper
- ? wrapper.clone()
- : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an array of elements split into groups the length of `size`.
- * If `collection` can't be split evenly, the final chunk will be the remaining
- * elements.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to process.
- * @param {number} [size=1] The length of each chunk.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Array} Returns the new array containing chunks.
- * @example
- *
- * _.chunk(['a', 'b', 'c', 'd'], 2);
- * // => [['a', 'b'], ['c', 'd']]
- *
- * _.chunk(['a', 'b', 'c', 'd'], 3);
- * // => [['a', 'b', 'c'], ['d']]
- */
- function chunk(array, size, guard) {
- if (guard ? isIterateeCall(array, size, guard) : size == null) {
- size = 1;
- } else {
- size = nativeMax(nativeFloor(size) || 1, 1);
- }
- var index = 0,
- length = array ? array.length : 0,
- resIndex = -1,
- result = Array(nativeCeil(length / size));
-
- while (index < length) {
- result[++resIndex] = baseSlice(array, index, (index += size));
- }
- return result;
- }
-
- /**
- * Creates an array with all falsey values removed. The values `false`, `null`,
- * `0`, `""`, `undefined`, and `NaN` are falsey.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to compact.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.compact([0, 1, false, 2, '', 3]);
- * // => [1, 2, 3]
- */
- function compact(array) {
- var index = -1,
- length = array ? array.length : 0,
- resIndex = -1,
- result = [];
-
- while (++index < length) {
- var value = array[index];
- if (value) {
- result[++resIndex] = value;
- }
- }
- return result;
- }
-
- /**
- * Creates an array of unique `array` values not included in the other
- * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...Array} [values] The arrays of values to exclude.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.difference([1, 2, 3], [4, 2]);
- * // => [1, 3]
- */
- var difference = restParam(function(array, values) {
- return (isObjectLike(array) && isArrayLike(array))
- ? baseDifference(array, baseFlatten(values, false, true))
- : [];
- });
-
- /**
- * Creates a slice of `array` with `n` elements dropped from the beginning.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to drop.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.drop([1, 2, 3]);
- * // => [2, 3]
- *
- * _.drop([1, 2, 3], 2);
- * // => [3]
- *
- * _.drop([1, 2, 3], 5);
- * // => []
- *
- * _.drop([1, 2, 3], 0);
- * // => [1, 2, 3]
- */
- function drop(array, n, guard) {
- var length = array ? array.length : 0;
- if (!length) {
- return [];
- }
- if (guard ? isIterateeCall(array, n, guard) : n == null) {
- n = 1;
- }
- return baseSlice(array, n < 0 ? 0 : n);
- }
-
- /**
- * Creates a slice of `array` with `n` elements dropped from the end.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to drop.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.dropRight([1, 2, 3]);
- * // => [1, 2]
- *
- * _.dropRight([1, 2, 3], 2);
- * // => [1]
- *
- * _.dropRight([1, 2, 3], 5);
- * // => []
- *
- * _.dropRight([1, 2, 3], 0);
- * // => [1, 2, 3]
- */
- function dropRight(array, n, guard) {
- var length = array ? array.length : 0;
- if (!length) {
- return [];
- }
- if (guard ? isIterateeCall(array, n, guard) : n == null) {
- n = 1;
- }
- n = length - (+n || 0);
- return baseSlice(array, 0, n < 0 ? 0 : n);
- }
-
- /**
- * Creates a slice of `array` excluding elements dropped from the end.
- * Elements are dropped until `predicate` returns falsey. The predicate is
- * bound to `thisArg` and invoked with three arguments: (value, index, array).
- *
- * If a property name is provided for `predicate` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `predicate` the created `_.matches` style
- * callback returns `true` for elements that match the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.dropRightWhile([1, 2, 3], function(n) {
- * return n > 1;
- * });
- * // => [1]
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
- * // => ['barney', 'fred']
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.pluck(_.dropRightWhile(users, 'active', false), 'user');
- * // => ['barney']
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.dropRightWhile(users, 'active'), 'user');
- * // => ['barney', 'fred', 'pebbles']
- */
- function dropRightWhile(array, predicate, thisArg) {
- return (array && array.length)
- ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true)
- : [];
- }
-
- /**
- * Creates a slice of `array` excluding elements dropped from the beginning.
- * Elements are dropped until `predicate` returns falsey. The predicate is
- * bound to `thisArg` and invoked with three arguments: (value, index, array).
- *
- * If a property name is provided for `predicate` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `predicate` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.dropWhile([1, 2, 3], function(n) {
- * return n < 3;
- * });
- * // => [3]
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user');
- * // => ['fred', 'pebbles']
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.pluck(_.dropWhile(users, 'active', false), 'user');
- * // => ['pebbles']
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.dropWhile(users, 'active'), 'user');
- * // => ['barney', 'fred', 'pebbles']
- */
- function dropWhile(array, predicate, thisArg) {
- return (array && array.length)
- ? baseWhile(array, getCallback(predicate, thisArg, 3), true)
- : [];
- }
-
- /**
- * Fills elements of `array` with `value` from `start` up to, but not
- * including, `end`.
- *
- * **Note:** This method mutates `array`.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to fill.
- * @param {*} value The value to fill `array` with.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _.fill(array, 'a');
- * console.log(array);
- * // => ['a', 'a', 'a']
- *
- * _.fill(Array(3), 2);
- * // => [2, 2, 2]
- *
- * _.fill([4, 6, 8], '*', 1, 2);
- * // => [4, '*', 8]
- */
- function fill(array, value, start, end) {
- var length = array ? array.length : 0;
- if (!length) {
- return [];
- }
- if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
- start = 0;
- end = length;
- }
- return baseFill(array, value, start, end);
- }
-
- /**
- * This method is like `_.find` except that it returns the index of the first
- * element `predicate` returns truthy for instead of the element itself.
- *
- * If a property name is provided for `predicate` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `predicate` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to search.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {number} Returns the index of the found element, else `-1`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * _.findIndex(users, function(chr) {
- * return chr.user == 'barney';
- * });
- * // => 0
- *
- * // using the `_.matches` callback shorthand
- * _.findIndex(users, { 'user': 'fred', 'active': false });
- * // => 1
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.findIndex(users, 'active', false);
- * // => 0
- *
- * // using the `_.property` callback shorthand
- * _.findIndex(users, 'active');
- * // => 2
- */
- var findIndex = createFindIndex();
-
- /**
- * This method is like `_.findIndex` except that it iterates over elements
- * of `collection` from right to left.
- *
- * If a property name is provided for `predicate` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `predicate` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to search.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {number} Returns the index of the found element, else `-1`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * _.findLastIndex(users, function(chr) {
- * return chr.user == 'pebbles';
- * });
- * // => 2
- *
- * // using the `_.matches` callback shorthand
- * _.findLastIndex(users, { 'user': 'barney', 'active': true });
- * // => 0
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.findLastIndex(users, 'active', false);
- * // => 2
- *
- * // using the `_.property` callback shorthand
- * _.findLastIndex(users, 'active');
- * // => 0
- */
- var findLastIndex = createFindIndex(true);
-
- /**
- * Gets the first element of `array`.
- *
- * @static
- * @memberOf _
- * @alias head
- * @category Array
- * @param {Array} array The array to query.
- * @returns {*} Returns the first element of `array`.
- * @example
- *
- * _.first([1, 2, 3]);
- * // => 1
- *
- * _.first([]);
- * // => undefined
- */
- function first(array) {
- return array ? array[0] : undefined;
- }
-
- /**
- * Flattens a nested array. If `isDeep` is `true` the array is recursively
- * flattened, otherwise it is only flattened a single level.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to flatten.
- * @param {boolean} [isDeep] Specify a deep flatten.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * _.flatten([1, [2, 3, [4]]]);
- * // => [1, 2, 3, [4]]
- *
- * // using `isDeep`
- * _.flatten([1, [2, 3, [4]]], true);
- * // => [1, 2, 3, 4]
- */
- function flatten(array, isDeep, guard) {
- var length = array ? array.length : 0;
- if (guard && isIterateeCall(array, isDeep, guard)) {
- isDeep = false;
- }
- return length ? baseFlatten(array, isDeep) : [];
- }
-
- /**
- * Recursively flattens a nested array.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to recursively flatten.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * _.flattenDeep([1, [2, 3, [4]]]);
- * // => [1, 2, 3, 4]
- */
- function flattenDeep(array) {
- var length = array ? array.length : 0;
- return length ? baseFlatten(array, true) : [];
- }
-
- /**
- * Gets the index at which the first occurrence of `value` is found in `array`
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
- * for equality comparisons. If `fromIndex` is negative, it is used as the offset
- * from the end of `array`. If `array` is sorted providing `true` for `fromIndex`
- * performs a faster binary search.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to search.
- * @param {*} value The value to search for.
- * @param {boolean|number} [fromIndex=0] The index to search from or `true`
- * to perform a binary search on a sorted array.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.indexOf([1, 2, 1, 2], 2);
- * // => 1
- *
- * // using `fromIndex`
- * _.indexOf([1, 2, 1, 2], 2, 2);
- * // => 3
- *
- * // performing a binary search
- * _.indexOf([1, 1, 2, 2], 2, true);
- * // => 2
- */
- function indexOf(array, value, fromIndex) {
- var length = array ? array.length : 0;
- if (!length) {
- return -1;
- }
- if (typeof fromIndex == 'number') {
- fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
- } else if (fromIndex) {
- var index = binaryIndex(array, value);
- if (index < length &&
- (value === value ? (value === array[index]) : (array[index] !== array[index]))) {
- return index;
- }
- return -1;
- }
- return baseIndexOf(array, value, fromIndex || 0);
- }
-
- /**
- * Gets all but the last element of `array`.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to query.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.initial([1, 2, 3]);
- * // => [1, 2]
- */
- function initial(array) {
- return dropRight(array, 1);
- }
-
- /**
- * Creates an array of unique values that are included in all of the provided
- * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of shared values.
- * @example
- * _.intersection([1, 2], [4, 2], [2, 1]);
- * // => [2]
- */
- var intersection = restParam(function(arrays) {
- var othLength = arrays.length,
- othIndex = othLength,
- caches = Array(length),
- indexOf = getIndexOf(),
- isCommon = indexOf == baseIndexOf,
- result = [];
-
- while (othIndex--) {
- var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
- caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
- }
- var array = arrays[0],
- index = -1,
- length = array ? array.length : 0,
- seen = caches[0];
-
- outer:
- while (++index < length) {
- value = array[index];
- if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
- var othIndex = othLength;
- while (--othIndex) {
- var cache = caches[othIndex];
- if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
- continue outer;
- }
- }
- if (seen) {
- seen.push(value);
- }
- result.push(value);
- }
- }
- return result;
- });
-
- /**
- * Gets the last element of `array`.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to query.
- * @returns {*} Returns the last element of `array`.
- * @example
- *
- * _.last([1, 2, 3]);
- * // => 3
- */
- function last(array) {
- var length = array ? array.length : 0;
- return length ? array[length - 1] : undefined;
- }
-
- /**
- * This method is like `_.indexOf` except that it iterates over elements of
- * `array` from right to left.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to search.
- * @param {*} value The value to search for.
- * @param {boolean|number} [fromIndex=array.length-1] The index to search from
- * or `true` to perform a binary search on a sorted array.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.lastIndexOf([1, 2, 1, 2], 2);
- * // => 3
- *
- * // using `fromIndex`
- * _.lastIndexOf([1, 2, 1, 2], 2, 2);
- * // => 1
- *
- * // performing a binary search
- * _.lastIndexOf([1, 1, 2, 2], 2, true);
- * // => 3
- */
- function lastIndexOf(array, value, fromIndex) {
- var length = array ? array.length : 0;
- if (!length) {
- return -1;
- }
- var index = length;
- if (typeof fromIndex == 'number') {
- index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;
- } else if (fromIndex) {
- index = binaryIndex(array, value, true) - 1;
- var other = array[index];
- if (value === value ? (value === other) : (other !== other)) {
- return index;
- }
- return -1;
- }
- if (value !== value) {
- return indexOfNaN(array, index, true);
- }
- while (index--) {
- if (array[index] === value) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * Removes all provided values from `array` using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * **Note:** Unlike `_.without`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to modify.
- * @param {...*} [values] The values to remove.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [1, 2, 3, 1, 2, 3];
- *
- * _.pull(array, 2, 3);
- * console.log(array);
- * // => [1, 1]
- */
- function pull() {
- var args = arguments,
- array = args[0];
-
- if (!(array && array.length)) {
- return array;
- }
- var index = 0,
- indexOf = getIndexOf(),
- length = args.length;
-
- while (++index < length) {
- var fromIndex = 0,
- value = args[index];
-
- while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
- splice.call(array, fromIndex, 1);
- }
- }
- return array;
- }
-
- /**
- * Removes elements from `array` corresponding to the given indexes and returns
- * an array of the removed elements. Indexes may be specified as an array of
- * indexes or as individual arguments.
- *
- * **Note:** Unlike `_.at`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to modify.
- * @param {...(number|number[])} [indexes] The indexes of elements to remove,
- * specified as individual indexes or arrays of indexes.
- * @returns {Array} Returns the new array of removed elements.
- * @example
- *
- * var array = [5, 10, 15, 20];
- * var evens = _.pullAt(array, 1, 3);
- *
- * console.log(array);
- * // => [5, 15]
- *
- * console.log(evens);
- * // => [10, 20]
- */
- var pullAt = restParam(function(array, indexes) {
- indexes = baseFlatten(indexes);
-
- var result = baseAt(array, indexes);
- basePullAt(array, indexes.sort(baseCompareAscending));
- return result;
- });
-
- /**
- * Removes all elements from `array` that `predicate` returns truthy for
- * and returns an array of the removed elements. The predicate is bound to
- * `thisArg` and invoked with three arguments: (value, index, array).
- *
- * If a property name is provided for `predicate` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `predicate` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * **Note:** Unlike `_.filter`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Array} Returns the new array of removed elements.
- * @example
- *
- * var array = [1, 2, 3, 4];
- * var evens = _.remove(array, function(n) {
- * return n % 2 == 0;
- * });
- *
- * console.log(array);
- * // => [1, 3]
- *
- * console.log(evens);
- * // => [2, 4]
- */
- function remove(array, predicate, thisArg) {
- var result = [];
- if (!(array && array.length)) {
- return result;
- }
- var index = -1,
- indexes = [],
- length = array.length;
-
- predicate = getCallback(predicate, thisArg, 3);
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result.push(value);
- indexes.push(index);
- }
- }
- basePullAt(array, indexes);
- return result;
- }
-
- /**
- * Gets all but the first element of `array`.
- *
- * @static
- * @memberOf _
- * @alias tail
- * @category Array
- * @param {Array} array The array to query.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.rest([1, 2, 3]);
- * // => [2, 3]
- */
- function rest(array) {
- return drop(array, 1);
- }
-
- /**
- * Creates a slice of `array` from `start` up to, but not including, `end`.
- *
- * **Note:** This method is used instead of `Array#slice` to support node
- * lists in IE < 9 and to ensure dense arrays are returned.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to slice.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns the slice of `array`.
- */
- function slice(array, start, end) {
- var length = array ? array.length : 0;
- if (!length) {
- return [];
- }
- if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
- start = 0;
- end = length;
- }
- return baseSlice(array, start, end);
- }
-
- /**
- * Uses a binary search to determine the lowest index at which `value` should
- * be inserted into `array` in order to maintain its sort order. If an iteratee
- * function is provided it is invoked for `value` and each element of `array`
- * to compute their sort ranking. The iteratee is bound to `thisArg` and
- * invoked with one argument; (value).
- *
- * If a property name is provided for `iteratee` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `iteratee` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * _.sortedIndex([30, 50], 40);
- * // => 1
- *
- * _.sortedIndex([4, 4, 5, 5], 5);
- * // => 2
- *
- * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
- *
- * // using an iteratee function
- * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) {
- * return this.data[word];
- * }, dict);
- * // => 1
- *
- * // using the `_.property` callback shorthand
- * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
- * // => 1
- */
- var sortedIndex = createSortedIndex();
-
- /**
- * This method is like `_.sortedIndex` except that it returns the highest
- * index at which `value` should be inserted into `array` in order to
- * maintain its sort order.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * _.sortedLastIndex([4, 4, 5, 5], 5);
- * // => 4
- */
- var sortedLastIndex = createSortedIndex(true);
-
- /**
- * Creates a slice of `array` with `n` elements taken from the beginning.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to take.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.take([1, 2, 3]);
- * // => [1]
- *
- * _.take([1, 2, 3], 2);
- * // => [1, 2]
- *
- * _.take([1, 2, 3], 5);
- * // => [1, 2, 3]
- *
- * _.take([1, 2, 3], 0);
- * // => []
- */
- function take(array, n, guard) {
- var length = array ? array.length : 0;
- if (!length) {
- return [];
- }
- if (guard ? isIterateeCall(array, n, guard) : n == null) {
- n = 1;
- }
- return baseSlice(array, 0, n < 0 ? 0 : n);
- }
-
- /**
- * Creates a slice of `array` with `n` elements taken from the end.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to take.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.takeRight([1, 2, 3]);
- * // => [3]
- *
- * _.takeRight([1, 2, 3], 2);
- * // => [2, 3]
- *
- * _.takeRight([1, 2, 3], 5);
- * // => [1, 2, 3]
- *
- * _.takeRight([1, 2, 3], 0);
- * // => []
- */
- function takeRight(array, n, guard) {
- var length = array ? array.length : 0;
- if (!length) {
- return [];
- }
- if (guard ? isIterateeCall(array, n, guard) : n == null) {
- n = 1;
- }
- n = length - (+n || 0);
- return baseSlice(array, n < 0 ? 0 : n);
- }
-
- /**
- * Creates a slice of `array` with elements taken from the end. Elements are
- * taken until `predicate` returns falsey. The predicate is bound to `thisArg`
- * and invoked with three arguments: (value, index, array).
- *
- * If a property name is provided for `predicate` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `predicate` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.takeRightWhile([1, 2, 3], function(n) {
- * return n > 1;
- * });
- * // => [2, 3]
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
- * // => ['pebbles']
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.pluck(_.takeRightWhile(users, 'active', false), 'user');
- * // => ['fred', 'pebbles']
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.takeRightWhile(users, 'active'), 'user');
- * // => []
- */
- function takeRightWhile(array, predicate, thisArg) {
- return (array && array.length)
- ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true)
- : [];
- }
-
- /**
- * Creates a slice of `array` with elements taken from the beginning. Elements
- * are taken until `predicate` returns falsey. The predicate is bound to
- * `thisArg` and invoked with three arguments: (value, index, array).
- *
- * If a property name is provided for `predicate` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `predicate` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.takeWhile([1, 2, 3], function(n) {
- * return n < 3;
- * });
- * // => [1, 2]
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false},
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user');
- * // => ['barney']
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.pluck(_.takeWhile(users, 'active', false), 'user');
- * // => ['barney', 'fred']
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.takeWhile(users, 'active'), 'user');
- * // => []
- */
- function takeWhile(array, predicate, thisArg) {
- return (array && array.length)
- ? baseWhile(array, getCallback(predicate, thisArg, 3))
- : [];
- }
-
- /**
- * Creates an array of unique values, in order, from all of the provided arrays
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of combined values.
- * @example
- *
- * _.union([1, 2], [4, 2], [2, 1]);
- * // => [1, 2, 4]
- */
- var union = restParam(function(arrays) {
- return baseUniq(baseFlatten(arrays, false, true));
- });
-
- /**
- * Creates a duplicate-free version of an array, using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
- * for equality comparisons, in which only the first occurence of each element
- * is kept. Providing `true` for `isSorted` performs a faster search algorithm
- * for sorted arrays. If an iteratee function is provided it is invoked for
- * each element in the array to generate the criterion by which uniqueness
- * is computed. The `iteratee` is bound to `thisArg` and invoked with three
- * arguments: (value, index, array).
- *
- * If a property name is provided for `iteratee` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `iteratee` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @alias unique
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {boolean} [isSorted] Specify the array is sorted.
- * @param {Function|Object|string} [iteratee] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new duplicate-value-free array.
- * @example
- *
- * _.uniq([2, 1, 2]);
- * // => [2, 1]
- *
- * // using `isSorted`
- * _.uniq([1, 1, 2], true);
- * // => [1, 2]
- *
- * // using an iteratee function
- * _.uniq([1, 2.5, 1.5, 2], function(n) {
- * return this.floor(n);
- * }, Math);
- * // => [1, 2.5]
- *
- * // using the `_.property` callback shorthand
- * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }, { 'x': 2 }]
- */
- function uniq(array, isSorted, iteratee, thisArg) {
- var length = array ? array.length : 0;
- if (!length) {
- return [];
- }
- if (isSorted != null && typeof isSorted != 'boolean') {
- thisArg = iteratee;
- iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
- isSorted = false;
- }
- var callback = getCallback();
- if (!(iteratee == null && callback === baseCallback)) {
- iteratee = callback(iteratee, thisArg, 3);
- }
- return (isSorted && getIndexOf() == baseIndexOf)
- ? sortedUniq(array, iteratee)
- : baseUniq(array, iteratee);
- }
-
- /**
- * This method is like `_.zip` except that it accepts an array of grouped
- * elements and creates an array regrouping the elements to their pre-zip
- * configuration.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array of grouped elements to process.
- * @returns {Array} Returns the new array of regrouped elements.
- * @example
- *
- * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
- * // => [['fred', 30, true], ['barney', 40, false]]
- *
- * _.unzip(zipped);
- * // => [['fred', 'barney'], [30, 40], [true, false]]
- */
- function unzip(array) {
- if (!(array && array.length)) {
- return [];
- }
- var index = -1,
- length = 0;
-
- array = arrayFilter(array, function(group) {
- if (isArrayLike(group)) {
- length = nativeMax(group.length, length);
- return true;
- }
- });
- var result = Array(length);
- while (++index < length) {
- result[index] = arrayMap(array, baseProperty(index));
- }
- return result;
- }
-
- /**
- * This method is like `_.unzip` except that it accepts an iteratee to specify
- * how regrouped values should be combined. The `iteratee` is bound to `thisArg`
- * and invoked with four arguments: (accumulator, value, index, group).
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array of grouped elements to process.
- * @param {Function} [iteratee] The function to combine regrouped values.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new array of regrouped elements.
- * @example
- *
- * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
- * // => [[1, 10, 100], [2, 20, 200]]
- *
- * _.unzipWith(zipped, _.add);
- * // => [3, 30, 300]
- */
- function unzipWith(array, iteratee, thisArg) {
- var length = array ? array.length : 0;
- if (!length) {
- return [];
- }
- var result = unzip(array);
- if (iteratee == null) {
- return result;
- }
- iteratee = bindCallback(iteratee, thisArg, 4);
- return arrayMap(result, function(group) {
- return arrayReduce(group, iteratee, undefined, true);
- });
- }
-
- /**
- * Creates an array excluding all provided values using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to filter.
- * @param {...*} [values] The values to exclude.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.without([1, 2, 1, 3], 1, 2);
- * // => [3]
- */
- var without = restParam(function(array, values) {
- return isArrayLike(array)
- ? baseDifference(array, values)
- : [];
- });
-
- /**
- * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
- * of the provided arrays.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of values.
- * @example
- *
- * _.xor([1, 2], [4, 2]);
- * // => [1, 4]
- */
- function xor() {
- var index = -1,
- length = arguments.length;
-
- while (++index < length) {
- var array = arguments[index];
- if (isArrayLike(array)) {
- var result = result
- ? arrayPush(baseDifference(result, array), baseDifference(array, result))
- : array;
- }
- }
- return result ? baseUniq(result) : [];
- }
-
- /**
- * Creates an array of grouped elements, the first of which contains the first
- * elements of the given arrays, the second of which contains the second elements
- * of the given arrays, and so on.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {...Array} [arrays] The arrays to process.
- * @returns {Array} Returns the new array of grouped elements.
- * @example
- *
- * _.zip(['fred', 'barney'], [30, 40], [true, false]);
- * // => [['fred', 30, true], ['barney', 40, false]]
- */
- var zip = restParam(unzip);
-
- /**
- * The inverse of `_.pairs`; this method returns an object composed from arrays
- * of property names and values. Provide either a single two dimensional array,
- * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names
- * and one of corresponding values.
- *
- * @static
- * @memberOf _
- * @alias object
- * @category Array
- * @param {Array} props The property names.
- * @param {Array} [values=[]] The property values.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.zipObject([['fred', 30], ['barney', 40]]);
- * // => { 'fred': 30, 'barney': 40 }
- *
- * _.zipObject(['fred', 'barney'], [30, 40]);
- * // => { 'fred': 30, 'barney': 40 }
- */
- function zipObject(props, values) {
- var index = -1,
- length = props ? props.length : 0,
- result = {};
-
- if (length && !values && !isArray(props[0])) {
- values = [];
- }
- while (++index < length) {
- var key = props[index];
- if (values) {
- result[key] = values[index];
- } else if (key) {
- result[key[0]] = key[1];
- }
- }
- return result;
- }
-
- /**
- * This method is like `_.zip` except that it accepts an iteratee to specify
- * how grouped values should be combined. The `iteratee` is bound to `thisArg`
- * and invoked with four arguments: (accumulator, value, index, group).
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {...Array} [arrays] The arrays to process.
- * @param {Function} [iteratee] The function to combine grouped values.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new array of grouped elements.
- * @example
- *
- * _.zipWith([1, 2], [10, 20], [100, 200], _.add);
- * // => [111, 222]
- */
- var zipWith = restParam(function(arrays) {
- var length = arrays.length,
- iteratee = length > 2 ? arrays[length - 2] : undefined,
- thisArg = length > 1 ? arrays[length - 1] : undefined;
-
- if (length > 2 && typeof iteratee == 'function') {
- length -= 2;
- } else {
- iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;
- thisArg = undefined;
- }
- arrays.length = length;
- return unzipWith(arrays, iteratee, thisArg);
- });
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a `lodash` object that wraps `value` with explicit method
- * chaining enabled.
- *
- * @static
- * @memberOf _
- * @category Chain
- * @param {*} value The value to wrap.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 },
- * { 'user': 'pebbles', 'age': 1 }
- * ];
- *
- * var youngest = _.chain(users)
- * .sortBy('age')
- * .map(function(chr) {
- * return chr.user + ' is ' + chr.age;
- * })
- * .first()
- * .value();
- * // => 'pebbles is 1'
- */
- function chain(value) {
- var result = lodash(value);
- result.__chain__ = true;
- return result;
- }
-
- /**
- * This method invokes `interceptor` and returns `value`. The interceptor is
- * bound to `thisArg` and invoked with one argument; (value). The purpose of
- * this method is to "tap into" a method chain in order to perform operations
- * on intermediate results within the chain.
- *
- * @static
- * @memberOf _
- * @category Chain
- * @param {*} value The value to provide to `interceptor`.
- * @param {Function} interceptor The function to invoke.
- * @param {*} [thisArg] The `this` binding of `interceptor`.
- * @returns {*} Returns `value`.
- * @example
- *
- * _([1, 2, 3])
- * .tap(function(array) {
- * array.pop();
- * })
- * .reverse()
- * .value();
- * // => [2, 1]
- */
- function tap(value, interceptor, thisArg) {
- interceptor.call(thisArg, value);
- return value;
- }
-
- /**
- * This method is like `_.tap` except that it returns the result of `interceptor`.
- *
- * @static
- * @memberOf _
- * @category Chain
- * @param {*} value The value to provide to `interceptor`.
- * @param {Function} interceptor The function to invoke.
- * @param {*} [thisArg] The `this` binding of `interceptor`.
- * @returns {*} Returns the result of `interceptor`.
- * @example
- *
- * _(' abc ')
- * .chain()
- * .trim()
- * .thru(function(value) {
- * return [value];
- * })
- * .value();
- * // => ['abc']
- */
- function thru(value, interceptor, thisArg) {
- return interceptor.call(thisArg, value);
- }
-
- /**
- * Enables explicit method chaining on the wrapper object.
- *
- * @name chain
- * @memberOf _
- * @category Chain
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 }
- * ];
- *
- * // without explicit chaining
- * _(users).first();
- * // => { 'user': 'barney', 'age': 36 }
- *
- * // with explicit chaining
- * _(users).chain()
- * .first()
- * .pick('user')
- * .value();
- * // => { 'user': 'barney' }
- */
- function wrapperChain() {
- return chain(this);
- }
-
- /**
- * Executes the chained sequence and returns the wrapped result.
- *
- * @name commit
- * @memberOf _
- * @category Chain
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2];
- * var wrapped = _(array).push(3);
- *
- * console.log(array);
- * // => [1, 2]
- *
- * wrapped = wrapped.commit();
- * console.log(array);
- * // => [1, 2, 3]
- *
- * wrapped.last();
- * // => 3
- *
- * console.log(array);
- * // => [1, 2, 3]
- */
- function wrapperCommit() {
- return new LodashWrapper(this.value(), this.__chain__);
- }
-
- /**
- * Creates a new array joining a wrapped array with any additional arrays
- * and/or values.
- *
- * @name concat
- * @memberOf _
- * @category Chain
- * @param {...*} [values] The values to concatenate.
- * @returns {Array} Returns the new concatenated array.
- * @example
- *
- * var array = [1];
- * var wrapped = _(array).concat(2, [3], [[4]]);
- *
- * console.log(wrapped.value());
- * // => [1, 2, 3, [4]]
- *
- * console.log(array);
- * // => [1]
- */
- var wrapperConcat = restParam(function(values) {
- values = baseFlatten(values);
- return this.thru(function(array) {
- return arrayConcat(isArray(array) ? array : [toObject(array)], values);
- });
- });
-
- /**
- * Creates a clone of the chained sequence planting `value` as the wrapped value.
- *
- * @name plant
- * @memberOf _
- * @category Chain
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2];
- * var wrapped = _(array).map(function(value) {
- * return Math.pow(value, 2);
- * });
- *
- * var other = [3, 4];
- * var otherWrapped = wrapped.plant(other);
- *
- * otherWrapped.value();
- * // => [9, 16]
- *
- * wrapped.value();
- * // => [1, 4]
- */
- function wrapperPlant(value) {
- var result,
- parent = this;
-
- while (parent instanceof baseLodash) {
- var clone = wrapperClone(parent);
- if (result) {
- previous.__wrapped__ = clone;
- } else {
- result = clone;
- }
- var previous = clone;
- parent = parent.__wrapped__;
- }
- previous.__wrapped__ = value;
- return result;
- }
-
- /**
- * Reverses the wrapped array so the first element becomes the last, the
- * second element becomes the second to last, and so on.
- *
- * **Note:** This method mutates the wrapped array.
- *
- * @name reverse
- * @memberOf _
- * @category Chain
- * @returns {Object} Returns the new reversed `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _(array).reverse().value()
- * // => [3, 2, 1]
- *
- * console.log(array);
- * // => [3, 2, 1]
- */
- function wrapperReverse() {
- var value = this.__wrapped__;
-
- var interceptor = function(value) {
- return (wrapped && wrapped.__dir__ < 0) ? value : value.reverse();
- };
- if (value instanceof LazyWrapper) {
- var wrapped = value;
- if (this.__actions__.length) {
- wrapped = new LazyWrapper(this);
- }
- wrapped = wrapped.reverse();
- wrapped.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
- return new LodashWrapper(wrapped, this.__chain__);
- }
- return this.thru(interceptor);
- }
-
- /**
- * Produces the result of coercing the unwrapped value to a string.
- *
- * @name toString
- * @memberOf _
- * @category Chain
- * @returns {string} Returns the coerced string value.
- * @example
- *
- * _([1, 2, 3]).toString();
- * // => '1,2,3'
- */
- function wrapperToString() {
- return (this.value() + '');
- }
-
- /**
- * Executes the chained sequence to extract the unwrapped value.
- *
- * @name value
- * @memberOf _
- * @alias run, toJSON, valueOf
- * @category Chain
- * @returns {*} Returns the resolved unwrapped value.
- * @example
- *
- * _([1, 2, 3]).value();
- * // => [1, 2, 3]
- */
- function wrapperValue() {
- return baseWrapperValue(this.__wrapped__, this.__actions__);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an array of elements corresponding to the given keys, or indexes,
- * of `collection`. Keys may be specified as individual arguments or as arrays
- * of keys.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {...(number|number[]|string|string[])} [props] The property names
- * or indexes of elements to pick, specified individually or in arrays.
- * @returns {Array} Returns the new array of picked elements.
- * @example
- *
- * _.at(['a', 'b', 'c'], [0, 2]);
- * // => ['a', 'c']
- *
- * _.at(['barney', 'fred', 'pebbles'], 0, 2);
- * // => ['barney', 'pebbles']
- */
- var at = restParam(function(collection, props) {
- return baseAt(collection, baseFlatten(props));
- });
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` through `iteratee`. The corresponding value
- * of each key is the number of times the key was returned by `iteratee`.
- * The `iteratee` is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * If a property name is provided for `iteratee` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `iteratee` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * _.countBy([4.3, 6.1, 6.4], function(n) {
- * return Math.floor(n);
- * });
- * // => { '4': 1, '6': 2 }
- *
- * _.countBy([4.3, 6.1, 6.4], function(n) {
- * return this.floor(n);
- * }, Math);
- * // => { '4': 1, '6': 2 }
- *
- * _.countBy(['one', 'two', 'three'], 'length');
- * // => { '3': 2, '5': 1 }
- */
- var countBy = createAggregator(function(result, value, key) {
- hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
- });
-
- /**
- * Checks if `predicate` returns truthy for **all** elements of `collection`.
- * The predicate is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * If a property name is provided for `predicate` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `predicate` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @alias all
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- * @example
- *
- * _.every([true, 1, null, 'yes'], Boolean);
- * // => false
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.every(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.every(users, 'active', false);
- * // => true
- *
- * // using the `_.property` callback shorthand
- * _.every(users, 'active');
- * // => false
- */
- function every(collection, predicate, thisArg) {
- var func = isArray(collection) ? arrayEvery : baseEvery;
- if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
- predicate = undefined;
- }
- if (typeof predicate != 'function' || thisArg !== undefined) {
- predicate = getCallback(predicate, thisArg, 3);
- }
- return func(collection, predicate);
- }
-
- /**
- * Iterates over elements of `collection`, returning an array of all elements
- * `predicate` returns truthy for. The predicate is bound to `thisArg` and
- * invoked with three arguments: (value, index|key, collection).
- *
- * If a property name is provided for `predicate` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `predicate` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @alias select
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Array} Returns the new filtered array.
- * @example
- *
- * _.filter([4, 5, 6], function(n) {
- * return n % 2 == 0;
- * });
- * // => [4, 6]
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');
- * // => ['barney']
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.pluck(_.filter(users, 'active', false), 'user');
- * // => ['fred']
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.filter(users, 'active'), 'user');
- * // => ['barney']
- */
- function filter(collection, predicate, thisArg) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- predicate = getCallback(predicate, thisArg, 3);
- return func(collection, predicate);
- }
-
- /**
- * Iterates over elements of `collection`, returning the first element
- * `predicate` returns truthy for. The predicate is bound to `thisArg` and
- * invoked with three arguments: (value, index|key, collection).
- *
- * If a property name is provided for `predicate` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `predicate` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @alias detect
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false },
- * { 'user': 'pebbles', 'age': 1, 'active': true }
- * ];
- *
- * _.result(_.find(users, function(chr) {
- * return chr.age < 40;
- * }), 'user');
- * // => 'barney'
- *
- * // using the `_.matches` callback shorthand
- * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
- * // => 'pebbles'
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.result(_.find(users, 'active', false), 'user');
- * // => 'fred'
- *
- * // using the `_.property` callback shorthand
- * _.result(_.find(users, 'active'), 'user');
- * // => 'barney'
- */
- var find = createFind(baseEach);
-
- /**
- * This method is like `_.find` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * _.findLast([1, 2, 3, 4], function(n) {
- * return n % 2 == 1;
- * });
- * // => 3
- */
- var findLast = createFind(baseEachRight, true);
-
- /**
- * Performs a deep comparison between each element in `collection` and the
- * source object, returning the first element that has equivalent property
- * values.
- *
- * **Note:** This method supports comparing arrays, booleans, `Date` objects,
- * numbers, `Object` objects, regexes, and strings. Objects are compared by
- * their own, not inherited, enumerable properties. For comparing a single
- * own or inherited property value see `_.matchesProperty`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {Object} source The object of property values to match.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user');
- * // => 'barney'
- *
- * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user');
- * // => 'fred'
- */
- function findWhere(collection, source) {
- return find(collection, baseMatches(source));
- }
-
- /**
- * Iterates over elements of `collection` invoking `iteratee` for each element.
- * The `iteratee` is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection). Iteratee functions may exit iteration early
- * by explicitly returning `false`.
- *
- * **Note:** As with other "Collections" methods, objects with a "length" property
- * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
- * may be used for object iteration.
- *
- * @static
- * @memberOf _
- * @alias each
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array|Object|string} Returns `collection`.
- * @example
- *
- * _([1, 2]).forEach(function(n) {
- * console.log(n);
- * }).value();
- * // => logs each value from left to right and returns the array
- *
- * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
- * console.log(n, key);
- * });
- * // => logs each value-key pair and returns the object (iteration order is not guaranteed)
- */
- var forEach = createForEach(arrayEach, baseEach);
-
- /**
- * This method is like `_.forEach` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @alias eachRight
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array|Object|string} Returns `collection`.
- * @example
- *
- * _([1, 2]).forEachRight(function(n) {
- * console.log(n);
- * }).value();
- * // => logs each value from right to left and returns the array
- */
- var forEachRight = createForEach(arrayEachRight, baseEachRight);
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` through `iteratee`. The corresponding value
- * of each key is an array of the elements responsible for generating the key.
- * The `iteratee` is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * If a property name is provided for `iteratee` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `iteratee` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * _.groupBy([4.2, 6.1, 6.4], function(n) {
- * return Math.floor(n);
- * });
- * // => { '4': [4.2], '6': [6.1, 6.4] }
- *
- * _.groupBy([4.2, 6.1, 6.4], function(n) {
- * return this.floor(n);
- * }, Math);
- * // => { '4': [4.2], '6': [6.1, 6.4] }
- *
- * // using the `_.property` callback shorthand
- * _.groupBy(['one', 'two', 'three'], 'length');
- * // => { '3': ['one', 'two'], '5': ['three'] }
- */
- var groupBy = createAggregator(function(result, value, key) {
- if (hasOwnProperty.call(result, key)) {
- result[key].push(value);
- } else {
- result[key] = [value];
- }
- });
-
- /**
- * Checks if `value` is in `collection` using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
- * for equality comparisons. If `fromIndex` is negative, it is used as the offset
- * from the end of `collection`.
- *
- * @static
- * @memberOf _
- * @alias contains, include
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {*} target The value to search for.
- * @param {number} [fromIndex=0] The index to search from.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
- * @returns {boolean} Returns `true` if a matching element is found, else `false`.
- * @example
- *
- * _.includes([1, 2, 3], 1);
- * // => true
- *
- * _.includes([1, 2, 3], 1, 2);
- * // => false
- *
- * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
- * // => true
- *
- * _.includes('pebbles', 'eb');
- * // => true
- */
- function includes(collection, target, fromIndex, guard) {
- var length = collection ? getLength(collection) : 0;
- if (!isLength(length)) {
- collection = values(collection);
- length = collection.length;
- }
- if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
- fromIndex = 0;
- } else {
- fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
- }
- return (typeof collection == 'string' || !isArray(collection) && isString(collection))
- ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1)
- : (!!length && getIndexOf(collection, target, fromIndex) > -1);
- }
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` through `iteratee`. The corresponding value
- * of each key is the last element responsible for generating the key. The
- * iteratee function is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * If a property name is provided for `iteratee` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `iteratee` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * var keyData = [
- * { 'dir': 'left', 'code': 97 },
- * { 'dir': 'right', 'code': 100 }
- * ];
- *
- * _.indexBy(keyData, 'dir');
- * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
- *
- * _.indexBy(keyData, function(object) {
- * return String.fromCharCode(object.code);
- * });
- * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
- *
- * _.indexBy(keyData, function(object) {
- * return this.fromCharCode(object.code);
- * }, String);
- * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
- */
- var indexBy = createAggregator(function(result, value, key) {
- result[key] = value;
- });
-
- /**
- * Invokes the method at `path` of each element in `collection`, returning
- * an array of the results of each invoked method. Any additional arguments
- * are provided to each invoked method. If `methodName` is a function it is
- * invoked for, and `this` bound to, each element in `collection`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Array|Function|string} path The path of the method to invoke or
- * the function invoked per iteration.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {Array} Returns the array of results.
- * @example
- *
- * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
- * // => [[1, 5, 7], [1, 2, 3]]
- *
- * _.invoke([123, 456], String.prototype.split, '');
- * // => [['1', '2', '3'], ['4', '5', '6']]
- */
- var invoke = restParam(function(collection, path, args) {
- var index = -1,
- isFunc = typeof path == 'function',
- isProp = isKey(path),
- result = isArrayLike(collection) ? Array(collection.length) : [];
-
- baseEach(collection, function(value) {
- var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
- result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
- });
- return result;
- });
-
- /**
- * Creates an array of values by running each element in `collection` through
- * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
- * arguments: (value, index|key, collection).
- *
- * If a property name is provided for `iteratee` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `iteratee` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * Many lodash methods are guarded to work as iteratees for methods like
- * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
- *
- * The guarded methods are:
- * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,
- * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,
- * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,
- * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,
- * `sum`, `uniq`, and `words`
- *
- * @static
- * @memberOf _
- * @alias collect
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new mapped array.
- * @example
- *
- * function timesThree(n) {
- * return n * 3;
- * }
- *
- * _.map([1, 2], timesThree);
- * // => [3, 6]
- *
- * _.map({ 'a': 1, 'b': 2 }, timesThree);
- * // => [3, 6] (iteration order is not guaranteed)
- *
- * var users = [
- * { 'user': 'barney' },
- * { 'user': 'fred' }
- * ];
- *
- * // using the `_.property` callback shorthand
- * _.map(users, 'user');
- * // => ['barney', 'fred']
- */
- function map(collection, iteratee, thisArg) {
- var func = isArray(collection) ? arrayMap : baseMap;
- iteratee = getCallback(iteratee, thisArg, 3);
- return func(collection, iteratee);
- }
-
- /**
- * Creates an array of elements split into two groups, the first of which
- * contains elements `predicate` returns truthy for, while the second of which
- * contains elements `predicate` returns falsey for. The predicate is bound
- * to `thisArg` and invoked with three arguments: (value, index|key, collection).
- *
- * If a property name is provided for `predicate` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `predicate` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Array} Returns the array of grouped elements.
- * @example
- *
- * _.partition([1, 2, 3], function(n) {
- * return n % 2;
- * });
- * // => [[1, 3], [2]]
- *
- * _.partition([1.2, 2.3, 3.4], function(n) {
- * return this.floor(n) % 2;
- * }, Math);
- * // => [[1.2, 3.4], [2.3]]
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': true },
- * { 'user': 'pebbles', 'age': 1, 'active': false }
- * ];
- *
- * var mapper = function(array) {
- * return _.pluck(array, 'user');
- * };
- *
- * // using the `_.matches` callback shorthand
- * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper);
- * // => [['pebbles'], ['barney', 'fred']]
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.map(_.partition(users, 'active', false), mapper);
- * // => [['barney', 'pebbles'], ['fred']]
- *
- * // using the `_.property` callback shorthand
- * _.map(_.partition(users, 'active'), mapper);
- * // => [['fred'], ['barney', 'pebbles']]
- */
- var partition = createAggregator(function(result, value, key) {
- result[key ? 0 : 1].push(value);
- }, function() { return [[], []]; });
-
- /**
- * Gets the property value of `path` from all elements in `collection`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Array|string} path The path of the property to pluck.
- * @returns {Array} Returns the property values.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 }
- * ];
- *
- * _.pluck(users, 'user');
- * // => ['barney', 'fred']
- *
- * var userIndex = _.indexBy(users, 'user');
- * _.pluck(userIndex, 'age');
- * // => [36, 40] (iteration order is not guaranteed)
- */
- function pluck(collection, path) {
- return map(collection, property(path));
- }
-
- /**
- * Reduces `collection` to a value which is the accumulated result of running
- * each element in `collection` through `iteratee`, where each successive
- * invocation is supplied the return value of the previous. If `accumulator`
- * is not provided the first element of `collection` is used as the initial
- * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:
- * (accumulator, value, index|key, collection).
- *
- * Many lodash methods are guarded to work as iteratees for methods like
- * `_.reduce`, `_.reduceRight`, and `_.transform`.
- *
- * The guarded methods are:
- * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `sortByAll`,
- * and `sortByOrder`
- *
- * @static
- * @memberOf _
- * @alias foldl, inject
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {*} Returns the accumulated value.
- * @example
- *
- * _.reduce([1, 2], function(total, n) {
- * return total + n;
- * });
- * // => 3
- *
- * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {
- * result[key] = n * 3;
- * return result;
- * }, {});
- * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)
- */
- var reduce = createReduce(arrayReduce, baseEach);
-
- /**
- * This method is like `_.reduce` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @alias foldr
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {*} Returns the accumulated value.
- * @example
- *
- * var array = [[0, 1], [2, 3], [4, 5]];
- *
- * _.reduceRight(array, function(flattened, other) {
- * return flattened.concat(other);
- * }, []);
- * // => [4, 5, 2, 3, 0, 1]
- */
- var reduceRight = createReduce(arrayReduceRight, baseEachRight);
-
- /**
- * The opposite of `_.filter`; this method returns the elements of `collection`
- * that `predicate` does **not** return truthy for.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Array} Returns the new filtered array.
- * @example
- *
- * _.reject([1, 2, 3, 4], function(n) {
- * return n % 2 == 0;
- * });
- * // => [1, 3]
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': true }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user');
- * // => ['barney']
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.pluck(_.reject(users, 'active', false), 'user');
- * // => ['fred']
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.reject(users, 'active'), 'user');
- * // => ['barney']
- */
- function reject(collection, predicate, thisArg) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- predicate = getCallback(predicate, thisArg, 3);
- return func(collection, function(value, index, collection) {
- return !predicate(value, index, collection);
- });
- }
-
- /**
- * Gets a random element or `n` random elements from a collection.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to sample.
- * @param {number} [n] The number of elements to sample.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {*} Returns the random sample(s).
- * @example
- *
- * _.sample([1, 2, 3, 4]);
- * // => 2
- *
- * _.sample([1, 2, 3, 4], 2);
- * // => [3, 1]
- */
- function sample(collection, n, guard) {
- if (guard ? isIterateeCall(collection, n, guard) : n == null) {
- collection = toIterable(collection);
- var length = collection.length;
- return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
- }
- var index = -1,
- result = toArray(collection),
- length = result.length,
- lastIndex = length - 1;
-
- n = nativeMin(n < 0 ? 0 : (+n || 0), length);
- while (++index < n) {
- var rand = baseRandom(index, lastIndex),
- value = result[rand];
-
- result[rand] = result[index];
- result[index] = value;
- }
- result.length = n;
- return result;
- }
-
- /**
- * Creates an array of shuffled values, using a version of the
- * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to shuffle.
- * @returns {Array} Returns the new shuffled array.
- * @example
- *
- * _.shuffle([1, 2, 3, 4]);
- * // => [4, 1, 3, 2]
- */
- function shuffle(collection) {
- return sample(collection, POSITIVE_INFINITY);
- }
-
- /**
- * Gets the size of `collection` by returning its length for array-like
- * values or the number of own enumerable properties for objects.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to inspect.
- * @returns {number} Returns the size of `collection`.
- * @example
- *
- * _.size([1, 2, 3]);
- * // => 3
- *
- * _.size({ 'a': 1, 'b': 2 });
- * // => 2
- *
- * _.size('pebbles');
- * // => 7
- */
- function size(collection) {
- var length = collection ? getLength(collection) : 0;
- return isLength(length) ? length : keys(collection).length;
- }
-
- /**
- * Checks if `predicate` returns truthy for **any** element of `collection`.
- * The function returns as soon as it finds a passing value and does not iterate
- * over the entire collection. The predicate is bound to `thisArg` and invoked
- * with three arguments: (value, index|key, collection).
- *
- * If a property name is provided for `predicate` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `predicate` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @alias any
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- * @example
- *
- * _.some([null, 0, 'yes', false], Boolean);
- * // => true
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false }
- * ];
- *
- * // using the `_.matches` callback shorthand
- * _.some(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.some(users, 'active', false);
- * // => true
- *
- * // using the `_.property` callback shorthand
- * _.some(users, 'active');
- * // => true
- */
- function some(collection, predicate, thisArg) {
- var func = isArray(collection) ? arraySome : baseSome;
- if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
- predicate = undefined;
- }
- if (typeof predicate != 'function' || thisArg !== undefined) {
- predicate = getCallback(predicate, thisArg, 3);
- }
- return func(collection, predicate);
- }
-
- /**
- * Creates an array of elements, sorted in ascending order by the results of
- * running each element in a collection through `iteratee`. This method performs
- * a stable sort, that is, it preserves the original sort order of equal elements.
- * The `iteratee` is bound to `thisArg` and invoked with three arguments:
- * (value, index|key, collection).
- *
- * If a property name is provided for `iteratee` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `iteratee` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * _.sortBy([1, 2, 3], function(n) {
- * return Math.sin(n);
- * });
- * // => [3, 1, 2]
- *
- * _.sortBy([1, 2, 3], function(n) {
- * return this.sin(n);
- * }, Math);
- * // => [3, 1, 2]
- *
- * var users = [
- * { 'user': 'fred' },
- * { 'user': 'pebbles' },
- * { 'user': 'barney' }
- * ];
- *
- * // using the `_.property` callback shorthand
- * _.pluck(_.sortBy(users, 'user'), 'user');
- * // => ['barney', 'fred', 'pebbles']
- */
- function sortBy(collection, iteratee, thisArg) {
- if (collection == null) {
- return [];
- }
- if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
- iteratee = undefined;
- }
- var index = -1;
- iteratee = getCallback(iteratee, thisArg, 3);
-
- var result = baseMap(collection, function(value, key, collection) {
- return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value };
- });
- return baseSortBy(result, compareAscending);
- }
-
- /**
- * This method is like `_.sortBy` except that it can sort by multiple iteratees
- * or property names.
- *
- * If a property name is provided for an iteratee the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If an object is provided for an iteratee the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees
- * The iteratees to sort by, specified as individual values or arrays of values.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * var users = [
- * { 'user': 'fred', 'age': 48 },
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 42 },
- * { 'user': 'barney', 'age': 34 }
- * ];
- *
- * _.map(_.sortByAll(users, ['user', 'age']), _.values);
- * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]
- *
- * _.map(_.sortByAll(users, 'user', function(chr) {
- * return Math.floor(chr.age / 10);
- * }), _.values);
- * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
- */
- var sortByAll = restParam(function(collection, iteratees) {
- if (collection == null) {
- return [];
- }
- var guard = iteratees[2];
- if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {
- iteratees.length = 1;
- }
- return baseSortByOrder(collection, baseFlatten(iteratees), []);
- });
-
- /**
- * This method is like `_.sortByAll` except that it allows specifying the
- * sort orders of the iteratees to sort by. If `orders` is unspecified, all
- * values are sorted in ascending order. Otherwise, a value is sorted in
- * ascending order if its corresponding order is "asc", and descending if "desc".
- *
- * If a property name is provided for an iteratee the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If an object is provided for an iteratee the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
- * @param {boolean[]} [orders] The sort orders of `iteratees`.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * var users = [
- * { 'user': 'fred', 'age': 48 },
- * { 'user': 'barney', 'age': 34 },
- * { 'user': 'fred', 'age': 42 },
- * { 'user': 'barney', 'age': 36 }
- * ];
- *
- * // sort by `user` in ascending order and by `age` in descending order
- * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values);
- * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
- */
- function sortByOrder(collection, iteratees, orders, guard) {
- if (collection == null) {
- return [];
- }
- if (guard && isIterateeCall(iteratees, orders, guard)) {
- orders = undefined;
- }
- if (!isArray(iteratees)) {
- iteratees = iteratees == null ? [] : [iteratees];
- }
- if (!isArray(orders)) {
- orders = orders == null ? [] : [orders];
- }
- return baseSortByOrder(collection, iteratees, orders);
- }
-
- /**
- * Performs a deep comparison between each element in `collection` and the
- * source object, returning an array of all elements that have equivalent
- * property values.
- *
- * **Note:** This method supports comparing arrays, booleans, `Date` objects,
- * numbers, `Object` objects, regexes, and strings. Objects are compared by
- * their own, not inherited, enumerable properties. For comparing a single
- * own or inherited property value see `_.matchesProperty`.
- *
- * @static
- * @memberOf _
- * @category Collection
- * @param {Array|Object|string} collection The collection to search.
- * @param {Object} source The object of property values to match.
- * @returns {Array} Returns the new filtered array.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] },
- * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] }
- * ];
- *
- * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user');
- * // => ['barney']
- *
- * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user');
- * // => ['fred']
- */
- function where(collection, source) {
- return filter(collection, baseMatches(source));
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Gets the number of milliseconds that have elapsed since the Unix epoch
- * (1 January 1970 00:00:00 UTC).
- *
- * @static
- * @memberOf _
- * @category Date
- * @example
- *
- * _.defer(function(stamp) {
- * console.log(_.now() - stamp);
- * }, _.now());
- * // => logs the number of milliseconds it took for the deferred function to be invoked
- */
- var now = nativeNow || function() {
- return new Date().getTime();
- };
-
- /*------------------------------------------------------------------------*/
-
- /**
- * The opposite of `_.before`; this method creates a function that invokes
- * `func` once it is called `n` or more times.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {number} n The number of calls before `func` is invoked.
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * var saves = ['profile', 'settings'];
- *
- * var done = _.after(saves.length, function() {
- * console.log('done saving!');
- * });
- *
- * _.forEach(saves, function(type) {
- * asyncSave({ 'type': type, 'complete': done });
- * });
- * // => logs 'done saving!' after the two async saves have completed
- */
- function after(n, func) {
- if (typeof func != 'function') {
- if (typeof n == 'function') {
- var temp = n;
- n = func;
- func = temp;
- } else {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- }
- n = nativeIsFinite(n = +n) ? n : 0;
- return function() {
- if (--n < 1) {
- return func.apply(this, arguments);
- }
- };
- }
-
- /**
- * Creates a function that accepts up to `n` arguments ignoring any
- * additional arguments.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to cap arguments for.
- * @param {number} [n=func.length] The arity cap.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Function} Returns the new function.
- * @example
- *
- * _.map(['6', '8', '10'], _.ary(parseInt, 1));
- * // => [6, 8, 10]
- */
- function ary(func, n, guard) {
- if (guard && isIterateeCall(func, n, guard)) {
- n = undefined;
- }
- n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);
- return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
- }
-
- /**
- * Creates a function that invokes `func`, with the `this` binding and arguments
- * of the created function, while it is called less than `n` times. Subsequent
- * calls to the created function return the result of the last `func` invocation.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {number} n The number of calls at which `func` is no longer invoked.
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * jQuery('#add').on('click', _.before(5, addContactToList));
- * // => allows adding up to 4 contacts to the list
- */
- function before(n, func) {
- var result;
- if (typeof func != 'function') {
- if (typeof n == 'function') {
- var temp = n;
- n = func;
- func = temp;
- } else {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- }
- return function() {
- if (--n > 0) {
- result = func.apply(this, arguments);
- }
- if (n <= 1) {
- func = undefined;
- }
- return result;
- };
- }
-
- /**
- * Creates a function that invokes `func` with the `this` binding of `thisArg`
- * and prepends any additional `_.bind` arguments to those provided to the
- * bound function.
- *
- * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
- * may be used as a placeholder for partially applied arguments.
- *
- * **Note:** Unlike native `Function#bind` this method does not set the "length"
- * property of bound functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to bind.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new bound function.
- * @example
- *
- * var greet = function(greeting, punctuation) {
- * return greeting + ' ' + this.user + punctuation;
- * };
- *
- * var object = { 'user': 'fred' };
- *
- * var bound = _.bind(greet, object, 'hi');
- * bound('!');
- * // => 'hi fred!'
- *
- * // using placeholders
- * var bound = _.bind(greet, object, _, '!');
- * bound('hi');
- * // => 'hi fred!'
- */
- var bind = restParam(function(func, thisArg, partials) {
- var bitmask = BIND_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, bind.placeholder);
- bitmask |= PARTIAL_FLAG;
- }
- return createWrapper(func, bitmask, thisArg, partials, holders);
- });
-
- /**
- * Binds methods of an object to the object itself, overwriting the existing
- * method. Method names may be specified as individual arguments or as arrays
- * of method names. If no method names are provided all enumerable function
- * properties, own and inherited, of `object` are bound.
- *
- * **Note:** This method does not set the "length" property of bound functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Object} object The object to bind and assign the bound methods to.
- * @param {...(string|string[])} [methodNames] The object method names to bind,
- * specified as individual method names or arrays of method names.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var view = {
- * 'label': 'docs',
- * 'onClick': function() {
- * console.log('clicked ' + this.label);
- * }
- * };
- *
- * _.bindAll(view);
- * jQuery('#docs').on('click', view.onClick);
- * // => logs 'clicked docs' when the element is clicked
- */
- var bindAll = restParam(function(object, methodNames) {
- methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
-
- var index = -1,
- length = methodNames.length;
-
- while (++index < length) {
- var key = methodNames[index];
- object[key] = createWrapper(object[key], BIND_FLAG, object);
- }
- return object;
- });
-
- /**
- * Creates a function that invokes the method at `object[key]` and prepends
- * any additional `_.bindKey` arguments to those provided to the bound function.
- *
- * This method differs from `_.bind` by allowing bound functions to reference
- * methods that may be redefined or don't yet exist.
- * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
- * for more details.
- *
- * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Object} object The object the method belongs to.
- * @param {string} key The key of the method.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new bound function.
- * @example
- *
- * var object = {
- * 'user': 'fred',
- * 'greet': function(greeting, punctuation) {
- * return greeting + ' ' + this.user + punctuation;
- * }
- * };
- *
- * var bound = _.bindKey(object, 'greet', 'hi');
- * bound('!');
- * // => 'hi fred!'
- *
- * object.greet = function(greeting, punctuation) {
- * return greeting + 'ya ' + this.user + punctuation;
- * };
- *
- * bound('!');
- * // => 'hiya fred!'
- *
- * // using placeholders
- * var bound = _.bindKey(object, 'greet', _, '!');
- * bound('hi');
- * // => 'hiya fred!'
- */
- var bindKey = restParam(function(object, key, partials) {
- var bitmask = BIND_FLAG | BIND_KEY_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, bindKey.placeholder);
- bitmask |= PARTIAL_FLAG;
- }
- return createWrapper(key, bitmask, object, partials, holders);
- });
-
- /**
- * Creates a function that accepts one or more arguments of `func` that when
- * called either invokes `func` returning its result, if all `func` arguments
- * have been provided, or returns a function that accepts one or more of the
- * remaining `func` arguments, and so on. The arity of `func` may be specified
- * if `func.length` is not sufficient.
- *
- * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
- * may be used as a placeholder for provided arguments.
- *
- * **Note:** This method does not set the "length" property of curried functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to curry.
- * @param {number} [arity=func.length] The arity of `func`.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Function} Returns the new curried function.
- * @example
- *
- * var abc = function(a, b, c) {
- * return [a, b, c];
- * };
- *
- * var curried = _.curry(abc);
- *
- * curried(1)(2)(3);
- * // => [1, 2, 3]
- *
- * curried(1, 2)(3);
- * // => [1, 2, 3]
- *
- * curried(1, 2, 3);
- * // => [1, 2, 3]
- *
- * // using placeholders
- * curried(1)(_, 3)(2);
- * // => [1, 2, 3]
- */
- var curry = createCurry(CURRY_FLAG);
-
- /**
- * This method is like `_.curry` except that arguments are applied to `func`
- * in the manner of `_.partialRight` instead of `_.partial`.
- *
- * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for provided arguments.
- *
- * **Note:** This method does not set the "length" property of curried functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to curry.
- * @param {number} [arity=func.length] The arity of `func`.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Function} Returns the new curried function.
- * @example
- *
- * var abc = function(a, b, c) {
- * return [a, b, c];
- * };
- *
- * var curried = _.curryRight(abc);
- *
- * curried(3)(2)(1);
- * // => [1, 2, 3]
- *
- * curried(2, 3)(1);
- * // => [1, 2, 3]
- *
- * curried(1, 2, 3);
- * // => [1, 2, 3]
- *
- * // using placeholders
- * curried(3)(1, _)(2);
- * // => [1, 2, 3]
- */
- var curryRight = createCurry(CURRY_RIGHT_FLAG);
-
- /**
- * Creates a debounced function that delays invoking `func` until after `wait`
- * milliseconds have elapsed since the last time the debounced function was
- * invoked. The debounced function comes with a `cancel` method to cancel
- * delayed invocations. Provide an options object to indicate that `func`
- * should be invoked on the leading and/or trailing edge of the `wait` timeout.
- * Subsequent calls to the debounced function return the result of the last
- * `func` invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
- * on the trailing edge of the timeout only if the the debounced function is
- * invoked more than once during the `wait` timeout.
- *
- * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
- * for details over the differences between `_.debounce` and `_.throttle`.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to debounce.
- * @param {number} [wait=0] The number of milliseconds to delay.
- * @param {Object} [options] The options object.
- * @param {boolean} [options.leading=false] Specify invoking on the leading
- * edge of the timeout.
- * @param {number} [options.maxWait] The maximum time `func` is allowed to be
- * delayed before it is invoked.
- * @param {boolean} [options.trailing=true] Specify invoking on the trailing
- * edge of the timeout.
- * @returns {Function} Returns the new debounced function.
- * @example
- *
- * // avoid costly calculations while the window size is in flux
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
- *
- * // invoke `sendMail` when the click event is fired, debouncing subsequent calls
- * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
- * 'leading': true,
- * 'trailing': false
- * }));
- *
- * // ensure `batchLog` is invoked once after 1 second of debounced calls
- * var source = new EventSource('/stream');
- * jQuery(source).on('message', _.debounce(batchLog, 250, {
- * 'maxWait': 1000
- * }));
- *
- * // cancel a debounced call
- * var todoChanges = _.debounce(batchLog, 1000);
- * Object.observe(models.todo, todoChanges);
- *
- * Object.observe(models, function(changes) {
- * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {
- * todoChanges.cancel();
- * }
- * }, ['delete']);
- *
- * // ...at some point `models.todo` is changed
- * models.todo.completed = true;
- *
- * // ...before 1 second has passed `models.todo` is deleted
- * // which cancels the debounced `todoChanges` call
- * delete models.todo;
- */
- function debounce(func, wait, options) {
- var args,
- maxTimeoutId,
- result,
- stamp,
- thisArg,
- timeoutId,
- trailingCall,
- lastCalled = 0,
- maxWait = false,
- trailing = true;
-
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- wait = wait < 0 ? 0 : (+wait || 0);
- if (options === true) {
- var leading = true;
- trailing = false;
- } else if (isObject(options)) {
- leading = !!options.leading;
- maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
-
- function cancel() {
- if (timeoutId) {
- clearTimeout(timeoutId);
- }
- if (maxTimeoutId) {
- clearTimeout(maxTimeoutId);
- }
- lastCalled = 0;
- maxTimeoutId = timeoutId = trailingCall = undefined;
- }
-
- function complete(isCalled, id) {
- if (id) {
- clearTimeout(id);
- }
- maxTimeoutId = timeoutId = trailingCall = undefined;
- if (isCalled) {
- lastCalled = now();
- result = func.apply(thisArg, args);
- if (!timeoutId && !maxTimeoutId) {
- args = thisArg = undefined;
- }
- }
- }
-
- function delayed() {
- var remaining = wait - (now() - stamp);
- if (remaining <= 0 || remaining > wait) {
- complete(trailingCall, maxTimeoutId);
- } else {
- timeoutId = setTimeout(delayed, remaining);
- }
- }
-
- function maxDelayed() {
- complete(trailing, timeoutId);
- }
-
- function debounced() {
- args = arguments;
- stamp = now();
- thisArg = this;
- trailingCall = trailing && (timeoutId || !leading);
-
- if (maxWait === false) {
- var leadingCall = leading && !timeoutId;
- } else {
- if (!maxTimeoutId && !leading) {
- lastCalled = stamp;
- }
- var remaining = maxWait - (stamp - lastCalled),
- isCalled = remaining <= 0 || remaining > maxWait;
-
- if (isCalled) {
- if (maxTimeoutId) {
- maxTimeoutId = clearTimeout(maxTimeoutId);
- }
- lastCalled = stamp;
- result = func.apply(thisArg, args);
- }
- else if (!maxTimeoutId) {
- maxTimeoutId = setTimeout(maxDelayed, remaining);
- }
- }
- if (isCalled && timeoutId) {
- timeoutId = clearTimeout(timeoutId);
- }
- else if (!timeoutId && wait !== maxWait) {
- timeoutId = setTimeout(delayed, wait);
- }
- if (leadingCall) {
- isCalled = true;
- result = func.apply(thisArg, args);
- }
- if (isCalled && !timeoutId && !maxTimeoutId) {
- args = thisArg = undefined;
- }
- return result;
- }
- debounced.cancel = cancel;
- return debounced;
- }
-
- /**
- * Defers invoking the `func` until the current call stack has cleared. Any
- * additional arguments are provided to `func` when it is invoked.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to defer.
- * @param {...*} [args] The arguments to invoke the function with.
- * @returns {number} Returns the timer id.
- * @example
- *
- * _.defer(function(text) {
- * console.log(text);
- * }, 'deferred');
- * // logs 'deferred' after one or more milliseconds
- */
- var defer = restParam(function(func, args) {
- return baseDelay(func, 1, args);
- });
-
- /**
- * Invokes `func` after `wait` milliseconds. Any additional arguments are
- * provided to `func` when it is invoked.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @param {...*} [args] The arguments to invoke the function with.
- * @returns {number} Returns the timer id.
- * @example
- *
- * _.delay(function(text) {
- * console.log(text);
- * }, 1000, 'later');
- * // => logs 'later' after one second
- */
- var delay = restParam(function(func, wait, args) {
- return baseDelay(func, wait, args);
- });
-
- /**
- * Creates a function that returns the result of invoking the provided
- * functions with the `this` binding of the created function, where each
- * successive invocation is supplied the return value of the previous.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {...Function} [funcs] Functions to invoke.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var addSquare = _.flow(_.add, square);
- * addSquare(1, 2);
- * // => 9
- */
- var flow = createFlow();
-
- /**
- * This method is like `_.flow` except that it creates a function that
- * invokes the provided functions from right to left.
- *
- * @static
- * @memberOf _
- * @alias backflow, compose
- * @category Function
- * @param {...Function} [funcs] Functions to invoke.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var addSquare = _.flowRight(square, _.add);
- * addSquare(1, 2);
- * // => 9
- */
- var flowRight = createFlow(true);
-
- /**
- * Creates a function that memoizes the result of `func`. If `resolver` is
- * provided it determines the cache key for storing the result based on the
- * arguments provided to the memoized function. By default, the first argument
- * provided to the memoized function is coerced to a string and used as the
- * cache key. The `func` is invoked with the `this` binding of the memoized
- * function.
- *
- * **Note:** The cache is exposed as the `cache` property on the memoized
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
- * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
- * method interface of `get`, `has`, and `set`.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to have its output memoized.
- * @param {Function} [resolver] The function to resolve the cache key.
- * @returns {Function} Returns the new memoizing function.
- * @example
- *
- * var upperCase = _.memoize(function(string) {
- * return string.toUpperCase();
- * });
- *
- * upperCase('fred');
- * // => 'FRED'
- *
- * // modifying the result cache
- * upperCase.cache.set('fred', 'BARNEY');
- * upperCase('fred');
- * // => 'BARNEY'
- *
- * // replacing `_.memoize.Cache`
- * var object = { 'user': 'fred' };
- * var other = { 'user': 'barney' };
- * var identity = _.memoize(_.identity);
- *
- * identity(object);
- * // => { 'user': 'fred' }
- * identity(other);
- * // => { 'user': 'fred' }
- *
- * _.memoize.Cache = WeakMap;
- * var identity = _.memoize(_.identity);
- *
- * identity(object);
- * // => { 'user': 'fred' }
- * identity(other);
- * // => { 'user': 'barney' }
- */
- function memoize(func, resolver) {
- if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var memoized = function() {
- var args = arguments,
- key = resolver ? resolver.apply(this, args) : args[0],
- cache = memoized.cache;
-
- if (cache.has(key)) {
- return cache.get(key);
- }
- var result = func.apply(this, args);
- memoized.cache = cache.set(key, result);
- return result;
- };
- memoized.cache = new memoize.Cache;
- return memoized;
- }
-
- /**
- * Creates a function that runs each argument through a corresponding
- * transform function.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to wrap.
- * @param {...(Function|Function[])} [transforms] The functions to transform
- * arguments, specified as individual functions or arrays of functions.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function doubled(n) {
- * return n * 2;
- * }
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var modded = _.modArgs(function(x, y) {
- * return [x, y];
- * }, square, doubled);
- *
- * modded(1, 2);
- * // => [1, 4]
- *
- * modded(5, 10);
- * // => [25, 20]
- */
- var modArgs = restParam(function(func, transforms) {
- transforms = baseFlatten(transforms);
- if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var length = transforms.length;
- return restParam(function(args) {
- var index = nativeMin(args.length, length);
- while (index--) {
- args[index] = transforms[index](args[index]);
- }
- return func.apply(this, args);
- });
- });
-
- /**
- * Creates a function that negates the result of the predicate `func`. The
- * `func` predicate is invoked with the `this` binding and arguments of the
- * created function.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} predicate The predicate to negate.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function isEven(n) {
- * return n % 2 == 0;
- * }
- *
- * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
- * // => [1, 3, 5]
- */
- function negate(predicate) {
- if (typeof predicate != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return function() {
- return !predicate.apply(this, arguments);
- };
- }
-
- /**
- * Creates a function that is restricted to invoking `func` once. Repeat calls
- * to the function return the value of the first call. The `func` is invoked
- * with the `this` binding and arguments of the created function.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * var initialize = _.once(createApplication);
- * initialize();
- * initialize();
- * // `initialize` invokes `createApplication` once
- */
- function once(func) {
- return before(2, func);
- }
-
- /**
- * Creates a function that invokes `func` with `partial` arguments prepended
- * to those provided to the new function. This method is like `_.bind` except
- * it does **not** alter the `this` binding.
- *
- * The `_.partial.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * **Note:** This method does not set the "length" property of partially
- * applied functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to partially apply arguments to.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new partially applied function.
- * @example
- *
- * var greet = function(greeting, name) {
- * return greeting + ' ' + name;
- * };
- *
- * var sayHelloTo = _.partial(greet, 'hello');
- * sayHelloTo('fred');
- * // => 'hello fred'
- *
- * // using placeholders
- * var greetFred = _.partial(greet, _, 'fred');
- * greetFred('hi');
- * // => 'hi fred'
- */
- var partial = createPartial(PARTIAL_FLAG);
-
- /**
- * This method is like `_.partial` except that partially applied arguments
- * are appended to those provided to the new function.
- *
- * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * **Note:** This method does not set the "length" property of partially
- * applied functions.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to partially apply arguments to.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new partially applied function.
- * @example
- *
- * var greet = function(greeting, name) {
- * return greeting + ' ' + name;
- * };
- *
- * var greetFred = _.partialRight(greet, 'fred');
- * greetFred('hi');
- * // => 'hi fred'
- *
- * // using placeholders
- * var sayHelloTo = _.partialRight(greet, 'hello', _);
- * sayHelloTo('fred');
- * // => 'hello fred'
- */
- var partialRight = createPartial(PARTIAL_RIGHT_FLAG);
-
- /**
- * Creates a function that invokes `func` with arguments arranged according
- * to the specified indexes where the argument value at the first index is
- * provided as the first argument, the argument value at the second index is
- * provided as the second argument, and so on.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to rearrange arguments for.
- * @param {...(number|number[])} indexes The arranged argument indexes,
- * specified as individual indexes or arrays of indexes.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var rearged = _.rearg(function(a, b, c) {
- * return [a, b, c];
- * }, 2, 0, 1);
- *
- * rearged('b', 'c', 'a')
- * // => ['a', 'b', 'c']
- *
- * var map = _.rearg(_.map, [1, 0]);
- * map(function(n) {
- * return n * 3;
- * }, [1, 2, 3]);
- * // => [3, 6, 9]
- */
- var rearg = restParam(function(func, indexes) {
- return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
- });
-
- /**
- * Creates a function that invokes `func` with the `this` binding of the
- * created function and arguments from `start` and beyond provided as an array.
- *
- * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.restParam(function(what, names) {
- * return what + ' ' + _.initial(names).join(', ') +
- * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
- * });
- *
- * say('hello', 'fred', 'barney', 'pebbles');
- * // => 'hello fred, barney, & pebbles'
- */
- function restParam(func, start) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
- return function() {
- var args = arguments,
- index = -1,
- length = nativeMax(args.length - start, 0),
- rest = Array(length);
-
- while (++index < length) {
- rest[index] = args[start + index];
- }
- switch (start) {
- case 0: return func.call(this, rest);
- case 1: return func.call(this, args[0], rest);
- case 2: return func.call(this, args[0], args[1], rest);
- }
- var otherArgs = Array(start + 1);
- index = -1;
- while (++index < start) {
- otherArgs[index] = args[index];
- }
- otherArgs[start] = rest;
- return func.apply(this, otherArgs);
- };
- }
-
- /**
- * Creates a function that invokes `func` with the `this` binding of the created
- * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).
- *
- * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator).
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to spread arguments over.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.spread(function(who, what) {
- * return who + ' says ' + what;
- * });
- *
- * say(['fred', 'hello']);
- * // => 'fred says hello'
- *
- * // with a Promise
- * var numbers = Promise.all([
- * Promise.resolve(40),
- * Promise.resolve(36)
- * ]);
- *
- * numbers.then(_.spread(function(x, y) {
- * return x + y;
- * }));
- * // => a Promise of 76
- */
- function spread(func) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return function(array) {
- return func.apply(this, array);
- };
- }
-
- /**
- * Creates a throttled function that only invokes `func` at most once per
- * every `wait` milliseconds. The throttled function comes with a `cancel`
- * method to cancel delayed invocations. Provide an options object to indicate
- * that `func` should be invoked on the leading and/or trailing edge of the
- * `wait` timeout. Subsequent calls to the throttled function return the
- * result of the last `func` call.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
- * on the trailing edge of the timeout only if the the throttled function is
- * invoked more than once during the `wait` timeout.
- *
- * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
- * for details over the differences between `_.throttle` and `_.debounce`.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {Function} func The function to throttle.
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
- * @param {Object} [options] The options object.
- * @param {boolean} [options.leading=true] Specify invoking on the leading
- * edge of the timeout.
- * @param {boolean} [options.trailing=true] Specify invoking on the trailing
- * edge of the timeout.
- * @returns {Function} Returns the new throttled function.
- * @example
- *
- * // avoid excessively updating the position while scrolling
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
- *
- * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes
- * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
- * 'trailing': false
- * }));
- *
- * // cancel a trailing throttled call
- * jQuery(window).on('popstate', throttled.cancel);
- */
- function throttle(func, wait, options) {
- var leading = true,
- trailing = true;
-
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (options === false) {
- leading = false;
- } else if (isObject(options)) {
- leading = 'leading' in options ? !!options.leading : leading;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
- return debounce(func, wait, { 'leading': leading, 'maxWait': +wait, 'trailing': trailing });
- }
-
- /**
- * Creates a function that provides `value` to the wrapper function as its
- * first argument. Any additional arguments provided to the function are
- * appended to those provided to the wrapper function. The wrapper is invoked
- * with the `this` binding of the created function.
- *
- * @static
- * @memberOf _
- * @category Function
- * @param {*} value The value to wrap.
- * @param {Function} wrapper The wrapper function.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var p = _.wrap(_.escape, function(func, text) {
- * return '<p>' + func(text) + '</p>';
- * });
- *
- * p('fred, barney, & pebbles');
- * // => '<p>fred, barney, &amp; pebbles</p>'
- */
- function wrap(value, wrapper) {
- wrapper = wrapper == null ? identity : wrapper;
- return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned,
- * otherwise they are assigned by reference. If `customizer` is provided it is
- * invoked to produce the cloned values. If `customizer` returns `undefined`
- * cloning is handled by the method instead. The `customizer` is bound to
- * `thisArg` and invoked with two argument; (value [, index|key, object]).
- *
- * **Note:** This method is loosely based on the
- * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
- * The enumerable properties of `arguments` objects and objects created by
- * constructors other than `Object` are cloned to plain `Object` objects. An
- * empty object is returned for uncloneable values such as functions, DOM nodes,
- * Maps, Sets, and WeakMaps.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @param {Function} [customizer] The function to customize cloning values.
- * @param {*} [thisArg] The `this` binding of `customizer`.
- * @returns {*} Returns the cloned value.
- * @example
- *
- * var users = [
- * { 'user': 'barney' },
- * { 'user': 'fred' }
- * ];
- *
- * var shallow = _.clone(users);
- * shallow[0] === users[0];
- * // => true
- *
- * var deep = _.clone(users, true);
- * deep[0] === users[0];
- * // => false
- *
- * // using a customizer callback
- * var el = _.clone(document.body, function(value) {
- * if (_.isElement(value)) {
- * return value.cloneNode(false);
- * }
- * });
- *
- * el === document.body
- * // => false
- * el.nodeName
- * // => BODY
- * el.childNodes.length;
- * // => 0
- */
- function clone(value, isDeep, customizer, thisArg) {
- if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) {
- isDeep = false;
- }
- else if (typeof isDeep == 'function') {
- thisArg = customizer;
- customizer = isDeep;
- isDeep = false;
- }
- return typeof customizer == 'function'
- ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1))
- : baseClone(value, isDeep);
- }
-
- /**
- * Creates a deep clone of `value`. If `customizer` is provided it is invoked
- * to produce the cloned values. If `customizer` returns `undefined` cloning
- * is handled by the method instead. The `customizer` is bound to `thisArg`
- * and invoked with two argument; (value [, index|key, object]).
- *
- * **Note:** This method is loosely based on the
- * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
- * The enumerable properties of `arguments` objects and objects created by
- * constructors other than `Object` are cloned to plain `Object` objects. An
- * empty object is returned for uncloneable values such as functions, DOM nodes,
- * Maps, Sets, and WeakMaps.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to deep clone.
- * @param {Function} [customizer] The function to customize cloning values.
- * @param {*} [thisArg] The `this` binding of `customizer`.
- * @returns {*} Returns the deep cloned value.
- * @example
- *
- * var users = [
- * { 'user': 'barney' },
- * { 'user': 'fred' }
- * ];
- *
- * var deep = _.cloneDeep(users);
- * deep[0] === users[0];
- * // => false
- *
- * // using a customizer callback
- * var el = _.cloneDeep(document.body, function(value) {
- * if (_.isElement(value)) {
- * return value.cloneNode(true);
- * }
- * });
- *
- * el === document.body
- * // => false
- * el.nodeName
- * // => BODY
- * el.childNodes.length;
- * // => 20
- */
- function cloneDeep(value, customizer, thisArg) {
- return typeof customizer == 'function'
- ? baseClone(value, true, bindCallback(customizer, thisArg, 1))
- : baseClone(value, true);
- }
-
- /**
- * Checks if `value` is greater than `other`.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`.
- * @example
- *
- * _.gt(3, 1);
- * // => true
- *
- * _.gt(3, 3);
- * // => false
- *
- * _.gt(1, 3);
- * // => false
- */
- function gt(value, other) {
- return value > other;
- }
-
- /**
- * Checks if `value` is greater than or equal to `other`.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`.
- * @example
- *
- * _.gte(3, 1);
- * // => true
- *
- * _.gte(3, 3);
- * // => true
- *
- * _.gte(1, 3);
- * // => false
- */
- function gte(value, other) {
- return value >= other;
- }
-
- /**
- * Checks if `value` is classified as an `arguments` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isArguments(function() { return arguments; }());
- * // => true
- *
- * _.isArguments([1, 2, 3]);
- * // => false
- */
- function isArguments(value) {
- return isObjectLike(value) && isArrayLike(value) &&
- hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
- }
-
- /**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(function() { return arguments; }());
- * // => false
- */
- var isArray = nativeIsArray || function(value) {
- return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
- };
-
- /**
- * Checks if `value` is classified as a boolean primitive or object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isBoolean(false);
- * // => true
- *
- * _.isBoolean(null);
- * // => false
- */
- function isBoolean(value) {
- return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag);
- }
-
- /**
- * Checks if `value` is classified as a `Date` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isDate(new Date);
- * // => true
- *
- * _.isDate('Mon April 23 2012');
- * // => false
- */
- function isDate(value) {
- return isObjectLike(value) && objToString.call(value) == dateTag;
- }
-
- /**
- * Checks if `value` is a DOM element.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
- * @example
- *
- * _.isElement(document.body);
- * // => true
- *
- * _.isElement('<body>');
- * // => false
- */
- function isElement(value) {
- return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
- }
-
- /**
- * Checks if `value` is empty. A value is considered empty unless it is an
- * `arguments` object, array, string, or jQuery-like collection with a length
- * greater than `0` or an object with own enumerable properties.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {Array|Object|string} value The value to inspect.
- * @returns {boolean} Returns `true` if `value` is empty, else `false`.
- * @example
- *
- * _.isEmpty(null);
- * // => true
- *
- * _.isEmpty(true);
- * // => true
- *
- * _.isEmpty(1);
- * // => true
- *
- * _.isEmpty([1, 2, 3]);
- * // => false
- *
- * _.isEmpty({ 'a': 1 });
- * // => false
- */
- function isEmpty(value) {
- if (value == null) {
- return true;
- }
- if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
- (isObjectLike(value) && isFunction(value.splice)))) {
- return !value.length;
- }
- return !keys(value).length;
- }
-
- /**
- * Performs a deep comparison between two values to determine if they are
- * equivalent. If `customizer` is provided it is invoked to compare values.
- * If `customizer` returns `undefined` comparisons are handled by the method
- * instead. The `customizer` is bound to `thisArg` and invoked with three
- * arguments: (value, other [, index|key]).
- *
- * **Note:** This method supports comparing arrays, booleans, `Date` objects,
- * numbers, `Object` objects, regexes, and strings. Objects are compared by
- * their own, not inherited, enumerable properties. Functions and DOM nodes
- * are **not** supported. Provide a customizer function to extend support
- * for comparing other values.
- *
- * @static
- * @memberOf _
- * @alias eq
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {Function} [customizer] The function to customize value comparisons.
- * @param {*} [thisArg] The `this` binding of `customizer`.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'user': 'fred' };
- * var other = { 'user': 'fred' };
- *
- * object == other;
- * // => false
- *
- * _.isEqual(object, other);
- * // => true
- *
- * // using a customizer callback
- * var array = ['hello', 'goodbye'];
- * var other = ['hi', 'goodbye'];
- *
- * _.isEqual(array, other, function(value, other) {
- * if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) {
- * return true;
- * }
- * });
- * // => true
- */
- function isEqual(value, other, customizer, thisArg) {
- customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
- var result = customizer ? customizer(value, other) : undefined;
- return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
- }
-
- /**
- * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
- * `SyntaxError`, `TypeError`, or `URIError` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
- * @example
- *
- * _.isError(new Error);
- * // => true
- *
- * _.isError(Error);
- * // => false
- */
- function isError(value) {
- return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;
- }
-
- /**
- * Checks if `value` is a finite primitive number.
- *
- * **Note:** This method is based on [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite).
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
- * @example
- *
- * _.isFinite(10);
- * // => true
- *
- * _.isFinite('10');
- * // => false
- *
- * _.isFinite(true);
- * // => false
- *
- * _.isFinite(Object(10));
- * // => false
- *
- * _.isFinite(Infinity);
- * // => false
- */
- function isFinite(value) {
- return typeof value == 'number' && nativeIsFinite(value);
- }
-
- /**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
- function isFunction(value) {
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in older versions of Chrome and Safari which return 'function' for regexes
- // and Safari 8 equivalents which return 'object' for typed array constructors.
- return isObject(value) && objToString.call(value) == funcTag;
- }
-
- /**
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(1);
- * // => false
- */
- function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
- }
-
- /**
- * Performs a deep comparison between `object` and `source` to determine if
- * `object` contains equivalent property values. If `customizer` is provided
- * it is invoked to compare values. If `customizer` returns `undefined`
- * comparisons are handled by the method instead. The `customizer` is bound
- * to `thisArg` and invoked with three arguments: (value, other, index|key).
- *
- * **Note:** This method supports comparing properties of arrays, booleans,
- * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions
- * and DOM nodes are **not** supported. Provide a customizer function to extend
- * support for comparing other values.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property values to match.
- * @param {Function} [customizer] The function to customize value comparisons.
- * @param {*} [thisArg] The `this` binding of `customizer`.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- * @example
- *
- * var object = { 'user': 'fred', 'age': 40 };
- *
- * _.isMatch(object, { 'age': 40 });
- * // => true
- *
- * _.isMatch(object, { 'age': 36 });
- * // => false
- *
- * // using a customizer callback
- * var object = { 'greeting': 'hello' };
- * var source = { 'greeting': 'hi' };
- *
- * _.isMatch(object, source, function(value, other) {
- * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined;
- * });
- * // => true
- */
- function isMatch(object, source, customizer, thisArg) {
- customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
- return baseIsMatch(object, getMatchData(source), customizer);
- }
-
- /**
- * Checks if `value` is `NaN`.
- *
- * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4)
- * which returns `true` for `undefined` and other non-numeric values.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
- * @example
- *
- * _.isNaN(NaN);
- * // => true
- *
- * _.isNaN(new Number(NaN));
- * // => true
- *
- * isNaN(undefined);
- * // => true
- *
- * _.isNaN(undefined);
- * // => false
- */
- function isNaN(value) {
- // An `NaN` primitive is the only value that is not equal to itself.
- // Perform the `toStringTag` check first to avoid errors with some host objects in IE.
- return isNumber(value) && value != +value;
- }
-
- /**
- * Checks if `value` is a native function.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
- * @example
- *
- * _.isNative(Array.prototype.push);
- * // => true
- *
- * _.isNative(_);
- * // => false
- */
- function isNative(value) {
- if (value == null) {
- return false;
- }
- if (isFunction(value)) {
- return reIsNative.test(fnToString.call(value));
- }
- return isObjectLike(value) && reIsHostCtor.test(value);
- }
-
- /**
- * Checks if `value` is `null`.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
- * @example
- *
- * _.isNull(null);
- * // => true
- *
- * _.isNull(void 0);
- * // => false
- */
- function isNull(value) {
- return value === null;
- }
-
- /**
- * Checks if `value` is classified as a `Number` primitive or object.
- *
- * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
- * as numbers, use the `_.isFinite` method.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isNumber(8.4);
- * // => true
- *
- * _.isNumber(NaN);
- * // => true
- *
- * _.isNumber('8.4');
- * // => false
- */
- function isNumber(value) {
- return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
- }
-
- /**
- * Checks if `value` is a plain object, that is, an object created by the
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
- *
- * **Note:** This method assumes objects created by the `Object` constructor
- * have no inherited enumerable properties.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * _.isPlainObject(new Foo);
- * // => false
- *
- * _.isPlainObject([1, 2, 3]);
- * // => false
- *
- * _.isPlainObject({ 'x': 0, 'y': 0 });
- * // => true
- *
- * _.isPlainObject(Object.create(null));
- * // => true
- */
- function isPlainObject(value) {
- var Ctor;
-
- // Exit early for non `Object` objects.
- if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
- (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
- return false;
- }
- // IE < 9 iterates inherited properties before own properties. If the first
- // iterated property is an object's own property then there are no inherited
- // enumerable properties.
- var result;
- // In most environments an object's own properties are iterated before
- // its inherited properties. If the last iterated property is an object's
- // own property then there are no inherited enumerable properties.
- baseForIn(value, function(subValue, key) {
- result = key;
- });
- return result === undefined || hasOwnProperty.call(value, result);
- }
-
- /**
- * Checks if `value` is classified as a `RegExp` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isRegExp(/abc/);
- * // => true
- *
- * _.isRegExp('/abc/');
- * // => false
- */
- function isRegExp(value) {
- return isObject(value) && objToString.call(value) == regexpTag;
- }
-
- /**
- * Checks if `value` is classified as a `String` primitive or object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isString('abc');
- * // => true
- *
- * _.isString(1);
- * // => false
- */
- function isString(value) {
- return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
- }
-
- /**
- * Checks if `value` is classified as a typed array.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isTypedArray(new Uint8Array);
- * // => true
- *
- * _.isTypedArray([]);
- * // => false
- */
- function isTypedArray(value) {
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
- }
-
- /**
- * Checks if `value` is `undefined`.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
- * @example
- *
- * _.isUndefined(void 0);
- * // => true
- *
- * _.isUndefined(null);
- * // => false
- */
- function isUndefined(value) {
- return value === undefined;
- }
-
- /**
- * Checks if `value` is less than `other`.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`.
- * @example
- *
- * _.lt(1, 3);
- * // => true
- *
- * _.lt(3, 3);
- * // => false
- *
- * _.lt(3, 1);
- * // => false
- */
- function lt(value, other) {
- return value < other;
- }
-
- /**
- * Checks if `value` is less than or equal to `other`.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`.
- * @example
- *
- * _.lte(1, 3);
- * // => true
- *
- * _.lte(3, 3);
- * // => true
- *
- * _.lte(3, 1);
- * // => false
- */
- function lte(value, other) {
- return value <= other;
- }
-
- /**
- * Converts `value` to an array.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {Array} Returns the converted array.
- * @example
- *
- * (function() {
- * return _.toArray(arguments).slice(1);
- * }(1, 2, 3));
- * // => [2, 3]
- */
- function toArray(value) {
- var length = value ? getLength(value) : 0;
- if (!isLength(length)) {
- return values(value);
- }
- if (!length) {
- return [];
- }
- return arrayCopy(value);
- }
-
- /**
- * Converts `value` to a plain object flattening inherited enumerable
- * properties of `value` to own properties of the plain object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {Object} Returns the converted plain object.
- * @example
- *
- * function Foo() {
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.assign({ 'a': 1 }, new Foo);
- * // => { 'a': 1, 'b': 2 }
- *
- * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
- * // => { 'a': 1, 'b': 2, 'c': 3 }
- */
- function toPlainObject(value) {
- return baseCopy(value, keysIn(value));
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Recursively merges own enumerable properties of the source object(s), that
- * don't resolve to `undefined` into the destination object. Subsequent sources
- * overwrite property assignments of previous sources. If `customizer` is
- * provided it is invoked to produce the merged values of the destination and
- * source properties. If `customizer` returns `undefined` merging is handled
- * by the method instead. The `customizer` is bound to `thisArg` and invoked
- * with five arguments: (objectValue, sourceValue, key, object, source).
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @param {Function} [customizer] The function to customize assigned values.
- * @param {*} [thisArg] The `this` binding of `customizer`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var users = {
- * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
- * };
- *
- * var ages = {
- * 'data': [{ 'age': 36 }, { 'age': 40 }]
- * };
- *
- * _.merge(users, ages);
- * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
- *
- * // using a customizer callback
- * var object = {
- * 'fruits': ['apple'],
- * 'vegetables': ['beet']
- * };
- *
- * var other = {
- * 'fruits': ['banana'],
- * 'vegetables': ['carrot']
- * };
- *
- * _.merge(object, other, function(a, b) {
- * if (_.isArray(a)) {
- * return a.concat(b);
- * }
- * });
- * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
- */
- var merge = createAssigner(baseMerge);
-
- /**
- * Assigns own enumerable properties of source object(s) to the destination
- * object. Subsequent sources overwrite property assignments of previous sources.
- * If `customizer` is provided it is invoked to produce the assigned values.
- * The `customizer` is bound to `thisArg` and invoked with five arguments:
- * (objectValue, sourceValue, key, object, source).
- *
- * **Note:** This method mutates `object` and is based on
- * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
- *
- * @static
- * @memberOf _
- * @alias extend
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @param {Function} [customizer] The function to customize assigned values.
- * @param {*} [thisArg] The `this` binding of `customizer`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
- * // => { 'user': 'fred', 'age': 40 }
- *
- * // using a customizer callback
- * var defaults = _.partialRight(_.assign, function(value, other) {
- * return _.isUndefined(value) ? other : value;
- * });
- *
- * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
- * // => { 'user': 'barney', 'age': 36 }
- */
- var assign = createAssigner(function(object, source, customizer) {
- return customizer
- ? assignWith(object, source, customizer)
- : baseAssign(object, source);
- });
-
- /**
- * Creates an object that inherits from the given `prototype` object. If a
- * `properties` object is provided its own enumerable properties are assigned
- * to the created object.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} prototype The object to inherit from.
- * @param {Object} [properties] The properties to assign to the object.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Object} Returns the new object.
- * @example
- *
- * function Shape() {
- * this.x = 0;
- * this.y = 0;
- * }
- *
- * function Circle() {
- * Shape.call(this);
- * }
- *
- * Circle.prototype = _.create(Shape.prototype, {
- * 'constructor': Circle
- * });
- *
- * var circle = new Circle;
- * circle instanceof Circle;
- * // => true
- *
- * circle instanceof Shape;
- * // => true
- */
- function create(prototype, properties, guard) {
- var result = baseCreate(prototype);
- if (guard && isIterateeCall(prototype, properties, guard)) {
- properties = undefined;
- }
- return properties ? baseAssign(result, properties) : result;
- }
-
- /**
- * Assigns own enumerable properties of source object(s) to the destination
- * object for all destination properties that resolve to `undefined`. Once a
- * property is set, additional values of the same property are ignored.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @example
- *
- * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
- * // => { 'user': 'barney', 'age': 36 }
- */
- var defaults = createDefaults(assign, assignDefaults);
-
- /**
- * This method is like `_.defaults` except that it recursively assigns
- * default properties.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @example
- *
- * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
- * // => { 'user': { 'name': 'barney', 'age': 36 } }
- *
- */
- var defaultsDeep = createDefaults(merge, mergeDefaults);
-
- /**
- * This method is like `_.find` except that it returns the key of the first
- * element `predicate` returns truthy for instead of the element itself.
- *
- * If a property name is provided for `predicate` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `predicate` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to search.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
- * @example
- *
- * var users = {
- * 'barney': { 'age': 36, 'active': true },
- * 'fred': { 'age': 40, 'active': false },
- * 'pebbles': { 'age': 1, 'active': true }
- * };
- *
- * _.findKey(users, function(chr) {
- * return chr.age < 40;
- * });
- * // => 'barney' (iteration order is not guaranteed)
- *
- * // using the `_.matches` callback shorthand
- * _.findKey(users, { 'age': 1, 'active': true });
- * // => 'pebbles'
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.findKey(users, 'active', false);
- * // => 'fred'
- *
- * // using the `_.property` callback shorthand
- * _.findKey(users, 'active');
- * // => 'barney'
- */
- var findKey = createFindKey(baseForOwn);
-
- /**
- * This method is like `_.findKey` except that it iterates over elements of
- * a collection in the opposite order.
- *
- * If a property name is provided for `predicate` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `predicate` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to search.
- * @param {Function|Object|string} [predicate=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
- * @example
- *
- * var users = {
- * 'barney': { 'age': 36, 'active': true },
- * 'fred': { 'age': 40, 'active': false },
- * 'pebbles': { 'age': 1, 'active': true }
- * };
- *
- * _.findLastKey(users, function(chr) {
- * return chr.age < 40;
- * });
- * // => returns `pebbles` assuming `_.findKey` returns `barney`
- *
- * // using the `_.matches` callback shorthand
- * _.findLastKey(users, { 'age': 36, 'active': true });
- * // => 'barney'
- *
- * // using the `_.matchesProperty` callback shorthand
- * _.findLastKey(users, 'active', false);
- * // => 'fred'
- *
- * // using the `_.property` callback shorthand
- * _.findLastKey(users, 'active');
- * // => 'pebbles'
- */
- var findLastKey = createFindKey(baseForOwnRight);
-
- /**
- * Iterates over own and inherited enumerable properties of an object invoking
- * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked
- * with three arguments: (value, key, object). Iteratee functions may exit
- * iteration early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forIn(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed)
- */
- var forIn = createForIn(baseFor);
-
- /**
- * This method is like `_.forIn` except that it iterates over properties of
- * `object` in the opposite order.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forInRight(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
- */
- var forInRight = createForIn(baseForRight);
-
- /**
- * Iterates over own enumerable properties of an object invoking `iteratee`
- * for each property. The `iteratee` is bound to `thisArg` and invoked with
- * three arguments: (value, key, object). Iteratee functions may exit iteration
- * early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forOwn(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => logs 'a' and 'b' (iteration order is not guaranteed)
- */
- var forOwn = createForOwn(baseForOwn);
-
- /**
- * This method is like `_.forOwn` except that it iterates over properties of
- * `object` in the opposite order.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forOwnRight(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
- */
- var forOwnRight = createForOwn(baseForOwnRight);
-
- /**
- * Creates an array of function property names from all enumerable properties,
- * own and inherited, of `object`.
- *
- * @static
- * @memberOf _
- * @alias methods
- * @category Object
- * @param {Object} object The object to inspect.
- * @returns {Array} Returns the new array of property names.
- * @example
- *
- * _.functions(_);
- * // => ['after', 'ary', 'assign', ...]
- */
- function functions(object) {
- return baseFunctions(object, keysIn(object));
- }
-
- /**
- * Gets the property value at `path` of `object`. If the resolved value is
- * `undefined` the `defaultValue` is used in its place.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to get.
- * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.get(object, 'a[0].b.c');
- * // => 3
- *
- * _.get(object, ['a', '0', 'b', 'c']);
- * // => 3
- *
- * _.get(object, 'a.b.c', 'default');
- * // => 'default'
- */
- function get(object, path, defaultValue) {
- var result = object == null ? undefined : baseGet(object, toPath(path), path + '');
- return result === undefined ? defaultValue : result;
- }
-
- /**
- * Checks if `path` is a direct property.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path to check.
- * @returns {boolean} Returns `true` if `path` is a direct property, else `false`.
- * @example
- *
- * var object = { 'a': { 'b': { 'c': 3 } } };
- *
- * _.has(object, 'a');
- * // => true
- *
- * _.has(object, 'a.b.c');
- * // => true
- *
- * _.has(object, ['a', 'b', 'c']);
- * // => true
- */
- function has(object, path) {
- if (object == null) {
- return false;
- }
- var result = hasOwnProperty.call(object, path);
- if (!result && !isKey(path)) {
- path = toPath(path);
- object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
- if (object == null) {
- return false;
- }
- path = last(path);
- result = hasOwnProperty.call(object, path);
- }
- return result || (isLength(object.length) && isIndex(path, object.length) &&
- (isArray(object) || isArguments(object)));
- }
-
- /**
- * Creates an object composed of the inverted keys and values of `object`.
- * If `object` contains duplicate values, subsequent values overwrite property
- * assignments of previous values unless `multiValue` is `true`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to invert.
- * @param {boolean} [multiValue] Allow multiple values per key.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Object} Returns the new inverted object.
- * @example
- *
- * var object = { 'a': 1, 'b': 2, 'c': 1 };
- *
- * _.invert(object);
- * // => { '1': 'c', '2': 'b' }
- *
- * // with `multiValue`
- * _.invert(object, true);
- * // => { '1': ['a', 'c'], '2': ['b'] }
- */
- function invert(object, multiValue, guard) {
- if (guard && isIterateeCall(object, multiValue, guard)) {
- multiValue = undefined;
- }
- var index = -1,
- props = keys(object),
- length = props.length,
- result = {};
-
- while (++index < length) {
- var key = props[index],
- value = object[key];
-
- if (multiValue) {
- if (hasOwnProperty.call(result, value)) {
- result[value].push(key);
- } else {
- result[value] = [key];
- }
- }
- else {
- result[value] = key;
- }
- }
- return result;
- }
-
- /**
- * Creates an array of the own enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects. See the
- * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
- * for more details.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keys(new Foo);
- * // => ['a', 'b'] (iteration order is not guaranteed)
- *
- * _.keys('hi');
- * // => ['0', '1']
- */
- var keys = !nativeKeys ? shimKeys : function(object) {
- var Ctor = object == null ? undefined : object.constructor;
- if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
- (typeof object != 'function' && isArrayLike(object))) {
- return shimKeys(object);
- }
- return isObject(object) ? nativeKeys(object) : [];
- };
-
- /**
- * Creates an array of the own and inherited enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keysIn(new Foo);
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
- */
- function keysIn(object) {
- if (object == null) {
- return [];
- }
- if (!isObject(object)) {
- object = Object(object);
- }
- var length = object.length;
- length = (length && isLength(length) &&
- (isArray(object) || isArguments(object)) && length) || 0;
-
- var Ctor = object.constructor,
- index = -1,
- isProto = typeof Ctor == 'function' && Ctor.prototype === object,
- result = Array(length),
- skipIndexes = length > 0;
-
- while (++index < length) {
- result[index] = (index + '');
- }
- for (var key in object) {
- if (!(skipIndexes && isIndex(key, length)) &&
- !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * The opposite of `_.mapValues`; this method creates an object with the
- * same values as `object` and keys generated by running each own enumerable
- * property of `object` through `iteratee`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns the new mapped object.
- * @example
- *
- * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
- * return key + value;
- * });
- * // => { 'a1': 1, 'b2': 2 }
- */
- var mapKeys = createObjectMapper(true);
-
- /**
- * Creates an object with the same keys as `object` and values generated by
- * running each own enumerable property of `object` through `iteratee`. The
- * iteratee function is bound to `thisArg` and invoked with three arguments:
- * (value, key, object).
- *
- * If a property name is provided for `iteratee` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `iteratee` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function|Object|string} [iteratee=_.identity] The function invoked
- * per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Object} Returns the new mapped object.
- * @example
- *
- * _.mapValues({ 'a': 1, 'b': 2 }, function(n) {
- * return n * 3;
- * });
- * // => { 'a': 3, 'b': 6 }
- *
- * var users = {
- * 'fred': { 'user': 'fred', 'age': 40 },
- * 'pebbles': { 'user': 'pebbles', 'age': 1 }
- * };
- *
- * // using the `_.property` callback shorthand
- * _.mapValues(users, 'age');
- * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
- */
- var mapValues = createObjectMapper();
-
- /**
- * The opposite of `_.pick`; this method creates an object composed of the
- * own and inherited enumerable properties of `object` that are not omitted.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The source object.
- * @param {Function|...(string|string[])} [predicate] The function invoked per
- * iteration or property names to omit, specified as individual property
- * names or arrays of property names.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'user': 'fred', 'age': 40 };
- *
- * _.omit(object, 'age');
- * // => { 'user': 'fred' }
- *
- * _.omit(object, _.isNumber);
- * // => { 'user': 'fred' }
- */
- var omit = restParam(function(object, props) {
- if (object == null) {
- return {};
- }
- if (typeof props[0] != 'function') {
- var props = arrayMap(baseFlatten(props), String);
- return pickByArray(object, baseDifference(keysIn(object), props));
- }
- var predicate = bindCallback(props[0], props[1], 3);
- return pickByCallback(object, function(value, key, object) {
- return !predicate(value, key, object);
- });
- });
-
- /**
- * Creates a two dimensional array of the key-value pairs for `object`,
- * e.g. `[[key1, value1], [key2, value2]]`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the new array of key-value pairs.
- * @example
- *
- * _.pairs({ 'barney': 36, 'fred': 40 });
- * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
- */
- function pairs(object) {
- object = toObject(object);
-
- var index = -1,
- props = keys(object),
- length = props.length,
- result = Array(length);
-
- while (++index < length) {
- var key = props[index];
- result[index] = [key, object[key]];
- }
- return result;
- }
-
- /**
- * Creates an object composed of the picked `object` properties. Property
- * names may be specified as individual arguments or as arrays of property
- * names. If `predicate` is provided it is invoked for each property of `object`
- * picking the properties `predicate` returns truthy for. The predicate is
- * bound to `thisArg` and invoked with three arguments: (value, key, object).
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The source object.
- * @param {Function|...(string|string[])} [predicate] The function invoked per
- * iteration or property names to pick, specified as individual property
- * names or arrays of property names.
- * @param {*} [thisArg] The `this` binding of `predicate`.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'user': 'fred', 'age': 40 };
- *
- * _.pick(object, 'user');
- * // => { 'user': 'fred' }
- *
- * _.pick(object, _.isString);
- * // => { 'user': 'fred' }
- */
- var pick = restParam(function(object, props) {
- if (object == null) {
- return {};
- }
- return typeof props[0] == 'function'
- ? pickByCallback(object, bindCallback(props[0], props[1], 3))
- : pickByArray(object, baseFlatten(props));
- });
-
- /**
- * This method is like `_.get` except that if the resolved value is a function
- * it is invoked with the `this` binding of its parent object and its result
- * is returned.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to resolve.
- * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
- *
- * _.result(object, 'a[0].b.c1');
- * // => 3
- *
- * _.result(object, 'a[0].b.c2');
- * // => 4
- *
- * _.result(object, 'a.b.c', 'default');
- * // => 'default'
- *
- * _.result(object, 'a.b.c', _.constant('default'));
- * // => 'default'
- */
- function result(object, path, defaultValue) {
- var result = object == null ? undefined : object[path];
- if (result === undefined) {
- if (object != null && !isKey(path, object)) {
- path = toPath(path);
- object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
- result = object == null ? undefined : object[last(path)];
- }
- result = result === undefined ? defaultValue : result;
- }
- return isFunction(result) ? result.call(object) : result;
- }
-
- /**
- * Sets the property value of `path` on `object`. If a portion of `path`
- * does not exist it is created.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to augment.
- * @param {Array|string} path The path of the property to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.set(object, 'a[0].b.c', 4);
- * console.log(object.a[0].b.c);
- * // => 4
- *
- * _.set(object, 'x[0].y.z', 5);
- * console.log(object.x[0].y.z);
- * // => 5
- */
- function set(object, path, value) {
- if (object == null) {
- return object;
- }
- var pathKey = (path + '');
- path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path);
-
- var index = -1,
- length = path.length,
- lastIndex = length - 1,
- nested = object;
-
- while (nested != null && ++index < length) {
- var key = path[index];
- if (isObject(nested)) {
- if (index == lastIndex) {
- nested[key] = value;
- } else if (nested[key] == null) {
- nested[key] = isIndex(path[index + 1]) ? [] : {};
- }
- }
- nested = nested[key];
- }
- return object;
- }
-
- /**
- * An alternative to `_.reduce`; this method transforms `object` to a new
- * `accumulator` object which is the result of running each of its own enumerable
- * properties through `iteratee`, with each invocation potentially mutating
- * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked
- * with four arguments: (accumulator, value, key, object). Iteratee functions
- * may exit iteration early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Array|Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The custom accumulator value.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {*} Returns the accumulated value.
- * @example
- *
- * _.transform([2, 3, 4], function(result, n) {
- * result.push(n *= n);
- * return n % 2 == 0;
- * });
- * // => [4, 9]
- *
- * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) {
- * result[key] = n * 3;
- * });
- * // => { 'a': 3, 'b': 6 }
- */
- function transform(object, iteratee, accumulator, thisArg) {
- var isArr = isArray(object) || isTypedArray(object);
- iteratee = getCallback(iteratee, thisArg, 4);
-
- if (accumulator == null) {
- if (isArr || isObject(object)) {
- var Ctor = object.constructor;
- if (isArr) {
- accumulator = isArray(object) ? new Ctor : [];
- } else {
- accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
- }
- } else {
- accumulator = {};
- }
- }
- (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
- return iteratee(accumulator, value, index, object);
- });
- return accumulator;
- }
-
- /**
- * Creates an array of the own enumerable property values of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property values.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.values(new Foo);
- * // => [1, 2] (iteration order is not guaranteed)
- *
- * _.values('hi');
- * // => ['h', 'i']
- */
- function values(object) {
- return baseValues(object, keys(object));
- }
-
- /**
- * Creates an array of the own and inherited enumerable property values
- * of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property values.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.valuesIn(new Foo);
- * // => [1, 2, 3] (iteration order is not guaranteed)
- */
- function valuesIn(object) {
- return baseValues(object, keysIn(object));
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Checks if `n` is between `start` and up to but not including, `end`. If
- * `end` is not specified it is set to `start` with `start` then set to `0`.
- *
- * @static
- * @memberOf _
- * @category Number
- * @param {number} n The number to check.
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @returns {boolean} Returns `true` if `n` is in the range, else `false`.
- * @example
- *
- * _.inRange(3, 2, 4);
- * // => true
- *
- * _.inRange(4, 8);
- * // => true
- *
- * _.inRange(4, 2);
- * // => false
- *
- * _.inRange(2, 2);
- * // => false
- *
- * _.inRange(1.2, 2);
- * // => true
- *
- * _.inRange(5.2, 4);
- * // => false
- */
- function inRange(value, start, end) {
- start = +start || 0;
- if (end === undefined) {
- end = start;
- start = 0;
- } else {
- end = +end || 0;
- }
- return value >= nativeMin(start, end) && value < nativeMax(start, end);
- }
-
- /**
- * Produces a random number between `min` and `max` (inclusive). If only one
- * argument is provided a number between `0` and the given number is returned.
- * If `floating` is `true`, or either `min` or `max` are floats, a floating-point
- * number is returned instead of an integer.
- *
- * @static
- * @memberOf _
- * @category Number
- * @param {number} [min=0] The minimum possible value.
- * @param {number} [max=1] The maximum possible value.
- * @param {boolean} [floating] Specify returning a floating-point number.
- * @returns {number} Returns the random number.
- * @example
- *
- * _.random(0, 5);
- * // => an integer between 0 and 5
- *
- * _.random(5);
- * // => also an integer between 0 and 5
- *
- * _.random(5, true);
- * // => a floating-point number between 0 and 5
- *
- * _.random(1.2, 5.2);
- * // => a floating-point number between 1.2 and 5.2
- */
- function random(min, max, floating) {
- if (floating && isIterateeCall(min, max, floating)) {
- max = floating = undefined;
- }
- var noMin = min == null,
- noMax = max == null;
-
- if (floating == null) {
- if (noMax && typeof min == 'boolean') {
- floating = min;
- min = 1;
- }
- else if (typeof max == 'boolean') {
- floating = max;
- noMax = true;
- }
- }
- if (noMin && noMax) {
- max = 1;
- noMax = false;
- }
- min = +min || 0;
- if (noMax) {
- max = min;
- min = 0;
- } else {
- max = +max || 0;
- }
- if (floating || min % 1 || max % 1) {
- var rand = nativeRandom();
- return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max);
- }
- return baseRandom(min, max);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the camel cased string.
- * @example
- *
- * _.camelCase('Foo Bar');
- * // => 'fooBar'
- *
- * _.camelCase('--foo-bar');
- * // => 'fooBar'
- *
- * _.camelCase('__foo_bar__');
- * // => 'fooBar'
- */
- var camelCase = createCompounder(function(result, word, index) {
- word = word.toLowerCase();
- return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word);
- });
-
- /**
- * Capitalizes the first character of `string`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to capitalize.
- * @returns {string} Returns the capitalized string.
- * @example
- *
- * _.capitalize('fred');
- * // => 'Fred'
- */
- function capitalize(string) {
- string = baseToString(string);
- return string && (string.charAt(0).toUpperCase() + string.slice(1));
- }
-
- /**
- * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
- * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to deburr.
- * @returns {string} Returns the deburred string.
- * @example
- *
- * _.deburr('déjà vu');
- * // => 'deja vu'
- */
- function deburr(string) {
- string = baseToString(string);
- return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
- }
-
- /**
- * Checks if `string` ends with the given target string.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to search.
- * @param {string} [target] The string to search for.
- * @param {number} [position=string.length] The position to search from.
- * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`.
- * @example
- *
- * _.endsWith('abc', 'c');
- * // => true
- *
- * _.endsWith('abc', 'b');
- * // => false
- *
- * _.endsWith('abc', 'b', 2);
- * // => true
- */
- function endsWith(string, target, position) {
- string = baseToString(string);
- target = (target + '');
-
- var length = string.length;
- position = position === undefined
- ? length
- : nativeMin(position < 0 ? 0 : (+position || 0), length);
-
- position -= target.length;
- return position >= 0 && string.indexOf(target, position) == position;
- }
-
- /**
- * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to
- * their corresponding HTML entities.
- *
- * **Note:** No other characters are escaped. To escape additional characters
- * use a third-party library like [_he_](https://mths.be/he).
- *
- * Though the ">" character is escaped for symmetry, characters like
- * ">" and "/" don't need escaping in HTML and have no special meaning
- * unless they're part of a tag or unquoted attribute value.
- * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
- * (under "semi-related fun fact") for more details.
- *
- * Backticks are escaped because in Internet Explorer < 9, they can break out
- * of attribute values or HTML comments. See [#59](https://html5sec.org/#59),
- * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
- * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)
- * for more details.
- *
- * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)
- * to reduce XSS vectors.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to escape.
- * @returns {string} Returns the escaped string.
- * @example
- *
- * _.escape('fred, barney, & pebbles');
- * // => 'fred, barney, &amp; pebbles'
- */
- function escape(string) {
- // Reset `lastIndex` because in IE < 9 `String#replace` does not.
- string = baseToString(string);
- return (string && reHasUnescapedHtml.test(string))
- ? string.replace(reUnescapedHtml, escapeHtmlChar)
- : string;
- }
-
- /**
- * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
- * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to escape.
- * @returns {string} Returns the escaped string.
- * @example
- *
- * _.escapeRegExp('[lodash](https://lodash.com/)');
- * // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
- */
- function escapeRegExp(string) {
- string = baseToString(string);
- return (string && reHasRegExpChars.test(string))
- ? string.replace(reRegExpChars, escapeRegExpChar)
- : (string || '(?:)');
- }
-
- /**
- * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the kebab cased string.
- * @example
- *
- * _.kebabCase('Foo Bar');
- * // => 'foo-bar'
- *
- * _.kebabCase('fooBar');
- * // => 'foo-bar'
- *
- * _.kebabCase('__foo_bar__');
- * // => 'foo-bar'
- */
- var kebabCase = createCompounder(function(result, word, index) {
- return result + (index ? '-' : '') + word.toLowerCase();
- });
-
- /**
- * Pads `string` on the left and right sides if it's shorter than `length`.
- * Padding characters are truncated if they can't be evenly divided by `length`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.pad('abc', 8);
- * // => ' abc '
- *
- * _.pad('abc', 8, '_-');
- * // => '_-abc_-_'
- *
- * _.pad('abc', 3);
- * // => 'abc'
- */
- function pad(string, length, chars) {
- string = baseToString(string);
- length = +length;
-
- var strLength = string.length;
- if (strLength >= length || !nativeIsFinite(length)) {
- return string;
- }
- var mid = (length - strLength) / 2,
- leftLength = nativeFloor(mid),
- rightLength = nativeCeil(mid);
-
- chars = createPadding('', rightLength, chars);
- return chars.slice(0, leftLength) + string + chars;
- }
-
- /**
- * Pads `string` on the left side if it's shorter than `length`. Padding
- * characters are truncated if they exceed `length`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.padLeft('abc', 6);
- * // => ' abc'
- *
- * _.padLeft('abc', 6, '_-');
- * // => '_-_abc'
- *
- * _.padLeft('abc', 3);
- * // => 'abc'
- */
- var padLeft = createPadDir();
-
- /**
- * Pads `string` on the right side if it's shorter than `length`. Padding
- * characters are truncated if they exceed `length`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.padRight('abc', 6);
- * // => 'abc '
- *
- * _.padRight('abc', 6, '_-');
- * // => 'abc_-_'
- *
- * _.padRight('abc', 3);
- * // => 'abc'
- */
- var padRight = createPadDir(true);
-
- /**
- * Converts `string` to an integer of the specified radix. If `radix` is
- * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal,
- * in which case a `radix` of `16` is used.
- *
- * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E)
- * of `parseInt`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} string The string to convert.
- * @param {number} [radix] The radix to interpret `value` by.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.parseInt('08');
- * // => 8
- *
- * _.map(['6', '08', '10'], _.parseInt);
- * // => [6, 8, 10]
- */
- function parseInt(string, radix, guard) {
- // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.
- // Chrome fails to trim leading <BOM> whitespace characters.
- // See https://code.google.com/p/v8/issues/detail?id=3109 for more details.
- if (guard ? isIterateeCall(string, radix, guard) : radix == null) {
- radix = 0;
- } else if (radix) {
- radix = +radix;
- }
- string = trim(string);
- return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
- }
-
- /**
- * Repeats the given string `n` times.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to repeat.
- * @param {number} [n=0] The number of times to repeat the string.
- * @returns {string} Returns the repeated string.
- * @example
- *
- * _.repeat('*', 3);
- * // => '***'
- *
- * _.repeat('abc', 2);
- * // => 'abcabc'
- *
- * _.repeat('abc', 0);
- * // => ''
- */
- function repeat(string, n) {
- var result = '';
- string = baseToString(string);
- n = +n;
- if (n < 1 || !string || !nativeIsFinite(n)) {
- return result;
- }
- // Leverage the exponentiation by squaring algorithm for a faster repeat.
- // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
- do {
- if (n % 2) {
- result += string;
- }
- n = nativeFloor(n / 2);
- string += string;
- } while (n);
-
- return result;
- }
-
- /**
- * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case).
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the snake cased string.
- * @example
- *
- * _.snakeCase('Foo Bar');
- * // => 'foo_bar'
- *
- * _.snakeCase('fooBar');
- * // => 'foo_bar'
- *
- * _.snakeCase('--foo-bar');
- * // => 'foo_bar'
- */
- var snakeCase = createCompounder(function(result, word, index) {
- return result + (index ? '_' : '') + word.toLowerCase();
- });
-
- /**
- * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the start cased string.
- * @example
- *
- * _.startCase('--foo-bar');
- * // => 'Foo Bar'
- *
- * _.startCase('fooBar');
- * // => 'Foo Bar'
- *
- * _.startCase('__foo_bar__');
- * // => 'Foo Bar'
- */
- var startCase = createCompounder(function(result, word, index) {
- return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));
- });
-
- /**
- * Checks if `string` starts with the given target string.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to search.
- * @param {string} [target] The string to search for.
- * @param {number} [position=0] The position to search from.
- * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`.
- * @example
- *
- * _.startsWith('abc', 'a');
- * // => true
- *
- * _.startsWith('abc', 'b');
- * // => false
- *
- * _.startsWith('abc', 'b', 1);
- * // => true
- */
- function startsWith(string, target, position) {
- string = baseToString(string);
- position = position == null
- ? 0
- : nativeMin(position < 0 ? 0 : (+position || 0), string.length);
-
- return string.lastIndexOf(target, position) == position;
- }
-
- /**
- * Creates a compiled template function that can interpolate data properties
- * in "interpolate" delimiters, HTML-escape interpolated data properties in
- * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
- * properties may be accessed as free variables in the template. If a setting
- * object is provided it takes precedence over `_.templateSettings` values.
- *
- * **Note:** In the development build `_.template` utilizes
- * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
- * for easier debugging.
- *
- * For more information on precompiling templates see
- * [lodash's custom builds documentation](https://lodash.com/custom-builds).
- *
- * For more information on Chrome extension sandboxes see
- * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The template string.
- * @param {Object} [options] The options object.
- * @param {RegExp} [options.escape] The HTML "escape" delimiter.
- * @param {RegExp} [options.evaluate] The "evaluate" delimiter.
- * @param {Object} [options.imports] An object to import into the template as free variables.
- * @param {RegExp} [options.interpolate] The "interpolate" delimiter.
- * @param {string} [options.sourceURL] The sourceURL of the template's compiled source.
- * @param {string} [options.variable] The data object variable name.
- * @param- {Object} [otherOptions] Enables the legacy `options` param signature.
- * @returns {Function} Returns the compiled template function.
- * @example
- *
- * // using the "interpolate" delimiter to create a compiled template
- * var compiled = _.template('hello <%= user %>!');
- * compiled({ 'user': 'fred' });
- * // => 'hello fred!'
- *
- * // using the HTML "escape" delimiter to escape data property values
- * var compiled = _.template('<b><%- value %></b>');
- * compiled({ 'value': '<script>' });
- * // => '<b>&lt;script&gt;</b>'
- *
- * // using the "evaluate" delimiter to execute JavaScript and generate HTML
- * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
- * compiled({ 'users': ['fred', 'barney'] });
- * // => '<li>fred</li><li>barney</li>'
- *
- * // using the internal `print` function in "evaluate" delimiters
- * var compiled = _.template('<% print("hello " + user); %>!');
- * compiled({ 'user': 'barney' });
- * // => 'hello barney!'
- *
- * // using the ES delimiter as an alternative to the default "interpolate" delimiter
- * var compiled = _.template('hello ${ user }!');
- * compiled({ 'user': 'pebbles' });
- * // => 'hello pebbles!'
- *
- * // using custom template delimiters
- * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
- * var compiled = _.template('hello {{ user }}!');
- * compiled({ 'user': 'mustache' });
- * // => 'hello mustache!'
- *
- * // using backslashes to treat delimiters as plain text
- * var compiled = _.template('<%= "\\<%- value %\\>" %>');
- * compiled({ 'value': 'ignored' });
- * // => '<%- value %>'
- *
- * // using the `imports` option to import `jQuery` as `jq`
- * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
- * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
- * compiled({ 'users': ['fred', 'barney'] });
- * // => '<li>fred</li><li>barney</li>'
- *
- * // using the `sourceURL` option to specify a custom sourceURL for the template
- * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
- * compiled(data);
- * // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector
- *
- * // using the `variable` option to ensure a with-statement isn't used in the compiled template
- * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
- * compiled.source;
- * // => function(data) {
- * // var __t, __p = '';
- * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
- * // return __p;
- * // }
- *
- * // using the `source` property to inline compiled templates for meaningful
- * // line numbers in error messages and a stack trace
- * fs.writeFileSync(path.join(cwd, 'jst.js'), '\
- * var JST = {\
- * "main": ' + _.template(mainText).source + '\
- * };\
- * ');
- */
- function template(string, options, otherOptions) {
- // Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/)
- // and Laura Doktorova's doT.js (https://github.com/olado/doT).
- var settings = lodash.templateSettings;
-
- if (otherOptions && isIterateeCall(string, options, otherOptions)) {
- options = otherOptions = undefined;
- }
- string = baseToString(string);
- options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);
-
- var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults),
- importsKeys = keys(imports),
- importsValues = baseValues(imports, importsKeys);
-
- var isEscaping,
- isEvaluating,
- index = 0,
- interpolate = options.interpolate || reNoMatch,
- source = "__p += '";
-
- // Compile the regexp to match each delimiter.
- var reDelimiters = RegExp(
- (options.escape || reNoMatch).source + '|' +
- interpolate.source + '|' +
- (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
- (options.evaluate || reNoMatch).source + '|$'
- , 'g');
-
- // Use a sourceURL for easier debugging.
- var sourceURL = '//# sourceURL=' +
- ('sourceURL' in options
- ? options.sourceURL
- : ('lodash.templateSources[' + (++templateCounter) + ']')
- ) + '\n';
-
- string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
- interpolateValue || (interpolateValue = esTemplateValue);
-
- // Escape characters that can't be included in string literals.
- source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
-
- // Replace delimiters with snippets.
- if (escapeValue) {
- isEscaping = true;
- source += "' +\n__e(" + escapeValue + ") +\n'";
- }
- if (evaluateValue) {
- isEvaluating = true;
- source += "';\n" + evaluateValue + ";\n__p += '";
- }
- if (interpolateValue) {
- source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
- }
- index = offset + match.length;
-
- // The JS engine embedded in Adobe products requires returning the `match`
- // string in order to produce the correct `offset` value.
- return match;
- });
-
- source += "';\n";
-
- // If `variable` is not specified wrap a with-statement around the generated
- // code to add the data object to the top of the scope chain.
- var variable = options.variable;
- if (!variable) {
- source = 'with (obj) {\n' + source + '\n}\n';
- }
- // Cleanup code by stripping empty strings.
- source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
- .replace(reEmptyStringMiddle, '$1')
- .replace(reEmptyStringTrailing, '$1;');
-
- // Frame code as the function body.
- source = 'function(' + (variable || 'obj') + ') {\n' +
- (variable
- ? ''
- : 'obj || (obj = {});\n'
- ) +
- "var __t, __p = ''" +
- (isEscaping
- ? ', __e = _.escape'
- : ''
- ) +
- (isEvaluating
- ? ', __j = Array.prototype.join;\n' +
- "function print() { __p += __j.call(arguments, '') }\n"
- : ';\n'
- ) +
- source +
- 'return __p\n}';
-
- var result = attempt(function() {
- return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
- });
-
- // Provide the compiled function's source by its `toString` method or
- // the `source` property as a convenience for inlining compiled templates.
- result.source = source;
- if (isError(result)) {
- throw result;
- }
- return result;
- }
-
- /**
- * Removes leading and trailing whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trim(' abc ');
- * // => 'abc'
- *
- * _.trim('-_-abc-_-', '_-');
- * // => 'abc'
- *
- * _.map([' foo ', ' bar '], _.trim);
- * // => ['foo', 'bar']
- */
- function trim(string, chars, guard) {
- var value = string;
- string = baseToString(string);
- if (!string) {
- return string;
- }
- if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
- return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1);
- }
- chars = (chars + '');
- return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1);
- }
-
- /**
- * Removes leading whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trimLeft(' abc ');
- * // => 'abc '
- *
- * _.trimLeft('-_-abc-_-', '_-');
- * // => 'abc-_-'
- */
- function trimLeft(string, chars, guard) {
- var value = string;
- string = baseToString(string);
- if (!string) {
- return string;
- }
- if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
- return string.slice(trimmedLeftIndex(string));
- }
- return string.slice(charsLeftIndex(string, (chars + '')));
- }
-
- /**
- * Removes trailing whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trimRight(' abc ');
- * // => ' abc'
- *
- * _.trimRight('-_-abc-_-', '_-');
- * // => '-_-abc'
- */
- function trimRight(string, chars, guard) {
- var value = string;
- string = baseToString(string);
- if (!string) {
- return string;
- }
- if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
- return string.slice(0, trimmedRightIndex(string) + 1);
- }
- return string.slice(0, charsRightIndex(string, (chars + '')) + 1);
- }
-
- /**
- * Truncates `string` if it's longer than the given maximum string length.
- * The last characters of the truncated string are replaced with the omission
- * string which defaults to "...".
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to truncate.
- * @param {Object|number} [options] The options object or maximum string length.
- * @param {number} [options.length=30] The maximum string length.
- * @param {string} [options.omission='...'] The string to indicate text is omitted.
- * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {string} Returns the truncated string.
- * @example
- *
- * _.trunc('hi-diddly-ho there, neighborino');
- * // => 'hi-diddly-ho there, neighbo...'
- *
- * _.trunc('hi-diddly-ho there, neighborino', 24);
- * // => 'hi-diddly-ho there, n...'
- *
- * _.trunc('hi-diddly-ho there, neighborino', {
- * 'length': 24,
- * 'separator': ' '
- * });
- * // => 'hi-diddly-ho there,...'
- *
- * _.trunc('hi-diddly-ho there, neighborino', {
- * 'length': 24,
- * 'separator': /,? +/
- * });
- * // => 'hi-diddly-ho there...'
- *
- * _.trunc('hi-diddly-ho there, neighborino', {
- * 'omission': ' [...]'
- * });
- * // => 'hi-diddly-ho there, neig [...]'
- */
- function trunc(string, options, guard) {
- if (guard && isIterateeCall(string, options, guard)) {
- options = undefined;
- }
- var length = DEFAULT_TRUNC_LENGTH,
- omission = DEFAULT_TRUNC_OMISSION;
-
- if (options != null) {
- if (isObject(options)) {
- var separator = 'separator' in options ? options.separator : separator;
- length = 'length' in options ? (+options.length || 0) : length;
- omission = 'omission' in options ? baseToString(options.omission) : omission;
- } else {
- length = +options || 0;
- }
- }
- string = baseToString(string);
- if (length >= string.length) {
- return string;
- }
- var end = length - omission.length;
- if (end < 1) {
- return omission;
- }
- var result = string.slice(0, end);
- if (separator == null) {
- return result + omission;
- }
- if (isRegExp(separator)) {
- if (string.slice(end).search(separator)) {
- var match,
- newEnd,
- substring = string.slice(0, end);
-
- if (!separator.global) {
- separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');
- }
- separator.lastIndex = 0;
- while ((match = separator.exec(substring))) {
- newEnd = match.index;
- }
- result = result.slice(0, newEnd == null ? end : newEnd);
- }
- } else if (string.indexOf(separator, end) != end) {
- var index = result.lastIndexOf(separator);
- if (index > -1) {
- result = result.slice(0, index);
- }
- }
- return result + omission;
- }
-
- /**
- * The inverse of `_.escape`; this method converts the HTML entities
- * `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to their
- * corresponding characters.
- *
- * **Note:** No other HTML entities are unescaped. To unescape additional HTML
- * entities use a third-party library like [_he_](https://mths.be/he).
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to unescape.
- * @returns {string} Returns the unescaped string.
- * @example
- *
- * _.unescape('fred, barney, &amp; pebbles');
- * // => 'fred, barney, & pebbles'
- */
- function unescape(string) {
- string = baseToString(string);
- return (string && reHasEscapedHtml.test(string))
- ? string.replace(reEscapedHtml, unescapeHtmlChar)
- : string;
- }
-
- /**
- * Splits `string` into an array of its words.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to inspect.
- * @param {RegExp|string} [pattern] The pattern to match words.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Array} Returns the words of `string`.
- * @example
- *
- * _.words('fred, barney, & pebbles');
- * // => ['fred', 'barney', 'pebbles']
- *
- * _.words('fred, barney, & pebbles', /[^, ]+/g);
- * // => ['fred', 'barney', '&', 'pebbles']
- */
- function words(string, pattern, guard) {
- if (guard && isIterateeCall(string, pattern, guard)) {
- pattern = undefined;
- }
- string = baseToString(string);
- return string.match(pattern || reWords) || [];
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Attempts to invoke `func`, returning either the result or the caught error
- * object. Any additional arguments are provided to `func` when it is invoked.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {Function} func The function to attempt.
- * @returns {*} Returns the `func` result or error object.
- * @example
- *
- * // avoid throwing errors for invalid selectors
- * var elements = _.attempt(function(selector) {
- * return document.querySelectorAll(selector);
- * }, '>_>');
- *
- * if (_.isError(elements)) {
- * elements = [];
- * }
- */
- var attempt = restParam(function(func, args) {
- try {
- return func.apply(undefined, args);
- } catch(e) {
- return isError(e) ? e : new Error(e);
- }
- });
-
- /**
- * Creates a function that invokes `func` with the `this` binding of `thisArg`
- * and arguments of the created function. If `func` is a property name the
- * created callback returns the property value for a given element. If `func`
- * is an object the created callback returns `true` for elements that contain
- * the equivalent object properties, otherwise it returns `false`.
- *
- * @static
- * @memberOf _
- * @alias iteratee
- * @category Utility
- * @param {*} [func=_.identity] The value to convert to a callback.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Function} Returns the callback.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 }
- * ];
- *
- * // wrap to create custom callback shorthands
- * _.callback = _.wrap(_.callback, function(callback, func, thisArg) {
- * var match = /^(.+?)__([gl]t)(.+)$/.exec(func);
- * if (!match) {
- * return callback(func, thisArg);
- * }
- * return function(object) {
- * return match[2] == 'gt'
- * ? object[match[1]] > match[3]
- * : object[match[1]] < match[3];
- * };
- * });
- *
- * _.filter(users, 'age__gt36');
- * // => [{ 'user': 'fred', 'age': 40 }]
- */
- function callback(func, thisArg, guard) {
- if (guard && isIterateeCall(func, thisArg, guard)) {
- thisArg = undefined;
- }
- return isObjectLike(func)
- ? matches(func)
- : baseCallback(func, thisArg);
- }
-
- /**
- * Creates a function that returns `value`.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {*} value The value to return from the new function.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var object = { 'user': 'fred' };
- * var getter = _.constant(object);
- *
- * getter() === object;
- * // => true
- */
- function constant(value) {
- return function() {
- return value;
- };
- }
-
- /**
- * This method returns the first argument provided to it.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {*} value Any value.
- * @returns {*} Returns `value`.
- * @example
- *
- * var object = { 'user': 'fred' };
- *
- * _.identity(object) === object;
- * // => true
- */
- function identity(value) {
- return value;
- }
-
- /**
- * Creates a function that performs a deep comparison between a given object
- * and `source`, returning `true` if the given object has equivalent property
- * values, else `false`.
- *
- * **Note:** This method supports comparing arrays, booleans, `Date` objects,
- * numbers, `Object` objects, regexes, and strings. Objects are compared by
- * their own, not inherited, enumerable properties. For comparing a single
- * own or inherited property value see `_.matchesProperty`.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {Object} source The object of property values to match.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * _.filter(users, _.matches({ 'age': 40, 'active': false }));
- * // => [{ 'user': 'fred', 'age': 40, 'active': false }]
- */
- function matches(source) {
- return baseMatches(baseClone(source, true));
- }
-
- /**
- * Creates a function that compares the property value of `path` on a given
- * object to `value`.
- *
- * **Note:** This method supports comparing arrays, booleans, `Date` objects,
- * numbers, `Object` objects, regexes, and strings. Objects are compared by
- * their own, not inherited, enumerable properties.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {Array|string} path The path of the property to get.
- * @param {*} srcValue The value to match.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var users = [
- * { 'user': 'barney' },
- * { 'user': 'fred' }
- * ];
- *
- * _.find(users, _.matchesProperty('user', 'fred'));
- * // => { 'user': 'fred' }
- */
- function matchesProperty(path, srcValue) {
- return baseMatchesProperty(path, baseClone(srcValue, true));
- }
-
- /**
- * Creates a function that invokes the method at `path` on a given object.
- * Any additional arguments are provided to the invoked method.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {Array|string} path The path of the method to invoke.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var objects = [
- * { 'a': { 'b': { 'c': _.constant(2) } } },
- * { 'a': { 'b': { 'c': _.constant(1) } } }
- * ];
- *
- * _.map(objects, _.method('a.b.c'));
- * // => [2, 1]
- *
- * _.invoke(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');
- * // => [1, 2]
- */
- var method = restParam(function(path, args) {
- return function(object) {
- return invokePath(object, path, args);
- };
- });
-
- /**
- * The opposite of `_.method`; this method creates a function that invokes
- * the method at a given path on `object`. Any additional arguments are
- * provided to the invoked method.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {Object} object The object to query.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var array = _.times(3, _.constant),
- * object = { 'a': array, 'b': array, 'c': array };
- *
- * _.map(['a[2]', 'c[0]'], _.methodOf(object));
- * // => [2, 0]
- *
- * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
- * // => [2, 0]
- */
- var methodOf = restParam(function(object, args) {
- return function(path) {
- return invokePath(object, path, args);
- };
- });
-
- /**
- * Adds all own enumerable function properties of a source object to the
- * destination object. If `object` is a function then methods are added to
- * its prototype as well.
- *
- * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
- * avoid conflicts caused by modifying the original.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {Function|Object} [object=lodash] The destination object.
- * @param {Object} source The object of functions to add.
- * @param {Object} [options] The options object.
- * @param {boolean} [options.chain=true] Specify whether the functions added
- * are chainable.
- * @returns {Function|Object} Returns `object`.
- * @example
- *
- * function vowels(string) {
- * return _.filter(string, function(v) {
- * return /[aeiou]/i.test(v);
- * });
- * }
- *
- * _.mixin({ 'vowels': vowels });
- * _.vowels('fred');
- * // => ['e']
- *
- * _('fred').vowels().value();
- * // => ['e']
- *
- * _.mixin({ 'vowels': vowels }, { 'chain': false });
- * _('fred').vowels();
- * // => ['e']
- */
- function mixin(object, source, options) {
- if (options == null) {
- var isObj = isObject(source),
- props = isObj ? keys(source) : undefined,
- methodNames = (props && props.length) ? baseFunctions(source, props) : undefined;
-
- if (!(methodNames ? methodNames.length : isObj)) {
- methodNames = false;
- options = source;
- source = object;
- object = this;
- }
- }
- if (!methodNames) {
- methodNames = baseFunctions(source, keys(source));
- }
- var chain = true,
- index = -1,
- isFunc = isFunction(object),
- length = methodNames.length;
-
- if (options === false) {
- chain = false;
- } else if (isObject(options) && 'chain' in options) {
- chain = options.chain;
- }
- while (++index < length) {
- var methodName = methodNames[index],
- func = source[methodName];
-
- object[methodName] = func;
- if (isFunc) {
- object.prototype[methodName] = (function(func) {
- return function() {
- var chainAll = this.__chain__;
- if (chain || chainAll) {
- var result = object(this.__wrapped__),
- actions = result.__actions__ = arrayCopy(this.__actions__);
-
- actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
- result.__chain__ = chainAll;
- return result;
- }
- return func.apply(object, arrayPush([this.value()], arguments));
- };
- }(func));
- }
- }
- return object;
- }
-
- /**
- * Reverts the `_` variable to its previous value and returns a reference to
- * the `lodash` function.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @returns {Function} Returns the `lodash` function.
- * @example
- *
- * var lodash = _.noConflict();
- */
- function noConflict() {
- root._ = oldDash;
- return this;
- }
-
- /**
- * A no-operation function that returns `undefined` regardless of the
- * arguments it receives.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @example
- *
- * var object = { 'user': 'fred' };
- *
- * _.noop(object) === undefined;
- * // => true
- */
- function noop() {
- // No operation performed.
- }
-
- /**
- * Creates a function that returns the property value at `path` on a
- * given object.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var objects = [
- * { 'a': { 'b': { 'c': 2 } } },
- * { 'a': { 'b': { 'c': 1 } } }
- * ];
- *
- * _.map(objects, _.property('a.b.c'));
- * // => [2, 1]
- *
- * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
- * // => [1, 2]
- */
- function property(path) {
- return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
- }
-
- /**
- * The opposite of `_.property`; this method creates a function that returns
- * the property value at a given path on `object`.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {Object} object The object to query.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var array = [0, 1, 2],
- * object = { 'a': array, 'b': array, 'c': array };
- *
- * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
- * // => [2, 0]
- *
- * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
- * // => [2, 0]
- */
- function propertyOf(object) {
- return function(path) {
- return baseGet(object, toPath(path), path + '');
- };
- }
-
- /**
- * Creates an array of numbers (positive and/or negative) progressing from
- * `start` up to, but not including, `end`. If `end` is not specified it is
- * set to `start` with `start` then set to `0`. If `end` is less than `start`
- * a zero-length range is created unless a negative `step` is specified.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @param {number} [step=1] The value to increment or decrement by.
- * @returns {Array} Returns the new array of numbers.
- * @example
- *
- * _.range(4);
- * // => [0, 1, 2, 3]
- *
- * _.range(1, 5);
- * // => [1, 2, 3, 4]
- *
- * _.range(0, 20, 5);
- * // => [0, 5, 10, 15]
- *
- * _.range(0, -4, -1);
- * // => [0, -1, -2, -3]
- *
- * _.range(1, 4, 0);
- * // => [1, 1, 1]
- *
- * _.range(0);
- * // => []
- */
- function range(start, end, step) {
- if (step && isIterateeCall(start, end, step)) {
- end = step = undefined;
- }
- start = +start || 0;
- step = step == null ? 1 : (+step || 0);
-
- if (end == null) {
- end = start;
- start = 0;
- } else {
- end = +end || 0;
- }
- // Use `Array(length)` so engines like Chakra and V8 avoid slower modes.
- // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details.
- var index = -1,
- length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
- result = Array(length);
-
- while (++index < length) {
- result[index] = start;
- start += step;
- }
- return result;
- }
-
- /**
- * Invokes the iteratee function `n` times, returning an array of the results
- * of each invocation. The `iteratee` is bound to `thisArg` and invoked with
- * one argument; (index).
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {number} n The number of times to invoke `iteratee`.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {Array} Returns the array of results.
- * @example
- *
- * var diceRolls = _.times(3, _.partial(_.random, 1, 6, false));
- * // => [3, 6, 4]
- *
- * _.times(3, function(n) {
- * mage.castSpell(n);
- * });
- * // => invokes `mage.castSpell(n)` three times with `n` of `0`, `1`, and `2`
- *
- * _.times(3, function(n) {
- * this.cast(n);
- * }, mage);
- * // => also invokes `mage.castSpell(n)` three times
- */
- function times(n, iteratee, thisArg) {
- n = nativeFloor(n);
-
- // Exit early to avoid a JSC JIT bug in Safari 8
- // where `Array(0)` is treated as `Array(1)`.
- if (n < 1 || !nativeIsFinite(n)) {
- return [];
- }
- var index = -1,
- result = Array(nativeMin(n, MAX_ARRAY_LENGTH));
-
- iteratee = bindCallback(iteratee, thisArg, 1);
- while (++index < n) {
- if (index < MAX_ARRAY_LENGTH) {
- result[index] = iteratee(index);
- } else {
- iteratee(index);
- }
- }
- return result;
- }
-
- /**
- * Generates a unique ID. If `prefix` is provided the ID is appended to it.
- *
- * @static
- * @memberOf _
- * @category Utility
- * @param {string} [prefix] The value to prefix the ID with.
- * @returns {string} Returns the unique ID.
- * @example
- *
- * _.uniqueId('contact_');
- * // => 'contact_104'
- *
- * _.uniqueId();
- * // => '105'
- */
- function uniqueId(prefix) {
- var id = ++idCounter;
- return baseToString(prefix) + id;
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Adds two numbers.
- *
- * @static
- * @memberOf _
- * @category Math
- * @param {number} augend The first number to add.
- * @param {number} addend The second number to add.
- * @returns {number} Returns the sum.
- * @example
- *
- * _.add(6, 4);
- * // => 10
- */
- function add(augend, addend) {
- return (+augend || 0) + (+addend || 0);
- }
-
- /**
- * Calculates `n` rounded up to `precision`.
- *
- * @static
- * @memberOf _
- * @category Math
- * @param {number} n The number to round up.
- * @param {number} [precision=0] The precision to round up to.
- * @returns {number} Returns the rounded up number.
- * @example
- *
- * _.ceil(4.006);
- * // => 5
- *
- * _.ceil(6.004, 2);
- * // => 6.01
- *
- * _.ceil(6040, -2);
- * // => 6100
- */
- var ceil = createRound('ceil');
-
- /**
- * Calculates `n` rounded down to `precision`.
- *
- * @static
- * @memberOf _
- * @category Math
- * @param {number} n The number to round down.
- * @param {number} [precision=0] The precision to round down to.
- * @returns {number} Returns the rounded down number.
- * @example
- *
- * _.floor(4.006);
- * // => 4
- *
- * _.floor(0.046, 2);
- * // => 0.04
- *
- * _.floor(4060, -2);
- * // => 4000
- */
- var floor = createRound('floor');
-
- /**
- * Gets the maximum value of `collection`. If `collection` is empty or falsey
- * `-Infinity` is returned. If an iteratee function is provided it is invoked
- * for each value in `collection` to generate the criterion by which the value
- * is ranked. The `iteratee` is bound to `thisArg` and invoked with three
- * arguments: (value, index, collection).
- *
- * If a property name is provided for `iteratee` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `iteratee` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Math
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {*} Returns the maximum value.
- * @example
- *
- * _.max([4, 2, 8, 6]);
- * // => 8
- *
- * _.max([]);
- * // => -Infinity
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 }
- * ];
- *
- * _.max(users, function(chr) {
- * return chr.age;
- * });
- * // => { 'user': 'fred', 'age': 40 }
- *
- * // using the `_.property` callback shorthand
- * _.max(users, 'age');
- * // => { 'user': 'fred', 'age': 40 }
- */
- var max = createExtremum(gt, NEGATIVE_INFINITY);
-
- /**
- * Gets the minimum value of `collection`. If `collection` is empty or falsey
- * `Infinity` is returned. If an iteratee function is provided it is invoked
- * for each value in `collection` to generate the criterion by which the value
- * is ranked. The `iteratee` is bound to `thisArg` and invoked with three
- * arguments: (value, index, collection).
- *
- * If a property name is provided for `iteratee` the created `_.property`
- * style callback returns the property value of the given element.
- *
- * If a value is also provided for `thisArg` the created `_.matchesProperty`
- * style callback returns `true` for elements that have a matching property
- * value, else `false`.
- *
- * If an object is provided for `iteratee` the created `_.matches` style
- * callback returns `true` for elements that have the properties of the given
- * object, else `false`.
- *
- * @static
- * @memberOf _
- * @category Math
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {*} Returns the minimum value.
- * @example
- *
- * _.min([4, 2, 8, 6]);
- * // => 2
- *
- * _.min([]);
- * // => Infinity
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 }
- * ];
- *
- * _.min(users, function(chr) {
- * return chr.age;
- * });
- * // => { 'user': 'barney', 'age': 36 }
- *
- * // using the `_.property` callback shorthand
- * _.min(users, 'age');
- * // => { 'user': 'barney', 'age': 36 }
- */
- var min = createExtremum(lt, POSITIVE_INFINITY);
-
- /**
- * Calculates `n` rounded to `precision`.
- *
- * @static
- * @memberOf _
- * @category Math
- * @param {number} n The number to round.
- * @param {number} [precision=0] The precision to round to.
- * @returns {number} Returns the rounded number.
- * @example
- *
- * _.round(4.006);
- * // => 4
- *
- * _.round(4.006, 2);
- * // => 4.01
- *
- * _.round(4060, -2);
- * // => 4100
- */
- var round = createRound('round');
-
- /**
- * Gets the sum of the values in `collection`.
- *
- * @static
- * @memberOf _
- * @category Math
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function|Object|string} [iteratee] The function invoked per iteration.
- * @param {*} [thisArg] The `this` binding of `iteratee`.
- * @returns {number} Returns the sum.
- * @example
- *
- * _.sum([4, 6]);
- * // => 10
- *
- * _.sum({ 'a': 4, 'b': 6 });
- * // => 10
- *
- * var objects = [
- * { 'n': 4 },
- * { 'n': 6 }
- * ];
- *
- * _.sum(objects, function(object) {
- * return object.n;
- * });
- * // => 10
- *
- * // using the `_.property` callback shorthand
- * _.sum(objects, 'n');
- * // => 10
- */
- function sum(collection, iteratee, thisArg) {
- if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
- iteratee = undefined;
- }
- iteratee = getCallback(iteratee, thisArg, 3);
- return iteratee.length == 1
- ? arraySum(isArray(collection) ? collection : toIterable(collection), iteratee)
- : baseSum(collection, iteratee);
- }
-
- /*------------------------------------------------------------------------*/
-
- // Ensure wrappers are instances of `baseLodash`.
- lodash.prototype = baseLodash.prototype;
-
- LodashWrapper.prototype = baseCreate(baseLodash.prototype);
- LodashWrapper.prototype.constructor = LodashWrapper;
-
- LazyWrapper.prototype = baseCreate(baseLodash.prototype);
- LazyWrapper.prototype.constructor = LazyWrapper;
-
- // Add functions to the `Map` cache.
- MapCache.prototype['delete'] = mapDelete;
- MapCache.prototype.get = mapGet;
- MapCache.prototype.has = mapHas;
- MapCache.prototype.set = mapSet;
-
- // Add functions to the `Set` cache.
- SetCache.prototype.push = cachePush;
-
- // Assign cache to `_.memoize`.
- memoize.Cache = MapCache;
-
- // Add functions that return wrapped values when chaining.
- lodash.after = after;
- lodash.ary = ary;
- lodash.assign = assign;
- lodash.at = at;
- lodash.before = before;
- lodash.bind = bind;
- lodash.bindAll = bindAll;
- lodash.bindKey = bindKey;
- lodash.callback = callback;
- lodash.chain = chain;
- lodash.chunk = chunk;
- lodash.compact = compact;
- lodash.constant = constant;
- lodash.countBy = countBy;
- lodash.create = create;
- lodash.curry = curry;
- lodash.curryRight = curryRight;
- lodash.debounce = debounce;
- lodash.defaults = defaults;
- lodash.defaultsDeep = defaultsDeep;
- lodash.defer = defer;
- lodash.delay = delay;
- lodash.difference = difference;
- lodash.drop = drop;
- lodash.dropRight = dropRight;
- lodash.dropRightWhile = dropRightWhile;
- lodash.dropWhile = dropWhile;
- lodash.fill = fill;
- lodash.filter = filter;
- lodash.flatten = flatten;
- lodash.flattenDeep = flattenDeep;
- lodash.flow = flow;
- lodash.flowRight = flowRight;
- lodash.forEach = forEach;
- lodash.forEachRight = forEachRight;
- lodash.forIn = forIn;
- lodash.forInRight = forInRight;
- lodash.forOwn = forOwn;
- lodash.forOwnRight = forOwnRight;
- lodash.functions = functions;
- lodash.groupBy = groupBy;
- lodash.indexBy = indexBy;
- lodash.initial = initial;
- lodash.intersection = intersection;
- lodash.invert = invert;
- lodash.invoke = invoke;
- lodash.keys = keys;
- lodash.keysIn = keysIn;
- lodash.map = map;
- lodash.mapKeys = mapKeys;
- lodash.mapValues = mapValues;
- lodash.matches = matches;
- lodash.matchesProperty = matchesProperty;
- lodash.memoize = memoize;
- lodash.merge = merge;
- lodash.method = method;
- lodash.methodOf = methodOf;
- lodash.mixin = mixin;
- lodash.modArgs = modArgs;
- lodash.negate = negate;
- lodash.omit = omit;
- lodash.once = once;
- lodash.pairs = pairs;
- lodash.partial = partial;
- lodash.partialRight = partialRight;
- lodash.partition = partition;
- lodash.pick = pick;
- lodash.pluck = pluck;
- lodash.property = property;
- lodash.propertyOf = propertyOf;
- lodash.pull = pull;
- lodash.pullAt = pullAt;
- lodash.range = range;
- lodash.rearg = rearg;
- lodash.reject = reject;
- lodash.remove = remove;
- lodash.rest = rest;
- lodash.restParam = restParam;
- lodash.set = set;
- lodash.shuffle = shuffle;
- lodash.slice = slice;
- lodash.sortBy = sortBy;
- lodash.sortByAll = sortByAll;
- lodash.sortByOrder = sortByOrder;
- lodash.spread = spread;
- lodash.take = take;
- lodash.takeRight = takeRight;
- lodash.takeRightWhile = takeRightWhile;
- lodash.takeWhile = takeWhile;
- lodash.tap = tap;
- lodash.throttle = throttle;
- lodash.thru = thru;
- lodash.times = times;
- lodash.toArray = toArray;
- lodash.toPlainObject = toPlainObject;
- lodash.transform = transform;
- lodash.union = union;
- lodash.uniq = uniq;
- lodash.unzip = unzip;
- lodash.unzipWith = unzipWith;
- lodash.values = values;
- lodash.valuesIn = valuesIn;
- lodash.where = where;
- lodash.without = without;
- lodash.wrap = wrap;
- lodash.xor = xor;
- lodash.zip = zip;
- lodash.zipObject = zipObject;
- lodash.zipWith = zipWith;
-
- // Add aliases.
- lodash.backflow = flowRight;
- lodash.collect = map;
- lodash.compose = flowRight;
- lodash.each = forEach;
- lodash.eachRight = forEachRight;
- lodash.extend = assign;
- lodash.iteratee = callback;
- lodash.methods = functions;
- lodash.object = zipObject;
- lodash.select = filter;
- lodash.tail = rest;
- lodash.unique = uniq;
-
- // Add functions to `lodash.prototype`.
- mixin(lodash, lodash);
-
- /*------------------------------------------------------------------------*/
-
- // Add functions that return unwrapped values when chaining.
- lodash.add = add;
- lodash.attempt = attempt;
- lodash.camelCase = camelCase;
- lodash.capitalize = capitalize;
- lodash.ceil = ceil;
- lodash.clone = clone;
- lodash.cloneDeep = cloneDeep;
- lodash.deburr = deburr;
- lodash.endsWith = endsWith;
- lodash.escape = escape;
- lodash.escapeRegExp = escapeRegExp;
- lodash.every = every;
- lodash.find = find;
- lodash.findIndex = findIndex;
- lodash.findKey = findKey;
- lodash.findLast = findLast;
- lodash.findLastIndex = findLastIndex;
- lodash.findLastKey = findLastKey;
- lodash.findWhere = findWhere;
- lodash.first = first;
- lodash.floor = floor;
- lodash.get = get;
- lodash.gt = gt;
- lodash.gte = gte;
- lodash.has = has;
- lodash.identity = identity;
- lodash.includes = includes;
- lodash.indexOf = indexOf;
- lodash.inRange = inRange;
- lodash.isArguments = isArguments;
- lodash.isArray = isArray;
- lodash.isBoolean = isBoolean;
- lodash.isDate = isDate;
- lodash.isElement = isElement;
- lodash.isEmpty = isEmpty;
- lodash.isEqual = isEqual;
- lodash.isError = isError;
- lodash.isFinite = isFinite;
- lodash.isFunction = isFunction;
- lodash.isMatch = isMatch;
- lodash.isNaN = isNaN;
- lodash.isNative = isNative;
- lodash.isNull = isNull;
- lodash.isNumber = isNumber;
- lodash.isObject = isObject;
- lodash.isPlainObject = isPlainObject;
- lodash.isRegExp = isRegExp;
- lodash.isString = isString;
- lodash.isTypedArray = isTypedArray;
- lodash.isUndefined = isUndefined;
- lodash.kebabCase = kebabCase;
- lodash.last = last;
- lodash.lastIndexOf = lastIndexOf;
- lodash.lt = lt;
- lodash.lte = lte;
- lodash.max = max;
- lodash.min = min;
- lodash.noConflict = noConflict;
- lodash.noop = noop;
- lodash.now = now;
- lodash.pad = pad;
- lodash.padLeft = padLeft;
- lodash.padRight = padRight;
- lodash.parseInt = parseInt;
- lodash.random = random;
- lodash.reduce = reduce;
- lodash.reduceRight = reduceRight;
- lodash.repeat = repeat;
- lodash.result = result;
- lodash.round = round;
- lodash.runInContext = runInContext;
- lodash.size = size;
- lodash.snakeCase = snakeCase;
- lodash.some = some;
- lodash.sortedIndex = sortedIndex;
- lodash.sortedLastIndex = sortedLastIndex;
- lodash.startCase = startCase;
- lodash.startsWith = startsWith;
- lodash.sum = sum;
- lodash.template = template;
- lodash.trim = trim;
- lodash.trimLeft = trimLeft;
- lodash.trimRight = trimRight;
- lodash.trunc = trunc;
- lodash.unescape = unescape;
- lodash.uniqueId = uniqueId;
- lodash.words = words;
-
- // Add aliases.
- lodash.all = every;
- lodash.any = some;
- lodash.contains = includes;
- lodash.eq = isEqual;
- lodash.detect = find;
- lodash.foldl = reduce;
- lodash.foldr = reduceRight;
- lodash.head = first;
- lodash.include = includes;
- lodash.inject = reduce;
-
- mixin(lodash, (function() {
- var source = {};
- baseForOwn(lodash, function(func, methodName) {
- if (!lodash.prototype[methodName]) {
- source[methodName] = func;
- }
- });
- return source;
- }()), false);
-
- /*------------------------------------------------------------------------*/
-
- // Add functions capable of returning wrapped and unwrapped values when chaining.
- lodash.sample = sample;
-
- lodash.prototype.sample = function(n) {
- if (!this.__chain__ && n == null) {
- return sample(this.value());
- }
- return this.thru(function(value) {
- return sample(value, n);
- });
- };
-
- /*------------------------------------------------------------------------*/
-
- /**
- * The semantic version number.
- *
- * @static
- * @memberOf _
- * @type string
- */
- lodash.VERSION = VERSION;
-
- // Assign default placeholders.
- arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
- lodash[methodName].placeholder = lodash;
- });
-
- // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
- arrayEach(['drop', 'take'], function(methodName, index) {
- LazyWrapper.prototype[methodName] = function(n) {
- var filtered = this.__filtered__;
- if (filtered && !index) {
- return new LazyWrapper(this);
- }
- n = n == null ? 1 : nativeMax(nativeFloor(n) || 0, 0);
-
- var result = this.clone();
- if (filtered) {
- result.__takeCount__ = nativeMin(result.__takeCount__, n);
- } else {
- result.__views__.push({ 'size': n, 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') });
- }
- return result;
- };
-
- LazyWrapper.prototype[methodName + 'Right'] = function(n) {
- return this.reverse()[methodName](n).reverse();
- };
- });
-
- // Add `LazyWrapper` methods that accept an `iteratee` value.
- arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
- var type = index + 1,
- isFilter = type != LAZY_MAP_FLAG;
-
- LazyWrapper.prototype[methodName] = function(iteratee, thisArg) {
- var result = this.clone();
- result.__iteratees__.push({ 'iteratee': getCallback(iteratee, thisArg, 1), 'type': type });
- result.__filtered__ = result.__filtered__ || isFilter;
- return result;
- };
- });
-
- // Add `LazyWrapper` methods for `_.first` and `_.last`.
- arrayEach(['first', 'last'], function(methodName, index) {
- var takeName = 'take' + (index ? 'Right' : '');
-
- LazyWrapper.prototype[methodName] = function() {
- return this[takeName](1).value()[0];
- };
- });
-
- // Add `LazyWrapper` methods for `_.initial` and `_.rest`.
- arrayEach(['initial', 'rest'], function(methodName, index) {
- var dropName = 'drop' + (index ? '' : 'Right');
-
- LazyWrapper.prototype[methodName] = function() {
- return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
- };
- });
-
- // Add `LazyWrapper` methods for `_.pluck` and `_.where`.
- arrayEach(['pluck', 'where'], function(methodName, index) {
- var operationName = index ? 'filter' : 'map',
- createCallback = index ? baseMatches : property;
-
- LazyWrapper.prototype[methodName] = function(value) {
- return this[operationName](createCallback(value));
- };
- });
-
- LazyWrapper.prototype.compact = function() {
- return this.filter(identity);
- };
-
- LazyWrapper.prototype.reject = function(predicate, thisArg) {
- predicate = getCallback(predicate, thisArg, 1);
- return this.filter(function(value) {
- return !predicate(value);
- });
- };
-
- LazyWrapper.prototype.slice = function(start, end) {
- start = start == null ? 0 : (+start || 0);
-
- var result = this;
- if (result.__filtered__ && (start > 0 || end < 0)) {
- return new LazyWrapper(result);
- }
- if (start < 0) {
- result = result.takeRight(-start);
- } else if (start) {
- result = result.drop(start);
- }
- if (end !== undefined) {
- end = (+end || 0);
- result = end < 0 ? result.dropRight(-end) : result.take(end - start);
- }
- return result;
- };
-
- LazyWrapper.prototype.takeRightWhile = function(predicate, thisArg) {
- return this.reverse().takeWhile(predicate, thisArg).reverse();
- };
-
- LazyWrapper.prototype.toArray = function() {
- return this.take(POSITIVE_INFINITY);
- };
-
- // Add `LazyWrapper` methods to `lodash.prototype`.
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- var checkIteratee = /^(?:filter|map|reject)|While$/.test(methodName),
- retUnwrapped = /^(?:first|last)$/.test(methodName),
- lodashFunc = lodash[retUnwrapped ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName];
-
- if (!lodashFunc) {
- return;
- }
- lodash.prototype[methodName] = function() {
- var args = retUnwrapped ? [1] : arguments,
- chainAll = this.__chain__,
- value = this.__wrapped__,
- isHybrid = !!this.__actions__.length,
- isLazy = value instanceof LazyWrapper,
- iteratee = args[0],
- useLazy = isLazy || isArray(value);
-
- if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
- // Avoid lazy use if the iteratee has a "length" value other than `1`.
- isLazy = useLazy = false;
- }
- var interceptor = function(value) {
- return (retUnwrapped && chainAll)
- ? lodashFunc(value, 1)[0]
- : lodashFunc.apply(undefined, arrayPush([value], args));
- };
-
- var action = { 'func': thru, 'args': [interceptor], 'thisArg': undefined },
- onlyLazy = isLazy && !isHybrid;
-
- if (retUnwrapped && !chainAll) {
- if (onlyLazy) {
- value = value.clone();
- value.__actions__.push(action);
- return func.call(value);
- }
- return lodashFunc.call(undefined, this.value())[0];
- }
- if (!retUnwrapped && useLazy) {
- value = onlyLazy ? value : new LazyWrapper(this);
- var result = func.apply(value, args);
- result.__actions__.push(action);
- return new LodashWrapper(result, chainAll);
- }
- return this.thru(interceptor);
- };
- });
-
- // Add `Array` and `String` methods to `lodash.prototype`.
- arrayEach(['join', 'pop', 'push', 'replace', 'shift', 'sort', 'splice', 'split', 'unshift'], function(methodName) {
- var func = (/^(?:replace|split)$/.test(methodName) ? stringProto : arrayProto)[methodName],
- chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
- retUnwrapped = /^(?:join|pop|replace|shift)$/.test(methodName);
-
- lodash.prototype[methodName] = function() {
- var args = arguments;
- if (retUnwrapped && !this.__chain__) {
- return func.apply(this.value(), args);
- }
- return this[chainName](function(value) {
- return func.apply(value, args);
- });
- };
- });
-
- // Map minified function names to their real names.
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- var lodashFunc = lodash[methodName];
- if (lodashFunc) {
- var key = lodashFunc.name,
- names = realNames[key] || (realNames[key] = []);
-
- names.push({ 'name': methodName, 'func': lodashFunc });
- }
- });
-
- realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': undefined }];
-
- // Add functions to the lazy wrapper.
- LazyWrapper.prototype.clone = lazyClone;
- LazyWrapper.prototype.reverse = lazyReverse;
- LazyWrapper.prototype.value = lazyValue;
-
- // Add chaining functions to the `lodash` wrapper.
- lodash.prototype.chain = wrapperChain;
- lodash.prototype.commit = wrapperCommit;
- lodash.prototype.concat = wrapperConcat;
- lodash.prototype.plant = wrapperPlant;
- lodash.prototype.reverse = wrapperReverse;
- lodash.prototype.toString = wrapperToString;
- lodash.prototype.run = lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
-
- // Add function aliases to the `lodash` wrapper.
- lodash.prototype.collect = lodash.prototype.map;
- lodash.prototype.head = lodash.prototype.first;
- lodash.prototype.select = lodash.prototype.filter;
- lodash.prototype.tail = lodash.prototype.rest;
-
- return lodash;
- }
-
- /*--------------------------------------------------------------------------*/
-
- // Export lodash.
- var _ = runInContext();
-
- // Some AMD build optimizers like r.js check for condition patterns like the following:
- if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
- // Expose lodash to the global object when an AMD loader is present to avoid
- // errors in cases where lodash is loaded by a script tag and not intended
- // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch for
- // more details.
- root._ = _;
-
- // Define as an anonymous module so, through path mapping, it can be
- // referenced as the "underscore" module.
- define(function() {
- return _;
- });
- }
- // Check for `exports` after `define` in case a build optimizer adds an `exports` object.
- else if (freeExports && freeModule) {
- // Export for Node.js or RingoJS.
- if (moduleExports) {
- (freeModule.exports = _)._ = _;
- }
- // Export for Rhino with CommonJS support.
- else {
- freeExports._ = _;
- }
- }
- else {
- // Export for a browser or Rhino.
- root._ = _;
- }
-}.call(this));
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{}],88:[function(require,module,exports){
-module.exports={"Aacute":"\u00C1","aacute":"\u00E1","Abreve":"\u0102","abreve":"\u0103","ac":"\u223E","acd":"\u223F","acE":"\u223E\u0333","Acirc":"\u00C2","acirc":"\u00E2","acute":"\u00B4","Acy":"\u0410","acy":"\u0430","AElig":"\u00C6","aelig":"\u00E6","af":"\u2061","Afr":"\uD835\uDD04","afr":"\uD835\uDD1E","Agrave":"\u00C0","agrave":"\u00E0","alefsym":"\u2135","aleph":"\u2135","Alpha":"\u0391","alpha":"\u03B1","Amacr":"\u0100","amacr":"\u0101","amalg":"\u2A3F","amp":"&","AMP":"&","andand":"\u2A55","And":"\u2A53","and":"\u2227","andd":"\u2A5C","andslope":"\u2A58","andv":"\u2A5A","ang":"\u2220","ange":"\u29A4","angle":"\u2220","angmsdaa":"\u29A8","angmsdab":"\u29A9","angmsdac":"\u29AA","angmsdad":"\u29AB","angmsdae":"\u29AC","angmsdaf":"\u29AD","angmsdag":"\u29AE","angmsdah":"\u29AF","angmsd":"\u2221","angrt":"\u221F","angrtvb":"\u22BE","angrtvbd":"\u299D","angsph":"\u2222","angst":"\u00C5","angzarr":"\u237C","Aogon":"\u0104","aogon":"\u0105","Aopf":"\uD835\uDD38","aopf":"\uD835\uDD52","apacir":"\u2A6F","ap":"\u2248","apE":"\u2A70","ape":"\u224A","apid":"\u224B","apos":"'","ApplyFunction":"\u2061","approx":"\u2248","approxeq":"\u224A","Aring":"\u00C5","aring":"\u00E5","Ascr":"\uD835\uDC9C","ascr":"\uD835\uDCB6","Assign":"\u2254","ast":"*","asymp":"\u2248","asympeq":"\u224D","Atilde":"\u00C3","atilde":"\u00E3","Auml":"\u00C4","auml":"\u00E4","awconint":"\u2233","awint":"\u2A11","backcong":"\u224C","backepsilon":"\u03F6","backprime":"\u2035","backsim":"\u223D","backsimeq":"\u22CD","Backslash":"\u2216","Barv":"\u2AE7","barvee":"\u22BD","barwed":"\u2305","Barwed":"\u2306","barwedge":"\u2305","bbrk":"\u23B5","bbrktbrk":"\u23B6","bcong":"\u224C","Bcy":"\u0411","bcy":"\u0431","bdquo":"\u201E","becaus":"\u2235","because":"\u2235","Because":"\u2235","bemptyv":"\u29B0","bepsi":"\u03F6","bernou":"\u212C","Bernoullis":"\u212C","Beta":"\u0392","beta":"\u03B2","beth":"\u2136","between":"\u226C","Bfr":"\uD835\uDD05","bfr":"\uD835\uDD1F","bigcap":"\u22C2","bigcirc":"\u25EF","bigcup":"\u22C3","bigodot":"\u2A00","bigoplus":"\u2A01","bigotimes":"\u2A02","bigsqcup":"\u2A06","bigstar":"\u2605","bigtriangledown":"\u25BD","bigtriangleup":"\u25B3","biguplus":"\u2A04","bigvee":"\u22C1","bigwedge":"\u22C0","bkarow":"\u290D","blacklozenge":"\u29EB","blacksquare":"\u25AA","blacktriangle":"\u25B4","blacktriangledown":"\u25BE","blacktriangleleft":"\u25C2","blacktriangleright":"\u25B8","blank":"\u2423","blk12":"\u2592","blk14":"\u2591","blk34":"\u2593","block":"\u2588","bne":"=\u20E5","bnequiv":"\u2261\u20E5","bNot":"\u2AED","bnot":"\u2310","Bopf":"\uD835\uDD39","bopf":"\uD835\uDD53","bot":"\u22A5","bottom":"\u22A5","bowtie":"\u22C8","boxbox":"\u29C9","boxdl":"\u2510","boxdL":"\u2555","boxDl":"\u2556","boxDL":"\u2557","boxdr":"\u250C","boxdR":"\u2552","boxDr":"\u2553","boxDR":"\u2554","boxh":"\u2500","boxH":"\u2550","boxhd":"\u252C","boxHd":"\u2564","boxhD":"\u2565","boxHD":"\u2566","boxhu":"\u2534","boxHu":"\u2567","boxhU":"\u2568","boxHU":"\u2569","boxminus":"\u229F","boxplus":"\u229E","boxtimes":"\u22A0","boxul":"\u2518","boxuL":"\u255B","boxUl":"\u255C","boxUL":"\u255D","boxur":"\u2514","boxuR":"\u2558","boxUr":"\u2559","boxUR":"\u255A","boxv":"\u2502","boxV":"\u2551","boxvh":"\u253C","boxvH":"\u256A","boxVh":"\u256B","boxVH":"\u256C","boxvl":"\u2524","boxvL":"\u2561","boxVl":"\u2562","boxVL":"\u2563","boxvr":"\u251C","boxvR":"\u255E","boxVr":"\u255F","boxVR":"\u2560","bprime":"\u2035","breve":"\u02D8","Breve":"\u02D8","brvbar":"\u00A6","bscr":"\uD835\uDCB7","Bscr":"\u212C","bsemi":"\u204F","bsim":"\u223D","bsime":"\u22CD","bsolb":"\u29C5","bsol":"\\","bsolhsub":"\u27C8","bull":"\u2022","bullet":"\u2022","bump":"\u224E","bumpE":"\u2AAE","bumpe":"\u224F","Bumpeq":"\u224E","bumpeq":"\u224F","Cacute":"\u0106","cacute":"\u0107","capand":"\u2A44","capbrcup":"\u2A49","capcap":"\u2A4B","cap":"\u2229","Cap":"\u22D2","capcup":"\u2A47","capdot":"\u2A40","CapitalDifferentialD":"\u2145","caps":"\u2229\uFE00","caret":"\u2041","caron":"\u02C7","Cayleys":"\u212D","ccaps":"\u2A4D","Ccaron":"\u010C","ccaron":"\u010D","Ccedil":"\u00C7","ccedil":"\u00E7","Ccirc":"\u0108","ccirc":"\u0109","Cconint":"\u2230","ccups":"\u2A4C","ccupssm":"\u2A50","Cdot":"\u010A","cdot":"\u010B","cedil":"\u00B8","Cedilla":"\u00B8","cemptyv":"\u29B2","cent":"\u00A2","centerdot":"\u00B7","CenterDot":"\u00B7","cfr":"\uD835\uDD20","Cfr":"\u212D","CHcy":"\u0427","chcy":"\u0447","check":"\u2713","checkmark":"\u2713","Chi":"\u03A7","chi":"\u03C7","circ":"\u02C6","circeq":"\u2257","circlearrowleft":"\u21BA","circlearrowright":"\u21BB","circledast":"\u229B","circledcirc":"\u229A","circleddash":"\u229D","CircleDot":"\u2299","circledR":"\u00AE","circledS":"\u24C8","CircleMinus":"\u2296","CirclePlus":"\u2295","CircleTimes":"\u2297","cir":"\u25CB","cirE":"\u29C3","cire":"\u2257","cirfnint":"\u2A10","cirmid":"\u2AEF","cirscir":"\u29C2","ClockwiseContourIntegral":"\u2232","CloseCurlyDoubleQuote":"\u201D","CloseCurlyQuote":"\u2019","clubs":"\u2663","clubsuit":"\u2663","colon":":","Colon":"\u2237","Colone":"\u2A74","colone":"\u2254","coloneq":"\u2254","comma":",","commat":"@","comp":"\u2201","compfn":"\u2218","complement":"\u2201","complexes":"\u2102","cong":"\u2245","congdot":"\u2A6D","Congruent":"\u2261","conint":"\u222E","Conint":"\u222F","ContourIntegral":"\u222E","copf":"\uD835\uDD54","Copf":"\u2102","coprod":"\u2210","Coproduct":"\u2210","copy":"\u00A9","COPY":"\u00A9","copysr":"\u2117","CounterClockwiseContourIntegral":"\u2233","crarr":"\u21B5","cross":"\u2717","Cross":"\u2A2F","Cscr":"\uD835\uDC9E","cscr":"\uD835\uDCB8","csub":"\u2ACF","csube":"\u2AD1","csup":"\u2AD0","csupe":"\u2AD2","ctdot":"\u22EF","cudarrl":"\u2938","cudarrr":"\u2935","cuepr":"\u22DE","cuesc":"\u22DF","cularr":"\u21B6","cularrp":"\u293D","cupbrcap":"\u2A48","cupcap":"\u2A46","CupCap":"\u224D","cup":"\u222A","Cup":"\u22D3","cupcup":"\u2A4A","cupdot":"\u228D","cupor":"\u2A45","cups":"\u222A\uFE00","curarr":"\u21B7","curarrm":"\u293C","curlyeqprec":"\u22DE","curlyeqsucc":"\u22DF","curlyvee":"\u22CE","curlywedge":"\u22CF","curren":"\u00A4","curvearrowleft":"\u21B6","curvearrowright":"\u21B7","cuvee":"\u22CE","cuwed":"\u22CF","cwconint":"\u2232","cwint":"\u2231","cylcty":"\u232D","dagger":"\u2020","Dagger":"\u2021","daleth":"\u2138","darr":"\u2193","Darr":"\u21A1","dArr":"\u21D3","dash":"\u2010","Dashv":"\u2AE4","dashv":"\u22A3","dbkarow":"\u290F","dblac":"\u02DD","Dcaron":"\u010E","dcaron":"\u010F","Dcy":"\u0414","dcy":"\u0434","ddagger":"\u2021","ddarr":"\u21CA","DD":"\u2145","dd":"\u2146","DDotrahd":"\u2911","ddotseq":"\u2A77","deg":"\u00B0","Del":"\u2207","Delta":"\u0394","delta":"\u03B4","demptyv":"\u29B1","dfisht":"\u297F","Dfr":"\uD835\uDD07","dfr":"\uD835\uDD21","dHar":"\u2965","dharl":"\u21C3","dharr":"\u21C2","DiacriticalAcute":"\u00B4","DiacriticalDot":"\u02D9","DiacriticalDoubleAcute":"\u02DD","DiacriticalGrave":"`","DiacriticalTilde":"\u02DC","diam":"\u22C4","diamond":"\u22C4","Diamond":"\u22C4","diamondsuit":"\u2666","diams":"\u2666","die":"\u00A8","DifferentialD":"\u2146","digamma":"\u03DD","disin":"\u22F2","div":"\u00F7","divide":"\u00F7","divideontimes":"\u22C7","divonx":"\u22C7","DJcy":"\u0402","djcy":"\u0452","dlcorn":"\u231E","dlcrop":"\u230D","dollar":"$","Dopf":"\uD835\uDD3B","dopf":"\uD835\uDD55","Dot":"\u00A8","dot":"\u02D9","DotDot":"\u20DC","doteq":"\u2250","doteqdot":"\u2251","DotEqual":"\u2250","dotminus":"\u2238","dotplus":"\u2214","dotsquare":"\u22A1","doublebarwedge":"\u2306","DoubleContourIntegral":"\u222F","DoubleDot":"\u00A8","DoubleDownArrow":"\u21D3","DoubleLeftArrow":"\u21D0","DoubleLeftRightArrow":"\u21D4","DoubleLeftTee":"\u2AE4","DoubleLongLeftArrow":"\u27F8","DoubleLongLeftRightArrow":"\u27FA","DoubleLongRightArrow":"\u27F9","DoubleRightArrow":"\u21D2","DoubleRightTee":"\u22A8","DoubleUpArrow":"\u21D1","DoubleUpDownArrow":"\u21D5","DoubleVerticalBar":"\u2225","DownArrowBar":"\u2913","downarrow":"\u2193","DownArrow":"\u2193","Downarrow":"\u21D3","DownArrowUpArrow":"\u21F5","DownBreve":"\u0311","downdownarrows":"\u21CA","downharpoonleft":"\u21C3","downharpoonright":"\u21C2","DownLeftRightVector":"\u2950","DownLeftTeeVector":"\u295E","DownLeftVectorBar":"\u2956","DownLeftVector":"\u21BD","DownRightTeeVector":"\u295F","DownRightVectorBar":"\u2957","DownRightVector":"\u21C1","DownTeeArrow":"\u21A7","DownTee":"\u22A4","drbkarow":"\u2910","drcorn":"\u231F","drcrop":"\u230C","Dscr":"\uD835\uDC9F","dscr":"\uD835\uDCB9","DScy":"\u0405","dscy":"\u0455","dsol":"\u29F6","Dstrok":"\u0110","dstrok":"\u0111","dtdot":"\u22F1","dtri":"\u25BF","dtrif":"\u25BE","duarr":"\u21F5","duhar":"\u296F","dwangle":"\u29A6","DZcy":"\u040F","dzcy":"\u045F","dzigrarr":"\u27FF","Eacute":"\u00C9","eacute":"\u00E9","easter":"\u2A6E","Ecaron":"\u011A","ecaron":"\u011B","Ecirc":"\u00CA","ecirc":"\u00EA","ecir":"\u2256","ecolon":"\u2255","Ecy":"\u042D","ecy":"\u044D","eDDot":"\u2A77","Edot":"\u0116","edot":"\u0117","eDot":"\u2251","ee":"\u2147","efDot":"\u2252","Efr":"\uD835\uDD08","efr":"\uD835\uDD22","eg":"\u2A9A","Egrave":"\u00C8","egrave":"\u00E8","egs":"\u2A96","egsdot":"\u2A98","el":"\u2A99","Element":"\u2208","elinters":"\u23E7","ell":"\u2113","els":"\u2A95","elsdot":"\u2A97","Emacr":"\u0112","emacr":"\u0113","empty":"\u2205","emptyset":"\u2205","EmptySmallSquare":"\u25FB","emptyv":"\u2205","EmptyVerySmallSquare":"\u25AB","emsp13":"\u2004","emsp14":"\u2005","emsp":"\u2003","ENG":"\u014A","eng":"\u014B","ensp":"\u2002","Eogon":"\u0118","eogon":"\u0119","Eopf":"\uD835\uDD3C","eopf":"\uD835\uDD56","epar":"\u22D5","eparsl":"\u29E3","eplus":"\u2A71","epsi":"\u03B5","Epsilon":"\u0395","epsilon":"\u03B5","epsiv":"\u03F5","eqcirc":"\u2256","eqcolon":"\u2255","eqsim":"\u2242","eqslantgtr":"\u2A96","eqslantless":"\u2A95","Equal":"\u2A75","equals":"=","EqualTilde":"\u2242","equest":"\u225F","Equilibrium":"\u21CC","equiv":"\u2261","equivDD":"\u2A78","eqvparsl":"\u29E5","erarr":"\u2971","erDot":"\u2253","escr":"\u212F","Escr":"\u2130","esdot":"\u2250","Esim":"\u2A73","esim":"\u2242","Eta":"\u0397","eta":"\u03B7","ETH":"\u00D0","eth":"\u00F0","Euml":"\u00CB","euml":"\u00EB","euro":"\u20AC","excl":"!","exist":"\u2203","Exists":"\u2203","expectation":"\u2130","exponentiale":"\u2147","ExponentialE":"\u2147","fallingdotseq":"\u2252","Fcy":"\u0424","fcy":"\u0444","female":"\u2640","ffilig":"\uFB03","fflig":"\uFB00","ffllig":"\uFB04","Ffr":"\uD835\uDD09","ffr":"\uD835\uDD23","filig":"\uFB01","FilledSmallSquare":"\u25FC","FilledVerySmallSquare":"\u25AA","fjlig":"fj","flat":"\u266D","fllig":"\uFB02","fltns":"\u25B1","fnof":"\u0192","Fopf":"\uD835\uDD3D","fopf":"\uD835\uDD57","forall":"\u2200","ForAll":"\u2200","fork":"\u22D4","forkv":"\u2AD9","Fouriertrf":"\u2131","fpartint":"\u2A0D","frac12":"\u00BD","frac13":"\u2153","frac14":"\u00BC","frac15":"\u2155","frac16":"\u2159","frac18":"\u215B","frac23":"\u2154","frac25":"\u2156","frac34":"\u00BE","frac35":"\u2157","frac38":"\u215C","frac45":"\u2158","frac56":"\u215A","frac58":"\u215D","frac78":"\u215E","frasl":"\u2044","frown":"\u2322","fscr":"\uD835\uDCBB","Fscr":"\u2131","gacute":"\u01F5","Gamma":"\u0393","gamma":"\u03B3","Gammad":"\u03DC","gammad":"\u03DD","gap":"\u2A86","Gbreve":"\u011E","gbreve":"\u011F","Gcedil":"\u0122","Gcirc":"\u011C","gcirc":"\u011D","Gcy":"\u0413","gcy":"\u0433","Gdot":"\u0120","gdot":"\u0121","ge":"\u2265","gE":"\u2267","gEl":"\u2A8C","gel":"\u22DB","geq":"\u2265","geqq":"\u2267","geqslant":"\u2A7E","gescc":"\u2AA9","ges":"\u2A7E","gesdot":"\u2A80","gesdoto":"\u2A82","gesdotol":"\u2A84","gesl":"\u22DB\uFE00","gesles":"\u2A94","Gfr":"\uD835\uDD0A","gfr":"\uD835\uDD24","gg":"\u226B","Gg":"\u22D9","ggg":"\u22D9","gimel":"\u2137","GJcy":"\u0403","gjcy":"\u0453","gla":"\u2AA5","gl":"\u2277","glE":"\u2A92","glj":"\u2AA4","gnap":"\u2A8A","gnapprox":"\u2A8A","gne":"\u2A88","gnE":"\u2269","gneq":"\u2A88","gneqq":"\u2269","gnsim":"\u22E7","Gopf":"\uD835\uDD3E","gopf":"\uD835\uDD58","grave":"`","GreaterEqual":"\u2265","GreaterEqualLess":"\u22DB","GreaterFullEqual":"\u2267","GreaterGreater":"\u2AA2","GreaterLess":"\u2277","GreaterSlantEqual":"\u2A7E","GreaterTilde":"\u2273","Gscr":"\uD835\uDCA2","gscr":"\u210A","gsim":"\u2273","gsime":"\u2A8E","gsiml":"\u2A90","gtcc":"\u2AA7","gtcir":"\u2A7A","gt":">","GT":">","Gt":"\u226B","gtdot":"\u22D7","gtlPar":"\u2995","gtquest":"\u2A7C","gtrapprox":"\u2A86","gtrarr":"\u2978","gtrdot":"\u22D7","gtreqless":"\u22DB","gtreqqless":"\u2A8C","gtrless":"\u2277","gtrsim":"\u2273","gvertneqq":"\u2269\uFE00","gvnE":"\u2269\uFE00","Hacek":"\u02C7","hairsp":"\u200A","half":"\u00BD","hamilt":"\u210B","HARDcy":"\u042A","hardcy":"\u044A","harrcir":"\u2948","harr":"\u2194","hArr":"\u21D4","harrw":"\u21AD","Hat":"^","hbar":"\u210F","Hcirc":"\u0124","hcirc":"\u0125","hearts":"\u2665","heartsuit":"\u2665","hellip":"\u2026","hercon":"\u22B9","hfr":"\uD835\uDD25","Hfr":"\u210C","HilbertSpace":"\u210B","hksearow":"\u2925","hkswarow":"\u2926","hoarr":"\u21FF","homtht":"\u223B","hookleftarrow":"\u21A9","hookrightarrow":"\u21AA","hopf":"\uD835\uDD59","Hopf":"\u210D","horbar":"\u2015","HorizontalLine":"\u2500","hscr":"\uD835\uDCBD","Hscr":"\u210B","hslash":"\u210F","Hstrok":"\u0126","hstrok":"\u0127","HumpDownHump":"\u224E","HumpEqual":"\u224F","hybull":"\u2043","hyphen":"\u2010","Iacute":"\u00CD","iacute":"\u00ED","ic":"\u2063","Icirc":"\u00CE","icirc":"\u00EE","Icy":"\u0418","icy":"\u0438","Idot":"\u0130","IEcy":"\u0415","iecy":"\u0435","iexcl":"\u00A1","iff":"\u21D4","ifr":"\uD835\uDD26","Ifr":"\u2111","Igrave":"\u00CC","igrave":"\u00EC","ii":"\u2148","iiiint":"\u2A0C","iiint":"\u222D","iinfin":"\u29DC","iiota":"\u2129","IJlig":"\u0132","ijlig":"\u0133","Imacr":"\u012A","imacr":"\u012B","image":"\u2111","ImaginaryI":"\u2148","imagline":"\u2110","imagpart":"\u2111","imath":"\u0131","Im":"\u2111","imof":"\u22B7","imped":"\u01B5","Implies":"\u21D2","incare":"\u2105","in":"\u2208","infin":"\u221E","infintie":"\u29DD","inodot":"\u0131","intcal":"\u22BA","int":"\u222B","Int":"\u222C","integers":"\u2124","Integral":"\u222B","intercal":"\u22BA","Intersection":"\u22C2","intlarhk":"\u2A17","intprod":"\u2A3C","InvisibleComma":"\u2063","InvisibleTimes":"\u2062","IOcy":"\u0401","iocy":"\u0451","Iogon":"\u012E","iogon":"\u012F","Iopf":"\uD835\uDD40","iopf":"\uD835\uDD5A","Iota":"\u0399","iota":"\u03B9","iprod":"\u2A3C","iquest":"\u00BF","iscr":"\uD835\uDCBE","Iscr":"\u2110","isin":"\u2208","isindot":"\u22F5","isinE":"\u22F9","isins":"\u22F4","isinsv":"\u22F3","isinv":"\u2208","it":"\u2062","Itilde":"\u0128","itilde":"\u0129","Iukcy":"\u0406","iukcy":"\u0456","Iuml":"\u00CF","iuml":"\u00EF","Jcirc":"\u0134","jcirc":"\u0135","Jcy":"\u0419","jcy":"\u0439","Jfr":"\uD835\uDD0D","jfr":"\uD835\uDD27","jmath":"\u0237","Jopf":"\uD835\uDD41","jopf":"\uD835\uDD5B","Jscr":"\uD835\uDCA5","jscr":"\uD835\uDCBF","Jsercy":"\u0408","jsercy":"\u0458","Jukcy":"\u0404","jukcy":"\u0454","Kappa":"\u039A","kappa":"\u03BA","kappav":"\u03F0","Kcedil":"\u0136","kcedil":"\u0137","Kcy":"\u041A","kcy":"\u043A","Kfr":"\uD835\uDD0E","kfr":"\uD835\uDD28","kgreen":"\u0138","KHcy":"\u0425","khcy":"\u0445","KJcy":"\u040C","kjcy":"\u045C","Kopf":"\uD835\uDD42","kopf":"\uD835\uDD5C","Kscr":"\uD835\uDCA6","kscr":"\uD835\uDCC0","lAarr":"\u21DA","Lacute":"\u0139","lacute":"\u013A","laemptyv":"\u29B4","lagran":"\u2112","Lambda":"\u039B","lambda":"\u03BB","lang":"\u27E8","Lang":"\u27EA","langd":"\u2991","langle":"\u27E8","lap":"\u2A85","Laplacetrf":"\u2112","laquo":"\u00AB","larrb":"\u21E4","larrbfs":"\u291F","larr":"\u2190","Larr":"\u219E","lArr":"\u21D0","larrfs":"\u291D","larrhk":"\u21A9","larrlp":"\u21AB","larrpl":"\u2939","larrsim":"\u2973","larrtl":"\u21A2","latail":"\u2919","lAtail":"\u291B","lat":"\u2AAB","late":"\u2AAD","lates":"\u2AAD\uFE00","lbarr":"\u290C","lBarr":"\u290E","lbbrk":"\u2772","lbrace":"{","lbrack":"[","lbrke":"\u298B","lbrksld":"\u298F","lbrkslu":"\u298D","Lcaron":"\u013D","lcaron":"\u013E","Lcedil":"\u013B","lcedil":"\u013C","lceil":"\u2308","lcub":"{","Lcy":"\u041B","lcy":"\u043B","ldca":"\u2936","ldquo":"\u201C","ldquor":"\u201E","ldrdhar":"\u2967","ldrushar":"\u294B","ldsh":"\u21B2","le":"\u2264","lE":"\u2266","LeftAngleBracket":"\u27E8","LeftArrowBar":"\u21E4","leftarrow":"\u2190","LeftArrow":"\u2190","Leftarrow":"\u21D0","LeftArrowRightArrow":"\u21C6","leftarrowtail":"\u21A2","LeftCeiling":"\u2308","LeftDoubleBracket":"\u27E6","LeftDownTeeVector":"\u2961","LeftDownVectorBar":"\u2959","LeftDownVector":"\u21C3","LeftFloor":"\u230A","leftharpoondown":"\u21BD","leftharpoonup":"\u21BC","leftleftarrows":"\u21C7","leftrightarrow":"\u2194","LeftRightArrow":"\u2194","Leftrightarrow":"\u21D4","leftrightarrows":"\u21C6","leftrightharpoons":"\u21CB","leftrightsquigarrow":"\u21AD","LeftRightVector":"\u294E","LeftTeeArrow":"\u21A4","LeftTee":"\u22A3","LeftTeeVector":"\u295A","leftthreetimes":"\u22CB","LeftTriangleBar":"\u29CF","LeftTriangle":"\u22B2","LeftTriangleEqual":"\u22B4","LeftUpDownVector":"\u2951","LeftUpTeeVector":"\u2960","LeftUpVectorBar":"\u2958","LeftUpVector":"\u21BF","LeftVectorBar":"\u2952","LeftVector":"\u21BC","lEg":"\u2A8B","leg":"\u22DA","leq":"\u2264","leqq":"\u2266","leqslant":"\u2A7D","lescc":"\u2AA8","les":"\u2A7D","lesdot":"\u2A7F","lesdoto":"\u2A81","lesdotor":"\u2A83","lesg":"\u22DA\uFE00","lesges":"\u2A93","lessapprox":"\u2A85","lessdot":"\u22D6","lesseqgtr":"\u22DA","lesseqqgtr":"\u2A8B","LessEqualGreater":"\u22DA","LessFullEqual":"\u2266","LessGreater":"\u2276","lessgtr":"\u2276","LessLess":"\u2AA1","lesssim":"\u2272","LessSlantEqual":"\u2A7D","LessTilde":"\u2272","lfisht":"\u297C","lfloor":"\u230A","Lfr":"\uD835\uDD0F","lfr":"\uD835\uDD29","lg":"\u2276","lgE":"\u2A91","lHar":"\u2962","lhard":"\u21BD","lharu":"\u21BC","lharul":"\u296A","lhblk":"\u2584","LJcy":"\u0409","ljcy":"\u0459","llarr":"\u21C7","ll":"\u226A","Ll":"\u22D8","llcorner":"\u231E","Lleftarrow":"\u21DA","llhard":"\u296B","lltri":"\u25FA","Lmidot":"\u013F","lmidot":"\u0140","lmoustache":"\u23B0","lmoust":"\u23B0","lnap":"\u2A89","lnapprox":"\u2A89","lne":"\u2A87","lnE":"\u2268","lneq":"\u2A87","lneqq":"\u2268","lnsim":"\u22E6","loang":"\u27EC","loarr":"\u21FD","lobrk":"\u27E6","longleftarrow":"\u27F5","LongLeftArrow":"\u27F5","Longleftarrow":"\u27F8","longleftrightarrow":"\u27F7","LongLeftRightArrow":"\u27F7","Longleftrightarrow":"\u27FA","longmapsto":"\u27FC","longrightarrow":"\u27F6","LongRightArrow":"\u27F6","Longrightarrow":"\u27F9","looparrowleft":"\u21AB","looparrowright":"\u21AC","lopar":"\u2985","Lopf":"\uD835\uDD43","lopf":"\uD835\uDD5D","loplus":"\u2A2D","lotimes":"\u2A34","lowast":"\u2217","lowbar":"_","LowerLeftArrow":"\u2199","LowerRightArrow":"\u2198","loz":"\u25CA","lozenge":"\u25CA","lozf":"\u29EB","lpar":"(","lparlt":"\u2993","lrarr":"\u21C6","lrcorner":"\u231F","lrhar":"\u21CB","lrhard":"\u296D","lrm":"\u200E","lrtri":"\u22BF","lsaquo":"\u2039","lscr":"\uD835\uDCC1","Lscr":"\u2112","lsh":"\u21B0","Lsh":"\u21B0","lsim":"\u2272","lsime":"\u2A8D","lsimg":"\u2A8F","lsqb":"[","lsquo":"\u2018","lsquor":"\u201A","Lstrok":"\u0141","lstrok":"\u0142","ltcc":"\u2AA6","ltcir":"\u2A79","lt":"<","LT":"<","Lt":"\u226A","ltdot":"\u22D6","lthree":"\u22CB","ltimes":"\u22C9","ltlarr":"\u2976","ltquest":"\u2A7B","ltri":"\u25C3","ltrie":"\u22B4","ltrif":"\u25C2","ltrPar":"\u2996","lurdshar":"\u294A","luruhar":"\u2966","lvertneqq":"\u2268\uFE00","lvnE":"\u2268\uFE00","macr":"\u00AF","male":"\u2642","malt":"\u2720","maltese":"\u2720","Map":"\u2905","map":"\u21A6","mapsto":"\u21A6","mapstodown":"\u21A7","mapstoleft":"\u21A4","mapstoup":"\u21A5","marker":"\u25AE","mcomma":"\u2A29","Mcy":"\u041C","mcy":"\u043C","mdash":"\u2014","mDDot":"\u223A","measuredangle":"\u2221","MediumSpace":"\u205F","Mellintrf":"\u2133","Mfr":"\uD835\uDD10","mfr":"\uD835\uDD2A","mho":"\u2127","micro":"\u00B5","midast":"*","midcir":"\u2AF0","mid":"\u2223","middot":"\u00B7","minusb":"\u229F","minus":"\u2212","minusd":"\u2238","minusdu":"\u2A2A","MinusPlus":"\u2213","mlcp":"\u2ADB","mldr":"\u2026","mnplus":"\u2213","models":"\u22A7","Mopf":"\uD835\uDD44","mopf":"\uD835\uDD5E","mp":"\u2213","mscr":"\uD835\uDCC2","Mscr":"\u2133","mstpos":"\u223E","Mu":"\u039C","mu":"\u03BC","multimap":"\u22B8","mumap":"\u22B8","nabla":"\u2207","Nacute":"\u0143","nacute":"\u0144","nang":"\u2220\u20D2","nap":"\u2249","napE":"\u2A70\u0338","napid":"\u224B\u0338","napos":"\u0149","napprox":"\u2249","natural":"\u266E","naturals":"\u2115","natur":"\u266E","nbsp":"\u00A0","nbump":"\u224E\u0338","nbumpe":"\u224F\u0338","ncap":"\u2A43","Ncaron":"\u0147","ncaron":"\u0148","Ncedil":"\u0145","ncedil":"\u0146","ncong":"\u2247","ncongdot":"\u2A6D\u0338","ncup":"\u2A42","Ncy":"\u041D","ncy":"\u043D","ndash":"\u2013","nearhk":"\u2924","nearr":"\u2197","neArr":"\u21D7","nearrow":"\u2197","ne":"\u2260","nedot":"\u2250\u0338","NegativeMediumSpace":"\u200B","NegativeThickSpace":"\u200B","NegativeThinSpace":"\u200B","NegativeVeryThinSpace":"\u200B","nequiv":"\u2262","nesear":"\u2928","nesim":"\u2242\u0338","NestedGreaterGreater":"\u226B","NestedLessLess":"\u226A","NewLine":"\n","nexist":"\u2204","nexists":"\u2204","Nfr":"\uD835\uDD11","nfr":"\uD835\uDD2B","ngE":"\u2267\u0338","nge":"\u2271","ngeq":"\u2271","ngeqq":"\u2267\u0338","ngeqslant":"\u2A7E\u0338","nges":"\u2A7E\u0338","nGg":"\u22D9\u0338","ngsim":"\u2275","nGt":"\u226B\u20D2","ngt":"\u226F","ngtr":"\u226F","nGtv":"\u226B\u0338","nharr":"\u21AE","nhArr":"\u21CE","nhpar":"\u2AF2","ni":"\u220B","nis":"\u22FC","nisd":"\u22FA","niv":"\u220B","NJcy":"\u040A","njcy":"\u045A","nlarr":"\u219A","nlArr":"\u21CD","nldr":"\u2025","nlE":"\u2266\u0338","nle":"\u2270","nleftarrow":"\u219A","nLeftarrow":"\u21CD","nleftrightarrow":"\u21AE","nLeftrightarrow":"\u21CE","nleq":"\u2270","nleqq":"\u2266\u0338","nleqslant":"\u2A7D\u0338","nles":"\u2A7D\u0338","nless":"\u226E","nLl":"\u22D8\u0338","nlsim":"\u2274","nLt":"\u226A\u20D2","nlt":"\u226E","nltri":"\u22EA","nltrie":"\u22EC","nLtv":"\u226A\u0338","nmid":"\u2224","NoBreak":"\u2060","NonBreakingSpace":"\u00A0","nopf":"\uD835\uDD5F","Nopf":"\u2115","Not":"\u2AEC","not":"\u00AC","NotCongruent":"\u2262","NotCupCap":"\u226D","NotDoubleVerticalBar":"\u2226","NotElement":"\u2209","NotEqual":"\u2260","NotEqualTilde":"\u2242\u0338","NotExists":"\u2204","NotGreater":"\u226F","NotGreaterEqual":"\u2271","NotGreaterFullEqual":"\u2267\u0338","NotGreaterGreater":"\u226B\u0338","NotGreaterLess":"\u2279","NotGreaterSlantEqual":"\u2A7E\u0338","NotGreaterTilde":"\u2275","NotHumpDownHump":"\u224E\u0338","NotHumpEqual":"\u224F\u0338","notin":"\u2209","notindot":"\u22F5\u0338","notinE":"\u22F9\u0338","notinva":"\u2209","notinvb":"\u22F7","notinvc":"\u22F6","NotLeftTriangleBar":"\u29CF\u0338","NotLeftTriangle":"\u22EA","NotLeftTriangleEqual":"\u22EC","NotLess":"\u226E","NotLessEqual":"\u2270","NotLessGreater":"\u2278","NotLessLess":"\u226A\u0338","NotLessSlantEqual":"\u2A7D\u0338","NotLessTilde":"\u2274","NotNestedGreaterGreater":"\u2AA2\u0338","NotNestedLessLess":"\u2AA1\u0338","notni":"\u220C","notniva":"\u220C","notnivb":"\u22FE","notnivc":"\u22FD","NotPrecedes":"\u2280","NotPrecedesEqual":"\u2AAF\u0338","NotPrecedesSlantEqual":"\u22E0","NotReverseElement":"\u220C","NotRightTriangleBar":"\u29D0\u0338","NotRightTriangle":"\u22EB","NotRightTriangleEqual":"\u22ED","NotSquareSubset":"\u228F\u0338","NotSquareSubsetEqual":"\u22E2","NotSquareSuperset":"\u2290\u0338","NotSquareSupersetEqual":"\u22E3","NotSubset":"\u2282\u20D2","NotSubsetEqual":"\u2288","NotSucceeds":"\u2281","NotSucceedsEqual":"\u2AB0\u0338","NotSucceedsSlantEqual":"\u22E1","NotSucceedsTilde":"\u227F\u0338","NotSuperset":"\u2283\u20D2","NotSupersetEqual":"\u2289","NotTilde":"\u2241","NotTildeEqual":"\u2244","NotTildeFullEqual":"\u2247","NotTildeTilde":"\u2249","NotVerticalBar":"\u2224","nparallel":"\u2226","npar":"\u2226","nparsl":"\u2AFD\u20E5","npart":"\u2202\u0338","npolint":"\u2A14","npr":"\u2280","nprcue":"\u22E0","nprec":"\u2280","npreceq":"\u2AAF\u0338","npre":"\u2AAF\u0338","nrarrc":"\u2933\u0338","nrarr":"\u219B","nrArr":"\u21CF","nrarrw":"\u219D\u0338","nrightarrow":"\u219B","nRightarrow":"\u21CF","nrtri":"\u22EB","nrtrie":"\u22ED","nsc":"\u2281","nsccue":"\u22E1","nsce":"\u2AB0\u0338","Nscr":"\uD835\uDCA9","nscr":"\uD835\uDCC3","nshortmid":"\u2224","nshortparallel":"\u2226","nsim":"\u2241","nsime":"\u2244","nsimeq":"\u2244","nsmid":"\u2224","nspar":"\u2226","nsqsube":"\u22E2","nsqsupe":"\u22E3","nsub":"\u2284","nsubE":"\u2AC5\u0338","nsube":"\u2288","nsubset":"\u2282\u20D2","nsubseteq":"\u2288","nsubseteqq":"\u2AC5\u0338","nsucc":"\u2281","nsucceq":"\u2AB0\u0338","nsup":"\u2285","nsupE":"\u2AC6\u0338","nsupe":"\u2289","nsupset":"\u2283\u20D2","nsupseteq":"\u2289","nsupseteqq":"\u2AC6\u0338","ntgl":"\u2279","Ntilde":"\u00D1","ntilde":"\u00F1","ntlg":"\u2278","ntriangleleft":"\u22EA","ntrianglelefteq":"\u22EC","ntriangleright":"\u22EB","ntrianglerighteq":"\u22ED","Nu":"\u039D","nu":"\u03BD","num":"#","numero":"\u2116","numsp":"\u2007","nvap":"\u224D\u20D2","nvdash":"\u22AC","nvDash":"\u22AD","nVdash":"\u22AE","nVDash":"\u22AF","nvge":"\u2265\u20D2","nvgt":">\u20D2","nvHarr":"\u2904","nvinfin":"\u29DE","nvlArr":"\u2902","nvle":"\u2264\u20D2","nvlt":"<\u20D2","nvltrie":"\u22B4\u20D2","nvrArr":"\u2903","nvrtrie":"\u22B5\u20D2","nvsim":"\u223C\u20D2","nwarhk":"\u2923","nwarr":"\u2196","nwArr":"\u21D6","nwarrow":"\u2196","nwnear":"\u2927","Oacute":"\u00D3","oacute":"\u00F3","oast":"\u229B","Ocirc":"\u00D4","ocirc":"\u00F4","ocir":"\u229A","Ocy":"\u041E","ocy":"\u043E","odash":"\u229D","Odblac":"\u0150","odblac":"\u0151","odiv":"\u2A38","odot":"\u2299","odsold":"\u29BC","OElig":"\u0152","oelig":"\u0153","ofcir":"\u29BF","Ofr":"\uD835\uDD12","ofr":"\uD835\uDD2C","ogon":"\u02DB","Ograve":"\u00D2","ograve":"\u00F2","ogt":"\u29C1","ohbar":"\u29B5","ohm":"\u03A9","oint":"\u222E","olarr":"\u21BA","olcir":"\u29BE","olcross":"\u29BB","oline":"\u203E","olt":"\u29C0","Omacr":"\u014C","omacr":"\u014D","Omega":"\u03A9","omega":"\u03C9","Omicron":"\u039F","omicron":"\u03BF","omid":"\u29B6","ominus":"\u2296","Oopf":"\uD835\uDD46","oopf":"\uD835\uDD60","opar":"\u29B7","OpenCurlyDoubleQuote":"\u201C","OpenCurlyQuote":"\u2018","operp":"\u29B9","oplus":"\u2295","orarr":"\u21BB","Or":"\u2A54","or":"\u2228","ord":"\u2A5D","order":"\u2134","orderof":"\u2134","ordf":"\u00AA","ordm":"\u00BA","origof":"\u22B6","oror":"\u2A56","orslope":"\u2A57","orv":"\u2A5B","oS":"\u24C8","Oscr":"\uD835\uDCAA","oscr":"\u2134","Oslash":"\u00D8","oslash":"\u00F8","osol":"\u2298","Otilde":"\u00D5","otilde":"\u00F5","otimesas":"\u2A36","Otimes":"\u2A37","otimes":"\u2297","Ouml":"\u00D6","ouml":"\u00F6","ovbar":"\u233D","OverBar":"\u203E","OverBrace":"\u23DE","OverBracket":"\u23B4","OverParenthesis":"\u23DC","para":"\u00B6","parallel":"\u2225","par":"\u2225","parsim":"\u2AF3","parsl":"\u2AFD","part":"\u2202","PartialD":"\u2202","Pcy":"\u041F","pcy":"\u043F","percnt":"%","period":".","permil":"\u2030","perp":"\u22A5","pertenk":"\u2031","Pfr":"\uD835\uDD13","pfr":"\uD835\uDD2D","Phi":"\u03A6","phi":"\u03C6","phiv":"\u03D5","phmmat":"\u2133","phone":"\u260E","Pi":"\u03A0","pi":"\u03C0","pitchfork":"\u22D4","piv":"\u03D6","planck":"\u210F","planckh":"\u210E","plankv":"\u210F","plusacir":"\u2A23","plusb":"\u229E","pluscir":"\u2A22","plus":"+","plusdo":"\u2214","plusdu":"\u2A25","pluse":"\u2A72","PlusMinus":"\u00B1","plusmn":"\u00B1","plussim":"\u2A26","plustwo":"\u2A27","pm":"\u00B1","Poincareplane":"\u210C","pointint":"\u2A15","popf":"\uD835\uDD61","Popf":"\u2119","pound":"\u00A3","prap":"\u2AB7","Pr":"\u2ABB","pr":"\u227A","prcue":"\u227C","precapprox":"\u2AB7","prec":"\u227A","preccurlyeq":"\u227C","Precedes":"\u227A","PrecedesEqual":"\u2AAF","PrecedesSlantEqual":"\u227C","PrecedesTilde":"\u227E","preceq":"\u2AAF","precnapprox":"\u2AB9","precneqq":"\u2AB5","precnsim":"\u22E8","pre":"\u2AAF","prE":"\u2AB3","precsim":"\u227E","prime":"\u2032","Prime":"\u2033","primes":"\u2119","prnap":"\u2AB9","prnE":"\u2AB5","prnsim":"\u22E8","prod":"\u220F","Product":"\u220F","profalar":"\u232E","profline":"\u2312","profsurf":"\u2313","prop":"\u221D","Proportional":"\u221D","Proportion":"\u2237","propto":"\u221D","prsim":"\u227E","prurel":"\u22B0","Pscr":"\uD835\uDCAB","pscr":"\uD835\uDCC5","Psi":"\u03A8","psi":"\u03C8","puncsp":"\u2008","Qfr":"\uD835\uDD14","qfr":"\uD835\uDD2E","qint":"\u2A0C","qopf":"\uD835\uDD62","Qopf":"\u211A","qprime":"\u2057","Qscr":"\uD835\uDCAC","qscr":"\uD835\uDCC6","quaternions":"\u210D","quatint":"\u2A16","quest":"?","questeq":"\u225F","quot":"\"","QUOT":"\"","rAarr":"\u21DB","race":"\u223D\u0331","Racute":"\u0154","racute":"\u0155","radic":"\u221A","raemptyv":"\u29B3","rang":"\u27E9","Rang":"\u27EB","rangd":"\u2992","range":"\u29A5","rangle":"\u27E9","raquo":"\u00BB","rarrap":"\u2975","rarrb":"\u21E5","rarrbfs":"\u2920","rarrc":"\u2933","rarr":"\u2192","Rarr":"\u21A0","rArr":"\u21D2","rarrfs":"\u291E","rarrhk":"\u21AA","rarrlp":"\u21AC","rarrpl":"\u2945","rarrsim":"\u2974","Rarrtl":"\u2916","rarrtl":"\u21A3","rarrw":"\u219D","ratail":"\u291A","rAtail":"\u291C","ratio":"\u2236","rationals":"\u211A","rbarr":"\u290D","rBarr":"\u290F","RBarr":"\u2910","rbbrk":"\u2773","rbrace":"}","rbrack":"]","rbrke":"\u298C","rbrksld":"\u298E","rbrkslu":"\u2990","Rcaron":"\u0158","rcaron":"\u0159","Rcedil":"\u0156","rcedil":"\u0157","rceil":"\u2309","rcub":"}","Rcy":"\u0420","rcy":"\u0440","rdca":"\u2937","rdldhar":"\u2969","rdquo":"\u201D","rdquor":"\u201D","rdsh":"\u21B3","real":"\u211C","realine":"\u211B","realpart":"\u211C","reals":"\u211D","Re":"\u211C","rect":"\u25AD","reg":"\u00AE","REG":"\u00AE","ReverseElement":"\u220B","ReverseEquilibrium":"\u21CB","ReverseUpEquilibrium":"\u296F","rfisht":"\u297D","rfloor":"\u230B","rfr":"\uD835\uDD2F","Rfr":"\u211C","rHar":"\u2964","rhard":"\u21C1","rharu":"\u21C0","rharul":"\u296C","Rho":"\u03A1","rho":"\u03C1","rhov":"\u03F1","RightAngleBracket":"\u27E9","RightArrowBar":"\u21E5","rightarrow":"\u2192","RightArrow":"\u2192","Rightarrow":"\u21D2","RightArrowLeftArrow":"\u21C4","rightarrowtail":"\u21A3","RightCeiling":"\u2309","RightDoubleBracket":"\u27E7","RightDownTeeVector":"\u295D","RightDownVectorBar":"\u2955","RightDownVector":"\u21C2","RightFloor":"\u230B","rightharpoondown":"\u21C1","rightharpoonup":"\u21C0","rightleftarrows":"\u21C4","rightleftharpoons":"\u21CC","rightrightarrows":"\u21C9","rightsquigarrow":"\u219D","RightTeeArrow":"\u21A6","RightTee":"\u22A2","RightTeeVector":"\u295B","rightthreetimes":"\u22CC","RightTriangleBar":"\u29D0","RightTriangle":"\u22B3","RightTriangleEqual":"\u22B5","RightUpDownVector":"\u294F","RightUpTeeVector":"\u295C","RightUpVectorBar":"\u2954","RightUpVector":"\u21BE","RightVectorBar":"\u2953","RightVector":"\u21C0","ring":"\u02DA","risingdotseq":"\u2253","rlarr":"\u21C4","rlhar":"\u21CC","rlm":"\u200F","rmoustache":"\u23B1","rmoust":"\u23B1","rnmid":"\u2AEE","roang":"\u27ED","roarr":"\u21FE","robrk":"\u27E7","ropar":"\u2986","ropf":"\uD835\uDD63","Ropf":"\u211D","roplus":"\u2A2E","rotimes":"\u2A35","RoundImplies":"\u2970","rpar":")","rpargt":"\u2994","rppolint":"\u2A12","rrarr":"\u21C9","Rrightarrow":"\u21DB","rsaquo":"\u203A","rscr":"\uD835\uDCC7","Rscr":"\u211B","rsh":"\u21B1","Rsh":"\u21B1","rsqb":"]","rsquo":"\u2019","rsquor":"\u2019","rthree":"\u22CC","rtimes":"\u22CA","rtri":"\u25B9","rtrie":"\u22B5","rtrif":"\u25B8","rtriltri":"\u29CE","RuleDelayed":"\u29F4","ruluhar":"\u2968","rx":"\u211E","Sacute":"\u015A","sacute":"\u015B","sbquo":"\u201A","scap":"\u2AB8","Scaron":"\u0160","scaron":"\u0161","Sc":"\u2ABC","sc":"\u227B","sccue":"\u227D","sce":"\u2AB0","scE":"\u2AB4","Scedil":"\u015E","scedil":"\u015F","Scirc":"\u015C","scirc":"\u015D","scnap":"\u2ABA","scnE":"\u2AB6","scnsim":"\u22E9","scpolint":"\u2A13","scsim":"\u227F","Scy":"\u0421","scy":"\u0441","sdotb":"\u22A1","sdot":"\u22C5","sdote":"\u2A66","searhk":"\u2925","searr":"\u2198","seArr":"\u21D8","searrow":"\u2198","sect":"\u00A7","semi":";","seswar":"\u2929","setminus":"\u2216","setmn":"\u2216","sext":"\u2736","Sfr":"\uD835\uDD16","sfr":"\uD835\uDD30","sfrown":"\u2322","sharp":"\u266F","SHCHcy":"\u0429","shchcy":"\u0449","SHcy":"\u0428","shcy":"\u0448","ShortDownArrow":"\u2193","ShortLeftArrow":"\u2190","shortmid":"\u2223","shortparallel":"\u2225","ShortRightArrow":"\u2192","ShortUpArrow":"\u2191","shy":"\u00AD","Sigma":"\u03A3","sigma":"\u03C3","sigmaf":"\u03C2","sigmav":"\u03C2","sim":"\u223C","simdot":"\u2A6A","sime":"\u2243","simeq":"\u2243","simg":"\u2A9E","simgE":"\u2AA0","siml":"\u2A9D","simlE":"\u2A9F","simne":"\u2246","simplus":"\u2A24","simrarr":"\u2972","slarr":"\u2190","SmallCircle":"\u2218","smallsetminus":"\u2216","smashp":"\u2A33","smeparsl":"\u29E4","smid":"\u2223","smile":"\u2323","smt":"\u2AAA","smte":"\u2AAC","smtes":"\u2AAC\uFE00","SOFTcy":"\u042C","softcy":"\u044C","solbar":"\u233F","solb":"\u29C4","sol":"/","Sopf":"\uD835\uDD4A","sopf":"\uD835\uDD64","spades":"\u2660","spadesuit":"\u2660","spar":"\u2225","sqcap":"\u2293","sqcaps":"\u2293\uFE00","sqcup":"\u2294","sqcups":"\u2294\uFE00","Sqrt":"\u221A","sqsub":"\u228F","sqsube":"\u2291","sqsubset":"\u228F","sqsubseteq":"\u2291","sqsup":"\u2290","sqsupe":"\u2292","sqsupset":"\u2290","sqsupseteq":"\u2292","square":"\u25A1","Square":"\u25A1","SquareIntersection":"\u2293","SquareSubset":"\u228F","SquareSubsetEqual":"\u2291","SquareSuperset":"\u2290","SquareSupersetEqual":"\u2292","SquareUnion":"\u2294","squarf":"\u25AA","squ":"\u25A1","squf":"\u25AA","srarr":"\u2192","Sscr":"\uD835\uDCAE","sscr":"\uD835\uDCC8","ssetmn":"\u2216","ssmile":"\u2323","sstarf":"\u22C6","Star":"\u22C6","star":"\u2606","starf":"\u2605","straightepsilon":"\u03F5","straightphi":"\u03D5","strns":"\u00AF","sub":"\u2282","Sub":"\u22D0","subdot":"\u2ABD","subE":"\u2AC5","sube":"\u2286","subedot":"\u2AC3","submult":"\u2AC1","subnE":"\u2ACB","subne":"\u228A","subplus":"\u2ABF","subrarr":"\u2979","subset":"\u2282","Subset":"\u22D0","subseteq":"\u2286","subseteqq":"\u2AC5","SubsetEqual":"\u2286","subsetneq":"\u228A","subsetneqq":"\u2ACB","subsim":"\u2AC7","subsub":"\u2AD5","subsup":"\u2AD3","succapprox":"\u2AB8","succ":"\u227B","succcurlyeq":"\u227D","Succeeds":"\u227B","SucceedsEqual":"\u2AB0","SucceedsSlantEqual":"\u227D","SucceedsTilde":"\u227F","succeq":"\u2AB0","succnapprox":"\u2ABA","succneqq":"\u2AB6","succnsim":"\u22E9","succsim":"\u227F","SuchThat":"\u220B","sum":"\u2211","Sum":"\u2211","sung":"\u266A","sup1":"\u00B9","sup2":"\u00B2","sup3":"\u00B3","sup":"\u2283","Sup":"\u22D1","supdot":"\u2ABE","supdsub":"\u2AD8","supE":"\u2AC6","supe":"\u2287","supedot":"\u2AC4","Superset":"\u2283","SupersetEqual":"\u2287","suphsol":"\u27C9","suphsub":"\u2AD7","suplarr":"\u297B","supmult":"\u2AC2","supnE":"\u2ACC","supne":"\u228B","supplus":"\u2AC0","supset":"\u2283","Supset":"\u22D1","supseteq":"\u2287","supseteqq":"\u2AC6","supsetneq":"\u228B","supsetneqq":"\u2ACC","supsim":"\u2AC8","supsub":"\u2AD4","supsup":"\u2AD6","swarhk":"\u2926","swarr":"\u2199","swArr":"\u21D9","swarrow":"\u2199","swnwar":"\u292A","szlig":"\u00DF","Tab":"\t","target":"\u2316","Tau":"\u03A4","tau":"\u03C4","tbrk":"\u23B4","Tcaron":"\u0164","tcaron":"\u0165","Tcedil":"\u0162","tcedil":"\u0163","Tcy":"\u0422","tcy":"\u0442","tdot":"\u20DB","telrec":"\u2315","Tfr":"\uD835\uDD17","tfr":"\uD835\uDD31","there4":"\u2234","therefore":"\u2234","Therefore":"\u2234","Theta":"\u0398","theta":"\u03B8","thetasym":"\u03D1","thetav":"\u03D1","thickapprox":"\u2248","thicksim":"\u223C","ThickSpace":"\u205F\u200A","ThinSpace":"\u2009","thinsp":"\u2009","thkap":"\u2248","thksim":"\u223C","THORN":"\u00DE","thorn":"\u00FE","tilde":"\u02DC","Tilde":"\u223C","TildeEqual":"\u2243","TildeFullEqual":"\u2245","TildeTilde":"\u2248","timesbar":"\u2A31","timesb":"\u22A0","times":"\u00D7","timesd":"\u2A30","tint":"\u222D","toea":"\u2928","topbot":"\u2336","topcir":"\u2AF1","top":"\u22A4","Topf":"\uD835\uDD4B","topf":"\uD835\uDD65","topfork":"\u2ADA","tosa":"\u2929","tprime":"\u2034","trade":"\u2122","TRADE":"\u2122","triangle":"\u25B5","triangledown":"\u25BF","triangleleft":"\u25C3","trianglelefteq":"\u22B4","triangleq":"\u225C","triangleright":"\u25B9","trianglerighteq":"\u22B5","tridot":"\u25EC","trie":"\u225C","triminus":"\u2A3A","TripleDot":"\u20DB","triplus":"\u2A39","trisb":"\u29CD","tritime":"\u2A3B","trpezium":"\u23E2","Tscr":"\uD835\uDCAF","tscr":"\uD835\uDCC9","TScy":"\u0426","tscy":"\u0446","TSHcy":"\u040B","tshcy":"\u045B","Tstrok":"\u0166","tstrok":"\u0167","twixt":"\u226C","twoheadleftarrow":"\u219E","twoheadrightarrow":"\u21A0","Uacute":"\u00DA","uacute":"\u00FA","uarr":"\u2191","Uarr":"\u219F","uArr":"\u21D1","Uarrocir":"\u2949","Ubrcy":"\u040E","ubrcy":"\u045E","Ubreve":"\u016C","ubreve":"\u016D","Ucirc":"\u00DB","ucirc":"\u00FB","Ucy":"\u0423","ucy":"\u0443","udarr":"\u21C5","Udblac":"\u0170","udblac":"\u0171","udhar":"\u296E","ufisht":"\u297E","Ufr":"\uD835\uDD18","ufr":"\uD835\uDD32","Ugrave":"\u00D9","ugrave":"\u00F9","uHar":"\u2963","uharl":"\u21BF","uharr":"\u21BE","uhblk":"\u2580","ulcorn":"\u231C","ulcorner":"\u231C","ulcrop":"\u230F","ultri":"\u25F8","Umacr":"\u016A","umacr":"\u016B","uml":"\u00A8","UnderBar":"_","UnderBrace":"\u23DF","UnderBracket":"\u23B5","UnderParenthesis":"\u23DD","Union":"\u22C3","UnionPlus":"\u228E","Uogon":"\u0172","uogon":"\u0173","Uopf":"\uD835\uDD4C","uopf":"\uD835\uDD66","UpArrowBar":"\u2912","uparrow":"\u2191","UpArrow":"\u2191","Uparrow":"\u21D1","UpArrowDownArrow":"\u21C5","updownarrow":"\u2195","UpDownArrow":"\u2195","Updownarrow":"\u21D5","UpEquilibrium":"\u296E","upharpoonleft":"\u21BF","upharpoonright":"\u21BE","uplus":"\u228E","UpperLeftArrow":"\u2196","UpperRightArrow":"\u2197","upsi":"\u03C5","Upsi":"\u03D2","upsih":"\u03D2","Upsilon":"\u03A5","upsilon":"\u03C5","UpTeeArrow":"\u21A5","UpTee":"\u22A5","upuparrows":"\u21C8","urcorn":"\u231D","urcorner":"\u231D","urcrop":"\u230E","Uring":"\u016E","uring":"\u016F","urtri":"\u25F9","Uscr":"\uD835\uDCB0","uscr":"\uD835\uDCCA","utdot":"\u22F0","Utilde":"\u0168","utilde":"\u0169","utri":"\u25B5","utrif":"\u25B4","uuarr":"\u21C8","Uuml":"\u00DC","uuml":"\u00FC","uwangle":"\u29A7","vangrt":"\u299C","varepsilon":"\u03F5","varkappa":"\u03F0","varnothing":"\u2205","varphi":"\u03D5","varpi":"\u03D6","varpropto":"\u221D","varr":"\u2195","vArr":"\u21D5","varrho":"\u03F1","varsigma":"\u03C2","varsubsetneq":"\u228A\uFE00","varsubsetneqq":"\u2ACB\uFE00","varsupsetneq":"\u228B\uFE00","varsupsetneqq":"\u2ACC\uFE00","vartheta":"\u03D1","vartriangleleft":"\u22B2","vartriangleright":"\u22B3","vBar":"\u2AE8","Vbar":"\u2AEB","vBarv":"\u2AE9","Vcy":"\u0412","vcy":"\u0432","vdash":"\u22A2","vDash":"\u22A8","Vdash":"\u22A9","VDash":"\u22AB","Vdashl":"\u2AE6","veebar":"\u22BB","vee":"\u2228","Vee":"\u22C1","veeeq":"\u225A","vellip":"\u22EE","verbar":"|","Verbar":"\u2016","vert":"|","Vert":"\u2016","VerticalBar":"\u2223","VerticalLine":"|","VerticalSeparator":"\u2758","VerticalTilde":"\u2240","VeryThinSpace":"\u200A","Vfr":"\uD835\uDD19","vfr":"\uD835\uDD33","vltri":"\u22B2","vnsub":"\u2282\u20D2","vnsup":"\u2283\u20D2","Vopf":"\uD835\uDD4D","vopf":"\uD835\uDD67","vprop":"\u221D","vrtri":"\u22B3","Vscr":"\uD835\uDCB1","vscr":"\uD835\uDCCB","vsubnE":"\u2ACB\uFE00","vsubne":"\u228A\uFE00","vsupnE":"\u2ACC\uFE00","vsupne":"\u228B\uFE00","Vvdash":"\u22AA","vzigzag":"\u299A","Wcirc":"\u0174","wcirc":"\u0175","wedbar":"\u2A5F","wedge":"\u2227","Wedge":"\u22C0","wedgeq":"\u2259","weierp":"\u2118","Wfr":"\uD835\uDD1A","wfr":"\uD835\uDD34","Wopf":"\uD835\uDD4E","wopf":"\uD835\uDD68","wp":"\u2118","wr":"\u2240","wreath":"\u2240","Wscr":"\uD835\uDCB2","wscr":"\uD835\uDCCC","xcap":"\u22C2","xcirc":"\u25EF","xcup":"\u22C3","xdtri":"\u25BD","Xfr":"\uD835\uDD1B","xfr":"\uD835\uDD35","xharr":"\u27F7","xhArr":"\u27FA","Xi":"\u039E","xi":"\u03BE","xlarr":"\u27F5","xlArr":"\u27F8","xmap":"\u27FC","xnis":"\u22FB","xodot":"\u2A00","Xopf":"\uD835\uDD4F","xopf":"\uD835\uDD69","xoplus":"\u2A01","xotime":"\u2A02","xrarr":"\u27F6","xrArr":"\u27F9","Xscr":"\uD835\uDCB3","xscr":"\uD835\uDCCD","xsqcup":"\u2A06","xuplus":"\u2A04","xutri":"\u25B3","xvee":"\u22C1","xwedge":"\u22C0","Yacute":"\u00DD","yacute":"\u00FD","YAcy":"\u042F","yacy":"\u044F","Ycirc":"\u0176","ycirc":"\u0177","Ycy":"\u042B","ycy":"\u044B","yen":"\u00A5","Yfr":"\uD835\uDD1C","yfr":"\uD835\uDD36","YIcy":"\u0407","yicy":"\u0457","Yopf":"\uD835\uDD50","yopf":"\uD835\uDD6A","Yscr":"\uD835\uDCB4","yscr":"\uD835\uDCCE","YUcy":"\u042E","yucy":"\u044E","yuml":"\u00FF","Yuml":"\u0178","Zacute":"\u0179","zacute":"\u017A","Zcaron":"\u017D","zcaron":"\u017E","Zcy":"\u0417","zcy":"\u0437","Zdot":"\u017B","zdot":"\u017C","zeetrf":"\u2128","ZeroWidthSpace":"\u200B","Zeta":"\u0396","zeta":"\u03B6","zfr":"\uD835\uDD37","Zfr":"\u2128","ZHcy":"\u0416","zhcy":"\u0436","zigrarr":"\u21DD","zopf":"\uD835\uDD6B","Zopf":"\u2124","Zscr":"\uD835\uDCB5","zscr":"\uD835\uDCCF","zwj":"\u200D","zwnj":"\u200C"}
-},{}],89:[function(require,module,exports){
-arguments[4][37][0].apply(exports,arguments)
-},{"./lib":105,"./lib/alg":96,"./lib/json":106,"dup":37}],90:[function(require,module,exports){
-arguments[4][38][0].apply(exports,arguments)
-},{"../lodash":107,"dup":38}],91:[function(require,module,exports){
-var _ = require("../lodash");
-
-module.exports = dfs;
-
-/*
- * A helper that preforms a pre- or post-order traversal on the input graph
- * and returns the nodes in the order they were visited. This algorithm treats
- * the input as undirected.
- *
- * Order must be one of "pre" or "post".
- */
-function dfs(g, vs, order) {
- if (!_.isArray(vs)) {
- vs = [vs];
- }
-
- var acc = [],
- visited = {};
- _.each(vs, function(v) {
- if (!g.hasNode(v)) {
- throw new Error("Graph does not have node: " + v);
- }
-
- doDfs(g, v, order === "post", visited, acc);
- });
- return acc;
-}
-
-function doDfs(g, v, postorder, visited, acc) {
- if (!_.has(visited, v)) {
- visited[v] = true;
-
- if (!postorder) { acc.push(v); }
- _.each(g.neighbors(v), function(w) {
- doDfs(g, w, postorder, visited, acc);
- });
- if (postorder) { acc.push(v); }
- }
-}
-
-},{"../lodash":107}],92:[function(require,module,exports){
-arguments[4][40][0].apply(exports,arguments)
-},{"../lodash":107,"./dijkstra":93,"dup":40}],93:[function(require,module,exports){
-arguments[4][41][0].apply(exports,arguments)
-},{"../data/priority-queue":103,"../lodash":107,"dup":41}],94:[function(require,module,exports){
-arguments[4][42][0].apply(exports,arguments)
-},{"../lodash":107,"./tarjan":101,"dup":42}],95:[function(require,module,exports){
-arguments[4][43][0].apply(exports,arguments)
-},{"../lodash":107,"dup":43}],96:[function(require,module,exports){
-arguments[4][44][0].apply(exports,arguments)
-},{"./components":90,"./dijkstra":93,"./dijkstra-all":92,"./find-cycles":94,"./floyd-warshall":95,"./is-acyclic":97,"./postorder":98,"./preorder":99,"./prim":100,"./tarjan":101,"./topsort":102,"dup":44}],97:[function(require,module,exports){
-arguments[4][45][0].apply(exports,arguments)
-},{"./topsort":102,"dup":45}],98:[function(require,module,exports){
-arguments[4][46][0].apply(exports,arguments)
-},{"./dfs":91,"dup":46}],99:[function(require,module,exports){
-arguments[4][47][0].apply(exports,arguments)
-},{"./dfs":91,"dup":47}],100:[function(require,module,exports){
-arguments[4][48][0].apply(exports,arguments)
-},{"../data/priority-queue":103,"../graph":104,"../lodash":107,"dup":48}],101:[function(require,module,exports){
-arguments[4][49][0].apply(exports,arguments)
-},{"../lodash":107,"dup":49}],102:[function(require,module,exports){
-arguments[4][50][0].apply(exports,arguments)
-},{"../lodash":107,"dup":50}],103:[function(require,module,exports){
-arguments[4][51][0].apply(exports,arguments)
-},{"../lodash":107,"dup":51}],104:[function(require,module,exports){
-"use strict";
-
-var _ = require("./lodash");
-
-module.exports = Graph;
-
-var DEFAULT_EDGE_NAME = "\x00",
- GRAPH_NODE = "\x00",
- EDGE_KEY_DELIM = "\x01";
-
-// Implementation notes:
-//
-// * Node id query functions should return string ids for the nodes
-// * Edge id query functions should return an "edgeObj", edge object, that is
-// composed of enough information to uniquely identify an edge: {v, w, name}.
-// * Internally we use an "edgeId", a stringified form of the edgeObj, to
-// reference edges. This is because we need a performant way to look these
-// edges up and, object properties, which have string keys, are the closest
-// we're going to get to a performant hashtable in JavaScript.
-
-function Graph(opts) {
- this._isDirected = _.has(opts, "directed") ? opts.directed : true;
- this._isMultigraph = _.has(opts, "multigraph") ? opts.multigraph : false;
- this._isCompound = _.has(opts, "compound") ? opts.compound : false;
-
- // Label for the graph itself
- this._label = undefined;
-
- // Defaults to be set when creating a new node
- this._defaultNodeLabelFn = _.constant(undefined);
-
- // Defaults to be set when creating a new edge
- this._defaultEdgeLabelFn = _.constant(undefined);
-
- // v -> label
- this._nodes = {};
-
- if (this._isCompound) {
- // v -> parent
- this._parent = {};
-
- // v -> children
- this._children = {};
- this._children[GRAPH_NODE] = {};
- }
-
- // v -> edgeObj
- this._in = {};
-
- // u -> v -> Number
- this._preds = {};
-
- // v -> edgeObj
- this._out = {};
-
- // v -> w -> Number
- this._sucs = {};
-
- // e -> edgeObj
- this._edgeObjs = {};
-
- // e -> label
- this._edgeLabels = {};
-}
-
-/* Number of nodes in the graph. Should only be changed by the implementation. */
-Graph.prototype._nodeCount = 0;
-
-/* Number of edges in the graph. Should only be changed by the implementation. */
-Graph.prototype._edgeCount = 0;
-
-
-/* === Graph functions ========= */
-
-Graph.prototype.isDirected = function() {
- return this._isDirected;
-};
-
-Graph.prototype.isMultigraph = function() {
- return this._isMultigraph;
-};
-
-Graph.prototype.isCompound = function() {
- return this._isCompound;
-};
-
-Graph.prototype.setGraph = function(label) {
- this._label = label;
- return this;
-};
-
-Graph.prototype.graph = function() {
- return this._label;
-};
-
-
-/* === Node functions ========== */
-
-Graph.prototype.setDefaultNodeLabel = function(newDefault) {
- if (!_.isFunction(newDefault)) {
- newDefault = _.constant(newDefault);
- }
- this._defaultNodeLabelFn = newDefault;
- return this;
-};
-
-Graph.prototype.nodeCount = function() {
- return this._nodeCount;
-};
-
-Graph.prototype.nodes = function() {
- return _.keys(this._nodes);
-};
-
-Graph.prototype.sources = function() {
- return _.filter(this.nodes(), function(v) {
- return _.isEmpty(this._in[v]);
- }, this);
-};
-
-Graph.prototype.sinks = function() {
- return _.filter(this.nodes(), function(v) {
- return _.isEmpty(this._out[v]);
- }, this);
-};
-
-Graph.prototype.setNodes = function(vs, value) {
- var args = arguments;
- _.each(vs, function(v) {
- if (args.length > 1) {
- this.setNode(v, value);
- } else {
- this.setNode(v);
- }
- }, this);
- return this;
-};
-
-Graph.prototype.setNode = function(v, value) {
- if (_.has(this._nodes, v)) {
- if (arguments.length > 1) {
- this._nodes[v] = value;
- }
- return this;
- }
-
- this._nodes[v] = arguments.length > 1 ? value : this._defaultNodeLabelFn(v);
- if (this._isCompound) {
- this._parent[v] = GRAPH_NODE;
- this._children[v] = {};
- this._children[GRAPH_NODE][v] = true;
- }
- this._in[v] = {};
- this._preds[v] = {};
- this._out[v] = {};
- this._sucs[v] = {};
- ++this._nodeCount;
- return this;
-};
-
-Graph.prototype.node = function(v) {
- return this._nodes[v];
-};
-
-Graph.prototype.hasNode = function(v) {
- return _.has(this._nodes, v);
-};
-
-Graph.prototype.removeNode = function(v) {
- var self = this;
- if (_.has(this._nodes, v)) {
- var removeEdge = function(e) { self.removeEdge(self._edgeObjs[e]); };
- delete this._nodes[v];
- if (this._isCompound) {
- this._removeFromParentsChildList(v);
- delete this._parent[v];
- _.each(this.children(v), function(child) {
- this.setParent(child);
- }, this);
- delete this._children[v];
- }
- _.each(_.keys(this._in[v]), removeEdge);
- delete this._in[v];
- delete this._preds[v];
- _.each(_.keys(this._out[v]), removeEdge);
- delete this._out[v];
- delete this._sucs[v];
- --this._nodeCount;
- }
- return this;
-};
-
-Graph.prototype.setParent = function(v, parent) {
- if (!this._isCompound) {
- throw new Error("Cannot set parent in a non-compound graph");
- }
-
- if (_.isUndefined(parent)) {
- parent = GRAPH_NODE;
- } else {
- // Coerce parent to string
- parent += "";
- for (var ancestor = parent;
- !_.isUndefined(ancestor);
- ancestor = this.parent(ancestor)) {
- if (ancestor === v) {
- throw new Error("Setting " + parent+ " as parent of " + v +
- " would create create a cycle");
- }
- }
-
- this.setNode(parent);
- }
-
- this.setNode(v);
- this._removeFromParentsChildList(v);
- this._parent[v] = parent;
- this._children[parent][v] = true;
- return this;
-};
-
-Graph.prototype._removeFromParentsChildList = function(v) {
- delete this._children[this._parent[v]][v];
-};
-
-Graph.prototype.parent = function(v) {
- if (this._isCompound) {
- var parent = this._parent[v];
- if (parent !== GRAPH_NODE) {
- return parent;
- }
- }
-};
-
-Graph.prototype.children = function(v) {
- if (_.isUndefined(v)) {
- v = GRAPH_NODE;
- }
-
- if (this._isCompound) {
- var children = this._children[v];
- if (children) {
- return _.keys(children);
- }
- } else if (v === GRAPH_NODE) {
- return this.nodes();
- } else if (this.hasNode(v)) {
- return [];
- }
-};
-
-Graph.prototype.predecessors = function(v) {
- var predsV = this._preds[v];
- if (predsV) {
- return _.keys(predsV);
- }
-};
-
-Graph.prototype.successors = function(v) {
- var sucsV = this._sucs[v];
- if (sucsV) {
- return _.keys(sucsV);
- }
-};
-
-Graph.prototype.neighbors = function(v) {
- var preds = this.predecessors(v);
- if (preds) {
- return _.union(preds, this.successors(v));
- }
-};
-
-Graph.prototype.filterNodes = function(filter) {
- var copy = new this.constructor({
- directed: this._isDirected,
- multigraph: this._isMultigraph,
- compound: this._isCompound
- });
-
- copy.setGraph(this.graph());
-
- _.each(this._nodes, function(value, v) {
- if (filter(v)) {
- copy.setNode(v, value);
- }
- }, this);
-
- _.each(this._edgeObjs, function(e) {
- if (copy.hasNode(e.v) && copy.hasNode(e.w)) {
- copy.setEdge(e, this.edge(e));
- }
- }, this);
-
- var self = this;
- var parents = {};
- function findParent(v) {
- var parent = self.parent(v);
- if (parent === undefined || copy.hasNode(parent)) {
- parents[v] = parent;
- return parent;
- } else if (parent in parents) {
- return parents[parent];
- } else {
- return findParent(parent);
- }
- }
-
- if (this._isCompound) {
- _.each(copy.nodes(), function(v) {
- copy.setParent(v, findParent(v));
- });
- }
-
- return copy;
-};
-
-/* === Edge functions ========== */
-
-Graph.prototype.setDefaultEdgeLabel = function(newDefault) {
- if (!_.isFunction(newDefault)) {
- newDefault = _.constant(newDefault);
- }
- this._defaultEdgeLabelFn = newDefault;
- return this;
-};
-
-Graph.prototype.edgeCount = function() {
- return this._edgeCount;
-};
-
-Graph.prototype.edges = function() {
- return _.values(this._edgeObjs);
-};
-
-Graph.prototype.setPath = function(vs, value) {
- var self = this,
- args = arguments;
- _.reduce(vs, function(v, w) {
- if (args.length > 1) {
- self.setEdge(v, w, value);
- } else {
- self.setEdge(v, w);
- }
- return w;
- });
- return this;
-};
-
-/*
- * setEdge(v, w, [value, [name]])
- * setEdge({ v, w, [name] }, [value])
- */
-Graph.prototype.setEdge = function() {
- var v, w, name, value,
- valueSpecified = false,
- arg0 = arguments[0];
-
- if (typeof arg0 === "object" && arg0 !== null && "v" in arg0) {
- v = arg0.v;
- w = arg0.w;
- name = arg0.name;
- if (arguments.length === 2) {
- value = arguments[1];
- valueSpecified = true;
- }
- } else {
- v = arg0;
- w = arguments[1];
- name = arguments[3];
- if (arguments.length > 2) {
- value = arguments[2];
- valueSpecified = true;
- }
- }
-
- v = "" + v;
- w = "" + w;
- if (!_.isUndefined(name)) {
- name = "" + name;
- }
-
- var e = edgeArgsToId(this._isDirected, v, w, name);
- if (_.has(this._edgeLabels, e)) {
- if (valueSpecified) {
- this._edgeLabels[e] = value;
- }
- return this;
- }
-
- if (!_.isUndefined(name) && !this._isMultigraph) {
- throw new Error("Cannot set a named edge when isMultigraph = false");
- }
-
- // It didn't exist, so we need to create it.
- // First ensure the nodes exist.
- this.setNode(v);
- this.setNode(w);
-
- this._edgeLabels[e] = valueSpecified ? value : this._defaultEdgeLabelFn(v, w, name);
-
- var edgeObj = edgeArgsToObj(this._isDirected, v, w, name);
- // Ensure we add undirected edges in a consistent way.
- v = edgeObj.v;
- w = edgeObj.w;
-
- Object.freeze(edgeObj);
- this._edgeObjs[e] = edgeObj;
- incrementOrInitEntry(this._preds[w], v);
- incrementOrInitEntry(this._sucs[v], w);
- this._in[w][e] = edgeObj;
- this._out[v][e] = edgeObj;
- this._edgeCount++;
- return this;
-};
-
-Graph.prototype.edge = function(v, w, name) {
- var e = (arguments.length === 1
- ? edgeObjToId(this._isDirected, arguments[0])
- : edgeArgsToId(this._isDirected, v, w, name));
- return this._edgeLabels[e];
-};
-
-Graph.prototype.hasEdge = function(v, w, name) {
- var e = (arguments.length === 1
- ? edgeObjToId(this._isDirected, arguments[0])
- : edgeArgsToId(this._isDirected, v, w, name));
- return _.has(this._edgeLabels, e);
-};
-
-Graph.prototype.removeEdge = function(v, w, name) {
- var e = (arguments.length === 1
- ? edgeObjToId(this._isDirected, arguments[0])
- : edgeArgsToId(this._isDirected, v, w, name)),
- edge = this._edgeObjs[e];
- if (edge) {
- v = edge.v;
- w = edge.w;
- delete this._edgeLabels[e];
- delete this._edgeObjs[e];
- decrementOrRemoveEntry(this._preds[w], v);
- decrementOrRemoveEntry(this._sucs[v], w);
- delete this._in[w][e];
- delete this._out[v][e];
- this._edgeCount--;
- }
- return this;
-};
-
-Graph.prototype.inEdges = function(v, u) {
- var inV = this._in[v];
- if (inV) {
- var edges = _.values(inV);
- if (!u) {
- return edges;
- }
- return _.filter(edges, function(edge) { return edge.v === u; });
- }
-};
-
-Graph.prototype.outEdges = function(v, w) {
- var outV = this._out[v];
- if (outV) {
- var edges = _.values(outV);
- if (!w) {
- return edges;
- }
- return _.filter(edges, function(edge) { return edge.w === w; });
- }
-};
-
-Graph.prototype.nodeEdges = function(v, w) {
- var inEdges = this.inEdges(v, w);
- if (inEdges) {
- return inEdges.concat(this.outEdges(v, w));
- }
-};
-
-function incrementOrInitEntry(map, k) {
- if (map[k]) {
- map[k]++;
- } else {
- map[k] = 1;
- }
-}
-
-function decrementOrRemoveEntry(map, k) {
- if (!--map[k]) { delete map[k]; }
-}
-
-function edgeArgsToId(isDirected, v_, w_, name) {
- var v = "" + v_;
- var w = "" + w_;
- if (!isDirected && v > w) {
- var tmp = v;
- v = w;
- w = tmp;
- }
- return v + EDGE_KEY_DELIM + w + EDGE_KEY_DELIM +
- (_.isUndefined(name) ? DEFAULT_EDGE_NAME : name);
-}
-
-function edgeArgsToObj(isDirected, v_, w_, name) {
- var v = "" + v_;
- var w = "" + w_;
- if (!isDirected && v > w) {
- var tmp = v;
- v = w;
- w = tmp;
- }
- var edgeObj = { v: v, w: w };
- if (name) {
- edgeObj.name = name;
- }
- return edgeObj;
-}
-
-function edgeObjToId(isDirected, edgeObj) {
- return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name);
-}
-
-},{"./lodash":107}],105:[function(require,module,exports){
-arguments[4][53][0].apply(exports,arguments)
-},{"./graph":104,"./version":108,"dup":53}],106:[function(require,module,exports){
-arguments[4][54][0].apply(exports,arguments)
-},{"./graph":104,"./lodash":107,"dup":54}],107:[function(require,module,exports){
-arguments[4][55][0].apply(exports,arguments)
-},{"dup":55,"lodash":109}],108:[function(require,module,exports){
-module.exports = '1.0.7';
-
-},{}],109:[function(require,module,exports){
-arguments[4][87][0].apply(exports,arguments)
-},{"dup":87}],110:[function(require,module,exports){
-(function (global){
-/*! https://mths.be/he v1.1.1 by @mathias | MIT license */
-;(function(root) {
-
- // Detect free variables `exports`.
- var freeExports = typeof exports == 'object' && exports;
-
- // Detect free variable `module`.
- var freeModule = typeof module == 'object' && module &&
- module.exports == freeExports && module;
-
- // Detect free variable `global`, from Node.js or Browserified code,
- // and use it as `root`.
- var freeGlobal = typeof global == 'object' && global;
- if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
- root = freeGlobal;
- }
-
- /*--------------------------------------------------------------------------*/
-
- // All astral symbols.
- var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
- // All ASCII symbols (not just printable ASCII) except those listed in the
- // first column of the overrides table.
- // https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides
- var regexAsciiWhitelist = /[\x01-\x7F]/g;
- // All BMP symbols that are not ASCII newlines, printable ASCII symbols, or
- // code points listed in the first column of the overrides table on
- // https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides.
- var regexBmpWhitelist = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;
-
- var regexEncodeNonAscii = /<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g;
- var encodeMap = {'\xAD':'shy','\u200C':'zwnj','\u200D':'zwj','\u200E':'lrm','\u2063':'ic','\u2062':'it','\u2061':'af','\u200F':'rlm','\u200B':'ZeroWidthSpace','\u2060':'NoBreak','\u0311':'DownBreve','\u20DB':'tdot','\u20DC':'DotDot','\t':'Tab','\n':'NewLine','\u2008':'puncsp','\u205F':'MediumSpace','\u2009':'thinsp','\u200A':'hairsp','\u2004':'emsp13','\u2002':'ensp','\u2005':'emsp14','\u2003':'emsp','\u2007':'numsp','\xA0':'nbsp','\u205F\u200A':'ThickSpace','\u203E':'oline','_':'lowbar','\u2010':'dash','\u2013':'ndash','\u2014':'mdash','\u2015':'horbar',',':'comma',';':'semi','\u204F':'bsemi',':':'colon','\u2A74':'Colone','!':'excl','\xA1':'iexcl','?':'quest','\xBF':'iquest','.':'period','\u2025':'nldr','\u2026':'mldr','\xB7':'middot','\'':'apos','\u2018':'lsquo','\u2019':'rsquo','\u201A':'sbquo','\u2039':'lsaquo','\u203A':'rsaquo','"':'quot','\u201C':'ldquo','\u201D':'rdquo','\u201E':'bdquo','\xAB':'laquo','\xBB':'raquo','(':'lpar',')':'rpar','[':'lsqb',']':'rsqb','{':'lcub','}':'rcub','\u2308':'lceil','\u2309':'rceil','\u230A':'lfloor','\u230B':'rfloor','\u2985':'lopar','\u2986':'ropar','\u298B':'lbrke','\u298C':'rbrke','\u298D':'lbrkslu','\u298E':'rbrksld','\u298F':'lbrksld','\u2990':'rbrkslu','\u2991':'langd','\u2992':'rangd','\u2993':'lparlt','\u2994':'rpargt','\u2995':'gtlPar','\u2996':'ltrPar','\u27E6':'lobrk','\u27E7':'robrk','\u27E8':'lang','\u27E9':'rang','\u27EA':'Lang','\u27EB':'Rang','\u27EC':'loang','\u27ED':'roang','\u2772':'lbbrk','\u2773':'rbbrk','\u2016':'Vert','\xA7':'sect','\xB6':'para','@':'commat','*':'ast','/':'sol','undefined':null,'&':'amp','#':'num','%':'percnt','\u2030':'permil','\u2031':'pertenk','\u2020':'dagger','\u2021':'Dagger','\u2022':'bull','\u2043':'hybull','\u2032':'prime','\u2033':'Prime','\u2034':'tprime','\u2057':'qprime','\u2035':'bprime','\u2041':'caret','`':'grave','\xB4':'acute','\u02DC':'tilde','^':'Hat','\xAF':'macr','\u02D8':'breve','\u02D9':'dot','\xA8':'die','\u02DA':'ring','\u02DD':'dblac','\xB8':'cedil','\u02DB':'ogon','\u02C6':'circ','\u02C7':'caron','\xB0':'deg','\xA9':'copy','\xAE':'reg','\u2117':'copysr','\u2118':'wp','\u211E':'rx','\u2127':'mho','\u2129':'iiota','\u2190':'larr','\u219A':'nlarr','\u2192':'rarr','\u219B':'nrarr','\u2191':'uarr','\u2193':'darr','\u2194':'harr','\u21AE':'nharr','\u2195':'varr','\u2196':'nwarr','\u2197':'nearr','\u2198':'searr','\u2199':'swarr','\u219D':'rarrw','\u219D\u0338':'nrarrw','\u219E':'Larr','\u219F':'Uarr','\u21A0':'Rarr','\u21A1':'Darr','\u21A2':'larrtl','\u21A3':'rarrtl','\u21A4':'mapstoleft','\u21A5':'mapstoup','\u21A6':'map','\u21A7':'mapstodown','\u21A9':'larrhk','\u21AA':'rarrhk','\u21AB':'larrlp','\u21AC':'rarrlp','\u21AD':'harrw','\u21B0':'lsh','\u21B1':'rsh','\u21B2':'ldsh','\u21B3':'rdsh','\u21B5':'crarr','\u21B6':'cularr','\u21B7':'curarr','\u21BA':'olarr','\u21BB':'orarr','\u21BC':'lharu','\u21BD':'lhard','\u21BE':'uharr','\u21BF':'uharl','\u21C0':'rharu','\u21C1':'rhard','\u21C2':'dharr','\u21C3':'dharl','\u21C4':'rlarr','\u21C5':'udarr','\u21C6':'lrarr','\u21C7':'llarr','\u21C8':'uuarr','\u21C9':'rrarr','\u21CA':'ddarr','\u21CB':'lrhar','\u21CC':'rlhar','\u21D0':'lArr','\u21CD':'nlArr','\u21D1':'uArr','\u21D2':'rArr','\u21CF':'nrArr','\u21D3':'dArr','\u21D4':'iff','\u21CE':'nhArr','\u21D5':'vArr','\u21D6':'nwArr','\u21D7':'neArr','\u21D8':'seArr','\u21D9':'swArr','\u21DA':'lAarr','\u21DB':'rAarr','\u21DD':'zigrarr','\u21E4':'larrb','\u21E5':'rarrb','\u21F5':'duarr','\u21FD':'loarr','\u21FE':'roarr','\u21FF':'hoarr','\u2200':'forall','\u2201':'comp','\u2202':'part','\u2202\u0338':'npart','\u2203':'exist','\u2204':'nexist','\u2205':'empty','\u2207':'Del','\u2208':'in','\u2209':'notin','\u220B':'ni','\u220C':'notni','\u03F6':'bepsi','\u220F':'prod','\u2210':'coprod','\u2211':'sum','+':'plus','\xB1':'pm','\xF7':'div','\xD7':'times','<':'lt','\u226E':'nlt','<\u20D2':'nvlt','=':'equals','\u2260':'ne','=\u20E5':'bne','\u2A75':'Equal','>':'gt','\u226F':'ngt','>\u20D2':'nvgt','\xAC':'not','|':'vert','\xA6':'brvbar','\u2212':'minus','\u2213':'mp','\u2214':'plusdo','\u2044':'frasl','\u2216':'setmn','\u2217':'lowast','\u2218':'compfn','\u221A':'Sqrt','\u221D':'prop','\u221E':'infin','\u221F':'angrt','\u2220':'ang','\u2220\u20D2':'nang','\u2221':'angmsd','\u2222':'angsph','\u2223':'mid','\u2224':'nmid','\u2225':'par','\u2226':'npar','\u2227':'and','\u2228':'or','\u2229':'cap','\u2229\uFE00':'caps','\u222A':'cup','\u222A\uFE00':'cups','\u222B':'int','\u222C':'Int','\u222D':'tint','\u2A0C':'qint','\u222E':'oint','\u222F':'Conint','\u2230':'Cconint','\u2231':'cwint','\u2232':'cwconint','\u2233':'awconint','\u2234':'there4','\u2235':'becaus','\u2236':'ratio','\u2237':'Colon','\u2238':'minusd','\u223A':'mDDot','\u223B':'homtht','\u223C':'sim','\u2241':'nsim','\u223C\u20D2':'nvsim','\u223D':'bsim','\u223D\u0331':'race','\u223E':'ac','\u223E\u0333':'acE','\u223F':'acd','\u2240':'wr','\u2242':'esim','\u2242\u0338':'nesim','\u2243':'sime','\u2244':'nsime','\u2245':'cong','\u2247':'ncong','\u2246':'simne','\u2248':'ap','\u2249':'nap','\u224A':'ape','\u224B':'apid','\u224B\u0338':'napid','\u224C':'bcong','\u224D':'CupCap','\u226D':'NotCupCap','\u224D\u20D2':'nvap','\u224E':'bump','\u224E\u0338':'nbump','\u224F':'bumpe','\u224F\u0338':'nbumpe','\u2250':'doteq','\u2250\u0338':'nedot','\u2251':'eDot','\u2252':'efDot','\u2253':'erDot','\u2254':'colone','\u2255':'ecolon','\u2256':'ecir','\u2257':'cire','\u2259':'wedgeq','\u225A':'veeeq','\u225C':'trie','\u225F':'equest','\u2261':'equiv','\u2262':'nequiv','\u2261\u20E5':'bnequiv','\u2264':'le','\u2270':'nle','\u2264\u20D2':'nvle','\u2265':'ge','\u2271':'nge','\u2265\u20D2':'nvge','\u2266':'lE','\u2266\u0338':'nlE','\u2267':'gE','\u2267\u0338':'ngE','\u2268\uFE00':'lvnE','\u2268':'lnE','\u2269':'gnE','\u2269\uFE00':'gvnE','\u226A':'ll','\u226A\u0338':'nLtv','\u226A\u20D2':'nLt','\u226B':'gg','\u226B\u0338':'nGtv','\u226B\u20D2':'nGt','\u226C':'twixt','\u2272':'lsim','\u2274':'nlsim','\u2273':'gsim','\u2275':'ngsim','\u2276':'lg','\u2278':'ntlg','\u2277':'gl','\u2279':'ntgl','\u227A':'pr','\u2280':'npr','\u227B':'sc','\u2281':'nsc','\u227C':'prcue','\u22E0':'nprcue','\u227D':'sccue','\u22E1':'nsccue','\u227E':'prsim','\u227F':'scsim','\u227F\u0338':'NotSucceedsTilde','\u2282':'sub','\u2284':'nsub','\u2282\u20D2':'vnsub','\u2283':'sup','\u2285':'nsup','\u2283\u20D2':'vnsup','\u2286':'sube','\u2288':'nsube','\u2287':'supe','\u2289':'nsupe','\u228A\uFE00':'vsubne','\u228A':'subne','\u228B\uFE00':'vsupne','\u228B':'supne','\u228D':'cupdot','\u228E':'uplus','\u228F':'sqsub','\u228F\u0338':'NotSquareSubset','\u2290':'sqsup','\u2290\u0338':'NotSquareSuperset','\u2291':'sqsube','\u22E2':'nsqsube','\u2292':'sqsupe','\u22E3':'nsqsupe','\u2293':'sqcap','\u2293\uFE00':'sqcaps','\u2294':'sqcup','\u2294\uFE00':'sqcups','\u2295':'oplus','\u2296':'ominus','\u2297':'otimes','\u2298':'osol','\u2299':'odot','\u229A':'ocir','\u229B':'oast','\u229D':'odash','\u229E':'plusb','\u229F':'minusb','\u22A0':'timesb','\u22A1':'sdotb','\u22A2':'vdash','\u22AC':'nvdash','\u22A3':'dashv','\u22A4':'top','\u22A5':'bot','\u22A7':'models','\u22A8':'vDash','\u22AD':'nvDash','\u22A9':'Vdash','\u22AE':'nVdash','\u22AA':'Vvdash','\u22AB':'VDash','\u22AF':'nVDash','\u22B0':'prurel','\u22B2':'vltri','\u22EA':'nltri','\u22B3':'vrtri','\u22EB':'nrtri','\u22B4':'ltrie','\u22EC':'nltrie','\u22B4\u20D2':'nvltrie','\u22B5':'rtrie','\u22ED':'nrtrie','\u22B5\u20D2':'nvrtrie','\u22B6':'origof','\u22B7':'imof','\u22B8':'mumap','\u22B9':'hercon','\u22BA':'intcal','\u22BB':'veebar','\u22BD':'barvee','\u22BE':'angrtvb','\u22BF':'lrtri','\u22C0':'Wedge','\u22C1':'Vee','\u22C2':'xcap','\u22C3':'xcup','\u22C4':'diam','\u22C5':'sdot','\u22C6':'Star','\u22C7':'divonx','\u22C8':'bowtie','\u22C9':'ltimes','\u22CA':'rtimes','\u22CB':'lthree','\u22CC':'rthree','\u22CD':'bsime','\u22CE':'cuvee','\u22CF':'cuwed','\u22D0':'Sub','\u22D1':'Sup','\u22D2':'Cap','\u22D3':'Cup','\u22D4':'fork','\u22D5':'epar','\u22D6':'ltdot','\u22D7':'gtdot','\u22D8':'Ll','\u22D8\u0338':'nLl','\u22D9':'Gg','\u22D9\u0338':'nGg','\u22DA\uFE00':'lesg','\u22DA':'leg','\u22DB':'gel','\u22DB\uFE00':'gesl','\u22DE':'cuepr','\u22DF':'cuesc','\u22E6':'lnsim','\u22E7':'gnsim','\u22E8':'prnsim','\u22E9':'scnsim','\u22EE':'vellip','\u22EF':'ctdot','\u22F0':'utdot','\u22F1':'dtdot','\u22F2':'disin','\u22F3':'isinsv','\u22F4':'isins','\u22F5':'isindot','\u22F5\u0338':'notindot','\u22F6':'notinvc','\u22F7':'notinvb','\u22F9':'isinE','\u22F9\u0338':'notinE','\u22FA':'nisd','\u22FB':'xnis','\u22FC':'nis','\u22FD':'notnivc','\u22FE':'notnivb','\u2305':'barwed','\u2306':'Barwed','\u230C':'drcrop','\u230D':'dlcrop','\u230E':'urcrop','\u230F':'ulcrop','\u2310':'bnot','\u2312':'profline','\u2313':'profsurf','\u2315':'telrec','\u2316':'target','\u231C':'ulcorn','\u231D':'urcorn','\u231E':'dlcorn','\u231F':'drcorn','\u2322':'frown','\u2323':'smile','\u232D':'cylcty','\u232E':'profalar','\u2336':'topbot','\u233D':'ovbar','\u233F':'solbar','\u237C':'angzarr','\u23B0':'lmoust','\u23B1':'rmoust','\u23B4':'tbrk','\u23B5':'bbrk','\u23B6':'bbrktbrk','\u23DC':'OverParenthesis','\u23DD':'UnderParenthesis','\u23DE':'OverBrace','\u23DF':'UnderBrace','\u23E2':'trpezium','\u23E7':'elinters','\u2423':'blank','\u2500':'boxh','\u2502':'boxv','\u250C':'boxdr','\u2510':'boxdl','\u2514':'boxur','\u2518':'boxul','\u251C':'boxvr','\u2524':'boxvl','\u252C':'boxhd','\u2534':'boxhu','\u253C':'boxvh','\u2550':'boxH','\u2551':'boxV','\u2552':'boxdR','\u2553':'boxDr','\u2554':'boxDR','\u2555':'boxdL','\u2556':'boxDl','\u2557':'boxDL','\u2558':'boxuR','\u2559':'boxUr','\u255A':'boxUR','\u255B':'boxuL','\u255C':'boxUl','\u255D':'boxUL','\u255E':'boxvR','\u255F':'boxVr','\u2560':'boxVR','\u2561':'boxvL','\u2562':'boxVl','\u2563':'boxVL','\u2564':'boxHd','\u2565':'boxhD','\u2566':'boxHD','\u2567':'boxHu','\u2568':'boxhU','\u2569':'boxHU','\u256A':'boxvH','\u256B':'boxVh','\u256C':'boxVH','\u2580':'uhblk','\u2584':'lhblk','\u2588':'block','\u2591':'blk14','\u2592':'blk12','\u2593':'blk34','\u25A1':'squ','\u25AA':'squf','\u25AB':'EmptyVerySmallSquare','\u25AD':'rect','\u25AE':'marker','\u25B1':'fltns','\u25B3':'xutri','\u25B4':'utrif','\u25B5':'utri','\u25B8':'rtrif','\u25B9':'rtri','\u25BD':'xdtri','\u25BE':'dtrif','\u25BF':'dtri','\u25C2':'ltrif','\u25C3':'ltri','\u25CA':'loz','\u25CB':'cir','\u25EC':'tridot','\u25EF':'xcirc','\u25F8':'ultri','\u25F9':'urtri','\u25FA':'lltri','\u25FB':'EmptySmallSquare','\u25FC':'FilledSmallSquare','\u2605':'starf','\u2606':'star','\u260E':'phone','\u2640':'female','\u2642':'male','\u2660':'spades','\u2663':'clubs','\u2665':'hearts','\u2666':'diams','\u266A':'sung','\u2713':'check','\u2717':'cross','\u2720':'malt','\u2736':'sext','\u2758':'VerticalSeparator','\u27C8':'bsolhsub','\u27C9':'suphsol','\u27F5':'xlarr','\u27F6':'xrarr','\u27F7':'xharr','\u27F8':'xlArr','\u27F9':'xrArr','\u27FA':'xhArr','\u27FC':'xmap','\u27FF':'dzigrarr','\u2902':'nvlArr','\u2903':'nvrArr','\u2904':'nvHarr','\u2905':'Map','\u290C':'lbarr','\u290D':'rbarr','\u290E':'lBarr','\u290F':'rBarr','\u2910':'RBarr','\u2911':'DDotrahd','\u2912':'UpArrowBar','\u2913':'DownArrowBar','\u2916':'Rarrtl','\u2919':'latail','\u291A':'ratail','\u291B':'lAtail','\u291C':'rAtail','\u291D':'larrfs','\u291E':'rarrfs','\u291F':'larrbfs','\u2920':'rarrbfs','\u2923':'nwarhk','\u2924':'nearhk','\u2925':'searhk','\u2926':'swarhk','\u2927':'nwnear','\u2928':'toea','\u2929':'tosa','\u292A':'swnwar','\u2933':'rarrc','\u2933\u0338':'nrarrc','\u2935':'cudarrr','\u2936':'ldca','\u2937':'rdca','\u2938':'cudarrl','\u2939':'larrpl','\u293C':'curarrm','\u293D':'cularrp','\u2945':'rarrpl','\u2948':'harrcir','\u2949':'Uarrocir','\u294A':'lurdshar','\u294B':'ldrushar','\u294E':'LeftRightVector','\u294F':'RightUpDownVector','\u2950':'DownLeftRightVector','\u2951':'LeftUpDownVector','\u2952':'LeftVectorBar','\u2953':'RightVectorBar','\u2954':'RightUpVectorBar','\u2955':'RightDownVectorBar','\u2956':'DownLeftVectorBar','\u2957':'DownRightVectorBar','\u2958':'LeftUpVectorBar','\u2959':'LeftDownVectorBar','\u295A':'LeftTeeVector','\u295B':'RightTeeVector','\u295C':'RightUpTeeVector','\u295D':'RightDownTeeVector','\u295E':'DownLeftTeeVector','\u295F':'DownRightTeeVector','\u2960':'LeftUpTeeVector','\u2961':'LeftDownTeeVector','\u2962':'lHar','\u2963':'uHar','\u2964':'rHar','\u2965':'dHar','\u2966':'luruhar','\u2967':'ldrdhar','\u2968':'ruluhar','\u2969':'rdldhar','\u296A':'lharul','\u296B':'llhard','\u296C':'rharul','\u296D':'lrhard','\u296E':'udhar','\u296F':'duhar','\u2970':'RoundImplies','\u2971':'erarr','\u2972':'simrarr','\u2973':'larrsim','\u2974':'rarrsim','\u2975':'rarrap','\u2976':'ltlarr','\u2978':'gtrarr','\u2979':'subrarr','\u297B':'suplarr','\u297C':'lfisht','\u297D':'rfisht','\u297E':'ufisht','\u297F':'dfisht','\u299A':'vzigzag','\u299C':'vangrt','\u299D':'angrtvbd','\u29A4':'ange','\u29A5':'range','\u29A6':'dwangle','\u29A7':'uwangle','\u29A8':'angmsdaa','\u29A9':'angmsdab','\u29AA':'angmsdac','\u29AB':'angmsdad','\u29AC':'angmsdae','\u29AD':'angmsdaf','\u29AE':'angmsdag','\u29AF':'angmsdah','\u29B0':'bemptyv','\u29B1':'demptyv','\u29B2':'cemptyv','\u29B3':'raemptyv','\u29B4':'laemptyv','\u29B5':'ohbar','\u29B6':'omid','\u29B7':'opar','\u29B9':'operp','\u29BB':'olcross','\u29BC':'odsold','\u29BE':'olcir','\u29BF':'ofcir','\u29C0':'olt','\u29C1':'ogt','\u29C2':'cirscir','\u29C3':'cirE','\u29C4':'solb','\u29C5':'bsolb','\u29C9':'boxbox','\u29CD':'trisb','\u29CE':'rtriltri','\u29CF':'LeftTriangleBar','\u29CF\u0338':'NotLeftTriangleBar','\u29D0':'RightTriangleBar','\u29D0\u0338':'NotRightTriangleBar','\u29DC':'iinfin','\u29DD':'infintie','\u29DE':'nvinfin','\u29E3':'eparsl','\u29E4':'smeparsl','\u29E5':'eqvparsl','\u29EB':'lozf','\u29F4':'RuleDelayed','\u29F6':'dsol','\u2A00':'xodot','\u2A01':'xoplus','\u2A02':'xotime','\u2A04':'xuplus','\u2A06':'xsqcup','\u2A0D':'fpartint','\u2A10':'cirfnint','\u2A11':'awint','\u2A12':'rppolint','\u2A13':'scpolint','\u2A14':'npolint','\u2A15':'pointint','\u2A16':'quatint','\u2A17':'intlarhk','\u2A22':'pluscir','\u2A23':'plusacir','\u2A24':'simplus','\u2A25':'plusdu','\u2A26':'plussim','\u2A27':'plustwo','\u2A29':'mcomma','\u2A2A':'minusdu','\u2A2D':'loplus','\u2A2E':'roplus','\u2A2F':'Cross','\u2A30':'timesd','\u2A31':'timesbar','\u2A33':'smashp','\u2A34':'lotimes','\u2A35':'rotimes','\u2A36':'otimesas','\u2A37':'Otimes','\u2A38':'odiv','\u2A39':'triplus','\u2A3A':'triminus','\u2A3B':'tritime','\u2A3C':'iprod','\u2A3F':'amalg','\u2A40':'capdot','\u2A42':'ncup','\u2A43':'ncap','\u2A44':'capand','\u2A45':'cupor','\u2A46':'cupcap','\u2A47':'capcup','\u2A48':'cupbrcap','\u2A49':'capbrcup','\u2A4A':'cupcup','\u2A4B':'capcap','\u2A4C':'ccups','\u2A4D':'ccaps','\u2A50':'ccupssm','\u2A53':'And','\u2A54':'Or','\u2A55':'andand','\u2A56':'oror','\u2A57':'orslope','\u2A58':'andslope','\u2A5A':'andv','\u2A5B':'orv','\u2A5C':'andd','\u2A5D':'ord','\u2A5F':'wedbar','\u2A66':'sdote','\u2A6A':'simdot','\u2A6D':'congdot','\u2A6D\u0338':'ncongdot','\u2A6E':'easter','\u2A6F':'apacir','\u2A70':'apE','\u2A70\u0338':'napE','\u2A71':'eplus','\u2A72':'pluse','\u2A73':'Esim','\u2A77':'eDDot','\u2A78':'equivDD','\u2A79':'ltcir','\u2A7A':'gtcir','\u2A7B':'ltquest','\u2A7C':'gtquest','\u2A7D':'les','\u2A7D\u0338':'nles','\u2A7E':'ges','\u2A7E\u0338':'nges','\u2A7F':'lesdot','\u2A80':'gesdot','\u2A81':'lesdoto','\u2A82':'gesdoto','\u2A83':'lesdotor','\u2A84':'gesdotol','\u2A85':'lap','\u2A86':'gap','\u2A87':'lne','\u2A88':'gne','\u2A89':'lnap','\u2A8A':'gnap','\u2A8B':'lEg','\u2A8C':'gEl','\u2A8D':'lsime','\u2A8E':'gsime','\u2A8F':'lsimg','\u2A90':'gsiml','\u2A91':'lgE','\u2A92':'glE','\u2A93':'lesges','\u2A94':'gesles','\u2A95':'els','\u2A96':'egs','\u2A97':'elsdot','\u2A98':'egsdot','\u2A99':'el','\u2A9A':'eg','\u2A9D':'siml','\u2A9E':'simg','\u2A9F':'simlE','\u2AA0':'simgE','\u2AA1':'LessLess','\u2AA1\u0338':'NotNestedLessLess','\u2AA2':'GreaterGreater','\u2AA2\u0338':'NotNestedGreaterGreater','\u2AA4':'glj','\u2AA5':'gla','\u2AA6':'ltcc','\u2AA7':'gtcc','\u2AA8':'lescc','\u2AA9':'gescc','\u2AAA':'smt','\u2AAB':'lat','\u2AAC':'smte','\u2AAC\uFE00':'smtes','\u2AAD':'late','\u2AAD\uFE00':'lates','\u2AAE':'bumpE','\u2AAF':'pre','\u2AAF\u0338':'npre','\u2AB0':'sce','\u2AB0\u0338':'nsce','\u2AB3':'prE','\u2AB4':'scE','\u2AB5':'prnE','\u2AB6':'scnE','\u2AB7':'prap','\u2AB8':'scap','\u2AB9':'prnap','\u2ABA':'scnap','\u2ABB':'Pr','\u2ABC':'Sc','\u2ABD':'subdot','\u2ABE':'supdot','\u2ABF':'subplus','\u2AC0':'supplus','\u2AC1':'submult','\u2AC2':'supmult','\u2AC3':'subedot','\u2AC4':'supedot','\u2AC5':'subE','\u2AC5\u0338':'nsubE','\u2AC6':'supE','\u2AC6\u0338':'nsupE','\u2AC7':'subsim','\u2AC8':'supsim','\u2ACB\uFE00':'vsubnE','\u2ACB':'subnE','\u2ACC\uFE00':'vsupnE','\u2ACC':'supnE','\u2ACF':'csub','\u2AD0':'csup','\u2AD1':'csube','\u2AD2':'csupe','\u2AD3':'subsup','\u2AD4':'supsub','\u2AD5':'subsub','\u2AD6':'supsup','\u2AD7':'suphsub','\u2AD8':'supdsub','\u2AD9':'forkv','\u2ADA':'topfork','\u2ADB':'mlcp','\u2AE4':'Dashv','\u2AE6':'Vdashl','\u2AE7':'Barv','\u2AE8':'vBar','\u2AE9':'vBarv','\u2AEB':'Vbar','\u2AEC':'Not','\u2AED':'bNot','\u2AEE':'rnmid','\u2AEF':'cirmid','\u2AF0':'midcir','\u2AF1':'topcir','\u2AF2':'nhpar','\u2AF3':'parsim','\u2AFD':'parsl','\u2AFD\u20E5':'nparsl','\u266D':'flat','\u266E':'natur','\u266F':'sharp','\xA4':'curren','\xA2':'cent','$':'dollar','\xA3':'pound','\xA5':'yen','\u20AC':'euro','\xB9':'sup1','\xBD':'half','\u2153':'frac13','\xBC':'frac14','\u2155':'frac15','\u2159':'frac16','\u215B':'frac18','\xB2':'sup2','\u2154':'frac23','\u2156':'frac25','\xB3':'sup3','\xBE':'frac34','\u2157':'frac35','\u215C':'frac38','\u2158':'frac45','\u215A':'frac56','\u215D':'frac58','\u215E':'frac78','\uD835\uDCB6':'ascr','\uD835\uDD52':'aopf','\uD835\uDD1E':'afr','\uD835\uDD38':'Aopf','\uD835\uDD04':'Afr','\uD835\uDC9C':'Ascr','\xAA':'ordf','\xE1':'aacute','\xC1':'Aacute','\xE0':'agrave','\xC0':'Agrave','\u0103':'abreve','\u0102':'Abreve','\xE2':'acirc','\xC2':'Acirc','\xE5':'aring','\xC5':'angst','\xE4':'auml','\xC4':'Auml','\xE3':'atilde','\xC3':'Atilde','\u0105':'aogon','\u0104':'Aogon','\u0101':'amacr','\u0100':'Amacr','\xE6':'aelig','\xC6':'AElig','\uD835\uDCB7':'bscr','\uD835\uDD53':'bopf','\uD835\uDD1F':'bfr','\uD835\uDD39':'Bopf','\u212C':'Bscr','\uD835\uDD05':'Bfr','\uD835\uDD20':'cfr','\uD835\uDCB8':'cscr','\uD835\uDD54':'copf','\u212D':'Cfr','\uD835\uDC9E':'Cscr','\u2102':'Copf','\u0107':'cacute','\u0106':'Cacute','\u0109':'ccirc','\u0108':'Ccirc','\u010D':'ccaron','\u010C':'Ccaron','\u010B':'cdot','\u010A':'Cdot','\xE7':'ccedil','\xC7':'Ccedil','\u2105':'incare','\uD835\uDD21':'dfr','\u2146':'dd','\uD835\uDD55':'dopf','\uD835\uDCB9':'dscr','\uD835\uDC9F':'Dscr','\uD835\uDD07':'Dfr','\u2145':'DD','\uD835\uDD3B':'Dopf','\u010F':'dcaron','\u010E':'Dcaron','\u0111':'dstrok','\u0110':'Dstrok','\xF0':'eth','\xD0':'ETH','\u2147':'ee','\u212F':'escr','\uD835\uDD22':'efr','\uD835\uDD56':'eopf','\u2130':'Escr','\uD835\uDD08':'Efr','\uD835\uDD3C':'Eopf','\xE9':'eacute','\xC9':'Eacute','\xE8':'egrave','\xC8':'Egrave','\xEA':'ecirc','\xCA':'Ecirc','\u011B':'ecaron','\u011A':'Ecaron','\xEB':'euml','\xCB':'Euml','\u0117':'edot','\u0116':'Edot','\u0119':'eogon','\u0118':'Eogon','\u0113':'emacr','\u0112':'Emacr','\uD835\uDD23':'ffr','\uD835\uDD57':'fopf','\uD835\uDCBB':'fscr','\uD835\uDD09':'Ffr','\uD835\uDD3D':'Fopf','\u2131':'Fscr','\uFB00':'fflig','\uFB03':'ffilig','\uFB04':'ffllig','\uFB01':'filig','fj':'fjlig','\uFB02':'fllig','\u0192':'fnof','\u210A':'gscr','\uD835\uDD58':'gopf','\uD835\uDD24':'gfr','\uD835\uDCA2':'Gscr','\uD835\uDD3E':'Gopf','\uD835\uDD0A':'Gfr','\u01F5':'gacute','\u011F':'gbreve','\u011E':'Gbreve','\u011D':'gcirc','\u011C':'Gcirc','\u0121':'gdot','\u0120':'Gdot','\u0122':'Gcedil','\uD835\uDD25':'hfr','\u210E':'planckh','\uD835\uDCBD':'hscr','\uD835\uDD59':'hopf','\u210B':'Hscr','\u210C':'Hfr','\u210D':'Hopf','\u0125':'hcirc','\u0124':'Hcirc','\u210F':'hbar','\u0127':'hstrok','\u0126':'Hstrok','\uD835\uDD5A':'iopf','\uD835\uDD26':'ifr','\uD835\uDCBE':'iscr','\u2148':'ii','\uD835\uDD40':'Iopf','\u2110':'Iscr','\u2111':'Im','\xED':'iacute','\xCD':'Iacute','\xEC':'igrave','\xCC':'Igrave','\xEE':'icirc','\xCE':'Icirc','\xEF':'iuml','\xCF':'Iuml','\u0129':'itilde','\u0128':'Itilde','\u0130':'Idot','\u012F':'iogon','\u012E':'Iogon','\u012B':'imacr','\u012A':'Imacr','\u0133':'ijlig','\u0132':'IJlig','\u0131':'imath','\uD835\uDCBF':'jscr','\uD835\uDD5B':'jopf','\uD835\uDD27':'jfr','\uD835\uDCA5':'Jscr','\uD835\uDD0D':'Jfr','\uD835\uDD41':'Jopf','\u0135':'jcirc','\u0134':'Jcirc','\u0237':'jmath','\uD835\uDD5C':'kopf','\uD835\uDCC0':'kscr','\uD835\uDD28':'kfr','\uD835\uDCA6':'Kscr','\uD835\uDD42':'Kopf','\uD835\uDD0E':'Kfr','\u0137':'kcedil','\u0136':'Kcedil','\uD835\uDD29':'lfr','\uD835\uDCC1':'lscr','\u2113':'ell','\uD835\uDD5D':'lopf','\u2112':'Lscr','\uD835\uDD0F':'Lfr','\uD835\uDD43':'Lopf','\u013A':'lacute','\u0139':'Lacute','\u013E':'lcaron','\u013D':'Lcaron','\u013C':'lcedil','\u013B':'Lcedil','\u0142':'lstrok','\u0141':'Lstrok','\u0140':'lmidot','\u013F':'Lmidot','\uD835\uDD2A':'mfr','\uD835\uDD5E':'mopf','\uD835\uDCC2':'mscr','\uD835\uDD10':'Mfr','\uD835\uDD44':'Mopf','\u2133':'Mscr','\uD835\uDD2B':'nfr','\uD835\uDD5F':'nopf','\uD835\uDCC3':'nscr','\u2115':'Nopf','\uD835\uDCA9':'Nscr','\uD835\uDD11':'Nfr','\u0144':'nacute','\u0143':'Nacute','\u0148':'ncaron','\u0147':'Ncaron','\xF1':'ntilde','\xD1':'Ntilde','\u0146':'ncedil','\u0145':'Ncedil','\u2116':'numero','\u014B':'eng','\u014A':'ENG','\uD835\uDD60':'oopf','\uD835\uDD2C':'ofr','\u2134':'oscr','\uD835\uDCAA':'Oscr','\uD835\uDD12':'Ofr','\uD835\uDD46':'Oopf','\xBA':'ordm','\xF3':'oacute','\xD3':'Oacute','\xF2':'ograve','\xD2':'Ograve','\xF4':'ocirc','\xD4':'Ocirc','\xF6':'ouml','\xD6':'Ouml','\u0151':'odblac','\u0150':'Odblac','\xF5':'otilde','\xD5':'Otilde','\xF8':'oslash','\xD8':'Oslash','\u014D':'omacr','\u014C':'Omacr','\u0153':'oelig','\u0152':'OElig','\uD835\uDD2D':'pfr','\uD835\uDCC5':'pscr','\uD835\uDD61':'popf','\u2119':'Popf','\uD835\uDD13':'Pfr','\uD835\uDCAB':'Pscr','\uD835\uDD62':'qopf','\uD835\uDD2E':'qfr','\uD835\uDCC6':'qscr','\uD835\uDCAC':'Qscr','\uD835\uDD14':'Qfr','\u211A':'Qopf','\u0138':'kgreen','\uD835\uDD2F':'rfr','\uD835\uDD63':'ropf','\uD835\uDCC7':'rscr','\u211B':'Rscr','\u211C':'Re','\u211D':'Ropf','\u0155':'racute','\u0154':'Racute','\u0159':'rcaron','\u0158':'Rcaron','\u0157':'rcedil','\u0156':'Rcedil','\uD835\uDD64':'sopf','\uD835\uDCC8':'sscr','\uD835\uDD30':'sfr','\uD835\uDD4A':'Sopf','\uD835\uDD16':'Sfr','\uD835\uDCAE':'Sscr','\u24C8':'oS','\u015B':'sacute','\u015A':'Sacute','\u015D':'scirc','\u015C':'Scirc','\u0161':'scaron','\u0160':'Scaron','\u015F':'scedil','\u015E':'Scedil','\xDF':'szlig','\uD835\uDD31':'tfr','\uD835\uDCC9':'tscr','\uD835\uDD65':'topf','\uD835\uDCAF':'Tscr','\uD835\uDD17':'Tfr','\uD835\uDD4B':'Topf','\u0165':'tcaron','\u0164':'Tcaron','\u0163':'tcedil','\u0162':'Tcedil','\u2122':'trade','\u0167':'tstrok','\u0166':'Tstrok','\uD835\uDCCA':'uscr','\uD835\uDD66':'uopf','\uD835\uDD32':'ufr','\uD835\uDD4C':'Uopf','\uD835\uDD18':'Ufr','\uD835\uDCB0':'Uscr','\xFA':'uacute','\xDA':'Uacute','\xF9':'ugrave','\xD9':'Ugrave','\u016D':'ubreve','\u016C':'Ubreve','\xFB':'ucirc','\xDB':'Ucirc','\u016F':'uring','\u016E':'Uring','\xFC':'uuml','\xDC':'Uuml','\u0171':'udblac','\u0170':'Udblac','\u0169':'utilde','\u0168':'Utilde','\u0173':'uogon','\u0172':'Uogon','\u016B':'umacr','\u016A':'Umacr','\uD835\uDD33':'vfr','\uD835\uDD67':'vopf','\uD835\uDCCB':'vscr','\uD835\uDD19':'Vfr','\uD835\uDD4D':'Vopf','\uD835\uDCB1':'Vscr','\uD835\uDD68':'wopf','\uD835\uDCCC':'wscr','\uD835\uDD34':'wfr','\uD835\uDCB2':'Wscr','\uD835\uDD4E':'Wopf','\uD835\uDD1A':'Wfr','\u0175':'wcirc','\u0174':'Wcirc','\uD835\uDD35':'xfr','\uD835\uDCCD':'xscr','\uD835\uDD69':'xopf','\uD835\uDD4F':'Xopf','\uD835\uDD1B':'Xfr','\uD835\uDCB3':'Xscr','\uD835\uDD36':'yfr','\uD835\uDCCE':'yscr','\uD835\uDD6A':'yopf','\uD835\uDCB4':'Yscr','\uD835\uDD1C':'Yfr','\uD835\uDD50':'Yopf','\xFD':'yacute','\xDD':'Yacute','\u0177':'ycirc','\u0176':'Ycirc','\xFF':'yuml','\u0178':'Yuml','\uD835\uDCCF':'zscr','\uD835\uDD37':'zfr','\uD835\uDD6B':'zopf','\u2128':'Zfr','\u2124':'Zopf','\uD835\uDCB5':'Zscr','\u017A':'zacute','\u0179':'Zacute','\u017E':'zcaron','\u017D':'Zcaron','\u017C':'zdot','\u017B':'Zdot','\u01B5':'imped','\xFE':'thorn','\xDE':'THORN','\u0149':'napos','\u03B1':'alpha','\u0391':'Alpha','\u03B2':'beta','\u0392':'Beta','\u03B3':'gamma','\u0393':'Gamma','\u03B4':'delta','\u0394':'Delta','\u03B5':'epsi','\u03F5':'epsiv','\u0395':'Epsilon','\u03DD':'gammad','\u03DC':'Gammad','\u03B6':'zeta','\u0396':'Zeta','\u03B7':'eta','\u0397':'Eta','\u03B8':'theta','\u03D1':'thetav','\u0398':'Theta','\u03B9':'iota','\u0399':'Iota','\u03BA':'kappa','\u03F0':'kappav','\u039A':'Kappa','\u03BB':'lambda','\u039B':'Lambda','\u03BC':'mu','\xB5':'micro','\u039C':'Mu','\u03BD':'nu','\u039D':'Nu','\u03BE':'xi','\u039E':'Xi','\u03BF':'omicron','\u039F':'Omicron','\u03C0':'pi','\u03D6':'piv','\u03A0':'Pi','\u03C1':'rho','\u03F1':'rhov','\u03A1':'Rho','\u03C3':'sigma','\u03A3':'Sigma','\u03C2':'sigmaf','\u03C4':'tau','\u03A4':'Tau','\u03C5':'upsi','\u03A5':'Upsilon','\u03D2':'Upsi','\u03C6':'phi','\u03D5':'phiv','\u03A6':'Phi','\u03C7':'chi','\u03A7':'Chi','\u03C8':'psi','\u03A8':'Psi','\u03C9':'omega','\u03A9':'ohm','\u0430':'acy','\u0410':'Acy','\u0431':'bcy','\u0411':'Bcy','\u0432':'vcy','\u0412':'Vcy','\u0433':'gcy','\u0413':'Gcy','\u0453':'gjcy','\u0403':'GJcy','\u0434':'dcy','\u0414':'Dcy','\u0452':'djcy','\u0402':'DJcy','\u0435':'iecy','\u0415':'IEcy','\u0451':'iocy','\u0401':'IOcy','\u0454':'jukcy','\u0404':'Jukcy','\u0436':'zhcy','\u0416':'ZHcy','\u0437':'zcy','\u0417':'Zcy','\u0455':'dscy','\u0405':'DScy','\u0438':'icy','\u0418':'Icy','\u0456':'iukcy','\u0406':'Iukcy','\u0457':'yicy','\u0407':'YIcy','\u0439':'jcy','\u0419':'Jcy','\u0458':'jsercy','\u0408':'Jsercy','\u043A':'kcy','\u041A':'Kcy','\u045C':'kjcy','\u040C':'KJcy','\u043B':'lcy','\u041B':'Lcy','\u0459':'ljcy','\u0409':'LJcy','\u043C':'mcy','\u041C':'Mcy','\u043D':'ncy','\u041D':'Ncy','\u045A':'njcy','\u040A':'NJcy','\u043E':'ocy','\u041E':'Ocy','\u043F':'pcy','\u041F':'Pcy','\u0440':'rcy','\u0420':'Rcy','\u0441':'scy','\u0421':'Scy','\u0442':'tcy','\u0422':'Tcy','\u045B':'tshcy','\u040B':'TSHcy','\u0443':'ucy','\u0423':'Ucy','\u045E':'ubrcy','\u040E':'Ubrcy','\u0444':'fcy','\u0424':'Fcy','\u0445':'khcy','\u0425':'KHcy','\u0446':'tscy','\u0426':'TScy','\u0447':'chcy','\u0427':'CHcy','\u045F':'dzcy','\u040F':'DZcy','\u0448':'shcy','\u0428':'SHcy','\u0449':'shchcy','\u0429':'SHCHcy','\u044A':'hardcy','\u042A':'HARDcy','\u044B':'ycy','\u042B':'Ycy','\u044C':'softcy','\u042C':'SOFTcy','\u044D':'ecy','\u042D':'Ecy','\u044E':'yucy','\u042E':'YUcy','\u044F':'yacy','\u042F':'YAcy','\u2135':'aleph','\u2136':'beth','\u2137':'gimel','\u2138':'daleth'};
-
- var regexEscape = /["&'<>`]/g;
- var escapeMap = {
- '"': '&quot;',
- '&': '&amp;',
- '\'': '&#x27;',
- '<': '&lt;',
- // See https://mathiasbynens.be/notes/ambiguous-ampersands: in HTML, the
- // following is not strictly necessary unless it’s part of a tag or an
- // unquoted attribute value. We’re only escaping it to support those
- // situations, and for XML support.
- '>': '&gt;',
- // In Internet Explorer ≤ 8, the backtick character can be used
- // to break out of (un)quoted attribute values or HTML comments.
- // See http://html5sec.org/#102, http://html5sec.org/#108, and
- // http://html5sec.org/#133.
- '`': '&#x60;'
- };
-
- var regexInvalidEntity = /&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/;
- var regexInvalidRawCodePoint = /[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
- var regexDecode = /&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)([=a-zA-Z0-9])?/g;
- var decodeMap = {'aacute':'\xE1','Aacute':'\xC1','abreve':'\u0103','Abreve':'\u0102','ac':'\u223E','acd':'\u223F','acE':'\u223E\u0333','acirc':'\xE2','Acirc':'\xC2','acute':'\xB4','acy':'\u0430','Acy':'\u0410','aelig':'\xE6','AElig':'\xC6','af':'\u2061','afr':'\uD835\uDD1E','Afr':'\uD835\uDD04','agrave':'\xE0','Agrave':'\xC0','alefsym':'\u2135','aleph':'\u2135','alpha':'\u03B1','Alpha':'\u0391','amacr':'\u0101','Amacr':'\u0100','amalg':'\u2A3F','amp':'&','AMP':'&','and':'\u2227','And':'\u2A53','andand':'\u2A55','andd':'\u2A5C','andslope':'\u2A58','andv':'\u2A5A','ang':'\u2220','ange':'\u29A4','angle':'\u2220','angmsd':'\u2221','angmsdaa':'\u29A8','angmsdab':'\u29A9','angmsdac':'\u29AA','angmsdad':'\u29AB','angmsdae':'\u29AC','angmsdaf':'\u29AD','angmsdag':'\u29AE','angmsdah':'\u29AF','angrt':'\u221F','angrtvb':'\u22BE','angrtvbd':'\u299D','angsph':'\u2222','angst':'\xC5','angzarr':'\u237C','aogon':'\u0105','Aogon':'\u0104','aopf':'\uD835\uDD52','Aopf':'\uD835\uDD38','ap':'\u2248','apacir':'\u2A6F','ape':'\u224A','apE':'\u2A70','apid':'\u224B','apos':'\'','ApplyFunction':'\u2061','approx':'\u2248','approxeq':'\u224A','aring':'\xE5','Aring':'\xC5','ascr':'\uD835\uDCB6','Ascr':'\uD835\uDC9C','Assign':'\u2254','ast':'*','asymp':'\u2248','asympeq':'\u224D','atilde':'\xE3','Atilde':'\xC3','auml':'\xE4','Auml':'\xC4','awconint':'\u2233','awint':'\u2A11','backcong':'\u224C','backepsilon':'\u03F6','backprime':'\u2035','backsim':'\u223D','backsimeq':'\u22CD','Backslash':'\u2216','Barv':'\u2AE7','barvee':'\u22BD','barwed':'\u2305','Barwed':'\u2306','barwedge':'\u2305','bbrk':'\u23B5','bbrktbrk':'\u23B6','bcong':'\u224C','bcy':'\u0431','Bcy':'\u0411','bdquo':'\u201E','becaus':'\u2235','because':'\u2235','Because':'\u2235','bemptyv':'\u29B0','bepsi':'\u03F6','bernou':'\u212C','Bernoullis':'\u212C','beta':'\u03B2','Beta':'\u0392','beth':'\u2136','between':'\u226C','bfr':'\uD835\uDD1F','Bfr':'\uD835\uDD05','bigcap':'\u22C2','bigcirc':'\u25EF','bigcup':'\u22C3','bigodot':'\u2A00','bigoplus':'\u2A01','bigotimes':'\u2A02','bigsqcup':'\u2A06','bigstar':'\u2605','bigtriangledown':'\u25BD','bigtriangleup':'\u25B3','biguplus':'\u2A04','bigvee':'\u22C1','bigwedge':'\u22C0','bkarow':'\u290D','blacklozenge':'\u29EB','blacksquare':'\u25AA','blacktriangle':'\u25B4','blacktriangledown':'\u25BE','blacktriangleleft':'\u25C2','blacktriangleright':'\u25B8','blank':'\u2423','blk12':'\u2592','blk14':'\u2591','blk34':'\u2593','block':'\u2588','bne':'=\u20E5','bnequiv':'\u2261\u20E5','bnot':'\u2310','bNot':'\u2AED','bopf':'\uD835\uDD53','Bopf':'\uD835\uDD39','bot':'\u22A5','bottom':'\u22A5','bowtie':'\u22C8','boxbox':'\u29C9','boxdl':'\u2510','boxdL':'\u2555','boxDl':'\u2556','boxDL':'\u2557','boxdr':'\u250C','boxdR':'\u2552','boxDr':'\u2553','boxDR':'\u2554','boxh':'\u2500','boxH':'\u2550','boxhd':'\u252C','boxhD':'\u2565','boxHd':'\u2564','boxHD':'\u2566','boxhu':'\u2534','boxhU':'\u2568','boxHu':'\u2567','boxHU':'\u2569','boxminus':'\u229F','boxplus':'\u229E','boxtimes':'\u22A0','boxul':'\u2518','boxuL':'\u255B','boxUl':'\u255C','boxUL':'\u255D','boxur':'\u2514','boxuR':'\u2558','boxUr':'\u2559','boxUR':'\u255A','boxv':'\u2502','boxV':'\u2551','boxvh':'\u253C','boxvH':'\u256A','boxVh':'\u256B','boxVH':'\u256C','boxvl':'\u2524','boxvL':'\u2561','boxVl':'\u2562','boxVL':'\u2563','boxvr':'\u251C','boxvR':'\u255E','boxVr':'\u255F','boxVR':'\u2560','bprime':'\u2035','breve':'\u02D8','Breve':'\u02D8','brvbar':'\xA6','bscr':'\uD835\uDCB7','Bscr':'\u212C','bsemi':'\u204F','bsim':'\u223D','bsime':'\u22CD','bsol':'\\','bsolb':'\u29C5','bsolhsub':'\u27C8','bull':'\u2022','bullet':'\u2022','bump':'\u224E','bumpe':'\u224F','bumpE':'\u2AAE','bumpeq':'\u224F','Bumpeq':'\u224E','cacute':'\u0107','Cacute':'\u0106','cap':'\u2229','Cap':'\u22D2','capand':'\u2A44','capbrcup':'\u2A49','capcap':'\u2A4B','capcup':'\u2A47','capdot':'\u2A40','CapitalDifferentialD':'\u2145','caps':'\u2229\uFE00','caret':'\u2041','caron':'\u02C7','Cayleys':'\u212D','ccaps':'\u2A4D','ccaron':'\u010D','Ccaron':'\u010C','ccedil':'\xE7','Ccedil':'\xC7','ccirc':'\u0109','Ccirc':'\u0108','Cconint':'\u2230','ccups':'\u2A4C','ccupssm':'\u2A50','cdot':'\u010B','Cdot':'\u010A','cedil':'\xB8','Cedilla':'\xB8','cemptyv':'\u29B2','cent':'\xA2','centerdot':'\xB7','CenterDot':'\xB7','cfr':'\uD835\uDD20','Cfr':'\u212D','chcy':'\u0447','CHcy':'\u0427','check':'\u2713','checkmark':'\u2713','chi':'\u03C7','Chi':'\u03A7','cir':'\u25CB','circ':'\u02C6','circeq':'\u2257','circlearrowleft':'\u21BA','circlearrowright':'\u21BB','circledast':'\u229B','circledcirc':'\u229A','circleddash':'\u229D','CircleDot':'\u2299','circledR':'\xAE','circledS':'\u24C8','CircleMinus':'\u2296','CirclePlus':'\u2295','CircleTimes':'\u2297','cire':'\u2257','cirE':'\u29C3','cirfnint':'\u2A10','cirmid':'\u2AEF','cirscir':'\u29C2','ClockwiseContourIntegral':'\u2232','CloseCurlyDoubleQuote':'\u201D','CloseCurlyQuote':'\u2019','clubs':'\u2663','clubsuit':'\u2663','colon':':','Colon':'\u2237','colone':'\u2254','Colone':'\u2A74','coloneq':'\u2254','comma':',','commat':'@','comp':'\u2201','compfn':'\u2218','complement':'\u2201','complexes':'\u2102','cong':'\u2245','congdot':'\u2A6D','Congruent':'\u2261','conint':'\u222E','Conint':'\u222F','ContourIntegral':'\u222E','copf':'\uD835\uDD54','Copf':'\u2102','coprod':'\u2210','Coproduct':'\u2210','copy':'\xA9','COPY':'\xA9','copysr':'\u2117','CounterClockwiseContourIntegral':'\u2233','crarr':'\u21B5','cross':'\u2717','Cross':'\u2A2F','cscr':'\uD835\uDCB8','Cscr':'\uD835\uDC9E','csub':'\u2ACF','csube':'\u2AD1','csup':'\u2AD0','csupe':'\u2AD2','ctdot':'\u22EF','cudarrl':'\u2938','cudarrr':'\u2935','cuepr':'\u22DE','cuesc':'\u22DF','cularr':'\u21B6','cularrp':'\u293D','cup':'\u222A','Cup':'\u22D3','cupbrcap':'\u2A48','cupcap':'\u2A46','CupCap':'\u224D','cupcup':'\u2A4A','cupdot':'\u228D','cupor':'\u2A45','cups':'\u222A\uFE00','curarr':'\u21B7','curarrm':'\u293C','curlyeqprec':'\u22DE','curlyeqsucc':'\u22DF','curlyvee':'\u22CE','curlywedge':'\u22CF','curren':'\xA4','curvearrowleft':'\u21B6','curvearrowright':'\u21B7','cuvee':'\u22CE','cuwed':'\u22CF','cwconint':'\u2232','cwint':'\u2231','cylcty':'\u232D','dagger':'\u2020','Dagger':'\u2021','daleth':'\u2138','darr':'\u2193','dArr':'\u21D3','Darr':'\u21A1','dash':'\u2010','dashv':'\u22A3','Dashv':'\u2AE4','dbkarow':'\u290F','dblac':'\u02DD','dcaron':'\u010F','Dcaron':'\u010E','dcy':'\u0434','Dcy':'\u0414','dd':'\u2146','DD':'\u2145','ddagger':'\u2021','ddarr':'\u21CA','DDotrahd':'\u2911','ddotseq':'\u2A77','deg':'\xB0','Del':'\u2207','delta':'\u03B4','Delta':'\u0394','demptyv':'\u29B1','dfisht':'\u297F','dfr':'\uD835\uDD21','Dfr':'\uD835\uDD07','dHar':'\u2965','dharl':'\u21C3','dharr':'\u21C2','DiacriticalAcute':'\xB4','DiacriticalDot':'\u02D9','DiacriticalDoubleAcute':'\u02DD','DiacriticalGrave':'`','DiacriticalTilde':'\u02DC','diam':'\u22C4','diamond':'\u22C4','Diamond':'\u22C4','diamondsuit':'\u2666','diams':'\u2666','die':'\xA8','DifferentialD':'\u2146','digamma':'\u03DD','disin':'\u22F2','div':'\xF7','divide':'\xF7','divideontimes':'\u22C7','divonx':'\u22C7','djcy':'\u0452','DJcy':'\u0402','dlcorn':'\u231E','dlcrop':'\u230D','dollar':'$','dopf':'\uD835\uDD55','Dopf':'\uD835\uDD3B','dot':'\u02D9','Dot':'\xA8','DotDot':'\u20DC','doteq':'\u2250','doteqdot':'\u2251','DotEqual':'\u2250','dotminus':'\u2238','dotplus':'\u2214','dotsquare':'\u22A1','doublebarwedge':'\u2306','DoubleContourIntegral':'\u222F','DoubleDot':'\xA8','DoubleDownArrow':'\u21D3','DoubleLeftArrow':'\u21D0','DoubleLeftRightArrow':'\u21D4','DoubleLeftTee':'\u2AE4','DoubleLongLeftArrow':'\u27F8','DoubleLongLeftRightArrow':'\u27FA','DoubleLongRightArrow':'\u27F9','DoubleRightArrow':'\u21D2','DoubleRightTee':'\u22A8','DoubleUpArrow':'\u21D1','DoubleUpDownArrow':'\u21D5','DoubleVerticalBar':'\u2225','downarrow':'\u2193','Downarrow':'\u21D3','DownArrow':'\u2193','DownArrowBar':'\u2913','DownArrowUpArrow':'\u21F5','DownBreve':'\u0311','downdownarrows':'\u21CA','downharpoonleft':'\u21C3','downharpoonright':'\u21C2','DownLeftRightVector':'\u2950','DownLeftTeeVector':'\u295E','DownLeftVector':'\u21BD','DownLeftVectorBar':'\u2956','DownRightTeeVector':'\u295F','DownRightVector':'\u21C1','DownRightVectorBar':'\u2957','DownTee':'\u22A4','DownTeeArrow':'\u21A7','drbkarow':'\u2910','drcorn':'\u231F','drcrop':'\u230C','dscr':'\uD835\uDCB9','Dscr':'\uD835\uDC9F','dscy':'\u0455','DScy':'\u0405','dsol':'\u29F6','dstrok':'\u0111','Dstrok':'\u0110','dtdot':'\u22F1','dtri':'\u25BF','dtrif':'\u25BE','duarr':'\u21F5','duhar':'\u296F','dwangle':'\u29A6','dzcy':'\u045F','DZcy':'\u040F','dzigrarr':'\u27FF','eacute':'\xE9','Eacute':'\xC9','easter':'\u2A6E','ecaron':'\u011B','Ecaron':'\u011A','ecir':'\u2256','ecirc':'\xEA','Ecirc':'\xCA','ecolon':'\u2255','ecy':'\u044D','Ecy':'\u042D','eDDot':'\u2A77','edot':'\u0117','eDot':'\u2251','Edot':'\u0116','ee':'\u2147','efDot':'\u2252','efr':'\uD835\uDD22','Efr':'\uD835\uDD08','eg':'\u2A9A','egrave':'\xE8','Egrave':'\xC8','egs':'\u2A96','egsdot':'\u2A98','el':'\u2A99','Element':'\u2208','elinters':'\u23E7','ell':'\u2113','els':'\u2A95','elsdot':'\u2A97','emacr':'\u0113','Emacr':'\u0112','empty':'\u2205','emptyset':'\u2205','EmptySmallSquare':'\u25FB','emptyv':'\u2205','EmptyVerySmallSquare':'\u25AB','emsp':'\u2003','emsp13':'\u2004','emsp14':'\u2005','eng':'\u014B','ENG':'\u014A','ensp':'\u2002','eogon':'\u0119','Eogon':'\u0118','eopf':'\uD835\uDD56','Eopf':'\uD835\uDD3C','epar':'\u22D5','eparsl':'\u29E3','eplus':'\u2A71','epsi':'\u03B5','epsilon':'\u03B5','Epsilon':'\u0395','epsiv':'\u03F5','eqcirc':'\u2256','eqcolon':'\u2255','eqsim':'\u2242','eqslantgtr':'\u2A96','eqslantless':'\u2A95','Equal':'\u2A75','equals':'=','EqualTilde':'\u2242','equest':'\u225F','Equilibrium':'\u21CC','equiv':'\u2261','equivDD':'\u2A78','eqvparsl':'\u29E5','erarr':'\u2971','erDot':'\u2253','escr':'\u212F','Escr':'\u2130','esdot':'\u2250','esim':'\u2242','Esim':'\u2A73','eta':'\u03B7','Eta':'\u0397','eth':'\xF0','ETH':'\xD0','euml':'\xEB','Euml':'\xCB','euro':'\u20AC','excl':'!','exist':'\u2203','Exists':'\u2203','expectation':'\u2130','exponentiale':'\u2147','ExponentialE':'\u2147','fallingdotseq':'\u2252','fcy':'\u0444','Fcy':'\u0424','female':'\u2640','ffilig':'\uFB03','fflig':'\uFB00','ffllig':'\uFB04','ffr':'\uD835\uDD23','Ffr':'\uD835\uDD09','filig':'\uFB01','FilledSmallSquare':'\u25FC','FilledVerySmallSquare':'\u25AA','fjlig':'fj','flat':'\u266D','fllig':'\uFB02','fltns':'\u25B1','fnof':'\u0192','fopf':'\uD835\uDD57','Fopf':'\uD835\uDD3D','forall':'\u2200','ForAll':'\u2200','fork':'\u22D4','forkv':'\u2AD9','Fouriertrf':'\u2131','fpartint':'\u2A0D','frac12':'\xBD','frac13':'\u2153','frac14':'\xBC','frac15':'\u2155','frac16':'\u2159','frac18':'\u215B','frac23':'\u2154','frac25':'\u2156','frac34':'\xBE','frac35':'\u2157','frac38':'\u215C','frac45':'\u2158','frac56':'\u215A','frac58':'\u215D','frac78':'\u215E','frasl':'\u2044','frown':'\u2322','fscr':'\uD835\uDCBB','Fscr':'\u2131','gacute':'\u01F5','gamma':'\u03B3','Gamma':'\u0393','gammad':'\u03DD','Gammad':'\u03DC','gap':'\u2A86','gbreve':'\u011F','Gbreve':'\u011E','Gcedil':'\u0122','gcirc':'\u011D','Gcirc':'\u011C','gcy':'\u0433','Gcy':'\u0413','gdot':'\u0121','Gdot':'\u0120','ge':'\u2265','gE':'\u2267','gel':'\u22DB','gEl':'\u2A8C','geq':'\u2265','geqq':'\u2267','geqslant':'\u2A7E','ges':'\u2A7E','gescc':'\u2AA9','gesdot':'\u2A80','gesdoto':'\u2A82','gesdotol':'\u2A84','gesl':'\u22DB\uFE00','gesles':'\u2A94','gfr':'\uD835\uDD24','Gfr':'\uD835\uDD0A','gg':'\u226B','Gg':'\u22D9','ggg':'\u22D9','gimel':'\u2137','gjcy':'\u0453','GJcy':'\u0403','gl':'\u2277','gla':'\u2AA5','glE':'\u2A92','glj':'\u2AA4','gnap':'\u2A8A','gnapprox':'\u2A8A','gne':'\u2A88','gnE':'\u2269','gneq':'\u2A88','gneqq':'\u2269','gnsim':'\u22E7','gopf':'\uD835\uDD58','Gopf':'\uD835\uDD3E','grave':'`','GreaterEqual':'\u2265','GreaterEqualLess':'\u22DB','GreaterFullEqual':'\u2267','GreaterGreater':'\u2AA2','GreaterLess':'\u2277','GreaterSlantEqual':'\u2A7E','GreaterTilde':'\u2273','gscr':'\u210A','Gscr':'\uD835\uDCA2','gsim':'\u2273','gsime':'\u2A8E','gsiml':'\u2A90','gt':'>','Gt':'\u226B','GT':'>','gtcc':'\u2AA7','gtcir':'\u2A7A','gtdot':'\u22D7','gtlPar':'\u2995','gtquest':'\u2A7C','gtrapprox':'\u2A86','gtrarr':'\u2978','gtrdot':'\u22D7','gtreqless':'\u22DB','gtreqqless':'\u2A8C','gtrless':'\u2277','gtrsim':'\u2273','gvertneqq':'\u2269\uFE00','gvnE':'\u2269\uFE00','Hacek':'\u02C7','hairsp':'\u200A','half':'\xBD','hamilt':'\u210B','hardcy':'\u044A','HARDcy':'\u042A','harr':'\u2194','hArr':'\u21D4','harrcir':'\u2948','harrw':'\u21AD','Hat':'^','hbar':'\u210F','hcirc':'\u0125','Hcirc':'\u0124','hearts':'\u2665','heartsuit':'\u2665','hellip':'\u2026','hercon':'\u22B9','hfr':'\uD835\uDD25','Hfr':'\u210C','HilbertSpace':'\u210B','hksearow':'\u2925','hkswarow':'\u2926','hoarr':'\u21FF','homtht':'\u223B','hookleftarrow':'\u21A9','hookrightarrow':'\u21AA','hopf':'\uD835\uDD59','Hopf':'\u210D','horbar':'\u2015','HorizontalLine':'\u2500','hscr':'\uD835\uDCBD','Hscr':'\u210B','hslash':'\u210F','hstrok':'\u0127','Hstrok':'\u0126','HumpDownHump':'\u224E','HumpEqual':'\u224F','hybull':'\u2043','hyphen':'\u2010','iacute':'\xED','Iacute':'\xCD','ic':'\u2063','icirc':'\xEE','Icirc':'\xCE','icy':'\u0438','Icy':'\u0418','Idot':'\u0130','iecy':'\u0435','IEcy':'\u0415','iexcl':'\xA1','iff':'\u21D4','ifr':'\uD835\uDD26','Ifr':'\u2111','igrave':'\xEC','Igrave':'\xCC','ii':'\u2148','iiiint':'\u2A0C','iiint':'\u222D','iinfin':'\u29DC','iiota':'\u2129','ijlig':'\u0133','IJlig':'\u0132','Im':'\u2111','imacr':'\u012B','Imacr':'\u012A','image':'\u2111','ImaginaryI':'\u2148','imagline':'\u2110','imagpart':'\u2111','imath':'\u0131','imof':'\u22B7','imped':'\u01B5','Implies':'\u21D2','in':'\u2208','incare':'\u2105','infin':'\u221E','infintie':'\u29DD','inodot':'\u0131','int':'\u222B','Int':'\u222C','intcal':'\u22BA','integers':'\u2124','Integral':'\u222B','intercal':'\u22BA','Intersection':'\u22C2','intlarhk':'\u2A17','intprod':'\u2A3C','InvisibleComma':'\u2063','InvisibleTimes':'\u2062','iocy':'\u0451','IOcy':'\u0401','iogon':'\u012F','Iogon':'\u012E','iopf':'\uD835\uDD5A','Iopf':'\uD835\uDD40','iota':'\u03B9','Iota':'\u0399','iprod':'\u2A3C','iquest':'\xBF','iscr':'\uD835\uDCBE','Iscr':'\u2110','isin':'\u2208','isindot':'\u22F5','isinE':'\u22F9','isins':'\u22F4','isinsv':'\u22F3','isinv':'\u2208','it':'\u2062','itilde':'\u0129','Itilde':'\u0128','iukcy':'\u0456','Iukcy':'\u0406','iuml':'\xEF','Iuml':'\xCF','jcirc':'\u0135','Jcirc':'\u0134','jcy':'\u0439','Jcy':'\u0419','jfr':'\uD835\uDD27','Jfr':'\uD835\uDD0D','jmath':'\u0237','jopf':'\uD835\uDD5B','Jopf':'\uD835\uDD41','jscr':'\uD835\uDCBF','Jscr':'\uD835\uDCA5','jsercy':'\u0458','Jsercy':'\u0408','jukcy':'\u0454','Jukcy':'\u0404','kappa':'\u03BA','Kappa':'\u039A','kappav':'\u03F0','kcedil':'\u0137','Kcedil':'\u0136','kcy':'\u043A','Kcy':'\u041A','kfr':'\uD835\uDD28','Kfr':'\uD835\uDD0E','kgreen':'\u0138','khcy':'\u0445','KHcy':'\u0425','kjcy':'\u045C','KJcy':'\u040C','kopf':'\uD835\uDD5C','Kopf':'\uD835\uDD42','kscr':'\uD835\uDCC0','Kscr':'\uD835\uDCA6','lAarr':'\u21DA','lacute':'\u013A','Lacute':'\u0139','laemptyv':'\u29B4','lagran':'\u2112','lambda':'\u03BB','Lambda':'\u039B','lang':'\u27E8','Lang':'\u27EA','langd':'\u2991','langle':'\u27E8','lap':'\u2A85','Laplacetrf':'\u2112','laquo':'\xAB','larr':'\u2190','lArr':'\u21D0','Larr':'\u219E','larrb':'\u21E4','larrbfs':'\u291F','larrfs':'\u291D','larrhk':'\u21A9','larrlp':'\u21AB','larrpl':'\u2939','larrsim':'\u2973','larrtl':'\u21A2','lat':'\u2AAB','latail':'\u2919','lAtail':'\u291B','late':'\u2AAD','lates':'\u2AAD\uFE00','lbarr':'\u290C','lBarr':'\u290E','lbbrk':'\u2772','lbrace':'{','lbrack':'[','lbrke':'\u298B','lbrksld':'\u298F','lbrkslu':'\u298D','lcaron':'\u013E','Lcaron':'\u013D','lcedil':'\u013C','Lcedil':'\u013B','lceil':'\u2308','lcub':'{','lcy':'\u043B','Lcy':'\u041B','ldca':'\u2936','ldquo':'\u201C','ldquor':'\u201E','ldrdhar':'\u2967','ldrushar':'\u294B','ldsh':'\u21B2','le':'\u2264','lE':'\u2266','LeftAngleBracket':'\u27E8','leftarrow':'\u2190','Leftarrow':'\u21D0','LeftArrow':'\u2190','LeftArrowBar':'\u21E4','LeftArrowRightArrow':'\u21C6','leftarrowtail':'\u21A2','LeftCeiling':'\u2308','LeftDoubleBracket':'\u27E6','LeftDownTeeVector':'\u2961','LeftDownVector':'\u21C3','LeftDownVectorBar':'\u2959','LeftFloor':'\u230A','leftharpoondown':'\u21BD','leftharpoonup':'\u21BC','leftleftarrows':'\u21C7','leftrightarrow':'\u2194','Leftrightarrow':'\u21D4','LeftRightArrow':'\u2194','leftrightarrows':'\u21C6','leftrightharpoons':'\u21CB','leftrightsquigarrow':'\u21AD','LeftRightVector':'\u294E','LeftTee':'\u22A3','LeftTeeArrow':'\u21A4','LeftTeeVector':'\u295A','leftthreetimes':'\u22CB','LeftTriangle':'\u22B2','LeftTriangleBar':'\u29CF','LeftTriangleEqual':'\u22B4','LeftUpDownVector':'\u2951','LeftUpTeeVector':'\u2960','LeftUpVector':'\u21BF','LeftUpVectorBar':'\u2958','LeftVector':'\u21BC','LeftVectorBar':'\u2952','leg':'\u22DA','lEg':'\u2A8B','leq':'\u2264','leqq':'\u2266','leqslant':'\u2A7D','les':'\u2A7D','lescc':'\u2AA8','lesdot':'\u2A7F','lesdoto':'\u2A81','lesdotor':'\u2A83','lesg':'\u22DA\uFE00','lesges':'\u2A93','lessapprox':'\u2A85','lessdot':'\u22D6','lesseqgtr':'\u22DA','lesseqqgtr':'\u2A8B','LessEqualGreater':'\u22DA','LessFullEqual':'\u2266','LessGreater':'\u2276','lessgtr':'\u2276','LessLess':'\u2AA1','lesssim':'\u2272','LessSlantEqual':'\u2A7D','LessTilde':'\u2272','lfisht':'\u297C','lfloor':'\u230A','lfr':'\uD835\uDD29','Lfr':'\uD835\uDD0F','lg':'\u2276','lgE':'\u2A91','lHar':'\u2962','lhard':'\u21BD','lharu':'\u21BC','lharul':'\u296A','lhblk':'\u2584','ljcy':'\u0459','LJcy':'\u0409','ll':'\u226A','Ll':'\u22D8','llarr':'\u21C7','llcorner':'\u231E','Lleftarrow':'\u21DA','llhard':'\u296B','lltri':'\u25FA','lmidot':'\u0140','Lmidot':'\u013F','lmoust':'\u23B0','lmoustache':'\u23B0','lnap':'\u2A89','lnapprox':'\u2A89','lne':'\u2A87','lnE':'\u2268','lneq':'\u2A87','lneqq':'\u2268','lnsim':'\u22E6','loang':'\u27EC','loarr':'\u21FD','lobrk':'\u27E6','longleftarrow':'\u27F5','Longleftarrow':'\u27F8','LongLeftArrow':'\u27F5','longleftrightarrow':'\u27F7','Longleftrightarrow':'\u27FA','LongLeftRightArrow':'\u27F7','longmapsto':'\u27FC','longrightarrow':'\u27F6','Longrightarrow':'\u27F9','LongRightArrow':'\u27F6','looparrowleft':'\u21AB','looparrowright':'\u21AC','lopar':'\u2985','lopf':'\uD835\uDD5D','Lopf':'\uD835\uDD43','loplus':'\u2A2D','lotimes':'\u2A34','lowast':'\u2217','lowbar':'_','LowerLeftArrow':'\u2199','LowerRightArrow':'\u2198','loz':'\u25CA','lozenge':'\u25CA','lozf':'\u29EB','lpar':'(','lparlt':'\u2993','lrarr':'\u21C6','lrcorner':'\u231F','lrhar':'\u21CB','lrhard':'\u296D','lrm':'\u200E','lrtri':'\u22BF','lsaquo':'\u2039','lscr':'\uD835\uDCC1','Lscr':'\u2112','lsh':'\u21B0','Lsh':'\u21B0','lsim':'\u2272','lsime':'\u2A8D','lsimg':'\u2A8F','lsqb':'[','lsquo':'\u2018','lsquor':'\u201A','lstrok':'\u0142','Lstrok':'\u0141','lt':'<','Lt':'\u226A','LT':'<','ltcc':'\u2AA6','ltcir':'\u2A79','ltdot':'\u22D6','lthree':'\u22CB','ltimes':'\u22C9','ltlarr':'\u2976','ltquest':'\u2A7B','ltri':'\u25C3','ltrie':'\u22B4','ltrif':'\u25C2','ltrPar':'\u2996','lurdshar':'\u294A','luruhar':'\u2966','lvertneqq':'\u2268\uFE00','lvnE':'\u2268\uFE00','macr':'\xAF','male':'\u2642','malt':'\u2720','maltese':'\u2720','map':'\u21A6','Map':'\u2905','mapsto':'\u21A6','mapstodown':'\u21A7','mapstoleft':'\u21A4','mapstoup':'\u21A5','marker':'\u25AE','mcomma':'\u2A29','mcy':'\u043C','Mcy':'\u041C','mdash':'\u2014','mDDot':'\u223A','measuredangle':'\u2221','MediumSpace':'\u205F','Mellintrf':'\u2133','mfr':'\uD835\uDD2A','Mfr':'\uD835\uDD10','mho':'\u2127','micro':'\xB5','mid':'\u2223','midast':'*','midcir':'\u2AF0','middot':'\xB7','minus':'\u2212','minusb':'\u229F','minusd':'\u2238','minusdu':'\u2A2A','MinusPlus':'\u2213','mlcp':'\u2ADB','mldr':'\u2026','mnplus':'\u2213','models':'\u22A7','mopf':'\uD835\uDD5E','Mopf':'\uD835\uDD44','mp':'\u2213','mscr':'\uD835\uDCC2','Mscr':'\u2133','mstpos':'\u223E','mu':'\u03BC','Mu':'\u039C','multimap':'\u22B8','mumap':'\u22B8','nabla':'\u2207','nacute':'\u0144','Nacute':'\u0143','nang':'\u2220\u20D2','nap':'\u2249','napE':'\u2A70\u0338','napid':'\u224B\u0338','napos':'\u0149','napprox':'\u2249','natur':'\u266E','natural':'\u266E','naturals':'\u2115','nbsp':'\xA0','nbump':'\u224E\u0338','nbumpe':'\u224F\u0338','ncap':'\u2A43','ncaron':'\u0148','Ncaron':'\u0147','ncedil':'\u0146','Ncedil':'\u0145','ncong':'\u2247','ncongdot':'\u2A6D\u0338','ncup':'\u2A42','ncy':'\u043D','Ncy':'\u041D','ndash':'\u2013','ne':'\u2260','nearhk':'\u2924','nearr':'\u2197','neArr':'\u21D7','nearrow':'\u2197','nedot':'\u2250\u0338','NegativeMediumSpace':'\u200B','NegativeThickSpace':'\u200B','NegativeThinSpace':'\u200B','NegativeVeryThinSpace':'\u200B','nequiv':'\u2262','nesear':'\u2928','nesim':'\u2242\u0338','NestedGreaterGreater':'\u226B','NestedLessLess':'\u226A','NewLine':'\n','nexist':'\u2204','nexists':'\u2204','nfr':'\uD835\uDD2B','Nfr':'\uD835\uDD11','nge':'\u2271','ngE':'\u2267\u0338','ngeq':'\u2271','ngeqq':'\u2267\u0338','ngeqslant':'\u2A7E\u0338','nges':'\u2A7E\u0338','nGg':'\u22D9\u0338','ngsim':'\u2275','ngt':'\u226F','nGt':'\u226B\u20D2','ngtr':'\u226F','nGtv':'\u226B\u0338','nharr':'\u21AE','nhArr':'\u21CE','nhpar':'\u2AF2','ni':'\u220B','nis':'\u22FC','nisd':'\u22FA','niv':'\u220B','njcy':'\u045A','NJcy':'\u040A','nlarr':'\u219A','nlArr':'\u21CD','nldr':'\u2025','nle':'\u2270','nlE':'\u2266\u0338','nleftarrow':'\u219A','nLeftarrow':'\u21CD','nleftrightarrow':'\u21AE','nLeftrightarrow':'\u21CE','nleq':'\u2270','nleqq':'\u2266\u0338','nleqslant':'\u2A7D\u0338','nles':'\u2A7D\u0338','nless':'\u226E','nLl':'\u22D8\u0338','nlsim':'\u2274','nlt':'\u226E','nLt':'\u226A\u20D2','nltri':'\u22EA','nltrie':'\u22EC','nLtv':'\u226A\u0338','nmid':'\u2224','NoBreak':'\u2060','NonBreakingSpace':'\xA0','nopf':'\uD835\uDD5F','Nopf':'\u2115','not':'\xAC','Not':'\u2AEC','NotCongruent':'\u2262','NotCupCap':'\u226D','NotDoubleVerticalBar':'\u2226','NotElement':'\u2209','NotEqual':'\u2260','NotEqualTilde':'\u2242\u0338','NotExists':'\u2204','NotGreater':'\u226F','NotGreaterEqual':'\u2271','NotGreaterFullEqual':'\u2267\u0338','NotGreaterGreater':'\u226B\u0338','NotGreaterLess':'\u2279','NotGreaterSlantEqual':'\u2A7E\u0338','NotGreaterTilde':'\u2275','NotHumpDownHump':'\u224E\u0338','NotHumpEqual':'\u224F\u0338','notin':'\u2209','notindot':'\u22F5\u0338','notinE':'\u22F9\u0338','notinva':'\u2209','notinvb':'\u22F7','notinvc':'\u22F6','NotLeftTriangle':'\u22EA','NotLeftTriangleBar':'\u29CF\u0338','NotLeftTriangleEqual':'\u22EC','NotLess':'\u226E','NotLessEqual':'\u2270','NotLessGreater':'\u2278','NotLessLess':'\u226A\u0338','NotLessSlantEqual':'\u2A7D\u0338','NotLessTilde':'\u2274','NotNestedGreaterGreater':'\u2AA2\u0338','NotNestedLessLess':'\u2AA1\u0338','notni':'\u220C','notniva':'\u220C','notnivb':'\u22FE','notnivc':'\u22FD','NotPrecedes':'\u2280','NotPrecedesEqual':'\u2AAF\u0338','NotPrecedesSlantEqual':'\u22E0','NotReverseElement':'\u220C','NotRightTriangle':'\u22EB','NotRightTriangleBar':'\u29D0\u0338','NotRightTriangleEqual':'\u22ED','NotSquareSubset':'\u228F\u0338','NotSquareSubsetEqual':'\u22E2','NotSquareSuperset':'\u2290\u0338','NotSquareSupersetEqual':'\u22E3','NotSubset':'\u2282\u20D2','NotSubsetEqual':'\u2288','NotSucceeds':'\u2281','NotSucceedsEqual':'\u2AB0\u0338','NotSucceedsSlantEqual':'\u22E1','NotSucceedsTilde':'\u227F\u0338','NotSuperset':'\u2283\u20D2','NotSupersetEqual':'\u2289','NotTilde':'\u2241','NotTildeEqual':'\u2244','NotTildeFullEqual':'\u2247','NotTildeTilde':'\u2249','NotVerticalBar':'\u2224','npar':'\u2226','nparallel':'\u2226','nparsl':'\u2AFD\u20E5','npart':'\u2202\u0338','npolint':'\u2A14','npr':'\u2280','nprcue':'\u22E0','npre':'\u2AAF\u0338','nprec':'\u2280','npreceq':'\u2AAF\u0338','nrarr':'\u219B','nrArr':'\u21CF','nrarrc':'\u2933\u0338','nrarrw':'\u219D\u0338','nrightarrow':'\u219B','nRightarrow':'\u21CF','nrtri':'\u22EB','nrtrie':'\u22ED','nsc':'\u2281','nsccue':'\u22E1','nsce':'\u2AB0\u0338','nscr':'\uD835\uDCC3','Nscr':'\uD835\uDCA9','nshortmid':'\u2224','nshortparallel':'\u2226','nsim':'\u2241','nsime':'\u2244','nsimeq':'\u2244','nsmid':'\u2224','nspar':'\u2226','nsqsube':'\u22E2','nsqsupe':'\u22E3','nsub':'\u2284','nsube':'\u2288','nsubE':'\u2AC5\u0338','nsubset':'\u2282\u20D2','nsubseteq':'\u2288','nsubseteqq':'\u2AC5\u0338','nsucc':'\u2281','nsucceq':'\u2AB0\u0338','nsup':'\u2285','nsupe':'\u2289','nsupE':'\u2AC6\u0338','nsupset':'\u2283\u20D2','nsupseteq':'\u2289','nsupseteqq':'\u2AC6\u0338','ntgl':'\u2279','ntilde':'\xF1','Ntilde':'\xD1','ntlg':'\u2278','ntriangleleft':'\u22EA','ntrianglelefteq':'\u22EC','ntriangleright':'\u22EB','ntrianglerighteq':'\u22ED','nu':'\u03BD','Nu':'\u039D','num':'#','numero':'\u2116','numsp':'\u2007','nvap':'\u224D\u20D2','nvdash':'\u22AC','nvDash':'\u22AD','nVdash':'\u22AE','nVDash':'\u22AF','nvge':'\u2265\u20D2','nvgt':'>\u20D2','nvHarr':'\u2904','nvinfin':'\u29DE','nvlArr':'\u2902','nvle':'\u2264\u20D2','nvlt':'<\u20D2','nvltrie':'\u22B4\u20D2','nvrArr':'\u2903','nvrtrie':'\u22B5\u20D2','nvsim':'\u223C\u20D2','nwarhk':'\u2923','nwarr':'\u2196','nwArr':'\u21D6','nwarrow':'\u2196','nwnear':'\u2927','oacute':'\xF3','Oacute':'\xD3','oast':'\u229B','ocir':'\u229A','ocirc':'\xF4','Ocirc':'\xD4','ocy':'\u043E','Ocy':'\u041E','odash':'\u229D','odblac':'\u0151','Odblac':'\u0150','odiv':'\u2A38','odot':'\u2299','odsold':'\u29BC','oelig':'\u0153','OElig':'\u0152','ofcir':'\u29BF','ofr':'\uD835\uDD2C','Ofr':'\uD835\uDD12','ogon':'\u02DB','ograve':'\xF2','Ograve':'\xD2','ogt':'\u29C1','ohbar':'\u29B5','ohm':'\u03A9','oint':'\u222E','olarr':'\u21BA','olcir':'\u29BE','olcross':'\u29BB','oline':'\u203E','olt':'\u29C0','omacr':'\u014D','Omacr':'\u014C','omega':'\u03C9','Omega':'\u03A9','omicron':'\u03BF','Omicron':'\u039F','omid':'\u29B6','ominus':'\u2296','oopf':'\uD835\uDD60','Oopf':'\uD835\uDD46','opar':'\u29B7','OpenCurlyDoubleQuote':'\u201C','OpenCurlyQuote':'\u2018','operp':'\u29B9','oplus':'\u2295','or':'\u2228','Or':'\u2A54','orarr':'\u21BB','ord':'\u2A5D','order':'\u2134','orderof':'\u2134','ordf':'\xAA','ordm':'\xBA','origof':'\u22B6','oror':'\u2A56','orslope':'\u2A57','orv':'\u2A5B','oS':'\u24C8','oscr':'\u2134','Oscr':'\uD835\uDCAA','oslash':'\xF8','Oslash':'\xD8','osol':'\u2298','otilde':'\xF5','Otilde':'\xD5','otimes':'\u2297','Otimes':'\u2A37','otimesas':'\u2A36','ouml':'\xF6','Ouml':'\xD6','ovbar':'\u233D','OverBar':'\u203E','OverBrace':'\u23DE','OverBracket':'\u23B4','OverParenthesis':'\u23DC','par':'\u2225','para':'\xB6','parallel':'\u2225','parsim':'\u2AF3','parsl':'\u2AFD','part':'\u2202','PartialD':'\u2202','pcy':'\u043F','Pcy':'\u041F','percnt':'%','period':'.','permil':'\u2030','perp':'\u22A5','pertenk':'\u2031','pfr':'\uD835\uDD2D','Pfr':'\uD835\uDD13','phi':'\u03C6','Phi':'\u03A6','phiv':'\u03D5','phmmat':'\u2133','phone':'\u260E','pi':'\u03C0','Pi':'\u03A0','pitchfork':'\u22D4','piv':'\u03D6','planck':'\u210F','planckh':'\u210E','plankv':'\u210F','plus':'+','plusacir':'\u2A23','plusb':'\u229E','pluscir':'\u2A22','plusdo':'\u2214','plusdu':'\u2A25','pluse':'\u2A72','PlusMinus':'\xB1','plusmn':'\xB1','plussim':'\u2A26','plustwo':'\u2A27','pm':'\xB1','Poincareplane':'\u210C','pointint':'\u2A15','popf':'\uD835\uDD61','Popf':'\u2119','pound':'\xA3','pr':'\u227A','Pr':'\u2ABB','prap':'\u2AB7','prcue':'\u227C','pre':'\u2AAF','prE':'\u2AB3','prec':'\u227A','precapprox':'\u2AB7','preccurlyeq':'\u227C','Precedes':'\u227A','PrecedesEqual':'\u2AAF','PrecedesSlantEqual':'\u227C','PrecedesTilde':'\u227E','preceq':'\u2AAF','precnapprox':'\u2AB9','precneqq':'\u2AB5','precnsim':'\u22E8','precsim':'\u227E','prime':'\u2032','Prime':'\u2033','primes':'\u2119','prnap':'\u2AB9','prnE':'\u2AB5','prnsim':'\u22E8','prod':'\u220F','Product':'\u220F','profalar':'\u232E','profline':'\u2312','profsurf':'\u2313','prop':'\u221D','Proportion':'\u2237','Proportional':'\u221D','propto':'\u221D','prsim':'\u227E','prurel':'\u22B0','pscr':'\uD835\uDCC5','Pscr':'\uD835\uDCAB','psi':'\u03C8','Psi':'\u03A8','puncsp':'\u2008','qfr':'\uD835\uDD2E','Qfr':'\uD835\uDD14','qint':'\u2A0C','qopf':'\uD835\uDD62','Qopf':'\u211A','qprime':'\u2057','qscr':'\uD835\uDCC6','Qscr':'\uD835\uDCAC','quaternions':'\u210D','quatint':'\u2A16','quest':'?','questeq':'\u225F','quot':'"','QUOT':'"','rAarr':'\u21DB','race':'\u223D\u0331','racute':'\u0155','Racute':'\u0154','radic':'\u221A','raemptyv':'\u29B3','rang':'\u27E9','Rang':'\u27EB','rangd':'\u2992','range':'\u29A5','rangle':'\u27E9','raquo':'\xBB','rarr':'\u2192','rArr':'\u21D2','Rarr':'\u21A0','rarrap':'\u2975','rarrb':'\u21E5','rarrbfs':'\u2920','rarrc':'\u2933','rarrfs':'\u291E','rarrhk':'\u21AA','rarrlp':'\u21AC','rarrpl':'\u2945','rarrsim':'\u2974','rarrtl':'\u21A3','Rarrtl':'\u2916','rarrw':'\u219D','ratail':'\u291A','rAtail':'\u291C','ratio':'\u2236','rationals':'\u211A','rbarr':'\u290D','rBarr':'\u290F','RBarr':'\u2910','rbbrk':'\u2773','rbrace':'}','rbrack':']','rbrke':'\u298C','rbrksld':'\u298E','rbrkslu':'\u2990','rcaron':'\u0159','Rcaron':'\u0158','rcedil':'\u0157','Rcedil':'\u0156','rceil':'\u2309','rcub':'}','rcy':'\u0440','Rcy':'\u0420','rdca':'\u2937','rdldhar':'\u2969','rdquo':'\u201D','rdquor':'\u201D','rdsh':'\u21B3','Re':'\u211C','real':'\u211C','realine':'\u211B','realpart':'\u211C','reals':'\u211D','rect':'\u25AD','reg':'\xAE','REG':'\xAE','ReverseElement':'\u220B','ReverseEquilibrium':'\u21CB','ReverseUpEquilibrium':'\u296F','rfisht':'\u297D','rfloor':'\u230B','rfr':'\uD835\uDD2F','Rfr':'\u211C','rHar':'\u2964','rhard':'\u21C1','rharu':'\u21C0','rharul':'\u296C','rho':'\u03C1','Rho':'\u03A1','rhov':'\u03F1','RightAngleBracket':'\u27E9','rightarrow':'\u2192','Rightarrow':'\u21D2','RightArrow':'\u2192','RightArrowBar':'\u21E5','RightArrowLeftArrow':'\u21C4','rightarrowtail':'\u21A3','RightCeiling':'\u2309','RightDoubleBracket':'\u27E7','RightDownTeeVector':'\u295D','RightDownVector':'\u21C2','RightDownVectorBar':'\u2955','RightFloor':'\u230B','rightharpoondown':'\u21C1','rightharpoonup':'\u21C0','rightleftarrows':'\u21C4','rightleftharpoons':'\u21CC','rightrightarrows':'\u21C9','rightsquigarrow':'\u219D','RightTee':'\u22A2','RightTeeArrow':'\u21A6','RightTeeVector':'\u295B','rightthreetimes':'\u22CC','RightTriangle':'\u22B3','RightTriangleBar':'\u29D0','RightTriangleEqual':'\u22B5','RightUpDownVector':'\u294F','RightUpTeeVector':'\u295C','RightUpVector':'\u21BE','RightUpVectorBar':'\u2954','RightVector':'\u21C0','RightVectorBar':'\u2953','ring':'\u02DA','risingdotseq':'\u2253','rlarr':'\u21C4','rlhar':'\u21CC','rlm':'\u200F','rmoust':'\u23B1','rmoustache':'\u23B1','rnmid':'\u2AEE','roang':'\u27ED','roarr':'\u21FE','robrk':'\u27E7','ropar':'\u2986','ropf':'\uD835\uDD63','Ropf':'\u211D','roplus':'\u2A2E','rotimes':'\u2A35','RoundImplies':'\u2970','rpar':')','rpargt':'\u2994','rppolint':'\u2A12','rrarr':'\u21C9','Rrightarrow':'\u21DB','rsaquo':'\u203A','rscr':'\uD835\uDCC7','Rscr':'\u211B','rsh':'\u21B1','Rsh':'\u21B1','rsqb':']','rsquo':'\u2019','rsquor':'\u2019','rthree':'\u22CC','rtimes':'\u22CA','rtri':'\u25B9','rtrie':'\u22B5','rtrif':'\u25B8','rtriltri':'\u29CE','RuleDelayed':'\u29F4','ruluhar':'\u2968','rx':'\u211E','sacute':'\u015B','Sacute':'\u015A','sbquo':'\u201A','sc':'\u227B','Sc':'\u2ABC','scap':'\u2AB8','scaron':'\u0161','Scaron':'\u0160','sccue':'\u227D','sce':'\u2AB0','scE':'\u2AB4','scedil':'\u015F','Scedil':'\u015E','scirc':'\u015D','Scirc':'\u015C','scnap':'\u2ABA','scnE':'\u2AB6','scnsim':'\u22E9','scpolint':'\u2A13','scsim':'\u227F','scy':'\u0441','Scy':'\u0421','sdot':'\u22C5','sdotb':'\u22A1','sdote':'\u2A66','searhk':'\u2925','searr':'\u2198','seArr':'\u21D8','searrow':'\u2198','sect':'\xA7','semi':';','seswar':'\u2929','setminus':'\u2216','setmn':'\u2216','sext':'\u2736','sfr':'\uD835\uDD30','Sfr':'\uD835\uDD16','sfrown':'\u2322','sharp':'\u266F','shchcy':'\u0449','SHCHcy':'\u0429','shcy':'\u0448','SHcy':'\u0428','ShortDownArrow':'\u2193','ShortLeftArrow':'\u2190','shortmid':'\u2223','shortparallel':'\u2225','ShortRightArrow':'\u2192','ShortUpArrow':'\u2191','shy':'\xAD','sigma':'\u03C3','Sigma':'\u03A3','sigmaf':'\u03C2','sigmav':'\u03C2','sim':'\u223C','simdot':'\u2A6A','sime':'\u2243','simeq':'\u2243','simg':'\u2A9E','simgE':'\u2AA0','siml':'\u2A9D','simlE':'\u2A9F','simne':'\u2246','simplus':'\u2A24','simrarr':'\u2972','slarr':'\u2190','SmallCircle':'\u2218','smallsetminus':'\u2216','smashp':'\u2A33','smeparsl':'\u29E4','smid':'\u2223','smile':'\u2323','smt':'\u2AAA','smte':'\u2AAC','smtes':'\u2AAC\uFE00','softcy':'\u044C','SOFTcy':'\u042C','sol':'/','solb':'\u29C4','solbar':'\u233F','sopf':'\uD835\uDD64','Sopf':'\uD835\uDD4A','spades':'\u2660','spadesuit':'\u2660','spar':'\u2225','sqcap':'\u2293','sqcaps':'\u2293\uFE00','sqcup':'\u2294','sqcups':'\u2294\uFE00','Sqrt':'\u221A','sqsub':'\u228F','sqsube':'\u2291','sqsubset':'\u228F','sqsubseteq':'\u2291','sqsup':'\u2290','sqsupe':'\u2292','sqsupset':'\u2290','sqsupseteq':'\u2292','squ':'\u25A1','square':'\u25A1','Square':'\u25A1','SquareIntersection':'\u2293','SquareSubset':'\u228F','SquareSubsetEqual':'\u2291','SquareSuperset':'\u2290','SquareSupersetEqual':'\u2292','SquareUnion':'\u2294','squarf':'\u25AA','squf':'\u25AA','srarr':'\u2192','sscr':'\uD835\uDCC8','Sscr':'\uD835\uDCAE','ssetmn':'\u2216','ssmile':'\u2323','sstarf':'\u22C6','star':'\u2606','Star':'\u22C6','starf':'\u2605','straightepsilon':'\u03F5','straightphi':'\u03D5','strns':'\xAF','sub':'\u2282','Sub':'\u22D0','subdot':'\u2ABD','sube':'\u2286','subE':'\u2AC5','subedot':'\u2AC3','submult':'\u2AC1','subne':'\u228A','subnE':'\u2ACB','subplus':'\u2ABF','subrarr':'\u2979','subset':'\u2282','Subset':'\u22D0','subseteq':'\u2286','subseteqq':'\u2AC5','SubsetEqual':'\u2286','subsetneq':'\u228A','subsetneqq':'\u2ACB','subsim':'\u2AC7','subsub':'\u2AD5','subsup':'\u2AD3','succ':'\u227B','succapprox':'\u2AB8','succcurlyeq':'\u227D','Succeeds':'\u227B','SucceedsEqual':'\u2AB0','SucceedsSlantEqual':'\u227D','SucceedsTilde':'\u227F','succeq':'\u2AB0','succnapprox':'\u2ABA','succneqq':'\u2AB6','succnsim':'\u22E9','succsim':'\u227F','SuchThat':'\u220B','sum':'\u2211','Sum':'\u2211','sung':'\u266A','sup':'\u2283','Sup':'\u22D1','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','supdot':'\u2ABE','supdsub':'\u2AD8','supe':'\u2287','supE':'\u2AC6','supedot':'\u2AC4','Superset':'\u2283','SupersetEqual':'\u2287','suphsol':'\u27C9','suphsub':'\u2AD7','suplarr':'\u297B','supmult':'\u2AC2','supne':'\u228B','supnE':'\u2ACC','supplus':'\u2AC0','supset':'\u2283','Supset':'\u22D1','supseteq':'\u2287','supseteqq':'\u2AC6','supsetneq':'\u228B','supsetneqq':'\u2ACC','supsim':'\u2AC8','supsub':'\u2AD4','supsup':'\u2AD6','swarhk':'\u2926','swarr':'\u2199','swArr':'\u21D9','swarrow':'\u2199','swnwar':'\u292A','szlig':'\xDF','Tab':'\t','target':'\u2316','tau':'\u03C4','Tau':'\u03A4','tbrk':'\u23B4','tcaron':'\u0165','Tcaron':'\u0164','tcedil':'\u0163','Tcedil':'\u0162','tcy':'\u0442','Tcy':'\u0422','tdot':'\u20DB','telrec':'\u2315','tfr':'\uD835\uDD31','Tfr':'\uD835\uDD17','there4':'\u2234','therefore':'\u2234','Therefore':'\u2234','theta':'\u03B8','Theta':'\u0398','thetasym':'\u03D1','thetav':'\u03D1','thickapprox':'\u2248','thicksim':'\u223C','ThickSpace':'\u205F\u200A','thinsp':'\u2009','ThinSpace':'\u2009','thkap':'\u2248','thksim':'\u223C','thorn':'\xFE','THORN':'\xDE','tilde':'\u02DC','Tilde':'\u223C','TildeEqual':'\u2243','TildeFullEqual':'\u2245','TildeTilde':'\u2248','times':'\xD7','timesb':'\u22A0','timesbar':'\u2A31','timesd':'\u2A30','tint':'\u222D','toea':'\u2928','top':'\u22A4','topbot':'\u2336','topcir':'\u2AF1','topf':'\uD835\uDD65','Topf':'\uD835\uDD4B','topfork':'\u2ADA','tosa':'\u2929','tprime':'\u2034','trade':'\u2122','TRADE':'\u2122','triangle':'\u25B5','triangledown':'\u25BF','triangleleft':'\u25C3','trianglelefteq':'\u22B4','triangleq':'\u225C','triangleright':'\u25B9','trianglerighteq':'\u22B5','tridot':'\u25EC','trie':'\u225C','triminus':'\u2A3A','TripleDot':'\u20DB','triplus':'\u2A39','trisb':'\u29CD','tritime':'\u2A3B','trpezium':'\u23E2','tscr':'\uD835\uDCC9','Tscr':'\uD835\uDCAF','tscy':'\u0446','TScy':'\u0426','tshcy':'\u045B','TSHcy':'\u040B','tstrok':'\u0167','Tstrok':'\u0166','twixt':'\u226C','twoheadleftarrow':'\u219E','twoheadrightarrow':'\u21A0','uacute':'\xFA','Uacute':'\xDA','uarr':'\u2191','uArr':'\u21D1','Uarr':'\u219F','Uarrocir':'\u2949','ubrcy':'\u045E','Ubrcy':'\u040E','ubreve':'\u016D','Ubreve':'\u016C','ucirc':'\xFB','Ucirc':'\xDB','ucy':'\u0443','Ucy':'\u0423','udarr':'\u21C5','udblac':'\u0171','Udblac':'\u0170','udhar':'\u296E','ufisht':'\u297E','ufr':'\uD835\uDD32','Ufr':'\uD835\uDD18','ugrave':'\xF9','Ugrave':'\xD9','uHar':'\u2963','uharl':'\u21BF','uharr':'\u21BE','uhblk':'\u2580','ulcorn':'\u231C','ulcorner':'\u231C','ulcrop':'\u230F','ultri':'\u25F8','umacr':'\u016B','Umacr':'\u016A','uml':'\xA8','UnderBar':'_','UnderBrace':'\u23DF','UnderBracket':'\u23B5','UnderParenthesis':'\u23DD','Union':'\u22C3','UnionPlus':'\u228E','uogon':'\u0173','Uogon':'\u0172','uopf':'\uD835\uDD66','Uopf':'\uD835\uDD4C','uparrow':'\u2191','Uparrow':'\u21D1','UpArrow':'\u2191','UpArrowBar':'\u2912','UpArrowDownArrow':'\u21C5','updownarrow':'\u2195','Updownarrow':'\u21D5','UpDownArrow':'\u2195','UpEquilibrium':'\u296E','upharpoonleft':'\u21BF','upharpoonright':'\u21BE','uplus':'\u228E','UpperLeftArrow':'\u2196','UpperRightArrow':'\u2197','upsi':'\u03C5','Upsi':'\u03D2','upsih':'\u03D2','upsilon':'\u03C5','Upsilon':'\u03A5','UpTee':'\u22A5','UpTeeArrow':'\u21A5','upuparrows':'\u21C8','urcorn':'\u231D','urcorner':'\u231D','urcrop':'\u230E','uring':'\u016F','Uring':'\u016E','urtri':'\u25F9','uscr':'\uD835\uDCCA','Uscr':'\uD835\uDCB0','utdot':'\u22F0','utilde':'\u0169','Utilde':'\u0168','utri':'\u25B5','utrif':'\u25B4','uuarr':'\u21C8','uuml':'\xFC','Uuml':'\xDC','uwangle':'\u29A7','vangrt':'\u299C','varepsilon':'\u03F5','varkappa':'\u03F0','varnothing':'\u2205','varphi':'\u03D5','varpi':'\u03D6','varpropto':'\u221D','varr':'\u2195','vArr':'\u21D5','varrho':'\u03F1','varsigma':'\u03C2','varsubsetneq':'\u228A\uFE00','varsubsetneqq':'\u2ACB\uFE00','varsupsetneq':'\u228B\uFE00','varsupsetneqq':'\u2ACC\uFE00','vartheta':'\u03D1','vartriangleleft':'\u22B2','vartriangleright':'\u22B3','vBar':'\u2AE8','Vbar':'\u2AEB','vBarv':'\u2AE9','vcy':'\u0432','Vcy':'\u0412','vdash':'\u22A2','vDash':'\u22A8','Vdash':'\u22A9','VDash':'\u22AB','Vdashl':'\u2AE6','vee':'\u2228','Vee':'\u22C1','veebar':'\u22BB','veeeq':'\u225A','vellip':'\u22EE','verbar':'|','Verbar':'\u2016','vert':'|','Vert':'\u2016','VerticalBar':'\u2223','VerticalLine':'|','VerticalSeparator':'\u2758','VerticalTilde':'\u2240','VeryThinSpace':'\u200A','vfr':'\uD835\uDD33','Vfr':'\uD835\uDD19','vltri':'\u22B2','vnsub':'\u2282\u20D2','vnsup':'\u2283\u20D2','vopf':'\uD835\uDD67','Vopf':'\uD835\uDD4D','vprop':'\u221D','vrtri':'\u22B3','vscr':'\uD835\uDCCB','Vscr':'\uD835\uDCB1','vsubne':'\u228A\uFE00','vsubnE':'\u2ACB\uFE00','vsupne':'\u228B\uFE00','vsupnE':'\u2ACC\uFE00','Vvdash':'\u22AA','vzigzag':'\u299A','wcirc':'\u0175','Wcirc':'\u0174','wedbar':'\u2A5F','wedge':'\u2227','Wedge':'\u22C0','wedgeq':'\u2259','weierp':'\u2118','wfr':'\uD835\uDD34','Wfr':'\uD835\uDD1A','wopf':'\uD835\uDD68','Wopf':'\uD835\uDD4E','wp':'\u2118','wr':'\u2240','wreath':'\u2240','wscr':'\uD835\uDCCC','Wscr':'\uD835\uDCB2','xcap':'\u22C2','xcirc':'\u25EF','xcup':'\u22C3','xdtri':'\u25BD','xfr':'\uD835\uDD35','Xfr':'\uD835\uDD1B','xharr':'\u27F7','xhArr':'\u27FA','xi':'\u03BE','Xi':'\u039E','xlarr':'\u27F5','xlArr':'\u27F8','xmap':'\u27FC','xnis':'\u22FB','xodot':'\u2A00','xopf':'\uD835\uDD69','Xopf':'\uD835\uDD4F','xoplus':'\u2A01','xotime':'\u2A02','xrarr':'\u27F6','xrArr':'\u27F9','xscr':'\uD835\uDCCD','Xscr':'\uD835\uDCB3','xsqcup':'\u2A06','xuplus':'\u2A04','xutri':'\u25B3','xvee':'\u22C1','xwedge':'\u22C0','yacute':'\xFD','Yacute':'\xDD','yacy':'\u044F','YAcy':'\u042F','ycirc':'\u0177','Ycirc':'\u0176','ycy':'\u044B','Ycy':'\u042B','yen':'\xA5','yfr':'\uD835\uDD36','Yfr':'\uD835\uDD1C','yicy':'\u0457','YIcy':'\u0407','yopf':'\uD835\uDD6A','Yopf':'\uD835\uDD50','yscr':'\uD835\uDCCE','Yscr':'\uD835\uDCB4','yucy':'\u044E','YUcy':'\u042E','yuml':'\xFF','Yuml':'\u0178','zacute':'\u017A','Zacute':'\u0179','zcaron':'\u017E','Zcaron':'\u017D','zcy':'\u0437','Zcy':'\u0417','zdot':'\u017C','Zdot':'\u017B','zeetrf':'\u2128','ZeroWidthSpace':'\u200B','zeta':'\u03B6','Zeta':'\u0396','zfr':'\uD835\uDD37','Zfr':'\u2128','zhcy':'\u0436','ZHcy':'\u0416','zigrarr':'\u21DD','zopf':'\uD835\uDD6B','Zopf':'\u2124','zscr':'\uD835\uDCCF','Zscr':'\uD835\uDCB5','zwj':'\u200D','zwnj':'\u200C'};
- var decodeMapLegacy = {'aacute':'\xE1','Aacute':'\xC1','acirc':'\xE2','Acirc':'\xC2','acute':'\xB4','aelig':'\xE6','AElig':'\xC6','agrave':'\xE0','Agrave':'\xC0','amp':'&','AMP':'&','aring':'\xE5','Aring':'\xC5','atilde':'\xE3','Atilde':'\xC3','auml':'\xE4','Auml':'\xC4','brvbar':'\xA6','ccedil':'\xE7','Ccedil':'\xC7','cedil':'\xB8','cent':'\xA2','copy':'\xA9','COPY':'\xA9','curren':'\xA4','deg':'\xB0','divide':'\xF7','eacute':'\xE9','Eacute':'\xC9','ecirc':'\xEA','Ecirc':'\xCA','egrave':'\xE8','Egrave':'\xC8','eth':'\xF0','ETH':'\xD0','euml':'\xEB','Euml':'\xCB','frac12':'\xBD','frac14':'\xBC','frac34':'\xBE','gt':'>','GT':'>','iacute':'\xED','Iacute':'\xCD','icirc':'\xEE','Icirc':'\xCE','iexcl':'\xA1','igrave':'\xEC','Igrave':'\xCC','iquest':'\xBF','iuml':'\xEF','Iuml':'\xCF','laquo':'\xAB','lt':'<','LT':'<','macr':'\xAF','micro':'\xB5','middot':'\xB7','nbsp':'\xA0','not':'\xAC','ntilde':'\xF1','Ntilde':'\xD1','oacute':'\xF3','Oacute':'\xD3','ocirc':'\xF4','Ocirc':'\xD4','ograve':'\xF2','Ograve':'\xD2','ordf':'\xAA','ordm':'\xBA','oslash':'\xF8','Oslash':'\xD8','otilde':'\xF5','Otilde':'\xD5','ouml':'\xF6','Ouml':'\xD6','para':'\xB6','plusmn':'\xB1','pound':'\xA3','quot':'"','QUOT':'"','raquo':'\xBB','reg':'\xAE','REG':'\xAE','sect':'\xA7','shy':'\xAD','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','szlig':'\xDF','thorn':'\xFE','THORN':'\xDE','times':'\xD7','uacute':'\xFA','Uacute':'\xDA','ucirc':'\xFB','Ucirc':'\xDB','ugrave':'\xF9','Ugrave':'\xD9','uml':'\xA8','uuml':'\xFC','Uuml':'\xDC','yacute':'\xFD','Yacute':'\xDD','yen':'\xA5','yuml':'\xFF'};
- var decodeMapNumeric = {'0':'\uFFFD','128':'\u20AC','130':'\u201A','131':'\u0192','132':'\u201E','133':'\u2026','134':'\u2020','135':'\u2021','136':'\u02C6','137':'\u2030','138':'\u0160','139':'\u2039','140':'\u0152','142':'\u017D','145':'\u2018','146':'\u2019','147':'\u201C','148':'\u201D','149':'\u2022','150':'\u2013','151':'\u2014','152':'\u02DC','153':'\u2122','154':'\u0161','155':'\u203A','156':'\u0153','158':'\u017E','159':'\u0178'};
- var invalidReferenceCodePoints = [1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65000,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];
-
- /*--------------------------------------------------------------------------*/
-
- var stringFromCharCode = String.fromCharCode;
-
- var object = {};
- var hasOwnProperty = object.hasOwnProperty;
- var has = function(object, propertyName) {
- return hasOwnProperty.call(object, propertyName);
- };
-
- var contains = function(array, value) {
- var index = -1;
- var length = array.length;
- while (++index < length) {
- if (array[index] == value) {
- return true;
- }
- }
- return false;
- };
-
- var merge = function(options, defaults) {
- if (!options) {
- return defaults;
- }
- var result = {};
- var key;
- for (key in defaults) {
- // A `hasOwnProperty` check is not needed here, since only recognized
- // option names are used anyway. Any others are ignored.
- result[key] = has(options, key) ? options[key] : defaults[key];
- }
- return result;
- };
-
- // Modified version of `ucs2encode`; see https://mths.be/punycode.
- var codePointToSymbol = function(codePoint, strict) {
- var output = '';
- if ((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF) {
- // See issue #4:
- // “Otherwise, if the number is in the range 0xD800 to 0xDFFF or is
- // greater than 0x10FFFF, then this is a parse error. Return a U+FFFD
- // REPLACEMENT CHARACTER.”
- if (strict) {
- parseError('character reference outside the permissible Unicode range');
- }
- return '\uFFFD';
- }
- if (has(decodeMapNumeric, codePoint)) {
- if (strict) {
- parseError('disallowed character reference');
- }
- return decodeMapNumeric[codePoint];
- }
- if (strict && contains(invalidReferenceCodePoints, codePoint)) {
- parseError('disallowed character reference');
- }
- if (codePoint > 0xFFFF) {
- codePoint -= 0x10000;
- output += stringFromCharCode(codePoint >>> 10 & 0x3FF | 0xD800);
- codePoint = 0xDC00 | codePoint & 0x3FF;
- }
- output += stringFromCharCode(codePoint);
- return output;
- };
-
- var hexEscape = function(codePoint) {
- return '&#x' + codePoint.toString(16).toUpperCase() + ';';
- };
-
- var decEscape = function(codePoint) {
- return '&#' + codePoint + ';';
- };
-
- var parseError = function(message) {
- throw Error('Parse error: ' + message);
- };
-
- /*--------------------------------------------------------------------------*/
-
- var encode = function(string, options) {
- options = merge(options, encode.options);
- var strict = options.strict;
- if (strict && regexInvalidRawCodePoint.test(string)) {
- parseError('forbidden code point');
- }
- var encodeEverything = options.encodeEverything;
- var useNamedReferences = options.useNamedReferences;
- var allowUnsafeSymbols = options.allowUnsafeSymbols;
- var escapeCodePoint = options.decimal ? decEscape : hexEscape;
-
- var escapeBmpSymbol = function(symbol) {
- return escapeCodePoint(symbol.charCodeAt(0));
- };
-
- if (encodeEverything) {
- // Encode ASCII symbols.
- string = string.replace(regexAsciiWhitelist, function(symbol) {
- // Use named references if requested & possible.
- if (useNamedReferences && has(encodeMap, symbol)) {
- return '&' + encodeMap[symbol] + ';';
- }
- return escapeBmpSymbol(symbol);
- });
- // Shorten a few escapes that represent two symbols, of which at least one
- // is within the ASCII range.
- if (useNamedReferences) {
- string = string
- .replace(/&gt;\u20D2/g, '&nvgt;')
- .replace(/&lt;\u20D2/g, '&nvlt;')
- .replace(/&#x66;&#x6A;/g, '&fjlig;');
- }
- // Encode non-ASCII symbols.
- if (useNamedReferences) {
- // Encode non-ASCII symbols that can be replaced with a named reference.
- string = string.replace(regexEncodeNonAscii, function(string) {
- // Note: there is no need to check `has(encodeMap, string)` here.
- return '&' + encodeMap[string] + ';';
- });
- }
- // Note: any remaining non-ASCII symbols are handled outside of the `if`.
- } else if (useNamedReferences) {
- // Apply named character references.
- // Encode `<>"'&` using named character references.
- if (!allowUnsafeSymbols) {
- string = string.replace(regexEscape, function(string) {
- return '&' + encodeMap[string] + ';'; // no need to check `has()` here
- });
- }
- // Shorten escapes that represent two symbols, of which at least one is
- // `<>"'&`.
- string = string
- .replace(/&gt;\u20D2/g, '&nvgt;')
- .replace(/&lt;\u20D2/g, '&nvlt;');
- // Encode non-ASCII symbols that can be replaced with a named reference.
- string = string.replace(regexEncodeNonAscii, function(string) {
- // Note: there is no need to check `has(encodeMap, string)` here.
- return '&' + encodeMap[string] + ';';
- });
- } else if (!allowUnsafeSymbols) {
- // Encode `<>"'&` using hexadecimal escapes, now that they’re not handled
- // using named character references.
- string = string.replace(regexEscape, escapeBmpSymbol);
- }
- return string
- // Encode astral symbols.
- .replace(regexAstralSymbols, function($0) {
- // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
- var high = $0.charCodeAt(0);
- var low = $0.charCodeAt(1);
- var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000;
- return escapeCodePoint(codePoint);
- })
- // Encode any remaining BMP symbols that are not printable ASCII symbols
- // using a hexadecimal escape.
- .replace(regexBmpWhitelist, escapeBmpSymbol);
- };
- // Expose default options (so they can be overridden globally).
- encode.options = {
- 'allowUnsafeSymbols': false,
- 'encodeEverything': false,
- 'strict': false,
- 'useNamedReferences': false,
- 'decimal' : false
- };
-
- var decode = function(html, options) {
- options = merge(options, decode.options);
- var strict = options.strict;
- if (strict && regexInvalidEntity.test(html)) {
- parseError('malformed character reference');
- }
- return html.replace(regexDecode, function($0, $1, $2, $3, $4, $5, $6, $7) {
- var codePoint;
- var semicolon;
- var decDigits;
- var hexDigits;
- var reference;
- var next;
- if ($1) {
- // Decode decimal escapes, e.g. `&#119558;`.
- decDigits = $1;
- semicolon = $2;
- if (strict && !semicolon) {
- parseError('character reference was not terminated by a semicolon');
- }
- codePoint = parseInt(decDigits, 10);
- return codePointToSymbol(codePoint, strict);
- }
- if ($3) {
- // Decode hexadecimal escapes, e.g. `&#x1D306;`.
- hexDigits = $3;
- semicolon = $4;
- if (strict && !semicolon) {
- parseError('character reference was not terminated by a semicolon');
- }
- codePoint = parseInt(hexDigits, 16);
- return codePointToSymbol(codePoint, strict);
- }
- if ($5) {
- // Decode named character references with trailing `;`, e.g. `&copy;`.
- reference = $5;
- if (has(decodeMap, reference)) {
- return decodeMap[reference];
- } else {
- // Ambiguous ampersand. https://mths.be/notes/ambiguous-ampersands
- if (strict) {
- parseError(
- 'named character reference was not terminated by a semicolon'
- );
- }
- return $0;
- }
- }
- // If we’re still here, it’s a legacy reference for sure. No need for an
- // extra `if` check.
- // Decode named character references without trailing `;`, e.g. `&amp`
- // This is only a parse error if it gets converted to `&`, or if it is
- // followed by `=` in an attribute context.
- reference = $6;
- next = $7;
- if (next && options.isAttributeValue) {
- if (strict && next == '=') {
- parseError('`&` did not start a character reference');
- }
- return $0;
- } else {
- if (strict) {
- parseError(
- 'named character reference was not terminated by a semicolon'
- );
- }
- // Note: there is no need to check `has(decodeMapLegacy, reference)`.
- return decodeMapLegacy[reference] + (next || '');
- }
- });
- };
- // Expose default options (so they can be overridden globally).
- decode.options = {
- 'isAttributeValue': false,
- 'strict': false
- };
-
- var escape = function(string) {
- return string.replace(regexEscape, function($0) {
- // Note: there is no need to check `has(escapeMap, $0)` here.
- return escapeMap[$0];
- });
- };
-
- /*--------------------------------------------------------------------------*/
-
- var he = {
- 'version': '1.1.1',
- 'encode': encode,
- 'decode': decode,
- 'escape': escape,
- 'unescape': decode
- };
-
- // Some AMD build optimizers, like r.js, check for specific condition patterns
- // like the following:
- if (
- typeof define == 'function' &&
- typeof define.amd == 'object' &&
- define.amd
- ) {
- define(function() {
- return he;
- });
- } else if (freeExports && !freeExports.nodeType) {
- if (freeModule) { // in Node.js, io.js, or RingoJS v0.8.0+
- freeModule.exports = he;
- } else { // in Narwhal or RingoJS v0.7.0-
- for (var key in he) {
- has(he, key) && (freeExports[key] = he[key]);
- }
- }
- } else { // in Rhino or a web browser
- root.he = he;
- }
-
-}(this));
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{}],111:[function(require,module,exports){
-/*
-Syntax highlighting with language autodetection.
-https://highlightjs.org/
-*/
-
-(function(factory) {
-
- // Find the global object for export to both the browser and web workers.
- var globalObject = typeof window === 'object' && window ||
- typeof self === 'object' && self;
-
- // Setup highlight.js for different environments. First is Node.js or
- // CommonJS.
- if(typeof exports !== 'undefined') {
- factory(exports);
- } else if(globalObject) {
- // Export hljs globally even when using AMD for cases when this script
- // is loaded with others that may still expect a global hljs.
- globalObject.hljs = factory({});
-
- // Finally register the global hljs with AMD.
- if(typeof define === 'function' && define.amd) {
- define([], function() {
- return globalObject.hljs;
- });
- }
- }
-
-}(function(hljs) {
- // Convenience variables for build-in objects
- var ArrayProto = [],
- objectKeys = Object.keys;
-
- // Global internal variables used within the highlight.js library.
- var languages = {},
- aliases = {};
-
- // Regular expressions used throughout the highlight.js library.
- var noHighlightRe = /^(no-?highlight|plain|text)$/i,
- languagePrefixRe = /\blang(?:uage)?-([\w-]+)\b/i,
- fixMarkupRe = /((^(<[^>]+>|\t|)+|(?:\n)))/gm;
-
- var spanEndTag = '</span>';
-
- // Global options used when within external APIs. This is modified when
- // calling the `hljs.configure` function.
- var options = {
- classPrefix: 'hljs-',
- tabReplace: null,
- useBR: false,
- languages: undefined
- };
-
-
- /* Utility functions */
-
- function escape(value) {
- return value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
- }
-
- function tag(node) {
- return node.nodeName.toLowerCase();
- }
-
- function testRe(re, lexeme) {
- var match = re && re.exec(lexeme);
- return match && match.index === 0;
- }
-
- function isNotHighlighted(language) {
- return noHighlightRe.test(language);
- }
-
- function blockLanguage(block) {
- var i, match, length, _class;
- var classes = block.className + ' ';
-
- classes += block.parentNode ? block.parentNode.className : '';
-
- // language-* takes precedence over non-prefixed class names.
- match = languagePrefixRe.exec(classes);
- if (match) {
- return getLanguage(match[1]) ? match[1] : 'no-highlight';
- }
-
- classes = classes.split(/\s+/);
-
- for (i = 0, length = classes.length; i < length; i++) {
- _class = classes[i]
-
- if (isNotHighlighted(_class) || getLanguage(_class)) {
- return _class;
- }
- }
- }
-
- function inherit(parent) { // inherit(parent, override_obj, override_obj, ...)
- var key;
- var result = {};
- var objects = Array.prototype.slice.call(arguments, 1);
-
- for (key in parent)
- result[key] = parent[key];
- objects.forEach(function(obj) {
- for (key in obj)
- result[key] = obj[key];
- });
- return result;
- }
-
- /* Stream merging */
-
- function nodeStream(node) {
- var result = [];
- (function _nodeStream(node, offset) {
- for (var child = node.firstChild; child; child = child.nextSibling) {
- if (child.nodeType === 3)
- offset += child.nodeValue.length;
- else if (child.nodeType === 1) {
- result.push({
- event: 'start',
- offset: offset,
- node: child
- });
- offset = _nodeStream(child, offset);
- // Prevent void elements from having an end tag that would actually
- // double them in the output. There are more void elements in HTML
- // but we list only those realistically expected in code display.
- if (!tag(child).match(/br|hr|img|input/)) {
- result.push({
- event: 'stop',
- offset: offset,
- node: child
- });
- }
- }
- }
- return offset;
- })(node, 0);
- return result;
- }
-
- function mergeStreams(original, highlighted, value) {
- var processed = 0;
- var result = '';
- var nodeStack = [];
-
- function selectStream() {
- if (!original.length || !highlighted.length) {
- return original.length ? original : highlighted;
- }
- if (original[0].offset !== highlighted[0].offset) {
- return (original[0].offset < highlighted[0].offset) ? original : highlighted;
- }
-
- /*
- To avoid starting the stream just before it should stop the order is
- ensured that original always starts first and closes last:
-
- if (event1 == 'start' && event2 == 'start')
- return original;
- if (event1 == 'start' && event2 == 'stop')
- return highlighted;
- if (event1 == 'stop' && event2 == 'start')
- return original;
- if (event1 == 'stop' && event2 == 'stop')
- return highlighted;
-
- ... which is collapsed to:
- */
- return highlighted[0].event === 'start' ? original : highlighted;
- }
-
- function open(node) {
- function attr_str(a) {return ' ' + a.nodeName + '="' + escape(a.value).replace('"', '&quot;') + '"';}
- result += '<' + tag(node) + ArrayProto.map.call(node.attributes, attr_str).join('') + '>';
- }
-
- function close(node) {
- result += '</' + tag(node) + '>';
- }
-
- function render(event) {
- (event.event === 'start' ? open : close)(event.node);
- }
-
- while (original.length || highlighted.length) {
- var stream = selectStream();
- result += escape(value.substring(processed, stream[0].offset));
- processed = stream[0].offset;
- if (stream === original) {
- /*
- On any opening or closing tag of the original markup we first close
- the entire highlighted node stack, then render the original tag along
- with all the following original tags at the same offset and then
- reopen all the tags on the highlighted stack.
- */
- nodeStack.reverse().forEach(close);
- do {
- render(stream.splice(0, 1)[0]);
- stream = selectStream();
- } while (stream === original && stream.length && stream[0].offset === processed);
- nodeStack.reverse().forEach(open);
- } else {
- if (stream[0].event === 'start') {
- nodeStack.push(stream[0].node);
- } else {
- nodeStack.pop();
- }
- render(stream.splice(0, 1)[0]);
- }
- }
- return result + escape(value.substr(processed));
- }
-
- /* Initialization */
-
- function expand_mode(mode) {
- if (mode.variants && !mode.cached_variants) {
- mode.cached_variants = mode.variants.map(function(variant) {
- return inherit(mode, {variants: null}, variant);
- });
- }
- return mode.cached_variants || (mode.endsWithParent && [inherit(mode)]) || [mode];
- }
-
- function compileLanguage(language) {
-
- function reStr(re) {
- return (re && re.source) || re;
- }
-
- function langRe(value, global) {
- return new RegExp(
- reStr(value),
- 'm' + (language.case_insensitive ? 'i' : '') + (global ? 'g' : '')
- );
- }
-
- function compileMode(mode, parent) {
- if (mode.compiled)
- return;
- mode.compiled = true;
-
- mode.keywords = mode.keywords || mode.beginKeywords;
- if (mode.keywords) {
- var compiled_keywords = {};
-
- var flatten = function(className, str) {
- if (language.case_insensitive) {
- str = str.toLowerCase();
- }
- str.split(' ').forEach(function(kw) {
- var pair = kw.split('|');
- compiled_keywords[pair[0]] = [className, pair[1] ? Number(pair[1]) : 1];
- });
- };
-
- if (typeof mode.keywords === 'string') { // string
- flatten('keyword', mode.keywords);
- } else {
- objectKeys(mode.keywords).forEach(function (className) {
- flatten(className, mode.keywords[className]);
- });
- }
- mode.keywords = compiled_keywords;
- }
- mode.lexemesRe = langRe(mode.lexemes || /\w+/, true);
-
- if (parent) {
- if (mode.beginKeywords) {
- mode.begin = '\\b(' + mode.beginKeywords.split(' ').join('|') + ')\\b';
- }
- if (!mode.begin)
- mode.begin = /\B|\b/;
- mode.beginRe = langRe(mode.begin);
- if (!mode.end && !mode.endsWithParent)
- mode.end = /\B|\b/;
- if (mode.end)
- mode.endRe = langRe(mode.end);
- mode.terminator_end = reStr(mode.end) || '';
- if (mode.endsWithParent && parent.terminator_end)
- mode.terminator_end += (mode.end ? '|' : '') + parent.terminator_end;
- }
- if (mode.illegal)
- mode.illegalRe = langRe(mode.illegal);
- if (mode.relevance == null)
- mode.relevance = 1;
- if (!mode.contains) {
- mode.contains = [];
- }
- mode.contains = Array.prototype.concat.apply([], mode.contains.map(function(c) {
- return expand_mode(c === 'self' ? mode : c)
- }));
- mode.contains.forEach(function(c) {compileMode(c, mode);});
-
- if (mode.starts) {
- compileMode(mode.starts, parent);
- }
-
- var terminators =
- mode.contains.map(function(c) {
- return c.beginKeywords ? '\\.?(' + c.begin + ')\\.?' : c.begin;
- })
- .concat([mode.terminator_end, mode.illegal])
- .map(reStr)
- .filter(Boolean);
- mode.terminators = terminators.length ? langRe(terminators.join('|'), true) : {exec: function(/*s*/) {return null;}};
- }
-
- compileMode(language);
- }
-
- /*
- Core highlighting function. Accepts a language name, or an alias, and a
- string with the code to highlight. Returns an object with the following
- properties:
-
- - relevance (int)
- - value (an HTML string with highlighting markup)
-
- */
- function highlight(name, value, ignore_illegals, continuation) {
-
- function subMode(lexeme, mode) {
- var i, length;
-
- for (i = 0, length = mode.contains.length; i < length; i++) {
- if (testRe(mode.contains[i].beginRe, lexeme)) {
- return mode.contains[i];
- }
- }
- }
-
- function endOfMode(mode, lexeme) {
- if (testRe(mode.endRe, lexeme)) {
- while (mode.endsParent && mode.parent) {
- mode = mode.parent;
- }
- return mode;
- }
- if (mode.endsWithParent) {
- return endOfMode(mode.parent, lexeme);
- }
- }
-
- function isIllegal(lexeme, mode) {
- return !ignore_illegals && testRe(mode.illegalRe, lexeme);
- }
-
- function keywordMatch(mode, match) {
- var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];
- return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];
- }
-
- function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {
- var classPrefix = noPrefix ? '' : options.classPrefix,
- openSpan = '<span class="' + classPrefix,
- closeSpan = leaveOpen ? '' : spanEndTag
-
- openSpan += classname + '">';
-
- return openSpan + insideSpan + closeSpan;
- }
-
- function processKeywords() {
- var keyword_match, last_index, match, result;
-
- if (!top.keywords)
- return escape(mode_buffer);
-
- result = '';
- last_index = 0;
- top.lexemesRe.lastIndex = 0;
- match = top.lexemesRe.exec(mode_buffer);
-
- while (match) {
- result += escape(mode_buffer.substring(last_index, match.index));
- keyword_match = keywordMatch(top, match);
- if (keyword_match) {
- relevance += keyword_match[1];
- result += buildSpan(keyword_match[0], escape(match[0]));
- } else {
- result += escape(match[0]);
- }
- last_index = top.lexemesRe.lastIndex;
- match = top.lexemesRe.exec(mode_buffer);
- }
- return result + escape(mode_buffer.substr(last_index));
- }
-
- function processSubLanguage() {
- var explicit = typeof top.subLanguage === 'string';
- if (explicit && !languages[top.subLanguage]) {
- return escape(mode_buffer);
- }
-
- var result = explicit ?
- highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :
- highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);
-
- // Counting embedded language score towards the host language may be disabled
- // with zeroing the containing mode relevance. Usecase in point is Markdown that
- // allows XML everywhere and makes every XML snippet to have a much larger Markdown
- // score.
- if (top.relevance > 0) {
- relevance += result.relevance;
- }
- if (explicit) {
- continuations[top.subLanguage] = result.top;
- }
- return buildSpan(result.language, result.value, false, true);
- }
-
- function processBuffer() {
- result += (top.subLanguage != null ? processSubLanguage() : processKeywords());
- mode_buffer = '';
- }
-
- function startNewMode(mode) {
- result += mode.className? buildSpan(mode.className, '', true): '';
- top = Object.create(mode, {parent: {value: top}});
- }
-
- function processLexeme(buffer, lexeme) {
-
- mode_buffer += buffer;
-
- if (lexeme == null) {
- processBuffer();
- return 0;
- }
-
- var new_mode = subMode(lexeme, top);
- if (new_mode) {
- if (new_mode.skip) {
- mode_buffer += lexeme;
- } else {
- if (new_mode.excludeBegin) {
- mode_buffer += lexeme;
- }
- processBuffer();
- if (!new_mode.returnBegin && !new_mode.excludeBegin) {
- mode_buffer = lexeme;
- }
- }
- startNewMode(new_mode, lexeme);
- return new_mode.returnBegin ? 0 : lexeme.length;
- }
-
- var end_mode = endOfMode(top, lexeme);
- if (end_mode) {
- var origin = top;
- if (origin.skip) {
- mode_buffer += lexeme;
- } else {
- if (!(origin.returnEnd || origin.excludeEnd)) {
- mode_buffer += lexeme;
- }
- processBuffer();
- if (origin.excludeEnd) {
- mode_buffer = lexeme;
- }
- }
- do {
- if (top.className) {
- result += spanEndTag;
- }
- if (!top.skip) {
- relevance += top.relevance;
- }
- top = top.parent;
- } while (top !== end_mode.parent);
- if (end_mode.starts) {
- startNewMode(end_mode.starts, '');
- }
- return origin.returnEnd ? 0 : lexeme.length;
- }
-
- if (isIllegal(lexeme, top))
- throw new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || '<unnamed>') + '"');
-
- /*
- Parser should not reach this point as all types of lexemes should be caught
- earlier, but if it does due to some bug make sure it advances at least one
- character forward to prevent infinite looping.
- */
- mode_buffer += lexeme;
- return lexeme.length || 1;
- }
-
- var language = getLanguage(name);
- if (!language) {
- throw new Error('Unknown language: "' + name + '"');
- }
-
- compileLanguage(language);
- var top = continuation || language;
- var continuations = {}; // keep continuations for sub-languages
- var result = '', current;
- for(current = top; current !== language; current = current.parent) {
- if (current.className) {
- result = buildSpan(current.className, '', true) + result;
- }
- }
- var mode_buffer = '';
- var relevance = 0;
- try {
- var match, count, index = 0;
- while (true) {
- top.terminators.lastIndex = index;
- match = top.terminators.exec(value);
- if (!match)
- break;
- count = processLexeme(value.substring(index, match.index), match[0]);
- index = match.index + count;
- }
- processLexeme(value.substr(index));
- for(current = top; current.parent; current = current.parent) { // close dangling modes
- if (current.className) {
- result += spanEndTag;
- }
- }
- return {
- relevance: relevance,
- value: result,
- language: name,
- top: top
- };
- } catch (e) {
- if (e.message && e.message.indexOf('Illegal') !== -1) {
- return {
- relevance: 0,
- value: escape(value)
- };
- } else {
- throw e;
- }
- }
- }
-
- /*
- Highlighting with language detection. Accepts a string with the code to
- highlight. Returns an object with the following properties:
-
- - language (detected language)
- - relevance (int)
- - value (an HTML string with highlighting markup)
- - second_best (object with the same structure for second-best heuristically
- detected language, may be absent)
-
- */
- function highlightAuto(text, languageSubset) {
- languageSubset = languageSubset || options.languages || objectKeys(languages);
- var result = {
- relevance: 0,
- value: escape(text)
- };
- var second_best = result;
- languageSubset.filter(getLanguage).forEach(function(name) {
- var current = highlight(name, text, false);
- current.language = name;
- if (current.relevance > second_best.relevance) {
- second_best = current;
- }
- if (current.relevance > result.relevance) {
- second_best = result;
- result = current;
- }
- });
- if (second_best.language) {
- result.second_best = second_best;
- }
- return result;
- }
-
- /*
- Post-processing of the highlighted markup:
-
- - replace TABs with something more useful
- - replace real line-breaks with '<br>' for non-pre containers
-
- */
- function fixMarkup(value) {
- return !(options.tabReplace || options.useBR)
- ? value
- : value.replace(fixMarkupRe, function(match, p1) {
- if (options.useBR && match === '\n') {
- return '<br>';
- } else if (options.tabReplace) {
- return p1.replace(/\t/g, options.tabReplace);
- }
- return '';
- });
- }
-
- function buildClassName(prevClassName, currentLang, resultLang) {
- var language = currentLang ? aliases[currentLang] : resultLang,
- result = [prevClassName.trim()];
-
- if (!prevClassName.match(/\bhljs\b/)) {
- result.push('hljs');
- }
-
- if (prevClassName.indexOf(language) === -1) {
- result.push(language);
- }
-
- return result.join(' ').trim();
- }
-
- /*
- Applies highlighting to a DOM node containing code. Accepts a DOM node and
- two optional parameters for fixMarkup.
- */
- function highlightBlock(block) {
- var node, originalStream, result, resultNode, text;
- var language = blockLanguage(block);
-
- if (isNotHighlighted(language))
- return;
-
- if (options.useBR) {
- node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');
- node.innerHTML = block.innerHTML.replace(/\n/g, '').replace(/<br[ \/]*>/g, '\n');
- } else {
- node = block;
- }
- text = node.textContent;
- result = language ? highlight(language, text, true) : highlightAuto(text);
-
- originalStream = nodeStream(node);
- if (originalStream.length) {
- resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');
- resultNode.innerHTML = result.value;
- result.value = mergeStreams(originalStream, nodeStream(resultNode), text);
- }
- result.value = fixMarkup(result.value);
-
- block.innerHTML = result.value;
- block.className = buildClassName(block.className, language, result.language);
- block.result = {
- language: result.language,
- re: result.relevance
- };
- if (result.second_best) {
- block.second_best = {
- language: result.second_best.language,
- re: result.second_best.relevance
- };
- }
- }
-
- /*
- Updates highlight.js global options with values passed in the form of an object.
- */
- function configure(user_options) {
- options = inherit(options, user_options);
- }
-
- /*
- Applies highlighting to all <pre><code>..</code></pre> blocks on a page.
- */
- function initHighlighting() {
- if (initHighlighting.called)
- return;
- initHighlighting.called = true;
-
- var blocks = document.querySelectorAll('pre code');
- ArrayProto.forEach.call(blocks, highlightBlock);
- }
-
- /*
- Attaches highlighting to the page load event.
- */
- function initHighlightingOnLoad() {
- addEventListener('DOMContentLoaded', initHighlighting, false);
- addEventListener('load', initHighlighting, false);
- }
-
- function registerLanguage(name, language) {
- var lang = languages[name] = language(hljs);
- if (lang.aliases) {
- lang.aliases.forEach(function(alias) {aliases[alias] = name;});
- }
- }
-
- function listLanguages() {
- return objectKeys(languages);
- }
-
- function getLanguage(name) {
- name = (name || '').toLowerCase();
- return languages[name] || languages[aliases[name]];
- }
-
- /* Interface definition */
-
- hljs.highlight = highlight;
- hljs.highlightAuto = highlightAuto;
- hljs.fixMarkup = fixMarkup;
- hljs.highlightBlock = highlightBlock;
- hljs.configure = configure;
- hljs.initHighlighting = initHighlighting;
- hljs.initHighlightingOnLoad = initHighlightingOnLoad;
- hljs.registerLanguage = registerLanguage;
- hljs.listLanguages = listLanguages;
- hljs.getLanguage = getLanguage;
- hljs.inherit = inherit;
-
- // Common regexps
- hljs.IDENT_RE = '[a-zA-Z]\\w*';
- hljs.UNDERSCORE_IDENT_RE = '[a-zA-Z_]\\w*';
- hljs.NUMBER_RE = '\\b\\d+(\\.\\d+)?';
- hljs.C_NUMBER_RE = '(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)'; // 0x..., 0..., decimal, float
- hljs.BINARY_NUMBER_RE = '\\b(0b[01]+)'; // 0b...
- hljs.RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~';
-
- // Common modes
- hljs.BACKSLASH_ESCAPE = {
- begin: '\\\\[\\s\\S]', relevance: 0
- };
- hljs.APOS_STRING_MODE = {
- className: 'string',
- begin: '\'', end: '\'',
- illegal: '\\n',
- contains: [hljs.BACKSLASH_ESCAPE]
- };
- hljs.QUOTE_STRING_MODE = {
- className: 'string',
- begin: '"', end: '"',
- illegal: '\\n',
- contains: [hljs.BACKSLASH_ESCAPE]
- };
- hljs.PHRASAL_WORDS_MODE = {
- begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
- };
- hljs.COMMENT = function (begin, end, inherits) {
- var mode = hljs.inherit(
- {
- className: 'comment',
- begin: begin, end: end,
- contains: []
- },
- inherits || {}
- );
- mode.contains.push(hljs.PHRASAL_WORDS_MODE);
- mode.contains.push({
- className: 'doctag',
- begin: '(?:TODO|FIXME|NOTE|BUG|XXX):',
- relevance: 0
- });
- return mode;
- };
- hljs.C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$');
- hljs.C_BLOCK_COMMENT_MODE = hljs.COMMENT('/\\*', '\\*/');
- hljs.HASH_COMMENT_MODE = hljs.COMMENT('#', '$');
- hljs.NUMBER_MODE = {
- className: 'number',
- begin: hljs.NUMBER_RE,
- relevance: 0
- };
- hljs.C_NUMBER_MODE = {
- className: 'number',
- begin: hljs.C_NUMBER_RE,
- relevance: 0
- };
- hljs.BINARY_NUMBER_MODE = {
- className: 'number',
- begin: hljs.BINARY_NUMBER_RE,
- relevance: 0
- };
- hljs.CSS_NUMBER_MODE = {
- className: 'number',
- begin: hljs.NUMBER_RE + '(' +
- '%|em|ex|ch|rem' +
- '|vw|vh|vmin|vmax' +
- '|cm|mm|in|pt|pc|px' +
- '|deg|grad|rad|turn' +
- '|s|ms' +
- '|Hz|kHz' +
- '|dpi|dpcm|dppx' +
- ')?',
- relevance: 0
- };
- hljs.REGEXP_MODE = {
- className: 'regexp',
- begin: /\//, end: /\/[gimuy]*/,
- illegal: /\n/,
- contains: [
- hljs.BACKSLASH_ESCAPE,
- {
- begin: /\[/, end: /\]/,
- relevance: 0,
- contains: [hljs.BACKSLASH_ESCAPE]
- }
- ]
- };
- hljs.TITLE_MODE = {
- className: 'title',
- begin: hljs.IDENT_RE,
- relevance: 0
- };
- hljs.UNDERSCORE_TITLE_MODE = {
- className: 'title',
- begin: hljs.UNDERSCORE_IDENT_RE,
- relevance: 0
- };
- hljs.METHOD_GUARD = {
- // excludes method names from keyword processing
- begin: '\\.\\s*' + hljs.UNDERSCORE_IDENT_RE,
- relevance: 0
- };
-
- return hljs;
-}));
-
-},{}],112:[function(require,module,exports){
-var hljs = require('./highlight');
-
-hljs.registerLanguage('1c', require('./languages/1c'));
-hljs.registerLanguage('abnf', require('./languages/abnf'));
-hljs.registerLanguage('accesslog', require('./languages/accesslog'));
-hljs.registerLanguage('actionscript', require('./languages/actionscript'));
-hljs.registerLanguage('ada', require('./languages/ada'));
-hljs.registerLanguage('apache', require('./languages/apache'));
-hljs.registerLanguage('applescript', require('./languages/applescript'));
-hljs.registerLanguage('cpp', require('./languages/cpp'));
-hljs.registerLanguage('arduino', require('./languages/arduino'));
-hljs.registerLanguage('armasm', require('./languages/armasm'));
-hljs.registerLanguage('xml', require('./languages/xml'));
-hljs.registerLanguage('asciidoc', require('./languages/asciidoc'));
-hljs.registerLanguage('aspectj', require('./languages/aspectj'));
-hljs.registerLanguage('autohotkey', require('./languages/autohotkey'));
-hljs.registerLanguage('autoit', require('./languages/autoit'));
-hljs.registerLanguage('avrasm', require('./languages/avrasm'));
-hljs.registerLanguage('awk', require('./languages/awk'));
-hljs.registerLanguage('axapta', require('./languages/axapta'));
-hljs.registerLanguage('bash', require('./languages/bash'));
-hljs.registerLanguage('basic', require('./languages/basic'));
-hljs.registerLanguage('bnf', require('./languages/bnf'));
-hljs.registerLanguage('brainfuck', require('./languages/brainfuck'));
-hljs.registerLanguage('cal', require('./languages/cal'));
-hljs.registerLanguage('capnproto', require('./languages/capnproto'));
-hljs.registerLanguage('ceylon', require('./languages/ceylon'));
-hljs.registerLanguage('clean', require('./languages/clean'));
-hljs.registerLanguage('clojure', require('./languages/clojure'));
-hljs.registerLanguage('clojure-repl', require('./languages/clojure-repl'));
-hljs.registerLanguage('cmake', require('./languages/cmake'));
-hljs.registerLanguage('coffeescript', require('./languages/coffeescript'));
-hljs.registerLanguage('coq', require('./languages/coq'));
-hljs.registerLanguage('cos', require('./languages/cos'));
-hljs.registerLanguage('crmsh', require('./languages/crmsh'));
-hljs.registerLanguage('crystal', require('./languages/crystal'));
-hljs.registerLanguage('cs', require('./languages/cs'));
-hljs.registerLanguage('csp', require('./languages/csp'));
-hljs.registerLanguage('css', require('./languages/css'));
-hljs.registerLanguage('d', require('./languages/d'));
-hljs.registerLanguage('markdown', require('./languages/markdown'));
-hljs.registerLanguage('dart', require('./languages/dart'));
-hljs.registerLanguage('delphi', require('./languages/delphi'));
-hljs.registerLanguage('diff', require('./languages/diff'));
-hljs.registerLanguage('django', require('./languages/django'));
-hljs.registerLanguage('dns', require('./languages/dns'));
-hljs.registerLanguage('dockerfile', require('./languages/dockerfile'));
-hljs.registerLanguage('dos', require('./languages/dos'));
-hljs.registerLanguage('dsconfig', require('./languages/dsconfig'));
-hljs.registerLanguage('dts', require('./languages/dts'));
-hljs.registerLanguage('dust', require('./languages/dust'));
-hljs.registerLanguage('ebnf', require('./languages/ebnf'));
-hljs.registerLanguage('elixir', require('./languages/elixir'));
-hljs.registerLanguage('elm', require('./languages/elm'));
-hljs.registerLanguage('ruby', require('./languages/ruby'));
-hljs.registerLanguage('erb', require('./languages/erb'));
-hljs.registerLanguage('erlang-repl', require('./languages/erlang-repl'));
-hljs.registerLanguage('erlang', require('./languages/erlang'));
-hljs.registerLanguage('excel', require('./languages/excel'));
-hljs.registerLanguage('fix', require('./languages/fix'));
-hljs.registerLanguage('flix', require('./languages/flix'));
-hljs.registerLanguage('fortran', require('./languages/fortran'));
-hljs.registerLanguage('fsharp', require('./languages/fsharp'));
-hljs.registerLanguage('gams', require('./languages/gams'));
-hljs.registerLanguage('gauss', require('./languages/gauss'));
-hljs.registerLanguage('gcode', require('./languages/gcode'));
-hljs.registerLanguage('gherkin', require('./languages/gherkin'));
-hljs.registerLanguage('glsl', require('./languages/glsl'));
-hljs.registerLanguage('go', require('./languages/go'));
-hljs.registerLanguage('golo', require('./languages/golo'));
-hljs.registerLanguage('gradle', require('./languages/gradle'));
-hljs.registerLanguage('groovy', require('./languages/groovy'));
-hljs.registerLanguage('haml', require('./languages/haml'));
-hljs.registerLanguage('handlebars', require('./languages/handlebars'));
-hljs.registerLanguage('haskell', require('./languages/haskell'));
-hljs.registerLanguage('haxe', require('./languages/haxe'));
-hljs.registerLanguage('hsp', require('./languages/hsp'));
-hljs.registerLanguage('htmlbars', require('./languages/htmlbars'));
-hljs.registerLanguage('http', require('./languages/http'));
-hljs.registerLanguage('hy', require('./languages/hy'));
-hljs.registerLanguage('inform7', require('./languages/inform7'));
-hljs.registerLanguage('ini', require('./languages/ini'));
-hljs.registerLanguage('irpf90', require('./languages/irpf90'));
-hljs.registerLanguage('java', require('./languages/java'));
-hljs.registerLanguage('javascript', require('./languages/javascript'));
-hljs.registerLanguage('jboss-cli', require('./languages/jboss-cli'));
-hljs.registerLanguage('json', require('./languages/json'));
-hljs.registerLanguage('julia', require('./languages/julia'));
-hljs.registerLanguage('julia-repl', require('./languages/julia-repl'));
-hljs.registerLanguage('kotlin', require('./languages/kotlin'));
-hljs.registerLanguage('lasso', require('./languages/lasso'));
-hljs.registerLanguage('ldif', require('./languages/ldif'));
-hljs.registerLanguage('leaf', require('./languages/leaf'));
-hljs.registerLanguage('less', require('./languages/less'));
-hljs.registerLanguage('lisp', require('./languages/lisp'));
-hljs.registerLanguage('livecodeserver', require('./languages/livecodeserver'));
-hljs.registerLanguage('livescript', require('./languages/livescript'));
-hljs.registerLanguage('llvm', require('./languages/llvm'));
-hljs.registerLanguage('lsl', require('./languages/lsl'));
-hljs.registerLanguage('lua', require('./languages/lua'));
-hljs.registerLanguage('makefile', require('./languages/makefile'));
-hljs.registerLanguage('mathematica', require('./languages/mathematica'));
-hljs.registerLanguage('matlab', require('./languages/matlab'));
-hljs.registerLanguage('maxima', require('./languages/maxima'));
-hljs.registerLanguage('mel', require('./languages/mel'));
-hljs.registerLanguage('mercury', require('./languages/mercury'));
-hljs.registerLanguage('mipsasm', require('./languages/mipsasm'));
-hljs.registerLanguage('mizar', require('./languages/mizar'));
-hljs.registerLanguage('perl', require('./languages/perl'));
-hljs.registerLanguage('mojolicious', require('./languages/mojolicious'));
-hljs.registerLanguage('monkey', require('./languages/monkey'));
-hljs.registerLanguage('moonscript', require('./languages/moonscript'));
-hljs.registerLanguage('n1ql', require('./languages/n1ql'));
-hljs.registerLanguage('nginx', require('./languages/nginx'));
-hljs.registerLanguage('nimrod', require('./languages/nimrod'));
-hljs.registerLanguage('nix', require('./languages/nix'));
-hljs.registerLanguage('nsis', require('./languages/nsis'));
-hljs.registerLanguage('objectivec', require('./languages/objectivec'));
-hljs.registerLanguage('ocaml', require('./languages/ocaml'));
-hljs.registerLanguage('openscad', require('./languages/openscad'));
-hljs.registerLanguage('oxygene', require('./languages/oxygene'));
-hljs.registerLanguage('parser3', require('./languages/parser3'));
-hljs.registerLanguage('pf', require('./languages/pf'));
-hljs.registerLanguage('php', require('./languages/php'));
-hljs.registerLanguage('pony', require('./languages/pony'));
-hljs.registerLanguage('powershell', require('./languages/powershell'));
-hljs.registerLanguage('processing', require('./languages/processing'));
-hljs.registerLanguage('profile', require('./languages/profile'));
-hljs.registerLanguage('prolog', require('./languages/prolog'));
-hljs.registerLanguage('protobuf', require('./languages/protobuf'));
-hljs.registerLanguage('puppet', require('./languages/puppet'));
-hljs.registerLanguage('purebasic', require('./languages/purebasic'));
-hljs.registerLanguage('python', require('./languages/python'));
-hljs.registerLanguage('q', require('./languages/q'));
-hljs.registerLanguage('qml', require('./languages/qml'));
-hljs.registerLanguage('r', require('./languages/r'));
-hljs.registerLanguage('rib', require('./languages/rib'));
-hljs.registerLanguage('roboconf', require('./languages/roboconf'));
-hljs.registerLanguage('routeros', require('./languages/routeros'));
-hljs.registerLanguage('rsl', require('./languages/rsl'));
-hljs.registerLanguage('ruleslanguage', require('./languages/ruleslanguage'));
-hljs.registerLanguage('rust', require('./languages/rust'));
-hljs.registerLanguage('scala', require('./languages/scala'));
-hljs.registerLanguage('scheme', require('./languages/scheme'));
-hljs.registerLanguage('scilab', require('./languages/scilab'));
-hljs.registerLanguage('scss', require('./languages/scss'));
-hljs.registerLanguage('shell', require('./languages/shell'));
-hljs.registerLanguage('smali', require('./languages/smali'));
-hljs.registerLanguage('smalltalk', require('./languages/smalltalk'));
-hljs.registerLanguage('sml', require('./languages/sml'));
-hljs.registerLanguage('sqf', require('./languages/sqf'));
-hljs.registerLanguage('sql', require('./languages/sql'));
-hljs.registerLanguage('stan', require('./languages/stan'));
-hljs.registerLanguage('stata', require('./languages/stata'));
-hljs.registerLanguage('step21', require('./languages/step21'));
-hljs.registerLanguage('stylus', require('./languages/stylus'));
-hljs.registerLanguage('subunit', require('./languages/subunit'));
-hljs.registerLanguage('swift', require('./languages/swift'));
-hljs.registerLanguage('taggerscript', require('./languages/taggerscript'));
-hljs.registerLanguage('yaml', require('./languages/yaml'));
-hljs.registerLanguage('tap', require('./languages/tap'));
-hljs.registerLanguage('tcl', require('./languages/tcl'));
-hljs.registerLanguage('tex', require('./languages/tex'));
-hljs.registerLanguage('thrift', require('./languages/thrift'));
-hljs.registerLanguage('tp', require('./languages/tp'));
-hljs.registerLanguage('twig', require('./languages/twig'));
-hljs.registerLanguage('typescript', require('./languages/typescript'));
-hljs.registerLanguage('vala', require('./languages/vala'));
-hljs.registerLanguage('vbnet', require('./languages/vbnet'));
-hljs.registerLanguage('vbscript', require('./languages/vbscript'));
-hljs.registerLanguage('vbscript-html', require('./languages/vbscript-html'));
-hljs.registerLanguage('verilog', require('./languages/verilog'));
-hljs.registerLanguage('vhdl', require('./languages/vhdl'));
-hljs.registerLanguage('vim', require('./languages/vim'));
-hljs.registerLanguage('x86asm', require('./languages/x86asm'));
-hljs.registerLanguage('xl', require('./languages/xl'));
-hljs.registerLanguage('xquery', require('./languages/xquery'));
-hljs.registerLanguage('zephir', require('./languages/zephir'));
-
-module.exports = hljs;
-},{"./highlight":111,"./languages/1c":113,"./languages/abnf":114,"./languages/accesslog":115,"./languages/actionscript":116,"./languages/ada":117,"./languages/apache":118,"./languages/applescript":119,"./languages/arduino":120,"./languages/armasm":121,"./languages/asciidoc":122,"./languages/aspectj":123,"./languages/autohotkey":124,"./languages/autoit":125,"./languages/avrasm":126,"./languages/awk":127,"./languages/axapta":128,"./languages/bash":129,"./languages/basic":130,"./languages/bnf":131,"./languages/brainfuck":132,"./languages/cal":133,"./languages/capnproto":134,"./languages/ceylon":135,"./languages/clean":136,"./languages/clojure":138,"./languages/clojure-repl":137,"./languages/cmake":139,"./languages/coffeescript":140,"./languages/coq":141,"./languages/cos":142,"./languages/cpp":143,"./languages/crmsh":144,"./languages/crystal":145,"./languages/cs":146,"./languages/csp":147,"./languages/css":148,"./languages/d":149,"./languages/dart":150,"./languages/delphi":151,"./languages/diff":152,"./languages/django":153,"./languages/dns":154,"./languages/dockerfile":155,"./languages/dos":156,"./languages/dsconfig":157,"./languages/dts":158,"./languages/dust":159,"./languages/ebnf":160,"./languages/elixir":161,"./languages/elm":162,"./languages/erb":163,"./languages/erlang":165,"./languages/erlang-repl":164,"./languages/excel":166,"./languages/fix":167,"./languages/flix":168,"./languages/fortran":169,"./languages/fsharp":170,"./languages/gams":171,"./languages/gauss":172,"./languages/gcode":173,"./languages/gherkin":174,"./languages/glsl":175,"./languages/go":176,"./languages/golo":177,"./languages/gradle":178,"./languages/groovy":179,"./languages/haml":180,"./languages/handlebars":181,"./languages/haskell":182,"./languages/haxe":183,"./languages/hsp":184,"./languages/htmlbars":185,"./languages/http":186,"./languages/hy":187,"./languages/inform7":188,"./languages/ini":189,"./languages/irpf90":190,"./languages/java":191,"./languages/javascript":192,"./languages/jboss-cli":193,"./languages/json":194,"./languages/julia":196,"./languages/julia-repl":195,"./languages/kotlin":197,"./languages/lasso":198,"./languages/ldif":199,"./languages/leaf":200,"./languages/less":201,"./languages/lisp":202,"./languages/livecodeserver":203,"./languages/livescript":204,"./languages/llvm":205,"./languages/lsl":206,"./languages/lua":207,"./languages/makefile":208,"./languages/markdown":209,"./languages/mathematica":210,"./languages/matlab":211,"./languages/maxima":212,"./languages/mel":213,"./languages/mercury":214,"./languages/mipsasm":215,"./languages/mizar":216,"./languages/mojolicious":217,"./languages/monkey":218,"./languages/moonscript":219,"./languages/n1ql":220,"./languages/nginx":221,"./languages/nimrod":222,"./languages/nix":223,"./languages/nsis":224,"./languages/objectivec":225,"./languages/ocaml":226,"./languages/openscad":227,"./languages/oxygene":228,"./languages/parser3":229,"./languages/perl":230,"./languages/pf":231,"./languages/php":232,"./languages/pony":233,"./languages/powershell":234,"./languages/processing":235,"./languages/profile":236,"./languages/prolog":237,"./languages/protobuf":238,"./languages/puppet":239,"./languages/purebasic":240,"./languages/python":241,"./languages/q":242,"./languages/qml":243,"./languages/r":244,"./languages/rib":245,"./languages/roboconf":246,"./languages/routeros":247,"./languages/rsl":248,"./languages/ruby":249,"./languages/ruleslanguage":250,"./languages/rust":251,"./languages/scala":252,"./languages/scheme":253,"./languages/scilab":254,"./languages/scss":255,"./languages/shell":256,"./languages/smali":257,"./languages/smalltalk":258,"./languages/sml":259,"./languages/sqf":260,"./languages/sql":261,"./languages/stan":262,"./languages/stata":263,"./languages/step21":264,"./languages/stylus":265,"./languages/subunit":266,"./languages/swift":267,"./languages/taggerscript":268,"./languages/tap":269,"./languages/tcl":270,"./languages/tex":271,"./languages/thrift":272,"./languages/tp":273,"./languages/twig":274,"./languages/typescript":275,"./languages/vala":276,"./languages/vbnet":277,"./languages/vbscript":279,"./languages/vbscript-html":278,"./languages/verilog":280,"./languages/vhdl":281,"./languages/vim":282,"./languages/x86asm":283,"./languages/xl":284,"./languages/xml":285,"./languages/xquery":286,"./languages/yaml":287,"./languages/zephir":288}],113:[function(require,module,exports){
-module.exports = function(hljs){
-
- // общий паттерн для определения идентификаторов
- var UNDERSCORE_IDENT_RE = '[A-Za-zА-Яа-яёЁ_][A-Za-zА-Яа-яёЁ_0-9]+';
-
- // v7 уникальные ключевые слова, отсутствующие в v8 ==> keyword
- var v7_keywords =
- 'далее ';
-
- // v8 ключевые слова ==> keyword
- var v8_keywords =
- 'возврат вызватьисключение выполнить для если и из или иначе иначеесли исключение каждого конецесли ' +
- 'конецпопытки конеццикла не новый перейти перем по пока попытка прервать продолжить тогда цикл экспорт ';
-
- // keyword : ключевые слова
- var KEYWORD = v7_keywords + v8_keywords;
-
- // v7 уникальные директивы, отсутствующие в v8 ==> meta-keyword
- var v7_meta_keywords =
- 'загрузитьизфайла ';
-
- // v8 ключевые слова в инструкциях препроцессора, директивах компиляции, аннотациях ==> meta-keyword
- var v8_meta_keywords =
- 'вебклиент вместо внешнеесоединение клиент конецобласти мобильноеприложениеклиент мобильноеприложениесервер ' +
- 'наклиенте наклиентенасервере наклиентенасерверебезконтекста насервере насерверебезконтекста область перед ' +
- 'после сервер толстыйклиентобычноеприложение толстыйклиентуправляемоеприложение тонкийклиент ';
-
- // meta-keyword : ключевые слова в инструкциях препроцессора, директивах компиляции, аннотациях
- var METAKEYWORD = v7_meta_keywords + v8_meta_keywords;
-
- // v7 системные константы ==> built_in
- var v7_system_constants =
- 'разделительстраниц разделительстрок символтабуляции ';
-
- // v7 уникальные методы глобального контекста, отсутствующие в v8 ==> built_in
- var v7_global_context_methods =
- 'ansitooem oemtoansi ввестивидсубконто ввестиперечисление ввестипериод ввестиплансчетов выбранныйплансчетов ' +
- 'датагод датамесяц датачисло заголовоксистемы значениевстроку значениеизстроки каталогиб каталогпользователя ' +
- 'кодсимв конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца ' +
- 'коннедели лог лог10 максимальноеколичествосубконто названиеинтерфейса названиенабораправ назначитьвид ' +
- 'назначитьсчет найтиссылки началопериодаби началостандартногоинтервала начгода начквартала начмесяца ' +
- 'начнедели номерднягода номерднянедели номернеделигода обработкаожидания основнойжурналрасчетов ' +
- 'основнойплансчетов основнойязык очиститьокносообщений периодстр получитьвремята получитьдатута ' +
- 'получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта ' +
- 'префиксавтонумерации пропись пустоезначение разм разобратьпозициюдокумента рассчитатьрегистрына ' +
- 'рассчитатьрегистрыпо симв создатьобъект статусвозврата стрколичествострок сформироватьпозициюдокумента ' +
- 'счетпокоду текущеевремя типзначения типзначениястр установитьтана установитьтапо фиксшаблон шаблон ';
-
- // v8 методы глобального контекста ==> built_in
- var v8_global_context_methods =
- 'acos asin atan base64значение base64строка cos exp log log10 pow sin sqrt tan xmlзначение xmlстрока ' +
- 'xmlтип xmlтипзнч активноеокно безопасныйрежим безопасныйрежимразделенияданных булево ввестидату ввестизначение ' +
- 'ввестистроку ввестичисло возможностьчтенияxml вопрос восстановитьзначение врег выгрузитьжурналрегистрации ' +
- 'выполнитьобработкуоповещения выполнитьпроверкуправдоступа вычислить год данныеформывзначение дата день деньгода ' +
- 'деньнедели добавитьмесяц заблокироватьданныедляредактирования заблокироватьработупользователя завершитьработусистемы ' +
- 'загрузитьвнешнююкомпоненту закрытьсправку записатьjson записатьxml записатьдатуjson записьжурналарегистрации ' +
- 'заполнитьзначениясвойств запроситьразрешениепользователя запуститьприложение запуститьсистему зафиксироватьтранзакцию ' +
- 'значениевданныеформы значениевстрокувнутр значениевфайл значениезаполнено значениеизстрокивнутр значениеизфайла ' +
- 'изxmlтипа импортмоделиxdto имякомпьютера имяпользователя инициализироватьпредопределенныеданные информацияобошибке ' +
- 'каталогбиблиотекимобильногоустройства каталогвременныхфайлов каталогдокументов каталогпрограммы кодироватьстроку ' +
- 'кодлокализацииинформационнойбазы кодсимвола командасистемы конецгода конецдня конецквартала конецмесяца конецминуты ' +
- 'конецнедели конецчаса конфигурациябазыданныхизмененадинамически конфигурацияизменена копироватьданныеформы ' +
- 'копироватьфайл краткоепредставлениеошибки лев макс местноевремя месяц мин минута монопольныйрежим найти ' +
- 'найтинедопустимыесимволыxml найтиокнопонавигационнойссылке найтипомеченныенаудаление найтипоссылкам найтифайлы ' +
- 'началогода началодня началоквартала началомесяца началоминуты началонедели началочаса начатьзапросразрешенияпользователя ' +
- 'начатьзапускприложения начатькопированиефайла начатьперемещениефайла начатьподключениевнешнейкомпоненты ' +
- 'начатьподключениерасширенияработыскриптографией начатьподключениерасширенияработысфайлами начатьпоискфайлов ' +
- 'начатьполучениекаталогавременныхфайлов начатьполучениекаталогадокументов начатьполучениерабочегокаталогаданныхпользователя ' +
- 'начатьполучениефайлов начатьпомещениефайла начатьпомещениефайлов начатьсозданиедвоичныхданныхизфайла начатьсозданиекаталога ' +
- 'начатьтранзакцию начатьудалениефайлов начатьустановкувнешнейкомпоненты начатьустановкурасширенияработыскриптографией ' +
- 'начатьустановкурасширенияработысфайлами неделягода необходимостьзавершениясоединения номерсеансаинформационнойбазы ' +
- 'номерсоединенияинформационнойбазы нрег нстр обновитьинтерфейс обновитьнумерациюобъектов обновитьповторноиспользуемыезначения ' +
- 'обработкапрерыванияпользователя объединитьфайлы окр описаниеошибки оповестить оповеститьобизменении ' +
- 'отключитьобработчикзапросанастроекклиенталицензирования отключитьобработчикожидания отключитьобработчикоповещения ' +
- 'открытьзначение открытьиндекссправки открытьсодержаниесправки открытьсправку открытьформу открытьформумодально ' +
- 'отменитьтранзакцию очиститьжурналрегистрации очиститьнастройкипользователя очиститьсообщения параметрыдоступа ' +
- 'перейтипонавигационнойссылке переместитьфайл подключитьвнешнююкомпоненту ' +
- 'подключитьобработчикзапросанастроекклиенталицензирования подключитьобработчикожидания подключитьобработчикоповещения ' +
- 'подключитьрасширениеработыскриптографией подключитьрасширениеработысфайлами подробноепредставлениеошибки ' +
- 'показатьвводдаты показатьвводзначения показатьвводстроки показатьвводчисла показатьвопрос показатьзначение ' +
- 'показатьинформациюобошибке показатьнакарте показатьоповещениепользователя показатьпредупреждение полноеимяпользователя ' +
- 'получитьcomобъект получитьxmlтип получитьадреспоместоположению получитьблокировкусеансов получитьвремязавершенияспящегосеанса ' +
- 'получитьвремязасыпанияпассивногосеанса получитьвремяожиданияблокировкиданных получитьданныевыбора ' +
- 'получитьдополнительныйпараметрклиенталицензирования получитьдопустимыекодылокализации получитьдопустимыечасовыепояса ' +
- 'получитьзаголовокклиентскогоприложения получитьзаголовоксистемы получитьзначенияотборажурналарегистрации ' +
- 'получитьидентификаторконфигурации получитьизвременногохранилища получитьимявременногофайла ' +
- 'получитьимяклиенталицензирования получитьинформациюэкрановклиента получитьиспользованиежурналарегистрации ' +
- 'получитьиспользованиесобытияжурналарегистрации получитькраткийзаголовокприложения получитьмакетоформления ' +
- 'получитьмаскувсефайлы получитьмаскувсефайлыклиента получитьмаскувсефайлысервера получитьместоположениепоадресу ' +
- 'получитьминимальнуюдлинупаролейпользователей получитьнавигационнуюссылку получитьнавигационнуюссылкуинформационнойбазы ' +
- 'получитьобновлениеконфигурациибазыданных получитьобновлениепредопределенныхданныхинформационнойбазы получитьобщиймакет ' +
- 'получитьобщуюформу получитьокна получитьоперативнуюотметкувремени получитьотключениебезопасногорежима ' +
- 'получитьпараметрыфункциональныхопцийинтерфейса получитьполноеимяпредопределенногозначения ' +
- 'получитьпредставлениянавигационныхссылок получитьпроверкусложностипаролейпользователей получитьразделительпути ' +
- 'получитьразделительпутиклиента получитьразделительпутисервера получитьсеансыинформационнойбазы ' +
- 'получитьскоростьклиентскогосоединения получитьсоединенияинформационнойбазы получитьсообщенияпользователю ' +
- 'получитьсоответствиеобъектаиформы получитьсоставстандартногоинтерфейсаodata получитьструктурухранениябазыданных ' +
- 'получитьтекущийсеансинформационнойбазы получитьфайл получитьфайлы получитьформу получитьфункциональнуюопцию ' +
- 'получитьфункциональнуюопциюинтерфейса получитьчасовойпоясинформационнойбазы пользователиос поместитьвовременноехранилище ' +
- 'поместитьфайл поместитьфайлы прав праводоступа предопределенноезначение представлениекодалокализации представлениепериода ' +
- 'представлениеправа представлениеприложения представлениесобытияжурналарегистрации представлениечасовогопояса предупреждение ' +
- 'прекратитьработусистемы привилегированныйрежим продолжитьвызов прочитатьjson прочитатьxml прочитатьдатуjson пустаястрока ' +
- 'рабочийкаталогданныхпользователя разблокироватьданныедляредактирования разделитьфайл разорватьсоединениесвнешнимисточникомданных ' +
- 'раскодироватьстроку рольдоступна секунда сигнал символ скопироватьжурналрегистрации смещениелетнеговремени ' +
- 'смещениестандартноговремени соединитьбуферыдвоичныхданных создатькаталог создатьфабрикуxdto сокрл сокрлп сокрп сообщить ' +
- 'состояние сохранитьзначение сохранитьнастройкипользователя сред стрдлина стрзаканчиваетсяна стрзаменить стрнайти стрначинаетсяс ' +
- 'строка строкасоединенияинформационнойбазы стрполучитьстроку стрразделить стрсоединить стрсравнить стрчисловхождений '+
- 'стрчислострок стршаблон текущаядата текущаядатасеанса текущаяуниверсальнаядата текущаяуниверсальнаядатавмиллисекундах ' +
- 'текущийвариантинтерфейсаклиентскогоприложения текущийвариантосновногошрифтаклиентскогоприложения текущийкодлокализации ' +
- 'текущийрежимзапуска текущийязык текущийязыксистемы тип типзнч транзакцияактивна трег удалитьданныеинформационнойбазы ' +
- 'удалитьизвременногохранилища удалитьобъекты удалитьфайлы универсальноевремя установитьбезопасныйрежим ' +
- 'установитьбезопасныйрежимразделенияданных установитьблокировкусеансов установитьвнешнююкомпоненту ' +
- 'установитьвремязавершенияспящегосеанса установитьвремязасыпанияпассивногосеанса установитьвремяожиданияблокировкиданных ' +
- 'установитьзаголовокклиентскогоприложения установитьзаголовоксистемы установитьиспользованиежурналарегистрации ' +
- 'установитьиспользованиесобытияжурналарегистрации установитькраткийзаголовокприложения ' +
- 'установитьминимальнуюдлинупаролейпользователей установитьмонопольныйрежим установитьнастройкиклиенталицензирования ' +
- 'установитьобновлениепредопределенныхданныхинформационнойбазы установитьотключениебезопасногорежима ' +
- 'установитьпараметрыфункциональныхопцийинтерфейса установитьпривилегированныйрежим ' +
- 'установитьпроверкусложностипаролейпользователей установитьрасширениеработыскриптографией ' +
- 'установитьрасширениеработысфайлами установитьсоединениесвнешнимисточникомданных установитьсоответствиеобъектаиформы ' +
- 'установитьсоставстандартногоинтерфейсаodata установитьчасовойпоясинформационнойбазы установитьчасовойпояссеанса ' +
- 'формат цел час часовойпояс часовойпояссеанса число числопрописью этоадресвременногохранилища ';
-
- // v8 свойства глобального контекста ==> built_in
- var v8_global_context_property =
- 'wsссылки библиотекакартинок библиотекамакетовоформлениякомпоновкиданных библиотекастилей бизнеспроцессы ' +
- 'внешниеисточникиданных внешниеобработки внешниеотчеты встроенныепокупки главныйинтерфейс главныйстиль ' +
- 'документы доставляемыеуведомления журналыдокументов задачи информацияобинтернетсоединении использованиерабочейдаты ' +
- 'историяработыпользователя константы критерииотбора метаданные обработки отображениерекламы отправкадоставляемыхуведомлений ' +
- 'отчеты панельзадачос параметрзапуска параметрысеанса перечисления планывидоврасчета планывидовхарактеристик ' +
- 'планыобмена планысчетов полнотекстовыйпоиск пользователиинформационнойбазы последовательности проверкавстроенныхпокупок ' +
- 'рабочаядата расширенияконфигурации регистрыбухгалтерии регистрынакопления регистрырасчета регистрысведений ' +
- 'регламентныезадания сериализаторxdto справочники средствагеопозиционирования средствакриптографии средствамультимедиа ' +
- 'средстваотображениярекламы средствапочты средствателефонии фабрикаxdto файловыепотоки фоновыезадания хранилищанастроек ' +
- 'хранилищевариантовотчетов хранилищенастроекданныхформ хранилищеобщихнастроек хранилищепользовательскихнастроекдинамическихсписков ' +
- 'хранилищепользовательскихнастроекотчетов хранилищесистемныхнастроек ';
-
- // built_in : встроенные или библиотечные объекты (константы, классы, функции)
- var BUILTIN =
- v7_system_constants +
- v7_global_context_methods + v8_global_context_methods +
- v8_global_context_property;
-
- // v8 системные наборы значений ==> class
- var v8_system_sets_of_values =
- 'webцвета windowsцвета windowsшрифты библиотекакартинок рамкистиля символы цветастиля шрифтыстиля ';
-
- // v8 системные перечисления - интерфейсные ==> class
- var v8_system_enums_interface =
- 'автоматическоесохранениеданныхформывнастройках автонумерациявформе автораздвижениесерий ' +
- 'анимациядиаграммы вариантвыравниванияэлементовизаголовков вариантуправлениявысотойтаблицы ' +
- 'вертикальнаяпрокруткаформы вертикальноеположение вертикальноеположениеэлемента видгруппыформы ' +
- 'виддекорацииформы виддополненияэлементаформы видизмененияданных видкнопкиформы видпереключателя ' +
- 'видподписейкдиаграмме видполяформы видфлажка влияниеразмеранапузырекдиаграммы горизонтальноеположение ' +
- 'горизонтальноеположениеэлемента группировкаколонок группировкаподчиненныхэлементовформы ' +
- 'группыиэлементы действиеперетаскивания дополнительныйрежимотображения допустимыедействияперетаскивания ' +
- 'интервалмеждуэлементамиформы использованиевывода использованиеполосыпрокрутки ' +
- 'используемоезначениеточкибиржевойдиаграммы историявыборапривводе источникзначенийоситочекдиаграммы ' +
- 'источникзначенияразмерапузырькадиаграммы категориягруппыкоманд максимумсерий начальноеотображениедерева ' +
- 'начальноеотображениесписка обновлениетекстаредактирования ориентациядендрограммы ориентациядиаграммы ' +
- 'ориентацияметокдиаграммы ориентацияметоксводнойдиаграммы ориентацияэлементаформы отображениевдиаграмме ' +
- 'отображениевлегендедиаграммы отображениегруппыкнопок отображениезаголовкашкалыдиаграммы ' +
- 'отображениезначенийсводнойдиаграммы отображениезначенияизмерительнойдиаграммы ' +
- 'отображениеинтерваладиаграммыганта отображениекнопки отображениекнопкивыбора отображениеобсужденийформы ' +
- 'отображениеобычнойгруппы отображениеотрицательныхзначенийпузырьковойдиаграммы отображениепанелипоиска ' +
- 'отображениеподсказки отображениепредупрежденияприредактировании отображениеразметкиполосырегулирования ' +
- 'отображениестраницформы отображениетаблицы отображениетекстазначениядиаграммыганта ' +
- 'отображениеуправленияобычнойгруппы отображениефигурыкнопки палитрацветовдиаграммы поведениеобычнойгруппы ' +
- 'поддержкамасштабадендрограммы поддержкамасштабадиаграммыганта поддержкамасштабасводнойдиаграммы ' +
- 'поисквтаблицепривводе положениезаголовкаэлементаформы положениекартинкикнопкиформы ' +
- 'положениекартинкиэлементаграфическойсхемы положениекоманднойпанелиформы положениекоманднойпанелиэлементаформы ' +
- 'положениеопорнойточкиотрисовки положениеподписейкдиаграмме положениеподписейшкалызначенийизмерительнойдиаграммы ' +
- 'положениесостоянияпросмотра положениестрокипоиска положениетекстасоединительнойлинии положениеуправленияпоиском ' +
- 'положениешкалывремени порядокотображенияточекгоризонтальнойгистограммы порядоксерийвлегендедиаграммы ' +
- 'размеркартинки расположениезаголовкашкалыдиаграммы растягиваниеповертикалидиаграммыганта ' +
- 'режимавтоотображениясостояния режимвводастроктаблицы режимвыборанезаполненного режимвыделениядаты ' +
- 'режимвыделениястрокитаблицы режимвыделениятаблицы режимизмененияразмера режимизменениясвязанногозначения ' +
- 'режимиспользованиядиалогапечати режимиспользованияпараметракоманды режиммасштабированияпросмотра ' +
- 'режимосновногоокнаклиентскогоприложения режимоткрытияокнаформы режимотображениявыделения ' +
- 'режимотображениягеографическойсхемы режимотображениязначенийсерии режимотрисовкисеткиграфическойсхемы ' +
- 'режимполупрозрачностидиаграммы режимпробеловдиаграммы режимразмещениянастранице режимредактированияколонки ' +
- 'режимсглаживаниядиаграммы режимсглаживанияиндикатора режимсписказадач сквозноевыравнивание ' +
- 'сохранениеданныхформывнастройках способзаполнениятекстазаголовкашкалыдиаграммы ' +
- 'способопределенияограничивающегозначениядиаграммы стандартнаягруппакоманд стандартноеоформление ' +
- 'статусоповещенияпользователя стильстрелки типаппроксимациилиниитрендадиаграммы типдиаграммы ' +
- 'типединицышкалывремени типимпортасерийслоягеографическойсхемы типлиниигеографическойсхемы типлиниидиаграммы ' +
- 'типмаркерагеографическойсхемы типмаркерадиаграммы типобластиоформления ' +
- 'типорганизацииисточникаданныхгеографическойсхемы типотображениясериислоягеографическойсхемы ' +
- 'типотображенияточечногообъектагеографическойсхемы типотображенияшкалыэлементалегендыгеографическойсхемы ' +
- 'типпоискаобъектовгеографическойсхемы типпроекциигеографическойсхемы типразмещенияизмерений ' +
- 'типразмещенияреквизитовизмерений типрамкиэлементауправления типсводнойдиаграммы ' +
- 'типсвязидиаграммыганта типсоединениязначенийпосериямдиаграммы типсоединенияточекдиаграммы ' +
- 'типсоединительнойлинии типстороныэлементаграфическойсхемы типформыотчета типшкалырадарнойдиаграммы ' +
- 'факторлиниитрендадиаграммы фигуракнопки фигурыграфическойсхемы фиксациявтаблице форматдняшкалывремени ' +
- 'форматкартинки ширинаподчиненныхэлементовформы ';
-
- // v8 системные перечисления - свойства прикладных объектов ==> class
- var v8_system_enums_objects_properties =
- 'виддвижениябухгалтерии виддвижениянакопления видпериодарегистрарасчета видсчета видточкимаршрутабизнеспроцесса ' +
- 'использованиеагрегатарегистранакопления использованиегруппиэлементов использованиережимапроведения ' +
- 'использованиесреза периодичностьагрегатарегистранакопления режимавтовремя режимзаписидокумента режимпроведениядокумента ';
-
- // v8 системные перечисления - планы обмена ==> class
- var v8_system_enums_exchange_plans =
- 'авторегистрацияизменений допустимыйномерсообщения отправкаэлементаданных получениеэлементаданных ';
-
- // v8 системные перечисления - табличный документ ==> class
- var v8_system_enums_tabular_document =
- 'использованиерасшифровкитабличногодокумента ориентациястраницы положениеитоговколоноксводнойтаблицы ' +
- 'положениеитоговстроксводнойтаблицы положениетекстаотносительнокартинки расположениезаголовкагруппировкитабличногодокумента ' +
- 'способчтениязначенийтабличногодокумента типдвустороннейпечати типзаполненияобластитабличногодокумента ' +
- 'типкурсоровтабличногодокумента типлиниирисункатабличногодокумента типлинииячейкитабличногодокумента ' +
- 'типнаправленияпереходатабличногодокумента типотображениявыделениятабличногодокумента типотображениялинийсводнойтаблицы ' +
- 'типразмещениятекстатабличногодокумента типрисункатабличногодокумента типсмещениятабличногодокумента ' +
- 'типузоратабличногодокумента типфайлатабличногодокумента точностьпечати чередованиерасположениястраниц ';
-
- // v8 системные перечисления - планировщик ==> class
- var v8_system_enums_sheduler =
- 'отображениевремениэлементовпланировщика ';
-
- // v8 системные перечисления - форматированный документ ==> class
- var v8_system_enums_formatted_document =
- 'типфайлаформатированногодокумента ';
-
- // v8 системные перечисления - запрос ==> class
- var v8_system_enums_query =
- 'обходрезультатазапроса типзаписизапроса ';
-
- // v8 системные перечисления - построитель отчета ==> class
- var v8_system_enums_report_builder =
- 'видзаполнениярасшифровкипостроителяотчета типдобавленияпредставлений типизмеренияпостроителяотчета типразмещенияитогов ';
-
- // v8 системные перечисления - работа с файлами ==> class
- var v8_system_enums_files =
- 'доступкфайлу режимдиалогавыборафайла режимоткрытияфайла ';
-
- // v8 системные перечисления - построитель запроса ==> class
- var v8_system_enums_query_builder =
- 'типизмеренияпостроителязапроса ';
-
- // v8 системные перечисления - анализ данных ==> class
- var v8_system_enums_data_analysis =
- 'видданныханализа методкластеризации типединицыинтервалавременианализаданных типзаполнениятаблицырезультатаанализаданных ' +
- 'типиспользованиячисловыхзначенийанализаданных типисточникаданныхпоискаассоциаций типколонкианализаданныхдереворешений ' +
- 'типколонкианализаданныхкластеризация типколонкианализаданныхобщаястатистика типколонкианализаданныхпоискассоциаций ' +
- 'типколонкианализаданныхпоискпоследовательностей типколонкимоделипрогноза типмерырасстоянияанализаданных ' +
- 'типотсеченияправилассоциации типполяанализаданных типстандартизациианализаданных типупорядочиванияправилассоциациианализаданных ' +
- 'типупорядочиванияшаблоновпоследовательностейанализаданных типупрощениядереварешений ';
-
- // v8 системные перечисления - xml, json, xs, dom, xdto, web-сервисы ==> class
- var v8_system_enums_xml_json_xs_dom_xdto_ws =
- 'wsнаправлениепараметра вариантxpathxs вариантзаписидатыjson вариантпростоготипаxs видгруппымоделиxs видфасетаxdto ' +
- 'действиепостроителяdom завершенностьпростоготипаxs завершенностьсоставноготипаxs завершенностьсхемыxs запрещенныеподстановкиxs ' +
- 'исключениягруппподстановкиxs категорияиспользованияатрибутаxs категорияограниченияидентичностиxs категорияограниченияпространствименxs ' +
- 'методнаследованияxs модельсодержимогоxs назначениетипаxml недопустимыеподстановкиxs обработкапробельныхсимволовxs обработкасодержимогоxs ' +
- 'ограничениезначенияxs параметрыотбораузловdom переносстрокjson позициявдокументеdom пробельныесимволыxml типатрибутаxml типзначенияjson ' +
- 'типканоническогоxml типкомпонентыxs типпроверкиxml типрезультатаdomxpath типузлаdom типузлаxml формаxml формапредставленияxs ' +
- 'форматдатыjson экранированиесимволовjson ';
-
- // v8 системные перечисления - система компоновки данных ==> class
- var v8_system_enums_data_composition_system =
- 'видсравнениякомпоновкиданных действиеобработкирасшифровкикомпоновкиданных направлениесортировкикомпоновкиданных ' +
- 'расположениевложенныхэлементоврезультатакомпоновкиданных расположениеитоговкомпоновкиданных расположениегруппировкикомпоновкиданных ' +
- 'расположениеполейгруппировкикомпоновкиданных расположениеполякомпоновкиданных расположениереквизитовкомпоновкиданных ' +
- 'расположениересурсовкомпоновкиданных типбухгалтерскогоостаткакомпоновкиданных типвыводатекстакомпоновкиданных ' +
- 'типгруппировкикомпоновкиданных типгруппыэлементовотборакомпоновкиданных типдополненияпериодакомпоновкиданных ' +
- 'типзаголовкаполейкомпоновкиданных типмакетагруппировкикомпоновкиданных типмакетаобластикомпоновкиданных типостаткакомпоновкиданных ' +
- 'типпериодакомпоновкиданных типразмещениятекстакомпоновкиданных типсвязинаборовданныхкомпоновкиданных типэлементарезультатакомпоновкиданных ' +
- 'расположениелегендыдиаграммыкомпоновкиданных типпримененияотборакомпоновкиданных режимотображенияэлементанастройкикомпоновкиданных ' +
- 'режимотображениянастроеккомпоновкиданных состояниеэлементанастройкикомпоновкиданных способвосстановлениянастроеккомпоновкиданных ' +
- 'режимкомпоновкирезультата использованиепараметракомпоновкиданных автопозицияресурсовкомпоновкиданных '+
- 'вариантиспользованиягруппировкикомпоновкиданных расположениересурсоввдиаграммекомпоновкиданных фиксациякомпоновкиданных ' +
- 'использованиеусловногооформлениякомпоновкиданных ';
-
- // v8 системные перечисления - почта ==> class
- var v8_system_enums_email =
- 'важностьинтернетпочтовогосообщения обработкатекстаинтернетпочтовогосообщения способкодированияинтернетпочтовоговложения ' +
- 'способкодированиянеasciiсимволовинтернетпочтовогосообщения типтекстапочтовогосообщения протоколинтернетпочты ' +
- 'статусразборапочтовогосообщения ';
-
- // v8 системные перечисления - журнал регистрации ==> class
- var v8_system_enums_logbook =
- 'режимтранзакциизаписижурналарегистрации статустранзакциизаписижурналарегистрации уровеньжурналарегистрации ';
-
- // v8 системные перечисления - криптография ==> class
- var v8_system_enums_cryptography =
- 'расположениехранилищасертификатовкриптографии режимвключениясертификатовкриптографии режимпроверкисертификатакриптографии ' +
- 'типхранилищасертификатовкриптографии ';
-
- // v8 системные перечисления - ZIP ==> class
- var v8_system_enums_zip =
- 'кодировкаименфайловвzipфайле методсжатияzip методшифрованияzip режимвосстановленияпутейфайловzip режимобработкиподкаталоговzip ' +
- 'режимсохраненияпутейzip уровеньсжатияzip ';
-
- // v8 системные перечисления -
- // Блокировка данных, Фоновые задания, Автоматизированное тестирование,
- // Доставляемые уведомления, Встроенные покупки, Интернет, Работа с двоичными данными ==> class
- var v8_system_enums_other =
- 'звуковоеоповещение направлениепереходакстроке позициявпотоке порядокбайтов режимблокировкиданных режимуправленияблокировкойданных ' +
- 'сервисвстроенныхпокупок состояниефоновогозадания типподписчикадоставляемыхуведомлений уровеньиспользованиязащищенногосоединенияftp ';
-
- // v8 системные перечисления - схема запроса ==> class
- var v8_system_enums_request_schema =
- 'направлениепорядкасхемызапроса типдополненияпериодамисхемызапроса типконтрольнойточкисхемызапроса типобъединениясхемызапроса ' +
- 'типпараметрадоступнойтаблицысхемызапроса типсоединениясхемызапроса ';
-
- // v8 системные перечисления - свойства объектов метаданных ==> class
- var v8_system_enums_properties_of_metadata_objects =
- 'httpметод автоиспользованиеобщегореквизита автопрефиксномеразадачи вариантвстроенногоязыка видиерархии видрегистранакопления ' +
- 'видтаблицывнешнегоисточникаданных записьдвиженийприпроведении заполнениепоследовательностей индексирование ' +
- 'использованиебазыпланавидоврасчета использованиебыстроговыбора использованиеобщегореквизита использованиеподчинения ' +
- 'использованиеполнотекстовогопоиска использованиеразделяемыхданныхобщегореквизита использованиереквизита ' +
- 'назначениеиспользованияприложения назначениерасширенияконфигурации направлениепередачи обновлениепредопределенныхданных ' +
- 'оперативноепроведение основноепредставлениевидарасчета основноепредставлениевидахарактеристики основноепредставлениезадачи ' +
- 'основноепредставлениепланаобмена основноепредставлениесправочника основноепредставлениесчета перемещениеграницыприпроведении ' +
- 'периодичностьномерабизнеспроцесса периодичностьномерадокумента периодичностьрегистрарасчета периодичностьрегистрасведений ' +
- 'повторноеиспользованиевозвращаемыхзначений полнотекстовыйпоискпривводепостроке принадлежностьобъекта проведение ' +
- 'разделениеаутентификацииобщегореквизита разделениеданныхобщегореквизита разделениерасширенийконфигурацииобщегореквизита '+
- 'режимавтонумерацииобъектов режимзаписирегистра режимиспользованиямодальности ' +
- 'режимиспользованиясинхронныхвызововрасширенийплатформыивнешнихкомпонент режимповторногоиспользованиясеансов ' +
- 'режимполученияданныхвыборапривводепостроке режимсовместимости режимсовместимостиинтерфейса ' +
- 'режимуправленияблокировкойданныхпоумолчанию сериикодовпланавидовхарактеристик сериикодовпланасчетов ' +
- 'сериикодовсправочника созданиепривводе способвыбора способпоискастрокипривводепостроке способредактирования ' +
- 'типданныхтаблицывнешнегоисточникаданных типкодапланавидоврасчета типкодасправочника типмакета типномерабизнеспроцесса ' +
- 'типномерадокумента типномеразадачи типформы удалениедвижений ';
-
- // v8 системные перечисления - разные ==> class
- var v8_system_enums_differents =
- 'важностьпроблемыприменениярасширенияконфигурации вариантинтерфейсаклиентскогоприложения вариантмасштабаформклиентскогоприложения ' +
- 'вариантосновногошрифтаклиентскогоприложения вариантстандартногопериода вариантстандартнойдатыначала видграницы видкартинки ' +
- 'видотображенияполнотекстовогопоиска видрамки видсравнения видцвета видчисловогозначения видшрифта допустимаядлина допустимыйзнак ' +
- 'использованиеbyteordermark использованиеметаданныхполнотекстовогопоиска источникрасширенийконфигурации клавиша кодвозвратадиалога ' +
- 'кодировкаxbase кодировкатекста направлениепоиска направлениесортировки обновлениепредопределенныхданных обновлениеприизмененииданных ' +
- 'отображениепанелиразделов проверказаполнения режимдиалогавопрос режимзапускаклиентскогоприложения режимокругления режимоткрытияформприложения ' +
- 'режимполнотекстовогопоиска скоростьклиентскогосоединения состояниевнешнегоисточникаданных состояниеобновленияконфигурациибазыданных ' +
- 'способвыборасертификатаwindows способкодированиястроки статуссообщения типвнешнейкомпоненты типплатформы типповеденияклавишиenter ' +
- 'типэлементаинформацииовыполненииобновленияконфигурациибазыданных уровеньизоляциитранзакций хешфункция частидаты';
-
- // class: встроенные наборы значений, системные перечисления (содержат дочерние значения, обращения к которым через разыменование)
- var CLASS =
- v8_system_sets_of_values +
- v8_system_enums_interface +
- v8_system_enums_objects_properties +
- v8_system_enums_exchange_plans +
- v8_system_enums_tabular_document +
- v8_system_enums_sheduler +
- v8_system_enums_formatted_document +
- v8_system_enums_query +
- v8_system_enums_report_builder +
- v8_system_enums_files +
- v8_system_enums_query_builder +
- v8_system_enums_data_analysis +
- v8_system_enums_xml_json_xs_dom_xdto_ws +
- v8_system_enums_data_composition_system +
- v8_system_enums_email +
- v8_system_enums_logbook +
- v8_system_enums_cryptography +
- v8_system_enums_zip +
- v8_system_enums_other +
- v8_system_enums_request_schema +
- v8_system_enums_properties_of_metadata_objects +
- v8_system_enums_differents;
-
- // v8 общие объекты (у объектов есть конструктор, экземпляры создаются методом НОВЫЙ) ==> type
- var v8_shared_object =
- 'comобъект ftpсоединение httpзапрос httpсервисответ httpсоединение wsопределения wsпрокси xbase анализданных аннотацияxs ' +
- 'блокировкаданных буфердвоичныхданных включениеxs выражениекомпоновкиданных генераторслучайныхчисел географическаясхема ' +
- 'географическиекоординаты графическаясхема группамоделиxs данныерасшифровкикомпоновкиданных двоичныеданные дендрограмма ' +
- 'диаграмма диаграммаганта диалогвыборафайла диалогвыборацвета диалогвыборашрифта диалограсписаниярегламентногозадания ' +
- 'диалогредактированиястандартногопериода диапазон документdom документhtml документацияxs доставляемоеуведомление ' +
- 'записьdom записьfastinfoset записьhtml записьjson записьxml записьzipфайла записьданных записьтекста записьузловdom ' +
- 'запрос защищенноесоединениеopenssl значенияполейрасшифровкикомпоновкиданных извлечениетекста импортxs интернетпочта ' +
- 'интернетпочтовоесообщение интернетпочтовыйпрофиль интернетпрокси интернетсоединение информациядляприложенияxs ' +
- 'использованиеатрибутаxs использованиесобытияжурналарегистрации источникдоступныхнастроеккомпоновкиданных ' +
- 'итераторузловdom картинка квалификаторыдаты квалификаторыдвоичныхданных квалификаторыстроки квалификаторычисла ' +
- 'компоновщикмакетакомпоновкиданных компоновщикнастроеккомпоновкиданных конструктормакетаоформлениякомпоновкиданных ' +
- 'конструкторнастроеккомпоновкиданных конструкторформатнойстроки линия макеткомпоновкиданных макетобластикомпоновкиданных ' +
- 'макетоформлениякомпоновкиданных маскаxs менеджеркриптографии наборсхемxml настройкикомпоновкиданных настройкисериализацииjson ' +
- 'обработкакартинок обработкарасшифровкикомпоновкиданных обходдереваdom объявлениеатрибутаxs объявлениенотацииxs ' +
- 'объявлениеэлементаxs описаниеиспользованиясобытиядоступжурналарегистрации ' +
- 'описаниеиспользованиясобытияотказвдоступежурналарегистрации описаниеобработкирасшифровкикомпоновкиданных ' +
- 'описаниепередаваемогофайла описаниетипов определениегруппыатрибутовxs определениегруппымоделиxs ' +
- 'определениеограниченияидентичностиxs определениепростоготипаxs определениесоставноготипаxs определениетипадокументаdom ' +
- 'определенияxpathxs отборкомпоновкиданных пакетотображаемыхдокументов параметрвыбора параметркомпоновкиданных ' +
- 'параметрызаписиjson параметрызаписиxml параметрычтенияxml переопределениеxs планировщик полеанализаданных ' +
- 'полекомпоновкиданных построительdom построительзапроса построительотчета построительотчетаанализаданных ' +
- 'построительсхемxml поток потоквпамяти почта почтовоесообщение преобразованиеxsl преобразованиекканоническомуxml ' +
- 'процессорвыводарезультатакомпоновкиданныхвколлекциюзначений процессорвыводарезультатакомпоновкиданныхвтабличныйдокумент ' +
- 'процессоркомпоновкиданных разыменовательпространствименdom рамка расписаниерегламентногозадания расширенноеимяxml ' +
- 'результатчтенияданных своднаядиаграмма связьпараметравыбора связьпотипу связьпотипукомпоновкиданных сериализаторxdto ' +
- 'сертификатклиентаwindows сертификатклиентафайл сертификаткриптографии сертификатыудостоверяющихцентровwindows ' +
- 'сертификатыудостоверяющихцентровфайл сжатиеданных системнаяинформация сообщениепользователю сочетаниеклавиш ' +
- 'сравнениезначений стандартнаядатаначала стандартныйпериод схемаxml схемакомпоновкиданных табличныйдокумент ' +
- 'текстовыйдокумент тестируемоеприложение типданныхxml уникальныйидентификатор фабрикаxdto файл файловыйпоток ' +
- 'фасетдлиныxs фасетколичестваразрядовдробнойчастиxs фасетмаксимальноговключающегозначенияxs ' +
- 'фасетмаксимальногоисключающегозначенияxs фасетмаксимальнойдлиныxs фасетминимальноговключающегозначенияxs ' +
- 'фасетминимальногоисключающегозначенияxs фасетминимальнойдлиныxs фасетобразцаxs фасетобщегоколичестваразрядовxs ' +
- 'фасетперечисленияxs фасетпробельныхсимволовxs фильтрузловdom форматированнаястрока форматированныйдокумент ' +
- 'фрагментxs хешированиеданных хранилищезначения цвет чтениеfastinfoset чтениеhtml чтениеjson чтениеxml чтениеzipфайла ' +
- 'чтениеданных чтениетекста чтениеузловdom шрифт элементрезультатакомпоновкиданных ';
-
- // v8 универсальные коллекции значений ==> type
- var v8_universal_collection =
- 'comsafearray деревозначений массив соответствие списокзначений структура таблицазначений фиксированнаяструктура ' +
- 'фиксированноесоответствие фиксированныймассив ';
-
- // type : встроенные типы
- var TYPE =
- v8_shared_object +
- v8_universal_collection;
-
- // literal : примитивные типы
- var LITERAL = 'null истина ложь неопределено';
-
- // number : числа
- var NUMBERS = hljs.inherit(hljs.NUMBER_MODE);
-
- // string : строки
- var STRINGS = {
- className: 'string',
- begin: '"|\\|', end: '"|$',
- contains: [{begin: '""'}]
- };
-
- // number : даты
- var DATE = {
- begin: "'", end: "'", excludeBegin: true, excludeEnd: true,
- contains: [
- {
- className: 'number',
- begin: '\\d{4}([\\.\\\\/:-]?\\d{2}){0,5}'
- }
- ]
- };
-
- // comment : комментарии
- var COMMENTS = hljs.inherit(hljs.C_LINE_COMMENT_MODE);
-
- // meta : инструкции препроцессора, директивы компиляции
- var META = {
- className: 'meta',
- lexemes: UNDERSCORE_IDENT_RE,
- begin: '#|&', end: '$',
- keywords: {'meta-keyword': KEYWORD + METAKEYWORD},
- contains: [
- COMMENTS
- ]
- };
-
- // symbol : метка goto
- var SYMBOL = {
- className: 'symbol',
- begin: '~', end: ';|:', excludeEnd: true
- };
-
- // function : объявление процедур и функций
- var FUNCTION = {
- className: 'function',
- lexemes: UNDERSCORE_IDENT_RE,
- variants: [
- {begin: 'процедура|функция', end: '\\)', keywords: 'процедура функция'},
- {begin: 'конецпроцедуры|конецфункции', keywords: 'конецпроцедуры конецфункции'}
- ],
- contains: [
- {
- begin: '\\(', end: '\\)', endsParent : true,
- contains: [
- {
- className: 'params',
- lexemes: UNDERSCORE_IDENT_RE,
- begin: UNDERSCORE_IDENT_RE, end: ',', excludeEnd: true, endsWithParent: true,
- keywords: {
- keyword: 'знач',
- literal: LITERAL
- },
- contains: [
- NUMBERS,
- STRINGS,
- DATE
- ]
- },
- COMMENTS
- ]
- },
- hljs.inherit(hljs.TITLE_MODE, {begin: UNDERSCORE_IDENT_RE})
- ]
- };
-
- return {
- case_insensitive: true,
- lexemes: UNDERSCORE_IDENT_RE,
- keywords: {
- keyword: KEYWORD,
- built_in: BUILTIN,
- class: CLASS,
- type: TYPE,
- literal: LITERAL
- },
- contains: [
- META,
- FUNCTION,
- COMMENTS,
- SYMBOL,
- NUMBERS,
- STRINGS,
- DATE
- ]
- }
-};
-},{}],114:[function(require,module,exports){
-module.exports = function(hljs) {
- var regexes = {
- ruleDeclaration: "^[a-zA-Z][a-zA-Z0-9-]*",
- unexpectedChars: "[!@#$^&',?+~`|:]"
- };
-
- var keywords = [
- "ALPHA",
- "BIT",
- "CHAR",
- "CR",
- "CRLF",
- "CTL",
- "DIGIT",
- "DQUOTE",
- "HEXDIG",
- "HTAB",
- "LF",
- "LWSP",
- "OCTET",
- "SP",
- "VCHAR",
- "WSP"
- ];
-
- var commentMode = hljs.COMMENT(";", "$");
-
- var terminalBinaryMode = {
- className: "symbol",
- begin: /%b[0-1]+(-[0-1]+|(\.[0-1]+)+){0,1}/
- };
-
- var terminalDecimalMode = {
- className: "symbol",
- begin: /%d[0-9]+(-[0-9]+|(\.[0-9]+)+){0,1}/
- };
-
- var terminalHexadecimalMode = {
- className: "symbol",
- begin: /%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+){0,1}/,
- };
-
- var caseSensitivityIndicatorMode = {
- className: "symbol",
- begin: /%[si]/
- };
-
- var ruleDeclarationMode = {
- begin: regexes.ruleDeclaration + '\\s*=',
- returnBegin: true,
- end: /=/,
- relevance: 0,
- contains: [{className: "attribute", begin: regexes.ruleDeclaration}]
- };
-
- return {
- illegal: regexes.unexpectedChars,
- keywords: keywords.join(" "),
- contains: [
- ruleDeclarationMode,
- commentMode,
- terminalBinaryMode,
- terminalDecimalMode,
- terminalHexadecimalMode,
- caseSensitivityIndicatorMode,
- hljs.QUOTE_STRING_MODE,
- hljs.NUMBER_MODE
- ]
- };
-};
-},{}],115:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- contains: [
- // IP
- {
- className: 'number',
- begin: '\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b'
- },
- // Other numbers
- {
- className: 'number',
- begin: '\\b\\d+\\b',
- relevance: 0
- },
- // Requests
- {
- className: 'string',
- begin: '"(GET|POST|HEAD|PUT|DELETE|CONNECT|OPTIONS|PATCH|TRACE)', end: '"',
- keywords: 'GET POST HEAD PUT DELETE CONNECT OPTIONS PATCH TRACE',
- illegal: '\\n',
- relevance: 10
- },
- // Dates
- {
- className: 'string',
- begin: /\[/, end: /\]/,
- illegal: '\\n'
- },
- // Strings
- {
- className: 'string',
- begin: '"', end: '"',
- illegal: '\\n'
- }
- ]
- };
-};
-},{}],116:[function(require,module,exports){
-module.exports = function(hljs) {
- var IDENT_RE = '[a-zA-Z_$][a-zA-Z0-9_$]*';
- var IDENT_FUNC_RETURN_TYPE_RE = '([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)';
-
- var AS3_REST_ARG_MODE = {
- className: 'rest_arg',
- begin: '[.]{3}', end: IDENT_RE,
- relevance: 10
- };
-
- return {
- aliases: ['as'],
- keywords: {
- keyword: 'as break case catch class const continue default delete do dynamic each ' +
- 'else extends final finally for function get if implements import in include ' +
- 'instanceof interface internal is namespace native new override package private ' +
- 'protected public return set static super switch this throw try typeof use var void ' +
- 'while with',
- literal: 'true false null undefined'
- },
- contains: [
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.C_NUMBER_MODE,
- {
- className: 'class',
- beginKeywords: 'package', end: '{',
- contains: [hljs.TITLE_MODE]
- },
- {
- className: 'class',
- beginKeywords: 'class interface', end: '{', excludeEnd: true,
- contains: [
- {
- beginKeywords: 'extends implements'
- },
- hljs.TITLE_MODE
- ]
- },
- {
- className: 'meta',
- beginKeywords: 'import include', end: ';',
- keywords: {'meta-keyword': 'import include'}
- },
- {
- className: 'function',
- beginKeywords: 'function', end: '[{;]', excludeEnd: true,
- illegal: '\\S',
- contains: [
- hljs.TITLE_MODE,
- {
- className: 'params',
- begin: '\\(', end: '\\)',
- contains: [
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- AS3_REST_ARG_MODE
- ]
- },
- {
- begin: ':\\s*' + IDENT_FUNC_RETURN_TYPE_RE
- }
- ]
- },
- hljs.METHOD_GUARD
- ],
- illegal: /#/
- };
-};
-},{}],117:[function(require,module,exports){
-module.exports = // We try to support full Ada2012
-//
-// We highlight all appearances of types, keywords, literals (string, char, number, bool)
-// and titles (user defined function/procedure/package)
-// CSS classes are set accordingly
-//
-// Languages causing problems for language detection:
-// xml (broken by Foo : Bar type), elm (broken by Foo : Bar type), vbscript-html (broken by body keyword)
-// sql (ada default.txt has a lot of sql keywords)
-
-function(hljs) {
- // Regular expression for Ada numeric literals.
- // stolen form the VHDL highlighter
-
- // Decimal literal:
- var INTEGER_RE = '\\d(_|\\d)*';
- var EXPONENT_RE = '[eE][-+]?' + INTEGER_RE;
- var DECIMAL_LITERAL_RE = INTEGER_RE + '(\\.' + INTEGER_RE + ')?' + '(' + EXPONENT_RE + ')?';
-
- // Based literal:
- var BASED_INTEGER_RE = '\\w+';
- var BASED_LITERAL_RE = INTEGER_RE + '#' + BASED_INTEGER_RE + '(\\.' + BASED_INTEGER_RE + ')?' + '#' + '(' + EXPONENT_RE + ')?';
-
- var NUMBER_RE = '\\b(' + BASED_LITERAL_RE + '|' + DECIMAL_LITERAL_RE + ')';
-
- // Identifier regex
- var ID_REGEX = '[A-Za-z](_?[A-Za-z0-9.])*';
-
- // bad chars, only allowed in literals
- var BAD_CHARS = '[]{}%#\'\"'
-
- // Ada doesn't have block comments, only line comments
- var COMMENTS = hljs.COMMENT('--', '$');
-
- // variable declarations of the form
- // Foo : Bar := Baz;
- // where only Bar will be highlighted
- var VAR_DECLS = {
- // TODO: These spaces are not required by the Ada syntax
- // however, I have yet to see handwritten Ada code where
- // someone does not put spaces around :
- begin: '\\s+:\\s+', end: '\\s*(:=|;|\\)|=>|$)',
- // endsWithParent: true,
- // returnBegin: true,
- illegal: BAD_CHARS,
- contains: [
- {
- // workaround to avoid highlighting
- // named loops and declare blocks
- beginKeywords: 'loop for declare others',
- endsParent: true,
- },
- {
- // properly highlight all modifiers
- className: 'keyword',
- beginKeywords: 'not null constant access function procedure in out aliased exception'
- },
- {
- className: 'type',
- begin: ID_REGEX,
- endsParent: true,
- relevance: 0,
- }
- ]
- };
-
- return {
- case_insensitive: true,
- keywords: {
- keyword:
- 'abort else new return abs elsif not reverse abstract end ' +
- 'accept entry select access exception of separate aliased exit or some ' +
- 'all others subtype and for out synchronized array function overriding ' +
- 'at tagged generic package task begin goto pragma terminate ' +
- 'body private then if procedure type case in protected constant interface ' +
- 'is raise use declare range delay limited record when delta loop rem while ' +
- 'digits renames with do mod requeue xor',
- literal:
- 'True False',
- },
- contains: [
- COMMENTS,
- // strings "foobar"
- {
- className: 'string',
- begin: /"/, end: /"/,
- contains: [{begin: /""/, relevance: 0}]
- },
- // characters ''
- {
- // character literals always contain one char
- className: 'string',
- begin: /'.'/
- },
- {
- // number literals
- className: 'number',
- begin: NUMBER_RE,
- relevance: 0
- },
- {
- // Attributes
- className: 'symbol',
- begin: "'" + ID_REGEX,
- },
- {
- // package definition, maybe inside generic
- className: 'title',
- begin: '(\\bwith\\s+)?(\\bprivate\\s+)?\\bpackage\\s+(\\bbody\\s+)?', end: '(is|$)',
- keywords: 'package body',
- excludeBegin: true,
- excludeEnd: true,
- illegal: BAD_CHARS
- },
- {
- // function/procedure declaration/definition
- // maybe inside generic
- begin: '(\\b(with|overriding)\\s+)?\\b(function|procedure)\\s+', end: '(\\bis|\\bwith|\\brenames|\\)\\s*;)',
- keywords: 'overriding function procedure with is renames return',
- // we need to re-match the 'function' keyword, so that
- // the title mode below matches only exactly once
- returnBegin: true,
- contains:
- [
- COMMENTS,
- {
- // name of the function/procedure
- className: 'title',
- begin: '(\\bwith\\s+)?\\b(function|procedure)\\s+',
- end: '(\\(|\\s+|$)',
- excludeBegin: true,
- excludeEnd: true,
- illegal: BAD_CHARS
- },
- // 'self'
- // // parameter types
- VAR_DECLS,
- {
- // return type
- className: 'type',
- begin: '\\breturn\\s+', end: '(\\s+|;|$)',
- keywords: 'return',
- excludeBegin: true,
- excludeEnd: true,
- // we are done with functions
- endsParent: true,
- illegal: BAD_CHARS
-
- },
- ]
- },
- {
- // new type declarations
- // maybe inside generic
- className: 'type',
- begin: '\\b(sub)?type\\s+', end: '\\s+',
- keywords: 'type',
- excludeBegin: true,
- illegal: BAD_CHARS
- },
-
- // see comment above the definition
- VAR_DECLS,
-
- // no markup
- // relevance boosters for small snippets
- // {begin: '\\s*=>\\s*'},
- // {begin: '\\s*:=\\s*'},
- // {begin: '\\s+:=\\s+'},
- ]
- };
-};
-},{}],118:[function(require,module,exports){
-module.exports = function(hljs) {
- var NUMBER = {className: 'number', begin: '[\\$%]\\d+'};
- return {
- aliases: ['apacheconf'],
- case_insensitive: true,
- contains: [
- hljs.HASH_COMMENT_MODE,
- {className: 'section', begin: '</?', end: '>'},
- {
- className: 'attribute',
- begin: /\w+/,
- relevance: 0,
- // keywords aren’t needed for highlighting per se, they only boost relevance
- // for a very generally defined mode (starts with a word, ends with line-end
- keywords: {
- nomarkup:
- 'order deny allow setenv rewriterule rewriteengine rewritecond documentroot ' +
- 'sethandler errordocument loadmodule options header listen serverroot ' +
- 'servername'
- },
- starts: {
- end: /$/,
- relevance: 0,
- keywords: {
- literal: 'on off all'
- },
- contains: [
- {
- className: 'meta',
- begin: '\\s\\[', end: '\\]$'
- },
- {
- className: 'variable',
- begin: '[\\$%]\\{', end: '\\}',
- contains: ['self', NUMBER]
- },
- NUMBER,
- hljs.QUOTE_STRING_MODE
- ]
- }
- }
- ],
- illegal: /\S/
- };
-};
-},{}],119:[function(require,module,exports){
-module.exports = function(hljs) {
- var STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: ''});
- var PARAMS = {
- className: 'params',
- begin: '\\(', end: '\\)',
- contains: ['self', hljs.C_NUMBER_MODE, STRING]
- };
- var COMMENT_MODE_1 = hljs.COMMENT('--', '$');
- var COMMENT_MODE_2 = hljs.COMMENT(
- '\\(\\*',
- '\\*\\)',
- {
- contains: ['self', COMMENT_MODE_1] //allow nesting
- }
- );
- var COMMENTS = [
- COMMENT_MODE_1,
- COMMENT_MODE_2,
- hljs.HASH_COMMENT_MODE
- ];
-
- return {
- aliases: ['osascript'],
- keywords: {
- keyword:
- 'about above after against and around as at back before beginning ' +
- 'behind below beneath beside between but by considering ' +
- 'contain contains continue copy div does eighth else end equal ' +
- 'equals error every exit fifth first for fourth from front ' +
- 'get given global if ignoring in into is it its last local me ' +
- 'middle mod my ninth not of on onto or over prop property put ref ' +
- 'reference repeat returning script second set seventh since ' +
- 'sixth some tell tenth that the|0 then third through thru ' +
- 'timeout times to transaction try until where while whose with ' +
- 'without',
- literal:
- 'AppleScript false linefeed return pi quote result space tab true',
- built_in:
- 'alias application boolean class constant date file integer list ' +
- 'number real record string text ' +
- 'activate beep count delay launch log offset read round ' +
- 'run say summarize write ' +
- 'character characters contents day frontmost id item length ' +
- 'month name paragraph paragraphs rest reverse running time version ' +
- 'weekday word words year'
- },
- contains: [
- STRING,
- hljs.C_NUMBER_MODE,
- {
- className: 'built_in',
- begin:
- '\\b(clipboard info|the clipboard|info for|list (disks|folder)|' +
- 'mount volume|path to|(close|open for) access|(get|set) eof|' +
- 'current date|do shell script|get volume settings|random number|' +
- 'set volume|system attribute|system info|time to GMT|' +
- '(load|run|store) script|scripting components|' +
- 'ASCII (character|number)|localized string|' +
- 'choose (application|color|file|file name|' +
- 'folder|from list|remote application|URL)|' +
- 'display (alert|dialog))\\b|^\\s*return\\b'
- },
- {
- className: 'literal',
- begin:
- '\\b(text item delimiters|current application|missing value)\\b'
- },
- {
- className: 'keyword',
- begin:
- '\\b(apart from|aside from|instead of|out of|greater than|' +
- "isn't|(doesn't|does not) (equal|come before|come after|contain)|" +
- '(greater|less) than( or equal)?|(starts?|ends|begins?) with|' +
- 'contained by|comes (before|after)|a (ref|reference)|POSIX file|' +
- 'POSIX path|(date|time) string|quoted form)\\b'
- },
- {
- beginKeywords: 'on',
- illegal: '[${=;\\n]',
- contains: [hljs.UNDERSCORE_TITLE_MODE, PARAMS]
- }
- ].concat(COMMENTS),
- illegal: '//|->|=>|\\[\\['
- };
-};
-},{}],120:[function(require,module,exports){
-module.exports = function(hljs) {
- var CPP = hljs.getLanguage('cpp').exports;
- return {
- keywords: {
- keyword:
- 'boolean byte word string String array ' + CPP.keywords.keyword,
- built_in:
- 'setup loop while catch for if do goto try switch case else ' +
- 'default break continue return ' +
- 'KeyboardController MouseController SoftwareSerial ' +
- 'EthernetServer EthernetClient LiquidCrystal ' +
- 'RobotControl GSMVoiceCall EthernetUDP EsploraTFT ' +
- 'HttpClient RobotMotor WiFiClient GSMScanner ' +
- 'FileSystem Scheduler GSMServer YunClient YunServer ' +
- 'IPAddress GSMClient GSMModem Keyboard Ethernet ' +
- 'Console GSMBand Esplora Stepper Process ' +
- 'WiFiUDP GSM_SMS Mailbox USBHost Firmata PImage ' +
- 'Client Server GSMPIN FileIO Bridge Serial ' +
- 'EEPROM Stream Mouse Audio Servo File Task ' +
- 'GPRS WiFi Wire TFT GSM SPI SD ' +
- 'runShellCommandAsynchronously analogWriteResolution ' +
- 'retrieveCallingNumber printFirmwareVersion ' +
- 'analogReadResolution sendDigitalPortPair ' +
- 'noListenOnLocalhost readJoystickButton setFirmwareVersion ' +
- 'readJoystickSwitch scrollDisplayRight getVoiceCallStatus ' +
- 'scrollDisplayLeft writeMicroseconds delayMicroseconds ' +
- 'beginTransmission getSignalStrength runAsynchronously ' +
- 'getAsynchronously listenOnLocalhost getCurrentCarrier ' +
- 'readAccelerometer messageAvailable sendDigitalPorts ' +
- 'lineFollowConfig countryNameWrite runShellCommand ' +
- 'readStringUntil rewindDirectory readTemperature ' +
- 'setClockDivider readLightSensor endTransmission ' +
- 'analogReference detachInterrupt countryNameRead ' +
- 'attachInterrupt encryptionType readBytesUntil ' +
- 'robotNameWrite readMicrophone robotNameRead cityNameWrite ' +
- 'userNameWrite readJoystickY readJoystickX mouseReleased ' +
- 'openNextFile scanNetworks noInterrupts digitalWrite ' +
- 'beginSpeaker mousePressed isActionDone mouseDragged ' +
- 'displayLogos noAutoscroll addParameter remoteNumber ' +
- 'getModifiers keyboardRead userNameRead waitContinue ' +
- 'processInput parseCommand printVersion readNetworks ' +
- 'writeMessage blinkVersion cityNameRead readMessage ' +
- 'setDataMode parsePacket isListening setBitOrder ' +
- 'beginPacket isDirectory motorsWrite drawCompass ' +
- 'digitalRead clearScreen serialEvent rightToLeft ' +
- 'setTextSize leftToRight requestFrom keyReleased ' +
- 'compassRead analogWrite interrupts WiFiServer ' +
- 'disconnect playMelody parseFloat autoscroll ' +
- 'getPINUsed setPINUsed setTimeout sendAnalog ' +
- 'readSlider analogRead beginWrite createChar ' +
- 'motorsStop keyPressed tempoWrite readButton ' +
- 'subnetMask debugPrint macAddress writeGreen ' +
- 'randomSeed attachGPRS readString sendString ' +
- 'remotePort releaseAll mouseMoved background ' +
- 'getXChange getYChange answerCall getResult ' +
- 'voiceCall endPacket constrain getSocket writeJSON ' +
- 'getButton available connected findUntil readBytes ' +
- 'exitValue readGreen writeBlue startLoop IPAddress ' +
- 'isPressed sendSysex pauseMode gatewayIP setCursor ' +
- 'getOemKey tuneWrite noDisplay loadImage switchPIN ' +
- 'onRequest onReceive changePIN playFile noBuffer ' +
- 'parseInt overflow checkPIN knobRead beginTFT ' +
- 'bitClear updateIR bitWrite position writeRGB ' +
- 'highByte writeRed setSpeed readBlue noStroke ' +
- 'remoteIP transfer shutdown hangCall beginSMS ' +
- 'endWrite attached maintain noCursor checkReg ' +
- 'checkPUK shiftOut isValid shiftIn pulseIn ' +
- 'connect println localIP pinMode getIMEI ' +
- 'display noBlink process getBand running beginSD ' +
- 'drawBMP lowByte setBand release bitRead prepare ' +
- 'pointTo readRed setMode noFill remove listen ' +
- 'stroke detach attach noTone exists buffer ' +
- 'height bitSet circle config cursor random ' +
- 'IRread setDNS endSMS getKey micros ' +
- 'millis begin print write ready flush width ' +
- 'isPIN blink clear press mkdir rmdir close ' +
- 'point yield image BSSID click delay ' +
- 'read text move peek beep rect line open ' +
- 'seek fill size turn stop home find ' +
- 'step tone sqrt RSSI SSID ' +
- 'end bit tan cos sin pow map abs max ' +
- 'min get run put',
- literal:
- 'DIGITAL_MESSAGE FIRMATA_STRING ANALOG_MESSAGE ' +
- 'REPORT_DIGITAL REPORT_ANALOG INPUT_PULLUP ' +
- 'SET_PIN_MODE INTERNAL2V56 SYSTEM_RESET LED_BUILTIN ' +
- 'INTERNAL1V1 SYSEX_START INTERNAL EXTERNAL ' +
- 'DEFAULT OUTPUT INPUT HIGH LOW'
- },
- contains: [
- CPP.preprocessor,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE
- ]
- };
-};
-},{}],121:[function(require,module,exports){
-module.exports = function(hljs) {
- //local labels: %?[FB]?[AT]?\d{1,2}\w+
- return {
- case_insensitive: true,
- aliases: ['arm'],
- lexemes: '\\.?' + hljs.IDENT_RE,
- keywords: {
- meta:
- //GNU preprocs
- '.2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .arm .thumb .code16 .code32 .force_thumb .thumb_func .ltorg '+
- //ARM directives
- 'ALIAS ALIGN ARM AREA ASSERT ATTR CN CODE CODE16 CODE32 COMMON CP DATA DCB DCD DCDU DCDO DCFD DCFDU DCI DCQ DCQU DCW DCWU DN ELIF ELSE END ENDFUNC ENDIF ENDP ENTRY EQU EXPORT EXPORTAS EXTERN FIELD FILL FUNCTION GBLA GBLL GBLS GET GLOBAL IF IMPORT INCBIN INCLUDE INFO KEEP LCLA LCLL LCLS LTORG MACRO MAP MEND MEXIT NOFP OPT PRESERVE8 PROC QN READONLY RELOC REQUIRE REQUIRE8 RLIST FN ROUT SETA SETL SETS SN SPACE SUBT THUMB THUMBX TTL WHILE WEND ',
- built_in:
- 'r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 '+ //standard registers
- 'pc lr sp ip sl sb fp '+ //typical regs plus backward compatibility
- 'a1 a2 a3 a4 v1 v2 v3 v4 v5 v6 v7 v8 f0 f1 f2 f3 f4 f5 f6 f7 '+ //more regs and fp
- 'p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 '+ //coprocessor regs
- 'c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 '+ //more coproc
- 'q0 q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12 q13 q14 q15 '+ //advanced SIMD NEON regs
-
- //program status registers
- 'cpsr_c cpsr_x cpsr_s cpsr_f cpsr_cx cpsr_cxs cpsr_xs cpsr_xsf cpsr_sf cpsr_cxsf '+
- 'spsr_c spsr_x spsr_s spsr_f spsr_cx spsr_cxs spsr_xs spsr_xsf spsr_sf spsr_cxsf '+
-
- //NEON and VFP registers
- 's0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 '+
- 's16 s17 s18 s19 s20 s21 s22 s23 s24 s25 s26 s27 s28 s29 s30 s31 '+
- 'd0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 '+
- 'd16 d17 d18 d19 d20 d21 d22 d23 d24 d25 d26 d27 d28 d29 d30 d31 ' +
-
- '{PC} {VAR} {TRUE} {FALSE} {OPT} {CONFIG} {ENDIAN} {CODESIZE} {CPU} {FPU} {ARCHITECTURE} {PCSTOREOFFSET} {ARMASM_VERSION} {INTER} {ROPI} {RWPI} {SWST} {NOSWST} . @'
- },
- contains: [
- {
- className: 'keyword',
- begin: '\\b('+ //mnemonics
- 'adc|'+
- '(qd?|sh?|u[qh]?)?add(8|16)?|usada?8|(q|sh?|u[qh]?)?(as|sa)x|'+
- 'and|adrl?|sbc|rs[bc]|asr|b[lx]?|blx|bxj|cbn?z|tb[bh]|bic|'+
- 'bfc|bfi|[su]bfx|bkpt|cdp2?|clz|clrex|cmp|cmn|cpsi[ed]|cps|'+
- 'setend|dbg|dmb|dsb|eor|isb|it[te]{0,3}|lsl|lsr|ror|rrx|'+
- 'ldm(([id][ab])|f[ds])?|ldr((s|ex)?[bhd])?|movt?|mvn|mra|mar|'+
- 'mul|[us]mull|smul[bwt][bt]|smu[as]d|smmul|smmla|'+
- 'mla|umlaal|smlal?([wbt][bt]|d)|mls|smlsl?[ds]|smc|svc|sev|'+
- 'mia([bt]{2}|ph)?|mrr?c2?|mcrr2?|mrs|msr|orr|orn|pkh(tb|bt)|rbit|'+
- 'rev(16|sh)?|sel|[su]sat(16)?|nop|pop|push|rfe([id][ab])?|'+
- 'stm([id][ab])?|str(ex)?[bhd]?|(qd?)?sub|(sh?|q|u[qh]?)?sub(8|16)|'+
- '[su]xt(a?h|a?b(16)?)|srs([id][ab])?|swpb?|swi|smi|tst|teq|'+
- 'wfe|wfi|yield'+
- ')'+
- '(eq|ne|cs|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|hs|lo)?'+ //condition codes
- '[sptrx]?' , //legal postfixes
- end: '\\s'
- },
- hljs.COMMENT('[;@]', '$', {relevance: 0}),
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- {
- className: 'string',
- begin: '\'',
- end: '[^\\\\]\'',
- relevance: 0
- },
- {
- className: 'title',
- begin: '\\|', end: '\\|',
- illegal: '\\n',
- relevance: 0
- },
- {
- className: 'number',
- variants: [
- {begin: '[#$=]?0x[0-9a-f]+'}, //hex
- {begin: '[#$=]?0b[01]+'}, //bin
- {begin: '[#$=]\\d+'}, //literal
- {begin: '\\b\\d+'} //bare number
- ],
- relevance: 0
- },
- {
- className: 'symbol',
- variants: [
- {begin: '^[a-z_\\.\\$][a-z0-9_\\.\\$]+'}, //ARM syntax
- {begin: '^\\s*[a-z_\\.\\$][a-z0-9_\\.\\$]+:'}, //GNU ARM syntax
- {begin: '[=#]\\w+' } //label reference
- ],
- relevance: 0
- }
- ]
- };
-};
-},{}],122:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['adoc'],
- contains: [
- // block comment
- hljs.COMMENT(
- '^/{4,}\\n',
- '\\n/{4,}$',
- // can also be done as...
- //'^/{4,}$',
- //'^/{4,}$',
- {
- relevance: 10
- }
- ),
- // line comment
- hljs.COMMENT(
- '^//',
- '$',
- {
- relevance: 0
- }
- ),
- // title
- {
- className: 'title',
- begin: '^\\.\\w.*$'
- },
- // example, admonition & sidebar blocks
- {
- begin: '^[=\\*]{4,}\\n',
- end: '\\n^[=\\*]{4,}$',
- relevance: 10
- },
- // headings
- {
- className: 'section',
- relevance: 10,
- variants: [
- {begin: '^(={1,5}) .+?( \\1)?$'},
- {begin: '^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$'},
- ]
- },
- // document attributes
- {
- className: 'meta',
- begin: '^:.+?:',
- end: '\\s',
- excludeEnd: true,
- relevance: 10
- },
- // block attributes
- {
- className: 'meta',
- begin: '^\\[.+?\\]$',
- relevance: 0
- },
- // quoteblocks
- {
- className: 'quote',
- begin: '^_{4,}\\n',
- end: '\\n_{4,}$',
- relevance: 10
- },
- // listing and literal blocks
- {
- className: 'code',
- begin: '^[\\-\\.]{4,}\\n',
- end: '\\n[\\-\\.]{4,}$',
- relevance: 10
- },
- // passthrough blocks
- {
- begin: '^\\+{4,}\\n',
- end: '\\n\\+{4,}$',
- contains: [
- {
- begin: '<', end: '>',
- subLanguage: 'xml',
- relevance: 0
- }
- ],
- relevance: 10
- },
- // lists (can only capture indicators)
- {
- className: 'bullet',
- begin: '^(\\*+|\\-+|\\.+|[^\\n]+?::)\\s+'
- },
- // admonition
- {
- className: 'symbol',
- begin: '^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+',
- relevance: 10
- },
- // inline strong
- {
- className: 'strong',
- // must not follow a word character or be followed by an asterisk or space
- begin: '\\B\\*(?![\\*\\s])',
- end: '(\\n{2}|\\*)',
- // allow escaped asterisk followed by word char
- contains: [
- {
- begin: '\\\\*\\w',
- relevance: 0
- }
- ]
- },
- // inline emphasis
- {
- className: 'emphasis',
- // must not follow a word character or be followed by a single quote or space
- begin: '\\B\'(?![\'\\s])',
- end: '(\\n{2}|\')',
- // allow escaped single quote followed by word char
- contains: [
- {
- begin: '\\\\\'\\w',
- relevance: 0
- }
- ],
- relevance: 0
- },
- // inline emphasis (alt)
- {
- className: 'emphasis',
- // must not follow a word character or be followed by an underline or space
- begin: '_(?![_\\s])',
- end: '(\\n{2}|_)',
- relevance: 0
- },
- // inline smart quotes
- {
- className: 'string',
- variants: [
- {begin: "``.+?''"},
- {begin: "`.+?'"}
- ]
- },
- // inline code snippets (TODO should get same treatment as strong and emphasis)
- {
- className: 'code',
- begin: '(`.+?`|\\+.+?\\+)',
- relevance: 0
- },
- // indented literal block
- {
- className: 'code',
- begin: '^[ \\t]',
- end: '$',
- relevance: 0
- },
- // horizontal rules
- {
- begin: '^\'{3,}[ \\t]*$',
- relevance: 10
- },
- // images and links
- {
- begin: '(link:)?(http|https|ftp|file|irc|image:?):\\S+\\[.*?\\]',
- returnBegin: true,
- contains: [
- {
- begin: '(link|image:?):',
- relevance: 0
- },
- {
- className: 'link',
- begin: '\\w',
- end: '[^\\[]+',
- relevance: 0
- },
- {
- className: 'string',
- begin: '\\[',
- end: '\\]',
- excludeBegin: true,
- excludeEnd: true,
- relevance: 0
- }
- ],
- relevance: 10
- }
- ]
- };
-};
-},{}],123:[function(require,module,exports){
-module.exports = function (hljs) {
- var KEYWORDS =
- 'false synchronized int abstract float private char boolean static null if const ' +
- 'for true while long throw strictfp finally protected import native final return void ' +
- 'enum else extends implements break transient new catch instanceof byte super volatile case ' +
- 'assert short package default double public try this switch continue throws privileged ' +
- 'aspectOf adviceexecution proceed cflowbelow cflow initialization preinitialization ' +
- 'staticinitialization withincode target within execution getWithinTypeName handler ' +
- 'thisJoinPoint thisJoinPointStaticPart thisEnclosingJoinPointStaticPart declare parents '+
- 'warning error soft precedence thisAspectInstance';
- var SHORTKEYS = 'get set args call';
- return {
- keywords : KEYWORDS,
- illegal : /<\/|#/,
- contains : [
- hljs.COMMENT(
- '/\\*\\*',
- '\\*/',
- {
- relevance : 0,
- contains : [
- {
- // eat up @'s in emails to prevent them to be recognized as doctags
- begin: /\w+@/, relevance: 0
- },
- {
- className : 'doctag',
- begin : '@[A-Za-z]+'
- }
- ]
- }
- ),
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- {
- className : 'class',
- beginKeywords : 'aspect',
- end : /[{;=]/,
- excludeEnd : true,
- illegal : /[:;"\[\]]/,
- contains : [
- {
- beginKeywords : 'extends implements pertypewithin perthis pertarget percflowbelow percflow issingleton'
- },
- hljs.UNDERSCORE_TITLE_MODE,
- {
- begin : /\([^\)]*/,
- end : /[)]+/,
- keywords : KEYWORDS + ' ' + SHORTKEYS,
- excludeEnd : false
- }
- ]
- },
- {
- className : 'class',
- beginKeywords : 'class interface',
- end : /[{;=]/,
- excludeEnd : true,
- relevance: 0,
- keywords : 'class interface',
- illegal : /[:"\[\]]/,
- contains : [
- {beginKeywords : 'extends implements'},
- hljs.UNDERSCORE_TITLE_MODE
- ]
- },
- {
- // AspectJ Constructs
- beginKeywords : 'pointcut after before around throwing returning',
- end : /[)]/,
- excludeEnd : false,
- illegal : /["\[\]]/,
- contains : [
- {
- begin : hljs.UNDERSCORE_IDENT_RE + '\\s*\\(',
- returnBegin : true,
- contains : [hljs.UNDERSCORE_TITLE_MODE]
- }
- ]
- },
- {
- begin : /[:]/,
- returnBegin : true,
- end : /[{;]/,
- relevance: 0,
- excludeEnd : false,
- keywords : KEYWORDS,
- illegal : /["\[\]]/,
- contains : [
- {
- begin : hljs.UNDERSCORE_IDENT_RE + '\\s*\\(',
- keywords : KEYWORDS + ' ' + SHORTKEYS,
- relevance: 0
- },
- hljs.QUOTE_STRING_MODE
- ]
- },
- {
- // this prevents 'new Name(...), or throw ...' from being recognized as a function definition
- beginKeywords : 'new throw',
- relevance : 0
- },
- {
- // the function class is a bit different for AspectJ compared to the Java language
- className : 'function',
- begin : /\w+ +\w+(\.)?\w+\s*\([^\)]*\)\s*((throws)[\w\s,]+)?[\{;]/,
- returnBegin : true,
- end : /[{;=]/,
- keywords : KEYWORDS,
- excludeEnd : true,
- contains : [
- {
- begin : hljs.UNDERSCORE_IDENT_RE + '\\s*\\(',
- returnBegin : true,
- relevance: 0,
- contains : [hljs.UNDERSCORE_TITLE_MODE]
- },
- {
- className : 'params',
- begin : /\(/, end : /\)/,
- relevance: 0,
- keywords : KEYWORDS,
- contains : [
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- },
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- },
- hljs.C_NUMBER_MODE,
- {
- // annotation is also used in this language
- className : 'meta',
- begin : '@[A-Za-z]+'
- }
- ]
- };
-};
-},{}],124:[function(require,module,exports){
-module.exports = function(hljs) {
- var BACKTICK_ESCAPE = {
- begin: '`[\\s\\S]'
- };
-
- return {
- case_insensitive: true,
- aliases: [ 'ahk' ],
- keywords: {
- keyword: 'Break Continue Critical Exit ExitApp Gosub Goto New OnExit Pause return SetBatchLines SetTimer Suspend Thread Throw Until ahk_id ahk_class ahk_pid ahk_exe ahk_group',
- literal: 'A|0 true false NOT AND OR',
- built_in: 'ComSpec Clipboard ClipboardAll ErrorLevel',
- },
- contains: [
- {
- className: 'built_in',
- begin: 'A_[a-zA-Z0-9]+'
- },
- BACKTICK_ESCAPE,
- hljs.inherit(hljs.QUOTE_STRING_MODE, {contains: [BACKTICK_ESCAPE]}),
- hljs.COMMENT(';', '$', {relevance: 0}),
- hljs.C_BLOCK_COMMENT_MODE,
- {
- className: 'number',
- begin: hljs.NUMBER_RE,
- relevance: 0
- },
- {
- className: 'subst', // FIXED
- begin: '%(?=[a-zA-Z0-9#_$@])', end: '%',
- illegal: '[^a-zA-Z0-9#_$@]'
- },
- {
- className: 'built_in',
- begin: '^\\s*\\w+\\s*,'
- //I don't really know if this is totally relevant
- },
- {
- className: 'meta',
- begin: '^\\s*#\w+', end:'$',
- relevance: 0
- },
- {
- className: 'symbol',
- contains: [BACKTICK_ESCAPE],
- variants: [
- {begin: '^[^\\n";]+::(?!=)'},
- {begin: '^[^\\n";]+:(?!=)', relevance: 0} // zero relevance as it catches a lot of things
- // followed by a single ':' in many languages
- ]
- },
- {
- // consecutive commas, not for highlighting but just for relevance
- begin: ',\\s*,'
- }
- ]
- }
-};
-},{}],125:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS = 'ByRef Case Const ContinueCase ContinueLoop ' +
- 'Default Dim Do Else ElseIf EndFunc EndIf EndSelect ' +
- 'EndSwitch EndWith Enum Exit ExitLoop For Func ' +
- 'Global If In Local Next ReDim Return Select Static ' +
- 'Step Switch Then To Until Volatile WEnd While With',
-
- LITERAL = 'True False And Null Not Or',
-
- BUILT_IN =
- 'Abs ACos AdlibRegister AdlibUnRegister Asc AscW ASin Assign ATan AutoItSetOption AutoItWinGetTitle AutoItWinSetTitle Beep Binary BinaryLen BinaryMid BinaryToString BitAND BitNOT BitOR BitRotate BitShift BitXOR BlockInput Break Call CDTray Ceiling Chr ChrW ClipGet ClipPut ConsoleRead ConsoleWrite ConsoleWriteError ControlClick ControlCommand ControlDisable ControlEnable ControlFocus ControlGetFocus ControlGetHandle ControlGetPos ControlGetText ControlHide ControlListView ControlMove ControlSend ControlSetText ControlShow ControlTreeView Cos Dec DirCopy DirCreate DirGetSize DirMove DirRemove DllCall DllCallAddress DllCallbackFree DllCallbackGetPtr DllCallbackRegister DllClose DllOpen DllStructCreate DllStructGetData DllStructGetPtr DllStructGetSize DllStructSetData DriveGetDrive DriveGetFileSystem DriveGetLabel DriveGetSerial DriveGetType DriveMapAdd DriveMapDel DriveMapGet DriveSetLabel DriveSpaceFree DriveSpaceTotal DriveStatus EnvGet EnvSet EnvUpdate Eval Execute Exp FileChangeDir FileClose FileCopy FileCreateNTFSLink FileCreateShortcut FileDelete FileExists FileFindFirstFile FileFindNextFile FileFlush FileGetAttrib FileGetEncoding FileGetLongName FileGetPos FileGetShortcut FileGetShortName FileGetSize FileGetTime FileGetVersion FileInstall FileMove FileOpen FileOpenDialog FileRead FileReadLine FileReadToArray FileRecycle FileRecycleEmpty FileSaveDialog FileSelectFolder FileSetAttrib FileSetEnd FileSetPos FileSetTime FileWrite FileWriteLine Floor FtpSetProxy FuncName GUICreate GUICtrlCreateAvi GUICtrlCreateButton GUICtrlCreateCheckbox GUICtrlCreateCombo GUICtrlCreateContextMenu GUICtrlCreateDate GUICtrlCreateDummy GUICtrlCreateEdit GUICtrlCreateGraphic GUICtrlCreateGroup GUICtrlCreateIcon GUICtrlCreateInput GUICtrlCreateLabel GUICtrlCreateList GUICtrlCreateListView GUICtrlCreateListViewItem GUICtrlCreateMenu GUICtrlCreateMenuItem GUICtrlCreateMonthCal GUICtrlCreateObj GUICtrlCreatePic GUICtrlCreateProgress GUICtrlCreateRadio GUICtrlCreateSlider GUICtrlCreateTab GUICtrlCreateTabItem GUICtrlCreateTreeView GUICtrlCreateTreeViewItem GUICtrlCreateUpdown GUICtrlDelete GUICtrlGetHandle GUICtrlGetState GUICtrlRead GUICtrlRecvMsg GUICtrlRegisterListViewSort GUICtrlSendMsg GUICtrlSendToDummy GUICtrlSetBkColor GUICtrlSetColor GUICtrlSetCursor GUICtrlSetData GUICtrlSetDefBkColor GUICtrlSetDefColor GUICtrlSetFont GUICtrlSetGraphic GUICtrlSetImage GUICtrlSetLimit GUICtrlSetOnEvent GUICtrlSetPos GUICtrlSetResizing GUICtrlSetState GUICtrlSetStyle GUICtrlSetTip GUIDelete GUIGetCursorInfo GUIGetMsg GUIGetStyle GUIRegisterMsg GUISetAccelerators GUISetBkColor GUISetCoord GUISetCursor GUISetFont GUISetHelp GUISetIcon GUISetOnEvent GUISetState GUISetStyle GUIStartGroup GUISwitch Hex HotKeySet HttpSetProxy HttpSetUserAgent HWnd InetClose InetGet InetGetInfo InetGetSize InetRead IniDelete IniRead IniReadSection IniReadSectionNames IniRenameSection IniWrite IniWriteSection InputBox Int IsAdmin IsArray IsBinary IsBool IsDeclared IsDllStruct IsFloat IsFunc IsHWnd IsInt IsKeyword IsNumber IsObj IsPtr IsString Log MemGetStats Mod MouseClick MouseClickDrag MouseDown MouseGetCursor MouseGetPos MouseMove MouseUp MouseWheel MsgBox Number ObjCreate ObjCreateInterface ObjEvent ObjGet ObjName OnAutoItExitRegister OnAutoItExitUnRegister Ping PixelChecksum PixelGetColor PixelSearch ProcessClose ProcessExists ProcessGetStats ProcessList ProcessSetPriority ProcessWait ProcessWaitClose ProgressOff ProgressOn ProgressSet Ptr Random RegDelete RegEnumKey RegEnumVal RegRead RegWrite Round Run RunAs RunAsWait RunWait Send SendKeepActive SetError SetExtended ShellExecute ShellExecuteWait Shutdown Sin Sleep SoundPlay SoundSetWaveVolume SplashImageOn SplashOff SplashTextOn Sqrt SRandom StatusbarGetText StderrRead StdinWrite StdioClose StdoutRead String StringAddCR StringCompare StringFormat StringFromASCIIArray StringInStr StringIsAlNum StringIsAlpha StringIsASCII StringIsDigit StringIsFloat StringIsInt StringIsLower StringIsSpace StringIsUpper StringIsXDigit StringLeft StringLen StringLower StringMid StringRegExp StringRegExpReplace StringReplace StringReverse StringRight StringSplit StringStripCR StringStripWS StringToASCIIArray StringToBinary StringTrimLeft StringTrimRight StringUpper Tan TCPAccept TCPCloseSocket TCPConnect TCPListen TCPNameToIP TCPRecv TCPSend TCPShutdown, UDPShutdown TCPStartup, UDPStartup TimerDiff TimerInit ToolTip TrayCreateItem TrayCreateMenu TrayGetMsg TrayItemDelete TrayItemGetHandle TrayItemGetState TrayItemGetText TrayItemSetOnEvent TrayItemSetState TrayItemSetText TraySetClick TraySetIcon TraySetOnEvent TraySetPauseIcon TraySetState TraySetToolTip TrayTip UBound UDPBind UDPCloseSocket UDPOpen UDPRecv UDPSend VarGetType WinActivate WinActive WinClose WinExists WinFlash WinGetCaretPos WinGetClassList WinGetClientSize WinGetHandle WinGetPos WinGetProcess WinGetState WinGetText WinGetTitle WinKill WinList WinMenuSelectItem WinMinimizeAll WinMinimizeAllUndo WinMove WinSetOnTop WinSetState WinSetTitle WinSetTrans WinWait',
-
- COMMENT = {
- variants: [
- hljs.COMMENT(';', '$', {relevance: 0}),
- hljs.COMMENT('#cs', '#ce'),
- hljs.COMMENT('#comments-start', '#comments-end')
- ]
- },
-
- VARIABLE = {
- begin: '\\$[A-z0-9_]+'
- },
-
- STRING = {
- className: 'string',
- variants: [{
- begin: /"/,
- end: /"/,
- contains: [{
- begin: /""/,
- relevance: 0
- }]
- }, {
- begin: /'/,
- end: /'/,
- contains: [{
- begin: /''/,
- relevance: 0
- }]
- }]
- },
-
- NUMBER = {
- variants: [hljs.BINARY_NUMBER_MODE, hljs.C_NUMBER_MODE]
- },
-
- PREPROCESSOR = {
- className: 'meta',
- begin: '#',
- end: '$',
- keywords: {'meta-keyword': 'comments include include-once NoTrayIcon OnAutoItStartRegister pragma compile RequireAdmin'},
- contains: [{
- begin: /\\\n/,
- relevance: 0
- }, {
- beginKeywords: 'include',
- keywords: {'meta-keyword': 'include'},
- end: '$',
- contains: [
- STRING, {
- className: 'meta-string',
- variants: [{
- begin: '<',
- end: '>'
- }, {
- begin: /"/,
- end: /"/,
- contains: [{
- begin: /""/,
- relevance: 0
- }]
- }, {
- begin: /'/,
- end: /'/,
- contains: [{
- begin: /''/,
- relevance: 0
- }]
- }]
- }
- ]
- },
- STRING,
- COMMENT
- ]
- },
-
- CONSTANT = {
- className: 'symbol',
- // begin: '@',
- // end: '$',
- // keywords: 'AppDataCommonDir AppDataDir AutoItExe AutoItPID AutoItVersion AutoItX64 COM_EventObj CommonFilesDir Compiled ComputerName ComSpec CPUArch CR CRLF DesktopCommonDir DesktopDepth DesktopDir DesktopHeight DesktopRefresh DesktopWidth DocumentsCommonDir error exitCode exitMethod extended FavoritesCommonDir FavoritesDir GUI_CtrlHandle GUI_CtrlId GUI_DragFile GUI_DragId GUI_DropId GUI_WinHandle HomeDrive HomePath HomeShare HotKeyPressed HOUR IPAddress1 IPAddress2 IPAddress3 IPAddress4 KBLayout LF LocalAppDataDir LogonDNSDomain LogonDomain LogonServer MDAY MIN MON MSEC MUILang MyDocumentsDir NumParams OSArch OSBuild OSLang OSServicePack OSType OSVersion ProgramFilesDir ProgramsCommonDir ProgramsDir ScriptDir ScriptFullPath ScriptLineNumber ScriptName SEC StartMenuCommonDir StartMenuDir StartupCommonDir StartupDir SW_DISABLE SW_ENABLE SW_HIDE SW_LOCK SW_MAXIMIZE SW_MINIMIZE SW_RESTORE SW_SHOW SW_SHOWDEFAULT SW_SHOWMAXIMIZED SW_SHOWMINIMIZED SW_SHOWMINNOACTIVE SW_SHOWNA SW_SHOWNOACTIVATE SW_SHOWNORMAL SW_UNLOCK SystemDir TAB TempDir TRAY_ID TrayIconFlashing TrayIconVisible UserName UserProfileDir WDAY WindowsDir WorkingDir YDAY YEAR',
- // relevance: 5
- begin: '@[A-z0-9_]+'
- },
-
- FUNCTION = {
- className: 'function',
- beginKeywords: 'Func',
- end: '$',
- illegal: '\\$|\\[|%',
- contains: [
- hljs.UNDERSCORE_TITLE_MODE, {
- className: 'params',
- begin: '\\(',
- end: '\\)',
- contains: [
- VARIABLE,
- STRING,
- NUMBER
- ]
- }
- ]
- };
-
- return {
- case_insensitive: true,
- illegal: /\/\*/,
- keywords: {
- keyword: KEYWORDS,
- built_in: BUILT_IN,
- literal: LITERAL
- },
- contains: [
- COMMENT,
- VARIABLE,
- STRING,
- NUMBER,
- PREPROCESSOR,
- CONSTANT,
- FUNCTION
- ]
- }
-};
-},{}],126:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- case_insensitive: true,
- lexemes: '\\.?' + hljs.IDENT_RE,
- keywords: {
- keyword:
- /* mnemonic */
- 'adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs ' +
- 'brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr ' +
- 'clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor ' +
- 'fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul ' +
- 'muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs ' +
- 'sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub ' +
- 'subi swap tst wdr',
- built_in:
- /* general purpose registers */
- 'r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 ' +
- 'r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ' +
- /* IO Registers (ATMega128) */
- 'ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h ' +
- 'tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ' +
- 'ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ' +
- 'ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk ' +
- 'tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ' +
- 'ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr ' +
- 'porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ' +
- 'ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf',
- meta:
- '.byte .cseg .db .def .device .dseg .dw .endmacro .equ .eseg .exit .include .list ' +
- '.listmac .macro .nolist .org .set'
- },
- contains: [
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.COMMENT(
- ';',
- '$',
- {
- relevance: 0
- }
- ),
- hljs.C_NUMBER_MODE, // 0x..., decimal, float
- hljs.BINARY_NUMBER_MODE, // 0b...
- {
- className: 'number',
- begin: '\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)' // $..., 0o...
- },
- hljs.QUOTE_STRING_MODE,
- {
- className: 'string',
- begin: '\'', end: '[^\\\\]\'',
- illegal: '[^\\\\][^\']'
- },
- {className: 'symbol', begin: '^[A-Za-z0-9_.$]+:'},
- {className: 'meta', begin: '#', end: '$'},
- { // подстановка в «.macro»
- className: 'subst',
- begin: '@[0-9]+'
- }
- ]
- };
-};
-},{}],127:[function(require,module,exports){
-module.exports = function(hljs) {
- var VARIABLE = {
- className: 'variable',
- variants: [
- {begin: /\$[\w\d#@][\w\d_]*/},
- {begin: /\$\{(.*?)}/}
- ]
- };
- var KEYWORDS = 'BEGIN END if else while do for in break continue delete next nextfile function func exit|10';
- var STRING = {
- className: 'string',
- contains: [hljs.BACKSLASH_ESCAPE],
- variants: [
- {
- begin: /(u|b)?r?'''/, end: /'''/,
- relevance: 10
- },
- {
- begin: /(u|b)?r?"""/, end: /"""/,
- relevance: 10
- },
- {
- begin: /(u|r|ur)'/, end: /'/,
- relevance: 10
- },
- {
- begin: /(u|r|ur)"/, end: /"/,
- relevance: 10
- },
- {
- begin: /(b|br)'/, end: /'/
- },
- {
- begin: /(b|br)"/, end: /"/
- },
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE
- ]
- };
- return {
- keywords: {
- keyword: KEYWORDS
- },
- contains: [
- VARIABLE,
- STRING,
- hljs.REGEXP_MODE,
- hljs.HASH_COMMENT_MODE,
- hljs.NUMBER_MODE
- ]
- }
-};
-},{}],128:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- keywords: 'false int abstract private char boolean static null if for true ' +
- 'while long throw finally protected final return void enum else ' +
- 'break new catch byte super case short default double public try this switch ' +
- 'continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count ' +
- 'order group by asc desc index hint like dispaly edit client server ttsbegin ' +
- 'ttscommit str real date container anytype common div mod',
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE,
- {
- className: 'meta',
- begin: '#', end: '$'
- },
- {
- className: 'class',
- beginKeywords: 'class interface', end: '{', excludeEnd: true,
- illegal: ':',
- contains: [
- {beginKeywords: 'extends implements'},
- hljs.UNDERSCORE_TITLE_MODE
- ]
- }
- ]
- };
-};
-},{}],129:[function(require,module,exports){
-module.exports = function(hljs) {
- var VAR = {
- className: 'variable',
- variants: [
- {begin: /\$[\w\d#@][\w\d_]*/},
- {begin: /\$\{(.*?)}/}
- ]
- };
- var QUOTE_STRING = {
- className: 'string',
- begin: /"/, end: /"/,
- contains: [
- hljs.BACKSLASH_ESCAPE,
- VAR,
- {
- className: 'variable',
- begin: /\$\(/, end: /\)/,
- contains: [hljs.BACKSLASH_ESCAPE]
- }
- ]
- };
- var APOS_STRING = {
- className: 'string',
- begin: /'/, end: /'/
- };
-
- return {
- aliases: ['sh', 'zsh'],
- lexemes: /\b-?[a-z\._]+\b/,
- keywords: {
- keyword:
- 'if then else elif fi for while in do done case esac function',
- literal:
- 'true false',
- built_in:
- // Shell built-ins
- // http://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
- 'break cd continue eval exec exit export getopts hash pwd readonly return shift test times ' +
- 'trap umask unset ' +
- // Bash built-ins
- 'alias bind builtin caller command declare echo enable help let local logout mapfile printf ' +
- 'read readarray source type typeset ulimit unalias ' +
- // Shell modifiers
- 'set shopt ' +
- // Zsh built-ins
- 'autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles ' +
- 'compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate ' +
- 'fc fg float functions getcap getln history integer jobs kill limit log noglob popd print ' +
- 'pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit ' +
- 'unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof ' +
- 'zpty zregexparse zsocket zstyle ztcp',
- _:
- '-ne -eq -lt -gt -f -d -e -s -l -a' // relevance booster
- },
- contains: [
- {
- className: 'meta',
- begin: /^#![^\n]+sh\s*$/,
- relevance: 10
- },
- {
- className: 'function',
- begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
- returnBegin: true,
- contains: [hljs.inherit(hljs.TITLE_MODE, {begin: /\w[\w\d_]*/})],
- relevance: 0
- },
- hljs.HASH_COMMENT_MODE,
- QUOTE_STRING,
- APOS_STRING,
- VAR
- ]
- };
-};
-},{}],130:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- case_insensitive: true,
- illegal: '^\.',
- // Support explicitely typed variables that end with $%! or #.
- lexemes: '[a-zA-Z][a-zA-Z0-9_\$\%\!\#]*',
- keywords: {
- keyword:
- 'ABS ASC AND ATN AUTO|0 BEEP BLOAD|10 BSAVE|10 CALL CALLS CDBL CHAIN CHDIR CHR$|10 CINT CIRCLE ' +
- 'CLEAR CLOSE CLS COLOR COM COMMON CONT COS CSNG CSRLIN CVD CVI CVS DATA DATE$ ' +
- 'DEFDBL DEFINT DEFSNG DEFSTR DEF|0 SEG USR DELETE DIM DRAW EDIT END ENVIRON ENVIRON$ ' +
- 'EOF EQV ERASE ERDEV ERDEV$ ERL ERR ERROR EXP FIELD FILES FIX FOR|0 FRE GET GOSUB|10 GOTO ' +
- 'HEX$ IF|0 THEN ELSE|0 INKEY$ INP INPUT INPUT# INPUT$ INSTR IMP INT IOCTL IOCTL$ KEY ON ' +
- 'OFF LIST KILL LEFT$ LEN LET LINE LLIST LOAD LOC LOCATE LOF LOG LPRINT USING LSET ' +
- 'MERGE MID$ MKDIR MKD$ MKI$ MKS$ MOD NAME NEW NEXT NOISE NOT OCT$ ON OR PEN PLAY STRIG OPEN OPTION ' +
- 'BASE OUT PAINT PALETTE PCOPY PEEK PMAP POINT POKE POS PRINT PRINT] PSET PRESET ' +
- 'PUT RANDOMIZE READ REM RENUM RESET|0 RESTORE RESUME RETURN|0 RIGHT$ RMDIR RND RSET ' +
- 'RUN SAVE SCREEN SGN SHELL SIN SOUND SPACE$ SPC SQR STEP STICK STOP STR$ STRING$ SWAP ' +
- 'SYSTEM TAB TAN TIME$ TIMER TROFF TRON TO USR VAL VARPTR VARPTR$ VIEW WAIT WHILE ' +
- 'WEND WIDTH WINDOW WRITE XOR'
- },
- contains: [
- hljs.QUOTE_STRING_MODE,
- hljs.COMMENT('REM', '$', {relevance: 10}),
- hljs.COMMENT('\'', '$', {relevance: 0}),
- {
- // Match line numbers
- className: 'symbol',
- begin: '^[0-9]+\ ',
- relevance: 10
- },
- {
- // Match typed numeric constants (1000, 12.34!, 1.2e5, 1.5#, 1.2D2)
- className: 'number',
- begin: '\\b([0-9]+[0-9edED\.]*[#\!]?)',
- relevance: 0
- },
- {
- // Match hexadecimal numbers (&Hxxxx)
- className: 'number',
- begin: '(\&[hH][0-9a-fA-F]{1,4})'
- },
- {
- // Match octal numbers (&Oxxxxxx)
- className: 'number',
- begin: '(\&[oO][0-7]{1,6})'
- }
- ]
- };
-};
-},{}],131:[function(require,module,exports){
-module.exports = function(hljs){
- return {
- contains: [
- // Attribute
- {
- className: 'attribute',
- begin: /</, end: />/
- },
- // Specific
- {
- begin: /::=/,
- starts: {
- end: /$/,
- contains: [
- {
- begin: /</, end: />/
- },
- // Common
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE
- ]
- }
- }
- ]
- };
-};
-},{}],132:[function(require,module,exports){
-module.exports = function(hljs){
- var LITERAL = {
- className: 'literal',
- begin: '[\\+\\-]',
- relevance: 0
- };
- return {
- aliases: ['bf'],
- contains: [
- hljs.COMMENT(
- '[^\\[\\]\\.,\\+\\-<> \r\n]',
- '[\\[\\]\\.,\\+\\-<> \r\n]',
- {
- returnEnd: true,
- relevance: 0
- }
- ),
- {
- className: 'title',
- begin: '[\\[\\]]',
- relevance: 0
- },
- {
- className: 'string',
- begin: '[\\.,]',
- relevance: 0
- },
- {
- // this mode works as the only relevance counter
- begin: /\+\+|\-\-/, returnBegin: true,
- contains: [LITERAL]
- },
- LITERAL
- ]
- };
-};
-},{}],133:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS =
- 'div mod in and or not xor asserterror begin case do downto else end exit for if of repeat then to ' +
- 'until while with var';
- var LITERALS = 'false true';
- var COMMENT_MODES = [
- hljs.C_LINE_COMMENT_MODE,
- hljs.COMMENT(
- /\{/,
- /\}/,
- {
- relevance: 0
- }
- ),
- hljs.COMMENT(
- /\(\*/,
- /\*\)/,
- {
- relevance: 10
- }
- )
- ];
- var STRING = {
- className: 'string',
- begin: /'/, end: /'/,
- contains: [{begin: /''/}]
- };
- var CHAR_STRING = {
- className: 'string', begin: /(#\d+)+/
- };
- var DATE = {
- className: 'number',
- begin: '\\b\\d+(\\.\\d+)?(DT|D|T)',
- relevance: 0
- };
- var DBL_QUOTED_VARIABLE = {
- className: 'string', // not a string technically but makes sense to be highlighted in the same style
- begin: '"',
- end: '"'
- };
-
- var PROCEDURE = {
- className: 'function',
- beginKeywords: 'procedure', end: /[:;]/,
- keywords: 'procedure|10',
- contains: [
- hljs.TITLE_MODE,
- {
- className: 'params',
- begin: /\(/, end: /\)/,
- keywords: KEYWORDS,
- contains: [STRING, CHAR_STRING]
- }
- ].concat(COMMENT_MODES)
- };
-
- var OBJECT = {
- className: 'class',
- begin: 'OBJECT (Table|Form|Report|Dataport|Codeunit|XMLport|MenuSuite|Page|Query) (\\d+) ([^\\r\\n]+)',
- returnBegin: true,
- contains: [
- hljs.TITLE_MODE,
- PROCEDURE
- ]
- };
-
- return {
- case_insensitive: true,
- keywords: { keyword: KEYWORDS, literal: LITERALS },
- illegal: /\/\*/,
- contains: [
- STRING, CHAR_STRING,
- DATE, DBL_QUOTED_VARIABLE,
- hljs.NUMBER_MODE,
- OBJECT,
- PROCEDURE
- ]
- };
-};
-},{}],134:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['capnp'],
- keywords: {
- keyword:
- 'struct enum interface union group import using const annotation extends in of on as with from fixed',
- built_in:
- 'Void Bool Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Float32 Float64 ' +
- 'Text Data AnyPointer AnyStruct Capability List',
- literal:
- 'true false'
- },
- contains: [
- hljs.QUOTE_STRING_MODE,
- hljs.NUMBER_MODE,
- hljs.HASH_COMMENT_MODE,
- {
- className: 'meta',
- begin: /@0x[\w\d]{16};/,
- illegal: /\n/
- },
- {
- className: 'symbol',
- begin: /@\d+\b/
- },
- {
- className: 'class',
- beginKeywords: 'struct enum', end: /\{/,
- illegal: /\n/,
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {
- starts: {endsWithParent: true, excludeEnd: true} // hack: eating everything after the first title
- })
- ]
- },
- {
- className: 'class',
- beginKeywords: 'interface', end: /\{/,
- illegal: /\n/,
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {
- starts: {endsWithParent: true, excludeEnd: true} // hack: eating everything after the first title
- })
- ]
- }
- ]
- };
-};
-},{}],135:[function(require,module,exports){
-module.exports = function(hljs) {
- // 2.3. Identifiers and keywords
- var KEYWORDS =
- 'assembly module package import alias class interface object given value ' +
- 'assign void function new of extends satisfies abstracts in out return ' +
- 'break continue throw assert dynamic if else switch case for while try ' +
- 'catch finally then let this outer super is exists nonempty';
- // 7.4.1 Declaration Modifiers
- var DECLARATION_MODIFIERS =
- 'shared abstract formal default actual variable late native deprecated' +
- 'final sealed annotation suppressWarnings small';
- // 7.4.2 Documentation
- var DOCUMENTATION =
- 'doc by license see throws tagged';
- var SUBST = {
- className: 'subst', excludeBegin: true, excludeEnd: true,
- begin: /``/, end: /``/,
- keywords: KEYWORDS,
- relevance: 10
- };
- var EXPRESSIONS = [
- {
- // verbatim string
- className: 'string',
- begin: '"""',
- end: '"""',
- relevance: 10
- },
- {
- // string literal or template
- className: 'string',
- begin: '"', end: '"',
- contains: [SUBST]
- },
- {
- // character literal
- className: 'string',
- begin: "'",
- end: "'"
- },
- {
- // numeric literal
- className: 'number',
- begin: '#[0-9a-fA-F_]+|\\$[01_]+|[0-9_]+(?:\\.[0-9_](?:[eE][+-]?\\d+)?)?[kMGTPmunpf]?',
- relevance: 0
- }
- ];
- SUBST.contains = EXPRESSIONS;
-
- return {
- keywords: {
- keyword: KEYWORDS + ' ' + DECLARATION_MODIFIERS,
- meta: DOCUMENTATION
- },
- illegal: '\\$[^01]|#[^0-9a-fA-F]',
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.COMMENT('/\\*', '\\*/', {contains: ['self']}),
- {
- // compiler annotation
- className: 'meta',
- begin: '@[a-z]\\w*(?:\\:\"[^\"]*\")?'
- }
- ].concat(EXPRESSIONS)
- };
-};
-},{}],136:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['clean','icl','dcl'],
- keywords: {
- keyword:
- 'if let in with where case of class instance otherwise ' +
- 'implementation definition system module from import qualified as ' +
- 'special code inline foreign export ccall stdcall generic derive ' +
- 'infix infixl infixr',
- literal:
- 'True False'
- },
- contains: [
-
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE,
-
- {begin: '->|<-[|:]?|::|#!?|>>=|\\{\\||\\|\\}|:==|=:|\\.\\.|<>|`'} // relevance booster
- ]
- };
-};
-},{}],137:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- contains: [
- {
- className: 'meta',
- begin: /^([\w.-]+|\s*#_)=>/,
- starts: {
- end: /$/,
- subLanguage: 'clojure'
- }
- }
- ]
- }
-};
-},{}],138:[function(require,module,exports){
-module.exports = function(hljs) {
- var keywords = {
- 'builtin-name':
- // Clojure keywords
- 'def defonce cond apply if-not if-let if not not= = < > <= >= == + / * - rem '+
- 'quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? '+
- 'set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? '+
- 'class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? '+
- 'string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . '+
- 'inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last '+
- 'drop-while while intern condp case reduced cycle split-at split-with repeat replicate '+
- 'iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext '+
- 'nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends '+
- 'add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler '+
- 'set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter '+
- 'monitor-exit defmacro defn defn- macroexpand macroexpand-1 for dosync and or '+
- 'when when-not when-let comp juxt partial sequence memoize constantly complement identity assert '+
- 'peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast '+
- 'sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import '+
- 'refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! '+
- 'assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger '+
- 'bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline '+
- 'flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking '+
- 'assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! '+
- 'reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! '+
- 'new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty '+
- 'hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list '+
- 'disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer '+
- 'chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate '+
- 'unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta '+
- 'lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize'
- };
-
- var SYMBOLSTART = 'a-zA-Z_\\-!.?+*=<>&#\'';
- var SYMBOL_RE = '[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:]*';
- var SIMPLE_NUMBER_RE = '[-+]?\\d+(\\.\\d+)?';
-
- var SYMBOL = {
- begin: SYMBOL_RE,
- relevance: 0
- };
- var NUMBER = {
- className: 'number', begin: SIMPLE_NUMBER_RE,
- relevance: 0
- };
- var STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null});
- var COMMENT = hljs.COMMENT(
- ';',
- '$',
- {
- relevance: 0
- }
- );
- var LITERAL = {
- className: 'literal',
- begin: /\b(true|false|nil)\b/
- };
- var COLLECTION = {
- begin: '[\\[\\{]', end: '[\\]\\}]'
- };
- var HINT = {
- className: 'comment',
- begin: '\\^' + SYMBOL_RE
- };
- var HINT_COL = hljs.COMMENT('\\^\\{', '\\}');
- var KEY = {
- className: 'symbol',
- begin: '[:]{1,2}' + SYMBOL_RE
- };
- var LIST = {
- begin: '\\(', end: '\\)'
- };
- var BODY = {
- endsWithParent: true,
- relevance: 0
- };
- var NAME = {
- keywords: keywords,
- lexemes: SYMBOL_RE,
- className: 'name', begin: SYMBOL_RE,
- starts: BODY
- };
- var DEFAULT_CONTAINS = [LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER, LITERAL, SYMBOL];
-
- LIST.contains = [hljs.COMMENT('comment', ''), NAME, BODY];
- BODY.contains = DEFAULT_CONTAINS;
- COLLECTION.contains = DEFAULT_CONTAINS;
- HINT_COL.contains = [COLLECTION];
-
- return {
- aliases: ['clj'],
- illegal: /\S/,
- contains: [LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER, LITERAL]
- }
-};
-},{}],139:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['cmake.in'],
- case_insensitive: true,
- keywords: {
- keyword:
- 'add_custom_command add_custom_target add_definitions add_dependencies ' +
- 'add_executable add_library add_subdirectory add_test aux_source_directory ' +
- 'break build_command cmake_minimum_required cmake_policy configure_file ' +
- 'create_test_sourcelist define_property else elseif enable_language enable_testing ' +
- 'endforeach endfunction endif endmacro endwhile execute_process export find_file ' +
- 'find_library find_package find_path find_program fltk_wrap_ui foreach function ' +
- 'get_cmake_property get_directory_property get_filename_component get_property ' +
- 'get_source_file_property get_target_property get_test_property if include ' +
- 'include_directories include_external_msproject include_regular_expression install ' +
- 'link_directories load_cache load_command macro mark_as_advanced message option ' +
- 'output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return ' +
- 'separate_arguments set set_directory_properties set_property ' +
- 'set_source_files_properties set_target_properties set_tests_properties site_name ' +
- 'source_group string target_link_libraries try_compile try_run unset variable_watch ' +
- 'while build_name exec_program export_library_dependencies install_files ' +
- 'install_programs install_targets link_libraries make_directory remove subdir_depends ' +
- 'subdirs use_mangled_mesa utility_source variable_requires write_file ' +
- 'qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or ' +
- 'equal less greater strless strgreater strequal matches'
- },
- contains: [
- {
- className: 'variable',
- begin: '\\${', end: '}'
- },
- hljs.HASH_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.NUMBER_MODE
- ]
- };
-};
-},{}],140:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS = {
- keyword:
- // JS keywords
- 'in if for while finally new do return else break catch instanceof throw try this ' +
- 'switch continue typeof delete debugger super yield import export from as default await ' +
- // Coffee keywords
- 'then unless until loop of by when and or is isnt not',
- literal:
- // JS literals
- 'true false null undefined ' +
- // Coffee literals
- 'yes no on off',
- built_in:
- 'npm require console print module global window document'
- };
- var JS_IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
- var SUBST = {
- className: 'subst',
- begin: /#\{/, end: /}/,
- keywords: KEYWORDS
- };
- var EXPRESSIONS = [
- hljs.BINARY_NUMBER_MODE,
- hljs.inherit(hljs.C_NUMBER_MODE, {starts: {end: '(\\s*/)?', relevance: 0}}), // a number tries to eat the following slash to prevent treating it as a regexp
- {
- className: 'string',
- variants: [
- {
- begin: /'''/, end: /'''/,
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- begin: /'/, end: /'/,
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- begin: /"""/, end: /"""/,
- contains: [hljs.BACKSLASH_ESCAPE, SUBST]
- },
- {
- begin: /"/, end: /"/,
- contains: [hljs.BACKSLASH_ESCAPE, SUBST]
- }
- ]
- },
- {
- className: 'regexp',
- variants: [
- {
- begin: '///', end: '///',
- contains: [SUBST, hljs.HASH_COMMENT_MODE]
- },
- {
- begin: '//[gim]*',
- relevance: 0
- },
- {
- // regex can't start with space to parse x / 2 / 3 as two divisions
- // regex can't start with *, and it supports an "illegal" in the main mode
- begin: /\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/
- }
- ]
- },
- {
- begin: '@' + JS_IDENT_RE // relevance booster
- },
- {
- subLanguage: 'javascript',
- excludeBegin: true, excludeEnd: true,
- variants: [
- {
- begin: '```', end: '```',
- },
- {
- begin: '`', end: '`',
- }
- ]
- }
- ];
- SUBST.contains = EXPRESSIONS;
-
- var TITLE = hljs.inherit(hljs.TITLE_MODE, {begin: JS_IDENT_RE});
- var PARAMS_RE = '(\\(.*\\))?\\s*\\B[-=]>';
- var PARAMS = {
- className: 'params',
- begin: '\\([^\\(]', returnBegin: true,
- /* We need another contained nameless mode to not have every nested
- pair of parens to be called "params" */
- contains: [{
- begin: /\(/, end: /\)/,
- keywords: KEYWORDS,
- contains: ['self'].concat(EXPRESSIONS)
- }]
- };
-
- return {
- aliases: ['coffee', 'cson', 'iced'],
- keywords: KEYWORDS,
- illegal: /\/\*/,
- contains: EXPRESSIONS.concat([
- hljs.COMMENT('###', '###'),
- hljs.HASH_COMMENT_MODE,
- {
- className: 'function',
- begin: '^\\s*' + JS_IDENT_RE + '\\s*=\\s*' + PARAMS_RE, end: '[-=]>',
- returnBegin: true,
- contains: [TITLE, PARAMS]
- },
- {
- // anonymous function start
- begin: /[:\(,=]\s*/,
- relevance: 0,
- contains: [
- {
- className: 'function',
- begin: PARAMS_RE, end: '[-=]>',
- returnBegin: true,
- contains: [PARAMS]
- }
- ]
- },
- {
- className: 'class',
- beginKeywords: 'class',
- end: '$',
- illegal: /[:="\[\]]/,
- contains: [
- {
- beginKeywords: 'extends',
- endsWithParent: true,
- illegal: /[:="\[\]]/,
- contains: [TITLE]
- },
- TITLE
- ]
- },
- {
- begin: JS_IDENT_RE + ':', end: ':',
- returnBegin: true, returnEnd: true,
- relevance: 0
- }
- ])
- };
-};
-},{}],141:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- keywords: {
- keyword:
- '_ as at cofix else end exists exists2 fix for forall fun if IF in let ' +
- 'match mod Prop return Set then Type using where with ' +
- 'Abort About Add Admit Admitted All Arguments Assumptions Axiom Back BackTo ' +
- 'Backtrack Bind Blacklist Canonical Cd Check Class Classes Close Coercion ' +
- 'Coercions CoFixpoint CoInductive Collection Combined Compute Conjecture ' +
- 'Conjectures Constant constr Constraint Constructors Context Corollary ' +
- 'CreateHintDb Cut Declare Defined Definition Delimit Dependencies Dependent' +
- 'Derive Drop eauto End Equality Eval Example Existential Existentials ' +
- 'Existing Export exporting Extern Extract Extraction Fact Field Fields File ' +
- 'Fixpoint Focus for From Function Functional Generalizable Global Goal Grab ' +
- 'Grammar Graph Guarded Heap Hint HintDb Hints Hypotheses Hypothesis ident ' +
- 'Identity If Immediate Implicit Import Include Inductive Infix Info Initial ' +
- 'Inline Inspect Instance Instances Intro Intros Inversion Inversion_clear ' +
- 'Language Left Lemma Let Libraries Library Load LoadPath Local Locate Ltac ML ' +
- 'Mode Module Modules Monomorphic Morphism Next NoInline Notation Obligation ' +
- 'Obligations Opaque Open Optimize Options Parameter Parameters Parametric ' +
- 'Path Paths pattern Polymorphic Preterm Print Printing Program Projections ' +
- 'Proof Proposition Pwd Qed Quit Rec Record Recursive Redirect Relation Remark ' +
- 'Remove Require Reserved Reset Resolve Restart Rewrite Right Ring Rings Save ' +
- 'Scheme Scope Scopes Script Search SearchAbout SearchHead SearchPattern ' +
- 'SearchRewrite Section Separate Set Setoid Show Solve Sorted Step Strategies ' +
- 'Strategy Structure SubClass Table Tables Tactic Term Test Theorem Time ' +
- 'Timeout Transparent Type Typeclasses Types Undelimit Undo Unfocus Unfocused ' +
- 'Unfold Universe Universes Unset Unshelve using Variable Variables Variant ' +
- 'Verbose Visibility where with',
- built_in:
- 'abstract absurd admit after apply as assert assumption at auto autorewrite ' +
- 'autounfold before bottom btauto by case case_eq cbn cbv change ' +
- 'classical_left classical_right clear clearbody cofix compare compute ' +
- 'congruence constr_eq constructor contradict contradiction cut cutrewrite ' +
- 'cycle decide decompose dependent destruct destruction dintuition ' +
- 'discriminate discrR do double dtauto eapply eassumption eauto ecase ' +
- 'econstructor edestruct ediscriminate eelim eexact eexists einduction ' +
- 'einjection eleft elim elimtype enough equality erewrite eright ' +
- 'esimplify_eq esplit evar exact exactly_once exfalso exists f_equal fail ' +
- 'field field_simplify field_simplify_eq first firstorder fix fold fourier ' +
- 'functional generalize generalizing gfail give_up has_evar hnf idtac in ' +
- 'induction injection instantiate intro intro_pattern intros intuition ' +
- 'inversion inversion_clear is_evar is_var lapply lazy left lia lra move ' +
- 'native_compute nia nsatz omega once pattern pose progress proof psatz quote ' +
- 'record red refine reflexivity remember rename repeat replace revert ' +
- 'revgoals rewrite rewrite_strat right ring ring_simplify rtauto set ' +
- 'setoid_reflexivity setoid_replace setoid_rewrite setoid_symmetry ' +
- 'setoid_transitivity shelve shelve_unifiable simpl simple simplify_eq solve ' +
- 'specialize split split_Rabs split_Rmult stepl stepr subst sum swap ' +
- 'symmetry tactic tauto time timeout top transitivity trivial try tryif ' +
- 'unfold unify until using vm_compute with'
- },
- contains: [
- hljs.QUOTE_STRING_MODE,
- hljs.COMMENT('\\(\\*', '\\*\\)'),
- hljs.C_NUMBER_MODE,
- {
- className: 'type',
- excludeBegin: true,
- begin: '\\|\\s*',
- end: '\\w+'
- },
- {begin: /[-=]>/} // relevance booster
- ]
- };
-};
-},{}],142:[function(require,module,exports){
-module.exports = function cos (hljs) {
-
- var STRINGS = {
- className: 'string',
- variants: [
- {
- begin: '"',
- end: '"',
- contains: [{ // escaped
- begin: "\"\"",
- relevance: 0
- }]
- }
- ]
- };
-
- var NUMBERS = {
- className: "number",
- begin: "\\b(\\d+(\\.\\d*)?|\\.\\d+)",
- relevance: 0
- };
-
- var COS_KEYWORDS =
- 'property parameter class classmethod clientmethod extends as break ' +
- 'catch close continue do d|0 else elseif for goto halt hang h|0 if job ' +
- 'j|0 kill k|0 lock l|0 merge new open quit q|0 read r|0 return set s|0 ' +
- 'tcommit throw trollback try tstart use view while write w|0 xecute x|0 ' +
- 'zkill znspace zn ztrap zwrite zw zzdump zzwrite print zbreak zinsert ' +
- 'zload zprint zremove zsave zzprint mv mvcall mvcrt mvdim mvprint zquit ' +
- 'zsync ascii';
-
- // registered function - no need in them due to all functions are highlighted,
- // but I'll just leave this here.
-
- //"$bit", "$bitcount",
- //"$bitfind", "$bitlogic", "$case", "$char", "$classmethod", "$classname",
- //"$compile", "$data", "$decimal", "$double", "$extract", "$factor",
- //"$find", "$fnumber", "$get", "$increment", "$inumber", "$isobject",
- //"$isvaliddouble", "$isvalidnum", "$justify", "$length", "$list",
- //"$listbuild", "$listdata", "$listfind", "$listfromstring", "$listget",
- //"$listlength", "$listnext", "$listsame", "$listtostring", "$listvalid",
- //"$locate", "$match", "$method", "$name", "$nconvert", "$next",
- //"$normalize", "$now", "$number", "$order", "$parameter", "$piece",
- //"$prefetchoff", "$prefetchon", "$property", "$qlength", "$qsubscript",
- //"$query", "$random", "$replace", "$reverse", "$sconvert", "$select",
- //"$sortbegin", "$sortend", "$stack", "$text", "$translate", "$view",
- //"$wascii", "$wchar", "$wextract", "$wfind", "$wiswide", "$wlength",
- //"$wreverse", "$xecute", "$zabs", "$zarccos", "$zarcsin", "$zarctan",
- //"$zcos", "$zcot", "$zcsc", "$zdate", "$zdateh", "$zdatetime",
- //"$zdatetimeh", "$zexp", "$zhex", "$zln", "$zlog", "$zpower", "$zsec",
- //"$zsin", "$zsqr", "$ztan", "$ztime", "$ztimeh", "$zboolean",
- //"$zconvert", "$zcrc", "$zcyc", "$zdascii", "$zdchar", "$zf",
- //"$ziswide", "$zlascii", "$zlchar", "$zname", "$zposition", "$zqascii",
- //"$zqchar", "$zsearch", "$zseek", "$zstrip", "$zwascii", "$zwchar",
- //"$zwidth", "$zwpack", "$zwbpack", "$zwunpack", "$zwbunpack", "$zzenkaku",
- //"$change", "$mv", "$mvat", "$mvfmt", "$mvfmts", "$mviconv",
- //"$mviconvs", "$mvinmat", "$mvlover", "$mvoconv", "$mvoconvs", "$mvraise",
- //"$mvtrans", "$mvv", "$mvname", "$zbitand", "$zbitcount", "$zbitfind",
- //"$zbitget", "$zbitlen", "$zbitnot", "$zbitor", "$zbitset", "$zbitstr",
- //"$zbitxor", "$zincrement", "$znext", "$zorder", "$zprevious", "$zsort",
- //"device", "$ecode", "$estack", "$etrap", "$halt", "$horolog",
- //"$io", "$job", "$key", "$namespace", "$principal", "$quit", "$roles",
- //"$storage", "$system", "$test", "$this", "$tlevel", "$username",
- //"$x", "$y", "$za", "$zb", "$zchild", "$zeof", "$zeos", "$zerror",
- //"$zhorolog", "$zio", "$zjob", "$zmode", "$znspace", "$zparent", "$zpi",
- //"$zpos", "$zreference", "$zstorage", "$ztimestamp", "$ztimezone",
- //"$ztrap", "$zversion"
-
- return {
- case_insensitive: true,
- aliases: ["cos", "cls"],
- keywords: COS_KEYWORDS,
- contains: [
- NUMBERS,
- STRINGS,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- {
- className: "comment",
- begin: /;/, end: "$",
- relevance: 0
- },
- { // Functions and user-defined functions: write $ztime(60*60*3), $$myFunc(10), $$^Val(1)
- className: "built_in",
- begin: /(?:\$\$?|\.\.)\^?[a-zA-Z]+/
- },
- { // Macro command: quit $$$OK
- className: "built_in",
- begin: /\$\$\$[a-zA-Z]+/
- },
- { // Special (global) variables: write %request.Content; Built-in classes: %Library.Integer
- className: "built_in",
- begin: /%[a-z]+(?:\.[a-z]+)*/
- },
- { // Global variable: set ^globalName = 12 write ^globalName
- className: "symbol",
- begin: /\^%?[a-zA-Z][\w]*/
- },
- { // Some control constructions: do ##class(Package.ClassName).Method(), ##super()
- className: "keyword",
- begin: /##class|##super|#define|#dim/
- },
-
- // sub-languages: are not fully supported by hljs by 11/15/2015
- // left for the future implementation.
- {
- begin: /&sql\(/, end: /\)/,
- excludeBegin: true, excludeEnd: true,
- subLanguage: "sql"
- },
- {
- begin: /&(js|jscript|javascript)</, end: />/,
- excludeBegin: true, excludeEnd: true,
- subLanguage: "javascript"
- },
- {
- // this brakes first and last tag, but this is the only way to embed a valid html
- begin: /&html<\s*</, end: />\s*>/,
- subLanguage: "xml"
- }
- ]
- };
-};
-},{}],143:[function(require,module,exports){
-module.exports = function(hljs) {
- var CPP_PRIMITIVE_TYPES = {
- className: 'keyword',
- begin: '\\b[a-z\\d_]*_t\\b'
- };
-
- var STRINGS = {
- className: 'string',
- variants: [
- {
- begin: '(u8?|U)?L?"', end: '"',
- illegal: '\\n',
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- begin: '(u8?|U)?R"', end: '"',
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- begin: '\'\\\\?.', end: '\'',
- illegal: '.'
- }
- ]
- };
-
- var NUMBERS = {
- className: 'number',
- variants: [
- { begin: '\\b(0b[01\']+)' },
- { begin: '(-?)\\b([\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)(u|U|l|L|ul|UL|f|F|b|B)' },
- { begin: '(-?)(\\b0[xX][a-fA-F0-9\']+|(\\b[\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)([eE][-+]?[\\d\']+)?)' }
- ],
- relevance: 0
- };
-
- var PREPROCESSOR = {
- className: 'meta',
- begin: /#\s*[a-z]+\b/, end: /$/,
- keywords: {
- 'meta-keyword':
- 'if else elif endif define undef warning error line ' +
- 'pragma ifdef ifndef include'
- },
- contains: [
- {
- begin: /\\\n/, relevance: 0
- },
- hljs.inherit(STRINGS, {className: 'meta-string'}),
- {
- className: 'meta-string',
- begin: /<[^\n>]*>/, end: /$/,
- illegal: '\\n',
- },
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- };
-
- var FUNCTION_TITLE = hljs.IDENT_RE + '\\s*\\(';
-
- var CPP_KEYWORDS = {
- keyword: 'int float while private char catch import module export virtual operator sizeof ' +
- 'dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace ' +
- 'unsigned long volatile static protected bool template mutable if public friend ' +
- 'do goto auto void enum else break extern using asm case typeid ' +
- 'short reinterpret_cast|10 default double register explicit signed typename try this ' +
- 'switch continue inline delete alignof constexpr decltype ' +
- 'noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary ' +
- 'atomic_bool atomic_char atomic_schar ' +
- 'atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong ' +
- 'atomic_ullong new throw return ' +
- 'and or not',
- built_in: 'std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream ' +
- 'auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set ' +
- 'unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos ' +
- 'asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp ' +
- 'fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper ' +
- 'isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow ' +
- 'printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp ' +
- 'strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan ' +
- 'vfprintf vprintf vsprintf endl initializer_list unique_ptr',
- literal: 'true false nullptr NULL'
- };
-
- var EXPRESSION_CONTAINS = [
- CPP_PRIMITIVE_TYPES,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- NUMBERS,
- STRINGS
- ];
-
- return {
- aliases: ['c', 'cc', 'h', 'c++', 'h++', 'hpp'],
- keywords: CPP_KEYWORDS,
- illegal: '</',
- contains: EXPRESSION_CONTAINS.concat([
- PREPROCESSOR,
- {
- begin: '\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<', end: '>',
- keywords: CPP_KEYWORDS,
- contains: ['self', CPP_PRIMITIVE_TYPES]
- },
- {
- begin: hljs.IDENT_RE + '::',
- keywords: CPP_KEYWORDS
- },
- {
- // This mode covers expression context where we can't expect a function
- // definition and shouldn't highlight anything that looks like one:
- // `return some()`, `else if()`, `(x*sum(1, 2))`
- variants: [
- {begin: /=/, end: /;/},
- {begin: /\(/, end: /\)/},
- {beginKeywords: 'new throw return else', end: /;/}
- ],
- keywords: CPP_KEYWORDS,
- contains: EXPRESSION_CONTAINS.concat([
- {
- begin: /\(/, end: /\)/,
- keywords: CPP_KEYWORDS,
- contains: EXPRESSION_CONTAINS.concat(['self']),
- relevance: 0
- }
- ]),
- relevance: 0
- },
- {
- className: 'function',
- begin: '(' + hljs.IDENT_RE + '[\\*&\\s]+)+' + FUNCTION_TITLE,
- returnBegin: true, end: /[{;=]/,
- excludeEnd: true,
- keywords: CPP_KEYWORDS,
- illegal: /[^\w\s\*&]/,
- contains: [
- {
- begin: FUNCTION_TITLE, returnBegin: true,
- contains: [hljs.TITLE_MODE],
- relevance: 0
- },
- {
- className: 'params',
- begin: /\(/, end: /\)/,
- keywords: CPP_KEYWORDS,
- relevance: 0,
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- STRINGS,
- NUMBERS,
- CPP_PRIMITIVE_TYPES
- ]
- },
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- PREPROCESSOR
- ]
- },
- {
- className: 'class',
- beginKeywords: 'class struct', end: /[{;:]/,
- contains: [
- {begin: /</, end: />/, contains: ['self']}, // skip generic stuff
- hljs.TITLE_MODE
- ]
- }
- ]),
- exports: {
- preprocessor: PREPROCESSOR,
- strings: STRINGS,
- keywords: CPP_KEYWORDS
- }
- };
-};
-},{}],144:[function(require,module,exports){
-module.exports = function(hljs) {
- var RESOURCES = 'primitive rsc_template';
-
- var COMMANDS = 'group clone ms master location colocation order fencing_topology ' +
- 'rsc_ticket acl_target acl_group user role ' +
- 'tag xml';
-
- var PROPERTY_SETS = 'property rsc_defaults op_defaults';
-
- var KEYWORDS = 'params meta operations op rule attributes utilization';
-
- var OPERATORS = 'read write deny defined not_defined in_range date spec in ' +
- 'ref reference attribute type xpath version and or lt gt tag ' +
- 'lte gte eq ne \\';
-
- var TYPES = 'number string';
-
- var LITERALS = 'Master Started Slave Stopped start promote demote stop monitor true false';
-
- return {
- aliases: ['crm', 'pcmk'],
- case_insensitive: true,
- keywords: {
- keyword: KEYWORDS + ' ' + OPERATORS + ' ' + TYPES,
- literal: LITERALS
- },
- contains: [
- hljs.HASH_COMMENT_MODE,
- {
- beginKeywords: 'node',
- starts: {
- end: '\\s*([\\w_-]+:)?',
- starts: {
- className: 'title',
- end: '\\s*[\\$\\w_][\\w_-]*'
- }
- }
- },
- {
- beginKeywords: RESOURCES,
- starts: {
- className: 'title',
- end: '\\s*[\\$\\w_][\\w_-]*',
- starts: {
- end: '\\s*@?[\\w_][\\w_\\.:-]*'
- }
- }
- },
- {
- begin: '\\b(' + COMMANDS.split(' ').join('|') + ')\\s+',
- keywords: COMMANDS,
- starts: {
- className: 'title',
- end: '[\\$\\w_][\\w_-]*'
- }
- },
- {
- beginKeywords: PROPERTY_SETS,
- starts: {
- className: 'title',
- end: '\\s*([\\w_-]+:)?'
- }
- },
- hljs.QUOTE_STRING_MODE,
- {
- className: 'meta',
- begin: '(ocf|systemd|service|lsb):[\\w_:-]+',
- relevance: 0
- },
- {
- className: 'number',
- begin: '\\b\\d+(\\.\\d+)?(ms|s|h|m)?',
- relevance: 0
- },
- {
- className: 'literal',
- begin: '[-]?(infinity|inf)',
- relevance: 0
- },
- {
- className: 'attr',
- begin: /([A-Za-z\$_\#][\w_-]+)=/,
- relevance: 0
- },
- {
- className: 'tag',
- begin: '</?',
- end: '/?>',
- relevance: 0
- }
- ]
- };
-};
-},{}],145:[function(require,module,exports){
-module.exports = function(hljs) {
- var NUM_SUFFIX = '(_[uif](8|16|32|64))?';
- var CRYSTAL_IDENT_RE = '[a-zA-Z_]\\w*[!?=]?';
- var RE_STARTER = '!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|' +
- '>>|>|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~';
- var CRYSTAL_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\][=?]?';
- var CRYSTAL_KEYWORDS = {
- keyword:
- 'abstract alias as as? asm begin break case class def do else elsif end ensure enum extend for fun if ' +
- 'include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? ' +
- 'return require select self sizeof struct super then type typeof union uninitialized unless until when while with yield ' +
- '__DIR__ __END_LINE__ __FILE__ __LINE__',
- literal: 'false nil true'
- };
- var SUBST = {
- className: 'subst',
- begin: '#{', end: '}',
- keywords: CRYSTAL_KEYWORDS
- };
- var EXPANSION = {
- className: 'template-variable',
- variants: [
- {begin: '\\{\\{', end: '\\}\\}'},
- {begin: '\\{%', end: '%\\}'}
- ],
- keywords: CRYSTAL_KEYWORDS
- };
-
- function recursiveParen(begin, end) {
- var
- contains = [{begin: begin, end: end}];
- contains[0].contains = contains;
- return contains;
- }
- var STRING = {
- className: 'string',
- contains: [hljs.BACKSLASH_ESCAPE, SUBST],
- variants: [
- {begin: /'/, end: /'/},
- {begin: /"/, end: /"/},
- {begin: /`/, end: /`/},
- {begin: '%w?\\(', end: '\\)', contains: recursiveParen('\\(', '\\)')},
- {begin: '%w?\\[', end: '\\]', contains: recursiveParen('\\[', '\\]')},
- {begin: '%w?{', end: '}', contains: recursiveParen('{', '}')},
- {begin: '%w?<', end: '>', contains: recursiveParen('<', '>')},
- {begin: '%w?/', end: '/'},
- {begin: '%w?%', end: '%'},
- {begin: '%w?-', end: '-'},
- {begin: '%w?\\|', end: '\\|'},
- {begin: /<<-\w+$/, end: /^\s*\w+$/},
- ],
- relevance: 0,
- };
- var Q_STRING = {
- className: 'string',
- variants: [
- {begin: '%q\\(', end: '\\)', contains: recursiveParen('\\(', '\\)')},
- {begin: '%q\\[', end: '\\]', contains: recursiveParen('\\[', '\\]')},
- {begin: '%q{', end: '}', contains: recursiveParen('{', '}')},
- {begin: '%q<', end: '>', contains: recursiveParen('<', '>')},
- {begin: '%q/', end: '/'},
- {begin: '%q%', end: '%'},
- {begin: '%q-', end: '-'},
- {begin: '%q\\|', end: '\\|'},
- {begin: /<<-'\w+'$/, end: /^\s*\w+$/},
- ],
- relevance: 0,
- };
- var REGEXP = {
- begin: '(' + RE_STARTER + ')\\s*',
- contains: [
- {
- className: 'regexp',
- contains: [hljs.BACKSLASH_ESCAPE, SUBST],
- variants: [
- {begin: '//[a-z]*', relevance: 0},
- {begin: '/', end: '/[a-z]*'},
- {begin: '%r\\(', end: '\\)', contains: recursiveParen('\\(', '\\)')},
- {begin: '%r\\[', end: '\\]', contains: recursiveParen('\\[', '\\]')},
- {begin: '%r{', end: '}', contains: recursiveParen('{', '}')},
- {begin: '%r<', end: '>', contains: recursiveParen('<', '>')},
- {begin: '%r/', end: '/'},
- {begin: '%r%', end: '%'},
- {begin: '%r-', end: '-'},
- {begin: '%r\\|', end: '\\|'},
- ]
- }
- ],
- relevance: 0
- };
- var REGEXP2 = {
- className: 'regexp',
- contains: [hljs.BACKSLASH_ESCAPE, SUBST],
- variants: [
- {begin: '%r\\(', end: '\\)', contains: recursiveParen('\\(', '\\)')},
- {begin: '%r\\[', end: '\\]', contains: recursiveParen('\\[', '\\]')},
- {begin: '%r{', end: '}', contains: recursiveParen('{', '}')},
- {begin: '%r<', end: '>', contains: recursiveParen('<', '>')},
- {begin: '%r/', end: '/'},
- {begin: '%r%', end: '%'},
- {begin: '%r-', end: '-'},
- {begin: '%r\\|', end: '\\|'},
- ],
- relevance: 0
- };
- var ATTRIBUTE = {
- className: 'meta',
- begin: '@\\[', end: '\\]',
- contains: [
- hljs.inherit(hljs.QUOTE_STRING_MODE, {className: 'meta-string'})
- ]
- };
- var CRYSTAL_DEFAULT_CONTAINS = [
- EXPANSION,
- STRING,
- Q_STRING,
- REGEXP,
- REGEXP2,
- ATTRIBUTE,
- hljs.HASH_COMMENT_MODE,
- {
- className: 'class',
- beginKeywords: 'class module struct', end: '$|;',
- illegal: /=/,
- contains: [
- hljs.HASH_COMMENT_MODE,
- hljs.inherit(hljs.TITLE_MODE, {begin: '[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?'}),
- {begin: '<'} // relevance booster for inheritance
- ]
- },
- {
- className: 'class',
- beginKeywords: 'lib enum union', end: '$|;',
- illegal: /=/,
- contains: [
- hljs.HASH_COMMENT_MODE,
- hljs.inherit(hljs.TITLE_MODE, {begin: '[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?'}),
- ],
- relevance: 10
- },
- {
- className: 'function',
- beginKeywords: 'def', end: /\B\b/,
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {
- begin: CRYSTAL_METHOD_RE,
- endsParent: true
- })
- ]
- },
- {
- className: 'function',
- beginKeywords: 'fun macro', end: /\B\b/,
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {
- begin: CRYSTAL_METHOD_RE,
- endsParent: true
- })
- ],
- relevance: 5
- },
- {
- className: 'symbol',
- begin: hljs.UNDERSCORE_IDENT_RE + '(\\!|\\?)?:',
- relevance: 0
- },
- {
- className: 'symbol',
- begin: ':',
- contains: [STRING, {begin: CRYSTAL_METHOD_RE}],
- relevance: 0
- },
- {
- className: 'number',
- variants: [
- { begin: '\\b0b([01_]*[01])' + NUM_SUFFIX },
- { begin: '\\b0o([0-7_]*[0-7])' + NUM_SUFFIX },
- { begin: '\\b0x([A-Fa-f0-9_]*[A-Fa-f0-9])' + NUM_SUFFIX },
- { begin: '\\b(([0-9][0-9_]*[0-9]|[0-9])(\\.[0-9_]*[0-9])?([eE][+-]?[0-9_]*[0-9])?)' + NUM_SUFFIX}
- ],
- relevance: 0
- }
- ];
- SUBST.contains = CRYSTAL_DEFAULT_CONTAINS;
- EXPANSION.contains = CRYSTAL_DEFAULT_CONTAINS.slice(1); // without EXPANSION
-
- return {
- aliases: ['cr'],
- lexemes: CRYSTAL_IDENT_RE,
- keywords: CRYSTAL_KEYWORDS,
- contains: CRYSTAL_DEFAULT_CONTAINS
- };
-};
-},{}],146:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS = {
- keyword:
- // Normal keywords.
- 'abstract as base bool break byte case catch char checked const continue decimal ' +
- 'default delegate do double enum event explicit extern finally fixed float ' +
- 'for foreach goto if implicit in int interface internal is lock long nameof ' +
- 'object operator out override params private protected public readonly ref sbyte ' +
- 'sealed short sizeof stackalloc static string struct switch this try typeof ' +
- 'uint ulong unchecked unsafe ushort using virtual void volatile while ' +
- // Contextual keywords.
- 'add alias ascending async await by descending dynamic equals from get global group into join ' +
- 'let on orderby partial remove select set value var where yield',
- literal:
- 'null false true'
- };
-
- var VERBATIM_STRING = {
- className: 'string',
- begin: '@"', end: '"',
- contains: [{begin: '""'}]
- };
- var VERBATIM_STRING_NO_LF = hljs.inherit(VERBATIM_STRING, {illegal: /\n/});
- var SUBST = {
- className: 'subst',
- begin: '{', end: '}',
- keywords: KEYWORDS
- };
- var SUBST_NO_LF = hljs.inherit(SUBST, {illegal: /\n/});
- var INTERPOLATED_STRING = {
- className: 'string',
- begin: /\$"/, end: '"',
- illegal: /\n/,
- contains: [{begin: '{{'}, {begin: '}}'}, hljs.BACKSLASH_ESCAPE, SUBST_NO_LF]
- };
- var INTERPOLATED_VERBATIM_STRING = {
- className: 'string',
- begin: /\$@"/, end: '"',
- contains: [{begin: '{{'}, {begin: '}}'}, {begin: '""'}, SUBST]
- };
- var INTERPOLATED_VERBATIM_STRING_NO_LF = hljs.inherit(INTERPOLATED_VERBATIM_STRING, {
- illegal: /\n/,
- contains: [{begin: '{{'}, {begin: '}}'}, {begin: '""'}, SUBST_NO_LF]
- });
- SUBST.contains = [
- INTERPOLATED_VERBATIM_STRING,
- INTERPOLATED_STRING,
- VERBATIM_STRING,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ];
- SUBST_NO_LF.contains = [
- INTERPOLATED_VERBATIM_STRING_NO_LF,
- INTERPOLATED_STRING,
- VERBATIM_STRING_NO_LF,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE,
- hljs.inherit(hljs.C_BLOCK_COMMENT_MODE, {illegal: /\n/})
- ];
- var STRING = {
- variants: [
- INTERPOLATED_VERBATIM_STRING,
- INTERPOLATED_STRING,
- VERBATIM_STRING,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE
- ]
- };
-
- var TYPE_IDENT_RE = hljs.IDENT_RE + '(<' + hljs.IDENT_RE + '(\\s*,\\s*' + hljs.IDENT_RE + ')*>)?(\\[\\])?';
-
- return {
- aliases: ['csharp'],
- keywords: KEYWORDS,
- illegal: /::/,
- contains: [
- hljs.COMMENT(
- '///',
- '$',
- {
- returnBegin: true,
- contains: [
- {
- className: 'doctag',
- variants: [
- {
- begin: '///', relevance: 0
- },
- {
- begin: '<!--|-->'
- },
- {
- begin: '</?', end: '>'
- }
- ]
- }
- ]
- }
- ),
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- {
- className: 'meta',
- begin: '#', end: '$',
- keywords: {
- 'meta-keyword': 'if else elif endif define undef warning error line region endregion pragma checksum'
- }
- },
- STRING,
- hljs.C_NUMBER_MODE,
- {
- beginKeywords: 'class interface', end: /[{;=]/,
- illegal: /[^\s:]/,
- contains: [
- hljs.TITLE_MODE,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- },
- {
- beginKeywords: 'namespace', end: /[{;=]/,
- illegal: /[^\s:]/,
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {begin: '[a-zA-Z](\\.?\\w)*'}),
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- },
- {
- // [Attributes("")]
- className: 'meta',
- begin: '^\\s*\\[', excludeBegin: true, end: '\\]', excludeEnd: true,
- contains: [
- {className: 'meta-string', begin: /"/, end: /"/}
- ]
- },
- {
- // Expression keywords prevent 'keyword Name(...)' from being
- // recognized as a function definition
- beginKeywords: 'new return throw await else',
- relevance: 0
- },
- {
- className: 'function',
- begin: '(' + TYPE_IDENT_RE + '\\s+)+' + hljs.IDENT_RE + '\\s*\\(', returnBegin: true,
- end: /[{;=]/, excludeEnd: true,
- keywords: KEYWORDS,
- contains: [
- {
- begin: hljs.IDENT_RE + '\\s*\\(', returnBegin: true,
- contains: [hljs.TITLE_MODE],
- relevance: 0
- },
- {
- className: 'params',
- begin: /\(/, end: /\)/,
- excludeBegin: true,
- excludeEnd: true,
- keywords: KEYWORDS,
- relevance: 0,
- contains: [
- STRING,
- hljs.C_NUMBER_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- },
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- }
- ]
- };
-};
-},{}],147:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- case_insensitive: false,
- lexemes: '[a-zA-Z][a-zA-Z0-9_-]*',
- keywords: {
- keyword: 'base-uri child-src connect-src default-src font-src form-action' +
- ' frame-ancestors frame-src img-src media-src object-src plugin-types' +
- ' report-uri sandbox script-src style-src',
- },
- contains: [
- {
- className: 'string',
- begin: "'", end: "'"
- },
- {
- className: 'attribute',
- begin: '^Content', end: ':', excludeEnd: true,
- },
- ]
- };
-};
-},{}],148:[function(require,module,exports){
-module.exports = function(hljs) {
- var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';
- var RULE = {
- begin: /[A-Z\_\.\-]+\s*:/, returnBegin: true, end: ';', endsWithParent: true,
- contains: [
- {
- className: 'attribute',
- begin: /\S/, end: ':', excludeEnd: true,
- starts: {
- endsWithParent: true, excludeEnd: true,
- contains: [
- {
- begin: /[\w-]+\(/, returnBegin: true,
- contains: [
- {
- className: 'built_in',
- begin: /[\w-]+/
- },
- {
- begin: /\(/, end: /\)/,
- contains: [
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE
- ]
- }
- ]
- },
- hljs.CSS_NUMBER_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.APOS_STRING_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- {
- className: 'number', begin: '#[0-9A-Fa-f]+'
- },
- {
- className: 'meta', begin: '!important'
- }
- ]
- }
- }
- ]
- };
-
- return {
- case_insensitive: true,
- illegal: /[=\/|'\$]/,
- contains: [
- hljs.C_BLOCK_COMMENT_MODE,
- {
- className: 'selector-id', begin: /#[A-Za-z0-9_-]+/
- },
- {
- className: 'selector-class', begin: /\.[A-Za-z0-9_-]+/
- },
- {
- className: 'selector-attr',
- begin: /\[/, end: /\]/,
- illegal: '$'
- },
- {
- className: 'selector-pseudo',
- begin: /:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/
- },
- {
- begin: '@(font-face|page)',
- lexemes: '[a-z-]+',
- keywords: 'font-face page'
- },
- {
- begin: '@', end: '[{;]', // at_rule eating first "{" is a good thing
- // because it doesn’t let it to be parsed as
- // a rule set but instead drops parser into
- // the default mode which is how it should be.
- illegal: /:/, // break on Less variables @var: ...
- contains: [
- {
- className: 'keyword',
- begin: /\w+/
- },
- {
- begin: /\s/, endsWithParent: true, excludeEnd: true,
- relevance: 0,
- contains: [
- hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE,
- hljs.CSS_NUMBER_MODE
- ]
- }
- ]
- },
- {
- className: 'selector-tag', begin: IDENT_RE,
- relevance: 0
- },
- {
- begin: '{', end: '}',
- illegal: /\S/,
- contains: [
- hljs.C_BLOCK_COMMENT_MODE,
- RULE,
- ]
- }
- ]
- };
-};
-},{}],149:[function(require,module,exports){
-module.exports = /**
- * Known issues:
- *
- * - invalid hex string literals will be recognized as a double quoted strings
- * but 'x' at the beginning of string will not be matched
- *
- * - delimited string literals are not checked for matching end delimiter
- * (not possible to do with js regexp)
- *
- * - content of token string is colored as a string (i.e. no keyword coloring inside a token string)
- * also, content of token string is not validated to contain only valid D tokens
- *
- * - special token sequence rule is not strictly following D grammar (anything following #line
- * up to the end of line is matched as special token sequence)
- */
-
-function(hljs) {
- /**
- * Language keywords
- *
- * @type {Object}
- */
- var D_KEYWORDS = {
- keyword:
- 'abstract alias align asm assert auto body break byte case cast catch class ' +
- 'const continue debug default delete deprecated do else enum export extern final ' +
- 'finally for foreach foreach_reverse|10 goto if immutable import in inout int ' +
- 'interface invariant is lazy macro mixin module new nothrow out override package ' +
- 'pragma private protected public pure ref return scope shared static struct ' +
- 'super switch synchronized template this throw try typedef typeid typeof union ' +
- 'unittest version void volatile while with __FILE__ __LINE__ __gshared|10 ' +
- '__thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__',
- built_in:
- 'bool cdouble cent cfloat char creal dchar delegate double dstring float function ' +
- 'idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar ' +
- 'wstring',
- literal:
- 'false null true'
- };
-
- /**
- * Number literal regexps
- *
- * @type {String}
- */
- var decimal_integer_re = '(0|[1-9][\\d_]*)',
- decimal_integer_nosus_re = '(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)',
- binary_integer_re = '0[bB][01_]+',
- hexadecimal_digits_re = '([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)',
- hexadecimal_integer_re = '0[xX]' + hexadecimal_digits_re,
-
- decimal_exponent_re = '([eE][+-]?' + decimal_integer_nosus_re + ')',
- decimal_float_re = '(' + decimal_integer_nosus_re + '(\\.\\d*|' + decimal_exponent_re + ')|' +
- '\\d+\\.' + decimal_integer_nosus_re + decimal_integer_nosus_re + '|' +
- '\\.' + decimal_integer_re + decimal_exponent_re + '?' +
- ')',
- hexadecimal_float_re = '(0[xX](' +
- hexadecimal_digits_re + '\\.' + hexadecimal_digits_re + '|'+
- '\\.?' + hexadecimal_digits_re +
- ')[pP][+-]?' + decimal_integer_nosus_re + ')',
-
- integer_re = '(' +
- decimal_integer_re + '|' +
- binary_integer_re + '|' +
- hexadecimal_integer_re +
- ')',
-
- float_re = '(' +
- hexadecimal_float_re + '|' +
- decimal_float_re +
- ')';
-
- /**
- * Escape sequence supported in D string and character literals
- *
- * @type {String}
- */
- var escape_sequence_re = '\\\\(' +
- '[\'"\\?\\\\abfnrtv]|' + // common escapes
- 'u[\\dA-Fa-f]{4}|' + // four hex digit unicode codepoint
- '[0-7]{1,3}|' + // one to three octal digit ascii char code
- 'x[\\dA-Fa-f]{2}|' + // two hex digit ascii char code
- 'U[\\dA-Fa-f]{8}' + // eight hex digit unicode codepoint
- ')|' +
- '&[a-zA-Z\\d]{2,};'; // named character entity
-
- /**
- * D integer number literals
- *
- * @type {Object}
- */
- var D_INTEGER_MODE = {
- className: 'number',
- begin: '\\b' + integer_re + '(L|u|U|Lu|LU|uL|UL)?',
- relevance: 0
- };
-
- /**
- * [D_FLOAT_MODE description]
- * @type {Object}
- */
- var D_FLOAT_MODE = {
- className: 'number',
- begin: '\\b(' +
- float_re + '([fF]|L|i|[fF]i|Li)?|' +
- integer_re + '(i|[fF]i|Li)' +
- ')',
- relevance: 0
- };
-
- /**
- * D character literal
- *
- * @type {Object}
- */
- var D_CHARACTER_MODE = {
- className: 'string',
- begin: '\'(' + escape_sequence_re + '|.)', end: '\'',
- illegal: '.'
- };
-
- /**
- * D string escape sequence
- *
- * @type {Object}
- */
- var D_ESCAPE_SEQUENCE = {
- begin: escape_sequence_re,
- relevance: 0
- };
-
- /**
- * D double quoted string literal
- *
- * @type {Object}
- */
- var D_STRING_MODE = {
- className: 'string',
- begin: '"',
- contains: [D_ESCAPE_SEQUENCE],
- end: '"[cwd]?'
- };
-
- /**
- * D wysiwyg and delimited string literals
- *
- * @type {Object}
- */
- var D_WYSIWYG_DELIMITED_STRING_MODE = {
- className: 'string',
- begin: '[rq]"',
- end: '"[cwd]?',
- relevance: 5
- };
-
- /**
- * D alternate wysiwyg string literal
- *
- * @type {Object}
- */
- var D_ALTERNATE_WYSIWYG_STRING_MODE = {
- className: 'string',
- begin: '`',
- end: '`[cwd]?'
- };
-
- /**
- * D hexadecimal string literal
- *
- * @type {Object}
- */
- var D_HEX_STRING_MODE = {
- className: 'string',
- begin: 'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',
- relevance: 10
- };
-
- /**
- * D delimited string literal
- *
- * @type {Object}
- */
- var D_TOKEN_STRING_MODE = {
- className: 'string',
- begin: 'q"\\{',
- end: '\\}"'
- };
-
- /**
- * Hashbang support
- *
- * @type {Object}
- */
- var D_HASHBANG_MODE = {
- className: 'meta',
- begin: '^#!',
- end: '$',
- relevance: 5
- };
-
- /**
- * D special token sequence
- *
- * @type {Object}
- */
- var D_SPECIAL_TOKEN_SEQUENCE_MODE = {
- className: 'meta',
- begin: '#(line)',
- end: '$',
- relevance: 5
- };
-
- /**
- * D attributes
- *
- * @type {Object}
- */
- var D_ATTRIBUTE_MODE = {
- className: 'keyword',
- begin: '@[a-zA-Z_][a-zA-Z_\\d]*'
- };
-
- /**
- * D nesting comment
- *
- * @type {Object}
- */
- var D_NESTING_COMMENT_MODE = hljs.COMMENT(
- '\\/\\+',
- '\\+\\/',
- {
- contains: ['self'],
- relevance: 10
- }
- );
-
- return {
- lexemes: hljs.UNDERSCORE_IDENT_RE,
- keywords: D_KEYWORDS,
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- D_NESTING_COMMENT_MODE,
- D_HEX_STRING_MODE,
- D_STRING_MODE,
- D_WYSIWYG_DELIMITED_STRING_MODE,
- D_ALTERNATE_WYSIWYG_STRING_MODE,
- D_TOKEN_STRING_MODE,
- D_FLOAT_MODE,
- D_INTEGER_MODE,
- D_CHARACTER_MODE,
- D_HASHBANG_MODE,
- D_SPECIAL_TOKEN_SEQUENCE_MODE,
- D_ATTRIBUTE_MODE
- ]
- };
-};
-},{}],150:[function(require,module,exports){
-module.exports = function (hljs) {
- var SUBST = {
- className: 'subst',
- begin: '\\$\\{', end: '}',
- keywords: 'true false null this is new super'
- };
-
- var STRING = {
- className: 'string',
- variants: [
- {
- begin: 'r\'\'\'', end: '\'\'\''
- },
- {
- begin: 'r"""', end: '"""'
- },
- {
- begin: 'r\'', end: '\'',
- illegal: '\\n'
- },
- {
- begin: 'r"', end: '"',
- illegal: '\\n'
- },
- {
- begin: '\'\'\'', end: '\'\'\'',
- contains: [hljs.BACKSLASH_ESCAPE, SUBST]
- },
- {
- begin: '"""', end: '"""',
- contains: [hljs.BACKSLASH_ESCAPE, SUBST]
- },
- {
- begin: '\'', end: '\'',
- illegal: '\\n',
- contains: [hljs.BACKSLASH_ESCAPE, SUBST]
- },
- {
- begin: '"', end: '"',
- illegal: '\\n',
- contains: [hljs.BACKSLASH_ESCAPE, SUBST]
- }
- ]
- };
- SUBST.contains = [
- hljs.C_NUMBER_MODE, STRING
- ];
-
- var KEYWORDS = {
- keyword: 'assert async await break case catch class const continue default do else enum extends false final ' +
- 'finally for if in is new null rethrow return super switch sync this throw true try var void while with yield ' +
- 'abstract as dynamic export external factory get implements import library operator part set static typedef',
- built_in:
- // dart:core
- 'print Comparable DateTime Duration Function Iterable Iterator List Map Match Null Object Pattern RegExp Set ' +
- 'Stopwatch String StringBuffer StringSink Symbol Type Uri bool double int num ' +
- // dart:html
- 'document window querySelector querySelectorAll Element ElementList'
- };
-
- return {
- keywords: KEYWORDS,
- contains: [
- STRING,
- hljs.COMMENT(
- '/\\*\\*',
- '\\*/',
- {
- subLanguage: 'markdown'
- }
- ),
- hljs.COMMENT(
- '///',
- '$',
- {
- subLanguage: 'markdown'
- }
- ),
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- {
- className: 'class',
- beginKeywords: 'class interface', end: '{', excludeEnd: true,
- contains: [
- {
- beginKeywords: 'extends implements'
- },
- hljs.UNDERSCORE_TITLE_MODE
- ]
- },
- hljs.C_NUMBER_MODE,
- {
- className: 'meta', begin: '@[A-Za-z]+'
- },
- {
- begin: '=>' // No markup, just a relevance booster
- }
- ]
- }
-};
-},{}],151:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS =
- 'exports register file shl array record property for mod while set ally label uses raise not ' +
- 'stored class safecall var interface or private static exit index inherited to else stdcall ' +
- 'override shr asm far resourcestring finalization packed virtual out and protected library do ' +
- 'xorwrite goto near function end div overload object unit begin string on inline repeat until ' +
- 'destructor write message program with read initialization except default nil if case cdecl in ' +
- 'downto threadvar of try pascal const external constructor type public then implementation ' +
- 'finally published procedure absolute reintroduce operator as is abstract alias assembler ' +
- 'bitpacked break continue cppdecl cvar enumerator experimental platform deprecated ' +
- 'unimplemented dynamic export far16 forward generic helper implements interrupt iochecks ' +
- 'local name nodefault noreturn nostackframe oldfpccall otherwise saveregisters softfloat ' +
- 'specialize strict unaligned varargs ';
- var COMMENT_MODES = [
- hljs.C_LINE_COMMENT_MODE,
- hljs.COMMENT(/\{/, /\}/, {relevance: 0}),
- hljs.COMMENT(/\(\*/, /\*\)/, {relevance: 10})
- ];
- var DIRECTIVE = {
- className: 'meta',
- variants: [
- {begin: /\{\$/, end: /\}/},
- {begin: /\(\*\$/, end: /\*\)/}
- ]
- };
- var STRING = {
- className: 'string',
- begin: /'/, end: /'/,
- contains: [{begin: /''/}]
- };
- var CHAR_STRING = {
- className: 'string', begin: /(#\d+)+/
- };
- var CLASS = {
- begin: hljs.IDENT_RE + '\\s*=\\s*class\\s*\\(', returnBegin: true,
- contains: [
- hljs.TITLE_MODE
- ]
- };
- var FUNCTION = {
- className: 'function',
- beginKeywords: 'function constructor destructor procedure', end: /[:;]/,
- keywords: 'function constructor|10 destructor|10 procedure|10',
- contains: [
- hljs.TITLE_MODE,
- {
- className: 'params',
- begin: /\(/, end: /\)/,
- keywords: KEYWORDS,
- contains: [STRING, CHAR_STRING, DIRECTIVE].concat(COMMENT_MODES)
- },
- DIRECTIVE
- ].concat(COMMENT_MODES)
- };
- return {
- aliases: ['dpr', 'dfm', 'pas', 'pascal', 'freepascal', 'lazarus', 'lpr', 'lfm'],
- case_insensitive: true,
- keywords: KEYWORDS,
- illegal: /"|\$[G-Zg-z]|\/\*|<\/|\|/,
- contains: [
- STRING, CHAR_STRING,
- hljs.NUMBER_MODE,
- CLASS,
- FUNCTION,
- DIRECTIVE
- ].concat(COMMENT_MODES)
- };
-};
-},{}],152:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['patch'],
- contains: [
- {
- className: 'meta',
- relevance: 10,
- variants: [
- {begin: /^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/},
- {begin: /^\*\*\* +\d+,\d+ +\*\*\*\*$/},
- {begin: /^\-\-\- +\d+,\d+ +\-\-\-\-$/}
- ]
- },
- {
- className: 'comment',
- variants: [
- {begin: /Index: /, end: /$/},
- {begin: /={3,}/, end: /$/},
- {begin: /^\-{3}/, end: /$/},
- {begin: /^\*{3} /, end: /$/},
- {begin: /^\+{3}/, end: /$/},
- {begin: /\*{5}/, end: /\*{5}$/}
- ]
- },
- {
- className: 'addition',
- begin: '^\\+', end: '$'
- },
- {
- className: 'deletion',
- begin: '^\\-', end: '$'
- },
- {
- className: 'addition',
- begin: '^\\!', end: '$'
- }
- ]
- };
-};
-},{}],153:[function(require,module,exports){
-module.exports = function(hljs) {
- var FILTER = {
- begin: /\|[A-Za-z]+:?/,
- keywords: {
- name:
- 'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +
- 'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +
- 'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' +
- 'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' +
- 'dictsortreversed default_if_none pluralize lower join center default ' +
- 'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' +
- 'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +
- 'localtime utc timezone'
- },
- contains: [
- hljs.QUOTE_STRING_MODE,
- hljs.APOS_STRING_MODE
- ]
- };
-
- return {
- aliases: ['jinja'],
- case_insensitive: true,
- subLanguage: 'xml',
- contains: [
- hljs.COMMENT(/\{%\s*comment\s*%}/, /\{%\s*endcomment\s*%}/),
- hljs.COMMENT(/\{#/, /#}/),
- {
- className: 'template-tag',
- begin: /\{%/, end: /%}/,
- contains: [
- {
- className: 'name',
- begin: /\w+/,
- keywords: {
- name:
- 'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +
- 'endfor ifnotequal endifnotequal widthratio extends include spaceless ' +
- 'endspaceless regroup ifequal endifequal ssi now with cycle url filter ' +
- 'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +
- 'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +
- 'plural get_current_language language get_available_languages ' +
- 'get_current_language_bidi get_language_info get_language_info_list localize ' +
- 'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone ' +
- 'verbatim'
- },
- starts: {
- endsWithParent: true,
- keywords: 'in by as',
- contains: [FILTER],
- relevance: 0
- }
- }
- ]
- },
- {
- className: 'template-variable',
- begin: /\{\{/, end: /}}/,
- contains: [FILTER]
- }
- ]
- };
-};
-},{}],154:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['bind', 'zone'],
- keywords: {
- keyword:
- 'IN A AAAA AFSDB APL CAA CDNSKEY CDS CERT CNAME DHCID DLV DNAME DNSKEY DS HIP IPSECKEY KEY KX ' +
- 'LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM PTR RRSIG RP SIG SOA SRV SSHFP TA TKEY TLSA TSIG TXT'
- },
- contains: [
- hljs.COMMENT(';', '$', {relevance: 0}),
- {
- className: 'meta',
- begin: /^\$(TTL|GENERATE|INCLUDE|ORIGIN)\b/
- },
- // IPv6
- {
- className: 'number',
- begin: '((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))\\b'
- },
- // IPv4
- {
- className: 'number',
- begin: '((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\b'
- },
- hljs.inherit(hljs.NUMBER_MODE, {begin: /\b\d+[dhwm]?/})
- ]
- };
-};
-},{}],155:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['docker'],
- case_insensitive: true,
- keywords: 'from maintainer expose env arg user onbuild stopsignal',
- contains: [
- hljs.HASH_COMMENT_MODE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.NUMBER_MODE,
- {
- beginKeywords: 'run cmd entrypoint volume add copy workdir label healthcheck shell',
- starts: {
- end: /[^\\]\n/,
- subLanguage: 'bash'
- }
- }
- ],
- illegal: '</'
- }
-};
-},{}],156:[function(require,module,exports){
-module.exports = function(hljs) {
- var COMMENT = hljs.COMMENT(
- /^\s*@?rem\b/, /$/,
- {
- relevance: 10
- }
- );
- var LABEL = {
- className: 'symbol',
- begin: '^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)',
- relevance: 0
- };
- return {
- aliases: ['bat', 'cmd'],
- case_insensitive: true,
- illegal: /\/\*/,
- keywords: {
- keyword:
- 'if else goto for in do call exit not exist errorlevel defined ' +
- 'equ neq lss leq gtr geq',
- built_in:
- 'prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux ' +
- 'shift cd dir echo setlocal endlocal set pause copy ' +
- 'append assoc at attrib break cacls cd chcp chdir chkdsk chkntfs cls cmd color ' +
- 'comp compact convert date dir diskcomp diskcopy doskey erase fs ' +
- 'find findstr format ftype graftabl help keyb label md mkdir mode more move path ' +
- 'pause print popd pushd promt rd recover rem rename replace restore rmdir shift' +
- 'sort start subst time title tree type ver verify vol ' +
- // winutils
- 'ping net ipconfig taskkill xcopy ren del'
- },
- contains: [
- {
- className: 'variable', begin: /%%[^ ]|%[^ ]+?%|![^ ]+?!/
- },
- {
- className: 'function',
- begin: LABEL.begin, end: 'goto:eof',
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {begin: '([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*'}),
- COMMENT
- ]
- },
- {
- className: 'number', begin: '\\b\\d+',
- relevance: 0
- },
- COMMENT
- ]
- };
-};
-},{}],157:[function(require,module,exports){
-module.exports = function(hljs) {
- var QUOTED_PROPERTY = {
- className: 'string',
- begin: /"/, end: /"/
- };
- var APOS_PROPERTY = {
- className: 'string',
- begin: /'/, end: /'/
- };
- var UNQUOTED_PROPERTY = {
- className: 'string',
- begin: '[\\w-?]+:\\w+', end: '\\W',
- relevance: 0
- };
- var VALUELESS_PROPERTY = {
- className: 'string',
- begin: '\\w+-?\\w+', end: '\\W',
- relevance: 0
- };
-
- return {
- keywords: 'dsconfig',
- contains: [
- {
- className: 'keyword',
- begin: '^dsconfig', end: '\\s', excludeEnd: true,
- relevance: 10
- },
- {
- className: 'built_in',
- begin: '(list|create|get|set|delete)-(\\w+)', end: '\\s', excludeEnd: true,
- illegal: '!@#$%^&*()',
- relevance: 10
- },
- {
- className: 'built_in',
- begin: '--(\\w+)', end: '\\s', excludeEnd: true
- },
- QUOTED_PROPERTY,
- APOS_PROPERTY,
- UNQUOTED_PROPERTY,
- VALUELESS_PROPERTY,
- hljs.HASH_COMMENT_MODE
- ]
- };
-};
-},{}],158:[function(require,module,exports){
-module.exports = function(hljs) {
- var STRINGS = {
- className: 'string',
- variants: [
- hljs.inherit(hljs.QUOTE_STRING_MODE, { begin: '((u8?|U)|L)?"' }),
- {
- begin: '(u8?|U)?R"', end: '"',
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- begin: '\'\\\\?.', end: '\'',
- illegal: '.'
- }
- ]
- };
-
- var NUMBERS = {
- className: 'number',
- variants: [
- { begin: '\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)' },
- { begin: hljs.C_NUMBER_RE }
- ],
- relevance: 0
- };
-
- var PREPROCESSOR = {
- className: 'meta',
- begin: '#', end: '$',
- keywords: {'meta-keyword': 'if else elif endif define undef ifdef ifndef'},
- contains: [
- {
- begin: /\\\n/, relevance: 0
- },
- {
- beginKeywords: 'include', end: '$',
- keywords: {'meta-keyword': 'include'},
- contains: [
- hljs.inherit(STRINGS, {className: 'meta-string'}),
- {
- className: 'meta-string',
- begin: '<', end: '>',
- illegal: '\\n'
- }
- ]
- },
- STRINGS,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- };
-
- var DTS_REFERENCE = {
- className: 'variable',
- begin: '\\&[a-z\\d_]*\\b'
- };
-
- var DTS_KEYWORD = {
- className: 'meta-keyword',
- begin: '/[a-z][a-z\\d-]*/'
- };
-
- var DTS_LABEL = {
- className: 'symbol',
- begin: '^\\s*[a-zA-Z_][a-zA-Z\\d_]*:'
- };
-
- var DTS_CELL_PROPERTY = {
- className: 'params',
- begin: '<',
- end: '>',
- contains: [
- NUMBERS,
- DTS_REFERENCE
- ]
- };
-
- var DTS_NODE = {
- className: 'class',
- begin: /[a-zA-Z_][a-zA-Z\d_@]*\s{/,
- end: /[{;=]/,
- returnBegin: true,
- excludeEnd: true
- };
-
- var DTS_ROOT_NODE = {
- className: 'class',
- begin: '/\\s*{',
- end: '};',
- relevance: 10,
- contains: [
- DTS_REFERENCE,
- DTS_KEYWORD,
- DTS_LABEL,
- DTS_NODE,
- DTS_CELL_PROPERTY,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- NUMBERS,
- STRINGS
- ]
- };
-
- return {
- keywords: "",
- contains: [
- DTS_ROOT_NODE,
- DTS_REFERENCE,
- DTS_KEYWORD,
- DTS_LABEL,
- DTS_NODE,
- DTS_CELL_PROPERTY,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- NUMBERS,
- STRINGS,
- PREPROCESSOR,
- {
- begin: hljs.IDENT_RE + '::',
- keywords: ""
- }
- ]
- };
-};
-},{}],159:[function(require,module,exports){
-module.exports = function(hljs) {
- var EXPRESSION_KEYWORDS = 'if eq ne lt lte gt gte select default math sep';
- return {
- aliases: ['dst'],
- case_insensitive: true,
- subLanguage: 'xml',
- contains: [
- {
- className: 'template-tag',
- begin: /\{[#\/]/, end: /\}/, illegal: /;/,
- contains: [
- {
- className: 'name',
- begin: /[a-zA-Z\.-]+/,
- starts: {
- endsWithParent: true, relevance: 0,
- contains: [
- hljs.QUOTE_STRING_MODE
- ]
- }
- }
- ]
- },
- {
- className: 'template-variable',
- begin: /\{/, end: /\}/, illegal: /;/,
- keywords: EXPRESSION_KEYWORDS
- }
- ]
- };
-};
-},{}],160:[function(require,module,exports){
-module.exports = function(hljs) {
- var commentMode = hljs.COMMENT(/\(\*/, /\*\)/);
-
- var nonTerminalMode = {
- className: "attribute",
- begin: /^[ ]*[a-zA-Z][a-zA-Z-]*([\s-]+[a-zA-Z][a-zA-Z]*)*/
- };
-
- var specialSequenceMode = {
- className: "meta",
- begin: /\?.*\?/
- };
-
- var ruleBodyMode = {
- begin: /=/, end: /;/,
- contains: [
- commentMode,
- specialSequenceMode,
- // terminals
- hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE
- ]
- };
-
- return {
- illegal: /\S/,
- contains: [
- commentMode,
- nonTerminalMode,
- ruleBodyMode
- ]
- };
-};
-},{}],161:[function(require,module,exports){
-module.exports = function(hljs) {
- var ELIXIR_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?';
- var ELIXIR_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?';
- var ELIXIR_KEYWORDS =
- 'and false then defined module in return redo retry end for true self when ' +
- 'next until do begin unless nil break not case cond alias while ensure or ' +
- 'include use alias fn quote';
- var SUBST = {
- className: 'subst',
- begin: '#\\{', end: '}',
- lexemes: ELIXIR_IDENT_RE,
- keywords: ELIXIR_KEYWORDS
- };
- var STRING = {
- className: 'string',
- contains: [hljs.BACKSLASH_ESCAPE, SUBST],
- variants: [
- {
- begin: /'/, end: /'/
- },
- {
- begin: /"/, end: /"/
- }
- ]
- };
- var FUNCTION = {
- className: 'function',
- beginKeywords: 'def defp defmacro', end: /\B\b/, // the mode is ended by the title
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {
- begin: ELIXIR_IDENT_RE,
- endsParent: true
- })
- ]
- };
- var CLASS = hljs.inherit(FUNCTION, {
- className: 'class',
- beginKeywords: 'defimpl defmodule defprotocol defrecord', end: /\bdo\b|$|;/
- });
- var ELIXIR_DEFAULT_CONTAINS = [
- STRING,
- hljs.HASH_COMMENT_MODE,
- CLASS,
- FUNCTION,
- {
- className: 'symbol',
- begin: ':(?!\\s)',
- contains: [STRING, {begin: ELIXIR_METHOD_RE}],
- relevance: 0
- },
- {
- className: 'symbol',
- begin: ELIXIR_IDENT_RE + ':',
- relevance: 0
- },
- {
- className: 'number',
- begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',
- relevance: 0
- },
- {
- className: 'variable',
- begin: '(\\$\\W)|((\\$|\\@\\@?)(\\w+))'
- },
- {
- begin: '->'
- },
- { // regexp container
- begin: '(' + hljs.RE_STARTERS_RE + ')\\s*',
- contains: [
- hljs.HASH_COMMENT_MODE,
- {
- className: 'regexp',
- illegal: '\\n',
- contains: [hljs.BACKSLASH_ESCAPE, SUBST],
- variants: [
- {
- begin: '/', end: '/[a-z]*'
- },
- {
- begin: '%r\\[', end: '\\][a-z]*'
- }
- ]
- }
- ],
- relevance: 0
- }
- ];
- SUBST.contains = ELIXIR_DEFAULT_CONTAINS;
-
- return {
- lexemes: ELIXIR_IDENT_RE,
- keywords: ELIXIR_KEYWORDS,
- contains: ELIXIR_DEFAULT_CONTAINS
- };
-};
-},{}],162:[function(require,module,exports){
-module.exports = function(hljs) {
- var COMMENT = {
- variants: [
- hljs.COMMENT('--', '$'),
- hljs.COMMENT(
- '{-',
- '-}',
- {
- contains: ['self']
- }
- )
- ]
- };
-
- var CONSTRUCTOR = {
- className: 'type',
- begin: '\\b[A-Z][\\w\']*', // TODO: other constructors (built-in, infix).
- relevance: 0
- };
-
- var LIST = {
- begin: '\\(', end: '\\)',
- illegal: '"',
- contains: [
- {className: 'type', begin: '\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?'},
- COMMENT
- ]
- };
-
- var RECORD = {
- begin: '{', end: '}',
- contains: LIST.contains
- };
-
- return {
- keywords:
- 'let in if then else case of where module import exposing ' +
- 'type alias as infix infixl infixr port effect command subscription',
- contains: [
-
- // Top-level constructions.
-
- {
- beginKeywords: 'port effect module', end: 'exposing',
- keywords: 'port effect module where command subscription exposing',
- contains: [LIST, COMMENT],
- illegal: '\\W\\.|;'
- },
- {
- begin: 'import', end: '$',
- keywords: 'import as exposing',
- contains: [LIST, COMMENT],
- illegal: '\\W\\.|;'
- },
- {
- begin: 'type', end: '$',
- keywords: 'type alias',
- contains: [CONSTRUCTOR, LIST, RECORD, COMMENT]
- },
- {
- beginKeywords: 'infix infixl infixr', end: '$',
- contains: [hljs.C_NUMBER_MODE, COMMENT]
- },
- {
- begin: 'port', end: '$',
- keywords: 'port',
- contains: [COMMENT]
- },
-
- // Literals and names.
-
- // TODO: characters.
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE,
- CONSTRUCTOR,
- hljs.inherit(hljs.TITLE_MODE, {begin: '^[_a-z][\\w\']*'}),
- COMMENT,
-
- {begin: '->|<-'} // No markup, relevance booster
- ],
- illegal: /;/
- };
-};
-},{}],163:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- subLanguage: 'xml',
- contains: [
- hljs.COMMENT('<%#', '%>'),
- {
- begin: '<%[%=-]?', end: '[%-]?%>',
- subLanguage: 'ruby',
- excludeBegin: true,
- excludeEnd: true
- }
- ]
- };
-};
-},{}],164:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- keywords: {
- built_in:
- 'spawn spawn_link self',
- keyword:
- 'after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if ' +
- 'let not of or orelse|10 query receive rem try when xor'
- },
- contains: [
- {
- className: 'meta', begin: '^[0-9]+> ',
- relevance: 10
- },
- hljs.COMMENT('%', '$'),
- {
- className: 'number',
- begin: '\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)',
- relevance: 0
- },
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- {
- begin: '\\?(::)?([A-Z]\\w*(::)?)+'
- },
- {
- begin: '->'
- },
- {
- begin: 'ok'
- },
- {
- begin: '!'
- },
- {
- begin: '(\\b[a-z\'][a-zA-Z0-9_\']*:[a-z\'][a-zA-Z0-9_\']*)|(\\b[a-z\'][a-zA-Z0-9_\']*)',
- relevance: 0
- },
- {
- begin: '[A-Z][a-zA-Z0-9_\']*',
- relevance: 0
- }
- ]
- };
-};
-},{}],165:[function(require,module,exports){
-module.exports = function(hljs) {
- var BASIC_ATOM_RE = '[a-z\'][a-zA-Z0-9_\']*';
- var FUNCTION_NAME_RE = '(' + BASIC_ATOM_RE + ':' + BASIC_ATOM_RE + '|' + BASIC_ATOM_RE + ')';
- var ERLANG_RESERVED = {
- keyword:
- 'after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if ' +
- 'let not of orelse|10 query receive rem try when xor',
- literal:
- 'false true'
- };
-
- var COMMENT = hljs.COMMENT('%', '$');
- var NUMBER = {
- className: 'number',
- begin: '\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)',
- relevance: 0
- };
- var NAMED_FUN = {
- begin: 'fun\\s+' + BASIC_ATOM_RE + '/\\d+'
- };
- var FUNCTION_CALL = {
- begin: FUNCTION_NAME_RE + '\\(', end: '\\)',
- returnBegin: true,
- relevance: 0,
- contains: [
- {
- begin: FUNCTION_NAME_RE, relevance: 0
- },
- {
- begin: '\\(', end: '\\)', endsWithParent: true,
- returnEnd: true,
- relevance: 0
- // "contains" defined later
- }
- ]
- };
- var TUPLE = {
- begin: '{', end: '}',
- relevance: 0
- // "contains" defined later
- };
- var VAR1 = {
- begin: '\\b_([A-Z][A-Za-z0-9_]*)?',
- relevance: 0
- };
- var VAR2 = {
- begin: '[A-Z][a-zA-Z0-9_]*',
- relevance: 0
- };
- var RECORD_ACCESS = {
- begin: '#' + hljs.UNDERSCORE_IDENT_RE,
- relevance: 0,
- returnBegin: true,
- contains: [
- {
- begin: '#' + hljs.UNDERSCORE_IDENT_RE,
- relevance: 0
- },
- {
- begin: '{', end: '}',
- relevance: 0
- // "contains" defined later
- }
- ]
- };
-
- var BLOCK_STATEMENTS = {
- beginKeywords: 'fun receive if try case', end: 'end',
- keywords: ERLANG_RESERVED
- };
- BLOCK_STATEMENTS.contains = [
- COMMENT,
- NAMED_FUN,
- hljs.inherit(hljs.APOS_STRING_MODE, {className: ''}),
- BLOCK_STATEMENTS,
- FUNCTION_CALL,
- hljs.QUOTE_STRING_MODE,
- NUMBER,
- TUPLE,
- VAR1, VAR2,
- RECORD_ACCESS
- ];
-
- var BASIC_MODES = [
- COMMENT,
- NAMED_FUN,
- BLOCK_STATEMENTS,
- FUNCTION_CALL,
- hljs.QUOTE_STRING_MODE,
- NUMBER,
- TUPLE,
- VAR1, VAR2,
- RECORD_ACCESS
- ];
- FUNCTION_CALL.contains[1].contains = BASIC_MODES;
- TUPLE.contains = BASIC_MODES;
- RECORD_ACCESS.contains[1].contains = BASIC_MODES;
-
- var PARAMS = {
- className: 'params',
- begin: '\\(', end: '\\)',
- contains: BASIC_MODES
- };
- return {
- aliases: ['erl'],
- keywords: ERLANG_RESERVED,
- illegal: '(</|\\*=|\\+=|-=|/\\*|\\*/|\\(\\*|\\*\\))',
- contains: [
- {
- className: 'function',
- begin: '^' + BASIC_ATOM_RE + '\\s*\\(', end: '->',
- returnBegin: true,
- illegal: '\\(|#|//|/\\*|\\\\|:|;',
- contains: [
- PARAMS,
- hljs.inherit(hljs.TITLE_MODE, {begin: BASIC_ATOM_RE})
- ],
- starts: {
- end: ';|\\.',
- keywords: ERLANG_RESERVED,
- contains: BASIC_MODES
- }
- },
- COMMENT,
- {
- begin: '^-', end: '\\.',
- relevance: 0,
- excludeEnd: true,
- returnBegin: true,
- lexemes: '-' + hljs.IDENT_RE,
- keywords:
- '-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn ' +
- '-import -include -include_lib -compile -define -else -endif -file -behaviour ' +
- '-behavior -spec',
- contains: [PARAMS]
- },
- NUMBER,
- hljs.QUOTE_STRING_MODE,
- RECORD_ACCESS,
- VAR1, VAR2,
- TUPLE,
- {begin: /\.$/} // relevance booster
- ]
- };
-};
-},{}],166:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['xlsx', 'xls'],
- case_insensitive: true,
- lexemes: /[a-zA-Z][\w\.]*/,
- // built-in functions imported from https://web.archive.org/web/20160513042710/https://support.office.com/en-us/article/Excel-functions-alphabetical-b3944572-255d-4efb-bb96-c6d90033e188
- keywords: {
- built_in: 'ABS ACCRINT ACCRINTM ACOS ACOSH ACOT ACOTH AGGREGATE ADDRESS AMORDEGRC AMORLINC AND ARABIC AREAS ASC ASIN ASINH ATAN ATAN2 ATANH AVEDEV AVERAGE AVERAGEA AVERAGEIF AVERAGEIFS BAHTTEXT BASE BESSELI BESSELJ BESSELK BESSELY BETADIST BETA.DIST BETAINV BETA.INV BIN2DEC BIN2HEX BIN2OCT BINOMDIST BINOM.DIST BINOM.DIST.RANGE BINOM.INV BITAND BITLSHIFT BITOR BITRSHIFT BITXOR CALL CEILING CEILING.MATH CEILING.PRECISE CELL CHAR CHIDIST CHIINV CHITEST CHISQ.DIST CHISQ.DIST.RT CHISQ.INV CHISQ.INV.RT CHISQ.TEST CHOOSE CLEAN CODE COLUMN COLUMNS COMBIN COMBINA COMPLEX CONCAT CONCATENATE CONFIDENCE CONFIDENCE.NORM CONFIDENCE.T CONVERT CORREL COS COSH COT COTH COUNT COUNTA COUNTBLANK COUNTIF COUNTIFS COUPDAYBS COUPDAYS COUPDAYSNC COUPNCD COUPNUM COUPPCD COVAR COVARIANCE.P COVARIANCE.S CRITBINOM CSC CSCH CUBEKPIMEMBER CUBEMEMBER CUBEMEMBERPROPERTY CUBERANKEDMEMBER CUBESET CUBESETCOUNT CUBEVALUE CUMIPMT CUMPRINC DATE DATEDIF DATEVALUE DAVERAGE DAY DAYS DAYS360 DB DBCS DCOUNT DCOUNTA DDB DEC2BIN DEC2HEX DEC2OCT DECIMAL DEGREES DELTA DEVSQ DGET DISC DMAX DMIN DOLLAR DOLLARDE DOLLARFR DPRODUCT DSTDEV DSTDEVP DSUM DURATION DVAR DVARP EDATE EFFECT ENCODEURL EOMONTH ERF ERF.PRECISE ERFC ERFC.PRECISE ERROR.TYPE EUROCONVERT EVEN EXACT EXP EXPON.DIST EXPONDIST FACT FACTDOUBLE FALSE|0 F.DIST FDIST F.DIST.RT FILTERXML FIND FINDB F.INV F.INV.RT FINV FISHER FISHERINV FIXED FLOOR FLOOR.MATH FLOOR.PRECISE FORECAST FORECAST.ETS FORECAST.ETS.CONFINT FORECAST.ETS.SEASONALITY FORECAST.ETS.STAT FORECAST.LINEAR FORMULATEXT FREQUENCY F.TEST FTEST FV FVSCHEDULE GAMMA GAMMA.DIST GAMMADIST GAMMA.INV GAMMAINV GAMMALN GAMMALN.PRECISE GAUSS GCD GEOMEAN GESTEP GETPIVOTDATA GROWTH HARMEAN HEX2BIN HEX2DEC HEX2OCT HLOOKUP HOUR HYPERLINK HYPGEOM.DIST HYPGEOMDIST IF|0 IFERROR IFNA IFS IMABS IMAGINARY IMARGUMENT IMCONJUGATE IMCOS IMCOSH IMCOT IMCSC IMCSCH IMDIV IMEXP IMLN IMLOG10 IMLOG2 IMPOWER IMPRODUCT IMREAL IMSEC IMSECH IMSIN IMSINH IMSQRT IMSUB IMSUM IMTAN INDEX INDIRECT INFO INT INTERCEPT INTRATE IPMT IRR ISBLANK ISERR ISERROR ISEVEN ISFORMULA ISLOGICAL ISNA ISNONTEXT ISNUMBER ISODD ISREF ISTEXT ISO.CEILING ISOWEEKNUM ISPMT JIS KURT LARGE LCM LEFT LEFTB LEN LENB LINEST LN LOG LOG10 LOGEST LOGINV LOGNORM.DIST LOGNORMDIST LOGNORM.INV LOOKUP LOWER MATCH MAX MAXA MAXIFS MDETERM MDURATION MEDIAN MID MIDBs MIN MINIFS MINA MINUTE MINVERSE MIRR MMULT MOD MODE MODE.MULT MODE.SNGL MONTH MROUND MULTINOMIAL MUNIT N NA NEGBINOM.DIST NEGBINOMDIST NETWORKDAYS NETWORKDAYS.INTL NOMINAL NORM.DIST NORMDIST NORMINV NORM.INV NORM.S.DIST NORMSDIST NORM.S.INV NORMSINV NOT NOW NPER NPV NUMBERVALUE OCT2BIN OCT2DEC OCT2HEX ODD ODDFPRICE ODDFYIELD ODDLPRICE ODDLYIELD OFFSET OR PDURATION PEARSON PERCENTILE.EXC PERCENTILE.INC PERCENTILE PERCENTRANK.EXC PERCENTRANK.INC PERCENTRANK PERMUT PERMUTATIONA PHI PHONETIC PI PMT POISSON.DIST POISSON POWER PPMT PRICE PRICEDISC PRICEMAT PROB PRODUCT PROPER PV QUARTILE QUARTILE.EXC QUARTILE.INC QUOTIENT RADIANS RAND RANDBETWEEN RANK.AVG RANK.EQ RANK RATE RECEIVED REGISTER.ID REPLACE REPLACEB REPT RIGHT RIGHTB ROMAN ROUND ROUNDDOWN ROUNDUP ROW ROWS RRI RSQ RTD SEARCH SEARCHB SEC SECH SECOND SERIESSUM SHEET SHEETS SIGN SIN SINH SKEW SKEW.P SLN SLOPE SMALL SQL.REQUEST SQRT SQRTPI STANDARDIZE STDEV STDEV.P STDEV.S STDEVA STDEVP STDEVPA STEYX SUBSTITUTE SUBTOTAL SUM SUMIF SUMIFS SUMPRODUCT SUMSQ SUMX2MY2 SUMX2PY2 SUMXMY2 SWITCH SYD T TAN TANH TBILLEQ TBILLPRICE TBILLYIELD T.DIST T.DIST.2T T.DIST.RT TDIST TEXT TEXTJOIN TIME TIMEVALUE T.INV T.INV.2T TINV TODAY TRANSPOSE TREND TRIM TRIMMEAN TRUE|0 TRUNC T.TEST TTEST TYPE UNICHAR UNICODE UPPER VALUE VAR VAR.P VAR.S VARA VARP VARPA VDB VLOOKUP WEBSERVICE WEEKDAY WEEKNUM WEIBULL WEIBULL.DIST WORKDAY WORKDAY.INTL XIRR XNPV XOR YEAR YEARFRAC YIELD YIELDDISC YIELDMAT Z.TEST ZTEST'
- },
- contains: [
- {
- /* matches a beginning equal sign found in Excel formula examples */
- begin: /^=/,
- end: /[^=]/, returnEnd: true, illegal: /=/, /* only allow single equal sign at front of line */
- relevance: 10
- },
- /* technically, there can be more than 2 letters in column names, but this prevents conflict with some keywords */
- {
- /* matches a reference to a single cell */
- className: 'symbol',
- begin: /\b[A-Z]{1,2}\d+\b/,
- end: /[^\d]/, excludeEnd: true,
- relevance: 0
- },
- {
- /* matches a reference to a range of cells */
- className: 'symbol',
- begin: /[A-Z]{0,2}\d*:[A-Z]{0,2}\d*/,
- relevance: 0
- },
- hljs.BACKSLASH_ESCAPE,
- hljs.QUOTE_STRING_MODE,
- {
- className: 'number',
- begin: hljs.NUMBER_RE + '(%)?',
- relevance: 0
- },
- /* Excel formula comments are done by putting the comment in a function call to N() */
- hljs.COMMENT(/\bN\(/,/\)/,
- {
- excludeBegin: true,
- excludeEnd: true,
- illegal: /\n/
- })
- ]
- };
-};
-},{}],167:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- contains: [
- {
- begin: /[^\u2401\u0001]+/,
- end: /[\u2401\u0001]/,
- excludeEnd: true,
- returnBegin: true,
- returnEnd: false,
- contains: [
- {
- begin: /([^\u2401\u0001=]+)/,
- end: /=([^\u2401\u0001=]+)/,
- returnEnd: true,
- returnBegin: false,
- className: 'attr'
- },
- {
- begin: /=/,
- end: /([\u2401\u0001])/,
- excludeEnd: true,
- excludeBegin: true,
- className: 'string'
- }]
- }],
- case_insensitive: true
- };
-};
-},{}],168:[function(require,module,exports){
-module.exports = function (hljs) {
-
- var CHAR = {
- className: 'string',
- begin: /'(.|\\[xXuU][a-zA-Z0-9]+)'/
- };
-
- var STRING = {
- className: 'string',
- variants: [
- {
- begin: '"', end: '"'
- }
- ]
- };
-
- var NAME = {
- className: 'title',
- begin: /[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/
- };
-
- var METHOD = {
- className: 'function',
- beginKeywords: 'def',
- end: /[:={\[(\n;]/,
- excludeEnd: true,
- contains: [NAME]
- };
-
- return {
- keywords: {
- literal: 'true false',
- keyword: 'case class def else enum if impl import in lat rel index let match namespace switch type yield with'
- },
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- CHAR,
- STRING,
- METHOD,
- hljs.C_NUMBER_MODE
- ]
- };
-};
-},{}],169:[function(require,module,exports){
-module.exports = function(hljs) {
- var PARAMS = {
- className: 'params',
- begin: '\\(', end: '\\)'
- };
-
- var F_KEYWORDS = {
- literal: '.False. .True.',
- keyword: 'kind do while private call intrinsic where elsewhere ' +
- 'type endtype endmodule endselect endinterface end enddo endif if forall endforall only contains default return stop then ' +
- 'public subroutine|10 function program .and. .or. .not. .le. .eq. .ge. .gt. .lt. ' +
- 'goto save else use module select case ' +
- 'access blank direct exist file fmt form formatted iostat name named nextrec number opened rec recl sequential status unformatted unit ' +
- 'continue format pause cycle exit ' +
- 'c_null_char c_alert c_backspace c_form_feed flush wait decimal round iomsg ' +
- 'synchronous nopass non_overridable pass protected volatile abstract extends import ' +
- 'non_intrinsic value deferred generic final enumerator class associate bind enum ' +
- 'c_int c_short c_long c_long_long c_signed_char c_size_t c_int8_t c_int16_t c_int32_t c_int64_t c_int_least8_t c_int_least16_t ' +
- 'c_int_least32_t c_int_least64_t c_int_fast8_t c_int_fast16_t c_int_fast32_t c_int_fast64_t c_intmax_t C_intptr_t c_float c_double ' +
- 'c_long_double c_float_complex c_double_complex c_long_double_complex c_bool c_char c_null_ptr c_null_funptr ' +
- 'c_new_line c_carriage_return c_horizontal_tab c_vertical_tab iso_c_binding c_loc c_funloc c_associated c_f_pointer ' +
- 'c_ptr c_funptr iso_fortran_env character_storage_size error_unit file_storage_size input_unit iostat_end iostat_eor ' +
- 'numeric_storage_size output_unit c_f_procpointer ieee_arithmetic ieee_support_underflow_control ' +
- 'ieee_get_underflow_mode ieee_set_underflow_mode newunit contiguous recursive ' +
- 'pad position action delim readwrite eor advance nml interface procedure namelist include sequence elemental pure ' +
- 'integer real character complex logical dimension allocatable|10 parameter ' +
- 'external implicit|10 none double precision assign intent optional pointer ' +
- 'target in out common equivalence data',
- built_in: 'alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint ' +
- 'dlog dlog10 dmax1 dmin1 dmod dnint dsign dsin dsinh dsqrt dtan dtanh float iabs idim idint idnint ifix isign max0 max1 min0 min1 sngl ' +
- 'algama cdabs cdcos cdexp cdlog cdsin cdsqrt cqabs cqcos cqexp cqlog cqsin cqsqrt dcmplx dconjg derf derfc dfloat dgamma dimag dlgama ' +
- 'iqint qabs qacos qasin qatan qatan2 qcmplx qconjg qcos qcosh qdim qerf qerfc qexp qgamma qimag qlgama qlog qlog10 qmax1 qmin1 qmod ' +
- 'qnint qsign qsin qsinh qsqrt qtan qtanh abs acos aimag aint anint asin atan atan2 char cmplx conjg cos cosh exp ichar index int log ' +
- 'log10 max min nint sign sin sinh sqrt tan tanh print write dim lge lgt lle llt mod nullify allocate deallocate ' +
- 'adjustl adjustr all allocated any associated bit_size btest ceiling count cshift date_and_time digits dot_product ' +
- 'eoshift epsilon exponent floor fraction huge iand ibclr ibits ibset ieor ior ishft ishftc lbound len_trim matmul ' +
- 'maxexponent maxloc maxval merge minexponent minloc minval modulo mvbits nearest pack present product ' +
- 'radix random_number random_seed range repeat reshape rrspacing scale scan selected_int_kind selected_real_kind ' +
- 'set_exponent shape size spacing spread sum system_clock tiny transpose trim ubound unpack verify achar iachar transfer ' +
- 'dble entry dprod cpu_time command_argument_count get_command get_command_argument get_environment_variable is_iostat_end ' +
- 'ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode ' +
- 'is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_of' +
- 'acosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2 ' +
- 'atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits ' +
- 'bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr ' +
- 'num_images parity popcnt poppar shifta shiftl shiftr this_image'
- };
- return {
- case_insensitive: true,
- aliases: ['f90', 'f95'],
- keywords: F_KEYWORDS,
- illegal: /\/\*/,
- contains: [
- hljs.inherit(hljs.APOS_STRING_MODE, {className: 'string', relevance: 0}),
- hljs.inherit(hljs.QUOTE_STRING_MODE, {className: 'string', relevance: 0}),
- {
- className: 'function',
- beginKeywords: 'subroutine function program',
- illegal: '[${=\\n]',
- contains: [hljs.UNDERSCORE_TITLE_MODE, PARAMS]
- },
- hljs.COMMENT('!', '$', {relevance: 0}),
- {
- className: 'number',
- begin: '(?=\\b|\\+|\\-|\\.)(?=\\.\\d|\\d)(?:\\d+)?(?:\\.?\\d*)(?:[de][+-]?\\d+)?\\b\\.?',
- relevance: 0
- }
- ]
- };
-};
-},{}],170:[function(require,module,exports){
-module.exports = function(hljs) {
- var TYPEPARAM = {
- begin: '<', end: '>',
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {begin: /'[a-zA-Z0-9_]+/})
- ]
- };
-
- return {
- aliases: ['fs'],
- keywords:
- 'abstract and as assert base begin class default delegate do done ' +
- 'downcast downto elif else end exception extern false finally for ' +
- 'fun function global if in inherit inline interface internal lazy let ' +
- 'match member module mutable namespace new null of open or ' +
- 'override private public rec return sig static struct then to ' +
- 'true try type upcast use val void when while with yield',
- illegal: /\/\*/,
- contains: [
- {
- // monad builder keywords (matches before non-bang kws)
- className: 'keyword',
- begin: /\b(yield|return|let|do)!/
- },
- {
- className: 'string',
- begin: '@"', end: '"',
- contains: [{begin: '""'}]
- },
- {
- className: 'string',
- begin: '"""', end: '"""'
- },
- hljs.COMMENT('\\(\\*', '\\*\\)'),
- {
- className: 'class',
- beginKeywords: 'type', end: '\\(|=|$', excludeEnd: true,
- contains: [
- hljs.UNDERSCORE_TITLE_MODE,
- TYPEPARAM
- ]
- },
- {
- className: 'meta',
- begin: '\\[<', end: '>\\]',
- relevance: 10
- },
- {
- className: 'symbol',
- begin: '\\B(\'[A-Za-z])\\b',
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- hljs.C_LINE_COMMENT_MODE,
- hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}),
- hljs.C_NUMBER_MODE
- ]
- };
-};
-},{}],171:[function(require,module,exports){
-module.exports = function (hljs) {
- var KEYWORDS = {
- 'keyword':
- 'abort acronym acronyms alias all and assign binary card diag display ' +
- 'else eq file files for free ge gt if integer le loop lt maximizing ' +
- 'minimizing model models ne negative no not option options or ord ' +
- 'positive prod put putpage puttl repeat sameas semicont semiint smax ' +
- 'smin solve sos1 sos2 sum system table then until using while xor yes',
- 'literal': 'eps inf na',
- 'built-in':
- 'abs arccos arcsin arctan arctan2 Beta betaReg binomial ceil centropy ' +
- 'cos cosh cvPower div div0 eDist entropy errorf execSeed exp fact ' +
- 'floor frac gamma gammaReg log logBeta logGamma log10 log2 mapVal max ' +
- 'min mod ncpCM ncpF ncpVUpow ncpVUsin normal pi poly power ' +
- 'randBinomial randLinear randTriangle round rPower sigmoid sign ' +
- 'signPower sin sinh slexp sllog10 slrec sqexp sqlog10 sqr sqrec sqrt ' +
- 'tan tanh trunc uniform uniformInt vcPower bool_and bool_eqv bool_imp ' +
- 'bool_not bool_or bool_xor ifThen rel_eq rel_ge rel_gt rel_le rel_lt ' +
- 'rel_ne gday gdow ghour gleap gmillisec gminute gmonth gsecond gyear ' +
- 'jdate jnow jstart jtime errorLevel execError gamsRelease gamsVersion ' +
- 'handleCollect handleDelete handleStatus handleSubmit heapFree ' +
- 'heapLimit heapSize jobHandle jobKill jobStatus jobTerminate ' +
- 'licenseLevel licenseStatus maxExecError sleep timeClose timeComp ' +
- 'timeElapsed timeExec timeStart'
- };
- var PARAMS = {
- className: 'params',
- begin: /\(/, end: /\)/,
- excludeBegin: true,
- excludeEnd: true,
- };
- var SYMBOLS = {
- className: 'symbol',
- variants: [
- {begin: /\=[lgenxc]=/},
- {begin: /\$/},
- ]
- };
- var QSTR = { // One-line quoted comment string
- className: 'comment',
- variants: [
- {begin: '\'', end: '\''},
- {begin: '"', end: '"'},
- ],
- illegal: '\\n',
- contains: [hljs.BACKSLASH_ESCAPE]
- };
- var ASSIGNMENT = {
- begin: '/',
- end: '/',
- keywords: KEYWORDS,
- contains: [
- QSTR,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.APOS_STRING_MODE,
- hljs.C_NUMBER_MODE,
- ],
- };
- var DESCTEXT = { // Parameter/set/variable description text
- begin: /[a-z][a-z0-9_]*(\([a-z0-9_, ]*\))?[ \t]+/,
- excludeBegin: true,
- end: '$',
- endsWithParent: true,
- contains: [
- QSTR,
- ASSIGNMENT,
- {
- className: 'comment',
- begin: /([ ]*[a-z0-9&#*=?@>\\<:\-,()$\[\]_.{}!+%^]+)+/,
- relevance: 0
- },
- ],
- };
-
- return {
- aliases: ['gms'],
- case_insensitive: true,
- keywords: KEYWORDS,
- contains: [
- hljs.COMMENT(/^\$ontext/, /^\$offtext/),
- {
- className: 'meta',
- begin: '^\\$[a-z0-9]+',
- end: '$',
- returnBegin: true,
- contains: [
- {
- className: 'meta-keyword',
- begin: '^\\$[a-z0-9]+',
- }
- ]
- },
- hljs.COMMENT('^\\*', '$'),
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.APOS_STRING_MODE,
- // Declarations
- {
- beginKeywords:
- 'set sets parameter parameters variable variables ' +
- 'scalar scalars equation equations',
- end: ';',
- contains: [
- hljs.COMMENT('^\\*', '$'),
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.APOS_STRING_MODE,
- ASSIGNMENT,
- DESCTEXT,
- ]
- },
- { // table environment
- beginKeywords: 'table',
- end: ';',
- returnBegin: true,
- contains: [
- { // table header row
- beginKeywords: 'table',
- end: '$',
- contains: [DESCTEXT],
- },
- hljs.COMMENT('^\\*', '$'),
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.APOS_STRING_MODE,
- hljs.C_NUMBER_MODE,
- // Table does not contain DESCTEXT or ASSIGNMENT
- ]
- },
- // Function definitions
- {
- className: 'function',
- begin: /^[a-z][a-z0-9_,\-+' ()$]+\.{2}/,
- returnBegin: true,
- contains: [
- { // Function title
- className: 'title',
- begin: /^[a-z0-9_]+/,
- },
- PARAMS,
- SYMBOLS,
- ],
- },
- hljs.C_NUMBER_MODE,
- SYMBOLS,
- ]
- };
-};
-},{}],172:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS = {
- keyword: 'and bool break call callexe checkinterrupt clear clearg closeall cls comlog compile ' +
- 'continue create debug declare delete disable dlibrary dllcall do dos ed edit else ' +
- 'elseif enable end endfor endif endp endo errorlog errorlogat expr external fn ' +
- 'for format goto gosub graph if keyword let lib library line load loadarray loadexe ' +
- 'loadf loadk loadm loadp loads loadx local locate loopnextindex lprint lpwidth lshow ' +
- 'matrix msym ndpclex new not open or output outwidth plot plotsym pop prcsn print ' +
- 'printdos proc push retp return rndcon rndmod rndmult rndseed run save saveall screen ' +
- 'scroll setarray show sparse stop string struct system trace trap threadfor ' +
- 'threadendfor threadbegin threadjoin threadstat threadend until use while winprint',
- built_in: 'abs acf aconcat aeye amax amean AmericanBinomCall AmericanBinomCall_Greeks AmericanBinomCall_ImpVol ' +
- 'AmericanBinomPut AmericanBinomPut_Greeks AmericanBinomPut_ImpVol AmericanBSCall AmericanBSCall_Greeks ' +
- 'AmericanBSCall_ImpVol AmericanBSPut AmericanBSPut_Greeks AmericanBSPut_ImpVol amin amult annotationGetDefaults ' +
- 'annotationSetBkd annotationSetFont annotationSetLineColor annotationSetLineStyle annotationSetLineThickness ' +
- 'annualTradingDays arccos arcsin areshape arrayalloc arrayindex arrayinit arraytomat asciiload asclabel astd ' +
- 'astds asum atan atan2 atranspose axmargin balance band bandchol bandcholsol bandltsol bandrv bandsolpd bar ' +
- 'base10 begwind besselj bessely beta box boxcox cdfBeta cdfBetaInv cdfBinomial cdfBinomialInv cdfBvn cdfBvn2 ' +
- 'cdfBvn2e cdfCauchy cdfCauchyInv cdfChic cdfChii cdfChinc cdfChincInv cdfExp cdfExpInv cdfFc cdfFnc cdfFncInv ' +
- 'cdfGam cdfGenPareto cdfHyperGeo cdfLaplace cdfLaplaceInv cdfLogistic cdfLogisticInv cdfmControlCreate cdfMvn ' +
- 'cdfMvn2e cdfMvnce cdfMvne cdfMvt2e cdfMvtce cdfMvte cdfN cdfN2 cdfNc cdfNegBinomial cdfNegBinomialInv cdfNi ' +
- 'cdfPoisson cdfPoissonInv cdfRayleigh cdfRayleighInv cdfTc cdfTci cdfTnc cdfTvn cdfWeibull cdfWeibullInv cdir ' +
- 'ceil ChangeDir chdir chiBarSquare chol choldn cholsol cholup chrs close code cols colsf combinate combinated ' +
- 'complex con cond conj cons ConScore contour conv convertsatostr convertstrtosa corrm corrms corrvc corrx corrxs ' +
- 'cos cosh counts countwts crossprd crout croutp csrcol csrlin csvReadM csvReadSA cumprodc cumsumc curve cvtos ' +
- 'datacreate datacreatecomplex datalist dataload dataloop dataopen datasave date datestr datestring datestrymd ' +
- 'dayinyr dayofweek dbAddDatabase dbClose dbCommit dbCreateQuery dbExecQuery dbGetConnectOptions dbGetDatabaseName ' +
- 'dbGetDriverName dbGetDrivers dbGetHostName dbGetLastErrorNum dbGetLastErrorText dbGetNumericalPrecPolicy ' +
- 'dbGetPassword dbGetPort dbGetTableHeaders dbGetTables dbGetUserName dbHasFeature dbIsDriverAvailable dbIsOpen ' +
- 'dbIsOpenError dbOpen dbQueryBindValue dbQueryClear dbQueryCols dbQueryExecPrepared dbQueryFetchAllM dbQueryFetchAllSA ' +
- 'dbQueryFetchOneM dbQueryFetchOneSA dbQueryFinish dbQueryGetBoundValue dbQueryGetBoundValues dbQueryGetField ' +
- 'dbQueryGetLastErrorNum dbQueryGetLastErrorText dbQueryGetLastInsertID dbQueryGetLastQuery dbQueryGetPosition ' +
- 'dbQueryIsActive dbQueryIsForwardOnly dbQueryIsNull dbQueryIsSelect dbQueryIsValid dbQueryPrepare dbQueryRows ' +
- 'dbQuerySeek dbQuerySeekFirst dbQuerySeekLast dbQuerySeekNext dbQuerySeekPrevious dbQuerySetForwardOnly ' +
- 'dbRemoveDatabase dbRollback dbSetConnectOptions dbSetDatabaseName dbSetHostName dbSetNumericalPrecPolicy ' +
- 'dbSetPort dbSetUserName dbTransaction DeleteFile delif delrows denseToSp denseToSpRE denToZero design det detl ' +
- 'dfft dffti diag diagrv digamma doswin DOSWinCloseall DOSWinOpen dotfeq dotfeqmt dotfge dotfgemt dotfgt dotfgtmt ' +
- 'dotfle dotflemt dotflt dotfltmt dotfne dotfnemt draw drop dsCreate dstat dstatmt dstatmtControlCreate dtdate dtday ' +
- 'dttime dttodtv dttostr dttoutc dtvnormal dtvtodt dtvtoutc dummy dummybr dummydn eig eigh eighv eigv elapsedTradingDays ' +
- 'endwind envget eof eqSolve eqSolvemt eqSolvemtControlCreate eqSolvemtOutCreate eqSolveset erf erfc erfccplx erfcplx error ' +
- 'etdays ethsec etstr EuropeanBinomCall EuropeanBinomCall_Greeks EuropeanBinomCall_ImpVol EuropeanBinomPut ' +
- 'EuropeanBinomPut_Greeks EuropeanBinomPut_ImpVol EuropeanBSCall EuropeanBSCall_Greeks EuropeanBSCall_ImpVol ' +
- 'EuropeanBSPut EuropeanBSPut_Greeks EuropeanBSPut_ImpVol exctsmpl exec execbg exp extern eye fcheckerr fclearerr feq ' +
- 'feqmt fflush fft ffti fftm fftmi fftn fge fgemt fgets fgetsa fgetsat fgetst fgt fgtmt fileinfo filesa fle flemt ' +
- 'floor flt fltmt fmod fne fnemt fonts fopen formatcv formatnv fputs fputst fseek fstrerror ftell ftocv ftos ftostrC ' +
- 'gamma gammacplx gammaii gausset gdaAppend gdaCreate gdaDStat gdaDStatMat gdaGetIndex gdaGetName gdaGetNames gdaGetOrders ' +
- 'gdaGetType gdaGetTypes gdaGetVarInfo gdaIsCplx gdaLoad gdaPack gdaRead gdaReadByIndex gdaReadSome gdaReadSparse ' +
- 'gdaReadStruct gdaReportVarInfo gdaSave gdaUpdate gdaUpdateAndPack gdaVars gdaWrite gdaWrite32 gdaWriteSome getarray ' +
- 'getdims getf getGAUSShome getmatrix getmatrix4D getname getnamef getNextTradingDay getNextWeekDay getnr getorders ' +
- 'getpath getPreviousTradingDay getPreviousWeekDay getRow getscalar3D getscalar4D getTrRow getwind glm gradcplx gradMT ' +
- 'gradMTm gradMTT gradMTTm gradp graphprt graphset hasimag header headermt hess hessMT hessMTg hessMTgw hessMTm ' +
- 'hessMTmw hessMTT hessMTTg hessMTTgw hessMTTm hessMTw hessp hist histf histp hsec imag indcv indexcat indices indices2 ' +
- 'indicesf indicesfn indnv indsav integrate1d integrateControlCreate intgrat2 intgrat3 inthp1 inthp2 inthp3 inthp4 ' +
- 'inthpControlCreate intquad1 intquad2 intquad3 intrleav intrleavsa intrsect intsimp inv invpd invswp iscplx iscplxf ' +
- 'isden isinfnanmiss ismiss key keyav keyw lag lag1 lagn lapEighb lapEighi lapEighvb lapEighvi lapgEig lapgEigh lapgEighv ' +
- 'lapgEigv lapgSchur lapgSvdcst lapgSvds lapgSvdst lapSvdcusv lapSvds lapSvdusv ldlp ldlsol linSolve listwise ln lncdfbvn ' +
- 'lncdfbvn2 lncdfmvn lncdfn lncdfn2 lncdfnc lnfact lngammacplx lnpdfmvn lnpdfmvt lnpdfn lnpdft loadd loadstruct loadwind ' +
- 'loess loessmt loessmtControlCreate log loglog logx logy lower lowmat lowmat1 ltrisol lu lusol machEpsilon make makevars ' +
- 'makewind margin matalloc matinit mattoarray maxbytes maxc maxindc maxv maxvec mbesselei mbesselei0 mbesselei1 mbesseli ' +
- 'mbesseli0 mbesseli1 meanc median mergeby mergevar minc minindc minv miss missex missrv moment momentd movingave ' +
- 'movingaveExpwgt movingaveWgt nextindex nextn nextnevn nextwind ntos null null1 numCombinations ols olsmt olsmtControlCreate ' +
- 'olsqr olsqr2 olsqrmt ones optn optnevn orth outtyp pacf packedToSp packr parse pause pdfCauchy pdfChi pdfExp pdfGenPareto ' +
- 'pdfHyperGeo pdfLaplace pdfLogistic pdfn pdfPoisson pdfRayleigh pdfWeibull pi pinv pinvmt plotAddArrow plotAddBar plotAddBox ' +
- 'plotAddHist plotAddHistF plotAddHistP plotAddPolar plotAddScatter plotAddShape plotAddTextbox plotAddTS plotAddXY plotArea ' +
- 'plotBar plotBox plotClearLayout plotContour plotCustomLayout plotGetDefaults plotHist plotHistF plotHistP plotLayout ' +
- 'plotLogLog plotLogX plotLogY plotOpenWindow plotPolar plotSave plotScatter plotSetAxesPen plotSetBar plotSetBarFill ' +
- 'plotSetBarStacked plotSetBkdColor plotSetFill plotSetGrid plotSetLegend plotSetLineColor plotSetLineStyle plotSetLineSymbol ' +
- 'plotSetLineThickness plotSetNewWindow plotSetTitle plotSetWhichYAxis plotSetXAxisShow plotSetXLabel plotSetXRange ' +
- 'plotSetXTicInterval plotSetXTicLabel plotSetYAxisShow plotSetYLabel plotSetYRange plotSetZAxisShow plotSetZLabel ' +
- 'plotSurface plotTS plotXY polar polychar polyeval polygamma polyint polymake polymat polymroot polymult polyroot ' +
- 'pqgwin previousindex princomp printfm printfmt prodc psi putarray putf putvals pvCreate pvGetIndex pvGetParNames ' +
- 'pvGetParVector pvLength pvList pvPack pvPacki pvPackm pvPackmi pvPacks pvPacksi pvPacksm pvPacksmi pvPutParVector ' +
- 'pvTest pvUnpack QNewton QNewtonmt QNewtonmtControlCreate QNewtonmtOutCreate QNewtonSet QProg QProgmt QProgmtInCreate ' +
- 'qqr qqre qqrep qr qre qrep qrsol qrtsol qtyr qtyre qtyrep quantile quantiled qyr qyre qyrep qz rank rankindx readr ' +
- 'real reclassify reclassifyCuts recode recserar recsercp recserrc rerun rescale reshape rets rev rfft rffti rfftip rfftn ' +
- 'rfftnp rfftp rndBernoulli rndBeta rndBinomial rndCauchy rndChiSquare rndCon rndCreateState rndExp rndGamma rndGeo rndGumbel ' +
- 'rndHyperGeo rndi rndKMbeta rndKMgam rndKMi rndKMn rndKMnb rndKMp rndKMu rndKMvm rndLaplace rndLCbeta rndLCgam rndLCi rndLCn ' +
- 'rndLCnb rndLCp rndLCu rndLCvm rndLogNorm rndMTu rndMVn rndMVt rndn rndnb rndNegBinomial rndp rndPoisson rndRayleigh ' +
- 'rndStateSkip rndu rndvm rndWeibull rndWishart rotater round rows rowsf rref sampleData satostrC saved saveStruct savewind ' +
- 'scale scale3d scalerr scalinfnanmiss scalmiss schtoc schur searchsourcepath seekr select selif seqa seqm setdif setdifsa ' +
- 'setvars setvwrmode setwind shell shiftr sin singleindex sinh sleep solpd sortc sortcc sortd sorthc sorthcc sortind ' +
- 'sortindc sortmc sortr sortrc spBiconjGradSol spChol spConjGradSol spCreate spDenseSubmat spDiagRvMat spEigv spEye spLDL ' +
- 'spline spLU spNumNZE spOnes spreadSheetReadM spreadSheetReadSA spreadSheetWrite spScale spSubmat spToDense spTrTDense ' +
- 'spTScalar spZeros sqpSolve sqpSolveMT sqpSolveMTControlCreate sqpSolveMTlagrangeCreate sqpSolveMToutCreate sqpSolveSet ' +
- 'sqrt statements stdc stdsc stocv stof strcombine strindx strlen strput strrindx strsect strsplit strsplitPad strtodt ' +
- 'strtof strtofcplx strtriml strtrimr strtrunc strtruncl strtruncpad strtruncr submat subscat substute subvec sumc sumr ' +
- 'surface svd svd1 svd2 svdcusv svds svdusv sysstate tab tan tanh tempname threadBegin threadEnd threadEndFor threadFor ' +
- 'threadJoin threadStat time timedt timestr timeutc title tkf2eps tkf2ps tocart todaydt toeplitz token topolar trapchk ' +
- 'trigamma trimr trunc type typecv typef union unionsa uniqindx uniqindxsa unique uniquesa upmat upmat1 upper utctodt ' +
- 'utctodtv utrisol vals varCovMS varCovXS varget vargetl varmall varmares varput varputl vartypef vcm vcms vcx vcxs ' +
- 'vec vech vecr vector vget view viewxyz vlist vnamecv volume vput vread vtypecv wait waitc walkindex where window ' +
- 'writer xlabel xlsGetSheetCount xlsGetSheetSize xlsGetSheetTypes xlsMakeRange xlsReadM xlsReadSA xlsWrite xlsWriteM ' +
- 'xlsWriteSA xpnd xtics xy xyz ylabel ytics zeros zeta zlabel ztics cdfEmpirical dot h5create h5open h5read h5readAttribute ' +
- 'h5write h5writeAttribute ldl plotAddErrorBar plotAddSurface plotCDFEmpirical plotSetColormap plotSetContourLabels ' +
- 'plotSetLegendFont plotSetTextInterpreter plotSetXTicCount plotSetYTicCount plotSetZLevels powerm strjoin strtrim sylvester',
- literal: 'DB_AFTER_LAST_ROW DB_ALL_TABLES DB_BATCH_OPERATIONS DB_BEFORE_FIRST_ROW DB_BLOB DB_EVENT_NOTIFICATIONS ' +
- 'DB_FINISH_QUERY DB_HIGH_PRECISION DB_LAST_INSERT_ID DB_LOW_PRECISION_DOUBLE DB_LOW_PRECISION_INT32 ' +
- 'DB_LOW_PRECISION_INT64 DB_LOW_PRECISION_NUMBERS DB_MULTIPLE_RESULT_SETS DB_NAMED_PLACEHOLDERS ' +
- 'DB_POSITIONAL_PLACEHOLDERS DB_PREPARED_QUERIES DB_QUERY_SIZE DB_SIMPLE_LOCKING DB_SYSTEM_TABLES DB_TABLES ' +
- 'DB_TRANSACTIONS DB_UNICODE DB_VIEWS'
- };
-
- var PREPROCESSOR =
- {
- className: 'meta',
- begin: '#', end: '$',
- keywords: {'meta-keyword': 'define definecs|10 undef ifdef ifndef iflight ifdllcall ifmac ifos2win ifunix else endif lineson linesoff srcfile srcline'},
- contains: [
- {
- begin: /\\\n/, relevance: 0
- },
- {
- beginKeywords: 'include', end: '$',
- keywords: {'meta-keyword': 'include'},
- contains: [
- {
- className: 'meta-string',
- begin: '"', end: '"',
- illegal: '\\n'
- }
- ]
- },
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- };
-
- var FUNCTION_TITLE = hljs.UNDERSCORE_IDENT_RE + '\\s*\\(?';
- var PARSE_PARAMS = [
- {
- className: 'params',
- begin: /\(/, end: /\)/,
- keywords: KEYWORDS,
- relevance: 0,
- contains: [
- hljs.C_NUMBER_MODE,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- }
- ];
-
- return {
- aliases: ['gss'],
- case_insensitive: true, // language is case-insensitive
- keywords: KEYWORDS,
- illegal: '(\\{[%#]|[%#]\\})',
- contains: [
- hljs.C_NUMBER_MODE,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.COMMENT('@', '@'),
- PREPROCESSOR,
- {
- className: 'string',
- begin: '"', end: '"',
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- className: 'function',
- beginKeywords: 'proc keyword',
- end: ';',
- excludeEnd: true,
- keywords: KEYWORDS,
- contains: [
- {
- begin: FUNCTION_TITLE, returnBegin: true,
- contains: [hljs.UNDERSCORE_TITLE_MODE],
- relevance: 0
- },
- hljs.C_NUMBER_MODE,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- PREPROCESSOR
- ].concat(PARSE_PARAMS)
- },
- {
- className: 'function',
- beginKeywords: 'fn',
- end: ';',
- excludeEnd: true,
- keywords: KEYWORDS,
- contains: [
- {
- begin: FUNCTION_TITLE + hljs.IDENT_RE + '\\)?\\s*\\=\\s*', returnBegin: true,
- contains: [hljs.UNDERSCORE_TITLE_MODE],
- relevance: 0
- },
- hljs.C_NUMBER_MODE,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ].concat(PARSE_PARAMS)
- },
- {
- className: 'function',
- begin: '\\bexternal (proc|keyword|fn)\\s+',
- end: ';',
- excludeEnd: true,
- keywords: KEYWORDS,
- contains: [
- {
- begin: FUNCTION_TITLE, returnBegin: true,
- contains: [hljs.UNDERSCORE_TITLE_MODE],
- relevance: 0
- },
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- },
- {
- className: 'function',
- begin: '\\bexternal (matrix|string|array|sparse matrix|struct ' + hljs.IDENT_RE + ')\\s+',
- end: ';',
- excludeEnd: true,
- keywords: KEYWORDS,
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- }
- ]
- };
-};
-},{}],173:[function(require,module,exports){
-module.exports = function(hljs) {
- var GCODE_IDENT_RE = '[A-Z_][A-Z0-9_.]*';
- var GCODE_CLOSE_RE = '\\%';
- var GCODE_KEYWORDS =
- 'IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT ' +
- 'EQ LT GT NE GE LE OR XOR';
- var GCODE_START = {
- className: 'meta',
- begin: '([O])([0-9]+)'
- };
- var GCODE_CODE = [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.COMMENT(/\(/, /\)/),
- hljs.inherit(hljs.C_NUMBER_MODE, {begin: '([-+]?([0-9]*\\.?[0-9]+\\.?))|' + hljs.C_NUMBER_RE}),
- hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}),
- hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}),
- {
- className: 'name',
- begin: '([G])([0-9]+\\.?[0-9]?)'
- },
- {
- className: 'name',
- begin: '([M])([0-9]+\\.?[0-9]?)'
- },
- {
- className: 'attr',
- begin: '(VC|VS|#)',
- end: '(\\d+)'
- },
- {
- className: 'attr',
- begin: '(VZOFX|VZOFY|VZOFZ)'
- },
- {
- className: 'built_in',
- begin: '(ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN)(\\[)',
- end: '([-+]?([0-9]*\\.?[0-9]+\\.?))(\\])'
- },
- {
- className: 'symbol',
- variants: [
- {
- begin: 'N', end: '\\d+',
- illegal: '\\W'
- }
- ]
- }
- ];
-
- return {
- aliases: ['nc'],
- // Some implementations (CNC controls) of G-code are interoperable with uppercase and lowercase letters seamlessly.
- // However, most prefer all uppercase and uppercase is customary.
- case_insensitive: true,
- lexemes: GCODE_IDENT_RE,
- keywords: GCODE_KEYWORDS,
- contains: [
- {
- className: 'meta',
- begin: GCODE_CLOSE_RE
- },
- GCODE_START
- ].concat(GCODE_CODE)
- };
-};
-},{}],174:[function(require,module,exports){
-module.exports = function (hljs) {
- return {
- aliases: ['feature'],
- keywords: 'Feature Background Ability Business\ Need Scenario Scenarios Scenario\ Outline Scenario\ Template Examples Given And Then But When',
- contains: [
- {
- className: 'symbol',
- begin: '\\*',
- relevance: 0
- },
- {
- className: 'meta',
- begin: '@[^@\\s]+'
- },
- {
- begin: '\\|', end: '\\|\\w*$',
- contains: [
- {
- className: 'string',
- begin: '[^|]+'
- }
- ]
- },
- {
- className: 'variable',
- begin: '<', end: '>'
- },
- hljs.HASH_COMMENT_MODE,
- {
- className: 'string',
- begin: '"""', end: '"""'
- },
- hljs.QUOTE_STRING_MODE
- ]
- };
-};
-},{}],175:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- keywords: {
- keyword:
- // Statements
- 'break continue discard do else for if return while switch case default ' +
- // Qualifiers
- 'attribute binding buffer ccw centroid centroid varying coherent column_major const cw ' +
- 'depth_any depth_greater depth_less depth_unchanged early_fragment_tests equal_spacing ' +
- 'flat fractional_even_spacing fractional_odd_spacing highp in index inout invariant ' +
- 'invocations isolines layout line_strip lines lines_adjacency local_size_x local_size_y ' +
- 'local_size_z location lowp max_vertices mediump noperspective offset origin_upper_left ' +
- 'out packed patch pixel_center_integer point_mode points precise precision quads r11f_g11f_b10f '+
- 'r16 r16_snorm r16f r16i r16ui r32f r32i r32ui r8 r8_snorm r8i r8ui readonly restrict ' +
- 'rg16 rg16_snorm rg16f rg16i rg16ui rg32f rg32i rg32ui rg8 rg8_snorm rg8i rg8ui rgb10_a2 ' +
- 'rgb10_a2ui rgba16 rgba16_snorm rgba16f rgba16i rgba16ui rgba32f rgba32i rgba32ui rgba8 ' +
- 'rgba8_snorm rgba8i rgba8ui row_major sample shared smooth std140 std430 stream triangle_strip ' +
- 'triangles triangles_adjacency uniform varying vertices volatile writeonly',
- type:
- 'atomic_uint bool bvec2 bvec3 bvec4 dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 ' +
- 'dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 double dvec2 dvec3 dvec4 float iimage1D iimage1DArray ' +
- 'iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer' +
- 'iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray ' +
- 'image2DRect image3D imageBuffer imageCube imageCubeArray int isampler1D isampler1DArray ' +
- 'isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D ' +
- 'isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 mat2 mat2x2 mat2x3 ' +
- 'mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 sampler1D sampler1DArray ' +
- 'sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow ' +
- 'sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D ' +
- 'samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow ' +
- 'image1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect ' +
- 'uimage3D uimageBuffer uimageCube uimageCubeArray uint usampler1D usampler1DArray ' +
- 'usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D ' +
- 'samplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 vec2 vec3 vec4 void',
- built_in:
- // Constants
- 'gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes ' +
- 'gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms ' +
- 'gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxComputeAtomicCounterBuffers ' +
- 'gl_MaxComputeAtomicCounters gl_MaxComputeImageUniforms gl_MaxComputeTextureImageUnits ' +
- 'gl_MaxComputeUniformComponents gl_MaxComputeWorkGroupCount gl_MaxComputeWorkGroupSize ' +
- 'gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters ' +
- 'gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentInputVectors ' +
- 'gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers ' +
- 'gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents ' +
- 'gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits ' +
- 'gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents ' +
- 'gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset ' +
- 'gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms ' +
- 'gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits ' +
- 'gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents ' +
- 'gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters ' +
- 'gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents ' +
- 'gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents ' +
- 'gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits ' +
- 'gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors ' +
- 'gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms ' +
- 'gl_MaxVertexOutputComponents gl_MaxVertexOutputVectors gl_MaxVertexTextureImageUnits ' +
- 'gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffset ' +
- // Variables
- 'gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial ' +
- 'gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color ' +
- 'gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord ' +
- 'gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor ' +
- 'gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial ' +
- 'gl_FrontSecondaryColor gl_GlobalInvocationID gl_InstanceID gl_InvocationID gl_Layer gl_LightModel ' +
- 'gl_LightSource gl_LocalInvocationID gl_LocalInvocationIndex gl_ModelViewMatrix ' +
- 'gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose ' +
- 'gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose ' +
- 'gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 ' +
- 'gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 ' +
- 'gl_Normal gl_NormalMatrix gl_NormalScale gl_NumSamples gl_NumWorkGroups gl_ObjectPlaneQ ' +
- 'gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_Point gl_PointCoord ' +
- 'gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse ' +
- 'gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask ' +
- 'gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter ' +
- 'gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose ' +
- 'gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_WorkGroupID gl_WorkGroupSize gl_in gl_out ' +
- // Functions
- 'EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin ' +
- 'asinh atan atanh atomicAdd atomicAnd atomicCompSwap atomicCounter atomicCounterDecrement ' +
- 'atomicCounterIncrement atomicExchange atomicMax atomicMin atomicOr atomicXor barrier ' +
- 'bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross ' +
- 'dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB ' +
- 'floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan ' +
- 'greaterThanEqual groupMemoryBarrier imageAtomicAdd imageAtomicAnd imageAtomicCompSwap ' +
- 'imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad ' +
- 'imageSize imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset ' +
- 'interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log ' +
- 'log2 matrixCompMult max memoryBarrier memoryBarrierAtomicCounter memoryBarrierBuffer ' +
- 'memoryBarrierImage memoryBarrierShared min mix mod modf noise1 noise2 noise3 noise4 ' +
- 'normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 ' +
- 'packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod ' +
- 'shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh ' +
- 'smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod ' +
- 'texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod ' +
- 'texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod ' +
- 'textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset ' +
- 'textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset ' +
- 'textureProjLod textureProjLodOffset textureProjOffset textureQueryLevels textureQueryLod ' +
- 'textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 ' +
- 'unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow',
- literal: 'true false'
- },
- illegal: '"',
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.C_NUMBER_MODE,
- {
- className: 'meta',
- begin: '#', end: '$'
- }
- ]
- };
-};
-},{}],176:[function(require,module,exports){
-module.exports = function(hljs) {
- var GO_KEYWORDS = {
- keyword:
- 'break default func interface select case map struct chan else goto package switch ' +
- 'const fallthrough if range type continue for import return var go defer ' +
- 'bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 ' +
- 'uint16 uint32 uint64 int uint uintptr rune',
- literal:
- 'true false iota nil',
- built_in:
- 'append cap close complex copy imag len make new panic print println real recover delete'
- };
- return {
- aliases: ['golang'],
- keywords: GO_KEYWORDS,
- illegal: '</',
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- {
- className: 'string',
- variants: [
- hljs.QUOTE_STRING_MODE,
- {begin: '\'', end: '[^\\\\]\''},
- {begin: '`', end: '`'},
- ]
- },
- {
- className: 'number',
- variants: [
- {begin: hljs.C_NUMBER_RE + '[dflsi]', relevance: 1},
- hljs.C_NUMBER_MODE
- ]
- },
- {
- begin: /:=/ // relevance booster
- },
- {
- className: 'function',
- beginKeywords: 'func', end: /\s*\{/, excludeEnd: true,
- contains: [
- hljs.TITLE_MODE,
- {
- className: 'params',
- begin: /\(/, end: /\)/,
- keywords: GO_KEYWORDS,
- illegal: /["']/
- }
- ]
- }
- ]
- };
-};
-},{}],177:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- keywords: {
- keyword:
- 'println readln print import module function local return let var ' +
- 'while for foreach times in case when match with break continue ' +
- 'augment augmentation each find filter reduce ' +
- 'if then else otherwise try catch finally raise throw orIfNull ' +
- 'DynamicObject|10 DynamicVariable struct Observable map set vector list array',
- literal:
- 'true false null'
- },
- contains: [
- hljs.HASH_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE,
- {
- className: 'meta', begin: '@[A-Za-z]+'
- }
- ]
- }
-};
-},{}],178:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- case_insensitive: true,
- keywords: {
- keyword:
- 'task project allprojects subprojects artifacts buildscript configurations ' +
- 'dependencies repositories sourceSets description delete from into include ' +
- 'exclude source classpath destinationDir includes options sourceCompatibility ' +
- 'targetCompatibility group flatDir doLast doFirst flatten todir fromdir ant ' +
- 'def abstract break case catch continue default do else extends final finally ' +
- 'for if implements instanceof native new private protected public return static ' +
- 'switch synchronized throw throws transient try volatile while strictfp package ' +
- 'import false null super this true antlrtask checkstyle codenarc copy boolean ' +
- 'byte char class double float int interface long short void compile runTime ' +
- 'file fileTree abs any append asList asWritable call collect compareTo count ' +
- 'div dump each eachByte eachFile eachLine every find findAll flatten getAt ' +
- 'getErr getIn getOut getText grep immutable inject inspect intersect invokeMethods ' +
- 'isCase join leftShift minus multiply newInputStream newOutputStream newPrintWriter ' +
- 'newReader newWriter next plus pop power previous print println push putAt read ' +
- 'readBytes readLines reverse reverseEach round size sort splitEachLine step subMap ' +
- 'times toInteger toList tokenize upto waitForOrKill withPrintWriter withReader ' +
- 'withStream withWriter withWriterAppend write writeLine'
- },
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.NUMBER_MODE,
- hljs.REGEXP_MODE
-
- ]
- }
-};
-},{}],179:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- keywords: {
- literal : 'true false null',
- keyword:
- 'byte short char int long boolean float double void ' +
- // groovy specific keywords
- 'def as in assert trait ' +
- // common keywords with Java
- 'super this abstract static volatile transient public private protected synchronized final ' +
- 'class interface enum if else for while switch case break default continue ' +
- 'throw throws try catch finally implements extends new import package return instanceof'
- },
-
- contains: [
- hljs.COMMENT(
- '/\\*\\*',
- '\\*/',
- {
- relevance : 0,
- contains : [
- {
- // eat up @'s in emails to prevent them to be recognized as doctags
- begin: /\w+@/, relevance: 0
- },
- {
- className : 'doctag',
- begin : '@[A-Za-z]+'
- }
- ]
- }
- ),
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- {
- className: 'string',
- begin: '"""', end: '"""'
- },
- {
- className: 'string',
- begin: "'''", end: "'''"
- },
- {
- className: 'string',
- begin: "\\$/", end: "/\\$",
- relevance: 10
- },
- hljs.APOS_STRING_MODE,
- {
- className: 'regexp',
- begin: /~?\/[^\/\n]+\//,
- contains: [
- hljs.BACKSLASH_ESCAPE
- ]
- },
- hljs.QUOTE_STRING_MODE,
- {
- className: 'meta',
- begin: "^#!/usr/bin/env", end: '$',
- illegal: '\n'
- },
- hljs.BINARY_NUMBER_MODE,
- {
- className: 'class',
- beginKeywords: 'class interface trait enum', end: '{',
- illegal: ':',
- contains: [
- {beginKeywords: 'extends implements'},
- hljs.UNDERSCORE_TITLE_MODE
- ]
- },
- hljs.C_NUMBER_MODE,
- {
- className: 'meta', begin: '@[A-Za-z]+'
- },
- {
- // highlight map keys and named parameters as strings
- className: 'string', begin: /[^\?]{0}[A-Za-z0-9_$]+ *:/
- },
- {
- // catch middle element of the ternary operator
- // to avoid highlight it as a label, named parameter, or map key
- begin: /\?/, end: /\:/
- },
- {
- // highlight labeled statements
- className: 'symbol', begin: '^\\s*[A-Za-z0-9_$]+:',
- relevance: 0
- }
- ],
- illegal: /#|<\//
- }
-};
-},{}],180:[function(require,module,exports){
-module.exports = // TODO support filter tags like :javascript, support inline HTML
-function(hljs) {
- return {
- case_insensitive: true,
- contains: [
- {
- className: 'meta',
- begin: '^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$',
- relevance: 10
- },
- // FIXME these comments should be allowed to span indented lines
- hljs.COMMENT(
- '^\\s*(!=#|=#|-#|/).*$',
- false,
- {
- relevance: 0
- }
- ),
- {
- begin: '^\\s*(-|=|!=)(?!#)',
- starts: {
- end: '\\n',
- subLanguage: 'ruby'
- }
- },
- {
- className: 'tag',
- begin: '^\\s*%',
- contains: [
- {
- className: 'selector-tag',
- begin: '\\w+'
- },
- {
- className: 'selector-id',
- begin: '#[\\w-]+'
- },
- {
- className: 'selector-class',
- begin: '\\.[\\w-]+'
- },
- {
- begin: '{\\s*',
- end: '\\s*}',
- contains: [
- {
- begin: ':\\w+\\s*=>',
- end: ',\\s+',
- returnBegin: true,
- endsWithParent: true,
- contains: [
- {
- className: 'attr',
- begin: ':\\w+'
- },
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- {
- begin: '\\w+',
- relevance: 0
- }
- ]
- }
- ]
- },
- {
- begin: '\\(\\s*',
- end: '\\s*\\)',
- excludeEnd: true,
- contains: [
- {
- begin: '\\w+\\s*=',
- end: '\\s+',
- returnBegin: true,
- endsWithParent: true,
- contains: [
- {
- className: 'attr',
- begin: '\\w+',
- relevance: 0
- },
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- {
- begin: '\\w+',
- relevance: 0
- }
- ]
- }
- ]
- }
- ]
- },
- {
- begin: '^\\s*[=~]\\s*'
- },
- {
- begin: '#{',
- starts: {
- end: '}',
- subLanguage: 'ruby'
- }
- }
- ]
- };
-};
-},{}],181:[function(require,module,exports){
-module.exports = function(hljs) {
- var BUILT_INS = {'builtin-name': 'each in with if else unless bindattr action collection debugger log outlet template unbound view yield'};
- return {
- aliases: ['hbs', 'html.hbs', 'html.handlebars'],
- case_insensitive: true,
- subLanguage: 'xml',
- contains: [
- hljs.COMMENT('{{!(--)?', '(--)?}}'),
- {
- className: 'template-tag',
- begin: /\{\{[#\/]/, end: /\}\}/,
- contains: [
- {
- className: 'name',
- begin: /[a-zA-Z\.-]+/,
- keywords: BUILT_INS,
- starts: {
- endsWithParent: true, relevance: 0,
- contains: [
- hljs.QUOTE_STRING_MODE
- ]
- }
- }
- ]
- },
- {
- className: 'template-variable',
- begin: /\{\{/, end: /\}\}/,
- keywords: BUILT_INS
- }
- ]
- };
-};
-},{}],182:[function(require,module,exports){
-module.exports = function(hljs) {
- var COMMENT = {
- variants: [
- hljs.COMMENT('--', '$'),
- hljs.COMMENT(
- '{-',
- '-}',
- {
- contains: ['self']
- }
- )
- ]
- };
-
- var PRAGMA = {
- className: 'meta',
- begin: '{-#', end: '#-}'
- };
-
- var PREPROCESSOR = {
- className: 'meta',
- begin: '^#', end: '$'
- };
-
- var CONSTRUCTOR = {
- className: 'type',
- begin: '\\b[A-Z][\\w\']*', // TODO: other constructors (build-in, infix).
- relevance: 0
- };
-
- var LIST = {
- begin: '\\(', end: '\\)',
- illegal: '"',
- contains: [
- PRAGMA,
- PREPROCESSOR,
- {className: 'type', begin: '\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?'},
- hljs.inherit(hljs.TITLE_MODE, {begin: '[_a-z][\\w\']*'}),
- COMMENT
- ]
- };
-
- var RECORD = {
- begin: '{', end: '}',
- contains: LIST.contains
- };
-
- return {
- aliases: ['hs'],
- keywords:
- 'let in if then else case of where do module import hiding ' +
- 'qualified type data newtype deriving class instance as default ' +
- 'infix infixl infixr foreign export ccall stdcall cplusplus ' +
- 'jvm dotnet safe unsafe family forall mdo proc rec',
- contains: [
-
- // Top-level constructions.
-
- {
- beginKeywords: 'module', end: 'where',
- keywords: 'module where',
- contains: [LIST, COMMENT],
- illegal: '\\W\\.|;'
- },
- {
- begin: '\\bimport\\b', end: '$',
- keywords: 'import qualified as hiding',
- contains: [LIST, COMMENT],
- illegal: '\\W\\.|;'
- },
-
- {
- className: 'class',
- begin: '^(\\s*)?(class|instance)\\b', end: 'where',
- keywords: 'class family instance where',
- contains: [CONSTRUCTOR, LIST, COMMENT]
- },
- {
- className: 'class',
- begin: '\\b(data|(new)?type)\\b', end: '$',
- keywords: 'data family type newtype deriving',
- contains: [PRAGMA, CONSTRUCTOR, LIST, RECORD, COMMENT]
- },
- {
- beginKeywords: 'default', end: '$',
- contains: [CONSTRUCTOR, LIST, COMMENT]
- },
- {
- beginKeywords: 'infix infixl infixr', end: '$',
- contains: [hljs.C_NUMBER_MODE, COMMENT]
- },
- {
- begin: '\\bforeign\\b', end: '$',
- keywords: 'foreign import export ccall stdcall cplusplus jvm ' +
- 'dotnet safe unsafe',
- contains: [CONSTRUCTOR, hljs.QUOTE_STRING_MODE, COMMENT]
- },
- {
- className: 'meta',
- begin: '#!\\/usr\\/bin\\/env\ runhaskell', end: '$'
- },
-
- // "Whitespaces".
-
- PRAGMA,
- PREPROCESSOR,
-
- // Literals and names.
-
- // TODO: characters.
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE,
- CONSTRUCTOR,
- hljs.inherit(hljs.TITLE_MODE, {begin: '^[_a-z][\\w\']*'}),
-
- COMMENT,
-
- {begin: '->|<-'} // No markup, relevance booster
- ]
- };
-};
-},{}],183:[function(require,module,exports){
-module.exports = function(hljs) {
- var IDENT_RE = '[a-zA-Z_$][a-zA-Z0-9_$]*';
- var IDENT_FUNC_RETURN_TYPE_RE = '([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)';
-
- var HAXE_BASIC_TYPES = 'Int Float String Bool Dynamic Void Array ';
-
- return {
- aliases: ['hx'],
- keywords: {
- keyword: 'break case cast catch continue default do dynamic else enum extern ' +
- 'for function here if import in inline never new override package private get set ' +
- 'public return static super switch this throw trace try typedef untyped using var while ' +
- HAXE_BASIC_TYPES,
- built_in:
- 'trace this',
- literal:
- 'true false null _'
- },
- contains: [
- { className: 'string', // interpolate-able strings
- begin: '\'', end: '\'',
- contains: [
- hljs.BACKSLASH_ESCAPE,
- { className: 'subst', // interpolation
- begin: '\\$\\{', end: '\\}'
- },
- { className: 'subst', // interpolation
- begin: '\\$', end: '\\W}'
- }
- ]
- },
- hljs.QUOTE_STRING_MODE,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.C_NUMBER_MODE,
- { className: 'meta', // compiler meta
- begin: '@:', end: '$'
- },
- { className: 'meta', // compiler conditionals
- begin: '#', end: '$',
- keywords: {'meta-keyword': 'if else elseif end error'}
- },
- { className: 'type', // function types
- begin: ':[ \t]*', end: '[^A-Za-z0-9_ \t\\->]',
- excludeBegin: true, excludeEnd: true,
- relevance: 0
- },
- { className: 'type', // types
- begin: ':[ \t]*', end: '\\W',
- excludeBegin: true, excludeEnd: true
- },
- { className: 'type', // instantiation
- begin: 'new *', end: '\\W',
- excludeBegin: true, excludeEnd: true
- },
- { className: 'class', // enums
- beginKeywords: 'enum', end: '\\{',
- contains: [
- hljs.TITLE_MODE
- ]
- },
- { className: 'class', // abstracts
- beginKeywords: 'abstract', end: '[\\{$]',
- contains: [
- { className: 'type',
- begin: '\\(', end: '\\)',
- excludeBegin: true, excludeEnd: true
- },
- { className: 'type',
- begin: 'from +', end: '\\W',
- excludeBegin: true, excludeEnd: true
- },
- { className: 'type',
- begin: 'to +', end: '\\W',
- excludeBegin: true, excludeEnd: true
- },
- hljs.TITLE_MODE
- ],
- keywords: {
- keyword: 'abstract from to'
- }
- },
- { className: 'class', // classes
- begin: '\\b(class|interface) +', end: '[\\{$]', excludeEnd: true,
- keywords: 'class interface',
- contains: [
- { className: 'keyword',
- begin: '\\b(extends|implements) +',
- keywords: 'extends implements',
- contains: [
- {
- className: 'type',
- begin: hljs.IDENT_RE,
- relevance: 0
- }
- ]
- },
- hljs.TITLE_MODE
- ]
- },
- { className: 'function',
- beginKeywords: 'function', end: '\\(', excludeEnd: true,
- illegal: '\\S',
- contains: [
- hljs.TITLE_MODE
- ]
- }
- ],
- illegal: /<\//
- };
-};
-},{}],184:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- case_insensitive: true,
- lexemes: /[\w\._]+/,
- keywords: 'goto gosub return break repeat loop continue wait await dim sdim foreach dimtype dup dupptr end stop newmod delmod mref run exgoto on mcall assert logmes newlab resume yield onexit onerror onkey onclick oncmd exist delete mkdir chdir dirlist bload bsave bcopy memfile if else poke wpoke lpoke getstr chdpm memexpand memcpy memset notesel noteadd notedel noteload notesave randomize noteunsel noteget split strrep setease button chgdisp exec dialog mmload mmplay mmstop mci pset pget syscolor mes print title pos circle cls font sysfont objsize picload color palcolor palette redraw width gsel gcopy gzoom gmode bmpsave hsvcolor getkey listbox chkbox combox input mesbox buffer screen bgscr mouse objsel groll line clrobj boxf objprm objmode stick grect grotate gsquare gradf objimage objskip objenable celload celdiv celput newcom querycom delcom cnvstow comres axobj winobj sendmsg comevent comevarg sarrayconv callfunc cnvwtos comevdisp libptr system hspstat hspver stat cnt err strsize looplev sublev iparam wparam lparam refstr refdval int rnd strlen length length2 length3 length4 vartype gettime peek wpeek lpeek varptr varuse noteinfo instr abs limit getease str strmid strf getpath strtrim sin cos tan atan sqrt double absf expf logf limitf powf geteasef mousex mousey mousew hwnd hinstance hdc ginfo objinfo dirinfo sysinfo thismod __hspver__ __hsp30__ __date__ __time__ __line__ __file__ _debug __hspdef__ and or xor not screen_normal screen_palette screen_hide screen_fixedsize screen_tool screen_frame gmode_gdi gmode_mem gmode_rgb0 gmode_alpha gmode_rgb0alpha gmode_add gmode_sub gmode_pixela ginfo_mx ginfo_my ginfo_act ginfo_sel ginfo_wx1 ginfo_wy1 ginfo_wx2 ginfo_wy2 ginfo_vx ginfo_vy ginfo_sizex ginfo_sizey ginfo_winx ginfo_winy ginfo_mesx ginfo_mesy ginfo_r ginfo_g ginfo_b ginfo_paluse ginfo_dispx ginfo_dispy ginfo_cx ginfo_cy ginfo_intid ginfo_newid ginfo_sx ginfo_sy objinfo_mode objinfo_bmscr objinfo_hwnd notemax notesize dir_cur dir_exe dir_win dir_sys dir_cmdline dir_desktop dir_mydoc dir_tv font_normal font_bold font_italic font_underline font_strikeout font_antialias objmode_normal objmode_guifont objmode_usefont gsquare_grad msgothic msmincho do until while wend for next _break _continue switch case default swbreak swend ddim ldim alloc m_pi rad2deg deg2rad ease_linear ease_quad_in ease_quad_out ease_quad_inout ease_cubic_in ease_cubic_out ease_cubic_inout ease_quartic_in ease_quartic_out ease_quartic_inout ease_bounce_in ease_bounce_out ease_bounce_inout ease_shake_in ease_shake_out ease_shake_inout ease_loop',
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.APOS_STRING_MODE,
-
- {
- // multi-line string
- className: 'string',
- begin: '{"', end: '"}',
- contains: [hljs.BACKSLASH_ESCAPE]
- },
-
- hljs.COMMENT(';', '$', {relevance: 0}),
-
- {
- // pre-processor
- className: 'meta',
- begin: '#', end: '$',
- keywords: {'meta-keyword': 'addion cfunc cmd cmpopt comfunc const defcfunc deffunc define else endif enum epack func global if ifdef ifndef include modcfunc modfunc modinit modterm module pack packopt regcmd runtime undef usecom uselib'},
- contains: [
- hljs.inherit(hljs.QUOTE_STRING_MODE, {className: 'meta-string'}),
- hljs.NUMBER_MODE,
- hljs.C_NUMBER_MODE,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- },
-
- {
- // label
- className: 'symbol',
- begin: '^\\*(\\w+|@)'
- },
-
- hljs.NUMBER_MODE,
- hljs.C_NUMBER_MODE
- ]
- };
-};
-},{}],185:[function(require,module,exports){
-module.exports = function(hljs) {
- var BUILT_INS = 'action collection component concat debugger each each-in else get hash if input link-to loc log mut outlet partial query-params render textarea unbound unless with yield view';
-
- var ATTR_ASSIGNMENT = {
- illegal: /\}\}/,
- begin: /[a-zA-Z0-9_]+=/,
- returnBegin: true,
- relevance: 0,
- contains: [
- {
- className: 'attr', begin: /[a-zA-Z0-9_]+/
- }
- ]
- };
-
- var SUB_EXPR = {
- illegal: /\}\}/,
- begin: /\)/, end: /\)/,
- contains: [
- {
- begin: /[a-zA-Z\.\-]+/,
- keywords: {built_in: BUILT_INS},
- starts: {
- endsWithParent: true, relevance: 0,
- contains: [
- hljs.QUOTE_STRING_MODE,
- ]
- }
- }
- ]
- };
-
- var TAG_INNARDS = {
- endsWithParent: true, relevance: 0,
- keywords: {keyword: 'as', built_in: BUILT_INS},
- contains: [
- hljs.QUOTE_STRING_MODE,
- ATTR_ASSIGNMENT,
- hljs.NUMBER_MODE
- ]
- };
-
- return {
- case_insensitive: true,
- subLanguage: 'xml',
- contains: [
- hljs.COMMENT('{{!(--)?', '(--)?}}'),
- {
- className: 'template-tag',
- begin: /\{\{[#\/]/, end: /\}\}/,
- contains: [
- {
- className: 'name',
- begin: /[a-zA-Z\.\-]+/,
- keywords: {'builtin-name': BUILT_INS},
- starts: TAG_INNARDS
- }
- ]
- },
- {
- className: 'template-variable',
- begin: /\{\{[a-zA-Z][a-zA-Z\-]+/, end: /\}\}/,
- keywords: {keyword: 'as', built_in: BUILT_INS},
- contains: [
- hljs.QUOTE_STRING_MODE
- ]
- }
- ]
- };
-};
-},{}],186:[function(require,module,exports){
-module.exports = function(hljs) {
- var VERSION = 'HTTP/[0-9\\.]+';
- return {
- aliases: ['https'],
- illegal: '\\S',
- contains: [
- {
- begin: '^' + VERSION, end: '$',
- contains: [{className: 'number', begin: '\\b\\d{3}\\b'}]
- },
- {
- begin: '^[A-Z]+ (.*?) ' + VERSION + '$', returnBegin: true, end: '$',
- contains: [
- {
- className: 'string',
- begin: ' ', end: ' ',
- excludeBegin: true, excludeEnd: true
- },
- {
- begin: VERSION
- },
- {
- className: 'keyword',
- begin: '[A-Z]+'
- }
- ]
- },
- {
- className: 'attribute',
- begin: '^\\w', end: ': ', excludeEnd: true,
- illegal: '\\n|\\s|=',
- starts: {end: '$', relevance: 0}
- },
- {
- begin: '\\n\\n',
- starts: {subLanguage: [], endsWithParent: true}
- }
- ]
- };
-};
-},{}],187:[function(require,module,exports){
-module.exports = function(hljs) {
- var keywords = {
- 'builtin-name':
- // keywords
- '!= % %= & &= * ** **= *= *map ' +
- '+ += , --build-class-- --import-- -= . / // //= ' +
- '/= < << <<= <= = > >= >> >>= ' +
- '@ @= ^ ^= abs accumulate all and any ap-compose ' +
- 'ap-dotimes ap-each ap-each-while ap-filter ap-first ap-if ap-last ap-map ap-map-when ap-pipe ' +
- 'ap-reduce ap-reject apply as-> ascii assert assoc bin break butlast ' +
- 'callable calling-module-name car case cdr chain chr coll? combinations compile ' +
- 'compress cond cons cons? continue count curry cut cycle dec ' +
- 'def default-method defclass defmacro defmacro-alias defmacro/g! defmain defmethod defmulti defn ' +
- 'defn-alias defnc defnr defreader defseq del delattr delete-route dict-comp dir ' +
- 'disassemble dispatch-reader-macro distinct divmod do doto drop drop-last drop-while empty? ' +
- 'end-sequence eval eval-and-compile eval-when-compile even? every? except exec filter first ' +
- 'flatten float? fn fnc fnr for for* format fraction genexpr ' +
- 'gensym get getattr global globals group-by hasattr hash hex id ' +
- 'identity if if* if-not if-python2 import in inc input instance? ' +
- 'integer integer-char? integer? interleave interpose is is-coll is-cons is-empty is-even ' +
- 'is-every is-float is-instance is-integer is-integer-char is-iterable is-iterator is-keyword is-neg is-none ' +
- 'is-not is-numeric is-odd is-pos is-string is-symbol is-zero isinstance islice issubclass ' +
- 'iter iterable? iterate iterator? keyword keyword? lambda last len let ' +
- 'lif lif-not list* list-comp locals loop macro-error macroexpand macroexpand-1 macroexpand-all ' +
- 'map max merge-with method-decorator min multi-decorator multicombinations name neg? next ' +
- 'none? nonlocal not not-in not? nth numeric? oct odd? open ' +
- 'or ord partition permutations pos? post-route postwalk pow prewalk print ' +
- 'product profile/calls profile/cpu put-route quasiquote quote raise range read read-str ' +
- 'recursive-replace reduce remove repeat repeatedly repr require rest round route ' +
- 'route-with-methods rwm second seq set-comp setattr setv some sorted string ' +
- 'string? sum switch symbol? take take-nth take-while tee try unless ' +
- 'unquote unquote-splicing vars walk when while with with* with-decorator with-gensyms ' +
- 'xi xor yield yield-from zero? zip zip-longest | |= ~'
- };
-
- var SYMBOLSTART = 'a-zA-Z_\\-!.?+*=<>&#\'';
- var SYMBOL_RE = '[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:]*';
- var SIMPLE_NUMBER_RE = '[-+]?\\d+(\\.\\d+)?';
-
- var SHEBANG = {
- className: 'meta',
- begin: '^#!', end: '$'
- };
-
- var SYMBOL = {
- begin: SYMBOL_RE,
- relevance: 0
- };
- var NUMBER = {
- className: 'number', begin: SIMPLE_NUMBER_RE,
- relevance: 0
- };
- var STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null});
- var COMMENT = hljs.COMMENT(
- ';',
- '$',
- {
- relevance: 0
- }
- );
- var LITERAL = {
- className: 'literal',
- begin: /\b([Tt]rue|[Ff]alse|nil|None)\b/
- };
- var COLLECTION = {
- begin: '[\\[\\{]', end: '[\\]\\}]'
- };
- var HINT = {
- className: 'comment',
- begin: '\\^' + SYMBOL_RE
- };
- var HINT_COL = hljs.COMMENT('\\^\\{', '\\}');
- var KEY = {
- className: 'symbol',
- begin: '[:]{1,2}' + SYMBOL_RE
- };
- var LIST = {
- begin: '\\(', end: '\\)'
- };
- var BODY = {
- endsWithParent: true,
- relevance: 0
- };
- var NAME = {
- keywords: keywords,
- lexemes: SYMBOL_RE,
- className: 'name', begin: SYMBOL_RE,
- starts: BODY
- };
- var DEFAULT_CONTAINS = [LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER, LITERAL, SYMBOL];
-
- LIST.contains = [hljs.COMMENT('comment', ''), NAME, BODY];
- BODY.contains = DEFAULT_CONTAINS;
- COLLECTION.contains = DEFAULT_CONTAINS;
-
- return {
- aliases: ['hylang'],
- illegal: /\S/,
- contains: [SHEBANG, LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER, LITERAL]
- }
-};
-},{}],188:[function(require,module,exports){
-module.exports = function(hljs) {
- var START_BRACKET = '\\[';
- var END_BRACKET = '\\]';
- return {
- aliases: ['i7'],
- case_insensitive: true,
- keywords: {
- // Some keywords more or less unique to I7, for relevance.
- keyword:
- // kind:
- 'thing room person man woman animal container ' +
- 'supporter backdrop door ' +
- // characteristic:
- 'scenery open closed locked inside gender ' +
- // verb:
- 'is are say understand ' +
- // misc keyword:
- 'kind of rule'
- },
- contains: [
- {
- className: 'string',
- begin: '"', end: '"',
- relevance: 0,
- contains: [
- {
- className: 'subst',
- begin: START_BRACKET, end: END_BRACKET
- }
- ]
- },
- {
- className: 'section',
- begin: /^(Volume|Book|Part|Chapter|Section|Table)\b/,
- end: '$'
- },
- {
- // Rule definition
- // This is here for relevance.
- begin: /^(Check|Carry out|Report|Instead of|To|Rule|When|Before|After)\b/,
- end: ':',
- contains: [
- {
- //Rule name
- begin: '\\(This', end: '\\)'
- }
- ]
- },
- {
- className: 'comment',
- begin: START_BRACKET, end: END_BRACKET,
- contains: ['self']
- }
- ]
- };
-};
-},{}],189:[function(require,module,exports){
-module.exports = function(hljs) {
- var STRING = {
- className: "string",
- contains: [hljs.BACKSLASH_ESCAPE],
- variants: [
- {
- begin: "'''", end: "'''",
- relevance: 10
- }, {
- begin: '"""', end: '"""',
- relevance: 10
- }, {
- begin: '"', end: '"'
- }, {
- begin: "'", end: "'"
- }
- ]
- };
- return {
- aliases: ['toml'],
- case_insensitive: true,
- illegal: /\S/,
- contains: [
- hljs.COMMENT(';', '$'),
- hljs.HASH_COMMENT_MODE,
- {
- className: 'section',
- begin: /^\s*\[+/, end: /\]+/
- },
- {
- begin: /^[a-z0-9\[\]_-]+\s*=\s*/, end: '$',
- returnBegin: true,
- contains: [
- {
- className: 'attr',
- begin: /[a-z0-9\[\]_-]+/
- },
- {
- begin: /=/, endsWithParent: true,
- relevance: 0,
- contains: [
- {
- className: 'literal',
- begin: /\bon|off|true|false|yes|no\b/
- },
- {
- className: 'variable',
- variants: [
- {begin: /\$[\w\d"][\w\d_]*/},
- {begin: /\$\{(.*?)}/}
- ]
- },
- STRING,
- {
- className: 'number',
- begin: /([\+\-]+)?[\d]+_[\d_]+/
- },
- hljs.NUMBER_MODE
- ]
- }
- ]
- }
- ]
- };
-};
-},{}],190:[function(require,module,exports){
-module.exports = function(hljs) {
- var PARAMS = {
- className: 'params',
- begin: '\\(', end: '\\)'
- };
-
- var F_KEYWORDS = {
- literal: '.False. .True.',
- keyword: 'kind do while private call intrinsic where elsewhere ' +
- 'type endtype endmodule endselect endinterface end enddo endif if forall endforall only contains default return stop then ' +
- 'public subroutine|10 function program .and. .or. .not. .le. .eq. .ge. .gt. .lt. ' +
- 'goto save else use module select case ' +
- 'access blank direct exist file fmt form formatted iostat name named nextrec number opened rec recl sequential status unformatted unit ' +
- 'continue format pause cycle exit ' +
- 'c_null_char c_alert c_backspace c_form_feed flush wait decimal round iomsg ' +
- 'synchronous nopass non_overridable pass protected volatile abstract extends import ' +
- 'non_intrinsic value deferred generic final enumerator class associate bind enum ' +
- 'c_int c_short c_long c_long_long c_signed_char c_size_t c_int8_t c_int16_t c_int32_t c_int64_t c_int_least8_t c_int_least16_t ' +
- 'c_int_least32_t c_int_least64_t c_int_fast8_t c_int_fast16_t c_int_fast32_t c_int_fast64_t c_intmax_t C_intptr_t c_float c_double ' +
- 'c_long_double c_float_complex c_double_complex c_long_double_complex c_bool c_char c_null_ptr c_null_funptr ' +
- 'c_new_line c_carriage_return c_horizontal_tab c_vertical_tab iso_c_binding c_loc c_funloc c_associated c_f_pointer ' +
- 'c_ptr c_funptr iso_fortran_env character_storage_size error_unit file_storage_size input_unit iostat_end iostat_eor ' +
- 'numeric_storage_size output_unit c_f_procpointer ieee_arithmetic ieee_support_underflow_control ' +
- 'ieee_get_underflow_mode ieee_set_underflow_mode newunit contiguous recursive ' +
- 'pad position action delim readwrite eor advance nml interface procedure namelist include sequence elemental pure ' +
- 'integer real character complex logical dimension allocatable|10 parameter ' +
- 'external implicit|10 none double precision assign intent optional pointer ' +
- 'target in out common equivalence data ' +
- // IRPF90 special keywords
- 'begin_provider &begin_provider end_provider begin_shell end_shell begin_template end_template subst assert touch ' +
- 'soft_touch provide no_dep free irp_if irp_else irp_endif irp_write irp_read',
- built_in: 'alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint ' +
- 'dlog dlog10 dmax1 dmin1 dmod dnint dsign dsin dsinh dsqrt dtan dtanh float iabs idim idint idnint ifix isign max0 max1 min0 min1 sngl ' +
- 'algama cdabs cdcos cdexp cdlog cdsin cdsqrt cqabs cqcos cqexp cqlog cqsin cqsqrt dcmplx dconjg derf derfc dfloat dgamma dimag dlgama ' +
- 'iqint qabs qacos qasin qatan qatan2 qcmplx qconjg qcos qcosh qdim qerf qerfc qexp qgamma qimag qlgama qlog qlog10 qmax1 qmin1 qmod ' +
- 'qnint qsign qsin qsinh qsqrt qtan qtanh abs acos aimag aint anint asin atan atan2 char cmplx conjg cos cosh exp ichar index int log ' +
- 'log10 max min nint sign sin sinh sqrt tan tanh print write dim lge lgt lle llt mod nullify allocate deallocate ' +
- 'adjustl adjustr all allocated any associated bit_size btest ceiling count cshift date_and_time digits dot_product ' +
- 'eoshift epsilon exponent floor fraction huge iand ibclr ibits ibset ieor ior ishft ishftc lbound len_trim matmul ' +
- 'maxexponent maxloc maxval merge minexponent minloc minval modulo mvbits nearest pack present product ' +
- 'radix random_number random_seed range repeat reshape rrspacing scale scan selected_int_kind selected_real_kind ' +
- 'set_exponent shape size spacing spread sum system_clock tiny transpose trim ubound unpack verify achar iachar transfer ' +
- 'dble entry dprod cpu_time command_argument_count get_command get_command_argument get_environment_variable is_iostat_end ' +
- 'ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode ' +
- 'is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_of' +
- 'acosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2 ' +
- 'atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits ' +
- 'bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr ' +
- 'num_images parity popcnt poppar shifta shiftl shiftr this_image ' +
- // IRPF90 special built_ins
- 'IRP_ALIGN irp_here'
- };
- return {
- case_insensitive: true,
- keywords: F_KEYWORDS,
- illegal: /\/\*/,
- contains: [
- hljs.inherit(hljs.APOS_STRING_MODE, {className: 'string', relevance: 0}),
- hljs.inherit(hljs.QUOTE_STRING_MODE, {className: 'string', relevance: 0}),
- {
- className: 'function',
- beginKeywords: 'subroutine function program',
- illegal: '[${=\\n]',
- contains: [hljs.UNDERSCORE_TITLE_MODE, PARAMS]
- },
- hljs.COMMENT('!', '$', {relevance: 0}),
- hljs.COMMENT('begin_doc', 'end_doc', {relevance: 10}),
- {
- className: 'number',
- begin: '(?=\\b|\\+|\\-|\\.)(?=\\.\\d|\\d)(?:\\d+)?(?:\\.?\\d*)(?:[de][+-]?\\d+)?\\b\\.?',
- relevance: 0
- }
- ]
- };
-};
-},{}],191:[function(require,module,exports){
-module.exports = function(hljs) {
- var JAVA_IDENT_RE = '[\u00C0-\u02B8a-zA-Z_$][\u00C0-\u02B8a-zA-Z_$0-9]*';
- var GENERIC_IDENT_RE = JAVA_IDENT_RE + '(<' + JAVA_IDENT_RE + '(\\s*,\\s*' + JAVA_IDENT_RE + ')*>)?';
- var KEYWORDS =
- 'false synchronized int abstract float private char boolean static null if const ' +
- 'for true while long strictfp finally protected import native final void ' +
- 'enum else break transient catch instanceof byte super volatile case assert short ' +
- 'package default double public try this switch continue throws protected public private ' +
- 'module requires exports do';
-
- // https://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html
- var JAVA_NUMBER_RE = '\\b' +
- '(' +
- '0[bB]([01]+[01_]+[01]+|[01]+)' + // 0b...
- '|' +
- '0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)' + // 0x...
- '|' +
- '(' +
- '([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?' +
- '|' +
- '\\.([\\d]+[\\d_]+[\\d]+|[\\d]+)' +
- ')' +
- '([eE][-+]?\\d+)?' + // octal, decimal, float
- ')' +
- '[lLfF]?';
- var JAVA_NUMBER_MODE = {
- className: 'number',
- begin: JAVA_NUMBER_RE,
- relevance: 0
- };
-
- return {
- aliases: ['jsp'],
- keywords: KEYWORDS,
- illegal: /<\/|#/,
- contains: [
- hljs.COMMENT(
- '/\\*\\*',
- '\\*/',
- {
- relevance : 0,
- contains : [
- {
- // eat up @'s in emails to prevent them to be recognized as doctags
- begin: /\w+@/, relevance: 0
- },
- {
- className : 'doctag',
- begin : '@[A-Za-z]+'
- }
- ]
- }
- ),
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- {
- className: 'class',
- beginKeywords: 'class interface', end: /[{;=]/, excludeEnd: true,
- keywords: 'class interface',
- illegal: /[:"\[\]]/,
- contains: [
- {beginKeywords: 'extends implements'},
- hljs.UNDERSCORE_TITLE_MODE
- ]
- },
- {
- // Expression keywords prevent 'keyword Name(...)' from being
- // recognized as a function definition
- beginKeywords: 'new throw return else',
- relevance: 0
- },
- {
- className: 'function',
- begin: '(' + GENERIC_IDENT_RE + '\\s+)+' + hljs.UNDERSCORE_IDENT_RE + '\\s*\\(', returnBegin: true, end: /[{;=]/,
- excludeEnd: true,
- keywords: KEYWORDS,
- contains: [
- {
- begin: hljs.UNDERSCORE_IDENT_RE + '\\s*\\(', returnBegin: true,
- relevance: 0,
- contains: [hljs.UNDERSCORE_TITLE_MODE]
- },
- {
- className: 'params',
- begin: /\(/, end: /\)/,
- keywords: KEYWORDS,
- relevance: 0,
- contains: [
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- },
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- },
- JAVA_NUMBER_MODE,
- {
- className: 'meta', begin: '@[A-Za-z]+'
- }
- ]
- };
-};
-},{}],192:[function(require,module,exports){
-module.exports = function(hljs) {
- var IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
- var KEYWORDS = {
- keyword:
- 'in of if for while finally var new function do return void else break catch ' +
- 'instanceof with throw case default try this switch continue typeof delete ' +
- 'let yield const export super debugger as async await static ' +
- // ECMAScript 6 modules import
- 'import from as'
- ,
- literal:
- 'true false null undefined NaN Infinity',
- built_in:
- 'eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent ' +
- 'encodeURI encodeURIComponent escape unescape Object Function Boolean Error ' +
- 'EvalError InternalError RangeError ReferenceError StopIteration SyntaxError ' +
- 'TypeError URIError Number Math Date String RegExp Array Float32Array ' +
- 'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' +
- 'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' +
- 'module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect ' +
- 'Promise'
- };
- var EXPRESSIONS;
- var NUMBER = {
- className: 'number',
- variants: [
- { begin: '\\b(0[bB][01]+)' },
- { begin: '\\b(0[oO][0-7]+)' },
- { begin: hljs.C_NUMBER_RE }
- ],
- relevance: 0
- };
- var SUBST = {
- className: 'subst',
- begin: '\\$\\{', end: '\\}',
- keywords: KEYWORDS,
- contains: [] // defined later
- };
- var TEMPLATE_STRING = {
- className: 'string',
- begin: '`', end: '`',
- contains: [
- hljs.BACKSLASH_ESCAPE,
- SUBST
- ]
- };
- SUBST.contains = [
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- TEMPLATE_STRING,
- NUMBER,
- hljs.REGEXP_MODE
- ]
- var PARAMS_CONTAINS = SUBST.contains.concat([
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.C_LINE_COMMENT_MODE
- ]);
-
- return {
- aliases: ['js', 'jsx'],
- keywords: KEYWORDS,
- contains: [
- {
- className: 'meta',
- relevance: 10,
- begin: /^\s*['"]use (strict|asm)['"]/
- },
- {
- className: 'meta',
- begin: /^#!/, end: /$/
- },
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- TEMPLATE_STRING,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- NUMBER,
- { // object attr container
- begin: /[{,]\s*/, relevance: 0,
- contains: [
- {
- begin: IDENT_RE + '\\s*:', returnBegin: true,
- relevance: 0,
- contains: [{className: 'attr', begin: IDENT_RE, relevance: 0}]
- }
- ]
- },
- { // "value" container
- begin: '(' + hljs.RE_STARTERS_RE + '|\\b(case|return|throw)\\b)\\s*',
- keywords: 'return throw case',
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.REGEXP_MODE,
- {
- className: 'function',
- begin: '(\\(.*?\\)|' + IDENT_RE + ')\\s*=>', returnBegin: true,
- end: '\\s*=>',
- contains: [
- {
- className: 'params',
- variants: [
- {
- begin: IDENT_RE
- },
- {
- begin: /\(\s*\)/,
- },
- {
- begin: /\(/, end: /\)/,
- excludeBegin: true, excludeEnd: true,
- keywords: KEYWORDS,
- contains: PARAMS_CONTAINS
- }
- ]
- }
- ]
- },
- { // E4X / JSX
- begin: /</, end: /(\/\w+|\w+\/)>/,
- subLanguage: 'xml',
- contains: [
- {begin: /<\w+\s*\/>/, skip: true},
- {
- begin: /<\w+/, end: /(\/\w+|\w+\/)>/, skip: true,
- contains: [
- {begin: /<\w+\s*\/>/, skip: true},
- 'self'
- ]
- }
- ]
- }
- ],
- relevance: 0
- },
- {
- className: 'function',
- beginKeywords: 'function', end: /\{/, excludeEnd: true,
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {begin: IDENT_RE}),
- {
- className: 'params',
- begin: /\(/, end: /\)/,
- excludeBegin: true,
- excludeEnd: true,
- contains: PARAMS_CONTAINS
- }
- ],
- illegal: /\[|%/
- },
- {
- begin: /\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
- },
- hljs.METHOD_GUARD,
- { // ES6 class
- className: 'class',
- beginKeywords: 'class', end: /[{;=]/, excludeEnd: true,
- illegal: /[:"\[\]]/,
- contains: [
- {beginKeywords: 'extends'},
- hljs.UNDERSCORE_TITLE_MODE
- ]
- },
- {
- beginKeywords: 'constructor', end: /\{/, excludeEnd: true
- }
- ],
- illegal: /#(?!!)/
- };
-};
-},{}],193:[function(require,module,exports){
-module.exports = function (hljs) {
- var PARAM = {
- begin: /[\w-]+ *=/, returnBegin: true,
- relevance: 0,
- contains: [{className: 'attr', begin: /[\w-]+/}]
- };
- var PARAMSBLOCK = {
- className: 'params',
- begin: /\(/,
- end: /\)/,
- contains: [PARAM],
- relevance : 0
- };
- var OPERATION = {
- className: 'function',
- begin: /:[\w\-.]+/,
- relevance: 0
- };
- var PATH = {
- className: 'string',
- begin: /\B(([\/.])[\w\-.\/=]+)+/,
- };
- var COMMAND_PARAMS = {
- className: 'params',
- begin: /--[\w\-=\/]+/,
- };
- return {
- aliases: ['wildfly-cli'],
- lexemes: '[a-z\-]+',
- keywords: {
- keyword: 'alias batch cd clear command connect connection-factory connection-info data-source deploy ' +
- 'deployment-info deployment-overlay echo echo-dmr help history if jdbc-driver-info jms-queue|20 jms-topic|20 ls ' +
- 'patch pwd quit read-attribute read-operation reload rollout-plan run-batch set shutdown try unalias ' +
- 'undeploy unset version xa-data-source', // module
- literal: 'true false'
- },
- contains: [
- hljs.HASH_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- COMMAND_PARAMS,
- OPERATION,
- PATH,
- PARAMSBLOCK
- ]
- }
-};
-},{}],194:[function(require,module,exports){
-module.exports = function(hljs) {
- var LITERALS = {literal: 'true false null'};
- var TYPES = [
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE
- ];
- var VALUE_CONTAINER = {
- end: ',', endsWithParent: true, excludeEnd: true,
- contains: TYPES,
- keywords: LITERALS
- };
- var OBJECT = {
- begin: '{', end: '}',
- contains: [
- {
- className: 'attr',
- begin: /"/, end: /"/,
- contains: [hljs.BACKSLASH_ESCAPE],
- illegal: '\\n',
- },
- hljs.inherit(VALUE_CONTAINER, {begin: /:/})
- ],
- illegal: '\\S'
- };
- var ARRAY = {
- begin: '\\[', end: '\\]',
- contains: [hljs.inherit(VALUE_CONTAINER)], // inherit is a workaround for a bug that makes shared modes with endsWithParent compile only the ending of one of the parents
- illegal: '\\S'
- };
- TYPES.splice(TYPES.length, 0, OBJECT, ARRAY);
- return {
- contains: TYPES,
- keywords: LITERALS,
- illegal: '\\S'
- };
-};
-},{}],195:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- contains: [
- {
- className: 'meta',
- begin: /^julia>/,
- relevance: 10,
- starts: {
- // end the highlighting if we are on a new line and the line does not have at
- // least six spaces in the beginning
- end: /^(?![ ]{6})/,
- subLanguage: 'julia'
- },
- // jldoctest Markdown blocks are used in the Julia manual and package docs indicate
- // code snippets that should be verified when the documentation is built. They can be
- // either REPL-like or script-like, but are usually REPL-like and therefore we apply
- // julia-repl highlighting to them. More information can be found in Documenter's
- // manual: https://juliadocs.github.io/Documenter.jl/latest/man/doctests.html
- aliases: ['jldoctest']
- }
- ]
- }
-};
-},{}],196:[function(require,module,exports){
-module.exports = function(hljs) {
- // Since there are numerous special names in Julia, it is too much trouble
- // to maintain them by hand. Hence these names (i.e. keywords, literals and
- // built-ins) are automatically generated from Julia v0.6 itself through
- // the following scripts for each.
-
- var KEYWORDS = {
- // # keyword generator, multi-word keywords handled manually below
- // foreach(println, ["in", "isa", "where"])
- // for kw in Base.REPLCompletions.complete_keyword("")
- // if !(contains(kw, " ") || kw == "struct")
- // println(kw)
- // end
- // end
- keyword:
- 'in isa where ' +
- 'baremodule begin break catch ccall const continue do else elseif end export false finally for function ' +
- 'global if import importall let local macro module quote return true try using while ' +
- // legacy, to be deprecated in the next release
- 'type immutable abstract bitstype typealias ',
-
- // # literal generator
- // println("true")
- // println("false")
- // for name in Base.REPLCompletions.completions("", 0)[1]
- // try
- // v = eval(Symbol(name))
- // if !(v isa Function || v isa Type || v isa TypeVar || v isa Module || v isa Colon)
- // println(name)
- // end
- // end
- // end
- literal:
- 'true false ' +
- 'ARGS C_NULL DevNull ENDIAN_BOM ENV I Inf Inf16 Inf32 Inf64 InsertionSort JULIA_HOME LOAD_PATH MergeSort ' +
- 'NaN NaN16 NaN32 NaN64 PROGRAM_FILE QuickSort RoundDown RoundFromZero RoundNearest RoundNearestTiesAway ' +
- 'RoundNearestTiesUp RoundToZero RoundUp STDERR STDIN STDOUT VERSION catalan e|0 eu|0 eulergamma golden im ' +
- 'nothing pi γ π φ ',
-
- // # built_in generator:
- // for name in Base.REPLCompletions.completions("", 0)[1]
- // try
- // v = eval(Symbol(name))
- // if v isa Type || v isa TypeVar
- // println(name)
- // end
- // end
- // end
- built_in:
- 'ANY AbstractArray AbstractChannel AbstractFloat AbstractMatrix AbstractRNG AbstractSerializer AbstractSet ' +
- 'AbstractSparseArray AbstractSparseMatrix AbstractSparseVector AbstractString AbstractUnitRange AbstractVecOrMat ' +
- 'AbstractVector Any ArgumentError Array AssertionError Associative Base64DecodePipe Base64EncodePipe Bidiagonal '+
- 'BigFloat BigInt BitArray BitMatrix BitVector Bool BoundsError BufferStream CachingPool CapturedException ' +
- 'CartesianIndex CartesianRange Cchar Cdouble Cfloat Channel Char Cint Cintmax_t Clong Clonglong ClusterManager ' +
- 'Cmd CodeInfo Colon Complex Complex128 Complex32 Complex64 CompositeException Condition ConjArray ConjMatrix ' +
- 'ConjVector Cptrdiff_t Cshort Csize_t Cssize_t Cstring Cuchar Cuint Cuintmax_t Culong Culonglong Cushort Cwchar_t ' +
- 'Cwstring DataType Date DateFormat DateTime DenseArray DenseMatrix DenseVecOrMat DenseVector Diagonal Dict ' +
- 'DimensionMismatch Dims DirectIndexString Display DivideError DomainError EOFError EachLine Enum Enumerate ' +
- 'ErrorException Exception ExponentialBackOff Expr Factorization FileMonitor Float16 Float32 Float64 Function ' +
- 'Future GlobalRef GotoNode HTML Hermitian IO IOBuffer IOContext IOStream IPAddr IPv4 IPv6 IndexCartesian IndexLinear ' +
- 'IndexStyle InexactError InitError Int Int128 Int16 Int32 Int64 Int8 IntSet Integer InterruptException ' +
- 'InvalidStateException Irrational KeyError LabelNode LinSpace LineNumberNode LoadError LowerTriangular MIME Matrix ' +
- 'MersenneTwister Method MethodError MethodTable Module NTuple NewvarNode NullException Nullable Number ObjectIdDict ' +
- 'OrdinalRange OutOfMemoryError OverflowError Pair ParseError PartialQuickSort PermutedDimsArray Pipe ' +
- 'PollingFileWatcher ProcessExitedException Ptr QuoteNode RandomDevice Range RangeIndex Rational RawFD ' +
- 'ReadOnlyMemoryError Real ReentrantLock Ref Regex RegexMatch RemoteChannel RemoteException RevString RoundingMode ' +
- 'RowVector SSAValue SegmentationFault SerializationState Set SharedArray SharedMatrix SharedVector Signed ' +
- 'SimpleVector Slot SlotNumber SparseMatrixCSC SparseVector StackFrame StackOverflowError StackTrace StepRange ' +
- 'StepRangeLen StridedArray StridedMatrix StridedVecOrMat StridedVector String SubArray SubString SymTridiagonal ' +
- 'Symbol Symmetric SystemError TCPSocket Task Text TextDisplay Timer Tridiagonal Tuple Type TypeError TypeMapEntry ' +
- 'TypeMapLevel TypeName TypeVar TypedSlot UDPSocket UInt UInt128 UInt16 UInt32 UInt64 UInt8 UndefRefError UndefVarError ' +
- 'UnicodeError UniformScaling Union UnionAll UnitRange Unsigned UpperTriangular Val Vararg VecElement VecOrMat Vector ' +
- 'VersionNumber Void WeakKeyDict WeakRef WorkerConfig WorkerPool '
- };
-
- // ref: http://julia.readthedocs.org/en/latest/manual/variables/#allowed-variable-names
- var VARIABLE_NAME_RE = '[A-Za-z_\\u00A1-\\uFFFF][A-Za-z_0-9\\u00A1-\\uFFFF]*';
-
- // placeholder for recursive self-reference
- var DEFAULT = {
- lexemes: VARIABLE_NAME_RE, keywords: KEYWORDS, illegal: /<\//
- };
-
- // ref: http://julia.readthedocs.org/en/latest/manual/integers-and-floating-point-numbers/
- var NUMBER = {
- className: 'number',
- // supported numeric literals:
- // * binary literal (e.g. 0x10)
- // * octal literal (e.g. 0o76543210)
- // * hexadecimal literal (e.g. 0xfedcba876543210)
- // * hexadecimal floating point literal (e.g. 0x1p0, 0x1.2p2)
- // * decimal literal (e.g. 9876543210, 100_000_000)
- // * floating pointe literal (e.g. 1.2, 1.2f, .2, 1., 1.2e10, 1.2e-10)
- begin: /(\b0x[\d_]*(\.[\d_]*)?|0x\.\d[\d_]*)p[-+]?\d+|\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\b\d[\d_]*(\.[\d_]*)?|\.\d[\d_]*)([eEfF][-+]?\d+)?/,
- relevance: 0
- };
-
- var CHAR = {
- className: 'string',
- begin: /'(.|\\[xXuU][a-zA-Z0-9]+)'/
- };
-
- var INTERPOLATION = {
- className: 'subst',
- begin: /\$\(/, end: /\)/,
- keywords: KEYWORDS
- };
-
- var INTERPOLATED_VARIABLE = {
- className: 'variable',
- begin: '\\$' + VARIABLE_NAME_RE
- };
-
- // TODO: neatly escape normal code in string literal
- var STRING = {
- className: 'string',
- contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],
- variants: [
- { begin: /\w*"""/, end: /"""\w*/, relevance: 10 },
- { begin: /\w*"/, end: /"\w*/ }
- ]
- };
-
- var COMMAND = {
- className: 'string',
- contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],
- begin: '`', end: '`'
- };
-
- var MACROCALL = {
- className: 'meta',
- begin: '@' + VARIABLE_NAME_RE
- };
-
- var COMMENT = {
- className: 'comment',
- variants: [
- { begin: '#=', end: '=#', relevance: 10 },
- { begin: '#', end: '$' }
- ]
- };
-
- DEFAULT.contains = [
- NUMBER,
- CHAR,
- STRING,
- COMMAND,
- MACROCALL,
- COMMENT,
- hljs.HASH_COMMENT_MODE,
- {
- className: 'keyword',
- begin:
- '\\b(((abstract|primitive)\\s+)type|(mutable\\s+)?struct)\\b'
- },
- {begin: /<:/} // relevance booster
- ];
- INTERPOLATION.contains = DEFAULT.contains;
-
- return DEFAULT;
-};
-},{}],197:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS = {
- keyword:
- 'abstract as val var vararg get set class object open private protected public noinline ' +
- 'crossinline dynamic final enum if else do while for when throw try catch finally ' +
- 'import package is in fun override companion reified inline lateinit init' +
- 'interface annotation data sealed internal infix operator out by constructor super ' +
- // to be deleted soon
- 'trait volatile transient native default',
- built_in:
- 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',
- literal:
- 'true false null'
- };
- var KEYWORDS_WITH_LABEL = {
- className: 'keyword',
- begin: /\b(break|continue|return|this)\b/,
- starts: {
- contains: [
- {
- className: 'symbol',
- begin: /@\w+/
- }
- ]
- }
- };
- var LABEL = {
- className: 'symbol', begin: hljs.UNDERSCORE_IDENT_RE + '@'
- };
-
- // for string templates
- var SUBST = {
- className: 'subst',
- begin: '\\${', end: '}', contains: [hljs.APOS_STRING_MODE, hljs.C_NUMBER_MODE]
- };
- var VARIABLE = {
- className: 'variable', begin: '\\$' + hljs.UNDERSCORE_IDENT_RE
- };
- var STRING = {
- className: 'string',
- variants: [
- {
- begin: '"""', end: '"""',
- contains: [VARIABLE, SUBST]
- },
- // Can't use built-in modes easily, as we want to use STRING in the meta
- // context as 'meta-string' and there's no syntax to remove explicitly set
- // classNames in built-in modes.
- {
- begin: '\'', end: '\'',
- illegal: /\n/,
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- begin: '"', end: '"',
- illegal: /\n/,
- contains: [hljs.BACKSLASH_ESCAPE, VARIABLE, SUBST]
- }
- ]
- };
-
- var ANNOTATION_USE_SITE = {
- className: 'meta', begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'
- };
- var ANNOTATION = {
- className: 'meta', begin: '@' + hljs.UNDERSCORE_IDENT_RE,
- contains: [
- {
- begin: /\(/, end: /\)/,
- contains: [
- hljs.inherit(STRING, {className: 'meta-string'})
- ]
- }
- ]
- };
-
- return {
- keywords: KEYWORDS,
- contains : [
- hljs.COMMENT(
- '/\\*\\*',
- '\\*/',
- {
- relevance : 0,
- contains : [{
- className : 'doctag',
- begin : '@[A-Za-z]+'
- }]
- }
- ),
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- KEYWORDS_WITH_LABEL,
- LABEL,
- ANNOTATION_USE_SITE,
- ANNOTATION,
- {
- className: 'function',
- beginKeywords: 'fun', end: '[(]|$',
- returnBegin: true,
- excludeEnd: true,
- keywords: KEYWORDS,
- illegal: /fun\s+(<.*>)?[^\s\(]+(\s+[^\s\(]+)\s*=/,
- relevance: 5,
- contains: [
- {
- begin: hljs.UNDERSCORE_IDENT_RE + '\\s*\\(', returnBegin: true,
- relevance: 0,
- contains: [hljs.UNDERSCORE_TITLE_MODE]
- },
- {
- className: 'type',
- begin: /</, end: />/, keywords: 'reified',
- relevance: 0
- },
- {
- className: 'params',
- begin: /\(/, end: /\)/,
- endsParent: true,
- keywords: KEYWORDS,
- relevance: 0,
- contains: [
- {
- begin: /:/, end: /[=,\/]/, endsWithParent: true,
- contains: [
- {className: 'type', begin: hljs.UNDERSCORE_IDENT_RE},
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ],
- relevance: 0
- },
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- ANNOTATION_USE_SITE,
- ANNOTATION,
- STRING,
- hljs.C_NUMBER_MODE
- ]
- },
- hljs.C_BLOCK_COMMENT_MODE
- ]
- },
- {
- className: 'class',
- beginKeywords: 'class interface trait', end: /[:\{(]|$/, // remove 'trait' when removed from KEYWORDS
- excludeEnd: true,
- illegal: 'extends implements',
- contains: [
- {beginKeywords: 'public protected internal private constructor'},
- hljs.UNDERSCORE_TITLE_MODE,
- {
- className: 'type',
- begin: /</, end: />/, excludeBegin: true, excludeEnd: true,
- relevance: 0
- },
- {
- className: 'type',
- begin: /[,:]\s*/, end: /[<\(,]|$/, excludeBegin: true, returnEnd: true
- },
- ANNOTATION_USE_SITE,
- ANNOTATION
- ]
- },
- STRING,
- {
- className: 'meta',
- begin: "^#!/usr/bin/env", end: '$',
- illegal: '\n'
- },
- hljs.C_NUMBER_MODE
- ]
- };
-};
-},{}],198:[function(require,module,exports){
-module.exports = function(hljs) {
- var LASSO_IDENT_RE = '[a-zA-Z_][\\w.]*';
- var LASSO_ANGLE_RE = '<\\?(lasso(script)?|=)';
- var LASSO_CLOSE_RE = '\\]|\\?>';
- var LASSO_KEYWORDS = {
- literal:
- 'true false none minimal full all void and or not ' +
- 'bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft',
- built_in:
- 'array date decimal duration integer map pair string tag xml null ' +
- 'boolean bytes keyword list locale queue set stack staticarray ' +
- 'local var variable global data self inherited currentcapture givenblock',
- keyword:
- 'cache database_names database_schemanames database_tablenames ' +
- 'define_tag define_type email_batch encode_set html_comment handle ' +
- 'handle_error header if inline iterate ljax_target link ' +
- 'link_currentaction link_currentgroup link_currentrecord link_detail ' +
- 'link_firstgroup link_firstrecord link_lastgroup link_lastrecord ' +
- 'link_nextgroup link_nextrecord link_prevgroup link_prevrecord log ' +
- 'loop namespace_using output_none portal private protect records ' +
- 'referer referrer repeating resultset rows search_args ' +
- 'search_arguments select sort_args sort_arguments thread_atomic ' +
- 'value_list while abort case else fail_if fail_ifnot fail if_empty ' +
- 'if_false if_null if_true loop_abort loop_continue loop_count params ' +
- 'params_up return return_value run_children soap_definetag ' +
- 'soap_lastrequest soap_lastresponse tag_name ascending average by ' +
- 'define descending do equals frozen group handle_failure import in ' +
- 'into join let match max min on order parent protected provide public ' +
- 'require returnhome skip split_thread sum take thread to trait type ' +
- 'where with yield yieldhome'
- };
- var HTML_COMMENT = hljs.COMMENT(
- '<!--',
- '-->',
- {
- relevance: 0
- }
- );
- var LASSO_NOPROCESS = {
- className: 'meta',
- begin: '\\[noprocess\\]',
- starts: {
- end: '\\[/noprocess\\]',
- returnEnd: true,
- contains: [HTML_COMMENT]
- }
- };
- var LASSO_START = {
- className: 'meta',
- begin: '\\[/noprocess|' + LASSO_ANGLE_RE
- };
- var LASSO_DATAMEMBER = {
- className: 'symbol',
- begin: '\'' + LASSO_IDENT_RE + '\''
- };
- var LASSO_CODE = [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.inherit(hljs.C_NUMBER_MODE, {begin: hljs.C_NUMBER_RE + '|(-?infinity|NaN)\\b'}),
- hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}),
- hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}),
- {
- className: 'string',
- begin: '`', end: '`'
- },
- { // variables
- variants: [
- {
- begin: '[#$]' + LASSO_IDENT_RE
- },
- {
- begin: '#', end: '\\d+',
- illegal: '\\W'
- }
- ]
- },
- {
- className: 'type',
- begin: '::\\s*', end: LASSO_IDENT_RE,
- illegal: '\\W'
- },
- {
- className: 'params',
- variants: [
- {
- begin: '-(?!infinity)' + LASSO_IDENT_RE,
- relevance: 0
- },
- {
- begin: '(\\.\\.\\.)'
- }
- ]
- },
- {
- begin: /(->|\.)\s*/,
- relevance: 0,
- contains: [LASSO_DATAMEMBER]
- },
- {
- className: 'class',
- beginKeywords: 'define',
- returnEnd: true, end: '\\(|=>',
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {begin: LASSO_IDENT_RE + '(=(?!>))?|[-+*/%](?!>)'})
- ]
- }
- ];
- return {
- aliases: ['ls', 'lassoscript'],
- case_insensitive: true,
- lexemes: LASSO_IDENT_RE + '|&[lg]t;',
- keywords: LASSO_KEYWORDS,
- contains: [
- {
- className: 'meta',
- begin: LASSO_CLOSE_RE,
- relevance: 0,
- starts: { // markup
- end: '\\[|' + LASSO_ANGLE_RE,
- returnEnd: true,
- relevance: 0,
- contains: [HTML_COMMENT]
- }
- },
- LASSO_NOPROCESS,
- LASSO_START,
- {
- className: 'meta',
- begin: '\\[no_square_brackets',
- starts: {
- end: '\\[/no_square_brackets\\]', // not implemented in the language
- lexemes: LASSO_IDENT_RE + '|&[lg]t;',
- keywords: LASSO_KEYWORDS,
- contains: [
- {
- className: 'meta',
- begin: LASSO_CLOSE_RE,
- relevance: 0,
- starts: {
- end: '\\[noprocess\\]|' + LASSO_ANGLE_RE,
- returnEnd: true,
- contains: [HTML_COMMENT]
- }
- },
- LASSO_NOPROCESS,
- LASSO_START
- ].concat(LASSO_CODE)
- }
- },
- {
- className: 'meta',
- begin: '\\[',
- relevance: 0
- },
- {
- className: 'meta',
- begin: '^#!', end:'lasso9$',
- relevance: 10
- }
- ].concat(LASSO_CODE)
- };
-};
-},{}],199:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- contains: [
- {
- className: 'attribute',
- begin: '^dn', end: ': ', excludeEnd: true,
- starts: {end: '$', relevance: 0},
- relevance: 10
- },
- {
- className: 'attribute',
- begin: '^\\w', end: ': ', excludeEnd: true,
- starts: {end: '$', relevance: 0}
- },
- {
- className: 'literal',
- begin: '^-', end: '$'
- },
- hljs.HASH_COMMENT_MODE
- ]
- };
-};
-},{}],200:[function(require,module,exports){
-module.exports = function (hljs) {
- return {
- contains: [
- {
- className: 'function',
- begin: '#+' + '[A-Za-z_0-9]*' + '\\(',
- end:' {',
- returnBegin: true,
- excludeEnd: true,
- contains : [
- {
- className: 'keyword',
- begin: '#+'
- },
- {
- className: 'title',
- begin: '[A-Za-z_][A-Za-z_0-9]*'
- },
- {
- className: 'params',
- begin: '\\(', end: '\\)',
- endsParent: true,
- contains: [
- {
- className: 'string',
- begin: '"',
- end: '"'
- },
- {
- className: 'variable',
- begin: '[A-Za-z_][A-Za-z_0-9]*'
- }
- ]
- }
- ]
- }
- ]
- };
-};
-},{}],201:[function(require,module,exports){
-module.exports = function(hljs) {
- var IDENT_RE = '[\\w-]+'; // yes, Less identifiers may begin with a digit
- var INTERP_IDENT_RE = '(' + IDENT_RE + '|@{' + IDENT_RE + '})';
-
- /* Generic Modes */
-
- var RULES = [], VALUE = []; // forward def. for recursive modes
-
- var STRING_MODE = function(c) { return {
- // Less strings are not multiline (also include '~' for more consistent coloring of "escaped" strings)
- className: 'string', begin: '~?' + c + '.*?' + c
- };};
-
- var IDENT_MODE = function(name, begin, relevance) { return {
- className: name, begin: begin, relevance: relevance
- };};
-
- var PARENS_MODE = {
- // used only to properly balance nested parens inside mixin call, def. arg list
- begin: '\\(', end: '\\)', contains: VALUE, relevance: 0
- };
-
- // generic Less highlighter (used almost everywhere except selectors):
- VALUE.push(
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- STRING_MODE("'"),
- STRING_MODE('"'),
- hljs.CSS_NUMBER_MODE, // fixme: it does not include dot for numbers like .5em :(
- {
- begin: '(url|data-uri)\\(',
- starts: {className: 'string', end: '[\\)\\n]', excludeEnd: true}
- },
- IDENT_MODE('number', '#[0-9A-Fa-f]+\\b'),
- PARENS_MODE,
- IDENT_MODE('variable', '@@?' + IDENT_RE, 10),
- IDENT_MODE('variable', '@{' + IDENT_RE + '}'),
- IDENT_MODE('built_in', '~?`[^`]*?`'), // inline javascript (or whatever host language) *multiline* string
- { // @media features (it’s here to not duplicate things in AT_RULE_MODE with extra PARENS_MODE overriding):
- className: 'attribute', begin: IDENT_RE + '\\s*:', end: ':', returnBegin: true, excludeEnd: true
- },
- {
- className: 'meta',
- begin: '!important'
- }
- );
-
- var VALUE_WITH_RULESETS = VALUE.concat({
- begin: '{', end: '}', contains: RULES
- });
-
- var MIXIN_GUARD_MODE = {
- beginKeywords: 'when', endsWithParent: true,
- contains: [{beginKeywords: 'and not'}].concat(VALUE) // using this form to override VALUE’s 'function' match
- };
-
- /* Rule-Level Modes */
-
- var RULE_MODE = {
- begin: INTERP_IDENT_RE + '\\s*:', returnBegin: true, end: '[;}]',
- relevance: 0,
- contains: [
- {
- className: 'attribute',
- begin: INTERP_IDENT_RE, end: ':', excludeEnd: true,
- starts: {
- endsWithParent: true, illegal: '[<=$]',
- relevance: 0,
- contains: VALUE
- }
- }
- ]
- };
-
- var AT_RULE_MODE = {
- className: 'keyword',
- begin: '@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b',
- starts: {end: '[;{}]', returnEnd: true, contains: VALUE, relevance: 0}
- };
-
- // variable definitions and calls
- var VAR_RULE_MODE = {
- className: 'variable',
- variants: [
- // using more strict pattern for higher relevance to increase chances of Less detection.
- // this is *the only* Less specific statement used in most of the sources, so...
- // (we’ll still often loose to the css-parser unless there's '//' comment,
- // simply because 1 variable just can't beat 99 properties :)
- {begin: '@' + IDENT_RE + '\\s*:', relevance: 15},
- {begin: '@' + IDENT_RE}
- ],
- starts: {end: '[;}]', returnEnd: true, contains: VALUE_WITH_RULESETS}
- };
-
- var SELECTOR_MODE = {
- // first parse unambiguous selectors (i.e. those not starting with tag)
- // then fall into the scary lookahead-discriminator variant.
- // this mode also handles mixin definitions and calls
- variants: [{
- begin: '[\\.#:&\\[>]', end: '[;{}]' // mixin calls end with ';'
- }, {
- begin: INTERP_IDENT_RE, end: '{'
- }],
- returnBegin: true,
- returnEnd: true,
- illegal: '[<=\'$"]',
- relevance: 0,
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- MIXIN_GUARD_MODE,
- IDENT_MODE('keyword', 'all\\b'),
- IDENT_MODE('variable', '@{' + IDENT_RE + '}'), // otherwise it’s identified as tag
- IDENT_MODE('selector-tag', INTERP_IDENT_RE + '%?', 0), // '%' for more consistent coloring of @keyframes "tags"
- IDENT_MODE('selector-id', '#' + INTERP_IDENT_RE),
- IDENT_MODE('selector-class', '\\.' + INTERP_IDENT_RE, 0),
- IDENT_MODE('selector-tag', '&', 0),
- {className: 'selector-attr', begin: '\\[', end: '\\]'},
- {className: 'selector-pseudo', begin: /:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},
- {begin: '\\(', end: '\\)', contains: VALUE_WITH_RULESETS}, // argument list of parametric mixins
- {begin: '!important'} // eat !important after mixin call or it will be colored as tag
- ]
- };
-
- RULES.push(
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- AT_RULE_MODE,
- VAR_RULE_MODE,
- RULE_MODE,
- SELECTOR_MODE
- );
-
- return {
- case_insensitive: true,
- illegal: '[=>\'/<($"]',
- contains: RULES
- };
-};
-},{}],202:[function(require,module,exports){
-module.exports = function(hljs) {
- var LISP_IDENT_RE = '[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#!]*';
- var MEC_RE = '\\|[^]*?\\|';
- var LISP_SIMPLE_NUMBER_RE = '(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s|D|E|F|L|S)(\\+|\\-)?\\d+)?';
- var SHEBANG = {
- className: 'meta',
- begin: '^#!', end: '$'
- };
- var LITERAL = {
- className: 'literal',
- begin: '\\b(t{1}|nil)\\b'
- };
- var NUMBER = {
- className: 'number',
- variants: [
- {begin: LISP_SIMPLE_NUMBER_RE, relevance: 0},
- {begin: '#(b|B)[0-1]+(/[0-1]+)?'},
- {begin: '#(o|O)[0-7]+(/[0-7]+)?'},
- {begin: '#(x|X)[0-9a-fA-F]+(/[0-9a-fA-F]+)?'},
- {begin: '#(c|C)\\(' + LISP_SIMPLE_NUMBER_RE + ' +' + LISP_SIMPLE_NUMBER_RE, end: '\\)'}
- ]
- };
- var STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null});
- var COMMENT = hljs.COMMENT(
- ';', '$',
- {
- relevance: 0
- }
- );
- var VARIABLE = {
- begin: '\\*', end: '\\*'
- };
- var KEYWORD = {
- className: 'symbol',
- begin: '[:&]' + LISP_IDENT_RE
- };
- var IDENT = {
- begin: LISP_IDENT_RE,
- relevance: 0
- };
- var MEC = {
- begin: MEC_RE
- };
- var QUOTED_LIST = {
- begin: '\\(', end: '\\)',
- contains: ['self', LITERAL, STRING, NUMBER, IDENT]
- };
- var QUOTED = {
- contains: [NUMBER, STRING, VARIABLE, KEYWORD, QUOTED_LIST, IDENT],
- variants: [
- {
- begin: '[\'`]\\(', end: '\\)'
- },
- {
- begin: '\\(quote ', end: '\\)',
- keywords: {name: 'quote'}
- },
- {
- begin: '\'' + MEC_RE
- }
- ]
- };
- var QUOTED_ATOM = {
- variants: [
- {begin: '\'' + LISP_IDENT_RE},
- {begin: '#\'' + LISP_IDENT_RE + '(::' + LISP_IDENT_RE + ')*'}
- ]
- };
- var LIST = {
- begin: '\\(\\s*', end: '\\)'
- };
- var BODY = {
- endsWithParent: true,
- relevance: 0
- };
- LIST.contains = [
- {
- className: 'name',
- variants: [
- {begin: LISP_IDENT_RE},
- {begin: MEC_RE}
- ]
- },
- BODY
- ];
- BODY.contains = [QUOTED, QUOTED_ATOM, LIST, LITERAL, NUMBER, STRING, COMMENT, VARIABLE, KEYWORD, MEC, IDENT];
-
- return {
- illegal: /\S/,
- contains: [
- NUMBER,
- SHEBANG,
- LITERAL,
- STRING,
- COMMENT,
- QUOTED,
- QUOTED_ATOM,
- LIST,
- IDENT
- ]
- };
-};
-},{}],203:[function(require,module,exports){
-module.exports = function(hljs) {
- var VARIABLE = {
- begin: '\\b[gtps][A-Z]+[A-Za-z0-9_\\-]*\\b|\\$_[A-Z]+',
- relevance: 0
- };
- var COMMENT_MODES = [
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.HASH_COMMENT_MODE,
- hljs.COMMENT('--', '$'),
- hljs.COMMENT('[^:]//', '$')
- ];
- var TITLE1 = hljs.inherit(hljs.TITLE_MODE, {
- variants: [
- {begin: '\\b_*rig[A-Z]+[A-Za-z0-9_\\-]*'},
- {begin: '\\b_[a-z0-9\\-]+'}
- ]
- });
- var TITLE2 = hljs.inherit(hljs.TITLE_MODE, {begin: '\\b([A-Za-z0-9_\\-]+)\\b'});
- return {
- case_insensitive: false,
- keywords: {
- keyword:
- '$_COOKIE $_FILES $_GET $_GET_BINARY $_GET_RAW $_POST $_POST_BINARY $_POST_RAW $_SESSION $_SERVER ' +
- 'codepoint codepoints segment segments codeunit codeunits sentence sentences trueWord trueWords paragraph ' +
- 'after byte bytes english the until http forever descending using line real8 with seventh ' +
- 'for stdout finally element word words fourth before black ninth sixth characters chars stderr ' +
- 'uInt1 uInt1s uInt2 uInt2s stdin string lines relative rel any fifth items from middle mid ' +
- 'at else of catch then third it file milliseconds seconds second secs sec int1 int1s int4 ' +
- 'int4s internet int2 int2s normal text item last long detailed effective uInt4 uInt4s repeat ' +
- 'end repeat URL in try into switch to words https token binfile each tenth as ticks tick ' +
- 'system real4 by dateItems without char character ascending eighth whole dateTime numeric short ' +
- 'first ftp integer abbreviated abbr abbrev private case while if ' +
- 'div mod wrap and or bitAnd bitNot bitOr bitXor among not in a an within ' +
- 'contains ends with begins the keys of keys',
- literal:
- 'SIX TEN FORMFEED NINE ZERO NONE SPACE FOUR FALSE COLON CRLF PI COMMA ENDOFFILE EOF EIGHT FIVE ' +
- 'QUOTE EMPTY ONE TRUE RETURN CR LINEFEED RIGHT BACKSLASH NULL SEVEN TAB THREE TWO ' +
- 'six ten formfeed nine zero none space four false colon crlf pi comma endoffile eof eight five ' +
- 'quote empty one true return cr linefeed right backslash null seven tab three two ' +
- 'RIVERSION RISTATE FILE_READ_MODE FILE_WRITE_MODE FILE_WRITE_MODE DIR_WRITE_MODE FILE_READ_UMASK ' +
- 'FILE_WRITE_UMASK DIR_READ_UMASK DIR_WRITE_UMASK',
- built_in:
- 'put abs acos aliasReference annuity arrayDecode arrayEncode asin atan atan2 average avg avgDev base64Decode ' +
- 'base64Encode baseConvert binaryDecode binaryEncode byteOffset byteToNum cachedURL cachedURLs charToNum ' +
- 'cipherNames codepointOffset codepointProperty codepointToNum codeunitOffset commandNames compound compress ' +
- 'constantNames cos date dateFormat decompress directories ' +
- 'diskSpace DNSServers exp exp1 exp2 exp10 extents files flushEvents folders format functionNames geometricMean global ' +
- 'globals hasMemory harmonicMean hostAddress hostAddressToName hostName hostNameToAddress isNumber ISOToMac itemOffset ' +
- 'keys len length libURLErrorData libUrlFormData libURLftpCommand libURLLastHTTPHeaders libURLLastRHHeaders ' +
- 'libUrlMultipartFormAddPart libUrlMultipartFormData libURLVersion lineOffset ln ln1 localNames log log2 log10 ' +
- 'longFilePath lower macToISO matchChunk matchText matrixMultiply max md5Digest median merge millisec ' +
- 'millisecs millisecond milliseconds min monthNames nativeCharToNum normalizeText num number numToByte numToChar ' +
- 'numToCodepoint numToNativeChar offset open openfiles openProcesses openProcessIDs openSockets ' +
- 'paragraphOffset paramCount param params peerAddress pendingMessages platform popStdDev populationStandardDeviation ' +
- 'populationVariance popVariance processID random randomBytes replaceText result revCreateXMLTree revCreateXMLTreeFromFile ' +
- 'revCurrentRecord revCurrentRecordIsFirst revCurrentRecordIsLast revDatabaseColumnCount revDatabaseColumnIsNull ' +
- 'revDatabaseColumnLengths revDatabaseColumnNames revDatabaseColumnNamed revDatabaseColumnNumbered ' +
- 'revDatabaseColumnTypes revDatabaseConnectResult revDatabaseCursors revDatabaseID revDatabaseTableNames ' +
- 'revDatabaseType revDataFromQuery revdb_closeCursor revdb_columnbynumber revdb_columncount revdb_columnisnull ' +
- 'revdb_columnlengths revdb_columnnames revdb_columntypes revdb_commit revdb_connect revdb_connections ' +
- 'revdb_connectionerr revdb_currentrecord revdb_cursorconnection revdb_cursorerr revdb_cursors revdb_dbtype ' +
- 'revdb_disconnect revdb_execute revdb_iseof revdb_isbof revdb_movefirst revdb_movelast revdb_movenext ' +
- 'revdb_moveprev revdb_query revdb_querylist revdb_recordcount revdb_rollback revdb_tablenames ' +
- 'revGetDatabaseDriverPath revNumberOfRecords revOpenDatabase revOpenDatabases revQueryDatabase ' +
- 'revQueryDatabaseBlob revQueryResult revQueryIsAtStart revQueryIsAtEnd revUnixFromMacPath revXMLAttribute ' +
- 'revXMLAttributes revXMLAttributeValues revXMLChildContents revXMLChildNames revXMLCreateTreeFromFileWithNamespaces ' +
- 'revXMLCreateTreeWithNamespaces revXMLDataFromXPathQuery revXMLEvaluateXPath revXMLFirstChild revXMLMatchingNode ' +
- 'revXMLNextSibling revXMLNodeContents revXMLNumberOfChildren revXMLParent revXMLPreviousSibling ' +
- 'revXMLRootNode revXMLRPC_CreateRequest revXMLRPC_Documents revXMLRPC_Error ' +
- 'revXMLRPC_GetHost revXMLRPC_GetMethod revXMLRPC_GetParam revXMLText revXMLRPC_Execute ' +
- 'revXMLRPC_GetParamCount revXMLRPC_GetParamNode revXMLRPC_GetParamType revXMLRPC_GetPath revXMLRPC_GetPort ' +
- 'revXMLRPC_GetProtocol revXMLRPC_GetRequest revXMLRPC_GetResponse revXMLRPC_GetSocket revXMLTree ' +
- 'revXMLTrees revXMLValidateDTD revZipDescribeItem revZipEnumerateItems revZipOpenArchives round sampVariance ' +
- 'sec secs seconds sentenceOffset sha1Digest shell shortFilePath sin specialFolderPath sqrt standardDeviation statRound ' +
- 'stdDev sum sysError systemVersion tan tempName textDecode textEncode tick ticks time to tokenOffset toLower toUpper ' +
- 'transpose truewordOffset trunc uniDecode uniEncode upper URLDecode URLEncode URLStatus uuid value variableNames ' +
- 'variance version waitDepth weekdayNames wordOffset xsltApplyStylesheet xsltApplyStylesheetFromFile xsltLoadStylesheet ' +
- 'xsltLoadStylesheetFromFile add breakpoint cancel clear local variable file word line folder directory URL close socket process ' +
- 'combine constant convert create new alias folder directory decrypt delete variable word line folder ' +
- 'directory URL dispatch divide do encrypt filter get include intersect kill libURLDownloadToFile ' +
- 'libURLFollowHttpRedirects libURLftpUpload libURLftpUploadFile libURLresetAll libUrlSetAuthCallback ' +
- 'libURLSetCustomHTTPHeaders libUrlSetExpect100 libURLSetFTPListCommand libURLSetFTPMode libURLSetFTPStopTime ' +
- 'libURLSetStatusCallback load multiply socket prepare process post seek rel relative read from process rename ' +
- 'replace require resetAll resolve revAddXMLNode revAppendXML revCloseCursor revCloseDatabase revCommitDatabase ' +
- 'revCopyFile revCopyFolder revCopyXMLNode revDeleteFolder revDeleteXMLNode revDeleteAllXMLTrees ' +
- 'revDeleteXMLTree revExecuteSQL revGoURL revInsertXMLNode revMoveFolder revMoveToFirstRecord revMoveToLastRecord ' +
- 'revMoveToNextRecord revMoveToPreviousRecord revMoveToRecord revMoveXMLNode revPutIntoXMLNode revRollBackDatabase ' +
- 'revSetDatabaseDriverPath revSetXMLAttribute revXMLRPC_AddParam revXMLRPC_DeleteAllDocuments revXMLAddDTD ' +
- 'revXMLRPC_Free revXMLRPC_FreeAll revXMLRPC_DeleteDocument revXMLRPC_DeleteParam revXMLRPC_SetHost ' +
- 'revXMLRPC_SetMethod revXMLRPC_SetPort revXMLRPC_SetProtocol revXMLRPC_SetSocket revZipAddItemWithData ' +
- 'revZipAddItemWithFile revZipAddUncompressedItemWithData revZipAddUncompressedItemWithFile revZipCancel ' +
- 'revZipCloseArchive revZipDeleteItem revZipExtractItemToFile revZipExtractItemToVariable revZipSetProgressCallback ' +
- 'revZipRenameItem revZipReplaceItemWithData revZipReplaceItemWithFile revZipOpenArchive send set sort split start stop ' +
- 'subtract union unload wait write'
- },
- contains: [
- VARIABLE,
- {
- className: 'keyword',
- begin: '\\bend\\sif\\b'
- },
- {
- className: 'function',
- beginKeywords: 'function', end: '$',
- contains: [
- VARIABLE,
- TITLE2,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.BINARY_NUMBER_MODE,
- hljs.C_NUMBER_MODE,
- TITLE1
- ]
- },
- {
- className: 'function',
- begin: '\\bend\\s+', end: '$',
- keywords: 'end',
- contains: [
- TITLE2,
- TITLE1
- ],
- relevance: 0
- },
- {
- beginKeywords: 'command on', end: '$',
- contains: [
- VARIABLE,
- TITLE2,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.BINARY_NUMBER_MODE,
- hljs.C_NUMBER_MODE,
- TITLE1
- ]
- },
- {
- className: 'meta',
- variants: [
- {
- begin: '<\\?(rev|lc|livecode)',
- relevance: 10
- },
- { begin: '<\\?' },
- { begin: '\\?>' }
- ]
- },
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.BINARY_NUMBER_MODE,
- hljs.C_NUMBER_MODE,
- TITLE1
- ].concat(COMMENT_MODES),
- illegal: ';$|^\\[|^=|&|{'
- };
-};
-},{}],204:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS = {
- keyword:
- // JS keywords
- 'in if for while finally new do return else break catch instanceof throw try this ' +
- 'switch continue typeof delete debugger case default function var with ' +
- // LiveScript keywords
- 'then unless until loop of by when and or is isnt not it that otherwise from to til fallthrough super ' +
- 'case default function var void const let enum export import native ' +
- '__hasProp __extends __slice __bind __indexOf',
- literal:
- // JS literals
- 'true false null undefined ' +
- // LiveScript literals
- 'yes no on off it that void',
- built_in:
- 'npm require console print module global window document'
- };
- var JS_IDENT_RE = '[A-Za-z$_](?:\-[0-9A-Za-z$_]|[0-9A-Za-z$_])*';
- var TITLE = hljs.inherit(hljs.TITLE_MODE, {begin: JS_IDENT_RE});
- var SUBST = {
- className: 'subst',
- begin: /#\{/, end: /}/,
- keywords: KEYWORDS
- };
- var SUBST_SIMPLE = {
- className: 'subst',
- begin: /#[A-Za-z$_]/, end: /(?:\-[0-9A-Za-z$_]|[0-9A-Za-z$_])*/,
- keywords: KEYWORDS
- };
- var EXPRESSIONS = [
- hljs.BINARY_NUMBER_MODE,
- {
- className: 'number',
- begin: '(\\b0[xX][a-fA-F0-9_]+)|(\\b\\d(\\d|_\\d)*(\\.(\\d(\\d|_\\d)*)?)?(_*[eE]([-+]\\d(_\\d|\\d)*)?)?[_a-z]*)',
- relevance: 0,
- starts: {end: '(\\s*/)?', relevance: 0} // a number tries to eat the following slash to prevent treating it as a regexp
- },
- {
- className: 'string',
- variants: [
- {
- begin: /'''/, end: /'''/,
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- begin: /'/, end: /'/,
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- begin: /"""/, end: /"""/,
- contains: [hljs.BACKSLASH_ESCAPE, SUBST, SUBST_SIMPLE]
- },
- {
- begin: /"/, end: /"/,
- contains: [hljs.BACKSLASH_ESCAPE, SUBST, SUBST_SIMPLE]
- },
- {
- begin: /\\/, end: /(\s|$)/,
- excludeEnd: true
- }
- ]
- },
- {
- className: 'regexp',
- variants: [
- {
- begin: '//', end: '//[gim]*',
- contains: [SUBST, hljs.HASH_COMMENT_MODE]
- },
- {
- // regex can't start with space to parse x / 2 / 3 as two divisions
- // regex can't start with *, and it supports an "illegal" in the main mode
- begin: /\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/
- }
- ]
- },
- {
- begin: '@' + JS_IDENT_RE
- },
- {
- begin: '``', end: '``',
- excludeBegin: true, excludeEnd: true,
- subLanguage: 'javascript'
- }
- ];
- SUBST.contains = EXPRESSIONS;
-
- var PARAMS = {
- className: 'params',
- begin: '\\(', returnBegin: true,
- /* We need another contained nameless mode to not have every nested
- pair of parens to be called "params" */
- contains: [
- {
- begin: /\(/, end: /\)/,
- keywords: KEYWORDS,
- contains: ['self'].concat(EXPRESSIONS)
- }
- ]
- };
-
- return {
- aliases: ['ls'],
- keywords: KEYWORDS,
- illegal: /\/\*/,
- contains: EXPRESSIONS.concat([
- hljs.COMMENT('\\/\\*', '\\*\\/'),
- hljs.HASH_COMMENT_MODE,
- {
- className: 'function',
- contains: [TITLE, PARAMS],
- returnBegin: true,
- variants: [
- {
- begin: '(' + JS_IDENT_RE + '\\s*(?:=|:=)\\s*)?(\\(.*\\))?\\s*\\B\\->\\*?', end: '\\->\\*?'
- },
- {
- begin: '(' + JS_IDENT_RE + '\\s*(?:=|:=)\\s*)?!?(\\(.*\\))?\\s*\\B[-~]{1,2}>\\*?', end: '[-~]{1,2}>\\*?'
- },
- {
- begin: '(' + JS_IDENT_RE + '\\s*(?:=|:=)\\s*)?(\\(.*\\))?\\s*\\B!?[-~]{1,2}>\\*?', end: '!?[-~]{1,2}>\\*?'
- }
- ]
- },
- {
- className: 'class',
- beginKeywords: 'class',
- end: '$',
- illegal: /[:="\[\]]/,
- contains: [
- {
- beginKeywords: 'extends',
- endsWithParent: true,
- illegal: /[:="\[\]]/,
- contains: [TITLE]
- },
- TITLE
- ]
- },
- {
- begin: JS_IDENT_RE + ':', end: ':',
- returnBegin: true, returnEnd: true,
- relevance: 0
- }
- ])
- };
-};
-},{}],205:[function(require,module,exports){
-module.exports = function(hljs) {
- var identifier = '([-a-zA-Z$._][\\w\\-$.]*)';
- return {
- //lexemes: '[.%]?' + hljs.IDENT_RE,
- keywords:
- 'begin end true false declare define global ' +
- 'constant private linker_private internal ' +
- 'available_externally linkonce linkonce_odr weak ' +
- 'weak_odr appending dllimport dllexport common ' +
- 'default hidden protected extern_weak external ' +
- 'thread_local zeroinitializer undef null to tail ' +
- 'target triple datalayout volatile nuw nsw nnan ' +
- 'ninf nsz arcp fast exact inbounds align ' +
- 'addrspace section alias module asm sideeffect ' +
- 'gc dbg linker_private_weak attributes blockaddress ' +
- 'initialexec localdynamic localexec prefix unnamed_addr ' +
- 'ccc fastcc coldcc x86_stdcallcc x86_fastcallcc ' +
- 'arm_apcscc arm_aapcscc arm_aapcs_vfpcc ptx_device ' +
- 'ptx_kernel intel_ocl_bicc msp430_intrcc spir_func ' +
- 'spir_kernel x86_64_sysvcc x86_64_win64cc x86_thiscallcc ' +
- 'cc c signext zeroext inreg sret nounwind ' +
- 'noreturn noalias nocapture byval nest readnone ' +
- 'readonly inlinehint noinline alwaysinline optsize ssp ' +
- 'sspreq noredzone noimplicitfloat naked builtin cold ' +
- 'nobuiltin noduplicate nonlazybind optnone returns_twice ' +
- 'sanitize_address sanitize_memory sanitize_thread sspstrong ' +
- 'uwtable returned type opaque eq ne slt sgt ' +
- 'sle sge ult ugt ule uge oeq one olt ogt ' +
- 'ole oge ord uno ueq une x acq_rel acquire ' +
- 'alignstack atomic catch cleanup filter inteldialect ' +
- 'max min monotonic nand personality release seq_cst ' +
- 'singlethread umax umin unordered xchg add fadd ' +
- 'sub fsub mul fmul udiv sdiv fdiv urem srem ' +
- 'frem shl lshr ashr and or xor icmp fcmp ' +
- 'phi call trunc zext sext fptrunc fpext uitofp ' +
- 'sitofp fptoui fptosi inttoptr ptrtoint bitcast ' +
- 'addrspacecast select va_arg ret br switch invoke ' +
- 'unwind unreachable indirectbr landingpad resume ' +
- 'malloc alloca free load store getelementptr ' +
- 'extractelement insertelement shufflevector getresult ' +
- 'extractvalue insertvalue atomicrmw cmpxchg fence ' +
- 'argmemonly double',
- contains: [
- {
- className: 'keyword',
- begin: 'i\\d+'
- },
- hljs.COMMENT(
- ';', '\\n', {relevance: 0}
- ),
- // Double quote string
- hljs.QUOTE_STRING_MODE,
- {
- className: 'string',
- variants: [
- // Double-quoted string
- { begin: '"', end: '[^\\\\]"' },
- ],
- relevance: 0
- },
- {
- className: 'title',
- variants: [
- { begin: '@' + identifier },
- { begin: '@\\d+' },
- { begin: '!' + identifier },
- { begin: '!\\d+' + identifier }
- ]
- },
- {
- className: 'symbol',
- variants: [
- { begin: '%' + identifier },
- { begin: '%\\d+' },
- { begin: '#\\d+' },
- ]
- },
- {
- className: 'number',
- variants: [
- { begin: '0[xX][a-fA-F0-9]+' },
- { begin: '-?\\d+(?:[.]\\d+)?(?:[eE][-+]?\\d+(?:[.]\\d+)?)?' }
- ],
- relevance: 0
- },
- ]
- };
-};
-},{}],206:[function(require,module,exports){
-module.exports = function(hljs) {
-
- var LSL_STRING_ESCAPE_CHARS = {
- className: 'subst',
- begin: /\\[tn"\\]/
- };
-
- var LSL_STRINGS = {
- className: 'string',
- begin: '"',
- end: '"',
- contains: [
- LSL_STRING_ESCAPE_CHARS
- ]
- };
-
- var LSL_NUMBERS = {
- className: 'number',
- begin: hljs.C_NUMBER_RE
- };
-
- var LSL_CONSTANTS = {
- className: 'literal',
- variants: [
- {
- begin: '\\b(?:PI|TWO_PI|PI_BY_TWO|DEG_TO_RAD|RAD_TO_DEG|SQRT2)\\b'
- },
- {
- begin: '\\b(?:XP_ERROR_(?:EXPERIENCES_DISABLED|EXPERIENCE_(?:DISABLED|SUSPENDED)|INVALID_(?:EXPERIENCE|PARAMETERS)|KEY_NOT_FOUND|MATURITY_EXCEEDED|NONE|NOT_(?:FOUND|PERMITTED(?:_LAND)?)|NO_EXPERIENCE|QUOTA_EXCEEDED|RETRY_UPDATE|STORAGE_EXCEPTION|STORE_DISABLED|THROTTLED|UNKNOWN_ERROR)|JSON_APPEND|STATUS_(?:PHYSICS|ROTATE_[XYZ]|PHANTOM|SANDBOX|BLOCK_GRAB(?:_OBJECT)?|(?:DIE|RETURN)_AT_EDGE|CAST_SHADOWS|OK|MALFORMED_PARAMS|TYPE_MISMATCH|BOUNDS_ERROR|NOT_(?:FOUND|SUPPORTED)|INTERNAL_ERROR|WHITELIST_FAILED)|AGENT(?:_(?:BY_(?:LEGACY_|USER)NAME|FLYING|ATTACHMENTS|SCRIPTED|MOUSELOOK|SITTING|ON_OBJECT|AWAY|WALKING|IN_AIR|TYPING|CROUCHING|BUSY|ALWAYS_RUN|AUTOPILOT|LIST_(?:PARCEL(?:_OWNER)?|REGION)))?|CAMERA_(?:PITCH|DISTANCE|BEHINDNESS_(?:ANGLE|LAG)|(?:FOCUS|POSITION)(?:_(?:THRESHOLD|LOCKED|LAG))?|FOCUS_OFFSET|ACTIVE)|ANIM_ON|LOOP|REVERSE|PING_PONG|SMOOTH|ROTATE|SCALE|ALL_SIDES|LINK_(?:ROOT|SET|ALL_(?:OTHERS|CHILDREN)|THIS)|ACTIVE|PASS(?:IVE|_(?:ALWAYS|IF_NOT_HANDLED|NEVER))|SCRIPTED|CONTROL_(?:FWD|BACK|(?:ROT_)?(?:LEFT|RIGHT)|UP|DOWN|(?:ML_)?LBUTTON)|PERMISSION_(?:RETURN_OBJECTS|DEBIT|OVERRIDE_ANIMATIONS|SILENT_ESTATE_MANAGEMENT|TAKE_CONTROLS|TRIGGER_ANIMATION|ATTACH|CHANGE_LINKS|(?:CONTROL|TRACK)_CAMERA|TELEPORT)|INVENTORY_(?:TEXTURE|SOUND|OBJECT|SCRIPT|LANDMARK|CLOTHING|NOTECARD|BODYPART|ANIMATION|GESTURE|ALL|NONE)|CHANGED_(?:INVENTORY|COLOR|SHAPE|SCALE|TEXTURE|LINK|ALLOWED_DROP|OWNER|REGION(?:_START)?|TELEPORT|MEDIA)|OBJECT_(?:CLICK_ACTION|HOVER_HEIGHT|LAST_OWNER_ID|(?:PHYSICS|SERVER|STREAMING)_COST|UNKNOWN_DETAIL|CHARACTER_TIME|PHANTOM|PHYSICS|TEMP_ON_REZ|NAME|DESC|POS|PRIM_(?:COUNT|EQUIVALENCE)|RETURN_(?:PARCEL(?:_OWNER)?|REGION)|REZZER_KEY|ROO?T|VELOCITY|OMEGA|OWNER|GROUP|CREATOR|ATTACHED_POINT|RENDER_WEIGHT|(?:BODY_SHAPE|PATHFINDING)_TYPE|(?:RUNNING|TOTAL)_SCRIPT_COUNT|TOTAL_INVENTORY_COUNT|SCRIPT_(?:MEMORY|TIME))|TYPE_(?:INTEGER|FLOAT|STRING|KEY|VECTOR|ROTATION|INVALID)|(?:DEBUG|PUBLIC)_CHANNEL|ATTACH_(?:AVATAR_CENTER|CHEST|HEAD|BACK|PELVIS|MOUTH|CHIN|NECK|NOSE|BELLY|[LR](?:SHOULDER|HAND|FOOT|EAR|EYE|[UL](?:ARM|LEG)|HIP)|(?:LEFT|RIGHT)_PEC|HUD_(?:CENTER_[12]|TOP_(?:RIGHT|CENTER|LEFT)|BOTTOM(?:_(?:RIGHT|LEFT))?)|[LR]HAND_RING1|TAIL_(?:BASE|TIP)|[LR]WING|FACE_(?:JAW|[LR]EAR|[LR]EYE|TOUNGE)|GROIN|HIND_[LR]FOOT)|LAND_(?:LEVEL|RAISE|LOWER|SMOOTH|NOISE|REVERT)|DATA_(?:ONLINE|NAME|BORN|SIM_(?:POS|STATUS|RATING)|PAYINFO)|PAYMENT_INFO_(?:ON_FILE|USED)|REMOTE_DATA_(?:CHANNEL|REQUEST|REPLY)|PSYS_(?:PART_(?:BF_(?:ZERO|ONE(?:_MINUS_(?:DEST_COLOR|SOURCE_(ALPHA|COLOR)))?|DEST_COLOR|SOURCE_(ALPHA|COLOR))|BLEND_FUNC_(DEST|SOURCE)|FLAGS|(?:START|END)_(?:COLOR|ALPHA|SCALE|GLOW)|MAX_AGE|(?:RIBBON|WIND|INTERP_(?:COLOR|SCALE)|BOUNCE|FOLLOW_(?:SRC|VELOCITY)|TARGET_(?:POS|LINEAR)|EMISSIVE)_MASK)|SRC_(?:MAX_AGE|PATTERN|ANGLE_(?:BEGIN|END)|BURST_(?:RATE|PART_COUNT|RADIUS|SPEED_(?:MIN|MAX))|ACCEL|TEXTURE|TARGET_KEY|OMEGA|PATTERN_(?:DROP|EXPLODE|ANGLE(?:_CONE(?:_EMPTY)?)?)))|VEHICLE_(?:REFERENCE_FRAME|TYPE_(?:NONE|SLED|CAR|BOAT|AIRPLANE|BALLOON)|(?:LINEAR|ANGULAR)_(?:FRICTION_TIMESCALE|MOTOR_DIRECTION)|LINEAR_MOTOR_OFFSET|HOVER_(?:HEIGHT|EFFICIENCY|TIMESCALE)|BUOYANCY|(?:LINEAR|ANGULAR)_(?:DEFLECTION_(?:EFFICIENCY|TIMESCALE)|MOTOR_(?:DECAY_)?TIMESCALE)|VERTICAL_ATTRACTION_(?:EFFICIENCY|TIMESCALE)|BANKING_(?:EFFICIENCY|MIX|TIMESCALE)|FLAG_(?:NO_DEFLECTION_UP|LIMIT_(?:ROLL_ONLY|MOTOR_UP)|HOVER_(?:(?:WATER|TERRAIN|UP)_ONLY|GLOBAL_HEIGHT)|MOUSELOOK_(?:STEER|BANK)|CAMERA_DECOUPLED))|PRIM_(?:ALPHA_MODE(?:_(?:BLEND|EMISSIVE|MASK|NONE))?|NORMAL|SPECULAR|TYPE(?:_(?:BOX|CYLINDER|PRISM|SPHERE|TORUS|TUBE|RING|SCULPT))?|HOLE_(?:DEFAULT|CIRCLE|SQUARE|TRIANGLE)|MATERIAL(?:_(?:STONE|METAL|GLASS|WOOD|FLESH|PLASTIC|RUBBER))?|SHINY_(?:NONE|LOW|MEDIUM|HIGH)|BUMP_(?:NONE|BRIGHT|DARK|WOOD|BARK|BRICKS|CHECKER|CONCRETE|TILE|STONE|DISKS|GRAVEL|BLOBS|SIDING|LARGETILE|STUCCO|SUCTION|WEAVE)|TEXGEN_(?:DEFAULT|PLANAR)|SCULPT_(?:TYPE_(?:SPHERE|TORUS|PLANE|CYLINDER|MASK)|FLAG_(?:MIRROR|INVERT))|PHYSICS(?:_(?:SHAPE_(?:CONVEX|NONE|PRIM|TYPE)))?|(?:POS|ROT)_LOCAL|SLICE|TEXT|FLEXIBLE|POINT_LIGHT|TEMP_ON_REZ|PHANTOM|POSITION|SIZE|ROTATION|TEXTURE|NAME|OMEGA|DESC|LINK_TARGET|COLOR|BUMP_SHINY|FULLBRIGHT|TEXGEN|GLOW|MEDIA_(?:ALT_IMAGE_ENABLE|CONTROLS|(?:CURRENT|HOME)_URL|AUTO_(?:LOOP|PLAY|SCALE|ZOOM)|FIRST_CLICK_INTERACT|(?:WIDTH|HEIGHT)_PIXELS|WHITELIST(?:_ENABLE)?|PERMS_(?:INTERACT|CONTROL)|PARAM_MAX|CONTROLS_(?:STANDARD|MINI)|PERM_(?:NONE|OWNER|GROUP|ANYONE)|MAX_(?:URL_LENGTH|WHITELIST_(?:SIZE|COUNT)|(?:WIDTH|HEIGHT)_PIXELS)))|MASK_(?:BASE|OWNER|GROUP|EVERYONE|NEXT)|PERM_(?:TRANSFER|MODIFY|COPY|MOVE|ALL)|PARCEL_(?:MEDIA_COMMAND_(?:STOP|PAUSE|PLAY|LOOP|TEXTURE|URL|TIME|AGENT|UNLOAD|AUTO_ALIGN|TYPE|SIZE|DESC|LOOP_SET)|FLAG_(?:ALLOW_(?:FLY|(?:GROUP_)?SCRIPTS|LANDMARK|TERRAFORM|DAMAGE|CREATE_(?:GROUP_)?OBJECTS)|USE_(?:ACCESS_(?:GROUP|LIST)|BAN_LIST|LAND_PASS_LIST)|LOCAL_SOUND_ONLY|RESTRICT_PUSHOBJECT|ALLOW_(?:GROUP|ALL)_OBJECT_ENTRY)|COUNT_(?:TOTAL|OWNER|GROUP|OTHER|SELECTED|TEMP)|DETAILS_(?:NAME|DESC|OWNER|GROUP|AREA|ID|SEE_AVATARS))|LIST_STAT_(?:MAX|MIN|MEAN|MEDIAN|STD_DEV|SUM(?:_SQUARES)?|NUM_COUNT|GEOMETRIC_MEAN|RANGE)|PAY_(?:HIDE|DEFAULT)|REGION_FLAG_(?:ALLOW_DAMAGE|FIXED_SUN|BLOCK_TERRAFORM|SANDBOX|DISABLE_(?:COLLISIONS|PHYSICS)|BLOCK_FLY|ALLOW_DIRECT_TELEPORT|RESTRICT_PUSHOBJECT)|HTTP_(?:METHOD|MIMETYPE|BODY_(?:MAXLENGTH|TRUNCATED)|CUSTOM_HEADER|PRAGMA_NO_CACHE|VERBOSE_THROTTLE|VERIFY_CERT)|STRING_(?:TRIM(?:_(?:HEAD|TAIL))?)|CLICK_ACTION_(?:NONE|TOUCH|SIT|BUY|PAY|OPEN(?:_MEDIA)?|PLAY|ZOOM)|TOUCH_INVALID_FACE|PROFILE_(?:NONE|SCRIPT_MEMORY)|RC_(?:DATA_FLAGS|DETECT_PHANTOM|GET_(?:LINK_NUM|NORMAL|ROOT_KEY)|MAX_HITS|REJECT_(?:TYPES|AGENTS|(?:NON)?PHYSICAL|LAND))|RCERR_(?:CAST_TIME_EXCEEDED|SIM_PERF_LOW|UNKNOWN)|ESTATE_ACCESS_(?:ALLOWED_(?:AGENT|GROUP)_(?:ADD|REMOVE)|BANNED_AGENT_(?:ADD|REMOVE))|DENSITY|FRICTION|RESTITUTION|GRAVITY_MULTIPLIER|KFM_(?:COMMAND|CMD_(?:PLAY|STOP|PAUSE)|MODE|FORWARD|LOOP|PING_PONG|REVERSE|DATA|ROTATION|TRANSLATION)|ERR_(?:GENERIC|PARCEL_PERMISSIONS|MALFORMED_PARAMS|RUNTIME_PERMISSIONS|THROTTLED)|CHARACTER_(?:CMD_(?:(?:SMOOTH_)?STOP|JUMP)|DESIRED_(?:TURN_)?SPEED|RADIUS|STAY_WITHIN_PARCEL|LENGTH|ORIENTATION|ACCOUNT_FOR_SKIPPED_FRAMES|AVOIDANCE_MODE|TYPE(?:_(?:[ABCD]|NONE))?|MAX_(?:DECEL|TURN_RADIUS|(?:ACCEL|SPEED)))|PURSUIT_(?:OFFSET|FUZZ_FACTOR|GOAL_TOLERANCE|INTERCEPT)|REQUIRE_LINE_OF_SIGHT|FORCE_DIRECT_PATH|VERTICAL|HORIZONTAL|AVOID_(?:CHARACTERS|DYNAMIC_OBSTACLES|NONE)|PU_(?:EVADE_(?:HIDDEN|SPOTTED)|FAILURE_(?:DYNAMIC_PATHFINDING_DISABLED|INVALID_(?:GOAL|START)|NO_(?:NAVMESH|VALID_DESTINATION)|OTHER|TARGET_GONE|(?:PARCEL_)?UNREACHABLE)|(?:GOAL|SLOWDOWN_DISTANCE)_REACHED)|TRAVERSAL_TYPE(?:_(?:FAST|NONE|SLOW))?|CONTENT_TYPE_(?:ATOM|FORM|HTML|JSON|LLSD|RSS|TEXT|XHTML|XML)|GCNP_(?:RADIUS|STATIC)|(?:PATROL|WANDER)_PAUSE_AT_WAYPOINTS|OPT_(?:AVATAR|CHARACTER|EXCLUSION_VOLUME|LEGACY_LINKSET|MATERIAL_VOLUME|OTHER|STATIC_OBSTACLE|WALKABLE)|SIM_STAT_PCT_CHARS_STEPPED)\\b'
- },
- {
- begin: '\\b(?:FALSE|TRUE)\\b'
- },
- {
- begin: '\\b(?:ZERO_ROTATION)\\b'
- },
- {
- begin: '\\b(?:EOF|JSON_(?:ARRAY|DELETE|FALSE|INVALID|NULL|NUMBER|OBJECT|STRING|TRUE)|NULL_KEY|TEXTURE_(?:BLANK|DEFAULT|MEDIA|PLYWOOD|TRANSPARENT)|URL_REQUEST_(?:GRANTED|DENIED))\\b'
- },
- {
- begin: '\\b(?:ZERO_VECTOR|TOUCH_INVALID_(?:TEXCOORD|VECTOR))\\b'
- }
- ]
- };
-
- var LSL_FUNCTIONS = {
- className: 'built_in',
- begin: '\\b(?:ll(?:AgentInExperience|(?:Create|DataSize|Delete|KeyCount|Keys|Read|Update)KeyValue|GetExperience(?:Details|ErrorMessage)|ReturnObjectsBy(?:ID|Owner)|Json(?:2List|[GS]etValue|ValueType)|Sin|Cos|Tan|Atan2|Sqrt|Pow|Abs|Fabs|Frand|Floor|Ceil|Round|Vec(?:Mag|Norm|Dist)|Rot(?:Between|2(?:Euler|Fwd|Left|Up))|(?:Euler|Axes)2Rot|Whisper|(?:Region|Owner)?Say|Shout|Listen(?:Control|Remove)?|Sensor(?:Repeat|Remove)?|Detected(?:Name|Key|Owner|Type|Pos|Vel|Grab|Rot|Group|LinkNumber)|Die|Ground|Wind|(?:[GS]et)(?:AnimationOverride|MemoryLimit|PrimMediaParams|ParcelMusicURL|Object(?:Desc|Name)|PhysicsMaterial|Status|Scale|Color|Alpha|Texture|Pos|Rot|Force|Torque)|ResetAnimationOverride|(?:Scale|Offset|Rotate)Texture|(?:Rot)?Target(?:Remove)?|(?:Stop)?MoveToTarget|Apply(?:Rotational)?Impulse|Set(?:KeyframedMotion|ContentType|RegionPos|(?:Angular)?Velocity|Buoyancy|HoverHeight|ForceAndTorque|TimerEvent|ScriptState|Damage|TextureAnim|Sound(?:Queueing|Radius)|Vehicle(?:Type|(?:Float|Vector|Rotation)Param)|(?:Touch|Sit)?Text|Camera(?:Eye|At)Offset|PrimitiveParams|ClickAction|Link(?:Alpha|Color|PrimitiveParams(?:Fast)?|Texture(?:Anim)?|Camera|Media)|RemoteScriptAccessPin|PayPrice|LocalRot)|ScaleByFactor|Get(?:(?:Max|Min)ScaleFactor|ClosestNavPoint|StaticPath|SimStats|Env|PrimitiveParams|Link(?:PrimitiveParams|Number(?:OfSides)?|Key|Name|Media)|HTTPHeader|FreeURLs|Object(?:Details|PermMask|PrimCount)|Parcel(?:MaxPrims|Details|Prim(?:Count|Owners))|Attached(?:List)?|(?:SPMax|Free|Used)Memory|Region(?:Name|TimeDilation|FPS|Corner|AgentCount)|Root(?:Position|Rotation)|UnixTime|(?:Parcel|Region)Flags|(?:Wall|GMT)clock|SimulatorHostname|BoundingBox|GeometricCenter|Creator|NumberOf(?:Prims|NotecardLines|Sides)|Animation(?:List)?|(?:Camera|Local)(?:Pos|Rot)|Vel|Accel|Omega|Time(?:stamp|OfDay)|(?:Object|CenterOf)?Mass|MassMKS|Energy|Owner|(?:Owner)?Key|SunDirection|Texture(?:Offset|Scale|Rot)|Inventory(?:Number|Name|Key|Type|Creator|PermMask)|Permissions(?:Key)?|StartParameter|List(?:Length|EntryType)|Date|Agent(?:Size|Info|Language|List)|LandOwnerAt|NotecardLine|Script(?:Name|State))|(?:Get|Reset|GetAndReset)Time|PlaySound(?:Slave)?|LoopSound(?:Master|Slave)?|(?:Trigger|Stop|Preload)Sound|(?:(?:Get|Delete)Sub|Insert)String|To(?:Upper|Lower)|Give(?:InventoryList|Money)|RezObject|(?:Stop)?LookAt|Sleep|CollisionFilter|(?:Take|Release)Controls|DetachFromAvatar|AttachToAvatar(?:Temp)?|InstantMessage|(?:GetNext)?Email|StopHover|MinEventDelay|RotLookAt|String(?:Length|Trim)|(?:Start|Stop)Animation|TargetOmega|Request(?:Experience)?Permissions|(?:Create|Break)Link|BreakAllLinks|(?:Give|Remove)Inventory|Water|PassTouches|Request(?:Agent|Inventory)Data|TeleportAgent(?:Home|GlobalCoords)?|ModifyLand|CollisionSound|ResetScript|MessageLinked|PushObject|PassCollisions|AxisAngle2Rot|Rot2(?:Axis|Angle)|A(?:cos|sin)|AngleBetween|AllowInventoryDrop|SubStringIndex|List2(?:CSV|Integer|Json|Float|String|Key|Vector|Rot|List(?:Strided)?)|DeleteSubList|List(?:Statistics|Sort|Randomize|(?:Insert|Find|Replace)List)|EdgeOfWorld|AdjustSoundVolume|Key2Name|TriggerSoundLimited|EjectFromLand|(?:CSV|ParseString)2List|OverMyLand|SameGroup|UnSit|Ground(?:Slope|Normal|Contour)|GroundRepel|(?:Set|Remove)VehicleFlags|(?:AvatarOn)?(?:Link)?SitTarget|Script(?:Danger|Profiler)|Dialog|VolumeDetect|ResetOtherScript|RemoteLoadScriptPin|(?:Open|Close)RemoteDataChannel|SendRemoteData|RemoteDataReply|(?:Integer|String)ToBase64|XorBase64|Log(?:10)?|Base64To(?:String|Integer)|ParseStringKeepNulls|RezAtRoot|RequestSimulatorData|ForceMouselook|(?:Load|Release|(?:E|Une)scape)URL|ParcelMedia(?:CommandList|Query)|ModPow|MapDestination|(?:RemoveFrom|AddTo|Reset)Land(?:Pass|Ban)List|(?:Set|Clear)CameraParams|HTTP(?:Request|Response)|TextBox|DetectedTouch(?:UV|Face|Pos|(?:N|Bin)ormal|ST)|(?:MD5|SHA1|DumpList2)String|Request(?:Secure)?URL|Clear(?:Prim|Link)Media|(?:Link)?ParticleSystem|(?:Get|Request)(?:Username|DisplayName)|RegionSayTo|CastRay|GenerateKey|TransferLindenDollars|ManageEstateAccess|(?:Create|Delete)Character|ExecCharacterCmd|Evade|FleeFrom|NavigateTo|PatrolPoints|Pursue|UpdateCharacter|WanderWithin))\\b'
- };
-
- return {
- illegal: ':',
- contains: [
- LSL_STRINGS,
- {
- className: 'comment',
- variants: [
- hljs.COMMENT('//', '$'),
- hljs.COMMENT('/\\*', '\\*/')
- ]
- },
- LSL_NUMBERS,
- {
- className: 'section',
- variants: [
- {
- begin: '\\b(?:state|default)\\b'
- },
- {
- begin: '\\b(?:state_(?:entry|exit)|touch(?:_(?:start|end))?|(?:land_)?collision(?:_(?:start|end))?|timer|listen|(?:no_)?sensor|control|(?:not_)?at_(?:rot_)?target|money|email|experience_permissions(?:_denied)?|run_time_permissions|changed|attach|dataserver|moving_(?:start|end)|link_message|(?:on|object)_rez|remote_data|http_re(?:sponse|quest)|path_update|transaction_result)\\b'
- }
- ]
- },
- LSL_FUNCTIONS,
- LSL_CONSTANTS,
- {
- className: 'type',
- begin: '\\b(?:integer|float|string|key|vector|quaternion|rotation|list)\\b'
- }
- ]
- };
-};
-},{}],207:[function(require,module,exports){
-module.exports = function(hljs) {
- var OPENING_LONG_BRACKET = '\\[=*\\[';
- var CLOSING_LONG_BRACKET = '\\]=*\\]';
- var LONG_BRACKETS = {
- begin: OPENING_LONG_BRACKET, end: CLOSING_LONG_BRACKET,
- contains: ['self']
- };
- var COMMENTS = [
- hljs.COMMENT('--(?!' + OPENING_LONG_BRACKET + ')', '$'),
- hljs.COMMENT(
- '--' + OPENING_LONG_BRACKET,
- CLOSING_LONG_BRACKET,
- {
- contains: [LONG_BRACKETS],
- relevance: 10
- }
- )
- ];
- return {
- lexemes: hljs.UNDERSCORE_IDENT_RE,
- keywords: {
- literal: "true false nil",
- keyword: "and break do else elseif end for goto if in local not or repeat return then until while",
- built_in:
- //Metatags and globals:
- '_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len ' +
- '__gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert ' +
- //Standard methods and properties:
- 'collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring' +
- 'module next pairs pcall print rawequal rawget rawset require select setfenv' +
- 'setmetatable tonumber tostring type unpack xpcall arg self' +
- //Library methods and properties (one line per library):
- 'coroutine resume yield status wrap create running debug getupvalue ' +
- 'debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv ' +
- 'io lines write close flush open output type read stderr stdin input stdout popen tmpfile ' +
- 'math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan ' +
- 'os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall ' +
- 'string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower ' +
- 'table setn insert getn foreachi maxn foreach concat sort remove'
- },
- contains: COMMENTS.concat([
- {
- className: 'function',
- beginKeywords: 'function', end: '\\)',
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {begin: '([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*'}),
- {
- className: 'params',
- begin: '\\(', endsWithParent: true,
- contains: COMMENTS
- }
- ].concat(COMMENTS)
- },
- hljs.C_NUMBER_MODE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- {
- className: 'string',
- begin: OPENING_LONG_BRACKET, end: CLOSING_LONG_BRACKET,
- contains: [LONG_BRACKETS],
- relevance: 5
- }
- ])
- };
-};
-},{}],208:[function(require,module,exports){
-module.exports = function(hljs) {
- /* Variables: simple (eg $(var)) and special (eg $@) */
- var VARIABLE = {
- className: 'variable',
- variants: [
- {
- begin: '\\$\\(' + hljs.UNDERSCORE_IDENT_RE + '\\)',
- contains: [hljs.BACKSLASH_ESCAPE],
- },
- {
- begin: /\$[@%<?\^\+\*]/
- },
- ]
- };
- /* Quoted string with variables inside */
- var QUOTE_STRING = {
- className: 'string',
- begin: /"/, end: /"/,
- contains: [
- hljs.BACKSLASH_ESCAPE,
- VARIABLE,
- ]
- };
- /* Function: $(func arg,...) */
- var FUNC = {
- className: 'variable',
- begin: /\$\([\w-]+\s/, end: /\)/,
- keywords: {
- built_in:
- 'subst patsubst strip findstring filter filter-out sort ' +
- 'word wordlist firstword lastword dir notdir suffix basename ' +
- 'addsuffix addprefix join wildcard realpath abspath error warning ' +
- 'shell origin flavor foreach if or and call eval file value',
- },
- contains: [
- VARIABLE,
- ]
- };
- /* Variable assignment */
- var VAR_ASSIG = {
- begin: '^' + hljs.UNDERSCORE_IDENT_RE + '\\s*[:+?]?=',
- illegal: '\\n',
- returnBegin: true,
- contains: [
- {
- begin: '^' + hljs.UNDERSCORE_IDENT_RE, end: '[:+?]?=',
- excludeEnd: true,
- }
- ]
- };
- /* Meta targets (.PHONY) */
- var META = {
- className: 'meta',
- begin: /^\.PHONY:/, end: /$/,
- keywords: {'meta-keyword': '.PHONY'},
- lexemes: /[\.\w]+/
- };
- /* Targets */
- var TARGET = {
- className: 'section',
- begin: /^[^\s]+:/, end: /$/,
- contains: [VARIABLE,]
- };
- return {
- aliases: ['mk', 'mak'],
- keywords:
- 'define endef undefine ifdef ifndef ifeq ifneq else endif ' +
- 'include -include sinclude override export unexport private vpath',
- lexemes: /[\w-]+/,
- contains: [
- hljs.HASH_COMMENT_MODE,
- VARIABLE,
- QUOTE_STRING,
- FUNC,
- VAR_ASSIG,
- META,
- TARGET,
- ]
- };
-};
-},{}],209:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['md', 'mkdown', 'mkd'],
- contains: [
- // highlight headers
- {
- className: 'section',
- variants: [
- { begin: '^#{1,6}', end: '$' },
- { begin: '^.+?\\n[=-]{2,}$' }
- ]
- },
- // inline html
- {
- begin: '<', end: '>',
- subLanguage: 'xml',
- relevance: 0
- },
- // lists (indicators only)
- {
- className: 'bullet',
- begin: '^([*+-]|(\\d+\\.))\\s+'
- },
- // strong segments
- {
- className: 'strong',
- begin: '[*_]{2}.+?[*_]{2}'
- },
- // emphasis segments
- {
- className: 'emphasis',
- variants: [
- { begin: '\\*.+?\\*' },
- { begin: '_.+?_'
- , relevance: 0
- }
- ]
- },
- // blockquotes
- {
- className: 'quote',
- begin: '^>\\s+', end: '$'
- },
- // code snippets
- {
- className: 'code',
- variants: [
- {
- begin: '^```\w*\s*$', end: '^```\s*$'
- },
- {
- begin: '`.+?`'
- },
- {
- begin: '^( {4}|\t)', end: '$',
- relevance: 0
- }
- ]
- },
- // horizontal rules
- {
- begin: '^[-\\*]{3,}', end: '$'
- },
- // using links - title and link
- {
- begin: '\\[.+?\\][\\(\\[].*?[\\)\\]]',
- returnBegin: true,
- contains: [
- {
- className: 'string',
- begin: '\\[', end: '\\]',
- excludeBegin: true,
- returnEnd: true,
- relevance: 0
- },
- {
- className: 'link',
- begin: '\\]\\(', end: '\\)',
- excludeBegin: true, excludeEnd: true
- },
- {
- className: 'symbol',
- begin: '\\]\\[', end: '\\]',
- excludeBegin: true, excludeEnd: true
- }
- ],
- relevance: 10
- },
- {
- begin: /^\[[^\n]+\]:/,
- returnBegin: true,
- contains: [
- {
- className: 'symbol',
- begin: /\[/, end: /\]/,
- excludeBegin: true, excludeEnd: true
- },
- {
- className: 'link',
- begin: /:\s*/, end: /$/,
- excludeBegin: true
- }
- ]
- }
- ]
- };
-};
-},{}],210:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['mma'],
- lexemes: '(\\$|\\b)' + hljs.IDENT_RE + '\\b',
- keywords: 'AbelianGroup Abort AbortKernels AbortProtect Above Abs Absolute AbsoluteCorrelation AbsoluteCorrelationFunction AbsoluteCurrentValue AbsoluteDashing AbsoluteFileName AbsoluteOptions AbsolutePointSize AbsoluteThickness AbsoluteTime AbsoluteTiming AccountingForm Accumulate Accuracy AccuracyGoal ActionDelay ActionMenu ActionMenuBox ActionMenuBoxOptions Active ActiveItem ActiveStyle AcyclicGraphQ AddOnHelpPath AddTo AdjacencyGraph AdjacencyList AdjacencyMatrix AdjustmentBox AdjustmentBoxOptions AdjustTimeSeriesForecast AffineTransform After AiryAi AiryAiPrime AiryAiZero AiryBi AiryBiPrime AiryBiZero AlgebraicIntegerQ AlgebraicNumber AlgebraicNumberDenominator AlgebraicNumberNorm AlgebraicNumberPolynomial AlgebraicNumberTrace AlgebraicRules AlgebraicRulesData Algebraics AlgebraicUnitQ Alignment AlignmentMarker AlignmentPoint All AllowedDimensions AllowGroupClose AllowInlineCells AllowKernelInitialization AllowReverseGroupClose AllowScriptLevelChange AlphaChannel AlternatingGroup AlternativeHypothesis Alternatives AmbientLight Analytic AnchoredSearch And AndersonDarlingTest AngerJ AngleBracket AngularGauge Animate AnimationCycleOffset AnimationCycleRepetitions AnimationDirection AnimationDisplayTime AnimationRate AnimationRepetitions AnimationRunning Animator AnimatorBox AnimatorBoxOptions AnimatorElements Annotation Annuity AnnuityDue Antialiasing Antisymmetric Apart ApartSquareFree Appearance AppearanceElements AppellF1 Append AppendTo Apply ArcCos ArcCosh ArcCot ArcCoth ArcCsc ArcCsch ArcSec ArcSech ArcSin ArcSinDistribution ArcSinh ArcTan ArcTanh Arg ArgMax ArgMin ArgumentCountQ ARIMAProcess ArithmeticGeometricMean ARMAProcess ARProcess Array ArrayComponents ArrayDepth ArrayFlatten ArrayPad ArrayPlot ArrayQ ArrayReshape ArrayRules Arrays Arrow Arrow3DBox ArrowBox Arrowheads AspectRatio AspectRatioFixed Assert Assuming Assumptions AstronomicalData Asynchronous AsynchronousTaskObject AsynchronousTasks AtomQ Attributes AugmentedSymmetricPolynomial AutoAction AutoDelete AutoEvaluateEvents AutoGeneratedPackage AutoIndent AutoIndentSpacings AutoItalicWords AutoloadPath AutoMatch Automatic AutomaticImageSize AutoMultiplicationSymbol AutoNumberFormatting AutoOpenNotebooks AutoOpenPalettes AutorunSequencing AutoScaling AutoScroll AutoSpacing AutoStyleOptions AutoStyleWords Axes AxesEdge AxesLabel AxesOrigin AxesStyle Axis ' +
- 'BabyMonsterGroupB Back Background BackgroundTasksSettings Backslash Backsubstitution Backward Band BandpassFilter BandstopFilter BarabasiAlbertGraphDistribution BarChart BarChart3D BarLegend BarlowProschanImportance BarnesG BarOrigin BarSpacing BartlettHannWindow BartlettWindow BaseForm Baseline BaselinePosition BaseStyle BatesDistribution BattleLemarieWavelet Because BeckmannDistribution Beep Before Begin BeginDialogPacket BeginFrontEndInteractionPacket BeginPackage BellB BellY Below BenfordDistribution BeniniDistribution BenktanderGibratDistribution BenktanderWeibullDistribution BernoulliB BernoulliDistribution BernoulliGraphDistribution BernoulliProcess BernsteinBasis BesselFilterModel BesselI BesselJ BesselJZero BesselK BesselY BesselYZero Beta BetaBinomialDistribution BetaDistribution BetaNegativeBinomialDistribution BetaPrimeDistribution BetaRegularized BetweennessCentrality BezierCurve BezierCurve3DBox BezierCurve3DBoxOptions BezierCurveBox BezierCurveBoxOptions BezierFunction BilateralFilter Binarize BinaryFormat BinaryImageQ BinaryRead BinaryReadList BinaryWrite BinCounts BinLists Binomial BinomialDistribution BinomialProcess BinormalDistribution BiorthogonalSplineWavelet BipartiteGraphQ BirnbaumImportance BirnbaumSaundersDistribution BitAnd BitClear BitGet BitLength BitNot BitOr BitSet BitShiftLeft BitShiftRight BitXor Black BlackmanHarrisWindow BlackmanNuttallWindow BlackmanWindow Blank BlankForm BlankNullSequence BlankSequence Blend Block BlockRandom BlomqvistBeta BlomqvistBetaTest Blue Blur BodePlot BohmanWindow Bold Bookmarks Boole BooleanConsecutiveFunction BooleanConvert BooleanCountingFunction BooleanFunction BooleanGraph BooleanMaxterms BooleanMinimize BooleanMinterms Booleans BooleanTable BooleanVariables BorderDimensions BorelTannerDistribution Bottom BottomHatTransform BoundaryStyle Bounds Box BoxBaselineShift BoxData BoxDimensions Boxed Boxes BoxForm BoxFormFormatTypes BoxFrame BoxID BoxMargins BoxMatrix BoxRatios BoxRotation BoxRotationPoint BoxStyle BoxWhiskerChart Bra BracketingBar BraKet BrayCurtisDistance BreadthFirstScan Break Brown BrownForsytheTest BrownianBridgeProcess BrowserCategory BSplineBasis BSplineCurve BSplineCurve3DBox BSplineCurveBox BSplineCurveBoxOptions BSplineFunction BSplineSurface BSplineSurface3DBox BubbleChart BubbleChart3D BubbleScale BubbleSizes BulletGauge BusinessDayQ ButterflyGraph ButterworthFilterModel Button ButtonBar ButtonBox ButtonBoxOptions ButtonCell ButtonContents ButtonData ButtonEvaluator ButtonExpandable ButtonFrame ButtonFunction ButtonMargins ButtonMinHeight ButtonNote ButtonNotebook ButtonSource ButtonStyle ButtonStyleMenuListing Byte ByteCount ByteOrdering ' +
- 'C CachedValue CacheGraphics CalendarData CalendarType CallPacket CanberraDistance Cancel CancelButton CandlestickChart Cap CapForm CapitalDifferentialD CardinalBSplineBasis CarmichaelLambda Cases Cashflow Casoratian Catalan CatalanNumber Catch CauchyDistribution CauchyWindow CayleyGraph CDF CDFDeploy CDFInformation CDFWavelet Ceiling Cell CellAutoOverwrite CellBaseline CellBoundingBox CellBracketOptions CellChangeTimes CellContents CellContext CellDingbat CellDynamicExpression CellEditDuplicate CellElementsBoundingBox CellElementSpacings CellEpilog CellEvaluationDuplicate CellEvaluationFunction CellEventActions CellFrame CellFrameColor CellFrameLabelMargins CellFrameLabels CellFrameMargins CellGroup CellGroupData CellGrouping CellGroupingRules CellHorizontalScrolling CellID CellLabel CellLabelAutoDelete CellLabelMargins CellLabelPositioning CellMargins CellObject CellOpen CellPrint CellProlog Cells CellSize CellStyle CellTags CellularAutomaton CensoredDistribution Censoring Center CenterDot CentralMoment CentralMomentGeneratingFunction CForm ChampernowneNumber ChanVeseBinarize Character CharacterEncoding CharacterEncodingsPath CharacteristicFunction CharacteristicPolynomial CharacterRange Characters ChartBaseStyle ChartElementData ChartElementDataFunction ChartElementFunction ChartElements ChartLabels ChartLayout ChartLegends ChartStyle Chebyshev1FilterModel Chebyshev2FilterModel ChebyshevDistance ChebyshevT ChebyshevU Check CheckAbort CheckAll Checkbox CheckboxBar CheckboxBox CheckboxBoxOptions ChemicalData ChessboardDistance ChiDistribution ChineseRemainder ChiSquareDistribution ChoiceButtons ChoiceDialog CholeskyDecomposition Chop Circle CircleBox CircleDot CircleMinus CirclePlus CircleTimes CirculantGraph CityData Clear ClearAll ClearAttributes ClearSystemCache ClebschGordan ClickPane Clip ClipboardNotebook ClipFill ClippingStyle ClipPlanes ClipRange Clock ClockGauge ClockwiseContourIntegral Close Closed CloseKernels ClosenessCentrality Closing ClosingAutoSave ClosingEvent ClusteringComponents CMYKColor Coarse Coefficient CoefficientArrays CoefficientDomain CoefficientList CoefficientRules CoifletWavelet Collect Colon ColonForm ColorCombine ColorConvert ColorData ColorDataFunction ColorFunction ColorFunctionScaling Colorize ColorNegate ColorOutput ColorProfileData ColorQuantize ColorReplace ColorRules ColorSelectorSettings ColorSeparate ColorSetter ColorSetterBox ColorSetterBoxOptions ColorSlider ColorSpace Column ColumnAlignments ColumnBackgrounds ColumnForm ColumnLines ColumnsEqual ColumnSpacings ColumnWidths CommonDefaultFormatTypes Commonest CommonestFilter CommonUnits CommunityBoundaryStyle CommunityGraphPlot CommunityLabels CommunityRegionStyle CompatibleUnitQ CompilationOptions CompilationTarget Compile Compiled CompiledFunction Complement CompleteGraph CompleteGraphQ CompleteKaryTree CompletionsListPacket Complex Complexes ComplexExpand ComplexInfinity ComplexityFunction ComponentMeasurements ' +
- 'ComponentwiseContextMenu Compose ComposeList ComposeSeries Composition CompoundExpression CompoundPoissonDistribution CompoundPoissonProcess CompoundRenewalProcess Compress CompressedData Condition ConditionalExpression Conditioned Cone ConeBox ConfidenceLevel ConfidenceRange ConfidenceTransform ConfigurationPath Congruent Conjugate ConjugateTranspose Conjunction Connect ConnectedComponents ConnectedGraphQ ConnesWindow ConoverTest ConsoleMessage ConsoleMessagePacket ConsolePrint Constant ConstantArray Constants ConstrainedMax ConstrainedMin ContentPadding ContentsBoundingBox ContentSelectable ContentSize Context ContextMenu Contexts ContextToFilename ContextToFileName Continuation Continue ContinuedFraction ContinuedFractionK ContinuousAction ContinuousMarkovProcess ContinuousTimeModelQ ContinuousWaveletData ContinuousWaveletTransform ContourDetect ContourGraphics ContourIntegral ContourLabels ContourLines ContourPlot ContourPlot3D Contours ContourShading ContourSmoothing ContourStyle ContraharmonicMean Control ControlActive ControlAlignment ControllabilityGramian ControllabilityMatrix ControllableDecomposition ControllableModelQ ControllerDuration ControllerInformation ControllerInformationData ControllerLinking ControllerManipulate ControllerMethod ControllerPath ControllerState ControlPlacement ControlsRendering ControlType Convergents ConversionOptions ConversionRules ConvertToBitmapPacket ConvertToPostScript ConvertToPostScriptPacket Convolve ConwayGroupCo1 ConwayGroupCo2 ConwayGroupCo3 CoordinateChartData CoordinatesToolOptions CoordinateTransform CoordinateTransformData CoprimeQ Coproduct CopulaDistribution Copyable CopyDirectory CopyFile CopyTag CopyToClipboard CornerFilter CornerNeighbors Correlation CorrelationDistance CorrelationFunction CorrelationTest Cos Cosh CoshIntegral CosineDistance CosineWindow CosIntegral Cot Coth Count CounterAssignments CounterBox CounterBoxOptions CounterClockwiseContourIntegral CounterEvaluator CounterFunction CounterIncrements CounterStyle CounterStyleMenuListing CountRoots CountryData Covariance CovarianceEstimatorFunction CovarianceFunction CoxianDistribution CoxIngersollRossProcess CoxModel CoxModelFit CramerVonMisesTest CreateArchive CreateDialog CreateDirectory CreateDocument CreateIntermediateDirectories CreatePalette CreatePalettePacket CreateScheduledTask CreateTemporary CreateWindow CriticalityFailureImportance CriticalitySuccessImportance CriticalSection Cross CrossingDetect CrossMatrix Csc Csch CubeRoot Cubics Cuboid CuboidBox Cumulant CumulantGeneratingFunction Cup CupCap Curl CurlyDoubleQuote CurlyQuote CurrentImage CurrentlySpeakingPacket CurrentValue CurvatureFlowFilter CurveClosed Cyan CycleGraph CycleIndexPolynomial Cycles CyclicGroup Cyclotomic Cylinder CylinderBox CylindricalDecomposition ' +
- 'D DagumDistribution DamerauLevenshteinDistance DampingFactor Darker Dashed Dashing DataCompression DataDistribution DataRange DataReversed Date DateDelimiters DateDifference DateFunction DateList DateListLogPlot DateListPlot DatePattern DatePlus DateRange DateString DateTicksFormat DaubechiesWavelet DavisDistribution DawsonF DayCount DayCountConvention DayMatchQ DayName DayPlus DayRange DayRound DeBruijnGraph Debug DebugTag Decimal DeclareKnownSymbols DeclarePackage Decompose Decrement DedekindEta Default DefaultAxesStyle DefaultBaseStyle DefaultBoxStyle DefaultButton DefaultColor DefaultControlPlacement DefaultDuplicateCellStyle DefaultDuration DefaultElement DefaultFaceGridsStyle DefaultFieldHintStyle DefaultFont DefaultFontProperties DefaultFormatType DefaultFormatTypeForStyle DefaultFrameStyle DefaultFrameTicksStyle DefaultGridLinesStyle DefaultInlineFormatType DefaultInputFormatType DefaultLabelStyle DefaultMenuStyle DefaultNaturalLanguage DefaultNewCellStyle DefaultNewInlineCellStyle DefaultNotebook DefaultOptions DefaultOutputFormatType DefaultStyle DefaultStyleDefinitions DefaultTextFormatType DefaultTextInlineFormatType DefaultTicksStyle DefaultTooltipStyle DefaultValues Defer DefineExternal DefineInputStreamMethod DefineOutputStreamMethod Definition Degree DegreeCentrality DegreeGraphDistribution DegreeLexicographic DegreeReverseLexicographic Deinitialization Del Deletable Delete DeleteBorderComponents DeleteCases DeleteContents DeleteDirectory DeleteDuplicates DeleteFile DeleteSmallComponents DeleteWithContents DeletionWarning Delimiter DelimiterFlashTime DelimiterMatching Delimiters Denominator DensityGraphics DensityHistogram DensityPlot DependentVariables Deploy Deployed Depth DepthFirstScan Derivative DerivativeFilter DescriptorStateSpace DesignMatrix Det DGaussianWavelet DiacriticalPositioning Diagonal DiagonalMatrix Dialog DialogIndent DialogInput DialogLevel DialogNotebook DialogProlog DialogReturn DialogSymbols Diamond DiamondMatrix DiceDissimilarity DictionaryLookup DifferenceDelta DifferenceOrder DifferenceRoot DifferenceRootReduce Differences DifferentialD DifferentialRoot DifferentialRootReduce DifferentiatorFilter DigitBlock DigitBlockMinimum DigitCharacter DigitCount DigitQ DihedralGroup Dilation Dimensions DiracComb DiracDelta DirectedEdge DirectedEdges DirectedGraph DirectedGraphQ DirectedInfinity Direction Directive Directory DirectoryName DirectoryQ DirectoryStack DirichletCharacter DirichletConvolve DirichletDistribution DirichletL DirichletTransform DirichletWindow DisableConsolePrintPacket DiscreteChirpZTransform DiscreteConvolve DiscreteDelta DiscreteHadamardTransform DiscreteIndicator DiscreteLQEstimatorGains DiscreteLQRegulatorGains DiscreteLyapunovSolve DiscreteMarkovProcess DiscretePlot DiscretePlot3D DiscreteRatio DiscreteRiccatiSolve DiscreteShift DiscreteTimeModelQ DiscreteUniformDistribution DiscreteVariables DiscreteWaveletData DiscreteWaveletPacketTransform ' +
- 'DiscreteWaveletTransform Discriminant Disjunction Disk DiskBox DiskMatrix Dispatch DispersionEstimatorFunction Display DisplayAllSteps DisplayEndPacket DisplayFlushImagePacket DisplayForm DisplayFunction DisplayPacket DisplayRules DisplaySetSizePacket DisplayString DisplayTemporary DisplayWith DisplayWithRef DisplayWithVariable DistanceFunction DistanceTransform Distribute Distributed DistributedContexts DistributeDefinitions DistributionChart DistributionDomain DistributionFitTest DistributionParameterAssumptions DistributionParameterQ Dithering Div Divergence Divide DivideBy Dividers Divisible Divisors DivisorSigma DivisorSum DMSList DMSString Do DockedCells DocumentNotebook DominantColors DOSTextFormat Dot DotDashed DotEqual Dotted DoubleBracketingBar DoubleContourIntegral DoubleDownArrow DoubleLeftArrow DoubleLeftRightArrow DoubleLeftTee DoubleLongLeftArrow DoubleLongLeftRightArrow DoubleLongRightArrow DoubleRightArrow DoubleRightTee DoubleUpArrow DoubleUpDownArrow DoubleVerticalBar DoublyInfinite Down DownArrow DownArrowBar DownArrowUpArrow DownLeftRightVector DownLeftTeeVector DownLeftVector DownLeftVectorBar DownRightTeeVector DownRightVector DownRightVectorBar Downsample DownTee DownTeeArrow DownValues DragAndDrop DrawEdges DrawFrontFaces DrawHighlighted Drop DSolve Dt DualLinearProgramming DualSystemsModel DumpGet DumpSave DuplicateFreeQ Dynamic DynamicBox DynamicBoxOptions DynamicEvaluationTimeout DynamicLocation DynamicModule DynamicModuleBox DynamicModuleBoxOptions DynamicModuleParent DynamicModuleValues DynamicName DynamicNamespace DynamicReference DynamicSetting DynamicUpdating DynamicWrapper DynamicWrapperBox DynamicWrapperBoxOptions ' +
- 'E EccentricityCentrality EdgeAdd EdgeBetweennessCentrality EdgeCapacity EdgeCapForm EdgeColor EdgeConnectivity EdgeCost EdgeCount EdgeCoverQ EdgeDashing EdgeDelete EdgeDetect EdgeForm EdgeIndex EdgeJoinForm EdgeLabeling EdgeLabels EdgeLabelStyle EdgeList EdgeOpacity EdgeQ EdgeRenderingFunction EdgeRules EdgeShapeFunction EdgeStyle EdgeThickness EdgeWeight Editable EditButtonSettings EditCellTagsSettings EditDistance EffectiveInterest Eigensystem Eigenvalues EigenvectorCentrality Eigenvectors Element ElementData Eliminate EliminationOrder EllipticE EllipticExp EllipticExpPrime EllipticF EllipticFilterModel EllipticK EllipticLog EllipticNomeQ EllipticPi EllipticReducedHalfPeriods EllipticTheta EllipticThetaPrime EmitSound EmphasizeSyntaxErrors EmpiricalDistribution Empty EmptyGraphQ EnableConsolePrintPacket Enabled Encode End EndAdd EndDialogPacket EndFrontEndInteractionPacket EndOfFile EndOfLine EndOfString EndPackage EngineeringForm Enter EnterExpressionPacket EnterTextPacket Entropy EntropyFilter Environment Epilog Equal EqualColumns EqualRows EqualTilde EquatedTo Equilibrium EquirippleFilterKernel Equivalent Erf Erfc Erfi ErlangB ErlangC ErlangDistribution Erosion ErrorBox ErrorBoxOptions ErrorNorm ErrorPacket ErrorsDialogSettings EstimatedDistribution EstimatedProcess EstimatorGains EstimatorRegulator EuclideanDistance EulerE EulerGamma EulerianGraphQ EulerPhi Evaluatable Evaluate Evaluated EvaluatePacket EvaluationCell EvaluationCompletionAction EvaluationElements EvaluationMode EvaluationMonitor EvaluationNotebook EvaluationObject EvaluationOrder Evaluator EvaluatorNames EvenQ EventData EventEvaluator EventHandler EventHandlerTag EventLabels ExactBlackmanWindow ExactNumberQ ExactRootIsolation ExampleData Except ExcludedForms ExcludePods Exclusions ExclusionsStyle Exists Exit ExitDialog Exp Expand ExpandAll ExpandDenominator ExpandFileName ExpandNumerator Expectation ExpectationE ExpectedValue ExpGammaDistribution ExpIntegralE ExpIntegralEi Exponent ExponentFunction ExponentialDistribution ExponentialFamily ExponentialGeneratingFunction ExponentialMovingAverage ExponentialPowerDistribution ExponentPosition ExponentStep Export ExportAutoReplacements ExportPacket ExportString Expression ExpressionCell ExpressionPacket ExpToTrig ExtendedGCD Extension ExtentElementFunction ExtentMarkers ExtentSize ExternalCall ExternalDataCharacterEncoding Extract ExtractArchive ExtremeValueDistribution ' +
- 'FaceForm FaceGrids FaceGridsStyle Factor FactorComplete Factorial Factorial2 FactorialMoment FactorialMomentGeneratingFunction FactorialPower FactorInteger FactorList FactorSquareFree FactorSquareFreeList FactorTerms FactorTermsList Fail FailureDistribution False FARIMAProcess FEDisableConsolePrintPacket FeedbackSector FeedbackSectorStyle FeedbackType FEEnableConsolePrintPacket Fibonacci FieldHint FieldHintStyle FieldMasked FieldSize File FileBaseName FileByteCount FileDate FileExistsQ FileExtension FileFormat FileHash FileInformation FileName FileNameDepth FileNameDialogSettings FileNameDrop FileNameJoin FileNames FileNameSetter FileNameSplit FileNameTake FilePrint FileType FilledCurve FilledCurveBox Filling FillingStyle FillingTransform FilterRules FinancialBond FinancialData FinancialDerivative FinancialIndicator Find FindArgMax FindArgMin FindClique FindClusters FindCurvePath FindDistributionParameters FindDivisions FindEdgeCover FindEdgeCut FindEulerianCycle FindFaces FindFile FindFit FindGeneratingFunction FindGeoLocation FindGeometricTransform FindGraphCommunities FindGraphIsomorphism FindGraphPartition FindHamiltonianCycle FindIndependentEdgeSet FindIndependentVertexSet FindInstance FindIntegerNullVector FindKClan FindKClique FindKClub FindKPlex FindLibrary FindLinearRecurrence FindList FindMaximum FindMaximumFlow FindMaxValue FindMinimum FindMinimumCostFlow FindMinimumCut FindMinValue FindPermutation FindPostmanTour FindProcessParameters FindRoot FindSequenceFunction FindSettings FindShortestPath FindShortestTour FindThreshold FindVertexCover FindVertexCut Fine FinishDynamic FiniteAbelianGroupCount FiniteGroupCount FiniteGroupData First FirstPassageTimeDistribution FischerGroupFi22 FischerGroupFi23 FischerGroupFi24Prime FisherHypergeometricDistribution FisherRatioTest FisherZDistribution Fit FitAll FittedModel FixedPoint FixedPointList FlashSelection Flat Flatten FlattenAt FlatTopWindow FlipView Floor FlushPrintOutputPacket Fold FoldList Font FontColor FontFamily FontForm FontName FontOpacity FontPostScriptName FontProperties FontReencoding FontSize FontSlant FontSubstitutions FontTracking FontVariations FontWeight For ForAll Format FormatRules FormatType FormatTypeAutoConvert FormatValues FormBox FormBoxOptions FortranForm Forward ForwardBackward Fourier FourierCoefficient FourierCosCoefficient FourierCosSeries FourierCosTransform FourierDCT FourierDCTFilter FourierDCTMatrix FourierDST FourierDSTMatrix FourierMatrix FourierParameters FourierSequenceTransform FourierSeries FourierSinCoefficient FourierSinSeries FourierSinTransform FourierTransform FourierTrigSeries FractionalBrownianMotionProcess FractionalPart FractionBox FractionBoxOptions FractionLine Frame FrameBox FrameBoxOptions Framed FrameInset FrameLabel Frameless FrameMargins FrameStyle FrameTicks FrameTicksStyle FRatioDistribution FrechetDistribution FreeQ FrequencySamplingFilterKernel FresnelC FresnelS Friday FrobeniusNumber FrobeniusSolve ' +
- 'FromCharacterCode FromCoefficientRules FromContinuedFraction FromDate FromDigits FromDMS Front FrontEndDynamicExpression FrontEndEventActions FrontEndExecute FrontEndObject FrontEndResource FrontEndResourceString FrontEndStackSize FrontEndToken FrontEndTokenExecute FrontEndValueCache FrontEndVersion FrontFaceColor FrontFaceOpacity Full FullAxes FullDefinition FullForm FullGraphics FullOptions FullSimplify Function FunctionExpand FunctionInterpolation FunctionSpace FussellVeselyImportance ' +
- 'GaborFilter GaborMatrix GaborWavelet GainMargins GainPhaseMargins Gamma GammaDistribution GammaRegularized GapPenalty Gather GatherBy GaugeFaceElementFunction GaugeFaceStyle GaugeFrameElementFunction GaugeFrameSize GaugeFrameStyle GaugeLabels GaugeMarkers GaugeStyle GaussianFilter GaussianIntegers GaussianMatrix GaussianWindow GCD GegenbauerC General GeneralizedLinearModelFit GenerateConditions GeneratedCell GeneratedParameters GeneratingFunction Generic GenericCylindricalDecomposition GenomeData GenomeLookup GeodesicClosing GeodesicDilation GeodesicErosion GeodesicOpening GeoDestination GeodesyData GeoDirection GeoDistance GeoGridPosition GeometricBrownianMotionProcess GeometricDistribution GeometricMean GeometricMeanFilter GeometricTransformation GeometricTransformation3DBox GeometricTransformation3DBoxOptions GeometricTransformationBox GeometricTransformationBoxOptions GeoPosition GeoPositionENU GeoPositionXYZ GeoProjectionData GestureHandler GestureHandlerTag Get GetBoundingBoxSizePacket GetContext GetEnvironment GetFileName GetFrontEndOptionsDataPacket GetLinebreakInformationPacket GetMenusPacket GetPageBreakInformationPacket Glaisher GlobalClusteringCoefficient GlobalPreferences GlobalSession Glow GoldenRatio GompertzMakehamDistribution GoodmanKruskalGamma GoodmanKruskalGammaTest Goto Grad Gradient GradientFilter GradientOrientationFilter Graph GraphAssortativity GraphCenter GraphComplement GraphData GraphDensity GraphDiameter GraphDifference GraphDisjointUnion ' +
- 'GraphDistance GraphDistanceMatrix GraphElementData GraphEmbedding GraphHighlight GraphHighlightStyle GraphHub Graphics Graphics3D Graphics3DBox Graphics3DBoxOptions GraphicsArray GraphicsBaseline GraphicsBox GraphicsBoxOptions GraphicsColor GraphicsColumn GraphicsComplex GraphicsComplex3DBox GraphicsComplex3DBoxOptions GraphicsComplexBox GraphicsComplexBoxOptions GraphicsContents GraphicsData GraphicsGrid GraphicsGridBox GraphicsGroup GraphicsGroup3DBox GraphicsGroup3DBoxOptions GraphicsGroupBox GraphicsGroupBoxOptions GraphicsGrouping GraphicsHighlightColor GraphicsRow GraphicsSpacing GraphicsStyle GraphIntersection GraphLayout GraphLinkEfficiency GraphPeriphery GraphPlot GraphPlot3D GraphPower GraphPropertyDistribution GraphQ GraphRadius GraphReciprocity GraphRoot GraphStyle GraphUnion Gray GrayLevel GreatCircleDistance Greater GreaterEqual GreaterEqualLess GreaterFullEqual GreaterGreater GreaterLess GreaterSlantEqual GreaterTilde Green Grid GridBaseline GridBox GridBoxAlignment GridBoxBackground GridBoxDividers GridBoxFrame GridBoxItemSize GridBoxItemStyle GridBoxOptions GridBoxSpacings GridCreationSettings GridDefaultElement GridElementStyleOptions GridFrame GridFrameMargins GridGraph GridLines GridLinesStyle GroebnerBasis GroupActionBase GroupCentralizer GroupElementFromWord GroupElementPosition GroupElementQ GroupElements GroupElementToWord GroupGenerators GroupMultiplicationTable GroupOrbits GroupOrder GroupPageBreakWithin GroupSetwiseStabilizer GroupStabilizer GroupStabilizerChain Gudermannian GumbelDistribution ' +
- 'HaarWavelet HadamardMatrix HalfNormalDistribution HamiltonianGraphQ HammingDistance HammingWindow HankelH1 HankelH2 HankelMatrix HannPoissonWindow HannWindow HaradaNortonGroupHN HararyGraph HarmonicMean HarmonicMeanFilter HarmonicNumber Hash HashTable Haversine HazardFunction Head HeadCompose Heads HeavisideLambda HeavisidePi HeavisideTheta HeldGroupHe HeldPart HelpBrowserLookup HelpBrowserNotebook HelpBrowserSettings HermiteDecomposition HermiteH HermitianMatrixQ HessenbergDecomposition Hessian HexadecimalCharacter Hexahedron HexahedronBox HexahedronBoxOptions HiddenSurface HighlightGraph HighlightImage HighpassFilter HigmanSimsGroupHS HilbertFilter HilbertMatrix Histogram Histogram3D HistogramDistribution HistogramList HistogramTransform HistogramTransformInterpolation HitMissTransform HITSCentrality HodgeDual HoeffdingD HoeffdingDTest Hold HoldAll HoldAllComplete HoldComplete HoldFirst HoldForm HoldPattern HoldRest HolidayCalendar HomeDirectory HomePage Horizontal HorizontalForm HorizontalGauge HorizontalScrollPosition HornerForm HotellingTSquareDistribution HoytDistribution HTMLSave Hue HumpDownHump HumpEqual HurwitzLerchPhi HurwitzZeta HyperbolicDistribution HypercubeGraph HyperexponentialDistribution Hyperfactorial Hypergeometric0F1 Hypergeometric0F1Regularized Hypergeometric1F1 Hypergeometric1F1Regularized Hypergeometric2F1 Hypergeometric2F1Regularized HypergeometricDistribution HypergeometricPFQ HypergeometricPFQRegularized HypergeometricU Hyperlink HyperlinkCreationSettings Hyphenation HyphenationOptions HypoexponentialDistribution HypothesisTestData ' +
- 'I Identity IdentityMatrix If IgnoreCase Im Image Image3D Image3DSlices ImageAccumulate ImageAdd ImageAdjust ImageAlign ImageApply ImageAspectRatio ImageAssemble ImageCache ImageCacheValid ImageCapture ImageChannels ImageClip ImageColorSpace ImageCompose ImageConvolve ImageCooccurrence ImageCorners ImageCorrelate ImageCorrespondingPoints ImageCrop ImageData ImageDataPacket ImageDeconvolve ImageDemosaic ImageDifference ImageDimensions ImageDistance ImageEffect ImageFeatureTrack ImageFileApply ImageFileFilter ImageFileScan ImageFilter ImageForestingComponents ImageForwardTransformation ImageHistogram ImageKeypoints ImageLevels ImageLines ImageMargins ImageMarkers ImageMeasurements ImageMultiply ImageOffset ImagePad ImagePadding ImagePartition ImagePeriodogram ImagePerspectiveTransformation ImageQ ImageRangeCache ImageReflect ImageRegion ImageResize ImageResolution ImageRotate ImageRotated ImageScaled ImageScan ImageSize ImageSizeAction ImageSizeCache ImageSizeMultipliers ImageSizeRaw ImageSubtract ImageTake ImageTransformation ImageTrim ImageType ImageValue ImageValuePositions Implies Import ImportAutoReplacements ImportString ImprovementImportance In IncidenceGraph IncidenceList IncidenceMatrix IncludeConstantBasis IncludeFileExtension IncludePods IncludeSingularTerm Increment Indent IndentingNewlineSpacings IndentMaxFraction IndependenceTest IndependentEdgeSetQ IndependentUnit IndependentVertexSetQ Indeterminate IndexCreationOptions Indexed IndexGraph IndexTag Inequality InexactNumberQ InexactNumbers Infinity Infix Information Inherited InheritScope Initialization InitializationCell InitializationCellEvaluation InitializationCellWarning InlineCounterAssignments InlineCounterIncrements InlineRules Inner Inpaint Input InputAliases InputAssumptions InputAutoReplacements InputField InputFieldBox InputFieldBoxOptions InputForm InputGrouping InputNamePacket InputNotebook InputPacket InputSettings InputStream InputString InputStringPacket InputToBoxFormPacket Insert InsertionPointObject InsertResults Inset Inset3DBox Inset3DBoxOptions InsetBox InsetBoxOptions Install InstallService InString Integer IntegerDigits IntegerExponent IntegerLength IntegerPart IntegerPartitions IntegerQ Integers IntegerString Integral Integrate Interactive InteractiveTradingChart Interlaced Interleaving InternallyBalancedDecomposition InterpolatingFunction InterpolatingPolynomial Interpolation InterpolationOrder InterpolationPoints InterpolationPrecision Interpretation InterpretationBox InterpretationBoxOptions InterpretationFunction ' +
- 'InterpretTemplate InterquartileRange Interrupt InterruptSettings Intersection Interval IntervalIntersection IntervalMemberQ IntervalUnion Inverse InverseBetaRegularized InverseCDF InverseChiSquareDistribution InverseContinuousWaveletTransform InverseDistanceTransform InverseEllipticNomeQ InverseErf InverseErfc InverseFourier InverseFourierCosTransform InverseFourierSequenceTransform InverseFourierSinTransform InverseFourierTransform InverseFunction InverseFunctions InverseGammaDistribution InverseGammaRegularized InverseGaussianDistribution InverseGudermannian InverseHaversine InverseJacobiCD InverseJacobiCN InverseJacobiCS InverseJacobiDC InverseJacobiDN InverseJacobiDS InverseJacobiNC InverseJacobiND InverseJacobiNS InverseJacobiSC InverseJacobiSD InverseJacobiSN InverseLaplaceTransform InversePermutation InverseRadon InverseSeries InverseSurvivalFunction InverseWaveletTransform InverseWeierstrassP InverseZTransform Invisible InvisibleApplication InvisibleTimes IrreduciblePolynomialQ IsolatingInterval IsomorphicGraphQ IsotopeData Italic Item ItemBox ItemBoxOptions ItemSize ItemStyle ItoProcess ' +
- 'JaccardDissimilarity JacobiAmplitude Jacobian JacobiCD JacobiCN JacobiCS JacobiDC JacobiDN JacobiDS JacobiNC JacobiND JacobiNS JacobiP JacobiSC JacobiSD JacobiSN JacobiSymbol JacobiZeta JankoGroupJ1 JankoGroupJ2 JankoGroupJ3 JankoGroupJ4 JarqueBeraALMTest JohnsonDistribution Join Joined JoinedCurve JoinedCurveBox JoinForm JordanDecomposition JordanModelDecomposition ' +
- 'K KagiChart KaiserBesselWindow KaiserWindow KalmanEstimator KalmanFilter KarhunenLoeveDecomposition KaryTree KatzCentrality KCoreComponents KDistribution KelvinBei KelvinBer KelvinKei KelvinKer KendallTau KendallTauTest KernelExecute KernelMixtureDistribution KernelObject Kernels Ket Khinchin KirchhoffGraph KirchhoffMatrix KleinInvariantJ KnightTourGraph KnotData KnownUnitQ KolmogorovSmirnovTest KroneckerDelta KroneckerModelDecomposition KroneckerProduct KroneckerSymbol KuiperTest KumaraswamyDistribution Kurtosis KuwaharaFilter ' +
- 'Label Labeled LabeledSlider LabelingFunction LabelStyle LaguerreL LambdaComponents LambertW LanczosWindow LandauDistribution Language LanguageCategory LaplaceDistribution LaplaceTransform Laplacian LaplacianFilter LaplacianGaussianFilter Large Larger Last Latitude LatitudeLongitude LatticeData LatticeReduce Launch LaunchKernels LayeredGraphPlot LayerSizeFunction LayoutInformation LCM LeafCount LeapYearQ LeastSquares LeastSquaresFilterKernel Left LeftArrow LeftArrowBar LeftArrowRightArrow LeftDownTeeVector LeftDownVector LeftDownVectorBar LeftRightArrow LeftRightVector LeftTee LeftTeeArrow LeftTeeVector LeftTriangle LeftTriangleBar LeftTriangleEqual LeftUpDownVector LeftUpTeeVector LeftUpVector LeftUpVectorBar LeftVector LeftVectorBar LegendAppearance Legended LegendFunction LegendLabel LegendLayout LegendMargins LegendMarkers LegendMarkerSize LegendreP LegendreQ LegendreType Length LengthWhile LerchPhi Less LessEqual LessEqualGreater LessFullEqual LessGreater LessLess LessSlantEqual LessTilde LetterCharacter LetterQ Level LeveneTest LeviCivitaTensor LevyDistribution Lexicographic LibraryFunction LibraryFunctionError LibraryFunctionInformation LibraryFunctionLoad LibraryFunctionUnload LibraryLoad LibraryUnload LicenseID LiftingFilterData LiftingWaveletTransform LightBlue LightBrown LightCyan Lighter LightGray LightGreen Lighting LightingAngle LightMagenta LightOrange LightPink LightPurple LightRed LightSources LightYellow Likelihood Limit LimitsPositioning LimitsPositioningTokens LindleyDistribution Line Line3DBox LinearFilter LinearFractionalTransform LinearModelFit LinearOffsetFunction LinearProgramming LinearRecurrence LinearSolve LinearSolveFunction LineBox LineBreak LinebreakAdjustments LineBreakChart LineBreakWithin LineColor LineForm LineGraph LineIndent LineIndentMaxFraction LineIntegralConvolutionPlot LineIntegralConvolutionScale LineLegend LineOpacity LineSpacing LineWrapParts LinkActivate LinkClose LinkConnect LinkConnectedQ LinkCreate LinkError LinkFlush LinkFunction LinkHost LinkInterrupt LinkLaunch LinkMode LinkObject LinkOpen LinkOptions LinkPatterns LinkProtocol LinkRead LinkReadHeld LinkReadyQ Links LinkWrite LinkWriteHeld LiouvilleLambda List Listable ListAnimate ListContourPlot ListContourPlot3D ListConvolve ListCorrelate ListCurvePathPlot ListDeconvolve ListDensityPlot Listen ListFourierSequenceTransform ListInterpolation ListLineIntegralConvolutionPlot ListLinePlot ListLogLinearPlot ListLogLogPlot ListLogPlot ListPicker ListPickerBox ListPickerBoxBackground ListPickerBoxOptions ListPlay ListPlot ListPlot3D ListPointPlot3D ListPolarPlot ListQ ListStreamDensityPlot ListStreamPlot ListSurfacePlot3D ListVectorDensityPlot ListVectorPlot ListVectorPlot3D ListZTransform Literal LiteralSearch LocalClusteringCoefficient LocalizeVariables LocationEquivalenceTest LocationTest Locator LocatorAutoCreate LocatorBox LocatorBoxOptions LocatorCentering LocatorPane LocatorPaneBox LocatorPaneBoxOptions ' +
- 'LocatorRegion Locked Log Log10 Log2 LogBarnesG LogGamma LogGammaDistribution LogicalExpand LogIntegral LogisticDistribution LogitModelFit LogLikelihood LogLinearPlot LogLogisticDistribution LogLogPlot LogMultinormalDistribution LogNormalDistribution LogPlot LogRankTest LogSeriesDistribution LongEqual Longest LongestAscendingSequence LongestCommonSequence LongestCommonSequencePositions LongestCommonSubsequence LongestCommonSubsequencePositions LongestMatch LongForm Longitude LongLeftArrow LongLeftRightArrow LongRightArrow Loopback LoopFreeGraphQ LowerCaseQ LowerLeftArrow LowerRightArrow LowerTriangularize LowpassFilter LQEstimatorGains LQGRegulator LQOutputRegulatorGains LQRegulatorGains LUBackSubstitution LucasL LuccioSamiComponents LUDecomposition LyapunovSolve LyonsGroupLy ' +
- 'MachineID MachineName MachineNumberQ MachinePrecision MacintoshSystemPageSetup Magenta Magnification Magnify MainSolve MaintainDynamicCaches Majority MakeBoxes MakeExpression MakeRules MangoldtLambda ManhattanDistance Manipulate Manipulator MannWhitneyTest MantissaExponent Manual Map MapAll MapAt MapIndexed MAProcess MapThread MarcumQ MardiaCombinedTest MardiaKurtosisTest MardiaSkewnessTest MarginalDistribution MarkovProcessProperties Masking MatchingDissimilarity MatchLocalNameQ MatchLocalNames MatchQ Material MathematicaNotation MathieuC MathieuCharacteristicA MathieuCharacteristicB MathieuCharacteristicExponent MathieuCPrime MathieuGroupM11 MathieuGroupM12 MathieuGroupM22 MathieuGroupM23 MathieuGroupM24 MathieuS MathieuSPrime MathMLForm MathMLText Matrices MatrixExp MatrixForm MatrixFunction MatrixLog MatrixPlot MatrixPower MatrixQ MatrixRank Max MaxBend MaxDetect MaxExtraBandwidths MaxExtraConditions MaxFeatures MaxFilter Maximize MaxIterations MaxMemoryUsed MaxMixtureKernels MaxPlotPoints MaxPoints MaxRecursion MaxStableDistribution MaxStepFraction MaxSteps MaxStepSize MaxValue MaxwellDistribution McLaughlinGroupMcL Mean MeanClusteringCoefficient MeanDegreeConnectivity MeanDeviation MeanFilter MeanGraphDistance MeanNeighborDegree MeanShift MeanShiftFilter Median MedianDeviation MedianFilter Medium MeijerG MeixnerDistribution MemberQ MemoryConstrained MemoryInUse Menu MenuAppearance MenuCommandKey MenuEvaluator MenuItem MenuPacket MenuSortingValue MenuStyle MenuView MergeDifferences Mesh MeshFunctions MeshRange MeshShading MeshStyle Message MessageDialog MessageList MessageName MessageOptions MessagePacket Messages MessagesNotebook MetaCharacters MetaInformation Method MethodOptions MexicanHatWavelet MeyerWavelet Min MinDetect MinFilter MinimalPolynomial MinimalStateSpaceModel Minimize Minors MinRecursion MinSize MinStableDistribution Minus MinusPlus MinValue Missing MissingDataMethod MittagLefflerE MixedRadix MixedRadixQuantity MixtureDistribution Mod Modal Mode Modular ModularLambda Module Modulus MoebiusMu Moment Momentary MomentConvert MomentEvaluate MomentGeneratingFunction Monday Monitor MonomialList MonomialOrder MonsterGroupM MorletWavelet MorphologicalBinarize MorphologicalBranchPoints MorphologicalComponents MorphologicalEulerNumber MorphologicalGraph MorphologicalPerimeter MorphologicalTransform Most MouseAnnotation MouseAppearance MouseAppearanceTag MouseButtons Mouseover MousePointerNote MousePosition MovingAverage MovingMedian MoyalDistribution MultiedgeStyle MultilaunchWarning MultiLetterItalics MultiLetterStyle MultilineFunction Multinomial MultinomialDistribution MultinormalDistribution MultiplicativeOrder Multiplicity Multiselection MultivariateHypergeometricDistribution MultivariatePoissonDistribution MultivariateTDistribution ' +
- 'N NakagamiDistribution NameQ Names NamespaceBox Nand NArgMax NArgMin NBernoulliB NCache NDSolve NDSolveValue Nearest NearestFunction NeedCurrentFrontEndPackagePacket NeedCurrentFrontEndSymbolsPacket NeedlemanWunschSimilarity Needs Negative NegativeBinomialDistribution NegativeMultinomialDistribution NeighborhoodGraph Nest NestedGreaterGreater NestedLessLess NestedScriptRules NestList NestWhile NestWhileList NevilleThetaC NevilleThetaD NevilleThetaN NevilleThetaS NewPrimitiveStyle NExpectation Next NextPrime NHoldAll NHoldFirst NHoldRest NicholsGridLines NicholsPlot NIntegrate NMaximize NMaxValue NMinimize NMinValue NominalVariables NonAssociative NoncentralBetaDistribution NoncentralChiSquareDistribution NoncentralFRatioDistribution NoncentralStudentTDistribution NonCommutativeMultiply NonConstants None NonlinearModelFit NonlocalMeansFilter NonNegative NonPositive Nor NorlundB Norm Normal NormalDistribution NormalGrouping Normalize NormalizedSquaredEuclideanDistance NormalsFunction NormFunction Not NotCongruent NotCupCap NotDoubleVerticalBar Notebook NotebookApply NotebookAutoSave NotebookClose NotebookConvertSettings NotebookCreate NotebookCreateReturnObject NotebookDefault NotebookDelete NotebookDirectory NotebookDynamicExpression NotebookEvaluate NotebookEventActions NotebookFileName NotebookFind NotebookFindReturnObject NotebookGet NotebookGetLayoutInformationPacket NotebookGetMisspellingsPacket NotebookInformation NotebookInterfaceObject NotebookLocate NotebookObject NotebookOpen NotebookOpenReturnObject NotebookPath NotebookPrint NotebookPut NotebookPutReturnObject NotebookRead NotebookResetGeneratedCells Notebooks NotebookSave NotebookSaveAs NotebookSelection NotebookSetupLayoutInformationPacket NotebooksMenu NotebookWrite NotElement NotEqualTilde NotExists NotGreater NotGreaterEqual NotGreaterFullEqual NotGreaterGreater NotGreaterLess NotGreaterSlantEqual NotGreaterTilde NotHumpDownHump NotHumpEqual NotLeftTriangle NotLeftTriangleBar NotLeftTriangleEqual NotLess NotLessEqual NotLessFullEqual NotLessGreater NotLessLess NotLessSlantEqual NotLessTilde NotNestedGreaterGreater NotNestedLessLess NotPrecedes NotPrecedesEqual NotPrecedesSlantEqual NotPrecedesTilde NotReverseElement NotRightTriangle NotRightTriangleBar NotRightTriangleEqual NotSquareSubset NotSquareSubsetEqual NotSquareSuperset NotSquareSupersetEqual NotSubset NotSubsetEqual NotSucceeds NotSucceedsEqual NotSucceedsSlantEqual NotSucceedsTilde NotSuperset NotSupersetEqual NotTilde NotTildeEqual NotTildeFullEqual NotTildeTilde NotVerticalBar NProbability NProduct NProductFactors NRoots NSolve NSum NSumTerms Null NullRecords NullSpace NullWords Number NumberFieldClassNumber NumberFieldDiscriminant NumberFieldFundamentalUnits NumberFieldIntegralBasis NumberFieldNormRepresentatives NumberFieldRegulator NumberFieldRootsOfUnity NumberFieldSignature NumberForm NumberFormat NumberMarks NumberMultiplier NumberPadding NumberPoint NumberQ NumberSeparator ' +
- 'NumberSigns NumberString Numerator NumericFunction NumericQ NuttallWindow NValues NyquistGridLines NyquistPlot ' +
- 'O ObservabilityGramian ObservabilityMatrix ObservableDecomposition ObservableModelQ OddQ Off Offset OLEData On ONanGroupON OneIdentity Opacity Open OpenAppend Opener OpenerBox OpenerBoxOptions OpenerView OpenFunctionInspectorPacket Opening OpenRead OpenSpecialOptions OpenTemporary OpenWrite Operate OperatingSystem OptimumFlowData Optional OptionInspectorSettings OptionQ Options OptionsPacket OptionsPattern OptionValue OptionValueBox OptionValueBoxOptions Or Orange Order OrderDistribution OrderedQ Ordering Orderless OrnsteinUhlenbeckProcess Orthogonalize Out Outer OutputAutoOverwrite OutputControllabilityMatrix OutputControllableModelQ OutputForm OutputFormData OutputGrouping OutputMathEditExpression OutputNamePacket OutputResponse OutputSizeLimit OutputStream Over OverBar OverDot Overflow OverHat Overlaps Overlay OverlayBox OverlayBoxOptions Overscript OverscriptBox OverscriptBoxOptions OverTilde OverVector OwenT OwnValues ' +
- 'PackingMethod PaddedForm Padding PadeApproximant PadLeft PadRight PageBreakAbove PageBreakBelow PageBreakWithin PageFooterLines PageFooters PageHeaderLines PageHeaders PageHeight PageRankCentrality PageWidth PairedBarChart PairedHistogram PairedSmoothHistogram PairedTTest PairedZTest PaletteNotebook PalettePath Pane PaneBox PaneBoxOptions Panel PanelBox PanelBoxOptions Paneled PaneSelector PaneSelectorBox PaneSelectorBoxOptions PaperWidth ParabolicCylinderD ParagraphIndent ParagraphSpacing ParallelArray ParallelCombine ParallelDo ParallelEvaluate Parallelization Parallelize ParallelMap ParallelNeeds ParallelProduct ParallelSubmit ParallelSum ParallelTable ParallelTry Parameter ParameterEstimator ParameterMixtureDistribution ParameterVariables ParametricFunction ParametricNDSolve ParametricNDSolveValue ParametricPlot ParametricPlot3D ParentConnect ParentDirectory ParentForm Parenthesize ParentList ParetoDistribution Part PartialCorrelationFunction PartialD ParticleData Partition PartitionsP PartitionsQ ParzenWindow PascalDistribution PassEventsDown PassEventsUp Paste PasteBoxFormInlineCells PasteButton Path PathGraph PathGraphQ Pattern PatternSequence PatternTest PauliMatrix PaulWavelet Pause PausedTime PDF PearsonChiSquareTest PearsonCorrelationTest PearsonDistribution PerformanceGoal PeriodicInterpolation Periodogram PeriodogramArray PermutationCycles PermutationCyclesQ PermutationGroup PermutationLength PermutationList PermutationListQ PermutationMax PermutationMin PermutationOrder PermutationPower PermutationProduct PermutationReplace Permutations PermutationSupport Permute PeronaMalikFilter Perpendicular PERTDistribution PetersenGraph PhaseMargins Pi Pick PIDData PIDDerivativeFilter PIDFeedforward PIDTune Piecewise PiecewiseExpand PieChart PieChart3D PillaiTrace PillaiTraceTest Pink Pivoting PixelConstrained PixelValue PixelValuePositions Placed Placeholder PlaceholderReplace Plain PlanarGraphQ Play PlayRange Plot Plot3D Plot3Matrix PlotDivision PlotJoined PlotLabel PlotLayout PlotLegends PlotMarkers PlotPoints PlotRange PlotRangeClipping PlotRangePadding PlotRegion PlotStyle Plus PlusMinus Pochhammer PodStates PodWidth Point Point3DBox PointBox PointFigureChart PointForm PointLegend PointSize PoissonConsulDistribution PoissonDistribution PoissonProcess PoissonWindow PolarAxes PolarAxesOrigin PolarGridLines PolarPlot PolarTicks PoleZeroMarkers PolyaAeppliDistribution PolyGamma Polygon Polygon3DBox Polygon3DBoxOptions PolygonBox PolygonBoxOptions PolygonHoleScale PolygonIntersections PolygonScale PolyhedronData PolyLog PolynomialExtendedGCD PolynomialForm PolynomialGCD PolynomialLCM PolynomialMod PolynomialQ PolynomialQuotient PolynomialQuotientRemainder PolynomialReduce PolynomialRemainder Polynomials PopupMenu PopupMenuBox PopupMenuBoxOptions PopupView PopupWindow Position Positive PositiveDefiniteMatrixQ PossibleZeroQ Postfix PostScript Power PowerDistribution PowerExpand PowerMod PowerModList ' +
- 'PowerSpectralDensity PowersRepresentations PowerSymmetricPolynomial Precedence PrecedenceForm Precedes PrecedesEqual PrecedesSlantEqual PrecedesTilde Precision PrecisionGoal PreDecrement PredictionRoot PreemptProtect PreferencesPath Prefix PreIncrement Prepend PrependTo PreserveImageOptions Previous PriceGraphDistribution PrimaryPlaceholder Prime PrimeNu PrimeOmega PrimePi PrimePowerQ PrimeQ Primes PrimeZetaP PrimitiveRoot PrincipalComponents PrincipalValue Print PrintAction PrintForm PrintingCopies PrintingOptions PrintingPageRange PrintingStartingPageNumber PrintingStyleEnvironment PrintPrecision PrintTemporary Prism PrismBox PrismBoxOptions PrivateCellOptions PrivateEvaluationOptions PrivateFontOptions PrivateFrontEndOptions PrivateNotebookOptions PrivatePaths Probability ProbabilityDistribution ProbabilityPlot ProbabilityPr ProbabilityScalePlot ProbitModelFit ProcessEstimator ProcessParameterAssumptions ProcessParameterQ ProcessStateDomain ProcessTimeDomain Product ProductDistribution ProductLog ProgressIndicator ProgressIndicatorBox ProgressIndicatorBoxOptions Projection Prolog PromptForm Properties Property PropertyList PropertyValue Proportion Proportional Protect Protected ProteinData Pruning PseudoInverse Purple Put PutAppend Pyramid PyramidBox PyramidBoxOptions ' +
- 'QBinomial QFactorial QGamma QHypergeometricPFQ QPochhammer QPolyGamma QRDecomposition QuadraticIrrationalQ Quantile QuantilePlot Quantity QuantityForm QuantityMagnitude QuantityQ QuantityUnit Quartics QuartileDeviation Quartiles QuartileSkewness QueueingNetworkProcess QueueingProcess QueueProperties Quiet Quit Quotient QuotientRemainder ' +
- 'RadialityCentrality RadicalBox RadicalBoxOptions RadioButton RadioButtonBar RadioButtonBox RadioButtonBoxOptions Radon RamanujanTau RamanujanTauL RamanujanTauTheta RamanujanTauZ Random RandomChoice RandomComplex RandomFunction RandomGraph RandomImage RandomInteger RandomPermutation RandomPrime RandomReal RandomSample RandomSeed RandomVariate RandomWalkProcess Range RangeFilter RangeSpecification RankedMax RankedMin Raster Raster3D Raster3DBox Raster3DBoxOptions RasterArray RasterBox RasterBoxOptions Rasterize RasterSize Rational RationalFunctions Rationalize Rationals Ratios Raw RawArray RawBoxes RawData RawMedium RayleighDistribution Re Read ReadList ReadProtected Real RealBlockDiagonalForm RealDigits RealExponent Reals Reap Record RecordLists RecordSeparators Rectangle RectangleBox RectangleBoxOptions RectangleChart RectangleChart3D RecurrenceFilter RecurrenceTable RecurringDigitsForm Red Reduce RefBox ReferenceLineStyle ReferenceMarkers ReferenceMarkerStyle Refine ReflectionMatrix ReflectionTransform Refresh RefreshRate RegionBinarize RegionFunction RegionPlot RegionPlot3D RegularExpression Regularization Reinstall Release ReleaseHold ReliabilityDistribution ReliefImage ReliefPlot Remove RemoveAlphaChannel RemoveAsynchronousTask Removed RemoveInputStreamMethod RemoveOutputStreamMethod RemoveProperty RemoveScheduledTask RenameDirectory RenameFile RenderAll RenderingOptions RenewalProcess RenkoChart Repeated RepeatedNull RepeatedString Replace ReplaceAll ReplaceHeldPart ReplaceImageValue ReplaceList ReplacePart ReplacePixelValue ReplaceRepeated Resampling Rescale RescalingTransform ResetDirectory ResetMenusPacket ResetScheduledTask Residue Resolve Rest Resultant ResumePacket Return ReturnExpressionPacket ReturnInputFormPacket ReturnPacket ReturnTextPacket Reverse ReverseBiorthogonalSplineWavelet ReverseElement ReverseEquilibrium ReverseGraph ReverseUpEquilibrium RevolutionAxis RevolutionPlot3D RGBColor RiccatiSolve RiceDistribution RidgeFilter RiemannR RiemannSiegelTheta RiemannSiegelZ Riffle Right RightArrow RightArrowBar RightArrowLeftArrow RightCosetRepresentative RightDownTeeVector RightDownVector RightDownVectorBar RightTee RightTeeArrow RightTeeVector RightTriangle RightTriangleBar RightTriangleEqual RightUpDownVector RightUpTeeVector RightUpVector RightUpVectorBar RightVector RightVectorBar RiskAchievementImportance RiskReductionImportance RogersTanimotoDissimilarity Root RootApproximant RootIntervals RootLocusPlot RootMeanSquare RootOfUnityQ RootReduce Roots RootSum Rotate RotateLabel RotateLeft RotateRight RotationAction RotationBox RotationBoxOptions RotationMatrix RotationTransform Round RoundImplies RoundingRadius Row RowAlignments RowBackgrounds RowBox RowHeights RowLines RowMinHeight RowReduce RowsEqual RowSpacings RSolve RudvalisGroupRu Rule RuleCondition RuleDelayed RuleForm RulerUnits Run RunScheduledTask RunThrough RuntimeAttributes RuntimeOptions RussellRaoDissimilarity ' +
- 'SameQ SameTest SampleDepth SampledSoundFunction SampledSoundList SampleRate SamplingPeriod SARIMAProcess SARMAProcess SatisfiabilityCount SatisfiabilityInstances SatisfiableQ Saturday Save Saveable SaveAutoDelete SaveDefinitions SawtoothWave Scale Scaled ScaleDivisions ScaledMousePosition ScaleOrigin ScalePadding ScaleRanges ScaleRangeStyle ScalingFunctions ScalingMatrix ScalingTransform Scan ScheduledTaskActiveQ ScheduledTaskData ScheduledTaskObject ScheduledTasks SchurDecomposition ScientificForm ScreenRectangle ScreenStyleEnvironment ScriptBaselineShifts ScriptLevel ScriptMinSize ScriptRules ScriptSizeMultipliers Scrollbars ScrollingOptions ScrollPosition Sec Sech SechDistribution SectionGrouping SectorChart SectorChart3D SectorOrigin SectorSpacing SeedRandom Select Selectable SelectComponents SelectedCells SelectedNotebook Selection SelectionAnimate SelectionCell SelectionCellCreateCell SelectionCellDefaultStyle SelectionCellParentStyle SelectionCreateCell SelectionDebuggerTag SelectionDuplicateCell SelectionEvaluate SelectionEvaluateCreateCell SelectionMove SelectionPlaceholder SelectionSetStyle SelectWithContents SelfLoops SelfLoopStyle SemialgebraicComponentInstances SendMail Sequence SequenceAlignment SequenceForm SequenceHold SequenceLimit Series SeriesCoefficient SeriesData SessionTime Set SetAccuracy SetAlphaChannel SetAttributes Setbacks SetBoxFormNamesPacket SetDelayed SetDirectory SetEnvironment SetEvaluationNotebook SetFileDate SetFileLoadingContext SetNotebookStatusLine SetOptions SetOptionsPacket SetPrecision SetProperty SetSelectedNotebook SetSharedFunction SetSharedVariable SetSpeechParametersPacket SetStreamPosition SetSystemOptions Setter SetterBar SetterBox SetterBoxOptions Setting SetValue Shading Shallow ShannonWavelet ShapiroWilkTest Share Sharpen ShearingMatrix ShearingTransform ShenCastanMatrix Short ShortDownArrow Shortest ShortestMatch ShortestPathFunction ShortLeftArrow ShortRightArrow ShortUpArrow Show ShowAutoStyles ShowCellBracket ShowCellLabel ShowCellTags ShowClosedCellArea ShowContents ShowControls ShowCursorTracker ShowGroupOpenCloseIcon ShowGroupOpener ShowInvisibleCharacters ShowPageBreaks ShowPredictiveInterface ShowSelection ShowShortBoxForm ShowSpecialCharacters ShowStringCharacters ShowSyntaxStyles ShrinkingDelay ShrinkWrapBoundingBox SiegelTheta SiegelTukeyTest Sign Signature SignedRankTest SignificanceLevel SignPadding SignTest SimilarityRules SimpleGraph SimpleGraphQ Simplify Sin Sinc SinghMaddalaDistribution SingleEvaluation SingleLetterItalics SingleLetterStyle SingularValueDecomposition SingularValueList SingularValuePlot SingularValues Sinh SinhIntegral SinIntegral SixJSymbol Skeleton SkeletonTransform SkellamDistribution Skewness SkewNormalDistribution Skip SliceDistribution Slider Slider2D Slider2DBox Slider2DBoxOptions SliderBox SliderBoxOptions SlideView Slot SlotSequence Small SmallCircle Smaller SmithDelayCompensator SmithWatermanSimilarity ' +
- 'SmoothDensityHistogram SmoothHistogram SmoothHistogram3D SmoothKernelDistribution SocialMediaData Socket SokalSneathDissimilarity Solve SolveAlways SolveDelayed Sort SortBy Sound SoundAndGraphics SoundNote SoundVolume Sow Space SpaceForm Spacer Spacings Span SpanAdjustments SpanCharacterRounding SpanFromAbove SpanFromBoth SpanFromLeft SpanLineThickness SpanMaxSize SpanMinSize SpanningCharacters SpanSymmetric SparseArray SpatialGraphDistribution Speak SpeakTextPacket SpearmanRankTest SpearmanRho Spectrogram SpectrogramArray Specularity SpellingCorrection SpellingDictionaries SpellingDictionariesPath SpellingOptions SpellingSuggestionsPacket Sphere SphereBox SphericalBesselJ SphericalBesselY SphericalHankelH1 SphericalHankelH2 SphericalHarmonicY SphericalPlot3D SphericalRegion SpheroidalEigenvalue SpheroidalJoiningFactor SpheroidalPS SpheroidalPSPrime SpheroidalQS SpheroidalQSPrime SpheroidalRadialFactor SpheroidalS1 SpheroidalS1Prime SpheroidalS2 SpheroidalS2Prime Splice SplicedDistribution SplineClosed SplineDegree SplineKnots SplineWeights Split SplitBy SpokenString Sqrt SqrtBox SqrtBoxOptions Square SquaredEuclideanDistance SquareFreeQ SquareIntersection SquaresR SquareSubset SquareSubsetEqual SquareSuperset SquareSupersetEqual SquareUnion SquareWave StabilityMargins StabilityMarginsStyle StableDistribution Stack StackBegin StackComplete StackInhibit StandardDeviation StandardDeviationFilter StandardForm Standardize StandbyDistribution Star StarGraph StartAsynchronousTask StartingStepSize StartOfLine StartOfString StartScheduledTask StartupSound StateDimensions StateFeedbackGains StateOutputEstimator StateResponse StateSpaceModel StateSpaceRealization StateSpaceTransform StationaryDistribution StationaryWaveletPacketTransform StationaryWaveletTransform StatusArea StatusCentrality StepMonitor StieltjesGamma StirlingS1 StirlingS2 StopAsynchronousTask StopScheduledTask StrataVariables StratonovichProcess StreamColorFunction StreamColorFunctionScaling StreamDensityPlot StreamPlot StreamPoints StreamPosition Streams StreamScale StreamStyle String StringBreak StringByteCount StringCases StringCount StringDrop StringExpression StringForm StringFormat StringFreeQ StringInsert StringJoin StringLength StringMatchQ StringPosition StringQ StringReplace StringReplaceList StringReplacePart StringReverse StringRotateLeft StringRotateRight StringSkeleton StringSplit StringTake StringToStream StringTrim StripBoxes StripOnInput StripWrapperBoxes StrokeForm StructuralImportance StructuredArray StructuredSelection StruveH StruveL Stub StudentTDistribution Style StyleBox StyleBoxAutoDelete StyleBoxOptions StyleData StyleDefinitions StyleForm StyleKeyMapping StyleMenuListing StyleNameDialogSettings StyleNames StylePrint StyleSheetPath Subfactorial Subgraph SubMinus SubPlus SubresultantPolynomialRemainders ' +
- 'SubresultantPolynomials Subresultants Subscript SubscriptBox SubscriptBoxOptions Subscripted Subset SubsetEqual Subsets SubStar Subsuperscript SubsuperscriptBox SubsuperscriptBoxOptions Subtract SubtractFrom SubValues Succeeds SucceedsEqual SucceedsSlantEqual SucceedsTilde SuchThat Sum SumConvergence Sunday SuperDagger SuperMinus SuperPlus Superscript SuperscriptBox SuperscriptBoxOptions Superset SupersetEqual SuperStar Surd SurdForm SurfaceColor SurfaceGraphics SurvivalDistribution SurvivalFunction SurvivalModel SurvivalModelFit SuspendPacket SuzukiDistribution SuzukiGroupSuz SwatchLegend Switch Symbol SymbolName SymletWavelet Symmetric SymmetricGroup SymmetricMatrixQ SymmetricPolynomial SymmetricReduction Symmetrize SymmetrizedArray SymmetrizedArrayRules SymmetrizedDependentComponents SymmetrizedIndependentComponents SymmetrizedReplacePart SynchronousInitialization SynchronousUpdating Syntax SyntaxForm SyntaxInformation SyntaxLength SyntaxPacket SyntaxQ SystemDialogInput SystemException SystemHelpPath SystemInformation SystemInformationData SystemOpen SystemOptions SystemsModelDelay SystemsModelDelayApproximate SystemsModelDelete SystemsModelDimensions SystemsModelExtract SystemsModelFeedbackConnect SystemsModelLabels SystemsModelOrder SystemsModelParallelConnect SystemsModelSeriesConnect SystemsModelStateFeedbackConnect SystemStub ' +
- 'Tab TabFilling Table TableAlignments TableDepth TableDirections TableForm TableHeadings TableSpacing TableView TableViewBox TabSpacings TabView TabViewBox TabViewBoxOptions TagBox TagBoxNote TagBoxOptions TaggingRules TagSet TagSetDelayed TagStyle TagUnset Take TakeWhile Tally Tan Tanh TargetFunctions TargetUnits TautologyQ TelegraphProcess TemplateBox TemplateBoxOptions TemplateSlotSequence TemporalData Temporary TemporaryVariable TensorContract TensorDimensions TensorExpand TensorProduct TensorQ TensorRank TensorReduce TensorSymmetry TensorTranspose TensorWedge Tetrahedron TetrahedronBox TetrahedronBoxOptions TeXForm TeXSave Text Text3DBox Text3DBoxOptions TextAlignment TextBand TextBoundingBox TextBox TextCell TextClipboardType TextData TextForm TextJustification TextLine TextPacket TextParagraph TextRecognize TextRendering TextStyle Texture TextureCoordinateFunction TextureCoordinateScaling Therefore ThermometerGauge Thick Thickness Thin Thinning ThisLink ThompsonGroupTh Thread ThreeJSymbol Threshold Through Throw Thumbnail Thursday Ticks TicksStyle Tilde TildeEqual TildeFullEqual TildeTilde TimeConstrained TimeConstraint Times TimesBy TimeSeriesForecast TimeSeriesInvertibility TimeUsed TimeValue TimeZone Timing Tiny TitleGrouping TitsGroupT ToBoxes ToCharacterCode ToColor ToContinuousTimeModel ToDate ToDiscreteTimeModel ToeplitzMatrix ToExpression ToFileName Together Toggle ToggleFalse Toggler TogglerBar TogglerBox TogglerBoxOptions ToHeldExpression ToInvertibleTimeSeries TokenWords Tolerance ToLowerCase ToNumberField TooBig Tooltip TooltipBox TooltipBoxOptions TooltipDelay TooltipStyle Top TopHatTransform TopologicalSort ToRadicals ToRules ToString Total TotalHeight TotalVariationFilter TotalWidth TouchscreenAutoZoom TouchscreenControlPlacement ToUpperCase Tr Trace TraceAbove TraceAction TraceBackward TraceDepth TraceDialog TraceForward TraceInternal TraceLevel TraceOff TraceOn TraceOriginal TracePrint TraceScan TrackedSymbols TradingChart TraditionalForm TraditionalFunctionNotation TraditionalNotation TraditionalOrder TransferFunctionCancel TransferFunctionExpand TransferFunctionFactor TransferFunctionModel TransferFunctionPoles TransferFunctionTransform TransferFunctionZeros TransformationFunction TransformationFunctions TransformationMatrix TransformedDistribution TransformedField Translate TranslationTransform TransparentColor Transpose TreeForm TreeGraph TreeGraphQ TreePlot TrendStyle TriangleWave TriangularDistribution Trig TrigExpand TrigFactor TrigFactorList Trigger TrigReduce TrigToExp TrimmedMean True TrueQ TruncatedDistribution TsallisQExponentialDistribution TsallisQGaussianDistribution TTest Tube TubeBezierCurveBox TubeBezierCurveBoxOptions TubeBox TubeBSplineCurveBox TubeBSplineCurveBoxOptions Tuesday TukeyLambdaDistribution TukeyWindow Tuples TuranGraph TuringMachine ' +
- 'Transparent ' +
- 'UnateQ Uncompress Undefined UnderBar Underflow Underlined Underoverscript UnderoverscriptBox UnderoverscriptBoxOptions Underscript UnderscriptBox UnderscriptBoxOptions UndirectedEdge UndirectedGraph UndirectedGraphQ UndocumentedTestFEParserPacket UndocumentedTestGetSelectionPacket Unequal Unevaluated UniformDistribution UniformGraphDistribution UniformSumDistribution Uninstall Union UnionPlus Unique UnitBox UnitConvert UnitDimensions Unitize UnitRootTest UnitSimplify UnitStep UnitTriangle UnitVector Unprotect UnsameQ UnsavedVariables Unset UnsetShared UntrackedVariables Up UpArrow UpArrowBar UpArrowDownArrow Update UpdateDynamicObjects UpdateDynamicObjectsSynchronous UpdateInterval UpDownArrow UpEquilibrium UpperCaseQ UpperLeftArrow UpperRightArrow UpperTriangularize Upsample UpSet UpSetDelayed UpTee UpTeeArrow UpValues URL URLFetch URLFetchAsynchronous URLSave URLSaveAsynchronous UseGraphicsRange Using UsingFrontEnd ' +
- 'V2Get ValidationLength Value ValueBox ValueBoxOptions ValueForm ValueQ ValuesData Variables Variance VarianceEquivalenceTest VarianceEstimatorFunction VarianceGammaDistribution VarianceTest VectorAngle VectorColorFunction VectorColorFunctionScaling VectorDensityPlot VectorGlyphData VectorPlot VectorPlot3D VectorPoints VectorQ Vectors VectorScale VectorStyle Vee Verbatim Verbose VerboseConvertToPostScriptPacket VerifyConvergence VerifySolutions VerifyTestAssumptions Version VersionNumber VertexAdd VertexCapacity VertexColors VertexComponent VertexConnectivity VertexCoordinateRules VertexCoordinates VertexCorrelationSimilarity VertexCosineSimilarity VertexCount VertexCoverQ VertexDataCoordinates VertexDegree VertexDelete VertexDiceSimilarity VertexEccentricity VertexInComponent VertexInDegree VertexIndex VertexJaccardSimilarity VertexLabeling VertexLabels VertexLabelStyle VertexList VertexNormals VertexOutComponent VertexOutDegree VertexQ VertexRenderingFunction VertexReplace VertexShape VertexShapeFunction VertexSize VertexStyle VertexTextureCoordinates VertexWeight Vertical VerticalBar VerticalForm VerticalGauge VerticalSeparator VerticalSlider VerticalTilde ViewAngle ViewCenter ViewMatrix ViewPoint ViewPointSelectorSettings ViewPort ViewRange ViewVector ViewVertical VirtualGroupData Visible VisibleCell VoigtDistribution VonMisesDistribution ' +
- 'WaitAll WaitAsynchronousTask WaitNext WaitUntil WakebyDistribution WalleniusHypergeometricDistribution WaringYuleDistribution WatershedComponents WatsonUSquareTest WattsStrogatzGraphDistribution WaveletBestBasis WaveletFilterCoefficients WaveletImagePlot WaveletListPlot WaveletMapIndexed WaveletMatrixPlot WaveletPhi WaveletPsi WaveletScale WaveletScalogram WaveletThreshold WeaklyConnectedComponents WeaklyConnectedGraphQ WeakStationarity WeatherData WeberE Wedge Wednesday WeibullDistribution WeierstrassHalfPeriods WeierstrassInvariants WeierstrassP WeierstrassPPrime WeierstrassSigma WeierstrassZeta WeightedAdjacencyGraph WeightedAdjacencyMatrix WeightedData WeightedGraphQ Weights WelchWindow WheelGraph WhenEvent Which While White Whitespace WhitespaceCharacter WhittakerM WhittakerW WienerFilter WienerProcess WignerD WignerSemicircleDistribution WilksW WilksWTest WindowClickSelect WindowElements WindowFloating WindowFrame WindowFrameElements WindowMargins WindowMovable WindowOpacity WindowSelected WindowSize WindowStatusArea WindowTitle WindowToolbars WindowWidth With WolframAlpha WolframAlphaDate WolframAlphaQuantity WolframAlphaResult Word WordBoundary WordCharacter WordData WordSearch WordSeparators WorkingPrecision Write WriteString Wronskian ' +
- 'XMLElement XMLObject Xnor Xor ' +
- 'Yellow YuleDissimilarity ' +
- 'ZernikeR ZeroSymmetric ZeroTest ZeroWidthTimes Zeta ZetaZero ZipfDistribution ZTest ZTransform ' +
- '$Aborted $ActivationGroupID $ActivationKey $ActivationUserRegistered $AddOnsDirectory $AssertFunction $Assumptions $AsynchronousTask $BaseDirectory $BatchInput $BatchOutput $BoxForms $ByteOrdering $Canceled $CharacterEncoding $CharacterEncodings $CommandLine $CompilationTarget $ConditionHold $ConfiguredKernels $Context $ContextPath $ControlActiveSetting $CreationDate $CurrentLink $DateStringFormat $DefaultFont $DefaultFrontEnd $DefaultImagingDevice $DefaultPath $Display $DisplayFunction $DistributedContexts $DynamicEvaluation $Echo $Epilog $ExportFormats $Failed $FinancialDataSource $FormatType $FrontEnd $FrontEndSession $GeoLocation $HistoryLength $HomeDirectory $HTTPCookies $IgnoreEOF $ImagingDevices $ImportFormats $InitialDirectory $Input $InputFileName $InputStreamMethods $Inspector $InstallationDate $InstallationDirectory $InterfaceEnvironment $IterationLimit $KernelCount $KernelID $Language $LaunchDirectory $LibraryPath $LicenseExpirationDate $LicenseID $LicenseProcesses $LicenseServer $LicenseSubprocesses $LicenseType $Line $Linked $LinkSupported $LoadedFiles $MachineAddresses $MachineDomain $MachineDomains $MachineEpsilon $MachineID $MachineName $MachinePrecision $MachineType $MaxExtraPrecision $MaxLicenseProcesses $MaxLicenseSubprocesses $MaxMachineNumber $MaxNumber $MaxPiecewiseCases $MaxPrecision $MaxRootDegree $MessageGroups $MessageList $MessagePrePrint $Messages $MinMachineNumber $MinNumber $MinorReleaseNumber $MinPrecision $ModuleNumber $NetworkLicense $NewMessage $NewSymbol $Notebooks $NumberMarks $Off $OperatingSystem $Output $OutputForms $OutputSizeLimit $OutputStreamMethods $Packages $ParentLink $ParentProcessID $PasswordFile $PatchLevelID $Path $PathnameSeparator $PerformanceGoal $PipeSupported $Post $Pre $PreferencesDirectory $PrePrint $PreRead $PrintForms $PrintLiteral $ProcessID $ProcessorCount $ProcessorType $ProductInformation $ProgramName $RandomState $RecursionLimit $ReleaseNumber $RootDirectory $ScheduledTask $ScriptCommandLine $SessionID $SetParentLink $SharedFunctions $SharedVariables $SoundDisplay $SoundDisplayFunction $SuppressInputFormHeads $SynchronousEvaluation $SyntaxHandler $System $SystemCharacterEncoding $SystemID $SystemWordLength $TemporaryDirectory $TemporaryPrefix $TextStyle $TimedOut $TimeUnit $TimeZone $TopDirectory $TraceOff $TraceOn $TracePattern $TracePostAction $TracePreAction $Urgent $UserAddOnsDirectory $UserBaseDirectory $UserDocumentsDirectory $UserName $Version $VersionNumber',
- contains: [
- {
- className: 'comment',
- begin: /\(\*/, end: /\*\)/
- },
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE,
- {
- begin: /\{/, end: /\}/,
- illegal: /:/
- }
- ]
- };
-};
-},{}],211:[function(require,module,exports){
-module.exports = function(hljs) {
- var COMMON_CONTAINS = [
- hljs.C_NUMBER_MODE,
- {
- className: 'string',
- begin: '\'', end: '\'',
- contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}]
- }
- ];
- var TRANSPOSE = {
- relevance: 0,
- contains: [
- {
- begin: /'['\.]*/
- }
- ]
- };
-
- return {
- keywords: {
- keyword:
- 'break case catch classdef continue else elseif end enumerated events for function ' +
- 'global if methods otherwise parfor persistent properties return spmd switch try while',
- built_in:
- 'sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan ' +
- 'atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot ' +
- 'cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog ' +
- 'realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal ' +
- 'cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli ' +
- 'besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma ' +
- 'gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms ' +
- 'nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones ' +
- 'eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ' +
- 'ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril ' +
- 'triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute ' +
- 'shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i inf nan ' +
- 'isnan isinf isfinite j why compan gallery hadamard hankel hilb invhilb magic pascal ' +
- 'rosser toeplitz vander wilkinson'
- },
- illegal: '(//|"|#|/\\*|\\s+/\\w+)',
- contains: [
- {
- className: 'function',
- beginKeywords: 'function', end: '$',
- contains: [
- hljs.UNDERSCORE_TITLE_MODE,
- {
- className: 'params',
- variants: [
- {begin: '\\(', end: '\\)'},
- {begin: '\\[', end: '\\]'}
- ]
- }
- ]
- },
- {
- begin: /[a-zA-Z_][a-zA-Z_0-9]*'['\.]*/,
- returnBegin: true,
- relevance: 0,
- contains: [
- {begin: /[a-zA-Z_][a-zA-Z_0-9]*/, relevance: 0},
- TRANSPOSE.contains[0]
- ]
- },
- {
- begin: '\\[', end: '\\]',
- contains: COMMON_CONTAINS,
- relevance: 0,
- starts: TRANSPOSE
- },
- {
- begin: '\\{', end: /}/,
- contains: COMMON_CONTAINS,
- relevance: 0,
- starts: TRANSPOSE
- },
- {
- // transpose operators at the end of a function call
- begin: /\)/,
- relevance: 0,
- starts: TRANSPOSE
- },
- hljs.COMMENT('^\\s*\\%\\{\\s*$', '^\\s*\\%\\}\\s*$'),
- hljs.COMMENT('\\%', '$')
- ].concat(COMMON_CONTAINS)
- };
-};
-},{}],212:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS = 'if then else elseif for thru do while unless step in and or not';
- var LITERALS = 'true false unknown inf minf ind und %e %i %pi %phi %gamma';
- var BUILTIN_FUNCTIONS =
- ' abasep abs absint absolute_real_time acos acosh acot acoth acsc acsch activate'
- + ' addcol add_edge add_edges addmatrices addrow add_vertex add_vertices adjacency_matrix'
- + ' adjoin adjoint af agd airy airy_ai airy_bi airy_dai airy_dbi algsys alg_type'
- + ' alias allroots alphacharp alphanumericp amortization %and annuity_fv'
- + ' annuity_pv antid antidiff AntiDifference append appendfile apply apply1 apply2'
- + ' applyb1 apropos args arit_amortization arithmetic arithsum array arrayapply'
- + ' arrayinfo arraymake arraysetapply ascii asec asech asin asinh askinteger'
- + ' asksign assoc assoc_legendre_p assoc_legendre_q assume assume_external_byte_order'
- + ' asympa at atan atan2 atanh atensimp atom atvalue augcoefmatrix augmented_lagrangian_method'
- + ' av average_degree backtrace bars barsplot barsplot_description base64 base64_decode'
- + ' bashindices batch batchload bc2 bdvac belln benefit_cost bern bernpoly bernstein_approx'
- + ' bernstein_expand bernstein_poly bessel bessel_i bessel_j bessel_k bessel_simplify'
- + ' bessel_y beta beta_incomplete beta_incomplete_generalized beta_incomplete_regularized'
- + ' bezout bfallroots bffac bf_find_root bf_fmin_cobyla bfhzeta bfloat bfloatp'
- + ' bfpsi bfpsi0 bfzeta biconnected_components bimetric binomial bipartition'
- + ' block blockmatrixp bode_gain bode_phase bothcoef box boxplot boxplot_description'
- + ' break bug_report build_info|10 buildq build_sample burn cabs canform canten'
- + ' cardinality carg cartan cartesian_product catch cauchy_matrix cbffac cdf_bernoulli'
- + ' cdf_beta cdf_binomial cdf_cauchy cdf_chi2 cdf_continuous_uniform cdf_discrete_uniform'
- + ' cdf_exp cdf_f cdf_gamma cdf_general_finite_discrete cdf_geometric cdf_gumbel'
- + ' cdf_hypergeometric cdf_laplace cdf_logistic cdf_lognormal cdf_negative_binomial'
- + ' cdf_noncentral_chi2 cdf_noncentral_student_t cdf_normal cdf_pareto cdf_poisson'
- + ' cdf_rank_sum cdf_rayleigh cdf_signed_rank cdf_student_t cdf_weibull cdisplay'
- + ' ceiling central_moment cequal cequalignore cf cfdisrep cfexpand cgeodesic'
- + ' cgreaterp cgreaterpignore changename changevar chaosgame charat charfun charfun2'
- + ' charlist charp charpoly chdir chebyshev_t chebyshev_u checkdiv check_overlaps'
- + ' chinese cholesky christof chromatic_index chromatic_number cint circulant_graph'
- + ' clear_edge_weight clear_rules clear_vertex_label clebsch_gordan clebsch_graph'
- + ' clessp clesspignore close closefile cmetric coeff coefmatrix cograd col collapse'
- + ' collectterms columnop columnspace columnswap columnvector combination combine'
- + ' comp2pui compare compfile compile compile_file complement_graph complete_bipartite_graph'
- + ' complete_graph complex_number_p components compose_functions concan concat'
- + ' conjugate conmetderiv connected_components connect_vertices cons constant'
- + ' constantp constituent constvalue cont2part content continuous_freq contortion'
- + ' contour_plot contract contract_edge contragrad contrib_ode convert coord'
- + ' copy copy_file copy_graph copylist copymatrix cor cos cosh cot coth cov cov1'
- + ' covdiff covect covers crc24sum create_graph create_list csc csch csetup cspline'
- + ' ctaylor ct_coordsys ctransform ctranspose cube_graph cuboctahedron_graph'
- + ' cunlisp cv cycle_digraph cycle_graph cylindrical days360 dblint deactivate'
- + ' declare declare_constvalue declare_dimensions declare_fundamental_dimensions'
- + ' declare_fundamental_units declare_qty declare_translated declare_unit_conversion'
- + ' declare_units declare_weights decsym defcon define define_alt_display define_variable'
- + ' defint defmatch defrule defstruct deftaylor degree_sequence del delete deleten'
- + ' delta demo demoivre denom depends derivdegree derivlist describe desolve'
- + ' determinant dfloat dgauss_a dgauss_b dgeev dgemm dgeqrf dgesv dgesvd diag'
- + ' diagmatrix diag_matrix diagmatrixp diameter diff digitcharp dimacs_export'
- + ' dimacs_import dimension dimensionless dimensions dimensions_as_list direct'
- + ' directory discrete_freq disjoin disjointp disolate disp dispcon dispform'
- + ' dispfun dispJordan display disprule dispterms distrib divide divisors divsum'
- + ' dkummer_m dkummer_u dlange dodecahedron_graph dotproduct dotsimp dpart'
- + ' draw draw2d draw3d drawdf draw_file draw_graph dscalar echelon edge_coloring'
- + ' edge_connectivity edges eigens_by_jacobi eigenvalues eigenvectors eighth'
- + ' einstein eivals eivects elapsed_real_time elapsed_run_time ele2comp ele2polynome'
- + ' ele2pui elem elementp elevation_grid elim elim_allbut eliminate eliminate_using'
- + ' ellipse elliptic_e elliptic_ec elliptic_eu elliptic_f elliptic_kc elliptic_pi'
- + ' ematrix empty_graph emptyp endcons entermatrix entertensor entier equal equalp'
- + ' equiv_classes erf erfc erf_generalized erfi errcatch error errormsg errors'
- + ' euler ev eval_string evenp every evolution evolution2d evundiff example exp'
- + ' expand expandwrt expandwrt_factored expint expintegral_chi expintegral_ci'
- + ' expintegral_e expintegral_e1 expintegral_ei expintegral_e_simplify expintegral_li'
- + ' expintegral_shi expintegral_si explicit explose exponentialize express expt'
- + ' exsec extdiff extract_linear_equations extremal_subset ezgcd %f f90 facsum'
- + ' factcomb factor factorfacsum factorial factorout factorsum facts fast_central_elements'
- + ' fast_linsolve fasttimes featurep fernfale fft fib fibtophi fifth filename_merge'
- + ' file_search file_type fillarray findde find_root find_root_abs find_root_error'
- + ' find_root_rel first fix flatten flength float floatnump floor flower_snark'
- + ' flush flush1deriv flushd flushnd flush_output fmin_cobyla forget fortran'
- + ' fourcos fourexpand fourier fourier_elim fourint fourintcos fourintsin foursimp'
- + ' foursin fourth fposition frame_bracket freeof freshline fresnel_c fresnel_s'
- + ' from_adjacency_matrix frucht_graph full_listify fullmap fullmapl fullratsimp'
- + ' fullratsubst fullsetify funcsolve fundamental_dimensions fundamental_units'
- + ' fundef funmake funp fv g0 g1 gamma gamma_greek gamma_incomplete gamma_incomplete_generalized'
- + ' gamma_incomplete_regularized gauss gauss_a gauss_b gaussprob gcd gcdex gcdivide'
- + ' gcfac gcfactor gd generalized_lambert_w genfact gen_laguerre genmatrix gensym'
- + ' geo_amortization geo_annuity_fv geo_annuity_pv geomap geometric geometric_mean'
- + ' geosum get getcurrentdirectory get_edge_weight getenv get_lu_factors get_output_stream_string'
- + ' get_pixel get_plot_option get_tex_environment get_tex_environment_default'
- + ' get_vertex_label gfactor gfactorsum ggf girth global_variances gn gnuplot_close'
- + ' gnuplot_replot gnuplot_reset gnuplot_restart gnuplot_start go Gosper GosperSum'
- + ' gr2d gr3d gradef gramschmidt graph6_decode graph6_encode graph6_export graph6_import'
- + ' graph_center graph_charpoly graph_eigenvalues graph_flow graph_order graph_periphery'
- + ' graph_product graph_size graph_union great_rhombicosidodecahedron_graph great_rhombicuboctahedron_graph'
- + ' grid_graph grind grobner_basis grotzch_graph hamilton_cycle hamilton_path'
- + ' hankel hankel_1 hankel_2 harmonic harmonic_mean hav heawood_graph hermite'
- + ' hessian hgfred hilbertmap hilbert_matrix hipow histogram histogram_description'
- + ' hodge horner hypergeometric i0 i1 %ibes ic1 ic2 ic_convert ichr1 ichr2 icosahedron_graph'
- + ' icosidodecahedron_graph icurvature ident identfor identity idiff idim idummy'
- + ' ieqn %if ifactors iframes ifs igcdex igeodesic_coords ilt image imagpart'
- + ' imetric implicit implicit_derivative implicit_plot indexed_tensor indices'
- + ' induced_subgraph inferencep inference_result infix info_display init_atensor'
- + ' init_ctensor in_neighbors innerproduct inpart inprod inrt integerp integer_partitions'
- + ' integrate intersect intersection intervalp intopois intosum invariant1 invariant2'
- + ' inverse_fft inverse_jacobi_cd inverse_jacobi_cn inverse_jacobi_cs inverse_jacobi_dc'
- + ' inverse_jacobi_dn inverse_jacobi_ds inverse_jacobi_nc inverse_jacobi_nd inverse_jacobi_ns'
- + ' inverse_jacobi_sc inverse_jacobi_sd inverse_jacobi_sn invert invert_by_adjoint'
- + ' invert_by_lu inv_mod irr is is_biconnected is_bipartite is_connected is_digraph'
- + ' is_edge_in_graph is_graph is_graph_or_digraph ishow is_isomorphic isolate'
- + ' isomorphism is_planar isqrt isreal_p is_sconnected is_tree is_vertex_in_graph'
- + ' items_inference %j j0 j1 jacobi jacobian jacobi_cd jacobi_cn jacobi_cs jacobi_dc'
- + ' jacobi_dn jacobi_ds jacobi_nc jacobi_nd jacobi_ns jacobi_p jacobi_sc jacobi_sd'
- + ' jacobi_sn JF jn join jordan julia julia_set julia_sin %k kdels kdelta kill'
- + ' killcontext kostka kron_delta kronecker_product kummer_m kummer_u kurtosis'
- + ' kurtosis_bernoulli kurtosis_beta kurtosis_binomial kurtosis_chi2 kurtosis_continuous_uniform'
- + ' kurtosis_discrete_uniform kurtosis_exp kurtosis_f kurtosis_gamma kurtosis_general_finite_discrete'
- + ' kurtosis_geometric kurtosis_gumbel kurtosis_hypergeometric kurtosis_laplace'
- + ' kurtosis_logistic kurtosis_lognormal kurtosis_negative_binomial kurtosis_noncentral_chi2'
- + ' kurtosis_noncentral_student_t kurtosis_normal kurtosis_pareto kurtosis_poisson'
- + ' kurtosis_rayleigh kurtosis_student_t kurtosis_weibull label labels lagrange'
- + ' laguerre lambda lambert_w laplace laplacian_matrix last lbfgs lc2kdt lcharp'
- + ' lc_l lcm lc_u ldefint ldisp ldisplay legendre_p legendre_q leinstein length'
- + ' let letrules letsimp levi_civita lfreeof lgtreillis lhs li liediff limit'
- + ' Lindstedt linear linearinterpol linear_program linear_regression line_graph'
- + ' linsolve listarray list_correlations listify list_matrix_entries list_nc_monomials'
- + ' listoftens listofvars listp lmax lmin load loadfile local locate_matrix_entry'
- + ' log logcontract log_gamma lopow lorentz_gauge lowercasep lpart lratsubst'
- + ' lreduce lriemann lsquares_estimates lsquares_estimates_approximate lsquares_estimates_exact'
- + ' lsquares_mse lsquares_residual_mse lsquares_residuals lsum ltreillis lu_backsub'
- + ' lucas lu_factor %m macroexpand macroexpand1 make_array makebox makefact makegamma'
- + ' make_graph make_level_picture makelist makeOrders make_poly_continent make_poly_country'
- + ' make_polygon make_random_state make_rgb_picture makeset make_string_input_stream'
- + ' make_string_output_stream make_transform mandelbrot mandelbrot_set map mapatom'
- + ' maplist matchdeclare matchfix mat_cond mat_fullunblocker mat_function mathml_display'
- + ' mat_norm matrix matrixmap matrixp matrix_size mattrace mat_trace mat_unblocker'
- + ' max max_clique max_degree max_flow maximize_lp max_independent_set max_matching'
- + ' maybe md5sum mean mean_bernoulli mean_beta mean_binomial mean_chi2 mean_continuous_uniform'
- + ' mean_deviation mean_discrete_uniform mean_exp mean_f mean_gamma mean_general_finite_discrete'
- + ' mean_geometric mean_gumbel mean_hypergeometric mean_laplace mean_logistic'
- + ' mean_lognormal mean_negative_binomial mean_noncentral_chi2 mean_noncentral_student_t'
- + ' mean_normal mean_pareto mean_poisson mean_rayleigh mean_student_t mean_weibull'
- + ' median median_deviation member mesh metricexpandall mgf1_sha1 min min_degree'
- + ' min_edge_cut minfactorial minimalPoly minimize_lp minimum_spanning_tree minor'
- + ' minpack_lsquares minpack_solve min_vertex_cover min_vertex_cut mkdir mnewton'
- + ' mod mode_declare mode_identity ModeMatrix moebius mon2schur mono monomial_dimensions'
- + ' multibernstein_poly multi_display_for_texinfo multi_elem multinomial multinomial_coeff'
- + ' multi_orbit multiplot_mode multi_pui multsym multthru mycielski_graph nary'
- + ' natural_unit nc_degree ncexpt ncharpoly negative_picture neighbors new newcontext'
- + ' newdet new_graph newline newton new_variable next_prime nicedummies niceindices'
- + ' ninth nofix nonarray noncentral_moment nonmetricity nonnegintegerp nonscalarp'
- + ' nonzeroandfreeof notequal nounify nptetrad npv nroots nterms ntermst'
- + ' nthroot nullity nullspace num numbered_boundaries numberp number_to_octets'
- + ' num_distinct_partitions numerval numfactor num_partitions nusum nzeta nzetai'
- + ' nzetar octets_to_number octets_to_oid odd_girth oddp ode2 ode_check odelin'
- + ' oid_to_octets op opena opena_binary openr openr_binary openw openw_binary'
- + ' operatorp opsubst optimize %or orbit orbits ordergreat ordergreatp orderless'
- + ' orderlessp orthogonal_complement orthopoly_recur orthopoly_weight outermap'
- + ' out_neighbors outofpois pade parabolic_cylinder_d parametric parametric_surface'
- + ' parg parGosper parse_string parse_timedate part part2cont partfrac partition'
- + ' partition_set partpol path_digraph path_graph pathname_directory pathname_name'
- + ' pathname_type pdf_bernoulli pdf_beta pdf_binomial pdf_cauchy pdf_chi2 pdf_continuous_uniform'
- + ' pdf_discrete_uniform pdf_exp pdf_f pdf_gamma pdf_general_finite_discrete'
- + ' pdf_geometric pdf_gumbel pdf_hypergeometric pdf_laplace pdf_logistic pdf_lognormal'
- + ' pdf_negative_binomial pdf_noncentral_chi2 pdf_noncentral_student_t pdf_normal'
- + ' pdf_pareto pdf_poisson pdf_rank_sum pdf_rayleigh pdf_signed_rank pdf_student_t'
- + ' pdf_weibull pearson_skewness permanent permut permutation permutations petersen_graph'
- + ' petrov pickapart picture_equalp picturep piechart piechart_description planar_embedding'
- + ' playback plog plot2d plot3d plotdf ploteq plsquares pochhammer points poisdiff'
- + ' poisexpt poisint poismap poisplus poissimp poissubst poistimes poistrim polar'
- + ' polarform polartorect polar_to_xy poly_add poly_buchberger poly_buchberger_criterion'
- + ' poly_colon_ideal poly_content polydecomp poly_depends_p poly_elimination_ideal'
- + ' poly_exact_divide poly_expand poly_expt poly_gcd polygon poly_grobner poly_grobner_equal'
- + ' poly_grobner_member poly_grobner_subsetp poly_ideal_intersection poly_ideal_polysaturation'
- + ' poly_ideal_polysaturation1 poly_ideal_saturation poly_ideal_saturation1 poly_lcm'
- + ' poly_minimization polymod poly_multiply polynome2ele polynomialp poly_normal_form'
- + ' poly_normalize poly_normalize_list poly_polysaturation_extension poly_primitive_part'
- + ' poly_pseudo_divide poly_reduced_grobner poly_reduction poly_saturation_extension'
- + ' poly_s_polynomial poly_subtract polytocompanion pop postfix potential power_mod'
- + ' powerseries powerset prefix prev_prime primep primes principal_components'
- + ' print printf printfile print_graph printpois printprops prodrac product properties'
- + ' propvars psi psubst ptriangularize pui pui2comp pui2ele pui2polynome pui_direct'
- + ' puireduc push put pv qput qrange qty quad_control quad_qag quad_qagi quad_qagp'
- + ' quad_qags quad_qawc quad_qawf quad_qawo quad_qaws quadrilateral quantile'
- + ' quantile_bernoulli quantile_beta quantile_binomial quantile_cauchy quantile_chi2'
- + ' quantile_continuous_uniform quantile_discrete_uniform quantile_exp quantile_f'
- + ' quantile_gamma quantile_general_finite_discrete quantile_geometric quantile_gumbel'
- + ' quantile_hypergeometric quantile_laplace quantile_logistic quantile_lognormal'
- + ' quantile_negative_binomial quantile_noncentral_chi2 quantile_noncentral_student_t'
- + ' quantile_normal quantile_pareto quantile_poisson quantile_rayleigh quantile_student_t'
- + ' quantile_weibull quartile_skewness quit qunit quotient racah_v racah_w radcan'
- + ' radius random random_bernoulli random_beta random_binomial random_bipartite_graph'
- + ' random_cauchy random_chi2 random_continuous_uniform random_digraph random_discrete_uniform'
- + ' random_exp random_f random_gamma random_general_finite_discrete random_geometric'
- + ' random_graph random_graph1 random_gumbel random_hypergeometric random_laplace'
- + ' random_logistic random_lognormal random_negative_binomial random_network'
- + ' random_noncentral_chi2 random_noncentral_student_t random_normal random_pareto'
- + ' random_permutation random_poisson random_rayleigh random_regular_graph random_student_t'
- + ' random_tournament random_tree random_weibull range rank rat ratcoef ratdenom'
- + ' ratdiff ratdisrep ratexpand ratinterpol rational rationalize ratnumer ratnump'
- + ' ratp ratsimp ratsubst ratvars ratweight read read_array read_binary_array'
- + ' read_binary_list read_binary_matrix readbyte readchar read_hashed_array readline'
- + ' read_list read_matrix read_nested_list readonly read_xpm real_imagpart_to_conjugate'
- + ' realpart realroots rearray rectangle rectform rectform_log_if_constant recttopolar'
- + ' rediff reduce_consts reduce_order region region_boundaries region_boundaries_plus'
- + ' rem remainder remarray rembox remcomps remcon remcoord remfun remfunction'
- + ' remlet remove remove_constvalue remove_dimensions remove_edge remove_fundamental_dimensions'
- + ' remove_fundamental_units remove_plot_option remove_vertex rempart remrule'
- + ' remsym remvalue rename rename_file reset reset_displays residue resolvante'
- + ' resolvante_alternee1 resolvante_bipartite resolvante_diedrale resolvante_klein'
- + ' resolvante_klein3 resolvante_produit_sym resolvante_unitaire resolvante_vierer'
- + ' rest resultant return reveal reverse revert revert2 rgb2level rhs ricci riemann'
- + ' rinvariant risch rk rmdir rncombine romberg room rootscontract round row'
- + ' rowop rowswap rreduce run_testsuite %s save saving scalarp scaled_bessel_i'
- + ' scaled_bessel_i0 scaled_bessel_i1 scalefactors scanmap scatterplot scatterplot_description'
- + ' scene schur2comp sconcat scopy scsimp scurvature sdowncase sec sech second'
- + ' sequal sequalignore set_alt_display setdifference set_draw_defaults set_edge_weight'
- + ' setelmx setequalp setify setp set_partitions set_plot_option set_prompt set_random_state'
- + ' set_tex_environment set_tex_environment_default setunits setup_autoload set_up_dot_simplifications'
- + ' set_vertex_label seventh sexplode sf sha1sum sha256sum shortest_path shortest_weighted_path'
- + ' show showcomps showratvars sierpinskiale sierpinskimap sign signum similaritytransform'
- + ' simp_inequality simplify_sum simplode simpmetderiv simtran sin sinh sinsert'
- + ' sinvertcase sixth skewness skewness_bernoulli skewness_beta skewness_binomial'
- + ' skewness_chi2 skewness_continuous_uniform skewness_discrete_uniform skewness_exp'
- + ' skewness_f skewness_gamma skewness_general_finite_discrete skewness_geometric'
- + ' skewness_gumbel skewness_hypergeometric skewness_laplace skewness_logistic'
- + ' skewness_lognormal skewness_negative_binomial skewness_noncentral_chi2 skewness_noncentral_student_t'
- + ' skewness_normal skewness_pareto skewness_poisson skewness_rayleigh skewness_student_t'
- + ' skewness_weibull slength smake small_rhombicosidodecahedron_graph small_rhombicuboctahedron_graph'
- + ' smax smin smismatch snowmap snub_cube_graph snub_dodecahedron_graph solve'
- + ' solve_rec solve_rec_rat some somrac sort sparse6_decode sparse6_encode sparse6_export'
- + ' sparse6_import specint spherical spherical_bessel_j spherical_bessel_y spherical_hankel1'
- + ' spherical_hankel2 spherical_harmonic spherical_to_xyz splice split sposition'
- + ' sprint sqfr sqrt sqrtdenest sremove sremovefirst sreverse ssearch ssort sstatus'
- + ' ssubst ssubstfirst staircase standardize standardize_inverse_trig starplot'
- + ' starplot_description status std std1 std_bernoulli std_beta std_binomial'
- + ' std_chi2 std_continuous_uniform std_discrete_uniform std_exp std_f std_gamma'
- + ' std_general_finite_discrete std_geometric std_gumbel std_hypergeometric std_laplace'
- + ' std_logistic std_lognormal std_negative_binomial std_noncentral_chi2 std_noncentral_student_t'
- + ' std_normal std_pareto std_poisson std_rayleigh std_student_t std_weibull'
- + ' stemplot stirling stirling1 stirling2 strim striml strimr string stringout'
- + ' stringp strong_components struve_h struve_l sublis sublist sublist_indices'
- + ' submatrix subsample subset subsetp subst substinpart subst_parallel substpart'
- + ' substring subvar subvarp sum sumcontract summand_to_rec supcase supcontext'
- + ' symbolp symmdifference symmetricp system take_channel take_inference tan'
- + ' tanh taylor taylorinfo taylorp taylor_simplifier taytorat tcl_output tcontract'
- + ' tellrat tellsimp tellsimpafter tentex tenth test_mean test_means_difference'
- + ' test_normality test_proportion test_proportions_difference test_rank_sum'
- + ' test_sign test_signed_rank test_variance test_variance_ratio tex tex1 tex_display'
- + ' texput %th third throw time timedate timer timer_info tldefint tlimit todd_coxeter'
- + ' toeplitz tokens to_lisp topological_sort to_poly to_poly_solve totaldisrep'
- + ' totalfourier totient tpartpol trace tracematrix trace_options transform_sample'
- + ' translate translate_file transpose treefale tree_reduce treillis treinat'
- + ' triangle triangularize trigexpand trigrat trigreduce trigsimp trunc truncate'
- + ' truncated_cube_graph truncated_dodecahedron_graph truncated_icosahedron_graph'
- + ' truncated_tetrahedron_graph tr_warnings_get tube tutte_graph ueivects uforget'
- + ' ultraspherical underlying_graph undiff union unique uniteigenvectors unitp'
- + ' units unit_step unitvector unorder unsum untellrat untimer'
- + ' untrace uppercasep uricci uriemann uvect vandermonde_matrix var var1 var_bernoulli'
- + ' var_beta var_binomial var_chi2 var_continuous_uniform var_discrete_uniform'
- + ' var_exp var_f var_gamma var_general_finite_discrete var_geometric var_gumbel'
- + ' var_hypergeometric var_laplace var_logistic var_lognormal var_negative_binomial'
- + ' var_noncentral_chi2 var_noncentral_student_t var_normal var_pareto var_poisson'
- + ' var_rayleigh var_student_t var_weibull vector vectorpotential vectorsimp'
- + ' verbify vers vertex_coloring vertex_connectivity vertex_degree vertex_distance'
- + ' vertex_eccentricity vertex_in_degree vertex_out_degree vertices vertices_to_cycle'
- + ' vertices_to_path %w weyl wheel_graph wiener_index wigner_3j wigner_6j'
- + ' wigner_9j with_stdout write_binary_data writebyte write_data writefile wronskian'
- + ' xreduce xthru %y Zeilberger zeroequiv zerofor zeromatrix zeromatrixp zeta'
- + ' zgeev zheev zlange zn_add_table zn_carmichael_lambda zn_characteristic_factors'
- + ' zn_determinant zn_factor_generators zn_invert_by_lu zn_log zn_mult_table'
- + ' absboxchar activecontexts adapt_depth additive adim aform algebraic'
- + ' algepsilon algexact aliases allbut all_dotsimp_denoms allocation allsym alphabetic'
- + ' animation antisymmetric arrays askexp assume_pos assume_pos_pred assumescalar'
- + ' asymbol atomgrad atrig1 axes axis_3d axis_bottom axis_left axis_right axis_top'
- + ' azimuth background background_color backsubst berlefact bernstein_explicit'
- + ' besselexpand beta_args_sum_to_integer beta_expand bftorat bftrunc bindtest'
- + ' border boundaries_array box boxchar breakup %c capping cauchysum cbrange'
- + ' cbtics center cflength cframe_flag cnonmet_flag color color_bar color_bar_tics'
- + ' colorbox columns commutative complex cone context contexts contour contour_levels'
- + ' cosnpiflag ctaypov ctaypt ctayswitch ctayvar ct_coords ctorsion_flag ctrgsimp'
- + ' cube current_let_rule_package cylinder data_file_name debugmode decreasing'
- + ' default_let_rule_package delay dependencies derivabbrev derivsubst detout'
- + ' diagmetric diff dim dimensions dispflag display2d|10 display_format_internal'
- + ' distribute_over doallmxops domain domxexpt domxmxops domxnctimes dontfactor'
- + ' doscmxops doscmxplus dot0nscsimp dot0simp dot1simp dotassoc dotconstrules'
- + ' dotdistrib dotexptsimp dotident dotscrules draw_graph_program draw_realpart'
- + ' edge_color edge_coloring edge_partition edge_type edge_width %edispflag'
- + ' elevation %emode endphi endtheta engineering_format_floats enhanced3d %enumer'
- + ' epsilon_lp erfflag erf_representation errormsg error_size error_syms error_type'
- + ' %e_to_numlog eval even evenfun evflag evfun ev_point expandwrt_denom expintexpand'
- + ' expintrep expon expop exptdispflag exptisolate exptsubst facexpand facsum_combine'
- + ' factlim factorflag factorial_expand factors_only fb feature features'
- + ' file_name file_output_append file_search_demo file_search_lisp file_search_maxima|10'
- + ' file_search_tests file_search_usage file_type_lisp file_type_maxima|10 fill_color'
- + ' fill_density filled_func fixed_vertices flipflag float2bf font font_size'
- + ' fortindent fortspaces fpprec fpprintprec functions gamma_expand gammalim'
- + ' gdet genindex gensumnum GGFCFMAX GGFINFINITY globalsolve gnuplot_command'
- + ' gnuplot_curve_styles gnuplot_curve_titles gnuplot_default_term_command gnuplot_dumb_term_command'
- + ' gnuplot_file_args gnuplot_file_name gnuplot_out_file gnuplot_pdf_term_command'
- + ' gnuplot_pm3d gnuplot_png_term_command gnuplot_postamble gnuplot_preamble'
- + ' gnuplot_ps_term_command gnuplot_svg_term_command gnuplot_term gnuplot_view_args'
- + ' Gosper_in_Zeilberger gradefs grid grid2d grind halfangles head_angle head_both'
- + ' head_length head_type height hypergeometric_representation %iargs ibase'
- + ' icc1 icc2 icounter idummyx ieqnprint ifb ifc1 ifc2 ifg ifgi ifr iframe_bracket_form'
- + ' ifri igeowedge_flag ikt1 ikt2 imaginary inchar increasing infeval'
- + ' infinity inflag infolists inm inmc1 inmc2 intanalysis integer integervalued'
- + ' integrate_use_rootsof integration_constant integration_constant_counter interpolate_color'
- + ' intfaclim ip_grid ip_grid_in irrational isolate_wrt_times iterations itr'
- + ' julia_parameter %k1 %k2 keepfloat key key_pos kinvariant kt label label_alignment'
- + ' label_orientation labels lassociative lbfgs_ncorrections lbfgs_nfeval_max'
- + ' leftjust legend letrat let_rule_packages lfg lg lhospitallim limsubst linear'
- + ' linear_solver linechar linel|10 linenum line_type linewidth line_width linsolve_params'
- + ' linsolvewarn lispdisp listarith listconstvars listdummyvars lmxchar load_pathname'
- + ' loadprint logabs logarc logcb logconcoeffp logexpand lognegint logsimp logx'
- + ' logx_secondary logy logy_secondary logz lriem m1pbranch macroexpansion macros'
- + ' mainvar manual_demo maperror mapprint matrix_element_add matrix_element_mult'
- + ' matrix_element_transpose maxapplydepth maxapplyheight maxima_tempdir|10 maxima_userdir|10'
- + ' maxnegex MAX_ORD maxposex maxpsifracdenom maxpsifracnum maxpsinegint maxpsiposint'
- + ' maxtayorder mesh_lines_color method mod_big_prime mode_check_errorp'
- + ' mode_checkp mode_check_warnp mod_test mod_threshold modular_linear_solver'
- + ' modulus multiplicative multiplicities myoptions nary negdistrib negsumdispflag'
- + ' newline newtonepsilon newtonmaxiter nextlayerfactor niceindicespref nm nmc'
- + ' noeval nolabels nonegative_lp noninteger nonscalar noun noundisp nouns np'
- + ' npi nticks ntrig numer numer_pbranch obase odd oddfun opacity opproperties'
- + ' opsubst optimprefix optionset orientation origin orthopoly_returns_intervals'
- + ' outative outchar packagefile palette partswitch pdf_file pfeformat phiresolution'
- + ' %piargs piece pivot_count_sx pivot_max_sx plot_format plot_options plot_realpart'
- + ' png_file pochhammer_max_index points pointsize point_size points_joined point_type'
- + ' poislim poisson poly_coefficient_ring poly_elimination_order polyfactor poly_grobner_algorithm'
- + ' poly_grobner_debug poly_monomial_order poly_primary_elimination_order poly_return_term_list'
- + ' poly_secondary_elimination_order poly_top_reduction_only posfun position'
- + ' powerdisp pred prederror primep_number_of_tests product_use_gamma program'
- + ' programmode promote_float_to_bigfloat prompt proportional_axes props psexpand'
- + ' ps_file radexpand radius radsubstflag rassociative ratalgdenom ratchristof'
- + ' ratdenomdivide rateinstein ratepsilon ratfac rational ratmx ratprint ratriemann'
- + ' ratsimpexpons ratvarswitch ratweights ratweyl ratwtlvl real realonly redraw'
- + ' refcheck resolution restart resultant ric riem rmxchar %rnum_list rombergabs'
- + ' rombergit rombergmin rombergtol rootsconmode rootsepsilon run_viewer same_xy'
- + ' same_xyz savedef savefactors scalar scalarmatrixp scale scale_lp setcheck'
- + ' setcheckbreak setval show_edge_color show_edges show_edge_type show_edge_width'
- + ' show_id show_label showtime show_vertex_color show_vertex_size show_vertex_type'
- + ' show_vertices show_weight simp simplified_output simplify_products simpproduct'
- + ' simpsum sinnpiflag solvedecomposes solveexplicit solvefactors solvenullwarn'
- + ' solveradcan solvetrigwarn space sparse sphere spring_embedding_depth sqrtdispflag'
- + ' stardisp startphi starttheta stats_numer stringdisp structures style sublis_apply_lambda'
- + ' subnumsimp sumexpand sumsplitfact surface surface_hide svg_file symmetric'
- + ' tab taylordepth taylor_logexpand taylor_order_coefficients taylor_truncate_polynomials'
- + ' tensorkill terminal testsuite_files thetaresolution timer_devalue title tlimswitch'
- + ' tr track transcompile transform transform_xy translate_fast_arrays transparent'
- + ' transrun tr_array_as_ref tr_bound_function_applyp tr_file_tty_messagesp tr_float_can_branch_complex'
- + ' tr_function_call_default trigexpandplus trigexpandtimes triginverses trigsign'
- + ' trivial_solutions tr_numer tr_optimize_max_loop tr_semicompile tr_state_vars'
- + ' tr_warn_bad_function_calls tr_warn_fexpr tr_warn_meval tr_warn_mode'
- + ' tr_warn_undeclared tr_warn_undefined_variable tstep ttyoff tube_extremes'
- + ' ufg ug %unitexpand unit_vectors uric uriem use_fast_arrays user_preamble'
- + ' usersetunits values vect_cross verbose vertex_color vertex_coloring vertex_partition'
- + ' vertex_size vertex_type view warnings weyl width windowname windowtitle wired_surface'
- + ' wireframe xaxis xaxis_color xaxis_secondary xaxis_type xaxis_width xlabel'
- + ' xlabel_secondary xlength xrange xrange_secondary xtics xtics_axis xtics_rotate'
- + ' xtics_rotate_secondary xtics_secondary xtics_secondary_axis xu_grid x_voxel'
- + ' xy_file xyplane xy_scale yaxis yaxis_color yaxis_secondary yaxis_type yaxis_width'
- + ' ylabel ylabel_secondary ylength yrange yrange_secondary ytics ytics_axis'
- + ' ytics_rotate ytics_rotate_secondary ytics_secondary ytics_secondary_axis'
- + ' yv_grid y_voxel yx_ratio zaxis zaxis_color zaxis_type zaxis_width zeroa zerob'
- + ' zerobern zeta%pi zlabel zlabel_rotate zlength zmin zn_primroot_limit zn_primroot_pretest';
- var SYMBOLS = '_ __ %|0 %%|0';
-
- return {
- lexemes: '[A-Za-z_%][0-9A-Za-z_%]*',
- keywords: {
- keyword: KEYWORDS,
- literal: LITERALS,
- built_in: BUILTIN_FUNCTIONS,
- symbol: SYMBOLS,
- },
- contains: [
- {
- className: 'comment',
- begin: '/\\*',
- end: '\\*/',
- contains: ['self']
- },
- hljs.QUOTE_STRING_MODE,
- {
- className: 'number',
- relevance: 0,
- variants: [
- {
- // float number w/ exponent
- // hmm, I wonder if we ought to include other exponent markers?
- begin: '\\b(\\d+|\\d+\\.|\\.\\d+|\\d+\\.\\d+)[Ee][-+]?\\d+\\b',
- },
- {
- // bigfloat number
- begin: '\\b(\\d+|\\d+\\.|\\.\\d+|\\d+\\.\\d+)[Bb][-+]?\\d+\\b',
- relevance: 10
- },
- {
- // float number w/out exponent
- // Doesn't seem to recognize floats which start with '.'
- begin: '\\b(\\.\\d+|\\d+\\.\\d+)\\b',
- },
- {
- // integer in base up to 36
- // Doesn't seem to recognize integers which end with '.'
- begin: '\\b(\\d+|0[0-9A-Za-z]+)\\.?\\b',
- }
- ]
- }
- ],
- illegal: /@/
- }
-};
-},{}],213:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- keywords:
- 'int float string vector matrix if else switch case default while do for in break ' +
- 'continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic ' +
- 'addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey ' +
- 'affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve ' +
- 'alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor ' +
- 'animDisplay animView annotate appendStringArray applicationName applyAttrPreset ' +
- 'applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx ' +
- 'artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu ' +
- 'artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand ' +
- 'assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface ' +
- 'attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu ' +
- 'attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp ' +
- 'attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery ' +
- 'autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults ' +
- 'bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership ' +
- 'bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType ' +
- 'boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu ' +
- 'buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge ' +
- 'cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch ' +
- 'catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox ' +
- 'character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp ' +
- 'checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip ' +
- 'clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore ' +
- 'closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter ' +
- 'cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color ' +
- 'colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp ' +
- 'colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem ' +
- 'componentEditor compositingInterop computePolysetVolume condition cone confirmDialog ' +
- 'connectAttr connectControl connectDynamic connectJoint connectionInfo constrain ' +
- 'constrainValue constructionHistory container containsMultibyte contextInfo control ' +
- 'convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation ' +
- 'convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache ' +
- 'cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel ' +
- 'cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver ' +
- 'cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor ' +
- 'createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer ' +
- 'createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse ' +
- 'currentCtx currentTime currentTimeCtx currentUnit curve curveAddPtCtx ' +
- 'curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface ' +
- 'curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox ' +
- 'defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete ' +
- 'deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes ' +
- 'delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo ' +
- 'dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable ' +
- 'disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected ' +
- 'displayColor displayCull displayLevelOfDetail displayPref displayRGBColor ' +
- 'displaySmoothness displayStats displayString displaySurface distanceDimContext ' +
- 'distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct ' +
- 'doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator ' +
- 'duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression ' +
- 'dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor ' +
- 'dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers ' +
- 'editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor ' +
- 'editorTemplate effector emit emitter enableDevice encodeString endString endsWith env ' +
- 'equivalent equivalentTol erf error eval evalDeferred evalEcho event ' +
- 'exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp ' +
- 'expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof ' +
- 'fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo ' +
- 'filetest filletCurve filter filterCurve filterExpand filterStudioImport ' +
- 'findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster ' +
- 'finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar ' +
- 'floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo ' +
- 'fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint ' +
- 'frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss ' +
- 'geometryConstraint getApplicationVersionAsFloat getAttr getClassification ' +
- 'getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes ' +
- 'getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender ' +
- 'glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl ' +
- 'gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid ' +
- 'gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap ' +
- 'HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor ' +
- 'HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached ' +
- 'HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel ' +
- 'headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey ' +
- 'hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender ' +
- 'hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox ' +
- 'iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ' +
- 'ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ' +
- 'ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform ' +
- 'insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance ' +
- 'instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp ' +
- 'interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf ' +
- 'isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect ' +
- 'itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx ' +
- 'jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner ' +
- 'keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx ' +
- 'keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx ' +
- 'keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx ' +
- 'keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor ' +
- 'layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList ' +
- 'lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep ' +
- 'listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory ' +
- 'listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation ' +
- 'listNodeTypes listPanelCategories listRelatives listSets listTransforms ' +
- 'listUnselected listerEditor loadFluid loadNewShelf loadPlugin ' +
- 'loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log ' +
- 'longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive ' +
- 'makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext ' +
- 'manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx ' +
- 'manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout ' +
- 'menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp ' +
- 'mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move ' +
- 'moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute ' +
- 'nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast ' +
- 'nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint ' +
- 'normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect ' +
- 'nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref ' +
- 'nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType ' +
- 'objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface ' +
- 'offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit ' +
- 'orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier ' +
- 'paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration ' +
- 'panelHistory paramDimContext paramDimension paramLocator parent parentConstraint ' +
- 'particle particleExists particleInstancer particleRenderInfo partition pasteKey ' +
- 'pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture ' +
- 'pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo ' +
- 'pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult ' +
- 'pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend ' +
- 'polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal ' +
- 'polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge ' +
- 'polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge ' +
- 'polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet ' +
- 'polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet ' +
- 'polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection ' +
- 'polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge ' +
- 'polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet ' +
- 'polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix ' +
- 'polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut ' +
- 'polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet ' +
- 'polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge ' +
- 'polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex ' +
- 'polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection ' +
- 'polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection ' +
- 'polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint ' +
- 'polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate ' +
- 'polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge ' +
- 'polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing ' +
- 'polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet ' +
- 'polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace ' +
- 'popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer ' +
- 'projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx ' +
- 'propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd ' +
- 'python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection ' +
- 'radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl ' +
- 'readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference ' +
- 'referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE ' +
- 'registerPluginResource rehash reloadImage removeJoint removeMultiInstance ' +
- 'removePanelCategory rename renameAttr renameSelectionList renameUI render ' +
- 'renderGlobalsNode renderInfo renderLayerButton renderLayerParent ' +
- 'renderLayerPostProcess renderLayerUnparent renderManip renderPartition ' +
- 'renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor ' +
- 'renderWindowSelectContext renderer reorder reorderDeformers requires reroot ' +
- 'resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget ' +
- 'reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx ' +
- 'rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout ' +
- 'runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage ' +
- 'saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale ' +
- 'scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor ' +
- 'sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable ' +
- 'scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt ' +
- 'searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey ' +
- 'selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType ' +
- 'selectedNodes selectionConnection separator setAttr setAttrEnumResource ' +
- 'setAttrMapping setAttrNiceNameResource setConstraintRestPosition ' +
- 'setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr ' +
- 'setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe ' +
- 'setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag ' +
- 'setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject ' +
- 'setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets ' +
- 'shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare ' +
- 'shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField ' +
- 'shortNameOf showHelp showHidden showManipCtx showSelectionInTitle ' +
- 'showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface ' +
- 'size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep ' +
- 'snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound ' +
- 'soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort ' +
- 'spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString ' +
- 'startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp ' +
- 'stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex ' +
- 'stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex ' +
- 'stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString ' +
- 'stringToStringArray strip stripPrefixFromName stroke subdAutoProjection ' +
- 'subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV ' +
- 'subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror ' +
- 'subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease ' +
- 'subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring ' +
- 'surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton ' +
- 'symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext ' +
- 'texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext ' +
- 'texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text ' +
- 'textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList ' +
- 'textToShelf textureDisplacePlane textureHairColor texturePlacementContext ' +
- 'textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath ' +
- 'toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower ' +
- 'toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper ' +
- 'trace track trackCtx transferAttributes transformCompare transformLimits translator ' +
- 'trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence ' +
- 'twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit ' +
- 'unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink ' +
- 'uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane ' +
- 'viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex ' +
- 'waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire ' +
- 'wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform',
- illegal: '</',
- contains: [
- hljs.C_NUMBER_MODE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- {
- className: 'string',
- begin: '`', end: '`',
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- { // eats variables
- begin: '[\\$\\%\\@](\\^\\w\\b|#\\w+|[^\\s\\w{]|{\\w+}|\\w+)'
- },
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- };
-};
-},{}],214:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS = {
- keyword:
- 'module use_module import_module include_module end_module initialise ' +
- 'mutable initialize finalize finalise interface implementation pred ' +
- 'mode func type inst solver any_pred any_func is semidet det nondet ' +
- 'multi erroneous failure cc_nondet cc_multi typeclass instance where ' +
- 'pragma promise external trace atomic or_else require_complete_switch ' +
- 'require_det require_semidet require_multi require_nondet ' +
- 'require_cc_multi require_cc_nondet require_erroneous require_failure',
- meta:
- // pragma
- 'inline no_inline type_spec source_file fact_table obsolete memo ' +
- 'loop_check minimal_model terminates does_not_terminate ' +
- 'check_termination promise_equivalent_clauses ' +
- // preprocessor
- 'foreign_proc foreign_decl foreign_code foreign_type ' +
- 'foreign_import_module foreign_export_enum foreign_export ' +
- 'foreign_enum may_call_mercury will_not_call_mercury thread_safe ' +
- 'not_thread_safe maybe_thread_safe promise_pure promise_semipure ' +
- 'tabled_for_io local untrailed trailed attach_to_io_state ' +
- 'can_pass_as_mercury_type stable will_not_throw_exception ' +
- 'may_modify_trail will_not_modify_trail may_duplicate ' +
- 'may_not_duplicate affects_liveness does_not_affect_liveness ' +
- 'doesnt_affect_liveness no_sharing unknown_sharing sharing',
- built_in:
- 'some all not if then else true fail false try catch catch_any ' +
- 'semidet_true semidet_false semidet_fail impure_true impure semipure'
- };
-
- var COMMENT = hljs.COMMENT('%', '$');
-
- var NUMCODE = {
- className: 'number',
- begin: "0'.\\|0[box][0-9a-fA-F]*"
- };
-
- var ATOM = hljs.inherit(hljs.APOS_STRING_MODE, {relevance: 0});
- var STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {relevance: 0});
- var STRING_FMT = {
- className: 'subst',
- begin: '\\\\[abfnrtv]\\|\\\\x[0-9a-fA-F]*\\\\\\|%[-+# *.0-9]*[dioxXucsfeEgGp]',
- relevance: 0
- };
- STRING.contains.push(STRING_FMT);
-
- var IMPLICATION = {
- className: 'built_in',
- variants: [
- {begin: '<=>'},
- {begin: '<=', relevance: 0},
- {begin: '=>', relevance: 0},
- {begin: '/\\\\'},
- {begin: '\\\\/'}
- ]
- };
-
- var HEAD_BODY_CONJUNCTION = {
- className: 'built_in',
- variants: [
- {begin: ':-\\|-->'},
- {begin: '=', relevance: 0}
- ]
- };
-
- return {
- aliases: ['m', 'moo'],
- keywords: KEYWORDS,
- contains: [
- IMPLICATION,
- HEAD_BODY_CONJUNCTION,
- COMMENT,
- hljs.C_BLOCK_COMMENT_MODE,
- NUMCODE,
- hljs.NUMBER_MODE,
- ATOM,
- STRING,
- {begin: /:-/} // relevance booster
- ]
- };
-};
-},{}],215:[function(require,module,exports){
-module.exports = function(hljs) {
- //local labels: %?[FB]?[AT]?\d{1,2}\w+
- return {
- case_insensitive: true,
- aliases: ['mips'],
- lexemes: '\\.?' + hljs.IDENT_RE,
- keywords: {
- meta:
- //GNU preprocs
- '.2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .ltorg ',
- built_in:
- '$0 $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 ' + // integer registers
- '$16 $17 $18 $19 $20 $21 $22 $23 $24 $25 $26 $27 $28 $29 $30 $31 ' + // integer registers
- 'zero at v0 v1 a0 a1 a2 a3 a4 a5 a6 a7 ' + // integer register aliases
- 't0 t1 t2 t3 t4 t5 t6 t7 t8 t9 s0 s1 s2 s3 s4 s5 s6 s7 s8 ' + // integer register aliases
- 'k0 k1 gp sp fp ra ' + // integer register aliases
- '$f0 $f1 $f2 $f2 $f4 $f5 $f6 $f7 $f8 $f9 $f10 $f11 $f12 $f13 $f14 $f15 ' + // floating-point registers
- '$f16 $f17 $f18 $f19 $f20 $f21 $f22 $f23 $f24 $f25 $f26 $f27 $f28 $f29 $f30 $f31 ' + // floating-point registers
- 'Context Random EntryLo0 EntryLo1 Context PageMask Wired EntryHi ' + // Coprocessor 0 registers
- 'HWREna BadVAddr Count Compare SR IntCtl SRSCtl SRSMap Cause EPC PRId ' + // Coprocessor 0 registers
- 'EBase Config Config1 Config2 Config3 LLAddr Debug DEPC DESAVE CacheErr ' + // Coprocessor 0 registers
- 'ECC ErrorEPC TagLo DataLo TagHi DataHi WatchLo WatchHi PerfCtl PerfCnt ' // Coprocessor 0 registers
- },
- contains: [
- {
- className: 'keyword',
- begin: '\\b('+ //mnemonics
- // 32-bit integer instructions
- 'addi?u?|andi?|b(al)?|beql?|bgez(al)?l?|bgtzl?|blezl?|bltz(al)?l?|' +
- 'bnel?|cl[oz]|divu?|ext|ins|j(al)?|jalr(\.hb)?|jr(\.hb)?|lbu?|lhu?|' +
- 'll|lui|lw[lr]?|maddu?|mfhi|mflo|movn|movz|move|msubu?|mthi|mtlo|mul|' +
- 'multu?|nop|nor|ori?|rotrv?|sb|sc|se[bh]|sh|sllv?|slti?u?|srav?|' +
- 'srlv?|subu?|sw[lr]?|xori?|wsbh|' +
- // floating-point instructions
- 'abs\.[sd]|add\.[sd]|alnv.ps|bc1[ft]l?|' +
- 'c\.(s?f|un|u?eq|[ou]lt|[ou]le|ngle?|seq|l[et]|ng[et])\.[sd]|' +
- '(ceil|floor|round|trunc)\.[lw]\.[sd]|cfc1|cvt\.d\.[lsw]|' +
- 'cvt\.l\.[dsw]|cvt\.ps\.s|cvt\.s\.[dlw]|cvt\.s\.p[lu]|cvt\.w\.[dls]|' +
- 'div\.[ds]|ldx?c1|luxc1|lwx?c1|madd\.[sd]|mfc1|mov[fntz]?\.[ds]|' +
- 'msub\.[sd]|mth?c1|mul\.[ds]|neg\.[ds]|nmadd\.[ds]|nmsub\.[ds]|' +
- 'p[lu][lu]\.ps|recip\.fmt|r?sqrt\.[ds]|sdx?c1|sub\.[ds]|suxc1|' +
- 'swx?c1|' +
- // system control instructions
- 'break|cache|d?eret|[de]i|ehb|mfc0|mtc0|pause|prefx?|rdhwr|' +
- 'rdpgpr|sdbbp|ssnop|synci?|syscall|teqi?|tgei?u?|tlb(p|r|w[ir])|' +
- 'tlti?u?|tnei?|wait|wrpgpr'+
- ')',
- end: '\\s'
- },
- hljs.COMMENT('[;#]', '$'),
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- {
- className: 'string',
- begin: '\'',
- end: '[^\\\\]\'',
- relevance: 0
- },
- {
- className: 'title',
- begin: '\\|', end: '\\|',
- illegal: '\\n',
- relevance: 0
- },
- {
- className: 'number',
- variants: [
- {begin: '0x[0-9a-f]+'}, //hex
- {begin: '\\b-?\\d+'} //bare number
- ],
- relevance: 0
- },
- {
- className: 'symbol',
- variants: [
- {begin: '^\\s*[a-z_\\.\\$][a-z0-9_\\.\\$]+:'}, //GNU MIPS syntax
- {begin: '^\\s*[0-9]+:'}, // numbered local labels
- {begin: '[0-9]+[bf]' } // number local label reference (backwards, forwards)
- ],
- relevance: 0
- }
- ],
- illegal: '\/'
- };
-};
-},{}],216:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- keywords:
- 'environ vocabularies notations constructors definitions ' +
- 'registrations theorems schemes requirements begin end definition ' +
- 'registration cluster existence pred func defpred deffunc theorem ' +
- 'proof let take assume then thus hence ex for st holds consider ' +
- 'reconsider such that and in provided of as from be being by means ' +
- 'equals implies iff redefine define now not or attr is mode ' +
- 'suppose per cases set thesis contradiction scheme reserve struct ' +
- 'correctness compatibility coherence symmetry assymetry ' +
- 'reflexivity irreflexivity connectedness uniqueness commutativity ' +
- 'idempotence involutiveness projectivity',
- contains: [
- hljs.COMMENT('::', '$')
- ]
- };
-};
-},{}],217:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- subLanguage: 'xml',
- contains: [
- {
- className: 'meta',
- begin: '^__(END|DATA)__$'
- },
- // mojolicious line
- {
- begin: "^\\s*%{1,2}={0,2}", end: '$',
- subLanguage: 'perl'
- },
- // mojolicious block
- {
- begin: "<%{1,2}={0,2}",
- end: "={0,1}%>",
- subLanguage: 'perl',
- excludeBegin: true,
- excludeEnd: true
- }
- ]
- };
-};
-},{}],218:[function(require,module,exports){
-module.exports = function(hljs) {
- var NUMBER = {
- className: 'number', relevance: 0,
- variants: [
- {
- begin: '[$][a-fA-F0-9]+'
- },
- hljs.NUMBER_MODE
- ]
- };
-
- return {
- case_insensitive: true,
- keywords: {
- keyword: 'public private property continue exit extern new try catch ' +
- 'eachin not abstract final select case default const local global field ' +
- 'end if then else elseif endif while wend repeat until forever for ' +
- 'to step next return module inline throw import',
-
- built_in: 'DebugLog DebugStop Error Print ACos ACosr ASin ASinr ATan ATan2 ATan2r ATanr Abs Abs Ceil ' +
- 'Clamp Clamp Cos Cosr Exp Floor Log Max Max Min Min Pow Sgn Sgn Sin Sinr Sqrt Tan Tanr Seed PI HALFPI TWOPI',
-
- literal: 'true false null and or shl shr mod'
- },
- illegal: /\/\*/,
- contains: [
- hljs.COMMENT('#rem', '#end'),
- hljs.COMMENT(
- "'",
- '$',
- {
- relevance: 0
- }
- ),
- {
- className: 'function',
- beginKeywords: 'function method', end: '[(=:]|$',
- illegal: /\n/,
- contains: [
- hljs.UNDERSCORE_TITLE_MODE
- ]
- },
- {
- className: 'class',
- beginKeywords: 'class interface', end: '$',
- contains: [
- {
- beginKeywords: 'extends implements'
- },
- hljs.UNDERSCORE_TITLE_MODE
- ]
- },
- {
- className: 'built_in',
- begin: '\\b(self|super)\\b'
- },
- {
- className: 'meta',
- begin: '\\s*#', end: '$',
- keywords: {'meta-keyword': 'if else elseif endif end then'}
- },
- {
- className: 'meta',
- begin: '^\\s*strict\\b'
- },
- {
- beginKeywords: 'alias', end: '=',
- contains: [hljs.UNDERSCORE_TITLE_MODE]
- },
- hljs.QUOTE_STRING_MODE,
- NUMBER
- ]
- }
-};
-},{}],219:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS = {
- keyword:
- // Moonscript keywords
- 'if then not for in while do return else elseif break continue switch and or ' +
- 'unless when class extends super local import export from using',
- literal:
- 'true false nil',
- built_in:
- '_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load ' +
- 'loadfile loadstring module next pairs pcall print rawequal rawget rawset require ' +
- 'select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug ' +
- 'io math os package string table'
- };
- var JS_IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
- var SUBST = {
- className: 'subst',
- begin: /#\{/, end: /}/,
- keywords: KEYWORDS
- };
- var EXPRESSIONS = [
- hljs.inherit(hljs.C_NUMBER_MODE,
- {starts: {end: '(\\s*/)?', relevance: 0}}), // a number tries to eat the following slash to prevent treating it as a regexp
- {
- className: 'string',
- variants: [
- {
- begin: /'/, end: /'/,
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- begin: /"/, end: /"/,
- contains: [hljs.BACKSLASH_ESCAPE, SUBST]
- }
- ]
- },
- {
- className: 'built_in',
- begin: '@__' + hljs.IDENT_RE
- },
- {
- begin: '@' + hljs.IDENT_RE // relevance booster on par with CoffeeScript
- },
- {
- begin: hljs.IDENT_RE + '\\\\' + hljs.IDENT_RE // inst\method
- }
- ];
- SUBST.contains = EXPRESSIONS;
-
- var TITLE = hljs.inherit(hljs.TITLE_MODE, {begin: JS_IDENT_RE});
- var PARAMS_RE = '(\\(.*\\))?\\s*\\B[-=]>';
- var PARAMS = {
- className: 'params',
- begin: '\\([^\\(]', returnBegin: true,
- /* We need another contained nameless mode to not have every nested
- pair of parens to be called "params" */
- contains: [{
- begin: /\(/, end: /\)/,
- keywords: KEYWORDS,
- contains: ['self'].concat(EXPRESSIONS)
- }]
- };
-
- return {
- aliases: ['moon'],
- keywords: KEYWORDS,
- illegal: /\/\*/,
- contains: EXPRESSIONS.concat([
- hljs.COMMENT('--', '$'),
- {
- className: 'function', // function: -> =>
- begin: '^\\s*' + JS_IDENT_RE + '\\s*=\\s*' + PARAMS_RE, end: '[-=]>',
- returnBegin: true,
- contains: [TITLE, PARAMS]
- },
- {
- begin: /[\(,:=]\s*/, // anonymous function start
- relevance: 0,
- contains: [
- {
- className: 'function',
- begin: PARAMS_RE, end: '[-=]>',
- returnBegin: true,
- contains: [PARAMS]
- }
- ]
- },
- {
- className: 'class',
- beginKeywords: 'class',
- end: '$',
- illegal: /[:="\[\]]/,
- contains: [
- {
- beginKeywords: 'extends',
- endsWithParent: true,
- illegal: /[:="\[\]]/,
- contains: [TITLE]
- },
- TITLE
- ]
- },
- {
- className: 'name', // table
- begin: JS_IDENT_RE + ':', end: ':',
- returnBegin: true, returnEnd: true,
- relevance: 0
- }
- ])
- };
-};
-},{}],220:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- case_insensitive: true,
- contains: [
- {
- beginKeywords:
- 'build create index delete drop explain infer|10 insert merge prepare select update upsert|10',
- end: /;/, endsWithParent: true,
- keywords: {
- // Taken from http://developer.couchbase.com/documentation/server/current/n1ql/n1ql-language-reference/reservedwords.html
- keyword:
- 'all alter analyze and any array as asc begin between binary boolean break bucket build by call ' +
- 'case cast cluster collate collection commit connect continue correlate cover create database ' +
- 'dataset datastore declare decrement delete derived desc describe distinct do drop each element ' +
- 'else end every except exclude execute exists explain fetch first flatten for force from ' +
- 'function grant group gsi having if ignore ilike in include increment index infer inline inner ' +
- 'insert intersect into is join key keys keyspace known last left let letting like limit lsm map ' +
- 'mapping matched materialized merge minus namespace nest not number object offset on ' +
- 'option or order outer over parse partition password path pool prepare primary private privilege ' +
- 'procedure public raw realm reduce rename return returning revoke right role rollback satisfies ' +
- 'schema select self semi set show some start statistics string system then to transaction trigger ' +
- 'truncate under union unique unknown unnest unset update upsert use user using validate value ' +
- 'valued values via view when where while with within work xor',
- // Taken from http://developer.couchbase.com/documentation/server/4.5/n1ql/n1ql-language-reference/literals.html
- literal:
- 'true false null missing|5',
- // Taken from http://developer.couchbase.com/documentation/server/4.5/n1ql/n1ql-language-reference/functions.html
- built_in:
- 'array_agg array_append array_concat array_contains array_count array_distinct array_ifnull array_length ' +
- 'array_max array_min array_position array_prepend array_put array_range array_remove array_repeat array_replace ' +
- 'array_reverse array_sort array_sum avg count max min sum greatest least ifmissing ifmissingornull ifnull ' +
- 'missingif nullif ifinf ifnan ifnanorinf naninf neginfif posinfif clock_millis clock_str date_add_millis ' +
- 'date_add_str date_diff_millis date_diff_str date_part_millis date_part_str date_trunc_millis date_trunc_str ' +
- 'duration_to_str millis str_to_millis millis_to_str millis_to_utc millis_to_zone_name now_millis now_str ' +
- 'str_to_duration str_to_utc str_to_zone_name decode_json encode_json encoded_size poly_length base64 base64_encode ' +
- 'base64_decode meta uuid abs acos asin atan atan2 ceil cos degrees e exp ln log floor pi power radians random ' +
- 'round sign sin sqrt tan trunc object_length object_names object_pairs object_inner_pairs object_values ' +
- 'object_inner_values object_add object_put object_remove object_unwrap regexp_contains regexp_like regexp_position ' +
- 'regexp_replace contains initcap length lower ltrim position repeat replace rtrim split substr title trim upper ' +
- 'isarray isatom isboolean isnumber isobject isstring type toarray toatom toboolean tonumber toobject tostring'
- },
- contains: [
- {
- className: 'string',
- begin: '\'', end: '\'',
- contains: [hljs.BACKSLASH_ESCAPE],
- relevance: 0
- },
- {
- className: 'string',
- begin: '"', end: '"',
- contains: [hljs.BACKSLASH_ESCAPE],
- relevance: 0
- },
- {
- className: 'symbol',
- begin: '`', end: '`',
- contains: [hljs.BACKSLASH_ESCAPE],
- relevance: 2
- },
- hljs.C_NUMBER_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- },
- hljs.C_BLOCK_COMMENT_MODE
- ]
- };
-};
-},{}],221:[function(require,module,exports){
-module.exports = function(hljs) {
- var VAR = {
- className: 'variable',
- variants: [
- {begin: /\$\d+/},
- {begin: /\$\{/, end: /}/},
- {begin: '[\\$\\@]' + hljs.UNDERSCORE_IDENT_RE}
- ]
- };
- var DEFAULT = {
- endsWithParent: true,
- lexemes: '[a-z/_]+',
- keywords: {
- literal:
- 'on off yes no true false none blocked debug info notice warn error crit ' +
- 'select break last permanent redirect kqueue rtsig epoll poll /dev/poll'
- },
- relevance: 0,
- illegal: '=>',
- contains: [
- hljs.HASH_COMMENT_MODE,
- {
- className: 'string',
- contains: [hljs.BACKSLASH_ESCAPE, VAR],
- variants: [
- {begin: /"/, end: /"/},
- {begin: /'/, end: /'/}
- ]
- },
- // this swallows entire URLs to avoid detecting numbers within
- {
- begin: '([a-z]+):/', end: '\\s', endsWithParent: true, excludeEnd: true,
- contains: [VAR]
- },
- {
- className: 'regexp',
- contains: [hljs.BACKSLASH_ESCAPE, VAR],
- variants: [
- {begin: "\\s\\^", end: "\\s|{|;", returnEnd: true},
- // regexp locations (~, ~*)
- {begin: "~\\*?\\s+", end: "\\s|{|;", returnEnd: true},
- // *.example.com
- {begin: "\\*(\\.[a-z\\-]+)+"},
- // sub.example.*
- {begin: "([a-z\\-]+\\.)+\\*"}
- ]
- },
- // IP
- {
- className: 'number',
- begin: '\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b'
- },
- // units
- {
- className: 'number',
- begin: '\\b\\d+[kKmMgGdshdwy]*\\b',
- relevance: 0
- },
- VAR
- ]
- };
-
- return {
- aliases: ['nginxconf'],
- contains: [
- hljs.HASH_COMMENT_MODE,
- {
- begin: hljs.UNDERSCORE_IDENT_RE + '\\s+{', returnBegin: true,
- end: '{',
- contains: [
- {
- className: 'section',
- begin: hljs.UNDERSCORE_IDENT_RE
- }
- ],
- relevance: 0
- },
- {
- begin: hljs.UNDERSCORE_IDENT_RE + '\\s', end: ';|{', returnBegin: true,
- contains: [
- {
- className: 'attribute',
- begin: hljs.UNDERSCORE_IDENT_RE,
- starts: DEFAULT
- }
- ],
- relevance: 0
- }
- ],
- illegal: '[^\\s\\}]'
- };
-};
-},{}],222:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['nim'],
- keywords: {
- keyword:
- 'addr and as asm bind block break case cast const continue converter ' +
- 'discard distinct div do elif else end enum except export finally ' +
- 'for from generic if import in include interface is isnot iterator ' +
- 'let macro method mixin mod nil not notin object of or out proc ptr ' +
- 'raise ref return shl shr static template try tuple type using var ' +
- 'when while with without xor yield',
- literal:
- 'shared guarded stdin stdout stderr result true false',
- built_in:
- 'int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float ' +
- 'float32 float64 bool char string cstring pointer expr stmt void ' +
- 'auto any range array openarray varargs seq set clong culong cchar ' +
- 'cschar cshort cint csize clonglong cfloat cdouble clongdouble ' +
- 'cuchar cushort cuint culonglong cstringarray semistatic'
- },
- contains: [ {
- className: 'meta', // Actually pragma
- begin: /{\./,
- end: /\.}/,
- relevance: 10
- }, {
- className: 'string',
- begin: /[a-zA-Z]\w*"/,
- end: /"/,
- contains: [{begin: /""/}]
- }, {
- className: 'string',
- begin: /([a-zA-Z]\w*)?"""/,
- end: /"""/
- },
- hljs.QUOTE_STRING_MODE,
- {
- className: 'type',
- begin: /\b[A-Z]\w+\b/,
- relevance: 0
- }, {
- className: 'number',
- relevance: 0,
- variants: [
- {begin: /\b(0[xX][0-9a-fA-F][_0-9a-fA-F]*)('?[iIuU](8|16|32|64))?/},
- {begin: /\b(0o[0-7][_0-7]*)('?[iIuUfF](8|16|32|64))?/},
- {begin: /\b(0(b|B)[01][_01]*)('?[iIuUfF](8|16|32|64))?/},
- {begin: /\b(\d[_\d]*)('?[iIuUfF](8|16|32|64))?/}
- ]
- },
- hljs.HASH_COMMENT_MODE
- ]
- }
-};
-},{}],223:[function(require,module,exports){
-module.exports = function(hljs) {
- var NIX_KEYWORDS = {
- keyword:
- 'rec with let in inherit assert if else then',
- literal:
- 'true false or and null',
- built_in:
- 'import abort baseNameOf dirOf isNull builtins map removeAttrs throw ' +
- 'toString derivation'
- };
- var ANTIQUOTE = {
- className: 'subst',
- begin: /\$\{/,
- end: /}/,
- keywords: NIX_KEYWORDS
- };
- var ATTRS = {
- begin: /[a-zA-Z0-9-_]+(\s*=)/, returnBegin: true,
- relevance: 0,
- contains: [
- {
- className: 'attr',
- begin: /\S+/
- }
- ]
- };
- var STRING = {
- className: 'string',
- contains: [ANTIQUOTE],
- variants: [
- {begin: "''", end: "''"},
- {begin: '"', end: '"'}
- ]
- };
- var EXPRESSIONS = [
- hljs.NUMBER_MODE,
- hljs.HASH_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- STRING,
- ATTRS
- ];
- ANTIQUOTE.contains = EXPRESSIONS;
- return {
- aliases: ["nixos"],
- keywords: NIX_KEYWORDS,
- contains: EXPRESSIONS
- };
-};
-},{}],224:[function(require,module,exports){
-module.exports = function(hljs) {
- var CONSTANTS = {
- className: 'variable',
- begin: /\$(ADMINTOOLS|APPDATA|CDBURN_AREA|CMDLINE|COMMONFILES32|COMMONFILES64|COMMONFILES|COOKIES|DESKTOP|DOCUMENTS|EXEDIR|EXEFILE|EXEPATH|FAVORITES|FONTS|HISTORY|HWNDPARENT|INSTDIR|INTERNET_CACHE|LANGUAGE|LOCALAPPDATA|MUSIC|NETHOOD|OUTDIR|PICTURES|PLUGINSDIR|PRINTHOOD|PROFILE|PROGRAMFILES32|PROGRAMFILES64|PROGRAMFILES|QUICKLAUNCH|RECENT|RESOURCES_LOCALIZED|RESOURCES|SENDTO|SMPROGRAMS|SMSTARTUP|STARTMENU|SYSDIR|TEMP|TEMPLATES|VIDEOS|WINDIR)/
- };
-
- var DEFINES = {
- // ${defines}
- className: 'variable',
- begin: /\$+{[\w\.:-]+}/
- };
-
- var VARIABLES = {
- // $variables
- className: 'variable',
- begin: /\$+\w+/,
- illegal: /\(\){}/
- };
-
- var LANGUAGES = {
- // $(language_strings)
- className: 'variable',
- begin: /\$+\([\w\^\.:-]+\)/
- };
-
- var PARAMETERS = {
- // command parameters
- className: 'params',
- begin: '(ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY)'
- };
-
- var COMPILER = {
- // !compiler_flags
- className: 'keyword',
- begin: /\!(addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversionsystem|ifdef|ifmacrodef|ifmacrondef|ifndef|if|include|insertmacro|macroend|macro|makensis|packhdr|searchparse|searchreplace|tempfile|undef|verbose|warning)/
- };
-
- var METACHARS = {
- // $\n, $\r, $\t, $$
- className: 'subst',
- begin: /\$(\\[nrt]|\$)/
- };
-
- var PLUGINS = {
- // plug::ins
- className: 'class',
- begin: /\w+\:\:\w+/
- };
-
- var STRING = {
- className: 'string',
- variants: [
- {
- begin: '"', end: '"'
- },
- {
- begin: '\'', end: '\''
- },
- {
- begin: '`', end: '`'
- }
- ],
- illegal: /\n/,
- contains: [
- METACHARS,
- CONSTANTS,
- DEFINES,
- VARIABLES,
- LANGUAGES
- ]
- };
-
- return {
- case_insensitive: false,
- keywords: {
- keyword:
- 'Abort AddBrandingImage AddSize AllowRootDirInstall AllowSkipFiles AutoCloseWindow BGFont BGGradient BrandingText BringToFront Call CallInstDLL Caption ChangeUI CheckBitmap ClearErrors CompletedText ComponentText CopyFiles CRCCheck CreateDirectory CreateFont CreateShortCut Delete DeleteINISec DeleteINIStr DeleteRegKey DeleteRegValue DetailPrint DetailsButtonText DirText DirVar DirVerify EnableWindow EnumRegKey EnumRegValue Exch Exec ExecShell ExecWait ExpandEnvStrings File FileBufSize FileClose FileErrorText FileOpen FileRead FileReadByte FileReadUTF16LE FileReadWord FileSeek FileWrite FileWriteByte FileWriteUTF16LE FileWriteWord FindClose FindFirst FindNext FindWindow FlushINI FunctionEnd GetCurInstType GetCurrentAddress GetDlgItem GetDLLVersion GetDLLVersionLocal GetErrorLevel GetFileTime GetFileTimeLocal GetFullPathName GetFunctionAddress GetInstDirError GetLabelAddress GetTempFileName Goto HideWindow Icon IfAbort IfErrors IfFileExists IfRebootFlag IfSilent InitPluginsDir InstallButtonText InstallColors InstallDir InstallDirRegKey InstProgressFlags InstType InstTypeGetText InstTypeSetText IntCmp IntCmpU IntFmt IntOp IsWindow LangString LicenseBkColor LicenseData LicenseForceSelection LicenseLangString LicenseText LoadLanguageFile LockWindow LogSet LogText ManifestDPIAware ManifestSupportedOS MessageBox MiscButtonText Name Nop OutFile Page PageCallbacks PageExEnd Pop Push Quit ReadEnvStr ReadINIStr ReadRegDWORD ReadRegStr Reboot RegDLL Rename RequestExecutionLevel ReserveFile Return RMDir SearchPath SectionEnd SectionGetFlags SectionGetInstTypes SectionGetSize SectionGetText SectionGroupEnd SectionIn SectionSetFlags SectionSetInstTypes SectionSetSize SectionSetText SendMessage SetAutoClose SetBrandingImage SetCompress SetCompressor SetCompressorDictSize SetCtlColors SetCurInstType SetDatablockOptimize SetDateSave SetDetailsPrint SetDetailsView SetErrorLevel SetErrors SetFileAttributes SetFont SetOutPath SetOverwrite SetRebootFlag SetRegView SetShellVarContext SetSilent ShowInstDetails ShowUninstDetails ShowWindow SilentInstall SilentUnInstall Sleep SpaceTexts StrCmp StrCmpS StrCpy StrLen SubCaption Unicode UninstallButtonText UninstallCaption UninstallIcon UninstallSubCaption UninstallText UninstPage UnRegDLL Var VIAddVersionKey VIFileVersion VIProductVersion WindowIcon WriteINIStr WriteRegBin WriteRegDWORD WriteRegExpandStr WriteRegStr WriteUninstaller XPStyle',
- literal:
- 'admin all auto both bottom bzip2 colored components current custom directory false force hide highest ifdiff ifnewer instfiles lastused leave left license listonly lzma nevershow none normal notset off on open print right show silent silentlog smooth textonly top true try un.components un.custom un.directory un.instfiles un.license uninstConfirm user Win10 Win7 Win8 WinVista zlib'
- },
- contains: [
- hljs.HASH_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.COMMENT(
- ';',
- '$',
- {
- relevance: 0
- }
- ),
- {
- className: 'function',
- beginKeywords: 'Function PageEx Section SectionGroup', end: '$'
- },
- STRING,
- COMPILER,
- DEFINES,
- VARIABLES,
- LANGUAGES,
- PARAMETERS,
- PLUGINS,
- hljs.NUMBER_MODE
- ]
- };
-};
-},{}],225:[function(require,module,exports){
-module.exports = function(hljs) {
- var API_CLASS = {
- className: 'built_in',
- begin: '\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+',
- };
- var OBJC_KEYWORDS = {
- keyword:
- 'int float while char export sizeof typedef const struct for union ' +
- 'unsigned long volatile static bool mutable if do return goto void ' +
- 'enum else break extern asm case short default double register explicit ' +
- 'signed typename this switch continue wchar_t inline readonly assign ' +
- 'readwrite self @synchronized id typeof ' +
- 'nonatomic super unichar IBOutlet IBAction strong weak copy ' +
- 'in out inout bycopy byref oneway __strong __weak __block __autoreleasing ' +
- '@private @protected @public @try @property @end @throw @catch @finally ' +
- '@autoreleasepool @synthesize @dynamic @selector @optional @required ' +
- '@encode @package @import @defs @compatibility_alias ' +
- '__bridge __bridge_transfer __bridge_retained __bridge_retain ' +
- '__covariant __contravariant __kindof ' +
- '_Nonnull _Nullable _Null_unspecified ' +
- '__FUNCTION__ __PRETTY_FUNCTION__ __attribute__ ' +
- 'getter setter retain unsafe_unretained ' +
- 'nonnull nullable null_unspecified null_resettable class instancetype ' +
- 'NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER ' +
- 'NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED ' +
- 'NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE ' +
- 'NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END ' +
- 'NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW ' +
- 'NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN',
- literal:
- 'false true FALSE TRUE nil YES NO NULL',
- built_in:
- 'BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once'
- };
- var LEXEMES = /[a-zA-Z@][a-zA-Z0-9_]*/;
- var CLASS_KEYWORDS = '@interface @class @protocol @implementation';
- return {
- aliases: ['mm', 'objc', 'obj-c'],
- keywords: OBJC_KEYWORDS,
- lexemes: LEXEMES,
- illegal: '</',
- contains: [
- API_CLASS,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.C_NUMBER_MODE,
- hljs.QUOTE_STRING_MODE,
- {
- className: 'string',
- variants: [
- {
- begin: '@"', end: '"',
- illegal: '\\n',
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- begin: '\'', end: '[^\\\\]\'',
- illegal: '[^\\\\][^\']'
- }
- ]
- },
- {
- className: 'meta',
- begin: '#',
- end: '$',
- contains: [
- {
- className: 'meta-string',
- variants: [
- { begin: '\"', end: '\"' },
- { begin: '<', end: '>' }
- ]
- }
- ]
- },
- {
- className: 'class',
- begin: '(' + CLASS_KEYWORDS.split(' ').join('|') + ')\\b', end: '({|$)', excludeEnd: true,
- keywords: CLASS_KEYWORDS, lexemes: LEXEMES,
- contains: [
- hljs.UNDERSCORE_TITLE_MODE
- ]
- },
- {
- begin: '\\.'+hljs.UNDERSCORE_IDENT_RE,
- relevance: 0
- }
- ]
- };
-};
-},{}],226:[function(require,module,exports){
-module.exports = function(hljs) {
- /* missing support for heredoc-like string (OCaml 4.0.2+) */
- return {
- aliases: ['ml'],
- keywords: {
- keyword:
- 'and as assert asr begin class constraint do done downto else end ' +
- 'exception external for fun function functor if in include ' +
- 'inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method ' +
- 'mod module mutable new object of open! open or private rec sig struct ' +
- 'then to try type val! val virtual when while with ' +
- /* camlp4 */
- 'parser value',
- built_in:
- /* built-in types */
- 'array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit ' +
- /* (some) types in Pervasives */
- 'in_channel out_channel ref',
- literal:
- 'true false'
- },
- illegal: /\/\/|>>/,
- lexemes: '[a-z_]\\w*!?',
- contains: [
- {
- className: 'literal',
- begin: '\\[(\\|\\|)?\\]|\\(\\)',
- relevance: 0
- },
- hljs.COMMENT(
- '\\(\\*',
- '\\*\\)',
- {
- contains: ['self']
- }
- ),
- { /* type variable */
- className: 'symbol',
- begin: '\'[A-Za-z_](?!\')[\\w\']*'
- /* the grammar is ambiguous on how 'a'b should be interpreted but not the compiler */
- },
- { /* polymorphic variant */
- className: 'type',
- begin: '`[A-Z][\\w\']*'
- },
- { /* module or constructor */
- className: 'type',
- begin: '\\b[A-Z][\\w\']*',
- relevance: 0
- },
- { /* don't color identifiers, but safely catch all identifiers with '*/
- begin: '[a-z_]\\w*\'[\\w\']*', relevance: 0
- },
- hljs.inherit(hljs.APOS_STRING_MODE, {className: 'string', relevance: 0}),
- hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}),
- {
- className: 'number',
- begin:
- '\\b(0[xX][a-fA-F0-9_]+[Lln]?|' +
- '0[oO][0-7_]+[Lln]?|' +
- '0[bB][01_]+[Lln]?|' +
- '[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)',
- relevance: 0
- },
- {
- begin: /[-=]>/ // relevance booster
- }
- ]
- }
-};
-},{}],227:[function(require,module,exports){
-module.exports = function(hljs) {
- var SPECIAL_VARS = {
- className: 'keyword',
- begin: '\\$(f[asn]|t|vp[rtd]|children)'
- },
- LITERALS = {
- className: 'literal',
- begin: 'false|true|PI|undef'
- },
- NUMBERS = {
- className: 'number',
- begin: '\\b\\d+(\\.\\d+)?(e-?\\d+)?', //adds 1e5, 1e-10
- relevance: 0
- },
- STRING = hljs.inherit(hljs.QUOTE_STRING_MODE,{illegal: null}),
- PREPRO = {
- className: 'meta',
- keywords: {'meta-keyword': 'include use'},
- begin: 'include|use <',
- end: '>'
- },
- PARAMS = {
- className: 'params',
- begin: '\\(', end: '\\)',
- contains: ['self', NUMBERS, STRING, SPECIAL_VARS, LITERALS]
- },
- MODIFIERS = {
- begin: '[*!#%]',
- relevance: 0
- },
- FUNCTIONS = {
- className: 'function',
- beginKeywords: 'module function',
- end: '\\=|\\{',
- contains: [PARAMS, hljs.UNDERSCORE_TITLE_MODE]
- };
-
- return {
- aliases: ['scad'],
- keywords: {
- keyword: 'function module include use for intersection_for if else \\%',
- literal: 'false true PI undef',
- built_in: 'circle square polygon text sphere cube cylinder polyhedron translate rotate scale resize mirror multmatrix color offset hull minkowski union difference intersection abs sign sin cos tan acos asin atan atan2 floor round ceil ln log pow sqrt exp rands min max concat lookup str chr search version version_num norm cross parent_module echo import import_dxf dxf_linear_extrude linear_extrude rotate_extrude surface projection render children dxf_cross dxf_dim let assign'
- },
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- NUMBERS,
- PREPRO,
- STRING,
- SPECIAL_VARS,
- MODIFIERS,
- FUNCTIONS
- ]
- }
-};
-},{}],228:[function(require,module,exports){
-module.exports = function(hljs) {
- var OXYGENE_KEYWORDS = 'abstract add and array as asc aspect assembly async begin break block by case class concat const copy constructor continue '+
- 'create default delegate desc distinct div do downto dynamic each else empty end ensure enum equals event except exit extension external false '+
- 'final finalize finalizer finally flags for forward from function future global group has if implementation implements implies in index inherited '+
- 'inline interface into invariants is iterator join locked locking loop matching method mod module namespace nested new nil not notify nullable of '+
- 'old on operator or order out override parallel params partial pinned private procedure property protected public queryable raise read readonly '+
- 'record reintroduce remove repeat require result reverse sealed select self sequence set shl shr skip static step soft take then to true try tuple '+
- 'type union unit unsafe until uses using var virtual raises volatile where while with write xor yield await mapped deprecated stdcall cdecl pascal '+
- 'register safecall overload library platform reference packed strict published autoreleasepool selector strong weak unretained';
- var CURLY_COMMENT = hljs.COMMENT(
- '{',
- '}',
- {
- relevance: 0
- }
- );
- var PAREN_COMMENT = hljs.COMMENT(
- '\\(\\*',
- '\\*\\)',
- {
- relevance: 10
- }
- );
- var STRING = {
- className: 'string',
- begin: '\'', end: '\'',
- contains: [{begin: '\'\''}]
- };
- var CHAR_STRING = {
- className: 'string', begin: '(#\\d+)+'
- };
- var FUNCTION = {
- className: 'function',
- beginKeywords: 'function constructor destructor procedure method', end: '[:;]',
- keywords: 'function constructor|10 destructor|10 procedure|10 method|10',
- contains: [
- hljs.TITLE_MODE,
- {
- className: 'params',
- begin: '\\(', end: '\\)',
- keywords: OXYGENE_KEYWORDS,
- contains: [STRING, CHAR_STRING]
- },
- CURLY_COMMENT, PAREN_COMMENT
- ]
- };
- return {
- case_insensitive: true,
- lexemes: /\.?\w+/,
- keywords: OXYGENE_KEYWORDS,
- illegal: '("|\\$[G-Zg-z]|\\/\\*|</|=>|->)',
- contains: [
- CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE,
- STRING, CHAR_STRING,
- hljs.NUMBER_MODE,
- FUNCTION,
- {
- className: 'class',
- begin: '=\\bclass\\b', end: 'end;',
- keywords: OXYGENE_KEYWORDS,
- contains: [
- STRING, CHAR_STRING,
- CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE,
- FUNCTION
- ]
- }
- ]
- };
-};
-},{}],229:[function(require,module,exports){
-module.exports = function(hljs) {
- var CURLY_SUBCOMMENT = hljs.COMMENT(
- '{',
- '}',
- {
- contains: ['self']
- }
- );
- return {
- subLanguage: 'xml', relevance: 0,
- contains: [
- hljs.COMMENT('^#', '$'),
- hljs.COMMENT(
- '\\^rem{',
- '}',
- {
- relevance: 10,
- contains: [
- CURLY_SUBCOMMENT
- ]
- }
- ),
- {
- className: 'meta',
- begin: '^@(?:BASE|USE|CLASS|OPTIONS)$',
- relevance: 10
- },
- {
- className: 'title',
- begin: '@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$'
- },
- {
- className: 'variable',
- begin: '\\$\\{?[\\w\\-\\.\\:]+\\}?'
- },
- {
- className: 'keyword',
- begin: '\\^[\\w\\-\\.\\:]+'
- },
- {
- className: 'number',
- begin: '\\^#[0-9a-fA-F]+'
- },
- hljs.C_NUMBER_MODE
- ]
- };
-};
-},{}],230:[function(require,module,exports){
-module.exports = function(hljs) {
- var PERL_KEYWORDS = 'getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ' +
- 'ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime ' +
- 'readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qq' +
- 'fileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent ' +
- 'shutdown dump chomp connect getsockname die socketpair close flock exists index shmget' +
- 'sub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr ' +
- 'unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 ' +
- 'getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline ' +
- 'endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand ' +
- 'mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink ' +
- 'getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr ' +
- 'untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link ' +
- 'getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller ' +
- 'lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and ' +
- 'sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 ' +
- 'chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach ' +
- 'tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedir' +
- 'ioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe ' +
- 'atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when';
- var SUBST = {
- className: 'subst',
- begin: '[$@]\\{', end: '\\}',
- keywords: PERL_KEYWORDS
- };
- var METHOD = {
- begin: '->{', end: '}'
- // contains defined later
- };
- var VAR = {
- variants: [
- {begin: /\$\d/},
- {begin: /[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},
- {begin: /[\$%@][^\s\w{]/, relevance: 0}
- ]
- };
- var STRING_CONTAINS = [hljs.BACKSLASH_ESCAPE, SUBST, VAR];
- var PERL_DEFAULT_CONTAINS = [
- VAR,
- hljs.HASH_COMMENT_MODE,
- hljs.COMMENT(
- '^\\=\\w',
- '\\=cut',
- {
- endsWithParent: true
- }
- ),
- METHOD,
- {
- className: 'string',
- contains: STRING_CONTAINS,
- variants: [
- {
- begin: 'q[qwxr]?\\s*\\(', end: '\\)',
- relevance: 5
- },
- {
- begin: 'q[qwxr]?\\s*\\[', end: '\\]',
- relevance: 5
- },
- {
- begin: 'q[qwxr]?\\s*\\{', end: '\\}',
- relevance: 5
- },
- {
- begin: 'q[qwxr]?\\s*\\|', end: '\\|',
- relevance: 5
- },
- {
- begin: 'q[qwxr]?\\s*\\<', end: '\\>',
- relevance: 5
- },
- {
- begin: 'qw\\s+q', end: 'q',
- relevance: 5
- },
- {
- begin: '\'', end: '\'',
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- begin: '"', end: '"'
- },
- {
- begin: '`', end: '`',
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- begin: '{\\w+}',
- contains: [],
- relevance: 0
- },
- {
- begin: '\-?\\w+\\s*\\=\\>',
- contains: [],
- relevance: 0
- }
- ]
- },
- {
- className: 'number',
- begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',
- relevance: 0
- },
- { // regexp container
- begin: '(\\/\\/|' + hljs.RE_STARTERS_RE + '|\\b(split|return|print|reverse|grep)\\b)\\s*',
- keywords: 'split return print reverse grep',
- relevance: 0,
- contains: [
- hljs.HASH_COMMENT_MODE,
- {
- className: 'regexp',
- begin: '(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*',
- relevance: 10
- },
- {
- className: 'regexp',
- begin: '(m|qr)?/', end: '/[a-z]*',
- contains: [hljs.BACKSLASH_ESCAPE],
- relevance: 0 // allows empty "//" which is a common comment delimiter in other languages
- }
- ]
- },
- {
- className: 'function',
- beginKeywords: 'sub', end: '(\\s*\\(.*?\\))?[;{]', excludeEnd: true,
- relevance: 5,
- contains: [hljs.TITLE_MODE]
- },
- {
- begin: '-\\w\\b',
- relevance: 0
- },
- {
- begin: "^__DATA__$",
- end: "^__END__$",
- subLanguage: 'mojolicious',
- contains: [
- {
- begin: "^@@.*",
- end: "$",
- className: "comment"
- }
- ]
- }
- ];
- SUBST.contains = PERL_DEFAULT_CONTAINS;
- METHOD.contains = PERL_DEFAULT_CONTAINS;
-
- return {
- aliases: ['pl', 'pm'],
- lexemes: /[\w\.]+/,
- keywords: PERL_KEYWORDS,
- contains: PERL_DEFAULT_CONTAINS
- };
-};
-},{}],231:[function(require,module,exports){
-module.exports = function(hljs) {
- var MACRO = {
- className: 'variable',
- begin: /\$[\w\d#@][\w\d_]*/
- };
- var TABLE = {
- className: 'variable',
- begin: /<(?!\/)/, end: />/
- };
- var QUOTE_STRING = {
- className: 'string',
- begin: /"/, end: /"/
- };
-
- return {
- aliases: ['pf.conf'],
- lexemes: /[a-z0-9_<>-]+/,
- keywords: {
- built_in: /* block match pass are "actions" in pf.conf(5), the rest are
- * lexically similar top-level commands.
- */
- 'block match pass load anchor|5 antispoof|10 set table',
- keyword:
- 'in out log quick on rdomain inet inet6 proto from port os to route' +
- 'allow-opts divert-packet divert-reply divert-to flags group icmp-type' +
- 'icmp6-type label once probability recieved-on rtable prio queue' +
- 'tos tag tagged user keep fragment for os drop' +
- 'af-to|10 binat-to|10 nat-to|10 rdr-to|10 bitmask least-stats random round-robin' +
- 'source-hash static-port' +
- 'dup-to reply-to route-to' +
- 'parent bandwidth default min max qlimit' +
- 'block-policy debug fingerprints hostid limit loginterface optimization' +
- 'reassemble ruleset-optimization basic none profile skip state-defaults' +
- 'state-policy timeout' +
- 'const counters persist' +
- 'no modulate synproxy state|5 floating if-bound no-sync pflow|10 sloppy' +
- 'source-track global rule max-src-nodes max-src-states max-src-conn' +
- 'max-src-conn-rate overload flush' +
- 'scrub|5 max-mss min-ttl no-df|10 random-id',
- literal:
- 'all any no-route self urpf-failed egress|5 unknown'
- },
- contains: [
- hljs.HASH_COMMENT_MODE,
- hljs.NUMBER_MODE,
- hljs.QUOTE_STRING_MODE,
- MACRO,
- TABLE
- ]
- };
-};
-},{}],232:[function(require,module,exports){
-module.exports = function(hljs) {
- var VARIABLE = {
- begin: '\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
- };
- var PREPROCESSOR = {
- className: 'meta', begin: /<\?(php)?|\?>/
- };
- var STRING = {
- className: 'string',
- contains: [hljs.BACKSLASH_ESCAPE, PREPROCESSOR],
- variants: [
- {
- begin: 'b"', end: '"'
- },
- {
- begin: 'b\'', end: '\''
- },
- hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}),
- hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null})
- ]
- };
- var NUMBER = {variants: [hljs.BINARY_NUMBER_MODE, hljs.C_NUMBER_MODE]};
- return {
- aliases: ['php3', 'php4', 'php5', 'php6'],
- case_insensitive: true,
- keywords:
- 'and include_once list abstract global private echo interface as static endswitch ' +
- 'array null if endwhile or const for endforeach self var while isset public ' +
- 'protected exit foreach throw elseif include __FILE__ empty require_once do xor ' +
- 'return parent clone use __CLASS__ __LINE__ else break print eval new ' +
- 'catch __METHOD__ case exception default die require __FUNCTION__ ' +
- 'enddeclare final try switch continue endfor endif declare unset true false ' +
- 'trait goto instanceof insteadof __DIR__ __NAMESPACE__ ' +
- 'yield finally',
- contains: [
- hljs.HASH_COMMENT_MODE,
- hljs.COMMENT('//', '$', {contains: [PREPROCESSOR]}),
- hljs.COMMENT(
- '/\\*',
- '\\*/',
- {
- contains: [
- {
- className: 'doctag',
- begin: '@[A-Za-z]+'
- }
- ]
- }
- ),
- hljs.COMMENT(
- '__halt_compiler.+?;',
- false,
- {
- endsWithParent: true,
- keywords: '__halt_compiler',
- lexemes: hljs.UNDERSCORE_IDENT_RE
- }
- ),
- {
- className: 'string',
- begin: /<<<['"]?\w+['"]?$/, end: /^\w+;?$/,
- contains: [
- hljs.BACKSLASH_ESCAPE,
- {
- className: 'subst',
- variants: [
- {begin: /\$\w+/},
- {begin: /\{\$/, end: /\}/}
- ]
- }
- ]
- },
- PREPROCESSOR,
- {
- className: 'keyword', begin: /\$this\b/
- },
- VARIABLE,
- {
- // swallow composed identifiers to avoid parsing them as keywords
- begin: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/
- },
- {
- className: 'function',
- beginKeywords: 'function', end: /[;{]/, excludeEnd: true,
- illegal: '\\$|\\[|%',
- contains: [
- hljs.UNDERSCORE_TITLE_MODE,
- {
- className: 'params',
- begin: '\\(', end: '\\)',
- contains: [
- 'self',
- VARIABLE,
- hljs.C_BLOCK_COMMENT_MODE,
- STRING,
- NUMBER
- ]
- }
- ]
- },
- {
- className: 'class',
- beginKeywords: 'class interface', end: '{', excludeEnd: true,
- illegal: /[:\(\$"]/,
- contains: [
- {beginKeywords: 'extends implements'},
- hljs.UNDERSCORE_TITLE_MODE
- ]
- },
- {
- beginKeywords: 'namespace', end: ';',
- illegal: /[\.']/,
- contains: [hljs.UNDERSCORE_TITLE_MODE]
- },
- {
- beginKeywords: 'use', end: ';',
- contains: [hljs.UNDERSCORE_TITLE_MODE]
- },
- {
- begin: '=>' // No markup, just a relevance booster
- },
- STRING,
- NUMBER
- ]
- };
-};
-},{}],233:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS = {
- keyword:
- 'actor addressof and as be break class compile_error compile_intrinsic' +
- 'consume continue delegate digestof do else elseif embed end error' +
- 'for fun if ifdef in interface is isnt lambda let match new not object' +
- 'or primitive recover repeat return struct then trait try type until ' +
- 'use var where while with xor',
- meta:
- 'iso val tag trn box ref',
- literal:
- 'this false true'
- };
-
- var TRIPLE_QUOTE_STRING_MODE = {
- className: 'string',
- begin: '"""', end: '"""',
- relevance: 10
- };
-
- var QUOTE_STRING_MODE = {
- className: 'string',
- begin: '"', end: '"',
- contains: [hljs.BACKSLASH_ESCAPE]
- };
-
- var SINGLE_QUOTE_CHAR_MODE = {
- className: 'string',
- begin: '\'', end: '\'',
- contains: [hljs.BACKSLASH_ESCAPE],
- relevance: 0
- };
-
- var TYPE_NAME = {
- className: 'type',
- begin: '\\b_?[A-Z][\\w]*',
- relevance: 0
- };
-
- var PRIMED_NAME = {
- begin: hljs.IDENT_RE + '\'', relevance: 0
- };
-
- var CLASS = {
- className: 'class',
- beginKeywords: 'class actor', end: '$',
- contains: [
- hljs.TITLE_MODE,
- hljs.C_LINE_COMMENT_MODE
- ]
- }
-
- var FUNCTION = {
- className: 'function',
- beginKeywords: 'new fun', end: '=>',
- contains: [
- hljs.TITLE_MODE,
- {
- begin: /\(/, end: /\)/,
- contains: [
- TYPE_NAME,
- PRIMED_NAME,
- hljs.C_NUMBER_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- },
- {
- begin: /:/, endsWithParent: true,
- contains: [TYPE_NAME]
- },
- hljs.C_LINE_COMMENT_MODE
- ]
- }
-
- return {
- keywords: KEYWORDS,
- contains: [
- CLASS,
- FUNCTION,
- TYPE_NAME,
- TRIPLE_QUOTE_STRING_MODE,
- QUOTE_STRING_MODE,
- SINGLE_QUOTE_CHAR_MODE,
- PRIMED_NAME,
- hljs.C_NUMBER_MODE,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- };
-};
-},{}],234:[function(require,module,exports){
-module.exports = function(hljs) {
- var BACKTICK_ESCAPE = {
- begin: '`[\\s\\S]',
- relevance: 0
- };
- var VAR = {
- className: 'variable',
- variants: [
- {begin: /\$[\w\d][\w\d_:]*/}
- ]
- };
- var LITERAL = {
- className: 'literal',
- begin: /\$(null|true|false)\b/
- };
- var QUOTE_STRING = {
- className: 'string',
- variants: [
- { begin: /"/, end: /"/ },
- { begin: /@"/, end: /^"@/ }
- ],
- contains: [
- BACKTICK_ESCAPE,
- VAR,
- {
- className: 'variable',
- begin: /\$[A-z]/, end: /[^A-z]/
- }
- ]
- };
- var APOS_STRING = {
- className: 'string',
- variants: [
- { begin: /'/, end: /'/ },
- { begin: /@'/, end: /^'@/ }
- ]
- };
-
- var PS_HELPTAGS = {
- className: 'doctag',
- variants: [
- /* no paramater help tags */
- { begin: /\.(synopsis|description|example|inputs|outputs|notes|link|component|role|functionality)/ },
- /* one parameter help tags */
- { begin: /\.(parameter|forwardhelptargetname|forwardhelpcategory|remotehelprunspace|externalhelp)\s+\S+/ }
- ]
- };
- var PS_COMMENT = hljs.inherit(
- hljs.COMMENT(null, null),
- {
- variants: [
- /* single-line comment */
- { begin: /#/, end: /$/ },
- /* multi-line comment */
- { begin: /<#/, end: /#>/ }
- ],
- contains: [PS_HELPTAGS]
- }
- );
-
- return {
- aliases: ['ps'],
- lexemes: /-?[A-z\.\-]+/,
- case_insensitive: true,
- keywords: {
- keyword: 'if else foreach return function do while until elseif begin for trap data dynamicparam end break throw param continue finally in switch exit filter try process catch',
- built_in: 'Add-Computer Add-Content Add-History Add-JobTrigger Add-Member Add-PSSnapin Add-Type Checkpoint-Computer Clear-Content Clear-EventLog Clear-History Clear-Host Clear-Item Clear-ItemProperty Clear-Variable Compare-Object Complete-Transaction Connect-PSSession Connect-WSMan Convert-Path ConvertFrom-Csv ConvertFrom-Json ConvertFrom-SecureString ConvertFrom-StringData ConvertTo-Csv ConvertTo-Html ConvertTo-Json ConvertTo-SecureString ConvertTo-Xml Copy-Item Copy-ItemProperty Debug-Process Disable-ComputerRestore Disable-JobTrigger Disable-PSBreakpoint Disable-PSRemoting Disable-PSSessionConfiguration Disable-WSManCredSSP Disconnect-PSSession Disconnect-WSMan Disable-ScheduledJob Enable-ComputerRestore Enable-JobTrigger Enable-PSBreakpoint Enable-PSRemoting Enable-PSSessionConfiguration Enable-ScheduledJob Enable-WSManCredSSP Enter-PSSession Exit-PSSession Export-Alias Export-Clixml Export-Console Export-Counter Export-Csv Export-FormatData Export-ModuleMember Export-PSSession ForEach-Object Format-Custom Format-List Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command Get-ComputerRestorePoint Get-Content Get-ControlPanelItem Get-Counter Get-Credential Get-Culture Get-Date Get-Event Get-EventLog Get-EventSubscriber Get-ExecutionPolicy Get-FormatData Get-Host Get-HotFix Get-Help Get-History Get-IseSnippet Get-Item Get-ItemProperty Get-Job Get-JobTrigger Get-Location Get-Member Get-Module Get-PfxCertificate Get-Process Get-PSBreakpoint Get-PSCallStack Get-PSDrive Get-PSProvider Get-PSSession Get-PSSessionConfiguration Get-PSSnapin Get-Random Get-ScheduledJob Get-ScheduledJobOption Get-Service Get-TraceSource Get-Transaction Get-TypeData Get-UICulture Get-Unique Get-Variable Get-Verb Get-WinEvent Get-WmiObject Get-WSManCredSSP Get-WSManInstance Group-Object Import-Alias Import-Clixml Import-Counter Import-Csv Import-IseSnippet Import-LocalizedData Import-PSSession Import-Module Invoke-AsWorkflow Invoke-Command Invoke-Expression Invoke-History Invoke-Item Invoke-RestMethod Invoke-WebRequest Invoke-WmiMethod Invoke-WSManAction Join-Path Limit-EventLog Measure-Command Measure-Object Move-Item Move-ItemProperty New-Alias New-Event New-EventLog New-IseSnippet New-Item New-ItemProperty New-JobTrigger New-Object New-Module New-ModuleManifest New-PSDrive New-PSSession New-PSSessionConfigurationFile New-PSSessionOption New-PSTransportOption New-PSWorkflowExecutionOption New-PSWorkflowSession New-ScheduledJobOption New-Service New-TimeSpan New-Variable New-WebServiceProxy New-WinEvent New-WSManInstance New-WSManSessionOption Out-Default Out-File Out-GridView Out-Host Out-Null Out-Printer Out-String Pop-Location Push-Location Read-Host Receive-Job Register-EngineEvent Register-ObjectEvent Register-PSSessionConfiguration Register-ScheduledJob Register-WmiEvent Remove-Computer Remove-Event Remove-EventLog Remove-Item Remove-ItemProperty Remove-Job Remove-JobTrigger Remove-Module Remove-PSBreakpoint Remove-PSDrive Remove-PSSession Remove-PSSnapin Remove-TypeData Remove-Variable Remove-WmiObject Remove-WSManInstance Rename-Computer Rename-Item Rename-ItemProperty Reset-ComputerMachinePassword Resolve-Path Restart-Computer Restart-Service Restore-Computer Resume-Job Resume-Service Save-Help Select-Object Select-String Select-Xml Send-MailMessage Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-JobTrigger Set-Location Set-PSBreakpoint Set-PSDebug Set-PSSessionConfiguration Set-ScheduledJob Set-ScheduledJobOption Set-Service Set-StrictMode Set-TraceSource Set-Variable Set-WmiInstance Set-WSManInstance Set-WSManQuickConfig Show-Command Show-ControlPanelItem Show-EventLog Sort-Object Split-Path Start-Job Start-Process Start-Service Start-Sleep Start-Transaction Start-Transcript Stop-Computer Stop-Job Stop-Process Stop-Service Stop-Transcript Suspend-Job Suspend-Service Tee-Object Test-ComputerSecureChannel Test-Connection Test-ModuleManifest Test-Path Test-PSSessionConfigurationFile Trace-Command Unblock-File Undo-Transaction Unregister-Event Unregister-PSSessionConfiguration Unregister-ScheduledJob Update-FormatData Update-Help Update-List Update-TypeData Use-Transaction Wait-Event Wait-Job Wait-Process Where-Object Write-Debug Write-Error Write-EventLog Write-Host Write-Output Write-Progress Write-Verbose Write-Warning Add-MDTPersistentDrive Disable-MDTMonitorService Enable-MDTMonitorService Get-MDTDeploymentShareStatistics Get-MDTMonitorData Get-MDTOperatingSystemCatalog Get-MDTPersistentDrive Import-MDTApplication Import-MDTDriver Import-MDTOperatingSystem Import-MDTPackage Import-MDTTaskSequence New-MDTDatabase Remove-MDTMonitorData Remove-MDTPersistentDrive Restore-MDTPersistentDrive Set-MDTMonitorData Test-MDTDeploymentShare Test-MDTMonitorData Update-MDTDatabaseSchema Update-MDTDeploymentShare Update-MDTLinkedDS Update-MDTMedia Update-MDTMedia Add-VamtProductKey Export-VamtData Find-VamtManagedMachine Get-VamtConfirmationId Get-VamtProduct Get-VamtProductKey Import-VamtData Initialize-VamtData Install-VamtConfirmationId Install-VamtProductActivation Install-VamtProductKey Update-VamtProduct',
- nomarkup: '-ne -eq -lt -gt -ge -le -not -like -notlike -match -notmatch -contains -notcontains -in -notin -replace'
- },
- contains: [
- BACKTICK_ESCAPE,
- hljs.NUMBER_MODE,
- QUOTE_STRING,
- APOS_STRING,
- LITERAL,
- VAR,
- PS_COMMENT
- ]
- };
-};
-},{}],235:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- keywords: {
- keyword: 'BufferedReader PVector PFont PImage PGraphics HashMap boolean byte char color ' +
- 'double float int long String Array FloatDict FloatList IntDict IntList JSONArray JSONObject ' +
- 'Object StringDict StringList Table TableRow XML ' +
- // Java keywords
- 'false synchronized int abstract float private char boolean static null if const ' +
- 'for true while long throw strictfp finally protected import native final return void ' +
- 'enum else break transient new catch instanceof byte super volatile case assert short ' +
- 'package default double public try this switch continue throws protected public private',
- literal: 'P2D P3D HALF_PI PI QUARTER_PI TAU TWO_PI',
- title: 'setup draw',
- built_in: 'displayHeight displayWidth mouseY mouseX mousePressed pmouseX pmouseY key ' +
- 'keyCode pixels focused frameCount frameRate height width ' +
- 'size createGraphics beginDraw createShape loadShape PShape arc ellipse line point ' +
- 'quad rect triangle bezier bezierDetail bezierPoint bezierTangent curve curveDetail curvePoint ' +
- 'curveTangent curveTightness shape shapeMode beginContour beginShape bezierVertex curveVertex ' +
- 'endContour endShape quadraticVertex vertex ellipseMode noSmooth rectMode smooth strokeCap ' +
- 'strokeJoin strokeWeight mouseClicked mouseDragged mouseMoved mousePressed mouseReleased ' +
- 'mouseWheel keyPressed keyPressedkeyReleased keyTyped print println save saveFrame day hour ' +
- 'millis minute month second year background clear colorMode fill noFill noStroke stroke alpha ' +
- 'blue brightness color green hue lerpColor red saturation modelX modelY modelZ screenX screenY ' +
- 'screenZ ambient emissive shininess specular add createImage beginCamera camera endCamera frustum ' +
- 'ortho perspective printCamera printProjection cursor frameRate noCursor exit loop noLoop popStyle ' +
- 'pushStyle redraw binary boolean byte char float hex int str unbinary unhex join match matchAll nf ' +
- 'nfc nfp nfs split splitTokens trim append arrayCopy concat expand reverse shorten sort splice subset ' +
- 'box sphere sphereDetail createInput createReader loadBytes loadJSONArray loadJSONObject loadStrings ' +
- 'loadTable loadXML open parseXML saveTable selectFolder selectInput beginRaw beginRecord createOutput ' +
- 'createWriter endRaw endRecord PrintWritersaveBytes saveJSONArray saveJSONObject saveStream saveStrings ' +
- 'saveXML selectOutput popMatrix printMatrix pushMatrix resetMatrix rotate rotateX rotateY rotateZ scale ' +
- 'shearX shearY translate ambientLight directionalLight lightFalloff lights lightSpecular noLights normal ' +
- 'pointLight spotLight image imageMode loadImage noTint requestImage tint texture textureMode textureWrap ' +
- 'blend copy filter get loadPixels set updatePixels blendMode loadShader PShaderresetShader shader createFont ' +
- 'loadFont text textFont textAlign textLeading textMode textSize textWidth textAscent textDescent abs ceil ' +
- 'constrain dist exp floor lerp log mag map max min norm pow round sq sqrt acos asin atan atan2 cos degrees ' +
- 'radians sin tan noise noiseDetail noiseSeed random randomGaussian randomSeed'
- },
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE
- ]
- };
-};
-},{}],236:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- contains: [
- hljs.C_NUMBER_MODE,
- {
- begin: '[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}', end: ':',
- excludeEnd: true
- },
- {
- begin: '(ncalls|tottime|cumtime)', end: '$',
- keywords: 'ncalls tottime|10 cumtime|10 filename',
- relevance: 10
- },
- {
- begin: 'function calls', end: '$',
- contains: [hljs.C_NUMBER_MODE],
- relevance: 10
- },
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- {
- className: 'string',
- begin: '\\(', end: '\\)$',
- excludeBegin: true, excludeEnd: true,
- relevance: 0
- }
- ]
- };
-};
-},{}],237:[function(require,module,exports){
-module.exports = function(hljs) {
-
- var ATOM = {
-
- begin: /[a-z][A-Za-z0-9_]*/,
- relevance: 0
- };
-
- var VAR = {
-
- className: 'symbol',
- variants: [
- {begin: /[A-Z][a-zA-Z0-9_]*/},
- {begin: /_[A-Za-z0-9_]*/},
- ],
- relevance: 0
- };
-
- var PARENTED = {
-
- begin: /\(/,
- end: /\)/,
- relevance: 0
- };
-
- var LIST = {
-
- begin: /\[/,
- end: /\]/
- };
-
- var LINE_COMMENT = {
-
- className: 'comment',
- begin: /%/, end: /$/,
- contains: [hljs.PHRASAL_WORDS_MODE]
- };
-
- var BACKTICK_STRING = {
-
- className: 'string',
- begin: /`/, end: /`/,
- contains: [hljs.BACKSLASH_ESCAPE]
- };
-
- var CHAR_CODE = {
-
- className: 'string', // 0'a etc.
- begin: /0\'(\\\'|.)/
- };
-
- var SPACE_CODE = {
-
- className: 'string',
- begin: /0\'\\s/ // 0'\s
- };
-
- var PRED_OP = { // relevance booster
- begin: /:-/
- };
-
- var inner = [
-
- ATOM,
- VAR,
- PARENTED,
- PRED_OP,
- LIST,
- LINE_COMMENT,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.APOS_STRING_MODE,
- BACKTICK_STRING,
- CHAR_CODE,
- SPACE_CODE,
- hljs.C_NUMBER_MODE
- ];
-
- PARENTED.contains = inner;
- LIST.contains = inner;
-
- return {
- contains: inner.concat([
- {begin: /\.$/} // relevance booster
- ])
- };
-};
-},{}],238:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- keywords: {
- keyword: 'package import option optional required repeated group',
- built_in: 'double float int32 int64 uint32 uint64 sint32 sint64 ' +
- 'fixed32 fixed64 sfixed32 sfixed64 bool string bytes',
- literal: 'true false'
- },
- contains: [
- hljs.QUOTE_STRING_MODE,
- hljs.NUMBER_MODE,
- hljs.C_LINE_COMMENT_MODE,
- {
- className: 'class',
- beginKeywords: 'message enum service', end: /\{/,
- illegal: /\n/,
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {
- starts: {endsWithParent: true, excludeEnd: true} // hack: eating everything after the first title
- })
- ]
- },
- {
- className: 'function',
- beginKeywords: 'rpc',
- end: /;/, excludeEnd: true,
- keywords: 'rpc returns'
- },
- {
- begin: /^\s*[A-Z_]+/,
- end: /\s*=/, excludeEnd: true
- }
- ]
- };
-};
-},{}],239:[function(require,module,exports){
-module.exports = function(hljs) {
-
- var PUPPET_KEYWORDS = {
- keyword:
- /* language keywords */
- 'and case default else elsif false if in import enherits node or true undef unless main settings $string ',
- literal:
- /* metaparameters */
- 'alias audit before loglevel noop require subscribe tag ' +
- /* normal attributes */
- 'owner ensure group mode name|0 changes context force incl lens load_path onlyif provider returns root show_diff type_check ' +
- 'en_address ip_address realname command environment hour monute month monthday special target weekday '+
- 'creates cwd ogoutput refresh refreshonly tries try_sleep umask backup checksum content ctime force ignore ' +
- 'links mtime purge recurse recurselimit replace selinux_ignore_defaults selrange selrole seltype seluser source ' +
- 'souirce_permissions sourceselect validate_cmd validate_replacement allowdupe attribute_membership auth_membership forcelocal gid '+
- 'ia_load_module members system host_aliases ip allowed_trunk_vlans description device_url duplex encapsulation etherchannel ' +
- 'native_vlan speed principals allow_root auth_class auth_type authenticate_user k_of_n mechanisms rule session_owner shared options ' +
- 'device fstype enable hasrestart directory present absent link atboot blockdevice device dump pass remounts poller_tag use ' +
- 'message withpath adminfile allow_virtual allowcdrom category configfiles flavor install_options instance package_settings platform ' +
- 'responsefile status uninstall_options vendor unless_system_user unless_uid binary control flags hasstatus manifest pattern restart running ' +
- 'start stop allowdupe auths expiry gid groups home iterations key_membership keys managehome membership password password_max_age ' +
- 'password_min_age profile_membership profiles project purge_ssh_keys role_membership roles salt shell uid baseurl cost descr enabled ' +
- 'enablegroups exclude failovermethod gpgcheck gpgkey http_caching include includepkgs keepalive metadata_expire metalink mirrorlist ' +
- 'priority protect proxy proxy_password proxy_username repo_gpgcheck s3_enabled skip_if_unavailable sslcacert sslclientcert sslclientkey ' +
- 'sslverify mounted',
- built_in:
- /* core facts */
- 'architecture augeasversion blockdevices boardmanufacturer boardproductname boardserialnumber cfkey dhcp_servers ' +
- 'domain ec2_ ec2_userdata facterversion filesystems ldom fqdn gid hardwareisa hardwaremodel hostname id|0 interfaces '+
- 'ipaddress ipaddress_ ipaddress6 ipaddress6_ iphostnumber is_virtual kernel kernelmajversion kernelrelease kernelversion ' +
- 'kernelrelease kernelversion lsbdistcodename lsbdistdescription lsbdistid lsbdistrelease lsbmajdistrelease lsbminordistrelease ' +
- 'lsbrelease macaddress macaddress_ macosx_buildversion macosx_productname macosx_productversion macosx_productverson_major ' +
- 'macosx_productversion_minor manufacturer memoryfree memorysize netmask metmask_ network_ operatingsystem operatingsystemmajrelease '+
- 'operatingsystemrelease osfamily partitions path physicalprocessorcount processor processorcount productname ps puppetversion '+
- 'rubysitedir rubyversion selinux selinux_config_mode selinux_config_policy selinux_current_mode selinux_current_mode selinux_enforced '+
- 'selinux_policyversion serialnumber sp_ sshdsakey sshecdsakey sshrsakey swapencrypted swapfree swapsize timezone type uniqueid uptime '+
- 'uptime_days uptime_hours uptime_seconds uuid virtual vlans xendomains zfs_version zonenae zones zpool_version'
- };
-
- var COMMENT = hljs.COMMENT('#', '$');
-
- var IDENT_RE = '([A-Za-z_]|::)(\\w|::)*';
-
- var TITLE = hljs.inherit(hljs.TITLE_MODE, {begin: IDENT_RE});
-
- var VARIABLE = {className: 'variable', begin: '\\$' + IDENT_RE};
-
- var STRING = {
- className: 'string',
- contains: [hljs.BACKSLASH_ESCAPE, VARIABLE],
- variants: [
- {begin: /'/, end: /'/},
- {begin: /"/, end: /"/}
- ]
- };
-
- return {
- aliases: ['pp'],
- contains: [
- COMMENT,
- VARIABLE,
- STRING,
- {
- beginKeywords: 'class', end: '\\{|;',
- illegal: /=/,
- contains: [TITLE, COMMENT]
- },
- {
- beginKeywords: 'define', end: /\{/,
- contains: [
- {
- className: 'section', begin: hljs.IDENT_RE, endsParent: true
- }
- ]
- },
- {
- begin: hljs.IDENT_RE + '\\s+\\{', returnBegin: true,
- end: /\S/,
- contains: [
- {
- className: 'keyword',
- begin: hljs.IDENT_RE
- },
- {
- begin: /\{/, end: /\}/,
- keywords: PUPPET_KEYWORDS,
- relevance: 0,
- contains: [
- STRING,
- COMMENT,
- {
- begin:'[a-zA-Z_]+\\s*=>',
- returnBegin: true, end: '=>',
- contains: [
- {
- className: 'attr',
- begin: hljs.IDENT_RE,
- }
- ]
- },
- {
- className: 'number',
- begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',
- relevance: 0
- },
- VARIABLE
- ]
- }
- ],
- relevance: 0
- }
- ]
- }
-};
-},{}],240:[function(require,module,exports){
-module.exports = // Base deafult colors in PB IDE: background: #FFFFDF; foreground: #000000;
-
-function(hljs) {
- var STRINGS = { // PB IDE color: #0080FF (Azure Radiance)
- className: 'string',
- begin: '(~)?"', end: '"',
- illegal: '\\n'
- };
- var CONSTANTS = { // PB IDE color: #924B72 (Cannon Pink)
- // "#" + a letter or underscore + letters, digits or underscores + (optional) "$"
- className: 'symbol',
- begin: '#[a-zA-Z_]\\w*\\$?'
- };
-
- return {
- aliases: ['pb', 'pbi'],
- keywords: // PB IDE color: #006666 (Blue Stone) + Bold
- // The following keywords list was taken and adapted from GuShH's PureBasic language file for GeSHi...
- 'And As Break CallDebugger Case CompilerCase CompilerDefault CompilerElse CompilerEndIf CompilerEndSelect ' +
- 'CompilerError CompilerIf CompilerSelect Continue Data DataSection EndDataSection Debug DebugLevel ' +
- 'Default Define Dim DisableASM DisableDebugger DisableExplicit Else ElseIf EnableASM ' +
- 'EnableDebugger EnableExplicit End EndEnumeration EndIf EndImport EndInterface EndMacro EndProcedure ' +
- 'EndSelect EndStructure EndStructureUnion EndWith Enumeration Extends FakeReturn For Next ForEach ' +
- 'ForEver Global Gosub Goto If Import ImportC IncludeBinary IncludeFile IncludePath Interface Macro ' +
- 'NewList Not Or ProcedureReturn Protected Prototype ' +
- 'PrototypeC Read ReDim Repeat Until Restore Return Select Shared Static Step Structure StructureUnion ' +
- 'Swap To Wend While With XIncludeFile XOr ' +
- 'Procedure ProcedureC ProcedureCDLL ProcedureDLL Declare DeclareC DeclareCDLL DeclareDLL',
- contains: [
- // COMMENTS | PB IDE color: #00AAAA (Persian Green)
- hljs.COMMENT(';', '$', {relevance: 0}),
-
- { // PROCEDURES DEFINITIONS
- className: 'function',
- begin: '\\b(Procedure|Declare)(C|CDLL|DLL)?\\b',
- end: '\\(',
- excludeEnd: true,
- returnBegin: true,
- contains: [
- { // PROCEDURE KEYWORDS | PB IDE color: #006666 (Blue Stone) + Bold
- className: 'keyword',
- begin: '(Procedure|Declare)(C|CDLL|DLL)?',
- excludeEnd: true
- },
- { // PROCEDURE RETURN TYPE SETTING | PB IDE color: #000000 (Black)
- className: 'type',
- begin: '\\.\\w*'
- // end: ' ',
- },
- hljs.UNDERSCORE_TITLE_MODE // PROCEDURE NAME | PB IDE color: #006666 (Blue Stone)
- ]
- },
- STRINGS,
- CONSTANTS
- ]
- };
-};
-},{}],241:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS = {
- keyword:
- 'and elif is global as in if from raise for except finally print import pass return ' +
- 'exec else break not with class assert yield try while continue del or def lambda ' +
- 'async await nonlocal|10 None True False',
- built_in:
- 'Ellipsis NotImplemented'
- };
- var PROMPT = {
- className: 'meta', begin: /^(>>>|\.\.\.) /
- };
- var SUBST = {
- className: 'subst',
- begin: /\{/, end: /\}/,
- keywords: KEYWORDS,
- illegal: /#/
- };
- var STRING = {
- className: 'string',
- contains: [hljs.BACKSLASH_ESCAPE],
- variants: [
- {
- begin: /(u|b)?r?'''/, end: /'''/,
- contains: [PROMPT],
- relevance: 10
- },
- {
- begin: /(u|b)?r?"""/, end: /"""/,
- contains: [PROMPT],
- relevance: 10
- },
- {
- begin: /(fr|rf|f)'''/, end: /'''/,
- contains: [PROMPT, SUBST]
- },
- {
- begin: /(fr|rf|f)"""/, end: /"""/,
- contains: [PROMPT, SUBST]
- },
- {
- begin: /(u|r|ur)'/, end: /'/,
- relevance: 10
- },
- {
- begin: /(u|r|ur)"/, end: /"/,
- relevance: 10
- },
- {
- begin: /(b|br)'/, end: /'/
- },
- {
- begin: /(b|br)"/, end: /"/
- },
- {
- begin: /(fr|rf|f)'/, end: /'/,
- contains: [SUBST]
- },
- {
- begin: /(fr|rf|f)"/, end: /"/,
- contains: [SUBST]
- },
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE
- ]
- };
- var NUMBER = {
- className: 'number', relevance: 0,
- variants: [
- {begin: hljs.BINARY_NUMBER_RE + '[lLjJ]?'},
- {begin: '\\b(0o[0-7]+)[lLjJ]?'},
- {begin: hljs.C_NUMBER_RE + '[lLjJ]?'}
- ]
- };
- var PARAMS = {
- className: 'params',
- begin: /\(/, end: /\)/,
- contains: ['self', PROMPT, NUMBER, STRING]
- };
- SUBST.contains = [STRING, NUMBER, PROMPT];
- return {
- aliases: ['py', 'gyp'],
- keywords: KEYWORDS,
- illegal: /(<\/|->|\?)|=>/,
- contains: [
- PROMPT,
- NUMBER,
- STRING,
- hljs.HASH_COMMENT_MODE,
- {
- variants: [
- {className: 'function', beginKeywords: 'def'},
- {className: 'class', beginKeywords: 'class'}
- ],
- end: /:/,
- illegal: /[${=;\n,]/,
- contains: [
- hljs.UNDERSCORE_TITLE_MODE,
- PARAMS,
- {
- begin: /->/, endsWithParent: true,
- keywords: 'None'
- }
- ]
- },
- {
- className: 'meta',
- begin: /^[\t ]*@/, end: /$/
- },
- {
- begin: /\b(print|exec)\(/ // don’t highlight keywords-turned-functions in Python 3
- }
- ]
- };
-};
-},{}],242:[function(require,module,exports){
-module.exports = function(hljs) {
- var Q_KEYWORDS = {
- keyword:
- 'do while select delete by update from',
- literal:
- '0b 1b',
- built_in:
- 'neg not null string reciprocal floor ceiling signum mod xbar xlog and or each scan over prior mmu lsq inv md5 ltime gtime count first var dev med cov cor all any rand sums prds mins maxs fills deltas ratios avgs differ prev next rank reverse iasc idesc asc desc msum mcount mavg mdev xrank mmin mmax xprev rotate distinct group where flip type key til get value attr cut set upsert raze union inter except cross sv vs sublist enlist read0 read1 hopen hclose hdel hsym hcount peach system ltrim rtrim trim lower upper ssr view tables views cols xcols keys xkey xcol xasc xdesc fkeys meta lj aj aj0 ij pj asof uj ww wj wj1 fby xgroup ungroup ej save load rsave rload show csv parse eval min max avg wavg wsum sin cos tan sum',
- type:
- '`float `double int `timestamp `timespan `datetime `time `boolean `symbol `char `byte `short `long `real `month `date `minute `second `guid'
- };
- return {
- aliases:['k', 'kdb'],
- keywords: Q_KEYWORDS,
- lexemes: /(`?)[A-Za-z0-9_]+\b/,
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE
- ]
- };
-};
-},{}],243:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS = {
- keyword:
- 'in of on if for while finally var new function do return void else break catch ' +
- 'instanceof with throw case default try this switch continue typeof delete ' +
- 'let yield const export super debugger as async await import',
- literal:
- 'true false null undefined NaN Infinity',
- built_in:
- 'eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent ' +
- 'encodeURI encodeURIComponent escape unescape Object Function Boolean Error ' +
- 'EvalError InternalError RangeError ReferenceError StopIteration SyntaxError ' +
- 'TypeError URIError Number Math Date String RegExp Array Float32Array ' +
- 'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' +
- 'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' +
- 'module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect ' +
- 'Behavior bool color coordinate date double enumeration font geocircle georectangle ' +
- 'geoshape int list matrix4x4 parent point quaternion real rect ' +
- 'size string url variant vector2d vector3d vector4d' +
- 'Promise'
- };
-
- var QML_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9\\._]*';
-
- // Isolate property statements. Ends at a :, =, ;, ,, a comment or end of line.
- // Use property class.
- var PROPERTY = {
- className: 'keyword',
- begin: '\\bproperty\\b',
- starts: {
- className: 'string',
- end: '(:|=|;|,|//|/\\*|$)',
- returnEnd: true
- }
- };
-
- // Isolate signal statements. Ends at a ) a comment or end of line.
- // Use property class.
- var SIGNAL = {
- className: 'keyword',
- begin: '\\bsignal\\b',
- starts: {
- className: 'string',
- end: '(\\(|:|=|;|,|//|/\\*|$)',
- returnEnd: true
- }
- };
-
- // id: is special in QML. When we see id: we want to mark the id: as attribute and
- // emphasize the token following.
- var ID_ID = {
- className: 'attribute',
- begin: '\\bid\\s*:',
- starts: {
- className: 'string',
- end: QML_IDENT_RE,
- returnEnd: false
- }
- };
-
- // Find QML object attribute. An attribute is a QML identifier followed by :.
- // Unfortunately it's hard to know where it ends, as it may contain scalars,
- // objects, object definitions, or javascript. The true end is either when the parent
- // ends or the next attribute is detected.
- var QML_ATTRIBUTE = {
- begin: QML_IDENT_RE + '\\s*:',
- returnBegin: true,
- contains: [
- {
- className: 'attribute',
- begin: QML_IDENT_RE,
- end: '\\s*:',
- excludeEnd: true,
- relevance: 0
- }
- ],
- relevance: 0
- };
-
- // Find QML object. A QML object is a QML identifier followed by { and ends at the matching }.
- // All we really care about is finding IDENT followed by { and just mark up the IDENT and ignore the {.
- var QML_OBJECT = {
- begin: QML_IDENT_RE + '\\s*{', end: '{',
- returnBegin: true,
- relevance: 0,
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {begin: QML_IDENT_RE})
- ]
- };
-
- return {
- aliases: ['qt'],
- case_insensitive: false,
- keywords: KEYWORDS,
- contains: [
- {
- className: 'meta',
- begin: /^\s*['"]use (strict|asm)['"]/
- },
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- { // template string
- className: 'string',
- begin: '`', end: '`',
- contains: [
- hljs.BACKSLASH_ESCAPE,
- {
- className: 'subst',
- begin: '\\$\\{', end: '\\}'
- }
- ]
- },
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- {
- className: 'number',
- variants: [
- { begin: '\\b(0[bB][01]+)' },
- { begin: '\\b(0[oO][0-7]+)' },
- { begin: hljs.C_NUMBER_RE }
- ],
- relevance: 0
- },
- { // "value" container
- begin: '(' + hljs.RE_STARTERS_RE + '|\\b(case|return|throw)\\b)\\s*',
- keywords: 'return throw case',
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.REGEXP_MODE,
- { // E4X / JSX
- begin: /</, end: />\s*[);\]]/,
- relevance: 0,
- subLanguage: 'xml'
- }
- ],
- relevance: 0
- },
- SIGNAL,
- PROPERTY,
- {
- className: 'function',
- beginKeywords: 'function', end: /\{/, excludeEnd: true,
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {begin: /[A-Za-z$_][0-9A-Za-z$_]*/}),
- {
- className: 'params',
- begin: /\(/, end: /\)/,
- excludeBegin: true,
- excludeEnd: true,
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- }
- ],
- illegal: /\[|%/
- },
- {
- begin: '\\.' + hljs.IDENT_RE, relevance: 0 // hack: prevents detection of keywords after dots
- },
- ID_ID,
- QML_ATTRIBUTE,
- QML_OBJECT
- ],
- illegal: /#/
- };
-};
-},{}],244:[function(require,module,exports){
-module.exports = function(hljs) {
- var IDENT_RE = '([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*';
-
- return {
- contains: [
- hljs.HASH_COMMENT_MODE,
- {
- begin: IDENT_RE,
- lexemes: IDENT_RE,
- keywords: {
- keyword:
- 'function if in break next repeat else for return switch while try tryCatch ' +
- 'stop warning require library attach detach source setMethod setGeneric ' +
- 'setGroupGeneric setClass ...',
- literal:
- 'NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 ' +
- 'NA_complex_|10'
- },
- relevance: 0
- },
- {
- // hex value
- className: 'number',
- begin: "0[xX][0-9a-fA-F]+[Li]?\\b",
- relevance: 0
- },
- {
- // explicit integer
- className: 'number',
- begin: "\\d+(?:[eE][+\\-]?\\d*)?L\\b",
- relevance: 0
- },
- {
- // number with trailing decimal
- className: 'number',
- begin: "\\d+\\.(?!\\d)(?:i\\b)?",
- relevance: 0
- },
- {
- // number
- className: 'number',
- begin: "\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",
- relevance: 0
- },
- {
- // number with leading decimal
- className: 'number',
- begin: "\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",
- relevance: 0
- },
-
- {
- // escaped identifier
- begin: '`',
- end: '`',
- relevance: 0
- },
-
- {
- className: 'string',
- contains: [hljs.BACKSLASH_ESCAPE],
- variants: [
- {begin: '"', end: '"'},
- {begin: "'", end: "'"}
- ]
- }
- ]
- };
-};
-},{}],245:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- keywords:
- 'ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis ' +
- 'Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone ' +
- 'CoordinateSystem CoordSysTransform CropWindow Curves Cylinder DepthOfField Detail ' +
- 'DetailRange Disk Displacement Display End ErrorHandler Exposure Exterior Format ' +
- 'FrameAspectRatio FrameBegin FrameEnd GeneralPolygon GeometricApproximation Geometry ' +
- 'Hider Hyperboloid Identity Illuminate Imager Interior LightSource ' +
- 'MakeCubeFaceEnvironment MakeLatLongEnvironment MakeShadow MakeTexture Matte ' +
- 'MotionBegin MotionEnd NuPatch ObjectBegin ObjectEnd ObjectInstance Opacity Option ' +
- 'Orientation Paraboloid Patch PatchMesh Perspective PixelFilter PixelSamples ' +
- 'PixelVariance Points PointsGeneralPolygons PointsPolygons Polygon Procedural Projection ' +
- 'Quantize ReadArchive RelativeDetail ReverseOrientation Rotate Scale ScreenWindow ' +
- 'ShadingInterpolation ShadingRate Shutter Sides Skew SolidBegin SolidEnd Sphere ' +
- 'SubdivisionMesh Surface TextureCoordinates Torus Transform TransformBegin TransformEnd ' +
- 'TransformPoints Translate TrimCurve WorldBegin WorldEnd',
- illegal: '</',
- contains: [
- hljs.HASH_COMMENT_MODE,
- hljs.C_NUMBER_MODE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE
- ]
- };
-};
-},{}],246:[function(require,module,exports){
-module.exports = function(hljs) {
- var IDENTIFIER = '[a-zA-Z-_][^\\n{]+\\{';
-
- var PROPERTY = {
- className: 'attribute',
- begin: /[a-zA-Z-_]+/, end: /\s*:/, excludeEnd: true,
- starts: {
- end: ';',
- relevance: 0,
- contains: [
- {
- className: 'variable',
- begin: /\.[a-zA-Z-_]+/
- },
- {
- className: 'keyword',
- begin: /\(optional\)/
- }
- ]
- }
- };
-
- return {
- aliases: ['graph', 'instances'],
- case_insensitive: true,
- keywords: 'import',
- contains: [
- // Facet sections
- {
- begin: '^facet ' + IDENTIFIER,
- end: '}',
- keywords: 'facet',
- contains: [
- PROPERTY,
- hljs.HASH_COMMENT_MODE
- ]
- },
-
- // Instance sections
- {
- begin: '^\\s*instance of ' + IDENTIFIER,
- end: '}',
- keywords: 'name count channels instance-data instance-state instance of',
- illegal: /\S/,
- contains: [
- 'self',
- PROPERTY,
- hljs.HASH_COMMENT_MODE
- ]
- },
-
- // Component sections
- {
- begin: '^' + IDENTIFIER,
- end: '}',
- contains: [
- PROPERTY,
- hljs.HASH_COMMENT_MODE
- ]
- },
-
- // Comments
- hljs.HASH_COMMENT_MODE
- ]
- };
-};
-},{}],247:[function(require,module,exports){
-module.exports = // Colors from RouterOS terminal:
-// green - #0E9A00
-// teal - #0C9A9A
-// purple - #99069A
-// light-brown - #9A9900
-
-function(hljs) {
-
- var STATEMENTS = 'foreach do while for if from to step else on-error and or not in';
-
- // Global commands: Every global command should start with ":" token, otherwise it will be treated as variable.
- var GLOBAL_COMMANDS = 'global local beep delay put len typeof pick log time set find environment terminal error execute parse resolve toarray tobool toid toip toip6 tonum tostr totime';
-
- // Common commands: Following commands available from most sub-menus:
- var COMMON_COMMANDS = 'add remove enable disable set get print export edit find run debug error info warning';
-
- var LITERALS = 'true false yes no nothing nil null';
-
- var OBJECTS = 'traffic-flow traffic-generator firewall scheduler aaa accounting address-list address align area bandwidth-server bfd bgp bridge client clock community config connection console customer default dhcp-client dhcp-server discovery dns e-mail ethernet filter firewall firmware gps graphing group hardware health hotspot identity igmp-proxy incoming instance interface ip ipsec ipv6 irq l2tp-server lcd ldp logging mac-server mac-winbox mangle manual mirror mme mpls nat nd neighbor network note ntp ospf ospf-v3 ovpn-server page peer pim ping policy pool port ppp pppoe-client pptp-server prefix profile proposal proxy queue radius resource rip ripng route routing screen script security-profiles server service service-port settings shares smb sms sniffer snmp snooper socks sstp-server system tool tracking type upgrade upnp user-manager users user vlan secret vrrp watchdog web-access wireless pptp pppoe lan wan layer7-protocol lease simple raw';
-
- // print parameters
- // Several parameters are available for print command:
- // ToDo: var PARAMETERS_PRINT = 'append as-value brief detail count-only file follow follow-only from interval terse value-list without-paging where info';
- // ToDo: var OPERATORS = '&& and ! not || or in ~ ^ & << >> + - * /';
- // ToDo: var TYPES = 'num number bool boolean str string ip ip6-prefix id time array';
- // ToDo: The following tokens serve as delimiters in the grammar: () [] {} : ; $ /
-
- var VAR_PREFIX = 'global local set for foreach';
-
- var VAR = {
- className: 'variable',
- variants: [
- {begin: /\$[\w\d#@][\w\d_]*/},
- {begin: /\$\{(.*?)}/}
- ]
- };
-
- var QUOTE_STRING = {
- className: 'string',
- begin: /"/, end: /"/,
- contains: [
- hljs.BACKSLASH_ESCAPE,
- VAR,
- {
- className: 'variable',
- begin: /\$\(/, end: /\)/,
- contains: [hljs.BACKSLASH_ESCAPE]
- }
- ]
- };
-
- var APOS_STRING = {
- className: 'string',
- begin: /'/, end: /'/
- };
-
- var IPADDR = '((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\b';
- var IPADDR_wBITMASK = IPADDR+'/(3[0-2]|[1-2][0-9]|\\d)';
- //////////////////////////////////////////////////////////////////////
- return {
- aliases: ['routeros', 'mikrotik'],
- case_insensitive: true,
- lexemes: /:?[\w-]+/,
- keywords: {
- literal: LITERALS,
- keyword: STATEMENTS + ' :' + STATEMENTS.split(' ').join(' :') + ' :' + GLOBAL_COMMANDS.split(' ').join(' :'),
- },
- contains: [
- { // недопустимые конструкции
- variants: [
- { begin: /^@/, end: /$/, }, // dns
- { begin: /\/\*/, end: /\*\//, }, // -- comment
- { begin: /%%/, end: /$/, }, // -- comment
- { begin: /^'/, end: /$/, }, // Monkey one line comment
- { begin: /^\s*\/[\w-]+=/, end: /$/, }, // jboss-cli
- { begin: /\/\//, end: /$/, }, // Stan comment
- { begin: /^\[\</, end: /\>\]$/, }, // F# class declaration?
- { begin: /<\//, end: />/, }, // HTML tags
- { begin: /^facet /, end: /\}/, }, // roboconf - лютый костыль )))
- { begin: '^1\\.\\.(\\d+)$', end: /$/, }, // tap
- ],
- illegal: /./,
- },
- hljs.COMMENT('^#', '$'),
- QUOTE_STRING,
- APOS_STRING,
- VAR,
- { // attribute=value
- begin: /[\w-]+\=([^\s\{\}\[\]\(\)]+)/,
- relevance: 0,
- returnBegin: true,
- contains: [
- {
- className: 'attribute',
- begin: /[^=]+/
- },
- {
- begin: /=/,
- endsWithParent: true,
- relevance: 0,
- contains: [
- QUOTE_STRING,
- APOS_STRING,
- VAR,
- {
- className: 'literal',
- begin: '\\b(' + LITERALS.split(' ').join('|') + ')\\b',
- },
- /*{
- // IPv4 addresses and subnets
- className: 'number',
- variants: [
- {begin: IPADDR_wBITMASK+'(,'+IPADDR_wBITMASK+')*'}, //192.168.0.0/24,1.2.3.0/24
- {begin: IPADDR+'-'+IPADDR}, // 192.168.0.1-192.168.0.3
- {begin: IPADDR+'(,'+IPADDR+')*'}, // 192.168.0.1,192.168.0.34,192.168.24.1,192.168.0.1
- ]
- }, // */
- /*{
- // MAC addresses and DHCP Client IDs
- className: 'number',
- begin: /\b(1:)?([0-9A-Fa-f]{1,2}[:-]){5}([0-9A-Fa-f]){1,2}\b/,
- }, //*/
- {
- // Не форматировать не классифицированные значения. Необходимо для исключения подсветки значений как built_in.
- // className: 'number',
- begin: /("[^"]*"|[^\s\{\}\[\]]+)/,
- }, //*/
- ]
- } //*/
- ]
- },//*/
- {
- // HEX values
- className: 'number',
- begin: /\*[0-9a-fA-F]+/,
- }, //*/
-
- {
- begin: '\\b(' + COMMON_COMMANDS.split(' ').join('|') + ')([\\s\[\(]|\])',
- returnBegin: true,
- contains: [
- {
- className: 'builtin-name', //'function',
- begin: /\w+/,
- },
- ],
- },
-
- {
- className: 'built_in',
- variants: [
- {begin: '(\\.\\./|/|\\s)((' + OBJECTS.split(' ').join('|') + ');?\\s)+',relevance: 10,},
- {begin: /\.\./,},
- ],
- },//*/
- ]
- };
-};
-},{}],248:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- keywords: {
- keyword:
- 'float color point normal vector matrix while for if do return else break extern continue',
- built_in:
- 'abs acos ambient area asin atan atmosphere attribute calculatenormal ceil cellnoise ' +
- 'clamp comp concat cos degrees depth Deriv diffuse distance Du Dv environment exp ' +
- 'faceforward filterstep floor format fresnel incident length lightsource log match ' +
- 'max min mod noise normalize ntransform opposite option phong pnoise pow printf ' +
- 'ptlined radians random reflect refract renderinfo round setcomp setxcomp setycomp ' +
- 'setzcomp shadow sign sin smoothstep specular specularbrdf spline sqrt step tan ' +
- 'texture textureinfo trace transform vtransform xcomp ycomp zcomp'
- },
- illegal: '</',
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.APOS_STRING_MODE,
- hljs.C_NUMBER_MODE,
- {
- className: 'meta',
- begin: '#', end: '$'
- },
- {
- className: 'class',
- beginKeywords: 'surface displacement light volume imager', end: '\\('
- },
- {
- beginKeywords: 'illuminate illuminance gather', end: '\\('
- }
- ]
- };
-};
-},{}],249:[function(require,module,exports){
-module.exports = function(hljs) {
- var RUBY_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?';
- var RUBY_KEYWORDS = {
- keyword:
- 'and then defined module in return redo if BEGIN retry end for self when ' +
- 'next until do begin unless END rescue else break undef not super class case ' +
- 'require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor',
- literal:
- 'true false nil'
- };
- var YARDOCTAG = {
- className: 'doctag',
- begin: '@[A-Za-z]+'
- };
- var IRB_OBJECT = {
- begin: '#<', end: '>'
- };
- var COMMENT_MODES = [
- hljs.COMMENT(
- '#',
- '$',
- {
- contains: [YARDOCTAG]
- }
- ),
- hljs.COMMENT(
- '^\\=begin',
- '^\\=end',
- {
- contains: [YARDOCTAG],
- relevance: 10
- }
- ),
- hljs.COMMENT('^__END__', '\\n$')
- ];
- var SUBST = {
- className: 'subst',
- begin: '#\\{', end: '}',
- keywords: RUBY_KEYWORDS
- };
- var STRING = {
- className: 'string',
- contains: [hljs.BACKSLASH_ESCAPE, SUBST],
- variants: [
- {begin: /'/, end: /'/},
- {begin: /"/, end: /"/},
- {begin: /`/, end: /`/},
- {begin: '%[qQwWx]?\\(', end: '\\)'},
- {begin: '%[qQwWx]?\\[', end: '\\]'},
- {begin: '%[qQwWx]?{', end: '}'},
- {begin: '%[qQwWx]?<', end: '>'},
- {begin: '%[qQwWx]?/', end: '/'},
- {begin: '%[qQwWx]?%', end: '%'},
- {begin: '%[qQwWx]?-', end: '-'},
- {begin: '%[qQwWx]?\\|', end: '\\|'},
- {
- // \B in the beginning suppresses recognition of ?-sequences where ?
- // is the last character of a preceding identifier, as in: `func?4`
- begin: /\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/
- },
- {
- begin: /<<(-?)\w+$/, end: /^\s*\w+$/,
- }
- ]
- };
- var PARAMS = {
- className: 'params',
- begin: '\\(', end: '\\)', endsParent: true,
- keywords: RUBY_KEYWORDS
- };
-
- var RUBY_DEFAULT_CONTAINS = [
- STRING,
- IRB_OBJECT,
- {
- className: 'class',
- beginKeywords: 'class module', end: '$|;',
- illegal: /=/,
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {begin: '[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?'}),
- {
- begin: '<\\s*',
- contains: [{
- begin: '(' + hljs.IDENT_RE + '::)?' + hljs.IDENT_RE
- }]
- }
- ].concat(COMMENT_MODES)
- },
- {
- className: 'function',
- beginKeywords: 'def', end: '$|;',
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {begin: RUBY_METHOD_RE}),
- PARAMS
- ].concat(COMMENT_MODES)
- },
- {
- // swallow namespace qualifiers before symbols
- begin: hljs.IDENT_RE + '::'
- },
- {
- className: 'symbol',
- begin: hljs.UNDERSCORE_IDENT_RE + '(\\!|\\?)?:',
- relevance: 0
- },
- {
- className: 'symbol',
- begin: ':(?!\\s)',
- contains: [STRING, {begin: RUBY_METHOD_RE}],
- relevance: 0
- },
- {
- className: 'number',
- begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',
- relevance: 0
- },
- {
- begin: '(\\$\\W)|((\\$|\\@\\@?)(\\w+))' // variables
- },
- {
- className: 'params',
- begin: /\|/, end: /\|/,
- keywords: RUBY_KEYWORDS
- },
- { // regexp container
- begin: '(' + hljs.RE_STARTERS_RE + '|unless)\\s*',
- keywords: 'unless',
- contains: [
- IRB_OBJECT,
- {
- className: 'regexp',
- contains: [hljs.BACKSLASH_ESCAPE, SUBST],
- illegal: /\n/,
- variants: [
- {begin: '/', end: '/[a-z]*'},
- {begin: '%r{', end: '}[a-z]*'},
- {begin: '%r\\(', end: '\\)[a-z]*'},
- {begin: '%r!', end: '![a-z]*'},
- {begin: '%r\\[', end: '\\][a-z]*'}
- ]
- }
- ].concat(COMMENT_MODES),
- relevance: 0
- }
- ].concat(COMMENT_MODES);
-
- SUBST.contains = RUBY_DEFAULT_CONTAINS;
- PARAMS.contains = RUBY_DEFAULT_CONTAINS;
-
- var SIMPLE_PROMPT = "[>?]>";
- var DEFAULT_PROMPT = "[\\w#]+\\(\\w+\\):\\d+:\\d+>";
- var RVM_PROMPT = "(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>";
-
- var IRB_DEFAULT = [
- {
- begin: /^\s*=>/,
- starts: {
- end: '$', contains: RUBY_DEFAULT_CONTAINS
- }
- },
- {
- className: 'meta',
- begin: '^('+SIMPLE_PROMPT+"|"+DEFAULT_PROMPT+'|'+RVM_PROMPT+')',
- starts: {
- end: '$', contains: RUBY_DEFAULT_CONTAINS
- }
- }
- ];
-
- return {
- aliases: ['rb', 'gemspec', 'podspec', 'thor', 'irb'],
- keywords: RUBY_KEYWORDS,
- illegal: /\/\*/,
- contains: COMMENT_MODES.concat(IRB_DEFAULT).concat(RUBY_DEFAULT_CONTAINS)
- };
-};
-},{}],250:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- keywords: {
- keyword: 'BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE ' +
- 'INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 ' +
- 'INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 ' +
- 'INTDCREATEHANDLE|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 ' +
- 'INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 ' +
- 'INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 ' +
- 'INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 ' +
- 'INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 ' +
- 'INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 ' +
- 'INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 ' +
- 'INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 ' +
- 'INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 ' +
- 'INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 ' +
- 'INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 ' +
- 'INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 ' +
- 'MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER ' +
- 'OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE ' +
- 'NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH ' +
- 'IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE RATE_CODE AUXILIARY_DEMAND ' +
- 'UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ' +
- 'ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE ' +
- 'GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE ' +
- 'SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING ' +
- 'DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF ' +
- 'MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY ' +
- 'YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE ' +
- 'COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR ' +
- 'READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ' +
- 'ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE ' +
- 'EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE ' +
- 'SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL ' +
- 'COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN ' +
- 'MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING ' +
- 'FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM ' +
- 'NUMDAYS READ_DATE STAGING',
- built_in: 'IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML ' +
- 'DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT ' +
- 'DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE ' +
- 'DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT ' +
- 'DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME'
- },
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE,
- {
- className: 'literal',
- variants: [
- {begin: '#\\s+[a-zA-Z\\ \\.]*', relevance: 0}, // looks like #-comment
- {begin: '#[a-zA-Z\\ \\.]+'}
- ]
- }
- ]
- };
-};
-},{}],251:[function(require,module,exports){
-module.exports = function(hljs) {
- var NUM_SUFFIX = '([ui](8|16|32|64|128|size)|f(32|64))\?';
- var KEYWORDS =
- 'alignof as be box break const continue crate do else enum extern ' +
- 'false fn for if impl in let loop match mod mut offsetof once priv ' +
- 'proc pub pure ref return self Self sizeof static struct super trait true ' +
- 'type typeof unsafe unsized use virtual while where yield move default';
- var BUILTINS =
- // functions
- 'drop ' +
- // types
- 'i8 i16 i32 i64 i128 isize ' +
- 'u8 u16 u32 u64 u128 usize ' +
- 'f32 f64 ' +
- 'str char bool ' +
- 'Box Option Result String Vec ' +
- // traits
- 'Copy Send Sized Sync Drop Fn FnMut FnOnce ToOwned Clone Debug ' +
- 'PartialEq PartialOrd Eq Ord AsRef AsMut Into From Default Iterator ' +
- 'Extend IntoIterator DoubleEndedIterator ExactSizeIterator ' +
- 'SliceConcatExt ToString ' +
- // macros
- 'assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! ' +
- 'debug_assert! debug_assert_eq! env! panic! file! format! format_args! ' +
- 'include_bin! include_str! line! local_data_key! module_path! ' +
- 'option_env! print! println! select! stringify! try! unimplemented! ' +
- 'unreachable! vec! write! writeln! macro_rules! assert_ne! debug_assert_ne!';
- return {
- aliases: ['rs'],
- keywords: {
- keyword:
- KEYWORDS,
- literal:
- 'true false Some None Ok Err',
- built_in:
- BUILTINS
- },
- lexemes: hljs.IDENT_RE + '!?',
- illegal: '</',
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.COMMENT('/\\*', '\\*/', {contains: ['self']}),
- hljs.inherit(hljs.QUOTE_STRING_MODE, {begin: /b?"/, illegal: null}),
- {
- className: 'string',
- variants: [
- { begin: /r(#*)"(.|\n)*?"\1(?!#)/ },
- { begin: /b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/ }
- ]
- },
- {
- className: 'symbol',
- begin: /'[a-zA-Z_][a-zA-Z0-9_]*/
- },
- {
- className: 'number',
- variants: [
- { begin: '\\b0b([01_]+)' + NUM_SUFFIX },
- { begin: '\\b0o([0-7_]+)' + NUM_SUFFIX },
- { begin: '\\b0x([A-Fa-f0-9_]+)' + NUM_SUFFIX },
- { begin: '\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)' +
- NUM_SUFFIX
- }
- ],
- relevance: 0
- },
- {
- className: 'function',
- beginKeywords: 'fn', end: '(\\(|<)', excludeEnd: true,
- contains: [hljs.UNDERSCORE_TITLE_MODE]
- },
- {
- className: 'meta',
- begin: '#\\!?\\[', end: '\\]',
- contains: [
- {
- className: 'meta-string',
- begin: /"/, end: /"/
- }
- ]
- },
- {
- className: 'class',
- beginKeywords: 'type', end: ';',
- contains: [
- hljs.inherit(hljs.UNDERSCORE_TITLE_MODE, {endsParent: true})
- ],
- illegal: '\\S'
- },
- {
- className: 'class',
- beginKeywords: 'trait enum struct union', end: '{',
- contains: [
- hljs.inherit(hljs.UNDERSCORE_TITLE_MODE, {endsParent: true})
- ],
- illegal: '[\\w\\d]'
- },
- {
- begin: hljs.IDENT_RE + '::',
- keywords: {built_in: BUILTINS}
- },
- {
- begin: '->'
- }
- ]
- };
-};
-},{}],252:[function(require,module,exports){
-module.exports = function(hljs) {
-
- var ANNOTATION = { className: 'meta', begin: '@[A-Za-z]+' };
-
- // used in strings for escaping/interpolation/substitution
- var SUBST = {
- className: 'subst',
- variants: [
- {begin: '\\$[A-Za-z0-9_]+'},
- {begin: '\\${', end: '}'}
- ]
- };
-
- var STRING = {
- className: 'string',
- variants: [
- {
- begin: '"', end: '"',
- illegal: '\\n',
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- begin: '"""', end: '"""',
- relevance: 10
- },
- {
- begin: '[a-z]+"', end: '"',
- illegal: '\\n',
- contains: [hljs.BACKSLASH_ESCAPE, SUBST]
- },
- {
- className: 'string',
- begin: '[a-z]+"""', end: '"""',
- contains: [SUBST],
- relevance: 10
- }
- ]
-
- };
-
- var SYMBOL = {
- className: 'symbol',
- begin: '\'\\w[\\w\\d_]*(?!\')'
- };
-
- var TYPE = {
- className: 'type',
- begin: '\\b[A-Z][A-Za-z0-9_]*',
- relevance: 0
- };
-
- var NAME = {
- className: 'title',
- begin: /[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,
- relevance: 0
- };
-
- var CLASS = {
- className: 'class',
- beginKeywords: 'class object trait type',
- end: /[:={\[\n;]/,
- excludeEnd: true,
- contains: [
- {
- beginKeywords: 'extends with',
- relevance: 10
- },
- {
- begin: /\[/,
- end: /\]/,
- excludeBegin: true,
- excludeEnd: true,
- relevance: 0,
- contains: [TYPE]
- },
- {
- className: 'params',
- begin: /\(/,
- end: /\)/,
- excludeBegin: true,
- excludeEnd: true,
- relevance: 0,
- contains: [TYPE]
- },
- NAME
- ]
- };
-
- var METHOD = {
- className: 'function',
- beginKeywords: 'def',
- end: /[:={\[(\n;]/,
- excludeEnd: true,
- contains: [NAME]
- };
-
- return {
- keywords: {
- literal: 'true false null',
- keyword: 'type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit'
- },
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- STRING,
- SYMBOL,
- TYPE,
- METHOD,
- CLASS,
- hljs.C_NUMBER_MODE,
- ANNOTATION
- ]
- };
-};
-},{}],253:[function(require,module,exports){
-module.exports = function(hljs) {
- var SCHEME_IDENT_RE = '[^\\(\\)\\[\\]\\{\\}",\'`;#|\\\\\\s]+';
- var SCHEME_SIMPLE_NUMBER_RE = '(\\-|\\+)?\\d+([./]\\d+)?';
- var SCHEME_COMPLEX_NUMBER_RE = SCHEME_SIMPLE_NUMBER_RE + '[+\\-]' + SCHEME_SIMPLE_NUMBER_RE + 'i';
- var BUILTINS = {
- 'builtin-name':
- 'case-lambda call/cc class define-class exit-handler field import ' +
- 'inherit init-field interface let*-values let-values let/ec mixin ' +
- 'opt-lambda override protect provide public rename require ' +
- 'require-for-syntax syntax syntax-case syntax-error unit/sig unless ' +
- 'when with-syntax and begin call-with-current-continuation ' +
- 'call-with-input-file call-with-output-file case cond define ' +
- 'define-syntax delay do dynamic-wind else for-each if lambda let let* ' +
- 'let-syntax letrec letrec-syntax map or syntax-rules \' * + , ,@ - ... / ' +
- '; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan ' +
- 'boolean? caar cadr call-with-input-file call-with-output-file ' +
- 'call-with-values car cdddar cddddr cdr ceiling char->integer ' +
- 'char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? ' +
- 'char-downcase char-lower-case? char-numeric? char-ready? char-upcase ' +
- 'char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? ' +
- 'char? close-input-port close-output-port complex? cons cos ' +
- 'current-input-port current-output-port denominator display eof-object? ' +
- 'eq? equal? eqv? eval even? exact->inexact exact? exp expt floor ' +
- 'force gcd imag-part inexact->exact inexact? input-port? integer->char ' +
- 'integer? interaction-environment lcm length list list->string ' +
- 'list->vector list-ref list-tail list? load log magnitude make-polar ' +
- 'make-rectangular make-string make-vector max member memq memv min ' +
- 'modulo negative? newline not null-environment null? number->string ' +
- 'number? numerator odd? open-input-file open-output-file output-port? ' +
- 'pair? peek-char port? positive? procedure? quasiquote quote quotient ' +
- 'rational? rationalize read read-char real-part real? remainder reverse ' +
- 'round scheme-report-environment set! set-car! set-cdr! sin sqrt string ' +
- 'string->list string->number string->symbol string-append string-ci<=? ' +
- 'string-ci<? string-ci=? string-ci>=? string-ci>? string-copy ' +
- 'string-fill! string-length string-ref string-set! string<=? string<? ' +
- 'string=? string>=? string>? string? substring symbol->string symbol? ' +
- 'tan transcript-off transcript-on truncate values vector ' +
- 'vector->list vector-fill! vector-length vector-ref vector-set! ' +
- 'with-input-from-file with-output-to-file write write-char zero?'
- };
-
- var SHEBANG = {
- className: 'meta',
- begin: '^#!',
- end: '$'
- };
-
- var LITERAL = {
- className: 'literal',
- begin: '(#t|#f|#\\\\' + SCHEME_IDENT_RE + '|#\\\\.)'
- };
-
- var NUMBER = {
- className: 'number',
- variants: [
- { begin: SCHEME_SIMPLE_NUMBER_RE, relevance: 0 },
- { begin: SCHEME_COMPLEX_NUMBER_RE, relevance: 0 },
- { begin: '#b[0-1]+(/[0-1]+)?' },
- { begin: '#o[0-7]+(/[0-7]+)?' },
- { begin: '#x[0-9a-f]+(/[0-9a-f]+)?' }
- ]
- };
-
- var STRING = hljs.QUOTE_STRING_MODE;
-
- var REGULAR_EXPRESSION = {
- className: 'regexp',
- begin: '#[pr]x"',
- end: '[^\\\\]"'
- };
-
- var COMMENT_MODES = [
- hljs.COMMENT(
- ';',
- '$',
- {
- relevance: 0
- }
- ),
- hljs.COMMENT('#\\|', '\\|#')
- ];
-
- var IDENT = {
- begin: SCHEME_IDENT_RE,
- relevance: 0
- };
-
- var QUOTED_IDENT = {
- className: 'symbol',
- begin: '\'' + SCHEME_IDENT_RE
- };
-
- var BODY = {
- endsWithParent: true,
- relevance: 0
- };
-
- var QUOTED_LIST = {
- variants: [
- { begin: /'/ },
- { begin: '`' }
- ],
- contains: [
- {
- begin: '\\(', end: '\\)',
- contains: ['self', LITERAL, STRING, NUMBER, IDENT, QUOTED_IDENT]
- }
- ]
- };
-
- var NAME = {
- className: 'name',
- begin: SCHEME_IDENT_RE,
- lexemes: SCHEME_IDENT_RE,
- keywords: BUILTINS
- };
-
- var LAMBDA = {
- begin: /lambda/, endsWithParent: true, returnBegin: true,
- contains: [
- NAME,
- {
- begin: /\(/, end: /\)/, endsParent: true,
- contains: [IDENT],
- }
- ]
- };
-
- var LIST = {
- variants: [
- { begin: '\\(', end: '\\)' },
- { begin: '\\[', end: '\\]' }
- ],
- contains: [LAMBDA, NAME, BODY]
- };
-
- BODY.contains = [LITERAL, NUMBER, STRING, IDENT, QUOTED_IDENT, QUOTED_LIST, LIST].concat(COMMENT_MODES);
-
- return {
- illegal: /\S/,
- contains: [SHEBANG, NUMBER, STRING, QUOTED_IDENT, QUOTED_LIST, LIST].concat(COMMENT_MODES)
- };
-};
-},{}],254:[function(require,module,exports){
-module.exports = function(hljs) {
-
- var COMMON_CONTAINS = [
- hljs.C_NUMBER_MODE,
- {
- className: 'string',
- begin: '\'|\"', end: '\'|\"',
- contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}]
- }
- ];
-
- return {
- aliases: ['sci'],
- lexemes: /%?\w+/,
- keywords: {
- keyword: 'abort break case clear catch continue do elseif else endfunction end for function '+
- 'global if pause return resume select try then while',
- literal:
- '%f %F %t %T %pi %eps %inf %nan %e %i %z %s',
- built_in: // Scilab has more than 2000 functions. Just list the most commons
- 'abs and acos asin atan ceil cd chdir clearglobal cosh cos cumprod deff disp error '+
- 'exec execstr exists exp eye gettext floor fprintf fread fsolve imag isdef isempty '+
- 'isinfisnan isvector lasterror length load linspace list listfiles log10 log2 log '+
- 'max min msprintf mclose mopen ones or pathconvert poly printf prod pwd rand real '+
- 'round sinh sin size gsort sprintf sqrt strcat strcmps tring sum system tanh tan '+
- 'type typename warning zeros matrix'
- },
- illegal: '("|#|/\\*|\\s+/\\w+)',
- contains: [
- {
- className: 'function',
- beginKeywords: 'function', end: '$',
- contains: [
- hljs.UNDERSCORE_TITLE_MODE,
- {
- className: 'params',
- begin: '\\(', end: '\\)'
- }
- ]
- },
- {
- begin: '[a-zA-Z_][a-zA-Z_0-9]*(\'+[\\.\']*|[\\.\']+)', end: '',
- relevance: 0
- },
- {
- begin: '\\[', end: '\\]\'*[\\.\']*',
- relevance: 0,
- contains: COMMON_CONTAINS
- },
- hljs.COMMENT('//', '$')
- ].concat(COMMON_CONTAINS)
- };
-};
-},{}],255:[function(require,module,exports){
-module.exports = function(hljs) {
- var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';
- var VARIABLE = {
- className: 'variable',
- begin: '(\\$' + IDENT_RE + ')\\b'
- };
- var HEXCOLOR = {
- className: 'number', begin: '#[0-9A-Fa-f]+'
- };
- var DEF_INTERNALS = {
- className: 'attribute',
- begin: '[A-Z\\_\\.\\-]+', end: ':',
- excludeEnd: true,
- illegal: '[^\\s]',
- starts: {
- endsWithParent: true, excludeEnd: true,
- contains: [
- HEXCOLOR,
- hljs.CSS_NUMBER_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.APOS_STRING_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- {
- className: 'meta', begin: '!important'
- }
- ]
- }
- };
- return {
- case_insensitive: true,
- illegal: '[=/|\']',
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- {
- className: 'selector-id', begin: '\\#[A-Za-z0-9_-]+',
- relevance: 0
- },
- {
- className: 'selector-class', begin: '\\.[A-Za-z0-9_-]+',
- relevance: 0
- },
- {
- className: 'selector-attr', begin: '\\[', end: '\\]',
- illegal: '$'
- },
- {
- className: 'selector-tag', // begin: IDENT_RE, end: '[,|\\s]'
- begin: '\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b',
- relevance: 0
- },
- {
- begin: ':(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)'
- },
- {
- begin: '::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)'
- },
- VARIABLE,
- {
- className: 'attribute',
- begin: '\\b(z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b',
- illegal: '[^\\s]'
- },
- {
- begin: '\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b'
- },
- {
- begin: ':', end: ';',
- contains: [
- VARIABLE,
- HEXCOLOR,
- hljs.CSS_NUMBER_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.APOS_STRING_MODE,
- {
- className: 'meta', begin: '!important'
- }
- ]
- },
- {
- begin: '@', end: '[{;]',
- keywords: 'mixin include extend for if else each while charset import debug media page content font-face namespace warn',
- contains: [
- VARIABLE,
- hljs.QUOTE_STRING_MODE,
- hljs.APOS_STRING_MODE,
- HEXCOLOR,
- hljs.CSS_NUMBER_MODE,
- {
- begin: '\\s[A-Za-z0-9_.-]+',
- relevance: 0
- }
- ]
- }
- ]
- };
-};
-},{}],256:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['console'],
- contains: [
- {
- className: 'meta',
- begin: '^\\s{0,3}[\\w\\d\\[\\]()@-]*[>%$#]',
- starts: {
- end: '$', subLanguage: 'bash'
- }
- },
- ]
- }
-};
-},{}],257:[function(require,module,exports){
-module.exports = function(hljs) {
- var smali_instr_low_prio = ['add', 'and', 'cmp', 'cmpg', 'cmpl', 'const', 'div', 'double', 'float', 'goto', 'if', 'int', 'long', 'move', 'mul', 'neg', 'new', 'nop', 'not', 'or', 'rem', 'return', 'shl', 'shr', 'sput', 'sub', 'throw', 'ushr', 'xor'];
- var smali_instr_high_prio = ['aget', 'aput', 'array', 'check', 'execute', 'fill', 'filled', 'goto/16', 'goto/32', 'iget', 'instance', 'invoke', 'iput', 'monitor', 'packed', 'sget', 'sparse'];
- var smali_keywords = ['transient', 'constructor', 'abstract', 'final', 'synthetic', 'public', 'private', 'protected', 'static', 'bridge', 'system'];
- return {
- aliases: ['smali'],
- contains: [
- {
- className: 'string',
- begin: '"', end: '"',
- relevance: 0
- },
- hljs.COMMENT(
- '#',
- '$',
- {
- relevance: 0
- }
- ),
- {
- className: 'keyword',
- variants: [
- {begin: '\\s*\\.end\\s[a-zA-Z0-9]*'},
- {begin: '^[ ]*\\.[a-zA-Z]*', relevance: 0},
- {begin: '\\s:[a-zA-Z_0-9]*', relevance: 0},
- {begin: '\\s(' + smali_keywords.join('|') + ')'}
- ]
- },
- {
- className: 'built_in',
- variants : [
- {
- begin: '\\s('+smali_instr_low_prio.join('|')+')\\s'
- },
- {
- begin: '\\s('+smali_instr_low_prio.join('|')+')((\\-|/)[a-zA-Z0-9]+)+\\s',
- relevance: 10
- },
- {
- begin: '\\s('+smali_instr_high_prio.join('|')+')((\\-|/)[a-zA-Z0-9]+)*\\s',
- relevance: 10
- },
- ]
- },
- {
- className: 'class',
- begin: 'L[^\(;:\n]*;',
- relevance: 0
- },
- {
- begin: '[vp][0-9]+',
- }
- ]
- };
-};
-},{}],258:[function(require,module,exports){
-module.exports = function(hljs) {
- var VAR_IDENT_RE = '[a-z][a-zA-Z0-9_]*';
- var CHAR = {
- className: 'string',
- begin: '\\$.{1}'
- };
- var SYMBOL = {
- className: 'symbol',
- begin: '#' + hljs.UNDERSCORE_IDENT_RE
- };
- return {
- aliases: ['st'],
- keywords: 'self super nil true false thisContext', // only 6
- contains: [
- hljs.COMMENT('"', '"'),
- hljs.APOS_STRING_MODE,
- {
- className: 'type',
- begin: '\\b[A-Z][A-Za-z0-9_]*',
- relevance: 0
- },
- {
- begin: VAR_IDENT_RE + ':',
- relevance: 0
- },
- hljs.C_NUMBER_MODE,
- SYMBOL,
- CHAR,
- {
- // This looks more complicated than needed to avoid combinatorial
- // explosion under V8. It effectively means `| var1 var2 ... |` with
- // whitespace adjacent to `|` being optional.
- begin: '\\|[ ]*' + VAR_IDENT_RE + '([ ]+' + VAR_IDENT_RE + ')*[ ]*\\|',
- returnBegin: true, end: /\|/,
- illegal: /\S/,
- contains: [{begin: '(\\|[ ]*)?' + VAR_IDENT_RE}]
- },
- {
- begin: '\\#\\(', end: '\\)',
- contains: [
- hljs.APOS_STRING_MODE,
- CHAR,
- hljs.C_NUMBER_MODE,
- SYMBOL
- ]
- }
- ]
- };
-};
-},{}],259:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['ml'],
- keywords: {
- keyword:
- /* according to Definition of Standard ML 97 */
- 'abstype and andalso as case datatype do else end eqtype ' +
- 'exception fn fun functor handle if in include infix infixr ' +
- 'let local nonfix of op open orelse raise rec sharing sig ' +
- 'signature struct structure then type val with withtype where while',
- built_in:
- /* built-in types according to basis library */
- 'array bool char exn int list option order real ref string substring vector unit word',
- literal:
- 'true false NONE SOME LESS EQUAL GREATER nil'
- },
- illegal: /\/\/|>>/,
- lexemes: '[a-z_]\\w*!?',
- contains: [
- {
- className: 'literal',
- begin: /\[(\|\|)?\]|\(\)/,
- relevance: 0
- },
- hljs.COMMENT(
- '\\(\\*',
- '\\*\\)',
- {
- contains: ['self']
- }
- ),
- { /* type variable */
- className: 'symbol',
- begin: '\'[A-Za-z_](?!\')[\\w\']*'
- /* the grammar is ambiguous on how 'a'b should be interpreted but not the compiler */
- },
- { /* polymorphic variant */
- className: 'type',
- begin: '`[A-Z][\\w\']*'
- },
- { /* module or constructor */
- className: 'type',
- begin: '\\b[A-Z][\\w\']*',
- relevance: 0
- },
- { /* don't color identifiers, but safely catch all identifiers with '*/
- begin: '[a-z_]\\w*\'[\\w\']*'
- },
- hljs.inherit(hljs.APOS_STRING_MODE, {className: 'string', relevance: 0}),
- hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}),
- {
- className: 'number',
- begin:
- '\\b(0[xX][a-fA-F0-9_]+[Lln]?|' +
- '0[oO][0-7_]+[Lln]?|' +
- '0[bB][01_]+[Lln]?|' +
- '[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)',
- relevance: 0
- },
- {
- begin: /[-=]>/ // relevance booster
- }
- ]
- };
-};
-},{}],260:[function(require,module,exports){
-module.exports = function(hljs) {
- var CPP = hljs.getLanguage('cpp').exports;
-
- // In SQF, a variable start with _
- var VARIABLE = {
- className: 'variable',
- begin: /\b_+[a-zA-Z_]\w*/
- };
-
- // In SQF, a function should fit myTag_fnc_myFunction pattern
- // https://community.bistudio.com/wiki/Functions_Library_(Arma_3)#Adding_a_Function
- var FUNCTION = {
- className: 'title',
- begin: /[a-zA-Z][a-zA-Z0-9]+_fnc_\w*/
- };
-
- // In SQF strings, quotes matching the start are escaped by adding a consecutive.
- // Example of single escaped quotes: " "" " and ' '' '.
- var STRINGS = {
- className: 'string',
- variants: [
- {
- begin: '"',
- end: '"',
- contains: [{begin: '""', relevance: 0}]
- },
- {
- begin: '\'',
- end: '\'',
- contains: [{begin: '\'\'', relevance: 0}]
- }
- ]
- };
-
- return {
- aliases: ['sqf'],
- case_insensitive: true,
- keywords: {
- keyword:
- 'case catch default do else exit exitWith for forEach from if ' +
- 'switch then throw to try waitUntil while with',
- built_in:
- 'abs accTime acos action actionIDs actionKeys actionKeysImages actionKeysNames ' +
- 'actionKeysNamesArray actionName actionParams activateAddons activatedAddons activateKey ' +
- 'add3DENConnection add3DENEventHandler add3DENLayer addAction addBackpack addBackpackCargo ' +
- 'addBackpackCargoGlobal addBackpackGlobal addCamShake addCuratorAddons addCuratorCameraArea ' +
- 'addCuratorEditableObjects addCuratorEditingArea addCuratorPoints addEditorObject addEventHandler ' +
- 'addGoggles addGroupIcon addHandgunItem addHeadgear addItem addItemCargo addItemCargoGlobal ' +
- 'addItemPool addItemToBackpack addItemToUniform addItemToVest addLiveStats addMagazine ' +
- 'addMagazineAmmoCargo addMagazineCargo addMagazineCargoGlobal addMagazineGlobal addMagazinePool ' +
- 'addMagazines addMagazineTurret addMenu addMenuItem addMissionEventHandler addMPEventHandler ' +
- 'addMusicEventHandler addOwnedMine addPlayerScores addPrimaryWeaponItem ' +
- 'addPublicVariableEventHandler addRating addResources addScore addScoreSide addSecondaryWeaponItem ' +
- 'addSwitchableUnit addTeamMember addToRemainsCollector addUniform addVehicle addVest addWaypoint ' +
- 'addWeapon addWeaponCargo addWeaponCargoGlobal addWeaponGlobal addWeaponItem addWeaponPool ' +
- 'addWeaponTurret agent agents AGLToASL aimedAtTarget aimPos airDensityRTD airportSide ' +
- 'AISFinishHeal alive all3DENEntities allControls allCurators allCutLayers allDead allDeadMen ' +
- 'allDisplays allGroups allMapMarkers allMines allMissionObjects allow3DMode allowCrewInImmobile ' +
- 'allowCuratorLogicIgnoreAreas allowDamage allowDammage allowFileOperations allowFleeing allowGetIn ' +
- 'allowSprint allPlayers allSites allTurrets allUnits allUnitsUAV allVariables ammo and animate ' +
- 'animateDoor animateSource animationNames animationPhase animationSourcePhase animationState ' +
- 'append apply armoryPoints arrayIntersect asin ASLToAGL ASLToATL assert assignAsCargo ' +
- 'assignAsCargoIndex assignAsCommander assignAsDriver assignAsGunner assignAsTurret assignCurator ' +
- 'assignedCargo assignedCommander assignedDriver assignedGunner assignedItems assignedTarget ' +
- 'assignedTeam assignedVehicle assignedVehicleRole assignItem assignTeam assignToAirport atan atan2 ' +
- 'atg ATLToASL attachedObject attachedObjects attachedTo attachObject attachTo attackEnabled ' +
- 'backpack backpackCargo backpackContainer backpackItems backpackMagazines backpackSpaceFor ' +
- 'behaviour benchmark binocular blufor boundingBox boundingBoxReal boundingCenter breakOut breakTo ' +
- 'briefingName buildingExit buildingPos buttonAction buttonSetAction cadetMode call callExtension ' +
- 'camCommand camCommit camCommitPrepared camCommitted camConstuctionSetParams camCreate camDestroy ' +
- 'cameraEffect cameraEffectEnableHUD cameraInterest cameraOn cameraView campaignConfigFile ' +
- 'camPreload camPreloaded camPrepareBank camPrepareDir camPrepareDive camPrepareFocus camPrepareFov ' +
- 'camPrepareFovRange camPreparePos camPrepareRelPos camPrepareTarget camSetBank camSetDir ' +
- 'camSetDive camSetFocus camSetFov camSetFovRange camSetPos camSetRelPos camSetTarget camTarget ' +
- 'camUseNVG canAdd canAddItemToBackpack canAddItemToUniform canAddItemToVest ' +
- 'cancelSimpleTaskDestination canFire canMove canSlingLoad canStand canSuspend canUnloadInCombat ' +
- 'canVehicleCargo captive captiveNum cbChecked cbSetChecked ceil channelEnabled cheatsEnabled ' +
- 'checkAIFeature checkVisibility civilian className clearAllItemsFromBackpack clearBackpackCargo ' +
- 'clearBackpackCargoGlobal clearGroupIcons clearItemCargo clearItemCargoGlobal clearItemPool ' +
- 'clearMagazineCargo clearMagazineCargoGlobal clearMagazinePool clearOverlay clearRadio ' +
- 'clearWeaponCargo clearWeaponCargoGlobal clearWeaponPool clientOwner closeDialog closeDisplay ' +
- 'closeOverlay collapseObjectTree collect3DENHistory combatMode commandArtilleryFire commandChat ' +
- 'commander commandFire commandFollow commandFSM commandGetOut commandingMenu commandMove ' +
- 'commandRadio commandStop commandSuppressiveFire commandTarget commandWatch comment commitOverlay ' +
- 'compile compileFinal completedFSM composeText configClasses configFile configHierarchy configName ' +
- 'configNull configProperties configSourceAddonList configSourceMod configSourceModList ' +
- 'connectTerminalToUAV controlNull controlsGroupCtrl copyFromClipboard copyToClipboard ' +
- 'copyWaypoints cos count countEnemy countFriendly countSide countType countUnknown ' +
- 'create3DENComposition create3DENEntity createAgent createCenter createDialog createDiaryLink ' +
- 'createDiaryRecord createDiarySubject createDisplay createGearDialog createGroup ' +
- 'createGuardedPoint createLocation createMarker createMarkerLocal createMenu createMine ' +
- 'createMissionDisplay createMPCampaignDisplay createSimpleObject createSimpleTask createSite ' +
- 'createSoundSource createTask createTeam createTrigger createUnit createVehicle createVehicleCrew ' +
- 'createVehicleLocal crew ctrlActivate ctrlAddEventHandler ctrlAngle ctrlAutoScrollDelay ' +
- 'ctrlAutoScrollRewind ctrlAutoScrollSpeed ctrlChecked ctrlClassName ctrlCommit ctrlCommitted ' +
- 'ctrlCreate ctrlDelete ctrlEnable ctrlEnabled ctrlFade ctrlHTMLLoaded ctrlIDC ctrlIDD ' +
- 'ctrlMapAnimAdd ctrlMapAnimClear ctrlMapAnimCommit ctrlMapAnimDone ctrlMapCursor ctrlMapMouseOver ' +
- 'ctrlMapScale ctrlMapScreenToWorld ctrlMapWorldToScreen ctrlModel ctrlModelDirAndUp ctrlModelScale ' +
- 'ctrlParent ctrlParentControlsGroup ctrlPosition ctrlRemoveAllEventHandlers ctrlRemoveEventHandler ' +
- 'ctrlScale ctrlSetActiveColor ctrlSetAngle ctrlSetAutoScrollDelay ctrlSetAutoScrollRewind ' +
- 'ctrlSetAutoScrollSpeed ctrlSetBackgroundColor ctrlSetChecked ctrlSetEventHandler ctrlSetFade ' +
- 'ctrlSetFocus ctrlSetFont ctrlSetFontH1 ctrlSetFontH1B ctrlSetFontH2 ctrlSetFontH2B ctrlSetFontH3 ' +
- 'ctrlSetFontH3B ctrlSetFontH4 ctrlSetFontH4B ctrlSetFontH5 ctrlSetFontH5B ctrlSetFontH6 ' +
- 'ctrlSetFontH6B ctrlSetFontHeight ctrlSetFontHeightH1 ctrlSetFontHeightH2 ctrlSetFontHeightH3 ' +
- 'ctrlSetFontHeightH4 ctrlSetFontHeightH5 ctrlSetFontHeightH6 ctrlSetFontHeightSecondary ' +
- 'ctrlSetFontP ctrlSetFontPB ctrlSetFontSecondary ctrlSetForegroundColor ctrlSetModel ' +
- 'ctrlSetModelDirAndUp ctrlSetModelScale ctrlSetPosition ctrlSetScale ctrlSetStructuredText ' +
- 'ctrlSetText ctrlSetTextColor ctrlSetTooltip ctrlSetTooltipColorBox ctrlSetTooltipColorShade ' +
- 'ctrlSetTooltipColorText ctrlShow ctrlShown ctrlText ctrlTextHeight ctrlType ctrlVisible ' +
- 'curatorAddons curatorCamera curatorCameraArea curatorCameraAreaCeiling curatorCoef ' +
- 'curatorEditableObjects curatorEditingArea curatorEditingAreaType curatorMouseOver curatorPoints ' +
- 'curatorRegisteredObjects curatorSelected curatorWaypointCost current3DENOperation currentChannel ' +
- 'currentCommand currentMagazine currentMagazineDetail currentMagazineDetailTurret ' +
- 'currentMagazineTurret currentMuzzle currentNamespace currentTask currentTasks currentThrowable ' +
- 'currentVisionMode currentWaypoint currentWeapon currentWeaponMode currentWeaponTurret ' +
- 'currentZeroing cursorObject cursorTarget customChat customRadio cutFadeOut cutObj cutRsc cutText ' +
- 'damage date dateToNumber daytime deActivateKey debriefingText debugFSM debugLog deg ' +
- 'delete3DENEntities deleteAt deleteCenter deleteCollection deleteEditorObject deleteGroup ' +
- 'deleteIdentity deleteLocation deleteMarker deleteMarkerLocal deleteRange deleteResources ' +
- 'deleteSite deleteStatus deleteTeam deleteVehicle deleteVehicleCrew deleteWaypoint detach ' +
- 'detectedMines diag_activeMissionFSMs diag_activeScripts diag_activeSQFScripts ' +
- 'diag_activeSQSScripts diag_captureFrame diag_captureSlowFrame diag_codePerformance diag_drawMode ' +
- 'diag_enable diag_enabled diag_fps diag_fpsMin diag_frameNo diag_list diag_log diag_logSlowFrame ' +
- 'diag_mergeConfigFile diag_recordTurretLimits diag_tickTime diag_toggle dialog diarySubjectExists ' +
- 'didJIP didJIPOwner difficulty difficultyEnabled difficultyEnabledRTD difficultyOption direction ' +
- 'directSay disableAI disableCollisionWith disableConversation disableDebriefingStats ' +
- 'disableNVGEquipment disableRemoteSensors disableSerialization disableTIEquipment ' +
- 'disableUAVConnectability disableUserInput displayAddEventHandler displayCtrl displayNull ' +
- 'displayParent displayRemoveAllEventHandlers displayRemoveEventHandler displaySetEventHandler ' +
- 'dissolveTeam distance distance2D distanceSqr distributionRegion do3DENAction doArtilleryFire ' +
- 'doFire doFollow doFSM doGetOut doMove doorPhase doStop doSuppressiveFire doTarget doWatch ' +
- 'drawArrow drawEllipse drawIcon drawIcon3D drawLine drawLine3D drawLink drawLocation drawPolygon ' +
- 'drawRectangle driver drop east echo edit3DENMissionAttributes editObject editorSetEventHandler ' +
- 'effectiveCommander emptyPositions enableAI enableAIFeature enableAimPrecision enableAttack ' +
- 'enableAudioFeature enableCamShake enableCaustics enableChannel enableCollisionWith enableCopilot ' +
- 'enableDebriefingStats enableDiagLegend enableEndDialog enableEngineArtillery enableEnvironment ' +
- 'enableFatigue enableGunLights enableIRLasers enableMimics enablePersonTurret enableRadio ' +
- 'enableReload enableRopeAttach enableSatNormalOnDetail enableSaving enableSentences ' +
- 'enableSimulation enableSimulationGlobal enableStamina enableTeamSwitch enableUAVConnectability ' +
- 'enableUAVWaypoints enableVehicleCargo endLoadingScreen endMission engineOn enginesIsOnRTD ' +
- 'enginesRpmRTD enginesTorqueRTD entities estimatedEndServerTime estimatedTimeLeft ' +
- 'evalObjectArgument everyBackpack everyContainer exec execEditorScript execFSM execVM exp ' +
- 'expectedDestination exportJIPMessages eyeDirection eyePos face faction fadeMusic fadeRadio ' +
- 'fadeSound fadeSpeech failMission fillWeaponsFromPool find findCover findDisplay findEditorObject ' +
- 'findEmptyPosition findEmptyPositionReady findNearestEnemy finishMissionInit finite fire ' +
- 'fireAtTarget firstBackpack flag flagOwner flagSide flagTexture fleeing floor flyInHeight ' +
- 'flyInHeightASL fog fogForecast fogParams forceAddUniform forcedMap forceEnd forceMap forceRespawn ' +
- 'forceSpeed forceWalk forceWeaponFire forceWeatherChange forEachMember forEachMemberAgent ' +
- 'forEachMemberTeam format formation formationDirection formationLeader formationMembers ' +
- 'formationPosition formationTask formatText formLeader freeLook fromEditor fuel fullCrew ' +
- 'gearIDCAmmoCount gearSlotAmmoCount gearSlotData get3DENActionState get3DENAttribute get3DENCamera ' +
- 'get3DENConnections get3DENEntity get3DENEntityID get3DENGrid get3DENIconsVisible ' +
- 'get3DENLayerEntities get3DENLinesVisible get3DENMissionAttribute get3DENMouseOver get3DENSelected ' +
- 'getAimingCoef getAllHitPointsDamage getAllOwnedMines getAmmoCargo getAnimAimPrecision ' +
- 'getAnimSpeedCoef getArray getArtilleryAmmo getArtilleryComputerSettings getArtilleryETA ' +
- 'getAssignedCuratorLogic getAssignedCuratorUnit getBackpackCargo getBleedingRemaining ' +
- 'getBurningValue getCameraViewDirection getCargoIndex getCenterOfMass getClientState ' +
- 'getClientStateNumber getConnectedUAV getCustomAimingCoef getDammage getDescription getDir ' +
- 'getDirVisual getDLCs getEditorCamera getEditorMode getEditorObjectScope getElevationOffset ' +
- 'getFatigue getFriend getFSMVariable getFuelCargo getGroupIcon getGroupIconParams getGroupIcons ' +
- 'getHideFrom getHit getHitIndex getHitPointDamage getItemCargo getMagazineCargo getMarkerColor ' +
- 'getMarkerPos getMarkerSize getMarkerType getMass getMissionConfig getMissionConfigValue ' +
- 'getMissionDLCs getMissionLayerEntities getModelInfo getMousePosition getNumber getObjectArgument ' +
- 'getObjectChildren getObjectDLC getObjectMaterials getObjectProxy getObjectTextures getObjectType ' +
- 'getObjectViewDistance getOxygenRemaining getPersonUsedDLCs getPilotCameraDirection ' +
- 'getPilotCameraPosition getPilotCameraRotation getPilotCameraTarget getPlayerChannel ' +
- 'getPlayerScores getPlayerUID getPos getPosASL getPosASLVisual getPosASLW getPosATL ' +
- 'getPosATLVisual getPosVisual getPosWorld getRelDir getRelPos getRemoteSensorsDisabled ' +
- 'getRepairCargo getResolution getShadowDistance getShotParents getSlingLoad getSpeed getStamina ' +
- 'getStatValue getSuppression getTerrainHeightASL getText getUnitLoadout getUnitTrait getVariable ' +
- 'getVehicleCargo getWeaponCargo getWeaponSway getWPPos glanceAt globalChat globalRadio goggles ' +
- 'goto group groupChat groupFromNetId groupIconSelectable groupIconsVisible groupId groupOwner ' +
- 'groupRadio groupSelectedUnits groupSelectUnit grpNull gunner gusts halt handgunItems ' +
- 'handgunMagazine handgunWeapon handsHit hasInterface hasPilotCamera hasWeapon hcAllGroups ' +
- 'hcGroupParams hcLeader hcRemoveAllGroups hcRemoveGroup hcSelected hcSelectGroup hcSetGroup ' +
- 'hcShowBar hcShownBar headgear hideBody hideObject hideObjectGlobal hideSelection hint hintC ' +
- 'hintCadet hintSilent hmd hostMission htmlLoad HUDMovementLevels humidity image importAllGroups ' +
- 'importance in inArea inAreaArray incapacitatedState independent inflame inflamed ' +
- 'inGameUISetEventHandler inheritsFrom initAmbientLife inPolygon inputAction inRangeOfArtillery ' +
- 'insertEditorObject intersect is3DEN is3DENMultiplayer isAbleToBreathe isAgent isArray ' +
- 'isAutoHoverOn isAutonomous isAutotest isBleeding isBurning isClass isCollisionLightOn ' +
- 'isCopilotEnabled isDedicated isDLCAvailable isEngineOn isEqualTo isEqualType isEqualTypeAll ' +
- 'isEqualTypeAny isEqualTypeArray isEqualTypeParams isFilePatchingEnabled isFlashlightOn ' +
- 'isFlatEmpty isForcedWalk isFormationLeader isHidden isInRemainsCollector ' +
- 'isInstructorFigureEnabled isIRLaserOn isKeyActive isKindOf isLightOn isLocalized isManualFire ' +
- 'isMarkedForCollection isMultiplayer isMultiplayerSolo isNil isNull isNumber isObjectHidden ' +
- 'isObjectRTD isOnRoad isPipEnabled isPlayer isRealTime isRemoteExecuted isRemoteExecutedJIP ' +
- 'isServer isShowing3DIcons isSprintAllowed isStaminaEnabled isSteamMission ' +
- 'isStreamFriendlyUIEnabled isText isTouchingGround isTurnedOut isTutHintsEnabled isUAVConnectable ' +
- 'isUAVConnected isUniformAllowed isVehicleCargo isWalking isWeaponDeployed isWeaponRested ' +
- 'itemCargo items itemsWithMagazines join joinAs joinAsSilent joinSilent joinString kbAddDatabase ' +
- 'kbAddDatabaseTargets kbAddTopic kbHasTopic kbReact kbRemoveTopic kbTell kbWasSaid keyImage ' +
- 'keyName knowsAbout land landAt landResult language laserTarget lbAdd lbClear lbColor lbCurSel ' +
- 'lbData lbDelete lbIsSelected lbPicture lbSelection lbSetColor lbSetCurSel lbSetData lbSetPicture ' +
- 'lbSetPictureColor lbSetPictureColorDisabled lbSetPictureColorSelected lbSetSelectColor ' +
- 'lbSetSelectColorRight lbSetSelected lbSetTooltip lbSetValue lbSize lbSort lbSortByValue lbText ' +
- 'lbValue leader leaderboardDeInit leaderboardGetRows leaderboardInit leaveVehicle libraryCredits ' +
- 'libraryDisclaimers lifeState lightAttachObject lightDetachObject lightIsOn lightnings limitSpeed ' +
- 'linearConversion lineBreak lineIntersects lineIntersectsObjs lineIntersectsSurfaces ' +
- 'lineIntersectsWith linkItem list listObjects ln lnbAddArray lnbAddColumn lnbAddRow lnbClear ' +
- 'lnbColor lnbCurSelRow lnbData lnbDeleteColumn lnbDeleteRow lnbGetColumnsPosition lnbPicture ' +
- 'lnbSetColor lnbSetColumnsPos lnbSetCurSelRow lnbSetData lnbSetPicture lnbSetText lnbSetValue ' +
- 'lnbSize lnbText lnbValue load loadAbs loadBackpack loadFile loadGame loadIdentity loadMagazine ' +
- 'loadOverlay loadStatus loadUniform loadVest local localize locationNull locationPosition lock ' +
- 'lockCameraTo lockCargo lockDriver locked lockedCargo lockedDriver lockedTurret lockIdentity ' +
- 'lockTurret lockWP log logEntities logNetwork logNetworkTerminate lookAt lookAtPos magazineCargo ' +
- 'magazines magazinesAllTurrets magazinesAmmo magazinesAmmoCargo magazinesAmmoFull magazinesDetail ' +
- 'magazinesDetailBackpack magazinesDetailUniform magazinesDetailVest magazinesTurret ' +
- 'magazineTurretAmmo mapAnimAdd mapAnimClear mapAnimCommit mapAnimDone mapCenterOnCamera ' +
- 'mapGridPosition markAsFinishedOnSteam markerAlpha markerBrush markerColor markerDir markerPos ' +
- 'markerShape markerSize markerText markerType max members menuAction menuAdd menuChecked menuClear ' +
- 'menuCollapse menuData menuDelete menuEnable menuEnabled menuExpand menuHover menuPicture ' +
- 'menuSetAction menuSetCheck menuSetData menuSetPicture menuSetValue menuShortcut menuShortcutText ' +
- 'menuSize menuSort menuText menuURL menuValue min mineActive mineDetectedBy missionConfigFile ' +
- 'missionDifficulty missionName missionNamespace missionStart missionVersion mod modelToWorld ' +
- 'modelToWorldVisual modParams moonIntensity moonPhase morale move move3DENCamera moveInAny ' +
- 'moveInCargo moveInCommander moveInDriver moveInGunner moveInTurret moveObjectToEnd moveOut ' +
- 'moveTime moveTo moveToCompleted moveToFailed musicVolume name nameSound nearEntities ' +
- 'nearestBuilding nearestLocation nearestLocations nearestLocationWithDubbing nearestObject ' +
- 'nearestObjects nearestTerrainObjects nearObjects nearObjectsReady nearRoads nearSupplies ' +
- 'nearTargets needReload netId netObjNull newOverlay nextMenuItemIndex nextWeatherChange nMenuItems ' +
- 'not numberToDate objectCurators objectFromNetId objectParent objNull objStatus onBriefingGroup ' +
- 'onBriefingNotes onBriefingPlan onBriefingTeamSwitch onCommandModeChanged onDoubleClick ' +
- 'onEachFrame onGroupIconClick onGroupIconOverEnter onGroupIconOverLeave onHCGroupSelectionChanged ' +
- 'onMapSingleClick onPlayerConnected onPlayerDisconnected onPreloadFinished onPreloadStarted ' +
- 'onShowNewObject onTeamSwitch openCuratorInterface openDLCPage openMap openYoutubeVideo opfor or ' +
- 'orderGetIn overcast overcastForecast owner param params parseNumber parseText parsingNamespace ' +
- 'particlesQuality pi pickWeaponPool pitch pixelGrid pixelGridBase pixelGridNoUIScale pixelH pixelW ' +
- 'playableSlotsNumber playableUnits playAction playActionNow player playerRespawnTime playerSide ' +
- 'playersNumber playGesture playMission playMove playMoveNow playMusic playScriptedMission ' +
- 'playSound playSound3D position positionCameraToWorld posScreenToWorld posWorldToScreen ' +
- 'ppEffectAdjust ppEffectCommit ppEffectCommitted ppEffectCreate ppEffectDestroy ppEffectEnable ' +
- 'ppEffectEnabled ppEffectForceInNVG precision preloadCamera preloadObject preloadSound ' +
- 'preloadTitleObj preloadTitleRsc preprocessFile preprocessFileLineNumbers primaryWeapon ' +
- 'primaryWeaponItems primaryWeaponMagazine priority private processDiaryLink productVersion ' +
- 'profileName profileNamespace profileNameSteam progressLoadingScreen progressPosition ' +
- 'progressSetPosition publicVariable publicVariableClient publicVariableServer pushBack ' +
- 'pushBackUnique putWeaponPool queryItemsPool queryMagazinePool queryWeaponPool rad radioChannelAdd ' +
- 'radioChannelCreate radioChannelRemove radioChannelSetCallSign radioChannelSetLabel radioVolume ' +
- 'rain rainbow random rank rankId rating rectangular registeredTasks registerTask reload ' +
- 'reloadEnabled remoteControl remoteExec remoteExecCall remove3DENConnection remove3DENEventHandler ' +
- 'remove3DENLayer removeAction removeAll3DENEventHandlers removeAllActions removeAllAssignedItems ' +
- 'removeAllContainers removeAllCuratorAddons removeAllCuratorCameraAreas ' +
- 'removeAllCuratorEditingAreas removeAllEventHandlers removeAllHandgunItems removeAllItems ' +
- 'removeAllItemsWithMagazines removeAllMissionEventHandlers removeAllMPEventHandlers ' +
- 'removeAllMusicEventHandlers removeAllOwnedMines removeAllPrimaryWeaponItems removeAllWeapons ' +
- 'removeBackpack removeBackpackGlobal removeCuratorAddons removeCuratorCameraArea ' +
- 'removeCuratorEditableObjects removeCuratorEditingArea removeDrawIcon removeDrawLinks ' +
- 'removeEventHandler removeFromRemainsCollector removeGoggles removeGroupIcon removeHandgunItem ' +
- 'removeHeadgear removeItem removeItemFromBackpack removeItemFromUniform removeItemFromVest ' +
- 'removeItems removeMagazine removeMagazineGlobal removeMagazines removeMagazinesTurret ' +
- 'removeMagazineTurret removeMenuItem removeMissionEventHandler removeMPEventHandler ' +
- 'removeMusicEventHandler removeOwnedMine removePrimaryWeaponItem removeSecondaryWeaponItem ' +
- 'removeSimpleTask removeSwitchableUnit removeTeamMember removeUniform removeVest removeWeapon ' +
- 'removeWeaponGlobal removeWeaponTurret requiredVersion resetCamShake resetSubgroupDirection ' +
- 'resistance resize resources respawnVehicle restartEditorCamera reveal revealMine reverse ' +
- 'reversedMouseY roadAt roadsConnectedTo roleDescription ropeAttachedObjects ropeAttachedTo ' +
- 'ropeAttachEnabled ropeAttachTo ropeCreate ropeCut ropeDestroy ropeDetach ropeEndPosition ' +
- 'ropeLength ropes ropeUnwind ropeUnwound rotorsForcesRTD rotorsRpmRTD round runInitScript ' +
- 'safeZoneH safeZoneW safeZoneWAbs safeZoneX safeZoneXAbs safeZoneY save3DENInventory saveGame ' +
- 'saveIdentity saveJoysticks saveOverlay saveProfileNamespace saveStatus saveVar savingEnabled say ' +
- 'say2D say3D scopeName score scoreSide screenshot screenToWorld scriptDone scriptName scriptNull ' +
- 'scudState secondaryWeapon secondaryWeaponItems secondaryWeaponMagazine select selectBestPlaces ' +
- 'selectDiarySubject selectedEditorObjects selectEditorObject selectionNames selectionPosition ' +
- 'selectLeader selectMax selectMin selectNoPlayer selectPlayer selectRandom selectWeapon ' +
- 'selectWeaponTurret sendAUMessage sendSimpleCommand sendTask sendTaskResult sendUDPMessage ' +
- 'serverCommand serverCommandAvailable serverCommandExecutable serverName serverTime set ' +
- 'set3DENAttribute set3DENAttributes set3DENGrid set3DENIconsVisible set3DENLayer ' +
- 'set3DENLinesVisible set3DENMissionAttributes set3DENModelsVisible set3DENObjectType ' +
- 'set3DENSelected setAccTime setAirportSide setAmmo setAmmoCargo setAnimSpeedCoef setAperture ' +
- 'setApertureNew setArmoryPoints setAttributes setAutonomous setBehaviour setBleedingRemaining ' +
- 'setCameraInterest setCamShakeDefParams setCamShakeParams setCamUseTi setCaptive setCenterOfMass ' +
- 'setCollisionLight setCombatMode setCompassOscillation setCuratorCameraAreaCeiling setCuratorCoef ' +
- 'setCuratorEditingAreaType setCuratorWaypointCost setCurrentChannel setCurrentTask ' +
- 'setCurrentWaypoint setCustomAimCoef setDamage setDammage setDate setDebriefingText ' +
- 'setDefaultCamera setDestination setDetailMapBlendPars setDir setDirection setDrawIcon ' +
- 'setDropInterval setEditorMode setEditorObjectScope setEffectCondition setFace setFaceAnimation ' +
- 'setFatigue setFlagOwner setFlagSide setFlagTexture setFog setFormation setFormationTask ' +
- 'setFormDir setFriend setFromEditor setFSMVariable setFuel setFuelCargo setGroupIcon ' +
- 'setGroupIconParams setGroupIconsSelectable setGroupIconsVisible setGroupId setGroupIdGlobal ' +
- 'setGroupOwner setGusts setHideBehind setHit setHitIndex setHitPointDamage setHorizonParallaxCoef ' +
- 'setHUDMovementLevels setIdentity setImportance setLeader setLightAmbient setLightAttenuation ' +
- 'setLightBrightness setLightColor setLightDayLight setLightFlareMaxDistance setLightFlareSize ' +
- 'setLightIntensity setLightnings setLightUseFlare setLocalWindParams setMagazineTurretAmmo ' +
- 'setMarkerAlpha setMarkerAlphaLocal setMarkerBrush setMarkerBrushLocal setMarkerColor ' +
- 'setMarkerColorLocal setMarkerDir setMarkerDirLocal setMarkerPos setMarkerPosLocal setMarkerShape ' +
- 'setMarkerShapeLocal setMarkerSize setMarkerSizeLocal setMarkerText setMarkerTextLocal ' +
- 'setMarkerType setMarkerTypeLocal setMass setMimic setMousePosition setMusicEffect ' +
- 'setMusicEventHandler setName setNameSound setObjectArguments setObjectMaterial ' +
- 'setObjectMaterialGlobal setObjectProxy setObjectTexture setObjectTextureGlobal ' +
- 'setObjectViewDistance setOvercast setOwner setOxygenRemaining setParticleCircle setParticleClass ' +
- 'setParticleFire setParticleParams setParticleRandom setPilotCameraDirection ' +
- 'setPilotCameraRotation setPilotCameraTarget setPilotLight setPiPEffect setPitch setPlayable ' +
- 'setPlayerRespawnTime setPos setPosASL setPosASL2 setPosASLW setPosATL setPosition setPosWorld ' +
- 'setRadioMsg setRain setRainbow setRandomLip setRank setRectangular setRepairCargo ' +
- 'setShadowDistance setShotParents setSide setSimpleTaskAlwaysVisible setSimpleTaskCustomData ' +
- 'setSimpleTaskDescription setSimpleTaskDestination setSimpleTaskTarget setSimpleTaskType ' +
- 'setSimulWeatherLayers setSize setSkill setSlingLoad setSoundEffect setSpeaker setSpeech ' +
- 'setSpeedMode setStamina setStaminaScheme setStatValue setSuppression setSystemOfUnits ' +
- 'setTargetAge setTaskResult setTaskState setTerrainGrid setText setTimeMultiplier setTitleEffect ' +
- 'setTriggerActivation setTriggerArea setTriggerStatements setTriggerText setTriggerTimeout ' +
- 'setTriggerType setType setUnconscious setUnitAbility setUnitLoadout setUnitPos setUnitPosWeak ' +
- 'setUnitRank setUnitRecoilCoefficient setUnitTrait setUnloadInCombat setUserActionText setVariable ' +
- 'setVectorDir setVectorDirAndUp setVectorUp setVehicleAmmo setVehicleAmmoDef setVehicleArmor ' +
- 'setVehicleCargo setVehicleId setVehicleLock setVehiclePosition setVehicleTiPars setVehicleVarName ' +
- 'setVelocity setVelocityTransformation setViewDistance setVisibleIfTreeCollapsed setWaves ' +
- 'setWaypointBehaviour setWaypointCombatMode setWaypointCompletionRadius setWaypointDescription ' +
- 'setWaypointForceBehaviour setWaypointFormation setWaypointHousePosition setWaypointLoiterRadius ' +
- 'setWaypointLoiterType setWaypointName setWaypointPosition setWaypointScript setWaypointSpeed ' +
- 'setWaypointStatements setWaypointTimeout setWaypointType setWaypointVisible ' +
- 'setWeaponReloadingTime setWind setWindDir setWindForce setWindStr setWPPos show3DIcons showChat ' +
- 'showCinemaBorder showCommandingMenu showCompass showCuratorCompass showGPS showHUD showLegend ' +
- 'showMap shownArtilleryComputer shownChat shownCompass shownCuratorCompass showNewEditorObject ' +
- 'shownGPS shownHUD shownMap shownPad shownRadio shownScoretable shownUAVFeed shownWarrant ' +
- 'shownWatch showPad showRadio showScoretable showSubtitles showUAVFeed showWarrant showWatch ' +
- 'showWaypoint showWaypoints side sideAmbientLife sideChat sideEmpty sideEnemy sideFriendly ' +
- 'sideLogic sideRadio sideUnknown simpleTasks simulationEnabled simulCloudDensity ' +
- 'simulCloudOcclusion simulInClouds simulWeatherSync sin size sizeOf skill skillFinal skipTime ' +
- 'sleep sliderPosition sliderRange sliderSetPosition sliderSetRange sliderSetSpeed sliderSpeed ' +
- 'slingLoadAssistantShown soldierMagazines someAmmo sort soundVolume spawn speaker speed speedMode ' +
- 'splitString sqrt squadParams stance startLoadingScreen step stop stopEngineRTD stopped str ' +
- 'sunOrMoon supportInfo suppressFor surfaceIsWater surfaceNormal surfaceType swimInDepth ' +
- 'switchableUnits switchAction switchCamera switchGesture switchLight switchMove ' +
- 'synchronizedObjects synchronizedTriggers synchronizedWaypoints synchronizeObjectsAdd ' +
- 'synchronizeObjectsRemove synchronizeTrigger synchronizeWaypoint systemChat systemOfUnits tan ' +
- 'targetKnowledge targetsAggregate targetsQuery taskAlwaysVisible taskChildren taskCompleted ' +
- 'taskCustomData taskDescription taskDestination taskHint taskMarkerOffset taskNull taskParent ' +
- 'taskResult taskState taskType teamMember teamMemberNull teamName teams teamSwitch ' +
- 'teamSwitchEnabled teamType terminate terrainIntersect terrainIntersectASL text textLog ' +
- 'textLogFormat tg time timeMultiplier titleCut titleFadeOut titleObj titleRsc titleText toArray ' +
- 'toFixed toLower toString toUpper triggerActivated triggerActivation triggerArea ' +
- 'triggerAttachedVehicle triggerAttachObject triggerAttachVehicle triggerStatements triggerText ' +
- 'triggerTimeout triggerTimeoutCurrent triggerType turretLocal turretOwner turretUnit tvAdd tvClear ' +
- 'tvCollapse tvCount tvCurSel tvData tvDelete tvExpand tvPicture tvSetCurSel tvSetData tvSetPicture ' +
- 'tvSetPictureColor tvSetPictureColorDisabled tvSetPictureColorSelected tvSetPictureRight ' +
- 'tvSetPictureRightColor tvSetPictureRightColorDisabled tvSetPictureRightColorSelected tvSetText ' +
- 'tvSetTooltip tvSetValue tvSort tvSortByValue tvText tvTooltip tvValue type typeName typeOf ' +
- 'UAVControl uiNamespace uiSleep unassignCurator unassignItem unassignTeam unassignVehicle ' +
- 'underwater uniform uniformContainer uniformItems uniformMagazines unitAddons unitAimPosition ' +
- 'unitAimPositionVisual unitBackpack unitIsUAV unitPos unitReady unitRecoilCoefficient units ' +
- 'unitsBelowHeight unlinkItem unlockAchievement unregisterTask updateDrawIcon updateMenuItem ' +
- 'updateObjectTree useAISteeringComponent useAudioTimeForMoves vectorAdd vectorCos ' +
- 'vectorCrossProduct vectorDiff vectorDir vectorDirVisual vectorDistance vectorDistanceSqr ' +
- 'vectorDotProduct vectorFromTo vectorMagnitude vectorMagnitudeSqr vectorMultiply vectorNormalized ' +
- 'vectorUp vectorUpVisual vehicle vehicleCargoEnabled vehicleChat vehicleRadio vehicles ' +
- 'vehicleVarName velocity velocityModelSpace verifySignature vest vestContainer vestItems ' +
- 'vestMagazines viewDistance visibleCompass visibleGPS visibleMap visiblePosition ' +
- 'visiblePositionASL visibleScoretable visibleWatch waves waypointAttachedObject ' +
- 'waypointAttachedVehicle waypointAttachObject waypointAttachVehicle waypointBehaviour ' +
- 'waypointCombatMode waypointCompletionRadius waypointDescription waypointForceBehaviour ' +
- 'waypointFormation waypointHousePosition waypointLoiterRadius waypointLoiterType waypointName ' +
- 'waypointPosition waypoints waypointScript waypointsEnabledUAV waypointShow waypointSpeed ' +
- 'waypointStatements waypointTimeout waypointTimeoutCurrent waypointType waypointVisible ' +
- 'weaponAccessories weaponAccessoriesCargo weaponCargo weaponDirection weaponInertia weaponLowered ' +
- 'weapons weaponsItems weaponsItemsCargo weaponState weaponsTurret weightRTD west WFSideText wind',
- literal:
- 'true false nil'
- },
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.NUMBER_MODE,
- VARIABLE,
- FUNCTION,
- STRINGS,
- CPP.preprocessor
- ],
- illegal: /#/
- };
-};
-},{}],261:[function(require,module,exports){
-module.exports = function(hljs) {
- var COMMENT_MODE = hljs.COMMENT('--', '$');
- return {
- case_insensitive: true,
- illegal: /[<>{}*#]/,
- contains: [
- {
- beginKeywords:
- 'begin end start commit rollback savepoint lock alter create drop rename call ' +
- 'delete do handler insert load replace select truncate update set show pragma grant ' +
- 'merge describe use explain help declare prepare execute deallocate release ' +
- 'unlock purge reset change stop analyze cache flush optimize repair kill ' +
- 'install uninstall checksum restore check backup revoke comment',
- end: /;/, endsWithParent: true,
- lexemes: /[\w\.]+/,
- keywords: {
- keyword:
- 'abort abs absolute acc acce accep accept access accessed accessible account acos action activate add ' +
- 'addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias ' +
- 'allocate allow alter always analyze ancillary and any anydata anydataset anyschema anytype apply ' +
- 'archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan ' +
- 'atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid ' +
- 'authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile ' +
- 'before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float ' +
- 'binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound ' +
- 'buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel ' +
- 'capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base ' +
- 'char_length character_length characters characterset charindex charset charsetform charsetid check ' +
- 'checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close ' +
- 'cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation ' +
- 'collect colu colum column column_value columns columns_updated comment commit compact compatibility ' +
- 'compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn ' +
- 'connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection ' +
- 'consider consistent constant constraint constraints constructor container content contents context ' +
- 'contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost ' +
- 'count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation ' +
- 'critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user ' +
- 'cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add ' +
- 'date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts ' +
- 'day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate ' +
- 'declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults ' +
- 'deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank ' +
- 'depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor ' +
- 'deterministic diagnostics difference dimension direct_load directory disable disable_all ' +
- 'disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div ' +
- 'do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable ' +
- 'editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt ' +
- 'end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors ' +
- 'escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding ' +
- 'execu execut execute exempt exists exit exp expire explain export export_set extended extent external ' +
- 'external_1 external_2 externally extract failed failed_login_attempts failover failure far fast ' +
- 'feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final ' +
- 'finish first first_value fixed flash_cache flashback floor flush following follows for forall force ' +
- 'form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ' +
- 'ftp full function general generated get get_format get_lock getdate getutcdate global global_name ' +
- 'globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups ' +
- 'gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex ' +
- 'hierarchy high high_priority hosts hour http id ident_current ident_incr ident_seed identified ' +
- 'identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment ' +
- 'index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile ' +
- 'initial initialized initially initrans inmemory inner innodb input insert install instance instantiable ' +
- 'instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat ' +
- 'is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists ' +
- 'keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lax lcase ' +
- 'lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit ' +
- 'lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate ' +
- 'locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call ' +
- 'logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime ' +
- 'managed management manual map mapping mask master master_pos_wait match matched materialized max ' +
- 'maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans ' +
- 'md5 measures median medium member memcompress memory merge microsecond mid migration min minextents ' +
- 'minimum mining minus minute minvalue missing mod mode model modification modify module monitoring month ' +
- 'months mount move movement multiset mutex name name_const names nan national native natural nav nchar ' +
- 'nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile ' +
- 'nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile ' +
- 'nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder ' +
- 'nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck ' +
- 'noswitch not nothing notice notrim novalidate now nowait nth_value nullif nulls num numb numbe ' +
- 'nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ' +
- 'ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old ' +
- 'on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date ' +
- 'oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary ' +
- 'out outer outfile outline output over overflow overriding package pad parallel parallel_enable ' +
- 'parameters parent parse partial partition partitions pascal passing password password_grace_time ' +
- 'password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex ' +
- 'pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc ' +
- 'performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin ' +
- 'policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction ' +
- 'prediction_cost prediction_details prediction_probability prediction_set prepare present preserve ' +
- 'prior priority private private_sga privileges procedural procedure procedure_analyze processlist ' +
- 'profiles project prompt protection public publishingservername purge quarter query quick quiesce quota ' +
- 'quotename radians raise rand range rank raw read reads readsize rebuild record records ' +
- 'recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh ' +
- 'regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy ' +
- 'reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename ' +
- 'repair repeat replace replicate replication required reset resetlogs resize resource respect restore ' +
- 'restricted result result_cache resumable resume retention return returning returns reuse reverse revoke ' +
- 'right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows ' +
- 'rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll ' +
- 'sdo_georaster sdo_topo_geometry search sec_to_time second section securefile security seed segment select ' +
- 'self sequence sequential serializable server servererror session session_user sessions_per_user set ' +
- 'sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor ' +
- 'si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin ' +
- 'size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex ' +
- 'source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows ' +
- 'sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone ' +
- 'standby start starting startup statement static statistics stats_binomial_test stats_crosstab ' +
- 'stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep ' +
- 'stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev ' +
- 'stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate ' +
- 'subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum ' +
- 'suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate ' +
- 'sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tan tdo ' +
- 'template temporary terminated tertiary_weights test than then thread through tier ties time time_format ' +
- 'time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr ' +
- 'timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking ' +
- 'transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate ' +
- 'try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress ' +
- 'under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unpivot ' +
- 'unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert ' +
- 'url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date ' +
- 'utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var ' +
- 'var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray ' +
- 'verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear ' +
- 'wellformed when whene whenev wheneve whenever where while whitespace with within without work wrapped ' +
- 'xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces ' +
- 'xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek',
- literal:
- 'true false null',
- built_in:
- 'array bigint binary bit blob boolean char character date dec decimal float int int8 integer interval number ' +
- 'numeric real record serial serial8 smallint text varchar varying void'
- },
- contains: [
- {
- className: 'string',
- begin: '\'', end: '\'',
- contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}]
- },
- {
- className: 'string',
- begin: '"', end: '"',
- contains: [hljs.BACKSLASH_ESCAPE, {begin: '""'}]
- },
- {
- className: 'string',
- begin: '`', end: '`',
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- hljs.C_NUMBER_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- COMMENT_MODE
- ]
- },
- hljs.C_BLOCK_COMMENT_MODE,
- COMMENT_MODE
- ]
- };
-};
-},{}],262:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- contains: [
- hljs.HASH_COMMENT_MODE,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- {
- begin: hljs.UNDERSCORE_IDENT_RE,
- lexemes: hljs.UNDERSCORE_IDENT_RE,
- keywords: {
- // Stan's keywords
- name:
- 'for in while repeat until if then else',
- // Stan's probablity distributions (less beta and gamma, as commonly
- // used for parameter names). So far, _log and _rng variants are not
- // included
- symbol:
- 'bernoulli bernoulli_logit binomial binomial_logit ' +
- 'beta_binomial hypergeometric categorical categorical_logit ' +
- 'ordered_logistic neg_binomial neg_binomial_2 ' +
- 'neg_binomial_2_log poisson poisson_log multinomial normal ' +
- 'exp_mod_normal skew_normal student_t cauchy double_exponential ' +
- 'logistic gumbel lognormal chi_square inv_chi_square ' +
- 'scaled_inv_chi_square exponential inv_gamma weibull frechet ' +
- 'rayleigh wiener pareto pareto_type_2 von_mises uniform ' +
- 'multi_normal multi_normal_prec multi_normal_cholesky multi_gp ' +
- 'multi_gp_cholesky multi_student_t gaussian_dlm_obs dirichlet ' +
- 'lkj_corr lkj_corr_cholesky wishart inv_wishart',
- // Stan's data types
- 'selector-tag':
- 'int real vector simplex unit_vector ordered positive_ordered ' +
- 'row_vector matrix cholesky_factor_corr cholesky_factor_cov ' +
- 'corr_matrix cov_matrix',
- // Stan's model blocks
- title:
- 'functions model data parameters quantities transformed ' +
- 'generated',
- literal:
- 'true false'
- },
- relevance: 0
- },
- // The below is all taken from the R language definition
- {
- // hex value
- className: 'number',
- begin: "0[xX][0-9a-fA-F]+[Li]?\\b",
- relevance: 0
- },
- {
- // hex value
- className: 'number',
- begin: "0[xX][0-9a-fA-F]+[Li]?\\b",
- relevance: 0
- },
- {
- // explicit integer
- className: 'number',
- begin: "\\d+(?:[eE][+\\-]?\\d*)?L\\b",
- relevance: 0
- },
- {
- // number with trailing decimal
- className: 'number',
- begin: "\\d+\\.(?!\\d)(?:i\\b)?",
- relevance: 0
- },
- {
- // number
- className: 'number',
- begin: "\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",
- relevance: 0
- },
- {
- // number with leading decimal
- className: 'number',
- begin: "\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",
- relevance: 0
- }
- ]
- };
-};
-},{}],263:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['do', 'ado'],
- case_insensitive: true,
- keywords: 'if else in foreach for forv forva forval forvalu forvalue forvalues by bys bysort xi quietly qui capture about ac ac_7 acprplot acprplot_7 adjust ado adopath adoupdate alpha ameans an ano anov anova anova_estat anova_terms anovadef aorder ap app appe appen append arch arch_dr arch_estat arch_p archlm areg areg_p args arima arima_dr arima_estat arima_p as asmprobit asmprobit_estat asmprobit_lf asmprobit_mfx__dlg asmprobit_p ass asse asser assert avplot avplot_7 avplots avplots_7 bcskew0 bgodfrey binreg bip0_lf biplot bipp_lf bipr_lf bipr_p biprobit bitest bitesti bitowt blogit bmemsize boot bootsamp bootstrap bootstrap_8 boxco_l boxco_p boxcox boxcox_6 boxcox_p bprobit br break brier bro brow brows browse brr brrstat bs bs_7 bsampl_w bsample bsample_7 bsqreg bstat bstat_7 bstat_8 bstrap bstrap_7 ca ca_estat ca_p cabiplot camat canon canon_8 canon_8_p canon_estat canon_p cap caprojection capt captu captur capture cat cc cchart cchart_7 cci cd censobs_table centile cf char chdir checkdlgfiles checkestimationsample checkhlpfiles checksum chelp ci cii cl class classutil clear cli clis clist clo clog clog_lf clog_p clogi clogi_sw clogit clogit_lf clogit_p clogitp clogl_sw cloglog clonevar clslistarray cluster cluster_measures cluster_stop cluster_tree cluster_tree_8 clustermat cmdlog cnr cnre cnreg cnreg_p cnreg_sw cnsreg codebook collaps4 collapse colormult_nb colormult_nw compare compress conf confi confir confirm conren cons const constr constra constrai constrain constraint continue contract copy copyright copysource cor corc corr corr2data corr_anti corr_kmo corr_smc corre correl correla correlat correlate corrgram cou coun count cox cox_p cox_sw coxbase coxhaz coxvar cprplot cprplot_7 crc cret cretu cretur creturn cross cs cscript cscript_log csi ct ct_is ctset ctst_5 ctst_st cttost cumsp cumsp_7 cumul cusum cusum_7 cutil d|0 datasig datasign datasigna datasignat datasignatu datasignatur datasignature datetof db dbeta de dec deco decod decode deff des desc descr descri describ describe destring dfbeta dfgls dfuller di di_g dir dirstats dis discard disp disp_res disp_s displ displa display distinct do doe doed doedi doedit dotplot dotplot_7 dprobit drawnorm drop ds ds_util dstdize duplicates durbina dwstat dydx e|0 ed edi edit egen eivreg emdef en enc enco encod encode eq erase ereg ereg_lf ereg_p ereg_sw ereghet ereghet_glf ereghet_glf_sh ereghet_gp ereghet_ilf ereghet_ilf_sh ereghet_ip eret eretu eretur ereturn err erro error est est_cfexist est_cfname est_clickable est_expand est_hold est_table est_unhold est_unholdok estat estat_default estat_summ estat_vce_only esti estimates etodow etof etomdy ex exi exit expand expandcl fac fact facto factor factor_estat factor_p factor_pca_rotated factor_rotate factormat fcast fcast_compute fcast_graph fdades fdadesc fdadescr fdadescri fdadescrib fdadescribe fdasav fdasave fdause fh_st file open file read file close file filefilter fillin find_hlp_file findfile findit findit_7 fit fl fli flis flist for5_0 form forma format fpredict frac_154 frac_adj frac_chk frac_cox frac_ddp frac_dis frac_dv frac_in frac_mun frac_pp frac_pq frac_pv frac_wgt frac_xo fracgen fracplot fracplot_7 fracpoly fracpred fron_ex fron_hn fron_p fron_tn fron_tn2 frontier ftodate ftoe ftomdy ftowdate g|0 gamhet_glf gamhet_gp gamhet_ilf gamhet_ip gamma gamma_d2 gamma_p gamma_sw gammahet gdi_hexagon gdi_spokes ge gen gene gener genera generat generate genrank genstd genvmean gettoken gl gladder gladder_7 glim_l01 glim_l02 glim_l03 glim_l04 glim_l05 glim_l06 glim_l07 glim_l08 glim_l09 glim_l10 glim_l11 glim_l12 glim_lf glim_mu glim_nw1 glim_nw2 glim_nw3 glim_p glim_v1 glim_v2 glim_v3 glim_v4 glim_v5 glim_v6 glim_v7 glm glm_6 glm_p glm_sw glmpred glo glob globa global glogit glogit_8 glogit_p gmeans gnbre_lf gnbreg gnbreg_5 gnbreg_p gomp_lf gompe_sw gomper_p gompertz gompertzhet gomphet_glf gomphet_glf_sh gomphet_gp gomphet_ilf gomphet_ilf_sh gomphet_ip gphdot gphpen gphprint gprefs gprobi_p gprobit gprobit_8 gr gr7 gr_copy gr_current gr_db gr_describe gr_dir gr_draw gr_draw_replay gr_drop gr_edit gr_editviewopts gr_example gr_example2 gr_export gr_print gr_qscheme gr_query gr_read gr_rename gr_replay gr_save gr_set gr_setscheme gr_table gr_undo gr_use graph graph7 grebar greigen greigen_7 greigen_8 grmeanby grmeanby_7 gs_fileinfo gs_filetype gs_graphinfo gs_stat gsort gwood h|0 hadimvo hareg hausman haver he heck_d2 heckma_p heckman heckp_lf heckpr_p heckprob hel help hereg hetpr_lf hetpr_p hetprob hettest hexdump hilite hist hist_7 histogram hlogit hlu hmeans hotel hotelling hprobit hreg hsearch icd9 icd9_ff icd9p iis impute imtest inbase include inf infi infil infile infix inp inpu input ins insheet insp inspe inspec inspect integ inten intreg intreg_7 intreg_p intrg2_ll intrg_ll intrg_ll2 ipolate iqreg ir irf irf_create irfm iri is_svy is_svysum isid istdize ivprob_1_lf ivprob_lf ivprobit ivprobit_p ivreg ivreg_footnote ivtob_1_lf ivtob_lf ivtobit ivtobit_p jackknife jacknife jknife jknife_6 jknife_8 jkstat joinby kalarma1 kap kap_3 kapmeier kappa kapwgt kdensity kdensity_7 keep ksm ksmirnov ktau kwallis l|0 la lab labe label labelbook ladder levels levelsof leverage lfit lfit_p li lincom line linktest lis list lloghet_glf lloghet_glf_sh lloghet_gp lloghet_ilf lloghet_ilf_sh lloghet_ip llogi_sw llogis_p llogist llogistic llogistichet lnorm_lf lnorm_sw lnorma_p lnormal lnormalhet lnormhet_glf lnormhet_glf_sh lnormhet_gp lnormhet_ilf lnormhet_ilf_sh lnormhet_ip lnskew0 loadingplot loc loca local log logi logis_lf logistic logistic_p logit logit_estat logit_p loglogs logrank loneway lookfor lookup lowess lowess_7 lpredict lrecomp lroc lroc_7 lrtest ls lsens lsens_7 lsens_x lstat ltable ltable_7 ltriang lv lvr2plot lvr2plot_7 m|0 ma mac macr macro makecns man manova manova_estat manova_p manovatest mantel mark markin markout marksample mat mat_capp mat_order mat_put_rr mat_rapp mata mata_clear mata_describe mata_drop mata_matdescribe mata_matsave mata_matuse mata_memory mata_mlib mata_mosave mata_rename mata_which matalabel matcproc matlist matname matr matri matrix matrix_input__dlg matstrik mcc mcci md0_ md1_ md1debug_ md2_ md2debug_ mds mds_estat mds_p mdsconfig mdslong mdsmat mdsshepard mdytoe mdytof me_derd mean means median memory memsize meqparse mer merg merge mfp mfx mhelp mhodds minbound mixed_ll mixed_ll_reparm mkassert mkdir mkmat mkspline ml ml_5 ml_adjs ml_bhhhs ml_c_d ml_check ml_clear ml_cnt ml_debug ml_defd ml_e0 ml_e0_bfgs ml_e0_cycle ml_e0_dfp ml_e0i ml_e1 ml_e1_bfgs ml_e1_bhhh ml_e1_cycle ml_e1_dfp ml_e2 ml_e2_cycle ml_ebfg0 ml_ebfr0 ml_ebfr1 ml_ebh0q ml_ebhh0 ml_ebhr0 ml_ebr0i ml_ecr0i ml_edfp0 ml_edfr0 ml_edfr1 ml_edr0i ml_eds ml_eer0i ml_egr0i ml_elf ml_elf_bfgs ml_elf_bhhh ml_elf_cycle ml_elf_dfp ml_elfi ml_elfs ml_enr0i ml_enrr0 ml_erdu0 ml_erdu0_bfgs ml_erdu0_bhhh ml_erdu0_bhhhq ml_erdu0_cycle ml_erdu0_dfp ml_erdu0_nrbfgs ml_exde ml_footnote ml_geqnr ml_grad0 ml_graph ml_hbhhh ml_hd0 ml_hold ml_init ml_inv ml_log ml_max ml_mlout ml_mlout_8 ml_model ml_nb0 ml_opt ml_p ml_plot ml_query ml_rdgrd ml_repor ml_s_e ml_score ml_searc ml_technique ml_unhold mleval mlf_ mlmatbysum mlmatsum mlog mlogi mlogit mlogit_footnote mlogit_p mlopts mlsum mlvecsum mnl0_ mor more mov move mprobit mprobit_lf mprobit_p mrdu0_ mrdu1_ mvdecode mvencode mvreg mvreg_estat n|0 nbreg nbreg_al nbreg_lf nbreg_p nbreg_sw nestreg net newey newey_7 newey_p news nl nl_7 nl_9 nl_9_p nl_p nl_p_7 nlcom nlcom_p nlexp2 nlexp2_7 nlexp2a nlexp2a_7 nlexp3 nlexp3_7 nlgom3 nlgom3_7 nlgom4 nlgom4_7 nlinit nllog3 nllog3_7 nllog4 nllog4_7 nlog_rd nlogit nlogit_p nlogitgen nlogittree nlpred no nobreak noi nois noisi noisil noisily note notes notes_dlg nptrend numlabel numlist odbc old_ver olo olog ologi ologi_sw ologit ologit_p ologitp on one onew onewa oneway op_colnm op_comp op_diff op_inv op_str opr opro oprob oprob_sw oprobi oprobi_p oprobit oprobitp opts_exclusive order orthog orthpoly ou out outf outfi outfil outfile outs outsh outshe outshee outsheet ovtest pac pac_7 palette parse parse_dissim pause pca pca_8 pca_display pca_estat pca_p pca_rotate pcamat pchart pchart_7 pchi pchi_7 pcorr pctile pentium pergram pergram_7 permute permute_8 personal peto_st pkcollapse pkcross pkequiv pkexamine pkexamine_7 pkshape pksumm pksumm_7 pl plo plot plugin pnorm pnorm_7 poisgof poiss_lf poiss_sw poisso_p poisson poisson_estat post postclose postfile postutil pperron pr prais prais_e prais_e2 prais_p predict predictnl preserve print pro prob probi probit probit_estat probit_p proc_time procoverlay procrustes procrustes_estat procrustes_p profiler prog progr progra program prop proportion prtest prtesti pwcorr pwd q\\s qby qbys qchi qchi_7 qladder qladder_7 qnorm qnorm_7 qqplot qqplot_7 qreg qreg_c qreg_p qreg_sw qu quadchk quantile quantile_7 que quer query range ranksum ratio rchart rchart_7 rcof recast reclink recode reg reg3 reg3_p regdw regr regre regre_p2 regres regres_p regress regress_estat regriv_p remap ren rena renam rename renpfix repeat replace report reshape restore ret retu retur return rm rmdir robvar roccomp roccomp_7 roccomp_8 rocf_lf rocfit rocfit_8 rocgold rocplot rocplot_7 roctab roctab_7 rolling rologit rologit_p rot rota rotat rotate rotatemat rreg rreg_p ru run runtest rvfplot rvfplot_7 rvpplot rvpplot_7 sa safesum sample sampsi sav save savedresults saveold sc sca scal scala scalar scatter scm_mine sco scob_lf scob_p scobi_sw scobit scor score scoreplot scoreplot_help scree screeplot screeplot_help sdtest sdtesti se search separate seperate serrbar serrbar_7 serset set set_defaults sfrancia sh she shel shell shewhart shewhart_7 signestimationsample signrank signtest simul simul_7 simulate simulate_8 sktest sleep slogit slogit_d2 slogit_p smooth snapspan so sor sort spearman spikeplot spikeplot_7 spikeplt spline_x split sqreg sqreg_p sret sretu sretur sreturn ssc st st_ct st_hc st_hcd st_hcd_sh st_is st_issys st_note st_promo st_set st_show st_smpl st_subid stack statsby statsby_8 stbase stci stci_7 stcox stcox_estat stcox_fr stcox_fr_ll stcox_p stcox_sw stcoxkm stcoxkm_7 stcstat stcurv stcurve stcurve_7 stdes stem stepwise stereg stfill stgen stir stjoin stmc stmh stphplot stphplot_7 stphtest stphtest_7 stptime strate strate_7 streg streg_sw streset sts sts_7 stset stsplit stsum sttocc sttoct stvary stweib su suest suest_8 sum summ summa summar summari summariz summarize sunflower sureg survcurv survsum svar svar_p svmat svy svy_disp svy_dreg svy_est svy_est_7 svy_estat svy_get svy_gnbreg_p svy_head svy_header svy_heckman_p svy_heckprob_p svy_intreg_p svy_ivreg_p svy_logistic_p svy_logit_p svy_mlogit_p svy_nbreg_p svy_ologit_p svy_oprobit_p svy_poisson_p svy_probit_p svy_regress_p svy_sub svy_sub_7 svy_x svy_x_7 svy_x_p svydes svydes_8 svygen svygnbreg svyheckman svyheckprob svyintreg svyintreg_7 svyintrg svyivreg svylc svylog_p svylogit svymarkout svymarkout_8 svymean svymlog svymlogit svynbreg svyolog svyologit svyoprob svyoprobit svyopts svypois svypois_7 svypoisson svyprobit svyprobt svyprop svyprop_7 svyratio svyreg svyreg_p svyregress svyset svyset_7 svyset_8 svytab svytab_7 svytest svytotal sw sw_8 swcnreg swcox swereg swilk swlogis swlogit swologit swoprbt swpois swprobit swqreg swtobit swweib symmetry symmi symplot symplot_7 syntax sysdescribe sysdir sysuse szroeter ta tab tab1 tab2 tab_or tabd tabdi tabdis tabdisp tabi table tabodds tabodds_7 tabstat tabu tabul tabula tabulat tabulate te tempfile tempname tempvar tes test testnl testparm teststd tetrachoric time_it timer tis tob tobi tobit tobit_p tobit_sw token tokeni tokeniz tokenize tostring total translate translator transmap treat_ll treatr_p treatreg trim trnb_cons trnb_mean trpoiss_d2 trunc_ll truncr_p truncreg tsappend tset tsfill tsline tsline_ex tsreport tsrevar tsrline tsset tssmooth tsunab ttest ttesti tut_chk tut_wait tutorial tw tware_st two twoway twoway__fpfit_serset twoway__function_gen twoway__histogram_gen twoway__ipoint_serset twoway__ipoints_serset twoway__kdensity_gen twoway__lfit_serset twoway__normgen_gen twoway__pci_serset twoway__qfit_serset twoway__scatteri_serset twoway__sunflower_gen twoway_ksm_serset ty typ type typeof u|0 unab unabbrev unabcmd update us use uselabel var var_mkcompanion var_p varbasic varfcast vargranger varirf varirf_add varirf_cgraph varirf_create varirf_ctable varirf_describe varirf_dir varirf_drop varirf_erase varirf_graph varirf_ograph varirf_rename varirf_set varirf_table varlist varlmar varnorm varsoc varstable varstable_w varstable_w2 varwle vce vec vec_fevd vec_mkphi vec_p vec_p_w vecirf_create veclmar veclmar_w vecnorm vecnorm_w vecrank vecstable verinst vers versi versio version view viewsource vif vwls wdatetof webdescribe webseek webuse weib1_lf weib2_lf weib_lf weib_lf0 weibhet_glf weibhet_glf_sh weibhet_glfa weibhet_glfa_sh weibhet_gp weibhet_ilf weibhet_ilf_sh weibhet_ilfa weibhet_ilfa_sh weibhet_ip weibu_sw weibul_p weibull weibull_c weibull_s weibullhet wh whelp whi which whil while wilc_st wilcoxon win wind windo window winexec wntestb wntestb_7 wntestq xchart xchart_7 xcorr xcorr_7 xi xi_6 xmlsav xmlsave xmluse xpose xsh xshe xshel xshell xt_iis xt_tis xtab_p xtabond xtbin_p xtclog xtcloglog xtcloglog_8 xtcloglog_d2 xtcloglog_pa_p xtcloglog_re_p xtcnt_p xtcorr xtdata xtdes xtfront_p xtfrontier xtgee xtgee_elink xtgee_estat xtgee_makeivar xtgee_p xtgee_plink xtgls xtgls_p xthaus xthausman xtht_p xthtaylor xtile xtint_p xtintreg xtintreg_8 xtintreg_d2 xtintreg_p xtivp_1 xtivp_2 xtivreg xtline xtline_ex xtlogit xtlogit_8 xtlogit_d2 xtlogit_fe_p xtlogit_pa_p xtlogit_re_p xtmixed xtmixed_estat xtmixed_p xtnb_fe xtnb_lf xtnbreg xtnbreg_pa_p xtnbreg_refe_p xtpcse xtpcse_p xtpois xtpoisson xtpoisson_d2 xtpoisson_pa_p xtpoisson_refe_p xtpred xtprobit xtprobit_8 xtprobit_d2 xtprobit_re_p xtps_fe xtps_lf xtps_ren xtps_ren_8 xtrar_p xtrc xtrc_p xtrchh xtrefe_p xtreg xtreg_be xtreg_fe xtreg_ml xtreg_pa_p xtreg_re xtregar xtrere_p xtset xtsf_ll xtsf_llti xtsum xttab xttest0 xttobit xttobit_8 xttobit_p xttrans yx yxview__barlike_draw yxview_area_draw yxview_bar_draw yxview_dot_draw yxview_dropline_draw yxview_function_draw yxview_iarrow_draw yxview_ilabels_draw yxview_normal_draw yxview_pcarrow_draw yxview_pcbarrow_draw yxview_pccapsym_draw yxview_pcscatter_draw yxview_pcspike_draw yxview_rarea_draw yxview_rbar_draw yxview_rbarm_draw yxview_rcap_draw yxview_rcapsym_draw yxview_rconnected_draw yxview_rline_draw yxview_rscatter_draw yxview_rspike_draw yxview_spike_draw yxview_sunflower_draw zap_s zinb zinb_llf zinb_plf zip zip_llf zip_p zip_plf zt_ct_5 zt_hc_5 zt_hcd_5 zt_is_5 zt_iss_5 zt_sho_5 zt_smp_5 ztbase_5 ztcox_5 ztdes_5 ztereg_5 ztfill_5 ztgen_5 ztir_5 ztjoin_5 ztnb ztnb_p ztp ztp_p zts_5 ztset_5 ztspli_5 ztsum_5 zttoct_5 ztvary_5 ztweib_5',
- contains: [
- {
- className: 'symbol',
- begin: /`[a-zA-Z0-9_]+'/
- },
- {
- className: 'variable',
- begin: /\$\{?[a-zA-Z0-9_]+\}?/
- },
- {
- className: 'string',
- variants: [
- {begin: '`"[^\r\n]*?"\''},
- {begin: '"[^\r\n"]*"'}
- ]
- },
-
- {
- className: 'built_in',
- variants: [
- {
- begin: '\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\(|$)'
- }
- ]
- },
-
- hljs.COMMENT('^[ \t]*\\*.*$', false),
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- };
-};
-},{}],264:[function(require,module,exports){
-module.exports = function(hljs) {
- var STEP21_IDENT_RE = '[A-Z_][A-Z0-9_.]*';
- var STEP21_KEYWORDS = {
- keyword: 'HEADER ENDSEC DATA'
- };
- var STEP21_START = {
- className: 'meta',
- begin: 'ISO-10303-21;',
- relevance: 10
- };
- var STEP21_CLOSE = {
- className: 'meta',
- begin: 'END-ISO-10303-21;',
- relevance: 10
- };
-
- return {
- aliases: ['p21', 'step', 'stp'],
- case_insensitive: true, // STEP 21 is case insensitive in theory, in practice all non-comments are capitalized.
- lexemes: STEP21_IDENT_RE,
- keywords: STEP21_KEYWORDS,
- contains: [
- STEP21_START,
- STEP21_CLOSE,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.COMMENT('/\\*\\*!', '\\*/'),
- hljs.C_NUMBER_MODE,
- hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}),
- hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}),
- {
- className: 'string',
- begin: "'", end: "'"
- },
- {
- className: 'symbol',
- variants: [
- {
- begin: '#', end: '\\d+',
- illegal: '\\W'
- }
- ]
- }
- ]
- };
-};
-},{}],265:[function(require,module,exports){
-module.exports = function(hljs) {
-
- var VARIABLE = {
- className: 'variable',
- begin: '\\$' + hljs.IDENT_RE
- };
-
- var HEX_COLOR = {
- className: 'number',
- begin: '#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})'
- };
-
- var AT_KEYWORDS = [
- 'charset',
- 'css',
- 'debug',
- 'extend',
- 'font-face',
- 'for',
- 'import',
- 'include',
- 'media',
- 'mixin',
- 'page',
- 'warn',
- 'while'
- ];
-
- var PSEUDO_SELECTORS = [
- 'after',
- 'before',
- 'first-letter',
- 'first-line',
- 'active',
- 'first-child',
- 'focus',
- 'hover',
- 'lang',
- 'link',
- 'visited'
- ];
-
- var TAGS = [
- 'a',
- 'abbr',
- 'address',
- 'article',
- 'aside',
- 'audio',
- 'b',
- 'blockquote',
- 'body',
- 'button',
- 'canvas',
- 'caption',
- 'cite',
- 'code',
- 'dd',
- 'del',
- 'details',
- 'dfn',
- 'div',
- 'dl',
- 'dt',
- 'em',
- 'fieldset',
- 'figcaption',
- 'figure',
- 'footer',
- 'form',
- 'h1',
- 'h2',
- 'h3',
- 'h4',
- 'h5',
- 'h6',
- 'header',
- 'hgroup',
- 'html',
- 'i',
- 'iframe',
- 'img',
- 'input',
- 'ins',
- 'kbd',
- 'label',
- 'legend',
- 'li',
- 'mark',
- 'menu',
- 'nav',
- 'object',
- 'ol',
- 'p',
- 'q',
- 'quote',
- 'samp',
- 'section',
- 'span',
- 'strong',
- 'summary',
- 'sup',
- 'table',
- 'tbody',
- 'td',
- 'textarea',
- 'tfoot',
- 'th',
- 'thead',
- 'time',
- 'tr',
- 'ul',
- 'var',
- 'video'
- ];
-
- var TAG_END = '[\\.\\s\\n\\[\\:,]';
-
- var ATTRIBUTES = [
- 'align-content',
- 'align-items',
- 'align-self',
- 'animation',
- 'animation-delay',
- 'animation-direction',
- 'animation-duration',
- 'animation-fill-mode',
- 'animation-iteration-count',
- 'animation-name',
- 'animation-play-state',
- 'animation-timing-function',
- 'auto',
- 'backface-visibility',
- 'background',
- 'background-attachment',
- 'background-clip',
- 'background-color',
- 'background-image',
- 'background-origin',
- 'background-position',
- 'background-repeat',
- 'background-size',
- 'border',
- 'border-bottom',
- 'border-bottom-color',
- 'border-bottom-left-radius',
- 'border-bottom-right-radius',
- 'border-bottom-style',
- 'border-bottom-width',
- 'border-collapse',
- 'border-color',
- 'border-image',
- 'border-image-outset',
- 'border-image-repeat',
- 'border-image-slice',
- 'border-image-source',
- 'border-image-width',
- 'border-left',
- 'border-left-color',
- 'border-left-style',
- 'border-left-width',
- 'border-radius',
- 'border-right',
- 'border-right-color',
- 'border-right-style',
- 'border-right-width',
- 'border-spacing',
- 'border-style',
- 'border-top',
- 'border-top-color',
- 'border-top-left-radius',
- 'border-top-right-radius',
- 'border-top-style',
- 'border-top-width',
- 'border-width',
- 'bottom',
- 'box-decoration-break',
- 'box-shadow',
- 'box-sizing',
- 'break-after',
- 'break-before',
- 'break-inside',
- 'caption-side',
- 'clear',
- 'clip',
- 'clip-path',
- 'color',
- 'column-count',
- 'column-fill',
- 'column-gap',
- 'column-rule',
- 'column-rule-color',
- 'column-rule-style',
- 'column-rule-width',
- 'column-span',
- 'column-width',
- 'columns',
- 'content',
- 'counter-increment',
- 'counter-reset',
- 'cursor',
- 'direction',
- 'display',
- 'empty-cells',
- 'filter',
- 'flex',
- 'flex-basis',
- 'flex-direction',
- 'flex-flow',
- 'flex-grow',
- 'flex-shrink',
- 'flex-wrap',
- 'float',
- 'font',
- 'font-family',
- 'font-feature-settings',
- 'font-kerning',
- 'font-language-override',
- 'font-size',
- 'font-size-adjust',
- 'font-stretch',
- 'font-style',
- 'font-variant',
- 'font-variant-ligatures',
- 'font-weight',
- 'height',
- 'hyphens',
- 'icon',
- 'image-orientation',
- 'image-rendering',
- 'image-resolution',
- 'ime-mode',
- 'inherit',
- 'initial',
- 'justify-content',
- 'left',
- 'letter-spacing',
- 'line-height',
- 'list-style',
- 'list-style-image',
- 'list-style-position',
- 'list-style-type',
- 'margin',
- 'margin-bottom',
- 'margin-left',
- 'margin-right',
- 'margin-top',
- 'marks',
- 'mask',
- 'max-height',
- 'max-width',
- 'min-height',
- 'min-width',
- 'nav-down',
- 'nav-index',
- 'nav-left',
- 'nav-right',
- 'nav-up',
- 'none',
- 'normal',
- 'object-fit',
- 'object-position',
- 'opacity',
- 'order',
- 'orphans',
- 'outline',
- 'outline-color',
- 'outline-offset',
- 'outline-style',
- 'outline-width',
- 'overflow',
- 'overflow-wrap',
- 'overflow-x',
- 'overflow-y',
- 'padding',
- 'padding-bottom',
- 'padding-left',
- 'padding-right',
- 'padding-top',
- 'page-break-after',
- 'page-break-before',
- 'page-break-inside',
- 'perspective',
- 'perspective-origin',
- 'pointer-events',
- 'position',
- 'quotes',
- 'resize',
- 'right',
- 'tab-size',
- 'table-layout',
- 'text-align',
- 'text-align-last',
- 'text-decoration',
- 'text-decoration-color',
- 'text-decoration-line',
- 'text-decoration-style',
- 'text-indent',
- 'text-overflow',
- 'text-rendering',
- 'text-shadow',
- 'text-transform',
- 'text-underline-position',
- 'top',
- 'transform',
- 'transform-origin',
- 'transform-style',
- 'transition',
- 'transition-delay',
- 'transition-duration',
- 'transition-property',
- 'transition-timing-function',
- 'unicode-bidi',
- 'vertical-align',
- 'visibility',
- 'white-space',
- 'widows',
- 'width',
- 'word-break',
- 'word-spacing',
- 'word-wrap',
- 'z-index'
- ];
-
- // illegals
- var ILLEGAL = [
- '\\?',
- '(\\bReturn\\b)', // monkey
- '(\\bEnd\\b)', // monkey
- '(\\bend\\b)', // vbscript
- '(\\bdef\\b)', // gradle
- ';', // a whole lot of languages
- '#\\s', // markdown
- '\\*\\s', // markdown
- '===\\s', // markdown
- '\\|',
- '%', // prolog
- ];
-
- return {
- aliases: ['styl'],
- case_insensitive: false,
- keywords: 'if else for in',
- illegal: '(' + ILLEGAL.join('|') + ')',
- contains: [
-
- // strings
- hljs.QUOTE_STRING_MODE,
- hljs.APOS_STRING_MODE,
-
- // comments
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
-
- // hex colors
- HEX_COLOR,
-
- // class tag
- {
- begin: '\\.[a-zA-Z][a-zA-Z0-9_-]*' + TAG_END,
- returnBegin: true,
- contains: [
- {className: 'selector-class', begin: '\\.[a-zA-Z][a-zA-Z0-9_-]*'}
- ]
- },
-
- // id tag
- {
- begin: '\\#[a-zA-Z][a-zA-Z0-9_-]*' + TAG_END,
- returnBegin: true,
- contains: [
- {className: 'selector-id', begin: '\\#[a-zA-Z][a-zA-Z0-9_-]*'}
- ]
- },
-
- // tags
- {
- begin: '\\b(' + TAGS.join('|') + ')' + TAG_END,
- returnBegin: true,
- contains: [
- {className: 'selector-tag', begin: '\\b[a-zA-Z][a-zA-Z0-9_-]*'}
- ]
- },
-
- // psuedo selectors
- {
- begin: '&?:?:\\b(' + PSEUDO_SELECTORS.join('|') + ')' + TAG_END
- },
-
- // @ keywords
- {
- begin: '\@(' + AT_KEYWORDS.join('|') + ')\\b'
- },
-
- // variables
- VARIABLE,
-
- // dimension
- hljs.CSS_NUMBER_MODE,
-
- // number
- hljs.NUMBER_MODE,
-
- // functions
- // - only from beginning of line + whitespace
- {
- className: 'function',
- begin: '^[a-zA-Z][a-zA-Z0-9_\-]*\\(.*\\)',
- illegal: '[\\n]',
- returnBegin: true,
- contains: [
- {className: 'title', begin: '\\b[a-zA-Z][a-zA-Z0-9_\-]*'},
- {
- className: 'params',
- begin: /\(/,
- end: /\)/,
- contains: [
- HEX_COLOR,
- VARIABLE,
- hljs.APOS_STRING_MODE,
- hljs.CSS_NUMBER_MODE,
- hljs.NUMBER_MODE,
- hljs.QUOTE_STRING_MODE
- ]
- }
- ]
- },
-
- // attributes
- // - only from beginning of line + whitespace
- // - must have whitespace after it
- {
- className: 'attribute',
- begin: '\\b(' + ATTRIBUTES.reverse().join('|') + ')\\b',
- starts: {
- // value container
- end: /;|$/,
- contains: [
- HEX_COLOR,
- VARIABLE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.CSS_NUMBER_MODE,
- hljs.NUMBER_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ],
- illegal: /\./,
- relevance: 0
- }
- }
- ]
- };
-};
-},{}],266:[function(require,module,exports){
-module.exports = function(hljs) {
- var DETAILS = {
- className: 'string',
- begin: '\\[\n(multipart)?', end: '\\]\n'
- };
- var TIME = {
- className: 'string',
- begin: '\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}\.\\d+Z'
- };
- var PROGRESSVALUE = {
- className: 'string',
- begin: '(\\+|-)\\d+'
- };
- var KEYWORDS = {
- className: 'keyword',
- relevance: 10,
- variants: [
- { begin: '^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?' },
- { begin: '^progress(:?)(\\s+)?(pop|push)?' },
- { begin: '^tags:' },
- { begin: '^time:' }
- ],
- };
- return {
- case_insensitive: true,
- contains: [
- DETAILS,
- TIME,
- PROGRESSVALUE,
- KEYWORDS
- ]
- };
-};
-},{}],267:[function(require,module,exports){
-module.exports = function(hljs) {
- var SWIFT_KEYWORDS = {
- keyword: '__COLUMN__ __FILE__ __FUNCTION__ __LINE__ as as! as? associativity ' +
- 'break case catch class continue convenience default defer deinit didSet do ' +
- 'dynamic dynamicType else enum extension fallthrough false fileprivate final for func ' +
- 'get guard if import in indirect infix init inout internal is lazy left let ' +
- 'mutating nil none nonmutating open operator optional override postfix precedence ' +
- 'prefix private protocol Protocol public repeat required rethrows return ' +
- 'right self Self set static struct subscript super switch throw throws true ' +
- 'try try! try? Type typealias unowned var weak where while willSet',
- literal: 'true false nil',
- built_in: 'abs advance alignof alignofValue anyGenerator assert assertionFailure ' +
- 'bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC ' +
- 'bridgeToObjectiveCUnconditional c contains count countElements countLeadingZeros ' +
- 'debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords ' +
- 'enumerate equal fatalError filter find getBridgedObjectiveCType getVaList ' +
- 'indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC ' +
- 'isUniquelyReferenced isUniquelyReferencedNonObjC join lazy lexicographicalCompare ' +
- 'map max maxElement min minElement numericCast overlaps partition posix ' +
- 'precondition preconditionFailure print println quickSort readLine reduce reflect ' +
- 'reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split ' +
- 'startsWith stride strideof strideofValue swap toString transcode ' +
- 'underestimateCount unsafeAddressOf unsafeBitCast unsafeDowncast unsafeUnwrap ' +
- 'unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer ' +
- 'withUnsafePointerToObject withUnsafeMutablePointer withUnsafeMutablePointers ' +
- 'withUnsafePointer withUnsafePointers withVaList zip'
- };
-
- var TYPE = {
- className: 'type',
- begin: '\\b[A-Z][\\w\u00C0-\u02B8\']*',
- relevance: 0
- };
- var BLOCK_COMMENT = hljs.COMMENT(
- '/\\*',
- '\\*/',
- {
- contains: ['self']
- }
- );
- var SUBST = {
- className: 'subst',
- begin: /\\\(/, end: '\\)',
- keywords: SWIFT_KEYWORDS,
- contains: [] // assigned later
- };
- var NUMBERS = {
- className: 'number',
- begin: '\\b([\\d_]+(\\.[\\deE_]+)?|0x[a-fA-F0-9_]+(\\.[a-fA-F0-9p_]+)?|0b[01_]+|0o[0-7_]+)\\b',
- relevance: 0
- };
- var QUOTE_STRING_MODE = hljs.inherit(hljs.QUOTE_STRING_MODE, {
- contains: [SUBST, hljs.BACKSLASH_ESCAPE]
- });
- SUBST.contains = [NUMBERS];
-
- return {
- keywords: SWIFT_KEYWORDS,
- contains: [
- QUOTE_STRING_MODE,
- hljs.C_LINE_COMMENT_MODE,
- BLOCK_COMMENT,
- TYPE,
- NUMBERS,
- {
- className: 'function',
- beginKeywords: 'func', end: '{', excludeEnd: true,
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {
- begin: /[A-Za-z$_][0-9A-Za-z$_]*/
- }),
- {
- begin: /</, end: />/
- },
- {
- className: 'params',
- begin: /\(/, end: /\)/, endsParent: true,
- keywords: SWIFT_KEYWORDS,
- contains: [
- 'self',
- NUMBERS,
- QUOTE_STRING_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- {begin: ':'} // relevance booster
- ],
- illegal: /["']/
- }
- ],
- illegal: /\[|%/
- },
- {
- className: 'class',
- beginKeywords: 'struct protocol class extension enum',
- keywords: SWIFT_KEYWORDS,
- end: '\\{',
- excludeEnd: true,
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {begin: /[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/})
- ]
- },
- {
- className: 'meta', // @attributes
- begin: '(@warn_unused_result|@exported|@lazy|@noescape|' +
- '@NSCopying|@NSManaged|@objc|@convention|@required|' +
- '@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|' +
- '@infix|@prefix|@postfix|@autoclosure|@testable|@available|' +
- '@nonobjc|@NSApplicationMain|@UIApplicationMain)'
-
- },
- {
- beginKeywords: 'import', end: /$/,
- contains: [hljs.C_LINE_COMMENT_MODE, BLOCK_COMMENT]
- }
- ]
- };
-};
-},{}],268:[function(require,module,exports){
-module.exports = function(hljs) {
-
- var COMMENT = {
- className: 'comment',
- begin: /\$noop\(/,
- end: /\)/,
- contains: [{
- begin: /\(/,
- end: /\)/,
- contains: ['self', {
- begin: /\\./
- }]
- }],
- relevance: 10
- };
-
- var FUNCTION = {
- className: 'keyword',
- begin: /\$(?!noop)[a-zA-Z][_a-zA-Z0-9]*/,
- end: /\(/,
- excludeEnd: true
- };
-
- var VARIABLE = {
- className: 'variable',
- begin: /%[_a-zA-Z0-9:]*/,
- end: '%'
- };
-
- var ESCAPE_SEQUENCE = {
- className: 'symbol',
- begin: /\\./
- };
-
- return {
- contains: [
- COMMENT,
- FUNCTION,
- VARIABLE,
- ESCAPE_SEQUENCE
- ]
- };
-};
-},{}],269:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- case_insensitive: true,
- contains: [
- hljs.HASH_COMMENT_MODE,
- // version of format and total amount of testcases
- {
- className: 'meta',
- variants: [
- { begin: '^TAP version (\\d+)$' },
- { begin: '^1\\.\\.(\\d+)$' }
- ],
- },
- // YAML block
- {
- begin: '(\s+)?---$', end: '\\.\\.\\.$',
- subLanguage: 'yaml',
- relevance: 0
- },
- // testcase number
- {
- className: 'number',
- begin: ' (\\d+) '
- },
- // testcase status and description
- {
- className: 'symbol',
- variants: [
- { begin: '^ok' },
- { begin: '^not ok' }
- ],
- },
- ]
- };
-};
-},{}],270:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['tk'],
- keywords: 'after append apply array auto_execok auto_import auto_load auto_mkindex ' +
- 'auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd chan clock ' +
- 'close concat continue dde dict encoding eof error eval exec exit expr fblocked ' +
- 'fconfigure fcopy file fileevent filename flush for foreach format gets glob global ' +
- 'history http if incr info interp join lappend|10 lassign|10 lindex|10 linsert|10 list ' +
- 'llength|10 load lrange|10 lrepeat|10 lreplace|10 lreverse|10 lsearch|10 lset|10 lsort|10 '+
- 'mathfunc mathop memory msgcat namespace open package parray pid pkg::create pkg_mkIndex '+
- 'platform platform::shell proc puts pwd read refchan regexp registry regsub|10 rename '+
- 'return safe scan seek set socket source split string subst switch tcl_endOfWord '+
- 'tcl_findLibrary tcl_startOfNextWord tcl_startOfPreviousWord tcl_wordBreakAfter '+
- 'tcl_wordBreakBefore tcltest tclvars tell time tm trace unknown unload unset update '+
- 'uplevel upvar variable vwait while',
- contains: [
- hljs.COMMENT(';[ \\t]*#', '$'),
- hljs.COMMENT('^[ \\t]*#', '$'),
- {
- beginKeywords: 'proc',
- end: '[\\{]',
- excludeEnd: true,
- contains: [
- {
- className: 'title',
- begin: '[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*',
- end: '[ \\t\\n\\r]',
- endsWithParent: true,
- excludeEnd: true
- }
- ]
- },
- {
- excludeEnd: true,
- variants: [
- {
- begin: '\\$(\\{)?(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*\\(([a-zA-Z0-9_])*\\)',
- end: '[^a-zA-Z0-9_\\}\\$]'
- },
- {
- begin: '\\$(\\{)?(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*',
- end: '(\\))?[^a-zA-Z0-9_\\}\\$]'
- }
- ]
- },
- {
- className: 'string',
- contains: [hljs.BACKSLASH_ESCAPE],
- variants: [
- hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}),
- hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null})
- ]
- },
- {
- className: 'number',
- variants: [hljs.BINARY_NUMBER_MODE, hljs.C_NUMBER_MODE]
- }
- ]
- }
-};
-},{}],271:[function(require,module,exports){
-module.exports = function(hljs) {
- var COMMAND = {
- className: 'tag',
- begin: /\\/,
- relevance: 0,
- contains: [
- {
- className: 'name',
- variants: [
- {begin: /[a-zA-Zа-яА-я]+[*]?/},
- {begin: /[^a-zA-Zа-яА-я0-9]/}
- ],
- starts: {
- endsWithParent: true,
- relevance: 0,
- contains: [
- {
- className: 'string', // because it looks like attributes in HTML tags
- variants: [
- {begin: /\[/, end: /\]/},
- {begin: /\{/, end: /\}/}
- ]
- },
- {
- begin: /\s*=\s*/, endsWithParent: true,
- relevance: 0,
- contains: [
- {
- className: 'number',
- begin: /-?\d*\.?\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?/
- }
- ]
- }
- ]
- }
- }
- ]
- };
-
- return {
- contains: [
- COMMAND,
- {
- className: 'formula',
- contains: [COMMAND],
- relevance: 0,
- variants: [
- {begin: /\$\$/, end: /\$\$/},
- {begin: /\$/, end: /\$/}
- ]
- },
- hljs.COMMENT(
- '%',
- '$',
- {
- relevance: 0
- }
- )
- ]
- };
-};
-},{}],272:[function(require,module,exports){
-module.exports = function(hljs) {
- var BUILT_IN_TYPES = 'bool byte i16 i32 i64 double string binary';
- return {
- keywords: {
- keyword:
- 'namespace const typedef struct enum service exception void oneway set list map required optional',
- built_in:
- BUILT_IN_TYPES,
- literal:
- 'true false'
- },
- contains: [
- hljs.QUOTE_STRING_MODE,
- hljs.NUMBER_MODE,
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- {
- className: 'class',
- beginKeywords: 'struct enum service exception', end: /\{/,
- illegal: /\n/,
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {
- starts: {endsWithParent: true, excludeEnd: true} // hack: eating everything after the first title
- })
- ]
- },
- {
- begin: '\\b(set|list|map)\\s*<', end: '>',
- keywords: BUILT_IN_TYPES,
- contains: ['self']
- }
- ]
- };
-};
-},{}],273:[function(require,module,exports){
-module.exports = function(hljs) {
- var TPID = {
- className: 'number',
- begin: '[1-9][0-9]*', /* no leading zeros */
- relevance: 0
- };
- var TPLABEL = {
- className: 'symbol',
- begin: ':[^\\]]+'
- };
- var TPDATA = {
- className: 'built_in',
- begin: '(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER|\
- TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[', end: '\\]',
- contains: [
- 'self',
- TPID,
- TPLABEL
- ]
- };
- var TPIO = {
- className: 'built_in',
- begin: '(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[', end: '\\]',
- contains: [
- 'self',
- TPID,
- hljs.QUOTE_STRING_MODE, /* for pos section at bottom */
- TPLABEL
- ]
- };
-
- return {
- keywords: {
- keyword:
- 'ABORT ACC ADJUST AND AP_LD BREAK CALL CNT COL CONDITION CONFIG DA DB ' +
- 'DIV DETECT ELSE END ENDFOR ERR_NUM ERROR_PROG FINE FOR GP GUARD INC ' +
- 'IF JMP LINEAR_MAX_SPEED LOCK MOD MONITOR OFFSET Offset OR OVERRIDE ' +
- 'PAUSE PREG PTH RT_LD RUN SELECT SKIP Skip TA TB TO TOOL_OFFSET ' +
- 'Tool_Offset UF UT UFRAME_NUM UTOOL_NUM UNLOCK WAIT X Y Z W P R STRLEN ' +
- 'SUBSTR FINDSTR VOFFSET PROG ATTR MN POS',
- literal:
- 'ON OFF max_speed LPOS JPOS ENABLE DISABLE START STOP RESET'
- },
- contains: [
- TPDATA,
- TPIO,
- {
- className: 'keyword',
- begin: '/(PROG|ATTR|MN|POS|END)\\b'
- },
- {
- /* this is for cases like ,CALL */
- className: 'keyword',
- begin: '(CALL|RUN|POINT_LOGIC|LBL)\\b'
- },
- {
- /* this is for cases like CNT100 where the default lexemes do not
- * separate the keyword and the number */
- className: 'keyword',
- begin: '\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)'
- },
- {
- /* to catch numbers that do not have a word boundary on the left */
- className: 'number',
- begin: '\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b',
- relevance: 0
- },
- hljs.COMMENT('//', '[;$]'),
- hljs.COMMENT('!', '[;$]'),
- hljs.COMMENT('--eg:', '$'),
- hljs.QUOTE_STRING_MODE,
- {
- className: 'string',
- begin: '\'', end: '\''
- },
- hljs.C_NUMBER_MODE,
- {
- className: 'variable',
- begin: '\\$[A-Za-z0-9_]+'
- }
- ]
- };
-};
-},{}],274:[function(require,module,exports){
-module.exports = function(hljs) {
- var PARAMS = {
- className: 'params',
- begin: '\\(', end: '\\)'
- };
-
- var FUNCTION_NAMES = 'attribute block constant cycle date dump include ' +
- 'max min parent random range source template_from_string';
-
- var FUNCTIONS = {
- beginKeywords: FUNCTION_NAMES,
- keywords: {name: FUNCTION_NAMES},
- relevance: 0,
- contains: [
- PARAMS
- ]
- };
-
- var FILTER = {
- begin: /\|[A-Za-z_]+:?/,
- keywords:
- 'abs batch capitalize convert_encoding date date_modify default ' +
- 'escape first format join json_encode keys last length lower ' +
- 'merge nl2br number_format raw replace reverse round slice sort split ' +
- 'striptags title trim upper url_encode',
- contains: [
- FUNCTIONS
- ]
- };
-
- var TAGS = 'autoescape block do embed extends filter flush for ' +
- 'if import include macro sandbox set spaceless use verbatim';
-
- TAGS = TAGS + ' ' + TAGS.split(' ').map(function(t){return 'end' + t}).join(' ');
-
- return {
- aliases: ['craftcms'],
- case_insensitive: true,
- subLanguage: 'xml',
- contains: [
- hljs.COMMENT(/\{#/, /#}/),
- {
- className: 'template-tag',
- begin: /\{%/, end: /%}/,
- contains: [
- {
- className: 'name',
- begin: /\w+/,
- keywords: TAGS,
- starts: {
- endsWithParent: true,
- contains: [FILTER, FUNCTIONS],
- relevance: 0
- }
- }
- ]
- },
- {
- className: 'template-variable',
- begin: /\{\{/, end: /}}/,
- contains: ['self', FILTER, FUNCTIONS]
- }
- ]
- };
-};
-},{}],275:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS = {
- keyword:
- 'in if for while finally var new function do return void else break catch ' +
- 'instanceof with throw case default try this switch continue typeof delete ' +
- 'let yield const class public private protected get set super ' +
- 'static implements enum export import declare type namespace abstract ' +
- 'as from extends async await',
- literal:
- 'true false null undefined NaN Infinity',
- built_in:
- 'eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent ' +
- 'encodeURI encodeURIComponent escape unescape Object Function Boolean Error ' +
- 'EvalError InternalError RangeError ReferenceError StopIteration SyntaxError ' +
- 'TypeError URIError Number Math Date String RegExp Array Float32Array ' +
- 'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' +
- 'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' +
- 'module console window document any number boolean string void Promise'
- };
-
- return {
- aliases: ['ts'],
- keywords: KEYWORDS,
- contains: [
- {
- className: 'meta',
- begin: /^\s*['"]use strict['"]/
- },
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- { // template string
- className: 'string',
- begin: '`', end: '`',
- contains: [
- hljs.BACKSLASH_ESCAPE,
- {
- className: 'subst',
- begin: '\\$\\{', end: '\\}'
- }
- ]
- },
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- {
- className: 'number',
- variants: [
- { begin: '\\b(0[bB][01]+)' },
- { begin: '\\b(0[oO][0-7]+)' },
- { begin: hljs.C_NUMBER_RE }
- ],
- relevance: 0
- },
- { // "value" container
- begin: '(' + hljs.RE_STARTERS_RE + '|\\b(case|return|throw)\\b)\\s*',
- keywords: 'return throw case',
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.REGEXP_MODE,
- {
- className: 'function',
- begin: '(\\(.*?\\)|' + hljs.IDENT_RE + ')\\s*=>', returnBegin: true,
- end: '\\s*=>',
- contains: [
- {
- className: 'params',
- variants: [
- {
- begin: hljs.IDENT_RE
- },
- {
- begin: /\(\s*\)/,
- },
- {
- begin: /\(/, end: /\)/,
- excludeBegin: true, excludeEnd: true,
- keywords: KEYWORDS,
- contains: [
- 'self',
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ]
- }
- ]
- }
- ]
- }
- ],
- relevance: 0
- },
- {
- className: 'function',
- begin: 'function', end: /[\{;]/, excludeEnd: true,
- keywords: KEYWORDS,
- contains: [
- 'self',
- hljs.inherit(hljs.TITLE_MODE, {begin: /[A-Za-z$_][0-9A-Za-z$_]*/}),
- {
- className: 'params',
- begin: /\(/, end: /\)/,
- excludeBegin: true,
- excludeEnd: true,
- keywords: KEYWORDS,
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ],
- illegal: /["'\(]/
- }
- ],
- illegal: /%/,
- relevance: 0 // () => {} is more typical in TypeScript
- },
- {
- beginKeywords: 'constructor', end: /\{/, excludeEnd: true,
- contains: [
- 'self',
- {
- className: 'params',
- begin: /\(/, end: /\)/,
- excludeBegin: true,
- excludeEnd: true,
- keywords: KEYWORDS,
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE
- ],
- illegal: /["'\(]/
- }
- ]
- },
- { // prevent references like module.id from being higlighted as module definitions
- begin: /module\./,
- keywords: {built_in: 'module'},
- relevance: 0
- },
- {
- beginKeywords: 'module', end: /\{/, excludeEnd: true
- },
- {
- beginKeywords: 'interface', end: /\{/, excludeEnd: true,
- keywords: 'interface extends'
- },
- {
- begin: /\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
- },
- {
- begin: '\\.' + hljs.IDENT_RE, relevance: 0 // hack: prevents detection of keywords after dots
- },
- {
- className: 'meta', begin: '@[A-Za-z]+'
- }
- ]
- };
-};
-},{}],276:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- keywords: {
- keyword:
- // Value types
- 'char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 ' +
- 'uint16 uint32 uint64 float double bool struct enum string void ' +
- // Reference types
- 'weak unowned owned ' +
- // Modifiers
- 'async signal static abstract interface override virtual delegate ' +
- // Control Structures
- 'if while do for foreach else switch case break default return try catch ' +
- // Visibility
- 'public private protected internal ' +
- // Other
- 'using new this get set const stdout stdin stderr var',
- built_in:
- 'DBus GLib CCode Gee Object Gtk Posix',
- literal:
- 'false true null'
- },
- contains: [
- {
- className: 'class',
- beginKeywords: 'class interface namespace', end: '{', excludeEnd: true,
- illegal: '[^,:\\n\\s\\.]',
- contains: [
- hljs.UNDERSCORE_TITLE_MODE
- ]
- },
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- {
- className: 'string',
- begin: '"""', end: '"""',
- relevance: 5
- },
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE,
- {
- className: 'meta',
- begin: '^#', end: '$',
- relevance: 2
- }
- ]
- };
-};
-},{}],277:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['vb'],
- case_insensitive: true,
- keywords: {
- keyword:
- 'addhandler addressof alias and andalso aggregate ansi as assembly auto binary by byref byval ' + /* a-b */
- 'call case catch class compare const continue custom declare default delegate dim distinct do ' + /* c-d */
- 'each equals else elseif end enum erase error event exit explicit finally for friend from function ' + /* e-f */
- 'get global goto group handles if implements imports in inherits interface into is isfalse isnot istrue ' + /* g-i */
- 'join key let lib like loop me mid mod module mustinherit mustoverride mybase myclass ' + /* j-m */
- 'namespace narrowing new next not notinheritable notoverridable ' + /* n */
- 'of off on operator option optional or order orelse overloads overridable overrides ' + /* o */
- 'paramarray partial preserve private property protected public ' + /* p */
- 'raiseevent readonly redim rem removehandler resume return ' + /* r */
- 'select set shadows shared skip static step stop structure strict sub synclock ' + /* s */
- 'take text then throw to try unicode until using when where while widening with withevents writeonly xor', /* t-x */
- built_in:
- 'boolean byte cbool cbyte cchar cdate cdec cdbl char cint clng cobj csbyte cshort csng cstr ctype ' + /* b-c */
- 'date decimal directcast double gettype getxmlnamespace iif integer long object ' + /* d-o */
- 'sbyte short single string trycast typeof uinteger ulong ushort', /* s-u */
- literal:
- 'true false nothing'
- },
- illegal: '//|{|}|endif|gosub|variant|wend', /* reserved deprecated keywords */
- contains: [
- hljs.inherit(hljs.QUOTE_STRING_MODE, {contains: [{begin: '""'}]}),
- hljs.COMMENT(
- '\'',
- '$',
- {
- returnBegin: true,
- contains: [
- {
- className: 'doctag',
- begin: '\'\'\'|<!--|-->',
- contains: [hljs.PHRASAL_WORDS_MODE]
- },
- {
- className: 'doctag',
- begin: '</?', end: '>',
- contains: [hljs.PHRASAL_WORDS_MODE]
- }
- ]
- }
- ),
- hljs.C_NUMBER_MODE,
- {
- className: 'meta',
- begin: '#', end: '$',
- keywords: {'meta-keyword': 'if else elseif end region externalsource'}
- }
- ]
- };
-};
-},{}],278:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- subLanguage: 'xml',
- contains: [
- {
- begin: '<%', end: '%>',
- subLanguage: 'vbscript'
- }
- ]
- };
-};
-},{}],279:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- aliases: ['vbs'],
- case_insensitive: true,
- keywords: {
- keyword:
- 'call class const dim do loop erase execute executeglobal exit for each next function ' +
- 'if then else on error option explicit new private property let get public randomize ' +
- 'redim rem select case set stop sub while wend with end to elseif is or xor and not ' +
- 'class_initialize class_terminate default preserve in me byval byref step resume goto',
- built_in:
- 'lcase month vartype instrrev ubound setlocale getobject rgb getref string ' +
- 'weekdayname rnd dateadd monthname now day minute isarray cbool round formatcurrency ' +
- 'conversions csng timevalue second year space abs clng timeserial fixs len asc ' +
- 'isempty maths dateserial atn timer isobject filter weekday datevalue ccur isdate ' +
- 'instr datediff formatdatetime replace isnull right sgn array snumeric log cdbl hex ' +
- 'chr lbound msgbox ucase getlocale cos cdate cbyte rtrim join hour oct typename trim ' +
- 'strcomp int createobject loadpicture tan formatnumber mid scriptenginebuildversion ' +
- 'scriptengine split scriptengineminorversion cint sin datepart ltrim sqr ' +
- 'scriptenginemajorversion time derived eval date formatpercent exp inputbox left ascw ' +
- 'chrw regexp server response request cstr err',
- literal:
- 'true false null nothing empty'
- },
- illegal: '//',
- contains: [
- hljs.inherit(hljs.QUOTE_STRING_MODE, {contains: [{begin: '""'}]}),
- hljs.COMMENT(
- /'/,
- /$/,
- {
- relevance: 0
- }
- ),
- hljs.C_NUMBER_MODE
- ]
- };
-};
-},{}],280:[function(require,module,exports){
-module.exports = function(hljs) {
- var SV_KEYWORDS = {
- keyword:
- 'accept_on alias always always_comb always_ff always_latch and assert assign ' +
- 'assume automatic before begin bind bins binsof bit break buf|0 bufif0 bufif1 ' +
- 'byte case casex casez cell chandle checker class clocking cmos config const ' +
- 'constraint context continue cover covergroup coverpoint cross deassign default ' +
- 'defparam design disable dist do edge else end endcase endchecker endclass ' +
- 'endclocking endconfig endfunction endgenerate endgroup endinterface endmodule ' +
- 'endpackage endprimitive endprogram endproperty endspecify endsequence endtable ' +
- 'endtask enum event eventually expect export extends extern final first_match for ' +
- 'force foreach forever fork forkjoin function generate|5 genvar global highz0 highz1 ' +
- 'if iff ifnone ignore_bins illegal_bins implements implies import incdir include ' +
- 'initial inout input inside instance int integer interconnect interface intersect ' +
- 'join join_any join_none large let liblist library local localparam logic longint ' +
- 'macromodule matches medium modport module nand negedge nettype new nexttime nmos ' +
- 'nor noshowcancelled not notif0 notif1 or output package packed parameter pmos ' +
- 'posedge primitive priority program property protected pull0 pull1 pulldown pullup ' +
- 'pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos ' +
- 'real realtime ref reg reject_on release repeat restrict return rnmos rpmos rtran ' +
- 'rtranif0 rtranif1 s_always s_eventually s_nexttime s_until s_until_with scalared ' +
- 'sequence shortint shortreal showcancelled signed small soft solve specify specparam ' +
- 'static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on ' +
- 'sync_reject_on table tagged task this throughout time timeprecision timeunit tran ' +
- 'tranif0 tranif1 tri tri0 tri1 triand trior trireg type typedef union unique unique0 ' +
- 'unsigned until until_with untyped use uwire var vectored virtual void wait wait_order ' +
- 'wand weak weak0 weak1 while wildcard wire with within wor xnor xor',
- literal:
- 'null',
- built_in:
- '$finish $stop $exit $fatal $error $warning $info $realtime $time $printtimescale ' +
- '$bitstoreal $bitstoshortreal $itor $signed $cast $bits $stime $timeformat ' +
- '$realtobits $shortrealtobits $rtoi $unsigned $asserton $assertkill $assertpasson ' +
- '$assertfailon $assertnonvacuouson $assertoff $assertcontrol $assertpassoff ' +
- '$assertfailoff $assertvacuousoff $isunbounded $sampled $fell $changed $past_gclk ' +
- '$fell_gclk $changed_gclk $rising_gclk $steady_gclk $coverage_control ' +
- '$coverage_get $coverage_save $set_coverage_db_name $rose $stable $past ' +
- '$rose_gclk $stable_gclk $future_gclk $falling_gclk $changing_gclk $display ' +
- '$coverage_get_max $coverage_merge $get_coverage $load_coverage_db $typename ' +
- '$unpacked_dimensions $left $low $increment $clog2 $ln $log10 $exp $sqrt $pow ' +
- '$floor $ceil $sin $cos $tan $countbits $onehot $isunknown $fatal $warning ' +
- '$dimensions $right $high $size $asin $acos $atan $atan2 $hypot $sinh $cosh ' +
- '$tanh $asinh $acosh $atanh $countones $onehot0 $error $info $random ' +
- '$dist_chi_square $dist_erlang $dist_exponential $dist_normal $dist_poisson ' +
- '$dist_t $dist_uniform $q_initialize $q_remove $q_exam $async$and$array ' +
- '$async$nand$array $async$or$array $async$nor$array $sync$and$array ' +
- '$sync$nand$array $sync$or$array $sync$nor$array $q_add $q_full $psprintf ' +
- '$async$and$plane $async$nand$plane $async$or$plane $async$nor$plane ' +
- '$sync$and$plane $sync$nand$plane $sync$or$plane $sync$nor$plane $system ' +
- '$display $displayb $displayh $displayo $strobe $strobeb $strobeh $strobeo ' +
- '$write $readmemb $readmemh $writememh $value$plusargs ' +
- '$dumpvars $dumpon $dumplimit $dumpports $dumpportson $dumpportslimit ' +
- '$writeb $writeh $writeo $monitor $monitorb $monitorh $monitoro $writememb ' +
- '$dumpfile $dumpoff $dumpall $dumpflush $dumpportsoff $dumpportsall ' +
- '$dumpportsflush $fclose $fdisplay $fdisplayb $fdisplayh $fdisplayo ' +
- '$fstrobe $fstrobeb $fstrobeh $fstrobeo $swrite $swriteb $swriteh ' +
- '$swriteo $fscanf $fread $fseek $fflush $feof $fopen $fwrite $fwriteb ' +
- '$fwriteh $fwriteo $fmonitor $fmonitorb $fmonitorh $fmonitoro $sformat ' +
- '$sformatf $fgetc $ungetc $fgets $sscanf $rewind $ftell $ferror'
- };
- return {
- aliases: ['v', 'sv', 'svh'],
- case_insensitive: false,
- keywords: SV_KEYWORDS, lexemes: /[\w\$]+/,
- contains: [
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.C_LINE_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- {
- className: 'number',
- contains: [hljs.BACKSLASH_ESCAPE],
- variants: [
- {begin: '\\b((\\d+\'(b|h|o|d|B|H|O|D))[0-9xzXZa-fA-F_]+)'},
- {begin: '\\B((\'(b|h|o|d|B|H|O|D))[0-9xzXZa-fA-F_]+)'},
- {begin: '\\b([0-9_])+', relevance: 0}
- ]
- },
- /* parameters to instances */
- {
- className: 'variable',
- variants: [
- {begin: '#\\((?!parameter).+\\)'},
- {begin: '\\.\\w+', relevance: 0},
- ]
- },
- {
- className: 'meta',
- begin: '`', end: '$',
- keywords: {'meta-keyword': 'define __FILE__ ' +
- '__LINE__ begin_keywords celldefine default_nettype define ' +
- 'else elsif end_keywords endcelldefine endif ifdef ifndef ' +
- 'include line nounconnected_drive pragma resetall timescale ' +
- 'unconnected_drive undef undefineall'},
- relevance: 0
- }
- ]
- }; // return
-};
-},{}],281:[function(require,module,exports){
-module.exports = function(hljs) {
- // Regular expression for VHDL numeric literals.
-
- // Decimal literal:
- var INTEGER_RE = '\\d(_|\\d)*';
- var EXPONENT_RE = '[eE][-+]?' + INTEGER_RE;
- var DECIMAL_LITERAL_RE = INTEGER_RE + '(\\.' + INTEGER_RE + ')?' + '(' + EXPONENT_RE + ')?';
- // Based literal:
- var BASED_INTEGER_RE = '\\w+';
- var BASED_LITERAL_RE = INTEGER_RE + '#' + BASED_INTEGER_RE + '(\\.' + BASED_INTEGER_RE + ')?' + '#' + '(' + EXPONENT_RE + ')?';
-
- var NUMBER_RE = '\\b(' + BASED_LITERAL_RE + '|' + DECIMAL_LITERAL_RE + ')';
-
- return {
- case_insensitive: true,
- keywords: {
- keyword:
- 'abs access after alias all and architecture array assert assume assume_guarantee attribute ' +
- 'begin block body buffer bus case component configuration constant context cover disconnect ' +
- 'downto default else elsif end entity exit fairness file for force function generate ' +
- 'generic group guarded if impure in inertial inout is label library linkage literal ' +
- 'loop map mod nand new next nor not null of on open or others out package port ' +
- 'postponed procedure process property protected pure range record register reject ' +
- 'release rem report restrict restrict_guarantee return rol ror select sequence ' +
- 'severity shared signal sla sll sra srl strong subtype then to transport type ' +
- 'unaffected units until use variable vmode vprop vunit wait when while with xnor xor',
- built_in:
- 'boolean bit character ' +
- 'integer time delay_length natural positive ' +
- 'string bit_vector file_open_kind file_open_status ' +
- 'std_logic std_logic_vector unsigned signed boolean_vector integer_vector ' +
- 'std_ulogic std_ulogic_vector unresolved_unsigned u_unsigned unresolved_signed u_signed' +
- 'real_vector time_vector',
- literal:
- 'false true note warning error failure ' + // severity_level
- 'line text side width' // textio
- },
- illegal: '{',
- contains: [
- hljs.C_BLOCK_COMMENT_MODE, // VHDL-2008 block commenting.
- hljs.COMMENT('--', '$'),
- hljs.QUOTE_STRING_MODE,
- {
- className: 'number',
- begin: NUMBER_RE,
- relevance: 0
- },
- {
- className: 'string',
- begin: '\'(U|X|0|1|Z|W|L|H|-)\'',
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- className: 'symbol',
- begin: '\'[A-Za-z](_?[A-Za-z0-9])*',
- contains: [hljs.BACKSLASH_ESCAPE]
- }
- ]
- };
-};
-},{}],282:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- lexemes: /[!#@\w]+/,
- keywords: {
- keyword:
- // express version except: ! & * < = > !! # @ @@
- 'N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea breaka breakd breakl bro bufdo buffers bun bw c|0 cN cNf ca cabc caddb cad caddf cal cat cb cc ccl cd ce cex cf cfir cgetb cgete cg changes chd che checkt cl cla clo cm cmapc cme cn cnew cnf cno cnorea cnoreme co col colo com comc comp con conf cope '+
- 'cp cpf cq cr cs cst cu cuna cunme cw delm deb debugg delc delf dif diffg diffo diffp diffpu diffs diffthis dig di dl dell dj dli do doautoa dp dr ds dsp e|0 ea ec echoe echoh echom echon el elsei em en endfo endf endt endw ene ex exe exi exu f|0 files filet fin fina fini fir fix fo foldc foldd folddoc foldo for fu go gr grepa gu gv ha helpf helpg helpt hi hid his ia iabc if ij il im imapc '+
- 'ime ino inorea inoreme int is isp iu iuna iunme j|0 ju k|0 keepa kee keepj lN lNf l|0 lad laddb laddf la lan lat lb lc lch lcl lcs le lefta let lex lf lfir lgetb lgete lg lgr lgrepa lh ll lla lli lmak lm lmapc lne lnew lnf ln loadk lo loc lockv lol lope lp lpf lr ls lt lu lua luad luaf lv lvimgrepa lw m|0 ma mak map mapc marks mat me menut mes mk mks mksp mkv mkvie mod mz mzf nbc nb nbs new nm nmapc nme nn nnoreme noa no noh norea noreme norm nu nun nunme ol o|0 om omapc ome on ono onoreme opt ou ounme ow p|0 '+
- 'profd prof pro promptr pc ped pe perld po popu pp pre prev ps pt ptN ptf ptj ptl ptn ptp ptr pts pu pw py3 python3 py3d py3f py pyd pyf quita qa rec red redi redr redraws reg res ret retu rew ri rightb rub rubyd rubyf rund ru rv sN san sa sal sav sb sbN sba sbf sbl sbm sbn sbp sbr scrip scripte scs se setf setg setl sf sfir sh sim sig sil sl sla sm smap smapc sme sn sni sno snor snoreme sor '+
- 'so spelld spe spelli spellr spellu spellw sp spr sre st sta startg startr star stopi stj sts sun sunm sunme sus sv sw sy synti sync tN tabN tabc tabdo tabe tabf tabfir tabl tabm tabnew '+
- 'tabn tabo tabp tabr tabs tab ta tags tc tcld tclf te tf th tj tl tm tn to tp tr try ts tu u|0 undoj undol una unh unl unlo unm unme uns up ve verb vert vim vimgrepa vi viu vie vm vmapc vme vne vn vnoreme vs vu vunme windo w|0 wN wa wh wi winc winp wn wp wq wqa ws wu wv x|0 xa xmapc xm xme xn xnoreme xu xunme y|0 z|0 ~ '+
- // full version
- 'Next Print append abbreviate abclear aboveleft all amenu anoremenu args argadd argdelete argedit argglobal arglocal argument ascii autocmd augroup aunmenu buffer bNext ball badd bdelete behave belowright bfirst blast bmodified bnext botright bprevious brewind break breakadd breakdel breaklist browse bunload '+
- 'bwipeout change cNext cNfile cabbrev cabclear caddbuffer caddexpr caddfile call catch cbuffer cclose center cexpr cfile cfirst cgetbuffer cgetexpr cgetfile chdir checkpath checktime clist clast close cmap cmapclear cmenu cnext cnewer cnfile cnoremap cnoreabbrev cnoremenu copy colder colorscheme command comclear compiler continue confirm copen cprevious cpfile cquit crewind cscope cstag cunmap '+
- 'cunabbrev cunmenu cwindow delete delmarks debug debuggreedy delcommand delfunction diffupdate diffget diffoff diffpatch diffput diffsplit digraphs display deletel djump dlist doautocmd doautoall deletep drop dsearch dsplit edit earlier echo echoerr echohl echomsg else elseif emenu endif endfor '+
- 'endfunction endtry endwhile enew execute exit exusage file filetype find finally finish first fixdel fold foldclose folddoopen folddoclosed foldopen function global goto grep grepadd gui gvim hardcopy help helpfind helpgrep helptags highlight hide history insert iabbrev iabclear ijump ilist imap '+
- 'imapclear imenu inoremap inoreabbrev inoremenu intro isearch isplit iunmap iunabbrev iunmenu join jumps keepalt keepmarks keepjumps lNext lNfile list laddexpr laddbuffer laddfile last language later lbuffer lcd lchdir lclose lcscope left leftabove lexpr lfile lfirst lgetbuffer lgetexpr lgetfile lgrep lgrepadd lhelpgrep llast llist lmake lmap lmapclear lnext lnewer lnfile lnoremap loadkeymap loadview '+
- 'lockmarks lockvar lolder lopen lprevious lpfile lrewind ltag lunmap luado luafile lvimgrep lvimgrepadd lwindow move mark make mapclear match menu menutranslate messages mkexrc mksession mkspell mkvimrc mkview mode mzscheme mzfile nbclose nbkey nbsart next nmap nmapclear nmenu nnoremap '+
- 'nnoremenu noautocmd noremap nohlsearch noreabbrev noremenu normal number nunmap nunmenu oldfiles open omap omapclear omenu only onoremap onoremenu options ounmap ounmenu ownsyntax print profdel profile promptfind promptrepl pclose pedit perl perldo pop popup ppop preserve previous psearch ptag ptNext '+
- 'ptfirst ptjump ptlast ptnext ptprevious ptrewind ptselect put pwd py3do py3file python pydo pyfile quit quitall qall read recover redo redir redraw redrawstatus registers resize retab return rewind right rightbelow ruby rubydo rubyfile rundo runtime rviminfo substitute sNext sandbox sargument sall saveas sbuffer sbNext sball sbfirst sblast sbmodified sbnext sbprevious sbrewind scriptnames scriptencoding '+
- 'scscope set setfiletype setglobal setlocal sfind sfirst shell simalt sign silent sleep slast smagic smapclear smenu snext sniff snomagic snoremap snoremenu sort source spelldump spellgood spellinfo spellrepall spellundo spellwrong split sprevious srewind stop stag startgreplace startreplace '+
- 'startinsert stopinsert stjump stselect sunhide sunmap sunmenu suspend sview swapname syntax syntime syncbind tNext tabNext tabclose tabedit tabfind tabfirst tablast tabmove tabnext tabonly tabprevious tabrewind tag tcl tcldo tclfile tearoff tfirst throw tjump tlast tmenu tnext topleft tprevious '+'trewind tselect tunmenu undo undojoin undolist unabbreviate unhide unlet unlockvar unmap unmenu unsilent update vglobal version verbose vertical vimgrep vimgrepadd visual viusage view vmap vmapclear vmenu vnew '+
- 'vnoremap vnoremenu vsplit vunmap vunmenu write wNext wall while winsize wincmd winpos wnext wprevious wqall wsverb wundo wviminfo xit xall xmapclear xmap xmenu xnoremap xnoremenu xunmap xunmenu yank',
- built_in: //built in func
- 'synIDtrans atan2 range matcharg did_filetype asin feedkeys xor argv ' +
- 'complete_check add getwinposx getqflist getwinposy screencol ' +
- 'clearmatches empty extend getcmdpos mzeval garbagecollect setreg ' +
- 'ceil sqrt diff_hlID inputsecret get getfperm getpid filewritable ' +
- 'shiftwidth max sinh isdirectory synID system inputrestore winline ' +
- 'atan visualmode inputlist tabpagewinnr round getregtype mapcheck ' +
- 'hasmapto histdel argidx findfile sha256 exists toupper getcmdline ' +
- 'taglist string getmatches bufnr strftime winwidth bufexists ' +
- 'strtrans tabpagebuflist setcmdpos remote_read printf setloclist ' +
- 'getpos getline bufwinnr float2nr len getcmdtype diff_filler luaeval ' +
- 'resolve libcallnr foldclosedend reverse filter has_key bufname ' +
- 'str2float strlen setline getcharmod setbufvar index searchpos ' +
- 'shellescape undofile foldclosed setqflist buflisted strchars str2nr ' +
- 'virtcol floor remove undotree remote_expr winheight gettabwinvar ' +
- 'reltime cursor tabpagenr finddir localtime acos getloclist search ' +
- 'tanh matchend rename gettabvar strdisplaywidth type abs py3eval ' +
- 'setwinvar tolower wildmenumode log10 spellsuggest bufloaded ' +
- 'synconcealed nextnonblank server2client complete settabwinvar ' +
- 'executable input wincol setmatches getftype hlID inputsave ' +
- 'searchpair or screenrow line settabvar histadd deepcopy strpart ' +
- 'remote_peek and eval getftime submatch screenchar winsaveview ' +
- 'matchadd mkdir screenattr getfontname libcall reltimestr getfsize ' +
- 'winnr invert pow getbufline byte2line soundfold repeat fnameescape ' +
- 'tagfiles sin strwidth spellbadword trunc maparg log lispindent ' +
- 'hostname setpos globpath remote_foreground getchar synIDattr ' +
- 'fnamemodify cscope_connection stridx winbufnr indent min ' +
- 'complete_add nr2char searchpairpos inputdialog values matchlist ' +
- 'items hlexists strridx browsedir expand fmod pathshorten line2byte ' +
- 'argc count getwinvar glob foldtextresult getreg foreground cosh ' +
- 'matchdelete has char2nr simplify histget searchdecl iconv ' +
- 'winrestcmd pumvisible writefile foldlevel haslocaldir keys cos ' +
- 'matchstr foldtext histnr tan tempname getcwd byteidx getbufvar ' +
- 'islocked escape eventhandler remote_send serverlist winrestview ' +
- 'synstack pyeval prevnonblank readfile cindent filereadable changenr ' +
- 'exp'
- },
- illegal: /;/,
- contains: [
- hljs.NUMBER_MODE,
- hljs.APOS_STRING_MODE,
-
- /*
- A double quote can start either a string or a line comment. Strings are
- ended before the end of a line by another double quote and can contain
- escaped double-quotes and post-escaped line breaks.
-
- Also, any double quote at the beginning of a line is a comment but we
- don't handle that properly at the moment: any double quote inside will
- turn them into a string. Handling it properly will require a smarter
- parser.
- */
- {
- className: 'string',
- begin: /"(\\"|\n\\|[^"\n])*"/
- },
- hljs.COMMENT('"', '$'),
-
- {
- className: 'variable',
- begin: /[bwtglsav]:[\w\d_]*/
- },
- {
- className: 'function',
- beginKeywords: 'function function!', end: '$',
- relevance: 0,
- contains: [
- hljs.TITLE_MODE,
- {
- className: 'params',
- begin: '\\(', end: '\\)'
- }
- ]
- },
- {
- className: 'symbol',
- begin: /<[\w-]+>/
- }
- ]
- };
-};
-},{}],283:[function(require,module,exports){
-module.exports = function(hljs) {
- return {
- case_insensitive: true,
- lexemes: '[.%]?' + hljs.IDENT_RE,
- keywords: {
- keyword:
- 'lock rep repe repz repne repnz xaquire xrelease bnd nobnd ' +
- 'aaa aad aam aas adc add and arpl bb0_reset bb1_reset bound bsf bsr bswap bt btc btr bts call cbw cdq cdqe clc cld cli clts cmc cmp cmpsb cmpsd cmpsq cmpsw cmpxchg cmpxchg486 cmpxchg8b cmpxchg16b cpuid cpu_read cpu_write cqo cwd cwde daa das dec div dmint emms enter equ f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove fcmovnb fcmovnbe fcmovne fcmovnu fcmovu fcom fcomi fcomip fcomp fcompp fcos fdecstp fdisi fdiv fdivp fdivr fdivrp femms feni ffree ffreep fiadd ficom ficomp fidiv fidivr fild fimul fincstp finit fist fistp fisttp fisub fisubr fld fld1 fldcw fldenv fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnstcw fnstenv fnstsw fpatan fprem fprem1 fptan frndint frstor fsave fscale fsetpm fsin fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr fsubrp ftst fucom fucomi fucomip fucomp fucompp fxam fxch fxtract fyl2x fyl2xp1 hlt ibts icebp idiv imul in inc incbin insb insd insw int int01 int1 int03 int3 into invd invpcid invlpg invlpga iret iretd iretq iretw jcxz jecxz jrcxz jmp jmpe lahf lar lds lea leave les lfence lfs lgdt lgs lidt lldt lmsw loadall loadall286 lodsb lodsd lodsq lodsw loop loope loopne loopnz loopz lsl lss ltr mfence monitor mov movd movq movsb movsd movsq movsw movsx movsxd movzx mul mwait neg nop not or out outsb outsd outsw packssdw packsswb packuswb paddb paddd paddsb paddsiw paddsw paddusb paddusw paddw pand pandn pause paveb pavgusb pcmpeqb pcmpeqd pcmpeqw pcmpgtb pcmpgtd pcmpgtw pdistib pf2id pfacc pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pmachriw pmaddwd pmagw pmulhriw pmulhrwa pmulhrwc pmulhw pmullw pmvgezb pmvlzb pmvnzb pmvzb pop popa popad popaw popf popfd popfq popfw por prefetch prefetchw pslld psllq psllw psrad psraw psrld psrlq psrlw psubb psubd psubsb psubsiw psubsw psubusb psubusw psubw punpckhbw punpckhdq punpckhwd punpcklbw punpckldq punpcklwd push pusha pushad pushaw pushf pushfd pushfq pushfw pxor rcl rcr rdshr rdmsr rdpmc rdtsc rdtscp ret retf retn rol ror rdm rsdc rsldt rsm rsts sahf sal salc sar sbb scasb scasd scasq scasw sfence sgdt shl shld shr shrd sidt sldt skinit smi smint smintold smsw stc std sti stosb stosd stosq stosw str sub svdc svldt svts swapgs syscall sysenter sysexit sysret test ud0 ud1 ud2b ud2 ud2a umov verr verw fwait wbinvd wrshr wrmsr xadd xbts xchg xlatb xlat xor cmove cmovz cmovne cmovnz cmova cmovnbe cmovae cmovnb cmovb cmovnae cmovbe cmovna cmovg cmovnle cmovge cmovnl cmovl cmovnge cmovle cmovng cmovc cmovnc cmovo cmovno cmovs cmovns cmovp cmovpe cmovnp cmovpo je jz jne jnz ja jnbe jae jnb jb jnae jbe jna jg jnle jge jnl jl jnge jle jng jc jnc jo jno js jns jpo jnp jpe jp sete setz setne setnz seta setnbe setae setnb setnc setb setnae setcset setbe setna setg setnle setge setnl setl setnge setle setng sets setns seto setno setpe setp setpo setnp addps addss andnps andps cmpeqps cmpeqss cmpleps cmpless cmpltps cmpltss cmpneqps cmpneqss cmpnleps cmpnless cmpnltps cmpnltss cmpordps cmpordss cmpunordps cmpunordss cmpps cmpss comiss cvtpi2ps cvtps2pi cvtsi2ss cvtss2si cvttps2pi cvttss2si divps divss ldmxcsr maxps maxss minps minss movaps movhps movlhps movlps movhlps movmskps movntps movss movups mulps mulss orps rcpps rcpss rsqrtps rsqrtss shufps sqrtps sqrtss stmxcsr subps subss ucomiss unpckhps unpcklps xorps fxrstor fxrstor64 fxsave fxsave64 xgetbv xsetbv xsave xsave64 xsaveopt xsaveopt64 xrstor xrstor64 prefetchnta prefetcht0 prefetcht1 prefetcht2 maskmovq movntq pavgb pavgw pextrw pinsrw pmaxsw pmaxub pminsw pminub pmovmskb pmulhuw psadbw pshufw pf2iw pfnacc pfpnacc pi2fw pswapd maskmovdqu clflush movntdq movnti movntpd movdqa movdqu movdq2q movq2dq paddq pmuludq pshufd pshufhw pshuflw pslldq psrldq psubq punpckhqdq punpcklqdq addpd addsd andnpd andpd cmpeqpd cmpeqsd cmplepd cmplesd cmpltpd cmpltsd cmpneqpd cmpneqsd cmpnlepd cmpnlesd cmpnltpd cmpnltsd cmpordpd cmpordsd cmpunordpd cmpunordsd cmppd comisd cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps cvtpi2pd cvtps2dq cvtps2pd cvtsd2si cvtsd2ss cvtsi2sd cvtss2sd cvttpd2pi cvttpd2dq cvttps2dq cvttsd2si divpd divsd maxpd maxsd minpd minsd movapd movhpd movlpd movmskpd movupd mulpd mulsd orpd shufpd sqrtpd sqrtsd subpd subsd ucomisd unpckhpd unpcklpd xorpd addsubpd addsubps haddpd haddps hsubpd hsubps lddqu movddup movshdup movsldup clgi stgi vmcall vmclear vmfunc vmlaunch vmload vmmcall vmptrld vmptrst vmread vmresume vmrun vmsave vmwrite vmxoff vmxon invept invvpid pabsb pabsw pabsd palignr phaddw phaddd phaddsw phsubw phsubd phsubsw pmaddubsw pmulhrsw pshufb psignb psignw psignd extrq insertq movntsd movntss lzcnt blendpd blendps blendvpd blendvps dppd dpps extractps insertps movntdqa mpsadbw packusdw pblendvb pblendw pcmpeqq pextrb pextrd pextrq phminposuw pinsrb pinsrd pinsrq pmaxsb pmaxsd pmaxud pmaxuw pminsb pminsd pminud pminuw pmovsxbw pmovsxbd pmovsxbq pmovsxwd pmovsxwq pmovsxdq pmovzxbw pmovzxbd pmovzxbq pmovzxwd pmovzxwq pmovzxdq pmuldq pmulld ptest roundpd roundps roundsd roundss crc32 pcmpestri pcmpestrm pcmpistri pcmpistrm pcmpgtq popcnt getsec pfrcpv pfrsqrtv movbe aesenc aesenclast aesdec aesdeclast aesimc aeskeygenassist vaesenc vaesenclast vaesdec vaesdeclast vaesimc vaeskeygenassist vaddpd vaddps vaddsd vaddss vaddsubpd vaddsubps vandpd vandps vandnpd vandnps vblendpd vblendps vblendvpd vblendvps vbroadcastss vbroadcastsd vbroadcastf128 vcmpeq_ospd vcmpeqpd vcmplt_ospd vcmpltpd vcmple_ospd vcmplepd vcmpunord_qpd vcmpunordpd vcmpneq_uqpd vcmpneqpd vcmpnlt_uspd vcmpnltpd vcmpnle_uspd vcmpnlepd vcmpord_qpd vcmpordpd vcmpeq_uqpd vcmpnge_uspd vcmpngepd vcmpngt_uspd vcmpngtpd vcmpfalse_oqpd vcmpfalsepd vcmpneq_oqpd vcmpge_ospd vcmpgepd vcmpgt_ospd vcmpgtpd vcmptrue_uqpd vcmptruepd vcmplt_oqpd vcmple_oqpd vcmpunord_spd vcmpneq_uspd vcmpnlt_uqpd vcmpnle_uqpd vcmpord_spd vcmpeq_uspd vcmpnge_uqpd vcmpngt_uqpd vcmpfalse_ospd vcmpneq_ospd vcmpge_oqpd vcmpgt_oqpd vcmptrue_uspd vcmppd vcmpeq_osps vcmpeqps vcmplt_osps vcmpltps vcmple_osps vcmpleps vcmpunord_qps vcmpunordps vcmpneq_uqps vcmpneqps vcmpnlt_usps vcmpnltps vcmpnle_usps vcmpnleps vcmpord_qps vcmpordps vcmpeq_uqps vcmpnge_usps vcmpngeps vcmpngt_usps vcmpngtps vcmpfalse_oqps vcmpfalseps vcmpneq_oqps vcmpge_osps vcmpgeps vcmpgt_osps vcmpgtps vcmptrue_uqps vcmptrueps vcmplt_oqps vcmple_oqps vcmpunord_sps vcmpneq_usps vcmpnlt_uqps vcmpnle_uqps vcmpord_sps vcmpeq_usps vcmpnge_uqps vcmpngt_uqps vcmpfalse_osps vcmpneq_osps vcmpge_oqps vcmpgt_oqps vcmptrue_usps vcmpps vcmpeq_ossd vcmpeqsd vcmplt_ossd vcmpltsd vcmple_ossd vcmplesd vcmpunord_qsd vcmpunordsd vcmpneq_uqsd vcmpneqsd vcmpnlt_ussd vcmpnltsd vcmpnle_ussd vcmpnlesd vcmpord_qsd vcmpordsd vcmpeq_uqsd vcmpnge_ussd vcmpngesd vcmpngt_ussd vcmpngtsd vcmpfalse_oqsd vcmpfalsesd vcmpneq_oqsd vcmpge_ossd vcmpgesd vcmpgt_ossd vcmpgtsd vcmptrue_uqsd vcmptruesd vcmplt_oqsd vcmple_oqsd vcmpunord_ssd vcmpneq_ussd vcmpnlt_uqsd vcmpnle_uqsd vcmpord_ssd vcmpeq_ussd vcmpnge_uqsd vcmpngt_uqsd vcmpfalse_ossd vcmpneq_ossd vcmpge_oqsd vcmpgt_oqsd vcmptrue_ussd vcmpsd vcmpeq_osss vcmpeqss vcmplt_osss vcmpltss vcmple_osss vcmpless vcmpunord_qss vcmpunordss vcmpneq_uqss vcmpneqss vcmpnlt_usss vcmpnltss vcmpnle_usss vcmpnless vcmpord_qss vcmpordss vcmpeq_uqss vcmpnge_usss vcmpngess vcmpngt_usss vcmpngtss vcmpfalse_oqss vcmpfalsess vcmpneq_oqss vcmpge_osss vcmpgess vcmpgt_osss vcmpgtss vcmptrue_uqss vcmptruess vcmplt_oqss vcmple_oqss vcmpunord_sss vcmpneq_usss vcmpnlt_uqss vcmpnle_uqss vcmpord_sss vcmpeq_usss vcmpnge_uqss vcmpngt_uqss vcmpfalse_osss vcmpneq_osss vcmpge_oqss vcmpgt_oqss vcmptrue_usss vcmpss vcomisd vcomiss vcvtdq2pd vcvtdq2ps vcvtpd2dq vcvtpd2ps vcvtps2dq vcvtps2pd vcvtsd2si vcvtsd2ss vcvtsi2sd vcvtsi2ss vcvtss2sd vcvtss2si vcvttpd2dq vcvttps2dq vcvttsd2si vcvttss2si vdivpd vdivps vdivsd vdivss vdppd vdpps vextractf128 vextractps vhaddpd vhaddps vhsubpd vhsubps vinsertf128 vinsertps vlddqu vldqqu vldmxcsr vmaskmovdqu vmaskmovps vmaskmovpd vmaxpd vmaxps vmaxsd vmaxss vminpd vminps vminsd vminss vmovapd vmovaps vmovd vmovq vmovddup vmovdqa vmovqqa vmovdqu vmovqqu vmovhlps vmovhpd vmovhps vmovlhps vmovlpd vmovlps vmovmskpd vmovmskps vmovntdq vmovntqq vmovntdqa vmovntpd vmovntps vmovsd vmovshdup vmovsldup vmovss vmovupd vmovups vmpsadbw vmulpd vmulps vmulsd vmulss vorpd vorps vpabsb vpabsw vpabsd vpacksswb vpackssdw vpackuswb vpackusdw vpaddb vpaddw vpaddd vpaddq vpaddsb vpaddsw vpaddusb vpaddusw vpalignr vpand vpandn vpavgb vpavgw vpblendvb vpblendw vpcmpestri vpcmpestrm vpcmpistri vpcmpistrm vpcmpeqb vpcmpeqw vpcmpeqd vpcmpeqq vpcmpgtb vpcmpgtw vpcmpgtd vpcmpgtq vpermilpd vpermilps vperm2f128 vpextrb vpextrw vpextrd vpextrq vphaddw vphaddd vphaddsw vphminposuw vphsubw vphsubd vphsubsw vpinsrb vpinsrw vpinsrd vpinsrq vpmaddwd vpmaddubsw vpmaxsb vpmaxsw vpmaxsd vpmaxub vpmaxuw vpmaxud vpminsb vpminsw vpminsd vpminub vpminuw vpminud vpmovmskb vpmovsxbw vpmovsxbd vpmovsxbq vpmovsxwd vpmovsxwq vpmovsxdq vpmovzxbw vpmovzxbd vpmovzxbq vpmovzxwd vpmovzxwq vpmovzxdq vpmulhuw vpmulhrsw vpmulhw vpmullw vpmulld vpmuludq vpmuldq vpor vpsadbw vpshufb vpshufd vpshufhw vpshuflw vpsignb vpsignw vpsignd vpslldq vpsrldq vpsllw vpslld vpsllq vpsraw vpsrad vpsrlw vpsrld vpsrlq vptest vpsubb vpsubw vpsubd vpsubq vpsubsb vpsubsw vpsubusb vpsubusw vpunpckhbw vpunpckhwd vpunpckhdq vpunpckhqdq vpunpcklbw vpunpcklwd vpunpckldq vpunpcklqdq vpxor vrcpps vrcpss vrsqrtps vrsqrtss vroundpd vroundps vroundsd vroundss vshufpd vshufps vsqrtpd vsqrtps vsqrtsd vsqrtss vstmxcsr vsubpd vsubps vsubsd vsubss vtestps vtestpd vucomisd vucomiss vunpckhpd vunpckhps vunpcklpd vunpcklps vxorpd vxorps vzeroall vzeroupper pclmullqlqdq pclmulhqlqdq pclmullqhqdq pclmulhqhqdq pclmulqdq vpclmullqlqdq vpclmulhqlqdq vpclmullqhqdq vpclmulhqhqdq vpclmulqdq vfmadd132ps vfmadd132pd vfmadd312ps vfmadd312pd vfmadd213ps vfmadd213pd vfmadd123ps vfmadd123pd vfmadd231ps vfmadd231pd vfmadd321ps vfmadd321pd vfmaddsub132ps vfmaddsub132pd vfmaddsub312ps vfmaddsub312pd vfmaddsub213ps vfmaddsub213pd vfmaddsub123ps vfmaddsub123pd vfmaddsub231ps vfmaddsub231pd vfmaddsub321ps vfmaddsub321pd vfmsub132ps vfmsub132pd vfmsub312ps vfmsub312pd vfmsub213ps vfmsub213pd vfmsub123ps vfmsub123pd vfmsub231ps vfmsub231pd vfmsub321ps vfmsub321pd vfmsubadd132ps vfmsubadd132pd vfmsubadd312ps vfmsubadd312pd vfmsubadd213ps vfmsubadd213pd vfmsubadd123ps vfmsubadd123pd vfmsubadd231ps vfmsubadd231pd vfmsubadd321ps vfmsubadd321pd vfnmadd132ps vfnmadd132pd vfnmadd312ps vfnmadd312pd vfnmadd213ps vfnmadd213pd vfnmadd123ps vfnmadd123pd vfnmadd231ps vfnmadd231pd vfnmadd321ps vfnmadd321pd vfnmsub132ps vfnmsub132pd vfnmsub312ps vfnmsub312pd vfnmsub213ps vfnmsub213pd vfnmsub123ps vfnmsub123pd vfnmsub231ps vfnmsub231pd vfnmsub321ps vfnmsub321pd vfmadd132ss vfmadd132sd vfmadd312ss vfmadd312sd vfmadd213ss vfmadd213sd vfmadd123ss vfmadd123sd vfmadd231ss vfmadd231sd vfmadd321ss vfmadd321sd vfmsub132ss vfmsub132sd vfmsub312ss vfmsub312sd vfmsub213ss vfmsub213sd vfmsub123ss vfmsub123sd vfmsub231ss vfmsub231sd vfmsub321ss vfmsub321sd vfnmadd132ss vfnmadd132sd vfnmadd312ss vfnmadd312sd vfnmadd213ss vfnmadd213sd vfnmadd123ss vfnmadd123sd vfnmadd231ss vfnmadd231sd vfnmadd321ss vfnmadd321sd vfnmsub132ss vfnmsub132sd vfnmsub312ss vfnmsub312sd vfnmsub213ss vfnmsub213sd vfnmsub123ss vfnmsub123sd vfnmsub231ss vfnmsub231sd vfnmsub321ss vfnmsub321sd rdfsbase rdgsbase rdrand wrfsbase wrgsbase vcvtph2ps vcvtps2ph adcx adox rdseed clac stac xstore xcryptecb xcryptcbc xcryptctr xcryptcfb xcryptofb montmul xsha1 xsha256 llwpcb slwpcb lwpval lwpins vfmaddpd vfmaddps vfmaddsd vfmaddss vfmaddsubpd vfmaddsubps vfmsubaddpd vfmsubaddps vfmsubpd vfmsubps vfmsubsd vfmsubss vfnmaddpd vfnmaddps vfnmaddsd vfnmaddss vfnmsubpd vfnmsubps vfnmsubsd vfnmsubss vfrczpd vfrczps vfrczsd vfrczss vpcmov vpcomb vpcomd vpcomq vpcomub vpcomud vpcomuq vpcomuw vpcomw vphaddbd vphaddbq vphaddbw vphadddq vphaddubd vphaddubq vphaddubw vphaddudq vphadduwd vphadduwq vphaddwd vphaddwq vphsubbw vphsubdq vphsubwd vpmacsdd vpmacsdqh vpmacsdql vpmacssdd vpmacssdqh vpmacssdql vpmacsswd vpmacssww vpmacswd vpmacsww vpmadcsswd vpmadcswd vpperm vprotb vprotd vprotq vprotw vpshab vpshad vpshaq vpshaw vpshlb vpshld vpshlq vpshlw vbroadcasti128 vpblendd vpbroadcastb vpbroadcastw vpbroadcastd vpbroadcastq vpermd vpermpd vpermps vpermq vperm2i128 vextracti128 vinserti128 vpmaskmovd vpmaskmovq vpsllvd vpsllvq vpsravd vpsrlvd vpsrlvq vgatherdpd vgatherqpd vgatherdps vgatherqps vpgatherdd vpgatherqd vpgatherdq vpgatherqq xabort xbegin xend xtest andn bextr blci blcic blsi blsic blcfill blsfill blcmsk blsmsk blsr blcs bzhi mulx pdep pext rorx sarx shlx shrx tzcnt tzmsk t1mskc valignd valignq vblendmpd vblendmps vbroadcastf32x4 vbroadcastf64x4 vbroadcasti32x4 vbroadcasti64x4 vcompresspd vcompressps vcvtpd2udq vcvtps2udq vcvtsd2usi vcvtss2usi vcvttpd2udq vcvttps2udq vcvttsd2usi vcvttss2usi vcvtudq2pd vcvtudq2ps vcvtusi2sd vcvtusi2ss vexpandpd vexpandps vextractf32x4 vextractf64x4 vextracti32x4 vextracti64x4 vfixupimmpd vfixupimmps vfixupimmsd vfixupimmss vgetexppd vgetexpps vgetexpsd vgetexpss vgetmantpd vgetmantps vgetmantsd vgetmantss vinsertf32x4 vinsertf64x4 vinserti32x4 vinserti64x4 vmovdqa32 vmovdqa64 vmovdqu32 vmovdqu64 vpabsq vpandd vpandnd vpandnq vpandq vpblendmd vpblendmq vpcmpltd vpcmpled vpcmpneqd vpcmpnltd vpcmpnled vpcmpd vpcmpltq vpcmpleq vpcmpneqq vpcmpnltq vpcmpnleq vpcmpq vpcmpequd vpcmpltud vpcmpleud vpcmpnequd vpcmpnltud vpcmpnleud vpcmpud vpcmpequq vpcmpltuq vpcmpleuq vpcmpnequq vpcmpnltuq vpcmpnleuq vpcmpuq vpcompressd vpcompressq vpermi2d vpermi2pd vpermi2ps vpermi2q vpermt2d vpermt2pd vpermt2ps vpermt2q vpexpandd vpexpandq vpmaxsq vpmaxuq vpminsq vpminuq vpmovdb vpmovdw vpmovqb vpmovqd vpmovqw vpmovsdb vpmovsdw vpmovsqb vpmovsqd vpmovsqw vpmovusdb vpmovusdw vpmovusqb vpmovusqd vpmovusqw vpord vporq vprold vprolq vprolvd vprolvq vprord vprorq vprorvd vprorvq vpscatterdd vpscatterdq vpscatterqd vpscatterqq vpsraq vpsravq vpternlogd vpternlogq vptestmd vptestmq vptestnmd vptestnmq vpxord vpxorq vrcp14pd vrcp14ps vrcp14sd vrcp14ss vrndscalepd vrndscaleps vrndscalesd vrndscaless vrsqrt14pd vrsqrt14ps vrsqrt14sd vrsqrt14ss vscalefpd vscalefps vscalefsd vscalefss vscatterdpd vscatterdps vscatterqpd vscatterqps vshuff32x4 vshuff64x2 vshufi32x4 vshufi64x2 kandnw kandw kmovw knotw kortestw korw kshiftlw kshiftrw kunpckbw kxnorw kxorw vpbroadcastmb2q vpbroadcastmw2d vpconflictd vpconflictq vplzcntd vplzcntq vexp2pd vexp2ps vrcp28pd vrcp28ps vrcp28sd vrcp28ss vrsqrt28pd vrsqrt28ps vrsqrt28sd vrsqrt28ss vgatherpf0dpd vgatherpf0dps vgatherpf0qpd vgatherpf0qps vgatherpf1dpd vgatherpf1dps vgatherpf1qpd vgatherpf1qps vscatterpf0dpd vscatterpf0dps vscatterpf0qpd vscatterpf0qps vscatterpf1dpd vscatterpf1dps vscatterpf1qpd vscatterpf1qps prefetchwt1 bndmk bndcl bndcu bndcn bndmov bndldx bndstx sha1rnds4 sha1nexte sha1msg1 sha1msg2 sha256rnds2 sha256msg1 sha256msg2 hint_nop0 hint_nop1 hint_nop2 hint_nop3 hint_nop4 hint_nop5 hint_nop6 hint_nop7 hint_nop8 hint_nop9 hint_nop10 hint_nop11 hint_nop12 hint_nop13 hint_nop14 hint_nop15 hint_nop16 hint_nop17 hint_nop18 hint_nop19 hint_nop20 hint_nop21 hint_nop22 hint_nop23 hint_nop24 hint_nop25 hint_nop26 hint_nop27 hint_nop28 hint_nop29 hint_nop30 hint_nop31 hint_nop32 hint_nop33 hint_nop34 hint_nop35 hint_nop36 hint_nop37 hint_nop38 hint_nop39 hint_nop40 hint_nop41 hint_nop42 hint_nop43 hint_nop44 hint_nop45 hint_nop46 hint_nop47 hint_nop48 hint_nop49 hint_nop50 hint_nop51 hint_nop52 hint_nop53 hint_nop54 hint_nop55 hint_nop56 hint_nop57 hint_nop58 hint_nop59 hint_nop60 hint_nop61 hint_nop62 hint_nop63',
- built_in:
- // Instruction pointer
- 'ip eip rip ' +
- // 8-bit registers
- 'al ah bl bh cl ch dl dh sil dil bpl spl r8b r9b r10b r11b r12b r13b r14b r15b ' +
- // 16-bit registers
- 'ax bx cx dx si di bp sp r8w r9w r10w r11w r12w r13w r14w r15w ' +
- // 32-bit registers
- 'eax ebx ecx edx esi edi ebp esp eip r8d r9d r10d r11d r12d r13d r14d r15d ' +
- // 64-bit registers
- 'rax rbx rcx rdx rsi rdi rbp rsp r8 r9 r10 r11 r12 r13 r14 r15 ' +
- // Segment registers
- 'cs ds es fs gs ss ' +
- // Floating point stack registers
- 'st st0 st1 st2 st3 st4 st5 st6 st7 ' +
- // MMX Registers
- 'mm0 mm1 mm2 mm3 mm4 mm5 mm6 mm7 ' +
- // SSE registers
- 'xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8 xmm9 xmm10 xmm11 xmm12 xmm13 xmm14 xmm15 ' +
- 'xmm16 xmm17 xmm18 xmm19 xmm20 xmm21 xmm22 xmm23 xmm24 xmm25 xmm26 xmm27 xmm28 xmm29 xmm30 xmm31 ' +
- // AVX registers
- 'ymm0 ymm1 ymm2 ymm3 ymm4 ymm5 ymm6 ymm7 ymm8 ymm9 ymm10 ymm11 ymm12 ymm13 ymm14 ymm15 ' +
- 'ymm16 ymm17 ymm18 ymm19 ymm20 ymm21 ymm22 ymm23 ymm24 ymm25 ymm26 ymm27 ymm28 ymm29 ymm30 ymm31 ' +
- // AVX-512F registers
- 'zmm0 zmm1 zmm2 zmm3 zmm4 zmm5 zmm6 zmm7 zmm8 zmm9 zmm10 zmm11 zmm12 zmm13 zmm14 zmm15 ' +
- 'zmm16 zmm17 zmm18 zmm19 zmm20 zmm21 zmm22 zmm23 zmm24 zmm25 zmm26 zmm27 zmm28 zmm29 zmm30 zmm31 ' +
- // AVX-512F mask registers
- 'k0 k1 k2 k3 k4 k5 k6 k7 ' +
- // Bound (MPX) register
- 'bnd0 bnd1 bnd2 bnd3 ' +
- // Special register
- 'cr0 cr1 cr2 cr3 cr4 cr8 dr0 dr1 dr2 dr3 dr8 tr3 tr4 tr5 tr6 tr7 ' +
- // NASM altreg package
- 'r0 r1 r2 r3 r4 r5 r6 r7 r0b r1b r2b r3b r4b r5b r6b r7b ' +
- 'r0w r1w r2w r3w r4w r5w r6w r7w r0d r1d r2d r3d r4d r5d r6d r7d ' +
- 'r0h r1h r2h r3h ' +
- 'r0l r1l r2l r3l r4l r5l r6l r7l r8l r9l r10l r11l r12l r13l r14l r15l ' +
-
- 'db dw dd dq dt ddq do dy dz ' +
- 'resb resw resd resq rest resdq reso resy resz ' +
- 'incbin equ times ' +
- 'byte word dword qword nosplit rel abs seg wrt strict near far a32 ptr',
-
- meta:
- '%define %xdefine %+ %undef %defstr %deftok %assign %strcat %strlen %substr %rotate %elif %else %endif ' +
- '%if %ifmacro %ifctx %ifidn %ifidni %ifid %ifnum %ifstr %iftoken %ifempty %ifenv %error %warning %fatal %rep ' +
- '%endrep %include %push %pop %repl %pathsearch %depend %use %arg %stacksize %local %line %comment %endcomment ' +
- '.nolist ' +
- '__FILE__ __LINE__ __SECT__ __BITS__ __OUTPUT_FORMAT__ __DATE__ __TIME__ __DATE_NUM__ __TIME_NUM__ ' +
- '__UTC_DATE__ __UTC_TIME__ __UTC_DATE_NUM__ __UTC_TIME_NUM__ __PASS__ struc endstruc istruc at iend ' +
- 'align alignb sectalign daz nodaz up down zero default option assume public ' +
-
- 'bits use16 use32 use64 default section segment absolute extern global common cpu float ' +
- '__utf16__ __utf16le__ __utf16be__ __utf32__ __utf32le__ __utf32be__ ' +
- '__float8__ __float16__ __float32__ __float64__ __float80m__ __float80e__ __float128l__ __float128h__ ' +
- '__Infinity__ __QNaN__ __SNaN__ Inf NaN QNaN SNaN float8 float16 float32 float64 float80m float80e ' +
- 'float128l float128h __FLOAT_DAZ__ __FLOAT_ROUND__ __FLOAT__'
- },
- contains: [
- hljs.COMMENT(
- ';',
- '$',
- {
- relevance: 0
- }
- ),
- {
- className: 'number',
- variants: [
- // Float number and x87 BCD
- {
- begin: '\\b(?:([0-9][0-9_]*)?\\.[0-9_]*(?:[eE][+-]?[0-9_]+)?|' +
- '(0[Xx])?[0-9][0-9_]*\\.?[0-9_]*(?:[pP](?:[+-]?[0-9_]+)?)?)\\b',
- relevance: 0
- },
-
- // Hex number in $
- { begin: '\\$[0-9][0-9A-Fa-f]*', relevance: 0 },
-
- // Number in H,D,T,Q,O,B,Y suffix
- { begin: '\\b(?:[0-9A-Fa-f][0-9A-Fa-f_]*[Hh]|[0-9][0-9_]*[DdTt]?|[0-7][0-7_]*[QqOo]|[0-1][0-1_]*[BbYy])\\b' },
-
- // Number in X,D,T,Q,O,B,Y prefix
- { begin: '\\b(?:0[Xx][0-9A-Fa-f_]+|0[DdTt][0-9_]+|0[QqOo][0-7_]+|0[BbYy][0-1_]+)\\b'}
- ]
- },
- // Double quote string
- hljs.QUOTE_STRING_MODE,
- {
- className: 'string',
- variants: [
- // Single-quoted string
- { begin: '\'', end: '[^\\\\]\'' },
- // Backquoted string
- { begin: '`', end: '[^\\\\]`' }
- ],
- relevance: 0
- },
- {
- className: 'symbol',
- variants: [
- // Global label and local label
- { begin: '^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)' },
- // Macro-local label
- { begin: '^\\s*%%[A-Za-z0-9_$#@~.?]*:' }
- ],
- relevance: 0
- },
- // Macro parameter
- {
- className: 'subst',
- begin: '%[0-9]+',
- relevance: 0
- },
- // Macro parameter
- {
- className: 'subst',
- begin: '%!\S+',
- relevance: 0
- },
- {
- className: 'meta',
- begin: /^\s*\.[\w_-]+/
- }
- ]
- };
-};
-},{}],284:[function(require,module,exports){
-module.exports = function(hljs) {
- var BUILTIN_MODULES =
- 'ObjectLoader Animate MovieCredits Slides Filters Shading Materials LensFlare Mapping VLCAudioVideo ' +
- 'StereoDecoder PointCloud NetworkAccess RemoteControl RegExp ChromaKey Snowfall NodeJS Speech Charts';
-
- var XL_KEYWORDS = {
- keyword:
- 'if then else do while until for loop import with is as where when by data constant ' +
- 'integer real text name boolean symbol infix prefix postfix block tree',
- literal:
- 'true false nil',
- built_in:
- 'in mod rem and or xor not abs sign floor ceil sqrt sin cos tan asin ' +
- 'acos atan exp expm1 log log2 log10 log1p pi at text_length text_range ' +
- 'text_find text_replace contains page slide basic_slide title_slide ' +
- 'title subtitle fade_in fade_out fade_at clear_color color line_color ' +
- 'line_width texture_wrap texture_transform texture scale_?x scale_?y ' +
- 'scale_?z? translate_?x translate_?y translate_?z? rotate_?x rotate_?y ' +
- 'rotate_?z? rectangle circle ellipse sphere path line_to move_to ' +
- 'quad_to curve_to theme background contents locally time mouse_?x ' +
- 'mouse_?y mouse_buttons ' +
- BUILTIN_MODULES
- };
-
- var DOUBLE_QUOTE_TEXT = {
- className: 'string',
- begin: '"', end: '"', illegal: '\\n'
- };
- var SINGLE_QUOTE_TEXT = {
- className: 'string',
- begin: '\'', end: '\'', illegal: '\\n'
- };
- var LONG_TEXT = {
- className: 'string',
- begin: '<<', end: '>>'
- };
- var BASED_NUMBER = {
- className: 'number',
- begin: '[0-9]+#[0-9A-Z_]+(\\.[0-9-A-Z_]+)?#?([Ee][+-]?[0-9]+)?'
- };
- var IMPORT = {
- beginKeywords: 'import', end: '$',
- keywords: XL_KEYWORDS,
- contains: [DOUBLE_QUOTE_TEXT]
- };
- var FUNCTION_DEFINITION = {
- className: 'function',
- begin: /[a-z][^\n]*->/, returnBegin: true, end: /->/,
- contains: [
- hljs.inherit(hljs.TITLE_MODE, {starts: {
- endsWithParent: true,
- keywords: XL_KEYWORDS
- }})
- ]
- };
- return {
- aliases: ['tao'],
- lexemes: /[a-zA-Z][a-zA-Z0-9_?]*/,
- keywords: XL_KEYWORDS,
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- DOUBLE_QUOTE_TEXT,
- SINGLE_QUOTE_TEXT,
- LONG_TEXT,
- FUNCTION_DEFINITION,
- IMPORT,
- BASED_NUMBER,
- hljs.NUMBER_MODE
- ]
- };
-};
-},{}],285:[function(require,module,exports){
-module.exports = function(hljs) {
- var XML_IDENT_RE = '[A-Za-z0-9\\._:-]+';
- var TAG_INTERNALS = {
- endsWithParent: true,
- illegal: /</,
- relevance: 0,
- contains: [
- {
- className: 'attr',
- begin: XML_IDENT_RE,
- relevance: 0
- },
- {
- begin: /=\s*/,
- relevance: 0,
- contains: [
- {
- className: 'string',
- endsParent: true,
- variants: [
- {begin: /"/, end: /"/},
- {begin: /'/, end: /'/},
- {begin: /[^\s"'=<>`]+/}
- ]
- }
- ]
- }
- ]
- };
- return {
- aliases: ['html', 'xhtml', 'rss', 'atom', 'xjb', 'xsd', 'xsl', 'plist'],
- case_insensitive: true,
- contains: [
- {
- className: 'meta',
- begin: '<!DOCTYPE', end: '>',
- relevance: 10,
- contains: [{begin: '\\[', end: '\\]'}]
- },
- hljs.COMMENT(
- '<!--',
- '-->',
- {
- relevance: 10
- }
- ),
- {
- begin: '<\\!\\[CDATA\\[', end: '\\]\\]>',
- relevance: 10
- },
- {
- begin: /<\?(php)?/, end: /\?>/,
- subLanguage: 'php',
- contains: [{begin: '/\\*', end: '\\*/', skip: true}]
- },
- {
- className: 'tag',
- /*
- The lookahead pattern (?=...) ensures that 'begin' only matches
- '<style' as a single word, followed by a whitespace or an
- ending braket. The '$' is needed for the lexeme to be recognized
- by hljs.subMode() that tests lexemes outside the stream.
- */
- begin: '<style(?=\\s|>|$)', end: '>',
- keywords: {name: 'style'},
- contains: [TAG_INTERNALS],
- starts: {
- end: '</style>', returnEnd: true,
- subLanguage: ['css', 'xml']
- }
- },
- {
- className: 'tag',
- // See the comment in the <style tag about the lookahead pattern
- begin: '<script(?=\\s|>|$)', end: '>',
- keywords: {name: 'script'},
- contains: [TAG_INTERNALS],
- starts: {
- end: '\<\/script\>', returnEnd: true,
- subLanguage: ['actionscript', 'javascript', 'handlebars', 'xml']
- }
- },
- {
- className: 'meta',
- variants: [
- {begin: /<\?xml/, end: /\?>/, relevance: 10},
- {begin: /<\?\w+/, end: /\?>/}
- ]
- },
- {
- className: 'tag',
- begin: '</?', end: '/?>',
- contains: [
- {
- className: 'name', begin: /[^\/><\s]+/, relevance: 0
- },
- TAG_INTERNALS
- ]
- }
- ]
- };
-};
-},{}],286:[function(require,module,exports){
-module.exports = function(hljs) {
- var KEYWORDS = 'for let if while then else return where group by xquery encoding version' +
- 'module namespace boundary-space preserve strip default collation base-uri ordering' +
- 'copy-namespaces order declare import schema namespace function option in allowing empty' +
- 'at tumbling window sliding window start when only end when previous next stable ascending' +
- 'descending empty greatest least some every satisfies switch case typeswitch try catch and' +
- 'or to union intersect instance of treat as castable cast map array delete insert into' +
- 'replace value rename copy modify update';
- var LITERAL = 'false true xs:string xs:integer element item xs:date xs:datetime xs:float xs:double xs:decimal QName xs:anyURI xs:long xs:int xs:short xs:byte attribute';
- var VAR = {
- begin: /\$[a-zA-Z0-9\-]+/
- };
-
- var NUMBER = {
- className: 'number',
- begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',
- relevance: 0
- };
-
- var STRING = {
- className: 'string',
- variants: [
- {begin: /"/, end: /"/, contains: [{begin: /""/, relevance: 0}]},
- {begin: /'/, end: /'/, contains: [{begin: /''/, relevance: 0}]}
- ]
- };
-
- var ANNOTATION = {
- className: 'meta',
- begin: '%\\w+'
- };
-
- var COMMENT = {
- className: 'comment',
- begin: '\\(:', end: ':\\)',
- relevance: 10,
- contains: [
- {
- className: 'doctag', begin: '@\\w+'
- }
- ]
- };
-
- var METHOD = {
- begin: '{', end: '}'
- };
-
- var CONTAINS = [
- VAR,
- STRING,
- NUMBER,
- COMMENT,
- ANNOTATION,
- METHOD
- ];
- METHOD.contains = CONTAINS;
-
-
- return {
- aliases: ['xpath', 'xq'],
- case_insensitive: false,
- lexemes: /[a-zA-Z\$][a-zA-Z0-9_:\-]*/,
- illegal: /(proc)|(abstract)|(extends)|(until)|(#)/,
- keywords: {
- keyword: KEYWORDS,
- literal: LITERAL
- },
- contains: CONTAINS
- };
-};
-},{}],287:[function(require,module,exports){
-module.exports = function(hljs) {
- var LITERALS = 'true false yes no null';
-
- var keyPrefix = '^[ \\-]*';
- var keyName = '[a-zA-Z_][\\w\\-]*';
- var KEY = {
- className: 'attr',
- variants: [
- { begin: keyPrefix + keyName + ":"},
- { begin: keyPrefix + '"' + keyName + '"' + ":"},
- { begin: keyPrefix + "'" + keyName + "'" + ":"}
- ]
- };
-
- var TEMPLATE_VARIABLES = {
- className: 'template-variable',
- variants: [
- { begin: '\{\{', end: '\}\}' }, // jinja templates Ansible
- { begin: '%\{', end: '\}' } // Ruby i18n
- ]
- };
- var STRING = {
- className: 'string',
- relevance: 0,
- variants: [
- {begin: /'/, end: /'/},
- {begin: /"/, end: /"/},
- {begin: /\S+/}
- ],
- contains: [
- hljs.BACKSLASH_ESCAPE,
- TEMPLATE_VARIABLES
- ]
- };
-
- return {
- case_insensitive: true,
- aliases: ['yml', 'YAML', 'yaml'],
- contains: [
- KEY,
- {
- className: 'meta',
- begin: '^---\s*$',
- relevance: 10
- },
- { // multi line string
- className: 'string',
- begin: '[\\|>] *$',
- returnEnd: true,
- contains: STRING.contains,
- // very simple termination: next hash key
- end: KEY.variants[0].begin
- },
- { // Ruby/Rails erb
- begin: '<%[%=-]?', end: '[%-]?%>',
- subLanguage: 'ruby',
- excludeBegin: true,
- excludeEnd: true,
- relevance: 0
- },
- { // data type
- className: 'type',
- begin: '!!' + hljs.UNDERSCORE_IDENT_RE,
- },
- { // fragment id &ref
- className: 'meta',
- begin: '&' + hljs.UNDERSCORE_IDENT_RE + '$',
- },
- { // fragment reference *ref
- className: 'meta',
- begin: '\\*' + hljs.UNDERSCORE_IDENT_RE + '$'
- },
- { // array listing
- className: 'bullet',
- begin: '^ *-',
- relevance: 0
- },
- hljs.HASH_COMMENT_MODE,
- {
- beginKeywords: LITERALS,
- keywords: {literal: LITERALS}
- },
- hljs.C_NUMBER_MODE,
- STRING
- ]
- };
-};
-},{}],288:[function(require,module,exports){
-module.exports = function(hljs) {
- var STRING = {
- className: 'string',
- contains: [hljs.BACKSLASH_ESCAPE],
- variants: [
- {
- begin: 'b"', end: '"'
- },
- {
- begin: 'b\'', end: '\''
- },
- hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}),
- hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null})
- ]
- };
- var NUMBER = {variants: [hljs.BINARY_NUMBER_MODE, hljs.C_NUMBER_MODE]};
- return {
- aliases: ['zep'],
- case_insensitive: true,
- keywords:
- 'and include_once list abstract global private echo interface as static endswitch ' +
- 'array null if endwhile or const for endforeach self var let while isset public ' +
- 'protected exit foreach throw elseif include __FILE__ empty require_once do xor ' +
- 'return parent clone use __CLASS__ __LINE__ else break print eval new ' +
- 'catch __METHOD__ case exception default die require __FUNCTION__ ' +
- 'enddeclare final try switch continue endfor endif declare unset true false ' +
- 'trait goto instanceof insteadof __DIR__ __NAMESPACE__ ' +
- 'yield finally int uint long ulong char uchar double float bool boolean string' +
- 'likely unlikely',
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.HASH_COMMENT_MODE,
- hljs.COMMENT(
- '/\\*',
- '\\*/',
- {
- contains: [
- {
- className: 'doctag',
- begin: '@[A-Za-z]+'
- }
- ]
- }
- ),
- hljs.COMMENT(
- '__halt_compiler.+?;',
- false,
- {
- endsWithParent: true,
- keywords: '__halt_compiler',
- lexemes: hljs.UNDERSCORE_IDENT_RE
- }
- ),
- {
- className: 'string',
- begin: '<<<[\'"]?\\w+[\'"]?$', end: '^\\w+;',
- contains: [hljs.BACKSLASH_ESCAPE]
- },
- {
- // swallow composed identifiers to avoid parsing them as keywords
- begin: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/
- },
- {
- className: 'function',
- beginKeywords: 'function', end: /[;{]/, excludeEnd: true,
- illegal: '\\$|\\[|%',
- contains: [
- hljs.UNDERSCORE_TITLE_MODE,
- {
- className: 'params',
- begin: '\\(', end: '\\)',
- contains: [
- 'self',
- hljs.C_BLOCK_COMMENT_MODE,
- STRING,
- NUMBER
- ]
- }
- ]
- },
- {
- className: 'class',
- beginKeywords: 'class interface', end: '{', excludeEnd: true,
- illegal: /[:\(\$"]/,
- contains: [
- {beginKeywords: 'extends implements'},
- hljs.UNDERSCORE_TITLE_MODE
- ]
- },
- {
- beginKeywords: 'namespace', end: ';',
- illegal: /[\.']/,
- contains: [hljs.UNDERSCORE_TITLE_MODE]
- },
- {
- beginKeywords: 'use', end: ';',
- contains: [hljs.UNDERSCORE_TITLE_MODE]
- },
- {
- begin: '=>' // No markup, just a relevance booster
- },
- STRING,
- NUMBER
- ]
- };
-};
-},{}],289:[function(require,module,exports){
-'use strict';
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Helpers
-
-// Merge objects
-//
-function assign(obj /*from1, from2, from3, ...*/) {
- var sources = Array.prototype.slice.call(arguments, 1);
-
- sources.forEach(function (source) {
- if (!source) { return; }
-
- Object.keys(source).forEach(function (key) {
- obj[key] = source[key];
- });
- });
-
- return obj;
-}
-
-function _class(obj) { return Object.prototype.toString.call(obj); }
-function isString(obj) { return _class(obj) === '[object String]'; }
-function isObject(obj) { return _class(obj) === '[object Object]'; }
-function isRegExp(obj) { return _class(obj) === '[object RegExp]'; }
-function isFunction(obj) { return _class(obj) === '[object Function]'; }
-
-
-function escapeRE(str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); }
-
-////////////////////////////////////////////////////////////////////////////////
-
-
-var defaultOptions = {
- fuzzyLink: true,
- fuzzyEmail: true,
- fuzzyIP: false
-};
-
-
-function isOptionsObj(obj) {
- return Object.keys(obj || {}).reduce(function (acc, k) {
- return acc || defaultOptions.hasOwnProperty(k);
- }, false);
-}
-
-
-var defaultSchemas = {
- 'http:': {
- validate: function (text, pos, self) {
- var tail = text.slice(pos);
-
- if (!self.re.http) {
- // compile lazily, because "host"-containing variables can change on tlds update.
- self.re.http = new RegExp(
- '^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'
- );
- }
- if (self.re.http.test(tail)) {
- return tail.match(self.re.http)[0].length;
- }
- return 0;
- }
- },
- 'https:': 'http:',
- 'ftp:': 'http:',
- '//': {
- validate: function (text, pos, self) {
- var tail = text.slice(pos);
-
- if (!self.re.no_http) {
- // compile lazily, because "host"-containing variables can change on tlds update.
- self.re.no_http = new RegExp(
- '^' +
- self.re.src_auth +
- // Don't allow single-level domains, because of false positives like '//test'
- // with code comments
- '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' +
- self.re.src_port +
- self.re.src_host_terminator +
- self.re.src_path,
-
- 'i'
- );
- }
-
- if (self.re.no_http.test(tail)) {
- // should not be `://` & `///`, that protects from errors in protocol name
- if (pos >= 3 && text[pos - 3] === ':') { return 0; }
- if (pos >= 3 && text[pos - 3] === '/') { return 0; }
- return tail.match(self.re.no_http)[0].length;
- }
- return 0;
- }
- },
- 'mailto:': {
- validate: function (text, pos, self) {
- var tail = text.slice(pos);
-
- if (!self.re.mailto) {
- self.re.mailto = new RegExp(
- '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'
- );
- }
- if (self.re.mailto.test(tail)) {
- return tail.match(self.re.mailto)[0].length;
- }
- return 0;
- }
- }
-};
-
-/*eslint-disable max-len*/
-
-// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)
-var tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
-
-// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead
-var tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
-
-/*eslint-enable max-len*/
-
-////////////////////////////////////////////////////////////////////////////////
-
-function resetScanCache(self) {
- self.__index__ = -1;
- self.__text_cache__ = '';
-}
-
-function createValidator(re) {
- return function (text, pos) {
- var tail = text.slice(pos);
-
- if (re.test(tail)) {
- return tail.match(re)[0].length;
- }
- return 0;
- };
-}
-
-function createNormalizer() {
- return function (match, self) {
- self.normalize(match);
- };
-}
-
-// Schemas compiler. Build regexps.
-//
-function compile(self) {
-
- // Load & clone RE patterns.
- var re = self.re = require('./lib/re')(self.__opts__);
-
- // Define dynamic patterns
- var tlds = self.__tlds__.slice();
-
- self.onCompile();
-
- if (!self.__tlds_replaced__) {
- tlds.push(tlds_2ch_src_re);
- }
- tlds.push(re.src_xn);
-
- re.src_tlds = tlds.join('|');
-
- function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); }
-
- re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i');
- re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i');
- re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i');
- re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i');
-
- //
- // Compile each schema
- //
-
- var aliases = [];
-
- self.__compiled__ = {}; // Reset compiled data
-
- function schemaError(name, val) {
- throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val);
- }
-
- Object.keys(self.__schemas__).forEach(function (name) {
- var val = self.__schemas__[name];
-
- // skip disabled methods
- if (val === null) { return; }
-
- var compiled = { validate: null, link: null };
-
- self.__compiled__[name] = compiled;
-
- if (isObject(val)) {
- if (isRegExp(val.validate)) {
- compiled.validate = createValidator(val.validate);
- } else if (isFunction(val.validate)) {
- compiled.validate = val.validate;
- } else {
- schemaError(name, val);
- }
-
- if (isFunction(val.normalize)) {
- compiled.normalize = val.normalize;
- } else if (!val.normalize) {
- compiled.normalize = createNormalizer();
- } else {
- schemaError(name, val);
- }
-
- return;
- }
-
- if (isString(val)) {
- aliases.push(name);
- return;
- }
-
- schemaError(name, val);
- });
-
- //
- // Compile postponed aliases
- //
-
- aliases.forEach(function (alias) {
- if (!self.__compiled__[self.__schemas__[alias]]) {
- // Silently fail on missed schemas to avoid errons on disable.
- // schemaError(alias, self.__schemas__[alias]);
- return;
- }
-
- self.__compiled__[alias].validate =
- self.__compiled__[self.__schemas__[alias]].validate;
- self.__compiled__[alias].normalize =
- self.__compiled__[self.__schemas__[alias]].normalize;
- });
-
- //
- // Fake record for guessed links
- //
- self.__compiled__[''] = { validate: null, normalize: createNormalizer() };
-
- //
- // Build schema condition
- //
- var slist = Object.keys(self.__compiled__)
- .filter(function (name) {
- // Filter disabled & fake schemas
- return name.length > 0 && self.__compiled__[name];
- })
- .map(escapeRE)
- .join('|');
- // (?!_) cause 1.5x slowdown
- self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i');
- self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig');
-
- self.re.pretest = RegExp(
- '(' + self.re.schema_test.source + ')|' +
- '(' + self.re.host_fuzzy_test.source + ')|' +
- '@',
- 'i');
-
- //
- // Cleanup
- //
-
- resetScanCache(self);
-}
-
-/**
- * class Match
- *
- * Match result. Single element of array, returned by [[LinkifyIt#match]]
- **/
-function Match(self, shift) {
- var start = self.__index__,
- end = self.__last_index__,
- text = self.__text_cache__.slice(start, end);
-
- /**
- * Match#schema -> String
- *
- * Prefix (protocol) for matched string.
- **/
- this.schema = self.__schema__.toLowerCase();
- /**
- * Match#index -> Number
- *
- * First position of matched string.
- **/
- this.index = start + shift;
- /**
- * Match#lastIndex -> Number
- *
- * Next position after matched string.
- **/
- this.lastIndex = end + shift;
- /**
- * Match#raw -> String
- *
- * Matched string.
- **/
- this.raw = text;
- /**
- * Match#text -> String
- *
- * Notmalized text of matched string.
- **/
- this.text = text;
- /**
- * Match#url -> String
- *
- * Normalized url of matched string.
- **/
- this.url = text;
-}
-
-function createMatch(self, shift) {
- var match = new Match(self, shift);
-
- self.__compiled__[match.schema].normalize(match, self);
-
- return match;
-}
-
-
-/**
- * class LinkifyIt
- **/
-
-/**
- * new LinkifyIt(schemas, options)
- * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)
- * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
- *
- * Creates new linkifier instance with optional additional schemas.
- * Can be called without `new` keyword for convenience.
- *
- * By default understands:
- *
- * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
- * - "fuzzy" links and emails (example.com, foo@bar.com).
- *
- * `schemas` is an object, where each key/value describes protocol/rule:
- *
- * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`
- * for example). `linkify-it` makes shure that prefix is not preceeded with
- * alphanumeric char and symbols. Only whitespaces and punctuation allowed.
- * - __value__ - rule to check tail after link prefix
- * - _String_ - just alias to existing rule
- * - _Object_
- * - _validate_ - validator function (should return matched length on success),
- * or `RegExp`.
- * - _normalize_ - optional function to normalize text & url of matched result
- * (for example, for @twitter mentions).
- *
- * `options`:
- *
- * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.
- * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts
- * like version numbers. Default `false`.
- * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.
- *
- **/
-function LinkifyIt(schemas, options) {
- if (!(this instanceof LinkifyIt)) {
- return new LinkifyIt(schemas, options);
- }
-
- if (!options) {
- if (isOptionsObj(schemas)) {
- options = schemas;
- schemas = {};
- }
- }
-
- this.__opts__ = assign({}, defaultOptions, options);
-
- // Cache last tested result. Used to skip repeating steps on next `match` call.
- this.__index__ = -1;
- this.__last_index__ = -1; // Next scan position
- this.__schema__ = '';
- this.__text_cache__ = '';
-
- this.__schemas__ = assign({}, defaultSchemas, schemas);
- this.__compiled__ = {};
-
- this.__tlds__ = tlds_default;
- this.__tlds_replaced__ = false;
-
- this.re = {};
-
- compile(this);
-}
-
-
-/** chainable
- * LinkifyIt#add(schema, definition)
- * - schema (String): rule name (fixed pattern prefix)
- * - definition (String|RegExp|Object): schema definition
- *
- * Add new rule definition. See constructor description for details.
- **/
-LinkifyIt.prototype.add = function add(schema, definition) {
- this.__schemas__[schema] = definition;
- compile(this);
- return this;
-};
-
-
-/** chainable
- * LinkifyIt#set(options)
- * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
- *
- * Set recognition options for links without schema.
- **/
-LinkifyIt.prototype.set = function set(options) {
- this.__opts__ = assign(this.__opts__, options);
- return this;
-};
-
-
-/**
- * LinkifyIt#test(text) -> Boolean
- *
- * Searches linkifiable pattern and returns `true` on success or `false` on fail.
- **/
-LinkifyIt.prototype.test = function test(text) {
- // Reset scan cache
- this.__text_cache__ = text;
- this.__index__ = -1;
-
- if (!text.length) { return false; }
-
- var m, ml, me, len, shift, next, re, tld_pos, at_pos;
-
- // try to scan for link with schema - that's the most simple rule
- if (this.re.schema_test.test(text)) {
- re = this.re.schema_search;
- re.lastIndex = 0;
- while ((m = re.exec(text)) !== null) {
- len = this.testSchemaAt(text, m[2], re.lastIndex);
- if (len) {
- this.__schema__ = m[2];
- this.__index__ = m.index + m[1].length;
- this.__last_index__ = m.index + m[0].length + len;
- break;
- }
- }
- }
-
- if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {
- // guess schemaless links
- tld_pos = text.search(this.re.host_fuzzy_test);
- if (tld_pos >= 0) {
- // if tld is located after found link - no need to check fuzzy pattern
- if (this.__index__ < 0 || tld_pos < this.__index__) {
- if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
-
- shift = ml.index + ml[1].length;
-
- if (this.__index__ < 0 || shift < this.__index__) {
- this.__schema__ = '';
- this.__index__ = shift;
- this.__last_index__ = ml.index + ml[0].length;
- }
- }
- }
- }
- }
-
- if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {
- // guess schemaless emails
- at_pos = text.indexOf('@');
- if (at_pos >= 0) {
- // We can't skip this check, because this cases are possible:
- // 192.168.1.1@gmail.com, my.in@example.com
- if ((me = text.match(this.re.email_fuzzy)) !== null) {
-
- shift = me.index + me[1].length;
- next = me.index + me[0].length;
-
- if (this.__index__ < 0 || shift < this.__index__ ||
- (shift === this.__index__ && next > this.__last_index__)) {
- this.__schema__ = 'mailto:';
- this.__index__ = shift;
- this.__last_index__ = next;
- }
- }
- }
- }
-
- return this.__index__ >= 0;
-};
-
-
-/**
- * LinkifyIt#pretest(text) -> Boolean
- *
- * Very quick check, that can give false positives. Returns true if link MAY BE
- * can exists. Can be used for speed optimization, when you need to check that
- * link NOT exists.
- **/
-LinkifyIt.prototype.pretest = function pretest(text) {
- return this.re.pretest.test(text);
-};
-
-
-/**
- * LinkifyIt#testSchemaAt(text, name, position) -> Number
- * - text (String): text to scan
- * - name (String): rule (schema) name
- * - position (Number): text offset to check from
- *
- * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly
- * at given position. Returns length of found pattern (0 on fail).
- **/
-LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) {
- // If not supported schema check requested - terminate
- if (!this.__compiled__[schema.toLowerCase()]) {
- return 0;
- }
- return this.__compiled__[schema.toLowerCase()].validate(text, pos, this);
-};
-
-
-/**
- * LinkifyIt#match(text) -> Array|null
- *
- * Returns array of found link descriptions or `null` on fail. We strongly
- * recommend to use [[LinkifyIt#test]] first, for best speed.
- *
- * ##### Result match description
- *
- * - __schema__ - link schema, can be empty for fuzzy links, or `//` for
- * protocol-neutral links.
- * - __index__ - offset of matched text
- * - __lastIndex__ - index of next char after mathch end
- * - __raw__ - matched text
- * - __text__ - normalized text
- * - __url__ - link, generated from matched text
- **/
-LinkifyIt.prototype.match = function match(text) {
- var shift = 0, result = [];
-
- // Try to take previous element from cache, if .test() called before
- if (this.__index__ >= 0 && this.__text_cache__ === text) {
- result.push(createMatch(this, shift));
- shift = this.__last_index__;
- }
-
- // Cut head if cache was used
- var tail = shift ? text.slice(shift) : text;
-
- // Scan string until end reached
- while (this.test(tail)) {
- result.push(createMatch(this, shift));
-
- tail = tail.slice(this.__last_index__);
- shift += this.__last_index__;
- }
-
- if (result.length) {
- return result;
- }
-
- return null;
-};
-
-
-/** chainable
- * LinkifyIt#tlds(list [, keepOld]) -> this
- * - list (Array): list of tlds
- * - keepOld (Boolean): merge with current list if `true` (`false` by default)
- *
- * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)
- * to avoid false positives. By default this algorythm used:
- *
- * - hostname with any 2-letter root zones are ok.
- * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф
- * are ok.
- * - encoded (`xn--...`) root zones are ok.
- *
- * If list is replaced, then exact match for 2-chars root zones will be checked.
- **/
-LinkifyIt.prototype.tlds = function tlds(list, keepOld) {
- list = Array.isArray(list) ? list : [ list ];
-
- if (!keepOld) {
- this.__tlds__ = list.slice();
- this.__tlds_replaced__ = true;
- compile(this);
- return this;
- }
-
- this.__tlds__ = this.__tlds__.concat(list)
- .sort()
- .filter(function (el, idx, arr) {
- return el !== arr[idx - 1];
- })
- .reverse();
-
- compile(this);
- return this;
-};
-
-/**
- * LinkifyIt#normalize(match)
- *
- * Default normalizer (if schema does not define it's own).
- **/
-LinkifyIt.prototype.normalize = function normalize(match) {
-
- // Do minimal possible changes by default. Need to collect feedback prior
- // to move forward https://github.com/markdown-it/linkify-it/issues/1
-
- if (!match.schema) { match.url = 'http://' + match.url; }
-
- if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {
- match.url = 'mailto:' + match.url;
- }
-};
-
-
-/**
- * LinkifyIt#onCompile()
- *
- * Override to modify basic RegExp-s.
- **/
-LinkifyIt.prototype.onCompile = function onCompile() {
-};
-
-
-module.exports = LinkifyIt;
-
-},{"./lib/re":290}],290:[function(require,module,exports){
-'use strict';
-
-
-module.exports = function (opts) {
- var re = {};
-
- // Use direct extract instead of `regenerate` to reduse browserified size
- re.src_Any = require('uc.micro/properties/Any/regex').source;
- re.src_Cc = require('uc.micro/categories/Cc/regex').source;
- re.src_Z = require('uc.micro/categories/Z/regex').source;
- re.src_P = require('uc.micro/categories/P/regex').source;
-
- // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation)
- re.src_ZPCc = [ re.src_Z, re.src_P, re.src_Cc ].join('|');
-
- // \p{\Z\Cc} (white spaces + control)
- re.src_ZCc = [ re.src_Z, re.src_Cc ].join('|');
-
- // Experimental. List of chars, completely prohibited in links
- // because can separate it from other part of text
- var text_separators = '[><\uff5c]';
-
- // All possible word characters (everything without punctuation, spaces & controls)
- // Defined via punctuation & spaces to save space
- // Should be something like \p{\L\N\S\M} (\w but without `_`)
- re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')';
- // The same as abothe but without [0-9]
- // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
-
- ////////////////////////////////////////////////////////////////////////////////
-
- re.src_ip4 =
-
- '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
-
- // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch.
- re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?';
-
- re.src_port =
-
- '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?';
-
- re.src_host_terminator =
-
- '(?=$|' + text_separators + '|' + re.src_ZPCc + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))';
-
- re.src_path =
-
- '(?:' +
- '[/?#]' +
- '(?:' +
- '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-]).|' +
- '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' +
- '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' +
- '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' +
- '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' +
- "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" +
- "\\'(?=" + re.src_pseudo_letter + '|[-]).|' + // allow `I'm_king` if no pair found
- '\\.{2,3}[a-zA-Z0-9%/]|' + // github has ... in commit range links. Restrict to
- // - english
- // - percent-encoded
- // - parts of file path
- // until more examples found.
- '\\.(?!' + re.src_ZCc + '|[.]).|' +
- (opts && opts['---'] ?
- '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate
- :
- '\\-+|'
- ) +
- '\\,(?!' + re.src_ZCc + ').|' + // allow `,,,` in paths
- '\\!(?!' + re.src_ZCc + '|[!]).|' +
- '\\?(?!' + re.src_ZCc + '|[?]).' +
- ')+' +
- '|\\/' +
- ')?';
-
- re.src_email_name =
-
- '[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+';
-
- re.src_xn =
-
- 'xn--[a-z0-9\\-]{1,59}';
-
- // More to read about domain names
- // http://serverfault.com/questions/638260/
-
- re.src_domain_root =
-
- // Allow letters & digits (http://test1)
- '(?:' +
- re.src_xn +
- '|' +
- re.src_pseudo_letter + '{1,63}' +
- ')';
-
- re.src_domain =
-
- '(?:' +
- re.src_xn +
- '|' +
- '(?:' + re.src_pseudo_letter + ')' +
- '|' +
- // don't allow `--` in domain names, because:
- // - that can conflict with markdown &mdash; / &ndash;
- // - nobody use those anyway
- '(?:' + re.src_pseudo_letter + '(?:-(?!-)|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +
- ')';
-
- re.src_host =
-
- '(?:' +
- // Don't need IP check, because digits are already allowed in normal domain names
- // src_ip4 +
- // '|' +
- '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain/*_root*/ + ')' +
- ')';
-
- re.tpl_host_fuzzy =
-
- '(?:' +
- re.src_ip4 +
- '|' +
- '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' +
- ')';
-
- re.tpl_host_no_ip_fuzzy =
-
- '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))';
-
- re.src_host_strict =
-
- re.src_host + re.src_host_terminator;
-
- re.tpl_host_fuzzy_strict =
-
- re.tpl_host_fuzzy + re.src_host_terminator;
-
- re.src_host_port_strict =
-
- re.src_host + re.src_port + re.src_host_terminator;
-
- re.tpl_host_port_fuzzy_strict =
-
- re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
-
- re.tpl_host_port_no_ip_fuzzy_strict =
-
- re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // Main rules
-
- // Rude test fuzzy links by host, for quick deny
- re.tpl_host_fuzzy_test =
-
- 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))';
-
- re.tpl_email_fuzzy =
-
- '(^|' + text_separators + '|\\(|' + re.src_ZCc + ')(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')';
-
- re.tpl_link_fuzzy =
- // Fuzzy link can't be prepended with .:/\- and non punctuation.
- // but can start with > (markdown blockquote)
- '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
- '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')';
-
- re.tpl_link_no_ip_fuzzy =
- // Fuzzy link can't be prepended with .:/\- and non punctuation.
- // but can start with > (markdown blockquote)
- '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
- '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')';
-
- return re;
-};
-
-},{"uc.micro/categories/Cc/regex":413,"uc.micro/categories/P/regex":415,"uc.micro/categories/Z/regex":416,"uc.micro/properties/Any/regex":418}],291:[function(require,module,exports){
-/**
- * lodash (Custom Build) <https://lodash.com/>
- * Build: `lodash modularize exports="npm" -o ./`
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
-
-/** Used as references for various `Number` constants. */
-var MAX_SAFE_INTEGER = 9007199254740991;
-
-/** `Object#toString` result references. */
-var argsTag = '[object Arguments]',
- funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]';
-
-/** Used to detect unsigned integer values. */
-var reIsUint = /^(?:0|[1-9]\d*)$/;
-
-/**
- * A faster alternative to `Function#apply`, this function invokes `func`
- * with the `this` binding of `thisArg` and the arguments of `args`.
- *
- * @private
- * @param {Function} func The function to invoke.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {Array} args The arguments to invoke `func` with.
- * @returns {*} Returns the result of `func`.
- */
-function apply(func, thisArg, args) {
- switch (args.length) {
- case 0: return func.call(thisArg);
- case 1: return func.call(thisArg, args[0]);
- case 2: return func.call(thisArg, args[0], args[1]);
- case 3: return func.call(thisArg, args[0], args[1], args[2]);
- }
- return func.apply(thisArg, args);
-}
-
-/**
- * The base implementation of `_.times` without support for iteratee shorthands
- * or max array length checks.
- *
- * @private
- * @param {number} n The number of times to invoke `iteratee`.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the array of results.
- */
-function baseTimes(n, iteratee) {
- var index = -1,
- result = Array(n);
-
- while (++index < n) {
- result[index] = iteratee(index);
- }
- return result;
-}
-
-/**
- * Creates a unary function that invokes `func` with its argument transformed.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {Function} transform The argument transform.
- * @returns {Function} Returns the new function.
- */
-function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
-}
-
-/** Used for built-in method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objectToString = objectProto.toString;
-
-/** Built-in value references. */
-var propertyIsEnumerable = objectProto.propertyIsEnumerable;
-
-/* Built-in method references for those with the same name as other `lodash` methods. */
-var nativeKeys = overArg(Object.keys, Object),
- nativeMax = Math.max;
-
-/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
-var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
-
-/**
- * Creates an array of the enumerable property names of the array-like `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @param {boolean} inherited Specify returning inherited property names.
- * @returns {Array} Returns the array of property names.
- */
-function arrayLikeKeys(value, inherited) {
- // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
- // Safari 9 makes `arguments.length` enumerable in strict mode.
- var result = (isArray(value) || isArguments(value))
- ? baseTimes(value.length, String)
- : [];
-
- var length = result.length,
- skipIndexes = !!length;
-
- for (var key in value) {
- if ((inherited || hasOwnProperty.call(value, key)) &&
- !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
- result.push(key);
- }
- }
- return result;
-}
-
-/**
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
-function assignValue(object, key, value) {
- var objValue = object[key];
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
- (value === undefined && !(key in object))) {
- object[key] = value;
- }
-}
-
-/**
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
-function baseKeys(object) {
- if (!isPrototype(object)) {
- return nativeKeys(object);
- }
- var result = [];
- for (var key in Object(object)) {
- if (hasOwnProperty.call(object, key) && key != 'constructor') {
- result.push(key);
- }
- }
- return result;
-}
-
-/**
- * The base implementation of `_.rest` which doesn't validate or coerce arguments.
- *
- * @private
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @returns {Function} Returns the new function.
- */
-function baseRest(func, start) {
- start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
- return function() {
- var args = arguments,
- index = -1,
- length = nativeMax(args.length - start, 0),
- array = Array(length);
-
- while (++index < length) {
- array[index] = args[start + index];
- }
- index = -1;
- var otherArgs = Array(start + 1);
- while (++index < start) {
- otherArgs[index] = args[index];
- }
- otherArgs[start] = array;
- return apply(func, this, otherArgs);
- };
-}
-
-/**
- * Copies properties of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy properties from.
- * @param {Array} props The property identifiers to copy.
- * @param {Object} [object={}] The object to copy properties to.
- * @param {Function} [customizer] The function to customize copied values.
- * @returns {Object} Returns `object`.
- */
-function copyObject(source, props, object, customizer) {
- object || (object = {});
-
- var index = -1,
- length = props.length;
-
- while (++index < length) {
- var key = props[index];
-
- var newValue = customizer
- ? customizer(object[key], source[key], key, object, source)
- : undefined;
-
- assignValue(object, key, newValue === undefined ? source[key] : newValue);
- }
- return object;
-}
-
-/**
- * Creates a function like `_.assign`.
- *
- * @private
- * @param {Function} assigner The function to assign values.
- * @returns {Function} Returns the new assigner function.
- */
-function createAssigner(assigner) {
- return baseRest(function(object, sources) {
- var index = -1,
- length = sources.length,
- customizer = length > 1 ? sources[length - 1] : undefined,
- guard = length > 2 ? sources[2] : undefined;
-
- customizer = (assigner.length > 3 && typeof customizer == 'function')
- ? (length--, customizer)
- : undefined;
-
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? undefined : customizer;
- length = 1;
- }
- object = Object(object);
- while (++index < length) {
- var source = sources[index];
- if (source) {
- assigner(object, source, index, customizer);
- }
- }
- return object;
- });
-}
-
-/**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
-function isIndex(value, length) {
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length &&
- (typeof value == 'number' || reIsUint.test(value)) &&
- (value > -1 && value % 1 == 0 && value < length);
-}
-
-/**
- * Checks if the given arguments are from an iteratee call.
- *
- * @private
- * @param {*} value The potential iteratee value argument.
- * @param {*} index The potential iteratee index or key argument.
- * @param {*} object The potential iteratee object argument.
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
- * else `false`.
- */
-function isIterateeCall(value, index, object) {
- if (!isObject(object)) {
- return false;
- }
- var type = typeof index;
- if (type == 'number'
- ? (isArrayLike(object) && isIndex(index, object.length))
- : (type == 'string' && index in object)
- ) {
- return eq(object[index], value);
- }
- return false;
-}
-
-/**
- * Checks if `value` is likely a prototype object.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
- */
-function isPrototype(value) {
- var Ctor = value && value.constructor,
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
-
- return value === proto;
-}
-
-/**
- * Performs a
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * comparison between two values to determine if they are equivalent.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'a': 1 };
- * var other = { 'a': 1 };
- *
- * _.eq(object, object);
- * // => true
- *
- * _.eq(object, other);
- * // => false
- *
- * _.eq('a', 'a');
- * // => true
- *
- * _.eq('a', Object('a'));
- * // => false
- *
- * _.eq(NaN, NaN);
- * // => true
- */
-function eq(value, other) {
- return value === other || (value !== value && other !== other);
-}
-
-/**
- * Checks if `value` is likely an `arguments` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- * else `false`.
- * @example
- *
- * _.isArguments(function() { return arguments; }());
- * // => true
- *
- * _.isArguments([1, 2, 3]);
- * // => false
- */
-function isArguments(value) {
- // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
- return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
- (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
-}
-
-/**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(document.body.children);
- * // => false
- *
- * _.isArray('abc');
- * // => false
- *
- * _.isArray(_.noop);
- * // => false
- */
-var isArray = Array.isArray;
-
-/**
- * Checks if `value` is array-like. A value is considered array-like if it's
- * not a function and has a `value.length` that's an integer greater than or
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- * @example
- *
- * _.isArrayLike([1, 2, 3]);
- * // => true
- *
- * _.isArrayLike(document.body.children);
- * // => true
- *
- * _.isArrayLike('abc');
- * // => true
- *
- * _.isArrayLike(_.noop);
- * // => false
- */
-function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction(value);
-}
-
-/**
- * This method is like `_.isArrayLike` except that it also checks if `value`
- * is an object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array-like object,
- * else `false`.
- * @example
- *
- * _.isArrayLikeObject([1, 2, 3]);
- * // => true
- *
- * _.isArrayLikeObject(document.body.children);
- * // => true
- *
- * _.isArrayLikeObject('abc');
- * // => false
- *
- * _.isArrayLikeObject(_.noop);
- * // => false
- */
-function isArrayLikeObject(value) {
- return isObjectLike(value) && isArrayLike(value);
-}
-
-/**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
-function isFunction(value) {
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in Safari 8-9 which returns 'object' for typed array and other constructors.
- var tag = isObject(value) ? objectToString.call(value) : '';
- return tag == funcTag || tag == genTag;
-}
-
-/**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This method is loosely based on
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- * @example
- *
- * _.isLength(3);
- * // => true
- *
- * _.isLength(Number.MIN_VALUE);
- * // => false
- *
- * _.isLength(Infinity);
- * // => false
- *
- * _.isLength('3');
- * // => false
- */
-function isLength(value) {
- return typeof value == 'number' &&
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
-}
-
-/**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
-function isObject(value) {
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-/**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
-function isObjectLike(value) {
- return !!value && typeof value == 'object';
-}
-
-/**
- * Assigns own enumerable string keyed properties of source objects to the
- * destination object. Source objects are applied from left to right.
- * Subsequent sources overwrite property assignments of previous sources.
- *
- * **Note:** This method mutates `object` and is loosely based on
- * [`Object.assign`](https://mdn.io/Object/assign).
- *
- * @static
- * @memberOf _
- * @since 0.10.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.assignIn
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * function Bar() {
- * this.c = 3;
- * }
- *
- * Foo.prototype.b = 2;
- * Bar.prototype.d = 4;
- *
- * _.assign({ 'a': 0 }, new Foo, new Bar);
- * // => { 'a': 1, 'c': 3 }
- */
-var assign = createAssigner(function(object, source) {
- if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
- copyObject(source, keys(source), object);
- return;
- }
- for (var key in source) {
- if (hasOwnProperty.call(source, key)) {
- assignValue(object, key, source[key]);
- }
- }
-});
-
-/**
- * Creates an array of the own enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects. See the
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
- * for more details.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keys(new Foo);
- * // => ['a', 'b'] (iteration order is not guaranteed)
- *
- * _.keys('hi');
- * // => ['0', '1']
- */
-function keys(object) {
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
-}
-
-module.exports = assign;
-
-},{}],292:[function(require,module,exports){
-(function (global){
-/**
- * @license
- * Lodash <https://lodash.com/>
- * Copyright JS Foundation and other contributors <https://js.foundation/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
-;(function() {
-
- /** Used as a safe reference for `undefined` in pre-ES5 environments. */
- var undefined;
-
- /** Used as the semantic version number. */
- var VERSION = '4.17.4';
-
- /** Used as the size to enable large array optimizations. */
- var LARGE_ARRAY_SIZE = 200;
-
- /** Error message constants. */
- var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
- FUNC_ERROR_TEXT = 'Expected a function';
-
- /** Used to stand-in for `undefined` hash values. */
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
-
- /** Used as the maximum memoize cache size. */
- var MAX_MEMOIZE_SIZE = 500;
-
- /** Used as the internal argument placeholder. */
- var PLACEHOLDER = '__lodash_placeholder__';
-
- /** Used to compose bitmasks for cloning. */
- var CLONE_DEEP_FLAG = 1,
- CLONE_FLAT_FLAG = 2,
- CLONE_SYMBOLS_FLAG = 4;
-
- /** Used to compose bitmasks for value comparisons. */
- var COMPARE_PARTIAL_FLAG = 1,
- COMPARE_UNORDERED_FLAG = 2;
-
- /** Used to compose bitmasks for function metadata. */
- var WRAP_BIND_FLAG = 1,
- WRAP_BIND_KEY_FLAG = 2,
- WRAP_CURRY_BOUND_FLAG = 4,
- WRAP_CURRY_FLAG = 8,
- WRAP_CURRY_RIGHT_FLAG = 16,
- WRAP_PARTIAL_FLAG = 32,
- WRAP_PARTIAL_RIGHT_FLAG = 64,
- WRAP_ARY_FLAG = 128,
- WRAP_REARG_FLAG = 256,
- WRAP_FLIP_FLAG = 512;
-
- /** Used as default options for `_.truncate`. */
- var DEFAULT_TRUNC_LENGTH = 30,
- DEFAULT_TRUNC_OMISSION = '...';
-
- /** Used to detect hot functions by number of calls within a span of milliseconds. */
- var HOT_COUNT = 800,
- HOT_SPAN = 16;
-
- /** Used to indicate the type of lazy iteratees. */
- var LAZY_FILTER_FLAG = 1,
- LAZY_MAP_FLAG = 2,
- LAZY_WHILE_FLAG = 3;
-
- /** Used as references for various `Number` constants. */
- var INFINITY = 1 / 0,
- MAX_SAFE_INTEGER = 9007199254740991,
- MAX_INTEGER = 1.7976931348623157e+308,
- NAN = 0 / 0;
-
- /** Used as references for the maximum length and index of an array. */
- var MAX_ARRAY_LENGTH = 4294967295,
- MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
- HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
-
- /** Used to associate wrap methods with their bit flags. */
- var wrapFlags = [
- ['ary', WRAP_ARY_FLAG],
- ['bind', WRAP_BIND_FLAG],
- ['bindKey', WRAP_BIND_KEY_FLAG],
- ['curry', WRAP_CURRY_FLAG],
- ['curryRight', WRAP_CURRY_RIGHT_FLAG],
- ['flip', WRAP_FLIP_FLAG],
- ['partial', WRAP_PARTIAL_FLAG],
- ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
- ['rearg', WRAP_REARG_FLAG]
- ];
-
- /** `Object#toString` result references. */
- var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- asyncTag = '[object AsyncFunction]',
- boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- domExcTag = '[object DOMException]',
- errorTag = '[object Error]',
- funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- nullTag = '[object Null]',
- objectTag = '[object Object]',
- promiseTag = '[object Promise]',
- proxyTag = '[object Proxy]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- symbolTag = '[object Symbol]',
- undefinedTag = '[object Undefined]',
- weakMapTag = '[object WeakMap]',
- weakSetTag = '[object WeakSet]';
-
- var arrayBufferTag = '[object ArrayBuffer]',
- dataViewTag = '[object DataView]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
-
- /** Used to match empty string literals in compiled template source. */
- var reEmptyStringLeading = /\b__p \+= '';/g,
- reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
- reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
-
- /** Used to match HTML entities and HTML characters. */
- var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
- reUnescapedHtml = /[&<>"']/g,
- reHasEscapedHtml = RegExp(reEscapedHtml.source),
- reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
-
- /** Used to match template delimiters. */
- var reEscape = /<%-([\s\S]+?)%>/g,
- reEvaluate = /<%([\s\S]+?)%>/g,
- reInterpolate = /<%=([\s\S]+?)%>/g;
-
- /** Used to match property names within property paths. */
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
- reIsPlainProp = /^\w*$/,
- reLeadingDot = /^\./,
- rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
-
- /**
- * Used to match `RegExp`
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
- */
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
- reHasRegExpChar = RegExp(reRegExpChar.source);
-
- /** Used to match leading and trailing whitespace. */
- var reTrim = /^\s+|\s+$/g,
- reTrimStart = /^\s+/,
- reTrimEnd = /\s+$/;
-
- /** Used to match wrap detail comments. */
- var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
- reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
- reSplitDetails = /,? & /;
-
- /** Used to match words composed of alphanumeric characters. */
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
-
- /** Used to match backslashes in property paths. */
- var reEscapeChar = /\\(\\)?/g;
-
- /**
- * Used to match
- * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
- */
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
-
- /** Used to match `RegExp` flags from their coerced string values. */
- var reFlags = /\w*$/;
-
- /** Used to detect bad signed hexadecimal string values. */
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
-
- /** Used to detect binary string values. */
- var reIsBinary = /^0b[01]+$/i;
-
- /** Used to detect host constructors (Safari). */
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
- /** Used to detect octal string values. */
- var reIsOctal = /^0o[0-7]+$/i;
-
- /** Used to detect unsigned integer values. */
- var reIsUint = /^(?:0|[1-9]\d*)$/;
-
- /** Used to match Latin Unicode letters (excluding mathematical operators). */
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
-
- /** Used to ensure capturing order of template delimiters. */
- var reNoMatch = /($^)/;
-
- /** Used to match unescaped characters in compiled string literals. */
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
-
- /** Used to compose unicode character classes. */
- var rsAstralRange = '\\ud800-\\udfff',
- rsComboMarksRange = '\\u0300-\\u036f',
- reComboHalfMarksRange = '\\ufe20-\\ufe2f',
- rsComboSymbolsRange = '\\u20d0-\\u20ff',
- rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
- rsDingbatRange = '\\u2700-\\u27bf',
- rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
- rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
- rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
- rsPunctuationRange = '\\u2000-\\u206f',
- rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
- rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
- rsVarRange = '\\ufe0e\\ufe0f',
- rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
-
- /** Used to compose unicode capture groups. */
- var rsApos = "['\u2019]",
- rsAstral = '[' + rsAstralRange + ']',
- rsBreak = '[' + rsBreakRange + ']',
- rsCombo = '[' + rsComboRange + ']',
- rsDigits = '\\d+',
- rsDingbat = '[' + rsDingbatRange + ']',
- rsLower = '[' + rsLowerRange + ']',
- rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
- rsFitz = '\\ud83c[\\udffb-\\udfff]',
- rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
- rsNonAstral = '[^' + rsAstralRange + ']',
- rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
- rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
- rsUpper = '[' + rsUpperRange + ']',
- rsZWJ = '\\u200d';
-
- /** Used to compose unicode regexes. */
- var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
- rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
- rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
- rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
- reOptMod = rsModifier + '?',
- rsOptVar = '[' + rsVarRange + ']?',
- rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
- rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)',
- rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)',
- rsSeq = rsOptVar + reOptMod + rsOptJoin,
- rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
- rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
-
- /** Used to match apostrophes. */
- var reApos = RegExp(rsApos, 'g');
-
- /**
- * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
- * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
- */
- var reComboMark = RegExp(rsCombo, 'g');
-
- /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
- var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
-
- /** Used to match complex or compound words. */
- var reUnicodeWord = RegExp([
- rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
- rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
- rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
- rsUpper + '+' + rsOptContrUpper,
- rsOrdUpper,
- rsOrdLower,
- rsDigits,
- rsEmoji
- ].join('|'), 'g');
-
- /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
- var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
-
- /** Used to detect strings that need a more robust regexp to match words. */
- var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
-
- /** Used to assign default `context` object properties. */
- var contextProps = [
- 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
- 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
- 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
- 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
- '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
- ];
-
- /** Used to make template sourceURLs easier to identify. */
- var templateCounter = -1;
-
- /** Used to identify `toStringTag` values of typed arrays. */
- var typedArrayTags = {};
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
- typedArrayTags[uint32Tag] = true;
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
- typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
- typedArrayTags[errorTag] = typedArrayTags[funcTag] =
- typedArrayTags[mapTag] = typedArrayTags[numberTag] =
- typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
- typedArrayTags[setTag] = typedArrayTags[stringTag] =
- typedArrayTags[weakMapTag] = false;
-
- /** Used to identify `toStringTag` values supported by `_.clone`. */
- var cloneableTags = {};
- cloneableTags[argsTag] = cloneableTags[arrayTag] =
- cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
- cloneableTags[boolTag] = cloneableTags[dateTag] =
- cloneableTags[float32Tag] = cloneableTags[float64Tag] =
- cloneableTags[int8Tag] = cloneableTags[int16Tag] =
- cloneableTags[int32Tag] = cloneableTags[mapTag] =
- cloneableTags[numberTag] = cloneableTags[objectTag] =
- cloneableTags[regexpTag] = cloneableTags[setTag] =
- cloneableTags[stringTag] = cloneableTags[symbolTag] =
- cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
- cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
- cloneableTags[errorTag] = cloneableTags[funcTag] =
- cloneableTags[weakMapTag] = false;
-
- /** Used to map Latin Unicode letters to basic Latin letters. */
- var deburredLetters = {
- // Latin-1 Supplement block.
- '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
- '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
- '\xc7': 'C', '\xe7': 'c',
- '\xd0': 'D', '\xf0': 'd',
- '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
- '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
- '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
- '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
- '\xd1': 'N', '\xf1': 'n',
- '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
- '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
- '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
- '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
- '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
- '\xc6': 'Ae', '\xe6': 'ae',
- '\xde': 'Th', '\xfe': 'th',
- '\xdf': 'ss',
- // Latin Extended-A block.
- '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
- '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
- '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
- '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
- '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
- '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
- '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
- '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
- '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
- '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
- '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
- '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
- '\u0134': 'J', '\u0135': 'j',
- '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
- '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
- '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
- '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
- '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
- '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
- '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
- '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
- '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
- '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
- '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
- '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
- '\u0163': 't', '\u0165': 't', '\u0167': 't',
- '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
- '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
- '\u0174': 'W', '\u0175': 'w',
- '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
- '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
- '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
- '\u0132': 'IJ', '\u0133': 'ij',
- '\u0152': 'Oe', '\u0153': 'oe',
- '\u0149': "'n", '\u017f': 's'
- };
-
- /** Used to map characters to HTML entities. */
- var htmlEscapes = {
- '&': '&amp;',
- '<': '&lt;',
- '>': '&gt;',
- '"': '&quot;',
- "'": '&#39;'
- };
-
- /** Used to map HTML entities to characters. */
- var htmlUnescapes = {
- '&amp;': '&',
- '&lt;': '<',
- '&gt;': '>',
- '&quot;': '"',
- '&#39;': "'"
- };
-
- /** Used to escape characters for inclusion in compiled string literals. */
- var stringEscapes = {
- '\\': '\\',
- "'": "'",
- '\n': 'n',
- '\r': 'r',
- '\u2028': 'u2028',
- '\u2029': 'u2029'
- };
-
- /** Built-in method references without a dependency on `root`. */
- var freeParseFloat = parseFloat,
- freeParseInt = parseInt;
-
- /** Detect free variable `global` from Node.js. */
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
-
- /** Detect free variable `self`. */
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
-
- /** Used as a reference to the global object. */
- var root = freeGlobal || freeSelf || Function('return this')();
-
- /** Detect free variable `exports`. */
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
-
- /** Detect free variable `module`. */
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
-
- /** Detect the popular CommonJS extension `module.exports`. */
- var moduleExports = freeModule && freeModule.exports === freeExports;
-
- /** Detect free variable `process` from Node.js. */
- var freeProcess = moduleExports && freeGlobal.process;
-
- /** Used to access faster Node.js helpers. */
- var nodeUtil = (function() {
- try {
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
- } catch (e) {}
- }());
-
- /* Node.js helper references. */
- var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
- nodeIsDate = nodeUtil && nodeUtil.isDate,
- nodeIsMap = nodeUtil && nodeUtil.isMap,
- nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
- nodeIsSet = nodeUtil && nodeUtil.isSet,
- nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Adds the key-value `pair` to `map`.
- *
- * @private
- * @param {Object} map The map to modify.
- * @param {Array} pair The key-value pair to add.
- * @returns {Object} Returns `map`.
- */
- function addMapEntry(map, pair) {
- // Don't return `map.set` because it's not chainable in IE 11.
- map.set(pair[0], pair[1]);
- return map;
- }
-
- /**
- * Adds `value` to `set`.
- *
- * @private
- * @param {Object} set The set to modify.
- * @param {*} value The value to add.
- * @returns {Object} Returns `set`.
- */
- function addSetEntry(set, value) {
- // Don't return `set.add` because it's not chainable in IE 11.
- set.add(value);
- return set;
- }
-
- /**
- * A faster alternative to `Function#apply`, this function invokes `func`
- * with the `this` binding of `thisArg` and the arguments of `args`.
- *
- * @private
- * @param {Function} func The function to invoke.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {Array} args The arguments to invoke `func` with.
- * @returns {*} Returns the result of `func`.
- */
- function apply(func, thisArg, args) {
- switch (args.length) {
- case 0: return func.call(thisArg);
- case 1: return func.call(thisArg, args[0]);
- case 2: return func.call(thisArg, args[0], args[1]);
- case 3: return func.call(thisArg, args[0], args[1], args[2]);
- }
- return func.apply(thisArg, args);
- }
-
- /**
- * A specialized version of `baseAggregator` for arrays.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} setter The function to set `accumulator` values.
- * @param {Function} iteratee The iteratee to transform keys.
- * @param {Object} accumulator The initial aggregated object.
- * @returns {Function} Returns `accumulator`.
- */
- function arrayAggregator(array, setter, iteratee, accumulator) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- var value = array[index];
- setter(accumulator, value, iteratee(value), array);
- }
- return accumulator;
- }
-
- /**
- * A specialized version of `_.forEach` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
- function arrayEach(array, iteratee) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- if (iteratee(array[index], index, array) === false) {
- break;
- }
- }
- return array;
- }
-
- /**
- * A specialized version of `_.forEachRight` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
- function arrayEachRight(array, iteratee) {
- var length = array == null ? 0 : array.length;
-
- while (length--) {
- if (iteratee(array[length], length, array) === false) {
- break;
- }
- }
- return array;
- }
-
- /**
- * A specialized version of `_.every` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- */
- function arrayEvery(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- if (!predicate(array[index], index, array)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * A specialized version of `_.filter` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function arrayFilter(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length,
- resIndex = 0,
- result = [];
-
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result[resIndex++] = value;
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `_.includes` for arrays without support for
- * specifying an index to search from.
- *
- * @private
- * @param {Array} [array] The array to inspect.
- * @param {*} target The value to search for.
- * @returns {boolean} Returns `true` if `target` is found, else `false`.
- */
- function arrayIncludes(array, value) {
- var length = array == null ? 0 : array.length;
- return !!length && baseIndexOf(array, value, 0) > -1;
- }
-
- /**
- * This function is like `arrayIncludes` except that it accepts a comparator.
- *
- * @private
- * @param {Array} [array] The array to inspect.
- * @param {*} target The value to search for.
- * @param {Function} comparator The comparator invoked per element.
- * @returns {boolean} Returns `true` if `target` is found, else `false`.
- */
- function arrayIncludesWith(array, value, comparator) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- if (comparator(value, array[index])) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * A specialized version of `_.map` for arrays without support for iteratee
- * shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- */
- function arrayMap(array, iteratee) {
- var index = -1,
- length = array == null ? 0 : array.length,
- result = Array(length);
-
- while (++index < length) {
- result[index] = iteratee(array[index], index, array);
- }
- return result;
- }
-
- /**
- * Appends the elements of `values` to `array`.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {Array} values The values to append.
- * @returns {Array} Returns `array`.
- */
- function arrayPush(array, values) {
- var index = -1,
- length = values.length,
- offset = array.length;
-
- while (++index < length) {
- array[offset + index] = values[index];
- }
- return array;
- }
-
- /**
- * A specialized version of `_.reduce` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {boolean} [initAccum] Specify using the first element of `array` as
- * the initial value.
- * @returns {*} Returns the accumulated value.
- */
- function arrayReduce(array, iteratee, accumulator, initAccum) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- if (initAccum && length) {
- accumulator = array[++index];
- }
- while (++index < length) {
- accumulator = iteratee(accumulator, array[index], index, array);
- }
- return accumulator;
- }
-
- /**
- * A specialized version of `_.reduceRight` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {boolean} [initAccum] Specify using the last element of `array` as
- * the initial value.
- * @returns {*} Returns the accumulated value.
- */
- function arrayReduceRight(array, iteratee, accumulator, initAccum) {
- var length = array == null ? 0 : array.length;
- if (initAccum && length) {
- accumulator = array[--length];
- }
- while (length--) {
- accumulator = iteratee(accumulator, array[length], length, array);
- }
- return accumulator;
- }
-
- /**
- * A specialized version of `_.some` for arrays without support for iteratee
- * shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- */
- function arraySome(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- if (predicate(array[index], index, array)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Gets the size of an ASCII `string`.
- *
- * @private
- * @param {string} string The string inspect.
- * @returns {number} Returns the string size.
- */
- var asciiSize = baseProperty('length');
-
- /**
- * Converts an ASCII `string` to an array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the converted array.
- */
- function asciiToArray(string) {
- return string.split('');
- }
-
- /**
- * Splits an ASCII `string` into an array of its words.
- *
- * @private
- * @param {string} The string to inspect.
- * @returns {Array} Returns the words of `string`.
- */
- function asciiWords(string) {
- return string.match(reAsciiWord) || [];
- }
-
- /**
- * The base implementation of methods like `_.findKey` and `_.findLastKey`,
- * without support for iteratee shorthands, which iterates over `collection`
- * using `eachFunc`.
- *
- * @private
- * @param {Array|Object} collection The collection to inspect.
- * @param {Function} predicate The function invoked per iteration.
- * @param {Function} eachFunc The function to iterate over `collection`.
- * @returns {*} Returns the found element or its key, else `undefined`.
- */
- function baseFindKey(collection, predicate, eachFunc) {
- var result;
- eachFunc(collection, function(value, key, collection) {
- if (predicate(value, key, collection)) {
- result = key;
- return false;
- }
- });
- return result;
- }
-
- /**
- * The base implementation of `_.findIndex` and `_.findLastIndex` without
- * support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} predicate The function invoked per iteration.
- * @param {number} fromIndex The index to search from.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
- var length = array.length,
- index = fromIndex + (fromRight ? 1 : -1);
-
- while ((fromRight ? index-- : ++index < length)) {
- if (predicate(array[index], index, array)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseIndexOf(array, value, fromIndex) {
- return value === value
- ? strictIndexOf(array, value, fromIndex)
- : baseFindIndex(array, baseIsNaN, fromIndex);
- }
-
- /**
- * This function is like `baseIndexOf` except that it accepts a comparator.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @param {Function} comparator The comparator invoked per element.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseIndexOfWith(array, value, fromIndex, comparator) {
- var index = fromIndex - 1,
- length = array.length;
-
- while (++index < length) {
- if (comparator(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * The base implementation of `_.isNaN` without support for number objects.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
- */
- function baseIsNaN(value) {
- return value !== value;
- }
-
- /**
- * The base implementation of `_.mean` and `_.meanBy` without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {number} Returns the mean.
- */
- function baseMean(array, iteratee) {
- var length = array == null ? 0 : array.length;
- return length ? (baseSum(array, iteratee) / length) : NAN;
- }
-
- /**
- * The base implementation of `_.property` without support for deep paths.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @returns {Function} Returns the new accessor function.
- */
- function baseProperty(key) {
- return function(object) {
- return object == null ? undefined : object[key];
- };
- }
-
- /**
- * The base implementation of `_.propertyOf` without support for deep paths.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Function} Returns the new accessor function.
- */
- function basePropertyOf(object) {
- return function(key) {
- return object == null ? undefined : object[key];
- };
- }
-
- /**
- * The base implementation of `_.reduce` and `_.reduceRight`, without support
- * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} accumulator The initial value.
- * @param {boolean} initAccum Specify using the first or last element of
- * `collection` as the initial value.
- * @param {Function} eachFunc The function to iterate over `collection`.
- * @returns {*} Returns the accumulated value.
- */
- function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
- eachFunc(collection, function(value, index, collection) {
- accumulator = initAccum
- ? (initAccum = false, value)
- : iteratee(accumulator, value, index, collection);
- });
- return accumulator;
- }
-
- /**
- * The base implementation of `_.sortBy` which uses `comparer` to define the
- * sort order of `array` and replaces criteria objects with their corresponding
- * values.
- *
- * @private
- * @param {Array} array The array to sort.
- * @param {Function} comparer The function to define sort order.
- * @returns {Array} Returns `array`.
- */
- function baseSortBy(array, comparer) {
- var length = array.length;
-
- array.sort(comparer);
- while (length--) {
- array[length] = array[length].value;
- }
- return array;
- }
-
- /**
- * The base implementation of `_.sum` and `_.sumBy` without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {number} Returns the sum.
- */
- function baseSum(array, iteratee) {
- var result,
- index = -1,
- length = array.length;
-
- while (++index < length) {
- var current = iteratee(array[index]);
- if (current !== undefined) {
- result = result === undefined ? current : (result + current);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.times` without support for iteratee shorthands
- * or max array length checks.
- *
- * @private
- * @param {number} n The number of times to invoke `iteratee`.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the array of results.
- */
- function baseTimes(n, iteratee) {
- var index = -1,
- result = Array(n);
-
- while (++index < n) {
- result[index] = iteratee(index);
- }
- return result;
- }
-
- /**
- * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
- * of key-value pairs for `object` corresponding to the property names of `props`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} props The property names to get values for.
- * @returns {Object} Returns the key-value pairs.
- */
- function baseToPairs(object, props) {
- return arrayMap(props, function(key) {
- return [key, object[key]];
- });
- }
-
- /**
- * The base implementation of `_.unary` without support for storing metadata.
- *
- * @private
- * @param {Function} func The function to cap arguments for.
- * @returns {Function} Returns the new capped function.
- */
- function baseUnary(func) {
- return function(value) {
- return func(value);
- };
- }
-
- /**
- * The base implementation of `_.values` and `_.valuesIn` which creates an
- * array of `object` property values corresponding to the property names
- * of `props`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} props The property names to get values for.
- * @returns {Object} Returns the array of property values.
- */
- function baseValues(object, props) {
- return arrayMap(props, function(key) {
- return object[key];
- });
- }
-
- /**
- * Checks if a `cache` value for `key` exists.
- *
- * @private
- * @param {Object} cache The cache to query.
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function cacheHas(cache, key) {
- return cache.has(key);
- }
-
- /**
- * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
- * that is not found in the character symbols.
- *
- * @private
- * @param {Array} strSymbols The string symbols to inspect.
- * @param {Array} chrSymbols The character symbols to find.
- * @returns {number} Returns the index of the first unmatched string symbol.
- */
- function charsStartIndex(strSymbols, chrSymbols) {
- var index = -1,
- length = strSymbols.length;
-
- while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
- return index;
- }
-
- /**
- * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
- * that is not found in the character symbols.
- *
- * @private
- * @param {Array} strSymbols The string symbols to inspect.
- * @param {Array} chrSymbols The character symbols to find.
- * @returns {number} Returns the index of the last unmatched string symbol.
- */
- function charsEndIndex(strSymbols, chrSymbols) {
- var index = strSymbols.length;
-
- while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
- return index;
- }
-
- /**
- * Gets the number of `placeholder` occurrences in `array`.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} placeholder The placeholder to search for.
- * @returns {number} Returns the placeholder count.
- */
- function countHolders(array, placeholder) {
- var length = array.length,
- result = 0;
-
- while (length--) {
- if (array[length] === placeholder) {
- ++result;
- }
- }
- return result;
- }
-
- /**
- * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
- * letters to basic Latin letters.
- *
- * @private
- * @param {string} letter The matched letter to deburr.
- * @returns {string} Returns the deburred letter.
- */
- var deburrLetter = basePropertyOf(deburredLetters);
-
- /**
- * Used by `_.escape` to convert characters to HTML entities.
- *
- * @private
- * @param {string} chr The matched character to escape.
- * @returns {string} Returns the escaped character.
- */
- var escapeHtmlChar = basePropertyOf(htmlEscapes);
-
- /**
- * Used by `_.template` to escape characters for inclusion in compiled string literals.
- *
- * @private
- * @param {string} chr The matched character to escape.
- * @returns {string} Returns the escaped character.
- */
- function escapeStringChar(chr) {
- return '\\' + stringEscapes[chr];
- }
-
- /**
- * Gets the value at `key` of `object`.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {string} key The key of the property to get.
- * @returns {*} Returns the property value.
- */
- function getValue(object, key) {
- return object == null ? undefined : object[key];
- }
-
- /**
- * Checks if `string` contains Unicode symbols.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {boolean} Returns `true` if a symbol is found, else `false`.
- */
- function hasUnicode(string) {
- return reHasUnicode.test(string);
- }
-
- /**
- * Checks if `string` contains a word composed of Unicode symbols.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {boolean} Returns `true` if a word is found, else `false`.
- */
- function hasUnicodeWord(string) {
- return reHasUnicodeWord.test(string);
- }
-
- /**
- * Converts `iterator` to an array.
- *
- * @private
- * @param {Object} iterator The iterator to convert.
- * @returns {Array} Returns the converted array.
- */
- function iteratorToArray(iterator) {
- var data,
- result = [];
-
- while (!(data = iterator.next()).done) {
- result.push(data.value);
- }
- return result;
- }
-
- /**
- * Converts `map` to its key-value pairs.
- *
- * @private
- * @param {Object} map The map to convert.
- * @returns {Array} Returns the key-value pairs.
- */
- function mapToArray(map) {
- var index = -1,
- result = Array(map.size);
-
- map.forEach(function(value, key) {
- result[++index] = [key, value];
- });
- return result;
- }
-
- /**
- * Creates a unary function that invokes `func` with its argument transformed.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {Function} transform The argument transform.
- * @returns {Function} Returns the new function.
- */
- function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
- }
-
- /**
- * Replaces all `placeholder` elements in `array` with an internal placeholder
- * and returns an array of their indexes.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {*} placeholder The placeholder to replace.
- * @returns {Array} Returns the new array of placeholder indexes.
- */
- function replaceHolders(array, placeholder) {
- var index = -1,
- length = array.length,
- resIndex = 0,
- result = [];
-
- while (++index < length) {
- var value = array[index];
- if (value === placeholder || value === PLACEHOLDER) {
- array[index] = PLACEHOLDER;
- result[resIndex++] = index;
- }
- }
- return result;
- }
-
- /**
- * Converts `set` to an array of its values.
- *
- * @private
- * @param {Object} set The set to convert.
- * @returns {Array} Returns the values.
- */
- function setToArray(set) {
- var index = -1,
- result = Array(set.size);
-
- set.forEach(function(value) {
- result[++index] = value;
- });
- return result;
- }
-
- /**
- * Converts `set` to its value-value pairs.
- *
- * @private
- * @param {Object} set The set to convert.
- * @returns {Array} Returns the value-value pairs.
- */
- function setToPairs(set) {
- var index = -1,
- result = Array(set.size);
-
- set.forEach(function(value) {
- result[++index] = [value, value];
- });
- return result;
- }
-
- /**
- * A specialized version of `_.indexOf` which performs strict equality
- * comparisons of values, i.e. `===`.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function strictIndexOf(array, value, fromIndex) {
- var index = fromIndex - 1,
- length = array.length;
-
- while (++index < length) {
- if (array[index] === value) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * A specialized version of `_.lastIndexOf` which performs strict equality
- * comparisons of values, i.e. `===`.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function strictLastIndexOf(array, value, fromIndex) {
- var index = fromIndex + 1;
- while (index--) {
- if (array[index] === value) {
- return index;
- }
- }
- return index;
- }
-
- /**
- * Gets the number of symbols in `string`.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {number} Returns the string size.
- */
- function stringSize(string) {
- return hasUnicode(string)
- ? unicodeSize(string)
- : asciiSize(string);
- }
-
- /**
- * Converts `string` to an array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the converted array.
- */
- function stringToArray(string) {
- return hasUnicode(string)
- ? unicodeToArray(string)
- : asciiToArray(string);
- }
-
- /**
- * Used by `_.unescape` to convert HTML entities to characters.
- *
- * @private
- * @param {string} chr The matched character to unescape.
- * @returns {string} Returns the unescaped character.
- */
- var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
-
- /**
- * Gets the size of a Unicode `string`.
- *
- * @private
- * @param {string} string The string inspect.
- * @returns {number} Returns the string size.
- */
- function unicodeSize(string) {
- var result = reUnicode.lastIndex = 0;
- while (reUnicode.test(string)) {
- ++result;
- }
- return result;
- }
-
- /**
- * Converts a Unicode `string` to an array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the converted array.
- */
- function unicodeToArray(string) {
- return string.match(reUnicode) || [];
- }
-
- /**
- * Splits a Unicode `string` into an array of its words.
- *
- * @private
- * @param {string} The string to inspect.
- * @returns {Array} Returns the words of `string`.
- */
- function unicodeWords(string) {
- return string.match(reUnicodeWord) || [];
- }
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Create a new pristine `lodash` function using the `context` object.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category Util
- * @param {Object} [context=root] The context object.
- * @returns {Function} Returns a new `lodash` function.
- * @example
- *
- * _.mixin({ 'foo': _.constant('foo') });
- *
- * var lodash = _.runInContext();
- * lodash.mixin({ 'bar': lodash.constant('bar') });
- *
- * _.isFunction(_.foo);
- * // => true
- * _.isFunction(_.bar);
- * // => false
- *
- * lodash.isFunction(lodash.foo);
- * // => false
- * lodash.isFunction(lodash.bar);
- * // => true
- *
- * // Create a suped-up `defer` in Node.js.
- * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
- */
- var runInContext = (function runInContext(context) {
- context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
-
- /** Built-in constructor references. */
- var Array = context.Array,
- Date = context.Date,
- Error = context.Error,
- Function = context.Function,
- Math = context.Math,
- Object = context.Object,
- RegExp = context.RegExp,
- String = context.String,
- TypeError = context.TypeError;
-
- /** Used for built-in method references. */
- var arrayProto = Array.prototype,
- funcProto = Function.prototype,
- objectProto = Object.prototype;
-
- /** Used to detect overreaching core-js shims. */
- var coreJsData = context['__core-js_shared__'];
-
- /** Used to resolve the decompiled source of functions. */
- var funcToString = funcProto.toString;
-
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
-
- /** Used to generate unique IDs. */
- var idCounter = 0;
-
- /** Used to detect methods masquerading as native. */
- var maskSrcKey = (function() {
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
- return uid ? ('Symbol(src)_1.' + uid) : '';
- }());
-
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var nativeObjectToString = objectProto.toString;
-
- /** Used to infer the `Object` constructor. */
- var objectCtorString = funcToString.call(Object);
-
- /** Used to restore the original `_` reference in `_.noConflict`. */
- var oldDash = root._;
-
- /** Used to detect if a method is native. */
- var reIsNative = RegExp('^' +
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
- );
-
- /** Built-in value references. */
- var Buffer = moduleExports ? context.Buffer : undefined,
- Symbol = context.Symbol,
- Uint8Array = context.Uint8Array,
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
- getPrototype = overArg(Object.getPrototypeOf, Object),
- objectCreate = Object.create,
- propertyIsEnumerable = objectProto.propertyIsEnumerable,
- splice = arrayProto.splice,
- spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
- symIterator = Symbol ? Symbol.iterator : undefined,
- symToStringTag = Symbol ? Symbol.toStringTag : undefined;
-
- var defineProperty = (function() {
- try {
- var func = getNative(Object, 'defineProperty');
- func({}, '', {});
- return func;
- } catch (e) {}
- }());
-
- /** Mocked built-ins. */
- var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
- ctxNow = Date && Date.now !== root.Date.now && Date.now,
- ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
-
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeCeil = Math.ceil,
- nativeFloor = Math.floor,
- nativeGetSymbols = Object.getOwnPropertySymbols,
- nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
- nativeIsFinite = context.isFinite,
- nativeJoin = arrayProto.join,
- nativeKeys = overArg(Object.keys, Object),
- nativeMax = Math.max,
- nativeMin = Math.min,
- nativeNow = Date.now,
- nativeParseInt = context.parseInt,
- nativeRandom = Math.random,
- nativeReverse = arrayProto.reverse;
-
- /* Built-in method references that are verified to be native. */
- var DataView = getNative(context, 'DataView'),
- Map = getNative(context, 'Map'),
- Promise = getNative(context, 'Promise'),
- Set = getNative(context, 'Set'),
- WeakMap = getNative(context, 'WeakMap'),
- nativeCreate = getNative(Object, 'create');
-
- /** Used to store function metadata. */
- var metaMap = WeakMap && new WeakMap;
-
- /** Used to lookup unminified function names. */
- var realNames = {};
-
- /** Used to detect maps, sets, and weakmaps. */
- var dataViewCtorString = toSource(DataView),
- mapCtorString = toSource(Map),
- promiseCtorString = toSource(Promise),
- setCtorString = toSource(Set),
- weakMapCtorString = toSource(WeakMap);
-
- /** Used to convert symbols to primitives and strings. */
- var symbolProto = Symbol ? Symbol.prototype : undefined,
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
- symbolToString = symbolProto ? symbolProto.toString : undefined;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a `lodash` object which wraps `value` to enable implicit method
- * chain sequences. Methods that operate on and return arrays, collections,
- * and functions can be chained together. Methods that retrieve a single value
- * or may return a primitive value will automatically end the chain sequence
- * and return the unwrapped value. Otherwise, the value must be unwrapped
- * with `_#value`.
- *
- * Explicit chain sequences, which must be unwrapped with `_#value`, may be
- * enabled using `_.chain`.
- *
- * The execution of chained methods is lazy, that is, it's deferred until
- * `_#value` is implicitly or explicitly called.
- *
- * Lazy evaluation allows several methods to support shortcut fusion.
- * Shortcut fusion is an optimization to merge iteratee calls; this avoids
- * the creation of intermediate arrays and can greatly reduce the number of
- * iteratee executions. Sections of a chain sequence qualify for shortcut
- * fusion if the section is applied to an array and iteratees accept only
- * one argument. The heuristic for whether a section qualifies for shortcut
- * fusion is subject to change.
- *
- * Chaining is supported in custom builds as long as the `_#value` method is
- * directly or indirectly included in the build.
- *
- * In addition to lodash methods, wrappers have `Array` and `String` methods.
- *
- * The wrapper `Array` methods are:
- * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
- *
- * The wrapper `String` methods are:
- * `replace` and `split`
- *
- * The wrapper methods that support shortcut fusion are:
- * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
- * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
- * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
- *
- * The chainable wrapper methods are:
- * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
- * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
- * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
- * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
- * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
- * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
- * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
- * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
- * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
- * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
- * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
- * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
- * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
- * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
- * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
- * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
- * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
- * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
- * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
- * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
- * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
- * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
- * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
- * `zipObject`, `zipObjectDeep`, and `zipWith`
- *
- * The wrapper methods that are **not** chainable by default are:
- * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
- * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
- * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
- * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
- * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
- * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
- * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
- * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
- * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
- * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
- * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
- * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
- * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
- * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
- * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
- * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
- * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
- * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
- * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
- * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
- * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
- * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
- * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
- * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
- * `upperFirst`, `value`, and `words`
- *
- * @name _
- * @constructor
- * @category Seq
- * @param {*} value The value to wrap in a `lodash` instance.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var wrapped = _([1, 2, 3]);
- *
- * // Returns an unwrapped value.
- * wrapped.reduce(_.add);
- * // => 6
- *
- * // Returns a wrapped value.
- * var squares = wrapped.map(square);
- *
- * _.isArray(squares);
- * // => false
- *
- * _.isArray(squares.value());
- * // => true
- */
- function lodash(value) {
- if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
- if (value instanceof LodashWrapper) {
- return value;
- }
- if (hasOwnProperty.call(value, '__wrapped__')) {
- return wrapperClone(value);
- }
- }
- return new LodashWrapper(value);
- }
-
- /**
- * The base implementation of `_.create` without support for assigning
- * properties to the created object.
- *
- * @private
- * @param {Object} proto The object to inherit from.
- * @returns {Object} Returns the new object.
- */
- var baseCreate = (function() {
- function object() {}
- return function(proto) {
- if (!isObject(proto)) {
- return {};
- }
- if (objectCreate) {
- return objectCreate(proto);
- }
- object.prototype = proto;
- var result = new object;
- object.prototype = undefined;
- return result;
- };
- }());
-
- /**
- * The function whose prototype chain sequence wrappers inherit from.
- *
- * @private
- */
- function baseLodash() {
- // No operation performed.
- }
-
- /**
- * The base constructor for creating `lodash` wrapper objects.
- *
- * @private
- * @param {*} value The value to wrap.
- * @param {boolean} [chainAll] Enable explicit method chain sequences.
- */
- function LodashWrapper(value, chainAll) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__chain__ = !!chainAll;
- this.__index__ = 0;
- this.__values__ = undefined;
- }
-
- /**
- * By default, the template delimiters used by lodash are like those in
- * embedded Ruby (ERB) as well as ES2015 template strings. Change the
- * following template settings to use alternative delimiters.
- *
- * @static
- * @memberOf _
- * @type {Object}
- */
- lodash.templateSettings = {
-
- /**
- * Used to detect `data` property values to be HTML-escaped.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- 'escape': reEscape,
-
- /**
- * Used to detect code to be evaluated.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- 'evaluate': reEvaluate,
-
- /**
- * Used to detect `data` property values to inject.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- 'interpolate': reInterpolate,
-
- /**
- * Used to reference the data object in the template text.
- *
- * @memberOf _.templateSettings
- * @type {string}
- */
- 'variable': '',
-
- /**
- * Used to import variables into the compiled template.
- *
- * @memberOf _.templateSettings
- * @type {Object}
- */
- 'imports': {
-
- /**
- * A reference to the `lodash` function.
- *
- * @memberOf _.templateSettings.imports
- * @type {Function}
- */
- '_': lodash
- }
- };
-
- // Ensure wrappers are instances of `baseLodash`.
- lodash.prototype = baseLodash.prototype;
- lodash.prototype.constructor = lodash;
-
- LodashWrapper.prototype = baseCreate(baseLodash.prototype);
- LodashWrapper.prototype.constructor = LodashWrapper;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
- *
- * @private
- * @constructor
- * @param {*} value The value to wrap.
- */
- function LazyWrapper(value) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__dir__ = 1;
- this.__filtered__ = false;
- this.__iteratees__ = [];
- this.__takeCount__ = MAX_ARRAY_LENGTH;
- this.__views__ = [];
- }
-
- /**
- * Creates a clone of the lazy wrapper object.
- *
- * @private
- * @name clone
- * @memberOf LazyWrapper
- * @returns {Object} Returns the cloned `LazyWrapper` object.
- */
- function lazyClone() {
- var result = new LazyWrapper(this.__wrapped__);
- result.__actions__ = copyArray(this.__actions__);
- result.__dir__ = this.__dir__;
- result.__filtered__ = this.__filtered__;
- result.__iteratees__ = copyArray(this.__iteratees__);
- result.__takeCount__ = this.__takeCount__;
- result.__views__ = copyArray(this.__views__);
- return result;
- }
-
- /**
- * Reverses the direction of lazy iteration.
- *
- * @private
- * @name reverse
- * @memberOf LazyWrapper
- * @returns {Object} Returns the new reversed `LazyWrapper` object.
- */
- function lazyReverse() {
- if (this.__filtered__) {
- var result = new LazyWrapper(this);
- result.__dir__ = -1;
- result.__filtered__ = true;
- } else {
- result = this.clone();
- result.__dir__ *= -1;
- }
- return result;
- }
-
- /**
- * Extracts the unwrapped value from its lazy wrapper.
- *
- * @private
- * @name value
- * @memberOf LazyWrapper
- * @returns {*} Returns the unwrapped value.
- */
- function lazyValue() {
- var array = this.__wrapped__.value(),
- dir = this.__dir__,
- isArr = isArray(array),
- isRight = dir < 0,
- arrLength = isArr ? array.length : 0,
- view = getView(0, arrLength, this.__views__),
- start = view.start,
- end = view.end,
- length = end - start,
- index = isRight ? end : (start - 1),
- iteratees = this.__iteratees__,
- iterLength = iteratees.length,
- resIndex = 0,
- takeCount = nativeMin(length, this.__takeCount__);
-
- if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
- return baseWrapperValue(array, this.__actions__);
- }
- var result = [];
-
- outer:
- while (length-- && resIndex < takeCount) {
- index += dir;
-
- var iterIndex = -1,
- value = array[index];
-
- while (++iterIndex < iterLength) {
- var data = iteratees[iterIndex],
- iteratee = data.iteratee,
- type = data.type,
- computed = iteratee(value);
-
- if (type == LAZY_MAP_FLAG) {
- value = computed;
- } else if (!computed) {
- if (type == LAZY_FILTER_FLAG) {
- continue outer;
- } else {
- break outer;
- }
- }
- }
- result[resIndex++] = value;
- }
- return result;
- }
-
- // Ensure `LazyWrapper` is an instance of `baseLodash`.
- LazyWrapper.prototype = baseCreate(baseLodash.prototype);
- LazyWrapper.prototype.constructor = LazyWrapper;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a hash object.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function Hash(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
-
- /**
- * Removes all key-value entries from the hash.
- *
- * @private
- * @name clear
- * @memberOf Hash
- */
- function hashClear() {
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
- this.size = 0;
- }
-
- /**
- * Removes `key` and its value from the hash.
- *
- * @private
- * @name delete
- * @memberOf Hash
- * @param {Object} hash The hash to modify.
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function hashDelete(key) {
- var result = this.has(key) && delete this.__data__[key];
- this.size -= result ? 1 : 0;
- return result;
- }
-
- /**
- * Gets the hash value for `key`.
- *
- * @private
- * @name get
- * @memberOf Hash
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function hashGet(key) {
- var data = this.__data__;
- if (nativeCreate) {
- var result = data[key];
- return result === HASH_UNDEFINED ? undefined : result;
- }
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
- }
-
- /**
- * Checks if a hash value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf Hash
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function hashHas(key) {
- var data = this.__data__;
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
- }
-
- /**
- * Sets the hash `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf Hash
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the hash instance.
- */
- function hashSet(key, value) {
- var data = this.__data__;
- this.size += this.has(key) ? 0 : 1;
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
- return this;
- }
-
- // Add methods to `Hash`.
- Hash.prototype.clear = hashClear;
- Hash.prototype['delete'] = hashDelete;
- Hash.prototype.get = hashGet;
- Hash.prototype.has = hashHas;
- Hash.prototype.set = hashSet;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an list cache object.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function ListCache(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
-
- /**
- * Removes all key-value entries from the list cache.
- *
- * @private
- * @name clear
- * @memberOf ListCache
- */
- function listCacheClear() {
- this.__data__ = [];
- this.size = 0;
- }
-
- /**
- * Removes `key` and its value from the list cache.
- *
- * @private
- * @name delete
- * @memberOf ListCache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function listCacheDelete(key) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- if (index < 0) {
- return false;
- }
- var lastIndex = data.length - 1;
- if (index == lastIndex) {
- data.pop();
- } else {
- splice.call(data, index, 1);
- }
- --this.size;
- return true;
- }
-
- /**
- * Gets the list cache value for `key`.
- *
- * @private
- * @name get
- * @memberOf ListCache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function listCacheGet(key) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- return index < 0 ? undefined : data[index][1];
- }
-
- /**
- * Checks if a list cache value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf ListCache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function listCacheHas(key) {
- return assocIndexOf(this.__data__, key) > -1;
- }
-
- /**
- * Sets the list cache `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf ListCache
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the list cache instance.
- */
- function listCacheSet(key, value) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- if (index < 0) {
- ++this.size;
- data.push([key, value]);
- } else {
- data[index][1] = value;
- }
- return this;
- }
-
- // Add methods to `ListCache`.
- ListCache.prototype.clear = listCacheClear;
- ListCache.prototype['delete'] = listCacheDelete;
- ListCache.prototype.get = listCacheGet;
- ListCache.prototype.has = listCacheHas;
- ListCache.prototype.set = listCacheSet;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a map cache object to store key-value pairs.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function MapCache(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
-
- /**
- * Removes all key-value entries from the map.
- *
- * @private
- * @name clear
- * @memberOf MapCache
- */
- function mapCacheClear() {
- this.size = 0;
- this.__data__ = {
- 'hash': new Hash,
- 'map': new (Map || ListCache),
- 'string': new Hash
- };
- }
-
- /**
- * Removes `key` and its value from the map.
- *
- * @private
- * @name delete
- * @memberOf MapCache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function mapCacheDelete(key) {
- var result = getMapData(this, key)['delete'](key);
- this.size -= result ? 1 : 0;
- return result;
- }
-
- /**
- * Gets the map value for `key`.
- *
- * @private
- * @name get
- * @memberOf MapCache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function mapCacheGet(key) {
- return getMapData(this, key).get(key);
- }
-
- /**
- * Checks if a map value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf MapCache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function mapCacheHas(key) {
- return getMapData(this, key).has(key);
- }
-
- /**
- * Sets the map `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf MapCache
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the map cache instance.
- */
- function mapCacheSet(key, value) {
- var data = getMapData(this, key),
- size = data.size;
-
- data.set(key, value);
- this.size += data.size == size ? 0 : 1;
- return this;
- }
-
- // Add methods to `MapCache`.
- MapCache.prototype.clear = mapCacheClear;
- MapCache.prototype['delete'] = mapCacheDelete;
- MapCache.prototype.get = mapCacheGet;
- MapCache.prototype.has = mapCacheHas;
- MapCache.prototype.set = mapCacheSet;
-
- /*------------------------------------------------------------------------*/
-
- /**
- *
- * Creates an array cache object to store unique values.
- *
- * @private
- * @constructor
- * @param {Array} [values] The values to cache.
- */
- function SetCache(values) {
- var index = -1,
- length = values == null ? 0 : values.length;
-
- this.__data__ = new MapCache;
- while (++index < length) {
- this.add(values[index]);
- }
- }
-
- /**
- * Adds `value` to the array cache.
- *
- * @private
- * @name add
- * @memberOf SetCache
- * @alias push
- * @param {*} value The value to cache.
- * @returns {Object} Returns the cache instance.
- */
- function setCacheAdd(value) {
- this.__data__.set(value, HASH_UNDEFINED);
- return this;
- }
-
- /**
- * Checks if `value` is in the array cache.
- *
- * @private
- * @name has
- * @memberOf SetCache
- * @param {*} value The value to search for.
- * @returns {number} Returns `true` if `value` is found, else `false`.
- */
- function setCacheHas(value) {
- return this.__data__.has(value);
- }
-
- // Add methods to `SetCache`.
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
- SetCache.prototype.has = setCacheHas;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a stack cache object to store key-value pairs.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function Stack(entries) {
- var data = this.__data__ = new ListCache(entries);
- this.size = data.size;
- }
-
- /**
- * Removes all key-value entries from the stack.
- *
- * @private
- * @name clear
- * @memberOf Stack
- */
- function stackClear() {
- this.__data__ = new ListCache;
- this.size = 0;
- }
-
- /**
- * Removes `key` and its value from the stack.
- *
- * @private
- * @name delete
- * @memberOf Stack
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function stackDelete(key) {
- var data = this.__data__,
- result = data['delete'](key);
-
- this.size = data.size;
- return result;
- }
-
- /**
- * Gets the stack value for `key`.
- *
- * @private
- * @name get
- * @memberOf Stack
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function stackGet(key) {
- return this.__data__.get(key);
- }
-
- /**
- * Checks if a stack value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf Stack
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function stackHas(key) {
- return this.__data__.has(key);
- }
-
- /**
- * Sets the stack `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf Stack
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the stack cache instance.
- */
- function stackSet(key, value) {
- var data = this.__data__;
- if (data instanceof ListCache) {
- var pairs = data.__data__;
- if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
- pairs.push([key, value]);
- this.size = ++data.size;
- return this;
- }
- data = this.__data__ = new MapCache(pairs);
- }
- data.set(key, value);
- this.size = data.size;
- return this;
- }
-
- // Add methods to `Stack`.
- Stack.prototype.clear = stackClear;
- Stack.prototype['delete'] = stackDelete;
- Stack.prototype.get = stackGet;
- Stack.prototype.has = stackHas;
- Stack.prototype.set = stackSet;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an array of the enumerable property names of the array-like `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @param {boolean} inherited Specify returning inherited property names.
- * @returns {Array} Returns the array of property names.
- */
- function arrayLikeKeys(value, inherited) {
- var isArr = isArray(value),
- isArg = !isArr && isArguments(value),
- isBuff = !isArr && !isArg && isBuffer(value),
- isType = !isArr && !isArg && !isBuff && isTypedArray(value),
- skipIndexes = isArr || isArg || isBuff || isType,
- result = skipIndexes ? baseTimes(value.length, String) : [],
- length = result.length;
-
- for (var key in value) {
- if ((inherited || hasOwnProperty.call(value, key)) &&
- !(skipIndexes && (
- // Safari 9 has enumerable `arguments.length` in strict mode.
- key == 'length' ||
- // Node.js 0.10 has enumerable non-index properties on buffers.
- (isBuff && (key == 'offset' || key == 'parent')) ||
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
- // Skip index properties.
- isIndex(key, length)
- ))) {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `_.sample` for arrays.
- *
- * @private
- * @param {Array} array The array to sample.
- * @returns {*} Returns the random element.
- */
- function arraySample(array) {
- var length = array.length;
- return length ? array[baseRandom(0, length - 1)] : undefined;
- }
-
- /**
- * A specialized version of `_.sampleSize` for arrays.
- *
- * @private
- * @param {Array} array The array to sample.
- * @param {number} n The number of elements to sample.
- * @returns {Array} Returns the random elements.
- */
- function arraySampleSize(array, n) {
- return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
- }
-
- /**
- * A specialized version of `_.shuffle` for arrays.
- *
- * @private
- * @param {Array} array The array to shuffle.
- * @returns {Array} Returns the new shuffled array.
- */
- function arrayShuffle(array) {
- return shuffleSelf(copyArray(array));
- }
-
- /**
- * This function is like `assignValue` except that it doesn't assign
- * `undefined` values.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
- function assignMergeValue(object, key, value) {
- if ((value !== undefined && !eq(object[key], value)) ||
- (value === undefined && !(key in object))) {
- baseAssignValue(object, key, value);
- }
- }
-
- /**
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
- function assignValue(object, key, value) {
- var objValue = object[key];
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
- (value === undefined && !(key in object))) {
- baseAssignValue(object, key, value);
- }
- }
-
- /**
- * Gets the index at which the `key` is found in `array` of key-value pairs.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} key The key to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function assocIndexOf(array, key) {
- var length = array.length;
- while (length--) {
- if (eq(array[length][0], key)) {
- return length;
- }
- }
- return -1;
- }
-
- /**
- * Aggregates elements of `collection` on `accumulator` with keys transformed
- * by `iteratee` and values set by `setter`.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} setter The function to set `accumulator` values.
- * @param {Function} iteratee The iteratee to transform keys.
- * @param {Object} accumulator The initial aggregated object.
- * @returns {Function} Returns `accumulator`.
- */
- function baseAggregator(collection, setter, iteratee, accumulator) {
- baseEach(collection, function(value, key, collection) {
- setter(accumulator, value, iteratee(value), collection);
- });
- return accumulator;
- }
-
- /**
- * The base implementation of `_.assign` without support for multiple sources
- * or `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
- function baseAssign(object, source) {
- return object && copyObject(source, keys(source), object);
- }
-
- /**
- * The base implementation of `_.assignIn` without support for multiple sources
- * or `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
- function baseAssignIn(object, source) {
- return object && copyObject(source, keysIn(source), object);
- }
-
- /**
- * The base implementation of `assignValue` and `assignMergeValue` without
- * value checks.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
- function baseAssignValue(object, key, value) {
- if (key == '__proto__' && defineProperty) {
- defineProperty(object, key, {
- 'configurable': true,
- 'enumerable': true,
- 'value': value,
- 'writable': true
- });
- } else {
- object[key] = value;
- }
- }
-
- /**
- * The base implementation of `_.at` without support for individual paths.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {string[]} paths The property paths to pick.
- * @returns {Array} Returns the picked elements.
- */
- function baseAt(object, paths) {
- var index = -1,
- length = paths.length,
- result = Array(length),
- skip = object == null;
-
- while (++index < length) {
- result[index] = skip ? undefined : get(object, paths[index]);
- }
- return result;
- }
-
- /**
- * The base implementation of `_.clamp` which doesn't coerce arguments.
- *
- * @private
- * @param {number} number The number to clamp.
- * @param {number} [lower] The lower bound.
- * @param {number} upper The upper bound.
- * @returns {number} Returns the clamped number.
- */
- function baseClamp(number, lower, upper) {
- if (number === number) {
- if (upper !== undefined) {
- number = number <= upper ? number : upper;
- }
- if (lower !== undefined) {
- number = number >= lower ? number : lower;
- }
- }
- return number;
- }
-
- /**
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
- * traversed objects.
- *
- * @private
- * @param {*} value The value to clone.
- * @param {boolean} bitmask The bitmask flags.
- * 1 - Deep clone
- * 2 - Flatten inherited properties
- * 4 - Clone symbols
- * @param {Function} [customizer] The function to customize cloning.
- * @param {string} [key] The key of `value`.
- * @param {Object} [object] The parent object of `value`.
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
- * @returns {*} Returns the cloned value.
- */
- function baseClone(value, bitmask, customizer, key, object, stack) {
- var result,
- isDeep = bitmask & CLONE_DEEP_FLAG,
- isFlat = bitmask & CLONE_FLAT_FLAG,
- isFull = bitmask & CLONE_SYMBOLS_FLAG;
-
- if (customizer) {
- result = object ? customizer(value, key, object, stack) : customizer(value);
- }
- if (result !== undefined) {
- return result;
- }
- if (!isObject(value)) {
- return value;
- }
- var isArr = isArray(value);
- if (isArr) {
- result = initCloneArray(value);
- if (!isDeep) {
- return copyArray(value, result);
- }
- } else {
- var tag = getTag(value),
- isFunc = tag == funcTag || tag == genTag;
-
- if (isBuffer(value)) {
- return cloneBuffer(value, isDeep);
- }
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
- result = (isFlat || isFunc) ? {} : initCloneObject(value);
- if (!isDeep) {
- return isFlat
- ? copySymbolsIn(value, baseAssignIn(result, value))
- : copySymbols(value, baseAssign(result, value));
- }
- } else {
- if (!cloneableTags[tag]) {
- return object ? value : {};
- }
- result = initCloneByTag(value, tag, baseClone, isDeep);
- }
- }
- // Check for circular references and return its corresponding clone.
- stack || (stack = new Stack);
- var stacked = stack.get(value);
- if (stacked) {
- return stacked;
- }
- stack.set(value, result);
-
- var keysFunc = isFull
- ? (isFlat ? getAllKeysIn : getAllKeys)
- : (isFlat ? keysIn : keys);
-
- var props = isArr ? undefined : keysFunc(value);
- arrayEach(props || value, function(subValue, key) {
- if (props) {
- key = subValue;
- subValue = value[key];
- }
- // Recursively populate clone (susceptible to call stack limits).
- assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
- });
- return result;
- }
-
- /**
- * The base implementation of `_.conforms` which doesn't clone `source`.
- *
- * @private
- * @param {Object} source The object of property predicates to conform to.
- * @returns {Function} Returns the new spec function.
- */
- function baseConforms(source) {
- var props = keys(source);
- return function(object) {
- return baseConformsTo(object, source, props);
- };
- }
-
- /**
- * The base implementation of `_.conformsTo` which accepts `props` to check.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property predicates to conform to.
- * @returns {boolean} Returns `true` if `object` conforms, else `false`.
- */
- function baseConformsTo(object, source, props) {
- var length = props.length;
- if (object == null) {
- return !length;
- }
- object = Object(object);
- while (length--) {
- var key = props[length],
- predicate = source[key],
- value = object[key];
-
- if ((value === undefined && !(key in object)) || !predicate(value)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * The base implementation of `_.delay` and `_.defer` which accepts `args`
- * to provide to `func`.
- *
- * @private
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @param {Array} args The arguments to provide to `func`.
- * @returns {number|Object} Returns the timer id or timeout object.
- */
- function baseDelay(func, wait, args) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return setTimeout(function() { func.apply(undefined, args); }, wait);
- }
-
- /**
- * The base implementation of methods like `_.difference` without support
- * for excluding multiple arrays or iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Array} values The values to exclude.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- */
- function baseDifference(array, values, iteratee, comparator) {
- var index = -1,
- includes = arrayIncludes,
- isCommon = true,
- length = array.length,
- result = [],
- valuesLength = values.length;
-
- if (!length) {
- return result;
- }
- if (iteratee) {
- values = arrayMap(values, baseUnary(iteratee));
- }
- if (comparator) {
- includes = arrayIncludesWith;
- isCommon = false;
- }
- else if (values.length >= LARGE_ARRAY_SIZE) {
- includes = cacheHas;
- isCommon = false;
- values = new SetCache(values);
- }
- outer:
- while (++index < length) {
- var value = array[index],
- computed = iteratee == null ? value : iteratee(value);
-
- value = (comparator || value !== 0) ? value : 0;
- if (isCommon && computed === computed) {
- var valuesIndex = valuesLength;
- while (valuesIndex--) {
- if (values[valuesIndex] === computed) {
- continue outer;
- }
- }
- result.push(value);
- }
- else if (!includes(values, computed, comparator)) {
- result.push(value);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.forEach` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- */
- var baseEach = createBaseEach(baseForOwn);
-
- /**
- * The base implementation of `_.forEachRight` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- */
- var baseEachRight = createBaseEach(baseForOwnRight, true);
-
- /**
- * The base implementation of `_.every` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`
- */
- function baseEvery(collection, predicate) {
- var result = true;
- baseEach(collection, function(value, index, collection) {
- result = !!predicate(value, index, collection);
- return result;
- });
- return result;
- }
-
- /**
- * The base implementation of methods like `_.max` and `_.min` which accepts a
- * `comparator` to determine the extremum value.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The iteratee invoked per iteration.
- * @param {Function} comparator The comparator used to compare values.
- * @returns {*} Returns the extremum value.
- */
- function baseExtremum(array, iteratee, comparator) {
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- var value = array[index],
- current = iteratee(value);
-
- if (current != null && (computed === undefined
- ? (current === current && !isSymbol(current))
- : comparator(current, computed)
- )) {
- var computed = current,
- result = value;
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.fill` without an iteratee call guard.
- *
- * @private
- * @param {Array} array The array to fill.
- * @param {*} value The value to fill `array` with.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns `array`.
- */
- function baseFill(array, value, start, end) {
- var length = array.length;
-
- start = toInteger(start);
- if (start < 0) {
- start = -start > length ? 0 : (length + start);
- }
- end = (end === undefined || end > length) ? length : toInteger(end);
- if (end < 0) {
- end += length;
- }
- end = start > end ? 0 : toLength(end);
- while (start < end) {
- array[start++] = value;
- }
- return array;
- }
-
- /**
- * The base implementation of `_.filter` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function baseFilter(collection, predicate) {
- var result = [];
- baseEach(collection, function(value, index, collection) {
- if (predicate(value, index, collection)) {
- result.push(value);
- }
- });
- return result;
- }
-
- /**
- * The base implementation of `_.flatten` with support for restricting flattening.
- *
- * @private
- * @param {Array} array The array to flatten.
- * @param {number} depth The maximum recursion depth.
- * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
- * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
- * @param {Array} [result=[]] The initial result value.
- * @returns {Array} Returns the new flattened array.
- */
- function baseFlatten(array, depth, predicate, isStrict, result) {
- var index = -1,
- length = array.length;
-
- predicate || (predicate = isFlattenable);
- result || (result = []);
-
- while (++index < length) {
- var value = array[index];
- if (depth > 0 && predicate(value)) {
- if (depth > 1) {
- // Recursively flatten arrays (susceptible to call stack limits).
- baseFlatten(value, depth - 1, predicate, isStrict, result);
- } else {
- arrayPush(result, value);
- }
- } else if (!isStrict) {
- result[result.length] = value;
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `baseForOwn` which iterates over `object`
- * properties returned by `keysFunc` and invokes `iteratee` for each property.
- * Iteratee functions may exit iteration early by explicitly returning `false`.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @returns {Object} Returns `object`.
- */
- var baseFor = createBaseFor();
-
- /**
- * This function is like `baseFor` except that it iterates over properties
- * in the opposite order.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @returns {Object} Returns `object`.
- */
- var baseForRight = createBaseFor(true);
-
- /**
- * The base implementation of `_.forOwn` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function baseForOwn(object, iteratee) {
- return object && baseFor(object, iteratee, keys);
- }
-
- /**
- * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function baseForOwnRight(object, iteratee) {
- return object && baseForRight(object, iteratee, keys);
- }
-
- /**
- * The base implementation of `_.functions` which creates an array of
- * `object` function property names filtered from `props`.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Array} props The property names to filter.
- * @returns {Array} Returns the function names.
- */
- function baseFunctions(object, props) {
- return arrayFilter(props, function(key) {
- return isFunction(object[key]);
- });
- }
-
- /**
- * The base implementation of `_.get` without support for default values.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to get.
- * @returns {*} Returns the resolved value.
- */
- function baseGet(object, path) {
- path = castPath(path, object);
-
- var index = 0,
- length = path.length;
-
- while (object != null && index < length) {
- object = object[toKey(path[index++])];
- }
- return (index && index == length) ? object : undefined;
- }
-
- /**
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
- * symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
- var result = keysFunc(object);
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
- }
-
- /**
- * The base implementation of `getTag` without fallbacks for buggy environments.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
- function baseGetTag(value) {
- if (value == null) {
- return value === undefined ? undefinedTag : nullTag;
- }
- return (symToStringTag && symToStringTag in Object(value))
- ? getRawTag(value)
- : objectToString(value);
- }
-
- /**
- * The base implementation of `_.gt` which doesn't coerce arguments.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than `other`,
- * else `false`.
- */
- function baseGt(value, other) {
- return value > other;
- }
-
- /**
- * The base implementation of `_.has` without support for deep paths.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {Array|string} key The key to check.
- * @returns {boolean} Returns `true` if `key` exists, else `false`.
- */
- function baseHas(object, key) {
- return object != null && hasOwnProperty.call(object, key);
- }
-
- /**
- * The base implementation of `_.hasIn` without support for deep paths.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {Array|string} key The key to check.
- * @returns {boolean} Returns `true` if `key` exists, else `false`.
- */
- function baseHasIn(object, key) {
- return object != null && key in Object(object);
- }
-
- /**
- * The base implementation of `_.inRange` which doesn't coerce arguments.
- *
- * @private
- * @param {number} number The number to check.
- * @param {number} start The start of the range.
- * @param {number} end The end of the range.
- * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
- */
- function baseInRange(number, start, end) {
- return number >= nativeMin(start, end) && number < nativeMax(start, end);
- }
-
- /**
- * The base implementation of methods like `_.intersection`, without support
- * for iteratee shorthands, that accepts an array of arrays to inspect.
- *
- * @private
- * @param {Array} arrays The arrays to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of shared values.
- */
- function baseIntersection(arrays, iteratee, comparator) {
- var includes = comparator ? arrayIncludesWith : arrayIncludes,
- length = arrays[0].length,
- othLength = arrays.length,
- othIndex = othLength,
- caches = Array(othLength),
- maxLength = Infinity,
- result = [];
-
- while (othIndex--) {
- var array = arrays[othIndex];
- if (othIndex && iteratee) {
- array = arrayMap(array, baseUnary(iteratee));
- }
- maxLength = nativeMin(array.length, maxLength);
- caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
- ? new SetCache(othIndex && array)
- : undefined;
- }
- array = arrays[0];
-
- var index = -1,
- seen = caches[0];
-
- outer:
- while (++index < length && result.length < maxLength) {
- var value = array[index],
- computed = iteratee ? iteratee(value) : value;
-
- value = (comparator || value !== 0) ? value : 0;
- if (!(seen
- ? cacheHas(seen, computed)
- : includes(result, computed, comparator)
- )) {
- othIndex = othLength;
- while (--othIndex) {
- var cache = caches[othIndex];
- if (!(cache
- ? cacheHas(cache, computed)
- : includes(arrays[othIndex], computed, comparator))
- ) {
- continue outer;
- }
- }
- if (seen) {
- seen.push(computed);
- }
- result.push(value);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.invert` and `_.invertBy` which inverts
- * `object` with values transformed by `iteratee` and set by `setter`.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} setter The function to set `accumulator` values.
- * @param {Function} iteratee The iteratee to transform values.
- * @param {Object} accumulator The initial inverted object.
- * @returns {Function} Returns `accumulator`.
- */
- function baseInverter(object, setter, iteratee, accumulator) {
- baseForOwn(object, function(value, key, object) {
- setter(accumulator, iteratee(value), key, object);
- });
- return accumulator;
- }
-
- /**
- * The base implementation of `_.invoke` without support for individual
- * method arguments.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the method to invoke.
- * @param {Array} args The arguments to invoke the method with.
- * @returns {*} Returns the result of the invoked method.
- */
- function baseInvoke(object, path, args) {
- path = castPath(path, object);
- object = parent(object, path);
- var func = object == null ? object : object[toKey(last(path))];
- return func == null ? undefined : apply(func, object, args);
- }
-
- /**
- * The base implementation of `_.isArguments`.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- */
- function baseIsArguments(value) {
- return isObjectLike(value) && baseGetTag(value) == argsTag;
- }
-
- /**
- * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
- */
- function baseIsArrayBuffer(value) {
- return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
- }
-
- /**
- * The base implementation of `_.isDate` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
- */
- function baseIsDate(value) {
- return isObjectLike(value) && baseGetTag(value) == dateTag;
- }
-
- /**
- * The base implementation of `_.isEqual` which supports partial comparisons
- * and tracks traversed objects.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {boolean} bitmask The bitmask flags.
- * 1 - Unordered comparison
- * 2 - Partial comparison
- * @param {Function} [customizer] The function to customize comparisons.
- * @param {Object} [stack] Tracks traversed `value` and `other` objects.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- */
- function baseIsEqual(value, other, bitmask, customizer, stack) {
- if (value === other) {
- return true;
- }
- if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
- return value !== value && other !== other;
- }
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
- }
-
- /**
- * A specialized version of `baseIsEqual` for arrays and objects which performs
- * deep comparisons and tracks traversed objects enabling objects with circular
- * references to be compared.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} [stack] Tracks traversed `object` and `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
- var objIsArr = isArray(object),
- othIsArr = isArray(other),
- objTag = objIsArr ? arrayTag : getTag(object),
- othTag = othIsArr ? arrayTag : getTag(other);
-
- objTag = objTag == argsTag ? objectTag : objTag;
- othTag = othTag == argsTag ? objectTag : othTag;
-
- var objIsObj = objTag == objectTag,
- othIsObj = othTag == objectTag,
- isSameTag = objTag == othTag;
-
- if (isSameTag && isBuffer(object)) {
- if (!isBuffer(other)) {
- return false;
- }
- objIsArr = true;
- objIsObj = false;
- }
- if (isSameTag && !objIsObj) {
- stack || (stack = new Stack);
- return (objIsArr || isTypedArray(object))
- ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
- : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
- }
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
- othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
-
- if (objIsWrapped || othIsWrapped) {
- var objUnwrapped = objIsWrapped ? object.value() : object,
- othUnwrapped = othIsWrapped ? other.value() : other;
-
- stack || (stack = new Stack);
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
- }
- }
- if (!isSameTag) {
- return false;
- }
- stack || (stack = new Stack);
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
- }
-
- /**
- * The base implementation of `_.isMap` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
- */
- function baseIsMap(value) {
- return isObjectLike(value) && getTag(value) == mapTag;
- }
-
- /**
- * The base implementation of `_.isMatch` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property values to match.
- * @param {Array} matchData The property names, values, and compare flags to match.
- * @param {Function} [customizer] The function to customize comparisons.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- */
- function baseIsMatch(object, source, matchData, customizer) {
- var index = matchData.length,
- length = index,
- noCustomizer = !customizer;
-
- if (object == null) {
- return !length;
- }
- object = Object(object);
- while (index--) {
- var data = matchData[index];
- if ((noCustomizer && data[2])
- ? data[1] !== object[data[0]]
- : !(data[0] in object)
- ) {
- return false;
- }
- }
- while (++index < length) {
- data = matchData[index];
- var key = data[0],
- objValue = object[key],
- srcValue = data[1];
-
- if (noCustomizer && data[2]) {
- if (objValue === undefined && !(key in object)) {
- return false;
- }
- } else {
- var stack = new Stack;
- if (customizer) {
- var result = customizer(objValue, srcValue, key, object, source, stack);
- }
- if (!(result === undefined
- ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
- : result
- )) {
- return false;
- }
- }
- }
- return true;
- }
-
- /**
- * The base implementation of `_.isNative` without bad shim checks.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function,
- * else `false`.
- */
- function baseIsNative(value) {
- if (!isObject(value) || isMasked(value)) {
- return false;
- }
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
- return pattern.test(toSource(value));
- }
-
- /**
- * The base implementation of `_.isRegExp` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
- */
- function baseIsRegExp(value) {
- return isObjectLike(value) && baseGetTag(value) == regexpTag;
- }
-
- /**
- * The base implementation of `_.isSet` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
- */
- function baseIsSet(value) {
- return isObjectLike(value) && getTag(value) == setTag;
- }
-
- /**
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
- */
- function baseIsTypedArray(value) {
- return isObjectLike(value) &&
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
- }
-
- /**
- * The base implementation of `_.iteratee`.
- *
- * @private
- * @param {*} [value=_.identity] The value to convert to an iteratee.
- * @returns {Function} Returns the iteratee.
- */
- function baseIteratee(value) {
- // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
- // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
- if (typeof value == 'function') {
- return value;
- }
- if (value == null) {
- return identity;
- }
- if (typeof value == 'object') {
- return isArray(value)
- ? baseMatchesProperty(value[0], value[1])
- : baseMatches(value);
- }
- return property(value);
- }
-
- /**
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function baseKeys(object) {
- if (!isPrototype(object)) {
- return nativeKeys(object);
- }
- var result = [];
- for (var key in Object(object)) {
- if (hasOwnProperty.call(object, key) && key != 'constructor') {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function baseKeysIn(object) {
- if (!isObject(object)) {
- return nativeKeysIn(object);
- }
- var isProto = isPrototype(object),
- result = [];
-
- for (var key in object) {
- if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.lt` which doesn't coerce arguments.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than `other`,
- * else `false`.
- */
- function baseLt(value, other) {
- return value < other;
- }
-
- /**
- * The base implementation of `_.map` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- */
- function baseMap(collection, iteratee) {
- var index = -1,
- result = isArrayLike(collection) ? Array(collection.length) : [];
-
- baseEach(collection, function(value, key, collection) {
- result[++index] = iteratee(value, key, collection);
- });
- return result;
- }
-
- /**
- * The base implementation of `_.matches` which doesn't clone `source`.
- *
- * @private
- * @param {Object} source The object of property values to match.
- * @returns {Function} Returns the new spec function.
- */
- function baseMatches(source) {
- var matchData = getMatchData(source);
- if (matchData.length == 1 && matchData[0][2]) {
- return matchesStrictComparable(matchData[0][0], matchData[0][1]);
- }
- return function(object) {
- return object === source || baseIsMatch(object, source, matchData);
- };
- }
-
- /**
- * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
- *
- * @private
- * @param {string} path The path of the property to get.
- * @param {*} srcValue The value to match.
- * @returns {Function} Returns the new spec function.
- */
- function baseMatchesProperty(path, srcValue) {
- if (isKey(path) && isStrictComparable(srcValue)) {
- return matchesStrictComparable(toKey(path), srcValue);
- }
- return function(object) {
- var objValue = get(object, path);
- return (objValue === undefined && objValue === srcValue)
- ? hasIn(object, path)
- : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
- };
- }
-
- /**
- * The base implementation of `_.merge` without support for multiple sources.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {number} srcIndex The index of `source`.
- * @param {Function} [customizer] The function to customize merged values.
- * @param {Object} [stack] Tracks traversed source values and their merged
- * counterparts.
- */
- function baseMerge(object, source, srcIndex, customizer, stack) {
- if (object === source) {
- return;
- }
- baseFor(source, function(srcValue, key) {
- if (isObject(srcValue)) {
- stack || (stack = new Stack);
- baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
- }
- else {
- var newValue = customizer
- ? customizer(object[key], srcValue, (key + ''), object, source, stack)
- : undefined;
-
- if (newValue === undefined) {
- newValue = srcValue;
- }
- assignMergeValue(object, key, newValue);
- }
- }, keysIn);
- }
-
- /**
- * A specialized version of `baseMerge` for arrays and objects which performs
- * deep merges and tracks traversed objects enabling objects with circular
- * references to be merged.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {string} key The key of the value to merge.
- * @param {number} srcIndex The index of `source`.
- * @param {Function} mergeFunc The function to merge values.
- * @param {Function} [customizer] The function to customize assigned values.
- * @param {Object} [stack] Tracks traversed source values and their merged
- * counterparts.
- */
- function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
- var objValue = object[key],
- srcValue = source[key],
- stacked = stack.get(srcValue);
-
- if (stacked) {
- assignMergeValue(object, key, stacked);
- return;
- }
- var newValue = customizer
- ? customizer(objValue, srcValue, (key + ''), object, source, stack)
- : undefined;
-
- var isCommon = newValue === undefined;
-
- if (isCommon) {
- var isArr = isArray(srcValue),
- isBuff = !isArr && isBuffer(srcValue),
- isTyped = !isArr && !isBuff && isTypedArray(srcValue);
-
- newValue = srcValue;
- if (isArr || isBuff || isTyped) {
- if (isArray(objValue)) {
- newValue = objValue;
- }
- else if (isArrayLikeObject(objValue)) {
- newValue = copyArray(objValue);
- }
- else if (isBuff) {
- isCommon = false;
- newValue = cloneBuffer(srcValue, true);
- }
- else if (isTyped) {
- isCommon = false;
- newValue = cloneTypedArray(srcValue, true);
- }
- else {
- newValue = [];
- }
- }
- else if (isPlainObject(srcValue) || isArguments(srcValue)) {
- newValue = objValue;
- if (isArguments(objValue)) {
- newValue = toPlainObject(objValue);
- }
- else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
- newValue = initCloneObject(srcValue);
- }
- }
- else {
- isCommon = false;
- }
- }
- if (isCommon) {
- // Recursively merge objects and arrays (susceptible to call stack limits).
- stack.set(srcValue, newValue);
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
- stack['delete'](srcValue);
- }
- assignMergeValue(object, key, newValue);
- }
-
- /**
- * The base implementation of `_.nth` which doesn't coerce arguments.
- *
- * @private
- * @param {Array} array The array to query.
- * @param {number} n The index of the element to return.
- * @returns {*} Returns the nth element of `array`.
- */
- function baseNth(array, n) {
- var length = array.length;
- if (!length) {
- return;
- }
- n += n < 0 ? length : 0;
- return isIndex(n, length) ? array[n] : undefined;
- }
-
- /**
- * The base implementation of `_.orderBy` without param guards.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
- * @param {string[]} orders The sort orders of `iteratees`.
- * @returns {Array} Returns the new sorted array.
- */
- function baseOrderBy(collection, iteratees, orders) {
- var index = -1;
- iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
-
- var result = baseMap(collection, function(value, key, collection) {
- var criteria = arrayMap(iteratees, function(iteratee) {
- return iteratee(value);
- });
- return { 'criteria': criteria, 'index': ++index, 'value': value };
- });
-
- return baseSortBy(result, function(object, other) {
- return compareMultiple(object, other, orders);
- });
- }
-
- /**
- * The base implementation of `_.pick` without support for individual
- * property identifiers.
- *
- * @private
- * @param {Object} object The source object.
- * @param {string[]} paths The property paths to pick.
- * @returns {Object} Returns the new object.
- */
- function basePick(object, paths) {
- return basePickBy(object, paths, function(value, path) {
- return hasIn(object, path);
- });
- }
-
- /**
- * The base implementation of `_.pickBy` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The source object.
- * @param {string[]} paths The property paths to pick.
- * @param {Function} predicate The function invoked per property.
- * @returns {Object} Returns the new object.
- */
- function basePickBy(object, paths, predicate) {
- var index = -1,
- length = paths.length,
- result = {};
-
- while (++index < length) {
- var path = paths[index],
- value = baseGet(object, path);
-
- if (predicate(value, path)) {
- baseSet(result, castPath(path, object), value);
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `baseProperty` which supports deep paths.
- *
- * @private
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new accessor function.
- */
- function basePropertyDeep(path) {
- return function(object) {
- return baseGet(object, path);
- };
- }
-
- /**
- * The base implementation of `_.pullAllBy` without support for iteratee
- * shorthands.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns `array`.
- */
- function basePullAll(array, values, iteratee, comparator) {
- var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
- index = -1,
- length = values.length,
- seen = array;
-
- if (array === values) {
- values = copyArray(values);
- }
- if (iteratee) {
- seen = arrayMap(array, baseUnary(iteratee));
- }
- while (++index < length) {
- var fromIndex = 0,
- value = values[index],
- computed = iteratee ? iteratee(value) : value;
-
- while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
- if (seen !== array) {
- splice.call(seen, fromIndex, 1);
- }
- splice.call(array, fromIndex, 1);
- }
- }
- return array;
- }
-
- /**
- * The base implementation of `_.pullAt` without support for individual
- * indexes or capturing the removed elements.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {number[]} indexes The indexes of elements to remove.
- * @returns {Array} Returns `array`.
- */
- function basePullAt(array, indexes) {
- var length = array ? indexes.length : 0,
- lastIndex = length - 1;
-
- while (length--) {
- var index = indexes[length];
- if (length == lastIndex || index !== previous) {
- var previous = index;
- if (isIndex(index)) {
- splice.call(array, index, 1);
- } else {
- baseUnset(array, index);
- }
- }
- }
- return array;
- }
-
- /**
- * The base implementation of `_.random` without support for returning
- * floating-point numbers.
- *
- * @private
- * @param {number} lower The lower bound.
- * @param {number} upper The upper bound.
- * @returns {number} Returns the random number.
- */
- function baseRandom(lower, upper) {
- return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
- }
-
- /**
- * The base implementation of `_.range` and `_.rangeRight` which doesn't
- * coerce arguments.
- *
- * @private
- * @param {number} start The start of the range.
- * @param {number} end The end of the range.
- * @param {number} step The value to increment or decrement by.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Array} Returns the range of numbers.
- */
- function baseRange(start, end, step, fromRight) {
- var index = -1,
- length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
- result = Array(length);
-
- while (length--) {
- result[fromRight ? length : ++index] = start;
- start += step;
- }
- return result;
- }
-
- /**
- * The base implementation of `_.repeat` which doesn't coerce arguments.
- *
- * @private
- * @param {string} string The string to repeat.
- * @param {number} n The number of times to repeat the string.
- * @returns {string} Returns the repeated string.
- */
- function baseRepeat(string, n) {
- var result = '';
- if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
- return result;
- }
- // Leverage the exponentiation by squaring algorithm for a faster repeat.
- // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
- do {
- if (n % 2) {
- result += string;
- }
- n = nativeFloor(n / 2);
- if (n) {
- string += string;
- }
- } while (n);
-
- return result;
- }
-
- /**
- * The base implementation of `_.rest` which doesn't validate or coerce arguments.
- *
- * @private
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @returns {Function} Returns the new function.
- */
- function baseRest(func, start) {
- return setToString(overRest(func, start, identity), func + '');
- }
-
- /**
- * The base implementation of `_.sample`.
- *
- * @private
- * @param {Array|Object} collection The collection to sample.
- * @returns {*} Returns the random element.
- */
- function baseSample(collection) {
- return arraySample(values(collection));
- }
-
- /**
- * The base implementation of `_.sampleSize` without param guards.
- *
- * @private
- * @param {Array|Object} collection The collection to sample.
- * @param {number} n The number of elements to sample.
- * @returns {Array} Returns the random elements.
- */
- function baseSampleSize(collection, n) {
- var array = values(collection);
- return shuffleSelf(array, baseClamp(n, 0, array.length));
- }
-
- /**
- * The base implementation of `_.set`.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {*} value The value to set.
- * @param {Function} [customizer] The function to customize path creation.
- * @returns {Object} Returns `object`.
- */
- function baseSet(object, path, value, customizer) {
- if (!isObject(object)) {
- return object;
- }
- path = castPath(path, object);
-
- var index = -1,
- length = path.length,
- lastIndex = length - 1,
- nested = object;
-
- while (nested != null && ++index < length) {
- var key = toKey(path[index]),
- newValue = value;
-
- if (index != lastIndex) {
- var objValue = nested[key];
- newValue = customizer ? customizer(objValue, key, nested) : undefined;
- if (newValue === undefined) {
- newValue = isObject(objValue)
- ? objValue
- : (isIndex(path[index + 1]) ? [] : {});
- }
- }
- assignValue(nested, key, newValue);
- nested = nested[key];
- }
- return object;
- }
-
- /**
- * The base implementation of `setData` without support for hot loop shorting.
- *
- * @private
- * @param {Function} func The function to associate metadata with.
- * @param {*} data The metadata.
- * @returns {Function} Returns `func`.
- */
- var baseSetData = !metaMap ? identity : function(func, data) {
- metaMap.set(func, data);
- return func;
- };
-
- /**
- * The base implementation of `setToString` without support for hot loop shorting.
- *
- * @private
- * @param {Function} func The function to modify.
- * @param {Function} string The `toString` result.
- * @returns {Function} Returns `func`.
- */
- var baseSetToString = !defineProperty ? identity : function(func, string) {
- return defineProperty(func, 'toString', {
- 'configurable': true,
- 'enumerable': false,
- 'value': constant(string),
- 'writable': true
- });
- };
-
- /**
- * The base implementation of `_.shuffle`.
- *
- * @private
- * @param {Array|Object} collection The collection to shuffle.
- * @returns {Array} Returns the new shuffled array.
- */
- function baseShuffle(collection) {
- return shuffleSelf(values(collection));
- }
-
- /**
- * The base implementation of `_.slice` without an iteratee call guard.
- *
- * @private
- * @param {Array} array The array to slice.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns the slice of `array`.
- */
- function baseSlice(array, start, end) {
- var index = -1,
- length = array.length;
-
- if (start < 0) {
- start = -start > length ? 0 : (length + start);
- }
- end = end > length ? length : end;
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : ((end - start) >>> 0);
- start >>>= 0;
-
- var result = Array(length);
- while (++index < length) {
- result[index] = array[index + start];
- }
- return result;
- }
-
- /**
- * The base implementation of `_.some` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- */
- function baseSome(collection, predicate) {
- var result;
-
- baseEach(collection, function(value, index, collection) {
- result = predicate(value, index, collection);
- return !result;
- });
- return !!result;
- }
-
- /**
- * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
- * performs a binary search of `array` to determine the index at which `value`
- * should be inserted into `array` in order to maintain its sort order.
- *
- * @private
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {boolean} [retHighest] Specify returning the highest qualified index.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- */
- function baseSortedIndex(array, value, retHighest) {
- var low = 0,
- high = array == null ? low : array.length;
-
- if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
- while (low < high) {
- var mid = (low + high) >>> 1,
- computed = array[mid];
-
- if (computed !== null && !isSymbol(computed) &&
- (retHighest ? (computed <= value) : (computed < value))) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return high;
- }
- return baseSortedIndexBy(array, value, identity, retHighest);
- }
-
- /**
- * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
- * which invokes `iteratee` for `value` and each element of `array` to compute
- * their sort ranking. The iteratee is invoked with one argument; (value).
- *
- * @private
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function} iteratee The iteratee invoked per element.
- * @param {boolean} [retHighest] Specify returning the highest qualified index.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- */
- function baseSortedIndexBy(array, value, iteratee, retHighest) {
- value = iteratee(value);
-
- var low = 0,
- high = array == null ? 0 : array.length,
- valIsNaN = value !== value,
- valIsNull = value === null,
- valIsSymbol = isSymbol(value),
- valIsUndefined = value === undefined;
-
- while (low < high) {
- var mid = nativeFloor((low + high) / 2),
- computed = iteratee(array[mid]),
- othIsDefined = computed !== undefined,
- othIsNull = computed === null,
- othIsReflexive = computed === computed,
- othIsSymbol = isSymbol(computed);
-
- if (valIsNaN) {
- var setLow = retHighest || othIsReflexive;
- } else if (valIsUndefined) {
- setLow = othIsReflexive && (retHighest || othIsDefined);
- } else if (valIsNull) {
- setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
- } else if (valIsSymbol) {
- setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
- } else if (othIsNull || othIsSymbol) {
- setLow = false;
- } else {
- setLow = retHighest ? (computed <= value) : (computed < value);
- }
- if (setLow) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return nativeMin(high, MAX_ARRAY_INDEX);
- }
-
- /**
- * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
- * support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- */
- function baseSortedUniq(array, iteratee) {
- var index = -1,
- length = array.length,
- resIndex = 0,
- result = [];
-
- while (++index < length) {
- var value = array[index],
- computed = iteratee ? iteratee(value) : value;
-
- if (!index || !eq(computed, seen)) {
- var seen = computed;
- result[resIndex++] = value === 0 ? 0 : value;
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.toNumber` which doesn't ensure correct
- * conversions of binary, hexadecimal, or octal string values.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {number} Returns the number.
- */
- function baseToNumber(value) {
- if (typeof value == 'number') {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- return +value;
- }
-
- /**
- * The base implementation of `_.toString` which doesn't convert nullish
- * values to empty strings.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {string} Returns the string.
- */
- function baseToString(value) {
- // Exit early for strings to avoid a performance hit in some environments.
- if (typeof value == 'string') {
- return value;
- }
- if (isArray(value)) {
- // Recursively convert values (susceptible to call stack limits).
- return arrayMap(value, baseToString) + '';
- }
- if (isSymbol(value)) {
- return symbolToString ? symbolToString.call(value) : '';
- }
- var result = (value + '');
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
- }
-
- /**
- * The base implementation of `_.uniqBy` without support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- */
- function baseUniq(array, iteratee, comparator) {
- var index = -1,
- includes = arrayIncludes,
- length = array.length,
- isCommon = true,
- result = [],
- seen = result;
-
- if (comparator) {
- isCommon = false;
- includes = arrayIncludesWith;
- }
- else if (length >= LARGE_ARRAY_SIZE) {
- var set = iteratee ? null : createSet(array);
- if (set) {
- return setToArray(set);
- }
- isCommon = false;
- includes = cacheHas;
- seen = new SetCache;
- }
- else {
- seen = iteratee ? [] : result;
- }
- outer:
- while (++index < length) {
- var value = array[index],
- computed = iteratee ? iteratee(value) : value;
-
- value = (comparator || value !== 0) ? value : 0;
- if (isCommon && computed === computed) {
- var seenIndex = seen.length;
- while (seenIndex--) {
- if (seen[seenIndex] === computed) {
- continue outer;
- }
- }
- if (iteratee) {
- seen.push(computed);
- }
- result.push(value);
- }
- else if (!includes(seen, computed, comparator)) {
- if (seen !== result) {
- seen.push(computed);
- }
- result.push(value);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.unset`.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {Array|string} path The property path to unset.
- * @returns {boolean} Returns `true` if the property is deleted, else `false`.
- */
- function baseUnset(object, path) {
- path = castPath(path, object);
- object = parent(object, path);
- return object == null || delete object[toKey(last(path))];
- }
-
- /**
- * The base implementation of `_.update`.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to update.
- * @param {Function} updater The function to produce the updated value.
- * @param {Function} [customizer] The function to customize path creation.
- * @returns {Object} Returns `object`.
- */
- function baseUpdate(object, path, updater, customizer) {
- return baseSet(object, path, updater(baseGet(object, path)), customizer);
- }
-
- /**
- * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
- * without support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to query.
- * @param {Function} predicate The function invoked per iteration.
- * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Array} Returns the slice of `array`.
- */
- function baseWhile(array, predicate, isDrop, fromRight) {
- var length = array.length,
- index = fromRight ? length : -1;
-
- while ((fromRight ? index-- : ++index < length) &&
- predicate(array[index], index, array)) {}
-
- return isDrop
- ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
- : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
- }
-
- /**
- * The base implementation of `wrapperValue` which returns the result of
- * performing a sequence of actions on the unwrapped `value`, where each
- * successive action is supplied the return value of the previous.
- *
- * @private
- * @param {*} value The unwrapped value.
- * @param {Array} actions Actions to perform to resolve the unwrapped value.
- * @returns {*} Returns the resolved value.
- */
- function baseWrapperValue(value, actions) {
- var result = value;
- if (result instanceof LazyWrapper) {
- result = result.value();
- }
- return arrayReduce(actions, function(result, action) {
- return action.func.apply(action.thisArg, arrayPush([result], action.args));
- }, result);
- }
-
- /**
- * The base implementation of methods like `_.xor`, without support for
- * iteratee shorthands, that accepts an array of arrays to inspect.
- *
- * @private
- * @param {Array} arrays The arrays to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of values.
- */
- function baseXor(arrays, iteratee, comparator) {
- var length = arrays.length;
- if (length < 2) {
- return length ? baseUniq(arrays[0]) : [];
- }
- var index = -1,
- result = Array(length);
-
- while (++index < length) {
- var array = arrays[index],
- othIndex = -1;
-
- while (++othIndex < length) {
- if (othIndex != index) {
- result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
- }
- }
- }
- return baseUniq(baseFlatten(result, 1), iteratee, comparator);
- }
-
- /**
- * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
- *
- * @private
- * @param {Array} props The property identifiers.
- * @param {Array} values The property values.
- * @param {Function} assignFunc The function to assign values.
- * @returns {Object} Returns the new object.
- */
- function baseZipObject(props, values, assignFunc) {
- var index = -1,
- length = props.length,
- valsLength = values.length,
- result = {};
-
- while (++index < length) {
- var value = index < valsLength ? values[index] : undefined;
- assignFunc(result, props[index], value);
- }
- return result;
- }
-
- /**
- * Casts `value` to an empty array if it's not an array like object.
- *
- * @private
- * @param {*} value The value to inspect.
- * @returns {Array|Object} Returns the cast array-like object.
- */
- function castArrayLikeObject(value) {
- return isArrayLikeObject(value) ? value : [];
- }
-
- /**
- * Casts `value` to `identity` if it's not a function.
- *
- * @private
- * @param {*} value The value to inspect.
- * @returns {Function} Returns cast function.
- */
- function castFunction(value) {
- return typeof value == 'function' ? value : identity;
- }
-
- /**
- * Casts `value` to a path array if it's not one.
- *
- * @private
- * @param {*} value The value to inspect.
- * @param {Object} [object] The object to query keys on.
- * @returns {Array} Returns the cast property path array.
- */
- function castPath(value, object) {
- if (isArray(value)) {
- return value;
- }
- return isKey(value, object) ? [value] : stringToPath(toString(value));
- }
-
- /**
- * A `baseRest` alias which can be replaced with `identity` by module
- * replacement plugins.
- *
- * @private
- * @type {Function}
- * @param {Function} func The function to apply a rest parameter to.
- * @returns {Function} Returns the new function.
- */
- var castRest = baseRest;
-
- /**
- * Casts `array` to a slice if it's needed.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {number} start The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns the cast slice.
- */
- function castSlice(array, start, end) {
- var length = array.length;
- end = end === undefined ? length : end;
- return (!start && end >= length) ? array : baseSlice(array, start, end);
- }
-
- /**
- * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
- *
- * @private
- * @param {number|Object} id The timer id or timeout object of the timer to clear.
- */
- var clearTimeout = ctxClearTimeout || function(id) {
- return root.clearTimeout(id);
- };
-
- /**
- * Creates a clone of `buffer`.
- *
- * @private
- * @param {Buffer} buffer The buffer to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Buffer} Returns the cloned buffer.
- */
- function cloneBuffer(buffer, isDeep) {
- if (isDeep) {
- return buffer.slice();
- }
- var length = buffer.length,
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
-
- buffer.copy(result);
- return result;
- }
-
- /**
- * Creates a clone of `arrayBuffer`.
- *
- * @private
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
- * @returns {ArrayBuffer} Returns the cloned array buffer.
- */
- function cloneArrayBuffer(arrayBuffer) {
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
- return result;
- }
-
- /**
- * Creates a clone of `dataView`.
- *
- * @private
- * @param {Object} dataView The data view to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned data view.
- */
- function cloneDataView(dataView, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
- }
-
- /**
- * Creates a clone of `map`.
- *
- * @private
- * @param {Object} map The map to clone.
- * @param {Function} cloneFunc The function to clone values.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned map.
- */
- function cloneMap(map, isDeep, cloneFunc) {
- var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);
- return arrayReduce(array, addMapEntry, new map.constructor);
- }
-
- /**
- * Creates a clone of `regexp`.
- *
- * @private
- * @param {Object} regexp The regexp to clone.
- * @returns {Object} Returns the cloned regexp.
- */
- function cloneRegExp(regexp) {
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
- result.lastIndex = regexp.lastIndex;
- return result;
- }
-
- /**
- * Creates a clone of `set`.
- *
- * @private
- * @param {Object} set The set to clone.
- * @param {Function} cloneFunc The function to clone values.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned set.
- */
- function cloneSet(set, isDeep, cloneFunc) {
- var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);
- return arrayReduce(array, addSetEntry, new set.constructor);
- }
-
- /**
- * Creates a clone of the `symbol` object.
- *
- * @private
- * @param {Object} symbol The symbol object to clone.
- * @returns {Object} Returns the cloned symbol object.
- */
- function cloneSymbol(symbol) {
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
- }
-
- /**
- * Creates a clone of `typedArray`.
- *
- * @private
- * @param {Object} typedArray The typed array to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned typed array.
- */
- function cloneTypedArray(typedArray, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
- }
-
- /**
- * Compares values to sort them in ascending order.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {number} Returns the sort order indicator for `value`.
- */
- function compareAscending(value, other) {
- if (value !== other) {
- var valIsDefined = value !== undefined,
- valIsNull = value === null,
- valIsReflexive = value === value,
- valIsSymbol = isSymbol(value);
-
- var othIsDefined = other !== undefined,
- othIsNull = other === null,
- othIsReflexive = other === other,
- othIsSymbol = isSymbol(other);
-
- if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
- (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
- (valIsNull && othIsDefined && othIsReflexive) ||
- (!valIsDefined && othIsReflexive) ||
- !valIsReflexive) {
- return 1;
- }
- if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
- (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
- (othIsNull && valIsDefined && valIsReflexive) ||
- (!othIsDefined && valIsReflexive) ||
- !othIsReflexive) {
- return -1;
- }
- }
- return 0;
- }
-
- /**
- * Used by `_.orderBy` to compare multiple properties of a value to another
- * and stable sort them.
- *
- * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
- * specify an order of "desc" for descending or "asc" for ascending sort order
- * of corresponding values.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {boolean[]|string[]} orders The order to sort by for each property.
- * @returns {number} Returns the sort order indicator for `object`.
- */
- function compareMultiple(object, other, orders) {
- var index = -1,
- objCriteria = object.criteria,
- othCriteria = other.criteria,
- length = objCriteria.length,
- ordersLength = orders.length;
-
- while (++index < length) {
- var result = compareAscending(objCriteria[index], othCriteria[index]);
- if (result) {
- if (index >= ordersLength) {
- return result;
- }
- var order = orders[index];
- return result * (order == 'desc' ? -1 : 1);
- }
- }
- // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
- // that causes it, under certain circumstances, to provide the same value for
- // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
- // for more details.
- //
- // This also ensures a stable sort in V8 and other engines.
- // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
- return object.index - other.index;
- }
-
- /**
- * Creates an array that is the composition of partially applied arguments,
- * placeholders, and provided arguments into a single array of arguments.
- *
- * @private
- * @param {Array} args The provided arguments.
- * @param {Array} partials The arguments to prepend to those provided.
- * @param {Array} holders The `partials` placeholder indexes.
- * @params {boolean} [isCurried] Specify composing for a curried function.
- * @returns {Array} Returns the new array of composed arguments.
- */
- function composeArgs(args, partials, holders, isCurried) {
- var argsIndex = -1,
- argsLength = args.length,
- holdersLength = holders.length,
- leftIndex = -1,
- leftLength = partials.length,
- rangeLength = nativeMax(argsLength - holdersLength, 0),
- result = Array(leftLength + rangeLength),
- isUncurried = !isCurried;
-
- while (++leftIndex < leftLength) {
- result[leftIndex] = partials[leftIndex];
- }
- while (++argsIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result[holders[argsIndex]] = args[argsIndex];
- }
- }
- while (rangeLength--) {
- result[leftIndex++] = args[argsIndex++];
- }
- return result;
- }
-
- /**
- * This function is like `composeArgs` except that the arguments composition
- * is tailored for `_.partialRight`.
- *
- * @private
- * @param {Array} args The provided arguments.
- * @param {Array} partials The arguments to append to those provided.
- * @param {Array} holders The `partials` placeholder indexes.
- * @params {boolean} [isCurried] Specify composing for a curried function.
- * @returns {Array} Returns the new array of composed arguments.
- */
- function composeArgsRight(args, partials, holders, isCurried) {
- var argsIndex = -1,
- argsLength = args.length,
- holdersIndex = -1,
- holdersLength = holders.length,
- rightIndex = -1,
- rightLength = partials.length,
- rangeLength = nativeMax(argsLength - holdersLength, 0),
- result = Array(rangeLength + rightLength),
- isUncurried = !isCurried;
-
- while (++argsIndex < rangeLength) {
- result[argsIndex] = args[argsIndex];
- }
- var offset = argsIndex;
- while (++rightIndex < rightLength) {
- result[offset + rightIndex] = partials[rightIndex];
- }
- while (++holdersIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result[offset + holders[holdersIndex]] = args[argsIndex++];
- }
- }
- return result;
- }
-
- /**
- * Copies the values of `source` to `array`.
- *
- * @private
- * @param {Array} source The array to copy values from.
- * @param {Array} [array=[]] The array to copy values to.
- * @returns {Array} Returns `array`.
- */
- function copyArray(source, array) {
- var index = -1,
- length = source.length;
-
- array || (array = Array(length));
- while (++index < length) {
- array[index] = source[index];
- }
- return array;
- }
-
- /**
- * Copies properties of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy properties from.
- * @param {Array} props The property identifiers to copy.
- * @param {Object} [object={}] The object to copy properties to.
- * @param {Function} [customizer] The function to customize copied values.
- * @returns {Object} Returns `object`.
- */
- function copyObject(source, props, object, customizer) {
- var isNew = !object;
- object || (object = {});
-
- var index = -1,
- length = props.length;
-
- while (++index < length) {
- var key = props[index];
-
- var newValue = customizer
- ? customizer(object[key], source[key], key, object, source)
- : undefined;
-
- if (newValue === undefined) {
- newValue = source[key];
- }
- if (isNew) {
- baseAssignValue(object, key, newValue);
- } else {
- assignValue(object, key, newValue);
- }
- }
- return object;
- }
-
- /**
- * Copies own symbols of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy symbols from.
- * @param {Object} [object={}] The object to copy symbols to.
- * @returns {Object} Returns `object`.
- */
- function copySymbols(source, object) {
- return copyObject(source, getSymbols(source), object);
- }
-
- /**
- * Copies own and inherited symbols of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy symbols from.
- * @param {Object} [object={}] The object to copy symbols to.
- * @returns {Object} Returns `object`.
- */
- function copySymbolsIn(source, object) {
- return copyObject(source, getSymbolsIn(source), object);
- }
-
- /**
- * Creates a function like `_.groupBy`.
- *
- * @private
- * @param {Function} setter The function to set accumulator values.
- * @param {Function} [initializer] The accumulator object initializer.
- * @returns {Function} Returns the new aggregator function.
- */
- function createAggregator(setter, initializer) {
- return function(collection, iteratee) {
- var func = isArray(collection) ? arrayAggregator : baseAggregator,
- accumulator = initializer ? initializer() : {};
-
- return func(collection, setter, getIteratee(iteratee, 2), accumulator);
- };
- }
-
- /**
- * Creates a function like `_.assign`.
- *
- * @private
- * @param {Function} assigner The function to assign values.
- * @returns {Function} Returns the new assigner function.
- */
- function createAssigner(assigner) {
- return baseRest(function(object, sources) {
- var index = -1,
- length = sources.length,
- customizer = length > 1 ? sources[length - 1] : undefined,
- guard = length > 2 ? sources[2] : undefined;
-
- customizer = (assigner.length > 3 && typeof customizer == 'function')
- ? (length--, customizer)
- : undefined;
-
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? undefined : customizer;
- length = 1;
- }
- object = Object(object);
- while (++index < length) {
- var source = sources[index];
- if (source) {
- assigner(object, source, index, customizer);
- }
- }
- return object;
- });
- }
-
- /**
- * Creates a `baseEach` or `baseEachRight` function.
- *
- * @private
- * @param {Function} eachFunc The function to iterate over a collection.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
- function createBaseEach(eachFunc, fromRight) {
- return function(collection, iteratee) {
- if (collection == null) {
- return collection;
- }
- if (!isArrayLike(collection)) {
- return eachFunc(collection, iteratee);
- }
- var length = collection.length,
- index = fromRight ? length : -1,
- iterable = Object(collection);
-
- while ((fromRight ? index-- : ++index < length)) {
- if (iteratee(iterable[index], index, iterable) === false) {
- break;
- }
- }
- return collection;
- };
- }
-
- /**
- * Creates a base function for methods like `_.forIn` and `_.forOwn`.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
- function createBaseFor(fromRight) {
- return function(object, iteratee, keysFunc) {
- var index = -1,
- iterable = Object(object),
- props = keysFunc(object),
- length = props.length;
-
- while (length--) {
- var key = props[fromRight ? length : ++index];
- if (iteratee(iterable[key], key, iterable) === false) {
- break;
- }
- }
- return object;
- };
- }
-
- /**
- * Creates a function that wraps `func` to invoke it with the optional `this`
- * binding of `thisArg`.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createBind(func, bitmask, thisArg) {
- var isBind = bitmask & WRAP_BIND_FLAG,
- Ctor = createCtor(func);
-
- function wrapper() {
- var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
- return fn.apply(isBind ? thisArg : this, arguments);
- }
- return wrapper;
- }
-
- /**
- * Creates a function like `_.lowerFirst`.
- *
- * @private
- * @param {string} methodName The name of the `String` case method to use.
- * @returns {Function} Returns the new case function.
- */
- function createCaseFirst(methodName) {
- return function(string) {
- string = toString(string);
-
- var strSymbols = hasUnicode(string)
- ? stringToArray(string)
- : undefined;
-
- var chr = strSymbols
- ? strSymbols[0]
- : string.charAt(0);
-
- var trailing = strSymbols
- ? castSlice(strSymbols, 1).join('')
- : string.slice(1);
-
- return chr[methodName]() + trailing;
- };
- }
-
- /**
- * Creates a function like `_.camelCase`.
- *
- * @private
- * @param {Function} callback The function to combine each word.
- * @returns {Function} Returns the new compounder function.
- */
- function createCompounder(callback) {
- return function(string) {
- return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
- };
- }
-
- /**
- * Creates a function that produces an instance of `Ctor` regardless of
- * whether it was invoked as part of a `new` expression or by `call` or `apply`.
- *
- * @private
- * @param {Function} Ctor The constructor to wrap.
- * @returns {Function} Returns the new wrapped function.
- */
- function createCtor(Ctor) {
- return function() {
- // Use a `switch` statement to work with class constructors. See
- // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
- // for more details.
- var args = arguments;
- switch (args.length) {
- case 0: return new Ctor;
- case 1: return new Ctor(args[0]);
- case 2: return new Ctor(args[0], args[1]);
- case 3: return new Ctor(args[0], args[1], args[2]);
- case 4: return new Ctor(args[0], args[1], args[2], args[3]);
- case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
- case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
- case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
- }
- var thisBinding = baseCreate(Ctor.prototype),
- result = Ctor.apply(thisBinding, args);
-
- // Mimic the constructor's `return` behavior.
- // See https://es5.github.io/#x13.2.2 for more details.
- return isObject(result) ? result : thisBinding;
- };
- }
-
- /**
- * Creates a function that wraps `func` to enable currying.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {number} arity The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createCurry(func, bitmask, arity) {
- var Ctor = createCtor(func);
-
- function wrapper() {
- var length = arguments.length,
- args = Array(length),
- index = length,
- placeholder = getHolder(wrapper);
-
- while (index--) {
- args[index] = arguments[index];
- }
- var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
- ? []
- : replaceHolders(args, placeholder);
-
- length -= holders.length;
- if (length < arity) {
- return createRecurry(
- func, bitmask, createHybrid, wrapper.placeholder, undefined,
- args, holders, undefined, undefined, arity - length);
- }
- var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
- return apply(fn, this, args);
- }
- return wrapper;
- }
-
- /**
- * Creates a `_.find` or `_.findLast` function.
- *
- * @private
- * @param {Function} findIndexFunc The function to find the collection index.
- * @returns {Function} Returns the new find function.
- */
- function createFind(findIndexFunc) {
- return function(collection, predicate, fromIndex) {
- var iterable = Object(collection);
- if (!isArrayLike(collection)) {
- var iteratee = getIteratee(predicate, 3);
- collection = keys(collection);
- predicate = function(key) { return iteratee(iterable[key], key, iterable); };
- }
- var index = findIndexFunc(collection, predicate, fromIndex);
- return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
- };
- }
-
- /**
- * Creates a `_.flow` or `_.flowRight` function.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new flow function.
- */
- function createFlow(fromRight) {
- return flatRest(function(funcs) {
- var length = funcs.length,
- index = length,
- prereq = LodashWrapper.prototype.thru;
-
- if (fromRight) {
- funcs.reverse();
- }
- while (index--) {
- var func = funcs[index];
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
- var wrapper = new LodashWrapper([], true);
- }
- }
- index = wrapper ? index : length;
- while (++index < length) {
- func = funcs[index];
-
- var funcName = getFuncName(func),
- data = funcName == 'wrapper' ? getData(func) : undefined;
-
- if (data && isLaziable(data[0]) &&
- data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
- !data[4].length && data[9] == 1
- ) {
- wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
- } else {
- wrapper = (func.length == 1 && isLaziable(func))
- ? wrapper[funcName]()
- : wrapper.thru(func);
- }
- }
- return function() {
- var args = arguments,
- value = args[0];
-
- if (wrapper && args.length == 1 && isArray(value)) {
- return wrapper.plant(value).value();
- }
- var index = 0,
- result = length ? funcs[index].apply(this, args) : value;
-
- while (++index < length) {
- result = funcs[index].call(this, result);
- }
- return result;
- };
- });
- }
-
- /**
- * Creates a function that wraps `func` to invoke it with optional `this`
- * binding of `thisArg`, partial application, and currying.
- *
- * @private
- * @param {Function|string} func The function or method name to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to prepend to those provided to
- * the new function.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [partialsRight] The arguments to append to those provided
- * to the new function.
- * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
- var isAry = bitmask & WRAP_ARY_FLAG,
- isBind = bitmask & WRAP_BIND_FLAG,
- isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
- isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
- isFlip = bitmask & WRAP_FLIP_FLAG,
- Ctor = isBindKey ? undefined : createCtor(func);
-
- function wrapper() {
- var length = arguments.length,
- args = Array(length),
- index = length;
-
- while (index--) {
- args[index] = arguments[index];
- }
- if (isCurried) {
- var placeholder = getHolder(wrapper),
- holdersCount = countHolders(args, placeholder);
- }
- if (partials) {
- args = composeArgs(args, partials, holders, isCurried);
- }
- if (partialsRight) {
- args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
- }
- length -= holdersCount;
- if (isCurried && length < arity) {
- var newHolders = replaceHolders(args, placeholder);
- return createRecurry(
- func, bitmask, createHybrid, wrapper.placeholder, thisArg,
- args, newHolders, argPos, ary, arity - length
- );
- }
- var thisBinding = isBind ? thisArg : this,
- fn = isBindKey ? thisBinding[func] : func;
-
- length = args.length;
- if (argPos) {
- args = reorder(args, argPos);
- } else if (isFlip && length > 1) {
- args.reverse();
- }
- if (isAry && ary < length) {
- args.length = ary;
- }
- if (this && this !== root && this instanceof wrapper) {
- fn = Ctor || createCtor(fn);
- }
- return fn.apply(thisBinding, args);
- }
- return wrapper;
- }
-
- /**
- * Creates a function like `_.invertBy`.
- *
- * @private
- * @param {Function} setter The function to set accumulator values.
- * @param {Function} toIteratee The function to resolve iteratees.
- * @returns {Function} Returns the new inverter function.
- */
- function createInverter(setter, toIteratee) {
- return function(object, iteratee) {
- return baseInverter(object, setter, toIteratee(iteratee), {});
- };
- }
-
- /**
- * Creates a function that performs a mathematical operation on two values.
- *
- * @private
- * @param {Function} operator The function to perform the operation.
- * @param {number} [defaultValue] The value used for `undefined` arguments.
- * @returns {Function} Returns the new mathematical operation function.
- */
- function createMathOperation(operator, defaultValue) {
- return function(value, other) {
- var result;
- if (value === undefined && other === undefined) {
- return defaultValue;
- }
- if (value !== undefined) {
- result = value;
- }
- if (other !== undefined) {
- if (result === undefined) {
- return other;
- }
- if (typeof value == 'string' || typeof other == 'string') {
- value = baseToString(value);
- other = baseToString(other);
- } else {
- value = baseToNumber(value);
- other = baseToNumber(other);
- }
- result = operator(value, other);
- }
- return result;
- };
- }
-
- /**
- * Creates a function like `_.over`.
- *
- * @private
- * @param {Function} arrayFunc The function to iterate over iteratees.
- * @returns {Function} Returns the new over function.
- */
- function createOver(arrayFunc) {
- return flatRest(function(iteratees) {
- iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
- return baseRest(function(args) {
- var thisArg = this;
- return arrayFunc(iteratees, function(iteratee) {
- return apply(iteratee, thisArg, args);
- });
- });
- });
- }
-
- /**
- * Creates the padding for `string` based on `length`. The `chars` string
- * is truncated if the number of characters exceeds `length`.
- *
- * @private
- * @param {number} length The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padding for `string`.
- */
- function createPadding(length, chars) {
- chars = chars === undefined ? ' ' : baseToString(chars);
-
- var charsLength = chars.length;
- if (charsLength < 2) {
- return charsLength ? baseRepeat(chars, length) : chars;
- }
- var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
- return hasUnicode(chars)
- ? castSlice(stringToArray(result), 0, length).join('')
- : result.slice(0, length);
- }
-
- /**
- * Creates a function that wraps `func` to invoke it with the `this` binding
- * of `thisArg` and `partials` prepended to the arguments it receives.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {Array} partials The arguments to prepend to those provided to
- * the new function.
- * @returns {Function} Returns the new wrapped function.
- */
- function createPartial(func, bitmask, thisArg, partials) {
- var isBind = bitmask & WRAP_BIND_FLAG,
- Ctor = createCtor(func);
-
- function wrapper() {
- var argsIndex = -1,
- argsLength = arguments.length,
- leftIndex = -1,
- leftLength = partials.length,
- args = Array(leftLength + argsLength),
- fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
-
- while (++leftIndex < leftLength) {
- args[leftIndex] = partials[leftIndex];
- }
- while (argsLength--) {
- args[leftIndex++] = arguments[++argsIndex];
- }
- return apply(fn, isBind ? thisArg : this, args);
- }
- return wrapper;
- }
-
- /**
- * Creates a `_.range` or `_.rangeRight` function.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new range function.
- */
- function createRange(fromRight) {
- return function(start, end, step) {
- if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
- end = step = undefined;
- }
- // Ensure the sign of `-0` is preserved.
- start = toFinite(start);
- if (end === undefined) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
- return baseRange(start, end, step, fromRight);
- };
- }
-
- /**
- * Creates a function that performs a relational operation on two values.
- *
- * @private
- * @param {Function} operator The function to perform the operation.
- * @returns {Function} Returns the new relational operation function.
- */
- function createRelationalOperation(operator) {
- return function(value, other) {
- if (!(typeof value == 'string' && typeof other == 'string')) {
- value = toNumber(value);
- other = toNumber(other);
- }
- return operator(value, other);
- };
- }
-
- /**
- * Creates a function that wraps `func` to continue currying.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {Function} wrapFunc The function to create the `func` wrapper.
- * @param {*} placeholder The placeholder value.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to prepend to those provided to
- * the new function.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
- var isCurry = bitmask & WRAP_CURRY_FLAG,
- newHolders = isCurry ? holders : undefined,
- newHoldersRight = isCurry ? undefined : holders,
- newPartials = isCurry ? partials : undefined,
- newPartialsRight = isCurry ? undefined : partials;
-
- bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
- bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
-
- if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
- bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
- }
- var newData = [
- func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
- newHoldersRight, argPos, ary, arity
- ];
-
- var result = wrapFunc.apply(undefined, newData);
- if (isLaziable(func)) {
- setData(result, newData);
- }
- result.placeholder = placeholder;
- return setWrapToString(result, func, bitmask);
- }
-
- /**
- * Creates a function like `_.round`.
- *
- * @private
- * @param {string} methodName The name of the `Math` method to use when rounding.
- * @returns {Function} Returns the new round function.
- */
- function createRound(methodName) {
- var func = Math[methodName];
- return function(number, precision) {
- number = toNumber(number);
- precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
- if (precision) {
- // Shift with exponential notation to avoid floating-point issues.
- // See [MDN](https://mdn.io/round#Examples) for more details.
- var pair = (toString(number) + 'e').split('e'),
- value = func(pair[0] + 'e' + (+pair[1] + precision));
-
- pair = (toString(value) + 'e').split('e');
- return +(pair[0] + 'e' + (+pair[1] - precision));
- }
- return func(number);
- };
- }
-
- /**
- * Creates a set object of `values`.
- *
- * @private
- * @param {Array} values The values to add to the set.
- * @returns {Object} Returns the new set.
- */
- var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
- return new Set(values);
- };
-
- /**
- * Creates a `_.toPairs` or `_.toPairsIn` function.
- *
- * @private
- * @param {Function} keysFunc The function to get the keys of a given object.
- * @returns {Function} Returns the new pairs function.
- */
- function createToPairs(keysFunc) {
- return function(object) {
- var tag = getTag(object);
- if (tag == mapTag) {
- return mapToArray(object);
- }
- if (tag == setTag) {
- return setToPairs(object);
- }
- return baseToPairs(object, keysFunc(object));
- };
- }
-
- /**
- * Creates a function that either curries or invokes `func` with optional
- * `this` binding and partially applied arguments.
- *
- * @private
- * @param {Function|string} func The function or method name to wrap.
- * @param {number} bitmask The bitmask flags.
- * 1 - `_.bind`
- * 2 - `_.bindKey`
- * 4 - `_.curry` or `_.curryRight` of a bound function
- * 8 - `_.curry`
- * 16 - `_.curryRight`
- * 32 - `_.partial`
- * 64 - `_.partialRight`
- * 128 - `_.rearg`
- * 256 - `_.ary`
- * 512 - `_.flip`
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to be partially applied.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
- var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
- if (!isBindKey && typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var length = partials ? partials.length : 0;
- if (!length) {
- bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
- partials = holders = undefined;
- }
- ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
- arity = arity === undefined ? arity : toInteger(arity);
- length -= holders ? holders.length : 0;
-
- if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
- var partialsRight = partials,
- holdersRight = holders;
-
- partials = holders = undefined;
- }
- var data = isBindKey ? undefined : getData(func);
-
- var newData = [
- func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
- argPos, ary, arity
- ];
-
- if (data) {
- mergeData(newData, data);
- }
- func = newData[0];
- bitmask = newData[1];
- thisArg = newData[2];
- partials = newData[3];
- holders = newData[4];
- arity = newData[9] = newData[9] === undefined
- ? (isBindKey ? 0 : func.length)
- : nativeMax(newData[9] - length, 0);
-
- if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
- bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
- }
- if (!bitmask || bitmask == WRAP_BIND_FLAG) {
- var result = createBind(func, bitmask, thisArg);
- } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
- result = createCurry(func, bitmask, arity);
- } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
- result = createPartial(func, bitmask, thisArg, partials);
- } else {
- result = createHybrid.apply(undefined, newData);
- }
- var setter = data ? baseSetData : setData;
- return setWrapToString(setter(result, newData), func, bitmask);
- }
-
- /**
- * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
- * of source objects to the destination object for all destination properties
- * that resolve to `undefined`.
- *
- * @private
- * @param {*} objValue The destination value.
- * @param {*} srcValue The source value.
- * @param {string} key The key of the property to assign.
- * @param {Object} object The parent object of `objValue`.
- * @returns {*} Returns the value to assign.
- */
- function customDefaultsAssignIn(objValue, srcValue, key, object) {
- if (objValue === undefined ||
- (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
- return srcValue;
- }
- return objValue;
- }
-
- /**
- * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
- * objects into destination objects that are passed thru.
- *
- * @private
- * @param {*} objValue The destination value.
- * @param {*} srcValue The source value.
- * @param {string} key The key of the property to merge.
- * @param {Object} object The parent object of `objValue`.
- * @param {Object} source The parent object of `srcValue`.
- * @param {Object} [stack] Tracks traversed source values and their merged
- * counterparts.
- * @returns {*} Returns the value to assign.
- */
- function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
- if (isObject(objValue) && isObject(srcValue)) {
- // Recursively merge objects and arrays (susceptible to call stack limits).
- stack.set(srcValue, objValue);
- baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
- stack['delete'](srcValue);
- }
- return objValue;
- }
-
- /**
- * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
- * objects.
- *
- * @private
- * @param {*} value The value to inspect.
- * @param {string} key The key of the property to inspect.
- * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
- */
- function customOmitClone(value) {
- return isPlainObject(value) ? undefined : value;
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for arrays with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Array} array The array to compare.
- * @param {Array} other The other array to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} stack Tracks traversed `array` and `other` objects.
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
- */
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
- arrLength = array.length,
- othLength = other.length;
-
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
- return false;
- }
- // Assume cyclic values are equal.
- var stacked = stack.get(array);
- if (stacked && stack.get(other)) {
- return stacked == other;
- }
- var index = -1,
- result = true,
- seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
-
- stack.set(array, other);
- stack.set(other, array);
-
- // Ignore non-index properties.
- while (++index < arrLength) {
- var arrValue = array[index],
- othValue = other[index];
-
- if (customizer) {
- var compared = isPartial
- ? customizer(othValue, arrValue, index, other, array, stack)
- : customizer(arrValue, othValue, index, array, other, stack);
- }
- if (compared !== undefined) {
- if (compared) {
- continue;
- }
- result = false;
- break;
- }
- // Recursively compare arrays (susceptible to call stack limits).
- if (seen) {
- if (!arraySome(other, function(othValue, othIndex) {
- if (!cacheHas(seen, othIndex) &&
- (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
- return seen.push(othIndex);
- }
- })) {
- result = false;
- break;
- }
- } else if (!(
- arrValue === othValue ||
- equalFunc(arrValue, othValue, bitmask, customizer, stack)
- )) {
- result = false;
- break;
- }
- }
- stack['delete'](array);
- stack['delete'](other);
- return result;
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for comparing objects of
- * the same `toStringTag`.
- *
- * **Note:** This function only supports comparing values with tags of
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {string} tag The `toStringTag` of the objects to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} stack Tracks traversed `object` and `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
- switch (tag) {
- case dataViewTag:
- if ((object.byteLength != other.byteLength) ||
- (object.byteOffset != other.byteOffset)) {
- return false;
- }
- object = object.buffer;
- other = other.buffer;
-
- case arrayBufferTag:
- if ((object.byteLength != other.byteLength) ||
- !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
- return false;
- }
- return true;
-
- case boolTag:
- case dateTag:
- case numberTag:
- // Coerce booleans to `1` or `0` and dates to milliseconds.
- // Invalid dates are coerced to `NaN`.
- return eq(+object, +other);
-
- case errorTag:
- return object.name == other.name && object.message == other.message;
-
- case regexpTag:
- case stringTag:
- // Coerce regexes to strings and treat strings, primitives and objects,
- // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
- // for more details.
- return object == (other + '');
-
- case mapTag:
- var convert = mapToArray;
-
- case setTag:
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
- convert || (convert = setToArray);
-
- if (object.size != other.size && !isPartial) {
- return false;
- }
- // Assume cyclic values are equal.
- var stacked = stack.get(object);
- if (stacked) {
- return stacked == other;
- }
- bitmask |= COMPARE_UNORDERED_FLAG;
-
- // Recursively compare objects (susceptible to call stack limits).
- stack.set(object, other);
- var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
- stack['delete'](object);
- return result;
-
- case symbolTag:
- if (symbolValueOf) {
- return symbolValueOf.call(object) == symbolValueOf.call(other);
- }
- }
- return false;
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for objects with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} stack Tracks traversed `object` and `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
- objProps = getAllKeys(object),
- objLength = objProps.length,
- othProps = getAllKeys(other),
- othLength = othProps.length;
-
- if (objLength != othLength && !isPartial) {
- return false;
- }
- var index = objLength;
- while (index--) {
- var key = objProps[index];
- if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
- return false;
- }
- }
- // Assume cyclic values are equal.
- var stacked = stack.get(object);
- if (stacked && stack.get(other)) {
- return stacked == other;
- }
- var result = true;
- stack.set(object, other);
- stack.set(other, object);
-
- var skipCtor = isPartial;
- while (++index < objLength) {
- key = objProps[index];
- var objValue = object[key],
- othValue = other[key];
-
- if (customizer) {
- var compared = isPartial
- ? customizer(othValue, objValue, key, other, object, stack)
- : customizer(objValue, othValue, key, object, other, stack);
- }
- // Recursively compare objects (susceptible to call stack limits).
- if (!(compared === undefined
- ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
- : compared
- )) {
- result = false;
- break;
- }
- skipCtor || (skipCtor = key == 'constructor');
- }
- if (result && !skipCtor) {
- var objCtor = object.constructor,
- othCtor = other.constructor;
-
- // Non `Object` object instances with different constructors are not equal.
- if (objCtor != othCtor &&
- ('constructor' in object && 'constructor' in other) &&
- !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
- typeof othCtor == 'function' && othCtor instanceof othCtor)) {
- result = false;
- }
- }
- stack['delete'](object);
- stack['delete'](other);
- return result;
- }
-
- /**
- * A specialized version of `baseRest` which flattens the rest array.
- *
- * @private
- * @param {Function} func The function to apply a rest parameter to.
- * @returns {Function} Returns the new function.
- */
- function flatRest(func) {
- return setToString(overRest(func, undefined, flatten), func + '');
- }
-
- /**
- * Creates an array of own enumerable property names and symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function getAllKeys(object) {
- return baseGetAllKeys(object, keys, getSymbols);
- }
-
- /**
- * Creates an array of own and inherited enumerable property names and
- * symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function getAllKeysIn(object) {
- return baseGetAllKeys(object, keysIn, getSymbolsIn);
- }
-
- /**
- * Gets metadata for `func`.
- *
- * @private
- * @param {Function} func The function to query.
- * @returns {*} Returns the metadata for `func`.
- */
- var getData = !metaMap ? noop : function(func) {
- return metaMap.get(func);
- };
-
- /**
- * Gets the name of `func`.
- *
- * @private
- * @param {Function} func The function to query.
- * @returns {string} Returns the function name.
- */
- function getFuncName(func) {
- var result = (func.name + ''),
- array = realNames[result],
- length = hasOwnProperty.call(realNames, result) ? array.length : 0;
-
- while (length--) {
- var data = array[length],
- otherFunc = data.func;
- if (otherFunc == null || otherFunc == func) {
- return data.name;
- }
- }
- return result;
- }
-
- /**
- * Gets the argument placeholder value for `func`.
- *
- * @private
- * @param {Function} func The function to inspect.
- * @returns {*} Returns the placeholder value.
- */
- function getHolder(func) {
- var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
- return object.placeholder;
- }
-
- /**
- * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
- * this function returns the custom method, otherwise it returns `baseIteratee`.
- * If arguments are provided, the chosen function is invoked with them and
- * its result is returned.
- *
- * @private
- * @param {*} [value] The value to convert to an iteratee.
- * @param {number} [arity] The arity of the created iteratee.
- * @returns {Function} Returns the chosen function or its result.
- */
- function getIteratee() {
- var result = lodash.iteratee || iteratee;
- result = result === iteratee ? baseIteratee : result;
- return arguments.length ? result(arguments[0], arguments[1]) : result;
- }
-
- /**
- * Gets the data for `map`.
- *
- * @private
- * @param {Object} map The map to query.
- * @param {string} key The reference key.
- * @returns {*} Returns the map data.
- */
- function getMapData(map, key) {
- var data = map.__data__;
- return isKeyable(key)
- ? data[typeof key == 'string' ? 'string' : 'hash']
- : data.map;
- }
-
- /**
- * Gets the property names, values, and compare flags of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the match data of `object`.
- */
- function getMatchData(object) {
- var result = keys(object),
- length = result.length;
-
- while (length--) {
- var key = result[length],
- value = object[key];
-
- result[length] = [key, value, isStrictComparable(value)];
- }
- return result;
- }
-
- /**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
- function getNative(object, key) {
- var value = getValue(object, key);
- return baseIsNative(value) ? value : undefined;
- }
-
- /**
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the raw `toStringTag`.
- */
- function getRawTag(value) {
- var isOwn = hasOwnProperty.call(value, symToStringTag),
- tag = value[symToStringTag];
-
- try {
- value[symToStringTag] = undefined;
- var unmasked = true;
- } catch (e) {}
-
- var result = nativeObjectToString.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag] = tag;
- } else {
- delete value[symToStringTag];
- }
- }
- return result;
- }
-
- /**
- * Creates an array of the own enumerable symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of symbols.
- */
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
- if (object == null) {
- return [];
- }
- object = Object(object);
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
- return propertyIsEnumerable.call(object, symbol);
- });
- };
-
- /**
- * Creates an array of the own and inherited enumerable symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of symbols.
- */
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
- var result = [];
- while (object) {
- arrayPush(result, getSymbols(object));
- object = getPrototype(object);
- }
- return result;
- };
-
- /**
- * Gets the `toStringTag` of `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
- var getTag = baseGetTag;
-
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
- if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
- (Map && getTag(new Map) != mapTag) ||
- (Promise && getTag(Promise.resolve()) != promiseTag) ||
- (Set && getTag(new Set) != setTag) ||
- (WeakMap && getTag(new WeakMap) != weakMapTag)) {
- getTag = function(value) {
- var result = baseGetTag(value),
- Ctor = result == objectTag ? value.constructor : undefined,
- ctorString = Ctor ? toSource(Ctor) : '';
-
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString: return dataViewTag;
- case mapCtorString: return mapTag;
- case promiseCtorString: return promiseTag;
- case setCtorString: return setTag;
- case weakMapCtorString: return weakMapTag;
- }
- }
- return result;
- };
- }
-
- /**
- * Gets the view, applying any `transforms` to the `start` and `end` positions.
- *
- * @private
- * @param {number} start The start of the view.
- * @param {number} end The end of the view.
- * @param {Array} transforms The transformations to apply to the view.
- * @returns {Object} Returns an object containing the `start` and `end`
- * positions of the view.
- */
- function getView(start, end, transforms) {
- var index = -1,
- length = transforms.length;
-
- while (++index < length) {
- var data = transforms[index],
- size = data.size;
-
- switch (data.type) {
- case 'drop': start += size; break;
- case 'dropRight': end -= size; break;
- case 'take': end = nativeMin(end, start + size); break;
- case 'takeRight': start = nativeMax(start, end - size); break;
- }
- }
- return { 'start': start, 'end': end };
- }
-
- /**
- * Extracts wrapper details from the `source` body comment.
- *
- * @private
- * @param {string} source The source to inspect.
- * @returns {Array} Returns the wrapper details.
- */
- function getWrapDetails(source) {
- var match = source.match(reWrapDetails);
- return match ? match[1].split(reSplitDetails) : [];
- }
-
- /**
- * Checks if `path` exists on `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path to check.
- * @param {Function} hasFunc The function to check properties.
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
- */
- function hasPath(object, path, hasFunc) {
- path = castPath(path, object);
-
- var index = -1,
- length = path.length,
- result = false;
-
- while (++index < length) {
- var key = toKey(path[index]);
- if (!(result = object != null && hasFunc(object, key))) {
- break;
- }
- object = object[key];
- }
- if (result || ++index != length) {
- return result;
- }
- length = object == null ? 0 : object.length;
- return !!length && isLength(length) && isIndex(key, length) &&
- (isArray(object) || isArguments(object));
- }
-
- /**
- * Initializes an array clone.
- *
- * @private
- * @param {Array} array The array to clone.
- * @returns {Array} Returns the initialized clone.
- */
- function initCloneArray(array) {
- var length = array.length,
- result = array.constructor(length);
-
- // Add properties assigned by `RegExp#exec`.
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
- result.index = array.index;
- result.input = array.input;
- }
- return result;
- }
-
- /**
- * Initializes an object clone.
- *
- * @private
- * @param {Object} object The object to clone.
- * @returns {Object} Returns the initialized clone.
- */
- function initCloneObject(object) {
- return (typeof object.constructor == 'function' && !isPrototype(object))
- ? baseCreate(getPrototype(object))
- : {};
- }
-
- /**
- * Initializes an object clone based on its `toStringTag`.
- *
- * **Note:** This function only supports cloning values with tags of
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
- *
- * @private
- * @param {Object} object The object to clone.
- * @param {string} tag The `toStringTag` of the object to clone.
- * @param {Function} cloneFunc The function to clone values.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the initialized clone.
- */
- function initCloneByTag(object, tag, cloneFunc, isDeep) {
- var Ctor = object.constructor;
- switch (tag) {
- case arrayBufferTag:
- return cloneArrayBuffer(object);
-
- case boolTag:
- case dateTag:
- return new Ctor(+object);
-
- case dataViewTag:
- return cloneDataView(object, isDeep);
-
- case float32Tag: case float64Tag:
- case int8Tag: case int16Tag: case int32Tag:
- case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
- return cloneTypedArray(object, isDeep);
-
- case mapTag:
- return cloneMap(object, isDeep, cloneFunc);
-
- case numberTag:
- case stringTag:
- return new Ctor(object);
-
- case regexpTag:
- return cloneRegExp(object);
-
- case setTag:
- return cloneSet(object, isDeep, cloneFunc);
-
- case symbolTag:
- return cloneSymbol(object);
- }
- }
-
- /**
- * Inserts wrapper `details` in a comment at the top of the `source` body.
- *
- * @private
- * @param {string} source The source to modify.
- * @returns {Array} details The details to insert.
- * @returns {string} Returns the modified source.
- */
- function insertWrapDetails(source, details) {
- var length = details.length;
- if (!length) {
- return source;
- }
- var lastIndex = length - 1;
- details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
- details = details.join(length > 2 ? ', ' : ' ');
- return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
- }
-
- /**
- * Checks if `value` is a flattenable `arguments` object or array.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
- */
- function isFlattenable(value) {
- return isArray(value) || isArguments(value) ||
- !!(spreadableSymbol && value && value[spreadableSymbol]);
- }
-
- /**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
- function isIndex(value, length) {
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length &&
- (typeof value == 'number' || reIsUint.test(value)) &&
- (value > -1 && value % 1 == 0 && value < length);
- }
-
- /**
- * Checks if the given arguments are from an iteratee call.
- *
- * @private
- * @param {*} value The potential iteratee value argument.
- * @param {*} index The potential iteratee index or key argument.
- * @param {*} object The potential iteratee object argument.
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
- * else `false`.
- */
- function isIterateeCall(value, index, object) {
- if (!isObject(object)) {
- return false;
- }
- var type = typeof index;
- if (type == 'number'
- ? (isArrayLike(object) && isIndex(index, object.length))
- : (type == 'string' && index in object)
- ) {
- return eq(object[index], value);
- }
- return false;
- }
-
- /**
- * Checks if `value` is a property name and not a property path.
- *
- * @private
- * @param {*} value The value to check.
- * @param {Object} [object] The object to query keys on.
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
- */
- function isKey(value, object) {
- if (isArray(value)) {
- return false;
- }
- var type = typeof value;
- if (type == 'number' || type == 'symbol' || type == 'boolean' ||
- value == null || isSymbol(value)) {
- return true;
- }
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
- (object != null && value in Object(object));
- }
-
- /**
- * Checks if `value` is suitable for use as unique object key.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
- */
- function isKeyable(value) {
- var type = typeof value;
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
- ? (value !== '__proto__')
- : (value === null);
- }
-
- /**
- * Checks if `func` has a lazy counterpart.
- *
- * @private
- * @param {Function} func The function to check.
- * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
- * else `false`.
- */
- function isLaziable(func) {
- var funcName = getFuncName(func),
- other = lodash[funcName];
-
- if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
- return false;
- }
- if (func === other) {
- return true;
- }
- var data = getData(other);
- return !!data && func === data[0];
- }
-
- /**
- * Checks if `func` has its source masked.
- *
- * @private
- * @param {Function} func The function to check.
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
- */
- function isMasked(func) {
- return !!maskSrcKey && (maskSrcKey in func);
- }
-
- /**
- * Checks if `func` is capable of being masked.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
- */
- var isMaskable = coreJsData ? isFunction : stubFalse;
-
- /**
- * Checks if `value` is likely a prototype object.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
- */
- function isPrototype(value) {
- var Ctor = value && value.constructor,
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
-
- return value === proto;
- }
-
- /**
- * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` if suitable for strict
- * equality comparisons, else `false`.
- */
- function isStrictComparable(value) {
- return value === value && !isObject(value);
- }
-
- /**
- * A specialized version of `matchesProperty` for source values suitable
- * for strict equality comparisons, i.e. `===`.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @param {*} srcValue The value to match.
- * @returns {Function} Returns the new spec function.
- */
- function matchesStrictComparable(key, srcValue) {
- return function(object) {
- if (object == null) {
- return false;
- }
- return object[key] === srcValue &&
- (srcValue !== undefined || (key in Object(object)));
- };
- }
-
- /**
- * A specialized version of `_.memoize` which clears the memoized function's
- * cache when it exceeds `MAX_MEMOIZE_SIZE`.
- *
- * @private
- * @param {Function} func The function to have its output memoized.
- * @returns {Function} Returns the new memoized function.
- */
- function memoizeCapped(func) {
- var result = memoize(func, function(key) {
- if (cache.size === MAX_MEMOIZE_SIZE) {
- cache.clear();
- }
- return key;
- });
-
- var cache = result.cache;
- return result;
- }
-
- /**
- * Merges the function metadata of `source` into `data`.
- *
- * Merging metadata reduces the number of wrappers used to invoke a function.
- * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
- * may be applied regardless of execution order. Methods like `_.ary` and
- * `_.rearg` modify function arguments, making the order in which they are
- * executed important, preventing the merging of metadata. However, we make
- * an exception for a safe combined case where curried functions have `_.ary`
- * and or `_.rearg` applied.
- *
- * @private
- * @param {Array} data The destination metadata.
- * @param {Array} source The source metadata.
- * @returns {Array} Returns `data`.
- */
- function mergeData(data, source) {
- var bitmask = data[1],
- srcBitmask = source[1],
- newBitmask = bitmask | srcBitmask,
- isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
-
- var isCombo =
- ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
- ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
- ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
-
- // Exit early if metadata can't be merged.
- if (!(isCommon || isCombo)) {
- return data;
- }
- // Use source `thisArg` if available.
- if (srcBitmask & WRAP_BIND_FLAG) {
- data[2] = source[2];
- // Set when currying a bound function.
- newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
- }
- // Compose partial arguments.
- var value = source[3];
- if (value) {
- var partials = data[3];
- data[3] = partials ? composeArgs(partials, value, source[4]) : value;
- data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
- }
- // Compose partial right arguments.
- value = source[5];
- if (value) {
- partials = data[5];
- data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
- data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
- }
- // Use source `argPos` if available.
- value = source[7];
- if (value) {
- data[7] = value;
- }
- // Use source `ary` if it's smaller.
- if (srcBitmask & WRAP_ARY_FLAG) {
- data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
- }
- // Use source `arity` if one is not provided.
- if (data[9] == null) {
- data[9] = source[9];
- }
- // Use source `func` and merge bitmasks.
- data[0] = source[0];
- data[1] = newBitmask;
-
- return data;
- }
-
- /**
- * This function is like
- * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
- * except that it includes inherited enumerable properties.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function nativeKeysIn(object) {
- var result = [];
- if (object != null) {
- for (var key in Object(object)) {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * Converts `value` to a string using `Object.prototype.toString`.
- *
- * @private
- * @param {*} value The value to convert.
- * @returns {string} Returns the converted string.
- */
- function objectToString(value) {
- return nativeObjectToString.call(value);
- }
-
- /**
- * A specialized version of `baseRest` which transforms the rest array.
- *
- * @private
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @param {Function} transform The rest array transform.
- * @returns {Function} Returns the new function.
- */
- function overRest(func, start, transform) {
- start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
- return function() {
- var args = arguments,
- index = -1,
- length = nativeMax(args.length - start, 0),
- array = Array(length);
-
- while (++index < length) {
- array[index] = args[start + index];
- }
- index = -1;
- var otherArgs = Array(start + 1);
- while (++index < start) {
- otherArgs[index] = args[index];
- }
- otherArgs[start] = transform(array);
- return apply(func, this, otherArgs);
- };
- }
-
- /**
- * Gets the parent value at `path` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} path The path to get the parent value of.
- * @returns {*} Returns the parent value.
- */
- function parent(object, path) {
- return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
- }
-
- /**
- * Reorder `array` according to the specified indexes where the element at
- * the first index is assigned as the first element, the element at
- * the second index is assigned as the second element, and so on.
- *
- * @private
- * @param {Array} array The array to reorder.
- * @param {Array} indexes The arranged array indexes.
- * @returns {Array} Returns `array`.
- */
- function reorder(array, indexes) {
- var arrLength = array.length,
- length = nativeMin(indexes.length, arrLength),
- oldArray = copyArray(array);
-
- while (length--) {
- var index = indexes[length];
- array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
- }
- return array;
- }
-
- /**
- * Sets metadata for `func`.
- *
- * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
- * period of time, it will trip its breaker and transition to an identity
- * function to avoid garbage collection pauses in V8. See
- * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
- * for more details.
- *
- * @private
- * @param {Function} func The function to associate metadata with.
- * @param {*} data The metadata.
- * @returns {Function} Returns `func`.
- */
- var setData = shortOut(baseSetData);
-
- /**
- * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
- *
- * @private
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @returns {number|Object} Returns the timer id or timeout object.
- */
- var setTimeout = ctxSetTimeout || function(func, wait) {
- return root.setTimeout(func, wait);
- };
-
- /**
- * Sets the `toString` method of `func` to return `string`.
- *
- * @private
- * @param {Function} func The function to modify.
- * @param {Function} string The `toString` result.
- * @returns {Function} Returns `func`.
- */
- var setToString = shortOut(baseSetToString);
-
- /**
- * Sets the `toString` method of `wrapper` to mimic the source of `reference`
- * with wrapper details in a comment at the top of the source body.
- *
- * @private
- * @param {Function} wrapper The function to modify.
- * @param {Function} reference The reference function.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @returns {Function} Returns `wrapper`.
- */
- function setWrapToString(wrapper, reference, bitmask) {
- var source = (reference + '');
- return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
- }
-
- /**
- * Creates a function that'll short out and invoke `identity` instead
- * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
- * milliseconds.
- *
- * @private
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new shortable function.
- */
- function shortOut(func) {
- var count = 0,
- lastCalled = 0;
-
- return function() {
- var stamp = nativeNow(),
- remaining = HOT_SPAN - (stamp - lastCalled);
-
- lastCalled = stamp;
- if (remaining > 0) {
- if (++count >= HOT_COUNT) {
- return arguments[0];
- }
- } else {
- count = 0;
- }
- return func.apply(undefined, arguments);
- };
- }
-
- /**
- * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
- *
- * @private
- * @param {Array} array The array to shuffle.
- * @param {number} [size=array.length] The size of `array`.
- * @returns {Array} Returns `array`.
- */
- function shuffleSelf(array, size) {
- var index = -1,
- length = array.length,
- lastIndex = length - 1;
-
- size = size === undefined ? length : size;
- while (++index < size) {
- var rand = baseRandom(index, lastIndex),
- value = array[rand];
-
- array[rand] = array[index];
- array[index] = value;
- }
- array.length = size;
- return array;
- }
-
- /**
- * Converts `string` to a property path array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the property path array.
- */
- var stringToPath = memoizeCapped(function(string) {
- var result = [];
- if (reLeadingDot.test(string)) {
- result.push('');
- }
- string.replace(rePropName, function(match, number, quote, string) {
- result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
- });
- return result;
- });
-
- /**
- * Converts `value` to a string key if it's not a string or symbol.
- *
- * @private
- * @param {*} value The value to inspect.
- * @returns {string|symbol} Returns the key.
- */
- function toKey(value) {
- if (typeof value == 'string' || isSymbol(value)) {
- return value;
- }
- var result = (value + '');
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
- }
-
- /**
- * Converts `func` to its source code.
- *
- * @private
- * @param {Function} func The function to convert.
- * @returns {string} Returns the source code.
- */
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e) {}
- try {
- return (func + '');
- } catch (e) {}
- }
- return '';
- }
-
- /**
- * Updates wrapper `details` based on `bitmask` flags.
- *
- * @private
- * @returns {Array} details The details to modify.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @returns {Array} Returns `details`.
- */
- function updateWrapDetails(details, bitmask) {
- arrayEach(wrapFlags, function(pair) {
- var value = '_.' + pair[0];
- if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
- details.push(value);
- }
- });
- return details.sort();
- }
-
- /**
- * Creates a clone of `wrapper`.
- *
- * @private
- * @param {Object} wrapper The wrapper to clone.
- * @returns {Object} Returns the cloned wrapper.
- */
- function wrapperClone(wrapper) {
- if (wrapper instanceof LazyWrapper) {
- return wrapper.clone();
- }
- var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
- result.__actions__ = copyArray(wrapper.__actions__);
- result.__index__ = wrapper.__index__;
- result.__values__ = wrapper.__values__;
- return result;
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an array of elements split into groups the length of `size`.
- * If `array` can't be split evenly, the final chunk will be the remaining
- * elements.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to process.
- * @param {number} [size=1] The length of each chunk
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the new array of chunks.
- * @example
- *
- * _.chunk(['a', 'b', 'c', 'd'], 2);
- * // => [['a', 'b'], ['c', 'd']]
- *
- * _.chunk(['a', 'b', 'c', 'd'], 3);
- * // => [['a', 'b', 'c'], ['d']]
- */
- function chunk(array, size, guard) {
- if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
- size = 1;
- } else {
- size = nativeMax(toInteger(size), 0);
- }
- var length = array == null ? 0 : array.length;
- if (!length || size < 1) {
- return [];
- }
- var index = 0,
- resIndex = 0,
- result = Array(nativeCeil(length / size));
-
- while (index < length) {
- result[resIndex++] = baseSlice(array, index, (index += size));
- }
- return result;
- }
-
- /**
- * Creates an array with all falsey values removed. The values `false`, `null`,
- * `0`, `""`, `undefined`, and `NaN` are falsey.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to compact.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.compact([0, 1, false, 2, '', 3]);
- * // => [1, 2, 3]
- */
- function compact(array) {
- var index = -1,
- length = array == null ? 0 : array.length,
- resIndex = 0,
- result = [];
-
- while (++index < length) {
- var value = array[index];
- if (value) {
- result[resIndex++] = value;
- }
- }
- return result;
- }
-
- /**
- * Creates a new array concatenating `array` with any additional arrays
- * and/or values.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to concatenate.
- * @param {...*} [values] The values to concatenate.
- * @returns {Array} Returns the new concatenated array.
- * @example
- *
- * var array = [1];
- * var other = _.concat(array, 2, [3], [[4]]);
- *
- * console.log(other);
- * // => [1, 2, 3, [4]]
- *
- * console.log(array);
- * // => [1]
- */
- function concat() {
- var length = arguments.length;
- if (!length) {
- return [];
- }
- var args = Array(length - 1),
- array = arguments[0],
- index = length;
-
- while (index--) {
- args[index - 1] = arguments[index];
- }
- return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
- }
-
- /**
- * Creates an array of `array` values not included in the other given arrays
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons. The order and references of result values are
- * determined by the first array.
- *
- * **Note:** Unlike `_.pullAll`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...Array} [values] The values to exclude.
- * @returns {Array} Returns the new array of filtered values.
- * @see _.without, _.xor
- * @example
- *
- * _.difference([2, 1], [2, 3]);
- * // => [1]
- */
- var difference = baseRest(function(array, values) {
- return isArrayLikeObject(array)
- ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
- : [];
- });
-
- /**
- * This method is like `_.difference` except that it accepts `iteratee` which
- * is invoked for each element of `array` and `values` to generate the criterion
- * by which they're compared. The order and references of result values are
- * determined by the first array. The iteratee is invoked with one argument:
- * (value).
- *
- * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...Array} [values] The values to exclude.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
- * // => [1.2]
- *
- * // The `_.property` iteratee shorthand.
- * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
- * // => [{ 'x': 2 }]
- */
- var differenceBy = baseRest(function(array, values) {
- var iteratee = last(values);
- if (isArrayLikeObject(iteratee)) {
- iteratee = undefined;
- }
- return isArrayLikeObject(array)
- ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
- : [];
- });
-
- /**
- * This method is like `_.difference` except that it accepts `comparator`
- * which is invoked to compare elements of `array` to `values`. The order and
- * references of result values are determined by the first array. The comparator
- * is invoked with two arguments: (arrVal, othVal).
- *
- * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...Array} [values] The values to exclude.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- *
- * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
- * // => [{ 'x': 2, 'y': 1 }]
- */
- var differenceWith = baseRest(function(array, values) {
- var comparator = last(values);
- if (isArrayLikeObject(comparator)) {
- comparator = undefined;
- }
- return isArrayLikeObject(array)
- ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
- : [];
- });
-
- /**
- * Creates a slice of `array` with `n` elements dropped from the beginning.
- *
- * @static
- * @memberOf _
- * @since 0.5.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to drop.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.drop([1, 2, 3]);
- * // => [2, 3]
- *
- * _.drop([1, 2, 3], 2);
- * // => [3]
- *
- * _.drop([1, 2, 3], 5);
- * // => []
- *
- * _.drop([1, 2, 3], 0);
- * // => [1, 2, 3]
- */
- function drop(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : toInteger(n);
- return baseSlice(array, n < 0 ? 0 : n, length);
- }
-
- /**
- * Creates a slice of `array` with `n` elements dropped from the end.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to drop.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.dropRight([1, 2, 3]);
- * // => [1, 2]
- *
- * _.dropRight([1, 2, 3], 2);
- * // => [1]
- *
- * _.dropRight([1, 2, 3], 5);
- * // => []
- *
- * _.dropRight([1, 2, 3], 0);
- * // => [1, 2, 3]
- */
- function dropRight(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : toInteger(n);
- n = length - n;
- return baseSlice(array, 0, n < 0 ? 0 : n);
- }
-
- /**
- * Creates a slice of `array` excluding elements dropped from the end.
- * Elements are dropped until `predicate` returns falsey. The predicate is
- * invoked with three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * _.dropRightWhile(users, function(o) { return !o.active; });
- * // => objects for ['barney']
- *
- * // The `_.matches` iteratee shorthand.
- * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
- * // => objects for ['barney', 'fred']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.dropRightWhile(users, ['active', false]);
- * // => objects for ['barney']
- *
- * // The `_.property` iteratee shorthand.
- * _.dropRightWhile(users, 'active');
- * // => objects for ['barney', 'fred', 'pebbles']
- */
- function dropRightWhile(array, predicate) {
- return (array && array.length)
- ? baseWhile(array, getIteratee(predicate, 3), true, true)
- : [];
- }
-
- /**
- * Creates a slice of `array` excluding elements dropped from the beginning.
- * Elements are dropped until `predicate` returns falsey. The predicate is
- * invoked with three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * _.dropWhile(users, function(o) { return !o.active; });
- * // => objects for ['pebbles']
- *
- * // The `_.matches` iteratee shorthand.
- * _.dropWhile(users, { 'user': 'barney', 'active': false });
- * // => objects for ['fred', 'pebbles']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.dropWhile(users, ['active', false]);
- * // => objects for ['pebbles']
- *
- * // The `_.property` iteratee shorthand.
- * _.dropWhile(users, 'active');
- * // => objects for ['barney', 'fred', 'pebbles']
- */
- function dropWhile(array, predicate) {
- return (array && array.length)
- ? baseWhile(array, getIteratee(predicate, 3), true)
- : [];
- }
-
- /**
- * Fills elements of `array` with `value` from `start` up to, but not
- * including, `end`.
- *
- * **Note:** This method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 3.2.0
- * @category Array
- * @param {Array} array The array to fill.
- * @param {*} value The value to fill `array` with.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _.fill(array, 'a');
- * console.log(array);
- * // => ['a', 'a', 'a']
- *
- * _.fill(Array(3), 2);
- * // => [2, 2, 2]
- *
- * _.fill([4, 6, 8, 10], '*', 1, 3);
- * // => [4, '*', '*', 10]
- */
- function fill(array, value, start, end) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
- start = 0;
- end = length;
- }
- return baseFill(array, value, start, end);
- }
-
- /**
- * This method is like `_.find` except that it returns the index of the first
- * element `predicate` returns truthy for instead of the element itself.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=0] The index to search from.
- * @returns {number} Returns the index of the found element, else `-1`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * _.findIndex(users, function(o) { return o.user == 'barney'; });
- * // => 0
- *
- * // The `_.matches` iteratee shorthand.
- * _.findIndex(users, { 'user': 'fred', 'active': false });
- * // => 1
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findIndex(users, ['active', false]);
- * // => 0
- *
- * // The `_.property` iteratee shorthand.
- * _.findIndex(users, 'active');
- * // => 2
- */
- function findIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index < 0) {
- index = nativeMax(length + index, 0);
- }
- return baseFindIndex(array, getIteratee(predicate, 3), index);
- }
-
- /**
- * This method is like `_.findIndex` except that it iterates over elements
- * of `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=array.length-1] The index to search from.
- * @returns {number} Returns the index of the found element, else `-1`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
- * // => 2
- *
- * // The `_.matches` iteratee shorthand.
- * _.findLastIndex(users, { 'user': 'barney', 'active': true });
- * // => 0
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findLastIndex(users, ['active', false]);
- * // => 2
- *
- * // The `_.property` iteratee shorthand.
- * _.findLastIndex(users, 'active');
- * // => 0
- */
- function findLastIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = length - 1;
- if (fromIndex !== undefined) {
- index = toInteger(fromIndex);
- index = fromIndex < 0
- ? nativeMax(length + index, 0)
- : nativeMin(index, length - 1);
- }
- return baseFindIndex(array, getIteratee(predicate, 3), index, true);
- }
-
- /**
- * Flattens `array` a single level deep.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to flatten.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * _.flatten([1, [2, [3, [4]], 5]]);
- * // => [1, 2, [3, [4]], 5]
- */
- function flatten(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseFlatten(array, 1) : [];
- }
-
- /**
- * Recursively flattens `array`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to flatten.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * _.flattenDeep([1, [2, [3, [4]], 5]]);
- * // => [1, 2, 3, 4, 5]
- */
- function flattenDeep(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseFlatten(array, INFINITY) : [];
- }
-
- /**
- * Recursively flatten `array` up to `depth` times.
- *
- * @static
- * @memberOf _
- * @since 4.4.0
- * @category Array
- * @param {Array} array The array to flatten.
- * @param {number} [depth=1] The maximum recursion depth.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * var array = [1, [2, [3, [4]], 5]];
- *
- * _.flattenDepth(array, 1);
- * // => [1, 2, [3, [4]], 5]
- *
- * _.flattenDepth(array, 2);
- * // => [1, 2, 3, [4], 5]
- */
- function flattenDepth(array, depth) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- depth = depth === undefined ? 1 : toInteger(depth);
- return baseFlatten(array, depth);
- }
-
- /**
- * The inverse of `_.toPairs`; this method returns an object composed
- * from key-value `pairs`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} pairs The key-value pairs.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.fromPairs([['a', 1], ['b', 2]]);
- * // => { 'a': 1, 'b': 2 }
- */
- function fromPairs(pairs) {
- var index = -1,
- length = pairs == null ? 0 : pairs.length,
- result = {};
-
- while (++index < length) {
- var pair = pairs[index];
- result[pair[0]] = pair[1];
- }
- return result;
- }
-
- /**
- * Gets the first element of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @alias first
- * @category Array
- * @param {Array} array The array to query.
- * @returns {*} Returns the first element of `array`.
- * @example
- *
- * _.head([1, 2, 3]);
- * // => 1
- *
- * _.head([]);
- * // => undefined
- */
- function head(array) {
- return (array && array.length) ? array[0] : undefined;
- }
-
- /**
- * Gets the index at which the first occurrence of `value` is found in `array`
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons. If `fromIndex` is negative, it's used as the
- * offset from the end of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} [fromIndex=0] The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.indexOf([1, 2, 1, 2], 2);
- * // => 1
- *
- * // Search from the `fromIndex`.
- * _.indexOf([1, 2, 1, 2], 2, 2);
- * // => 3
- */
- function indexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index < 0) {
- index = nativeMax(length + index, 0);
- }
- return baseIndexOf(array, value, index);
- }
-
- /**
- * Gets all but the last element of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to query.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.initial([1, 2, 3]);
- * // => [1, 2]
- */
- function initial(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseSlice(array, 0, -1) : [];
- }
-
- /**
- * Creates an array of unique values that are included in all given arrays
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons. The order and references of result values are
- * determined by the first array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of intersecting values.
- * @example
- *
- * _.intersection([2, 1], [2, 3]);
- * // => [2]
- */
- var intersection = baseRest(function(arrays) {
- var mapped = arrayMap(arrays, castArrayLikeObject);
- return (mapped.length && mapped[0] === arrays[0])
- ? baseIntersection(mapped)
- : [];
- });
-
- /**
- * This method is like `_.intersection` except that it accepts `iteratee`
- * which is invoked for each element of each `arrays` to generate the criterion
- * by which they're compared. The order and references of result values are
- * determined by the first array. The iteratee is invoked with one argument:
- * (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of intersecting values.
- * @example
- *
- * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
- * // => [2.1]
- *
- * // The `_.property` iteratee shorthand.
- * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }]
- */
- var intersectionBy = baseRest(function(arrays) {
- var iteratee = last(arrays),
- mapped = arrayMap(arrays, castArrayLikeObject);
-
- if (iteratee === last(mapped)) {
- iteratee = undefined;
- } else {
- mapped.pop();
- }
- return (mapped.length && mapped[0] === arrays[0])
- ? baseIntersection(mapped, getIteratee(iteratee, 2))
- : [];
- });
-
- /**
- * This method is like `_.intersection` except that it accepts `comparator`
- * which is invoked to compare elements of `arrays`. The order and references
- * of result values are determined by the first array. The comparator is
- * invoked with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of intersecting values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.intersectionWith(objects, others, _.isEqual);
- * // => [{ 'x': 1, 'y': 2 }]
- */
- var intersectionWith = baseRest(function(arrays) {
- var comparator = last(arrays),
- mapped = arrayMap(arrays, castArrayLikeObject);
-
- comparator = typeof comparator == 'function' ? comparator : undefined;
- if (comparator) {
- mapped.pop();
- }
- return (mapped.length && mapped[0] === arrays[0])
- ? baseIntersection(mapped, undefined, comparator)
- : [];
- });
-
- /**
- * Converts all elements in `array` into a string separated by `separator`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to convert.
- * @param {string} [separator=','] The element separator.
- * @returns {string} Returns the joined string.
- * @example
- *
- * _.join(['a', 'b', 'c'], '~');
- * // => 'a~b~c'
- */
- function join(array, separator) {
- return array == null ? '' : nativeJoin.call(array, separator);
- }
-
- /**
- * Gets the last element of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to query.
- * @returns {*} Returns the last element of `array`.
- * @example
- *
- * _.last([1, 2, 3]);
- * // => 3
- */
- function last(array) {
- var length = array == null ? 0 : array.length;
- return length ? array[length - 1] : undefined;
- }
-
- /**
- * This method is like `_.indexOf` except that it iterates over elements of
- * `array` from right to left.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} [fromIndex=array.length-1] The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.lastIndexOf([1, 2, 1, 2], 2);
- * // => 3
- *
- * // Search from the `fromIndex`.
- * _.lastIndexOf([1, 2, 1, 2], 2, 2);
- * // => 1
- */
- function lastIndexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = length;
- if (fromIndex !== undefined) {
- index = toInteger(fromIndex);
- index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
- }
- return value === value
- ? strictLastIndexOf(array, value, index)
- : baseFindIndex(array, baseIsNaN, index, true);
- }
-
- /**
- * Gets the element at index `n` of `array`. If `n` is negative, the nth
- * element from the end is returned.
- *
- * @static
- * @memberOf _
- * @since 4.11.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=0] The index of the element to return.
- * @returns {*} Returns the nth element of `array`.
- * @example
- *
- * var array = ['a', 'b', 'c', 'd'];
- *
- * _.nth(array, 1);
- * // => 'b'
- *
- * _.nth(array, -2);
- * // => 'c';
- */
- function nth(array, n) {
- return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
- }
-
- /**
- * Removes all given values from `array` using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
- * to remove elements from an array by predicate.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {...*} [values] The values to remove.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
- *
- * _.pull(array, 'a', 'c');
- * console.log(array);
- * // => ['b', 'b']
- */
- var pull = baseRest(pullAll);
-
- /**
- * This method is like `_.pull` except that it accepts an array of values to remove.
- *
- * **Note:** Unlike `_.difference`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
- *
- * _.pullAll(array, ['a', 'c']);
- * console.log(array);
- * // => ['b', 'b']
- */
- function pullAll(array, values) {
- return (array && array.length && values && values.length)
- ? basePullAll(array, values)
- : array;
- }
-
- /**
- * This method is like `_.pullAll` except that it accepts `iteratee` which is
- * invoked for each element of `array` and `values` to generate the criterion
- * by which they're compared. The iteratee is invoked with one argument: (value).
- *
- * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
- *
- * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
- * console.log(array);
- * // => [{ 'x': 2 }]
- */
- function pullAllBy(array, values, iteratee) {
- return (array && array.length && values && values.length)
- ? basePullAll(array, values, getIteratee(iteratee, 2))
- : array;
- }
-
- /**
- * This method is like `_.pullAll` except that it accepts `comparator` which
- * is invoked to compare elements of `array` to `values`. The comparator is
- * invoked with two arguments: (arrVal, othVal).
- *
- * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 4.6.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
- *
- * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
- * console.log(array);
- * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
- */
- function pullAllWith(array, values, comparator) {
- return (array && array.length && values && values.length)
- ? basePullAll(array, values, undefined, comparator)
- : array;
- }
-
- /**
- * Removes elements from `array` corresponding to `indexes` and returns an
- * array of removed elements.
- *
- * **Note:** Unlike `_.at`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {...(number|number[])} [indexes] The indexes of elements to remove.
- * @returns {Array} Returns the new array of removed elements.
- * @example
- *
- * var array = ['a', 'b', 'c', 'd'];
- * var pulled = _.pullAt(array, [1, 3]);
- *
- * console.log(array);
- * // => ['a', 'c']
- *
- * console.log(pulled);
- * // => ['b', 'd']
- */
- var pullAt = flatRest(function(array, indexes) {
- var length = array == null ? 0 : array.length,
- result = baseAt(array, indexes);
-
- basePullAt(array, arrayMap(indexes, function(index) {
- return isIndex(index, length) ? +index : index;
- }).sort(compareAscending));
-
- return result;
- });
-
- /**
- * Removes all elements from `array` that `predicate` returns truthy for
- * and returns an array of the removed elements. The predicate is invoked
- * with three arguments: (value, index, array).
- *
- * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
- * to pull elements from an array by value.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new array of removed elements.
- * @example
- *
- * var array = [1, 2, 3, 4];
- * var evens = _.remove(array, function(n) {
- * return n % 2 == 0;
- * });
- *
- * console.log(array);
- * // => [1, 3]
- *
- * console.log(evens);
- * // => [2, 4]
- */
- function remove(array, predicate) {
- var result = [];
- if (!(array && array.length)) {
- return result;
- }
- var index = -1,
- indexes = [],
- length = array.length;
-
- predicate = getIteratee(predicate, 3);
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result.push(value);
- indexes.push(index);
- }
- }
- basePullAt(array, indexes);
- return result;
- }
-
- /**
- * Reverses `array` so that the first element becomes the last, the second
- * element becomes the second to last, and so on.
- *
- * **Note:** This method mutates `array` and is based on
- * [`Array#reverse`](https://mdn.io/Array/reverse).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _.reverse(array);
- * // => [3, 2, 1]
- *
- * console.log(array);
- * // => [3, 2, 1]
- */
- function reverse(array) {
- return array == null ? array : nativeReverse.call(array);
- }
-
- /**
- * Creates a slice of `array` from `start` up to, but not including, `end`.
- *
- * **Note:** This method is used instead of
- * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
- * returned.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to slice.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns the slice of `array`.
- */
- function slice(array, start, end) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
- start = 0;
- end = length;
- }
- else {
- start = start == null ? 0 : toInteger(start);
- end = end === undefined ? length : toInteger(end);
- }
- return baseSlice(array, start, end);
- }
-
- /**
- * Uses a binary search to determine the lowest index at which `value`
- * should be inserted into `array` in order to maintain its sort order.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * _.sortedIndex([30, 50], 40);
- * // => 1
- */
- function sortedIndex(array, value) {
- return baseSortedIndex(array, value);
- }
-
- /**
- * This method is like `_.sortedIndex` except that it accepts `iteratee`
- * which is invoked for `value` and each element of `array` to compute their
- * sort ranking. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * var objects = [{ 'x': 4 }, { 'x': 5 }];
- *
- * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
- * // => 0
- *
- * // The `_.property` iteratee shorthand.
- * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
- * // => 0
- */
- function sortedIndexBy(array, value, iteratee) {
- return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
- }
-
- /**
- * This method is like `_.indexOf` except that it performs a binary
- * search on a sorted `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
- * // => 1
- */
- function sortedIndexOf(array, value) {
- var length = array == null ? 0 : array.length;
- if (length) {
- var index = baseSortedIndex(array, value);
- if (index < length && eq(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * This method is like `_.sortedIndex` except that it returns the highest
- * index at which `value` should be inserted into `array` in order to
- * maintain its sort order.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
- * // => 4
- */
- function sortedLastIndex(array, value) {
- return baseSortedIndex(array, value, true);
- }
-
- /**
- * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
- * which is invoked for `value` and each element of `array` to compute their
- * sort ranking. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * var objects = [{ 'x': 4 }, { 'x': 5 }];
- *
- * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
- * // => 1
- *
- * // The `_.property` iteratee shorthand.
- * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
- * // => 1
- */
- function sortedLastIndexBy(array, value, iteratee) {
- return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
- }
-
- /**
- * This method is like `_.lastIndexOf` except that it performs a binary
- * search on a sorted `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
- * // => 3
- */
- function sortedLastIndexOf(array, value) {
- var length = array == null ? 0 : array.length;
- if (length) {
- var index = baseSortedIndex(array, value, true) - 1;
- if (eq(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * This method is like `_.uniq` except that it's designed and optimized
- * for sorted arrays.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.sortedUniq([1, 1, 2]);
- * // => [1, 2]
- */
- function sortedUniq(array) {
- return (array && array.length)
- ? baseSortedUniq(array)
- : [];
- }
-
- /**
- * This method is like `_.uniqBy` except that it's designed and optimized
- * for sorted arrays.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
- * // => [1.1, 2.3]
- */
- function sortedUniqBy(array, iteratee) {
- return (array && array.length)
- ? baseSortedUniq(array, getIteratee(iteratee, 2))
- : [];
- }
-
- /**
- * Gets all but the first element of `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.tail([1, 2, 3]);
- * // => [2, 3]
- */
- function tail(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseSlice(array, 1, length) : [];
- }
-
- /**
- * Creates a slice of `array` with `n` elements taken from the beginning.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to take.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.take([1, 2, 3]);
- * // => [1]
- *
- * _.take([1, 2, 3], 2);
- * // => [1, 2]
- *
- * _.take([1, 2, 3], 5);
- * // => [1, 2, 3]
- *
- * _.take([1, 2, 3], 0);
- * // => []
- */
- function take(array, n, guard) {
- if (!(array && array.length)) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : toInteger(n);
- return baseSlice(array, 0, n < 0 ? 0 : n);
- }
-
- /**
- * Creates a slice of `array` with `n` elements taken from the end.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to take.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.takeRight([1, 2, 3]);
- * // => [3]
- *
- * _.takeRight([1, 2, 3], 2);
- * // => [2, 3]
- *
- * _.takeRight([1, 2, 3], 5);
- * // => [1, 2, 3]
- *
- * _.takeRight([1, 2, 3], 0);
- * // => []
- */
- function takeRight(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : toInteger(n);
- n = length - n;
- return baseSlice(array, n < 0 ? 0 : n, length);
- }
-
- /**
- * Creates a slice of `array` with elements taken from the end. Elements are
- * taken until `predicate` returns falsey. The predicate is invoked with
- * three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * _.takeRightWhile(users, function(o) { return !o.active; });
- * // => objects for ['fred', 'pebbles']
- *
- * // The `_.matches` iteratee shorthand.
- * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
- * // => objects for ['pebbles']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.takeRightWhile(users, ['active', false]);
- * // => objects for ['fred', 'pebbles']
- *
- * // The `_.property` iteratee shorthand.
- * _.takeRightWhile(users, 'active');
- * // => []
- */
- function takeRightWhile(array, predicate) {
- return (array && array.length)
- ? baseWhile(array, getIteratee(predicate, 3), false, true)
- : [];
- }
-
- /**
- * Creates a slice of `array` with elements taken from the beginning. Elements
- * are taken until `predicate` returns falsey. The predicate is invoked with
- * three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * _.takeWhile(users, function(o) { return !o.active; });
- * // => objects for ['barney', 'fred']
- *
- * // The `_.matches` iteratee shorthand.
- * _.takeWhile(users, { 'user': 'barney', 'active': false });
- * // => objects for ['barney']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.takeWhile(users, ['active', false]);
- * // => objects for ['barney', 'fred']
- *
- * // The `_.property` iteratee shorthand.
- * _.takeWhile(users, 'active');
- * // => []
- */
- function takeWhile(array, predicate) {
- return (array && array.length)
- ? baseWhile(array, getIteratee(predicate, 3))
- : [];
- }
-
- /**
- * Creates an array of unique values, in order, from all given arrays using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of combined values.
- * @example
- *
- * _.union([2], [1, 2]);
- * // => [2, 1]
- */
- var union = baseRest(function(arrays) {
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
- });
-
- /**
- * This method is like `_.union` except that it accepts `iteratee` which is
- * invoked for each element of each `arrays` to generate the criterion by
- * which uniqueness is computed. Result values are chosen from the first
- * array in which the value occurs. The iteratee is invoked with one argument:
- * (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of combined values.
- * @example
- *
- * _.unionBy([2.1], [1.2, 2.3], Math.floor);
- * // => [2.1, 1.2]
- *
- * // The `_.property` iteratee shorthand.
- * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }, { 'x': 2 }]
- */
- var unionBy = baseRest(function(arrays) {
- var iteratee = last(arrays);
- if (isArrayLikeObject(iteratee)) {
- iteratee = undefined;
- }
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
- });
-
- /**
- * This method is like `_.union` except that it accepts `comparator` which
- * is invoked to compare elements of `arrays`. Result values are chosen from
- * the first array in which the value occurs. The comparator is invoked
- * with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of combined values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.unionWith(objects, others, _.isEqual);
- * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
- */
- var unionWith = baseRest(function(arrays) {
- var comparator = last(arrays);
- comparator = typeof comparator == 'function' ? comparator : undefined;
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
- });
-
- /**
- * Creates a duplicate-free version of an array, using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons, in which only the first occurrence of each element
- * is kept. The order of result values is determined by the order they occur
- * in the array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.uniq([2, 1, 2]);
- * // => [2, 1]
- */
- function uniq(array) {
- return (array && array.length) ? baseUniq(array) : [];
- }
-
- /**
- * This method is like `_.uniq` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the criterion by which
- * uniqueness is computed. The order of result values is determined by the
- * order they occur in the array. The iteratee is invoked with one argument:
- * (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
- * // => [2.1, 1.2]
- *
- * // The `_.property` iteratee shorthand.
- * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }, { 'x': 2 }]
- */
- function uniqBy(array, iteratee) {
- return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
- }
-
- /**
- * This method is like `_.uniq` except that it accepts `comparator` which
- * is invoked to compare elements of `array`. The order of result values is
- * determined by the order they occur in the array.The comparator is invoked
- * with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.uniqWith(objects, _.isEqual);
- * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
- */
- function uniqWith(array, comparator) {
- comparator = typeof comparator == 'function' ? comparator : undefined;
- return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
- }
-
- /**
- * This method is like `_.zip` except that it accepts an array of grouped
- * elements and creates an array regrouping the elements to their pre-zip
- * configuration.
- *
- * @static
- * @memberOf _
- * @since 1.2.0
- * @category Array
- * @param {Array} array The array of grouped elements to process.
- * @returns {Array} Returns the new array of regrouped elements.
- * @example
- *
- * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
- * // => [['a', 1, true], ['b', 2, false]]
- *
- * _.unzip(zipped);
- * // => [['a', 'b'], [1, 2], [true, false]]
- */
- function unzip(array) {
- if (!(array && array.length)) {
- return [];
- }
- var length = 0;
- array = arrayFilter(array, function(group) {
- if (isArrayLikeObject(group)) {
- length = nativeMax(group.length, length);
- return true;
- }
- });
- return baseTimes(length, function(index) {
- return arrayMap(array, baseProperty(index));
- });
- }
-
- /**
- * This method is like `_.unzip` except that it accepts `iteratee` to specify
- * how regrouped values should be combined. The iteratee is invoked with the
- * elements of each group: (...group).
- *
- * @static
- * @memberOf _
- * @since 3.8.0
- * @category Array
- * @param {Array} array The array of grouped elements to process.
- * @param {Function} [iteratee=_.identity] The function to combine
- * regrouped values.
- * @returns {Array} Returns the new array of regrouped elements.
- * @example
- *
- * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
- * // => [[1, 10, 100], [2, 20, 200]]
- *
- * _.unzipWith(zipped, _.add);
- * // => [3, 30, 300]
- */
- function unzipWith(array, iteratee) {
- if (!(array && array.length)) {
- return [];
- }
- var result = unzip(array);
- if (iteratee == null) {
- return result;
- }
- return arrayMap(result, function(group) {
- return apply(iteratee, undefined, group);
- });
- }
-
- /**
- * Creates an array excluding all given values using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * **Note:** Unlike `_.pull`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...*} [values] The values to exclude.
- * @returns {Array} Returns the new array of filtered values.
- * @see _.difference, _.xor
- * @example
- *
- * _.without([2, 1, 2, 3], 1, 2);
- * // => [3]
- */
- var without = baseRest(function(array, values) {
- return isArrayLikeObject(array)
- ? baseDifference(array, values)
- : [];
- });
-
- /**
- * Creates an array of unique values that is the
- * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
- * of the given arrays. The order of result values is determined by the order
- * they occur in the arrays.
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of filtered values.
- * @see _.difference, _.without
- * @example
- *
- * _.xor([2, 1], [2, 3]);
- * // => [1, 3]
- */
- var xor = baseRest(function(arrays) {
- return baseXor(arrayFilter(arrays, isArrayLikeObject));
- });
-
- /**
- * This method is like `_.xor` except that it accepts `iteratee` which is
- * invoked for each element of each `arrays` to generate the criterion by
- * which by which they're compared. The order of result values is determined
- * by the order they occur in the arrays. The iteratee is invoked with one
- * argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
- * // => [1.2, 3.4]
- *
- * // The `_.property` iteratee shorthand.
- * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 2 }]
- */
- var xorBy = baseRest(function(arrays) {
- var iteratee = last(arrays);
- if (isArrayLikeObject(iteratee)) {
- iteratee = undefined;
- }
- return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
- });
-
- /**
- * This method is like `_.xor` except that it accepts `comparator` which is
- * invoked to compare elements of `arrays`. The order of result values is
- * determined by the order they occur in the arrays. The comparator is invoked
- * with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.xorWith(objects, others, _.isEqual);
- * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
- */
- var xorWith = baseRest(function(arrays) {
- var comparator = last(arrays);
- comparator = typeof comparator == 'function' ? comparator : undefined;
- return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
- });
-
- /**
- * Creates an array of grouped elements, the first of which contains the
- * first elements of the given arrays, the second of which contains the
- * second elements of the given arrays, and so on.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {...Array} [arrays] The arrays to process.
- * @returns {Array} Returns the new array of grouped elements.
- * @example
- *
- * _.zip(['a', 'b'], [1, 2], [true, false]);
- * // => [['a', 1, true], ['b', 2, false]]
- */
- var zip = baseRest(unzip);
-
- /**
- * This method is like `_.fromPairs` except that it accepts two arrays,
- * one of property identifiers and one of corresponding values.
- *
- * @static
- * @memberOf _
- * @since 0.4.0
- * @category Array
- * @param {Array} [props=[]] The property identifiers.
- * @param {Array} [values=[]] The property values.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.zipObject(['a', 'b'], [1, 2]);
- * // => { 'a': 1, 'b': 2 }
- */
- function zipObject(props, values) {
- return baseZipObject(props || [], values || [], assignValue);
- }
-
- /**
- * This method is like `_.zipObject` except that it supports property paths.
- *
- * @static
- * @memberOf _
- * @since 4.1.0
- * @category Array
- * @param {Array} [props=[]] The property identifiers.
- * @param {Array} [values=[]] The property values.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
- * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
- */
- function zipObjectDeep(props, values) {
- return baseZipObject(props || [], values || [], baseSet);
- }
-
- /**
- * This method is like `_.zip` except that it accepts `iteratee` to specify
- * how grouped values should be combined. The iteratee is invoked with the
- * elements of each group: (...group).
- *
- * @static
- * @memberOf _
- * @since 3.8.0
- * @category Array
- * @param {...Array} [arrays] The arrays to process.
- * @param {Function} [iteratee=_.identity] The function to combine
- * grouped values.
- * @returns {Array} Returns the new array of grouped elements.
- * @example
- *
- * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
- * return a + b + c;
- * });
- * // => [111, 222]
- */
- var zipWith = baseRest(function(arrays) {
- var length = arrays.length,
- iteratee = length > 1 ? arrays[length - 1] : undefined;
-
- iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
- return unzipWith(arrays, iteratee);
- });
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a `lodash` wrapper instance that wraps `value` with explicit method
- * chain sequences enabled. The result of such sequences must be unwrapped
- * with `_#value`.
- *
- * @static
- * @memberOf _
- * @since 1.3.0
- * @category Seq
- * @param {*} value The value to wrap.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 },
- * { 'user': 'pebbles', 'age': 1 }
- * ];
- *
- * var youngest = _
- * .chain(users)
- * .sortBy('age')
- * .map(function(o) {
- * return o.user + ' is ' + o.age;
- * })
- * .head()
- * .value();
- * // => 'pebbles is 1'
- */
- function chain(value) {
- var result = lodash(value);
- result.__chain__ = true;
- return result;
- }
-
- /**
- * This method invokes `interceptor` and returns `value`. The interceptor
- * is invoked with one argument; (value). The purpose of this method is to
- * "tap into" a method chain sequence in order to modify intermediate results.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Seq
- * @param {*} value The value to provide to `interceptor`.
- * @param {Function} interceptor The function to invoke.
- * @returns {*} Returns `value`.
- * @example
- *
- * _([1, 2, 3])
- * .tap(function(array) {
- * // Mutate input array.
- * array.pop();
- * })
- * .reverse()
- * .value();
- * // => [2, 1]
- */
- function tap(value, interceptor) {
- interceptor(value);
- return value;
- }
-
- /**
- * This method is like `_.tap` except that it returns the result of `interceptor`.
- * The purpose of this method is to "pass thru" values replacing intermediate
- * results in a method chain sequence.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Seq
- * @param {*} value The value to provide to `interceptor`.
- * @param {Function} interceptor The function to invoke.
- * @returns {*} Returns the result of `interceptor`.
- * @example
- *
- * _(' abc ')
- * .chain()
- * .trim()
- * .thru(function(value) {
- * return [value];
- * })
- * .value();
- * // => ['abc']
- */
- function thru(value, interceptor) {
- return interceptor(value);
- }
-
- /**
- * This method is the wrapper version of `_.at`.
- *
- * @name at
- * @memberOf _
- * @since 1.0.0
- * @category Seq
- * @param {...(string|string[])} [paths] The property paths to pick.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
- *
- * _(object).at(['a[0].b.c', 'a[1]']).value();
- * // => [3, 4]
- */
- var wrapperAt = flatRest(function(paths) {
- var length = paths.length,
- start = length ? paths[0] : 0,
- value = this.__wrapped__,
- interceptor = function(object) { return baseAt(object, paths); };
-
- if (length > 1 || this.__actions__.length ||
- !(value instanceof LazyWrapper) || !isIndex(start)) {
- return this.thru(interceptor);
- }
- value = value.slice(start, +start + (length ? 1 : 0));
- value.__actions__.push({
- 'func': thru,
- 'args': [interceptor],
- 'thisArg': undefined
- });
- return new LodashWrapper(value, this.__chain__).thru(function(array) {
- if (length && !array.length) {
- array.push(undefined);
- }
- return array;
- });
- });
-
- /**
- * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
- *
- * @name chain
- * @memberOf _
- * @since 0.1.0
- * @category Seq
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 }
- * ];
- *
- * // A sequence without explicit chaining.
- * _(users).head();
- * // => { 'user': 'barney', 'age': 36 }
- *
- * // A sequence with explicit chaining.
- * _(users)
- * .chain()
- * .head()
- * .pick('user')
- * .value();
- * // => { 'user': 'barney' }
- */
- function wrapperChain() {
- return chain(this);
- }
-
- /**
- * Executes the chain sequence and returns the wrapped result.
- *
- * @name commit
- * @memberOf _
- * @since 3.2.0
- * @category Seq
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2];
- * var wrapped = _(array).push(3);
- *
- * console.log(array);
- * // => [1, 2]
- *
- * wrapped = wrapped.commit();
- * console.log(array);
- * // => [1, 2, 3]
- *
- * wrapped.last();
- * // => 3
- *
- * console.log(array);
- * // => [1, 2, 3]
- */
- function wrapperCommit() {
- return new LodashWrapper(this.value(), this.__chain__);
- }
-
- /**
- * Gets the next value on a wrapped object following the
- * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
- *
- * @name next
- * @memberOf _
- * @since 4.0.0
- * @category Seq
- * @returns {Object} Returns the next iterator value.
- * @example
- *
- * var wrapped = _([1, 2]);
- *
- * wrapped.next();
- * // => { 'done': false, 'value': 1 }
- *
- * wrapped.next();
- * // => { 'done': false, 'value': 2 }
- *
- * wrapped.next();
- * // => { 'done': true, 'value': undefined }
- */
- function wrapperNext() {
- if (this.__values__ === undefined) {
- this.__values__ = toArray(this.value());
- }
- var done = this.__index__ >= this.__values__.length,
- value = done ? undefined : this.__values__[this.__index__++];
-
- return { 'done': done, 'value': value };
- }
-
- /**
- * Enables the wrapper to be iterable.
- *
- * @name Symbol.iterator
- * @memberOf _
- * @since 4.0.0
- * @category Seq
- * @returns {Object} Returns the wrapper object.
- * @example
- *
- * var wrapped = _([1, 2]);
- *
- * wrapped[Symbol.iterator]() === wrapped;
- * // => true
- *
- * Array.from(wrapped);
- * // => [1, 2]
- */
- function wrapperToIterator() {
- return this;
- }
-
- /**
- * Creates a clone of the chain sequence planting `value` as the wrapped value.
- *
- * @name plant
- * @memberOf _
- * @since 3.2.0
- * @category Seq
- * @param {*} value The value to plant.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var wrapped = _([1, 2]).map(square);
- * var other = wrapped.plant([3, 4]);
- *
- * other.value();
- * // => [9, 16]
- *
- * wrapped.value();
- * // => [1, 4]
- */
- function wrapperPlant(value) {
- var result,
- parent = this;
-
- while (parent instanceof baseLodash) {
- var clone = wrapperClone(parent);
- clone.__index__ = 0;
- clone.__values__ = undefined;
- if (result) {
- previous.__wrapped__ = clone;
- } else {
- result = clone;
- }
- var previous = clone;
- parent = parent.__wrapped__;
- }
- previous.__wrapped__ = value;
- return result;
- }
-
- /**
- * This method is the wrapper version of `_.reverse`.
- *
- * **Note:** This method mutates the wrapped array.
- *
- * @name reverse
- * @memberOf _
- * @since 0.1.0
- * @category Seq
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _(array).reverse().value()
- * // => [3, 2, 1]
- *
- * console.log(array);
- * // => [3, 2, 1]
- */
- function wrapperReverse() {
- var value = this.__wrapped__;
- if (value instanceof LazyWrapper) {
- var wrapped = value;
- if (this.__actions__.length) {
- wrapped = new LazyWrapper(this);
- }
- wrapped = wrapped.reverse();
- wrapped.__actions__.push({
- 'func': thru,
- 'args': [reverse],
- 'thisArg': undefined
- });
- return new LodashWrapper(wrapped, this.__chain__);
- }
- return this.thru(reverse);
- }
-
- /**
- * Executes the chain sequence to resolve the unwrapped value.
- *
- * @name value
- * @memberOf _
- * @since 0.1.0
- * @alias toJSON, valueOf
- * @category Seq
- * @returns {*} Returns the resolved unwrapped value.
- * @example
- *
- * _([1, 2, 3]).value();
- * // => [1, 2, 3]
- */
- function wrapperValue() {
- return baseWrapperValue(this.__wrapped__, this.__actions__);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` thru `iteratee`. The corresponding value of
- * each key is the number of times the key was returned by `iteratee`. The
- * iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 0.5.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * _.countBy([6.1, 4.2, 6.3], Math.floor);
- * // => { '4': 1, '6': 2 }
- *
- * // The `_.property` iteratee shorthand.
- * _.countBy(['one', 'two', 'three'], 'length');
- * // => { '3': 2, '5': 1 }
- */
- var countBy = createAggregator(function(result, value, key) {
- if (hasOwnProperty.call(result, key)) {
- ++result[key];
- } else {
- baseAssignValue(result, key, 1);
- }
- });
-
- /**
- * Checks if `predicate` returns truthy for **all** elements of `collection`.
- * Iteration is stopped once `predicate` returns falsey. The predicate is
- * invoked with three arguments: (value, index|key, collection).
- *
- * **Note:** This method returns `true` for
- * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
- * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
- * elements of empty collections.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- * @example
- *
- * _.every([true, 1, null, 'yes'], Boolean);
- * // => false
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * // The `_.matches` iteratee shorthand.
- * _.every(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.every(users, ['active', false]);
- * // => true
- *
- * // The `_.property` iteratee shorthand.
- * _.every(users, 'active');
- * // => false
- */
- function every(collection, predicate, guard) {
- var func = isArray(collection) ? arrayEvery : baseEvery;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined;
- }
- return func(collection, getIteratee(predicate, 3));
- }
-
- /**
- * Iterates over elements of `collection`, returning an array of all elements
- * `predicate` returns truthy for. The predicate is invoked with three
- * arguments: (value, index|key, collection).
- *
- * **Note:** Unlike `_.remove`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- * @see _.reject
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * _.filter(users, function(o) { return !o.active; });
- * // => objects for ['fred']
- *
- * // The `_.matches` iteratee shorthand.
- * _.filter(users, { 'age': 36, 'active': true });
- * // => objects for ['barney']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.filter(users, ['active', false]);
- * // => objects for ['fred']
- *
- * // The `_.property` iteratee shorthand.
- * _.filter(users, 'active');
- * // => objects for ['barney']
- */
- function filter(collection, predicate) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- return func(collection, getIteratee(predicate, 3));
- }
-
- /**
- * Iterates over elements of `collection`, returning the first element
- * `predicate` returns truthy for. The predicate is invoked with three
- * arguments: (value, index|key, collection).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=0] The index to search from.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false },
- * { 'user': 'pebbles', 'age': 1, 'active': true }
- * ];
- *
- * _.find(users, function(o) { return o.age < 40; });
- * // => object for 'barney'
- *
- * // The `_.matches` iteratee shorthand.
- * _.find(users, { 'age': 1, 'active': true });
- * // => object for 'pebbles'
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.find(users, ['active', false]);
- * // => object for 'fred'
- *
- * // The `_.property` iteratee shorthand.
- * _.find(users, 'active');
- * // => object for 'barney'
- */
- var find = createFind(findIndex);
-
- /**
- * This method is like `_.find` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=collection.length-1] The index to search from.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * _.findLast([1, 2, 3, 4], function(n) {
- * return n % 2 == 1;
- * });
- * // => 3
- */
- var findLast = createFind(findLastIndex);
-
- /**
- * Creates a flattened array of values by running each element in `collection`
- * thru `iteratee` and flattening the mapped results. The iteratee is invoked
- * with three arguments: (value, index|key, collection).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * function duplicate(n) {
- * return [n, n];
- * }
- *
- * _.flatMap([1, 2], duplicate);
- * // => [1, 1, 2, 2]
- */
- function flatMap(collection, iteratee) {
- return baseFlatten(map(collection, iteratee), 1);
- }
-
- /**
- * This method is like `_.flatMap` except that it recursively flattens the
- * mapped results.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * function duplicate(n) {
- * return [[[n, n]]];
- * }
- *
- * _.flatMapDeep([1, 2], duplicate);
- * // => [1, 1, 2, 2]
- */
- function flatMapDeep(collection, iteratee) {
- return baseFlatten(map(collection, iteratee), INFINITY);
- }
-
- /**
- * This method is like `_.flatMap` except that it recursively flattens the
- * mapped results up to `depth` times.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {number} [depth=1] The maximum recursion depth.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * function duplicate(n) {
- * return [[[n, n]]];
- * }
- *
- * _.flatMapDepth([1, 2], duplicate, 2);
- * // => [[1, 1], [2, 2]]
- */
- function flatMapDepth(collection, iteratee, depth) {
- depth = depth === undefined ? 1 : toInteger(depth);
- return baseFlatten(map(collection, iteratee), depth);
- }
-
- /**
- * Iterates over elements of `collection` and invokes `iteratee` for each element.
- * The iteratee is invoked with three arguments: (value, index|key, collection).
- * Iteratee functions may exit iteration early by explicitly returning `false`.
- *
- * **Note:** As with other "Collections" methods, objects with a "length"
- * property are iterated like arrays. To avoid this behavior use `_.forIn`
- * or `_.forOwn` for object iteration.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @alias each
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- * @see _.forEachRight
- * @example
- *
- * _.forEach([1, 2], function(value) {
- * console.log(value);
- * });
- * // => Logs `1` then `2`.
- *
- * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'a' then 'b' (iteration order is not guaranteed).
- */
- function forEach(collection, iteratee) {
- var func = isArray(collection) ? arrayEach : baseEach;
- return func(collection, getIteratee(iteratee, 3));
- }
-
- /**
- * This method is like `_.forEach` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @alias eachRight
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- * @see _.forEach
- * @example
- *
- * _.forEachRight([1, 2], function(value) {
- * console.log(value);
- * });
- * // => Logs `2` then `1`.
- */
- function forEachRight(collection, iteratee) {
- var func = isArray(collection) ? arrayEachRight : baseEachRight;
- return func(collection, getIteratee(iteratee, 3));
- }
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` thru `iteratee`. The order of grouped values
- * is determined by the order they occur in `collection`. The corresponding
- * value of each key is an array of elements responsible for generating the
- * key. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * _.groupBy([6.1, 4.2, 6.3], Math.floor);
- * // => { '4': [4.2], '6': [6.1, 6.3] }
- *
- * // The `_.property` iteratee shorthand.
- * _.groupBy(['one', 'two', 'three'], 'length');
- * // => { '3': ['one', 'two'], '5': ['three'] }
- */
- var groupBy = createAggregator(function(result, value, key) {
- if (hasOwnProperty.call(result, key)) {
- result[key].push(value);
- } else {
- baseAssignValue(result, key, [value]);
- }
- });
-
- /**
- * Checks if `value` is in `collection`. If `collection` is a string, it's
- * checked for a substring of `value`, otherwise
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * is used for equality comparisons. If `fromIndex` is negative, it's used as
- * the offset from the end of `collection`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object|string} collection The collection to inspect.
- * @param {*} value The value to search for.
- * @param {number} [fromIndex=0] The index to search from.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
- * @returns {boolean} Returns `true` if `value` is found, else `false`.
- * @example
- *
- * _.includes([1, 2, 3], 1);
- * // => true
- *
- * _.includes([1, 2, 3], 1, 2);
- * // => false
- *
- * _.includes({ 'a': 1, 'b': 2 }, 1);
- * // => true
- *
- * _.includes('abcd', 'bc');
- * // => true
- */
- function includes(collection, value, fromIndex, guard) {
- collection = isArrayLike(collection) ? collection : values(collection);
- fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
-
- var length = collection.length;
- if (fromIndex < 0) {
- fromIndex = nativeMax(length + fromIndex, 0);
- }
- return isString(collection)
- ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
- : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
- }
-
- /**
- * Invokes the method at `path` of each element in `collection`, returning
- * an array of the results of each invoked method. Any additional arguments
- * are provided to each invoked method. If `path` is a function, it's invoked
- * for, and `this` bound to, each element in `collection`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Array|Function|string} path The path of the method to invoke or
- * the function invoked per iteration.
- * @param {...*} [args] The arguments to invoke each method with.
- * @returns {Array} Returns the array of results.
- * @example
- *
- * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
- * // => [[1, 5, 7], [1, 2, 3]]
- *
- * _.invokeMap([123, 456], String.prototype.split, '');
- * // => [['1', '2', '3'], ['4', '5', '6']]
- */
- var invokeMap = baseRest(function(collection, path, args) {
- var index = -1,
- isFunc = typeof path == 'function',
- result = isArrayLike(collection) ? Array(collection.length) : [];
-
- baseEach(collection, function(value) {
- result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
- });
- return result;
- });
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` thru `iteratee`. The corresponding value of
- * each key is the last element responsible for generating the key. The
- * iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * var array = [
- * { 'dir': 'left', 'code': 97 },
- * { 'dir': 'right', 'code': 100 }
- * ];
- *
- * _.keyBy(array, function(o) {
- * return String.fromCharCode(o.code);
- * });
- * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
- *
- * _.keyBy(array, 'dir');
- * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
- */
- var keyBy = createAggregator(function(result, value, key) {
- baseAssignValue(result, key, value);
- });
-
- /**
- * Creates an array of values by running each element in `collection` thru
- * `iteratee`. The iteratee is invoked with three arguments:
- * (value, index|key, collection).
- *
- * Many lodash methods are guarded to work as iteratees for methods like
- * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
- *
- * The guarded methods are:
- * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
- * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
- * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
- * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * _.map([4, 8], square);
- * // => [16, 64]
- *
- * _.map({ 'a': 4, 'b': 8 }, square);
- * // => [16, 64] (iteration order is not guaranteed)
- *
- * var users = [
- * { 'user': 'barney' },
- * { 'user': 'fred' }
- * ];
- *
- * // The `_.property` iteratee shorthand.
- * _.map(users, 'user');
- * // => ['barney', 'fred']
- */
- function map(collection, iteratee) {
- var func = isArray(collection) ? arrayMap : baseMap;
- return func(collection, getIteratee(iteratee, 3));
- }
-
- /**
- * This method is like `_.sortBy` except that it allows specifying the sort
- * orders of the iteratees to sort by. If `orders` is unspecified, all values
- * are sorted in ascending order. Otherwise, specify an order of "desc" for
- * descending or "asc" for ascending sort order of corresponding values.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
- * The iteratees to sort by.
- * @param {string[]} [orders] The sort orders of `iteratees`.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * var users = [
- * { 'user': 'fred', 'age': 48 },
- * { 'user': 'barney', 'age': 34 },
- * { 'user': 'fred', 'age': 40 },
- * { 'user': 'barney', 'age': 36 }
- * ];
- *
- * // Sort by `user` in ascending order and by `age` in descending order.
- * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
- * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
- */
- function orderBy(collection, iteratees, orders, guard) {
- if (collection == null) {
- return [];
- }
- if (!isArray(iteratees)) {
- iteratees = iteratees == null ? [] : [iteratees];
- }
- orders = guard ? undefined : orders;
- if (!isArray(orders)) {
- orders = orders == null ? [] : [orders];
- }
- return baseOrderBy(collection, iteratees, orders);
- }
-
- /**
- * Creates an array of elements split into two groups, the first of which
- * contains elements `predicate` returns truthy for, the second of which
- * contains elements `predicate` returns falsey for. The predicate is
- * invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the array of grouped elements.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': true },
- * { 'user': 'pebbles', 'age': 1, 'active': false }
- * ];
- *
- * _.partition(users, function(o) { return o.active; });
- * // => objects for [['fred'], ['barney', 'pebbles']]
- *
- * // The `_.matches` iteratee shorthand.
- * _.partition(users, { 'age': 1, 'active': false });
- * // => objects for [['pebbles'], ['barney', 'fred']]
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.partition(users, ['active', false]);
- * // => objects for [['barney', 'pebbles'], ['fred']]
- *
- * // The `_.property` iteratee shorthand.
- * _.partition(users, 'active');
- * // => objects for [['fred'], ['barney', 'pebbles']]
- */
- var partition = createAggregator(function(result, value, key) {
- result[key ? 0 : 1].push(value);
- }, function() { return [[], []]; });
-
- /**
- * Reduces `collection` to a value which is the accumulated result of running
- * each element in `collection` thru `iteratee`, where each successive
- * invocation is supplied the return value of the previous. If `accumulator`
- * is not given, the first element of `collection` is used as the initial
- * value. The iteratee is invoked with four arguments:
- * (accumulator, value, index|key, collection).
- *
- * Many lodash methods are guarded to work as iteratees for methods like
- * `_.reduce`, `_.reduceRight`, and `_.transform`.
- *
- * The guarded methods are:
- * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
- * and `sortBy`
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @returns {*} Returns the accumulated value.
- * @see _.reduceRight
- * @example
- *
- * _.reduce([1, 2], function(sum, n) {
- * return sum + n;
- * }, 0);
- * // => 3
- *
- * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
- * (result[value] || (result[value] = [])).push(key);
- * return result;
- * }, {});
- * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
- */
- function reduce(collection, iteratee, accumulator) {
- var func = isArray(collection) ? arrayReduce : baseReduce,
- initAccum = arguments.length < 3;
-
- return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
- }
-
- /**
- * This method is like `_.reduce` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @returns {*} Returns the accumulated value.
- * @see _.reduce
- * @example
- *
- * var array = [[0, 1], [2, 3], [4, 5]];
- *
- * _.reduceRight(array, function(flattened, other) {
- * return flattened.concat(other);
- * }, []);
- * // => [4, 5, 2, 3, 0, 1]
- */
- function reduceRight(collection, iteratee, accumulator) {
- var func = isArray(collection) ? arrayReduceRight : baseReduce,
- initAccum = arguments.length < 3;
-
- return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
- }
-
- /**
- * The opposite of `_.filter`; this method returns the elements of `collection`
- * that `predicate` does **not** return truthy for.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- * @see _.filter
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': true }
- * ];
- *
- * _.reject(users, function(o) { return !o.active; });
- * // => objects for ['fred']
- *
- * // The `_.matches` iteratee shorthand.
- * _.reject(users, { 'age': 40, 'active': true });
- * // => objects for ['barney']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.reject(users, ['active', false]);
- * // => objects for ['fred']
- *
- * // The `_.property` iteratee shorthand.
- * _.reject(users, 'active');
- * // => objects for ['barney']
- */
- function reject(collection, predicate) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- return func(collection, negate(getIteratee(predicate, 3)));
- }
-
- /**
- * Gets a random element from `collection`.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to sample.
- * @returns {*} Returns the random element.
- * @example
- *
- * _.sample([1, 2, 3, 4]);
- * // => 2
- */
- function sample(collection) {
- var func = isArray(collection) ? arraySample : baseSample;
- return func(collection);
- }
-
- /**
- * Gets `n` random elements at unique keys from `collection` up to the
- * size of `collection`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to sample.
- * @param {number} [n=1] The number of elements to sample.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the random elements.
- * @example
- *
- * _.sampleSize([1, 2, 3], 2);
- * // => [3, 1]
- *
- * _.sampleSize([1, 2, 3], 4);
- * // => [2, 3, 1]
- */
- function sampleSize(collection, n, guard) {
- if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
- n = 1;
- } else {
- n = toInteger(n);
- }
- var func = isArray(collection) ? arraySampleSize : baseSampleSize;
- return func(collection, n);
- }
-
- /**
- * Creates an array of shuffled values, using a version of the
- * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to shuffle.
- * @returns {Array} Returns the new shuffled array.
- * @example
- *
- * _.shuffle([1, 2, 3, 4]);
- * // => [4, 1, 3, 2]
- */
- function shuffle(collection) {
- var func = isArray(collection) ? arrayShuffle : baseShuffle;
- return func(collection);
- }
-
- /**
- * Gets the size of `collection` by returning its length for array-like
- * values or the number of own enumerable string keyed properties for objects.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object|string} collection The collection to inspect.
- * @returns {number} Returns the collection size.
- * @example
- *
- * _.size([1, 2, 3]);
- * // => 3
- *
- * _.size({ 'a': 1, 'b': 2 });
- * // => 2
- *
- * _.size('pebbles');
- * // => 7
- */
- function size(collection) {
- if (collection == null) {
- return 0;
- }
- if (isArrayLike(collection)) {
- return isString(collection) ? stringSize(collection) : collection.length;
- }
- var tag = getTag(collection);
- if (tag == mapTag || tag == setTag) {
- return collection.size;
- }
- return baseKeys(collection).length;
- }
-
- /**
- * Checks if `predicate` returns truthy for **any** element of `collection`.
- * Iteration is stopped once `predicate` returns truthy. The predicate is
- * invoked with three arguments: (value, index|key, collection).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- * @example
- *
- * _.some([null, 0, 'yes', false], Boolean);
- * // => true
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false }
- * ];
- *
- * // The `_.matches` iteratee shorthand.
- * _.some(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.some(users, ['active', false]);
- * // => true
- *
- * // The `_.property` iteratee shorthand.
- * _.some(users, 'active');
- * // => true
- */
- function some(collection, predicate, guard) {
- var func = isArray(collection) ? arraySome : baseSome;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined;
- }
- return func(collection, getIteratee(predicate, 3));
- }
-
- /**
- * Creates an array of elements, sorted in ascending order by the results of
- * running each element in a collection thru each iteratee. This method
- * performs a stable sort, that is, it preserves the original sort order of
- * equal elements. The iteratees are invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {...(Function|Function[])} [iteratees=[_.identity]]
- * The iteratees to sort by.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * var users = [
- * { 'user': 'fred', 'age': 48 },
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 },
- * { 'user': 'barney', 'age': 34 }
- * ];
- *
- * _.sortBy(users, [function(o) { return o.user; }]);
- * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
- *
- * _.sortBy(users, ['user', 'age']);
- * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
- */
- var sortBy = baseRest(function(collection, iteratees) {
- if (collection == null) {
- return [];
- }
- var length = iteratees.length;
- if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
- iteratees = [];
- } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
- iteratees = [iteratees[0]];
- }
- return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
- });
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Gets the timestamp of the number of milliseconds that have elapsed since
- * the Unix epoch (1 January 1970 00:00:00 UTC).
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Date
- * @returns {number} Returns the timestamp.
- * @example
- *
- * _.defer(function(stamp) {
- * console.log(_.now() - stamp);
- * }, _.now());
- * // => Logs the number of milliseconds it took for the deferred invocation.
- */
- var now = ctxNow || function() {
- return root.Date.now();
- };
-
- /*------------------------------------------------------------------------*/
-
- /**
- * The opposite of `_.before`; this method creates a function that invokes
- * `func` once it's called `n` or more times.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {number} n The number of calls before `func` is invoked.
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * var saves = ['profile', 'settings'];
- *
- * var done = _.after(saves.length, function() {
- * console.log('done saving!');
- * });
- *
- * _.forEach(saves, function(type) {
- * asyncSave({ 'type': type, 'complete': done });
- * });
- * // => Logs 'done saving!' after the two async saves have completed.
- */
- function after(n, func) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- n = toInteger(n);
- return function() {
- if (--n < 1) {
- return func.apply(this, arguments);
- }
- };
- }
-
- /**
- * Creates a function that invokes `func`, with up to `n` arguments,
- * ignoring any additional arguments.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} func The function to cap arguments for.
- * @param {number} [n=func.length] The arity cap.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the new capped function.
- * @example
- *
- * _.map(['6', '8', '10'], _.ary(parseInt, 1));
- * // => [6, 8, 10]
- */
- function ary(func, n, guard) {
- n = guard ? undefined : n;
- n = (func && n == null) ? func.length : n;
- return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
- }
-
- /**
- * Creates a function that invokes `func`, with the `this` binding and arguments
- * of the created function, while it's called less than `n` times. Subsequent
- * calls to the created function return the result of the last `func` invocation.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {number} n The number of calls at which `func` is no longer invoked.
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * jQuery(element).on('click', _.before(5, addContactToList));
- * // => Allows adding up to 4 contacts to the list.
- */
- function before(n, func) {
- var result;
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- n = toInteger(n);
- return function() {
- if (--n > 0) {
- result = func.apply(this, arguments);
- }
- if (n <= 1) {
- func = undefined;
- }
- return result;
- };
- }
-
- /**
- * Creates a function that invokes `func` with the `this` binding of `thisArg`
- * and `partials` prepended to the arguments it receives.
- *
- * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
- * may be used as a placeholder for partially applied arguments.
- *
- * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
- * property of bound functions.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to bind.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new bound function.
- * @example
- *
- * function greet(greeting, punctuation) {
- * return greeting + ' ' + this.user + punctuation;
- * }
- *
- * var object = { 'user': 'fred' };
- *
- * var bound = _.bind(greet, object, 'hi');
- * bound('!');
- * // => 'hi fred!'
- *
- * // Bound with placeholders.
- * var bound = _.bind(greet, object, _, '!');
- * bound('hi');
- * // => 'hi fred!'
- */
- var bind = baseRest(function(func, thisArg, partials) {
- var bitmask = WRAP_BIND_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bind));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(func, bitmask, thisArg, partials, holders);
- });
-
- /**
- * Creates a function that invokes the method at `object[key]` with `partials`
- * prepended to the arguments it receives.
- *
- * This method differs from `_.bind` by allowing bound functions to reference
- * methods that may be redefined or don't yet exist. See
- * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
- * for more details.
- *
- * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * @static
- * @memberOf _
- * @since 0.10.0
- * @category Function
- * @param {Object} object The object to invoke the method on.
- * @param {string} key The key of the method.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new bound function.
- * @example
- *
- * var object = {
- * 'user': 'fred',
- * 'greet': function(greeting, punctuation) {
- * return greeting + ' ' + this.user + punctuation;
- * }
- * };
- *
- * var bound = _.bindKey(object, 'greet', 'hi');
- * bound('!');
- * // => 'hi fred!'
- *
- * object.greet = function(greeting, punctuation) {
- * return greeting + 'ya ' + this.user + punctuation;
- * };
- *
- * bound('!');
- * // => 'hiya fred!'
- *
- * // Bound with placeholders.
- * var bound = _.bindKey(object, 'greet', _, '!');
- * bound('hi');
- * // => 'hiya fred!'
- */
- var bindKey = baseRest(function(object, key, partials) {
- var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bindKey));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(key, bitmask, object, partials, holders);
- });
-
- /**
- * Creates a function that accepts arguments of `func` and either invokes
- * `func` returning its result, if at least `arity` number of arguments have
- * been provided, or returns a function that accepts the remaining `func`
- * arguments, and so on. The arity of `func` may be specified if `func.length`
- * is not sufficient.
- *
- * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
- * may be used as a placeholder for provided arguments.
- *
- * **Note:** This method doesn't set the "length" property of curried functions.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Function
- * @param {Function} func The function to curry.
- * @param {number} [arity=func.length] The arity of `func`.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the new curried function.
- * @example
- *
- * var abc = function(a, b, c) {
- * return [a, b, c];
- * };
- *
- * var curried = _.curry(abc);
- *
- * curried(1)(2)(3);
- * // => [1, 2, 3]
- *
- * curried(1, 2)(3);
- * // => [1, 2, 3]
- *
- * curried(1, 2, 3);
- * // => [1, 2, 3]
- *
- * // Curried with placeholders.
- * curried(1)(_, 3)(2);
- * // => [1, 2, 3]
- */
- function curry(func, arity, guard) {
- arity = guard ? undefined : arity;
- var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
- result.placeholder = curry.placeholder;
- return result;
- }
-
- /**
- * This method is like `_.curry` except that arguments are applied to `func`
- * in the manner of `_.partialRight` instead of `_.partial`.
- *
- * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for provided arguments.
- *
- * **Note:** This method doesn't set the "length" property of curried functions.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} func The function to curry.
- * @param {number} [arity=func.length] The arity of `func`.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the new curried function.
- * @example
- *
- * var abc = function(a, b, c) {
- * return [a, b, c];
- * };
- *
- * var curried = _.curryRight(abc);
- *
- * curried(3)(2)(1);
- * // => [1, 2, 3]
- *
- * curried(2, 3)(1);
- * // => [1, 2, 3]
- *
- * curried(1, 2, 3);
- * // => [1, 2, 3]
- *
- * // Curried with placeholders.
- * curried(3)(1, _)(2);
- * // => [1, 2, 3]
- */
- function curryRight(func, arity, guard) {
- arity = guard ? undefined : arity;
- var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
- result.placeholder = curryRight.placeholder;
- return result;
- }
-
- /**
- * Creates a debounced function that delays invoking `func` until after `wait`
- * milliseconds have elapsed since the last time the debounced function was
- * invoked. The debounced function comes with a `cancel` method to cancel
- * delayed `func` invocations and a `flush` method to immediately invoke them.
- * Provide `options` to indicate whether `func` should be invoked on the
- * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
- * with the last arguments provided to the debounced function. Subsequent
- * calls to the debounced function return the result of the last `func`
- * invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
- * invoked on the trailing edge of the timeout only if the debounced function
- * is invoked more than once during the `wait` timeout.
- *
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
- *
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
- * for details over the differences between `_.debounce` and `_.throttle`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to debounce.
- * @param {number} [wait=0] The number of milliseconds to delay.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.leading=false]
- * Specify invoking on the leading edge of the timeout.
- * @param {number} [options.maxWait]
- * The maximum time `func` is allowed to be delayed before it's invoked.
- * @param {boolean} [options.trailing=true]
- * Specify invoking on the trailing edge of the timeout.
- * @returns {Function} Returns the new debounced function.
- * @example
- *
- * // Avoid costly calculations while the window size is in flux.
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
- *
- * // Invoke `sendMail` when clicked, debouncing subsequent calls.
- * jQuery(element).on('click', _.debounce(sendMail, 300, {
- * 'leading': true,
- * 'trailing': false
- * }));
- *
- * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
- * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
- * var source = new EventSource('/stream');
- * jQuery(source).on('message', debounced);
- *
- * // Cancel the trailing debounced invocation.
- * jQuery(window).on('popstate', debounced.cancel);
- */
- function debounce(func, wait, options) {
- var lastArgs,
- lastThis,
- maxWait,
- result,
- timerId,
- lastCallTime,
- lastInvokeTime = 0,
- leading = false,
- maxing = false,
- trailing = true;
-
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- wait = toNumber(wait) || 0;
- if (isObject(options)) {
- leading = !!options.leading;
- maxing = 'maxWait' in options;
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
-
- function invokeFunc(time) {
- var args = lastArgs,
- thisArg = lastThis;
-
- lastArgs = lastThis = undefined;
- lastInvokeTime = time;
- result = func.apply(thisArg, args);
- return result;
- }
-
- function leadingEdge(time) {
- // Reset any `maxWait` timer.
- lastInvokeTime = time;
- // Start the timer for the trailing edge.
- timerId = setTimeout(timerExpired, wait);
- // Invoke the leading edge.
- return leading ? invokeFunc(time) : result;
- }
-
- function remainingWait(time) {
- var timeSinceLastCall = time - lastCallTime,
- timeSinceLastInvoke = time - lastInvokeTime,
- result = wait - timeSinceLastCall;
-
- return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
- }
-
- function shouldInvoke(time) {
- var timeSinceLastCall = time - lastCallTime,
- timeSinceLastInvoke = time - lastInvokeTime;
-
- // Either this is the first call, activity has stopped and we're at the
- // trailing edge, the system time has gone backwards and we're treating
- // it as the trailing edge, or we've hit the `maxWait` limit.
- return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
- (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
- }
-
- function timerExpired() {
- var time = now();
- if (shouldInvoke(time)) {
- return trailingEdge(time);
- }
- // Restart the timer.
- timerId = setTimeout(timerExpired, remainingWait(time));
- }
-
- function trailingEdge(time) {
- timerId = undefined;
-
- // Only invoke if we have `lastArgs` which means `func` has been
- // debounced at least once.
- if (trailing && lastArgs) {
- return invokeFunc(time);
- }
- lastArgs = lastThis = undefined;
- return result;
- }
-
- function cancel() {
- if (timerId !== undefined) {
- clearTimeout(timerId);
- }
- lastInvokeTime = 0;
- lastArgs = lastCallTime = lastThis = timerId = undefined;
- }
-
- function flush() {
- return timerId === undefined ? result : trailingEdge(now());
- }
-
- function debounced() {
- var time = now(),
- isInvoking = shouldInvoke(time);
-
- lastArgs = arguments;
- lastThis = this;
- lastCallTime = time;
-
- if (isInvoking) {
- if (timerId === undefined) {
- return leadingEdge(lastCallTime);
- }
- if (maxing) {
- // Handle invocations in a tight loop.
- timerId = setTimeout(timerExpired, wait);
- return invokeFunc(lastCallTime);
- }
- }
- if (timerId === undefined) {
- timerId = setTimeout(timerExpired, wait);
- }
- return result;
- }
- debounced.cancel = cancel;
- debounced.flush = flush;
- return debounced;
- }
-
- /**
- * Defers invoking the `func` until the current call stack has cleared. Any
- * additional arguments are provided to `func` when it's invoked.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to defer.
- * @param {...*} [args] The arguments to invoke `func` with.
- * @returns {number} Returns the timer id.
- * @example
- *
- * _.defer(function(text) {
- * console.log(text);
- * }, 'deferred');
- * // => Logs 'deferred' after one millisecond.
- */
- var defer = baseRest(function(func, args) {
- return baseDelay(func, 1, args);
- });
-
- /**
- * Invokes `func` after `wait` milliseconds. Any additional arguments are
- * provided to `func` when it's invoked.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @param {...*} [args] The arguments to invoke `func` with.
- * @returns {number} Returns the timer id.
- * @example
- *
- * _.delay(function(text) {
- * console.log(text);
- * }, 1000, 'later');
- * // => Logs 'later' after one second.
- */
- var delay = baseRest(function(func, wait, args) {
- return baseDelay(func, toNumber(wait) || 0, args);
- });
-
- /**
- * Creates a function that invokes `func` with arguments reversed.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Function
- * @param {Function} func The function to flip arguments for.
- * @returns {Function} Returns the new flipped function.
- * @example
- *
- * var flipped = _.flip(function() {
- * return _.toArray(arguments);
- * });
- *
- * flipped('a', 'b', 'c', 'd');
- * // => ['d', 'c', 'b', 'a']
- */
- function flip(func) {
- return createWrap(func, WRAP_FLIP_FLAG);
- }
-
- /**
- * Creates a function that memoizes the result of `func`. If `resolver` is
- * provided, it determines the cache key for storing the result based on the
- * arguments provided to the memoized function. By default, the first argument
- * provided to the memoized function is used as the map cache key. The `func`
- * is invoked with the `this` binding of the memoized function.
- *
- * **Note:** The cache is exposed as the `cache` property on the memoized
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
- * constructor with one whose instances implement the
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
- * method interface of `clear`, `delete`, `get`, `has`, and `set`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to have its output memoized.
- * @param {Function} [resolver] The function to resolve the cache key.
- * @returns {Function} Returns the new memoized function.
- * @example
- *
- * var object = { 'a': 1, 'b': 2 };
- * var other = { 'c': 3, 'd': 4 };
- *
- * var values = _.memoize(_.values);
- * values(object);
- * // => [1, 2]
- *
- * values(other);
- * // => [3, 4]
- *
- * object.a = 2;
- * values(object);
- * // => [1, 2]
- *
- * // Modify the result cache.
- * values.cache.set(object, ['a', 'b']);
- * values(object);
- * // => ['a', 'b']
- *
- * // Replace `_.memoize.Cache`.
- * _.memoize.Cache = WeakMap;
- */
- function memoize(func, resolver) {
- if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var memoized = function() {
- var args = arguments,
- key = resolver ? resolver.apply(this, args) : args[0],
- cache = memoized.cache;
-
- if (cache.has(key)) {
- return cache.get(key);
- }
- var result = func.apply(this, args);
- memoized.cache = cache.set(key, result) || cache;
- return result;
- };
- memoized.cache = new (memoize.Cache || MapCache);
- return memoized;
- }
-
- // Expose `MapCache`.
- memoize.Cache = MapCache;
-
- /**
- * Creates a function that negates the result of the predicate `func`. The
- * `func` predicate is invoked with the `this` binding and arguments of the
- * created function.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} predicate The predicate to negate.
- * @returns {Function} Returns the new negated function.
- * @example
- *
- * function isEven(n) {
- * return n % 2 == 0;
- * }
- *
- * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
- * // => [1, 3, 5]
- */
- function negate(predicate) {
- if (typeof predicate != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return function() {
- var args = arguments;
- switch (args.length) {
- case 0: return !predicate.call(this);
- case 1: return !predicate.call(this, args[0]);
- case 2: return !predicate.call(this, args[0], args[1]);
- case 3: return !predicate.call(this, args[0], args[1], args[2]);
- }
- return !predicate.apply(this, args);
- };
- }
-
- /**
- * Creates a function that is restricted to invoking `func` once. Repeat calls
- * to the function return the value of the first invocation. The `func` is
- * invoked with the `this` binding and arguments of the created function.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * var initialize = _.once(createApplication);
- * initialize();
- * initialize();
- * // => `createApplication` is invoked once
- */
- function once(func) {
- return before(2, func);
- }
-
- /**
- * Creates a function that invokes `func` with its arguments transformed.
- *
- * @static
- * @since 4.0.0
- * @memberOf _
- * @category Function
- * @param {Function} func The function to wrap.
- * @param {...(Function|Function[])} [transforms=[_.identity]]
- * The argument transforms.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function doubled(n) {
- * return n * 2;
- * }
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var func = _.overArgs(function(x, y) {
- * return [x, y];
- * }, [square, doubled]);
- *
- * func(9, 3);
- * // => [81, 6]
- *
- * func(10, 5);
- * // => [100, 10]
- */
- var overArgs = castRest(function(func, transforms) {
- transforms = (transforms.length == 1 && isArray(transforms[0]))
- ? arrayMap(transforms[0], baseUnary(getIteratee()))
- : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
-
- var funcsLength = transforms.length;
- return baseRest(function(args) {
- var index = -1,
- length = nativeMin(args.length, funcsLength);
-
- while (++index < length) {
- args[index] = transforms[index].call(this, args[index]);
- }
- return apply(func, this, args);
- });
- });
-
- /**
- * Creates a function that invokes `func` with `partials` prepended to the
- * arguments it receives. This method is like `_.bind` except it does **not**
- * alter the `this` binding.
- *
- * The `_.partial.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * **Note:** This method doesn't set the "length" property of partially
- * applied functions.
- *
- * @static
- * @memberOf _
- * @since 0.2.0
- * @category Function
- * @param {Function} func The function to partially apply arguments to.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new partially applied function.
- * @example
- *
- * function greet(greeting, name) {
- * return greeting + ' ' + name;
- * }
- *
- * var sayHelloTo = _.partial(greet, 'hello');
- * sayHelloTo('fred');
- * // => 'hello fred'
- *
- * // Partially applied with placeholders.
- * var greetFred = _.partial(greet, _, 'fred');
- * greetFred('hi');
- * // => 'hi fred'
- */
- var partial = baseRest(function(func, partials) {
- var holders = replaceHolders(partials, getHolder(partial));
- return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
- });
-
- /**
- * This method is like `_.partial` except that partially applied arguments
- * are appended to the arguments it receives.
- *
- * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * **Note:** This method doesn't set the "length" property of partially
- * applied functions.
- *
- * @static
- * @memberOf _
- * @since 1.0.0
- * @category Function
- * @param {Function} func The function to partially apply arguments to.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new partially applied function.
- * @example
- *
- * function greet(greeting, name) {
- * return greeting + ' ' + name;
- * }
- *
- * var greetFred = _.partialRight(greet, 'fred');
- * greetFred('hi');
- * // => 'hi fred'
- *
- * // Partially applied with placeholders.
- * var sayHelloTo = _.partialRight(greet, 'hello', _);
- * sayHelloTo('fred');
- * // => 'hello fred'
- */
- var partialRight = baseRest(function(func, partials) {
- var holders = replaceHolders(partials, getHolder(partialRight));
- return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
- });
-
- /**
- * Creates a function that invokes `func` with arguments arranged according
- * to the specified `indexes` where the argument value at the first index is
- * provided as the first argument, the argument value at the second index is
- * provided as the second argument, and so on.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} func The function to rearrange arguments for.
- * @param {...(number|number[])} indexes The arranged argument indexes.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var rearged = _.rearg(function(a, b, c) {
- * return [a, b, c];
- * }, [2, 0, 1]);
- *
- * rearged('b', 'c', 'a')
- * // => ['a', 'b', 'c']
- */
- var rearg = flatRest(function(func, indexes) {
- return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
- });
-
- /**
- * Creates a function that invokes `func` with the `this` binding of the
- * created function and arguments from `start` and beyond provided as
- * an array.
- *
- * **Note:** This method is based on the
- * [rest parameter](https://mdn.io/rest_parameters).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Function
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.rest(function(what, names) {
- * return what + ' ' + _.initial(names).join(', ') +
- * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
- * });
- *
- * say('hello', 'fred', 'barney', 'pebbles');
- * // => 'hello fred, barney, & pebbles'
- */
- function rest(func, start) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- start = start === undefined ? start : toInteger(start);
- return baseRest(func, start);
- }
-
- /**
- * Creates a function that invokes `func` with the `this` binding of the
- * create function and an array of arguments much like
- * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
- *
- * **Note:** This method is based on the
- * [spread operator](https://mdn.io/spread_operator).
- *
- * @static
- * @memberOf _
- * @since 3.2.0
- * @category Function
- * @param {Function} func The function to spread arguments over.
- * @param {number} [start=0] The start position of the spread.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.spread(function(who, what) {
- * return who + ' says ' + what;
- * });
- *
- * say(['fred', 'hello']);
- * // => 'fred says hello'
- *
- * var numbers = Promise.all([
- * Promise.resolve(40),
- * Promise.resolve(36)
- * ]);
- *
- * numbers.then(_.spread(function(x, y) {
- * return x + y;
- * }));
- * // => a Promise of 76
- */
- function spread(func, start) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- start = start == null ? 0 : nativeMax(toInteger(start), 0);
- return baseRest(function(args) {
- var array = args[start],
- otherArgs = castSlice(args, 0, start);
-
- if (array) {
- arrayPush(otherArgs, array);
- }
- return apply(func, this, otherArgs);
- });
- }
-
- /**
- * Creates a throttled function that only invokes `func` at most once per
- * every `wait` milliseconds. The throttled function comes with a `cancel`
- * method to cancel delayed `func` invocations and a `flush` method to
- * immediately invoke them. Provide `options` to indicate whether `func`
- * should be invoked on the leading and/or trailing edge of the `wait`
- * timeout. The `func` is invoked with the last arguments provided to the
- * throttled function. Subsequent calls to the throttled function return the
- * result of the last `func` invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
- * invoked on the trailing edge of the timeout only if the throttled function
- * is invoked more than once during the `wait` timeout.
- *
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
- *
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
- * for details over the differences between `_.throttle` and `_.debounce`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to throttle.
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.leading=true]
- * Specify invoking on the leading edge of the timeout.
- * @param {boolean} [options.trailing=true]
- * Specify invoking on the trailing edge of the timeout.
- * @returns {Function} Returns the new throttled function.
- * @example
- *
- * // Avoid excessively updating the position while scrolling.
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
- *
- * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
- * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
- * jQuery(element).on('click', throttled);
- *
- * // Cancel the trailing throttled invocation.
- * jQuery(window).on('popstate', throttled.cancel);
- */
- function throttle(func, wait, options) {
- var leading = true,
- trailing = true;
-
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (isObject(options)) {
- leading = 'leading' in options ? !!options.leading : leading;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
- return debounce(func, wait, {
- 'leading': leading,
- 'maxWait': wait,
- 'trailing': trailing
- });
- }
-
- /**
- * Creates a function that accepts up to one argument, ignoring any
- * additional arguments.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Function
- * @param {Function} func The function to cap arguments for.
- * @returns {Function} Returns the new capped function.
- * @example
- *
- * _.map(['6', '8', '10'], _.unary(parseInt));
- * // => [6, 8, 10]
- */
- function unary(func) {
- return ary(func, 1);
- }
-
- /**
- * Creates a function that provides `value` to `wrapper` as its first
- * argument. Any additional arguments provided to the function are appended
- * to those provided to the `wrapper`. The wrapper is invoked with the `this`
- * binding of the created function.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {*} value The value to wrap.
- * @param {Function} [wrapper=identity] The wrapper function.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var p = _.wrap(_.escape, function(func, text) {
- * return '<p>' + func(text) + '</p>';
- * });
- *
- * p('fred, barney, & pebbles');
- * // => '<p>fred, barney, &amp; pebbles</p>'
- */
- function wrap(value, wrapper) {
- return partial(castFunction(wrapper), value);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Casts `value` as an array if it's not one.
- *
- * @static
- * @memberOf _
- * @since 4.4.0
- * @category Lang
- * @param {*} value The value to inspect.
- * @returns {Array} Returns the cast array.
- * @example
- *
- * _.castArray(1);
- * // => [1]
- *
- * _.castArray({ 'a': 1 });
- * // => [{ 'a': 1 }]
- *
- * _.castArray('abc');
- * // => ['abc']
- *
- * _.castArray(null);
- * // => [null]
- *
- * _.castArray(undefined);
- * // => [undefined]
- *
- * _.castArray();
- * // => []
- *
- * var array = [1, 2, 3];
- * console.log(_.castArray(array) === array);
- * // => true
- */
- function castArray() {
- if (!arguments.length) {
- return [];
- }
- var value = arguments[0];
- return isArray(value) ? value : [value];
- }
-
- /**
- * Creates a shallow clone of `value`.
- *
- * **Note:** This method is loosely based on the
- * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
- * and supports cloning arrays, array buffers, booleans, date objects, maps,
- * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
- * arrays. The own enumerable properties of `arguments` objects are cloned
- * as plain objects. An empty object is returned for uncloneable values such
- * as error objects, functions, DOM nodes, and WeakMaps.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to clone.
- * @returns {*} Returns the cloned value.
- * @see _.cloneDeep
- * @example
- *
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
- *
- * var shallow = _.clone(objects);
- * console.log(shallow[0] === objects[0]);
- * // => true
- */
- function clone(value) {
- return baseClone(value, CLONE_SYMBOLS_FLAG);
- }
-
- /**
- * This method is like `_.clone` except that it accepts `customizer` which
- * is invoked to produce the cloned value. If `customizer` returns `undefined`,
- * cloning is handled by the method instead. The `customizer` is invoked with
- * up to four arguments; (value [, index|key, object, stack]).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to clone.
- * @param {Function} [customizer] The function to customize cloning.
- * @returns {*} Returns the cloned value.
- * @see _.cloneDeepWith
- * @example
- *
- * function customizer(value) {
- * if (_.isElement(value)) {
- * return value.cloneNode(false);
- * }
- * }
- *
- * var el = _.cloneWith(document.body, customizer);
- *
- * console.log(el === document.body);
- * // => false
- * console.log(el.nodeName);
- * // => 'BODY'
- * console.log(el.childNodes.length);
- * // => 0
- */
- function cloneWith(value, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
- }
-
- /**
- * This method is like `_.clone` except that it recursively clones `value`.
- *
- * @static
- * @memberOf _
- * @since 1.0.0
- * @category Lang
- * @param {*} value The value to recursively clone.
- * @returns {*} Returns the deep cloned value.
- * @see _.clone
- * @example
- *
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
- *
- * var deep = _.cloneDeep(objects);
- * console.log(deep[0] === objects[0]);
- * // => false
- */
- function cloneDeep(value) {
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
- }
-
- /**
- * This method is like `_.cloneWith` except that it recursively clones `value`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to recursively clone.
- * @param {Function} [customizer] The function to customize cloning.
- * @returns {*} Returns the deep cloned value.
- * @see _.cloneWith
- * @example
- *
- * function customizer(value) {
- * if (_.isElement(value)) {
- * return value.cloneNode(true);
- * }
- * }
- *
- * var el = _.cloneDeepWith(document.body, customizer);
- *
- * console.log(el === document.body);
- * // => false
- * console.log(el.nodeName);
- * // => 'BODY'
- * console.log(el.childNodes.length);
- * // => 20
- */
- function cloneDeepWith(value, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
- }
-
- /**
- * Checks if `object` conforms to `source` by invoking the predicate
- * properties of `source` with the corresponding property values of `object`.
- *
- * **Note:** This method is equivalent to `_.conforms` when `source` is
- * partially applied.
- *
- * @static
- * @memberOf _
- * @since 4.14.0
- * @category Lang
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property predicates to conform to.
- * @returns {boolean} Returns `true` if `object` conforms, else `false`.
- * @example
- *
- * var object = { 'a': 1, 'b': 2 };
- *
- * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
- * // => true
- *
- * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
- * // => false
- */
- function conformsTo(object, source) {
- return source == null || baseConformsTo(object, source, keys(source));
- }
-
- /**
- * Performs a
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * comparison between two values to determine if they are equivalent.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'a': 1 };
- * var other = { 'a': 1 };
- *
- * _.eq(object, object);
- * // => true
- *
- * _.eq(object, other);
- * // => false
- *
- * _.eq('a', 'a');
- * // => true
- *
- * _.eq('a', Object('a'));
- * // => false
- *
- * _.eq(NaN, NaN);
- * // => true
- */
- function eq(value, other) {
- return value === other || (value !== value && other !== other);
- }
-
- /**
- * Checks if `value` is greater than `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than `other`,
- * else `false`.
- * @see _.lt
- * @example
- *
- * _.gt(3, 1);
- * // => true
- *
- * _.gt(3, 3);
- * // => false
- *
- * _.gt(1, 3);
- * // => false
- */
- var gt = createRelationalOperation(baseGt);
-
- /**
- * Checks if `value` is greater than or equal to `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than or equal to
- * `other`, else `false`.
- * @see _.lte
- * @example
- *
- * _.gte(3, 1);
- * // => true
- *
- * _.gte(3, 3);
- * // => true
- *
- * _.gte(1, 3);
- * // => false
- */
- var gte = createRelationalOperation(function(value, other) {
- return value >= other;
- });
-
- /**
- * Checks if `value` is likely an `arguments` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- * else `false`.
- * @example
- *
- * _.isArguments(function() { return arguments; }());
- * // => true
- *
- * _.isArguments([1, 2, 3]);
- * // => false
- */
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
- return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
- !propertyIsEnumerable.call(value, 'callee');
- };
-
- /**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(document.body.children);
- * // => false
- *
- * _.isArray('abc');
- * // => false
- *
- * _.isArray(_.noop);
- * // => false
- */
- var isArray = Array.isArray;
-
- /**
- * Checks if `value` is classified as an `ArrayBuffer` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
- * @example
- *
- * _.isArrayBuffer(new ArrayBuffer(2));
- * // => true
- *
- * _.isArrayBuffer(new Array(2));
- * // => false
- */
- var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
-
- /**
- * Checks if `value` is array-like. A value is considered array-like if it's
- * not a function and has a `value.length` that's an integer greater than or
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- * @example
- *
- * _.isArrayLike([1, 2, 3]);
- * // => true
- *
- * _.isArrayLike(document.body.children);
- * // => true
- *
- * _.isArrayLike('abc');
- * // => true
- *
- * _.isArrayLike(_.noop);
- * // => false
- */
- function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction(value);
- }
-
- /**
- * This method is like `_.isArrayLike` except that it also checks if `value`
- * is an object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array-like object,
- * else `false`.
- * @example
- *
- * _.isArrayLikeObject([1, 2, 3]);
- * // => true
- *
- * _.isArrayLikeObject(document.body.children);
- * // => true
- *
- * _.isArrayLikeObject('abc');
- * // => false
- *
- * _.isArrayLikeObject(_.noop);
- * // => false
- */
- function isArrayLikeObject(value) {
- return isObjectLike(value) && isArrayLike(value);
- }
-
- /**
- * Checks if `value` is classified as a boolean primitive or object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
- * @example
- *
- * _.isBoolean(false);
- * // => true
- *
- * _.isBoolean(null);
- * // => false
- */
- function isBoolean(value) {
- return value === true || value === false ||
- (isObjectLike(value) && baseGetTag(value) == boolTag);
- }
-
- /**
- * Checks if `value` is a buffer.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
- * @example
- *
- * _.isBuffer(new Buffer(2));
- * // => true
- *
- * _.isBuffer(new Uint8Array(2));
- * // => false
- */
- var isBuffer = nativeIsBuffer || stubFalse;
-
- /**
- * Checks if `value` is classified as a `Date` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
- * @example
- *
- * _.isDate(new Date);
- * // => true
- *
- * _.isDate('Mon April 23 2012');
- * // => false
- */
- var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
-
- /**
- * Checks if `value` is likely a DOM element.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
- * @example
- *
- * _.isElement(document.body);
- * // => true
- *
- * _.isElement('<body>');
- * // => false
- */
- function isElement(value) {
- return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
- }
-
- /**
- * Checks if `value` is an empty object, collection, map, or set.
- *
- * Objects are considered empty if they have no own enumerable string keyed
- * properties.
- *
- * Array-like values such as `arguments` objects, arrays, buffers, strings, or
- * jQuery-like collections are considered empty if they have a `length` of `0`.
- * Similarly, maps and sets are considered empty if they have a `size` of `0`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is empty, else `false`.
- * @example
- *
- * _.isEmpty(null);
- * // => true
- *
- * _.isEmpty(true);
- * // => true
- *
- * _.isEmpty(1);
- * // => true
- *
- * _.isEmpty([1, 2, 3]);
- * // => false
- *
- * _.isEmpty({ 'a': 1 });
- * // => false
- */
- function isEmpty(value) {
- if (value == null) {
- return true;
- }
- if (isArrayLike(value) &&
- (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
- isBuffer(value) || isTypedArray(value) || isArguments(value))) {
- return !value.length;
- }
- var tag = getTag(value);
- if (tag == mapTag || tag == setTag) {
- return !value.size;
- }
- if (isPrototype(value)) {
- return !baseKeys(value).length;
- }
- for (var key in value) {
- if (hasOwnProperty.call(value, key)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Performs a deep comparison between two values to determine if they are
- * equivalent.
- *
- * **Note:** This method supports comparing arrays, array buffers, booleans,
- * date objects, error objects, maps, numbers, `Object` objects, regexes,
- * sets, strings, symbols, and typed arrays. `Object` objects are compared
- * by their own, not inherited, enumerable properties. Functions and DOM
- * nodes are compared by strict equality, i.e. `===`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'a': 1 };
- * var other = { 'a': 1 };
- *
- * _.isEqual(object, other);
- * // => true
- *
- * object === other;
- * // => false
- */
- function isEqual(value, other) {
- return baseIsEqual(value, other);
- }
-
- /**
- * This method is like `_.isEqual` except that it accepts `customizer` which
- * is invoked to compare values. If `customizer` returns `undefined`, comparisons
- * are handled by the method instead. The `customizer` is invoked with up to
- * six arguments: (objValue, othValue [, index|key, object, other, stack]).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {Function} [customizer] The function to customize comparisons.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * function isGreeting(value) {
- * return /^h(?:i|ello)$/.test(value);
- * }
- *
- * function customizer(objValue, othValue) {
- * if (isGreeting(objValue) && isGreeting(othValue)) {
- * return true;
- * }
- * }
- *
- * var array = ['hello', 'goodbye'];
- * var other = ['hi', 'goodbye'];
- *
- * _.isEqualWith(array, other, customizer);
- * // => true
- */
- function isEqualWith(value, other, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- var result = customizer ? customizer(value, other) : undefined;
- return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
- }
-
- /**
- * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
- * `SyntaxError`, `TypeError`, or `URIError` object.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
- * @example
- *
- * _.isError(new Error);
- * // => true
- *
- * _.isError(Error);
- * // => false
- */
- function isError(value) {
- if (!isObjectLike(value)) {
- return false;
- }
- var tag = baseGetTag(value);
- return tag == errorTag || tag == domExcTag ||
- (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
- }
-
- /**
- * Checks if `value` is a finite primitive number.
- *
- * **Note:** This method is based on
- * [`Number.isFinite`](https://mdn.io/Number/isFinite).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
- * @example
- *
- * _.isFinite(3);
- * // => true
- *
- * _.isFinite(Number.MIN_VALUE);
- * // => true
- *
- * _.isFinite(Infinity);
- * // => false
- *
- * _.isFinite('3');
- * // => false
- */
- function isFinite(value) {
- return typeof value == 'number' && nativeIsFinite(value);
- }
-
- /**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
- function isFunction(value) {
- if (!isObject(value)) {
- return false;
- }
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
- var tag = baseGetTag(value);
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
- }
-
- /**
- * Checks if `value` is an integer.
- *
- * **Note:** This method is based on
- * [`Number.isInteger`](https://mdn.io/Number/isInteger).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
- * @example
- *
- * _.isInteger(3);
- * // => true
- *
- * _.isInteger(Number.MIN_VALUE);
- * // => false
- *
- * _.isInteger(Infinity);
- * // => false
- *
- * _.isInteger('3');
- * // => false
- */
- function isInteger(value) {
- return typeof value == 'number' && value == toInteger(value);
- }
-
- /**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This method is loosely based on
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- * @example
- *
- * _.isLength(3);
- * // => true
- *
- * _.isLength(Number.MIN_VALUE);
- * // => false
- *
- * _.isLength(Infinity);
- * // => false
- *
- * _.isLength('3');
- * // => false
- */
- function isLength(value) {
- return typeof value == 'number' &&
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
-
- /**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
- function isObject(value) {
- var type = typeof value;
- return value != null && (type == 'object' || type == 'function');
- }
-
- /**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
- function isObjectLike(value) {
- return value != null && typeof value == 'object';
- }
-
- /**
- * Checks if `value` is classified as a `Map` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
- * @example
- *
- * _.isMap(new Map);
- * // => true
- *
- * _.isMap(new WeakMap);
- * // => false
- */
- var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
-
- /**
- * Performs a partial deep comparison between `object` and `source` to
- * determine if `object` contains equivalent property values.
- *
- * **Note:** This method is equivalent to `_.matches` when `source` is
- * partially applied.
- *
- * Partial comparisons will match empty array and empty object `source`
- * values against any array or object value, respectively. See `_.isEqual`
- * for a list of supported value comparisons.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property values to match.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- * @example
- *
- * var object = { 'a': 1, 'b': 2 };
- *
- * _.isMatch(object, { 'b': 2 });
- * // => true
- *
- * _.isMatch(object, { 'b': 1 });
- * // => false
- */
- function isMatch(object, source) {
- return object === source || baseIsMatch(object, source, getMatchData(source));
- }
-
- /**
- * This method is like `_.isMatch` except that it accepts `customizer` which
- * is invoked to compare values. If `customizer` returns `undefined`, comparisons
- * are handled by the method instead. The `customizer` is invoked with five
- * arguments: (objValue, srcValue, index|key, object, source).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property values to match.
- * @param {Function} [customizer] The function to customize comparisons.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- * @example
- *
- * function isGreeting(value) {
- * return /^h(?:i|ello)$/.test(value);
- * }
- *
- * function customizer(objValue, srcValue) {
- * if (isGreeting(objValue) && isGreeting(srcValue)) {
- * return true;
- * }
- * }
- *
- * var object = { 'greeting': 'hello' };
- * var source = { 'greeting': 'hi' };
- *
- * _.isMatchWith(object, source, customizer);
- * // => true
- */
- function isMatchWith(object, source, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return baseIsMatch(object, source, getMatchData(source), customizer);
- }
-
- /**
- * Checks if `value` is `NaN`.
- *
- * **Note:** This method is based on
- * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
- * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
- * `undefined` and other non-number values.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
- * @example
- *
- * _.isNaN(NaN);
- * // => true
- *
- * _.isNaN(new Number(NaN));
- * // => true
- *
- * isNaN(undefined);
- * // => true
- *
- * _.isNaN(undefined);
- * // => false
- */
- function isNaN(value) {
- // An `NaN` primitive is the only value that is not equal to itself.
- // Perform the `toStringTag` check first to avoid errors with some
- // ActiveX objects in IE.
- return isNumber(value) && value != +value;
- }
-
- /**
- * Checks if `value` is a pristine native function.
- *
- * **Note:** This method can't reliably detect native functions in the presence
- * of the core-js package because core-js circumvents this kind of detection.
- * Despite multiple requests, the core-js maintainer has made it clear: any
- * attempt to fix the detection will be obstructed. As a result, we're left
- * with little choice but to throw an error. Unfortunately, this also affects
- * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
- * which rely on core-js.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function,
- * else `false`.
- * @example
- *
- * _.isNative(Array.prototype.push);
- * // => true
- *
- * _.isNative(_);
- * // => false
- */
- function isNative(value) {
- if (isMaskable(value)) {
- throw new Error(CORE_ERROR_TEXT);
- }
- return baseIsNative(value);
- }
-
- /**
- * Checks if `value` is `null`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
- * @example
- *
- * _.isNull(null);
- * // => true
- *
- * _.isNull(void 0);
- * // => false
- */
- function isNull(value) {
- return value === null;
- }
-
- /**
- * Checks if `value` is `null` or `undefined`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
- * @example
- *
- * _.isNil(null);
- * // => true
- *
- * _.isNil(void 0);
- * // => true
- *
- * _.isNil(NaN);
- * // => false
- */
- function isNil(value) {
- return value == null;
- }
-
- /**
- * Checks if `value` is classified as a `Number` primitive or object.
- *
- * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
- * classified as numbers, use the `_.isFinite` method.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a number, else `false`.
- * @example
- *
- * _.isNumber(3);
- * // => true
- *
- * _.isNumber(Number.MIN_VALUE);
- * // => true
- *
- * _.isNumber(Infinity);
- * // => true
- *
- * _.isNumber('3');
- * // => false
- */
- function isNumber(value) {
- return typeof value == 'number' ||
- (isObjectLike(value) && baseGetTag(value) == numberTag);
- }
-
- /**
- * Checks if `value` is a plain object, that is, an object created by the
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
- *
- * @static
- * @memberOf _
- * @since 0.8.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * _.isPlainObject(new Foo);
- * // => false
- *
- * _.isPlainObject([1, 2, 3]);
- * // => false
- *
- * _.isPlainObject({ 'x': 0, 'y': 0 });
- * // => true
- *
- * _.isPlainObject(Object.create(null));
- * // => true
- */
- function isPlainObject(value) {
- if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
- return false;
- }
- var proto = getPrototype(value);
- if (proto === null) {
- return true;
- }
- var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
- return typeof Ctor == 'function' && Ctor instanceof Ctor &&
- funcToString.call(Ctor) == objectCtorString;
- }
-
- /**
- * Checks if `value` is classified as a `RegExp` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
- * @example
- *
- * _.isRegExp(/abc/);
- * // => true
- *
- * _.isRegExp('/abc/');
- * // => false
- */
- var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
-
- /**
- * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
- * double precision number which isn't the result of a rounded unsafe integer.
- *
- * **Note:** This method is based on
- * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
- * @example
- *
- * _.isSafeInteger(3);
- * // => true
- *
- * _.isSafeInteger(Number.MIN_VALUE);
- * // => false
- *
- * _.isSafeInteger(Infinity);
- * // => false
- *
- * _.isSafeInteger('3');
- * // => false
- */
- function isSafeInteger(value) {
- return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
- }
-
- /**
- * Checks if `value` is classified as a `Set` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
- * @example
- *
- * _.isSet(new Set);
- * // => true
- *
- * _.isSet(new WeakSet);
- * // => false
- */
- var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
-
- /**
- * Checks if `value` is classified as a `String` primitive or object.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a string, else `false`.
- * @example
- *
- * _.isString('abc');
- * // => true
- *
- * _.isString(1);
- * // => false
- */
- function isString(value) {
- return typeof value == 'string' ||
- (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
- }
-
- /**
- * Checks if `value` is classified as a `Symbol` primitive or object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
- * @example
- *
- * _.isSymbol(Symbol.iterator);
- * // => true
- *
- * _.isSymbol('abc');
- * // => false
- */
- function isSymbol(value) {
- return typeof value == 'symbol' ||
- (isObjectLike(value) && baseGetTag(value) == symbolTag);
- }
-
- /**
- * Checks if `value` is classified as a typed array.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
- * @example
- *
- * _.isTypedArray(new Uint8Array);
- * // => true
- *
- * _.isTypedArray([]);
- * // => false
- */
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
-
- /**
- * Checks if `value` is `undefined`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
- * @example
- *
- * _.isUndefined(void 0);
- * // => true
- *
- * _.isUndefined(null);
- * // => false
- */
- function isUndefined(value) {
- return value === undefined;
- }
-
- /**
- * Checks if `value` is classified as a `WeakMap` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
- * @example
- *
- * _.isWeakMap(new WeakMap);
- * // => true
- *
- * _.isWeakMap(new Map);
- * // => false
- */
- function isWeakMap(value) {
- return isObjectLike(value) && getTag(value) == weakMapTag;
- }
-
- /**
- * Checks if `value` is classified as a `WeakSet` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
- * @example
- *
- * _.isWeakSet(new WeakSet);
- * // => true
- *
- * _.isWeakSet(new Set);
- * // => false
- */
- function isWeakSet(value) {
- return isObjectLike(value) && baseGetTag(value) == weakSetTag;
- }
-
- /**
- * Checks if `value` is less than `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than `other`,
- * else `false`.
- * @see _.gt
- * @example
- *
- * _.lt(1, 3);
- * // => true
- *
- * _.lt(3, 3);
- * // => false
- *
- * _.lt(3, 1);
- * // => false
- */
- var lt = createRelationalOperation(baseLt);
-
- /**
- * Checks if `value` is less than or equal to `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than or equal to
- * `other`, else `false`.
- * @see _.gte
- * @example
- *
- * _.lte(1, 3);
- * // => true
- *
- * _.lte(3, 3);
- * // => true
- *
- * _.lte(3, 1);
- * // => false
- */
- var lte = createRelationalOperation(function(value, other) {
- return value <= other;
- });
-
- /**
- * Converts `value` to an array.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {Array} Returns the converted array.
- * @example
- *
- * _.toArray({ 'a': 1, 'b': 2 });
- * // => [1, 2]
- *
- * _.toArray('abc');
- * // => ['a', 'b', 'c']
- *
- * _.toArray(1);
- * // => []
- *
- * _.toArray(null);
- * // => []
- */
- function toArray(value) {
- if (!value) {
- return [];
- }
- if (isArrayLike(value)) {
- return isString(value) ? stringToArray(value) : copyArray(value);
- }
- if (symIterator && value[symIterator]) {
- return iteratorToArray(value[symIterator]());
- }
- var tag = getTag(value),
- func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
-
- return func(value);
- }
-
- /**
- * Converts `value` to a finite number.
- *
- * @static
- * @memberOf _
- * @since 4.12.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted number.
- * @example
- *
- * _.toFinite(3.2);
- * // => 3.2
- *
- * _.toFinite(Number.MIN_VALUE);
- * // => 5e-324
- *
- * _.toFinite(Infinity);
- * // => 1.7976931348623157e+308
- *
- * _.toFinite('3.2');
- * // => 3.2
- */
- function toFinite(value) {
- if (!value) {
- return value === 0 ? value : 0;
- }
- value = toNumber(value);
- if (value === INFINITY || value === -INFINITY) {
- var sign = (value < 0 ? -1 : 1);
- return sign * MAX_INTEGER;
- }
- return value === value ? value : 0;
- }
-
- /**
- * Converts `value` to an integer.
- *
- * **Note:** This method is loosely based on
- * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.toInteger(3.2);
- * // => 3
- *
- * _.toInteger(Number.MIN_VALUE);
- * // => 0
- *
- * _.toInteger(Infinity);
- * // => 1.7976931348623157e+308
- *
- * _.toInteger('3.2');
- * // => 3
- */
- function toInteger(value) {
- var result = toFinite(value),
- remainder = result % 1;
-
- return result === result ? (remainder ? result - remainder : result) : 0;
- }
-
- /**
- * Converts `value` to an integer suitable for use as the length of an
- * array-like object.
- *
- * **Note:** This method is based on
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.toLength(3.2);
- * // => 3
- *
- * _.toLength(Number.MIN_VALUE);
- * // => 0
- *
- * _.toLength(Infinity);
- * // => 4294967295
- *
- * _.toLength('3.2');
- * // => 3
- */
- function toLength(value) {
- return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
- }
-
- /**
- * Converts `value` to a number.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to process.
- * @returns {number} Returns the number.
- * @example
- *
- * _.toNumber(3.2);
- * // => 3.2
- *
- * _.toNumber(Number.MIN_VALUE);
- * // => 5e-324
- *
- * _.toNumber(Infinity);
- * // => Infinity
- *
- * _.toNumber('3.2');
- * // => 3.2
- */
- function toNumber(value) {
- if (typeof value == 'number') {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- if (isObject(value)) {
- var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
- value = isObject(other) ? (other + '') : other;
- }
- if (typeof value != 'string') {
- return value === 0 ? value : +value;
- }
- value = value.replace(reTrim, '');
- var isBinary = reIsBinary.test(value);
- return (isBinary || reIsOctal.test(value))
- ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
- : (reIsBadHex.test(value) ? NAN : +value);
- }
-
- /**
- * Converts `value` to a plain object flattening inherited enumerable string
- * keyed properties of `value` to own properties of the plain object.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {Object} Returns the converted plain object.
- * @example
- *
- * function Foo() {
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.assign({ 'a': 1 }, new Foo);
- * // => { 'a': 1, 'b': 2 }
- *
- * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
- * // => { 'a': 1, 'b': 2, 'c': 3 }
- */
- function toPlainObject(value) {
- return copyObject(value, keysIn(value));
- }
-
- /**
- * Converts `value` to a safe integer. A safe integer can be compared and
- * represented correctly.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.toSafeInteger(3.2);
- * // => 3
- *
- * _.toSafeInteger(Number.MIN_VALUE);
- * // => 0
- *
- * _.toSafeInteger(Infinity);
- * // => 9007199254740991
- *
- * _.toSafeInteger('3.2');
- * // => 3
- */
- function toSafeInteger(value) {
- return value
- ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
- : (value === 0 ? value : 0);
- }
-
- /**
- * Converts `value` to a string. An empty string is returned for `null`
- * and `undefined` values. The sign of `-0` is preserved.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {string} Returns the converted string.
- * @example
- *
- * _.toString(null);
- * // => ''
- *
- * _.toString(-0);
- * // => '-0'
- *
- * _.toString([1, 2, 3]);
- * // => '1,2,3'
- */
- function toString(value) {
- return value == null ? '' : baseToString(value);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Assigns own enumerable string keyed properties of source objects to the
- * destination object. Source objects are applied from left to right.
- * Subsequent sources overwrite property assignments of previous sources.
- *
- * **Note:** This method mutates `object` and is loosely based on
- * [`Object.assign`](https://mdn.io/Object/assign).
- *
- * @static
- * @memberOf _
- * @since 0.10.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.assignIn
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * function Bar() {
- * this.c = 3;
- * }
- *
- * Foo.prototype.b = 2;
- * Bar.prototype.d = 4;
- *
- * _.assign({ 'a': 0 }, new Foo, new Bar);
- * // => { 'a': 1, 'c': 3 }
- */
- var assign = createAssigner(function(object, source) {
- if (isPrototype(source) || isArrayLike(source)) {
- copyObject(source, keys(source), object);
- return;
- }
- for (var key in source) {
- if (hasOwnProperty.call(source, key)) {
- assignValue(object, key, source[key]);
- }
- }
- });
-
- /**
- * This method is like `_.assign` except that it iterates over own and
- * inherited source properties.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias extend
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.assign
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * function Bar() {
- * this.c = 3;
- * }
- *
- * Foo.prototype.b = 2;
- * Bar.prototype.d = 4;
- *
- * _.assignIn({ 'a': 0 }, new Foo, new Bar);
- * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
- */
- var assignIn = createAssigner(function(object, source) {
- copyObject(source, keysIn(source), object);
- });
-
- /**
- * This method is like `_.assignIn` except that it accepts `customizer`
- * which is invoked to produce the assigned values. If `customizer` returns
- * `undefined`, assignment is handled by the method instead. The `customizer`
- * is invoked with five arguments: (objValue, srcValue, key, object, source).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias extendWith
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} sources The source objects.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @see _.assignWith
- * @example
- *
- * function customizer(objValue, srcValue) {
- * return _.isUndefined(objValue) ? srcValue : objValue;
- * }
- *
- * var defaults = _.partialRight(_.assignInWith, customizer);
- *
- * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
- * // => { 'a': 1, 'b': 2 }
- */
- var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
- copyObject(source, keysIn(source), object, customizer);
- });
-
- /**
- * This method is like `_.assign` except that it accepts `customizer`
- * which is invoked to produce the assigned values. If `customizer` returns
- * `undefined`, assignment is handled by the method instead. The `customizer`
- * is invoked with five arguments: (objValue, srcValue, key, object, source).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} sources The source objects.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @see _.assignInWith
- * @example
- *
- * function customizer(objValue, srcValue) {
- * return _.isUndefined(objValue) ? srcValue : objValue;
- * }
- *
- * var defaults = _.partialRight(_.assignWith, customizer);
- *
- * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
- * // => { 'a': 1, 'b': 2 }
- */
- var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
- copyObject(source, keys(source), object, customizer);
- });
-
- /**
- * Creates an array of values corresponding to `paths` of `object`.
- *
- * @static
- * @memberOf _
- * @since 1.0.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {...(string|string[])} [paths] The property paths to pick.
- * @returns {Array} Returns the picked values.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
- *
- * _.at(object, ['a[0].b.c', 'a[1]']);
- * // => [3, 4]
- */
- var at = flatRest(baseAt);
-
- /**
- * Creates an object that inherits from the `prototype` object. If a
- * `properties` object is given, its own enumerable string keyed properties
- * are assigned to the created object.
- *
- * @static
- * @memberOf _
- * @since 2.3.0
- * @category Object
- * @param {Object} prototype The object to inherit from.
- * @param {Object} [properties] The properties to assign to the object.
- * @returns {Object} Returns the new object.
- * @example
- *
- * function Shape() {
- * this.x = 0;
- * this.y = 0;
- * }
- *
- * function Circle() {
- * Shape.call(this);
- * }
- *
- * Circle.prototype = _.create(Shape.prototype, {
- * 'constructor': Circle
- * });
- *
- * var circle = new Circle;
- * circle instanceof Circle;
- * // => true
- *
- * circle instanceof Shape;
- * // => true
- */
- function create(prototype, properties) {
- var result = baseCreate(prototype);
- return properties == null ? result : baseAssign(result, properties);
- }
-
- /**
- * Assigns own and inherited enumerable string keyed properties of source
- * objects to the destination object for all destination properties that
- * resolve to `undefined`. Source objects are applied from left to right.
- * Once a property is set, additional values of the same property are ignored.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.defaultsDeep
- * @example
- *
- * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
- * // => { 'a': 1, 'b': 2 }
- */
- var defaults = baseRest(function(args) {
- args.push(undefined, customDefaultsAssignIn);
- return apply(assignInWith, undefined, args);
- });
-
- /**
- * This method is like `_.defaults` except that it recursively assigns
- * default properties.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.defaults
- * @example
- *
- * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
- * // => { 'a': { 'b': 2, 'c': 3 } }
- */
- var defaultsDeep = baseRest(function(args) {
- args.push(undefined, customDefaultsMerge);
- return apply(mergeWith, undefined, args);
- });
-
- /**
- * This method is like `_.find` except that it returns the key of the first
- * element `predicate` returns truthy for instead of the element itself.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category Object
- * @param {Object} object The object to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {string|undefined} Returns the key of the matched element,
- * else `undefined`.
- * @example
- *
- * var users = {
- * 'barney': { 'age': 36, 'active': true },
- * 'fred': { 'age': 40, 'active': false },
- * 'pebbles': { 'age': 1, 'active': true }
- * };
- *
- * _.findKey(users, function(o) { return o.age < 40; });
- * // => 'barney' (iteration order is not guaranteed)
- *
- * // The `_.matches` iteratee shorthand.
- * _.findKey(users, { 'age': 1, 'active': true });
- * // => 'pebbles'
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findKey(users, ['active', false]);
- * // => 'fred'
- *
- * // The `_.property` iteratee shorthand.
- * _.findKey(users, 'active');
- * // => 'barney'
- */
- function findKey(object, predicate) {
- return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
- }
-
- /**
- * This method is like `_.findKey` except that it iterates over elements of
- * a collection in the opposite order.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Object
- * @param {Object} object The object to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {string|undefined} Returns the key of the matched element,
- * else `undefined`.
- * @example
- *
- * var users = {
- * 'barney': { 'age': 36, 'active': true },
- * 'fred': { 'age': 40, 'active': false },
- * 'pebbles': { 'age': 1, 'active': true }
- * };
- *
- * _.findLastKey(users, function(o) { return o.age < 40; });
- * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
- *
- * // The `_.matches` iteratee shorthand.
- * _.findLastKey(users, { 'age': 36, 'active': true });
- * // => 'barney'
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findLastKey(users, ['active', false]);
- * // => 'fred'
- *
- * // The `_.property` iteratee shorthand.
- * _.findLastKey(users, 'active');
- * // => 'pebbles'
- */
- function findLastKey(object, predicate) {
- return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
- }
-
- /**
- * Iterates over own and inherited enumerable string keyed properties of an
- * object and invokes `iteratee` for each property. The iteratee is invoked
- * with three arguments: (value, key, object). Iteratee functions may exit
- * iteration early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @since 0.3.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forInRight
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forIn(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
- */
- function forIn(object, iteratee) {
- return object == null
- ? object
- : baseFor(object, getIteratee(iteratee, 3), keysIn);
- }
-
- /**
- * This method is like `_.forIn` except that it iterates over properties of
- * `object` in the opposite order.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forIn
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forInRight(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
- */
- function forInRight(object, iteratee) {
- return object == null
- ? object
- : baseForRight(object, getIteratee(iteratee, 3), keysIn);
- }
-
- /**
- * Iterates over own enumerable string keyed properties of an object and
- * invokes `iteratee` for each property. The iteratee is invoked with three
- * arguments: (value, key, object). Iteratee functions may exit iteration
- * early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @since 0.3.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forOwnRight
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forOwn(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'a' then 'b' (iteration order is not guaranteed).
- */
- function forOwn(object, iteratee) {
- return object && baseForOwn(object, getIteratee(iteratee, 3));
- }
-
- /**
- * This method is like `_.forOwn` except that it iterates over properties of
- * `object` in the opposite order.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forOwn
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forOwnRight(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
- */
- function forOwnRight(object, iteratee) {
- return object && baseForOwnRight(object, getIteratee(iteratee, 3));
- }
-
- /**
- * Creates an array of function property names from own enumerable properties
- * of `object`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to inspect.
- * @returns {Array} Returns the function names.
- * @see _.functionsIn
- * @example
- *
- * function Foo() {
- * this.a = _.constant('a');
- * this.b = _.constant('b');
- * }
- *
- * Foo.prototype.c = _.constant('c');
- *
- * _.functions(new Foo);
- * // => ['a', 'b']
- */
- function functions(object) {
- return object == null ? [] : baseFunctions(object, keys(object));
- }
-
- /**
- * Creates an array of function property names from own and inherited
- * enumerable properties of `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to inspect.
- * @returns {Array} Returns the function names.
- * @see _.functions
- * @example
- *
- * function Foo() {
- * this.a = _.constant('a');
- * this.b = _.constant('b');
- * }
- *
- * Foo.prototype.c = _.constant('c');
- *
- * _.functionsIn(new Foo);
- * // => ['a', 'b', 'c']
- */
- function functionsIn(object) {
- return object == null ? [] : baseFunctions(object, keysIn(object));
- }
-
- /**
- * Gets the value at `path` of `object`. If the resolved value is
- * `undefined`, the `defaultValue` is returned in its place.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to get.
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.get(object, 'a[0].b.c');
- * // => 3
- *
- * _.get(object, ['a', '0', 'b', 'c']);
- * // => 3
- *
- * _.get(object, 'a.b.c', 'default');
- * // => 'default'
- */
- function get(object, path, defaultValue) {
- var result = object == null ? undefined : baseGet(object, path);
- return result === undefined ? defaultValue : result;
- }
-
- /**
- * Checks if `path` is a direct property of `object`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path to check.
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
- * @example
- *
- * var object = { 'a': { 'b': 2 } };
- * var other = _.create({ 'a': _.create({ 'b': 2 }) });
- *
- * _.has(object, 'a');
- * // => true
- *
- * _.has(object, 'a.b');
- * // => true
- *
- * _.has(object, ['a', 'b']);
- * // => true
- *
- * _.has(other, 'a');
- * // => false
- */
- function has(object, path) {
- return object != null && hasPath(object, path, baseHas);
- }
-
- /**
- * Checks if `path` is a direct or inherited property of `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path to check.
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
- * @example
- *
- * var object = _.create({ 'a': _.create({ 'b': 2 }) });
- *
- * _.hasIn(object, 'a');
- * // => true
- *
- * _.hasIn(object, 'a.b');
- * // => true
- *
- * _.hasIn(object, ['a', 'b']);
- * // => true
- *
- * _.hasIn(object, 'b');
- * // => false
- */
- function hasIn(object, path) {
- return object != null && hasPath(object, path, baseHasIn);
- }
-
- /**
- * Creates an object composed of the inverted keys and values of `object`.
- * If `object` contains duplicate values, subsequent values overwrite
- * property assignments of previous values.
- *
- * @static
- * @memberOf _
- * @since 0.7.0
- * @category Object
- * @param {Object} object The object to invert.
- * @returns {Object} Returns the new inverted object.
- * @example
- *
- * var object = { 'a': 1, 'b': 2, 'c': 1 };
- *
- * _.invert(object);
- * // => { '1': 'c', '2': 'b' }
- */
- var invert = createInverter(function(result, value, key) {
- result[value] = key;
- }, constant(identity));
-
- /**
- * This method is like `_.invert` except that the inverted object is generated
- * from the results of running each element of `object` thru `iteratee`. The
- * corresponding inverted value of each inverted key is an array of keys
- * responsible for generating the inverted value. The iteratee is invoked
- * with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.1.0
- * @category Object
- * @param {Object} object The object to invert.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Object} Returns the new inverted object.
- * @example
- *
- * var object = { 'a': 1, 'b': 2, 'c': 1 };
- *
- * _.invertBy(object);
- * // => { '1': ['a', 'c'], '2': ['b'] }
- *
- * _.invertBy(object, function(value) {
- * return 'group' + value;
- * });
- * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
- */
- var invertBy = createInverter(function(result, value, key) {
- if (hasOwnProperty.call(result, value)) {
- result[value].push(key);
- } else {
- result[value] = [key];
- }
- }, getIteratee);
-
- /**
- * Invokes the method at `path` of `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the method to invoke.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {*} Returns the result of the invoked method.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
- *
- * _.invoke(object, 'a[0].b.c.slice', 1, 3);
- * // => [2, 3]
- */
- var invoke = baseRest(baseInvoke);
-
- /**
- * Creates an array of the own enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects. See the
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
- * for more details.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keys(new Foo);
- * // => ['a', 'b'] (iteration order is not guaranteed)
- *
- * _.keys('hi');
- * // => ['0', '1']
- */
- function keys(object) {
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
- }
-
- /**
- * Creates an array of the own and inherited enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keysIn(new Foo);
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
- */
- function keysIn(object) {
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
- }
-
- /**
- * The opposite of `_.mapValues`; this method creates an object with the
- * same values as `object` and keys generated by running each own enumerable
- * string keyed property of `object` thru `iteratee`. The iteratee is invoked
- * with three arguments: (value, key, object).
- *
- * @static
- * @memberOf _
- * @since 3.8.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns the new mapped object.
- * @see _.mapValues
- * @example
- *
- * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
- * return key + value;
- * });
- * // => { 'a1': 1, 'b2': 2 }
- */
- function mapKeys(object, iteratee) {
- var result = {};
- iteratee = getIteratee(iteratee, 3);
-
- baseForOwn(object, function(value, key, object) {
- baseAssignValue(result, iteratee(value, key, object), value);
- });
- return result;
- }
-
- /**
- * Creates an object with the same keys as `object` and values generated
- * by running each own enumerable string keyed property of `object` thru
- * `iteratee`. The iteratee is invoked with three arguments:
- * (value, key, object).
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns the new mapped object.
- * @see _.mapKeys
- * @example
- *
- * var users = {
- * 'fred': { 'user': 'fred', 'age': 40 },
- * 'pebbles': { 'user': 'pebbles', 'age': 1 }
- * };
- *
- * _.mapValues(users, function(o) { return o.age; });
- * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
- *
- * // The `_.property` iteratee shorthand.
- * _.mapValues(users, 'age');
- * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
- */
- function mapValues(object, iteratee) {
- var result = {};
- iteratee = getIteratee(iteratee, 3);
-
- baseForOwn(object, function(value, key, object) {
- baseAssignValue(result, key, iteratee(value, key, object));
- });
- return result;
- }
-
- /**
- * This method is like `_.assign` except that it recursively merges own and
- * inherited enumerable string keyed properties of source objects into the
- * destination object. Source properties that resolve to `undefined` are
- * skipped if a destination value exists. Array and plain object properties
- * are merged recursively. Other objects and value types are overridden by
- * assignment. Source objects are applied from left to right. Subsequent
- * sources overwrite property assignments of previous sources.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 0.5.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = {
- * 'a': [{ 'b': 2 }, { 'd': 4 }]
- * };
- *
- * var other = {
- * 'a': [{ 'c': 3 }, { 'e': 5 }]
- * };
- *
- * _.merge(object, other);
- * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
- */
- var merge = createAssigner(function(object, source, srcIndex) {
- baseMerge(object, source, srcIndex);
- });
-
- /**
- * This method is like `_.merge` except that it accepts `customizer` which
- * is invoked to produce the merged values of the destination and source
- * properties. If `customizer` returns `undefined`, merging is handled by the
- * method instead. The `customizer` is invoked with six arguments:
- * (objValue, srcValue, key, object, source, stack).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} sources The source objects.
- * @param {Function} customizer The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function customizer(objValue, srcValue) {
- * if (_.isArray(objValue)) {
- * return objValue.concat(srcValue);
- * }
- * }
- *
- * var object = { 'a': [1], 'b': [2] };
- * var other = { 'a': [3], 'b': [4] };
- *
- * _.mergeWith(object, other, customizer);
- * // => { 'a': [1, 3], 'b': [2, 4] }
- */
- var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
- baseMerge(object, source, srcIndex, customizer);
- });
-
- /**
- * The opposite of `_.pick`; this method creates an object composed of the
- * own and inherited enumerable property paths of `object` that are not omitted.
- *
- * **Note:** This method is considerably slower than `_.pick`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The source object.
- * @param {...(string|string[])} [paths] The property paths to omit.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.omit(object, ['a', 'c']);
- * // => { 'b': '2' }
- */
- var omit = flatRest(function(object, paths) {
- var result = {};
- if (object == null) {
- return result;
- }
- var isDeep = false;
- paths = arrayMap(paths, function(path) {
- path = castPath(path, object);
- isDeep || (isDeep = path.length > 1);
- return path;
- });
- copyObject(object, getAllKeysIn(object), result);
- if (isDeep) {
- result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
- }
- var length = paths.length;
- while (length--) {
- baseUnset(result, paths[length]);
- }
- return result;
- });
-
- /**
- * The opposite of `_.pickBy`; this method creates an object composed of
- * the own and inherited enumerable string keyed properties of `object` that
- * `predicate` doesn't return truthy for. The predicate is invoked with two
- * arguments: (value, key).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The source object.
- * @param {Function} [predicate=_.identity] The function invoked per property.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.omitBy(object, _.isNumber);
- * // => { 'b': '2' }
- */
- function omitBy(object, predicate) {
- return pickBy(object, negate(getIteratee(predicate)));
- }
-
- /**
- * Creates an object composed of the picked `object` properties.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The source object.
- * @param {...(string|string[])} [paths] The property paths to pick.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.pick(object, ['a', 'c']);
- * // => { 'a': 1, 'c': 3 }
- */
- var pick = flatRest(function(object, paths) {
- return object == null ? {} : basePick(object, paths);
- });
-
- /**
- * Creates an object composed of the `object` properties `predicate` returns
- * truthy for. The predicate is invoked with two arguments: (value, key).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The source object.
- * @param {Function} [predicate=_.identity] The function invoked per property.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.pickBy(object, _.isNumber);
- * // => { 'a': 1, 'c': 3 }
- */
- function pickBy(object, predicate) {
- if (object == null) {
- return {};
- }
- var props = arrayMap(getAllKeysIn(object), function(prop) {
- return [prop];
- });
- predicate = getIteratee(predicate);
- return basePickBy(object, props, function(value, path) {
- return predicate(value, path[0]);
- });
- }
-
- /**
- * This method is like `_.get` except that if the resolved value is a
- * function it's invoked with the `this` binding of its parent object and
- * its result is returned.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to resolve.
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
- *
- * _.result(object, 'a[0].b.c1');
- * // => 3
- *
- * _.result(object, 'a[0].b.c2');
- * // => 4
- *
- * _.result(object, 'a[0].b.c3', 'default');
- * // => 'default'
- *
- * _.result(object, 'a[0].b.c3', _.constant('default'));
- * // => 'default'
- */
- function result(object, path, defaultValue) {
- path = castPath(path, object);
-
- var index = -1,
- length = path.length;
-
- // Ensure the loop is entered when path is empty.
- if (!length) {
- length = 1;
- object = undefined;
- }
- while (++index < length) {
- var value = object == null ? undefined : object[toKey(path[index])];
- if (value === undefined) {
- index = length;
- value = defaultValue;
- }
- object = isFunction(value) ? value.call(object) : value;
- }
- return object;
- }
-
- /**
- * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
- * it's created. Arrays are created for missing index properties while objects
- * are created for all other missing properties. Use `_.setWith` to customize
- * `path` creation.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.set(object, 'a[0].b.c', 4);
- * console.log(object.a[0].b.c);
- * // => 4
- *
- * _.set(object, ['x', '0', 'y', 'z'], 5);
- * console.log(object.x[0].y.z);
- * // => 5
- */
- function set(object, path, value) {
- return object == null ? object : baseSet(object, path, value);
- }
-
- /**
- * This method is like `_.set` except that it accepts `customizer` which is
- * invoked to produce the objects of `path`. If `customizer` returns `undefined`
- * path creation is handled by the method instead. The `customizer` is invoked
- * with three arguments: (nsValue, key, nsObject).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {*} value The value to set.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = {};
- *
- * _.setWith(object, '[0][1]', 'a', Object);
- * // => { '0': { '1': 'a' } }
- */
- function setWith(object, path, value, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return object == null ? object : baseSet(object, path, value, customizer);
- }
-
- /**
- * Creates an array of own enumerable string keyed-value pairs for `object`
- * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
- * entries are returned.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias entries
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the key-value pairs.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.toPairs(new Foo);
- * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
- */
- var toPairs = createToPairs(keys);
-
- /**
- * Creates an array of own and inherited enumerable string keyed-value pairs
- * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
- * or set, its entries are returned.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias entriesIn
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the key-value pairs.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.toPairsIn(new Foo);
- * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
- */
- var toPairsIn = createToPairs(keysIn);
-
- /**
- * An alternative to `_.reduce`; this method transforms `object` to a new
- * `accumulator` object which is the result of running each of its own
- * enumerable string keyed properties thru `iteratee`, with each invocation
- * potentially mutating the `accumulator` object. If `accumulator` is not
- * provided, a new object with the same `[[Prototype]]` will be used. The
- * iteratee is invoked with four arguments: (accumulator, value, key, object).
- * Iteratee functions may exit iteration early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @since 1.3.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The custom accumulator value.
- * @returns {*} Returns the accumulated value.
- * @example
- *
- * _.transform([2, 3, 4], function(result, n) {
- * result.push(n *= n);
- * return n % 2 == 0;
- * }, []);
- * // => [4, 9]
- *
- * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
- * (result[value] || (result[value] = [])).push(key);
- * }, {});
- * // => { '1': ['a', 'c'], '2': ['b'] }
- */
- function transform(object, iteratee, accumulator) {
- var isArr = isArray(object),
- isArrLike = isArr || isBuffer(object) || isTypedArray(object);
-
- iteratee = getIteratee(iteratee, 4);
- if (accumulator == null) {
- var Ctor = object && object.constructor;
- if (isArrLike) {
- accumulator = isArr ? new Ctor : [];
- }
- else if (isObject(object)) {
- accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
- }
- else {
- accumulator = {};
- }
- }
- (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
- return iteratee(accumulator, value, index, object);
- });
- return accumulator;
- }
-
- /**
- * Removes the property at `path` of `object`.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to unset.
- * @returns {boolean} Returns `true` if the property is deleted, else `false`.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 7 } }] };
- * _.unset(object, 'a[0].b.c');
- * // => true
- *
- * console.log(object);
- * // => { 'a': [{ 'b': {} }] };
- *
- * _.unset(object, ['a', '0', 'b', 'c']);
- * // => true
- *
- * console.log(object);
- * // => { 'a': [{ 'b': {} }] };
- */
- function unset(object, path) {
- return object == null ? true : baseUnset(object, path);
- }
-
- /**
- * This method is like `_.set` except that accepts `updater` to produce the
- * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
- * is invoked with one argument: (value).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.6.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {Function} updater The function to produce the updated value.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.update(object, 'a[0].b.c', function(n) { return n * n; });
- * console.log(object.a[0].b.c);
- * // => 9
- *
- * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
- * console.log(object.x[0].y.z);
- * // => 0
- */
- function update(object, path, updater) {
- return object == null ? object : baseUpdate(object, path, castFunction(updater));
- }
-
- /**
- * This method is like `_.update` except that it accepts `customizer` which is
- * invoked to produce the objects of `path`. If `customizer` returns `undefined`
- * path creation is handled by the method instead. The `customizer` is invoked
- * with three arguments: (nsValue, key, nsObject).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.6.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {Function} updater The function to produce the updated value.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = {};
- *
- * _.updateWith(object, '[0][1]', _.constant('a'), Object);
- * // => { '0': { '1': 'a' } }
- */
- function updateWith(object, path, updater, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
- }
-
- /**
- * Creates an array of the own enumerable string keyed property values of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property values.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.values(new Foo);
- * // => [1, 2] (iteration order is not guaranteed)
- *
- * _.values('hi');
- * // => ['h', 'i']
- */
- function values(object) {
- return object == null ? [] : baseValues(object, keys(object));
- }
-
- /**
- * Creates an array of the own and inherited enumerable string keyed property
- * values of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property values.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.valuesIn(new Foo);
- * // => [1, 2, 3] (iteration order is not guaranteed)
- */
- function valuesIn(object) {
- return object == null ? [] : baseValues(object, keysIn(object));
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Clamps `number` within the inclusive `lower` and `upper` bounds.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Number
- * @param {number} number The number to clamp.
- * @param {number} [lower] The lower bound.
- * @param {number} upper The upper bound.
- * @returns {number} Returns the clamped number.
- * @example
- *
- * _.clamp(-10, -5, 5);
- * // => -5
- *
- * _.clamp(10, -5, 5);
- * // => 5
- */
- function clamp(number, lower, upper) {
- if (upper === undefined) {
- upper = lower;
- lower = undefined;
- }
- if (upper !== undefined) {
- upper = toNumber(upper);
- upper = upper === upper ? upper : 0;
- }
- if (lower !== undefined) {
- lower = toNumber(lower);
- lower = lower === lower ? lower : 0;
- }
- return baseClamp(toNumber(number), lower, upper);
- }
-
- /**
- * Checks if `n` is between `start` and up to, but not including, `end`. If
- * `end` is not specified, it's set to `start` with `start` then set to `0`.
- * If `start` is greater than `end` the params are swapped to support
- * negative ranges.
- *
- * @static
- * @memberOf _
- * @since 3.3.0
- * @category Number
- * @param {number} number The number to check.
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
- * @see _.range, _.rangeRight
- * @example
- *
- * _.inRange(3, 2, 4);
- * // => true
- *
- * _.inRange(4, 8);
- * // => true
- *
- * _.inRange(4, 2);
- * // => false
- *
- * _.inRange(2, 2);
- * // => false
- *
- * _.inRange(1.2, 2);
- * // => true
- *
- * _.inRange(5.2, 4);
- * // => false
- *
- * _.inRange(-3, -2, -6);
- * // => true
- */
- function inRange(number, start, end) {
- start = toFinite(start);
- if (end === undefined) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- number = toNumber(number);
- return baseInRange(number, start, end);
- }
-
- /**
- * Produces a random number between the inclusive `lower` and `upper` bounds.
- * If only one argument is provided a number between `0` and the given number
- * is returned. If `floating` is `true`, or either `lower` or `upper` are
- * floats, a floating-point number is returned instead of an integer.
- *
- * **Note:** JavaScript follows the IEEE-754 standard for resolving
- * floating-point values which can produce unexpected results.
- *
- * @static
- * @memberOf _
- * @since 0.7.0
- * @category Number
- * @param {number} [lower=0] The lower bound.
- * @param {number} [upper=1] The upper bound.
- * @param {boolean} [floating] Specify returning a floating-point number.
- * @returns {number} Returns the random number.
- * @example
- *
- * _.random(0, 5);
- * // => an integer between 0 and 5
- *
- * _.random(5);
- * // => also an integer between 0 and 5
- *
- * _.random(5, true);
- * // => a floating-point number between 0 and 5
- *
- * _.random(1.2, 5.2);
- * // => a floating-point number between 1.2 and 5.2
- */
- function random(lower, upper, floating) {
- if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
- upper = floating = undefined;
- }
- if (floating === undefined) {
- if (typeof upper == 'boolean') {
- floating = upper;
- upper = undefined;
- }
- else if (typeof lower == 'boolean') {
- floating = lower;
- lower = undefined;
- }
- }
- if (lower === undefined && upper === undefined) {
- lower = 0;
- upper = 1;
- }
- else {
- lower = toFinite(lower);
- if (upper === undefined) {
- upper = lower;
- lower = 0;
- } else {
- upper = toFinite(upper);
- }
- }
- if (lower > upper) {
- var temp = lower;
- lower = upper;
- upper = temp;
- }
- if (floating || lower % 1 || upper % 1) {
- var rand = nativeRandom();
- return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
- }
- return baseRandom(lower, upper);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the camel cased string.
- * @example
- *
- * _.camelCase('Foo Bar');
- * // => 'fooBar'
- *
- * _.camelCase('--foo-bar--');
- * // => 'fooBar'
- *
- * _.camelCase('__FOO_BAR__');
- * // => 'fooBar'
- */
- var camelCase = createCompounder(function(result, word, index) {
- word = word.toLowerCase();
- return result + (index ? capitalize(word) : word);
- });
-
- /**
- * Converts the first character of `string` to upper case and the remaining
- * to lower case.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to capitalize.
- * @returns {string} Returns the capitalized string.
- * @example
- *
- * _.capitalize('FRED');
- * // => 'Fred'
- */
- function capitalize(string) {
- return upperFirst(toString(string).toLowerCase());
- }
-
- /**
- * Deburrs `string` by converting
- * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
- * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
- * letters to basic Latin letters and removing
- * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to deburr.
- * @returns {string} Returns the deburred string.
- * @example
- *
- * _.deburr('déjà vu');
- * // => 'deja vu'
- */
- function deburr(string) {
- string = toString(string);
- return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
- }
-
- /**
- * Checks if `string` ends with the given target string.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to inspect.
- * @param {string} [target] The string to search for.
- * @param {number} [position=string.length] The position to search up to.
- * @returns {boolean} Returns `true` if `string` ends with `target`,
- * else `false`.
- * @example
- *
- * _.endsWith('abc', 'c');
- * // => true
- *
- * _.endsWith('abc', 'b');
- * // => false
- *
- * _.endsWith('abc', 'b', 2);
- * // => true
- */
- function endsWith(string, target, position) {
- string = toString(string);
- target = baseToString(target);
-
- var length = string.length;
- position = position === undefined
- ? length
- : baseClamp(toInteger(position), 0, length);
-
- var end = position;
- position -= target.length;
- return position >= 0 && string.slice(position, end) == target;
- }
-
- /**
- * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
- * corresponding HTML entities.
- *
- * **Note:** No other characters are escaped. To escape additional
- * characters use a third-party library like [_he_](https://mths.be/he).
- *
- * Though the ">" character is escaped for symmetry, characters like
- * ">" and "/" don't need escaping in HTML and have no special meaning
- * unless they're part of a tag or unquoted attribute value. See
- * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
- * (under "semi-related fun fact") for more details.
- *
- * When working with HTML you should always
- * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
- * XSS vectors.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to escape.
- * @returns {string} Returns the escaped string.
- * @example
- *
- * _.escape('fred, barney, & pebbles');
- * // => 'fred, barney, &amp; pebbles'
- */
- function escape(string) {
- string = toString(string);
- return (string && reHasUnescapedHtml.test(string))
- ? string.replace(reUnescapedHtml, escapeHtmlChar)
- : string;
- }
-
- /**
- * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
- * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to escape.
- * @returns {string} Returns the escaped string.
- * @example
- *
- * _.escapeRegExp('[lodash](https://lodash.com/)');
- * // => '\[lodash\]\(https://lodash\.com/\)'
- */
- function escapeRegExp(string) {
- string = toString(string);
- return (string && reHasRegExpChar.test(string))
- ? string.replace(reRegExpChar, '\\$&')
- : string;
- }
-
- /**
- * Converts `string` to
- * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the kebab cased string.
- * @example
- *
- * _.kebabCase('Foo Bar');
- * // => 'foo-bar'
- *
- * _.kebabCase('fooBar');
- * // => 'foo-bar'
- *
- * _.kebabCase('__FOO_BAR__');
- * // => 'foo-bar'
- */
- var kebabCase = createCompounder(function(result, word, index) {
- return result + (index ? '-' : '') + word.toLowerCase();
- });
-
- /**
- * Converts `string`, as space separated words, to lower case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the lower cased string.
- * @example
- *
- * _.lowerCase('--Foo-Bar--');
- * // => 'foo bar'
- *
- * _.lowerCase('fooBar');
- * // => 'foo bar'
- *
- * _.lowerCase('__FOO_BAR__');
- * // => 'foo bar'
- */
- var lowerCase = createCompounder(function(result, word, index) {
- return result + (index ? ' ' : '') + word.toLowerCase();
- });
-
- /**
- * Converts the first character of `string` to lower case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the converted string.
- * @example
- *
- * _.lowerFirst('Fred');
- * // => 'fred'
- *
- * _.lowerFirst('FRED');
- * // => 'fRED'
- */
- var lowerFirst = createCaseFirst('toLowerCase');
-
- /**
- * Pads `string` on the left and right sides if it's shorter than `length`.
- * Padding characters are truncated if they can't be evenly divided by `length`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.pad('abc', 8);
- * // => ' abc '
- *
- * _.pad('abc', 8, '_-');
- * // => '_-abc_-_'
- *
- * _.pad('abc', 3);
- * // => 'abc'
- */
- function pad(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
-
- var strLength = length ? stringSize(string) : 0;
- if (!length || strLength >= length) {
- return string;
- }
- var mid = (length - strLength) / 2;
- return (
- createPadding(nativeFloor(mid), chars) +
- string +
- createPadding(nativeCeil(mid), chars)
- );
- }
-
- /**
- * Pads `string` on the right side if it's shorter than `length`. Padding
- * characters are truncated if they exceed `length`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.padEnd('abc', 6);
- * // => 'abc '
- *
- * _.padEnd('abc', 6, '_-');
- * // => 'abc_-_'
- *
- * _.padEnd('abc', 3);
- * // => 'abc'
- */
- function padEnd(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
-
- var strLength = length ? stringSize(string) : 0;
- return (length && strLength < length)
- ? (string + createPadding(length - strLength, chars))
- : string;
- }
-
- /**
- * Pads `string` on the left side if it's shorter than `length`. Padding
- * characters are truncated if they exceed `length`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.padStart('abc', 6);
- * // => ' abc'
- *
- * _.padStart('abc', 6, '_-');
- * // => '_-_abc'
- *
- * _.padStart('abc', 3);
- * // => 'abc'
- */
- function padStart(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
-
- var strLength = length ? stringSize(string) : 0;
- return (length && strLength < length)
- ? (createPadding(length - strLength, chars) + string)
- : string;
- }
-
- /**
- * Converts `string` to an integer of the specified radix. If `radix` is
- * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
- * hexadecimal, in which case a `radix` of `16` is used.
- *
- * **Note:** This method aligns with the
- * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category String
- * @param {string} string The string to convert.
- * @param {number} [radix=10] The radix to interpret `value` by.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.parseInt('08');
- * // => 8
- *
- * _.map(['6', '08', '10'], _.parseInt);
- * // => [6, 8, 10]
- */
- function parseInt(string, radix, guard) {
- if (guard || radix == null) {
- radix = 0;
- } else if (radix) {
- radix = +radix;
- }
- return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
- }
-
- /**
- * Repeats the given string `n` times.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to repeat.
- * @param {number} [n=1] The number of times to repeat the string.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the repeated string.
- * @example
- *
- * _.repeat('*', 3);
- * // => '***'
- *
- * _.repeat('abc', 2);
- * // => 'abcabc'
- *
- * _.repeat('abc', 0);
- * // => ''
- */
- function repeat(string, n, guard) {
- if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
- n = 1;
- } else {
- n = toInteger(n);
- }
- return baseRepeat(toString(string), n);
- }
-
- /**
- * Replaces matches for `pattern` in `string` with `replacement`.
- *
- * **Note:** This method is based on
- * [`String#replace`](https://mdn.io/String/replace).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to modify.
- * @param {RegExp|string} pattern The pattern to replace.
- * @param {Function|string} replacement The match replacement.
- * @returns {string} Returns the modified string.
- * @example
- *
- * _.replace('Hi Fred', 'Fred', 'Barney');
- * // => 'Hi Barney'
- */
- function replace() {
- var args = arguments,
- string = toString(args[0]);
-
- return args.length < 3 ? string : string.replace(args[1], args[2]);
- }
-
- /**
- * Converts `string` to
- * [snake case](https://en.wikipedia.org/wiki/Snake_case).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the snake cased string.
- * @example
- *
- * _.snakeCase('Foo Bar');
- * // => 'foo_bar'
- *
- * _.snakeCase('fooBar');
- * // => 'foo_bar'
- *
- * _.snakeCase('--FOO-BAR--');
- * // => 'foo_bar'
- */
- var snakeCase = createCompounder(function(result, word, index) {
- return result + (index ? '_' : '') + word.toLowerCase();
- });
-
- /**
- * Splits `string` by `separator`.
- *
- * **Note:** This method is based on
- * [`String#split`](https://mdn.io/String/split).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to split.
- * @param {RegExp|string} separator The separator pattern to split by.
- * @param {number} [limit] The length to truncate results to.
- * @returns {Array} Returns the string segments.
- * @example
- *
- * _.split('a-b-c', '-', 2);
- * // => ['a', 'b']
- */
- function split(string, separator, limit) {
- if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
- separator = limit = undefined;
- }
- limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
- if (!limit) {
- return [];
- }
- string = toString(string);
- if (string && (
- typeof separator == 'string' ||
- (separator != null && !isRegExp(separator))
- )) {
- separator = baseToString(separator);
- if (!separator && hasUnicode(string)) {
- return castSlice(stringToArray(string), 0, limit);
- }
- }
- return string.split(separator, limit);
- }
-
- /**
- * Converts `string` to
- * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
- *
- * @static
- * @memberOf _
- * @since 3.1.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the start cased string.
- * @example
- *
- * _.startCase('--foo-bar--');
- * // => 'Foo Bar'
- *
- * _.startCase('fooBar');
- * // => 'Foo Bar'
- *
- * _.startCase('__FOO_BAR__');
- * // => 'FOO BAR'
- */
- var startCase = createCompounder(function(result, word, index) {
- return result + (index ? ' ' : '') + upperFirst(word);
- });
-
- /**
- * Checks if `string` starts with the given target string.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to inspect.
- * @param {string} [target] The string to search for.
- * @param {number} [position=0] The position to search from.
- * @returns {boolean} Returns `true` if `string` starts with `target`,
- * else `false`.
- * @example
- *
- * _.startsWith('abc', 'a');
- * // => true
- *
- * _.startsWith('abc', 'b');
- * // => false
- *
- * _.startsWith('abc', 'b', 1);
- * // => true
- */
- function startsWith(string, target, position) {
- string = toString(string);
- position = position == null
- ? 0
- : baseClamp(toInteger(position), 0, string.length);
-
- target = baseToString(target);
- return string.slice(position, position + target.length) == target;
- }
-
- /**
- * Creates a compiled template function that can interpolate data properties
- * in "interpolate" delimiters, HTML-escape interpolated data properties in
- * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
- * properties may be accessed as free variables in the template. If a setting
- * object is given, it takes precedence over `_.templateSettings` values.
- *
- * **Note:** In the development build `_.template` utilizes
- * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
- * for easier debugging.
- *
- * For more information on precompiling templates see
- * [lodash's custom builds documentation](https://lodash.com/custom-builds).
- *
- * For more information on Chrome extension sandboxes see
- * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category String
- * @param {string} [string=''] The template string.
- * @param {Object} [options={}] The options object.
- * @param {RegExp} [options.escape=_.templateSettings.escape]
- * The HTML "escape" delimiter.
- * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
- * The "evaluate" delimiter.
- * @param {Object} [options.imports=_.templateSettings.imports]
- * An object to import into the template as free variables.
- * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
- * The "interpolate" delimiter.
- * @param {string} [options.sourceURL='lodash.templateSources[n]']
- * The sourceURL of the compiled template.
- * @param {string} [options.variable='obj']
- * The data object variable name.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the compiled template function.
- * @example
- *
- * // Use the "interpolate" delimiter to create a compiled template.
- * var compiled = _.template('hello <%= user %>!');
- * compiled({ 'user': 'fred' });
- * // => 'hello fred!'
- *
- * // Use the HTML "escape" delimiter to escape data property values.
- * var compiled = _.template('<b><%- value %></b>');
- * compiled({ 'value': '<script>' });
- * // => '<b>&lt;script&gt;</b>'
- *
- * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
- * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
- * compiled({ 'users': ['fred', 'barney'] });
- * // => '<li>fred</li><li>barney</li>'
- *
- * // Use the internal `print` function in "evaluate" delimiters.
- * var compiled = _.template('<% print("hello " + user); %>!');
- * compiled({ 'user': 'barney' });
- * // => 'hello barney!'
- *
- * // Use the ES template literal delimiter as an "interpolate" delimiter.
- * // Disable support by replacing the "interpolate" delimiter.
- * var compiled = _.template('hello ${ user }!');
- * compiled({ 'user': 'pebbles' });
- * // => 'hello pebbles!'
- *
- * // Use backslashes to treat delimiters as plain text.
- * var compiled = _.template('<%= "\\<%- value %\\>" %>');
- * compiled({ 'value': 'ignored' });
- * // => '<%- value %>'
- *
- * // Use the `imports` option to import `jQuery` as `jq`.
- * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
- * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
- * compiled({ 'users': ['fred', 'barney'] });
- * // => '<li>fred</li><li>barney</li>'
- *
- * // Use the `sourceURL` option to specify a custom sourceURL for the template.
- * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
- * compiled(data);
- * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
- *
- * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
- * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
- * compiled.source;
- * // => function(data) {
- * // var __t, __p = '';
- * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
- * // return __p;
- * // }
- *
- * // Use custom template delimiters.
- * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
- * var compiled = _.template('hello {{ user }}!');
- * compiled({ 'user': 'mustache' });
- * // => 'hello mustache!'
- *
- * // Use the `source` property to inline compiled templates for meaningful
- * // line numbers in error messages and stack traces.
- * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
- * var JST = {\
- * "main": ' + _.template(mainText).source + '\
- * };\
- * ');
- */
- function template(string, options, guard) {
- // Based on John Resig's `tmpl` implementation
- // (http://ejohn.org/blog/javascript-micro-templating/)
- // and Laura Doktorova's doT.js (https://github.com/olado/doT).
- var settings = lodash.templateSettings;
-
- if (guard && isIterateeCall(string, options, guard)) {
- options = undefined;
- }
- string = toString(string);
- options = assignInWith({}, options, settings, customDefaultsAssignIn);
-
- var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
- importsKeys = keys(imports),
- importsValues = baseValues(imports, importsKeys);
-
- var isEscaping,
- isEvaluating,
- index = 0,
- interpolate = options.interpolate || reNoMatch,
- source = "__p += '";
-
- // Compile the regexp to match each delimiter.
- var reDelimiters = RegExp(
- (options.escape || reNoMatch).source + '|' +
- interpolate.source + '|' +
- (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
- (options.evaluate || reNoMatch).source + '|$'
- , 'g');
-
- // Use a sourceURL for easier debugging.
- var sourceURL = '//# sourceURL=' +
- ('sourceURL' in options
- ? options.sourceURL
- : ('lodash.templateSources[' + (++templateCounter) + ']')
- ) + '\n';
-
- string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
- interpolateValue || (interpolateValue = esTemplateValue);
-
- // Escape characters that can't be included in string literals.
- source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
-
- // Replace delimiters with snippets.
- if (escapeValue) {
- isEscaping = true;
- source += "' +\n__e(" + escapeValue + ") +\n'";
- }
- if (evaluateValue) {
- isEvaluating = true;
- source += "';\n" + evaluateValue + ";\n__p += '";
- }
- if (interpolateValue) {
- source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
- }
- index = offset + match.length;
-
- // The JS engine embedded in Adobe products needs `match` returned in
- // order to produce the correct `offset` value.
- return match;
- });
-
- source += "';\n";
-
- // If `variable` is not specified wrap a with-statement around the generated
- // code to add the data object to the top of the scope chain.
- var variable = options.variable;
- if (!variable) {
- source = 'with (obj) {\n' + source + '\n}\n';
- }
- // Cleanup code by stripping empty strings.
- source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
- .replace(reEmptyStringMiddle, '$1')
- .replace(reEmptyStringTrailing, '$1;');
-
- // Frame code as the function body.
- source = 'function(' + (variable || 'obj') + ') {\n' +
- (variable
- ? ''
- : 'obj || (obj = {});\n'
- ) +
- "var __t, __p = ''" +
- (isEscaping
- ? ', __e = _.escape'
- : ''
- ) +
- (isEvaluating
- ? ', __j = Array.prototype.join;\n' +
- "function print() { __p += __j.call(arguments, '') }\n"
- : ';\n'
- ) +
- source +
- 'return __p\n}';
-
- var result = attempt(function() {
- return Function(importsKeys, sourceURL + 'return ' + source)
- .apply(undefined, importsValues);
- });
-
- // Provide the compiled function's source by its `toString` method or
- // the `source` property as a convenience for inlining compiled templates.
- result.source = source;
- if (isError(result)) {
- throw result;
- }
- return result;
- }
-
- /**
- * Converts `string`, as a whole, to lower case just like
- * [String#toLowerCase](https://mdn.io/toLowerCase).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the lower cased string.
- * @example
- *
- * _.toLower('--Foo-Bar--');
- * // => '--foo-bar--'
- *
- * _.toLower('fooBar');
- * // => 'foobar'
- *
- * _.toLower('__FOO_BAR__');
- * // => '__foo_bar__'
- */
- function toLower(value) {
- return toString(value).toLowerCase();
- }
-
- /**
- * Converts `string`, as a whole, to upper case just like
- * [String#toUpperCase](https://mdn.io/toUpperCase).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the upper cased string.
- * @example
- *
- * _.toUpper('--foo-bar--');
- * // => '--FOO-BAR--'
- *
- * _.toUpper('fooBar');
- * // => 'FOOBAR'
- *
- * _.toUpper('__foo_bar__');
- * // => '__FOO_BAR__'
- */
- function toUpper(value) {
- return toString(value).toUpperCase();
- }
-
- /**
- * Removes leading and trailing whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trim(' abc ');
- * // => 'abc'
- *
- * _.trim('-_-abc-_-', '_-');
- * // => 'abc'
- *
- * _.map([' foo ', ' bar '], _.trim);
- * // => ['foo', 'bar']
- */
- function trim(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined)) {
- return string.replace(reTrim, '');
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string),
- chrSymbols = stringToArray(chars),
- start = charsStartIndex(strSymbols, chrSymbols),
- end = charsEndIndex(strSymbols, chrSymbols) + 1;
-
- return castSlice(strSymbols, start, end).join('');
- }
-
- /**
- * Removes trailing whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trimEnd(' abc ');
- * // => ' abc'
- *
- * _.trimEnd('-_-abc-_-', '_-');
- * // => '-_-abc'
- */
- function trimEnd(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined)) {
- return string.replace(reTrimEnd, '');
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string),
- end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
-
- return castSlice(strSymbols, 0, end).join('');
- }
-
- /**
- * Removes leading whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trimStart(' abc ');
- * // => 'abc '
- *
- * _.trimStart('-_-abc-_-', '_-');
- * // => 'abc-_-'
- */
- function trimStart(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined)) {
- return string.replace(reTrimStart, '');
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string),
- start = charsStartIndex(strSymbols, stringToArray(chars));
-
- return castSlice(strSymbols, start).join('');
- }
-
- /**
- * Truncates `string` if it's longer than the given maximum string length.
- * The last characters of the truncated string are replaced with the omission
- * string which defaults to "...".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to truncate.
- * @param {Object} [options={}] The options object.
- * @param {number} [options.length=30] The maximum string length.
- * @param {string} [options.omission='...'] The string to indicate text is omitted.
- * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
- * @returns {string} Returns the truncated string.
- * @example
- *
- * _.truncate('hi-diddly-ho there, neighborino');
- * // => 'hi-diddly-ho there, neighbo...'
- *
- * _.truncate('hi-diddly-ho there, neighborino', {
- * 'length': 24,
- * 'separator': ' '
- * });
- * // => 'hi-diddly-ho there,...'
- *
- * _.truncate('hi-diddly-ho there, neighborino', {
- * 'length': 24,
- * 'separator': /,? +/
- * });
- * // => 'hi-diddly-ho there...'
- *
- * _.truncate('hi-diddly-ho there, neighborino', {
- * 'omission': ' [...]'
- * });
- * // => 'hi-diddly-ho there, neig [...]'
- */
- function truncate(string, options) {
- var length = DEFAULT_TRUNC_LENGTH,
- omission = DEFAULT_TRUNC_OMISSION;
-
- if (isObject(options)) {
- var separator = 'separator' in options ? options.separator : separator;
- length = 'length' in options ? toInteger(options.length) : length;
- omission = 'omission' in options ? baseToString(options.omission) : omission;
- }
- string = toString(string);
-
- var strLength = string.length;
- if (hasUnicode(string)) {
- var strSymbols = stringToArray(string);
- strLength = strSymbols.length;
- }
- if (length >= strLength) {
- return string;
- }
- var end = length - stringSize(omission);
- if (end < 1) {
- return omission;
- }
- var result = strSymbols
- ? castSlice(strSymbols, 0, end).join('')
- : string.slice(0, end);
-
- if (separator === undefined) {
- return result + omission;
- }
- if (strSymbols) {
- end += (result.length - end);
- }
- if (isRegExp(separator)) {
- if (string.slice(end).search(separator)) {
- var match,
- substring = result;
-
- if (!separator.global) {
- separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
- }
- separator.lastIndex = 0;
- while ((match = separator.exec(substring))) {
- var newEnd = match.index;
- }
- result = result.slice(0, newEnd === undefined ? end : newEnd);
- }
- } else if (string.indexOf(baseToString(separator), end) != end) {
- var index = result.lastIndexOf(separator);
- if (index > -1) {
- result = result.slice(0, index);
- }
- }
- return result + omission;
- }
-
- /**
- * The inverse of `_.escape`; this method converts the HTML entities
- * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
- * their corresponding characters.
- *
- * **Note:** No other HTML entities are unescaped. To unescape additional
- * HTML entities use a third-party library like [_he_](https://mths.be/he).
- *
- * @static
- * @memberOf _
- * @since 0.6.0
- * @category String
- * @param {string} [string=''] The string to unescape.
- * @returns {string} Returns the unescaped string.
- * @example
- *
- * _.unescape('fred, barney, &amp; pebbles');
- * // => 'fred, barney, & pebbles'
- */
- function unescape(string) {
- string = toString(string);
- return (string && reHasEscapedHtml.test(string))
- ? string.replace(reEscapedHtml, unescapeHtmlChar)
- : string;
- }
-
- /**
- * Converts `string`, as space separated words, to upper case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the upper cased string.
- * @example
- *
- * _.upperCase('--foo-bar');
- * // => 'FOO BAR'
- *
- * _.upperCase('fooBar');
- * // => 'FOO BAR'
- *
- * _.upperCase('__foo_bar__');
- * // => 'FOO BAR'
- */
- var upperCase = createCompounder(function(result, word, index) {
- return result + (index ? ' ' : '') + word.toUpperCase();
- });
-
- /**
- * Converts the first character of `string` to upper case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the converted string.
- * @example
- *
- * _.upperFirst('fred');
- * // => 'Fred'
- *
- * _.upperFirst('FRED');
- * // => 'FRED'
- */
- var upperFirst = createCaseFirst('toUpperCase');
-
- /**
- * Splits `string` into an array of its words.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to inspect.
- * @param {RegExp|string} [pattern] The pattern to match words.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the words of `string`.
- * @example
- *
- * _.words('fred, barney, & pebbles');
- * // => ['fred', 'barney', 'pebbles']
- *
- * _.words('fred, barney, & pebbles', /[^, ]+/g);
- * // => ['fred', 'barney', '&', 'pebbles']
- */
- function words(string, pattern, guard) {
- string = toString(string);
- pattern = guard ? undefined : pattern;
-
- if (pattern === undefined) {
- return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
- }
- return string.match(pattern) || [];
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Attempts to invoke `func`, returning either the result or the caught error
- * object. Any additional arguments are provided to `func` when it's invoked.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {Function} func The function to attempt.
- * @param {...*} [args] The arguments to invoke `func` with.
- * @returns {*} Returns the `func` result or error object.
- * @example
- *
- * // Avoid throwing errors for invalid selectors.
- * var elements = _.attempt(function(selector) {
- * return document.querySelectorAll(selector);
- * }, '>_>');
- *
- * if (_.isError(elements)) {
- * elements = [];
- * }
- */
- var attempt = baseRest(function(func, args) {
- try {
- return apply(func, undefined, args);
- } catch (e) {
- return isError(e) ? e : new Error(e);
- }
- });
-
- /**
- * Binds methods of an object to the object itself, overwriting the existing
- * method.
- *
- * **Note:** This method doesn't set the "length" property of bound functions.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {Object} object The object to bind and assign the bound methods to.
- * @param {...(string|string[])} methodNames The object method names to bind.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var view = {
- * 'label': 'docs',
- * 'click': function() {
- * console.log('clicked ' + this.label);
- * }
- * };
- *
- * _.bindAll(view, ['click']);
- * jQuery(element).on('click', view.click);
- * // => Logs 'clicked docs' when clicked.
- */
- var bindAll = flatRest(function(object, methodNames) {
- arrayEach(methodNames, function(key) {
- key = toKey(key);
- baseAssignValue(object, key, bind(object[key], object));
- });
- return object;
- });
-
- /**
- * Creates a function that iterates over `pairs` and invokes the corresponding
- * function of the first predicate to return truthy. The predicate-function
- * pairs are invoked with the `this` binding and arguments of the created
- * function.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {Array} pairs The predicate-function pairs.
- * @returns {Function} Returns the new composite function.
- * @example
- *
- * var func = _.cond([
- * [_.matches({ 'a': 1 }), _.constant('matches A')],
- * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
- * [_.stubTrue, _.constant('no match')]
- * ]);
- *
- * func({ 'a': 1, 'b': 2 });
- * // => 'matches A'
- *
- * func({ 'a': 0, 'b': 1 });
- * // => 'matches B'
- *
- * func({ 'a': '1', 'b': '2' });
- * // => 'no match'
- */
- function cond(pairs) {
- var length = pairs == null ? 0 : pairs.length,
- toIteratee = getIteratee();
-
- pairs = !length ? [] : arrayMap(pairs, function(pair) {
- if (typeof pair[1] != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return [toIteratee(pair[0]), pair[1]];
- });
-
- return baseRest(function(args) {
- var index = -1;
- while (++index < length) {
- var pair = pairs[index];
- if (apply(pair[0], this, args)) {
- return apply(pair[1], this, args);
- }
- }
- });
- }
-
- /**
- * Creates a function that invokes the predicate properties of `source` with
- * the corresponding property values of a given object, returning `true` if
- * all predicates return truthy, else `false`.
- *
- * **Note:** The created function is equivalent to `_.conformsTo` with
- * `source` partially applied.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {Object} source The object of property predicates to conform to.
- * @returns {Function} Returns the new spec function.
- * @example
- *
- * var objects = [
- * { 'a': 2, 'b': 1 },
- * { 'a': 1, 'b': 2 }
- * ];
- *
- * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
- * // => [{ 'a': 1, 'b': 2 }]
- */
- function conforms(source) {
- return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
- }
-
- /**
- * Creates a function that returns `value`.
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Util
- * @param {*} value The value to return from the new function.
- * @returns {Function} Returns the new constant function.
- * @example
- *
- * var objects = _.times(2, _.constant({ 'a': 1 }));
- *
- * console.log(objects);
- * // => [{ 'a': 1 }, { 'a': 1 }]
- *
- * console.log(objects[0] === objects[1]);
- * // => true
- */
- function constant(value) {
- return function() {
- return value;
- };
- }
-
- /**
- * Checks `value` to determine whether a default value should be returned in
- * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
- * or `undefined`.
- *
- * @static
- * @memberOf _
- * @since 4.14.0
- * @category Util
- * @param {*} value The value to check.
- * @param {*} defaultValue The default value.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * _.defaultTo(1, 10);
- * // => 1
- *
- * _.defaultTo(undefined, 10);
- * // => 10
- */
- function defaultTo(value, defaultValue) {
- return (value == null || value !== value) ? defaultValue : value;
- }
-
- /**
- * Creates a function that returns the result of invoking the given functions
- * with the `this` binding of the created function, where each successive
- * invocation is supplied the return value of the previous.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {...(Function|Function[])} [funcs] The functions to invoke.
- * @returns {Function} Returns the new composite function.
- * @see _.flowRight
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var addSquare = _.flow([_.add, square]);
- * addSquare(1, 2);
- * // => 9
- */
- var flow = createFlow();
-
- /**
- * This method is like `_.flow` except that it creates a function that
- * invokes the given functions from right to left.
- *
- * @static
- * @since 3.0.0
- * @memberOf _
- * @category Util
- * @param {...(Function|Function[])} [funcs] The functions to invoke.
- * @returns {Function} Returns the new composite function.
- * @see _.flow
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var addSquare = _.flowRight([square, _.add]);
- * addSquare(1, 2);
- * // => 9
- */
- var flowRight = createFlow(true);
-
- /**
- * This method returns the first argument it receives.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {*} value Any value.
- * @returns {*} Returns `value`.
- * @example
- *
- * var object = { 'a': 1 };
- *
- * console.log(_.identity(object) === object);
- * // => true
- */
- function identity(value) {
- return value;
- }
-
- /**
- * Creates a function that invokes `func` with the arguments of the created
- * function. If `func` is a property name, the created function returns the
- * property value for a given element. If `func` is an array or object, the
- * created function returns `true` for elements that contain the equivalent
- * source properties, otherwise it returns `false`.
- *
- * @static
- * @since 4.0.0
- * @memberOf _
- * @category Util
- * @param {*} [func=_.identity] The value to convert to a callback.
- * @returns {Function} Returns the callback.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * // The `_.matches` iteratee shorthand.
- * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
- * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.filter(users, _.iteratee(['user', 'fred']));
- * // => [{ 'user': 'fred', 'age': 40 }]
- *
- * // The `_.property` iteratee shorthand.
- * _.map(users, _.iteratee('user'));
- * // => ['barney', 'fred']
- *
- * // Create custom iteratee shorthands.
- * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
- * return !_.isRegExp(func) ? iteratee(func) : function(string) {
- * return func.test(string);
- * };
- * });
- *
- * _.filter(['abc', 'def'], /ef/);
- * // => ['def']
- */
- function iteratee(func) {
- return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
- }
-
- /**
- * Creates a function that performs a partial deep comparison between a given
- * object and `source`, returning `true` if the given object has equivalent
- * property values, else `false`.
- *
- * **Note:** The created function is equivalent to `_.isMatch` with `source`
- * partially applied.
- *
- * Partial comparisons will match empty array and empty object `source`
- * values against any array or object value, respectively. See `_.isEqual`
- * for a list of supported value comparisons.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {Object} source The object of property values to match.
- * @returns {Function} Returns the new spec function.
- * @example
- *
- * var objects = [
- * { 'a': 1, 'b': 2, 'c': 3 },
- * { 'a': 4, 'b': 5, 'c': 6 }
- * ];
- *
- * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
- * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
- */
- function matches(source) {
- return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
- }
-
- /**
- * Creates a function that performs a partial deep comparison between the
- * value at `path` of a given object to `srcValue`, returning `true` if the
- * object value is equivalent, else `false`.
- *
- * **Note:** Partial comparisons will match empty array and empty object
- * `srcValue` values against any array or object value, respectively. See
- * `_.isEqual` for a list of supported value comparisons.
- *
- * @static
- * @memberOf _
- * @since 3.2.0
- * @category Util
- * @param {Array|string} path The path of the property to get.
- * @param {*} srcValue The value to match.
- * @returns {Function} Returns the new spec function.
- * @example
- *
- * var objects = [
- * { 'a': 1, 'b': 2, 'c': 3 },
- * { 'a': 4, 'b': 5, 'c': 6 }
- * ];
- *
- * _.find(objects, _.matchesProperty('a', 4));
- * // => { 'a': 4, 'b': 5, 'c': 6 }
- */
- function matchesProperty(path, srcValue) {
- return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
- }
-
- /**
- * Creates a function that invokes the method at `path` of a given object.
- * Any additional arguments are provided to the invoked method.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Util
- * @param {Array|string} path The path of the method to invoke.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {Function} Returns the new invoker function.
- * @example
- *
- * var objects = [
- * { 'a': { 'b': _.constant(2) } },
- * { 'a': { 'b': _.constant(1) } }
- * ];
- *
- * _.map(objects, _.method('a.b'));
- * // => [2, 1]
- *
- * _.map(objects, _.method(['a', 'b']));
- * // => [2, 1]
- */
- var method = baseRest(function(path, args) {
- return function(object) {
- return baseInvoke(object, path, args);
- };
- });
-
- /**
- * The opposite of `_.method`; this method creates a function that invokes
- * the method at a given path of `object`. Any additional arguments are
- * provided to the invoked method.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Util
- * @param {Object} object The object to query.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {Function} Returns the new invoker function.
- * @example
- *
- * var array = _.times(3, _.constant),
- * object = { 'a': array, 'b': array, 'c': array };
- *
- * _.map(['a[2]', 'c[0]'], _.methodOf(object));
- * // => [2, 0]
- *
- * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
- * // => [2, 0]
- */
- var methodOf = baseRest(function(object, args) {
- return function(path) {
- return baseInvoke(object, path, args);
- };
- });
-
- /**
- * Adds all own enumerable string keyed function properties of a source
- * object to the destination object. If `object` is a function, then methods
- * are added to its prototype as well.
- *
- * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
- * avoid conflicts caused by modifying the original.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {Function|Object} [object=lodash] The destination object.
- * @param {Object} source The object of functions to add.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
- * @returns {Function|Object} Returns `object`.
- * @example
- *
- * function vowels(string) {
- * return _.filter(string, function(v) {
- * return /[aeiou]/i.test(v);
- * });
- * }
- *
- * _.mixin({ 'vowels': vowels });
- * _.vowels('fred');
- * // => ['e']
- *
- * _('fred').vowels().value();
- * // => ['e']
- *
- * _.mixin({ 'vowels': vowels }, { 'chain': false });
- * _('fred').vowels();
- * // => ['e']
- */
- function mixin(object, source, options) {
- var props = keys(source),
- methodNames = baseFunctions(source, props);
-
- if (options == null &&
- !(isObject(source) && (methodNames.length || !props.length))) {
- options = source;
- source = object;
- object = this;
- methodNames = baseFunctions(source, keys(source));
- }
- var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
- isFunc = isFunction(object);
-
- arrayEach(methodNames, function(methodName) {
- var func = source[methodName];
- object[methodName] = func;
- if (isFunc) {
- object.prototype[methodName] = function() {
- var chainAll = this.__chain__;
- if (chain || chainAll) {
- var result = object(this.__wrapped__),
- actions = result.__actions__ = copyArray(this.__actions__);
-
- actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
- result.__chain__ = chainAll;
- return result;
- }
- return func.apply(object, arrayPush([this.value()], arguments));
- };
- }
- });
-
- return object;
- }
-
- /**
- * Reverts the `_` variable to its previous value and returns a reference to
- * the `lodash` function.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @returns {Function} Returns the `lodash` function.
- * @example
- *
- * var lodash = _.noConflict();
- */
- function noConflict() {
- if (root._ === this) {
- root._ = oldDash;
- }
- return this;
- }
-
- /**
- * This method returns `undefined`.
- *
- * @static
- * @memberOf _
- * @since 2.3.0
- * @category Util
- * @example
- *
- * _.times(2, _.noop);
- * // => [undefined, undefined]
- */
- function noop() {
- // No operation performed.
- }
-
- /**
- * Creates a function that gets the argument at index `n`. If `n` is negative,
- * the nth argument from the end is returned.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {number} [n=0] The index of the argument to return.
- * @returns {Function} Returns the new pass-thru function.
- * @example
- *
- * var func = _.nthArg(1);
- * func('a', 'b', 'c', 'd');
- * // => 'b'
- *
- * var func = _.nthArg(-2);
- * func('a', 'b', 'c', 'd');
- * // => 'c'
- */
- function nthArg(n) {
- n = toInteger(n);
- return baseRest(function(args) {
- return baseNth(args, n);
- });
- }
-
- /**
- * Creates a function that invokes `iteratees` with the arguments it receives
- * and returns their results.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {...(Function|Function[])} [iteratees=[_.identity]]
- * The iteratees to invoke.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var func = _.over([Math.max, Math.min]);
- *
- * func(1, 2, 3, 4);
- * // => [4, 1]
- */
- var over = createOver(arrayMap);
-
- /**
- * Creates a function that checks if **all** of the `predicates` return
- * truthy when invoked with the arguments it receives.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {...(Function|Function[])} [predicates=[_.identity]]
- * The predicates to check.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var func = _.overEvery([Boolean, isFinite]);
- *
- * func('1');
- * // => true
- *
- * func(null);
- * // => false
- *
- * func(NaN);
- * // => false
- */
- var overEvery = createOver(arrayEvery);
-
- /**
- * Creates a function that checks if **any** of the `predicates` return
- * truthy when invoked with the arguments it receives.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {...(Function|Function[])} [predicates=[_.identity]]
- * The predicates to check.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var func = _.overSome([Boolean, isFinite]);
- *
- * func('1');
- * // => true
- *
- * func(null);
- * // => true
- *
- * func(NaN);
- * // => false
- */
- var overSome = createOver(arraySome);
-
- /**
- * Creates a function that returns the value at `path` of a given object.
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Util
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new accessor function.
- * @example
- *
- * var objects = [
- * { 'a': { 'b': 2 } },
- * { 'a': { 'b': 1 } }
- * ];
- *
- * _.map(objects, _.property('a.b'));
- * // => [2, 1]
- *
- * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
- * // => [1, 2]
- */
- function property(path) {
- return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
- }
-
- /**
- * The opposite of `_.property`; this method creates a function that returns
- * the value at a given path of `object`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {Object} object The object to query.
- * @returns {Function} Returns the new accessor function.
- * @example
- *
- * var array = [0, 1, 2],
- * object = { 'a': array, 'b': array, 'c': array };
- *
- * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
- * // => [2, 0]
- *
- * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
- * // => [2, 0]
- */
- function propertyOf(object) {
- return function(path) {
- return object == null ? undefined : baseGet(object, path);
- };
- }
-
- /**
- * Creates an array of numbers (positive and/or negative) progressing from
- * `start` up to, but not including, `end`. A step of `-1` is used if a negative
- * `start` is specified without an `end` or `step`. If `end` is not specified,
- * it's set to `start` with `start` then set to `0`.
- *
- * **Note:** JavaScript follows the IEEE-754 standard for resolving
- * floating-point values which can produce unexpected results.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @param {number} [step=1] The value to increment or decrement by.
- * @returns {Array} Returns the range of numbers.
- * @see _.inRange, _.rangeRight
- * @example
- *
- * _.range(4);
- * // => [0, 1, 2, 3]
- *
- * _.range(-4);
- * // => [0, -1, -2, -3]
- *
- * _.range(1, 5);
- * // => [1, 2, 3, 4]
- *
- * _.range(0, 20, 5);
- * // => [0, 5, 10, 15]
- *
- * _.range(0, -4, -1);
- * // => [0, -1, -2, -3]
- *
- * _.range(1, 4, 0);
- * // => [1, 1, 1]
- *
- * _.range(0);
- * // => []
- */
- var range = createRange();
-
- /**
- * This method is like `_.range` except that it populates values in
- * descending order.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @param {number} [step=1] The value to increment or decrement by.
- * @returns {Array} Returns the range of numbers.
- * @see _.inRange, _.range
- * @example
- *
- * _.rangeRight(4);
- * // => [3, 2, 1, 0]
- *
- * _.rangeRight(-4);
- * // => [-3, -2, -1, 0]
- *
- * _.rangeRight(1, 5);
- * // => [4, 3, 2, 1]
- *
- * _.rangeRight(0, 20, 5);
- * // => [15, 10, 5, 0]
- *
- * _.rangeRight(0, -4, -1);
- * // => [-3, -2, -1, 0]
- *
- * _.rangeRight(1, 4, 0);
- * // => [1, 1, 1]
- *
- * _.rangeRight(0);
- * // => []
- */
- var rangeRight = createRange(true);
-
- /**
- * This method returns a new empty array.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {Array} Returns the new empty array.
- * @example
- *
- * var arrays = _.times(2, _.stubArray);
- *
- * console.log(arrays);
- * // => [[], []]
- *
- * console.log(arrays[0] === arrays[1]);
- * // => false
- */
- function stubArray() {
- return [];
- }
-
- /**
- * This method returns `false`.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {boolean} Returns `false`.
- * @example
- *
- * _.times(2, _.stubFalse);
- * // => [false, false]
- */
- function stubFalse() {
- return false;
- }
-
- /**
- * This method returns a new empty object.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {Object} Returns the new empty object.
- * @example
- *
- * var objects = _.times(2, _.stubObject);
- *
- * console.log(objects);
- * // => [{}, {}]
- *
- * console.log(objects[0] === objects[1]);
- * // => false
- */
- function stubObject() {
- return {};
- }
-
- /**
- * This method returns an empty string.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {string} Returns the empty string.
- * @example
- *
- * _.times(2, _.stubString);
- * // => ['', '']
- */
- function stubString() {
- return '';
- }
-
- /**
- * This method returns `true`.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {boolean} Returns `true`.
- * @example
- *
- * _.times(2, _.stubTrue);
- * // => [true, true]
- */
- function stubTrue() {
- return true;
- }
-
- /**
- * Invokes the iteratee `n` times, returning an array of the results of
- * each invocation. The iteratee is invoked with one argument; (index).
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {number} n The number of times to invoke `iteratee`.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the array of results.
- * @example
- *
- * _.times(3, String);
- * // => ['0', '1', '2']
- *
- * _.times(4, _.constant(0));
- * // => [0, 0, 0, 0]
- */
- function times(n, iteratee) {
- n = toInteger(n);
- if (n < 1 || n > MAX_SAFE_INTEGER) {
- return [];
- }
- var index = MAX_ARRAY_LENGTH,
- length = nativeMin(n, MAX_ARRAY_LENGTH);
-
- iteratee = getIteratee(iteratee);
- n -= MAX_ARRAY_LENGTH;
-
- var result = baseTimes(length, iteratee);
- while (++index < n) {
- iteratee(index);
- }
- return result;
- }
-
- /**
- * Converts `value` to a property path array.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {*} value The value to convert.
- * @returns {Array} Returns the new property path array.
- * @example
- *
- * _.toPath('a.b.c');
- * // => ['a', 'b', 'c']
- *
- * _.toPath('a[0].b.c');
- * // => ['a', '0', 'b', 'c']
- */
- function toPath(value) {
- if (isArray(value)) {
- return arrayMap(value, toKey);
- }
- return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
- }
-
- /**
- * Generates a unique ID. If `prefix` is given, the ID is appended to it.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {string} [prefix=''] The value to prefix the ID with.
- * @returns {string} Returns the unique ID.
- * @example
- *
- * _.uniqueId('contact_');
- * // => 'contact_104'
- *
- * _.uniqueId();
- * // => '105'
- */
- function uniqueId(prefix) {
- var id = ++idCounter;
- return toString(prefix) + id;
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Adds two numbers.
- *
- * @static
- * @memberOf _
- * @since 3.4.0
- * @category Math
- * @param {number} augend The first number in an addition.
- * @param {number} addend The second number in an addition.
- * @returns {number} Returns the total.
- * @example
- *
- * _.add(6, 4);
- * // => 10
- */
- var add = createMathOperation(function(augend, addend) {
- return augend + addend;
- }, 0);
-
- /**
- * Computes `number` rounded up to `precision`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Math
- * @param {number} number The number to round up.
- * @param {number} [precision=0] The precision to round up to.
- * @returns {number} Returns the rounded up number.
- * @example
- *
- * _.ceil(4.006);
- * // => 5
- *
- * _.ceil(6.004, 2);
- * // => 6.01
- *
- * _.ceil(6040, -2);
- * // => 6100
- */
- var ceil = createRound('ceil');
-
- /**
- * Divide two numbers.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Math
- * @param {number} dividend The first number in a division.
- * @param {number} divisor The second number in a division.
- * @returns {number} Returns the quotient.
- * @example
- *
- * _.divide(6, 4);
- * // => 1.5
- */
- var divide = createMathOperation(function(dividend, divisor) {
- return dividend / divisor;
- }, 1);
-
- /**
- * Computes `number` rounded down to `precision`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Math
- * @param {number} number The number to round down.
- * @param {number} [precision=0] The precision to round down to.
- * @returns {number} Returns the rounded down number.
- * @example
- *
- * _.floor(4.006);
- * // => 4
- *
- * _.floor(0.046, 2);
- * // => 0.04
- *
- * _.floor(4060, -2);
- * // => 4000
- */
- var floor = createRound('floor');
-
- /**
- * Computes the maximum value of `array`. If `array` is empty or falsey,
- * `undefined` is returned.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {*} Returns the maximum value.
- * @example
- *
- * _.max([4, 2, 8, 6]);
- * // => 8
- *
- * _.max([]);
- * // => undefined
- */
- function max(array) {
- return (array && array.length)
- ? baseExtremum(array, identity, baseGt)
- : undefined;
- }
-
- /**
- * This method is like `_.max` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the criterion by which
- * the value is ranked. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {*} Returns the maximum value.
- * @example
- *
- * var objects = [{ 'n': 1 }, { 'n': 2 }];
- *
- * _.maxBy(objects, function(o) { return o.n; });
- * // => { 'n': 2 }
- *
- * // The `_.property` iteratee shorthand.
- * _.maxBy(objects, 'n');
- * // => { 'n': 2 }
- */
- function maxBy(array, iteratee) {
- return (array && array.length)
- ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
- : undefined;
- }
-
- /**
- * Computes the mean of the values in `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {number} Returns the mean.
- * @example
- *
- * _.mean([4, 2, 8, 6]);
- * // => 5
- */
- function mean(array) {
- return baseMean(array, identity);
- }
-
- /**
- * This method is like `_.mean` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the value to be averaged.
- * The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the mean.
- * @example
- *
- * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
- *
- * _.meanBy(objects, function(o) { return o.n; });
- * // => 5
- *
- * // The `_.property` iteratee shorthand.
- * _.meanBy(objects, 'n');
- * // => 5
- */
- function meanBy(array, iteratee) {
- return baseMean(array, getIteratee(iteratee, 2));
- }
-
- /**
- * Computes the minimum value of `array`. If `array` is empty or falsey,
- * `undefined` is returned.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {*} Returns the minimum value.
- * @example
- *
- * _.min([4, 2, 8, 6]);
- * // => 2
- *
- * _.min([]);
- * // => undefined
- */
- function min(array) {
- return (array && array.length)
- ? baseExtremum(array, identity, baseLt)
- : undefined;
- }
-
- /**
- * This method is like `_.min` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the criterion by which
- * the value is ranked. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {*} Returns the minimum value.
- * @example
- *
- * var objects = [{ 'n': 1 }, { 'n': 2 }];
- *
- * _.minBy(objects, function(o) { return o.n; });
- * // => { 'n': 1 }
- *
- * // The `_.property` iteratee shorthand.
- * _.minBy(objects, 'n');
- * // => { 'n': 1 }
- */
- function minBy(array, iteratee) {
- return (array && array.length)
- ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
- : undefined;
- }
-
- /**
- * Multiply two numbers.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Math
- * @param {number} multiplier The first number in a multiplication.
- * @param {number} multiplicand The second number in a multiplication.
- * @returns {number} Returns the product.
- * @example
- *
- * _.multiply(6, 4);
- * // => 24
- */
- var multiply = createMathOperation(function(multiplier, multiplicand) {
- return multiplier * multiplicand;
- }, 1);
-
- /**
- * Computes `number` rounded to `precision`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Math
- * @param {number} number The number to round.
- * @param {number} [precision=0] The precision to round to.
- * @returns {number} Returns the rounded number.
- * @example
- *
- * _.round(4.006);
- * // => 4
- *
- * _.round(4.006, 2);
- * // => 4.01
- *
- * _.round(4060, -2);
- * // => 4100
- */
- var round = createRound('round');
-
- /**
- * Subtract two numbers.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {number} minuend The first number in a subtraction.
- * @param {number} subtrahend The second number in a subtraction.
- * @returns {number} Returns the difference.
- * @example
- *
- * _.subtract(6, 4);
- * // => 2
- */
- var subtract = createMathOperation(function(minuend, subtrahend) {
- return minuend - subtrahend;
- }, 0);
-
- /**
- * Computes the sum of the values in `array`.
- *
- * @static
- * @memberOf _
- * @since 3.4.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {number} Returns the sum.
- * @example
- *
- * _.sum([4, 2, 8, 6]);
- * // => 20
- */
- function sum(array) {
- return (array && array.length)
- ? baseSum(array, identity)
- : 0;
- }
-
- /**
- * This method is like `_.sum` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the value to be summed.
- * The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the sum.
- * @example
- *
- * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
- *
- * _.sumBy(objects, function(o) { return o.n; });
- * // => 20
- *
- * // The `_.property` iteratee shorthand.
- * _.sumBy(objects, 'n');
- * // => 20
- */
- function sumBy(array, iteratee) {
- return (array && array.length)
- ? baseSum(array, getIteratee(iteratee, 2))
- : 0;
- }
-
- /*------------------------------------------------------------------------*/
-
- // Add methods that return wrapped values in chain sequences.
- lodash.after = after;
- lodash.ary = ary;
- lodash.assign = assign;
- lodash.assignIn = assignIn;
- lodash.assignInWith = assignInWith;
- lodash.assignWith = assignWith;
- lodash.at = at;
- lodash.before = before;
- lodash.bind = bind;
- lodash.bindAll = bindAll;
- lodash.bindKey = bindKey;
- lodash.castArray = castArray;
- lodash.chain = chain;
- lodash.chunk = chunk;
- lodash.compact = compact;
- lodash.concat = concat;
- lodash.cond = cond;
- lodash.conforms = conforms;
- lodash.constant = constant;
- lodash.countBy = countBy;
- lodash.create = create;
- lodash.curry = curry;
- lodash.curryRight = curryRight;
- lodash.debounce = debounce;
- lodash.defaults = defaults;
- lodash.defaultsDeep = defaultsDeep;
- lodash.defer = defer;
- lodash.delay = delay;
- lodash.difference = difference;
- lodash.differenceBy = differenceBy;
- lodash.differenceWith = differenceWith;
- lodash.drop = drop;
- lodash.dropRight = dropRight;
- lodash.dropRightWhile = dropRightWhile;
- lodash.dropWhile = dropWhile;
- lodash.fill = fill;
- lodash.filter = filter;
- lodash.flatMap = flatMap;
- lodash.flatMapDeep = flatMapDeep;
- lodash.flatMapDepth = flatMapDepth;
- lodash.flatten = flatten;
- lodash.flattenDeep = flattenDeep;
- lodash.flattenDepth = flattenDepth;
- lodash.flip = flip;
- lodash.flow = flow;
- lodash.flowRight = flowRight;
- lodash.fromPairs = fromPairs;
- lodash.functions = functions;
- lodash.functionsIn = functionsIn;
- lodash.groupBy = groupBy;
- lodash.initial = initial;
- lodash.intersection = intersection;
- lodash.intersectionBy = intersectionBy;
- lodash.intersectionWith = intersectionWith;
- lodash.invert = invert;
- lodash.invertBy = invertBy;
- lodash.invokeMap = invokeMap;
- lodash.iteratee = iteratee;
- lodash.keyBy = keyBy;
- lodash.keys = keys;
- lodash.keysIn = keysIn;
- lodash.map = map;
- lodash.mapKeys = mapKeys;
- lodash.mapValues = mapValues;
- lodash.matches = matches;
- lodash.matchesProperty = matchesProperty;
- lodash.memoize = memoize;
- lodash.merge = merge;
- lodash.mergeWith = mergeWith;
- lodash.method = method;
- lodash.methodOf = methodOf;
- lodash.mixin = mixin;
- lodash.negate = negate;
- lodash.nthArg = nthArg;
- lodash.omit = omit;
- lodash.omitBy = omitBy;
- lodash.once = once;
- lodash.orderBy = orderBy;
- lodash.over = over;
- lodash.overArgs = overArgs;
- lodash.overEvery = overEvery;
- lodash.overSome = overSome;
- lodash.partial = partial;
- lodash.partialRight = partialRight;
- lodash.partition = partition;
- lodash.pick = pick;
- lodash.pickBy = pickBy;
- lodash.property = property;
- lodash.propertyOf = propertyOf;
- lodash.pull = pull;
- lodash.pullAll = pullAll;
- lodash.pullAllBy = pullAllBy;
- lodash.pullAllWith = pullAllWith;
- lodash.pullAt = pullAt;
- lodash.range = range;
- lodash.rangeRight = rangeRight;
- lodash.rearg = rearg;
- lodash.reject = reject;
- lodash.remove = remove;
- lodash.rest = rest;
- lodash.reverse = reverse;
- lodash.sampleSize = sampleSize;
- lodash.set = set;
- lodash.setWith = setWith;
- lodash.shuffle = shuffle;
- lodash.slice = slice;
- lodash.sortBy = sortBy;
- lodash.sortedUniq = sortedUniq;
- lodash.sortedUniqBy = sortedUniqBy;
- lodash.split = split;
- lodash.spread = spread;
- lodash.tail = tail;
- lodash.take = take;
- lodash.takeRight = takeRight;
- lodash.takeRightWhile = takeRightWhile;
- lodash.takeWhile = takeWhile;
- lodash.tap = tap;
- lodash.throttle = throttle;
- lodash.thru = thru;
- lodash.toArray = toArray;
- lodash.toPairs = toPairs;
- lodash.toPairsIn = toPairsIn;
- lodash.toPath = toPath;
- lodash.toPlainObject = toPlainObject;
- lodash.transform = transform;
- lodash.unary = unary;
- lodash.union = union;
- lodash.unionBy = unionBy;
- lodash.unionWith = unionWith;
- lodash.uniq = uniq;
- lodash.uniqBy = uniqBy;
- lodash.uniqWith = uniqWith;
- lodash.unset = unset;
- lodash.unzip = unzip;
- lodash.unzipWith = unzipWith;
- lodash.update = update;
- lodash.updateWith = updateWith;
- lodash.values = values;
- lodash.valuesIn = valuesIn;
- lodash.without = without;
- lodash.words = words;
- lodash.wrap = wrap;
- lodash.xor = xor;
- lodash.xorBy = xorBy;
- lodash.xorWith = xorWith;
- lodash.zip = zip;
- lodash.zipObject = zipObject;
- lodash.zipObjectDeep = zipObjectDeep;
- lodash.zipWith = zipWith;
-
- // Add aliases.
- lodash.entries = toPairs;
- lodash.entriesIn = toPairsIn;
- lodash.extend = assignIn;
- lodash.extendWith = assignInWith;
-
- // Add methods to `lodash.prototype`.
- mixin(lodash, lodash);
-
- /*------------------------------------------------------------------------*/
-
- // Add methods that return unwrapped values in chain sequences.
- lodash.add = add;
- lodash.attempt = attempt;
- lodash.camelCase = camelCase;
- lodash.capitalize = capitalize;
- lodash.ceil = ceil;
- lodash.clamp = clamp;
- lodash.clone = clone;
- lodash.cloneDeep = cloneDeep;
- lodash.cloneDeepWith = cloneDeepWith;
- lodash.cloneWith = cloneWith;
- lodash.conformsTo = conformsTo;
- lodash.deburr = deburr;
- lodash.defaultTo = defaultTo;
- lodash.divide = divide;
- lodash.endsWith = endsWith;
- lodash.eq = eq;
- lodash.escape = escape;
- lodash.escapeRegExp = escapeRegExp;
- lodash.every = every;
- lodash.find = find;
- lodash.findIndex = findIndex;
- lodash.findKey = findKey;
- lodash.findLast = findLast;
- lodash.findLastIndex = findLastIndex;
- lodash.findLastKey = findLastKey;
- lodash.floor = floor;
- lodash.forEach = forEach;
- lodash.forEachRight = forEachRight;
- lodash.forIn = forIn;
- lodash.forInRight = forInRight;
- lodash.forOwn = forOwn;
- lodash.forOwnRight = forOwnRight;
- lodash.get = get;
- lodash.gt = gt;
- lodash.gte = gte;
- lodash.has = has;
- lodash.hasIn = hasIn;
- lodash.head = head;
- lodash.identity = identity;
- lodash.includes = includes;
- lodash.indexOf = indexOf;
- lodash.inRange = inRange;
- lodash.invoke = invoke;
- lodash.isArguments = isArguments;
- lodash.isArray = isArray;
- lodash.isArrayBuffer = isArrayBuffer;
- lodash.isArrayLike = isArrayLike;
- lodash.isArrayLikeObject = isArrayLikeObject;
- lodash.isBoolean = isBoolean;
- lodash.isBuffer = isBuffer;
- lodash.isDate = isDate;
- lodash.isElement = isElement;
- lodash.isEmpty = isEmpty;
- lodash.isEqual = isEqual;
- lodash.isEqualWith = isEqualWith;
- lodash.isError = isError;
- lodash.isFinite = isFinite;
- lodash.isFunction = isFunction;
- lodash.isInteger = isInteger;
- lodash.isLength = isLength;
- lodash.isMap = isMap;
- lodash.isMatch = isMatch;
- lodash.isMatchWith = isMatchWith;
- lodash.isNaN = isNaN;
- lodash.isNative = isNative;
- lodash.isNil = isNil;
- lodash.isNull = isNull;
- lodash.isNumber = isNumber;
- lodash.isObject = isObject;
- lodash.isObjectLike = isObjectLike;
- lodash.isPlainObject = isPlainObject;
- lodash.isRegExp = isRegExp;
- lodash.isSafeInteger = isSafeInteger;
- lodash.isSet = isSet;
- lodash.isString = isString;
- lodash.isSymbol = isSymbol;
- lodash.isTypedArray = isTypedArray;
- lodash.isUndefined = isUndefined;
- lodash.isWeakMap = isWeakMap;
- lodash.isWeakSet = isWeakSet;
- lodash.join = join;
- lodash.kebabCase = kebabCase;
- lodash.last = last;
- lodash.lastIndexOf = lastIndexOf;
- lodash.lowerCase = lowerCase;
- lodash.lowerFirst = lowerFirst;
- lodash.lt = lt;
- lodash.lte = lte;
- lodash.max = max;
- lodash.maxBy = maxBy;
- lodash.mean = mean;
- lodash.meanBy = meanBy;
- lodash.min = min;
- lodash.minBy = minBy;
- lodash.stubArray = stubArray;
- lodash.stubFalse = stubFalse;
- lodash.stubObject = stubObject;
- lodash.stubString = stubString;
- lodash.stubTrue = stubTrue;
- lodash.multiply = multiply;
- lodash.nth = nth;
- lodash.noConflict = noConflict;
- lodash.noop = noop;
- lodash.now = now;
- lodash.pad = pad;
- lodash.padEnd = padEnd;
- lodash.padStart = padStart;
- lodash.parseInt = parseInt;
- lodash.random = random;
- lodash.reduce = reduce;
- lodash.reduceRight = reduceRight;
- lodash.repeat = repeat;
- lodash.replace = replace;
- lodash.result = result;
- lodash.round = round;
- lodash.runInContext = runInContext;
- lodash.sample = sample;
- lodash.size = size;
- lodash.snakeCase = snakeCase;
- lodash.some = some;
- lodash.sortedIndex = sortedIndex;
- lodash.sortedIndexBy = sortedIndexBy;
- lodash.sortedIndexOf = sortedIndexOf;
- lodash.sortedLastIndex = sortedLastIndex;
- lodash.sortedLastIndexBy = sortedLastIndexBy;
- lodash.sortedLastIndexOf = sortedLastIndexOf;
- lodash.startCase = startCase;
- lodash.startsWith = startsWith;
- lodash.subtract = subtract;
- lodash.sum = sum;
- lodash.sumBy = sumBy;
- lodash.template = template;
- lodash.times = times;
- lodash.toFinite = toFinite;
- lodash.toInteger = toInteger;
- lodash.toLength = toLength;
- lodash.toLower = toLower;
- lodash.toNumber = toNumber;
- lodash.toSafeInteger = toSafeInteger;
- lodash.toString = toString;
- lodash.toUpper = toUpper;
- lodash.trim = trim;
- lodash.trimEnd = trimEnd;
- lodash.trimStart = trimStart;
- lodash.truncate = truncate;
- lodash.unescape = unescape;
- lodash.uniqueId = uniqueId;
- lodash.upperCase = upperCase;
- lodash.upperFirst = upperFirst;
-
- // Add aliases.
- lodash.each = forEach;
- lodash.eachRight = forEachRight;
- lodash.first = head;
-
- mixin(lodash, (function() {
- var source = {};
- baseForOwn(lodash, function(func, methodName) {
- if (!hasOwnProperty.call(lodash.prototype, methodName)) {
- source[methodName] = func;
- }
- });
- return source;
- }()), { 'chain': false });
-
- /*------------------------------------------------------------------------*/
-
- /**
- * The semantic version number.
- *
- * @static
- * @memberOf _
- * @type {string}
- */
- lodash.VERSION = VERSION;
-
- // Assign default placeholders.
- arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
- lodash[methodName].placeholder = lodash;
- });
-
- // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
- arrayEach(['drop', 'take'], function(methodName, index) {
- LazyWrapper.prototype[methodName] = function(n) {
- n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
-
- var result = (this.__filtered__ && !index)
- ? new LazyWrapper(this)
- : this.clone();
-
- if (result.__filtered__) {
- result.__takeCount__ = nativeMin(n, result.__takeCount__);
- } else {
- result.__views__.push({
- 'size': nativeMin(n, MAX_ARRAY_LENGTH),
- 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
- });
- }
- return result;
- };
-
- LazyWrapper.prototype[methodName + 'Right'] = function(n) {
- return this.reverse()[methodName](n).reverse();
- };
- });
-
- // Add `LazyWrapper` methods that accept an `iteratee` value.
- arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
- var type = index + 1,
- isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
-
- LazyWrapper.prototype[methodName] = function(iteratee) {
- var result = this.clone();
- result.__iteratees__.push({
- 'iteratee': getIteratee(iteratee, 3),
- 'type': type
- });
- result.__filtered__ = result.__filtered__ || isFilter;
- return result;
- };
- });
-
- // Add `LazyWrapper` methods for `_.head` and `_.last`.
- arrayEach(['head', 'last'], function(methodName, index) {
- var takeName = 'take' + (index ? 'Right' : '');
-
- LazyWrapper.prototype[methodName] = function() {
- return this[takeName](1).value()[0];
- };
- });
-
- // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
- arrayEach(['initial', 'tail'], function(methodName, index) {
- var dropName = 'drop' + (index ? '' : 'Right');
-
- LazyWrapper.prototype[methodName] = function() {
- return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
- };
- });
-
- LazyWrapper.prototype.compact = function() {
- return this.filter(identity);
- };
-
- LazyWrapper.prototype.find = function(predicate) {
- return this.filter(predicate).head();
- };
-
- LazyWrapper.prototype.findLast = function(predicate) {
- return this.reverse().find(predicate);
- };
-
- LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
- if (typeof path == 'function') {
- return new LazyWrapper(this);
- }
- return this.map(function(value) {
- return baseInvoke(value, path, args);
- });
- });
-
- LazyWrapper.prototype.reject = function(predicate) {
- return this.filter(negate(getIteratee(predicate)));
- };
-
- LazyWrapper.prototype.slice = function(start, end) {
- start = toInteger(start);
-
- var result = this;
- if (result.__filtered__ && (start > 0 || end < 0)) {
- return new LazyWrapper(result);
- }
- if (start < 0) {
- result = result.takeRight(-start);
- } else if (start) {
- result = result.drop(start);
- }
- if (end !== undefined) {
- end = toInteger(end);
- result = end < 0 ? result.dropRight(-end) : result.take(end - start);
- }
- return result;
- };
-
- LazyWrapper.prototype.takeRightWhile = function(predicate) {
- return this.reverse().takeWhile(predicate).reverse();
- };
-
- LazyWrapper.prototype.toArray = function() {
- return this.take(MAX_ARRAY_LENGTH);
- };
-
- // Add `LazyWrapper` methods to `lodash.prototype`.
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
- isTaker = /^(?:head|last)$/.test(methodName),
- lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
- retUnwrapped = isTaker || /^find/.test(methodName);
-
- if (!lodashFunc) {
- return;
- }
- lodash.prototype[methodName] = function() {
- var value = this.__wrapped__,
- args = isTaker ? [1] : arguments,
- isLazy = value instanceof LazyWrapper,
- iteratee = args[0],
- useLazy = isLazy || isArray(value);
-
- var interceptor = function(value) {
- var result = lodashFunc.apply(lodash, arrayPush([value], args));
- return (isTaker && chainAll) ? result[0] : result;
- };
-
- if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
- // Avoid lazy use if the iteratee has a "length" value other than `1`.
- isLazy = useLazy = false;
- }
- var chainAll = this.__chain__,
- isHybrid = !!this.__actions__.length,
- isUnwrapped = retUnwrapped && !chainAll,
- onlyLazy = isLazy && !isHybrid;
-
- if (!retUnwrapped && useLazy) {
- value = onlyLazy ? value : new LazyWrapper(this);
- var result = func.apply(value, args);
- result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
- return new LodashWrapper(result, chainAll);
- }
- if (isUnwrapped && onlyLazy) {
- return func.apply(this, args);
- }
- result = this.thru(interceptor);
- return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
- };
- });
-
- // Add `Array` methods to `lodash.prototype`.
- arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
- var func = arrayProto[methodName],
- chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
- retUnwrapped = /^(?:pop|shift)$/.test(methodName);
-
- lodash.prototype[methodName] = function() {
- var args = arguments;
- if (retUnwrapped && !this.__chain__) {
- var value = this.value();
- return func.apply(isArray(value) ? value : [], args);
- }
- return this[chainName](function(value) {
- return func.apply(isArray(value) ? value : [], args);
- });
- };
- });
-
- // Map minified method names to their real names.
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- var lodashFunc = lodash[methodName];
- if (lodashFunc) {
- var key = (lodashFunc.name + ''),
- names = realNames[key] || (realNames[key] = []);
-
- names.push({ 'name': methodName, 'func': lodashFunc });
- }
- });
-
- realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
- 'name': 'wrapper',
- 'func': undefined
- }];
-
- // Add methods to `LazyWrapper`.
- LazyWrapper.prototype.clone = lazyClone;
- LazyWrapper.prototype.reverse = lazyReverse;
- LazyWrapper.prototype.value = lazyValue;
-
- // Add chain sequence methods to the `lodash` wrapper.
- lodash.prototype.at = wrapperAt;
- lodash.prototype.chain = wrapperChain;
- lodash.prototype.commit = wrapperCommit;
- lodash.prototype.next = wrapperNext;
- lodash.prototype.plant = wrapperPlant;
- lodash.prototype.reverse = wrapperReverse;
- lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
-
- // Add lazy aliases.
- lodash.prototype.first = lodash.prototype.head;
-
- if (symIterator) {
- lodash.prototype[symIterator] = wrapperToIterator;
- }
- return lodash;
- });
-
- /*--------------------------------------------------------------------------*/
-
- // Export lodash.
- var _ = runInContext();
-
- // Some AMD build optimizers, like r.js, check for condition patterns like:
- if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
- // Expose Lodash on the global object to prevent errors when Lodash is
- // loaded by a script tag in the presence of an AMD loader.
- // See http://requirejs.org/docs/errors.html#mismatch for more details.
- // Use `_.noConflict` to remove Lodash from the global object.
- root._ = _;
-
- // Define as an anonymous module so, through path mapping, it can be
- // referenced as the "underscore" module.
- define(function() {
- return _;
- });
- }
- // Check for `exports` after `define` in case a build optimizer adds it.
- else if (freeModule) {
- // Export for Node.js.
- (freeModule.exports = _)._ = _;
- // Export for CommonJS support.
- freeExports._ = _;
- }
- else {
- // Export to the global object.
- root._ = _;
- }
-}.call(this));
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{}],293:[function(require,module,exports){
-const string = require('string')
-
-const slugify = s =>
- string(s).slugify().toString()
-
-const position = {
- false: 'push',
- true: 'unshift'
-}
-
-const hasProp = ({}).hasOwnProperty
-
-const permalinkHref = slug => `#${slug}`
-
-const renderPermalink = (slug, opts, state, idx) => {
- const space = () =>
- Object.assign(new state.Token('text', '', 0), { content: ' ' })
-
- const linkTokens = [
- Object.assign(new state.Token('link_open', 'a', 1), {
- attrs: [
- ['class', opts.permalinkClass],
- ['href', opts.permalinkHref(slug, state)],
- ['aria-hidden', 'true']
- ]
- }),
- Object.assign(new state.Token('html_block', '', 0), { content: opts.permalinkSymbol }),
- new state.Token('link_close', 'a', -1)
- ]
-
- // `push` or `unshift` according to position option.
- // Space is at the opposite side.
- linkTokens[position[!opts.permalinkBefore]](space())
- state.tokens[idx + 1].children[position[opts.permalinkBefore]](...linkTokens)
-}
-
-const uniqueSlug = (slug, slugs) => {
- // Mark this slug as used in the environment.
- slugs[slug] = (hasProp.call(slugs, slug) ? slugs[slug] : 0) + 1
-
- // First slug, return as is.
- if (slugs[slug] === 1) {
- return slug
- }
-
- // Duplicate slug, add a `-2`, `-3`, etc. to keep ID unique.
- return slug + '-' + slugs[slug]
-}
-
-const isLevelSelectedNumber = selection => level => level >= selection
-const isLevelSelectedArray = selection => level => selection.includes(level)
-
-const anchor = (md, opts) => {
- opts = Object.assign({}, anchor.defaults, opts)
-
- md.core.ruler.push('anchor', state => {
- const slugs = {}
- const tokens = state.tokens
-
- const isLevelSelected = Array.isArray(opts.level)
- ? isLevelSelectedArray(opts.level)
- : isLevelSelectedNumber(opts.level)
-
- tokens
- .filter(token => token.type === 'heading_open')
- .filter(token => isLevelSelected(Number(token.tag.substr(1))))
- .forEach(token => {
- // Aggregate the next token children text.
- const title = tokens[tokens.indexOf(token) + 1].children
- .filter(token => token.type === 'text' || token.type === 'code_inline')
- .reduce((acc, t) => acc + t.content, '')
-
- let slug = token.attrGet('id')
-
- if (slug == null) {
- slug = uniqueSlug(opts.slugify(title), slugs)
- token.attrPush(['id', slug])
- }
-
- if (opts.permalink) {
- opts.renderPermalink(slug, opts, state, tokens.indexOf(token))
- }
-
- if (opts.callback) {
- opts.callback(token, { slug, title })
- }
- })
- })
-}
-
-anchor.defaults = {
- level: 1,
- slugify,
- permalink: false,
- renderPermalink,
- permalinkClass: 'header-anchor',
- permalinkSymbol: '¶',
- permalinkBefore: false,
- permalinkHref
-}
-
-module.exports = anchor
-
-},{"string":412}],294:[function(require,module,exports){
-'use strict';
-
-
-module.exports = function for_inline_plugin(md, ruleName, tokenType, iteartor) {
-
- function scan(state) {
- var i, blkIdx, inlineTokens;
-
- for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
- if (state.tokens[blkIdx].type !== 'inline') {
- continue;
- }
-
- inlineTokens = state.tokens[blkIdx].children;
-
- for (i = inlineTokens.length - 1; i >= 0; i--) {
- if (inlineTokens[i].type !== tokenType) {
- continue;
- }
-
- iteartor(inlineTokens, i);
- }
- }
- }
-
- md.core.ruler.push(ruleName, scan);
-};
-
-},{}],295:[function(require,module,exports){
-const hljs = require('highlight.js')
-
-const maybe = f => {
- try {
- return f()
- } catch (e) {
- return false
- }
-}
-
-// Highlight with given language.
-const highlight = (code, lang) =>
- maybe(() => hljs.highlight(lang, code, true).value) || ''
-
-// Highlight with given language or automatically.
-const highlightAuto = (code, lang) =>
- lang
- ? highlight(code, lang)
- : maybe(() => hljs.highlightAuto(code).value) || ''
-
-// Wrap a render function to add `hljs` class to code blocks.
-const wrap = render =>
- function (...args) {
- return render.apply(this, args)
- .replace('<code class="', '<code class="hljs ')
- .replace('<code>', '<code class="hljs">')
- }
-
-const highlightjs = (md, opts) => {
- opts = Object.assign({}, highlightjs.defaults, opts)
-
- md.options.highlight = opts.auto ? highlightAuto : highlight
- md.renderer.rules.fence = wrap(md.renderer.rules.fence)
-
- if (opts.code) {
- md.renderer.rules.code_block = wrap(md.renderer.rules.code_block)
- }
-}
-
-highlightjs.defaults = {
- auto: true,
- code: true
-}
-
-module.exports = highlightjs
-
-},{"highlight.js":112}],296:[function(require,module,exports){
-/* Process inline math */
-/*
-Like markdown-it-simplemath, this is a stripped down, simplified version of:
-https://github.com/runarberg/markdown-it-math
-
-It differs in that it takes (a subset of) LaTeX as input and relies on KaTeX
-for rendering output.
-*/
-
-/*jslint node: true */
-'use strict';
-
-var katex = require('katex');
-
-// Test if potential opening or closing delimieter
-// Assumes that there is a "$" at state.src[pos]
-function isValidDelim(state, pos) {
- var prevChar, nextChar,
- max = state.posMax,
- can_open = true,
- can_close = true;
-
- prevChar = pos > 0 ? state.src.charCodeAt(pos - 1) : -1;
- nextChar = pos + 1 <= max ? state.src.charCodeAt(pos + 1) : -1;
-
- // Check non-whitespace conditions for opening and closing, and
- // check that closing delimeter isn't followed by a number
- if (prevChar === 0x20/* " " */ || prevChar === 0x09/* \t */ ||
- (nextChar >= 0x30/* "0" */ && nextChar <= 0x39/* "9" */)) {
- can_close = false;
- }
- if (nextChar === 0x20/* " " */ || nextChar === 0x09/* \t */) {
- can_open = false;
- }
-
- return {
- can_open: can_open,
- can_close: can_close
- };
-}
-
-function math_inline(state, silent) {
- var start, match, token, res, pos, esc_count;
-
- if (state.src[state.pos] !== "$") { return false; }
-
- res = isValidDelim(state, state.pos);
- if (!res.can_open) {
- if (!silent) { state.pending += "$"; }
- state.pos += 1;
- return true;
- }
-
- // First check for and bypass all properly escaped delimieters
- // This loop will assume that the first leading backtick can not
- // be the first character in state.src, which is known since
- // we have found an opening delimieter already.
- start = state.pos + 1;
- match = start;
- while ( (match = state.src.indexOf("$", match)) !== -1) {
- // Found potential $, look for escapes, pos will point to
- // first non escape when complete
- pos = match - 1;
- while (state.src[pos] === "\\") { pos -= 1; }
-
- // Even number of escapes, potential closing delimiter found
- if ( ((match - pos) % 2) == 1 ) { break; }
- match += 1;
- }
-
- // No closing delimter found. Consume $ and continue.
- if (match === -1) {
- if (!silent) { state.pending += "$"; }
- state.pos = start;
- return true;
- }
-
- // Check if we have empty content, ie: $$. Do not parse.
- if (match - start === 0) {
- if (!silent) { state.pending += "$$"; }
- state.pos = start + 1;
- return true;
- }
-
- // Check for valid closing delimiter
- res = isValidDelim(state, match);
- if (!res.can_close) {
- if (!silent) { state.pending += "$"; }
- state.pos = start;
- return true;
- }
-
- if (!silent) {
- token = state.push('math_inline', 'math', 0);
- token.markup = "$";
- token.content = state.src.slice(start, match);
- }
-
- state.pos = match + 1;
- return true;
-}
-
-function math_block(state, start, end, silent){
- var firstLine, lastLine, next, lastPos, found = false, token,
- pos = state.bMarks[start] + state.tShift[start],
- max = state.eMarks[start]
-
- if(pos + 2 > max){ return false; }
- if(state.src.slice(pos,pos+2)!=='$$'){ return false; }
-
- pos += 2;
- firstLine = state.src.slice(pos,max);
-
- if(silent){ return true; }
- if(firstLine.trim().slice(-2)==='$$'){
- // Single line expression
- firstLine = firstLine.trim().slice(0, -2);
- found = true;
- }
-
- for(next = start; !found; ){
-
- next++;
-
- if(next >= end){ break; }
-
- pos = state.bMarks[next]+state.tShift[next];
- max = state.eMarks[next];
-
- if(pos < max && state.tShift[next] < state.blkIndent){
- // non-empty line with negative indent should stop the list:
- break;
- }
-
- if(state.src.slice(pos,max).trim().slice(-2)==='$$'){
- lastPos = state.src.slice(0,max).lastIndexOf('$$');
- lastLine = state.src.slice(pos,lastPos);
- found = true;
- }
-
- }
-
- state.line = next + 1;
-
- token = state.push('math_block', 'math', 0);
- token.block = true;
- token.content = (firstLine && firstLine.trim() ? firstLine + '\n' : '')
- + state.getLines(start + 1, next, state.tShift[start], true)
- + (lastLine && lastLine.trim() ? lastLine : '');
- token.map = [ start, state.line ];
- token.markup = '$$';
- return true;
-}
-
-module.exports = function math_plugin(md, options) {
- // Default options
-
- options = options || {};
-
- // set KaTeX as the renderer for markdown-it-simplemath
- var katexInline = function(latex){
- options.displayMode = false;
- try{
- return katex.renderToString(latex, options);
- }
- catch(error){
- if(options.throwOnError){ console.log(error); }
- return latex;
- }
- };
-
- var inlineRenderer = function(tokens, idx){
- return katexInline(tokens[idx].content);
- };
-
- var katexBlock = function(latex){
- options.displayMode = true;
- try{
- return "<p>" + katex.renderToString(latex, options) + "</p>";
- }
- catch(error){
- if(options.throwOnError){ console.log(error); }
- return latex;
- }
- }
-
- var blockRenderer = function(tokens, idx){
- return katexBlock(tokens[idx].content) + '\n';
- }
-
- md.inline.ruler.after('escape', 'math_inline', math_inline);
- md.block.ruler.after('blockquote', 'math_block', math_block, {
- alt: [ 'paragraph', 'reference', 'blockquote', 'list' ]
- });
- md.renderer.rules.math_inline = inlineRenderer;
- md.renderer.rules.math_block = blockRenderer;
-};
-
-},{"katex":297}],297:[function(require,module,exports){
-/* eslint no-console:0 */
-/**
- * This is the main entry point for KaTeX. Here, we expose functions for
- * rendering expressions either to DOM nodes or to markup strings.
- *
- * We also expose the ParseError class to check if errors thrown from KaTeX are
- * errors in the expression, or errors in javascript handling.
- */
-
-var ParseError = require("./src/ParseError");
-var Settings = require("./src/Settings");
-
-var buildTree = require("./src/buildTree");
-var parseTree = require("./src/parseTree");
-var utils = require("./src/utils");
-
-/**
- * Parse and build an expression, and place that expression in the DOM node
- * given.
- */
-var render = function(expression, baseNode, options) {
- utils.clearNode(baseNode);
-
- var settings = new Settings(options);
-
- var tree = parseTree(expression, settings);
- var node = buildTree(tree, expression, settings).toNode();
-
- baseNode.appendChild(node);
-};
-
-// KaTeX's styles don't work properly in quirks mode. Print out an error, and
-// disable rendering.
-if (typeof document !== "undefined") {
- if (document.compatMode !== "CSS1Compat") {
- typeof console !== "undefined" && console.warn(
- "Warning: KaTeX doesn't work in quirks mode. Make sure your " +
- "website has a suitable doctype.");
-
- render = function() {
- throw new ParseError("KaTeX doesn't work in quirks mode.");
- };
- }
-}
-
-/**
- * Parse and build an expression, and return the markup for that.
- */
-var renderToString = function(expression, options) {
- var settings = new Settings(options);
-
- var tree = parseTree(expression, settings);
- return buildTree(tree, expression, settings).toMarkup();
-};
-
-/**
- * Parse an expression and return the parse tree.
- */
-var generateParseTree = function(expression, options) {
- var settings = new Settings(options);
- return parseTree(expression, settings);
-};
-
-module.exports = {
- render: render,
- renderToString: renderToString,
- /**
- * NOTE: This method is not currently recommended for public use.
- * The internal tree representation is unstable and is very likely
- * to change. Use at your own risk.
- */
- __parse: generateParseTree,
- ParseError: ParseError,
-};
-
-},{"./src/ParseError":300,"./src/Settings":302,"./src/buildTree":307,"./src/parseTree":316,"./src/utils":318}],298:[function(require,module,exports){
-/**
- * The Lexer class handles tokenizing the input in various ways. Since our
- * parser expects us to be able to backtrack, the lexer allows lexing from any
- * given starting point.
- *
- * Its main exposed function is the `lex` function, which takes a position to
- * lex from and a type of token to lex. It defers to the appropriate `_innerLex`
- * function.
- *
- * The various `_innerLex` functions perform the actual lexing of different
- * kinds.
- */
-
-var matchAt = require("match-at");
-
-var ParseError = require("./ParseError");
-
-// The main lexer class
-function Lexer(input) {
- this._input = input;
-}
-
-// The resulting token returned from `lex`.
-function Token(text, data, position) {
- this.text = text;
- this.data = data;
- this.position = position;
-}
-
-/* The following tokenRegex
- * - matches typical whitespace (but not NBSP etc.) using its first group
- * - matches symbol combinations which result in a single output character
- * - does not match any control character \x00-\x1f except whitespace
- * - does not match a bare backslash
- * - matches any ASCII character except those just mentioned
- * - does not match the BMP private use area \uE000-\uF8FF
- * - does not match bare surrogate code units
- * - matches any BMP character except for those just described
- * - matches any valid Unicode surrogate pair
- * - matches a backslash followed by one or more letters
- * - matches a backslash followed by any BMP character, including newline
- * Just because the Lexer matches something doesn't mean it's valid input:
- * If there is no matching function or symbol definition, the Parser will
- * still reject the input.
- */
-var tokenRegex = new RegExp(
- "([ \r\n\t]+)|(" + // whitespace
- "---?" + // special combinations
- "|[!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]" + // single codepoint
- "|[\uD800-\uDBFF][\uDC00-\uDFFF]" + // surrogate pair
- "|\\\\(?:[a-zA-Z]+|[^\uD800-\uDFFF])" + // function name
- ")"
-);
-
-var whitespaceRegex = /\s*/;
-
-/**
- * This function lexes a single normal token. It takes a position and
- * whether it should completely ignore whitespace or not.
- */
-Lexer.prototype._innerLex = function(pos, ignoreWhitespace) {
- var input = this._input;
- if (pos === input.length) {
- return new Token("EOF", null, pos);
- }
- var match = matchAt(tokenRegex, input, pos);
- if (match === null) {
- throw new ParseError(
- "Unexpected character: '" + input[pos] + "'",
- this, pos);
- } else if (match[2]) { // matched non-whitespace
- return new Token(match[2], null, pos + match[2].length);
- } else if (ignoreWhitespace) {
- return this._innerLex(pos + match[1].length, true);
- } else { // concatenate whitespace to a single space
- return new Token(" ", null, pos + match[1].length);
- }
-};
-
-// A regex to match a CSS color (like #ffffff or BlueViolet)
-var cssColor = /#[a-z0-9]+|[a-z]+/i;
-
-/**
- * This function lexes a CSS color.
- */
-Lexer.prototype._innerLexColor = function(pos) {
- var input = this._input;
-
- // Ignore whitespace
- var whitespace = matchAt(whitespaceRegex, input, pos)[0];
- pos += whitespace.length;
-
- var match;
- if ((match = matchAt(cssColor, input, pos))) {
- // If we look like a color, return a color
- return new Token(match[0], null, pos + match[0].length);
- } else {
- throw new ParseError("Invalid color", this, pos);
- }
-};
-
-// A regex to match a dimension. Dimensions look like
-// "1.2em" or ".4pt" or "1 ex"
-var sizeRegex = /(-?)\s*(\d+(?:\.\d*)?|\.\d+)\s*([a-z]{2})/;
-
-/**
- * This function lexes a dimension.
- */
-Lexer.prototype._innerLexSize = function(pos) {
- var input = this._input;
-
- // Ignore whitespace
- var whitespace = matchAt(whitespaceRegex, input, pos)[0];
- pos += whitespace.length;
-
- var match;
- if ((match = matchAt(sizeRegex, input, pos))) {
- var unit = match[3];
- // We only currently handle "em" and "ex" units
- if (unit !== "em" && unit !== "ex") {
- throw new ParseError("Invalid unit: '" + unit + "'", this, pos);
- }
- return new Token(match[0], {
- number: +(match[1] + match[2]),
- unit: unit,
- }, pos + match[0].length);
- }
-
- throw new ParseError("Invalid size", this, pos);
-};
-
-/**
- * This function lexes a string of whitespace.
- */
-Lexer.prototype._innerLexWhitespace = function(pos) {
- var input = this._input;
-
- var whitespace = matchAt(whitespaceRegex, input, pos)[0];
- pos += whitespace.length;
-
- return new Token(whitespace[0], null, pos);
-};
-
-/**
- * This function lexes a single token starting at `pos` and of the given mode.
- * Based on the mode, we defer to one of the `_innerLex` functions.
- */
-Lexer.prototype.lex = function(pos, mode) {
- if (mode === "math") {
- return this._innerLex(pos, true);
- } else if (mode === "text") {
- return this._innerLex(pos, false);
- } else if (mode === "color") {
- return this._innerLexColor(pos);
- } else if (mode === "size") {
- return this._innerLexSize(pos);
- } else if (mode === "whitespace") {
- return this._innerLexWhitespace(pos);
- }
-};
-
-module.exports = Lexer;
-
-},{"./ParseError":300,"match-at":372}],299:[function(require,module,exports){
-/**
- * This file contains information about the options that the Parser carries
- * around with it while parsing. Data is held in an `Options` object, and when
- * recursing, a new `Options` object can be created with the `.with*` and
- * `.reset` functions.
- */
-
-/**
- * This is the main options class. It contains the style, size, color, and font
- * of the current parse level. It also contains the style and size of the parent
- * parse level, so size changes can be handled efficiently.
- *
- * Each of the `.with*` and `.reset` functions passes its current style and size
- * as the parentStyle and parentSize of the new options class, so parent
- * handling is taken care of automatically.
- */
-function Options(data) {
- this.style = data.style;
- this.color = data.color;
- this.size = data.size;
- this.phantom = data.phantom;
- this.font = data.font;
-
- if (data.parentStyle === undefined) {
- this.parentStyle = data.style;
- } else {
- this.parentStyle = data.parentStyle;
- }
-
- if (data.parentSize === undefined) {
- this.parentSize = data.size;
- } else {
- this.parentSize = data.parentSize;
- }
-}
-
-/**
- * Returns a new options object with the same properties as "this". Properties
- * from "extension" will be copied to the new options object.
- */
-Options.prototype.extend = function(extension) {
- var data = {
- style: this.style,
- size: this.size,
- color: this.color,
- parentStyle: this.style,
- parentSize: this.size,
- phantom: this.phantom,
- font: this.font,
- };
-
- for (var key in extension) {
- if (extension.hasOwnProperty(key)) {
- data[key] = extension[key];
- }
- }
-
- return new Options(data);
-};
-
-/**
- * Create a new options object with the given style.
- */
-Options.prototype.withStyle = function(style) {
- return this.extend({
- style: style,
- });
-};
-
-/**
- * Create a new options object with the given size.
- */
-Options.prototype.withSize = function(size) {
- return this.extend({
- size: size,
- });
-};
-
-/**
- * Create a new options object with the given color.
- */
-Options.prototype.withColor = function(color) {
- return this.extend({
- color: color,
- });
-};
-
-/**
- * Create a new options object with "phantom" set to true.
- */
-Options.prototype.withPhantom = function() {
- return this.extend({
- phantom: true,
- });
-};
-
-/**
- * Create a new options objects with the give font.
- */
-Options.prototype.withFont = function(font) {
- return this.extend({
- font: font,
- });
-};
-
-/**
- * Create a new options object with the same style, size, and color. This is
- * used so that parent style and size changes are handled correctly.
- */
-Options.prototype.reset = function() {
- return this.extend({});
-};
-
-/**
- * A map of color names to CSS colors.
- * TODO(emily): Remove this when we have real macros
- */
-var colorMap = {
- "katex-blue": "#6495ed",
- "katex-orange": "#ffa500",
- "katex-pink": "#ff00af",
- "katex-red": "#df0030",
- "katex-green": "#28ae7b",
- "katex-gray": "gray",
- "katex-purple": "#9d38bd",
- "katex-blueA": "#c7e9f1",
- "katex-blueB": "#9cdceb",
- "katex-blueC": "#58c4dd",
- "katex-blueD": "#29abca",
- "katex-blueE": "#1c758a",
- "katex-tealA": "#acead7",
- "katex-tealB": "#76ddc0",
- "katex-tealC": "#5cd0b3",
- "katex-tealD": "#55c1a7",
- "katex-tealE": "#49a88f",
- "katex-greenA": "#c9e2ae",
- "katex-greenB": "#a6cf8c",
- "katex-greenC": "#83c167",
- "katex-greenD": "#77b05d",
- "katex-greenE": "#699c52",
- "katex-goldA": "#f7c797",
- "katex-goldB": "#f9b775",
- "katex-goldC": "#f0ac5f",
- "katex-goldD": "#e1a158",
- "katex-goldE": "#c78d46",
- "katex-redA": "#f7a1a3",
- "katex-redB": "#ff8080",
- "katex-redC": "#fc6255",
- "katex-redD": "#e65a4c",
- "katex-redE": "#cf5044",
- "katex-maroonA": "#ecabc1",
- "katex-maroonB": "#ec92ab",
- "katex-maroonC": "#c55f73",
- "katex-maroonD": "#a24d61",
- "katex-maroonE": "#94424f",
- "katex-purpleA": "#caa3e8",
- "katex-purpleB": "#b189c6",
- "katex-purpleC": "#9a72ac",
- "katex-purpleD": "#715582",
- "katex-purpleE": "#644172",
- "katex-mintA": "#f5f9e8",
- "katex-mintB": "#edf2df",
- "katex-mintC": "#e0e5cc",
- "katex-grayA": "#fdfdfd",
- "katex-grayB": "#f7f7f7",
- "katex-grayC": "#eeeeee",
- "katex-grayD": "#dddddd",
- "katex-grayE": "#cccccc",
- "katex-grayF": "#aaaaaa",
- "katex-grayG": "#999999",
- "katex-grayH": "#555555",
- "katex-grayI": "#333333",
- "katex-kaBlue": "#314453",
- "katex-kaGreen": "#639b24",
-};
-
-/**
- * Gets the CSS color of the current options object, accounting for the
- * `colorMap`.
- */
-Options.prototype.getColor = function() {
- if (this.phantom) {
- return "transparent";
- } else {
- return colorMap[this.color] || this.color;
- }
-};
-
-module.exports = Options;
-
-},{}],300:[function(require,module,exports){
-/**
- * This is the ParseError class, which is the main error thrown by KaTeX
- * functions when something has gone wrong. This is used to distinguish internal
- * errors from errors in the expression that the user provided.
- */
-function ParseError(message, lexer, position) {
- var error = "KaTeX parse error: " + message;
-
- if (lexer !== undefined && position !== undefined) {
- // If we have the input and a position, make the error a bit fancier
-
- // Prepend some information
- error += " at position " + position + ": ";
-
- // Get the input
- var input = lexer._input;
- // Insert a combining underscore at the correct position
- input = input.slice(0, position) + "\u0332" +
- input.slice(position);
-
- // Extract some context from the input and add it to the error
- var begin = Math.max(0, position - 15);
- var end = position + 15;
- error += input.slice(begin, end);
- }
-
- // Some hackery to make ParseError a prototype of Error
- // See http://stackoverflow.com/a/8460753
- var self = new Error(error);
- self.name = "ParseError";
- self.__proto__ = ParseError.prototype;
-
- self.position = position;
- return self;
-}
-
-// More hackery
-ParseError.prototype.__proto__ = Error.prototype;
-
-module.exports = ParseError;
-
-},{}],301:[function(require,module,exports){
-/* eslint no-constant-condition:0 */
-var functions = require("./functions");
-var environments = require("./environments");
-var Lexer = require("./Lexer");
-var symbols = require("./symbols");
-var utils = require("./utils");
-
-var parseData = require("./parseData");
-var ParseError = require("./ParseError");
-
-/**
- * This file contains the parser used to parse out a TeX expression from the
- * input. Since TeX isn't context-free, standard parsers don't work particularly
- * well.
- *
- * The strategy of this parser is as such:
- *
- * The main functions (the `.parse...` ones) take a position in the current
- * parse string to parse tokens from. The lexer (found in Lexer.js, stored at
- * this.lexer) also supports pulling out tokens at arbitrary places. When
- * individual tokens are needed at a position, the lexer is called to pull out a
- * token, which is then used.
- *
- * The parser has a property called "mode" indicating the mode that
- * the parser is currently in. Currently it has to be one of "math" or
- * "text", which denotes whether the current environment is a math-y
- * one or a text-y one (e.g. inside \text). Currently, this serves to
- * limit the functions which can be used in text mode.
- *
- * The main functions then return an object which contains the useful data that
- * was parsed at its given point, and a new position at the end of the parsed
- * data. The main functions can call each other and continue the parsing by
- * using the returned position as a new starting point.
- *
- * There are also extra `.handle...` functions, which pull out some reused
- * functionality into self-contained functions.
- *
- * The earlier functions return ParseNodes.
- * The later functions (which are called deeper in the parse) sometimes return
- * ParseFuncOrArgument, which contain a ParseNode as well as some data about
- * whether the parsed object is a function which is missing some arguments, or a
- * standalone object which can be used as an argument to another function.
- */
-
-/**
- * Main Parser class
- */
-function Parser(input, settings) {
- // Make a new lexer
- this.lexer = new Lexer(input);
- // Store the settings for use in parsing
- this.settings = settings;
-}
-
-var ParseNode = parseData.ParseNode;
-
-/**
- * An initial function (without its arguments), or an argument to a function.
- * The `result` argument should be a ParseNode.
- */
-function ParseFuncOrArgument(result, isFunction) {
- this.result = result;
- // Is this a function (i.e. is it something defined in functions.js)?
- this.isFunction = isFunction;
-}
-
-/**
- * Checks a result to make sure it has the right type, and throws an
- * appropriate error otherwise.
- *
- * @param {boolean=} consume whether to consume the expected token,
- * defaults to true
- */
-Parser.prototype.expect = function(text, consume) {
- if (this.nextToken.text !== text) {
- throw new ParseError(
- "Expected '" + text + "', got '" + this.nextToken.text + "'",
- this.lexer, this.nextToken.position
- );
- }
- if (consume !== false) {
- this.consume();
- }
-};
-
-/**
- * Considers the current look ahead token as consumed,
- * and fetches the one after that as the new look ahead.
- */
-Parser.prototype.consume = function() {
- this.pos = this.nextToken.position;
- this.nextToken = this.lexer.lex(this.pos, this.mode);
-};
-
-/**
- * Main parsing function, which parses an entire input.
- *
- * @return {?Array.<ParseNode>}
- */
-Parser.prototype.parse = function() {
- // Try to parse the input
- this.mode = "math";
- this.pos = 0;
- this.nextToken = this.lexer.lex(this.pos, this.mode);
- var parse = this.parseInput();
- return parse;
-};
-
-/**
- * Parses an entire input tree.
- */
-Parser.prototype.parseInput = function() {
- // Parse an expression
- var expression = this.parseExpression(false);
- // If we succeeded, make sure there's an EOF at the end
- this.expect("EOF", false);
- return expression;
-};
-
-var endOfExpression = ["}", "\\end", "\\right", "&", "\\\\", "\\cr"];
-
-/**
- * Parses an "expression", which is a list of atoms.
- *
- * @param {boolean} breakOnInfix Should the parsing stop when we hit infix
- * nodes? This happens when functions have higher precendence
- * than infix nodes in implicit parses.
- *
- * @param {?string} breakOnToken The token that the expression should end with,
- * or `null` if something else should end the expression.
- *
- * @return {ParseNode}
- */
-Parser.prototype.parseExpression = function(breakOnInfix, breakOnToken) {
- var body = [];
- // Keep adding atoms to the body until we can't parse any more atoms (either
- // we reached the end, a }, or a \right)
- while (true) {
- var lex = this.nextToken;
- var pos = this.pos;
- if (endOfExpression.indexOf(lex.text) !== -1) {
- break;
- }
- if (breakOnToken && lex.text === breakOnToken) {
- break;
- }
- var atom = this.parseAtom();
- if (!atom) {
- if (!this.settings.throwOnError && lex.text[0] === "\\") {
- var errorNode = this.handleUnsupportedCmd();
- body.push(errorNode);
-
- pos = lex.position;
- continue;
- }
-
- break;
- }
- if (breakOnInfix && atom.type === "infix") {
- // rewind so we can parse the infix atom again
- this.pos = pos;
- this.nextToken = lex;
- break;
- }
- body.push(atom);
- }
- return this.handleInfixNodes(body);
-};
-
-/**
- * Rewrites infix operators such as \over with corresponding commands such
- * as \frac.
- *
- * There can only be one infix operator per group. If there's more than one
- * then the expression is ambiguous. This can be resolved by adding {}.
- *
- * @returns {Array}
- */
-Parser.prototype.handleInfixNodes = function(body) {
- var overIndex = -1;
- var funcName;
-
- for (var i = 0; i < body.length; i++) {
- var node = body[i];
- if (node.type === "infix") {
- if (overIndex !== -1) {
- throw new ParseError("only one infix operator per group",
- this.lexer, -1);
- }
- overIndex = i;
- funcName = node.value.replaceWith;
- }
- }
-
- if (overIndex !== -1) {
- var numerNode;
- var denomNode;
-
- var numerBody = body.slice(0, overIndex);
- var denomBody = body.slice(overIndex + 1);
-
- if (numerBody.length === 1 && numerBody[0].type === "ordgroup") {
- numerNode = numerBody[0];
- } else {
- numerNode = new ParseNode("ordgroup", numerBody, this.mode);
- }
-
- if (denomBody.length === 1 && denomBody[0].type === "ordgroup") {
- denomNode = denomBody[0];
- } else {
- denomNode = new ParseNode("ordgroup", denomBody, this.mode);
- }
-
- var value = this.callFunction(
- funcName, [numerNode, denomNode], null);
- return [new ParseNode(value.type, value, this.mode)];
- } else {
- return body;
- }
-};
-
-// The greediness of a superscript or subscript
-var SUPSUB_GREEDINESS = 1;
-
-/**
- * Handle a subscript or superscript with nice errors.
- */
-Parser.prototype.handleSupSubscript = function(name) {
- var symbol = this.nextToken.text;
- var symPos = this.pos;
- this.consume();
- var group = this.parseGroup();
-
- if (!group) {
- if (!this.settings.throwOnError && this.nextToken.text[0] === "\\") {
- return this.handleUnsupportedCmd();
- } else {
- throw new ParseError(
- "Expected group after '" + symbol + "'",
- this.lexer,
- symPos + 1
- );
- }
- } else if (group.isFunction) {
- // ^ and _ have a greediness, so handle interactions with functions'
- // greediness
- var funcGreediness = functions[group.result].greediness;
- if (funcGreediness > SUPSUB_GREEDINESS) {
- return this.parseFunction(group);
- } else {
- throw new ParseError(
- "Got function '" + group.result + "' with no arguments " +
- "as " + name,
- this.lexer, symPos + 1);
- }
- } else {
- return group.result;
- }
-};
-
-/**
- * Converts the textual input of an unsupported command into a text node
- * contained within a color node whose color is determined by errorColor
- */
-Parser.prototype.handleUnsupportedCmd = function() {
- var text = this.nextToken.text;
- var textordArray = [];
-
- for (var i = 0; i < text.length; i++) {
- textordArray.push(new ParseNode("textord", text[i], "text"));
- }
-
- var textNode = new ParseNode(
- "text",
- {
- body: textordArray,
- type: "text",
- },
- this.mode);
-
- var colorNode = new ParseNode(
- "color",
- {
- color: this.settings.errorColor,
- value: [textNode],
- type: "color",
- },
- this.mode);
-
- this.consume();
- return colorNode;
-};
-
-/**
- * Parses a group with optional super/subscripts.
- *
- * @return {?ParseNode}
- */
-Parser.prototype.parseAtom = function() {
- // The body of an atom is an implicit group, so that things like
- // \left(x\right)^2 work correctly.
- var base = this.parseImplicitGroup();
-
- // In text mode, we don't have superscripts or subscripts
- if (this.mode === "text") {
- return base;
- }
-
- // Note that base may be empty (i.e. null) at this point.
-
- var superscript;
- var subscript;
- while (true) {
- // Lex the first token
- var lex = this.nextToken;
-
- if (lex.text === "\\limits" || lex.text === "\\nolimits") {
- // We got a limit control
- if (!base || base.type !== "op") {
- throw new ParseError(
- "Limit controls must follow a math operator",
- this.lexer, this.pos);
- } else {
- var limits = lex.text === "\\limits";
- base.value.limits = limits;
- base.value.alwaysHandleSupSub = true;
- }
- this.consume();
- } else if (lex.text === "^") {
- // We got a superscript start
- if (superscript) {
- throw new ParseError(
- "Double superscript", this.lexer, this.pos);
- }
- superscript = this.handleSupSubscript("superscript");
- } else if (lex.text === "_") {
- // We got a subscript start
- if (subscript) {
- throw new ParseError(
- "Double subscript", this.lexer, this.pos);
- }
- subscript = this.handleSupSubscript("subscript");
- } else if (lex.text === "'") {
- // We got a prime
- var prime = new ParseNode("textord", "\\prime", this.mode);
-
- // Many primes can be grouped together, so we handle this here
- var primes = [prime];
- this.consume();
- // Keep lexing tokens until we get something that's not a prime
- while (this.nextToken.text === "'") {
- // For each one, add another prime to the list
- primes.push(prime);
- this.consume();
- }
- // Put them into an ordgroup as the superscript
- superscript = new ParseNode("ordgroup", primes, this.mode);
- } else {
- // If it wasn't ^, _, or ', stop parsing super/subscripts
- break;
- }
- }
-
- if (superscript || subscript) {
- // If we got either a superscript or subscript, create a supsub
- return new ParseNode("supsub", {
- base: base,
- sup: superscript,
- sub: subscript,
- }, this.mode);
- } else {
- // Otherwise return the original body
- return base;
- }
-};
-
-// A list of the size-changing functions, for use in parseImplicitGroup
-var sizeFuncs = [
- "\\tiny", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize",
- "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge",
-];
-
-// A list of the style-changing functions, for use in parseImplicitGroup
-var styleFuncs = [
- "\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle",
-];
-
-/**
- * Parses an implicit group, which is a group that starts at the end of a
- * specified, and ends right before a higher explicit group ends, or at EOL. It
- * is used for functions that appear to affect the current style, like \Large or
- * \textrm, where instead of keeping a style we just pretend that there is an
- * implicit grouping after it until the end of the group. E.g.
- * small text {\Large large text} small text again
- * It is also used for \left and \right to get the correct grouping.
- *
- * @return {?ParseNode}
- */
-Parser.prototype.parseImplicitGroup = function() {
- var start = this.parseSymbol();
-
- if (start == null) {
- // If we didn't get anything we handle, fall back to parseFunction
- return this.parseFunction();
- }
-
- var func = start.result;
- var body;
-
- if (func === "\\left") {
- // If we see a left:
- // Parse the entire left function (including the delimiter)
- var left = this.parseFunction(start);
- // Parse out the implicit body
- body = this.parseExpression(false);
- // Check the next token
- this.expect("\\right", false);
- var right = this.parseFunction();
- return new ParseNode("leftright", {
- body: body,
- left: left.value.value,
- right: right.value.value,
- }, this.mode);
- } else if (func === "\\begin") {
- // begin...end is similar to left...right
- var begin = this.parseFunction(start);
- var envName = begin.value.name;
- if (!environments.hasOwnProperty(envName)) {
- throw new ParseError(
- "No such environment: " + envName,
- this.lexer, begin.value.namepos);
- }
- // Build the environment object. Arguments and other information will
- // be made available to the begin and end methods using properties.
- var env = environments[envName];
- var args = this.parseArguments("\\begin{" + envName + "}", env);
- var context = {
- mode: this.mode,
- envName: envName,
- parser: this,
- lexer: this.lexer,
- positions: args.pop(),
- };
- var result = env.handler(context, args);
- this.expect("\\end", false);
- var end = this.parseFunction();
- if (end.value.name !== envName) {
- throw new ParseError(
- "Mismatch: \\begin{" + envName + "} matched " +
- "by \\end{" + end.value.name + "}",
- this.lexer /* , end.value.namepos */);
- // TODO: Add position to the above line and adjust test case,
- // requires #385 to get merged first
- }
- result.position = end.position;
- return result;
- } else if (utils.contains(sizeFuncs, func)) {
- // If we see a sizing function, parse out the implict body
- body = this.parseExpression(false);
- return new ParseNode("sizing", {
- // Figure out what size to use based on the list of functions above
- size: "size" + (utils.indexOf(sizeFuncs, func) + 1),
- value: body,
- }, this.mode);
- } else if (utils.contains(styleFuncs, func)) {
- // If we see a styling function, parse out the implict body
- body = this.parseExpression(true);
- return new ParseNode("styling", {
- // Figure out what style to use by pulling out the style from
- // the function name
- style: func.slice(1, func.length - 5),
- value: body,
- }, this.mode);
- } else {
- // Defer to parseFunction if it's not a function we handle
- return this.parseFunction(start);
- }
-};
-
-/**
- * Parses an entire function, including its base and all of its arguments.
- * The base might either have been parsed already, in which case
- * it is provided as an argument, or it's the next group in the input.
- *
- * @param {ParseFuncOrArgument=} baseGroup optional as described above
- * @return {?ParseNode}
- */
-Parser.prototype.parseFunction = function(baseGroup) {
- if (!baseGroup) {
- baseGroup = this.parseGroup();
- }
-
- if (baseGroup) {
- if (baseGroup.isFunction) {
- var func = baseGroup.result;
- var funcData = functions[func];
- if (this.mode === "text" && !funcData.allowedInText) {
- throw new ParseError(
- "Can't use function '" + func + "' in text mode",
- this.lexer, baseGroup.position);
- }
-
- var args = this.parseArguments(func, funcData);
- var result = this.callFunction(func, args, args.pop());
- return new ParseNode(result.type, result, this.mode);
- } else {
- return baseGroup.result;
- }
- } else {
- return null;
- }
-};
-
-/**
- * Call a function handler with a suitable context and arguments.
- */
-Parser.prototype.callFunction = function(name, args, positions) {
- var context = {
- funcName: name,
- parser: this,
- lexer: this.lexer,
- positions: positions,
- };
- return functions[name].handler(context, args);
-};
-
-/**
- * Parses the arguments of a function or environment
- *
- * @param {string} func "\name" or "\begin{name}"
- * @param {{numArgs:number,numOptionalArgs:number|undefined}} funcData
- * @return the array of arguments, with the list of positions as last element
- */
-Parser.prototype.parseArguments = function(func, funcData) {
- var totalArgs = funcData.numArgs + funcData.numOptionalArgs;
- if (totalArgs === 0) {
- return [[this.pos]];
- }
-
- var baseGreediness = funcData.greediness;
- var positions = [this.pos];
- var args = [];
-
- for (var i = 0; i < totalArgs; i++) {
- var argType = funcData.argTypes && funcData.argTypes[i];
- var arg;
- if (i < funcData.numOptionalArgs) {
- if (argType) {
- arg = this.parseSpecialGroup(argType, true);
- } else {
- arg = this.parseOptionalGroup();
- }
- if (!arg) {
- args.push(null);
- positions.push(this.pos);
- continue;
- }
- } else {
- if (argType) {
- arg = this.parseSpecialGroup(argType);
- } else {
- arg = this.parseGroup();
- }
- if (!arg) {
- if (!this.settings.throwOnError &&
- this.nextToken.text[0] === "\\") {
- arg = new ParseFuncOrArgument(
- this.handleUnsupportedCmd(this.nextToken.text),
- false);
- } else {
- throw new ParseError(
- "Expected group after '" + func + "'",
- this.lexer, this.pos);
- }
- }
- }
- var argNode;
- if (arg.isFunction) {
- var argGreediness =
- functions[arg.result].greediness;
- if (argGreediness > baseGreediness) {
- argNode = this.parseFunction(arg);
- } else {
- throw new ParseError(
- "Got function '" + arg.result + "' as " +
- "argument to '" + func + "'",
- this.lexer, this.pos - 1);
- }
- } else {
- argNode = arg.result;
- }
- args.push(argNode);
- positions.push(this.pos);
- }
-
- args.push(positions);
-
- return args;
-};
-
-
-/**
- * Parses a group when the mode is changing. Takes a position, a new mode, and
- * an outer mode that is used to parse the outside.
- *
- * @return {?ParseFuncOrArgument}
- */
-Parser.prototype.parseSpecialGroup = function(innerMode, optional) {
- var outerMode = this.mode;
- // Handle `original` argTypes
- if (innerMode === "original") {
- innerMode = outerMode;
- }
-
- if (innerMode === "color" || innerMode === "size") {
- // color and size modes are special because they should have braces and
- // should only lex a single symbol inside
- var openBrace = this.nextToken;
- if (optional && openBrace.text !== "[") {
- // optional arguments should return null if they don't exist
- return null;
- }
- // The call to expect will lex the token after the '{' in inner mode
- this.mode = innerMode;
- this.expect(optional ? "[" : "{");
- var inner = this.nextToken;
- this.mode = outerMode;
- var data;
- if (innerMode === "color") {
- data = inner.text;
- } else {
- data = inner.data;
- }
- this.consume(); // consume the token stored in inner
- this.expect(optional ? "]" : "}");
- return new ParseFuncOrArgument(
- new ParseNode(innerMode, data, outerMode),
- false);
- } else if (innerMode === "text") {
- // text mode is special because it should ignore the whitespace before
- // it
- var whitespace = this.lexer.lex(this.pos, "whitespace");
- this.pos = whitespace.position;
- }
-
- // By the time we get here, innerMode is one of "text" or "math".
- // We switch the mode of the parser, recurse, then restore the old mode.
- this.mode = innerMode;
- this.nextToken = this.lexer.lex(this.pos, innerMode);
- var res;
- if (optional) {
- res = this.parseOptionalGroup();
- } else {
- res = this.parseGroup();
- }
- this.mode = outerMode;
- this.nextToken = this.lexer.lex(this.pos, outerMode);
- return res;
-};
-
-/**
- * Parses a group, which is either a single nucleus (like "x") or an expression
- * in braces (like "{x+y}")
- *
- * @return {?ParseFuncOrArgument}
- */
-Parser.prototype.parseGroup = function() {
- // Try to parse an open brace
- if (this.nextToken.text === "{") {
- // If we get a brace, parse an expression
- this.consume();
- var expression = this.parseExpression(false);
- // Make sure we get a close brace
- this.expect("}");
- return new ParseFuncOrArgument(
- new ParseNode("ordgroup", expression, this.mode),
- false);
- } else {
- // Otherwise, just return a nucleus
- return this.parseSymbol();
- }
-};
-
-/**
- * Parses a group, which is an expression in brackets (like "[x+y]")
- *
- * @return {?ParseFuncOrArgument}
- */
-Parser.prototype.parseOptionalGroup = function() {
- // Try to parse an open bracket
- if (this.nextToken.text === "[") {
- // If we get a brace, parse an expression
- this.consume();
- var expression = this.parseExpression(false, "]");
- // Make sure we get a close bracket
- this.expect("]");
- return new ParseFuncOrArgument(
- new ParseNode("ordgroup", expression, this.mode),
- false);
- } else {
- // Otherwise, return null,
- return null;
- }
-};
-
-/**
- * Parse a single symbol out of the string. Here, we handle both the functions
- * we have defined, as well as the single character symbols
- *
- * @return {?ParseFuncOrArgument}
- */
-Parser.prototype.parseSymbol = function() {
- var nucleus = this.nextToken;
-
- if (functions[nucleus.text]) {
- this.consume();
- // If there exists a function with this name, we return the function and
- // say that it is a function.
- return new ParseFuncOrArgument(
- nucleus.text,
- true);
- } else if (symbols[this.mode][nucleus.text]) {
- this.consume();
- // Otherwise if this is a no-argument function, find the type it
- // corresponds to in the symbols map
- return new ParseFuncOrArgument(
- new ParseNode(symbols[this.mode][nucleus.text].group,
- nucleus.text, this.mode),
- false);
- } else {
- return null;
- }
-};
-
-Parser.prototype.ParseNode = ParseNode;
-
-module.exports = Parser;
-
-},{"./Lexer":298,"./ParseError":300,"./environments":310,"./functions":313,"./parseData":315,"./symbols":317,"./utils":318}],302:[function(require,module,exports){
-/**
- * This is a module for storing settings passed into KaTeX. It correctly handles
- * default settings.
- */
-
-/**
- * Helper function for getting a default value if the value is undefined
- */
-function get(option, defaultValue) {
- return option === undefined ? defaultValue : option;
-}
-
-/**
- * The main Settings object
- *
- * The current options stored are:
- * - displayMode: Whether the expression should be typeset by default in
- * textstyle or displaystyle (default false)
- */
-function Settings(options) {
- // allow null options
- options = options || {};
- this.displayMode = get(options.displayMode, false);
- this.throwOnError = get(options.throwOnError, true);
- this.errorColor = get(options.errorColor, "#cc0000");
-}
-
-module.exports = Settings;
-
-},{}],303:[function(require,module,exports){
-/**
- * This file contains information and classes for the various kinds of styles
- * used in TeX. It provides a generic `Style` class, which holds information
- * about a specific style. It then provides instances of all the different kinds
- * of styles possible, and provides functions to move between them and get
- * information about them.
- */
-
-/**
- * The main style class. Contains a unique id for the style, a size (which is
- * the same for cramped and uncramped version of a style), a cramped flag, and a
- * size multiplier, which gives the size difference between a style and
- * textstyle.
- */
-function Style(id, size, multiplier, cramped) {
- this.id = id;
- this.size = size;
- this.cramped = cramped;
- this.sizeMultiplier = multiplier;
-}
-
-/**
- * Get the style of a superscript given a base in the current style.
- */
-Style.prototype.sup = function() {
- return styles[sup[this.id]];
-};
-
-/**
- * Get the style of a subscript given a base in the current style.
- */
-Style.prototype.sub = function() {
- return styles[sub[this.id]];
-};
-
-/**
- * Get the style of a fraction numerator given the fraction in the current
- * style.
- */
-Style.prototype.fracNum = function() {
- return styles[fracNum[this.id]];
-};
-
-/**
- * Get the style of a fraction denominator given the fraction in the current
- * style.
- */
-Style.prototype.fracDen = function() {
- return styles[fracDen[this.id]];
-};
-
-/**
- * Get the cramped version of a style (in particular, cramping a cramped style
- * doesn't change the style).
- */
-Style.prototype.cramp = function() {
- return styles[cramp[this.id]];
-};
-
-/**
- * HTML class name, like "displaystyle cramped"
- */
-Style.prototype.cls = function() {
- return sizeNames[this.size] + (this.cramped ? " cramped" : " uncramped");
-};
-
-/**
- * HTML Reset class name, like "reset-textstyle"
- */
-Style.prototype.reset = function() {
- return resetNames[this.size];
-};
-
-// IDs of the different styles
-var D = 0;
-var Dc = 1;
-var T = 2;
-var Tc = 3;
-var S = 4;
-var Sc = 5;
-var SS = 6;
-var SSc = 7;
-
-// String names for the different sizes
-var sizeNames = [
- "displaystyle textstyle",
- "textstyle",
- "scriptstyle",
- "scriptscriptstyle",
-];
-
-// Reset names for the different sizes
-var resetNames = [
- "reset-textstyle",
- "reset-textstyle",
- "reset-scriptstyle",
- "reset-scriptscriptstyle",
-];
-
-// Instances of the different styles
-var styles = [
- new Style(D, 0, 1.0, false),
- new Style(Dc, 0, 1.0, true),
- new Style(T, 1, 1.0, false),
- new Style(Tc, 1, 1.0, true),
- new Style(S, 2, 0.7, false),
- new Style(Sc, 2, 0.7, true),
- new Style(SS, 3, 0.5, false),
- new Style(SSc, 3, 0.5, true),
-];
-
-// Lookup tables for switching from one style to another
-var sup = [S, Sc, S, Sc, SS, SSc, SS, SSc];
-var sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc];
-var fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc];
-var fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc];
-var cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc];
-
-// We only export some of the styles. Also, we don't export the `Style` class so
-// no more styles can be generated.
-module.exports = {
- DISPLAY: styles[D],
- TEXT: styles[T],
- SCRIPT: styles[S],
- SCRIPTSCRIPT: styles[SS],
-};
-
-},{}],304:[function(require,module,exports){
-/* eslint no-console:0 */
-/**
- * This module contains general functions that can be used for building
- * different kinds of domTree nodes in a consistent manner.
- */
-
-var domTree = require("./domTree");
-var fontMetrics = require("./fontMetrics");
-var symbols = require("./symbols");
-var utils = require("./utils");
-
-var greekCapitals = [
- "\\Gamma",
- "\\Delta",
- "\\Theta",
- "\\Lambda",
- "\\Xi",
- "\\Pi",
- "\\Sigma",
- "\\Upsilon",
- "\\Phi",
- "\\Psi",
- "\\Omega",
-];
-
-var dotlessLetters = [
- "\u0131", // dotless i, \imath
- "\u0237", // dotless j, \jmath
-];
-
-/**
- * Makes a symbolNode after translation via the list of symbols in symbols.js.
- * Correctly pulls out metrics for the character, and optionally takes a list of
- * classes to be attached to the node.
- */
-var makeSymbol = function(value, style, mode, color, classes) {
- // Replace the value with its replaced value from symbol.js
- if (symbols[mode][value] && symbols[mode][value].replace) {
- value = symbols[mode][value].replace;
- }
-
- var metrics = fontMetrics.getCharacterMetrics(value, style);
-
- var symbolNode;
- if (metrics) {
- symbolNode = new domTree.symbolNode(
- value, metrics.height, metrics.depth, metrics.italic, metrics.skew,
- classes);
- } else {
- // TODO(emily): Figure out a good way to only print this in development
- typeof console !== "undefined" && console.warn(
- "No character metrics for '" + value + "' in style '" +
- style + "'");
- symbolNode = new domTree.symbolNode(value, 0, 0, 0, 0, classes);
- }
-
- if (color) {
- symbolNode.style.color = color;
- }
-
- return symbolNode;
-};
-
-/**
- * Makes a symbol in Main-Regular or AMS-Regular.
- * Used for rel, bin, open, close, inner, and punct.
- */
-var mathsym = function(value, mode, color, classes) {
- // Decide what font to render the symbol in by its entry in the symbols
- // table.
- // Have a special case for when the value = \ because the \ is used as a
- // textord in unsupported command errors but cannot be parsed as a regular
- // text ordinal and is therefore not present as a symbol in the symbols
- // table for text
- if (value === "\\" || symbols[mode][value].font === "main") {
- return makeSymbol(value, "Main-Regular", mode, color, classes);
- } else {
- return makeSymbol(
- value, "AMS-Regular", mode, color, classes.concat(["amsrm"]));
- }
-};
-
-/**
- * Makes a symbol in the default font for mathords and textords.
- */
-var mathDefault = function(value, mode, color, classes, type) {
- if (type === "mathord") {
- return mathit(value, mode, color, classes);
- } else if (type === "textord") {
- return makeSymbol(
- value, "Main-Regular", mode, color, classes.concat(["mathrm"]));
- } else {
- throw new Error("unexpected type: " + type + " in mathDefault");
- }
-};
-
-/**
- * Makes a symbol in the italic math font.
- */
-var mathit = function(value, mode, color, classes) {
- if (/[0-9]/.test(value.charAt(0)) ||
- // glyphs for \imath and \jmath do not exist in Math-Italic so we
- // need to use Main-Italic instead
- utils.contains(dotlessLetters, value) ||
- utils.contains(greekCapitals, value)) {
- return makeSymbol(
- value, "Main-Italic", mode, color, classes.concat(["mainit"]));
- } else {
- return makeSymbol(
- value, "Math-Italic", mode, color, classes.concat(["mathit"]));
- }
-};
-
-/**
- * Makes either a mathord or textord in the correct font and color.
- */
-var makeOrd = function(group, options, type) {
- var mode = group.mode;
- var value = group.value;
- if (symbols[mode][value] && symbols[mode][value].replace) {
- value = symbols[mode][value].replace;
- }
-
- var classes = ["mord"];
- var color = options.getColor();
-
- var font = options.font;
- if (font) {
- if (font === "mathit" || utils.contains(dotlessLetters, value)) {
- return mathit(value, mode, color, classes);
- } else {
- var fontName = fontMap[font].fontName;
- if (fontMetrics.getCharacterMetrics(value, fontName)) {
- return makeSymbol(
- value, fontName, mode, color, classes.concat([font]));
- } else {
- return mathDefault(value, mode, color, classes, type);
- }
- }
- } else {
- return mathDefault(value, mode, color, classes, type);
- }
-};
-
-/**
- * Calculate the height, depth, and maxFontSize of an element based on its
- * children.
- */
-var sizeElementFromChildren = function(elem) {
- var height = 0;
- var depth = 0;
- var maxFontSize = 0;
-
- if (elem.children) {
- for (var i = 0; i < elem.children.length; i++) {
- if (elem.children[i].height > height) {
- height = elem.children[i].height;
- }
- if (elem.children[i].depth > depth) {
- depth = elem.children[i].depth;
- }
- if (elem.children[i].maxFontSize > maxFontSize) {
- maxFontSize = elem.children[i].maxFontSize;
- }
- }
- }
-
- elem.height = height;
- elem.depth = depth;
- elem.maxFontSize = maxFontSize;
-};
-
-/**
- * Makes a span with the given list of classes, list of children, and color.
- */
-var makeSpan = function(classes, children, color) {
- var span = new domTree.span(classes, children);
-
- sizeElementFromChildren(span);
-
- if (color) {
- span.style.color = color;
- }
-
- return span;
-};
-
-/**
- * Makes a document fragment with the given list of children.
- */
-var makeFragment = function(children) {
- var fragment = new domTree.documentFragment(children);
-
- sizeElementFromChildren(fragment);
-
- return fragment;
-};
-
-/**
- * Makes an element placed in each of the vlist elements to ensure that each
- * element has the same max font size. To do this, we create a zero-width space
- * with the correct font size.
- */
-var makeFontSizer = function(options, fontSize) {
- var fontSizeInner = makeSpan([], [new domTree.symbolNode("\u200b")]);
- fontSizeInner.style.fontSize =
- (fontSize / options.style.sizeMultiplier) + "em";
-
- var fontSizer = makeSpan(
- ["fontsize-ensurer", "reset-" + options.size, "size5"],
- [fontSizeInner]);
-
- return fontSizer;
-};
-
-/**
- * Makes a vertical list by stacking elements and kerns on top of each other.
- * Allows for many different ways of specifying the positioning method.
- *
- * Arguments:
- * - children: A list of child or kern nodes to be stacked on top of each other
- * (i.e. the first element will be at the bottom, and the last at
- * the top). Element nodes are specified as
- * {type: "elem", elem: node}
- * while kern nodes are specified as
- * {type: "kern", size: size}
- * - positionType: The method by which the vlist should be positioned. Valid
- * values are:
- * - "individualShift": The children list only contains elem
- * nodes, and each node contains an extra
- * "shift" value of how much it should be
- * shifted (note that shifting is always
- * moving downwards). positionData is
- * ignored.
- * - "top": The positionData specifies the topmost point of
- * the vlist (note this is expected to be a height,
- * so positive values move up)
- * - "bottom": The positionData specifies the bottommost point
- * of the vlist (note this is expected to be a
- * depth, so positive values move down
- * - "shift": The vlist will be positioned such that its
- * baseline is positionData away from the baseline
- * of the first child. Positive values move
- * downwards.
- * - "firstBaseline": The vlist will be positioned such that
- * its baseline is aligned with the
- * baseline of the first child.
- * positionData is ignored. (this is
- * equivalent to "shift" with
- * positionData=0)
- * - positionData: Data used in different ways depending on positionType
- * - options: An Options object
- *
- */
-var makeVList = function(children, positionType, positionData, options) {
- var depth;
- var currPos;
- var i;
- if (positionType === "individualShift") {
- var oldChildren = children;
- children = [oldChildren[0]];
-
- // Add in kerns to the list of children to get each element to be
- // shifted to the correct specified shift
- depth = -oldChildren[0].shift - oldChildren[0].elem.depth;
- currPos = depth;
- for (i = 1; i < oldChildren.length; i++) {
- var diff = -oldChildren[i].shift - currPos -
- oldChildren[i].elem.depth;
- var size = diff -
- (oldChildren[i - 1].elem.height +
- oldChildren[i - 1].elem.depth);
-
- currPos = currPos + diff;
-
- children.push({type: "kern", size: size});
- children.push(oldChildren[i]);
- }
- } else if (positionType === "top") {
- // We always start at the bottom, so calculate the bottom by adding up
- // all the sizes
- var bottom = positionData;
- for (i = 0; i < children.length; i++) {
- if (children[i].type === "kern") {
- bottom -= children[i].size;
- } else {
- bottom -= children[i].elem.height + children[i].elem.depth;
- }
- }
- depth = bottom;
- } else if (positionType === "bottom") {
- depth = -positionData;
- } else if (positionType === "shift") {
- depth = -children[0].elem.depth - positionData;
- } else if (positionType === "firstBaseline") {
- depth = -children[0].elem.depth;
- } else {
- depth = 0;
- }
-
- // Make the fontSizer
- var maxFontSize = 0;
- for (i = 0; i < children.length; i++) {
- if (children[i].type === "elem") {
- maxFontSize = Math.max(maxFontSize, children[i].elem.maxFontSize);
- }
- }
- var fontSizer = makeFontSizer(options, maxFontSize);
-
- // Create a new list of actual children at the correct offsets
- var realChildren = [];
- currPos = depth;
- for (i = 0; i < children.length; i++) {
- if (children[i].type === "kern") {
- currPos += children[i].size;
- } else {
- var child = children[i].elem;
-
- var shift = -child.depth - currPos;
- currPos += child.height + child.depth;
-
- var childWrap = makeSpan([], [fontSizer, child]);
- childWrap.height -= shift;
- childWrap.depth += shift;
- childWrap.style.top = shift + "em";
-
- realChildren.push(childWrap);
- }
- }
-
- // Add in an element at the end with no offset to fix the calculation of
- // baselines in some browsers (namely IE, sometimes safari)
- var baselineFix = makeSpan(
- ["baseline-fix"], [fontSizer, new domTree.symbolNode("\u200b")]);
- realChildren.push(baselineFix);
-
- var vlist = makeSpan(["vlist"], realChildren);
- // Fix the final height and depth, in case there were kerns at the ends
- // since the makeSpan calculation won't take that in to account.
- vlist.height = Math.max(currPos, vlist.height);
- vlist.depth = Math.max(-depth, vlist.depth);
- return vlist;
-};
-
-// A table of size -> font size for the different sizing functions
-var sizingMultiplier = {
- size1: 0.5,
- size2: 0.7,
- size3: 0.8,
- size4: 0.9,
- size5: 1.0,
- size6: 1.2,
- size7: 1.44,
- size8: 1.73,
- size9: 2.07,
- size10: 2.49,
-};
-
-// A map of spacing functions to their attributes, like size and corresponding
-// CSS class
-var spacingFunctions = {
- "\\qquad": {
- size: "2em",
- className: "qquad",
- },
- "\\quad": {
- size: "1em",
- className: "quad",
- },
- "\\enspace": {
- size: "0.5em",
- className: "enspace",
- },
- "\\;": {
- size: "0.277778em",
- className: "thickspace",
- },
- "\\:": {
- size: "0.22222em",
- className: "mediumspace",
- },
- "\\,": {
- size: "0.16667em",
- className: "thinspace",
- },
- "\\!": {
- size: "-0.16667em",
- className: "negativethinspace",
- },
-};
-
-/**
- * Maps TeX font commands to objects containing:
- * - variant: string used for "mathvariant" attribute in buildMathML.js
- * - fontName: the "style" parameter to fontMetrics.getCharacterMetrics
- */
-// A map between tex font commands an MathML mathvariant attribute values
-var fontMap = {
- // styles
- "mathbf": {
- variant: "bold",
- fontName: "Main-Bold",
- },
- "mathrm": {
- variant: "normal",
- fontName: "Main-Regular",
- },
-
- // "mathit" is missing because it requires the use of two fonts: Main-Italic
- // and Math-Italic. This is handled by a special case in makeOrd which ends
- // up calling mathit.
-
- // families
- "mathbb": {
- variant: "double-struck",
- fontName: "AMS-Regular",
- },
- "mathcal": {
- variant: "script",
- fontName: "Caligraphic-Regular",
- },
- "mathfrak": {
- variant: "fraktur",
- fontName: "Fraktur-Regular",
- },
- "mathscr": {
- variant: "script",
- fontName: "Script-Regular",
- },
- "mathsf": {
- variant: "sans-serif",
- fontName: "SansSerif-Regular",
- },
- "mathtt": {
- variant: "monospace",
- fontName: "Typewriter-Regular",
- },
-};
-
-module.exports = {
- fontMap: fontMap,
- makeSymbol: makeSymbol,
- mathsym: mathsym,
- makeSpan: makeSpan,
- makeFragment: makeFragment,
- makeVList: makeVList,
- makeOrd: makeOrd,
- sizingMultiplier: sizingMultiplier,
- spacingFunctions: spacingFunctions,
-};
-
-},{"./domTree":309,"./fontMetrics":311,"./symbols":317,"./utils":318}],305:[function(require,module,exports){
-/* eslint no-console:0 */
-/**
- * This file does the main work of building a domTree structure from a parse
- * tree. The entry point is the `buildHTML` function, which takes a parse tree.
- * Then, the buildExpression, buildGroup, and various groupTypes functions are
- * called, to produce a final HTML tree.
- */
-
-var ParseError = require("./ParseError");
-var Style = require("./Style");
-
-var buildCommon = require("./buildCommon");
-var delimiter = require("./delimiter");
-var domTree = require("./domTree");
-var fontMetrics = require("./fontMetrics");
-var utils = require("./utils");
-
-var makeSpan = buildCommon.makeSpan;
-
-/**
- * Take a list of nodes, build them in order, and return a list of the built
- * nodes. This function handles the `prev` node correctly, and passes the
- * previous element from the list as the prev of the next element.
- */
-var buildExpression = function(expression, options, prev) {
- var groups = [];
- for (var i = 0; i < expression.length; i++) {
- var group = expression[i];
- groups.push(buildGroup(group, options, prev));
- prev = group;
- }
- return groups;
-};
-
-// List of types used by getTypeOfGroup,
-// see https://github.com/Khan/KaTeX/wiki/Examining-TeX#group-types
-var groupToType = {
- mathord: "mord",
- textord: "mord",
- bin: "mbin",
- rel: "mrel",
- text: "mord",
- open: "mopen",
- close: "mclose",
- inner: "minner",
- genfrac: "mord",
- array: "mord",
- spacing: "mord",
- punct: "mpunct",
- ordgroup: "mord",
- op: "mop",
- katex: "mord",
- overline: "mord",
- underline: "mord",
- rule: "mord",
- leftright: "minner",
- sqrt: "mord",
- accent: "mord",
-};
-
-/**
- * Gets the final math type of an expression, given its group type. This type is
- * used to determine spacing between elements, and affects bin elements by
- * causing them to change depending on what types are around them. This type
- * must be attached to the outermost node of an element as a CSS class so that
- * spacing with its surrounding elements works correctly.
- *
- * Some elements can be mapped one-to-one from group type to math type, and
- * those are listed in the `groupToType` table.
- *
- * Others (usually elements that wrap around other elements) often have
- * recursive definitions, and thus call `getTypeOfGroup` on their inner
- * elements.
- */
-var getTypeOfGroup = function(group) {
- if (group == null) {
- // Like when typesetting $^3$
- return groupToType.mathord;
- } else if (group.type === "supsub") {
- return getTypeOfGroup(group.value.base);
- } else if (group.type === "llap" || group.type === "rlap") {
- return getTypeOfGroup(group.value);
- } else if (group.type === "color") {
- return getTypeOfGroup(group.value.value);
- } else if (group.type === "sizing") {
- return getTypeOfGroup(group.value.value);
- } else if (group.type === "styling") {
- return getTypeOfGroup(group.value.value);
- } else if (group.type === "delimsizing") {
- return groupToType[group.value.delimType];
- } else {
- return groupToType[group.type];
- }
-};
-
-/**
- * Sometimes, groups perform special rules when they have superscripts or
- * subscripts attached to them. This function lets the `supsub` group know that
- * its inner element should handle the superscripts and subscripts instead of
- * handling them itself.
- */
-var shouldHandleSupSub = function(group, options) {
- if (!group) {
- return false;
- } else if (group.type === "op") {
- // Operators handle supsubs differently when they have limits
- // (e.g. `\displaystyle\sum_2^3`)
- return group.value.limits &&
- (options.style.size === Style.DISPLAY.size ||
- group.value.alwaysHandleSupSub);
- } else if (group.type === "accent") {
- return isCharacterBox(group.value.base);
- } else {
- return null;
- }
-};
-
-/**
- * Sometimes we want to pull out the innermost element of a group. In most
- * cases, this will just be the group itself, but when ordgroups and colors have
- * a single element, we want to pull that out.
- */
-var getBaseElem = function(group) {
- if (!group) {
- return false;
- } else if (group.type === "ordgroup") {
- if (group.value.length === 1) {
- return getBaseElem(group.value[0]);
- } else {
- return group;
- }
- } else if (group.type === "color") {
- if (group.value.value.length === 1) {
- return getBaseElem(group.value.value[0]);
- } else {
- return group;
- }
- } else {
- return group;
- }
-};
-
-/**
- * TeXbook algorithms often reference "character boxes", which are simply groups
- * with a single character in them. To decide if something is a character box,
- * we find its innermost group, and see if it is a single character.
- */
-var isCharacterBox = function(group) {
- var baseElem = getBaseElem(group);
-
- // These are all they types of groups which hold single characters
- return baseElem.type === "mathord" ||
- baseElem.type === "textord" ||
- baseElem.type === "bin" ||
- baseElem.type === "rel" ||
- baseElem.type === "inner" ||
- baseElem.type === "open" ||
- baseElem.type === "close" ||
- baseElem.type === "punct";
-};
-
-var makeNullDelimiter = function(options) {
- return makeSpan([
- "sizing", "reset-" + options.size, "size5",
- options.style.reset(), Style.TEXT.cls(),
- "nulldelimiter",
- ]);
-};
-
-/**
- * This is a map of group types to the function used to handle that type.
- * Simpler types come at the beginning, while complicated types come afterwards.
- */
-var groupTypes = {};
-
-groupTypes.mathord = function(group, options, prev) {
- return buildCommon.makeOrd(group, options, "mathord");
-};
-
-groupTypes.textord = function(group, options, prev) {
- return buildCommon.makeOrd(group, options, "textord");
-};
-
-groupTypes.bin = function(group, options, prev) {
- var className = "mbin";
- // Pull out the most recent element. Do some special handling to find
- // things at the end of a \color group. Note that we don't use the same
- // logic for ordgroups (which count as ords).
- var prevAtom = prev;
- while (prevAtom && prevAtom.type === "color") {
- var atoms = prevAtom.value.value;
- prevAtom = atoms[atoms.length - 1];
- }
- // See TeXbook pg. 442-446, Rules 5 and 6, and the text before Rule 19.
- // Here, we determine whether the bin should turn into an ord. We
- // currently only apply Rule 5.
- if (!prev || utils.contains(["mbin", "mopen", "mrel", "mop", "mpunct"],
- getTypeOfGroup(prevAtom))) {
- group.type = "textord";
- className = "mord";
- }
-
- return buildCommon.mathsym(
- group.value, group.mode, options.getColor(), [className]);
-};
-
-groupTypes.rel = function(group, options, prev) {
- return buildCommon.mathsym(
- group.value, group.mode, options.getColor(), ["mrel"]);
-};
-
-groupTypes.open = function(group, options, prev) {
- return buildCommon.mathsym(
- group.value, group.mode, options.getColor(), ["mopen"]);
-};
-
-groupTypes.close = function(group, options, prev) {
- return buildCommon.mathsym(
- group.value, group.mode, options.getColor(), ["mclose"]);
-};
-
-groupTypes.inner = function(group, options, prev) {
- return buildCommon.mathsym(
- group.value, group.mode, options.getColor(), ["minner"]);
-};
-
-groupTypes.punct = function(group, options, prev) {
- return buildCommon.mathsym(
- group.value, group.mode, options.getColor(), ["mpunct"]);
-};
-
-groupTypes.ordgroup = function(group, options, prev) {
- return makeSpan(
- ["mord", options.style.cls()],
- buildExpression(group.value, options.reset())
- );
-};
-
-groupTypes.text = function(group, options, prev) {
- return makeSpan(["text", "mord", options.style.cls()],
- buildExpression(group.value.body, options.reset()));
-};
-
-groupTypes.color = function(group, options, prev) {
- var elements = buildExpression(
- group.value.value,
- options.withColor(group.value.color),
- prev
- );
-
- // \color isn't supposed to affect the type of the elements it contains.
- // To accomplish this, we wrap the results in a fragment, so the inner
- // elements will be able to directly interact with their neighbors. For
- // example, `\color{red}{2 +} 3` has the same spacing as `2 + 3`
- return new buildCommon.makeFragment(elements);
-};
-
-groupTypes.supsub = function(group, options, prev) {
- // Superscript and subscripts are handled in the TeXbook on page
- // 445-446, rules 18(a-f).
-
- // Here is where we defer to the inner group if it should handle
- // superscripts and subscripts itself.
- if (shouldHandleSupSub(group.value.base, options)) {
- return groupTypes[group.value.base.type](group, options, prev);
- }
-
- var base = buildGroup(group.value.base, options.reset());
- var supmid;
- var submid;
- var sup;
- var sub;
-
- if (group.value.sup) {
- sup = buildGroup(group.value.sup,
- options.withStyle(options.style.sup()));
- supmid = makeSpan(
- [options.style.reset(), options.style.sup().cls()], [sup]);
- }
-
- if (group.value.sub) {
- sub = buildGroup(group.value.sub,
- options.withStyle(options.style.sub()));
- submid = makeSpan(
- [options.style.reset(), options.style.sub().cls()], [sub]);
- }
-
- // Rule 18a
- var supShift;
- var subShift;
- if (isCharacterBox(group.value.base)) {
- supShift = 0;
- subShift = 0;
- } else {
- supShift = base.height - fontMetrics.metrics.supDrop;
- subShift = base.depth + fontMetrics.metrics.subDrop;
- }
-
- // Rule 18c
- var minSupShift;
- if (options.style === Style.DISPLAY) {
- minSupShift = fontMetrics.metrics.sup1;
- } else if (options.style.cramped) {
- minSupShift = fontMetrics.metrics.sup3;
- } else {
- minSupShift = fontMetrics.metrics.sup2;
- }
-
- // scriptspace is a font-size-independent size, so scale it
- // appropriately
- var multiplier = Style.TEXT.sizeMultiplier *
- options.style.sizeMultiplier;
- var scriptspace =
- (0.5 / fontMetrics.metrics.ptPerEm) / multiplier + "em";
-
- var supsub;
- if (!group.value.sup) {
- // Rule 18b
- subShift = Math.max(
- subShift, fontMetrics.metrics.sub1,
- sub.height - 0.8 * fontMetrics.metrics.xHeight);
-
- supsub = buildCommon.makeVList([
- {type: "elem", elem: submid},
- ], "shift", subShift, options);
-
- supsub.children[0].style.marginRight = scriptspace;
-
- // Subscripts shouldn't be shifted by the base's italic correction.
- // Account for that by shifting the subscript back the appropriate
- // amount. Note we only do this when the base is a single symbol.
- if (base instanceof domTree.symbolNode) {
- supsub.children[0].style.marginLeft = -base.italic + "em";
- }
- } else if (!group.value.sub) {
- // Rule 18c, d
- supShift = Math.max(supShift, minSupShift,
- sup.depth + 0.25 * fontMetrics.metrics.xHeight);
-
- supsub = buildCommon.makeVList([
- {type: "elem", elem: supmid},
- ], "shift", -supShift, options);
-
- supsub.children[0].style.marginRight = scriptspace;
- } else {
- supShift = Math.max(
- supShift, minSupShift,
- sup.depth + 0.25 * fontMetrics.metrics.xHeight);
- subShift = Math.max(subShift, fontMetrics.metrics.sub2);
-
- var ruleWidth = fontMetrics.metrics.defaultRuleThickness;
-
- // Rule 18e
- if ((supShift - sup.depth) - (sub.height - subShift) <
- 4 * ruleWidth) {
- subShift = 4 * ruleWidth - (supShift - sup.depth) + sub.height;
- var psi = 0.8 * fontMetrics.metrics.xHeight -
- (supShift - sup.depth);
- if (psi > 0) {
- supShift += psi;
- subShift -= psi;
- }
- }
-
- supsub = buildCommon.makeVList([
- {type: "elem", elem: submid, shift: subShift},
- {type: "elem", elem: supmid, shift: -supShift},
- ], "individualShift", null, options);
-
- // See comment above about subscripts not being shifted
- if (base instanceof domTree.symbolNode) {
- supsub.children[0].style.marginLeft = -base.italic + "em";
- }
-
- supsub.children[0].style.marginRight = scriptspace;
- supsub.children[1].style.marginRight = scriptspace;
- }
-
- return makeSpan([getTypeOfGroup(group.value.base)],
- [base, supsub]);
-};
-
-groupTypes.genfrac = function(group, options, prev) {
- // Fractions are handled in the TeXbook on pages 444-445, rules 15(a-e).
- // Figure out what style this fraction should be in based on the
- // function used
- var fstyle = options.style;
- if (group.value.size === "display") {
- fstyle = Style.DISPLAY;
- } else if (group.value.size === "text") {
- fstyle = Style.TEXT;
- }
-
- var nstyle = fstyle.fracNum();
- var dstyle = fstyle.fracDen();
-
- var numer = buildGroup(group.value.numer, options.withStyle(nstyle));
- var numerreset = makeSpan([fstyle.reset(), nstyle.cls()], [numer]);
-
- var denom = buildGroup(group.value.denom, options.withStyle(dstyle));
- var denomreset = makeSpan([fstyle.reset(), dstyle.cls()], [denom]);
-
- var ruleWidth;
- if (group.value.hasBarLine) {
- ruleWidth = fontMetrics.metrics.defaultRuleThickness /
- options.style.sizeMultiplier;
- } else {
- ruleWidth = 0;
- }
-
- // Rule 15b
- var numShift;
- var clearance;
- var denomShift;
- if (fstyle.size === Style.DISPLAY.size) {
- numShift = fontMetrics.metrics.num1;
- if (ruleWidth > 0) {
- clearance = 3 * ruleWidth;
- } else {
- clearance = 7 * fontMetrics.metrics.defaultRuleThickness;
- }
- denomShift = fontMetrics.metrics.denom1;
- } else {
- if (ruleWidth > 0) {
- numShift = fontMetrics.metrics.num2;
- clearance = ruleWidth;
- } else {
- numShift = fontMetrics.metrics.num3;
- clearance = 3 * fontMetrics.metrics.defaultRuleThickness;
- }
- denomShift = fontMetrics.metrics.denom2;
- }
-
- var frac;
- if (ruleWidth === 0) {
- // Rule 15c
- var candiateClearance =
- (numShift - numer.depth) - (denom.height - denomShift);
- if (candiateClearance < clearance) {
- numShift += 0.5 * (clearance - candiateClearance);
- denomShift += 0.5 * (clearance - candiateClearance);
- }
-
- frac = buildCommon.makeVList([
- {type: "elem", elem: denomreset, shift: denomShift},
- {type: "elem", elem: numerreset, shift: -numShift},
- ], "individualShift", null, options);
- } else {
- // Rule 15d
- var axisHeight = fontMetrics.metrics.axisHeight;
-
- if ((numShift - numer.depth) - (axisHeight + 0.5 * ruleWidth) <
- clearance) {
- numShift +=
- clearance - ((numShift - numer.depth) -
- (axisHeight + 0.5 * ruleWidth));
- }
-
- if ((axisHeight - 0.5 * ruleWidth) - (denom.height - denomShift) <
- clearance) {
- denomShift +=
- clearance - ((axisHeight - 0.5 * ruleWidth) -
- (denom.height - denomShift));
- }
-
- var mid = makeSpan(
- [options.style.reset(), Style.TEXT.cls(), "frac-line"]);
- // Manually set the height of the line because its height is
- // created in CSS
- mid.height = ruleWidth;
-
- var midShift = -(axisHeight - 0.5 * ruleWidth);
-
- frac = buildCommon.makeVList([
- {type: "elem", elem: denomreset, shift: denomShift},
- {type: "elem", elem: mid, shift: midShift},
- {type: "elem", elem: numerreset, shift: -numShift},
- ], "individualShift", null, options);
- }
-
- // Since we manually change the style sometimes (with \dfrac or \tfrac),
- // account for the possible size change here.
- frac.height *= fstyle.sizeMultiplier / options.style.sizeMultiplier;
- frac.depth *= fstyle.sizeMultiplier / options.style.sizeMultiplier;
-
- // Rule 15e
- var delimSize;
- if (fstyle.size === Style.DISPLAY.size) {
- delimSize = fontMetrics.metrics.delim1;
- } else {
- delimSize = fontMetrics.metrics.getDelim2(fstyle);
- }
-
- var leftDelim;
- var rightDelim;
- if (group.value.leftDelim == null) {
- leftDelim = makeNullDelimiter(options);
- } else {
- leftDelim = delimiter.customSizedDelim(
- group.value.leftDelim, delimSize, true,
- options.withStyle(fstyle), group.mode);
- }
- if (group.value.rightDelim == null) {
- rightDelim = makeNullDelimiter(options);
- } else {
- rightDelim = delimiter.customSizedDelim(
- group.value.rightDelim, delimSize, true,
- options.withStyle(fstyle), group.mode);
- }
-
- return makeSpan(
- ["mord", options.style.reset(), fstyle.cls()],
- [leftDelim, makeSpan(["mfrac"], [frac]), rightDelim],
- options.getColor());
-};
-
-groupTypes.array = function(group, options, prev) {
- var r;
- var c;
- var nr = group.value.body.length;
- var nc = 0;
- var body = new Array(nr);
-
- // Horizontal spacing
- var pt = 1 / fontMetrics.metrics.ptPerEm;
- var arraycolsep = 5 * pt; // \arraycolsep in article.cls
-
- // Vertical spacing
- var baselineskip = 12 * pt; // see size10.clo
- // Default \arraystretch from lttab.dtx
- // TODO(gagern): may get redefined once we have user-defined macros
- var arraystretch = utils.deflt(group.value.arraystretch, 1);
- var arrayskip = arraystretch * baselineskip;
- var arstrutHeight = 0.7 * arrayskip; // \strutbox in ltfsstrc.dtx and
- var arstrutDepth = 0.3 * arrayskip; // \@arstrutbox in lttab.dtx
-
- var totalHeight = 0;
- for (r = 0; r < group.value.body.length; ++r) {
- var inrow = group.value.body[r];
- var height = arstrutHeight; // \@array adds an \@arstrut
- var depth = arstrutDepth; // to each tow (via the template)
-
- if (nc < inrow.length) {
- nc = inrow.length;
- }
-
- var outrow = new Array(inrow.length);
- for (c = 0; c < inrow.length; ++c) {
- var elt = buildGroup(inrow[c], options);
- if (depth < elt.depth) {
- depth = elt.depth;
- }
- if (height < elt.height) {
- height = elt.height;
- }
- outrow[c] = elt;
- }
-
- var gap = 0;
- if (group.value.rowGaps[r]) {
- gap = group.value.rowGaps[r].value;
- switch (gap.unit) {
- case "em":
- gap = gap.number;
- break;
- case "ex":
- gap = gap.number * fontMetrics.metrics.emPerEx;
- break;
- default:
- console.error("Can't handle unit " + gap.unit);
- gap = 0;
- }
- if (gap > 0) { // \@argarraycr
- gap += arstrutDepth;
- if (depth < gap) {
- depth = gap; // \@xargarraycr
- }
- gap = 0;
- }
- }
-
- outrow.height = height;
- outrow.depth = depth;
- totalHeight += height;
- outrow.pos = totalHeight;
- totalHeight += depth + gap; // \@yargarraycr
- body[r] = outrow;
- }
-
- var offset = totalHeight / 2 + fontMetrics.metrics.axisHeight;
- var colDescriptions = group.value.cols || [];
- var cols = [];
- var colSep;
- var colDescrNum;
- for (c = 0, colDescrNum = 0;
- // Continue while either there are more columns or more column
- // descriptions, so trailing separators don't get lost.
- c < nc || colDescrNum < colDescriptions.length;
- ++c, ++colDescrNum) {
-
- var colDescr = colDescriptions[colDescrNum] || {};
-
- var firstSeparator = true;
- while (colDescr.type === "separator") {
- // If there is more than one separator in a row, add a space
- // between them.
- if (!firstSeparator) {
- colSep = makeSpan(["arraycolsep"], []);
- colSep.style.width =
- fontMetrics.metrics.doubleRuleSep + "em";
- cols.push(colSep);
- }
-
- if (colDescr.separator === "|") {
- var separator = makeSpan(
- ["vertical-separator"],
- []);
- separator.style.height = totalHeight + "em";
- separator.style.verticalAlign =
- -(totalHeight - offset) + "em";
-
- cols.push(separator);
- } else {
- throw new ParseError(
- "Invalid separator type: " + colDescr.separator);
- }
-
- colDescrNum++;
- colDescr = colDescriptions[colDescrNum] || {};
- firstSeparator = false;
- }
-
- if (c >= nc) {
- continue;
- }
-
- var sepwidth;
- if (c > 0 || group.value.hskipBeforeAndAfter) {
- sepwidth = utils.deflt(colDescr.pregap, arraycolsep);
- if (sepwidth !== 0) {
- colSep = makeSpan(["arraycolsep"], []);
- colSep.style.width = sepwidth + "em";
- cols.push(colSep);
- }
- }
-
- var col = [];
- for (r = 0; r < nr; ++r) {
- var row = body[r];
- var elem = row[c];
- if (!elem) {
- continue;
- }
- var shift = row.pos - offset;
- elem.depth = row.depth;
- elem.height = row.height;
- col.push({type: "elem", elem: elem, shift: shift});
- }
-
- col = buildCommon.makeVList(col, "individualShift", null, options);
- col = makeSpan(
- ["col-align-" + (colDescr.align || "c")],
- [col]);
- cols.push(col);
-
- if (c < nc - 1 || group.value.hskipBeforeAndAfter) {
- sepwidth = utils.deflt(colDescr.postgap, arraycolsep);
- if (sepwidth !== 0) {
- colSep = makeSpan(["arraycolsep"], []);
- colSep.style.width = sepwidth + "em";
- cols.push(colSep);
- }
- }
- }
- body = makeSpan(["mtable"], cols);
- return makeSpan(["mord"], [body], options.getColor());
-};
-
-groupTypes.spacing = function(group, options, prev) {
- if (group.value === "\\ " || group.value === "\\space" ||
- group.value === " " || group.value === "~") {
- // Spaces are generated by adding an actual space. Each of these
- // things has an entry in the symbols table, so these will be turned
- // into appropriate outputs.
- return makeSpan(
- ["mord", "mspace"],
- [buildCommon.mathsym(group.value, group.mode)]
- );
- } else {
- // Other kinds of spaces are of arbitrary width. We use CSS to
- // generate these.
- return makeSpan(
- ["mord", "mspace",
- buildCommon.spacingFunctions[group.value].className]);
- }
-};
-
-groupTypes.llap = function(group, options, prev) {
- var inner = makeSpan(
- ["inner"], [buildGroup(group.value.body, options.reset())]);
- var fix = makeSpan(["fix"], []);
- return makeSpan(
- ["llap", options.style.cls()], [inner, fix]);
-};
-
-groupTypes.rlap = function(group, options, prev) {
- var inner = makeSpan(
- ["inner"], [buildGroup(group.value.body, options.reset())]);
- var fix = makeSpan(["fix"], []);
- return makeSpan(
- ["rlap", options.style.cls()], [inner, fix]);
-};
-
-groupTypes.op = function(group, options, prev) {
- // Operators are handled in the TeXbook pg. 443-444, rule 13(a).
- var supGroup;
- var subGroup;
- var hasLimits = false;
- if (group.type === "supsub" ) {
- // If we have limits, supsub will pass us its group to handle. Pull
- // out the superscript and subscript and set the group to the op in
- // its base.
- supGroup = group.value.sup;
- subGroup = group.value.sub;
- group = group.value.base;
- hasLimits = true;
- }
-
- // Most operators have a large successor symbol, but these don't.
- var noSuccessor = [
- "\\smallint",
- ];
-
- var large = false;
- if (options.style.size === Style.DISPLAY.size &&
- group.value.symbol &&
- !utils.contains(noSuccessor, group.value.body)) {
-
- // Most symbol operators get larger in displaystyle (rule 13)
- large = true;
- }
-
- var base;
- var baseShift = 0;
- var slant = 0;
- if (group.value.symbol) {
- // If this is a symbol, create the symbol.
- var style = large ? "Size2-Regular" : "Size1-Regular";
- base = buildCommon.makeSymbol(
- group.value.body, style, "math", options.getColor(),
- ["op-symbol", large ? "large-op" : "small-op", "mop"]);
-
- // Shift the symbol so its center lies on the axis (rule 13). It
- // appears that our fonts have the centers of the symbols already
- // almost on the axis, so these numbers are very small. Note we
- // don't actually apply this here, but instead it is used either in
- // the vlist creation or separately when there are no limits.
- baseShift = (base.height - base.depth) / 2 -
- fontMetrics.metrics.axisHeight *
- options.style.sizeMultiplier;
-
- // The slant of the symbol is just its italic correction.
- slant = base.italic;
- } else {
- // Otherwise, this is a text operator. Build the text from the
- // operator's name.
- // TODO(emily): Add a space in the middle of some of these
- // operators, like \limsup
- var output = [];
- for (var i = 1; i < group.value.body.length; i++) {
- output.push(buildCommon.mathsym(group.value.body[i], group.mode));
- }
- base = makeSpan(["mop"], output, options.getColor());
- }
-
- if (hasLimits) {
- // IE 8 clips \int if it is in a display: inline-block. We wrap it
- // in a new span so it is an inline, and works.
- base = makeSpan([], [base]);
-
- var supmid;
- var supKern;
- var submid;
- var subKern;
- // We manually have to handle the superscripts and subscripts. This,
- // aside from the kern calculations, is copied from supsub.
- if (supGroup) {
- var sup = buildGroup(
- supGroup, options.withStyle(options.style.sup()));
- supmid = makeSpan(
- [options.style.reset(), options.style.sup().cls()], [sup]);
-
- supKern = Math.max(
- fontMetrics.metrics.bigOpSpacing1,
- fontMetrics.metrics.bigOpSpacing3 - sup.depth);
- }
-
- if (subGroup) {
- var sub = buildGroup(
- subGroup, options.withStyle(options.style.sub()));
- submid = makeSpan(
- [options.style.reset(), options.style.sub().cls()],
- [sub]);
-
- subKern = Math.max(
- fontMetrics.metrics.bigOpSpacing2,
- fontMetrics.metrics.bigOpSpacing4 - sub.height);
- }
-
- // Build the final group as a vlist of the possible subscript, base,
- // and possible superscript.
- var finalGroup;
- var top;
- var bottom;
- if (!supGroup) {
- top = base.height - baseShift;
-
- finalGroup = buildCommon.makeVList([
- {type: "kern", size: fontMetrics.metrics.bigOpSpacing5},
- {type: "elem", elem: submid},
- {type: "kern", size: subKern},
- {type: "elem", elem: base},
- ], "top", top, options);
-
- // Here, we shift the limits by the slant of the symbol. Note
- // that we are supposed to shift the limits by 1/2 of the slant,
- // but since we are centering the limits adding a full slant of
- // margin will shift by 1/2 that.
- finalGroup.children[0].style.marginLeft = -slant + "em";
- } else if (!subGroup) {
- bottom = base.depth + baseShift;
-
- finalGroup = buildCommon.makeVList([
- {type: "elem", elem: base},
- {type: "kern", size: supKern},
- {type: "elem", elem: supmid},
- {type: "kern", size: fontMetrics.metrics.bigOpSpacing5},
- ], "bottom", bottom, options);
-
- // See comment above about slants
- finalGroup.children[1].style.marginLeft = slant + "em";
- } else if (!supGroup && !subGroup) {
- // This case probably shouldn't occur (this would mean the
- // supsub was sending us a group with no superscript or
- // subscript) but be safe.
- return base;
- } else {
- bottom = fontMetrics.metrics.bigOpSpacing5 +
- submid.height + submid.depth +
- subKern +
- base.depth + baseShift;
-
- finalGroup = buildCommon.makeVList([
- {type: "kern", size: fontMetrics.metrics.bigOpSpacing5},
- {type: "elem", elem: submid},
- {type: "kern", size: subKern},
- {type: "elem", elem: base},
- {type: "kern", size: supKern},
- {type: "elem", elem: supmid},
- {type: "kern", size: fontMetrics.metrics.bigOpSpacing5},
- ], "bottom", bottom, options);
-
- // See comment above about slants
- finalGroup.children[0].style.marginLeft = -slant + "em";
- finalGroup.children[2].style.marginLeft = slant + "em";
- }
-
- return makeSpan(["mop", "op-limits"], [finalGroup]);
- } else {
- if (group.value.symbol) {
- base.style.top = baseShift + "em";
- }
-
- return base;
- }
-};
-
-groupTypes.katex = function(group, options, prev) {
- // The KaTeX logo. The offsets for the K and a were chosen to look
- // good, but the offsets for the T, E, and X were taken from the
- // definition of \TeX in TeX (see TeXbook pg. 356)
- var k = makeSpan(
- ["k"], [buildCommon.mathsym("K", group.mode)]);
- var a = makeSpan(
- ["a"], [buildCommon.mathsym("A", group.mode)]);
-
- a.height = (a.height + 0.2) * 0.75;
- a.depth = (a.height - 0.2) * 0.75;
-
- var t = makeSpan(
- ["t"], [buildCommon.mathsym("T", group.mode)]);
- var e = makeSpan(
- ["e"], [buildCommon.mathsym("E", group.mode)]);
-
- e.height = (e.height - 0.2155);
- e.depth = (e.depth + 0.2155);
-
- var x = makeSpan(
- ["x"], [buildCommon.mathsym("X", group.mode)]);
-
- return makeSpan(
- ["katex-logo", "mord"], [k, a, t, e, x], options.getColor());
-};
-
-groupTypes.overline = function(group, options, prev) {
- // Overlines are handled in the TeXbook pg 443, Rule 9.
-
- // Build the inner group in the cramped style.
- var innerGroup = buildGroup(group.value.body,
- options.withStyle(options.style.cramp()));
-
- var ruleWidth = fontMetrics.metrics.defaultRuleThickness /
- options.style.sizeMultiplier;
-
- // Create the line above the body
- var line = makeSpan(
- [options.style.reset(), Style.TEXT.cls(), "overline-line"]);
- line.height = ruleWidth;
- line.maxFontSize = 1.0;
-
- // Generate the vlist, with the appropriate kerns
- var vlist = buildCommon.makeVList([
- {type: "elem", elem: innerGroup},
- {type: "kern", size: 3 * ruleWidth},
- {type: "elem", elem: line},
- {type: "kern", size: ruleWidth},
- ], "firstBaseline", null, options);
-
- return makeSpan(["overline", "mord"], [vlist], options.getColor());
-};
-
-groupTypes.underline = function(group, options, prev) {
- // Underlines are handled in the TeXbook pg 443, Rule 10.
-
- // Build the inner group.
- var innerGroup = buildGroup(group.value.body, options);
-
- var ruleWidth = fontMetrics.metrics.defaultRuleThickness /
- options.style.sizeMultiplier;
-
- // Create the line above the body
- var line = makeSpan(
- [options.style.reset(), Style.TEXT.cls(), "underline-line"]);
- line.height = ruleWidth;
- line.maxFontSize = 1.0;
-
- // Generate the vlist, with the appropriate kerns
- var vlist = buildCommon.makeVList([
- {type: "kern", size: ruleWidth},
- {type: "elem", elem: line},
- {type: "kern", size: 3 * ruleWidth},
- {type: "elem", elem: innerGroup},
- ], "top", innerGroup.height, options);
-
- return makeSpan(["underline", "mord"], [vlist], options.getColor());
-};
-
-groupTypes.sqrt = function(group, options, prev) {
- // Square roots are handled in the TeXbook pg. 443, Rule 11.
-
- // First, we do the same steps as in overline to build the inner group
- // and line
- var inner = buildGroup(group.value.body,
- options.withStyle(options.style.cramp()));
-
- var ruleWidth = fontMetrics.metrics.defaultRuleThickness /
- options.style.sizeMultiplier;
-
- var line = makeSpan(
- [options.style.reset(), Style.TEXT.cls(), "sqrt-line"], [],
- options.getColor());
- line.height = ruleWidth;
- line.maxFontSize = 1.0;
-
- var phi = ruleWidth;
- if (options.style.id < Style.TEXT.id) {
- phi = fontMetrics.metrics.xHeight;
- }
-
- // Calculate the clearance between the body and line
- var lineClearance = ruleWidth + phi / 4;
-
- var innerHeight =
- (inner.height + inner.depth) * options.style.sizeMultiplier;
- var minDelimiterHeight = innerHeight + lineClearance + ruleWidth;
-
- // Create a \surd delimiter of the required minimum size
- var delim = makeSpan(["sqrt-sign"], [
- delimiter.customSizedDelim("\\surd", minDelimiterHeight,
- false, options, group.mode)],
- options.getColor());
-
- var delimDepth = (delim.height + delim.depth) - ruleWidth;
-
- // Adjust the clearance based on the delimiter size
- if (delimDepth > inner.height + inner.depth + lineClearance) {
- lineClearance =
- (lineClearance + delimDepth - inner.height - inner.depth) / 2;
- }
-
- // Shift the delimiter so that its top lines up with the top of the line
- var delimShift = -(inner.height + lineClearance + ruleWidth) + delim.height;
- delim.style.top = delimShift + "em";
- delim.height -= delimShift;
- delim.depth += delimShift;
-
- // We add a special case here, because even when `inner` is empty, we
- // still get a line. So, we use a simple heuristic to decide if we
- // should omit the body entirely. (note this doesn't work for something
- // like `\sqrt{\rlap{x}}`, but if someone is doing that they deserve for
- // it not to work.
- var body;
- if (inner.height === 0 && inner.depth === 0) {
- body = makeSpan();
- } else {
- body = buildCommon.makeVList([
- {type: "elem", elem: inner},
- {type: "kern", size: lineClearance},
- {type: "elem", elem: line},
- {type: "kern", size: ruleWidth},
- ], "firstBaseline", null, options);
- }
-
- if (!group.value.index) {
- return makeSpan(["sqrt", "mord"], [delim, body]);
- } else {
- // Handle the optional root index
-
- // The index is always in scriptscript style
- var root = buildGroup(
- group.value.index,
- options.withStyle(Style.SCRIPTSCRIPT));
- var rootWrap = makeSpan(
- [options.style.reset(), Style.SCRIPTSCRIPT.cls()],
- [root]);
-
- // Figure out the height and depth of the inner part
- var innerRootHeight = Math.max(delim.height, body.height);
- var innerRootDepth = Math.max(delim.depth, body.depth);
-
- // The amount the index is shifted by. This is taken from the TeX
- // source, in the definition of `\r@@t`.
- var toShift = 0.6 * (innerRootHeight - innerRootDepth);
-
- // Build a VList with the superscript shifted up correctly
- var rootVList = buildCommon.makeVList(
- [{type: "elem", elem: rootWrap}],
- "shift", -toShift, options);
- // Add a class surrounding it so we can add on the appropriate
- // kerning
- var rootVListWrap = makeSpan(["root"], [rootVList]);
-
- return makeSpan(["sqrt", "mord"], [rootVListWrap, delim, body]);
- }
-};
-
-groupTypes.sizing = function(group, options, prev) {
- // Handle sizing operators like \Huge. Real TeX doesn't actually allow
- // these functions inside of math expressions, so we do some special
- // handling.
- var inner = buildExpression(group.value.value,
- options.withSize(group.value.size), prev);
-
- var span = makeSpan(["mord"],
- [makeSpan(["sizing", "reset-" + options.size, group.value.size,
- options.style.cls()],
- inner)]);
-
- // Calculate the correct maxFontSize manually
- var fontSize = buildCommon.sizingMultiplier[group.value.size];
- span.maxFontSize = fontSize * options.style.sizeMultiplier;
-
- return span;
-};
-
-groupTypes.styling = function(group, options, prev) {
- // Style changes are handled in the TeXbook on pg. 442, Rule 3.
-
- // Figure out what style we're changing to.
- var style = {
- "display": Style.DISPLAY,
- "text": Style.TEXT,
- "script": Style.SCRIPT,
- "scriptscript": Style.SCRIPTSCRIPT,
- };
-
- var newStyle = style[group.value.style];
-
- // Build the inner expression in the new style.
- var inner = buildExpression(
- group.value.value, options.withStyle(newStyle), prev);
-
- return makeSpan([options.style.reset(), newStyle.cls()], inner);
-};
-
-groupTypes.font = function(group, options, prev) {
- var font = group.value.font;
- return buildGroup(group.value.body, options.withFont(font), prev);
-};
-
-groupTypes.delimsizing = function(group, options, prev) {
- var delim = group.value.value;
-
- if (delim === ".") {
- // Empty delimiters still count as elements, even though they don't
- // show anything.
- return makeSpan([groupToType[group.value.delimType]]);
- }
-
- // Use delimiter.sizedDelim to generate the delimiter.
- return makeSpan(
- [groupToType[group.value.delimType]],
- [delimiter.sizedDelim(
- delim, group.value.size, options, group.mode)]);
-};
-
-groupTypes.leftright = function(group, options, prev) {
- // Build the inner expression
- var inner = buildExpression(group.value.body, options.reset());
-
- var innerHeight = 0;
- var innerDepth = 0;
-
- // Calculate its height and depth
- for (var i = 0; i < inner.length; i++) {
- innerHeight = Math.max(inner[i].height, innerHeight);
- innerDepth = Math.max(inner[i].depth, innerDepth);
- }
-
- // The size of delimiters is the same, regardless of what style we are
- // in. Thus, to correctly calculate the size of delimiter we need around
- // a group, we scale down the inner size based on the size.
- innerHeight *= options.style.sizeMultiplier;
- innerDepth *= options.style.sizeMultiplier;
-
- var leftDelim;
- if (group.value.left === ".") {
- // Empty delimiters in \left and \right make null delimiter spaces.
- leftDelim = makeNullDelimiter(options);
- } else {
- // Otherwise, use leftRightDelim to generate the correct sized
- // delimiter.
- leftDelim = delimiter.leftRightDelim(
- group.value.left, innerHeight, innerDepth, options,
- group.mode);
- }
- // Add it to the beginning of the expression
- inner.unshift(leftDelim);
-
- var rightDelim;
- // Same for the right delimiter
- if (group.value.right === ".") {
- rightDelim = makeNullDelimiter(options);
- } else {
- rightDelim = delimiter.leftRightDelim(
- group.value.right, innerHeight, innerDepth, options,
- group.mode);
- }
- // Add it to the end of the expression.
- inner.push(rightDelim);
-
- return makeSpan(
- ["minner", options.style.cls()], inner, options.getColor());
-};
-
-groupTypes.rule = function(group, options, prev) {
- // Make an empty span for the rule
- var rule = makeSpan(["mord", "rule"], [], options.getColor());
-
- // Calculate the shift, width, and height of the rule, and account for units
- var shift = 0;
- if (group.value.shift) {
- shift = group.value.shift.number;
- if (group.value.shift.unit === "ex") {
- shift *= fontMetrics.metrics.xHeight;
- }
- }
-
- var width = group.value.width.number;
- if (group.value.width.unit === "ex") {
- width *= fontMetrics.metrics.xHeight;
- }
-
- var height = group.value.height.number;
- if (group.value.height.unit === "ex") {
- height *= fontMetrics.metrics.xHeight;
- }
-
- // The sizes of rules are absolute, so make it larger if we are in a
- // smaller style.
- shift /= options.style.sizeMultiplier;
- width /= options.style.sizeMultiplier;
- height /= options.style.sizeMultiplier;
-
- // Style the rule to the right size
- rule.style.borderRightWidth = width + "em";
- rule.style.borderTopWidth = height + "em";
- rule.style.bottom = shift + "em";
-
- // Record the height and width
- rule.width = width;
- rule.height = height + shift;
- rule.depth = -shift;
-
- return rule;
-};
-
-groupTypes.accent = function(group, options, prev) {
- // Accents are handled in the TeXbook pg. 443, rule 12.
- var base = group.value.base;
-
- var supsubGroup;
- if (group.type === "supsub") {
- // If our base is a character box, and we have superscripts and
- // subscripts, the supsub will defer to us. In particular, we want
- // to attach the superscripts and subscripts to the inner body (so
- // that the position of the superscripts and subscripts won't be
- // affected by the height of the accent). We accomplish this by
- // sticking the base of the accent into the base of the supsub, and
- // rendering that, while keeping track of where the accent is.
-
- // The supsub group is the group that was passed in
- var supsub = group;
- // The real accent group is the base of the supsub group
- group = supsub.value.base;
- // The character box is the base of the accent group
- base = group.value.base;
- // Stick the character box into the base of the supsub group
- supsub.value.base = base;
-
- // Rerender the supsub group with its new base, and store that
- // result.
- supsubGroup = buildGroup(
- supsub, options.reset(), prev);
- }
-
- // Build the base group
- var body = buildGroup(
- base, options.withStyle(options.style.cramp()));
-
- // Calculate the skew of the accent. This is based on the line "If the
- // nucleus is not a single character, let s = 0; otherwise set s to the
- // kern amount for the nucleus followed by the \skewchar of its font."
- // Note that our skew metrics are just the kern between each character
- // and the skewchar.
- var skew;
- if (isCharacterBox(base)) {
- // If the base is a character box, then we want the skew of the
- // innermost character. To do that, we find the innermost character:
- var baseChar = getBaseElem(base);
- // Then, we render its group to get the symbol inside it
- var baseGroup = buildGroup(
- baseChar, options.withStyle(options.style.cramp()));
- // Finally, we pull the skew off of the symbol.
- skew = baseGroup.skew;
- // Note that we now throw away baseGroup, because the layers we
- // removed with getBaseElem might contain things like \color which
- // we can't get rid of.
- // TODO(emily): Find a better way to get the skew
- } else {
- skew = 0;
- }
-
- // calculate the amount of space between the body and the accent
- var clearance = Math.min(body.height, fontMetrics.metrics.xHeight);
-
- // Build the accent
- var accent = buildCommon.makeSymbol(
- group.value.accent, "Main-Regular", "math", options.getColor());
- // Remove the italic correction of the accent, because it only serves to
- // shift the accent over to a place we don't want.
- accent.italic = 0;
-
- // The \vec character that the fonts use is a combining character, and
- // thus shows up much too far to the left. To account for this, we add a
- // specific class which shifts the accent over to where we want it.
- // TODO(emily): Fix this in a better way, like by changing the font
- var vecClass = group.value.accent === "\\vec" ? "accent-vec" : null;
-
- var accentBody = makeSpan(["accent-body", vecClass], [
- makeSpan([], [accent])]);
-
- accentBody = buildCommon.makeVList([
- {type: "elem", elem: body},
- {type: "kern", size: -clearance},
- {type: "elem", elem: accentBody},
- ], "firstBaseline", null, options);
-
- // Shift the accent over by the skew. Note we shift by twice the skew
- // because we are centering the accent, so by adding 2*skew to the left,
- // we shift it to the right by 1*skew.
- accentBody.children[1].style.marginLeft = 2 * skew + "em";
-
- var accentWrap = makeSpan(["mord", "accent"], [accentBody]);
-
- if (supsubGroup) {
- // Here, we replace the "base" child of the supsub with our newly
- // generated accent.
- supsubGroup.children[0] = accentWrap;
-
- // Since we don't rerun the height calculation after replacing the
- // accent, we manually recalculate height.
- supsubGroup.height = Math.max(accentWrap.height, supsubGroup.height);
-
- // Accents should always be ords, even when their innards are not.
- supsubGroup.classes[0] = "mord";
-
- return supsubGroup;
- } else {
- return accentWrap;
- }
-};
-
-groupTypes.phantom = function(group, options, prev) {
- var elements = buildExpression(
- group.value.value,
- options.withPhantom(),
- prev
- );
-
- // \phantom isn't supposed to affect the elements it contains.
- // See "color" for more details.
- return new buildCommon.makeFragment(elements);
-};
-
-/**
- * buildGroup is the function that takes a group and calls the correct groupType
- * function for it. It also handles the interaction of size and style changes
- * between parents and children.
- */
-var buildGroup = function(group, options, prev) {
- if (!group) {
- return makeSpan();
- }
-
- if (groupTypes[group.type]) {
- // Call the groupTypes function
- var groupNode = groupTypes[group.type](group, options, prev);
- var multiplier;
-
- // If the style changed between the parent and the current group,
- // account for the size difference
- if (options.style !== options.parentStyle) {
- multiplier = options.style.sizeMultiplier /
- options.parentStyle.sizeMultiplier;
-
- groupNode.height *= multiplier;
- groupNode.depth *= multiplier;
- }
-
- // If the size changed between the parent and the current group, account
- // for that size difference.
- if (options.size !== options.parentSize) {
- multiplier = buildCommon.sizingMultiplier[options.size] /
- buildCommon.sizingMultiplier[options.parentSize];
-
- groupNode.height *= multiplier;
- groupNode.depth *= multiplier;
- }
-
- return groupNode;
- } else {
- throw new ParseError(
- "Got group of unknown type: '" + group.type + "'");
- }
-};
-
-/**
- * Take an entire parse tree, and build it into an appropriate set of HTML
- * nodes.
- */
-var buildHTML = function(tree, options) {
- // buildExpression is destructive, so we need to make a clone
- // of the incoming tree so that it isn't accidentally changed
- tree = JSON.parse(JSON.stringify(tree));
-
- // Build the expression contained in the tree
- var expression = buildExpression(tree, options);
- var body = makeSpan(["base", options.style.cls()], expression);
-
- // Add struts, which ensure that the top of the HTML element falls at the
- // height of the expression, and the bottom of the HTML element falls at the
- // depth of the expression.
- var topStrut = makeSpan(["strut"]);
- var bottomStrut = makeSpan(["strut", "bottom"]);
-
- topStrut.style.height = body.height + "em";
- bottomStrut.style.height = (body.height + body.depth) + "em";
- // We'd like to use `vertical-align: top` but in IE 9 this lowers the
- // baseline of the box to the bottom of this strut (instead staying in the
- // normal place) so we use an absolute value for vertical-align instead
- bottomStrut.style.verticalAlign = -body.depth + "em";
-
- // Wrap the struts and body together
- var htmlNode = makeSpan(["katex-html"], [topStrut, bottomStrut, body]);
-
- htmlNode.setAttribute("aria-hidden", "true");
-
- return htmlNode;
-};
-
-module.exports = buildHTML;
-
-},{"./ParseError":300,"./Style":303,"./buildCommon":304,"./delimiter":308,"./domTree":309,"./fontMetrics":311,"./utils":318}],306:[function(require,module,exports){
-/**
- * This file converts a parse tree into a cooresponding MathML tree. The main
- * entry point is the `buildMathML` function, which takes a parse tree from the
- * parser.
- */
-
-var buildCommon = require("./buildCommon");
-var fontMetrics = require("./fontMetrics");
-var mathMLTree = require("./mathMLTree");
-var ParseError = require("./ParseError");
-var symbols = require("./symbols");
-var utils = require("./utils");
-
-var makeSpan = buildCommon.makeSpan;
-var fontMap = buildCommon.fontMap;
-
-/**
- * Takes a symbol and converts it into a MathML text node after performing
- * optional replacement from symbols.js.
- */
-var makeText = function(text, mode) {
- if (symbols[mode][text] && symbols[mode][text].replace) {
- text = symbols[mode][text].replace;
- }
-
- return new mathMLTree.TextNode(text);
-};
-
-/**
- * Returns the math variant as a string or null if none is required.
- */
-var getVariant = function(group, options) {
- var font = options.font;
- if (!font) {
- return null;
- }
-
- var mode = group.mode;
- if (font === "mathit") {
- return "italic";
- }
-
- var value = group.value;
- if (utils.contains(["\\imath", "\\jmath"], value)) {
- return null;
- }
-
- if (symbols[mode][value] && symbols[mode][value].replace) {
- value = symbols[mode][value].replace;
- }
-
- var fontName = fontMap[font].fontName;
- if (fontMetrics.getCharacterMetrics(value, fontName)) {
- return fontMap[options.font].variant;
- }
-
- return null;
-};
-
-/**
- * Functions for handling the different types of groups found in the parse
- * tree. Each function should take a parse group and return a MathML node.
- */
-var groupTypes = {};
-
-groupTypes.mathord = function(group, options) {
- var node = new mathMLTree.MathNode(
- "mi",
- [makeText(group.value, group.mode)]);
-
- var variant = getVariant(group, options);
- if (variant) {
- node.setAttribute("mathvariant", variant);
- }
- return node;
-};
-
-groupTypes.textord = function(group, options) {
- var text = makeText(group.value, group.mode);
-
- var variant = getVariant(group, options) || "normal";
-
- var node;
- if (/[0-9]/.test(group.value)) {
- // TODO(kevinb) merge adjacent <mn> nodes
- // do it as a post processing step
- node = new mathMLTree.MathNode("mn", [text]);
- if (options.font) {
- node.setAttribute("mathvariant", variant);
- }
- } else {
- node = new mathMLTree.MathNode("mi", [text]);
- node.setAttribute("mathvariant", variant);
- }
-
- return node;
-};
-
-groupTypes.bin = function(group) {
- var node = new mathMLTree.MathNode(
- "mo", [makeText(group.value, group.mode)]);
-
- return node;
-};
-
-groupTypes.rel = function(group) {
- var node = new mathMLTree.MathNode(
- "mo", [makeText(group.value, group.mode)]);
-
- return node;
-};
-
-groupTypes.open = function(group) {
- var node = new mathMLTree.MathNode(
- "mo", [makeText(group.value, group.mode)]);
-
- return node;
-};
-
-groupTypes.close = function(group) {
- var node = new mathMLTree.MathNode(
- "mo", [makeText(group.value, group.mode)]);
-
- return node;
-};
-
-groupTypes.inner = function(group) {
- var node = new mathMLTree.MathNode(
- "mo", [makeText(group.value, group.mode)]);
-
- return node;
-};
-
-groupTypes.punct = function(group) {
- var node = new mathMLTree.MathNode(
- "mo", [makeText(group.value, group.mode)]);
-
- node.setAttribute("separator", "true");
-
- return node;
-};
-
-groupTypes.ordgroup = function(group, options) {
- var inner = buildExpression(group.value, options);
-
- var node = new mathMLTree.MathNode("mrow", inner);
-
- return node;
-};
-
-groupTypes.text = function(group, options) {
- var inner = buildExpression(group.value.body, options);
-
- var node = new mathMLTree.MathNode("mtext", inner);
-
- return node;
-};
-
-groupTypes.color = function(group, options) {
- var inner = buildExpression(group.value.value, options);
-
- var node = new mathMLTree.MathNode("mstyle", inner);
-
- node.setAttribute("mathcolor", group.value.color);
-
- return node;
-};
-
-groupTypes.supsub = function(group, options) {
- var children = [buildGroup(group.value.base, options)];
-
- if (group.value.sub) {
- children.push(buildGroup(group.value.sub, options));
- }
-
- if (group.value.sup) {
- children.push(buildGroup(group.value.sup, options));
- }
-
- var nodeType;
- if (!group.value.sub) {
- nodeType = "msup";
- } else if (!group.value.sup) {
- nodeType = "msub";
- } else {
- nodeType = "msubsup";
- }
-
- var node = new mathMLTree.MathNode(nodeType, children);
-
- return node;
-};
-
-groupTypes.genfrac = function(group, options) {
- var node = new mathMLTree.MathNode(
- "mfrac",
- [buildGroup(group.value.numer, options),
- buildGroup(group.value.denom, options)]);
-
- if (!group.value.hasBarLine) {
- node.setAttribute("linethickness", "0px");
- }
-
- if (group.value.leftDelim != null || group.value.rightDelim != null) {
- var withDelims = [];
-
- if (group.value.leftDelim != null) {
- var leftOp = new mathMLTree.MathNode(
- "mo", [new mathMLTree.TextNode(group.value.leftDelim)]);
-
- leftOp.setAttribute("fence", "true");
-
- withDelims.push(leftOp);
- }
-
- withDelims.push(node);
-
- if (group.value.rightDelim != null) {
- var rightOp = new mathMLTree.MathNode(
- "mo", [new mathMLTree.TextNode(group.value.rightDelim)]);
-
- rightOp.setAttribute("fence", "true");
-
- withDelims.push(rightOp);
- }
-
- var outerNode = new mathMLTree.MathNode("mrow", withDelims);
-
- return outerNode;
- }
-
- return node;
-};
-
-groupTypes.array = function(group, options) {
- return new mathMLTree.MathNode(
- "mtable", group.value.body.map(function(row) {
- return new mathMLTree.MathNode(
- "mtr", row.map(function(cell) {
- return new mathMLTree.MathNode(
- "mtd", [buildGroup(cell, options)]);
- }));
- }));
-};
-
-groupTypes.sqrt = function(group, options) {
- var node;
- if (group.value.index) {
- node = new mathMLTree.MathNode(
- "mroot", [
- buildGroup(group.value.body, options),
- buildGroup(group.value.index, options),
- ]);
- } else {
- node = new mathMLTree.MathNode(
- "msqrt", [buildGroup(group.value.body, options)]);
- }
-
- return node;
-};
-
-groupTypes.leftright = function(group, options) {
- var inner = buildExpression(group.value.body, options);
-
- if (group.value.left !== ".") {
- var leftNode = new mathMLTree.MathNode(
- "mo", [makeText(group.value.left, group.mode)]);
-
- leftNode.setAttribute("fence", "true");
-
- inner.unshift(leftNode);
- }
-
- if (group.value.right !== ".") {
- var rightNode = new mathMLTree.MathNode(
- "mo", [makeText(group.value.right, group.mode)]);
-
- rightNode.setAttribute("fence", "true");
-
- inner.push(rightNode);
- }
-
- var outerNode = new mathMLTree.MathNode("mrow", inner);
-
- return outerNode;
-};
-
-groupTypes.accent = function(group, options) {
- var accentNode = new mathMLTree.MathNode(
- "mo", [makeText(group.value.accent, group.mode)]);
-
- var node = new mathMLTree.MathNode(
- "mover",
- [buildGroup(group.value.base, options),
- accentNode]);
-
- node.setAttribute("accent", "true");
-
- return node;
-};
-
-groupTypes.spacing = function(group) {
- var node;
-
- if (group.value === "\\ " || group.value === "\\space" ||
- group.value === " " || group.value === "~") {
- node = new mathMLTree.MathNode(
- "mtext", [new mathMLTree.TextNode("\u00a0")]);
- } else {
- node = new mathMLTree.MathNode("mspace");
-
- node.setAttribute(
- "width", buildCommon.spacingFunctions[group.value].size);
- }
-
- return node;
-};
-
-groupTypes.op = function(group) {
- var node;
-
- // TODO(emily): handle big operators using the `largeop` attribute
-
- if (group.value.symbol) {
- // This is a symbol. Just add the symbol.
- node = new mathMLTree.MathNode(
- "mo", [makeText(group.value.body, group.mode)]);
- } else {
- // This is a text operator. Add all of the characters from the
- // operator's name.
- // TODO(emily): Add a space in the middle of some of these
- // operators, like \limsup.
- node = new mathMLTree.MathNode(
- "mi", [new mathMLTree.TextNode(group.value.body.slice(1))]);
- }
-
- return node;
-};
-
-groupTypes.katex = function(group) {
- var node = new mathMLTree.MathNode(
- "mtext", [new mathMLTree.TextNode("KaTeX")]);
-
- return node;
-};
-
-groupTypes.font = function(group, options) {
- var font = group.value.font;
- return buildGroup(group.value.body, options.withFont(font));
-};
-
-groupTypes.delimsizing = function(group) {
- var children = [];
-
- if (group.value.value !== ".") {
- children.push(makeText(group.value.value, group.mode));
- }
-
- var node = new mathMLTree.MathNode("mo", children);
-
- if (group.value.delimType === "open" ||
- group.value.delimType === "close") {
- // Only some of the delimsizing functions act as fences, and they
- // return "open" or "close" delimTypes.
- node.setAttribute("fence", "true");
- } else {
- // Explicitly disable fencing if it's not a fence, to override the
- // defaults.
- node.setAttribute("fence", "false");
- }
-
- return node;
-};
-
-groupTypes.styling = function(group, options) {
- var inner = buildExpression(group.value.value, options);
-
- var node = new mathMLTree.MathNode("mstyle", inner);
-
- var styleAttributes = {
- "display": ["0", "true"],
- "text": ["0", "false"],
- "script": ["1", "false"],
- "scriptscript": ["2", "false"],
- };
-
- var attr = styleAttributes[group.value.style];
-
- node.setAttribute("scriptlevel", attr[0]);
- node.setAttribute("displaystyle", attr[1]);
-
- return node;
-};
-
-groupTypes.sizing = function(group, options) {
- var inner = buildExpression(group.value.value, options);
-
- var node = new mathMLTree.MathNode("mstyle", inner);
-
- // TODO(emily): This doesn't produce the correct size for nested size
- // changes, because we don't keep state of what style we're currently
- // in, so we can't reset the size to normal before changing it. Now
- // that we're passing an options parameter we should be able to fix
- // this.
- node.setAttribute(
- "mathsize", buildCommon.sizingMultiplier[group.value.size] + "em");
-
- return node;
-};
-
-groupTypes.overline = function(group, options) {
- var operator = new mathMLTree.MathNode(
- "mo", [new mathMLTree.TextNode("\u203e")]);
- operator.setAttribute("stretchy", "true");
-
- var node = new mathMLTree.MathNode(
- "mover",
- [buildGroup(group.value.body, options),
- operator]);
- node.setAttribute("accent", "true");
-
- return node;
-};
-
-groupTypes.underline = function(group, options) {
- var operator = new mathMLTree.MathNode(
- "mo", [new mathMLTree.TextNode("\u203e")]);
- operator.setAttribute("stretchy", "true");
-
- var node = new mathMLTree.MathNode(
- "munder",
- [buildGroup(group.value.body, options),
- operator]);
- node.setAttribute("accentunder", "true");
-
- return node;
-};
-
-groupTypes.rule = function(group) {
- // TODO(emily): Figure out if there's an actual way to draw black boxes
- // in MathML.
- var node = new mathMLTree.MathNode("mrow");
-
- return node;
-};
-
-groupTypes.llap = function(group, options) {
- var node = new mathMLTree.MathNode(
- "mpadded", [buildGroup(group.value.body, options)]);
-
- node.setAttribute("lspace", "-1width");
- node.setAttribute("width", "0px");
-
- return node;
-};
-
-groupTypes.rlap = function(group, options) {
- var node = new mathMLTree.MathNode(
- "mpadded", [buildGroup(group.value.body, options)]);
-
- node.setAttribute("width", "0px");
-
- return node;
-};
-
-groupTypes.phantom = function(group, options, prev) {
- var inner = buildExpression(group.value.value, options);
- return new mathMLTree.MathNode("mphantom", inner);
-};
-
-/**
- * Takes a list of nodes, builds them, and returns a list of the generated
- * MathML nodes. A little simpler than the HTML version because we don't do any
- * previous-node handling.
- */
-var buildExpression = function(expression, options) {
- var groups = [];
- for (var i = 0; i < expression.length; i++) {
- var group = expression[i];
- groups.push(buildGroup(group, options));
- }
- return groups;
-};
-
-/**
- * Takes a group from the parser and calls the appropriate groupTypes function
- * on it to produce a MathML node.
- */
-var buildGroup = function(group, options) {
- if (!group) {
- return new mathMLTree.MathNode("mrow");
- }
-
- if (groupTypes[group.type]) {
- // Call the groupTypes function
- return groupTypes[group.type](group, options);
- } else {
- throw new ParseError(
- "Got group of unknown type: '" + group.type + "'");
- }
-};
-
-/**
- * Takes a full parse tree and settings and builds a MathML representation of
- * it. In particular, we put the elements from building the parse tree into a
- * <semantics> tag so we can also include that TeX source as an annotation.
- *
- * Note that we actually return a domTree element with a `<math>` inside it so
- * we can do appropriate styling.
- */
-var buildMathML = function(tree, texExpression, options) {
- var expression = buildExpression(tree, options);
-
- // Wrap up the expression in an mrow so it is presented in the semantics
- // tag correctly.
- var wrapper = new mathMLTree.MathNode("mrow", expression);
-
- // Build a TeX annotation of the source
- var annotation = new mathMLTree.MathNode(
- "annotation", [new mathMLTree.TextNode(texExpression)]);
-
- annotation.setAttribute("encoding", "application/x-tex");
-
- var semantics = new mathMLTree.MathNode(
- "semantics", [wrapper, annotation]);
-
- var math = new mathMLTree.MathNode("math", [semantics]);
-
- // You can't style <math> nodes, so we wrap the node in a span.
- return makeSpan(["katex-mathml"], [math]);
-};
-
-module.exports = buildMathML;
-
-},{"./ParseError":300,"./buildCommon":304,"./fontMetrics":311,"./mathMLTree":314,"./symbols":317,"./utils":318}],307:[function(require,module,exports){
-var buildHTML = require("./buildHTML");
-var buildMathML = require("./buildMathML");
-var buildCommon = require("./buildCommon");
-var Options = require("./Options");
-var Settings = require("./Settings");
-var Style = require("./Style");
-
-var makeSpan = buildCommon.makeSpan;
-
-var buildTree = function(tree, expression, settings) {
- settings = settings || new Settings({});
-
- var startStyle = Style.TEXT;
- if (settings.displayMode) {
- startStyle = Style.DISPLAY;
- }
-
- // Setup the default options
- var options = new Options({
- style: startStyle,
- size: "size5",
- });
-
- // `buildHTML` sometimes messes with the parse tree (like turning bins ->
- // ords), so we build the MathML version first.
- var mathMLNode = buildMathML(tree, expression, options);
- var htmlNode = buildHTML(tree, options);
-
- var katexNode = makeSpan(["katex"], [
- mathMLNode, htmlNode,
- ]);
-
- if (settings.displayMode) {
- return makeSpan(["katex-display"], [katexNode]);
- } else {
- return katexNode;
- }
-};
-
-module.exports = buildTree;
-
-},{"./Options":299,"./Settings":302,"./Style":303,"./buildCommon":304,"./buildHTML":305,"./buildMathML":306}],308:[function(require,module,exports){
-/**
- * This file deals with creating delimiters of various sizes. The TeXbook
- * discusses these routines on page 441-442, in the "Another subroutine sets box
- * x to a specified variable delimiter" paragraph.
- *
- * There are three main routines here. `makeSmallDelim` makes a delimiter in the
- * normal font, but in either text, script, or scriptscript style.
- * `makeLargeDelim` makes a delimiter in textstyle, but in one of the Size1,
- * Size2, Size3, or Size4 fonts. `makeStackedDelim` makes a delimiter out of
- * smaller pieces that are stacked on top of one another.
- *
- * The functions take a parameter `center`, which determines if the delimiter
- * should be centered around the axis.
- *
- * Then, there are three exposed functions. `sizedDelim` makes a delimiter in
- * one of the given sizes. This is used for things like `\bigl`.
- * `customSizedDelim` makes a delimiter with a given total height+depth. It is
- * called in places like `\sqrt`. `leftRightDelim` makes an appropriate
- * delimiter which surrounds an expression of a given height an depth. It is
- * used in `\left` and `\right`.
- */
-
-var ParseError = require("./ParseError");
-var Style = require("./Style");
-
-var buildCommon = require("./buildCommon");
-var fontMetrics = require("./fontMetrics");
-var symbols = require("./symbols");
-var utils = require("./utils");
-
-var makeSpan = buildCommon.makeSpan;
-
-/**
- * Get the metrics for a given symbol and font, after transformation (i.e.
- * after following replacement from symbols.js)
- */
-var getMetrics = function(symbol, font) {
- if (symbols.math[symbol] && symbols.math[symbol].replace) {
- return fontMetrics.getCharacterMetrics(
- symbols.math[symbol].replace, font);
- } else {
- return fontMetrics.getCharacterMetrics(
- symbol, font);
- }
-};
-
-/**
- * Builds a symbol in the given font size (note size is an integer)
- */
-var mathrmSize = function(value, size, mode) {
- return buildCommon.makeSymbol(value, "Size" + size + "-Regular", mode);
-};
-
-/**
- * Puts a delimiter span in a given style, and adds appropriate height, depth,
- * and maxFontSizes.
- */
-var styleWrap = function(delim, toStyle, options) {
- var span = makeSpan(
- ["style-wrap", options.style.reset(), toStyle.cls()], [delim]);
-
- var multiplier = toStyle.sizeMultiplier / options.style.sizeMultiplier;
-
- span.height *= multiplier;
- span.depth *= multiplier;
- span.maxFontSize = toStyle.sizeMultiplier;
-
- return span;
-};
-
-/**
- * Makes a small delimiter. This is a delimiter that comes in the Main-Regular
- * font, but is restyled to either be in textstyle, scriptstyle, or
- * scriptscriptstyle.
- */
-var makeSmallDelim = function(delim, style, center, options, mode) {
- var text = buildCommon.makeSymbol(delim, "Main-Regular", mode);
-
- var span = styleWrap(text, style, options);
-
- if (center) {
- var shift =
- (1 - options.style.sizeMultiplier / style.sizeMultiplier) *
- fontMetrics.metrics.axisHeight;
-
- span.style.top = shift + "em";
- span.height -= shift;
- span.depth += shift;
- }
-
- return span;
-};
-
-/**
- * Makes a large delimiter. This is a delimiter that comes in the Size1, Size2,
- * Size3, or Size4 fonts. It is always rendered in textstyle.
- */
-var makeLargeDelim = function(delim, size, center, options, mode) {
- var inner = mathrmSize(delim, size, mode);
-
- var span = styleWrap(
- makeSpan(["delimsizing", "size" + size],
- [inner], options.getColor()),
- Style.TEXT, options);
-
- if (center) {
- var shift = (1 - options.style.sizeMultiplier) *
- fontMetrics.metrics.axisHeight;
-
- span.style.top = shift + "em";
- span.height -= shift;
- span.depth += shift;
- }
-
- return span;
-};
-
-/**
- * Make an inner span with the given offset and in the given font. This is used
- * in `makeStackedDelim` to make the stacking pieces for the delimiter.
- */
-var makeInner = function(symbol, font, mode) {
- var sizeClass;
- // Apply the correct CSS class to choose the right font.
- if (font === "Size1-Regular") {
- sizeClass = "delim-size1";
- } else if (font === "Size4-Regular") {
- sizeClass = "delim-size4";
- }
-
- var inner = makeSpan(
- ["delimsizinginner", sizeClass],
- [makeSpan([], [buildCommon.makeSymbol(symbol, font, mode)])]);
-
- // Since this will be passed into `makeVList` in the end, wrap the element
- // in the appropriate tag that VList uses.
- return {type: "elem", elem: inner};
-};
-
-/**
- * Make a stacked delimiter out of a given delimiter, with the total height at
- * least `heightTotal`. This routine is mentioned on page 442 of the TeXbook.
- */
-var makeStackedDelim = function(delim, heightTotal, center, options, mode) {
- // There are four parts, the top, an optional middle, a repeated part, and a
- // bottom.
- var top;
- var middle;
- var repeat;
- var bottom;
- top = repeat = bottom = delim;
- middle = null;
- // Also keep track of what font the delimiters are in
- var font = "Size1-Regular";
-
- // We set the parts and font based on the symbol. Note that we use
- // '\u23d0' instead of '|' and '\u2016' instead of '\\|' for the
- // repeats of the arrows
- if (delim === "\\uparrow") {
- repeat = bottom = "\u23d0";
- } else if (delim === "\\Uparrow") {
- repeat = bottom = "\u2016";
- } else if (delim === "\\downarrow") {
- top = repeat = "\u23d0";
- } else if (delim === "\\Downarrow") {
- top = repeat = "\u2016";
- } else if (delim === "\\updownarrow") {
- top = "\\uparrow";
- repeat = "\u23d0";
- bottom = "\\downarrow";
- } else if (delim === "\\Updownarrow") {
- top = "\\Uparrow";
- repeat = "\u2016";
- bottom = "\\Downarrow";
- } else if (delim === "[" || delim === "\\lbrack") {
- top = "\u23a1";
- repeat = "\u23a2";
- bottom = "\u23a3";
- font = "Size4-Regular";
- } else if (delim === "]" || delim === "\\rbrack") {
- top = "\u23a4";
- repeat = "\u23a5";
- bottom = "\u23a6";
- font = "Size4-Regular";
- } else if (delim === "\\lfloor") {
- repeat = top = "\u23a2";
- bottom = "\u23a3";
- font = "Size4-Regular";
- } else if (delim === "\\lceil") {
- top = "\u23a1";
- repeat = bottom = "\u23a2";
- font = "Size4-Regular";
- } else if (delim === "\\rfloor") {
- repeat = top = "\u23a5";
- bottom = "\u23a6";
- font = "Size4-Regular";
- } else if (delim === "\\rceil") {
- top = "\u23a4";
- repeat = bottom = "\u23a5";
- font = "Size4-Regular";
- } else if (delim === "(") {
- top = "\u239b";
- repeat = "\u239c";
- bottom = "\u239d";
- font = "Size4-Regular";
- } else if (delim === ")") {
- top = "\u239e";
- repeat = "\u239f";
- bottom = "\u23a0";
- font = "Size4-Regular";
- } else if (delim === "\\{" || delim === "\\lbrace") {
- top = "\u23a7";
- middle = "\u23a8";
- bottom = "\u23a9";
- repeat = "\u23aa";
- font = "Size4-Regular";
- } else if (delim === "\\}" || delim === "\\rbrace") {
- top = "\u23ab";
- middle = "\u23ac";
- bottom = "\u23ad";
- repeat = "\u23aa";
- font = "Size4-Regular";
- } else if (delim === "\\lgroup") {
- top = "\u23a7";
- bottom = "\u23a9";
- repeat = "\u23aa";
- font = "Size4-Regular";
- } else if (delim === "\\rgroup") {
- top = "\u23ab";
- bottom = "\u23ad";
- repeat = "\u23aa";
- font = "Size4-Regular";
- } else if (delim === "\\lmoustache") {
- top = "\u23a7";
- bottom = "\u23ad";
- repeat = "\u23aa";
- font = "Size4-Regular";
- } else if (delim === "\\rmoustache") {
- top = "\u23ab";
- bottom = "\u23a9";
- repeat = "\u23aa";
- font = "Size4-Regular";
- } else if (delim === "\\surd") {
- top = "\ue001";
- bottom = "\u23b7";
- repeat = "\ue000";
- font = "Size4-Regular";
- }
-
- // Get the metrics of the four sections
- var topMetrics = getMetrics(top, font);
- var topHeightTotal = topMetrics.height + topMetrics.depth;
- var repeatMetrics = getMetrics(repeat, font);
- var repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth;
- var bottomMetrics = getMetrics(bottom, font);
- var bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth;
- var middleHeightTotal = 0;
- var middleFactor = 1;
- if (middle !== null) {
- var middleMetrics = getMetrics(middle, font);
- middleHeightTotal = middleMetrics.height + middleMetrics.depth;
- middleFactor = 2; // repeat symmetrically above and below middle
- }
-
- // Calcuate the minimal height that the delimiter can have.
- // It is at least the size of the top, bottom, and optional middle combined.
- var minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal;
-
- // Compute the number of copies of the repeat symbol we will need
- var repeatCount = Math.ceil(
- (heightTotal - minHeight) / (middleFactor * repeatHeightTotal));
-
- // Compute the total height of the delimiter including all the symbols
- var realHeightTotal =
- minHeight + repeatCount * middleFactor * repeatHeightTotal;
-
- // The center of the delimiter is placed at the center of the axis. Note
- // that in this context, "center" means that the delimiter should be
- // centered around the axis in the current style, while normally it is
- // centered around the axis in textstyle.
- var axisHeight = fontMetrics.metrics.axisHeight;
- if (center) {
- axisHeight *= options.style.sizeMultiplier;
- }
- // Calculate the depth
- var depth = realHeightTotal / 2 - axisHeight;
-
- // Now, we start building the pieces that will go into the vlist
-
- // Keep a list of the inner pieces
- var inners = [];
-
- // Add the bottom symbol
- inners.push(makeInner(bottom, font, mode));
-
- var i;
- if (middle === null) {
- // Add that many symbols
- for (i = 0; i < repeatCount; i++) {
- inners.push(makeInner(repeat, font, mode));
- }
- } else {
- // When there is a middle bit, we need the middle part and two repeated
- // sections
- for (i = 0; i < repeatCount; i++) {
- inners.push(makeInner(repeat, font, mode));
- }
- inners.push(makeInner(middle, font, mode));
- for (i = 0; i < repeatCount; i++) {
- inners.push(makeInner(repeat, font, mode));
- }
- }
-
- // Add the top symbol
- inners.push(makeInner(top, font, mode));
-
- // Finally, build the vlist
- var inner = buildCommon.makeVList(inners, "bottom", depth, options);
-
- return styleWrap(
- makeSpan(["delimsizing", "mult"], [inner], options.getColor()),
- Style.TEXT, options);
-};
-
-// There are three kinds of delimiters, delimiters that stack when they become
-// too large
-var stackLargeDelimiters = [
- "(", ")", "[", "\\lbrack", "]", "\\rbrack",
- "\\{", "\\lbrace", "\\}", "\\rbrace",
- "\\lfloor", "\\rfloor", "\\lceil", "\\rceil",
- "\\surd",
-];
-
-// delimiters that always stack
-var stackAlwaysDelimiters = [
- "\\uparrow", "\\downarrow", "\\updownarrow",
- "\\Uparrow", "\\Downarrow", "\\Updownarrow",
- "|", "\\|", "\\vert", "\\Vert",
- "\\lvert", "\\rvert", "\\lVert", "\\rVert",
- "\\lgroup", "\\rgroup", "\\lmoustache", "\\rmoustache",
-];
-
-// and delimiters that never stack
-var stackNeverDelimiters = [
- "<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt",
-];
-
-// Metrics of the different sizes. Found by looking at TeX's output of
-// $\bigl| // \Bigl| \biggl| \Biggl| \showlists$
-// Used to create stacked delimiters of appropriate sizes in makeSizedDelim.
-var sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3.0];
-
-/**
- * Used to create a delimiter of a specific size, where `size` is 1, 2, 3, or 4.
- */
-var makeSizedDelim = function(delim, size, options, mode) {
- // < and > turn into \langle and \rangle in delimiters
- if (delim === "<" || delim === "\\lt") {
- delim = "\\langle";
- } else if (delim === ">" || delim === "\\gt") {
- delim = "\\rangle";
- }
-
- // Sized delimiters are never centered.
- if (utils.contains(stackLargeDelimiters, delim) ||
- utils.contains(stackNeverDelimiters, delim)) {
- return makeLargeDelim(delim, size, false, options, mode);
- } else if (utils.contains(stackAlwaysDelimiters, delim)) {
- return makeStackedDelim(
- delim, sizeToMaxHeight[size], false, options, mode);
- } else {
- throw new ParseError("Illegal delimiter: '" + delim + "'");
- }
-};
-
-/**
- * There are three different sequences of delimiter sizes that the delimiters
- * follow depending on the kind of delimiter. This is used when creating custom
- * sized delimiters to decide whether to create a small, large, or stacked
- * delimiter.
- *
- * In real TeX, these sequences aren't explicitly defined, but are instead
- * defined inside the font metrics. Since there are only three sequences that
- * are possible for the delimiters that TeX defines, it is easier to just encode
- * them explicitly here.
- */
-
-// Delimiters that never stack try small delimiters and large delimiters only
-var stackNeverDelimiterSequence = [
- {type: "small", style: Style.SCRIPTSCRIPT},
- {type: "small", style: Style.SCRIPT},
- {type: "small", style: Style.TEXT},
- {type: "large", size: 1},
- {type: "large", size: 2},
- {type: "large", size: 3},
- {type: "large", size: 4},
-];
-
-// Delimiters that always stack try the small delimiters first, then stack
-var stackAlwaysDelimiterSequence = [
- {type: "small", style: Style.SCRIPTSCRIPT},
- {type: "small", style: Style.SCRIPT},
- {type: "small", style: Style.TEXT},
- {type: "stack"},
-];
-
-// Delimiters that stack when large try the small and then large delimiters, and
-// stack afterwards
-var stackLargeDelimiterSequence = [
- {type: "small", style: Style.SCRIPTSCRIPT},
- {type: "small", style: Style.SCRIPT},
- {type: "small", style: Style.TEXT},
- {type: "large", size: 1},
- {type: "large", size: 2},
- {type: "large", size: 3},
- {type: "large", size: 4},
- {type: "stack"},
-];
-
-/**
- * Get the font used in a delimiter based on what kind of delimiter it is.
- */
-var delimTypeToFont = function(type) {
- if (type.type === "small") {
- return "Main-Regular";
- } else if (type.type === "large") {
- return "Size" + type.size + "-Regular";
- } else if (type.type === "stack") {
- return "Size4-Regular";
- }
-};
-
-/**
- * Traverse a sequence of types of delimiters to decide what kind of delimiter
- * should be used to create a delimiter of the given height+depth.
- */
-var traverseSequence = function(delim, height, sequence, options) {
- // Here, we choose the index we should start at in the sequences. In smaller
- // sizes (which correspond to larger numbers in style.size) we start earlier
- // in the sequence. Thus, scriptscript starts at index 3-3=0, script starts
- // at index 3-2=1, text starts at 3-1=2, and display starts at min(2,3-0)=2
- var start = Math.min(2, 3 - options.style.size);
- for (var i = start; i < sequence.length; i++) {
- if (sequence[i].type === "stack") {
- // This is always the last delimiter, so we just break the loop now.
- break;
- }
-
- var metrics = getMetrics(delim, delimTypeToFont(sequence[i]));
- var heightDepth = metrics.height + metrics.depth;
-
- // Small delimiters are scaled down versions of the same font, so we
- // account for the style change size.
-
- if (sequence[i].type === "small") {
- heightDepth *= sequence[i].style.sizeMultiplier;
- }
-
- // Check if the delimiter at this size works for the given height.
- if (heightDepth > height) {
- return sequence[i];
- }
- }
-
- // If we reached the end of the sequence, return the last sequence element.
- return sequence[sequence.length - 1];
-};
-
-/**
- * Make a delimiter of a given height+depth, with optional centering. Here, we
- * traverse the sequences, and create a delimiter that the sequence tells us to.
- */
-var makeCustomSizedDelim = function(delim, height, center, options, mode) {
- if (delim === "<" || delim === "\\lt") {
- delim = "\\langle";
- } else if (delim === ">" || delim === "\\gt") {
- delim = "\\rangle";
- }
-
- // Decide what sequence to use
- var sequence;
- if (utils.contains(stackNeverDelimiters, delim)) {
- sequence = stackNeverDelimiterSequence;
- } else if (utils.contains(stackLargeDelimiters, delim)) {
- sequence = stackLargeDelimiterSequence;
- } else {
- sequence = stackAlwaysDelimiterSequence;
- }
-
- // Look through the sequence
- var delimType = traverseSequence(delim, height, sequence, options);
-
- // Depending on the sequence element we decided on, call the appropriate
- // function.
- if (delimType.type === "small") {
- return makeSmallDelim(delim, delimType.style, center, options, mode);
- } else if (delimType.type === "large") {
- return makeLargeDelim(delim, delimType.size, center, options, mode);
- } else if (delimType.type === "stack") {
- return makeStackedDelim(delim, height, center, options, mode);
- }
-};
-
-/**
- * Make a delimiter for use with `\left` and `\right`, given a height and depth
- * of an expression that the delimiters surround.
- */
-var makeLeftRightDelim = function(delim, height, depth, options, mode) {
- // We always center \left/\right delimiters, so the axis is always shifted
- var axisHeight =
- fontMetrics.metrics.axisHeight * options.style.sizeMultiplier;
-
- // Taken from TeX source, tex.web, function make_left_right
- var delimiterFactor = 901;
- var delimiterExtend = 5.0 / fontMetrics.metrics.ptPerEm;
-
- var maxDistFromAxis = Math.max(
- height - axisHeight, depth + axisHeight);
-
- var totalHeight = Math.max(
- // In real TeX, calculations are done using integral values which are
- // 65536 per pt, or 655360 per em. So, the division here truncates in
- // TeX but doesn't here, producing different results. If we wanted to
- // exactly match TeX's calculation, we could do
- // Math.floor(655360 * maxDistFromAxis / 500) *
- // delimiterFactor / 655360
- // (To see the difference, compare
- // x^{x^{\left(\rule{0.1em}{0.68em}\right)}}
- // in TeX and KaTeX)
- maxDistFromAxis / 500 * delimiterFactor,
- 2 * maxDistFromAxis - delimiterExtend);
-
- // Finally, we defer to `makeCustomSizedDelim` with our calculated total
- // height
- return makeCustomSizedDelim(delim, totalHeight, true, options, mode);
-};
-
-module.exports = {
- sizedDelim: makeSizedDelim,
- customSizedDelim: makeCustomSizedDelim,
- leftRightDelim: makeLeftRightDelim,
-};
-
-},{"./ParseError":300,"./Style":303,"./buildCommon":304,"./fontMetrics":311,"./symbols":317,"./utils":318}],309:[function(require,module,exports){
-/**
- * These objects store the data about the DOM nodes we create, as well as some
- * extra data. They can then be transformed into real DOM nodes with the
- * `toNode` function or HTML markup using `toMarkup`. They are useful for both
- * storing extra properties on the nodes, as well as providing a way to easily
- * work with the DOM.
- *
- * Similar functions for working with MathML nodes exist in mathMLTree.js.
- */
-
-var utils = require("./utils");
-
-/**
- * Create an HTML className based on a list of classes. In addition to joining
- * with spaces, we also remove null or empty classes.
- */
-var createClass = function(classes) {
- classes = classes.slice();
- for (var i = classes.length - 1; i >= 0; i--) {
- if (!classes[i]) {
- classes.splice(i, 1);
- }
- }
-
- return classes.join(" ");
-};
-
-/**
- * This node represents a span node, with a className, a list of children, and
- * an inline style. It also contains information about its height, depth, and
- * maxFontSize.
- */
-function span(classes, children, height, depth, maxFontSize, style) {
- this.classes = classes || [];
- this.children = children || [];
- this.height = height || 0;
- this.depth = depth || 0;
- this.maxFontSize = maxFontSize || 0;
- this.style = style || {};
- this.attributes = {};
-}
-
-/**
- * Sets an arbitrary attribute on the span. Warning: use this wisely. Not all
- * browsers support attributes the same, and having too many custom attributes
- * is probably bad.
- */
-span.prototype.setAttribute = function(attribute, value) {
- this.attributes[attribute] = value;
-};
-
-/**
- * Convert the span into an HTML node
- */
-span.prototype.toNode = function() {
- var span = document.createElement("span");
-
- // Apply the class
- span.className = createClass(this.classes);
-
- // Apply inline styles
- for (var style in this.style) {
- if (Object.prototype.hasOwnProperty.call(this.style, style)) {
- span.style[style] = this.style[style];
- }
- }
-
- // Apply attributes
- for (var attr in this.attributes) {
- if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
- span.setAttribute(attr, this.attributes[attr]);
- }
- }
-
- // Append the children, also as HTML nodes
- for (var i = 0; i < this.children.length; i++) {
- span.appendChild(this.children[i].toNode());
- }
-
- return span;
-};
-
-/**
- * Convert the span into an HTML markup string
- */
-span.prototype.toMarkup = function() {
- var markup = "<span";
-
- // Add the class
- if (this.classes.length) {
- markup += " class=\"";
- markup += utils.escape(createClass(this.classes));
- markup += "\"";
- }
-
- var styles = "";
-
- // Add the styles, after hyphenation
- for (var style in this.style) {
- if (this.style.hasOwnProperty(style)) {
- styles += utils.hyphenate(style) + ":" + this.style[style] + ";";
- }
- }
-
- if (styles) {
- markup += " style=\"" + utils.escape(styles) + "\"";
- }
-
- // Add the attributes
- for (var attr in this.attributes) {
- if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
- markup += " " + attr + "=\"";
- markup += utils.escape(this.attributes[attr]);
- markup += "\"";
- }
- }
-
- markup += ">";
-
- // Add the markup of the children, also as markup
- for (var i = 0; i < this.children.length; i++) {
- markup += this.children[i].toMarkup();
- }
-
- markup += "</span>";
-
- return markup;
-};
-
-/**
- * This node represents a document fragment, which contains elements, but when
- * placed into the DOM doesn't have any representation itself. Thus, it only
- * contains children and doesn't have any HTML properties. It also keeps track
- * of a height, depth, and maxFontSize.
- */
-function documentFragment(children, height, depth, maxFontSize) {
- this.children = children || [];
- this.height = height || 0;
- this.depth = depth || 0;
- this.maxFontSize = maxFontSize || 0;
-}
-
-/**
- * Convert the fragment into a node
- */
-documentFragment.prototype.toNode = function() {
- // Create a fragment
- var frag = document.createDocumentFragment();
-
- // Append the children
- for (var i = 0; i < this.children.length; i++) {
- frag.appendChild(this.children[i].toNode());
- }
-
- return frag;
-};
-
-/**
- * Convert the fragment into HTML markup
- */
-documentFragment.prototype.toMarkup = function() {
- var markup = "";
-
- // Simply concatenate the markup for the children together
- for (var i = 0; i < this.children.length; i++) {
- markup += this.children[i].toMarkup();
- }
-
- return markup;
-};
-
-/**
- * A symbol node contains information about a single symbol. It either renders
- * to a single text node, or a span with a single text node in it, depending on
- * whether it has CSS classes, styles, or needs italic correction.
- */
-function symbolNode(value, height, depth, italic, skew, classes, style) {
- this.value = value || "";
- this.height = height || 0;
- this.depth = depth || 0;
- this.italic = italic || 0;
- this.skew = skew || 0;
- this.classes = classes || [];
- this.style = style || {};
- this.maxFontSize = 0;
-}
-
-/**
- * Creates a text node or span from a symbol node. Note that a span is only
- * created if it is needed.
- */
-symbolNode.prototype.toNode = function() {
- var node = document.createTextNode(this.value);
- var span = null;
-
- if (this.italic > 0) {
- span = document.createElement("span");
- span.style.marginRight = this.italic + "em";
- }
-
- if (this.classes.length > 0) {
- span = span || document.createElement("span");
- span.className = createClass(this.classes);
- }
-
- for (var style in this.style) {
- if (this.style.hasOwnProperty(style)) {
- span = span || document.createElement("span");
- span.style[style] = this.style[style];
- }
- }
-
- if (span) {
- span.appendChild(node);
- return span;
- } else {
- return node;
- }
-};
-
-/**
- * Creates markup for a symbol node.
- */
-symbolNode.prototype.toMarkup = function() {
- // TODO(alpert): More duplication than I'd like from
- // span.prototype.toMarkup and symbolNode.prototype.toNode...
- var needsSpan = false;
-
- var markup = "<span";
-
- if (this.classes.length) {
- needsSpan = true;
- markup += " class=\"";
- markup += utils.escape(createClass(this.classes));
- markup += "\"";
- }
-
- var styles = "";
-
- if (this.italic > 0) {
- styles += "margin-right:" + this.italic + "em;";
- }
- for (var style in this.style) {
- if (this.style.hasOwnProperty(style)) {
- styles += utils.hyphenate(style) + ":" + this.style[style] + ";";
- }
- }
-
- if (styles) {
- needsSpan = true;
- markup += " style=\"" + utils.escape(styles) + "\"";
- }
-
- var escaped = utils.escape(this.value);
- if (needsSpan) {
- markup += ">";
- markup += escaped;
- markup += "</span>";
- return markup;
- } else {
- return escaped;
- }
-};
-
-module.exports = {
- span: span,
- documentFragment: documentFragment,
- symbolNode: symbolNode,
-};
-
-},{"./utils":318}],310:[function(require,module,exports){
-/* eslint no-constant-condition:0 */
-var fontMetrics = require("./fontMetrics");
-var parseData = require("./parseData");
-var ParseError = require("./ParseError");
-
-var ParseNode = parseData.ParseNode;
-
-/**
- * Parse the body of the environment, with rows delimited by \\ and
- * columns delimited by &, and create a nested list in row-major order
- * with one group per cell.
- */
-function parseArray(parser, result) {
- var row = [];
- var body = [row];
- var rowGaps = [];
- while (true) {
- var cell = parser.parseExpression(false, null);
- row.push(new ParseNode("ordgroup", cell, parser.mode));
- var next = parser.nextToken.text;
- if (next === "&") {
- parser.consume();
- } else if (next === "\\end") {
- break;
- } else if (next === "\\\\" || next === "\\cr") {
- var cr = parser.parseFunction();
- rowGaps.push(cr.value.size);
- row = [];
- body.push(row);
- } else {
- // TODO: Clean up the following hack once #385 got merged
- var pos = Math.min(parser.pos + 1, parser.lexer._input.length);
- throw new ParseError("Expected & or \\\\ or \\end",
- parser.lexer, pos);
- }
- }
- result.body = body;
- result.rowGaps = rowGaps;
- return new ParseNode(result.type, result, parser.mode);
-}
-
-/*
- * An environment definition is very similar to a function definition:
- * it is declared with a name or a list of names, a set of properties
- * and a handler containing the actual implementation.
- *
- * The properties include:
- * - numArgs: The number of arguments after the \begin{name} function.
- * - argTypes: (optional) Just like for a function
- * - allowedInText: (optional) Whether or not the environment is allowed inside
- * text mode (default false) (not enforced yet)
- * - numOptionalArgs: (optional) Just like for a function
- * A bare number instead of that object indicates the numArgs value.
- *
- * The handler function will receive two arguments
- * - context: information and references provided by the parser
- * - args: an array of arguments passed to \begin{name}
- * The context contains the following properties:
- * - envName: the name of the environment, one of the listed names.
- * - parser: the parser object
- * - lexer: the lexer object
- * - positions: the positions associated with these arguments from args.
- * The handler must return a ParseResult.
- */
-
-function defineEnvironment(names, props, handler) {
- if (typeof names === "string") {
- names = [names];
- }
- if (typeof props === "number") {
- props = { numArgs: props };
- }
- // Set default values of environments
- var data = {
- numArgs: props.numArgs || 0,
- argTypes: props.argTypes,
- greediness: 1,
- allowedInText: !!props.allowedInText,
- numOptionalArgs: props.numOptionalArgs || 0,
- handler: handler,
- };
- for (var i = 0; i < names.length; ++i) {
- module.exports[names[i]] = data;
- }
-}
-
-// Arrays are part of LaTeX, defined in lttab.dtx so its documentation
-// is part of the source2e.pdf file of LaTeX2e source documentation.
-defineEnvironment("array", {
- numArgs: 1,
-}, function(context, args) {
- var colalign = args[0];
- colalign = colalign.value.map ? colalign.value : [colalign];
- var cols = colalign.map(function(node) {
- var ca = node.value;
- if ("lcr".indexOf(ca) !== -1) {
- return {
- type: "align",
- align: ca,
- };
- } else if (ca === "|") {
- return {
- type: "separator",
- separator: "|",
- };
- }
- throw new ParseError(
- "Unknown column alignment: " + node.value,
- context.lexer, context.positions[1]);
- });
- var res = {
- type: "array",
- cols: cols,
- hskipBeforeAndAfter: true, // \@preamble in lttab.dtx
- };
- res = parseArray(context.parser, res);
- return res;
-});
-
-// The matrix environments of amsmath builds on the array environment
-// of LaTeX, which is discussed above.
-defineEnvironment([
- "matrix",
- "pmatrix",
- "bmatrix",
- "Bmatrix",
- "vmatrix",
- "Vmatrix",
-], {
-}, function(context) {
- var delimiters = {
- "matrix": null,
- "pmatrix": ["(", ")"],
- "bmatrix": ["[", "]"],
- "Bmatrix": ["\\{", "\\}"],
- "vmatrix": ["|", "|"],
- "Vmatrix": ["\\Vert", "\\Vert"],
- }[context.envName];
- var res = {
- type: "array",
- hskipBeforeAndAfter: false, // \hskip -\arraycolsep in amsmath
- };
- res = parseArray(context.parser, res);
- if (delimiters) {
- res = new ParseNode("leftright", {
- body: [res],
- left: delimiters[0],
- right: delimiters[1],
- }, context.mode);
- }
- return res;
-});
-
-// A cases environment (in amsmath.sty) is almost equivalent to
-// \def\arraystretch{1.2}%
-// \left\{\begin{array}{@{}l@{\quad}l@{}} … \end{array}\right.
-defineEnvironment("cases", {
-}, function(context) {
- var res = {
- type: "array",
- arraystretch: 1.2,
- cols: [{
- type: "align",
- align: "l",
- pregap: 0,
- postgap: fontMetrics.metrics.quad,
- }, {
- type: "align",
- align: "l",
- pregap: 0,
- postgap: 0,
- }],
- };
- res = parseArray(context.parser, res);
- res = new ParseNode("leftright", {
- body: [res],
- left: "\\{",
- right: ".",
- }, context.mode);
- return res;
-});
-
-// An aligned environment is like the align* environment
-// except it operates within math mode.
-// Note that we assume \nomallineskiplimit to be zero,
-// so that \strut@ is the same as \strut.
-defineEnvironment("aligned", {
-}, function(context) {
- var res = {
- type: "array",
- cols: [],
- };
- res = parseArray(context.parser, res);
- var emptyGroup = new ParseNode("ordgroup", [], context.mode);
- var numCols = 0;
- res.value.body.forEach(function(row) {
- var i;
- for (i = 1; i < row.length; i += 2) {
- row[i].value.unshift(emptyGroup);
- }
- if (numCols < row.length) {
- numCols = row.length;
- }
- });
- for (var i = 0; i < numCols; ++i) {
- var align = "r";
- var pregap = 0;
- if (i % 2 === 1) {
- align = "l";
- } else if (i > 0) {
- pregap = 2; // one \qquad between columns
- }
- res.value.cols[i] = {
- type: "align",
- align: align,
- pregap: pregap,
- postgap: 0,
- };
- }
- return res;
-});
-
-},{"./ParseError":300,"./fontMetrics":311,"./parseData":315}],311:[function(require,module,exports){
-/* eslint no-unused-vars:0 */
-
-var Style = require("./Style");
-
-/**
- * This file contains metrics regarding fonts and individual symbols. The sigma
- * and xi variables, as well as the metricMap map contain data extracted from
- * TeX, TeX font metrics, and the TTF files. These data are then exposed via the
- * `metrics` variable and the getCharacterMetrics function.
- */
-
-// These font metrics are extracted from TeX by using
-// \font\a=cmmi10
-// \showthe\fontdimenX\a
-// where X is the corresponding variable number. These correspond to the font
-// parameters of the symbol fonts. In TeX, there are actually three sets of
-// dimensions, one for each of textstyle, scriptstyle, and scriptscriptstyle,
-// but we only use the textstyle ones, and scale certain dimensions accordingly.
-// See the TeXbook, page 441.
-var sigma1 = 0.025;
-var sigma2 = 0;
-var sigma3 = 0;
-var sigma4 = 0;
-var sigma5 = 0.431;
-var sigma6 = 1;
-var sigma7 = 0;
-var sigma8 = 0.677;
-var sigma9 = 0.394;
-var sigma10 = 0.444;
-var sigma11 = 0.686;
-var sigma12 = 0.345;
-var sigma13 = 0.413;
-var sigma14 = 0.363;
-var sigma15 = 0.289;
-var sigma16 = 0.150;
-var sigma17 = 0.247;
-var sigma18 = 0.386;
-var sigma19 = 0.050;
-var sigma20 = 2.390;
-var sigma21 = 1.01;
-var sigma21Script = 0.81;
-var sigma21ScriptScript = 0.71;
-var sigma22 = 0.250;
-
-// These font metrics are extracted from TeX by using
-// \font\a=cmex10
-// \showthe\fontdimenX\a
-// where X is the corresponding variable number. These correspond to the font
-// parameters of the extension fonts (family 3). See the TeXbook, page 441.
-var xi1 = 0;
-var xi2 = 0;
-var xi3 = 0;
-var xi4 = 0;
-var xi5 = 0.431;
-var xi6 = 1;
-var xi7 = 0;
-var xi8 = 0.04;
-var xi9 = 0.111;
-var xi10 = 0.166;
-var xi11 = 0.2;
-var xi12 = 0.6;
-var xi13 = 0.1;
-
-// This value determines how large a pt is, for metrics which are defined in
-// terms of pts.
-// This value is also used in katex.less; if you change it make sure the values
-// match.
-var ptPerEm = 10.0;
-
-// The space between adjacent `|` columns in an array definition. From
-// `\showthe\doublerulesep` in LaTeX.
-var doubleRuleSep = 2.0 / ptPerEm;
-
-/**
- * This is just a mapping from common names to real metrics
- */
-var metrics = {
- xHeight: sigma5,
- quad: sigma6,
- num1: sigma8,
- num2: sigma9,
- num3: sigma10,
- denom1: sigma11,
- denom2: sigma12,
- sup1: sigma13,
- sup2: sigma14,
- sup3: sigma15,
- sub1: sigma16,
- sub2: sigma17,
- supDrop: sigma18,
- subDrop: sigma19,
- axisHeight: sigma22,
- defaultRuleThickness: xi8,
- bigOpSpacing1: xi9,
- bigOpSpacing2: xi10,
- bigOpSpacing3: xi11,
- bigOpSpacing4: xi12,
- bigOpSpacing5: xi13,
- ptPerEm: ptPerEm,
- emPerEx: sigma5 / sigma6,
- doubleRuleSep: doubleRuleSep,
-
- // TODO(alpert): Missing parallel structure here. We should probably add
- // style-specific metrics for all of these.
- delim1: sigma20,
- getDelim2: function(style) {
- if (style.size === Style.TEXT.size) {
- return sigma21;
- } else if (style.size === Style.SCRIPT.size) {
- return sigma21Script;
- } else if (style.size === Style.SCRIPTSCRIPT.size) {
- return sigma21ScriptScript;
- }
- throw new Error("Unexpected style size: " + style.size);
- },
-};
-
-// This map contains a mapping from font name and character code to character
-// metrics, including height, depth, italic correction, and skew (kern from the
-// character to the corresponding \skewchar)
-// This map is generated via `make metrics`. It should not be changed manually.
-var metricMap = require("./fontMetricsData");
-
-/**
- * This function is a convenience function for looking up information in the
- * metricMap table. It takes a character as a string, and a style.
- *
- * Note: the `width` property may be undefined if fontMetricsData.js wasn't
- * built using `Make extended_metrics`.
- */
-var getCharacterMetrics = function(character, style) {
- var metrics = metricMap[style][character.charCodeAt(0)];
- if (metrics) {
- return {
- depth: metrics[0],
- height: metrics[1],
- italic: metrics[2],
- skew: metrics[3],
- width: metrics[4],
- };
- }
-};
-
-module.exports = {
- metrics: metrics,
- getCharacterMetrics: getCharacterMetrics,
-};
-
-},{"./Style":303,"./fontMetricsData":312}],312:[function(require,module,exports){
-module.exports = {
- "AMS-Regular": {
- "65": [0, 0.68889, 0, 0],
- "66": [0, 0.68889, 0, 0],
- "67": [0, 0.68889, 0, 0],
- "68": [0, 0.68889, 0, 0],
- "69": [0, 0.68889, 0, 0],
- "70": [0, 0.68889, 0, 0],
- "71": [0, 0.68889, 0, 0],
- "72": [0, 0.68889, 0, 0],
- "73": [0, 0.68889, 0, 0],
- "74": [0.16667, 0.68889, 0, 0],
- "75": [0, 0.68889, 0, 0],
- "76": [0, 0.68889, 0, 0],
- "77": [0, 0.68889, 0, 0],
- "78": [0, 0.68889, 0, 0],
- "79": [0.16667, 0.68889, 0, 0],
- "80": [0, 0.68889, 0, 0],
- "81": [0.16667, 0.68889, 0, 0],
- "82": [0, 0.68889, 0, 0],
- "83": [0, 0.68889, 0, 0],
- "84": [0, 0.68889, 0, 0],
- "85": [0, 0.68889, 0, 0],
- "86": [0, 0.68889, 0, 0],
- "87": [0, 0.68889, 0, 0],
- "88": [0, 0.68889, 0, 0],
- "89": [0, 0.68889, 0, 0],
- "90": [0, 0.68889, 0, 0],
- "107": [0, 0.68889, 0, 0],
- "165": [0, 0.675, 0.025, 0],
- "174": [0.15559, 0.69224, 0, 0],
- "240": [0, 0.68889, 0, 0],
- "295": [0, 0.68889, 0, 0],
- "710": [0, 0.825, 0, 0],
- "732": [0, 0.9, 0, 0],
- "770": [0, 0.825, 0, 0],
- "771": [0, 0.9, 0, 0],
- "989": [0.08167, 0.58167, 0, 0],
- "1008": [0, 0.43056, 0.04028, 0],
- "8245": [0, 0.54986, 0, 0],
- "8463": [0, 0.68889, 0, 0],
- "8487": [0, 0.68889, 0, 0],
- "8498": [0, 0.68889, 0, 0],
- "8502": [0, 0.68889, 0, 0],
- "8503": [0, 0.68889, 0, 0],
- "8504": [0, 0.68889, 0, 0],
- "8513": [0, 0.68889, 0, 0],
- "8592": [-0.03598, 0.46402, 0, 0],
- "8594": [-0.03598, 0.46402, 0, 0],
- "8602": [-0.13313, 0.36687, 0, 0],
- "8603": [-0.13313, 0.36687, 0, 0],
- "8606": [0.01354, 0.52239, 0, 0],
- "8608": [0.01354, 0.52239, 0, 0],
- "8610": [0.01354, 0.52239, 0, 0],
- "8611": [0.01354, 0.52239, 0, 0],
- "8619": [0, 0.54986, 0, 0],
- "8620": [0, 0.54986, 0, 0],
- "8621": [-0.13313, 0.37788, 0, 0],
- "8622": [-0.13313, 0.36687, 0, 0],
- "8624": [0, 0.69224, 0, 0],
- "8625": [0, 0.69224, 0, 0],
- "8630": [0, 0.43056, 0, 0],
- "8631": [0, 0.43056, 0, 0],
- "8634": [0.08198, 0.58198, 0, 0],
- "8635": [0.08198, 0.58198, 0, 0],
- "8638": [0.19444, 0.69224, 0, 0],
- "8639": [0.19444, 0.69224, 0, 0],
- "8642": [0.19444, 0.69224, 0, 0],
- "8643": [0.19444, 0.69224, 0, 0],
- "8644": [0.1808, 0.675, 0, 0],
- "8646": [0.1808, 0.675, 0, 0],
- "8647": [0.1808, 0.675, 0, 0],
- "8648": [0.19444, 0.69224, 0, 0],
- "8649": [0.1808, 0.675, 0, 0],
- "8650": [0.19444, 0.69224, 0, 0],
- "8651": [0.01354, 0.52239, 0, 0],
- "8652": [0.01354, 0.52239, 0, 0],
- "8653": [-0.13313, 0.36687, 0, 0],
- "8654": [-0.13313, 0.36687, 0, 0],
- "8655": [-0.13313, 0.36687, 0, 0],
- "8666": [0.13667, 0.63667, 0, 0],
- "8667": [0.13667, 0.63667, 0, 0],
- "8669": [-0.13313, 0.37788, 0, 0],
- "8672": [-0.064, 0.437, 0, 0],
- "8674": [-0.064, 0.437, 0, 0],
- "8705": [0, 0.825, 0, 0],
- "8708": [0, 0.68889, 0, 0],
- "8709": [0.08167, 0.58167, 0, 0],
- "8717": [0, 0.43056, 0, 0],
- "8722": [-0.03598, 0.46402, 0, 0],
- "8724": [0.08198, 0.69224, 0, 0],
- "8726": [0.08167, 0.58167, 0, 0],
- "8733": [0, 0.69224, 0, 0],
- "8736": [0, 0.69224, 0, 0],
- "8737": [0, 0.69224, 0, 0],
- "8738": [0.03517, 0.52239, 0, 0],
- "8739": [0.08167, 0.58167, 0, 0],
- "8740": [0.25142, 0.74111, 0, 0],
- "8741": [0.08167, 0.58167, 0, 0],
- "8742": [0.25142, 0.74111, 0, 0],
- "8756": [0, 0.69224, 0, 0],
- "8757": [0, 0.69224, 0, 0],
- "8764": [-0.13313, 0.36687, 0, 0],
- "8765": [-0.13313, 0.37788, 0, 0],
- "8769": [-0.13313, 0.36687, 0, 0],
- "8770": [-0.03625, 0.46375, 0, 0],
- "8774": [0.30274, 0.79383, 0, 0],
- "8776": [-0.01688, 0.48312, 0, 0],
- "8778": [0.08167, 0.58167, 0, 0],
- "8782": [0.06062, 0.54986, 0, 0],
- "8783": [0.06062, 0.54986, 0, 0],
- "8785": [0.08198, 0.58198, 0, 0],
- "8786": [0.08198, 0.58198, 0, 0],
- "8787": [0.08198, 0.58198, 0, 0],
- "8790": [0, 0.69224, 0, 0],
- "8791": [0.22958, 0.72958, 0, 0],
- "8796": [0.08198, 0.91667, 0, 0],
- "8806": [0.25583, 0.75583, 0, 0],
- "8807": [0.25583, 0.75583, 0, 0],
- "8808": [0.25142, 0.75726, 0, 0],
- "8809": [0.25142, 0.75726, 0, 0],
- "8812": [0.25583, 0.75583, 0, 0],
- "8814": [0.20576, 0.70576, 0, 0],
- "8815": [0.20576, 0.70576, 0, 0],
- "8816": [0.30274, 0.79383, 0, 0],
- "8817": [0.30274, 0.79383, 0, 0],
- "8818": [0.22958, 0.72958, 0, 0],
- "8819": [0.22958, 0.72958, 0, 0],
- "8822": [0.1808, 0.675, 0, 0],
- "8823": [0.1808, 0.675, 0, 0],
- "8828": [0.13667, 0.63667, 0, 0],
- "8829": [0.13667, 0.63667, 0, 0],
- "8830": [0.22958, 0.72958, 0, 0],
- "8831": [0.22958, 0.72958, 0, 0],
- "8832": [0.20576, 0.70576, 0, 0],
- "8833": [0.20576, 0.70576, 0, 0],
- "8840": [0.30274, 0.79383, 0, 0],
- "8841": [0.30274, 0.79383, 0, 0],
- "8842": [0.13597, 0.63597, 0, 0],
- "8843": [0.13597, 0.63597, 0, 0],
- "8847": [0.03517, 0.54986, 0, 0],
- "8848": [0.03517, 0.54986, 0, 0],
- "8858": [0.08198, 0.58198, 0, 0],
- "8859": [0.08198, 0.58198, 0, 0],
- "8861": [0.08198, 0.58198, 0, 0],
- "8862": [0, 0.675, 0, 0],
- "8863": [0, 0.675, 0, 0],
- "8864": [0, 0.675, 0, 0],
- "8865": [0, 0.675, 0, 0],
- "8872": [0, 0.69224, 0, 0],
- "8873": [0, 0.69224, 0, 0],
- "8874": [0, 0.69224, 0, 0],
- "8876": [0, 0.68889, 0, 0],
- "8877": [0, 0.68889, 0, 0],
- "8878": [0, 0.68889, 0, 0],
- "8879": [0, 0.68889, 0, 0],
- "8882": [0.03517, 0.54986, 0, 0],
- "8883": [0.03517, 0.54986, 0, 0],
- "8884": [0.13667, 0.63667, 0, 0],
- "8885": [0.13667, 0.63667, 0, 0],
- "8888": [0, 0.54986, 0, 0],
- "8890": [0.19444, 0.43056, 0, 0],
- "8891": [0.19444, 0.69224, 0, 0],
- "8892": [0.19444, 0.69224, 0, 0],
- "8901": [0, 0.54986, 0, 0],
- "8903": [0.08167, 0.58167, 0, 0],
- "8905": [0.08167, 0.58167, 0, 0],
- "8906": [0.08167, 0.58167, 0, 0],
- "8907": [0, 0.69224, 0, 0],
- "8908": [0, 0.69224, 0, 0],
- "8909": [-0.03598, 0.46402, 0, 0],
- "8910": [0, 0.54986, 0, 0],
- "8911": [0, 0.54986, 0, 0],
- "8912": [0.03517, 0.54986, 0, 0],
- "8913": [0.03517, 0.54986, 0, 0],
- "8914": [0, 0.54986, 0, 0],
- "8915": [0, 0.54986, 0, 0],
- "8916": [0, 0.69224, 0, 0],
- "8918": [0.0391, 0.5391, 0, 0],
- "8919": [0.0391, 0.5391, 0, 0],
- "8920": [0.03517, 0.54986, 0, 0],
- "8921": [0.03517, 0.54986, 0, 0],
- "8922": [0.38569, 0.88569, 0, 0],
- "8923": [0.38569, 0.88569, 0, 0],
- "8926": [0.13667, 0.63667, 0, 0],
- "8927": [0.13667, 0.63667, 0, 0],
- "8928": [0.30274, 0.79383, 0, 0],
- "8929": [0.30274, 0.79383, 0, 0],
- "8934": [0.23222, 0.74111, 0, 0],
- "8935": [0.23222, 0.74111, 0, 0],
- "8936": [0.23222, 0.74111, 0, 0],
- "8937": [0.23222, 0.74111, 0, 0],
- "8938": [0.20576, 0.70576, 0, 0],
- "8939": [0.20576, 0.70576, 0, 0],
- "8940": [0.30274, 0.79383, 0, 0],
- "8941": [0.30274, 0.79383, 0, 0],
- "8994": [0.19444, 0.69224, 0, 0],
- "8995": [0.19444, 0.69224, 0, 0],
- "9416": [0.15559, 0.69224, 0, 0],
- "9484": [0, 0.69224, 0, 0],
- "9488": [0, 0.69224, 0, 0],
- "9492": [0, 0.37788, 0, 0],
- "9496": [0, 0.37788, 0, 0],
- "9585": [0.19444, 0.68889, 0, 0],
- "9586": [0.19444, 0.74111, 0, 0],
- "9632": [0, 0.675, 0, 0],
- "9633": [0, 0.675, 0, 0],
- "9650": [0, 0.54986, 0, 0],
- "9651": [0, 0.54986, 0, 0],
- "9654": [0.03517, 0.54986, 0, 0],
- "9660": [0, 0.54986, 0, 0],
- "9661": [0, 0.54986, 0, 0],
- "9664": [0.03517, 0.54986, 0, 0],
- "9674": [0.11111, 0.69224, 0, 0],
- "9733": [0.19444, 0.69224, 0, 0],
- "10003": [0, 0.69224, 0, 0],
- "10016": [0, 0.69224, 0, 0],
- "10731": [0.11111, 0.69224, 0, 0],
- "10846": [0.19444, 0.75583, 0, 0],
- "10877": [0.13667, 0.63667, 0, 0],
- "10878": [0.13667, 0.63667, 0, 0],
- "10885": [0.25583, 0.75583, 0, 0],
- "10886": [0.25583, 0.75583, 0, 0],
- "10887": [0.13597, 0.63597, 0, 0],
- "10888": [0.13597, 0.63597, 0, 0],
- "10889": [0.26167, 0.75726, 0, 0],
- "10890": [0.26167, 0.75726, 0, 0],
- "10891": [0.48256, 0.98256, 0, 0],
- "10892": [0.48256, 0.98256, 0, 0],
- "10901": [0.13667, 0.63667, 0, 0],
- "10902": [0.13667, 0.63667, 0, 0],
- "10933": [0.25142, 0.75726, 0, 0],
- "10934": [0.25142, 0.75726, 0, 0],
- "10935": [0.26167, 0.75726, 0, 0],
- "10936": [0.26167, 0.75726, 0, 0],
- "10937": [0.26167, 0.75726, 0, 0],
- "10938": [0.26167, 0.75726, 0, 0],
- "10949": [0.25583, 0.75583, 0, 0],
- "10950": [0.25583, 0.75583, 0, 0],
- "10955": [0.28481, 0.79383, 0, 0],
- "10956": [0.28481, 0.79383, 0, 0],
- "57350": [0.08167, 0.58167, 0, 0],
- "57351": [0.08167, 0.58167, 0, 0],
- "57352": [0.08167, 0.58167, 0, 0],
- "57353": [0, 0.43056, 0.04028, 0],
- "57356": [0.25142, 0.75726, 0, 0],
- "57357": [0.25142, 0.75726, 0, 0],
- "57358": [0.41951, 0.91951, 0, 0],
- "57359": [0.30274, 0.79383, 0, 0],
- "57360": [0.30274, 0.79383, 0, 0],
- "57361": [0.41951, 0.91951, 0, 0],
- "57366": [0.25142, 0.75726, 0, 0],
- "57367": [0.25142, 0.75726, 0, 0],
- "57368": [0.25142, 0.75726, 0, 0],
- "57369": [0.25142, 0.75726, 0, 0],
- "57370": [0.13597, 0.63597, 0, 0],
- "57371": [0.13597, 0.63597, 0, 0],
- },
- "Caligraphic-Regular": {
- "48": [0, 0.43056, 0, 0],
- "49": [0, 0.43056, 0, 0],
- "50": [0, 0.43056, 0, 0],
- "51": [0.19444, 0.43056, 0, 0],
- "52": [0.19444, 0.43056, 0, 0],
- "53": [0.19444, 0.43056, 0, 0],
- "54": [0, 0.64444, 0, 0],
- "55": [0.19444, 0.43056, 0, 0],
- "56": [0, 0.64444, 0, 0],
- "57": [0.19444, 0.43056, 0, 0],
- "65": [0, 0.68333, 0, 0.19445],
- "66": [0, 0.68333, 0.03041, 0.13889],
- "67": [0, 0.68333, 0.05834, 0.13889],
- "68": [0, 0.68333, 0.02778, 0.08334],
- "69": [0, 0.68333, 0.08944, 0.11111],
- "70": [0, 0.68333, 0.09931, 0.11111],
- "71": [0.09722, 0.68333, 0.0593, 0.11111],
- "72": [0, 0.68333, 0.00965, 0.11111],
- "73": [0, 0.68333, 0.07382, 0],
- "74": [0.09722, 0.68333, 0.18472, 0.16667],
- "75": [0, 0.68333, 0.01445, 0.05556],
- "76": [0, 0.68333, 0, 0.13889],
- "77": [0, 0.68333, 0, 0.13889],
- "78": [0, 0.68333, 0.14736, 0.08334],
- "79": [0, 0.68333, 0.02778, 0.11111],
- "80": [0, 0.68333, 0.08222, 0.08334],
- "81": [0.09722, 0.68333, 0, 0.11111],
- "82": [0, 0.68333, 0, 0.08334],
- "83": [0, 0.68333, 0.075, 0.13889],
- "84": [0, 0.68333, 0.25417, 0],
- "85": [0, 0.68333, 0.09931, 0.08334],
- "86": [0, 0.68333, 0.08222, 0],
- "87": [0, 0.68333, 0.08222, 0.08334],
- "88": [0, 0.68333, 0.14643, 0.13889],
- "89": [0.09722, 0.68333, 0.08222, 0.08334],
- "90": [0, 0.68333, 0.07944, 0.13889],
- },
- "Fraktur-Regular": {
- "33": [0, 0.69141, 0, 0],
- "34": [0, 0.69141, 0, 0],
- "38": [0, 0.69141, 0, 0],
- "39": [0, 0.69141, 0, 0],
- "40": [0.24982, 0.74947, 0, 0],
- "41": [0.24982, 0.74947, 0, 0],
- "42": [0, 0.62119, 0, 0],
- "43": [0.08319, 0.58283, 0, 0],
- "44": [0, 0.10803, 0, 0],
- "45": [0.08319, 0.58283, 0, 0],
- "46": [0, 0.10803, 0, 0],
- "47": [0.24982, 0.74947, 0, 0],
- "48": [0, 0.47534, 0, 0],
- "49": [0, 0.47534, 0, 0],
- "50": [0, 0.47534, 0, 0],
- "51": [0.18906, 0.47534, 0, 0],
- "52": [0.18906, 0.47534, 0, 0],
- "53": [0.18906, 0.47534, 0, 0],
- "54": [0, 0.69141, 0, 0],
- "55": [0.18906, 0.47534, 0, 0],
- "56": [0, 0.69141, 0, 0],
- "57": [0.18906, 0.47534, 0, 0],
- "58": [0, 0.47534, 0, 0],
- "59": [0.12604, 0.47534, 0, 0],
- "61": [-0.13099, 0.36866, 0, 0],
- "63": [0, 0.69141, 0, 0],
- "65": [0, 0.69141, 0, 0],
- "66": [0, 0.69141, 0, 0],
- "67": [0, 0.69141, 0, 0],
- "68": [0, 0.69141, 0, 0],
- "69": [0, 0.69141, 0, 0],
- "70": [0.12604, 0.69141, 0, 0],
- "71": [0, 0.69141, 0, 0],
- "72": [0.06302, 0.69141, 0, 0],
- "73": [0, 0.69141, 0, 0],
- "74": [0.12604, 0.69141, 0, 0],
- "75": [0, 0.69141, 0, 0],
- "76": [0, 0.69141, 0, 0],
- "77": [0, 0.69141, 0, 0],
- "78": [0, 0.69141, 0, 0],
- "79": [0, 0.69141, 0, 0],
- "80": [0.18906, 0.69141, 0, 0],
- "81": [0.03781, 0.69141, 0, 0],
- "82": [0, 0.69141, 0, 0],
- "83": [0, 0.69141, 0, 0],
- "84": [0, 0.69141, 0, 0],
- "85": [0, 0.69141, 0, 0],
- "86": [0, 0.69141, 0, 0],
- "87": [0, 0.69141, 0, 0],
- "88": [0, 0.69141, 0, 0],
- "89": [0.18906, 0.69141, 0, 0],
- "90": [0.12604, 0.69141, 0, 0],
- "91": [0.24982, 0.74947, 0, 0],
- "93": [0.24982, 0.74947, 0, 0],
- "94": [0, 0.69141, 0, 0],
- "97": [0, 0.47534, 0, 0],
- "98": [0, 0.69141, 0, 0],
- "99": [0, 0.47534, 0, 0],
- "100": [0, 0.62119, 0, 0],
- "101": [0, 0.47534, 0, 0],
- "102": [0.18906, 0.69141, 0, 0],
- "103": [0.18906, 0.47534, 0, 0],
- "104": [0.18906, 0.69141, 0, 0],
- "105": [0, 0.69141, 0, 0],
- "106": [0, 0.69141, 0, 0],
- "107": [0, 0.69141, 0, 0],
- "108": [0, 0.69141, 0, 0],
- "109": [0, 0.47534, 0, 0],
- "110": [0, 0.47534, 0, 0],
- "111": [0, 0.47534, 0, 0],
- "112": [0.18906, 0.52396, 0, 0],
- "113": [0.18906, 0.47534, 0, 0],
- "114": [0, 0.47534, 0, 0],
- "115": [0, 0.47534, 0, 0],
- "116": [0, 0.62119, 0, 0],
- "117": [0, 0.47534, 0, 0],
- "118": [0, 0.52396, 0, 0],
- "119": [0, 0.52396, 0, 0],
- "120": [0.18906, 0.47534, 0, 0],
- "121": [0.18906, 0.47534, 0, 0],
- "122": [0.18906, 0.47534, 0, 0],
- "8216": [0, 0.69141, 0, 0],
- "8217": [0, 0.69141, 0, 0],
- "58112": [0, 0.62119, 0, 0],
- "58113": [0, 0.62119, 0, 0],
- "58114": [0.18906, 0.69141, 0, 0],
- "58115": [0.18906, 0.69141, 0, 0],
- "58116": [0.18906, 0.47534, 0, 0],
- "58117": [0, 0.69141, 0, 0],
- "58118": [0, 0.62119, 0, 0],
- "58119": [0, 0.47534, 0, 0],
- },
- "Main-Bold": {
- "33": [0, 0.69444, 0, 0],
- "34": [0, 0.69444, 0, 0],
- "35": [0.19444, 0.69444, 0, 0],
- "36": [0.05556, 0.75, 0, 0],
- "37": [0.05556, 0.75, 0, 0],
- "38": [0, 0.69444, 0, 0],
- "39": [0, 0.69444, 0, 0],
- "40": [0.25, 0.75, 0, 0],
- "41": [0.25, 0.75, 0, 0],
- "42": [0, 0.75, 0, 0],
- "43": [0.13333, 0.63333, 0, 0],
- "44": [0.19444, 0.15556, 0, 0],
- "45": [0, 0.44444, 0, 0],
- "46": [0, 0.15556, 0, 0],
- "47": [0.25, 0.75, 0, 0],
- "48": [0, 0.64444, 0, 0],
- "49": [0, 0.64444, 0, 0],
- "50": [0, 0.64444, 0, 0],
- "51": [0, 0.64444, 0, 0],
- "52": [0, 0.64444, 0, 0],
- "53": [0, 0.64444, 0, 0],
- "54": [0, 0.64444, 0, 0],
- "55": [0, 0.64444, 0, 0],
- "56": [0, 0.64444, 0, 0],
- "57": [0, 0.64444, 0, 0],
- "58": [0, 0.44444, 0, 0],
- "59": [0.19444, 0.44444, 0, 0],
- "60": [0.08556, 0.58556, 0, 0],
- "61": [-0.10889, 0.39111, 0, 0],
- "62": [0.08556, 0.58556, 0, 0],
- "63": [0, 0.69444, 0, 0],
- "64": [0, 0.69444, 0, 0],
- "65": [0, 0.68611, 0, 0],
- "66": [0, 0.68611, 0, 0],
- "67": [0, 0.68611, 0, 0],
- "68": [0, 0.68611, 0, 0],
- "69": [0, 0.68611, 0, 0],
- "70": [0, 0.68611, 0, 0],
- "71": [0, 0.68611, 0, 0],
- "72": [0, 0.68611, 0, 0],
- "73": [0, 0.68611, 0, 0],
- "74": [0, 0.68611, 0, 0],
- "75": [0, 0.68611, 0, 0],
- "76": [0, 0.68611, 0, 0],
- "77": [0, 0.68611, 0, 0],
- "78": [0, 0.68611, 0, 0],
- "79": [0, 0.68611, 0, 0],
- "80": [0, 0.68611, 0, 0],
- "81": [0.19444, 0.68611, 0, 0],
- "82": [0, 0.68611, 0, 0],
- "83": [0, 0.68611, 0, 0],
- "84": [0, 0.68611, 0, 0],
- "85": [0, 0.68611, 0, 0],
- "86": [0, 0.68611, 0.01597, 0],
- "87": [0, 0.68611, 0.01597, 0],
- "88": [0, 0.68611, 0, 0],
- "89": [0, 0.68611, 0.02875, 0],
- "90": [0, 0.68611, 0, 0],
- "91": [0.25, 0.75, 0, 0],
- "92": [0.25, 0.75, 0, 0],
- "93": [0.25, 0.75, 0, 0],
- "94": [0, 0.69444, 0, 0],
- "95": [0.31, 0.13444, 0.03194, 0],
- "96": [0, 0.69444, 0, 0],
- "97": [0, 0.44444, 0, 0],
- "98": [0, 0.69444, 0, 0],
- "99": [0, 0.44444, 0, 0],
- "100": [0, 0.69444, 0, 0],
- "101": [0, 0.44444, 0, 0],
- "102": [0, 0.69444, 0.10903, 0],
- "103": [0.19444, 0.44444, 0.01597, 0],
- "104": [0, 0.69444, 0, 0],
- "105": [0, 0.69444, 0, 0],
- "106": [0.19444, 0.69444, 0, 0],
- "107": [0, 0.69444, 0, 0],
- "108": [0, 0.69444, 0, 0],
- "109": [0, 0.44444, 0, 0],
- "110": [0, 0.44444, 0, 0],
- "111": [0, 0.44444, 0, 0],
- "112": [0.19444, 0.44444, 0, 0],
- "113": [0.19444, 0.44444, 0, 0],
- "114": [0, 0.44444, 0, 0],
- "115": [0, 0.44444, 0, 0],
- "116": [0, 0.63492, 0, 0],
- "117": [0, 0.44444, 0, 0],
- "118": [0, 0.44444, 0.01597, 0],
- "119": [0, 0.44444, 0.01597, 0],
- "120": [0, 0.44444, 0, 0],
- "121": [0.19444, 0.44444, 0.01597, 0],
- "122": [0, 0.44444, 0, 0],
- "123": [0.25, 0.75, 0, 0],
- "124": [0.25, 0.75, 0, 0],
- "125": [0.25, 0.75, 0, 0],
- "126": [0.35, 0.34444, 0, 0],
- "168": [0, 0.69444, 0, 0],
- "172": [0, 0.44444, 0, 0],
- "175": [0, 0.59611, 0, 0],
- "176": [0, 0.69444, 0, 0],
- "177": [0.13333, 0.63333, 0, 0],
- "180": [0, 0.69444, 0, 0],
- "215": [0.13333, 0.63333, 0, 0],
- "247": [0.13333, 0.63333, 0, 0],
- "305": [0, 0.44444, 0, 0],
- "567": [0.19444, 0.44444, 0, 0],
- "710": [0, 0.69444, 0, 0],
- "711": [0, 0.63194, 0, 0],
- "713": [0, 0.59611, 0, 0],
- "714": [0, 0.69444, 0, 0],
- "715": [0, 0.69444, 0, 0],
- "728": [0, 0.69444, 0, 0],
- "729": [0, 0.69444, 0, 0],
- "730": [0, 0.69444, 0, 0],
- "732": [0, 0.69444, 0, 0],
- "768": [0, 0.69444, 0, 0],
- "769": [0, 0.69444, 0, 0],
- "770": [0, 0.69444, 0, 0],
- "771": [0, 0.69444, 0, 0],
- "772": [0, 0.59611, 0, 0],
- "774": [0, 0.69444, 0, 0],
- "775": [0, 0.69444, 0, 0],
- "776": [0, 0.69444, 0, 0],
- "778": [0, 0.69444, 0, 0],
- "779": [0, 0.69444, 0, 0],
- "780": [0, 0.63194, 0, 0],
- "824": [0.19444, 0.69444, 0, 0],
- "915": [0, 0.68611, 0, 0],
- "916": [0, 0.68611, 0, 0],
- "920": [0, 0.68611, 0, 0],
- "923": [0, 0.68611, 0, 0],
- "926": [0, 0.68611, 0, 0],
- "928": [0, 0.68611, 0, 0],
- "931": [0, 0.68611, 0, 0],
- "933": [0, 0.68611, 0, 0],
- "934": [0, 0.68611, 0, 0],
- "936": [0, 0.68611, 0, 0],
- "937": [0, 0.68611, 0, 0],
- "8211": [0, 0.44444, 0.03194, 0],
- "8212": [0, 0.44444, 0.03194, 0],
- "8216": [0, 0.69444, 0, 0],
- "8217": [0, 0.69444, 0, 0],
- "8220": [0, 0.69444, 0, 0],
- "8221": [0, 0.69444, 0, 0],
- "8224": [0.19444, 0.69444, 0, 0],
- "8225": [0.19444, 0.69444, 0, 0],
- "8242": [0, 0.55556, 0, 0],
- "8407": [0, 0.72444, 0.15486, 0],
- "8463": [0, 0.69444, 0, 0],
- "8465": [0, 0.69444, 0, 0],
- "8467": [0, 0.69444, 0, 0],
- "8472": [0.19444, 0.44444, 0, 0],
- "8476": [0, 0.69444, 0, 0],
- "8501": [0, 0.69444, 0, 0],
- "8592": [-0.10889, 0.39111, 0, 0],
- "8593": [0.19444, 0.69444, 0, 0],
- "8594": [-0.10889, 0.39111, 0, 0],
- "8595": [0.19444, 0.69444, 0, 0],
- "8596": [-0.10889, 0.39111, 0, 0],
- "8597": [0.25, 0.75, 0, 0],
- "8598": [0.19444, 0.69444, 0, 0],
- "8599": [0.19444, 0.69444, 0, 0],
- "8600": [0.19444, 0.69444, 0, 0],
- "8601": [0.19444, 0.69444, 0, 0],
- "8636": [-0.10889, 0.39111, 0, 0],
- "8637": [-0.10889, 0.39111, 0, 0],
- "8640": [-0.10889, 0.39111, 0, 0],
- "8641": [-0.10889, 0.39111, 0, 0],
- "8656": [-0.10889, 0.39111, 0, 0],
- "8657": [0.19444, 0.69444, 0, 0],
- "8658": [-0.10889, 0.39111, 0, 0],
- "8659": [0.19444, 0.69444, 0, 0],
- "8660": [-0.10889, 0.39111, 0, 0],
- "8661": [0.25, 0.75, 0, 0],
- "8704": [0, 0.69444, 0, 0],
- "8706": [0, 0.69444, 0.06389, 0],
- "8707": [0, 0.69444, 0, 0],
- "8709": [0.05556, 0.75, 0, 0],
- "8711": [0, 0.68611, 0, 0],
- "8712": [0.08556, 0.58556, 0, 0],
- "8715": [0.08556, 0.58556, 0, 0],
- "8722": [0.13333, 0.63333, 0, 0],
- "8723": [0.13333, 0.63333, 0, 0],
- "8725": [0.25, 0.75, 0, 0],
- "8726": [0.25, 0.75, 0, 0],
- "8727": [-0.02778, 0.47222, 0, 0],
- "8728": [-0.02639, 0.47361, 0, 0],
- "8729": [-0.02639, 0.47361, 0, 0],
- "8730": [0.18, 0.82, 0, 0],
- "8733": [0, 0.44444, 0, 0],
- "8734": [0, 0.44444, 0, 0],
- "8736": [0, 0.69224, 0, 0],
- "8739": [0.25, 0.75, 0, 0],
- "8741": [0.25, 0.75, 0, 0],
- "8743": [0, 0.55556, 0, 0],
- "8744": [0, 0.55556, 0, 0],
- "8745": [0, 0.55556, 0, 0],
- "8746": [0, 0.55556, 0, 0],
- "8747": [0.19444, 0.69444, 0.12778, 0],
- "8764": [-0.10889, 0.39111, 0, 0],
- "8768": [0.19444, 0.69444, 0, 0],
- "8771": [0.00222, 0.50222, 0, 0],
- "8776": [0.02444, 0.52444, 0, 0],
- "8781": [0.00222, 0.50222, 0, 0],
- "8801": [0.00222, 0.50222, 0, 0],
- "8804": [0.19667, 0.69667, 0, 0],
- "8805": [0.19667, 0.69667, 0, 0],
- "8810": [0.08556, 0.58556, 0, 0],
- "8811": [0.08556, 0.58556, 0, 0],
- "8826": [0.08556, 0.58556, 0, 0],
- "8827": [0.08556, 0.58556, 0, 0],
- "8834": [0.08556, 0.58556, 0, 0],
- "8835": [0.08556, 0.58556, 0, 0],
- "8838": [0.19667, 0.69667, 0, 0],
- "8839": [0.19667, 0.69667, 0, 0],
- "8846": [0, 0.55556, 0, 0],
- "8849": [0.19667, 0.69667, 0, 0],
- "8850": [0.19667, 0.69667, 0, 0],
- "8851": [0, 0.55556, 0, 0],
- "8852": [0, 0.55556, 0, 0],
- "8853": [0.13333, 0.63333, 0, 0],
- "8854": [0.13333, 0.63333, 0, 0],
- "8855": [0.13333, 0.63333, 0, 0],
- "8856": [0.13333, 0.63333, 0, 0],
- "8857": [0.13333, 0.63333, 0, 0],
- "8866": [0, 0.69444, 0, 0],
- "8867": [0, 0.69444, 0, 0],
- "8868": [0, 0.69444, 0, 0],
- "8869": [0, 0.69444, 0, 0],
- "8900": [-0.02639, 0.47361, 0, 0],
- "8901": [-0.02639, 0.47361, 0, 0],
- "8902": [-0.02778, 0.47222, 0, 0],
- "8968": [0.25, 0.75, 0, 0],
- "8969": [0.25, 0.75, 0, 0],
- "8970": [0.25, 0.75, 0, 0],
- "8971": [0.25, 0.75, 0, 0],
- "8994": [-0.13889, 0.36111, 0, 0],
- "8995": [-0.13889, 0.36111, 0, 0],
- "9651": [0.19444, 0.69444, 0, 0],
- "9657": [-0.02778, 0.47222, 0, 0],
- "9661": [0.19444, 0.69444, 0, 0],
- "9667": [-0.02778, 0.47222, 0, 0],
- "9711": [0.19444, 0.69444, 0, 0],
- "9824": [0.12963, 0.69444, 0, 0],
- "9825": [0.12963, 0.69444, 0, 0],
- "9826": [0.12963, 0.69444, 0, 0],
- "9827": [0.12963, 0.69444, 0, 0],
- "9837": [0, 0.75, 0, 0],
- "9838": [0.19444, 0.69444, 0, 0],
- "9839": [0.19444, 0.69444, 0, 0],
- "10216": [0.25, 0.75, 0, 0],
- "10217": [0.25, 0.75, 0, 0],
- "10815": [0, 0.68611, 0, 0],
- "10927": [0.19667, 0.69667, 0, 0],
- "10928": [0.19667, 0.69667, 0, 0],
- },
- "Main-Italic": {
- "33": [0, 0.69444, 0.12417, 0],
- "34": [0, 0.69444, 0.06961, 0],
- "35": [0.19444, 0.69444, 0.06616, 0],
- "37": [0.05556, 0.75, 0.13639, 0],
- "38": [0, 0.69444, 0.09694, 0],
- "39": [0, 0.69444, 0.12417, 0],
- "40": [0.25, 0.75, 0.16194, 0],
- "41": [0.25, 0.75, 0.03694, 0],
- "42": [0, 0.75, 0.14917, 0],
- "43": [0.05667, 0.56167, 0.03694, 0],
- "44": [0.19444, 0.10556, 0, 0],
- "45": [0, 0.43056, 0.02826, 0],
- "46": [0, 0.10556, 0, 0],
- "47": [0.25, 0.75, 0.16194, 0],
- "48": [0, 0.64444, 0.13556, 0],
- "49": [0, 0.64444, 0.13556, 0],
- "50": [0, 0.64444, 0.13556, 0],
- "51": [0, 0.64444, 0.13556, 0],
- "52": [0.19444, 0.64444, 0.13556, 0],
- "53": [0, 0.64444, 0.13556, 0],
- "54": [0, 0.64444, 0.13556, 0],
- "55": [0.19444, 0.64444, 0.13556, 0],
- "56": [0, 0.64444, 0.13556, 0],
- "57": [0, 0.64444, 0.13556, 0],
- "58": [0, 0.43056, 0.0582, 0],
- "59": [0.19444, 0.43056, 0.0582, 0],
- "61": [-0.13313, 0.36687, 0.06616, 0],
- "63": [0, 0.69444, 0.1225, 0],
- "64": [0, 0.69444, 0.09597, 0],
- "65": [0, 0.68333, 0, 0],
- "66": [0, 0.68333, 0.10257, 0],
- "67": [0, 0.68333, 0.14528, 0],
- "68": [0, 0.68333, 0.09403, 0],
- "69": [0, 0.68333, 0.12028, 0],
- "70": [0, 0.68333, 0.13305, 0],
- "71": [0, 0.68333, 0.08722, 0],
- "72": [0, 0.68333, 0.16389, 0],
- "73": [0, 0.68333, 0.15806, 0],
- "74": [0, 0.68333, 0.14028, 0],
- "75": [0, 0.68333, 0.14528, 0],
- "76": [0, 0.68333, 0, 0],
- "77": [0, 0.68333, 0.16389, 0],
- "78": [0, 0.68333, 0.16389, 0],
- "79": [0, 0.68333, 0.09403, 0],
- "80": [0, 0.68333, 0.10257, 0],
- "81": [0.19444, 0.68333, 0.09403, 0],
- "82": [0, 0.68333, 0.03868, 0],
- "83": [0, 0.68333, 0.11972, 0],
- "84": [0, 0.68333, 0.13305, 0],
- "85": [0, 0.68333, 0.16389, 0],
- "86": [0, 0.68333, 0.18361, 0],
- "87": [0, 0.68333, 0.18361, 0],
- "88": [0, 0.68333, 0.15806, 0],
- "89": [0, 0.68333, 0.19383, 0],
- "90": [0, 0.68333, 0.14528, 0],
- "91": [0.25, 0.75, 0.1875, 0],
- "93": [0.25, 0.75, 0.10528, 0],
- "94": [0, 0.69444, 0.06646, 0],
- "95": [0.31, 0.12056, 0.09208, 0],
- "97": [0, 0.43056, 0.07671, 0],
- "98": [0, 0.69444, 0.06312, 0],
- "99": [0, 0.43056, 0.05653, 0],
- "100": [0, 0.69444, 0.10333, 0],
- "101": [0, 0.43056, 0.07514, 0],
- "102": [0.19444, 0.69444, 0.21194, 0],
- "103": [0.19444, 0.43056, 0.08847, 0],
- "104": [0, 0.69444, 0.07671, 0],
- "105": [0, 0.65536, 0.1019, 0],
- "106": [0.19444, 0.65536, 0.14467, 0],
- "107": [0, 0.69444, 0.10764, 0],
- "108": [0, 0.69444, 0.10333, 0],
- "109": [0, 0.43056, 0.07671, 0],
- "110": [0, 0.43056, 0.07671, 0],
- "111": [0, 0.43056, 0.06312, 0],
- "112": [0.19444, 0.43056, 0.06312, 0],
- "113": [0.19444, 0.43056, 0.08847, 0],
- "114": [0, 0.43056, 0.10764, 0],
- "115": [0, 0.43056, 0.08208, 0],
- "116": [0, 0.61508, 0.09486, 0],
- "117": [0, 0.43056, 0.07671, 0],
- "118": [0, 0.43056, 0.10764, 0],
- "119": [0, 0.43056, 0.10764, 0],
- "120": [0, 0.43056, 0.12042, 0],
- "121": [0.19444, 0.43056, 0.08847, 0],
- "122": [0, 0.43056, 0.12292, 0],
- "126": [0.35, 0.31786, 0.11585, 0],
- "163": [0, 0.69444, 0, 0],
- "305": [0, 0.43056, 0, 0.02778],
- "567": [0.19444, 0.43056, 0, 0.08334],
- "768": [0, 0.69444, 0, 0],
- "769": [0, 0.69444, 0.09694, 0],
- "770": [0, 0.69444, 0.06646, 0],
- "771": [0, 0.66786, 0.11585, 0],
- "772": [0, 0.56167, 0.10333, 0],
- "774": [0, 0.69444, 0.10806, 0],
- "775": [0, 0.66786, 0.11752, 0],
- "776": [0, 0.66786, 0.10474, 0],
- "778": [0, 0.69444, 0, 0],
- "779": [0, 0.69444, 0.1225, 0],
- "780": [0, 0.62847, 0.08295, 0],
- "915": [0, 0.68333, 0.13305, 0],
- "916": [0, 0.68333, 0, 0],
- "920": [0, 0.68333, 0.09403, 0],
- "923": [0, 0.68333, 0, 0],
- "926": [0, 0.68333, 0.15294, 0],
- "928": [0, 0.68333, 0.16389, 0],
- "931": [0, 0.68333, 0.12028, 0],
- "933": [0, 0.68333, 0.11111, 0],
- "934": [0, 0.68333, 0.05986, 0],
- "936": [0, 0.68333, 0.11111, 0],
- "937": [0, 0.68333, 0.10257, 0],
- "8211": [0, 0.43056, 0.09208, 0],
- "8212": [0, 0.43056, 0.09208, 0],
- "8216": [0, 0.69444, 0.12417, 0],
- "8217": [0, 0.69444, 0.12417, 0],
- "8220": [0, 0.69444, 0.1685, 0],
- "8221": [0, 0.69444, 0.06961, 0],
- "8463": [0, 0.68889, 0, 0],
- },
- "Main-Regular": {
- "32": [0, 0, 0, 0],
- "33": [0, 0.69444, 0, 0],
- "34": [0, 0.69444, 0, 0],
- "35": [0.19444, 0.69444, 0, 0],
- "36": [0.05556, 0.75, 0, 0],
- "37": [0.05556, 0.75, 0, 0],
- "38": [0, 0.69444, 0, 0],
- "39": [0, 0.69444, 0, 0],
- "40": [0.25, 0.75, 0, 0],
- "41": [0.25, 0.75, 0, 0],
- "42": [0, 0.75, 0, 0],
- "43": [0.08333, 0.58333, 0, 0],
- "44": [0.19444, 0.10556, 0, 0],
- "45": [0, 0.43056, 0, 0],
- "46": [0, 0.10556, 0, 0],
- "47": [0.25, 0.75, 0, 0],
- "48": [0, 0.64444, 0, 0],
- "49": [0, 0.64444, 0, 0],
- "50": [0, 0.64444, 0, 0],
- "51": [0, 0.64444, 0, 0],
- "52": [0, 0.64444, 0, 0],
- "53": [0, 0.64444, 0, 0],
- "54": [0, 0.64444, 0, 0],
- "55": [0, 0.64444, 0, 0],
- "56": [0, 0.64444, 0, 0],
- "57": [0, 0.64444, 0, 0],
- "58": [0, 0.43056, 0, 0],
- "59": [0.19444, 0.43056, 0, 0],
- "60": [0.0391, 0.5391, 0, 0],
- "61": [-0.13313, 0.36687, 0, 0],
- "62": [0.0391, 0.5391, 0, 0],
- "63": [0, 0.69444, 0, 0],
- "64": [0, 0.69444, 0, 0],
- "65": [0, 0.68333, 0, 0],
- "66": [0, 0.68333, 0, 0],
- "67": [0, 0.68333, 0, 0],
- "68": [0, 0.68333, 0, 0],
- "69": [0, 0.68333, 0, 0],
- "70": [0, 0.68333, 0, 0],
- "71": [0, 0.68333, 0, 0],
- "72": [0, 0.68333, 0, 0],
- "73": [0, 0.68333, 0, 0],
- "74": [0, 0.68333, 0, 0],
- "75": [0, 0.68333, 0, 0],
- "76": [0, 0.68333, 0, 0],
- "77": [0, 0.68333, 0, 0],
- "78": [0, 0.68333, 0, 0],
- "79": [0, 0.68333, 0, 0],
- "80": [0, 0.68333, 0, 0],
- "81": [0.19444, 0.68333, 0, 0],
- "82": [0, 0.68333, 0, 0],
- "83": [0, 0.68333, 0, 0],
- "84": [0, 0.68333, 0, 0],
- "85": [0, 0.68333, 0, 0],
- "86": [0, 0.68333, 0.01389, 0],
- "87": [0, 0.68333, 0.01389, 0],
- "88": [0, 0.68333, 0, 0],
- "89": [0, 0.68333, 0.025, 0],
- "90": [0, 0.68333, 0, 0],
- "91": [0.25, 0.75, 0, 0],
- "92": [0.25, 0.75, 0, 0],
- "93": [0.25, 0.75, 0, 0],
- "94": [0, 0.69444, 0, 0],
- "95": [0.31, 0.12056, 0.02778, 0],
- "96": [0, 0.69444, 0, 0],
- "97": [0, 0.43056, 0, 0],
- "98": [0, 0.69444, 0, 0],
- "99": [0, 0.43056, 0, 0],
- "100": [0, 0.69444, 0, 0],
- "101": [0, 0.43056, 0, 0],
- "102": [0, 0.69444, 0.07778, 0],
- "103": [0.19444, 0.43056, 0.01389, 0],
- "104": [0, 0.69444, 0, 0],
- "105": [0, 0.66786, 0, 0],
- "106": [0.19444, 0.66786, 0, 0],
- "107": [0, 0.69444, 0, 0],
- "108": [0, 0.69444, 0, 0],
- "109": [0, 0.43056, 0, 0],
- "110": [0, 0.43056, 0, 0],
- "111": [0, 0.43056, 0, 0],
- "112": [0.19444, 0.43056, 0, 0],
- "113": [0.19444, 0.43056, 0, 0],
- "114": [0, 0.43056, 0, 0],
- "115": [0, 0.43056, 0, 0],
- "116": [0, 0.61508, 0, 0],
- "117": [0, 0.43056, 0, 0],
- "118": [0, 0.43056, 0.01389, 0],
- "119": [0, 0.43056, 0.01389, 0],
- "120": [0, 0.43056, 0, 0],
- "121": [0.19444, 0.43056, 0.01389, 0],
- "122": [0, 0.43056, 0, 0],
- "123": [0.25, 0.75, 0, 0],
- "124": [0.25, 0.75, 0, 0],
- "125": [0.25, 0.75, 0, 0],
- "126": [0.35, 0.31786, 0, 0],
- "160": [0, 0, 0, 0],
- "168": [0, 0.66786, 0, 0],
- "172": [0, 0.43056, 0, 0],
- "175": [0, 0.56778, 0, 0],
- "176": [0, 0.69444, 0, 0],
- "177": [0.08333, 0.58333, 0, 0],
- "180": [0, 0.69444, 0, 0],
- "215": [0.08333, 0.58333, 0, 0],
- "247": [0.08333, 0.58333, 0, 0],
- "305": [0, 0.43056, 0, 0],
- "567": [0.19444, 0.43056, 0, 0],
- "710": [0, 0.69444, 0, 0],
- "711": [0, 0.62847, 0, 0],
- "713": [0, 0.56778, 0, 0],
- "714": [0, 0.69444, 0, 0],
- "715": [0, 0.69444, 0, 0],
- "728": [0, 0.69444, 0, 0],
- "729": [0, 0.66786, 0, 0],
- "730": [0, 0.69444, 0, 0],
- "732": [0, 0.66786, 0, 0],
- "768": [0, 0.69444, 0, 0],
- "769": [0, 0.69444, 0, 0],
- "770": [0, 0.69444, 0, 0],
- "771": [0, 0.66786, 0, 0],
- "772": [0, 0.56778, 0, 0],
- "774": [0, 0.69444, 0, 0],
- "775": [0, 0.66786, 0, 0],
- "776": [0, 0.66786, 0, 0],
- "778": [0, 0.69444, 0, 0],
- "779": [0, 0.69444, 0, 0],
- "780": [0, 0.62847, 0, 0],
- "824": [0.19444, 0.69444, 0, 0],
- "915": [0, 0.68333, 0, 0],
- "916": [0, 0.68333, 0, 0],
- "920": [0, 0.68333, 0, 0],
- "923": [0, 0.68333, 0, 0],
- "926": [0, 0.68333, 0, 0],
- "928": [0, 0.68333, 0, 0],
- "931": [0, 0.68333, 0, 0],
- "933": [0, 0.68333, 0, 0],
- "934": [0, 0.68333, 0, 0],
- "936": [0, 0.68333, 0, 0],
- "937": [0, 0.68333, 0, 0],
- "8211": [0, 0.43056, 0.02778, 0],
- "8212": [0, 0.43056, 0.02778, 0],
- "8216": [0, 0.69444, 0, 0],
- "8217": [0, 0.69444, 0, 0],
- "8220": [0, 0.69444, 0, 0],
- "8221": [0, 0.69444, 0, 0],
- "8224": [0.19444, 0.69444, 0, 0],
- "8225": [0.19444, 0.69444, 0, 0],
- "8230": [0, 0.12, 0, 0],
- "8242": [0, 0.55556, 0, 0],
- "8407": [0, 0.71444, 0.15382, 0],
- "8463": [0, 0.68889, 0, 0],
- "8465": [0, 0.69444, 0, 0],
- "8467": [0, 0.69444, 0, 0.11111],
- "8472": [0.19444, 0.43056, 0, 0.11111],
- "8476": [0, 0.69444, 0, 0],
- "8501": [0, 0.69444, 0, 0],
- "8592": [-0.13313, 0.36687, 0, 0],
- "8593": [0.19444, 0.69444, 0, 0],
- "8594": [-0.13313, 0.36687, 0, 0],
- "8595": [0.19444, 0.69444, 0, 0],
- "8596": [-0.13313, 0.36687, 0, 0],
- "8597": [0.25, 0.75, 0, 0],
- "8598": [0.19444, 0.69444, 0, 0],
- "8599": [0.19444, 0.69444, 0, 0],
- "8600": [0.19444, 0.69444, 0, 0],
- "8601": [0.19444, 0.69444, 0, 0],
- "8614": [0.011, 0.511, 0, 0],
- "8617": [0.011, 0.511, 0, 0],
- "8618": [0.011, 0.511, 0, 0],
- "8636": [-0.13313, 0.36687, 0, 0],
- "8637": [-0.13313, 0.36687, 0, 0],
- "8640": [-0.13313, 0.36687, 0, 0],
- "8641": [-0.13313, 0.36687, 0, 0],
- "8652": [0.011, 0.671, 0, 0],
- "8656": [-0.13313, 0.36687, 0, 0],
- "8657": [0.19444, 0.69444, 0, 0],
- "8658": [-0.13313, 0.36687, 0, 0],
- "8659": [0.19444, 0.69444, 0, 0],
- "8660": [-0.13313, 0.36687, 0, 0],
- "8661": [0.25, 0.75, 0, 0],
- "8704": [0, 0.69444, 0, 0],
- "8706": [0, 0.69444, 0.05556, 0.08334],
- "8707": [0, 0.69444, 0, 0],
- "8709": [0.05556, 0.75, 0, 0],
- "8711": [0, 0.68333, 0, 0],
- "8712": [0.0391, 0.5391, 0, 0],
- "8715": [0.0391, 0.5391, 0, 0],
- "8722": [0.08333, 0.58333, 0, 0],
- "8723": [0.08333, 0.58333, 0, 0],
- "8725": [0.25, 0.75, 0, 0],
- "8726": [0.25, 0.75, 0, 0],
- "8727": [-0.03472, 0.46528, 0, 0],
- "8728": [-0.05555, 0.44445, 0, 0],
- "8729": [-0.05555, 0.44445, 0, 0],
- "8730": [0.2, 0.8, 0, 0],
- "8733": [0, 0.43056, 0, 0],
- "8734": [0, 0.43056, 0, 0],
- "8736": [0, 0.69224, 0, 0],
- "8739": [0.25, 0.75, 0, 0],
- "8741": [0.25, 0.75, 0, 0],
- "8743": [0, 0.55556, 0, 0],
- "8744": [0, 0.55556, 0, 0],
- "8745": [0, 0.55556, 0, 0],
- "8746": [0, 0.55556, 0, 0],
- "8747": [0.19444, 0.69444, 0.11111, 0],
- "8764": [-0.13313, 0.36687, 0, 0],
- "8768": [0.19444, 0.69444, 0, 0],
- "8771": [-0.03625, 0.46375, 0, 0],
- "8773": [-0.022, 0.589, 0, 0],
- "8776": [-0.01688, 0.48312, 0, 0],
- "8781": [-0.03625, 0.46375, 0, 0],
- "8784": [-0.133, 0.67, 0, 0],
- "8800": [0.215, 0.716, 0, 0],
- "8801": [-0.03625, 0.46375, 0, 0],
- "8804": [0.13597, 0.63597, 0, 0],
- "8805": [0.13597, 0.63597, 0, 0],
- "8810": [0.0391, 0.5391, 0, 0],
- "8811": [0.0391, 0.5391, 0, 0],
- "8826": [0.0391, 0.5391, 0, 0],
- "8827": [0.0391, 0.5391, 0, 0],
- "8834": [0.0391, 0.5391, 0, 0],
- "8835": [0.0391, 0.5391, 0, 0],
- "8838": [0.13597, 0.63597, 0, 0],
- "8839": [0.13597, 0.63597, 0, 0],
- "8846": [0, 0.55556, 0, 0],
- "8849": [0.13597, 0.63597, 0, 0],
- "8850": [0.13597, 0.63597, 0, 0],
- "8851": [0, 0.55556, 0, 0],
- "8852": [0, 0.55556, 0, 0],
- "8853": [0.08333, 0.58333, 0, 0],
- "8854": [0.08333, 0.58333, 0, 0],
- "8855": [0.08333, 0.58333, 0, 0],
- "8856": [0.08333, 0.58333, 0, 0],
- "8857": [0.08333, 0.58333, 0, 0],
- "8866": [0, 0.69444, 0, 0],
- "8867": [0, 0.69444, 0, 0],
- "8868": [0, 0.69444, 0, 0],
- "8869": [0, 0.69444, 0, 0],
- "8872": [0.249, 0.75, 0, 0],
- "8900": [-0.05555, 0.44445, 0, 0],
- "8901": [-0.05555, 0.44445, 0, 0],
- "8902": [-0.03472, 0.46528, 0, 0],
- "8904": [0.005, 0.505, 0, 0],
- "8942": [0.03, 0.9, 0, 0],
- "8943": [-0.19, 0.31, 0, 0],
- "8945": [-0.1, 0.82, 0, 0],
- "8968": [0.25, 0.75, 0, 0],
- "8969": [0.25, 0.75, 0, 0],
- "8970": [0.25, 0.75, 0, 0],
- "8971": [0.25, 0.75, 0, 0],
- "8994": [-0.14236, 0.35764, 0, 0],
- "8995": [-0.14236, 0.35764, 0, 0],
- "9136": [0.244, 0.744, 0, 0],
- "9137": [0.244, 0.744, 0, 0],
- "9651": [0.19444, 0.69444, 0, 0],
- "9657": [-0.03472, 0.46528, 0, 0],
- "9661": [0.19444, 0.69444, 0, 0],
- "9667": [-0.03472, 0.46528, 0, 0],
- "9711": [0.19444, 0.69444, 0, 0],
- "9824": [0.12963, 0.69444, 0, 0],
- "9825": [0.12963, 0.69444, 0, 0],
- "9826": [0.12963, 0.69444, 0, 0],
- "9827": [0.12963, 0.69444, 0, 0],
- "9837": [0, 0.75, 0, 0],
- "9838": [0.19444, 0.69444, 0, 0],
- "9839": [0.19444, 0.69444, 0, 0],
- "10216": [0.25, 0.75, 0, 0],
- "10217": [0.25, 0.75, 0, 0],
- "10222": [0.244, 0.744, 0, 0],
- "10223": [0.244, 0.744, 0, 0],
- "10229": [0.011, 0.511, 0, 0],
- "10230": [0.011, 0.511, 0, 0],
- "10231": [0.011, 0.511, 0, 0],
- "10232": [0.024, 0.525, 0, 0],
- "10233": [0.024, 0.525, 0, 0],
- "10234": [0.024, 0.525, 0, 0],
- "10236": [0.011, 0.511, 0, 0],
- "10815": [0, 0.68333, 0, 0],
- "10927": [0.13597, 0.63597, 0, 0],
- "10928": [0.13597, 0.63597, 0, 0],
- },
- "Math-BoldItalic": {
- "47": [0.19444, 0.69444, 0, 0],
- "65": [0, 0.68611, 0, 0],
- "66": [0, 0.68611, 0.04835, 0],
- "67": [0, 0.68611, 0.06979, 0],
- "68": [0, 0.68611, 0.03194, 0],
- "69": [0, 0.68611, 0.05451, 0],
- "70": [0, 0.68611, 0.15972, 0],
- "71": [0, 0.68611, 0, 0],
- "72": [0, 0.68611, 0.08229, 0],
- "73": [0, 0.68611, 0.07778, 0],
- "74": [0, 0.68611, 0.10069, 0],
- "75": [0, 0.68611, 0.06979, 0],
- "76": [0, 0.68611, 0, 0],
- "77": [0, 0.68611, 0.11424, 0],
- "78": [0, 0.68611, 0.11424, 0],
- "79": [0, 0.68611, 0.03194, 0],
- "80": [0, 0.68611, 0.15972, 0],
- "81": [0.19444, 0.68611, 0, 0],
- "82": [0, 0.68611, 0.00421, 0],
- "83": [0, 0.68611, 0.05382, 0],
- "84": [0, 0.68611, 0.15972, 0],
- "85": [0, 0.68611, 0.11424, 0],
- "86": [0, 0.68611, 0.25555, 0],
- "87": [0, 0.68611, 0.15972, 0],
- "88": [0, 0.68611, 0.07778, 0],
- "89": [0, 0.68611, 0.25555, 0],
- "90": [0, 0.68611, 0.06979, 0],
- "97": [0, 0.44444, 0, 0],
- "98": [0, 0.69444, 0, 0],
- "99": [0, 0.44444, 0, 0],
- "100": [0, 0.69444, 0, 0],
- "101": [0, 0.44444, 0, 0],
- "102": [0.19444, 0.69444, 0.11042, 0],
- "103": [0.19444, 0.44444, 0.03704, 0],
- "104": [0, 0.69444, 0, 0],
- "105": [0, 0.69326, 0, 0],
- "106": [0.19444, 0.69326, 0.0622, 0],
- "107": [0, 0.69444, 0.01852, 0],
- "108": [0, 0.69444, 0.0088, 0],
- "109": [0, 0.44444, 0, 0],
- "110": [0, 0.44444, 0, 0],
- "111": [0, 0.44444, 0, 0],
- "112": [0.19444, 0.44444, 0, 0],
- "113": [0.19444, 0.44444, 0.03704, 0],
- "114": [0, 0.44444, 0.03194, 0],
- "115": [0, 0.44444, 0, 0],
- "116": [0, 0.63492, 0, 0],
- "117": [0, 0.44444, 0, 0],
- "118": [0, 0.44444, 0.03704, 0],
- "119": [0, 0.44444, 0.02778, 0],
- "120": [0, 0.44444, 0, 0],
- "121": [0.19444, 0.44444, 0.03704, 0],
- "122": [0, 0.44444, 0.04213, 0],
- "915": [0, 0.68611, 0.15972, 0],
- "916": [0, 0.68611, 0, 0],
- "920": [0, 0.68611, 0.03194, 0],
- "923": [0, 0.68611, 0, 0],
- "926": [0, 0.68611, 0.07458, 0],
- "928": [0, 0.68611, 0.08229, 0],
- "931": [0, 0.68611, 0.05451, 0],
- "933": [0, 0.68611, 0.15972, 0],
- "934": [0, 0.68611, 0, 0],
- "936": [0, 0.68611, 0.11653, 0],
- "937": [0, 0.68611, 0.04835, 0],
- "945": [0, 0.44444, 0, 0],
- "946": [0.19444, 0.69444, 0.03403, 0],
- "947": [0.19444, 0.44444, 0.06389, 0],
- "948": [0, 0.69444, 0.03819, 0],
- "949": [0, 0.44444, 0, 0],
- "950": [0.19444, 0.69444, 0.06215, 0],
- "951": [0.19444, 0.44444, 0.03704, 0],
- "952": [0, 0.69444, 0.03194, 0],
- "953": [0, 0.44444, 0, 0],
- "954": [0, 0.44444, 0, 0],
- "955": [0, 0.69444, 0, 0],
- "956": [0.19444, 0.44444, 0, 0],
- "957": [0, 0.44444, 0.06898, 0],
- "958": [0.19444, 0.69444, 0.03021, 0],
- "959": [0, 0.44444, 0, 0],
- "960": [0, 0.44444, 0.03704, 0],
- "961": [0.19444, 0.44444, 0, 0],
- "962": [0.09722, 0.44444, 0.07917, 0],
- "963": [0, 0.44444, 0.03704, 0],
- "964": [0, 0.44444, 0.13472, 0],
- "965": [0, 0.44444, 0.03704, 0],
- "966": [0.19444, 0.44444, 0, 0],
- "967": [0.19444, 0.44444, 0, 0],
- "968": [0.19444, 0.69444, 0.03704, 0],
- "969": [0, 0.44444, 0.03704, 0],
- "977": [0, 0.69444, 0, 0],
- "981": [0.19444, 0.69444, 0, 0],
- "982": [0, 0.44444, 0.03194, 0],
- "1009": [0.19444, 0.44444, 0, 0],
- "1013": [0, 0.44444, 0, 0],
- },
- "Math-Italic": {
- "47": [0.19444, 0.69444, 0, 0],
- "65": [0, 0.68333, 0, 0.13889],
- "66": [0, 0.68333, 0.05017, 0.08334],
- "67": [0, 0.68333, 0.07153, 0.08334],
- "68": [0, 0.68333, 0.02778, 0.05556],
- "69": [0, 0.68333, 0.05764, 0.08334],
- "70": [0, 0.68333, 0.13889, 0.08334],
- "71": [0, 0.68333, 0, 0.08334],
- "72": [0, 0.68333, 0.08125, 0.05556],
- "73": [0, 0.68333, 0.07847, 0.11111],
- "74": [0, 0.68333, 0.09618, 0.16667],
- "75": [0, 0.68333, 0.07153, 0.05556],
- "76": [0, 0.68333, 0, 0.02778],
- "77": [0, 0.68333, 0.10903, 0.08334],
- "78": [0, 0.68333, 0.10903, 0.08334],
- "79": [0, 0.68333, 0.02778, 0.08334],
- "80": [0, 0.68333, 0.13889, 0.08334],
- "81": [0.19444, 0.68333, 0, 0.08334],
- "82": [0, 0.68333, 0.00773, 0.08334],
- "83": [0, 0.68333, 0.05764, 0.08334],
- "84": [0, 0.68333, 0.13889, 0.08334],
- "85": [0, 0.68333, 0.10903, 0.02778],
- "86": [0, 0.68333, 0.22222, 0],
- "87": [0, 0.68333, 0.13889, 0],
- "88": [0, 0.68333, 0.07847, 0.08334],
- "89": [0, 0.68333, 0.22222, 0],
- "90": [0, 0.68333, 0.07153, 0.08334],
- "97": [0, 0.43056, 0, 0],
- "98": [0, 0.69444, 0, 0],
- "99": [0, 0.43056, 0, 0.05556],
- "100": [0, 0.69444, 0, 0.16667],
- "101": [0, 0.43056, 0, 0.05556],
- "102": [0.19444, 0.69444, 0.10764, 0.16667],
- "103": [0.19444, 0.43056, 0.03588, 0.02778],
- "104": [0, 0.69444, 0, 0],
- "105": [0, 0.65952, 0, 0],
- "106": [0.19444, 0.65952, 0.05724, 0],
- "107": [0, 0.69444, 0.03148, 0],
- "108": [0, 0.69444, 0.01968, 0.08334],
- "109": [0, 0.43056, 0, 0],
- "110": [0, 0.43056, 0, 0],
- "111": [0, 0.43056, 0, 0.05556],
- "112": [0.19444, 0.43056, 0, 0.08334],
- "113": [0.19444, 0.43056, 0.03588, 0.08334],
- "114": [0, 0.43056, 0.02778, 0.05556],
- "115": [0, 0.43056, 0, 0.05556],
- "116": [0, 0.61508, 0, 0.08334],
- "117": [0, 0.43056, 0, 0.02778],
- "118": [0, 0.43056, 0.03588, 0.02778],
- "119": [0, 0.43056, 0.02691, 0.08334],
- "120": [0, 0.43056, 0, 0.02778],
- "121": [0.19444, 0.43056, 0.03588, 0.05556],
- "122": [0, 0.43056, 0.04398, 0.05556],
- "915": [0, 0.68333, 0.13889, 0.08334],
- "916": [0, 0.68333, 0, 0.16667],
- "920": [0, 0.68333, 0.02778, 0.08334],
- "923": [0, 0.68333, 0, 0.16667],
- "926": [0, 0.68333, 0.07569, 0.08334],
- "928": [0, 0.68333, 0.08125, 0.05556],
- "931": [0, 0.68333, 0.05764, 0.08334],
- "933": [0, 0.68333, 0.13889, 0.05556],
- "934": [0, 0.68333, 0, 0.08334],
- "936": [0, 0.68333, 0.11, 0.05556],
- "937": [0, 0.68333, 0.05017, 0.08334],
- "945": [0, 0.43056, 0.0037, 0.02778],
- "946": [0.19444, 0.69444, 0.05278, 0.08334],
- "947": [0.19444, 0.43056, 0.05556, 0],
- "948": [0, 0.69444, 0.03785, 0.05556],
- "949": [0, 0.43056, 0, 0.08334],
- "950": [0.19444, 0.69444, 0.07378, 0.08334],
- "951": [0.19444, 0.43056, 0.03588, 0.05556],
- "952": [0, 0.69444, 0.02778, 0.08334],
- "953": [0, 0.43056, 0, 0.05556],
- "954": [0, 0.43056, 0, 0],
- "955": [0, 0.69444, 0, 0],
- "956": [0.19444, 0.43056, 0, 0.02778],
- "957": [0, 0.43056, 0.06366, 0.02778],
- "958": [0.19444, 0.69444, 0.04601, 0.11111],
- "959": [0, 0.43056, 0, 0.05556],
- "960": [0, 0.43056, 0.03588, 0],
- "961": [0.19444, 0.43056, 0, 0.08334],
- "962": [0.09722, 0.43056, 0.07986, 0.08334],
- "963": [0, 0.43056, 0.03588, 0],
- "964": [0, 0.43056, 0.1132, 0.02778],
- "965": [0, 0.43056, 0.03588, 0.02778],
- "966": [0.19444, 0.43056, 0, 0.08334],
- "967": [0.19444, 0.43056, 0, 0.05556],
- "968": [0.19444, 0.69444, 0.03588, 0.11111],
- "969": [0, 0.43056, 0.03588, 0],
- "977": [0, 0.69444, 0, 0.08334],
- "981": [0.19444, 0.69444, 0, 0.08334],
- "982": [0, 0.43056, 0.02778, 0],
- "1009": [0.19444, 0.43056, 0, 0.08334],
- "1013": [0, 0.43056, 0, 0.05556],
- },
- "Math-Regular": {
- "65": [0, 0.68333, 0, 0.13889],
- "66": [0, 0.68333, 0.05017, 0.08334],
- "67": [0, 0.68333, 0.07153, 0.08334],
- "68": [0, 0.68333, 0.02778, 0.05556],
- "69": [0, 0.68333, 0.05764, 0.08334],
- "70": [0, 0.68333, 0.13889, 0.08334],
- "71": [0, 0.68333, 0, 0.08334],
- "72": [0, 0.68333, 0.08125, 0.05556],
- "73": [0, 0.68333, 0.07847, 0.11111],
- "74": [0, 0.68333, 0.09618, 0.16667],
- "75": [0, 0.68333, 0.07153, 0.05556],
- "76": [0, 0.68333, 0, 0.02778],
- "77": [0, 0.68333, 0.10903, 0.08334],
- "78": [0, 0.68333, 0.10903, 0.08334],
- "79": [0, 0.68333, 0.02778, 0.08334],
- "80": [0, 0.68333, 0.13889, 0.08334],
- "81": [0.19444, 0.68333, 0, 0.08334],
- "82": [0, 0.68333, 0.00773, 0.08334],
- "83": [0, 0.68333, 0.05764, 0.08334],
- "84": [0, 0.68333, 0.13889, 0.08334],
- "85": [0, 0.68333, 0.10903, 0.02778],
- "86": [0, 0.68333, 0.22222, 0],
- "87": [0, 0.68333, 0.13889, 0],
- "88": [0, 0.68333, 0.07847, 0.08334],
- "89": [0, 0.68333, 0.22222, 0],
- "90": [0, 0.68333, 0.07153, 0.08334],
- "97": [0, 0.43056, 0, 0],
- "98": [0, 0.69444, 0, 0],
- "99": [0, 0.43056, 0, 0.05556],
- "100": [0, 0.69444, 0, 0.16667],
- "101": [0, 0.43056, 0, 0.05556],
- "102": [0.19444, 0.69444, 0.10764, 0.16667],
- "103": [0.19444, 0.43056, 0.03588, 0.02778],
- "104": [0, 0.69444, 0, 0],
- "105": [0, 0.65952, 0, 0],
- "106": [0.19444, 0.65952, 0.05724, 0],
- "107": [0, 0.69444, 0.03148, 0],
- "108": [0, 0.69444, 0.01968, 0.08334],
- "109": [0, 0.43056, 0, 0],
- "110": [0, 0.43056, 0, 0],
- "111": [0, 0.43056, 0, 0.05556],
- "112": [0.19444, 0.43056, 0, 0.08334],
- "113": [0.19444, 0.43056, 0.03588, 0.08334],
- "114": [0, 0.43056, 0.02778, 0.05556],
- "115": [0, 0.43056, 0, 0.05556],
- "116": [0, 0.61508, 0, 0.08334],
- "117": [0, 0.43056, 0, 0.02778],
- "118": [0, 0.43056, 0.03588, 0.02778],
- "119": [0, 0.43056, 0.02691, 0.08334],
- "120": [0, 0.43056, 0, 0.02778],
- "121": [0.19444, 0.43056, 0.03588, 0.05556],
- "122": [0, 0.43056, 0.04398, 0.05556],
- "915": [0, 0.68333, 0.13889, 0.08334],
- "916": [0, 0.68333, 0, 0.16667],
- "920": [0, 0.68333, 0.02778, 0.08334],
- "923": [0, 0.68333, 0, 0.16667],
- "926": [0, 0.68333, 0.07569, 0.08334],
- "928": [0, 0.68333, 0.08125, 0.05556],
- "931": [0, 0.68333, 0.05764, 0.08334],
- "933": [0, 0.68333, 0.13889, 0.05556],
- "934": [0, 0.68333, 0, 0.08334],
- "936": [0, 0.68333, 0.11, 0.05556],
- "937": [0, 0.68333, 0.05017, 0.08334],
- "945": [0, 0.43056, 0.0037, 0.02778],
- "946": [0.19444, 0.69444, 0.05278, 0.08334],
- "947": [0.19444, 0.43056, 0.05556, 0],
- "948": [0, 0.69444, 0.03785, 0.05556],
- "949": [0, 0.43056, 0, 0.08334],
- "950": [0.19444, 0.69444, 0.07378, 0.08334],
- "951": [0.19444, 0.43056, 0.03588, 0.05556],
- "952": [0, 0.69444, 0.02778, 0.08334],
- "953": [0, 0.43056, 0, 0.05556],
- "954": [0, 0.43056, 0, 0],
- "955": [0, 0.69444, 0, 0],
- "956": [0.19444, 0.43056, 0, 0.02778],
- "957": [0, 0.43056, 0.06366, 0.02778],
- "958": [0.19444, 0.69444, 0.04601, 0.11111],
- "959": [0, 0.43056, 0, 0.05556],
- "960": [0, 0.43056, 0.03588, 0],
- "961": [0.19444, 0.43056, 0, 0.08334],
- "962": [0.09722, 0.43056, 0.07986, 0.08334],
- "963": [0, 0.43056, 0.03588, 0],
- "964": [0, 0.43056, 0.1132, 0.02778],
- "965": [0, 0.43056, 0.03588, 0.02778],
- "966": [0.19444, 0.43056, 0, 0.08334],
- "967": [0.19444, 0.43056, 0, 0.05556],
- "968": [0.19444, 0.69444, 0.03588, 0.11111],
- "969": [0, 0.43056, 0.03588, 0],
- "977": [0, 0.69444, 0, 0.08334],
- "981": [0.19444, 0.69444, 0, 0.08334],
- "982": [0, 0.43056, 0.02778, 0],
- "1009": [0.19444, 0.43056, 0, 0.08334],
- "1013": [0, 0.43056, 0, 0.05556],
- },
- "SansSerif-Regular": {
- "33": [0, 0.69444, 0, 0],
- "34": [0, 0.69444, 0, 0],
- "35": [0.19444, 0.69444, 0, 0],
- "36": [0.05556, 0.75, 0, 0],
- "37": [0.05556, 0.75, 0, 0],
- "38": [0, 0.69444, 0, 0],
- "39": [0, 0.69444, 0, 0],
- "40": [0.25, 0.75, 0, 0],
- "41": [0.25, 0.75, 0, 0],
- "42": [0, 0.75, 0, 0],
- "43": [0.08333, 0.58333, 0, 0],
- "44": [0.125, 0.08333, 0, 0],
- "45": [0, 0.44444, 0, 0],
- "46": [0, 0.08333, 0, 0],
- "47": [0.25, 0.75, 0, 0],
- "48": [0, 0.65556, 0, 0],
- "49": [0, 0.65556, 0, 0],
- "50": [0, 0.65556, 0, 0],
- "51": [0, 0.65556, 0, 0],
- "52": [0, 0.65556, 0, 0],
- "53": [0, 0.65556, 0, 0],
- "54": [0, 0.65556, 0, 0],
- "55": [0, 0.65556, 0, 0],
- "56": [0, 0.65556, 0, 0],
- "57": [0, 0.65556, 0, 0],
- "58": [0, 0.44444, 0, 0],
- "59": [0.125, 0.44444, 0, 0],
- "61": [-0.13, 0.37, 0, 0],
- "63": [0, 0.69444, 0, 0],
- "64": [0, 0.69444, 0, 0],
- "65": [0, 0.69444, 0, 0],
- "66": [0, 0.69444, 0, 0],
- "67": [0, 0.69444, 0, 0],
- "68": [0, 0.69444, 0, 0],
- "69": [0, 0.69444, 0, 0],
- "70": [0, 0.69444, 0, 0],
- "71": [0, 0.69444, 0, 0],
- "72": [0, 0.69444, 0, 0],
- "73": [0, 0.69444, 0, 0],
- "74": [0, 0.69444, 0, 0],
- "75": [0, 0.69444, 0, 0],
- "76": [0, 0.69444, 0, 0],
- "77": [0, 0.69444, 0, 0],
- "78": [0, 0.69444, 0, 0],
- "79": [0, 0.69444, 0, 0],
- "80": [0, 0.69444, 0, 0],
- "81": [0.125, 0.69444, 0, 0],
- "82": [0, 0.69444, 0, 0],
- "83": [0, 0.69444, 0, 0],
- "84": [0, 0.69444, 0, 0],
- "85": [0, 0.69444, 0, 0],
- "86": [0, 0.69444, 0.01389, 0],
- "87": [0, 0.69444, 0.01389, 0],
- "88": [0, 0.69444, 0, 0],
- "89": [0, 0.69444, 0.025, 0],
- "90": [0, 0.69444, 0, 0],
- "91": [0.25, 0.75, 0, 0],
- "93": [0.25, 0.75, 0, 0],
- "94": [0, 0.69444, 0, 0],
- "95": [0.35, 0.09444, 0.02778, 0],
- "97": [0, 0.44444, 0, 0],
- "98": [0, 0.69444, 0, 0],
- "99": [0, 0.44444, 0, 0],
- "100": [0, 0.69444, 0, 0],
- "101": [0, 0.44444, 0, 0],
- "102": [0, 0.69444, 0.06944, 0],
- "103": [0.19444, 0.44444, 0.01389, 0],
- "104": [0, 0.69444, 0, 0],
- "105": [0, 0.67937, 0, 0],
- "106": [0.19444, 0.67937, 0, 0],
- "107": [0, 0.69444, 0, 0],
- "108": [0, 0.69444, 0, 0],
- "109": [0, 0.44444, 0, 0],
- "110": [0, 0.44444, 0, 0],
- "111": [0, 0.44444, 0, 0],
- "112": [0.19444, 0.44444, 0, 0],
- "113": [0.19444, 0.44444, 0, 0],
- "114": [0, 0.44444, 0.01389, 0],
- "115": [0, 0.44444, 0, 0],
- "116": [0, 0.57143, 0, 0],
- "117": [0, 0.44444, 0, 0],
- "118": [0, 0.44444, 0.01389, 0],
- "119": [0, 0.44444, 0.01389, 0],
- "120": [0, 0.44444, 0, 0],
- "121": [0.19444, 0.44444, 0.01389, 0],
- "122": [0, 0.44444, 0, 0],
- "126": [0.35, 0.32659, 0, 0],
- "305": [0, 0.44444, 0, 0],
- "567": [0.19444, 0.44444, 0, 0],
- "768": [0, 0.69444, 0, 0],
- "769": [0, 0.69444, 0, 0],
- "770": [0, 0.69444, 0, 0],
- "771": [0, 0.67659, 0, 0],
- "772": [0, 0.60889, 0, 0],
- "774": [0, 0.69444, 0, 0],
- "775": [0, 0.67937, 0, 0],
- "776": [0, 0.67937, 0, 0],
- "778": [0, 0.69444, 0, 0],
- "779": [0, 0.69444, 0, 0],
- "780": [0, 0.63194, 0, 0],
- "915": [0, 0.69444, 0, 0],
- "916": [0, 0.69444, 0, 0],
- "920": [0, 0.69444, 0, 0],
- "923": [0, 0.69444, 0, 0],
- "926": [0, 0.69444, 0, 0],
- "928": [0, 0.69444, 0, 0],
- "931": [0, 0.69444, 0, 0],
- "933": [0, 0.69444, 0, 0],
- "934": [0, 0.69444, 0, 0],
- "936": [0, 0.69444, 0, 0],
- "937": [0, 0.69444, 0, 0],
- "8211": [0, 0.44444, 0.02778, 0],
- "8212": [0, 0.44444, 0.02778, 0],
- "8216": [0, 0.69444, 0, 0],
- "8217": [0, 0.69444, 0, 0],
- "8220": [0, 0.69444, 0, 0],
- "8221": [0, 0.69444, 0, 0],
- },
- "Script-Regular": {
- "65": [0, 0.7, 0.22925, 0],
- "66": [0, 0.7, 0.04087, 0],
- "67": [0, 0.7, 0.1689, 0],
- "68": [0, 0.7, 0.09371, 0],
- "69": [0, 0.7, 0.18583, 0],
- "70": [0, 0.7, 0.13634, 0],
- "71": [0, 0.7, 0.17322, 0],
- "72": [0, 0.7, 0.29694, 0],
- "73": [0, 0.7, 0.19189, 0],
- "74": [0.27778, 0.7, 0.19189, 0],
- "75": [0, 0.7, 0.31259, 0],
- "76": [0, 0.7, 0.19189, 0],
- "77": [0, 0.7, 0.15981, 0],
- "78": [0, 0.7, 0.3525, 0],
- "79": [0, 0.7, 0.08078, 0],
- "80": [0, 0.7, 0.08078, 0],
- "81": [0, 0.7, 0.03305, 0],
- "82": [0, 0.7, 0.06259, 0],
- "83": [0, 0.7, 0.19189, 0],
- "84": [0, 0.7, 0.29087, 0],
- "85": [0, 0.7, 0.25815, 0],
- "86": [0, 0.7, 0.27523, 0],
- "87": [0, 0.7, 0.27523, 0],
- "88": [0, 0.7, 0.26006, 0],
- "89": [0, 0.7, 0.2939, 0],
- "90": [0, 0.7, 0.24037, 0],
- },
- "Size1-Regular": {
- "40": [0.35001, 0.85, 0, 0],
- "41": [0.35001, 0.85, 0, 0],
- "47": [0.35001, 0.85, 0, 0],
- "91": [0.35001, 0.85, 0, 0],
- "92": [0.35001, 0.85, 0, 0],
- "93": [0.35001, 0.85, 0, 0],
- "123": [0.35001, 0.85, 0, 0],
- "125": [0.35001, 0.85, 0, 0],
- "710": [0, 0.72222, 0, 0],
- "732": [0, 0.72222, 0, 0],
- "770": [0, 0.72222, 0, 0],
- "771": [0, 0.72222, 0, 0],
- "8214": [-0.00099, 0.601, 0, 0],
- "8593": [1e-05, 0.6, 0, 0],
- "8595": [1e-05, 0.6, 0, 0],
- "8657": [1e-05, 0.6, 0, 0],
- "8659": [1e-05, 0.6, 0, 0],
- "8719": [0.25001, 0.75, 0, 0],
- "8720": [0.25001, 0.75, 0, 0],
- "8721": [0.25001, 0.75, 0, 0],
- "8730": [0.35001, 0.85, 0, 0],
- "8739": [-0.00599, 0.606, 0, 0],
- "8741": [-0.00599, 0.606, 0, 0],
- "8747": [0.30612, 0.805, 0.19445, 0],
- "8748": [0.306, 0.805, 0.19445, 0],
- "8749": [0.306, 0.805, 0.19445, 0],
- "8750": [0.30612, 0.805, 0.19445, 0],
- "8896": [0.25001, 0.75, 0, 0],
- "8897": [0.25001, 0.75, 0, 0],
- "8898": [0.25001, 0.75, 0, 0],
- "8899": [0.25001, 0.75, 0, 0],
- "8968": [0.35001, 0.85, 0, 0],
- "8969": [0.35001, 0.85, 0, 0],
- "8970": [0.35001, 0.85, 0, 0],
- "8971": [0.35001, 0.85, 0, 0],
- "9168": [-0.00099, 0.601, 0, 0],
- "10216": [0.35001, 0.85, 0, 0],
- "10217": [0.35001, 0.85, 0, 0],
- "10752": [0.25001, 0.75, 0, 0],
- "10753": [0.25001, 0.75, 0, 0],
- "10754": [0.25001, 0.75, 0, 0],
- "10756": [0.25001, 0.75, 0, 0],
- "10758": [0.25001, 0.75, 0, 0],
- },
- "Size2-Regular": {
- "40": [0.65002, 1.15, 0, 0],
- "41": [0.65002, 1.15, 0, 0],
- "47": [0.65002, 1.15, 0, 0],
- "91": [0.65002, 1.15, 0, 0],
- "92": [0.65002, 1.15, 0, 0],
- "93": [0.65002, 1.15, 0, 0],
- "123": [0.65002, 1.15, 0, 0],
- "125": [0.65002, 1.15, 0, 0],
- "710": [0, 0.75, 0, 0],
- "732": [0, 0.75, 0, 0],
- "770": [0, 0.75, 0, 0],
- "771": [0, 0.75, 0, 0],
- "8719": [0.55001, 1.05, 0, 0],
- "8720": [0.55001, 1.05, 0, 0],
- "8721": [0.55001, 1.05, 0, 0],
- "8730": [0.65002, 1.15, 0, 0],
- "8747": [0.86225, 1.36, 0.44445, 0],
- "8748": [0.862, 1.36, 0.44445, 0],
- "8749": [0.862, 1.36, 0.44445, 0],
- "8750": [0.86225, 1.36, 0.44445, 0],
- "8896": [0.55001, 1.05, 0, 0],
- "8897": [0.55001, 1.05, 0, 0],
- "8898": [0.55001, 1.05, 0, 0],
- "8899": [0.55001, 1.05, 0, 0],
- "8968": [0.65002, 1.15, 0, 0],
- "8969": [0.65002, 1.15, 0, 0],
- "8970": [0.65002, 1.15, 0, 0],
- "8971": [0.65002, 1.15, 0, 0],
- "10216": [0.65002, 1.15, 0, 0],
- "10217": [0.65002, 1.15, 0, 0],
- "10752": [0.55001, 1.05, 0, 0],
- "10753": [0.55001, 1.05, 0, 0],
- "10754": [0.55001, 1.05, 0, 0],
- "10756": [0.55001, 1.05, 0, 0],
- "10758": [0.55001, 1.05, 0, 0],
- },
- "Size3-Regular": {
- "40": [0.95003, 1.45, 0, 0],
- "41": [0.95003, 1.45, 0, 0],
- "47": [0.95003, 1.45, 0, 0],
- "91": [0.95003, 1.45, 0, 0],
- "92": [0.95003, 1.45, 0, 0],
- "93": [0.95003, 1.45, 0, 0],
- "123": [0.95003, 1.45, 0, 0],
- "125": [0.95003, 1.45, 0, 0],
- "710": [0, 0.75, 0, 0],
- "732": [0, 0.75, 0, 0],
- "770": [0, 0.75, 0, 0],
- "771": [0, 0.75, 0, 0],
- "8730": [0.95003, 1.45, 0, 0],
- "8968": [0.95003, 1.45, 0, 0],
- "8969": [0.95003, 1.45, 0, 0],
- "8970": [0.95003, 1.45, 0, 0],
- "8971": [0.95003, 1.45, 0, 0],
- "10216": [0.95003, 1.45, 0, 0],
- "10217": [0.95003, 1.45, 0, 0],
- },
- "Size4-Regular": {
- "40": [1.25003, 1.75, 0, 0],
- "41": [1.25003, 1.75, 0, 0],
- "47": [1.25003, 1.75, 0, 0],
- "91": [1.25003, 1.75, 0, 0],
- "92": [1.25003, 1.75, 0, 0],
- "93": [1.25003, 1.75, 0, 0],
- "123": [1.25003, 1.75, 0, 0],
- "125": [1.25003, 1.75, 0, 0],
- "710": [0, 0.825, 0, 0],
- "732": [0, 0.825, 0, 0],
- "770": [0, 0.825, 0, 0],
- "771": [0, 0.825, 0, 0],
- "8730": [1.25003, 1.75, 0, 0],
- "8968": [1.25003, 1.75, 0, 0],
- "8969": [1.25003, 1.75, 0, 0],
- "8970": [1.25003, 1.75, 0, 0],
- "8971": [1.25003, 1.75, 0, 0],
- "9115": [0.64502, 1.155, 0, 0],
- "9116": [1e-05, 0.6, 0, 0],
- "9117": [0.64502, 1.155, 0, 0],
- "9118": [0.64502, 1.155, 0, 0],
- "9119": [1e-05, 0.6, 0, 0],
- "9120": [0.64502, 1.155, 0, 0],
- "9121": [0.64502, 1.155, 0, 0],
- "9122": [-0.00099, 0.601, 0, 0],
- "9123": [0.64502, 1.155, 0, 0],
- "9124": [0.64502, 1.155, 0, 0],
- "9125": [-0.00099, 0.601, 0, 0],
- "9126": [0.64502, 1.155, 0, 0],
- "9127": [1e-05, 0.9, 0, 0],
- "9128": [0.65002, 1.15, 0, 0],
- "9129": [0.90001, 0, 0, 0],
- "9130": [0, 0.3, 0, 0],
- "9131": [1e-05, 0.9, 0, 0],
- "9132": [0.65002, 1.15, 0, 0],
- "9133": [0.90001, 0, 0, 0],
- "9143": [0.88502, 0.915, 0, 0],
- "10216": [1.25003, 1.75, 0, 0],
- "10217": [1.25003, 1.75, 0, 0],
- "57344": [-0.00499, 0.605, 0, 0],
- "57345": [-0.00499, 0.605, 0, 0],
- "57680": [0, 0.12, 0, 0],
- "57681": [0, 0.12, 0, 0],
- "57682": [0, 0.12, 0, 0],
- "57683": [0, 0.12, 0, 0],
- },
- "Typewriter-Regular": {
- "33": [0, 0.61111, 0, 0],
- "34": [0, 0.61111, 0, 0],
- "35": [0, 0.61111, 0, 0],
- "36": [0.08333, 0.69444, 0, 0],
- "37": [0.08333, 0.69444, 0, 0],
- "38": [0, 0.61111, 0, 0],
- "39": [0, 0.61111, 0, 0],
- "40": [0.08333, 0.69444, 0, 0],
- "41": [0.08333, 0.69444, 0, 0],
- "42": [0, 0.52083, 0, 0],
- "43": [-0.08056, 0.53055, 0, 0],
- "44": [0.13889, 0.125, 0, 0],
- "45": [-0.08056, 0.53055, 0, 0],
- "46": [0, 0.125, 0, 0],
- "47": [0.08333, 0.69444, 0, 0],
- "48": [0, 0.61111, 0, 0],
- "49": [0, 0.61111, 0, 0],
- "50": [0, 0.61111, 0, 0],
- "51": [0, 0.61111, 0, 0],
- "52": [0, 0.61111, 0, 0],
- "53": [0, 0.61111, 0, 0],
- "54": [0, 0.61111, 0, 0],
- "55": [0, 0.61111, 0, 0],
- "56": [0, 0.61111, 0, 0],
- "57": [0, 0.61111, 0, 0],
- "58": [0, 0.43056, 0, 0],
- "59": [0.13889, 0.43056, 0, 0],
- "60": [-0.05556, 0.55556, 0, 0],
- "61": [-0.19549, 0.41562, 0, 0],
- "62": [-0.05556, 0.55556, 0, 0],
- "63": [0, 0.61111, 0, 0],
- "64": [0, 0.61111, 0, 0],
- "65": [0, 0.61111, 0, 0],
- "66": [0, 0.61111, 0, 0],
- "67": [0, 0.61111, 0, 0],
- "68": [0, 0.61111, 0, 0],
- "69": [0, 0.61111, 0, 0],
- "70": [0, 0.61111, 0, 0],
- "71": [0, 0.61111, 0, 0],
- "72": [0, 0.61111, 0, 0],
- "73": [0, 0.61111, 0, 0],
- "74": [0, 0.61111, 0, 0],
- "75": [0, 0.61111, 0, 0],
- "76": [0, 0.61111, 0, 0],
- "77": [0, 0.61111, 0, 0],
- "78": [0, 0.61111, 0, 0],
- "79": [0, 0.61111, 0, 0],
- "80": [0, 0.61111, 0, 0],
- "81": [0.13889, 0.61111, 0, 0],
- "82": [0, 0.61111, 0, 0],
- "83": [0, 0.61111, 0, 0],
- "84": [0, 0.61111, 0, 0],
- "85": [0, 0.61111, 0, 0],
- "86": [0, 0.61111, 0, 0],
- "87": [0, 0.61111, 0, 0],
- "88": [0, 0.61111, 0, 0],
- "89": [0, 0.61111, 0, 0],
- "90": [0, 0.61111, 0, 0],
- "91": [0.08333, 0.69444, 0, 0],
- "92": [0.08333, 0.69444, 0, 0],
- "93": [0.08333, 0.69444, 0, 0],
- "94": [0, 0.61111, 0, 0],
- "95": [0.09514, 0, 0, 0],
- "96": [0, 0.61111, 0, 0],
- "97": [0, 0.43056, 0, 0],
- "98": [0, 0.61111, 0, 0],
- "99": [0, 0.43056, 0, 0],
- "100": [0, 0.61111, 0, 0],
- "101": [0, 0.43056, 0, 0],
- "102": [0, 0.61111, 0, 0],
- "103": [0.22222, 0.43056, 0, 0],
- "104": [0, 0.61111, 0, 0],
- "105": [0, 0.61111, 0, 0],
- "106": [0.22222, 0.61111, 0, 0],
- "107": [0, 0.61111, 0, 0],
- "108": [0, 0.61111, 0, 0],
- "109": [0, 0.43056, 0, 0],
- "110": [0, 0.43056, 0, 0],
- "111": [0, 0.43056, 0, 0],
- "112": [0.22222, 0.43056, 0, 0],
- "113": [0.22222, 0.43056, 0, 0],
- "114": [0, 0.43056, 0, 0],
- "115": [0, 0.43056, 0, 0],
- "116": [0, 0.55358, 0, 0],
- "117": [0, 0.43056, 0, 0],
- "118": [0, 0.43056, 0, 0],
- "119": [0, 0.43056, 0, 0],
- "120": [0, 0.43056, 0, 0],
- "121": [0.22222, 0.43056, 0, 0],
- "122": [0, 0.43056, 0, 0],
- "123": [0.08333, 0.69444, 0, 0],
- "124": [0.08333, 0.69444, 0, 0],
- "125": [0.08333, 0.69444, 0, 0],
- "126": [0, 0.61111, 0, 0],
- "127": [0, 0.61111, 0, 0],
- "305": [0, 0.43056, 0, 0],
- "567": [0.22222, 0.43056, 0, 0],
- "768": [0, 0.61111, 0, 0],
- "769": [0, 0.61111, 0, 0],
- "770": [0, 0.61111, 0, 0],
- "771": [0, 0.61111, 0, 0],
- "772": [0, 0.56555, 0, 0],
- "774": [0, 0.61111, 0, 0],
- "776": [0, 0.61111, 0, 0],
- "778": [0, 0.61111, 0, 0],
- "780": [0, 0.56597, 0, 0],
- "915": [0, 0.61111, 0, 0],
- "916": [0, 0.61111, 0, 0],
- "920": [0, 0.61111, 0, 0],
- "923": [0, 0.61111, 0, 0],
- "926": [0, 0.61111, 0, 0],
- "928": [0, 0.61111, 0, 0],
- "931": [0, 0.61111, 0, 0],
- "933": [0, 0.61111, 0, 0],
- "934": [0, 0.61111, 0, 0],
- "936": [0, 0.61111, 0, 0],
- "937": [0, 0.61111, 0, 0],
- "2018": [0, 0.61111, 0, 0],
- "2019": [0, 0.61111, 0, 0],
- "8242": [0, 0.61111, 0, 0],
- },
-};
-
-},{}],313:[function(require,module,exports){
-var utils = require("./utils");
-var ParseError = require("./ParseError");
-
-/* This file contains a list of functions that we parse, identified by
- * the calls to defineFunction.
- *
- * The first argument to defineFunction is a single name or a list of names.
- * All functions named in such a list will share a single implementation.
- *
- * Each declared function can have associated properties, which
- * include the following:
- *
- * - numArgs: The number of arguments the function takes.
- * If this is the only property, it can be passed as a number
- * instead of an element of a properties object.
- * - argTypes: (optional) An array corresponding to each argument of the
- * function, giving the type of argument that should be parsed. Its
- * length should be equal to `numArgs + numOptionalArgs`. Valid
- * types:
- * - "size": A size-like thing, such as "1em" or "5ex"
- * - "color": An html color, like "#abc" or "blue"
- * - "original": The same type as the environment that the
- * function being parsed is in (e.g. used for the
- * bodies of functions like \color where the first
- * argument is special and the second argument is
- * parsed normally)
- * Other possible types (probably shouldn't be used)
- * - "text": Text-like (e.g. \text)
- * - "math": Normal math
- * If undefined, this will be treated as an appropriate length
- * array of "original" strings
- * - greediness: (optional) The greediness of the function to use ungrouped
- * arguments.
- *
- * E.g. if you have an expression
- * \sqrt \frac 1 2
- * since \frac has greediness=2 vs \sqrt's greediness=1, \frac
- * will use the two arguments '1' and '2' as its two arguments,
- * then that whole function will be used as the argument to
- * \sqrt. On the other hand, the expressions
- * \frac \frac 1 2 3
- * and
- * \frac \sqrt 1 2
- * will fail because \frac and \frac have equal greediness
- * and \sqrt has a lower greediness than \frac respectively. To
- * make these parse, we would have to change them to:
- * \frac {\frac 1 2} 3
- * and
- * \frac {\sqrt 1} 2
- *
- * The default value is `1`
- * - allowedInText: (optional) Whether or not the function is allowed inside
- * text mode (default false)
- * - numOptionalArgs: (optional) The number of optional arguments the function
- * should parse. If the optional arguments aren't found,
- * `null` will be passed to the handler in their place.
- * (default 0)
- *
- * The last argument is that implementation, the handler for the function(s).
- * It is called to handle these functions and their arguments.
- * It receives two arguments:
- * - context contains information and references provided by the parser
- * - args is an array of arguments obtained from TeX input
- * The context contains the following properties:
- * - funcName: the text (i.e. name) of the function, including \
- * - parser: the parser object
- * - lexer: the lexer object
- * - positions: the positions in the overall string of the function
- * and the arguments.
- * The latter three should only be used to produce error messages.
- *
- * The function should return an object with the following keys:
- * - type: The type of element that this is. This is then used in
- * buildHTML/buildMathML to determine which function
- * should be called to build this node into a DOM node
- * Any other data can be added to the object, which will be passed
- * in to the function in buildHTML/buildMathML as `group.value`.
- */
-
-function defineFunction(names, props, handler) {
- if (typeof names === "string") {
- names = [names];
- }
- if (typeof props === "number") {
- props = { numArgs: props };
- }
- // Set default values of functions
- var data = {
- numArgs: props.numArgs,
- argTypes: props.argTypes,
- greediness: (props.greediness === undefined) ? 1 : props.greediness,
- allowedInText: !!props.allowedInText,
- numOptionalArgs: props.numOptionalArgs || 0,
- handler: handler,
- };
- for (var i = 0; i < names.length; ++i) {
- module.exports[names[i]] = data;
- }
-}
-
-// A normal square root
-defineFunction("\\sqrt", {
- numArgs: 1,
- numOptionalArgs: 1,
-}, function(context, args) {
- var index = args[0];
- var body = args[1];
- return {
- type: "sqrt",
- body: body,
- index: index,
- };
-});
-
-// Some non-mathy text
-defineFunction("\\text", {
- numArgs: 1,
- argTypes: ["text"],
- greediness: 2,
-}, function(context, args) {
- var body = args[0];
- // Since the corresponding buildHTML/buildMathML function expects a
- // list of elements, we normalize for different kinds of arguments
- // TODO(emily): maybe this should be done somewhere else
- var inner;
- if (body.type === "ordgroup") {
- inner = body.value;
- } else {
- inner = [body];
- }
-
- return {
- type: "text",
- body: inner,
- };
-});
-
-// A two-argument custom color
-defineFunction("\\color", {
- numArgs: 2,
- allowedInText: true,
- greediness: 3,
- argTypes: ["color", "original"],
-}, function(context, args) {
- var color = args[0];
- var body = args[1];
- // Normalize the different kinds of bodies (see \text above)
- var inner;
- if (body.type === "ordgroup") {
- inner = body.value;
- } else {
- inner = [body];
- }
-
- return {
- type: "color",
- color: color.value,
- value: inner,
- };
-});
-
-// An overline
-defineFunction("\\overline", {
- numArgs: 1,
-}, function(context, args) {
- var body = args[0];
- return {
- type: "overline",
- body: body,
- };
-});
-
-// An underline
-defineFunction("\\underline", {
- numArgs: 1,
-}, function(context, args) {
- var body = args[0];
- return {
- type: "underline",
- body: body,
- };
-});
-
-// A box of the width and height
-defineFunction("\\rule", {
- numArgs: 2,
- numOptionalArgs: 1,
- argTypes: ["size", "size", "size"],
-}, function(context, args) {
- var shift = args[0];
- var width = args[1];
- var height = args[2];
- return {
- type: "rule",
- shift: shift && shift.value,
- width: width.value,
- height: height.value,
- };
-});
-
-// A KaTeX logo
-defineFunction("\\KaTeX", {
- numArgs: 0,
-}, function(context) {
- return {
- type: "katex",
- };
-});
-
-defineFunction("\\phantom", {
- numArgs: 1,
-}, function(context, args) {
- var body = args[0];
- var inner;
- if (body.type === "ordgroup") {
- inner = body.value;
- } else {
- inner = [body];
- }
-
- return {
- type: "phantom",
- value: inner,
- };
-});
-
-// Extra data needed for the delimiter handler down below
-var delimiterSizes = {
- "\\bigl" : {type: "open", size: 1},
- "\\Bigl" : {type: "open", size: 2},
- "\\biggl": {type: "open", size: 3},
- "\\Biggl": {type: "open", size: 4},
- "\\bigr" : {type: "close", size: 1},
- "\\Bigr" : {type: "close", size: 2},
- "\\biggr": {type: "close", size: 3},
- "\\Biggr": {type: "close", size: 4},
- "\\bigm" : {type: "rel", size: 1},
- "\\Bigm" : {type: "rel", size: 2},
- "\\biggm": {type: "rel", size: 3},
- "\\Biggm": {type: "rel", size: 4},
- "\\big" : {type: "textord", size: 1},
- "\\Big" : {type: "textord", size: 2},
- "\\bigg" : {type: "textord", size: 3},
- "\\Bigg" : {type: "textord", size: 4},
-};
-
-var delimiters = [
- "(", ")", "[", "\\lbrack", "]", "\\rbrack",
- "\\{", "\\lbrace", "\\}", "\\rbrace",
- "\\lfloor", "\\rfloor", "\\lceil", "\\rceil",
- "<", ">", "\\langle", "\\rangle", "\\lt", "\\gt",
- "\\lvert", "\\rvert", "\\lVert", "\\rVert",
- "\\lgroup", "\\rgroup", "\\lmoustache", "\\rmoustache",
- "/", "\\backslash",
- "|", "\\vert", "\\|", "\\Vert",
- "\\uparrow", "\\Uparrow",
- "\\downarrow", "\\Downarrow",
- "\\updownarrow", "\\Updownarrow",
- ".",
-];
-
-var fontAliases = {
- "\\Bbb": "\\mathbb",
- "\\bold": "\\mathbf",
- "\\frak": "\\mathfrak",
-};
-
-// Single-argument color functions
-defineFunction([
- "\\blue", "\\orange", "\\pink", "\\red",
- "\\green", "\\gray", "\\purple",
- "\\blueA", "\\blueB", "\\blueC", "\\blueD", "\\blueE",
- "\\tealA", "\\tealB", "\\tealC", "\\tealD", "\\tealE",
- "\\greenA", "\\greenB", "\\greenC", "\\greenD", "\\greenE",
- "\\goldA", "\\goldB", "\\goldC", "\\goldD", "\\goldE",
- "\\redA", "\\redB", "\\redC", "\\redD", "\\redE",
- "\\maroonA", "\\maroonB", "\\maroonC", "\\maroonD", "\\maroonE",
- "\\purpleA", "\\purpleB", "\\purpleC", "\\purpleD", "\\purpleE",
- "\\mintA", "\\mintB", "\\mintC",
- "\\grayA", "\\grayB", "\\grayC", "\\grayD", "\\grayE",
- "\\grayF", "\\grayG", "\\grayH", "\\grayI",
- "\\kaBlue", "\\kaGreen",
-], {
- numArgs: 1,
- allowedInText: true,
- greediness: 3,
-}, function(context, args) {
- var body = args[0];
- var atoms;
- if (body.type === "ordgroup") {
- atoms = body.value;
- } else {
- atoms = [body];
- }
-
- return {
- type: "color",
- color: "katex-" + context.funcName.slice(1),
- value: atoms,
- };
-});
-
-// There are 2 flags for operators; whether they produce limits in
-// displaystyle, and whether they are symbols and should grow in
-// displaystyle. These four groups cover the four possible choices.
-
-// No limits, not symbols
-defineFunction([
- "\\arcsin", "\\arccos", "\\arctan", "\\arg", "\\cos", "\\cosh",
- "\\cot", "\\coth", "\\csc", "\\deg", "\\dim", "\\exp", "\\hom",
- "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh",
- "\\tan", "\\tanh",
-], {
- numArgs: 0,
-}, function(context) {
- return {
- type: "op",
- limits: false,
- symbol: false,
- body: context.funcName,
- };
-});
-
-// Limits, not symbols
-defineFunction([
- "\\det", "\\gcd", "\\inf", "\\lim", "\\liminf", "\\limsup", "\\max",
- "\\min", "\\Pr", "\\sup",
-], {
- numArgs: 0,
-}, function(context) {
- return {
- type: "op",
- limits: true,
- symbol: false,
- body: context.funcName,
- };
-});
-
-// No limits, symbols
-defineFunction([
- "\\int", "\\iint", "\\iiint", "\\oint",
-], {
- numArgs: 0,
-}, function(context) {
- return {
- type: "op",
- limits: false,
- symbol: true,
- body: context.funcName,
- };
-});
-
-// Limits, symbols
-defineFunction([
- "\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap",
- "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes",
- "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint",
-], {
- numArgs: 0,
-}, function(context) {
- return {
- type: "op",
- limits: true,
- symbol: true,
- body: context.funcName,
- };
-});
-
-// Fractions
-defineFunction([
- "\\dfrac", "\\frac", "\\tfrac",
- "\\dbinom", "\\binom", "\\tbinom",
-], {
- numArgs: 2,
- greediness: 2,
-}, function(context, args) {
- var numer = args[0];
- var denom = args[1];
- var hasBarLine;
- var leftDelim = null;
- var rightDelim = null;
- var size = "auto";
-
- switch (context.funcName) {
- case "\\dfrac":
- case "\\frac":
- case "\\tfrac":
- hasBarLine = true;
- break;
- case "\\dbinom":
- case "\\binom":
- case "\\tbinom":
- hasBarLine = false;
- leftDelim = "(";
- rightDelim = ")";
- break;
- default:
- throw new Error("Unrecognized genfrac command");
- }
-
- switch (context.funcName) {
- case "\\dfrac":
- case "\\dbinom":
- size = "display";
- break;
- case "\\tfrac":
- case "\\tbinom":
- size = "text";
- break;
- }
-
- return {
- type: "genfrac",
- numer: numer,
- denom: denom,
- hasBarLine: hasBarLine,
- leftDelim: leftDelim,
- rightDelim: rightDelim,
- size: size,
- };
-});
-
-// Left and right overlap functions
-defineFunction(["\\llap", "\\rlap"], {
- numArgs: 1,
- allowedInText: true,
-}, function(context, args) {
- var body = args[0];
- return {
- type: context.funcName.slice(1),
- body: body,
- };
-});
-
-// Delimiter functions
-defineFunction([
- "\\bigl", "\\Bigl", "\\biggl", "\\Biggl",
- "\\bigr", "\\Bigr", "\\biggr", "\\Biggr",
- "\\bigm", "\\Bigm", "\\biggm", "\\Biggm",
- "\\big", "\\Big", "\\bigg", "\\Bigg",
- "\\left", "\\right",
-], {
- numArgs: 1,
-}, function(context, args) {
- var delim = args[0];
- if (!utils.contains(delimiters, delim.value)) {
- throw new ParseError(
- "Invalid delimiter: '" + delim.value + "' after '" +
- context.funcName + "'",
- context.lexer, context.positions[1]);
- }
-
- // \left and \right are caught somewhere in Parser.js, which is
- // why this data doesn't match what is in buildHTML.
- if (context.funcName === "\\left" || context.funcName === "\\right") {
- return {
- type: "leftright",
- value: delim.value,
- };
- } else {
- return {
- type: "delimsizing",
- size: delimiterSizes[context.funcName].size,
- delimType: delimiterSizes[context.funcName].type,
- value: delim.value,
- };
- }
-});
-
-// Sizing functions (handled in Parser.js explicitly, hence no handler)
-defineFunction([
- "\\tiny", "\\scriptsize", "\\footnotesize", "\\small",
- "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge",
-], 0, null);
-
-// Style changing functions (handled in Parser.js explicitly, hence no
-// handler)
-defineFunction([
- "\\displaystyle", "\\textstyle", "\\scriptstyle",
- "\\scriptscriptstyle",
-], 0, null);
-
-defineFunction([
- // styles
- "\\mathrm", "\\mathit", "\\mathbf",
-
- // families
- "\\mathbb", "\\mathcal", "\\mathfrak", "\\mathscr", "\\mathsf",
- "\\mathtt",
-
- // aliases
- "\\Bbb", "\\bold", "\\frak",
-], {
- numArgs: 1,
- greediness: 2,
-}, function(context, args) {
- var body = args[0];
- var func = context.funcName;
- if (func in fontAliases) {
- func = fontAliases[func];
- }
- return {
- type: "font",
- font: func.slice(1),
- body: body,
- };
-});
-
-// Accents
-defineFunction([
- "\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve",
- "\\check", "\\hat", "\\vec", "\\dot",
- // We don't support expanding accents yet
- // "\\widetilde", "\\widehat"
-], {
- numArgs: 1,
-}, function(context, args) {
- var base = args[0];
- return {
- type: "accent",
- accent: context.funcName,
- base: base,
- };
-});
-
-// Infix generalized fractions
-defineFunction(["\\over", "\\choose"], {
- numArgs: 0,
-}, function(context) {
- var replaceWith;
- switch (context.funcName) {
- case "\\over":
- replaceWith = "\\frac";
- break;
- case "\\choose":
- replaceWith = "\\binom";
- break;
- default:
- throw new Error("Unrecognized infix genfrac command");
- }
- return {
- type: "infix",
- replaceWith: replaceWith,
- };
-});
-
-// Row breaks for aligned data
-defineFunction(["\\\\", "\\cr"], {
- numArgs: 0,
- numOptionalArgs: 1,
- argTypes: ["size"],
-}, function(context, args) {
- var size = args[0];
- return {
- type: "cr",
- size: size,
- };
-});
-
-// Environment delimiters
-defineFunction(["\\begin", "\\end"], {
- numArgs: 1,
- argTypes: ["text"],
-}, function(context, args) {
- var nameGroup = args[0];
- if (nameGroup.type !== "ordgroup") {
- throw new ParseError(
- "Invalid environment name",
- context.lexer, context.positions[1]);
- }
- var name = "";
- for (var i = 0; i < nameGroup.value.length; ++i) {
- name += nameGroup.value[i].value;
- }
- return {
- type: "environment",
- name: name,
- namepos: context.positions[1],
- };
-});
-
-},{"./ParseError":300,"./utils":318}],314:[function(require,module,exports){
-/**
- * These objects store data about MathML nodes. This is the MathML equivalent
- * of the types in domTree.js. Since MathML handles its own rendering, and
- * since we're mainly using MathML to improve accessibility, we don't manage
- * any of the styling state that the plain DOM nodes do.
- *
- * The `toNode` and `toMarkup` functions work simlarly to how they do in
- * domTree.js, creating namespaced DOM nodes and HTML text markup respectively.
- */
-
-var utils = require("./utils");
-
-/**
- * This node represents a general purpose MathML node of any type. The
- * constructor requires the type of node to create (for example, `"mo"` or
- * `"mspace"`, corresponding to `<mo>` and `<mspace>` tags).
- */
-function MathNode(type, children) {
- this.type = type;
- this.attributes = {};
- this.children = children || [];
-}
-
-/**
- * Sets an attribute on a MathML node. MathML depends on attributes to convey a
- * semantic content, so this is used heavily.
- */
-MathNode.prototype.setAttribute = function(name, value) {
- this.attributes[name] = value;
-};
-
-/**
- * Converts the math node into a MathML-namespaced DOM element.
- */
-MathNode.prototype.toNode = function() {
- var node = document.createElementNS(
- "http://www.w3.org/1998/Math/MathML", this.type);
-
- for (var attr in this.attributes) {
- if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
- node.setAttribute(attr, this.attributes[attr]);
- }
- }
-
- for (var i = 0; i < this.children.length; i++) {
- node.appendChild(this.children[i].toNode());
- }
-
- return node;
-};
-
-/**
- * Converts the math node into an HTML markup string.
- */
-MathNode.prototype.toMarkup = function() {
- var markup = "<" + this.type;
-
- // Add the attributes
- for (var attr in this.attributes) {
- if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
- markup += " " + attr + "=\"";
- markup += utils.escape(this.attributes[attr]);
- markup += "\"";
- }
- }
-
- markup += ">";
-
- for (var i = 0; i < this.children.length; i++) {
- markup += this.children[i].toMarkup();
- }
-
- markup += "</" + this.type + ">";
-
- return markup;
-};
-
-/**
- * This node represents a piece of text.
- */
-function TextNode(text) {
- this.text = text;
-}
-
-/**
- * Converts the text node into a DOM text node.
- */
-TextNode.prototype.toNode = function() {
- return document.createTextNode(this.text);
-};
-
-/**
- * Converts the text node into HTML markup (which is just the text itself).
- */
-TextNode.prototype.toMarkup = function() {
- return utils.escape(this.text);
-};
-
-module.exports = {
- MathNode: MathNode,
- TextNode: TextNode,
-};
-
-},{"./utils":318}],315:[function(require,module,exports){
-/**
- * The resulting parse tree nodes of the parse tree.
- */
-function ParseNode(type, value, mode) {
- this.type = type;
- this.value = value;
- this.mode = mode;
-}
-
-module.exports = {
- ParseNode: ParseNode,
-};
-
-
-},{}],316:[function(require,module,exports){
-/**
- * Provides a single function for parsing an expression using a Parser
- * TODO(emily): Remove this
- */
-
-var Parser = require("./Parser");
-
-/**
- * Parses an expression using a Parser, then returns the parsed result.
- */
-var parseTree = function(toParse, settings) {
- var parser = new Parser(toParse, settings);
-
- return parser.parse();
-};
-
-module.exports = parseTree;
-
-},{"./Parser":301}],317:[function(require,module,exports){
-/**
- * This file holds a list of all no-argument functions and single-character
- * symbols (like 'a' or ';').
- *
- * For each of the symbols, there are three properties they can have:
- * - font (required): the font to be used for this symbol. Either "main" (the
- normal font), or "ams" (the ams fonts).
- * - group (required): the ParseNode group type the symbol should have (i.e.
- "textord", "mathord", etc).
- See https://github.com/Khan/KaTeX/wiki/Examining-TeX#group-types
- * - replace: the character that this symbol or function should be
- * replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi
- * character in the main font).
- *
- * The outermost map in the table indicates what mode the symbols should be
- * accepted in (e.g. "math" or "text").
- */
-
-module.exports = {
- math: {},
- text: {},
-};
-
-function defineSymbol(mode, font, group, replace, name) {
- module.exports[mode][name] = {
- font: font,
- group: group,
- replace: replace,
- };
-}
-
-// Some abbreviations for commonly used strings.
-// This helps minify the code, and also spotting typos using jshint.
-
-// modes:
-var math = "math";
-var text = "text";
-
-// fonts:
-var main = "main";
-var ams = "ams";
-
-// groups:
-var accent = "accent";
-var bin = "bin";
-var close = "close";
-var inner = "inner";
-var mathord = "mathord";
-var op = "op";
-var open = "open";
-var punct = "punct";
-var rel = "rel";
-var spacing = "spacing";
-var textord = "textord";
-
-// Now comes the symbol table
-
-// Relation Symbols
-defineSymbol(math, main, rel, "\u2261", "\\equiv");
-defineSymbol(math, main, rel, "\u227a", "\\prec");
-defineSymbol(math, main, rel, "\u227b", "\\succ");
-defineSymbol(math, main, rel, "\u223c", "\\sim");
-defineSymbol(math, main, rel, "\u22a5", "\\perp");
-defineSymbol(math, main, rel, "\u2aaf", "\\preceq");
-defineSymbol(math, main, rel, "\u2ab0", "\\succeq");
-defineSymbol(math, main, rel, "\u2243", "\\simeq");
-defineSymbol(math, main, rel, "\u2223", "\\mid");
-defineSymbol(math, main, rel, "\u226a", "\\ll");
-defineSymbol(math, main, rel, "\u226b", "\\gg");
-defineSymbol(math, main, rel, "\u224d", "\\asymp");
-defineSymbol(math, main, rel, "\u2225", "\\parallel");
-defineSymbol(math, main, rel, "\u22c8", "\\bowtie");
-defineSymbol(math, main, rel, "\u2323", "\\smile");
-defineSymbol(math, main, rel, "\u2291", "\\sqsubseteq");
-defineSymbol(math, main, rel, "\u2292", "\\sqsupseteq");
-defineSymbol(math, main, rel, "\u2250", "\\doteq");
-defineSymbol(math, main, rel, "\u2322", "\\frown");
-defineSymbol(math, main, rel, "\u220b", "\\ni");
-defineSymbol(math, main, rel, "\u221d", "\\propto");
-defineSymbol(math, main, rel, "\u22a2", "\\vdash");
-defineSymbol(math, main, rel, "\u22a3", "\\dashv");
-defineSymbol(math, main, rel, "\u220b", "\\owns");
-
-// Punctuation
-defineSymbol(math, main, punct, "\u002e", "\\ldotp");
-defineSymbol(math, main, punct, "\u22c5", "\\cdotp");
-
-// Misc Symbols
-defineSymbol(math, main, textord, "\u0023", "\\#");
-defineSymbol(math, main, textord, "\u0026", "\\&");
-defineSymbol(math, main, textord, "\u2135", "\\aleph");
-defineSymbol(math, main, textord, "\u2200", "\\forall");
-defineSymbol(math, main, textord, "\u210f", "\\hbar");
-defineSymbol(math, main, textord, "\u2203", "\\exists");
-defineSymbol(math, main, textord, "\u2207", "\\nabla");
-defineSymbol(math, main, textord, "\u266d", "\\flat");
-defineSymbol(math, main, textord, "\u2113", "\\ell");
-defineSymbol(math, main, textord, "\u266e", "\\natural");
-defineSymbol(math, main, textord, "\u2663", "\\clubsuit");
-defineSymbol(math, main, textord, "\u2118", "\\wp");
-defineSymbol(math, main, textord, "\u266f", "\\sharp");
-defineSymbol(math, main, textord, "\u2662", "\\diamondsuit");
-defineSymbol(math, main, textord, "\u211c", "\\Re");
-defineSymbol(math, main, textord, "\u2661", "\\heartsuit");
-defineSymbol(math, main, textord, "\u2111", "\\Im");
-defineSymbol(math, main, textord, "\u2660", "\\spadesuit");
-
-// Math and Text
-defineSymbol(math, main, textord, "\u2020", "\\dag");
-defineSymbol(math, main, textord, "\u2021", "\\ddag");
-
-// Large Delimiters
-defineSymbol(math, main, close, "\u23b1", "\\rmoustache");
-defineSymbol(math, main, open, "\u23b0", "\\lmoustache");
-defineSymbol(math, main, close, "\u27ef", "\\rgroup");
-defineSymbol(math, main, open, "\u27ee", "\\lgroup");
-
-// Binary Operators
-defineSymbol(math, main, bin, "\u2213", "\\mp");
-defineSymbol(math, main, bin, "\u2296", "\\ominus");
-defineSymbol(math, main, bin, "\u228e", "\\uplus");
-defineSymbol(math, main, bin, "\u2293", "\\sqcap");
-defineSymbol(math, main, bin, "\u2217", "\\ast");
-defineSymbol(math, main, bin, "\u2294", "\\sqcup");
-defineSymbol(math, main, bin, "\u25ef", "\\bigcirc");
-defineSymbol(math, main, bin, "\u2219", "\\bullet");
-defineSymbol(math, main, bin, "\u2021", "\\ddagger");
-defineSymbol(math, main, bin, "\u2240", "\\wr");
-defineSymbol(math, main, bin, "\u2a3f", "\\amalg");
-
-// Arrow Symbols
-defineSymbol(math, main, rel, "\u27f5", "\\longleftarrow");
-defineSymbol(math, main, rel, "\u21d0", "\\Leftarrow");
-defineSymbol(math, main, rel, "\u27f8", "\\Longleftarrow");
-defineSymbol(math, main, rel, "\u27f6", "\\longrightarrow");
-defineSymbol(math, main, rel, "\u21d2", "\\Rightarrow");
-defineSymbol(math, main, rel, "\u27f9", "\\Longrightarrow");
-defineSymbol(math, main, rel, "\u2194", "\\leftrightarrow");
-defineSymbol(math, main, rel, "\u27f7", "\\longleftrightarrow");
-defineSymbol(math, main, rel, "\u21d4", "\\Leftrightarrow");
-defineSymbol(math, main, rel, "\u27fa", "\\Longleftrightarrow");
-defineSymbol(math, main, rel, "\u21a6", "\\mapsto");
-defineSymbol(math, main, rel, "\u27fc", "\\longmapsto");
-defineSymbol(math, main, rel, "\u2197", "\\nearrow");
-defineSymbol(math, main, rel, "\u21a9", "\\hookleftarrow");
-defineSymbol(math, main, rel, "\u21aa", "\\hookrightarrow");
-defineSymbol(math, main, rel, "\u2198", "\\searrow");
-defineSymbol(math, main, rel, "\u21bc", "\\leftharpoonup");
-defineSymbol(math, main, rel, "\u21c0", "\\rightharpoonup");
-defineSymbol(math, main, rel, "\u2199", "\\swarrow");
-defineSymbol(math, main, rel, "\u21bd", "\\leftharpoondown");
-defineSymbol(math, main, rel, "\u21c1", "\\rightharpoondown");
-defineSymbol(math, main, rel, "\u2196", "\\nwarrow");
-defineSymbol(math, main, rel, "\u21cc", "\\rightleftharpoons");
-
-// AMS Negated Binary Relations
-defineSymbol(math, ams, rel, "\u226e", "\\nless");
-defineSymbol(math, ams, rel, "\ue010", "\\nleqslant");
-defineSymbol(math, ams, rel, "\ue011", "\\nleqq");
-defineSymbol(math, ams, rel, "\u2a87", "\\lneq");
-defineSymbol(math, ams, rel, "\u2268", "\\lneqq");
-defineSymbol(math, ams, rel, "\ue00c", "\\lvertneqq");
-defineSymbol(math, ams, rel, "\u22e6", "\\lnsim");
-defineSymbol(math, ams, rel, "\u2a89", "\\lnapprox");
-defineSymbol(math, ams, rel, "\u2280", "\\nprec");
-defineSymbol(math, ams, rel, "\u22e0", "\\npreceq");
-defineSymbol(math, ams, rel, "\u22e8", "\\precnsim");
-defineSymbol(math, ams, rel, "\u2ab9", "\\precnapprox");
-defineSymbol(math, ams, rel, "\u2241", "\\nsim");
-defineSymbol(math, ams, rel, "\ue006", "\\nshortmid");
-defineSymbol(math, ams, rel, "\u2224", "\\nmid");
-defineSymbol(math, ams, rel, "\u22ac", "\\nvdash");
-defineSymbol(math, ams, rel, "\u22ad", "\\nvDash");
-defineSymbol(math, ams, rel, "\u22ea", "\\ntriangleleft");
-defineSymbol(math, ams, rel, "\u22ec", "\\ntrianglelefteq");
-defineSymbol(math, ams, rel, "\u228a", "\\subsetneq");
-defineSymbol(math, ams, rel, "\ue01a", "\\varsubsetneq");
-defineSymbol(math, ams, rel, "\u2acb", "\\subsetneqq");
-defineSymbol(math, ams, rel, "\ue017", "\\varsubsetneqq");
-defineSymbol(math, ams, rel, "\u226f", "\\ngtr");
-defineSymbol(math, ams, rel, "\ue00f", "\\ngeqslant");
-defineSymbol(math, ams, rel, "\ue00e", "\\ngeqq");
-defineSymbol(math, ams, rel, "\u2a88", "\\gneq");
-defineSymbol(math, ams, rel, "\u2269", "\\gneqq");
-defineSymbol(math, ams, rel, "\ue00d", "\\gvertneqq");
-defineSymbol(math, ams, rel, "\u22e7", "\\gnsim");
-defineSymbol(math, ams, rel, "\u2a8a", "\\gnapprox");
-defineSymbol(math, ams, rel, "\u2281", "\\nsucc");
-defineSymbol(math, ams, rel, "\u22e1", "\\nsucceq");
-defineSymbol(math, ams, rel, "\u22e9", "\\succnsim");
-defineSymbol(math, ams, rel, "\u2aba", "\\succnapprox");
-defineSymbol(math, ams, rel, "\u2246", "\\ncong");
-defineSymbol(math, ams, rel, "\ue007", "\\nshortparallel");
-defineSymbol(math, ams, rel, "\u2226", "\\nparallel");
-defineSymbol(math, ams, rel, "\u22af", "\\nVDash");
-defineSymbol(math, ams, rel, "\u22eb", "\\ntriangleright");
-defineSymbol(math, ams, rel, "\u22ed", "\\ntrianglerighteq");
-defineSymbol(math, ams, rel, "\ue018", "\\nsupseteqq");
-defineSymbol(math, ams, rel, "\u228b", "\\supsetneq");
-defineSymbol(math, ams, rel, "\ue01b", "\\varsupsetneq");
-defineSymbol(math, ams, rel, "\u2acc", "\\supsetneqq");
-defineSymbol(math, ams, rel, "\ue019", "\\varsupsetneqq");
-defineSymbol(math, ams, rel, "\u22ae", "\\nVdash");
-defineSymbol(math, ams, rel, "\u2ab5", "\\precneqq");
-defineSymbol(math, ams, rel, "\u2ab6", "\\succneqq");
-defineSymbol(math, ams, rel, "\ue016", "\\nsubseteqq");
-defineSymbol(math, ams, bin, "\u22b4", "\\unlhd");
-defineSymbol(math, ams, bin, "\u22b5", "\\unrhd");
-
-// AMS Negated Arrows
-defineSymbol(math, ams, rel, "\u219a", "\\nleftarrow");
-defineSymbol(math, ams, rel, "\u219b", "\\nrightarrow");
-defineSymbol(math, ams, rel, "\u21cd", "\\nLeftarrow");
-defineSymbol(math, ams, rel, "\u21cf", "\\nRightarrow");
-defineSymbol(math, ams, rel, "\u21ae", "\\nleftrightarrow");
-defineSymbol(math, ams, rel, "\u21ce", "\\nLeftrightarrow");
-
-// AMS Misc
-defineSymbol(math, ams, rel, "\u25b3", "\\vartriangle");
-defineSymbol(math, ams, textord, "\u210f", "\\hslash");
-defineSymbol(math, ams, textord, "\u25bd", "\\triangledown");
-defineSymbol(math, ams, textord, "\u25ca", "\\lozenge");
-defineSymbol(math, ams, textord, "\u24c8", "\\circledS");
-defineSymbol(math, ams, textord, "\u00ae", "\\circledR");
-defineSymbol(math, ams, textord, "\u2221", "\\measuredangle");
-defineSymbol(math, ams, textord, "\u2204", "\\nexists");
-defineSymbol(math, ams, textord, "\u2127", "\\mho");
-defineSymbol(math, ams, textord, "\u2132", "\\Finv");
-defineSymbol(math, ams, textord, "\u2141", "\\Game");
-defineSymbol(math, ams, textord, "\u006b", "\\Bbbk");
-defineSymbol(math, ams, textord, "\u2035", "\\backprime");
-defineSymbol(math, ams, textord, "\u25b2", "\\blacktriangle");
-defineSymbol(math, ams, textord, "\u25bc", "\\blacktriangledown");
-defineSymbol(math, ams, textord, "\u25a0", "\\blacksquare");
-defineSymbol(math, ams, textord, "\u29eb", "\\blacklozenge");
-defineSymbol(math, ams, textord, "\u2605", "\\bigstar");
-defineSymbol(math, ams, textord, "\u2222", "\\sphericalangle");
-defineSymbol(math, ams, textord, "\u2201", "\\complement");
-defineSymbol(math, ams, textord, "\u00f0", "\\eth");
-defineSymbol(math, ams, textord, "\u2571", "\\diagup");
-defineSymbol(math, ams, textord, "\u2572", "\\diagdown");
-defineSymbol(math, ams, textord, "\u25a1", "\\square");
-defineSymbol(math, ams, textord, "\u25a1", "\\Box");
-defineSymbol(math, ams, textord, "\u25ca", "\\Diamond");
-defineSymbol(math, ams, textord, "\u00a5", "\\yen");
-defineSymbol(math, ams, textord, "\u2713", "\\checkmark");
-
-// AMS Hebrew
-defineSymbol(math, ams, textord, "\u2136", "\\beth");
-defineSymbol(math, ams, textord, "\u2138", "\\daleth");
-defineSymbol(math, ams, textord, "\u2137", "\\gimel");
-
-// AMS Greek
-defineSymbol(math, ams, textord, "\u03dd", "\\digamma");
-defineSymbol(math, ams, textord, "\u03f0", "\\varkappa");
-
-// AMS Delimiters
-defineSymbol(math, ams, open, "\u250c", "\\ulcorner");
-defineSymbol(math, ams, close, "\u2510", "\\urcorner");
-defineSymbol(math, ams, open, "\u2514", "\\llcorner");
-defineSymbol(math, ams, close, "\u2518", "\\lrcorner");
-
-// AMS Binary Relations
-defineSymbol(math, ams, rel, "\u2266", "\\leqq");
-defineSymbol(math, ams, rel, "\u2a7d", "\\leqslant");
-defineSymbol(math, ams, rel, "\u2a95", "\\eqslantless");
-defineSymbol(math, ams, rel, "\u2272", "\\lesssim");
-defineSymbol(math, ams, rel, "\u2a85", "\\lessapprox");
-defineSymbol(math, ams, rel, "\u224a", "\\approxeq");
-defineSymbol(math, ams, bin, "\u22d6", "\\lessdot");
-defineSymbol(math, ams, rel, "\u22d8", "\\lll");
-defineSymbol(math, ams, rel, "\u2276", "\\lessgtr");
-defineSymbol(math, ams, rel, "\u22da", "\\lesseqgtr");
-defineSymbol(math, ams, rel, "\u2a8b", "\\lesseqqgtr");
-defineSymbol(math, ams, rel, "\u2251", "\\doteqdot");
-defineSymbol(math, ams, rel, "\u2253", "\\risingdotseq");
-defineSymbol(math, ams, rel, "\u2252", "\\fallingdotseq");
-defineSymbol(math, ams, rel, "\u223d", "\\backsim");
-defineSymbol(math, ams, rel, "\u22cd", "\\backsimeq");
-defineSymbol(math, ams, rel, "\u2ac5", "\\subseteqq");
-defineSymbol(math, ams, rel, "\u22d0", "\\Subset");
-defineSymbol(math, ams, rel, "\u228f", "\\sqsubset");
-defineSymbol(math, ams, rel, "\u227c", "\\preccurlyeq");
-defineSymbol(math, ams, rel, "\u22de", "\\curlyeqprec");
-defineSymbol(math, ams, rel, "\u227e", "\\precsim");
-defineSymbol(math, ams, rel, "\u2ab7", "\\precapprox");
-defineSymbol(math, ams, rel, "\u22b2", "\\vartriangleleft");
-defineSymbol(math, ams, rel, "\u22b4", "\\trianglelefteq");
-defineSymbol(math, ams, rel, "\u22a8", "\\vDash");
-defineSymbol(math, ams, rel, "\u22aa", "\\Vvdash");
-defineSymbol(math, ams, rel, "\u2323", "\\smallsmile");
-defineSymbol(math, ams, rel, "\u2322", "\\smallfrown");
-defineSymbol(math, ams, rel, "\u224f", "\\bumpeq");
-defineSymbol(math, ams, rel, "\u224e", "\\Bumpeq");
-defineSymbol(math, ams, rel, "\u2267", "\\geqq");
-defineSymbol(math, ams, rel, "\u2a7e", "\\geqslant");
-defineSymbol(math, ams, rel, "\u2a96", "\\eqslantgtr");
-defineSymbol(math, ams, rel, "\u2273", "\\gtrsim");
-defineSymbol(math, ams, rel, "\u2a86", "\\gtrapprox");
-defineSymbol(math, ams, bin, "\u22d7", "\\gtrdot");
-defineSymbol(math, ams, rel, "\u22d9", "\\ggg");
-defineSymbol(math, ams, rel, "\u2277", "\\gtrless");
-defineSymbol(math, ams, rel, "\u22db", "\\gtreqless");
-defineSymbol(math, ams, rel, "\u2a8c", "\\gtreqqless");
-defineSymbol(math, ams, rel, "\u2256", "\\eqcirc");
-defineSymbol(math, ams, rel, "\u2257", "\\circeq");
-defineSymbol(math, ams, rel, "\u225c", "\\triangleq");
-defineSymbol(math, ams, rel, "\u223c", "\\thicksim");
-defineSymbol(math, ams, rel, "\u2248", "\\thickapprox");
-defineSymbol(math, ams, rel, "\u2ac6", "\\supseteqq");
-defineSymbol(math, ams, rel, "\u22d1", "\\Supset");
-defineSymbol(math, ams, rel, "\u2290", "\\sqsupset");
-defineSymbol(math, ams, rel, "\u227d", "\\succcurlyeq");
-defineSymbol(math, ams, rel, "\u22df", "\\curlyeqsucc");
-defineSymbol(math, ams, rel, "\u227f", "\\succsim");
-defineSymbol(math, ams, rel, "\u2ab8", "\\succapprox");
-defineSymbol(math, ams, rel, "\u22b3", "\\vartriangleright");
-defineSymbol(math, ams, rel, "\u22b5", "\\trianglerighteq");
-defineSymbol(math, ams, rel, "\u22a9", "\\Vdash");
-defineSymbol(math, ams, rel, "\u2223", "\\shortmid");
-defineSymbol(math, ams, rel, "\u2225", "\\shortparallel");
-defineSymbol(math, ams, rel, "\u226c", "\\between");
-defineSymbol(math, ams, rel, "\u22d4", "\\pitchfork");
-defineSymbol(math, ams, rel, "\u221d", "\\varpropto");
-defineSymbol(math, ams, rel, "\u25c0", "\\blacktriangleleft");
-defineSymbol(math, ams, rel, "\u2234", "\\therefore");
-defineSymbol(math, ams, rel, "\u220d", "\\backepsilon");
-defineSymbol(math, ams, rel, "\u25b6", "\\blacktriangleright");
-defineSymbol(math, ams, rel, "\u2235", "\\because");
-defineSymbol(math, ams, rel, "\u22d8", "\\llless");
-defineSymbol(math, ams, rel, "\u22d9", "\\gggtr");
-defineSymbol(math, ams, bin, "\u22b2", "\\lhd");
-defineSymbol(math, ams, bin, "\u22b3", "\\rhd");
-defineSymbol(math, ams, rel, "\u2242", "\\eqsim");
-defineSymbol(math, main, rel, "\u22c8", "\\Join");
-defineSymbol(math, ams, rel, "\u2251", "\\Doteq");
-
-// AMS Binary Operators
-defineSymbol(math, ams, bin, "\u2214", "\\dotplus");
-defineSymbol(math, ams, bin, "\u2216", "\\smallsetminus");
-defineSymbol(math, ams, bin, "\u22d2", "\\Cap");
-defineSymbol(math, ams, bin, "\u22d3", "\\Cup");
-defineSymbol(math, ams, bin, "\u2a5e", "\\doublebarwedge");
-defineSymbol(math, ams, bin, "\u229f", "\\boxminus");
-defineSymbol(math, ams, bin, "\u229e", "\\boxplus");
-defineSymbol(math, ams, bin, "\u22c7", "\\divideontimes");
-defineSymbol(math, ams, bin, "\u22c9", "\\ltimes");
-defineSymbol(math, ams, bin, "\u22ca", "\\rtimes");
-defineSymbol(math, ams, bin, "\u22cb", "\\leftthreetimes");
-defineSymbol(math, ams, bin, "\u22cc", "\\rightthreetimes");
-defineSymbol(math, ams, bin, "\u22cf", "\\curlywedge");
-defineSymbol(math, ams, bin, "\u22ce", "\\curlyvee");
-defineSymbol(math, ams, bin, "\u229d", "\\circleddash");
-defineSymbol(math, ams, bin, "\u229b", "\\circledast");
-defineSymbol(math, ams, bin, "\u22c5", "\\centerdot");
-defineSymbol(math, ams, bin, "\u22ba", "\\intercal");
-defineSymbol(math, ams, bin, "\u22d2", "\\doublecap");
-defineSymbol(math, ams, bin, "\u22d3", "\\doublecup");
-defineSymbol(math, ams, bin, "\u22a0", "\\boxtimes");
-
-// AMS Arrows
-defineSymbol(math, ams, rel, "\u21e2", "\\dashrightarrow");
-defineSymbol(math, ams, rel, "\u21e0", "\\dashleftarrow");
-defineSymbol(math, ams, rel, "\u21c7", "\\leftleftarrows");
-defineSymbol(math, ams, rel, "\u21c6", "\\leftrightarrows");
-defineSymbol(math, ams, rel, "\u21da", "\\Lleftarrow");
-defineSymbol(math, ams, rel, "\u219e", "\\twoheadleftarrow");
-defineSymbol(math, ams, rel, "\u21a2", "\\leftarrowtail");
-defineSymbol(math, ams, rel, "\u21ab", "\\looparrowleft");
-defineSymbol(math, ams, rel, "\u21cb", "\\leftrightharpoons");
-defineSymbol(math, ams, rel, "\u21b6", "\\curvearrowleft");
-defineSymbol(math, ams, rel, "\u21ba", "\\circlearrowleft");
-defineSymbol(math, ams, rel, "\u21b0", "\\Lsh");
-defineSymbol(math, ams, rel, "\u21c8", "\\upuparrows");
-defineSymbol(math, ams, rel, "\u21bf", "\\upharpoonleft");
-defineSymbol(math, ams, rel, "\u21c3", "\\downharpoonleft");
-defineSymbol(math, ams, rel, "\u22b8", "\\multimap");
-defineSymbol(math, ams, rel, "\u21ad", "\\leftrightsquigarrow");
-defineSymbol(math, ams, rel, "\u21c9", "\\rightrightarrows");
-defineSymbol(math, ams, rel, "\u21c4", "\\rightleftarrows");
-defineSymbol(math, ams, rel, "\u21a0", "\\twoheadrightarrow");
-defineSymbol(math, ams, rel, "\u21a3", "\\rightarrowtail");
-defineSymbol(math, ams, rel, "\u21ac", "\\looparrowright");
-defineSymbol(math, ams, rel, "\u21b7", "\\curvearrowright");
-defineSymbol(math, ams, rel, "\u21bb", "\\circlearrowright");
-defineSymbol(math, ams, rel, "\u21b1", "\\Rsh");
-defineSymbol(math, ams, rel, "\u21ca", "\\downdownarrows");
-defineSymbol(math, ams, rel, "\u21be", "\\upharpoonright");
-defineSymbol(math, ams, rel, "\u21c2", "\\downharpoonright");
-defineSymbol(math, ams, rel, "\u21dd", "\\rightsquigarrow");
-defineSymbol(math, ams, rel, "\u21dd", "\\leadsto");
-defineSymbol(math, ams, rel, "\u21db", "\\Rrightarrow");
-defineSymbol(math, ams, rel, "\u21be", "\\restriction");
-
-defineSymbol(math, main, textord, "\u2018", "`");
-defineSymbol(math, main, textord, "$", "\\$");
-defineSymbol(math, main, textord, "%", "\\%");
-defineSymbol(math, main, textord, "_", "\\_");
-defineSymbol(math, main, textord, "\u2220", "\\angle");
-defineSymbol(math, main, textord, "\u221e", "\\infty");
-defineSymbol(math, main, textord, "\u2032", "\\prime");
-defineSymbol(math, main, textord, "\u25b3", "\\triangle");
-defineSymbol(math, main, textord, "\u0393", "\\Gamma");
-defineSymbol(math, main, textord, "\u0394", "\\Delta");
-defineSymbol(math, main, textord, "\u0398", "\\Theta");
-defineSymbol(math, main, textord, "\u039b", "\\Lambda");
-defineSymbol(math, main, textord, "\u039e", "\\Xi");
-defineSymbol(math, main, textord, "\u03a0", "\\Pi");
-defineSymbol(math, main, textord, "\u03a3", "\\Sigma");
-defineSymbol(math, main, textord, "\u03a5", "\\Upsilon");
-defineSymbol(math, main, textord, "\u03a6", "\\Phi");
-defineSymbol(math, main, textord, "\u03a8", "\\Psi");
-defineSymbol(math, main, textord, "\u03a9", "\\Omega");
-defineSymbol(math, main, textord, "\u00ac", "\\neg");
-defineSymbol(math, main, textord, "\u00ac", "\\lnot");
-defineSymbol(math, main, textord, "\u22a4", "\\top");
-defineSymbol(math, main, textord, "\u22a5", "\\bot");
-defineSymbol(math, main, textord, "\u2205", "\\emptyset");
-defineSymbol(math, ams, textord, "\u2205", "\\varnothing");
-defineSymbol(math, main, mathord, "\u03b1", "\\alpha");
-defineSymbol(math, main, mathord, "\u03b2", "\\beta");
-defineSymbol(math, main, mathord, "\u03b3", "\\gamma");
-defineSymbol(math, main, mathord, "\u03b4", "\\delta");
-defineSymbol(math, main, mathord, "\u03f5", "\\epsilon");
-defineSymbol(math, main, mathord, "\u03b6", "\\zeta");
-defineSymbol(math, main, mathord, "\u03b7", "\\eta");
-defineSymbol(math, main, mathord, "\u03b8", "\\theta");
-defineSymbol(math, main, mathord, "\u03b9", "\\iota");
-defineSymbol(math, main, mathord, "\u03ba", "\\kappa");
-defineSymbol(math, main, mathord, "\u03bb", "\\lambda");
-defineSymbol(math, main, mathord, "\u03bc", "\\mu");
-defineSymbol(math, main, mathord, "\u03bd", "\\nu");
-defineSymbol(math, main, mathord, "\u03be", "\\xi");
-defineSymbol(math, main, mathord, "o", "\\omicron");
-defineSymbol(math, main, mathord, "\u03c0", "\\pi");
-defineSymbol(math, main, mathord, "\u03c1", "\\rho");
-defineSymbol(math, main, mathord, "\u03c3", "\\sigma");
-defineSymbol(math, main, mathord, "\u03c4", "\\tau");
-defineSymbol(math, main, mathord, "\u03c5", "\\upsilon");
-defineSymbol(math, main, mathord, "\u03d5", "\\phi");
-defineSymbol(math, main, mathord, "\u03c7", "\\chi");
-defineSymbol(math, main, mathord, "\u03c8", "\\psi");
-defineSymbol(math, main, mathord, "\u03c9", "\\omega");
-defineSymbol(math, main, mathord, "\u03b5", "\\varepsilon");
-defineSymbol(math, main, mathord, "\u03d1", "\\vartheta");
-defineSymbol(math, main, mathord, "\u03d6", "\\varpi");
-defineSymbol(math, main, mathord, "\u03f1", "\\varrho");
-defineSymbol(math, main, mathord, "\u03c2", "\\varsigma");
-defineSymbol(math, main, mathord, "\u03c6", "\\varphi");
-defineSymbol(math, main, bin, "\u2217", "*");
-defineSymbol(math, main, bin, "+", "+");
-defineSymbol(math, main, bin, "\u2212", "-");
-defineSymbol(math, main, bin, "\u22c5", "\\cdot");
-defineSymbol(math, main, bin, "\u2218", "\\circ");
-defineSymbol(math, main, bin, "\u00f7", "\\div");
-defineSymbol(math, main, bin, "\u00b1", "\\pm");
-defineSymbol(math, main, bin, "\u00d7", "\\times");
-defineSymbol(math, main, bin, "\u2229", "\\cap");
-defineSymbol(math, main, bin, "\u222a", "\\cup");
-defineSymbol(math, main, bin, "\u2216", "\\setminus");
-defineSymbol(math, main, bin, "\u2227", "\\land");
-defineSymbol(math, main, bin, "\u2228", "\\lor");
-defineSymbol(math, main, bin, "\u2227", "\\wedge");
-defineSymbol(math, main, bin, "\u2228", "\\vee");
-defineSymbol(math, main, textord, "\u221a", "\\surd");
-defineSymbol(math, main, open, "(", "(");
-defineSymbol(math, main, open, "[", "[");
-defineSymbol(math, main, open, "\u27e8", "\\langle");
-defineSymbol(math, main, open, "\u2223", "\\lvert");
-defineSymbol(math, main, open, "\u2225", "\\lVert");
-defineSymbol(math, main, close, ")", ")");
-defineSymbol(math, main, close, "]", "]");
-defineSymbol(math, main, close, "?", "?");
-defineSymbol(math, main, close, "!", "!");
-defineSymbol(math, main, close, "\u27e9", "\\rangle");
-defineSymbol(math, main, close, "\u2223", "\\rvert");
-defineSymbol(math, main, close, "\u2225", "\\rVert");
-defineSymbol(math, main, rel, "=", "=");
-defineSymbol(math, main, rel, "<", "<");
-defineSymbol(math, main, rel, ">", ">");
-defineSymbol(math, main, rel, ":", ":");
-defineSymbol(math, main, rel, "\u2248", "\\approx");
-defineSymbol(math, main, rel, "\u2245", "\\cong");
-defineSymbol(math, main, rel, "\u2265", "\\ge");
-defineSymbol(math, main, rel, "\u2265", "\\geq");
-defineSymbol(math, main, rel, "\u2190", "\\gets");
-defineSymbol(math, main, rel, ">", "\\gt");
-defineSymbol(math, main, rel, "\u2208", "\\in");
-defineSymbol(math, main, rel, "\u2209", "\\notin");
-defineSymbol(math, main, rel, "\u2282", "\\subset");
-defineSymbol(math, main, rel, "\u2283", "\\supset");
-defineSymbol(math, main, rel, "\u2286", "\\subseteq");
-defineSymbol(math, main, rel, "\u2287", "\\supseteq");
-defineSymbol(math, ams, rel, "\u2288", "\\nsubseteq");
-defineSymbol(math, ams, rel, "\u2289", "\\nsupseteq");
-defineSymbol(math, main, rel, "\u22a8", "\\models");
-defineSymbol(math, main, rel, "\u2190", "\\leftarrow");
-defineSymbol(math, main, rel, "\u2264", "\\le");
-defineSymbol(math, main, rel, "\u2264", "\\leq");
-defineSymbol(math, main, rel, "<", "\\lt");
-defineSymbol(math, main, rel, "\u2260", "\\ne");
-defineSymbol(math, main, rel, "\u2260", "\\neq");
-defineSymbol(math, main, rel, "\u2192", "\\rightarrow");
-defineSymbol(math, main, rel, "\u2192", "\\to");
-defineSymbol(math, ams, rel, "\u2271", "\\ngeq");
-defineSymbol(math, ams, rel, "\u2270", "\\nleq");
-defineSymbol(math, main, spacing, null, "\\!");
-defineSymbol(math, main, spacing, "\u00a0", "\\ ");
-defineSymbol(math, main, spacing, "\u00a0", "~");
-defineSymbol(math, main, spacing, null, "\\,");
-defineSymbol(math, main, spacing, null, "\\:");
-defineSymbol(math, main, spacing, null, "\\;");
-defineSymbol(math, main, spacing, null, "\\enspace");
-defineSymbol(math, main, spacing, null, "\\qquad");
-defineSymbol(math, main, spacing, null, "\\quad");
-defineSymbol(math, main, spacing, "\u00a0", "\\space");
-defineSymbol(math, main, punct, ",", ",");
-defineSymbol(math, main, punct, ";", ";");
-defineSymbol(math, main, punct, ":", "\\colon");
-defineSymbol(math, ams, bin, "\u22bc", "\\barwedge");
-defineSymbol(math, ams, bin, "\u22bb", "\\veebar");
-defineSymbol(math, main, bin, "\u2299", "\\odot");
-defineSymbol(math, main, bin, "\u2295", "\\oplus");
-defineSymbol(math, main, bin, "\u2297", "\\otimes");
-defineSymbol(math, main, textord, "\u2202", "\\partial");
-defineSymbol(math, main, bin, "\u2298", "\\oslash");
-defineSymbol(math, ams, bin, "\u229a", "\\circledcirc");
-defineSymbol(math, ams, bin, "\u22a1", "\\boxdot");
-defineSymbol(math, main, bin, "\u25b3", "\\bigtriangleup");
-defineSymbol(math, main, bin, "\u25bd", "\\bigtriangledown");
-defineSymbol(math, main, bin, "\u2020", "\\dagger");
-defineSymbol(math, main, bin, "\u22c4", "\\diamond");
-defineSymbol(math, main, bin, "\u22c6", "\\star");
-defineSymbol(math, main, bin, "\u25c3", "\\triangleleft");
-defineSymbol(math, main, bin, "\u25b9", "\\triangleright");
-defineSymbol(math, main, open, "{", "\\{");
-defineSymbol(math, main, close, "}", "\\}");
-defineSymbol(math, main, open, "{", "\\lbrace");
-defineSymbol(math, main, close, "}", "\\rbrace");
-defineSymbol(math, main, open, "[", "\\lbrack");
-defineSymbol(math, main, close, "]", "\\rbrack");
-defineSymbol(math, main, open, "\u230a", "\\lfloor");
-defineSymbol(math, main, close, "\u230b", "\\rfloor");
-defineSymbol(math, main, open, "\u2308", "\\lceil");
-defineSymbol(math, main, close, "\u2309", "\\rceil");
-defineSymbol(math, main, textord, "\\", "\\backslash");
-defineSymbol(math, main, textord, "\u2223", "|");
-defineSymbol(math, main, textord, "\u2223", "\\vert");
-defineSymbol(math, main, textord, "\u2225", "\\|");
-defineSymbol(math, main, textord, "\u2225", "\\Vert");
-defineSymbol(math, main, rel, "\u2191", "\\uparrow");
-defineSymbol(math, main, rel, "\u21d1", "\\Uparrow");
-defineSymbol(math, main, rel, "\u2193", "\\downarrow");
-defineSymbol(math, main, rel, "\u21d3", "\\Downarrow");
-defineSymbol(math, main, rel, "\u2195", "\\updownarrow");
-defineSymbol(math, main, rel, "\u21d5", "\\Updownarrow");
-defineSymbol(math, math, op, "\u2210", "\\coprod");
-defineSymbol(math, math, op, "\u22c1", "\\bigvee");
-defineSymbol(math, math, op, "\u22c0", "\\bigwedge");
-defineSymbol(math, math, op, "\u2a04", "\\biguplus");
-defineSymbol(math, math, op, "\u22c2", "\\bigcap");
-defineSymbol(math, math, op, "\u22c3", "\\bigcup");
-defineSymbol(math, math, op, "\u222b", "\\int");
-defineSymbol(math, math, op, "\u222b", "\\intop");
-defineSymbol(math, math, op, "\u222c", "\\iint");
-defineSymbol(math, math, op, "\u222d", "\\iiint");
-defineSymbol(math, math, op, "\u220f", "\\prod");
-defineSymbol(math, math, op, "\u2211", "\\sum");
-defineSymbol(math, math, op, "\u2a02", "\\bigotimes");
-defineSymbol(math, math, op, "\u2a01", "\\bigoplus");
-defineSymbol(math, math, op, "\u2a00", "\\bigodot");
-defineSymbol(math, math, op, "\u222e", "\\oint");
-defineSymbol(math, math, op, "\u2a06", "\\bigsqcup");
-defineSymbol(math, math, op, "\u222b", "\\smallint");
-defineSymbol(math, main, inner, "\u2026", "\\ldots");
-defineSymbol(math, main, inner, "\u22ef", "\\cdots");
-defineSymbol(math, main, inner, "\u22f1", "\\ddots");
-defineSymbol(math, main, textord, "\u22ee", "\\vdots");
-defineSymbol(math, main, accent, "\u00b4", "\\acute");
-defineSymbol(math, main, accent, "\u0060", "\\grave");
-defineSymbol(math, main, accent, "\u00a8", "\\ddot");
-defineSymbol(math, main, accent, "\u007e", "\\tilde");
-defineSymbol(math, main, accent, "\u00af", "\\bar");
-defineSymbol(math, main, accent, "\u02d8", "\\breve");
-defineSymbol(math, main, accent, "\u02c7", "\\check");
-defineSymbol(math, main, accent, "\u005e", "\\hat");
-defineSymbol(math, main, accent, "\u20d7", "\\vec");
-defineSymbol(math, main, accent, "\u02d9", "\\dot");
-defineSymbol(math, main, mathord, "\u0131", "\\imath");
-defineSymbol(math, main, mathord, "\u0237", "\\jmath");
-
-defineSymbol(text, main, spacing, "\u00a0", "\\ ");
-defineSymbol(text, main, spacing, "\u00a0", " ");
-defineSymbol(text, main, spacing, "\u00a0", "~");
-
-// There are lots of symbols which are the same, so we add them in afterwards.
-var i;
-var ch;
-
-// All of these are textords in math mode
-var mathTextSymbols = "0123456789/@.\"";
-for (i = 0; i < mathTextSymbols.length; i++) {
- ch = mathTextSymbols.charAt(i);
- defineSymbol(math, main, textord, ch, ch);
-}
-
-// All of these are textords in text mode
-var textSymbols = "0123456789`!@*()-=+[]'\";:?/.,";
-for (i = 0; i < textSymbols.length; i++) {
- ch = textSymbols.charAt(i);
- defineSymbol(text, main, textord, ch, ch);
-}
-
-// All of these are textords in text mode, and mathords in math mode
-var letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
-for (i = 0; i < letters.length; i++) {
- ch = letters.charAt(i);
- defineSymbol(math, main, mathord, ch, ch);
- defineSymbol(text, main, textord, ch, ch);
-}
-
-},{}],318:[function(require,module,exports){
-/**
- * This file contains a list of utility functions which are useful in other
- * files.
- */
-
-/**
- * Provide an `indexOf` function which works in IE8, but defers to native if
- * possible.
- */
-var nativeIndexOf = Array.prototype.indexOf;
-var indexOf = function(list, elem) {
- if (list == null) {
- return -1;
- }
- if (nativeIndexOf && list.indexOf === nativeIndexOf) {
- return list.indexOf(elem);
- }
- var i = 0;
- var l = list.length;
- for (; i < l; i++) {
- if (list[i] === elem) {
- return i;
- }
- }
- return -1;
-};
-
-/**
- * Return whether an element is contained in a list
- */
-var contains = function(list, elem) {
- return indexOf(list, elem) !== -1;
-};
-
-/**
- * Provide a default value if a setting is undefined
- */
-var deflt = function(setting, defaultIfUndefined) {
- return setting === undefined ? defaultIfUndefined : setting;
-};
-
-// hyphenate and escape adapted from Facebook's React under Apache 2 license
-
-var uppercase = /([A-Z])/g;
-var hyphenate = function(str) {
- return str.replace(uppercase, "-$1").toLowerCase();
-};
-
-var ESCAPE_LOOKUP = {
- "&": "&amp;",
- ">": "&gt;",
- "<": "&lt;",
- "\"": "&quot;",
- "'": "&#x27;",
-};
-
-var ESCAPE_REGEX = /[&><"']/g;
-
-function escaper(match) {
- return ESCAPE_LOOKUP[match];
-}
-
-/**
- * Escapes text to prevent scripting attacks.
- *
- * @param {*} text Text value to escape.
- * @return {string} An escaped string.
- */
-function escape(text) {
- return ("" + text).replace(ESCAPE_REGEX, escaper);
-}
-
-/**
- * A function to set the text content of a DOM element in all supported
- * browsers. Note that we don't define this if there is no document.
- */
-var setTextContent;
-if (typeof document !== "undefined") {
- var testNode = document.createElement("span");
- if ("textContent" in testNode) {
- setTextContent = function(node, text) {
- node.textContent = text;
- };
- } else {
- setTextContent = function(node, text) {
- node.innerText = text;
- };
- }
-}
-
-/**
- * A function to clear a node.
- */
-function clearNode(node) {
- setTextContent(node, "");
-}
-
-module.exports = {
- contains: contains,
- deflt: deflt,
- escape: escape,
- hyphenate: hyphenate,
- indexOf: indexOf,
- setTextContent: setTextContent,
- clearNode: clearNode,
-};
-
-},{}],319:[function(require,module,exports){
-"use strict";
-var string = require("string");
-var assign = require("lodash.assign");
-var defaults = {
- includeLevel: [ 1, 2 ],
- containerClass: "table-of-contents",
- slugify: function(str) {
- return string(str).slugify().toString();
- },
- markerPattern: /^\[\[toc\]\]/im,
- listType: "ul",
- format: undefined
-};
-
-module.exports = function(md, options) {
- var options = assign({}, defaults, options);
- var tocRegexp = options.markerPattern;
- var gstate;
-
- function toc(state, silent) {
- var token;
- var match;
-
- // Reject if the token does not start with [
- if (state.src.charCodeAt(state.pos) !== 0x5B /* [ */ ) {
- return false;
- }
- // Don't run any pairs in validation mode
- if (silent) {
- return false;
- }
-
- // Detect TOC markdown
- match = tocRegexp.exec(state.src);
- match = !match ? [] : match.filter(function(m) { return m; });
- if (match.length < 1) {
- return false;
- }
-
- // Build content
- token = state.push("toc_open", "toc", 1);
- token.markup = "[[toc]]";
- token = state.push("toc_body", "", 0);
- token = state.push("toc_close", "toc", -1);
-
- // Update pos so the parser can continue
- var newline = state.src.indexOf("\n");
- if (newline !== -1) {
- state.pos = state.pos + newline;
- } else {
- state.pos = state.pos + state.posMax + 1;
- }
-
- return true;
- }
-
- md.renderer.rules.toc_open = function(tokens, index) {
- return '<div class="' + options.containerClass + '">';
- };
-
- md.renderer.rules.toc_close = function(tokens, index) {
- return "</div>";
- };
-
- md.renderer.rules.toc_body = function(tokens, index) {
- return renderChildsTokens(0, gstate.tokens)[1];
- };
-
- function renderChildsTokens(pos, tokens) {
- var headings = [],
- buffer = '',
- currentLevel,
- subHeadings,
- size = tokens.length,
- i = pos;
- while(i < size) {
- var token = tokens[i];
- var heading = tokens[i - 1];
- var level = token.tag && parseInt(token.tag.substr(1, 1));
- if (token.type !== "heading_close" || options.includeLevel.indexOf(level) == -1 || heading.type !== "inline") {
- i++; continue; // Skip if not matching criteria
- }
- if (!currentLevel) {
- currentLevel = level;// We init with the first found level
- } else {
- if (level > currentLevel) {
- subHeadings = renderChildsTokens(i, tokens);
- buffer += subHeadings[1];
- i = subHeadings[0];
- continue;
- }
- if (level < currentLevel) {
- // Finishing the sub headings
- buffer += "</li>";
- headings.push(buffer);
- return [i, "<" + options.listType + ">" + headings.join("") + "</" + options.listType + ">"];
- }
- if (level == currentLevel) {
- // Finishing the sub headings
- buffer += "</li>";
- headings.push(buffer);
- }
- }
- buffer = "<li><a href=\"#" + options.slugify(heading.content) + "\">";
- buffer += typeof options.format === "function" ? options.format(heading.content) : heading.content;
- buffer += "</a>";
- i++;
- }
- buffer += "</li>";
- headings.push(buffer);
- return [i, "<" + options.listType + ">" + headings.join("") + "</" + options.listType + ">"];
- }
-
- // Catch all the tokens for iteration later
- md.core.ruler.push("grab_state", function(state) {
- gstate = state;
- });
-
- // Insert TOC
- md.inline.ruler.after("emphasis", "toc", toc);
-};
-
-},{"lodash.assign":291,"string":412}],320:[function(require,module,exports){
-'use strict';
-
-
-module.exports = require('./lib/');
-
-},{"./lib/":329}],321:[function(require,module,exports){
-// HTML5 entities map: { name -> utf16string }
-//
-'use strict';
-
-/*eslint quotes:0*/
-module.exports = require('entities/maps/entities.json');
-
-},{"entities/maps/entities.json":88}],322:[function(require,module,exports){
-// List of valid html blocks names, accorting to commonmark spec
-// http://jgm.github.io/CommonMark/spec.html#html-blocks
-
-'use strict';
-
-
-module.exports = [
- 'address',
- 'article',
- 'aside',
- 'base',
- 'basefont',
- 'blockquote',
- 'body',
- 'caption',
- 'center',
- 'col',
- 'colgroup',
- 'dd',
- 'details',
- 'dialog',
- 'dir',
- 'div',
- 'dl',
- 'dt',
- 'fieldset',
- 'figcaption',
- 'figure',
- 'footer',
- 'form',
- 'frame',
- 'frameset',
- 'h1',
- 'h2',
- 'h3',
- 'h4',
- 'h5',
- 'h6',
- 'head',
- 'header',
- 'hr',
- 'html',
- 'iframe',
- 'legend',
- 'li',
- 'link',
- 'main',
- 'menu',
- 'menuitem',
- 'meta',
- 'nav',
- 'noframes',
- 'ol',
- 'optgroup',
- 'option',
- 'p',
- 'param',
- 'section',
- 'source',
- 'summary',
- 'table',
- 'tbody',
- 'td',
- 'tfoot',
- 'th',
- 'thead',
- 'title',
- 'tr',
- 'track',
- 'ul'
-];
-
-},{}],323:[function(require,module,exports){
-// Regexps to match html elements
-
-'use strict';
-
-var attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*';
-
-var unquoted = '[^"\'=<>`\\x00-\\x20]+';
-var single_quoted = "'[^']*'";
-var double_quoted = '"[^"]*"';
-
-var attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')';
-
-var attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)';
-
-var open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>';
-
-var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>';
-var comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->';
-var processing = '<[?].*?[?]>';
-var declaration = '<![A-Z]+\\s+[^>]*>';
-var cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>';
-
-var HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment +
- '|' + processing + '|' + declaration + '|' + cdata + ')');
-var HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')');
-
-module.exports.HTML_TAG_RE = HTML_TAG_RE;
-module.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE;
-
-},{}],324:[function(require,module,exports){
-// Utilities
-//
-'use strict';
-
-
-function _class(obj) { return Object.prototype.toString.call(obj); }
-
-function isString(obj) { return _class(obj) === '[object String]'; }
-
-var _hasOwnProperty = Object.prototype.hasOwnProperty;
-
-function has(object, key) {
- return _hasOwnProperty.call(object, key);
-}
-
-// Merge objects
-//
-function assign(obj /*from1, from2, from3, ...*/) {
- var sources = Array.prototype.slice.call(arguments, 1);
-
- sources.forEach(function (source) {
- if (!source) { return; }
-
- if (typeof source !== 'object') {
- throw new TypeError(source + 'must be object');
- }
-
- Object.keys(source).forEach(function (key) {
- obj[key] = source[key];
- });
- });
-
- return obj;
-}
-
-// Remove element from array and put another array at those position.
-// Useful for some operations with tokens
-function arrayReplaceAt(src, pos, newElements) {
- return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-function isValidEntityCode(c) {
- /*eslint no-bitwise:0*/
- // broken sequence
- if (c >= 0xD800 && c <= 0xDFFF) { return false; }
- // never used
- if (c >= 0xFDD0 && c <= 0xFDEF) { return false; }
- if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false; }
- // control codes
- if (c >= 0x00 && c <= 0x08) { return false; }
- if (c === 0x0B) { return false; }
- if (c >= 0x0E && c <= 0x1F) { return false; }
- if (c >= 0x7F && c <= 0x9F) { return false; }
- // out of range
- if (c > 0x10FFFF) { return false; }
- return true;
-}
-
-function fromCodePoint(c) {
- /*eslint no-bitwise:0*/
- if (c > 0xffff) {
- c -= 0x10000;
- var surrogate1 = 0xd800 + (c >> 10),
- surrogate2 = 0xdc00 + (c & 0x3ff);
-
- return String.fromCharCode(surrogate1, surrogate2);
- }
- return String.fromCharCode(c);
-}
-
-
-var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g;
-var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;
-var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi');
-
-var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;
-
-var entities = require('./entities');
-
-function replaceEntityPattern(match, name) {
- var code = 0;
-
- if (has(entities, name)) {
- return entities[name];
- }
-
- if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {
- code = name[1].toLowerCase() === 'x' ?
- parseInt(name.slice(2), 16)
- :
- parseInt(name.slice(1), 10);
- if (isValidEntityCode(code)) {
- return fromCodePoint(code);
- }
- }
-
- return match;
-}
-
-/*function replaceEntities(str) {
- if (str.indexOf('&') < 0) { return str; }
-
- return str.replace(ENTITY_RE, replaceEntityPattern);
-}*/
-
-function unescapeMd(str) {
- if (str.indexOf('\\') < 0) { return str; }
- return str.replace(UNESCAPE_MD_RE, '$1');
-}
-
-function unescapeAll(str) {
- if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { return str; }
-
- return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) {
- if (escaped) { return escaped; }
- return replaceEntityPattern(match, entity);
- });
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-var HTML_ESCAPE_TEST_RE = /[&<>"]/;
-var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
-var HTML_REPLACEMENTS = {
- '&': '&amp;',
- '<': '&lt;',
- '>': '&gt;',
- '"': '&quot;'
-};
-
-function replaceUnsafeChar(ch) {
- return HTML_REPLACEMENTS[ch];
-}
-
-function escapeHtml(str) {
- if (HTML_ESCAPE_TEST_RE.test(str)) {
- return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
- }
- return str;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g;
-
-function escapeRE(str) {
- return str.replace(REGEXP_ESCAPE_RE, '\\$&');
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-function isSpace(code) {
- switch (code) {
- case 0x09:
- case 0x20:
- return true;
- }
- return false;
-}
-
-// Zs (unicode class) || [\t\f\v\r\n]
-function isWhiteSpace(code) {
- if (code >= 0x2000 && code <= 0x200A) { return true; }
- switch (code) {
- case 0x09: // \t
- case 0x0A: // \n
- case 0x0B: // \v
- case 0x0C: // \f
- case 0x0D: // \r
- case 0x20:
- case 0xA0:
- case 0x1680:
- case 0x202F:
- case 0x205F:
- case 0x3000:
- return true;
- }
- return false;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-/*eslint-disable max-len*/
-var UNICODE_PUNCT_RE = require('uc.micro/categories/P/regex');
-
-// Currently without astral characters support.
-function isPunctChar(ch) {
- return UNICODE_PUNCT_RE.test(ch);
-}
-
-
-// Markdown ASCII punctuation characters.
-//
-// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
-// http://spec.commonmark.org/0.15/#ascii-punctuation-character
-//
-// Don't confuse with unicode punctuation !!! It lacks some chars in ascii range.
-//
-function isMdAsciiPunct(ch) {
- switch (ch) {
- case 0x21/* ! */:
- case 0x22/* " */:
- case 0x23/* # */:
- case 0x24/* $ */:
- case 0x25/* % */:
- case 0x26/* & */:
- case 0x27/* ' */:
- case 0x28/* ( */:
- case 0x29/* ) */:
- case 0x2A/* * */:
- case 0x2B/* + */:
- case 0x2C/* , */:
- case 0x2D/* - */:
- case 0x2E/* . */:
- case 0x2F/* / */:
- case 0x3A/* : */:
- case 0x3B/* ; */:
- case 0x3C/* < */:
- case 0x3D/* = */:
- case 0x3E/* > */:
- case 0x3F/* ? */:
- case 0x40/* @ */:
- case 0x5B/* [ */:
- case 0x5C/* \ */:
- case 0x5D/* ] */:
- case 0x5E/* ^ */:
- case 0x5F/* _ */:
- case 0x60/* ` */:
- case 0x7B/* { */:
- case 0x7C/* | */:
- case 0x7D/* } */:
- case 0x7E/* ~ */:
- return true;
- default:
- return false;
- }
-}
-
-// Hepler to unify [reference labels].
-//
-function normalizeReference(str) {
- // use .toUpperCase() instead of .toLowerCase()
- // here to avoid a conflict with Object.prototype
- // members (most notably, `__proto__`)
- return str.trim().replace(/\s+/g, ' ').toUpperCase();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-// Re-export libraries commonly used in both markdown-it and its plugins,
-// so plugins won't have to depend on them explicitly, which reduces their
-// bundled size (e.g. a browser build).
-//
-exports.lib = {};
-exports.lib.mdurl = require('mdurl');
-exports.lib.ucmicro = require('uc.micro');
-
-exports.assign = assign;
-exports.isString = isString;
-exports.has = has;
-exports.unescapeMd = unescapeMd;
-exports.unescapeAll = unescapeAll;
-exports.isValidEntityCode = isValidEntityCode;
-exports.fromCodePoint = fromCodePoint;
-// exports.replaceEntities = replaceEntities;
-exports.escapeHtml = escapeHtml;
-exports.arrayReplaceAt = arrayReplaceAt;
-exports.isSpace = isSpace;
-exports.isWhiteSpace = isWhiteSpace;
-exports.isMdAsciiPunct = isMdAsciiPunct;
-exports.isPunctChar = isPunctChar;
-exports.escapeRE = escapeRE;
-exports.normalizeReference = normalizeReference;
-
-},{"./entities":321,"mdurl":376,"uc.micro":417,"uc.micro/categories/P/regex":415}],325:[function(require,module,exports){
-// Just a shortcut for bulk export
-'use strict';
-
-
-exports.parseLinkLabel = require('./parse_link_label');
-exports.parseLinkDestination = require('./parse_link_destination');
-exports.parseLinkTitle = require('./parse_link_title');
-
-},{"./parse_link_destination":326,"./parse_link_label":327,"./parse_link_title":328}],326:[function(require,module,exports){
-// Parse link destination
-//
-'use strict';
-
-
-var isSpace = require('../common/utils').isSpace;
-var unescapeAll = require('../common/utils').unescapeAll;
-
-
-module.exports = function parseLinkDestination(str, pos, max) {
- var code, level,
- lines = 0,
- start = pos,
- result = {
- ok: false,
- pos: 0,
- lines: 0,
- str: ''
- };
-
- if (str.charCodeAt(pos) === 0x3C /* < */) {
- pos++;
- while (pos < max) {
- code = str.charCodeAt(pos);
- if (code === 0x0A /* \n */ || isSpace(code)) { return result; }
- if (code === 0x3E /* > */) {
- result.pos = pos + 1;
- result.str = unescapeAll(str.slice(start + 1, pos));
- result.ok = true;
- return result;
- }
- if (code === 0x5C /* \ */ && pos + 1 < max) {
- pos += 2;
- continue;
- }
-
- pos++;
- }
-
- // no closing '>'
- return result;
- }
-
- // this should be ... } else { ... branch
-
- level = 0;
- while (pos < max) {
- code = str.charCodeAt(pos);
-
- if (code === 0x20) { break; }
-
- // ascii control characters
- if (code < 0x20 || code === 0x7F) { break; }
-
- if (code === 0x5C /* \ */ && pos + 1 < max) {
- pos += 2;
- continue;
- }
-
- if (code === 0x28 /* ( */) {
- level++;
- }
-
- if (code === 0x29 /* ) */) {
- if (level === 0) { break; }
- level--;
- }
-
- pos++;
- }
-
- if (start === pos) { return result; }
- if (level !== 0) { return result; }
-
- result.str = unescapeAll(str.slice(start, pos));
- result.lines = lines;
- result.pos = pos;
- result.ok = true;
- return result;
-};
-
-},{"../common/utils":324}],327:[function(require,module,exports){
-// Parse link label
-//
-// this function assumes that first character ("[") already matches;
-// returns the end of the label
-//
-'use strict';
-
-module.exports = function parseLinkLabel(state, start, disableNested) {
- var level, found, marker, prevPos,
- labelEnd = -1,
- max = state.posMax,
- oldPos = state.pos;
-
- state.pos = start + 1;
- level = 1;
-
- while (state.pos < max) {
- marker = state.src.charCodeAt(state.pos);
- if (marker === 0x5D /* ] */) {
- level--;
- if (level === 0) {
- found = true;
- break;
- }
- }
-
- prevPos = state.pos;
- state.md.inline.skipToken(state);
- if (marker === 0x5B /* [ */) {
- if (prevPos === state.pos - 1) {
- // increase level if we find text `[`, which is not a part of any token
- level++;
- } else if (disableNested) {
- state.pos = oldPos;
- return -1;
- }
- }
- }
-
- if (found) {
- labelEnd = state.pos;
- }
-
- // restore old state
- state.pos = oldPos;
-
- return labelEnd;
-};
-
-},{}],328:[function(require,module,exports){
-// Parse link title
-//
-'use strict';
-
-
-var unescapeAll = require('../common/utils').unescapeAll;
-
-
-module.exports = function parseLinkTitle(str, pos, max) {
- var code,
- marker,
- lines = 0,
- start = pos,
- result = {
- ok: false,
- pos: 0,
- lines: 0,
- str: ''
- };
-
- if (pos >= max) { return result; }
-
- marker = str.charCodeAt(pos);
-
- if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return result; }
-
- pos++;
-
- // if opening marker is "(", switch it to closing marker ")"
- if (marker === 0x28) { marker = 0x29; }
-
- while (pos < max) {
- code = str.charCodeAt(pos);
- if (code === marker) {
- result.pos = pos + 1;
- result.lines = lines;
- result.str = unescapeAll(str.slice(start + 1, pos));
- result.ok = true;
- return result;
- } else if (code === 0x0A) {
- lines++;
- } else if (code === 0x5C /* \ */ && pos + 1 < max) {
- pos++;
- if (str.charCodeAt(pos) === 0x0A) {
- lines++;
- }
- }
-
- pos++;
- }
-
- return result;
-};
-
-},{"../common/utils":324}],329:[function(require,module,exports){
-// Main parser class
-
-'use strict';
-
-
-var utils = require('./common/utils');
-var helpers = require('./helpers');
-var Renderer = require('./renderer');
-var ParserCore = require('./parser_core');
-var ParserBlock = require('./parser_block');
-var ParserInline = require('./parser_inline');
-var LinkifyIt = require('linkify-it');
-var mdurl = require('mdurl');
-var punycode = require('punycode');
-
-
-var config = {
- 'default': require('./presets/default'),
- zero: require('./presets/zero'),
- commonmark: require('./presets/commonmark')
-};
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// This validator can prohibit more than really needed to prevent XSS. It's a
-// tradeoff to keep code simple and to be secure by default.
-//
-// If you need different setup - override validator method as you wish. Or
-// replace it with dummy function and use external sanitizer.
-//
-
-var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
-var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
-
-function validateLink(url) {
- // url should be normalized at this point, and existing entities are decoded
- var str = url.trim().toLowerCase();
-
- return BAD_PROTO_RE.test(str) ? (GOOD_DATA_RE.test(str) ? true : false) : true;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-
-var RECODE_HOSTNAME_FOR = [ 'http:', 'https:', 'mailto:' ];
-
-function normalizeLink(url) {
- var parsed = mdurl.parse(url, true);
-
- if (parsed.hostname) {
- // Encode hostnames in urls like:
- // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
- //
- // We don't encode unknown schemas, because it's likely that we encode
- // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
- //
- if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
- try {
- parsed.hostname = punycode.toASCII(parsed.hostname);
- } catch (er) { /**/ }
- }
- }
-
- return mdurl.encode(mdurl.format(parsed));
-}
-
-function normalizeLinkText(url) {
- var parsed = mdurl.parse(url, true);
-
- if (parsed.hostname) {
- // Encode hostnames in urls like:
- // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
- //
- // We don't encode unknown schemas, because it's likely that we encode
- // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
- //
- if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
- try {
- parsed.hostname = punycode.toUnicode(parsed.hostname);
- } catch (er) { /**/ }
- }
- }
-
- return mdurl.decode(mdurl.format(parsed));
-}
-
-
-/**
- * class MarkdownIt
- *
- * Main parser/renderer class.
- *
- * ##### Usage
- *
- * ```javascript
- * // node.js, "classic" way:
- * var MarkdownIt = require('markdown-it'),
- * md = new MarkdownIt();
- * var result = md.render('# markdown-it rulezz!');
- *
- * // node.js, the same, but with sugar:
- * var md = require('markdown-it')();
- * var result = md.render('# markdown-it rulezz!');
- *
- * // browser without AMD, added to "window" on script load
- * // Note, there are no dash.
- * var md = window.markdownit();
- * var result = md.render('# markdown-it rulezz!');
- * ```
- *
- * Single line rendering, without paragraph wrap:
- *
- * ```javascript
- * var md = require('markdown-it')();
- * var result = md.renderInline('__markdown-it__ rulezz!');
- * ```
- **/
-
-/**
- * new MarkdownIt([presetName, options])
- * - presetName (String): optional, `commonmark` / `zero`
- * - options (Object)
- *
- * Creates parser instanse with given config. Can be called without `new`.
- *
- * ##### presetName
- *
- * MarkdownIt provides named presets as a convenience to quickly
- * enable/disable active syntax rules and options for common use cases.
- *
- * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) -
- * configures parser to strict [CommonMark](http://commonmark.org/) mode.
- * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) -
- * similar to GFM, used when no preset name given. Enables all available rules,
- * but still without html, typographer & autolinker.
- * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) -
- * all rules disabled. Useful to quickly setup your config via `.enable()`.
- * For example, when you need only `bold` and `italic` markup and nothing else.
- *
- * ##### options:
- *
- * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful!
- * That's not safe! You may need external sanitizer to protect output from XSS.
- * It's better to extend features via plugins, instead of enabling HTML.
- * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags
- * (`<br />`). This is needed only for full CommonMark compatibility. In real
- * world you will need HTML output.
- * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `<br>`.
- * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks.
- * Can be useful for external highlighters.
- * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links.
- * - __typographer__ - `false`. Set `true` to enable [some language-neutral
- * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) +
- * quotes beautification (smartquotes).
- * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement
- * pairs, when typographer enabled and smartquotes on. For example, you can
- * use `'«»„“'` for Russian, `'„“‚‘'` for German, and
- * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp).
- * - __highlight__ - `null`. Highlighter function for fenced code blocks.
- * Highlighter `function (str, lang)` should return escaped HTML. It can also
- * return empty string if the source was not changed and should be escaped
- * externaly. If result starts with <pre... internal wrapper is skipped.
- *
- * ##### Example
- *
- * ```javascript
- * // commonmark mode
- * var md = require('markdown-it')('commonmark');
- *
- * // default mode
- * var md = require('markdown-it')();
- *
- * // enable everything
- * var md = require('markdown-it')({
- * html: true,
- * linkify: true,
- * typographer: true
- * });
- * ```
- *
- * ##### Syntax highlighting
- *
- * ```js
- * var hljs = require('highlight.js') // https://highlightjs.org/
- *
- * var md = require('markdown-it')({
- * highlight: function (str, lang) {
- * if (lang && hljs.getLanguage(lang)) {
- * try {
- * return hljs.highlight(lang, str, true).value;
- * } catch (__) {}
- * }
- *
- * return ''; // use external default escaping
- * }
- * });
- * ```
- *
- * Or with full wrapper override (if you need assign class to `<pre>`):
- *
- * ```javascript
- * var hljs = require('highlight.js') // https://highlightjs.org/
- *
- * // Actual default values
- * var md = require('markdown-it')({
- * highlight: function (str, lang) {
- * if (lang && hljs.getLanguage(lang)) {
- * try {
- * return '<pre class="hljs"><code>' +
- * hljs.highlight(lang, str, true).value +
- * '</code></pre>';
- * } catch (__) {}
- * }
- *
- * return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
- * }
- * });
- * ```
- *
- **/
-function MarkdownIt(presetName, options) {
- if (!(this instanceof MarkdownIt)) {
- return new MarkdownIt(presetName, options);
- }
-
- if (!options) {
- if (!utils.isString(presetName)) {
- options = presetName || {};
- presetName = 'default';
- }
- }
-
- /**
- * MarkdownIt#inline -> ParserInline
- *
- * Instance of [[ParserInline]]. You may need it to add new rules when
- * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
- * [[MarkdownIt.enable]].
- **/
- this.inline = new ParserInline();
-
- /**
- * MarkdownIt#block -> ParserBlock
- *
- * Instance of [[ParserBlock]]. You may need it to add new rules when
- * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
- * [[MarkdownIt.enable]].
- **/
- this.block = new ParserBlock();
-
- /**
- * MarkdownIt#core -> Core
- *
- * Instance of [[Core]] chain executor. You may need it to add new rules when
- * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
- * [[MarkdownIt.enable]].
- **/
- this.core = new ParserCore();
-
- /**
- * MarkdownIt#renderer -> Renderer
- *
- * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering
- * rules for new token types, generated by plugins.
- *
- * ##### Example
- *
- * ```javascript
- * var md = require('markdown-it')();
- *
- * function myToken(tokens, idx, options, env, self) {
- * //...
- * return result;
- * };
- *
- * md.renderer.rules['my_token'] = myToken
- * ```
- *
- * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).
- **/
- this.renderer = new Renderer();
-
- /**
- * MarkdownIt#linkify -> LinkifyIt
- *
- * [linkify-it](https://github.com/markdown-it/linkify-it) instance.
- * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js)
- * rule.
- **/
- this.linkify = new LinkifyIt();
-
- /**
- * MarkdownIt#validateLink(url) -> Boolean
- *
- * Link validation function. CommonMark allows too much in links. By default
- * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
- * except some embedded image types.
- *
- * You can change this behaviour:
- *
- * ```javascript
- * var md = require('markdown-it')();
- * // enable everything
- * md.validateLink = function () { return true; }
- * ```
- **/
- this.validateLink = validateLink;
-
- /**
- * MarkdownIt#normalizeLink(url) -> String
- *
- * Function used to encode link url to a machine-readable format,
- * which includes url-encoding, punycode, etc.
- **/
- this.normalizeLink = normalizeLink;
-
- /**
- * MarkdownIt#normalizeLinkText(url) -> String
- *
- * Function used to decode link url to a human-readable format`
- **/
- this.normalizeLinkText = normalizeLinkText;
-
-
- // Expose utils & helpers for easy acces from plugins
-
- /**
- * MarkdownIt#utils -> utils
- *
- * Assorted utility functions, useful to write plugins. See details
- * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js).
- **/
- this.utils = utils;
-
- /**
- * MarkdownIt#helpers -> helpers
- *
- * Link components parser functions, useful to write plugins. See details
- * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).
- **/
- this.helpers = utils.assign({}, helpers);
-
-
- this.options = {};
- this.configure(presetName);
-
- if (options) { this.set(options); }
-}
-
-
-/** chainable
- * MarkdownIt.set(options)
- *
- * Set parser options (in the same format as in constructor). Probably, you
- * will never need it, but you can change options after constructor call.
- *
- * ##### Example
- *
- * ```javascript
- * var md = require('markdown-it')()
- * .set({ html: true, breaks: true })
- * .set({ typographer, true });
- * ```
- *
- * __Note:__ To achieve the best possible performance, don't modify a
- * `markdown-it` instance options on the fly. If you need multiple configurations
- * it's best to create multiple instances and initialize each with separate
- * config.
- **/
-MarkdownIt.prototype.set = function (options) {
- utils.assign(this.options, options);
- return this;
-};
-
-
-/** chainable, internal
- * MarkdownIt.configure(presets)
- *
- * Batch load of all options and compenent settings. This is internal method,
- * and you probably will not need it. But if you with - see available presets
- * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)
- *
- * We strongly recommend to use presets instead of direct config loads. That
- * will give better compatibility with next versions.
- **/
-MarkdownIt.prototype.configure = function (presets) {
- var self = this, presetName;
-
- if (utils.isString(presets)) {
- presetName = presets;
- presets = config[presetName];
- if (!presets) { throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); }
- }
-
- if (!presets) { throw new Error('Wrong `markdown-it` preset, can\'t be empty'); }
-
- if (presets.options) { self.set(presets.options); }
-
- if (presets.components) {
- Object.keys(presets.components).forEach(function (name) {
- if (presets.components[name].rules) {
- self[name].ruler.enableOnly(presets.components[name].rules);
- }
- if (presets.components[name].rules2) {
- self[name].ruler2.enableOnly(presets.components[name].rules2);
- }
- });
- }
- return this;
-};
-
-
-/** chainable
- * MarkdownIt.enable(list, ignoreInvalid)
- * - list (String|Array): rule name or list of rule names to enable
- * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
- *
- * Enable list or rules. It will automatically find appropriate components,
- * containing rules with given names. If rule not found, and `ignoreInvalid`
- * not set - throws exception.
- *
- * ##### Example
- *
- * ```javascript
- * var md = require('markdown-it')()
- * .enable(['sub', 'sup'])
- * .disable('smartquotes');
- * ```
- **/
-MarkdownIt.prototype.enable = function (list, ignoreInvalid) {
- var result = [];
-
- if (!Array.isArray(list)) { list = [ list ]; }
-
- [ 'core', 'block', 'inline' ].forEach(function (chain) {
- result = result.concat(this[chain].ruler.enable(list, true));
- }, this);
-
- result = result.concat(this.inline.ruler2.enable(list, true));
-
- var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
-
- if (missed.length && !ignoreInvalid) {
- throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed);
- }
-
- return this;
-};
-
-
-/** chainable
- * MarkdownIt.disable(list, ignoreInvalid)
- * - list (String|Array): rule name or list of rule names to disable.
- * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
- *
- * The same as [[MarkdownIt.enable]], but turn specified rules off.
- **/
-MarkdownIt.prototype.disable = function (list, ignoreInvalid) {
- var result = [];
-
- if (!Array.isArray(list)) { list = [ list ]; }
-
- [ 'core', 'block', 'inline' ].forEach(function (chain) {
- result = result.concat(this[chain].ruler.disable(list, true));
- }, this);
-
- result = result.concat(this.inline.ruler2.disable(list, true));
-
- var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
-
- if (missed.length && !ignoreInvalid) {
- throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed);
- }
- return this;
-};
-
-
-/** chainable
- * MarkdownIt.use(plugin, params)
- *
- * Load specified plugin with given params into current parser instance.
- * It's just a sugar to call `plugin(md, params)` with curring.
- *
- * ##### Example
- *
- * ```javascript
- * var iterator = require('markdown-it-for-inline');
- * var md = require('markdown-it')()
- * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
- * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');
- * });
- * ```
- **/
-MarkdownIt.prototype.use = function (plugin /*, params, ... */) {
- var args = [ this ].concat(Array.prototype.slice.call(arguments, 1));
- plugin.apply(plugin, args);
- return this;
-};
-
-
-/** internal
- * MarkdownIt.parse(src, env) -> Array
- * - src (String): source string
- * - env (Object): environment sandbox
- *
- * Parse input string and returns list of block tokens (special token type
- * "inline" will contain list of inline tokens). You should not call this
- * method directly, until you write custom renderer (for example, to produce
- * AST).
- *
- * `env` is used to pass data between "distributed" rules and return additional
- * metadata like reference info, needed for the renderer. It also can be used to
- * inject data in specific cases. Usually, you will be ok to pass `{}`,
- * and then pass updated object to renderer.
- **/
-MarkdownIt.prototype.parse = function (src, env) {
- if (typeof src !== 'string') {
- throw new Error('Input data should be a String');
- }
-
- var state = new this.core.State(src, this, env);
-
- this.core.process(state);
-
- return state.tokens;
-};
-
-
-/**
- * MarkdownIt.render(src [, env]) -> String
- * - src (String): source string
- * - env (Object): environment sandbox
- *
- * Render markdown string into html. It does all magic for you :).
- *
- * `env` can be used to inject additional metadata (`{}` by default).
- * But you will not need it with high probability. See also comment
- * in [[MarkdownIt.parse]].
- **/
-MarkdownIt.prototype.render = function (src, env) {
- env = env || {};
-
- return this.renderer.render(this.parse(src, env), this.options, env);
-};
-
-
-/** internal
- * MarkdownIt.parseInline(src, env) -> Array
- * - src (String): source string
- * - env (Object): environment sandbox
- *
- * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the
- * block tokens list with the single `inline` element, containing parsed inline
- * tokens in `children` property. Also updates `env` object.
- **/
-MarkdownIt.prototype.parseInline = function (src, env) {
- var state = new this.core.State(src, this, env);
-
- state.inlineMode = true;
- this.core.process(state);
-
- return state.tokens;
-};
-
-
-/**
- * MarkdownIt.renderInline(src [, env]) -> String
- * - src (String): source string
- * - env (Object): environment sandbox
- *
- * Similar to [[MarkdownIt.render]] but for single paragraph content. Result
- * will NOT be wrapped into `<p>` tags.
- **/
-MarkdownIt.prototype.renderInline = function (src, env) {
- env = env || {};
-
- return this.renderer.render(this.parseInline(src, env), this.options, env);
-};
-
-
-module.exports = MarkdownIt;
-
-},{"./common/utils":324,"./helpers":325,"./parser_block":330,"./parser_core":331,"./parser_inline":332,"./presets/commonmark":333,"./presets/default":334,"./presets/zero":335,"./renderer":336,"linkify-it":289,"mdurl":376,"punycode":407}],330:[function(require,module,exports){
-/** internal
- * class ParserBlock
- *
- * Block-level tokenizer.
- **/
-'use strict';
-
-
-var Ruler = require('./ruler');
-
-
-var _rules = [
- // First 2 params - rule name & source. Secondary array - list of rules,
- // which can be terminated by this one.
- [ 'table', require('./rules_block/table'), [ 'paragraph', 'reference' ] ],
- [ 'code', require('./rules_block/code') ],
- [ 'fence', require('./rules_block/fence'), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
- [ 'blockquote', require('./rules_block/blockquote'), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
- [ 'hr', require('./rules_block/hr'), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
- [ 'list', require('./rules_block/list'), [ 'paragraph', 'reference', 'blockquote' ] ],
- [ 'reference', require('./rules_block/reference') ],
- [ 'heading', require('./rules_block/heading'), [ 'paragraph', 'reference', 'blockquote' ] ],
- [ 'lheading', require('./rules_block/lheading') ],
- [ 'html_block', require('./rules_block/html_block'), [ 'paragraph', 'reference', 'blockquote' ] ],
- [ 'paragraph', require('./rules_block/paragraph') ]
-];
-
-
-/**
- * new ParserBlock()
- **/
-function ParserBlock() {
- /**
- * ParserBlock#ruler -> Ruler
- *
- * [[Ruler]] instance. Keep configuration of block rules.
- **/
- this.ruler = new Ruler();
-
- for (var i = 0; i < _rules.length; i++) {
- this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() });
- }
-}
-
-
-// Generate tokens for input range
-//
-ParserBlock.prototype.tokenize = function (state, startLine, endLine) {
- var ok, i,
- rules = this.ruler.getRules(''),
- len = rules.length,
- line = startLine,
- hasEmptyLines = false,
- maxNesting = state.md.options.maxNesting;
-
- while (line < endLine) {
- state.line = line = state.skipEmptyLines(line);
- if (line >= endLine) { break; }
-
- // Termination condition for nested calls.
- // Nested calls currently used for blockquotes & lists
- if (state.sCount[line] < state.blkIndent) { break; }
-
- // If nesting level exceeded - skip tail to the end. That's not ordinary
- // situation and we should not care about content.
- if (state.level >= maxNesting) {
- state.line = endLine;
- break;
- }
-
- // Try all possible rules.
- // On success, rule should:
- //
- // - update `state.line`
- // - update `state.tokens`
- // - return true
-
- for (i = 0; i < len; i++) {
- ok = rules[i](state, line, endLine, false);
- if (ok) { break; }
- }
-
- // set state.tight if we had an empty line before current tag
- // i.e. latest empty line should not count
- state.tight = !hasEmptyLines;
-
- // paragraph might "eat" one newline after it in nested lists
- if (state.isEmpty(state.line - 1)) {
- hasEmptyLines = true;
- }
-
- line = state.line;
-
- if (line < endLine && state.isEmpty(line)) {
- hasEmptyLines = true;
- line++;
- state.line = line;
- }
- }
-};
-
-
-/**
- * ParserBlock.parse(str, md, env, outTokens)
- *
- * Process input string and push block tokens into `outTokens`
- **/
-ParserBlock.prototype.parse = function (src, md, env, outTokens) {
- var state;
-
- if (!src) { return; }
-
- state = new this.State(src, md, env, outTokens);
-
- this.tokenize(state, state.line, state.lineMax);
-};
-
-
-ParserBlock.prototype.State = require('./rules_block/state_block');
-
-
-module.exports = ParserBlock;
-
-},{"./ruler":337,"./rules_block/blockquote":338,"./rules_block/code":339,"./rules_block/fence":340,"./rules_block/heading":341,"./rules_block/hr":342,"./rules_block/html_block":343,"./rules_block/lheading":344,"./rules_block/list":345,"./rules_block/paragraph":346,"./rules_block/reference":347,"./rules_block/state_block":348,"./rules_block/table":349}],331:[function(require,module,exports){
-/** internal
- * class Core
- *
- * Top-level rules executor. Glues block/inline parsers and does intermediate
- * transformations.
- **/
-'use strict';
-
-
-var Ruler = require('./ruler');
-
-
-var _rules = [
- [ 'normalize', require('./rules_core/normalize') ],
- [ 'block', require('./rules_core/block') ],
- [ 'inline', require('./rules_core/inline') ],
- [ 'linkify', require('./rules_core/linkify') ],
- [ 'replacements', require('./rules_core/replacements') ],
- [ 'smartquotes', require('./rules_core/smartquotes') ]
-];
-
-
-/**
- * new Core()
- **/
-function Core() {
- /**
- * Core#ruler -> Ruler
- *
- * [[Ruler]] instance. Keep configuration of core rules.
- **/
- this.ruler = new Ruler();
-
- for (var i = 0; i < _rules.length; i++) {
- this.ruler.push(_rules[i][0], _rules[i][1]);
- }
-}
-
-
-/**
- * Core.process(state)
- *
- * Executes core chain rules.
- **/
-Core.prototype.process = function (state) {
- var i, l, rules;
-
- rules = this.ruler.getRules('');
-
- for (i = 0, l = rules.length; i < l; i++) {
- rules[i](state);
- }
-};
-
-Core.prototype.State = require('./rules_core/state_core');
-
-
-module.exports = Core;
-
-},{"./ruler":337,"./rules_core/block":350,"./rules_core/inline":351,"./rules_core/linkify":352,"./rules_core/normalize":353,"./rules_core/replacements":354,"./rules_core/smartquotes":355,"./rules_core/state_core":356}],332:[function(require,module,exports){
-/** internal
- * class ParserInline
- *
- * Tokenizes paragraph content.
- **/
-'use strict';
-
-
-var Ruler = require('./ruler');
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Parser rules
-
-var _rules = [
- [ 'text', require('./rules_inline/text') ],
- [ 'newline', require('./rules_inline/newline') ],
- [ 'escape', require('./rules_inline/escape') ],
- [ 'backticks', require('./rules_inline/backticks') ],
- [ 'strikethrough', require('./rules_inline/strikethrough').tokenize ],
- [ 'emphasis', require('./rules_inline/emphasis').tokenize ],
- [ 'link', require('./rules_inline/link') ],
- [ 'image', require('./rules_inline/image') ],
- [ 'autolink', require('./rules_inline/autolink') ],
- [ 'html_inline', require('./rules_inline/html_inline') ],
- [ 'entity', require('./rules_inline/entity') ]
-];
-
-var _rules2 = [
- [ 'balance_pairs', require('./rules_inline/balance_pairs') ],
- [ 'strikethrough', require('./rules_inline/strikethrough').postProcess ],
- [ 'emphasis', require('./rules_inline/emphasis').postProcess ],
- [ 'text_collapse', require('./rules_inline/text_collapse') ]
-];
-
-
-/**
- * new ParserInline()
- **/
-function ParserInline() {
- var i;
-
- /**
- * ParserInline#ruler -> Ruler
- *
- * [[Ruler]] instance. Keep configuration of inline rules.
- **/
- this.ruler = new Ruler();
-
- for (i = 0; i < _rules.length; i++) {
- this.ruler.push(_rules[i][0], _rules[i][1]);
- }
-
- /**
- * ParserInline#ruler2 -> Ruler
- *
- * [[Ruler]] instance. Second ruler used for post-processing
- * (e.g. in emphasis-like rules).
- **/
- this.ruler2 = new Ruler();
-
- for (i = 0; i < _rules2.length; i++) {
- this.ruler2.push(_rules2[i][0], _rules2[i][1]);
- }
-}
-
-
-// Skip single token by running all rules in validation mode;
-// returns `true` if any rule reported success
-//
-ParserInline.prototype.skipToken = function (state) {
- var ok, i, pos = state.pos,
- rules = this.ruler.getRules(''),
- len = rules.length,
- maxNesting = state.md.options.maxNesting,
- cache = state.cache;
-
-
- if (typeof cache[pos] !== 'undefined') {
- state.pos = cache[pos];
- return;
- }
-
- if (state.level < maxNesting) {
- for (i = 0; i < len; i++) {
- // Increment state.level and decrement it later to limit recursion.
- // It's harmless to do here, because no tokens are created. But ideally,
- // we'd need a separate private state variable for this purpose.
- //
- state.level++;
- ok = rules[i](state, true);
- state.level--;
-
- if (ok) { break; }
- }
- } else {
- // Too much nesting, just skip until the end of the paragraph.
- //
- // NOTE: this will cause links to behave incorrectly in the following case,
- // when an amount of `[` is exactly equal to `maxNesting + 1`:
- //
- // [[[[[[[[[[[[[[[[[[[[[foo]()
- //
- // TODO: remove this workaround when CM standard will allow nested links
- // (we can replace it by preventing links from being parsed in
- // validation mode)
- //
- state.pos = state.posMax;
- }
-
- if (!ok) { state.pos++; }
- cache[pos] = state.pos;
-};
-
-
-// Generate tokens for input range
-//
-ParserInline.prototype.tokenize = function (state) {
- var ok, i,
- rules = this.ruler.getRules(''),
- len = rules.length,
- end = state.posMax,
- maxNesting = state.md.options.maxNesting;
-
- while (state.pos < end) {
- // Try all possible rules.
- // On success, rule should:
- //
- // - update `state.pos`
- // - update `state.tokens`
- // - return true
-
- if (state.level < maxNesting) {
- for (i = 0; i < len; i++) {
- ok = rules[i](state, false);
- if (ok) { break; }
- }
- }
-
- if (ok) {
- if (state.pos >= end) { break; }
- continue;
- }
-
- state.pending += state.src[state.pos++];
- }
-
- if (state.pending) {
- state.pushPending();
- }
-};
-
-
-/**
- * ParserInline.parse(str, md, env, outTokens)
- *
- * Process input string and push inline tokens into `outTokens`
- **/
-ParserInline.prototype.parse = function (str, md, env, outTokens) {
- var i, rules, len;
- var state = new this.State(str, md, env, outTokens);
-
- this.tokenize(state);
-
- rules = this.ruler2.getRules('');
- len = rules.length;
-
- for (i = 0; i < len; i++) {
- rules[i](state);
- }
-};
-
-
-ParserInline.prototype.State = require('./rules_inline/state_inline');
-
-
-module.exports = ParserInline;
-
-},{"./ruler":337,"./rules_inline/autolink":357,"./rules_inline/backticks":358,"./rules_inline/balance_pairs":359,"./rules_inline/emphasis":360,"./rules_inline/entity":361,"./rules_inline/escape":362,"./rules_inline/html_inline":363,"./rules_inline/image":364,"./rules_inline/link":365,"./rules_inline/newline":366,"./rules_inline/state_inline":367,"./rules_inline/strikethrough":368,"./rules_inline/text":369,"./rules_inline/text_collapse":370}],333:[function(require,module,exports){
-// Commonmark default options
-
-'use strict';
-
-
-module.exports = {
- options: {
- html: true, // Enable HTML tags in source
- xhtmlOut: true, // Use '/' to close single tags (<br />)
- breaks: false, // Convert '\n' in paragraphs into <br>
- langPrefix: 'language-', // CSS language prefix for fenced blocks
- linkify: false, // autoconvert URL-like texts to links
-
- // Enable some language-neutral replacements + quotes beautification
- typographer: false,
-
- // Double + single quotes replacement pairs, when typographer enabled,
- // and smartquotes on. Could be either a String or an Array.
- //
- // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
- // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
- quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
-
- // Highlighter function. Should return escaped HTML,
- // or '' if the source string is not changed and should be escaped externaly.
- // If result starts with <pre... internal wrapper is skipped.
- //
- // function (/*str, lang*/) { return ''; }
- //
- highlight: null,
-
- maxNesting: 20 // Internal protection, recursion limit
- },
-
- components: {
-
- core: {
- rules: [
- 'normalize',
- 'block',
- 'inline'
- ]
- },
-
- block: {
- rules: [
- 'blockquote',
- 'code',
- 'fence',
- 'heading',
- 'hr',
- 'html_block',
- 'lheading',
- 'list',
- 'reference',
- 'paragraph'
- ]
- },
-
- inline: {
- rules: [
- 'autolink',
- 'backticks',
- 'emphasis',
- 'entity',
- 'escape',
- 'html_inline',
- 'image',
- 'link',
- 'newline',
- 'text'
- ],
- rules2: [
- 'balance_pairs',
- 'emphasis',
- 'text_collapse'
- ]
- }
- }
-};
-
-},{}],334:[function(require,module,exports){
-// markdown-it default options
-
-'use strict';
-
-
-module.exports = {
- options: {
- html: false, // Enable HTML tags in source
- xhtmlOut: false, // Use '/' to close single tags (<br />)
- breaks: false, // Convert '\n' in paragraphs into <br>
- langPrefix: 'language-', // CSS language prefix for fenced blocks
- linkify: false, // autoconvert URL-like texts to links
-
- // Enable some language-neutral replacements + quotes beautification
- typographer: false,
-
- // Double + single quotes replacement pairs, when typographer enabled,
- // and smartquotes on. Could be either a String or an Array.
- //
- // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
- // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
- quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
-
- // Highlighter function. Should return escaped HTML,
- // or '' if the source string is not changed and should be escaped externaly.
- // If result starts with <pre... internal wrapper is skipped.
- //
- // function (/*str, lang*/) { return ''; }
- //
- highlight: null,
-
- maxNesting: 100 // Internal protection, recursion limit
- },
-
- components: {
-
- core: {},
- block: {},
- inline: {}
- }
-};
-
-},{}],335:[function(require,module,exports){
-// "Zero" preset, with nothing enabled. Useful for manual configuring of simple
-// modes. For example, to parse bold/italic only.
-
-'use strict';
-
-
-module.exports = {
- options: {
- html: false, // Enable HTML tags in source
- xhtmlOut: false, // Use '/' to close single tags (<br />)
- breaks: false, // Convert '\n' in paragraphs into <br>
- langPrefix: 'language-', // CSS language prefix for fenced blocks
- linkify: false, // autoconvert URL-like texts to links
-
- // Enable some language-neutral replacements + quotes beautification
- typographer: false,
-
- // Double + single quotes replacement pairs, when typographer enabled,
- // and smartquotes on. Could be either a String or an Array.
- //
- // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
- // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
- quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
-
- // Highlighter function. Should return escaped HTML,
- // or '' if the source string is not changed and should be escaped externaly.
- // If result starts with <pre... internal wrapper is skipped.
- //
- // function (/*str, lang*/) { return ''; }
- //
- highlight: null,
-
- maxNesting: 20 // Internal protection, recursion limit
- },
-
- components: {
-
- core: {
- rules: [
- 'normalize',
- 'block',
- 'inline'
- ]
- },
-
- block: {
- rules: [
- 'paragraph'
- ]
- },
-
- inline: {
- rules: [
- 'text'
- ],
- rules2: [
- 'balance_pairs',
- 'text_collapse'
- ]
- }
- }
-};
-
-},{}],336:[function(require,module,exports){
-/**
- * class Renderer
- *
- * Generates HTML from parsed token stream. Each instance has independent
- * copy of rules. Those can be rewritten with ease. Also, you can add new
- * rules if you create plugin and adds new token types.
- **/
-'use strict';
-
-
-var assign = require('./common/utils').assign;
-var unescapeAll = require('./common/utils').unescapeAll;
-var escapeHtml = require('./common/utils').escapeHtml;
-
-
-////////////////////////////////////////////////////////////////////////////////
-
-var default_rules = {};
-
-
-default_rules.code_inline = function (tokens, idx, options, env, slf) {
- var token = tokens[idx];
-
- return '<code' + slf.renderAttrs(token) + '>' +
- escapeHtml(tokens[idx].content) +
- '</code>';
-};
-
-
-default_rules.code_block = function (tokens, idx, options, env, slf) {
- var token = tokens[idx];
-
- return '<pre' + slf.renderAttrs(token) + '><code>' +
- escapeHtml(tokens[idx].content) +
- '</code></pre>\n';
-};
-
-
-default_rules.fence = function (tokens, idx, options, env, slf) {
- var token = tokens[idx],
- info = token.info ? unescapeAll(token.info).trim() : '',
- langName = '',
- highlighted, i, tmpAttrs, tmpToken;
-
- if (info) {
- langName = info.split(/\s+/g)[0];
- }
-
- if (options.highlight) {
- highlighted = options.highlight(token.content, langName) || escapeHtml(token.content);
- } else {
- highlighted = escapeHtml(token.content);
- }
-
- if (highlighted.indexOf('<pre') === 0) {
- return highlighted + '\n';
- }
-
- // If language exists, inject class gently, without modifying original token.
- // May be, one day we will add .clone() for token and simplify this part, but
- // now we prefer to keep things local.
- if (info) {
- i = token.attrIndex('class');
- tmpAttrs = token.attrs ? token.attrs.slice() : [];
-
- if (i < 0) {
- tmpAttrs.push([ 'class', options.langPrefix + langName ]);
- } else {
- tmpAttrs[i][1] += ' ' + options.langPrefix + langName;
- }
-
- // Fake token just to render attributes
- tmpToken = {
- attrs: tmpAttrs
- };
-
- return '<pre><code' + slf.renderAttrs(tmpToken) + '>'
- + highlighted
- + '</code></pre>\n';
- }
-
-
- return '<pre><code' + slf.renderAttrs(token) + '>'
- + highlighted
- + '</code></pre>\n';
-};
-
-
-default_rules.image = function (tokens, idx, options, env, slf) {
- var token = tokens[idx];
-
- // "alt" attr MUST be set, even if empty. Because it's mandatory and
- // should be placed on proper position for tests.
- //
- // Replace content with actual value
-
- token.attrs[token.attrIndex('alt')][1] =
- slf.renderInlineAsText(token.children, options, env);
-
- return slf.renderToken(tokens, idx, options);
-};
-
-
-default_rules.hardbreak = function (tokens, idx, options /*, env */) {
- return options.xhtmlOut ? '<br />\n' : '<br>\n';
-};
-default_rules.softbreak = function (tokens, idx, options /*, env */) {
- return options.breaks ? (options.xhtmlOut ? '<br />\n' : '<br>\n') : '\n';
-};
-
-
-default_rules.text = function (tokens, idx /*, options, env */) {
- return escapeHtml(tokens[idx].content);
-};
-
-
-default_rules.html_block = function (tokens, idx /*, options, env */) {
- return tokens[idx].content;
-};
-default_rules.html_inline = function (tokens, idx /*, options, env */) {
- return tokens[idx].content;
-};
-
-
-/**
- * new Renderer()
- *
- * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.
- **/
-function Renderer() {
-
- /**
- * Renderer#rules -> Object
- *
- * Contains render rules for tokens. Can be updated and extended.
- *
- * ##### Example
- *
- * ```javascript
- * var md = require('markdown-it')();
- *
- * md.renderer.rules.strong_open = function () { return '<b>'; };
- * md.renderer.rules.strong_close = function () { return '</b>'; };
- *
- * var result = md.renderInline(...);
- * ```
- *
- * Each rule is called as independed static function with fixed signature:
- *
- * ```javascript
- * function my_token_render(tokens, idx, options, env, renderer) {
- * // ...
- * return renderedHTML;
- * }
- * ```
- *
- * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)
- * for more details and examples.
- **/
- this.rules = assign({}, default_rules);
-}
-
-
-/**
- * Renderer.renderAttrs(token) -> String
- *
- * Render token attributes to string.
- **/
-Renderer.prototype.renderAttrs = function renderAttrs(token) {
- var i, l, result;
-
- if (!token.attrs) { return ''; }
-
- result = '';
-
- for (i = 0, l = token.attrs.length; i < l; i++) {
- result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"';
- }
-
- return result;
-};
-
-
-/**
- * Renderer.renderToken(tokens, idx, options) -> String
- * - tokens (Array): list of tokens
- * - idx (Numbed): token index to render
- * - options (Object): params of parser instance
- *
- * Default token renderer. Can be overriden by custom function
- * in [[Renderer#rules]].
- **/
-Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {
- var nextToken,
- result = '',
- needLf = false,
- token = tokens[idx];
-
- // Tight list paragraphs
- if (token.hidden) {
- return '';
- }
-
- // Insert a newline between hidden paragraph and subsequent opening
- // block-level tag.
- //
- // For example, here we should insert a newline before blockquote:
- // - a
- // >
- //
- if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {
- result += '\n';
- }
-
- // Add token name, e.g. `<img`
- result += (token.nesting === -1 ? '</' : '<') + token.tag;
-
- // Encode attributes, e.g. `<img src="foo"`
- result += this.renderAttrs(token);
-
- // Add a slash for self-closing tags, e.g. `<img src="foo" /`
- if (token.nesting === 0 && options.xhtmlOut) {
- result += ' /';
- }
-
- // Check if we need to add a newline after this tag
- if (token.block) {
- needLf = true;
-
- if (token.nesting === 1) {
- if (idx + 1 < tokens.length) {
- nextToken = tokens[idx + 1];
-
- if (nextToken.type === 'inline' || nextToken.hidden) {
- // Block-level tag containing an inline tag.
- //
- needLf = false;
-
- } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {
- // Opening tag + closing tag of the same type. E.g. `<li></li>`.
- //
- needLf = false;
- }
- }
- }
- }
-
- result += needLf ? '>\n' : '>';
-
- return result;
-};
-
-
-/**
- * Renderer.renderInline(tokens, options, env) -> String
- * - tokens (Array): list on block tokens to renter
- * - options (Object): params of parser instance
- * - env (Object): additional data from parsed input (references, for example)
- *
- * The same as [[Renderer.render]], but for single token of `inline` type.
- **/
-Renderer.prototype.renderInline = function (tokens, options, env) {
- var type,
- result = '',
- rules = this.rules;
-
- for (var i = 0, len = tokens.length; i < len; i++) {
- type = tokens[i].type;
-
- if (typeof rules[type] !== 'undefined') {
- result += rules[type](tokens, i, options, env, this);
- } else {
- result += this.renderToken(tokens, i, options);
- }
- }
-
- return result;
-};
-
-
-/** internal
- * Renderer.renderInlineAsText(tokens, options, env) -> String
- * - tokens (Array): list on block tokens to renter
- * - options (Object): params of parser instance
- * - env (Object): additional data from parsed input (references, for example)
- *
- * Special kludge for image `alt` attributes to conform CommonMark spec.
- * Don't try to use it! Spec requires to show `alt` content with stripped markup,
- * instead of simple escaping.
- **/
-Renderer.prototype.renderInlineAsText = function (tokens, options, env) {
- var result = '';
-
- for (var i = 0, len = tokens.length; i < len; i++) {
- if (tokens[i].type === 'text') {
- result += tokens[i].content;
- } else if (tokens[i].type === 'image') {
- result += this.renderInlineAsText(tokens[i].children, options, env);
- }
- }
-
- return result;
-};
-
-
-/**
- * Renderer.render(tokens, options, env) -> String
- * - tokens (Array): list on block tokens to renter
- * - options (Object): params of parser instance
- * - env (Object): additional data from parsed input (references, for example)
- *
- * Takes token stream and generates HTML. Probably, you will never need to call
- * this method directly.
- **/
-Renderer.prototype.render = function (tokens, options, env) {
- var i, len, type,
- result = '',
- rules = this.rules;
-
- for (i = 0, len = tokens.length; i < len; i++) {
- type = tokens[i].type;
-
- if (type === 'inline') {
- result += this.renderInline(tokens[i].children, options, env);
- } else if (typeof rules[type] !== 'undefined') {
- result += rules[tokens[i].type](tokens, i, options, env, this);
- } else {
- result += this.renderToken(tokens, i, options, env);
- }
- }
-
- return result;
-};
-
-module.exports = Renderer;
-
-},{"./common/utils":324}],337:[function(require,module,exports){
-/**
- * class Ruler
- *
- * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and
- * [[MarkdownIt#inline]] to manage sequences of functions (rules):
- *
- * - keep rules in defined order
- * - assign the name to each rule
- * - enable/disable rules
- * - add/replace rules
- * - allow assign rules to additional named chains (in the same)
- * - cacheing lists of active rules
- *
- * You will not need use this class directly until write plugins. For simple
- * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and
- * [[MarkdownIt.use]].
- **/
-'use strict';
-
-
-/**
- * new Ruler()
- **/
-function Ruler() {
- // List of added rules. Each element is:
- //
- // {
- // name: XXX,
- // enabled: Boolean,
- // fn: Function(),
- // alt: [ name2, name3 ]
- // }
- //
- this.__rules__ = [];
-
- // Cached rule chains.
- //
- // First level - chain name, '' for default.
- // Second level - diginal anchor for fast filtering by charcodes.
- //
- this.__cache__ = null;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// Helper methods, should not be used directly
-
-
-// Find rule index by name
-//
-Ruler.prototype.__find__ = function (name) {
- for (var i = 0; i < this.__rules__.length; i++) {
- if (this.__rules__[i].name === name) {
- return i;
- }
- }
- return -1;
-};
-
-
-// Build rules lookup cache
-//
-Ruler.prototype.__compile__ = function () {
- var self = this;
- var chains = [ '' ];
-
- // collect unique names
- self.__rules__.forEach(function (rule) {
- if (!rule.enabled) { return; }
-
- rule.alt.forEach(function (altName) {
- if (chains.indexOf(altName) < 0) {
- chains.push(altName);
- }
- });
- });
-
- self.__cache__ = {};
-
- chains.forEach(function (chain) {
- self.__cache__[chain] = [];
- self.__rules__.forEach(function (rule) {
- if (!rule.enabled) { return; }
-
- if (chain && rule.alt.indexOf(chain) < 0) { return; }
-
- self.__cache__[chain].push(rule.fn);
- });
- });
-};
-
-
-/**
- * Ruler.at(name, fn [, options])
- * - name (String): rule name to replace.
- * - fn (Function): new rule function.
- * - options (Object): new rule options (not mandatory).
- *
- * Replace rule by name with new function & options. Throws error if name not
- * found.
- *
- * ##### Options:
- *
- * - __alt__ - array with names of "alternate" chains.
- *
- * ##### Example
- *
- * Replace existing typorgapher replacement rule with new one:
- *
- * ```javascript
- * var md = require('markdown-it')();
- *
- * md.core.ruler.at('replacements', function replace(state) {
- * //...
- * });
- * ```
- **/
-Ruler.prototype.at = function (name, fn, options) {
- var index = this.__find__(name);
- var opt = options || {};
-
- if (index === -1) { throw new Error('Parser rule not found: ' + name); }
-
- this.__rules__[index].fn = fn;
- this.__rules__[index].alt = opt.alt || [];
- this.__cache__ = null;
-};
-
-
-/**
- * Ruler.before(beforeName, ruleName, fn [, options])
- * - beforeName (String): new rule will be added before this one.
- * - ruleName (String): name of added rule.
- * - fn (Function): rule function.
- * - options (Object): rule options (not mandatory).
- *
- * Add new rule to chain before one with given name. See also
- * [[Ruler.after]], [[Ruler.push]].
- *
- * ##### Options:
- *
- * - __alt__ - array with names of "alternate" chains.
- *
- * ##### Example
- *
- * ```javascript
- * var md = require('markdown-it')();
- *
- * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {
- * //...
- * });
- * ```
- **/
-Ruler.prototype.before = function (beforeName, ruleName, fn, options) {
- var index = this.__find__(beforeName);
- var opt = options || {};
-
- if (index === -1) { throw new Error('Parser rule not found: ' + beforeName); }
-
- this.__rules__.splice(index, 0, {
- name: ruleName,
- enabled: true,
- fn: fn,
- alt: opt.alt || []
- });
-
- this.__cache__ = null;
-};
-
-
-/**
- * Ruler.after(afterName, ruleName, fn [, options])
- * - afterName (String): new rule will be added after this one.
- * - ruleName (String): name of added rule.
- * - fn (Function): rule function.
- * - options (Object): rule options (not mandatory).
- *
- * Add new rule to chain after one with given name. See also
- * [[Ruler.before]], [[Ruler.push]].
- *
- * ##### Options:
- *
- * - __alt__ - array with names of "alternate" chains.
- *
- * ##### Example
- *
- * ```javascript
- * var md = require('markdown-it')();
- *
- * md.inline.ruler.after('text', 'my_rule', function replace(state) {
- * //...
- * });
- * ```
- **/
-Ruler.prototype.after = function (afterName, ruleName, fn, options) {
- var index = this.__find__(afterName);
- var opt = options || {};
-
- if (index === -1) { throw new Error('Parser rule not found: ' + afterName); }
-
- this.__rules__.splice(index + 1, 0, {
- name: ruleName,
- enabled: true,
- fn: fn,
- alt: opt.alt || []
- });
-
- this.__cache__ = null;
-};
-
-/**
- * Ruler.push(ruleName, fn [, options])
- * - ruleName (String): name of added rule.
- * - fn (Function): rule function.
- * - options (Object): rule options (not mandatory).
- *
- * Push new rule to the end of chain. See also
- * [[Ruler.before]], [[Ruler.after]].
- *
- * ##### Options:
- *
- * - __alt__ - array with names of "alternate" chains.
- *
- * ##### Example
- *
- * ```javascript
- * var md = require('markdown-it')();
- *
- * md.core.ruler.push('my_rule', function replace(state) {
- * //...
- * });
- * ```
- **/
-Ruler.prototype.push = function (ruleName, fn, options) {
- var opt = options || {};
-
- this.__rules__.push({
- name: ruleName,
- enabled: true,
- fn: fn,
- alt: opt.alt || []
- });
-
- this.__cache__ = null;
-};
-
-
-/**
- * Ruler.enable(list [, ignoreInvalid]) -> Array
- * - list (String|Array): list of rule names to enable.
- * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
- *
- * Enable rules with given names. If any rule name not found - throw Error.
- * Errors can be disabled by second param.
- *
- * Returns list of found rule names (if no exception happened).
- *
- * See also [[Ruler.disable]], [[Ruler.enableOnly]].
- **/
-Ruler.prototype.enable = function (list, ignoreInvalid) {
- if (!Array.isArray(list)) { list = [ list ]; }
-
- var result = [];
-
- // Search by name and enable
- list.forEach(function (name) {
- var idx = this.__find__(name);
-
- if (idx < 0) {
- if (ignoreInvalid) { return; }
- throw new Error('Rules manager: invalid rule name ' + name);
- }
- this.__rules__[idx].enabled = true;
- result.push(name);
- }, this);
-
- this.__cache__ = null;
- return result;
-};
-
-
-/**
- * Ruler.enableOnly(list [, ignoreInvalid])
- * - list (String|Array): list of rule names to enable (whitelist).
- * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
- *
- * Enable rules with given names, and disable everything else. If any rule name
- * not found - throw Error. Errors can be disabled by second param.
- *
- * See also [[Ruler.disable]], [[Ruler.enable]].
- **/
-Ruler.prototype.enableOnly = function (list, ignoreInvalid) {
- if (!Array.isArray(list)) { list = [ list ]; }
-
- this.__rules__.forEach(function (rule) { rule.enabled = false; });
-
- this.enable(list, ignoreInvalid);
-};
-
-
-/**
- * Ruler.disable(list [, ignoreInvalid]) -> Array
- * - list (String|Array): list of rule names to disable.
- * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
- *
- * Disable rules with given names. If any rule name not found - throw Error.
- * Errors can be disabled by second param.
- *
- * Returns list of found rule names (if no exception happened).
- *
- * See also [[Ruler.enable]], [[Ruler.enableOnly]].
- **/
-Ruler.prototype.disable = function (list, ignoreInvalid) {
- if (!Array.isArray(list)) { list = [ list ]; }
-
- var result = [];
-
- // Search by name and disable
- list.forEach(function (name) {
- var idx = this.__find__(name);
-
- if (idx < 0) {
- if (ignoreInvalid) { return; }
- throw new Error('Rules manager: invalid rule name ' + name);
- }
- this.__rules__[idx].enabled = false;
- result.push(name);
- }, this);
-
- this.__cache__ = null;
- return result;
-};
-
-
-/**
- * Ruler.getRules(chainName) -> Array
- *
- * Return array of active functions (rules) for given chain name. It analyzes
- * rules configuration, compiles caches if not exists and returns result.
- *
- * Default chain name is `''` (empty string). It can't be skipped. That's
- * done intentionally, to keep signature monomorphic for high speed.
- **/
-Ruler.prototype.getRules = function (chainName) {
- if (this.__cache__ === null) {
- this.__compile__();
- }
-
- // Chain can be empty, if rules disabled. But we still have to return Array.
- return this.__cache__[chainName] || [];
-};
-
-module.exports = Ruler;
-
-},{}],338:[function(require,module,exports){
-// Block quotes
-
-'use strict';
-
-var isSpace = require('../common/utils').isSpace;
-
-
-module.exports = function blockquote(state, startLine, endLine, silent) {
- var adjustTab,
- ch,
- i,
- initial,
- l,
- lastLineEmpty,
- lines,
- nextLine,
- offset,
- oldBMarks,
- oldBSCount,
- oldIndent,
- oldParentType,
- oldSCount,
- oldTShift,
- spaceAfterMarker,
- terminate,
- terminatorRules,
- token,
- wasOutdented,
- oldLineMax = state.lineMax,
- pos = state.bMarks[startLine] + state.tShift[startLine],
- max = state.eMarks[startLine];
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- // check the block quote marker
- if (state.src.charCodeAt(pos++) !== 0x3E/* > */) { return false; }
-
- // we know that it's going to be a valid blockquote,
- // so no point trying to find the end of it in silent mode
- if (silent) { return true; }
-
- // skip spaces after ">" and re-calculate offset
- initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);
-
- // skip one optional space after '>'
- if (state.src.charCodeAt(pos) === 0x20 /* space */) {
- // ' > test '
- // ^ -- position start of line here:
- pos++;
- initial++;
- offset++;
- adjustTab = false;
- spaceAfterMarker = true;
- } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
- spaceAfterMarker = true;
-
- if ((state.bsCount[startLine] + offset) % 4 === 3) {
- // ' >\t test '
- // ^ -- position start of line here (tab has width===1)
- pos++;
- initial++;
- offset++;
- adjustTab = false;
- } else {
- // ' >\t test '
- // ^ -- position start of line here + shift bsCount slightly
- // to make extra space appear
- adjustTab = true;
- }
- } else {
- spaceAfterMarker = false;
- }
-
- oldBMarks = [ state.bMarks[startLine] ];
- state.bMarks[startLine] = pos;
-
- while (pos < max) {
- ch = state.src.charCodeAt(pos);
-
- if (isSpace(ch)) {
- if (ch === 0x09) {
- offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4;
- } else {
- offset++;
- }
- } else {
- break;
- }
-
- pos++;
- }
-
- oldBSCount = [ state.bsCount[startLine] ];
- state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0);
-
- lastLineEmpty = pos >= max;
-
- oldSCount = [ state.sCount[startLine] ];
- state.sCount[startLine] = offset - initial;
-
- oldTShift = [ state.tShift[startLine] ];
- state.tShift[startLine] = pos - state.bMarks[startLine];
-
- terminatorRules = state.md.block.ruler.getRules('blockquote');
-
- oldParentType = state.parentType;
- state.parentType = 'blockquote';
- wasOutdented = false;
-
- // Search the end of the block
- //
- // Block ends with either:
- // 1. an empty line outside:
- // ```
- // > test
- //
- // ```
- // 2. an empty line inside:
- // ```
- // >
- // test
- // ```
- // 3. another tag:
- // ```
- // > test
- // - - -
- // ```
- for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
- // check if it's outdented, i.e. it's inside list item and indented
- // less than said list item:
- //
- // ```
- // 1. anything
- // > current blockquote
- // 2. checking this line
- // ```
- if (state.sCount[nextLine] < state.blkIndent) wasOutdented = true;
-
- pos = state.bMarks[nextLine] + state.tShift[nextLine];
- max = state.eMarks[nextLine];
-
- if (pos >= max) {
- // Case 1: line is not inside the blockquote, and this line is empty.
- break;
- }
-
- if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !wasOutdented) {
- // This line is inside the blockquote.
-
- // skip spaces after ">" and re-calculate offset
- initial = offset = state.sCount[nextLine] + pos - (state.bMarks[nextLine] + state.tShift[nextLine]);
-
- // skip one optional space after '>'
- if (state.src.charCodeAt(pos) === 0x20 /* space */) {
- // ' > test '
- // ^ -- position start of line here:
- pos++;
- initial++;
- offset++;
- adjustTab = false;
- spaceAfterMarker = true;
- } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
- spaceAfterMarker = true;
-
- if ((state.bsCount[nextLine] + offset) % 4 === 3) {
- // ' >\t test '
- // ^ -- position start of line here (tab has width===1)
- pos++;
- initial++;
- offset++;
- adjustTab = false;
- } else {
- // ' >\t test '
- // ^ -- position start of line here + shift bsCount slightly
- // to make extra space appear
- adjustTab = true;
- }
- } else {
- spaceAfterMarker = false;
- }
-
- oldBMarks.push(state.bMarks[nextLine]);
- state.bMarks[nextLine] = pos;
-
- while (pos < max) {
- ch = state.src.charCodeAt(pos);
-
- if (isSpace(ch)) {
- if (ch === 0x09) {
- offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
- } else {
- offset++;
- }
- } else {
- break;
- }
-
- pos++;
- }
-
- lastLineEmpty = pos >= max;
-
- oldBSCount.push(state.bsCount[nextLine]);
- state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
-
- oldSCount.push(state.sCount[nextLine]);
- state.sCount[nextLine] = offset - initial;
-
- oldTShift.push(state.tShift[nextLine]);
- state.tShift[nextLine] = pos - state.bMarks[nextLine];
- continue;
- }
-
- // Case 2: line is not inside the blockquote, and the last line was empty.
- if (lastLineEmpty) { break; }
-
- // Case 3: another tag found.
- terminate = false;
- for (i = 0, l = terminatorRules.length; i < l; i++) {
- if (terminatorRules[i](state, nextLine, endLine, true)) {
- terminate = true;
- break;
- }
- }
-
- if (terminate) {
- // Quirk to enforce "hard termination mode" for paragraphs;
- // normally if you call `tokenize(state, startLine, nextLine)`,
- // paragraphs will look below nextLine for paragraph continuation,
- // but if blockquote is terminated by another tag, they shouldn't
- state.lineMax = nextLine;
-
- if (state.blkIndent !== 0) {
- // state.blkIndent was non-zero, we now set it to zero,
- // so we need to re-calculate all offsets to appear as
- // if indent wasn't changed
- oldBMarks.push(state.bMarks[nextLine]);
- oldBSCount.push(state.bsCount[nextLine]);
- oldTShift.push(state.tShift[nextLine]);
- oldSCount.push(state.sCount[nextLine]);
- state.sCount[nextLine] -= state.blkIndent;
- }
-
- break;
- }
-
- oldBMarks.push(state.bMarks[nextLine]);
- oldBSCount.push(state.bsCount[nextLine]);
- oldTShift.push(state.tShift[nextLine]);
- oldSCount.push(state.sCount[nextLine]);
-
- // A negative indentation means that this is a paragraph continuation
- //
- state.sCount[nextLine] = -1;
- }
-
- oldIndent = state.blkIndent;
- state.blkIndent = 0;
-
- token = state.push('blockquote_open', 'blockquote', 1);
- token.markup = '>';
- token.map = lines = [ startLine, 0 ];
-
- state.md.block.tokenize(state, startLine, nextLine);
-
- token = state.push('blockquote_close', 'blockquote', -1);
- token.markup = '>';
-
- state.lineMax = oldLineMax;
- state.parentType = oldParentType;
- lines[1] = state.line;
-
- // Restore original tShift; this might not be necessary since the parser
- // has already been here, but just to make sure we can do that.
- for (i = 0; i < oldTShift.length; i++) {
- state.bMarks[i + startLine] = oldBMarks[i];
- state.tShift[i + startLine] = oldTShift[i];
- state.sCount[i + startLine] = oldSCount[i];
- state.bsCount[i + startLine] = oldBSCount[i];
- }
- state.blkIndent = oldIndent;
-
- return true;
-};
-
-},{"../common/utils":324}],339:[function(require,module,exports){
-// Code block (4 spaces padded)
-
-'use strict';
-
-
-module.exports = function code(state, startLine, endLine/*, silent*/) {
- var nextLine, last, token;
-
- if (state.sCount[startLine] - state.blkIndent < 4) { return false; }
-
- last = nextLine = startLine + 1;
-
- while (nextLine < endLine) {
- if (state.isEmpty(nextLine)) {
- nextLine++;
- continue;
- }
-
- if (state.sCount[nextLine] - state.blkIndent >= 4) {
- nextLine++;
- last = nextLine;
- continue;
- }
- break;
- }
-
- state.line = last;
-
- token = state.push('code_block', 'code', 0);
- token.content = state.getLines(startLine, last, 4 + state.blkIndent, true);
- token.map = [ startLine, state.line ];
-
- return true;
-};
-
-},{}],340:[function(require,module,exports){
-// fences (``` lang, ~~~ lang)
-
-'use strict';
-
-
-module.exports = function fence(state, startLine, endLine, silent) {
- var marker, len, params, nextLine, mem, token, markup,
- haveEndMarker = false,
- pos = state.bMarks[startLine] + state.tShift[startLine],
- max = state.eMarks[startLine];
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- if (pos + 3 > max) { return false; }
-
- marker = state.src.charCodeAt(pos);
-
- if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {
- return false;
- }
-
- // scan marker length
- mem = pos;
- pos = state.skipChars(pos, marker);
-
- len = pos - mem;
-
- if (len < 3) { return false; }
-
- markup = state.src.slice(mem, pos);
- params = state.src.slice(pos, max);
-
- if (params.indexOf(String.fromCharCode(marker)) >= 0) { return false; }
-
- // Since start is found, we can report success here in validation mode
- if (silent) { return true; }
-
- // search end of block
- nextLine = startLine;
-
- for (;;) {
- nextLine++;
- if (nextLine >= endLine) {
- // unclosed block should be autoclosed by end of document.
- // also block seems to be autoclosed by end of parent
- break;
- }
-
- pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
- max = state.eMarks[nextLine];
-
- if (pos < max && state.sCount[nextLine] < state.blkIndent) {
- // non-empty line with negative indent should stop the list:
- // - ```
- // test
- break;
- }
-
- if (state.src.charCodeAt(pos) !== marker) { continue; }
-
- if (state.sCount[nextLine] - state.blkIndent >= 4) {
- // closing fence should be indented less than 4 spaces
- continue;
- }
-
- pos = state.skipChars(pos, marker);
-
- // closing code fence must be at least as long as the opening one
- if (pos - mem < len) { continue; }
-
- // make sure tail has spaces only
- pos = state.skipSpaces(pos);
-
- if (pos < max) { continue; }
-
- haveEndMarker = true;
- // found!
- break;
- }
-
- // If a fence has heading spaces, they should be removed from its inner block
- len = state.sCount[startLine];
-
- state.line = nextLine + (haveEndMarker ? 1 : 0);
-
- token = state.push('fence', 'code', 0);
- token.info = params;
- token.content = state.getLines(startLine + 1, nextLine, len, true);
- token.markup = markup;
- token.map = [ startLine, state.line ];
-
- return true;
-};
-
-},{}],341:[function(require,module,exports){
-// heading (#, ##, ...)
-
-'use strict';
-
-var isSpace = require('../common/utils').isSpace;
-
-
-module.exports = function heading(state, startLine, endLine, silent) {
- var ch, level, tmp, token,
- pos = state.bMarks[startLine] + state.tShift[startLine],
- max = state.eMarks[startLine];
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- ch = state.src.charCodeAt(pos);
-
- if (ch !== 0x23/* # */ || pos >= max) { return false; }
-
- // count heading level
- level = 1;
- ch = state.src.charCodeAt(++pos);
- while (ch === 0x23/* # */ && pos < max && level <= 6) {
- level++;
- ch = state.src.charCodeAt(++pos);
- }
-
- if (level > 6 || (pos < max && !isSpace(ch))) { return false; }
-
- if (silent) { return true; }
-
- // Let's cut tails like ' ### ' from the end of string
-
- max = state.skipSpacesBack(max, pos);
- tmp = state.skipCharsBack(max, 0x23, pos); // #
- if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {
- max = tmp;
- }
-
- state.line = startLine + 1;
-
- token = state.push('heading_open', 'h' + String(level), 1);
- token.markup = '########'.slice(0, level);
- token.map = [ startLine, state.line ];
-
- token = state.push('inline', '', 0);
- token.content = state.src.slice(pos, max).trim();
- token.map = [ startLine, state.line ];
- token.children = [];
-
- token = state.push('heading_close', 'h' + String(level), -1);
- token.markup = '########'.slice(0, level);
-
- return true;
-};
-
-},{"../common/utils":324}],342:[function(require,module,exports){
-// Horizontal rule
-
-'use strict';
-
-var isSpace = require('../common/utils').isSpace;
-
-
-module.exports = function hr(state, startLine, endLine, silent) {
- var marker, cnt, ch, token,
- pos = state.bMarks[startLine] + state.tShift[startLine],
- max = state.eMarks[startLine];
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- marker = state.src.charCodeAt(pos++);
-
- // Check hr marker
- if (marker !== 0x2A/* * */ &&
- marker !== 0x2D/* - */ &&
- marker !== 0x5F/* _ */) {
- return false;
- }
-
- // markers can be mixed with spaces, but there should be at least 3 of them
-
- cnt = 1;
- while (pos < max) {
- ch = state.src.charCodeAt(pos++);
- if (ch !== marker && !isSpace(ch)) { return false; }
- if (ch === marker) { cnt++; }
- }
-
- if (cnt < 3) { return false; }
-
- if (silent) { return true; }
-
- state.line = startLine + 1;
-
- token = state.push('hr', 'hr', 0);
- token.map = [ startLine, state.line ];
- token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
-
- return true;
-};
-
-},{"../common/utils":324}],343:[function(require,module,exports){
-// HTML block
-
-'use strict';
-
-
-var block_names = require('../common/html_blocks');
-var HTML_OPEN_CLOSE_TAG_RE = require('../common/html_re').HTML_OPEN_CLOSE_TAG_RE;
-
-// An array of opening and corresponding closing sequences for html tags,
-// last argument defines whether it can terminate a paragraph or not
-//
-var HTML_SEQUENCES = [
- [ /^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, true ],
- [ /^<!--/, /-->/, true ],
- [ /^<\?/, /\?>/, true ],
- [ /^<![A-Z]/, />/, true ],
- [ /^<!\[CDATA\[/, /\]\]>/, true ],
- [ new RegExp('^</?(' + block_names.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true ],
- [ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false ]
-];
-
-
-module.exports = function html_block(state, startLine, endLine, silent) {
- var i, nextLine, token, lineText,
- pos = state.bMarks[startLine] + state.tShift[startLine],
- max = state.eMarks[startLine];
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- if (!state.md.options.html) { return false; }
-
- if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
-
- lineText = state.src.slice(pos, max);
-
- for (i = 0; i < HTML_SEQUENCES.length; i++) {
- if (HTML_SEQUENCES[i][0].test(lineText)) { break; }
- }
-
- if (i === HTML_SEQUENCES.length) { return false; }
-
- if (silent) {
- // true if this sequence can be a terminator, false otherwise
- return HTML_SEQUENCES[i][2];
- }
-
- nextLine = startLine + 1;
-
- // If we are here - we detected HTML block.
- // Let's roll down till block end.
- if (!HTML_SEQUENCES[i][1].test(lineText)) {
- for (; nextLine < endLine; nextLine++) {
- if (state.sCount[nextLine] < state.blkIndent) { break; }
-
- pos = state.bMarks[nextLine] + state.tShift[nextLine];
- max = state.eMarks[nextLine];
- lineText = state.src.slice(pos, max);
-
- if (HTML_SEQUENCES[i][1].test(lineText)) {
- if (lineText.length !== 0) { nextLine++; }
- break;
- }
- }
- }
-
- state.line = nextLine;
-
- token = state.push('html_block', '', 0);
- token.map = [ startLine, nextLine ];
- token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
-
- return true;
-};
-
-},{"../common/html_blocks":322,"../common/html_re":323}],344:[function(require,module,exports){
-// lheading (---, ===)
-
-'use strict';
-
-
-module.exports = function lheading(state, startLine, endLine/*, silent*/) {
- var content, terminate, i, l, token, pos, max, level, marker,
- nextLine = startLine + 1, oldParentType,
- terminatorRules = state.md.block.ruler.getRules('paragraph');
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- oldParentType = state.parentType;
- state.parentType = 'paragraph'; // use paragraph to match terminatorRules
-
- // jump line-by-line until empty one or EOF
- for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
- // this would be a code block normally, but after paragraph
- // it's considered a lazy continuation regardless of what's there
- if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
-
- //
- // Check for underline in setext header
- //
- if (state.sCount[nextLine] >= state.blkIndent) {
- pos = state.bMarks[nextLine] + state.tShift[nextLine];
- max = state.eMarks[nextLine];
-
- if (pos < max) {
- marker = state.src.charCodeAt(pos);
-
- if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {
- pos = state.skipChars(pos, marker);
- pos = state.skipSpaces(pos);
-
- if (pos >= max) {
- level = (marker === 0x3D/* = */ ? 1 : 2);
- break;
- }
- }
- }
- }
-
- // quirk for blockquotes, this line should already be checked by that rule
- if (state.sCount[nextLine] < 0) { continue; }
-
- // Some tags can terminate paragraph without empty line.
- terminate = false;
- for (i = 0, l = terminatorRules.length; i < l; i++) {
- if (terminatorRules[i](state, nextLine, endLine, true)) {
- terminate = true;
- break;
- }
- }
- if (terminate) { break; }
- }
-
- if (!level) {
- // Didn't find valid underline
- return false;
- }
-
- content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
-
- state.line = nextLine + 1;
-
- token = state.push('heading_open', 'h' + String(level), 1);
- token.markup = String.fromCharCode(marker);
- token.map = [ startLine, state.line ];
-
- token = state.push('inline', '', 0);
- token.content = content;
- token.map = [ startLine, state.line - 1 ];
- token.children = [];
-
- token = state.push('heading_close', 'h' + String(level), -1);
- token.markup = String.fromCharCode(marker);
-
- state.parentType = oldParentType;
-
- return true;
-};
-
-},{}],345:[function(require,module,exports){
-// Lists
-
-'use strict';
-
-var isSpace = require('../common/utils').isSpace;
-
-
-// Search `[-+*][\n ]`, returns next pos after marker on success
-// or -1 on fail.
-function skipBulletListMarker(state, startLine) {
- var marker, pos, max, ch;
-
- pos = state.bMarks[startLine] + state.tShift[startLine];
- max = state.eMarks[startLine];
-
- marker = state.src.charCodeAt(pos++);
- // Check bullet
- if (marker !== 0x2A/* * */ &&
- marker !== 0x2D/* - */ &&
- marker !== 0x2B/* + */) {
- return -1;
- }
-
- if (pos < max) {
- ch = state.src.charCodeAt(pos);
-
- if (!isSpace(ch)) {
- // " -test " - is not a list item
- return -1;
- }
- }
-
- return pos;
-}
-
-// Search `\d+[.)][\n ]`, returns next pos after marker on success
-// or -1 on fail.
-function skipOrderedListMarker(state, startLine) {
- var ch,
- start = state.bMarks[startLine] + state.tShift[startLine],
- pos = start,
- max = state.eMarks[startLine];
-
- // List marker should have at least 2 chars (digit + dot)
- if (pos + 1 >= max) { return -1; }
-
- ch = state.src.charCodeAt(pos++);
-
- if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }
-
- for (;;) {
- // EOL -> fail
- if (pos >= max) { return -1; }
-
- ch = state.src.charCodeAt(pos++);
-
- if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {
-
- // List marker should have no more than 9 digits
- // (prevents integer overflow in browsers)
- if (pos - start >= 10) { return -1; }
-
- continue;
- }
-
- // found valid marker
- if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {
- break;
- }
-
- return -1;
- }
-
-
- if (pos < max) {
- ch = state.src.charCodeAt(pos);
-
- if (!isSpace(ch)) {
- // " 1.test " - is not a list item
- return -1;
- }
- }
- return pos;
-}
-
-function markTightParagraphs(state, idx) {
- var i, l,
- level = state.level + 2;
-
- for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) {
- if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {
- state.tokens[i + 2].hidden = true;
- state.tokens[i].hidden = true;
- i += 2;
- }
- }
-}
-
-
-module.exports = function list(state, startLine, endLine, silent) {
- var ch,
- contentStart,
- i,
- indent,
- indentAfterMarker,
- initial,
- isOrdered,
- itemLines,
- l,
- listLines,
- listTokIdx,
- markerCharCode,
- markerValue,
- max,
- nextLine,
- offset,
- oldIndent,
- oldLIndent,
- oldParentType,
- oldTShift,
- oldTight,
- pos,
- posAfterMarker,
- prevEmptyEnd,
- start,
- terminate,
- terminatorRules,
- token,
- isTerminatingParagraph = false,
- tight = true;
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- // limit conditions when list can interrupt
- // a paragraph (validation mode only)
- if (silent && state.parentType === 'paragraph') {
- // Next list item should still terminate previous list item;
- //
- // This code can fail if plugins use blkIndent as well as lists,
- // but I hope the spec gets fixed long before that happens.
- //
- if (state.tShift[startLine] >= state.blkIndent) {
- isTerminatingParagraph = true;
- }
- }
-
- // Detect list type and position after marker
- if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) {
- isOrdered = true;
- start = state.bMarks[startLine] + state.tShift[startLine];
- markerValue = Number(state.src.substr(start, posAfterMarker - start - 1));
-
- // If we're starting a new ordered list right after
- // a paragraph, it should start with 1.
- if (isTerminatingParagraph && markerValue !== 1) return false;
-
- } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) {
- isOrdered = false;
-
- } else {
- return false;
- }
-
- // If we're starting a new unordered list right after
- // a paragraph, first line should not be empty.
- if (isTerminatingParagraph) {
- if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine]) return false;
- }
-
- // We should terminate list on style change. Remember first one to compare.
- markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
-
- // For validation mode we can terminate immediately
- if (silent) { return true; }
-
- // Start list
- listTokIdx = state.tokens.length;
-
- if (isOrdered) {
- token = state.push('ordered_list_open', 'ol', 1);
- if (markerValue !== 1) {
- token.attrs = [ [ 'start', markerValue ] ];
- }
-
- } else {
- token = state.push('bullet_list_open', 'ul', 1);
- }
-
- token.map = listLines = [ startLine, 0 ];
- token.markup = String.fromCharCode(markerCharCode);
-
- //
- // Iterate list items
- //
-
- nextLine = startLine;
- prevEmptyEnd = false;
- terminatorRules = state.md.block.ruler.getRules('list');
-
- oldParentType = state.parentType;
- state.parentType = 'list';
-
- while (nextLine < endLine) {
- pos = posAfterMarker;
- max = state.eMarks[nextLine];
-
- initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]);
-
- while (pos < max) {
- ch = state.src.charCodeAt(pos);
-
- if (ch === 0x09) {
- offset += 4 - (offset + state.bsCount[nextLine]) % 4;
- } else if (ch === 0x20) {
- offset++;
- } else {
- break;
- }
-
- pos++;
- }
-
- contentStart = pos;
-
- if (contentStart >= max) {
- // trimming space in "- \n 3" case, indent is 1 here
- indentAfterMarker = 1;
- } else {
- indentAfterMarker = offset - initial;
- }
-
- // If we have more than 4 spaces, the indent is 1
- // (the rest is just indented code block)
- if (indentAfterMarker > 4) { indentAfterMarker = 1; }
-
- // " - test"
- // ^^^^^ - calculating total length of this thing
- indent = initial + indentAfterMarker;
-
- // Run subparser & write tokens
- token = state.push('list_item_open', 'li', 1);
- token.markup = String.fromCharCode(markerCharCode);
- token.map = itemLines = [ startLine, 0 ];
-
- oldIndent = state.blkIndent;
- oldTight = state.tight;
- oldTShift = state.tShift[startLine];
- oldLIndent = state.sCount[startLine];
- state.blkIndent = indent;
- state.tight = true;
- state.tShift[startLine] = contentStart - state.bMarks[startLine];
- state.sCount[startLine] = offset;
-
- if (contentStart >= max && state.isEmpty(startLine + 1)) {
- // workaround for this case
- // (list item is empty, list terminates before "foo"):
- // ~~~~~~~~
- // -
- //
- // foo
- // ~~~~~~~~
- state.line = Math.min(state.line + 2, endLine);
- } else {
- state.md.block.tokenize(state, startLine, endLine, true);
- }
-
- // If any of list item is tight, mark list as tight
- if (!state.tight || prevEmptyEnd) {
- tight = false;
- }
- // Item become loose if finish with empty line,
- // but we should filter last element, because it means list finish
- prevEmptyEnd = (state.line - startLine) > 1 && state.isEmpty(state.line - 1);
-
- state.blkIndent = oldIndent;
- state.tShift[startLine] = oldTShift;
- state.sCount[startLine] = oldLIndent;
- state.tight = oldTight;
-
- token = state.push('list_item_close', 'li', -1);
- token.markup = String.fromCharCode(markerCharCode);
-
- nextLine = startLine = state.line;
- itemLines[1] = nextLine;
- contentStart = state.bMarks[startLine];
-
- if (nextLine >= endLine) { break; }
-
- //
- // Try to check if list is terminated or continued.
- //
- if (state.sCount[nextLine] < state.blkIndent) { break; }
-
- // fail if terminating block found
- terminate = false;
- for (i = 0, l = terminatorRules.length; i < l; i++) {
- if (terminatorRules[i](state, nextLine, endLine, true)) {
- terminate = true;
- break;
- }
- }
- if (terminate) { break; }
-
- // fail if list has another type
- if (isOrdered) {
- posAfterMarker = skipOrderedListMarker(state, nextLine);
- if (posAfterMarker < 0) { break; }
- } else {
- posAfterMarker = skipBulletListMarker(state, nextLine);
- if (posAfterMarker < 0) { break; }
- }
-
- if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; }
- }
-
- // Finalize list
- if (isOrdered) {
- token = state.push('ordered_list_close', 'ol', -1);
- } else {
- token = state.push('bullet_list_close', 'ul', -1);
- }
- token.markup = String.fromCharCode(markerCharCode);
-
- listLines[1] = nextLine;
- state.line = nextLine;
-
- state.parentType = oldParentType;
-
- // mark paragraphs tight if needed
- if (tight) {
- markTightParagraphs(state, listTokIdx);
- }
-
- return true;
-};
-
-},{"../common/utils":324}],346:[function(require,module,exports){
-// Paragraph
-
-'use strict';
-
-
-module.exports = function paragraph(state, startLine/*, endLine*/) {
- var content, terminate, i, l, token, oldParentType,
- nextLine = startLine + 1,
- terminatorRules = state.md.block.ruler.getRules('paragraph'),
- endLine = state.lineMax;
-
- oldParentType = state.parentType;
- state.parentType = 'paragraph';
-
- // jump line-by-line until empty one or EOF
- for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
- // this would be a code block normally, but after paragraph
- // it's considered a lazy continuation regardless of what's there
- if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
-
- // quirk for blockquotes, this line should already be checked by that rule
- if (state.sCount[nextLine] < 0) { continue; }
-
- // Some tags can terminate paragraph without empty line.
- terminate = false;
- for (i = 0, l = terminatorRules.length; i < l; i++) {
- if (terminatorRules[i](state, nextLine, endLine, true)) {
- terminate = true;
- break;
- }
- }
- if (terminate) { break; }
- }
-
- content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
-
- state.line = nextLine;
-
- token = state.push('paragraph_open', 'p', 1);
- token.map = [ startLine, state.line ];
-
- token = state.push('inline', '', 0);
- token.content = content;
- token.map = [ startLine, state.line ];
- token.children = [];
-
- token = state.push('paragraph_close', 'p', -1);
-
- state.parentType = oldParentType;
-
- return true;
-};
-
-},{}],347:[function(require,module,exports){
-'use strict';
-
-
-var normalizeReference = require('../common/utils').normalizeReference;
-var isSpace = require('../common/utils').isSpace;
-
-
-module.exports = function reference(state, startLine, _endLine, silent) {
- var ch,
- destEndPos,
- destEndLineNo,
- endLine,
- href,
- i,
- l,
- label,
- labelEnd,
- oldParentType,
- res,
- start,
- str,
- terminate,
- terminatorRules,
- title,
- lines = 0,
- pos = state.bMarks[startLine] + state.tShift[startLine],
- max = state.eMarks[startLine],
- nextLine = startLine + 1;
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false; }
-
- // Simple check to quickly interrupt scan on [link](url) at the start of line.
- // Can be useful on practice: https://github.com/markdown-it/markdown-it/issues/54
- while (++pos < max) {
- if (state.src.charCodeAt(pos) === 0x5D /* ] */ &&
- state.src.charCodeAt(pos - 1) !== 0x5C/* \ */) {
- if (pos + 1 === max) { return false; }
- if (state.src.charCodeAt(pos + 1) !== 0x3A/* : */) { return false; }
- break;
- }
- }
-
- endLine = state.lineMax;
-
- // jump line-by-line until empty one or EOF
- terminatorRules = state.md.block.ruler.getRules('reference');
-
- oldParentType = state.parentType;
- state.parentType = 'reference';
-
- for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
- // this would be a code block normally, but after paragraph
- // it's considered a lazy continuation regardless of what's there
- if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
-
- // quirk for blockquotes, this line should already be checked by that rule
- if (state.sCount[nextLine] < 0) { continue; }
-
- // Some tags can terminate paragraph without empty line.
- terminate = false;
- for (i = 0, l = terminatorRules.length; i < l; i++) {
- if (terminatorRules[i](state, nextLine, endLine, true)) {
- terminate = true;
- break;
- }
- }
- if (terminate) { break; }
- }
-
- str = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
- max = str.length;
-
- for (pos = 1; pos < max; pos++) {
- ch = str.charCodeAt(pos);
- if (ch === 0x5B /* [ */) {
- return false;
- } else if (ch === 0x5D /* ] */) {
- labelEnd = pos;
- break;
- } else if (ch === 0x0A /* \n */) {
- lines++;
- } else if (ch === 0x5C /* \ */) {
- pos++;
- if (pos < max && str.charCodeAt(pos) === 0x0A) {
- lines++;
- }
- }
- }
-
- if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false; }
-
- // [label]: destination 'title'
- // ^^^ skip optional whitespace here
- for (pos = labelEnd + 2; pos < max; pos++) {
- ch = str.charCodeAt(pos);
- if (ch === 0x0A) {
- lines++;
- } else if (isSpace(ch)) {
- /*eslint no-empty:0*/
- } else {
- break;
- }
- }
-
- // [label]: destination 'title'
- // ^^^^^^^^^^^ parse this
- res = state.md.helpers.parseLinkDestination(str, pos, max);
- if (!res.ok) { return false; }
-
- href = state.md.normalizeLink(res.str);
- if (!state.md.validateLink(href)) { return false; }
-
- pos = res.pos;
- lines += res.lines;
-
- // save cursor state, we could require to rollback later
- destEndPos = pos;
- destEndLineNo = lines;
-
- // [label]: destination 'title'
- // ^^^ skipping those spaces
- start = pos;
- for (; pos < max; pos++) {
- ch = str.charCodeAt(pos);
- if (ch === 0x0A) {
- lines++;
- } else if (isSpace(ch)) {
- /*eslint no-empty:0*/
- } else {
- break;
- }
- }
-
- // [label]: destination 'title'
- // ^^^^^^^ parse this
- res = state.md.helpers.parseLinkTitle(str, pos, max);
- if (pos < max && start !== pos && res.ok) {
- title = res.str;
- pos = res.pos;
- lines += res.lines;
- } else {
- title = '';
- pos = destEndPos;
- lines = destEndLineNo;
- }
-
- // skip trailing spaces until the rest of the line
- while (pos < max) {
- ch = str.charCodeAt(pos);
- if (!isSpace(ch)) { break; }
- pos++;
- }
-
- if (pos < max && str.charCodeAt(pos) !== 0x0A) {
- if (title) {
- // garbage at the end of the line after title,
- // but it could still be a valid reference if we roll back
- title = '';
- pos = destEndPos;
- lines = destEndLineNo;
- while (pos < max) {
- ch = str.charCodeAt(pos);
- if (!isSpace(ch)) { break; }
- pos++;
- }
- }
- }
-
- if (pos < max && str.charCodeAt(pos) !== 0x0A) {
- // garbage at the end of the line
- return false;
- }
-
- label = normalizeReference(str.slice(1, labelEnd));
- if (!label) {
- // CommonMark 0.20 disallows empty labels
- return false;
- }
-
- // Reference can not terminate anything. This check is for safety only.
- /*istanbul ignore if*/
- if (silent) { return true; }
-
- if (typeof state.env.references === 'undefined') {
- state.env.references = {};
- }
- if (typeof state.env.references[label] === 'undefined') {
- state.env.references[label] = { title: title, href: href };
- }
-
- state.parentType = oldParentType;
-
- state.line = startLine + lines + 1;
- return true;
-};
-
-},{"../common/utils":324}],348:[function(require,module,exports){
-// Parser state class
-
-'use strict';
-
-var Token = require('../token');
-var isSpace = require('../common/utils').isSpace;
-
-
-function StateBlock(src, md, env, tokens) {
- var ch, s, start, pos, len, indent, offset, indent_found;
-
- this.src = src;
-
- // link to parser instance
- this.md = md;
-
- this.env = env;
-
- //
- // Internal state vartiables
- //
-
- this.tokens = tokens;
-
- this.bMarks = []; // line begin offsets for fast jumps
- this.eMarks = []; // line end offsets for fast jumps
- this.tShift = []; // offsets of the first non-space characters (tabs not expanded)
- this.sCount = []; // indents for each line (tabs expanded)
-
- // An amount of virtual spaces (tabs expanded) between beginning
- // of each line (bMarks) and real beginning of that line.
- //
- // It exists only as a hack because blockquotes override bMarks
- // losing information in the process.
- //
- // It's used only when expanding tabs, you can think about it as
- // an initial tab length, e.g. bsCount=21 applied to string `\t123`
- // means first tab should be expanded to 4-21%4 === 3 spaces.
- //
- this.bsCount = [];
-
- // block parser variables
- this.blkIndent = 0; // required block content indent
- // (for example, if we are in list)
- this.line = 0; // line index in src
- this.lineMax = 0; // lines count
- this.tight = false; // loose/tight mode for lists
- this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any)
-
- // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'
- // used in lists to determine if they interrupt a paragraph
- this.parentType = 'root';
-
- this.level = 0;
-
- // renderer
- this.result = '';
-
- // Create caches
- // Generate markers.
- s = this.src;
- indent_found = false;
-
- for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) {
- ch = s.charCodeAt(pos);
-
- if (!indent_found) {
- if (isSpace(ch)) {
- indent++;
-
- if (ch === 0x09) {
- offset += 4 - offset % 4;
- } else {
- offset++;
- }
- continue;
- } else {
- indent_found = true;
- }
- }
-
- if (ch === 0x0A || pos === len - 1) {
- if (ch !== 0x0A) { pos++; }
- this.bMarks.push(start);
- this.eMarks.push(pos);
- this.tShift.push(indent);
- this.sCount.push(offset);
- this.bsCount.push(0);
-
- indent_found = false;
- indent = 0;
- offset = 0;
- start = pos + 1;
- }
- }
-
- // Push fake entry to simplify cache bounds checks
- this.bMarks.push(s.length);
- this.eMarks.push(s.length);
- this.tShift.push(0);
- this.sCount.push(0);
- this.bsCount.push(0);
-
- this.lineMax = this.bMarks.length - 1; // don't count last fake line
-}
-
-// Push new token to "stream".
-//
-StateBlock.prototype.push = function (type, tag, nesting) {
- var token = new Token(type, tag, nesting);
- token.block = true;
-
- if (nesting < 0) { this.level--; }
- token.level = this.level;
- if (nesting > 0) { this.level++; }
-
- this.tokens.push(token);
- return token;
-};
-
-StateBlock.prototype.isEmpty = function isEmpty(line) {
- return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
-};
-
-StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {
- for (var max = this.lineMax; from < max; from++) {
- if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {
- break;
- }
- }
- return from;
-};
-
-// Skip spaces from given position.
-StateBlock.prototype.skipSpaces = function skipSpaces(pos) {
- var ch;
-
- for (var max = this.src.length; pos < max; pos++) {
- ch = this.src.charCodeAt(pos);
- if (!isSpace(ch)) { break; }
- }
- return pos;
-};
-
-// Skip spaces from given position in reverse.
-StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {
- if (pos <= min) { return pos; }
-
- while (pos > min) {
- if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1; }
- }
- return pos;
-};
-
-// Skip char codes from given position
-StateBlock.prototype.skipChars = function skipChars(pos, code) {
- for (var max = this.src.length; pos < max; pos++) {
- if (this.src.charCodeAt(pos) !== code) { break; }
- }
- return pos;
-};
-
-// Skip char codes reverse from given position - 1
-StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {
- if (pos <= min) { return pos; }
-
- while (pos > min) {
- if (code !== this.src.charCodeAt(--pos)) { return pos + 1; }
- }
- return pos;
-};
-
-// cut lines range from source.
-StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {
- var i, lineIndent, ch, first, last, queue, lineStart,
- line = begin;
-
- if (begin >= end) {
- return '';
- }
-
- queue = new Array(end - begin);
-
- for (i = 0; line < end; line++, i++) {
- lineIndent = 0;
- lineStart = first = this.bMarks[line];
-
- if (line + 1 < end || keepLastLF) {
- // No need for bounds check because we have fake entry on tail.
- last = this.eMarks[line] + 1;
- } else {
- last = this.eMarks[line];
- }
-
- while (first < last && lineIndent < indent) {
- ch = this.src.charCodeAt(first);
-
- if (isSpace(ch)) {
- if (ch === 0x09) {
- lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
- } else {
- lineIndent++;
- }
- } else if (first - lineStart < this.tShift[line]) {
- // patched tShift masked characters to look like spaces (blockquotes, list markers)
- lineIndent++;
- } else {
- break;
- }
-
- first++;
- }
-
- if (lineIndent > indent) {
- // partially expanding tabs in code blocks, e.g '\t\tfoobar'
- // with indent=2 becomes ' \tfoobar'
- queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last);
- } else {
- queue[i] = this.src.slice(first, last);
- }
- }
-
- return queue.join('');
-};
-
-// re-export Token class to use in block rules
-StateBlock.prototype.Token = Token;
-
-
-module.exports = StateBlock;
-
-},{"../common/utils":324,"../token":371}],349:[function(require,module,exports){
-// GFM table, non-standard
-
-'use strict';
-
-var isSpace = require('../common/utils').isSpace;
-
-
-function getLine(state, line) {
- var pos = state.bMarks[line] + state.blkIndent,
- max = state.eMarks[line];
-
- return state.src.substr(pos, max - pos);
-}
-
-function escapedSplit(str) {
- var result = [],
- pos = 0,
- max = str.length,
- ch,
- escapes = 0,
- lastPos = 0,
- backTicked = false,
- lastBackTick = 0;
-
- ch = str.charCodeAt(pos);
-
- while (pos < max) {
- if (ch === 0x60/* ` */) {
- if (backTicked) {
- // make \` close code sequence, but not open it;
- // the reason is: `\` is correct code block
- backTicked = false;
- lastBackTick = pos;
- } else if (escapes % 2 === 0) {
- backTicked = true;
- lastBackTick = pos;
- }
- } else if (ch === 0x7c/* | */ && (escapes % 2 === 0) && !backTicked) {
- result.push(str.substring(lastPos, pos));
- lastPos = pos + 1;
- }
-
- if (ch === 0x5c/* \ */) {
- escapes++;
- } else {
- escapes = 0;
- }
-
- pos++;
-
- // If there was an un-closed backtick, go back to just after
- // the last backtick, but as if it was a normal character
- if (pos === max && backTicked) {
- backTicked = false;
- pos = lastBackTick + 1;
- }
-
- ch = str.charCodeAt(pos);
- }
-
- result.push(str.substring(lastPos));
-
- return result;
-}
-
-
-module.exports = function table(state, startLine, endLine, silent) {
- var ch, lineText, pos, i, nextLine, columns, columnCount, token,
- aligns, t, tableLines, tbodyLines;
-
- // should have at least two lines
- if (startLine + 2 > endLine) { return false; }
-
- nextLine = startLine + 1;
-
- if (state.sCount[nextLine] < state.blkIndent) { return false; }
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[nextLine] - state.blkIndent >= 4) { return false; }
-
- // first character of the second line should be '|', '-', ':',
- // and no other characters are allowed but spaces;
- // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp
-
- pos = state.bMarks[nextLine] + state.tShift[nextLine];
- if (pos >= state.eMarks[nextLine]) { return false; }
-
- ch = state.src.charCodeAt(pos++);
- if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */) { return false; }
-
- while (pos < state.eMarks[nextLine]) {
- ch = state.src.charCodeAt(pos);
-
- if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false; }
-
- pos++;
- }
-
- lineText = getLine(state, startLine + 1);
-
- columns = lineText.split('|');
- aligns = [];
- for (i = 0; i < columns.length; i++) {
- t = columns[i].trim();
- if (!t) {
- // allow empty columns before and after table, but not in between columns;
- // e.g. allow ` |---| `, disallow ` ---||--- `
- if (i === 0 || i === columns.length - 1) {
- continue;
- } else {
- return false;
- }
- }
-
- if (!/^:?-+:?$/.test(t)) { return false; }
- if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {
- aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right');
- } else if (t.charCodeAt(0) === 0x3A/* : */) {
- aligns.push('left');
- } else {
- aligns.push('');
- }
- }
-
- lineText = getLine(state, startLine).trim();
- if (lineText.indexOf('|') === -1) { return false; }
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
- columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
-
- // header row will define an amount of columns in the entire table,
- // and align row shouldn't be smaller than that (the rest of the rows can)
- columnCount = columns.length;
- if (columnCount > aligns.length) { return false; }
-
- if (silent) { return true; }
-
- token = state.push('table_open', 'table', 1);
- token.map = tableLines = [ startLine, 0 ];
-
- token = state.push('thead_open', 'thead', 1);
- token.map = [ startLine, startLine + 1 ];
-
- token = state.push('tr_open', 'tr', 1);
- token.map = [ startLine, startLine + 1 ];
-
- for (i = 0; i < columns.length; i++) {
- token = state.push('th_open', 'th', 1);
- token.map = [ startLine, startLine + 1 ];
- if (aligns[i]) {
- token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
- }
-
- token = state.push('inline', '', 0);
- token.content = columns[i].trim();
- token.map = [ startLine, startLine + 1 ];
- token.children = [];
-
- token = state.push('th_close', 'th', -1);
- }
-
- token = state.push('tr_close', 'tr', -1);
- token = state.push('thead_close', 'thead', -1);
-
- token = state.push('tbody_open', 'tbody', 1);
- token.map = tbodyLines = [ startLine + 2, 0 ];
-
- for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
- if (state.sCount[nextLine] < state.blkIndent) { break; }
-
- lineText = getLine(state, nextLine).trim();
- if (lineText.indexOf('|') === -1) { break; }
- if (state.sCount[nextLine] - state.blkIndent >= 4) { break; }
- columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
-
- token = state.push('tr_open', 'tr', 1);
- for (i = 0; i < columnCount; i++) {
- token = state.push('td_open', 'td', 1);
- if (aligns[i]) {
- token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
- }
-
- token = state.push('inline', '', 0);
- token.content = columns[i] ? columns[i].trim() : '';
- token.children = [];
-
- token = state.push('td_close', 'td', -1);
- }
- token = state.push('tr_close', 'tr', -1);
- }
- token = state.push('tbody_close', 'tbody', -1);
- token = state.push('table_close', 'table', -1);
-
- tableLines[1] = tbodyLines[1] = nextLine;
- state.line = nextLine;
- return true;
-};
-
-},{"../common/utils":324}],350:[function(require,module,exports){
-'use strict';
-
-
-module.exports = function block(state) {
- var token;
-
- if (state.inlineMode) {
- token = new state.Token('inline', '', 0);
- token.content = state.src;
- token.map = [ 0, 1 ];
- token.children = [];
- state.tokens.push(token);
- } else {
- state.md.block.parse(state.src, state.md, state.env, state.tokens);
- }
-};
-
-},{}],351:[function(require,module,exports){
-'use strict';
-
-module.exports = function inline(state) {
- var tokens = state.tokens, tok, i, l;
-
- // Parse inlines
- for (i = 0, l = tokens.length; i < l; i++) {
- tok = tokens[i];
- if (tok.type === 'inline') {
- state.md.inline.parse(tok.content, state.md, state.env, tok.children);
- }
- }
-};
-
-},{}],352:[function(require,module,exports){
-// Replace link-like texts with link nodes.
-//
-// Currently restricted by `md.validateLink()` to http/https/ftp
-//
-'use strict';
-
-
-var arrayReplaceAt = require('../common/utils').arrayReplaceAt;
-
-
-function isLinkOpen(str) {
- return /^<a[>\s]/i.test(str);
-}
-function isLinkClose(str) {
- return /^<\/a\s*>/i.test(str);
-}
-
-
-module.exports = function linkify(state) {
- var i, j, l, tokens, token, currentToken, nodes, ln, text, pos, lastPos,
- level, htmlLinkLevel, url, fullUrl, urlText,
- blockTokens = state.tokens,
- links;
-
- if (!state.md.options.linkify) { return; }
-
- for (j = 0, l = blockTokens.length; j < l; j++) {
- if (blockTokens[j].type !== 'inline' ||
- !state.md.linkify.pretest(blockTokens[j].content)) {
- continue;
- }
-
- tokens = blockTokens[j].children;
-
- htmlLinkLevel = 0;
-
- // We scan from the end, to keep position when new tags added.
- // Use reversed logic in links start/end match
- for (i = tokens.length - 1; i >= 0; i--) {
- currentToken = tokens[i];
-
- // Skip content of markdown links
- if (currentToken.type === 'link_close') {
- i--;
- while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {
- i--;
- }
- continue;
- }
-
- // Skip content of html tag links
- if (currentToken.type === 'html_inline') {
- if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
- htmlLinkLevel--;
- }
- if (isLinkClose(currentToken.content)) {
- htmlLinkLevel++;
- }
- }
- if (htmlLinkLevel > 0) { continue; }
-
- if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {
-
- text = currentToken.content;
- links = state.md.linkify.match(text);
-
- // Now split string to nodes
- nodes = [];
- level = currentToken.level;
- lastPos = 0;
-
- for (ln = 0; ln < links.length; ln++) {
-
- url = links[ln].url;
- fullUrl = state.md.normalizeLink(url);
- if (!state.md.validateLink(fullUrl)) { continue; }
-
- urlText = links[ln].text;
-
- // Linkifier might send raw hostnames like "example.com", where url
- // starts with domain name. So we prepend http:// in those cases,
- // and remove it afterwards.
- //
- if (!links[ln].schema) {
- urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, '');
- } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {
- urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '');
- } else {
- urlText = state.md.normalizeLinkText(urlText);
- }
-
- pos = links[ln].index;
-
- if (pos > lastPos) {
- token = new state.Token('text', '', 0);
- token.content = text.slice(lastPos, pos);
- token.level = level;
- nodes.push(token);
- }
-
- token = new state.Token('link_open', 'a', 1);
- token.attrs = [ [ 'href', fullUrl ] ];
- token.level = level++;
- token.markup = 'linkify';
- token.info = 'auto';
- nodes.push(token);
-
- token = new state.Token('text', '', 0);
- token.content = urlText;
- token.level = level;
- nodes.push(token);
-
- token = new state.Token('link_close', 'a', -1);
- token.level = --level;
- token.markup = 'linkify';
- token.info = 'auto';
- nodes.push(token);
-
- lastPos = links[ln].lastIndex;
- }
- if (lastPos < text.length) {
- token = new state.Token('text', '', 0);
- token.content = text.slice(lastPos);
- token.level = level;
- nodes.push(token);
- }
-
- // replace current node
- blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
- }
- }
- }
-};
-
-},{"../common/utils":324}],353:[function(require,module,exports){
-// Normalize input string
-
-'use strict';
-
-
-var NEWLINES_RE = /\r[\n\u0085]?|[\u2424\u2028\u0085]/g;
-var NULL_RE = /\u0000/g;
-
-
-module.exports = function inline(state) {
- var str;
-
- // Normalize newlines
- str = state.src.replace(NEWLINES_RE, '\n');
-
- // Replace NULL characters
- str = str.replace(NULL_RE, '\uFFFD');
-
- state.src = str;
-};
-
-},{}],354:[function(require,module,exports){
-// Simple typographyc replacements
-//
-// (c) (C) → ©
-// (tm) (TM) → ™
-// (r) (R) → ®
-// +- → ±
-// (p) (P) -> §
-// ... → … (also ?.... → ?.., !.... → !..)
-// ???????? → ???, !!!!! → !!!, `,,` → `,`
-// -- → &ndash;, --- → &mdash;
-//
-'use strict';
-
-// TODO:
-// - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾
-// - miltiplication 2 x 4 -> 2 × 4
-
-var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
-
-// Workaround for phantomjs - need regex without /g flag,
-// or root check will fail every second time
-var SCOPED_ABBR_TEST_RE = /\((c|tm|r|p)\)/i;
-
-var SCOPED_ABBR_RE = /\((c|tm|r|p)\)/ig;
-var SCOPED_ABBR = {
- c: '©',
- r: '®',
- p: '§',
- tm: '™'
-};
-
-function replaceFn(match, name) {
- return SCOPED_ABBR[name.toLowerCase()];
-}
-
-function replace_scoped(inlineTokens) {
- var i, token, inside_autolink = 0;
-
- for (i = inlineTokens.length - 1; i >= 0; i--) {
- token = inlineTokens[i];
-
- if (token.type === 'text' && !inside_autolink) {
- token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
- }
-
- if (token.type === 'link_open' && token.info === 'auto') {
- inside_autolink--;
- }
-
- if (token.type === 'link_close' && token.info === 'auto') {
- inside_autolink++;
- }
- }
-}
-
-function replace_rare(inlineTokens) {
- var i, token, inside_autolink = 0;
-
- for (i = inlineTokens.length - 1; i >= 0; i--) {
- token = inlineTokens[i];
-
- if (token.type === 'text' && !inside_autolink) {
- if (RARE_RE.test(token.content)) {
- token.content = token.content
- .replace(/\+-/g, '±')
- // .., ..., ....... -> …
- // but ?..... & !..... -> ?.. & !..
- .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..')
- .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')
- // em-dash
- .replace(/(^|[^-])---([^-]|$)/mg, '$1\u2014$2')
- // en-dash
- .replace(/(^|\s)--(\s|$)/mg, '$1\u2013$2')
- .replace(/(^|[^-\s])--([^-\s]|$)/mg, '$1\u2013$2');
- }
- }
-
- if (token.type === 'link_open' && token.info === 'auto') {
- inside_autolink--;
- }
-
- if (token.type === 'link_close' && token.info === 'auto') {
- inside_autolink++;
- }
- }
-}
-
-
-module.exports = function replace(state) {
- var blkIdx;
-
- if (!state.md.options.typographer) { return; }
-
- for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
-
- if (state.tokens[blkIdx].type !== 'inline') { continue; }
-
- if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
- replace_scoped(state.tokens[blkIdx].children);
- }
-
- if (RARE_RE.test(state.tokens[blkIdx].content)) {
- replace_rare(state.tokens[blkIdx].children);
- }
-
- }
-};
-
-},{}],355:[function(require,module,exports){
-// Convert straight quotation marks to typographic ones
-//
-'use strict';
-
-
-var isWhiteSpace = require('../common/utils').isWhiteSpace;
-var isPunctChar = require('../common/utils').isPunctChar;
-var isMdAsciiPunct = require('../common/utils').isMdAsciiPunct;
-
-var QUOTE_TEST_RE = /['"]/;
-var QUOTE_RE = /['"]/g;
-var APOSTROPHE = '\u2019'; /* ’ */
-
-
-function replaceAt(str, index, ch) {
- return str.substr(0, index) + ch + str.substr(index + 1);
-}
-
-function process_inlines(tokens, state) {
- var i, token, text, t, pos, max, thisLevel, item, lastChar, nextChar,
- isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace,
- canOpen, canClose, j, isSingle, stack, openQuote, closeQuote;
-
- stack = [];
-
- for (i = 0; i < tokens.length; i++) {
- token = tokens[i];
-
- thisLevel = tokens[i].level;
-
- for (j = stack.length - 1; j >= 0; j--) {
- if (stack[j].level <= thisLevel) { break; }
- }
- stack.length = j + 1;
-
- if (token.type !== 'text') { continue; }
-
- text = token.content;
- pos = 0;
- max = text.length;
-
- /*eslint no-labels:0,block-scoped-var:0*/
- OUTER:
- while (pos < max) {
- QUOTE_RE.lastIndex = pos;
- t = QUOTE_RE.exec(text);
- if (!t) { break; }
-
- canOpen = canClose = true;
- pos = t.index + 1;
- isSingle = (t[0] === "'");
-
- // Find previous character,
- // default to space if it's the beginning of the line
- //
- lastChar = 0x20;
-
- if (t.index - 1 >= 0) {
- lastChar = text.charCodeAt(t.index - 1);
- } else {
- for (j = i - 1; j >= 0; j--) {
- if (tokens[j].type !== 'text') { continue; }
-
- lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
- break;
- }
- }
-
- // Find next character,
- // default to space if it's the end of the line
- //
- nextChar = 0x20;
-
- if (pos < max) {
- nextChar = text.charCodeAt(pos);
- } else {
- for (j = i + 1; j < tokens.length; j++) {
- if (tokens[j].type !== 'text') { continue; }
-
- nextChar = tokens[j].content.charCodeAt(0);
- break;
- }
- }
-
- isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
- isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
-
- isLastWhiteSpace = isWhiteSpace(lastChar);
- isNextWhiteSpace = isWhiteSpace(nextChar);
-
- if (isNextWhiteSpace) {
- canOpen = false;
- } else if (isNextPunctChar) {
- if (!(isLastWhiteSpace || isLastPunctChar)) {
- canOpen = false;
- }
- }
-
- if (isLastWhiteSpace) {
- canClose = false;
- } else if (isLastPunctChar) {
- if (!(isNextWhiteSpace || isNextPunctChar)) {
- canClose = false;
- }
- }
-
- if (nextChar === 0x22 /* " */ && t[0] === '"') {
- if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {
- // special case: 1"" - count first quote as an inch
- canClose = canOpen = false;
- }
- }
-
- if (canOpen && canClose) {
- // treat this as the middle of the word
- canOpen = false;
- canClose = isNextPunctChar;
- }
-
- if (!canOpen && !canClose) {
- // middle of word
- if (isSingle) {
- token.content = replaceAt(token.content, t.index, APOSTROPHE);
- }
- continue;
- }
-
- if (canClose) {
- // this could be a closing quote, rewind the stack to get a match
- for (j = stack.length - 1; j >= 0; j--) {
- item = stack[j];
- if (stack[j].level < thisLevel) { break; }
- if (item.single === isSingle && stack[j].level === thisLevel) {
- item = stack[j];
-
- if (isSingle) {
- openQuote = state.md.options.quotes[2];
- closeQuote = state.md.options.quotes[3];
- } else {
- openQuote = state.md.options.quotes[0];
- closeQuote = state.md.options.quotes[1];
- }
-
- // replace token.content *before* tokens[item.token].content,
- // because, if they are pointing at the same token, replaceAt
- // could mess up indices when quote length != 1
- token.content = replaceAt(token.content, t.index, closeQuote);
- tokens[item.token].content = replaceAt(
- tokens[item.token].content, item.pos, openQuote);
-
- pos += closeQuote.length - 1;
- if (item.token === i) { pos += openQuote.length - 1; }
-
- text = token.content;
- max = text.length;
-
- stack.length = j;
- continue OUTER;
- }
- }
- }
-
- if (canOpen) {
- stack.push({
- token: i,
- pos: t.index,
- single: isSingle,
- level: thisLevel
- });
- } else if (canClose && isSingle) {
- token.content = replaceAt(token.content, t.index, APOSTROPHE);
- }
- }
- }
-}
-
-
-module.exports = function smartquotes(state) {
- /*eslint max-depth:0*/
- var blkIdx;
-
- if (!state.md.options.typographer) { return; }
-
- for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
-
- if (state.tokens[blkIdx].type !== 'inline' ||
- !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
- continue;
- }
-
- process_inlines(state.tokens[blkIdx].children, state);
- }
-};
-
-},{"../common/utils":324}],356:[function(require,module,exports){
-// Core state object
-//
-'use strict';
-
-var Token = require('../token');
-
-
-function StateCore(src, md, env) {
- this.src = src;
- this.env = env;
- this.tokens = [];
- this.inlineMode = false;
- this.md = md; // link to parser instance
-}
-
-// re-export Token class to use in core rules
-StateCore.prototype.Token = Token;
-
-
-module.exports = StateCore;
-
-},{"../token":371}],357:[function(require,module,exports){
-// Process autolinks '<protocol:...>'
-
-'use strict';
-
-
-/*eslint max-len:0*/
-var EMAIL_RE = /^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/;
-var AUTOLINK_RE = /^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;
-
-
-module.exports = function autolink(state, silent) {
- var tail, linkMatch, emailMatch, url, fullUrl, token,
- pos = state.pos;
-
- if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
-
- tail = state.src.slice(pos);
-
- if (tail.indexOf('>') < 0) { return false; }
-
- if (AUTOLINK_RE.test(tail)) {
- linkMatch = tail.match(AUTOLINK_RE);
-
- url = linkMatch[0].slice(1, -1);
- fullUrl = state.md.normalizeLink(url);
- if (!state.md.validateLink(fullUrl)) { return false; }
-
- if (!silent) {
- token = state.push('link_open', 'a', 1);
- token.attrs = [ [ 'href', fullUrl ] ];
- token.markup = 'autolink';
- token.info = 'auto';
-
- token = state.push('text', '', 0);
- token.content = state.md.normalizeLinkText(url);
-
- token = state.push('link_close', 'a', -1);
- token.markup = 'autolink';
- token.info = 'auto';
- }
-
- state.pos += linkMatch[0].length;
- return true;
- }
-
- if (EMAIL_RE.test(tail)) {
- emailMatch = tail.match(EMAIL_RE);
-
- url = emailMatch[0].slice(1, -1);
- fullUrl = state.md.normalizeLink('mailto:' + url);
- if (!state.md.validateLink(fullUrl)) { return false; }
-
- if (!silent) {
- token = state.push('link_open', 'a', 1);
- token.attrs = [ [ 'href', fullUrl ] ];
- token.markup = 'autolink';
- token.info = 'auto';
-
- token = state.push('text', '', 0);
- token.content = state.md.normalizeLinkText(url);
-
- token = state.push('link_close', 'a', -1);
- token.markup = 'autolink';
- token.info = 'auto';
- }
-
- state.pos += emailMatch[0].length;
- return true;
- }
-
- return false;
-};
-
-},{}],358:[function(require,module,exports){
-// Parse backticks
-
-'use strict';
-
-module.exports = function backtick(state, silent) {
- var start, max, marker, matchStart, matchEnd, token,
- pos = state.pos,
- ch = state.src.charCodeAt(pos);
-
- if (ch !== 0x60/* ` */) { return false; }
-
- start = pos;
- pos++;
- max = state.posMax;
-
- while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++; }
-
- marker = state.src.slice(start, pos);
-
- matchStart = matchEnd = pos;
-
- while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {
- matchEnd = matchStart + 1;
-
- while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++; }
-
- if (matchEnd - matchStart === marker.length) {
- if (!silent) {
- token = state.push('code_inline', 'code', 0);
- token.markup = marker;
- token.content = state.src.slice(pos, matchStart)
- .replace(/[ \n]+/g, ' ')
- .trim();
- }
- state.pos = matchEnd;
- return true;
- }
- }
-
- if (!silent) { state.pending += marker; }
- state.pos += marker.length;
- return true;
-};
-
-},{}],359:[function(require,module,exports){
-// For each opening emphasis-like marker find a matching closing one
-//
-'use strict';
-
-
-module.exports = function link_pairs(state) {
- var i, j, lastDelim, currDelim,
- delimiters = state.delimiters,
- max = state.delimiters.length;
-
- for (i = 0; i < max; i++) {
- lastDelim = delimiters[i];
-
- if (!lastDelim.close) { continue; }
-
- j = i - lastDelim.jump - 1;
-
- while (j >= 0) {
- currDelim = delimiters[j];
-
- if (currDelim.open &&
- currDelim.marker === lastDelim.marker &&
- currDelim.end < 0 &&
- currDelim.level === lastDelim.level) {
-
- // typeofs are for backward compatibility with plugins
- var odd_match = (currDelim.close || lastDelim.open) &&
- typeof currDelim.length !== 'undefined' &&
- typeof lastDelim.length !== 'undefined' &&
- (currDelim.length + lastDelim.length) % 3 === 0;
-
- if (!odd_match) {
- lastDelim.jump = i - j;
- lastDelim.open = false;
- currDelim.end = i;
- currDelim.jump = 0;
- break;
- }
- }
-
- j -= currDelim.jump + 1;
- }
- }
-};
-
-},{}],360:[function(require,module,exports){
-// Process *this* and _that_
-//
-'use strict';
-
-
-// Insert each marker as a separate text token, and add it to delimiter list
-//
-module.exports.tokenize = function emphasis(state, silent) {
- var i, scanned, token,
- start = state.pos,
- marker = state.src.charCodeAt(start);
-
- if (silent) { return false; }
-
- if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false; }
-
- scanned = state.scanDelims(state.pos, marker === 0x2A);
-
- for (i = 0; i < scanned.length; i++) {
- token = state.push('text', '', 0);
- token.content = String.fromCharCode(marker);
-
- state.delimiters.push({
- // Char code of the starting marker (number).
- //
- marker: marker,
-
- // Total length of these series of delimiters.
- //
- length: scanned.length,
-
- // An amount of characters before this one that's equivalent to
- // current one. In plain English: if this delimiter does not open
- // an emphasis, neither do previous `jump` characters.
- //
- // Used to skip sequences like "*****" in one step, for 1st asterisk
- // value will be 0, for 2nd it's 1 and so on.
- //
- jump: i,
-
- // A position of the token this delimiter corresponds to.
- //
- token: state.tokens.length - 1,
-
- // Token level.
- //
- level: state.level,
-
- // If this delimiter is matched as a valid opener, `end` will be
- // equal to its position, otherwise it's `-1`.
- //
- end: -1,
-
- // Boolean flags that determine if this delimiter could open or close
- // an emphasis.
- //
- open: scanned.can_open,
- close: scanned.can_close
- });
- }
-
- state.pos += scanned.length;
-
- return true;
-};
-
-
-// Walk through delimiter list and replace text tokens with tags
-//
-module.exports.postProcess = function emphasis(state) {
- var i,
- startDelim,
- endDelim,
- token,
- ch,
- isStrong,
- delimiters = state.delimiters,
- max = state.delimiters.length;
-
- for (i = max - 1; i >= 0; i--) {
- startDelim = delimiters[i];
-
- if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) {
- continue;
- }
-
- // Process only opening markers
- if (startDelim.end === -1) {
- continue;
- }
-
- endDelim = delimiters[startDelim.end];
-
- // If the previous delimiter has the same marker and is adjacent to this one,
- // merge those into one strong delimiter.
- //
- // `<em><em>whatever</em></em>` -> `<strong>whatever</strong>`
- //
- isStrong = i > 0 &&
- delimiters[i - 1].end === startDelim.end + 1 &&
- delimiters[i - 1].token === startDelim.token - 1 &&
- delimiters[startDelim.end + 1].token === endDelim.token + 1 &&
- delimiters[i - 1].marker === startDelim.marker;
-
- ch = String.fromCharCode(startDelim.marker);
-
- token = state.tokens[startDelim.token];
- token.type = isStrong ? 'strong_open' : 'em_open';
- token.tag = isStrong ? 'strong' : 'em';
- token.nesting = 1;
- token.markup = isStrong ? ch + ch : ch;
- token.content = '';
-
- token = state.tokens[endDelim.token];
- token.type = isStrong ? 'strong_close' : 'em_close';
- token.tag = isStrong ? 'strong' : 'em';
- token.nesting = -1;
- token.markup = isStrong ? ch + ch : ch;
- token.content = '';
-
- if (isStrong) {
- state.tokens[delimiters[i - 1].token].content = '';
- state.tokens[delimiters[startDelim.end + 1].token].content = '';
- i--;
- }
- }
-};
-
-},{}],361:[function(require,module,exports){
-// Process html entity - &#123;, &#xAF;, &quot;, ...
-
-'use strict';
-
-var entities = require('../common/entities');
-var has = require('../common/utils').has;
-var isValidEntityCode = require('../common/utils').isValidEntityCode;
-var fromCodePoint = require('../common/utils').fromCodePoint;
-
-
-var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i;
-var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
-
-
-module.exports = function entity(state, silent) {
- var ch, code, match, pos = state.pos, max = state.posMax;
-
- if (state.src.charCodeAt(pos) !== 0x26/* & */) { return false; }
-
- if (pos + 1 < max) {
- ch = state.src.charCodeAt(pos + 1);
-
- if (ch === 0x23 /* # */) {
- match = state.src.slice(pos).match(DIGITAL_RE);
- if (match) {
- if (!silent) {
- code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
- state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD);
- }
- state.pos += match[0].length;
- return true;
- }
- } else {
- match = state.src.slice(pos).match(NAMED_RE);
- if (match) {
- if (has(entities, match[1])) {
- if (!silent) { state.pending += entities[match[1]]; }
- state.pos += match[0].length;
- return true;
- }
- }
- }
- }
-
- if (!silent) { state.pending += '&'; }
- state.pos++;
- return true;
-};
-
-},{"../common/entities":321,"../common/utils":324}],362:[function(require,module,exports){
-// Process escaped chars and hardbreaks
-
-'use strict';
-
-var isSpace = require('../common/utils').isSpace;
-
-var ESCAPED = [];
-
-for (var i = 0; i < 256; i++) { ESCAPED.push(0); }
-
-'\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'
- .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1; });
-
-
-module.exports = function escape(state, silent) {
- var ch, pos = state.pos, max = state.posMax;
-
- if (state.src.charCodeAt(pos) !== 0x5C/* \ */) { return false; }
-
- pos++;
-
- if (pos < max) {
- ch = state.src.charCodeAt(pos);
-
- if (ch < 256 && ESCAPED[ch] !== 0) {
- if (!silent) { state.pending += state.src[pos]; }
- state.pos += 2;
- return true;
- }
-
- if (ch === 0x0A) {
- if (!silent) {
- state.push('hardbreak', 'br', 0);
- }
-
- pos++;
- // skip leading whitespaces from next line
- while (pos < max) {
- ch = state.src.charCodeAt(pos);
- if (!isSpace(ch)) { break; }
- pos++;
- }
-
- state.pos = pos;
- return true;
- }
- }
-
- if (!silent) { state.pending += '\\'; }
- state.pos++;
- return true;
-};
-
-},{"../common/utils":324}],363:[function(require,module,exports){
-// Process html tags
-
-'use strict';
-
-
-var HTML_TAG_RE = require('../common/html_re').HTML_TAG_RE;
-
-
-function isLetter(ch) {
- /*eslint no-bitwise:0*/
- var lc = ch | 0x20; // to lower case
- return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */);
-}
-
-
-module.exports = function html_inline(state, silent) {
- var ch, match, max, token,
- pos = state.pos;
-
- if (!state.md.options.html) { return false; }
-
- // Check start
- max = state.posMax;
- if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||
- pos + 2 >= max) {
- return false;
- }
-
- // Quick fail on second char
- ch = state.src.charCodeAt(pos + 1);
- if (ch !== 0x21/* ! */ &&
- ch !== 0x3F/* ? */ &&
- ch !== 0x2F/* / */ &&
- !isLetter(ch)) {
- return false;
- }
-
- match = state.src.slice(pos).match(HTML_TAG_RE);
- if (!match) { return false; }
-
- if (!silent) {
- token = state.push('html_inline', '', 0);
- token.content = state.src.slice(pos, pos + match[0].length);
- }
- state.pos += match[0].length;
- return true;
-};
-
-},{"../common/html_re":323}],364:[function(require,module,exports){
-// Process ![image](<src> "title")
-
-'use strict';
-
-var normalizeReference = require('../common/utils').normalizeReference;
-var isSpace = require('../common/utils').isSpace;
-
-
-module.exports = function image(state, silent) {
- var attrs,
- code,
- content,
- label,
- labelEnd,
- labelStart,
- pos,
- ref,
- res,
- title,
- token,
- tokens,
- start,
- href = '',
- oldPos = state.pos,
- max = state.posMax;
-
- if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false; }
- if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false; }
-
- labelStart = state.pos + 2;
- labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
-
- // parser failed to find ']', so it's not a valid link
- if (labelEnd < 0) { return false; }
-
- pos = labelEnd + 1;
- if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
- //
- // Inline link
- //
-
- // [link]( <href> "title" )
- // ^^ skipping these spaces
- pos++;
- for (; pos < max; pos++) {
- code = state.src.charCodeAt(pos);
- if (!isSpace(code) && code !== 0x0A) { break; }
- }
- if (pos >= max) { return false; }
-
- // [link]( <href> "title" )
- // ^^^^^^ parsing link destination
- start = pos;
- res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
- if (res.ok) {
- href = state.md.normalizeLink(res.str);
- if (state.md.validateLink(href)) {
- pos = res.pos;
- } else {
- href = '';
- }
- }
-
- // [link]( <href> "title" )
- // ^^ skipping these spaces
- start = pos;
- for (; pos < max; pos++) {
- code = state.src.charCodeAt(pos);
- if (!isSpace(code) && code !== 0x0A) { break; }
- }
-
- // [link]( <href> "title" )
- // ^^^^^^^ parsing link title
- res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
- if (pos < max && start !== pos && res.ok) {
- title = res.str;
- pos = res.pos;
-
- // [link]( <href> "title" )
- // ^^ skipping these spaces
- for (; pos < max; pos++) {
- code = state.src.charCodeAt(pos);
- if (!isSpace(code) && code !== 0x0A) { break; }
- }
- } else {
- title = '';
- }
-
- if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
- state.pos = oldPos;
- return false;
- }
- pos++;
- } else {
- //
- // Link reference
- //
- if (typeof state.env.references === 'undefined') { return false; }
-
- if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
- start = pos + 1;
- pos = state.md.helpers.parseLinkLabel(state, pos);
- if (pos >= 0) {
- label = state.src.slice(start, pos++);
- } else {
- pos = labelEnd + 1;
- }
- } else {
- pos = labelEnd + 1;
- }
-
- // covers label === '' and label === undefined
- // (collapsed reference link and shortcut reference link respectively)
- if (!label) { label = state.src.slice(labelStart, labelEnd); }
-
- ref = state.env.references[normalizeReference(label)];
- if (!ref) {
- state.pos = oldPos;
- return false;
- }
- href = ref.href;
- title = ref.title;
- }
-
- //
- // We found the end of the link, and know for a fact it's a valid link;
- // so all that's left to do is to call tokenizer.
- //
- if (!silent) {
- content = state.src.slice(labelStart, labelEnd);
-
- state.md.inline.parse(
- content,
- state.md,
- state.env,
- tokens = []
- );
-
- token = state.push('image', 'img', 0);
- token.attrs = attrs = [ [ 'src', href ], [ 'alt', '' ] ];
- token.children = tokens;
- token.content = content;
-
- if (title) {
- attrs.push([ 'title', title ]);
- }
- }
-
- state.pos = pos;
- state.posMax = max;
- return true;
-};
-
-},{"../common/utils":324}],365:[function(require,module,exports){
-// Process [link](<to> "stuff")
-
-'use strict';
-
-var normalizeReference = require('../common/utils').normalizeReference;
-var isSpace = require('../common/utils').isSpace;
-
-
-module.exports = function link(state, silent) {
- var attrs,
- code,
- label,
- labelEnd,
- labelStart,
- pos,
- res,
- ref,
- title,
- token,
- href = '',
- oldPos = state.pos,
- max = state.posMax,
- start = state.pos,
- parseReference = true;
-
- if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false; }
-
- labelStart = state.pos + 1;
- labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
-
- // parser failed to find ']', so it's not a valid link
- if (labelEnd < 0) { return false; }
-
- pos = labelEnd + 1;
- if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
- //
- // Inline link
- //
-
- // might have found a valid shortcut link, disable reference parsing
- parseReference = false;
-
- // [link]( <href> "title" )
- // ^^ skipping these spaces
- pos++;
- for (; pos < max; pos++) {
- code = state.src.charCodeAt(pos);
- if (!isSpace(code) && code !== 0x0A) { break; }
- }
- if (pos >= max) { return false; }
-
- // [link]( <href> "title" )
- // ^^^^^^ parsing link destination
- start = pos;
- res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
- if (res.ok) {
- href = state.md.normalizeLink(res.str);
- if (state.md.validateLink(href)) {
- pos = res.pos;
- } else {
- href = '';
- }
- }
-
- // [link]( <href> "title" )
- // ^^ skipping these spaces
- start = pos;
- for (; pos < max; pos++) {
- code = state.src.charCodeAt(pos);
- if (!isSpace(code) && code !== 0x0A) { break; }
- }
-
- // [link]( <href> "title" )
- // ^^^^^^^ parsing link title
- res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
- if (pos < max && start !== pos && res.ok) {
- title = res.str;
- pos = res.pos;
-
- // [link]( <href> "title" )
- // ^^ skipping these spaces
- for (; pos < max; pos++) {
- code = state.src.charCodeAt(pos);
- if (!isSpace(code) && code !== 0x0A) { break; }
- }
- } else {
- title = '';
- }
-
- if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
- // parsing a valid shortcut link failed, fallback to reference
- parseReference = true;
- }
- pos++;
- }
-
- if (parseReference) {
- //
- // Link reference
- //
- if (typeof state.env.references === 'undefined') { return false; }
-
- if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
- start = pos + 1;
- pos = state.md.helpers.parseLinkLabel(state, pos);
- if (pos >= 0) {
- label = state.src.slice(start, pos++);
- } else {
- pos = labelEnd + 1;
- }
- } else {
- pos = labelEnd + 1;
- }
-
- // covers label === '' and label === undefined
- // (collapsed reference link and shortcut reference link respectively)
- if (!label) { label = state.src.slice(labelStart, labelEnd); }
-
- ref = state.env.references[normalizeReference(label)];
- if (!ref) {
- state.pos = oldPos;
- return false;
- }
- href = ref.href;
- title = ref.title;
- }
-
- //
- // We found the end of the link, and know for a fact it's a valid link;
- // so all that's left to do is to call tokenizer.
- //
- if (!silent) {
- state.pos = labelStart;
- state.posMax = labelEnd;
-
- token = state.push('link_open', 'a', 1);
- token.attrs = attrs = [ [ 'href', href ] ];
- if (title) {
- attrs.push([ 'title', title ]);
- }
-
- state.md.inline.tokenize(state);
-
- token = state.push('link_close', 'a', -1);
- }
-
- state.pos = pos;
- state.posMax = max;
- return true;
-};
-
-},{"../common/utils":324}],366:[function(require,module,exports){
-// Proceess '\n'
-
-'use strict';
-
-var isSpace = require('../common/utils').isSpace;
-
-
-module.exports = function newline(state, silent) {
- var pmax, max, pos = state.pos;
-
- if (state.src.charCodeAt(pos) !== 0x0A/* \n */) { return false; }
-
- pmax = state.pending.length - 1;
- max = state.posMax;
-
- // ' \n' -> hardbreak
- // Lookup in pending chars is bad practice! Don't copy to other rules!
- // Pending string is stored in concat mode, indexed lookups will cause
- // convertion to flat mode.
- if (!silent) {
- if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {
- if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {
- state.pending = state.pending.replace(/ +$/, '');
- state.push('hardbreak', 'br', 0);
- } else {
- state.pending = state.pending.slice(0, -1);
- state.push('softbreak', 'br', 0);
- }
-
- } else {
- state.push('softbreak', 'br', 0);
- }
- }
-
- pos++;
-
- // skip heading spaces for next line
- while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; }
-
- state.pos = pos;
- return true;
-};
-
-},{"../common/utils":324}],367:[function(require,module,exports){
-// Inline parser state
-
-'use strict';
-
-
-var Token = require('../token');
-var isWhiteSpace = require('../common/utils').isWhiteSpace;
-var isPunctChar = require('../common/utils').isPunctChar;
-var isMdAsciiPunct = require('../common/utils').isMdAsciiPunct;
-
-
-function StateInline(src, md, env, outTokens) {
- this.src = src;
- this.env = env;
- this.md = md;
- this.tokens = outTokens;
-
- this.pos = 0;
- this.posMax = this.src.length;
- this.level = 0;
- this.pending = '';
- this.pendingLevel = 0;
-
- this.cache = {}; // Stores { start: end } pairs. Useful for backtrack
- // optimization of pairs parse (emphasis, strikes).
-
- this.delimiters = []; // Emphasis-like delimiters
-}
-
-
-// Flush pending text
-//
-StateInline.prototype.pushPending = function () {
- var token = new Token('text', '', 0);
- token.content = this.pending;
- token.level = this.pendingLevel;
- this.tokens.push(token);
- this.pending = '';
- return token;
-};
-
-
-// Push new token to "stream".
-// If pending text exists - flush it as text token
-//
-StateInline.prototype.push = function (type, tag, nesting) {
- if (this.pending) {
- this.pushPending();
- }
-
- var token = new Token(type, tag, nesting);
-
- if (nesting < 0) { this.level--; }
- token.level = this.level;
- if (nesting > 0) { this.level++; }
-
- this.pendingLevel = this.level;
- this.tokens.push(token);
- return token;
-};
-
-
-// Scan a sequence of emphasis-like markers, and determine whether
-// it can start an emphasis sequence or end an emphasis sequence.
-//
-// - start - position to scan from (it should point at a valid marker);
-// - canSplitWord - determine if these markers can be found inside a word
-//
-StateInline.prototype.scanDelims = function (start, canSplitWord) {
- var pos = start, lastChar, nextChar, count, can_open, can_close,
- isLastWhiteSpace, isLastPunctChar,
- isNextWhiteSpace, isNextPunctChar,
- left_flanking = true,
- right_flanking = true,
- max = this.posMax,
- marker = this.src.charCodeAt(start);
-
- // treat beginning of the line as a whitespace
- lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20;
-
- while (pos < max && this.src.charCodeAt(pos) === marker) { pos++; }
-
- count = pos - start;
-
- // treat end of the line as a whitespace
- nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20;
-
- isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
- isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
-
- isLastWhiteSpace = isWhiteSpace(lastChar);
- isNextWhiteSpace = isWhiteSpace(nextChar);
-
- if (isNextWhiteSpace) {
- left_flanking = false;
- } else if (isNextPunctChar) {
- if (!(isLastWhiteSpace || isLastPunctChar)) {
- left_flanking = false;
- }
- }
-
- if (isLastWhiteSpace) {
- right_flanking = false;
- } else if (isLastPunctChar) {
- if (!(isNextWhiteSpace || isNextPunctChar)) {
- right_flanking = false;
- }
- }
-
- if (!canSplitWord) {
- can_open = left_flanking && (!right_flanking || isLastPunctChar);
- can_close = right_flanking && (!left_flanking || isNextPunctChar);
- } else {
- can_open = left_flanking;
- can_close = right_flanking;
- }
-
- return {
- can_open: can_open,
- can_close: can_close,
- length: count
- };
-};
-
-
-// re-export Token class to use in block rules
-StateInline.prototype.Token = Token;
-
-
-module.exports = StateInline;
-
-},{"../common/utils":324,"../token":371}],368:[function(require,module,exports){
-// ~~strike through~~
-//
-'use strict';
-
-
-// Insert each marker as a separate text token, and add it to delimiter list
-//
-module.exports.tokenize = function strikethrough(state, silent) {
- var i, scanned, token, len, ch,
- start = state.pos,
- marker = state.src.charCodeAt(start);
-
- if (silent) { return false; }
-
- if (marker !== 0x7E/* ~ */) { return false; }
-
- scanned = state.scanDelims(state.pos, true);
- len = scanned.length;
- ch = String.fromCharCode(marker);
-
- if (len < 2) { return false; }
-
- if (len % 2) {
- token = state.push('text', '', 0);
- token.content = ch;
- len--;
- }
-
- for (i = 0; i < len; i += 2) {
- token = state.push('text', '', 0);
- token.content = ch + ch;
-
- state.delimiters.push({
- marker: marker,
- jump: i,
- token: state.tokens.length - 1,
- level: state.level,
- end: -1,
- open: scanned.can_open,
- close: scanned.can_close
- });
- }
-
- state.pos += scanned.length;
-
- return true;
-};
-
-
-// Walk through delimiter list and replace text tokens with tags
-//
-module.exports.postProcess = function strikethrough(state) {
- var i, j,
- startDelim,
- endDelim,
- token,
- loneMarkers = [],
- delimiters = state.delimiters,
- max = state.delimiters.length;
-
- for (i = 0; i < max; i++) {
- startDelim = delimiters[i];
-
- if (startDelim.marker !== 0x7E/* ~ */) {
- continue;
- }
-
- if (startDelim.end === -1) {
- continue;
- }
-
- endDelim = delimiters[startDelim.end];
-
- token = state.tokens[startDelim.token];
- token.type = 's_open';
- token.tag = 's';
- token.nesting = 1;
- token.markup = '~~';
- token.content = '';
-
- token = state.tokens[endDelim.token];
- token.type = 's_close';
- token.tag = 's';
- token.nesting = -1;
- token.markup = '~~';
- token.content = '';
-
- if (state.tokens[endDelim.token - 1].type === 'text' &&
- state.tokens[endDelim.token - 1].content === '~') {
-
- loneMarkers.push(endDelim.token - 1);
- }
- }
-
- // If a marker sequence has an odd number of characters, it's splitted
- // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the
- // start of the sequence.
- //
- // So, we have to move all those markers after subsequent s_close tags.
- //
- while (loneMarkers.length) {
- i = loneMarkers.pop();
- j = i + 1;
-
- while (j < state.tokens.length && state.tokens[j].type === 's_close') {
- j++;
- }
-
- j--;
-
- if (i !== j) {
- token = state.tokens[j];
- state.tokens[j] = state.tokens[i];
- state.tokens[i] = token;
- }
- }
-};
-
-},{}],369:[function(require,module,exports){
-// Skip text characters for text token, place those to pending buffer
-// and increment current pos
-
-'use strict';
-
-
-// Rule to skip pure text
-// '{}$%@~+=:' reserved for extentions
-
-// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
-
-// !!!! Don't confuse with "Markdown ASCII Punctuation" chars
-// http://spec.commonmark.org/0.15/#ascii-punctuation-character
-function isTerminatorChar(ch) {
- switch (ch) {
- case 0x0A/* \n */:
- case 0x21/* ! */:
- case 0x23/* # */:
- case 0x24/* $ */:
- case 0x25/* % */:
- case 0x26/* & */:
- case 0x2A/* * */:
- case 0x2B/* + */:
- case 0x2D/* - */:
- case 0x3A/* : */:
- case 0x3C/* < */:
- case 0x3D/* = */:
- case 0x3E/* > */:
- case 0x40/* @ */:
- case 0x5B/* [ */:
- case 0x5C/* \ */:
- case 0x5D/* ] */:
- case 0x5E/* ^ */:
- case 0x5F/* _ */:
- case 0x60/* ` */:
- case 0x7B/* { */:
- case 0x7D/* } */:
- case 0x7E/* ~ */:
- return true;
- default:
- return false;
- }
-}
-
-module.exports = function text(state, silent) {
- var pos = state.pos;
-
- while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {
- pos++;
- }
-
- if (pos === state.pos) { return false; }
-
- if (!silent) { state.pending += state.src.slice(state.pos, pos); }
-
- state.pos = pos;
-
- return true;
-};
-
-// Alternative implementation, for memory.
-//
-// It costs 10% of performance, but allows extend terminators list, if place it
-// to `ParcerInline` property. Probably, will switch to it sometime, such
-// flexibility required.
-
-/*
-var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/;
-
-module.exports = function text(state, silent) {
- var pos = state.pos,
- idx = state.src.slice(pos).search(TERMINATOR_RE);
-
- // first char is terminator -> empty text
- if (idx === 0) { return false; }
-
- // no terminator -> text till end of string
- if (idx < 0) {
- if (!silent) { state.pending += state.src.slice(pos); }
- state.pos = state.src.length;
- return true;
- }
-
- if (!silent) { state.pending += state.src.slice(pos, pos + idx); }
-
- state.pos += idx;
-
- return true;
-};*/
-
-},{}],370:[function(require,module,exports){
-// Merge adjacent text nodes into one, and re-calculate all token levels
-//
-'use strict';
-
-
-module.exports = function text_collapse(state) {
- var curr, last,
- level = 0,
- tokens = state.tokens,
- max = state.tokens.length;
-
- for (curr = last = 0; curr < max; curr++) {
- // re-calculate levels
- level += tokens[curr].nesting;
- tokens[curr].level = level;
-
- if (tokens[curr].type === 'text' &&
- curr + 1 < max &&
- tokens[curr + 1].type === 'text') {
-
- // collapse two adjacent text nodes
- tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
- } else {
- if (curr !== last) { tokens[last] = tokens[curr]; }
-
- last++;
- }
- }
-
- if (curr !== last) {
- tokens.length = last;
- }
-};
-
-},{}],371:[function(require,module,exports){
-// Token class
-
-'use strict';
-
-
-/**
- * class Token
- **/
-
-/**
- * new Token(type, tag, nesting)
- *
- * Create new token and fill passed properties.
- **/
-function Token(type, tag, nesting) {
- /**
- * Token#type -> String
- *
- * Type of the token (string, e.g. "paragraph_open")
- **/
- this.type = type;
-
- /**
- * Token#tag -> String
- *
- * html tag name, e.g. "p"
- **/
- this.tag = tag;
-
- /**
- * Token#attrs -> Array
- *
- * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`
- **/
- this.attrs = null;
-
- /**
- * Token#map -> Array
- *
- * Source map info. Format: `[ line_begin, line_end ]`
- **/
- this.map = null;
-
- /**
- * Token#nesting -> Number
- *
- * Level change (number in {-1, 0, 1} set), where:
- *
- * - `1` means the tag is opening
- * - `0` means the tag is self-closing
- * - `-1` means the tag is closing
- **/
- this.nesting = nesting;
-
- /**
- * Token#level -> Number
- *
- * nesting level, the same as `state.level`
- **/
- this.level = 0;
-
- /**
- * Token#children -> Array
- *
- * An array of child nodes (inline and img tokens)
- **/
- this.children = null;
-
- /**
- * Token#content -> String
- *
- * In a case of self-closing tag (code, html, fence, etc.),
- * it has contents of this tag.
- **/
- this.content = '';
-
- /**
- * Token#markup -> String
- *
- * '*' or '_' for emphasis, fence string for fence, etc.
- **/
- this.markup = '';
-
- /**
- * Token#info -> String
- *
- * fence infostring
- **/
- this.info = '';
-
- /**
- * Token#meta -> Object
- *
- * A place for plugins to store an arbitrary data
- **/
- this.meta = null;
-
- /**
- * Token#block -> Boolean
- *
- * True for block-level tokens, false for inline tokens.
- * Used in renderer to calculate line breaks
- **/
- this.block = false;
-
- /**
- * Token#hidden -> Boolean
- *
- * If it's true, ignore this element when rendering. Used for tight lists
- * to hide paragraphs.
- **/
- this.hidden = false;
-}
-
-
-/**
- * Token.attrIndex(name) -> Number
- *
- * Search attribute index by name.
- **/
-Token.prototype.attrIndex = function attrIndex(name) {
- var attrs, i, len;
-
- if (!this.attrs) { return -1; }
-
- attrs = this.attrs;
-
- for (i = 0, len = attrs.length; i < len; i++) {
- if (attrs[i][0] === name) { return i; }
- }
- return -1;
-};
-
-
-/**
- * Token.attrPush(attrData)
- *
- * Add `[ name, value ]` attribute to list. Init attrs if necessary
- **/
-Token.prototype.attrPush = function attrPush(attrData) {
- if (this.attrs) {
- this.attrs.push(attrData);
- } else {
- this.attrs = [ attrData ];
- }
-};
-
-
-/**
- * Token.attrSet(name, value)
- *
- * Set `name` attribute to `value`. Override old value if exists.
- **/
-Token.prototype.attrSet = function attrSet(name, value) {
- var idx = this.attrIndex(name),
- attrData = [ name, value ];
-
- if (idx < 0) {
- this.attrPush(attrData);
- } else {
- this.attrs[idx] = attrData;
- }
-};
-
-
-/**
- * Token.attrGet(name)
- *
- * Get the value of attribute `name`, or null if it does not exist.
- **/
-Token.prototype.attrGet = function attrGet(name) {
- var idx = this.attrIndex(name), value = null;
- if (idx >= 0) {
- value = this.attrs[idx][1];
- }
- return value;
-};
-
-
-/**
- * Token.attrJoin(name, value)
- *
- * Join value to existing attribute via space. Or create new attribute if not
- * exists. Useful to operate with token classes.
- **/
-Token.prototype.attrJoin = function attrJoin(name, value) {
- var idx = this.attrIndex(name);
-
- if (idx < 0) {
- this.attrPush([ name, value ]);
- } else {
- this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value;
- }
-};
-
-
-module.exports = Token;
-
-},{}],372:[function(require,module,exports){
-/** @flow */
-
-"use strict";
-
-function getRelocatable(re) {
- // In the future, this could use a WeakMap instead of an expando.
- if (!re.__matchAtRelocatable) {
- // Disjunctions are the lowest-precedence operator, so we can make any
- // pattern match the empty string by appending `|()` to it:
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-patterns
- var source = re.source + "|()";
-
- // We always make the new regex global.
- var flags = "g" + (re.ignoreCase ? "i" : "") + (re.multiline ? "m" : "") + (re.unicode ? "u" : "")
- // sticky (/.../y) doesn't make sense in conjunction with our relocation
- // logic, so we ignore it here.
- ;
-
- re.__matchAtRelocatable = new RegExp(source, flags);
- }
- return re.__matchAtRelocatable;
-}
-
-function matchAt(re, str, pos) {
- if (re.global || re.sticky) {
- throw new Error("matchAt(...): Only non-global regexes are supported");
- }
- var reloc = getRelocatable(re);
- reloc.lastIndex = pos;
- var match = reloc.exec(str);
- // Last capturing group is our sentinel that indicates whether the regex
- // matched at the given location.
- if (match[match.length - 1] == null) {
- // Original regex matched.
- match.length = match.length - 1;
- return match;
- } else {
- return null;
- }
-}
-
-module.exports = matchAt;
-},{}],373:[function(require,module,exports){
-
-'use strict';
-
-
-/* eslint-disable no-bitwise */
-
-var decodeCache = {};
-
-function getDecodeCache(exclude) {
- var i, ch, cache = decodeCache[exclude];
- if (cache) { return cache; }
-
- cache = decodeCache[exclude] = [];
-
- for (i = 0; i < 128; i++) {
- ch = String.fromCharCode(i);
- cache.push(ch);
- }
-
- for (i = 0; i < exclude.length; i++) {
- ch = exclude.charCodeAt(i);
- cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2);
- }
-
- return cache;
-}
-
-
-// Decode percent-encoded string.
-//
-function decode(string, exclude) {
- var cache;
-
- if (typeof exclude !== 'string') {
- exclude = decode.defaultChars;
- }
-
- cache = getDecodeCache(exclude);
-
- return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {
- var i, l, b1, b2, b3, b4, chr,
- result = '';
-
- for (i = 0, l = seq.length; i < l; i += 3) {
- b1 = parseInt(seq.slice(i + 1, i + 3), 16);
-
- if (b1 < 0x80) {
- result += cache[b1];
- continue;
- }
-
- if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {
- // 110xxxxx 10xxxxxx
- b2 = parseInt(seq.slice(i + 4, i + 6), 16);
-
- if ((b2 & 0xC0) === 0x80) {
- chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F);
-
- if (chr < 0x80) {
- result += '\ufffd\ufffd';
- } else {
- result += String.fromCharCode(chr);
- }
-
- i += 3;
- continue;
- }
- }
-
- if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {
- // 1110xxxx 10xxxxxx 10xxxxxx
- b2 = parseInt(seq.slice(i + 4, i + 6), 16);
- b3 = parseInt(seq.slice(i + 7, i + 9), 16);
-
- if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
- chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F);
-
- if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {
- result += '\ufffd\ufffd\ufffd';
- } else {
- result += String.fromCharCode(chr);
- }
-
- i += 6;
- continue;
- }
- }
-
- if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {
- // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx
- b2 = parseInt(seq.slice(i + 4, i + 6), 16);
- b3 = parseInt(seq.slice(i + 7, i + 9), 16);
- b4 = parseInt(seq.slice(i + 10, i + 12), 16);
-
- if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {
- chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F);
-
- if (chr < 0x10000 || chr > 0x10FFFF) {
- result += '\ufffd\ufffd\ufffd\ufffd';
- } else {
- chr -= 0x10000;
- result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF));
- }
-
- i += 9;
- continue;
- }
- }
-
- result += '\ufffd';
- }
-
- return result;
- });
-}
-
-
-decode.defaultChars = ';/?:@&=+$,#';
-decode.componentChars = '';
-
-
-module.exports = decode;
-
-},{}],374:[function(require,module,exports){
-
-'use strict';
-
-
-var encodeCache = {};
-
-
-// Create a lookup array where anything but characters in `chars` string
-// and alphanumeric chars is percent-encoded.
-//
-function getEncodeCache(exclude) {
- var i, ch, cache = encodeCache[exclude];
- if (cache) { return cache; }
-
- cache = encodeCache[exclude] = [];
-
- for (i = 0; i < 128; i++) {
- ch = String.fromCharCode(i);
-
- if (/^[0-9a-z]$/i.test(ch)) {
- // always allow unencoded alphanumeric characters
- cache.push(ch);
- } else {
- cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2));
- }
- }
-
- for (i = 0; i < exclude.length; i++) {
- cache[exclude.charCodeAt(i)] = exclude[i];
- }
-
- return cache;
-}
-
-
-// Encode unsafe characters with percent-encoding, skipping already
-// encoded sequences.
-//
-// - string - string to encode
-// - exclude - list of characters to ignore (in addition to a-zA-Z0-9)
-// - keepEscaped - don't encode '%' in a correct escape sequence (default: true)
-//
-function encode(string, exclude, keepEscaped) {
- var i, l, code, nextCode, cache,
- result = '';
-
- if (typeof exclude !== 'string') {
- // encode(string, keepEscaped)
- keepEscaped = exclude;
- exclude = encode.defaultChars;
- }
-
- if (typeof keepEscaped === 'undefined') {
- keepEscaped = true;
- }
-
- cache = getEncodeCache(exclude);
-
- for (i = 0, l = string.length; i < l; i++) {
- code = string.charCodeAt(i);
-
- if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {
- if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {
- result += string.slice(i, i + 3);
- i += 2;
- continue;
- }
- }
-
- if (code < 128) {
- result += cache[code];
- continue;
- }
-
- if (code >= 0xD800 && code <= 0xDFFF) {
- if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {
- nextCode = string.charCodeAt(i + 1);
- if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {
- result += encodeURIComponent(string[i] + string[i + 1]);
- i++;
- continue;
- }
- }
- result += '%EF%BF%BD';
- continue;
- }
-
- result += encodeURIComponent(string[i]);
- }
-
- return result;
-}
-
-encode.defaultChars = ";/?:@&=+$,-_.!~*'()#";
-encode.componentChars = "-_.!~*'()";
-
-
-module.exports = encode;
-
-},{}],375:[function(require,module,exports){
-
-'use strict';
-
-
-module.exports = function format(url) {
- var result = '';
-
- result += url.protocol || '';
- result += url.slashes ? '//' : '';
- result += url.auth ? url.auth + '@' : '';
-
- if (url.hostname && url.hostname.indexOf(':') !== -1) {
- // ipv6 address
- result += '[' + url.hostname + ']';
- } else {
- result += url.hostname || '';
- }
-
- result += url.port ? ':' + url.port : '';
- result += url.pathname || '';
- result += url.search || '';
- result += url.hash || '';
-
- return result;
-};
-
-},{}],376:[function(require,module,exports){
-'use strict';
-
-
-module.exports.encode = require('./encode');
-module.exports.decode = require('./decode');
-module.exports.format = require('./format');
-module.exports.parse = require('./parse');
-
-},{"./decode":373,"./encode":374,"./format":375,"./parse":377}],377:[function(require,module,exports){
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-'use strict';
-
-//
-// Changes from joyent/node:
-//
-// 1. No leading slash in paths,
-// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`
-//
-// 2. Backslashes are not replaced with slashes,
-// so `http:\\example.org\` is treated like a relative path
-//
-// 3. Trailing colon is treated like a part of the path,
-// i.e. in `http://example.org:foo` pathname is `:foo`
-//
-// 4. Nothing is URL-encoded in the resulting object,
-// (in joyent/node some chars in auth and paths are encoded)
-//
-// 5. `url.parse()` does not have `parseQueryString` argument
-//
-// 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,
-// which can be constructed using other parts of the url.
-//
-
-
-function Url() {
- this.protocol = null;
- this.slashes = null;
- this.auth = null;
- this.port = null;
- this.hostname = null;
- this.hash = null;
- this.search = null;
- this.pathname = null;
-}
-
-// Reference: RFC 3986, RFC 1808, RFC 2396
-
-// define these here so at least they only have to be
-// compiled once on the first module load.
-var protocolPattern = /^([a-z0-9.+-]+:)/i,
- portPattern = /:[0-9]*$/,
-
- // Special case for a simple path URL
- simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
-
- // RFC 2396: characters reserved for delimiting URLs.
- // We actually just auto-escape these.
- delims = [ '<', '>', '"', '`', ' ', '\r', '\n', '\t' ],
-
- // RFC 2396: characters not allowed for various reasons.
- unwise = [ '{', '}', '|', '\\', '^', '`' ].concat(delims),
-
- // Allowed by RFCs, but cause of XSS attacks. Always escape these.
- autoEscape = [ '\'' ].concat(unwise),
- // Characters that are never ever allowed in a hostname.
- // Note that any invalid chars are also handled, but these
- // are the ones that are *expected* to be seen, so we fast-path
- // them.
- nonHostChars = [ '%', '/', '?', ';', '#' ].concat(autoEscape),
- hostEndingChars = [ '/', '?', '#' ],
- hostnameMaxLen = 255,
- hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
- hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
- // protocols that can allow "unsafe" and "unwise" chars.
- /* eslint-disable no-script-url */
- // protocols that never have a hostname.
- hostlessProtocol = {
- 'javascript': true,
- 'javascript:': true
- },
- // protocols that always contain a // bit.
- slashedProtocol = {
- 'http': true,
- 'https': true,
- 'ftp': true,
- 'gopher': true,
- 'file': true,
- 'http:': true,
- 'https:': true,
- 'ftp:': true,
- 'gopher:': true,
- 'file:': true
- };
- /* eslint-enable no-script-url */
-
-function urlParse(url, slashesDenoteHost) {
- if (url && url instanceof Url) { return url; }
-
- var u = new Url();
- u.parse(url, slashesDenoteHost);
- return u;
-}
-
-Url.prototype.parse = function(url, slashesDenoteHost) {
- var i, l, lowerProto, hec, slashes,
- rest = url;
-
- // trim before proceeding.
- // This is to support parse stuff like " http://foo.com \n"
- rest = rest.trim();
-
- if (!slashesDenoteHost && url.split('#').length === 1) {
- // Try fast path regexp
- var simplePath = simplePathPattern.exec(rest);
- if (simplePath) {
- this.pathname = simplePath[1];
- if (simplePath[2]) {
- this.search = simplePath[2];
- }
- return this;
- }
- }
-
- var proto = protocolPattern.exec(rest);
- if (proto) {
- proto = proto[0];
- lowerProto = proto.toLowerCase();
- this.protocol = proto;
- rest = rest.substr(proto.length);
- }
-
- // figure out if it's got a host
- // user@server is *always* interpreted as a hostname, and url
- // resolution will treat //foo/bar as host=foo,path=bar because that's
- // how the browser resolves relative URLs.
- if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
- slashes = rest.substr(0, 2) === '//';
- if (slashes && !(proto && hostlessProtocol[proto])) {
- rest = rest.substr(2);
- this.slashes = true;
- }
- }
-
- if (!hostlessProtocol[proto] &&
- (slashes || (proto && !slashedProtocol[proto]))) {
-
- // there's a hostname.
- // the first instance of /, ?, ;, or # ends the host.
- //
- // If there is an @ in the hostname, then non-host chars *are* allowed
- // to the left of the last @ sign, unless some host-ending character
- // comes *before* the @-sign.
- // URLs are obnoxious.
- //
- // ex:
- // http://a@b@c/ => user:a@b host:c
- // http://a@b?@c => user:a host:c path:/?@c
-
- // v0.12 TODO(isaacs): This is not quite how Chrome does things.
- // Review our test case against browsers more comprehensively.
-
- // find the first instance of any hostEndingChars
- var hostEnd = -1;
- for (i = 0; i < hostEndingChars.length; i++) {
- hec = rest.indexOf(hostEndingChars[i]);
- if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
- hostEnd = hec;
- }
- }
-
- // at this point, either we have an explicit point where the
- // auth portion cannot go past, or the last @ char is the decider.
- var auth, atSign;
- if (hostEnd === -1) {
- // atSign can be anywhere.
- atSign = rest.lastIndexOf('@');
- } else {
- // atSign must be in auth portion.
- // http://a@b/c@d => host:b auth:a path:/c@d
- atSign = rest.lastIndexOf('@', hostEnd);
- }
-
- // Now we have a portion which is definitely the auth.
- // Pull that off.
- if (atSign !== -1) {
- auth = rest.slice(0, atSign);
- rest = rest.slice(atSign + 1);
- this.auth = auth;
- }
-
- // the host is the remaining to the left of the first non-host char
- hostEnd = -1;
- for (i = 0; i < nonHostChars.length; i++) {
- hec = rest.indexOf(nonHostChars[i]);
- if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
- hostEnd = hec;
- }
- }
- // if we still have not hit it, then the entire thing is a host.
- if (hostEnd === -1) {
- hostEnd = rest.length;
- }
-
- if (rest[hostEnd - 1] === ':') { hostEnd--; }
- var host = rest.slice(0, hostEnd);
- rest = rest.slice(hostEnd);
-
- // pull out port.
- this.parseHost(host);
-
- // we've indicated that there is a hostname,
- // so even if it's empty, it has to be present.
- this.hostname = this.hostname || '';
-
- // if hostname begins with [ and ends with ]
- // assume that it's an IPv6 address.
- var ipv6Hostname = this.hostname[0] === '[' &&
- this.hostname[this.hostname.length - 1] === ']';
-
- // validate a little.
- if (!ipv6Hostname) {
- var hostparts = this.hostname.split(/\./);
- for (i = 0, l = hostparts.length; i < l; i++) {
- var part = hostparts[i];
- if (!part) { continue; }
- if (!part.match(hostnamePartPattern)) {
- var newpart = '';
- for (var j = 0, k = part.length; j < k; j++) {
- if (part.charCodeAt(j) > 127) {
- // we replace non-ASCII char with a temporary placeholder
- // we need this to make sure size of hostname is not
- // broken by replacing non-ASCII by nothing
- newpart += 'x';
- } else {
- newpart += part[j];
- }
- }
- // we test again with ASCII char only
- if (!newpart.match(hostnamePartPattern)) {
- var validParts = hostparts.slice(0, i);
- var notHost = hostparts.slice(i + 1);
- var bit = part.match(hostnamePartStart);
- if (bit) {
- validParts.push(bit[1]);
- notHost.unshift(bit[2]);
- }
- if (notHost.length) {
- rest = notHost.join('.') + rest;
- }
- this.hostname = validParts.join('.');
- break;
- }
- }
- }
- }
-
- if (this.hostname.length > hostnameMaxLen) {
- this.hostname = '';
- }
-
- // strip [ and ] from the hostname
- // the host field still retains them, though
- if (ipv6Hostname) {
- this.hostname = this.hostname.substr(1, this.hostname.length - 2);
- }
- }
-
- // chop off from the tail first.
- var hash = rest.indexOf('#');
- if (hash !== -1) {
- // got a fragment string.
- this.hash = rest.substr(hash);
- rest = rest.slice(0, hash);
- }
- var qm = rest.indexOf('?');
- if (qm !== -1) {
- this.search = rest.substr(qm);
- rest = rest.slice(0, qm);
- }
- if (rest) { this.pathname = rest; }
- if (slashedProtocol[lowerProto] &&
- this.hostname && !this.pathname) {
- this.pathname = '';
- }
-
- return this;
-};
-
-Url.prototype.parseHost = function(host) {
- var port = portPattern.exec(host);
- if (port) {
- port = port[0];
- if (port !== ':') {
- this.port = port.substr(1);
- }
- host = host.substr(0, host.length - port.length);
- }
- if (host) { this.hostname = host; }
-};
-
-module.exports = urlParse;
-
-},{}],378:[function(require,module,exports){
-module.exports={
- "_from": "mermaid",
- "_id": "mermaid@7.0.4",
- "_inBundle": false,
- "_integrity": "sha512-Jjf+QdBd58hcAk3jbBzAaaYudipgI7FCxZZrymanvd4EkIyoATQFAZgqoD0RnIZxgUvd/LdPoQhnJGJls93b/Q==",
- "_location": "/mermaid",
- "_phantomChildren": {},
- "_requested": {
- "type": "tag",
- "registry": true,
- "raw": "mermaid",
- "name": "mermaid",
- "escapedName": "mermaid",
- "rawSpec": "",
- "saveSpec": null,
- "fetchSpec": "latest"
- },
- "_requiredBy": [
- "#USER",
- "/"
- ],
- "_resolved": "https://registry.npmjs.org/mermaid/-/mermaid-7.0.4.tgz",
- "_shasum": "4242459bc9bd8e2e7b8c35e35f11f816f9893ba7",
- "_spec": "mermaid",
- "_where": "/srv/http/cloud/apps/files_markdown/js",
- "author": {
- "name": "Knut Sveidqvist"
- },
- "bin": {
- "mermaid": "./bin/mermaid.js"
- },
- "bugs": {
- "url": "https://github.com/knsv/mermaid/issues"
- },
- "bundleDependencies": false,
- "dependencies": {
- "chalk": "^2.1.0",
- "d3": "3.5.17",
- "dagre": "^0.7.4",
- "dagre-d3-renderer": "0.1.6",
- "he": "^1.1.1",
- "lodash": "^4.17.4",
- "minimist": "^1.2.0",
- "mkdirp": "^0.5.1",
- "moment": "^2.18.1",
- "semver": "^5.4.1",
- "which": "^1.3.0"
- },
- "deprecated": false,
- "description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
- "devDependencies": {
- "async": "^2.5.0",
- "babel-core": "^6.25.0",
- "babel-loader": "^7.1.1",
- "babel-plugin-transform-remove-strict-mode": "^0.0.2",
- "babel-preset-env": "^1.6.0",
- "clone": "^2.1.1",
- "codeclimate-test-reporter": "0.5.0",
- "css-loader": "^0.28.4",
- "dox": "^0.9.0",
- "event-stream": "^3.3.4",
- "extract-text-webpack-plugin": "^3.0.0",
- "front-matter": "^2.1.2",
- "gulp": "~3.9.1",
- "gulp-bower": "0.0.13",
- "gulp-bump": "^2.7.0",
- "gulp-concat": "~2.6.1",
- "gulp-data": "^1.2.1",
- "gulp-dox": "^0.1.6",
- "gulp-ext-replace": "^0.3.0",
- "gulp-filelog": "^0.4.1",
- "gulp-front-matter": "^1.3.0",
- "gulp-hogan": "^2.0.0",
- "gulp-if": "^2.0.2",
- "gulp-insert": "^0.5.0",
- "gulp-istanbul": "^1.1.2",
- "gulp-jasmine": "~2.4.2",
- "gulp-jasmine-browser": "^1.9.0",
- "gulp-jison": "~1.2.0",
- "gulp-less": "^3.3.2",
- "gulp-livereload": "^3.8.1",
- "gulp-marked": "^1.0.0",
- "gulp-mdvars": "^2.0.0",
- "gulp-qunit": "~1.5.0",
- "gulp-rename": "~1.2.2",
- "gulp-shell": "^0.6.3",
- "gulp-tag-version": "^1.3.0",
- "gulp-util": "^3.0.8",
- "gulp-vartree": "^2.0.1",
- "hogan.js": "^3.0.2",
- "inject-loader": "^3.0.1",
- "jasmine": "2.7.0",
- "jasmine-es6": "0.4.1",
- "jison": "^0.4.17",
- "jsdom": "^11.1.0",
- "karma": "^1.7.0",
- "karma-chrome-launcher": "^2.2.0",
- "karma-jasmine": "^1.1.0",
- "karma-webpack": "^2.0.4",
- "less": "^2.7.2",
- "less-loader": "^4.0.5",
- "live-server": "^1.2.0",
- "map-stream": "0.0.7",
- "marked": "^0.3.6",
- "mock-browser": "^0.92.14",
- "npm-check-updates": "^2.12.1",
- "phantomjs-prebuilt": "^2.1.15",
- "require-dir": "^0.3.2",
- "rimraf": "^2.6.1",
- "standard": "^10.0.3",
- "style-loader": "^0.18.2",
- "tape": "^4.8.0",
- "webpack": "^3.5.5",
- "webpack-node-externals": "^1.6.0"
- },
- "files": [
- "bin",
- "dist",
- "lib",
- "src"
- ],
- "homepage": "https://github.com/knsv/mermaid#readme",
- "keywords": [
- "diagram",
- "markdown",
- "flowchart",
- "sequence diagram",
- "gantt",
- "class diagram",
- "git graph"
- ],
- "license": "MIT",
- "main": "src/mermaid.js",
- "name": "mermaid",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/knsv/mermaid.git"
- },
- "scripts": {
- "build": "node -r babel-register ./node_modules/.bin/webpack --progress --colors",
- "dist": "node -r babel-register ./node_modules/.bin/webpack --progress --colors -p --config webpack.config.prod.js",
- "doc": "rm -r build;rm -r dist/www;gulp vartree;cp dist/www/all.html ../mermaid-pages/index.html;cp dist/mermaid.js ../mermaid-pages/javascripts/lib;cp dist/mermaid.forest.css ../mermaid-pages/stylesheets",
- "jison": "gulp jison_legacy",
- "karma": "node node_modules/karma/bin/karma start karma.conf.js --single-run",
- "lint": "standard",
- "live": "live-server ./test/examples",
- "live_server": "gulp live-server",
- "prepublishOnly": "yarn build && yarn dist && yarn test",
- "pretest": "yarn lint",
- "tape": "node node_modules/tape/bin/tape test/cli_test-*.js",
- "test": "yarn tape && yarn karma",
- "upgrade": "rm -rf node_modules && rm yarn.lock && yarn install && ncu -ua && yarn upgrade && yarn remove d3 && yarn add d3@3.5.17",
- "watch": "yarn build -- --watch"
- },
- "standard": {
- "ignore": [
- "**/parser/*.js",
- "dist/**/*.js",
- "docs/**/*.js",
- "editor/**/*.js"
- ]
- },
- "version": "7.0.4"
-}
-
-},{}],379:[function(require,module,exports){
-const d3 = require('d3')
-
-module.exports = d3;
-
-/*
- D3 Text Wrap
- By Vijith Assar
- http://www.vijithassar.com
- http://www.github.com/vijithassar
- @vijithassar
-
- Detailed instructions at http://www.github.com/vijithassar/d3textwrap
- */
-
-(function () {
- // set this variable to a string value to always force a particular
- // wrap method for development purposes, for example to check tspan
- // rendering using a foreignobject-enabled browser. set to 'tspan' to
- // use tspans and 'foreignobject' to use foreignobject
- var forceWrapMethod = false // by default no wrap method is forced
- forceWrapMethod = 'tspans' // uncomment this statement to force tspans
- // force_wrap_method = 'foreignobjects'; // uncomment this statement to force foreignobjects
-
- // exit immediately if something in this location
- // has already been defined; the plugin will defer to whatever
- // else you're doing in your code
- if (d3.selection.prototype.textwrap) {
- return false
- }
-
- // double check the force_wrap_method flag
- // and reset if someone screwed up the above
- // settings
- if (typeof forceWrapMethod === 'undefined') {
- forceWrapMethod = false
- }
-
- // create the plugin method twice, both for regular use
- // and again for use inside the enter() selection
- d3.selection.prototype.textwrap = d3.selection.enter.prototype.textwrap = function (bounds, padding) {
- // default value of padding is zero if it's undefined
- padding = parseInt(padding) || 0
-
- // save callee into a variable so we can continue to refer to it
- // as the function scope changes
- var selection = this
-
- // create a variable to store desired return values in
- var returnValue
-
- // extract wrap boundaries from any d3-selected rect and return them
- // in a format that matches the simpler object argument option
- var extractBounds = function (bounds) {
- // discard the nested array wrappers added by d3
- var boundingRect = bounds[0][0]
- // sanitize the svg element name so we can test against it
- var elementType = boundingRect.tagName.toString()
- // if it's not a rect, exit
- if (elementType !== 'rect') {
- return false
- // if it's a rect, proceed to extracting the position attributes
- } else {
- var boundsExtracted = {}
- boundsExtracted.x = d3.select(boundingRect).attr('x') || 0
- boundsExtracted.y = d3.select(boundingRect).attr('y') || 0
- boundsExtracted.width = d3.select(boundingRect).attr('width') || 0
- boundsExtracted.height = d3.select(boundingRect).attr('height') || 0
- // also pass along the getter function
- boundsExtracted.attr = bounds.attr
- }
- return boundsExtracted
- }
-
- // double check the input argument for the wrapping
- // boundaries to make sure it actually contains all
- // the information we'll need in order to wrap successfully
- var verifyBounds = function (bounds) {
- // quickly add a simple getter method so you can use either
- // bounds.x or bounds.attr('x') as your notation,
- // the latter being a common convention among D3
- // developers
- if (!bounds.attr) {
- bounds.attr = function (property) {
- if (this[property]) {
- return this[property]
- }
- }
- }
- // if it's an associative array, make sure it has all the
- // necessary properties represented directly
- if (
- (typeof bounds === 'object') &&
- (typeof bounds.x !== 'undefined') &&
- (typeof bounds.y !== 'undefined') &&
- (typeof bounds.width !== 'undefined') &&
- (typeof bounds.height !== 'undefined')
- // if that's the case, then the bounds are fine
- ) {
- // return the lightly modified bounds
- return bounds
- // if it's a numerically indexed array, assume it's a
- // d3-selected rect and try to extract the positions
- } else if (
- // first try to make sure it's an array using Array.isArray
- (
- (typeof Array.isArray === 'function') &&
- (Array.isArray(bounds))
- ) ||
- // but since Array.isArray isn't always supported, fall
- // back to casting to the object to string when it's not
- (Object.prototype.toString.call(bounds) === '[object Array]')
- ) {
- // once you're sure it's an array, extract the boundaries
- // from the rect
- var extractedBounds = extractBounds(bounds)
- return extractedBounds
- } else {
- // but if the bounds are neither an object nor a numerical
- // array, then the bounds argument is invalid and you'll
- // need to fix it
- return false
- }
- }
-
- var applyPadding = function (bounds, padding) {
- var paddedBounds = bounds
- if (padding !== 0) {
- paddedBounds.x = parseInt(paddedBounds.x) + padding
- paddedBounds.y = parseInt(paddedBounds.y) + padding
- paddedBounds.width -= padding * 2
- paddedBounds.height -= padding * 2
- }
- return paddedBounds
- }
-
- // verify bounds
- var verifiedBounds = verifyBounds(bounds)
-
- // modify bounds if a padding value is provided
- if (padding) {
- verifiedBounds = applyPadding(verifiedBounds, padding)
- }
-
- // check that we have the necessary conditions for this function to operate properly
- if (
- // selection it's operating on cannot be not empty
- (selection.length === 0) ||
- // d3 must be available
- (!d3) ||
- // desired wrapping bounds must be provided as an input argument
- (!bounds) ||
- // input bounds must validate
- (!verifiedBounds)
- ) {
- // try to return the calling selection if possible
- // so as not to interfere with methods downstream in the
- // chain
- if (selection) {
- return selection
- // if all else fails, just return false. if you hit this point then you're
- // almost certainly trying to call the textwrap() method on something that
- // doesn't make sense!
- } else {
- return false
- }
- // if we've validated everything then we can finally proceed
- // to the meat of this operation
- } else {
- // reassign the verified bounds as the set we want
- // to work with from here on; this ensures that we're
- // using the same data structure for our bounds regardless
- // of whether the input argument was a simple object or
- // a d3 selection
- bounds = verifiedBounds
-
- // wrap using html and foreignObjects if they are supported
- var wrapWithForeignobjects = function (item) {
- // establish variables to quickly reference target nodes later
- var parent = d3.select(item[0].parentNode)
- var textNode = parent.select('text')
- var styledLineHeight = textNode.style('line-height')
- // extract our desired content from the single text element
- var textToWrap = textNode.text()
- // remove the text node and replace with a foreign object
- textNode.remove()
- var foreignObject = parent.append('foreignObject')
- // add foreign object and set dimensions, position, etc
- foreignObject
- .attr('requiredFeatures', 'http://www.w3.org/TR/SVG11/feature#Extensibility')
- .attr('x', bounds.x)
- .attr('y', bounds.y)
- .attr('width', bounds.width)
- .attr('height', bounds.height)
- // insert an HTML div
- var wrapDiv = foreignObject
- .append('xhtml:div')
- // this class is currently hardcoded
- // probably not necessary but easy to
- // override using .classed() and for now
- // it's nice to avoid a litany of input
- // arguments
- .attr('class', 'wrapped')
- // set div to same dimensions as foreign object
- wrapDiv
- .style('height', bounds.height)
- .style('width', bounds.width)
- // insert text content
- .html(textToWrap)
- if (styledLineHeight) {
- wrapDiv.style('line-height', styledLineHeight)
- }
- returnValue = parent.select('foreignObject')
- }
-
- // wrap with tspans if foreignObject is undefined
- var wrapWithTspans = function (item) {
- // operate on the first text item in the selection
- var textNode = item[0]
- var parent = textNode.parentNode
- var textNodeSelected = d3.select(textNode)
- // measure initial size of the text node as rendered
- var textNodeHeight = textNode.getBBox().height
- var textNodeWidth = textNode.getBBox().width
- // figure out the line height, either from rendered height
- // of the font or attached styling
- var lineHeight
- var renderedLineHeight = textNodeHeight
- var styledLineHeight = textNodeSelected.style('line-height')
- if (
- (styledLineHeight) &&
- (parseInt(styledLineHeight))
- ) {
- lineHeight = parseInt(styledLineHeight.replace('px', ''))
- } else {
- lineHeight = renderedLineHeight
- }
- // only fire the rest of this if the text content
- // overflows the desired dimensions
- if (textNodeWidth > bounds.width) {
- // store whatever is inside the text node
- // in a variable and then zero out the
- // initial content; we'll reinsert in a moment
- // using tspan elements.
- var textToWrap = textNodeSelected.text()
- textNodeSelected.text('')
- if (textToWrap) {
- // keep track of whether we are splitting by spaces
- // so we know whether to reinsert those spaces later
- var breakDelimiter
- // split at spaces to create an array of individual words
- var textToWrapArray
- if (textToWrap.indexOf(' ') !== -1) {
- breakDelimiter = ' '
- textToWrapArray = textToWrap.split(' ')
- } else {
- // if there are no spaces, figure out the split
- // points by comparing rendered text width against
- // bounds and translating that into character position
- // cuts
- breakDelimiter = ''
- var stringLength = textToWrap.length
- var numberOfSubstrings = Math.ceil(textNodeWidth / bounds.width)
- var spliceInterval = Math.floor(stringLength / numberOfSubstrings)
- if (
- !(spliceInterval * numberOfSubstrings >= stringLength)
- ) {
- numberOfSubstrings++
- }
- textToWrapArray = []
- var substring
- var startPosition
- for (var i = 0; i < numberOfSubstrings; i++) {
- startPosition = i * spliceInterval
- substring = textToWrap.substr(startPosition, spliceInterval)
- textToWrapArray.push(substring)
- }
- }
-
- // new array where we'll store the words re-assembled into
- // substrings that have been tested against the desired
- // maximum wrapping width
- var substrings = []
- // computed text length is arguably incorrectly reported for
- // all tspans after the first one, in that they will include
- // the width of previous separate tspans. to compensate we need
- // to manually track the computed text length of all those
- // previous tspans and substrings, and then use that to offset
- // the miscalculation. this then gives us the actual correct
- // position we want to use in rendering the text in the SVG.
- var totalOffset = 0
- // object for storing the results of text length computations later
- var temp = {}
- // loop through the words and test the computed text length
- // of the string against the maximum desired wrapping width
- for (i = 0; i < textToWrapArray.length; i++) {
- var word = textToWrapArray[i]
- var previousString = textNodeSelected.text()
- var previousWidth = textNode.getComputedTextLength()
- // initialize the current word as the first word
- // or append to the previous string if one exists
- var newstring
- if (previousString) {
- newstring = previousString + breakDelimiter + word
- } else {
- newstring = word
- }
- // add the newest substring back to the text node and
- // measure the length
- textNodeSelected.text(newstring)
- var newWidth = textNode.getComputedTextLength()
- // adjust the length by the offset we've tracked
- // due to the misreported length discussed above
-
- // if our latest version of the string is too
- // big for the bounds, use the previous
- // version of the string (without the newest word
- // added) and use the latest word to restart the
- // process with a new tspan
- if (newWidth > bounds.width) {
- if (
- (previousString) &&
- (previousString !== '')
- ) {
- totalOffset = totalOffset + previousWidth
- temp = { string: previousString, width: previousWidth, offset: totalOffset }
- substrings.push(temp)
- textNodeSelected.text('')
- textNodeSelected.text(word)
- // Handle case where there is just one more word to be wrapped
- if (i === textToWrapArray.length - 1) {
- newstring = word
- textNodeSelected.text(newstring)
- newWidth = textNode.getComputedTextLength()
- }
- }
- }
- // if we're up to the last word in the array,
- // get the computed length as is without
- // appending anything further to it
- if (i === textToWrapArray.length - 1) {
- textNodeSelected.text('')
- var finalString = newstring
- if (
- (finalString) &&
- (finalString !== '')
- ) {
- if ((newWidth - totalOffset) > 0) { newWidth = newWidth - totalOffset }
- temp = { string: finalString, width: newWidth, offset: totalOffset }
- substrings.push(temp)
- }
- }
- }
-
- // append each substring as a tspan
- var currentTspan
- // var tspanCount
- // double check that the text content has been removed
- // before we start appending tspans
- textNodeSelected.text('')
- for (i = 0; i < substrings.length; i++) {
- substring = substrings[i].string
- // only append if we're sure it won't make the tspans
- // overflow the bounds.
- if ((i) * lineHeight < bounds.height - (lineHeight * 1.5)) {
- currentTspan = textNodeSelected.append('tspan')
- .text(substring)
- // vertical shift to all tspans after the first one
- currentTspan
- .attr('dy', function (d) {
- if (i > 0) {
- return lineHeight
- }
- })
- // shift left from default position, which
- // is probably based on the full length of the
- // text string until we make this adjustment
- currentTspan
- .attr('x', function () {
- var xOffset = bounds.x
- if (padding) { xOffset += padding }
- return xOffset
- })
- }
- }
- }
- }
- // position the overall text node, whether wrapped or not
- textNodeSelected.attr('y', function () {
- var yOffset = bounds.y
- // shift by line-height to move the baseline into
- // the bounds – otherwise the text baseline would be
- // at the top of the bounds
- if (lineHeight) { yOffset += lineHeight }
- // shift by padding, if it's there
- if (padding) { yOffset += padding }
- return yOffset
- })
- // shift to the right by the padding value
- textNodeSelected.attr('x', function () {
- var xOffset = bounds.x
- if (padding) { xOffset += padding }
- return xOffset
- })
-
- // assign our modified text node with tspans
- // to the return value
- returnValue = d3.select(parent).selectAll('text')
- }
-
- // variable used to hold the functions that let us
- // switch between the wrap methods
- var wrapMethod
-
- // if a wrap method if being forced, assign that
- // function
- if (forceWrapMethod) {
- if (forceWrapMethod === 'foreignobjects') {
- wrapMethod = wrapWithForeignobjects
- } else if (forceWrapMethod === 'tspans') {
- wrapMethod = wrapWithTspans
- }
- }
-
- // if no wrap method is being forced, then instead
- // test for browser support of foreignobject and
- // use whichever wrap method makes sense accordingly
- if (!forceWrapMethod) {
- if (typeof SVGForeignObjectElement !== 'undefined') {
- wrapMethod = wrapWithForeignobjects
- } else {
- wrapMethod = wrapWithTspans
- }
- }
-
- // run the desired wrap function for each item
- // in the d3 selection that called .textwrap()
- for (var i = 0; i < selection.length; i++) {
- var item = selection[i]
- wrapMethod(item)
- }
-
- // return the modified nodes so we can chain other
- // methods to them.
- return returnValue
- }
- }
-})()
-
-},{"d3":8}],380:[function(require,module,exports){
-
-var Logger = require('../../logger')
-var log = Logger.Log
-var relations = []
-
-var classes
-classes = {
-}
-
-/**
- * Function called by parser when a node definition has been found.
- * @param id
- * @param text
- * @param type
- * @param style
- */
-exports.addClass = function (id) {
- if (typeof classes[id] === 'undefined') {
- classes[id] = {
- id: id,
- methods: [],
- members: []
- }
- }
-}
-
-exports.clear = function () {
- relations = []
- classes = {}
-}
-
-module.exports.getClass = function (id) {
- return classes[id]
-}
-module.exports.getClasses = function () {
- return classes
-}
-
-module.exports.getRelations = function () {
- return relations
-}
-
-exports.addRelation = function (relation) {
- log.warn('Adding relation: ' + JSON.stringify(relation))
- exports.addClass(relation.id1)
- exports.addClass(relation.id2)
-
- relations.push(relation)
-}
-
-exports.addMembers = function (className, MembersArr) {
- var theClass = classes[className]
- if (typeof MembersArr === 'string') {
- if (MembersArr.substr(-1) === ')') {
- theClass.methods.push(MembersArr)
- } else {
- theClass.members.push(MembersArr)
- }
- }
-}
-
-exports.cleanupLabel = function (label) {
- if (label.substring(0, 1) === ':') {
- return label.substr(2).trim()
- } else {
- return label.trim()
- }
-}
-
-exports.lineType = {
- LINE: 0,
- DOTTED_LINE: 1
-}
-
-exports.relationType = {
- AGGREGATION: 0,
- EXTENSION: 1,
- COMPOSITION: 2,
- DEPENDENCY: 3
-}
-
-},{"../../logger":400}],381:[function(require,module,exports){
-/**
- * Created by knut on 14-11-23.
- */
-
-var cd = require('./parser/classDiagram').parser
-var cDDb = require('./classDb')
-cd.yy = cDDb
-var d3 = require('../../d3')
-var Logger = require('../../logger')
-var log = Logger.Log
-var dagre = require('dagre')
-
-var idCache
-idCache = {}
-
-var classCnt = 0
-var conf = {
- dividerMargin: 10,
- padding: 5,
- textHeight: 10
-}
-
-// Todo optimize
-var getGraphId = function (label) {
- var keys = Object.keys(idCache)
-
- var i
- for (i = 0; i < keys.length; i++) {
- if (idCache[keys[i]].label === label) {
- return keys[i]
- }
- }
-
- return undefined
-}
-
-/**
- * Setup arrow head and define the marker. The result is appended to the svg.
- */
-var insertMarkers = function (elem) {
- elem.append('defs').append('marker')
- .attr('id', 'extensionStart')
- .attr('class', 'extension')
- .attr('refX', 0)
- .attr('refY', 7)
- .attr('markerWidth', 190)
- .attr('markerHeight', 240)
- .attr('orient', 'auto')
- .append('path')
- .attr('d', 'M 1,7 L18,13 V 1 Z')
-
- elem.append('defs').append('marker')
- .attr('id', 'extensionEnd')
- .attr('refX', 19)
- .attr('refY', 7)
- .attr('markerWidth', 20)
- .attr('markerHeight', 28)
- .attr('orient', 'auto')
- .append('path')
- .attr('d', 'M 1,1 V 13 L18,7 Z') // this is actual shape for arrowhead
-
- elem.append('defs').append('marker')
- .attr('id', 'compositionStart')
- .attr('class', 'extension')
- .attr('refX', 0)
- .attr('refY', 7)
- .attr('markerWidth', 190)
- .attr('markerHeight', 240)
- .attr('orient', 'auto')
- .append('path')
- .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z')
-
- elem.append('defs').append('marker')
- .attr('id', 'compositionEnd')
- .attr('refX', 19)
- .attr('refY', 7)
- .attr('markerWidth', 20)
- .attr('markerHeight', 28)
- .attr('orient', 'auto')
- .append('path')
- .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z')
-
- elem.append('defs').append('marker')
- .attr('id', 'aggregationStart')
- .attr('class', 'extension')
- .attr('refX', 0)
- .attr('refY', 7)
- .attr('markerWidth', 190)
- .attr('markerHeight', 240)
- .attr('orient', 'auto')
- .append('path')
- .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z')
-
- elem.append('defs').append('marker')
- .attr('id', 'aggregationEnd')
- .attr('refX', 19)
- .attr('refY', 7)
- .attr('markerWidth', 20)
- .attr('markerHeight', 28)
- .attr('orient', 'auto')
- .append('path')
- .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z')
-
- elem.append('defs').append('marker')
- .attr('id', 'dependencyStart')
- .attr('class', 'extension')
- .attr('refX', 0)
- .attr('refY', 7)
- .attr('markerWidth', 190)
- .attr('markerHeight', 240)
- .attr('orient', 'auto')
- .append('path')
- .attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z')
-
- elem.append('defs').append('marker')
- .attr('id', 'dependencyEnd')
- .attr('refX', 19)
- .attr('refY', 7)
- .attr('markerWidth', 20)
- .attr('markerHeight', 28)
- .attr('orient', 'auto')
- .append('path')
- .attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z')
-}
-
-var edgeCount = 0
-var drawEdge = function (elem, path, relation) {
- var getRelationType = function (type) {
- switch (type) {
- case cDDb.relationType.AGGREGATION:
- return 'aggregation'
- case cDDb.relationType.EXTENSION:
- return 'extension'
- case cDDb.relationType.COMPOSITION:
- return 'composition'
- case cDDb.relationType.DEPENDENCY:
- return 'dependency'
- }
- }
-
- // The data for our line
- var lineData = path.points
-
- // This is the accessor function we talked about above
- var lineFunction = d3.svg.line()
- .x(function (d) {
- return d.x
- })
- .y(function (d) {
- return d.y
- })
- .interpolate('basis')
-
- var svgPath = elem.append('path')
- .attr('d', lineFunction(lineData))
- .attr('id', 'edge' + edgeCount)
- .attr('class', 'relation')
- var url = ''
- if (conf.arrowMarkerAbsolute) {
- url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search
- url = url.replace(/\(/g, '\\(')
- url = url.replace(/\)/g, '\\)')
- }
-
- if (relation.relation.type1 !== 'none') {
- svgPath.attr('marker-start', 'url(' + url + '#' + getRelationType(relation.relation.type1) + 'Start' + ')')
- }
- if (relation.relation.type2 !== 'none') {
- svgPath.attr('marker-end', 'url(' + url + '#' + getRelationType(relation.relation.type2) + 'End' + ')')
- }
-
- var x, y
- var l = path.points.length
- if ((l % 2) !== 0) {
- var p1 = path.points[Math.floor(l / 2)]
- var p2 = path.points[Math.ceil(l / 2)]
- x = (p1.x + p2.x) / 2
- y = (p1.y + p2.y) / 2
- } else {
- var p = path.points[Math.floor(l / 2)]
- x = p.x
- y = p.y
- }
-
- if (typeof relation.title !== 'undefined') {
- var g = elem.append('g')
- .attr('class', 'classLabel')
- var label = g.append('text')
- .attr('class', 'label')
- .attr('x', x)
- .attr('y', y)
- .attr('fill', 'red')
- .attr('text-anchor', 'middle')
- .text(relation.title)
-
- window.label = label
- var bounds = label.node().getBBox()
-
- g.insert('rect', ':first-child')
- .attr('class', 'box')
- .attr('x', bounds.x - conf.padding / 2)
- .attr('y', bounds.y - conf.padding / 2)
- .attr('width', bounds.width + conf.padding)
- .attr('height', bounds.height + conf.padding)
- }
-
- edgeCount++
-}
-
-var drawClass = function (elem, classDef) {
- log.info('Rendering class ' + classDef)
-
- var addTspan = function (textEl, txt, isFirst) {
- var tSpan = textEl.append('tspan')
- .attr('x', conf.padding)
- .text(txt)
- if (!isFirst) {
- tSpan.attr('dy', conf.textHeight)
- }
- }
-
- var id = 'classId' + classCnt
- var classInfo = {
- id: id,
- label: classDef.id,
- width: 0,
- height: 0
- }
-
- var g = elem.append('g')
- .attr('id', id)
- .attr('class', 'classGroup')
- var title = g.append('text')
- .attr('x', conf.padding)
- .attr('y', conf.textHeight + conf.padding)
- .text(classDef.id)
-
- var titleHeight = title.node().getBBox().height
-
- var membersLine = g.append('line') // text label for the x axis
- .attr('x1', 0)
- .attr('y1', conf.padding + titleHeight + conf.dividerMargin / 2)
- .attr('y2', conf.padding + titleHeight + conf.dividerMargin / 2)
-
- var members = g.append('text') // text label for the x axis
- .attr('x', conf.padding)
- .attr('y', titleHeight + (conf.dividerMargin) + conf.textHeight)
- .attr('fill', 'white')
- .attr('class', 'classText')
-
- var isFirst = true
-
- classDef.members.forEach(function (member) {
- addTspan(members, member, isFirst)
- isFirst = false
- })
-
- var membersBox = members.node().getBBox()
-
- var methodsLine = g.append('line') // text label for the x axis
- .attr('x1', 0)
- .attr('y1', conf.padding + titleHeight + conf.dividerMargin + membersBox.height)
- .attr('y2', conf.padding + titleHeight + conf.dividerMargin + membersBox.height)
-
- var methods = g.append('text') // text label for the x axis
- .attr('x', conf.padding)
- .attr('y', titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight)
- .attr('fill', 'white')
- .attr('class', 'classText')
-
- isFirst = true
-
- classDef.methods.forEach(function (method) {
- addTspan(methods, method, isFirst)
- isFirst = false
- })
-
- var classBox = g.node().getBBox()
- g.insert('rect', ':first-child')
- .attr('x', 0)
- .attr('y', 0)
- .attr('width', classBox.width + 2 * conf.padding)
- .attr('height', classBox.height + conf.padding + 0.5 * conf.dividerMargin)
-
- membersLine.attr('x2', classBox.width + 2 * conf.padding)
- methodsLine.attr('x2', classBox.width + 2 * conf.padding)
-
- classInfo.width = classBox.width + 2 * conf.padding
- classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin
-
- idCache[id] = classInfo
- classCnt++
- return classInfo
-}
-
-module.exports.setConf = function (cnf) {
- var keys = Object.keys(cnf)
-
- keys.forEach(function (key) {
- conf[key] = cnf[key]
- })
-}
-/**
- * Draws a flowchart in the tag with id: id based on the graph definition in text.
- * @param text
- * @param id
- */
-module.exports.draw = function (text, id) {
- cd.yy.clear()
- cd.parse(text)
-
- log.info('Rendering diagram ' + text)
-
- /// / Fetch the default direction, use TD if none was found
- var diagram = d3.select('#' + id)
- insertMarkers(diagram)
-
- // Layout graph, Create a new directed graph
- var g = new dagre.graphlib.Graph({
- multigraph: true
- })
-
- // Set an object for the graph label
- g.setGraph({
- isMultiGraph: true
- })
-
- // Default to assigning a new object as a label for each new edge.
- g.setDefaultEdgeLabel(function () {
- return {}
- })
-
- var classes = cDDb.getClasses()
- var keys = Object.keys(classes)
- var i
- for (i = 0; i < keys.length; i++) {
- var classDef = classes[keys[i]]
- var node = drawClass(diagram, classDef)
- // Add nodes to the graph. The first argument is the node id. The second is
- // metadata about the node. In this case we're going to add labels to each of
- // our nodes.
- g.setNode(node.id, node)
- log.info('Org height: ' + node.height)
- }
-
- var relations = cDDb.getRelations()
- relations.forEach(function (relation) {
- log.info('tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation))
- g.setEdge(getGraphId(relation.id1), getGraphId(relation.id2), { relation: relation })
- })
- dagre.layout(g)
- g.nodes().forEach(function (v) {
- if (typeof v !== 'undefined') {
- log.debug('Node ' + v + ': ' + JSON.stringify(g.node(v)))
- d3.select('#' + v).attr('transform', 'translate(' + (g.node(v).x - (g.node(v).width / 2)) + ',' + (g.node(v).y - (g.node(v).height / 2)) + ' )')
- }
- })
- g.edges().forEach(function (e) {
- log.debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e)))
- drawEdge(diagram, g.edge(e), g.edge(e).relation)
- })
-
- diagram.attr('height', '100%')
- diagram.attr('width', '100%')
- diagram.attr('viewBox', '0 0 ' + (g.graph().width + 20) + ' ' + (g.graph().height + 20))
-}
-
-},{"../../d3":379,"../../logger":400,"./classDb":380,"./parser/classDiagram":382,"dagre":57}],382:[function(require,module,exports){
-(function (process){
-/* parser generated by jison 0.4.17 */
-/*
- Returns a Parser object of the following structure:
-
- Parser: {
- yy: {}
- }
-
- Parser.prototype: {
- yy: {},
- trace: function(),
- symbols_: {associative list: name ==> number},
- terminals_: {associative list: number ==> name},
- productions_: [...],
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
- table: [...],
- defaultActions: {...},
- parseError: function(str, hash),
- parse: function(input),
-
- lexer: {
- EOF: 1,
- parseError: function(str, hash),
- setInput: function(input),
- input: function(),
- unput: function(str),
- more: function(),
- less: function(n),
- pastInput: function(),
- upcomingInput: function(),
- showPosition: function(),
- test_match: function(regex_match_array, rule_index),
- next: function(),
- lex: function(),
- begin: function(condition),
- popState: function(),
- _currentRules: function(),
- topState: function(),
- pushState: function(condition),
-
- options: {
- ranges: boolean (optional: true ==> token location info will include a .range[] member)
- flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
- backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
- },
-
- performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
- rules: [...],
- conditions: {associative list: name ==> set},
- }
- }
-
- token location info (@$, _$, etc.): {
- first_line: n,
- last_line: n,
- first_column: n,
- last_column: n,
- range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
- }
-
- the parseError function receives a 'hash' object with these members for lexer and parser errors: {
- text: (matched text)
- token: (the produced terminal token, if any)
- line: (yylineno)
- }
- while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
- loc: (yylloc)
- expected: (string describing the set of expected tokens)
- recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
- }
-*/
-var parser = (function () {
- var o = function (k, v, o, l) { for (o = o || {}, l = k.length; l--; o[k[l]] = v);return o }, $V0 = [1, 11], $V1 = [1, 12], $V2 = [1, 13], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 17], $V6 = [6, 8], $V7 = [1, 26], $V8 = [1, 27], $V9 = [1, 28], $Va = [1, 29], $Vb = [1, 30], $Vc = [1, 31], $Vd = [6, 8, 13, 17, 23, 26, 27, 28, 29, 30, 31], $Ve = [6, 8, 13, 17, 23, 26, 27, 28, 29, 30, 31, 45, 46, 47], $Vf = [23, 45, 46, 47], $Vg = [23, 30, 31, 45, 46, 47], $Vh = [23, 26, 27, 28, 29, 45, 46, 47], $Vi = [6, 8, 13], $Vj = [1, 46]
- var parser = {trace: function trace () { },
- yy: {},
- symbols_: {'error': 2, 'mermaidDoc': 3, 'graphConfig': 4, 'CLASS_DIAGRAM': 5, 'NEWLINE': 6, 'statements': 7, 'EOF': 8, 'statement': 9, 'className': 10, 'alphaNumToken': 11, 'relationStatement': 12, 'LABEL': 13, 'classStatement': 14, 'methodStatement': 15, 'CLASS': 16, 'STRUCT_START': 17, 'members': 18, 'STRUCT_STOP': 19, 'MEMBER': 20, 'SEPARATOR': 21, 'relation': 22, 'STR': 23, 'relationType': 24, 'lineType': 25, 'AGGREGATION': 26, 'EXTENSION': 27, 'COMPOSITION': 28, 'DEPENDENCY': 29, 'LINE': 30, 'DOTTED_LINE': 31, 'commentToken': 32, 'textToken': 33, 'graphCodeTokens': 34, 'textNoTagsToken': 35, 'TAGSTART': 36, 'TAGEND': 37, '==': 38, '--': 39, 'PCT': 40, 'DEFAULT': 41, 'SPACE': 42, 'MINUS': 43, 'keywords': 44, 'UNICODE_TEXT': 45, 'NUM': 46, 'ALPHA': 47, '$accept': 0, '$end': 1},
- terminals_: {2: 'error', 5: 'CLASS_DIAGRAM', 6: 'NEWLINE', 8: 'EOF', 13: 'LABEL', 16: 'CLASS', 17: 'STRUCT_START', 19: 'STRUCT_STOP', 20: 'MEMBER', 21: 'SEPARATOR', 23: 'STR', 26: 'AGGREGATION', 27: 'EXTENSION', 28: 'COMPOSITION', 29: 'DEPENDENCY', 30: 'LINE', 31: 'DOTTED_LINE', 34: 'graphCodeTokens', 36: 'TAGSTART', 37: 'TAGEND', 38: '==', 39: '--', 40: 'PCT', 41: 'DEFAULT', 42: 'SPACE', 43: 'MINUS', 44: 'keywords', 45: 'UNICODE_TEXT', 46: 'NUM', 47: 'ALPHA'},
- productions_: [0, [3, 1], [4, 4], [7, 1], [7, 3], [10, 2], [10, 1], [9, 1], [9, 2], [9, 1], [9, 1], [14, 2], [14, 5], [18, 1], [18, 2], [15, 1], [15, 2], [15, 1], [15, 1], [12, 3], [12, 4], [12, 4], [12, 5], [22, 3], [22, 2], [22, 2], [22, 1], [24, 1], [24, 1], [24, 1], [24, 1], [25, 1], [25, 1], [32, 1], [32, 1], [33, 1], [33, 1], [33, 1], [33, 1], [33, 1], [33, 1], [33, 1], [35, 1], [35, 1], [35, 1], [35, 1], [11, 1], [11, 1], [11, 1]],
- performAction: function anonymous (yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
-/* this == yyval */
-
- var $0 = $$.length - 1
- switch (yystate) {
- case 5:
- this.$ = $$[$0 - 1] + $$[$0]
- break
- case 6:
- this.$ = $$[$0]
- break
- case 7:
- yy.addRelation($$[$0])
- break
- case 8:
- $$[$0 - 1].title = yy.cleanupLabel($$[$0]); yy.addRelation($$[$0 - 1])
- break
- case 12:
- /* console.log($$[$0-3],JSON.stringify($$[$0-1])); */yy.addMembers($$[$0 - 3], $$[$0 - 1])
- break
- case 13:
- this.$ = [$$[$0]]
- break
- case 14:
- $$[$0].push($$[$0 - 1]); this.$ = $$[$0]
- break
- case 15:
-/* console.log('Rel found',$$[$0]); */
- break
- case 16:
- yy.addMembers($$[$0 - 1], yy.cleanupLabel($$[$0]))
- break
- case 17:
- console.warn('Member', $$[$0])
- break
- case 18:
-/* console.log('sep found',$$[$0]); */
- break
- case 19:
- this.$ = {'id1': $$[$0 - 2], 'id2': $$[$0], relation: $$[$0 - 1], relationTitle1: 'none', relationTitle2: 'none'}
- break
- case 20:
- this.$ = {id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 1], relationTitle1: $$[$0 - 2], relationTitle2: 'none'}
- break
- case 21:
- this.$ = {id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: 'none', relationTitle2: $$[$0 - 1]}
- break
- case 22:
- this.$ = {id1: $$[$0 - 4], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: $$[$0 - 3], relationTitle2: $$[$0 - 1]}
- break
- case 23:
- this.$ = {type1: $$[$0 - 2], type2: $$[$0], lineType: $$[$0 - 1]}
- break
- case 24:
- this.$ = {type1: 'none', type2: $$[$0], lineType: $$[$0 - 1]}
- break
- case 25:
- this.$ = {type1: $$[$0 - 1], type2: 'none', lineType: $$[$0]}
- break
- case 26:
- this.$ = {type1: 'none', type2: 'none', lineType: $$[$0]}
- break
- case 27:
- this.$ = yy.relationType.AGGREGATION
- break
- case 28:
- this.$ = yy.relationType.EXTENSION
- break
- case 29:
- this.$ = yy.relationType.COMPOSITION
- break
- case 30:
- this.$ = yy.relationType.DEPENDENCY
- break
- case 31:
- this.$ = yy.lineType.LINE
- break
- case 32:
- this.$ = yy.lineType.DOTTED_LINE
- break
- }
- },
- table: [{3: 1, 4: 2, 5: [1, 3]}, {1: [3]}, {1: [2, 1]}, {6: [1, 4]}, {7: 5, 9: 6, 10: 10, 11: 14, 12: 7, 14: 8, 15: 9, 16: $V0, 20: $V1, 21: $V2, 45: $V3, 46: $V4, 47: $V5}, {8: [1, 18]}, {6: [1, 19], 8: [2, 3]}, o($V6, [2, 7], {13: [1, 20]}), o($V6, [2, 9]), o($V6, [2, 10]), o($V6, [2, 15], {22: 21, 24: 24, 25: 25, 13: [1, 23], 23: [1, 22], 26: $V7, 27: $V8, 28: $V9, 29: $Va, 30: $Vb, 31: $Vc}), {10: 32, 11: 14, 45: $V3, 46: $V4, 47: $V5}, o($V6, [2, 17]), o($V6, [2, 18]), o($Vd, [2, 6], {11: 14, 10: 33, 45: $V3, 46: $V4, 47: $V5}), o($Ve, [2, 46]), o($Ve, [2, 47]), o($Ve, [2, 48]), {1: [2, 2]}, {7: 34, 9: 6, 10: 10, 11: 14, 12: 7, 14: 8, 15: 9, 16: $V0, 20: $V1, 21: $V2, 45: $V3, 46: $V4, 47: $V5}, o($V6, [2, 8]), {10: 35, 11: 14, 23: [1, 36], 45: $V3, 46: $V4, 47: $V5}, {22: 37, 24: 24, 25: 25, 26: $V7, 27: $V8, 28: $V9, 29: $Va, 30: $Vb, 31: $Vc}, o($V6, [2, 16]), {25: 38, 30: $Vb, 31: $Vc}, o($Vf, [2, 26], {24: 39, 26: $V7, 27: $V8, 28: $V9, 29: $Va}), o($Vg, [2, 27]), o($Vg, [2, 28]), o($Vg, [2, 29]), o($Vg, [2, 30]), o($Vh, [2, 31]), o($Vh, [2, 32]), o($V6, [2, 11], {17: [1, 40]}), o($Vd, [2, 5]), {8: [2, 4]}, o($Vi, [2, 19]), {10: 41, 11: 14, 45: $V3, 46: $V4, 47: $V5}, {10: 42, 11: 14, 23: [1, 43], 45: $V3, 46: $V4, 47: $V5}, o($Vf, [2, 25], {24: 44, 26: $V7, 27: $V8, 28: $V9, 29: $Va}), o($Vf, [2, 24]), {18: 45, 20: $Vj}, o($Vi, [2, 21]), o($Vi, [2, 20]), {10: 47, 11: 14, 45: $V3, 46: $V4, 47: $V5}, o($Vf, [2, 23]), {19: [1, 48]}, {18: 49, 19: [2, 13], 20: $Vj}, o($Vi, [2, 22]), o($V6, [2, 12]), {19: [2, 14]}],
- defaultActions: {2: [2, 1], 18: [2, 2], 34: [2, 4], 49: [2, 14]},
- parseError: function parseError (str, hash) {
- if (hash.recoverable) {
- this.trace(str)
- } else {
- function _parseError (msg, hash) {
- this.message = msg
- this.hash = hash
- }
- _parseError.prototype = Error
-
- throw new _parseError(str, hash)
- }
- },
- parse: function parse (input) {
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1
- var args = lstack.slice.call(arguments, 1)
- var lexer = Object.create(this.lexer)
- var sharedState = { yy: {} }
- for (var k in this.yy) {
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
- sharedState.yy[k] = this.yy[k]
- }
- }
- lexer.setInput(input, sharedState.yy)
- sharedState.yy.lexer = lexer
- sharedState.yy.parser = this
- if (typeof lexer.yylloc === 'undefined') {
- lexer.yylloc = {}
- }
- var yyloc = lexer.yylloc
- lstack.push(yyloc)
- var ranges = lexer.options && lexer.options.ranges
- if (typeof sharedState.yy.parseError === 'function') {
- this.parseError = sharedState.yy.parseError
- } else {
- this.parseError = Object.getPrototypeOf(this).parseError
- }
- function popStack (n) {
- stack.length = stack.length - 2 * n
- vstack.length = vstack.length - n
- lstack.length = lstack.length - n
- }
- var lex = function () {
- var token
- token = lexer.lex() || EOF
- if (typeof token !== 'number') {
- token = self.symbols_[token] || token
- }
- return token
- }
- var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected
- while (true) {
- state = stack[stack.length - 1]
- if (this.defaultActions[state]) {
- action = this.defaultActions[state]
- } else {
- if (symbol === null || typeof symbol === 'undefined') {
- symbol = lex()
- }
- action = table[state] && table[state][symbol]
- }
- if (typeof action === 'undefined' || !action.length || !action[0]) {
- var errStr = ''
- expected = []
- for (p in table[state]) {
- if (this.terminals_[p] && p > TERROR) {
- expected.push('\'' + this.terminals_[p] + '\'')
- }
- }
- if (lexer.showPosition) {
- errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''
- } else {
- errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'')
- }
- this.parseError(errStr, {
- text: lexer.match,
- token: this.terminals_[symbol] || symbol,
- line: lexer.yylineno,
- loc: yyloc,
- expected: expected
- })
- }
- if (action[0] instanceof Array && action.length > 1) {
- throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol)
- }
- switch (action[0]) {
- case 1:
- stack.push(symbol)
- vstack.push(lexer.yytext)
- lstack.push(lexer.yylloc)
- stack.push(action[1])
- symbol = null
- if (!preErrorSymbol) {
- yyleng = lexer.yyleng
- yytext = lexer.yytext
- yylineno = lexer.yylineno
- yyloc = lexer.yylloc
- if (recovering > 0) {
- recovering--
- }
- } else {
- symbol = preErrorSymbol
- preErrorSymbol = null
- }
- break
- case 2:
- len = this.productions_[action[1]][1]
- yyval.$ = vstack[vstack.length - len]
- yyval._$ = {
- first_line: lstack[lstack.length - (len || 1)].first_line,
- last_line: lstack[lstack.length - 1].last_line,
- first_column: lstack[lstack.length - (len || 1)].first_column,
- last_column: lstack[lstack.length - 1].last_column
- }
- if (ranges) {
- yyval._$.range = [
- lstack[lstack.length - (len || 1)].range[0],
- lstack[lstack.length - 1].range[1]
- ]
- }
- r = this.performAction.apply(yyval, [
- yytext,
- yyleng,
- yylineno,
- sharedState.yy,
- action[1],
- vstack,
- lstack
- ].concat(args))
- if (typeof r !== 'undefined') {
- return r
- }
- if (len) {
- stack = stack.slice(0, -1 * len * 2)
- vstack = vstack.slice(0, -1 * len)
- lstack = lstack.slice(0, -1 * len)
- }
- stack.push(this.productions_[action[1]][0])
- vstack.push(yyval.$)
- lstack.push(yyval._$)
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]]
- stack.push(newState)
- break
- case 3:
- return true
- }
- }
- return true
- }}
-
-/* generated by jison-lex 0.3.4 */
- var lexer = (function () {
- var lexer = ({
-
- EOF: 1,
-
- parseError: function parseError (str, hash) {
- if (this.yy.parser) {
- this.yy.parser.parseError(str, hash)
- } else {
- throw new Error(str)
- }
- },
-
-// resets the lexer, sets new input
- setInput: function (input, yy) {
- this.yy = yy || this.yy || {}
- this._input = input
- this._more = this._backtrack = this.done = false
- this.yylineno = this.yyleng = 0
- this.yytext = this.matched = this.match = ''
- this.conditionStack = ['INITIAL']
- this.yylloc = {
- first_line: 1,
- first_column: 0,
- last_line: 1,
- last_column: 0
- }
- if (this.options.ranges) {
- this.yylloc.range = [0, 0]
- }
- this.offset = 0
- return this
- },
-
-// consumes and returns one char from the input
- input: function () {
- var ch = this._input[0]
- this.yytext += ch
- this.yyleng++
- this.offset++
- this.match += ch
- this.matched += ch
- var lines = ch.match(/(?:\r\n?|\n).*/g)
- if (lines) {
- this.yylineno++
- this.yylloc.last_line++
- } else {
- this.yylloc.last_column++
- }
- if (this.options.ranges) {
- this.yylloc.range[1]++
- }
-
- this._input = this._input.slice(1)
- return ch
- },
-
-// unshifts one char (or a string) into the input
- unput: function (ch) {
- var len = ch.length
- var lines = ch.split(/(?:\r\n?|\n)/g)
-
- this._input = ch + this._input
- this.yytext = this.yytext.substr(0, this.yytext.length - len)
- // this.yyleng -= len;
- this.offset -= len
- var oldLines = this.match.split(/(?:\r\n?|\n)/g)
- this.match = this.match.substr(0, this.match.length - 1)
- this.matched = this.matched.substr(0, this.matched.length - 1)
-
- if (lines.length - 1) {
- this.yylineno -= lines.length - 1
- }
- var r = this.yylloc.range
-
- this.yylloc = {
- first_line: this.yylloc.first_line,
- last_line: this.yylineno + 1,
- first_column: this.yylloc.first_column,
- last_column: lines
- ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) +
- oldLines[oldLines.length - lines.length].length - lines[0].length
- : this.yylloc.first_column - len
- }
-
- if (this.options.ranges) {
- this.yylloc.range = [r[0], r[0] + this.yyleng - len]
- }
- this.yyleng = this.yytext.length
- return this
- },
-
-// When called from action, caches matched text and appends it on next action
- more: function () {
- this._more = true
- return this
- },
-
-// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
- reject: function () {
- if (this.options.backtrack_lexer) {
- this._backtrack = true
- } else {
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
- text: '',
- token: null,
- line: this.yylineno
- })
- }
- return this
- },
-
-// retain first n characters of the match
- less: function (n) {
- this.unput(this.match.slice(n))
- },
-
-// displays already matched input, i.e. for error messages
- pastInput: function () {
- var past = this.matched.substr(0, this.matched.length - this.match.length)
- return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '')
- },
-
-// displays upcoming input, i.e. for error messages
- upcomingInput: function () {
- var next = this.match
- if (next.length < 20) {
- next += this._input.substr(0, 20 - next.length)
- }
- return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '')
- },
-
-// displays the character position where the lexing error occurred, i.e. for error messages
- showPosition: function () {
- var pre = this.pastInput()
- var c = new Array(pre.length + 1).join('-')
- return pre + this.upcomingInput() + '\n' + c + '^'
- },
-
-// test the lexed token: return FALSE when not a match, otherwise return token
- test_match: function (match, indexed_rule) {
- var token,
- lines,
- backup
-
- if (this.options.backtrack_lexer) {
- // save context
- backup = {
- yylineno: this.yylineno,
- yylloc: {
- first_line: this.yylloc.first_line,
- last_line: this.last_line,
- first_column: this.yylloc.first_column,
- last_column: this.yylloc.last_column
- },
- yytext: this.yytext,
- match: this.match,
- matches: this.matches,
- matched: this.matched,
- yyleng: this.yyleng,
- offset: this.offset,
- _more: this._more,
- _input: this._input,
- yy: this.yy,
- conditionStack: this.conditionStack.slice(0),
- done: this.done
- }
- if (this.options.ranges) {
- backup.yylloc.range = this.yylloc.range.slice(0)
- }
- }
-
- lines = match[0].match(/(?:\r\n?|\n).*/g)
- if (lines) {
- this.yylineno += lines.length
- }
- this.yylloc = {
- first_line: this.yylloc.last_line,
- last_line: this.yylineno + 1,
- first_column: this.yylloc.last_column,
- last_column: lines
- ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length
- : this.yylloc.last_column + match[0].length
- }
- this.yytext += match[0]
- this.match += match[0]
- this.matches = match
- this.yyleng = this.yytext.length
- if (this.options.ranges) {
- this.yylloc.range = [this.offset, this.offset += this.yyleng]
- }
- this._more = false
- this._backtrack = false
- this._input = this._input.slice(match[0].length)
- this.matched += match[0]
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1])
- if (this.done && this._input) {
- this.done = false
- }
- if (token) {
- return token
- } else if (this._backtrack) {
- // recover context
- for (var k in backup) {
- this[k] = backup[k]
- }
- return false // rule action called reject() implying the next rule should be tested instead.
- }
- return false
- },
-
-// return next match in input
- next: function () {
- if (this.done) {
- return this.EOF
- }
- if (!this._input) {
- this.done = true
- }
-
- var token,
- match,
- tempMatch,
- index
- if (!this._more) {
- this.yytext = ''
- this.match = ''
- }
- var rules = this._currentRules()
- for (var i = 0; i < rules.length; i++) {
- tempMatch = this._input.match(this.rules[rules[i]])
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
- match = tempMatch
- index = i
- if (this.options.backtrack_lexer) {
- token = this.test_match(tempMatch, rules[i])
- if (token !== false) {
- return token
- } else if (this._backtrack) {
- match = false
- continue // rule action called reject() implying a rule MISmatch.
- } else {
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
- return false
- }
- } else if (!this.options.flex) {
- break
- }
- }
- }
- if (match) {
- token = this.test_match(match, rules[index])
- if (token !== false) {
- return token
- }
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
- return false
- }
- if (this._input === '') {
- return this.EOF
- } else {
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
- text: '',
- token: null,
- line: this.yylineno
- })
- }
- },
-
-// return next match that has a token
- lex: function lex () {
- var r = this.next()
- if (r) {
- return r
- } else {
- return this.lex()
- }
- },
-
-// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
- begin: function begin (condition) {
- this.conditionStack.push(condition)
- },
-
-// pop the previously active lexer condition state off the condition stack
- popState: function popState () {
- var n = this.conditionStack.length - 1
- if (n > 0) {
- return this.conditionStack.pop()
- } else {
- return this.conditionStack[0]
- }
- },
-
-// produce the lexer rule set which is active for the currently active lexer condition state
- _currentRules: function _currentRules () {
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules
- } else {
- return this.conditions['INITIAL'].rules
- }
- },
-
-// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
- topState: function topState (n) {
- n = this.conditionStack.length - 1 - Math.abs(n || 0)
- if (n >= 0) {
- return this.conditionStack[n]
- } else {
- return 'INITIAL'
- }
- },
-
-// alias for begin(condition)
- pushState: function pushState (condition) {
- this.begin(condition)
- },
-
-// return the number of states currently on the stack
- stateStackSize: function stateStackSize () {
- return this.conditionStack.length
- },
- options: {},
- performAction: function anonymous (yy, yy_, $avoiding_name_collisions, YY_START) {
- var YYSTATE = YY_START
- switch ($avoiding_name_collisions) {
- case 0:/* do nothing */
- break
- case 1:return 6
- break
- case 2:/* skip whitespace */
- break
- case 3:return 5
- break
- case 4: this.begin('struct'); /* console.log('Starting struct'); */return 17
- break
- case 5: /* console.log('Ending struct'); */this.popState(); return 19
- break
- case 6:/* nothing */
- break
- case 7: return 'MEMBER'
- break
- case 8:return 16
- break
- case 9:this.begin('string')
- break
- case 10:this.popState()
- break
- case 11:return 'STR'
- break
- case 12:return 27
- break
- case 13:return 27
- break
- case 14:return 29
- break
- case 15:return 29
- break
- case 16:return 28
- break
- case 17:return 26
- break
- case 18:return 30
- break
- case 19:return 31
- break
- case 20:return 13
- break
- case 21:return 43
- break
- case 22:return 'DOT'
- break
- case 23:return 'PLUS'
- break
- case 24:return 40
- break
- case 25:return 'EQUALS'
- break
- case 26:return 'EQUALS'
- break
- case 27:return 47
- break
- case 28:return 'PUNCTUATION'
- break
- case 29:return 46
- break
- case 30:return 45
- break
- case 31:return 42
- break
- case 32:return 8
- break
- }
- },
- rules: [/^(?:%%[^\n]*)/, /^(?:\n+)/, /^(?:\s+)/, /^(?:classDiagram\b)/, /^(?:[\{])/, /^(?:\})/, /^(?:[\n])/, /^(?:[^\{\}\n]*)/, /^(?:class\b)/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:\s*<\|)/, /^(?:\s*\|>)/, /^(?:\s*>)/, /^(?:\s*<)/, /^(?:\s*\*)/, /^(?:\s*o\b)/, /^(?:--)/, /^(?:\.\.)/, /^(?::[^#\n;]+)/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:[A-Za-z]+)/, /^(?:[!"#$%&'*+,-.`?\\_\/])/, /^(?:[0-9]+)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\s)/, /^(?:$)/],
- conditions: {'string': {'rules': [10, 11], 'inclusive': false}, 'struct': {'rules': [5, 6, 7], 'inclusive': false}, 'INITIAL': {'rules': [0, 1, 2, 3, 4, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], 'inclusive': true}}
- })
- return lexer
- })()
- parser.lexer = lexer
- function Parser () {
- this.yy = {}
- }
- Parser.prototype = parser; parser.Parser = Parser
- return new Parser()
-})()
-
-if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
- exports.parser = parser
- exports.Parser = parser.Parser
- exports.parse = function () { return parser.parse.apply(parser, arguments) }
- exports.main = function commonjsMain (args) {
- if (!args[1]) {
- console.log('Usage: ' + args[0] + ' FILE')
- process.exit(1)
- }
- var source = require('fs').readFileSync(require('path').normalize(args[1]), 'utf8')
- return exports.parser.parse(source)
- }
- if (typeof module !== 'undefined' && require.main === module) {
- exports.main(process.argv.slice(1))
- }
-}
-
-}).call(this,require('_process'))
-},{"_process":406,"fs":7,"path":405}],383:[function(require,module,exports){
-(function (global){
-/**
- * Created by knut on 15-01-14.
- */
-var Logger = require('../../logger')
-var log = Logger.Log
-
-var message = ''
-var info = false
-
-exports.setMessage = function (txt) {
- log.debug('Setting message to: ' + txt)
- message = txt
-}
-
-exports.getMessage = function () {
- return message
-}
-
-exports.setInfo = function (inf) {
- info = inf
-}
-
-exports.getInfo = function () {
- return info
-}
-
-exports.parseError = function (err, hash) {
- global.mermaidAPI.parseError(err, hash)
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"../../logger":400}],384:[function(require,module,exports){
-/**
- * Created by knut on 14-12-11.
- */
-var db = require('./exampleDb')
-var exampleParser = require('./parser/example.js')
-var d3 = require('../../d3')
-
-var Logger = require('../../logger')
-var log = Logger.Log
-
-/**
- * Draws a an info picture in the tag with id: id based on the graph definition in text.
- * @param text
- * @param id
- */
-exports.draw = function (txt, id, ver) {
- var parser
- parser = exampleParser.parser
- parser.yy = db
- log.debug('Renering example diagram')
- // Parse the graph definition
- parser.parse(txt)
-
- // Fetch the default direction, use TD if none was found
- var svg = d3.select('#' + id)
-
- var g = svg.append('g')
-
- g.append('text') // text label for the x axis
- .attr('x', 100)
- .attr('y', 40)
- .attr('class', 'version')
- .attr('font-size', '32px')
- .style('text-anchor', 'middle')
- .text('mermaid ' + ver)
-
- svg.attr('height', 100)
- svg.attr('width', 400)
-}
-
-},{"../../d3":379,"../../logger":400,"./exampleDb":383,"./parser/example.js":385}],385:[function(require,module,exports){
-(function (process){
-/* parser generated by jison 0.4.17 */
-/*
- Returns a Parser object of the following structure:
-
- Parser: {
- yy: {}
- }
-
- Parser.prototype: {
- yy: {},
- trace: function(),
- symbols_: {associative list: name ==> number},
- terminals_: {associative list: number ==> name},
- productions_: [...],
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
- table: [...],
- defaultActions: {...},
- parseError: function(str, hash),
- parse: function(input),
-
- lexer: {
- EOF: 1,
- parseError: function(str, hash),
- setInput: function(input),
- input: function(),
- unput: function(str),
- more: function(),
- less: function(n),
- pastInput: function(),
- upcomingInput: function(),
- showPosition: function(),
- test_match: function(regex_match_array, rule_index),
- next: function(),
- lex: function(),
- begin: function(condition),
- popState: function(),
- _currentRules: function(),
- topState: function(),
- pushState: function(condition),
-
- options: {
- ranges: boolean (optional: true ==> token location info will include a .range[] member)
- flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
- backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
- },
-
- performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
- rules: [...],
- conditions: {associative list: name ==> set},
- }
- }
-
- token location info (@$, _$, etc.): {
- first_line: n,
- last_line: n,
- first_column: n,
- last_column: n,
- range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
- }
-
- the parseError function receives a 'hash' object with these members for lexer and parser errors: {
- text: (matched text)
- token: (the produced terminal token, if any)
- line: (yylineno)
- }
- while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
- loc: (yylloc)
- expected: (string describing the set of expected tokens)
- recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
- }
-*/
-var parser = (function () {
- var o = function (k, v, o, l) { for (o = o || {}, l = k.length; l--; o[k[l]] = v);return o }, $V0 = [6, 9, 10, 12]
- var parser = {trace: function trace () { },
- yy: {},
- symbols_: {'error': 2, 'start': 3, 'info': 4, 'document': 5, 'EOF': 6, 'line': 7, 'statement': 8, 'NL': 9, 'showInfo': 10, 'message': 11, 'say': 12, 'TXT': 13, '$accept': 0, '$end': 1},
- terminals_: {2: 'error', 4: 'info', 6: 'EOF', 9: 'NL', 10: 'showInfo', 12: 'say', 13: 'TXT'},
- productions_: [0, [3, 3], [5, 0], [5, 2], [7, 1], [7, 1], [8, 1], [8, 1], [11, 2]],
- performAction: function anonymous (yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
-/* this == yyval */
-
- var $0 = $$.length - 1
- switch (yystate) {
- case 1:
- return yy
- break
- case 4:
-
- break
- case 6:
- yy.setInfo(true)
- break
- case 7:
- yy.setMessage($$[$0])
- break
- case 8:
- this.$ = $$[$0 - 1].substring(1).trim().replace(/\\n/gm, '\n')
- break
- }
- },
- table: [{3: 1, 4: [1, 2]}, {1: [3]}, o($V0, [2, 2], {5: 3}), {6: [1, 4], 7: 5, 8: 6, 9: [1, 7], 10: [1, 8], 11: 9, 12: [1, 10]}, {1: [2, 1]}, o($V0, [2, 3]), o($V0, [2, 4]), o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 7]), {13: [1, 11]}, o($V0, [2, 8])],
- defaultActions: {4: [2, 1]},
- parseError: function parseError (str, hash) {
- if (hash.recoverable) {
- this.trace(str)
- } else {
- function _parseError (msg, hash) {
- this.message = msg
- this.hash = hash
- }
- _parseError.prototype = Error
-
- throw new _parseError(str, hash)
- }
- },
- parse: function parse (input) {
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1
- var args = lstack.slice.call(arguments, 1)
- var lexer = Object.create(this.lexer)
- var sharedState = { yy: {} }
- for (var k in this.yy) {
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
- sharedState.yy[k] = this.yy[k]
- }
- }
- lexer.setInput(input, sharedState.yy)
- sharedState.yy.lexer = lexer
- sharedState.yy.parser = this
- if (typeof lexer.yylloc === 'undefined') {
- lexer.yylloc = {}
- }
- var yyloc = lexer.yylloc
- lstack.push(yyloc)
- var ranges = lexer.options && lexer.options.ranges
- if (typeof sharedState.yy.parseError === 'function') {
- this.parseError = sharedState.yy.parseError
- } else {
- this.parseError = Object.getPrototypeOf(this).parseError
- }
- function popStack (n) {
- stack.length = stack.length - 2 * n
- vstack.length = vstack.length - n
- lstack.length = lstack.length - n
- }
- var lex = function () {
- var token
- token = lexer.lex() || EOF
- if (typeof token !== 'number') {
- token = self.symbols_[token] || token
- }
- return token
- }
- var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected
- while (true) {
- state = stack[stack.length - 1]
- if (this.defaultActions[state]) {
- action = this.defaultActions[state]
- } else {
- if (symbol === null || typeof symbol === 'undefined') {
- symbol = lex()
- }
- action = table[state] && table[state][symbol]
- }
- if (typeof action === 'undefined' || !action.length || !action[0]) {
- var errStr = ''
- expected = []
- for (p in table[state]) {
- if (this.terminals_[p] && p > TERROR) {
- expected.push('\'' + this.terminals_[p] + '\'')
- }
- }
- if (lexer.showPosition) {
- errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''
- } else {
- errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'')
- }
- this.parseError(errStr, {
- text: lexer.match,
- token: this.terminals_[symbol] || symbol,
- line: lexer.yylineno,
- loc: yyloc,
- expected: expected
- })
- }
- if (action[0] instanceof Array && action.length > 1) {
- throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol)
- }
- switch (action[0]) {
- case 1:
- stack.push(symbol)
- vstack.push(lexer.yytext)
- lstack.push(lexer.yylloc)
- stack.push(action[1])
- symbol = null
- if (!preErrorSymbol) {
- yyleng = lexer.yyleng
- yytext = lexer.yytext
- yylineno = lexer.yylineno
- yyloc = lexer.yylloc
- if (recovering > 0) {
- recovering--
- }
- } else {
- symbol = preErrorSymbol
- preErrorSymbol = null
- }
- break
- case 2:
- len = this.productions_[action[1]][1]
- yyval.$ = vstack[vstack.length - len]
- yyval._$ = {
- first_line: lstack[lstack.length - (len || 1)].first_line,
- last_line: lstack[lstack.length - 1].last_line,
- first_column: lstack[lstack.length - (len || 1)].first_column,
- last_column: lstack[lstack.length - 1].last_column
- }
- if (ranges) {
- yyval._$.range = [
- lstack[lstack.length - (len || 1)].range[0],
- lstack[lstack.length - 1].range[1]
- ]
- }
- r = this.performAction.apply(yyval, [
- yytext,
- yyleng,
- yylineno,
- sharedState.yy,
- action[1],
- vstack,
- lstack
- ].concat(args))
- if (typeof r !== 'undefined') {
- return r
- }
- if (len) {
- stack = stack.slice(0, -1 * len * 2)
- vstack = vstack.slice(0, -1 * len)
- lstack = lstack.slice(0, -1 * len)
- }
- stack.push(this.productions_[action[1]][0])
- vstack.push(yyval.$)
- lstack.push(yyval._$)
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]]
- stack.push(newState)
- break
- case 3:
- return true
- }
- }
- return true
- }}
-/* generated by jison-lex 0.3.4 */
- var lexer = (function () {
- var lexer = ({
-
- EOF: 1,
-
- parseError: function parseError (str, hash) {
- if (this.yy.parser) {
- this.yy.parser.parseError(str, hash)
- } else {
- throw new Error(str)
- }
- },
-
-// resets the lexer, sets new input
- setInput: function (input, yy) {
- this.yy = yy || this.yy || {}
- this._input = input
- this._more = this._backtrack = this.done = false
- this.yylineno = this.yyleng = 0
- this.yytext = this.matched = this.match = ''
- this.conditionStack = ['INITIAL']
- this.yylloc = {
- first_line: 1,
- first_column: 0,
- last_line: 1,
- last_column: 0
- }
- if (this.options.ranges) {
- this.yylloc.range = [0, 0]
- }
- this.offset = 0
- return this
- },
-
-// consumes and returns one char from the input
- input: function () {
- var ch = this._input[0]
- this.yytext += ch
- this.yyleng++
- this.offset++
- this.match += ch
- this.matched += ch
- var lines = ch.match(/(?:\r\n?|\n).*/g)
- if (lines) {
- this.yylineno++
- this.yylloc.last_line++
- } else {
- this.yylloc.last_column++
- }
- if (this.options.ranges) {
- this.yylloc.range[1]++
- }
-
- this._input = this._input.slice(1)
- return ch
- },
-
-// unshifts one char (or a string) into the input
- unput: function (ch) {
- var len = ch.length
- var lines = ch.split(/(?:\r\n?|\n)/g)
-
- this._input = ch + this._input
- this.yytext = this.yytext.substr(0, this.yytext.length - len)
- // this.yyleng -= len;
- this.offset -= len
- var oldLines = this.match.split(/(?:\r\n?|\n)/g)
- this.match = this.match.substr(0, this.match.length - 1)
- this.matched = this.matched.substr(0, this.matched.length - 1)
-
- if (lines.length - 1) {
- this.yylineno -= lines.length - 1
- }
- var r = this.yylloc.range
-
- this.yylloc = {
- first_line: this.yylloc.first_line,
- last_line: this.yylineno + 1,
- first_column: this.yylloc.first_column,
- last_column: lines
- ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) +
- oldLines[oldLines.length - lines.length].length - lines[0].length
- : this.yylloc.first_column - len
- }
-
- if (this.options.ranges) {
- this.yylloc.range = [r[0], r[0] + this.yyleng - len]
- }
- this.yyleng = this.yytext.length
- return this
- },
-
-// When called from action, caches matched text and appends it on next action
- more: function () {
- this._more = true
- return this
- },
-
-// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
- reject: function () {
- if (this.options.backtrack_lexer) {
- this._backtrack = true
- } else {
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
- text: '',
- token: null,
- line: this.yylineno
- })
- }
- return this
- },
-
-// retain first n characters of the match
- less: function (n) {
- this.unput(this.match.slice(n))
- },
-
-// displays already matched input, i.e. for error messages
- pastInput: function () {
- var past = this.matched.substr(0, this.matched.length - this.match.length)
- return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '')
- },
-
-// displays upcoming input, i.e. for error messages
- upcomingInput: function () {
- var next = this.match
- if (next.length < 20) {
- next += this._input.substr(0, 20 - next.length)
- }
- return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '')
- },
-
-// displays the character position where the lexing error occurred, i.e. for error messages
- showPosition: function () {
- var pre = this.pastInput()
- var c = new Array(pre.length + 1).join('-')
- return pre + this.upcomingInput() + '\n' + c + '^'
- },
-
-// test the lexed token: return FALSE when not a match, otherwise return token
- test_match: function (match, indexed_rule) {
- var token,
- lines,
- backup
-
- if (this.options.backtrack_lexer) {
- // save context
- backup = {
- yylineno: this.yylineno,
- yylloc: {
- first_line: this.yylloc.first_line,
- last_line: this.last_line,
- first_column: this.yylloc.first_column,
- last_column: this.yylloc.last_column
- },
- yytext: this.yytext,
- match: this.match,
- matches: this.matches,
- matched: this.matched,
- yyleng: this.yyleng,
- offset: this.offset,
- _more: this._more,
- _input: this._input,
- yy: this.yy,
- conditionStack: this.conditionStack.slice(0),
- done: this.done
- }
- if (this.options.ranges) {
- backup.yylloc.range = this.yylloc.range.slice(0)
- }
- }
-
- lines = match[0].match(/(?:\r\n?|\n).*/g)
- if (lines) {
- this.yylineno += lines.length
- }
- this.yylloc = {
- first_line: this.yylloc.last_line,
- last_line: this.yylineno + 1,
- first_column: this.yylloc.last_column,
- last_column: lines
- ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length
- : this.yylloc.last_column + match[0].length
- }
- this.yytext += match[0]
- this.match += match[0]
- this.matches = match
- this.yyleng = this.yytext.length
- if (this.options.ranges) {
- this.yylloc.range = [this.offset, this.offset += this.yyleng]
- }
- this._more = false
- this._backtrack = false
- this._input = this._input.slice(match[0].length)
- this.matched += match[0]
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1])
- if (this.done && this._input) {
- this.done = false
- }
- if (token) {
- return token
- } else if (this._backtrack) {
- // recover context
- for (var k in backup) {
- this[k] = backup[k]
- }
- return false // rule action called reject() implying the next rule should be tested instead.
- }
- return false
- },
-
-// return next match in input
- next: function () {
- if (this.done) {
- return this.EOF
- }
- if (!this._input) {
- this.done = true
- }
-
- var token,
- match,
- tempMatch,
- index
- if (!this._more) {
- this.yytext = ''
- this.match = ''
- }
- var rules = this._currentRules()
- for (var i = 0; i < rules.length; i++) {
- tempMatch = this._input.match(this.rules[rules[i]])
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
- match = tempMatch
- index = i
- if (this.options.backtrack_lexer) {
- token = this.test_match(tempMatch, rules[i])
- if (token !== false) {
- return token
- } else if (this._backtrack) {
- match = false
- continue // rule action called reject() implying a rule MISmatch.
- } else {
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
- return false
- }
- } else if (!this.options.flex) {
- break
- }
- }
- }
- if (match) {
- token = this.test_match(match, rules[index])
- if (token !== false) {
- return token
- }
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
- return false
- }
- if (this._input === '') {
- return this.EOF
- } else {
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
- text: '',
- token: null,
- line: this.yylineno
- })
- }
- },
-
-// return next match that has a token
- lex: function lex () {
- var r = this.next()
- if (r) {
- return r
- } else {
- return this.lex()
- }
- },
-
-// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
- begin: function begin (condition) {
- this.conditionStack.push(condition)
- },
-
-// pop the previously active lexer condition state off the condition stack
- popState: function popState () {
- var n = this.conditionStack.length - 1
- if (n > 0) {
- return this.conditionStack.pop()
- } else {
- return this.conditionStack[0]
- }
- },
-
-// produce the lexer rule set which is active for the currently active lexer condition state
- _currentRules: function _currentRules () {
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules
- } else {
- return this.conditions['INITIAL'].rules
- }
- },
-
-// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
- topState: function topState (n) {
- n = this.conditionStack.length - 1 - Math.abs(n || 0)
- if (n >= 0) {
- return this.conditionStack[n]
- } else {
- return 'INITIAL'
- }
- },
-
-// alias for begin(condition)
- pushState: function pushState (condition) {
- this.begin(condition)
- },
-
-// return the number of states currently on the stack
- stateStackSize: function stateStackSize () {
- return this.conditionStack.length
- },
- options: {'case-insensitive': true},
- performAction: function anonymous (yy, yy_, $avoiding_name_collisions, YY_START) {
- // Pre-lexer code can go here
-
- var YYSTATE = YY_START
- switch ($avoiding_name_collisions) {
- case 0:return 9
- break
- case 1:return 10
- break
- case 2:return 4
- break
- case 3:return 12
- break
- case 4:return 13
- break
- case 5:return 6
- break
- case 6:return 'INVALID'
- break
- }
- },
- rules: [/^(?:[\n]+)/i, /^(?:showInfo\b)/i, /^(?:info\b)/i, /^(?:say\b)/i, /^(?::[^#\n;]+)/i, /^(?:$)/i, /^(?:.)/i],
- conditions: {'INITIAL': {'rules': [0, 1, 2, 3, 4, 5, 6], 'inclusive': true}}
- })
- return lexer
- })()
- parser.lexer = lexer
- function Parser () {
- this.yy = {}
- }
- Parser.prototype = parser; parser.Parser = Parser
- return new Parser()
-})()
-
-if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
- exports.parser = parser
- exports.Parser = parser.Parser
- exports.parse = function () { return parser.parse.apply(parser, arguments) }
- exports.main = function commonjsMain (args) {
- if (!args[1]) {
- console.log('Usage: ' + args[0] + ' FILE')
- process.exit(1)
- }
- var source = require('fs').readFileSync(require('path').normalize(args[1]), 'utf8')
- return exports.parser.parse(source)
- }
- if (typeof module !== 'undefined' && require.main === module) {
- exports.main(process.argv.slice(1))
- }
-}
-
-}).call(this,require('_process'))
-},{"_process":406,"fs":7,"path":405}],386:[function(require,module,exports){
-/**
- * Created by knut on 14-12-11.
- */
-var graph = require('./graphDb')
-var flow = require('./parser/flow')
-var dot = require('./parser/dot')
-var d3 = require('../../d3')
-var dagreD3 = require('dagre-d3-renderer')
-var Logger = require('../../logger')
-var log = Logger.Log
-
-var conf = {
-}
-module.exports.setConf = function (cnf) {
- var keys = Object.keys(cnf)
- var i
- for (i = 0; i < keys.length; i++) {
- conf[keys[i]] = cnf[keys[i]]
- }
-}
-
-/**
- * Function that adds the vertices found in the graph definition to the graph to be rendered.
- * @param vert Object containing the vertices.
- * @param g The graph that is to be drawn.
- */
-exports.addVertices = function (vert, g) {
- var keys = Object.keys(vert)
-
- var styleFromStyleArr = function (styleStr, arr) {
- var i
- // Create a compound style definition from the style definitions found for the node in the graph definition
- for (i = 0; i < arr.length; i++) {
- if (typeof arr[i] !== 'undefined') {
- styleStr = styleStr + arr[i] + ';'
- }
- }
-
- return styleStr
- }
-
- // Iterate through each item in the vertice object (containing all the vertices found) in the graph definition
- keys.forEach(function (id) {
- var vertice = vert[id]
- var verticeText
-
- /**
- * Variable for storing the classes for the vertice
- * @type {string}
- */
- var classStr = ''
-
- if (vertice.classes.length > 0) {
- classStr = vertice.classes.join(' ')
- }
-
- /**
- * Variable for storing the extracted style for the vertice
- * @type {string}
- */
- var style = ''
- // Create a compound style definition from the style definitions found for the node in the graph definition
- style = styleFromStyleArr(style, vertice.styles)
-
- // Use vertice id as text in the box if no text is provided by the graph definition
- if (typeof vertice.text === 'undefined') {
- verticeText = vertice.id
- } else {
- verticeText = vertice.text
- }
-
- var labelTypeStr = ''
- if (conf.htmlLabels) {
- labelTypeStr = 'html'
- verticeText = verticeText.replace(/fa:fa[\w-]+/g, function (s) {
- return '<i class="fa ' + s.substring(3) + '"></i>'
- })
- } else {
- var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text')
-
- var rows = verticeText.split(/<br>/)
-
- var j = 0
- for (j = 0; j < rows.length; j++) {
- var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan')
- tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve')
- tspan.setAttribute('dy', '1em')
- tspan.setAttribute('x', '1')
- tspan.textContent = rows[j]
- svgLabel.appendChild(tspan)
- }
-
- labelTypeStr = 'svg'
- verticeText = svgLabel
- }
-
- var radious = 0
- var _shape = ''
-
- // Set the shape based parameters
- switch (vertice.type) {
- case 'round':
- radious = 5
- _shape = 'rect'
- break
- case 'square':
- _shape = 'rect'
- break
- case 'diamond':
- _shape = 'question'
- break
- case 'odd':
- _shape = 'rect_left_inv_arrow'
- break
- case 'odd_right':
- _shape = 'rect_left_inv_arrow'
- break
- case 'circle':
- _shape = 'circle'
- break
- case 'ellipse':
- _shape = 'ellipse'
- break
- case 'group':
- _shape = 'rect'
- // Need to create a text node if using svg labels, see #367
- verticeText = conf.htmlLabels ? '' : document.createElementNS('http://www.w3.org/2000/svg', 'text')
- break
- default:
- _shape = 'rect'
- }
- // Add the node
- g.setNode(vertice.id, { labelType: labelTypeStr, shape: _shape, label: verticeText, rx: radious, ry: radious, 'class': classStr, style: style, id: vertice.id })
- })
-}
-
-/**
- * Add edges to graph based on parsed graph defninition
- * @param {Object} edges The edges to add to the graph
- * @param {Object} g The graph object
- */
-exports.addEdges = function (edges, g) {
- var cnt = 0
-
- var defaultStyle
- if (typeof edges.defaultStyle !== 'undefined') {
- defaultStyle = edges.defaultStyle.toString().replace(/,/g, ';')
- }
-
- edges.forEach(function (edge) {
- cnt++
- var edgeData = {}
-
- // Set link type for rendering
- if (edge.type === 'arrow_open') {
- edgeData.arrowhead = 'none'
- } else {
- edgeData.arrowhead = 'normal'
- }
-
- var style = ''
-
- if (typeof edge.style !== 'undefined') {
- edge.style.forEach(function (s) {
- style = style + s + ';'
- })
- } else {
- switch (edge.stroke) {
- case 'normal':
- style = 'fill:none'
- if (typeof defaultStyle !== 'undefined') {
- style = defaultStyle
- }
- break
- case 'dotted':
- style = 'stroke: #333; fill:none;stroke-width:2px;stroke-dasharray:3;'
- break
- case 'thick':
- style = 'stroke: #333; stroke-width: 3.5px;fill:none'
- break
- }
- }
- edgeData.style = style
-
- if (typeof edge.interpolate !== 'undefined') {
- edgeData.lineInterpolate = edge.interpolate
- } else {
- if (typeof edges.defaultInterpolate !== 'undefined') {
- edgeData.lineInterpolate = edges.defaultInterpolate
- }
- }
-
- if (typeof edge.text === 'undefined') {
- if (typeof edge.style !== 'undefined') {
- edgeData.arrowheadStyle = 'fill: #333'
- }
- } else {
- edgeData.arrowheadStyle = 'fill: #333'
- if (typeof edge.style === 'undefined') {
- edgeData.labelpos = 'c'
- if (conf.htmlLabels) {
- edgeData.labelType = 'html'
- edgeData.label = '<span class="edgeLabel">' + edge.text + '</span>'
- } else {
- edgeData.labelType = 'text'
- edgeData.style = 'stroke: #333; stroke-width: 1.5px;fill:none'
- edgeData.label = edge.text.replace(/<br>/g, '\n')
- }
- } else {
- edgeData.label = edge.text.replace(/<br>/g, '\n')
- }
- }
- // Add the edge to the graph
- g.setEdge(edge.start, edge.end, edgeData, cnt)
- })
-}
-
-/**
- * Returns the all the styles from classDef statements in the graph definition.
- * @returns {object} classDef styles
- */
-exports.getClasses = function (text, isDot) {
- var parser
- graph.clear()
- if (isDot) {
- parser = dot.parser
- } else {
- parser = flow.parser
- }
- parser.yy = graph
-
- // Parse the graph definition
- parser.parse(text)
-
- var classes = graph.getClasses()
-
- // Add default class if undefined
- if (typeof (classes.default) === 'undefined') {
- classes.default = { id: 'default' }
- classes.default.styles = []
- classes.default.clusterStyles = ['rx:4px', 'fill: rgb(255, 255, 222)', 'rx: 4px', 'stroke: rgb(170, 170, 51)', 'stroke-width: 1px']
- classes.default.nodeLabelStyles = ['fill:#000', 'stroke:none', 'font-weight:300', 'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf', 'font-size:14px']
- classes.default.edgeLabelStyles = ['fill:#000', 'stroke:none', 'font-weight:300', 'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf', 'font-size:14px']
- }
- return classes
-}
-
-/**
- * Draws a flowchart in the tag with id: id based on the graph definition in text.
- * @param text
- * @param id
- */
-exports.draw = function (text, id, isDot) {
- log.debug('Drawing flowchart')
- var parser
- graph.clear()
- if (isDot) {
- parser = dot.parser
- } else {
- parser = flow.parser
- }
- parser.yy = graph
-
- // Parse the graph definition
- try {
- parser.parse(text)
- } catch (err) {
- log.debug('Parsing failed')
- }
-
- // Fetch the default direction, use TD if none was found
- var dir
- dir = graph.getDirection()
- if (typeof dir === 'undefined') {
- dir = 'TD'
- }
-
- // Create the input mermaid.graph
- var g = new dagreD3.graphlib.Graph({
- multigraph: true,
- compound: true
- })
- .setGraph({
- rankdir: dir,
- marginx: 20,
- marginy: 20
-
- })
- .setDefaultEdgeLabel(function () {
- return {}
- })
-
- var subG
- var subGraphs = graph.getSubGraphs()
- var i = 0
- for (i = subGraphs.length - 1; i >= 0; i--) {
- subG = subGraphs[i]
- graph.addVertex(subG.id, subG.title, 'group', undefined)
- }
-
- // Fetch the verices/nodes and edges/links from the parsed graph definition
- var vert = graph.getVertices()
-
- var edges = graph.getEdges()
-
- i = 0
- var j
- for (i = subGraphs.length - 1; i >= 0; i--) {
- subG = subGraphs[i]
-
- d3.selectAll('cluster').append('text')
-
- for (j = 0; j < subG.nodes.length; j++) {
- g.setParent(subG.nodes[j], subG.id)
- }
- }
- exports.addVertices(vert, g)
- exports.addEdges(edges, g)
-
- // Create the renderer
- var Render = dagreD3.render
- var render = new Render()
-
- // Add custom shape for rhombus type of boc (decision)
- render.shapes().question = function (parent, bbox, node) {
- var w = bbox.width
- var h = bbox.height
- var s = (w + h) * 0.8
- var points = [
- { x: s / 2, y: 0 },
- { x: s, y: -s / 2 },
- { x: s / 2, y: -s },
- { x: 0, y: -s / 2 }
- ]
- var shapeSvg = parent.insert('polygon', ':first-child')
- .attr('points', points.map(function (d) {
- return d.x + ',' + d.y
- }).join(' '))
- .attr('rx', 5)
- .attr('ry', 5)
- .attr('transform', 'translate(' + (-s / 2) + ',' + (s * 2 / 4) + ')')
- node.intersect = function (point) {
- return dagreD3.intersect.polygon(node, points, point)
- }
- return shapeSvg
- }
-
- // Add custom shape for box with inverted arrow on left side
- render.shapes().rect_left_inv_arrow = function (parent, bbox, node) {
- var w = bbox.width
- var h = bbox.height
- var points = [
- { x: -h / 2, y: 0 },
- { x: w, y: 0 },
- { x: w, y: -h },
- { x: -h / 2, y: -h },
- { x: 0, y: -h / 2 }
- ]
- var shapeSvg = parent.insert('polygon', ':first-child')
- .attr('points', points.map(function (d) {
- return d.x + ',' + d.y
- }).join(' '))
- .attr('transform', 'translate(' + (-w / 2) + ',' + (h * 2 / 4) + ')')
- node.intersect = function (point) {
- return dagreD3.intersect.polygon(node, points, point)
- }
- return shapeSvg
- }
-
- // Add custom shape for box with inverted arrow on right side
- render.shapes().rect_right_inv_arrow = function (parent, bbox, node) {
- var w = bbox.width
- var h = bbox.height
- var points = [
- { x: 0, y: 0 },
- { x: w + h / 2, y: 0 },
- { x: w, y: -h / 2 },
- { x: w + h / 2, y: -h },
- { x: 0, y: -h }
- ]
- var shapeSvg = parent.insert('polygon', ':first-child')
- .attr('points', points.map(function (d) {
- return d.x + ',' + d.y
- }).join(' '))
- .attr('transform', 'translate(' + (-w / 2) + ',' + (h * 2 / 4) + ')')
- node.intersect = function (point) {
- return dagreD3.intersect.polygon(node, points, point)
- }
- return shapeSvg
- }
-
- // Add our custom arrow - an empty arrowhead
- render.arrows().none = function normal (parent, id, edge, type) {
- var marker = parent.append('marker')
- .attr('id', id)
- .attr('viewBox', '0 0 10 10')
- .attr('refX', 9)
- .attr('refY', 5)
- .attr('markerUnits', 'strokeWidth')
- .attr('markerWidth', 8)
- .attr('markerHeight', 6)
- .attr('orient', 'auto')
-
- var path = marker.append('path')
- .attr('d', 'M 0 0 L 0 0 L 0 0 z')
- dagreD3.util.applyStyle(path, edge[type + 'Style'])
- }
-
- // Override normal arrowhead defined in d3. Remove style & add class to allow css styling.
- render.arrows().normal = function normal (parent, id, edge, type) {
- var marker = parent.append('marker')
- .attr('id', id)
- .attr('viewBox', '0 0 10 10')
- .attr('refX', 9)
- .attr('refY', 5)
- .attr('markerUnits', 'strokeWidth')
- .attr('markerWidth', 8)
- .attr('markerHeight', 6)
- .attr('orient', 'auto')
-
- marker.append('path')
- .attr('d', 'M 0 0 L 10 5 L 0 10 z')
- .attr('class', 'arrowheadPath')
- .style('stroke-width', 1)
- .style('stroke-dasharray', '1,0')
- }
-
- // Set up an SVG group so that we can translate the final graph.
- var svg = d3.select('#' + id)
-
- // Run the renderer. This is what draws the final graph.
- var element = d3.select('#' + id + ' g')
- render(element, g)
-
- element.selectAll('g.node')
- .attr('title', function () {
- return graph.getTooltip(this.id)
- })
-
- if (conf.useMaxWidth) {
- // Center the graph
- svg.attr('height', '100%')
- svg.attr('width', conf.width)
- svg.attr('viewBox', '0 0 ' + (g.graph().width + 20) + ' ' + (g.graph().height + 20))
- svg.attr('style', 'max-width:' + (g.graph().width + 20) + 'px;')
- } else {
- // Center the graph
- svg.attr('height', g.graph().height)
- if (typeof conf.width === 'undefined') {
- svg.attr('width', g.graph().width)
- } else {
- svg.attr('width', conf.width)
- }
- svg.attr('viewBox', '0 0 ' + (g.graph().width + 20) + ' ' + (g.graph().height + 20))
- }
-
- // Index nodes
- graph.indexNodes('subGraph' + i)
-
- for (i = 0; i < subGraphs.length; i++) {
- subG = subGraphs[i]
-
- if (subG.title !== 'undefined') {
- var clusterRects = document.querySelectorAll('#' + id + ' #' + subG.id + ' rect')
- var clusterEl = document.querySelectorAll('#' + id + ' #' + subG.id)
-
- var xPos = clusterRects[0].x.baseVal.value
- var yPos = clusterRects[0].y.baseVal.value
- var width = clusterRects[0].width.baseVal.value
- var cluster = d3.select(clusterEl[0])
- var te = cluster.append('text')
- te.attr('x', xPos + width / 2)
- te.attr('y', yPos + 14)
- te.attr('fill', 'black')
- te.attr('stroke', 'none')
- te.attr('id', id + 'Text')
- te.style('text-anchor', 'middle')
-
- if (typeof subG.title === 'undefined') {
- te.text('Undef')
- } else {
- te.text(subG.title)
- }
- }
- }
-
- // Add label rects for non html labels
- if (!conf.htmlLabels) {
- var labels = document.querySelectorAll('#' + id + ' .edgeLabel .label')
- var k
- for (k = 0; k < labels.length; k++) {
- var label = labels[i]
-
- // Get dimensions of label
- var dim = label.getBBox()
-
- var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect')
- rect.setAttribute('rx', 0)
- rect.setAttribute('ry', 0)
- rect.setAttribute('width', dim.width)
- rect.setAttribute('height', dim.height)
- rect.setAttribute('style', 'fill:#e8e8e8;')
-
- label.insertBefore(rect, label.firstChild)
- }
- }
-}
-
-},{"../../d3":379,"../../logger":400,"./graphDb":387,"./parser/dot":388,"./parser/flow":389,"dagre-d3-renderer":9}],387:[function(require,module,exports){
-(function (global){
-/**
- * Created by knut on 14-11-03.
- */
-var Logger = require('../../logger')
-var log = Logger.Log
-var utils = require('../../utils')
-
-var d3 = require('../../d3')
-var vertices = {}
-var edges = []
-var classes = []
-var subGraphs = []
-var tooltips = {}
-var subCount = 0
-var direction
-// Functions to be run after graph rendering
-var funs = []
-/**
- * Function called by parser when a node definition has been found
- * @param id
- * @param text
- * @param type
- * @param style
- */
-exports.addVertex = function (id, text, type, style) {
- var txt
-
- if (typeof id === 'undefined') {
- return
- }
- if (id.trim().length === 0) {
- return
- }
-
- if (typeof vertices[id] === 'undefined') {
- vertices[id] = { id: id, styles: [], classes: [] }
- }
- if (typeof text !== 'undefined') {
- txt = text.trim()
-
- // strip quotes if string starts and exnds with a quote
- if (txt[0] === '"' && txt[txt.length - 1] === '"') {
- txt = txt.substring(1, txt.length - 1)
- }
-
- vertices[id].text = txt
- }
- if (typeof type !== 'undefined') {
- vertices[id].type = type
- }
- if (typeof type !== 'undefined') {
- vertices[id].type = type
- }
- if (typeof style !== 'undefined') {
- if (style !== null) {
- style.forEach(function (s) {
- vertices[id].styles.push(s)
- })
- }
- }
-}
-
-/**
- * Function called by parser when a link/edge definition has been found
- * @param start
- * @param end
- * @param type
- * @param linktext
- */
-exports.addLink = function (start, end, type, linktext) {
- log.info('Got edge...', start, end)
- var edge = { start: start, end: end, type: undefined, text: '' }
- linktext = type.text
-
- if (typeof linktext !== 'undefined') {
- edge.text = linktext.trim()
-
- // strip quotes if string starts and exnds with a quote
- if (edge.text[0] === '"' && edge.text[edge.text.length - 1] === '"') {
- edge.text = edge.text.substring(1, edge.text.length - 1)
- }
- }
-
- if (typeof type !== 'undefined') {
- edge.type = type.type
- edge.stroke = type.stroke
- }
- edges.push(edge)
-}
-
-/**
- * Updates a link's line interpolation algorithm
- * @param pos
- * @param interpolate
- */
-exports.updateLinkInterpolate = function (pos, interp) {
- if (pos === 'default') {
- edges.defaultInterpolate = interp
- } else {
- edges[pos].interpolate = interp
- }
-}
-
-/**
- * Updates a link with a style
- * @param pos
- * @param style
- */
-exports.updateLink = function (pos, style) {
- if (pos === 'default') {
- edges.defaultStyle = style
- } else {
- if (utils.isSubstringInArray('fill', style) === -1) {
- style.push('fill:none')
- }
- edges[pos].style = style
- }
-}
-
-exports.addClass = function (id, style) {
- if (typeof classes[id] === 'undefined') {
- classes[id] = { id: id, styles: [] }
- }
-
- if (typeof style !== 'undefined') {
- if (style !== null) {
- style.forEach(function (s) {
- classes[id].styles.push(s)
- })
- }
- }
-}
-
-/**
- * Called by parser when a graph definition is found, stores the direction of the chart.
- * @param dir
- */
-exports.setDirection = function (dir) {
- direction = dir
-}
-
-/**
- * Called by parser when a graph definition is found, stores the direction of the chart.
- * @param dir
- */
-exports.setClass = function (id, className) {
- if (id.indexOf(',') > 0) {
- id.split(',').forEach(function (id2) {
- if (typeof vertices[id2] !== 'undefined') {
- vertices[id2].classes.push(className)
- }
- })
- } else {
- if (typeof vertices[id] !== 'undefined') {
- vertices[id].classes.push(className)
- }
- }
-}
-
-var setTooltip = function (id, tooltip) {
- if (typeof tooltip !== 'undefined') {
- tooltips[id] = tooltip
- }
-}
-
-var setClickFun = function (id, functionName) {
- if (typeof functionName === 'undefined') {
- return
- }
- if (typeof vertices[id] !== 'undefined') {
- funs.push(function (element) {
- var elem = d3.select(element).select('#' + id)
- if (elem !== null) {
- elem.on('click', function () {
- window[functionName](id)
- })
- }
- })
- }
-}
-
-var setLink = function (id, linkStr) {
- if (typeof linkStr === 'undefined') {
- return
- }
- if (typeof vertices[id] !== 'undefined') {
- funs.push(function (element) {
- var elem = d3.select(element).select('#' + id)
- if (elem !== null) {
- elem.on('click', function () {
- window.open(linkStr, 'newTab')
- })
- }
- })
- }
-}
-exports.getTooltip = function (id) {
- return tooltips[id]
-}
-
-/**
- * Called by parser when a graph definition is found, stores the direction of the chart.
- * @param dir
- */
-exports.setClickEvent = function (id, functionName, link, tooltip) {
- if (id.indexOf(',') > 0) {
- id.split(',').forEach(function (id2) {
- setTooltip(id2, tooltip)
- setClickFun(id2, functionName)
- setLink(id2, link)
- })
- } else {
- setTooltip(id, tooltip)
- setClickFun(id, functionName)
- setLink(id, link)
- }
-}
-
-exports.bindFunctions = function (element) {
- funs.forEach(function (fun) {
- fun(element)
- })
-}
-exports.getDirection = function () {
- return direction
-}
-/**
- * Retrieval function for fetching the found nodes after parsing has completed.
- * @returns {{}|*|vertices}
- */
-exports.getVertices = function () {
- return vertices
-}
-
-/**
- * Retrieval function for fetching the found links after parsing has completed.
- * @returns {{}|*|edges}
- */
-exports.getEdges = function () {
- return edges
-}
-
-/**
- * Retrieval function for fetching the found class definitions after parsing has completed.
- * @returns {{}|*|classes}
- */
-exports.getClasses = function () {
- return classes
-}
-
-var setupToolTips = function (element) {
- var tooltipElem = d3.select('.mermaidTooltip')
- if (tooltipElem[0][0] === null) {
- tooltipElem = d3.select('body')
- .append('div')
- .attr('class', 'mermaidTooltip')
- .style('opacity', 0)
- }
-
- var svg = d3.select(element).select('svg')
-
- var nodes = svg.selectAll('g.node')
- nodes
- .on('mouseover', function () {
- var el = d3.select(this)
- var title = el.attr('title')
- // Dont try to draw a tooltip if no data is provided
- if (title === null) {
- return
- }
- var rect = this.getBoundingClientRect()
-
- tooltipElem.transition()
- .duration(200)
- .style('opacity', '.9')
- tooltipElem.html(el.attr('title'))
- .style('left', (rect.left + (rect.right - rect.left) / 2) + 'px')
- .style('top', (rect.top - 14 + document.body.scrollTop) + 'px')
- el.classed('hover', true)
- })
- .on('mouseout', function () {
- tooltipElem.transition()
- .duration(500)
- .style('opacity', 0)
- var el = d3.select(this)
- el.classed('hover', false)
- })
-}
-funs.push(setupToolTips)
-
-/**
- * Clears the internal graph db so that a new graph can be parsed.
- */
-exports.clear = function () {
- vertices = {}
- classes = {}
- edges = []
- funs = []
- funs.push(setupToolTips)
- subGraphs = []
- subCount = 0
- tooltips = []
-}
-/**
- *
- * @returns {string}
- */
-exports.defaultStyle = function () {
- return 'fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;'
-}
-
-/**
- * Clears the internal graph db so that a new graph can be parsed.
- */
-exports.addSubGraph = function (list, title) {
- function uniq (a) {
- var prims = { 'boolean': {}, 'number': {}, 'string': {} }
- var objs = []
-
- return a.filter(function (item) {
- var type = typeof item
- if (item === ' ') {
- return false
- }
- if (type in prims) { return prims[type].hasOwnProperty(item) ? false : (prims[type][item] = true) } else { return objs.indexOf(item) >= 0 ? false : objs.push(item) }
- })
- }
-
- var nodeList = []
-
- nodeList = uniq(nodeList.concat.apply(nodeList, list))
-
- var subGraph = { id: 'subGraph' + subCount, nodes: nodeList, title: title }
- subGraphs.push(subGraph)
- subCount = subCount + 1
- return subGraph.id
-}
-
-var getPosForId = function (id) {
- var i
- for (i = 0; i < subGraphs.length; i++) {
- if (subGraphs[i].id === id) {
- return i
- }
- }
- return -1
-}
-var secCount = -1
-var posCrossRef = []
-var indexNodes = function (id, pos) {
- var nodes = subGraphs[pos].nodes
- secCount = secCount + 1
- if (secCount > 2000) {
- return
- }
- posCrossRef[secCount] = pos
- // Check if match
- if (subGraphs[pos].id === id) {
- return {
- result: true,
- count: 0
- }
- }
-
- var count = 0
- var posCount = 1
- while (count < nodes.length) {
- var childPos = getPosForId(nodes[count])
- // Ignore regular nodes (pos will be -1)
- if (childPos >= 0) {
- var res = indexNodes(id, childPos)
- if (res.result) {
- return {
- result: true,
- count: posCount + res.count
- }
- } else {
- posCount = posCount + res.count
- }
- }
- count = count + 1
- }
-
- return {
- result: false,
- count: posCount
- }
-}
-
-exports.getDepthFirstPos = function (pos) {
- return posCrossRef[pos]
-}
-exports.indexNodes = function () {
- secCount = -1
- if (subGraphs.length > 0) {
- indexNodes('none', subGraphs.length - 1, 0)
- }
-}
-
-exports.getSubGraphs = function () {
- return subGraphs
-}
-
-exports.parseError = function (err, hash) {
- global.mermaidAPI.parseError(err, hash)
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"../../d3":379,"../../logger":400,"../../utils":403}],388:[function(require,module,exports){
-(function (process){
-/* parser generated by jison 0.4.17 */
-/*
- Returns a Parser object of the following structure:
-
- Parser: {
- yy: {}
- }
-
- Parser.prototype: {
- yy: {},
- trace: function(),
- symbols_: {associative list: name ==> number},
- terminals_: {associative list: number ==> name},
- productions_: [...],
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
- table: [...],
- defaultActions: {...},
- parseError: function(str, hash),
- parse: function(input),
-
- lexer: {
- EOF: 1,
- parseError: function(str, hash),
- setInput: function(input),
- input: function(),
- unput: function(str),
- more: function(),
- less: function(n),
- pastInput: function(),
- upcomingInput: function(),
- showPosition: function(),
- test_match: function(regex_match_array, rule_index),
- next: function(),
- lex: function(),
- begin: function(condition),
- popState: function(),
- _currentRules: function(),
- topState: function(),
- pushState: function(condition),
-
- options: {
- ranges: boolean (optional: true ==> token location info will include a .range[] member)
- flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
- backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
- },
-
- performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
- rules: [...],
- conditions: {associative list: name ==> set},
- }
- }
-
- token location info (@$, _$, etc.): {
- first_line: n,
- last_line: n,
- first_column: n,
- last_column: n,
- range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
- }
-
- the parseError function receives a 'hash' object with these members for lexer and parser errors: {
- text: (matched text)
- token: (the produced terminal token, if any)
- line: (yylineno)
- }
- while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
- loc: (yylloc)
- expected: (string describing the set of expected tokens)
- recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
- }
-*/
-var parser = (function () {
- var o = function (k, v, o, l) { for (o = o || {}, l = k.length; l--; o[k[l]] = v);return o }, $V0 = [1, 5], $V1 = [1, 6], $V2 = [1, 12], $V3 = [1, 13], $V4 = [1, 14], $V5 = [1, 15], $V6 = [1, 16], $V7 = [1, 17], $V8 = [1, 18], $V9 = [1, 19], $Va = [1, 20], $Vb = [1, 21], $Vc = [1, 22], $Vd = [8, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26], $Ve = [1, 37], $Vf = [1, 33], $Vg = [1, 34], $Vh = [1, 35], $Vi = [1, 36], $Vj = [8, 10, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 32, 37, 39, 40, 45, 57, 58], $Vk = [10, 28], $Vl = [10, 28, 37, 57, 58], $Vm = [2, 49], $Vn = [1, 45], $Vo = [1, 48], $Vp = [1, 49], $Vq = [1, 52], $Vr = [2, 65], $Vs = [1, 65], $Vt = [1, 66], $Vu = [1, 67], $Vv = [1, 68], $Vw = [1, 69], $Vx = [1, 70], $Vy = [1, 71], $Vz = [1, 72], $VA = [1, 73], $VB = [8, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 47], $VC = [10, 28, 37]
- var parser = {trace: function trace () { },
- yy: {},
- symbols_: {'error': 2, 'expressions': 3, 'graph': 4, 'EOF': 5, 'graphStatement': 6, 'idStatement': 7, '{': 8, 'stmt_list': 9, '}': 10, 'strict': 11, 'GRAPH': 12, 'DIGRAPH': 13, 'textNoTags': 14, 'textNoTagsToken': 15, 'ALPHA': 16, 'NUM': 17, 'COLON': 18, 'PLUS': 19, 'EQUALS': 20, 'MULT': 21, 'DOT': 22, 'BRKT': 23, 'SPACE': 24, 'MINUS': 25, 'keywords': 26, 'stmt': 27, ';': 28, 'node_stmt': 29, 'edge_stmt': 30, 'attr_stmt': 31, '=': 32, 'subgraph': 33, 'attr_list': 34, 'NODE': 35, 'EDGE': 36, '[': 37, 'a_list': 38, ']': 39, ',': 40, 'edgeRHS': 41, 'node_id': 42, 'edgeop': 43, 'port': 44, ':': 45, 'compass_pt': 46, 'SUBGRAPH': 47, 'n': 48, 'ne': 49, 'e': 50, 'se': 51, 's': 52, 'sw': 53, 'w': 54, 'nw': 55, 'c': 56, 'ARROW_POINT': 57, 'ARROW_OPEN': 58, '$accept': 0, '$end': 1},
- terminals_: {2: 'error', 5: 'EOF', 8: '{', 10: '}', 11: 'strict', 12: 'GRAPH', 13: 'DIGRAPH', 16: 'ALPHA', 17: 'NUM', 18: 'COLON', 19: 'PLUS', 20: 'EQUALS', 21: 'MULT', 22: 'DOT', 23: 'BRKT', 24: 'SPACE', 25: 'MINUS', 26: 'keywords', 28: ';', 32: '=', 35: 'NODE', 36: 'EDGE', 37: '[', 39: ']', 40: ',', 45: ':', 47: 'SUBGRAPH', 48: 'n', 49: 'ne', 50: 'e', 51: 'se', 52: 's', 53: 'sw', 54: 'w', 55: 'nw', 56: 'c', 57: 'ARROW_POINT', 58: 'ARROW_OPEN'},
- productions_: [0, [3, 2], [4, 5], [4, 6], [4, 4], [6, 1], [6, 1], [7, 1], [14, 1], [14, 2], [15, 1], [15, 1], [15, 1], [15, 1], [15, 1], [15, 1], [15, 1], [15, 1], [15, 1], [15, 1], [15, 1], [9, 1], [9, 3], [27, 1], [27, 1], [27, 1], [27, 3], [27, 1], [31, 2], [31, 2], [31, 2], [34, 4], [34, 3], [34, 3], [34, 2], [38, 5], [38, 5], [38, 3], [30, 3], [30, 3], [30, 2], [30, 2], [41, 3], [41, 3], [41, 2], [41, 2], [29, 2], [29, 1], [42, 2], [42, 1], [44, 4], [44, 2], [44, 2], [33, 5], [33, 4], [33, 3], [46, 1], [46, 1], [46, 1], [46, 1], [46, 1], [46, 1], [46, 1], [46, 1], [46, 1], [46, 0], [43, 1], [43, 1]],
- performAction: function anonymous (yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
-/* this == yyval */
-
- var $0 = $$.length - 1
- switch (yystate) {
- case 1:
- this.$ = $$[$0 - 1]
- break
- case 2:
- this.$ = $$[$0 - 4]
- break
- case 3:
- this.$ = $$[$0 - 5]
- break
- case 4:
- this.$ = $$[$0 - 3]
- break
- case 8: case 10: case 11:
- this.$ = $$[$0]
- break
- case 9:
- this.$ = $$[$0 - 1] + '' + $$[$0]
- break
- case 12: case 13: case 14: case 15: case 16: case 18: case 19: case 20:
- this.$ = $$[$0]
- break
- case 17:
- this.$ = '<br>'
- break
- case 39:
- this.$ = 'oy'
- break
- case 40:
-
- yy.addLink($$[$0 - 1], $$[$0].id, $$[$0].op)
- this.$ = 'oy'
- break
- case 42:
-
- yy.addLink($$[$0 - 1], $$[$0].id, $$[$0].op)
- this.$ = {op: $$[$0 - 2], id: $$[$0 - 1]}
-
- break
- case 44:
-
- this.$ = {op: $$[$0 - 1], id: $$[$0]}
-
- break
- case 48:
- yy.addVertex($$[$0 - 1]); this.$ = $$[$0 - 1]
- break
- case 49:
- yy.addVertex($$[$0]); this.$ = $$[$0]
- break
- case 66:
- this.$ = 'arrow'
- break
- case 67:
- this.$ = 'arrow_open'
- break
- }
- },
- table: [{3: 1, 4: 2, 6: 3, 11: [1, 4], 12: $V0, 13: $V1}, {1: [3]}, {5: [1, 7]}, {7: 8, 8: [1, 9], 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc}, {6: 23, 12: $V0, 13: $V1}, o($Vd, [2, 5]), o($Vd, [2, 6]), {1: [2, 1]}, {8: [1, 24]}, {7: 30, 8: $Ve, 9: 25, 12: $Vf, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: 26, 29: 27, 30: 28, 31: 29, 33: 31, 35: $Vg, 36: $Vh, 42: 32, 47: $Vi}, o([8, 10, 28, 32, 37, 39, 40, 45, 57, 58], [2, 7], {15: 38, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc}), o($Vj, [2, 8]), o($Vj, [2, 10]), o($Vj, [2, 11]), o($Vj, [2, 12]), o($Vj, [2, 13]), o($Vj, [2, 14]), o($Vj, [2, 15]), o($Vj, [2, 16]), o($Vj, [2, 17]), o($Vj, [2, 18]), o($Vj, [2, 19]), o($Vj, [2, 20]), {7: 39, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc}, {7: 30, 8: $Ve, 9: 40, 12: $Vf, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: 26, 29: 27, 30: 28, 31: 29, 33: 31, 35: $Vg, 36: $Vh, 42: 32, 47: $Vi}, {10: [1, 41]}, {10: [2, 21], 28: [1, 42]}, o($Vk, [2, 23]), o($Vk, [2, 24]), o($Vk, [2, 25]), o($Vl, $Vm, {44: 44, 32: [1, 43], 45: $Vn}), o($Vk, [2, 27], {41: 46, 43: 47, 57: $Vo, 58: $Vp}), o($Vk, [2, 47], {43: 47, 34: 50, 41: 51, 37: $Vq, 57: $Vo, 58: $Vp}), {34: 53, 37: $Vq}, {34: 54, 37: $Vq}, {34: 55, 37: $Vq}, {7: 56, 8: [1, 57], 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc}, {7: 30, 8: $Ve, 9: 58, 12: $Vf, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: 26, 29: 27, 30: 28, 31: 29, 33: 31, 35: $Vg, 36: $Vh, 42: 32, 47: $Vi}, o($Vj, [2, 9]), {8: [1, 59]}, {10: [1, 60]}, {5: [2, 4]}, {7: 30, 8: $Ve, 9: 61, 12: $Vf, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: 26, 29: 27, 30: 28, 31: 29, 33: 31, 35: $Vg, 36: $Vh, 42: 32, 47: $Vi}, {7: 62, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc}, o($Vl, [2, 48]), o($Vl, $Vr, {14: 10, 15: 11, 7: 63, 46: 64, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 48: $Vs, 49: $Vt, 50: $Vu, 51: $Vv, 52: $Vw, 53: $Vx, 54: $Vy, 55: $Vz, 56: $VA}), o($Vk, [2, 41], {34: 74, 37: $Vq}), {7: 77, 8: $Ve, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 33: 76, 42: 75, 47: $Vi}, o($VB, [2, 66]), o($VB, [2, 67]), o($Vk, [2, 46]), o($Vk, [2, 40], {34: 78, 37: $Vq}), {7: 81, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 38: 79, 39: [1, 80]}, o($Vk, [2, 28]), o($Vk, [2, 29]), o($Vk, [2, 30]), {8: [1, 82]}, {7: 30, 8: $Ve, 9: 83, 12: $Vf, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: 26, 29: 27, 30: 28, 31: 29, 33: 31, 35: $Vg, 36: $Vh, 42: 32, 47: $Vi}, {10: [1, 84]}, {7: 30, 8: $Ve, 9: 85, 12: $Vf, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: 26, 29: 27, 30: 28, 31: 29, 33: 31, 35: $Vg, 36: $Vh, 42: 32, 47: $Vi}, {5: [2, 2]}, {10: [2, 22]}, o($Vk, [2, 26]), o($Vl, [2, 51], {45: [1, 86]}), o($Vl, [2, 52]), o($Vl, [2, 56]), o($Vl, [2, 57]), o($Vl, [2, 58]), o($Vl, [2, 59]), o($Vl, [2, 60]), o($Vl, [2, 61]), o($Vl, [2, 62]), o($Vl, [2, 63]), o($Vl, [2, 64]), o($Vk, [2, 38]), o($VC, [2, 44], {43: 47, 41: 87, 57: $Vo, 58: $Vp}), o($VC, [2, 45], {43: 47, 41: 88, 57: $Vo, 58: $Vp}), o($Vl, $Vm, {44: 44, 45: $Vn}), o($Vk, [2, 39]), {39: [1, 89]}, o($Vk, [2, 34], {34: 90, 37: $Vq}), {32: [1, 91]}, {7: 30, 8: $Ve, 9: 92, 12: $Vf, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: 26, 29: 27, 30: 28, 31: 29, 33: 31, 35: $Vg, 36: $Vh, 42: 32, 47: $Vi}, {10: [1, 93]}, o($Vl, [2, 55]), {10: [1, 94]}, o($Vl, $Vr, {46: 95, 48: $Vs, 49: $Vt, 50: $Vu, 51: $Vv, 52: $Vw, 53: $Vx, 54: $Vy, 55: $Vz, 56: $VA}), o($VC, [2, 42]), o($VC, [2, 43]), o($Vk, [2, 33], {34: 96, 37: $Vq}), o($Vk, [2, 32]), {7: 97, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc}, {10: [1, 98]}, o($Vl, [2, 54]), {5: [2, 3]}, o($Vl, [2, 50]), o($Vk, [2, 31]), {28: [1, 99], 39: [2, 37], 40: [1, 100]}, o($Vl, [2, 53]), {7: 81, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 38: 101}, {7: 81, 14: 10, 15: 11, 16: $V2, 17: $V3, 18: $V4, 19: $V5, 20: $V6, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: $Vb, 26: $Vc, 38: 102}, {39: [2, 35]}, {39: [2, 36]}],
- defaultActions: {7: [2, 1], 41: [2, 4], 60: [2, 2], 61: [2, 22], 94: [2, 3], 101: [2, 35], 102: [2, 36]},
- parseError: function parseError (str, hash) {
- if (hash.recoverable) {
- this.trace(str)
- } else {
- function _parseError (msg, hash) {
- this.message = msg
- this.hash = hash
- }
- _parseError.prototype = Error
-
- throw new _parseError(str, hash)
- }
- },
- parse: function parse (input) {
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1
- var args = lstack.slice.call(arguments, 1)
- var lexer = Object.create(this.lexer)
- var sharedState = { yy: {} }
- for (var k in this.yy) {
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
- sharedState.yy[k] = this.yy[k]
- }
- }
- lexer.setInput(input, sharedState.yy)
- sharedState.yy.lexer = lexer
- sharedState.yy.parser = this
- if (typeof lexer.yylloc === 'undefined') {
- lexer.yylloc = {}
- }
- var yyloc = lexer.yylloc
- lstack.push(yyloc)
- var ranges = lexer.options && lexer.options.ranges
- if (typeof sharedState.yy.parseError === 'function') {
- this.parseError = sharedState.yy.parseError
- } else {
- this.parseError = Object.getPrototypeOf(this).parseError
- }
- function popStack (n) {
- stack.length = stack.length - 2 * n
- vstack.length = vstack.length - n
- lstack.length = lstack.length - n
- }
- var lex = function () {
- var token
- token = lexer.lex() || EOF
- if (typeof token !== 'number') {
- token = self.symbols_[token] || token
- }
- return token
- }
- var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected
- while (true) {
- state = stack[stack.length - 1]
- if (this.defaultActions[state]) {
- action = this.defaultActions[state]
- } else {
- if (symbol === null || typeof symbol === 'undefined') {
- symbol = lex()
- }
- action = table[state] && table[state][symbol]
- }
- if (typeof action === 'undefined' || !action.length || !action[0]) {
- var errStr = ''
- expected = []
- for (p in table[state]) {
- if (this.terminals_[p] && p > TERROR) {
- expected.push('\'' + this.terminals_[p] + '\'')
- }
- }
- if (lexer.showPosition) {
- errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''
- } else {
- errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'')
- }
- this.parseError(errStr, {
- text: lexer.match,
- token: this.terminals_[symbol] || symbol,
- line: lexer.yylineno,
- loc: yyloc,
- expected: expected
- })
- }
- if (action[0] instanceof Array && action.length > 1) {
- throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol)
- }
- switch (action[0]) {
- case 1:
- stack.push(symbol)
- vstack.push(lexer.yytext)
- lstack.push(lexer.yylloc)
- stack.push(action[1])
- symbol = null
- if (!preErrorSymbol) {
- yyleng = lexer.yyleng
- yytext = lexer.yytext
- yylineno = lexer.yylineno
- yyloc = lexer.yylloc
- if (recovering > 0) {
- recovering--
- }
- } else {
- symbol = preErrorSymbol
- preErrorSymbol = null
- }
- break
- case 2:
- len = this.productions_[action[1]][1]
- yyval.$ = vstack[vstack.length - len]
- yyval._$ = {
- first_line: lstack[lstack.length - (len || 1)].first_line,
- last_line: lstack[lstack.length - 1].last_line,
- first_column: lstack[lstack.length - (len || 1)].first_column,
- last_column: lstack[lstack.length - 1].last_column
- }
- if (ranges) {
- yyval._$.range = [
- lstack[lstack.length - (len || 1)].range[0],
- lstack[lstack.length - 1].range[1]
- ]
- }
- r = this.performAction.apply(yyval, [
- yytext,
- yyleng,
- yylineno,
- sharedState.yy,
- action[1],
- vstack,
- lstack
- ].concat(args))
- if (typeof r !== 'undefined') {
- return r
- }
- if (len) {
- stack = stack.slice(0, -1 * len * 2)
- vstack = vstack.slice(0, -1 * len)
- lstack = lstack.slice(0, -1 * len)
- }
- stack.push(this.productions_[action[1]][0])
- vstack.push(yyval.$)
- lstack.push(yyval._$)
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]]
- stack.push(newState)
- break
- case 3:
- return true
- }
- }
- return true
- }}
-
-/* generated by jison-lex 0.3.4 */
- var lexer = (function () {
- var lexer = ({
-
- EOF: 1,
-
- parseError: function parseError (str, hash) {
- if (this.yy.parser) {
- this.yy.parser.parseError(str, hash)
- } else {
- throw new Error(str)
- }
- },
-
-// resets the lexer, sets new input
- setInput: function (input, yy) {
- this.yy = yy || this.yy || {}
- this._input = input
- this._more = this._backtrack = this.done = false
- this.yylineno = this.yyleng = 0
- this.yytext = this.matched = this.match = ''
- this.conditionStack = ['INITIAL']
- this.yylloc = {
- first_line: 1,
- first_column: 0,
- last_line: 1,
- last_column: 0
- }
- if (this.options.ranges) {
- this.yylloc.range = [0, 0]
- }
- this.offset = 0
- return this
- },
-
-// consumes and returns one char from the input
- input: function () {
- var ch = this._input[0]
- this.yytext += ch
- this.yyleng++
- this.offset++
- this.match += ch
- this.matched += ch
- var lines = ch.match(/(?:\r\n?|\n).*/g)
- if (lines) {
- this.yylineno++
- this.yylloc.last_line++
- } else {
- this.yylloc.last_column++
- }
- if (this.options.ranges) {
- this.yylloc.range[1]++
- }
-
- this._input = this._input.slice(1)
- return ch
- },
-
-// unshifts one char (or a string) into the input
- unput: function (ch) {
- var len = ch.length
- var lines = ch.split(/(?:\r\n?|\n)/g)
-
- this._input = ch + this._input
- this.yytext = this.yytext.substr(0, this.yytext.length - len)
- // this.yyleng -= len;
- this.offset -= len
- var oldLines = this.match.split(/(?:\r\n?|\n)/g)
- this.match = this.match.substr(0, this.match.length - 1)
- this.matched = this.matched.substr(0, this.matched.length - 1)
-
- if (lines.length - 1) {
- this.yylineno -= lines.length - 1
- }
- var r = this.yylloc.range
-
- this.yylloc = {
- first_line: this.yylloc.first_line,
- last_line: this.yylineno + 1,
- first_column: this.yylloc.first_column,
- last_column: lines
- ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) +
- oldLines[oldLines.length - lines.length].length - lines[0].length
- : this.yylloc.first_column - len
- }
-
- if (this.options.ranges) {
- this.yylloc.range = [r[0], r[0] + this.yyleng - len]
- }
- this.yyleng = this.yytext.length
- return this
- },
-
-// When called from action, caches matched text and appends it on next action
- more: function () {
- this._more = true
- return this
- },
-
-// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
- reject: function () {
- if (this.options.backtrack_lexer) {
- this._backtrack = true
- } else {
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
- text: '',
- token: null,
- line: this.yylineno
- })
- }
- return this
- },
-
-// retain first n characters of the match
- less: function (n) {
- this.unput(this.match.slice(n))
- },
-
-// displays already matched input, i.e. for error messages
- pastInput: function () {
- var past = this.matched.substr(0, this.matched.length - this.match.length)
- return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '')
- },
-
-// displays upcoming input, i.e. for error messages
- upcomingInput: function () {
- var next = this.match
- if (next.length < 20) {
- next += this._input.substr(0, 20 - next.length)
- }
- return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '')
- },
-
-// displays the character position where the lexing error occurred, i.e. for error messages
- showPosition: function () {
- var pre = this.pastInput()
- var c = new Array(pre.length + 1).join('-')
- return pre + this.upcomingInput() + '\n' + c + '^'
- },
-
-// test the lexed token: return FALSE when not a match, otherwise return token
- test_match: function (match, indexed_rule) {
- var token,
- lines,
- backup
-
- if (this.options.backtrack_lexer) {
- // save context
- backup = {
- yylineno: this.yylineno,
- yylloc: {
- first_line: this.yylloc.first_line,
- last_line: this.last_line,
- first_column: this.yylloc.first_column,
- last_column: this.yylloc.last_column
- },
- yytext: this.yytext,
- match: this.match,
- matches: this.matches,
- matched: this.matched,
- yyleng: this.yyleng,
- offset: this.offset,
- _more: this._more,
- _input: this._input,
- yy: this.yy,
- conditionStack: this.conditionStack.slice(0),
- done: this.done
- }
- if (this.options.ranges) {
- backup.yylloc.range = this.yylloc.range.slice(0)
- }
- }
-
- lines = match[0].match(/(?:\r\n?|\n).*/g)
- if (lines) {
- this.yylineno += lines.length
- }
- this.yylloc = {
- first_line: this.yylloc.last_line,
- last_line: this.yylineno + 1,
- first_column: this.yylloc.last_column,
- last_column: lines
- ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length
- : this.yylloc.last_column + match[0].length
- }
- this.yytext += match[0]
- this.match += match[0]
- this.matches = match
- this.yyleng = this.yytext.length
- if (this.options.ranges) {
- this.yylloc.range = [this.offset, this.offset += this.yyleng]
- }
- this._more = false
- this._backtrack = false
- this._input = this._input.slice(match[0].length)
- this.matched += match[0]
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1])
- if (this.done && this._input) {
- this.done = false
- }
- if (token) {
- return token
- } else if (this._backtrack) {
- // recover context
- for (var k in backup) {
- this[k] = backup[k]
- }
- return false // rule action called reject() implying the next rule should be tested instead.
- }
- return false
- },
-
-// return next match in input
- next: function () {
- if (this.done) {
- return this.EOF
- }
- if (!this._input) {
- this.done = true
- }
-
- var token,
- match,
- tempMatch,
- index
- if (!this._more) {
- this.yytext = ''
- this.match = ''
- }
- var rules = this._currentRules()
- for (var i = 0; i < rules.length; i++) {
- tempMatch = this._input.match(this.rules[rules[i]])
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
- match = tempMatch
- index = i
- if (this.options.backtrack_lexer) {
- token = this.test_match(tempMatch, rules[i])
- if (token !== false) {
- return token
- } else if (this._backtrack) {
- match = false
- continue // rule action called reject() implying a rule MISmatch.
- } else {
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
- return false
- }
- } else if (!this.options.flex) {
- break
- }
- }
- }
- if (match) {
- token = this.test_match(match, rules[index])
- if (token !== false) {
- return token
- }
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
- return false
- }
- if (this._input === '') {
- return this.EOF
- } else {
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
- text: '',
- token: null,
- line: this.yylineno
- })
- }
- },
-
-// return next match that has a token
- lex: function lex () {
- var r = this.next()
- if (r) {
- return r
- } else {
- return this.lex()
- }
- },
-
-// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
- begin: function begin (condition) {
- this.conditionStack.push(condition)
- },
-
-// pop the previously active lexer condition state off the condition stack
- popState: function popState () {
- var n = this.conditionStack.length - 1
- if (n > 0) {
- return this.conditionStack.pop()
- } else {
- return this.conditionStack[0]
- }
- },
-
-// produce the lexer rule set which is active for the currently active lexer condition state
- _currentRules: function _currentRules () {
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules
- } else {
- return this.conditions['INITIAL'].rules
- }
- },
-
-// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
- topState: function topState (n) {
- n = this.conditionStack.length - 1 - Math.abs(n || 0)
- if (n >= 0) {
- return this.conditionStack[n]
- } else {
- return 'INITIAL'
- }
- },
-
-// alias for begin(condition)
- pushState: function pushState (condition) {
- this.begin(condition)
- },
-
-// return the number of states currently on the stack
- stateStackSize: function stateStackSize () {
- return this.conditionStack.length
- },
- options: {},
- performAction: function anonymous (yy, yy_, $avoiding_name_collisions, YY_START) {
- var YYSTATE = YY_START
- switch ($avoiding_name_collisions) {
- case 0:return 'STYLE'
- break
- case 1:return 'LINKSTYLE'
- break
- case 2:return 'CLASSDEF'
- break
- case 3:return 'CLASS'
- break
- case 4:return 'CLICK'
- break
- case 5:return 12
- break
- case 6:return 13
- break
- case 7:return 47
- break
- case 8:return 35
- break
- case 9:return 36
- break
- case 10:return 'DIR'
- break
- case 11:return 'DIR'
- break
- case 12:return 'DIR'
- break
- case 13:return 'DIR'
- break
- case 14:return 'DIR'
- break
- case 15:return 'DIR'
- break
- case 16:return 17
- break
- case 17:return 23
- break
- case 18:return 18
- break
- case 19:return 28
- break
- case 20:return 40
- break
- case 21:return 32
- break
- case 22:return 21
- break
- case 23:return 22
- break
- case 24:return 'ARROW_CROSS'
- break
- case 25:return 57
- break
- case 26:return 'ARROW_CIRCLE'
- break
- case 27:return 58
- break
- case 28:return 25
- break
- case 29:return 19
- break
- case 30:return 20
- break
- case 31:return 16
- break
- case 32:return 'PIPE'
- break
- case 33:return 'PS'
- break
- case 34:return 'PE'
- break
- case 35:return 37
- break
- case 36:return 39
- break
- case 37:return 8
- break
- case 38:return 10
- break
- case 39:return 'QUOTE'
- break
- case 40:return 24
- break
- case 41:return 'NEWLINE'
- break
- case 42:return 5
- break
- }
- },
- rules: [/^(?:style\b)/, /^(?:linkStyle\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:click\b)/, /^(?:graph\b)/, /^(?:digraph\b)/, /^(?:subgraph\b)/, /^(?:node\b)/, /^(?:edge\b)/, /^(?:LR\b)/, /^(?:RL\b)/, /^(?:TB\b)/, /^(?:BT\b)/, /^(?:TD\b)/, /^(?:BR\b)/, /^(?:[0-9])/, /^(?:#)/, /^(?::)/, /^(?:;)/, /^(?:,)/, /^(?:=)/, /^(?:\*)/, /^(?:\.)/, /^(?:--[x])/, /^(?:->)/, /^(?:--[o])/, /^(?:--)/, /^(?:-)/, /^(?:\+)/, /^(?:=)/, /^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC_])/, /^(?:\|)/, /^(?:\()/, /^(?:\))/, /^(?:\[)/, /^(?:\])/, /^(?:\{)/, /^(?:\})/, /^(?:")/, /^(?:\s)/, /^(?:\n)/, /^(?:$)/],
- conditions: {'INITIAL': {'rules': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], 'inclusive': true}}
- })
- return lexer
- })()
- parser.lexer = lexer
- function Parser () {
- this.yy = {}
- }
- Parser.prototype = parser; parser.Parser = Parser
- return new Parser()
-})()
-
-if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
- exports.parser = parser
- exports.Parser = parser.Parser
- exports.parse = function () { return parser.parse.apply(parser, arguments) }
- exports.main = function commonjsMain (args) {
- if (!args[1]) {
- console.log('Usage: ' + args[0] + ' FILE')
- process.exit(1)
- }
- var source = require('fs').readFileSync(require('path').normalize(args[1]), 'utf8')
- return exports.parser.parse(source)
- }
- if (typeof module !== 'undefined' && require.main === module) {
- exports.main(process.argv.slice(1))
- }
-}
-
-}).call(this,require('_process'))
-},{"_process":406,"fs":7,"path":405}],389:[function(require,module,exports){
-(function (process){
-/* parser generated by jison 0.4.17 */
-/*
- Returns a Parser object of the following structure:
-
- Parser: {
- yy: {}
- }
-
- Parser.prototype: {
- yy: {},
- trace: function(),
- symbols_: {associative list: name ==> number},
- terminals_: {associative list: number ==> name},
- productions_: [...],
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
- table: [...],
- defaultActions: {...},
- parseError: function(str, hash),
- parse: function(input),
-
- lexer: {
- EOF: 1,
- parseError: function(str, hash),
- setInput: function(input),
- input: function(),
- unput: function(str),
- more: function(),
- less: function(n),
- pastInput: function(),
- upcomingInput: function(),
- showPosition: function(),
- test_match: function(regex_match_array, rule_index),
- next: function(),
- lex: function(),
- begin: function(condition),
- popState: function(),
- _currentRules: function(),
- topState: function(),
- pushState: function(condition),
-
- options: {
- ranges: boolean (optional: true ==> token location info will include a .range[] member)
- flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
- backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
- },
-
- performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
- rules: [...],
- conditions: {associative list: name ==> set},
- }
- }
-
- token location info (@$, _$, etc.): {
- first_line: n,
- last_line: n,
- first_column: n,
- last_column: n,
- range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
- }
-
- the parseError function receives a 'hash' object with these members for lexer and parser errors: {
- text: (matched text)
- token: (the produced terminal token, if any)
- line: (yylineno)
- }
- while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
- loc: (yylloc)
- expected: (string describing the set of expected tokens)
- recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
- }
-*/
-var parser = (function () {
- var o = function (k, v, o, l) { for (o = o || {}, l = k.length; l--; o[k[l]] = v);return o }, $V0 = [1, 4], $V1 = [1, 3], $V2 = [1, 5], $V3 = [1, 8, 9, 10, 11, 13, 18, 30, 46, 71, 72, 73, 74, 75, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98], $V4 = [2, 2], $V5 = [1, 12], $V6 = [1, 13], $V7 = [1, 14], $V8 = [1, 15], $V9 = [1, 31], $Va = [1, 33], $Vb = [1, 22], $Vc = [1, 34], $Vd = [1, 24], $Ve = [1, 25], $Vf = [1, 26], $Vg = [1, 27], $Vh = [1, 28], $Vi = [1, 38], $Vj = [1, 40], $Vk = [1, 35], $Vl = [1, 39], $Vm = [1, 45], $Vn = [1, 44], $Vo = [1, 36], $Vp = [1, 37], $Vq = [1, 41], $Vr = [1, 42], $Vs = [1, 43], $Vt = [1, 8, 9, 10, 11, 13, 18, 30, 32, 46, 71, 72, 73, 74, 75, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98], $Vu = [1, 53], $Vv = [1, 52], $Vw = [1, 54], $Vx = [1, 72], $Vy = [1, 80], $Vz = [1, 81], $VA = [1, 66], $VB = [1, 65], $VC = [1, 85], $VD = [1, 84], $VE = [1, 82], $VF = [1, 83], $VG = [1, 73], $VH = [1, 68], $VI = [1, 67], $VJ = [1, 63], $VK = [1, 75], $VL = [1, 76], $VM = [1, 77], $VN = [1, 78], $VO = [1, 79], $VP = [1, 70], $VQ = [1, 69], $VR = [8, 9, 11], $VS = [8, 9, 11, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64], $VT = [1, 115], $VU = [8, 9, 10, 11, 13, 15, 18, 36, 38, 40, 42, 46, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98], $VV = [8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 30, 32, 36, 37, 38, 39, 40, 41, 42, 43, 46, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 71, 72, 73, 74, 75, 78, 81, 84, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98], $VW = [1, 117], $VX = [1, 118], $VY = [8, 9, 10, 11, 13, 18, 30, 32, 46, 71, 72, 73, 74, 75, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98], $VZ = [8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 30, 32, 37, 39, 41, 43, 46, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 71, 72, 73, 74, 75, 78, 81, 84, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98], $V_ = [13, 18, 46, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98], $V$ = [13, 18, 46, 49, 65, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98], $V01 = [1, 191], $V11 = [1, 188], $V21 = [1, 195], $V31 = [1, 192], $V41 = [1, 189], $V51 = [1, 196], $V61 = [1, 186], $V71 = [1, 187], $V81 = [1, 190], $V91 = [1, 193], $Va1 = [1, 194], $Vb1 = [1, 213], $Vc1 = [8, 9, 11, 86], $Vd1 = [8, 9, 10, 11, 46, 71, 80, 81, 84, 86, 88, 89, 90, 91, 92]
- var parser = {trace: function trace () { },
- yy: {},
- symbols_: {'error': 2, 'mermaidDoc': 3, 'graphConfig': 4, 'document': 5, 'line': 6, 'statement': 7, 'SEMI': 8, 'NEWLINE': 9, 'SPACE': 10, 'EOF': 11, 'GRAPH': 12, 'DIR': 13, 'FirstStmtSeperator': 14, 'TAGEND': 15, 'TAGSTART': 16, 'UP': 17, 'DOWN': 18, 'ending': 19, 'endToken': 20, 'spaceList': 21, 'spaceListNewline': 22, 'verticeStatement': 23, 'separator': 24, 'styleStatement': 25, 'linkStyleStatement': 26, 'classDefStatement': 27, 'classStatement': 28, 'clickStatement': 29, 'subgraph': 30, 'text': 31, 'end': 32, 'vertex': 33, 'link': 34, 'alphaNum': 35, 'SQS': 36, 'SQE': 37, 'PS': 38, 'PE': 39, '(-': 40, '-)': 41, 'DIAMOND_START': 42, 'DIAMOND_STOP': 43, 'alphaNumStatement': 44, 'alphaNumToken': 45, 'MINUS': 46, 'linkStatement': 47, 'arrowText': 48, 'TESTSTR': 49, '--': 50, 'ARROW_POINT': 51, 'ARROW_CIRCLE': 52, 'ARROW_CROSS': 53, 'ARROW_OPEN': 54, '-.': 55, 'DOTTED_ARROW_POINT': 56, 'DOTTED_ARROW_CIRCLE': 57, 'DOTTED_ARROW_CROSS': 58, 'DOTTED_ARROW_OPEN': 59, '==': 60, 'THICK_ARROW_POINT': 61, 'THICK_ARROW_CIRCLE': 62, 'THICK_ARROW_CROSS': 63, 'THICK_ARROW_OPEN': 64, 'PIPE': 65, 'textToken': 66, 'STR': 67, 'commentText': 68, 'commentToken': 69, 'keywords': 70, 'STYLE': 71, 'LINKSTYLE': 72, 'CLASSDEF': 73, 'CLASS': 74, 'CLICK': 75, 'textNoTags': 76, 'textNoTagsToken': 77, 'DEFAULT': 78, 'stylesOpt': 79, 'HEX': 80, 'NUM': 81, 'INTERPOLATE': 82, 'commentStatement': 83, 'PCT': 84, 'style': 85, 'COMMA': 86, 'styleComponent': 87, 'ALPHA': 88, 'COLON': 89, 'UNIT': 90, 'BRKT': 91, 'DOT': 92, 'graphCodeTokens': 93, 'PUNCTUATION': 94, 'UNICODE_TEXT': 95, 'PLUS': 96, 'EQUALS': 97, 'MULT': 98, 'TAG_START': 99, 'TAG_END': 100, 'QUOTE': 101, '$accept': 0, '$end': 1},
- terminals_: {2: 'error', 8: 'SEMI', 9: 'NEWLINE', 10: 'SPACE', 11: 'EOF', 12: 'GRAPH', 13: 'DIR', 15: 'TAGEND', 16: 'TAGSTART', 17: 'UP', 18: 'DOWN', 30: 'subgraph', 32: 'end', 36: 'SQS', 37: 'SQE', 38: 'PS', 39: 'PE', 40: '(-', 41: '-)', 42: 'DIAMOND_START', 43: 'DIAMOND_STOP', 46: 'MINUS', 49: 'TESTSTR', 50: '--', 51: 'ARROW_POINT', 52: 'ARROW_CIRCLE', 53: 'ARROW_CROSS', 54: 'ARROW_OPEN', 55: '-.', 56: 'DOTTED_ARROW_POINT', 57: 'DOTTED_ARROW_CIRCLE', 58: 'DOTTED_ARROW_CROSS', 59: 'DOTTED_ARROW_OPEN', 60: '==', 61: 'THICK_ARROW_POINT', 62: 'THICK_ARROW_CIRCLE', 63: 'THICK_ARROW_CROSS', 64: 'THICK_ARROW_OPEN', 65: 'PIPE', 67: 'STR', 71: 'STYLE', 72: 'LINKSTYLE', 73: 'CLASSDEF', 74: 'CLASS', 75: 'CLICK', 78: 'DEFAULT', 80: 'HEX', 81: 'NUM', 82: 'INTERPOLATE', 84: 'PCT', 86: 'COMMA', 88: 'ALPHA', 89: 'COLON', 90: 'UNIT', 91: 'BRKT', 92: 'DOT', 94: 'PUNCTUATION', 95: 'UNICODE_TEXT', 96: 'PLUS', 97: 'EQUALS', 98: 'MULT', 99: 'TAG_START', 100: 'TAG_END', 101: 'QUOTE'},
- productions_: [0, [3, 2], [5, 0], [5, 2], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [4, 2], [4, 2], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [19, 2], [19, 1], [20, 1], [20, 1], [20, 1], [14, 1], [14, 1], [14, 2], [22, 2], [22, 2], [22, 1], [22, 1], [21, 2], [21, 1], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 5], [7, 4], [24, 1], [24, 1], [24, 1], [23, 3], [23, 1], [33, 4], [33, 5], [33, 6], [33, 7], [33, 4], [33, 5], [33, 4], [33, 5], [33, 4], [33, 5], [33, 4], [33, 5], [33, 1], [33, 2], [35, 1], [35, 2], [44, 1], [44, 1], [44, 1], [44, 1], [34, 2], [34, 3], [34, 3], [34, 1], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [34, 3], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [47, 1], [48, 3], [31, 1], [31, 2], [31, 1], [68, 1], [68, 2], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [70, 1], [76, 1], [76, 2], [27, 5], [27, 5], [28, 5], [29, 5], [29, 7], [29, 5], [29, 7], [25, 5], [25, 5], [26, 5], [26, 5], [26, 9], [26, 9], [26, 7], [26, 7], [83, 3], [79, 1], [79, 3], [85, 1], [85, 2], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [69, 1], [69, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [77, 1], [77, 1], [77, 1], [77, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1], [93, 1]],
- performAction: function anonymous (yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
-/* this == yyval */
-
- var $0 = $$.length - 1
- switch (yystate) {
- case 2:
- this.$ = []
- break
- case 3:
-
- if ($$[$0] !== []) {
- $$[$0 - 1].push($$[$0])
- }
- this.$ = $$[$0 - 1]
- break
- case 4: case 57: case 59: case 60: case 92: case 94: case 95: case 108:
- this.$ = $$[$0]
- break
- case 11:
- yy.setDirection($$[$0 - 1]); this.$ = $$[$0 - 1]
- break
- case 12:
- yy.setDirection('LR'); this.$ = $$[$0 - 1]
- break
- case 13:
- yy.setDirection('RL'); this.$ = $$[$0 - 1]
- break
- case 14:
- yy.setDirection('BT'); this.$ = $$[$0 - 1]
- break
- case 15:
- yy.setDirection('TB'); this.$ = $$[$0 - 1]
- break
- case 30:
- this.$ = $$[$0 - 1]
- break
- case 31: case 32: case 33: case 34: case 35:
- this.$ = []
- break
- case 36:
- this.$ = yy.addSubGraph($$[$0 - 1], $$[$0 - 3])
- break
- case 37:
- this.$ = yy.addSubGraph($$[$0 - 1], undefined)
- break
- case 41:
- yy.addLink($$[$0 - 2], $$[$0], $$[$0 - 1]); this.$ = [$$[$0 - 2], $$[$0]]
- break
- case 42:
- this.$ = [$$[$0]]
- break
- case 43:
- this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], 'square')
- break
- case 44:
- this.$ = $$[$0 - 4]; yy.addVertex($$[$0 - 4], $$[$0 - 2], 'square')
- break
- case 45:
- this.$ = $$[$0 - 5]; yy.addVertex($$[$0 - 5], $$[$0 - 2], 'circle')
- break
- case 46:
- this.$ = $$[$0 - 6]; yy.addVertex($$[$0 - 6], $$[$0 - 3], 'circle')
- break
- case 47:
- this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], 'ellipse')
- break
- case 48:
- this.$ = $$[$0 - 4]; yy.addVertex($$[$0 - 4], $$[$0 - 2], 'ellipse')
- break
- case 49:
- this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], 'round')
- break
- case 50:
- this.$ = $$[$0 - 4]; yy.addVertex($$[$0 - 4], $$[$0 - 2], 'round')
- break
- case 51:
- this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], 'diamond')
- break
- case 52:
- this.$ = $$[$0 - 4]; yy.addVertex($$[$0 - 4], $$[$0 - 2], 'diamond')
- break
- case 53:
- this.$ = $$[$0 - 3]; yy.addVertex($$[$0 - 3], $$[$0 - 1], 'odd')
- break
- case 54:
- this.$ = $$[$0 - 4]; yy.addVertex($$[$0 - 4], $$[$0 - 2], 'odd')
- break
- case 55:
- this.$ = $$[$0]; yy.addVertex($$[$0])
- break
- case 56:
- this.$ = $$[$0 - 1]; yy.addVertex($$[$0 - 1])
- break
- case 58: case 93: case 96: case 109:
- this.$ = $$[$0 - 1] + '' + $$[$0]
- break
- case 61:
- this.$ = 'v'
- break
- case 62:
- this.$ = '-'
- break
- case 63:
- $$[$0 - 1].text = $$[$0]; this.$ = $$[$0 - 1]
- break
- case 64: case 65:
- $$[$0 - 2].text = $$[$0 - 1]; this.$ = $$[$0 - 2]
- break
- case 66:
- this.$ = $$[$0]
- break
- case 67:
- this.$ = {'type': 'arrow', 'stroke': 'normal', 'text': $$[$0 - 1]}
- break
- case 68:
- this.$ = {'type': 'arrow_circle', 'stroke': 'normal', 'text': $$[$0 - 1]}
- break
- case 69:
- this.$ = {'type': 'arrow_cross', 'stroke': 'normal', 'text': $$[$0 - 1]}
- break
- case 70:
- this.$ = {'type': 'arrow_open', 'stroke': 'normal', 'text': $$[$0 - 1]}
- break
- case 71:
- this.$ = {'type': 'arrow', 'stroke': 'dotted', 'text': $$[$0 - 1]}
- break
- case 72:
- this.$ = {'type': 'arrow_circle', 'stroke': 'dotted', 'text': $$[$0 - 1]}
- break
- case 73:
- this.$ = {'type': 'arrow_cross', 'stroke': 'dotted', 'text': $$[$0 - 1]}
- break
- case 74:
- this.$ = {'type': 'arrow_open', 'stroke': 'dotted', 'text': $$[$0 - 1]}
- break
- case 75:
- this.$ = {'type': 'arrow', 'stroke': 'thick', 'text': $$[$0 - 1]}
- break
- case 76:
- this.$ = {'type': 'arrow_circle', 'stroke': 'thick', 'text': $$[$0 - 1]}
- break
- case 77:
- this.$ = {'type': 'arrow_cross', 'stroke': 'thick', 'text': $$[$0 - 1]}
- break
- case 78:
- this.$ = {'type': 'arrow_open', 'stroke': 'thick', 'text': $$[$0 - 1]}
- break
- case 79:
- this.$ = {'type': 'arrow', 'stroke': 'normal'}
- break
- case 80:
- this.$ = {'type': 'arrow_circle', 'stroke': 'normal'}
- break
- case 81:
- this.$ = {'type': 'arrow_cross', 'stroke': 'normal'}
- break
- case 82:
- this.$ = {'type': 'arrow_open', 'stroke': 'normal'}
- break
- case 83:
- this.$ = {'type': 'arrow', 'stroke': 'dotted'}
- break
- case 84:
- this.$ = {'type': 'arrow_circle', 'stroke': 'dotted'}
- break
- case 85:
- this.$ = {'type': 'arrow_cross', 'stroke': 'dotted'}
- break
- case 86:
- this.$ = {'type': 'arrow_open', 'stroke': 'dotted'}
- break
- case 87:
- this.$ = {'type': 'arrow', 'stroke': 'thick'}
- break
- case 88:
- this.$ = {'type': 'arrow_circle', 'stroke': 'thick'}
- break
- case 89:
- this.$ = {'type': 'arrow_cross', 'stroke': 'thick'}
- break
- case 90:
- this.$ = {'type': 'arrow_open', 'stroke': 'thick'}
- break
- case 91:
- this.$ = $$[$0 - 1]
- break
- case 110: case 111:
- this.$ = $$[$0 - 4]; yy.addClass($$[$0 - 2], $$[$0])
- break
- case 112:
- this.$ = $$[$0 - 4]; yy.setClass($$[$0 - 2], $$[$0])
- break
- case 113:
- this.$ = $$[$0 - 4]; yy.setClickEvent($$[$0 - 2], $$[$0], undefined, undefined)
- break
- case 114:
- this.$ = $$[$0 - 6]; yy.setClickEvent($$[$0 - 4], $$[$0 - 2], undefined, $$[$0])
- break
- case 115:
- this.$ = $$[$0 - 4]; yy.setClickEvent($$[$0 - 2], undefined, $$[$0], undefined)
- break
- case 116:
- this.$ = $$[$0 - 6]; yy.setClickEvent($$[$0 - 4], undefined, $$[$0 - 2], $$[$0])
- break
- case 117:
- this.$ = $$[$0 - 4]; yy.addVertex($$[$0 - 2], undefined, undefined, $$[$0])
- break
- case 118: case 119: case 120:
- this.$ = $$[$0 - 4]; yy.updateLink($$[$0 - 2], $$[$0])
- break
- case 121: case 122:
- this.$ = $$[$0 - 8]; yy.updateLinkInterpolate($$[$0 - 6], $$[$0 - 2]); yy.updateLink($$[$0 - 6], $$[$0])
- break
- case 123: case 124:
- this.$ = $$[$0 - 6]; yy.updateLinkInterpolate($$[$0 - 4], $$[$0])
- break
- case 126:
- this.$ = [$$[$0]]
- break
- case 127:
- $$[$0 - 2].push($$[$0]); this.$ = $$[$0 - 2]
- break
- case 129:
- this.$ = $$[$0 - 1] + $$[$0]
- break
- }
- },
- table: [{3: 1, 4: 2, 9: $V0, 10: $V1, 12: $V2}, {1: [3]}, o($V3, $V4, {5: 6}), {4: 7, 9: $V0, 10: $V1, 12: $V2}, {4: 8, 9: $V0, 10: $V1, 12: $V2}, {10: [1, 9]}, {1: [2, 1], 6: 10, 7: 11, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 13: $V9, 18: $Va, 23: 16, 25: 17, 26: 18, 27: 19, 28: 20, 29: 21, 30: $Vb, 33: 23, 35: 29, 44: 30, 45: 32, 46: $Vc, 71: $Vd, 72: $Ve, 73: $Vf, 74: $Vg, 75: $Vh, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, o($V3, [2, 9]), o($V3, [2, 10]), {13: [1, 46], 15: [1, 47], 16: [1, 48], 17: [1, 49], 18: [1, 50]}, o($Vt, [2, 3]), o($Vt, [2, 4]), o($Vt, [2, 5]), o($Vt, [2, 6]), o($Vt, [2, 7]), o($Vt, [2, 8]), {8: $Vu, 9: $Vv, 11: $Vw, 24: 51}, {8: $Vu, 9: $Vv, 11: $Vw, 24: 55}, {8: $Vu, 9: $Vv, 11: $Vw, 24: 56}, {8: $Vu, 9: $Vv, 11: $Vw, 24: 57}, {8: $Vu, 9: $Vv, 11: $Vw, 24: 58}, {8: $Vu, 9: $Vv, 11: $Vw, 24: 59}, {8: $Vu, 9: $Vv, 10: $Vx, 11: $Vw, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 24: 61, 30: $VE, 31: 60, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, o($VR, [2, 42], {34: 86, 47: 87, 50: [1, 88], 51: [1, 91], 52: [1, 92], 53: [1, 93], 54: [1, 94], 55: [1, 89], 56: [1, 95], 57: [1, 96], 58: [1, 97], 59: [1, 98], 60: [1, 90], 61: [1, 99], 62: [1, 100], 63: [1, 101], 64: [1, 102]}), {10: [1, 103]}, {10: [1, 104]}, {10: [1, 105]}, {10: [1, 106]}, {10: [1, 107]}, o($VS, [2, 55], {45: 32, 21: 113, 44: 114, 10: $VT, 13: $V9, 15: [1, 112], 18: $Va, 36: [1, 108], 38: [1, 109], 40: [1, 110], 42: [1, 111], 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}), o($VU, [2, 57]), o($VU, [2, 59]), o($VU, [2, 60]), o($VU, [2, 61]), o($VU, [2, 62]), o($VV, [2, 154]), o($VV, [2, 155]), o($VV, [2, 156]), o($VV, [2, 157]), o($VV, [2, 158]), o($VV, [2, 159]), o($VV, [2, 160]), o($VV, [2, 161]), o($VV, [2, 162]), o($VV, [2, 163]), o($VV, [2, 164]), {8: $VW, 9: $VX, 10: $VT, 14: 116, 21: 119}, {8: $VW, 9: $VX, 10: $VT, 14: 120, 21: 119}, {8: $VW, 9: $VX, 10: $VT, 14: 121, 21: 119}, {8: $VW, 9: $VX, 10: $VT, 14: 122, 21: 119}, {8: $VW, 9: $VX, 10: $VT, 14: 123, 21: 119}, o($Vt, [2, 30]), o($Vt, [2, 38]), o($Vt, [2, 39]), o($Vt, [2, 40]), o($Vt, [2, 31]), o($Vt, [2, 32]), o($Vt, [2, 33]), o($Vt, [2, 34]), o($Vt, [2, 35]), {8: $Vu, 9: $Vv, 10: $Vx, 11: $Vw, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 24: 124, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, o($VY, $V4, {5: 126}), o($VZ, [2, 92]), o($VZ, [2, 94]), o($VZ, [2, 143]), o($VZ, [2, 144]), o($VZ, [2, 145]), o($VZ, [2, 146]), o($VZ, [2, 147]), o($VZ, [2, 148]), o($VZ, [2, 149]), o($VZ, [2, 150]), o($VZ, [2, 151]), o($VZ, [2, 152]), o($VZ, [2, 153]), o($VZ, [2, 97]), o($VZ, [2, 98]), o($VZ, [2, 99]), o($VZ, [2, 100]), o($VZ, [2, 101]), o($VZ, [2, 102]), o($VZ, [2, 103]), o($VZ, [2, 104]), o($VZ, [2, 105]), o($VZ, [2, 106]), o($VZ, [2, 107]), {13: $V9, 18: $Va, 33: 127, 35: 29, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, o($V_, [2, 66], {48: 128, 49: [1, 129], 65: [1, 130]}), {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 131, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 132, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 133, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, o($V$, [2, 79]), o($V$, [2, 80]), o($V$, [2, 81]), o($V$, [2, 82]), o($V$, [2, 83]), o($V$, [2, 84]), o($V$, [2, 85]), o($V$, [2, 86]), o($V$, [2, 87]), o($V$, [2, 88]), o($V$, [2, 89]), o($V$, [2, 90]), {13: $V9, 18: $Va, 35: 134, 44: 30, 45: 32, 46: $Vc, 80: [1, 135], 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {78: [1, 136], 81: [1, 137]}, {13: $V9, 18: $Va, 35: 139, 44: 30, 45: 32, 46: $Vc, 78: [1, 138], 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {13: $V9, 18: $Va, 35: 140, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {13: $V9, 18: $Va, 35: 141, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 142, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 144, 32: $VF, 38: [1, 143], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 145, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 146, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 147, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, o($VS, [2, 56]), o($VU, [2, 58]), o($VS, [2, 29], {21: 148, 10: $VT}), o($V3, [2, 11]), o($V3, [2, 21]), o($V3, [2, 22]), {9: [1, 149]}, o($V3, [2, 12]), o($V3, [2, 13]), o($V3, [2, 14]), o($V3, [2, 15]), o($VY, $V4, {5: 150}), o($VZ, [2, 93]), {6: 10, 7: 11, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 13: $V9, 18: $Va, 23: 16, 25: 17, 26: 18, 27: 19, 28: 20, 29: 21, 30: $Vb, 32: [1, 151], 33: 23, 35: 29, 44: 30, 45: 32, 46: $Vc, 71: $Vd, 72: $Ve, 73: $Vf, 74: $Vg, 75: $Vh, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, o($VR, [2, 41]), o($V_, [2, 63], {10: [1, 152]}), {10: [1, 153]}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 154, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 51: [1, 155], 52: [1, 156], 53: [1, 157], 54: [1, 158], 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 56: [1, 159], 57: [1, 160], 58: [1, 161], 59: [1, 162], 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 61: [1, 163], 62: [1, 164], 63: [1, 165], 64: [1, 166], 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: [1, 167], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: [1, 168]}, {10: [1, 169]}, {10: [1, 170]}, {10: [1, 171]}, {10: [1, 172], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: [1, 173], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: [1, 174], 13: $V9, 18: $Va, 44: 114, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 37: [1, 175], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 31: 176, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 62, 67: $VJ, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 39: [1, 177], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 41: [1, 178], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 43: [1, 179], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 37: [1, 180], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, o($VS, [2, 28]), o($V3, [2, 23]), {6: 10, 7: 11, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 13: $V9, 18: $Va, 23: 16, 25: 17, 26: 18, 27: 19, 28: 20, 29: 21, 30: $Vb, 32: [1, 181], 33: 23, 35: 29, 44: 30, 45: 32, 46: $Vc, 71: $Vd, 72: $Ve, 73: $Vf, 74: $Vg, 75: $Vh, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, o($Vt, [2, 37]), o($V_, [2, 65]), o($V_, [2, 64]), {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 45: 71, 46: $VG, 50: $VH, 60: $VI, 65: [1, 182], 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, o($V_, [2, 67]), o($V_, [2, 68]), o($V_, [2, 69]), o($V_, [2, 70]), o($V_, [2, 71]), o($V_, [2, 72]), o($V_, [2, 73]), o($V_, [2, 74]), o($V_, [2, 75]), o($V_, [2, 76]), o($V_, [2, 77]), o($V_, [2, 78]), {10: $V01, 46: $V11, 71: $V21, 79: 183, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1}, {10: $V01, 46: $V11, 71: $V21, 79: 197, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1}, {10: $V01, 46: $V11, 71: $V21, 79: 198, 80: $V31, 81: $V41, 82: [1, 199], 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1}, {10: $V01, 46: $V11, 71: $V21, 79: 200, 80: $V31, 81: $V41, 82: [1, 201], 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1}, {10: $V01, 46: $V11, 71: $V21, 79: 202, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1}, {10: $V01, 46: $V11, 71: $V21, 79: 203, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1}, {13: $V9, 18: $Va, 35: 204, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {13: $V9, 18: $Va, 35: 205, 44: 30, 45: 32, 46: $Vc, 67: [1, 206], 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, o($VS, [2, 43], {21: 207, 10: $VT}), {10: $Vx, 12: $Vy, 13: $Vz, 15: $VA, 16: $VB, 17: $VC, 18: $VD, 30: $VE, 32: $VF, 39: [1, 208], 45: 71, 46: $VG, 50: $VH, 60: $VI, 66: 125, 70: 74, 71: $VK, 72: $VL, 73: $VM, 74: $VN, 75: $VO, 77: 64, 78: $VP, 81: $Vi, 84: $VQ, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, o($VS, [2, 49], {21: 209, 10: $VT}), o($VS, [2, 47], {21: 210, 10: $VT}), o($VS, [2, 51], {21: 211, 10: $VT}), o($VS, [2, 53], {21: 212, 10: $VT}), o($Vt, [2, 36]), o([10, 13, 18, 46, 81, 86, 88, 89, 91, 92, 94, 95, 96, 97, 98], [2, 91]), o($VR, [2, 117], {86: $Vb1}), o($Vc1, [2, 126], {87: 214, 10: $V01, 46: $V11, 71: $V21, 80: $V31, 81: $V41, 84: $V51, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1}), o($Vd1, [2, 128]), o($Vd1, [2, 130]), o($Vd1, [2, 131]), o($Vd1, [2, 132]), o($Vd1, [2, 133]), o($Vd1, [2, 134]), o($Vd1, [2, 135]), o($Vd1, [2, 136]), o($Vd1, [2, 137]), o($Vd1, [2, 138]), o($Vd1, [2, 139]), o($Vd1, [2, 140]), o($VR, [2, 118], {86: $Vb1}), o($VR, [2, 119], {86: $Vb1}), {10: [1, 215]}, o($VR, [2, 120], {86: $Vb1}), {10: [1, 216]}, o($VR, [2, 110], {86: $Vb1}), o($VR, [2, 111], {86: $Vb1}), o($VR, [2, 112], {45: 32, 44: 114, 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}), o($VR, [2, 113], {45: 32, 44: 114, 10: [1, 217], 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}), o($VR, [2, 115], {10: [1, 218]}), o($VS, [2, 44]), {39: [1, 219]}, o($VS, [2, 50]), o($VS, [2, 48]), o($VS, [2, 52]), o($VS, [2, 54]), {10: $V01, 46: $V11, 71: $V21, 80: $V31, 81: $V41, 84: $V51, 85: 220, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1}, o($Vd1, [2, 129]), {13: $V9, 18: $Va, 35: 221, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {13: $V9, 18: $Va, 35: 222, 44: 30, 45: 32, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}, {67: [1, 223]}, {67: [1, 224]}, o($VS, [2, 45], {21: 225, 10: $VT}), o($Vc1, [2, 127], {87: 214, 10: $V01, 46: $V11, 71: $V21, 80: $V31, 81: $V41, 84: $V51, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1}), o($VR, [2, 123], {45: 32, 44: 114, 10: [1, 226], 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}), o($VR, [2, 124], {45: 32, 44: 114, 10: [1, 227], 13: $V9, 18: $Va, 46: $Vc, 81: $Vi, 86: $Vj, 88: $Vk, 89: $Vl, 91: $Vm, 92: $Vn, 94: $Vo, 95: $Vp, 96: $Vq, 97: $Vr, 98: $Vs}), o($VR, [2, 114]), o($VR, [2, 116]), o($VS, [2, 46]), {10: $V01, 46: $V11, 71: $V21, 79: 228, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1}, {10: $V01, 46: $V11, 71: $V21, 79: 229, 80: $V31, 81: $V41, 84: $V51, 85: 184, 87: 185, 88: $V61, 89: $V71, 90: $V81, 91: $V91, 92: $Va1}, o($VR, [2, 121], {86: $Vb1}), o($VR, [2, 122], {86: $Vb1})],
- defaultActions: {},
- parseError: function parseError (str, hash) {
- if (hash.recoverable) {
- this.trace(str)
- } else {
- function _parseError (msg, hash) {
- this.message = msg
- this.hash = hash
- }
- _parseError.prototype = Error
-
- throw new _parseError(str, hash)
- }
- },
- parse: function parse (input) {
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1
- var args = lstack.slice.call(arguments, 1)
- var lexer = Object.create(this.lexer)
- var sharedState = { yy: {} }
- for (var k in this.yy) {
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
- sharedState.yy[k] = this.yy[k]
- }
- }
- lexer.setInput(input, sharedState.yy)
- sharedState.yy.lexer = lexer
- sharedState.yy.parser = this
- if (typeof lexer.yylloc === 'undefined') {
- lexer.yylloc = {}
- }
- var yyloc = lexer.yylloc
- lstack.push(yyloc)
- var ranges = lexer.options && lexer.options.ranges
- if (typeof sharedState.yy.parseError === 'function') {
- this.parseError = sharedState.yy.parseError
- } else {
- this.parseError = Object.getPrototypeOf(this).parseError
- }
- function popStack (n) {
- stack.length = stack.length - 2 * n
- vstack.length = vstack.length - n
- lstack.length = lstack.length - n
- }
- var lex = function () {
- var token
- token = lexer.lex() || EOF
- if (typeof token !== 'number') {
- token = self.symbols_[token] || token
- }
- return token
- }
- var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected
- while (true) {
- state = stack[stack.length - 1]
- if (this.defaultActions[state]) {
- action = this.defaultActions[state]
- } else {
- if (symbol === null || typeof symbol === 'undefined') {
- symbol = lex()
- }
- action = table[state] && table[state][symbol]
- }
- if (typeof action === 'undefined' || !action.length || !action[0]) {
- var errStr = ''
- expected = []
- for (p in table[state]) {
- if (this.terminals_[p] && p > TERROR) {
- expected.push('\'' + this.terminals_[p] + '\'')
- }
- }
- if (lexer.showPosition) {
- errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''
- } else {
- errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'')
- }
- this.parseError(errStr, {
- text: lexer.match,
- token: this.terminals_[symbol] || symbol,
- line: lexer.yylineno,
- loc: yyloc,
- expected: expected
- })
- }
- if (action[0] instanceof Array && action.length > 1) {
- throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol)
- }
- switch (action[0]) {
- case 1:
- stack.push(symbol)
- vstack.push(lexer.yytext)
- lstack.push(lexer.yylloc)
- stack.push(action[1])
- symbol = null
- if (!preErrorSymbol) {
- yyleng = lexer.yyleng
- yytext = lexer.yytext
- yylineno = lexer.yylineno
- yyloc = lexer.yylloc
- if (recovering > 0) {
- recovering--
- }
- } else {
- symbol = preErrorSymbol
- preErrorSymbol = null
- }
- break
- case 2:
- len = this.productions_[action[1]][1]
- yyval.$ = vstack[vstack.length - len]
- yyval._$ = {
- first_line: lstack[lstack.length - (len || 1)].first_line,
- last_line: lstack[lstack.length - 1].last_line,
- first_column: lstack[lstack.length - (len || 1)].first_column,
- last_column: lstack[lstack.length - 1].last_column
- }
- if (ranges) {
- yyval._$.range = [
- lstack[lstack.length - (len || 1)].range[0],
- lstack[lstack.length - 1].range[1]
- ]
- }
- r = this.performAction.apply(yyval, [
- yytext,
- yyleng,
- yylineno,
- sharedState.yy,
- action[1],
- vstack,
- lstack
- ].concat(args))
- if (typeof r !== 'undefined') {
- return r
- }
- if (len) {
- stack = stack.slice(0, -1 * len * 2)
- vstack = vstack.slice(0, -1 * len)
- lstack = lstack.slice(0, -1 * len)
- }
- stack.push(this.productions_[action[1]][0])
- vstack.push(yyval.$)
- lstack.push(yyval._$)
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]]
- stack.push(newState)
- break
- case 3:
- return true
- }
- }
- return true
- }}
-
-/* generated by jison-lex 0.3.4 */
- var lexer = (function () {
- var lexer = ({
-
- EOF: 1,
-
- parseError: function parseError (str, hash) {
- if (this.yy.parser) {
- this.yy.parser.parseError(str, hash)
- } else {
- throw new Error(str)
- }
- },
-
-// resets the lexer, sets new input
- setInput: function (input, yy) {
- this.yy = yy || this.yy || {}
- this._input = input
- this._more = this._backtrack = this.done = false
- this.yylineno = this.yyleng = 0
- this.yytext = this.matched = this.match = ''
- this.conditionStack = ['INITIAL']
- this.yylloc = {
- first_line: 1,
- first_column: 0,
- last_line: 1,
- last_column: 0
- }
- if (this.options.ranges) {
- this.yylloc.range = [0, 0]
- }
- this.offset = 0
- return this
- },
-
-// consumes and returns one char from the input
- input: function () {
- var ch = this._input[0]
- this.yytext += ch
- this.yyleng++
- this.offset++
- this.match += ch
- this.matched += ch
- var lines = ch.match(/(?:\r\n?|\n).*/g)
- if (lines) {
- this.yylineno++
- this.yylloc.last_line++
- } else {
- this.yylloc.last_column++
- }
- if (this.options.ranges) {
- this.yylloc.range[1]++
- }
-
- this._input = this._input.slice(1)
- return ch
- },
-
-// unshifts one char (or a string) into the input
- unput: function (ch) {
- var len = ch.length
- var lines = ch.split(/(?:\r\n?|\n)/g)
-
- this._input = ch + this._input
- this.yytext = this.yytext.substr(0, this.yytext.length - len)
- // this.yyleng -= len;
- this.offset -= len
- var oldLines = this.match.split(/(?:\r\n?|\n)/g)
- this.match = this.match.substr(0, this.match.length - 1)
- this.matched = this.matched.substr(0, this.matched.length - 1)
-
- if (lines.length - 1) {
- this.yylineno -= lines.length - 1
- }
- var r = this.yylloc.range
-
- this.yylloc = {
- first_line: this.yylloc.first_line,
- last_line: this.yylineno + 1,
- first_column: this.yylloc.first_column,
- last_column: lines
- ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) +
- oldLines[oldLines.length - lines.length].length - lines[0].length
- : this.yylloc.first_column - len
- }
-
- if (this.options.ranges) {
- this.yylloc.range = [r[0], r[0] + this.yyleng - len]
- }
- this.yyleng = this.yytext.length
- return this
- },
-
-// When called from action, caches matched text and appends it on next action
- more: function () {
- this._more = true
- return this
- },
-
-// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
- reject: function () {
- if (this.options.backtrack_lexer) {
- this._backtrack = true
- } else {
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
- text: '',
- token: null,
- line: this.yylineno
- })
- }
- return this
- },
-
-// retain first n characters of the match
- less: function (n) {
- this.unput(this.match.slice(n))
- },
-
-// displays already matched input, i.e. for error messages
- pastInput: function () {
- var past = this.matched.substr(0, this.matched.length - this.match.length)
- return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '')
- },
-
-// displays upcoming input, i.e. for error messages
- upcomingInput: function () {
- var next = this.match
- if (next.length < 20) {
- next += this._input.substr(0, 20 - next.length)
- }
- return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '')
- },
-
-// displays the character position where the lexing error occurred, i.e. for error messages
- showPosition: function () {
- var pre = this.pastInput()
- var c = new Array(pre.length + 1).join('-')
- return pre + this.upcomingInput() + '\n' + c + '^'
- },
-
-// test the lexed token: return FALSE when not a match, otherwise return token
- test_match: function (match, indexed_rule) {
- var token,
- lines,
- backup
-
- if (this.options.backtrack_lexer) {
- // save context
- backup = {
- yylineno: this.yylineno,
- yylloc: {
- first_line: this.yylloc.first_line,
- last_line: this.last_line,
- first_column: this.yylloc.first_column,
- last_column: this.yylloc.last_column
- },
- yytext: this.yytext,
- match: this.match,
- matches: this.matches,
- matched: this.matched,
- yyleng: this.yyleng,
- offset: this.offset,
- _more: this._more,
- _input: this._input,
- yy: this.yy,
- conditionStack: this.conditionStack.slice(0),
- done: this.done
- }
- if (this.options.ranges) {
- backup.yylloc.range = this.yylloc.range.slice(0)
- }
- }
-
- lines = match[0].match(/(?:\r\n?|\n).*/g)
- if (lines) {
- this.yylineno += lines.length
- }
- this.yylloc = {
- first_line: this.yylloc.last_line,
- last_line: this.yylineno + 1,
- first_column: this.yylloc.last_column,
- last_column: lines
- ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length
- : this.yylloc.last_column + match[0].length
- }
- this.yytext += match[0]
- this.match += match[0]
- this.matches = match
- this.yyleng = this.yytext.length
- if (this.options.ranges) {
- this.yylloc.range = [this.offset, this.offset += this.yyleng]
- }
- this._more = false
- this._backtrack = false
- this._input = this._input.slice(match[0].length)
- this.matched += match[0]
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1])
- if (this.done && this._input) {
- this.done = false
- }
- if (token) {
- return token
- } else if (this._backtrack) {
- // recover context
- for (var k in backup) {
- this[k] = backup[k]
- }
- return false // rule action called reject() implying the next rule should be tested instead.
- }
- return false
- },
-
-// return next match in input
- next: function () {
- if (this.done) {
- return this.EOF
- }
- if (!this._input) {
- this.done = true
- }
-
- var token,
- match,
- tempMatch,
- index
- if (!this._more) {
- this.yytext = ''
- this.match = ''
- }
- var rules = this._currentRules()
- for (var i = 0; i < rules.length; i++) {
- tempMatch = this._input.match(this.rules[rules[i]])
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
- match = tempMatch
- index = i
- if (this.options.backtrack_lexer) {
- token = this.test_match(tempMatch, rules[i])
- if (token !== false) {
- return token
- } else if (this._backtrack) {
- match = false
- continue // rule action called reject() implying a rule MISmatch.
- } else {
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
- return false
- }
- } else if (!this.options.flex) {
- break
- }
- }
- }
- if (match) {
- token = this.test_match(match, rules[index])
- if (token !== false) {
- return token
- }
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
- return false
- }
- if (this._input === '') {
- return this.EOF
- } else {
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
- text: '',
- token: null,
- line: this.yylineno
- })
- }
- },
-
-// return next match that has a token
- lex: function lex () {
- var r = this.next()
- if (r) {
- return r
- } else {
- return this.lex()
- }
- },
-
-// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
- begin: function begin (condition) {
- this.conditionStack.push(condition)
- },
-
-// pop the previously active lexer condition state off the condition stack
- popState: function popState () {
- var n = this.conditionStack.length - 1
- if (n > 0) {
- return this.conditionStack.pop()
- } else {
- return this.conditionStack[0]
- }
- },
-
-// produce the lexer rule set which is active for the currently active lexer condition state
- _currentRules: function _currentRules () {
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules
- } else {
- return this.conditions['INITIAL'].rules
- }
- },
-
-// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
- topState: function topState (n) {
- n = this.conditionStack.length - 1 - Math.abs(n || 0)
- if (n >= 0) {
- return this.conditionStack[n]
- } else {
- return 'INITIAL'
- }
- },
-
-// alias for begin(condition)
- pushState: function pushState (condition) {
- this.begin(condition)
- },
-
-// return the number of states currently on the stack
- stateStackSize: function stateStackSize () {
- return this.conditionStack.length
- },
- options: {},
- performAction: function anonymous (yy, yy_, $avoiding_name_collisions, YY_START) {
- var YYSTATE = YY_START
- switch ($avoiding_name_collisions) {
- case 0:/* do nothing */
- break
- case 1:this.begin('string')
- break
- case 2:this.popState()
- break
- case 3:return 'STR'
- break
- case 4:return 71
- break
- case 5:return 78
- break
- case 6:return 72
- break
- case 7:return 82
- break
- case 8:return 73
- break
- case 9:return 74
- break
- case 10:return 75
- break
- case 11:return 12
- break
- case 12:return 30
- break
- case 13:return 32
- break
- case 14:return 13
- break
- case 15:return 13
- break
- case 16:return 13
- break
- case 17:return 13
- break
- case 18:return 13
- break
- case 19:return 13
- break
- case 20:return 81
- break
- case 21:return 91
- break
- case 22:return 89
- break
- case 23:return 8
- break
- case 24:return 86
- break
- case 25:return 98
- break
- case 26:return 16
- break
- case 27:return 15
- break
- case 28:return 17
- break
- case 29:return 18
- break
- case 30:return 53
- break
- case 31:return 51
- break
- case 32:return 52
- break
- case 33:return 54
- break
- case 34:return 58
- break
- case 35:return 56
- break
- case 36:return 57
- break
- case 37:return 59
- break
- case 38:return 58
- break
- case 39:return 56
- break
- case 40:return 57
- break
- case 41:return 59
- break
- case 42:return 63
- break
- case 43:return 61
- break
- case 44:return 62
- break
- case 45:return 64
- break
- case 46:return 50
- break
- case 47:return 55
- break
- case 48:return 60
- break
- case 49:return 40
- break
- case 50:return 41
- break
- case 51:return 46
- break
- case 52:return 92
- break
- case 53:return 96
- break
- case 54:return 84
- break
- case 55:return 97
- break
- case 56:return 97
- break
- case 57:return 88
- break
- case 58:return 94
- break
- case 59:return 95
- break
- case 60:return 65
- break
- case 61:return 38
- break
- case 62:return 39
- break
- case 63:return 36
- break
- case 64:return 37
- break
- case 65:return 42
- break
- case 66:return 43
- break
- case 67:return 101
- break
- case 68:return 9
- break
- case 69:return 10
- break
- case 70:return 11
- break
- }
- },
- rules: [/^(?:%%[^\n]*)/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:style\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:click\b)/, /^(?:graph\b)/, /^(?:subgraph\b)/, /^(?:end\b\s*)/, /^(?:LR\b)/, /^(?:RL\b)/, /^(?:TB\b)/, /^(?:BT\b)/, /^(?:TD\b)/, /^(?:BR\b)/, /^(?:[0-9]+)/, /^(?:#)/, /^(?::)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:<)/, /^(?:>)/, /^(?:\^)/, /^(?:v\b)/, /^(?:\s*--[x]\s*)/, /^(?:\s*-->\s*)/, /^(?:\s*--[o]\s*)/, /^(?:\s*---\s*)/, /^(?:\s*-\.-[x]\s*)/, /^(?:\s*-\.->\s*)/, /^(?:\s*-\.-[o]\s*)/, /^(?:\s*-\.-\s*)/, /^(?:\s*.-[x]\s*)/, /^(?:\s*\.->\s*)/, /^(?:\s*\.-[o]\s*)/, /^(?:\s*\.-\s*)/, /^(?:\s*==[x]\s*)/, /^(?:\s*==>\s*)/, /^(?:\s*==[o]\s*)/, /^(?:\s*==[\=]\s*)/, /^(?:\s*--\s*)/, /^(?:\s*-\.\s*)/, /^(?:\s*==\s*)/, /^(?:\(-)/, /^(?:-\))/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:[A-Za-z]+)/, /^(?:[!"#$%&'*+,-.`?\\_\/])/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\|)/, /^(?:\()/, /^(?:\))/, /^(?:\[)/, /^(?:\])/, /^(?:\{)/, /^(?:\})/, /^(?:")/, /^(?:\n+)/, /^(?:\s)/, /^(?:$)/],
- conditions: {'string': {'rules': [2, 3], 'inclusive': false}, 'INITIAL': {'rules': [0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70], 'inclusive': true}}
- })
- return lexer
- })()
- parser.lexer = lexer
- function Parser () {
- this.yy = {}
- }
- Parser.prototype = parser; parser.Parser = Parser
- return new Parser()
-})()
-
-if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
- exports.parser = parser
- exports.Parser = parser.Parser
- exports.parse = function () { return parser.parse.apply(parser, arguments) }
- exports.main = function commonjsMain (args) {
- if (!args[1]) {
- console.log('Usage: ' + args[0] + ' FILE')
- process.exit(1)
- }
- var source = require('fs').readFileSync(require('path').normalize(args[1]), 'utf8')
- return exports.parser.parse(source)
- }
- if (typeof module !== 'undefined' && require.main === module) {
- exports.main(process.argv.slice(1))
- }
-}
-
-}).call(this,require('_process'))
-},{"_process":406,"fs":7,"path":405}],390:[function(require,module,exports){
-(function (global){
-/**
- * Created by knut on 15-01-14.
- */
-var moment = require('moment')
-var Logger = require('../../logger')
-var log = Logger.Log
-
-var dateFormat = ''
-var title = ''
-var sections = []
-var tasks = []
-var currentSection = ''
-
-exports.clear = function () {
- sections = []
- tasks = []
- currentSection = ''
- title = ''
- taskCnt = 0
- lastTask = undefined
- lastTaskID = undefined
- rawTasks = []
-}
-
-exports.setDateFormat = function (txt) {
- dateFormat = txt
-}
-
-exports.getDateFormat = function () {
- return dateFormat
-}
-exports.setTitle = function (txt) {
- title = txt
-}
-
-exports.getTitle = function () {
- return title
-}
-
-exports.addSection = function (txt) {
- currentSection = txt
- sections.push(txt)
-}
-
-exports.getTasks = function () {
- var allItemsPricessed = compileTasks()
- var maxDepth = 10
- var iterationCount = 0
- while (!allItemsPricessed && (iterationCount < maxDepth)) {
- allItemsPricessed = compileTasks()
- iterationCount++
- }
-
- tasks = rawTasks
-
- return tasks
-}
-
-var getStartDate = function (prevTime, dateFormat, str) {
- str = str.trim()
-
- // Test for after
- var re = /^after\s+([\d\w-]+)/
- var afterStatement = re.exec(str.trim())
-
- if (afterStatement !== null) {
- var task = exports.findTaskById(afterStatement[1])
-
- if (typeof task === 'undefined') {
- var dt = new Date()
- dt.setHours(0, 0, 0, 0)
- return dt
- }
- return task.endTime
- }
-
- // Check for actual date set
- if (moment(str, dateFormat.trim(), true).isValid()) {
- return moment(str, dateFormat.trim(), true).toDate()
- } else {
- log.debug('Invalid date:' + str)
- log.debug('With date format:' + dateFormat.trim())
- }
-
- // Default date - now
- return new Date()
-}
-
-var getEndDate = function (prevTime, dateFormat, str) {
- str = str.trim()
-
- // Check for actual date
- if (moment(str, dateFormat.trim(), true).isValid()) {
- return moment(str, dateFormat.trim()).toDate()
- }
-
- var d = moment(prevTime)
- // Check for length
- var re = /^([\d]+)([wdhms])/
- var durationStatement = re.exec(str.trim())
-
- if (durationStatement !== null) {
- switch (durationStatement[2]) {
- case 's':
- d.add(durationStatement[1], 'seconds')
- break
- case 'm':
- d.add(durationStatement[1], 'minutes')
- break
- case 'h':
- d.add(durationStatement[1], 'hours')
- break
- case 'd':
- d.add(durationStatement[1], 'days')
- break
- case 'w':
- d.add(durationStatement[1], 'weeks')
- break
- }
- return d.toDate()
- }
- // Default date - now
- return d.toDate()
-}
-
-var taskCnt = 0
-var parseId = function (idStr) {
- if (typeof idStr === 'undefined') {
- taskCnt = taskCnt + 1
- return 'task' + taskCnt
- }
- return idStr
-}
-// id, startDate, endDate
-// id, startDate, length
-// id, after x, endDate
-// id, after x, length
-// startDate, endDate
-// startDate, length
-// after x, endDate
-// after x, length
-// endDate
-// length
-
-var compileData = function (prevTask, dataStr) {
- var ds
-
- if (dataStr.substr(0, 1) === ':') {
- ds = dataStr.substr(1, dataStr.length)
- } else {
- ds = dataStr
- }
-
- var data = ds.split(',')
-
- var task = {}
- var df = exports.getDateFormat()
-
- // Get tags like active, done cand crit
- var matchFound = true
- while (matchFound) {
- matchFound = false
- if (data[0].match(/^\s*active\s*$/)) {
- task.active = true
- data.shift(1)
- matchFound = true
- }
- if (data[0].match(/^\s*done\s*$/)) {
- task.done = true
- data.shift(1)
- matchFound = true
- }
- if (data[0].match(/^\s*crit\s*$/)) {
- task.crit = true
- data.shift(1)
- matchFound = true
- }
- }
- var i
- for (i = 0; i < data.length; i++) {
- data[i] = data[i].trim()
- }
-
- switch (data.length) {
- case 1:
- task.id = parseId()
- task.startTime = prevTask.endTime
- task.endTime = getEndDate(task.startTime, df, data[0])
- break
- case 2:
- task.id = parseId()
- task.startTime = getStartDate(undefined, df, data[0])
- task.endTime = getEndDate(task.startTime, df, data[1])
- break
- case 3:
- task.id = parseId(data[0])
- task.startTime = getStartDate(undefined, df, data[1])
- task.endTime = getEndDate(task.startTime, df, data[2])
- break
- default:
- }
-
- return task
-}
-
-var parseData = function (prevTaskId, dataStr) {
- var ds
-
- if (dataStr.substr(0, 1) === ':') {
- ds = dataStr.substr(1, dataStr.length)
- } else {
- ds = dataStr
- }
-
- var data = ds.split(',')
-
- var task = {}
-
- // Get tags like active, done cand crit
- var matchFound = true
- while (matchFound) {
- matchFound = false
- if (data[0].match(/^\s*active\s*$/)) {
- task.active = true
- data.shift(1)
- matchFound = true
- }
- if (data[0].match(/^\s*done\s*$/)) {
- task.done = true
- data.shift(1)
- matchFound = true
- }
- if (data[0].match(/^\s*crit\s*$/)) {
- task.crit = true
- data.shift(1)
- matchFound = true
- }
- }
- var i
- for (i = 0; i < data.length; i++) {
- data[i] = data[i].trim()
- }
-
- switch (data.length) {
- case 1:
- task.id = parseId()
- task.startTime = { type: 'prevTaskEnd', id: prevTaskId }
- task.endTime = { data: data[0] }
- break
- case 2:
- task.id = parseId()
- task.startTime = { type: 'getStartDate', startData: data[0] }
- task.endTime = { data: data[1] }
- break
- case 3:
- task.id = parseId(data[0])
- task.startTime = { type: 'getStartDate', startData: data[1] }
- task.endTime = { data: data[2] }
- break
- default:
- }
-
- return task
-}
-
-var lastTask
-var lastTaskID
-var rawTasks = []
-var taskDb = {}
-exports.addTask = function (descr, data) {
- var rawTask = {
- section: currentSection,
- type: currentSection,
- processed: false,
- raw: { data: data },
- task: descr
- }
- var taskInfo = parseData(lastTaskID, data)
- rawTask.raw.startTime = taskInfo.startTime
- rawTask.raw.endTime = taskInfo.endTime
- rawTask.id = taskInfo.id
- rawTask.prevTaskId = lastTaskID
- rawTask.active = taskInfo.active
- rawTask.done = taskInfo.done
- rawTask.crit = taskInfo.crit
-
- var pos = rawTasks.push(rawTask)
-
- lastTaskID = rawTask.id
- // Store cross ref
- taskDb[rawTask.id] = pos - 1
-}
-
-exports.findTaskById = function (id) {
- var pos = taskDb[id]
- return rawTasks[pos]
-}
-
-exports.addTaskOrg = function (descr, data) {
- var newTask = {
- section: currentSection,
- type: currentSection,
- description: descr,
- task: descr
- }
- var taskInfo = compileData(lastTask, data)
- newTask.startTime = taskInfo.startTime
- newTask.endTime = taskInfo.endTime
- newTask.id = taskInfo.id
- newTask.active = taskInfo.active
- newTask.done = taskInfo.done
- newTask.crit = taskInfo.crit
- lastTask = newTask
- tasks.push(newTask)
-}
-
-var compileTasks = function () {
- var df = exports.getDateFormat()
-
- var compileTask = function (pos) {
- var task = rawTasks[pos]
- var startTime = ''
- switch (rawTasks[pos].raw.startTime.type) {
- case 'prevTaskEnd':
- var prevTask = exports.findTaskById(task.prevTaskId)
- task.startTime = prevTask.endTime
- break
- case 'getStartDate':
- startTime = getStartDate(undefined, df, rawTasks[pos].raw.startTime.startData)
- if (startTime) {
- rawTasks[pos].startTime = startTime
- }
- break
- }
-
- if (rawTasks[pos].startTime) {
- rawTasks[pos].endTime = getEndDate(rawTasks[pos].startTime, df, rawTasks[pos].raw.endTime.data)
- if (rawTasks[pos].endTime) {
- rawTasks[pos].processed = true
- }
- }
-
- return rawTasks[pos].processed
- }
-
- var i
- var allProcessed = true
- for (i = 0; i < rawTasks.length; i++) {
- compileTask(i)
-
- allProcessed = allProcessed && rawTasks[i].processed
- }
- return allProcessed
-}
-
-exports.parseError = function (err, hash) {
- global.mermaidAPI.parseError(err, hash)
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"../../logger":400,"moment":404}],391:[function(require,module,exports){
-var gantt = require('./parser/gantt').parser
-gantt.yy = require('./ganttDb')
-var d3 = require('../../d3')
-var moment = require('moment')
-
-var daysInChart
-var conf = {
- titleTopMargin: 25,
- barHeight: 20,
- barGap: 4,
- topPadding: 50,
- rightPadding: 75,
- leftPadding: 75,
- gridLineStartPadding: 35,
- fontSize: 11,
- fontFamily: '"Open-Sans", "sans-serif"'
-}
-module.exports.setConf = function (cnf) {
- var keys = Object.keys(cnf)
-
- keys.forEach(function (key) {
- conf[key] = cnf[key]
- })
-}
-var w
-module.exports.draw = function (text, id) {
- gantt.yy.clear()
- gantt.parse(text)
-
- var elem = document.getElementById(id)
- w = elem.parentElement.offsetWidth
-
- if (typeof w === 'undefined') {
- w = 1200
- }
-
- if (typeof conf.useWidth !== 'undefined') {
- w = conf.useWidth
- }
-
- var taskArray = gantt.yy.getTasks()
-
- // Set height based on number of tasks
- var h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding
-
- elem.setAttribute('height', '100%')
- // Set viewBox
- elem.setAttribute('viewBox', '0 0 ' + w + ' ' + h)
- var svg = d3.select('#' + id)
-
- var startDate = d3.min(taskArray, function (d) {
- return d.startTime
- })
- var endDate = d3.max(taskArray, function (d) {
- return d.endTime
- })
-
- // Set timescale
- var timeScale = d3.time.scale()
- .domain([d3.min(taskArray, function (d) {
- return d.startTime
- }),
- d3.max(taskArray, function (d) {
- return d.endTime
- })])
- .rangeRound([0, w - conf.leftPadding - conf.rightPadding])
-
- var categories = []
-
- daysInChart = moment.duration(endDate - startDate).asDays()
-
- for (var i = 0; i < taskArray.length; i++) {
- categories.push(taskArray[i].type)
- }
-
- var catsUnfiltered = categories // for vert labels
-
- categories = checkUnique(categories)
-
- makeGant(taskArray, w, h)
- if (typeof conf.useWidth !== 'undefined') {
- elem.setAttribute('width', w)
- }
-
- svg.append('text')
- .text(gantt.yy.getTitle())
- .attr('x', w / 2)
- .attr('y', conf.titleTopMargin)
- .attr('class', 'titleText')
-
- function makeGant (tasks, pageWidth, pageHeight) {
- var barHeight = conf.barHeight
- var gap = barHeight + conf.barGap
- var topPadding = conf.topPadding
- var leftPadding = conf.leftPadding
-
- var colorScale = d3.scale.linear()
- .domain([0, categories.length])
- .range(['#00B9FA', '#F95002'])
- .interpolate(d3.interpolateHcl)
-
- makeGrid(leftPadding, topPadding, pageWidth, pageHeight)
- drawRects(tasks, gap, topPadding, leftPadding, barHeight, colorScale, pageWidth, pageHeight)
- vertLabels(gap, topPadding, leftPadding, barHeight, colorScale)
- drawToday(leftPadding, topPadding, pageWidth, pageHeight)
- }
-
- function drawRects (theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w, h) {
- svg.append('g')
- .selectAll('rect')
- .data(theArray)
- .enter()
- .append('rect')
- .attr('x', 0)
- .attr('y', function (d, i) {
- return i * theGap + theTopPad - 2
- })
- .attr('width', function () {
- return w - conf.rightPadding / 2
- })
- .attr('height', theGap)
- .attr('class', function (d) {
- for (var i = 0; i < categories.length; i++) {
- if (d.type === categories[i]) {
- return 'section section' + (i % conf.numberSectionStyles)
- }
- }
- return 'section section0'
- })
-
- var rectangles = svg.append('g')
- .selectAll('rect')
- .data(theArray)
- .enter()
-
- rectangles.append('rect')
- .attr('rx', 3)
- .attr('ry', 3)
- .attr('x', function (d) {
- return timeScale(d.startTime) + theSidePad
- })
- .attr('y', function (d, i) {
- return i * theGap + theTopPad
- })
- .attr('width', function (d) {
- return (timeScale(d.endTime) - timeScale(d.startTime))
- })
- .attr('height', theBarHeight)
- .attr('class', function (d) {
- var res = 'task '
-
- var secNum = 0
- for (var i = 0; i < categories.length; i++) {
- if (d.type === categories[i]) {
- secNum = (i % conf.numberSectionStyles)
- }
- }
-
- if (d.active) {
- if (d.crit) {
- return res + ' activeCrit' + secNum
- } else {
- return res + ' active' + secNum
- }
- }
-
- if (d.done) {
- if (d.crit) {
- return res + ' doneCrit' + secNum
- } else {
- return res + ' done' + secNum
- }
- }
-
- if (d.crit) {
- return res + ' crit' + secNum
- }
-
- return res + ' task' + secNum
- })
-
- rectangles.append('text')
- .text(function (d) {
- return d.task
- })
- .attr('font-size', conf.fontSize)
- .attr('x', function (d) {
- var startX = timeScale(d.startTime)
- var endX = timeScale(d.endTime)
- var textWidth = this.getBBox().width
-
- // Check id text width > width of rectangle
- if (textWidth > (endX - startX)) {
- if (endX + textWidth + 1.5 * conf.leftPadding > w) {
- return startX + theSidePad - 5
- } else {
- return endX + theSidePad + 5
- }
- } else {
- return (endX - startX) / 2 + startX + theSidePad
- }
- })
- .attr('y', function (d, i) {
- return i * theGap + (conf.barHeight / 2) + (conf.fontSize / 2 - 2) + theTopPad
- })
- .attr('text-height', theBarHeight)
- .attr('class', function (d) {
- var startX = timeScale(d.startTime)
- var endX = timeScale(d.endTime)
- var textWidth = this.getBBox().width
- var secNum = 0
- for (var i = 0; i < categories.length; i++) {
- if (d.type === categories[i]) {
- secNum = (i % conf.numberSectionStyles)
- }
- }
-
- var taskType = ''
- if (d.active) {
- if (d.crit) {
- taskType = 'activeCritText' + secNum
- } else {
- taskType = 'activeText' + secNum
- }
- }
-
- if (d.done) {
- if (d.crit) {
- taskType = taskType + ' doneCritText' + secNum
- } else {
- taskType = taskType + ' doneText' + secNum
- }
- } else {
- if (d.crit) {
- taskType = taskType + ' critText' + secNum
- }
- }
-
- // Check id text width > width of rectangle
- if (textWidth > (endX - startX)) {
- if (endX + textWidth + 1.5 * conf.leftPadding > w) {
- return 'taskTextOutsideLeft taskTextOutside' + secNum + ' ' + taskType
- } else {
- return 'taskTextOutsideRight taskTextOutside' + secNum + ' ' + taskType
- }
- } else {
- return 'taskText taskText' + secNum + ' ' + taskType
- }
- })
- }
-
- function makeGrid (theSidePad, theTopPad, w, h) {
- var pre = [
- ['.%L', function (d) {
- return d.getMilliseconds()
- }],
- [':%S', function (d) {
- return d.getSeconds()
- }],
- // Within a hour
- ['h1 %I:%M', function (d) {
- return d.getMinutes()
- }]]
- var post = [
- ['%Y', function () {
- return true
- }]]
-
- var mid = [
- // Within a day
- ['%I:%M', function (d) {
- return d.getHours()
- }],
- // Day within a week (not monday)
- ['%a %d', function (d) {
- return d.getDay() && d.getDate() !== 1
- }],
- // within a month
- ['%b %d', function (d) {
- return d.getDate() !== 1
- }],
- // Month
- ['%B', function (d) {
- return d.getMonth()
- }]
- ]
- var formatter
- if (typeof conf.axisFormatter !== 'undefined') {
- mid = []
- conf.axisFormatter.forEach(function (item) {
- var n = []
- n[0] = item[0]
- n[1] = item[1]
- mid.push(n)
- })
- }
- formatter = pre.concat(mid).concat(post)
-
- var xAxis = d3.svg.axis()
- .scale(timeScale)
- .orient('bottom')
- .tickSize(-h + theTopPad + conf.gridLineStartPadding, 0, 0)
- .tickFormat(d3.time.format.multi(formatter))
-
- if (daysInChart > 7 && daysInChart < 230) {
- xAxis = xAxis.ticks(d3.time.monday.range)
- }
-
- svg.append('g')
- .attr('class', 'grid')
- .attr('transform', 'translate(' + theSidePad + ', ' + (h - 50) + ')')
- .call(xAxis)
- .selectAll('text')
- .style('text-anchor', 'middle')
- .attr('fill', '#000')
- .attr('stroke', 'none')
- .attr('font-size', 10)
- .attr('dy', '1em')
- }
-
- function vertLabels (theGap, theTopPad) {
- var numOccurances = []
- var prevGap = 0
-
- for (var i = 0; i < categories.length; i++) {
- numOccurances[i] = [categories[i], getCount(categories[i], catsUnfiltered)]
- }
-
- svg.append('g') // without doing this, impossible to put grid lines behind text
- .selectAll('text')
- .data(numOccurances)
- .enter()
- .append('text')
- .text(function (d) {
- return d[0]
- })
- .attr('x', 10)
- .attr('y', function (d, i) {
- if (i > 0) {
- for (var j = 0; j < i; j++) {
- prevGap += numOccurances[i - 1][1]
- return d[1] * theGap / 2 + prevGap * theGap + theTopPad
- }
- } else {
- return d[1] * theGap / 2 + theTopPad
- }
- })
- .attr('class', function (d) {
- for (var i = 0; i < categories.length; i++) {
- if (d[0] === categories[i]) {
- return 'sectionTitle sectionTitle' + (i % conf.numberSectionStyles)
- }
- }
- return 'sectionTitle'
- })
- }
-
- function drawToday (theSidePad, theTopPad, w, h) {
- var todayG = svg.append('g')
- .attr('class', 'today')
-
- var today = new Date()
-
- todayG.append('line')
- .attr('x1', timeScale(today) + theSidePad)
- .attr('x2', timeScale(today) + theSidePad)
- .attr('y1', conf.titleTopMargin)
- .attr('y2', h - conf.titleTopMargin)
- .attr('class', 'today')
- }
-
- // from this stackexchange question: http://stackoverflow.com/questions/1890203/unique-for-arrays-in-javascript
- function checkUnique (arr) {
- var hash = {}
- var result = []
- for (var i = 0, l = arr.length; i < l; ++i) {
- if (!hash.hasOwnProperty(arr[i])) { // it works with objects! in FF, at least
- hash[arr[i]] = true
- result.push(arr[i])
- }
- }
- return result
- }
-
- // from this stackexchange question: http://stackoverflow.com/questions/14227981/count-how-many-strings-in-an-array-have-duplicates-in-the-same-array
- function getCounts (arr) {
- var i = arr.length // var to loop over
- var obj = {} // obj to store results
- while (i) {
- obj[arr[--i]] = (obj[arr[i]] || 0) + 1 // count occurrences
- }
- return obj
- }
-
- // get specific from everything
- function getCount (word, arr) {
- return getCounts(arr)[word] || 0
- }
-}
-
-},{"../../d3":379,"./ganttDb":390,"./parser/gantt":392,"moment":404}],392:[function(require,module,exports){
-(function (process){
-/* parser generated by jison 0.4.17 */
-/*
- Returns a Parser object of the following structure:
-
- Parser: {
- yy: {}
- }
-
- Parser.prototype: {
- yy: {},
- trace: function(),
- symbols_: {associative list: name ==> number},
- terminals_: {associative list: number ==> name},
- productions_: [...],
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
- table: [...],
- defaultActions: {...},
- parseError: function(str, hash),
- parse: function(input),
-
- lexer: {
- EOF: 1,
- parseError: function(str, hash),
- setInput: function(input),
- input: function(),
- unput: function(str),
- more: function(),
- less: function(n),
- pastInput: function(),
- upcomingInput: function(),
- showPosition: function(),
- test_match: function(regex_match_array, rule_index),
- next: function(),
- lex: function(),
- begin: function(condition),
- popState: function(),
- _currentRules: function(),
- topState: function(),
- pushState: function(condition),
-
- options: {
- ranges: boolean (optional: true ==> token location info will include a .range[] member)
- flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
- backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
- },
-
- performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
- rules: [...],
- conditions: {associative list: name ==> set},
- }
- }
-
- token location info (@$, _$, etc.): {
- first_line: n,
- last_line: n,
- first_column: n,
- last_column: n,
- range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
- }
-
- the parseError function receives a 'hash' object with these members for lexer and parser errors: {
- text: (matched text)
- token: (the produced terminal token, if any)
- line: (yylineno)
- }
- while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
- loc: (yylloc)
- expected: (string describing the set of expected tokens)
- recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
- }
-*/
-var parser = (function () {
- var o = function (k, v, o, l) { for (o = o || {}, l = k.length; l--; o[k[l]] = v); return o }, $V0 = [6, 8, 10, 11, 12, 13, 14], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12]
- var parser = {
- trace: function trace () { },
- yy: {},
- symbols_: { 'error': 2, 'start': 3, 'gantt': 4, 'document': 5, 'EOF': 6, 'line': 7, 'SPACE': 8, 'statement': 9, 'NL': 10, 'dateFormat': 11, 'title': 12, 'section': 13, 'taskTxt': 14, 'taskData': 15, '$accept': 0, '$end': 1 },
- terminals_: { 2: 'error', 4: 'gantt', 6: 'EOF', 8: 'SPACE', 10: 'NL', 11: 'dateFormat', 12: 'title', 13: 'section', 14: 'taskTxt', 15: 'taskData' },
- productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 1], [9, 1], [9, 2]],
- performAction: function anonymous (yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
- /* this == yyval */
-
- var $0 = $$.length - 1
- switch (yystate) {
- case 1:
- return $$[$0 - 1]
- break
- case 2:
- this.$ = []
- break
- case 3:
- $$[$0 - 1].push($$[$0]); this.$ = $$[$0 - 1]
- break
- case 4: case 5:
- this.$ = $$[$0]
- break
- case 6: case 7:
- this.$ = []
- break
- case 8:
- yy.setDateFormat($$[$0].substr(11)); this.$ = $$[$0].substr(11)
- break
- case 9:
- yy.setTitle($$[$0].substr(6)); this.$ = $$[$0].substr(6)
- break
- case 10:
- yy.addSection($$[$0].substr(8)); this.$ = $$[$0].substr(8)
- break
- case 11:
- yy.addTask($$[$0 - 1], $$[$0]); this.$ = 'task'
- break
- }
- },
- table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: $V1, 12: $V2, 13: $V3, 14: $V4 }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 13, 11: $V1, 12: $V2, 13: $V3, 14: $V4 }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 8]), o($V0, [2, 9]), o($V0, [2, 10]), { 15: [1, 14] }, o($V0, [2, 4]), o($V0, [2, 11])],
- defaultActions: {},
- parseError: function parseError (str, hash) {
- if (hash.recoverable) {
- this.trace(str)
- } else {
- function _parseError (msg, hash) {
- this.message = msg
- this.hash = hash
- }
- _parseError.prototype = Error
-
- throw new _parseError(str, hash)
- }
- },
- parse: function parse (input) {
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1
- var args = lstack.slice.call(arguments, 1)
- var lexer = Object.create(this.lexer)
- var sharedState = { yy: {} }
- for (var k in this.yy) {
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
- sharedState.yy[k] = this.yy[k]
- }
- }
- lexer.setInput(input, sharedState.yy)
- sharedState.yy.lexer = lexer
- sharedState.yy.parser = this
- if (typeof lexer.yylloc === 'undefined') {
- lexer.yylloc = {}
- }
- var yyloc = lexer.yylloc
- lstack.push(yyloc)
- var ranges = lexer.options && lexer.options.ranges
- if (typeof sharedState.yy.parseError === 'function') {
- this.parseError = sharedState.yy.parseError
- } else {
- this.parseError = Object.getPrototypeOf(this).parseError
- }
- function popStack (n) {
- stack.length = stack.length - 2 * n
- vstack.length = vstack.length - n
- lstack.length = lstack.length - n
- }
- var lex = function () {
- var token
- token = lexer.lex() || EOF
- if (typeof token !== 'number') {
- token = self.symbols_[token] || token
- }
- return token
- }
- var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected
- while (true) {
- state = stack[stack.length - 1]
- if (this.defaultActions[state]) {
- action = this.defaultActions[state]
- } else {
- if (symbol === null || typeof symbol === 'undefined') {
- symbol = lex()
- }
- action = table[state] && table[state][symbol]
- }
- if (typeof action === 'undefined' || !action.length || !action[0]) {
- var errStr = ''
- expected = []
- for (p in table[state]) {
- if (this.terminals_[p] && p > TERROR) {
- expected.push('\'' + this.terminals_[p] + '\'')
- }
- }
- if (lexer.showPosition) {
- errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''
- } else {
- errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'')
- }
- this.parseError(errStr, {
- text: lexer.match,
- token: this.terminals_[symbol] || symbol,
- line: lexer.yylineno,
- loc: yyloc,
- expected: expected
- })
- }
- if (action[0] instanceof Array && action.length > 1) {
- throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol)
- }
- switch (action[0]) {
- case 1:
- stack.push(symbol)
- vstack.push(lexer.yytext)
- lstack.push(lexer.yylloc)
- stack.push(action[1])
- symbol = null
- if (!preErrorSymbol) {
- yyleng = lexer.yyleng
- yytext = lexer.yytext
- yylineno = lexer.yylineno
- yyloc = lexer.yylloc
- if (recovering > 0) {
- recovering--
- }
- } else {
- symbol = preErrorSymbol
- preErrorSymbol = null
- }
- break
- case 2:
- len = this.productions_[action[1]][1]
- yyval.$ = vstack[vstack.length - len]
- yyval._$ = {
- first_line: lstack[lstack.length - (len || 1)].first_line,
- last_line: lstack[lstack.length - 1].last_line,
- first_column: lstack[lstack.length - (len || 1)].first_column,
- last_column: lstack[lstack.length - 1].last_column
- }
- if (ranges) {
- yyval._$.range = [
- lstack[lstack.length - (len || 1)].range[0],
- lstack[lstack.length - 1].range[1]
- ]
- }
- r = this.performAction.apply(yyval, [
- yytext,
- yyleng,
- yylineno,
- sharedState.yy,
- action[1],
- vstack,
- lstack
- ].concat(args))
- if (typeof r !== 'undefined') {
- return r
- }
- if (len) {
- stack = stack.slice(0, -1 * len * 2)
- vstack = vstack.slice(0, -1 * len)
- lstack = lstack.slice(0, -1 * len)
- }
- stack.push(this.productions_[action[1]][0])
- vstack.push(yyval.$)
- lstack.push(yyval._$)
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]]
- stack.push(newState)
- break
- case 3:
- return true
- }
- }
- return true
- }
- }
- /* generated by jison-lex 0.3.4 */
- var lexer = (function () {
- var lexer = ({
-
- EOF: 1,
-
- parseError: function parseError (str, hash) {
- if (this.yy.parser) {
- this.yy.parser.parseError(str, hash)
- } else {
- throw new Error(str)
- }
- },
-
- // resets the lexer, sets new input
- setInput: function (input, yy) {
- this.yy = yy || this.yy || {}
- this._input = input
- this._more = this._backtrack = this.done = false
- this.yylineno = this.yyleng = 0
- this.yytext = this.matched = this.match = ''
- this.conditionStack = ['INITIAL']
- this.yylloc = {
- first_line: 1,
- first_column: 0,
- last_line: 1,
- last_column: 0
- }
- if (this.options.ranges) {
- this.yylloc.range = [0, 0]
- }
- this.offset = 0
- return this
- },
-
- // consumes and returns one char from the input
- input: function () {
- var ch = this._input[0]
- this.yytext += ch
- this.yyleng++
- this.offset++
- this.match += ch
- this.matched += ch
- var lines = ch.match(/(?:\r\n?|\n).*/g)
- if (lines) {
- this.yylineno++
- this.yylloc.last_line++
- } else {
- this.yylloc.last_column++
- }
- if (this.options.ranges) {
- this.yylloc.range[1]++
- }
-
- this._input = this._input.slice(1)
- return ch
- },
-
- // unshifts one char (or a string) into the input
- unput: function (ch) {
- var len = ch.length
- var lines = ch.split(/(?:\r\n?|\n)/g)
-
- this._input = ch + this._input
- this.yytext = this.yytext.substr(0, this.yytext.length - len)
- // this.yyleng -= len;
- this.offset -= len
- var oldLines = this.match.split(/(?:\r\n?|\n)/g)
- this.match = this.match.substr(0, this.match.length - 1)
- this.matched = this.matched.substr(0, this.matched.length - 1)
-
- if (lines.length - 1) {
- this.yylineno -= lines.length - 1
- }
- var r = this.yylloc.range
-
- this.yylloc = {
- first_line: this.yylloc.first_line,
- last_line: this.yylineno + 1,
- first_column: this.yylloc.first_column,
- last_column: lines
- ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) +
- oldLines[oldLines.length - lines.length].length - lines[0].length
- : this.yylloc.first_column - len
- }
-
- if (this.options.ranges) {
- this.yylloc.range = [r[0], r[0] + this.yyleng - len]
- }
- this.yyleng = this.yytext.length
- return this
- },
-
- // When called from action, caches matched text and appends it on next action
- more: function () {
- this._more = true
- return this
- },
-
- // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
- reject: function () {
- if (this.options.backtrack_lexer) {
- this._backtrack = true
- } else {
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
- text: '',
- token: null,
- line: this.yylineno
- })
- }
- return this
- },
-
- // retain first n characters of the match
- less: function (n) {
- this.unput(this.match.slice(n))
- },
-
- // displays already matched input, i.e. for error messages
- pastInput: function () {
- var past = this.matched.substr(0, this.matched.length - this.match.length)
- return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '')
- },
-
- // displays upcoming input, i.e. for error messages
- upcomingInput: function () {
- var next = this.match
- if (next.length < 20) {
- next += this._input.substr(0, 20 - next.length)
- }
- return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '')
- },
-
- // displays the character position where the lexing error occurred, i.e. for error messages
- showPosition: function () {
- var pre = this.pastInput()
- var c = new Array(pre.length + 1).join('-')
- return pre + this.upcomingInput() + '\n' + c + '^'
- },
-
- // test the lexed token: return FALSE when not a match, otherwise return token
- test_match: function (match, indexed_rule) {
- var token,
- lines,
- backup
-
- if (this.options.backtrack_lexer) {
- // save context
- backup = {
- yylineno: this.yylineno,
- yylloc: {
- first_line: this.yylloc.first_line,
- last_line: this.last_line,
- first_column: this.yylloc.first_column,
- last_column: this.yylloc.last_column
- },
- yytext: this.yytext,
- match: this.match,
- matches: this.matches,
- matched: this.matched,
- yyleng: this.yyleng,
- offset: this.offset,
- _more: this._more,
- _input: this._input,
- yy: this.yy,
- conditionStack: this.conditionStack.slice(0),
- done: this.done
- }
- if (this.options.ranges) {
- backup.yylloc.range = this.yylloc.range.slice(0)
- }
- }
-
- lines = match[0].match(/(?:\r\n?|\n).*/g)
- if (lines) {
- this.yylineno += lines.length
- }
- this.yylloc = {
- first_line: this.yylloc.last_line,
- last_line: this.yylineno + 1,
- first_column: this.yylloc.last_column,
- last_column: lines
- ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length
- : this.yylloc.last_column + match[0].length
- }
- this.yytext += match[0]
- this.match += match[0]
- this.matches = match
- this.yyleng = this.yytext.length
- if (this.options.ranges) {
- this.yylloc.range = [this.offset, this.offset += this.yyleng]
- }
- this._more = false
- this._backtrack = false
- this._input = this._input.slice(match[0].length)
- this.matched += match[0]
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1])
- if (this.done && this._input) {
- this.done = false
- }
- if (token) {
- return token
- } else if (this._backtrack) {
- // recover context
- for (var k in backup) {
- this[k] = backup[k]
- }
- return false // rule action called reject() implying the next rule should be tested instead.
- }
- return false
- },
-
- // return next match in input
- next: function () {
- if (this.done) {
- return this.EOF
- }
- if (!this._input) {
- this.done = true
- }
-
- var token,
- match,
- tempMatch,
- index
- if (!this._more) {
- this.yytext = ''
- this.match = ''
- }
- var rules = this._currentRules()
- for (var i = 0; i < rules.length; i++) {
- tempMatch = this._input.match(this.rules[rules[i]])
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
- match = tempMatch
- index = i
- if (this.options.backtrack_lexer) {
- token = this.test_match(tempMatch, rules[i])
- if (token !== false) {
- return token
- } else if (this._backtrack) {
- match = false
- continue // rule action called reject() implying a rule MISmatch.
- } else {
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
- return false
- }
- } else if (!this.options.flex) {
- break
- }
- }
- }
- if (match) {
- token = this.test_match(match, rules[index])
- if (token !== false) {
- return token
- }
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
- return false
- }
- if (this._input === '') {
- return this.EOF
- } else {
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
- text: '',
- token: null,
- line: this.yylineno
- })
- }
- },
-
- // return next match that has a token
- lex: function lex () {
- var r = this.next()
- if (r) {
- return r
- } else {
- return this.lex()
- }
- },
-
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
- begin: function begin (condition) {
- this.conditionStack.push(condition)
- },
-
- // pop the previously active lexer condition state off the condition stack
- popState: function popState () {
- var n = this.conditionStack.length - 1
- if (n > 0) {
- return this.conditionStack.pop()
- } else {
- return this.conditionStack[0]
- }
- },
-
- // produce the lexer rule set which is active for the currently active lexer condition state
- _currentRules: function _currentRules () {
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules
- } else {
- return this.conditions['INITIAL'].rules
- }
- },
-
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
- topState: function topState (n) {
- n = this.conditionStack.length - 1 - Math.abs(n || 0)
- if (n >= 0) {
- return this.conditionStack[n]
- } else {
- return 'INITIAL'
- }
- },
-
- // alias for begin(condition)
- pushState: function pushState (condition) {
- this.begin(condition)
- },
-
- // return the number of states currently on the stack
- stateStackSize: function stateStackSize () {
- return this.conditionStack.length
- },
- options: { 'case-insensitive': true },
- performAction: function anonymous (yy, yy_, $avoiding_name_collisions, YY_START) {
- // Pre-lexer code can go here
-
- var YYSTATE = YY_START
- switch ($avoiding_name_collisions) {
- case 0: return 10
- break
- case 1:/* skip whitespace */
- break
- case 2:/* skip comments */
- break
- case 3:/* skip comments */
- break
- case 4: return 4
- break
- case 5: return 11
- break
- case 6: return 'date'
- break
- case 7: return 12
- break
- case 8: return 13
- break
- case 9: return 14
- break
- case 10: return 15
- break
- case 11: return ':'
- break
- case 12: return 6
- break
- case 13: return 'INVALID'
- break
- }
- },
- rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:gantt\b)/i, /^(?:dateFormat\s[^#\n;]+)/i, /^(?:\d\d\d\d-\d\d-\d\d\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:section\s[^#:\n;]+)/i, /^(?:[^#:\n;]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i],
- conditions: { 'INITIAL': { 'rules': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], 'inclusive': true } }
- })
- return lexer
- })()
- parser.lexer = lexer
- function Parser () {
- this.yy = {}
- }
- Parser.prototype = parser; parser.Parser = Parser
- return new Parser()
-})()
-
-if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
- exports.parser = parser
- exports.Parser = parser.Parser
- exports.parse = function () { return parser.parse.apply(parser, arguments) }
- exports.main = function commonjsMain (args) {
- if (!args[1]) {
- console.log('Usage: ' + args[0] + ' FILE')
- process.exit(1)
- }
- var source = require('fs').readFileSync(require('path').normalize(args[1]), 'utf8')
- return exports.parser.parse(source)
- }
- if (typeof module !== 'undefined' && require.main === module) {
- exports.main(process.argv.slice(1))
- }
-}
-
-}).call(this,require('_process'))
-},{"_process":406,"fs":7,"path":405}],393:[function(require,module,exports){
-const Logger = require('../../logger')
-const log = Logger.Log
-const _ = require('lodash')
-
-var commits = {}
-var head = null
-var branches = { 'master': head }
-var curBranch = 'master'
-var direction = 'LR'
-var seq = 0
-
-function getRandomInt (min, max) {
- return Math.floor(Math.random() * (max - min)) + min
-}
-
-function getId () {
- var pool = '0123456789abcdef'
- var id = ''
- for (var i = 0; i < 7; i++) {
- id += pool[getRandomInt(0, 16)]
- }
- return id
-}
-
-function isfastforwardable (currentCommit, otherCommit) {
- log.debug('Entering isfastforwardable:', currentCommit.id, otherCommit.id)
- while (currentCommit.seq <= otherCommit.seq && currentCommit !== otherCommit) {
- // only if other branch has more commits
- if (otherCommit.parent == null) break
- if (Array.isArray(otherCommit.parent)) {
- log.debug('In merge commit:', otherCommit.parent)
- return isfastforwardable(currentCommit, commits[otherCommit.parent[0]]) ||
- isfastforwardable(currentCommit, commits[otherCommit.parent[1]])
- } else {
- otherCommit = commits[otherCommit.parent]
- }
- }
- log.debug(currentCommit.id, otherCommit.id)
- return currentCommit.id === otherCommit.id
-}
-
-function isReachableFrom (currentCommit, otherCommit) {
- var currentSeq = currentCommit.seq
- var otherSeq = otherCommit.seq
- if (currentSeq > otherSeq) return isfastforwardable(otherCommit, currentCommit)
- return false
-}
-
-exports.setDirection = function (dir) {
- direction = dir
-}
-var options = {}
-exports.setOptions = function (rawOptString) {
- log.debug('options str', rawOptString)
- rawOptString = rawOptString && rawOptString.trim()
- rawOptString = rawOptString || '{}'
- try {
- options = JSON.parse(rawOptString)
- } catch (e) {
- log.error('error while parsing gitGraph options', e.message)
- }
-}
-
-exports.getOptions = function () {
- return options
-}
-
-exports.commit = function (msg) {
- var commit = {
- id: getId(),
- message: msg,
- seq: seq++,
- parent: head == null ? null : head.id
- }
- head = commit
- commits[commit.id] = commit
- branches[curBranch] = commit.id
- log.debug('in pushCommit ' + commit.id)
-}
-
-exports.branch = function (name) {
- branches[name] = head != null ? head.id : null
- log.debug('in createBranch')
-}
-
-exports.merge = function (otherBranch) {
- var currentCommit = commits[branches[curBranch]]
- var otherCommit = commits[branches[otherBranch]]
- if (isReachableFrom(currentCommit, otherCommit)) {
- log.debug('Already merged')
- return
- }
- if (isfastforwardable(currentCommit, otherCommit)) {
- branches[curBranch] = branches[otherBranch]
- head = commits[branches[curBranch]]
- } else {
- // create merge commit
- var commit = {
- id: getId(),
- message: 'merged branch ' + otherBranch + ' into ' + curBranch,
- seq: seq++,
- parent: [head == null ? null : head.id, branches[otherBranch]]
- }
- head = commit
- commits[commit.id] = commit
- branches[curBranch] = commit.id
- }
- log.debug(branches)
- log.debug('in mergeBranch')
-}
-
-exports.checkout = function (branch) {
- log.debug('in checkout')
- curBranch = branch
- var id = branches[curBranch]
- head = commits[id]
-}
-
-exports.reset = function (commitRef) {
- log.debug('in reset', commitRef)
- var ref = commitRef.split(':')[0]
- var parentCount = parseInt(commitRef.split(':')[1])
- var commit = ref === 'HEAD' ? head : commits[branches[ref]]
- log.debug(commit, parentCount)
- while (parentCount > 0) {
- commit = commits[commit.parent]
- parentCount--
- if (!commit) {
- var err = 'Critical error - unique parent commit not found during reset'
- log.error(err)
- throw err
- }
- }
- head = commit
- branches[curBranch] = commit.id
-}
-
-function upsert (arr, key, newval) {
- const index = arr.indexOf(key)
- if (index === -1) {
- arr.push(newval)
- } else {
- arr.splice(index, 1, newval)
- }
-}
-
-function prettyPrintCommitHistory (commitArr) {
- var commit = _.maxBy(commitArr, 'seq')
- var line = ''
- commitArr.forEach(function (c) {
- if (c === commit) {
- line += '\t*'
- } else {
- line += '\t|'
- }
- })
- var label = [line, commit.id, commit.seq]
- _.each(branches, function (value, key) {
- if (value === commit.id) label.push(key)
- })
- log.debug(label.join(' '))
- if (Array.isArray(commit.parent)) {
- var newCommit = commits[commit.parent[0]]
- upsert(commitArr, commit, newCommit)
- commitArr.push(commits[commit.parent[1]])
- } else if (commit.parent == null) {
- return
- } else {
- var nextCommit = commits[commit.parent]
- upsert(commitArr, commit, nextCommit)
- }
- commitArr = _.uniqBy(commitArr, 'id')
- prettyPrintCommitHistory(commitArr)
-}
-
-exports.prettyPrint = function () {
- log.debug(commits)
- var node = exports.getCommitsArray()[0]
- prettyPrintCommitHistory([node])
-}
-
-exports.clear = function () {
- commits = {}
- head = null
- branches = { 'master': head }
- curBranch = 'master'
- seq = 0
-}
-
-exports.getBranchesAsObjArray = function () {
- const branchArr = _.map(branches, function (value, key) {
- return { 'name': key, 'commit': commits[value] }
- })
- return branchArr
-}
-
-exports.getBranches = function () { return branches }
-exports.getCommits = function () { return commits }
-exports.getCommitsArray = function () {
- var commitArr = Object.keys(commits).map(function (key) {
- return commits[key]
- })
- commitArr.forEach(function (o) { log.debug(o.id) })
- return _.orderBy(commitArr, ['seq'], ['desc'])
-}
-exports.getCurrentBranch = function () { return curBranch }
-exports.getDirection = function () { return direction }
-exports.getHead = function () { return head }
-
-},{"../../logger":400,"lodash":292}],394:[function(require,module,exports){
-const db = require('./gitGraphAst')
-const _ = require('lodash')
-const gitGraphParser = require('./parser/gitGraph')
-const d3 = require('../../d3')
-const Logger = require('../../logger')
-const log = Logger.Log
-
-var allCommitsDict = {}
-var branchNum
-var config = {
- nodeSpacing: 150,
- nodeFillColor: 'yellow',
- nodeStrokeWidth: 2,
- nodeStrokeColor: 'grey',
- lineStrokeWidth: 4,
- branchOffset: 50,
- lineColor: 'grey',
- leftMargin: 50,
- branchColors: ['#442f74', '#983351', '#609732', '#AA9A39'],
- nodeRadius: 10,
- nodeLabel: {
- width: 75,
- height: 100,
- x: -25,
- y: 0
- }
-}
-var apiConfig = {}
-exports.setConf = function (c) {
- apiConfig = c
-}
-
-function svgCreateDefs (svg) {
- svg
- .append('defs')
- .append('g')
- .attr('id', 'def-commit')
- .append('circle')
- .attr('r', config.nodeRadius)
- .attr('cx', 0)
- .attr('cy', 0)
- svg.select('#def-commit')
- .append('foreignObject')
- .attr('width', config.nodeLabel.width)
- .attr('height', config.nodeLabel.height)
- .attr('x', config.nodeLabel.x)
- .attr('y', config.nodeLabel.y)
- .attr('class', 'node-label')
- .attr('requiredFeatures', 'http://www.w3.org/TR/SVG11/feature#Extensibility')
- .append('xhtml:p')
- .html('')
-}
-
-function svgDrawLine (svg, points, colorIdx, interpolate) {
- interpolate = interpolate || 'basis'
- var color = config.branchColors[colorIdx % config.branchColors.length]
- var lineGen = d3.svg.line()
- .x(function (d) {
- return Math.round(d.x)
- })
- .y(function (d) {
- return Math.round(d.y)
- })
- .interpolate(interpolate)
-
- svg
- .append('svg:path')
- .attr('d', lineGen(points))
- .style('stroke', color)
- .style('stroke-width', config.lineStrokeWidth)
- .style('fill', 'none')
-}
-// Pass in the element and its pre-transform coords
-function getElementCoords (element, coords) {
- coords = coords || element.node().getBBox()
- var ctm = element.node().getCTM()
- var xn = ctm.e + coords.x * ctm.a
- var yn = ctm.f + coords.y * ctm.d
- return {
- left: xn,
- top: yn,
- width: coords.width,
- height: coords.height
- }
-}
-
-function svgDrawLineForCommits (svg, fromId, toId, direction, color) {
- log.debug('svgDrawLineForCommits: ', fromId, toId)
- var fromBbox = getElementCoords(svg.select('#node-' + fromId + ' circle'))
- var toBbox = getElementCoords(svg.select('#node-' + toId + ' circle'))
- switch (direction) {
- case 'LR':
- // (toBbox)
- // +--------
- // + (fromBbox)
- if (fromBbox.left - toBbox.left > config.nodeSpacing) {
- var lineStart = { x: fromBbox.left - config.nodeSpacing, y: toBbox.top + toBbox.height / 2 }
- var lineEnd = { x: toBbox.left + toBbox.width, y: toBbox.top + toBbox.height / 2 }
- svgDrawLine(svg, [lineStart, lineEnd], color, 'linear')
- svgDrawLine(svg, [
- { x: fromBbox.left, y: fromBbox.top + fromBbox.height / 2 },
- { x: fromBbox.left - config.nodeSpacing / 2, y: fromBbox.top + fromBbox.height / 2 },
- { x: fromBbox.left - config.nodeSpacing / 2, y: lineStart.y },
- lineStart], color)
- } else {
- svgDrawLine(svg, [{
- 'x': fromBbox.left,
- 'y': fromBbox.top + fromBbox.height / 2
- }, {
- 'x': fromBbox.left - config.nodeSpacing / 2,
- 'y': fromBbox.top + fromBbox.height / 2
- }, {
- 'x': fromBbox.left - config.nodeSpacing / 2,
- 'y': toBbox.top + toBbox.height / 2
- }, {
- 'x': toBbox.left + toBbox.width,
- 'y': toBbox.top + toBbox.height / 2
- }], color)
- }
- break
- case 'BT':
- // + (fromBbox)
- // |
- // |
- // + (toBbox)
- if (toBbox.top - fromBbox.top > config.nodeSpacing) {
- lineStart = { x: toBbox.left + toBbox.width / 2, y: fromBbox.top + fromBbox.height + config.nodeSpacing }
- lineEnd = { x: toBbox.left + toBbox.width / 2, y: toBbox.top }
- svgDrawLine(svg, [lineStart, lineEnd], color, 'linear')
- svgDrawLine(svg, [
- { x: fromBbox.left + fromBbox.width / 2, y: fromBbox.top + fromBbox.height },
- { x: fromBbox.left + fromBbox.width / 2, y: fromBbox.top + fromBbox.height + config.nodeSpacing / 2 },
- { x: toBbox.left + toBbox.width / 2, y: lineStart.y - config.nodeSpacing / 2 },
- lineStart], color)
- } else {
- svgDrawLine(svg, [{
- 'x': fromBbox.left + fromBbox.width / 2,
- 'y': fromBbox.top + fromBbox.height
- }, {
- 'x': fromBbox.left + fromBbox.width / 2,
- 'y': fromBbox.top + config.nodeSpacing / 2
- }, {
- 'x': toBbox.left + toBbox.width / 2,
- 'y': toBbox.top - config.nodeSpacing / 2
- }, {
- 'x': toBbox.left + toBbox.width / 2,
- 'y': toBbox.top
- }], color)
- }
- break
- }
-}
-
-function cloneNode (svg, selector) {
- return svg.select(selector).node().cloneNode(true)
-}
-
-function renderCommitHistory (svg, commitid, branches, direction) {
- var commit
- var numCommits = Object.keys(allCommitsDict).length
- if (_.isString(commitid)) {
- do {
- commit = allCommitsDict[commitid]
- log.debug('in renderCommitHistory', commit.id, commit.seq)
- if (svg.select('#node-' + commitid).size() > 0) {
- return
- }
- svg
- .append(function () {
- return cloneNode(svg, '#def-commit')
- })
- .attr('class', 'commit')
- .attr('id', function () {
- return 'node-' + commit.id
- })
- .attr('transform', function () {
- switch (direction) {
- case 'LR':
- return 'translate(' + (commit.seq * config.nodeSpacing + config.leftMargin) + ', ' +
- (branchNum * config.branchOffset) + ')'
- case 'BT':
- return 'translate(' + (branchNum * config.branchOffset + config.leftMargin) + ', ' +
- ((numCommits - commit.seq) * config.nodeSpacing) + ')'
- }
- })
- .attr('fill', config.nodeFillColor)
- .attr('stroke', config.nodeStrokeColor)
- .attr('stroke-width', config.nodeStrokeWidth)
-
- var branch = _.find(branches, ['commit', commit])
- if (branch) {
- log.debug('found branch ', branch.name)
- svg.select('#node-' + commit.id + ' p')
- .append('xhtml:span')
- .attr('class', 'branch-label')
- .text(branch.name + ', ')
- }
- svg.select('#node-' + commit.id + ' p')
- .append('xhtml:span')
- .attr('class', 'commit-id')
- .text(commit.id)
- if (commit.message !== '' && direction === 'BT') {
- svg.select('#node-' + commit.id + ' p')
- .append('xhtml:span')
- .attr('class', 'commit-msg')
- .text(', ' + commit.message)
- }
- commitid = commit.parent
- } while (commitid && allCommitsDict[commitid])
- }
-
- if (_.isArray(commitid)) {
- log.debug('found merge commmit', commitid)
- renderCommitHistory(svg, commitid[0], branches, direction)
- branchNum++
- renderCommitHistory(svg, commitid[1], branches, direction)
- branchNum--
- }
-}
-
-function renderLines (svg, commit, direction, branchColor) {
- branchColor = branchColor || 0
- while (commit.seq > 0 && !commit.lineDrawn) {
- if (_.isString(commit.parent)) {
- svgDrawLineForCommits(svg, commit.id, commit.parent, direction, branchColor)
- commit.lineDrawn = true
- commit = allCommitsDict[commit.parent]
- } else if (_.isArray(commit.parent)) {
- svgDrawLineForCommits(svg, commit.id, commit.parent[0], direction, branchColor)
- svgDrawLineForCommits(svg, commit.id, commit.parent[1], direction, branchColor + 1)
- renderLines(svg, allCommitsDict[commit.parent[1]], direction, branchColor + 1)
- commit.lineDrawn = true
- commit = allCommitsDict[commit.parent[0]]
- }
- }
-}
-
-exports.draw = function (txt, id, ver) {
- try {
- var parser
- parser = gitGraphParser.parser
- parser.yy = db
-
- log.debug('in gitgraph renderer', txt, id, ver)
- // Parse the graph definition
- parser.parse(txt + '\n')
-
- config = _.extend(config, apiConfig, db.getOptions())
- log.debug('effective options', config)
- var direction = db.getDirection()
- allCommitsDict = db.getCommits()
- var branches = db.getBranchesAsObjArray()
- if (direction === 'BT') {
- config.nodeLabel.x = branches.length * config.branchOffset
- config.nodeLabel.width = '100%'
- config.nodeLabel.y = -1 * 2 * config.nodeRadius
- }
- var svg = d3.select('#' + id)
- svgCreateDefs(svg)
- branchNum = 1
- _.each(branches, function (v) {
- renderCommitHistory(svg, v.commit.id, branches, direction)
- renderLines(svg, v.commit, direction)
- branchNum++
- })
- svg.attr('height', function () {
- if (direction === 'BT') return Object.keys(allCommitsDict).length * config.nodeSpacing
- return (branches.length + 1) * config.branchOffset
- })
- } catch (e) {
- log.error('Error while rendering gitgraph')
- log.error(e.message)
- }
-}
-
-},{"../../d3":379,"../../logger":400,"./gitGraphAst":393,"./parser/gitGraph":395,"lodash":292}],395:[function(require,module,exports){
-(function (process){
-/* parser generated by jison 0.4.17 */
-/*
- Returns a Parser object of the following structure:
-
- Parser: {
- yy: {}
- }
-
- Parser.prototype: {
- yy: {},
- trace: function(),
- symbols_: {associative list: name ==> number},
- terminals_: {associative list: number ==> name},
- productions_: [...],
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
- table: [...],
- defaultActions: {...},
- parseError: function(str, hash),
- parse: function(input),
-
- lexer: {
- EOF: 1,
- parseError: function(str, hash),
- setInput: function(input),
- input: function(),
- unput: function(str),
- more: function(),
- less: function(n),
- pastInput: function(),
- upcomingInput: function(),
- showPosition: function(),
- test_match: function(regex_match_array, rule_index),
- next: function(),
- lex: function(),
- begin: function(condition),
- popState: function(),
- _currentRules: function(),
- topState: function(),
- pushState: function(condition),
-
- options: {
- ranges: boolean (optional: true ==> token location info will include a .range[] member)
- flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
- backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
- },
-
- performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
- rules: [...],
- conditions: {associative list: name ==> set},
- }
- }
-
- token location info (@$, _$, etc.): {
- first_line: n,
- last_line: n,
- first_column: n,
- last_column: n,
- range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
- }
-
- the parseError function receives a 'hash' object with these members for lexer and parser errors: {
- text: (matched text)
- token: (the produced terminal token, if any)
- line: (yylineno)
- }
- while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
- loc: (yylloc)
- expected: (string describing the set of expected tokens)
- recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
- }
-*/
-var parser = (function () {
- var o = function (k, v, o, l) { for (o = o || {}, l = k.length; l--; o[k[l]] = v);return o }, $V0 = [2, 3], $V1 = [1, 7], $V2 = [7, 12, 15, 17, 19, 20, 21], $V3 = [7, 11, 12, 15, 17, 19, 20, 21], $V4 = [2, 20], $V5 = [1, 32]
- var parser = {trace: function trace () { },
- yy: {},
- symbols_: {'error': 2, 'start': 3, 'GG': 4, ':': 5, 'document': 6, 'EOF': 7, 'DIR': 8, 'options': 9, 'body': 10, 'OPT': 11, 'NL': 12, 'line': 13, 'statement': 14, 'COMMIT': 15, 'commit_arg': 16, 'BRANCH': 17, 'ID': 18, 'CHECKOUT': 19, 'MERGE': 20, 'RESET': 21, 'reset_arg': 22, 'STR': 23, 'HEAD': 24, 'reset_parents': 25, 'CARET': 26, '$accept': 0, '$end': 1},
- terminals_: {2: 'error', 4: 'GG', 5: ':', 7: 'EOF', 8: 'DIR', 11: 'OPT', 12: 'NL', 15: 'COMMIT', 17: 'BRANCH', 18: 'ID', 19: 'CHECKOUT', 20: 'MERGE', 21: 'RESET', 23: 'STR', 24: 'HEAD', 26: 'CARET'},
- productions_: [0, [3, 4], [3, 5], [6, 0], [6, 2], [9, 2], [9, 1], [10, 0], [10, 2], [13, 2], [13, 1], [14, 2], [14, 2], [14, 2], [14, 2], [14, 2], [16, 0], [16, 1], [22, 2], [22, 2], [25, 0], [25, 2]],
- performAction: function anonymous (yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
-/* this == yyval */
-
- var $0 = $$.length - 1
- switch (yystate) {
- case 1:
- return $$[$0 - 1]
- break
- case 2:
- yy.setDirection($$[$0 - 3]); return $$[$0 - 1]
- break
- case 4:
- yy.setOptions($$[$0 - 1]); this.$ = $$[$0]
- break
- case 5:
- $$[$0 - 1] += $$[$0]; this.$ = $$[$0 - 1]
- break
- case 7:
- this.$ = []
- break
- case 8:
- $$[$0 - 1].push($$[$0]); this.$ = $$[$0 - 1]
- break
- case 9:
- this.$ = $$[$0 - 1]
- break
- case 11:
- yy.commit($$[$0])
- break
- case 12:
- yy.branch($$[$0])
- break
- case 13:
- yy.checkout($$[$0])
- break
- case 14:
- yy.merge($$[$0])
- break
- case 15:
- yy.reset($$[$0])
- break
- case 16:
- this.$ = ''
- break
- case 17:
- this.$ = $$[$0]
- break
- case 18:
- this.$ = $$[$0 - 1] + ':' + $$[$0]
- break
- case 19:
- this.$ = $$[$0 - 1] + ':' + yy.count; yy.count = 0
- break
- case 20:
- yy.count = 0
- break
- case 21:
- yy.count += 1
- break
- }
- },
- table: [{3: 1, 4: [1, 2]}, {1: [3]}, {5: [1, 3], 8: [1, 4]}, {6: 5, 7: $V0, 9: 6, 12: $V1}, {5: [1, 8]}, {7: [1, 9]}, o($V2, [2, 7], {10: 10, 11: [1, 11]}), o($V3, [2, 6]), {6: 12, 7: $V0, 9: 6, 12: $V1}, {1: [2, 1]}, {7: [2, 4], 12: [1, 15], 13: 13, 14: 14, 15: [1, 16], 17: [1, 17], 19: [1, 18], 20: [1, 19], 21: [1, 20]}, o($V3, [2, 5]), {7: [1, 21]}, o($V2, [2, 8]), {12: [1, 22]}, o($V2, [2, 10]), {12: [2, 16], 16: 23, 23: [1, 24]}, {18: [1, 25]}, {18: [1, 26]}, {18: [1, 27]}, {18: [1, 30], 22: 28, 24: [1, 29]}, {1: [2, 2]}, o($V2, [2, 9]), {12: [2, 11]}, {12: [2, 17]}, {12: [2, 12]}, {12: [2, 13]}, {12: [2, 14]}, {12: [2, 15]}, {12: $V4, 25: 31, 26: $V5}, {12: $V4, 25: 33, 26: $V5}, {12: [2, 18]}, {12: $V4, 25: 34, 26: $V5}, {12: [2, 19]}, {12: [2, 21]}],
- defaultActions: {9: [2, 1], 21: [2, 2], 23: [2, 11], 24: [2, 17], 25: [2, 12], 26: [2, 13], 27: [2, 14], 28: [2, 15], 31: [2, 18], 33: [2, 19], 34: [2, 21]},
- parseError: function parseError (str, hash) {
- if (hash.recoverable) {
- this.trace(str)
- } else {
- function _parseError (msg, hash) {
- this.message = msg
- this.hash = hash
- }
- _parseError.prototype = Error
-
- throw new _parseError(str, hash)
- }
- },
- parse: function parse (input) {
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1
- var args = lstack.slice.call(arguments, 1)
- var lexer = Object.create(this.lexer)
- var sharedState = { yy: {} }
- for (var k in this.yy) {
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
- sharedState.yy[k] = this.yy[k]
- }
- }
- lexer.setInput(input, sharedState.yy)
- sharedState.yy.lexer = lexer
- sharedState.yy.parser = this
- if (typeof lexer.yylloc === 'undefined') {
- lexer.yylloc = {}
- }
- var yyloc = lexer.yylloc
- lstack.push(yyloc)
- var ranges = lexer.options && lexer.options.ranges
- if (typeof sharedState.yy.parseError === 'function') {
- this.parseError = sharedState.yy.parseError
- } else {
- this.parseError = Object.getPrototypeOf(this).parseError
- }
- function popStack (n) {
- stack.length = stack.length - 2 * n
- vstack.length = vstack.length - n
- lstack.length = lstack.length - n
- }
- var lex = function () {
- var token
- token = lexer.lex() || EOF
- if (typeof token !== 'number') {
- token = self.symbols_[token] || token
- }
- return token
- }
- var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected
- while (true) {
- state = stack[stack.length - 1]
- if (this.defaultActions[state]) {
- action = this.defaultActions[state]
- } else {
- if (symbol === null || typeof symbol === 'undefined') {
- symbol = lex()
- }
- action = table[state] && table[state][symbol]
- }
- if (typeof action === 'undefined' || !action.length || !action[0]) {
- var errStr = ''
- expected = []
- for (p in table[state]) {
- if (this.terminals_[p] && p > TERROR) {
- expected.push('\'' + this.terminals_[p] + '\'')
- }
- }
- if (lexer.showPosition) {
- errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''
- } else {
- errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'')
- }
- this.parseError(errStr, {
- text: lexer.match,
- token: this.terminals_[symbol] || symbol,
- line: lexer.yylineno,
- loc: yyloc,
- expected: expected
- })
- }
- if (action[0] instanceof Array && action.length > 1) {
- throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol)
- }
- switch (action[0]) {
- case 1:
- stack.push(symbol)
- vstack.push(lexer.yytext)
- lstack.push(lexer.yylloc)
- stack.push(action[1])
- symbol = null
- if (!preErrorSymbol) {
- yyleng = lexer.yyleng
- yytext = lexer.yytext
- yylineno = lexer.yylineno
- yyloc = lexer.yylloc
- if (recovering > 0) {
- recovering--
- }
- } else {
- symbol = preErrorSymbol
- preErrorSymbol = null
- }
- break
- case 2:
- len = this.productions_[action[1]][1]
- yyval.$ = vstack[vstack.length - len]
- yyval._$ = {
- first_line: lstack[lstack.length - (len || 1)].first_line,
- last_line: lstack[lstack.length - 1].last_line,
- first_column: lstack[lstack.length - (len || 1)].first_column,
- last_column: lstack[lstack.length - 1].last_column
- }
- if (ranges) {
- yyval._$.range = [
- lstack[lstack.length - (len || 1)].range[0],
- lstack[lstack.length - 1].range[1]
- ]
- }
- r = this.performAction.apply(yyval, [
- yytext,
- yyleng,
- yylineno,
- sharedState.yy,
- action[1],
- vstack,
- lstack
- ].concat(args))
- if (typeof r !== 'undefined') {
- return r
- }
- if (len) {
- stack = stack.slice(0, -1 * len * 2)
- vstack = vstack.slice(0, -1 * len)
- lstack = lstack.slice(0, -1 * len)
- }
- stack.push(this.productions_[action[1]][0])
- vstack.push(yyval.$)
- lstack.push(yyval._$)
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]]
- stack.push(newState)
- break
- case 3:
- return true
- }
- }
- return true
- }}
-/* generated by jison-lex 0.3.4 */
- var lexer = (function () {
- var lexer = ({
-
- EOF: 1,
-
- parseError: function parseError (str, hash) {
- if (this.yy.parser) {
- this.yy.parser.parseError(str, hash)
- } else {
- throw new Error(str)
- }
- },
-
-// resets the lexer, sets new input
- setInput: function (input, yy) {
- this.yy = yy || this.yy || {}
- this._input = input
- this._more = this._backtrack = this.done = false
- this.yylineno = this.yyleng = 0
- this.yytext = this.matched = this.match = ''
- this.conditionStack = ['INITIAL']
- this.yylloc = {
- first_line: 1,
- first_column: 0,
- last_line: 1,
- last_column: 0
- }
- if (this.options.ranges) {
- this.yylloc.range = [0, 0]
- }
- this.offset = 0
- return this
- },
-
-// consumes and returns one char from the input
- input: function () {
- var ch = this._input[0]
- this.yytext += ch
- this.yyleng++
- this.offset++
- this.match += ch
- this.matched += ch
- var lines = ch.match(/(?:\r\n?|\n).*/g)
- if (lines) {
- this.yylineno++
- this.yylloc.last_line++
- } else {
- this.yylloc.last_column++
- }
- if (this.options.ranges) {
- this.yylloc.range[1]++
- }
-
- this._input = this._input.slice(1)
- return ch
- },
-
-// unshifts one char (or a string) into the input
- unput: function (ch) {
- var len = ch.length
- var lines = ch.split(/(?:\r\n?|\n)/g)
-
- this._input = ch + this._input
- this.yytext = this.yytext.substr(0, this.yytext.length - len)
- // this.yyleng -= len;
- this.offset -= len
- var oldLines = this.match.split(/(?:\r\n?|\n)/g)
- this.match = this.match.substr(0, this.match.length - 1)
- this.matched = this.matched.substr(0, this.matched.length - 1)
-
- if (lines.length - 1) {
- this.yylineno -= lines.length - 1
- }
- var r = this.yylloc.range
-
- this.yylloc = {
- first_line: this.yylloc.first_line,
- last_line: this.yylineno + 1,
- first_column: this.yylloc.first_column,
- last_column: lines
- ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) +
- oldLines[oldLines.length - lines.length].length - lines[0].length
- : this.yylloc.first_column - len
- }
-
- if (this.options.ranges) {
- this.yylloc.range = [r[0], r[0] + this.yyleng - len]
- }
- this.yyleng = this.yytext.length
- return this
- },
-
-// When called from action, caches matched text and appends it on next action
- more: function () {
- this._more = true
- return this
- },
-
-// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
- reject: function () {
- if (this.options.backtrack_lexer) {
- this._backtrack = true
- } else {
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
- text: '',
- token: null,
- line: this.yylineno
- })
- }
- return this
- },
-
-// retain first n characters of the match
- less: function (n) {
- this.unput(this.match.slice(n))
- },
-
-// displays already matched input, i.e. for error messages
- pastInput: function () {
- var past = this.matched.substr(0, this.matched.length - this.match.length)
- return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '')
- },
-
-// displays upcoming input, i.e. for error messages
- upcomingInput: function () {
- var next = this.match
- if (next.length < 20) {
- next += this._input.substr(0, 20 - next.length)
- }
- return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '')
- },
-
-// displays the character position where the lexing error occurred, i.e. for error messages
- showPosition: function () {
- var pre = this.pastInput()
- var c = new Array(pre.length + 1).join('-')
- return pre + this.upcomingInput() + '\n' + c + '^'
- },
-
-// test the lexed token: return FALSE when not a match, otherwise return token
- test_match: function (match, indexed_rule) {
- var token,
- lines,
- backup
-
- if (this.options.backtrack_lexer) {
- // save context
- backup = {
- yylineno: this.yylineno,
- yylloc: {
- first_line: this.yylloc.first_line,
- last_line: this.last_line,
- first_column: this.yylloc.first_column,
- last_column: this.yylloc.last_column
- },
- yytext: this.yytext,
- match: this.match,
- matches: this.matches,
- matched: this.matched,
- yyleng: this.yyleng,
- offset: this.offset,
- _more: this._more,
- _input: this._input,
- yy: this.yy,
- conditionStack: this.conditionStack.slice(0),
- done: this.done
- }
- if (this.options.ranges) {
- backup.yylloc.range = this.yylloc.range.slice(0)
- }
- }
-
- lines = match[0].match(/(?:\r\n?|\n).*/g)
- if (lines) {
- this.yylineno += lines.length
- }
- this.yylloc = {
- first_line: this.yylloc.last_line,
- last_line: this.yylineno + 1,
- first_column: this.yylloc.last_column,
- last_column: lines
- ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length
- : this.yylloc.last_column + match[0].length
- }
- this.yytext += match[0]
- this.match += match[0]
- this.matches = match
- this.yyleng = this.yytext.length
- if (this.options.ranges) {
- this.yylloc.range = [this.offset, this.offset += this.yyleng]
- }
- this._more = false
- this._backtrack = false
- this._input = this._input.slice(match[0].length)
- this.matched += match[0]
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1])
- if (this.done && this._input) {
- this.done = false
- }
- if (token) {
- return token
- } else if (this._backtrack) {
- // recover context
- for (var k in backup) {
- this[k] = backup[k]
- }
- return false // rule action called reject() implying the next rule should be tested instead.
- }
- return false
- },
-
-// return next match in input
- next: function () {
- if (this.done) {
- return this.EOF
- }
- if (!this._input) {
- this.done = true
- }
-
- var token,
- match,
- tempMatch,
- index
- if (!this._more) {
- this.yytext = ''
- this.match = ''
- }
- var rules = this._currentRules()
- for (var i = 0; i < rules.length; i++) {
- tempMatch = this._input.match(this.rules[rules[i]])
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
- match = tempMatch
- index = i
- if (this.options.backtrack_lexer) {
- token = this.test_match(tempMatch, rules[i])
- if (token !== false) {
- return token
- } else if (this._backtrack) {
- match = false
- continue // rule action called reject() implying a rule MISmatch.
- } else {
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
- return false
- }
- } else if (!this.options.flex) {
- break
- }
- }
- }
- if (match) {
- token = this.test_match(match, rules[index])
- if (token !== false) {
- return token
- }
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
- return false
- }
- if (this._input === '') {
- return this.EOF
- } else {
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
- text: '',
- token: null,
- line: this.yylineno
- })
- }
- },
-
-// return next match that has a token
- lex: function lex () {
- var r = this.next()
- if (r) {
- return r
- } else {
- return this.lex()
- }
- },
-
-// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
- begin: function begin (condition) {
- this.conditionStack.push(condition)
- },
-
-// pop the previously active lexer condition state off the condition stack
- popState: function popState () {
- var n = this.conditionStack.length - 1
- if (n > 0) {
- return this.conditionStack.pop()
- } else {
- return this.conditionStack[0]
- }
- },
-
-// produce the lexer rule set which is active for the currently active lexer condition state
- _currentRules: function _currentRules () {
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules
- } else {
- return this.conditions['INITIAL'].rules
- }
- },
-
-// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
- topState: function topState (n) {
- n = this.conditionStack.length - 1 - Math.abs(n || 0)
- if (n >= 0) {
- return this.conditionStack[n]
- } else {
- return 'INITIAL'
- }
- },
-
-// alias for begin(condition)
- pushState: function pushState (condition) {
- this.begin(condition)
- },
-
-// return the number of states currently on the stack
- stateStackSize: function stateStackSize () {
- return this.conditionStack.length
- },
- options: {'case-insensitive': true},
- performAction: function anonymous (yy, yy_, $avoiding_name_collisions, YY_START) {
- var YYSTATE = YY_START
- switch ($avoiding_name_collisions) {
- case 0:return 12
- break
- case 1:/* skip all whitespace */
- break
- case 2:/* skip comments */
- break
- case 3:/* skip comments */
- break
- case 4:return 4
- break
- case 5:return 15
- break
- case 6:return 17
- break
- case 7:return 20
- break
- case 8:return 21
- break
- case 9:return 19
- break
- case 10:return 8
- break
- case 11:return 8
- break
- case 12:return 5
- break
- case 13:return 26
- break
- case 14:this.begin('options')
- break
- case 15:this.popState()
- break
- case 16:return 11
- break
- case 17:this.begin('string')
- break
- case 18:this.popState()
- break
- case 19:return 23
- break
- case 20:return 18
- break
- case 21:return 7
- break
- }
- },
- rules: [/^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:gitGraph\b)/i, /^(?:commit\b)/i, /^(?:branch\b)/i, /^(?:merge\b)/i, /^(?:reset\b)/i, /^(?:checkout\b)/i, /^(?:LR\b)/i, /^(?:BT\b)/i, /^(?::)/i, /^(?:\^)/i, /^(?:options\r?\n)/i, /^(?:end\r?\n)/i, /^(?:[^\n]+\r?\n)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[a-zA-Z][a-zA-Z0-9_]+)/i, /^(?:$)/i],
- conditions: {'options': {'rules': [15, 16], 'inclusive': false}, 'string': {'rules': [18, 19], 'inclusive': false}, 'INITIAL': {'rules': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, 21], 'inclusive': true}}
- })
- return lexer
- })()
- parser.lexer = lexer
- function Parser () {
- this.yy = {}
- }
- Parser.prototype = parser; parser.Parser = Parser
- return new Parser()
-})()
-
-if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
- exports.parser = parser
- exports.Parser = parser.Parser
- exports.parse = function () { return parser.parse.apply(parser, arguments) }
- exports.main = function commonjsMain (args) {
- if (!args[1]) {
- console.log('Usage: ' + args[0] + ' FILE')
- process.exit(1)
- }
- var source = require('fs').readFileSync(require('path').normalize(args[1]), 'utf8')
- return exports.parser.parse(source)
- }
- if (typeof module !== 'undefined' && require.main === module) {
- exports.main(process.argv.slice(1))
- }
-}
-
-}).call(this,require('_process'))
-},{"_process":406,"fs":7,"path":405}],396:[function(require,module,exports){
-(function (process){
-/* parser generated by jison 0.4.17 */
-/*
- Returns a Parser object of the following structure:
-
- Parser: {
- yy: {}
- }
-
- Parser.prototype: {
- yy: {},
- trace: function(),
- symbols_: {associative list: name ==> number},
- terminals_: {associative list: number ==> name},
- productions_: [...],
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
- table: [...],
- defaultActions: {...},
- parseError: function(str, hash),
- parse: function(input),
-
- lexer: {
- EOF: 1,
- parseError: function(str, hash),
- setInput: function(input),
- input: function(),
- unput: function(str),
- more: function(),
- less: function(n),
- pastInput: function(),
- upcomingInput: function(),
- showPosition: function(),
- test_match: function(regex_match_array, rule_index),
- next: function(),
- lex: function(),
- begin: function(condition),
- popState: function(),
- _currentRules: function(),
- topState: function(),
- pushState: function(condition),
-
- options: {
- ranges: boolean (optional: true ==> token location info will include a .range[] member)
- flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
- backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
- },
-
- performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
- rules: [...],
- conditions: {associative list: name ==> set},
- }
- }
-
- token location info (@$, _$, etc.): {
- first_line: n,
- last_line: n,
- first_column: n,
- last_column: n,
- range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
- }
-
- the parseError function receives a 'hash' object with these members for lexer and parser errors: {
- text: (matched text)
- token: (the produced terminal token, if any)
- line: (yylineno)
- }
- while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
- loc: (yylloc)
- expected: (string describing the set of expected tokens)
- recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
- }
-*/
-var parser = (function () {
- var o = function (k, v, o, l) { for (o = o || {}, l = k.length; l--; o[k[l]] = v);return o }, $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 4], $V3 = [2, 4], $V4 = [1, 9], $V5 = [1, 11], $V6 = [1, 12], $V7 = [1, 14], $V8 = [1, 15], $V9 = [1, 17], $Va = [1, 18], $Vb = [1, 19], $Vc = [1, 20], $Vd = [1, 21], $Ve = [1, 23], $Vf = [1, 24], $Vg = [1, 4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 24, 25, 27, 28, 39], $Vh = [1, 32], $Vi = [4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 28, 39], $Vj = [4, 5, 10, 15, 16, 18, 20, 21, 22, 23, 25, 27, 28, 39], $Vk = [37, 38, 39]
- var parser = {trace: function trace () { },
- yy: {},
- symbols_: {'error': 2, 'start': 3, 'SPACE': 4, 'NL': 5, 'SD': 6, 'document': 7, 'line': 8, 'statement': 9, 'participant': 10, 'actor': 11, 'AS': 12, 'restOfLine': 13, 'signal': 14, 'activate': 15, 'deactivate': 16, 'note_statement': 17, 'title': 18, 'text2': 19, 'loop': 20, 'end': 21, 'opt': 22, 'alt': 23, 'else': 24, 'par': 25, 'par_sections': 26, 'and': 27, 'note': 28, 'placement': 29, 'over': 30, 'actor_pair': 31, 'spaceList': 32, ',': 33, 'left_of': 34, 'right_of': 35, 'signaltype': 36, '+': 37, '-': 38, 'ACTOR': 39, 'SOLID_OPEN_ARROW': 40, 'DOTTED_OPEN_ARROW': 41, 'SOLID_ARROW': 42, 'DOTTED_ARROW': 43, 'SOLID_CROSS': 44, 'DOTTED_CROSS': 45, 'TXT': 46, '$accept': 0, '$end': 1},
- terminals_: {2: 'error', 4: 'SPACE', 5: 'NL', 6: 'SD', 10: 'participant', 12: 'AS', 13: 'restOfLine', 15: 'activate', 16: 'deactivate', 18: 'title', 20: 'loop', 21: 'end', 22: 'opt', 23: 'alt', 24: 'else', 25: 'par', 27: 'and', 28: 'note', 30: 'over', 33: ',', 34: 'left_of', 35: 'right_of', 37: '+', 38: '-', 39: 'ACTOR', 40: 'SOLID_OPEN_ARROW', 41: 'DOTTED_OPEN_ARROW', 42: 'SOLID_ARROW', 43: 'DOTTED_ARROW', 44: 'SOLID_CROSS', 45: 'DOTTED_CROSS', 46: 'TXT'},
- productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [9, 5], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 3], [9, 4], [9, 4], [9, 7], [9, 4], [26, 1], [26, 4], [17, 4], [17, 4], [32, 2], [32, 1], [31, 3], [31, 1], [29, 1], [29, 1], [14, 5], [14, 5], [14, 4], [11, 1], [36, 1], [36, 1], [36, 1], [36, 1], [36, 1], [36, 1], [19, 1]],
- performAction: function anonymous (yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
-/* this == yyval */
-
- var $0 = $$.length - 1
- switch (yystate) {
- case 3:
- yy.apply($$[$0]); return $$[$0]
- break
- case 4:
- this.$ = []
- break
- case 5:
- $$[$0 - 1].push($$[$0]); this.$ = $$[$0 - 1]
- break
- case 6: case 7:
- this.$ = $$[$0]
- break
- case 8:
- this.$ = []
- break
- case 9:
- $$[$0 - 3].description = $$[$0 - 1]; this.$ = $$[$0 - 3]
- break
- case 10:
- this.$ = $$[$0 - 1]
- break
- case 12:
- this.$ = {type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1]}
- break
- case 13:
- this.$ = {type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1]}
- break
- case 15:
- this.$ = [{type: 'setTitle', text: $$[$0 - 1]}]
- break
- case 16:
-
- $$[$0 - 1].unshift({type: 'loopStart', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_START})
- $$[$0 - 1].push({type: 'loopEnd', loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_END})
- this.$ = $$[$0 - 1]
- break
- case 17:
-
- $$[$0 - 1].unshift({type: 'optStart', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_START})
- $$[$0 - 1].push({type: 'optEnd', optText: $$[$0 - 2], signalType: yy.LINETYPE.OPT_END})
- this.$ = $$[$0 - 1]
- break
- case 18:
-
- // Alt start
- $$[$0 - 4].unshift({type: 'altStart', altText: $$[$0 - 5], signalType: yy.LINETYPE.ALT_START})
- // Content in alt is already in $$[$0-4]
- // Else
- $$[$0 - 4].push({type: 'else', altText: $$[$0 - 2], signalType: yy.LINETYPE.ALT_ELSE})
- // Content in other alt
- $$[$0 - 4] = $$[$0 - 4].concat($$[$0 - 1])
- // End
- $$[$0 - 4].push({type: 'altEnd', signalType: yy.LINETYPE.ALT_END})
-
- this.$ = $$[$0 - 4]
- break
- case 19:
-
- // Parallel start
- $$[$0 - 1].unshift({type: 'parStart', parText: $$[$0 - 2], signalType: yy.LINETYPE.PAR_START})
- // Content in par is already in $$[$0-1]
- // End
- $$[$0 - 1].push({type: 'parEnd', signalType: yy.LINETYPE.PAR_END})
- this.$ = $$[$0 - 1]
- break
- case 21:
- this.$ = $$[$0 - 3].concat([{type: 'and', parText: $$[$0 - 1], signalType: yy.LINETYPE.PAR_AND}, $$[$0]])
- break
- case 22:
-
- this.$ = [$$[$0 - 1], {type: 'addNote', placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0]}]
- break
- case 23:
-
- // Coerce actor_pair into a [to, from, ...] array
- $$[$0 - 2] = [].concat($$[$0 - 1], $$[$0 - 1]).slice(0, 2)
- $$[$0 - 2][0] = $$[$0 - 2][0].actor
- $$[$0 - 2][1] = $$[$0 - 2][1].actor
- this.$ = [$$[$0 - 1], {type: 'addNote', placement: yy.PLACEMENT.OVER, actor: $$[$0 - 2].slice(0, 2), text: $$[$0]}]
- break
- case 26:
- this.$ = [$$[$0 - 2], $$[$0]]
- break
- case 27:
- this.$ = $$[$0]
- break
- case 28:
- this.$ = yy.PLACEMENT.LEFTOF
- break
- case 29:
- this.$ = yy.PLACEMENT.RIGHTOF
- break
- case 30:
- this.$ = [$$[$0 - 4], $$[$0 - 1], {type: 'addMessage', from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0]},
- {type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1]}
- ]
- break
- case 31:
- this.$ = [$$[$0 - 4], $$[$0 - 1], {type: 'addMessage', from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0]},
- {type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 4]}
- ]
- break
- case 32:
- this.$ = [$$[$0 - 3], $$[$0 - 1], {type: 'addMessage', from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0]}]
- break
- case 33:
- this.$ = {type: 'addActor', actor: $$[$0]}
- break
- case 34:
- this.$ = yy.LINETYPE.SOLID_OPEN
- break
- case 35:
- this.$ = yy.LINETYPE.DOTTED_OPEN
- break
- case 36:
- this.$ = yy.LINETYPE.SOLID
- break
- case 37:
- this.$ = yy.LINETYPE.DOTTED
- break
- case 38:
- this.$ = yy.LINETYPE.SOLID_CROSS
- break
- case 39:
- this.$ = yy.LINETYPE.DOTTED_CROSS
- break
- case 40:
- this.$ = $$[$0].substring(1).trim().replace(/\\n/gm, '\n')
- break
- }
- },
- table: [{3: 1, 4: $V0, 5: $V1, 6: $V2}, {1: [3]}, {3: 5, 4: $V0, 5: $V1, 6: $V2}, {3: 6, 4: $V0, 5: $V1, 6: $V2}, o([1, 4, 5, 10, 15, 16, 18, 20, 22, 23, 25, 28, 39], $V3, {7: 7}), {1: [2, 1]}, {1: [2, 2]}, {1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 28: $Ve, 39: $Vf}, o($Vg, [2, 5]), {9: 25, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 25: $Vd, 28: $Ve, 39: $Vf}, o($Vg, [2, 7]), o($Vg, [2, 8]), {11: 26, 39: $Vf}, {5: [1, 27]}, {11: 28, 39: $Vf}, {11: 29, 39: $Vf}, {5: [1, 30]}, {19: 31, 46: $Vh}, {13: [1, 33]}, {13: [1, 34]}, {13: [1, 35]}, {13: [1, 36]}, {36: 37, 40: [1, 38], 41: [1, 39], 42: [1, 40], 43: [1, 41], 44: [1, 42], 45: [1, 43]}, {29: 44, 30: [1, 45], 34: [1, 46], 35: [1, 47]}, o([5, 12, 33, 40, 41, 42, 43, 44, 45, 46], [2, 33]), o($Vg, [2, 6]), {5: [1, 49], 12: [1, 48]}, o($Vg, [2, 11]), {5: [1, 50]}, {5: [1, 51]}, o($Vg, [2, 14]), {5: [1, 52]}, {5: [2, 40]}, o($Vi, $V3, {7: 53}), o($Vi, $V3, {7: 54}), o([4, 5, 10, 15, 16, 18, 20, 22, 23, 24, 25, 28, 39], $V3, {7: 55}), o($Vj, $V3, {26: 56, 7: 57}), {11: 60, 37: [1, 58], 38: [1, 59], 39: $Vf}, o($Vk, [2, 34]), o($Vk, [2, 35]), o($Vk, [2, 36]), o($Vk, [2, 37]), o($Vk, [2, 38]), o($Vk, [2, 39]), {11: 61, 39: $Vf}, {11: 63, 31: 62, 39: $Vf}, {39: [2, 28]}, {39: [2, 29]}, {13: [1, 64]}, o($Vg, [2, 10]), o($Vg, [2, 12]), o($Vg, [2, 13]), o($Vg, [2, 15]), {4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 65], 22: $Vb, 23: $Vc, 25: $Vd, 28: $Ve, 39: $Vf}, {4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 66], 22: $Vb, 23: $Vc, 25: $Vd, 28: $Ve, 39: $Vf}, {4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 22: $Vb, 23: $Vc, 24: [1, 67], 25: $Vd, 28: $Ve, 39: $Vf}, {21: [1, 68]}, {4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [2, 20], 22: $Vb, 23: $Vc, 25: $Vd, 27: [1, 69], 28: $Ve, 39: $Vf}, {11: 70, 39: $Vf}, {11: 71, 39: $Vf}, {19: 72, 46: $Vh}, {19: 73, 46: $Vh}, {19: 74, 46: $Vh}, {33: [1, 75], 46: [2, 27]}, {5: [1, 76]}, o($Vg, [2, 16]), o($Vg, [2, 17]), {13: [1, 77]}, o($Vg, [2, 19]), {13: [1, 78]}, {19: 79, 46: $Vh}, {19: 80, 46: $Vh}, {5: [2, 32]}, {5: [2, 22]}, {5: [2, 23]}, {11: 81, 39: $Vf}, o($Vg, [2, 9]), o($Vi, $V3, {7: 82}), o($Vj, $V3, {7: 57, 26: 83}), {5: [2, 30]}, {5: [2, 31]}, {46: [2, 26]}, {4: $V4, 5: $V5, 8: 8, 9: 10, 10: $V6, 11: 22, 14: 13, 15: $V7, 16: $V8, 17: 16, 18: $V9, 20: $Va, 21: [1, 84], 22: $Vb, 23: $Vc, 25: $Vd, 28: $Ve, 39: $Vf}, {21: [2, 21]}, o($Vg, [2, 18])],
- defaultActions: {5: [2, 1], 6: [2, 2], 32: [2, 40], 46: [2, 28], 47: [2, 29], 72: [2, 32], 73: [2, 22], 74: [2, 23], 79: [2, 30], 80: [2, 31], 81: [2, 26], 83: [2, 21]},
- parseError: function parseError (str, hash) {
- if (hash.recoverable) {
- this.trace(str)
- } else {
- var error = new Error(str)
- error.hash = hash
- throw error
- }
- },
- parse: function parse (input) {
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1
- var args = lstack.slice.call(arguments, 1)
- var lexer = Object.create(this.lexer)
- var sharedState = { yy: {} }
- for (var k in this.yy) {
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
- sharedState.yy[k] = this.yy[k]
- }
- }
- lexer.setInput(input, sharedState.yy)
- sharedState.yy.lexer = lexer
- sharedState.yy.parser = this
- if (typeof lexer.yylloc === 'undefined') {
- lexer.yylloc = {}
- }
- var yyloc = lexer.yylloc
- lstack.push(yyloc)
- var ranges = lexer.options && lexer.options.ranges
- if (typeof sharedState.yy.parseError === 'function') {
- this.parseError = sharedState.yy.parseError
- } else {
- this.parseError = Object.getPrototypeOf(this).parseError
- }
- function popStack (n) {
- stack.length = stack.length - 2 * n
- vstack.length = vstack.length - n
- lstack.length = lstack.length - n
- }
- var lex = function () {
- var token
- token = lexer.lex() || EOF
- if (typeof token !== 'number') {
- token = self.symbols_[token] || token
- }
- return token
- }
- var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected
- while (true) {
- state = stack[stack.length - 1]
- if (this.defaultActions[state]) {
- action = this.defaultActions[state]
- } else {
- if (symbol === null || typeof symbol === 'undefined') {
- symbol = lex()
- }
- action = table[state] && table[state][symbol]
- }
- if (typeof action === 'undefined' || !action.length || !action[0]) {
- var errStr = ''
- expected = []
- for (p in table[state]) {
- if (this.terminals_[p] && p > TERROR) {
- expected.push('\'' + this.terminals_[p] + '\'')
- }
- }
- if (lexer.showPosition) {
- errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''
- } else {
- errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'')
- }
- this.parseError(errStr, {
- text: lexer.match,
- token: this.terminals_[symbol] || symbol,
- line: lexer.yylineno,
- loc: yyloc,
- expected: expected
- })
- }
- if (action[0] instanceof Array && action.length > 1) {
- throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol)
- }
- switch (action[0]) {
- case 1:
- stack.push(symbol)
- vstack.push(lexer.yytext)
- lstack.push(lexer.yylloc)
- stack.push(action[1])
- symbol = null
- if (!preErrorSymbol) {
- yyleng = lexer.yyleng
- yytext = lexer.yytext
- yylineno = lexer.yylineno
- yyloc = lexer.yylloc
- if (recovering > 0) {
- recovering--
- }
- } else {
- symbol = preErrorSymbol
- preErrorSymbol = null
- }
- break
- case 2:
- len = this.productions_[action[1]][1]
- yyval.$ = vstack[vstack.length - len]
- yyval._$ = {
- first_line: lstack[lstack.length - (len || 1)].first_line,
- last_line: lstack[lstack.length - 1].last_line,
- first_column: lstack[lstack.length - (len || 1)].first_column,
- last_column: lstack[lstack.length - 1].last_column
- }
- if (ranges) {
- yyval._$.range = [
- lstack[lstack.length - (len || 1)].range[0],
- lstack[lstack.length - 1].range[1]
- ]
- }
- r = this.performAction.apply(yyval, [
- yytext,
- yyleng,
- yylineno,
- sharedState.yy,
- action[1],
- vstack,
- lstack
- ].concat(args))
- if (typeof r !== 'undefined') {
- return r
- }
- if (len) {
- stack = stack.slice(0, -1 * len * 2)
- vstack = vstack.slice(0, -1 * len)
- lstack = lstack.slice(0, -1 * len)
- }
- stack.push(this.productions_[action[1]][0])
- vstack.push(yyval.$)
- lstack.push(yyval._$)
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]]
- stack.push(newState)
- break
- case 3:
- return true
- }
- }
- return true
- }}
-
-/* generated by jison-lex 0.3.4 */
- var lexer = (function () {
- var lexer = ({
-
- EOF: 1,
-
- parseError: function parseError (str, hash) {
- if (this.yy.parser) {
- this.yy.parser.parseError(str, hash)
- } else {
- throw new Error(str)
- }
- },
-
-// resets the lexer, sets new input
- setInput: function (input, yy) {
- this.yy = yy || this.yy || {}
- this._input = input
- this._more = this._backtrack = this.done = false
- this.yylineno = this.yyleng = 0
- this.yytext = this.matched = this.match = ''
- this.conditionStack = ['INITIAL']
- this.yylloc = {
- first_line: 1,
- first_column: 0,
- last_line: 1,
- last_column: 0
- }
- if (this.options.ranges) {
- this.yylloc.range = [0, 0]
- }
- this.offset = 0
- return this
- },
-
-// consumes and returns one char from the input
- input: function () {
- var ch = this._input[0]
- this.yytext += ch
- this.yyleng++
- this.offset++
- this.match += ch
- this.matched += ch
- var lines = ch.match(/(?:\r\n?|\n).*/g)
- if (lines) {
- this.yylineno++
- this.yylloc.last_line++
- } else {
- this.yylloc.last_column++
- }
- if (this.options.ranges) {
- this.yylloc.range[1]++
- }
-
- this._input = this._input.slice(1)
- return ch
- },
-
-// unshifts one char (or a string) into the input
- unput: function (ch) {
- var len = ch.length
- var lines = ch.split(/(?:\r\n?|\n)/g)
-
- this._input = ch + this._input
- this.yytext = this.yytext.substr(0, this.yytext.length - len)
- // this.yyleng -= len;
- this.offset -= len
- var oldLines = this.match.split(/(?:\r\n?|\n)/g)
- this.match = this.match.substr(0, this.match.length - 1)
- this.matched = this.matched.substr(0, this.matched.length - 1)
-
- if (lines.length - 1) {
- this.yylineno -= lines.length - 1
- }
- var r = this.yylloc.range
-
- this.yylloc = {
- first_line: this.yylloc.first_line,
- last_line: this.yylineno + 1,
- first_column: this.yylloc.first_column,
- last_column: lines
- ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) +
- oldLines[oldLines.length - lines.length].length - lines[0].length
- : this.yylloc.first_column - len
- }
-
- if (this.options.ranges) {
- this.yylloc.range = [r[0], r[0] + this.yyleng - len]
- }
- this.yyleng = this.yytext.length
- return this
- },
-
-// When called from action, caches matched text and appends it on next action
- more: function () {
- this._more = true
- return this
- },
-
-// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
- reject: function () {
- if (this.options.backtrack_lexer) {
- this._backtrack = true
- } else {
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
- text: '',
- token: null,
- line: this.yylineno
- })
- }
- return this
- },
-
-// retain first n characters of the match
- less: function (n) {
- this.unput(this.match.slice(n))
- },
-
-// displays already matched input, i.e. for error messages
- pastInput: function () {
- var past = this.matched.substr(0, this.matched.length - this.match.length)
- return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '')
- },
-
-// displays upcoming input, i.e. for error messages
- upcomingInput: function () {
- var next = this.match
- if (next.length < 20) {
- next += this._input.substr(0, 20 - next.length)
- }
- return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '')
- },
-
-// displays the character position where the lexing error occurred, i.e. for error messages
- showPosition: function () {
- var pre = this.pastInput()
- var c = new Array(pre.length + 1).join('-')
- return pre + this.upcomingInput() + '\n' + c + '^'
- },
-
-// test the lexed token: return FALSE when not a match, otherwise return token
- test_match: function (match, indexed_rule) {
- var token,
- lines,
- backup
-
- if (this.options.backtrack_lexer) {
- // save context
- backup = {
- yylineno: this.yylineno,
- yylloc: {
- first_line: this.yylloc.first_line,
- last_line: this.last_line,
- first_column: this.yylloc.first_column,
- last_column: this.yylloc.last_column
- },
- yytext: this.yytext,
- match: this.match,
- matches: this.matches,
- matched: this.matched,
- yyleng: this.yyleng,
- offset: this.offset,
- _more: this._more,
- _input: this._input,
- yy: this.yy,
- conditionStack: this.conditionStack.slice(0),
- done: this.done
- }
- if (this.options.ranges) {
- backup.yylloc.range = this.yylloc.range.slice(0)
- }
- }
-
- lines = match[0].match(/(?:\r\n?|\n).*/g)
- if (lines) {
- this.yylineno += lines.length
- }
- this.yylloc = {
- first_line: this.yylloc.last_line,
- last_line: this.yylineno + 1,
- first_column: this.yylloc.last_column,
- last_column: lines
- ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length
- : this.yylloc.last_column + match[0].length
- }
- this.yytext += match[0]
- this.match += match[0]
- this.matches = match
- this.yyleng = this.yytext.length
- if (this.options.ranges) {
- this.yylloc.range = [this.offset, this.offset += this.yyleng]
- }
- this._more = false
- this._backtrack = false
- this._input = this._input.slice(match[0].length)
- this.matched += match[0]
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1])
- if (this.done && this._input) {
- this.done = false
- }
- if (token) {
- return token
- } else if (this._backtrack) {
- // recover context
- for (var k in backup) {
- this[k] = backup[k]
- }
- return false // rule action called reject() implying the next rule should be tested instead.
- }
- return false
- },
-
-// return next match in input
- next: function () {
- if (this.done) {
- return this.EOF
- }
- if (!this._input) {
- this.done = true
- }
-
- var token,
- match,
- tempMatch,
- index
- if (!this._more) {
- this.yytext = ''
- this.match = ''
- }
- var rules = this._currentRules()
- for (var i = 0; i < rules.length; i++) {
- tempMatch = this._input.match(this.rules[rules[i]])
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
- match = tempMatch
- index = i
- if (this.options.backtrack_lexer) {
- token = this.test_match(tempMatch, rules[i])
- if (token !== false) {
- return token
- } else if (this._backtrack) {
- match = false
- continue // rule action called reject() implying a rule MISmatch.
- } else {
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
- return false
- }
- } else if (!this.options.flex) {
- break
- }
- }
- }
- if (match) {
- token = this.test_match(match, rules[index])
- if (token !== false) {
- return token
- }
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
- return false
- }
- if (this._input === '') {
- return this.EOF
- } else {
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
- text: '',
- token: null,
- line: this.yylineno
- })
- }
- },
-
-// return next match that has a token
- lex: function lex () {
- var r = this.next()
- if (r) {
- return r
- } else {
- return this.lex()
- }
- },
-
-// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
- begin: function begin (condition) {
- this.conditionStack.push(condition)
- },
-
-// pop the previously active lexer condition state off the condition stack
- popState: function popState () {
- var n = this.conditionStack.length - 1
- if (n > 0) {
- return this.conditionStack.pop()
- } else {
- return this.conditionStack[0]
- }
- },
-
-// produce the lexer rule set which is active for the currently active lexer condition state
- _currentRules: function _currentRules () {
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules
- } else {
- return this.conditions['INITIAL'].rules
- }
- },
-
-// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
- topState: function topState (n) {
- n = this.conditionStack.length - 1 - Math.abs(n || 0)
- if (n >= 0) {
- return this.conditionStack[n]
- } else {
- return 'INITIAL'
- }
- },
-
-// alias for begin(condition)
- pushState: function pushState (condition) {
- this.begin(condition)
- },
-
-// return the number of states currently on the stack
- stateStackSize: function stateStackSize () {
- return this.conditionStack.length
- },
- options: {'case-insensitive': true},
- performAction: function anonymous (yy, yy_, $avoiding_name_collisions, YY_START) {
- var YYSTATE = YY_START
- switch ($avoiding_name_collisions) {
- case 0:return 5
- break
- case 1:/* skip all whitespace */
- break
- case 2:/* skip same-line whitespace */
- break
- case 3:/* skip comments */
- break
- case 4:/* skip comments */
- break
- case 5: this.begin('ID'); return 10
- break
- case 6: this.begin('ALIAS'); return 39
- break
- case 7: this.popState(); this.popState(); this.begin('LINE'); return 12
- break
- case 8: this.popState(); this.popState(); return 5
- break
- case 9: this.begin('LINE'); return 20
- break
- case 10: this.begin('LINE'); return 22
- break
- case 11: this.begin('LINE'); return 23
- break
- case 12: this.begin('LINE'); return 24
- break
- case 13: this.begin('LINE'); return 25
- break
- case 14: this.begin('LINE'); return 27
- break
- case 15: this.popState(); return 13
- break
- case 16:return 21
- break
- case 17:return 34
- break
- case 18:return 35
- break
- case 19:return 30
- break
- case 20:return 28
- break
- case 21: this.begin('ID'); return 15
- break
- case 22: this.begin('ID'); return 16
- break
- case 23:return 18
- break
- case 24:return 6
- break
- case 25:return 33
- break
- case 26:return 5
- break
- case 27: yy_.yytext = yy_.yytext.trim(); return 39
- break
- case 28:return 42
- break
- case 29:return 43
- break
- case 30:return 40
- break
- case 31:return 41
- break
- case 32:return 44
- break
- case 33:return 45
- break
- case 34:return 46
- break
- case 35:return 37
- break
- case 36:return 38
- break
- case 37:return 5
- break
- case 38:return 'INVALID'
- break
- }
- },
- rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:participant\b)/i, /^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:and\b)/i, /^(?:[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\b)/i, /^(?:sequenceDiagram\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\->:\n,;]+)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?::[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
- conditions: {'LINE': {'rules': [2, 3, 15], 'inclusive': false}, 'ALIAS': {'rules': [2, 3, 7, 8], 'inclusive': false}, 'ID': {'rules': [2, 3, 6], 'inclusive': false}, 'INITIAL': {'rules': [0, 1, 3, 4, 5, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38], 'inclusive': true}}
- })
- return lexer
- })()
- parser.lexer = lexer
- function Parser () {
- this.yy = {}
- }
- Parser.prototype = parser; parser.Parser = Parser
- return new Parser()
-})()
-
-if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
- exports.parser = parser
- exports.Parser = parser.Parser
- exports.parse = function () { return parser.parse.apply(parser, arguments) }
- exports.main = function commonjsMain (args) {
- if (!args[1]) {
- console.log('Usage: ' + args[0] + ' FILE')
- process.exit(1)
- }
- var source = require('fs').readFileSync(require('path').normalize(args[1]), 'utf8')
- return exports.parser.parse(source)
- }
- if (typeof module !== 'undefined' && require.main === module) {
- exports.main(process.argv.slice(1))
- }
-}
-
-}).call(this,require('_process'))
-},{"_process":406,"fs":7,"path":405}],397:[function(require,module,exports){
-(function (global){
-/**
- * Created by knut on 14-11-19.
- */
-var actors = {}
-var messages = []
-var notes = []
-var title = ''
-var Logger = require('../../logger')
-var log = Logger.Log
-
-exports.addActor = function (id, name, description) {
- // Don't allow description nulling
- var old = actors[id]
- if (old && name === old.name && description == null) return
-
- // Don't allow null descriptions, either
- if (description == null) description = name
-
- actors[id] = { name: name, description: description }
-}
-
-exports.addMessage = function (idFrom, idTo, message, answer) {
- messages.push({ from: idFrom, to: idTo, message: message, answer: answer })
-}
-
-exports.addSignal = function (idFrom, idTo, message, messageType) {
- log.debug('Adding message from=' + idFrom + ' to=' + idTo + ' message=' + message + ' type=' + messageType)
- messages.push({ from: idFrom, to: idTo, message: message, type: messageType })
-}
-
-exports.getMessages = function () {
- return messages
-}
-
-exports.getActors = function () {
- return actors
-}
-exports.getActor = function (id) {
- return actors[id]
-}
-exports.getActorKeys = function () {
- return Object.keys(actors)
-}
-exports.getTitle = function () {
- return title
-}
-
-exports.clear = function () {
- actors = {}
- messages = []
-}
-
-exports.LINETYPE = {
- SOLID: 0,
- DOTTED: 1,
- NOTE: 2,
- SOLID_CROSS: 3,
- DOTTED_CROSS: 4,
- SOLID_OPEN: 5,
- DOTTED_OPEN: 6,
- LOOP_START: 10,
- LOOP_END: 11,
- ALT_START: 12,
- ALT_ELSE: 13,
- ALT_END: 14,
- OPT_START: 15,
- OPT_END: 16,
- ACTIVE_START: 17,
- ACTIVE_END: 18,
- PAR_START: 19,
- PAR_AND: 20,
- PAR_END: 21
-}
-
-exports.ARROWTYPE = {
- FILLED: 0,
- OPEN: 1
-}
-
-exports.PLACEMENT = {
- LEFTOF: 0,
- RIGHTOF: 1,
- OVER: 2
-}
-
-exports.addNote = function (actor, placement, message) {
- var note = { actor: actor, placement: placement, message: message }
-
- // Coerce actor into a [to, from, ...] array
- var actors = [].concat(actor, actor)
-
- notes.push(note)
- messages.push({ from: actors[0], to: actors[1], message: message, type: exports.LINETYPE.NOTE, placement: placement })
-}
-
-exports.setTitle = function (titleText) {
- title = titleText
-}
-
-exports.parseError = function (err, hash) {
- global.mermaidAPI.parseError(err, hash)
-}
-
-exports.apply = function (param) {
- if (param instanceof Array) {
- param.forEach(function (item) {
- exports.apply(item)
- })
- } else {
- switch (param.type) {
- case 'addActor':
- exports.addActor(param.actor, param.actor, param.description)
- break
- case 'activeStart':
- exports.addSignal(param.actor, undefined, undefined, param.signalType)
- break
- case 'activeEnd':
- exports.addSignal(param.actor, undefined, undefined, param.signalType)
- break
- case 'addNote':
- exports.addNote(param.actor, param.placement, param.text)
- break
- case 'addMessage':
- exports.addSignal(param.from, param.to, param.msg, param.signalType)
- break
- case 'loopStart':
- exports.addSignal(undefined, undefined, param.loopText, param.signalType)
- break
- case 'loopEnd':
- exports.addSignal(undefined, undefined, undefined, param.signalType)
- break
- case 'optStart':
- exports.addSignal(undefined, undefined, param.optText, param.signalType)
- break
- case 'optEnd':
- exports.addSignal(undefined, undefined, undefined, param.signalType)
- break
- case 'altStart':
- exports.addSignal(undefined, undefined, param.altText, param.signalType)
- break
- case 'else':
- exports.addSignal(undefined, undefined, param.altText, param.signalType)
- break
- case 'altEnd':
- exports.addSignal(undefined, undefined, undefined, param.signalType)
- break
- case 'setTitle':
- exports.setTitle(param.text)
- break
- case 'parStart':
- exports.addSignal(undefined, undefined, param.parText, param.signalType)
- break
- case 'and':
- exports.addSignal(undefined, undefined, param.parText, param.signalType)
- break
- case 'parEnd':
- exports.addSignal(undefined, undefined, undefined, param.signalType)
- break
- }
- }
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"../../logger":400}],398:[function(require,module,exports){
-/**
- * Created by knut on 14-11-23.
- */
-
-var sq = require('./parser/sequenceDiagram').parser
-sq.yy = require('./sequenceDb')
-var svgDraw = require('./svgDraw')
-var d3 = require('../../d3')
-var Logger = require('../../logger')
-var log = Logger.Log
-
-var conf = {
-
- diagramMarginX: 50,
- diagramMarginY: 30,
- // Margin between actors
- actorMargin: 50,
- // Width of actor boxes
- width: 150,
- // Height of actor boxes
- height: 65,
- // Margin around loop boxes
- boxMargin: 10,
- boxTextMargin: 5,
- noteMargin: 10,
- // Space between messages
- messageMargin: 35,
- // mirror actors under diagram
- mirrorActors: false,
- // Depending on css styling this might need adjustment
- // Prolongs the edge of the diagram downwards
- bottomMarginAdj: 1,
-
- // width of activation box
- activationWidth: 10,
-
- // text placement as: tspan | fo | old only text as before
- textPlacement: 'tspan'
-}
-
-exports.bounds = {
- data: {
- startx: undefined,
- stopx: undefined,
- starty: undefined,
- stopy: undefined
- },
- verticalPos: 0,
-
- sequenceItems: [],
- activations: [],
- init: function () {
- this.sequenceItems = []
- this.activations = []
- this.data = {
- startx: undefined,
- stopx: undefined,
- starty: undefined,
- stopy: undefined
- }
- this.verticalPos = 0
- },
- updateVal: function (obj, key, val, fun) {
- if (typeof obj[key] === 'undefined') {
- obj[key] = val
- } else {
- obj[key] = fun(val, obj[key])
- }
- },
- updateBounds: function (startx, starty, stopx, stopy) {
- var _self = this
- var cnt = 0
- function updateFn (type) {
- return function updateItemBounds (item) {
- cnt++
- // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems
- var n = _self.sequenceItems.length - cnt + 1
-
- _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min)
- _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max)
-
- _self.updateVal(exports.bounds.data, 'startx', startx - n * conf.boxMargin, Math.min)
- _self.updateVal(exports.bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max)
-
- if (!(type === 'activation')) {
- _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min)
- _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max)
-
- _self.updateVal(exports.bounds.data, 'starty', starty - n * conf.boxMargin, Math.min)
- _self.updateVal(exports.bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max)
- }
- }
- }
-
- this.sequenceItems.forEach(updateFn())
- this.activations.forEach(updateFn('activation'))
- },
- insert: function (startx, starty, stopx, stopy) {
- var _startx, _starty, _stopx, _stopy
-
- _startx = Math.min(startx, stopx)
- _stopx = Math.max(startx, stopx)
- _starty = Math.min(starty, stopy)
- _stopy = Math.max(starty, stopy)
-
- this.updateVal(exports.bounds.data, 'startx', _startx, Math.min)
- this.updateVal(exports.bounds.data, 'starty', _starty, Math.min)
- this.updateVal(exports.bounds.data, 'stopx', _stopx, Math.max)
- this.updateVal(exports.bounds.data, 'stopy', _stopy, Math.max)
-
- this.updateBounds(_startx, _starty, _stopx, _stopy)
- },
- newActivation: function (message, diagram) {
- var actorRect = sq.yy.getActors()[message.from.actor]
- var stackedSize = actorActivations(message.from.actor).length
- var x = actorRect.x + conf.width / 2 + (stackedSize - 1) * conf.activationWidth / 2
- this.activations.push({
- startx: x,
- starty: this.verticalPos + 2,
- stopx: x + conf.activationWidth,
- stopy: undefined,
- actor: message.from.actor,
- anchored: svgDraw.anchorElement(diagram)
- })
- },
- endActivation: function (message) {
- // find most recent activation for given actor
- var lastActorActivationIdx = this.activations
- .map(function (activation) { return activation.actor })
- .lastIndexOf(message.from.actor)
- var activation = this.activations.splice(lastActorActivationIdx, 1)[0]
- return activation
- },
- newLoop: function (title) {
- this.sequenceItems.push({ startx: undefined, starty: this.verticalPos, stopx: undefined, stopy: undefined, title: title })
- },
- endLoop: function () {
- var loop = this.sequenceItems.pop()
- return loop
- },
- addSectionToLoop: function (message) {
- var loop = this.sequenceItems.pop()
- loop.sections = loop.sections || []
- loop.sectionTitles = loop.sectionTitles || []
- loop.sections.push(exports.bounds.getVerticalPos())
- loop.sectionTitles.push(message)
- this.sequenceItems.push(loop)
- },
- bumpVerticalPos: function (bump) {
- this.verticalPos = this.verticalPos + bump
- this.data.stopy = this.verticalPos
- },
- getVerticalPos: function () {
- return this.verticalPos
- },
- getBounds: function () {
- return this.data
- }
-}
-
-/**
- * Draws an actor in the diagram with the attaced line
- * @param center - The center of the the actor
- * @param pos The position if the actor in the liost of actors
- * @param description The text in the box
- */
-var drawNote = function (elem, startx, verticalPos, msg, forceWidth) {
- var rect = svgDraw.getNoteRect()
- rect.x = startx
- rect.y = verticalPos
- rect.width = forceWidth || conf.width
- rect.class = 'note'
-
- var g = elem.append('g')
- var rectElem = svgDraw.drawRect(g, rect)
-
- var textObj = svgDraw.getTextObj()
- textObj.x = startx - 4
- textObj.y = verticalPos - 13
- textObj.textMargin = conf.noteMargin
- textObj.dy = '1em'
- textObj.text = msg.message
- textObj.class = 'noteText'
-
- var textElem = svgDraw.drawText(g, textObj, rect.width - conf.noteMargin)
-
- var textHeight = textElem[0][0].getBBox().height
- if (!forceWidth && textHeight > conf.width) {
- textElem.remove()
- g = elem.append('g')
-
- textElem = svgDraw.drawText(g, textObj, 2 * rect.width - conf.noteMargin)
- textHeight = textElem[0][0].getBBox().height
- rectElem.attr('width', 2 * rect.width)
- exports.bounds.insert(startx, verticalPos, startx + 2 * rect.width, verticalPos + 2 * conf.noteMargin + textHeight)
- } else {
- exports.bounds.insert(startx, verticalPos, startx + rect.width, verticalPos + 2 * conf.noteMargin + textHeight)
- }
-
- rectElem.attr('height', textHeight + 2 * conf.noteMargin)
- exports.bounds.bumpVerticalPos(textHeight + 2 * conf.noteMargin)
-}
-
-/**
- * Draws a message
- * @param elem
- * @param startx
- * @param stopx
- * @param verticalPos
- * @param txtCenter
- * @param msg
- */
-var drawMessage = function (elem, startx, stopx, verticalPos, msg) {
- var g = elem.append('g')
- var txtCenter = startx + (stopx - startx) / 2
-
- var textElem = g.append('text') // text label for the x axis
- .attr('x', txtCenter)
- .attr('y', verticalPos - 7)
- .style('text-anchor', 'middle')
- .attr('class', 'messageText')
- .text(msg.message)
-
- var textWidth
-
- if (typeof textElem[0][0].getBBox !== 'undefined') {
- textWidth = textElem[0][0].getBBox().width
- } else {
- textWidth = textElem[0][0].getBoundingClientRect()
- }
-
- var line
-
- if (startx === stopx) {
- line = g.append('path')
- .attr('d', 'M ' + startx + ',' + verticalPos + ' C ' + (startx + 60) + ',' + (verticalPos - 10) + ' ' + (startx + 60) + ',' +
- (verticalPos + 30) + ' ' + startx + ',' + (verticalPos + 20))
-
- exports.bounds.bumpVerticalPos(30)
- var dx = Math.max(textWidth / 2, 100)
- exports.bounds.insert(startx - dx, exports.bounds.getVerticalPos() - 10, stopx + dx, exports.bounds.getVerticalPos())
- } else {
- line = g.append('line')
- line.attr('x1', startx)
- line.attr('y1', verticalPos)
- line.attr('x2', stopx)
- line.attr('y2', verticalPos)
- exports.bounds.insert(startx, exports.bounds.getVerticalPos() - 10, stopx, exports.bounds.getVerticalPos())
- }
- // Make an SVG Container
- // Draw the line
- if (msg.type === sq.yy.LINETYPE.DOTTED || msg.type === sq.yy.LINETYPE.DOTTED_CROSS || msg.type === sq.yy.LINETYPE.DOTTED_OPEN) {
- line.style('stroke-dasharray', ('3, 3'))
- line.attr('class', 'messageLine1')
- } else {
- line.attr('class', 'messageLine0')
- }
-
- var url = ''
- if (conf.arrowMarkerAbsolute) {
- url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search
- url = url.replace(/\(/g, '\\(')
- url = url.replace(/\)/g, '\\)')
- }
-
- line.attr('stroke-width', 2)
- line.attr('stroke', 'black')
- line.style('fill', 'none') // remove any fill colour
- if (msg.type === sq.yy.LINETYPE.SOLID || msg.type === sq.yy.LINETYPE.DOTTED) {
- line.attr('marker-end', 'url(' + url + '#arrowhead)')
- }
-
- if (msg.type === sq.yy.LINETYPE.SOLID_CROSS || msg.type === sq.yy.LINETYPE.DOTTED_CROSS) {
- line.attr('marker-end', 'url(' + url + '#crosshead)')
- }
-}
-
-module.exports.drawActors = function (diagram, actors, actorKeys, verticalPos) {
- var i
- // Draw the actors
- for (i = 0; i < actorKeys.length; i++) {
- var key = actorKeys[i]
-
- // Add some rendering data to the object
- actors[key].x = i * conf.actorMargin + i * conf.width
- actors[key].y = verticalPos
- actors[key].width = conf.diagramMarginX
- actors[key].height = conf.diagramMarginY
-
- // Draw the box with the attached line
- svgDraw.drawActor(diagram, actors[key].x, verticalPos, actors[key].description, conf)
- exports.bounds.insert(actors[key].x, verticalPos, actors[key].x + conf.width, conf.height)
- }
-
- // Add a margin between the actor boxes and the first arrow
- exports.bounds.bumpVerticalPos(conf.height)
-}
-
-module.exports.setConf = function (cnf) {
- var keys = Object.keys(cnf)
-
- keys.forEach(function (key) {
- conf[key] = cnf[key]
- })
-}
-
-var actorActivations = function (actor) {
- return module.exports.bounds.activations.filter(function (activation) {
- return activation.actor === actor
- })
-}
-
-var actorFlowVerticaBounds = function (actor) {
- // handle multiple stacked activations for same actor
- var actors = sq.yy.getActors()
- var activations = actorActivations(actor)
-
- var left = activations.reduce(function (acc, activation) { return Math.min(acc, activation.startx) }, actors[actor].x + conf.width / 2)
- var right = activations.reduce(function (acc, activation) { return Math.max(acc, activation.stopx) }, actors[actor].x + conf.width / 2)
- return [left, right]
-}
-
-/**
- * Draws a flowchart in the tag with id: id based on the graph definition in text.
- * @param text
- * @param id
- */
-module.exports.draw = function (text, id) {
- sq.yy.clear()
- sq.parse(text + '\n')
-
- exports.bounds.init()
- var diagram = d3.select('#' + id)
-
- var startx
- var stopx
- var forceWidth
-
- // Fetch data from the parsing
- var actors = sq.yy.getActors()
- var actorKeys = sq.yy.getActorKeys()
- var messages = sq.yy.getMessages()
- var title = sq.yy.getTitle()
- module.exports.drawActors(diagram, actors, actorKeys, 0)
-
- // The arrow head definition is attached to the svg once
- svgDraw.insertArrowHead(diagram)
- svgDraw.insertArrowCrossHead(diagram)
-
- function activeEnd (msg, verticalPos) {
- var activationData = exports.bounds.endActivation(msg)
- if (activationData.starty + 18 > verticalPos) {
- activationData.starty = verticalPos - 6
- verticalPos += 12
- }
- svgDraw.drawActivation(diagram, activationData, verticalPos, conf)
-
- exports.bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos)
- }
-
- // var lastMsg
-
- // Draw the messages/signals
- messages.forEach(function (msg) {
- var loopData
-
- switch (msg.type) {
- case sq.yy.LINETYPE.NOTE:
- exports.bounds.bumpVerticalPos(conf.boxMargin)
-
- startx = actors[msg.from].x
- stopx = actors[msg.to].x
-
- if (msg.placement === sq.yy.PLACEMENT.RIGHTOF) {
- drawNote(diagram, startx + (conf.width + conf.actorMargin) / 2, exports.bounds.getVerticalPos(), msg)
- } else if (msg.placement === sq.yy.PLACEMENT.LEFTOF) {
- drawNote(diagram, startx - (conf.width + conf.actorMargin) / 2, exports.bounds.getVerticalPos(), msg)
- } else if (msg.to === msg.from) {
- // Single-actor over
- drawNote(diagram, startx, exports.bounds.getVerticalPos(), msg)
- } else {
- // Multi-actor over
- forceWidth = Math.abs(startx - stopx) + conf.actorMargin
- drawNote(diagram, (startx + stopx + conf.width - forceWidth) / 2, exports.bounds.getVerticalPos(), msg,
- forceWidth)
- }
- break
- case sq.yy.LINETYPE.ACTIVE_START:
- exports.bounds.newActivation(msg, diagram)
- break
- case sq.yy.LINETYPE.ACTIVE_END:
- activeEnd(msg, exports.bounds.getVerticalPos())
- break
- case sq.yy.LINETYPE.LOOP_START:
- exports.bounds.bumpVerticalPos(conf.boxMargin)
- exports.bounds.newLoop(msg.message)
- exports.bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin)
- break
- case sq.yy.LINETYPE.LOOP_END:
- loopData = exports.bounds.endLoop()
-
- svgDraw.drawLoop(diagram, loopData, 'loop', conf)
- exports.bounds.bumpVerticalPos(conf.boxMargin)
- break
- case sq.yy.LINETYPE.OPT_START:
- exports.bounds.bumpVerticalPos(conf.boxMargin)
- exports.bounds.newLoop(msg.message)
- exports.bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin)
- break
- case sq.yy.LINETYPE.OPT_END:
- loopData = exports.bounds.endLoop()
-
- svgDraw.drawLoop(diagram, loopData, 'opt', conf)
- exports.bounds.bumpVerticalPos(conf.boxMargin)
- break
- case sq.yy.LINETYPE.ALT_START:
- exports.bounds.bumpVerticalPos(conf.boxMargin)
- exports.bounds.newLoop(msg.message)
- exports.bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin)
- break
- case sq.yy.LINETYPE.ALT_ELSE:
- exports.bounds.bumpVerticalPos(conf.boxMargin)
- loopData = exports.bounds.addSectionToLoop(msg.message)
- exports.bounds.bumpVerticalPos(conf.boxMargin)
- break
- case sq.yy.LINETYPE.ALT_END:
- loopData = exports.bounds.endLoop()
-
- svgDraw.drawLoop(diagram, loopData, 'alt', conf)
- exports.bounds.bumpVerticalPos(conf.boxMargin)
- break
- case sq.yy.LINETYPE.PAR_START:
- exports.bounds.bumpVerticalPos(conf.boxMargin)
- exports.bounds.newLoop(msg.message)
- exports.bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin)
- break
- case sq.yy.LINETYPE.PAR_AND:
- exports.bounds.bumpVerticalPos(conf.boxMargin)
- loopData = exports.bounds.addSectionToLoop(msg.message)
- exports.bounds.bumpVerticalPos(conf.boxMargin)
- break
- case sq.yy.LINETYPE.PAR_END:
- loopData = exports.bounds.endLoop()
- svgDraw.drawLoop(diagram, loopData, 'par', conf)
- exports.bounds.bumpVerticalPos(conf.boxMargin)
- break
- default:
- try {
- // lastMsg = msg
- exports.bounds.bumpVerticalPos(conf.messageMargin)
- var fromBounds = actorFlowVerticaBounds(msg.from)
- var toBounds = actorFlowVerticaBounds(msg.to)
- var fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0
- var toIdx = fromBounds[0] < toBounds[0] ? 0 : 1
- startx = fromBounds[fromIdx]
- stopx = toBounds[toIdx]
-
- var verticalPos = exports.bounds.getVerticalPos()
- drawMessage(diagram, startx, stopx, verticalPos, msg)
- var allBounds = fromBounds.concat(toBounds)
- exports.bounds.insert(Math.min.apply(null, allBounds), verticalPos, Math.max.apply(null, allBounds), verticalPos)
- } catch (e) {
- console.error('error while drawing message', e)
- }
- }
- })
-
- if (conf.mirrorActors) {
- // Draw actors below diagram
- exports.bounds.bumpVerticalPos(conf.boxMargin * 2)
- module.exports.drawActors(diagram, actors, actorKeys, exports.bounds.getVerticalPos())
- }
-
- var box = exports.bounds.getBounds()
-
- // Adjust line height of actor lines now that the height of the diagram is known
- log.debug('For line height fix Querying: #' + id + ' .actor-line')
- var actorLines = d3.selectAll('#' + id + ' .actor-line')
- actorLines.attr('y2', box.stopy)
-
- var height = box.stopy - box.starty + 2 * conf.diagramMarginY
-
- if (conf.mirrorActors) {
- height = height - conf.boxMargin + conf.bottomMarginAdj
- }
-
- var width = (box.stopx - box.startx) + (2 * conf.diagramMarginX)
-
- if (title) {
- diagram.append('text')
- .text(title)
- .attr('x', ((box.stopx - box.startx) / 2) - (2 * conf.diagramMarginX))
- .attr('y', -25)
- }
-
- if (conf.useMaxWidth) {
- diagram.attr('height', '100%')
- diagram.attr('width', '100%')
- diagram.attr('style', 'max-width:' + (width) + 'px;')
- } else {
- diagram.attr('height', height)
- diagram.attr('width', width)
- }
- var extraVertForTitle = title ? 40 : 0
- diagram.attr('viewBox', (box.startx - conf.diagramMarginX) + ' -' + (conf.diagramMarginY + extraVertForTitle) + ' ' + width + ' ' + (height + extraVertForTitle))
-}
-
-},{"../../d3":379,"../../logger":400,"./parser/sequenceDiagram":396,"./sequenceDb":397,"./svgDraw":399}],399:[function(require,module,exports){
-/**
- * Created by knut on 14-12-20.
- */
-exports.drawRect = function (elem, rectData) {
- var rectElem = elem.append('rect')
- rectElem.attr('x', rectData.x)
- rectElem.attr('y', rectData.y)
- rectElem.attr('fill', rectData.fill)
- rectElem.attr('stroke', rectData.stroke)
- rectElem.attr('width', rectData.width)
- rectElem.attr('height', rectData.height)
- rectElem.attr('rx', rectData.rx)
- rectElem.attr('ry', rectData.ry)
-
- if (typeof rectData.class !== 'undefined') {
- rectElem.attr('class', rectData.class)
- }
-
- return rectElem
-}
-
-exports.drawText = function (elem, textData, width) {
- // Remove and ignore br:s
- var nText = textData.text.replace(/<br\/?>/ig, ' ')
-
- var textElem = elem.append('text')
- textElem.attr('x', textData.x)
- textElem.attr('y', textData.y)
- textElem.style('text-anchor', textData.anchor)
- textElem.attr('fill', textData.fill)
- if (typeof textData.class !== 'undefined') {
- textElem.attr('class', textData.class)
- }
-
- var span = textElem.append('tspan')
- span.attr('x', textData.x + textData.textMargin * 2)
- span.attr('fill', textData.fill)
- span.text(nText)
- if (typeof textElem.textwrap !== 'undefined') {
- textElem.textwrap({
- x: textData.x, // bounding box is 300 pixels from the left
- y: textData.y, // bounding box is 400 pixels from the top
- width: width, // bounding box is 500 pixels across
- height: 1800 // bounding box is 600 pixels tall
- }, textData.textMargin)
- }
-
- return textElem
-}
-
-exports.drawLabel = function (elem, txtObject) {
- function genPoints (x, y, width, height, cut) {
- return x + ',' + y + ' ' +
- (x + width) + ',' + y + ' ' +
- (x + width) + ',' + (y + height - cut) + ' ' +
- (x + width - cut * 1.2) + ',' + (y + height) + ' ' +
- (x) + ',' + (y + height)
- }
- var polygon = elem.append('polygon')
- polygon.attr('points', genPoints(txtObject.x, txtObject.y, 50, 20, 7))
- polygon.attr('class', 'labelBox')
-
- txtObject.y = txtObject.y + txtObject.labelMargin
- txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin
- exports.drawText(elem, txtObject)
-}
-var actorCnt = -1
-/**
- * Draws an actor in the diagram with the attaced line
- * @param center - The center of the the actor
- * @param pos The position if the actor in the liost of actors
- * @param description The text in the box
- */
-exports.drawActor = function (elem, left, verticalPos, description, conf) {
- var center = left + (conf.width / 2)
- var g = elem.append('g')
- if (verticalPos === 0) {
- actorCnt++
- g.append('line')
- .attr('id', 'actor' + actorCnt)
- .attr('x1', center)
- .attr('y1', 5)
- .attr('x2', center)
- .attr('y2', 2000)
- .attr('class', 'actor-line')
- .attr('stroke-width', '0.5px')
- .attr('stroke', '#999')
- }
-
- var rect = exports.getNoteRect()
- rect.x = left
- rect.y = verticalPos
- rect.fill = '#eaeaea'
- rect.width = conf.width
- rect.height = conf.height
- rect.class = 'actor'
- rect.rx = 3
- rect.ry = 3
- exports.drawRect(g, rect)
-
- _drawTextCandidateFunc(conf)(description, g,
- rect.x, rect.y, rect.width, rect.height, { 'class': 'actor' })
-}
-
-exports.anchorElement = function (elem) {
- return elem.append('g')
-}
-/**
- * Draws an actor in the diagram with the attaced line
- * @param elem - element to append activation rect
- * @param bounds - activation box bounds
- * @param verticalPos - precise y cooridnate of bottom activation box edge
- */
-exports.drawActivation = function (elem, bounds, verticalPos) {
- var rect = exports.getNoteRect()
- var g = bounds.anchored
- rect.x = bounds.startx
- rect.y = bounds.starty
- rect.fill = '#f4f4f4'
- rect.width = bounds.stopx - bounds.startx
- rect.height = verticalPos - bounds.starty
- exports.drawRect(g, rect)
-}
-
-/**
- * Draws an actor in the diagram with the attaced line
- * @param center - The center of the the actor
- * @param pos The position if the actor in the list of actors
- * @param description The text in the box
- */
-exports.drawLoop = function (elem, bounds, labelText, conf) {
- var g = elem.append('g')
- var drawLoopLine = function (startx, starty, stopx, stopy) {
- return g.append('line')
- .attr('x1', startx)
- .attr('y1', starty)
- .attr('x2', stopx)
- .attr('y2', stopy)
- .attr('class', 'loopLine')
- }
- drawLoopLine(bounds.startx, bounds.starty, bounds.stopx, bounds.starty)
- drawLoopLine(bounds.stopx, bounds.starty, bounds.stopx, bounds.stopy)
- drawLoopLine(bounds.startx, bounds.stopy, bounds.stopx, bounds.stopy)
- drawLoopLine(bounds.startx, bounds.starty, bounds.startx, bounds.stopy)
- if (typeof bounds.sections !== 'undefined') {
- bounds.sections.forEach(function (item) {
- drawLoopLine(bounds.startx, item, bounds.stopx, item).style('stroke-dasharray', '3, 3')
- })
- }
-
- var txt = exports.getTextObj()
- txt.text = labelText
- txt.x = bounds.startx
- txt.y = bounds.starty
- txt.labelMargin = 1.5 * 10 // This is the small box that says "loop"
- txt.class = 'labelText' // Its size & position are fixed.
-
- exports.drawLabel(g, txt)
-
- txt = exports.getTextObj()
- txt.text = '[ ' + bounds.title + ' ]'
- txt.x = bounds.startx + (bounds.stopx - bounds.startx) / 2
- txt.y = bounds.starty + 1.5 * conf.boxMargin
- txt.anchor = 'middle'
- txt.class = 'loopText'
-
- exports.drawText(g, txt)
-
- if (typeof bounds.sectionTitles !== 'undefined') {
- bounds.sectionTitles.forEach(function (item, idx) {
- if (item !== '') {
- txt.text = '[ ' + item + ' ]'
- txt.y = bounds.sections[idx] + 1.5 * conf.boxMargin
- exports.drawText(g, txt)
- }
- })
- }
-}
-
-/**
- * Setup arrow head and define the marker. The result is appended to the svg.
- */
-exports.insertArrowHead = function (elem) {
- elem.append('defs').append('marker')
- .attr('id', 'arrowhead')
- .attr('refX', 5)
- .attr('refY', 2)
- .attr('markerWidth', 6)
- .attr('markerHeight', 4)
- .attr('orient', 'auto')
- .append('path')
- .attr('d', 'M 0,0 V 4 L6,2 Z') // this is actual shape for arrowhead
-}
-/**
- * Setup arrow head and define the marker. The result is appended to the svg.
- */
-exports.insertArrowCrossHead = function (elem) {
- var defs = elem.append('defs')
- var marker = defs.append('marker')
- .attr('id', 'crosshead')
- .attr('markerWidth', 15)
- .attr('markerHeight', 8)
- .attr('orient', 'auto')
- .attr('refX', 16)
- .attr('refY', 4)
-
- // The arrow
- marker.append('path')
- .attr('fill', 'black')
- .attr('stroke', '#000000')
- .style('stroke-dasharray', ('0, 0'))
- .attr('stroke-width', '1px')
- .attr('d', 'M 9,2 V 6 L16,4 Z')
-
- // The cross
- marker.append('path')
- .attr('fill', 'none')
- .attr('stroke', '#000000')
- .style('stroke-dasharray', ('0, 0'))
- .attr('stroke-width', '1px')
- .attr('d', 'M 0,1 L 6,7 M 6,1 L 0,7')
- // this is actual shape for arrowhead
-}
-
-exports.getTextObj = function () {
- var txt = {
- x: 0,
- y: 0,
- 'fill': 'black',
- 'text-anchor': 'start',
- style: '#666',
- width: 100,
- height: 100,
- textMargin: 0,
- rx: 0,
- ry: 0
- }
- return txt
-}
-
-exports.getNoteRect = function () {
- var rect = {
- x: 0,
- y: 0,
- fill: '#EDF2AE',
- stroke: '#666',
- width: 100,
- anchor: 'start',
- height: 100,
- rx: 0,
- ry: 0
- }
- return rect
-}
-
-var _drawTextCandidateFunc = (function () {
- function byText (content, g, x, y, width, height, textAttrs) {
- var text = g.append('text')
- .attr('x', x + width / 2).attr('y', y + height / 2 + 5)
- .style('text-anchor', 'middle')
- .text(content)
- _setTextAttrs(text, textAttrs)
- }
-
- function byTspan (content, g, x, y, width, height, textAttrs) {
- var text = g.append('text')
- .attr('x', x + width / 2).attr('y', y)
- .style('text-anchor', 'middle')
- text.append('tspan')
- .attr('x', x + width / 2).attr('dy', '0')
- .text(content)
-
- if (typeof (text.textwrap) !== 'undefined') {
- text.textwrap({ // d3textwrap
- x: x + width / 2, y: y, width: width, height: height
- }, 0)
- // vertical aligment after d3textwrap expans tspan to multiple tspans
- var tspans = text.selectAll('tspan')
- if (tspans.length > 0 && tspans[0].length > 0) {
- tspans = tspans[0]
- // set y of <text> to the mid y of the first line
- text.attr('y', y + (height / 2.0 - text[0][0].getBBox().height * (1 - 1.0 / tspans.length) / 2.0))
- .attr('dominant-baseline', 'central')
- .attr('alignment-baseline', 'central')
- }
- }
- _setTextAttrs(text, textAttrs)
- }
-
- function byFo (content, g, x, y, width, height, textAttrs) {
- var s = g.append('switch')
- var f = s.append('foreignObject')
- .attr('x', x).attr('y', y)
- .attr('width', width).attr('height', height)
-
- var text = f.append('div').style('display', 'table')
- .style('height', '100%').style('width', '100%')
-
- text.append('div').style('display', 'table-cell')
- .style('text-align', 'center').style('vertical-align', 'middle')
- .text(content)
-
- byTspan(content, s, x, y, width, height, textAttrs)
- _setTextAttrs(text, textAttrs)
- }
-
- function _setTextAttrs (toText, fromTextAttrsDict) {
- for (var key in fromTextAttrsDict) {
- if (fromTextAttrsDict.hasOwnProperty(key)) {
- toText.attr(key, fromTextAttrsDict[key])
- }
- }
- }
-
- return function (conf) {
- return conf.textPlacement === 'fo' ? byFo : (
- conf.textPlacement === 'old' ? byText : byTspan)
- }
-})()
-
-},{}],400:[function(require,module,exports){
-/**
- * #logger
- * logger = require('logger').create()
- * logger.info("blah")
- * => [2011-3-3T20:24:4.810 info (5021)] blah
- * logger.debug("boom")
- * =>
- * logger.level = Logger.levels.debug
- * logger.debug(function() { return "booom" })
- * => [2011-3-3T20:24:4.810 error (5021)] booom
- */
-
-function formatTime (timestamp) {
- var hh = timestamp.getUTCHours()
- var mm = timestamp.getUTCMinutes()
- var ss = timestamp.getSeconds()
- var ms = timestamp.getMilliseconds()
- // If you were building a timestamp instead of a duration, you would uncomment the following line to get 12-hour (not 24) time
- // if (hh > 12) {hh = hh % 12;}
- // These lines ensure you have two-digits
- if (hh < 10) {
- hh = '0' + hh
- }
- if (mm < 10) {
- mm = '0' + mm
- }
- if (ss < 10) {
- ss = '0' + ss
- }
- if (ms < 100) {
- ms = '0' + ms
- }
- if (ms < 10) {
- ms = '00' + ms
- }
- // This formats your string to HH:MM:SS
- var t = hh + ':' + mm + ':' + ss + ' (' + ms + ')'
- return t
-}
-
-function format (level) {
- const time = formatTime(new Date())
- return '%c ' + time + ' :%c' + level + ': '
-}
-
-var debug = function () { }
-var info = function () { }
-var warn = function () { }
-var error = function () { }
-var fatal = function () { }
-
-/**
- * logLevel , decides the amount of logging to be used.
- * * debug: 1
- * * info: 2
- * * warn: 3
- * * error: 4
- * * fatal: 5
- */
-exports.setLogLevel = function (level) {
- if (level < 6) {
- exports.Log.fatal = console.log.bind(console, format('FATAL'), 'color:grey;', 'color: red;')
- }
- if (level < 5) {
- exports.Log.error = console.log.bind(console, format('ERROR'), 'color:grey;', 'color: red;')
- }
- if (level < 4) {
- exports.Log.warn = console.log.bind(console, format('WARN'), 'color:grey;', 'color: orange;')
- }
- if (level < 3) {
- exports.Log.info = console.log.bind(console, format('INFO'), 'color:grey;', 'color: info;')
- }
- if (level < 2) {
- exports.Log.debug = console.log.bind(console, format('DEBUG'), 'color:grey;', 'color: green;')
- }
-}
-
-exports.Log = {
- debug: debug,
- info: info,
- warn: warn,
- error: error,
- fatal: fatal
-}
-
-},{}],401:[function(require,module,exports){
-(function (global){
-/**
- * Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid functionality and to render
- * the diagrams to svg code.
- */
-
-var Logger = require('./logger')
-var log = Logger.Log
-var mermaidAPI = require('./mermaidAPI')
-var nextId = 0
-
-var he = require('he')
-
-module.exports.mermaidAPI = mermaidAPI
-/**
- * ## init
- * Function that goes through the document to find the chart definitions in there and render them.
- *
- * The function tags the processed attributes with the attribute data-processed and ignores found elements with the
- * attribute already set. This way the init function can be triggered several times.
- *
- * Optionally, `init` can accept in the second argument one of the following:
- * - a DOM Node
- * - an array of DOM nodes (as would come from a jQuery selector)
- * - a W3C selector, a la `.mermaid`
- *
- * ```mermaid
- * graph LR;
- * a(Find elements)-->b{Processed}
- * b-->|Yes|c(Leave element)
- * b-->|No |d(Transform)
- * ```
- * Renders the mermaid diagrams
- * @param nodes a css selector or an array of nodes
- */
-var init = function () {
- var conf = mermaidAPI.getConfig()
- log.debug('Starting rendering diagrams')
- var nodes
- if (arguments.length >= 2) {
- /*! sequence config was passed as #1 */
- if (typeof arguments[0] !== 'undefined') {
- global.mermaid.sequenceConfig = arguments[0]
- }
-
- nodes = arguments[1]
- } else {
- nodes = arguments[0]
- }
-
- // if last argument is a function this is the callback function
- var callback
- if (typeof arguments[arguments.length - 1] === 'function') {
- callback = arguments[arguments.length - 1]
- log.debug('Callback function found')
- } else {
- if (typeof conf.mermaid !== 'undefined') {
- if (typeof conf.mermaid.callback === 'function') {
- callback = conf.mermaid.callback
- log.debug('Callback function found')
- } else {
- log.debug('No Callback function found')
- }
- }
- }
- nodes = nodes === undefined ? document.querySelectorAll('.mermaid')
- : typeof nodes === 'string' ? document.querySelectorAll(nodes)
- : nodes instanceof window.Node ? [nodes]
- : nodes // Last case - sequence config was passed pick next
-
- if (typeof global.mermaid_config !== 'undefined') {
- mermaidAPI.initialize(global.mermaid_config)
- }
- log.debug('Start On Load before: ' + global.mermaid.startOnLoad)
- if (typeof global.mermaid.startOnLoad !== 'undefined') {
- log.debug('Start On Load inner: ' + global.mermaid.startOnLoad)
- mermaidAPI.initialize({ startOnLoad: global.mermaid.startOnLoad })
- }
-
- if (typeof global.mermaid.ganttConfig !== 'undefined') {
- mermaidAPI.initialize({ gantt: global.mermaid.ganttConfig })
- }
-
- var txt
- var insertSvg = function (svgCode, bindFunctions) {
- element.innerHTML = svgCode
- if (typeof callback !== 'undefined') {
- callback(id)
- }
- bindFunctions(element)
- }
-
- for (var i = 0; i < nodes.length; i++) {
- var element = nodes[i]
-
- /*! Check if previously processed */
- if (!element.getAttribute('data-processed')) {
- element.setAttribute('data-processed', true)
- } else {
- continue
- }
-
- var id = 'mermaidChart' + nextId++
-
- // Fetch the graph definition including tags
- txt = element.innerHTML
-
- // transforms the html to pure text
- txt = he.decode(txt).trim()
-
- mermaidAPI.render(id, txt, insertSvg, element)
- }
-}
-
-exports.init = init
-exports.parse = mermaidAPI.parse
-/**
- * ## version
- * Function returning version information
- * @returns {string} A string containing the version info
- */
-exports.version = function () {
- return 'v' + require('../package.json').version
-}
-
-/**
- * ## initialize
- * This function overrides the default configuration.
- * @param config
- */
-exports.initialize = function (config) {
- log.debug('Initializing mermaid')
- if (typeof config.mermaid !== 'undefined') {
- if (typeof config.mermaid.startOnLoad !== 'undefined') {
- global.mermaid.startOnLoad = config.mermaid.startOnLoad
- }
- if (typeof config.mermaid.htmlLabels !== 'undefined') {
- global.mermaid.htmlLabels = config.mermaid.htmlLabels
- }
- }
- mermaidAPI.initialize(config)
-}
-
-var equals = function (val, variable) {
- if (typeof variable === 'undefined') {
- return false
- } else {
- return (val === variable)
- }
-}
-
-/**
- * Global mermaid object. Contains the functions:
- * * init
- * * initialize
- * * version
- * * parse
- * * parseError
- * * render
- */
-global.mermaid = {
- startOnLoad: true,
- htmlLabels: true,
-
- init: function () {
- init.apply(null, arguments)
- },
- initialize: function (config) {
- exports.initialize(config)
- },
- version: function () {
- return mermaidAPI.version()
- },
- parse: function (text) {
- return mermaidAPI.parse(text)
- },
- parseError: function (err) {
- log.debug('Mermaid Syntax error:')
- log.debug(err)
- },
- render: function (id, text, callback, element) {
- return mermaidAPI.render(id, text, callback, element)
- }
-}
-
-/**
- * ## parseError
- * This function overrides the default configuration.
- * @param config
- */
-exports.parseError = global.mermaid.parseError
-
-/**
- * ##contentLoaded
- * Callback function that is called when page is loaded. This functions fetches configuration for mermaid rendering and
- * calls init for rendering the mermaid diagrams on the page.
- */
-exports.contentLoaded = function () {
- var config
- // Check state of start config mermaid namespace
- if (typeof global.mermaid_config !== 'undefined') {
- if (equals(false, global.mermaid_config.htmlLabels)) {
- global.mermaid.htmlLabels = false
- }
- }
-
- if (global.mermaid.startOnLoad) {
- // For backwards compatability reasons also check mermaid_config variable
- if (typeof global.mermaid_config !== 'undefined') {
- // Check if property startOnLoad is set
- if (equals(true, global.mermaid_config.startOnLoad)) {
- global.mermaid.init()
- }
- } else {
- // No config found, do check API config
- config = mermaidAPI.getConfig()
- if (config.startOnLoad) {
- global.mermaid.init()
- }
- }
- } else {
- if (typeof global.mermaid.startOnLoad === 'undefined') {
- log.debug('In start, no config')
- config = mermaidAPI.getConfig()
- if (config.startOnLoad) {
- global.mermaid.init()
- }
- }
- }
-}
-
-if (typeof document !== 'undefined') {
- /*!
- * Wait for document loaded before starting the execution
- */
- window.addEventListener('load', function () {
- exports.contentLoaded()
- }, false)
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"../package.json":378,"./logger":400,"./mermaidAPI":402,"he":110}],402:[function(require,module,exports){
-(function (global){
-/**
- * ---
- * title: mermaidAPI
- * order: 5
- * ---
- * # mermaidAPI
- * This is the api to be used when handling the integration with the web page instead of using the default integration
- * (mermaid.js).
- *
- * The core of this api is the **render** function that given a graph definitionas text renders the graph/diagram and
- * returns a svg element for the graph. It is is then up to the user of the API to make use of the svg, either insert it
- * somewhere in the page or something completely different.
- */
-var Logger = require('./logger')
-var log = Logger.Log
-
-var graph = require('./diagrams/flowchart/graphDb')
-var utils = require('./utils')
-var flowRenderer = require('./diagrams/flowchart/flowRenderer')
-var seq = require('./diagrams/sequenceDiagram/sequenceRenderer')
-var info = require('./diagrams/example/exampleRenderer')
-var infoParser = require('./diagrams/example/parser/example')
-var flowParser = require('./diagrams/flowchart/parser/flow')
-var dotParser = require('./diagrams/flowchart/parser/dot')
-var sequenceParser = require('./diagrams/sequenceDiagram/parser/sequenceDiagram')
-var sequenceDb = require('./diagrams/sequenceDiagram/sequenceDb')
-var infoDb = require('./diagrams/example/exampleDb')
-var gantt = require('./diagrams/gantt/ganttRenderer')
-var ganttParser = require('./diagrams/gantt/parser/gantt')
-var ganttDb = require('./diagrams/gantt/ganttDb')
-var classParser = require('./diagrams/classDiagram/parser/classDiagram')
-var classRenderer = require('./diagrams/classDiagram/classRenderer')
-var classDb = require('./diagrams/classDiagram/classDb')
-var gitGraphParser = require('./diagrams/gitGraph/parser/gitGraph')
-var gitGraphRenderer = require('./diagrams/gitGraph/gitGraphRenderer')
-var gitGraphAst = require('./diagrams/gitGraph/gitGraphAst')
-var d3 = require('./d3')
-
-/**
- * ## Configuration
- * These are the default options which can be overridden with the initialization call as in the example below:
- * ```
- * mermaid.initialize({
- * flowchart:{
- * htmlLabels: false
- * }
- * });
- * ```
- */
-var config = {
- /**
- * logLevel , decides the amount of logging to be used.
- * * debug: 1
- * * info: 2
- * * warn: 3
- * * error: 4
- * * fatal: 5
- */
- logLevel: 5,
- /**
- * **cloneCssStyles** - This options controls whether or not the css rules should be copied into the generated svg
- */
- cloneCssStyles: true,
-
- /**
- * **startOnLoad** - This options controls whether or mermaid starts when the page loads
- */
- startOnLoad: true,
-
- /**
- * **arrowMarkerAbsolute** - This options controls whether or arrow markers in html code will be absolute paths or
- * an anchor, #. This matters if you are using base tag settings.
- */
- arrowMarkerAbsolute: false,
-
- /**
- * ### flowchart
- * *The object containing configurations specific for flowcharts*
- */
- flowchart: {
- /**
- * **htmlLabels** - Flag for setting whether or not a html tag should be used for rendering labels
- * on the edges
- */
- htmlLabels: true,
- /**
- * **useMaxWidth** - Flag for setting whether or not a all available width should be used for
- * the diagram.
- */
- useMaxWidth: true
- },
-
- /**
- * ### sequenceDiagram
- * The object containing configurations specific for sequence diagrams
- */
- sequenceDiagram: {
-
- /**
- * **diagramMarginX** - margin to the right and left of the sequence diagram
- */
- diagramMarginX: 50,
-
- /**
- * **diagramMarginY** - margin to the over and under the sequence diagram
- */
- diagramMarginY: 10,
-
- /**
- * **actorMargin** - Margin between actors
- */
- actorMargin: 50,
-
- /**
- * **width** - Width of actor boxes
- */
- width: 150,
-
- /**
- * **height** - Height of actor boxes
- */
- height: 65,
-
- /**
- * **boxMargin** - Margin around loop boxes
- */
- boxMargin: 10,
-
- /**
- * **boxTextMargin** - margin around the text in loop/alt/opt boxes
- */
- boxTextMargin: 5,
-
- /**
- * **noteMargin** - margin around notes
- */
- noteMargin: 10,
-
- /**
- * **messageMargin** - Space between messages
- */
- messageMargin: 35,
-
- /**
- * **mirrorActors** - mirror actors under diagram
- */
- mirrorActors: true,
-
- /**
- * **bottomMarginAdj** - Depending on css styling this might need adjustment.
- * Prolongs the edge of the diagram downwards
- */
- bottomMarginAdj: 1,
-
- /**
- * **useMaxWidth** - when this flag is set the height and width is set to 100% and is then scaling with the
- * available space if not the absolute space required is used
- */
- useMaxWidth: true
- },
-
- /** ### gantt
- * The object containing configurations specific for gantt diagrams*
- */
- gantt: {
- /**
- * **titleTopMargin** - margin top for the text over the gantt diagram
- */
- titleTopMargin: 25,
-
- /**
- * **barHeight** - the height of the bars in the graph
- */
- barHeight: 20,
-
- /**
- * **barGap** - the margin between the different activities in the gantt diagram
- */
- barGap: 4,
-
- /**
- * **topPadding** - margin between title and gantt diagram and between axis and gantt diagram.
- */
- topPadding: 50,
-
- /**
- * **leftPadding** - the space allocated for the section name to the left of the activities.
- */
- leftPadding: 75,
-
- /**
- * **gridLineStartPadding** - Vertical starting position of the grid lines
- */
- gridLineStartPadding: 35,
-
- /**
- * **fontSize** - font size ...
- */
- fontSize: 11,
-
- /**
- * **fontFamily** - font family ...
- */
- fontFamily: '"Open-Sans", "sans-serif"',
-
- /**
- * **numberSectionStyles** - the number of alternating section styles
- */
- numberSectionStyles: 3,
-
- /**
- * **axisFormatter** - formatting of the axis, this might need adjustment to match your locale and preferences
- */
- axisFormatter: [
-
- // Within a day
- ['%I:%M', function (d) {
- return d.getHours()
- }],
- // Monday a week
- ['w. %U', function (d) {
- return d.getDay() === 1
- }],
- // Day within a week (not monday)
- ['%a %d', function (d) {
- return d.getDay() && d.getDate() !== 1
- }],
- // within a month
- ['%b %d', function (d) {
- return d.getDate() !== 1
- }],
- // Month
- ['%m-%y', function (d) {
- return d.getMonth()
- }]
- ]
- },
- classDiagram: {},
- gitGraph: {},
- info: {}
-}
-
-Logger.setLogLevel(config.logLevel)
-
-/**
- * ## parse
- * Function that parses a mermaid diagram definition. If parsing fails the parseError callback is called and an error is
- * thrown and
- * @param text
- */
-var parse = function (text) {
- var graphType = utils.detectType(text)
- var parser
-
- switch (graphType) {
- case 'gitGraph':
- parser = gitGraphParser
- parser.parser.yy = gitGraphAst
- break
- case 'graph':
- parser = flowParser
- parser.parser.yy = graph
- break
- case 'dotGraph':
- parser = dotParser
- parser.parser.yy = graph
- break
- case 'sequenceDiagram':
- parser = sequenceParser
- parser.parser.yy = sequenceDb
- break
- case 'info':
- parser = infoParser
- parser.parser.yy = infoDb
- break
- case 'gantt':
- parser = ganttParser
- parser.parser.yy = ganttDb
- break
- case 'classDiagram':
- parser = classParser
- parser.parser.yy = classDb
- break
- }
-
- try {
- parser.parse(text)
- return true
- } catch (err) {
- return false
- }
-}
-exports.parse = parse
-
-/**
- * ## version
- * Function returning version information
- * @returns {string} A string containing the version info
- */
-exports.version = function () {
- return require('../package.json').version
-}
-
-exports.encodeEntities = function (text) {
- var txt = text
-
- txt = txt.replace(/style.*:\S*#.*;/g, function (s) {
- var innerTxt = s.substring(0, s.length - 1)
- return innerTxt
- })
- txt = txt.replace(/classDef.*:\S*#.*;/g, function (s) {
- var innerTxt = s.substring(0, s.length - 1)
- return innerTxt
- })
-
- txt = txt.replace(/#\w+;/g, function (s) {
- var innerTxt = s.substring(1, s.length - 1)
-
- var isInt = /^\+?\d+$/.test(innerTxt)
- if (isInt) {
- return 'fl°°' + innerTxt + '¶ß'
- } else {
- return 'fl°' + innerTxt + '¶ß'
- }
- })
-
- return txt
-}
-
-exports.decodeEntities = function (text) {
- var txt = text
-
- txt = txt.replace(/fl°°/g, function () {
- return '&#'
- })
- txt = txt.replace(/fl°/g, function () {
- return '&'
- })
- txt = txt.replace(/¶ß/g, function () {
- return ';'
- })
-
- return txt
-}
-/**
- * ##render
- * Function that renders an svg with a graph from a chart definition. Usage example below.
- *
- * ```
- * mermaidAPI.initialize({
- * startOnLoad:true
- * });
- * $(function(){
- * var graphDefinition = 'graph TB\na-->b';
- * var cb = function(svgGraph){
- * console.log(svgGraph);
- * };
- * mermaidAPI.render('id1',graphDefinition,cb);
- * });
- *```
- * @param id the id of the element to be rendered
- * @param txt the graph definition
- * @param cb callback which is called after rendering is finished with the svg code as inparam.
- * @param container selector to element in which a div with the graph temporarily will be inserted. In one is
- * provided a hidden div will be inserted in the body of the page instead. The element will be removed when rendering is
- * completed.
- */
-var render = function (id, txt, cb, container) {
- if (typeof container !== 'undefined') {
- container.innerHTML = ''
-
- d3.select(container).append('div')
- .attr('id', 'd' + id)
- .append('svg')
- .attr('id', id)
- .attr('width', '100%')
- .attr('xmlns', 'http://www.w3.org/2000/svg')
- .append('g')
- } else {
- const element = document.querySelector('#' + 'd' + id)
- if (element) {
- element.innerHTML = ''
- }
-
- d3.select('body').append('div')
- .attr('id', 'd' + id)
- .append('svg')
- .attr('id', id)
- .attr('width', '100%')
- .attr('xmlns', 'http://www.w3.org/2000/svg')
- .append('g')
- }
-
- window.txt = txt
- txt = exports.encodeEntities(txt)
-
- var element = d3.select('#d' + id).node()
- var graphType = utils.detectType(txt)
- var classes = {}
- switch (graphType) {
- case 'gitGraph':
- config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute
- gitGraphRenderer.setConf(config.gitGraph)
- gitGraphRenderer.draw(txt, id, false)
- break
- case 'graph':
- config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute
- flowRenderer.setConf(config.flowchart)
- flowRenderer.draw(txt, id, false)
- if (config.cloneCssStyles) {
- classes = flowRenderer.getClasses(txt, false)
- utils.cloneCssStyles(element.firstChild, classes)
- }
- break
- case 'dotGraph':
- config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute
- flowRenderer.setConf(config.flowchart)
- flowRenderer.draw(txt, id, true)
- if (config.cloneCssStyles) {
- classes = flowRenderer.getClasses(txt, true)
- utils.cloneCssStyles(element.firstChild, classes)
- }
- break
- case 'sequenceDiagram':
- config.sequenceDiagram.arrowMarkerAbsolute = config.arrowMarkerAbsolute
- seq.setConf(config.sequenceDiagram)
- seq.draw(txt, id)
- if (config.cloneCssStyles) {
- utils.cloneCssStyles(element.firstChild, [])
- }
- break
- case 'gantt':
- config.gantt.arrowMarkerAbsolute = config.arrowMarkerAbsolute
- gantt.setConf(config.gantt)
- gantt.draw(txt, id)
- if (config.cloneCssStyles) {
- utils.cloneCssStyles(element.firstChild, [])
- }
- break
- case 'classDiagram':
- config.classDiagram.arrowMarkerAbsolute = config.arrowMarkerAbsolute
- classRenderer.setConf(config.classDiagram)
- classRenderer.draw(txt, id)
- if (config.cloneCssStyles) {
- utils.cloneCssStyles(element.firstChild, [])
- }
- break
- case 'info':
- config.info.arrowMarkerAbsolute = config.arrowMarkerAbsolute
- info.draw(txt, id, exports.version())
- if (config.cloneCssStyles) {
- utils.cloneCssStyles(element.firstChild, [])
- }
- break
- }
-
- d3.select('#d' + id).selectAll('foreignobject div').attr('xmlns', 'http://www.w3.org/1999/xhtml')
-
- var url = ''
- if (config.arrowMarkerAbsolute) {
- url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search
- url = url.replace(/\(/g, '\\(')
- url = url.replace(/\)/g, '\\)')
- }
-
- // Fix for when the base tag is used
- var svgCode = d3.select('#d' + id).node().innerHTML.replace(/url\(#arrowhead/g, 'url(' + url + '#arrowhead', 'g')
-
- svgCode = exports.decodeEntities(svgCode)
-
- if (typeof cb !== 'undefined') {
- cb(svgCode, graph.bindFunctions)
- } else {
- log.warn('CB = undefined!')
- }
-
- var node = d3.select('#d' + id).node()
- if (node !== null && typeof node.remove === 'function') {
- d3.select('#d' + id).node().remove()
- }
-
- return svgCode
-}
-
-exports.render = function (id, text, cb, containerElement) {
- try {
- if (arguments.length === 1) {
- text = id
- id = 'mermaidId0'
- }
-
- if (typeof document === 'undefined') {
- // Todo handle rendering serverside using phantomjs
- } else {
- // In browser
- return render(id, text, cb, containerElement)
- }
- } catch (e) {
- log.warn(e)
- }
-}
-
-var setConf = function (cnf) {
- // Top level initially mermaid, gflow, sequenceDiagram and gantt
- var lvl1Keys = Object.keys(cnf)
- var i
- for (i = 0; i < lvl1Keys.length; i++) {
- if (typeof cnf[lvl1Keys[i]] === 'object') {
- var lvl2Keys = Object.keys(cnf[lvl1Keys[i]])
-
- var j
- for (j = 0; j < lvl2Keys.length; j++) {
- log.debug('Setting conf ', lvl1Keys[i], '-', lvl2Keys[j])
- if (typeof config[lvl1Keys[i]] === 'undefined') {
- config[lvl1Keys[i]] = {}
- }
- log.debug('Setting config: ' + lvl1Keys[i] + ' ' + lvl2Keys[j] + ' to ' + cnf[lvl1Keys[i]][lvl2Keys[j]])
- config[lvl1Keys[i]][lvl2Keys[j]] = cnf[lvl1Keys[i]][lvl2Keys[j]]
- }
- } else {
- config[lvl1Keys[i]] = cnf[lvl1Keys[i]]
- }
- }
-}
-
-exports.initialize = function (options) {
- log.debug('Initializing mermaidAPI')
- // Update default config with options supplied at initialization
- if (typeof options === 'object') {
- setConf(options)
- }
- Logger.setLogLevel(config.logLevel)
-}
-exports.getConfig = function () {
- return config
-}
-
-exports.parseError = function (err, hash) {
- if (typeof mermaid !== 'undefined') {
- global.mermaid.parseError(err, hash)
- } else {
- log.debug('Mermaid Syntax error:')
- log.debug(err)
- }
-}
-global.mermaidAPI = {
- render: exports.render,
- parse: exports.parse,
- initialize: exports.initialize,
- detectType: utils.detectType,
- parseError: exports.parseError,
- getConfig: exports.getConfig
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"../package.json":378,"./d3":379,"./diagrams/classDiagram/classDb":380,"./diagrams/classDiagram/classRenderer":381,"./diagrams/classDiagram/parser/classDiagram":382,"./diagrams/example/exampleDb":383,"./diagrams/example/exampleRenderer":384,"./diagrams/example/parser/example":385,"./diagrams/flowchart/flowRenderer":386,"./diagrams/flowchart/graphDb":387,"./diagrams/flowchart/parser/dot":388,"./diagrams/flowchart/parser/flow":389,"./diagrams/gantt/ganttDb":390,"./diagrams/gantt/ganttRenderer":391,"./diagrams/gantt/parser/gantt":392,"./diagrams/gitGraph/gitGraphAst":393,"./diagrams/gitGraph/gitGraphRenderer":394,"./diagrams/gitGraph/parser/gitGraph":395,"./diagrams/sequenceDiagram/parser/sequenceDiagram":396,"./diagrams/sequenceDiagram/sequenceDb":397,"./diagrams/sequenceDiagram/sequenceRenderer":398,"./logger":400,"./utils":403}],403:[function(require,module,exports){
-/**
- * Created by knut on 14-11-23.
- */
-var Logger = require('./logger')
-var log = Logger.Log
-
-/**
- * @function detectType
- * Detects the type of the graph text.
- * ```mermaid
- * graph LR
- * a-->b
- * b-->c
- * c-->d
- * d-->e
- * e-->f
- * f-->g
- * g-->h
- * ```
- *
- * @param {string} text The text defining the graph
- * @returns {string} A graph definition key
- */
-var detectType = function (text) {
- text = text.replace(/^\s*%%.*\n/g, '\n')
- if (text.match(/^\s*sequenceDiagram/)) {
- return 'sequenceDiagram'
- }
-
- if (text.match(/^\s*digraph/)) {
- return 'dotGraph'
- }
-
- if (text.match(/^\s*info/)) {
- return 'info'
- }
-
- if (text.match(/^\s*gantt/)) {
- return 'gantt'
- }
-
- if (text.match(/^\s*classDiagram/)) {
- log.debug('Detected classDiagram syntax')
- return 'classDiagram'
- }
-
- if (text.match(/^\s*gitGraph/)) {
- log.debug('Detected gitGraph syntax')
- return 'gitGraph'
- }
- return 'graph'
-}
-exports.detectType = detectType
-
-/**
- * Copies all relevant CSS content into the graph SVG.
- * This allows the SVG to be copied as is while keeping class based styling
- * @param {element} svg The root element of the SVG
- * @param {object} Hash table of class definitions from the graph definition
- */
-var cloneCssStyles = function (svg, classes) {
- var usedStyles = ''
- var sheets = document.styleSheets
- var rule
- for (var i = 0; i < sheets.length; i++) {
- // Avoid multiple inclusion on pages with multiple graphs
- if (sheets[i].title !== 'mermaid-svg-internal-css') {
- try {
- var rules = sheets[i].cssRules
- if (rules !== null) {
- for (var j = 0; j < rules.length; j++) {
- rule = rules[j]
- if (typeof (rule.style) !== 'undefined') {
- var elems
- elems = svg.querySelectorAll(rule.selectorText)
- if (elems.length > 0) {
- usedStyles += rule.selectorText + ' { ' + rule.style.cssText + '}\n'
- }
- }
- }
- }
- } catch (err) {
- if (typeof (rule) !== 'undefined') {
- log.warn('Invalid CSS selector "' + rule.selectorText + '"', err)
- }
- }
- }
- }
-
- var defaultStyles = ''
- var embeddedStyles = ''
-
- for (var className in classes) {
- if (classes.hasOwnProperty(className) && typeof (className) !== 'undefined') {
- if (className === 'default') {
- if (classes.default.styles instanceof Array) {
- defaultStyles += '#' + svg.id.trim() + ' .node' + '>rect { ' + classes[className].styles.join('; ') + '; }\n'
- }
- if (classes.default.nodeLabelStyles instanceof Array) {
- defaultStyles += '#' + svg.id.trim() + ' .node text ' + ' { ' + classes[className].nodeLabelStyles.join('; ') + '; }\n'
- }
- if (classes.default.edgeLabelStyles instanceof Array) {
- defaultStyles += '#' + svg.id.trim() + ' .edgeLabel text ' + ' { ' + classes[className].edgeLabelStyles.join('; ') + '; }\n'
- }
- if (classes.default.clusterStyles instanceof Array) {
- defaultStyles += '#' + svg.id.trim() + ' .cluster rect ' + ' { ' + classes[className].clusterStyles.join('; ') + '; }\n'
- }
- } else {
- if (classes[className].styles instanceof Array) {
- embeddedStyles += '#' + svg.id.trim() + ' .' + className + '>rect, .' + className + '>polygon, .' + className + '>circle, .' + className + '>ellipse { ' + classes[className].styles.join('; ') + '; }\n'
- }
- }
- }
- }
-
- if (usedStyles !== '' || defaultStyles !== '' || embeddedStyles !== '') {
- var s = document.createElement('style')
- s.setAttribute('type', 'text/css')
- s.setAttribute('title', 'mermaid-svg-internal-css')
- s.innerHTML = '/* <![CDATA[ */\n'
- // Make this CSS local to this SVG
- if (defaultStyles !== '') {
- s.innerHTML += defaultStyles
- }
- if (usedStyles !== '') {
- s.innerHTML += usedStyles
- }
- if (embeddedStyles !== '') {
- s.innerHTML += embeddedStyles
- }
- s.innerHTML += '/* ]]> */\n'
- svg.insertBefore(s, svg.firstChild)
- }
-}
-
-exports.cloneCssStyles = cloneCssStyles
-
-/**
- * @function isSubstringInArray
- * Detects whether a substring in present in a given array
- * @param {string} str The substring to detect
- * @param {array} arr The array to search
- * @returns {number} the array index containing the substring or -1 if not present
- **/
-var isSubstringInArray = function (str, arr) {
- for (var i = 0; i < arr.length; i++) {
- if (arr[i].match(str)) return i
- }
- return -1
-}
-
-exports.isSubstringInArray = isSubstringInArray
-
-},{"./logger":400}],404:[function(require,module,exports){
-//! moment.js
-//! version : 2.18.1
-//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
-//! license : MIT
-//! momentjs.com
-
-;(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- global.moment = factory()
-}(this, (function () { 'use strict';
-
-var hookCallback;
-
-function hooks () {
- return hookCallback.apply(null, arguments);
-}
-
-// This is done to register the method called with moment()
-// without creating circular dependencies.
-function setHookCallback (callback) {
- hookCallback = callback;
-}
-
-function isArray(input) {
- return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
-}
-
-function isObject(input) {
- // IE8 will treat undefined and null as object if it wasn't for
- // input != null
- return input != null && Object.prototype.toString.call(input) === '[object Object]';
-}
-
-function isObjectEmpty(obj) {
- var k;
- for (k in obj) {
- // even if its not own property I'd still call it non-empty
- return false;
- }
- return true;
-}
-
-function isUndefined(input) {
- return input === void 0;
-}
-
-function isNumber(input) {
- return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
-}
-
-function isDate(input) {
- return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
-}
-
-function map(arr, fn) {
- var res = [], i;
- for (i = 0; i < arr.length; ++i) {
- res.push(fn(arr[i], i));
- }
- return res;
-}
-
-function hasOwnProp(a, b) {
- return Object.prototype.hasOwnProperty.call(a, b);
-}
-
-function extend(a, b) {
- for (var i in b) {
- if (hasOwnProp(b, i)) {
- a[i] = b[i];
- }
- }
-
- if (hasOwnProp(b, 'toString')) {
- a.toString = b.toString;
- }
-
- if (hasOwnProp(b, 'valueOf')) {
- a.valueOf = b.valueOf;
- }
-
- return a;
-}
-
-function createUTC (input, format, locale, strict) {
- return createLocalOrUTC(input, format, locale, strict, true).utc();
-}
-
-function defaultParsingFlags() {
- // We need to deep clone this object.
- return {
- empty : false,
- unusedTokens : [],
- unusedInput : [],
- overflow : -2,
- charsLeftOver : 0,
- nullInput : false,
- invalidMonth : null,
- invalidFormat : false,
- userInvalidated : false,
- iso : false,
- parsedDateParts : [],
- meridiem : null,
- rfc2822 : false,
- weekdayMismatch : false
- };
-}
-
-function getParsingFlags(m) {
- if (m._pf == null) {
- m._pf = defaultParsingFlags();
- }
- return m._pf;
-}
-
-var some;
-if (Array.prototype.some) {
- some = Array.prototype.some;
-} else {
- some = function (fun) {
- var t = Object(this);
- var len = t.length >>> 0;
-
- for (var i = 0; i < len; i++) {
- if (i in t && fun.call(this, t[i], i, t)) {
- return true;
- }
- }
-
- return false;
- };
-}
-
-var some$1 = some;
-
-function isValid(m) {
- if (m._isValid == null) {
- var flags = getParsingFlags(m);
- var parsedParts = some$1.call(flags.parsedDateParts, function (i) {
- return i != null;
- });
- var isNowValid = !isNaN(m._d.getTime()) &&
- flags.overflow < 0 &&
- !flags.empty &&
- !flags.invalidMonth &&
- !flags.invalidWeekday &&
- !flags.nullInput &&
- !flags.invalidFormat &&
- !flags.userInvalidated &&
- (!flags.meridiem || (flags.meridiem && parsedParts));
-
- if (m._strict) {
- isNowValid = isNowValid &&
- flags.charsLeftOver === 0 &&
- flags.unusedTokens.length === 0 &&
- flags.bigHour === undefined;
- }
-
- if (Object.isFrozen == null || !Object.isFrozen(m)) {
- m._isValid = isNowValid;
- }
- else {
- return isNowValid;
- }
- }
- return m._isValid;
-}
-
-function createInvalid (flags) {
- var m = createUTC(NaN);
- if (flags != null) {
- extend(getParsingFlags(m), flags);
- }
- else {
- getParsingFlags(m).userInvalidated = true;
- }
-
- return m;
-}
-
-// Plugins that add properties should also add the key here (null value),
-// so we can properly clone ourselves.
-var momentProperties = hooks.momentProperties = [];
-
-function copyConfig(to, from) {
- var i, prop, val;
-
- if (!isUndefined(from._isAMomentObject)) {
- to._isAMomentObject = from._isAMomentObject;
- }
- if (!isUndefined(from._i)) {
- to._i = from._i;
- }
- if (!isUndefined(from._f)) {
- to._f = from._f;
- }
- if (!isUndefined(from._l)) {
- to._l = from._l;
- }
- if (!isUndefined(from._strict)) {
- to._strict = from._strict;
- }
- if (!isUndefined(from._tzm)) {
- to._tzm = from._tzm;
- }
- if (!isUndefined(from._isUTC)) {
- to._isUTC = from._isUTC;
- }
- if (!isUndefined(from._offset)) {
- to._offset = from._offset;
- }
- if (!isUndefined(from._pf)) {
- to._pf = getParsingFlags(from);
- }
- if (!isUndefined(from._locale)) {
- to._locale = from._locale;
- }
-
- if (momentProperties.length > 0) {
- for (i = 0; i < momentProperties.length; i++) {
- prop = momentProperties[i];
- val = from[prop];
- if (!isUndefined(val)) {
- to[prop] = val;
- }
- }
- }
-
- return to;
-}
-
-var updateInProgress = false;
-
-// Moment prototype object
-function Moment(config) {
- copyConfig(this, config);
- this._d = new Date(config._d != null ? config._d.getTime() : NaN);
- if (!this.isValid()) {
- this._d = new Date(NaN);
- }
- // Prevent infinite loop in case updateOffset creates new moment
- // objects.
- if (updateInProgress === false) {
- updateInProgress = true;
- hooks.updateOffset(this);
- updateInProgress = false;
- }
-}
-
-function isMoment (obj) {
- return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
-}
-
-function absFloor (number) {
- if (number < 0) {
- // -0 -> 0
- return Math.ceil(number) || 0;
- } else {
- return Math.floor(number);
- }
-}
-
-function toInt(argumentForCoercion) {
- var coercedNumber = +argumentForCoercion,
- value = 0;
-
- if (coercedNumber !== 0 && isFinite(coercedNumber)) {
- value = absFloor(coercedNumber);
- }
-
- return value;
-}
-
-// compare two arrays, return the number of differences
-function compareArrays(array1, array2, dontConvert) {
- var len = Math.min(array1.length, array2.length),
- lengthDiff = Math.abs(array1.length - array2.length),
- diffs = 0,
- i;
- for (i = 0; i < len; i++) {
- if ((dontConvert && array1[i] !== array2[i]) ||
- (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
- diffs++;
- }
- }
- return diffs + lengthDiff;
-}
-
-function warn(msg) {
- if (hooks.suppressDeprecationWarnings === false &&
- (typeof console !== 'undefined') && console.warn) {
- console.warn('Deprecation warning: ' + msg);
- }
-}
-
-function deprecate(msg, fn) {
- var firstTime = true;
-
- return extend(function () {
- if (hooks.deprecationHandler != null) {
- hooks.deprecationHandler(null, msg);
- }
- if (firstTime) {
- var args = [];
- var arg;
- for (var i = 0; i < arguments.length; i++) {
- arg = '';
- if (typeof arguments[i] === 'object') {
- arg += '\n[' + i + '] ';
- for (var key in arguments[0]) {
- arg += key + ': ' + arguments[0][key] + ', ';
- }
- arg = arg.slice(0, -2); // Remove trailing comma and space
- } else {
- arg = arguments[i];
- }
- args.push(arg);
- }
- warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
- firstTime = false;
- }
- return fn.apply(this, arguments);
- }, fn);
-}
-
-var deprecations = {};
-
-function deprecateSimple(name, msg) {
- if (hooks.deprecationHandler != null) {
- hooks.deprecationHandler(name, msg);
- }
- if (!deprecations[name]) {
- warn(msg);
- deprecations[name] = true;
- }
-}
-
-hooks.suppressDeprecationWarnings = false;
-hooks.deprecationHandler = null;
-
-function isFunction(input) {
- return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
-}
-
-function set (config) {
- var prop, i;
- for (i in config) {
- prop = config[i];
- if (isFunction(prop)) {
- this[i] = prop;
- } else {
- this['_' + i] = prop;
- }
- }
- this._config = config;
- // Lenient ordinal parsing accepts just a number in addition to
- // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
- // TODO: Remove "ordinalParse" fallback in next major release.
- this._dayOfMonthOrdinalParseLenient = new RegExp(
- (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
- '|' + (/\d{1,2}/).source);
-}
-
-function mergeConfigs(parentConfig, childConfig) {
- var res = extend({}, parentConfig), prop;
- for (prop in childConfig) {
- if (hasOwnProp(childConfig, prop)) {
- if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
- res[prop] = {};
- extend(res[prop], parentConfig[prop]);
- extend(res[prop], childConfig[prop]);
- } else if (childConfig[prop] != null) {
- res[prop] = childConfig[prop];
- } else {
- delete res[prop];
- }
- }
- }
- for (prop in parentConfig) {
- if (hasOwnProp(parentConfig, prop) &&
- !hasOwnProp(childConfig, prop) &&
- isObject(parentConfig[prop])) {
- // make sure changes to properties don't modify parent config
- res[prop] = extend({}, res[prop]);
- }
- }
- return res;
-}
-
-function Locale(config) {
- if (config != null) {
- this.set(config);
- }
-}
-
-var keys;
-
-if (Object.keys) {
- keys = Object.keys;
-} else {
- keys = function (obj) {
- var i, res = [];
- for (i in obj) {
- if (hasOwnProp(obj, i)) {
- res.push(i);
- }
- }
- return res;
- };
-}
-
-var keys$1 = keys;
-
-var defaultCalendar = {
- sameDay : '[Today at] LT',
- nextDay : '[Tomorrow at] LT',
- nextWeek : 'dddd [at] LT',
- lastDay : '[Yesterday at] LT',
- lastWeek : '[Last] dddd [at] LT',
- sameElse : 'L'
-};
-
-function calendar (key, mom, now) {
- var output = this._calendar[key] || this._calendar['sameElse'];
- return isFunction(output) ? output.call(mom, now) : output;
-}
-
-var defaultLongDateFormat = {
- LTS : 'h:mm:ss A',
- LT : 'h:mm A',
- L : 'MM/DD/YYYY',
- LL : 'MMMM D, YYYY',
- LLL : 'MMMM D, YYYY h:mm A',
- LLLL : 'dddd, MMMM D, YYYY h:mm A'
-};
-
-function longDateFormat (key) {
- var format = this._longDateFormat[key],
- formatUpper = this._longDateFormat[key.toUpperCase()];
-
- if (format || !formatUpper) {
- return format;
- }
-
- this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
- return val.slice(1);
- });
-
- return this._longDateFormat[key];
-}
-
-var defaultInvalidDate = 'Invalid date';
-
-function invalidDate () {
- return this._invalidDate;
-}
-
-var defaultOrdinal = '%d';
-var defaultDayOfMonthOrdinalParse = /\d{1,2}/;
-
-function ordinal (number) {
- return this._ordinal.replace('%d', number);
-}
-
-var defaultRelativeTime = {
- future : 'in %s',
- past : '%s ago',
- s : 'a few seconds',
- ss : '%d seconds',
- m : 'a minute',
- mm : '%d minutes',
- h : 'an hour',
- hh : '%d hours',
- d : 'a day',
- dd : '%d days',
- M : 'a month',
- MM : '%d months',
- y : 'a year',
- yy : '%d years'
-};
-
-function relativeTime (number, withoutSuffix, string, isFuture) {
- var output = this._relativeTime[string];
- return (isFunction(output)) ?
- output(number, withoutSuffix, string, isFuture) :
- output.replace(/%d/i, number);
-}
-
-function pastFuture (diff, output) {
- var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
- return isFunction(format) ? format(output) : format.replace(/%s/i, output);
-}
-
-var aliases = {};
-
-function addUnitAlias (unit, shorthand) {
- var lowerCase = unit.toLowerCase();
- aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
-}
-
-function normalizeUnits(units) {
- return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
-}
-
-function normalizeObjectUnits(inputObject) {
- var normalizedInput = {},
- normalizedProp,
- prop;
-
- for (prop in inputObject) {
- if (hasOwnProp(inputObject, prop)) {
- normalizedProp = normalizeUnits(prop);
- if (normalizedProp) {
- normalizedInput[normalizedProp] = inputObject[prop];
- }
- }
- }
-
- return normalizedInput;
-}
-
-var priorities = {};
-
-function addUnitPriority(unit, priority) {
- priorities[unit] = priority;
-}
-
-function getPrioritizedUnits(unitsObj) {
- var units = [];
- for (var u in unitsObj) {
- units.push({unit: u, priority: priorities[u]});
- }
- units.sort(function (a, b) {
- return a.priority - b.priority;
- });
- return units;
-}
-
-function makeGetSet (unit, keepTime) {
- return function (value) {
- if (value != null) {
- set$1(this, unit, value);
- hooks.updateOffset(this, keepTime);
- return this;
- } else {
- return get(this, unit);
- }
- };
-}
-
-function get (mom, unit) {
- return mom.isValid() ?
- mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
-}
-
-function set$1 (mom, unit, value) {
- if (mom.isValid()) {
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
- }
-}
-
-// MOMENTS
-
-function stringGet (units) {
- units = normalizeUnits(units);
- if (isFunction(this[units])) {
- return this[units]();
- }
- return this;
-}
-
-
-function stringSet (units, value) {
- if (typeof units === 'object') {
- units = normalizeObjectUnits(units);
- var prioritized = getPrioritizedUnits(units);
- for (var i = 0; i < prioritized.length; i++) {
- this[prioritized[i].unit](units[prioritized[i].unit]);
- }
- } else {
- units = normalizeUnits(units);
- if (isFunction(this[units])) {
- return this[units](value);
- }
- }
- return this;
-}
-
-function zeroFill(number, targetLength, forceSign) {
- var absNumber = '' + Math.abs(number),
- zerosToFill = targetLength - absNumber.length,
- sign = number >= 0;
- return (sign ? (forceSign ? '+' : '') : '-') +
- Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
-}
-
-var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
-
-var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
-
-var formatFunctions = {};
-
-var formatTokenFunctions = {};
-
-// token: 'M'
-// padded: ['MM', 2]
-// ordinal: 'Mo'
-// callback: function () { this.month() + 1 }
-function addFormatToken (token, padded, ordinal, callback) {
- var func = callback;
- if (typeof callback === 'string') {
- func = function () {
- return this[callback]();
- };
- }
- if (token) {
- formatTokenFunctions[token] = func;
- }
- if (padded) {
- formatTokenFunctions[padded[0]] = function () {
- return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
- };
- }
- if (ordinal) {
- formatTokenFunctions[ordinal] = function () {
- return this.localeData().ordinal(func.apply(this, arguments), token);
- };
- }
-}
-
-function removeFormattingTokens(input) {
- if (input.match(/\[[\s\S]/)) {
- return input.replace(/^\[|\]$/g, '');
- }
- return input.replace(/\\/g, '');
-}
-
-function makeFormatFunction(format) {
- var array = format.match(formattingTokens), i, length;
-
- for (i = 0, length = array.length; i < length; i++) {
- if (formatTokenFunctions[array[i]]) {
- array[i] = formatTokenFunctions[array[i]];
- } else {
- array[i] = removeFormattingTokens(array[i]);
- }
- }
-
- return function (mom) {
- var output = '', i;
- for (i = 0; i < length; i++) {
- output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];
- }
- return output;
- };
-}
-
-// format date using native date object
-function formatMoment(m, format) {
- if (!m.isValid()) {
- return m.localeData().invalidDate();
- }
-
- format = expandFormat(format, m.localeData());
- formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
-
- return formatFunctions[format](m);
-}
-
-function expandFormat(format, locale) {
- var i = 5;
-
- function replaceLongDateFormatTokens(input) {
- return locale.longDateFormat(input) || input;
- }
-
- localFormattingTokens.lastIndex = 0;
- while (i >= 0 && localFormattingTokens.test(format)) {
- format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
- localFormattingTokens.lastIndex = 0;
- i -= 1;
- }
-
- return format;
-}
-
-var match1 = /\d/; // 0 - 9
-var match2 = /\d\d/; // 00 - 99
-var match3 = /\d{3}/; // 000 - 999
-var match4 = /\d{4}/; // 0000 - 9999
-var match6 = /[+-]?\d{6}/; // -999999 - 999999
-var match1to2 = /\d\d?/; // 0 - 99
-var match3to4 = /\d\d\d\d?/; // 999 - 9999
-var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
-var match1to3 = /\d{1,3}/; // 0 - 999
-var match1to4 = /\d{1,4}/; // 0 - 9999
-var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
-
-var matchUnsigned = /\d+/; // 0 - inf
-var matchSigned = /[+-]?\d+/; // -inf - inf
-
-var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
-var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
-
-var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
-
-// any word (or two) characters or numbers including two/three word month in arabic.
-// includes scottish gaelic two word and hyphenated months
-var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
-
-
-var regexes = {};
-
-function addRegexToken (token, regex, strictRegex) {
- regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
- return (isStrict && strictRegex) ? strictRegex : regex;
- };
-}
-
-function getParseRegexForToken (token, config) {
- if (!hasOwnProp(regexes, token)) {
- return new RegExp(unescapeFormat(token));
- }
-
- return regexes[token](config._strict, config._locale);
-}
-
-// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
-function unescapeFormat(s) {
- return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
- return p1 || p2 || p3 || p4;
- }));
-}
-
-function regexEscape(s) {
- return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
-}
-
-var tokens = {};
-
-function addParseToken (token, callback) {
- var i, func = callback;
- if (typeof token === 'string') {
- token = [token];
- }
- if (isNumber(callback)) {
- func = function (input, array) {
- array[callback] = toInt(input);
- };
- }
- for (i = 0; i < token.length; i++) {
- tokens[token[i]] = func;
- }
-}
-
-function addWeekParseToken (token, callback) {
- addParseToken(token, function (input, array, config, token) {
- config._w = config._w || {};
- callback(input, config._w, config, token);
- });
-}
-
-function addTimeToArrayFromToken(token, input, config) {
- if (input != null && hasOwnProp(tokens, token)) {
- tokens[token](input, config._a, config, token);
- }
-}
-
-var YEAR = 0;
-var MONTH = 1;
-var DATE = 2;
-var HOUR = 3;
-var MINUTE = 4;
-var SECOND = 5;
-var MILLISECOND = 6;
-var WEEK = 7;
-var WEEKDAY = 8;
-
-var indexOf;
-
-if (Array.prototype.indexOf) {
- indexOf = Array.prototype.indexOf;
-} else {
- indexOf = function (o) {
- // I know
- var i;
- for (i = 0; i < this.length; ++i) {
- if (this[i] === o) {
- return i;
- }
- }
- return -1;
- };
-}
-
-var indexOf$1 = indexOf;
-
-function daysInMonth(year, month) {
- return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
-}
-
-// FORMATTING
-
-addFormatToken('M', ['MM', 2], 'Mo', function () {
- return this.month() + 1;
-});
-
-addFormatToken('MMM', 0, 0, function (format) {
- return this.localeData().monthsShort(this, format);
-});
-
-addFormatToken('MMMM', 0, 0, function (format) {
- return this.localeData().months(this, format);
-});
-
-// ALIASES
-
-addUnitAlias('month', 'M');
-
-// PRIORITY
-
-addUnitPriority('month', 8);
-
-// PARSING
-
-addRegexToken('M', match1to2);
-addRegexToken('MM', match1to2, match2);
-addRegexToken('MMM', function (isStrict, locale) {
- return locale.monthsShortRegex(isStrict);
-});
-addRegexToken('MMMM', function (isStrict, locale) {
- return locale.monthsRegex(isStrict);
-});
-
-addParseToken(['M', 'MM'], function (input, array) {
- array[MONTH] = toInt(input) - 1;
-});
-
-addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
- var month = config._locale.monthsParse(input, token, config._strict);
- // if we didn't find a month name, mark the date as invalid.
- if (month != null) {
- array[MONTH] = month;
- } else {
- getParsingFlags(config).invalidMonth = input;
- }
-});
-
-// LOCALES
-
-var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
-var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
-function localeMonths (m, format) {
- if (!m) {
- return isArray(this._months) ? this._months :
- this._months['standalone'];
- }
- return isArray(this._months) ? this._months[m.month()] :
- this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
-}
-
-var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
-function localeMonthsShort (m, format) {
- if (!m) {
- return isArray(this._monthsShort) ? this._monthsShort :
- this._monthsShort['standalone'];
- }
- return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
- this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
-}
-
-function handleStrictParse(monthName, format, strict) {
- var i, ii, mom, llc = monthName.toLocaleLowerCase();
- if (!this._monthsParse) {
- // this is not used
- this._monthsParse = [];
- this._longMonthsParse = [];
- this._shortMonthsParse = [];
- for (i = 0; i < 12; ++i) {
- mom = createUTC([2000, i]);
- this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
- this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
- }
- }
-
- if (strict) {
- if (format === 'MMM') {
- ii = indexOf$1.call(this._shortMonthsParse, llc);
- return ii !== -1 ? ii : null;
- } else {
- ii = indexOf$1.call(this._longMonthsParse, llc);
- return ii !== -1 ? ii : null;
- }
- } else {
- if (format === 'MMM') {
- ii = indexOf$1.call(this._shortMonthsParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf$1.call(this._longMonthsParse, llc);
- return ii !== -1 ? ii : null;
- } else {
- ii = indexOf$1.call(this._longMonthsParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf$1.call(this._shortMonthsParse, llc);
- return ii !== -1 ? ii : null;
- }
- }
-}
-
-function localeMonthsParse (monthName, format, strict) {
- var i, mom, regex;
-
- if (this._monthsParseExact) {
- return handleStrictParse.call(this, monthName, format, strict);
- }
-
- if (!this._monthsParse) {
- this._monthsParse = [];
- this._longMonthsParse = [];
- this._shortMonthsParse = [];
- }
-
- // TODO: add sorting
- // Sorting makes sure if one month (or abbr) is a prefix of another
- // see sorting in computeMonthsParse
- for (i = 0; i < 12; i++) {
- // make the regex if we don't have it already
- mom = createUTC([2000, i]);
- if (strict && !this._longMonthsParse[i]) {
- this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
- this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
- }
- if (!strict && !this._monthsParse[i]) {
- regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
- this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
- }
- // test the regex
- if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
- return i;
- } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
- return i;
- } else if (!strict && this._monthsParse[i].test(monthName)) {
- return i;
- }
- }
-}
-
-// MOMENTS
-
-function setMonth (mom, value) {
- var dayOfMonth;
-
- if (!mom.isValid()) {
- // No op
- return mom;
- }
-
- if (typeof value === 'string') {
- if (/^\d+$/.test(value)) {
- value = toInt(value);
- } else {
- value = mom.localeData().monthsParse(value);
- // TODO: Another silent failure?
- if (!isNumber(value)) {
- return mom;
- }
- }
- }
-
- dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
- return mom;
-}
-
-function getSetMonth (value) {
- if (value != null) {
- setMonth(this, value);
- hooks.updateOffset(this, true);
- return this;
- } else {
- return get(this, 'Month');
- }
-}
-
-function getDaysInMonth () {
- return daysInMonth(this.year(), this.month());
-}
-
-var defaultMonthsShortRegex = matchWord;
-function monthsShortRegex (isStrict) {
- if (this._monthsParseExact) {
- if (!hasOwnProp(this, '_monthsRegex')) {
- computeMonthsParse.call(this);
- }
- if (isStrict) {
- return this._monthsShortStrictRegex;
- } else {
- return this._monthsShortRegex;
- }
- } else {
- if (!hasOwnProp(this, '_monthsShortRegex')) {
- this._monthsShortRegex = defaultMonthsShortRegex;
- }
- return this._monthsShortStrictRegex && isStrict ?
- this._monthsShortStrictRegex : this._monthsShortRegex;
- }
-}
-
-var defaultMonthsRegex = matchWord;
-function monthsRegex (isStrict) {
- if (this._monthsParseExact) {
- if (!hasOwnProp(this, '_monthsRegex')) {
- computeMonthsParse.call(this);
- }
- if (isStrict) {
- return this._monthsStrictRegex;
- } else {
- return this._monthsRegex;
- }
- } else {
- if (!hasOwnProp(this, '_monthsRegex')) {
- this._monthsRegex = defaultMonthsRegex;
- }
- return this._monthsStrictRegex && isStrict ?
- this._monthsStrictRegex : this._monthsRegex;
- }
-}
-
-function computeMonthsParse () {
- function cmpLenRev(a, b) {
- return b.length - a.length;
- }
-
- var shortPieces = [], longPieces = [], mixedPieces = [],
- i, mom;
- for (i = 0; i < 12; i++) {
- // make the regex if we don't have it already
- mom = createUTC([2000, i]);
- shortPieces.push(this.monthsShort(mom, ''));
- longPieces.push(this.months(mom, ''));
- mixedPieces.push(this.months(mom, ''));
- mixedPieces.push(this.monthsShort(mom, ''));
- }
- // Sorting makes sure if one month (or abbr) is a prefix of another it
- // will match the longer piece.
- shortPieces.sort(cmpLenRev);
- longPieces.sort(cmpLenRev);
- mixedPieces.sort(cmpLenRev);
- for (i = 0; i < 12; i++) {
- shortPieces[i] = regexEscape(shortPieces[i]);
- longPieces[i] = regexEscape(longPieces[i]);
- }
- for (i = 0; i < 24; i++) {
- mixedPieces[i] = regexEscape(mixedPieces[i]);
- }
-
- this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
- this._monthsShortRegex = this._monthsRegex;
- this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
- this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
-}
-
-// FORMATTING
-
-addFormatToken('Y', 0, 0, function () {
- var y = this.year();
- return y <= 9999 ? '' + y : '+' + y;
-});
-
-addFormatToken(0, ['YY', 2], 0, function () {
- return this.year() % 100;
-});
-
-addFormatToken(0, ['YYYY', 4], 0, 'year');
-addFormatToken(0, ['YYYYY', 5], 0, 'year');
-addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
-
-// ALIASES
-
-addUnitAlias('year', 'y');
-
-// PRIORITIES
-
-addUnitPriority('year', 1);
-
-// PARSING
-
-addRegexToken('Y', matchSigned);
-addRegexToken('YY', match1to2, match2);
-addRegexToken('YYYY', match1to4, match4);
-addRegexToken('YYYYY', match1to6, match6);
-addRegexToken('YYYYYY', match1to6, match6);
-
-addParseToken(['YYYYY', 'YYYYYY'], YEAR);
-addParseToken('YYYY', function (input, array) {
- array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
-});
-addParseToken('YY', function (input, array) {
- array[YEAR] = hooks.parseTwoDigitYear(input);
-});
-addParseToken('Y', function (input, array) {
- array[YEAR] = parseInt(input, 10);
-});
-
-// HELPERS
-
-function daysInYear(year) {
- return isLeapYear(year) ? 366 : 365;
-}
-
-function isLeapYear(year) {
- return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
-}
-
-// HOOKS
-
-hooks.parseTwoDigitYear = function (input) {
- return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
-};
-
-// MOMENTS
-
-var getSetYear = makeGetSet('FullYear', true);
-
-function getIsLeapYear () {
- return isLeapYear(this.year());
-}
-
-function createDate (y, m, d, h, M, s, ms) {
- // can't just apply() to create a date:
- // https://stackoverflow.com/q/181348
- var date = new Date(y, m, d, h, M, s, ms);
-
- // the date constructor remaps years 0-99 to 1900-1999
- if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
- date.setFullYear(y);
- }
- return date;
-}
-
-function createUTCDate (y) {
- var date = new Date(Date.UTC.apply(null, arguments));
-
- // the Date.UTC function remaps years 0-99 to 1900-1999
- if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
- date.setUTCFullYear(y);
- }
- return date;
-}
-
-// start-of-first-week - start-of-year
-function firstWeekOffset(year, dow, doy) {
- var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
- fwd = 7 + dow - doy,
- // first-week day local weekday -- which local weekday is fwd
- fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
-
- return -fwdlw + fwd - 1;
-}
-
-// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
-function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
- var localWeekday = (7 + weekday - dow) % 7,
- weekOffset = firstWeekOffset(year, dow, doy),
- dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
- resYear, resDayOfYear;
-
- if (dayOfYear <= 0) {
- resYear = year - 1;
- resDayOfYear = daysInYear(resYear) + dayOfYear;
- } else if (dayOfYear > daysInYear(year)) {
- resYear = year + 1;
- resDayOfYear = dayOfYear - daysInYear(year);
- } else {
- resYear = year;
- resDayOfYear = dayOfYear;
- }
-
- return {
- year: resYear,
- dayOfYear: resDayOfYear
- };
-}
-
-function weekOfYear(mom, dow, doy) {
- var weekOffset = firstWeekOffset(mom.year(), dow, doy),
- week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
- resWeek, resYear;
-
- if (week < 1) {
- resYear = mom.year() - 1;
- resWeek = week + weeksInYear(resYear, dow, doy);
- } else if (week > weeksInYear(mom.year(), dow, doy)) {
- resWeek = week - weeksInYear(mom.year(), dow, doy);
- resYear = mom.year() + 1;
- } else {
- resYear = mom.year();
- resWeek = week;
- }
-
- return {
- week: resWeek,
- year: resYear
- };
-}
-
-function weeksInYear(year, dow, doy) {
- var weekOffset = firstWeekOffset(year, dow, doy),
- weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
- return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
-}
-
-// FORMATTING
-
-addFormatToken('w', ['ww', 2], 'wo', 'week');
-addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
-
-// ALIASES
-
-addUnitAlias('week', 'w');
-addUnitAlias('isoWeek', 'W');
-
-// PRIORITIES
-
-addUnitPriority('week', 5);
-addUnitPriority('isoWeek', 5);
-
-// PARSING
-
-addRegexToken('w', match1to2);
-addRegexToken('ww', match1to2, match2);
-addRegexToken('W', match1to2);
-addRegexToken('WW', match1to2, match2);
-
-addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
- week[token.substr(0, 1)] = toInt(input);
-});
-
-// HELPERS
-
-// LOCALES
-
-function localeWeek (mom) {
- return weekOfYear(mom, this._week.dow, this._week.doy).week;
-}
-
-var defaultLocaleWeek = {
- dow : 0, // Sunday is the first day of the week.
- doy : 6 // The week that contains Jan 1st is the first week of the year.
-};
-
-function localeFirstDayOfWeek () {
- return this._week.dow;
-}
-
-function localeFirstDayOfYear () {
- return this._week.doy;
-}
-
-// MOMENTS
-
-function getSetWeek (input) {
- var week = this.localeData().week(this);
- return input == null ? week : this.add((input - week) * 7, 'd');
-}
-
-function getSetISOWeek (input) {
- var week = weekOfYear(this, 1, 4).week;
- return input == null ? week : this.add((input - week) * 7, 'd');
-}
-
-// FORMATTING
-
-addFormatToken('d', 0, 'do', 'day');
-
-addFormatToken('dd', 0, 0, function (format) {
- return this.localeData().weekdaysMin(this, format);
-});
-
-addFormatToken('ddd', 0, 0, function (format) {
- return this.localeData().weekdaysShort(this, format);
-});
-
-addFormatToken('dddd', 0, 0, function (format) {
- return this.localeData().weekdays(this, format);
-});
-
-addFormatToken('e', 0, 0, 'weekday');
-addFormatToken('E', 0, 0, 'isoWeekday');
-
-// ALIASES
-
-addUnitAlias('day', 'd');
-addUnitAlias('weekday', 'e');
-addUnitAlias('isoWeekday', 'E');
-
-// PRIORITY
-addUnitPriority('day', 11);
-addUnitPriority('weekday', 11);
-addUnitPriority('isoWeekday', 11);
-
-// PARSING
-
-addRegexToken('d', match1to2);
-addRegexToken('e', match1to2);
-addRegexToken('E', match1to2);
-addRegexToken('dd', function (isStrict, locale) {
- return locale.weekdaysMinRegex(isStrict);
-});
-addRegexToken('ddd', function (isStrict, locale) {
- return locale.weekdaysShortRegex(isStrict);
-});
-addRegexToken('dddd', function (isStrict, locale) {
- return locale.weekdaysRegex(isStrict);
-});
-
-addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
- var weekday = config._locale.weekdaysParse(input, token, config._strict);
- // if we didn't get a weekday name, mark the date as invalid
- if (weekday != null) {
- week.d = weekday;
- } else {
- getParsingFlags(config).invalidWeekday = input;
- }
-});
-
-addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
- week[token] = toInt(input);
-});
-
-// HELPERS
-
-function parseWeekday(input, locale) {
- if (typeof input !== 'string') {
- return input;
- }
-
- if (!isNaN(input)) {
- return parseInt(input, 10);
- }
-
- input = locale.weekdaysParse(input);
- if (typeof input === 'number') {
- return input;
- }
-
- return null;
-}
-
-function parseIsoWeekday(input, locale) {
- if (typeof input === 'string') {
- return locale.weekdaysParse(input) % 7 || 7;
- }
- return isNaN(input) ? null : input;
-}
-
-// LOCALES
-
-var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
-function localeWeekdays (m, format) {
- if (!m) {
- return isArray(this._weekdays) ? this._weekdays :
- this._weekdays['standalone'];
- }
- return isArray(this._weekdays) ? this._weekdays[m.day()] :
- this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
-}
-
-var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
-function localeWeekdaysShort (m) {
- return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
-}
-
-var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
-function localeWeekdaysMin (m) {
- return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
-}
-
-function handleStrictParse$1(weekdayName, format, strict) {
- var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
- if (!this._weekdaysParse) {
- this._weekdaysParse = [];
- this._shortWeekdaysParse = [];
- this._minWeekdaysParse = [];
-
- for (i = 0; i < 7; ++i) {
- mom = createUTC([2000, 1]).day(i);
- this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
- this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
- this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
- }
- }
-
- if (strict) {
- if (format === 'dddd') {
- ii = indexOf$1.call(this._weekdaysParse, llc);
- return ii !== -1 ? ii : null;
- } else if (format === 'ddd') {
- ii = indexOf$1.call(this._shortWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- } else {
- ii = indexOf$1.call(this._minWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- }
- } else {
- if (format === 'dddd') {
- ii = indexOf$1.call(this._weekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf$1.call(this._shortWeekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf$1.call(this._minWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- } else if (format === 'ddd') {
- ii = indexOf$1.call(this._shortWeekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf$1.call(this._weekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf$1.call(this._minWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- } else {
- ii = indexOf$1.call(this._minWeekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf$1.call(this._weekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf$1.call(this._shortWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- }
- }
-}
-
-function localeWeekdaysParse (weekdayName, format, strict) {
- var i, mom, regex;
-
- if (this._weekdaysParseExact) {
- return handleStrictParse$1.call(this, weekdayName, format, strict);
- }
-
- if (!this._weekdaysParse) {
- this._weekdaysParse = [];
- this._minWeekdaysParse = [];
- this._shortWeekdaysParse = [];
- this._fullWeekdaysParse = [];
- }
-
- for (i = 0; i < 7; i++) {
- // make the regex if we don't have it already
-
- mom = createUTC([2000, 1]).day(i);
- if (strict && !this._fullWeekdaysParse[i]) {
- this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
- this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
- this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
- }
- if (!this._weekdaysParse[i]) {
- regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
- this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
- }
- // test the regex
- if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
- return i;
- } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
- return i;
- } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
- return i;
- } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
- return i;
- }
- }
-}
-
-// MOMENTS
-
-function getSetDayOfWeek (input) {
- if (!this.isValid()) {
- return input != null ? this : NaN;
- }
- var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
- if (input != null) {
- input = parseWeekday(input, this.localeData());
- return this.add(input - day, 'd');
- } else {
- return day;
- }
-}
-
-function getSetLocaleDayOfWeek (input) {
- if (!this.isValid()) {
- return input != null ? this : NaN;
- }
- var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
- return input == null ? weekday : this.add(input - weekday, 'd');
-}
-
-function getSetISODayOfWeek (input) {
- if (!this.isValid()) {
- return input != null ? this : NaN;
- }
-
- // behaves the same as moment#day except
- // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
- // as a setter, sunday should belong to the previous week.
-
- if (input != null) {
- var weekday = parseIsoWeekday(input, this.localeData());
- return this.day(this.day() % 7 ? weekday : weekday - 7);
- } else {
- return this.day() || 7;
- }
-}
-
-var defaultWeekdaysRegex = matchWord;
-function weekdaysRegex (isStrict) {
- if (this._weekdaysParseExact) {
- if (!hasOwnProp(this, '_weekdaysRegex')) {
- computeWeekdaysParse.call(this);
- }
- if (isStrict) {
- return this._weekdaysStrictRegex;
- } else {
- return this._weekdaysRegex;
- }
- } else {
- if (!hasOwnProp(this, '_weekdaysRegex')) {
- this._weekdaysRegex = defaultWeekdaysRegex;
- }
- return this._weekdaysStrictRegex && isStrict ?
- this._weekdaysStrictRegex : this._weekdaysRegex;
- }
-}
-
-var defaultWeekdaysShortRegex = matchWord;
-function weekdaysShortRegex (isStrict) {
- if (this._weekdaysParseExact) {
- if (!hasOwnProp(this, '_weekdaysRegex')) {
- computeWeekdaysParse.call(this);
- }
- if (isStrict) {
- return this._weekdaysShortStrictRegex;
- } else {
- return this._weekdaysShortRegex;
- }
- } else {
- if (!hasOwnProp(this, '_weekdaysShortRegex')) {
- this._weekdaysShortRegex = defaultWeekdaysShortRegex;
- }
- return this._weekdaysShortStrictRegex && isStrict ?
- this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
- }
-}
-
-var defaultWeekdaysMinRegex = matchWord;
-function weekdaysMinRegex (isStrict) {
- if (this._weekdaysParseExact) {
- if (!hasOwnProp(this, '_weekdaysRegex')) {
- computeWeekdaysParse.call(this);
- }
- if (isStrict) {
- return this._weekdaysMinStrictRegex;
- } else {
- return this._weekdaysMinRegex;
- }
- } else {
- if (!hasOwnProp(this, '_weekdaysMinRegex')) {
- this._weekdaysMinRegex = defaultWeekdaysMinRegex;
- }
- return this._weekdaysMinStrictRegex && isStrict ?
- this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
- }
-}
-
-
-function computeWeekdaysParse () {
- function cmpLenRev(a, b) {
- return b.length - a.length;
- }
-
- var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
- i, mom, minp, shortp, longp;
- for (i = 0; i < 7; i++) {
- // make the regex if we don't have it already
- mom = createUTC([2000, 1]).day(i);
- minp = this.weekdaysMin(mom, '');
- shortp = this.weekdaysShort(mom, '');
- longp = this.weekdays(mom, '');
- minPieces.push(minp);
- shortPieces.push(shortp);
- longPieces.push(longp);
- mixedPieces.push(minp);
- mixedPieces.push(shortp);
- mixedPieces.push(longp);
- }
- // Sorting makes sure if one weekday (or abbr) is a prefix of another it
- // will match the longer piece.
- minPieces.sort(cmpLenRev);
- shortPieces.sort(cmpLenRev);
- longPieces.sort(cmpLenRev);
- mixedPieces.sort(cmpLenRev);
- for (i = 0; i < 7; i++) {
- shortPieces[i] = regexEscape(shortPieces[i]);
- longPieces[i] = regexEscape(longPieces[i]);
- mixedPieces[i] = regexEscape(mixedPieces[i]);
- }
-
- this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
- this._weekdaysShortRegex = this._weekdaysRegex;
- this._weekdaysMinRegex = this._weekdaysRegex;
-
- this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
- this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
- this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
-}
-
-// FORMATTING
-
-function hFormat() {
- return this.hours() % 12 || 12;
-}
-
-function kFormat() {
- return this.hours() || 24;
-}
-
-addFormatToken('H', ['HH', 2], 0, 'hour');
-addFormatToken('h', ['hh', 2], 0, hFormat);
-addFormatToken('k', ['kk', 2], 0, kFormat);
-
-addFormatToken('hmm', 0, 0, function () {
- return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
-});
-
-addFormatToken('hmmss', 0, 0, function () {
- return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
- zeroFill(this.seconds(), 2);
-});
-
-addFormatToken('Hmm', 0, 0, function () {
- return '' + this.hours() + zeroFill(this.minutes(), 2);
-});
-
-addFormatToken('Hmmss', 0, 0, function () {
- return '' + this.hours() + zeroFill(this.minutes(), 2) +
- zeroFill(this.seconds(), 2);
-});
-
-function meridiem (token, lowercase) {
- addFormatToken(token, 0, 0, function () {
- return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
- });
-}
-
-meridiem('a', true);
-meridiem('A', false);
-
-// ALIASES
-
-addUnitAlias('hour', 'h');
-
-// PRIORITY
-addUnitPriority('hour', 13);
-
-// PARSING
-
-function matchMeridiem (isStrict, locale) {
- return locale._meridiemParse;
-}
-
-addRegexToken('a', matchMeridiem);
-addRegexToken('A', matchMeridiem);
-addRegexToken('H', match1to2);
-addRegexToken('h', match1to2);
-addRegexToken('k', match1to2);
-addRegexToken('HH', match1to2, match2);
-addRegexToken('hh', match1to2, match2);
-addRegexToken('kk', match1to2, match2);
-
-addRegexToken('hmm', match3to4);
-addRegexToken('hmmss', match5to6);
-addRegexToken('Hmm', match3to4);
-addRegexToken('Hmmss', match5to6);
-
-addParseToken(['H', 'HH'], HOUR);
-addParseToken(['k', 'kk'], function (input, array, config) {
- var kInput = toInt(input);
- array[HOUR] = kInput === 24 ? 0 : kInput;
-});
-addParseToken(['a', 'A'], function (input, array, config) {
- config._isPm = config._locale.isPM(input);
- config._meridiem = input;
-});
-addParseToken(['h', 'hh'], function (input, array, config) {
- array[HOUR] = toInt(input);
- getParsingFlags(config).bigHour = true;
-});
-addParseToken('hmm', function (input, array, config) {
- var pos = input.length - 2;
- array[HOUR] = toInt(input.substr(0, pos));
- array[MINUTE] = toInt(input.substr(pos));
- getParsingFlags(config).bigHour = true;
-});
-addParseToken('hmmss', function (input, array, config) {
- var pos1 = input.length - 4;
- var pos2 = input.length - 2;
- array[HOUR] = toInt(input.substr(0, pos1));
- array[MINUTE] = toInt(input.substr(pos1, 2));
- array[SECOND] = toInt(input.substr(pos2));
- getParsingFlags(config).bigHour = true;
-});
-addParseToken('Hmm', function (input, array, config) {
- var pos = input.length - 2;
- array[HOUR] = toInt(input.substr(0, pos));
- array[MINUTE] = toInt(input.substr(pos));
-});
-addParseToken('Hmmss', function (input, array, config) {
- var pos1 = input.length - 4;
- var pos2 = input.length - 2;
- array[HOUR] = toInt(input.substr(0, pos1));
- array[MINUTE] = toInt(input.substr(pos1, 2));
- array[SECOND] = toInt(input.substr(pos2));
-});
-
-// LOCALES
-
-function localeIsPM (input) {
- // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
- // Using charAt should be more compatible.
- return ((input + '').toLowerCase().charAt(0) === 'p');
-}
-
-var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
-function localeMeridiem (hours, minutes, isLower) {
- if (hours > 11) {
- return isLower ? 'pm' : 'PM';
- } else {
- return isLower ? 'am' : 'AM';
- }
-}
-
-
-// MOMENTS
-
-// Setting the hour should keep the time, because the user explicitly
-// specified which hour he wants. So trying to maintain the same hour (in
-// a new timezone) makes sense. Adding/subtracting hours does not follow
-// this rule.
-var getSetHour = makeGetSet('Hours', true);
-
-// months
-// week
-// weekdays
-// meridiem
-var baseConfig = {
- calendar: defaultCalendar,
- longDateFormat: defaultLongDateFormat,
- invalidDate: defaultInvalidDate,
- ordinal: defaultOrdinal,
- dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
- relativeTime: defaultRelativeTime,
-
- months: defaultLocaleMonths,
- monthsShort: defaultLocaleMonthsShort,
-
- week: defaultLocaleWeek,
-
- weekdays: defaultLocaleWeekdays,
- weekdaysMin: defaultLocaleWeekdaysMin,
- weekdaysShort: defaultLocaleWeekdaysShort,
-
- meridiemParse: defaultLocaleMeridiemParse
-};
-
-// internal storage for locale config files
-var locales = {};
-var localeFamilies = {};
-var globalLocale;
-
-function normalizeLocale(key) {
- return key ? key.toLowerCase().replace('_', '-') : key;
-}
-
-// pick the locale from the array
-// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
-// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
-function chooseLocale(names) {
- var i = 0, j, next, locale, split;
-
- while (i < names.length) {
- split = normalizeLocale(names[i]).split('-');
- j = split.length;
- next = normalizeLocale(names[i + 1]);
- next = next ? next.split('-') : null;
- while (j > 0) {
- locale = loadLocale(split.slice(0, j).join('-'));
- if (locale) {
- return locale;
- }
- if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
- //the next array item is better than a shallower substring of this one
- break;
- }
- j--;
- }
- i++;
- }
- return null;
-}
-
-function loadLocale(name) {
- var oldLocale = null;
- // TODO: Find a better way to register and load all the locales in Node
- if (!locales[name] && (typeof module !== 'undefined') &&
- module && module.exports) {
- try {
- oldLocale = globalLocale._abbr;
- require('./locale/' + name);
- // because defineLocale currently also sets the global locale, we
- // want to undo that for lazy loaded locales
- getSetGlobalLocale(oldLocale);
- } catch (e) { }
- }
- return locales[name];
-}
-
-// This function will load locale and then set the global locale. If
-// no arguments are passed in, it will simply return the current global
-// locale key.
-function getSetGlobalLocale (key, values) {
- var data;
- if (key) {
- if (isUndefined(values)) {
- data = getLocale(key);
- }
- else {
- data = defineLocale(key, values);
- }
-
- if (data) {
- // moment.duration._locale = moment._locale = data;
- globalLocale = data;
- }
- }
-
- return globalLocale._abbr;
-}
-
-function defineLocale (name, config) {
- if (config !== null) {
- var parentConfig = baseConfig;
- config.abbr = name;
- if (locales[name] != null) {
- deprecateSimple('defineLocaleOverride',
- 'use moment.updateLocale(localeName, config) to change ' +
- 'an existing locale. moment.defineLocale(localeName, ' +
- 'config) should only be used for creating a new locale ' +
- 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
- parentConfig = locales[name]._config;
- } else if (config.parentLocale != null) {
- if (locales[config.parentLocale] != null) {
- parentConfig = locales[config.parentLocale]._config;
- } else {
- if (!localeFamilies[config.parentLocale]) {
- localeFamilies[config.parentLocale] = [];
- }
- localeFamilies[config.parentLocale].push({
- name: name,
- config: config
- });
- return null;
- }
- }
- locales[name] = new Locale(mergeConfigs(parentConfig, config));
-
- if (localeFamilies[name]) {
- localeFamilies[name].forEach(function (x) {
- defineLocale(x.name, x.config);
- });
- }
-
- // backwards compat for now: also set the locale
- // make sure we set the locale AFTER all child locales have been
- // created, so we won't end up with the child locale set.
- getSetGlobalLocale(name);
-
-
- return locales[name];
- } else {
- // useful for testing
- delete locales[name];
- return null;
- }
-}
-
-function updateLocale(name, config) {
- if (config != null) {
- var locale, parentConfig = baseConfig;
- // MERGE
- if (locales[name] != null) {
- parentConfig = locales[name]._config;
- }
- config = mergeConfigs(parentConfig, config);
- locale = new Locale(config);
- locale.parentLocale = locales[name];
- locales[name] = locale;
-
- // backwards compat for now: also set the locale
- getSetGlobalLocale(name);
- } else {
- // pass null for config to unupdate, useful for tests
- if (locales[name] != null) {
- if (locales[name].parentLocale != null) {
- locales[name] = locales[name].parentLocale;
- } else if (locales[name] != null) {
- delete locales[name];
- }
- }
- }
- return locales[name];
-}
-
-// returns locale data
-function getLocale (key) {
- var locale;
-
- if (key && key._locale && key._locale._abbr) {
- key = key._locale._abbr;
- }
-
- if (!key) {
- return globalLocale;
- }
-
- if (!isArray(key)) {
- //short-circuit everything else
- locale = loadLocale(key);
- if (locale) {
- return locale;
- }
- key = [key];
- }
-
- return chooseLocale(key);
-}
-
-function listLocales() {
- return keys$1(locales);
-}
-
-function checkOverflow (m) {
- var overflow;
- var a = m._a;
-
- if (a && getParsingFlags(m).overflow === -2) {
- overflow =
- a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
- a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
- a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
- a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
- a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
- a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
- -1;
-
- if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
- overflow = DATE;
- }
- if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
- overflow = WEEK;
- }
- if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
- overflow = WEEKDAY;
- }
-
- getParsingFlags(m).overflow = overflow;
- }
-
- return m;
-}
-
-// iso 8601 regex
-// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
-var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
-var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
-
-var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
-
-var isoDates = [
- ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
- ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
- ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
- ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
- ['YYYY-DDD', /\d{4}-\d{3}/],
- ['YYYY-MM', /\d{4}-\d\d/, false],
- ['YYYYYYMMDD', /[+-]\d{10}/],
- ['YYYYMMDD', /\d{8}/],
- // YYYYMM is NOT allowed by the standard
- ['GGGG[W]WWE', /\d{4}W\d{3}/],
- ['GGGG[W]WW', /\d{4}W\d{2}/, false],
- ['YYYYDDD', /\d{7}/]
-];
-
-// iso time formats and regexes
-var isoTimes = [
- ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
- ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
- ['HH:mm:ss', /\d\d:\d\d:\d\d/],
- ['HH:mm', /\d\d:\d\d/],
- ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
- ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
- ['HHmmss', /\d\d\d\d\d\d/],
- ['HHmm', /\d\d\d\d/],
- ['HH', /\d\d/]
-];
-
-var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
-
-// date from iso format
-function configFromISO(config) {
- var i, l,
- string = config._i,
- match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
- allowTime, dateFormat, timeFormat, tzFormat;
-
- if (match) {
- getParsingFlags(config).iso = true;
-
- for (i = 0, l = isoDates.length; i < l; i++) {
- if (isoDates[i][1].exec(match[1])) {
- dateFormat = isoDates[i][0];
- allowTime = isoDates[i][2] !== false;
- break;
- }
- }
- if (dateFormat == null) {
- config._isValid = false;
- return;
- }
- if (match[3]) {
- for (i = 0, l = isoTimes.length; i < l; i++) {
- if (isoTimes[i][1].exec(match[3])) {
- // match[2] should be 'T' or space
- timeFormat = (match[2] || ' ') + isoTimes[i][0];
- break;
- }
- }
- if (timeFormat == null) {
- config._isValid = false;
- return;
- }
- }
- if (!allowTime && timeFormat != null) {
- config._isValid = false;
- return;
- }
- if (match[4]) {
- if (tzRegex.exec(match[4])) {
- tzFormat = 'Z';
- } else {
- config._isValid = false;
- return;
- }
- }
- config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
- configFromStringAndFormat(config);
- } else {
- config._isValid = false;
- }
-}
-
-// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
-var basicRfcRegex = /^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d?\d\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(?:\d\d)?\d\d\s)(\d\d:\d\d)(\:\d\d)?(\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\d{4}))$/;
-
-// date and time from ref 2822 format
-function configFromRFC2822(config) {
- var string, match, dayFormat,
- dateFormat, timeFormat, tzFormat;
- var timezones = {
- ' GMT': ' +0000',
- ' EDT': ' -0400',
- ' EST': ' -0500',
- ' CDT': ' -0500',
- ' CST': ' -0600',
- ' MDT': ' -0600',
- ' MST': ' -0700',
- ' PDT': ' -0700',
- ' PST': ' -0800'
- };
- var military = 'YXWVUTSRQPONZABCDEFGHIKLM';
- var timezone, timezoneIndex;
-
- string = config._i
- .replace(/\([^\)]*\)|[\n\t]/g, ' ') // Remove comments and folding whitespace
- .replace(/(\s\s+)/g, ' ') // Replace multiple-spaces with a single space
- .replace(/^\s|\s$/g, ''); // Remove leading and trailing spaces
- match = basicRfcRegex.exec(string);
-
- if (match) {
- dayFormat = match[1] ? 'ddd' + ((match[1].length === 5) ? ', ' : ' ') : '';
- dateFormat = 'D MMM ' + ((match[2].length > 10) ? 'YYYY ' : 'YY ');
- timeFormat = 'HH:mm' + (match[4] ? ':ss' : '');
-
- // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.
- if (match[1]) { // day of week given
- var momentDate = new Date(match[2]);
- var momentDay = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'][momentDate.getDay()];
-
- if (match[1].substr(0,3) !== momentDay) {
- getParsingFlags(config).weekdayMismatch = true;
- config._isValid = false;
- return;
- }
- }
-
- switch (match[5].length) {
- case 2: // military
- if (timezoneIndex === 0) {
- timezone = ' +0000';
- } else {
- timezoneIndex = military.indexOf(match[5][1].toUpperCase()) - 12;
- timezone = ((timezoneIndex < 0) ? ' -' : ' +') +
- (('' + timezoneIndex).replace(/^-?/, '0')).match(/..$/)[0] + '00';
- }
- break;
- case 4: // Zone
- timezone = timezones[match[5]];
- break;
- default: // UT or +/-9999
- timezone = timezones[' GMT'];
- }
- match[5] = timezone;
- config._i = match.splice(1).join('');
- tzFormat = ' ZZ';
- config._f = dayFormat + dateFormat + timeFormat + tzFormat;
- configFromStringAndFormat(config);
- getParsingFlags(config).rfc2822 = true;
- } else {
- config._isValid = false;
- }
-}
-
-// date from iso format or fallback
-function configFromString(config) {
- var matched = aspNetJsonRegex.exec(config._i);
-
- if (matched !== null) {
- config._d = new Date(+matched[1]);
- return;
- }
-
- configFromISO(config);
- if (config._isValid === false) {
- delete config._isValid;
- } else {
- return;
- }
-
- configFromRFC2822(config);
- if (config._isValid === false) {
- delete config._isValid;
- } else {
- return;
- }
-
- // Final attempt, use Input Fallback
- hooks.createFromInputFallback(config);
-}
-
-hooks.createFromInputFallback = deprecate(
- 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
- 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
- 'discouraged and will be removed in an upcoming major release. Please refer to ' +
- 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
- function (config) {
- config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
- }
-);
-
-// Pick the first defined of two or three arguments.
-function defaults(a, b, c) {
- if (a != null) {
- return a;
- }
- if (b != null) {
- return b;
- }
- return c;
-}
-
-function currentDateArray(config) {
- // hooks is actually the exported moment object
- var nowValue = new Date(hooks.now());
- if (config._useUTC) {
- return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
- }
- return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
-}
-
-// convert an array to a date.
-// the array should mirror the parameters below
-// note: all values past the year are optional and will default to the lowest possible value.
-// [year, month, day , hour, minute, second, millisecond]
-function configFromArray (config) {
- var i, date, input = [], currentDate, yearToUse;
-
- if (config._d) {
- return;
- }
-
- currentDate = currentDateArray(config);
-
- //compute day of the year from weeks and weekdays
- if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
- dayOfYearFromWeekInfo(config);
- }
-
- //if the day of the year is set, figure out what it is
- if (config._dayOfYear != null) {
- yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
-
- if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
- getParsingFlags(config)._overflowDayOfYear = true;
- }
-
- date = createUTCDate(yearToUse, 0, config._dayOfYear);
- config._a[MONTH] = date.getUTCMonth();
- config._a[DATE] = date.getUTCDate();
- }
-
- // Default to current date.
- // * if no year, month, day of month are given, default to today
- // * if day of month is given, default month and year
- // * if month is given, default only year
- // * if year is given, don't default anything
- for (i = 0; i < 3 && config._a[i] == null; ++i) {
- config._a[i] = input[i] = currentDate[i];
- }
-
- // Zero out whatever was not defaulted, including time
- for (; i < 7; i++) {
- config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
- }
-
- // Check for 24:00:00.000
- if (config._a[HOUR] === 24 &&
- config._a[MINUTE] === 0 &&
- config._a[SECOND] === 0 &&
- config._a[MILLISECOND] === 0) {
- config._nextDay = true;
- config._a[HOUR] = 0;
- }
-
- config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
- // Apply timezone offset from input. The actual utcOffset can be changed
- // with parseZone.
- if (config._tzm != null) {
- config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
- }
-
- if (config._nextDay) {
- config._a[HOUR] = 24;
- }
-}
-
-function dayOfYearFromWeekInfo(config) {
- var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
-
- w = config._w;
- if (w.GG != null || w.W != null || w.E != null) {
- dow = 1;
- doy = 4;
-
- // TODO: We need to take the current isoWeekYear, but that depends on
- // how we interpret now (local, utc, fixed offset). So create
- // a now version of current config (take local/utc/offset flags, and
- // create now).
- weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
- week = defaults(w.W, 1);
- weekday = defaults(w.E, 1);
- if (weekday < 1 || weekday > 7) {
- weekdayOverflow = true;
- }
- } else {
- dow = config._locale._week.dow;
- doy = config._locale._week.doy;
-
- var curWeek = weekOfYear(createLocal(), dow, doy);
-
- weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
-
- // Default to current week.
- week = defaults(w.w, curWeek.week);
-
- if (w.d != null) {
- // weekday -- low day numbers are considered next week
- weekday = w.d;
- if (weekday < 0 || weekday > 6) {
- weekdayOverflow = true;
- }
- } else if (w.e != null) {
- // local weekday -- counting starts from begining of week
- weekday = w.e + dow;
- if (w.e < 0 || w.e > 6) {
- weekdayOverflow = true;
- }
- } else {
- // default to begining of week
- weekday = dow;
- }
- }
- if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
- getParsingFlags(config)._overflowWeeks = true;
- } else if (weekdayOverflow != null) {
- getParsingFlags(config)._overflowWeekday = true;
- } else {
- temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
- config._a[YEAR] = temp.year;
- config._dayOfYear = temp.dayOfYear;
- }
-}
-
-// constant that refers to the ISO standard
-hooks.ISO_8601 = function () {};
-
-// constant that refers to the RFC 2822 form
-hooks.RFC_2822 = function () {};
-
-// date from string and format string
-function configFromStringAndFormat(config) {
- // TODO: Move this to another part of the creation flow to prevent circular deps
- if (config._f === hooks.ISO_8601) {
- configFromISO(config);
- return;
- }
- if (config._f === hooks.RFC_2822) {
- configFromRFC2822(config);
- return;
- }
- config._a = [];
- getParsingFlags(config).empty = true;
-
- // This array is used to make a Date, either with `new Date` or `Date.UTC`
- var string = '' + config._i,
- i, parsedInput, tokens, token, skipped,
- stringLength = string.length,
- totalParsedInputLength = 0;
-
- tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
-
- for (i = 0; i < tokens.length; i++) {
- token = tokens[i];
- parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
- // console.log('token', token, 'parsedInput', parsedInput,
- // 'regex', getParseRegexForToken(token, config));
- if (parsedInput) {
- skipped = string.substr(0, string.indexOf(parsedInput));
- if (skipped.length > 0) {
- getParsingFlags(config).unusedInput.push(skipped);
- }
- string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
- totalParsedInputLength += parsedInput.length;
- }
- // don't parse if it's not a known token
- if (formatTokenFunctions[token]) {
- if (parsedInput) {
- getParsingFlags(config).empty = false;
- }
- else {
- getParsingFlags(config).unusedTokens.push(token);
- }
- addTimeToArrayFromToken(token, parsedInput, config);
- }
- else if (config._strict && !parsedInput) {
- getParsingFlags(config).unusedTokens.push(token);
- }
- }
-
- // add remaining unparsed input length to the string
- getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
- if (string.length > 0) {
- getParsingFlags(config).unusedInput.push(string);
- }
-
- // clear _12h flag if hour is <= 12
- if (config._a[HOUR] <= 12 &&
- getParsingFlags(config).bigHour === true &&
- config._a[HOUR] > 0) {
- getParsingFlags(config).bigHour = undefined;
- }
-
- getParsingFlags(config).parsedDateParts = config._a.slice(0);
- getParsingFlags(config).meridiem = config._meridiem;
- // handle meridiem
- config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
-
- configFromArray(config);
- checkOverflow(config);
-}
-
-
-function meridiemFixWrap (locale, hour, meridiem) {
- var isPm;
-
- if (meridiem == null) {
- // nothing to do
- return hour;
- }
- if (locale.meridiemHour != null) {
- return locale.meridiemHour(hour, meridiem);
- } else if (locale.isPM != null) {
- // Fallback
- isPm = locale.isPM(meridiem);
- if (isPm && hour < 12) {
- hour += 12;
- }
- if (!isPm && hour === 12) {
- hour = 0;
- }
- return hour;
- } else {
- // this is not supposed to happen
- return hour;
- }
-}
-
-// date from string and array of format strings
-function configFromStringAndArray(config) {
- var tempConfig,
- bestMoment,
-
- scoreToBeat,
- i,
- currentScore;
-
- if (config._f.length === 0) {
- getParsingFlags(config).invalidFormat = true;
- config._d = new Date(NaN);
- return;
- }
-
- for (i = 0; i < config._f.length; i++) {
- currentScore = 0;
- tempConfig = copyConfig({}, config);
- if (config._useUTC != null) {
- tempConfig._useUTC = config._useUTC;
- }
- tempConfig._f = config._f[i];
- configFromStringAndFormat(tempConfig);
-
- if (!isValid(tempConfig)) {
- continue;
- }
-
- // if there is any input that was not parsed add a penalty for that format
- currentScore += getParsingFlags(tempConfig).charsLeftOver;
-
- //or tokens
- currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
-
- getParsingFlags(tempConfig).score = currentScore;
-
- if (scoreToBeat == null || currentScore < scoreToBeat) {
- scoreToBeat = currentScore;
- bestMoment = tempConfig;
- }
- }
-
- extend(config, bestMoment || tempConfig);
-}
-
-function configFromObject(config) {
- if (config._d) {
- return;
- }
-
- var i = normalizeObjectUnits(config._i);
- config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
- return obj && parseInt(obj, 10);
- });
-
- configFromArray(config);
-}
-
-function createFromConfig (config) {
- var res = new Moment(checkOverflow(prepareConfig(config)));
- if (res._nextDay) {
- // Adding is smart enough around DST
- res.add(1, 'd');
- res._nextDay = undefined;
- }
-
- return res;
-}
-
-function prepareConfig (config) {
- var input = config._i,
- format = config._f;
-
- config._locale = config._locale || getLocale(config._l);
-
- if (input === null || (format === undefined && input === '')) {
- return createInvalid({nullInput: true});
- }
-
- if (typeof input === 'string') {
- config._i = input = config._locale.preparse(input);
- }
-
- if (isMoment(input)) {
- return new Moment(checkOverflow(input));
- } else if (isDate(input)) {
- config._d = input;
- } else if (isArray(format)) {
- configFromStringAndArray(config);
- } else if (format) {
- configFromStringAndFormat(config);
- } else {
- configFromInput(config);
- }
-
- if (!isValid(config)) {
- config._d = null;
- }
-
- return config;
-}
-
-function configFromInput(config) {
- var input = config._i;
- if (isUndefined(input)) {
- config._d = new Date(hooks.now());
- } else if (isDate(input)) {
- config._d = new Date(input.valueOf());
- } else if (typeof input === 'string') {
- configFromString(config);
- } else if (isArray(input)) {
- config._a = map(input.slice(0), function (obj) {
- return parseInt(obj, 10);
- });
- configFromArray(config);
- } else if (isObject(input)) {
- configFromObject(config);
- } else if (isNumber(input)) {
- // from milliseconds
- config._d = new Date(input);
- } else {
- hooks.createFromInputFallback(config);
- }
-}
-
-function createLocalOrUTC (input, format, locale, strict, isUTC) {
- var c = {};
-
- if (locale === true || locale === false) {
- strict = locale;
- locale = undefined;
- }
-
- if ((isObject(input) && isObjectEmpty(input)) ||
- (isArray(input) && input.length === 0)) {
- input = undefined;
- }
- // object construction must be done this way.
- // https://github.com/moment/moment/issues/1423
- c._isAMomentObject = true;
- c._useUTC = c._isUTC = isUTC;
- c._l = locale;
- c._i = input;
- c._f = format;
- c._strict = strict;
-
- return createFromConfig(c);
-}
-
-function createLocal (input, format, locale, strict) {
- return createLocalOrUTC(input, format, locale, strict, false);
-}
-
-var prototypeMin = deprecate(
- 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
- function () {
- var other = createLocal.apply(null, arguments);
- if (this.isValid() && other.isValid()) {
- return other < this ? this : other;
- } else {
- return createInvalid();
- }
- }
-);
-
-var prototypeMax = deprecate(
- 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
- function () {
- var other = createLocal.apply(null, arguments);
- if (this.isValid() && other.isValid()) {
- return other > this ? this : other;
- } else {
- return createInvalid();
- }
- }
-);
-
-// Pick a moment m from moments so that m[fn](other) is true for all
-// other. This relies on the function fn to be transitive.
-//
-// moments should either be an array of moment objects or an array, whose
-// first element is an array of moment objects.
-function pickBy(fn, moments) {
- var res, i;
- if (moments.length === 1 && isArray(moments[0])) {
- moments = moments[0];
- }
- if (!moments.length) {
- return createLocal();
- }
- res = moments[0];
- for (i = 1; i < moments.length; ++i) {
- if (!moments[i].isValid() || moments[i][fn](res)) {
- res = moments[i];
- }
- }
- return res;
-}
-
-// TODO: Use [].sort instead?
-function min () {
- var args = [].slice.call(arguments, 0);
-
- return pickBy('isBefore', args);
-}
-
-function max () {
- var args = [].slice.call(arguments, 0);
-
- return pickBy('isAfter', args);
-}
-
-var now = function () {
- return Date.now ? Date.now() : +(new Date());
-};
-
-var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];
-
-function isDurationValid(m) {
- for (var key in m) {
- if (!(ordering.indexOf(key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
- return false;
- }
- }
-
- var unitHasDecimal = false;
- for (var i = 0; i < ordering.length; ++i) {
- if (m[ordering[i]]) {
- if (unitHasDecimal) {
- return false; // only allow non-integers for smallest unit
- }
- if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
- unitHasDecimal = true;
- }
- }
- }
-
- return true;
-}
-
-function isValid$1() {
- return this._isValid;
-}
-
-function createInvalid$1() {
- return createDuration(NaN);
-}
-
-function Duration (duration) {
- var normalizedInput = normalizeObjectUnits(duration),
- years = normalizedInput.year || 0,
- quarters = normalizedInput.quarter || 0,
- months = normalizedInput.month || 0,
- weeks = normalizedInput.week || 0,
- days = normalizedInput.day || 0,
- hours = normalizedInput.hour || 0,
- minutes = normalizedInput.minute || 0,
- seconds = normalizedInput.second || 0,
- milliseconds = normalizedInput.millisecond || 0;
-
- this._isValid = isDurationValid(normalizedInput);
-
- // representation for dateAddRemove
- this._milliseconds = +milliseconds +
- seconds * 1e3 + // 1000
- minutes * 6e4 + // 1000 * 60
- hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
- // Because of dateAddRemove treats 24 hours as different from a
- // day when working around DST, we need to store them separately
- this._days = +days +
- weeks * 7;
- // It is impossible translate months into days without knowing
- // which months you are are talking about, so we have to store
- // it separately.
- this._months = +months +
- quarters * 3 +
- years * 12;
-
- this._data = {};
-
- this._locale = getLocale();
-
- this._bubble();
-}
-
-function isDuration (obj) {
- return obj instanceof Duration;
-}
-
-function absRound (number) {
- if (number < 0) {
- return Math.round(-1 * number) * -1;
- } else {
- return Math.round(number);
- }
-}
-
-// FORMATTING
-
-function offset (token, separator) {
- addFormatToken(token, 0, 0, function () {
- var offset = this.utcOffset();
- var sign = '+';
- if (offset < 0) {
- offset = -offset;
- sign = '-';
- }
- return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
- });
-}
-
-offset('Z', ':');
-offset('ZZ', '');
-
-// PARSING
-
-addRegexToken('Z', matchShortOffset);
-addRegexToken('ZZ', matchShortOffset);
-addParseToken(['Z', 'ZZ'], function (input, array, config) {
- config._useUTC = true;
- config._tzm = offsetFromString(matchShortOffset, input);
-});
-
-// HELPERS
-
-// timezone chunker
-// '+10:00' > ['10', '00']
-// '-1530' > ['-15', '30']
-var chunkOffset = /([\+\-]|\d\d)/gi;
-
-function offsetFromString(matcher, string) {
- var matches = (string || '').match(matcher);
-
- if (matches === null) {
- return null;
- }
-
- var chunk = matches[matches.length - 1] || [];
- var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
- var minutes = +(parts[1] * 60) + toInt(parts[2]);
-
- return minutes === 0 ?
- 0 :
- parts[0] === '+' ? minutes : -minutes;
-}
-
-// Return a moment from input, that is local/utc/zone equivalent to model.
-function cloneWithOffset(input, model) {
- var res, diff;
- if (model._isUTC) {
- res = model.clone();
- diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
- // Use low-level api, because this fn is low-level api.
- res._d.setTime(res._d.valueOf() + diff);
- hooks.updateOffset(res, false);
- return res;
- } else {
- return createLocal(input).local();
- }
-}
-
-function getDateOffset (m) {
- // On Firefox.24 Date#getTimezoneOffset returns a floating point.
- // https://github.com/moment/moment/pull/1871
- return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
-}
-
-// HOOKS
-
-// This function will be called whenever a moment is mutated.
-// It is intended to keep the offset in sync with the timezone.
-hooks.updateOffset = function () {};
-
-// MOMENTS
-
-// keepLocalTime = true means only change the timezone, without
-// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
-// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
-// +0200, so we adjust the time as needed, to be valid.
-//
-// Keeping the time actually adds/subtracts (one hour)
-// from the actual represented time. That is why we call updateOffset
-// a second time. In case it wants us to change the offset again
-// _changeInProgress == true case, then we have to adjust, because
-// there is no such time in the given timezone.
-function getSetOffset (input, keepLocalTime, keepMinutes) {
- var offset = this._offset || 0,
- localAdjust;
- if (!this.isValid()) {
- return input != null ? this : NaN;
- }
- if (input != null) {
- if (typeof input === 'string') {
- input = offsetFromString(matchShortOffset, input);
- if (input === null) {
- return this;
- }
- } else if (Math.abs(input) < 16 && !keepMinutes) {
- input = input * 60;
- }
- if (!this._isUTC && keepLocalTime) {
- localAdjust = getDateOffset(this);
- }
- this._offset = input;
- this._isUTC = true;
- if (localAdjust != null) {
- this.add(localAdjust, 'm');
- }
- if (offset !== input) {
- if (!keepLocalTime || this._changeInProgress) {
- addSubtract(this, createDuration(input - offset, 'm'), 1, false);
- } else if (!this._changeInProgress) {
- this._changeInProgress = true;
- hooks.updateOffset(this, true);
- this._changeInProgress = null;
- }
- }
- return this;
- } else {
- return this._isUTC ? offset : getDateOffset(this);
- }
-}
-
-function getSetZone (input, keepLocalTime) {
- if (input != null) {
- if (typeof input !== 'string') {
- input = -input;
- }
-
- this.utcOffset(input, keepLocalTime);
-
- return this;
- } else {
- return -this.utcOffset();
- }
-}
-
-function setOffsetToUTC (keepLocalTime) {
- return this.utcOffset(0, keepLocalTime);
-}
-
-function setOffsetToLocal (keepLocalTime) {
- if (this._isUTC) {
- this.utcOffset(0, keepLocalTime);
- this._isUTC = false;
-
- if (keepLocalTime) {
- this.subtract(getDateOffset(this), 'm');
- }
- }
- return this;
-}
-
-function setOffsetToParsedOffset () {
- if (this._tzm != null) {
- this.utcOffset(this._tzm, false, true);
- } else if (typeof this._i === 'string') {
- var tZone = offsetFromString(matchOffset, this._i);
- if (tZone != null) {
- this.utcOffset(tZone);
- }
- else {
- this.utcOffset(0, true);
- }
- }
- return this;
-}
-
-function hasAlignedHourOffset (input) {
- if (!this.isValid()) {
- return false;
- }
- input = input ? createLocal(input).utcOffset() : 0;
-
- return (this.utcOffset() - input) % 60 === 0;
-}
-
-function isDaylightSavingTime () {
- return (
- this.utcOffset() > this.clone().month(0).utcOffset() ||
- this.utcOffset() > this.clone().month(5).utcOffset()
- );
-}
-
-function isDaylightSavingTimeShifted () {
- if (!isUndefined(this._isDSTShifted)) {
- return this._isDSTShifted;
- }
-
- var c = {};
-
- copyConfig(c, this);
- c = prepareConfig(c);
-
- if (c._a) {
- var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
- this._isDSTShifted = this.isValid() &&
- compareArrays(c._a, other.toArray()) > 0;
- } else {
- this._isDSTShifted = false;
- }
-
- return this._isDSTShifted;
-}
-
-function isLocal () {
- return this.isValid() ? !this._isUTC : false;
-}
-
-function isUtcOffset () {
- return this.isValid() ? this._isUTC : false;
-}
-
-function isUtc () {
- return this.isValid() ? this._isUTC && this._offset === 0 : false;
-}
-
-// ASP.NET json date format regex
-var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
-
-// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
-// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
-// and further modified to allow for strings containing both week and day
-var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;
-
-function createDuration (input, key) {
- var duration = input,
- // matching against regexp is expensive, do it on demand
- match = null,
- sign,
- ret,
- diffRes;
-
- if (isDuration(input)) {
- duration = {
- ms : input._milliseconds,
- d : input._days,
- M : input._months
- };
- } else if (isNumber(input)) {
- duration = {};
- if (key) {
- duration[key] = input;
- } else {
- duration.milliseconds = input;
- }
- } else if (!!(match = aspNetRegex.exec(input))) {
- sign = (match[1] === '-') ? -1 : 1;
- duration = {
- y : 0,
- d : toInt(match[DATE]) * sign,
- h : toInt(match[HOUR]) * sign,
- m : toInt(match[MINUTE]) * sign,
- s : toInt(match[SECOND]) * sign,
- ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
- };
- } else if (!!(match = isoRegex.exec(input))) {
- sign = (match[1] === '-') ? -1 : 1;
- duration = {
- y : parseIso(match[2], sign),
- M : parseIso(match[3], sign),
- w : parseIso(match[4], sign),
- d : parseIso(match[5], sign),
- h : parseIso(match[6], sign),
- m : parseIso(match[7], sign),
- s : parseIso(match[8], sign)
- };
- } else if (duration == null) {// checks for null or undefined
- duration = {};
- } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
- diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
-
- duration = {};
- duration.ms = diffRes.milliseconds;
- duration.M = diffRes.months;
- }
-
- ret = new Duration(duration);
-
- if (isDuration(input) && hasOwnProp(input, '_locale')) {
- ret._locale = input._locale;
- }
-
- return ret;
-}
-
-createDuration.fn = Duration.prototype;
-createDuration.invalid = createInvalid$1;
-
-function parseIso (inp, sign) {
- // We'd normally use ~~inp for this, but unfortunately it also
- // converts floats to ints.
- // inp may be undefined, so careful calling replace on it.
- var res = inp && parseFloat(inp.replace(',', '.'));
- // apply sign while we're at it
- return (isNaN(res) ? 0 : res) * sign;
-}
-
-function positiveMomentsDifference(base, other) {
- var res = {milliseconds: 0, months: 0};
-
- res.months = other.month() - base.month() +
- (other.year() - base.year()) * 12;
- if (base.clone().add(res.months, 'M').isAfter(other)) {
- --res.months;
- }
-
- res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
-
- return res;
-}
-
-function momentsDifference(base, other) {
- var res;
- if (!(base.isValid() && other.isValid())) {
- return {milliseconds: 0, months: 0};
- }
-
- other = cloneWithOffset(other, base);
- if (base.isBefore(other)) {
- res = positiveMomentsDifference(base, other);
- } else {
- res = positiveMomentsDifference(other, base);
- res.milliseconds = -res.milliseconds;
- res.months = -res.months;
- }
-
- return res;
-}
-
-// TODO: remove 'name' arg after deprecation is removed
-function createAdder(direction, name) {
- return function (val, period) {
- var dur, tmp;
- //invert the arguments, but complain about it
- if (period !== null && !isNaN(+period)) {
- deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
- 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
- tmp = val; val = period; period = tmp;
- }
-
- val = typeof val === 'string' ? +val : val;
- dur = createDuration(val, period);
- addSubtract(this, dur, direction);
- return this;
- };
-}
-
-function addSubtract (mom, duration, isAdding, updateOffset) {
- var milliseconds = duration._milliseconds,
- days = absRound(duration._days),
- months = absRound(duration._months);
-
- if (!mom.isValid()) {
- // No op
- return;
- }
-
- updateOffset = updateOffset == null ? true : updateOffset;
-
- if (milliseconds) {
- mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
- }
- if (days) {
- set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
- }
- if (months) {
- setMonth(mom, get(mom, 'Month') + months * isAdding);
- }
- if (updateOffset) {
- hooks.updateOffset(mom, days || months);
- }
-}
-
-var add = createAdder(1, 'add');
-var subtract = createAdder(-1, 'subtract');
-
-function getCalendarFormat(myMoment, now) {
- var diff = myMoment.diff(now, 'days', true);
- return diff < -6 ? 'sameElse' :
- diff < -1 ? 'lastWeek' :
- diff < 0 ? 'lastDay' :
- diff < 1 ? 'sameDay' :
- diff < 2 ? 'nextDay' :
- diff < 7 ? 'nextWeek' : 'sameElse';
-}
-
-function calendar$1 (time, formats) {
- // We want to compare the start of today, vs this.
- // Getting start-of-today depends on whether we're local/utc/offset or not.
- var now = time || createLocal(),
- sod = cloneWithOffset(now, this).startOf('day'),
- format = hooks.calendarFormat(this, sod) || 'sameElse';
-
- var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
-
- return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
-}
-
-function clone () {
- return new Moment(this);
-}
-
-function isAfter (input, units) {
- var localInput = isMoment(input) ? input : createLocal(input);
- if (!(this.isValid() && localInput.isValid())) {
- return false;
- }
- units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
- if (units === 'millisecond') {
- return this.valueOf() > localInput.valueOf();
- } else {
- return localInput.valueOf() < this.clone().startOf(units).valueOf();
- }
-}
-
-function isBefore (input, units) {
- var localInput = isMoment(input) ? input : createLocal(input);
- if (!(this.isValid() && localInput.isValid())) {
- return false;
- }
- units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
- if (units === 'millisecond') {
- return this.valueOf() < localInput.valueOf();
- } else {
- return this.clone().endOf(units).valueOf() < localInput.valueOf();
- }
-}
-
-function isBetween (from, to, units, inclusivity) {
- inclusivity = inclusivity || '()';
- return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&
- (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
-}
-
-function isSame (input, units) {
- var localInput = isMoment(input) ? input : createLocal(input),
- inputMs;
- if (!(this.isValid() && localInput.isValid())) {
- return false;
- }
- units = normalizeUnits(units || 'millisecond');
- if (units === 'millisecond') {
- return this.valueOf() === localInput.valueOf();
- } else {
- inputMs = localInput.valueOf();
- return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
- }
-}
-
-function isSameOrAfter (input, units) {
- return this.isSame(input, units) || this.isAfter(input,units);
-}
-
-function isSameOrBefore (input, units) {
- return this.isSame(input, units) || this.isBefore(input,units);
-}
-
-function diff (input, units, asFloat) {
- var that,
- zoneDelta,
- delta, output;
-
- if (!this.isValid()) {
- return NaN;
- }
-
- that = cloneWithOffset(input, this);
-
- if (!that.isValid()) {
- return NaN;
- }
-
- zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
-
- units = normalizeUnits(units);
-
- if (units === 'year' || units === 'month' || units === 'quarter') {
- output = monthDiff(this, that);
- if (units === 'quarter') {
- output = output / 3;
- } else if (units === 'year') {
- output = output / 12;
- }
- } else {
- delta = this - that;
- output = units === 'second' ? delta / 1e3 : // 1000
- units === 'minute' ? delta / 6e4 : // 1000 * 60
- units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
- units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
- units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
- delta;
- }
- return asFloat ? output : absFloor(output);
-}
-
-function monthDiff (a, b) {
- // difference in months
- var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
- // b is in (anchor - 1 month, anchor + 1 month)
- anchor = a.clone().add(wholeMonthDiff, 'months'),
- anchor2, adjust;
-
- if (b - anchor < 0) {
- anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
- // linear across the month
- adjust = (b - anchor) / (anchor - anchor2);
- } else {
- anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
- // linear across the month
- adjust = (b - anchor) / (anchor2 - anchor);
- }
-
- //check for negative zero, return zero if negative zero
- return -(wholeMonthDiff + adjust) || 0;
-}
-
-hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
-hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
-
-function toString () {
- return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
-}
-
-function toISOString() {
- if (!this.isValid()) {
- return null;
- }
- var m = this.clone().utc();
- if (m.year() < 0 || m.year() > 9999) {
- return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
- }
- if (isFunction(Date.prototype.toISOString)) {
- // native implementation is ~50x faster, use it when we can
- return this.toDate().toISOString();
- }
- return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
-}
-
-/**
- * Return a human readable representation of a moment that can
- * also be evaluated to get a new moment which is the same
- *
- * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
- */
-function inspect () {
- if (!this.isValid()) {
- return 'moment.invalid(/* ' + this._i + ' */)';
- }
- var func = 'moment';
- var zone = '';
- if (!this.isLocal()) {
- func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
- zone = 'Z';
- }
- var prefix = '[' + func + '("]';
- var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';
- var datetime = '-MM-DD[T]HH:mm:ss.SSS';
- var suffix = zone + '[")]';
-
- return this.format(prefix + year + datetime + suffix);
-}
-
-function format (inputString) {
- if (!inputString) {
- inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
- }
- var output = formatMoment(this, inputString);
- return this.localeData().postformat(output);
-}
-
-function from (time, withoutSuffix) {
- if (this.isValid() &&
- ((isMoment(time) && time.isValid()) ||
- createLocal(time).isValid())) {
- return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
- } else {
- return this.localeData().invalidDate();
- }
-}
-
-function fromNow (withoutSuffix) {
- return this.from(createLocal(), withoutSuffix);
-}
-
-function to (time, withoutSuffix) {
- if (this.isValid() &&
- ((isMoment(time) && time.isValid()) ||
- createLocal(time).isValid())) {
- return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
- } else {
- return this.localeData().invalidDate();
- }
-}
-
-function toNow (withoutSuffix) {
- return this.to(createLocal(), withoutSuffix);
-}
-
-// If passed a locale key, it will set the locale for this
-// instance. Otherwise, it will return the locale configuration
-// variables for this instance.
-function locale (key) {
- var newLocaleData;
-
- if (key === undefined) {
- return this._locale._abbr;
- } else {
- newLocaleData = getLocale(key);
- if (newLocaleData != null) {
- this._locale = newLocaleData;
- }
- return this;
- }
-}
-
-var lang = deprecate(
- 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
- function (key) {
- if (key === undefined) {
- return this.localeData();
- } else {
- return this.locale(key);
- }
- }
-);
-
-function localeData () {
- return this._locale;
-}
-
-function startOf (units) {
- units = normalizeUnits(units);
- // the following switch intentionally omits break keywords
- // to utilize falling through the cases.
- switch (units) {
- case 'year':
- this.month(0);
- /* falls through */
- case 'quarter':
- case 'month':
- this.date(1);
- /* falls through */
- case 'week':
- case 'isoWeek':
- case 'day':
- case 'date':
- this.hours(0);
- /* falls through */
- case 'hour':
- this.minutes(0);
- /* falls through */
- case 'minute':
- this.seconds(0);
- /* falls through */
- case 'second':
- this.milliseconds(0);
- }
-
- // weeks are a special case
- if (units === 'week') {
- this.weekday(0);
- }
- if (units === 'isoWeek') {
- this.isoWeekday(1);
- }
-
- // quarters are also special
- if (units === 'quarter') {
- this.month(Math.floor(this.month() / 3) * 3);
- }
-
- return this;
-}
-
-function endOf (units) {
- units = normalizeUnits(units);
- if (units === undefined || units === 'millisecond') {
- return this;
- }
-
- // 'date' is an alias for 'day', so it should be considered as such.
- if (units === 'date') {
- units = 'day';
- }
-
- return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
-}
-
-function valueOf () {
- return this._d.valueOf() - ((this._offset || 0) * 60000);
-}
-
-function unix () {
- return Math.floor(this.valueOf() / 1000);
-}
-
-function toDate () {
- return new Date(this.valueOf());
-}
-
-function toArray () {
- var m = this;
- return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
-}
-
-function toObject () {
- var m = this;
- return {
- years: m.year(),
- months: m.month(),
- date: m.date(),
- hours: m.hours(),
- minutes: m.minutes(),
- seconds: m.seconds(),
- milliseconds: m.milliseconds()
- };
-}
-
-function toJSON () {
- // new Date(NaN).toJSON() === null
- return this.isValid() ? this.toISOString() : null;
-}
-
-function isValid$2 () {
- return isValid(this);
-}
-
-function parsingFlags () {
- return extend({}, getParsingFlags(this));
-}
-
-function invalidAt () {
- return getParsingFlags(this).overflow;
-}
-
-function creationData() {
- return {
- input: this._i,
- format: this._f,
- locale: this._locale,
- isUTC: this._isUTC,
- strict: this._strict
- };
-}
-
-// FORMATTING
-
-addFormatToken(0, ['gg', 2], 0, function () {
- return this.weekYear() % 100;
-});
-
-addFormatToken(0, ['GG', 2], 0, function () {
- return this.isoWeekYear() % 100;
-});
-
-function addWeekYearFormatToken (token, getter) {
- addFormatToken(0, [token, token.length], 0, getter);
-}
-
-addWeekYearFormatToken('gggg', 'weekYear');
-addWeekYearFormatToken('ggggg', 'weekYear');
-addWeekYearFormatToken('GGGG', 'isoWeekYear');
-addWeekYearFormatToken('GGGGG', 'isoWeekYear');
-
-// ALIASES
-
-addUnitAlias('weekYear', 'gg');
-addUnitAlias('isoWeekYear', 'GG');
-
-// PRIORITY
-
-addUnitPriority('weekYear', 1);
-addUnitPriority('isoWeekYear', 1);
-
-
-// PARSING
-
-addRegexToken('G', matchSigned);
-addRegexToken('g', matchSigned);
-addRegexToken('GG', match1to2, match2);
-addRegexToken('gg', match1to2, match2);
-addRegexToken('GGGG', match1to4, match4);
-addRegexToken('gggg', match1to4, match4);
-addRegexToken('GGGGG', match1to6, match6);
-addRegexToken('ggggg', match1to6, match6);
-
-addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
- week[token.substr(0, 2)] = toInt(input);
-});
-
-addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
- week[token] = hooks.parseTwoDigitYear(input);
-});
-
-// MOMENTS
-
-function getSetWeekYear (input) {
- return getSetWeekYearHelper.call(this,
- input,
- this.week(),
- this.weekday(),
- this.localeData()._week.dow,
- this.localeData()._week.doy);
-}
-
-function getSetISOWeekYear (input) {
- return getSetWeekYearHelper.call(this,
- input, this.isoWeek(), this.isoWeekday(), 1, 4);
-}
-
-function getISOWeeksInYear () {
- return weeksInYear(this.year(), 1, 4);
-}
-
-function getWeeksInYear () {
- var weekInfo = this.localeData()._week;
- return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
-}
-
-function getSetWeekYearHelper(input, week, weekday, dow, doy) {
- var weeksTarget;
- if (input == null) {
- return weekOfYear(this, dow, doy).year;
- } else {
- weeksTarget = weeksInYear(input, dow, doy);
- if (week > weeksTarget) {
- week = weeksTarget;
- }
- return setWeekAll.call(this, input, week, weekday, dow, doy);
- }
-}
-
-function setWeekAll(weekYear, week, weekday, dow, doy) {
- var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
- date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
-
- this.year(date.getUTCFullYear());
- this.month(date.getUTCMonth());
- this.date(date.getUTCDate());
- return this;
-}
-
-// FORMATTING
-
-addFormatToken('Q', 0, 'Qo', 'quarter');
-
-// ALIASES
-
-addUnitAlias('quarter', 'Q');
-
-// PRIORITY
-
-addUnitPriority('quarter', 7);
-
-// PARSING
-
-addRegexToken('Q', match1);
-addParseToken('Q', function (input, array) {
- array[MONTH] = (toInt(input) - 1) * 3;
-});
-
-// MOMENTS
-
-function getSetQuarter (input) {
- return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
-}
-
-// FORMATTING
-
-addFormatToken('D', ['DD', 2], 'Do', 'date');
-
-// ALIASES
-
-addUnitAlias('date', 'D');
-
-// PRIOROITY
-addUnitPriority('date', 9);
-
-// PARSING
-
-addRegexToken('D', match1to2);
-addRegexToken('DD', match1to2, match2);
-addRegexToken('Do', function (isStrict, locale) {
- // TODO: Remove "ordinalParse" fallback in next major release.
- return isStrict ?
- (locale._dayOfMonthOrdinalParse || locale._ordinalParse) :
- locale._dayOfMonthOrdinalParseLenient;
-});
-
-addParseToken(['D', 'DD'], DATE);
-addParseToken('Do', function (input, array) {
- array[DATE] = toInt(input.match(match1to2)[0], 10);
-});
-
-// MOMENTS
-
-var getSetDayOfMonth = makeGetSet('Date', true);
-
-// FORMATTING
-
-addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
-
-// ALIASES
-
-addUnitAlias('dayOfYear', 'DDD');
-
-// PRIORITY
-addUnitPriority('dayOfYear', 4);
-
-// PARSING
-
-addRegexToken('DDD', match1to3);
-addRegexToken('DDDD', match3);
-addParseToken(['DDD', 'DDDD'], function (input, array, config) {
- config._dayOfYear = toInt(input);
-});
-
-// HELPERS
-
-// MOMENTS
-
-function getSetDayOfYear (input) {
- var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
- return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
-}
-
-// FORMATTING
-
-addFormatToken('m', ['mm', 2], 0, 'minute');
-
-// ALIASES
-
-addUnitAlias('minute', 'm');
-
-// PRIORITY
-
-addUnitPriority('minute', 14);
-
-// PARSING
-
-addRegexToken('m', match1to2);
-addRegexToken('mm', match1to2, match2);
-addParseToken(['m', 'mm'], MINUTE);
-
-// MOMENTS
-
-var getSetMinute = makeGetSet('Minutes', false);
-
-// FORMATTING
-
-addFormatToken('s', ['ss', 2], 0, 'second');
-
-// ALIASES
-
-addUnitAlias('second', 's');
-
-// PRIORITY
-
-addUnitPriority('second', 15);
-
-// PARSING
-
-addRegexToken('s', match1to2);
-addRegexToken('ss', match1to2, match2);
-addParseToken(['s', 'ss'], SECOND);
-
-// MOMENTS
-
-var getSetSecond = makeGetSet('Seconds', false);
-
-// FORMATTING
-
-addFormatToken('S', 0, 0, function () {
- return ~~(this.millisecond() / 100);
-});
-
-addFormatToken(0, ['SS', 2], 0, function () {
- return ~~(this.millisecond() / 10);
-});
-
-addFormatToken(0, ['SSS', 3], 0, 'millisecond');
-addFormatToken(0, ['SSSS', 4], 0, function () {
- return this.millisecond() * 10;
-});
-addFormatToken(0, ['SSSSS', 5], 0, function () {
- return this.millisecond() * 100;
-});
-addFormatToken(0, ['SSSSSS', 6], 0, function () {
- return this.millisecond() * 1000;
-});
-addFormatToken(0, ['SSSSSSS', 7], 0, function () {
- return this.millisecond() * 10000;
-});
-addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
- return this.millisecond() * 100000;
-});
-addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
- return this.millisecond() * 1000000;
-});
-
-
-// ALIASES
-
-addUnitAlias('millisecond', 'ms');
-
-// PRIORITY
-
-addUnitPriority('millisecond', 16);
-
-// PARSING
-
-addRegexToken('S', match1to3, match1);
-addRegexToken('SS', match1to3, match2);
-addRegexToken('SSS', match1to3, match3);
-
-var token;
-for (token = 'SSSS'; token.length <= 9; token += 'S') {
- addRegexToken(token, matchUnsigned);
-}
-
-function parseMs(input, array) {
- array[MILLISECOND] = toInt(('0.' + input) * 1000);
-}
-
-for (token = 'S'; token.length <= 9; token += 'S') {
- addParseToken(token, parseMs);
-}
-// MOMENTS
-
-var getSetMillisecond = makeGetSet('Milliseconds', false);
-
-// FORMATTING
-
-addFormatToken('z', 0, 0, 'zoneAbbr');
-addFormatToken('zz', 0, 0, 'zoneName');
-
-// MOMENTS
-
-function getZoneAbbr () {
- return this._isUTC ? 'UTC' : '';
-}
-
-function getZoneName () {
- return this._isUTC ? 'Coordinated Universal Time' : '';
-}
-
-var proto = Moment.prototype;
-
-proto.add = add;
-proto.calendar = calendar$1;
-proto.clone = clone;
-proto.diff = diff;
-proto.endOf = endOf;
-proto.format = format;
-proto.from = from;
-proto.fromNow = fromNow;
-proto.to = to;
-proto.toNow = toNow;
-proto.get = stringGet;
-proto.invalidAt = invalidAt;
-proto.isAfter = isAfter;
-proto.isBefore = isBefore;
-proto.isBetween = isBetween;
-proto.isSame = isSame;
-proto.isSameOrAfter = isSameOrAfter;
-proto.isSameOrBefore = isSameOrBefore;
-proto.isValid = isValid$2;
-proto.lang = lang;
-proto.locale = locale;
-proto.localeData = localeData;
-proto.max = prototypeMax;
-proto.min = prototypeMin;
-proto.parsingFlags = parsingFlags;
-proto.set = stringSet;
-proto.startOf = startOf;
-proto.subtract = subtract;
-proto.toArray = toArray;
-proto.toObject = toObject;
-proto.toDate = toDate;
-proto.toISOString = toISOString;
-proto.inspect = inspect;
-proto.toJSON = toJSON;
-proto.toString = toString;
-proto.unix = unix;
-proto.valueOf = valueOf;
-proto.creationData = creationData;
-
-// Year
-proto.year = getSetYear;
-proto.isLeapYear = getIsLeapYear;
-
-// Week Year
-proto.weekYear = getSetWeekYear;
-proto.isoWeekYear = getSetISOWeekYear;
-
-// Quarter
-proto.quarter = proto.quarters = getSetQuarter;
-
-// Month
-proto.month = getSetMonth;
-proto.daysInMonth = getDaysInMonth;
-
-// Week
-proto.week = proto.weeks = getSetWeek;
-proto.isoWeek = proto.isoWeeks = getSetISOWeek;
-proto.weeksInYear = getWeeksInYear;
-proto.isoWeeksInYear = getISOWeeksInYear;
-
-// Day
-proto.date = getSetDayOfMonth;
-proto.day = proto.days = getSetDayOfWeek;
-proto.weekday = getSetLocaleDayOfWeek;
-proto.isoWeekday = getSetISODayOfWeek;
-proto.dayOfYear = getSetDayOfYear;
-
-// Hour
-proto.hour = proto.hours = getSetHour;
-
-// Minute
-proto.minute = proto.minutes = getSetMinute;
-
-// Second
-proto.second = proto.seconds = getSetSecond;
-
-// Millisecond
-proto.millisecond = proto.milliseconds = getSetMillisecond;
-
-// Offset
-proto.utcOffset = getSetOffset;
-proto.utc = setOffsetToUTC;
-proto.local = setOffsetToLocal;
-proto.parseZone = setOffsetToParsedOffset;
-proto.hasAlignedHourOffset = hasAlignedHourOffset;
-proto.isDST = isDaylightSavingTime;
-proto.isLocal = isLocal;
-proto.isUtcOffset = isUtcOffset;
-proto.isUtc = isUtc;
-proto.isUTC = isUtc;
-
-// Timezone
-proto.zoneAbbr = getZoneAbbr;
-proto.zoneName = getZoneName;
-
-// Deprecations
-proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
-proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
-proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
-proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
-proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
-
-function createUnix (input) {
- return createLocal(input * 1000);
-}
-
-function createInZone () {
- return createLocal.apply(null, arguments).parseZone();
-}
-
-function preParsePostFormat (string) {
- return string;
-}
-
-var proto$1 = Locale.prototype;
-
-proto$1.calendar = calendar;
-proto$1.longDateFormat = longDateFormat;
-proto$1.invalidDate = invalidDate;
-proto$1.ordinal = ordinal;
-proto$1.preparse = preParsePostFormat;
-proto$1.postformat = preParsePostFormat;
-proto$1.relativeTime = relativeTime;
-proto$1.pastFuture = pastFuture;
-proto$1.set = set;
-
-// Month
-proto$1.months = localeMonths;
-proto$1.monthsShort = localeMonthsShort;
-proto$1.monthsParse = localeMonthsParse;
-proto$1.monthsRegex = monthsRegex;
-proto$1.monthsShortRegex = monthsShortRegex;
-
-// Week
-proto$1.week = localeWeek;
-proto$1.firstDayOfYear = localeFirstDayOfYear;
-proto$1.firstDayOfWeek = localeFirstDayOfWeek;
-
-// Day of Week
-proto$1.weekdays = localeWeekdays;
-proto$1.weekdaysMin = localeWeekdaysMin;
-proto$1.weekdaysShort = localeWeekdaysShort;
-proto$1.weekdaysParse = localeWeekdaysParse;
-
-proto$1.weekdaysRegex = weekdaysRegex;
-proto$1.weekdaysShortRegex = weekdaysShortRegex;
-proto$1.weekdaysMinRegex = weekdaysMinRegex;
-
-// Hours
-proto$1.isPM = localeIsPM;
-proto$1.meridiem = localeMeridiem;
-
-function get$1 (format, index, field, setter) {
- var locale = getLocale();
- var utc = createUTC().set(setter, index);
- return locale[field](utc, format);
-}
-
-function listMonthsImpl (format, index, field) {
- if (isNumber(format)) {
- index = format;
- format = undefined;
- }
-
- format = format || '';
-
- if (index != null) {
- return get$1(format, index, field, 'month');
- }
-
- var i;
- var out = [];
- for (i = 0; i < 12; i++) {
- out[i] = get$1(format, i, field, 'month');
- }
- return out;
-}
-
-// ()
-// (5)
-// (fmt, 5)
-// (fmt)
-// (true)
-// (true, 5)
-// (true, fmt, 5)
-// (true, fmt)
-function listWeekdaysImpl (localeSorted, format, index, field) {
- if (typeof localeSorted === 'boolean') {
- if (isNumber(format)) {
- index = format;
- format = undefined;
- }
-
- format = format || '';
- } else {
- format = localeSorted;
- index = format;
- localeSorted = false;
-
- if (isNumber(format)) {
- index = format;
- format = undefined;
- }
-
- format = format || '';
- }
-
- var locale = getLocale(),
- shift = localeSorted ? locale._week.dow : 0;
-
- if (index != null) {
- return get$1(format, (index + shift) % 7, field, 'day');
- }
-
- var i;
- var out = [];
- for (i = 0; i < 7; i++) {
- out[i] = get$1(format, (i + shift) % 7, field, 'day');
- }
- return out;
-}
-
-function listMonths (format, index) {
- return listMonthsImpl(format, index, 'months');
-}
-
-function listMonthsShort (format, index) {
- return listMonthsImpl(format, index, 'monthsShort');
-}
-
-function listWeekdays (localeSorted, format, index) {
- return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
-}
-
-function listWeekdaysShort (localeSorted, format, index) {
- return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
-}
-
-function listWeekdaysMin (localeSorted, format, index) {
- return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
-}
-
-getSetGlobalLocale('en', {
- dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
- ordinal : function (number) {
- var b = number % 10,
- output = (toInt(number % 100 / 10) === 1) ? 'th' :
- (b === 1) ? 'st' :
- (b === 2) ? 'nd' :
- (b === 3) ? 'rd' : 'th';
- return number + output;
- }
-});
-
-// Side effect imports
-hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
-hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
-
-var mathAbs = Math.abs;
-
-function abs () {
- var data = this._data;
-
- this._milliseconds = mathAbs(this._milliseconds);
- this._days = mathAbs(this._days);
- this._months = mathAbs(this._months);
-
- data.milliseconds = mathAbs(data.milliseconds);
- data.seconds = mathAbs(data.seconds);
- data.minutes = mathAbs(data.minutes);
- data.hours = mathAbs(data.hours);
- data.months = mathAbs(data.months);
- data.years = mathAbs(data.years);
-
- return this;
-}
-
-function addSubtract$1 (duration, input, value, direction) {
- var other = createDuration(input, value);
-
- duration._milliseconds += direction * other._milliseconds;
- duration._days += direction * other._days;
- duration._months += direction * other._months;
-
- return duration._bubble();
-}
-
-// supports only 2.0-style add(1, 's') or add(duration)
-function add$1 (input, value) {
- return addSubtract$1(this, input, value, 1);
-}
-
-// supports only 2.0-style subtract(1, 's') or subtract(duration)
-function subtract$1 (input, value) {
- return addSubtract$1(this, input, value, -1);
-}
-
-function absCeil (number) {
- if (number < 0) {
- return Math.floor(number);
- } else {
- return Math.ceil(number);
- }
-}
-
-function bubble () {
- var milliseconds = this._milliseconds;
- var days = this._days;
- var months = this._months;
- var data = this._data;
- var seconds, minutes, hours, years, monthsFromDays;
-
- // if we have a mix of positive and negative values, bubble down first
- // check: https://github.com/moment/moment/issues/2166
- if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
- (milliseconds <= 0 && days <= 0 && months <= 0))) {
- milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
- days = 0;
- months = 0;
- }
-
- // The following code bubbles up values, see the tests for
- // examples of what that means.
- data.milliseconds = milliseconds % 1000;
-
- seconds = absFloor(milliseconds / 1000);
- data.seconds = seconds % 60;
-
- minutes = absFloor(seconds / 60);
- data.minutes = minutes % 60;
-
- hours = absFloor(minutes / 60);
- data.hours = hours % 24;
-
- days += absFloor(hours / 24);
-
- // convert days to months
- monthsFromDays = absFloor(daysToMonths(days));
- months += monthsFromDays;
- days -= absCeil(monthsToDays(monthsFromDays));
-
- // 12 months -> 1 year
- years = absFloor(months / 12);
- months %= 12;
-
- data.days = days;
- data.months = months;
- data.years = years;
-
- return this;
-}
-
-function daysToMonths (days) {
- // 400 years have 146097 days (taking into account leap year rules)
- // 400 years have 12 months === 4800
- return days * 4800 / 146097;
-}
-
-function monthsToDays (months) {
- // the reverse of daysToMonths
- return months * 146097 / 4800;
-}
-
-function as (units) {
- if (!this.isValid()) {
- return NaN;
- }
- var days;
- var months;
- var milliseconds = this._milliseconds;
-
- units = normalizeUnits(units);
-
- if (units === 'month' || units === 'year') {
- days = this._days + milliseconds / 864e5;
- months = this._months + daysToMonths(days);
- return units === 'month' ? months : months / 12;
- } else {
- // handle milliseconds separately because of floating point math errors (issue #1867)
- days = this._days + Math.round(monthsToDays(this._months));
- switch (units) {
- case 'week' : return days / 7 + milliseconds / 6048e5;
- case 'day' : return days + milliseconds / 864e5;
- case 'hour' : return days * 24 + milliseconds / 36e5;
- case 'minute' : return days * 1440 + milliseconds / 6e4;
- case 'second' : return days * 86400 + milliseconds / 1000;
- // Math.floor prevents floating point math errors here
- case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
- default: throw new Error('Unknown unit ' + units);
- }
- }
-}
-
-// TODO: Use this.as('ms')?
-function valueOf$1 () {
- if (!this.isValid()) {
- return NaN;
- }
- return (
- this._milliseconds +
- this._days * 864e5 +
- (this._months % 12) * 2592e6 +
- toInt(this._months / 12) * 31536e6
- );
-}
-
-function makeAs (alias) {
- return function () {
- return this.as(alias);
- };
-}
-
-var asMilliseconds = makeAs('ms');
-var asSeconds = makeAs('s');
-var asMinutes = makeAs('m');
-var asHours = makeAs('h');
-var asDays = makeAs('d');
-var asWeeks = makeAs('w');
-var asMonths = makeAs('M');
-var asYears = makeAs('y');
-
-function get$2 (units) {
- units = normalizeUnits(units);
- return this.isValid() ? this[units + 's']() : NaN;
-}
-
-function makeGetter(name) {
- return function () {
- return this.isValid() ? this._data[name] : NaN;
- };
-}
-
-var milliseconds = makeGetter('milliseconds');
-var seconds = makeGetter('seconds');
-var minutes = makeGetter('minutes');
-var hours = makeGetter('hours');
-var days = makeGetter('days');
-var months = makeGetter('months');
-var years = makeGetter('years');
-
-function weeks () {
- return absFloor(this.days() / 7);
-}
-
-var round = Math.round;
-var thresholds = {
- ss: 44, // a few seconds to seconds
- s : 45, // seconds to minute
- m : 45, // minutes to hour
- h : 22, // hours to day
- d : 26, // days to month
- M : 11 // months to year
-};
-
-// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
-function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
- return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
-}
-
-function relativeTime$1 (posNegDuration, withoutSuffix, locale) {
- var duration = createDuration(posNegDuration).abs();
- var seconds = round(duration.as('s'));
- var minutes = round(duration.as('m'));
- var hours = round(duration.as('h'));
- var days = round(duration.as('d'));
- var months = round(duration.as('M'));
- var years = round(duration.as('y'));
-
- var a = seconds <= thresholds.ss && ['s', seconds] ||
- seconds < thresholds.s && ['ss', seconds] ||
- minutes <= 1 && ['m'] ||
- minutes < thresholds.m && ['mm', minutes] ||
- hours <= 1 && ['h'] ||
- hours < thresholds.h && ['hh', hours] ||
- days <= 1 && ['d'] ||
- days < thresholds.d && ['dd', days] ||
- months <= 1 && ['M'] ||
- months < thresholds.M && ['MM', months] ||
- years <= 1 && ['y'] || ['yy', years];
-
- a[2] = withoutSuffix;
- a[3] = +posNegDuration > 0;
- a[4] = locale;
- return substituteTimeAgo.apply(null, a);
-}
-
-// This function allows you to set the rounding function for relative time strings
-function getSetRelativeTimeRounding (roundingFunction) {
- if (roundingFunction === undefined) {
- return round;
- }
- if (typeof(roundingFunction) === 'function') {
- round = roundingFunction;
- return true;
- }
- return false;
-}
-
-// This function allows you to set a threshold for relative time strings
-function getSetRelativeTimeThreshold (threshold, limit) {
- if (thresholds[threshold] === undefined) {
- return false;
- }
- if (limit === undefined) {
- return thresholds[threshold];
- }
- thresholds[threshold] = limit;
- if (threshold === 's') {
- thresholds.ss = limit - 1;
- }
- return true;
-}
-
-function humanize (withSuffix) {
- if (!this.isValid()) {
- return this.localeData().invalidDate();
- }
-
- var locale = this.localeData();
- var output = relativeTime$1(this, !withSuffix, locale);
-
- if (withSuffix) {
- output = locale.pastFuture(+this, output);
- }
-
- return locale.postformat(output);
-}
-
-var abs$1 = Math.abs;
-
-function toISOString$1() {
- // for ISO strings we do not use the normal bubbling rules:
- // * milliseconds bubble up until they become hours
- // * days do not bubble at all
- // * months bubble up until they become years
- // This is because there is no context-free conversion between hours and days
- // (think of clock changes)
- // and also not between days and months (28-31 days per month)
- if (!this.isValid()) {
- return this.localeData().invalidDate();
- }
-
- var seconds = abs$1(this._milliseconds) / 1000;
- var days = abs$1(this._days);
- var months = abs$1(this._months);
- var minutes, hours, years;
-
- // 3600 seconds -> 60 minutes -> 1 hour
- minutes = absFloor(seconds / 60);
- hours = absFloor(minutes / 60);
- seconds %= 60;
- minutes %= 60;
-
- // 12 months -> 1 year
- years = absFloor(months / 12);
- months %= 12;
-
-
- // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
- var Y = years;
- var M = months;
- var D = days;
- var h = hours;
- var m = minutes;
- var s = seconds;
- var total = this.asSeconds();
-
- if (!total) {
- // this is the same as C#'s (Noda) and python (isodate)...
- // but not other JS (goog.date)
- return 'P0D';
- }
-
- return (total < 0 ? '-' : '') +
- 'P' +
- (Y ? Y + 'Y' : '') +
- (M ? M + 'M' : '') +
- (D ? D + 'D' : '') +
- ((h || m || s) ? 'T' : '') +
- (h ? h + 'H' : '') +
- (m ? m + 'M' : '') +
- (s ? s + 'S' : '');
-}
-
-var proto$2 = Duration.prototype;
-
-proto$2.isValid = isValid$1;
-proto$2.abs = abs;
-proto$2.add = add$1;
-proto$2.subtract = subtract$1;
-proto$2.as = as;
-proto$2.asMilliseconds = asMilliseconds;
-proto$2.asSeconds = asSeconds;
-proto$2.asMinutes = asMinutes;
-proto$2.asHours = asHours;
-proto$2.asDays = asDays;
-proto$2.asWeeks = asWeeks;
-proto$2.asMonths = asMonths;
-proto$2.asYears = asYears;
-proto$2.valueOf = valueOf$1;
-proto$2._bubble = bubble;
-proto$2.get = get$2;
-proto$2.milliseconds = milliseconds;
-proto$2.seconds = seconds;
-proto$2.minutes = minutes;
-proto$2.hours = hours;
-proto$2.days = days;
-proto$2.weeks = weeks;
-proto$2.months = months;
-proto$2.years = years;
-proto$2.humanize = humanize;
-proto$2.toISOString = toISOString$1;
-proto$2.toString = toISOString$1;
-proto$2.toJSON = toISOString$1;
-proto$2.locale = locale;
-proto$2.localeData = localeData;
-
-// Deprecations
-proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
-proto$2.lang = lang;
-
-// Side effect imports
-
-// FORMATTING
-
-addFormatToken('X', 0, 0, 'unix');
-addFormatToken('x', 0, 0, 'valueOf');
-
-// PARSING
-
-addRegexToken('x', matchSigned);
-addRegexToken('X', matchTimestamp);
-addParseToken('X', function (input, array, config) {
- config._d = new Date(parseFloat(input, 10) * 1000);
-});
-addParseToken('x', function (input, array, config) {
- config._d = new Date(toInt(input));
-});
-
-// Side effect imports
-
-
-hooks.version = '2.18.1';
-
-setHookCallback(createLocal);
-
-hooks.fn = proto;
-hooks.min = min;
-hooks.max = max;
-hooks.now = now;
-hooks.utc = createUTC;
-hooks.unix = createUnix;
-hooks.months = listMonths;
-hooks.isDate = isDate;
-hooks.locale = getSetGlobalLocale;
-hooks.invalid = createInvalid;
-hooks.duration = createDuration;
-hooks.isMoment = isMoment;
-hooks.weekdays = listWeekdays;
-hooks.parseZone = createInZone;
-hooks.localeData = getLocale;
-hooks.isDuration = isDuration;
-hooks.monthsShort = listMonthsShort;
-hooks.weekdaysMin = listWeekdaysMin;
-hooks.defineLocale = defineLocale;
-hooks.updateLocale = updateLocale;
-hooks.locales = listLocales;
-hooks.weekdaysShort = listWeekdaysShort;
-hooks.normalizeUnits = normalizeUnits;
-hooks.relativeTimeRounding = getSetRelativeTimeRounding;
-hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
-hooks.calendarFormat = getCalendarFormat;
-hooks.prototype = proto;
-
-return hooks;
-
-})));
-
-},{}],405:[function(require,module,exports){
-(function (process){
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-// resolves . and .. elements in a path array with directory names there
-// must be no slashes, empty elements, or device names (c:\) in the array
-// (so also no leading and trailing slashes - it does not distinguish
-// relative and absolute paths)
-function normalizeArray(parts, allowAboveRoot) {
- // if the path tries to go above the root, `up` ends up > 0
- var up = 0;
- for (var i = parts.length - 1; i >= 0; i--) {
- var last = parts[i];
- if (last === '.') {
- parts.splice(i, 1);
- } else if (last === '..') {
- parts.splice(i, 1);
- up++;
- } else if (up) {
- parts.splice(i, 1);
- up--;
- }
- }
-
- // if the path is allowed to go above the root, restore leading ..s
- if (allowAboveRoot) {
- for (; up--; up) {
- parts.unshift('..');
- }
- }
-
- return parts;
-}
-
-// Split a filename into [root, dir, basename, ext], unix version
-// 'root' is just a slash, or nothing.
-var splitPathRe =
- /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
-var splitPath = function(filename) {
- return splitPathRe.exec(filename).slice(1);
-};
-
-// path.resolve([from ...], to)
-// posix version
-exports.resolve = function() {
- var resolvedPath = '',
- resolvedAbsolute = false;
-
- for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
- var path = (i >= 0) ? arguments[i] : process.cwd();
-
- // Skip empty and invalid entries
- if (typeof path !== 'string') {
- throw new TypeError('Arguments to path.resolve must be strings');
- } else if (!path) {
- continue;
- }
-
- resolvedPath = path + '/' + resolvedPath;
- resolvedAbsolute = path.charAt(0) === '/';
- }
-
- // At this point the path should be resolved to a full absolute path, but
- // handle relative paths to be safe (might happen when process.cwd() fails)
-
- // Normalize the path
- resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
- return !!p;
- }), !resolvedAbsolute).join('/');
-
- return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
-};
-
-// path.normalize(path)
-// posix version
-exports.normalize = function(path) {
- var isAbsolute = exports.isAbsolute(path),
- trailingSlash = substr(path, -1) === '/';
-
- // Normalize the path
- path = normalizeArray(filter(path.split('/'), function(p) {
- return !!p;
- }), !isAbsolute).join('/');
-
- if (!path && !isAbsolute) {
- path = '.';
- }
- if (path && trailingSlash) {
- path += '/';
- }
-
- return (isAbsolute ? '/' : '') + path;
-};
-
-// posix version
-exports.isAbsolute = function(path) {
- return path.charAt(0) === '/';
-};
-
-// posix version
-exports.join = function() {
- var paths = Array.prototype.slice.call(arguments, 0);
- return exports.normalize(filter(paths, function(p, index) {
- if (typeof p !== 'string') {
- throw new TypeError('Arguments to path.join must be strings');
- }
- return p;
- }).join('/'));
-};
-
-
-// path.relative(from, to)
-// posix version
-exports.relative = function(from, to) {
- from = exports.resolve(from).substr(1);
- to = exports.resolve(to).substr(1);
-
- function trim(arr) {
- var start = 0;
- for (; start < arr.length; start++) {
- if (arr[start] !== '') break;
- }
-
- var end = arr.length - 1;
- for (; end >= 0; end--) {
- if (arr[end] !== '') break;
- }
-
- if (start > end) return [];
- return arr.slice(start, end - start + 1);
- }
-
- var fromParts = trim(from.split('/'));
- var toParts = trim(to.split('/'));
-
- var length = Math.min(fromParts.length, toParts.length);
- var samePartsLength = length;
- for (var i = 0; i < length; i++) {
- if (fromParts[i] !== toParts[i]) {
- samePartsLength = i;
- break;
- }
- }
-
- var outputParts = [];
- for (var i = samePartsLength; i < fromParts.length; i++) {
- outputParts.push('..');
- }
-
- outputParts = outputParts.concat(toParts.slice(samePartsLength));
-
- return outputParts.join('/');
-};
-
-exports.sep = '/';
-exports.delimiter = ':';
-
-exports.dirname = function(path) {
- var result = splitPath(path),
- root = result[0],
- dir = result[1];
-
- if (!root && !dir) {
- // No dirname whatsoever
- return '.';
- }
-
- if (dir) {
- // It has a dirname, strip trailing slash
- dir = dir.substr(0, dir.length - 1);
- }
-
- return root + dir;
-};
-
-
-exports.basename = function(path, ext) {
- var f = splitPath(path)[2];
- // TODO: make this comparison case-insensitive on windows?
- if (ext && f.substr(-1 * ext.length) === ext) {
- f = f.substr(0, f.length - ext.length);
- }
- return f;
-};
-
-
-exports.extname = function(path) {
- return splitPath(path)[3];
-};
-
-function filter (xs, f) {
- if (xs.filter) return xs.filter(f);
- var res = [];
- for (var i = 0; i < xs.length; i++) {
- if (f(xs[i], i, xs)) res.push(xs[i]);
- }
- return res;
-}
-
-// String.prototype.substr - negative index don't work in IE8
-var substr = 'ab'.substr(-1) === 'b'
- ? function (str, start, len) { return str.substr(start, len) }
- : function (str, start, len) {
- if (start < 0) start = str.length + start;
- return str.substr(start, len);
- }
-;
-
-}).call(this,require('_process'))
-},{"_process":406}],406:[function(require,module,exports){
-// shim for using process in browser
-var process = module.exports = {};
-
-// cached from whatever global is present so that test runners that stub it
-// don't break things. But we need to wrap it in a try catch in case it is
-// wrapped in strict mode code which doesn't define any globals. It's inside a
-// function because try/catches deoptimize in certain engines.
-
-var cachedSetTimeout;
-var cachedClearTimeout;
-
-function defaultSetTimout() {
- throw new Error('setTimeout has not been defined');
-}
-function defaultClearTimeout () {
- throw new Error('clearTimeout has not been defined');
-}
-(function () {
- try {
- if (typeof setTimeout === 'function') {
- cachedSetTimeout = setTimeout;
- } else {
- cachedSetTimeout = defaultSetTimout;
- }
- } catch (e) {
- cachedSetTimeout = defaultSetTimout;
- }
- try {
- if (typeof clearTimeout === 'function') {
- cachedClearTimeout = clearTimeout;
- } else {
- cachedClearTimeout = defaultClearTimeout;
- }
- } catch (e) {
- cachedClearTimeout = defaultClearTimeout;
- }
-} ())
-function runTimeout(fun) {
- if (cachedSetTimeout === setTimeout) {
- //normal enviroments in sane situations
- return setTimeout(fun, 0);
- }
- // if setTimeout wasn't available but was latter defined
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
- cachedSetTimeout = setTimeout;
- return setTimeout(fun, 0);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedSetTimeout(fun, 0);
- } catch(e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedSetTimeout.call(null, fun, 0);
- } catch(e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
- return cachedSetTimeout.call(this, fun, 0);
- }
- }
-
-
-}
-function runClearTimeout(marker) {
- if (cachedClearTimeout === clearTimeout) {
- //normal enviroments in sane situations
- return clearTimeout(marker);
- }
- // if clearTimeout wasn't available but was latter defined
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
- cachedClearTimeout = clearTimeout;
- return clearTimeout(marker);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedClearTimeout(marker);
- } catch (e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedClearTimeout.call(null, marker);
- } catch (e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
- return cachedClearTimeout.call(this, marker);
- }
- }
-
-
-
-}
-var queue = [];
-var draining = false;
-var currentQueue;
-var queueIndex = -1;
-
-function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
-}
-
-function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
-
- var len = queue.length;
- while(len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- runClearTimeout(timeout);
-}
-
-process.nextTick = function (fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- runTimeout(drainQueue);
- }
-};
-
-// v8 likes predictible objects
-function Item(fun, array) {
- this.fun = fun;
- this.array = array;
-}
-Item.prototype.run = function () {
- this.fun.apply(null, this.array);
-};
-process.title = 'browser';
-process.browser = true;
-process.env = {};
-process.argv = [];
-process.version = ''; // empty string to avoid regexp issues
-process.versions = {};
-
-function noop() {}
-
-process.on = noop;
-process.addListener = noop;
-process.once = noop;
-process.off = noop;
-process.removeListener = noop;
-process.removeAllListeners = noop;
-process.emit = noop;
-process.prependListener = noop;
-process.prependOnceListener = noop;
-
-process.listeners = function (name) { return [] }
-
-process.binding = function (name) {
- throw new Error('process.binding is not supported');
-};
-
-process.cwd = function () { return '/' };
-process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
-};
-process.umask = function() { return 0; };
-
-},{}],407:[function(require,module,exports){
-(function (global){
-/*! https://mths.be/punycode v1.4.1 by @mathias */
-;(function(root) {
-
- /** Detect free variables */
- var freeExports = typeof exports == 'object' && exports &&
- !exports.nodeType && exports;
- var freeModule = typeof module == 'object' && module &&
- !module.nodeType && module;
- var freeGlobal = typeof global == 'object' && global;
- if (
- freeGlobal.global === freeGlobal ||
- freeGlobal.window === freeGlobal ||
- freeGlobal.self === freeGlobal
- ) {
- root = freeGlobal;
- }
-
- /**
- * The `punycode` object.
- * @name punycode
- * @type Object
- */
- var punycode,
-
- /** Highest positive signed 32-bit float value */
- maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
-
- /** Bootstring parameters */
- base = 36,
- tMin = 1,
- tMax = 26,
- skew = 38,
- damp = 700,
- initialBias = 72,
- initialN = 128, // 0x80
- delimiter = '-', // '\x2D'
-
- /** Regular expressions */
- regexPunycode = /^xn--/,
- regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
- regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
-
- /** Error messages */
- errors = {
- 'overflow': 'Overflow: input needs wider integers to process',
- 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
- 'invalid-input': 'Invalid input'
- },
-
- /** Convenience shortcuts */
- baseMinusTMin = base - tMin,
- floor = Math.floor,
- stringFromCharCode = String.fromCharCode,
-
- /** Temporary variable */
- key;
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * A generic error utility function.
- * @private
- * @param {String} type The error type.
- * @returns {Error} Throws a `RangeError` with the applicable error message.
- */
- function error(type) {
- throw new RangeError(errors[type]);
- }
-
- /**
- * A generic `Array#map` utility function.
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} callback The function that gets called for every array
- * item.
- * @returns {Array} A new array of values returned by the callback function.
- */
- function map(array, fn) {
- var length = array.length;
- var result = [];
- while (length--) {
- result[length] = fn(array[length]);
- }
- return result;
- }
-
- /**
- * A simple `Array#map`-like wrapper to work with domain name strings or email
- * addresses.
- * @private
- * @param {String} domain The domain name or email address.
- * @param {Function} callback The function that gets called for every
- * character.
- * @returns {Array} A new string of characters returned by the callback
- * function.
- */
- function mapDomain(string, fn) {
- var parts = string.split('@');
- var result = '';
- if (parts.length > 1) {
- // In email addresses, only the domain name should be punycoded. Leave
- // the local part (i.e. everything up to `@`) intact.
- result = parts[0] + '@';
- string = parts[1];
- }
- // Avoid `split(regex)` for IE8 compatibility. See #17.
- string = string.replace(regexSeparators, '\x2E');
- var labels = string.split('.');
- var encoded = map(labels, fn).join('.');
- return result + encoded;
- }
-
- /**
- * Creates an array containing the numeric code points of each Unicode
- * character in the string. While JavaScript uses UCS-2 internally,
- * this function will convert a pair of surrogate halves (each of which
- * UCS-2 exposes as separate characters) into a single code point,
- * matching UTF-16.
- * @see `punycode.ucs2.encode`
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
- * @memberOf punycode.ucs2
- * @name decode
- * @param {String} string The Unicode input string (UCS-2).
- * @returns {Array} The new array of code points.
- */
- function ucs2decode(string) {
- var output = [],
- counter = 0,
- length = string.length,
- value,
- extra;
- while (counter < length) {
- value = string.charCodeAt(counter++);
- if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
- // high surrogate, and there is a next character
- extra = string.charCodeAt(counter++);
- if ((extra & 0xFC00) == 0xDC00) { // low surrogate
- output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
- } else {
- // unmatched surrogate; only append this code unit, in case the next
- // code unit is the high surrogate of a surrogate pair
- output.push(value);
- counter--;
- }
- } else {
- output.push(value);
- }
- }
- return output;
- }
-
- /**
- * Creates a string based on an array of numeric code points.
- * @see `punycode.ucs2.decode`
- * @memberOf punycode.ucs2
- * @name encode
- * @param {Array} codePoints The array of numeric code points.
- * @returns {String} The new Unicode string (UCS-2).
- */
- function ucs2encode(array) {
- return map(array, function(value) {
- var output = '';
- if (value > 0xFFFF) {
- value -= 0x10000;
- output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
- value = 0xDC00 | value & 0x3FF;
- }
- output += stringFromCharCode(value);
- return output;
- }).join('');
- }
-
- /**
- * Converts a basic code point into a digit/integer.
- * @see `digitToBasic()`
- * @private
- * @param {Number} codePoint The basic numeric code point value.
- * @returns {Number} The numeric value of a basic code point (for use in
- * representing integers) in the range `0` to `base - 1`, or `base` if
- * the code point does not represent a value.
- */
- function basicToDigit(codePoint) {
- if (codePoint - 48 < 10) {
- return codePoint - 22;
- }
- if (codePoint - 65 < 26) {
- return codePoint - 65;
- }
- if (codePoint - 97 < 26) {
- return codePoint - 97;
- }
- return base;
- }
-
- /**
- * Converts a digit/integer into a basic code point.
- * @see `basicToDigit()`
- * @private
- * @param {Number} digit The numeric value of a basic code point.
- * @returns {Number} The basic code point whose value (when used for
- * representing integers) is `digit`, which needs to be in the range
- * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
- * used; else, the lowercase form is used. The behavior is undefined
- * if `flag` is non-zero and `digit` has no uppercase form.
- */
- function digitToBasic(digit, flag) {
- // 0..25 map to ASCII a..z or A..Z
- // 26..35 map to ASCII 0..9
- return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
- }
-
- /**
- * Bias adaptation function as per section 3.4 of RFC 3492.
- * https://tools.ietf.org/html/rfc3492#section-3.4
- * @private
- */
- function adapt(delta, numPoints, firstTime) {
- var k = 0;
- delta = firstTime ? floor(delta / damp) : delta >> 1;
- delta += floor(delta / numPoints);
- for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
- delta = floor(delta / baseMinusTMin);
- }
- return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
- }
-
- /**
- * Converts a Punycode string of ASCII-only symbols to a string of Unicode
- * symbols.
- * @memberOf punycode
- * @param {String} input The Punycode string of ASCII-only symbols.
- * @returns {String} The resulting string of Unicode symbols.
- */
- function decode(input) {
- // Don't use UCS-2
- var output = [],
- inputLength = input.length,
- out,
- i = 0,
- n = initialN,
- bias = initialBias,
- basic,
- j,
- index,
- oldi,
- w,
- k,
- digit,
- t,
- /** Cached calculation results */
- baseMinusT;
-
- // Handle the basic code points: let `basic` be the number of input code
- // points before the last delimiter, or `0` if there is none, then copy
- // the first basic code points to the output.
-
- basic = input.lastIndexOf(delimiter);
- if (basic < 0) {
- basic = 0;
- }
-
- for (j = 0; j < basic; ++j) {
- // if it's not a basic code point
- if (input.charCodeAt(j) >= 0x80) {
- error('not-basic');
- }
- output.push(input.charCodeAt(j));
- }
-
- // Main decoding loop: start just after the last delimiter if any basic code
- // points were copied; start at the beginning otherwise.
-
- for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
-
- // `index` is the index of the next character to be consumed.
- // Decode a generalized variable-length integer into `delta`,
- // which gets added to `i`. The overflow checking is easier
- // if we increase `i` as we go, then subtract off its starting
- // value at the end to obtain `delta`.
- for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
-
- if (index >= inputLength) {
- error('invalid-input');
- }
-
- digit = basicToDigit(input.charCodeAt(index++));
-
- if (digit >= base || digit > floor((maxInt - i) / w)) {
- error('overflow');
- }
-
- i += digit * w;
- t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
-
- if (digit < t) {
- break;
- }
-
- baseMinusT = base - t;
- if (w > floor(maxInt / baseMinusT)) {
- error('overflow');
- }
-
- w *= baseMinusT;
-
- }
-
- out = output.length + 1;
- bias = adapt(i - oldi, out, oldi == 0);
-
- // `i` was supposed to wrap around from `out` to `0`,
- // incrementing `n` each time, so we'll fix that now:
- if (floor(i / out) > maxInt - n) {
- error('overflow');
- }
-
- n += floor(i / out);
- i %= out;
-
- // Insert `n` at position `i` of the output
- output.splice(i++, 0, n);
-
- }
-
- return ucs2encode(output);
- }
-
- /**
- * Converts a string of Unicode symbols (e.g. a domain name label) to a
- * Punycode string of ASCII-only symbols.
- * @memberOf punycode
- * @param {String} input The string of Unicode symbols.
- * @returns {String} The resulting Punycode string of ASCII-only symbols.
- */
- function encode(input) {
- var n,
- delta,
- handledCPCount,
- basicLength,
- bias,
- j,
- m,
- q,
- k,
- t,
- currentValue,
- output = [],
- /** `inputLength` will hold the number of code points in `input`. */
- inputLength,
- /** Cached calculation results */
- handledCPCountPlusOne,
- baseMinusT,
- qMinusT;
-
- // Convert the input in UCS-2 to Unicode
- input = ucs2decode(input);
-
- // Cache the length
- inputLength = input.length;
-
- // Initialize the state
- n = initialN;
- delta = 0;
- bias = initialBias;
-
- // Handle the basic code points
- for (j = 0; j < inputLength; ++j) {
- currentValue = input[j];
- if (currentValue < 0x80) {
- output.push(stringFromCharCode(currentValue));
- }
- }
-
- handledCPCount = basicLength = output.length;
-
- // `handledCPCount` is the number of code points that have been handled;
- // `basicLength` is the number of basic code points.
-
- // Finish the basic string - if it is not empty - with a delimiter
- if (basicLength) {
- output.push(delimiter);
- }
-
- // Main encoding loop:
- while (handledCPCount < inputLength) {
-
- // All non-basic code points < n have been handled already. Find the next
- // larger one:
- for (m = maxInt, j = 0; j < inputLength; ++j) {
- currentValue = input[j];
- if (currentValue >= n && currentValue < m) {
- m = currentValue;
- }
- }
-
- // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
- // but guard against overflow
- handledCPCountPlusOne = handledCPCount + 1;
- if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
- error('overflow');
- }
-
- delta += (m - n) * handledCPCountPlusOne;
- n = m;
-
- for (j = 0; j < inputLength; ++j) {
- currentValue = input[j];
-
- if (currentValue < n && ++delta > maxInt) {
- error('overflow');
- }
-
- if (currentValue == n) {
- // Represent delta as a generalized variable-length integer
- for (q = delta, k = base; /* no condition */; k += base) {
- t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
- if (q < t) {
- break;
- }
- qMinusT = q - t;
- baseMinusT = base - t;
- output.push(
- stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
- );
- q = floor(qMinusT / baseMinusT);
- }
-
- output.push(stringFromCharCode(digitToBasic(q, 0)));
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
- delta = 0;
- ++handledCPCount;
- }
- }
-
- ++delta;
- ++n;
-
- }
- return output.join('');
- }
-
- /**
- * Converts a Punycode string representing a domain name or an email address
- * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
- * it doesn't matter if you call it on a string that has already been
- * converted to Unicode.
- * @memberOf punycode
- * @param {String} input The Punycoded domain name or email address to
- * convert to Unicode.
- * @returns {String} The Unicode representation of the given Punycode
- * string.
- */
- function toUnicode(input) {
- return mapDomain(input, function(string) {
- return regexPunycode.test(string)
- ? decode(string.slice(4).toLowerCase())
- : string;
- });
- }
-
- /**
- * Converts a Unicode string representing a domain name or an email address to
- * Punycode. Only the non-ASCII parts of the domain name will be converted,
- * i.e. it doesn't matter if you call it with a domain that's already in
- * ASCII.
- * @memberOf punycode
- * @param {String} input The domain name or email address to convert, as a
- * Unicode string.
- * @returns {String} The Punycode representation of the given domain name or
- * email address.
- */
- function toASCII(input) {
- return mapDomain(input, function(string) {
- return regexNonASCII.test(string)
- ? 'xn--' + encode(string)
- : string;
- });
- }
-
- /*--------------------------------------------------------------------------*/
-
- /** Define the public API */
- punycode = {
- /**
- * A string representing the current Punycode.js version number.
- * @memberOf punycode
- * @type String
- */
- 'version': '1.4.1',
- /**
- * An object of methods to convert from JavaScript's internal character
- * representation (UCS-2) to Unicode code points, and back.
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
- * @memberOf punycode
- * @type Object
- */
- 'ucs2': {
- 'decode': ucs2decode,
- 'encode': ucs2encode
- },
- 'decode': decode,
- 'encode': encode,
- 'toASCII': toASCII,
- 'toUnicode': toUnicode
- };
-
- /** Expose `punycode` */
- // Some AMD build optimizers, like r.js, check for specific condition patterns
- // like the following:
- if (
- typeof define == 'function' &&
- typeof define.amd == 'object' &&
- define.amd
- ) {
- define('punycode', function() {
- return punycode;
- });
- } else if (freeExports && freeModule) {
- if (module.exports == freeExports) {
- // in Node.js, io.js, or RingoJS v0.8.0+
- freeModule.exports = punycode;
- } else {
- // in Narwhal or RingoJS v0.7.0-
- for (key in punycode) {
- punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
- }
- }
- } else {
- // in Rhino or a web browser
- root.punycode = punycode;
- }
-
-}(this));
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{}],408:[function(require,module,exports){
-
-;(function (name, root, factory) {
- if (typeof exports === 'object') {
- module.exports = factory()
- }
- /* istanbul ignore next */
- else if (typeof define === 'function' && define.amd) {
- define(factory)
- }
- else {
- root[name] = factory()
- }
-}('slugify', this, function () {
- var charMap = {
- // latin
- 'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE',
- 'Ç': 'C', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', 'Í': 'I',
- 'Î': 'I', 'Ï': 'I', 'Ð': 'D', 'Ñ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O',
- 'Õ': 'O', 'Ö': 'O', 'Ő': 'O', 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U',
- 'Ü': 'U', 'Ű': 'U', 'Ý': 'Y', 'Þ': 'TH', 'ß': 'ss', 'à': 'a', 'á': 'a',
- 'â': 'a', 'ã': 'a', 'ä': 'a', 'å': 'a', 'æ': 'ae', 'ç': 'c', 'è': 'e',
- 'é': 'e', 'ê': 'e', 'ë': 'e', 'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i',
- 'ð': 'd', 'ñ': 'n', 'ò': 'o', 'ó': 'o', 'ô': 'o', 'õ': 'o', 'ö': 'o',
- 'ő': 'o', 'ø': 'o', 'ù': 'u', 'ú': 'u', 'û': 'u', 'ü': 'u', 'ű': 'u',
- 'ý': 'y', 'þ': 'th', 'ÿ': 'y', 'ẞ': 'SS',
- // greek
- 'α': 'a', 'β': 'b', 'γ': 'g', 'δ': 'd', 'ε': 'e', 'ζ': 'z', 'η': 'h', 'θ': '8',
- 'ι': 'i', 'κ': 'k', 'λ': 'l', 'μ': 'm', 'ν': 'n', 'ξ': '3', 'ο': 'o', 'π': 'p',
- 'ρ': 'r', 'σ': 's', 'τ': 't', 'υ': 'y', 'φ': 'f', 'χ': 'x', 'ψ': 'ps', 'ω': 'w',
- 'ά': 'a', 'έ': 'e', 'ί': 'i', 'ό': 'o', 'ύ': 'y', 'ή': 'h', 'ώ': 'w', 'ς': 's',
- 'ϊ': 'i', 'ΰ': 'y', 'ϋ': 'y', 'ΐ': 'i',
- 'Α': 'A', 'Β': 'B', 'Γ': 'G', 'Δ': 'D', 'Ε': 'E', 'Ζ': 'Z', 'Η': 'H', 'Θ': '8',
- 'Ι': 'I', 'Κ': 'K', 'Λ': 'L', 'Μ': 'M', 'Ν': 'N', 'Ξ': '3', 'Ο': 'O', 'Π': 'P',
- 'Ρ': 'R', 'Σ': 'S', 'Τ': 'T', 'Υ': 'Y', 'Φ': 'F', 'Χ': 'X', 'Ψ': 'PS', 'Ω': 'W',
- 'Ά': 'A', 'Έ': 'E', 'Ί': 'I', 'Ό': 'O', 'Ύ': 'Y', 'Ή': 'H', 'Ώ': 'W', 'Ϊ': 'I',
- 'Ϋ': 'Y',
- // turkish
- 'ş': 's', 'Ş': 'S', 'ı': 'i', 'İ': 'I', 'ç': 'c', 'Ç': 'C', 'ü': 'u', 'Ü': 'U',
- 'ö': 'o', 'Ö': 'O', 'ğ': 'g', 'Ğ': 'G',
- // russian
- 'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd', 'е': 'e', 'ё': 'yo', 'ж': 'zh',
- 'з': 'z', 'и': 'i', 'й': 'j', 'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n', 'о': 'o',
- 'п': 'p', 'р': 'r', 'с': 's', 'т': 't', 'у': 'u', 'ф': 'f', 'х': 'h', 'ц': 'c',
- 'ч': 'ch', 'ш': 'sh', 'щ': 'sh', 'ъ': 'u', 'ы': 'y', 'ь': '', 'э': 'e', 'ю': 'yu',
- 'я': 'ya',
- 'А': 'A', 'Б': 'B', 'В': 'V', 'Г': 'G', 'Д': 'D', 'Е': 'E', 'Ё': 'Yo', 'Ж': 'Zh',
- 'З': 'Z', 'И': 'I', 'Й': 'J', 'К': 'K', 'Л': 'L', 'М': 'M', 'Н': 'N', 'О': 'O',
- 'П': 'P', 'Р': 'R', 'С': 'S', 'Т': 'T', 'У': 'U', 'Ф': 'F', 'Х': 'H', 'Ц': 'C',
- 'Ч': 'Ch', 'Ш': 'Sh', 'Щ': 'Sh', 'Ъ': 'U', 'Ы': 'Y', 'Ь': '', 'Э': 'E', 'Ю': 'Yu',
- 'Я': 'Ya',
- // ukranian
- 'Є': 'Ye', 'І': 'I', 'Ї': 'Yi', 'Ґ': 'G', 'є': 'ye', 'і': 'i', 'ї': 'yi', 'ґ': 'g',
- // czech
- 'č': 'c', 'ď': 'd', 'ě': 'e', 'ň': 'n', 'ř': 'r', 'š': 's', 'ť': 't', 'ů': 'u',
- 'ž': 'z', 'Č': 'C', 'Ď': 'D', 'Ě': 'E', 'Ň': 'N', 'Ř': 'R', 'Š': 'S', 'Ť': 'T',
- 'Ů': 'U', 'Ž': 'Z',
- // polish
- 'ą': 'a', 'ć': 'c', 'ę': 'e', 'ł': 'l', 'ń': 'n', 'ó': 'o', 'ś': 's', 'ź': 'z',
- 'ż': 'z', 'Ą': 'A', 'Ć': 'C', 'Ę': 'e', 'Ł': 'L', 'Ń': 'N', 'Ś': 'S',
- 'Ź': 'Z', 'Ż': 'Z',
- // latvian
- 'ā': 'a', 'č': 'c', 'ē': 'e', 'ģ': 'g', 'ī': 'i', 'ķ': 'k', 'ļ': 'l', 'ņ': 'n',
- 'š': 's', 'ū': 'u', 'ž': 'z', 'Ā': 'A', 'Č': 'C', 'Ē': 'E', 'Ģ': 'G', 'Ī': 'i',
- 'Ķ': 'k', 'Ļ': 'L', 'Ņ': 'N', 'Š': 'S', 'Ū': 'u', 'Ž': 'Z',
- // currency
- '€': 'euro', '₢': 'cruzeiro', '₣': 'french franc', '£': 'pound',
- '₤': 'lira', '₥': 'mill', '₦': 'naira', '₧': 'peseta', '₨': 'rupee',
- '₩': 'won', '₪': 'new shequel', '₫': 'dong', '₭': 'kip', '₮': 'tugrik',
- '₯': 'drachma', '₰': 'penny', '₱': 'peso', '₲': 'guarani', '₳': 'austral',
- '₴': 'hryvnia', '₵': 'cedi', '¢': 'cent', '¥': 'yen', '元': 'yuan',
- '円': 'yen', '﷼': 'rial', '₠': 'ecu', '¤': 'currency', '฿': 'baht',
- '$': 'dollar',
- // symbols
- '©': '(c)', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': '(r)', '†': '+',
- '“': '"', '”': '"', '‘': "'", '’': "'", '∂': 'd', 'ƒ': 'f', '™': 'tm',
- '℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a', '•': '*',
- '∆': 'delta', '∞': 'infinity', '♥': 'love', '&': 'and', '|': 'or',
- '<': 'less', '>': 'greater'
- }
-
- function replace (string, options) {
- options = (typeof options === 'string')
- ? {replacement: options}
- : options || {}
-
- string = string.split('')
- .reduce(function (result, ch) {
- if (charMap[ch]) {
- ch = charMap[ch]
- }
- // allowed
- ch = ch.replace(options.remove || /[^\w\s$*_+~.()'"!\-:@]/g, '')
- result += ch
- return result
- }, '')
- // trim leading/trailing spaces
- .replace(/^\s+|\s+$/g, '')
- // convert spaces
- .replace(/[-\s]+/g, options.replacement || '-')
- // remove trailing separator
- .replace('#{replacement}$', '')
-
- return options.lower ? string.toLowerCase() : string
- }
-
- replace.extend = function (customMap) {
- for (var key in customMap) {
- charMap[key] = customMap[key]
- }
- }
-
- return replace
-}))
-
-},{}],409:[function(require,module,exports){
-function count(self, substr) {
- var count = 0
- var pos = self.indexOf(substr)
-
- while (pos >= 0) {
- count += 1
- pos = self.indexOf(substr, pos + 1)
- }
-
- return count
-}
-
-module.exports = count
-},{}],410:[function(require,module,exports){
-function splitLeft(self, sep, maxSplit, limit) {
-
- if (typeof maxSplit === 'undefined') {
- var maxSplit = -1;
- }
-
- var splitResult = self.split(sep);
- var splitPart1 = splitResult.slice(0, maxSplit);
- var splitPart2 = splitResult.slice(maxSplit);
-
- if (splitPart2.length === 0) {
- splitResult = splitPart1;
- } else {
- splitResult = splitPart1.concat(splitPart2.join(sep));
- }
-
- if (typeof limit === 'undefined') {
- return splitResult;
- } else if (limit < 0) {
- return splitResult.slice(limit);
- } else {
- return splitResult.slice(0, limit);
- }
-
-}
-
-module.exports = splitLeft;
-
-},{}],411:[function(require,module,exports){
-function splitRight(self, sep, maxSplit, limit) {
-
- if (typeof maxSplit === 'undefined') {
- var maxSplit = -1;
- }
- if (typeof limit === 'undefined') {
- var limit = 0;
- }
-
- var splitResult = [self];
-
- for (var i = self.length-1; i >= 0; i--) {
-
- if (
- splitResult[0].slice(i).indexOf(sep) === 0 &&
- (splitResult.length <= maxSplit || maxSplit === -1)
- ) {
- splitResult.splice(1, 0, splitResult[0].slice(i+sep.length)); // insert
- splitResult[0] = splitResult[0].slice(0, i)
- }
- }
-
- if (limit >= 0) {
- return splitResult.slice(-limit);
- } else {
- return splitResult.slice(0, -limit);
- }
-
-}
-
-module.exports = splitRight;
-
-},{}],412:[function(require,module,exports){
-/*
-string.js - Copyright (C) 2012-2014, JP Richardson <jprichardson@gmail.com>
-*/
-
-!(function() {
- "use strict";
-
- var VERSION = '3.3.3';
-
- var ENTITIES = {};
-
- // from http://semplicewebsites.com/removing-accents-javascript
- var latin_map={"Á":"A","Ă":"A","Ắ":"A","Ặ":"A","Ằ":"A","Ẳ":"A","Ẵ":"A","Ǎ":"A","Â":"A","Ấ":"A","Ậ":"A","Ầ":"A","Ẩ":"A","Ẫ":"A","Ä":"A","Ǟ":"A","Ȧ":"A","Ǡ":"A","Ạ":"A","Ȁ":"A","À":"A","Ả":"A","Ȃ":"A","Ā":"A","Ą":"A","Å":"A","Ǻ":"A","Ḁ":"A","Ⱥ":"A","Ã":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ḃ":"B","Ḅ":"B","Ɓ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ć":"C","Č":"C","Ç":"C","Ḉ":"C","Ĉ":"C","Ċ":"C","Ƈ":"C","Ȼ":"C","Ď":"D","Ḑ":"D","Ḓ":"D","Ḋ":"D","Ḍ":"D","Ɗ":"D","Ḏ":"D","Dz":"D","Dž":"D","Đ":"D","Ƌ":"D","DZ":"DZ","DŽ":"DZ","É":"E","Ĕ":"E","Ě":"E","Ȩ":"E","Ḝ":"E","Ê":"E","Ế":"E","Ệ":"E","Ề":"E","Ể":"E","Ễ":"E","Ḙ":"E","Ë":"E","Ė":"E","Ẹ":"E","Ȅ":"E","È":"E","Ẻ":"E","Ȇ":"E","Ē":"E","Ḗ":"E","Ḕ":"E","Ę":"E","Ɇ":"E","Ẽ":"E","Ḛ":"E","Ꝫ":"ET","Ḟ":"F","Ƒ":"F","Ǵ":"G","Ğ":"G","Ǧ":"G","Ģ":"G","Ĝ":"G","Ġ":"G","Ɠ":"G","Ḡ":"G","Ǥ":"G","Ḫ":"H","Ȟ":"H","Ḩ":"H","Ĥ":"H","Ⱨ":"H","Ḧ":"H","Ḣ":"H","Ḥ":"H","Ħ":"H","Í":"I","Ĭ":"I","Ǐ":"I","Î":"I","Ï":"I","Ḯ":"I","İ":"I","Ị":"I","Ȉ":"I","Ì":"I","Ỉ":"I","Ȋ":"I","Ī":"I","Į":"I","Ɨ":"I","Ĩ":"I","Ḭ":"I","Ꝺ":"D","Ꝼ":"F","Ᵹ":"G","Ꞃ":"R","Ꞅ":"S","Ꞇ":"T","Ꝭ":"IS","Ĵ":"J","Ɉ":"J","Ḱ":"K","Ǩ":"K","Ķ":"K","Ⱪ":"K","Ꝃ":"K","Ḳ":"K","Ƙ":"K","Ḵ":"K","Ꝁ":"K","Ꝅ":"K","Ĺ":"L","Ƚ":"L","Ľ":"L","Ļ":"L","Ḽ":"L","Ḷ":"L","Ḹ":"L","Ⱡ":"L","Ꝉ":"L","Ḻ":"L","Ŀ":"L","Ɫ":"L","Lj":"L","Ł":"L","LJ":"LJ","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ń":"N","Ň":"N","Ņ":"N","Ṋ":"N","Ṅ":"N","Ṇ":"N","Ǹ":"N","Ɲ":"N","Ṉ":"N","Ƞ":"N","Nj":"N","Ñ":"N","NJ":"NJ","Ó":"O","Ŏ":"O","Ǒ":"O","Ô":"O","Ố":"O","Ộ":"O","Ồ":"O","Ổ":"O","Ỗ":"O","Ö":"O","Ȫ":"O","Ȯ":"O","Ȱ":"O","Ọ":"O","Ő":"O","Ȍ":"O","Ò":"O","Ỏ":"O","Ơ":"O","Ớ":"O","Ợ":"O","Ờ":"O","Ở":"O","Ỡ":"O","Ȏ":"O","Ꝋ":"O","Ꝍ":"O","Ō":"O","Ṓ":"O","Ṑ":"O","Ɵ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Õ":"O","Ṍ":"O","Ṏ":"O","Ȭ":"O","Ƣ":"OI","Ꝏ":"OO","Ɛ":"E","Ɔ":"O","Ȣ":"OU","Ṕ":"P","Ṗ":"P","Ꝓ":"P","Ƥ":"P","Ꝕ":"P","Ᵽ":"P","Ꝑ":"P","Ꝙ":"Q","Ꝗ":"Q","Ŕ":"R","Ř":"R","Ŗ":"R","Ṙ":"R","Ṛ":"R","Ṝ":"R","Ȑ":"R","Ȓ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꜿ":"C","Ǝ":"E","Ś":"S","Ṥ":"S","Š":"S","Ṧ":"S","Ş":"S","Ŝ":"S","Ș":"S","Ṡ":"S","Ṣ":"S","Ṩ":"S","ẞ":"SS","Ť":"T","Ţ":"T","Ṱ":"T","Ț":"T","Ⱦ":"T","Ṫ":"T","Ṭ":"T","Ƭ":"T","Ṯ":"T","Ʈ":"T","Ŧ":"T","Ɐ":"A","Ꞁ":"L","Ɯ":"M","Ʌ":"V","Ꜩ":"TZ","Ú":"U","Ŭ":"U","Ǔ":"U","Û":"U","Ṷ":"U","Ü":"U","Ǘ":"U","Ǚ":"U","Ǜ":"U","Ǖ":"U","Ṳ":"U","Ụ":"U","Ű":"U","Ȕ":"U","Ù":"U","Ủ":"U","Ư":"U","Ứ":"U","Ự":"U","Ừ":"U","Ử":"U","Ữ":"U","Ȗ":"U","Ū":"U","Ṻ":"U","Ų":"U","Ů":"U","Ũ":"U","Ṹ":"U","Ṵ":"U","Ꝟ":"V","Ṿ":"V","Ʋ":"V","Ṽ":"V","Ꝡ":"VY","Ẃ":"W","Ŵ":"W","Ẅ":"W","Ẇ":"W","Ẉ":"W","Ẁ":"W","Ⱳ":"W","Ẍ":"X","Ẋ":"X","Ý":"Y","Ŷ":"Y","Ÿ":"Y","Ẏ":"Y","Ỵ":"Y","Ỳ":"Y","Ƴ":"Y","Ỷ":"Y","Ỿ":"Y","Ȳ":"Y","Ɏ":"Y","Ỹ":"Y","Ź":"Z","Ž":"Z","Ẑ":"Z","Ⱬ":"Z","Ż":"Z","Ẓ":"Z","Ȥ":"Z","Ẕ":"Z","Ƶ":"Z","IJ":"IJ","Œ":"OE","ᴀ":"A","ᴁ":"AE","ʙ":"B","ᴃ":"B","ᴄ":"C","ᴅ":"D","ᴇ":"E","ꜰ":"F","ɢ":"G","ʛ":"G","ʜ":"H","ɪ":"I","ʁ":"R","ᴊ":"J","ᴋ":"K","ʟ":"L","ᴌ":"L","ᴍ":"M","ɴ":"N","ᴏ":"O","ɶ":"OE","ᴐ":"O","ᴕ":"OU","ᴘ":"P","ʀ":"R","ᴎ":"N","ᴙ":"R","ꜱ":"S","ᴛ":"T","ⱻ":"E","ᴚ":"R","ᴜ":"U","ᴠ":"V","ᴡ":"W","ʏ":"Y","ᴢ":"Z","á":"a","ă":"a","ắ":"a","ặ":"a","ằ":"a","ẳ":"a","ẵ":"a","ǎ":"a","â":"a","ấ":"a","ậ":"a","ầ":"a","ẩ":"a","ẫ":"a","ä":"a","ǟ":"a","ȧ":"a","ǡ":"a","ạ":"a","ȁ":"a","à":"a","ả":"a","ȃ":"a","ā":"a","ą":"a","ᶏ":"a","ẚ":"a","å":"a","ǻ":"a","ḁ":"a","ⱥ":"a","ã":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ḃ":"b","ḅ":"b","ɓ":"b","ḇ":"b","ᵬ":"b","ᶀ":"b","ƀ":"b","ƃ":"b","ɵ":"o","ć":"c","č":"c","ç":"c","ḉ":"c","ĉ":"c","ɕ":"c","ċ":"c","ƈ":"c","ȼ":"c","ď":"d","ḑ":"d","ḓ":"d","ȡ":"d","ḋ":"d","ḍ":"d","ɗ":"d","ᶑ":"d","ḏ":"d","ᵭ":"d","ᶁ":"d","đ":"d","ɖ":"d","ƌ":"d","ı":"i","ȷ":"j","ɟ":"j","ʄ":"j","dz":"dz","dž":"dz","é":"e","ĕ":"e","ě":"e","ȩ":"e","ḝ":"e","ê":"e","ế":"e","ệ":"e","ề":"e","ể":"e","ễ":"e","ḙ":"e","ë":"e","ė":"e","ẹ":"e","ȅ":"e","è":"e","ẻ":"e","ȇ":"e","ē":"e","ḗ":"e","ḕ":"e","ⱸ":"e","ę":"e","ᶒ":"e","ɇ":"e","ẽ":"e","ḛ":"e","ꝫ":"et","ḟ":"f","ƒ":"f","ᵮ":"f","ᶂ":"f","ǵ":"g","ğ":"g","ǧ":"g","ģ":"g","ĝ":"g","ġ":"g","ɠ":"g","ḡ":"g","ᶃ":"g","ǥ":"g","ḫ":"h","ȟ":"h","ḩ":"h","ĥ":"h","ⱨ":"h","ḧ":"h","ḣ":"h","ḥ":"h","ɦ":"h","ẖ":"h","ħ":"h","ƕ":"hv","í":"i","ĭ":"i","ǐ":"i","î":"i","ï":"i","ḯ":"i","ị":"i","ȉ":"i","ì":"i","ỉ":"i","ȋ":"i","ī":"i","į":"i","ᶖ":"i","ɨ":"i","ĩ":"i","ḭ":"i","ꝺ":"d","ꝼ":"f","ᵹ":"g","ꞃ":"r","ꞅ":"s","ꞇ":"t","ꝭ":"is","ǰ":"j","ĵ":"j","ʝ":"j","ɉ":"j","ḱ":"k","ǩ":"k","ķ":"k","ⱪ":"k","ꝃ":"k","ḳ":"k","ƙ":"k","ḵ":"k","ᶄ":"k","ꝁ":"k","ꝅ":"k","ĺ":"l","ƚ":"l","ɬ":"l","ľ":"l","ļ":"l","ḽ":"l","ȴ":"l","ḷ":"l","ḹ":"l","ⱡ":"l","ꝉ":"l","ḻ":"l","ŀ":"l","ɫ":"l","ᶅ":"l","ɭ":"l","ł":"l","lj":"lj","ſ":"s","ẜ":"s","ẛ":"s","ẝ":"s","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ᵯ":"m","ᶆ":"m","ń":"n","ň":"n","ņ":"n","ṋ":"n","ȵ":"n","ṅ":"n","ṇ":"n","ǹ":"n","ɲ":"n","ṉ":"n","ƞ":"n","ᵰ":"n","ᶇ":"n","ɳ":"n","ñ":"n","nj":"nj","ó":"o","ŏ":"o","ǒ":"o","ô":"o","ố":"o","ộ":"o","ồ":"o","ổ":"o","ỗ":"o","ö":"o","ȫ":"o","ȯ":"o","ȱ":"o","ọ":"o","ő":"o","ȍ":"o","ò":"o","ỏ":"o","ơ":"o","ớ":"o","ợ":"o","ờ":"o","ở":"o","ỡ":"o","ȏ":"o","ꝋ":"o","ꝍ":"o","ⱺ":"o","ō":"o","ṓ":"o","ṑ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","õ":"o","ṍ":"o","ṏ":"o","ȭ":"o","ƣ":"oi","ꝏ":"oo","ɛ":"e","ᶓ":"e","ɔ":"o","ᶗ":"o","ȣ":"ou","ṕ":"p","ṗ":"p","ꝓ":"p","ƥ":"p","ᵱ":"p","ᶈ":"p","ꝕ":"p","ᵽ":"p","ꝑ":"p","ꝙ":"q","ʠ":"q","ɋ":"q","ꝗ":"q","ŕ":"r","ř":"r","ŗ":"r","ṙ":"r","ṛ":"r","ṝ":"r","ȑ":"r","ɾ":"r","ᵳ":"r","ȓ":"r","ṟ":"r","ɼ":"r","ᵲ":"r","ᶉ":"r","ɍ":"r","ɽ":"r","ↄ":"c","ꜿ":"c","ɘ":"e","ɿ":"r","ś":"s","ṥ":"s","š":"s","ṧ":"s","ş":"s","ŝ":"s","ș":"s","ṡ":"s","ṣ":"s","ṩ":"s","ʂ":"s","ᵴ":"s","ᶊ":"s","ȿ":"s","ɡ":"g","ß":"ss","ᴑ":"o","ᴓ":"o","ᴝ":"u","ť":"t","ţ":"t","ṱ":"t","ț":"t","ȶ":"t","ẗ":"t","ⱦ":"t","ṫ":"t","ṭ":"t","ƭ":"t","ṯ":"t","ᵵ":"t","ƫ":"t","ʈ":"t","ŧ":"t","ᵺ":"th","ɐ":"a","ᴂ":"ae","ǝ":"e","ᵷ":"g","ɥ":"h","ʮ":"h","ʯ":"h","ᴉ":"i","ʞ":"k","ꞁ":"l","ɯ":"m","ɰ":"m","ᴔ":"oe","ɹ":"r","ɻ":"r","ɺ":"r","ⱹ":"r","ʇ":"t","ʌ":"v","ʍ":"w","ʎ":"y","ꜩ":"tz","ú":"u","ŭ":"u","ǔ":"u","û":"u","ṷ":"u","ü":"u","ǘ":"u","ǚ":"u","ǜ":"u","ǖ":"u","ṳ":"u","ụ":"u","ű":"u","ȕ":"u","ù":"u","ủ":"u","ư":"u","ứ":"u","ự":"u","ừ":"u","ử":"u","ữ":"u","ȗ":"u","ū":"u","ṻ":"u","ų":"u","ᶙ":"u","ů":"u","ũ":"u","ṹ":"u","ṵ":"u","ᵫ":"ue","ꝸ":"um","ⱴ":"v","ꝟ":"v","ṿ":"v","ʋ":"v","ᶌ":"v","ⱱ":"v","ṽ":"v","ꝡ":"vy","ẃ":"w","ŵ":"w","ẅ":"w","ẇ":"w","ẉ":"w","ẁ":"w","ⱳ":"w","ẘ":"w","ẍ":"x","ẋ":"x","ᶍ":"x","ý":"y","ŷ":"y","ÿ":"y","ẏ":"y","ỵ":"y","ỳ":"y","ƴ":"y","ỷ":"y","ỿ":"y","ȳ":"y","ẙ":"y","ɏ":"y","ỹ":"y","ź":"z","ž":"z","ẑ":"z","ʑ":"z","ⱬ":"z","ż":"z","ẓ":"z","ȥ":"z","ẕ":"z","ᵶ":"z","ᶎ":"z","ʐ":"z","ƶ":"z","ɀ":"z","ff":"ff","ffi":"ffi","ffl":"ffl","fi":"fi","fl":"fl","ij":"ij","œ":"oe","st":"st","ₐ":"a","ₑ":"e","ᵢ":"i","ⱼ":"j","ₒ":"o","ᵣ":"r","ᵤ":"u","ᵥ":"v","ₓ":"x"};
-
-//******************************************************************************
-// Added an initialize function which is essentially the code from the S
-// constructor. Now, the S constructor calls this and a new method named
-// setValue calls it as well. The setValue function allows constructors for
-// modules that extend string.js to set the initial value of an object without
-// knowing the internal workings of string.js.
-//
-// Also, all methods which return a new S object now call:
-//
-// return new this.constructor(s);
-//
-// instead of:
-//
-// return new S(s);
-//
-// This allows extended objects to keep their proper instanceOf and constructor.
-//******************************************************************************
-
- function initialize (object, s) {
- if (s !== null && s !== undefined) {
- if (typeof s === 'string')
- object.s = s;
- else
- object.s = s.toString();
- } else {
- object.s = s; //null or undefined
- }
-
- object.orig = s; //original object, currently only used by toCSV() and toBoolean()
-
- if (s !== null && s !== undefined) {
- if (object.__defineGetter__) {
- object.__defineGetter__('length', function() {
- return object.s.length;
- })
- } else {
- object.length = s.length;
- }
- } else {
- object.length = -1;
- }
- }
-
- function S(s) {
- initialize(this, s);
- }
-
- var __nsp = String.prototype;
- var __sp = S.prototype = {
-
- between: function(left, right) {
- var s = this.s;
- var startPos = s.indexOf(left);
- var endPos = s.indexOf(right, startPos + left.length);
- if (endPos == -1 && right != null)
- return new this.constructor('')
- else if (endPos == -1 && right == null)
- return new this.constructor(s.substring(startPos + left.length))
- else
- return new this.constructor(s.slice(startPos + left.length, endPos));
- },
-
- //# modified slightly from https://github.com/epeli/underscore.string
- camelize: function() {
- var s = this.trim().s.replace(/(\-|_|\s)+(.)?/g, function(mathc, sep, c) {
- return (c ? c.toUpperCase() : '');
- });
- return new this.constructor(s);
- },
-
- capitalize: function() {
- return new this.constructor(this.s.substr(0, 1).toUpperCase() + this.s.substring(1).toLowerCase());
- },
-
- charAt: function(index) {
- return this.s.charAt(index);
- },
-
- chompLeft: function(prefix) {
- var s = this.s;
- if (s.indexOf(prefix) === 0) {
- s = s.slice(prefix.length);
- return new this.constructor(s);
- } else {
- return this;
- }
- },
-
- chompRight: function(suffix) {
- if (this.endsWith(suffix)) {
- var s = this.s;
- s = s.slice(0, s.length - suffix.length);
- return new this.constructor(s);
- } else {
- return this;
- }
- },
-
- //#thanks Google
- collapseWhitespace: function() {
- var s = this.s.replace(/[\s\xa0]+/g, ' ').replace(/^\s+|\s+$/g, '');
- return new this.constructor(s);
- },
-
- contains: function(ss) {
- return this.s.indexOf(ss) >= 0;
- },
-
- count: function(ss) {
- return require('./_count')(this.s, ss)
- },
-
- //#modified from https://github.com/epeli/underscore.string
- dasherize: function() {
- var s = this.trim().s.replace(/[_\s]+/g, '-').replace(/([A-Z])/g, '-$1').replace(/-+/g, '-').toLowerCase();
- return new this.constructor(s);
- },
-
- equalsIgnoreCase: function(prefix) {
- var s = this.s;
- return s.toLowerCase() == prefix.toLowerCase()
- },
-
- latinise: function() {
- var s = this.replace(/[^A-Za-z0-9\[\] ]/g, function(x) { return latin_map[x] || x; });
- return new this.constructor(s);
- },
-
- decodeHtmlEntities: function() { //https://github.com/substack/node-ent/blob/master/index.js
- var s = this.s;
- s = s.replace(/&#(\d+);?/g, function (_, code) {
- return String.fromCharCode(code);
- })
- .replace(/&#[xX]([A-Fa-f0-9]+);?/g, function (_, hex) {
- return String.fromCharCode(parseInt(hex, 16));
- })
- .replace(/&([^;\W]+;?)/g, function (m, e) {
- var ee = e.replace(/;$/, '');
- var target = ENTITIES[e] || (e.match(/;$/) && ENTITIES[ee]);
-
- if (typeof target === 'number') {
- return String.fromCharCode(target);
- }
- else if (typeof target === 'string') {
- return target;
- }
- else {
- return m;
- }
- })
-
- return new this.constructor(s);
- },
-
- endsWith: function() {
- var suffixes = Array.prototype.slice.call(arguments, 0);
- for (var i = 0; i < suffixes.length; ++i) {
- var l = this.s.length - suffixes[i].length;
- if (l >= 0 && this.s.indexOf(suffixes[i], l) === l) return true;
- }
- return false;
- },
-
- escapeHTML: function() { //from underscore.string
- return new this.constructor(this.s.replace(/[&<>"']/g, function(m){ return '&' + reversedEscapeChars[m] + ';'; }));
- },
-
- ensureLeft: function(prefix) {
- var s = this.s;
- if (s.indexOf(prefix) === 0) {
- return this;
- } else {
- return new this.constructor(prefix + s);
- }
- },
-
- ensureRight: function(suffix) {
- var s = this.s;
- if (this.endsWith(suffix)) {
- return this;
- } else {
- return new this.constructor(s + suffix);
- }
- },
-
- humanize: function() { //modified from underscore.string
- if (this.s === null || this.s === undefined)
- return new this.constructor('')
- var s = this.underscore().replace(/_id$/,'').replace(/_/g, ' ').trim().capitalize()
- return new this.constructor(s)
- },
-
- isAlpha: function() {
- return !/[^a-z\xDF-\xFF]|^$/.test(this.s.toLowerCase());
- },
-
- isAlphaNumeric: function() {
- return !/[^0-9a-z\xDF-\xFF]/.test(this.s.toLowerCase());
- },
-
- isEmpty: function() {
- return this.s === null || this.s === undefined ? true : /^[\s\xa0]*$/.test(this.s);
- },
-
- isLower: function() {
- return this.isAlpha() && this.s.toLowerCase() === this.s;
- },
-
- isNumeric: function() {
- return !/[^0-9]/.test(this.s);
- },
-
- isUpper: function() {
- return this.isAlpha() && this.s.toUpperCase() === this.s;
- },
-
- left: function(N) {
- if (N >= 0) {
- var s = this.s.substr(0, N);
- return new this.constructor(s);
- } else {
- return this.right(-N);
- }
- },
-
- lines: function() { //convert windows newlines to unix newlines then convert to an Array of lines
- return this.replaceAll('\r\n', '\n').s.split('\n');
- },
-
- pad: function(len, ch) { //https://github.com/component/pad
- if (ch == null) ch = ' ';
- if (this.s.length >= len) return new this.constructor(this.s);
- len = len - this.s.length;
- var left = Array(Math.ceil(len / 2) + 1).join(ch);
- var right = Array(Math.floor(len / 2) + 1).join(ch);
- return new this.constructor(left + this.s + right);
- },
-
- padLeft: function(len, ch) { //https://github.com/component/pad
- if (ch == null) ch = ' ';
- if (this.s.length >= len) return new this.constructor(this.s);
- return new this.constructor(Array(len - this.s.length + 1).join(ch) + this.s);
- },
-
- padRight: function(len, ch) { //https://github.com/component/pad
- if (ch == null) ch = ' ';
- if (this.s.length >= len) return new this.constructor(this.s);
- return new this.constructor(this.s + Array(len - this.s.length + 1).join(ch));
- },
-
- parseCSV: function(delimiter, qualifier, escape, lineDelimiter) { //try to parse no matter what
- delimiter = delimiter || ',';
- escape = escape || '\\'
- if (typeof qualifier == 'undefined')
- qualifier = '"';
-
- var i = 0, fieldBuffer = [], fields = [], len = this.s.length, inField = false, inUnqualifiedString = false, self = this;
- var ca = function(i){return self.s.charAt(i)};
- if (typeof lineDelimiter !== 'undefined') var rows = [];
-
- if (!qualifier)
- inField = true;
-
- while (i < len) {
- var current = ca(i);
- switch (current) {
- case escape:
- //fix for issues #32 and #35
- if (inField && ((escape !== qualifier) || ca(i+1) === qualifier)) {
- i += 1;
- fieldBuffer.push(ca(i));
- break;
- }
- if (escape !== qualifier) break;
- case qualifier:
- inField = !inField;
- break;
- case delimiter:
- if(inUnqualifiedString) {
- inField=false;
- inUnqualifiedString=false;
- }
- if (inField && qualifier)
- fieldBuffer.push(current);
- else {
- fields.push(fieldBuffer.join(''))
- fieldBuffer.length = 0;
- }
- break;
- case lineDelimiter:
- if(inUnqualifiedString) {
- inField=false;
- inUnqualifiedString=false;
- fields.push(fieldBuffer.join(''))
- rows.push(fields);
- fields = [];
- fieldBuffer.length = 0;
- }
- else if (inField) {
- fieldBuffer.push(current);
- } else {
- if (rows) {
- fields.push(fieldBuffer.join(''))
- rows.push(fields);
- fields = [];
- fieldBuffer.length = 0;
- }
- }
- break;
- case ' ':
- if (inField)
- fieldBuffer.push(current);
- break;
- default:
- if (inField)
- fieldBuffer.push(current);
- else if(current!==qualifier) {
- fieldBuffer.push(current);
- inField=true;
- inUnqualifiedString=true;
- }
- break;
- }
- i += 1;
- }
-
- fields.push(fieldBuffer.join(''));
- if (rows) {
- rows.push(fields);
- return rows;
- }
- return fields;
- },
-
- replaceAll: function(ss, r) {
- //var s = this.s.replace(new RegExp(ss, 'g'), r);
- var s = this.s.split(ss).join(r)
- return new this.constructor(s);
- },
-
- splitLeft: function(sep, maxSplit, limit) {
- return require('./_splitLeft')(this.s, sep, maxSplit, limit)
- },
-
- splitRight: function(sep, maxSplit, limit) {
- return require('./_splitRight')(this.s, sep, maxSplit, limit)
- },
-
- strip: function() {
- var ss = this.s;
- for(var i= 0, n=arguments.length; i<n; i++) {
- ss = ss.split(arguments[i]).join('');
- }
- return new this.constructor(ss);
- },
-
- stripLeft: function (chars) {
- var regex;
- var pattern;
- var ss = ensureString(this.s);
-
- if (chars === undefined) {
- pattern = /^\s+/g;
- }
- else {
- regex = escapeRegExp(chars);
- pattern = new RegExp("^[" + regex + "]+", "g");
- }
-
- return new this.constructor(ss.replace(pattern, ""));
- },
-
- stripRight: function (chars) {
- var regex;
- var pattern;
- var ss = ensureString(this.s);
-
- if (chars === undefined) {
- pattern = /\s+$/g;
- }
- else {
- regex = escapeRegExp(chars);
- pattern = new RegExp("[" + regex + "]+$", "g");
- }
-
- return new this.constructor(ss.replace(pattern, ""));
- },
-
- right: function(N) {
- if (N >= 0) {
- var s = this.s.substr(this.s.length - N, N);
- return new this.constructor(s);
- } else {
- return this.left(-N);
- }
- },
-
- setValue: function (s) {
- initialize(this, s);
- return this;
- },
-
- slugify: function() {
- var sl = (new S(new S(this.s).latinise().s.replace(/[^\w\s-]/g, '').toLowerCase())).dasherize().s;
- if (sl.charAt(0) === '-')
- sl = sl.substr(1);
- return new this.constructor(sl);
- },
-
- startsWith: function() {
- var prefixes = Array.prototype.slice.call(arguments, 0);
- for (var i = 0; i < prefixes.length; ++i) {
- if (this.s.lastIndexOf(prefixes[i], 0) === 0) return true;
- }
- return false;
- },
-
- stripPunctuation: function() {
- //return new this.constructor(this.s.replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~()]/g,""));
- return new this.constructor(this.s.replace(/[^\w\s]|_/g, "").replace(/\s+/g, " "));
- },
-
- stripTags: function() { //from sugar.js
- var s = this.s, args = arguments.length > 0 ? arguments : [''];
- multiArgs(args, function(tag) {
- s = s.replace(RegExp('<\/?' + tag + '[^<>]*>', 'gi'), '');
- });
- return new this.constructor(s);
- },
-
- template: function(values, opening, closing) {
- var s = this.s
- var opening = opening || Export.TMPL_OPEN
- var closing = closing || Export.TMPL_CLOSE
-
- var open = opening.replace(/[-[\]()*\s]/g, "\\$&").replace(/\$/g, '\\$')
- var close = closing.replace(/[-[\]()*\s]/g, "\\$&").replace(/\$/g, '\\$')
- var r = new RegExp(open + '(.+?)' + close, 'g')
- //, r = /\{\{(.+?)\}\}/g
- var matches = s.match(r) || [];
-
- matches.forEach(function(match) {
- var key = match.substring(opening.length, match.length - closing.length).trim();//chop {{ and }}
- var value = typeof values[key] == 'undefined' ? '' : values[key];
- s = s.replace(match, value);
- });
- return new this.constructor(s);
- },
-
- times: function(n) {
- return new this.constructor(new Array(n + 1).join(this.s));
- },
-
- titleCase: function() {
- var s = this.s;
- if (s) {
- s = s.replace(/(^[a-z]| [a-z]|-[a-z]|_[a-z])/g,
- function($1){
- return $1.toUpperCase();
- }
- );
- }
- return new this.constructor(s);
- },
-
- toBoolean: function() {
- if (typeof this.orig === 'string') {
- var s = this.s.toLowerCase();
- return s === 'true' || s === 'yes' || s === 'on' || s === '1';
- } else
- return this.orig === true || this.orig === 1;
- },
-
- toFloat: function(precision) {
- var num = parseFloat(this.s)
- if (precision)
- return parseFloat(num.toFixed(precision))
- else
- return num
- },
-
- toInt: function() { //thanks Google
- // If the string starts with '0x' or '-0x', parse as hex.
- return /^\s*-?0x/i.test(this.s) ? parseInt(this.s, 16) : parseInt(this.s, 10)
- },
-
- trim: function() {
- var s;
- if (typeof __nsp.trim === 'undefined')
- s = this.s.replace(/(^\s*|\s*$)/g, '')
- else
- s = this.s.trim()
- return new this.constructor(s);
- },
-
- trimLeft: function() {
- var s;
- if (__nsp.trimLeft)
- s = this.s.trimLeft();
- else
- s = this.s.replace(/(^\s*)/g, '');
- return new this.constructor(s);
- },
-
- trimRight: function() {
- var s;
- if (__nsp.trimRight)
- s = this.s.trimRight();
- else
- s = this.s.replace(/\s+$/, '');
- return new this.constructor(s);
- },
-
- truncate: function(length, pruneStr) { //from underscore.string, author: github.com/rwz
- var str = this.s;
-
- length = ~~length;
- pruneStr = pruneStr || '...';
-
- if (str.length <= length) return new this.constructor(str);
-
- var tmpl = function(c){ return c.toUpperCase() !== c.toLowerCase() ? 'A' : ' '; },
- template = str.slice(0, length+1).replace(/.(?=\W*\w*$)/g, tmpl); // 'Hello, world' -> 'HellAA AAAAA'
-
- if (template.slice(template.length-2).match(/\w\w/))
- template = template.replace(/\s*\S+$/, '');
- else
- template = new S(template.slice(0, template.length-1)).trimRight().s;
-
- return (template+pruneStr).length > str.length ? new S(str) : new S(str.slice(0, template.length)+pruneStr);
- },
-
- toCSV: function() {
- var delim = ',', qualifier = '"', escape = '\\', encloseNumbers = true, keys = false;
- var dataArray = [];
-
- function hasVal(it) {
- return it !== null && it !== '';
- }
-
- if (typeof arguments[0] === 'object') {
- delim = arguments[0].delimiter || delim;
- delim = arguments[0].separator || delim;
- qualifier = arguments[0].qualifier || qualifier;
- encloseNumbers = !!arguments[0].encloseNumbers;
- escape = arguments[0].escape || escape;
- keys = !!arguments[0].keys;
- } else if (typeof arguments[0] === 'string') {
- delim = arguments[0];
- }
-
- if (typeof arguments[1] === 'string')
- qualifier = arguments[1];
-
- if (arguments[1] === null)
- qualifier = null;
-
- if (this.orig instanceof Array)
- dataArray = this.orig;
- else { //object
- for (var key in this.orig)
- if (this.orig.hasOwnProperty(key))
- if (keys)
- dataArray.push(key);
- else
- dataArray.push(this.orig[key]);
- }
-
- var rep = escape + qualifier;
- var buildString = [];
- for (var i = 0; i < dataArray.length; ++i) {
- var shouldQualify = hasVal(qualifier)
- if (typeof dataArray[i] == 'number')
- shouldQualify &= encloseNumbers;
-
- if (shouldQualify)
- buildString.push(qualifier);
-
- if (dataArray[i] !== null && dataArray[i] !== undefined) {
- var d = new S(dataArray[i]).replaceAll(qualifier, rep).s;
- buildString.push(d);
- } else
- buildString.push('')
-
- if (shouldQualify)
- buildString.push(qualifier);
-
- if (delim)
- buildString.push(delim);
- }
-
- //chop last delim
- //console.log(buildString.length)
- buildString.length = buildString.length - 1;
- return new this.constructor(buildString.join(''));
- },
-
- toString: function() {
- return this.s;
- },
-
- //#modified from https://github.com/epeli/underscore.string
- underscore: function() {
- var s = this.trim().s.replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/([A-Z\d]+)([A-Z][a-z])/g,'$1_$2').replace(/[-\s]+/g, '_').toLowerCase();
- return new this.constructor(s);
- },
-
- unescapeHTML: function() { //from underscore.string
- return new this.constructor(this.s.replace(/\&([^;]+);/g, function(entity, entityCode){
- var match;
-
- if (entityCode in escapeChars) {
- return escapeChars[entityCode];
- } else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) {
- return String.fromCharCode(parseInt(match[1], 16));
- } else if (match = entityCode.match(/^#(\d+)$/)) {
- return String.fromCharCode(~~match[1]);
- } else {
- return entity;
- }
- }));
- },
-
- valueOf: function() {
- return this.s.valueOf();
- },
-
- //#Added a New Function called wrapHTML.
- wrapHTML: function (tagName, tagAttrs) {
- var s = this.s, el = (tagName == null) ? 'span' : tagName, elAttr = '', wrapped = '';
- if(typeof tagAttrs == 'object') for(var prop in tagAttrs) elAttr += ' ' + prop + '="' +(new this.constructor(tagAttrs[prop])).escapeHTML() + '"';
- s = wrapped.concat('<', el, elAttr, '>', this, '</', el, '>');
- return new this.constructor(s);
- }
- }
-
- var methodsAdded = [];
- function extendPrototype() {
- for (var name in __sp) {
- (function(name){
- var func = __sp[name];
- if (!__nsp.hasOwnProperty(name)) {
- methodsAdded.push(name);
- __nsp[name] = function() {
- String.prototype.s = this;
- return func.apply(this, arguments);
- }
- }
- })(name);
- }
- }
-
- function restorePrototype() {
- for (var i = 0; i < methodsAdded.length; ++i)
- delete String.prototype[methodsAdded[i]];
- methodsAdded.length = 0;
- }
-
-
-/*************************************
-/* Attach Native JavaScript String Properties
-/*************************************/
-
- var nativeProperties = getNativeStringProperties();
- for (var name in nativeProperties) {
- (function(name) {
- var stringProp = __nsp[name];
- if (typeof stringProp == 'function') {
- //console.log(stringProp)
- if (!__sp[name]) {
- if (nativeProperties[name] === 'string') {
- __sp[name] = function() {
- //console.log(name)
- return new this.constructor(stringProp.apply(this, arguments));
- }
- } else {
- __sp[name] = stringProp;
- }
- }
- }
- })(name);
- }
-
-
-/*************************************
-/* Function Aliases
-/*************************************/
-
- __sp.repeat = __sp.times;
- __sp.include = __sp.contains;
- __sp.toInteger = __sp.toInt;
- __sp.toBool = __sp.toBoolean;
- __sp.decodeHTMLEntities = __sp.decodeHtmlEntities //ensure consistent casing scheme of 'HTML'
-
-
-//******************************************************************************
-// Set the constructor. Without this, string.js objects are instances of
-// Object instead of S.
-//******************************************************************************
-
- __sp.constructor = S;
-
-
-/*************************************
-/* Private Functions
-/*************************************/
-
- function getNativeStringProperties() {
- var names = getNativeStringPropertyNames();
- var retObj = {};
-
- for (var i = 0; i < names.length; ++i) {
- var name = names[i];
- if (name === 'to' || name === 'toEnd') continue; // get rid of the shelljs prototype messup
- var func = __nsp[name];
- try {
- var type = typeof func.apply('teststring');
- retObj[name] = type;
- } catch (e) {}
- }
- return retObj;
- }
-
- function getNativeStringPropertyNames() {
- var results = [];
- if (Object.getOwnPropertyNames) {
- results = Object.getOwnPropertyNames(__nsp);
- results.splice(results.indexOf('valueOf'), 1);
- results.splice(results.indexOf('toString'), 1);
- return results;
- } else { //meant for legacy cruft, this could probably be made more efficient
- var stringNames = {};
- var objectNames = [];
- for (var name in String.prototype)
- stringNames[name] = name;
-
- for (var name in Object.prototype)
- delete stringNames[name];
-
- //stringNames['toString'] = 'toString'; //this was deleted with the rest of the object names
- for (var name in stringNames) {
- results.push(name);
- }
- return results;
- }
- }
-
- function Export(str) {
- return new S(str);
- };
-
- //attach exports to StringJSWrapper
- Export.extendPrototype = extendPrototype;
- Export.restorePrototype = restorePrototype;
- Export.VERSION = VERSION;
- Export.TMPL_OPEN = '{{';
- Export.TMPL_CLOSE = '}}';
- Export.ENTITIES = ENTITIES;
-
-
-
-/*************************************
-/* Exports
-/*************************************/
-
- if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
- module.exports = Export;
-
- } else {
-
- if(typeof define === "function" && define.amd) {
- define([], function() {
- return Export;
- });
- } else {
- window.S = Export;
- }
- }
-
-
-/*************************************
-/* 3rd Party Private Functions
-/*************************************/
-
- //from sugar.js
- function multiArgs(args, fn) {
- var result = [], i;
- for(i = 0; i < args.length; i++) {
- result.push(args[i]);
- if(fn) fn.call(args, args[i], i);
- }
- return result;
- }
-
- //from underscore.string
- var escapeChars = {
- lt: '<',
- gt: '>',
- quot: '"',
- apos: "'",
- amp: '&'
- };
-
- function escapeRegExp (s) {
- // most part from https://github.com/skulpt/skulpt/blob/ecaf75e69c2e539eff124b2ab45df0b01eaf2295/src/str.js#L242
- var c;
- var i;
- var ret = [];
- var re = /^[A-Za-z0-9]+$/;
- s = ensureString(s);
- for (i = 0; i < s.length; ++i) {
- c = s.charAt(i);
-
- if (re.test(c)) {
- ret.push(c);
- }
- else {
- if (c === "\\000") {
- ret.push("\\000");
- }
- else {
- ret.push("\\" + c);
- }
- }
- }
- return ret.join("");
- }
-
- function ensureString(string) {
- return string == null ? '' : '' + string;
- }
-
- //from underscore.string
- var reversedEscapeChars = {};
- for(var key in escapeChars){ reversedEscapeChars[escapeChars[key]] = key; }
-
- ENTITIES = {
- "amp" : "&",
- "gt" : ">",
- "lt" : "<",
- "quot" : "\"",
- "apos" : "'",
- "AElig" : 198,
- "Aacute" : 193,
- "Acirc" : 194,
- "Agrave" : 192,
- "Aring" : 197,
- "Atilde" : 195,
- "Auml" : 196,
- "Ccedil" : 199,
- "ETH" : 208,
- "Eacute" : 201,
- "Ecirc" : 202,
- "Egrave" : 200,
- "Euml" : 203,
- "Iacute" : 205,
- "Icirc" : 206,
- "Igrave" : 204,
- "Iuml" : 207,
- "Ntilde" : 209,
- "Oacute" : 211,
- "Ocirc" : 212,
- "Ograve" : 210,
- "Oslash" : 216,
- "Otilde" : 213,
- "Ouml" : 214,
- "THORN" : 222,
- "Uacute" : 218,
- "Ucirc" : 219,
- "Ugrave" : 217,
- "Uuml" : 220,
- "Yacute" : 221,
- "aacute" : 225,
- "acirc" : 226,
- "aelig" : 230,
- "agrave" : 224,
- "aring" : 229,
- "atilde" : 227,
- "auml" : 228,
- "ccedil" : 231,
- "eacute" : 233,
- "ecirc" : 234,
- "egrave" : 232,
- "eth" : 240,
- "euml" : 235,
- "iacute" : 237,
- "icirc" : 238,
- "igrave" : 236,
- "iuml" : 239,
- "ntilde" : 241,
- "oacute" : 243,
- "ocirc" : 244,
- "ograve" : 242,
- "oslash" : 248,
- "otilde" : 245,
- "ouml" : 246,
- "szlig" : 223,
- "thorn" : 254,
- "uacute" : 250,
- "ucirc" : 251,
- "ugrave" : 249,
- "uuml" : 252,
- "yacute" : 253,
- "yuml" : 255,
- "copy" : 169,
- "reg" : 174,
- "nbsp" : 160,
- "iexcl" : 161,
- "cent" : 162,
- "pound" : 163,
- "curren" : 164,
- "yen" : 165,
- "brvbar" : 166,
- "sect" : 167,
- "uml" : 168,
- "ordf" : 170,
- "laquo" : 171,
- "not" : 172,
- "shy" : 173,
- "macr" : 175,
- "deg" : 176,
- "plusmn" : 177,
- "sup1" : 185,
- "sup2" : 178,
- "sup3" : 179,
- "acute" : 180,
- "micro" : 181,
- "para" : 182,
- "middot" : 183,
- "cedil" : 184,
- "ordm" : 186,
- "raquo" : 187,
- "frac14" : 188,
- "frac12" : 189,
- "frac34" : 190,
- "iquest" : 191,
- "times" : 215,
- "divide" : 247,
- "OElig;" : 338,
- "oelig;" : 339,
- "Scaron;" : 352,
- "scaron;" : 353,
- "Yuml;" : 376,
- "fnof;" : 402,
- "circ;" : 710,
- "tilde;" : 732,
- "Alpha;" : 913,
- "Beta;" : 914,
- "Gamma;" : 915,
- "Delta;" : 916,
- "Epsilon;" : 917,
- "Zeta;" : 918,
- "Eta;" : 919,
- "Theta;" : 920,
- "Iota;" : 921,
- "Kappa;" : 922,
- "Lambda;" : 923,
- "Mu;" : 924,
- "Nu;" : 925,
- "Xi;" : 926,
- "Omicron;" : 927,
- "Pi;" : 928,
- "Rho;" : 929,
- "Sigma;" : 931,
- "Tau;" : 932,
- "Upsilon;" : 933,
- "Phi;" : 934,
- "Chi;" : 935,
- "Psi;" : 936,
- "Omega;" : 937,
- "alpha;" : 945,
- "beta;" : 946,
- "gamma;" : 947,
- "delta;" : 948,
- "epsilon;" : 949,
- "zeta;" : 950,
- "eta;" : 951,
- "theta;" : 952,
- "iota;" : 953,
- "kappa;" : 954,
- "lambda;" : 955,
- "mu;" : 956,
- "nu;" : 957,
- "xi;" : 958,
- "omicron;" : 959,
- "pi;" : 960,
- "rho;" : 961,
- "sigmaf;" : 962,
- "sigma;" : 963,
- "tau;" : 964,
- "upsilon;" : 965,
- "phi;" : 966,
- "chi;" : 967,
- "psi;" : 968,
- "omega;" : 969,
- "thetasym;" : 977,
- "upsih;" : 978,
- "piv;" : 982,
- "ensp;" : 8194,
- "emsp;" : 8195,
- "thinsp;" : 8201,
- "zwnj;" : 8204,
- "zwj;" : 8205,
- "lrm;" : 8206,
- "rlm;" : 8207,
- "ndash;" : 8211,
- "mdash;" : 8212,
- "lsquo;" : 8216,
- "rsquo;" : 8217,
- "sbquo;" : 8218,
- "ldquo;" : 8220,
- "rdquo;" : 8221,
- "bdquo;" : 8222,
- "dagger;" : 8224,
- "Dagger;" : 8225,
- "bull;" : 8226,
- "hellip;" : 8230,
- "permil;" : 8240,
- "prime;" : 8242,
- "Prime;" : 8243,
- "lsaquo;" : 8249,
- "rsaquo;" : 8250,
- "oline;" : 8254,
- "frasl;" : 8260,
- "euro;" : 8364,
- "image;" : 8465,
- "weierp;" : 8472,
- "real;" : 8476,
- "trade;" : 8482,
- "alefsym;" : 8501,
- "larr;" : 8592,
- "uarr;" : 8593,
- "rarr;" : 8594,
- "darr;" : 8595,
- "harr;" : 8596,
- "crarr;" : 8629,
- "lArr;" : 8656,
- "uArr;" : 8657,
- "rArr;" : 8658,
- "dArr;" : 8659,
- "hArr;" : 8660,
- "forall;" : 8704,
- "part;" : 8706,
- "exist;" : 8707,
- "empty;" : 8709,
- "nabla;" : 8711,
- "isin;" : 8712,
- "notin;" : 8713,
- "ni;" : 8715,
- "prod;" : 8719,
- "sum;" : 8721,
- "minus;" : 8722,
- "lowast;" : 8727,
- "radic;" : 8730,
- "prop;" : 8733,
- "infin;" : 8734,
- "ang;" : 8736,
- "and;" : 8743,
- "or;" : 8744,
- "cap;" : 8745,
- "cup;" : 8746,
- "int;" : 8747,
- "there4;" : 8756,
- "sim;" : 8764,
- "cong;" : 8773,
- "asymp;" : 8776,
- "ne;" : 8800,
- "equiv;" : 8801,
- "le;" : 8804,
- "ge;" : 8805,
- "sub;" : 8834,
- "sup;" : 8835,
- "nsub;" : 8836,
- "sube;" : 8838,
- "supe;" : 8839,
- "oplus;" : 8853,
- "otimes;" : 8855,
- "perp;" : 8869,
- "sdot;" : 8901,
- "lceil;" : 8968,
- "rceil;" : 8969,
- "lfloor;" : 8970,
- "rfloor;" : 8971,
- "lang;" : 9001,
- "rang;" : 9002,
- "loz;" : 9674,
- "spades;" : 9824,
- "clubs;" : 9827,
- "hearts;" : 9829,
- "diams;" : 9830
- }
-
-
-}).call(this);
-
-},{"./_count":409,"./_splitLeft":410,"./_splitRight":411}],413:[function(require,module,exports){
-module.exports=/[\0-\x1F\x7F-\x9F]/
-},{}],414:[function(require,module,exports){
-module.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/
-},{}],415:[function(require,module,exports){
-module.exports=/[!-#%-\*,-/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E44\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/
-},{}],416:[function(require,module,exports){
-module.exports=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/
-},{}],417:[function(require,module,exports){
-'use strict';
-
-exports.Any = require('./properties/Any/regex');
-exports.Cc = require('./categories/Cc/regex');
-exports.Cf = require('./categories/Cf/regex');
-exports.P = require('./categories/P/regex');
-exports.Z = require('./categories/Z/regex');
-
-},{"./categories/Cc/regex":413,"./categories/Cf/regex":414,"./categories/P/regex":415,"./categories/Z/regex":416,"./properties/Any/regex":418}],418:[function(require,module,exports){
-module.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/
-},{}]},{},[6]);
diff --git a/js/editor.js.map b/js/editor.js.map
deleted file mode 100644
index 64bf998..0000000
--- a/js/editor.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"editor.js","sourceRoot":"","sources":["Renderer.ts","PreviewPlugin.ts","editor.ts"],"names":[],"mappings":";;;IAIA;QAGI;YAAA,iBAwCC;YAvCG,IAAI,CAAC,QAAQ,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAEtC,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC5D,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,UAAC,IAAI,EAAE,KAAK,EAAE,IAAI;gBACpC,IAAI,GAAG,GAAG,YAAY,GAAG,KAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,GAAG,CAAC;gBACpE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,GAAG,IAAI,UAAU,GAAG,KAAK,GAAG,GAAG,CAAC;gBACpC,CAAC;gBACD,GAAG,IAAI,GAAG,CAAC;gBACX,MAAM,CAAC,GAAG,CAAC;YACf,CAAC,CAAC;YACF,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,UAAC,IAAI,EAAE,KAAK,EAAE,IAAI;gBACnC,IAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;gBACjD,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;gBAC3C,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;gBACnB,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;oBAC/C,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,sCAAsC,CAAC,CAAC;gBAC7E,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,MAAM,CAAC,QAAQ,CAAC;gBACpB,CAAC;YACL,CAAC,CAAC;YAEF,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,UAAC,IAAI,EAAE,QAAQ;gBAChC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;oBACjF,MAAM,CAAC,uBAAuB,GAAG,IAAI,GAAG,QAAQ,CAAC;gBACrD,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,8DAA8D;oBAC9D,IAAM,SAAS,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;oBAC7D,2CAA2C;oBAC3C,IAAM,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC;oBAC5E,iDAAiD;oBACjD,MAAM,CAAC,yBAAyB,GAAG,QAAQ,GAAG,IAAI,GAAG,WAAW,GAAG,eAAe,CAAC;gBACvF,CAAC;YACL,CAAC,CAAC;YAEF,MAAM,CAAC,UAAU,CAAC;gBACd,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,YAAY,EAAE,KAAK;aACtB,CAAC,CAAC;QACP,CAAC;QAED,8BAAW,GAAX,UAAY,IAAY;YACpB,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;gBAC9B,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBACtB,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;YAChD,CAAC;YAED,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC;QAED,yBAAM,GAAN,UAAO,IAAY;YACf,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;gBACR,MAAM,CAAC,IAAI,CAAC;YAChB,CAAC;YACD,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;gBACrG,MAAM,CAAC,IAAI,CAAC;YAChB,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;oBAC5B,EAAE,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,IAAI,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;wBAC7D,IAAI,GAAG,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;oBACtD,CAAC;oBAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC;wBACnE,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,iBAAiB,GAAG,GAAG,GAAG,IAAI,CAAC;oBACjE,CAAC;gBACL,CAAC;gBACD,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;YAClE,CAAC;QACL,CAAC;QAED,6BAAU,GAAV,UAAW,IAAY,EAAE,OAAO;YAC5B,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YAC5C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,wCAAwC;YACxC,oBAAoB;YACpB,oDAAoD;YACpD,kDAAkD;YAClD,QAAQ;YACR,MAAM;YACN,kBAAkB;QACtB,CAAC;QACL,eAAC;IAAD,CAAC,AAnFD,IAmFC;IAnFY,4BAAQ;;;;;ICCrB;QAAA;YACI,aAAQ,GAAa,IAAI,mBAAQ,EAAE,CAAC;YAEpC,YAAO,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC;QAC5E,CAAC;QAAD,oBAAC;IAAD,CAAC,AAJD,IAIC;IAJY,sCAAa;;;;;ICH1B,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,EAAE,CAAC,CAAC,GAAG,CAAC,gBAAgB,IAAI,GAAG,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC,CAAC;YACrE,GAAG,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,eAAe,EAAE,IAAI,6BAAa,EAAE,CAAC,CAAC;QACrF,CAAC;IACL,CAAC,CAAC,CAAC;IAEH;QAAA;YAAA,iBAgCC;YA3BG,kBAAa,GAAyB,UAAC,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,QAAQ;gBACtF,IAAM,YAAY,GAAI,mBAAmB,CAAC,MAAM,EAAE,CAAC,KAAK,EAAa,GAAG,EAAE,CAAC,CAAE,4BAA4B;gBACzG,IAAM,aAAa,GAAG,YAAY,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;gBAE9C,CAAC,CAAC,IAAI,CACF,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE;oBAC5C,gCAAgC;iBACnC,CAAC,EACF,KAAI,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAC3C,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,OAAO;oBACvB,aAAa,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;oBAClD,mBAAmB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;oBACtC,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;oBACrC,IAAM,YAAY,GAAG,CAAC,CAAC,2CAA2C,CAAC,CAAC;oBACpE,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;oBACnD,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC;oBAC9C,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;oBACnC,mBAAmB,CAAC,GAAG,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;gBACzD,CAAC,CAAC,IAAI,CAAC,KAAI,CAAC,EAAE;oBACV,QAAQ,EAAE,CAAC;gBACf,CAAC,CAAC,CAAC;YACP,CAAC,CAAC;QAMN,CAAC;QA/BG,+BAAM,GAAN,UAAO,OAAO;YACV,OAAO,CAAC,iBAAiB,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QACnE,CAAC;QAyBD,uCAAc,GAAd,UAAe,IAAY;YACvB,IAAM,GAAG,GAAG,EAAE,CAAC,gBAAgB,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;YAChD,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC;QACL,qBAAC;IAAD,CAAC,AAhCD,IAgCC;IAED,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,iCAAiC,EAAE,IAAI,cAAc,EAAE,CAAC,CAAC"} \ No newline at end of file
diff --git a/js/package-lock.json b/package-lock.json
index 35780f3..a260722 100644
--- a/js/package-lock.json
+++ b/package-lock.json
@@ -26,6 +26,15 @@
"integrity": "sha512-phGgIOAnmTr8SD1epgkHS3Jkfh0YDKjveeTHf/TmR+Dhq2DtonabEd6EBi2qG6o4xS0Nq0Jw4psI/IPKiUw2qg==",
"dev": true
},
+ "@types/markdown-it-anchor": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/@types/markdown-it-anchor/-/markdown-it-anchor-4.0.1.tgz",
+ "integrity": "sha512-+lt0nCTUFljQSLmfEeH4mpFuj5BL1qHPtZfzkGbmNyn6hxSvwHYwhCdbZG7NVpThPmQiOoKuLdq4H5pldhuNBg==",
+ "dev": true,
+ "requires": {
+ "@types/markdown-it": "0.0.3"
+ }
+ },
"@types/underscore": {
"version": "1.8.2",
"resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.8.2.tgz",
@@ -38,6 +47,61 @@
"integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=",
"dev": true
},
+ "acorn-dynamic-import": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz",
+ "integrity": "sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ=",
+ "dev": true,
+ "requires": {
+ "acorn": "4.0.13"
+ }
+ },
+ "ajv": {
+ "version": "5.2.2",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.2.2.tgz",
+ "integrity": "sha1-R8aNaehvXZUxA7AHSpQw3GPaXjk=",
+ "dev": true,
+ "requires": {
+ "co": "4.6.0",
+ "fast-deep-equal": "1.0.0",
+ "json-schema-traverse": "0.3.1",
+ "json-stable-stringify": "1.0.1"
+ },
+ "dependencies": {
+ "json-stable-stringify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
+ "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=",
+ "dev": true,
+ "requires": {
+ "jsonify": "0.0.0"
+ }
+ }
+ }
+ },
+ "ajv-keywords": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.0.tgz",
+ "integrity": "sha1-opbhf3v658HOT34N5T0pyzIWLfA=",
+ "dev": true
+ },
+ "align-text": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
+ "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
+ "dev": true,
+ "requires": {
+ "kind-of": "3.2.2",
+ "longest": "1.0.1",
+ "repeat-string": "1.6.1"
+ }
+ },
+ "ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+ "dev": true
+ },
"ansi-styles": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
@@ -46,12 +110,6 @@
"color-convert": "1.9.0"
}
},
- "any-promise": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
- "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=",
- "dev": true
- },
"anymatch": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz",
@@ -138,12 +196,591 @@
"acorn": "4.0.13"
}
},
+ "async": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/async/-/async-2.5.0.tgz",
+ "integrity": "sha512-e+lJAJeNWuPCNyxZKOBdaJGyLGHugXVQtrAwtuAe2vhxTYxFTKE73p8JuTmdH0qdQZtDvI4dhJwjZc5zsfIsYw==",
+ "dev": true,
+ "requires": {
+ "lodash": "4.17.4"
+ }
+ },
"async-each": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz",
"integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=",
"dev": true
},
+ "babel-code-frame": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
+ "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
+ "dev": true,
+ "requires": {
+ "chalk": "1.1.3",
+ "esutils": "2.0.2",
+ "js-tokens": "3.0.2"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
+ "dev": true
+ },
+ "chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "2.2.1",
+ "escape-string-regexp": "1.0.5",
+ "has-ansi": "2.0.0",
+ "strip-ansi": "3.0.1",
+ "supports-color": "2.0.0"
+ }
+ },
+ "supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+ "dev": true
+ }
+ }
+ },
+ "babel-core": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz",
+ "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=",
+ "dev": true,
+ "requires": {
+ "babel-code-frame": "6.26.0",
+ "babel-generator": "6.26.0",
+ "babel-helpers": "6.24.1",
+ "babel-messages": "6.23.0",
+ "babel-register": "6.26.0",
+ "babel-runtime": "6.26.0",
+ "babel-template": "6.26.0",
+ "babel-traverse": "6.26.0",
+ "babel-types": "6.26.0",
+ "babylon": "6.18.0",
+ "convert-source-map": "1.5.0",
+ "debug": "2.6.8",
+ "json5": "0.5.1",
+ "lodash": "4.17.4",
+ "minimatch": "3.0.4",
+ "path-is-absolute": "1.0.1",
+ "private": "0.1.7",
+ "slash": "1.0.0",
+ "source-map": "0.5.7"
+ }
+ },
+ "babel-generator": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.0.tgz",
+ "integrity": "sha1-rBriAHC3n248odMmlhMFN3TyDcU=",
+ "dev": true,
+ "requires": {
+ "babel-messages": "6.23.0",
+ "babel-runtime": "6.26.0",
+ "babel-types": "6.26.0",
+ "detect-indent": "4.0.0",
+ "jsesc": "1.3.0",
+ "lodash": "4.17.4",
+ "source-map": "0.5.7",
+ "trim-right": "1.0.1"
+ }
+ },
+ "babel-helper-call-delegate": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz",
+ "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=",
+ "dev": true,
+ "requires": {
+ "babel-helper-hoist-variables": "6.24.1",
+ "babel-runtime": "6.26.0",
+ "babel-traverse": "6.26.0",
+ "babel-types": "6.26.0"
+ }
+ },
+ "babel-helper-define-map": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz",
+ "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=",
+ "dev": true,
+ "requires": {
+ "babel-helper-function-name": "6.24.1",
+ "babel-runtime": "6.26.0",
+ "babel-types": "6.26.0",
+ "lodash": "4.17.4"
+ }
+ },
+ "babel-helper-function-name": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz",
+ "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=",
+ "dev": true,
+ "requires": {
+ "babel-helper-get-function-arity": "6.24.1",
+ "babel-runtime": "6.26.0",
+ "babel-template": "6.26.0",
+ "babel-traverse": "6.26.0",
+ "babel-types": "6.26.0"
+ }
+ },
+ "babel-helper-get-function-arity": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz",
+ "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0",
+ "babel-types": "6.26.0"
+ }
+ },
+ "babel-helper-hoist-variables": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz",
+ "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0",
+ "babel-types": "6.26.0"
+ }
+ },
+ "babel-helper-optimise-call-expression": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz",
+ "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0",
+ "babel-types": "6.26.0"
+ }
+ },
+ "babel-helper-regex": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz",
+ "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0",
+ "babel-types": "6.26.0",
+ "lodash": "4.17.4"
+ }
+ },
+ "babel-helper-replace-supers": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz",
+ "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=",
+ "dev": true,
+ "requires": {
+ "babel-helper-optimise-call-expression": "6.24.1",
+ "babel-messages": "6.23.0",
+ "babel-runtime": "6.26.0",
+ "babel-template": "6.26.0",
+ "babel-traverse": "6.26.0",
+ "babel-types": "6.26.0"
+ }
+ },
+ "babel-helpers": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz",
+ "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0",
+ "babel-template": "6.26.0"
+ }
+ },
+ "babel-loader": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.2.tgz",
+ "integrity": "sha512-jRwlFbINAeyDStqK6Dd5YuY0k5YuzQUvlz2ZamuXrXmxav3pNqe9vfJ402+2G+OmlJSXxCOpB6Uz0INM7RQe2A==",
+ "dev": true,
+ "requires": {
+ "find-cache-dir": "1.0.0",
+ "loader-utils": "1.1.0",
+ "mkdirp": "0.5.1"
+ }
+ },
+ "babel-messages": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz",
+ "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0"
+ }
+ },
+ "babel-plugin-check-es2015-constants": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz",
+ "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-arrow-functions": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz",
+ "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-block-scoped-functions": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz",
+ "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-block-scoping": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz",
+ "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0",
+ "babel-template": "6.26.0",
+ "babel-traverse": "6.26.0",
+ "babel-types": "6.26.0",
+ "lodash": "4.17.4"
+ }
+ },
+ "babel-plugin-transform-es2015-classes": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz",
+ "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=",
+ "dev": true,
+ "requires": {
+ "babel-helper-define-map": "6.26.0",
+ "babel-helper-function-name": "6.24.1",
+ "babel-helper-optimise-call-expression": "6.24.1",
+ "babel-helper-replace-supers": "6.24.1",
+ "babel-messages": "6.23.0",
+ "babel-runtime": "6.26.0",
+ "babel-template": "6.26.0",
+ "babel-traverse": "6.26.0",
+ "babel-types": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-computed-properties": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz",
+ "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0",
+ "babel-template": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-destructuring": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz",
+ "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-duplicate-keys": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz",
+ "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0",
+ "babel-types": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-for-of": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz",
+ "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-function-name": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz",
+ "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=",
+ "dev": true,
+ "requires": {
+ "babel-helper-function-name": "6.24.1",
+ "babel-runtime": "6.26.0",
+ "babel-types": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-literals": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz",
+ "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-modules-amd": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz",
+ "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-transform-es2015-modules-commonjs": "6.26.0",
+ "babel-runtime": "6.26.0",
+ "babel-template": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-modules-commonjs": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz",
+ "integrity": "sha1-DYOUApt9xqvhqX7xgeAHWN0uXYo=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-transform-strict-mode": "6.24.1",
+ "babel-runtime": "6.26.0",
+ "babel-template": "6.26.0",
+ "babel-types": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-modules-systemjs": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz",
+ "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=",
+ "dev": true,
+ "requires": {
+ "babel-helper-hoist-variables": "6.24.1",
+ "babel-runtime": "6.26.0",
+ "babel-template": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-modules-umd": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz",
+ "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-transform-es2015-modules-amd": "6.24.1",
+ "babel-runtime": "6.26.0",
+ "babel-template": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-object-super": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz",
+ "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=",
+ "dev": true,
+ "requires": {
+ "babel-helper-replace-supers": "6.24.1",
+ "babel-runtime": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-parameters": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz",
+ "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=",
+ "dev": true,
+ "requires": {
+ "babel-helper-call-delegate": "6.24.1",
+ "babel-helper-get-function-arity": "6.24.1",
+ "babel-runtime": "6.26.0",
+ "babel-template": "6.26.0",
+ "babel-traverse": "6.26.0",
+ "babel-types": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-shorthand-properties": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz",
+ "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0",
+ "babel-types": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-spread": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz",
+ "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-sticky-regex": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz",
+ "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=",
+ "dev": true,
+ "requires": {
+ "babel-helper-regex": "6.26.0",
+ "babel-runtime": "6.26.0",
+ "babel-types": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-template-literals": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz",
+ "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-typeof-symbol": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz",
+ "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-unicode-regex": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz",
+ "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=",
+ "dev": true,
+ "requires": {
+ "babel-helper-regex": "6.26.0",
+ "babel-runtime": "6.26.0",
+ "regexpu-core": "2.0.0"
+ }
+ },
+ "babel-plugin-transform-regenerator": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz",
+ "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=",
+ "dev": true,
+ "requires": {
+ "regenerator-transform": "0.10.1"
+ }
+ },
+ "babel-plugin-transform-strict-mode": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz",
+ "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0",
+ "babel-types": "6.26.0"
+ }
+ },
+ "babel-preset-es2015": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz",
+ "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-check-es2015-constants": "6.22.0",
+ "babel-plugin-transform-es2015-arrow-functions": "6.22.0",
+ "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0",
+ "babel-plugin-transform-es2015-block-scoping": "6.26.0",
+ "babel-plugin-transform-es2015-classes": "6.24.1",
+ "babel-plugin-transform-es2015-computed-properties": "6.24.1",
+ "babel-plugin-transform-es2015-destructuring": "6.23.0",
+ "babel-plugin-transform-es2015-duplicate-keys": "6.24.1",
+ "babel-plugin-transform-es2015-for-of": "6.23.0",
+ "babel-plugin-transform-es2015-function-name": "6.24.1",
+ "babel-plugin-transform-es2015-literals": "6.22.0",
+ "babel-plugin-transform-es2015-modules-amd": "6.24.1",
+ "babel-plugin-transform-es2015-modules-commonjs": "6.26.0",
+ "babel-plugin-transform-es2015-modules-systemjs": "6.24.1",
+ "babel-plugin-transform-es2015-modules-umd": "6.24.1",
+ "babel-plugin-transform-es2015-object-super": "6.24.1",
+ "babel-plugin-transform-es2015-parameters": "6.24.1",
+ "babel-plugin-transform-es2015-shorthand-properties": "6.24.1",
+ "babel-plugin-transform-es2015-spread": "6.22.0",
+ "babel-plugin-transform-es2015-sticky-regex": "6.24.1",
+ "babel-plugin-transform-es2015-template-literals": "6.22.0",
+ "babel-plugin-transform-es2015-typeof-symbol": "6.23.0",
+ "babel-plugin-transform-es2015-unicode-regex": "6.24.1",
+ "babel-plugin-transform-regenerator": "6.26.0"
+ }
+ },
+ "babel-register": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz",
+ "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=",
+ "dev": true,
+ "requires": {
+ "babel-core": "6.26.0",
+ "babel-runtime": "6.26.0",
+ "core-js": "2.5.0",
+ "home-or-tmp": "2.0.0",
+ "lodash": "4.17.4",
+ "mkdirp": "0.5.1",
+ "source-map-support": "0.4.16"
+ }
+ },
+ "babel-runtime": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
+ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
+ "dev": true,
+ "requires": {
+ "core-js": "2.5.0",
+ "regenerator-runtime": "0.11.0"
+ }
+ },
+ "babel-template": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz",
+ "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0",
+ "babel-traverse": "6.26.0",
+ "babel-types": "6.26.0",
+ "babylon": "6.18.0",
+ "lodash": "4.17.4"
+ }
+ },
+ "babel-traverse": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz",
+ "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=",
+ "dev": true,
+ "requires": {
+ "babel-code-frame": "6.26.0",
+ "babel-messages": "6.23.0",
+ "babel-runtime": "6.26.0",
+ "babel-types": "6.26.0",
+ "babylon": "6.18.0",
+ "debug": "2.6.8",
+ "globals": "9.18.0",
+ "invariant": "2.2.2",
+ "lodash": "4.17.4"
+ }
+ },
+ "babel-types": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz",
+ "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0",
+ "esutils": "2.0.2",
+ "lodash": "4.17.4",
+ "to-fast-properties": "1.0.3"
+ }
+ },
+ "babylon": {
+ "version": "6.18.0",
+ "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz",
+ "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==",
+ "dev": true
+ },
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
@@ -156,6 +793,12 @@
"integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==",
"dev": true
},
+ "big.js": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.1.3.tgz",
+ "integrity": "sha1-TK2iGTZS6zyp7I5VyQFWacmAaXg=",
+ "dev": true
+ },
"binary-extensions": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.10.0.tgz",
@@ -365,6 +1008,12 @@
"integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=",
"dev": true
},
+ "builtin-modules": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
+ "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
+ "dev": true
+ },
"builtin-status-codes": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz",
@@ -377,6 +1026,22 @@
"integrity": "sha1-0JxLUoAKpMB44t2BqGmqyQ0uVOc=",
"dev": true
},
+ "camelcase": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
+ "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=",
+ "dev": true
+ },
+ "center-align": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz",
+ "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=",
+ "dev": true,
+ "requires": {
+ "align-text": "0.1.4",
+ "lazy-cache": "1.0.4"
+ }
+ },
"chalk": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
@@ -413,6 +1078,29 @@
"safe-buffer": "5.1.1"
}
},
+ "cliui": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz",
+ "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=",
+ "dev": true,
+ "requires": {
+ "center-align": "0.1.3",
+ "right-align": "0.1.3",
+ "wordwrap": "0.0.2"
+ }
+ },
+ "co": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
+ "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=",
+ "dev": true
+ },
+ "code-point-at": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
+ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
+ "dev": true
+ },
"color-convert": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz",
@@ -446,10 +1134,10 @@
}
}
},
- "commander": {
- "version": "2.11.0",
- "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz",
- "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==",
+ "commondir": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
+ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
"dev": true
},
"concat-map": {
@@ -512,6 +1200,12 @@
"integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=",
"dev": true
},
+ "core-js": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.0.tgz",
+ "integrity": "sha1-VpwFCRi+ZIazg3VSAorgRmtxcIY=",
+ "dev": true
+ },
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
@@ -554,6 +1248,17 @@
"sha.js": "2.4.8"
}
},
+ "cross-spawn": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
+ "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
+ "dev": true,
+ "requires": {
+ "lru-cache": "4.1.1",
+ "shebang-command": "1.2.0",
+ "which": "1.3.0"
+ }
+ },
"crypto-browserify": {
"version": "3.11.1",
"resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.1.tgz",
@@ -572,6 +1277,15 @@
"randombytes": "2.0.5"
}
},
+ "d": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz",
+ "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=",
+ "dev": true,
+ "requires": {
+ "es5-ext": "0.10.30"
+ }
+ },
"d3": {
"version": "3.5.17",
"resolved": "https://registry.npmjs.org/d3/-/d3-3.5.17.tgz",
@@ -620,6 +1334,21 @@
"integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=",
"dev": true
},
+ "debug": {
+ "version": "2.6.8",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz",
+ "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "decamelize": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
+ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
+ "dev": true
+ },
"defined": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz",
@@ -648,6 +1377,15 @@
"minimalistic-assert": "1.0.0"
}
},
+ "detect-indent": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz",
+ "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=",
+ "dev": true,
+ "requires": {
+ "repeating": "2.0.1"
+ }
+ },
"detective": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/detective/-/detective-4.5.0.tgz",
@@ -699,11 +1437,38 @@
"minimalistic-crypto-utils": "1.0.1"
}
},
+ "emojis-list": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz",
+ "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=",
+ "dev": true
+ },
+ "enhanced-resolve": {
+ "version": "3.4.1",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz",
+ "integrity": "sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "4.1.11",
+ "memory-fs": "0.4.1",
+ "object-assign": "4.1.1",
+ "tapable": "0.2.8"
+ }
+ },
"entities": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
"integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA="
},
+ "errno": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz",
+ "integrity": "sha1-uJbiOp5ei6M4cfyZar02NfyaHH0=",
+ "dev": true,
+ "requires": {
+ "prr": "0.0.0"
+ }
+ },
"error-ex": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz",
@@ -713,11 +1478,125 @@
"is-arrayish": "0.2.1"
}
},
+ "es5-ext": {
+ "version": "0.10.30",
+ "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.30.tgz",
+ "integrity": "sha1-cUGhaDZpfbq/qq7uQUlc4p9SyTk=",
+ "dev": true,
+ "requires": {
+ "es6-iterator": "2.0.1",
+ "es6-symbol": "3.1.1"
+ }
+ },
+ "es6-iterator": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz",
+ "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=",
+ "dev": true,
+ "requires": {
+ "d": "1.0.0",
+ "es5-ext": "0.10.30",
+ "es6-symbol": "3.1.1"
+ }
+ },
+ "es6-map": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz",
+ "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=",
+ "dev": true,
+ "requires": {
+ "d": "1.0.0",
+ "es5-ext": "0.10.30",
+ "es6-iterator": "2.0.1",
+ "es6-set": "0.1.5",
+ "es6-symbol": "3.1.1",
+ "event-emitter": "0.3.5"
+ }
+ },
+ "es6-set": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz",
+ "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=",
+ "dev": true,
+ "requires": {
+ "d": "1.0.0",
+ "es5-ext": "0.10.30",
+ "es6-iterator": "2.0.1",
+ "es6-symbol": "3.1.1",
+ "event-emitter": "0.3.5"
+ }
+ },
+ "es6-symbol": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz",
+ "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=",
+ "dev": true,
+ "requires": {
+ "d": "1.0.0",
+ "es5-ext": "0.10.30"
+ }
+ },
+ "es6-weak-map": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz",
+ "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=",
+ "dev": true,
+ "requires": {
+ "d": "1.0.0",
+ "es5-ext": "0.10.30",
+ "es6-iterator": "2.0.1",
+ "es6-symbol": "3.1.1"
+ }
+ },
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
+ "escope": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz",
+ "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=",
+ "dev": true,
+ "requires": {
+ "es6-map": "0.1.5",
+ "es6-weak-map": "2.0.2",
+ "esrecurse": "4.2.0",
+ "estraverse": "4.2.0"
+ }
+ },
+ "esrecurse": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz",
+ "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=",
+ "dev": true,
+ "requires": {
+ "estraverse": "4.2.0",
+ "object-assign": "4.1.1"
+ }
+ },
+ "estraverse": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
+ "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=",
+ "dev": true
+ },
+ "esutils": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
+ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
+ "dev": true
+ },
+ "event-emitter": {
+ "version": "0.3.5",
+ "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
+ "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=",
+ "dev": true,
+ "requires": {
+ "d": "1.0.0",
+ "es5-ext": "0.10.30"
+ }
+ },
"events": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz",
@@ -734,6 +1613,21 @@
"safe-buffer": "5.1.1"
}
},
+ "execa": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz",
+ "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=",
+ "dev": true,
+ "requires": {
+ "cross-spawn": "5.1.0",
+ "get-stream": "3.0.0",
+ "is-stream": "1.1.0",
+ "npm-run-path": "2.0.2",
+ "p-finally": "1.0.0",
+ "signal-exit": "3.0.2",
+ "strip-eof": "1.0.0"
+ }
+ },
"expand-brackets": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
@@ -752,12 +1646,6 @@
"fill-range": "2.2.3"
}
},
- "extend": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/extend/-/extend-1.3.0.tgz",
- "integrity": "sha1-0VFvsP9WJNLr+RI+odrFoZlABPg=",
- "dev": true
- },
"extglob": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz",
@@ -767,6 +1655,12 @@
"is-extglob": "1.0.0"
}
},
+ "fast-deep-equal": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz",
+ "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=",
+ "dev": true
+ },
"filename-regex": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz",
@@ -786,6 +1680,26 @@
"repeat-string": "1.6.1"
}
},
+ "find-cache-dir": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz",
+ "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=",
+ "dev": true,
+ "requires": {
+ "commondir": "1.0.1",
+ "make-dir": "1.0.0",
+ "pkg-dir": "2.0.0"
+ }
+ },
+ "find-up": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
+ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
+ "dev": true,
+ "requires": {
+ "locate-path": "2.0.0"
+ }
+ },
"for-in": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
@@ -813,6 +1727,18 @@
"integrity": "sha1-FhdnFMgBeY5Ojyz391KUZ7tKV3E=",
"dev": true
},
+ "get-caller-file": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz",
+ "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=",
+ "dev": true
+ },
+ "get-stream": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
+ "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
+ "dev": true
+ },
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
@@ -846,6 +1772,12 @@
"is-glob": "2.0.1"
}
},
+ "globals": {
+ "version": "9.18.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz",
+ "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==",
+ "dev": true
+ },
"graceful-fs": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
@@ -876,6 +1808,15 @@
"function-bind": "1.1.0"
}
},
+ "has-ansi": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
+ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "2.1.1"
+ }
+ },
"has-flag": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
@@ -921,6 +1862,22 @@
"minimalistic-crypto-utils": "1.0.1"
}
},
+ "home-or-tmp": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz",
+ "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=",
+ "dev": true,
+ "requires": {
+ "os-homedir": "1.0.2",
+ "os-tmpdir": "1.0.2"
+ }
+ },
+ "hosted-git-info": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz",
+ "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==",
+ "dev": true
+ },
"htmlescape": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz",
@@ -986,6 +1943,27 @@
"xtend": "4.0.1"
}
},
+ "interpret": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz",
+ "integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A=",
+ "dev": true
+ },
+ "invariant": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz",
+ "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=",
+ "dev": true,
+ "requires": {
+ "loose-envify": "1.3.1"
+ }
+ },
+ "invert-kv": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
+ "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=",
+ "dev": true
+ },
"is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
@@ -1007,6 +1985,15 @@
"integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=",
"dev": true
},
+ "is-builtin-module": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
+ "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
+ "dev": true,
+ "requires": {
+ "builtin-modules": "1.1.1"
+ }
+ },
"is-dotfile": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz",
@@ -1034,6 +2021,24 @@
"integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
"dev": true
},
+ "is-finite": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz",
+ "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=",
+ "dev": true,
+ "requires": {
+ "number-is-nan": "1.0.1"
+ }
+ },
+ "is-fullwidth-code-point": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
+ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
+ "dev": true,
+ "requires": {
+ "number-is-nan": "1.0.1"
+ }
+ },
"is-glob": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
@@ -1064,10 +2069,10 @@
"integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=",
"dev": true
},
- "is-utf8": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
- "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=",
+ "is-stream": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
+ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
"dev": true
},
"isarray": {
@@ -1090,6 +2095,30 @@
"isarray": "1.0.0"
}
},
+ "js-tokens": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
+ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
+ "dev": true
+ },
+ "jsesc": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
+ "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=",
+ "dev": true
+ },
+ "json-loader": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.7.tgz",
+ "integrity": "sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w==",
+ "dev": true
+ },
+ "json-schema-traverse": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
+ "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=",
+ "dev": true
+ },
"json-stable-stringify": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz",
@@ -1099,6 +2128,12 @@
"jsonify": "0.0.0"
}
},
+ "json5": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
+ "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=",
+ "dev": true
+ },
"jsonify": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
@@ -1157,6 +2192,21 @@
}
}
},
+ "lazy-cache": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz",
+ "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=",
+ "dev": true
+ },
+ "lcid": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
+ "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
+ "dev": true,
+ "requires": {
+ "invert-kv": "1.0.0"
+ }
+ },
"lexical-scope": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz",
@@ -1174,6 +2224,53 @@
"uc.micro": "1.0.3"
}
},
+ "load-json-file": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
+ "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "4.1.11",
+ "parse-json": "2.2.0",
+ "pify": "2.3.0",
+ "strip-bom": "3.0.0"
+ },
+ "dependencies": {
+ "strip-bom": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
+ "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
+ "dev": true
+ }
+ }
+ },
+ "loader-runner": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.0.tgz",
+ "integrity": "sha1-9IKuqC1UPgeSFwDVpG7yb9rGuKI=",
+ "dev": true
+ },
+ "loader-utils": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz",
+ "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=",
+ "dev": true,
+ "requires": {
+ "big.js": "3.1.3",
+ "emojis-list": "2.1.0",
+ "json5": "0.5.1"
+ }
+ },
+ "locate-path": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
+ "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
+ "dev": true,
+ "requires": {
+ "p-locate": "2.0.0",
+ "path-exists": "3.0.0"
+ }
+ },
"lodash": {
"version": "4.17.4",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
@@ -1195,6 +2292,40 @@
"integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=",
"dev": true
},
+ "longest": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
+ "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
+ "dev": true
+ },
+ "loose-envify": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz",
+ "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=",
+ "dev": true,
+ "requires": {
+ "js-tokens": "3.0.2"
+ }
+ },
+ "lru-cache": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz",
+ "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==",
+ "dev": true,
+ "requires": {
+ "pseudomap": "1.0.2",
+ "yallist": "2.1.2"
+ }
+ },
+ "make-dir": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.0.0.tgz",
+ "integrity": "sha1-l6ARdR6R3YfPre9Ygy67BJNt6Xg=",
+ "dev": true,
+ "requires": {
+ "pify": "2.3.0"
+ }
+ },
"markdown-it": {
"version": "8.4.0",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.0.tgz",
@@ -1288,6 +2419,25 @@
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
"integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4="
},
+ "mem": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz",
+ "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=",
+ "dev": true,
+ "requires": {
+ "mimic-fn": "1.1.0"
+ }
+ },
+ "memory-fs": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz",
+ "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=",
+ "dev": true,
+ "requires": {
+ "errno": "0.1.4",
+ "readable-stream": "2.3.3"
+ }
+ },
"mermaid": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/mermaid/-/mermaid-7.0.4.tgz",
@@ -1337,6 +2487,12 @@
"brorand": "1.1.0"
}
},
+ "mimic-fn": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz",
+ "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=",
+ "dev": true
+ },
"minimalistic-assert": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz",
@@ -1406,6 +2562,95 @@
"resolved": "https://registry.npmjs.org/moment/-/moment-2.18.1.tgz",
"integrity": "sha1-w2GT3Tzhwu7SrbfIAtu8d6gbHA8="
},
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ },
+ "node-libs-browser": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.0.0.tgz",
+ "integrity": "sha1-o6WeyXAkmFtG6Vg3lkb5bEthZkY=",
+ "dev": true,
+ "requires": {
+ "assert": "1.4.1",
+ "browserify-zlib": "0.1.4",
+ "buffer": "4.9.1",
+ "console-browserify": "1.1.0",
+ "constants-browserify": "1.0.0",
+ "crypto-browserify": "3.11.1",
+ "domain-browser": "1.1.7",
+ "events": "1.1.1",
+ "https-browserify": "0.0.1",
+ "os-browserify": "0.2.1",
+ "path-browserify": "0.0.0",
+ "process": "0.11.10",
+ "punycode": "1.4.1",
+ "querystring-es3": "0.2.1",
+ "readable-stream": "2.3.3",
+ "stream-browserify": "2.0.1",
+ "stream-http": "2.7.2",
+ "string_decoder": "0.10.31",
+ "timers-browserify": "2.0.4",
+ "tty-browserify": "0.0.0",
+ "url": "0.11.0",
+ "util": "0.10.3",
+ "vm-browserify": "0.0.4"
+ },
+ "dependencies": {
+ "buffer": {
+ "version": "4.9.1",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz",
+ "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=",
+ "dev": true,
+ "requires": {
+ "base64-js": "1.2.1",
+ "ieee754": "1.1.8",
+ "isarray": "1.0.0"
+ }
+ },
+ "https-browserify": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz",
+ "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=",
+ "dev": true
+ },
+ "os-browserify": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.2.1.tgz",
+ "integrity": "sha1-Y/xMzuXS13Y9Jrv4YBB45sLgBE8=",
+ "dev": true
+ },
+ "string_decoder": {
+ "version": "0.10.31",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+ "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
+ "dev": true
+ },
+ "timers-browserify": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.4.tgz",
+ "integrity": "sha512-uZYhyU3EX8O7HQP+J9fTVYwsq90Vr68xPEFo7yrVImIxYvHgukBEgOB/SgGoorWVTzGM/3Z+wUNnboA4M8jWrg==",
+ "dev": true,
+ "requires": {
+ "setimmediate": "1.0.5"
+ }
+ }
+ }
+ },
+ "normalize-package-data": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
+ "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==",
+ "dev": true,
+ "requires": {
+ "hosted-git-info": "2.5.0",
+ "is-builtin-module": "1.0.0",
+ "semver": "5.4.1",
+ "validate-npm-package-license": "3.0.1"
+ }
+ },
"normalize-path": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
@@ -1415,6 +2660,21 @@
"remove-trailing-separator": "1.1.0"
}
},
+ "npm-run-path": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
+ "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
+ "dev": true,
+ "requires": {
+ "path-key": "2.0.1"
+ }
+ },
+ "number-is-nan": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
+ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
+ "dev": true
+ },
"object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@@ -1446,13 +2706,48 @@
"integrity": "sha1-ScoCk+CxlZCl9d4Qx/JlphfY/lQ=",
"dev": true
},
- "outpipe": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/outpipe/-/outpipe-1.1.1.tgz",
- "integrity": "sha1-UM+GFjZeh+Ax4ppeyTOaPaRyX6I=",
+ "os-homedir": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
+ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
+ "dev": true
+ },
+ "os-locale": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz",
+ "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==",
"dev": true,
"requires": {
- "shell-quote": "1.6.1"
+ "execa": "0.7.0",
+ "lcid": "1.0.0",
+ "mem": "1.1.0"
+ }
+ },
+ "os-tmpdir": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
+ "dev": true
+ },
+ "p-finally": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
+ "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
+ "dev": true
+ },
+ "p-limit": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz",
+ "integrity": "sha1-sH/y2aXYi+yAYDWJWiurZqJ5iLw=",
+ "dev": true
+ },
+ "p-locate": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
+ "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
+ "dev": true,
+ "requires": {
+ "p-limit": "1.1.0"
}
},
"pako": {
@@ -1510,12 +2805,24 @@
"integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=",
"dev": true
},
+ "path-exists": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
+ "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
+ "dev": true
+ },
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true
},
+ "path-key": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
+ "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
+ "dev": true
+ },
"path-parse": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz",
@@ -1528,6 +2835,15 @@
"integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=",
"dev": true
},
+ "path-type": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz",
+ "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=",
+ "dev": true,
+ "requires": {
+ "pify": "2.3.0"
+ }
+ },
"pbkdf2": {
"version": "3.0.13",
"resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.13.tgz",
@@ -1541,12 +2857,33 @@
"sha.js": "2.4.8"
}
},
+ "pify": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
+ "dev": true
+ },
+ "pkg-dir": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz",
+ "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=",
+ "dev": true,
+ "requires": {
+ "find-up": "2.1.0"
+ }
+ },
"preserve": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz",
"integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=",
"dev": true
},
+ "private": {
+ "version": "0.1.7",
+ "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz",
+ "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=",
+ "dev": true
+ },
"process": {
"version": "0.11.10",
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
@@ -1559,6 +2896,18 @@
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=",
"dev": true
},
+ "prr": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz",
+ "integrity": "sha1-GoS4WQgyVQFBGFPQCB7j+obikmo=",
+ "dev": true
+ },
+ "pseudomap": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
+ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=",
+ "dev": true
+ },
"public-encrypt": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz",
@@ -1649,6 +2998,27 @@
"readable-stream": "2.3.3"
}
},
+ "read-pkg": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz",
+ "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=",
+ "dev": true,
+ "requires": {
+ "load-json-file": "2.0.0",
+ "normalize-package-data": "2.4.0",
+ "path-type": "2.0.0"
+ }
+ },
+ "read-pkg-up": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz",
+ "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=",
+ "dev": true,
+ "requires": {
+ "find-up": "2.1.0",
+ "read-pkg": "2.0.0"
+ }
+ },
"readable-stream": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz",
@@ -1676,6 +3046,29 @@
"set-immediate-shim": "1.0.1"
}
},
+ "regenerate": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.2.tgz",
+ "integrity": "sha1-0ZQcZ7rUN+G+dkM63Vs4X5WxkmA=",
+ "dev": true
+ },
+ "regenerator-runtime": {
+ "version": "0.11.0",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz",
+ "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==",
+ "dev": true
+ },
+ "regenerator-transform": {
+ "version": "0.10.1",
+ "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz",
+ "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "6.26.0",
+ "babel-types": "6.26.0",
+ "private": "0.1.7"
+ }
+ },
"regex-cache": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz",
@@ -1686,6 +3079,40 @@
"is-primitive": "2.0.0"
}
},
+ "regexpu-core": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz",
+ "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=",
+ "dev": true,
+ "requires": {
+ "regenerate": "1.3.2",
+ "regjsgen": "0.2.0",
+ "regjsparser": "0.1.5"
+ }
+ },
+ "regjsgen": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
+ "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=",
+ "dev": true
+ },
+ "regjsparser": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz",
+ "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=",
+ "dev": true,
+ "requires": {
+ "jsesc": "0.5.0"
+ },
+ "dependencies": {
+ "jsesc": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
+ "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
+ "dev": true
+ }
+ }
+ },
"remove-trailing-separator": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
@@ -1704,6 +3131,27 @@
"integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=",
"dev": true
},
+ "repeating": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz",
+ "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=",
+ "dev": true,
+ "requires": {
+ "is-finite": "1.0.2"
+ }
+ },
+ "require-directory": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
+ "dev": true
+ },
+ "require-main-filename": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
+ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=",
+ "dev": true
+ },
"resolve": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz",
@@ -1713,6 +3161,15 @@
"path-parse": "1.0.5"
}
},
+ "right-align": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz",
+ "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=",
+ "dev": true,
+ "requires": {
+ "align-text": "0.1.4"
+ }
+ },
"ripemd160": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz",
@@ -1734,12 +3191,24 @@
"resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
"integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg=="
},
+ "set-blocking": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
+ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
+ "dev": true
+ },
"set-immediate-shim": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz",
"integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=",
"dev": true
},
+ "setimmediate": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
+ "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=",
+ "dev": true
+ },
"sha.js": {
"version": "2.4.8",
"resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.8.tgz",
@@ -1759,6 +3228,21 @@
"sha.js": "2.4.8"
}
},
+ "shebang-command": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
+ "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
+ "dev": true,
+ "requires": {
+ "shebang-regex": "1.0.0"
+ }
+ },
+ "shebang-regex": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
+ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
+ "dev": true
+ },
"shell-quote": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz",
@@ -1771,17 +3255,65 @@
"jsonify": "0.0.0"
}
},
+ "signal-exit": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
+ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
+ "dev": true
+ },
+ "slash": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
+ "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=",
+ "dev": true
+ },
"slugify": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/slugify/-/slugify-1.2.1.tgz",
"integrity": "sha512-WgTaDQNSyEKXlNKHO8L0DJJtE3gLK83pTx9OM941PnDVhPpZ93FHIbF2D9b0W6d5DsMwBkd56cRFKgxXkPN2KA=="
},
+ "source-list-map": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz",
+ "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==",
+ "dev": true
+ },
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true
},
+ "source-map-support": {
+ "version": "0.4.16",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.16.tgz",
+ "integrity": "sha512-A6vlydY7H/ljr4L2UOhDSajQdZQ6dMD7cLH0pzwcmwLyc9u8PNI4WGtnfDDzX7uzGL6c/T+ORL97Zlh+S4iOrg==",
+ "dev": true,
+ "requires": {
+ "source-map": "0.5.7"
+ }
+ },
+ "spdx-correct": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz",
+ "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=",
+ "dev": true,
+ "requires": {
+ "spdx-license-ids": "1.2.2"
+ }
+ },
+ "spdx-expression-parse": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz",
+ "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=",
+ "dev": true
+ },
+ "spdx-license-ids": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz",
+ "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=",
+ "dev": true
+ },
"sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
@@ -1844,19 +3376,52 @@
"safe-buffer": "5.1.1"
}
},
- "strip-bom": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
- "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
+ "string-width": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
+ "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
"dev": true,
"requires": {
- "is-utf8": "0.2.1"
+ "is-fullwidth-code-point": "2.0.0",
+ "strip-ansi": "4.0.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
+ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
+ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
+ "dev": true
+ },
+ "strip-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "3.0.0"
+ }
+ }
}
},
- "strip-json-comments": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
- "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
+ "strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "2.1.1"
+ }
+ },
+ "strip-eof": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
+ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
"dev": true
},
"subarg": {
@@ -1885,6 +3450,12 @@
"acorn": "4.0.13"
}
},
+ "tapable": {
+ "version": "0.2.8",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.8.tgz",
+ "integrity": "sha1-mTcqXJmb8t8WCvwNdL7U9HlIzSI=",
+ "dev": true
+ },
"through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
@@ -1916,30 +3487,28 @@
"integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=",
"dev": true
},
- "tsconfig": {
- "version": "5.0.3",
- "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-5.0.3.tgz",
- "integrity": "sha1-X0J45wGACWeo/Dg/0ZZIh48qbjo=",
- "dev": true,
- "requires": {
- "any-promise": "1.3.0",
- "parse-json": "2.2.0",
- "strip-bom": "2.0.0",
- "strip-json-comments": "2.0.1"
- }
+ "to-fast-properties": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
+ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=",
+ "dev": true
},
- "tsify": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/tsify/-/tsify-3.0.1.tgz",
- "integrity": "sha1-I1Cf87TnEQypZW9sJ8oT7IVgVvY=",
+ "trim-right": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz",
+ "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=",
+ "dev": true
+ },
+ "ts-loader": {
+ "version": "2.3.4",
+ "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-2.3.4.tgz",
+ "integrity": "sha512-OTFLRAX5LdIbdB9VOBzgdF4/FubWnZUTbxaAZeN70TvMCFVeaRIWcLGGvowlKwpObNih9KDScWYmLnYzDL2P7A==",
"dev": true,
"requires": {
- "convert-source-map": "1.5.0",
- "fs.realpath": "1.0.0",
- "object-assign": "4.1.1",
- "semver": "5.4.1",
- "through2": "2.0.3",
- "tsconfig": "5.0.3"
+ "chalk": "2.1.0",
+ "enhanced-resolve": "3.4.1",
+ "loader-utils": "1.1.0",
+ "semver": "5.4.1"
}
},
"tty-browserify": {
@@ -1965,34 +3534,46 @@
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.3.tgz",
"integrity": "sha1-ftUNXg+an7ClczeSWfKndFjVAZI="
},
- "uglify-es": {
- "version": "3.0.28",
- "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.0.28.tgz",
- "integrity": "sha512-xw1hJsSp361OO0Sq0XvNyTI2wfQ4eKNljfSYyeYX/dz9lKEDj+DK+A8CzB0NmoCwWX1MnEx9f16HlkKXyG65CQ==",
+ "uglify-to-browserify": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz",
+ "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=",
"dev": true,
- "requires": {
- "commander": "2.11.0",
- "source-map": "0.5.7"
- }
+ "optional": true
},
- "uglifyify": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/uglifyify/-/uglifyify-4.0.3.tgz",
- "integrity": "sha512-k+XKvVDmLOTVOS34sEBQdeUL0Od9zN0a1lzjJZMgkAaoNarskzFFWcpjpyh6lM7o9yRGNfbCIGdWOjIKZq6EAg==",
+ "uglifyjs-webpack-plugin": {
+ "version": "0.4.6",
+ "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz",
+ "integrity": "sha1-uVH0q7a9YX5m9j64kUmOORdj4wk=",
"dev": true,
"requires": {
- "convert-source-map": "1.1.3",
- "extend": "1.3.0",
- "minimatch": "3.0.4",
- "through": "2.3.8",
- "uglify-es": "3.0.28"
+ "source-map": "0.5.7",
+ "uglify-js": "2.8.29",
+ "webpack-sources": "1.0.1"
},
"dependencies": {
- "convert-source-map": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz",
- "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=",
- "dev": true
+ "uglify-js": {
+ "version": "2.8.29",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz",
+ "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=",
+ "dev": true,
+ "requires": {
+ "source-map": "0.5.7",
+ "uglify-to-browserify": "1.0.2",
+ "yargs": "3.10.0"
+ }
+ },
+ "yargs": {
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz",
+ "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=",
+ "dev": true,
+ "requires": {
+ "camelcase": "1.2.1",
+ "cliui": "2.1.0",
+ "decamelize": "1.2.0",
+ "window-size": "0.1.0"
+ }
}
}
},
@@ -2043,6 +3624,16 @@
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
"dev": true
},
+ "validate-npm-package-license": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz",
+ "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=",
+ "dev": true,
+ "requires": {
+ "spdx-correct": "1.0.2",
+ "spdx-expression-parse": "1.0.4"
+ }
+ },
"vm-browserify": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
@@ -2052,19 +3643,63 @@
"indexof": "0.0.1"
}
},
- "watchify": {
- "version": "3.9.0",
- "resolved": "https://registry.npmjs.org/watchify/-/watchify-3.9.0.tgz",
- "integrity": "sha1-8HX9LoqGrN6Eztum5cKgvt1SPZ4=",
+ "watchpack": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.4.0.tgz",
+ "integrity": "sha1-ShRyvLuVK9Cpu0A2gB+VTfs5+qw=",
"dev": true,
"requires": {
- "anymatch": "1.3.2",
- "browserify": "14.4.0",
+ "async": "2.5.0",
"chokidar": "1.7.0",
- "defined": "1.0.0",
- "outpipe": "1.1.1",
- "through2": "2.0.3",
- "xtend": "4.0.1"
+ "graceful-fs": "4.1.11"
+ }
+ },
+ "webpack": {
+ "version": "3.5.5",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.5.5.tgz",
+ "integrity": "sha512-qeUx4nIbeLL53qqNTs3kObPBMkUVDrOjEfp/hTvMlx21qL2MsGNr8/tXCoX/lS12dLl9qtZaXv2qfBEctPScDg==",
+ "dev": true,
+ "requires": {
+ "acorn": "5.1.1",
+ "acorn-dynamic-import": "2.0.2",
+ "ajv": "5.2.2",
+ "ajv-keywords": "2.1.0",
+ "async": "2.5.0",
+ "enhanced-resolve": "3.4.1",
+ "escope": "3.6.0",
+ "interpret": "1.0.3",
+ "json-loader": "0.5.7",
+ "json5": "0.5.1",
+ "loader-runner": "2.3.0",
+ "loader-utils": "1.1.0",
+ "memory-fs": "0.4.1",
+ "mkdirp": "0.5.1",
+ "node-libs-browser": "2.0.0",
+ "source-map": "0.5.7",
+ "supports-color": "4.2.1",
+ "tapable": "0.2.8",
+ "uglifyjs-webpack-plugin": "0.4.6",
+ "watchpack": "1.4.0",
+ "webpack-sources": "1.0.1",
+ "yargs": "8.0.2"
+ },
+ "dependencies": {
+ "acorn": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.1.tgz",
+ "integrity": "sha512-vOk6uEMctu0vQrvuSqFdJyqj1Q0S5VTDL79qtjo+DhRr+1mmaD+tluFSCZqhvi/JUhXSzoZN2BhtstaPEeE8cw==",
+ "dev": true
+ }
+ }
+ },
+ "webpack-sources": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.0.1.tgz",
+ "integrity": "sha512-05tMxipUCwHqYaVS8xc7sYPTly8PzXayRCB4dTxLhWTqlKUiwH6ezmEe0OSreL1c30LAuA3Zqmc+uEBUGFJDjw==",
+ "dev": true,
+ "requires": {
+ "source-list-map": "2.0.0",
+ "source-map": "0.5.7"
}
},
"which": {
@@ -2075,6 +3710,47 @@
"isexe": "2.0.0"
}
},
+ "which-module": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
+ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
+ "dev": true
+ },
+ "window-size": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz",
+ "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=",
+ "dev": true
+ },
+ "wordwrap": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz",
+ "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=",
+ "dev": true
+ },
+ "wrap-ansi": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
+ "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
+ "dev": true,
+ "requires": {
+ "string-width": "1.0.2",
+ "strip-ansi": "3.0.1"
+ },
+ "dependencies": {
+ "string-width": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+ "dev": true,
+ "requires": {
+ "code-point-at": "1.1.0",
+ "is-fullwidth-code-point": "1.0.0",
+ "strip-ansi": "3.0.1"
+ }
+ }
+ }
+ },
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
@@ -2086,6 +3762,88 @@
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
"integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=",
"dev": true
+ },
+ "y18n": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
+ "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=",
+ "dev": true
+ },
+ "yallist": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
+ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
+ "dev": true
+ },
+ "yargs": {
+ "version": "8.0.2",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz",
+ "integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=",
+ "dev": true,
+ "requires": {
+ "camelcase": "4.1.0",
+ "cliui": "3.2.0",
+ "decamelize": "1.2.0",
+ "get-caller-file": "1.0.2",
+ "os-locale": "2.1.0",
+ "read-pkg-up": "2.0.0",
+ "require-directory": "2.1.1",
+ "require-main-filename": "1.0.1",
+ "set-blocking": "2.0.0",
+ "string-width": "2.1.1",
+ "which-module": "2.0.0",
+ "y18n": "3.2.1",
+ "yargs-parser": "7.0.0"
+ },
+ "dependencies": {
+ "camelcase": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
+ "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
+ "dev": true
+ },
+ "cliui": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
+ "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
+ "dev": true,
+ "requires": {
+ "string-width": "1.0.2",
+ "strip-ansi": "3.0.1",
+ "wrap-ansi": "2.1.0"
+ },
+ "dependencies": {
+ "string-width": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+ "dev": true,
+ "requires": {
+ "code-point-at": "1.1.0",
+ "is-fullwidth-code-point": "1.0.0",
+ "strip-ansi": "3.0.1"
+ }
+ }
+ }
+ }
+ }
+ },
+ "yargs-parser": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz",
+ "integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k=",
+ "dev": true,
+ "requires": {
+ "camelcase": "4.1.0"
+ },
+ "dependencies": {
+ "camelcase": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
+ "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
+ "dev": true
+ }
+ }
}
}
}
diff --git a/js/package.json b/package.json
index 5483f91..827e321 100644
--- a/js/package.json
+++ b/package.json
@@ -16,11 +16,14 @@
"@types/jquery": "^3.2.12",
"@types/katex": "^0.5.0",
"@types/markdown-it": "0.0.3",
+ "@types/markdown-it-anchor": "^4.0.1",
"@types/underscore": "^1.8.2",
+ "babel-core": "^6.26.0",
+ "babel-loader": "^7.1.2",
+ "babel-preset-es2015": "^6.24.1",
"browserify": "^14.4.0",
- "tsify": "^3.0.1",
+ "ts-loader": "^2.3.4",
"typescript": "^2.4.2",
- "uglifyify": "^4.0.3",
- "watchify": "^3.9.0"
+ "webpack": "^3.5.5"
}
}
diff --git a/js/tsconfig.json b/tsconfig.json
index 84b7be7..d9fb8a4 100644
--- a/js/tsconfig.json
+++ b/tsconfig.json
@@ -15,7 +15,7 @@
"allowSyntheticDefaultImports": true
},
"files": [
- "editor.ts",
- "Nextcloud.d.ts"
+ "js/editor.ts",
+ "js/Nextcloud.d.ts"
]
} \ No newline at end of file
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644
index 0000000..4863c90
--- /dev/null
+++ b/webpack.config.js
@@ -0,0 +1,39 @@
+const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
+const webpack = require('webpack');
+const path = require('path');
+
+module.exports = {
+ entry: "./js/editor.ts",
+ output: {
+ filename: "build/editor.js"
+ },
+ resolve: {
+ extensions: [".ts", ".js"]
+ },
+ plugins: [
+ new UglifyJSPlugin(),
+ new webpack.NamedModulesPlugin()
+ ],
+ module: {
+ loaders: [
+ {
+ test: /\.ts/,
+ loader: "ts-loader"
+ },
+ {
+ test: /\.js$/,
+ include: [
+ path.resolve(__dirname, "js"),
+ path.resolve(__dirname, "node_modules/markdown-it-anchor"),
+ path.resolve(__dirname, "node_modules/markdown-it-highlightjs")
+ ],
+ use: {
+ loader: 'babel-loader'
+ }
+ }
+ ]
+ },
+ node: {
+ fs: 'empty'
+ }
+}; \ No newline at end of file