diff --git a/.eslintrc.json b/.eslintrc.json index b52b218..639ad0e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -19,7 +19,7 @@ "computed-property-spacing": ["error", "never"], "consistent-return": "error", "consistent-this": "off", - "curly": "error", + "curly": "off", "default-case": "error", "dot-location": ["error", "property"], "dot-notation": "error", @@ -28,7 +28,7 @@ "func-names": "off", "func-style": ["error", "declaration", { "allowArrowFunctions": true }], "generator-star-spacing": "error", - "global-require": "error", + "global-require": "off", "guard-for-in": "error", "handle-callback-err": "error", "id-blacklist": "error", @@ -46,7 +46,7 @@ "new-parens": "error", "newline-after-var": "off", "newline-before-return": "off", - "newline-per-chained-call": "error", + "newline-per-chained-call": "off", "no-alert": "off", "no-array-constructor": "error", "no-bitwise": "off", @@ -115,12 +115,12 @@ "no-shadow": "error", "no-shadow-restricted-names": "error", "no-spaced-func": "error", - "no-sync": "error", + "no-sync": "off", "no-ternary": "off", "no-throw-literal": "error", "no-trailing-spaces": "error", "no-undef-init": "error", - "no-undefined": "error", + "no-undefined": "off", "no-underscore-dangle": "error", "no-unmodified-loop-condition": "error", "no-unneeded-ternary": "error", @@ -138,7 +138,7 @@ "no-warning-comments": "off", "no-whitespace-before-property": "error", "no-with": "error", - "object-curly-spacing": ["error", "always"], + "object-curly-spacing": "off", "object-property-newline": "off", "object-shorthand": "off", "one-var": "off", @@ -200,6 +200,8 @@ "escodegen": true, "utils": true, "Promise": true, - "Inlet": true + "Inlet": true, + "db": true, + "firebase": true } } diff --git a/app/FiraCode.ttf b/app/FiraCode.ttf new file mode 100644 index 0000000..575c21b Binary files /dev/null and b/app/FiraCode.ttf differ diff --git a/app/Fixedsys.ttf b/app/Fixedsys.ttf new file mode 100644 index 0000000..2e8723b Binary files /dev/null and b/app/Fixedsys.ttf differ diff --git a/app/Inconsolata.ttf b/app/Inconsolata.ttf new file mode 100755 index 0000000..bbc9647 Binary files /dev/null and b/app/Inconsolata.ttf differ diff --git a/app/Monoid.ttf b/app/Monoid.ttf new file mode 100644 index 0000000..a09e9fa Binary files /dev/null and b/app/Monoid.ttf differ diff --git a/app/icon-48.png b/app/icon-48.png new file mode 100644 index 0000000..96ae8e7 Binary files /dev/null and b/app/icon-48.png differ diff --git a/app/index.html b/app/index.html new file mode 100644 index 0000000..5108f08 --- /dev/null +++ b/app/index.html @@ -0,0 +1,589 @@ + + + + Web Maker + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ + +
+
+
+
+ +
+ + +
+
+
+
+
+ +
+
+
+ Console (0) + +
+
+
+ + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+

My Library

+ + +
+ + +
+
+
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/lib/codemirror/mode/coffeescript/coffeescript.js b/app/lib/codemirror/mode/coffeescript/coffeescript.js new file mode 100644 index 0000000..adf2184 --- /dev/null +++ b/app/lib/codemirror/mode/coffeescript/coffeescript.js @@ -0,0 +1,355 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/** + * Link to the project's GitHub page: + * https://github.com/pickhardt/coffeescript-codemirror-mode + */ +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("coffeescript", function(conf, parserConf) { + var ERRORCLASS = "error"; + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + var operators = /^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/; + var delimiters = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/; + var identifiers = /^[_A-Za-z$][_A-Za-z$0-9]*/; + var atProp = /^@[_A-Za-z$][_A-Za-z$0-9]*/; + + var wordOperators = wordRegexp(["and", "or", "not", + "is", "isnt", "in", + "instanceof", "typeof"]); + var indentKeywords = ["for", "while", "loop", "if", "unless", "else", + "switch", "try", "catch", "finally", "class"]; + var commonKeywords = ["break", "by", "continue", "debugger", "delete", + "do", "in", "of", "new", "return", "then", + "this", "@", "throw", "when", "until", "extends"]; + + var keywords = wordRegexp(indentKeywords.concat(commonKeywords)); + + indentKeywords = wordRegexp(indentKeywords); + + + var stringPrefixes = /^('{3}|\"{3}|['\"])/; + var regexPrefixes = /^(\/{3}|\/)/; + var commonConstants = ["Infinity", "NaN", "undefined", "null", "true", "false", "on", "off", "yes", "no"]; + var constants = wordRegexp(commonConstants); + + // Tokenizers + function tokenBase(stream, state) { + // Handle scope changes + if (stream.sol()) { + if (state.scope.align === null) state.scope.align = false; + var scopeOffset = state.scope.offset; + if (stream.eatSpace()) { + var lineOffset = stream.indentation(); + if (lineOffset > scopeOffset && state.scope.type == "coffee") { + return "indent"; + } else if (lineOffset < scopeOffset) { + return "dedent"; + } + return null; + } else { + if (scopeOffset > 0) { + dedent(stream, state); + } + } + } + if (stream.eatSpace()) { + return null; + } + + var ch = stream.peek(); + + // Handle docco title comment (single line) + if (stream.match("####")) { + stream.skipToEnd(); + return "comment"; + } + + // Handle multi line comments + if (stream.match("###")) { + state.tokenize = longComment; + return state.tokenize(stream, state); + } + + // Single line comment + if (ch === "#") { + stream.skipToEnd(); + return "comment"; + } + + // Handle number literals + if (stream.match(/^-?[0-9\.]/, false)) { + var floatLiteral = false; + // Floats + if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)) { + floatLiteral = true; + } + if (stream.match(/^-?\d+\.\d*/)) { + floatLiteral = true; + } + if (stream.match(/^-?\.\d+/)) { + floatLiteral = true; + } + + if (floatLiteral) { + // prevent from getting extra . on 1.. + if (stream.peek() == "."){ + stream.backUp(1); + } + return "number"; + } + // Integers + var intLiteral = false; + // Hex + if (stream.match(/^-?0x[0-9a-f]+/i)) { + intLiteral = true; + } + // Decimal + if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)) { + intLiteral = true; + } + // Zero by itself with no other piece of number. + if (stream.match(/^-?0(?![\dx])/i)) { + intLiteral = true; + } + if (intLiteral) { + return "number"; + } + } + + // Handle strings + if (stream.match(stringPrefixes)) { + state.tokenize = tokenFactory(stream.current(), false, "string"); + return state.tokenize(stream, state); + } + // Handle regex literals + if (stream.match(regexPrefixes)) { + if (stream.current() != "/" || stream.match(/^.*\//, false)) { // prevent highlight of division + state.tokenize = tokenFactory(stream.current(), true, "string-2"); + return state.tokenize(stream, state); + } else { + stream.backUp(1); + } + } + + + + // Handle operators and delimiters + if (stream.match(operators) || stream.match(wordOperators)) { + return "operator"; + } + if (stream.match(delimiters)) { + return "punctuation"; + } + + if (stream.match(constants)) { + return "atom"; + } + + if (stream.match(atProp) || state.prop && stream.match(identifiers)) { + return "property"; + } + + if (stream.match(keywords)) { + return "keyword"; + } + + if (stream.match(identifiers)) { + return "variable"; + } + + // Handle non-detected items + stream.next(); + return ERRORCLASS; + } + + function tokenFactory(delimiter, singleline, outclass) { + return function(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^'"\/\\]/); + if (stream.eat("\\")) { + stream.next(); + if (singleline && stream.eol()) { + return outclass; + } + } else if (stream.match(delimiter)) { + state.tokenize = tokenBase; + return outclass; + } else { + stream.eat(/['"\/]/); + } + } + if (singleline) { + if (parserConf.singleLineStringErrors) { + outclass = ERRORCLASS; + } else { + state.tokenize = tokenBase; + } + } + return outclass; + }; + } + + function longComment(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^#]/); + if (stream.match("###")) { + state.tokenize = tokenBase; + break; + } + stream.eatWhile("#"); + } + return "comment"; + } + + function indent(stream, state, type) { + type = type || "coffee"; + var offset = 0, align = false, alignOffset = null; + for (var scope = state.scope; scope; scope = scope.prev) { + if (scope.type === "coffee" || scope.type == "}") { + offset = scope.offset + conf.indentUnit; + break; + } + } + if (type !== "coffee") { + align = null; + alignOffset = stream.column() + stream.current().length; + } else if (state.scope.align) { + state.scope.align = false; + } + state.scope = { + offset: offset, + type: type, + prev: state.scope, + align: align, + alignOffset: alignOffset + }; + } + + function dedent(stream, state) { + if (!state.scope.prev) return; + if (state.scope.type === "coffee") { + var _indent = stream.indentation(); + var matched = false; + for (var scope = state.scope; scope; scope = scope.prev) { + if (_indent === scope.offset) { + matched = true; + break; + } + } + if (!matched) { + return true; + } + while (state.scope.prev && state.scope.offset !== _indent) { + state.scope = state.scope.prev; + } + return false; + } else { + state.scope = state.scope.prev; + return false; + } + } + + function tokenLexer(stream, state) { + var style = state.tokenize(stream, state); + var current = stream.current(); + + // Handle scope changes. + if (current === "return") { + state.dedent = true; + } + if (((current === "->" || current === "=>") && stream.eol()) + || style === "indent") { + indent(stream, state); + } + var delimiter_index = "[({".indexOf(current); + if (delimiter_index !== -1) { + indent(stream, state, "])}".slice(delimiter_index, delimiter_index+1)); + } + if (indentKeywords.exec(current)){ + indent(stream, state); + } + if (current == "then"){ + dedent(stream, state); + } + + + if (style === "dedent") { + if (dedent(stream, state)) { + return ERRORCLASS; + } + } + delimiter_index = "])}".indexOf(current); + if (delimiter_index !== -1) { + while (state.scope.type == "coffee" && state.scope.prev) + state.scope = state.scope.prev; + if (state.scope.type == current) + state.scope = state.scope.prev; + } + if (state.dedent && stream.eol()) { + if (state.scope.type == "coffee" && state.scope.prev) + state.scope = state.scope.prev; + state.dedent = false; + } + + return style; + } + + var external = { + startState: function(basecolumn) { + return { + tokenize: tokenBase, + scope: {offset:basecolumn || 0, type:"coffee", prev: null, align: false}, + prop: false, + dedent: 0 + }; + }, + + token: function(stream, state) { + var fillAlign = state.scope.align === null && state.scope; + if (fillAlign && stream.sol()) fillAlign.align = false; + + var style = tokenLexer(stream, state); + if (style && style != "comment") { + if (fillAlign) fillAlign.align = true; + state.prop = style == "punctuation" && stream.current() == "." + } + + return style; + }, + + indent: function(state, text) { + if (state.tokenize != tokenBase) return 0; + var scope = state.scope; + var closer = text && "])}".indexOf(text.charAt(0)) > -1; + if (closer) while (scope.type == "coffee" && scope.prev) scope = scope.prev; + var closes = closer && scope.type === text.charAt(0); + if (scope.align) + return scope.alignOffset - (closes ? 1 : 0); + else + return (closes ? scope.prev : scope).offset; + }, + + lineComment: "#", + fold: "indent" + }; + return external; +}); + +CodeMirror.defineMIME("text/x-coffeescript", "coffeescript"); +CodeMirror.defineMIME("text/coffeescript", "coffeescript"); + +}); diff --git a/app/lib/codemirror/mode/css/css.js b/app/lib/codemirror/mode/css/css.js new file mode 100644 index 0000000..e9656e3 --- /dev/null +++ b/app/lib/codemirror/mode/css/css.js @@ -0,0 +1,825 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("css", function(config, parserConfig) { + var inline = parserConfig.inline + if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css"); + + var indentUnit = config.indentUnit, + tokenHooks = parserConfig.tokenHooks, + documentTypes = parserConfig.documentTypes || {}, + mediaTypes = parserConfig.mediaTypes || {}, + mediaFeatures = parserConfig.mediaFeatures || {}, + mediaValueKeywords = parserConfig.mediaValueKeywords || {}, + propertyKeywords = parserConfig.propertyKeywords || {}, + nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {}, + fontProperties = parserConfig.fontProperties || {}, + counterDescriptors = parserConfig.counterDescriptors || {}, + colorKeywords = parserConfig.colorKeywords || {}, + valueKeywords = parserConfig.valueKeywords || {}, + allowNested = parserConfig.allowNested, + supportsAtComponent = parserConfig.supportsAtComponent === true; + + var type, override; + function ret(style, tp) { type = tp; return style; } + + // Tokenizers + + function tokenBase(stream, state) { + var ch = stream.next(); + if (tokenHooks[ch]) { + var result = tokenHooks[ch](stream, state); + if (result !== false) return result; + } + if (ch == "@") { + stream.eatWhile(/[\w\\\-]/); + return ret("def", stream.current()); + } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) { + return ret(null, "compare"); + } else if (ch == "\"" || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } else if (ch == "#") { + stream.eatWhile(/[\w\\\-]/); + return ret("atom", "hash"); + } else if (ch == "!") { + stream.match(/^\s*\w*/); + return ret("keyword", "important"); + } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) { + stream.eatWhile(/[\w.%]/); + return ret("number", "unit"); + } else if (ch === "-") { + if (/[\d.]/.test(stream.peek())) { + stream.eatWhile(/[\w.%]/); + return ret("number", "unit"); + } else if (stream.match(/^-[\w\\\-]+/)) { + stream.eatWhile(/[\w\\\-]/); + if (stream.match(/^\s*:/, false)) + return ret("variable-2", "variable-definition"); + return ret("variable-2", "variable"); + } else if (stream.match(/^\w+-/)) { + return ret("meta", "meta"); + } + } else if (/[,+>*\/]/.test(ch)) { + return ret(null, "select-op"); + } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) { + return ret("qualifier", "qualifier"); + } else if (/[:;{}\[\]\(\)]/.test(ch)) { + return ret(null, ch); + } else if ((ch == "u" && stream.match(/rl(-prefix)?\(/)) || + (ch == "d" && stream.match("omain(")) || + (ch == "r" && stream.match("egexp("))) { + stream.backUp(1); + state.tokenize = tokenParenthesized; + return ret("property", "word"); + } else if (/[\w\\\-]/.test(ch)) { + stream.eatWhile(/[\w\\\-]/); + return ret("property", "word"); + } else { + return ret(null, null); + } + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + if (quote == ")") stream.backUp(1); + break; + } + escaped = !escaped && ch == "\\"; + } + if (ch == quote || !escaped && quote != ")") state.tokenize = null; + return ret("string", "string"); + }; + } + + function tokenParenthesized(stream, state) { + stream.next(); // Must be '(' + if (!stream.match(/\s*[\"\')]/, false)) + state.tokenize = tokenString(")"); + else + state.tokenize = null; + return ret(null, "("); + } + + // Context management + + function Context(type, indent, prev) { + this.type = type; + this.indent = indent; + this.prev = prev; + } + + function pushContext(state, stream, type, indent) { + state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context); + return type; + } + + function popContext(state) { + if (state.context.prev) + state.context = state.context.prev; + return state.context.type; + } + + function pass(type, stream, state) { + return states[state.context.type](type, stream, state); + } + function popAndPass(type, stream, state, n) { + for (var i = n || 1; i > 0; i--) + state.context = state.context.prev; + return pass(type, stream, state); + } + + // Parser + + function wordAsValue(stream) { + var word = stream.current().toLowerCase(); + if (valueKeywords.hasOwnProperty(word)) + override = "atom"; + else if (colorKeywords.hasOwnProperty(word)) + override = "keyword"; + else + override = "variable"; + } + + var states = {}; + + states.top = function(type, stream, state) { + if (type == "{") { + return pushContext(state, stream, "block"); + } else if (type == "}" && state.context.prev) { + return popContext(state); + } else if (supportsAtComponent && /@component/.test(type)) { + return pushContext(state, stream, "atComponentBlock"); + } else if (/^@(-moz-)?document$/.test(type)) { + return pushContext(state, stream, "documentTypes"); + } else if (/^@(media|supports|(-moz-)?document|import)$/.test(type)) { + return pushContext(state, stream, "atBlock"); + } else if (/^@(font-face|counter-style)/.test(type)) { + state.stateArg = type; + return "restricted_atBlock_before"; + } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { + return "keyframes"; + } else if (type && type.charAt(0) == "@") { + return pushContext(state, stream, "at"); + } else if (type == "hash") { + override = "builtin"; + } else if (type == "word") { + override = "tag"; + } else if (type == "variable-definition") { + return "maybeprop"; + } else if (type == "interpolation") { + return pushContext(state, stream, "interpolation"); + } else if (type == ":") { + return "pseudo"; + } else if (allowNested && type == "(") { + return pushContext(state, stream, "parens"); + } + return state.context.type; + }; + + states.block = function(type, stream, state) { + if (type == "word") { + var word = stream.current().toLowerCase(); + if (propertyKeywords.hasOwnProperty(word)) { + override = "property"; + return "maybeprop"; + } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) { + override = "string-2"; + return "maybeprop"; + } else if (allowNested) { + override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag"; + return "block"; + } else { + override += " error"; + return "maybeprop"; + } + } else if (type == "meta") { + return "block"; + } else if (!allowNested && (type == "hash" || type == "qualifier")) { + override = "error"; + return "block"; + } else { + return states.top(type, stream, state); + } + }; + + states.maybeprop = function(type, stream, state) { + if (type == ":") return pushContext(state, stream, "prop"); + return pass(type, stream, state); + }; + + states.prop = function(type, stream, state) { + if (type == ";") return popContext(state); + if (type == "{" && allowNested) return pushContext(state, stream, "propBlock"); + if (type == "}" || type == "{") return popAndPass(type, stream, state); + if (type == "(") return pushContext(state, stream, "parens"); + + if (type == "hash" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) { + override += " error"; + } else if (type == "word") { + wordAsValue(stream); + } else if (type == "interpolation") { + return pushContext(state, stream, "interpolation"); + } + return "prop"; + }; + + states.propBlock = function(type, _stream, state) { + if (type == "}") return popContext(state); + if (type == "word") { override = "property"; return "maybeprop"; } + return state.context.type; + }; + + states.parens = function(type, stream, state) { + if (type == "{" || type == "}") return popAndPass(type, stream, state); + if (type == ")") return popContext(state); + if (type == "(") return pushContext(state, stream, "parens"); + if (type == "interpolation") return pushContext(state, stream, "interpolation"); + if (type == "word") wordAsValue(stream); + return "parens"; + }; + + states.pseudo = function(type, stream, state) { + if (type == "word") { + override = "variable-3"; + return state.context.type; + } + return pass(type, stream, state); + }; + + states.documentTypes = function(type, stream, state) { + if (type == "word" && documentTypes.hasOwnProperty(stream.current())) { + override = "tag"; + return state.context.type; + } else { + return states.atBlock(type, stream, state); + } + }; + + states.atBlock = function(type, stream, state) { + if (type == "(") return pushContext(state, stream, "atBlock_parens"); + if (type == "}" || type == ";") return popAndPass(type, stream, state); + if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top"); + + if (type == "interpolation") return pushContext(state, stream, "interpolation"); + + if (type == "word") { + var word = stream.current().toLowerCase(); + if (word == "only" || word == "not" || word == "and" || word == "or") + override = "keyword"; + else if (mediaTypes.hasOwnProperty(word)) + override = "attribute"; + else if (mediaFeatures.hasOwnProperty(word)) + override = "property"; + else if (mediaValueKeywords.hasOwnProperty(word)) + override = "keyword"; + else if (propertyKeywords.hasOwnProperty(word)) + override = "property"; + else if (nonStandardPropertyKeywords.hasOwnProperty(word)) + override = "string-2"; + else if (valueKeywords.hasOwnProperty(word)) + override = "atom"; + else if (colorKeywords.hasOwnProperty(word)) + override = "keyword"; + else + override = "error"; + } + return state.context.type; + }; + + states.atComponentBlock = function(type, stream, state) { + if (type == "}") + return popAndPass(type, stream, state); + if (type == "{") + return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top", false); + if (type == "word") + override = "error"; + return state.context.type; + }; + + states.atBlock_parens = function(type, stream, state) { + if (type == ")") return popContext(state); + if (type == "{" || type == "}") return popAndPass(type, stream, state, 2); + return states.atBlock(type, stream, state); + }; + + states.restricted_atBlock_before = function(type, stream, state) { + if (type == "{") + return pushContext(state, stream, "restricted_atBlock"); + if (type == "word" && state.stateArg == "@counter-style") { + override = "variable"; + return "restricted_atBlock_before"; + } + return pass(type, stream, state); + }; + + states.restricted_atBlock = function(type, stream, state) { + if (type == "}") { + state.stateArg = null; + return popContext(state); + } + if (type == "word") { + if ((state.stateArg == "@font-face" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) || + (state.stateArg == "@counter-style" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase()))) + override = "error"; + else + override = "property"; + return "maybeprop"; + } + return "restricted_atBlock"; + }; + + states.keyframes = function(type, stream, state) { + if (type == "word") { override = "variable"; return "keyframes"; } + if (type == "{") return pushContext(state, stream, "top"); + return pass(type, stream, state); + }; + + states.at = function(type, stream, state) { + if (type == ";") return popContext(state); + if (type == "{" || type == "}") return popAndPass(type, stream, state); + if (type == "word") override = "tag"; + else if (type == "hash") override = "builtin"; + return "at"; + }; + + states.interpolation = function(type, stream, state) { + if (type == "}") return popContext(state); + if (type == "{" || type == ";") return popAndPass(type, stream, state); + if (type == "word") override = "variable"; + else if (type != "variable" && type != "(" && type != ")") override = "error"; + return "interpolation"; + }; + + return { + startState: function(base) { + return {tokenize: null, + state: inline ? "block" : "top", + stateArg: null, + context: new Context(inline ? "block" : "top", base || 0, null)}; + }, + + token: function(stream, state) { + if (!state.tokenize && stream.eatSpace()) return null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style && typeof style == "object") { + type = style[1]; + style = style[0]; + } + override = style; + state.state = states[state.state](type, stream, state); + return override; + }, + + indent: function(state, textAfter) { + var cx = state.context, ch = textAfter && textAfter.charAt(0); + var indent = cx.indent; + if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev; + if (cx.prev) { + if (ch == "}" && (cx.type == "block" || cx.type == "top" || + cx.type == "interpolation" || cx.type == "restricted_atBlock")) { + // Resume indentation from parent context. + cx = cx.prev; + indent = cx.indent; + } else if (ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || + ch == "{" && (cx.type == "at" || cx.type == "atBlock")) { + // Dedent relative to current context. + indent = Math.max(0, cx.indent - indentUnit); + cx = cx.prev; + } + } + return indent; + }, + + electricChars: "}", + blockCommentStart: "/*", + blockCommentEnd: "*/", + fold: "brace" + }; +}); + + function keySet(array) { + var keys = {}; + for (var i = 0; i < array.length; ++i) { + keys[array[i]] = true; + } + return keys; + } + + var documentTypes_ = [ + "domain", "regexp", "url", "url-prefix" + ], documentTypes = keySet(documentTypes_); + + var mediaTypes_ = [ + "all", "aural", "braille", "handheld", "print", "projection", "screen", + "tty", "tv", "embossed" + ], mediaTypes = keySet(mediaTypes_); + + var mediaFeatures_ = [ + "width", "min-width", "max-width", "height", "min-height", "max-height", + "device-width", "min-device-width", "max-device-width", "device-height", + "min-device-height", "max-device-height", "aspect-ratio", + "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio", + "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color", + "max-color", "color-index", "min-color-index", "max-color-index", + "monochrome", "min-monochrome", "max-monochrome", "resolution", + "min-resolution", "max-resolution", "scan", "grid", "orientation", + "device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio", + "pointer", "any-pointer", "hover", "any-hover" + ], mediaFeatures = keySet(mediaFeatures_); + + var mediaValueKeywords_ = [ + "landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover", + "interlace", "progressive" + ], mediaValueKeywords = keySet(mediaValueKeywords_); + + var propertyKeywords_ = [ + "align-content", "align-items", "align-self", "alignment-adjust", + "alignment-baseline", "anchor-point", "animation", "animation-delay", + "animation-direction", "animation-duration", "animation-fill-mode", + "animation-iteration-count", "animation-name", "animation-play-state", + "animation-timing-function", "appearance", "azimuth", "backface-visibility", + "background", "background-attachment", "background-blend-mode", "background-clip", + "background-color", "background-image", "background-origin", "background-position", + "background-repeat", "background-size", "baseline-shift", "binding", + "bleed", "bookmark-label", "bookmark-level", "bookmark-state", + "bookmark-target", "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", "color", "color-profile", "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", "crop", "cue", + "cue-after", "cue-before", "cursor", "direction", "display", + "dominant-baseline", "drop-initial-after-adjust", + "drop-initial-after-align", "drop-initial-before-adjust", + "drop-initial-before-align", "drop-initial-size", "drop-initial-value", + "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis", + "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", + "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings", + "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust", + "font-stretch", "font-style", "font-synthesis", "font-variant", + "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", + "font-variant-ligatures", "font-variant-numeric", "font-variant-position", + "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", + "grid-auto-position", "grid-auto-rows", "grid-column", "grid-column-end", + "grid-column-start", "grid-row", "grid-row-end", "grid-row-start", + "grid-template", "grid-template-areas", "grid-template-columns", + "grid-template-rows", "hanging-punctuation", "height", "hyphens", + "icon", "image-orientation", "image-rendering", "image-resolution", + "inline-box-align", "justify-content", "left", "letter-spacing", + "line-break", "line-height", "line-stacking", "line-stacking-ruby", + "line-stacking-shift", "line-stacking-strategy", "list-style", + "list-style-image", "list-style-position", "list-style-type", "margin", + "margin-bottom", "margin-left", "margin-right", "margin-top", + "marker-offset", "marks", "marquee-direction", "marquee-loop", + "marquee-play-count", "marquee-speed", "marquee-style", "max-height", + "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index", + "nav-left", "nav-right", "nav-up", "object-fit", "object-position", + "opacity", "order", "orphans", "outline", + "outline-color", "outline-offset", "outline-style", "outline-width", + "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y", + "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", + "page", "page-break-after", "page-break-before", "page-break-inside", + "page-policy", "pause", "pause-after", "pause-before", "perspective", + "perspective-origin", "pitch", "pitch-range", "play-during", "position", + "presentation-level", "punctuation-trim", "quotes", "region-break-after", + "region-break-before", "region-break-inside", "region-fragment", + "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness", + "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang", + "ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin", + "shape-outside", "size", "speak", "speak-as", "speak-header", + "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set", + "tab-size", "table-layout", "target", "target-name", "target-new", + "target-position", "text-align", "text-align-last", "text-decoration", + "text-decoration-color", "text-decoration-line", "text-decoration-skip", + "text-decoration-style", "text-emphasis", "text-emphasis-color", + "text-emphasis-position", "text-emphasis-style", "text-height", + "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow", + "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position", + "text-wrap", "top", "transform", "transform-origin", "transform-style", + "transition", "transition-delay", "transition-duration", + "transition-property", "transition-timing-function", "unicode-bidi", + "vertical-align", "visibility", "voice-balance", "voice-duration", + "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress", + "voice-volume", "volume", "white-space", "widows", "width", "word-break", + "word-spacing", "word-wrap", "z-index", + // SVG-specific + "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color", + "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events", + "color-interpolation", "color-interpolation-filters", + "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering", + "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke", + "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", + "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering", + "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal", + "glyph-orientation-vertical", "text-anchor", "writing-mode" + ], propertyKeywords = keySet(propertyKeywords_); + + var nonStandardPropertyKeywords_ = [ + "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color", + "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color", + "scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside", + "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", + "searchfield-results-decoration", "zoom" + ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_); + + var fontProperties_ = [ + "font-family", "src", "unicode-range", "font-variant", "font-feature-settings", + "font-stretch", "font-weight", "font-style" + ], fontProperties = keySet(fontProperties_); + + var counterDescriptors_ = [ + "additive-symbols", "fallback", "negative", "pad", "prefix", "range", + "speak-as", "suffix", "symbols", "system" + ], counterDescriptors = keySet(counterDescriptors_); + + var colorKeywords_ = [ + "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", + "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", + "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", + "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", + "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen", + "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", + "darkslateblue", "darkslategray", "darkturquoise", "darkviolet", + "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick", + "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", + "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew", + "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", + "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", + "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink", + "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", + "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", + "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", + "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", + "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", + "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", + "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", + "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", + "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", + "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", + "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan", + "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", + "whitesmoke", "yellow", "yellowgreen" + ], colorKeywords = keySet(colorKeywords_); + + var valueKeywords_ = [ + "above", "absolute", "activeborder", "additive", "activecaption", "afar", + "after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate", + "always", "amharic", "amharic-abegede", "antialiased", "appworkspace", + "arabic-indic", "armenian", "asterisks", "attr", "auto", "avoid", "avoid-column", "avoid-page", + "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary", + "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box", + "both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel", + "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian", + "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", + "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch", + "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", + "col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse", + "compact", "condensed", "contain", "content", + "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop", + "cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal", + "decimal-leading-zero", "default", "default-button", "destination-atop", + "destination-in", "destination-out", "destination-over", "devanagari", "difference", + "disc", "discard", "disclosure-closed", "disclosure-open", "document", + "dot-dash", "dot-dot-dash", + "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", + "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", + "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er", + "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", + "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", + "ethiopic-halehame-gez", "ethiopic-halehame-om-et", + "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", + "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", + "ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed", + "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes", + "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove", + "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew", + "help", "hidden", "hide", "higher", "highlight", "highlighttext", + "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore", + "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", + "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", + "inline-block", "inline-flex", "inline-table", "inset", "inside", "intrinsic", "invert", + "italic", "japanese-formal", "japanese-informal", "justify", "kannada", + "katakana", "katakana-iroha", "keep-all", "khmer", + "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal", + "landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten", + "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem", + "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", + "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", + "lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "match", "matrix", "matrix3d", + "media-controls-background", "media-current-time-display", + "media-fullscreen-button", "media-mute-button", "media-play-button", + "media-return-to-realtime-button", "media-rewind-button", + "media-seek-back-button", "media-seek-forward-button", "media-slider", + "media-sliderthumb", "media-time-remaining-display", "media-volume-slider", + "media-volume-slider-container", "media-volume-sliderthumb", "medium", + "menu", "menulist", "menulist-button", "menulist-text", + "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", + "mix", "mongolian", "monospace", "move", "multiple", "multiply", "myanmar", "n-resize", + "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", + "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", + "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", + "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset", + "outside", "outside-shape", "overlay", "overline", "padding", "padding-box", + "painted", "page", "paused", "persian", "perspective", "plus-darker", "plus-lighter", + "pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", + "progress", "push-button", "radial-gradient", "radio", "read-only", + "read-write", "read-write-plaintext-only", "rectangle", "region", + "relative", "repeat", "repeating-linear-gradient", + "repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse", + "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY", + "rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running", + "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen", + "scroll", "scrollbar", "se-resize", "searchfield", + "searchfield-cancel-button", "searchfield-decoration", + "searchfield-results-button", "searchfield-results-decoration", + "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama", + "simp-chinese-formal", "simp-chinese-informal", "single", + "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal", + "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", + "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali", + "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "spell-out", "square", + "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub", + "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "table", + "table-caption", "table-cell", "table-column", "table-column-group", + "table-footer-group", "table-header-group", "table-row", "table-row-group", + "tamil", + "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", + "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight", + "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", + "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top", + "trad-chinese-formal", "trad-chinese-informal", + "translate", "translate3d", "translateX", "translateY", "translateZ", + "transparent", "ultra-condensed", "ultra-expanded", "underline", "up", + "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal", + "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", + "var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted", + "visibleStroke", "visual", "w-resize", "wait", "wave", "wider", + "window", "windowframe", "windowtext", "words", "wrap", "wrap-reverse", "x-large", "x-small", "xor", + "xx-large", "xx-small" + ], valueKeywords = keySet(valueKeywords_); + + var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_) + .concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_) + .concat(valueKeywords_); + CodeMirror.registerHelper("hintWords", "css", allWords); + + function tokenCComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == "/") { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return ["comment", "comment"]; + } + + CodeMirror.defineMIME("text/css", { + documentTypes: documentTypes, + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + mediaValueKeywords: mediaValueKeywords, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + fontProperties: fontProperties, + counterDescriptors: counterDescriptors, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + tokenHooks: { + "/": function(stream, state) { + if (!stream.eat("*")) return false; + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + }, + name: "css" + }); + + CodeMirror.defineMIME("text/x-scss", { + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + mediaValueKeywords: mediaValueKeywords, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + fontProperties: fontProperties, + allowNested: true, + tokenHooks: { + "/": function(stream, state) { + if (stream.eat("/")) { + stream.skipToEnd(); + return ["comment", "comment"]; + } else if (stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } else { + return ["operator", "operator"]; + } + }, + ":": function(stream) { + if (stream.match(/\s*\{/)) + return [null, "{"]; + return false; + }, + "$": function(stream) { + stream.match(/^[\w-]+/); + if (stream.match(/^\s*:/, false)) + return ["variable-2", "variable-definition"]; + return ["variable-2", "variable"]; + }, + "#": function(stream) { + if (!stream.eat("{")) return false; + return [null, "interpolation"]; + } + }, + name: "css", + helperType: "scss" + }); + + CodeMirror.defineMIME("text/x-less", { + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + mediaValueKeywords: mediaValueKeywords, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + fontProperties: fontProperties, + allowNested: true, + tokenHooks: { + "/": function(stream, state) { + if (stream.eat("/")) { + stream.skipToEnd(); + return ["comment", "comment"]; + } else if (stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } else { + return ["operator", "operator"]; + } + }, + "@": function(stream) { + if (stream.eat("{")) return [null, "interpolation"]; + if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false; + stream.eatWhile(/[\w\\\-]/); + if (stream.match(/^\s*:/, false)) + return ["variable-2", "variable-definition"]; + return ["variable-2", "variable"]; + }, + "&": function() { + return ["atom", "atom"]; + } + }, + name: "css", + helperType: "less" + }); + + CodeMirror.defineMIME("text/x-gss", { + documentTypes: documentTypes, + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + fontProperties: fontProperties, + counterDescriptors: counterDescriptors, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + supportsAtComponent: true, + tokenHooks: { + "/": function(stream, state) { + if (!stream.eat("*")) return false; + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + }, + name: "css", + helperType: "gss" + }); + +}); diff --git a/app/lib/codemirror/mode/css/gss.html b/app/lib/codemirror/mode/css/gss.html new file mode 100644 index 0000000..232fe8c --- /dev/null +++ b/app/lib/codemirror/mode/css/gss.html @@ -0,0 +1,103 @@ + + +CodeMirror: Closure Stylesheets (GSS) mode + + + + + + + + + + + + +
+

Closure Stylesheets (GSS) mode

+
+ + +

A mode for Closure Stylesheets (GSS).

+

MIME type defined: text/x-gss.

+ +

Parsing/Highlighting Tests: normal, verbose.

+ +
diff --git a/app/lib/codemirror/mode/css/gss_test.js b/app/lib/codemirror/mode/css/gss_test.js new file mode 100644 index 0000000..d56e592 --- /dev/null +++ b/app/lib/codemirror/mode/css/gss_test.js @@ -0,0 +1,17 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + "use strict"; + + var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-gss"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "gss"); } + + MT("atComponent", + "[def @component] {", + "[tag foo] {", + " [property color]: [keyword black];", + "}", + "}"); + +})(); diff --git a/app/lib/codemirror/mode/css/less.html b/app/lib/codemirror/mode/css/less.html new file mode 100644 index 0000000..adf7427 --- /dev/null +++ b/app/lib/codemirror/mode/css/less.html @@ -0,0 +1,152 @@ + + +CodeMirror: LESS mode + + + + + + + + + + +
+

LESS mode

+
+ + +

The LESS mode is a sub-mode of the CSS mode (defined in css.js).

+ +

Parsing/Highlighting Tests: normal, verbose.

+
diff --git a/app/lib/codemirror/mode/css/scss.html b/app/lib/codemirror/mode/css/scss.html new file mode 100644 index 0000000..f8e4d37 --- /dev/null +++ b/app/lib/codemirror/mode/css/scss.html @@ -0,0 +1,157 @@ + + +CodeMirror: SCSS mode + + + + + + + + + +
+

SCSS mode

+
+ + +

The SCSS mode is a sub-mode of the CSS mode (defined in css.js).

+ +

Parsing/Highlighting Tests: normal, verbose.

+ +
diff --git a/app/lib/codemirror/mode/haml/haml.js b/app/lib/codemirror/mode/haml/haml.js new file mode 100644 index 0000000..86def73 --- /dev/null +++ b/app/lib/codemirror/mode/haml/haml.js @@ -0,0 +1,161 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../ruby/ruby")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../ruby/ruby"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + + // full haml mode. This handled embedded ruby and html fragments too + CodeMirror.defineMode("haml", function(config) { + var htmlMode = CodeMirror.getMode(config, {name: "htmlmixed"}); + var rubyMode = CodeMirror.getMode(config, "ruby"); + + function rubyInQuote(endQuote) { + return function(stream, state) { + var ch = stream.peek(); + if (ch == endQuote && state.rubyState.tokenize.length == 1) { + // step out of ruby context as it seems to complete processing all the braces + stream.next(); + state.tokenize = html; + return "closeAttributeTag"; + } else { + return ruby(stream, state); + } + }; + } + + function ruby(stream, state) { + if (stream.match("-#")) { + stream.skipToEnd(); + return "comment"; + } + return rubyMode.token(stream, state.rubyState); + } + + function html(stream, state) { + var ch = stream.peek(); + + // handle haml declarations. All declarations that cant be handled here + // will be passed to html mode + if (state.previousToken.style == "comment" ) { + if (state.indented > state.previousToken.indented) { + stream.skipToEnd(); + return "commentLine"; + } + } + + if (state.startOfLine) { + if (ch == "!" && stream.match("!!")) { + stream.skipToEnd(); + return "tag"; + } else if (stream.match(/^%[\w:#\.]+=/)) { + state.tokenize = ruby; + return "hamlTag"; + } else if (stream.match(/^%[\w:]+/)) { + return "hamlTag"; + } else if (ch == "/" ) { + stream.skipToEnd(); + return "comment"; + } + } + + if (state.startOfLine || state.previousToken.style == "hamlTag") { + if ( ch == "#" || ch == ".") { + stream.match(/[\w-#\.]*/); + return "hamlAttribute"; + } + } + + // donot handle --> as valid ruby, make it HTML close comment instead + if (state.startOfLine && !stream.match("-->", false) && (ch == "=" || ch == "-" )) { + state.tokenize = ruby; + return state.tokenize(stream, state); + } + + if (state.previousToken.style == "hamlTag" || + state.previousToken.style == "closeAttributeTag" || + state.previousToken.style == "hamlAttribute") { + if (ch == "(") { + state.tokenize = rubyInQuote(")"); + return state.tokenize(stream, state); + } else if (ch == "{") { + if (!stream.match(/^\{%.*/)) { + state.tokenize = rubyInQuote("}"); + return state.tokenize(stream, state); + } + } + } + + return htmlMode.token(stream, state.htmlState); + } + + return { + // default to html mode + startState: function() { + var htmlState = htmlMode.startState(); + var rubyState = rubyMode.startState(); + return { + htmlState: htmlState, + rubyState: rubyState, + indented: 0, + previousToken: { style: null, indented: 0}, + tokenize: html + }; + }, + + copyState: function(state) { + return { + htmlState : CodeMirror.copyState(htmlMode, state.htmlState), + rubyState: CodeMirror.copyState(rubyMode, state.rubyState), + indented: state.indented, + previousToken: state.previousToken, + tokenize: state.tokenize + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + state.startOfLine = false; + // dont record comment line as we only want to measure comment line with + // the opening comment block + if (style && style != "commentLine") { + state.previousToken = { style: style, indented: state.indented }; + } + // if current state is ruby and the previous token is not `,` reset the + // tokenize to html + if (stream.eol() && state.tokenize == ruby) { + stream.backUp(1); + var ch = stream.peek(); + stream.next(); + if (ch && ch != ",") { + state.tokenize = html; + } + } + // reprocess some of the specific style tag when finish setting previousToken + if (style == "hamlTag") { + style = "tag"; + } else if (style == "commentLine") { + style = "comment"; + } else if (style == "hamlAttribute") { + style = "attribute"; + } else if (style == "closeAttributeTag") { + style = null; + } + return style; + } + }; + }, "htmlmixed", "ruby"); + + CodeMirror.defineMIME("text/x-haml", "haml"); +}); diff --git a/app/lib/codemirror/mode/htmlembedded/htmlembedded.js b/app/lib/codemirror/mode/htmlembedded/htmlembedded.js new file mode 100644 index 0000000..464dc57 --- /dev/null +++ b/app/lib/codemirror/mode/htmlembedded/htmlembedded.js @@ -0,0 +1,28 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), + require("../../addon/mode/multiplex")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed", + "../../addon/mode/multiplex"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { + return CodeMirror.multiplexingMode(CodeMirror.getMode(config, "htmlmixed"), { + open: parserConfig.open || parserConfig.scriptStartRegex || "<%", + close: parserConfig.close || parserConfig.scriptEndRegex || "%>", + mode: CodeMirror.getMode(config, parserConfig.scriptingModeSpec) + }); + }, "htmlmixed"); + + CodeMirror.defineMIME("application/x-ejs", {name: "htmlembedded", scriptingModeSpec:"javascript"}); + CodeMirror.defineMIME("application/x-aspx", {name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); + CodeMirror.defineMIME("application/x-jsp", {name: "htmlembedded", scriptingModeSpec:"text/x-java"}); + CodeMirror.defineMIME("application/x-erb", {name: "htmlembedded", scriptingModeSpec:"ruby"}); +}); diff --git a/app/lib/codemirror/mode/htmlmixed/htmlmixed.js b/app/lib/codemirror/mode/htmlmixed/htmlmixed.js new file mode 100644 index 0000000..6574fbd --- /dev/null +++ b/app/lib/codemirror/mode/htmlmixed/htmlmixed.js @@ -0,0 +1,152 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + var defaultTags = { + script: [ + ["lang", /(javascript|babel)/i, "javascript"], + ["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, "javascript"], + ["type", /./, "text/plain"], + [null, null, "javascript"] + ], + style: [ + ["lang", /^css$/i, "css"], + ["type", /^(text\/)?(x-)?(stylesheet|css)$/i, "css"], + ["type", /./, "text/plain"], + [null, null, "css"] + ] + }; + + function maybeBackup(stream, pat, style) { + var cur = stream.current(), close = cur.search(pat); + if (close > -1) { + stream.backUp(cur.length - close); + } else if (cur.match(/<\/?$/)) { + stream.backUp(cur.length); + if (!stream.match(pat, false)) stream.match(cur); + } + return style; + } + + var attrRegexpCache = {}; + function getAttrRegexp(attr) { + var regexp = attrRegexpCache[attr]; + if (regexp) return regexp; + return attrRegexpCache[attr] = new RegExp("\\s+" + attr + "\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"); + } + + function getAttrValue(text, attr) { + var match = text.match(getAttrRegexp(attr)) + return match ? match[2] : "" + } + + function getTagRegexp(tagName, anchored) { + return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i"); + } + + function addTags(from, to) { + for (var tag in from) { + var dest = to[tag] || (to[tag] = []); + var source = from[tag]; + for (var i = source.length - 1; i >= 0; i--) + dest.unshift(source[i]) + } + } + + function findMatchingMode(tagInfo, tagText) { + for (var i = 0; i < tagInfo.length; i++) { + var spec = tagInfo[i]; + if (!spec[0] || spec[1].test(getAttrValue(tagText, spec[0]))) return spec[2]; + } + } + + CodeMirror.defineMode("htmlmixed", function (config, parserConfig) { + var htmlMode = CodeMirror.getMode(config, { + name: "xml", + htmlMode: true, + multilineTagIndentFactor: parserConfig.multilineTagIndentFactor, + multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag + }); + + var tags = {}; + var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes; + addTags(defaultTags, tags); + if (configTags) addTags(configTags, tags); + if (configScript) for (var i = configScript.length - 1; i >= 0; i--) + tags.script.unshift(["type", configScript[i].matches, configScript[i].mode]) + + function html(stream, state) { + var style = htmlMode.token(stream, state.htmlState), tag = /\btag\b/.test(style), tagName + if (tag && !/[<>\s\/]/.test(stream.current()) && + (tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase()) && + tags.hasOwnProperty(tagName)) { + state.inTag = tagName + " " + } else if (state.inTag && tag && />$/.test(stream.current())) { + var inTag = /^([\S]+) (.*)/.exec(state.inTag) + state.inTag = null + var modeSpec = stream.current() == ">" && findMatchingMode(tags[inTag[1]], inTag[2]) + var mode = CodeMirror.getMode(config, modeSpec) + var endTagA = getTagRegexp(inTag[1], true), endTag = getTagRegexp(inTag[1], false); + state.token = function (stream, state) { + if (stream.match(endTagA, false)) { + state.token = html; + state.localState = state.localMode = null; + return null; + } + return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState)); + }; + state.localMode = mode; + state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, "")); + } else if (state.inTag) { + state.inTag += stream.current() + if (stream.eol()) state.inTag += " " + } + return style; + }; + + return { + startState: function () { + var state = htmlMode.startState(); + return {token: html, inTag: null, localMode: null, localState: null, htmlState: state}; + }, + + copyState: function (state) { + var local; + if (state.localState) { + local = CodeMirror.copyState(state.localMode, state.localState); + } + return {token: state.token, inTag: state.inTag, + localMode: state.localMode, localState: local, + htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; + }, + + token: function (stream, state) { + return state.token(stream, state); + }, + + indent: function (state, textAfter) { + if (!state.localMode || /^\s*<\//.test(textAfter)) + return htmlMode.indent(state.htmlState, textAfter); + else if (state.localMode.indent) + return state.localMode.indent(state.localState, textAfter); + else + return CodeMirror.Pass; + }, + + innerMode: function (state) { + return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; + } + }; + }, "xml", "javascript", "css"); + + CodeMirror.defineMIME("text/html", "htmlmixed"); +}); diff --git a/app/lib/codemirror/mode/javascript/javascript.js b/app/lib/codemirror/mode/javascript/javascript.js new file mode 100644 index 0000000..fa5721d --- /dev/null +++ b/app/lib/codemirror/mode/javascript/javascript.js @@ -0,0 +1,742 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// TODO actually recognize syntax of TypeScript constructs + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +function expressionAllowed(stream, state, backUp) { + return /^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(state.lastType) || + (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0)))) +} + +CodeMirror.defineMode("javascript", function(config, parserConfig) { + var indentUnit = config.indentUnit; + var statementIndent = parserConfig.statementIndent; + var jsonldMode = parserConfig.jsonld; + var jsonMode = parserConfig.json || jsonldMode; + var isTS = parserConfig.typescript; + var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/; + + // Tokenizer + + var keywords = function(){ + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); + var operator = kw("operator"), atom = {type: "atom", style: "atom"}; + + var jsKeywords = { + "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, + "return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C, + "var": kw("var"), "const": kw("var"), "let": kw("var"), + "function": kw("function"), "catch": kw("catch"), + "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), + "in": operator, "typeof": operator, "instanceof": operator, + "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, + "this": kw("this"), "class": kw("class"), "super": kw("atom"), + "yield": C, "export": kw("export"), "import": kw("import"), "extends": C + }; + + // Extend the 'normal' keywords with the TypeScript language extensions + if (isTS) { + var type = {type: "variable", style: "variable-3"}; + var tsKeywords = { + // object-like things + "interface": kw("class"), + "implements": C, + "namespace": C, + "module": kw("module"), + "enum": kw("module"), + + // scope modifiers + "public": kw("modifier"), + "private": kw("modifier"), + "protected": kw("modifier"), + "abstract": kw("modifier"), + + // operators + "as": operator, + + // types + "string": type, "number": type, "boolean": type, "any": type + }; + + for (var attr in tsKeywords) { + jsKeywords[attr] = tsKeywords[attr]; + } + } + + return jsKeywords; + }(); + + var isOperatorChar = /[+\-*&%=<>!?|~^]/; + var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; + + function readRegexp(stream) { + var escaped = false, next, inSet = false; + while ((next = stream.next()) != null) { + if (!escaped) { + if (next == "/" && !inSet) return; + if (next == "[") inSet = true; + else if (inSet && next == "]") inSet = false; + } + escaped = !escaped && next == "\\"; + } + } + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + function ret(tp, style, cont) { + type = tp; content = cont; + return style; + } + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) { + return ret("number", "number"); + } else if (ch == "." && stream.match("..")) { + return ret("spread", "meta"); + } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + return ret(ch); + } else if (ch == "=" && stream.eat(">")) { + return ret("=>", "operator"); + } else if (ch == "0" && stream.eat(/x/i)) { + stream.eatWhile(/[\da-f]/i); + return ret("number", "number"); + } else if (ch == "0" && stream.eat(/o/i)) { + stream.eatWhile(/[0-7]/i); + return ret("number", "number"); + } else if (ch == "0" && stream.eat(/b/i)) { + stream.eatWhile(/[01]/i); + return ret("number", "number"); + } else if (/\d/.test(ch)) { + stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); + return ret("number", "number"); + } else if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } else if (stream.eat("/")) { + stream.skipToEnd(); + return ret("comment", "comment"); + } else if (expressionAllowed(stream, state, 1)) { + readRegexp(stream); + stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/); + return ret("regexp", "string-2"); + } else { + stream.eatWhile(isOperatorChar); + return ret("operator", "operator", stream.current()); + } + } else if (ch == "`") { + state.tokenize = tokenQuasi; + return tokenQuasi(stream, state); + } else if (ch == "#") { + stream.skipToEnd(); + return ret("error", "error"); + } else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return ret("operator", "operator", stream.current()); + } else if (wordRE.test(ch)) { + stream.eatWhile(wordRE); + var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; + return (known && state.lastType != ".") ? ret(known.type, known.style, word) : + ret("variable", "variable", word); + } + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next; + if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){ + state.tokenize = tokenBase; + return ret("jsonld-keyword", "meta"); + } + while ((next = stream.next()) != null) { + if (next == quote && !escaped) break; + escaped = !escaped && next == "\\"; + } + if (!escaped) state.tokenize = tokenBase; + return ret("string", "string"); + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + function tokenQuasi(stream, state) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && next == "\\"; + } + return ret("quasi", "string-2", stream.current()); + } + + var brackets = "([{}])"; + // This is a crude lookahead trick to try and notice that we're + // parsing the argument patterns for a fat-arrow function before we + // actually hit the arrow token. It only works if the arrow is on + // the same line as the arguments and there's no strange noise + // (comments) in between. Fallback is to only notice when we hit the + // arrow, and not declare the arguments as locals for the arrow + // body. + function findFatArrow(stream, state) { + if (state.fatArrowAt) state.fatArrowAt = null; + var arrow = stream.string.indexOf("=>", stream.start); + if (arrow < 0) return; + + var depth = 0, sawSomething = false; + for (var pos = arrow - 1; pos >= 0; --pos) { + var ch = stream.string.charAt(pos); + var bracket = brackets.indexOf(ch); + if (bracket >= 0 && bracket < 3) { + if (!depth) { ++pos; break; } + if (--depth == 0) break; + } else if (bracket >= 3 && bracket < 6) { + ++depth; + } else if (wordRE.test(ch)) { + sawSomething = true; + } else if (/["'\/]/.test(ch)) { + return; + } else if (sawSomething && !depth) { + ++pos; + break; + } + } + if (sawSomething && !depth) state.fatArrowAt = pos; + } + + // Parser + + var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true}; + + function JSLexical(indented, column, type, align, prev, info) { + this.indented = indented; + this.column = column; + this.type = type; + this.prev = prev; + this.info = info; + if (align != null) this.align = align; + } + + function inScope(state, varname) { + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return true; + for (var cx = state.context; cx; cx = cx.prev) { + for (var v = cx.vars; v; v = v.next) + if (v.name == varname) return true; + } + } + + function parseJS(state, style, type, content, stream) { + var cc = state.cc; + // Communicate our context to the combinators. + // (Less wasteful than consing up a hundred closures on every call.) + cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style; + + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = true; + + while(true) { + var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; + if (combinator(type, content)) { + while(cc.length && cc[cc.length - 1].lex) + cc.pop()(); + if (cx.marked) return cx.marked; + if (type == "variable" && inScope(state, content)) return "variable-2"; + return style; + } + } + } + + // Combinator utils + + var cx = {state: null, column: null, marked: null, cc: null}; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + function register(varname) { + function inList(list) { + for (var v = list; v; v = v.next) + if (v.name == varname) return true; + return false; + } + var state = cx.state; + cx.marked = "def"; + if (state.context) { + if (inList(state.localVars)) return; + state.localVars = {name: varname, next: state.localVars}; + } else { + if (inList(state.globalVars)) return; + if (parserConfig.globalVars) + state.globalVars = {name: varname, next: state.globalVars}; + } + } + + // Combinators + + var defaultVars = {name: "this", next: {name: "arguments"}}; + function pushcontext() { + cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; + cx.state.localVars = defaultVars; + } + function popcontext() { + cx.state.localVars = cx.state.context.vars; + cx.state.context = cx.state.context.prev; + } + function pushlex(type, info) { + var result = function() { + var state = cx.state, indent = state.indented; + if (state.lexical.type == "stat") indent = state.lexical.indented; + else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev) + indent = outer.indented; + state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info); + }; + result.lex = true; + return result; + } + function poplex() { + var state = cx.state; + if (state.lexical.prev) { + if (state.lexical.type == ")") + state.indented = state.lexical.indented; + state.lexical = state.lexical.prev; + } + } + poplex.lex = true; + + function expect(wanted) { + function exp(type) { + if (type == wanted) return cont(); + else if (wanted == ";") return pass(); + else return cont(exp); + }; + return exp; + } + + function statement(type, value) { + if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex); + if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); + if (type == "keyword b") return cont(pushlex("form"), statement, poplex); + if (type == "{") return cont(pushlex("}"), block, poplex); + if (type == ";") return cont(); + if (type == "if") { + if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) + cx.state.cc.pop()(); + return cont(pushlex("form"), expression, statement, poplex, maybeelse); + } + if (type == "function") return cont(functiondef); + if (type == "for") return cont(pushlex("form"), forspec, statement, poplex); + if (type == "variable") return cont(pushlex("stat"), maybelabel); + if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), + block, poplex, poplex); + if (type == "case") return cont(expression, expect(":")); + if (type == "default") return cont(expect(":")); + if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), + statement, poplex, popcontext); + if (type == "class") return cont(pushlex("form"), className, poplex); + if (type == "export") return cont(pushlex("stat"), afterExport, poplex); + if (type == "import") return cont(pushlex("stat"), afterImport, poplex); + if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex) + return pass(pushlex("stat"), expression, expect(";"), poplex); + } + function expression(type) { + return expressionInner(type, false); + } + function expressionNoComma(type) { + return expressionInner(type, true); + } + function expressionInner(type, noComma) { + if (cx.state.fatArrowAt == cx.stream.start) { + var body = noComma ? arrowBodyNoComma : arrowBody; + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext); + else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); + } + + var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; + if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); + if (type == "function") return cont(functiondef, maybeop); + if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression); + if (type == "(") return cont(pushlex(")"), maybeexpression, comprehension, expect(")"), poplex, maybeop); + if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); + if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); + if (type == "{") return contCommasep(objprop, "}", null, maybeop); + if (type == "quasi") return pass(quasi, maybeop); + if (type == "new") return cont(maybeTarget(noComma)); + return cont(); + } + function maybeexpression(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expression); + } + function maybeexpressionNoComma(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expressionNoComma); + } + + function maybeoperatorComma(type, value) { + if (type == ",") return cont(expression); + return maybeoperatorNoComma(type, value, false); + } + function maybeoperatorNoComma(type, value, noComma) { + var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma; + var expr = noComma == false ? expression : expressionNoComma; + if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); + if (type == "operator") { + if (/\+\+|--/.test(value)) return cont(me); + if (value == "?") return cont(expression, expect(":"), expr); + return cont(expr); + } + if (type == "quasi") { return pass(quasi, me); } + if (type == ";") return; + if (type == "(") return contCommasep(expressionNoComma, ")", "call", me); + if (type == ".") return cont(property, me); + if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); + } + function quasi(type, value) { + if (type != "quasi") return pass(); + if (value.slice(value.length - 2) != "${") return cont(quasi); + return cont(expression, continueQuasi); + } + function continueQuasi(type) { + if (type == "}") { + cx.marked = "string-2"; + cx.state.tokenize = tokenQuasi; + return cont(quasi); + } + } + function arrowBody(type) { + findFatArrow(cx.stream, cx.state); + return pass(type == "{" ? statement : expression); + } + function arrowBodyNoComma(type) { + findFatArrow(cx.stream, cx.state); + return pass(type == "{" ? statement : expressionNoComma); + } + function maybeTarget(noComma) { + return function(type) { + if (type == ".") return cont(noComma ? targetNoComma : target); + else return pass(noComma ? expressionNoComma : expression); + }; + } + function target(_, value) { + if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); } + } + function targetNoComma(_, value) { + if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); } + } + function maybelabel(type) { + if (type == ":") return cont(poplex, statement); + return pass(maybeoperatorComma, expect(";"), poplex); + } + function property(type) { + if (type == "variable") {cx.marked = "property"; return cont();} + } + function objprop(type, value) { + if (type == "variable" || cx.style == "keyword") { + cx.marked = "property"; + if (value == "get" || value == "set") return cont(getterSetter); + return cont(afterprop); + } else if (type == "number" || type == "string") { + cx.marked = jsonldMode ? "property" : (cx.style + " property"); + return cont(afterprop); + } else if (type == "jsonld-keyword") { + return cont(afterprop); + } else if (type == "modifier") { + return cont(objprop) + } else if (type == "[") { + return cont(expression, expect("]"), afterprop); + } else if (type == "spread") { + return cont(expression); + } + } + function getterSetter(type) { + if (type != "variable") return pass(afterprop); + cx.marked = "property"; + return cont(functiondef); + } + function afterprop(type) { + if (type == ":") return cont(expressionNoComma); + if (type == "(") return pass(functiondef); + } + function commasep(what, end) { + function proceed(type) { + if (type == ",") { + var lex = cx.state.lexical; + if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; + return cont(what, proceed); + } + if (type == end) return cont(); + return cont(expect(end)); + } + return function(type) { + if (type == end) return cont(); + return pass(what, proceed); + }; + } + function contCommasep(what, end, info) { + for (var i = 3; i < arguments.length; i++) + cx.cc.push(arguments[i]); + return cont(pushlex(end, info), commasep(what, end), poplex); + } + function block(type) { + if (type == "}") return cont(); + return pass(statement, block); + } + function maybetype(type) { + if (isTS && type == ":") return cont(typedef); + } + function maybedefault(_, value) { + if (value == "=") return cont(expressionNoComma); + } + function typedef(type) { + if (type == "variable") {cx.marked = "variable-3"; return cont();} + } + function vardef() { + return pass(pattern, maybetype, maybeAssign, vardefCont); + } + function pattern(type, value) { + if (type == "modifier") return cont(pattern) + if (type == "variable") { register(value); return cont(); } + if (type == "spread") return cont(pattern); + if (type == "[") return contCommasep(pattern, "]"); + if (type == "{") return contCommasep(proppattern, "}"); + } + function proppattern(type, value) { + if (type == "variable" && !cx.stream.match(/^\s*:/, false)) { + register(value); + return cont(maybeAssign); + } + if (type == "variable") cx.marked = "property"; + if (type == "spread") return cont(pattern); + if (type == "}") return pass(); + return cont(expect(":"), pattern, maybeAssign); + } + function maybeAssign(_type, value) { + if (value == "=") return cont(expressionNoComma); + } + function vardefCont(type) { + if (type == ",") return cont(vardef); + } + function maybeelse(type, value) { + if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex); + } + function forspec(type) { + if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex); + } + function forspec1(type) { + if (type == "var") return cont(vardef, expect(";"), forspec2); + if (type == ";") return cont(forspec2); + if (type == "variable") return cont(formaybeinof); + return pass(expression, expect(";"), forspec2); + } + function formaybeinof(_type, value) { + if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } + return cont(maybeoperatorComma, forspec2); + } + function forspec2(type, value) { + if (type == ";") return cont(forspec3); + if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } + return pass(expression, expect(";"), forspec3); + } + function forspec3(type) { + if (type != ")") cont(expression); + } + function functiondef(type, value) { + if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} + if (type == "variable") {register(value); return cont(functiondef);} + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, statement, popcontext); + } + function funarg(type) { + if (type == "spread") return cont(funarg); + return pass(pattern, maybetype, maybedefault); + } + function className(type, value) { + if (type == "variable") {register(value); return cont(classNameAfter);} + } + function classNameAfter(type, value) { + if (value == "extends") return cont(expression, classNameAfter); + if (type == "{") return cont(pushlex("}"), classBody, poplex); + } + function classBody(type, value) { + if (type == "variable" || cx.style == "keyword") { + if (value == "static") { + cx.marked = "keyword"; + return cont(classBody); + } + cx.marked = "property"; + if (value == "get" || value == "set") return cont(classGetterSetter, functiondef, classBody); + return cont(functiondef, classBody); + } + if (value == "*") { + cx.marked = "keyword"; + return cont(classBody); + } + if (type == ";") return cont(classBody); + if (type == "}") return cont(); + } + function classGetterSetter(type) { + if (type != "variable") return pass(); + cx.marked = "property"; + return cont(); + } + function afterExport(_type, value) { + if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } + if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); } + return pass(statement); + } + function afterImport(type) { + if (type == "string") return cont(); + return pass(importSpec, maybeFrom); + } + function importSpec(type, value) { + if (type == "{") return contCommasep(importSpec, "}"); + if (type == "variable") register(value); + if (value == "*") cx.marked = "keyword"; + return cont(maybeAs); + } + function maybeAs(_type, value) { + if (value == "as") { cx.marked = "keyword"; return cont(importSpec); } + } + function maybeFrom(_type, value) { + if (value == "from") { cx.marked = "keyword"; return cont(expression); } + } + function arrayLiteral(type) { + if (type == "]") return cont(); + return pass(expressionNoComma, maybeArrayComprehension); + } + function maybeArrayComprehension(type) { + if (type == "for") return pass(comprehension, expect("]")); + if (type == ",") return cont(commasep(maybeexpressionNoComma, "]")); + return pass(commasep(expressionNoComma, "]")); + } + function comprehension(type) { + if (type == "for") return cont(forspec, comprehension); + if (type == "if") return cont(expression, comprehension); + } + + function isContinuedStatement(state, textAfter) { + return state.lastType == "operator" || state.lastType == "," || + isOperatorChar.test(textAfter.charAt(0)) || + /[,.]/.test(textAfter.charAt(0)); + } + + // Interface + + return { + startState: function(basecolumn) { + var state = { + tokenize: tokenBase, + lastType: "sof", + cc: [], + lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), + localVars: parserConfig.localVars, + context: parserConfig.localVars && {vars: parserConfig.localVars}, + indented: basecolumn || 0 + }; + if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") + state.globalVars = parserConfig.globalVars; + return state; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = false; + state.indented = stream.indentation(); + findFatArrow(stream, state); + } + if (state.tokenize != tokenComment && stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (type == "comment") return style; + state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; + return parseJS(state, style, type, content, stream); + }, + + indent: function(state, textAfter) { + if (state.tokenize == tokenComment) return CodeMirror.Pass; + if (state.tokenize != tokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; + // Kludge to prevent 'maybelse' from blocking lexical scope pops + if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) { + var c = state.cc[i]; + if (c == poplex) lexical = lexical.prev; + else if (c != maybeelse) break; + } + if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; + if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") + lexical = lexical.prev; + var type = lexical.type, closing = firstChar == type; + + if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0); + else if (type == "form" && firstChar == "{") return lexical.indented; + else if (type == "form") return lexical.indented + indentUnit; + else if (type == "stat") + return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0); + else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) + return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); + else if (lexical.align) return lexical.column + (closing ? 0 : 1); + else return lexical.indented + (closing ? 0 : indentUnit); + }, + + electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, + blockCommentStart: jsonMode ? null : "/*", + blockCommentEnd: jsonMode ? null : "*/", + lineComment: jsonMode ? null : "//", + fold: "brace", + closeBrackets: "()[]{}''\"\"``", + + helperType: jsonMode ? "json" : "javascript", + jsonldMode: jsonldMode, + jsonMode: jsonMode, + + expressionAllowed: expressionAllowed, + skipExpression: function(state) { + var top = state.cc[state.cc.length - 1] + if (top == expression || top == expressionNoComma) state.cc.pop() + } + }; +}); + +CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/); + +CodeMirror.defineMIME("text/javascript", "javascript"); +CodeMirror.defineMIME("text/ecmascript", "javascript"); +CodeMirror.defineMIME("application/javascript", "javascript"); +CodeMirror.defineMIME("application/x-javascript", "javascript"); +CodeMirror.defineMIME("application/ecmascript", "javascript"); +CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); +CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true}); +CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true}); +CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); +CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); + +}); diff --git a/app/lib/codemirror/mode/javascript/json-ld.html b/app/lib/codemirror/mode/javascript/json-ld.html new file mode 100644 index 0000000..3a37f0b --- /dev/null +++ b/app/lib/codemirror/mode/javascript/json-ld.html @@ -0,0 +1,72 @@ + + +CodeMirror: JSON-LD mode + + + + + + + + + + + + +
+

JSON-LD mode

+ + +
+ + + +

This is a specialization of the JavaScript mode.

+
diff --git a/app/lib/codemirror/mode/javascript/typescript.html b/app/lib/codemirror/mode/javascript/typescript.html new file mode 100644 index 0000000..2cfc538 --- /dev/null +++ b/app/lib/codemirror/mode/javascript/typescript.html @@ -0,0 +1,61 @@ + + +CodeMirror: TypeScript mode + + + + + + + + + +
+

TypeScript mode

+ + +
+ + + +

This is a specialization of the JavaScript mode.

+
diff --git a/app/lib/codemirror/mode/jsx/jsx.js b/app/lib/codemirror/mode/jsx/jsx.js new file mode 100644 index 0000000..45c3024 --- /dev/null +++ b/app/lib/codemirror/mode/jsx/jsx.js @@ -0,0 +1,148 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript")) + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript"], mod) + else // Plain browser env + mod(CodeMirror) +})(function(CodeMirror) { + "use strict" + + // Depth means the amount of open braces in JS context, in XML + // context 0 means not in tag, 1 means in tag, and 2 means in tag + // and js block comment. + function Context(state, mode, depth, prev) { + this.state = state; this.mode = mode; this.depth = depth; this.prev = prev + } + + function copyContext(context) { + return new Context(CodeMirror.copyState(context.mode, context.state), + context.mode, + context.depth, + context.prev && copyContext(context.prev)) + } + + CodeMirror.defineMode("jsx", function(config, modeConfig) { + var xmlMode = CodeMirror.getMode(config, {name: "xml", allowMissing: true, multilineTagIndentPastTag: false}) + var jsMode = CodeMirror.getMode(config, modeConfig && modeConfig.base || "javascript") + + function flatXMLIndent(state) { + var tagName = state.tagName + state.tagName = null + var result = xmlMode.indent(state, "") + state.tagName = tagName + return result + } + + function token(stream, state) { + if (state.context.mode == xmlMode) + return xmlToken(stream, state, state.context) + else + return jsToken(stream, state, state.context) + } + + function xmlToken(stream, state, cx) { + if (cx.depth == 2) { // Inside a JS /* */ comment + if (stream.match(/^.*?\*\//)) cx.depth = 1 + else stream.skipToEnd() + return "comment" + } + + if (stream.peek() == "{") { + xmlMode.skipAttribute(cx.state) + + var indent = flatXMLIndent(cx.state), xmlContext = cx.state.context + // If JS starts on same line as tag + if (xmlContext && stream.match(/^[^>]*>\s*$/, false)) { + while (xmlContext.prev && !xmlContext.startOfLine) + xmlContext = xmlContext.prev + // If tag starts the line, use XML indentation level + if (xmlContext.startOfLine) indent -= config.indentUnit + // Else use JS indentation level + else if (cx.prev.state.lexical) indent = cx.prev.state.lexical.indented + // Else if inside of tag + } else if (cx.depth == 1) { + indent += config.indentUnit + } + + state.context = new Context(CodeMirror.startState(jsMode, indent), + jsMode, 0, state.context) + return null + } + + if (cx.depth == 1) { // Inside of tag + if (stream.peek() == "<") { // Tag inside of tag + xmlMode.skipAttribute(cx.state) + state.context = new Context(CodeMirror.startState(xmlMode, flatXMLIndent(cx.state)), + xmlMode, 0, state.context) + return null + } else if (stream.match("//")) { + stream.skipToEnd() + return "comment" + } else if (stream.match("/*")) { + cx.depth = 2 + return token(stream, state) + } + } + + var style = xmlMode.token(stream, cx.state), cur = stream.current(), stop + if (/\btag\b/.test(style)) { + if (/>$/.test(cur)) { + if (cx.state.context) cx.depth = 0 + else state.context = state.context.prev + } else if (/^ -1) { + stream.backUp(cur.length - stop) + } + return style + } + + function jsToken(stream, state, cx) { + if (stream.peek() == "<" && jsMode.expressionAllowed(stream, cx.state)) { + jsMode.skipExpression(cx.state) + state.context = new Context(CodeMirror.startState(xmlMode, jsMode.indent(cx.state, "")), + xmlMode, 0, state.context) + return null + } + + var style = jsMode.token(stream, cx.state) + if (!style && cx.depth != null) { + var cur = stream.current() + if (cur == "{") { + cx.depth++ + } else if (cur == "}") { + if (--cx.depth == 0) state.context = state.context.prev + } + } + return style + } + + return { + startState: function() { + return {context: new Context(CodeMirror.startState(jsMode), jsMode)} + }, + + copyState: function(state) { + return {context: copyContext(state.context)} + }, + + token: token, + + indent: function(state, textAfter, fullLine) { + return state.context.mode.indent(state.context.state, textAfter, fullLine) + }, + + innerMode: function(state) { + return state.context + } + } + }, "xml", "javascript") + + CodeMirror.defineMIME("text/jsx", "jsx") + CodeMirror.defineMIME("text/typescript-jsx", {name: "jsx", base: {name: "javascript", typescript: true}}) +}); diff --git a/app/lib/codemirror/mode/markdown/markdown.js b/app/lib/codemirror/mode/markdown/markdown.js new file mode 100644 index 0000000..37329c2 --- /dev/null +++ b/app/lib/codemirror/mode/markdown/markdown.js @@ -0,0 +1,797 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../xml/xml"), require("../meta")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../xml/xml", "../meta"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { + + var htmlMode = CodeMirror.getMode(cmCfg, "text/html"); + var htmlModeMissing = htmlMode.name == "null" + + function getMode(name) { + if (CodeMirror.findModeByName) { + var found = CodeMirror.findModeByName(name); + if (found) name = found.mime || found.mimes[0]; + } + var mode = CodeMirror.getMode(cmCfg, name); + return mode.name == "null" ? null : mode; + } + + // Should characters that affect highlighting be highlighted separate? + // Does not include characters that will be output (such as `1.` and `-` for lists) + if (modeCfg.highlightFormatting === undefined) + modeCfg.highlightFormatting = false; + + // Maximum number of nested blockquotes. Set to 0 for infinite nesting. + // Excess `>` will emit `error` token. + if (modeCfg.maxBlockquoteDepth === undefined) + modeCfg.maxBlockquoteDepth = 0; + + // Should underscores in words open/close em/strong? + if (modeCfg.underscoresBreakWords === undefined) + modeCfg.underscoresBreakWords = true; + + // Use `fencedCodeBlocks` to configure fenced code blocks. false to + // disable, string to specify a precise regexp that the fence should + // match, and true to allow three or more backticks or tildes (as + // per CommonMark). + + // Turn on task lists? ("- [ ] " and "- [x] ") + if (modeCfg.taskLists === undefined) modeCfg.taskLists = false; + + // Turn on strikethrough syntax + if (modeCfg.strikethrough === undefined) + modeCfg.strikethrough = false; + + // Allow token types to be overridden by user-provided token types. + if (modeCfg.tokenTypeOverrides === undefined) + modeCfg.tokenTypeOverrides = {}; + + var tokenTypes = { + header: "header", + code: "comment", + quote: "quote", + list1: "variable-2", + list2: "variable-3", + list3: "keyword", + hr: "hr", + image: "tag", + formatting: "formatting", + linkInline: "link", + linkEmail: "link", + linkText: "link", + linkHref: "string", + em: "em", + strong: "strong", + strikethrough: "strikethrough" + }; + + for (var tokenType in tokenTypes) { + if (tokenTypes.hasOwnProperty(tokenType) && modeCfg.tokenTypeOverrides[tokenType]) { + tokenTypes[tokenType] = modeCfg.tokenTypeOverrides[tokenType]; + } + } + + var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/ + , ulRE = /^[*\-+]\s+/ + , olRE = /^[0-9]+([.)])\s+/ + , taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE + , atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/ + , setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/ + , textRE = /^[^#!\[\]*_\\<>` "'(~]+/ + , fencedCodeRE = new RegExp("^(" + (modeCfg.fencedCodeBlocks === true ? "~~~+|```+" : modeCfg.fencedCodeBlocks) + + ")[ \\t]*([\\w+#\-]*)"); + + function switchInline(stream, state, f) { + state.f = state.inline = f; + return f(stream, state); + } + + function switchBlock(stream, state, f) { + state.f = state.block = f; + return f(stream, state); + } + + function lineIsEmpty(line) { + return !line || !/\S/.test(line.string) + } + + // Blocks + + function blankLine(state) { + // Reset linkTitle state + state.linkTitle = false; + // Reset EM state + state.em = false; + // Reset STRONG state + state.strong = false; + // Reset strikethrough state + state.strikethrough = false; + // Reset state.quote + state.quote = 0; + // Reset state.indentedCode + state.indentedCode = false; + if (htmlModeMissing && state.f == htmlBlock) { + state.f = inlineNormal; + state.block = blockNormal; + } + // Reset state.trailingSpace + state.trailingSpace = 0; + state.trailingSpaceNewLine = false; + // Mark this line as blank + state.prevLine = state.thisLine + state.thisLine = null + return null; + } + + function blockNormal(stream, state) { + + var sol = stream.sol(); + + var prevLineIsList = state.list !== false, + prevLineIsIndentedCode = state.indentedCode; + + state.indentedCode = false; + + if (prevLineIsList) { + if (state.indentationDiff >= 0) { // Continued list + if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block + state.indentation -= state.indentationDiff; + } + state.list = null; + } else if (state.indentation > 0) { + state.list = null; + } else { // No longer a list + state.list = false; + } + } + + var match = null; + if (state.indentationDiff >= 4) { + stream.skipToEnd(); + if (prevLineIsIndentedCode || lineIsEmpty(state.prevLine)) { + state.indentation -= 4; + state.indentedCode = true; + return tokenTypes.code; + } else { + return null; + } + } else if (stream.eatSpace()) { + return null; + } else if ((match = stream.match(atxHeaderRE)) && match[1].length <= 6) { + state.header = match[1].length; + if (modeCfg.highlightFormatting) state.formatting = "header"; + state.f = state.inline; + return getType(state); + } else if (!lineIsEmpty(state.prevLine) && !state.quote && !prevLineIsList && + !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) { + state.header = match[0].charAt(0) == '=' ? 1 : 2; + if (modeCfg.highlightFormatting) state.formatting = "header"; + state.f = state.inline; + return getType(state); + } else if (stream.eat('>')) { + state.quote = sol ? 1 : state.quote + 1; + if (modeCfg.highlightFormatting) state.formatting = "quote"; + stream.eatSpace(); + return getType(state); + } else if (stream.peek() === '[') { + return switchInline(stream, state, footnoteLink); + } else if (stream.match(hrRE, true)) { + state.hr = true; + return tokenTypes.hr; + } else if ((lineIsEmpty(state.prevLine) || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) { + var listType = null; + if (stream.match(ulRE, true)) { + listType = 'ul'; + } else { + stream.match(olRE, true); + listType = 'ol'; + } + state.indentation = stream.column() + stream.current().length; + state.list = true; + + // While this list item's marker's indentation + // is less than the deepest list item's content's indentation, + // pop the deepest list item indentation off the stack. + while (state.listStack && stream.column() < state.listStack[state.listStack.length - 1]) { + state.listStack.pop(); + } + + // Add this list item's content's indentation to the stack + state.listStack.push(state.indentation); + + if (modeCfg.taskLists && stream.match(taskListRE, false)) { + state.taskList = true; + } + state.f = state.inline; + if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType]; + return getType(state); + } else if (modeCfg.fencedCodeBlocks && (match = stream.match(fencedCodeRE, true))) { + state.fencedChars = match[1] + // try switching mode + state.localMode = getMode(match[2]); + if (state.localMode) state.localState = CodeMirror.startState(state.localMode); + state.f = state.block = local; + if (modeCfg.highlightFormatting) state.formatting = "code-block"; + state.code = -1 + return getType(state); + } + + return switchInline(stream, state, state.inline); + } + + function htmlBlock(stream, state) { + var style = htmlMode.token(stream, state.htmlState); + if (!htmlModeMissing) { + var inner = CodeMirror.innerMode(htmlMode, state.htmlState) + if ((inner.mode.name == "xml" && inner.state.tagStart === null && + (!inner.state.context && inner.state.tokenize.isInText)) || + (state.md_inside && stream.current().indexOf(">") > -1)) { + state.f = inlineNormal; + state.block = blockNormal; + state.htmlState = null; + } + } + return style; + } + + function local(stream, state) { + if (state.fencedChars && stream.match(state.fencedChars, false)) { + state.localMode = state.localState = null; + state.f = state.block = leavingLocal; + return null; + } else if (state.localMode) { + return state.localMode.token(stream, state.localState); + } else { + stream.skipToEnd(); + return tokenTypes.code; + } + } + + function leavingLocal(stream, state) { + stream.match(state.fencedChars); + state.block = blockNormal; + state.f = inlineNormal; + state.fencedChars = null; + if (modeCfg.highlightFormatting) state.formatting = "code-block"; + state.code = 1 + var returnType = getType(state); + state.code = 0 + return returnType; + } + + // Inline + function getType(state) { + var styles = []; + + if (state.formatting) { + styles.push(tokenTypes.formatting); + + if (typeof state.formatting === "string") state.formatting = [state.formatting]; + + for (var i = 0; i < state.formatting.length; i++) { + styles.push(tokenTypes.formatting + "-" + state.formatting[i]); + + if (state.formatting[i] === "header") { + styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.header); + } + + // Add `formatting-quote` and `formatting-quote-#` for blockquotes + // Add `error` instead if the maximum blockquote nesting depth is passed + if (state.formatting[i] === "quote") { + if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { + styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.quote); + } else { + styles.push("error"); + } + } + } + } + + if (state.taskOpen) { + styles.push("meta"); + return styles.length ? styles.join(' ') : null; + } + if (state.taskClosed) { + styles.push("property"); + return styles.length ? styles.join(' ') : null; + } + + if (state.linkHref) { + styles.push(tokenTypes.linkHref, "url"); + } else { // Only apply inline styles to non-url text + if (state.strong) { styles.push(tokenTypes.strong); } + if (state.em) { styles.push(tokenTypes.em); } + if (state.strikethrough) { styles.push(tokenTypes.strikethrough); } + if (state.linkText) { styles.push(tokenTypes.linkText); } + if (state.code) { styles.push(tokenTypes.code); } + } + + if (state.header) { styles.push(tokenTypes.header, tokenTypes.header + "-" + state.header); } + + if (state.quote) { + styles.push(tokenTypes.quote); + + // Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth + if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { + styles.push(tokenTypes.quote + "-" + state.quote); + } else { + styles.push(tokenTypes.quote + "-" + modeCfg.maxBlockquoteDepth); + } + } + + if (state.list !== false) { + var listMod = (state.listStack.length - 1) % 3; + if (!listMod) { + styles.push(tokenTypes.list1); + } else if (listMod === 1) { + styles.push(tokenTypes.list2); + } else { + styles.push(tokenTypes.list3); + } + } + + if (state.trailingSpaceNewLine) { + styles.push("trailing-space-new-line"); + } else if (state.trailingSpace) { + styles.push("trailing-space-" + (state.trailingSpace % 2 ? "a" : "b")); + } + + return styles.length ? styles.join(' ') : null; + } + + function handleText(stream, state) { + if (stream.match(textRE, true)) { + return getType(state); + } + return undefined; + } + + function inlineNormal(stream, state) { + var style = state.text(stream, state); + if (typeof style !== 'undefined') + return style; + + if (state.list) { // List marker (*, +, -, 1., etc) + state.list = null; + return getType(state); + } + + if (state.taskList) { + var taskOpen = stream.match(taskListRE, true)[1] !== "x"; + if (taskOpen) state.taskOpen = true; + else state.taskClosed = true; + if (modeCfg.highlightFormatting) state.formatting = "task"; + state.taskList = false; + return getType(state); + } + + state.taskOpen = false; + state.taskClosed = false; + + if (state.header && stream.match(/^#+$/, true)) { + if (modeCfg.highlightFormatting) state.formatting = "header"; + return getType(state); + } + + // Get sol() value now, before character is consumed + var sol = stream.sol(); + + var ch = stream.next(); + + // Matches link titles present on next line + if (state.linkTitle) { + state.linkTitle = false; + var matchCh = ch; + if (ch === '(') { + matchCh = ')'; + } + matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); + var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh; + if (stream.match(new RegExp(regex), true)) { + return tokenTypes.linkHref; + } + } + + // If this block is changed, it may need to be updated in GFM mode + if (ch === '`') { + var previousFormatting = state.formatting; + if (modeCfg.highlightFormatting) state.formatting = "code"; + stream.eatWhile('`'); + var count = stream.current().length + if (state.code == 0) { + state.code = count + return getType(state) + } else if (count == state.code) { // Must be exact + var t = getType(state) + state.code = 0 + return t + } else { + state.formatting = previousFormatting + return getType(state) + } + } else if (state.code) { + return getType(state); + } + + if (ch === '\\') { + stream.next(); + if (modeCfg.highlightFormatting) { + var type = getType(state); + var formattingEscape = tokenTypes.formatting + "-escape"; + return type ? type + " " + formattingEscape : formattingEscape; + } + } + + if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) { + stream.match(/\[[^\]]*\]/); + state.inline = state.f = linkHref; + return tokenTypes.image; + } + + if (ch === '[' && stream.match(/[^\]]*\](\(.*\)| ?\[.*?\])/, false)) { + state.linkText = true; + if (modeCfg.highlightFormatting) state.formatting = "link"; + return getType(state); + } + + if (ch === ']' && state.linkText && stream.match(/\(.*?\)| ?\[.*?\]/, false)) { + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + state.linkText = false; + state.inline = state.f = linkHref; + return type; + } + + if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) { + state.f = state.inline = linkInline; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + if (type){ + type += " "; + } else { + type = ""; + } + return type + tokenTypes.linkInline; + } + + if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) { + state.f = state.inline = linkInline; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + if (type){ + type += " "; + } else { + type = ""; + } + return type + tokenTypes.linkEmail; + } + + if (ch === '<' && stream.match(/^(!--|\w)/, false)) { + var end = stream.string.indexOf(">", stream.pos); + if (end != -1) { + var atts = stream.string.substring(stream.start, end); + if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) state.md_inside = true; + } + stream.backUp(1); + state.htmlState = CodeMirror.startState(htmlMode); + return switchBlock(stream, state, htmlBlock); + } + + if (ch === '<' && stream.match(/^\/\w*?>/)) { + state.md_inside = false; + return "tag"; + } + + var ignoreUnderscore = false; + if (!modeCfg.underscoresBreakWords) { + if (ch === '_' && stream.peek() !== '_' && stream.match(/(\w)/, false)) { + var prevPos = stream.pos - 2; + if (prevPos >= 0) { + var prevCh = stream.string.charAt(prevPos); + if (prevCh !== '_' && prevCh.match(/(\w)/, false)) { + ignoreUnderscore = true; + } + } + } + } + if (ch === '*' || (ch === '_' && !ignoreUnderscore)) { + if (sol && stream.peek() === ' ') { + // Do nothing, surrounded by newline and space + } else if (state.strong === ch && stream.eat(ch)) { // Remove STRONG + if (modeCfg.highlightFormatting) state.formatting = "strong"; + var t = getType(state); + state.strong = false; + return t; + } else if (!state.strong && stream.eat(ch)) { // Add STRONG + state.strong = ch; + if (modeCfg.highlightFormatting) state.formatting = "strong"; + return getType(state); + } else if (state.em === ch) { // Remove EM + if (modeCfg.highlightFormatting) state.formatting = "em"; + var t = getType(state); + state.em = false; + return t; + } else if (!state.em) { // Add EM + state.em = ch; + if (modeCfg.highlightFormatting) state.formatting = "em"; + return getType(state); + } + } else if (ch === ' ') { + if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces + if (stream.peek() === ' ') { // Surrounded by spaces, ignore + return getType(state); + } else { // Not surrounded by spaces, back up pointer + stream.backUp(1); + } + } + } + + if (modeCfg.strikethrough) { + if (ch === '~' && stream.eatWhile(ch)) { + if (state.strikethrough) {// Remove strikethrough + if (modeCfg.highlightFormatting) state.formatting = "strikethrough"; + var t = getType(state); + state.strikethrough = false; + return t; + } else if (stream.match(/^[^\s]/, false)) {// Add strikethrough + state.strikethrough = true; + if (modeCfg.highlightFormatting) state.formatting = "strikethrough"; + return getType(state); + } + } else if (ch === ' ') { + if (stream.match(/^~~/, true)) { // Probably surrounded by space + if (stream.peek() === ' ') { // Surrounded by spaces, ignore + return getType(state); + } else { // Not surrounded by spaces, back up pointer + stream.backUp(2); + } + } + } + } + + if (ch === ' ') { + if (stream.match(/ +$/, false)) { + state.trailingSpace++; + } else if (state.trailingSpace) { + state.trailingSpaceNewLine = true; + } + } + + return getType(state); + } + + function linkInline(stream, state) { + var ch = stream.next(); + + if (ch === ">") { + state.f = state.inline = inlineNormal; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + if (type){ + type += " "; + } else { + type = ""; + } + return type + tokenTypes.linkInline; + } + + stream.match(/^[^>]+/, true); + + return tokenTypes.linkInline; + } + + function linkHref(stream, state) { + // Check if space, and return NULL if so (to avoid marking the space) + if(stream.eatSpace()){ + return null; + } + var ch = stream.next(); + if (ch === '(' || ch === '[') { + state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]", 0); + if (modeCfg.highlightFormatting) state.formatting = "link-string"; + state.linkHref = true; + return getType(state); + } + return 'error'; + } + + var linkRE = { + ")": /^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/, + "]": /^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/ + } + + function getLinkHrefInside(endChar) { + return function(stream, state) { + var ch = stream.next(); + + if (ch === endChar) { + state.f = state.inline = inlineNormal; + if (modeCfg.highlightFormatting) state.formatting = "link-string"; + var returnState = getType(state); + state.linkHref = false; + return returnState; + } + + stream.match(linkRE[endChar]) + state.linkHref = true; + return getType(state); + }; + } + + function footnoteLink(stream, state) { + if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) { + state.f = footnoteLinkInside; + stream.next(); // Consume [ + if (modeCfg.highlightFormatting) state.formatting = "link"; + state.linkText = true; + return getType(state); + } + return switchInline(stream, state, inlineNormal); + } + + function footnoteLinkInside(stream, state) { + if (stream.match(/^\]:/, true)) { + state.f = state.inline = footnoteUrl; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var returnType = getType(state); + state.linkText = false; + return returnType; + } + + stream.match(/^([^\]\\]|\\.)+/, true); + + return tokenTypes.linkText; + } + + function footnoteUrl(stream, state) { + // Check if space, and return NULL if so (to avoid marking the space) + if(stream.eatSpace()){ + return null; + } + // Match URL + stream.match(/^[^\s]+/, true); + // Check for link title + if (stream.peek() === undefined) { // End of line, set flag to check next line + state.linkTitle = true; + } else { // More content on line, check if link title + stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true); + } + state.f = state.inline = inlineNormal; + return tokenTypes.linkHref + " url"; + } + + var mode = { + startState: function() { + return { + f: blockNormal, + + prevLine: null, + thisLine: null, + + block: blockNormal, + htmlState: null, + indentation: 0, + + inline: inlineNormal, + text: handleText, + + formatting: false, + linkText: false, + linkHref: false, + linkTitle: false, + code: 0, + em: false, + strong: false, + header: 0, + hr: false, + taskList: false, + list: false, + listStack: [], + quote: 0, + trailingSpace: 0, + trailingSpaceNewLine: false, + strikethrough: false, + fencedChars: null + }; + }, + + copyState: function(s) { + return { + f: s.f, + + prevLine: s.prevLine, + thisLine: s.thisLine, + + block: s.block, + htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState), + indentation: s.indentation, + + localMode: s.localMode, + localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null, + + inline: s.inline, + text: s.text, + formatting: false, + linkTitle: s.linkTitle, + code: s.code, + em: s.em, + strong: s.strong, + strikethrough: s.strikethrough, + header: s.header, + hr: s.hr, + taskList: s.taskList, + list: s.list, + listStack: s.listStack.slice(0), + quote: s.quote, + indentedCode: s.indentedCode, + trailingSpace: s.trailingSpace, + trailingSpaceNewLine: s.trailingSpaceNewLine, + md_inside: s.md_inside, + fencedChars: s.fencedChars + }; + }, + + token: function(stream, state) { + + // Reset state.formatting + state.formatting = false; + + if (stream != state.thisLine) { + var forceBlankLine = state.header || state.hr; + + // Reset state.header and state.hr + state.header = 0; + state.hr = false; + + if (stream.match(/^\s*$/, true) || forceBlankLine) { + blankLine(state); + if (!forceBlankLine) return null + state.prevLine = null + } + + state.prevLine = state.thisLine + state.thisLine = stream + + // Reset state.taskList + state.taskList = false; + + // Reset state.trailingSpace + state.trailingSpace = 0; + state.trailingSpaceNewLine = false; + + state.f = state.block; + var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length; + state.indentationDiff = Math.min(indentation - state.indentation, 4); + state.indentation = state.indentation + state.indentationDiff; + if (indentation > 0) return null; + } + return state.f(stream, state); + }, + + innerMode: function(state) { + if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode}; + if (state.localState) return {state: state.localState, mode: state.localMode}; + return {state: state, mode: mode}; + }, + + blankLine: blankLine, + + getType: getType, + + fold: "markdown" + }; + return mode; +}, "xml"); + +CodeMirror.defineMIME("text/x-markdown", "markdown"); + +}); diff --git a/app/lib/codemirror/mode/meta.js b/app/lib/codemirror/mode/meta.js new file mode 100644 index 0000000..eb25e24 --- /dev/null +++ b/app/lib/codemirror/mode/meta.js @@ -0,0 +1,208 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.modeInfo = [ + {name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]}, + {name: "PGP", mimes: ["application/pgp", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["pgp"]}, + {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"]}, + {name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i}, + {name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]}, + {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]}, + {name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]}, + {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]}, + {name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]}, + {name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj", "cljc", "cljx"]}, + {name: "ClojureScript", mime: "text/x-clojurescript", mode: "clojure", ext: ["cljs"]}, + {name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]}, + {name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/}, + {name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]}, + {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]}, + {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]}, + {name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]}, + {name: "Crystal", mime: "text/x-crystal", mode: "crystal", ext: ["cr"]}, + {name: "CSS", mime: "text/css", mode: "css", ext: ["css"]}, + {name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]}, + {name: "D", mime: "text/x-d", mode: "d", ext: ["d"]}, + {name: "Dart", mimes: ["application/dart", "text/x-dart"], mode: "dart", ext: ["dart"]}, + {name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"]}, + {name: "Django", mime: "text/x-django", mode: "django"}, + {name: "Dockerfile", mime: "text/x-dockerfile", mode: "dockerfile", file: /^Dockerfile$/}, + {name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"]}, + {name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]}, + {name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"}, + {name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]}, + {name: "edn", mime: "application/edn", mode: "clojure", ext: ["edn"]}, + {name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]}, + {name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]}, + {name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]}, + {name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]}, + {name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]}, + {name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]}, + {name: "FCL", mime: "text/x-fcl", mode: "fcl"}, + {name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]}, + {name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]}, + {name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]}, + {name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]}, + {name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]}, + {name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history).md$/i}, + {name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]}, + {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"]}, + {name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]}, + {name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]}, + {name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"]}, + {name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]}, + {name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]}, + {name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]}, + {name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm"], alias: ["xhtml"]}, + {name: "HTTP", mime: "message/http", mode: "http"}, + {name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]}, + {name: "Jade", mime: "text/x-jade", mode: "jade", ext: ["jade"]}, + {name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]}, + {name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]}, + {name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"], + mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]}, + {name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]}, + {name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]}, + {name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]}, + {name: "Jinja2", mime: "null", mode: "jinja2"}, + {name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]}, + {name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]}, + {name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]}, + {name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]}, + {name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]}, + {name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]}, + {name: "mIRC", mime: "text/mirc", mode: "mirc"}, + {name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"}, + {name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb"]}, + {name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]}, + {name: "MUMPS", mime: "text/x-mumps", mode: "mumps", ext: ["mps"]}, + {name: "MS SQL", mime: "text/x-mssql", mode: "sql"}, + {name: "mbox", mime: "application/mbox", mode: "mbox", ext: ["mbox"]}, + {name: "MySQL", mime: "text/x-mysql", mode: "sql"}, + {name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i}, + {name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]}, + {name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]}, + {name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"], alias: ["objective-c", "objc"]}, + {name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]}, + {name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]}, + {name: "Oz", mime: "text/x-oz", mode: "oz", ext: ["oz"]}, + {name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]}, + {name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]}, + {name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]}, + {name: "PHP", mime: "application/x-httpd-php", mode: "php", ext: ["php", "php3", "php4", "php5", "phtml"]}, + {name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]}, + {name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]}, + {name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]}, + {name: "PowerShell", mime: "application/x-powershell", mode: "powershell", ext: ["ps1", "psd1", "psm1"]}, + {name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]}, + {name: "ProtoBuf", mime: "text/x-protobuf", mode: "protobuf", ext: ["proto"]}, + {name: "Python", mime: "text/x-python", mode: "python", ext: ["BUILD", "bzl", "py", "pyw"], file: /^(BUCK|BUILD)$/}, + {name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]}, + {name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]}, + {name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r"], alias: ["rscript"]}, + {name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"], alias: ["rst"]}, + {name: "RPM Changes", mime: "text/x-rpm-changes", mode: "rpm"}, + {name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"]}, + {name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"]}, + {name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]}, + {name: "SAS", mime: "text/x-sas", mode: "sas", ext: ["sas"]}, + {name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]}, + {name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]}, + {name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]}, + {name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]}, + {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/}, + {name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]}, + {name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]}, + {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]}, + {name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]}, + {name: "Solr", mime: "text/x-solr", mode: "solr"}, + {name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]}, + {name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]}, + {name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]}, + {name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]}, + {name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]}, + {name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]}, + {name: "sTeX", mime: "text/x-stex", mode: "stex"}, + {name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"], alias: ["tex"]}, + {name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v"]}, + {name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]}, + {name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]}, + {name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"}, + {name: "Tiki wiki", mime: "text/tiki", mode: "tiki"}, + {name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]}, + {name: "Tornado", mime: "text/x-tornado", mode: "tornado"}, + {name: "troff", mime: "text/troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]}, + {name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"]}, + {name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]}, + {name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]}, + {name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]}, + {name: "Twig", mime: "text/x-twig", mode: "twig"}, + {name: "Web IDL", mime: "text/x-webidl", mode: "webidl", ext: ["webidl"]}, + {name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]}, + {name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]}, + {name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]}, + {name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]}, + {name: "VHDL", mime: "text/x-vhdl", mode: "vhdl", ext: ["vhd", "vhdl"]}, + {name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd"], alias: ["rss", "wsdl", "xsd"]}, + {name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]}, + {name: "Yacas", mime: "text/x-yacas", mode: "yacas", ext: ["ys"]}, + {name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]}, + {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]}, + {name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"]}, + {name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"]}, + {name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]} + ]; + // Ensure all modes have a mime property for backwards compatibility + for (var i = 0; i < CodeMirror.modeInfo.length; i++) { + var info = CodeMirror.modeInfo[i]; + if (info.mimes) info.mime = info.mimes[0]; + } + + CodeMirror.findModeByMIME = function(mime) { + mime = mime.toLowerCase(); + for (var i = 0; i < CodeMirror.modeInfo.length; i++) { + var info = CodeMirror.modeInfo[i]; + if (info.mime == mime) return info; + if (info.mimes) for (var j = 0; j < info.mimes.length; j++) + if (info.mimes[j] == mime) return info; + } + }; + + CodeMirror.findModeByExtension = function(ext) { + for (var i = 0; i < CodeMirror.modeInfo.length; i++) { + var info = CodeMirror.modeInfo[i]; + if (info.ext) for (var j = 0; j < info.ext.length; j++) + if (info.ext[j] == ext) return info; + } + }; + + CodeMirror.findModeByFileName = function(filename) { + for (var i = 0; i < CodeMirror.modeInfo.length; i++) { + var info = CodeMirror.modeInfo[i]; + if (info.file && info.file.test(filename)) return info; + } + var dot = filename.lastIndexOf("."); + var ext = dot > -1 && filename.substring(dot + 1, filename.length); + if (ext) return CodeMirror.findModeByExtension(ext); + }; + + CodeMirror.findModeByName = function(name) { + name = name.toLowerCase(); + for (var i = 0; i < CodeMirror.modeInfo.length; i++) { + var info = CodeMirror.modeInfo[i]; + if (info.name.toLowerCase() == name) return info; + if (info.alias) for (var j = 0; j < info.alias.length; j++) + if (info.alias[j].toLowerCase() == name) return info; + } + }; +}); diff --git a/app/lib/codemirror/mode/pug/pug.js b/app/lib/codemirror/mode/pug/pug.js new file mode 100644 index 0000000..4018233 --- /dev/null +++ b/app/lib/codemirror/mode/pug/pug.js @@ -0,0 +1,591 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../javascript/javascript"), require("../css/css"), require("../htmlmixed/htmlmixed")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../javascript/javascript", "../css/css", "../htmlmixed/htmlmixed"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("pug", function (config) { + // token types + var KEYWORD = 'keyword'; + var DOCTYPE = 'meta'; + var ID = 'builtin'; + var CLASS = 'qualifier'; + + var ATTRS_NEST = { + '{': '}', + '(': ')', + '[': ']' + }; + + var jsMode = CodeMirror.getMode(config, 'javascript'); + + function State() { + this.javaScriptLine = false; + this.javaScriptLineExcludesColon = false; + + this.javaScriptArguments = false; + this.javaScriptArgumentsDepth = 0; + + this.isInterpolating = false; + this.interpolationNesting = 0; + + this.jsState = CodeMirror.startState(jsMode); + + this.restOfLine = ''; + + this.isIncludeFiltered = false; + this.isEach = false; + + this.lastTag = ''; + this.scriptType = ''; + + // Attributes Mode + this.isAttrs = false; + this.attrsNest = []; + this.inAttributeName = true; + this.attributeIsType = false; + this.attrValue = ''; + + // Indented Mode + this.indentOf = Infinity; + this.indentToken = ''; + + this.innerMode = null; + this.innerState = null; + + this.innerModeForLine = false; + } + /** + * Safely copy a state + * + * @return {State} + */ + State.prototype.copy = function () { + var res = new State(); + res.javaScriptLine = this.javaScriptLine; + res.javaScriptLineExcludesColon = this.javaScriptLineExcludesColon; + res.javaScriptArguments = this.javaScriptArguments; + res.javaScriptArgumentsDepth = this.javaScriptArgumentsDepth; + res.isInterpolating = this.isInterpolating; + res.interpolationNesting = this.interpolationNesting; + + res.jsState = CodeMirror.copyState(jsMode, this.jsState); + + res.innerMode = this.innerMode; + if (this.innerMode && this.innerState) { + res.innerState = CodeMirror.copyState(this.innerMode, this.innerState); + } + + res.restOfLine = this.restOfLine; + + res.isIncludeFiltered = this.isIncludeFiltered; + res.isEach = this.isEach; + res.lastTag = this.lastTag; + res.scriptType = this.scriptType; + res.isAttrs = this.isAttrs; + res.attrsNest = this.attrsNest.slice(); + res.inAttributeName = this.inAttributeName; + res.attributeIsType = this.attributeIsType; + res.attrValue = this.attrValue; + res.indentOf = this.indentOf; + res.indentToken = this.indentToken; + + res.innerModeForLine = this.innerModeForLine; + + return res; + }; + + function javaScript(stream, state) { + if (stream.sol()) { + // if javaScriptLine was set at end of line, ignore it + state.javaScriptLine = false; + state.javaScriptLineExcludesColon = false; + } + if (state.javaScriptLine) { + if (state.javaScriptLineExcludesColon && stream.peek() === ':') { + state.javaScriptLine = false; + state.javaScriptLineExcludesColon = false; + return; + } + var tok = jsMode.token(stream, state.jsState); + if (stream.eol()) state.javaScriptLine = false; + return tok || true; + } + } + function javaScriptArguments(stream, state) { + if (state.javaScriptArguments) { + if (state.javaScriptArgumentsDepth === 0 && stream.peek() !== '(') { + state.javaScriptArguments = false; + return; + } + if (stream.peek() === '(') { + state.javaScriptArgumentsDepth++; + } else if (stream.peek() === ')') { + state.javaScriptArgumentsDepth--; + } + if (state.javaScriptArgumentsDepth === 0) { + state.javaScriptArguments = false; + return; + } + + var tok = jsMode.token(stream, state.jsState); + return tok || true; + } + } + + function yieldStatement(stream) { + if (stream.match(/^yield\b/)) { + return 'keyword'; + } + } + + function doctype(stream) { + if (stream.match(/^(?:doctype) *([^\n]+)?/)) { + return DOCTYPE; + } + } + + function interpolation(stream, state) { + if (stream.match('#{')) { + state.isInterpolating = true; + state.interpolationNesting = 0; + return 'punctuation'; + } + } + + function interpolationContinued(stream, state) { + if (state.isInterpolating) { + if (stream.peek() === '}') { + state.interpolationNesting--; + if (state.interpolationNesting < 0) { + stream.next(); + state.isInterpolating = false; + return 'punctuation'; + } + } else if (stream.peek() === '{') { + state.interpolationNesting++; + } + return jsMode.token(stream, state.jsState) || true; + } + } + + function caseStatement(stream, state) { + if (stream.match(/^case\b/)) { + state.javaScriptLine = true; + return KEYWORD; + } + } + + function when(stream, state) { + if (stream.match(/^when\b/)) { + state.javaScriptLine = true; + state.javaScriptLineExcludesColon = true; + return KEYWORD; + } + } + + function defaultStatement(stream) { + if (stream.match(/^default\b/)) { + return KEYWORD; + } + } + + function extendsStatement(stream, state) { + if (stream.match(/^extends?\b/)) { + state.restOfLine = 'string'; + return KEYWORD; + } + } + + function append(stream, state) { + if (stream.match(/^append\b/)) { + state.restOfLine = 'variable'; + return KEYWORD; + } + } + function prepend(stream, state) { + if (stream.match(/^prepend\b/)) { + state.restOfLine = 'variable'; + return KEYWORD; + } + } + function block(stream, state) { + if (stream.match(/^block\b *(?:(prepend|append)\b)?/)) { + state.restOfLine = 'variable'; + return KEYWORD; + } + } + + function include(stream, state) { + if (stream.match(/^include\b/)) { + state.restOfLine = 'string'; + return KEYWORD; + } + } + + function includeFiltered(stream, state) { + if (stream.match(/^include:([a-zA-Z0-9\-]+)/, false) && stream.match('include')) { + state.isIncludeFiltered = true; + return KEYWORD; + } + } + + function includeFilteredContinued(stream, state) { + if (state.isIncludeFiltered) { + var tok = filter(stream, state); + state.isIncludeFiltered = false; + state.restOfLine = 'string'; + return tok; + } + } + + function mixin(stream, state) { + if (stream.match(/^mixin\b/)) { + state.javaScriptLine = true; + return KEYWORD; + } + } + + function call(stream, state) { + if (stream.match(/^\+([-\w]+)/)) { + if (!stream.match(/^\( *[-\w]+ *=/, false)) { + state.javaScriptArguments = true; + state.javaScriptArgumentsDepth = 0; + } + return 'variable'; + } + if (stream.match(/^\+#{/, false)) { + stream.next(); + state.mixinCallAfter = true; + return interpolation(stream, state); + } + } + function callArguments(stream, state) { + if (state.mixinCallAfter) { + state.mixinCallAfter = false; + if (!stream.match(/^\( *[-\w]+ *=/, false)) { + state.javaScriptArguments = true; + state.javaScriptArgumentsDepth = 0; + } + return true; + } + } + + function conditional(stream, state) { + if (stream.match(/^(if|unless|else if|else)\b/)) { + state.javaScriptLine = true; + return KEYWORD; + } + } + + function each(stream, state) { + if (stream.match(/^(- *)?(each|for)\b/)) { + state.isEach = true; + return KEYWORD; + } + } + function eachContinued(stream, state) { + if (state.isEach) { + if (stream.match(/^ in\b/)) { + state.javaScriptLine = true; + state.isEach = false; + return KEYWORD; + } else if (stream.sol() || stream.eol()) { + state.isEach = false; + } else if (stream.next()) { + while (!stream.match(/^ in\b/, false) && stream.next()); + return 'variable'; + } + } + } + + function whileStatement(stream, state) { + if (stream.match(/^while\b/)) { + state.javaScriptLine = true; + return KEYWORD; + } + } + + function tag(stream, state) { + var captures; + if (captures = stream.match(/^(\w(?:[-:\w]*\w)?)\/?/)) { + state.lastTag = captures[1].toLowerCase(); + if (state.lastTag === 'script') { + state.scriptType = 'application/javascript'; + } + return 'tag'; + } + } + + function filter(stream, state) { + if (stream.match(/^:([\w\-]+)/)) { + var innerMode; + if (config && config.innerModes) { + innerMode = config.innerModes(stream.current().substring(1)); + } + if (!innerMode) { + innerMode = stream.current().substring(1); + } + if (typeof innerMode === 'string') { + innerMode = CodeMirror.getMode(config, innerMode); + } + setInnerMode(stream, state, innerMode); + return 'atom'; + } + } + + function code(stream, state) { + if (stream.match(/^(!?=|-)/)) { + state.javaScriptLine = true; + return 'punctuation'; + } + } + + function id(stream) { + if (stream.match(/^#([\w-]+)/)) { + return ID; + } + } + + function className(stream) { + if (stream.match(/^\.([\w-]+)/)) { + return CLASS; + } + } + + function attrs(stream, state) { + if (stream.peek() == '(') { + stream.next(); + state.isAttrs = true; + state.attrsNest = []; + state.inAttributeName = true; + state.attrValue = ''; + state.attributeIsType = false; + return 'punctuation'; + } + } + + function attrsContinued(stream, state) { + if (state.isAttrs) { + if (ATTRS_NEST[stream.peek()]) { + state.attrsNest.push(ATTRS_NEST[stream.peek()]); + } + if (state.attrsNest[state.attrsNest.length - 1] === stream.peek()) { + state.attrsNest.pop(); + } else if (stream.eat(')')) { + state.isAttrs = false; + return 'punctuation'; + } + if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) { + if (stream.peek() === '=' || stream.peek() === '!') { + state.inAttributeName = false; + state.jsState = CodeMirror.startState(jsMode); + if (state.lastTag === 'script' && stream.current().trim().toLowerCase() === 'type') { + state.attributeIsType = true; + } else { + state.attributeIsType = false; + } + } + return 'attribute'; + } + + var tok = jsMode.token(stream, state.jsState); + if (state.attributeIsType && tok === 'string') { + state.scriptType = stream.current().toString(); + } + if (state.attrsNest.length === 0 && (tok === 'string' || tok === 'variable' || tok === 'keyword')) { + try { + Function('', 'var x ' + state.attrValue.replace(/,\s*$/, '').replace(/^!/, '')); + state.inAttributeName = true; + state.attrValue = ''; + stream.backUp(stream.current().length); + return attrsContinued(stream, state); + } catch (ex) { + //not the end of an attribute + } + } + state.attrValue += stream.current(); + return tok || true; + } + } + + function attributesBlock(stream, state) { + if (stream.match(/^&attributes\b/)) { + state.javaScriptArguments = true; + state.javaScriptArgumentsDepth = 0; + return 'keyword'; + } + } + + function indent(stream) { + if (stream.sol() && stream.eatSpace()) { + return 'indent'; + } + } + + function comment(stream, state) { + if (stream.match(/^ *\/\/(-)?([^\n]*)/)) { + state.indentOf = stream.indentation(); + state.indentToken = 'comment'; + return 'comment'; + } + } + + function colon(stream) { + if (stream.match(/^: */)) { + return 'colon'; + } + } + + function text(stream, state) { + if (stream.match(/^(?:\| ?| )([^\n]+)/)) { + return 'string'; + } + if (stream.match(/^(<[^\n]*)/, false)) { + // html string + setInnerMode(stream, state, 'htmlmixed'); + state.innerModeForLine = true; + return innerMode(stream, state, true); + } + } + + function dot(stream, state) { + if (stream.eat('.')) { + var innerMode = null; + if (state.lastTag === 'script' && state.scriptType.toLowerCase().indexOf('javascript') != -1) { + innerMode = state.scriptType.toLowerCase().replace(/"|'/g, ''); + } else if (state.lastTag === 'style') { + innerMode = 'css'; + } + setInnerMode(stream, state, innerMode); + return 'dot'; + } + } + + function fail(stream) { + stream.next(); + return null; + } + + + function setInnerMode(stream, state, mode) { + mode = CodeMirror.mimeModes[mode] || mode; + mode = config.innerModes ? config.innerModes(mode) || mode : mode; + mode = CodeMirror.mimeModes[mode] || mode; + mode = CodeMirror.getMode(config, mode); + state.indentOf = stream.indentation(); + + if (mode && mode.name !== 'null') { + state.innerMode = mode; + } else { + state.indentToken = 'string'; + } + } + function innerMode(stream, state, force) { + if (stream.indentation() > state.indentOf || (state.innerModeForLine && !stream.sol()) || force) { + if (state.innerMode) { + if (!state.innerState) { + state.innerState = state.innerMode.startState ? CodeMirror.startState(state.innerMode, stream.indentation()) : {}; + } + return stream.hideFirstChars(state.indentOf + 2, function () { + return state.innerMode.token(stream, state.innerState) || true; + }); + } else { + stream.skipToEnd(); + return state.indentToken; + } + } else if (stream.sol()) { + state.indentOf = Infinity; + state.indentToken = null; + state.innerMode = null; + state.innerState = null; + } + } + function restOfLine(stream, state) { + if (stream.sol()) { + // if restOfLine was set at end of line, ignore it + state.restOfLine = ''; + } + if (state.restOfLine) { + stream.skipToEnd(); + var tok = state.restOfLine; + state.restOfLine = ''; + return tok; + } + } + + + function startState() { + return new State(); + } + function copyState(state) { + return state.copy(); + } + /** + * Get the next token in the stream + * + * @param {Stream} stream + * @param {State} state + */ + function nextToken(stream, state) { + var tok = innerMode(stream, state) + || restOfLine(stream, state) + || interpolationContinued(stream, state) + || includeFilteredContinued(stream, state) + || eachContinued(stream, state) + || attrsContinued(stream, state) + || javaScript(stream, state) + || javaScriptArguments(stream, state) + || callArguments(stream, state) + + || yieldStatement(stream, state) + || doctype(stream, state) + || interpolation(stream, state) + || caseStatement(stream, state) + || when(stream, state) + || defaultStatement(stream, state) + || extendsStatement(stream, state) + || append(stream, state) + || prepend(stream, state) + || block(stream, state) + || include(stream, state) + || includeFiltered(stream, state) + || mixin(stream, state) + || call(stream, state) + || conditional(stream, state) + || each(stream, state) + || whileStatement(stream, state) + || tag(stream, state) + || filter(stream, state) + || code(stream, state) + || id(stream, state) + || className(stream, state) + || attrs(stream, state) + || attributesBlock(stream, state) + || indent(stream, state) + || text(stream, state) + || comment(stream, state) + || colon(stream, state) + || dot(stream, state) + || fail(stream, state); + + return tok === true ? null : tok; + } + return { + startState: startState, + copyState: copyState, + token: nextToken + }; +}, 'javascript', 'css', 'htmlmixed'); + +CodeMirror.defineMIME('text/x-pug', 'pug'); +CodeMirror.defineMIME('text/x-jade', 'pug'); + +}); diff --git a/app/lib/codemirror/mode/sass/sass.js b/app/lib/codemirror/mode/sass/sass.js new file mode 100644 index 0000000..6973ece --- /dev/null +++ b/app/lib/codemirror/mode/sass/sass.js @@ -0,0 +1,414 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("sass", function(config) { + function tokenRegexp(words) { + return new RegExp("^" + words.join("|")); + } + + var keywords = ["true", "false", "null", "auto"]; + var keywordsRegexp = new RegExp("^" + keywords.join("|")); + + var operators = ["\\(", "\\)", "=", ">", "<", "==", ">=", "<=", "\\+", "-", + "\\!=", "/", "\\*", "%", "and", "or", "not", ";","\\{","\\}",":"]; + var opRegexp = tokenRegexp(operators); + + var pseudoElementsRegexp = /^::?[a-zA-Z_][\w\-]*/; + + function urlTokens(stream, state) { + var ch = stream.peek(); + + if (ch === ")") { + stream.next(); + state.tokenizer = tokenBase; + return "operator"; + } else if (ch === "(") { + stream.next(); + stream.eatSpace(); + + return "operator"; + } else if (ch === "'" || ch === '"') { + state.tokenizer = buildStringTokenizer(stream.next()); + return "string"; + } else { + state.tokenizer = buildStringTokenizer(")", false); + return "string"; + } + } + function comment(indentation, multiLine) { + return function(stream, state) { + if (stream.sol() && stream.indentation() <= indentation) { + state.tokenizer = tokenBase; + return tokenBase(stream, state); + } + + if (multiLine && stream.skipTo("*/")) { + stream.next(); + stream.next(); + state.tokenizer = tokenBase; + } else { + stream.skipToEnd(); + } + + return "comment"; + }; + } + + function buildStringTokenizer(quote, greedy) { + if (greedy == null) { greedy = true; } + + function stringTokenizer(stream, state) { + var nextChar = stream.next(); + var peekChar = stream.peek(); + var previousChar = stream.string.charAt(stream.pos-2); + + var endingString = ((nextChar !== "\\" && peekChar === quote) || (nextChar === quote && previousChar !== "\\")); + + if (endingString) { + if (nextChar !== quote && greedy) { stream.next(); } + state.tokenizer = tokenBase; + return "string"; + } else if (nextChar === "#" && peekChar === "{") { + state.tokenizer = buildInterpolationTokenizer(stringTokenizer); + stream.next(); + return "operator"; + } else { + return "string"; + } + } + + return stringTokenizer; + } + + function buildInterpolationTokenizer(currentTokenizer) { + return function(stream, state) { + if (stream.peek() === "}") { + stream.next(); + state.tokenizer = currentTokenizer; + return "operator"; + } else { + return tokenBase(stream, state); + } + }; + } + + function indent(state) { + if (state.indentCount == 0) { + state.indentCount++; + var lastScopeOffset = state.scopes[0].offset; + var currentOffset = lastScopeOffset + config.indentUnit; + state.scopes.unshift({ offset:currentOffset }); + } + } + + function dedent(state) { + if (state.scopes.length == 1) return; + + state.scopes.shift(); + } + + function tokenBase(stream, state) { + var ch = stream.peek(); + + // Comment + if (stream.match("/*")) { + state.tokenizer = comment(stream.indentation(), true); + return state.tokenizer(stream, state); + } + if (stream.match("//")) { + state.tokenizer = comment(stream.indentation(), false); + return state.tokenizer(stream, state); + } + + // Interpolation + if (stream.match("#{")) { + state.tokenizer = buildInterpolationTokenizer(tokenBase); + return "operator"; + } + + // Strings + if (ch === '"' || ch === "'") { + stream.next(); + state.tokenizer = buildStringTokenizer(ch); + return "string"; + } + + if(!state.cursorHalf){// state.cursorHalf === 0 + // first half i.e. before : for key-value pairs + // including selectors + + if (ch === ".") { + stream.next(); + if (stream.match(/^[\w-]+/)) { + indent(state); + return "atom"; + } else if (stream.peek() === "#") { + indent(state); + return "atom"; + } + } + + if (ch === "#") { + stream.next(); + // ID selectors + if (stream.match(/^[\w-]+/)) { + indent(state); + return "atom"; + } + if (stream.peek() === "#") { + indent(state); + return "atom"; + } + } + + // Variables + if (ch === "$") { + stream.next(); + stream.eatWhile(/[\w-]/); + return "variable-2"; + } + + // Numbers + if (stream.match(/^-?[0-9\.]+/)) + return "number"; + + // Units + if (stream.match(/^(px|em|in)\b/)) + return "unit"; + + if (stream.match(keywordsRegexp)) + return "keyword"; + + if (stream.match(/^url/) && stream.peek() === "(") { + state.tokenizer = urlTokens; + return "atom"; + } + + if (ch === "=") { + // Match shortcut mixin definition + if (stream.match(/^=[\w-]+/)) { + indent(state); + return "meta"; + } + } + + if (ch === "+") { + // Match shortcut mixin definition + if (stream.match(/^\+[\w-]+/)){ + return "variable-3"; + } + } + + if(ch === "@"){ + if(stream.match(/@extend/)){ + if(!stream.match(/\s*[\w]/)) + dedent(state); + } + } + + + // Indent Directives + if (stream.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)) { + indent(state); + return "meta"; + } + + // Other Directives + if (ch === "@") { + stream.next(); + stream.eatWhile(/[\w-]/); + return "meta"; + } + + if (stream.eatWhile(/[\w-]/)){ + if(stream.match(/ *: *[\w-\+\$#!\("']/,false)){ + return "property"; + } + else if(stream.match(/ *:/,false)){ + indent(state); + state.cursorHalf = 1; + return "atom"; + } + else if(stream.match(/ *,/,false)){ + return "atom"; + } + else{ + indent(state); + return "atom"; + } + } + + if(ch === ":"){ + if (stream.match(pseudoElementsRegexp)){ // could be a pseudo-element + return "keyword"; + } + stream.next(); + state.cursorHalf=1; + return "operator"; + } + + } // cursorHalf===0 ends here + else{ + + if (ch === "#") { + stream.next(); + // Hex numbers + if (stream.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){ + if(!stream.peek()){ + state.cursorHalf = 0; + } + return "number"; + } + } + + // Numbers + if (stream.match(/^-?[0-9\.]+/)){ + if(!stream.peek()){ + state.cursorHalf = 0; + } + return "number"; + } + + // Units + if (stream.match(/^(px|em|in)\b/)){ + if(!stream.peek()){ + state.cursorHalf = 0; + } + return "unit"; + } + + if (stream.match(keywordsRegexp)){ + if(!stream.peek()){ + state.cursorHalf = 0; + } + return "keyword"; + } + + if (stream.match(/^url/) && stream.peek() === "(") { + state.tokenizer = urlTokens; + if(!stream.peek()){ + state.cursorHalf = 0; + } + return "atom"; + } + + // Variables + if (ch === "$") { + stream.next(); + stream.eatWhile(/[\w-]/); + if(!stream.peek()){ + state.cursorHalf = 0; + } + return "variable-3"; + } + + // bang character for !important, !default, etc. + if (ch === "!") { + stream.next(); + if(!stream.peek()){ + state.cursorHalf = 0; + } + return stream.match(/^[\w]+/) ? "keyword": "operator"; + } + + if (stream.match(opRegexp)){ + if(!stream.peek()){ + state.cursorHalf = 0; + } + return "operator"; + } + + // attributes + if (stream.eatWhile(/[\w-]/)) { + if(!stream.peek()){ + state.cursorHalf = 0; + } + return "attribute"; + } + + //stream.eatSpace(); + if(!stream.peek()){ + state.cursorHalf = 0; + return null; + } + + } // else ends here + + if (stream.match(opRegexp)) + return "operator"; + + // If we haven't returned by now, we move 1 character + // and return an error + stream.next(); + return null; + } + + function tokenLexer(stream, state) { + if (stream.sol()) state.indentCount = 0; + var style = state.tokenizer(stream, state); + var current = stream.current(); + + if (current === "@return" || current === "}"){ + dedent(state); + } + + if (style !== null) { + var startOfToken = stream.pos - current.length; + + var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount); + + var newScopes = []; + + for (var i = 0; i < state.scopes.length; i++) { + var scope = state.scopes[i]; + + if (scope.offset <= withCurrentIndent) + newScopes.push(scope); + } + + state.scopes = newScopes; + } + + + return style; + } + + return { + startState: function() { + return { + tokenizer: tokenBase, + scopes: [{offset: 0, type: "sass"}], + indentCount: 0, + cursorHalf: 0, // cursor half tells us if cursor lies after (1) + // or before (0) colon (well... more or less) + definedVars: [], + definedMixins: [] + }; + }, + token: function(stream, state) { + var style = tokenLexer(stream, state); + + state.lastToken = { style: style, content: stream.current() }; + + return style; + }, + + indent: function(state) { + return state.scopes[0].offset; + } + }; +}); + +CodeMirror.defineMIME("text/x-sass", "sass"); + +}); diff --git a/app/lib/codemirror/mode/stylus/stylus.js b/app/lib/codemirror/mode/stylus/stylus.js new file mode 100644 index 0000000..8d83a01 --- /dev/null +++ b/app/lib/codemirror/mode/stylus/stylus.js @@ -0,0 +1,769 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Stylus mode created by Dmitry Kiselyov http://git.io/AaRB + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("stylus", function(config) { + var indentUnit = config.indentUnit, + tagKeywords = keySet(tagKeywords_), + tagVariablesRegexp = /^(a|b|i|s|col|em)$/i, + propertyKeywords = keySet(propertyKeywords_), + nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_), + valueKeywords = keySet(valueKeywords_), + colorKeywords = keySet(colorKeywords_), + documentTypes = keySet(documentTypes_), + documentTypesRegexp = wordRegexp(documentTypes_), + mediaFeatures = keySet(mediaFeatures_), + mediaTypes = keySet(mediaTypes_), + fontProperties = keySet(fontProperties_), + operatorsRegexp = /^\s*([.]{2,3}|&&|\|\||\*\*|[?!=:]?=|[-+*\/%<>]=?|\?:|\~)/, + wordOperatorKeywordsRegexp = wordRegexp(wordOperatorKeywords_), + blockKeywords = keySet(blockKeywords_), + vendorPrefixesRegexp = new RegExp(/^\-(moz|ms|o|webkit)-/i), + commonAtoms = keySet(commonAtoms_), + firstWordMatch = "", + states = {}, + ch, + style, + type, + override; + + /** + * Tokenizers + */ + function tokenBase(stream, state) { + firstWordMatch = stream.string.match(/(^[\w-]+\s*=\s*$)|(^\s*[\w-]+\s*=\s*[\w-])|(^\s*(\.|#|@|\$|\&|\[|\d|\+|::?|\{|\>|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/); + state.context.line.firstWord = firstWordMatch ? firstWordMatch[0].replace(/^\s*/, "") : ""; + state.context.line.indent = stream.indentation(); + ch = stream.peek(); + + // Line comment + if (stream.match("//")) { + stream.skipToEnd(); + return ["comment", "comment"]; + } + // Block comment + if (stream.match("/*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + // String + if (ch == "\"" || ch == "'") { + stream.next(); + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + // Def + if (ch == "@") { + stream.next(); + stream.eatWhile(/[\w\\-]/); + return ["def", stream.current()]; + } + // ID selector or Hex color + if (ch == "#") { + stream.next(); + // Hex color + if (stream.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i)) { + return ["atom", "atom"]; + } + // ID selector + if (stream.match(/^[a-z][\w-]*/i)) { + return ["builtin", "hash"]; + } + } + // Vendor prefixes + if (stream.match(vendorPrefixesRegexp)) { + return ["meta", "vendor-prefixes"]; + } + // Numbers + if (stream.match(/^-?[0-9]?\.?[0-9]/)) { + stream.eatWhile(/[a-z%]/i); + return ["number", "unit"]; + } + // !important|optional + if (ch == "!") { + stream.next(); + return [stream.match(/^(important|optional)/i) ? "keyword": "operator", "important"]; + } + // Class + if (ch == "." && stream.match(/^\.[a-z][\w-]*/i)) { + return ["qualifier", "qualifier"]; + } + // url url-prefix domain regexp + if (stream.match(documentTypesRegexp)) { + if (stream.peek() == "(") state.tokenize = tokenParenthesized; + return ["property", "word"]; + } + // Mixins / Functions + if (stream.match(/^[a-z][\w-]*\(/i)) { + stream.backUp(1); + return ["keyword", "mixin"]; + } + // Block mixins + if (stream.match(/^(\+|-)[a-z][\w-]*\(/i)) { + stream.backUp(1); + return ["keyword", "block-mixin"]; + } + // Parent Reference BEM naming + if (stream.string.match(/^\s*&/) && stream.match(/^[-_]+[a-z][\w-]*/)) { + return ["qualifier", "qualifier"]; + } + // / Root Reference & Parent Reference + if (stream.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)) { + stream.backUp(1); + return ["variable-3", "reference"]; + } + if (stream.match(/^&{1}\s*$/)) { + return ["variable-3", "reference"]; + } + // Word operator + if (stream.match(wordOperatorKeywordsRegexp)) { + return ["operator", "operator"]; + } + // Word + if (stream.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i)) { + // Variable + if (stream.match(/^(\.|\[)[\w-\'\"\]]+/i, false)) { + if (!wordIsTag(stream.current())) { + stream.match(/\./); + return ["variable-2", "variable-name"]; + } + } + return ["variable-2", "word"]; + } + // Operators + if (stream.match(operatorsRegexp)) { + return ["operator", stream.current()]; + } + // Delimiters + if (/[:;,{}\[\]\(\)]/.test(ch)) { + stream.next(); + return [null, ch]; + } + // Non-detected items + stream.next(); + return [null, null]; + } + + /** + * Token comment + */ + function tokenCComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == "/") { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return ["comment", "comment"]; + } + + /** + * Token string + */ + function tokenString(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + if (quote == ")") stream.backUp(1); + break; + } + escaped = !escaped && ch == "\\"; + } + if (ch == quote || !escaped && quote != ")") state.tokenize = null; + return ["string", "string"]; + }; + } + + /** + * Token parenthesized + */ + function tokenParenthesized(stream, state) { + stream.next(); // Must be "(" + if (!stream.match(/\s*[\"\')]/, false)) + state.tokenize = tokenString(")"); + else + state.tokenize = null; + return [null, "("]; + } + + /** + * Context management + */ + function Context(type, indent, prev, line) { + this.type = type; + this.indent = indent; + this.prev = prev; + this.line = line || {firstWord: "", indent: 0}; + } + + function pushContext(state, stream, type, indent) { + indent = indent >= 0 ? indent : indentUnit; + state.context = new Context(type, stream.indentation() + indent, state.context); + return type; + } + + function popContext(state, currentIndent) { + var contextIndent = state.context.indent - indentUnit; + currentIndent = currentIndent || false; + state.context = state.context.prev; + if (currentIndent) state.context.indent = contextIndent; + return state.context.type; + } + + function pass(type, stream, state) { + return states[state.context.type](type, stream, state); + } + + function popAndPass(type, stream, state, n) { + for (var i = n || 1; i > 0; i--) + state.context = state.context.prev; + return pass(type, stream, state); + } + + + /** + * Parser + */ + function wordIsTag(word) { + return word.toLowerCase() in tagKeywords; + } + + function wordIsProperty(word) { + word = word.toLowerCase(); + return word in propertyKeywords || word in fontProperties; + } + + function wordIsBlock(word) { + return word.toLowerCase() in blockKeywords; + } + + function wordIsVendorPrefix(word) { + return word.toLowerCase().match(vendorPrefixesRegexp); + } + + function wordAsValue(word) { + var wordLC = word.toLowerCase(); + var override = "variable-2"; + if (wordIsTag(word)) override = "tag"; + else if (wordIsBlock(word)) override = "block-keyword"; + else if (wordIsProperty(word)) override = "property"; + else if (wordLC in valueKeywords || wordLC in commonAtoms) override = "atom"; + else if (wordLC == "return" || wordLC in colorKeywords) override = "keyword"; + + // Font family + else if (word.match(/^[A-Z]/)) override = "string"; + return override; + } + + function typeIsBlock(type, stream) { + return ((endOfLine(stream) && (type == "{" || type == "]" || type == "hash" || type == "qualifier")) || type == "block-mixin"); + } + + function typeIsInterpolation(type, stream) { + return type == "{" && stream.match(/^\s*\$?[\w-]+/i, false); + } + + function typeIsPseudo(type, stream) { + return type == ":" && stream.match(/^[a-z-]+/, false); + } + + function startOfLine(stream) { + return stream.sol() || stream.string.match(new RegExp("^\\s*" + escapeRegExp(stream.current()))); + } + + function endOfLine(stream) { + return stream.eol() || stream.match(/^\s*$/, false); + } + + function firstWordOfLine(line) { + var re = /^\s*[-_]*[a-z0-9]+[\w-]*/i; + var result = typeof line == "string" ? line.match(re) : line.string.match(re); + return result ? result[0].replace(/^\s*/, "") : ""; + } + + + /** + * Block + */ + states.block = function(type, stream, state) { + if ((type == "comment" && startOfLine(stream)) || + (type == "," && endOfLine(stream)) || + type == "mixin") { + return pushContext(state, stream, "block", 0); + } + if (typeIsInterpolation(type, stream)) { + return pushContext(state, stream, "interpolation"); + } + if (endOfLine(stream) && type == "]") { + if (!/^\s*(\.|#|:|\[|\*|&)/.test(stream.string) && !wordIsTag(firstWordOfLine(stream))) { + return pushContext(state, stream, "block", 0); + } + } + if (typeIsBlock(type, stream, state)) { + return pushContext(state, stream, "block"); + } + if (type == "}" && endOfLine(stream)) { + return pushContext(state, stream, "block", 0); + } + if (type == "variable-name") { + if (stream.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/) || wordIsBlock(firstWordOfLine(stream))) { + return pushContext(state, stream, "variableName"); + } + else { + return pushContext(state, stream, "variableName", 0); + } + } + if (type == "=") { + if (!endOfLine(stream) && !wordIsBlock(firstWordOfLine(stream))) { + return pushContext(state, stream, "block", 0); + } + return pushContext(state, stream, "block"); + } + if (type == "*") { + if (endOfLine(stream) || stream.match(/\s*(,|\.|#|\[|:|{)/,false)) { + override = "tag"; + return pushContext(state, stream, "block"); + } + } + if (typeIsPseudo(type, stream)) { + return pushContext(state, stream, "pseudo"); + } + if (/@(font-face|media|supports|(-moz-)?document)/.test(type)) { + return pushContext(state, stream, endOfLine(stream) ? "block" : "atBlock"); + } + if (/@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { + return pushContext(state, stream, "keyframes"); + } + if (/@extends?/.test(type)) { + return pushContext(state, stream, "extend", 0); + } + if (type && type.charAt(0) == "@") { + + // Property Lookup + if (stream.indentation() > 0 && wordIsProperty(stream.current().slice(1))) { + override = "variable-2"; + return "block"; + } + if (/(@import|@require|@charset)/.test(type)) { + return pushContext(state, stream, "block", 0); + } + return pushContext(state, stream, "block"); + } + if (type == "reference" && endOfLine(stream)) { + return pushContext(state, stream, "block"); + } + if (type == "(") { + return pushContext(state, stream, "parens"); + } + + if (type == "vendor-prefixes") { + return pushContext(state, stream, "vendorPrefixes"); + } + if (type == "word") { + var word = stream.current(); + override = wordAsValue(word); + + if (override == "property") { + if (startOfLine(stream)) { + return pushContext(state, stream, "block", 0); + } else { + override = "atom"; + return "block"; + } + } + + if (override == "tag") { + + // tag is a css value + if (/embed|menu|pre|progress|sub|table/.test(word)) { + if (wordIsProperty(firstWordOfLine(stream))) { + override = "atom"; + return "block"; + } + } + + // tag is an attribute + if (stream.string.match(new RegExp("\\[\\s*" + word + "|" + word +"\\s*\\]"))) { + override = "atom"; + return "block"; + } + + // tag is a variable + if (tagVariablesRegexp.test(word)) { + if ((startOfLine(stream) && stream.string.match(/=/)) || + (!startOfLine(stream) && + !stream.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/) && + !wordIsTag(firstWordOfLine(stream)))) { + override = "variable-2"; + if (wordIsBlock(firstWordOfLine(stream))) return "block"; + return pushContext(state, stream, "block", 0); + } + } + + if (endOfLine(stream)) return pushContext(state, stream, "block"); + } + if (override == "block-keyword") { + override = "keyword"; + + // Postfix conditionals + if (stream.current(/(if|unless)/) && !startOfLine(stream)) { + return "block"; + } + return pushContext(state, stream, "block"); + } + if (word == "return") return pushContext(state, stream, "block", 0); + + // Placeholder selector + if (override == "variable-2" && stream.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/)) { + return pushContext(state, stream, "block"); + } + } + return state.context.type; + }; + + + /** + * Parens + */ + states.parens = function(type, stream, state) { + if (type == "(") return pushContext(state, stream, "parens"); + if (type == ")") { + if (state.context.prev.type == "parens") { + return popContext(state); + } + if ((stream.string.match(/^[a-z][\w-]*\(/i) && endOfLine(stream)) || + wordIsBlock(firstWordOfLine(stream)) || + /(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(firstWordOfLine(stream)) || + (!stream.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/) && + wordIsTag(firstWordOfLine(stream)))) { + return pushContext(state, stream, "block"); + } + if (stream.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/) || + stream.string.match(/^\s*(\(|\)|[0-9])/) || + stream.string.match(/^\s+[a-z][\w-]*\(/i) || + stream.string.match(/^\s+[\$-]?[a-z]/i)) { + return pushContext(state, stream, "block", 0); + } + if (endOfLine(stream)) return pushContext(state, stream, "block"); + else return pushContext(state, stream, "block", 0); + } + if (type && type.charAt(0) == "@" && wordIsProperty(stream.current().slice(1))) { + override = "variable-2"; + } + if (type == "word") { + var word = stream.current(); + override = wordAsValue(word); + if (override == "tag" && tagVariablesRegexp.test(word)) { + override = "variable-2"; + } + if (override == "property" || word == "to") override = "atom"; + } + if (type == "variable-name") { + return pushContext(state, stream, "variableName"); + } + if (typeIsPseudo(type, stream)) { + return pushContext(state, stream, "pseudo"); + } + return state.context.type; + }; + + + /** + * Vendor prefixes + */ + states.vendorPrefixes = function(type, stream, state) { + if (type == "word") { + override = "property"; + return pushContext(state, stream, "block", 0); + } + return popContext(state); + }; + + + /** + * Pseudo + */ + states.pseudo = function(type, stream, state) { + if (!wordIsProperty(firstWordOfLine(stream.string))) { + stream.match(/^[a-z-]+/); + override = "variable-3"; + if (endOfLine(stream)) return pushContext(state, stream, "block"); + return popContext(state); + } + return popAndPass(type, stream, state); + }; + + + /** + * atBlock + */ + states.atBlock = function(type, stream, state) { + if (type == "(") return pushContext(state, stream, "atBlock_parens"); + if (typeIsBlock(type, stream, state)) { + return pushContext(state, stream, "block"); + } + if (typeIsInterpolation(type, stream)) { + return pushContext(state, stream, "interpolation"); + } + if (type == "word") { + var word = stream.current().toLowerCase(); + if (/^(only|not|and|or)$/.test(word)) + override = "keyword"; + else if (documentTypes.hasOwnProperty(word)) + override = "tag"; + else if (mediaTypes.hasOwnProperty(word)) + override = "attribute"; + else if (mediaFeatures.hasOwnProperty(word)) + override = "property"; + else if (nonStandardPropertyKeywords.hasOwnProperty(word)) + override = "string-2"; + else override = wordAsValue(stream.current()); + if (override == "tag" && endOfLine(stream)) { + return pushContext(state, stream, "block"); + } + } + if (type == "operator" && /^(not|and|or)$/.test(stream.current())) { + override = "keyword"; + } + return state.context.type; + }; + + states.atBlock_parens = function(type, stream, state) { + if (type == "{" || type == "}") return state.context.type; + if (type == ")") { + if (endOfLine(stream)) return pushContext(state, stream, "block"); + else return pushContext(state, stream, "atBlock"); + } + if (type == "word") { + var word = stream.current().toLowerCase(); + override = wordAsValue(word); + if (/^(max|min)/.test(word)) override = "property"; + if (override == "tag") { + tagVariablesRegexp.test(word) ? override = "variable-2" : override = "atom"; + } + return state.context.type; + } + return states.atBlock(type, stream, state); + }; + + + /** + * Keyframes + */ + states.keyframes = function(type, stream, state) { + if (stream.indentation() == "0" && ((type == "}" && startOfLine(stream)) || type == "]" || type == "hash" + || type == "qualifier" || wordIsTag(stream.current()))) { + return popAndPass(type, stream, state); + } + if (type == "{") return pushContext(state, stream, "keyframes"); + if (type == "}") { + if (startOfLine(stream)) return popContext(state, true); + else return pushContext(state, stream, "keyframes"); + } + if (type == "unit" && /^[0-9]+\%$/.test(stream.current())) { + return pushContext(state, stream, "keyframes"); + } + if (type == "word") { + override = wordAsValue(stream.current()); + if (override == "block-keyword") { + override = "keyword"; + return pushContext(state, stream, "keyframes"); + } + } + if (/@(font-face|media|supports|(-moz-)?document)/.test(type)) { + return pushContext(state, stream, endOfLine(stream) ? "block" : "atBlock"); + } + if (type == "mixin") { + return pushContext(state, stream, "block", 0); + } + return state.context.type; + }; + + + /** + * Interpolation + */ + states.interpolation = function(type, stream, state) { + if (type == "{") popContext(state) && pushContext(state, stream, "block"); + if (type == "}") { + if (stream.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i) || + (stream.string.match(/^\s*[a-z]/i) && wordIsTag(firstWordOfLine(stream)))) { + return pushContext(state, stream, "block"); + } + if (!stream.string.match(/^(\{|\s*\&)/) || + stream.match(/\s*[\w-]/,false)) { + return pushContext(state, stream, "block", 0); + } + return pushContext(state, stream, "block"); + } + if (type == "variable-name") { + return pushContext(state, stream, "variableName", 0); + } + if (type == "word") { + override = wordAsValue(stream.current()); + if (override == "tag") override = "atom"; + } + return state.context.type; + }; + + + /** + * Extend/s + */ + states.extend = function(type, stream, state) { + if (type == "[" || type == "=") return "extend"; + if (type == "]") return popContext(state); + if (type == "word") { + override = wordAsValue(stream.current()); + return "extend"; + } + return popContext(state); + }; + + + /** + * Variable name + */ + states.variableName = function(type, stream, state) { + if (type == "string" || type == "[" || type == "]" || stream.current().match(/^(\.|\$)/)) { + if (stream.current().match(/^\.[\w-]+/i)) override = "variable-2"; + return "variableName"; + } + return popAndPass(type, stream, state); + }; + + + return { + startState: function(base) { + return { + tokenize: null, + state: "block", + context: new Context("block", base || 0, null) + }; + }, + token: function(stream, state) { + if (!state.tokenize && stream.eatSpace()) return null; + style = (state.tokenize || tokenBase)(stream, state); + if (style && typeof style == "object") { + type = style[1]; + style = style[0]; + } + override = style; + state.state = states[state.state](type, stream, state); + return override; + }, + indent: function(state, textAfter, line) { + + var cx = state.context, + ch = textAfter && textAfter.charAt(0), + indent = cx.indent, + lineFirstWord = firstWordOfLine(textAfter), + lineIndent = line.length - line.replace(/^\s*/, "").length, + prevLineFirstWord = state.context.prev ? state.context.prev.line.firstWord : "", + prevLineIndent = state.context.prev ? state.context.prev.line.indent : lineIndent; + + if (cx.prev && + (ch == "}" && (cx.type == "block" || cx.type == "atBlock" || cx.type == "keyframes") || + ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || + ch == "{" && (cx.type == "at"))) { + indent = cx.indent - indentUnit; + cx = cx.prev; + } else if (!(/(\})/.test(ch))) { + if (/@|\$|\d/.test(ch) || + /^\{/.test(textAfter) || +/^\s*\/(\/|\*)/.test(textAfter) || + /^\s*\/\*/.test(prevLineFirstWord) || + /^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(textAfter) || +/^(\+|-)?[a-z][\w-]*\(/i.test(textAfter) || +/^return/.test(textAfter) || + wordIsBlock(lineFirstWord)) { + indent = lineIndent; + } else if (/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(ch) || wordIsTag(lineFirstWord)) { + if (/\,\s*$/.test(prevLineFirstWord)) { + indent = prevLineIndent; + } else if (/^\s+/.test(line) && (/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(prevLineFirstWord) || wordIsTag(prevLineFirstWord))) { + indent = lineIndent <= prevLineIndent ? prevLineIndent : prevLineIndent + indentUnit; + } else { + indent = lineIndent; + } + } else if (!/,\s*$/.test(line) && (wordIsVendorPrefix(lineFirstWord) || wordIsProperty(lineFirstWord))) { + if (wordIsBlock(prevLineFirstWord)) { + indent = lineIndent <= prevLineIndent ? prevLineIndent : prevLineIndent + indentUnit; + } else if (/^\{/.test(prevLineFirstWord)) { + indent = lineIndent <= prevLineIndent ? lineIndent : prevLineIndent + indentUnit; + } else if (wordIsVendorPrefix(prevLineFirstWord) || wordIsProperty(prevLineFirstWord)) { + indent = lineIndent >= prevLineIndent ? prevLineIndent : lineIndent; + } else if (/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(prevLineFirstWord) || + /=\s*$/.test(prevLineFirstWord) || + wordIsTag(prevLineFirstWord) || + /^\$[\w-\.\[\]\'\"]/.test(prevLineFirstWord)) { + indent = prevLineIndent + indentUnit; + } else { + indent = lineIndent; + } + } + } + return indent; + }, + electricChars: "}", + lineComment: "//", + fold: "indent" + }; + }); + + // developer.mozilla.org/en-US/docs/Web/HTML/Element + var tagKeywords_ = ["a","abbr","address","area","article","aside","audio", "b", "base","bdi", "bdo","bgsound","blockquote","body","br","button","canvas","caption","cite", "code","col","colgroup","data","datalist","dd","del","details","dfn","div", "dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1", "h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe", "img","input","ins","kbd","keygen","label","legend","li","link","main","map", "mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes", "noscript","object","ol","optgroup","option","output","p","param","pre", "progress","q","rp","rt","ruby","s","samp","script","section","select", "small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track", "u","ul","var","video"]; + + // github.com/codemirror/CodeMirror/blob/master/mode/css/css.js + var documentTypes_ = ["domain", "regexp", "url", "url-prefix"]; + var mediaTypes_ = ["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]; + var mediaFeatures_ = ["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"]; + var propertyKeywords_ = ["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","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","color","color-profile","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","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode","font-smoothing","osx-font-smoothing"]; + var nonStandardPropertyKeywords_ = ["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"]; + var fontProperties_ = ["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]; + var colorKeywords_ = ["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]; + var valueKeywords_ = ["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale","row","row-reverse","wrap","wrap-reverse","column-reverse","flex-start","flex-end","space-between","space-around", "unset"]; + + var wordOperatorKeywords_ = ["in","and","or","not","is not","is a","is","isnt","defined","if unless"], + blockKeywords_ = ["for","if","else","unless", "from", "to"], + commonAtoms_ = ["null","true","false","href","title","type","not-allowed","readonly","disabled"], + commonDef_ = ["@font-face", "@keyframes", "@media", "@viewport", "@page", "@host", "@supports", "@block", "@css"]; + + var hintWords = tagKeywords_.concat(documentTypes_,mediaTypes_,mediaFeatures_, + propertyKeywords_,nonStandardPropertyKeywords_, + colorKeywords_,valueKeywords_,fontProperties_, + wordOperatorKeywords_,blockKeywords_, + commonAtoms_,commonDef_); + + function wordRegexp(words) { + words = words.sort(function(a,b){return b > a;}); + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + function keySet(array) { + var keys = {}; + for (var i = 0; i < array.length; ++i) keys[array[i]] = true; + return keys; + } + + function escapeRegExp(text) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + } + + CodeMirror.registerHelper("hintWords", "stylus", hintWords); + CodeMirror.defineMIME("text/x-styl", "stylus"); +}); diff --git a/app/lib/codemirror/mode/xml/xml.js b/app/lib/codemirror/mode/xml/xml.js new file mode 100644 index 0000000..f987a3a --- /dev/null +++ b/app/lib/codemirror/mode/xml/xml.js @@ -0,0 +1,394 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +var htmlConfig = { + autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, + 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, + 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, + 'track': true, 'wbr': true, 'menuitem': true}, + implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, + 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, + 'th': true, 'tr': true}, + contextGrabbers: { + 'dd': {'dd': true, 'dt': true}, + 'dt': {'dd': true, 'dt': true}, + 'li': {'li': true}, + 'option': {'option': true, 'optgroup': true}, + 'optgroup': {'optgroup': true}, + 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, + 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, + 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, + 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, + 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, + 'rp': {'rp': true, 'rt': true}, + 'rt': {'rp': true, 'rt': true}, + 'tbody': {'tbody': true, 'tfoot': true}, + 'td': {'td': true, 'th': true}, + 'tfoot': {'tbody': true}, + 'th': {'td': true, 'th': true}, + 'thead': {'tbody': true, 'tfoot': true}, + 'tr': {'tr': true} + }, + doNotIndent: {"pre": true}, + allowUnquoted: true, + allowMissing: true, + caseFold: true +} + +var xmlConfig = { + autoSelfClosers: {}, + implicitlyClosed: {}, + contextGrabbers: {}, + doNotIndent: {}, + allowUnquoted: false, + allowMissing: false, + caseFold: false +} + +CodeMirror.defineMode("xml", function(editorConf, config_) { + var indentUnit = editorConf.indentUnit + var config = {} + var defaults = config_.htmlMode ? htmlConfig : xmlConfig + for (var prop in defaults) config[prop] = defaults[prop] + for (var prop in config_) config[prop] = config_[prop] + + // Return variables for tokenizers + var type, setStyle; + + function inText(stream, state) { + function chain(parser) { + state.tokenize = parser; + return parser(stream, state); + } + + var ch = stream.next(); + if (ch == "<") { + if (stream.eat("!")) { + if (stream.eat("[")) { + if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>")); + else return null; + } else if (stream.match("--")) { + return chain(inBlock("comment", "-->")); + } else if (stream.match("DOCTYPE", true, true)) { + stream.eatWhile(/[\w\._\-]/); + return chain(doctype(1)); + } else { + return null; + } + } else if (stream.eat("?")) { + stream.eatWhile(/[\w\._\-]/); + state.tokenize = inBlock("meta", "?>"); + return "meta"; + } else { + type = stream.eat("/") ? "closeTag" : "openTag"; + state.tokenize = inTag; + return "tag bracket"; + } + } else if (ch == "&") { + var ok; + if (stream.eat("#")) { + if (stream.eat("x")) { + ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";"); + } else { + ok = stream.eatWhile(/[\d]/) && stream.eat(";"); + } + } else { + ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";"); + } + return ok ? "atom" : "error"; + } else { + stream.eatWhile(/[^&<]/); + return null; + } + } + inText.isInText = true; + + function inTag(stream, state) { + var ch = stream.next(); + if (ch == ">" || (ch == "/" && stream.eat(">"))) { + state.tokenize = inText; + type = ch == ">" ? "endTag" : "selfcloseTag"; + return "tag bracket"; + } else if (ch == "=") { + type = "equals"; + return null; + } else if (ch == "<") { + state.tokenize = inText; + state.state = baseState; + state.tagName = state.tagStart = null; + var next = state.tokenize(stream, state); + return next ? next + " tag error" : "tag error"; + } else if (/[\'\"]/.test(ch)) { + state.tokenize = inAttribute(ch); + state.stringStartCol = stream.column(); + return state.tokenize(stream, state); + } else { + stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/); + return "word"; + } + } + + function inAttribute(quote) { + var closure = function(stream, state) { + while (!stream.eol()) { + if (stream.next() == quote) { + state.tokenize = inTag; + break; + } + } + return "string"; + }; + closure.isInAttribute = true; + return closure; + } + + function inBlock(style, terminator) { + return function(stream, state) { + while (!stream.eol()) { + if (stream.match(terminator)) { + state.tokenize = inText; + break; + } + stream.next(); + } + return style; + }; + } + function doctype(depth) { + return function(stream, state) { + var ch; + while ((ch = stream.next()) != null) { + if (ch == "<") { + state.tokenize = doctype(depth + 1); + return state.tokenize(stream, state); + } else if (ch == ">") { + if (depth == 1) { + state.tokenize = inText; + break; + } else { + state.tokenize = doctype(depth - 1); + return state.tokenize(stream, state); + } + } + } + return "meta"; + }; + } + + function Context(state, tagName, startOfLine) { + this.prev = state.context; + this.tagName = tagName; + this.indent = state.indented; + this.startOfLine = startOfLine; + if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) + this.noIndent = true; + } + function popContext(state) { + if (state.context) state.context = state.context.prev; + } + function maybePopContext(state, nextTagName) { + var parentTagName; + while (true) { + if (!state.context) { + return; + } + parentTagName = state.context.tagName; + if (!config.contextGrabbers.hasOwnProperty(parentTagName) || + !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { + return; + } + popContext(state); + } + } + + function baseState(type, stream, state) { + if (type == "openTag") { + state.tagStart = stream.column(); + return tagNameState; + } else if (type == "closeTag") { + return closeTagNameState; + } else { + return baseState; + } + } + function tagNameState(type, stream, state) { + if (type == "word") { + state.tagName = stream.current(); + setStyle = "tag"; + return attrState; + } else { + setStyle = "error"; + return tagNameState; + } + } + function closeTagNameState(type, stream, state) { + if (type == "word") { + var tagName = stream.current(); + if (state.context && state.context.tagName != tagName && + config.implicitlyClosed.hasOwnProperty(state.context.tagName)) + popContext(state); + if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) { + setStyle = "tag"; + return closeState; + } else { + setStyle = "tag error"; + return closeStateErr; + } + } else { + setStyle = "error"; + return closeStateErr; + } + } + + function closeState(type, _stream, state) { + if (type != "endTag") { + setStyle = "error"; + return closeState; + } + popContext(state); + return baseState; + } + function closeStateErr(type, stream, state) { + setStyle = "error"; + return closeState(type, stream, state); + } + + function attrState(type, _stream, state) { + if (type == "word") { + setStyle = "attribute"; + return attrEqState; + } else if (type == "endTag" || type == "selfcloseTag") { + var tagName = state.tagName, tagStart = state.tagStart; + state.tagName = state.tagStart = null; + if (type == "selfcloseTag" || + config.autoSelfClosers.hasOwnProperty(tagName)) { + maybePopContext(state, tagName); + } else { + maybePopContext(state, tagName); + state.context = new Context(state, tagName, tagStart == state.indented); + } + return baseState; + } + setStyle = "error"; + return attrState; + } + function attrEqState(type, stream, state) { + if (type == "equals") return attrValueState; + if (!config.allowMissing) setStyle = "error"; + return attrState(type, stream, state); + } + function attrValueState(type, stream, state) { + if (type == "string") return attrContinuedState; + if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;} + setStyle = "error"; + return attrState(type, stream, state); + } + function attrContinuedState(type, stream, state) { + if (type == "string") return attrContinuedState; + return attrState(type, stream, state); + } + + return { + startState: function(baseIndent) { + var state = {tokenize: inText, + state: baseState, + indented: baseIndent || 0, + tagName: null, tagStart: null, + context: null} + if (baseIndent != null) state.baseIndent = baseIndent + return state + }, + + token: function(stream, state) { + if (!state.tagName && stream.sol()) + state.indented = stream.indentation(); + + if (stream.eatSpace()) return null; + type = null; + var style = state.tokenize(stream, state); + if ((style || type) && style != "comment") { + setStyle = null; + state.state = state.state(type || style, stream, state); + if (setStyle) + style = setStyle == "error" ? style + " error" : setStyle; + } + return style; + }, + + indent: function(state, textAfter, fullLine) { + var context = state.context; + // Indent multi-line strings (e.g. css). + if (state.tokenize.isInAttribute) { + if (state.tagStart == state.indented) + return state.stringStartCol + 1; + else + return state.indented + indentUnit; + } + if (context && context.noIndent) return CodeMirror.Pass; + if (state.tokenize != inTag && state.tokenize != inText) + return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; + // Indent the starts of attribute names. + if (state.tagName) { + if (config.multilineTagIndentPastTag !== false) + return state.tagStart + state.tagName.length + 2; + else + return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1); + } + if (config.alignCDATA && /$/, + blockCommentStart: "", + + configuration: config.htmlMode ? "html" : "xml", + helperType: config.htmlMode ? "html" : "xml", + + skipAttribute: function(state) { + if (state.state == attrValueState) + state.state = attrState + } + }; +}); + +CodeMirror.defineMIME("text/xml", "xml"); +CodeMirror.defineMIME("application/xml", "xml"); +if (!CodeMirror.mimeModes.hasOwnProperty("text/html")) + CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true}); + +}); diff --git a/app/lib/codemirror/theme/3024-day.css b/app/lib/codemirror/theme/3024-day.css new file mode 100644 index 0000000..7132655 --- /dev/null +++ b/app/lib/codemirror/theme/3024-day.css @@ -0,0 +1,41 @@ +/* + + Name: 3024 day + Author: Jan T. Sott (http://github.com/idleberg) + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +.cm-s-3024-day.CodeMirror { background: #f7f7f7; color: #3a3432; } +.cm-s-3024-day div.CodeMirror-selected { background: #d6d5d4; } + +.cm-s-3024-day .CodeMirror-line::selection, .cm-s-3024-day .CodeMirror-line > span::selection, .cm-s-3024-day .CodeMirror-line > span > span::selection { background: #d6d5d4; } +.cm-s-3024-day .CodeMirror-line::-moz-selection, .cm-s-3024-day .CodeMirror-line > span::-moz-selection, .cm-s-3024-day .CodeMirror-line > span > span::selection { background: #d9d9d9; } + +.cm-s-3024-day .CodeMirror-gutters { background: #f7f7f7; border-right: 0px; } +.cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; } +.cm-s-3024-day .CodeMirror-guttermarker-subtle { color: #807d7c; } +.cm-s-3024-day .CodeMirror-linenumber { color: #807d7c; } + +.cm-s-3024-day .CodeMirror-cursor { border-left: 1px solid #5c5855; } + +.cm-s-3024-day span.cm-comment { color: #cdab53; } +.cm-s-3024-day span.cm-atom { color: #a16a94; } +.cm-s-3024-day span.cm-number { color: #a16a94; } + +.cm-s-3024-day span.cm-property, .cm-s-3024-day span.cm-attribute { color: #01a252; } +.cm-s-3024-day span.cm-keyword { color: #db2d20; } +.cm-s-3024-day span.cm-string { color: #fded02; } + +.cm-s-3024-day span.cm-variable { color: #01a252; } +.cm-s-3024-day span.cm-variable-2 { color: #01a0e4; } +.cm-s-3024-day span.cm-def { color: #e8bbd0; } +.cm-s-3024-day span.cm-bracket { color: #3a3432; } +.cm-s-3024-day span.cm-tag { color: #db2d20; } +.cm-s-3024-day span.cm-link { color: #a16a94; } +.cm-s-3024-day span.cm-error { background: #db2d20; color: #5c5855; } + +.cm-s-3024-day .CodeMirror-activeline-background { background: #e8f2ff; } +.cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: #a16a94 !important; } diff --git a/app/lib/codemirror/theme/3024-night.css b/app/lib/codemirror/theme/3024-night.css new file mode 100644 index 0000000..adc5900 --- /dev/null +++ b/app/lib/codemirror/theme/3024-night.css @@ -0,0 +1,39 @@ +/* + + Name: 3024 night + Author: Jan T. Sott (http://github.com/idleberg) + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +.cm-s-3024-night.CodeMirror { background: #090300; color: #d6d5d4; } +.cm-s-3024-night div.CodeMirror-selected { background: #3a3432; } +.cm-s-3024-night .CodeMirror-line::selection, .cm-s-3024-night .CodeMirror-line > span::selection, .cm-s-3024-night .CodeMirror-line > span > span::selection { background: rgba(58, 52, 50, .99); } +.cm-s-3024-night .CodeMirror-line::-moz-selection, .cm-s-3024-night .CodeMirror-line > span::-moz-selection, .cm-s-3024-night .CodeMirror-line > span > span::-moz-selection { background: rgba(58, 52, 50, .99); } +.cm-s-3024-night .CodeMirror-gutters { background: #090300; border-right: 0px; } +.cm-s-3024-night .CodeMirror-guttermarker { color: #db2d20; } +.cm-s-3024-night .CodeMirror-guttermarker-subtle { color: #5c5855; } +.cm-s-3024-night .CodeMirror-linenumber { color: #5c5855; } + +.cm-s-3024-night .CodeMirror-cursor { border-left: 1px solid #807d7c; } + +.cm-s-3024-night span.cm-comment { color: #cdab53; } +.cm-s-3024-night span.cm-atom { color: #a16a94; } +.cm-s-3024-night span.cm-number { color: #a16a94; } + +.cm-s-3024-night span.cm-property, .cm-s-3024-night span.cm-attribute { color: #01a252; } +.cm-s-3024-night span.cm-keyword { color: #db2d20; } +.cm-s-3024-night span.cm-string { color: #fded02; } + +.cm-s-3024-night span.cm-variable { color: #01a252; } +.cm-s-3024-night span.cm-variable-2 { color: #01a0e4; } +.cm-s-3024-night span.cm-def { color: #e8bbd0; } +.cm-s-3024-night span.cm-bracket { color: #d6d5d4; } +.cm-s-3024-night span.cm-tag { color: #db2d20; } +.cm-s-3024-night span.cm-link { color: #a16a94; } +.cm-s-3024-night span.cm-error { background: #db2d20; color: #807d7c; } + +.cm-s-3024-night .CodeMirror-activeline-background { background: #2F2F2F; } +.cm-s-3024-night .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } diff --git a/app/lib/codemirror/theme/abcdef.css b/app/lib/codemirror/theme/abcdef.css new file mode 100644 index 0000000..7f9d788 --- /dev/null +++ b/app/lib/codemirror/theme/abcdef.css @@ -0,0 +1,32 @@ +.cm-s-abcdef.CodeMirror { background: #0f0f0f; color: #defdef; } +.cm-s-abcdef div.CodeMirror-selected { background: #515151; } +.cm-s-abcdef .CodeMirror-line::selection, .cm-s-abcdef .CodeMirror-line > span::selection, .cm-s-abcdef .CodeMirror-line > span > span::selection { background: rgba(56, 56, 56, 0.99); } +.cm-s-abcdef .CodeMirror-line::-moz-selection, .cm-s-abcdef .CodeMirror-line > span::-moz-selection, .cm-s-abcdef .CodeMirror-line > span > span::-moz-selection { background: rgba(56, 56, 56, 0.99); } +.cm-s-abcdef .CodeMirror-gutters { background: #555; border-right: 2px solid #314151; } +.cm-s-abcdef .CodeMirror-guttermarker { color: #222; } +.cm-s-abcdef .CodeMirror-guttermarker-subtle { color: azure; } +.cm-s-abcdef .CodeMirror-linenumber { color: #FFFFFF; } +.cm-s-abcdef .CodeMirror-cursor { border-left: 1px solid #00FF00; } + +.cm-s-abcdef span.cm-keyword { color: darkgoldenrod; font-weight: bold; } +.cm-s-abcdef span.cm-atom { color: #77F; } +.cm-s-abcdef span.cm-number { color: violet; } +.cm-s-abcdef span.cm-def { color: #fffabc; } +.cm-s-abcdef span.cm-variable { color: #abcdef; } +.cm-s-abcdef span.cm-variable-2 { color: #cacbcc; } +.cm-s-abcdef span.cm-variable-3 { color: #def; } +.cm-s-abcdef span.cm-property { color: #fedcba; } +.cm-s-abcdef span.cm-operator { color: #ff0; } +.cm-s-abcdef span.cm-comment { color: #7a7b7c; font-style: italic;} +.cm-s-abcdef span.cm-string { color: #2b4; } +.cm-s-abcdef span.cm-meta { color: #C9F; } +.cm-s-abcdef span.cm-qualifier { color: #FFF700; } +.cm-s-abcdef span.cm-builtin { color: #30aabc; } +.cm-s-abcdef span.cm-bracket { color: #8a8a8a; } +.cm-s-abcdef span.cm-tag { color: #FFDD44; } +.cm-s-abcdef span.cm-attribute { color: #DDFF00; } +.cm-s-abcdef span.cm-error { color: #FF0000; } +.cm-s-abcdef span.cm-header { color: aquamarine; font-weight: bold; } +.cm-s-abcdef span.cm-link { color: blueviolet; } + +.cm-s-abcdef .CodeMirror-activeline-background { background: #314151; } diff --git a/app/lib/codemirror/theme/ambiance-mobile.css b/app/lib/codemirror/theme/ambiance-mobile.css new file mode 100644 index 0000000..88d332e --- /dev/null +++ b/app/lib/codemirror/theme/ambiance-mobile.css @@ -0,0 +1,5 @@ +.cm-s-ambiance.CodeMirror { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} diff --git a/app/lib/codemirror/theme/ambiance.css b/app/lib/codemirror/theme/ambiance.css new file mode 100644 index 0000000..bce3446 --- /dev/null +++ b/app/lib/codemirror/theme/ambiance.css @@ -0,0 +1,74 @@ +/* ambiance theme for codemirror */ + +/* Color scheme */ + +.cm-s-ambiance .cm-header { color: blue; } +.cm-s-ambiance .cm-quote { color: #24C2C7; } + +.cm-s-ambiance .cm-keyword { color: #cda869; } +.cm-s-ambiance .cm-atom { color: #CF7EA9; } +.cm-s-ambiance .cm-number { color: #78CF8A; } +.cm-s-ambiance .cm-def { color: #aac6e3; } +.cm-s-ambiance .cm-variable { color: #ffb795; } +.cm-s-ambiance .cm-variable-2 { color: #eed1b3; } +.cm-s-ambiance .cm-variable-3 { color: #faded3; } +.cm-s-ambiance .cm-property { color: #eed1b3; } +.cm-s-ambiance .cm-operator { color: #fa8d6a; } +.cm-s-ambiance .cm-comment { color: #555; font-style:italic; } +.cm-s-ambiance .cm-string { color: #8f9d6a; } +.cm-s-ambiance .cm-string-2 { color: #9d937c; } +.cm-s-ambiance .cm-meta { color: #D2A8A1; } +.cm-s-ambiance .cm-qualifier { color: yellow; } +.cm-s-ambiance .cm-builtin { color: #9999cc; } +.cm-s-ambiance .cm-bracket { color: #24C2C7; } +.cm-s-ambiance .cm-tag { color: #fee4ff; } +.cm-s-ambiance .cm-attribute { color: #9B859D; } +.cm-s-ambiance .cm-hr { color: pink; } +.cm-s-ambiance .cm-link { color: #F4C20B; } +.cm-s-ambiance .cm-special { color: #FF9D00; } +.cm-s-ambiance .cm-error { color: #AF2018; } + +.cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; } +.cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; } + +.cm-s-ambiance div.CodeMirror-selected { background: rgba(255, 255, 255, 0.15); } +.cm-s-ambiance.CodeMirror-focused div.CodeMirror-selected { background: rgba(255, 255, 255, 0.10); } +.cm-s-ambiance .CodeMirror-line::selection, .cm-s-ambiance .CodeMirror-line > span::selection, .cm-s-ambiance .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); } +.cm-s-ambiance .CodeMirror-line::-moz-selection, .cm-s-ambiance .CodeMirror-line > span::-moz-selection, .cm-s-ambiance .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); } + +/* Editor styling */ + +.cm-s-ambiance.CodeMirror { + line-height: 1.40em; + color: #E6E1DC; + background-color: #202020; + -webkit-box-shadow: inset 0 0 10px black; + -moz-box-shadow: inset 0 0 10px black; + box-shadow: inset 0 0 10px black; +} + +.cm-s-ambiance .CodeMirror-gutters { + background: #3D3D3D; + border-right: 1px solid #4D4D4D; + box-shadow: 0 10px 20px black; +} + +.cm-s-ambiance .CodeMirror-linenumber { + text-shadow: 0px 1px 1px #4d4d4d; + color: #111; + padding: 0 5px; +} + +.cm-s-ambiance .CodeMirror-guttermarker { color: #aaa; } +.cm-s-ambiance .CodeMirror-guttermarker-subtle { color: #111; } + +.cm-s-ambiance .CodeMirror-cursor { border-left: 1px solid #7991E8; } + +.cm-s-ambiance .CodeMirror-activeline-background { + background: none repeat scroll 0% 0% rgba(255, 255, 255, 0.031); +} + +.cm-s-ambiance.CodeMirror, +.cm-s-ambiance .CodeMirror-gutters { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC"); +} diff --git a/app/lib/codemirror/theme/base16-dark.css b/app/lib/codemirror/theme/base16-dark.css new file mode 100644 index 0000000..026a816 --- /dev/null +++ b/app/lib/codemirror/theme/base16-dark.css @@ -0,0 +1,38 @@ +/* + + Name: Base16 Default Dark + Author: Chris Kempson (http://chriskempson.com) + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +.cm-s-base16-dark.CodeMirror { background: #151515; color: #e0e0e0; } +.cm-s-base16-dark div.CodeMirror-selected { background: #303030; } +.cm-s-base16-dark .CodeMirror-line::selection, .cm-s-base16-dark .CodeMirror-line > span::selection, .cm-s-base16-dark .CodeMirror-line > span > span::selection { background: rgba(48, 48, 48, .99); } +.cm-s-base16-dark .CodeMirror-line::-moz-selection, .cm-s-base16-dark .CodeMirror-line > span::-moz-selection, .cm-s-base16-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(48, 48, 48, .99); } +.cm-s-base16-dark .CodeMirror-gutters { background: #151515; border-right: 0px; } +.cm-s-base16-dark .CodeMirror-guttermarker { color: #ac4142; } +.cm-s-base16-dark .CodeMirror-guttermarker-subtle { color: #505050; } +.cm-s-base16-dark .CodeMirror-linenumber { color: #505050; } +.cm-s-base16-dark .CodeMirror-cursor { border-left: 1px solid #b0b0b0; } + +.cm-s-base16-dark span.cm-comment { color: #8f5536; } +.cm-s-base16-dark span.cm-atom { color: #aa759f; } +.cm-s-base16-dark span.cm-number { color: #aa759f; } + +.cm-s-base16-dark span.cm-property, .cm-s-base16-dark span.cm-attribute { color: #90a959; } +.cm-s-base16-dark span.cm-keyword { color: #ac4142; } +.cm-s-base16-dark span.cm-string { color: #f4bf75; } + +.cm-s-base16-dark span.cm-variable { color: #90a959; } +.cm-s-base16-dark span.cm-variable-2 { color: #6a9fb5; } +.cm-s-base16-dark span.cm-def { color: #d28445; } +.cm-s-base16-dark span.cm-bracket { color: #e0e0e0; } +.cm-s-base16-dark span.cm-tag { color: #ac4142; } +.cm-s-base16-dark span.cm-link { color: #aa759f; } +.cm-s-base16-dark span.cm-error { background: #ac4142; color: #b0b0b0; } + +.cm-s-base16-dark .CodeMirror-activeline-background { background: #202020; } +.cm-s-base16-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } diff --git a/app/lib/codemirror/theme/base16-light.css b/app/lib/codemirror/theme/base16-light.css new file mode 100644 index 0000000..474e0ca --- /dev/null +++ b/app/lib/codemirror/theme/base16-light.css @@ -0,0 +1,38 @@ +/* + + Name: Base16 Default Light + Author: Chris Kempson (http://chriskempson.com) + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +.cm-s-base16-light.CodeMirror { background: #f5f5f5; color: #202020; } +.cm-s-base16-light div.CodeMirror-selected { background: #e0e0e0; } +.cm-s-base16-light .CodeMirror-line::selection, .cm-s-base16-light .CodeMirror-line > span::selection, .cm-s-base16-light .CodeMirror-line > span > span::selection { background: #e0e0e0; } +.cm-s-base16-light .CodeMirror-line::-moz-selection, .cm-s-base16-light .CodeMirror-line > span::-moz-selection, .cm-s-base16-light .CodeMirror-line > span > span::-moz-selection { background: #e0e0e0; } +.cm-s-base16-light .CodeMirror-gutters { background: #f5f5f5; border-right: 0px; } +.cm-s-base16-light .CodeMirror-guttermarker { color: #ac4142; } +.cm-s-base16-light .CodeMirror-guttermarker-subtle { color: #b0b0b0; } +.cm-s-base16-light .CodeMirror-linenumber { color: #b0b0b0; } +.cm-s-base16-light .CodeMirror-cursor { border-left: 1px solid #505050; } + +.cm-s-base16-light span.cm-comment { color: #8f5536; } +.cm-s-base16-light span.cm-atom { color: #aa759f; } +.cm-s-base16-light span.cm-number { color: #aa759f; } + +.cm-s-base16-light span.cm-property, .cm-s-base16-light span.cm-attribute { color: #90a959; } +.cm-s-base16-light span.cm-keyword { color: #ac4142; } +.cm-s-base16-light span.cm-string { color: #f4bf75; } + +.cm-s-base16-light span.cm-variable { color: #90a959; } +.cm-s-base16-light span.cm-variable-2 { color: #6a9fb5; } +.cm-s-base16-light span.cm-def { color: #d28445; } +.cm-s-base16-light span.cm-bracket { color: #202020; } +.cm-s-base16-light span.cm-tag { color: #ac4142; } +.cm-s-base16-light span.cm-link { color: #aa759f; } +.cm-s-base16-light span.cm-error { background: #ac4142; color: #505050; } + +.cm-s-base16-light .CodeMirror-activeline-background { background: #DDDCDC; } +.cm-s-base16-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } diff --git a/app/lib/codemirror/theme/base2tone-meadow-dark.css b/app/lib/codemirror/theme/base2tone-meadow-dark.css new file mode 100644 index 0000000..1f79909 --- /dev/null +++ b/app/lib/codemirror/theme/base2tone-meadow-dark.css @@ -0,0 +1,34 @@ +/* +Name: Base2Tone-Meadow +Author: by Bram de Haan, adapted from DuoTone themes by Simurai (http://simurai.com/projects/2016/01/01/duotone-themes) +CodeMirror template by Jan T. Sott (https://github.com/idleberg), adapted by Bram de Haan (https://github.com/atelierbram/) +*/ + +.cm-s-Base2Tone-Meadow-dark.CodeMirror { background: #192834; color: #47adf5; } +.cm-s-Base2Tone-Meadow-dark div.CodeMirror-selected { background: #335166!important; } +.cm-s-Base2Tone-Meadow-dark .CodeMirror-gutters { background: #192834; border-right: 0px; } +.cm-s-Base2Tone-Meadow-dark .CodeMirror-linenumber { color: #335166; } + +/* begin cursor */ +.cm-s-Base2Tone-Meadow-dark .CodeMirror-cursor { border-left: 1px solid #80bf40; /* border-left: 1px solid #80bf4080; */ border-right: .5em solid #80bf40; /* border-right: .5em solid #80bf4080; */ opacity: .5; } +.cm-s-Base2Tone-Meadow-dark .CodeMirror-activeline-background { background: #223644; /* background: #22364480; */ opacity: .5;} +.cm-s-Base2Tone-Meadow-dark .cm-fat-cursor .CodeMirror-cursor { background: #80bf40; /* background: #80bf4080; */ opacity: .5;} +/* end cursor */ + +.cm-s-Base2Tone-Meadow-dark span.cm-atom, .cm-s-Base2Tone-Meadow-dark span.cm-number, .cm-s-Base2Tone-Meadow-dark span.cm-keyword, .cm-s-Base2Tone-Meadow-dark span.cm-variable, .cm-s-Base2Tone-Meadow-dark span.cm-attribute, .cm-s-Base2Tone-Meadow-dark span.cm-quote, .cm-s-Base2Tone-Meadow-dark span.cm-hr, .cm-s-Base2Tone-Meadow-dark span.cm-link { color: #a6f655; } + +.cm-s-Base2Tone-Meadow-dark span.cm-property { color: #4299d7; } +.cm-s-Base2Tone-Meadow-dark span.cm-punctuation, .cm-s-Base2Tone-Meadow-dark span.cm-unit, .cm-s-Base2Tone-Meadow-dark span.cm-negative { color: #66a329; } +.cm-s-Base2Tone-Meadow-dark span.cm-string { color: #8cdd3c; } +.cm-s-Base2Tone-Meadow-dark span.cm-operator { color: #80bf40; } +.cm-s-Base2Tone-Meadow-dark span.cm-positive { color: #1b6498; } + +.cm-s-Base2Tone-Meadow-dark span.cm-variable-2, .cm-s-Base2Tone-Meadow-dark span.cm-variable-3, .cm-s-Base2Tone-Meadow-dark span.cm-string-2, .cm-s-Base2Tone-Meadow-dark span.cm-url { color: #2172ab; } +.cm-s-Base2Tone-Meadow-dark span.cm-def, .cm-s-Base2Tone-Meadow-dark span.cm-tag, .cm-s-Base2Tone-Meadow-dark span.cm-builtin, .cm-s-Base2Tone-Meadow-dark span.cm-qualifier, .cm-s-Base2Tone-Meadow-dark span.cm-header, .cm-s-Base2Tone-Meadow-dark span.cm-em { color: #d1ecff; } +.cm-s-Base2Tone-Meadow-dark span.cm-bracket, .cm-s-Base2Tone-Meadow-dark span.cm-comment { color: #3d5e76; } + +/* using #f00 red for errors, don't think any of the colorscheme variables will stand out enough, ... maybe by giving it a background-color ... */ +.cm-s-Base2Tone-Meadow-dark span.cm-error, .cm-s-Base2Tone-Meadow-dark span.cm-invalidchar { color: #f00; } + +.cm-s-Base2Tone-Meadow-dark span.cm-header { font-weight: normal; } +.cm-s-Base2Tone-Meadow-dark .CodeMirror-matchingbracket { text-decoration: underline; color: #d1ecff!important; } diff --git a/app/lib/codemirror/theme/bespin.css b/app/lib/codemirror/theme/bespin.css new file mode 100644 index 0000000..60913ba --- /dev/null +++ b/app/lib/codemirror/theme/bespin.css @@ -0,0 +1,34 @@ +/* + + Name: Bespin + Author: Mozilla / Jan T. Sott + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +.cm-s-bespin.CodeMirror {background: #28211c; color: #9d9b97;} +.cm-s-bespin div.CodeMirror-selected {background: #36312e !important;} +.cm-s-bespin .CodeMirror-gutters {background: #28211c; border-right: 0px;} +.cm-s-bespin .CodeMirror-linenumber {color: #666666;} +.cm-s-bespin .CodeMirror-cursor {border-left: 1px solid #797977 !important;} + +.cm-s-bespin span.cm-comment {color: #937121;} +.cm-s-bespin span.cm-atom {color: #9b859d;} +.cm-s-bespin span.cm-number {color: #9b859d;} + +.cm-s-bespin span.cm-property, .cm-s-bespin span.cm-attribute {color: #54be0d;} +.cm-s-bespin span.cm-keyword {color: #cf6a4c;} +.cm-s-bespin span.cm-string {color: #f9ee98;} + +.cm-s-bespin span.cm-variable {color: #54be0d;} +.cm-s-bespin span.cm-variable-2 {color: #5ea6ea;} +.cm-s-bespin span.cm-def {color: #cf7d34;} +.cm-s-bespin span.cm-error {background: #cf6a4c; color: #797977;} +.cm-s-bespin span.cm-bracket {color: #9d9b97;} +.cm-s-bespin span.cm-tag {color: #cf6a4c;} +.cm-s-bespin span.cm-link {color: #9b859d;} + +.cm-s-bespin .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} +.cm-s-bespin .CodeMirror-activeline-background { background: #404040; } diff --git a/app/lib/codemirror/theme/blackboard.css b/app/lib/codemirror/theme/blackboard.css new file mode 100644 index 0000000..b6eaedb --- /dev/null +++ b/app/lib/codemirror/theme/blackboard.css @@ -0,0 +1,32 @@ +/* Port of TextMate's Blackboard theme */ + +.cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; } +.cm-s-blackboard div.CodeMirror-selected { background: #253B76; } +.cm-s-blackboard .CodeMirror-line::selection, .cm-s-blackboard .CodeMirror-line > span::selection, .cm-s-blackboard .CodeMirror-line > span > span::selection { background: rgba(37, 59, 118, .99); } +.cm-s-blackboard .CodeMirror-line::-moz-selection, .cm-s-blackboard .CodeMirror-line > span::-moz-selection, .cm-s-blackboard .CodeMirror-line > span > span::-moz-selection { background: rgba(37, 59, 118, .99); } +.cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; } +.cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; } +.cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; } +.cm-s-blackboard .CodeMirror-linenumber { color: #888; } +.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7; } + +.cm-s-blackboard .cm-keyword { color: #FBDE2D; } +.cm-s-blackboard .cm-atom { color: #D8FA3C; } +.cm-s-blackboard .cm-number { color: #D8FA3C; } +.cm-s-blackboard .cm-def { color: #8DA6CE; } +.cm-s-blackboard .cm-variable { color: #FF6400; } +.cm-s-blackboard .cm-operator { color: #FBDE2D; } +.cm-s-blackboard .cm-comment { color: #AEAEAE; } +.cm-s-blackboard .cm-string { color: #61CE3C; } +.cm-s-blackboard .cm-string-2 { color: #61CE3C; } +.cm-s-blackboard .cm-meta { color: #D8FA3C; } +.cm-s-blackboard .cm-builtin { color: #8DA6CE; } +.cm-s-blackboard .cm-tag { color: #8DA6CE; } +.cm-s-blackboard .cm-attribute { color: #8DA6CE; } +.cm-s-blackboard .cm-header { color: #FF6400; } +.cm-s-blackboard .cm-hr { color: #AEAEAE; } +.cm-s-blackboard .cm-link { color: #8DA6CE; } +.cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; } + +.cm-s-blackboard .CodeMirror-activeline-background { background: #3C3636; } +.cm-s-blackboard .CodeMirror-matchingbracket { outline:1px solid grey;color:white !important; } diff --git a/app/lib/codemirror/theme/cobalt.css b/app/lib/codemirror/theme/cobalt.css new file mode 100644 index 0000000..d88223e --- /dev/null +++ b/app/lib/codemirror/theme/cobalt.css @@ -0,0 +1,25 @@ +.cm-s-cobalt.CodeMirror { background: #002240; color: white; } +.cm-s-cobalt div.CodeMirror-selected { background: #b36539; } +.cm-s-cobalt .CodeMirror-line::selection, .cm-s-cobalt .CodeMirror-line > span::selection, .cm-s-cobalt .CodeMirror-line > span > span::selection { background: rgba(179, 101, 57, .99); } +.cm-s-cobalt .CodeMirror-line::-moz-selection, .cm-s-cobalt .CodeMirror-line > span::-moz-selection, .cm-s-cobalt .CodeMirror-line > span > span::-moz-selection { background: rgba(179, 101, 57, .99); } +.cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } +.cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; } +.cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; } +.cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; } +.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white; } + +.cm-s-cobalt span.cm-comment { color: #08f; } +.cm-s-cobalt span.cm-atom { color: #845dc4; } +.cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; } +.cm-s-cobalt span.cm-keyword { color: #ffee80; } +.cm-s-cobalt span.cm-string { color: #3ad900; } +.cm-s-cobalt span.cm-meta { color: #ff9d00; } +.cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; } +.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; } +.cm-s-cobalt span.cm-bracket { color: #d8d8d8; } +.cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; } +.cm-s-cobalt span.cm-link { color: #845dc4; } +.cm-s-cobalt span.cm-error { color: #9d1e15; } + +.cm-s-cobalt .CodeMirror-activeline-background { background: #002D57; } +.cm-s-cobalt .CodeMirror-matchingbracket { outline:1px solid grey;color:white !important; } diff --git a/app/lib/codemirror/theme/colorforth.css b/app/lib/codemirror/theme/colorforth.css new file mode 100644 index 0000000..606899f --- /dev/null +++ b/app/lib/codemirror/theme/colorforth.css @@ -0,0 +1,33 @@ +.cm-s-colorforth.CodeMirror { background: #000000; color: #f8f8f8; } +.cm-s-colorforth .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } +.cm-s-colorforth .CodeMirror-guttermarker { color: #FFBD40; } +.cm-s-colorforth .CodeMirror-guttermarker-subtle { color: #78846f; } +.cm-s-colorforth .CodeMirror-linenumber { color: #bababa; } +.cm-s-colorforth .CodeMirror-cursor { border-left: 1px solid white; } + +.cm-s-colorforth span.cm-comment { color: #ededed; } +.cm-s-colorforth span.cm-def { color: #ff1c1c; font-weight:bold; } +.cm-s-colorforth span.cm-keyword { color: #ffd900; } +.cm-s-colorforth span.cm-builtin { color: #00d95a; } +.cm-s-colorforth span.cm-variable { color: #73ff00; } +.cm-s-colorforth span.cm-string { color: #007bff; } +.cm-s-colorforth span.cm-number { color: #00c4ff; } +.cm-s-colorforth span.cm-atom { color: #606060; } + +.cm-s-colorforth span.cm-variable-2 { color: #EEE; } +.cm-s-colorforth span.cm-variable-3 { color: #DDD; } +.cm-s-colorforth span.cm-property {} +.cm-s-colorforth span.cm-operator {} + +.cm-s-colorforth span.cm-meta { color: yellow; } +.cm-s-colorforth span.cm-qualifier { color: #FFF700; } +.cm-s-colorforth span.cm-bracket { color: #cc7; } +.cm-s-colorforth span.cm-tag { color: #FFBD40; } +.cm-s-colorforth span.cm-attribute { color: #FFF700; } +.cm-s-colorforth span.cm-error { color: #f00; } + +.cm-s-colorforth div.CodeMirror-selected { background: #333d53; } + +.cm-s-colorforth span.cm-compilation { background: rgba(255, 255, 255, 0.12); } + +.cm-s-colorforth .CodeMirror-activeline-background { background: #253540; } diff --git a/app/lib/codemirror/theme/dracula.css b/app/lib/codemirror/theme/dracula.css new file mode 100644 index 0000000..53a660b --- /dev/null +++ b/app/lib/codemirror/theme/dracula.css @@ -0,0 +1,40 @@ +/* + + Name: dracula + Author: Michael Kaminsky (http://github.com/mkaminsky11) + + Original dracula color scheme by Zeno Rocha (https://github.com/zenorocha/dracula-theme) + +*/ + + +.cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters { + background-color: #282a36 !important; + color: #f8f8f2 !important; + border: none; +} +.cm-s-dracula .CodeMirror-gutters { color: #282a36; } +.cm-s-dracula .CodeMirror-cursor { border-left: solid thin #f8f8f0; } +.cm-s-dracula .CodeMirror-linenumber { color: #6D8A88; } +.cm-s-dracula .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); } +.cm-s-dracula .CodeMirror-line::selection, .cm-s-dracula .CodeMirror-line > span::selection, .cm-s-dracula .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); } +.cm-s-dracula .CodeMirror-line::-moz-selection, .cm-s-dracula .CodeMirror-line > span::-moz-selection, .cm-s-dracula .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); } +.cm-s-dracula span.cm-comment { color: #6272a4; } +.cm-s-dracula span.cm-string, .cm-s-dracula span.cm-string-2 { color: #f1fa8c; } +.cm-s-dracula span.cm-number { color: #bd93f9; } +.cm-s-dracula span.cm-variable { color: #50fa7b; } +.cm-s-dracula span.cm-variable-2 { color: white; } +.cm-s-dracula span.cm-def { color: #50fa7b; } +.cm-s-dracula span.cm-operator { color: #ff79c6; } +.cm-s-dracula span.cm-keyword { color: #ff79c6; } +.cm-s-dracula span.cm-atom { color: #bd93f9; } +.cm-s-dracula span.cm-meta { color: #f8f8f2; } +.cm-s-dracula span.cm-tag { color: #ff79c6; } +.cm-s-dracula span.cm-attribute { color: #50fa7b; } +.cm-s-dracula span.cm-qualifier { color: #50fa7b; } +.cm-s-dracula span.cm-property { color: #66d9ef; } +.cm-s-dracula span.cm-builtin { color: #50fa7b; } +.cm-s-dracula span.cm-variable-3 { color: #ffb86c; } + +.cm-s-dracula .CodeMirror-activeline-background { background: rgba(255,255,255,0.1); } +.cm-s-dracula .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } diff --git a/app/lib/codemirror/theme/duotone-dark.css b/app/lib/codemirror/theme/duotone-dark.css new file mode 100644 index 0000000..b09a585 --- /dev/null +++ b/app/lib/codemirror/theme/duotone-dark.css @@ -0,0 +1,35 @@ +/* +Name: DuoTone-Dark +Author: by Bram de Haan, adapted from DuoTone themes by Simurai (http://simurai.com/projects/2016/01/01/duotone-themes) + +CodeMirror template by Jan T. Sott (https://github.com/idleberg), adapted by Bram de Haan (https://github.com/atelierbram/) +*/ + +.cm-s-duotone-dark.CodeMirror { background: #2a2734; color: #6c6783; } +.cm-s-duotone-dark div.CodeMirror-selected { background: #545167!important; } +.cm-s-duotone-dark .CodeMirror-gutters { background: #2a2734; border-right: 0px; } +.cm-s-duotone-dark .CodeMirror-linenumber { color: #545167; } + +/* begin cursor */ +.cm-s-duotone-dark .CodeMirror-cursor { border-left: 1px solid #ffad5c; /* border-left: 1px solid #ffad5c80; */ border-right: .5em solid #ffad5c; /* border-right: .5em solid #ffad5c80; */ opacity: .5; } +.cm-s-duotone-dark .CodeMirror-activeline-background { background: #363342; /* background: #36334280; */ opacity: .5;} +.cm-s-duotone-dark .cm-fat-cursor .CodeMirror-cursor { background: #ffad5c; /* background: #ffad5c80; */ opacity: .5;} +/* end cursor */ + +.cm-s-duotone-dark span.cm-atom, .cm-s-duotone-dark span.cm-number, .cm-s-duotone-dark span.cm-keyword, .cm-s-duotone-dark span.cm-variable, .cm-s-duotone-dark span.cm-attribute, .cm-s-duotone-dark span.cm-quote, .cm-s-duotone-dark span.cm-hr, .cm-s-duotone-dark span.cm-link { color: #ffcc99; } + +.cm-s-duotone-dark span.cm-property { color: #9a86fd; } +.cm-s-duotone-dark span.cm-punctuation, .cm-s-duotone-dark span.cm-unit, .cm-s-duotone-dark span.cm-negative { color: #e09142; } +.cm-s-duotone-dark span.cm-string { color: #ffb870; } +.cm-s-duotone-dark span.cm-operator { color: #ffad5c; } +.cm-s-duotone-dark span.cm-positive { color: #6a51e6; } + +.cm-s-duotone-dark span.cm-variable-2, .cm-s-duotone-dark span.cm-variable-3, .cm-s-duotone-dark span.cm-string-2, .cm-s-duotone-dark span.cm-url { color: #7a63ee; } +.cm-s-duotone-dark span.cm-def, .cm-s-duotone-dark span.cm-tag, .cm-s-duotone-dark span.cm-builtin, .cm-s-duotone-dark span.cm-qualifier, .cm-s-duotone-dark span.cm-header, .cm-s-duotone-dark span.cm-em { color: #eeebff; } +.cm-s-duotone-dark span.cm-bracket, .cm-s-duotone-dark span.cm-comment { color: #6c6783; } + +/* using #f00 red for errors, don't think any of the colorscheme variables will stand out enough, ... maybe by giving it a background-color ... */ +.cm-s-duotone-dark span.cm-error, .cm-s-duotone-dark span.cm-invalidchar { color: #f00; } + +.cm-s-duotone-dark span.cm-header { font-weight: normal; } +.cm-s-duotone-dark .CodeMirror-matchingbracket { text-decoration: underline; color: #eeebff !important; } diff --git a/app/lib/codemirror/theme/duotone-light.css b/app/lib/codemirror/theme/duotone-light.css new file mode 100644 index 0000000..80203d1 --- /dev/null +++ b/app/lib/codemirror/theme/duotone-light.css @@ -0,0 +1,36 @@ +/* +Name: DuoTone-Light +Author: by Bram de Haan, adapted from DuoTone themes by Simurai (http://simurai.com/projects/2016/01/01/duotone-themes) + +CodeMirror template by Jan T. Sott (https://github.com/idleberg), adapted by Bram de Haan (https://github.com/atelierbram/) +*/ + +.cm-s-duotone-light.CodeMirror { background: #faf8f5; color: #b29762; } +.cm-s-duotone-light div.CodeMirror-selected { background: #e3dcce !important; } +.cm-s-duotone-light .CodeMirror-gutters { background: #faf8f5; border-right: 0px; } +.cm-s-duotone-light .CodeMirror-linenumber { color: #cdc4b1; } + +/* begin cursor */ +.cm-s-duotone-light .CodeMirror-cursor { border-left: 1px solid #93abdc; /* border-left: 1px solid #93abdc80; */ border-right: .5em solid #93abdc; /* border-right: .5em solid #93abdc80; */ opacity: .5; } +.cm-s-duotone-light .CodeMirror-activeline-background { background: #e3dcce; /* background: #e3dcce80; */ opacity: .5; } +.cm-s-duotone-light .cm-fat-cursor .CodeMirror-cursor { background: #93abdc; /* #93abdc80; */ opacity: .5; } +/* end cursor */ + +.cm-s-duotone-light span.cm-atom, .cm-s-duotone-light span.cm-number, .cm-s-duotone-light span.cm-keyword, .cm-s-duotone-light span.cm-variable, .cm-s-duotone-light span.cm-attribute, .cm-s-duotone-light span.cm-quote, .cm-s-duotone-light-light span.cm-hr, .cm-s-duotone-light-light span.cm-link { color: #063289; } + +.cm-s-duotone-light span.cm-property { color: #b29762; } +.cm-s-duotone-light span.cm-punctuation, .cm-s-duotone-light span.cm-unit, .cm-s-duotone-light span.cm-negative { color: #063289; } +.cm-s-duotone-light span.cm-string, .cm-s-duotone-light span.cm-operator { color: #1659df; } +.cm-s-duotone-light span.cm-positive { color: #896724; } + +.cm-s-duotone-light span.cm-variable-2, .cm-s-duotone-light span.cm-variable-3, .cm-s-duotone-light span.cm-string-2, .cm-s-duotone-light span.cm-url { color: #896724; } +.cm-s-duotone-light span.cm-def, .cm-s-duotone-light span.cm-tag, .cm-s-duotone-light span.cm-builtin, .cm-s-duotone-light span.cm-qualifier, .cm-s-duotone-light span.cm-header, .cm-s-duotone-light span.cm-em { color: #2d2006; } +.cm-s-duotone-light span.cm-bracket, .cm-s-duotone-light span.cm-comment { color: #b6ad9a; } + +/* using #f00 red for errors, don't think any of the colorscheme variables will stand out enough, ... maybe by giving it a background-color ... */ +/* .cm-s-duotone-light span.cm-error { background: #896724; color: #728fcb; } */ +.cm-s-duotone-light span.cm-error, .cm-s-duotone-light span.cm-invalidchar { color: #f00; } + +.cm-s-duotone-light span.cm-header { font-weight: normal; } +.cm-s-duotone-light .CodeMirror-matchingbracket { text-decoration: underline; color: #faf8f5 !important; } + diff --git a/app/lib/codemirror/theme/eclipse.css b/app/lib/codemirror/theme/eclipse.css new file mode 100644 index 0000000..1bde460 --- /dev/null +++ b/app/lib/codemirror/theme/eclipse.css @@ -0,0 +1,23 @@ +.cm-s-eclipse span.cm-meta { color: #FF1717; } +.cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; } +.cm-s-eclipse span.cm-atom { color: #219; } +.cm-s-eclipse span.cm-number { color: #164; } +.cm-s-eclipse span.cm-def { color: #00f; } +.cm-s-eclipse span.cm-variable { color: black; } +.cm-s-eclipse span.cm-variable-2 { color: #0000C0; } +.cm-s-eclipse span.cm-variable-3 { color: #0000C0; } +.cm-s-eclipse span.cm-property { color: black; } +.cm-s-eclipse span.cm-operator { color: black; } +.cm-s-eclipse span.cm-comment { color: #3F7F5F; } +.cm-s-eclipse span.cm-string { color: #2A00FF; } +.cm-s-eclipse span.cm-string-2 { color: #f50; } +.cm-s-eclipse span.cm-qualifier { color: #555; } +.cm-s-eclipse span.cm-builtin { color: #30a; } +.cm-s-eclipse span.cm-bracket { color: #cc7; } +.cm-s-eclipse span.cm-tag { color: #170; } +.cm-s-eclipse span.cm-attribute { color: #00c; } +.cm-s-eclipse span.cm-link { color: #219; } +.cm-s-eclipse span.cm-error { color: #f00; } + +.cm-s-eclipse .CodeMirror-activeline-background { background: #e8f2ff; } +.cm-s-eclipse .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; } diff --git a/app/lib/codemirror/theme/elegant.css b/app/lib/codemirror/theme/elegant.css new file mode 100644 index 0000000..45b3ea6 --- /dev/null +++ b/app/lib/codemirror/theme/elegant.css @@ -0,0 +1,13 @@ +.cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom { color: #762; } +.cm-s-elegant span.cm-comment { color: #262; font-style: italic; line-height: 1em; } +.cm-s-elegant span.cm-meta { color: #555; font-style: italic; line-height: 1em; } +.cm-s-elegant span.cm-variable { color: black; } +.cm-s-elegant span.cm-variable-2 { color: #b11; } +.cm-s-elegant span.cm-qualifier { color: #555; } +.cm-s-elegant span.cm-keyword { color: #730; } +.cm-s-elegant span.cm-builtin { color: #30a; } +.cm-s-elegant span.cm-link { color: #762; } +.cm-s-elegant span.cm-error { background-color: #fdd; } + +.cm-s-elegant .CodeMirror-activeline-background { background: #e8f2ff; } +.cm-s-elegant .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; } diff --git a/app/lib/codemirror/theme/erlang-dark.css b/app/lib/codemirror/theme/erlang-dark.css new file mode 100644 index 0000000..65fe481 --- /dev/null +++ b/app/lib/codemirror/theme/erlang-dark.css @@ -0,0 +1,34 @@ +.cm-s-erlang-dark.CodeMirror { background: #002240; color: white; } +.cm-s-erlang-dark div.CodeMirror-selected { background: #b36539; } +.cm-s-erlang-dark .CodeMirror-line::selection, .cm-s-erlang-dark .CodeMirror-line > span::selection, .cm-s-erlang-dark .CodeMirror-line > span > span::selection { background: rgba(179, 101, 57, .99); } +.cm-s-erlang-dark .CodeMirror-line::-moz-selection, .cm-s-erlang-dark .CodeMirror-line > span::-moz-selection, .cm-s-erlang-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(179, 101, 57, .99); } +.cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } +.cm-s-erlang-dark .CodeMirror-guttermarker { color: white; } +.cm-s-erlang-dark .CodeMirror-guttermarker-subtle { color: #d0d0d0; } +.cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; } +.cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white; } + +.cm-s-erlang-dark span.cm-quote { color: #ccc; } +.cm-s-erlang-dark span.cm-atom { color: #f133f1; } +.cm-s-erlang-dark span.cm-attribute { color: #ff80e1; } +.cm-s-erlang-dark span.cm-bracket { color: #ff9d00; } +.cm-s-erlang-dark span.cm-builtin { color: #eaa; } +.cm-s-erlang-dark span.cm-comment { color: #77f; } +.cm-s-erlang-dark span.cm-def { color: #e7a; } +.cm-s-erlang-dark span.cm-keyword { color: #ffee80; } +.cm-s-erlang-dark span.cm-meta { color: #50fefe; } +.cm-s-erlang-dark span.cm-number { color: #ffd0d0; } +.cm-s-erlang-dark span.cm-operator { color: #d55; } +.cm-s-erlang-dark span.cm-property { color: #ccc; } +.cm-s-erlang-dark span.cm-qualifier { color: #ccc; } +.cm-s-erlang-dark span.cm-special { color: #ffbbbb; } +.cm-s-erlang-dark span.cm-string { color: #3ad900; } +.cm-s-erlang-dark span.cm-string-2 { color: #ccc; } +.cm-s-erlang-dark span.cm-tag { color: #9effff; } +.cm-s-erlang-dark span.cm-variable { color: #50fe50; } +.cm-s-erlang-dark span.cm-variable-2 { color: #e0e; } +.cm-s-erlang-dark span.cm-variable-3 { color: #ccc; } +.cm-s-erlang-dark span.cm-error { color: #9d1e15; } + +.cm-s-erlang-dark .CodeMirror-activeline-background { background: #013461; } +.cm-s-erlang-dark .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; } diff --git a/app/lib/codemirror/theme/hopscotch.css b/app/lib/codemirror/theme/hopscotch.css new file mode 100644 index 0000000..7d05431 --- /dev/null +++ b/app/lib/codemirror/theme/hopscotch.css @@ -0,0 +1,34 @@ +/* + + Name: Hopscotch + Author: Jan T. Sott + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +.cm-s-hopscotch.CodeMirror {background: #322931; color: #d5d3d5;} +.cm-s-hopscotch div.CodeMirror-selected {background: #433b42 !important;} +.cm-s-hopscotch .CodeMirror-gutters {background: #322931; border-right: 0px;} +.cm-s-hopscotch .CodeMirror-linenumber {color: #797379;} +.cm-s-hopscotch .CodeMirror-cursor {border-left: 1px solid #989498 !important;} + +.cm-s-hopscotch span.cm-comment {color: #b33508;} +.cm-s-hopscotch span.cm-atom {color: #c85e7c;} +.cm-s-hopscotch span.cm-number {color: #c85e7c;} + +.cm-s-hopscotch span.cm-property, .cm-s-hopscotch span.cm-attribute {color: #8fc13e;} +.cm-s-hopscotch span.cm-keyword {color: #dd464c;} +.cm-s-hopscotch span.cm-string {color: #fdcc59;} + +.cm-s-hopscotch span.cm-variable {color: #8fc13e;} +.cm-s-hopscotch span.cm-variable-2 {color: #1290bf;} +.cm-s-hopscotch span.cm-def {color: #fd8b19;} +.cm-s-hopscotch span.cm-error {background: #dd464c; color: #989498;} +.cm-s-hopscotch span.cm-bracket {color: #d5d3d5;} +.cm-s-hopscotch span.cm-tag {color: #dd464c;} +.cm-s-hopscotch span.cm-link {color: #c85e7c;} + +.cm-s-hopscotch .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} +.cm-s-hopscotch .CodeMirror-activeline-background { background: #302020; } diff --git a/app/lib/codemirror/theme/icecoder.css b/app/lib/codemirror/theme/icecoder.css new file mode 100644 index 0000000..ffebaf2 --- /dev/null +++ b/app/lib/codemirror/theme/icecoder.css @@ -0,0 +1,43 @@ +/* +ICEcoder default theme by Matt Pass, used in code editor available at https://icecoder.net +*/ + +.cm-s-icecoder { color: #666; background: #1d1d1b; } + +.cm-s-icecoder span.cm-keyword { color: #eee; font-weight:bold; } /* off-white 1 */ +.cm-s-icecoder span.cm-atom { color: #e1c76e; } /* yellow */ +.cm-s-icecoder span.cm-number { color: #6cb5d9; } /* blue */ +.cm-s-icecoder span.cm-def { color: #b9ca4a; } /* green */ + +.cm-s-icecoder span.cm-variable { color: #6cb5d9; } /* blue */ +.cm-s-icecoder span.cm-variable-2 { color: #cc1e5c; } /* pink */ +.cm-s-icecoder span.cm-variable-3 { color: #f9602c; } /* orange */ + +.cm-s-icecoder span.cm-property { color: #eee; } /* off-white 1 */ +.cm-s-icecoder span.cm-operator { color: #9179bb; } /* purple */ +.cm-s-icecoder span.cm-comment { color: #97a3aa; } /* grey-blue */ + +.cm-s-icecoder span.cm-string { color: #b9ca4a; } /* green */ +.cm-s-icecoder span.cm-string-2 { color: #6cb5d9; } /* blue */ + +.cm-s-icecoder span.cm-meta { color: #555; } /* grey */ + +.cm-s-icecoder span.cm-qualifier { color: #555; } /* grey */ +.cm-s-icecoder span.cm-builtin { color: #214e7b; } /* bright blue */ +.cm-s-icecoder span.cm-bracket { color: #cc7; } /* grey-yellow */ + +.cm-s-icecoder span.cm-tag { color: #e8e8e8; } /* off-white 2 */ +.cm-s-icecoder span.cm-attribute { color: #099; } /* teal */ + +.cm-s-icecoder span.cm-header { color: #6a0d6a; } /* purple-pink */ +.cm-s-icecoder span.cm-quote { color: #186718; } /* dark green */ +.cm-s-icecoder span.cm-hr { color: #888; } /* mid-grey */ +.cm-s-icecoder span.cm-link { color: #e1c76e; } /* yellow */ +.cm-s-icecoder span.cm-error { color: #d00; } /* red */ + +.cm-s-icecoder .CodeMirror-cursor { border-left: 1px solid white; } +.cm-s-icecoder div.CodeMirror-selected { color: #fff; background: #037; } +.cm-s-icecoder .CodeMirror-gutters { background: #1d1d1b; min-width: 41px; border-right: 0; } +.cm-s-icecoder .CodeMirror-linenumber { color: #555; cursor: default; } +.cm-s-icecoder .CodeMirror-matchingbracket { color: #fff !important; background: #555 !important; } +.cm-s-icecoder .CodeMirror-activeline-background { background: #000; } diff --git a/app/lib/codemirror/theme/isotope.css b/app/lib/codemirror/theme/isotope.css new file mode 100644 index 0000000..d0d6263 --- /dev/null +++ b/app/lib/codemirror/theme/isotope.css @@ -0,0 +1,34 @@ +/* + + Name: Isotope + Author: David Desandro / Jan T. Sott + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +.cm-s-isotope.CodeMirror {background: #000000; color: #e0e0e0;} +.cm-s-isotope div.CodeMirror-selected {background: #404040 !important;} +.cm-s-isotope .CodeMirror-gutters {background: #000000; border-right: 0px;} +.cm-s-isotope .CodeMirror-linenumber {color: #808080;} +.cm-s-isotope .CodeMirror-cursor {border-left: 1px solid #c0c0c0 !important;} + +.cm-s-isotope span.cm-comment {color: #3300ff;} +.cm-s-isotope span.cm-atom {color: #cc00ff;} +.cm-s-isotope span.cm-number {color: #cc00ff;} + +.cm-s-isotope span.cm-property, .cm-s-isotope span.cm-attribute {color: #33ff00;} +.cm-s-isotope span.cm-keyword {color: #ff0000;} +.cm-s-isotope span.cm-string {color: #ff0099;} + +.cm-s-isotope span.cm-variable {color: #33ff00;} +.cm-s-isotope span.cm-variable-2 {color: #0066ff;} +.cm-s-isotope span.cm-def {color: #ff9900;} +.cm-s-isotope span.cm-error {background: #ff0000; color: #c0c0c0;} +.cm-s-isotope span.cm-bracket {color: #e0e0e0;} +.cm-s-isotope span.cm-tag {color: #ff0000;} +.cm-s-isotope span.cm-link {color: #cc00ff;} + +.cm-s-isotope .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} +.cm-s-isotope .CodeMirror-activeline-background { background: #202020; } diff --git a/app/lib/codemirror/theme/lesser-dark.css b/app/lib/codemirror/theme/lesser-dark.css new file mode 100644 index 0000000..690c183 --- /dev/null +++ b/app/lib/codemirror/theme/lesser-dark.css @@ -0,0 +1,47 @@ +/* +http://lesscss.org/ dark theme +Ported to CodeMirror by Peter Kroon +*/ +.cm-s-lesser-dark { + line-height: 1.3em; +} +.cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; } +.cm-s-lesser-dark div.CodeMirror-selected { background: #45443B; } /* 33322B*/ +.cm-s-lesser-dark .CodeMirror-line::selection, .cm-s-lesser-dark .CodeMirror-line > span::selection, .cm-s-lesser-dark .CodeMirror-line > span > span::selection { background: rgba(69, 68, 59, .99); } +.cm-s-lesser-dark .CodeMirror-line::-moz-selection, .cm-s-lesser-dark .CodeMirror-line > span::-moz-selection, .cm-s-lesser-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(69, 68, 59, .99); } +.cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white; } +.cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/ + +.cm-s-lesser-dark.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/ + +.cm-s-lesser-dark .CodeMirror-gutters { background: #262626; border-right:1px solid #aaa; } +.cm-s-lesser-dark .CodeMirror-guttermarker { color: #599eff; } +.cm-s-lesser-dark .CodeMirror-guttermarker-subtle { color: #777; } +.cm-s-lesser-dark .CodeMirror-linenumber { color: #777; } + +.cm-s-lesser-dark span.cm-header { color: #a0a; } +.cm-s-lesser-dark span.cm-quote { color: #090; } +.cm-s-lesser-dark span.cm-keyword { color: #599eff; } +.cm-s-lesser-dark span.cm-atom { color: #C2B470; } +.cm-s-lesser-dark span.cm-number { color: #B35E4D; } +.cm-s-lesser-dark span.cm-def { color: white; } +.cm-s-lesser-dark span.cm-variable { color:#D9BF8C; } +.cm-s-lesser-dark span.cm-variable-2 { color: #669199; } +.cm-s-lesser-dark span.cm-variable-3 { color: white; } +.cm-s-lesser-dark span.cm-property { color: #92A75C; } +.cm-s-lesser-dark span.cm-operator { color: #92A75C; } +.cm-s-lesser-dark span.cm-comment { color: #666; } +.cm-s-lesser-dark span.cm-string { color: #BCD279; } +.cm-s-lesser-dark span.cm-string-2 { color: #f50; } +.cm-s-lesser-dark span.cm-meta { color: #738C73; } +.cm-s-lesser-dark span.cm-qualifier { color: #555; } +.cm-s-lesser-dark span.cm-builtin { color: #ff9e59; } +.cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; } +.cm-s-lesser-dark span.cm-tag { color: #669199; } +.cm-s-lesser-dark span.cm-attribute { color: #00c; } +.cm-s-lesser-dark span.cm-hr { color: #999; } +.cm-s-lesser-dark span.cm-link { color: #00c; } +.cm-s-lesser-dark span.cm-error { color: #9d1e15; } + +.cm-s-lesser-dark .CodeMirror-activeline-background { background: #3C3A3A; } +.cm-s-lesser-dark .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; } diff --git a/app/lib/codemirror/theme/liquibyte.css b/app/lib/codemirror/theme/liquibyte.css new file mode 100644 index 0000000..9db8bde --- /dev/null +++ b/app/lib/codemirror/theme/liquibyte.css @@ -0,0 +1,95 @@ +.cm-s-liquibyte.CodeMirror { + background-color: #000; + color: #fff; + line-height: 1.2em; + font-size: 1em; +} +.cm-s-liquibyte .CodeMirror-focused .cm-matchhighlight { + text-decoration: underline; + text-decoration-color: #0f0; + text-decoration-style: wavy; +} +.cm-s-liquibyte .cm-trailingspace { + text-decoration: line-through; + text-decoration-color: #f00; + text-decoration-style: dotted; +} +.cm-s-liquibyte .cm-tab { + text-decoration: line-through; + text-decoration-color: #404040; + text-decoration-style: dotted; +} +.cm-s-liquibyte .CodeMirror-gutters { background-color: #262626; border-right: 1px solid #505050; padding-right: 0.8em; } +.cm-s-liquibyte .CodeMirror-gutter-elt div { font-size: 1.2em; } +.cm-s-liquibyte .CodeMirror-guttermarker { } +.cm-s-liquibyte .CodeMirror-guttermarker-subtle { } +.cm-s-liquibyte .CodeMirror-linenumber { color: #606060; padding-left: 0; } +.cm-s-liquibyte .CodeMirror-cursor { border-left: 1px solid #eee; } + +.cm-s-liquibyte span.cm-comment { color: #008000; } +.cm-s-liquibyte span.cm-def { color: #ffaf40; font-weight: bold; } +.cm-s-liquibyte span.cm-keyword { color: #c080ff; font-weight: bold; } +.cm-s-liquibyte span.cm-builtin { color: #ffaf40; font-weight: bold; } +.cm-s-liquibyte span.cm-variable { color: #5967ff; font-weight: bold; } +.cm-s-liquibyte span.cm-string { color: #ff8000; } +.cm-s-liquibyte span.cm-number { color: #0f0; font-weight: bold; } +.cm-s-liquibyte span.cm-atom { color: #bf3030; font-weight: bold; } + +.cm-s-liquibyte span.cm-variable-2 { color: #007f7f; font-weight: bold; } +.cm-s-liquibyte span.cm-variable-3 { color: #c080ff; font-weight: bold; } +.cm-s-liquibyte span.cm-property { color: #999; font-weight: bold; } +.cm-s-liquibyte span.cm-operator { color: #fff; } + +.cm-s-liquibyte span.cm-meta { color: #0f0; } +.cm-s-liquibyte span.cm-qualifier { color: #fff700; font-weight: bold; } +.cm-s-liquibyte span.cm-bracket { color: #cc7; } +.cm-s-liquibyte span.cm-tag { color: #ff0; font-weight: bold; } +.cm-s-liquibyte span.cm-attribute { color: #c080ff; font-weight: bold; } +.cm-s-liquibyte span.cm-error { color: #f00; } + +.cm-s-liquibyte div.CodeMirror-selected { background-color: rgba(255, 0, 0, 0.25); } + +.cm-s-liquibyte span.cm-compilation { background-color: rgba(255, 255, 255, 0.12); } + +.cm-s-liquibyte .CodeMirror-activeline-background { background-color: rgba(0, 255, 0, 0.15); } + +/* Default styles for common addons */ +.cm-s-liquibyte .CodeMirror span.CodeMirror-matchingbracket { color: #0f0; font-weight: bold; } +.cm-s-liquibyte .CodeMirror span.CodeMirror-nonmatchingbracket { color: #f00; font-weight: bold; } +.CodeMirror-matchingtag { background-color: rgba(150, 255, 0, .3); } +/* Scrollbars */ +/* Simple */ +.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div:hover, div.CodeMirror-simplescroll-vertical div:hover { + background-color: rgba(80, 80, 80, .7); +} +.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div, div.CodeMirror-simplescroll-vertical div { + background-color: rgba(80, 80, 80, .3); + border: 1px solid #404040; + border-radius: 5px; +} +.cm-s-liquibyte div.CodeMirror-simplescroll-vertical div { + border-top: 1px solid #404040; + border-bottom: 1px solid #404040; +} +.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div { + border-left: 1px solid #404040; + border-right: 1px solid #404040; +} +.cm-s-liquibyte div.CodeMirror-simplescroll-vertical { + background-color: #262626; +} +.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal { + background-color: #262626; + border-top: 1px solid #404040; +} +/* Overlay */ +.cm-s-liquibyte div.CodeMirror-overlayscroll-horizontal div, div.CodeMirror-overlayscroll-vertical div { + background-color: #404040; + border-radius: 5px; +} +.cm-s-liquibyte div.CodeMirror-overlayscroll-vertical div { + border: 1px solid #404040; +} +.cm-s-liquibyte div.CodeMirror-overlayscroll-horizontal div { + border: 1px solid #404040; +} diff --git a/app/lib/codemirror/theme/material.css b/app/lib/codemirror/theme/material.css new file mode 100644 index 0000000..01d8679 --- /dev/null +++ b/app/lib/codemirror/theme/material.css @@ -0,0 +1,53 @@ +/* + + Name: material + Author: Michael Kaminsky (http://github.com/mkaminsky11) + + Original material color scheme by Mattia Astorino (https://github.com/equinusocio/material-theme) + +*/ + +.cm-s-material.CodeMirror { + background-color: #263238; + color: rgba(233, 237, 237, 1); +} +.cm-s-material .CodeMirror-gutters { + background: #263238; + color: rgb(83,127,126); + border: none; +} +.cm-s-material .CodeMirror-guttermarker, .cm-s-material .CodeMirror-guttermarker-subtle, .cm-s-material .CodeMirror-linenumber { color: rgb(83,127,126); } +.cm-s-material .CodeMirror-cursor { border-left: 1px solid #f8f8f0; } +.cm-s-material div.CodeMirror-selected { background: rgba(255, 255, 255, 0.15); } +.cm-s-material.CodeMirror-focused div.CodeMirror-selected { background: rgba(255, 255, 255, 0.10); } +.cm-s-material .CodeMirror-line::selection, .cm-s-material .CodeMirror-line > span::selection, .cm-s-material .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); } +.cm-s-material .CodeMirror-line::-moz-selection, .cm-s-material .CodeMirror-line > span::-moz-selection, .cm-s-material .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); } + +.cm-s-material .CodeMirror-activeline-background { background: rgba(0, 0, 0, 0); } +.cm-s-material .cm-keyword { color: rgba(199, 146, 234, 1); } +.cm-s-material .cm-operator { color: rgba(233, 237, 237, 1); } +.cm-s-material .cm-variable-2 { color: #80CBC4; } +.cm-s-material .cm-variable-3 { color: #82B1FF; } +.cm-s-material .cm-builtin { color: #DECB6B; } +.cm-s-material .cm-atom { color: #F77669; } +.cm-s-material .cm-number { color: #F77669; } +.cm-s-material .cm-def { color: rgba(233, 237, 237, 1); } +.cm-s-material .cm-string { color: #C3E88D; } +.cm-s-material .cm-string-2 { color: #80CBC4; } +.cm-s-material .cm-comment { color: #546E7A; } +.cm-s-material .cm-variable { color: #82B1FF; } +.cm-s-material .cm-tag { color: #80CBC4; } +.cm-s-material .cm-meta { color: #80CBC4; } +.cm-s-material .cm-attribute { color: #FFCB6B; } +.cm-s-material .cm-property { color: #80CBAE; } +.cm-s-material .cm-qualifier { color: #DECB6B; } +.cm-s-material .cm-variable-3 { color: #DECB6B; } +.cm-s-material .cm-tag { color: rgba(255, 83, 112, 1); } +.cm-s-material .cm-error { + color: rgba(255, 255, 255, 1.0); + background-color: #EC5F67; +} +.cm-s-material .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} diff --git a/app/lib/codemirror/theme/mbo.css b/app/lib/codemirror/theme/mbo.css new file mode 100644 index 0000000..e164fcf --- /dev/null +++ b/app/lib/codemirror/theme/mbo.css @@ -0,0 +1,37 @@ +/****************************************************************/ +/* Based on mbonaci's Brackets mbo theme */ +/* https://github.com/mbonaci/global/blob/master/Mbo.tmTheme */ +/* Create your own: http://tmtheme-editor.herokuapp.com */ +/****************************************************************/ + +.cm-s-mbo.CodeMirror { background: #2c2c2c; color: #ffffec; } +.cm-s-mbo div.CodeMirror-selected { background: #716C62; } +.cm-s-mbo .CodeMirror-line::selection, .cm-s-mbo .CodeMirror-line > span::selection, .cm-s-mbo .CodeMirror-line > span > span::selection { background: rgba(113, 108, 98, .99); } +.cm-s-mbo .CodeMirror-line::-moz-selection, .cm-s-mbo .CodeMirror-line > span::-moz-selection, .cm-s-mbo .CodeMirror-line > span > span::-moz-selection { background: rgba(113, 108, 98, .99); } +.cm-s-mbo .CodeMirror-gutters { background: #4e4e4e; border-right: 0px; } +.cm-s-mbo .CodeMirror-guttermarker { color: white; } +.cm-s-mbo .CodeMirror-guttermarker-subtle { color: grey; } +.cm-s-mbo .CodeMirror-linenumber { color: #dadada; } +.cm-s-mbo .CodeMirror-cursor { border-left: 1px solid #ffffec; } + +.cm-s-mbo span.cm-comment { color: #95958a; } +.cm-s-mbo span.cm-atom { color: #00a8c6; } +.cm-s-mbo span.cm-number { color: #00a8c6; } + +.cm-s-mbo span.cm-property, .cm-s-mbo span.cm-attribute { color: #9ddfe9; } +.cm-s-mbo span.cm-keyword { color: #ffb928; } +.cm-s-mbo span.cm-string { color: #ffcf6c; } +.cm-s-mbo span.cm-string.cm-property { color: #ffffec; } + +.cm-s-mbo span.cm-variable { color: #ffffec; } +.cm-s-mbo span.cm-variable-2 { color: #00a8c6; } +.cm-s-mbo span.cm-def { color: #ffffec; } +.cm-s-mbo span.cm-bracket { color: #fffffc; font-weight: bold; } +.cm-s-mbo span.cm-tag { color: #9ddfe9; } +.cm-s-mbo span.cm-link { color: #f54b07; } +.cm-s-mbo span.cm-error { border-bottom: #636363; color: #ffffec; } +.cm-s-mbo span.cm-qualifier { color: #ffffec; } + +.cm-s-mbo .CodeMirror-activeline-background { background: #494b41; } +.cm-s-mbo .CodeMirror-matchingbracket { color: #ffb928 !important; } +.cm-s-mbo .CodeMirror-matchingtag { background: rgba(255, 255, 255, .37); } diff --git a/app/lib/codemirror/theme/mdn-like.css b/app/lib/codemirror/theme/mdn-like.css new file mode 100644 index 0000000..f325d45 --- /dev/null +++ b/app/lib/codemirror/theme/mdn-like.css @@ -0,0 +1,46 @@ +/* + MDN-LIKE Theme - Mozilla + Ported to CodeMirror by Peter Kroon + Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues + GitHub: @peterkroon + + The mdn-like theme is inspired on the displayed code examples at: https://developer.mozilla.org/en-US/docs/Web/CSS/animation + +*/ +.cm-s-mdn-like.CodeMirror { color: #999; background-color: #fff; } +.cm-s-mdn-like div.CodeMirror-selected { background: #cfc; } +.cm-s-mdn-like .CodeMirror-line::selection, .cm-s-mdn-like .CodeMirror-line > span::selection, .cm-s-mdn-like .CodeMirror-line > span > span::selection { background: #cfc; } +.cm-s-mdn-like .CodeMirror-line::-moz-selection, .cm-s-mdn-like .CodeMirror-line > span::-moz-selection, .cm-s-mdn-like .CodeMirror-line > span > span::-moz-selection { background: #cfc; } + +.cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; } +.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; padding-left: 8px; } +.cm-s-mdn-like .CodeMirror-cursor { border-left: 2px solid #222; } + +.cm-s-mdn-like .cm-keyword { color: #6262FF; } +.cm-s-mdn-like .cm-atom { color: #F90; } +.cm-s-mdn-like .cm-number { color: #ca7841; } +.cm-s-mdn-like .cm-def { color: #8DA6CE; } +.cm-s-mdn-like span.cm-variable-2, .cm-s-mdn-like span.cm-tag { color: #690; } +.cm-s-mdn-like span.cm-variable-3, .cm-s-mdn-like span.cm-def { color: #07a; } + +.cm-s-mdn-like .cm-variable { color: #07a; } +.cm-s-mdn-like .cm-property { color: #905; } +.cm-s-mdn-like .cm-qualifier { color: #690; } + +.cm-s-mdn-like .cm-operator { color: #cda869; } +.cm-s-mdn-like .cm-comment { color:#777; font-weight:normal; } +.cm-s-mdn-like .cm-string { color:#07a; font-style:italic; } +.cm-s-mdn-like .cm-string-2 { color:#bd6b18; } /*?*/ +.cm-s-mdn-like .cm-meta { color: #000; } /*?*/ +.cm-s-mdn-like .cm-builtin { color: #9B7536; } /*?*/ +.cm-s-mdn-like .cm-tag { color: #997643; } +.cm-s-mdn-like .cm-attribute { color: #d6bb6d; } /*?*/ +.cm-s-mdn-like .cm-header { color: #FF6400; } +.cm-s-mdn-like .cm-hr { color: #AEAEAE; } +.cm-s-mdn-like .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } +.cm-s-mdn-like .cm-error { border-bottom: 1px solid red; } + +div.cm-s-mdn-like .CodeMirror-activeline-background { background: #efefff; } +div.cm-s-mdn-like span.CodeMirror-matchingbracket { outline:1px solid grey; color: inherit; } + +.cm-s-mdn-like.CodeMirror { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAyCAYAAAAp8UeFAAAHvklEQVR42s2b63bcNgyEQZCSHCdt2vd/0tWF7I+Q6XgMXiTtuvU5Pl57ZQKkKHzEAOtF5KeIJBGJ8uvL599FRFREZhFx8DeXv8trn68RuGaC8TRfo3SNp9dlDDHedyLyTUTeRWStXKPZrjtpZxaRw5hPqozRs1N8/enzIiQRWcCgy4MUA0f+XWliDhyL8Lfyvx7ei/Ae3iQFHyw7U/59pQVIMEEPEz0G7XiwdRjzSfC3UTtz9vchIntxvry5iMgfIhJoEflOz2CQr3F5h/HfeFe+GTdLaKcu9L8LTeQb/R/7GgbsfKedyNdoHsN31uRPWrfZ5wsj/NzzRQHuToIdU3ahwnsKPxXCjJITuOsi7XLc7SG/v5GdALs7wf8JjTFiB5+QvTEfRyGOfX3Lrx8wxyQi3sNq46O7QahQiCsRFgqddjBouVEHOKDgXAQHD9gJCr5sMKkEdjwsarG/ww3BMHBU7OBjXnzdyY7SfCxf5/z6ATccrwlKuwC/jhznnPF4CgVzhhVf4xp2EixcBActO75iZ8/fM9zAs2OMzKdslgXWJ9XG8PQoOAMA5fGcsvORgv0doBXyHrCwfLJAOwo71QLNkb8n2Pl6EWiR7OCibtkPaz4Kc/0NNAze2gju3zOwekALDaCFPI5vjPFmgGY5AZqyGEvH1x7QfIb8YtxMnA/b+QQ0aQDAwc6JMFg8CbQZ4qoYEEHbRwNojuK3EHwd7VALSgq+MNDKzfT58T8qdpADrgW0GmgcAS1lhzztJmkAzcPNOQbsWEALBDSlMKUG0Eq4CLAQWvEVQ9WU57gZJwZtgPO3r9oBTQ9WO8TjqXINx8R0EYpiZEUWOF3FxkbJkgU9B2f41YBrIj5ZfsQa0M5kTgiAAqM3ShXLgu8XMqcrQBvJ0CL5pnTsfMB13oB8athpAq2XOQmcGmoACCLydx7nToa23ATaSIY2ichfOdPTGxlasXMLaL0MLZAOwAKIM+y8CmicobGdCcbbK9DzN+yYGVoNNI5iUKTMyYOjPse4A8SM1MmcXgU0toOq1yO/v8FOxlASyc7TgeYaAMBJHcY1CcCwGI/TK4AmDbDyKYBBtFUkRwto8gygiQEaByFgJ00BH2M8JWwQS1nafDXQCidWyOI8AcjDCSjCLk8ngObuAm3JAHAdubAmOaK06V8MNEsKPJOhobSprwQa6gD7DclRQdqcwL4zxqgBrQcabUiBLclRDKAlWp+etPkBaNMA0AKlrHwTdEByZAA4GM+SNluSY6wAzcMNewxmgig5Ks0nkrSpBvSaQHMdKTBAnLojOdYyGpQ254602ZILPdTD1hdlggdIm74jbTp8vDwF5ZYUeLWGJpWsh6XNyXgcYwVoJQTEhhTYkxzZjiU5npU2TaB979TQehlaAVq4kaGpiPwwwLkYUuBbQwocyQTv1tA0+1UFWoJF3iv1oq+qoSk8EQdJmwHkziIF7oOZk14EGitibAdjLYYK78H5vZOhtWpoI0ATGHs0Q8OMb4Ey+2bU2UYztCtA0wFAs7TplGLRVQCcqaFdGSPCeTI1QNIC52iWNzof6Uib7xjEp07mNNoUYmVosVItHrHzRlLgBn9LFyRHaQCtVUMbtTNhoXWiTOO9k/V8BdAc1Oq0ArSQs6/5SU0hckNy9NnXqQY0PGYo5dWJ7nINaN6o958FWin27aBaWRka1r5myvLOAm0j30eBJqCxHLReVclxhxOEN2JfDWjxBtAC7MIH1fVaGdoOp4qJYDgKtKPSFNID2gSnGldrCqkFZ+5UeQXQBIRrSwocbdZYQT/2LwRahBPBXoHrB8nxaGROST62DKUbQOMMzZIC9abkuELfQzQALWTnDNAm8KHWFOJgJ5+SHIvTPcmx1xQyZRhNL5Qci689aXMEaN/uNIWkEwDAvFpOZmgsBaaGnbs1NPa1Jm32gBZAIh1pCtG7TSH4aE0y1uVY4uqoFPisGlpP2rSA5qTecWn5agK6BzSpgAyD+wFaqhnYoSZ1Vwr8CmlTQbrcO3ZaX0NAEyMbYaAlyquFoLKK3SPby9CeVUPThrSJmkCAE0CrKUQadi4DrdSlWhmah0YL9z9vClH59YGbHx1J8VZTyAjQepJjmXwAKTDQI3omc3p1U4gDUf6RfcdYfrUp5ClAi2J3Ba6UOXGo+K+bQrjjssitG2SJzshaLwMtXgRagUNpYYoVkMSBLM+9GGiJZMvduG6DRZ4qc04DMPtQQxOjEtACmhO7K1AbNbQDEggZyJwscFpAGwENhoBeUwh3bWolhe8BTYVKxQEWrSUn/uhcM5KhvUu/+eQu0Lzhi+VrK0PrZZNDQKs9cpYUuFYgMVpD4/NxenJTiMCNqdUEUf1qZWjppLT5qSkkUZbCwkbZMSuVnu80hfSkzRbQeqCZSAh6huR4VtoM2gHAlLf72smuWgE+VV7XpE25Ab2WFDgyhnSuKbs4GuGzCjR+tIoUuMFg3kgcWKLTwRqanJQ2W00hAsenfaApRC42hbCvK1SlE0HtE9BGgneJO+ELamitD1YjjOYnNYVcraGhtKkW0EqVVeDx733I2NH581k1NNxNLG0i0IJ8/NjVaOZ0tYZ2Vtr0Xv7tPV3hkWp9EFkgS/J0vosngTaSoaG06WHi+xObQkaAdlbanP8B2+2l0f90LmUAAAAASUVORK5CYII=); } diff --git a/app/lib/codemirror/theme/midnight.css b/app/lib/codemirror/theme/midnight.css new file mode 100644 index 0000000..e41f105 --- /dev/null +++ b/app/lib/codemirror/theme/midnight.css @@ -0,0 +1,45 @@ +/* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */ + +/**/ +.cm-s-midnight span.CodeMirror-matchhighlight { background: #494949; } +.cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67 !important; } + +/**/ +.cm-s-midnight .CodeMirror-activeline-background { background: #253540; } + +.cm-s-midnight.CodeMirror { + background: #0F192A; + color: #D1EDFF; +} + +.cm-s-midnight.CodeMirror { border-top: 1px solid black; border-bottom: 1px solid black; } + +.cm-s-midnight div.CodeMirror-selected { background: #314D67; } +.cm-s-midnight .CodeMirror-line::selection, .cm-s-midnight .CodeMirror-line > span::selection, .cm-s-midnight .CodeMirror-line > span > span::selection { background: rgba(49, 77, 103, .99); } +.cm-s-midnight .CodeMirror-line::-moz-selection, .cm-s-midnight .CodeMirror-line > span::-moz-selection, .cm-s-midnight .CodeMirror-line > span > span::-moz-selection { background: rgba(49, 77, 103, .99); } +.cm-s-midnight .CodeMirror-gutters { background: #0F192A; border-right: 1px solid; } +.cm-s-midnight .CodeMirror-guttermarker { color: white; } +.cm-s-midnight .CodeMirror-guttermarker-subtle { color: #d0d0d0; } +.cm-s-midnight .CodeMirror-linenumber { color: #D0D0D0; } +.cm-s-midnight .CodeMirror-cursor { border-left: 1px solid #F8F8F0; } + +.cm-s-midnight span.cm-comment { color: #428BDD; } +.cm-s-midnight span.cm-atom { color: #AE81FF; } +.cm-s-midnight span.cm-number { color: #D1EDFF; } + +.cm-s-midnight span.cm-property, .cm-s-midnight span.cm-attribute { color: #A6E22E; } +.cm-s-midnight span.cm-keyword { color: #E83737; } +.cm-s-midnight span.cm-string { color: #1DC116; } + +.cm-s-midnight span.cm-variable { color: #FFAA3E; } +.cm-s-midnight span.cm-variable-2 { color: #FFAA3E; } +.cm-s-midnight span.cm-def { color: #4DD; } +.cm-s-midnight span.cm-bracket { color: #D1EDFF; } +.cm-s-midnight span.cm-tag { color: #449; } +.cm-s-midnight span.cm-link { color: #AE81FF; } +.cm-s-midnight span.cm-error { background: #F92672; color: #F8F8F0; } + +.cm-s-midnight .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} diff --git a/app/lib/codemirror/theme/monokai.css b/app/lib/codemirror/theme/monokai.css new file mode 100644 index 0000000..7c8a4c5 --- /dev/null +++ b/app/lib/codemirror/theme/monokai.css @@ -0,0 +1,36 @@ +/* Based on Sublime Text's Monokai theme */ + +.cm-s-monokai.CodeMirror { background: #272822; color: #f8f8f2; } +.cm-s-monokai div.CodeMirror-selected { background: #49483E; } +.cm-s-monokai .CodeMirror-line::selection, .cm-s-monokai .CodeMirror-line > span::selection, .cm-s-monokai .CodeMirror-line > span > span::selection { background: rgba(73, 72, 62, .99); } +.cm-s-monokai .CodeMirror-line::-moz-selection, .cm-s-monokai .CodeMirror-line > span::-moz-selection, .cm-s-monokai .CodeMirror-line > span > span::-moz-selection { background: rgba(73, 72, 62, .99); } +.cm-s-monokai .CodeMirror-gutters { background: #272822; border-right: 0px; } +.cm-s-monokai .CodeMirror-guttermarker { color: white; } +.cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; } +.cm-s-monokai .CodeMirror-linenumber { color: #d0d0d0; } +.cm-s-monokai .CodeMirror-cursor { border-left: 1px solid #f8f8f0; } + +.cm-s-monokai span.cm-comment { color: #75715e; } +.cm-s-monokai span.cm-atom { color: #ae81ff; } +.cm-s-monokai span.cm-number { color: #ae81ff; } + +.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute { color: #a6e22e; } +.cm-s-monokai span.cm-keyword { color: #f92672; } +.cm-s-monokai span.cm-builtin { color: #66d9ef; } +.cm-s-monokai span.cm-string { color: #e6db74; } + +.cm-s-monokai span.cm-variable { color: #f8f8f2; } +.cm-s-monokai span.cm-variable-2 { color: #9effff; } +.cm-s-monokai span.cm-variable-3 { color: #66d9ef; } +.cm-s-monokai span.cm-def { color: #fd971f; } +.cm-s-monokai span.cm-bracket { color: #f8f8f2; } +.cm-s-monokai span.cm-tag { color: #f92672; } +.cm-s-monokai span.cm-header { color: #ae81ff; } +.cm-s-monokai span.cm-link { color: #ae81ff; } +.cm-s-monokai span.cm-error { background: #f92672; color: #f8f8f0; } + +.cm-s-monokai .CodeMirror-activeline-background { background: #373831; } +.cm-s-monokai .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} diff --git a/app/lib/codemirror/theme/neat.css b/app/lib/codemirror/theme/neat.css new file mode 100644 index 0000000..4267b1a --- /dev/null +++ b/app/lib/codemirror/theme/neat.css @@ -0,0 +1,12 @@ +.cm-s-neat span.cm-comment { color: #a86; } +.cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; } +.cm-s-neat span.cm-string { color: #a22; } +.cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; } +.cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; } +.cm-s-neat span.cm-variable { color: black; } +.cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; } +.cm-s-neat span.cm-meta { color: #555; } +.cm-s-neat span.cm-link { color: #3a3; } + +.cm-s-neat .CodeMirror-activeline-background { background: #e8f2ff; } +.cm-s-neat .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; } diff --git a/app/lib/codemirror/theme/neo.css b/app/lib/codemirror/theme/neo.css new file mode 100644 index 0000000..b28d5c6 --- /dev/null +++ b/app/lib/codemirror/theme/neo.css @@ -0,0 +1,43 @@ +/* neo theme for codemirror */ + +/* Color scheme */ + +.cm-s-neo.CodeMirror { + background-color:#ffffff; + color:#2e383c; + line-height:1.4375; +} +.cm-s-neo .cm-comment { color:#75787b; } +.cm-s-neo .cm-keyword, .cm-s-neo .cm-property { color:#1d75b3; } +.cm-s-neo .cm-atom,.cm-s-neo .cm-number { color:#75438a; } +.cm-s-neo .cm-node,.cm-s-neo .cm-tag { color:#9c3328; } +.cm-s-neo .cm-string { color:#b35e14; } +.cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier { color:#047d65; } + + +/* Editor styling */ + +.cm-s-neo pre { + padding:0; +} + +.cm-s-neo .CodeMirror-gutters { + border:none; + border-right:10px solid transparent; + background-color:transparent; +} + +.cm-s-neo .CodeMirror-linenumber { + padding:0; + color:#e0e2e5; +} + +.cm-s-neo .CodeMirror-guttermarker { color: #1d75b3; } +.cm-s-neo .CodeMirror-guttermarker-subtle { color: #e0e2e5; } + +.cm-s-neo .CodeMirror-cursor { + width: auto; + border: 0; + background: rgba(155,157,162,0.37); + z-index: 1; +} diff --git a/app/lib/codemirror/theme/night.css b/app/lib/codemirror/theme/night.css new file mode 100644 index 0000000..fd4e561 --- /dev/null +++ b/app/lib/codemirror/theme/night.css @@ -0,0 +1,27 @@ +/* Loosely based on the Midnight Textmate theme */ + +.cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; } +.cm-s-night div.CodeMirror-selected { background: #447; } +.cm-s-night .CodeMirror-line::selection, .cm-s-night .CodeMirror-line > span::selection, .cm-s-night .CodeMirror-line > span > span::selection { background: rgba(68, 68, 119, .99); } +.cm-s-night .CodeMirror-line::-moz-selection, .cm-s-night .CodeMirror-line > span::-moz-selection, .cm-s-night .CodeMirror-line > span > span::-moz-selection { background: rgba(68, 68, 119, .99); } +.cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } +.cm-s-night .CodeMirror-guttermarker { color: white; } +.cm-s-night .CodeMirror-guttermarker-subtle { color: #bbb; } +.cm-s-night .CodeMirror-linenumber { color: #f8f8f8; } +.cm-s-night .CodeMirror-cursor { border-left: 1px solid white; } + +.cm-s-night span.cm-comment { color: #8900d1; } +.cm-s-night span.cm-atom { color: #845dc4; } +.cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; } +.cm-s-night span.cm-keyword { color: #599eff; } +.cm-s-night span.cm-string { color: #37f14a; } +.cm-s-night span.cm-meta { color: #7678e2; } +.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; } +.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; } +.cm-s-night span.cm-bracket { color: #8da6ce; } +.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; } +.cm-s-night span.cm-link { color: #845dc4; } +.cm-s-night span.cm-error { color: #9d1e15; } + +.cm-s-night .CodeMirror-activeline-background { background: #1C005A; } +.cm-s-night .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; } diff --git a/app/lib/codemirror/theme/panda-syntax.css b/app/lib/codemirror/theme/panda-syntax.css new file mode 100644 index 0000000..c93b2ea --- /dev/null +++ b/app/lib/codemirror/theme/panda-syntax.css @@ -0,0 +1,85 @@ +/* + Name: Panda Syntax + Author: Siamak Mokhtari (http://github.com/siamak/) + CodeMirror template by Siamak Mokhtari (https://github.com/siamak/atom-panda-syntax) +*/ +.cm-s-panda-syntax { + background: #292A2B; + color: #E6E6E6; + line-height: 1.5; + font-family: 'Operator Mono', 'Source Sans Pro', Menlo, Monaco, Consolas, Courier New, monospace; +} +.cm-s-panda-syntax .CodeMirror-cursor { border-color: #ff2c6d; } +.cm-s-panda-syntax .CodeMirror-activeline-background { + background: rgba(99, 123, 156, 0.1); +} +.cm-s-panda-syntax .CodeMirror-selected { + background: #FFF; +} +.cm-s-panda-syntax .cm-comment { + font-style: italic; + color: #676B79; +} +.cm-s-panda-syntax .cm-operator { + color: #f3f3f3; +} +.cm-s-panda-syntax .cm-string { + color: #19F9D8; +} +.cm-s-panda-syntax .cm-string-2 { + color: #FFB86C; +} + +.cm-s-panda-syntax .cm-tag { + color: #ff2c6d; +} +.cm-s-panda-syntax .cm-meta { + color: #b084eb; +} + +.cm-s-panda-syntax .cm-number { + color: #FFB86C; +} +.cm-s-panda-syntax .cm-atom { + color: #ff2c6d; +} +.cm-s-panda-syntax .cm-keyword { + color: #FF75B5; +} +.cm-s-panda-syntax .cm-variable { + color: #ffb86c; +} +.cm-s-panda-syntax .cm-variable-2 { + color: #ff9ac1; +} +.cm-s-panda-syntax .cm-variable-3 { + color: #ff9ac1; +} + +.cm-s-panda-syntax .cm-def { + color: #e6e6e6; +} +.cm-s-panda-syntax .cm-property { + color: #f3f3f3; +} +.cm-s-panda-syntax .cm-unit { + color: #ffb86c; +} + +.cm-s-panda-syntax .cm-attribute { + color: #ffb86c; +} + +.cm-s-panda-syntax .CodeMirror-matchingbracket { + border-bottom: 1px dotted #19F9D8; + padding-bottom: 2px; + color: #e6e6e6; +} +.cm-s-panda-syntax .CodeMirror-gutters { + background: #292a2b; + border-right-color: rgba(255, 255, 255, 0.1); +} +.cm-s-panda-syntax .CodeMirror-linenumber { + color: #e6e6e6; + opacity: 0.6; +} diff --git a/app/lib/codemirror/theme/paraiso-dark.css b/app/lib/codemirror/theme/paraiso-dark.css new file mode 100644 index 0000000..aa9d207 --- /dev/null +++ b/app/lib/codemirror/theme/paraiso-dark.css @@ -0,0 +1,38 @@ +/* + + Name: Paraíso (Dark) + Author: Jan T. Sott + + Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror) + Inspired by the art of Rubens LP (http://www.rubenslp.com.br) + +*/ + +.cm-s-paraiso-dark.CodeMirror { background: #2f1e2e; color: #b9b6b0; } +.cm-s-paraiso-dark div.CodeMirror-selected { background: #41323f; } +.cm-s-paraiso-dark .CodeMirror-line::selection, .cm-s-paraiso-dark .CodeMirror-line > span::selection, .cm-s-paraiso-dark .CodeMirror-line > span > span::selection { background: rgba(65, 50, 63, .99); } +.cm-s-paraiso-dark .CodeMirror-line::-moz-selection, .cm-s-paraiso-dark .CodeMirror-line > span::-moz-selection, .cm-s-paraiso-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(65, 50, 63, .99); } +.cm-s-paraiso-dark .CodeMirror-gutters { background: #2f1e2e; border-right: 0px; } +.cm-s-paraiso-dark .CodeMirror-guttermarker { color: #ef6155; } +.cm-s-paraiso-dark .CodeMirror-guttermarker-subtle { color: #776e71; } +.cm-s-paraiso-dark .CodeMirror-linenumber { color: #776e71; } +.cm-s-paraiso-dark .CodeMirror-cursor { border-left: 1px solid #8d8687; } + +.cm-s-paraiso-dark span.cm-comment { color: #e96ba8; } +.cm-s-paraiso-dark span.cm-atom { color: #815ba4; } +.cm-s-paraiso-dark span.cm-number { color: #815ba4; } + +.cm-s-paraiso-dark span.cm-property, .cm-s-paraiso-dark span.cm-attribute { color: #48b685; } +.cm-s-paraiso-dark span.cm-keyword { color: #ef6155; } +.cm-s-paraiso-dark span.cm-string { color: #fec418; } + +.cm-s-paraiso-dark span.cm-variable { color: #48b685; } +.cm-s-paraiso-dark span.cm-variable-2 { color: #06b6ef; } +.cm-s-paraiso-dark span.cm-def { color: #f99b15; } +.cm-s-paraiso-dark span.cm-bracket { color: #b9b6b0; } +.cm-s-paraiso-dark span.cm-tag { color: #ef6155; } +.cm-s-paraiso-dark span.cm-link { color: #815ba4; } +.cm-s-paraiso-dark span.cm-error { background: #ef6155; color: #8d8687; } + +.cm-s-paraiso-dark .CodeMirror-activeline-background { background: #4D344A; } +.cm-s-paraiso-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } diff --git a/app/lib/codemirror/theme/paraiso-light.css b/app/lib/codemirror/theme/paraiso-light.css new file mode 100644 index 0000000..ae0c755 --- /dev/null +++ b/app/lib/codemirror/theme/paraiso-light.css @@ -0,0 +1,38 @@ +/* + + Name: Paraíso (Light) + Author: Jan T. Sott + + Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror) + Inspired by the art of Rubens LP (http://www.rubenslp.com.br) + +*/ + +.cm-s-paraiso-light.CodeMirror { background: #e7e9db; color: #41323f; } +.cm-s-paraiso-light div.CodeMirror-selected { background: #b9b6b0; } +.cm-s-paraiso-light .CodeMirror-line::selection, .cm-s-paraiso-light .CodeMirror-line > span::selection, .cm-s-paraiso-light .CodeMirror-line > span > span::selection { background: #b9b6b0; } +.cm-s-paraiso-light .CodeMirror-line::-moz-selection, .cm-s-paraiso-light .CodeMirror-line > span::-moz-selection, .cm-s-paraiso-light .CodeMirror-line > span > span::-moz-selection { background: #b9b6b0; } +.cm-s-paraiso-light .CodeMirror-gutters { background: #e7e9db; border-right: 0px; } +.cm-s-paraiso-light .CodeMirror-guttermarker { color: black; } +.cm-s-paraiso-light .CodeMirror-guttermarker-subtle { color: #8d8687; } +.cm-s-paraiso-light .CodeMirror-linenumber { color: #8d8687; } +.cm-s-paraiso-light .CodeMirror-cursor { border-left: 1px solid #776e71; } + +.cm-s-paraiso-light span.cm-comment { color: #e96ba8; } +.cm-s-paraiso-light span.cm-atom { color: #815ba4; } +.cm-s-paraiso-light span.cm-number { color: #815ba4; } + +.cm-s-paraiso-light span.cm-property, .cm-s-paraiso-light span.cm-attribute { color: #48b685; } +.cm-s-paraiso-light span.cm-keyword { color: #ef6155; } +.cm-s-paraiso-light span.cm-string { color: #fec418; } + +.cm-s-paraiso-light span.cm-variable { color: #48b685; } +.cm-s-paraiso-light span.cm-variable-2 { color: #06b6ef; } +.cm-s-paraiso-light span.cm-def { color: #f99b15; } +.cm-s-paraiso-light span.cm-bracket { color: #41323f; } +.cm-s-paraiso-light span.cm-tag { color: #ef6155; } +.cm-s-paraiso-light span.cm-link { color: #815ba4; } +.cm-s-paraiso-light span.cm-error { background: #ef6155; color: #776e71; } + +.cm-s-paraiso-light .CodeMirror-activeline-background { background: #CFD1C4; } +.cm-s-paraiso-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } diff --git a/app/lib/codemirror/theme/pastel-on-dark.css b/app/lib/codemirror/theme/pastel-on-dark.css new file mode 100644 index 0000000..2603d36 --- /dev/null +++ b/app/lib/codemirror/theme/pastel-on-dark.css @@ -0,0 +1,52 @@ +/** + * Pastel On Dark theme ported from ACE editor + * @license MIT + * @copyright AtomicPages LLC 2014 + * @author Dennis Thompson, AtomicPages LLC + * @version 1.1 + * @source https://github.com/atomicpages/codemirror-pastel-on-dark-theme + */ + +.cm-s-pastel-on-dark.CodeMirror { + background: #2c2827; + color: #8F938F; + line-height: 1.5; +} +.cm-s-pastel-on-dark div.CodeMirror-selected { background: rgba(221,240,255,0.2); } +.cm-s-pastel-on-dark .CodeMirror-line::selection, .cm-s-pastel-on-dark .CodeMirror-line > span::selection, .cm-s-pastel-on-dark .CodeMirror-line > span > span::selection { background: rgba(221,240,255,0.2); } +.cm-s-pastel-on-dark .CodeMirror-line::-moz-selection, .cm-s-pastel-on-dark .CodeMirror-line > span::-moz-selection, .cm-s-pastel-on-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(221,240,255,0.2); } + +.cm-s-pastel-on-dark .CodeMirror-gutters { + background: #34302f; + border-right: 0px; + padding: 0 3px; +} +.cm-s-pastel-on-dark .CodeMirror-guttermarker { color: white; } +.cm-s-pastel-on-dark .CodeMirror-guttermarker-subtle { color: #8F938F; } +.cm-s-pastel-on-dark .CodeMirror-linenumber { color: #8F938F; } +.cm-s-pastel-on-dark .CodeMirror-cursor { border-left: 1px solid #A7A7A7; } +.cm-s-pastel-on-dark span.cm-comment { color: #A6C6FF; } +.cm-s-pastel-on-dark span.cm-atom { color: #DE8E30; } +.cm-s-pastel-on-dark span.cm-number { color: #CCCCCC; } +.cm-s-pastel-on-dark span.cm-property { color: #8F938F; } +.cm-s-pastel-on-dark span.cm-attribute { color: #a6e22e; } +.cm-s-pastel-on-dark span.cm-keyword { color: #AEB2F8; } +.cm-s-pastel-on-dark span.cm-string { color: #66A968; } +.cm-s-pastel-on-dark span.cm-variable { color: #AEB2F8; } +.cm-s-pastel-on-dark span.cm-variable-2 { color: #BEBF55; } +.cm-s-pastel-on-dark span.cm-variable-3 { color: #DE8E30; } +.cm-s-pastel-on-dark span.cm-def { color: #757aD8; } +.cm-s-pastel-on-dark span.cm-bracket { color: #f8f8f2; } +.cm-s-pastel-on-dark span.cm-tag { color: #C1C144; } +.cm-s-pastel-on-dark span.cm-link { color: #ae81ff; } +.cm-s-pastel-on-dark span.cm-qualifier,.cm-s-pastel-on-dark span.cm-builtin { color: #C1C144; } +.cm-s-pastel-on-dark span.cm-error { + background: #757aD8; + color: #f8f8f0; +} +.cm-s-pastel-on-dark .CodeMirror-activeline-background { background: rgba(255, 255, 255, 0.031); } +.cm-s-pastel-on-dark .CodeMirror-matchingbracket { + border: 1px solid rgba(255,255,255,0.25); + color: #8F938F !important; + margin: -1px -1px 0 -1px; +} diff --git a/app/lib/codemirror/theme/railscasts.css b/app/lib/codemirror/theme/railscasts.css new file mode 100644 index 0000000..aeff044 --- /dev/null +++ b/app/lib/codemirror/theme/railscasts.css @@ -0,0 +1,34 @@ +/* + + Name: Railscasts + Author: Ryan Bates (http://railscasts.com) + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +.cm-s-railscasts.CodeMirror {background: #2b2b2b; color: #f4f1ed;} +.cm-s-railscasts div.CodeMirror-selected {background: #272935 !important;} +.cm-s-railscasts .CodeMirror-gutters {background: #2b2b2b; border-right: 0px;} +.cm-s-railscasts .CodeMirror-linenumber {color: #5a647e;} +.cm-s-railscasts .CodeMirror-cursor {border-left: 1px solid #d4cfc9 !important;} + +.cm-s-railscasts span.cm-comment {color: #bc9458;} +.cm-s-railscasts span.cm-atom {color: #b6b3eb;} +.cm-s-railscasts span.cm-number {color: #b6b3eb;} + +.cm-s-railscasts span.cm-property, .cm-s-railscasts span.cm-attribute {color: #a5c261;} +.cm-s-railscasts span.cm-keyword {color: #da4939;} +.cm-s-railscasts span.cm-string {color: #ffc66d;} + +.cm-s-railscasts span.cm-variable {color: #a5c261;} +.cm-s-railscasts span.cm-variable-2 {color: #6d9cbe;} +.cm-s-railscasts span.cm-def {color: #cc7833;} +.cm-s-railscasts span.cm-error {background: #da4939; color: #d4cfc9;} +.cm-s-railscasts span.cm-bracket {color: #f4f1ed;} +.cm-s-railscasts span.cm-tag {color: #da4939;} +.cm-s-railscasts span.cm-link {color: #b6b3eb;} + +.cm-s-railscasts .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} +.cm-s-railscasts .CodeMirror-activeline-background { background: #303040; } diff --git a/app/lib/codemirror/theme/rubyblue.css b/app/lib/codemirror/theme/rubyblue.css new file mode 100644 index 0000000..76d33e7 --- /dev/null +++ b/app/lib/codemirror/theme/rubyblue.css @@ -0,0 +1,25 @@ +.cm-s-rubyblue.CodeMirror { background: #112435; color: white; } +.cm-s-rubyblue div.CodeMirror-selected { background: #38566F; } +.cm-s-rubyblue .CodeMirror-line::selection, .cm-s-rubyblue .CodeMirror-line > span::selection, .cm-s-rubyblue .CodeMirror-line > span > span::selection { background: rgba(56, 86, 111, 0.99); } +.cm-s-rubyblue .CodeMirror-line::-moz-selection, .cm-s-rubyblue .CodeMirror-line > span::-moz-selection, .cm-s-rubyblue .CodeMirror-line > span > span::-moz-selection { background: rgba(56, 86, 111, 0.99); } +.cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; } +.cm-s-rubyblue .CodeMirror-guttermarker { color: white; } +.cm-s-rubyblue .CodeMirror-guttermarker-subtle { color: #3E7087; } +.cm-s-rubyblue .CodeMirror-linenumber { color: white; } +.cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white; } + +.cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; } +.cm-s-rubyblue span.cm-atom { color: #F4C20B; } +.cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; } +.cm-s-rubyblue span.cm-keyword { color: #F0F; } +.cm-s-rubyblue span.cm-string { color: #F08047; } +.cm-s-rubyblue span.cm-meta { color: #F0F; } +.cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; } +.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; } +.cm-s-rubyblue span.cm-bracket { color: #F0F; } +.cm-s-rubyblue span.cm-link { color: #F4C20B; } +.cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; } +.cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; } +.cm-s-rubyblue span.cm-error { color: #AF2018; } + +.cm-s-rubyblue .CodeMirror-activeline-background { background: #173047; } diff --git a/app/lib/codemirror/theme/seti.css b/app/lib/codemirror/theme/seti.css new file mode 100644 index 0000000..6632d3f --- /dev/null +++ b/app/lib/codemirror/theme/seti.css @@ -0,0 +1,44 @@ +/* + + Name: seti + Author: Michael Kaminsky (http://github.com/mkaminsky11) + + Original seti color scheme by Jesse Weed (https://github.com/jesseweed/seti-syntax) + +*/ + + +.cm-s-seti.CodeMirror { + background-color: #151718 !important; + color: #CFD2D1 !important; + border: none; +} +.cm-s-seti .CodeMirror-gutters { + color: #404b53; + background-color: #0E1112; + border: none; +} +.cm-s-seti .CodeMirror-cursor { border-left: solid thin #f8f8f0; } +.cm-s-seti .CodeMirror-linenumber { color: #6D8A88; } +.cm-s-seti.CodeMirror-focused div.CodeMirror-selected { background: rgba(255, 255, 255, 0.10); } +.cm-s-seti .CodeMirror-line::selection, .cm-s-seti .CodeMirror-line > span::selection, .cm-s-seti .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); } +.cm-s-seti .CodeMirror-line::-moz-selection, .cm-s-seti .CodeMirror-line > span::-moz-selection, .cm-s-seti .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); } +.cm-s-seti span.cm-comment { color: #41535b; } +.cm-s-seti span.cm-string, .cm-s-seti span.cm-string-2 { color: #55b5db; } +.cm-s-seti span.cm-number { color: #cd3f45; } +.cm-s-seti span.cm-variable { color: #55b5db; } +.cm-s-seti span.cm-variable-2 { color: #a074c4; } +.cm-s-seti span.cm-def { color: #55b5db; } +.cm-s-seti span.cm-keyword { color: #ff79c6; } +.cm-s-seti span.cm-operator { color: #9fca56; } +.cm-s-seti span.cm-keyword { color: #e6cd69; } +.cm-s-seti span.cm-atom { color: #cd3f45; } +.cm-s-seti span.cm-meta { color: #55b5db; } +.cm-s-seti span.cm-tag { color: #55b5db; } +.cm-s-seti span.cm-attribute { color: #9fca56; } +.cm-s-seti span.cm-qualifier { color: #9fca56; } +.cm-s-seti span.cm-property { color: #a074c4; } +.cm-s-seti span.cm-variable-3 { color: #9fca56; } +.cm-s-seti span.cm-builtin { color: #9fca56; } +.cm-s-seti .CodeMirror-activeline-background { background: #101213; } +.cm-s-seti .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } diff --git a/app/lib/codemirror/theme/solarized dark.css b/app/lib/codemirror/theme/solarized dark.css new file mode 100644 index 0000000..1f39c7e --- /dev/null +++ b/app/lib/codemirror/theme/solarized dark.css @@ -0,0 +1,169 @@ +/* +Solarized theme for code-mirror +http://ethanschoonover.com/solarized +*/ + +/* +Solarized color palette +http://ethanschoonover.com/solarized/img/solarized-palette.png +*/ + +.solarized.base03 { color: #002b36; } +.solarized.base02 { color: #073642; } +.solarized.base01 { color: #586e75; } +.solarized.base00 { color: #657b83; } +.solarized.base0 { color: #839496; } +.solarized.base1 { color: #93a1a1; } +.solarized.base2 { color: #eee8d5; } +.solarized.base3 { color: #fdf6e3; } +.solarized.solar-yellow { color: #b58900; } +.solarized.solar-orange { color: #cb4b16; } +.solarized.solar-red { color: #dc322f; } +.solarized.solar-magenta { color: #d33682; } +.solarized.solar-violet { color: #6c71c4; } +.solarized.solar-blue { color: #268bd2; } +.solarized.solar-cyan { color: #2aa198; } +.solarized.solar-green { color: #859900; } + +/* Color scheme for code-mirror */ + +.cm-s-solarized { + line-height: 1.45em; + color-profile: sRGB; + rendering-intent: auto; +} +.cm-s-solarized.cm-s-dark { + color: #839496; + background-color: #002b36; + text-shadow: #002b36 0 1px; +} +.cm-s-solarized.cm-s-light { + background-color: #fdf6e3; + color: #657b83; + text-shadow: #eee8d5 0 1px; +} + +.cm-s-solarized .CodeMirror-widget { + text-shadow: none; +} + +.cm-s-solarized .cm-header { color: #586e75; } +.cm-s-solarized .cm-quote { color: #93a1a1; } + +.cm-s-solarized .cm-keyword { color: #cb4b16; } +.cm-s-solarized .cm-atom { color: #d33682; } +.cm-s-solarized .cm-number { color: #d33682; } +.cm-s-solarized .cm-def { color: #2aa198; } + +.cm-s-solarized .cm-variable { color: #839496; } +.cm-s-solarized .cm-variable-2 { color: #b58900; } +.cm-s-solarized .cm-variable-3 { color: #6c71c4; } + +.cm-s-solarized .cm-property { color: #2aa198; } +.cm-s-solarized .cm-operator { color: #6c71c4; } + +.cm-s-solarized .cm-comment { color: #586e75; font-style:italic; } + +.cm-s-solarized .cm-string { color: #859900; } +.cm-s-solarized .cm-string-2 { color: #b58900; } + +.cm-s-solarized .cm-meta { color: #859900; } +.cm-s-solarized .cm-qualifier { color: #b58900; } +.cm-s-solarized .cm-builtin { color: #d33682; } +.cm-s-solarized .cm-bracket { color: #cb4b16; } +.cm-s-solarized .CodeMirror-matchingbracket { color: #859900; } +.cm-s-solarized .CodeMirror-nonmatchingbracket { color: #dc322f; } +.cm-s-solarized .cm-tag { color: #93a1a1; } +.cm-s-solarized .cm-attribute { color: #2aa198; } +.cm-s-solarized .cm-hr { + color: transparent; + border-top: 1px solid #586e75; + display: block; +} +.cm-s-solarized .cm-link { color: #93a1a1; cursor: pointer; } +.cm-s-solarized .cm-special { color: #6c71c4; } +.cm-s-solarized .cm-em { + color: #999; + text-decoration: underline; + text-decoration-style: dotted; +} +.cm-s-solarized .cm-strong { color: #eee; } +.cm-s-solarized .cm-error, +.cm-s-solarized .cm-invalidchar { + color: #586e75; + border-bottom: 1px dotted #dc322f; +} + +.cm-s-solarized.cm-s-dark div.CodeMirror-selected { background: #073642; } +.cm-s-solarized.cm-s-dark.CodeMirror ::selection { background: rgba(7, 54, 66, 0.99); } +.cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection, .cm-s-dark .CodeMirror-line > span::-moz-selection, .cm-s-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(7, 54, 66, 0.99); } + +.cm-s-solarized.cm-s-light div.CodeMirror-selected { background: #eee8d5; } +.cm-s-solarized.cm-s-light .CodeMirror-line::selection, .cm-s-light .CodeMirror-line > span::selection, .cm-s-light .CodeMirror-line > span > span::selection { background: #eee8d5; } +.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection, .cm-s-ligh .CodeMirror-line > span::-moz-selection, .cm-s-ligh .CodeMirror-line > span > span::-moz-selection { background: #eee8d5; } + +/* Editor styling */ + + + +/* Little shadow on the view-port of the buffer view */ +.cm-s-solarized.CodeMirror { + -moz-box-shadow: inset 7px 0 12px -6px #000; + -webkit-box-shadow: inset 7px 0 12px -6px #000; + box-shadow: inset 7px 0 12px -6px #000; +} + +/* Remove gutter border */ +.cm-s-solarized .CodeMirror-gutters { + border-right: 0; +} + +/* Gutter colors and line number styling based of color scheme (dark / light) */ + +/* Dark */ +.cm-s-solarized.cm-s-dark .CodeMirror-gutters { + background-color: #073642; +} + +.cm-s-solarized.cm-s-dark .CodeMirror-linenumber { + color: #586e75; + text-shadow: #021014 0 -1px; +} + +/* Light */ +.cm-s-solarized.cm-s-light .CodeMirror-gutters { + background-color: #eee8d5; +} + +.cm-s-solarized.cm-s-light .CodeMirror-linenumber { + color: #839496; +} + +/* Common */ +.cm-s-solarized .CodeMirror-linenumber { + padding: 0 5px; +} +.cm-s-solarized .CodeMirror-guttermarker-subtle { color: #586e75; } +.cm-s-solarized.cm-s-dark .CodeMirror-guttermarker { color: #ddd; } +.cm-s-solarized.cm-s-light .CodeMirror-guttermarker { color: #cb4b16; } + +.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text { + color: #586e75; +} + +/* Cursor */ +.cm-s-solarized .CodeMirror-cursor { border-left: 1px solid #819090; } + +/* Fat cursor */ +.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor { background: #77ee77; } +.cm-s-solarized.cm-s-light .cm-animate-fat-cursor { background-color: #77ee77; } +.cm-s-solarized.cm-s-dark.cm-fat-cursor .CodeMirror-cursor { background: #586e75; } +.cm-s-solarized.cm-s-dark .cm-animate-fat-cursor { background-color: #586e75; } + +/* Active line */ +.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background { + background: rgba(255, 255, 255, 0.06); +} +.cm-s-solarized.cm-s-light .CodeMirror-activeline-background { + background: rgba(0, 0, 0, 0.06); +} diff --git a/app/lib/codemirror/theme/solarized light.css b/app/lib/codemirror/theme/solarized light.css new file mode 100644 index 0000000..1f39c7e --- /dev/null +++ b/app/lib/codemirror/theme/solarized light.css @@ -0,0 +1,169 @@ +/* +Solarized theme for code-mirror +http://ethanschoonover.com/solarized +*/ + +/* +Solarized color palette +http://ethanschoonover.com/solarized/img/solarized-palette.png +*/ + +.solarized.base03 { color: #002b36; } +.solarized.base02 { color: #073642; } +.solarized.base01 { color: #586e75; } +.solarized.base00 { color: #657b83; } +.solarized.base0 { color: #839496; } +.solarized.base1 { color: #93a1a1; } +.solarized.base2 { color: #eee8d5; } +.solarized.base3 { color: #fdf6e3; } +.solarized.solar-yellow { color: #b58900; } +.solarized.solar-orange { color: #cb4b16; } +.solarized.solar-red { color: #dc322f; } +.solarized.solar-magenta { color: #d33682; } +.solarized.solar-violet { color: #6c71c4; } +.solarized.solar-blue { color: #268bd2; } +.solarized.solar-cyan { color: #2aa198; } +.solarized.solar-green { color: #859900; } + +/* Color scheme for code-mirror */ + +.cm-s-solarized { + line-height: 1.45em; + color-profile: sRGB; + rendering-intent: auto; +} +.cm-s-solarized.cm-s-dark { + color: #839496; + background-color: #002b36; + text-shadow: #002b36 0 1px; +} +.cm-s-solarized.cm-s-light { + background-color: #fdf6e3; + color: #657b83; + text-shadow: #eee8d5 0 1px; +} + +.cm-s-solarized .CodeMirror-widget { + text-shadow: none; +} + +.cm-s-solarized .cm-header { color: #586e75; } +.cm-s-solarized .cm-quote { color: #93a1a1; } + +.cm-s-solarized .cm-keyword { color: #cb4b16; } +.cm-s-solarized .cm-atom { color: #d33682; } +.cm-s-solarized .cm-number { color: #d33682; } +.cm-s-solarized .cm-def { color: #2aa198; } + +.cm-s-solarized .cm-variable { color: #839496; } +.cm-s-solarized .cm-variable-2 { color: #b58900; } +.cm-s-solarized .cm-variable-3 { color: #6c71c4; } + +.cm-s-solarized .cm-property { color: #2aa198; } +.cm-s-solarized .cm-operator { color: #6c71c4; } + +.cm-s-solarized .cm-comment { color: #586e75; font-style:italic; } + +.cm-s-solarized .cm-string { color: #859900; } +.cm-s-solarized .cm-string-2 { color: #b58900; } + +.cm-s-solarized .cm-meta { color: #859900; } +.cm-s-solarized .cm-qualifier { color: #b58900; } +.cm-s-solarized .cm-builtin { color: #d33682; } +.cm-s-solarized .cm-bracket { color: #cb4b16; } +.cm-s-solarized .CodeMirror-matchingbracket { color: #859900; } +.cm-s-solarized .CodeMirror-nonmatchingbracket { color: #dc322f; } +.cm-s-solarized .cm-tag { color: #93a1a1; } +.cm-s-solarized .cm-attribute { color: #2aa198; } +.cm-s-solarized .cm-hr { + color: transparent; + border-top: 1px solid #586e75; + display: block; +} +.cm-s-solarized .cm-link { color: #93a1a1; cursor: pointer; } +.cm-s-solarized .cm-special { color: #6c71c4; } +.cm-s-solarized .cm-em { + color: #999; + text-decoration: underline; + text-decoration-style: dotted; +} +.cm-s-solarized .cm-strong { color: #eee; } +.cm-s-solarized .cm-error, +.cm-s-solarized .cm-invalidchar { + color: #586e75; + border-bottom: 1px dotted #dc322f; +} + +.cm-s-solarized.cm-s-dark div.CodeMirror-selected { background: #073642; } +.cm-s-solarized.cm-s-dark.CodeMirror ::selection { background: rgba(7, 54, 66, 0.99); } +.cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection, .cm-s-dark .CodeMirror-line > span::-moz-selection, .cm-s-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(7, 54, 66, 0.99); } + +.cm-s-solarized.cm-s-light div.CodeMirror-selected { background: #eee8d5; } +.cm-s-solarized.cm-s-light .CodeMirror-line::selection, .cm-s-light .CodeMirror-line > span::selection, .cm-s-light .CodeMirror-line > span > span::selection { background: #eee8d5; } +.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection, .cm-s-ligh .CodeMirror-line > span::-moz-selection, .cm-s-ligh .CodeMirror-line > span > span::-moz-selection { background: #eee8d5; } + +/* Editor styling */ + + + +/* Little shadow on the view-port of the buffer view */ +.cm-s-solarized.CodeMirror { + -moz-box-shadow: inset 7px 0 12px -6px #000; + -webkit-box-shadow: inset 7px 0 12px -6px #000; + box-shadow: inset 7px 0 12px -6px #000; +} + +/* Remove gutter border */ +.cm-s-solarized .CodeMirror-gutters { + border-right: 0; +} + +/* Gutter colors and line number styling based of color scheme (dark / light) */ + +/* Dark */ +.cm-s-solarized.cm-s-dark .CodeMirror-gutters { + background-color: #073642; +} + +.cm-s-solarized.cm-s-dark .CodeMirror-linenumber { + color: #586e75; + text-shadow: #021014 0 -1px; +} + +/* Light */ +.cm-s-solarized.cm-s-light .CodeMirror-gutters { + background-color: #eee8d5; +} + +.cm-s-solarized.cm-s-light .CodeMirror-linenumber { + color: #839496; +} + +/* Common */ +.cm-s-solarized .CodeMirror-linenumber { + padding: 0 5px; +} +.cm-s-solarized .CodeMirror-guttermarker-subtle { color: #586e75; } +.cm-s-solarized.cm-s-dark .CodeMirror-guttermarker { color: #ddd; } +.cm-s-solarized.cm-s-light .CodeMirror-guttermarker { color: #cb4b16; } + +.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text { + color: #586e75; +} + +/* Cursor */ +.cm-s-solarized .CodeMirror-cursor { border-left: 1px solid #819090; } + +/* Fat cursor */ +.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor { background: #77ee77; } +.cm-s-solarized.cm-s-light .cm-animate-fat-cursor { background-color: #77ee77; } +.cm-s-solarized.cm-s-dark.cm-fat-cursor .CodeMirror-cursor { background: #586e75; } +.cm-s-solarized.cm-s-dark .cm-animate-fat-cursor { background-color: #586e75; } + +/* Active line */ +.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background { + background: rgba(255, 255, 255, 0.06); +} +.cm-s-solarized.cm-s-light .CodeMirror-activeline-background { + background: rgba(0, 0, 0, 0.06); +} diff --git a/app/lib/codemirror/theme/the-matrix.css b/app/lib/codemirror/theme/the-matrix.css new file mode 100644 index 0000000..3912a8d --- /dev/null +++ b/app/lib/codemirror/theme/the-matrix.css @@ -0,0 +1,30 @@ +.cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; } +.cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D; } +.cm-s-the-matrix .CodeMirror-line::selection, .cm-s-the-matrix .CodeMirror-line > span::selection, .cm-s-the-matrix .CodeMirror-line > span > span::selection { background: rgba(45, 45, 45, 0.99); } +.cm-s-the-matrix .CodeMirror-line::-moz-selection, .cm-s-the-matrix .CodeMirror-line > span::-moz-selection, .cm-s-the-matrix .CodeMirror-line > span > span::-moz-selection { background: rgba(45, 45, 45, 0.99); } +.cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; } +.cm-s-the-matrix .CodeMirror-guttermarker { color: #0f0; } +.cm-s-the-matrix .CodeMirror-guttermarker-subtle { color: white; } +.cm-s-the-matrix .CodeMirror-linenumber { color: #FFFFFF; } +.cm-s-the-matrix .CodeMirror-cursor { border-left: 1px solid #00FF00; } + +.cm-s-the-matrix span.cm-keyword { color: #008803; font-weight: bold; } +.cm-s-the-matrix span.cm-atom { color: #3FF; } +.cm-s-the-matrix span.cm-number { color: #FFB94F; } +.cm-s-the-matrix span.cm-def { color: #99C; } +.cm-s-the-matrix span.cm-variable { color: #F6C; } +.cm-s-the-matrix span.cm-variable-2 { color: #C6F; } +.cm-s-the-matrix span.cm-variable-3 { color: #96F; } +.cm-s-the-matrix span.cm-property { color: #62FFA0; } +.cm-s-the-matrix span.cm-operator { color: #999; } +.cm-s-the-matrix span.cm-comment { color: #CCCCCC; } +.cm-s-the-matrix span.cm-string { color: #39C; } +.cm-s-the-matrix span.cm-meta { color: #C9F; } +.cm-s-the-matrix span.cm-qualifier { color: #FFF700; } +.cm-s-the-matrix span.cm-builtin { color: #30a; } +.cm-s-the-matrix span.cm-bracket { color: #cc7; } +.cm-s-the-matrix span.cm-tag { color: #FFBD40; } +.cm-s-the-matrix span.cm-attribute { color: #FFF700; } +.cm-s-the-matrix span.cm-error { color: #FF0000; } + +.cm-s-the-matrix .CodeMirror-activeline-background { background: #040; } diff --git a/app/lib/codemirror/theme/tomorrow-night-bright.css b/app/lib/codemirror/theme/tomorrow-night-bright.css new file mode 100644 index 0000000..b6dd4a9 --- /dev/null +++ b/app/lib/codemirror/theme/tomorrow-night-bright.css @@ -0,0 +1,35 @@ +/* + + Name: Tomorrow Night - Bright + Author: Chris Kempson + + Port done by Gerard Braad + +*/ + +.cm-s-tomorrow-night-bright.CodeMirror { background: #000000; color: #eaeaea; } +.cm-s-tomorrow-night-bright div.CodeMirror-selected { background: #424242; } +.cm-s-tomorrow-night-bright .CodeMirror-gutters { background: #000000; border-right: 0px; } +.cm-s-tomorrow-night-bright .CodeMirror-guttermarker { color: #e78c45; } +.cm-s-tomorrow-night-bright .CodeMirror-guttermarker-subtle { color: #777; } +.cm-s-tomorrow-night-bright .CodeMirror-linenumber { color: #424242; } +.cm-s-tomorrow-night-bright .CodeMirror-cursor { border-left: 1px solid #6A6A6A; } + +.cm-s-tomorrow-night-bright span.cm-comment { color: #d27b53; } +.cm-s-tomorrow-night-bright span.cm-atom { color: #a16a94; } +.cm-s-tomorrow-night-bright span.cm-number { color: #a16a94; } + +.cm-s-tomorrow-night-bright span.cm-property, .cm-s-tomorrow-night-bright span.cm-attribute { color: #99cc99; } +.cm-s-tomorrow-night-bright span.cm-keyword { color: #d54e53; } +.cm-s-tomorrow-night-bright span.cm-string { color: #e7c547; } + +.cm-s-tomorrow-night-bright span.cm-variable { color: #b9ca4a; } +.cm-s-tomorrow-night-bright span.cm-variable-2 { color: #7aa6da; } +.cm-s-tomorrow-night-bright span.cm-def { color: #e78c45; } +.cm-s-tomorrow-night-bright span.cm-bracket { color: #eaeaea; } +.cm-s-tomorrow-night-bright span.cm-tag { color: #d54e53; } +.cm-s-tomorrow-night-bright span.cm-link { color: #a16a94; } +.cm-s-tomorrow-night-bright span.cm-error { background: #d54e53; color: #6A6A6A; } + +.cm-s-tomorrow-night-bright .CodeMirror-activeline-background { background: #2a2a2a; } +.cm-s-tomorrow-night-bright .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } diff --git a/app/lib/codemirror/theme/tomorrow-night-eighties.css b/app/lib/codemirror/theme/tomorrow-night-eighties.css new file mode 100644 index 0000000..2a9debc --- /dev/null +++ b/app/lib/codemirror/theme/tomorrow-night-eighties.css @@ -0,0 +1,38 @@ +/* + + Name: Tomorrow Night - Eighties + Author: Chris Kempson + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +.cm-s-tomorrow-night-eighties.CodeMirror { background: #000000; color: #CCCCCC; } +.cm-s-tomorrow-night-eighties div.CodeMirror-selected { background: #2D2D2D; } +.cm-s-tomorrow-night-eighties .CodeMirror-line::selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span::selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span > span::selection { background: rgba(45, 45, 45, 0.99); } +.cm-s-tomorrow-night-eighties .CodeMirror-line::-moz-selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span::-moz-selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span > span::-moz-selection { background: rgba(45, 45, 45, 0.99); } +.cm-s-tomorrow-night-eighties .CodeMirror-gutters { background: #000000; border-right: 0px; } +.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker { color: #f2777a; } +.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle { color: #777; } +.cm-s-tomorrow-night-eighties .CodeMirror-linenumber { color: #515151; } +.cm-s-tomorrow-night-eighties .CodeMirror-cursor { border-left: 1px solid #6A6A6A; } + +.cm-s-tomorrow-night-eighties span.cm-comment { color: #d27b53; } +.cm-s-tomorrow-night-eighties span.cm-atom { color: #a16a94; } +.cm-s-tomorrow-night-eighties span.cm-number { color: #a16a94; } + +.cm-s-tomorrow-night-eighties span.cm-property, .cm-s-tomorrow-night-eighties span.cm-attribute { color: #99cc99; } +.cm-s-tomorrow-night-eighties span.cm-keyword { color: #f2777a; } +.cm-s-tomorrow-night-eighties span.cm-string { color: #ffcc66; } + +.cm-s-tomorrow-night-eighties span.cm-variable { color: #99cc99; } +.cm-s-tomorrow-night-eighties span.cm-variable-2 { color: #6699cc; } +.cm-s-tomorrow-night-eighties span.cm-def { color: #f99157; } +.cm-s-tomorrow-night-eighties span.cm-bracket { color: #CCCCCC; } +.cm-s-tomorrow-night-eighties span.cm-tag { color: #f2777a; } +.cm-s-tomorrow-night-eighties span.cm-link { color: #a16a94; } +.cm-s-tomorrow-night-eighties span.cm-error { background: #f2777a; color: #6A6A6A; } + +.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background { background: #343600; } +.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } diff --git a/app/lib/codemirror/theme/ttcn.css b/app/lib/codemirror/theme/ttcn.css new file mode 100644 index 0000000..b3d4656 --- /dev/null +++ b/app/lib/codemirror/theme/ttcn.css @@ -0,0 +1,64 @@ +.cm-s-ttcn .cm-quote { color: #090; } +.cm-s-ttcn .cm-negative { color: #d44; } +.cm-s-ttcn .cm-positive { color: #292; } +.cm-s-ttcn .cm-header, .cm-strong { font-weight: bold; } +.cm-s-ttcn .cm-em { font-style: italic; } +.cm-s-ttcn .cm-link { text-decoration: underline; } +.cm-s-ttcn .cm-strikethrough { text-decoration: line-through; } +.cm-s-ttcn .cm-header { color: #00f; font-weight: bold; } + +.cm-s-ttcn .cm-atom { color: #219; } +.cm-s-ttcn .cm-attribute { color: #00c; } +.cm-s-ttcn .cm-bracket { color: #997; } +.cm-s-ttcn .cm-comment { color: #333333; } +.cm-s-ttcn .cm-def { color: #00f; } +.cm-s-ttcn .cm-em { font-style: italic; } +.cm-s-ttcn .cm-error { color: #f00; } +.cm-s-ttcn .cm-hr { color: #999; } +.cm-s-ttcn .cm-invalidchar { color: #f00; } +.cm-s-ttcn .cm-keyword { font-weight:bold; } +.cm-s-ttcn .cm-link { color: #00c; text-decoration: underline; } +.cm-s-ttcn .cm-meta { color: #555; } +.cm-s-ttcn .cm-negative { color: #d44; } +.cm-s-ttcn .cm-positive { color: #292; } +.cm-s-ttcn .cm-qualifier { color: #555; } +.cm-s-ttcn .cm-strikethrough { text-decoration: line-through; } +.cm-s-ttcn .cm-string { color: #006400; } +.cm-s-ttcn .cm-string-2 { color: #f50; } +.cm-s-ttcn .cm-strong { font-weight: bold; } +.cm-s-ttcn .cm-tag { color: #170; } +.cm-s-ttcn .cm-variable { color: #8B2252; } +.cm-s-ttcn .cm-variable-2 { color: #05a; } +.cm-s-ttcn .cm-variable-3 { color: #085; } + +.cm-s-ttcn .cm-invalidchar { color: #f00; } + +/* ASN */ +.cm-s-ttcn .cm-accessTypes, +.cm-s-ttcn .cm-compareTypes { color: #27408B; } +.cm-s-ttcn .cm-cmipVerbs { color: #8B2252; } +.cm-s-ttcn .cm-modifier { color:#D2691E; } +.cm-s-ttcn .cm-status { color:#8B4545; } +.cm-s-ttcn .cm-storage { color:#A020F0; } +.cm-s-ttcn .cm-tags { color:#006400; } + +/* CFG */ +.cm-s-ttcn .cm-externalCommands { color: #8B4545; font-weight:bold; } +.cm-s-ttcn .cm-fileNCtrlMaskOptions, +.cm-s-ttcn .cm-sectionTitle { color: #2E8B57; font-weight:bold; } + +/* TTCN */ +.cm-s-ttcn .cm-booleanConsts, +.cm-s-ttcn .cm-otherConsts, +.cm-s-ttcn .cm-verdictConsts { color: #006400; } +.cm-s-ttcn .cm-configOps, +.cm-s-ttcn .cm-functionOps, +.cm-s-ttcn .cm-portOps, +.cm-s-ttcn .cm-sutOps, +.cm-s-ttcn .cm-timerOps, +.cm-s-ttcn .cm-verdictOps { color: #0000FF; } +.cm-s-ttcn .cm-preprocessor, +.cm-s-ttcn .cm-templateMatch, +.cm-s-ttcn .cm-ttcn3Macros { color: #27408B; } +.cm-s-ttcn .cm-types { color: #A52A2A; font-weight:bold; } +.cm-s-ttcn .cm-visibilityModifiers { font-weight:bold; } diff --git a/app/lib/codemirror/theme/twilight.css b/app/lib/codemirror/theme/twilight.css new file mode 100644 index 0000000..d342b89 --- /dev/null +++ b/app/lib/codemirror/theme/twilight.css @@ -0,0 +1,32 @@ +.cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/ +.cm-s-twilight div.CodeMirror-selected { background: #323232; } /**/ +.cm-s-twilight .CodeMirror-line::selection, .cm-s-twilight .CodeMirror-line > span::selection, .cm-s-twilight .CodeMirror-line > span > span::selection { background: rgba(50, 50, 50, 0.99); } +.cm-s-twilight .CodeMirror-line::-moz-selection, .cm-s-twilight .CodeMirror-line > span::-moz-selection, .cm-s-twilight .CodeMirror-line > span > span::-moz-selection { background: rgba(50, 50, 50, 0.99); } + +.cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; } +.cm-s-twilight .CodeMirror-guttermarker { color: white; } +.cm-s-twilight .CodeMirror-guttermarker-subtle { color: #aaa; } +.cm-s-twilight .CodeMirror-linenumber { color: #aaa; } +.cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white; } + +.cm-s-twilight .cm-keyword { color: #f9ee98; } /**/ +.cm-s-twilight .cm-atom { color: #FC0; } +.cm-s-twilight .cm-number { color: #ca7841; } /**/ +.cm-s-twilight .cm-def { color: #8DA6CE; } +.cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/ +.cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/ +.cm-s-twilight .cm-operator { color: #cda869; } /**/ +.cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/ +.cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/ +.cm-s-twilight .cm-string-2 { color:#bd6b18; } /*?*/ +.cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/ +.cm-s-twilight .cm-builtin { color: #cda869; } /*?*/ +.cm-s-twilight .cm-tag { color: #997643; } /**/ +.cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/ +.cm-s-twilight .cm-header { color: #FF6400; } +.cm-s-twilight .cm-hr { color: #AEAEAE; } +.cm-s-twilight .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } /**/ +.cm-s-twilight .cm-error { border-bottom: 1px solid red; } + +.cm-s-twilight .CodeMirror-activeline-background { background: #27282E; } +.cm-s-twilight .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; } diff --git a/app/lib/codemirror/theme/vibrant-ink.css b/app/lib/codemirror/theme/vibrant-ink.css new file mode 100644 index 0000000..ac4ec6d --- /dev/null +++ b/app/lib/codemirror/theme/vibrant-ink.css @@ -0,0 +1,34 @@ +/* Taken from the popular Visual Studio Vibrant Ink Schema */ + +.cm-s-vibrant-ink.CodeMirror { background: black; color: white; } +.cm-s-vibrant-ink div.CodeMirror-selected { background: #35493c; } +.cm-s-vibrant-ink .CodeMirror-line::selection, .cm-s-vibrant-ink .CodeMirror-line > span::selection, .cm-s-vibrant-ink .CodeMirror-line > span > span::selection { background: rgba(53, 73, 60, 0.99); } +.cm-s-vibrant-ink .CodeMirror-line::-moz-selection, .cm-s-vibrant-ink .CodeMirror-line > span::-moz-selection, .cm-s-vibrant-ink .CodeMirror-line > span > span::-moz-selection { background: rgba(53, 73, 60, 0.99); } + +.cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } +.cm-s-vibrant-ink .CodeMirror-guttermarker { color: white; } +.cm-s-vibrant-ink .CodeMirror-guttermarker-subtle { color: #d0d0d0; } +.cm-s-vibrant-ink .CodeMirror-linenumber { color: #d0d0d0; } +.cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white; } + +.cm-s-vibrant-ink .cm-keyword { color: #CC7832; } +.cm-s-vibrant-ink .cm-atom { color: #FC0; } +.cm-s-vibrant-ink .cm-number { color: #FFEE98; } +.cm-s-vibrant-ink .cm-def { color: #8DA6CE; } +.cm-s-vibrant-ink span.cm-variable-2, .cm-s-vibrant span.cm-tag { color: #FFC66D; } +.cm-s-vibrant-ink span.cm-variable-3, .cm-s-vibrant span.cm-def { color: #FFC66D; } +.cm-s-vibrant-ink .cm-operator { color: #888; } +.cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; } +.cm-s-vibrant-ink .cm-string { color: #A5C25C; } +.cm-s-vibrant-ink .cm-string-2 { color: red; } +.cm-s-vibrant-ink .cm-meta { color: #D8FA3C; } +.cm-s-vibrant-ink .cm-builtin { color: #8DA6CE; } +.cm-s-vibrant-ink .cm-tag { color: #8DA6CE; } +.cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; } +.cm-s-vibrant-ink .cm-header { color: #FF6400; } +.cm-s-vibrant-ink .cm-hr { color: #AEAEAE; } +.cm-s-vibrant-ink .cm-link { color: blue; } +.cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; } + +.cm-s-vibrant-ink .CodeMirror-activeline-background { background: #27282E; } +.cm-s-vibrant-ink .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; } diff --git a/app/lib/codemirror/theme/xq-dark.css b/app/lib/codemirror/theme/xq-dark.css new file mode 100644 index 0000000..e3bd960 --- /dev/null +++ b/app/lib/codemirror/theme/xq-dark.css @@ -0,0 +1,53 @@ +/* +Copyright (C) 2011 by MarkLogic Corporation +Author: Mike Brevoort + +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. +*/ +.cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; } +.cm-s-xq-dark div.CodeMirror-selected { background: #27007A; } +.cm-s-xq-dark .CodeMirror-line::selection, .cm-s-xq-dark .CodeMirror-line > span::selection, .cm-s-xq-dark .CodeMirror-line > span > span::selection { background: rgba(39, 0, 122, 0.99); } +.cm-s-xq-dark .CodeMirror-line::-moz-selection, .cm-s-xq-dark .CodeMirror-line > span::-moz-selection, .cm-s-xq-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(39, 0, 122, 0.99); } +.cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } +.cm-s-xq-dark .CodeMirror-guttermarker { color: #FFBD40; } +.cm-s-xq-dark .CodeMirror-guttermarker-subtle { color: #f8f8f8; } +.cm-s-xq-dark .CodeMirror-linenumber { color: #f8f8f8; } +.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white; } + +.cm-s-xq-dark span.cm-keyword { color: #FFBD40; } +.cm-s-xq-dark span.cm-atom { color: #6C8CD5; } +.cm-s-xq-dark span.cm-number { color: #164; } +.cm-s-xq-dark span.cm-def { color: #FFF; text-decoration:underline; } +.cm-s-xq-dark span.cm-variable { color: #FFF; } +.cm-s-xq-dark span.cm-variable-2 { color: #EEE; } +.cm-s-xq-dark span.cm-variable-3 { color: #DDD; } +.cm-s-xq-dark span.cm-property {} +.cm-s-xq-dark span.cm-operator {} +.cm-s-xq-dark span.cm-comment { color: gray; } +.cm-s-xq-dark span.cm-string { color: #9FEE00; } +.cm-s-xq-dark span.cm-meta { color: yellow; } +.cm-s-xq-dark span.cm-qualifier { color: #FFF700; } +.cm-s-xq-dark span.cm-builtin { color: #30a; } +.cm-s-xq-dark span.cm-bracket { color: #cc7; } +.cm-s-xq-dark span.cm-tag { color: #FFBD40; } +.cm-s-xq-dark span.cm-attribute { color: #FFF700; } +.cm-s-xq-dark span.cm-error { color: #f00; } + +.cm-s-xq-dark .CodeMirror-activeline-background { background: #27282E; } +.cm-s-xq-dark .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; } diff --git a/app/lib/codemirror/theme/xq-light.css b/app/lib/codemirror/theme/xq-light.css new file mode 100644 index 0000000..8d2fcb6 --- /dev/null +++ b/app/lib/codemirror/theme/xq-light.css @@ -0,0 +1,43 @@ +/* +Copyright (C) 2011 by MarkLogic Corporation +Author: Mike Brevoort + +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. +*/ +.cm-s-xq-light span.cm-keyword { line-height: 1em; font-weight: bold; color: #5A5CAD; } +.cm-s-xq-light span.cm-atom { color: #6C8CD5; } +.cm-s-xq-light span.cm-number { color: #164; } +.cm-s-xq-light span.cm-def { text-decoration:underline; } +.cm-s-xq-light span.cm-variable { color: black; } +.cm-s-xq-light span.cm-variable-2 { color:black; } +.cm-s-xq-light span.cm-variable-3 { color: black; } +.cm-s-xq-light span.cm-property {} +.cm-s-xq-light span.cm-operator {} +.cm-s-xq-light span.cm-comment { color: #0080FF; font-style: italic; } +.cm-s-xq-light span.cm-string { color: red; } +.cm-s-xq-light span.cm-meta { color: yellow; } +.cm-s-xq-light span.cm-qualifier { color: grey; } +.cm-s-xq-light span.cm-builtin { color: #7EA656; } +.cm-s-xq-light span.cm-bracket { color: #cc7; } +.cm-s-xq-light span.cm-tag { color: #3F7F7F; } +.cm-s-xq-light span.cm-attribute { color: #7F007F; } +.cm-s-xq-light span.cm-error { color: #f00; } + +.cm-s-xq-light .CodeMirror-activeline-background { background: #e8f2ff; } +.cm-s-xq-light .CodeMirror-matchingbracket { outline:1px solid grey;color:black !important;background:yellow; } diff --git a/app/lib/codemirror/theme/yeti.css b/app/lib/codemirror/theme/yeti.css new file mode 100644 index 0000000..c70d4d2 --- /dev/null +++ b/app/lib/codemirror/theme/yeti.css @@ -0,0 +1,44 @@ +/* + + Name: yeti + Author: Michael Kaminsky (http://github.com/mkaminsky11) + + Original yeti color scheme by Jesse Weed (https://github.com/jesseweed/yeti-syntax) + +*/ + + +.cm-s-yeti.CodeMirror { + background-color: #ECEAE8 !important; + color: #d1c9c0 !important; + border: none; +} + +.cm-s-yeti .CodeMirror-gutters { + color: #adaba6; + background-color: #E5E1DB; + border: none; +} +.cm-s-yeti .CodeMirror-cursor { border-left: solid thin #d1c9c0; } +.cm-s-yeti .CodeMirror-linenumber { color: #adaba6; } +.cm-s-yeti.CodeMirror-focused div.CodeMirror-selected { background: #DCD8D2; } +.cm-s-yeti .CodeMirror-line::selection, .cm-s-yeti .CodeMirror-line > span::selection, .cm-s-yeti .CodeMirror-line > span > span::selection { background: #DCD8D2; } +.cm-s-yeti .CodeMirror-line::-moz-selection, .cm-s-yeti .CodeMirror-line > span::-moz-selection, .cm-s-yeti .CodeMirror-line > span > span::-moz-selection { background: #DCD8D2; } +.cm-s-yeti span.cm-comment { color: #d4c8be; } +.cm-s-yeti span.cm-string, .cm-s-yeti span.cm-string-2 { color: #96c0d8; } +.cm-s-yeti span.cm-number { color: #a074c4; } +.cm-s-yeti span.cm-variable { color: #55b5db; } +.cm-s-yeti span.cm-variable-2 { color: #a074c4; } +.cm-s-yeti span.cm-def { color: #55b5db; } +.cm-s-yeti span.cm-operator { color: #9fb96e; } +.cm-s-yeti span.cm-keyword { color: #9fb96e; } +.cm-s-yeti span.cm-atom { color: #a074c4; } +.cm-s-yeti span.cm-meta { color: #96c0d8; } +.cm-s-yeti span.cm-tag { color: #96c0d8; } +.cm-s-yeti span.cm-attribute { color: #9fb96e; } +.cm-s-yeti span.cm-qualifier { color: #96c0d8; } +.cm-s-yeti span.cm-property { color: #a074c4; } +.cm-s-yeti span.cm-builtin { color: #a074c4; } +.cm-s-yeti span.cm-variable-3 { color: #96c0d8; } +.cm-s-yeti .CodeMirror-activeline-background { background: #E7E4E0; } +.cm-s-yeti .CodeMirror-matchingbracket { text-decoration: underline; } diff --git a/app/lib/codemirror/theme/zenburn.css b/app/lib/codemirror/theme/zenburn.css new file mode 100644 index 0000000..781c40a --- /dev/null +++ b/app/lib/codemirror/theme/zenburn.css @@ -0,0 +1,37 @@ +/** + * " + * Using Zenburn color palette from the Emacs Zenburn Theme + * https://github.com/bbatsov/zenburn-emacs/blob/master/zenburn-theme.el + * + * Also using parts of https://github.com/xavi/coderay-lighttable-theme + * " + * From: https://github.com/wisenomad/zenburn-lighttable-theme/blob/master/zenburn.css + */ + +.cm-s-zenburn .CodeMirror-gutters { background: #3f3f3f !important; } +.cm-s-zenburn .CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded { color: #999; } +.cm-s-zenburn .CodeMirror-cursor { border-left: 1px solid white; } +.cm-s-zenburn { background-color: #3f3f3f; color: #dcdccc; } +.cm-s-zenburn span.cm-builtin { color: #dcdccc; font-weight: bold; } +.cm-s-zenburn span.cm-comment { color: #7f9f7f; } +.cm-s-zenburn span.cm-keyword { color: #f0dfaf; font-weight: bold; } +.cm-s-zenburn span.cm-atom { color: #bfebbf; } +.cm-s-zenburn span.cm-def { color: #dcdccc; } +.cm-s-zenburn span.cm-variable { color: #dfaf8f; } +.cm-s-zenburn span.cm-variable-2 { color: #dcdccc; } +.cm-s-zenburn span.cm-string { color: #cc9393; } +.cm-s-zenburn span.cm-string-2 { color: #cc9393; } +.cm-s-zenburn span.cm-number { color: #dcdccc; } +.cm-s-zenburn span.cm-tag { color: #93e0e3; } +.cm-s-zenburn span.cm-property { color: #dfaf8f; } +.cm-s-zenburn span.cm-attribute { color: #dfaf8f; } +.cm-s-zenburn span.cm-qualifier { color: #7cb8bb; } +.cm-s-zenburn span.cm-meta { color: #f0dfaf; } +.cm-s-zenburn span.cm-header { color: #f0efd0; } +.cm-s-zenburn span.cm-operator { color: #f0efd0; } +.cm-s-zenburn span.CodeMirror-matchingbracket { box-sizing: border-box; background: transparent; border-bottom: 1px solid; } +.cm-s-zenburn span.CodeMirror-nonmatchingbracket { border-bottom: 1px solid; background: none; } +.cm-s-zenburn .CodeMirror-activeline { background: #000000; } +.cm-s-zenburn .CodeMirror-activeline-background { background: #000000; } +.cm-s-zenburn div.CodeMirror-selected { background: #545454; } +.cm-s-zenburn .CodeMirror-focused div.CodeMirror-selected { background: #4f4f4f; } diff --git a/app/lib/screenlog.js b/app/lib/screenlog.js new file mode 100644 index 0000000..160be63 --- /dev/null +++ b/app/lib/screenlog.js @@ -0,0 +1 @@ +var mainWindow=window.parent.onMessageFromConsole?window.parent:window.parent.opener;(function(){function a(a,b){var c=document.createElement(a);return c.style.cssText=b,c}function b(){var b=a('div','z-index:2147483647;font-family:Helvetica,Arial,sans-serif;font-size:10px;font-weight:bold;padding:5px;text-align:left;opacity:0.8;position:fixed;right:0;top:0;min-width:200px;max-height:50vh;overflow:auto;background:'+_options.bgColor+';'+_options.css);return b}function c(b){return function(){if(_options.proxyCallback&&_options.proxyCallback.apply(null,arguments),!_options.noUi){var c=a('div','line-height:18px;min-height:18px;background:'+(m.children.length%2?'rgba(255,255,255,0.1)':'')+';color:'+b),d=[].slice.call(arguments).reduce(function(a,b){return a+' '+('object'==typeof b?JSON.stringify(b):b)},'');c.textContent=d,m.appendChild(c),_options.autoScroll&&(m.scrollTop=m.scrollHeight-m.clientHeight)}}}function d(){return _options.noUi?void mainWindow.clearConsole():void(m.innerHTML='')}function e(){return c(_options.logColor).apply(null,arguments)}function f(){return c(_options.infoColor).apply(null,arguments)}function g(){return c(_options.warnColor).apply(null,arguments)}function h(){return c(_options.errorColor).apply(null,arguments)}function i(a){for(var b in a)a.hasOwnProperty(b)&&_options.hasOwnProperty(b)&&(_options[b]=a[b])}function j(){if(!n)throw'You need to call `screenLog.init()` first.'}function k(a){return function(){return j(),a.apply(this,arguments)}}function l(a,b){return function(){a.apply(this,arguments),'function'==typeof o[b]&&o[b].apply(console,arguments)}}var m,n=!1,o={};_options={bgColor:'black',logColor:'lightgreen',infoColor:'blue',warnColor:'orange',errorColor:'red',freeConsole:!1,css:'',autoScroll:!0,proxyCallback:null,noUi:!1},window.addEventListener('error',function(){c(_options.errorColor).call(null,arguments[0].error.stack)}),window.screenLog={init:function(a){n||(n=!0,a&&i(a),!_options.noUi&&(m=b(),document.body.appendChild(m)),!_options.freeConsole&&(o.log=console.log,o.clear=console.clear,o.info=console.info,o.warn=console.warn,o.error=console.error,console.log=l(e,'log'),console.clear=l(d,'clear'),console.info=l(f,'info'),console.warn=l(g,'warn'),console.error=l(h,'error')))},log:l(k(e),'log'),clear:l(k(d),'clear'),info:l(k(d),'info'),warn:l(k(g),'warn'),error:l(k(h),'error'),destroy:k(function(){n=!1,console.log=o.log,console.clear=o.clear,console.info=o.info,console.warn=o.warn,console.error=o.error,m.remove()})}})(),screenLog.init({noUi:!0,proxyCallback:function(){mainWindow.onMessageFromConsole.apply(null,arguments)}}),window._wmEvaluate=function(a){try{var b=eval(a)}catch(a){return void mainWindow.onMessageFromConsole.call(null,a)}mainWindow.onMessageFromConsole.call(null,b)}; \ No newline at end of file diff --git a/src/lib/atomizer.browser.js b/app/lib/transpilers/atomizer.browser.js similarity index 100% rename from src/lib/atomizer.browser.js rename to app/lib/transpilers/atomizer.browser.js diff --git a/src/lib/babel-polyfill.min.js b/app/lib/transpilers/babel-polyfill.min.js similarity index 100% rename from src/lib/babel-polyfill.min.js rename to app/lib/transpilers/babel-polyfill.min.js diff --git a/src/lib/babel.min.js b/app/lib/transpilers/babel.min.js similarity index 100% rename from src/lib/babel.min.js rename to app/lib/transpilers/babel.min.js diff --git a/src/lib/coffee-script.js b/app/lib/transpilers/coffee-script.js similarity index 100% rename from src/lib/coffee-script.js rename to app/lib/transpilers/coffee-script.js diff --git a/src/lib/jade.js b/app/lib/transpilers/jade.js similarity index 100% rename from src/lib/jade.js rename to app/lib/transpilers/jade.js diff --git a/src/lib/less.min.js b/app/lib/transpilers/less.min.js similarity index 100% rename from src/lib/less.min.js rename to app/lib/transpilers/less.min.js diff --git a/src/lib/marked.js b/app/lib/transpilers/marked.js similarity index 100% rename from src/lib/marked.js rename to app/lib/transpilers/marked.js diff --git a/src/lib/sass.js b/app/lib/transpilers/sass.js similarity index 100% rename from src/lib/sass.js rename to app/lib/transpilers/sass.js diff --git a/src/lib/sass.worker.js b/app/lib/transpilers/sass.worker.js similarity index 100% rename from src/lib/sass.worker.js rename to app/lib/transpilers/sass.worker.js diff --git a/src/lib/stylus.min.js b/app/lib/transpilers/stylus.min.js similarity index 100% rename from src/lib/stylus.min.js rename to app/lib/transpilers/stylus.min.js diff --git a/src/lib/typescript.js b/app/lib/transpilers/typescript.js similarity index 100% rename from src/lib/typescript.js rename to app/lib/transpilers/typescript.js diff --git a/app/partials/changelog.html b/app/partials/changelog.html new file mode 100644 index 0000000..cac2c37 --- /dev/null +++ b/app/partials/changelog.html @@ -0,0 +1,290 @@ + + + + + + +

Whats new?

+ +
+ 2.9.6 + +
+ +
+ 2.9.5 +
    +
  • Read blog post about this release.
  • +
  • Keyboard shortcuts panel: Add a list of all keyboard shotcuts. Access with Ctrl/⌘ + Shift + ? or click keyboard button in footer.
  • +
  • Add external library: Better UX for searching third party libraries.
  • +
  • Improvement: Code panes now go fullscreen when double-clicked on their headers - which is much more intuitive behavior based on feedback from lot of developers.
  • +
  • Improvement: Add allowfullscreen attribute on iframes. Thanks ClassicOldSong.
  • +
  • Bugfix - Stop screenlog.js from showing up in the exported HTML.
  • +
  • Popular external libraries list updated. Thanks jlapitan.
  • +
+
+ +
+ 2.9.4 +
    +
  • Improvement: Atomic CSS (Atomizer) has been updated to latest version. Now you can do things like psuedo elements. Learn More.
  • +
  • Bugfix - Logging circular objects is now possible. It won't show in the Web Maker console, but will show fine in browser's console.
  • +
  • Bugfix - Console's z-index issue has been fixed.
  • +
+
+ +
+ 2.9.3 +
    +
  • Choose the save location while exporting your saved creations. Now easily sync them to your Dropbox or any cloud storage.
  • +
  • All modals inside the app now have a close button.
  • +
  • Checkbox that showed on clicking a boolean value is now removed. Thanks Gaurav Nanda.
  • +
  • Bugfix - Screenshots on retina device are now correct. Thanks Ashish Bardhan.
  • +
  • Bugfix - Double console log in detached mode fixed.
  • +
  • Bugfix - Console.clear now works in detached mode too.
  • +
  • Bugfix - DOCTYPE added in preview.
  • +
  • Bugfix - Typo correction in README. Thanks Adil Mahmood.
  • +
  • gstatic.com is available to load external JavaScripts from.
  • +
  • Popular libraries list updated. Thanks diomed.
  • +
  • Added contribution guidelines in the Github repository.
  • +
+
+ +
+ 2.9.2 +
    +
  • Minor bug fixes.
  • +
+
+ + +
+ 2.9.1 + +
+ +
+ 2.9.0 +
    +
  • Read blog post about this release.
  • +
  • Detached Preview - Yes, you read that correct! You can now detach your preview and send it to your secondary monitor. +
  • +
  • Find & Replace - Long awaited, now its there. Ctrl/Cmd+f to find and add Alt to replace.
  • +
  • Atomic CSS (Atomizer) configurations - Add custom config for Atomic CSS. Read more.
  • +
  • Light mode - This new setting makes Web Maker drop some heavy effects like blur etc to gain more performance. Thanks Andrew.
  • +
  • Preserve logs setting - Choose whether or not to preserve logs across preview refreshes. Thanks Basit.
  • +
  • Line wrap setting - As the name says.
  • +
  • Semantic UI added to popular libraries.
  • +
  • Bootstrap, Vue, UI-Kit and more updated to latest versions in popular libraries.
  • +
  • UX improvements in settings UI
  • + +
  • Bugfix - Trigger preview refresh anytime with Ctrl/⌘ + Shift + 5. Even with auto-preview on.
  • +
+
+ +
+ 2.8.1 +
    +
  • Vue.js & UIKit version updated to latest version in 'Add Library' list.
  • +
  • UTF-8 charset added to preview HTML to support universal characters.
  • +
+
+ +
+ 2.8.0 +
    +
  • Read blog post about this release.
  • +
  • Auto Save - Your creations now auto-save after your + first manual save. This is configurable from settings. +
  • +
  • Base2Tone-Meadow Editor Theme - First user contributed theme. + Thanks to Diomed.
  • +
  • Use System Fonts - You can now use any of your existing + system fonts in the editor!
  • +
  • Matching Tag Highlight - Cursor over any HTML tag would + highlight the matching pair tag.
  • +
  • Auto-completion suggestion can now be switched off from settings.
  • +
  • Improvement - Stop white flicker in editor when the app + opens.
  • +
  • Bugfix - Add Babel Polyfill to enable use of next-gen + built-ins like Promise or WeakMap. +
  • +
  • Vue.js version updated to 2.4.0 in popular library list.
  • +
  • Downloads permission is optional. Asked only when you take screenshot.
  • +
+
+ +
+ 2.7.2 +
    +
  • External Libraries - Add Foundation.js and update UIKit 3 to latest beta.
  • +
  • rawgit.com & wzrd.in domains are now allowed for loading external libraries from.
  • +
  • Minor booting speed improvements
  • +
+
+ +
+ 2.7.1 +
    +
  • Framer.js support - You can now load the latest framer.js library from framer builds page and start coding framer prototypes.
  • +
  • Bugfix: Edit on CodePen is back in action.
  • +
  • Bugfix: Autocompletion menu doesn't show on cut and paste now.
  • +
  • Bugfix: Updated & fixed urls of some common external libraries to latest versions. UIKit3 & Bootstrap 4α are now in the list.
  • +
  • Preprocessor selector are now more accessible.
  • +
+
+ +
+ 2.7.0 +
    +
  • Fork any creation!: Now you can fork any existing creation of yours to start a new work based on it. One big use case of this feature is "Templates"! Read more about it.
  • +
  • Fonts 😍 : Super-awesome 4 fonts (mostly with ligature support) now available to choose from. Fira Code is the default font now.
  • +
  • Updated most used external libraries to latest versions.
  • +
  • Bugfix: Add missing Bootstrap JS file to most used external libraries list.
  • +
  • Several other minor bugfixes and improvements to make Web Maker awesome!
  • + +
  • Great news to share with you - Web Maker has been featured on the Chrome Webstore homepage! Thanks for all the love :)
  • +
+
+ +
+ 2.6.1 +
    +
  • Bugfix: Emojis vanishing while exporting to Codepen has been fixed.
  • +
  • Bugfix: console.clear() now doesn't error and clears the inbuilt console.
  • +
  • Bugfix: External libraries added to the creation are exported as well to Codepen.
  • +
+
+ +
+ 2.6.0 +
    +
  • The "Console": The most awaited feature is here! There is now an inbuilt console to see your logs, errors and for quickly evaluating JavaScript code inside your preview. Enjoy! I also a blog post about it.
  • +
  • Number slider which popped on clicking any number in the code has been removed due to poor user experience.
  • +
  • Minor usability improvements.
  • +
+
+ +
+ 2.5.0 +
    +
  • Atomic CSS: Use can now use Atomic CSS(ACSS) in your work! Read more about it here.
  • +
  • Search your saved creations: Easily search through all your saved creations by title.
  • +
  • Configurable Auto-preview - You can turn off the auto preview in settings if you don't want the preview to update as you type.
  • +
  • Configurable refresh on resize - You can configure whether you want the preview to refresh when you resize the preview panel.
  • +
  • Bugfix - Fix indentation issue with custom indentation size.
  • +
+
+ +
+ 2.4.2 +
    +
  • Improved infinite loop protection: Infinite loop protection is now faster and more reliable. And works without the need of Escodegen. Thanks to Ariya Hidayat!
  • +
  • Bugfix - Default parameters not working in JavaScript is fixed.
  • +
+
+ +
+ 2.4.0 +
    +
  • Import/Export: Your creations are most important. Now export all your creations into a single file as a backup that can be imported anytime & anywhere.
  • +
  • Editor themes: You have been heard. Now you can choose from a huge list of wonderful editor themes!
  • +
  • Identation settings: Not a spaces fan? Switch to tabs and set your indentation size.
  • +
  • Vim key bindings: Rejoice Vim lovers!
  • +
  • Code blast: Why don't you try coding with this switched on from the settings? Go on...
  • +
  • Important: Due to security policy changes from Chrome 57 onwards, Web Maker now allows loading external JavaScript libraries only from certain whitelisted domains (localhost, https://ajax.googleapis.com, https://code.jquery.com, https://cdnjs.cloudflare.com, + https://unpkg.com, https://maxcdn.com, https://cdn77.com, https://maxcdn.bootstrapcdn.com, https://cdn.jsdelivr.net/)
  • +
  • Save button now highlights when you have unsaved changes.
  • +
  • Jade is now called Pug. Just a name change.
  • +
+
+ +
+ 2.3.2 +
    +
  • Update Babel to support latest and coolest ES6 features.
  • +
  • Improve onboarding experience at first install.
  • +
+
+
+ 2.3.1 +
    +
  • Bugfix - Splitting of code and preview panes is remembered by the editor.
  • +
  • Title of the creation is used for the file name when saving as HTML.
  • +
+
+
+ 2.3.0 +
    +
  • Add Library Autocompletion - Just start typing the name of library and you'll be shown matching libraries from cdnjs.
  • +
  • Preview Screenshot Capture - Want to grab a nice screenshot of your creation. You have it! Click and capture.
  • +
  • Auto Indent Code - Select your code and hit Shift-Tab to auto-indent it!
  • +
  • Keyboard Navigation in Saved List - Now select your creation using arrow keys and hit ENTER to open it.
  • +
  • Highlight active line in code panes.
  • +
  • Bugfix - Fix in generated title of new creation.
  • +
  • Bugfix - HTML autocompletion is manual triggered now with Ctrl+Space.
  • +
+
+ +
+ 2.2.0 +
    +
  • Code Autocompletion - See code suggestions while you type!
  • +
  • Full Screen Preview - Checkout your creation in a full-screen layout.
  • +
  • SASS - SASS support added for CSS.
  • +
  • Faster CSS update - Preview updates instantly without refresh when just CSS is changed.
  • +
  • Bugfix - Indentation fixed while going on new line.
  • +
  • Bugfix - Works even in Chrome Canary now. Though libraries can be added only through CDNs.
  • +
+
+ +
+ 2.1.0 +
    +
  • TypeScript - Now you can code in TypeScript too!
  • +
  • Stylus Preprocessor - Stylus supported adding for CSS.
  • +
  • Code Folding - Collapse large code blocks for easy editing.
  • +
  • Bugfix - Support JSX in JavaScript.
  • +
  • Better onboarding for first time users.
  • +
+
+
+ 2.0.0 +
    +
  • Save and Load - Long pending and super-useful, now you can save your creations and resume them anytime later.
  • +
  • Insert JS & CSS - Load popular JavaScript & CSS libraries in your work without writing any code.
  • +
  • Collapsed Panes - Collapse/uncollapse code panes with a single click. Your pane configuration is even saved with every creation!
  • +
  • Quick color & number change - Click on any color or number and experiment with quick values using a slider.
  • +
  • Linting - See your code errors right where you are coding.
  • +
  • No more browser hang due to infinite loops!
  • + +
+
+
+ 1.7.0 +
    +
  • Preprocessors! - Enjoy a whole list of preprocessors for HTML(Jade & markdown), CSS(SCSS & LESS) and JavaScript(CoffeeScript & Babel).
  • +
  • More awesome font for code.
  • +
+
+
+ 1.6.0 +
    +
  • You can now configure Web-Maker to not replace new tab page from the settings. It is always accessible from the icon in the top-right.
  • +
  • Download current code as HTML file with Ctrl/⌘ + S keyboard shortcut.
  • +
  • New notifications panel added so you are always aware of the new changes in Web-Maker.
  • +
+
diff --git a/app/partials/help-modal.html b/app/partials/help-modal.html new file mode 100644 index 0000000..0439b68 --- /dev/null +++ b/app/partials/help-modal.html @@ -0,0 +1,37 @@ + + + + + + +

Web Maker
v2.9.6

+ +
+

Made with 💖 & 🙌 by Kushagra Gour

+

Tweet out your feature requests, comments & suggestions to @webmakerApp.

+

Like this extension? Please rate it here.

+

+ Show some love + Chat + Report a bug + Support the developer +

+ +

+

Awesome libraries used

+ +

+ +

+

License

+ "Web Maker" is open-source under the MIT License. +

+
\ No newline at end of file diff --git a/app/partials/keyboard-shortcuts.html b/app/partials/keyboard-shortcuts.html new file mode 100644 index 0000000..b94cc08 --- /dev/null +++ b/app/partials/keyboard-shortcuts.html @@ -0,0 +1,106 @@ + + + + + + +

Keyboard Shortcuts

+ +
+
+

Global

+

+ + Ctrl/⌘ + Shift + ? + + See keyboard shortcuts +

+

+ + Ctrl/⌘ + Shift + 5 + + Refresh preview +

+

+ + Ctrl/⌘ + S + + Save current creations +

+

+ + Ctrl/⌘ + O + + Open list of saved creations +

+

+ + Ctrl + L + + Clear console (works when console input is focused) +

+

+ + Esc + + Close saved creations panel & modals +

+
+
+

Editor

+

+ + Ctrl/⌘ + F + + Find +

+

+ + Ctrl/⌘ + G + + Select next match +

+

+ + Ctrl/⌘ + Shift + G + + Select previous match +

+

+ + Ctrl/⌘ + Opt/Alt + F + + Find & replace +

+

+ + Shift + Tab + + Realign code +

+

+ + Ctrl/⌘ + ] + + Indent code right +

+

+ + Ctrl/⌘ + [ + + Indent code left +

+

+ + Tab + + Emmet code completion Read more +

+

+ + Ctrl/⌘ + / + + Single line comment +

+
+
\ No newline at end of file diff --git a/app/partials/login-modal.html b/app/partials/login-modal.html new file mode 100644 index 0000000..43b7809 --- /dev/null +++ b/app/partials/login-modal.html @@ -0,0 +1,28 @@ + + + + + + +

Login / Signup

+ +
+

+ +

+

+ +

+

+ +

+

+ Join a community of 50,000+ Developers +

+
\ No newline at end of file diff --git a/app/partials/onboard-modal.html b/app/partials/onboard-modal.html new file mode 100644 index 0000000..c1e9594 --- /dev/null +++ b/app/partials/onboard-modal.html @@ -0,0 +1,53 @@ +
+ + + +

Welcome to Web Maker

+
+ +
+
+
+ + + +
+

+ Open Web Maker anytime by clicking the + + + button in top-right side of your browser. +

+
+
+
+ + + +
+

+ Configure and customize settings by clicking the gear icon ( + + + ) in bottom right of the app. +

+
+
+
+ + + +
+

+ Follow @webmakerApp to know about the new upcoming + features! +

+
+
+ + +

+ +

\ No newline at end of file diff --git a/app/script.js b/app/script.js new file mode 100644 index 0000000..72157a3 --- /dev/null +++ b/app/script.js @@ -0,0 +1 @@ +'serviceWorker'in navigator&&window.addEventListener('load',function(){navigator.serviceWorker.register('service-worker.js').then(function(e){e.onupdatefound=function(){var t=e.installing;t.onstatechange=function(){switch(t.state){case'installed':navigator.serviceWorker.controller?console.log('New or updated content is available.'):console.log('Content is now available offline!');break;case'redundant':console.error('The installing service worker became redundant.');}}}}).catch(function(t){console.error('Error during service worker registration:',t)})}),function(){window.DEBUG=-1[...document.querySelectorAll(e)];var e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';Node.prototype.nextUntil=function(e){const t=[...this.parentNode.querySelectorAll(e)],s=t.indexOf(this);return t[s+1]},Node.prototype.previousUntil=function(e){const t=[...this.parentNode.querySelectorAll(e)],s=t.indexOf(this);return t[s-1]},window.utils={semverCompare:function(e,t){for(var s=e.split('.'),o=t.split('.'),a=0;3>a;a++){var i=+s[a],n=+o[a];if(i>n)return 1;if(n>i)return-1;if(!isNaN(i)&&isNaN(n))return 1;if(isNaN(i)&&!isNaN(n))return-1}return 0},generateRandomId:function(t){for(var s='',o=t||10;o--;)s+=e[~~(Math.random()*e.length)];return s},onButtonClick:function(e,t){e.addEventListener('click',function(s){return t(s),!1})},addInfiniteLoopProtection:function(e){var t=1,s=[],i='_wmloopvar';return esprima.parse(e,{tolerant:!0,range:!0,jsx:!0},function(e){switch(e.type){case'DoWhileStatement':case'ForStatement':case'ForInStatement':case'ForOfStatement':case'WhileStatement':var o=1+e.body.range[0],a=e.body.range[1],n='\nif (Date.now() - %d > 1000) { window.top.previewException(new Error("Infinite loop")); break;}\n'.replace('%d',i+t),l='';'BlockStatement'!==e.body.type&&(n='{'+n,l='}',--o),s.push({pos:o,str:n}),s.push({pos:a,str:l}),s.push({pos:e.range[0],str:'var %d = Date.now();\n'.replace('%d',i+t)}),++t;break;default:}}),s.sort(function(e,t){return t.pos-e.pos}).forEach(function(t){e=e.slice(0,t.pos)+t.str+e.slice(t.pos)}),e},getHumanDate:function(e){var t=new Date(e),s=t.getDate()+' '+['January','February','March','April','May','June','July','August','September','October','November','December'][t.getMonth()]+' '+t.getFullYear();return s},log:function(){window.DEBUG&&console.log(...arguments)},once:function(e,t,s){e.addEventListener(t,function(i){return i.target.removeEventListener(t,arguments.callee),s(i)})},downloadFile:function(e,t){function s(){var s=document.createElement('a');s.href=window.URL.createObjectURL(t),s.download=e,s.style.display='none',document.body.appendChild(s),s.click(),s.remove()}window.IS_EXTENSION?chrome.downloads.download({url:window.URL.createObjectURL(t),filename:e,saveAs:!0},()=>{chrome.runtime.lastError&&s()}):s()}},window.chrome=window.chrome||{},window.chrome.i18n={getMessage:()=>{}},window.IS_EXTENSION=!!window.chrome.extension,window.IS_EXTENSION?document.body.classList.add('is-extension'):document.body.classList.add('is-app')}(),(()=>{async function e(){return i?i:(utils.log('Initializing firestore'),i=new Promise((e,t)=>s?e(s):firebase.firestore().enablePersistence().then(function(){s=firebase.firestore(),utils.log('firebase db ready',s),e(s)}).catch(function(e){t(e.code),'failed-precondition'!==e.code&&'unimplemented'!==e.code})),i)}const t=1;var s,i,o={get:(e,s)=>{const i={};'string'==typeof e?(i[e]=JSON.parse(window.localStorage.getItem(e)),setTimeout(()=>s(i),t)):(Object.keys(e).forEach((t)=>{const s=window.localStorage.getItem(t);i[t]=s===void 0||null===s?e[t]:JSON.parse(s)}),setTimeout(()=>s(i),t))},set:(e,s)=>{Object.keys(e).forEach((t)=>{window.localStorage.setItem(t,JSON.stringify(e[t]))}),setTimeout(()=>{if(s)return s()},t)}};const a=chrome&&chrome.storage?chrome.storage.local:o,n=chrome&&chrome.storage?chrome.storage.sync:o;window.db={getDb:e,getUser:async function(t){const s=await e();return s.doc(`users/${t}`).get().then((e)=>{if(!e.exists)return s.doc(`users/${t}`).set({},{merge:!0});const i=e.data();return Object.assign(window.user,i),i})},getUserLastSeenVersion:async function(){const e=deferred();return n.get({lastSeenVersion:''},(t)=>{e.resolve(t.lastSeenVersion)}),e.promise},setUserLastSeenVersion:async function(t){if(window.IS_EXTENSION)return void chrome.storage.sync.set({lastSeenVersion:t},function(){});if(o.set({lastSeenVersion:t}),window.user){const s=await e();s.doc(`users/${window.user.uid}`).update({lastSeenVersion:t})}},getSettings:function(e){const t=deferred();return n.get(e,(e)=>{t.resolve(e)}),t.promise},local:a,sync:n}})(),window.logout=function(){firebase.auth().signOut()};function login(e){var t;return'facebook'===e?t=new firebase.auth.FacebookAuthProvider:'twitter'===e?t=new firebase.auth.TwitterAuthProvider:'google'===e?(t=new firebase.auth.GoogleAuthProvider,t.addScope('https://www.googleapis.com/auth/userinfo.profile')):t=new firebase.auth.GithubAuthProvider,firebase.auth().signInWithPopup(t).then(function(){}).catch(function(e){alert('You have already signed up with the same email using different social login'),utils.log(e)})}window.login=login,window.trackEvent=function(e,t,s,i){return window.DEBUG?void utils.log('trackevent',e,t,s,i):void(window.ga&&ga('send','event',e,t,s,i))},navigator.onLine&&!window.DEBUG&&setTimeout(function(){(function(e,t,s,i,o,n,a){e.GoogleAnalyticsObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,n=t.createElement(s),a=t.getElementsByTagName(s)[0],n.async=1,n.src=i,a.parentNode.insertBefore(n,a)})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'),ga('create','UA-87786708-1',{cookieDomain:'none'}),ga('set','checkProtocolTask',function(){}),ga('send','pageview')},100),function(){window.deferred=function(){var e={},t=new Promise(function(t,s){e.resolve=t,e.reject=s});return e.promise=t,Object.assign(e,t)}}(),function(e){window.loadJS=function(t){var s=deferred(),i=e.document.getElementsByTagName('script')[0],o=e.document.createElement('script');return o.src=t,o.async=!0,i.parentNode.insertBefore(o,i),o.onload=function(){s.resolve()},s.promise}}(window),function(){const e=$('#js-alerts-container');var t;window.alertsService={add:function(s){e.textContent=s,e.classList.add('is-active'),clearTimeout(t),t=setTimeout(function(){e.classList.remove('is-active')},2e3)}}}(),window.jsLibs=[{url:'https://code.jquery.com/jquery-3.2.1.min.js',label:'jQuery',type:'js'},{url:'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js',label:'Bootstrap 3',type:'js'},{url:'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js',label:'Bootstrap 4\u03B2',type:'js'},{url:'https://cdnjs.cloudflare.com/ajax/libs/foundation/6.4.3/js/foundation.min.js',label:'Foundation',type:'js'},{url:'https://semantic-ui.com/dist/semantic.min.js',label:'Semantic UI',type:'js'},{url:'https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js',label:'Angular',type:'js'},{url:'https://cdnjs.cloudflare.com/ajax/libs/react/16.2.0/cjs/react.production.min.js',label:'React',type:'js'},{url:'https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react-dom.min.js',label:'React DOM',type:'js'},{url:'https://unpkg.com/vue@2.5.0/dist/vue.min.js',label:'Vue.js',type:'js'},{url:'https://cdnjs.cloudflare.com/ajax/libs/three.js/85/three.min.js',label:'Three.js',type:'js'},{url:'https://cdnjs.cloudflare.com/ajax/libs/d3/4.10.2/d3.min.js',label:'D3',type:'js'},{url:'https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js',label:'Underscore',type:'js'},{url:'https://cdnjs.cloudflare.com/ajax/libs/gsap/1.20.3/TweenMax.min.js',label:'Greensock TweenMax',type:'js'},{url:'https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.4/js/uikit.min.js',label:'UIkit 2',type:'js'},{url:'https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.31/js/uikit.min.js',label:'UIkit 3',type:'js'}],window.cssLibs=[{url:'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css',label:'Bootstrap 3',type:'css'},{url:'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css',label:'Bootstrap 4\u03B2',type:'css'},{url:'https://cdnjs.cloudflare.com/ajax/libs/foundation/6.4.3/css/foundation.min.css',label:'Foundation',type:'css'},{url:'https://semantic-ui.com/dist/semantic.min.css',label:'Semantic UI',type:'css'},{url:'https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.0/css/bulma.min.css',label:'Bulma',type:'css'},{url:'https://cdnjs.cloudflare.com/ajax/libs/hint.css/2.5.0/hint.min.css',label:'Hint.css',type:'css'},{url:'https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.4/css/uikit.min.css',label:'UIkit 2',type:'css'},{url:'https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.31/css/uikit.min.css',label:'UIkit 3',type:'css'},{url:'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css',label:'Animate.css',type:'css'},{url:'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css',label:'FontAwesome',type:'css'}],function(){class e{constructor(e,t){this.t=e,this.filter=t.filter,this.selectedCallback=t.selectedCallback;var s=document.createElement('div');s.classList.add('btn-group'),e.parentElement.insertBefore(s,e),s.insertBefore(e,null),this.list=document.createElement('ul'),this.list.classList.add('dropdown__menu'),this.list.classList.add('autocomplete-dropdown'),s.insertBefore(this.list,null),this.loader=document.createElement('div'),this.loader.classList.add('loader'),this.loader.classList.add('autocomplete__loader'),this.loader.style.display='none',s.insertBefore(this.loader,null),setTimeout(()=>{requestIdleCallback(()=>{document.body.appendChild(this.list),this.list.style.position='fixed'})},100),this.t.addEventListener('input',(t)=>this.onInput(t)),this.t.addEventListener('keydown',(t)=>this.onKeyDown(t)),this.t.addEventListener('blur',(t)=>this.closeSuggestions(t)),this.list.addEventListener('mousedown',(t)=>this.onListMouseDown(t))}get currentLineNumber(){return this.t.value.substr(0,this.t.selectionStart).split('\n').length}get currentLine(){var e=this.currentLineNumber;return this.t.value.split('\n')[e-1]}closeSuggestions(){this.list.classList.remove('is-open'),this.isShowingSuggestions=!1}getList(e){return fetch('https://api.cdnjs.com/libraries?search='+e).then((e)=>e.json().then((e)=>e.results))}replaceCurrentLine(e){var t=this.t.value.split('\n');t.splice(this.currentLineNumber-1,1,e),this.t.value=t.join('\n')}onInput(){var e=this.currentLine;if(e){if(-1!==e.indexOf('/')||e.match(/https*:\/\//))return;clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.loader.style.display='block',this.getList(e).then((e)=>{if(this.loader.style.display='none',!e.length)return void this.closeSuggestions();this.list.innerHTML='',this.filter&&(e=e.filter(this.filter));for(var t=0;t${e[t].name}`;this.isShowingSuggestions=!0,this.textareaBounds||(this.textareaBounds=this.t.getBoundingClientRect(),this.list.style.top=this.textareaBounds.bottom+'px',this.list.style.left=this.textareaBounds.left+'px',this.list.style.width=this.textareaBounds.width+'px'),this.list.classList.add('is-open')})},500)}}onKeyDown(e){var t;this.isShowingSuggestions&&(27===e.keyCode&&(this.closeSuggestions(),e.stopPropagation()),40===e.keyCode&&this.isShowingSuggestions?(t=this.list.querySelector('.selected'),t?(t.classList.remove('selected'),t.nextElementSibling.classList.add('selected')):this.list.querySelector('li:first-child').classList.add('selected'),this.list.querySelector('.selected').scrollIntoView(!1),e.preventDefault()):38===e.keyCode&&this.isShowingSuggestions?(t=this.list.querySelector('.selected'),t?(t.classList.remove('selected'),t.previousElementSibling.classList.add('selected')):this.list.querySelector('li:first-child').classList.add('selected'),this.list.querySelector('.selected').scrollIntoView(!1),e.preventDefault()):13===e.keyCode&&this.isShowingSuggestions&&(t=this.list.querySelector('.selected'),this.selectSuggestion(t.dataset.url),this.closeSuggestions()))}onListMouseDown(e){var t=e.target;t.parentElement.dataset.url&&this.selectSuggestion(t.parentElement.dataset.url)}selectSuggestion(e){this.selectedCallback?this.selectedCallback.call(null,e):this.replaceCurrentLine(e),this.closeSuggestions()}}window.TextareaAutoComplete=e}(),(()=>{window.itemService={async getItem(e){var t=await window.db.getDb();return t.doc(`items/${e}`).get().then((e)=>e.data())},async getUserItemIds(){if(window.user)return new Promise((e)=>{e(window.user.items||{})});var e=await window.db.getDb();return e.doc(`users/${window.user.uid}`).get().then((e)=>e.exists?e.data().items:{})},async getAllItems(){var e=deferred();let t=await this.getUserItemIds();t=Object.getOwnPropertyNames(t||{}),utils.log('itemids',t),t.length||e.resolve([]);const s=[];for(let o=0;o{s.push(i),t.length===s.length&&e.resolve(s)})}return e.promise},async setUser(){const e=await window.db.getDb();return e.doc(`users/${window.user.uid}`).set({items:{}})},async setItem(e,t){if(!window.user)return new Promise((e)=>e());var s=await window.db.getDb();return utils.log(`Starting to save item ${e}`),t.createdBy=window.user.uid,s.collection('items').doc(e).set(t,{merge:!0}).then((e)=>{utils.log('Document written',e)}).catch((e)=>utils.log(e))},saveItems(e){var t=deferred();return window.IS_EXTENSION?(window.db.local.set(e,t.resolve),window.db.local.get({items:{}},function(t){for(var s in e)t.items[s]=!0;window.db.local.set({items:t.items})})):window.db.getDb().then((s)=>{const i=s.batch();for(var o in e)e[o].createdBy=window.user.uid,i.set(s.doc(`items/${o}`),e[o]),i.update(s.doc(`users/${window.user.uid}`),{[`items.${o}`]:!0}),window.user.items[o]=!0;i.commit().then(t.resolve)}),t.promise},async removeItem(e){if(window.IS_EXTENSION){var t=deferred();return db.local.remove(e,t.resolve),t.promise}const s=await window.db.getDb();return utils.log(`Starting to save item ${e}`),s.collection('items').doc(e).delete().then((e)=>{utils.log('Document removed',e)}).catch((e)=>utils.log(e))},async setItemForUser(e){if(window.IS_EXTENSION||!window.user)return window.db.local.get({items:{}},function(t){t.items[e]=!0,window.db.local.set({items:t.items})});const t=await window.db.getDb();return t.collection('users').doc(window.user.uid).update({[`items.${e}`]:!0}).then((t)=>{utils.log(`Item ${e} set for user`,t),window.user.items=window.user.items||{},window.user.items[e]=!0}).catch((e)=>utils.log(e))},async unsetItemForUser(e){if(window.IS_EXTENSION)return window.db.local.get({items:{}},function(t){delete t.items[e],db.local.set({items:t.items})});const t=await window.db.getDb();return t.collection('users').doc(window.user.uid).update({[`items.${e}`]:firebase.firestore.FieldValue.delete()}).then((t)=>{utils.log(`Item ${e} unset for user`,t)}).catch((e)=>utils.log(e))}}})(),function(e,t){function s(){clearTimeout(s.timeout),s.timeout=setTimeout(function(){const e=2===oe?'width':'height';[we,Ee,xe].forEach(function(t){const s=t.getBoundingClientRect(),i=s[e];100>i?t.classList.add('is-minimized'):t.classList.remove('is-minimized'),-1===t.style[e].indexOf(`100% - ${2*Se}px`)?t.classList.remove('is-maximized'):t.classList.add('is-maximized')})},50)}function i(e){if(e.classList.contains('is-minimized')||e.classList.contains('is-maximized'))e.classList.remove('is-minimized'),e.classList.remove('is-maximized'),ce.setSizes([33.3,33.3,33.3]);else{const s=parseInt(e.dataset.codeWrapId,10);var t=[`${Se}px`,`${Se}px`,`${Se}px`];t[s]=`calc(100% - ${2*Se}px)`,ce.setSizes(t),e.classList.add('is-maximized')}}function o(){var e;return e=ne&&ne.mainSizes?3===oe?[ne.mainSizes[1],ne.mainSizes[0]]:ne.mainSizes:[50,50],e}function a(){ce&&ce.destroy(),de&&de.destroy();var e={direction:2===oe?'horizontal':'vertical',minSize:Se,gutterSize:6,onDragStart:function(){document.body.classList.add('is-dragging')},onDragEnd:function(){s(),document.body.classList.remove('is-dragging')}};e.sizes=ne&&ne.sizes?ne.sizes:[33.33,33.33,33.33],ce=Split(['#js-html-code','#js-css-code','#js-js-code'],e),de=Split(['#js-code-side','#js-demo-side'],{direction:2===oe?'vertical':'horizontal',minSize:150,gutterSize:6,sizes:o(),onDragEnd:function(){ye.refreshOnResize&&setTimeout(function(){Y.setPreviewContent(!0)},1)}})}function n(e){return oe===e?(de.setSizes(o()),ce.setSizes(ne.sizes||[33.33,33.33,33.33]),void(oe=e)):void(oe=e,layoutBtn1.classList.remove('selected'),layoutBtn2.classList.remove('selected'),layoutBtn3.classList.remove('selected'),layoutBtn4.classList.remove('selected'),$('#layoutBtn'+e).classList.add('selected'),document.body.classList.remove('layout-1'),document.body.classList.remove('layout-2'),document.body.classList.remove('layout-3'),document.body.classList.remove('layout-4'),document.body.classList.add('layout-'+e),a(),Y.setPreviewContent(!0))}function l(){utils.log('onExternalLibChange'),r(),Y.setPreviewContent(!0),e.add('Libraries updated.')}function r(){var e=0;e+=Ne.value.split('\n').filter((e)=>!!e).length,e+=ze.value.split('\n').filter((e)=>!!e).length,e?($('#js-external-lib-count').textContent=e,$('#js-external-lib-count').style.display='inline'):$('#js-external-lib-count').style.display='none'}function d(e,t){const s=deferred();return db.local.set({[e]:t},s.resolve),s.promise}function c(){var s=!ne.id;ne.id=ne.id||'item-'+utils.generateRandomId(),g().then(()=>{!ue&&ye.autoSave&&(ue=!0,e.add('Auto-save enabled.'))}),s&&t.setItemForUser(ne.id)}function m(){ue&&le&&c()}function u(){var e,t=2===oe?'width':'height';try{e=[we.style[t],Ee.style[t],xe.style[t]]}catch(t){e=[33.33,33.33,33.33]}finally{return e}}function p(){var e,t=2===oe?'height':'width';try{e=[+$('#js-code-side').style[t].match(/([\d.]+)%/)[1],+$('#js-demo-side').style[t].match(/([\d.]+)%/)[1]]}catch(t){e=[50,50]}finally{return e}}function g(s){return ne.title=Pe.value,ne.html=Y.cm.html.getValue(),ne.css=Y.cm.css.getValue(),ne.js=Y.cm.js.getValue(),ne.htmlMode=ve,ne.cssMode=fe,ne.jsMode=be,ee[fe].hasSettings&&(ne.cssSettings={acssConfig:Y.acssSettingsCm.getValue()}),ne.updatedOn=Date.now(),ne.layoutMode=oe,ne.externalLibs={js:Ne.value,css:ze.value},ne.sizes=u(),ne.mainSizes=p(),utils.log('saving key',s||ne.id,ne),d(s||ne.id,ne),'code'!==s&&t.setItem(s||ne.id,ne).then(()=>{e.add('Item saved.'),le=0,saveBtn.classList.remove('is-marked')})}function h(e){var t='';e.length?(e.sort(function(e,t){return t.updatedOn-e.updatedOn}),e.forEach(function(e){t+='

'+e.title+'

Last updated: '+utils.getHumanDate(e.updatedOn)+'
'}),savedItemCountEl.textContent='('+e.length+')',savedItemCountEl.style.display='inline'):(t+='

Nothing saved here.

',savedItemCountEl.style.display='none'),Ie.querySelector('#js-saved-items-wrap').innerHTML=t,v()}function v(e){!1===e?Ie.classList.remove('is-open'):Ie.classList.toggle('is-open'),Le=Ie.classList.contains('is-open'),Le?searchInput.focus():(searchInput.value='',me&&me.focus()),document.body.classList[Le?'add':'remove']('overlay-visible')}async function b(e){var s=deferred();re=re||{};var o=[];return!window.IS_EXTENSION&&window.user?(o=await t.getAllItems(),e&&o.forEach((e)=>{re[e.id]=e}),s.resolve(o),s.promise):(db.local.get('items',function(t){var a=Object.getOwnPropertyNames(t.items||{});a.length||s.resolve([]),trackEvent('fn','fetchItems',a.length);for(let n=0;n{e.add('Item removed.'),ne.id===s&&C()}),delete re[s],trackEvent('fn','itemRemoved'))}function k(){Pe.value=ne.title||'Untitled',Ne.value=ne.externalLibs&&ne.externalLibs.js||'',ze.value=ne.externalLibs&&ne.externalLibs.css||'',utils.log('refresh editor'),ve=ne.htmlMode||ye.htmlMode||X.HTML,fe=ne.cssMode||ye.cssMode||Z.CSS,be=ne.jsMode||ye.jsMode||Q.JS,Y.cm.html.setValue(ne.html),Y.cm.css.setValue(ne.css),Y.cm.js.setValue(ne.js),Y.cm.html.refresh(),Y.cm.css.refresh(),Y.cm.js.refresh(),Y.acssSettingsCm.setValue(ne.cssSettings?ne.cssSettings.acssConfig:''),Y.acssSettingsCm.refresh(),Y.clearConsole(),r(),Promise.all([x(ve),M(fe),I(be)]).then(()=>Y.setPreviewContent(!0)),n(ne.layoutMode||ye.layoutMode)}function w(){helpModal.classList.remove('is-modal-visible'),notificationsModal.classList.remove('is-modal-visible'),addLibraryModal.classList.remove('is-modal-visible'),onboardModal.classList.remove('is-modal-visible'),settingsModal.classList.remove('is-modal-visible'),cssSettingsModal.classList.remove('is-modal-visible'),keyboardShortcutsModal.classList.remove('is-modal-visible'),loginModal.classList.remove('is-modal-visible'),profileModal.classList.remove('is-modal-visible'),v(!1),document.dispatchEvent(new Event('overlaysClosed'))}function E(e){function t(){ee[e].hasLoaded=!0,i.resolve()}const s='lib/transpilers';var i=deferred();return ee[e].hasLoaded?(i.resolve(),i.promise):(e===X.JADE?loadJS(`${s}/jade.js`).then(t):e===X.MARKDOWN?loadJS(`${s}/marked.js`).then(t):e===Z.LESS?loadJS(`${s}/less.min.js`).then(t):e===Z.SCSS||e===Z.SASS?loadJS(`${s}/sass.js`).then(function(){ae=new Sass(`${s}/sass.worker.js`),t()}):e===Z.STYLUS?loadJS(`${s}/stylus.min.js`).then(t):e===Z.ACSS?loadJS(`${s}/atomizer.browser.js`).then(t):e===Q.COFFEESCRIPT?loadJS(`${s}/coffee-script.js`).then(t):e===Q.ES6?loadJS(`${s}/babel.min.js`).then(t):e===Q.TS?loadJS(`${s}/typescript.js`).then(t):i.resolve(),i.promise)}function x(e){return ve=e,De.textContent=ee[e].label,De.parentElement.querySelector('select').value=e,Y.cm.html.setOption('mode',ee[e].cmMode),CodeMirror.autoLoadMode(Y.cm.html,ee[e].cmPath||ee[e].cmMode),E(e)}function M(e){return fe=e,Oe.textContent=ee[e].label,Oe.parentElement.querySelector('select').value=e,Y.cm.css.setOption('mode',ee[e].cmMode),Y.cm.css.setOption('readOnly',ee[e].cmDisable),cssSettingsBtn.classList[ee[e].hasSettings?'remove':'add']('hide'),CodeMirror.autoLoadMode(Y.cm.css,ee[e].cmPath||ee[e].cmMode),E(e)}function I(e){return be=e,Ae.textContent=ee[e].label,Ae.parentElement.querySelector('select').value=e,Y.cm.js.setOption('mode',ee[e].cmMode),CodeMirror.autoLoadMode(Y.cm.js,ee[e].cmPath||ee[e].cmMode),E(e)}function T(){var e=deferred(),t=Y.cm.html.getValue();return ve===X.HTML?e.resolve(t):ve===X.MARKDOWN?e.resolve(marked?marked(t):t):ve===X.JADE&&e.resolve(window.jade?jade.render(t):t),e.promise}function D(){var e=deferred(),t=Y.cm.css.getValue();if(A('css'),fe===Z.CSS)e.resolve(t);else if(fe===Z.SCSS||fe===Z.SASS)ae&&t?ae.compile(t,{indentedSyntax:fe===Z.SASS},function(t){t.line&&t.message&&P('css',[{lineNumber:t.line-1,message:t.message}]),e.resolve(t.text)}):e.resolve(t);else if(fe===Z.LESS)less.render(t).then(function(t){e.resolve(t.css)},function(e){P('css',[{lineNumber:e.line,message:e.message}])});else if(fe===Z.STYLUS)stylus(t).render(function(t,s){if(t){window.err=t;var i=t.message.split('\n');i.pop(),P('css',[{lineNumber:+t.message.match(/stylus:(\d+):/)[1]-298,message:i.pop()}])}e.resolve(s)});else if(fe===Z.ACSS)if(!window.atomizer)e.resolve('');else{const t=Y.cm.html.getValue(),i=atomizer.findClassNames(t);var s;try{s=atomizer.getConfig(i,JSON.parse(Y.acssSettingsCm.getValue()))}catch(t){s=atomizer.getConfig(i,{})}const o=atomizer.getCss(s);Y.cm.css.setValue(o),e.resolve(o)}return e.promise}function O(e){var t=deferred(),s=Y.cm.js.getValue();if(A('js'),!s)return t.resolve(''),t.promise;if(be===Q.JS)try{esprima.parse(s,{tolerant:!0})}catch(t){P('js',[{lineNumber:t.lineNumber-1,message:t.description}])}finally{!1!==e&&(s=utils.addInfiniteLoopProtection(s)),t.resolve(s)}else if(be===Q.COFFEESCRIPT){var i;if(!window.CoffeeScript)return t.resolve(''),t.promise;try{i=CoffeeScript.compile(s,{bare:!0})}catch(t){P('js',[{lineNumber:t.location.first_line,message:t.message}])}finally{!1!==e&&(s=utils.addInfiniteLoopProtection(i)),t.resolve(s)}}else if(be===Q.ES6){if(!window.Babel)return t.resolve(''),t.promise;try{esprima.parse(s,{tolerant:!0,jsx:!0})}catch(t){P('js',[{lineNumber:t.lineNumber-1,message:t.description}])}finally{s=Babel.transform(s,{presets:['latest','stage-2','react']}).code,!1!==e&&(s=utils.addInfiniteLoopProtection(s)),t.resolve(s)}}else if(be===Q.TS)try{if(!window.ts)return t.resolve(''),t.promise;if(s=ts.transpileModule(s,{reportDiagnostics:!0,compilerOptions:{noEmitOnError:!0,diagnostics:!0,module:ts.ModuleKind.ES2015}}),s.diagnostics.length)throw{description:s.diagnostics[0].messageText,lineNumber:ts.getLineOfLocalPosition(s.diagnostics[0].file,s.diagnostics[0].start)};!1!==e&&(s=utils.addInfiniteLoopProtection(s.outputText)),t.resolve(s)}catch(t){P('js',[{lineNumber:t.lineNumber-1,message:t.description}])}return t.promise}function A(e){Y.cm[e].clearGutter('error-gutter')}function P(e,t){var s=Y.cm[e];t.forEach(function(t){s.operation(function(){var e=document.createElement('div');e.setAttribute('data-title',t.message),e.classList.add('gutter-error-marker'),s.setGutterMarker(t.lineNumber,'error-gutter',e)})})}function B(e,t,s,i){var o=Ne.value.split('\n').reduce(function(e,t){return e+(t?'\n':'')},''),a=ze.value.split('\n').reduce(function(e,t){return e+(t?'\n':'')},''),n='\n\n\n\n'+a+'\n\n\n\n'+e+'\n'+o+'\n';if(i||(n+=''),be===Q.ES6&&(n+=''),'string'==typeof s)n+='\n\n',n}function N(e,t,s){function i(e){return function(){utils.log(arguments),trackEvent('fn','error',e),N.errorCount=(N.errorCount||0)+1,4===N.errorCount&&setTimeout(function(){alert('Oops! Seems like your preview isn\'t updating. Please try the following steps until it fixes:\n - Refresh Web Maker\n - Restart browser\n - Update browser\n - Reinstall Web Maker (don\'t forget to export all your creations from saved items pane (click the OPEN button) before reinstalling)\n\nIf nothing works, please tweet out to @webmakerApp.'),trackEvent('ui','writeFileMessageSeen')},1e3)}}var o=!1;window.webkitRequestFileSystem(window.TEMPORARY,5242880,function(a){a.root.getFile(e,{create:!0},function(e){e.createWriter((e)=>{e.onwriteend=function(){return o?s():(o=!0,e.seek(0),e.write(t),!1)},e.truncate(0)},i('createWriterFail'))},i('getFileFail'))},i('webkitRequestFileSystemFail'))}function z(e,t,s){const i=!window.webkitRequestFileSystem||!window.IS_EXTENSION;var o=B(e,t,i?s:null),a=new Blob([o],{type:'text/plain;charset=UTF-8'}),n=new Blob([s],{type:'text/plain;charset=UTF-8'});!trackEvent.hasTrackedCode&&(e||t||s)&&(trackEvent('fn','hasCode'),trackEvent.hasTrackedCode=!0),i?(ke.src=ke.src,setTimeout(()=>{ke.contentDocument.open(),ke.contentDocument.write(o),ke.contentDocument.close()},10)):N('script.js',n,function(){N('preview.html',a,function(){var e=chrome.i18n.getMessage()?`chrome-extension://${chrome.i18n.getMessage('@@extension_id')}`:`${location.origin}`,t=`filesystem:${e}/temporary/preview.html`;Y.detachedWindow?Y.detachedWindow.postMessage(t,'*'):ke.src=t})})}function F(){var e=T(),t=D(),s=O(!1);Promise.all([e,t,s]).then(function(e){var t=e[0],s=e[1],i=e[2],o=B(t,s,i,!0),a=new Date,n=['web-maker',a.getFullYear(),a.getMonth()+1,a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds()].join('-');n+='.html',ne.title&&(n=ne.title);var l=new Blob([o],{type:'text/html;charset=UTF-8'});utils.downloadFile(n,l),trackEvent('fn','saveFileComplete')})}function V(e,t){var s=CodeMirror(e,{mode:t.mode,lineNumbers:!0,lineWrapping:!0,autofocus:t.autofocus||!1,autoCloseBrackets:!0,autoCloseTags:!0,matchBrackets:!0,matchTags:t.matchTags||!1,tabMode:'indent',keyMap:'sublime',theme:'monokai',lint:!!t.lint,tabSize:2,foldGutter:!0,styleActiveLine:!0,gutters:t.gutters||[],profile:t.profile||'',extraKeys:{Up:function(e){Le||CodeMirror.commands.goLineUp(e)},Down:function(e){Le||CodeMirror.commands.goLineDown(e)},"Shift-Tab":function(e){CodeMirror.commands.indentAuto(e)},Tab:function(e){if(t.emmet){const t=e.execCommand('emmetExpandAbbreviation');if(!0===t)return}const s=$('[data-setting=indentWith]:checked');e.somethingSelected()||s&&'spaces'!==s.value?CodeMirror.commands.defaultTab(e):CodeMirror.commands.insertSoftTab(e)},Enter:'emmetInsertLineBreak'}});return s.on('focus',(e)=>{me=e}),s.on('change',function(e,t){clearTimeout(se),se=setTimeout(function(){'setValue'!==t.origin&&(!1!==ye.autoPreview&&Y.setPreviewContent(),saveBtn.classList.add('is-marked'),le+=1,0==le%ge&&le>=ge&&(saveBtn.classList.add('animated'),saveBtn.classList.add('wobble'),saveBtn.addEventListener('animationend',()=>{saveBtn.classList.remove('animated'),saveBtn.classList.remove('wobble')})),trackEvent.previewCount=(trackEvent.previewCount||0)+1,4===trackEvent.previewCount&&trackEvent('fn','usingPreview'))},pe)}),s.addKeyMap({"Ctrl-Space":'autocomplete'}),t.noAutocomplete||s.on('inputRead',function(e,t){ye.autoComplete&&'+input'===t.origin&&';'!==t.text[0]&&','!==t.text[0]&&' '!==t.text[0]&&CodeMirror.commands.autocomplete(s,null,{completeSingle:!1})}),s}function U(){Y.toggleModal(settingsModal)}function _(s){var i=[],o={};s.forEach((e)=>{re[e.id]?i.push(e.id):(utils.log('merging',e.id),o[e.id]=e)});var a=s.length-i.length;if(i.length){var n=confirm(i.length+' creations already exist. Do you want to replace them?');n&&(utils.log('shouldreplace',n),s.forEach((e)=>{o[e.id]=e}),a=s.length)}a&&t.saveItems(o).then(()=>{e.add(a+' creations imported successfully.'),trackEvent('fn','itemsImported',a)}),v(!1)}function R(t){var e=t.target.files[0],s=new FileReader;s.onload=function(e){var t;try{t=JSON.parse(e.target.result),utils.log(t),_(t)}catch(e){utils.log(e),alert('Oops! Selected file is corrupted. Please select a file that was generated by clicking the "Export" button.')}},s.readAsText(e,'utf-8')}function W(e){function t(){var e='filesystem:chrome-extension://'+chrome.i18n.getMessage('@@extension_id')+'/temporary/'+d;chrome.downloads.download({url:e},function(){chrome.runtime.lastError&&window.open(e)})}function s(t){utils.log(t)}for(var o=atob(e.split(',')[1]),a=e.split(',')[0].split(':')[1].split(';')[0],n=new ArrayBuffer(o.length),l=new Uint8Array(n),r=0;r{e.root.getFile(d,{create:!0},(e)=>{e.createWriter((e)=>{e.onwriteend=t,e.write(i)},s)},s)},s)}function q(){var e=deferred();return window.IS_EXTENSION?(chrome.permissions.contains({permissions:['downloads']},function(t){t?e.resolve():chrome.permissions.request({permissions:['downloads']},function(t){t?(trackEvent('fn','downloadsPermGiven'),e.resolve()):e.reject()})}),e.promise):(e.resolve(),e.promise)}function K(){$('[data-setting=preserveLastCode]').checked=ye.preserveLastCode,$('[data-setting=replaceNewTab]').checked=ye.replaceNewTab,$('[data-setting=htmlMode]').value=ye.htmlMode,$('[data-setting=cssMode]').value=ye.cssMode,$('[data-setting=jsMode]').value=ye.jsMode,$('[data-setting=indentSize]').value=ye.indentSize,indentationSizeValueEl.textContent=ye.indentSize,$('[data-setting=indentWith][value='+(ye.indentWith||'spaces')+']').checked=!0,$('[data-setting=isCodeBlastOn]').checked=ye.isCodeBlastOn,$('[data-setting=editorTheme]').value=ye.editorTheme,$('[data-setting=keymap][value='+(ye.keymap||'sublime')+']').checked=!0,$('[data-setting=fontSize]').value=ye.fontSize||16,$('[data-setting=refreshOnResize]').checked=ye.refreshOnResize,$('[data-setting=autoPreview]').checked=ye.autoPreview,$('[data-setting=editorFont]').value=ye.editorFont,$('[data-setting=editorCustomFont]').value=ye.editorCustomFont,$('[data-setting=autoSave]').checked=ye.autoSave,$('[data-setting=autoComplete]').checked=ye.autoComplete,$('[data-setting=preserveConsoleLogs]').checked=ye.preserveConsoleLogs,$('[data-setting=lightVersion]').checked=ye.lightVersion,$('[data-setting=lineWrap]').checked=ye.lineWrap}function H(e){function t(t){const e=s(`[d-${t}]`);e.forEach(function(s){s.addEventListener(t,function(i){Y[s.getAttribute(`d-${t}`)].call(window,i)})})}e instanceof Node||(e=document);const s=(t)=>[...e.querySelectorAll(t)];t('click'),t('change'),t('input'),t('keyup');const i=s(`[d-open-modal]`);i.forEach(function(e){utils.onButtonClick(e,function(){Y.toggleModal(window[e.getAttribute('d-open-modal')]),trackEvent(e.getAttribute('data-event-category'),e.getAttribute('data-event-action'))})});const o=s(`[d-html]`);o.forEach(function(e){fetch(e.getAttribute('d-html')).then((t)=>{e.removeAttribute('d-html'),t.text().then((t)=>{requestIdleCallback(()=>{e.innerHTML=t,H(e)})})})})}var Y=Y||{},J='2.9.6';window.DEBUG&&(window.scope=Y);const G={preserveLastCode:!0,replaceNewTab:!1,htmlMode:'html',jsMode:'js',cssMode:'css',isCodeBlastOn:!1,indentWith:'spaces',indentSize:2,editorTheme:'monokai',keymap:'sublime',fontSize:16,refreshOnResize:!1,autoPreview:!0,editorFont:'FiraCode',editorCustomFont:'',autoSave:!0,autoComplete:!0,preserveConsoleLogs:!0,lightVersion:!1,lineWrap:!0};var X={HTML:'html',MARKDOWN:'markdown',JADE:'jade'},Z={CSS:'css',SCSS:'scss',SASS:'sass',LESS:'less',STYLUS:'stylus',ACSS:'acss'},Q={JS:'js',ES6:'es6',COFFEESCRIPT:'coffee',TS:'typescript'},ee={};ee[X.HTML]={label:'HTML',cmMode:'htmlmixed',codepenVal:'none'},ee[X.MARKDOWN]={label:'Markdown',cmMode:'markdown',codepenVal:'markdown'},ee[X.JADE]={label:'Pug',cmMode:'pug',codepenVal:'pug'},ee[Q.JS]={label:'JS',cmMode:'javascript',codepenVal:'none'},ee[Q.COFFEESCRIPT]={label:'CoffeeScript',cmMode:'coffeescript',codepenVal:'coffeescript'},ee[Q.ES6]={label:'ES6 (Babel)',cmMode:'jsx',codepenVal:'babel'},ee[Q.TS]={label:'TypeScript',cmPath:'jsx',cmMode:'text/typescript-jsx',codepenVal:'typescript'},ee[Z.CSS]={label:'CSS',cmPath:'css',cmMode:'css',codepenVal:'none'},ee[Z.SCSS]={label:'SCSS',cmPath:'css',cmMode:'text/x-scss',codepenVal:'scss'},ee[Z.SASS]={label:'SASS',cmMode:'sass',codepenVal:'sass'},ee[Z.LESS]={label:'LESS',cmPath:'css',cmMode:'text/x-less',codepenVal:'less'},ee[Z.STYLUS]={label:'Stylus',cmMode:'stylus',codepenVal:'stylus'},ee[Z.ACSS]={label:'Atomic CSS',cmPath:'css',cmMode:'css',codepenVal:'notsupported',cmDisable:!0,hasSettings:!0};const te=chrome.extension?'/':'/app';var se,ie,oe,ae,ne,le,re,de,ce,me,ue,pe=500,ge=15,he=!0,ve=X.HTML,be=Q.JS,fe=Z.CSS,Se=33,ye={},Ce={html:null,css:null,js:null},Le=!1,je=0,ke=$('#demo-frame'),we=$('#js-html-code'),Ee=$('#js-css-code'),xe=$('#js-js-code'),Me=$('#js-codepen-form'),Ie=$('#js-saved-items-pane'),Te=$('#js-saved-items-pane-close-btn'),De=$('#js-html-mode-label'),Oe=$('#js-css-mode-label'),Ae=$('#js-js-mode-label'),Pe=$('#js-title-input'),Be=$('#js-add-library-select'),Ne=$('#js-external-js'),ze=$('#js-external-css');Y.cm={},Y.frame=ke,Y.demoFrameDocument=ke.contentDocument||ke.contentWindow.document,window.previewException=function(e){console.error('Possible infinite loop detected.',e.stack),window.onMessageFromConsole('Possible infinite loop detected.',e.stack)},window.onunload=function(){g('code'),Y.detachedWindow&&Y.detachedWindow.close()},Y.setPreviewContent=function(e){ye.preserveConsoleLogs||Y.clearConsole();var t={html:Y.cm.html.getValue(),css:Y.cm.css.getValue(),js:Y.cm.js.getValue()};utils.log('\uD83D\uDD0E setPreviewContent',e);const s=Y.detachedWindow?Y.detachedWindow.document.querySelector('iframe'):ke;if(!e&&t.html===Ce.html&&t.js===Ce.js)D().then(function(e){s.contentDocument.querySelector('#webmakerstyle')&&(s.contentDocument.querySelector('#webmakerstyle').textContent=e)});else{var i=T(),o=D(),a=O();Promise.all([i,o,a]).then(function(e){z(e[0],e[1],e[2])})}Ce.html=t.html,Ce.css=t.css,Ce.js=t.js},Y.cm.html=V(we,{mode:'htmlmixed',profile:'xhtml',gutters:['CodeMirror-linenumbers','CodeMirror-foldgutter'],noAutocomplete:!0,matchTags:{bothTags:!0},emmet:!0}),Y.cm.css=V(Ee,{mode:'css',gutters:['error-gutter','CodeMirror-linenumbers','CodeMirror-foldgutter'],emmet:!0}),Inlet(Y.cm.css),Y.cm.js=V(xe,{mode:'javascript',gutters:['error-gutter','CodeMirror-linenumbers','CodeMirror-foldgutter']}),Inlet(Y.cm.js),Y.consoleCm=CodeMirror(consoleLogEl,{mode:'javascript',lineWrapping:!0,theme:'monokai',foldGutter:!0,readOnly:!0,gutters:['CodeMirror-foldgutter']}),Y.onModalSettingsLinkClick=function(){U(),trackEvent('ui','onboardSettingsBtnClick')},Y.onShowInTabClicked=function(){onboardDontShowInTabOptionBtn.classList.remove('selected'),onboardShowInTabOptionBtn.classList.add('selected'),trackEvent('ui','onboardShowInTabClick')},Y.onDontShowInTabClicked=function(){onboardDontShowInTabOptionBtn.classList.add('selected'),onboardShowInTabOptionBtn.classList.remove('selected'),trackEvent('ui','onboardDontShowInTabClick')},Y.exportItems=function(t){q().then(()=>{b().then(function(e){var t=new Date,s=['web-maker-export',t.getFullYear(),t.getMonth()+1,t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds()].join('-');s+='.json';var i=new Blob([JSON.stringify(e,!1,2)],{type:'application/json;charset=UTF-8'});utils.downloadFile(s,i),trackEvent('ui','exportBtnClicked')})}),t.preventDefault()},Y.onImportBtnClicked=function(t){var e=document.createElement('input');e.type='file',e.style.display='none',e.accept='accept="application/json',document.body.appendChild(e),e.addEventListener('change',R),e.click(),trackEvent('ui','importBtnClicked'),t.preventDefault()},Y.takeScreenshot=function(t){q().then(()=>{function e(t){var s=document.createElement('canvas'),i=ke.getBoundingClientRect();s.width=i.width,s.height=i.height;var o=s.getContext('2d'),a=window.devicePixelRatio||1;o.drawImage(t,i.left*a,i.top*a,i.width*a,i.height*a,0,0,i.width,i.height),t.removeEventListener('load',e),W(s.toDataURL())}var t=document.createElement('style');t.textContent='[class*="hint"]:after, [class*="hint"]:before { display: none!important; }',document.body.appendChild(t),setTimeout(()=>{chrome.tabs.captureVisibleTab(null,{format:'png',quality:100},function(s){if(t.remove(),s){var i=new Image;i.src=s,i.addEventListener('load',()=>e(i,s))}})},50),trackEvent('ui','takeScreenshotBtnClick')}),t.preventDefault()},Y.updateSetting=function(t){if(t){var s=t.target.dataset.setting,i={},o=t.target;utils.log(s,'checkbox'===o.type?o.checked:o.value),ye[s]='checkbox'===o.type?o.checked:o.value,i[s]=ye[s],db.sync.set(i,function(){e.add('Setting saved')}),window.IS_EXTENSION||window.db.getDb().then((e)=>{e.collection('users').doc(window.user.uid).update({[`settings.${s}`]:ye[s]}).then((e)=>{utils.log(`Setting "${s}" for user`,e)}).catch((e)=>utils.log(e))}),trackEvent('ui','updatePref-'+s,ye[s])}runBtn.classList[ye.autoPreview?'add':'remove']('hide'),we.querySelector('.CodeMirror').style.fontSize=ye.fontSize,Ee.querySelector('.CodeMirror').style.fontSize=ye.fontSize,xe.querySelector('.CodeMirror').style.fontSize=ye.fontSize,consoleEl.querySelector('.CodeMirror').style.fontSize=ye.fontSize,indentationSizeValueEl.textContent=$('[data-setting=indentSize]').value,editorThemeLinkTag.href=`lib/codemirror/theme/${ye.editorTheme}.css`,fontStyleTag.textContent=fontStyleTemplate.textContent.replace(/fontname/g,('other'===ye.editorFont?ye.editorCustomFont:ye.editorFont)||'FiraCode'),customEditorFontInput.classList['other'===ye.editorFont?'remove':'add']('hide'),['html','js','css'].forEach((e)=>{Y.cm[e].setOption('indentWithTabs','spaces'!==$('[data-setting=indentWith]:checked').value),Y.cm[e].setOption('blastCode',!!$('[data-setting=isCodeBlastOn]').checked&&{effect:2,shake:!1}),Y.cm[e].setOption('indentUnit',+$('[data-setting=indentSize]').value),Y.cm[e].setOption('tabSize',+$('[data-setting=indentSize]').value),Y.cm[e].setOption('theme',$('[data-setting=editorTheme]').value),Y.cm[e].setOption('keyMap',$('[data-setting=keymap]:checked').value),Y.cm[e].setOption('lineWrapping',$('[data-setting=lineWrap]').checked),Y.cm[e].refresh()}),Y.consoleCm.setOption('theme',$('[data-setting=editorTheme]').value),Y.acssSettingsCm.setOption('theme',$('[data-setting=editorTheme]').value),ye.autoSave?!ie&&(ie=setInterval(m,15000)):(clearInterval(ie),ie=null),document.body.classList[ye.lightVersion?'add':'remove']('light-version')},Y.onNewBtnClick=function(){if(trackEvent('ui','newBtnClick'),le){var e=confirm('You have unsaved changes. Do you still want to create something new?');e&&C()}else C()},Y.onOpenBtnClick=function(){trackEvent('ui','openBtnClick'),f()},Y.onSaveBtnClick=function(){trackEvent('ui','saveBtnClick',ne.id?'saved':'new'),c()},Y.toggleModal=function(e){e.classList.toggle('is-modal-visible'),document.body.classList[e.classList.contains('is-modal-visible')?'add':'remove']('overlay-visible')},Y.onSearchInputChange=function(t){const e=t.target.value;let s;for(const[i,o]of Object.entries(re))s=$(`#js-saved-items-pane [data-item-id=${i}]`),-1===o.title.toLowerCase().indexOf(e)?s.classList.add('hide'):s.classList.remove('hide');trackEvent('ui','searchInputType')},Y.toggleConsole=function(){consoleEl.classList.toggle('is-minimized'),trackEvent('ui','consoleToggle')},Y.clearConsole=window.clearConsole=function(){Y.consoleCm.setValue(''),je=0,logCountEl.textContent=je},Y.onClearConsoleBtnClick=function(){Y.clearConsole(),trackEvent('ui','consoleClearBtnClick')},Y.evalConsoleExpr=function(t){(76===t.which||12===t.which)&&t.ctrlKey?(Y.clearConsole(),trackEvent('ui','consoleClearKeyboardShortcut')):13===t.which&&(window.onMessageFromConsole('> '+t.target.value),ke.contentWindow._wmEvaluate(t.target.value),t.target.value='',trackEvent('fn','evalConsoleExpr'))},window.onMessageFromConsole=function(){[...arguments].forEach(function(e){e&&e.indexOf&&-1!==e.indexOf('filesystem:chrome-extension')&&(e=e.replace(/filesystem:chrome-extension.*\.js:(\d+):*(\d*)/g,'script $1:$2'));try{Y.consoleCm.replaceRange(e+' '+((e+'').match(/\[object \w+]/)?JSON.stringify(e):'')+'\n',{line:Infinity})}catch(t){Y.consoleCm.replaceRange('\uD83C\uDF00\n',{line:Infinity})}Y.consoleCm.scrollTo(0,Infinity),je++}),logCountEl.textContent=je},Y.openDetachedPreview=function(){if(trackEvent('ui','detachPreviewBtnClick'),Y.detachedWindow)return void Y.detachedWindow.focus();var e=ke.getBoundingClientRect();const t=e.width,s=e.height;document.body.classList.add('is-detached-mode'),globalConsoleContainerEl.insertBefore(consoleEl,null),Y.detachedWindow=window.open('./preview.html','Web Maker',`width=${t},height=${s},resizable,scrollbars=yes,status=1`),setTimeout(()=>{Y.detachedWindow.postMessage(ke.src,'*')},1e3);var i=window.setInterval(function(){Y.detachedWindow&&Y.detachedWindow.closed&&(clearInterval(i),document.body.classList.remove('is-detached-mode'),$('#js-demo-side').insertBefore(consoleEl,null),Y.detachedWindow=null,Y.setPreviewContent(!0))},500)},Y.openCssSettingsModal=function(){Y.toggleModal(cssSettingsModal),setTimeout(()=>{Y.acssSettingsCm.refresh(),Y.acssSettingsCm.focus()},500),trackEvent('ui','cssSettingsBtnClick')},Y.onModalCloseBtnClick=function(t){w(),t.preventDefault()},Y.updateProfileUi=()=>{window.user?(document.body.classList.add('is-logged-in'),headerAvatarImg.src=profileAvatarImg.src=window.user.photoURL||'data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 24 24\'%3E%3Cpath fill=\'#ccc\' d=\'M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z\' /%3E%3C/svg%3E',profileUserName.textContent=window.user.displayName||'Anonymous Creator'):(document.body.classList.remove('is-logged-in'),headerAvatarImg.src=profileAvatarImg.src='',profileUserName.textContent='Anonymous Creator')},Y.login=(t)=>{const e=t.target.dataset.authProvider;window.login(e),t&&t.preventDefault()},Y.logout=(t)=>{if(t.preventDefault(),le){var e=confirm('You have unsaved changes. Do you still want to logout?');if(!e)return}window.logout()},Y.closeAllOverlays=w,function(){function t(e){return function(){return d('layoutMode',e),trackEvent('ui','toggleLayoutClick',e),n(e),!1}}function o(t){consoleEl.style.height=p+u-t.pageY+'px'}firebase.initializeApp({apiKey:'AIzaSyBl8Dz7ZOE7aP75mipYl2zKdLSRzBU2fFc',authDomain:'web-maker-app.firebaseapp.com',databaseURL:'https://web-maker-app.firebaseio.com',projectId:'web-maker-app',storageBucket:'web-maker-app.appspot.com',messagingSenderId:'560473480645'}),firebase.auth().onAuthStateChanged(function(t){Y.closeAllOverlays(),t?(utils.log('You are -> ',t),e.add('You are now logged in!'),Y.user=window.user=t,window.db.getUser(t.uid).then((e)=>{e&&(Object.assign(ye,t.settings),K(),Y.updateSetting())})):delete window.user,Y.updateProfileUi()});var a;CodeMirror.modeURL=`lib/codemirror/mode/%N/%N.js`,layoutBtn1.addEventListener('click',t(1)),layoutBtn2.addEventListener('click',t(2)),layoutBtn3.addEventListener('click',t(3)),layoutBtn4.addEventListener('click',t(4)),notificationsBtn.addEventListener('click',function(){return Y.toggleModal(notificationsModal),notificationsModal.classList.contains('is-modal-visible')&&!he&&(he=!0,notificationsBtn.classList.remove('has-new'),window.db.setUserLastSeenVersion(J)),trackEvent('ui','notificationButtonClick',J),!1}),codepenBtn.addEventListener('click',function(t){if(fe===Z.ACSS)return alert('Oops! CodePen doesn\'t supports Atomic CSS currently.'),void t.preventDefault();var e={title:'A Web Maker experiment',html:Y.cm.html.getValue(),css:Y.cm.css.getValue(),js:Y.cm.js.getValue(),html_pre_processor:ee[ve].codepenVal,css_pre_processor:ee[fe].codepenVal,js_pre_processor:ee[be].codepenVal,css_external:ze.value.split('\n').join(';'),js_external:Ne.value.split('\n').join(';')};ne.title.match(/Untitled\s\d\d*-\d/)||(e.title=ne.title),e=JSON.stringify(e),Me.querySelector('input').value=e,Me.submit(),trackEvent('ui','openInCodepen'),t.preventDefault()}),utils.onButtonClick(saveHtmlBtn,function(){F(),trackEvent('ui','saveHtmlClick')}),utils.onButtonClick(Te,v),utils.onButtonClick(Ie,function(t){t.target.classList.contains('js-saved-item-tile')&&(setTimeout(function(){L(t.target.dataset.itemId)},350),v()),t.target.classList.contains('js-saved-item-tile__remove-btn')?j(t.target.parentElement.parentElement.dataset.itemId):t.target.classList.contains('js-saved-item-tile__fork-btn')&&(v(),setTimeout(function(){y(re[t.target.parentElement.parentElement.dataset.itemId])},350))}),Pe.addEventListener('blur',function(){ne.id&&(c(),trackEvent('ui','titleChanged'))}),$all('.js-mode-select').forEach((e)=>{e.addEventListener('change',function(t){var e=t.target.value,s=t.target.dataset.type,i='html'===s?ve:'css'===s?fe:be;i!==e&&('html'===s?x(e).then(()=>Y.setPreviewContent(!0)):'js'===s?I(e).then(()=>Y.setPreviewContent(!0)):'css'===s&&M(e).then(()=>Y.setPreviewContent(!0)),trackEvent('ui','updateCodeMode',e))})});var r=$all('.js-code-collapse-btn');r.forEach(function(e){e.addEventListener('click',function(t){var e=t.currentTarget.parentElement.parentElement.parentElement;return i(e),trackEvent('ui','paneCollapseBtnClick',e.dataset.type),!1})}),[we,Ee,xe].forEach(function(e){e.addEventListener('transitionend',function(){s()})}),window.addEventListener('keydown',function(e){var t;if((e.ctrlKey||e.metaKey)&&83===e.keyCode&&(e.preventDefault(),c(),trackEvent('ui','saveItemKeyboardShortcut')),(e.ctrlKey||e.metaKey)&&e.shiftKey&&53===e.keyCode?(e.preventDefault(),Y.setPreviewContent(!0),trackEvent('ui','previewKeyboardShortcut')):(e.ctrlKey||e.metaKey)&&79===e.keyCode?(e.preventDefault(),f(),trackEvent('ui','openCreationKeyboardShortcut')):(e.ctrlKey||e.metaKey)&&e.shiftKey&&191===e.keyCode?(e.preventDefault(),Y.toggleModal(keyboardShortcutsModal),trackEvent('ui','showKeyboardShortcutsShortcut')):27===e.keyCode&&w(),40===e.keyCode&&Le){if(!$all('.js-saved-item-tile').length)return;t=$('.js-saved-item-tile.selected'),t?(t.classList.remove('selected'),t.nextUntil('.js-saved-item-tile:not(.hide)').classList.add('selected')):$('.js-saved-item-tile:not(.hide)').classList.add('selected'),$('.js-saved-item-tile.selected').scrollIntoView(!1)}else if(38===e.keyCode&&Le){if(!$all('.js-saved-item-tile').length)return;t=$('.js-saved-item-tile.selected'),t?(t.classList.remove('selected'),t.previousUntil('.js-saved-item-tile:not(.hide)').classList.add('selected')):$('.js-saved-item-tile:not(.hide)').classList.add('selected'),$('.js-saved-item-tile.selected').scrollIntoView(!1)}else if(13===e.keyCode&&Le){if(t=$('.js-saved-item-tile.selected'),!t)return;setTimeout(function(){L(t.dataset.itemId)},350),v()}Le&&(e.ctrlKey||e.metaKey)&&70===e.keyCode&&(e.preventDefault(),t=$('.js-saved-item-tile.selected'),setTimeout(function(){y(re[t.dataset.itemId])},350),v(),trackEvent('ui','forkKeyboardShortcut'))}),window.addEventListener('click',function(t){'string'!=typeof t.target.className||-1!==t.target.className.indexOf('modal-overlay')&&w()}),window.addEventListener('dblclick',function(t){var e=t.target;if(e.classList.contains('js-console__header')&&(Y.toggleConsole(),trackEvent('ui','consoleToggleDblClick')),e.classList.contains('js-code-wrap__header')){var s=e.parentElement;i(s),trackEvent('ui','paneHeaderDblClick',s.dataset.type)}});var m=window.jsLibs.reduce((e,t)=>e+``,'');Be.children[1].innerHTML=m,m=window.cssLibs.reduce((e,t)=>e+``,''),Be.children[2].innerHTML=m,Be.addEventListener('change',function(t){var e=t.target;e.value&&($('#js-external-'+e.selectedOptions[0].dataset.type).value+='\n'+e.value,trackEvent('ui','addLibrarySelect',e.selectedOptions[0].label),l(),e.value='')}),Ne.addEventListener('blur',l),ze.addEventListener('blur',l),new TextareaAutoComplete(Ne,{filter:(e)=>e.latest.match(/\.js$/)}),new TextareaAutoComplete(ze,{filter:(e)=>e.latest.match(/\.css$/)}),new TextareaAutoComplete(externalLibrarySearchInput,{selectedCallback:(e)=>{const t=e.match(/\.js$/)?Ne:ze;t.value=`${t.value}\n${e}`,externalLibrarySearchInput.value=''}});var u,p;$('.js-console__header').addEventListener('mousedown',(t)=>{u=t.pageY,p=consoleEl.getBoundingClientRect().height,$('#demo-frame').classList.add('pointer-none'),window.addEventListener('mousemove',o)}),$('.js-console__header').addEventListener('mouseup',()=>{window.removeEventListener('mousemove',o),$('#demo-frame').classList.remove('pointer-none')}),db.local.get({layoutMode:1,code:''},function(e){n(e.layoutMode),ye.layoutMode=e.layoutMode,e.code&&(a=e.code)}),db.getSettings(G).then((e)=>{e.preserveLastCode&&a?(le=0,a.id?db.local.get(a.id,function(e){e[a.id]&&(utils.log('Load item ',a.id),ne=e[a.id],k())}):(utils.log('Load last unsaved item',a),ne=a,k())):C(),Object.assign(ye,e),K(),Y.updateSetting()}),db.getUserLastSeenVersion().then((e)=>{e||(onboardModal.classList.add('is-modal-visible'),-1===document.cookie.indexOf('onboarded')&&(trackEvent('ui','onboardModalSeen',J),document.cookie='onboarded=1'),window.db.setUserLastSeenVersion(J)),e&&-1!==utils.semverCompare(e,J)||(notificationsBtn.classList.add('has-new'),he=!1)}),Y.acssSettingsCm=CodeMirror.fromTextArea(acssSettingsTextarea,{mode:'application/ld+json'}),Y.acssSettingsCm.on('blur',()=>{Y.setPreviewContent(!0)});var g='';['3024-day','3024-night','abcdef','ambiance','base2tone-meadow-dark','base16-dark','base16-light','bespin','blackboard','cobalt','colorforth','dracula','duotone-dark','duotone-light','eclipse','elegant','erlang-dark','hopscotch','icecoder','isotope','lesser-dark','liquibyte','material','mbo','mdn-like','midnight','monokai','neat','neo','night','panda-syntax','paraiso-dark','paraiso-light','pastel-on-dark','railscasts','rubyblue','seti','solarized dark','solarized light','the-matrix','tomorrow-night-bright','tomorrow-night-eighties','ttcn','twilight','vibrant-ink','xq-dark','xq-light','yeti','zenburn'].forEach((e)=>{g+=''}),document.querySelector('[data-setting="editorTheme"]').innerHTML=g,requestAnimationFrame(H)}()}(window.alertsService,window.itemService),function(e){function t(e){s&&(!e||e!==s)&&(s.classList.remove('open'),s=null)}var s;(function(){var i=e('[dropdown]');i.forEach(function(e){e.addEventListener('click',function(i){t(i.currentTarget),i.currentTarget.classList.toggle('open'),s=i.currentTarget,i.stopPropagation()})}),document.addEventListener('click',function(){t()})})()}($all); \ No newline at end of file diff --git a/app/service-worker.js b/app/service-worker.js new file mode 100644 index 0000000..f7c697d --- /dev/null +++ b/app/service-worker.js @@ -0,0 +1,268 @@ +/** + * Copyright 2016 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +// DO NOT EDIT THIS GENERATED OUTPUT DIRECTLY! +// This file should be overwritten as part of your build process. +// If you need to extend the behavior of the generated service worker, the best approach is to write +// additional code and include it using the importScripts option: +// https://github.com/GoogleChrome/sw-precache#importscripts-arraystring +// +// Alternatively, it's possible to make changes to the underlying template file and then use that as the +// new base for generating output, via the templateFilePath option: +// https://github.com/GoogleChrome/sw-precache#templatefilepath-string +// +// If you go that route, make sure that whenever you update your sw-precache dependency, you reconcile any +// changes made to this original template file with your modified copy. + +// This generated service worker JavaScript will precache your site's resources. +// The code needs to be saved in a .js file at the top-level of your site, and registered +// from your pages in order to be used. See +// https://github.com/googlechrome/sw-precache/blob/master/demo/app/js/service-worker-registration.js +// for an example of how you can register this script and handle various service worker events. + +/* eslint-env worker, serviceworker */ +/* eslint-disable indent, no-unused-vars, no-multiple-empty-lines, max-nested-callbacks, space-before-function-paren, quotes, comma-spacing */ +'use strict'; + +var precacheConfig = [["FiraCode.ttf","fa1f8c8961adca519738d9518139579c"],["Fixedsys.ttf","43cc87e8f9adba81b9d63b6e2d15db57"],["Inconsolata.ttf","b0639eb725c0df94f68b779889679457"],["Monoid.ttf","9b27db986ad2a74c522e9d3b6f7e2a63"],["icon-48.png","ca68956f464ed4fd2e09c66d5edaed5f"],["index.html","cffb3ea782ffe75f0f92c02fc140cee0"],["lib/codemirror/mode/coffeescript/coffeescript.js","dea87b9f4c669789c4760605d947f1a9"],["lib/codemirror/mode/css/css.js","6c9ca32a78c120340e588ed3df734138"],["lib/codemirror/mode/css/gss.html","9afa6e2f3a7daa6127a3f26e2e68005c"],["lib/codemirror/mode/css/gss_test.js","e40c6fd9abdc6edc2b29e521bda726e1"],["lib/codemirror/mode/css/less.html","a35ff50857d48bb2f4df8ac737f35d64"],["lib/codemirror/mode/css/scss.html","8c96251f27727a9b23b45c41511e23a0"],["lib/codemirror/mode/haml/haml.js","9abc1679e0f54dcdd62d2326ed6133f5"],["lib/codemirror/mode/htmlembedded/htmlembedded.js","67f745ab3879bf7bc3029ac75ea3e181"],["lib/codemirror/mode/htmlmixed/htmlmixed.js","2d6915b576f267e93f0e1cf72f31af37"],["lib/codemirror/mode/javascript/javascript.js","3b2f1591e3175a24846cb182943f2a40"],["lib/codemirror/mode/javascript/json-ld.html","a2a5069194b78b6b5523cace263cab06"],["lib/codemirror/mode/javascript/typescript.html","76c2ffb883a133aa0fc5cc75ec0c56f5"],["lib/codemirror/mode/jsx/jsx.js","7bee6944931c2cc6ccd99b50fca637db"],["lib/codemirror/mode/markdown/markdown.js","30dd4984e2e929429d70cf5174b35c5d"],["lib/codemirror/mode/meta.js","6e456ea5fd8920c85d5281bd1efecb4c"],["lib/codemirror/mode/pug/pug.js","e988fd72c82f3b11836f6a06f7452436"],["lib/codemirror/mode/sass/sass.js","bd31ac70e9a457abc2789c2b83a21984"],["lib/codemirror/mode/stylus/stylus.js","81e2d281ecbb1dcf5c86857097ae60a7"],["lib/codemirror/mode/xml/xml.js","80f64aaafa6af7844d14f32f3219bb26"],["lib/codemirror/theme/3024-day.css","73c8f41583b4b71dbe1e5eac5c96f1a9"],["lib/codemirror/theme/3024-night.css","745180be9a932f24c6c0dd4ebdf5a0ed"],["lib/codemirror/theme/abcdef.css","8004cb71fd65e58bdfa64fdd55241315"],["lib/codemirror/theme/ambiance-mobile.css","256f2dd130b80c6afaa40fddf700d12a"],["lib/codemirror/theme/ambiance.css","6a200e1f3976929816cf3ac4675c810a"],["lib/codemirror/theme/base16-dark.css","84b6347918411d58d7f9b65a7ee87f65"],["lib/codemirror/theme/base16-light.css","037c7f3d16fe6d5ae2baa532e334172b"],["lib/codemirror/theme/base2tone-meadow-dark.css","f9dd12e2e51fc1575c57f3e5edc2232f"],["lib/codemirror/theme/bespin.css","cc414e4ec18bc89b3c79935b0e27fc20"],["lib/codemirror/theme/blackboard.css","cf9366960ff65c8101793bc64fe13e88"],["lib/codemirror/theme/cobalt.css","3488b576456693fd7ced2da0e10c8a16"],["lib/codemirror/theme/colorforth.css","b2ee8d2296277fc2811a7473ee4e9977"],["lib/codemirror/theme/dracula.css","e514d652ae86bfeaed34237b7d3afe44"],["lib/codemirror/theme/duotone-dark.css","02ec891b23125aaf625d978a39fd24ca"],["lib/codemirror/theme/duotone-light.css","608d11459665117d708651ce7f803fde"],["lib/codemirror/theme/eclipse.css","194369eec66630cfaf662ce5f0a193be"],["lib/codemirror/theme/elegant.css","0a4227e805a9d5f73a55dd248c1b052d"],["lib/codemirror/theme/erlang-dark.css","b5543f5273c968449760ab0d6a2af6dc"],["lib/codemirror/theme/hopscotch.css","b924ed31af30b1c68e5a01fc3c9b0553"],["lib/codemirror/theme/icecoder.css","576d776abdf7e28ea9f84e2eb161a20d"],["lib/codemirror/theme/isotope.css","7bb44bff5190c427de5ae750d6369633"],["lib/codemirror/theme/lesser-dark.css","da2c896bff035cec86fa98b6dc13f7cc"],["lib/codemirror/theme/liquibyte.css","9f37e7a4f3c02bec9bb735b78ed082d6"],["lib/codemirror/theme/material.css","11e812a3688805b5c187a6e6852bafe1"],["lib/codemirror/theme/mbo.css","55ff4bdd8a92c3dcbfd5421c532b3059"],["lib/codemirror/theme/mdn-like.css","79f8dabc5593d01d27bc824b801f9f05"],["lib/codemirror/theme/midnight.css","950e76dca6461ee1a2eac39f2d886613"],["lib/codemirror/theme/monokai.css","31c75ebee6311d49c046ffbbb91028f4"],["lib/codemirror/theme/neat.css","6b19894b9787c6791c250a95d0d4f8d6"],["lib/codemirror/theme/neo.css","2886072b53043c167e6f8765606c705c"],["lib/codemirror/theme/night.css","fe3ce7650a77e7e3887816dd7b6d880d"],["lib/codemirror/theme/panda-syntax.css","acbf94261e43c1f29c2252eb445de032"],["lib/codemirror/theme/paraiso-dark.css","3c24cee0dfac767713840b24e8359c99"],["lib/codemirror/theme/paraiso-light.css","e245bbfd22b4f61efe526ff13903f19e"],["lib/codemirror/theme/pastel-on-dark.css","48aae1a42733db57bd0a260ce0d83975"],["lib/codemirror/theme/railscasts.css","a5e7682d89da46244e5464d9572e24d8"],["lib/codemirror/theme/rubyblue.css","52bb601017a90bca522d66f6e82e73aa"],["lib/codemirror/theme/seti.css","f71668880eb1625f420ceaad670436f0"],["lib/codemirror/theme/solarized dark.css","4d05a166d713bb1ac24833061c1522d7"],["lib/codemirror/theme/solarized light.css","4d05a166d713bb1ac24833061c1522d7"],["lib/codemirror/theme/the-matrix.css","33c49ceeedafd0a08e712e465e3ad3ce"],["lib/codemirror/theme/tomorrow-night-bright.css","777d36e1c5bbfeb3bf2ca8dd607eee93"],["lib/codemirror/theme/tomorrow-night-eighties.css","5ceb5531fbe074d5190b55e8c725051e"],["lib/codemirror/theme/ttcn.css","d2cb74dfae563a10e9c286357429ea8b"],["lib/codemirror/theme/twilight.css","684040adf66ef89355cb7ebc6b54b00b"],["lib/codemirror/theme/vibrant-ink.css","f10004836fb29cc9a08c987d3e18938a"],["lib/codemirror/theme/xq-dark.css","60f162f0c4240e7352364d436b5598fa"],["lib/codemirror/theme/xq-light.css","447e80da7fe8c5c2bcf39127200cead2"],["lib/codemirror/theme/yeti.css","623dc805bc84dd6d25deef376593354e"],["lib/codemirror/theme/zenburn.css","94ad50bf3d048ed92cc513cd901dc685"],["lib/screenlog.js","974cb1ec0473b11ae4834028c1820816"],["lib/transpilers/atomizer.browser.js","c2925b84a627b017797664530f284618"],["lib/transpilers/babel-polyfill.min.js","6fef55c62df380d41c8f42f8b0c1f4da"],["lib/transpilers/babel.min.js","77a1a84bbc2661db874c738f9b3ba375"],["lib/transpilers/coffee-script.js","a43664b71b7b96e90046a605f6fa51a1"],["lib/transpilers/jade.js","529e365c68f8d5efc4cea18be310bd76"],["lib/transpilers/less.min.js","6fd457ee80aaf9aa8758fe8a2345c970"],["lib/transpilers/marked.js","9f948a81f35613d44efa9322cbaf450d"],["lib/transpilers/sass.js","1263518af3f8b2090c9b08d195bd20d9"],["lib/transpilers/sass.worker.js","0d6c944b36008580fbedc09642f7f656"],["lib/transpilers/stylus.min.js","58f6030903ab52f596fb407dcd3df34f"],["lib/transpilers/typescript.js","cc0882a3185037052e21fa06a38ef077"],["partials/changelog.html","ff90524091c37e22edb0c74e5c380bd4"],["partials/help-modal.html","e3c8168ba7942a056a8798aa7d4aa7d0"],["partials/keyboard-shortcuts.html","d7c4124380a4eeb18968d55276d19591"],["partials/login-modal.html","663426a789a6a1f15dab008762018b18"],["partials/onboard-modal.html","ea2a2d5af4f2a3898551477e758fdada"],["script.js","d090e9eea2d66be8a529d8353b0d0efb"],["style.css","e21cc55d373976676df552d9933e2422"],["vendor.css","6ed94306315b8aaf789c53091c23bb4b"],["vendor.js","4ef4adfb271eb1a554b06f70165fa6f0"]]; +var cacheName = 'sw-precache-v3--' + (self.registration ? self.registration.scope : ''); + + +var ignoreUrlParametersMatching = [/^utm_/]; + + + +var addDirectoryIndex = function (originalUrl, index) { + var url = new URL(originalUrl); + if (url.pathname.slice(-1) === '/') { + url.pathname += index; + } + return url.toString(); + }; + +var cleanResponse = function (originalResponse) { + // If this is not a redirected response, then we don't have to do anything. + if (!originalResponse.redirected) { + return Promise.resolve(originalResponse); + } + + // Firefox 50 and below doesn't support the Response.body stream, so we may + // need to read the entire body to memory as a Blob. + var bodyPromise = 'body' in originalResponse ? + Promise.resolve(originalResponse.body) : + originalResponse.blob(); + + return bodyPromise.then(function(body) { + // new Response() is happy when passed either a stream or a Blob. + return new Response(body, { + headers: originalResponse.headers, + status: originalResponse.status, + statusText: originalResponse.statusText + }); + }); + }; + +var createCacheKey = function (originalUrl, paramName, paramValue, + dontCacheBustUrlsMatching) { + // Create a new URL object to avoid modifying originalUrl. + var url = new URL(originalUrl); + + // If dontCacheBustUrlsMatching is not set, or if we don't have a match, + // then add in the extra cache-busting URL parameter. + if (!dontCacheBustUrlsMatching || + !(url.pathname.match(dontCacheBustUrlsMatching))) { + url.search += (url.search ? '&' : '') + + encodeURIComponent(paramName) + '=' + encodeURIComponent(paramValue); + } + + return url.toString(); + }; + +var isPathWhitelisted = function (whitelist, absoluteUrlString) { + // If the whitelist is empty, then consider all URLs to be whitelisted. + if (whitelist.length === 0) { + return true; + } + + // Otherwise compare each path regex to the path of the URL passed in. + var path = (new URL(absoluteUrlString)).pathname; + return whitelist.some(function(whitelistedPathRegex) { + return path.match(whitelistedPathRegex); + }); + }; + +var stripIgnoredUrlParameters = function (originalUrl, + ignoreUrlParametersMatching) { + var url = new URL(originalUrl); + // Remove the hash; see https://github.com/GoogleChrome/sw-precache/issues/290 + url.hash = ''; + + url.search = url.search.slice(1) // Exclude initial '?' + .split('&') // Split into an array of 'key=value' strings + .map(function(kv) { + return kv.split('='); // Split each 'key=value' string into a [key, value] array + }) + .filter(function(kv) { + return ignoreUrlParametersMatching.every(function(ignoredRegex) { + return !ignoredRegex.test(kv[0]); // Return true iff the key doesn't match any of the regexes. + }); + }) + .map(function(kv) { + return kv.join('='); // Join each [key, value] array into a 'key=value' string + }) + .join('&'); // Join the array of 'key=value' strings into a string with '&' in between each + + return url.toString(); + }; + + +var hashParamName = '_sw-precache'; +var urlsToCacheKeys = new Map( + precacheConfig.map(function(item) { + var relativeUrl = item[0]; + var hash = item[1]; + var absoluteUrl = new URL(relativeUrl, self.location); + var cacheKey = createCacheKey(absoluteUrl, hashParamName, hash, false); + return [absoluteUrl.toString(), cacheKey]; + }) +); + +function setOfCachedUrls(cache) { + return cache.keys().then(function(requests) { + return requests.map(function(request) { + return request.url; + }); + }).then(function(urls) { + return new Set(urls); + }); +} + +self.addEventListener('install', function(event) { + event.waitUntil( + caches.open(cacheName).then(function(cache) { + return setOfCachedUrls(cache).then(function(cachedUrls) { + return Promise.all( + Array.from(urlsToCacheKeys.values()).map(function(cacheKey) { + // If we don't have a key matching url in the cache already, add it. + if (!cachedUrls.has(cacheKey)) { + var request = new Request(cacheKey, {credentials: 'same-origin'}); + return fetch(request).then(function(response) { + // Bail out of installation unless we get back a 200 OK for + // every request. + if (!response.ok) { + throw new Error('Request for ' + cacheKey + ' returned a ' + + 'response with status ' + response.status); + } + + return cleanResponse(response).then(function(responseToCache) { + return cache.put(cacheKey, responseToCache); + }); + }); + } + }) + ); + }); + }).then(function() { + + // Force the SW to transition from installing -> active state + return self.skipWaiting(); + + }) + ); +}); + +self.addEventListener('activate', function(event) { + var setOfExpectedUrls = new Set(urlsToCacheKeys.values()); + + event.waitUntil( + caches.open(cacheName).then(function(cache) { + return cache.keys().then(function(existingRequests) { + return Promise.all( + existingRequests.map(function(existingRequest) { + if (!setOfExpectedUrls.has(existingRequest.url)) { + return cache.delete(existingRequest); + } + }) + ); + }); + }).then(function() { + + return self.clients.claim(); + + }) + ); +}); + + +self.addEventListener('fetch', function(event) { + if (event.request.method === 'GET') { + // Should we call event.respondWith() inside this fetch event handler? + // This needs to be determined synchronously, which will give other fetch + // handlers a chance to handle the request if need be. + var shouldRespond; + + // First, remove all the ignored parameters and hash fragment, and see if we + // have that URL in our cache. If so, great! shouldRespond will be true. + var url = stripIgnoredUrlParameters(event.request.url, ignoreUrlParametersMatching); + shouldRespond = urlsToCacheKeys.has(url); + + // If shouldRespond is false, check again, this time with 'index.html' + // (or whatever the directoryIndex option is set to) at the end. + var directoryIndex = 'index.html'; + if (!shouldRespond && directoryIndex) { + url = addDirectoryIndex(url, directoryIndex); + shouldRespond = urlsToCacheKeys.has(url); + } + + // If shouldRespond is still false, check to see if this is a navigation + // request, and if so, whether the URL matches navigateFallbackWhitelist. + var navigateFallback = ''; + if (!shouldRespond && + navigateFallback && + (event.request.mode === 'navigate') && + isPathWhitelisted([], event.request.url)) { + url = new URL(navigateFallback, self.location).toString(); + shouldRespond = urlsToCacheKeys.has(url); + } + + // If shouldRespond was set to true at any point, then call + // event.respondWith(), using the appropriate cache key. + if (shouldRespond) { + event.respondWith( + caches.open(cacheName).then(function(cache) { + return cache.match(urlsToCacheKeys.get(url)).then(function(response) { + if (response) { + return response; + } + throw Error('The cached response that was expected is missing.'); + }); + }).catch(function(e) { + // Fall back to just fetch()ing the request if some unexpected error + // prevented the cached response from being valid. + console.warn('Couldn\'t serve response for "%s" from cache: %O', event.request.url, e); + return fetch(event.request); + }) + ); + } + } +}); + + + + + + + diff --git a/app/style.css b/app/style.css new file mode 100644 index 0000000..7a50270 --- /dev/null +++ b/app/style.css @@ -0,0 +1 @@ +:root{--color-bg:#252637;--color-sidebar:#3a2b63;--code-font-size:16px}body{margin:0;padding:0;background:rgba(0,0,0,.5);background:var(--color-bg);color:rgba(255,255,255,.9);min-height:100vh;font-size:87.5%;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif,'Segoe UI Emoji','Segoe UI Symbol'}h1{margin-top:0}a{text-decoration:none;color:#dc143c;cursor:pointer}.hide{display:none!important}.flex{display:flex}.flex-grow{flex-grow:1}.flex-v-center{align-items:center}.fr{float:right}.relative{position:relative}.tac{text-align:center}.tar{text-align:right}.va-m{vertical-align:middle}.full-width{width:100%}.opacity--30{opacity:.3}.opacity--70{opacity:.7}.pointer-none{pointer-events:none}.ml-1{margin-left:1rem}.ml-2{margin-left:2rem}.mb-1{margin-bottom:1rem}.mb-2{margin-bottom:2rem}hr{background:0;border:0;border-bottom:1px solid #dedede}label{cursor:pointer}[class*=hint--]:after{text-transform:none;font-weight:400;letter-spacing:.5px}.line{display:block;margin-bottom:1em}.caret{display:inline-block;width:0;height:0;border:6px solid transparent;border-top-color:currentColor;position:relative;top:5px;margin-left:8px}a>svg{fill:rgba(255,255,255,.2)}input[type=number],input[type=text],select,textarea{padding:3px 5px;font-size:inherit}.hidden-select{opacity:0;position:absolute;left:0;right:0;top:0;bottom:0}.btn{display:inline-block;border:0;background:#0074d9;color:#fff;font-size:inherit;border-radius:3px;padding:7px 15px;cursor:pointer;transition:box-shadow .2s ease}.btn--big{padding:15px 30px;border-radius:3px}.btn-icon{display:inline-flex;align-items:center}.btn:hover{text-decoration:none;box-shadow:0 3px 5px 0 rgba(0,0,0,.15)}.btn:focus{outline-width:4px;outline-color:#b76b29;outline-style:solid;outline-offset:1px}.btn-icon>svg{width:20px;height:20px;fill:currentColor;vertical-align:middle;margin-right:8px}.btn--big>svg{width:25px;height:25px;margin-right:12px}.star:after{content:'★';color:#eee333}.show-when-selected{display:none}.selected .show-when-selected{display:inline-block}.main-container{position:absolute;left:0;right:0;top:0;bottom:0;display:flex;flex-direction:column;overflow:hidden;will-change:-webkit-filter;transition:.1s ease .2s}body:not(.light-version).overlay-visible .main-container{transition-duration:.5s;transition-delay:.4s;-webkit-filter:blur(3px);filter:blur(3px)}.code-side,.demo-side{flex-basis:inherit;position:relative;width:50%}.layout-3 .content-wrap{flex-direction:row-reverse}.code-side{display:flex;flex-direction:column}.layout-2 .content-wrap{flex-direction:column}.layout-2 .code-side{flex-direction:row;width:auto}.layout-2 .demo-side{width:auto}.layout-4 .code-side{display:none}.layout-4 .code-side+.gutter{display:none}.layout-4 .demo-side{width:100%!important}.is-detached-mode .demo-side{display:none}.is-detached-mode .code-side{width:100%!important}.is-detached-mode.layout-2 .code-side{height:auto!important}.code-wrap{display:flex;flex-direction:column;flex-basis:inherit;height:33%;overflow:hidden;position:relative;background:var(--color-bg);transition:height .3s ease,width .3s ease;will-change:height}.layout-2 .code-wrap.is-minimized{flex-direction:row}.is-dragging .code-wrap{transition:none}.layout-2 .code-wrap{height:auto;width:33%}.code-wrap:nth-of-type(3){animation-delay:.3s}.code-wrap:nth-of-type(5){animation-delay:.4s}.code-wrap__header{display:flex;flex-shrink:0;justify-content:space-between;align-items:center;padding:5px 10px;background:rgba(0,0,0,.2);color:#888;border-bottom:1px solid rgba(0,0,0,.3);font-weight:700;user-select:none}.code-wrap__header-label{display:inline-block;font-size:1.1em;opacity:.5}.layout-2 .code-side .is-minimized .code-wrap__header{writing-mode:vertical-lr;padding:10px 5px}.code-wrap__header .caret{transition:.2s ease}.is-minimized .code-wrap__header .caret{opacity:0}.code-wrap__header-btn{display:inline-block;vertical-align:top;margin-left:8px}.code-wrap__header-btn,.code-wrap__header-btn>svg{width:18px;height:18px}.code-wrap__collapse-btn:before{content:url('data:image/svg+xml;utf8,')}.is-maximized .code-wrap__collapse-btn:before{content:url('data:image/svg+xml;utf8,')}@keyframes pop-in{from{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}.Codemirror{width:100%;height:calc(100% - 25px);font-size:var(--code-font-size)}.layout-2 .is-minimized .Codemirror{height:calc(100%)}.Codemirror pre{font-variant-ligatures:contextual}.cm-s-monokai .CodeMirror-linenumber{color:rgba(255,255,255,.2)}.cm-s-monokai .CodeMirror-gutters,.cm-s-monokai.CodeMirror{background:var(--color-bg)}.cm-s-monokai .CodeMirror-guttermarker-subtle{opacity:.4}.cm-s-monokai .CodeMirror-activeline-background,.cm-s-monokai .CodeMirror-activeline-gutter{background:rgba(0,0,0,.1)!important}.CodeMirror-hints{font-size:var(--code-font-size);border:0;background:#1e1e2c}.CodeMirror-hint{color:#bbb;padding:2px 4px}li.CodeMirror-hint-active{background:#5b429d}#demo-frame{border:0;width:100%;height:calc(100% - 29px);position:absolute;z-index:1;background:#fff}body>#demo-frame{height:100%}.footer,.main-header{padding:5px 10px;background-color:#12131b;color:rgba(255,255,255,.45);border-top:1px solid rgba(255,255,255,.14)}.footer{z-index:6}.main-header{display:flex;flex-wrap:nowrap;border:0;border-bottom:1px solid rgba(255,255,255,.14)}.main-header__btn-wrap>a{font-size:.8em;font-weight:700;line-height:20px;height:20px;letter-spacing:.6px;color:#9297b3;border-radius:3px;margin-left:10px;padding:0 8px;border:1px solid rgba(0,0,0,.9);background:linear-gradient(180deg,rgba(0,0,0,.5) 0,rgba(255,255,255,.1) 100%);box-shadow:0 -1px 0 0 rgba(255,255,255,.15);text-transform:uppercase}.main-header__btn-wrap>a>svg{fill:#9297b3;margin-right:4px}.main-header__btn-wrap>a.is-marked>svg{fill:#dc143c}.main-header__btn-wrap>a:hover{border-color:rgba(146,151,179,.5)}.main-header__avatar-img,.profile-modal__avatar-img{border-radius:50%}.logo{display:inline-block;height:25px;width:48px;margin-right:5px;background:url(icon-48.png) 0 -12px;background-repeat:no-repeat;vertical-align:middle;-webkit-filter:grayscale(.9);transition:.4s ease;opacity:.3}.footer:hover .logo{-webkit-filter:grayscale(0);opacity:1}.footer__right{font-size:0;line-height:0}.footer__separator{display:inline-block;height:24px;margin:0 10px 0 20px;border-left:1px solid rgba(255,255,255,.2)}.mode-btn{margin-left:10px;display:inline-block}.footer__link:first-of-type{margin-left:5px}.footer__link{display:inline-block;margin-right:5px;position:relative;top:2px}.footer a>svg{transition:.3s ease;fill:rgba(255,255,255,.2)}.footer a:hover svg{fill:rgba(255,255,255,.45)}.mode-btn svg{width:24px;height:24px}.mode-btn.selected svg{fill:rgba(255,255,255,.45)}.gutter{background:rgba(255,255,255,.05);flex-shrink:0}.gutter-horizontal{cursor:ew-resize}.gutter-vertical{cursor:ns-resize}.item-title-input{background:0 0;border:0;color:rgba(255,255,255,.6);flex:1}.search-input{background:rgba(255,255,255,.1);padding:10px 20px;border:0;width:100%;font-size:16px;color:#fff;border-radius:4px}.modal{position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;align-items:center;justify-content:center;z-index:2000;visibility:hidden;pointer-events:none}.modal__close-btn{position:absolute;right:10px;top:10px;opacity:.3;transition:.25s ease}.modal__close-btn>svg{fill:#000;width:30px;height:30px}.modal__close-btn:hover{opacity:.7}.modal__content{background:#fdfdfd;color:#444;position:relative;border-radius:8px;opacity:0;padding:2em;font-size:1.1em;line-height:1.4;max-width:85vw;max-height:90vh;box-sizing:border-box;overflow-y:auto;pointer-events:auto;transition-property:transform,opacity;transition-duration:.19s;transform:translateY(-50px) scale(.7)}@media screen and (max-width:900px){.modal__content{max-width:95vw}}.is-modal-visible{visibility:visible}.is-modal-visible .modal__content{transition-duration:.3s;transform:translateY(0) scale(1);opacity:1}.modal-overlay{position:fixed;width:100%;height:100%;visibility:hidden;top:0;left:0;z-index:5;opacity:0;will-change:opacity;background:rgba(0,0,0,.6);transition:opacity .3s}.saved-items-pane{position:fixed;right:0;top:0;bottom:0;width:450px;padding:20px 30px;z-index:6;background-color:var(--color-sidebar);transition:.3s cubic-bezier(1,.13,.21,.87);transition-property:transform;will-change:transform;transform:translateX(100%)}.saved-items-pane.is-open{transition-duration:.4s;transform:translateX(0)}.is-modal-visible~.modal-overlay,.saved-items-pane.is-open~.modal-overlay{opacity:1;visibility:visible}.saved-items-pane__close-btn{position:absolute;left:-18px;top:24px;opacity:0;visibility:hidden;border-radius:50%;padding:10px 14px;background:#dc143c;transform:scale(0);will-change:transform,opacity;transition:.3s ease;transition-delay:0}.saved-items-pane.is-open .saved-items-pane__close-btn{opacity:1;transition-delay:.4s;transform:scale(1);visibility:visible}.saved-item-tile{padding:20px;background-color:rgba(255,255,255,.06);position:relative;margin:20px 0;display:block;border-radius:4px;cursor:pointer;opacity:0;transform:translateX(50px);will-change:opacity,transform;box-shadow:0 2px 4px 0 rgba(0,0,0,.2);animation:slide-left .35s ease forwards}.saved-item-tile:nth-child(1){animation-delay:.2s}.saved-item-tile:nth-child(2){animation-delay:.25s}.saved-item-tile:nth-child(3){animation-delay:.3s}.saved-item-tile:nth-child(4){animation-delay:.35s}.saved-item-tile:nth-child(5){animation-delay:.4s}.saved-item-tile:nth-child(6){animation-delay:.45s}.saved-item-tile:nth-child(7){animation-delay:.5s}.saved-item-tile:nth-child(8){animation-delay:.55s}.saved-item-tile:nth-child(9){animation-delay:.6s}.saved-item-tile:nth-child(10){animation-delay:.65s}.saved-item-tile:nth-child(11){animation-delay:.7s}.saved-item-tile:nth-child(12){animation-delay:.75s}.saved-item-tile:nth-child(n+12){animation-delay:.8s}@keyframes slide-left{from{opacity:0;transform:translateX(50px)}to{opacity:1;transform:translateX(0)}}.saved-item-tile.selected,.saved-item-tile:hover{background:rgba(255,255,255,.1)}.saved-item-tile__btns{position:absolute;top:6px;z-index:1;right:8px;opacity:0;pointer-events:none;transition:.25s ease}.saved-item-tile.selected .saved-item-tile__btns,.saved-item-tile:hover .saved-item-tile__btns{opacity:1;pointer-events:auto}.saved-item-tile__btn{padding:7px 10px;color:rgba(255,255,255,.3);border-radius:20px;margin-left:2px;background:rgba(255,255,255,.05);text-transform:uppercase}.saved-item-tile__btn:hover{background:rgba(255,255,255,.8);color:#555}.saved-item-tile__title{pointer-events:none;font-size:1.4em;margin:0 0 1em 0;opacity:.8}.saved-item-tile__meta{pointer-events:none;opacity:.3}.saved-items-pane__container{overflow-y:scroll;max-height:calc(100vh - 90px)}.notifications-btn{position:relative}@keyframes shake{2%,22%{transform:translate3d(-1px,0,0)}20%,5%{transform:translate3d(2px,0,0)}12%,17%,7%{transform:translate3d(-4px,0,0)}10%,15%{transform:translate3d(4px,0,0)}}.notifications-btn.has-new{animation:shake 7s linear infinite;transform-origin:50% 10px}.notifications-btn__dot{position:absolute;right:1;top:-2px;background:#31fe45;border-radius:50%;width:12px;height:12px;display:none}.has-new .notifications-btn__dot{display:block}.notification{border:1px solid #f1f1f1;border-radius:5px;padding:20px;background:#f8f6f9;position:relative}.notification:not(:last-child){margin-bottom:10px}.notification li:not(:last-child){margin-bottom:10px}.notification__version{background:#ff8c00;color:#fff;padding:3px;border-radius:5px;position:absolute;top:2px;left:2px}.loader,.loader:after{border-radius:50%;width:3em;height:3em}.loader{font-size:5px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(118,57,229,.2);border-right:1.1em solid rgba(118,57,229,.2);border-bottom:1.1em solid rgba(118,57,229,.2);border-left:1.1em solid #7639e5;transform:translateZ(0);animation:load8 1.1s infinite linear}@keyframes load8{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.btn-group{position:relative;cursor:pointer}.dropdown__menu{position:absolute;top:100%;left:0;padding:0;margin:0;min-width:200px;display:block;font-size:.88rem;list-style:none;border-radius:4px;overflow:hidden;opacity:0;visibility:hidden;transition:transform .25s ease;transform:translateY(10px);z-index:5;background:#fff}.dropdown__menu>li>a{display:block;padding:6px 15px;color:#333;cursor:pointer}.dropdown__menu>li.selected>a,.dropdown__menu>li>a:hover{background:var(--color-sidebar);color:#fff}.dropdown__menu>li:not(:last-child){border-bottom:1px solid rgba(0,0,0,.05)}.dropdown__menu.is-open,.open>.dropdown__menu{opacity:1;visibility:visible;transform:translateY(0)}.alerts-container{position:fixed;will-change:transform;left:50%;top:-5px;padding:10px;background:#fff;border:1px solid #eee;color:#333;box-shadow:0 3px 5px rgba(0,0,0,.2);font-size:1rem;border-radius:3px;z-index:6;transform:translateX(-50%) translateY(-100%);transition:.3s ease}.alerts-container.is-active{transform:translateX(-50%) translateY(0)}.error-gutter{width:8px}.gutter-error-marker{width:8px;height:20px;background:red;border-radius:0;position:relative;top:0;left:1px}.gutter-error-marker:after{content:attr(data-title);background:red;color:#fff;padding:4px;opacity:0;visibility:hidden;position:absolute;top:14px;left:0;width:300px;transform:translateX(-10px);will-change:transform;transition:.2s ease}.gutter-error-marker:hover:after{opacity:1;visibility:visible;transform:translateX(0)}.count-label{color:rgba(0,0,0,.8);background:rgba(255,255,255,.53);border-radius:5px;padding:1px 6px;font-weight:700}.onboard-step{background:#f7f2f1;border:1px solid #ecdede;margin:15px;padding:20px 30px;background-color:#fff;border-radius:10px;box-shadow:0 16px 22px rgba(0,0,0,.1);flex:1;opacity:0;animation:onboard-step-show .6s ease forwards;animation-delay:.1s}.onboard-step:nth-child(2){animation-delay:.2s}.onboard-step:nth-child(3){animation-delay:.4s}.onboard-step__icon{fill:transparent!important;stroke-width:.3px;stroke:#eeb096;width:150px;height:150px}@keyframes onboard-step-show{from{transform:translateY(10px);opacity:0}to{transform:translateY(0);opacity:1}}.autocomplete-dropdown{border-top-left-radius:0;border-top-right-radius:0;right:0;max-height:200px;overflow-y:auto;border:1px solid rgba(0,0,0,.5);z-index:2001}.autocomplete__loader{position:absolute;right:3px;bottom:1px}@keyframes wobble{from{transform:none}15%{transform:translate3d(-25%,0,0) rotate3d(0,0,1,-5deg)}30%{transform:translate3d(20%,0,0) rotate3d(0,0,1,3deg)}45%{transform:translate3d(-15%,0,0) rotate3d(0,0,1,-3deg)}60%{transform:translate3d(10%,0,0) rotate3d(0,0,1,2deg)}75%{transform:translate3d(-5%,0,0) rotate3d(0,0,1,-1deg)}to{transform:none}}.animated{animation-duration:1s;animation-fill-mode:both}.wobble{animation-name:wobble}.console{background:var(--color-bg);z-index:6;position:absolute;bottom:0;min-height:80px;height:35vh;left:0;right:0;transform:translateY(0);transition:transform .4s cubic-bezier(.76,.01,.13,.9)}.console.is-minimized{transform:translateY(calc(100% - 29px))}.console .Codemirror{height:calc(100% - 55px)}.console-exec-input{padding:5px;font-size:1.3em;flex:1;background:rgba(0,0,0,.3);color:#fff;border:0;outline:0}.console:not(.is-minimized) .code-wrap__header{cursor:ns-resize}.global-console-container{display:none;position:relative;height:35px}.is-detached-mode .console,.is-detached-mode .footer{z-index:4}.is-detached-mode .global-console-container{display:block}.kbd-shortcut__keys{background:rgba(0,0,0,.1);border-radius:3px;padding:3px 8px;margin-right:5px;display:inline-block;font-size:.9rem;font-weight:700}.kbd-shortcut__details{display:inline-block}.web-maker-with-tag{position:relative;display:inline-block}.web-maker-with-tag:after{content:'BETA';position:relative;left:3px;top:-7px;border-radius:4px;background:#b76b29;color:#fff;letter-spacing:.6px;padding:2px;font-size:10px}.is-extension .web-maker-with-tag:after{display:none}.social-login-btn--github{background:#656b6f}.social-login-btn--facebook{background:#4e62c0}.social-login-btn--google{background:#fff;border:2px solid currentColor;color:inherit}body.is-logged-in .hide-on-login,body:not(.is-app) .show-when-app,body:not(.is-extension) .show-when-extension,body:not(.is-logged-in) .hide-on-logout{display:none}.cm-s-paraiso-dark.CodeMirror{background:#2f1e2e;color:#b9b6b0}.cm-s-paraiso-dark .CodeMirror-gutters{background:#2f1e2e;border-right:0}.cm-s-paraiso-dark .CodeMirror-activeline-background{background:#4d344a}.cm-s-monokai.CodeMirror{background:#272822;color:#f8f8f2}.cm-s-monokai .CodeMirror-gutters{background:#272822;border-right:0}.cm-s-monokai .CodeMirror-activeline-background{background:#373831}.cm-s-3024-day.CodeMirror{background:#f7f7f7;color:#3a3432}.cm-s-3024-day .CodeMirror-gutters{background:#f7f7f7;border-right:0}.cm-s-3024-day .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-material.CodeMirror{background-color:#263238;color:rgba(233,237,237,1)}.cm-s-material .CodeMirror-gutters{background:#263238;color:#537f7e}.cm-s-material .CodeMirror-activeline-background{background:rgba(0,0,0,0)}.cm-s-dracula .CodeMirror-gutters,.cm-s-dracula.CodeMirror{background-color:#282a36!important;color:#f8f8f2!important}.cm-s-dracula .CodeMirror-activeline-background{background:rgba(255,255,255,.1)}.cm-s-blackboard.CodeMirror{background:#0c1021;color:#f8f8f8}.cm-s-blackboard .CodeMirror-gutters{background:#0c1021;border-right:0}.cm-s-blackboard .CodeMirror-activeline-background{background:#3c3636}.cm-s-midnight.CodeMirror{background:#0f192a;color:#d1edff}.cm-s-midnight .CodeMirror-gutters{background:#0f192a;border-right:1px solid}.cm-s-midnight .CodeMirror-activeline-background{background:#253540} \ No newline at end of file diff --git a/app/vendor.css b/app/vendor.css new file mode 100644 index 0000000..1359388 --- /dev/null +++ b/app/vendor.css @@ -0,0 +1,3 @@ +.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:none;font-variant-ligatures:none}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);border-radius:3px;border:1px solid silver;background:#fff;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;max-width:19em;overflow:hidden;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff}.CodeMirror-foldmarker{color:#00f;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-folded,.CodeMirror-foldgutter-open{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25BE"}.CodeMirror-foldgutter-folded:after{content:"\25B8"}.CodeMirror-dialog{position:absolute;left:0;right:0;background:inherit;z-index:15;padding:.1em .8em;overflow:hidden;color:inherit}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{border:none;outline:0;background:0 0;width:20em;color:inherit;font-family:monospace}.CodeMirror-dialog button{font-size:70%}/*! Hint.css - v2.3.1 - 2016-06-05 +* http://kushagragour.in/lab/hint/ +* Copyright (c) 2016 Kushagra Gour; Licensed */[class*=hint--]{position:relative;display:inline-block}[class*=hint--]:after,[class*=hint--]:before{position:absolute;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);visibility:hidden;opacity:0;z-index:1000000;pointer-events:none;-webkit-transition:.3s ease;-moz-transition:.3s ease;transition:.3s ease;-webkit-transition-delay:0s;-moz-transition-delay:0s;transition-delay:0s}[class*=hint--]:hover:after,[class*=hint--]:hover:before{visibility:visible;opacity:1;-webkit-transition-delay:.1s;-moz-transition-delay:.1s;transition-delay:.1s}[class*=hint--]:before{content:'';position:absolute;background:0 0;border:6px solid transparent;z-index:1000001}[class*=hint--]:after{background:#383838;color:#fff;padding:8px 10px;font-size:12px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;line-height:12px;white-space:nowrap;text-shadow:0 -1px 0 #000;box-shadow:4px 4px 8px rgba(0,0,0,.3)}[class*=hint--][aria-label]:after{content:attr(aria-label)}[class*=hint--][data-hint]:after{content:attr(data-hint)}[aria-label='']:after,[aria-label='']:before,[data-hint='']:after,[data-hint='']:before{display:none!important}.hint--top-left:before,.hint--top-right:before,.hint--top:before{border-top-color:#383838}.hint--bottom-left:before,.hint--bottom-right:before,.hint--bottom:before{border-bottom-color:#383838}.hint--top:after,.hint--top:before{bottom:100%;left:50%}.hint--top:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top:after{-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);transform:translateX(-50%)}.hint--top:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--top:hover:after{-webkit-transform:translateX(-50%) translateY(-8px);-moz-transform:translateX(-50%) translateY(-8px);transform:translateX(-50%) translateY(-8px)}.hint--bottom:after,.hint--bottom:before{top:100%;left:50%}.hint--bottom:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom:after{-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);transform:translateX(-50%)}.hint--bottom:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--bottom:hover:after{-webkit-transform:translateX(-50%) translateY(8px);-moz-transform:translateX(-50%) translateY(8px);transform:translateX(-50%) translateY(8px)}.hint--right:before{border-right-color:#383838;margin-left:-11px;margin-bottom:-6px}.hint--right:after{margin-bottom:-14px}.hint--right:after,.hint--right:before{left:100%;bottom:50%}.hint--right:hover:after,.hint--right:hover:before{-webkit-transform:translateX(8px);-moz-transform:translateX(8px);transform:translateX(8px)}.hint--left:before{border-left-color:#383838;margin-right:-11px;margin-bottom:-6px}.hint--left:after{margin-bottom:-14px}.hint--left:after,.hint--left:before{right:100%;bottom:50%}.hint--left:hover:after,.hint--left:hover:before{-webkit-transform:translateX(-8px);-moz-transform:translateX(-8px);transform:translateX(-8px)}.hint--top-left:after,.hint--top-left:before{bottom:100%;left:50%}.hint--top-left:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top-left:after{-webkit-transform:translateX(-100%);-moz-transform:translateX(-100%);transform:translateX(-100%);margin-left:12px}.hint--top-left:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--top-left:hover:after{-webkit-transform:translateX(-100%) translateY(-8px);-moz-transform:translateX(-100%) translateY(-8px);transform:translateX(-100%) translateY(-8px)}.hint--top-right:after,.hint--top-right:before{bottom:100%;left:50%}.hint--top-right:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top-right:after{-webkit-transform:translateX(0);-moz-transform:translateX(0);transform:translateX(0);margin-left:-12px}.hint--top-right:hover:after,.hint--top-right:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--bottom-left:after,.hint--bottom-left:before{top:100%;left:50%}.hint--bottom-left:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom-left:after{-webkit-transform:translateX(-100%);-moz-transform:translateX(-100%);transform:translateX(-100%);margin-left:12px}.hint--bottom-left:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--bottom-left:hover:after{-webkit-transform:translateX(-100%) translateY(8px);-moz-transform:translateX(-100%) translateY(8px);transform:translateX(-100%) translateY(8px)}.hint--bottom-right:after,.hint--bottom-right:before{top:100%;left:50%}.hint--bottom-right:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom-right:after{-webkit-transform:translateX(0);-moz-transform:translateX(0);transform:translateX(0);margin-left:-12px}.hint--bottom-right:hover:after,.hint--bottom-right:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--large:after,.hint--medium:after,.hint--small:after{white-space:normal;line-height:1.4em}.hint--small:after{width:80px}.hint--medium:after{width:150px}.hint--large:after{width:300px}.hint--error:after{background-color:#b34e4d;text-shadow:0 -1px 0 #592726}.hint--error.hint--top-left:before,.hint--error.hint--top-right:before,.hint--error.hint--top:before{border-top-color:#b34e4d}.hint--error.hint--bottom-left:before,.hint--error.hint--bottom-right:before,.hint--error.hint--bottom:before{border-bottom-color:#b34e4d}.hint--error.hint--left:before{border-left-color:#b34e4d}.hint--error.hint--right:before{border-right-color:#b34e4d}.hint--warning:after{background-color:#c09854;text-shadow:0 -1px 0 #6c5328}.hint--warning.hint--top-left:before,.hint--warning.hint--top-right:before,.hint--warning.hint--top:before{border-top-color:#c09854}.hint--warning.hint--bottom-left:before,.hint--warning.hint--bottom-right:before,.hint--warning.hint--bottom:before{border-bottom-color:#c09854}.hint--warning.hint--left:before{border-left-color:#c09854}.hint--warning.hint--right:before{border-right-color:#c09854}.hint--info:after{background-color:#3986ac;text-shadow:0 -1px 0 #1a3c4d}.hint--info.hint--top-left:before,.hint--info.hint--top-right:before,.hint--info.hint--top:before{border-top-color:#3986ac}.hint--info.hint--bottom-left:before,.hint--info.hint--bottom-right:before,.hint--info.hint--bottom:before{border-bottom-color:#3986ac}.hint--info.hint--left:before{border-left-color:#3986ac}.hint--info.hint--right:before{border-right-color:#3986ac}.hint--success:after{background-color:#458746;text-shadow:0 -1px 0 #1a321a}.hint--success.hint--top-left:before,.hint--success.hint--top-right:before,.hint--success.hint--top:before{border-top-color:#458746}.hint--success.hint--bottom-left:before,.hint--success.hint--bottom-right:before,.hint--success.hint--bottom:before{border-bottom-color:#458746}.hint--success.hint--left:before{border-left-color:#458746}.hint--success.hint--right:before{border-right-color:#458746}.hint--always:after,.hint--always:before{opacity:1;visibility:visible}.hint--always.hint--top:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--top:after{-webkit-transform:translateX(-50%) translateY(-8px);-moz-transform:translateX(-50%) translateY(-8px);transform:translateX(-50%) translateY(-8px)}.hint--always.hint--top-left:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--top-left:after{-webkit-transform:translateX(-100%) translateY(-8px);-moz-transform:translateX(-100%) translateY(-8px);transform:translateX(-100%) translateY(-8px)}.hint--always.hint--top-right:after,.hint--always.hint--top-right:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--bottom:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--bottom:after{-webkit-transform:translateX(-50%) translateY(8px);-moz-transform:translateX(-50%) translateY(8px);transform:translateX(-50%) translateY(8px)}.hint--always.hint--bottom-left:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--bottom-left:after{-webkit-transform:translateX(-100%) translateY(8px);-moz-transform:translateX(-100%) translateY(8px);transform:translateX(-100%) translateY(8px)}.hint--always.hint--bottom-right:after,.hint--always.hint--bottom-right:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--left:after,.hint--always.hint--left:before{-webkit-transform:translateX(-8px);-moz-transform:translateX(-8px);transform:translateX(-8px)}.hint--always.hint--right:after,.hint--always.hint--right:before{-webkit-transform:translateX(8px);-moz-transform:translateX(8px);transform:translateX(8px)}.hint--rounded:after{border-radius:4px}.hint--no-animate:after,.hint--no-animate:before{-webkit-transition-duration:0s;-moz-transition-duration:0s;transition-duration:0s}.hint--bounce:after,.hint--bounce:before{-webkit-transition:opacity .3s ease,visibility .3s ease,-webkit-transform .3s cubic-bezier(.71,1.7,.77,1.24);-moz-transition:opacity .3s ease,visibility .3s ease,-moz-transform .3s cubic-bezier(.71,1.7,.77,1.24);transition:opacity .3s ease,visibility .3s ease,transform .3s cubic-bezier(.71,1.7,.77,1.24)}.inlet_clicker{z-index:10}.inlet_slider{opacity:.85;z-index:10;width:24%;display:block;border-radius:3px;height:14px;box-shadow:inset 0 0 5px 0 rgba(4,4,4,.5);background-color:#d6d6d6;background-image:linear-gradient(top,#d6d6d6,#ebebeb)}.inlet_slider:hover{opacity:.98}.inlet_slider .range{width:100%;height:100%;outline:0;margin-top:0;margin-left:0;border-radius:3px}.inlet_slider input[type=range]{-webkit-appearance:none}@-moz-document url-prefix(){.inlet_slider input[type=range]{position:absolute}}.inlet_slider input::-moz-range-track{background:0 0;border:none;outline:0}.inlet_slider input::-webkit-slider-thumb{cursor:col-resize;-webkit-appearance:none;width:12px;height:12px;border-radius:6px;border:1px solid #000;background-color:red;box-shadow:0 0 3px 0 rgba(4,4,4,.4);background-color:#424242;background-color:#dc143c;background-image:linear-gradient(top,#424242,#212121)}.ColorPicker{text-shadow:1px 1px 1px #000;color:#050505;cursor:default;display:block;font-family:arial,helvetica,sans-serif;font-size:20px;padding:7px 8px 20px;position:absolute;top:100px;left:700px;width:229px;z-index:100;border-radius:3px;-webkit-box-shadow:inset 0 0 5px 0 rgba(4,4,4,.5);box-shadow:inset 0 0 5px 0 rgba(4,4,4,.5);background-color:rgba(214,214,215,.85)}.ColorPicker br{clear:both;margin:0;padding:0}.ColorPicker input.hexInput:focus,.ColorPicker input.hexInput:hover{color:#aa1212}.ColorPicker input.hexInput{-webkit-transition-property:color;-webkit-transition-duration:.5s;background:0 0;border:0;margin:0;font-family:courier,monospace;font-size:20px;position:relative;top:-2px;float:left;color:#050505;cursor:text}.ColorPicker div.hexBox{border:1px solid rgba(255,255,255,.5);border-radius:2px;background:#fff;float:left;font-size:1px;height:20px;margin:0 5px 0 2px;width:20px;cursor:pointer}.ColorPicker div.hexBox div{width:inherit;height:inherit}.ColorPicker div.hexClose{display:none}.ColorPicker div.hexClose:hover{text-shadow:0 0 20px #fff;color:#f10} \ No newline at end of file diff --git a/app/vendor.js b/app/vendor.js new file mode 100644 index 0000000..0e80bf1 --- /dev/null +++ b/app/vendor.js @@ -0,0 +1 @@ +(function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);(this||window).CodeMirror=e()}})(function(){"use strict";function e(n,o){if(!(this instanceof e))return new e(n,o);this.options=o=o?Fr(o):{},Fr(ii,o,!1),u(o);var r=o.value;"string"==typeof r&&(r=new Li(r,o.mode,null,o.lineSeparator)),this.doc=r;var a=new e.inputStyles[o.inputStyle](this),l=this.display=new t(n,r,a);l.wrapper.CodeMirror=this,d(this),s(this),o.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),o.autofocus&&!Da&&l.input.focus(),f(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Lr,keySeq:null,specialChars:null};var p=this;for(var c in Ta&&11>wa&&setTimeout(function(){p.display.input.reset(!0)},20),Ht(this),Qr(),xt(this),this.curOp.forceUpdate=!0,Yo(this,r),o.autofocus&&!Da||p.hasFocus()?setTimeout(Br(yn,this),20):bn(this),si)si.hasOwnProperty(c)&&si[c](this,o[c],di);C(this),o.finishInit&&o.finishInit(this);for(var h=0;hwa&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),Ia||Sa&&Da||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,n.init(o)}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),o(t)}function o(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Ue(e,100),e.state.modeGen++,e.curOp&&Dt(e)}function r(e){var t=bt(e.display),n=e.options.lineWrapping,o=n&&va(5,e.display.scroller.clientWidth/vt(e.display)-3);return function(r){if(Eo(e.doc,r))return 0;var a=0;if(r.widgets)for(var s=0;st.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function u(e){var t=Pr(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):-1wa&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function f(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&es(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Mi(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?rn(t,e):nn(t,e)},t),t.display.scrollbars.addClass&&ts(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=h(e));var n=e.display.barWidth,o=e.display.barHeight;b(e,t);for(var r=0;4>r&&n!=e.display.barWidth||o!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&L(e),b(e,h(e)),n=e.display.barWidth,o=e.display.barHeight}function b(e,t){var n=e.display,o=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=o.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=o.bottom)+"px",n.heightForcer.style.borderBottom=o.bottom+"px solid transparent",o.right&&o.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=o.bottom+"px",n.scrollbarFiller.style.width=o.right+"px"):n.scrollbarFiller.style.display="",o.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=o.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function v(e,t,n){var o=n&&null!=n.top?va(0,n.top):e.scroller.scrollTop;o=fa(o-je(e));var r=n&&null!=n.bottom?n.bottom:o+e.wrapper.clientHeight,a=nr(t,o),i=nr(t,r);if(n&&n.ensure){var s=n.ensure.from.line,d=n.ensure.to.line;s=i&&(a=nr(t,or(Jo(t,d))-e.wrapper.clientHeight),i=d)}return{from:a,to:va(i,a+1)}}function x(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var o=E(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,a=o+"px",s=0;s=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Wt(e))return!1;C(e)&&(Ft(e),t.dims=O(e));var r=o.first+o.size,a=va(t.visible.from-e.options.viewportMargin,o.first),i=ga(r,t.visible.to+e.options.viewportMargin);n.viewFroma-n.viewFrom&&(a=va(o.first,n.viewFrom)),n.viewTo>i&&20>n.viewTo-i&&(i=ga(r,n.viewTo)),ja&&(a=Co(e.doc,a),i=So(e.doc,i));var s=a!=n.viewFrom||i!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vt(e,a,i),n.viewOffset=or(Jo(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var d=Wt(e);if(!s&&0==d&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var l=zr();return 4=e.display.viewFrom&&t.visible.to<=e.display.viewTo))break;if(!w(e,t))break;L(e);var r=h(e);_e(e),y(e,r),A(e,r)}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function N(e,t){var n=new k(e,t);if(w(e,n)){L(e),I(e,n);var o=h(e);_e(e),y(e,o),A(e,o),n.finish()}}function A(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ke(e)+"px"}function L(e){for(var t=e.display,n=t.lineDiv.offsetTop,o=0;owa){var i=r.node.offsetTop+r.node.offsetHeight;a=i-n,n=i}else{var s=r.node.getBoundingClientRect();a=s.bottom-s.top}var d=r.line.height-a;if(2>a&&(a=bt(t)),(.001d)&&(er(r.line,a),R(r.line),r.rest))for(var l=0;lwa&&(e.node.style.zIndex=2)),e.node}function M(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=D(e);e.background=n.insertBefore(Hr("div",null,t),n.firstChild)}}function F(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Uo(e,t)}function B(e,t){var n=t.text.className,o=F(e,t);t.text==t.node&&(t.node=o.pre),t.text.parentNode.replaceChild(o.pre,t.text),t.text=o.pre,o.bgClass!=t.bgClass||o.textClass!=t.textClass?(t.bgClass=o.bgClass,t.textClass=o.textClass,U(t)):n&&(t.text.className=n)}function U(e){M(e),e.line.wrapClass?D(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function V(e,t,n,o){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=D(t);t.gutterBackground=Hr("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?o.fixedPos:-o.gutterTotalWidth)+"px; width: "+o.gutterTotalWidth+"px"),r.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var r=D(t),i=t.gutter=Hr("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?o.fixedPos:-o.gutterTotalWidth)+"px");if(e.display.input.setUneditable(i),r.insertBefore(i,t.text),t.line.gutterClass&&(i.className+=" "+t.line.gutterClass),!e.options.lineNumbers||a&&a["CodeMirror-linenumbers"]||(t.lineNumber=i.appendChild(Hr("div",S(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+o.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var s=0;sza(e,t)?t:e}function X(e,t){return 0>za(e,t)?e:t}function Q(e){e.state.focused||(e.display.input.focus(),yn(e))}function Y(e,t,n,o,r){var a=e.doc;e.display.shift=!1,o||(o=a.sel);var s=e.state.pasteIncoming||"paste"==r,d=a.splitLines(t),l=null;if(s&&1r?l.map:p[r];for(var i=0,s;ir?e.line:e.rest[r]),c=a[i]+o;return(0>o||s!=t)&&(c=a[i+(o?1:0)]),qa(d,c)}}}var r=e.text.firstChild,a=!1;if(!t||!Zi(r,t))return ae(qa(tr(e.line),0),!0);if(t==r&&(a=!0,t=r.childNodes[n],n=0,!t)){var i=e.rest?Or(e.rest):e.line;return ae(qa(tr(i),i.text.length),a)}var s=3==t.nodeType?t:null,d=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,n&&(n=s.nodeValue.length));d.parentNode!=r;)d=d.parentNode;var l=e.measure,p=l.maps,c=o(s,d,n);if(c)return ae(c,a);for(var u=d.nextSibling,h=s?s.nodeValue.length-n:0;u;u=u.nextSibling){if(c=o(u,u.firstChild,0),c)return ae(qa(c.line,c.ch-h),a);h+=u.textContent.length}for(var m=d.previousSibling,h=n;m;m=m.previousSibling){if(c=o(m,m.firstChild,-1),c)return ae(qa(c.line,c.ch+h),a);h+=u.textContent.length}}function le(e,t,n,o,r){function a(e){return function(t){return t.id==e}}function s(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(d+=n);var p=t.getAttribute("cm-marker"),c;if(p){var u=e.findMarks(qa(o,0),qa(r+1,0),a(+p));return void(u.length&&(c=u[0].find())&&(d+=$o(e.doc,c.from,c.to).join(i)))}if("false"==t.getAttribute("contenteditable"))return;for(var h=0;hn?qa(n,Jo(e,n).text.length):fe(t,Jo(e,t.line).text.length)}function fe(e,t){var n=e.ch;return null==n||n>t?qa(e.line,t):0>n?qa(e.line,0):e}function ye(e,t){return t>=e.first&&tza(n,r);a==0>za(o,r)?a!=0>za(n,o)&&(n=o):(r=n,n=o)}return new ce(r,n)}return new ce(o||n,n)}function xe(e,t,n,o){we(e,new pe([ve(e,e.sel.primary(),t,n)],0),o)}function Ce(e,t,n){for(var o=[],r=0;rza(t.primary().head,e.sel.primary().head)?-1:1);Ne(e,Le(e,t,o,!0)),!(n&&!1===n.scroll)&&e.cm&&Bn(e.cm)}function Ne(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Ir(e.cm)),kr(e,"cursorActivity",e))}function Ae(e){Ne(e,Le(e,e.sel,null,!1),Hi)}function Le(e,t,n,o){for(var r=0,a;r=t.ch:i.to>t.ch))){if(r&&(Bi(d,"beforeCursorEnter"),d.explicitlyCleared))if(!a.markedSpans)break;else{--s;continue}if(!d.atomic)continue;if(n){var l=d.find(0>o?1:-1),p;if((0>o?d.inclusiveRight:d.inclusiveLeft)&&(l=Pe(e,l,-o,l&&l.line==t.line?a:null)),l&&l.line==t.line&&(p=za(l,n))&&(0>o?0>p:0o?-1:1);return(0>o?d.inclusiveLeft:d.inclusiveRight)&&(c=Pe(e,c,o,c.line==t.line?a:null)),c?Re(e,c,t,o,r):null}}return t}function Oe(e,t,n,o,r){var a=o||1,i=Re(e,t,n,a,r)||!r&&Re(e,t,n,a,!0)||Re(e,t,n,-a,r)||!r&&Re(e,t,n,-a,!0);return i?i:(e.cantEdit=!0,qa(e.first,0))}function Pe(e,t,n,o){return 0>n&&0==t.ch?t.line>e.first?ge(e,qa(t.line-1)):null:0=e.display.viewTo||i.to().linet&&(t=0),t=ya(t),o=ya(o),s.appendChild(Hr("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?p-e:n)+"px; height: "+(o-t)+"px"))}function r(t,n,r){function a(n,o){return ut(e,qa(t,n),"div",s,o)}var s=Jo(i,t),d=s.text.length,c,u;return ea(rr(s),n||0,null==r?d:r,function(e,t,i){var s=a(e,"left"),h,m,g;if(e==t)h=s,m=g=s.left;else{if(h=a(t-1,"right"),"rtl"==i){var f=s;s=h,h=f}m=s.left,g=h.right}null==n&&0==e&&(m=l),3u.bottom||h.bottom==u.bottom&&h.right>u.right)&&(u=h),me.options.cursorBlinkRate&&(t.cursorDiv.style.visibility="hidden")}}function Ue(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.viewTo)){var n=+new Date+e.options.workTime,o=mi(t.mode,He(e,t.frontier)),r=[];t.iter(t.frontier,ga(t.first+t.size,e.display.viewTo+500),function(a){if(t.frontier>=e.display.viewFrom){var s=a.styles,d=a.text.length>e.options.maxHighlightLength,l=Do(e,a,d?mi(t.mode,o):o,!0);a.styles=l.styles;var p=a.styleClasses,c=l.classes;c?a.styleClasses=c:p&&(a.styleClasses=null);for(var u=!s||s.length!=a.styles.length||p!=c&&(!p||!c||p.bgClass!=c.bgClass||p.textClass!=c.textClass),h=0;!u&&hn)?(Ue(e,e.options.workDelay),!0):void 0}),r.length&&At(e,function(){for(var t=0;tr;--a){if(a<=o.first)return o.first;var d=Jo(o,a-1);if(d.stateAfter&&(!n||a<=o.frontier))return a;var l=zi(d.text,null,e.options.tabSize);(null==s||i>l)&&(s=a-1,i=l)}return s}function He(e,t,n){var o=e.doc,r=e.display;if(!o.mode.startState)return!0;var a=We(e,t,n),i=a>o.first&&Jo(o,a-1).stateAfter;return i=i?mi(o.mode,i):gi(o.mode),o.iter(a,t,function(n){Fo(e,n.text,i);var s=a==t-1||0==a%5||a>=r.viewFrom&&an)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function Je(e,t){t=vo(t);var n=tr(t),o=e.display.externalMeasured=new Pt(e.doc,t,n);o.lineN=n;var r=o.built=Uo(e,o);return o.text=r.pre,qr(e.display.lineMeasure,r.pre),o}function $e(e,t,n,o){return tt(e,et(e,t),n,o)}function Ze(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(i=l-d,a=i-1,t>=l&&(s="right")),null!=a){if(r=e[o+2],d==l&&n==(r.insertLeft?"left":"right")&&(s=n),"left"==n&&0==a)for(;o&&e[o-2]==e[o-3]&&e[o-1].insertLeft;)r=e[(o-=3)+2],s="left";if("right"==n&&a==l-d)for(;oc;c++){for(;s&&Wr(t.line.text.charAt(r.coverStart+s));)--s;for(;r.coverStart+dwa&&0==s&&d==r.coverEnd-r.coverStart)p=a.parentNode.getBoundingClientRect();else if(Ta&&e.options.lineWrapping){var i=$i(a,s,d).getClientRects();p=i.length?i["right"==o?i.length-1:0]:Ga}else p=$i(a,s,d).getBoundingClientRect()||Ga;if(p.left||p.right||0==s)break;d=s,--s,l="right"}Ta&&11>wa&&(p=rt(e.display.measure,p))}else{0wa&&!s&&(!p||!p.left&&!p.right)){var u=a.parentNode.getClientRects()[0];p=u?{left:u.left,right:u.left+vt(e.display),top:u.top,bottom:u.bottom}:Ga}for(var h=p.top-t.rect.top,m=p.bottom-t.rect.top,g=t.view.measure.heights,c=0;cn.from?i(e-1):i(e,o)}o=o||Jo(e.doc,t.line),r||(r=et(e,o));var d=rr(o),l=t.ch;if(!d)return i(l);var p=la(d,l),c=s(l,p);return null!=us&&(c.other=s(l,us)),c}function mt(e,t){var n=0,t=ge(e.doc,t);e.options.lineWrapping||(n=vt(e.display)*t.ch);var o=Jo(e.doc,t.line),r=or(o)+je(e.display);return{left:n,right:n,top:r,bottom:r+o.height}}function gt(e,t,n,o){var r=qa(e,t);return r.xRel=o,n&&(r.outside=!0),r}function ft(e,t,n){var o=e.doc;if(n+=e.display.viewOffset,0>n)return gt(o.first,0,!0,-1);var r=nr(o,n),a=o.first+o.size-1;if(r>a)return gt(o.first+o.size-1,Jo(o,a).text.length,!0,1);0>t&&(t=0);for(var i=Jo(o,r);;){var s=yt(e,i,r,t,n),d=yo(i),l=d&&d.find(0,!0);if(d&&(s.ch>l.from.ch||s.ch==l.from.ch&&0r.bottom)?r.left-l:sy)return gt(n,m,b,1);for(;;){if(c?m==h||m==ca(t,h,1):1>=m-h){for(var v=ox?-1:1o?(m=E,y=i,(b=d)&&(y+=1e3),u=S):(h=E,g=i,f=d,u-=S)}}function bt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Za){Za=Hr("pre");for(var t=0;49>t;++t)Za.appendChild(document.createTextNode("x")),Za.appendChild(Hr("br"));Za.appendChild(document.createTextNode("x"))}qr(e.measure,Za);var n=Za.offsetHeight/50;return 3=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new k(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Tt(e){e.updatedDisplay=e.mustUpdate&&w(e.cm,e.update)}function wt(e){var t=e.cm,n=t.display;e.updatedDisplay&&L(t),e.barMeasure=h(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=$e(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=va(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ke(t)+t.display.barWidth),e.maxScrollLeft=va(0,n.sizer.offsetLeft+e.adjustWidthTo-Ge(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function It(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeftt)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)ja&&Co(e.doc,t)r.viewFrom?Ft(e):(r.viewFrom+=o,r.viewTo+=o);else if(t<=r.viewFrom&&n>=r.viewTo)Ft(e);else if(t<=r.viewFrom){var a=Ut(e,n,n+o,1);a?(r.view=r.view.slice(a.index),r.viewFrom=a.lineN,r.viewTo+=o):Ft(e)}else if(n>=r.viewTo){var a=Ut(e,t,t,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):Ft(e)}else{var i=Ut(e,t,t,-1),s=Ut(e,n,n+o,1);i&&s?(r.view=r.view.slice(0,i.index).concat(_t(e,i.lineN,s.lineN)).concat(r.view.slice(s.index)),r.viewTo+=o):Ft(e)}var d=r.externalMeasured;d&&(n=r.lineN&&t=o.viewTo)){var a=o.view[Bt(e,t)];if(null!=a.node){var i=a.changes||(a.changes=[]);-1==Pr(i,n)&&i.push(n)}}}function Ft(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Bt(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,o=0;ot)return o}function Ut(e,t,o,r){var a=Bt(e,t),s=e.display.view,d;if(!ja||o==e.doc.first+e.doc.size)return{index:a,lineN:o};for(var l=0,i=e.display.viewFrom;lr?0:s.length-1))return null;o+=r*s[a-(0>r?1:0)].size,a+=r}return{index:a,lineN:o}}function Vt(e,t,n){var o=e.display,r=o.view;0==r.length||t>=o.viewTo||n<=o.viewFrom?(o.view=_t(e,t,n),o.viewFrom=t):(o.viewFrom>t?o.view=_t(e,t,o.viewFrom).concat(o.view):o.viewFromn&&(o.view=o.view.slice(0,Bt(e,n)))),o.viewTo=n}function Wt(e){for(var t=e.display.view,n=0,o=0,r;o=e.radiusX&&1>=e.radiusY}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,o=t.top-e.top;return 400wa?Mi(a.scroller,"dblclick",Lt(t,function(n){if(!wr(t,n)){var e=zt(t,n);if(!(!e||Jt(t,n)||qt(t.display,n))){Pi(n);var o=t.findWordAt(e);xe(t.doc,o.anchor,o.head)}}})):Mi(a.scroller,"dblclick",function(n){wr(t,n)||Pi(n)}),Wa||Mi(a.scroller,"contextmenu",function(n){vn(t,n)});var i={end:0},s;Mi(a.scroller,"touchstart",function(n){if(!wr(t,n)&&!o(n)){clearTimeout(s);var e=+new Date;a.activeTouch={start:e,moved:!1,prev:300>=e-i.end?i:null},1==n.touches.length&&(a.activeTouch.left=n.touches[0].pageX,a.activeTouch.top=n.touches[0].pageY)}}),Mi(a.scroller,"touchmove",function(){a.activeTouch&&(a.activeTouch.moved=!0)}),Mi(a.scroller,"touchend",function(o){var e=a.activeTouch;if(e&&!qt(a,o)&&null!=e.left&&!e.moved&&300>new Date-e.start){var i=t.coordsChar(a.activeTouch,"page"),s;s=!e.prev||r(e,e.prev)?new ce(i,i):!e.prev.prev||r(e,e.prev.prev)?t.findWordAt(i):new ce(qa(i.line,0),ge(t.doc,qa(i.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),Pi(o)}n()}),Mi(a.scroller,"touchcancel",n),Mi(a.scroller,"scroll",function(){a.scroller.clientHeight&&(nn(t,a.scroller.scrollTop),rn(t,a.scroller.scrollLeft,!0),Bi(t,"scroll",t))}),Mi(a.scroller,"mousewheel",function(n){an(t,n)}),Mi(a.scroller,"DOMMouseScroll",function(n){an(t,n)}),Mi(a.wrapper,"scroll",function(){a.wrapper.scrollTop=a.wrapper.scrollLeft=0}),a.dragFunctions={enter:function(n){wr(t,n)||Di(n)},over:function(n){wr(t,n)||(en(t,n),Di(n))},start:function(n){Zt(t,n)},drop:Lt(t,$t),leave:function(n){wr(t,n)||tn(t)}};var e=a.input.getField();Mi(e,"keyup",function(n){mn.call(t,n)}),Mi(e,"keydown",Lt(t,un)),Mi(e,"keypress",Lt(t,gn)),Mi(e,"focus",Br(yn,t)),Mi(e,"blur",Br(bn,t))}function jt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function qt(t,o){for(var e=Cr(o);e!=t.wrapper;e=e.parentNode)if(!e||1==e.nodeType&&"true"==e.getAttribute("cm-ignore-events")||e.parentNode==t.sizer&&e!=t.mover)return!0}function zt(t,n,e,o){var r=t.display;if(!e&&"true"==Cr(n).getAttribute("cm-not-content"))return null;var a=r.lineSpace.getBoundingClientRect(),i,s;try{i=n.clientX-a.left,s=n.clientY-a.top}catch(t){return null}var d=ft(t,i,s),l;if(o&&1==d.xRel&&(l=Jo(t.doc,d.line).text).length==d.ch){var p=zi(l,l.length,t.options.tabSize)-l.length;d=qa(d.line,va(0,ya((i-ze(t.display).left)/vt(t.display))-p))}return d}function Kt(t){var e=this,n=e.display;if(!(wr(e,t)||n.activeTouch&&n.input.supportsTouch())){if(n.shift=t.shiftKey,qt(n,t))return void(Ia||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!Jt(e,t)){var o=zt(e,t);switch(window.focus(),Sr(t)){case 1:e.state.selectingText?e.state.selectingText(t):o?Gt(e,t,o):Cr(t)==n.scroller&&Pi(t);break;case 2:Ia&&(e.state.lastMiddleDown=+new Date),o&&xe(e.doc,o),setTimeout(function(){n.input.focus()},20),Pi(t);break;case 3:Wa?vn(e,t):fn(e);}}}}function Gt(t,n,e){Ta?setTimeout(Br(Q,t),0):t.curOp.focus=zr();var o=+new Date,r;ti&&ti.time>o-400&&0==za(ti.pos,e)?r="triple":ei&&ei.time>o-400&&0==za(ei.pos,e)?(r="double",ti={time:o,pos:e}):(r="single",ei={time:o,pos:e});var a=t.doc.sel,i=Ma?n.metaKey:n.ctrlKey,s;t.options.dragDrop&&os&&!t.isReadOnly()&&"single"==r&&-1<(s=a.contains(e))&&(0>za((s=a.ranges[s]).from(),e)||0e.xRel)?Xt(t,n,e,i):Qt(t,n,e,r,i)}function Xt(t,n,e,o){var r=t.display,a=+new Date,i=Lt(t,function(s){Ia&&(r.scroller.draggable=!1),t.state.draggingText=!1,Fi(document,"mouseup",i),Fi(r.scroller,"drop",i),10>ha(n.clientX-s.clientX)+ha(n.clientY-s.clientY)&&(Pi(s),!o&&+new Date-200b&&r.push(new ce(qa(m,b),qa(m,Ki(y,c,a))))}r.length||r.push(new ce(e,e)),we(l,ue(p.ranges.slice(0,h).concat(r),h),{origin:"*mouse",scroll:!1}),t.scrollIntoView(n)}else{var v=u,x=v.anchor,C=n;if("single"!=o){if("double"==o)var S=t.findWordAt(n);else var S=new ce(qa(n.line,0),ge(l,qa(n.line+1,0)));0=s.to||r.liney.bottom?20:0;p&&setTimeout(Lt(t,function(){b!=e||(d.scroller.scrollTop+=p,i(n))}),50)}}function s(n){t.state.selectingText=!1,b=Infinity,Pi(n),d.input.focus(),Fi(document,"mousemove",x),Fi(document,"mouseup",C),l.history.lastSelOrigin=null}var d=t.display,l=t.doc;Pi(n);var p=l.sel,c=p.ranges,u,h;if(r&&!n.shiftKey?(h=l.sel.contains(e),u=-1=fa(t.display.gutters.getBoundingClientRect().right))return!1;o&&Pi(n);var s=t.display,d=s.lineDiv.getBoundingClientRect();if(a>d.bottom||!Nr(t,e))return xr(n);a-=d.top-s.viewOffset;for(var l=0,i;l=r){var p=nr(t.doc,a),c=t.options.gutters[l];return Bi(t,e,t,p,c,n),xr(n)}}function Jt(t,n){return Yt(t,n,"gutterClick",!0)}function $t(t){var e=this;if(tn(e),!(wr(e,t)||qt(e.display,t))){Pi(t),Ta&&(Ya=+new Date);var o=zt(e,t,!0),r=t.dataTransfer.files;if(o&&!e.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var a=r.length,n=Array(a),s=0,d=function(t,r){if(!(e.options.allowDropFileTypes&&-1==Pr(e.options.allowDropFileTypes,t.type))){var i=new FileReader;i.onload=Lt(e,function(){var t=i.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(t)&&(t=""),n[r]=t,++s==a){o=ge(e.doc,o);var d={from:o,to:o,text:e.doc.splitLines(n.join(e.doc.lineSeparator())),origin:"paste"};wn(e.doc,d),Te(e.doc,he(o,ai(d)))}}),i.readAsText(t)}},l=0;l+new Date-Ya))return void Di(n);if(!(wr(t,n)||qt(t.display,n))&&(n.dataTransfer.setData("Text",t.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!Ra)){var e=Hr("img",null,null,"position: fixed; left: 0; top: 0;");e.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",La&&(e.width=e.height=1,t.display.wrapper.appendChild(e),e._top=e.offsetTop),n.dataTransfer.setDragImage(e,0,0),La&&e.parentNode.removeChild(e)}}function en(t,n){var e=zt(t,n);if(e){var o=document.createDocumentFragment();Me(t,e,o),t.display.dragCursor||(t.display.dragCursor=Hr("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),qr(t.display.dragCursor,o)}}function tn(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function nn(e,t){2>ha(e.doc.scrollTop-t)||(e.doc.scrollTop=t,!Sa&&N(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),Sa&&N(e),Ue(e,100))}function rn(e,t,n){(n?t==e.doc.scrollLeft:2>ha(e.doc.scrollLeft-t))||(t=ga(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,x(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function an(t,n){var e=ni(n),o=e.x,r=e.y,a=t.display,s=a.scroller,d=s.scrollWidth>s.clientWidth,l=s.scrollHeight>s.clientHeight;if(o&&d||r&&l){if(r&&Ma&&Ia)outer:for(var p=n.target,c=a.view;p!=s;p=p.parentNode)for(var u=0;ui?h=va(0,h+i-50):m=ga(t.doc.height,m+i+50),N(t,{top:h,bottom:m})}20>Ja&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=o,a.wheelDY=r,setTimeout(function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&($a=($a*Ja+n)/(Ja+1),++Ja)}},200)):(a.wheelDX+=o,a.wheelDY+=r))}}function sn(e,t,n){if("string"==typeof t&&(t=fi[t],!t))return!1;e.display.input.ensurePolled();var o=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),r=t(e)!=Wi}finally{e.display.shift=o,e.state.suppressEdits=!1}return r}function dn(e,t,n){for(var o=0,r;owa&&27==t.keyCode&&(t.returnValue=!1);var n=t.keyCode;e.display.shift=16==n||t.shiftKey;var o=pn(e,t);La&&(ri=o?n:null,!o&&88==n&&!is&&(Ma?t.metaKey:t.ctrlKey)&&e.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||hn(e)}}function hn(e){function t(o){18!=o.keyCode&&o.altKey||(es(n,"CodeMirror-crosshair"),Fi(document,"keyup",t),Fi(document,"mouseover",t))}var n=e.display.lineDiv;ts(n,"CodeMirror-crosshair"),Mi(document,"keyup",t),Mi(document,"mouseover",t)}function mn(t){16==t.keyCode&&(this.doc.sel.shift=!1),wr(this,t)}function gn(t){var e=this;if(!(qt(e.display,t)||wr(e,t)||t.ctrlKey&&!t.altKey||Ma&&t.metaKey)){var n=t.keyCode,o=t.charCode;if(La&&n==ri)return ri=null,void Pi(t);if(!(La&&(!t.which||10>t.which)&&pn(e,t))){var r=ma(null==o?n:o);cn(e,t,r)||e.display.input.onKeyPress(t)}}}function fn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,bn(e))},100)}function yn(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"==e.options.readOnly||(!e.state.focused&&(Bi(e,"focus",e),e.state.focused=!0,ts(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),Ia&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Be(e))}function bn(e){e.state.delayingBlurEvent||(e.state.focused&&(Bi(e,"blur",e),e.state.focused=!1,es(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function vn(t,n){qt(t.display,n)||xn(t,n)||wr(t,n,"contextmenu")||t.display.input.onContextMenu(n)}function xn(t,n){return!!Nr(t,"gutterContextMenu")&&Yt(t,n,"gutterContextMenu",!1)}function Cn(e,t){if(0>za(e,t.from))return e;if(0>=za(e,t.to))return ai(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,o=e.ch;return e.line==t.to.line&&(o+=ai(t).ch-t.to.ch),qa(n,o)}function Sn(e,t){for(var n=[],o=0,r;oza(p.head,p.anchor);o[s]=new ce(c?l:d,c?d:l)}else o[s]=new ce(d,d)}return new pe(o,e.sel.primIndex)}function Tn(e,t,n){var o={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(o.update=function(t,n,o,r){t&&(this.from=ge(e,t)),n&&(this.to=ge(e,n)),o&&(this.text=o),void 0!==r&&(this.origin=r)}),Bi(e,"beforeChange",e,o),e.cm&&Bi(e.cm,"beforeChange",e.cm,o),o.canceled?null:{from:o.from,to:o.to,text:o.text,origin:o.origin}}function wn(e,t,n){if(e.cm){if(!e.cm.curOp)return Lt(e.cm,wn)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((Nr(e,"beforeChange")||e.cm&&Nr(e.cm,"beforeChange"))&&(t=Tn(e,t,!0),!t))){var o=Ha&&!n&&lo(e,t.from,t.to);if(o)for(var r=o.length-1;0<=r;--r)In(e,{from:o[r].from,to:o[r].to,text:r?[""]:t.text});else In(e,t)}}function In(e,t){if(1!=t.text.length||""!=t.text[0]||0!=za(t.from,t.to)){var n=Sn(e,t);lr(e,t,n,e.cm?e.cm.curOp.id:NaN),Ln(e,t,n,ao(e,t));var o=[];Qo(e,function(e,n){n||-1!=Pr(o,e.history)||(vr(e.history,t),o.push(e.history)),Ln(e,t,null,ao(e,t))})}}function Nn(e,t,n){if(!(e.cm&&e.cm.state.suppressEdits)){for(var o=e.history,r=e.sel,a="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,d=0,l;de.lastLine())){if(t.from.linea&&(t={from:t.from,to:qa(a,Jo(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=$o(e,t.from,t.to),n||(n=Sn(e,t)),e.cm?Rn(e.cm,t,o):Ko(e,t,o),Ie(e,n,Hi)}}function Rn(e,t,n){var o=e.doc,a=e.display,i=t.from,s=t.to,d=!1,l=i.line;e.options.lineWrapping||(l=tr(vo(Jo(o,i.line))),o.iter(l,s.line+1,function(e){if(e==a.maxLine)return d=!0,!0})),-1a.maxLineLength&&(a.maxLine=e,a.maxLineLength=t,a.maxLineChanged=!0,d=!1)}),d&&(e.curOp.updateMaxLine=!0)),o.frontier=ga(o.frontier,i.line),Ue(e,400);var c=t.text.length-(s.line-i.line)-1;t.full?Dt(e):i.line!=s.line||1!=t.text.length||zo(e.doc,t)?Dt(e,i.line,s.line+1,c):Mt(e,i.line,"text");var u=Nr(e,"changes"),h=Nr(e,"change");if(h||u){var m={from:i,to:s,text:t.text,removed:t.removed,origin:t.origin};h&&kr(e,"change",e,m),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(m)}e.display.selForContextMenu=null}function On(e,t,n,o,r){if(o||(o=n),0>za(o,n)){var a=o;o=n,n=a}"string"==typeof t&&(t=e.splitLines(t)),wn(e,{from:n,to:o,text:t,origin:r})}function Pn(e,t){if(!wr(e,"scrollCursorIntoView")){var n=e.display,o=n.sizer.getBoundingClientRect(),r=null;if(0>t.top+o.top?r=!0:t.bottom+o.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!Pa){var a=Hr("div","\u200B",null,"position: absolute; top: "+(t.top-n.viewOffset-je(e.display))+"px; height: "+(t.bottom-t.top+Ke(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(r),e.display.lineSpace.removeChild(a)}}}function _n(e,t,n,o){null==o&&(o=0);for(var r=0;5>r;r++){var a=!1,i=ht(e,t),s=n&&n!=t?ht(e,n):i,d=Mn(e,ga(i.left,s.left),ga(i.top,s.top)-o,va(i.left,s.left),va(i.bottom,s.bottom)+o),l=e.doc.scrollTop,p=e.doc.scrollLeft;if(null!=d.scrollTop&&(nn(e,d.scrollTop),1n&&(n=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:a.scroller.scrollTop,d=Xe(e),l={};r-n>d&&(r=n+d);var p=e.doc.height+qe(a),c=np-i;if(ns+d){var h=ga(n,(u?p:r)-d);h!=s&&(l.scrollTop=h)}var m=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:a.scroller.scrollLeft,g=Ge(e)-(e.options.fixedGutter?a.gutters.offsetWidth:0),f=o-t>g;return f&&(o=t+g),10>t?l.scrollLeft=0:tg+m-3&&(l.scrollLeft=o+(f?0:10)-g),l}function Fn(e,t,n){(null!=t||null!=n)&&Un(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Bn(e){Un(e);var t=e.getCursor(),n=t,o=t;e.options.lineWrapping||(n=t.ch?qa(t.line,t.ch-1):t,o=qa(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:o,margin:e.options.cursorScrollMargin,isCursor:!0}}function Un(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=mt(e,t.from),o=mt(e,t.to),r=Mn(e,ga(n.left,o.left),ga(n.top,o.top)-t.margin,va(n.right,o.right),va(n.bottom,o.bottom)+t.margin);e.scrollTo(r.scrollLeft,r.scrollTop)}}function Vn(e,t,n,o){var r=e.doc,a;null==n&&(n="add"),"smart"==n&&(r.mode.indent?a=He(e,t):n="prev");var s=e.options.tabSize,d=Jo(r,t),l=zi(d.text,null,s);d.stateAfter&&(d.stateAfter=null);var p=d.text.match(/^\s*/)[0],c;if(!o&&!/\S/.test(d.text))c=0,n="not";else if("smart"==n&&(c=r.mode.indent(a,d.text.slice(p.length),d.text),c==Wi||150r.first?c=zi(Jo(r,t-1).text,null,s):c=0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=va(0,c);var u="",h=0;if(e.options.indentWithTabs)for(var m=fa(c/s);m;--m)h+=s,u+="\t";if(h=za(a.from,Or(o).to);){var i=o.pop();if(0>za(i.from,a.from)){a.from=i.from;break}}o.push(a)}At(e,function(){for(var t=o.length-1;0<=t;t--)On(e.doc,"",o[t].from,o[t].to,"+delete");Bn(e)})}function jn(e,t,n,o,r){function a(){var t=s+n;return t=e.first+e.size?!1:(s=t,p=Jo(e,t))}function i(e){var t=(r?ca:ua)(p,d,n,!0);if(null!=t)d=t;else if(!e&&a())d=r?(0>n?ra:oa)(p):0>n?p.text.length:0;else return!1;return!0}var s=t.line,d=t.ch,l=n,p=Jo(e,s);if("char"==o)i();else if("column"==o)i(!0);else if("word"==o||"group"==o)for(var c=null,u="group"==o,h=e.cm&&e.cm.getHelper(t,"wordChars"),m=!0;;m=!1){if(0>n&&!i(!m))break;var g=p.text.charAt(d)||"\n",f=Ur(g,h)?"w":u&&"\n"==g?"n":!u||/\s/.test(g)?null:"p";if(!u||m||f||(f="s"),c&&c!=f){0>n&&(n=1,i());break}if(f&&(c=f),0n?1.5:.5)*bt(e.display))}else"line"==o&&(i=0n?0>=i:i>=r.height){d.hitSide=!0;break}i+=5*n}return d}function zn(t,n,o,r){e.defaults[t]=n,o&&(si[t]=r?function(e,t,n){n!=di&&o(e,t,n)}:o)}function Kn(e){for(var t=e.split(/-(?!$)/),e=t[t.length-1],n=0,o,r,a,i,s;n=t:a.to>t);(r||(r=[])).push(new Zn(i,a.from,d?null:a.to))}}return r}function ro(e,t,n){if(e)for(var o=0,r;o=t:a.to>t);if(s||a.from==t&&"bookmark"==i.type&&(!n||a.marker.insertLeft)){var d=null==a.from||(i.inclusiveLeft?a.from<=t:a.fromza(l.to,s.from)||0c)&&(i.inclusiveLeft||c)||p.push({from:l.from,to:s.from}),!(0mo(o,a.marker))&&(o=a.marker);return o}function fo(e){return go(e,!0)}function yo(e){return go(e,!1)}function bo(e,t,n,o,r){var a=Jo(e,t),s=ja&&a.markedSpans;if(s)for(var d=0,i;d=c||0>=p&&0<=c)&&(0>=p&&(0za(l.from,o)||i.marker.inclusiveLeft&&r.inclusiveRight)))return!0}}function vo(e){for(var t;t=fo(e);)e=t.find(-1,!0).line;return e}function xo(e){for(var t,n;t=yo(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Co(e,t){var n=Jo(e,t),o=vo(n);return n==o?t:tr(o)}function So(e,t){if(t>e.lastLine())return t;var n=Jo(e,t),o;if(!Eo(e,n))return t;for(;o=yo(n);)n=o.find(1,!0).line;return tr(n)+1}function Eo(e,t){var n=ja&&t.markedSpans;if(n)for(var o=0,r;oa;a++){r&&(r[0]=e.innerMode(t,o).mode);var i=t.token(n,o);if(n.pos>n.start)return i}throw new Error("Mode "+t.name+" failed to advance stream.")}function Po(e,t,n,o){function r(e){return{start:p.start,end:p.pos,string:p.current(),type:s||null,state:e?mi(a.mode,l):l}}var a=e.doc,i=a.mode,s;t=ge(a,t);var d=Jo(a,t.line),l=He(e,t.line,n),p=new Ci(d.text,e.options.tabSize),c;for(o&&(c=[]);(o||p.pose.options.maxHighlightLength?(s=!1,i&&Fo(e,t,o,p.pos),p.pos=t.length,u=null):u=Lo(Oo(n,p,o,c),a),c){var h=c[0].name;h&&(u="m-"+(u?h+" "+u:h))}if(!s||l!=u){for(;de&&a.splice(l,1,e,a[l+1],r),l+=2,i=ga(e,r);if(t)if(o.opaque)a.splice(n,l-n,e,"cm-overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength?mi(e.doc.mode,o):o);t.stateAfter=o,t.styles=r.styles,r.classes?t.styleClasses=r.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Fo(e,t,n,o){var r=e.doc.mode,a=new Ci(t,e.options.tabSize);for(a.start=a.pos=o||0,""==t&&Ro(r,n);!a.eol();)Oo(r,a,n),a.start=a.pos}function Bo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Ni:Ii;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Uo(e,t){var n=Hr("span",null,null,Ia?"padding-right: .1px":null),o={pre:Hr("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,splitSpaces:(Ta||Ia)&&e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var a=r?t.rest[r-1]:t.line,i;o.pos=0,o.addToken=Vo,$r(e.display.measure)&&(i=rr(a))&&(o.addToken=Ho(o.addToken,i)),o.map=[];var s=t!=e.display.externalMeasured&&tr(a);qo(a,o,Mo(e,a,s)),a.styleClasses&&(a.styleClasses.bgClass&&(o.bgClass=Gr(a.styleClasses.bgClass,o.bgClass||"")),a.styleClasses.textClass&&(o.textClass=Gr(a.styleClasses.textClass,o.textClass||""))),0==o.map.length&&o.map.push(0,0,o.content.appendChild(Jr(e.display.measure))),0==r?(t.measure.map=o.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(o.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return Ia&&/\bcm-tab\b/.test(o.content.lastChild.className)&&(o.content.className="cm-tab-wrap-hack"),Bi(e,"renderLine",e,t.line,o.pre),o.pre.className&&(o.textClass=Gr(o.pre.className,o.textClass||"")),o}function Vo(e,t,n,o,r,a,i){if(t){var s=e.splitSpaces?t.replace(/ {3,}/g,Wo):t,d=e.cm.state.specialChars,l=!1;if(!d.test(t)){e.col+=t.length;var p=document.createTextNode(s);e.map.push(e.pos,e.pos+t.length,p),Ta&&9>wa&&(l=!0),e.pos+=t.length}else for(var p=document.createDocumentFragment(),c=0;;){d.lastIndex=c;var u=d.exec(t),h=u?u.index-c:t.length-c;if(h){var g=document.createTextNode(s.slice(c,c+h));Ta&&9>wa?p.appendChild(Hr("span",[g])):p.appendChild(g),e.map.push(e.pos,e.pos+h,g),e.col+=h,e.pos+=h}if(!u)break;if(c+=h+1,"\t"==u[0]){var f=e.cm.options.tabSize,y=f-e.col%f,g=p.appendChild(Hr("span",Rr(y),"cm-tab"));g.setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=y}else if("\r"==u[0]||"\n"==u[0]){var g=p.appendChild(Hr("span","\r"==u[0]?"\u240D":"\u2424","cm-invalidchar"));g.setAttribute("cm-text",u[0]),e.col+=1}else{var g=e.cm.options.specialCharPlaceholder(u[0]);g.setAttribute("cm-text",u[0]),Ta&&9>wa?p.appendChild(Hr("span",[g])):p.appendChild(g),e.col+=1}e.map.push(e.pos,e.pos+1,g),e.pos++}if(n||o||r||l||i){var b=n||"";o&&(b+=o),r&&(b+=r);var v=Hr("span",[p],b,i);return a&&(v.title=a),e.content.appendChild(v)}e.content.appendChild(p)}}function Wo(e){for(var t=" ",n=0;np&&i.from<=p));u++);if(i.to>=c)return e(n,o,r,a,s,d,l);e(n,o.slice(0,i.to-p),r,a,null,d,l),a=null,o=o.slice(i.to-p),p=i.to}}}function jo(e,t,n,o){var r=!o&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!o&&e.cm.display.input.needsContentAttribute&&(!r&&(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t}function qo(e,t,n){var o=e.markedSpans,r=e.text,a=0;if(!o){for(var s=1;sd||E.collapsed&&S.to==d&&S.from==d)?(null!=S.to&&S.to!=d&&p>S.to&&(p=S.to,g=""),E.className&&(h+=" "+E.className),E.css&&(u=(u?u+";":"")+E.css),E.startStyle&&S.from==d&&(f+=" "+E.startStyle),E.endStyle&&S.to==p&&(C||(C=[])).push(E.endStyle,S.to),E.title&&!y&&(y=E.title),E.collapsed&&(!b||0>mo(b.marker,E))&&(b=S)):S.from>d&&p>S.from&&(p=S.from)}if(C)for(var x=0;x=i)break;for(var m=ga(i,p);;){if(l){var k=d+l.length;if(!b){var T=k>m?l.slice(0,m-d):l;t.addToken(t,T,c?c+h:h,f,d+T.length==p?g:"",y,u)}if(k>=m){l=l.slice(m-d),d=m;break}d=k,f=""}l=r.slice(a,a=n[s++]),c=Bo(n[s++],t.cm.options)}}}function zo(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Or(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ko(e,t,o,n){function r(e){return o?o[e]:null}function a(e,o,r){No(e,o,r,n),kr(e,"change",e,t)}function i(e,t){for(var o=e,a=[];ot||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var o=0;;++o){var r=n.children[o],a=r.chunkSize();if(ta-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(i=dr(r,r.lastOp==o))){var s=Or(i.changes);0==za(t.from,t.to)&&0==za(t.from,s.to)?s.to=ai(t):i.changes.push(ir(e,t))}else{var d=Or(r.done);for(d&&d.ranges||ur(e.sel,r.done),i={changes:[ir(e,t)],generation:r.generation},r.done.push(i);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=o,r.lastOrigin=r.lastSelOrigin=t.origin,s||Bi(e,"historyAdded")}function pr(e,t,n,o){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==o.ranges.length&&n.somethingSelected()==o.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function cr(e,t,n,o){var r=e.history,a=o&&o.origin;n==r.lastSelOp||a&&r.lastSelOrigin==a&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==a||pr(e,a,Or(r.done),t))?r.done[r.done.length-1]=t:ur(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=a,r.lastSelOp=n,o&&!1!==o.clearRedo&&sr(r.undone)}function ur(e,t){var n=Or(t);n&&n.ranges&&n.equals(e)||t.push(e)}function hr(e,t,o,r){var a=t["spans_"+e.id],i=0;e.iter(va(e.first,o),ga(e.first+e.size,r),function(n){n.markedSpans&&((a||(a=t["spans_"+e.id]={}))[i]=n.markedSpans),++i})}function mr(e){if(!e)return null;for(var t=0,n;t=t.offsetWidth&&2wa))}var n=ls?Hr("span","\u200B"):Hr("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function $r(e){if(null!=ps)return ps;var t=qr(e,document.createTextNode("A\u062EA")),n=$i(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var o=$i(t,1,2).getBoundingClientRect();return ps=3>o.right-n.right}function Zr(e){if(null!=ss)return ss;var t=qr(e,Hr("span","x")),n=t.getBoundingClientRect(),o=$i(t,0,1).getBoundingClientRect();return ss=1t||t==n&&i.to==t)&&(o(va(i.from,t),ga(i.to,n),1==i.level?"rtl":"ltr"),r=!0);r||o(t,n,"ltr")}function ta(e){return e.level%2?e.to:e.from}function na(e){return e.level%2?e.from:e.to}function oa(e){var t=rr(e);return t?ta(t[0]):0}function ra(e){var t=rr(e);return t?na(Or(t)):e.text.length}function aa(e,t){var n=Jo(e.doc,t),o=vo(n);o!=n&&(t=tr(o));var r=rr(o),a=r?r[0].level%2?ra(o):oa(o):0;return qa(t,a)}function ia(e,t){for(var n=Jo(e.doc,t),o;o=yo(n);)n=o.find(1,!0).line,t=null;var r=rr(n),a=r?r[0].level%2?oa(n):ra(n):n.text.length;return qa(null==t?tr(n):t,a)}function sa(e,t){var n=aa(e,t.line),o=Jo(e.doc,n.line),r=rr(o);if(!r||0==r[0].level){var a=va(0,o.text.search(/\S/)),i=t.line==n.line&&t.ch<=a&&t.ch;return qa(n.line,i?0:a)}return n}function da(e,t,n){var o=e[0].level;return t==o||n!=o&&tt)return n;if(r.from==t||r.to==t)if(null==o)o=n;else return da(e,r.level,e[o].level)?(r.from!=r.to&&(us=o),n):(r.from!=r.to&&(us=n),o)}return o}function pa(e,t,n,o){if(!o)return t+n;do t+=n;while(0i.from&&sr||r>e.text.length?null:r}var ha=Math.abs,ma=String.fromCharCode,ga=Math.min,fa=Math.floor,ya=Math.round,ba=Math.ceil,va=Math.max,xa=navigator.userAgent,Ca=navigator.platform,Sa=/gecko\/\d/i.test(xa),Ea=/MSIE \d/.test(xa),ka=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xa),Ta=Ea||ka,wa=Ta&&(Ea?document.documentMode||6:ka[1]),Ia=/WebKit\//.test(xa),Na=Ia&&/Qt\/\d+\.\d+/.test(xa),Aa=/Chrome\//.test(xa),La=/Opera\//.test(xa),Ra=/Apple Computer/.test(navigator.vendor),Oa=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(xa),Pa=/PhantomJS/.test(xa),_a=/AppleWebKit/.test(xa)&&/Mobile\/\w+/.test(xa),Da=_a||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(xa),Ma=_a||/Mac/.test(Ca),Fa=/\bCrOS\b/.test(xa),Ba=/win/i.test(Ca),Ua=La&&xa.match(/Version\/(\d*\.\d*)/);Ua&&(Ua=+Ua[1]),Ua&&15<=Ua&&(La=!1,Ia=!0);var Va=Ma&&(Na||La&&(null==Ua||12.11>Ua)),Wa=Sa||Ta&&9<=wa,Ha=!1,ja=!1;m.prototype=Fr({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,o=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?o+"px":"0";var r=e.viewHeight-(t?o:0);this.vert.firstChild.style.height=va(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?o+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(n?o:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+a+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&0wa&&a.scrollbars.setScrollTop(a.scroller.scrollTop=d),null!=s.selectionStart){(!Ta||Ta&&9>wa)&&e();var t=0,n=function(){a.selForContextMenu==r.doc.sel&&0==s.selectionStart&&0t++?a.detectingSelectAll=setTimeout(n,500):a.input.reset()};a.detectingSelectAll=setTimeout(n,200)}}var o=this,r=o.cm,a=r.display,s=o.textarea,i=zt(r,t),d=a.scroller.scrollTop;if(i&&!La){var l=r.options.resetSelectionOnContextMenu;l&&-1==r.doc.sel.contains(i)&&Lt(r,we)(r.doc,he(i),Hi);var p=s.style.cssText,c=o.wrapper.style.cssText;o.wrapper.style.cssText="position: absolute";var u=o.wrapper.getBoundingClientRect();if(s.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(t.clientY-u.top-5)+"px; left: "+(t.clientX-u.left-5)+"px; z-index: 1000; background: "+(Ta?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Ia)var h=window.scrollY;if(a.input.focus(),Ia&&window.scrollTo(null,h),a.input.reset(),r.somethingSelected()||(s.value=o.prevInput=" "),o.contextMenuPending=!0,a.selForContextMenu=r.doc.sel,clearTimeout(a.detectingSelectAll),Ta&&9<=wa&&e(),Wa){Di(t);var m=function(){Fi(window,"mouseup",m),setTimeout(n,20)};Mi(window,"mouseup",m)}else setTimeout(n,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Dr,needsContentAttribute:!1},te.prototype),oe.prototype=Fr({init:function(e){function t(t){if(!wr(o,t)){if(o.somethingSelected())Ka=o.getSelections(),"cut"==t.type&&o.replaceSelection("",null,"cut");else{if(!o.options.lineWiseCopyCut)return;var e=Z(o);Ka=e.text,"cut"==t.type&&o.operation(function(){o.setSelections(e.ranges,0,Hi),o.replaceSelection("",null,"cut")})}if(t.clipboardData&&!_a)t.preventDefault(),t.clipboardData.clearData(),t.clipboardData.setData("text/plain",Ka.join("\n"));else{var n=ne(),r=n.firstChild;o.display.lineSpace.insertBefore(n,o.display.lineSpace.firstChild),r.value=Ka.join("\n");var a=document.activeElement;Xi(r),setTimeout(function(){o.display.lineSpace.removeChild(n),a.focus()},50)}}}var n=this,o=n.cm,r=n.div=e.lineDiv;ee(r),Mi(r,"paste",function(t){wr(o,t)||J(t,o)}),Mi(r,"compositionstart",function(t){var e=t.data;if(n.composing={sel:o.doc.sel,data:e,startData:e},!!e){var r=o.doc.sel.primary(),a=o.getLine(r.head.line),i=a.indexOf(e,va(0,r.head.ch-e.length));-1t.viewTo-1)return!1;var a;if(o.line==t.viewFrom||0==(a=Bt(e,o.line)))var i=tr(t.view[0].line),s=t.view[0].node;else var i=tr(t.view[a].line),s=t.view[a-1].node.nextSibling;var d=Bt(e,r.line);if(d==t.view.length-1)var l=t.viewTo-1,p=t.lineDiv.lastChild;else var l=tr(t.view[d+1].line)-1,p=t.view[d+1].node.previousSibling;for(var c=e.doc.splitLines(le(e,s,p,i,l)),u=$o(e.doc,qa(i,0),qa(l,Jo(e.doc,l).text.length));1=za(e,o.to()))return n;return-1}},ce.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return G(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Ga={left:0,right:0,top:0,bottom:0},Xa=null,Qa=0,Ya=0,Ja=0,$a=null,Za,ei,ti;Ta?$a=-.53:Sa?$a=15:Aa?$a=-.7:Ra&&($a=-1/3);var ni=function(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}};e.wheelEventPixels=function(t){var e=ni(t);return e.x*=$a,e.y*=$a,e};var oi=new Lr,ri=null,ai=e.changeEnd=function(e){return e.text?qa(e.from.line+e.text.length-1,Or(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,o=n[e];n[e]==t&&"mode"!=e||(n[e]=t,si.hasOwnProperty(e)&&Lt(this,si[e])(this,t,o))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Gn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Vn(this,r.head.line,e,!0),n=r.head.line,o==this.doc.sel.primIndex&&Bn(this))}),getTokenAt:function(e,t){return Po(this,e,t)},getLineTokens:function(e,t){return Po(this,qa(e),t,!0)},getTokenTypeAt:function(e){e=ge(this.doc,e);var t=Mo(this,Jo(this.doc,e.line)),n=0,o=(t.length-1)/2,r=e.ch,a;if(0==r)a=t[2];else for(;;){var i=n+o>>1;if((i?t[2*i-1]:0)>=r)o=i;else if(t[2*i+1]s?a:0==s?null:a.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!hi.hasOwnProperty(t))return n;var o=hi[t],r=this.getModeAt(e);if("string"==typeof r[t])o[r[t]]&&n.push(o[r[t]]);else if(r[t])for(var a=0,i;ar&&(e=r,n=!0),o=Jo(this.doc,e)}else o=e;return pt(this,o,{top:0,left:0},t||"page").top+(n?this.doc.height-or(o):0)},defaultTextHeight:function(){return bt(this.display)},defaultCharWidth:function(){return vt(this.display)},setGutterMarker:Rt(function(e,t,n){return Wn(this.doc,e,"gutter",function(e){var o=e.gutterMarkers||(e.gutterMarkers={});return o[t]=n,!n&&Vr(o)&&(e.gutterMarkers=null),!0})}),clearGutter:Rt(function(e){var t=this,n=t.doc,o=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,Mt(t,o,"gutter"),Vr(n.gutterMarkers)&&(n.gutterMarkers=null)),++o})}),lineInfo:function(e){if("number"==typeof e){if(!ye(this.doc,e))return null;var t=e;if(e=Jo(this.doc,e),!e)return null}else{var t=tr(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,o,r){var a=this.display;e=ht(this,ge(this.doc,e));var i=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),a.sizer.appendChild(t),"over"==o)i=e.top;else if("above"==o||"near"==o){var d=va(a.wrapper.clientHeight,this.doc.height),l=va(a.sizer.clientWidth,a.lineSpace.clientWidth);("above"==o||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?i=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(i=e.bottom),s+t.offsetWidth>l&&(s=l-t.offsetWidth)}t.style.top=i+"px",t.style.left=t.style.right="","right"==r?(s=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?s=0:"middle"==r&&(s=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&Dn(this,s,i,s+t.offsetWidth,i+t.offsetHeight)},triggerOnKeyDown:Rt(un),triggerOnKeyPress:Rt(gn),triggerOnKeyUp:mn,execCommand:function(e){if(fi.hasOwnProperty(e))return fi[e].call(null,this)},triggerElectric:Rt(function(e){$(this,e)}),findPosH:function(e,t,n,o){var r=1;0>t&&(r=-1,t=-t);for(var a=0,i=ge(this.doc,e);ae?o.from():o.to()},qi)}),deleteH:Rt(function(e,t){var n=this.doc.sel,o=this.doc;n.somethingSelected()?o.replaceSelection("",null,"+delete"):Hn(this,function(n){var r=jn(o,n.head,e,t,!1);return 0>e?{from:r,to:n.head}:{from:n.head,to:r}})}),findPosV:function(e,t,n,o){var r=1,a=o;0>t&&(r=-1,t=-t);for(var s=0,i=ge(this.doc,e),d;se?i.from():i.to();var s=ht(n,i.head,"div");null!=i.goalColumn&&(s.left=i.goalColumn),r.push(s.left);var d=qn(n,s,e,t);return"page"==t&&i==o.sel.primary()&&Fn(n,null,ut(n,d,"div").top-s.top),d},qi),r.length)for(var s=0;se.xRel||r==n.length)&&o?--o:++r;for(var i=n.charAt(o),s=Ur(i,a)?function(e){return Ur(e,a)}:/\s/.test(i)?function(e){return /\s/.test(e)}:function(e){return!/\s/.test(e)&&!Ur(e)};0e.doc.first){var i=Jo(e.doc,r.line-1).text;i&&e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+i.charAt(i.length-1),qa(r.line-1,i.length-1),qa(r.line,1),"+transpose")}n.push(new ce(r,r))}e.setSelections(n)})},newlineAndIndent:function(e){At(e,function(){for(var t=e.listSelections().length,n=0,o;n=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(-1e.display.maxLineLength&&(e.display.maxLine=d,e.display.maxLineLength=l,e.display.maxLineChanged=!0)}null!=o&&e&&this.collapsed&&Dt(e,o,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ae(e.doc)),e&&kr(e,"markerCleared",e,this),t&&St(e),this.parent&&this.parent.clear()}},Ei.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n=0,o,r;nthis.size-t&&(1=this.children.length)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Xo(t);if(!e.parent){var o=new Xo(e.children);o.parent=e,e.children=[o,n],e=o}else{e.size-=n.size,e.height-=n.height;var r=Pr(e.parent.children,e);e.parent.children.splice(r+1,0,n)}n.parent=e.parent}while(10=e.ch)&&t.push(r.marker.parent||r.marker);return t},findMarks:function(e,t,n){e=ge(this,e),t=ge(this,t);var o=[],r=e.line;return this.iter(e.line,t.line+1,function(a){var s=a.markedSpans;if(s)for(var d=0,i;d=i.to||null==i.from&&r!=e.line||null!=i.from&&r==t.line&&i.from>=t.ch||n&&!n(i.marker)||o.push(i.marker.parent||i.marker);++r}),o},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var o=0;oe?(o=e,!0):void(e-=a,++t)}),ge(this,qa(t,o))},indexFromPos:function(e){e=ge(this,e);var t=e.ch;if(e.linee.ch)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Li(Zo(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.toPr(Ri,Oi)&&(e.prototype[Oi]=function(e){return function(){return e.apply(this.doc,arguments)}}(Li.prototype[Oi]));Ar(Li);var Pi=e.e_preventDefault=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1},_i=e.e_stopPropagation=function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},Di=e.e_stop=function(t){Pi(t),_i(t)},Mi=e.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var o=e._handlers||(e._handlers={}),r=o[t]||(o[t]=[]);r.push(n)}},on=[],Fi=e.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else for(var o=Er(e,t,!1),r=0;rn||n>=t)return i+(t-s);i+=n-s,i+=o-i%o,s=n+1}},Ki=e.findColumn=function(e,t,n){for(var o=0,r=0,a;;){a=e.indexOf("\t",o),-1==a&&(a=e.length);var i=a-o;if(a==e.length||r+i>=t)return o+ga(i,t-r);if(r+=a-o,r+=n-r%n,o=a+1,r>=t)return o}},Gi=[""],Xi=function(e){e.select()};_a?Xi=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Ta&&(Xi=function(e){try{e.select()}catch(e){}});var Qi=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Yi=e.isWordChar=function(e){return /\w/.test(e)||"\x80"wa&&(zr=function(){try{return document.activeElement}catch(t){return document.body}});var es=e.rmClass=function(e,t){var n=e.className,o=Kr(t).exec(n);if(o){var r=n.slice(o.index+o[0].length);e.className=n.slice(0,o.index)+(r?o[1]+r:"")}},ts=e.addClass=function(e,t){var n=e.className;Kr(t).test(n)||(e.className+=(n?" ":"")+t)},ns=!1,os=function(){if(Ta&&9>wa)return!1;var e=Hr("div");return"draggable"in e||"dragDrop"in e}(),rs=e.splitLines=3=="\n\nb".split(/\n/).length?function(e){return e.split(/\r\n?|\n/)}:function(e){for(var t=0,n=[],o=e.length,r;t<=o;){r=e.indexOf("\n",t),-1==r&&(r=e.length);var a=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),i=a.indexOf("\r");-1==i?(n.push(a),t=r+1):(n.push(a.slice(0,i)),t+=i+1)}return n},as=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(t){}return t&&t.parentElement()==e&&0!=t.compareEndPoints("StartToEnd",t)},is=function(){var t=Hr("div");return!!("oncopy"in t)||(t.setAttribute("oncopy","return;"),"function"==typeof t.oncopy)}(),ss=null,ds=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ls,ps;(function(){for(var e=0;10>e;e++)ds[e+48]=ds[e+96]=e+"";for(var e=65;90>=e;e++)ds[e]=ma(e);for(var e=1;12>=e;e++)ds[e+111]=ds[e+63235]="F"+e})();var cs=function(){function e(e){return 247>=e?n.charAt(e):1424<=e&&1524>=e?"R":1536<=e&&1773>=e?o.charAt(e-1536):1774<=e&&2220>=e?"r":8192<=e&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",o="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,s=/[LRr]/,d=/[Lb1n]/,l=/[1n]/,p="L";return function(n){if(!r.test(n))return!1;for(var o=n.length,c=[],u=0,i;ua))for(u==t.line&&(m=t.ch-(0>n?1:0));m!=g;m+=n){var f=h.charAt(m);if(p.test(f)&&(void 0===o||e.getTokenTypeAt(i(u,m+1))==o)){var y=s[f];if(">"==y.charAt(1)==0document.documentMode),i=e.Pos,s={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},d=null;e.defineOption("matchBrackets",!1,function(t,n,o){o&&o!=e.Init&&t.off("cursorActivity",r),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",r))}),e.defineExtension("matchBrackets",function(){o(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,o){return t(this,e,n,o)}),e.defineExtension("scanForBracket",function(e,t,o,r){return n(this,e,t,o,r)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(n){n.state.failedTagMatch=!1,n.operation(function(){if(t(n),!n.somethingSelected()){var o=n.getCursor(),r=n.getViewport();r.from=Math.min(r.from,o.line),r.to=Math.max(o.line+1,r.to);var a=e.findMatchingTag(n,o,r);if(a){if(n.state.matchBothTags){var i="open"==a.at?a.open:a.close;i&&(n.state.tagHit=n.markText(i.from,i.to,{className:"CodeMirror-matchingtag"}))}var s="close"==a.at?a.open:a.close;s?n.state.tagOther=n.markText(s.from,s.to,{className:"CodeMirror-matchingtag"}):n.state.failedTagMatch=!0}}})}function o(e){e.state.failedTagMatch&&n(e)}e.defineOption("matchTags",!1,function(r,a,i){i&&i!=e.Init&&(r.off("cursorActivity",n),r.off("viewportChange",o),t(r)),a&&(r.state.matchBothTags="object"==typeof a&&a.bothTags,r.on("cursorActivity",n),r.on("viewportChange",o),n(r))}),e.commands.toMatchingTag=function(t){var n=e.findMatchingTag(t,t.getCursor());if(n){var o="close"==n.at?n.open:n.close;o&&t.extendSelection(o.to,o.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:u[t]}function n(e){return function(t){return d(t,e)}}function o(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function r(n){var r=o(n);if(!r||n.getOption("disableInput"))return e.Pass;for(var a=t(r,"pairs"),s=n.listSelections(),d=0;d=x.ch||n.getRange(h(x.line,x.ch-3),h(x.line,x.ch-2))!=r))C="addFour";else if(m){if(!e.isWordChar(i)&&c(n,x,r))C="both";else return e.Pass;}else if(f&&(n.getLine(x.line).length==x.ch||l(i,d)||/\s/.test(i)))C="both";else return e.Pass;if(!b)b=C;else if(b!=C)return e.Pass}var S=p%2?d.charAt(p-1):r,E=p%2?r:d.charAt(p+1);n.operation(function(){if("skip"==b)n.execCommand("goCharRight");else if("skipThree"==b)for(var e=0;3>e;e++)n.execCommand("goCharRight");else if("surround"==b){for(var t=n.getSelections(),e=0;e=n.ch+1)return /\bstring2?\b/.test(s);i.start=i.pos}}var u={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},h=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,o){o&&o!=e.Init&&(t.removeKeyMap(g),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(g))});for(var m=u.pairs+"`",g={Backspace:r,Enter:a},f=0;fi.ch&&(y=y.slice(0,y.length-p.end+i.ch));var b=y.toLowerCase();if(!y||"string"==p.type&&(p.end!=i.ch||!/[\"\']/.test(p.string.charAt(p.string.length-1))||1==p.string.length)||"tag"==p.type&&"closeTag"==u.type||p.string.indexOf("/")==p.string.length-1||g&&-1"+(v?"\n\n":"")+"",newPos:v?e.Pos(i.line+1,0):e.Pos(i.line,i.ch+1)}}for(var l=n.length-1,x;0<=l;l--){x=o[l],t.replaceRange(x.text,n[l].head,n[l].anchor,"+insert");var C=t.listSelections().slice(0);C[l]={head:x.newPos,anchor:x.newPos},t.setSelections(C),x.indent&&(t.indentLine(x.newPos.line,null,!0),t.indentLine(x.newPos.line+1,null,!0))}}function n(t,n){for(var o=t.listSelections(),r=[],s=n?"/":""!=t.getLine(i.line).charAt(l.end)&&(u+=">"),r[d]=u}t.replaceSelections(r),o=t.listSelections();for(var d=0;d'"]=function(e){return t(e)}),n.addKeyMap(i)}});var s=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],d=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return n(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.search(a);return-1==t?0:t}function n(e,t,n){return /\bstring\b/.test(e.getTokenTypeAt(s(t.line,0)))&&!/^[\'\"`]/.test(n)}var o=Math.min,r={},a=/[^\s\u00a0]/,s=e.Pos;e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=r);for(var t=this,n=Infinity,o=this.listSelections(),a=null,d=o.length-1;0<=d;d--){var i=o[d].from(),l=o[d].to();i.line>=n||(l.line>=n&&(l=s(n,0)),n=i.line,null==a?t.uncomment(i,l,e)?a="un":(t.lineComment(i,l,e),a="line"):"un"==a?t.uncomment(i,l,e):t.lineComment(i,l,e))}}),e.defineExtension("lineComment",function(e,i,d){d||(d=r);var l=this,p=l.getModeAt(e),c=l.getLine(e.line);if(!(null==c||n(l,e,c))){var u=d.lineComment||p.lineComment;if(!u)return void((d.blockCommentStart||p.blockCommentStart)&&(d.fullLines=!0,l.blockComment(e,i,d)));var h=o(0!=i.ch||i.line==e.line?i.line+1:i.line,l.lastLine()+1),m=null==d.padding?" ":d.padding,g=d.commentBlankLines||e.line==i.line;l.operation(function(){if(d.indent){for(var n=null,o=e.line;oi.length)&&(n=i)}for(var o=e.line;ou||d.operation(function(){if(!1!=n.fullLines){var o=a.test(d.getLine(u));d.replaceRange(h+c,s(u)),d.replaceRange(p+h,s(e.line,0));var r=n.blockCommentLead||l.blockCommentLead;if(null!=r)for(var m=e.line+1;m<=u;++m)(m!=u||o)&&d.replaceRange(r+h,s(m,0))}else d.replaceRange(c,t),d.replaceRange(p,e)})}),e.defineExtension("uncomment",function(e,t,n){n||(n=r);var d=this,l=d.getModeAt(e),p=o(0!=t.ch||t.line==e.line?t.line:t.line-1,d.lastLine()),c=o(e.line,p),u=n.lineComment||l.lineComment,h=[],m=null==n.padding?" ":n.padding,g;lineComment:{if(!u)break lineComment;for(var f=c;f<=p;++f){var i=d.getLine(f),y=i.indexOf(u);if(-1n||(t.slice(o,o+m.length)==m&&(o+=m.length),g=!0,d.replaceRange("",s(e,n),s(e,o)))}}),g)return!0}var b=n.blockCommentStart||l.blockCommentStart,v=n.blockCommentEnd||l.blockCommentEnd;if(!b||!v)return!1;var x=n.blockCommentLead||l.blockCommentLead,C=d.getLine(c),S=p==c?C:d.getLine(p),E=C.indexOf(b),k=S.lastIndexOf(v);if(-1==k&&c!=p&&(S=d.getLine(--p),k=S.lastIndexOf(v)),-1==E||-1==k||!/comment/.test(d.getTokenTypeAt(s(c,E+1)))||!/comment/.test(d.getTokenTypeAt(s(p,k+1))))return!1;var T=C.lastIndexOf(b,e.ch),w=-1==T?-1:C.slice(0,e.ch).indexOf(v,T+b.length);if(-1!=T&&-1!=w&&w+v.length!=e.ch)return!1;w=S.indexOf(v,t.ch);var I=S.slice(t.ch).lastIndexOf(b,w-t.ch);return(T=-1==w||-1==I?-1:t.ch+I,-1==w||-1==T||T==t.ch)&&(d.operation(function(){d.replaceRange("",s(p,k-(m&&S.slice(k-m.length,k)==m?m.length:0)),s(p,k+v.length));var e=E+b.length;if(m&&C.slice(e,e+m.length)==m&&(e+=m.length),d.replaceRange("",s(c,E),s(c,e)),x)for(var t=c+1;t<=p;++t){var n=d.getLine(t),o=n.indexOf(x);if(!(-1==o||a.test(n.slice(0,o)))){var r=o+x.length;m&&n.slice(r,r+m.length)==m&&(r+=m.length),d.replaceRange("",s(t,o),s(t,r))}}}),!0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(t){"use strict";function e(e,r,a,s){function i(t){var n=d(e,r);if(!n||n.to.line-n.from.linee.firstLine();)r=t.Pos(r.line-1,0),p=i(!1);if(p&&!p.cleared&&"unfold"!==s){var c=n(e,a);t.on(c,"mousedown",function(n){u.clear(),t.e_preventDefault(n)});var u=e.markText(p.from,p.to,{replacedWith:c,clearOnEnter:!0,__isFold:!0});u.on("clear",function(n,o){t.signal(e,"unfold",e,n,o)}),t.signal(e,"fold",e,p.from,p.to)}}function n(e,t){var n=o(e,t,"widget");if("string"==typeof n){var r=document.createTextNode(n);n=document.createElement("span"),n.appendChild(r),n.className="CodeMirror-foldmarker"}return n}function o(e,t,n){if(t&&t[n]!==void 0)return t[n];var o=e.options.foldOptions;return o&&void 0!==o[n]?o[n]:r[n]}t.newFoldFunction=function(t,n){return function(o,r){e(o,r,{rangeFinder:t,widget:n})}},t.defineExtension("foldCode",function(t,n,o){e(this,t,n,o)}),t.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;n=s&&(n=r(a.indicatorOpen))}e.setGutterMarker(t,a.gutter,n),++i})}function i(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){a(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function s(e,t,n){var r=e.state.foldGutter;if(r){var a=r.options;if(n==a.gutter){var i=o(e,t);i?i.clear():e.foldCode(c(t,0),a.rangeFinder)}}}function d(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){i(e)},n.foldOnChangeTimeSpan||600)}}function l(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||20t.to&&(a(e,t.to,n.to),t.to=n.to)})},n.updateViewportTimeSpan||400)}}function p(e,t){var n=e.state.foldGutter;if(n){var o=t.line;o>=n.from&&o=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function a(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function s(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t)if(r(e))continue;else return;if(!o(e,t+1)){e.ch=t+1;continue}var n=e.text.lastIndexOf("/",t),a=-1",e.ch-1):-1;if(-1==t)if(a(e))continue;else return;if(!o(e,t+1)){e.ch=t;continue}var n=e.text.lastIndexOf("/",t),r=-1p&&(!t||t==o[2]))return{tag:o[2],from:u(r,a),to:u(e.line,e.ch)}}else n.push(o[2])}}function c(e,t){for(var n=[];;){var o=p(e);if(!o)return;if("selfClose"==o){d(e);continue}var r=e.line,a=e.ch,s=d(e);if(!s)return;if(s[1])n.push(s[2]);else{for(var l=n.length-1;0<=l;--l)if(n[l]==s[2]){n.length=l;break}if(0>l&&(!t||t==s[2]))return{tag:s[2],from:u(e.line,e.ch),to:u(r,a)}}}}var u=e.Pos,h=/<(\/?)([A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD-:.0-9\u00B7\u0300-\u036F\u203F-\u2040]*)/g;e.registerHelper("fold","xml",function(e,t){for(var o=new n(e,t.line,0);;){var r=l(o),a;if(!r||o.line!=t.line||!(a=s(o)))return;if(!r[1]&&"selfClose"!=a){var t=u(o.line,o.ch),d=i(o,r[2]);return d&&{from:t,to:d.from}}}}),e.findMatchingTag=function(e,o,r){var a=new n(e,o.line,o.ch,r);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var l=s(a),p=l&&u(a.line,a.ch),h=l&&d(a);if(l&&h&&!(0s)d=l;else if(!/\S/.test(p));else break}if(d)return{from:e.Pos(n.line,r.length),to:e.Pos(d,t.getLine(d).length)}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerGlobalHelper("fold","comment",function(e){return e.blockCommentStart&&e.blockCommentEnd},function(t,n){var o=t.getModeAt(n),r=o.blockCommentStart,a=o.blockCommentEnd;if(r&&a){for(var s=n.line,d=t.getLine(s),l=n.ch,p=0,c,u;;){if(u=0>=l?-1:d.lastIndexOf(r,l-1),-1==u){if(1==p)return;p=1,l=d.length;continue}if(1==p&&uv&&(v=i.length),0>x&&(x=i.length),b=Math.min(v,x),b==i.length)break;if(b==v)++h;else if(! --h){g=y,f=b;break outer}++b}return null==g||s==g&&f==c?void 0:{from:e.Pos(s,c),to:e.Pos(g,f)}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(t){"use strict";var n=Math.min;t.registerHelper("fold","brace",function(e,o){function r(n){for(var r=o.ch,i=0,d;;){if(d=0>=r?-1:s.lastIndexOf(n,r-1),-1==d){if(1==i)break;i=1,r=s.length;continue}if(1==i&&db&&(b=i.length),0>v&&(v=i.length),y=n(b,v),y==i.length)break;if(e.getTokenTypeAt(t.Pos(f,y+1))==c)if(y==b)++u;else if(! --u){m=f,g=y;break outer}++y}return null==m||a==m&&g==p?void 0:{from:t.Pos(a,p),to:t.Pos(m,g)}}}),t.registerHelper("fold","import",function(o,e){function r(r){if(ro.lastLine())return null;var a=o.getTokenAt(t.Pos(r,1));if(/\S/.test(a.string)||(a=o.getTokenAt(t.Pos(r,a.end+1))),"keyword"!=a.type||"import"!=a.string)return null;for(var s=r,i=n(o.lastLine(),r+10);s<=i;++s){var e=o.getLine(s),d=e.indexOf(";");if(-1!=d)return{startCh:a.end,end:t.Pos(s,d)}}}var e=e.line,a=r(e),i;if(!a||r(e-1)||(i=r(e-2))&&i.end.line==e-1)return null;for(var s=a.end,d;;){if(d=r(s.line+1),null==d)break;s=d.end}return{from:o.clipPos(t.Pos(e,a.startCh+1)),to:s}}),t.registerHelper("fold","include",function(e,n){function o(n){if(ne.lastLine())return null;var o=e.getTokenAt(t.Pos(n,1));if(/\S/.test(o.string)||(o=e.getTokenAt(t.Pos(n,o.end+1))),"meta"==o.type&&"#include"==o.string.slice(0,8))return o.start+8}var n=n.line,r=o(n);if(null==r||null!=o(n-1))return null;for(var a=n,i;;){if(i=o(a+1),null==i)break;++a}return{from:t.Pos(n,r+1),to:e.clipPos(t.Pos(a))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),"cjs"):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],function(t){e(t,"amd")}):e(CodeMirror,"plain")}(function(e,t){function n(e,t){var n=t;return function(){0==--n&&e()}}function o(t,o){var r=e.modes[t].dependencies;if(!r)return o();for(var a=[],s=0;sS){d.style.height=S-5+"px",d.style.top=(v=y.bottom-E.top)+"px";var I=s.getCursor();t.from.ch!=I.ch&&(y=s.cursorCoords(I),d.style.left=(b=y.left)+"px",E=d.getBoundingClientRect())}}var N=E.right-C;if(0C&&(d.style.width=C-5+"px",N-=E.right-E.left-C),d.style.left=(b=y.left-N)+"px"),s.addKeyMap(this.keyMap=a(n,{moveFocus:function(e,t){o.changeActive(o.selectedHint+e,t)},setFocus:function(e){o.changeActive(e)},menuSize:function(){return o.screenAmount()},length:l.length,close:function(){n.close()},pick:function(){o.pick()},data:t})),n.options.closeOnUnfocus){var A;s.on("blur",this.onBlur=function(){A=setTimeout(function(){n.close()},100)}),s.on("focus",this.onFocus=function(){clearTimeout(A)})}var L=s.getScrollInfo();return s.on("scroll",this.onScroll=function(){var e=s.getScrollInfo(),t=s.getWrapperElement().getBoundingClientRect(),o=v+L.top-e.top,r=o-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return x||(r+=d.offsetHeight),r<=t.top||r>=t.bottom?n.close():void(d.style.top=o+"px",d.style.left=b+L.left-e.left+"px")}),e.on(d,"dblclick",function(n){var e=i(d,n.target||n.srcElement);e&&null!=e.hintId&&(o.changeActive(e.hintId),o.pick())}),e.on(d,"click",function(r){var e=i(d,r.target||r.srcElement);e&&null!=e.hintId&&(o.changeActive(e.hintId),n.options.completeOnSingleClick&&o.pick())}),e.on(d,"mousedown",function(){setTimeout(function(){s.focus()},20)}),e.signal(t,"select",l[0],d.firstChild),!0}function d(e,t){if(!e.somethingSelected())return t;for(var n=[],o=0;o=this.data.list.length?t=n?this.data.list.length-1:0:0>t&&(t=n?0:this.data.list.length-1),this.selectedHint!=t){var o=this.hints.childNodes[this.selectedHint];o.className=o.className.replace(" "+u,""),o=this.hints.childNodes[this.selectedHint=t],o.className+=" "+u,o.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=o.offsetTop+o.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,"select",this.data.list[this.selectedHint],o)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",{resolve:function(t,n){var o=t.getHelpers(n,"hint"),r;if(o.length){var a=function(e,t,n){function r(o){return o==a.length?t(null):void l(a[o],e,n,function(e){e&&0,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(t,n){for(var o=0,r=t.length;os.ch&&(d.end=s.ch,d.string=d.string.slice(0,s.ch-d.start)):d={start:s.ch,end:s.ch,string:"",state:d.state,type:"."==d.string?"property":null};for(var l=d;"property"==l.type;){if(l=o(t,i(s.line,l.start)),"."!=l.string)return;if(l=o(t,i(s.line,l.start)),!p)var p=[];p.push(l)}return{list:a(d,p,n,r),from:i(s.line,d.start),to:i(s.line,d.end)}}}function r(e,t){var n=e.getTokenAt(t);return t.ch==n.start+1&&"."==n.string.charAt(0)?(n.end=n.start,n.string=".",n.type="property"):/^\.[\w$_]*$/.test(n.string)&&(n.type="property",n.start++,n.string=n.string.replace(/\./,"")),n}function a(e,o,r,a){function i(e){0!=e.lastIndexOf(u,0)||n(c,e)||c.push(e)}function p(e){for(var n in"string"==typeof e?t(s,i):e instanceof Array?t(d,i):e instanceof Function&&t(l,i),e)i(n)}var c=[],u=e.string,h=a&&a.globalScope||window;if(o&&o.length){var m=o.pop(),g;for(m.type&&0===m.type.indexOf("variable")?(a&&a.additionalContext&&(g=a.additionalContext[m.string]),(!a||!1!==a.useGlobalScope)&&(g=g||h[m.string])):"string"==m.type?g="":"atom"==m.type?g=1:"function"==m.type&&(null!=h.jQuery&&("$"==m.string||"jQuery"==m.string)&&"function"==typeof h.jQuery?g=h.jQuery():null!=h._&&"_"==m.string&&"function"==typeof h._&&(g=h._()));null!=g&&o.length;)g=g[o.pop().string];null!=g&&p(g)}else{for(var f=e.state.localVars;f;f=f.next)i(f.name);for(var f=e.state.globalVars;f;f=f.next)i(f.name);a&&!1===a.useGlobalScope||p(h),t(r,i)}return c}var i=e.Pos;e.registerHelper("hint","javascript",function(e,t){return o(e,p,function(t,e){return t.getTokenAt(e)},t)}),e.registerHelper("hint","coffeescript",function(e,t){return o(e,c,r,t)});var s="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),d="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),l=["prototype","apply","call","bind"],p="break case catch continue debugger default delete do else false finally for function if in instanceof new null return switch throw true try typeof var void while with".split(" "),c="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t=Math.max,o=e.Pos;e.registerHelper("hint","xml",function(r,a){var s=a&&a.schemaInfo,d=a&&a.quoteChar||"\"";if(s){var l=r.getCursor(),p=r.getTokenAt(l);p.end>l.ch&&(p.end=l.ch,p.string=p.string.slice(0,l.ch-p.start));var c=e.innerMode(r.getMode(),p.state);if("xml"==c.mode.name){var u=[],h=!1,m=/\btag\b/.test(p.type)&&!/>$/.test(p.string),g=m&&/^\w/.test(p.string),f,y;if(g){var b=r.getLine(l.line).slice(t(0,p.start-2),p.start),v=/<\/$/.test(b)?"close":/<$/.test(b)?"open":null;v&&(y=p.start-("close"==v?2:1))}else m&&"<"==p.string?v="open":m&&"")}else{var C=s[c.state.tagName],k=C&&C.attrs,T=s["!attrs"];if(!k&&!T)return;if(!k)k=T;else if(T){var w={};for(var I in T)T.hasOwnProperty(I)&&(w[I]=T[I]);for(var I in k)k.hasOwnProperty(I)&&(w[I]=k[I]);k=w}if("string"==p.type||"="==p.string){var b=r.getRange(o(l.line,t(0,l.ch-60)),o(l.line,"string"==p.type?p.start:p.end)),N=b.match(/([^\s\u00a0=<>\"\']+)=$/),A;if(!N||!k.hasOwnProperty(N[1])||!(A=k[N[1]]))return;if("function"==typeof A&&(A=A.call(this,r)),"string"==p.type){f=p.string;var L=0;/['"]/.test(p.string.charAt(0))&&(d=p.string.charAt(0),f=p.string.slice(1),L++);var n=p.string.length;/['"]/.test(p.string.charAt(n-1))&&(d=p.string.charAt(n-1),f=p.string.substr(L,n-2)),h=!0}for(var E=0;E][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],l={attrs:{}},p={a:{attrs:{href:null,ping:null,type:null,media:d,target:o,hreflang:n}},abbr:l,acronym:l,address:l,applet:l,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:d,hreflang:n,type:null,shape:["default","rect","circle","poly"]}},article:l,aside:l,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:l,base:{attrs:{href:null,target:o}},basefont:l,bdi:l,bdo:l,big:l,blockquote:{attrs:{cite:null}},body:l,br:l,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:i,formmethod:a,formnovalidate:["","novalidate"],formtarget:o,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:l,center:l,cite:l,code:l,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:l,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:l,dir:l,div:l,dl:l,dt:l,em:l,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:l,figure:l,font:l,footer:l,form:{attrs:{action:null,name:null,"accept-charset":r,autocomplete:["on","off"],enctype:i,method:a,novalidate:["","novalidate"],target:o}},frame:l,frameset:l,h1:l,h2:l,h3:l,h4:l,h5:l,h6:l,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:l,hgroup:l,hr:l,html:{attrs:{manifest:null},children:["head","body"]},i:l,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:i,formmethod:a,formnovalidate:["","novalidate"],formtarget:o,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:l,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:l,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:n,media:d,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:l,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:r,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:l,noframes:l,noscript:l,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:l,param:{attrs:{name:null,value:null}},pre:l,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:l,rt:l,ruby:l,s:l,samp:l,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:r}},section:l,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:l,source:{attrs:{src:null,type:null,media:null}},span:l,strike:l,strong:l,style:{attrs:{type:["text/css"],media:d,scoped:null}},sub:l,summary:l,sup:l,table:l,tbody:l,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:l,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:l,time:{attrs:{datetime:null}},title:l,tr:l,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:n}},tt:l,u:l,ul:l,var:l,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:l},c={accesskey:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"],class:null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["en","es"],spellcheck:["true","false"],style:null,tabindex:["1","2","3","4","5","6","7","8","9"],title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"]};for(var u in t(l),p)p.hasOwnProperty(u)&&p[u]!=l&&t(p[u]);e.htmlSchema=p,e.registerHelper("hint","html",function(t,n){var o={schemaInfo:p};if(n)for(var r in n)o[r]=n[r];return e.hint.xml(t,o)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],e):e(CodeMirror)}(function(e){"use strict";var t={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};e.registerHelper("hint","css",function(n){function o(e){for(var t in e)l&&0!=t.lastIndexOf(l,0)||c.push(t)}var r=n.getCursor(),a=n.getTokenAt(r),i=e.innerMode(n.getMode(),a.state);if("css"==i.mode.name){if("keyword"==a.type&&0=="!important".indexOf(a.string))return{list:["!important"],from:e.Pos(r.line,a.start),to:e.Pos(r.line,a.end)};var s=a.start,d=r.ch,l=a.string.slice(0,d-s);/[^\w$_-]/.test(l)&&(l="",s=d=r.ch);var p=e.resolveMode("text/css"),c=[],u=i.state.state;if("pseudo"==u||"variable-3"==a.type?o(t):"block"==u||"maybeprop"==u?o(p.propertyKeywords):"prop"==u||"parens"==u||"at"==u||"params"==u?(o(p.valueKeywords),o(p.colorKeywords)):("media"==u||"media_parens"==u)&&(o(p.mediaTypes),o(p.mediaFeatures)),c.length)return{list:c,from:e.Pos(r.line,s),to:e.Pos(r.line,d)}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;te.lastLine())){var i=e.getLine(n.line),u=i.length-l[0].length;if(s(i.slice(u))==d[0]){for(var h=o(n.line,u),p=n.line+1,c=1;cn)--o;else return o}var o=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=o(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return t(0);r=o(r.line-1,this.doc.getLine(r.line-1).length)}else{var a=this.doc.lineCount();if(r.line==a-1)return t(a);r=o(r.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var r=e.splitLines(t);this.doc.replaceRange(r,this.pos.from,this.pos.to,n),this.pos.to=o(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,o){return new t(this.doc,e,n,o)}),e.defineDocExtension("getSearchCursor",function(e,n,o){return new t(this,e,n,o)}),e.defineExtension("selectMatches",function(t,n){for(var o=[],r=this.getSearchCursor(t,this.getCursor("from"),n);r.findNext()&&!(0n.line&&document.querySelector&&(o=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&o.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((l=o).style.opacity=.4)}))})}else s(t,y,"Search for:",d,function(e){e&&!a.query&&t.operation(function(){c(t,a,e),a.posFrom=a.posTo=t.getCursor(),h(t,n)})})}function h(t,n,r){t.operation(function(){var i=o(t),s=a(t,i.query,n?i.posFrom:i.posTo);!s.find(n)&&(s=a(t,i.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),!s.find(n))||(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),i.posFrom=s.from(),i.posTo=s.to(),r&&r(s.from(),s.to()))})}function m(e){e.operation(function(){var t=o(e);t.lastQuery=t.query;t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function g(e,t,n){e.operation(function(){for(var o=a(e,t);o.findNext();)if("string"!=typeof t){var r=e.getRange(o.from(),o.to()).match(t);o.replace(n.replace(/\$(\d)/g,function(e,t){return r[t]}))}else o.replace(n)})}function f(e,t){if(!e.getOption("readOnly")){var n=e.getSelection()||o(e).lastQuery,r=t?"Replace all:":"Replace:";s(e,r+b,r,n,function(n){n&&(n=p(n),s(e,v,"Replace with:","",function(o){if(o=l(o),t)g(e,n,o);else{m(e);var r=a(e,n,e.getCursor("from")),i=function(){var t=r.from(),l;!(l=r.findNext())&&(r=a(e,n),!(l=r.findNext())||t&&r.from().line==t.line&&r.from().ch==t.ch)||(e.setSelection(r.from(),r.to()),e.scrollIntoView({from:r.from(),to:r.to()}),d(e,x,"Replace?",[function(){s(l)},i,function(){g(e,n,o)}]))},s=function(e){r.replace("string"==typeof n?o:o.replace(/\$(\d)/g,function(t,n){return e[n]})),i()};i()}}))})}}var y="Search: (Use /re/ syntax for regexp search)",b=" (Use /re/ syntax for regexp search)",v="With: ",x="Replace? ";e.commands.find=function(e){m(e),u(e)},e.commands.findPersistent=function(e){m(e),u(e,!1,!0)},e.commands.findNext=u,e.commands.findPrev=function(e){u(e,!0)},e.commands.clearSearch=m,e.commands.replace=f,e.commands.replaceAll=function(e){f(e,!0)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(t){function e(e,t,n){var o=e.getWrapperElement(),r;return r=o.appendChild(document.createElement("div")),r.className=n?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?r.innerHTML=t:r.appendChild(t),r}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}t.defineExtension("openDialog",function(o,r,a){function i(e){if("string"==typeof e)p.value=e;else{if(d)return;d=!0,s.parentNode.removeChild(s),l.focus(),a.onClose&&a.onClose(s)}}a||(a={}),n(this,null);var s=e(this,o,a.bottom),d=!1,l=this,p=s.getElementsByTagName("input")[0],c;return p?(p.focus(),a.value&&(p.value=a.value,!1!==a.selectValueOnOpen&&p.select()),a.onInput&&t.on(p,"input",function(t){a.onInput(t,p.value,i)}),a.onKeyUp&&t.on(p,"keyup",function(t){a.onKeyUp(t,p.value,i)}),t.on(p,"keydown",function(n){a&&a.onKeyDown&&a.onKeyDown(n,p.value,i)||((27==n.keyCode||!1!==a.closeOnEnter&&13==n.keyCode)&&(p.blur(),t.e_stop(n),i()),13==n.keyCode&&r(p.value,n))}),!1!==a.closeOnBlur&&t.on(p,"blur",i)):(c=s.getElementsByTagName("button")[0])&&(t.on(c,"click",function(){i(),l.focus()}),!1!==a.closeOnBlur&&t.on(c,"blur",i),c.focus()),i}),t.defineExtension("openConfirm",function(o,r,a){function s(){p||(p=!0,d.parentNode.removeChild(d),c.focus())}n(this,null);var d=e(this,o,a&&a.bottom),l=d.getElementsByTagName("button"),p=!1,c=this,u=1;l[0].focus();for(var h=0,i;h=u&&s()},200)}),t.on(i,"focus",function(){++u})}),t.defineExtension("openNotification",function(o,r){function a(){s||(s=!0,clearTimeout(l),i.parentNode.removeChild(i))}n(this,a);var i=e(this,o,r&&r.bottom),s=!1,d=r&&"undefined"!=typeof r.duration?r.duration:5e3,l;return t.on(i,"click",function(n){t.e_preventDefault(n),a()}),d&&(l=setTimeout(a,d)),a})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,o,r){e.openDialog?e.openDialog(t,r,{value:o,selectValueOnOpen:!0}):r(prompt(n,o))}function n(e,t){var n=+t;return /^[-+]/.test(t)?e.getCursor().line+n:n-1}e.commands.jumpToLine=function(e){var o=e.getCursor();t(e,"Jump to line: (Use line:column or scroll% syntax)","Jump to line:",o.line+1+":"+o.ch,function(t){if(t){var r;if(r=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(n(e,r[1]),+r[2]);else if(r=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var a=Math.round(e.lineCount()*+r[1]/100);/^[-+]/.test(r[1])&&(a=o.line+a+1),e.setCursor(a-1,o.ch)}else(r=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(n(e,r[1]),o.ch)}})},e.keyMap["default"]["Alt-G"]="jumpToLine"}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(o,r){function a(e,t){function n(n){return t.tokenize=n,n(e,t)}var o=e.next();if("<"==o)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(d("atom","]]>")):null:e.match("--")?n(d("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(l(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=d("meta","?>"),"meta"):(w=e.eat("/")?"closeTag":"openTag",t.tokenize=i,"tag bracket");if("&"==o){var r;return r=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),r?"atom":"error"}return e.eatWhile(/[^&<]/),null}function i(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=a,w=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return w="equals",null;if("<"==n){t.tokenize=a,t.state=h,t.tagName=t.tagStart=null;var o=t.tokenize(e,t);return o?o+" tag error":"tag error"}return /[\'\"]/.test(n)?(t.tokenize=s(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function s(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=i;break}return"string"};return t.isInAttribute=!0,t}function d(e,t){return function(n,o){for(;!n.eol();){if(n.match(t)){o.tokenize=a;break}n.next()}return e}}function l(e){return function(t,n){for(var o;null!=(o=t.next());){if("<"==o)return n.tokenize=l(e+1),n.tokenize(t,n);if(">"==o)if(1==e){n.tokenize=a;break}else return n.tokenize=l(e-1),n.tokenize(t,n)}return"meta"}}function p(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(E.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function c(e){e.context&&(e.context=e.context.prev)}function u(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!E.contextGrabbers.hasOwnProperty(n)||!E.contextGrabbers[n].hasOwnProperty(t))return;c(e)}}function h(e,t,n){return"openTag"==e?(n.tagStart=t.column(),m):"closeTag"==e?g:h}function m(e,t,n){return"word"==e?(n.tagName=t.current(),I="tag",b):(I="error",m)}function g(e,t,n){if("word"==e){var o=t.current();return n.context&&n.context.tagName!=o&&E.implicitlyClosed.hasOwnProperty(n.context.tagName)&&c(n),n.context&&n.context.tagName==o||!1===E.matchClosing?(I="tag",f):(I="tag error",y)}return I="error",y}function f(e,t,n){return"endTag"==e?(c(n),h):(I="error",f)}function y(e,t,n){return I="error",f(e,t,n)}function b(e,t,n){if("word"==e)return I="attribute",v;if("endTag"==e||"selfcloseTag"==e){var o=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||E.autoSelfClosers.hasOwnProperty(o)?u(n,o):(u(n,o),n.context=new p(n,o,r==n.indented)),h}return I="error",b}function v(e,t,n){return"equals"==e?x:(E.allowMissing||(I="error"),b(e,t,n))}function x(e,t,n){return"string"==e?C:"word"==e&&E.allowUnquoted?(I="string",b):(I="error",b(e,t,n))}function C(e,t,n){return"string"==e?C:b(e,t,n)}var S=o.indentUnit,E={},k=r.htmlMode?t:n;for(var T in k)E[T]=k[T];for(var T in r)E[T]=r[T];var w,I;return a.isInText=!0,{startState:function(e){var t={tokenize:a,state:h,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;w=null;var n=t.tokenize(e,t);return(n||w)&&"comment"!=n&&(I=null,t.state=t.state(w||n,e,t),I&&(n="error"==I?n+" error":I)),n},indent:function(t,n,o){var r=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+S;if(r&&r.noIndent)return e.Pass;if(t.tokenize!=i&&t.tokenize!=a)return o?o.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1===E.multilineTagIndentPastTag?t.tagStart+S*(E.multilineTagIndentFactor||1):t.tagStart+t.tagName.length+2;if(E.alignCDATA&&/$/,blockCommentStart:"",configuration:E.htmlMode?"html":"xml",helperType:E.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=b)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){return /^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}e.defineMode("javascript",function(n,o){function r(e){for(var t=!1,n=!1,o;null!=(o=e.next());){if(!t){if("/"==o&&!n)return;"["==o?n=!0:n&&"]"==o&&(n=!1)}t=!t&&"\\"==o}}function a(e,t,n){return Pe=e,_e=n,t}function s(e,n){var o=e.next();if("\""==o||"'"==o)return n.tokenize=i(o),n.tokenize(e,n);if("."==o&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return a("number","number");if("."==o&&e.match(".."))return a("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(o))return a(o);if("="==o&&e.eat(">"))return a("=>","operator");if("0"==o&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),a("number","number");if("0"==o&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),a("number","number");if("0"==o&&e.eat(/b/i))return e.eatWhile(/[01]/i),a("number","number");if(/\d/.test(o))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),a("number","number");if("/"==o)return e.eat("*")?(n.tokenize=d,d(e,n)):e.eat("/")?(e.skipToEnd(),a("comment","comment")):t(e,n,1)?(r(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),a("regexp","string-2")):(e.eatWhile(Ie),a("operator","operator",e.current()));if("`"==o)return n.tokenize=l,l(e,n);if("#"==o)return e.skipToEnd(),a("error","error");if(Ie.test(o))return e.eatWhile(Ie),a("operator","operator",e.current());if(Te.test(o)){e.eatWhile(Te);var s=e.current(),p=we.propertyIsEnumerable(s)&&we[s];return p&&"."!=n.lastType?a(p.type,p.style,s):a("variable","variable",s)}}function i(e){return function(t,n){var o=!1,r;if(Se&&"@"==t.peek()&&t.match(Ne))return n.tokenize=s,a("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||o);)o=!o&&"\\"==r;return o||(n.tokenize=s),a("string","string")}}function d(e,t){for(var n=!1,o;o=e.next();){if("/"==o&&n){t.tokenize=s;break}n="*"==o}return a("comment","comment")}function l(e,t){for(var n=!1,o;null!=(o=e.next());){if(!n&&("`"==o||"$"==o&&e.eat("{"))){t.tokenize=s;break}n=!n&&"\\"==o}return a("quasi","string-2",e.current())}function p(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(0>n)){for(var o=0,r=!1,a=n-1;0<=a;--a){var i=e.string.charAt(a),s=Ae.indexOf(i);if(0<=s&&3>s){if(!o){++a;break}if(0==--o)break}else if(3<=s&&6>s)++o;else if(Te.test(i))r=!0;else{if(/["'\/]/.test(i))return;if(r&&!o){++a;break}}}r&&!o&&(t.fatArrowAt=a)}}function c(e,t,n,o,r,a){this.indented=e,this.column=t,this.type=n,this.prev=r,this.info=a,null!=o&&(this.align=o)}function u(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var o=e.context;o;o=o.prev)for(var n=o.vars;n;n=n.next)if(n.name==t)return!0}function h(e,t,n,o,r){var a=e.cc;for(Re.state=e,Re.stream=r,Re.marked=null,Re.cc=a,Re.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var i=a.length?a.pop():Ee?E:S;if(i(n,o)){for(;a.length&&a[a.length-1].lex;)a.pop()();return Re.marked?Re.marked:"variable"==n&&u(e,o)?"variable-2":t}}}function m(){for(var e=arguments.length-1;0<=e;e--)Re.cc.push(arguments[e])}function g(){return m.apply(null,arguments),!0}function f(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var n=Re.state;if(Re.marked="def",n.context){if(t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;o.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function y(){Re.state.context={prev:Re.state.context,vars:Re.state.localVars},Re.state.localVars=Oe}function b(){Re.state.localVars=Re.state.context.vars,Re.state.context=Re.state.context.prev}function v(e,t){var n=function(){var n=Re.state,o=n.indented;if("stat"==n.lexical.type)o=n.lexical.indented;else for(var r=n.lexical;r&&")"==r.type&&r.align;r=r.prev)o=r.indented;n.lexical=new c(o,Re.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function x(){var e=Re.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function C(e){function t(n){return n==e?g():";"==e?m():g(t)}return t}function S(e,t){return"var"==e?g(v("vardef",t.length),X,C(";"),x):"keyword a"==e?g(v("form"),E,S,x):"keyword b"==e?g(v("form"),S,x):"{"==e?g(v("}"),q,x):";"==e?g():"if"==e?("else"==Re.state.lexical.info&&Re.state.cc[Re.state.cc.length-1]==x&&Re.state.cc.pop()(),g(v("form"),E,S,x,Z)):"function"==e?g(ae):"for"==e?g(v("form"),ee,S,x):"variable"==e?g(v("stat"),F):"switch"==e?g(v("form"),E,v("}","switch"),C("{"),q,x,x):"case"==e?g(E,C(":")):"default"==e?g(C(":")):"catch"==e?g(v("form"),y,C("("),ie,C(")"),S,x,b):"class"==e?g(v("form"),se,x):"export"==e?g(v("stat"),ce,x):"import"==e?g(v("stat"),ue,x):"module"==e?g(v("form"),Q,v("}"),C("{"),q,x,x):m(v("stat"),E,C(";"),x)}function E(e){return T(e,!1)}function k(e){return T(e,!0)}function T(e,t){if(Re.state.fatArrowAt==Re.stream.start){var n=t?P:O;if("("==e)return g(y,v(")"),H(Q,")"),x,C("=>"),n,b);if("variable"==e)return m(y,Q,C("=>"),n,b)}var o=t?A:N;return Le.hasOwnProperty(e)?g(o):"function"==e?g(ae,o):"keyword c"==e?g(t?I:w):"("==e?g(v(")"),w,be,C(")"),x,o):"operator"==e||"spread"==e?g(t?k:E):"["==e?g(v("]"),fe,x,o):"{"==e?j(U,"}",null,o):"quasi"==e?m(L,o):"new"==e?g(_(t)):g()}function w(e){return e.match(/[;\}\)\],]/)?m():m(E)}function I(e){return e.match(/[;\}\)\],]/)?m():m(k)}function N(e,t){return","==e?g(E):A(e,t,!1)}function A(e,t,n){var o=!1==n?N:A,r=!1==n?E:k;return"=>"==e?g(y,n?P:O,b):"operator"==e?/\+\+|--/.test(t)?g(o):"?"==t?g(E,C(":"),r):g(r):"quasi"==e?m(L,o):";"==e?void 0:"("==e?j(k,")","call",o):"."==e?g(B,o):"["==e?g(v("]"),w,C("]"),x,o):void 0}function L(e,t){return"quasi"==e?"${"==t.slice(t.length-2)?g(E,R):g(L):m()}function R(e){if("}"==e)return Re.marked="string-2",Re.state.tokenize=l,g(L)}function O(e){return p(Re.stream,Re.state),m("{"==e?S:E)}function P(e){return p(Re.stream,Re.state),m("{"==e?S:k)}function _(e){return function(t){return"."==t?g(e?M:D):m(e?k:E)}}function D(e,t){if("target"==t)return Re.marked="keyword",g(N)}function M(e,t){if("target"==t)return Re.marked="keyword",g(A)}function F(e){return":"==e?g(x,S):m(N,C(";"),x)}function B(e){if("variable"==e)return Re.marked="property",g()}function U(e,t){return"variable"==e||"keyword"==Re.style?(Re.marked="property","get"==t||"set"==t?g(V):g(W)):"number"==e||"string"==e?(Re.marked=Se?"property":Re.style+" property",g(W)):"jsonld-keyword"==e?g(W):"modifier"==e?g(U):"["==e?g(E,C("]"),W):"spread"==e?g(E):void 0}function V(e){return"variable"==e?(Re.marked="property",g(ae)):m(W)}function W(e){return":"==e?g(k):"("==e?m(ae):void 0}function H(e,t){function n(o){if(","==o){var r=Re.state.lexical;return"call"==r.info&&(r.pos=(r.pos||0)+1),g(e,n)}return o==t?g():g(C(t))}return function(o){return o==t?g():m(e,n)}}function j(e,t,n){for(var o=3;o!?|~^]/,Ne=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ae="([{}])",Le={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Re={state:null,column:null,marked:null,cc:null},Oe={name:"this",next:{name:"arguments"}},Pe,_e;return x.lex=!0,{startState:function(e){var t={tokenize:s,lastType:"sof",cc:[],lexical:new c((e||0)-xe,0,"block",!1),localVars:o.localVars,context:o.localVars&&{vars:o.localVars},indented:e||0};return o.globalVars&&"object"==typeof o.globalVars&&(t.globalVars=o.globalVars),t},token:function(e,t){if(e.sol()&&(!t.lexical.hasOwnProperty("align")&&(t.lexical.align=!1),t.indented=e.indentation(),p(e,t)),t.tokenize!=d&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==Pe?n:(t.lastType="operator"==Pe&&("++"==_e||"--"==_e)?"incdec":Pe,h(t,n,Pe,_e,e))},indent:function(t,n){if(t.tokenize==d)return e.Pass;if(t.tokenize!=s)return 0;var r=n&&n.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(n))for(var l=t.cc.length-1,i;0<=l;--l)if(i=t.cc[l],i==x)a=a.prev;else if(i!=Z)break;"stat"==a.type&&"}"==r&&(a=a.prev),Ce&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var p=a.type,c=r==p;return"vardef"==p?a.indented+("operator"==t.lastType||","==t.lastType?a.info+1:0):"form"==p&&"{"==r?a.indented:"form"==p?a.indented+xe:"stat"==p?a.indented+(ve(t,n)?Ce||xe:0):"switch"!=a.info||c||!1==o.doubleIndentSwitch?a.align?a.column+(c?0:1):a.indented+(c?0:xe):a.indented+(/^(?:case|default)\b/.test(n)?xe:2*xe)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ee?null:"/*",blockCommentEnd:Ee?null:"*/",lineComment:Ee?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ee?"json":"javascript",jsonldMode:Se,jsonMode:Ee,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];(t==E||t==k)&&e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=0;n*\/]/.test(n)?o(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?o("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?o(null,n):"u"==n&&e.match(/rl(-prefix)?\(/)||"d"==n&&e.match("omain(")||"r"==n&&e.match("egexp(")?(e.backUp(1),t.tokenize=i,o("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),o("property","word")):o(null,null)}function a(e){return function(t,n){for(var r=!1,a;null!=(a=t.next());){if(a==e&&!r){")"==e&&t.backUp(1);break}r=!r&&"\\"==a}return a!=e&&(r||")"==e)||(n.tokenize=null),o("string","string")}}function i(e,t){return e.next(),t.tokenize=e.match(/\s*[\"\')]/,!1)?null:a(")"),o(null,"(")}function s(e,t,n){this.type=e,this.indent=t,this.prev=n}function d(e,t,n,o){return e.context=new s(n,t.indentation()+(!1===o?0:m),e.context),n}function l(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function p(e,t,n){return N[n.context.type](e,t,n)}function c(e,t,o,r){for(var n=r||1;0","i")}function a(e,t){for(var n in e)for(var o=t[n]||(t[n]=[]),r=e[n],a=r.length-1;0<=a;a--)o.unshift(r[a])}function i(e,t){for(var n=0,r;n\s\/]/.test(o.current())&&(u=a.htmlState.tagName&&a.htmlState.tagName.toLowerCase())&&p.hasOwnProperty(u))a.inTag=u+" ";else if(a.inTag&&c&&/>$/.test(o.current())){var h=/^([\S]+) (.*)/.exec(a.inTag);a.inTag=null;var m=">"==o.current()&&i(p[h[1]],h[2]),g=e.getMode(n,m),f=r(h[1],!0),y=r(h[1],!1);a.token=function(e,n){return e.match(f,!1)?(n.token=d,n.localState=n.localMode=null,null):t(e,y,n.localMode.token(e,n.localState))},a.localMode=g,a.localState=e.startState(g,l.indent(a.htmlState,""))}else a.inTag&&(a.inTag+=o.current(),o.eol()&&(a.inTag+=" "));return s}var l=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:o.multilineTagIndentFactor,multilineTagIndentPastTag:o.multilineTagIndentPastTag}),p={},c=o&&o.tags,u=o&&o.scriptTypes;if(a(s,p),c&&a(c,p),u)for(var h=u.length-1;0<=h;h--)p.script.unshift(["type",u[h].matches,u[h].mode]);return{startState:function(){var e=l.startState();return{token:d,inTag:null,localMode:null,localState:null,htmlState:e}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(l,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n){return!t.localMode||/^\s*<\//.test(n)?l.indent(t.htmlState,n):t.localMode.indent?t.localMode.indent(t.localState,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||l}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,o){if(0>o&&0==n.ch)return t.clipPos(u(n.line-1));var r=t.getLine(n.line);if(0=r.length)return t.clipPos(u(n.line+1,0));for(var a="start",s=n.ch,d=0>o?0:r.length,l=0,i;s!=d;s+=o,l++){var p=r.charAt(0>o?s-1:s),c="_"!=p&&e.isWordChar(p)?"w":"o";if("w"==c&&p.toUpperCase()==p&&(c="W"),"start"==a)"o"!=c&&(a="in",i=c);else if("in"==a&&i!=c){if("w"==i&&"W"==c&&0>o&&s--,"W"==i&&"w"==c&&0n?o.from():o.to()})}function o(t,n){return t.isReadOnly()?e.Pass:void t.operation(function(){for(var e=t.listSelections().length,o=[],r=-1,a=0,i;a=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},c[p[g+"Down"]="scrollLineDown"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},c[p["Shift-"+m+"L"]="splitSelectionByLine"]=function(e){for(var t=e.listSelections(),n=[],o=0;or.line&&i==a.line&&0==a.ch||n.push({anchor:i==r.line?r:u(i,0),head:i==a.line?a:u(i)});e.setSelections(n,0)},p["Shift-Tab"]="indentLess",c[p.Esc="singleSelectionTop"]=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},c[p[m+"L"]="selectLine"]=function(e){for(var t=e.listSelections(),n=[],o=0,r;or?o.push(d,l):o.length&&(o[o.length-1]=l),r=l}t.operation(function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+i,u(t.lastLine()),null,"+swapLine"):t.replaceRange(i+"\n",u(r,0),null,"+swapLine")}t.setSelections(a),t.scrollIntoView()})},c[p[y+"Down"]="swapLineDown"]=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),o=[],r=t.lastLine()+1,a=n.length-1;0<=a;a--){var i=n[a],s=i.to().line+1,d=i.from().line;0!=i.to().ch||i.empty()||s--,se.firstLine()&&e.addSelection(u(o.head.line-1,o.head.ch))})},c[p["Shift-Alt-Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0,o;n",type:"keyToKey",toKeys:"h"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"",type:"keyToKey",toKeys:"W"},{keys:"",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"",type:"keyToKey",toKeys:"w"},{keys:"",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"",type:"keyToKey",toKeys:"0"},{keys:"",type:"keyToKey",toKeys:"$"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r",type:"action",action:"replace",isEdit:!0},{keys:"@",type:"action",action:"replayMacro"},{keys:"q",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0}},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"",type:"action",action:"redo"},{keys:"m",type:"action",action:"setMark"},{keys:"\"",type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a",type:"motion",motion:"textObjectManipulation"},{keys:"i",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],d=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],l=t.Pos;t.Vim=function(){function i(e){e.setOption("disableInput",!0),e.setOption("showCursorWhenSelecting",!1),t.signal(e,"vim-mode-change",{mode:"normal"}),e.on("cursorActivity",tt),N(e),t.on(e.getInputField(),"paste",g(e))}function p(e){e.setOption("disableInput",!1),e.off("cursorActivity",tt),t.off(e.getInputField(),"paste",g(e)),e.state.vim=null}function c(e,n){this==t.keyMap.vim&&t.rmClass(e.getWrapperElement(),"cm-fat-cursor"),n&&n.attach==u||p(e,!1)}function u(e,n){this==t.keyMap.vim&&t.addClass(e.getWrapperElement(),"cm-fat-cursor"),n&&n.attach==u||i(e)}function h(e,n){if(n){if(this[e])return this[e];var o=m(e);if(!o)return!1;var r=t.Vim.findKey(n,o);return"function"==typeof r&&t.signal(n,"vim-keypress",o),r}}function m(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),n=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==n.length)return!1;for(var o=!1,r=0,a;r")}function g(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(B(e.getCursor(),0,1)),wt.enterInsertMode(e,{},t))}),t.onPasteFn}function f(e,t){for(var o=[],r=e;r=e.firstLine()&&t<=e.lastLine()}function b(e){return /^[a-z]$/.test(e)}function v(e){return-1!="()[]{}".indexOf(e)}function x(e){return pt.test(e)}function C(e){return /^[A-Z]$/.test(e)}function S(e){return /^\s*$/.test(e)}function E(e,t){for(var n=0;n"==t.slice(-11)){var n=t.length-11,o=e.slice(0,n),r=t.slice(0,n);return o==r&&e.length>n?"full":0==r.indexOf(o)&&"partial"}return e==t?"full":0==t.indexOf(e)&&"partial"}function H(e){var t=/^.*(<[\w\-]+>)$/.exec(e),n=t?t[1]:e.slice(-1);if(1":n="\n";break;case"":n=" ";break;default:}return n}function j(e,t,n){return function(){for(var o=0;op?u:0,m=r[h].anchor,g=o(m.line,i.line),f=a(m.line,i.line),y=m.ch,b=i.ch,v=r[h].head.ch-y,x=b-y;0=x?(y++,!s&&b--):0>v&&0<=x?(y--,!c&&b++):0>v&&-1==x&&(y--,b++);for(var C=g,S;C<=f;C++)S={anchor:new l(C,y),head:new l(C,b)},n.push(S);return p=i.line==f?n.length-1:0,e.setSelections(n),t.ch=b,m.ch=y,m}function te(e,t,n){for(var o=[],r=0,a;ru&&(s.line=u),s.ch=Y(e,s.line)}else s.ch=0,d.ch=Y(e,d.line);return{ranges:[{anchor:d,head:s}],primary:0}}if("block"==n){for(var h=o(d.line,s.line),m=o(d.ch,s.ch),g=a(d.line,s.line),f=a(d.ch,s.ch)+1,y=g-h+1,b=s.line==h?0:y-1,v=[],x=0;x=i.length)return null;o?d=ut[0]:(d=ct[0],!d(i.charAt(s))&&(d=ct[1]));for(var p=s,c=s;d(i.charAt(p))&&pc&&!f?f=!0:r=!1,u=d;u>p&&(r&&a(u)!=f&&u!=d||!s(u,-1,!0));u--);return i=new l(u,0),{start:i,end:h}}function ke(e,t,n,o){var r=t,a={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[n],i={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[n],s=e.getLine(r.line).charAt(r.ch),d=s===i?1:0,p,c;if(p=e.scanForBracket(l(r.line,r.ch+d),-1,null,{bracketRegex:a}),c=e.scanForBracket(l(r.line,r.ch+d),1,null,{bracketRegex:a}),!p||!c)return{start:r,end:r};if(p=p.pos,c=c.pos,p.line==c.line&&p.ch>c.ch||p.line>c.line){var u=p;p=c,c=u}return o?c.ch+=1:p.ch+=1,{start:p,end:c}}function Te(e,t,n,o){var r=q(t),a=e.getLine(r.line),s=a.split(""),d=s.indexOf(n),p,c,u,i;if(r.ch"+t+"",{bottom:!0,duration:5e3}):alert(t)}function Me(e,t){var n=""+(e||"")+"";return t&&(n+=" "+t+""),n}function Fe(e,t){var n=(t.prefix||"")+" "+(t.desc||""),o=Me(t.prefix,t.desc);Ne(e,o,n,t.onClose,t)}function Be(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var n=["global","multiline","ignoreCase","source"],o=0,r;o=t&&e<=n:e==t}function ze(e){var t=e.getScrollInfo(),n=e.coordsChar({left:0,top:6+t.top},"local"),o=t.clientHeight-10+t.top,r=e.coordsChar({left:0,top:o},"local");return{top:n.line,bottom:r.line}}function Ke(e,t,n){if("'"==n){var o=e.doc.history.done,r=o[o.length-2];return r&&r.ranges&&r.ranges[0].head}var a=t.marks[n];return a&&a.find()}function Ge(e,n,o,r,a,i,s,d,l){function p(){e.operation(function(){for(;!m;)c(),u();h()})}function c(){var t=e.getRange(i.from(),i.to()),n=t.replace(s,d);i.replace(n)}function u(){for(;i.findNext()&&qe(i.from(),r,a);)if(o||!g||i.from().line!=g.line)return e.scrollIntoView(i.from(),30),e.setSelection(i.from(),i.to()),g=i.from(),void(m=!1);m=!0}function h(t){if(t&&t(),e.focus(),g){e.setCursor(g);var n=e.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=g.ch}l&&l()}e.state.vim.exMode=!0;var m=!1,g=i.from();return u(),m?void De(e,"No matches for "+s.source):n?void Fe(e,{prefix:"replace with "+d+" (y/n/a/q/l)",onKeyDown:function(n,o,r){t.e_stop(n);var a=t.keyName(n);switch(a){case"Y":c(),u();break;case"N":u();break;case"A":var i=l;l=void 0,e.operation(p),l=i;break;case"L":c();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":h(r);}return m&&h(r),!0}}):(p(),void(l&&l()))}function Xe(e){var n=e.state.vim,o=Ct.macroModeState,r=Ct.registerController.getRegister("."),a=o.isPlaying,s=o.lastInsertModeChanges,d=[];if(!a){for(var l=s.inVisualBlock?n.lastSelection.visualBlock.height:1,p=s.changes,d=[],c=0;c|<\w+>|./.exec(i),c=p[0],i=i.substring(p.index+c.length),t.Vim.handleKey(e,c,"macro"),n.insertMode){var u=a.insertModeChanges[d++].changes;Ct.macroModeState.lastInsertModeChanges.changes=u,st(e,u,1),Xe(e)}o.isPlaying=!1}function Je(e,t){if(!e.isPlaying){var n=e.latestRegister,o=Ct.registerController.getRegister(n);o&&o.pushText(t)}}function $e(e){if(!e.isPlaying){var t=e.latestRegister,n=Ct.registerController.getRegister(t);n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}}function Ze(e,t){if(!e.isPlaying){var n=e.latestRegister,o=Ct.registerController.getRegister(n);o&&o.pushSearchQuery&&o.pushSearchQuery(t)}}function et(e,t){var n=Ct.macroModeState,o=n.lastInsertModeChanges;if(!n.isPlaying)for(;t;){if(o.expectCursorActivityForChange=!0,"+input"==t.origin||"paste"==t.origin||void 0===t.origin){var r=t.text.join("\n");o.maybeReset&&(o.changes=[],o.maybeReset=!1),o.changes.push(r)}t=t.next}}function tt(e){var t=e.state.vim;if(t.insertMode){var n=Ct.macroModeState;if(n.isPlaying)return;var o=n.lastInsertModeChanges;o.expectCursorActivityForChange?o.expectCursorActivityForChange=!1:o.maybeReset=!0}else e.curOp.isVimOp||ot(e,t);t.visualMode&&nt(e)}function nt(e){var t=e.state.vim,n=M(e,q(t.sel.head)),o=B(n,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(n,o,{className:"cm-animate-fat-cursor"})}function ot(e,n){var o=e.getCursor("anchor"),r=e.getCursor("head");if(n.visualMode&&!e.somethingSelected()?le(e,!1):!n.visualMode&&!n.insertMode&&e.somethingSelected()&&(n.visualMode=!0,n.visualLine=!1,t.signal(e,"vim-mode-change",{mode:"visual"})),n.visualMode){var a=K(r,o)?0:-1,i=K(r,o)?-1:0;r=B(r,0,a),o=B(o,0,i),n.sel={anchor:o,head:r},Ce(e,n,"<",G(r,o)),Ce(e,n,">",X(r,o))}else n.insertMode||(n.lastHPos=e.getCursor().ch)}function rt(e){this.keyName=e}function at(n){var e=Ct.macroModeState,o=e.lastInsertModeChanges,r=t.keyName(n);r&&(-1==r.indexOf("Delete")&&-1==r.indexOf("Backspace")||t.lookupKey(r,"vim-insert",function(){return o.maybeReset&&(o.changes=[],o.maybeReset=!1),o.changes.push(new rt(r)),!0}))}function it(e,t,n,o){function r(){d?Et.processAction(e,t,t.lastEditActionCommand):Et.evalInput(e,t)}function a(n){if(0"]),yt=[].concat(ht,mt,gt,["-","\"",".",":","/"]),bt={};k("filetype",void 0,"string",["ft"],function(e,t){if(void 0!==t){if(void 0===e){var n=t.getOption("mode");return"null"==n?"":n}var n=""==e?"null":e;t.setOption("mode",n)}});var vt=function(){var e=100,t=-1,n=0,o=0,r=Array(e);return{cachedCursor:void 0,add:function(a,i,s){function d(n){var o=++t%e,i=r[o];i&&i.clear(),r[o]=a.setBookmark(n)}var l=t%e,p=r[l];if(p){var c=p.find();c&&!z(c,i)&&d(i)}else d(i);d(s),n=t,o=t-e+1,0>o&&(o=0)},move:function(a,i){t+=i,t>n?t=n:to)}return s}}},xt=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};I.prototype={exitMacroRecordMode:function(){var e=Ct.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var n=Ct.registerController.getRegister(t);n&&(n.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var Ct,St;L.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},L.prototype.getRepeat=function(){var e=0;return(0=n.length?(this.iterator=n.length,this.initialPrefix):0>r?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);-1"==i.keys.slice(-11)&&(n.selectedCharacter=H(e)),{type:"full",command:i}},processCommand:function(e,t,n){switch(t.inputState.repeatOverride=n.repeatOverride,n.type){case"motion":this.processMotion(e,t,n);break;case"operator":this.processOperator(e,t,n);break;case"operatorMotion":this.processOperatorMotion(e,t,n);break;case"action":this.processAction(e,t,n);break;case"search":this.processSearch(e,t,n);break;case"ex":case"keyToEx":this.processEx(e,t,n);break;default:}},processMotion:function(e,t,n){t.inputState.motion=n.motion,t.inputState.motionArgs=F(n.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,n){var o=t.inputState;if(o.operator){if(o.operator==n.operator)return o.motion="expandToLine",o.motionArgs={linewise:!0},void this.evalInput(e,t);R(e)}o.operator=n.operator,o.operatorArgs=F(n.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var o=t.visualMode,r=F(n.operatorMotionArgs);r&&o&&r.visualLine&&(t.visualLine=!0),this.processOperator(e,t,n),o||this.processMotion(e,t,n)},processAction:function(e,t,n){var o=t.inputState,r=o.getRepeat(),a=F(n.actionArgs)||{};o.selectedCharacter&&(a.selectedCharacter=o.selectedCharacter),n.operator&&this.processOperator(e,t,n),n.motion&&this.processMotion(e,t,n),(n.motion||n.operator)&&this.evalInput(e,t),a.repeat=r||1,a.repeatIsExplicit=!!r,a.registerName=o.registerName,R(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,o,n),wt[n.action](e,a,t)},processSearch:function(n,e,r){function a(t,o,a){Ct.searchHistoryController.pushInput(t),Ct.searchHistoryController.reset();try{Ue(n,t,o,a)}catch(o){return De(n,"Invalid regex: "+t),void R(n)}Et.processMotion(n,e,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:r.searchArgs.toJumplist}})}function i(e){n.scrollTo(h.left,h.top),a(e,!0,!0);var t=Ct.macroModeState;t.isRecording&&Ze(t,e)}function s(r,e,a){var i=t.keyName(r),s,d;"Up"==i||"Down"==i?(s="Up"==i,d=r.target?r.target.selectionEnd:0,e=Ct.searchHistoryController.nextMatch(e,s)||"",a(e),d&&r.target&&(r.target.selectionEnd=r.target.selectionStart=o(d,r.target.value.length))):"Left"!=i&&"Right"!=i&&"Ctrl"!=i&&"Alt"!=i&&"Shift"!=i&&Ct.searchHistoryController.reset();var p;try{p=Ue(n,e,!0,!0)}catch(t){}p?n.scrollIntoView(He(n,!l,p),30):(je(n),n.scrollTo(h.left,h.top))}function d(o,e,r){var a=t.keyName(o);"Esc"==a||"Ctrl-C"==a||"Ctrl-["==a||"Backspace"==a&&""==e?(Ct.searchHistoryController.pushInput(e),Ct.searchHistoryController.reset(),Ue(n,u),je(n),n.scrollTo(h.left,h.top),t.e_stop(o),R(n),r(),n.focus()):"Up"==a||"Down"==a?t.e_stop(o):"Ctrl-U"==a&&(t.e_stop(o),r(""))}if(n.getSearchCursor){var l=r.searchArgs.forward,p=r.searchArgs.wholeWordOnly;Ie(n).setReversed(!l);var c=l?"/":"?",u=Ie(n).getQuery(),h=n.getScrollInfo();switch(r.searchArgs.querySrc){case"prompt":var m=Ct.macroModeState;if(m.isPlaying){var g=m.replaySearchQueries.shift();a(g,!0,!1)}else Fe(n,{onClose:i,prefix:c,desc:Rt,onKeyUp:s,onKeyDown:d});break;case"wordUnderCursor":var f=he(n,!1,!0,!1,!0),y=!0;if(f||(f=he(n,!1,!0,!1,!1),y=!1),!f)return;var g=n.getLine(f.start.line).substring(f.start.ch,f.end.ch);g=y&&p?"\\b"+g+"\\b":$(g),Ct.jumpList.cachedCursor=n.getCursor(),n.setCursor(f.start),a(g,!0,!1);}}},processEx:function(n,e,r){function a(e){Ct.exCommandHistoryController.pushInput(e),Ct.exCommandHistoryController.reset(),_t.processCommand(n,e)}function i(r,e,a){var i=t.keyName(r),s,d;("Esc"==i||"Ctrl-C"==i||"Ctrl-["==i||"Backspace"==i&&""==e)&&(Ct.exCommandHistoryController.pushInput(e),Ct.exCommandHistoryController.reset(),t.e_stop(r),R(n),a(),n.focus()),"Up"==i||"Down"==i?(t.e_stop(r),s="Up"==i,d=r.target?r.target.selectionEnd:0,e=Ct.exCommandHistoryController.nextMatch(e,s)||"",a(e),d&&r.target&&(r.target.selectionEnd=r.target.selectionStart=o(d,r.target.value.length))):"Ctrl-U"==i?(t.e_stop(r),a("")):"Left"!=i&&"Right"!=i&&"Ctrl"!=i&&"Alt"!=i&&"Shift"!=i&&Ct.exCommandHistoryController.reset()}"keyToEx"==r.type?_t.processCommand(n,r.exArgs.input):e.visualMode?Fe(n,{onClose:a,prefix:":",value:"'<,'>",onKeyDown:i}):Fe(n,{onClose:a,prefix:":",onKeyDown:i})},evalInput:function(t,n){var o=n.inputState,r=o.motion,a=o.motionArgs||{},s=o.operator,d=o.operatorArgs||{},p=o.registerName,c=n.sel,u=q(n.visualMode?M(t,c.head):t.getCursor("head")),h=q(n.visualMode?M(t,c.anchor):t.getCursor("anchor")),m=q(u),g=q(h),f,y,b;if(s&&this.recordLastEdit(n,o),b=void 0===o.repeatOverride?o.getRepeat():o.repeatOverride,0",K(y,f)?f:y)):!s&&(f=M(t,f),t.setCursor(f.line,f.ch))}if(s){if(d.lastSel){y=g;var S=d.lastSel,E=e(S.head.line-S.anchor.line),k=e(S.head.ch-S.anchor.ch);f=S.visualLine?l(g.line+E,g.ch):S.visualBlock?l(g.line+E,g.ch+k):S.head.line==S.anchor.line?l(g.line,g.ch+k):l(g.line+E,g.ch),n.visualMode=!0,n.visualLine=S.visualLine,n.visualBlock=S.visualBlock,c=n.sel={anchor:y,head:f},ie(t)}else n.visualMode&&(d.lastSel={anchor:q(c.anchor),head:q(c.head),visualBlock:n.visualBlock,visualLine:n.visualLine});var T,w,I,N,A;if(!n.visualMode){if(T=q(y||g),w=q(f||m),K(w,T)){var L=T;T=w,w=L}I=a.linewise||d.linewise,I?ce(t,T,w):a.forward&&pe(t,T,w),N="char";var O=!a.inclusive||I;A=se(t,{anchor:T,head:w},N,O)}else if(T=G(c.head,c.anchor),w=X(c.head,c.anchor),I=n.visualLine||d.linewise,N=n.visualBlock?"block":I?"line":"char",A=se(t,{anchor:T,head:w},N),I){var P=A.ranges;if("block"==N)for(var _=0;_p&&r.line==p?this.moveToEol(e,t,n,o):(n.toFirstChar&&(a=ue(e.getLine(s)),o.lastHPos=a),o.lastHSPos=e.charCoords(l(s,a),"div").left,l(s,a))},moveByDisplayLines:function(e,t,n,o){var r=t;switch(o.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:o.lastHSPos=e.charCoords(r,"div").left;}var a=n.repeat,i=e.findPosV(r,n.forward?a:-a,"line",o.lastHSPos);if(i.hitSide)if(n.forward)var s=e.charCoords(i,"div"),d={top:s.top+8,left:o.lastHSPos},i=e.coordsChar(d,"div");else{var p=e.charCoords(l(e.firstLine(),0),"div");p.left=o.lastHSPos,i=e.coordsChar(p,"div")}return o.lastHPos=i.ch,i},moveByPage:function(e,t,n){var o=n.repeat;return e.findPosV(t,n.forward?o:-o,"page")},moveByParagraph:function(e,t,n){var o=n.forward?1:-1;return Ee(e,t,n.repeat,o)},moveByScroll:function(e,t,n,o){var r=e.getScrollInfo(),a=null,i=n.repeat;i||(i=r.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");n.repeat=i;var a=kt.moveByDisplayLines(e,t,n,o);if(!a)return null;var d=e.charCoords(a,"local");return e.scrollTo(null,r.top+d.top-s.top),a},moveByWords:function(e,t,n){return be(e,t,n.repeat,!!n.forward,!!n.wordEnd,!!n.bigWord)},moveTillCharacter:function(e,t,n){var o=n.repeat,r=ve(e,o,n.forward,n.selectedCharacter),a=n.forward?-1:1;return(ge(a,n),!r)?null:(r.ch+=a,r)},moveToCharacter:function(e,t,n){var o=n.repeat;return ge(0,n),ve(e,o,n.forward,n.selectedCharacter)||t},moveToSymbol:function(e,t,n){var o=n.repeat;return fe(e,o,n.forward,n.selectedCharacter)||t},moveToColumn:function(e,t,n,o){var r=n.repeat;return o.lastHPos=r-1,o.lastHSPos=e.charCoords(t,"div").left,xe(e,r)},moveToEol:function(e,t,n,o){o.lastHPos=Infinity;var r=l(t.line+n.repeat-1,Infinity),a=e.clipPos(r);return a.ch--,o.lastHSPos=e.charCoords(a,"div").left,r},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return l(n.line,ue(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){var n=t,o=n.line,r=n.ch,a=e.getLine(o),i;do if(i=a.charAt(r++),i&&v(i)){var s=e.getTokenTypeAt(l(o,r));if("string"!==s&&"comment"!==s)break}while(i);if(i){var d=e.findMatchingBracket(l(o,r));return d.to}return n},moveToStartOfLine:function(e,t){return l(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var o=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(o=n.repeat-e.getOption("firstLineNumber")),l(o,ue(e.getLine(o)))},textObjectManipulation:function(e,t,n,o){var r=n.selectedCharacter;"b"==r?r="(":"B"==r&&(r="{");var a=!n.textObjectInner,i;if({"(":")",")":"(","{":"}","}":"{","[":"]","]":"["}[r])i=ke(e,t,r,a);else if({"'":!0,'"':!0}[r])i=Te(e,t,r,a);else if("W"===r)i=he(e,a,!0,!0);else if("w"===r)i=he(e,a,!0,!1);else{if("p"!==r)return null;if(i=Ee(e,t,n.repeat,0,a),n.linewise=!0,o.visualMode)o.visualLine||(o.visualLine=!0);else{var s=o.inputState.operatorArgs;s&&(s.linewise=!0),i.end.line--}}return e.state.vim.visualMode?ae(e,i.start,i.end):[i.start,i.end]},repeatLastCharacterSearch:function(e,t,n){var o=Ct.lastCharacterSearch,r=n.repeat,a=n.forward===o.forward,i=(o.increment?1:0)*(a?-1:1);e.moveH(-i,"char"),n.inclusive=!!a;var s=ve(e,r,a,o.selectedCharacter);return s?(s.ch+=i,s):(e.moveH(i,"char"),t)}},Tt={change:function(e,n,o){var r=Number.MAX_VALUE,a=e.state.vim,i,s;if(Ct.macroModeState.lastInsertModeChanges.inVisualBlock=a.visualBlock,!a.visualMode){var d=o[0].anchor,p=o[0].head;s=e.getRange(d,p);var c=a.lastEditInputState||{};if("moveByWords"==c.motion&&!S(s)){var u=/\s+$/.exec(s);u&&c.motionArgs&&c.motionArgs.forward&&(p=B(p,0,-u[0].length),s=s.slice(0,-u[0].length))}var h=new l(d.line-1,r),m=e.firstLine()==e.lastLine();p.line>e.lastLine()&&n.linewise&&!m?e.replaceRange("",h,p):e.replaceRange("",d,p),n.linewise&&(!m&&(e.setCursor(h),t.commands.newlineAndIndent(e)),d.ch=r),i=d}else{s=e.getSelection();var g=D("",o.length);e.replaceSelections(g),i=G(o[0].head,o[0].anchor)}Ct.registerController.pushText(n.registerName,"change",s,n.linewise,1p.top?(l.line+=(d-p.top)/a,l.line=Math.ceil(l.line),e.setCursor(l),p=e.charCoords(l,"local"),e.scrollTo(null,p.top)):e.scrollTo(null,d);else{var c=d+e.getScrollInfo().clientHeight;c=d.anchor.line?p=B(d.head,0,1):p=l(d.anchor.line,0);else if("inplace"==s&&i.visualMode)return;n.setOption("disableInput",!1),r&&r.replace?(n.toggleOverwrite(!0),n.setOption("keyMap","vim-replace"),t.signal(n,"vim-mode-change",{mode:"replace"})):(n.toggleOverwrite(!1),n.setOption("keyMap","vim-insert"),t.signal(n,"vim-mode-change",{mode:"insert"})),Ct.macroModeState.isPlaying||(n.on("change",et),t.on(n.getInputField(),"keydown",at)),i.visualMode&&le(n),te(n,p,c)}},toggleVisualMode:function(e,n,o){var r=n.repeat,a=e.getCursor(),i;o.visualMode?o.visualLine^n.linewise||o.visualBlock^n.blockwise?(o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,t.signal(e,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ie(e)):le(e):(o.visualMode=!0,o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,i=M(e,l(a.line,a.ch+r-1),!0),o.sel={anchor:a,head:i},t.signal(e,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ie(e),Ce(e,o,"<",G(a,i)),Ce(e,o,">",X(a,i)))},reselectLastSelection:function(e,n,o){var r=o.lastSelection;if(o.visualMode&&re(e,o),r){var a=r.anchorMark.find(),i=r.headMark.find();if(!a||!i)return;o.sel={anchor:a,head:i},o.visualMode=!0,o.visualLine=r.visualLine,o.visualBlock=r.visualBlock,ie(e),Ce(e,o,"<",G(a,i)),Ce(e,o,">",X(a,i)),t.signal(e,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""})}},joinLines:function(e,t,n){var o,r;if(n.visualMode){if(o=e.getCursor("anchor"),r=e.getCursor("head"),K(r,o)){var s=r;r=o,o=s}r.ch=Y(e,r.line)-1}else{var d=a(t.repeat,2);o=e.getCursor(),r=M(e,l(o.line+d-1,Infinity))}for(var p=0,c=o.line;cn)return"";if(e.getOption("indentWithTabs")){var o=r(n/d);return Array(o+1).join("\t")}return Array(n+1).join(" ")});s+=m?"\n":""}if(1e.lastLine()&&e.replaceRange("\n",l(I,0));var N=Y(e,I);Np.length&&(s=p.length),d=l(a.line,s)}if("\n"==r)o.visualMode||e.replaceRange("",a,d),(t.commands.newlineAndIndentContinueComment||t.commands.newlineAndIndent)(e);else{var c=e.getRange(a,d);if(c=c.replace(/[^\n]/g,r),o.visualBlock){var u=Array(e.getOption("tabSize")+1).join(" ");c=e.getSelection(),c=c.replace(/\t/g,u).replace(/[^\n]/g,r).split("\n"),e.replaceSelections(c)}else e.replaceRange(c,a,d);o.visualMode?(a=K(i[0].anchor,i[0].head)?i[0].anchor:i[0].head,e.setCursor(a),le(e,!1)):e.setCursor(B(d,0,-1))}},incrementNumberToken:function(e,t){for(var n=e.getCursor(),o=e.getLine(n.line),r=/-?\d+/g,a,i,s,d,p;null!==(a=r.exec(o))&&(p=a[0],i=a.index,s=i+p.length,!(n.cht.args.length?void De(e,e.getOption("theme")):void e.setOption("theme",t.args[0])},map:function(e,t,n){var o=t.args;return!o||2>o.length?void(e&&De(e,"Invalid mapping: "+t.input)):void _t.map(o[0],o[1],n)},imap:function(e,t){this.map(e,t,"insert")},nmap:function(e,t){this.map(e,t,"normal")},vmap:function(e,t){this.map(e,t,"visual")},unmap:function(e,t,n){var o=t.args;return!o||1>o.length?void(e&&De(e,"No such mapping: "+t.input)):void _t.unmap(o[0],n)},move:function(e,t){Et.processCommand(e,e.state.vim,{type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:t.line+1})},set:function(e,t){var n=t.args,o=t.setCfg||{};if(!n||1>n.length)return void(e&&De(e,"Invalid mapping: "+t.input));var r=n[0].split("="),a=r[0],i=r[1],s=!1;if("?"==a.charAt(a.length-1)){if(i)throw Error("Trailing characters: "+t.argString);a=a.substring(0,a.length-1),s=!0}void 0===i&&"no"==a.substring(0,2)&&(a=a.substring(2),i=!1);var d=bt[a]&&"boolean"==bt[a].type;if(d&&void 0==i&&(i=!0),!d&&void 0===i||s){var l=w(a,e,o);!0===l||!1===l?De(e," "+(l?"":"no")+a):De(e," "+a+"="+l)}else T(a,i,e,o)},setlocal:function(e,t){t.setCfg={scope:"local"},this.set(e,t)},setglobal:function(e,t){t.setCfg={scope:"global"},this.set(e,t)},registers:function(e,t){var n=t.args,o=Ct.registerController.registers,r="----------Registers----------

";if(!n)for(var a in o){var s=o[a].toString();s.length&&(r+="\""+a+" "+s+"
")}else{var a;n=n.join("");for(var d=0;d"}}De(e,r)},sort:function(e,n){function o(e,t){if(s){var n;n=e,e=t,t=n}d&&(e=e.toLowerCase(),t=t.toLowerCase());var o=c&&v.exec(e),r=c&&v.exec(t);return o?(o=parseInt((o[1]+o[2]).toLowerCase(),x),r=parseInt((r[1]+r[2]).toLowerCase(),x),o-r):e");if(!d)return void De(e,c);var h=0,m=function(){if(h=c)return void De(e,"Invalid argument: "+o.argString.substring(i));for(var u=0,h;u<=c-p;u++)h=n(p+u),delete r.marks[h]}else return void De(e,"Invalid argument: "+d+"-")}else delete r.marks[s]}}},_t=new Ot;return t.keyMap.vim={attach:u,detach:c,call:h},k("insertModeEscKeysTimeout",200,"number"),t.keyMap["vim-insert"]={fallthrough:["default"],attach:u,detach:c,call:h},t.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:u,detach:c,call:h},(A(),{buildKeyMap:function(){},getRegisterController:function(){return Ct.registerController},resetVimGlobalState_:A,getVimGlobalState_:function(){return Ct},maybeInitVimState_:N,suppressErrorLogging:!1,InsertModeKey:rt,map:function(e,t,n){_t.map(e,t,n)},unmap:function(e,t){_t.unmap(e,t)},setOption:T,getOption:w,defineOption:k,defineEx:function(e,t,n){if(!t)t=e;else if(0!==e.indexOf(t))throw new Error("(Vim.defineEx) \""+t+"\" is not a prefix of \""+e+"\", command not registered");Pt[e]=n,_t.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,n){var o=this.findKey(e,t,n);if("function"==typeof o)return o()},findKey:function(n,e,o){function r(){var t=Ct.macroModeState;if(t.isRecording){if("q"==e)return t.exitMacroRecordMode(),R(n),!0;"mapping"!=o&&Je(t,e)}}function a(){if(""==e)return R(n),d.visualMode?le(n):d.insertMode&&Xe(n),!0}function i(o){for(var r;o;)r=/<\w+-.+?>|<\w+>|./.exec(o),e=r[0],o=o.substring(r.index+e.length),t.Vim.handleKey(n,e,"mapping")}var d=N(n),l;return l=d.insertMode?function(){if(a())return!0;for(var t=d.inputState.keyBuffer+=e,o=1==e.length,r=Et.matchCommand(t,s,d.inputState,"insert");1=e}function a(e){return 47e}function s(e){return e===Tr||e===zr}function l(t){return t&&t!==Rr&&!s(t)&&!te(t)}function c(s,l,e){l=_r(s.length,jr(0,null==l?s.length:l)),null!=e&&!0!==e||(l=u(s,l));var n=new $r(s),i;n.pos=l;for(var r=[];!n.sol();){if(i=n.peek(),h(i))r.push(i);else if(!d(i)){if(t(r,Wr)||t(r,Br)){n.pos--;continue}if(Lr(n)||!p(i))break}else if(r.pop()!==Yr.get(i))break;n.pos--}if(!r.length&&n.pos!==l){var o=s.slice(n.pos,l).replace(/^[\*\+\>\^]+/,"");return{abbreviation:o,location:l-o.length}}}function u(t,e){for(te(t.charCodeAt(e))&&e++;h(t.charCodeAt(e));)e++;return e}function t(n,t){return-1!==n.indexOf(t)}function p(e){return 64e||96e||47e||Dr.has(e)}function d(e){return e===Fr||e===Pr||e===Ir}function h(e){return e===Wr||e===Ur||e===Br}function m(n,t){return t&&(n="upper"===t?n.toUpperCase():n.toLowerCase()),n}function g(n,o){return n instanceof Jr?n:"string"==typeof n?new Jr(n,o):n&&"object"==typeof n?new Jr(n.name,n.value,n.options):void 0}function f(e){return(e+"").trim()}function y(o,t,e){return o&&e.indexOf(o)===t}function b(e){return e===ia||e===sa}function v(e){return 47e}function x(o,t,e){return t=t||65,e=e||90,(o&=-33)>=t&&o<=e}function k(e){return v(e)||x(e)}function C(e){return 32===e||9===e||160===e}function w(e){return C(e)||10===e||13===e}function A(s,t,e,n){n=n?Object.assign({},$a,n):$a;var r=s.pos;if(s.eat(t)){for(var i=1,a;!s.eof();)if(!Ca(s,n))if((a=s.next())===t)i++;else if(!(a===e))a===n.escape&&s.next();else if(! --i)return s.start=r,!0;if(s.pos=r,n.throws)throw s.error("Unable to find matching pair for "+Or(t))}return!1}function O(o){var r={};o.charCodeAt(0)===ai&&(o=o.slice(1),r.implied=!0),o.charCodeAt(o.length-1)===ii&&(o=o.slice(0,o.length-1),r.boolean=!0);var e={name:o};return Object.keys(r).length&&(e.options=r),e}function _(n){var t=n.pos;if(n.eatWhile(S))return n.start=t,!0}function S(e){return!w(e)&&!b(e)&&e!==di&&e!==li&&e!==si}function E(e){return e.start=e.pos,e.eatWhile(j),e.current()}function j(e){return k(e)||45===e||58===e||36===e||64===e||33===e||95===e||37===e}function q(d){for(var t=new aa(d.trim()),n=new Kr,r=n,i=[],o;!t.eof();)if(!((o=t.peek())!==hi)){var e=new Kr,l=i.length?T(i)[0]:r;i.push([e,l,t.pos]),r=e,t.next()}else if(o!==mi){var p=ui(t);if(r.appendChild(p),t.eof())break;switch(t.peek()){case gi:t.next();continue;case fi:t.next(),r=p;continue;case yi:for(;t.eat(yi);)r=r.parent||r;continue;}}else{var a=i.pop();if(!a)throw t.error("Unexpected \")\" group end");var c=a[0];if(r=a[1],t.next(),c.repeat=ei(t))r.appendChild(c);else{for(;c.firstChild;)r.appendChild(c.firstChild);t.eat(gi)}}if(i.length)throw t.pos=i.pop()[2],t.error("Expected group close");return n}function T(e){return e[e.length-1]}function M(o){if(o.repeat&&o.repeat.count){for(var t=1,e;tn&&(n=e.index)}),-1!==n&&(a.index=n+1),e}function Ct(d,l){if(null==d)return d;for(var e=[],t=function(e,t,n,o){return null==l[n]?"":t+l[n]+o},o="",a=0,i=0,s,n;i=t.get("inlineBreak"))return!0}for(var o=0,a=d.children.length;on?0:n}function Ut(a,t){var e=a.node;if(t.enabled&&t.trigger&&e.name)for(var n=a.node.attributes.reduce(function(n,t){return t.name&&null!=t.value&&(n[t.name.toUpperCase().replace(/-/g,"_")]=t.value),n},{}),r=0,i=t.trigger.length;rt?0:t}function zt(o,t){var e=o.node;return!e.isTextOnly&&e.value&&(o.beforeText=ho.test(e.value)?o.newline+o.indent+t.indent(1):" "),o}function Vt(o,t){if(null!=o.value&&ho.test(o.value)){var e=wt(o.value),n=t.indent(1),r=e.reduce(function(n,t){return jr(n,t.length)},0);return e.map(function(o,t){return""+(t?n:"")+Xt(o,r)+" |"}).join("\n")}return o.value}function Xt(n,t){for(;n.length>4).toString(16)}function ae(e){return se(e.toString(16),2)}function se(n,t){for(;n.length=r&&(r=a,n=o)}return n}function qe(o,a){var e=o&&"object"==typeof o?o[a]:o,n=(e||"").match(/^[\w-@]+/);return n?n[0]:e}function ze(o,t){for(var e=0,n=0;en&&(t=t.slice(0,n-1).concat(t.slice(n-1).join(", ")));t.length;){var r=t.shift(),i=e.fields.shift(),o=r.length-i.length;e.string=e.string.slice(0,i.location)+r+e.string.slice(i.location+i.length);for(var a=0,s=e.fields.length;aa.length)return a;a=a.slice();var t=a.length,e=/,$/,n=0;n=3=t?Be(0,1):6=t?Be(0,2):Be(1,4);for(var r=0,i=void 0;rgn(t,o.to):0<=gn(t,o.from)&&0>=gn(t,o.to)}function gn(n,t){return n.line-t.line||n.ch-t.ch}function fn(o,t,e){return Zt(o,Object.assign({syntax:an(t),field:xa},Cn(t),e))}function yn(n,t){return en(n,Object.assign({syntax:an(t)},Cn(t)))}function bn(n,t){return t=t||t.getCursor(),c(n.getLine(t.line),t.ch,!0)}function vn(n,o){try{return{ast:yn(n,o),abbreviation:n,snippet:fn(n,o)}}catch(e){return null}}function xn(d,t,l){var n=!1,p=0,o;try{o=fn(t,d,{field:function(o,t){return void 0===t&&(t=""),n||(n=!0,p=t.length,t=ya+t),t}})}catch(e){return!1}var e=d.getLine(l.from.line),r=e.match(/^\s+/);o=cn(d,o,r&&r[0]);var a=o.length;return n&&(a=o.indexOf(ya),o=o.slice(0,a)+o.slice(a+ya.length)),d.operation(function(){d.replaceRange(o,l.from,l.to);var t=d.indexFromPos(l.from),e=d.posFromIndex(a+t);return p?d.setSelection(e,{line:e.line,ch:e.ch+p}):d.setCursor(e),!0})}function Cn(o,t){var e=o.getModeAt(t||o.getCursor()),n=o.getOption("emmet"),r=n&&n.profile;return"xml"===e.name&&(r=Object.assign({selfClosingStyle:e.configuration},r)),Object.assign({profile:r,snippets:kn(o,an(o,t))},n)}function kn(o,t){var e=o.getOption("emmet");if(e)return on(t)?e.stylesheetSnippets:e.markupSnippets}function wn(n){var t=An(n,n.getCursor());t&&_n(n,t)||(Sn(n),ln(n)&&On(n,n.getCursor()))}function An(o,t){for(var e=o.findMarksAt(t),n=0;n\^\+\(\)]/.test(o[t-r.length-1]))?r:null}function Bn(e){return e===qa||e===za}function Dn(e){return 47e}function qn(o,t,e){return t=t||65,e=e||90,(o&=-33)>=t&&o<=e}function zn(e){return Dn(e)||qn(e)}function Vn(e){return 32===e||9===e||160===e}function Gn(e){return Vn(e)||10===e||13===e}function Hn(s,t,e,n){n=n?Object.assign({},Ra,n):Ra;var r=s.pos;if(s.eat(t)){for(var i=1,a;!s.eof();)if(!Ma(s,n))if((a=s.next())===t)i++;else if(!(a===e))a===n.escape&&s.next();else if(! --i)return s.start=r,!0;if(s.pos=r,n.throws)throw s.error("Unable to find matching pair for "+Or(t))}return!1}function Xn(o,t){var e=o.pos;return o.eatWhile(t)?new Wa(o,e,o.pos):void(o.pos=e)}function Qn(e){return Ia(e)||Fa(e,Kn)}function Yn(a){var t=a.pos;if(Ma(a)){var e=a.pos,i,n;a.pos=t,a.next(),i=a.start=a.pos,a.pos=e,a.backUp(1),n=a.pos;var r=Fa(a,i,n);return a.pos=e,r}return Ia(a)||$n(a)}function Kn(e){return e!==Da&&!Jn(e)&&!Gn(e)}function Jn(e){return e===Ya||e===Ba}function $n(e){return Fa(e,Zn)}function Zn(e){return!(isNaN(e)||Bn(e)||Gn(e)||Jn(e))}function er(e){return Fa(e,tr)}function tr(e){return zn(e)||e===Ha||e===Xa||e===Va||e===Za}function nr(o,t){for(var e=o.pos,n=0;n"))},new Map),u=[o],l,n,r;!e.eof();)if(!(l=ir(e)))e.next();else if(r=lr(l),"open"===l.type)n=new La(e,"tag",l),pr(u).addChild(n),s.has(r)?n.close=sr(e,s.get(r)):function(e,t){return e.selfClosing||!p.xml&&a.has(t)}(l,r)||u.push(n);else if("close"===l.type){for(var i=u.length-1;0","/"].map(Nr)),Yr=new Map().set(Fr,Wr).set(Pr,Ur).set(Ir,Br),Gr={indent:"\t",tagCase:"",attributeCase:"",attributeQuotes:"double",format:!0,formatSkip:["html"],formatForce:["body"],inlineBreak:3,compactBooleanAttributes:!1,booleanAttributes:["contenteditable","seamless","async","autofocus","autoplay","checked","controls","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","novalidate","readonly","required","reversed","selected","typemustmatch"],selfClosingStyle:"html",inlineElements:["a","abbr","acronym","applet","b","basefont","bdo","big","br","button","cite","code","del","dfn","em","font","i","iframe","img","input","ins","kbd","label","map","object","q","s","samp","select","small","span","strike","strong","sub","sup","textarea","tt","u","var"]},Vr=function(e){this.options=Object.assign({},Gr,e),this.quoteChar="single"===this.options.attributeQuotes?"'":"\""};Vr.prototype.get=function(e){return this.options[e]},Vr.prototype.quote=function(e){return""+this.quoteChar+(null==e?"":e)+this.quoteChar},Vr.prototype.name=function(e){return m(e,this.options.tagCase)},Vr.prototype.attribute=function(e){return m(e,this.options.attributeCase)},Vr.prototype.isBooleanAttribute=function(e){return e.options.boolean||-1!==this.get("booleanAttributes").indexOf((e.name||"").toLowerCase())},Vr.prototype.selfClose=function(){switch(this.options.selfClosingStyle){case"xhtml":return" /";case"xml":return"/";default:return"";}},Vr.prototype.indent=function(o){var t=this;o=o||0;for(var e="";o--;)e+=t.options.indent;return e},Vr.prototype.isInline=function(e){return"string"==typeof e?-1!==this.get("inlineElements").indexOf(e.toLowerCase()):null==e.name?e.isTextOnly:this.isInline(e.name)},Vr.prototype.field=function(n,t){return this.options.field(n,t)};var Xr=function(n,t){this.key=n,this.value=t},Hr=function(e){this._string=new Map,this._regexp=new Map,this._disabled=!1,this.load(e)},Zr={disabled:{}};Zr.disabled.get=function(){return this._disabled},Hr.prototype.disable=function(){this._disabled=!0},Hr.prototype.enable=function(){this._disabled=!1},Hr.prototype.set=function(o,r){var e=this;if("string"==typeof o)o.split("|").forEach(function(n){return e._string.set(n,new Xr(n,r))});else{if(!(o instanceof RegExp))throw new Error("Unknow snippet key: "+o);this._regexp.set(o,new Xr(o,r))}return this},Hr.prototype.get=function(o){var t=this;if(!this.disabled){if(this._string.has(o))return this._string.get(o);for(var e=Array.from(this._regexp.keys()),n=0,r=e.length;nt||t>this.children.length)throw new Error("Unable to insert node: position is out of child list range");var e=this.children[t-1],n=this.children[t];o.remove(),o.parent=this,this.children.splice(t,0,o),e&&(o.previous=e,e.next=o),n&&(o.next=n,n.previous=o)},Kr.prototype.removeChild=function(n){var t=this.children.indexOf(n);-1!==t&&(this.children.splice(t,1),n.previous&&(n.previous.next=n.next),n.next&&(n.next.previous=n.previous),n.parent=n.next=n.previous=null)},Kr.prototype.remove=function(){this.parent&&this.parent.removeChild(this)},Kr.prototype.clone=function(n){var o=new Kr(this.name);return o.value=this.value,o.selfClosing=this.selfClosing,this.repeat&&(o.repeat=Object.assign({},this.repeat)),this._attributes.forEach(function(e){return o.setAttribute(e.clone())}),n&&this.children.forEach(function(e){return o.appendChild(e.clone(!0))}),o},Kr.prototype.walk=function(o,t){t=t||0;for(var e=this.firstChild,n;e;){if(n=e.next,!1===o(e,t)||!1===e.walk(o,t+1))return!1;e=n}},Kr.prototype.use=function(o){for(var t=arguments,e=[this],n=1;n=this.end},aa.prototype.limit=function(n,t){return new this.constructor(this.string,n,t)},aa.prototype.peek=function(){return this.string.charCodeAt(this.pos)},aa.prototype.next=function(){if(this.pos"},lo=/^id$/i,co=/^class$/i,fo={primary:function(e){return e.join("")},secondary:function(e){return e.map(function(e){return e.isBoolean?e.name:e.name+"="+e.value}).join(", ")}},qi={open:null,close:null,omitName:/^div$/i,attributes:fo},ho=/\n|\r/,mo=/\n|\r/,go={none:"[ SECONDARY_ATTRS]",round:"[(SECONDARY_ATTRS)]",curly:"[{SECONDARY_ATTRS}]",square:"[[SECONDARY_ATTRS]"},bo=/\n|\r/,vo={html:function(o,a,e){return e=Object.assign({},e),e.comment=Object.assign({},uo,e.comment),bt(o,e.field,function(n){if(n=qt(n,a),!St(n)){var t=n.node;if(t.name){var r=a.name(t.name),i=Nt(n,a);n.open="<"+r+i+(t.selfClosing?a.selfClose():"")+">",t.selfClosing||(n.close=""),Ut(n,e.comment)}!t.value&&(t.children.length||t.selfClosing)||(n.text=n.renderFields(t.value))}return n})},haml:function(o,a,e){e=e||{};var i={open:"[%NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)][SELF_CLOSE]",selfClose:"/",attributes:{secondary:function(e){return e.map(function(e){return e.isBoolean?e.name+(a.get("compactBooleanAttributes")?"":"=true"):e.name+"="+a.quote(e.value)}).join(" ")}}};return bt(o,e.field,function(e){if(e=It(e,a,i),e=zt(e,a),!St(e)){var t=e.node;!t.value&&(t.children.length||t.selfClosing)||(e.text=e.renderFields(Vt(t,a)))}return e})},slim:function(a,s,e){e=e||{};var t=e.attributeWrap&&go[e.attributeWrap]||go.none,n=t===go.none?function(e){return e.name+"=true"}:function(e){return e.name},i={open:"[NAME][PRIMARY_ATTRS]"+t+"[SELF_CLOSE]",selfClose:"/",attributes:{secondary:function(e){return e.map(function(e){return e.isBoolean?n(e):e.name+"="+s.quote(e.value)}).join(" ")}}};return bt(a,e.field,function(e){if(e=It(e,s,i),e=Ht(e,s),!St(e)){var t=e.node;!t.value&&(t.children.length||t.selfClosing)||(e.text=e.renderFields(Qt(t,s)))}return e})},pug:function(o,a,e){e=e||{};var i={open:"[NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)]",attributes:{secondary:function(e){return e.map(function(e){return e.isBoolean?e.name:e.name+"="+a.quote(e.value)}).join(", ")}}};return bt(o,e.field,function(e){if(e=It(e,a,i),e=Kt(e,a),!St(e)){var t=e.node;!t.value&&(t.children.length||t.selfClosing)||(e.text=e.renderFields(ee(t,a)))}return e})}},yo=function(o,t,e,a){return"object"==typeof e&&(a=e,e=null),ne(e)||(e="html"),vo[e](o,t,a)},xo=function(){this.type="css-value",this.value=[]},wo={size:{}};wo.size.get=function(){return this.value.length},xo.prototype.add=function(e){this.value.push(e)},xo.prototype.has=function(e){return-1!==this.value.indexOf(e)},xo.prototype.toString=function(){return this.value.join(" ")},Object.defineProperties(xo.prototype,wo);var ko=function(n){if(35===n.peek()){n.start=n.pos,n.next(),n.eat(116)||n.eatWhile(re);var t=n.current();if(n.start=n.pos,n.eat(46)&&!n.eatWhile(v))throw n.error("Unexpected character for alpha value of color");return new $o(t,n.current())}},$o=function(o,t){this.type="color",this.raw=o,this.alpha=+(null!=t&&""!==t?t:1),o=o.slice(1);var e=0,n=0,r=0;if("t"===o)this.alpha=0;else switch(o.length){case 0:break;case 1:e=n=r=o+o;break;case 2:e=n=r=o;break;case 3:e=o[0]+o[0],n=o[1]+o[1],r=o[2]+o[2];break;default:o+=o,e=o.slice(0,2),n=o.slice(2,4),r=o.slice(4,6);}this.r=parseInt(e,16),this.g=parseInt(n,16),this.b=parseInt(r,16)};$o.prototype.toHex=function(n){var t=n&&ie(this.r)&&ie(this.g)&&ie(this.b)?oe:ae;return"#"+t(this.r)+t(this.g)+t(this.b)},$o.prototype.toRGB=function(){var e=[this.r,this.g,this.b];return 1!==this.alpha&&e.push(this.alpha.toFixed(8).replace(/\.?0+$/,"")),(3===e.length?"rgb":"rgba")+"("+e.join(", ")+")"},$o.prototype.toString=function(e){return this.r||this.g||this.b||this.alpha?1===this.alpha?this.toHex(e):this.toRGB():"transparent"};var Co=46,Ao=45,Oo=function(n){if(n.start=n.pos,ce(n)){var t=n.current();return n.start=n.pos,n.eat(37)||n.eatWhile(le),new jo(t,n.current())}},jo=function(n,o){this.type="numeric",this.value=+n,this.unit=o||""};jo.prototype.toString=function(){return""+this.value+this.unit};var _o=45,So=function(n,t){return n.start=n.pos,n.eat(36)||n.eat(64)?n.eatWhile(pe):t?n.eatWhile(le):n.eatWhile(fe),n.start===n.pos?null:new Eo(n.current())},Eo=function(e){this.type="keyword",this.value=e};Eo.prototype.toString=function(){return this.value};var qo={throws:!0},zo=function(e){if(Ca(e,qo))return new To(e.current())},To=function(e){this.type="string",this.value=e};To.prototype.toString=function(){return this.value};var Mo=40,Ro=41,Lo=44,No=function(n,t){this.type="function",this.name=n,this.args=t||[]};No.prototype.toString=function(){return this.name+"("+this.args.join(", ")+")"};var Fo=33,Wo=36,Po=45,Uo=58,Io=64,Bo=function(a){for(var t=new Kr,e=new aa(a),n;!e.eof();){n=new Kr(ge(e)),n.value=be(e);var r=he(e);if(r)for(var i=0;isrc:m+img","ri:t|ri:type":"pic>src:t+img","!!!":"{}",doc:"html[lang=${lang}]>(head>meta[charset=${charset}]+meta:vp+meta:edge+title{${1:Document}})+body","!|html:5":"!!!+doc",c:"{}","cc:ie":"{}","cc:noie":"{${0}}"},css:{"@f":"@font-face {\n\tfont-family: ${1};\n\tsrc: url(${1});\n}","@ff":"@font-face {\n\tfont-family: '${1:FontName}';\n\tsrc: url('${2:FileName}.eot');\n\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\n\t\t url('${2:FileName}.woff') format('woff'),\n\t\t url('${2:FileName}.ttf') format('truetype'),\n\t\t url('${2:FileName}.svg#${1:FontName}') format('svg');\n\tfont-style: ${3:normal};\n\tfont-weight: ${4:normal};\n}","@i|@import":"@import url(${0});","@kf":"@keyframes ${1:identifier} {\n\t${2}\n}","@m|@media":"@media ${1:screen} {\n\t${0}\n}",ac:"align-content:flex-start|flex-end|center|space-between|space-around|stretch",ai:"align-items:flex-start|flex-end|center|baseline|stretch",anim:"animation:${1:name} ${2:duration} ${3:timing-function} ${4:delay} ${5:iteration-count} ${6:direction} ${7:fill-mode}",animdel:"animation-delay:${1:time}",animdir:"animation-direction:normal|reverse|alternate|alternate-reverse",animdur:"animation-duration:${1:0}s",animfm:"animation-fill-mode:both|forwards|backwards",animic:"animation-iteration-count:1|infinite",animn:"animation-name",animps:"animation-play-state:running|paused",animtf:"animation-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(${1:0.1}, ${2:0.7}, ${3:1.0}, ${3:0.1})",ap:"appearance:none",as:"align-self:auto|flex-start|flex-end|center|baseline|stretch",b:"bottom",bd:"border:${1:1px} ${2:solid} ${3:#000}",bdb:"border-bottom:${1:1px} ${2:solid} ${3:#000}",bdbc:"border-bottom-color:#${1:000}",bdbi:"border-bottom-image:url(${0})",bdbk:"border-break:close",bdbli:"border-bottom-left-image:url(${0})|continue",bdblrs:"border-bottom-left-radius",bdbri:"border-bottom-right-image:url(${0})|continue",bdbrrs:"border-bottom-right-radius",bdbs:"border-bottom-style",bdbw:"border-bottom-width",bdc:"border-color:#${1:000}",bdci:"border-corner-image:url(${0})|continue",bdcl:"border-collapse:collapse|separate",bdf:"border-fit:repeat|clip|scale|stretch|overwrite|overflow|space",bdi:"border-image:url(${0})",bdl:"border-left:${1:1px} ${2:solid} ${3:#000}",bdlc:"border-left-color:#${1:000}",bdlen:"border-length",bdli:"border-left-image:url(${0})",bdls:"border-left-style",bdlw:"border-left-width",bdr:"border-right:${1:1px} ${2:solid} ${3:#000}",bdrc:"border-right-color:#${1:000}",bdri:"border-right-image:url(${0})",bdrs:"border-radius",bdrst:"border-right-style",bdrw:"border-right-width",bds:"border-style:hidden|dotted|dashed|solid|double|dot-dash|dot-dot-dash|wave|groove|ridge|inset|outset",bdsp:"border-spacing",bdt:"border-top:${1:1px} ${2:solid} ${3:#000}",bdtc:"border-top-color:#${1:000}",bdti:"border-top-image:url(${0})",bdtli:"border-top-left-image:url(${0})|continue",bdtlrs:"border-top-left-radius",bdtri:"border-top-right-image:url(${0})|continue",bdtrrs:"border-top-right-radius",bdts:"border-top-style",bdtw:"border-top-width",bdw:"border-width",bfv:"backface-visibility:hidden|visible",bg:"background:#${1:000}",bga:"background-attachment:fixed|scroll",bgbk:"background-break:bounding-box|each-box|continuous",bgc:"background-color:#${1:fff}",bgcp:"background-clip:padding-box|border-box|content-box|no-clip",bgi:"background-image:url(${0})",bgo:"background-origin:padding-box|border-box|content-box",bgp:"background-position:${1:0} ${2:0}",bgpx:"background-position-x",bgpy:"background-position-y",bgr:"background-repeat:no-repeat|repeat-x|repeat-y|space|round",bgsz:"background-size:contain|cover",bxsh:"box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} ${5:color}|none",bxsz:"box-sizing:border-box|content-box|border-box",c:"color:#${1:000}",cl:"clear:both|left|right|none",cm:"/* ${0} */",cnt:"content:'${0}'|normal|open-quote|no-open-quote|close-quote|no-close-quote|attr(${0})|counter(${0})|counters({$0})",coi:"counter-increment",colm:"columns",colmc:"column-count",colmf:"column-fill",colmg:"column-gap",colmr:"column-rule",colmrc:"column-rule-color",colmrs:"column-rule-style",colmrw:"column-rule-width",colms:"column-span",colmw:"column-width",cor:"counter-reset",cp:"clip:auto|rect(${1:top} ${2:right} ${3:bottom} ${4:left})",cps:"caption-side:top|bottom",cur:"cursor:pointer|auto|default|crosshair|hand|help|move|pointer|text",d:"display:block|none|flex|inline-flex|inline|inline-block|list-item|run-in|compact|table|inline-table|table-caption|table-column|table-column-group|table-header-group|table-footer-group|table-row|table-row-group|table-cell|ruby|ruby-base|ruby-base-group|ruby-text|ruby-text-group",ec:"empty-cells:show|hide",f:"font:${1:1em} ${2:sans-serif}",fef:"font-effect:none|engrave|emboss|outline",fem:"font-emphasize",femp:"font-emphasize-position:before|after",fems:"font-emphasize-style:none|accent|dot|circle|disc",ff:"font-family:serif|sans-serif|cursive|fantasy|monospace",fl:"float:left|right|none",fs:"font-style:italic|normal|oblique",fsm:"font-smoothing:antialiased|subpixel-antialiased|none",fst:"font-stretch:normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",fv:"font-variant:normal|small-caps",fw:"font-weight:normal|bold|bolder|lighter",fx:"flex",fxb:"flex-basis:fill|max-content|min-content|fit-content|content",fxd:"flex-direction:row|row-reverse|column|column-reverse",fxf:"flex-flow",fxg:"flex-grow",fxsh:"flex-shrink",fxw:"flex-wrap:nowrap|wrap|wrap-reverse",fz:"font-size",fza:"font-size-adjust",h:"height",jc:"justify-content:flex-start|flex-end|center|space-between|space-around",l:"left",lg:"background-image:linear-gradient(${1})",lh:"line-height",lis:"list-style",lisi:"list-style-image",lisp:"list-style-position:inside|outside",list:"list-style-type:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman",lts:"letter-spacing:normal",m:"margin",mah:"max-height",mar:"max-resolution",maw:"max-width",mb:"margin-bottom",mih:"min-height",mir:"min-resolution",miw:"min-width",ml:"margin-left",mr:"margin-right",mt:"margin-top",ol:"outline",olc:"outline-color:#${1:000}|invert",olo:"outline-offset",ols:"outline-style:none|dotted|dashed|solid|double|groove|ridge|inset|outset",olw:"outline-width|thin|medium|thick",op:"opacity",ord:"order",ori:"orientation:landscape|portrait",orp:"orphans",ov:"overflow:hidden|visible|hidden|scroll|auto",ovs:"overflow-style:scrollbar|auto|scrollbar|panner|move|marquee",ovx:"overflow-x:hidden|visible|hidden|scroll|auto",ovy:"overflow-y:hidden|visible|hidden|scroll|auto",p:"padding",pb:"padding-bottom",pgba:"page-break-after:auto|always|left|right",pgbb:"page-break-before:auto|always|left|right",pgbi:"page-break-inside:auto|avoid",pl:"padding-left",pos:"position:relative|absolute|relative|fixed|static",pr:"padding-right",pt:"padding-top",q:"quotes",qen:"quotes:'\\201C' '\\201D' '\\2018' '\\2019'",qru:"quotes:'\\00AB' '\\00BB' '\\201E' '\\201C'",r:"right",rsz:"resize:none|both|horizontal|vertical",t:"top",ta:"text-align:left|center|right|justify",tal:"text-align-last:left|center|right",tbl:"table-layout:fixed",td:"text-decoration:none|underline|overline|line-through",te:"text-emphasis:none|accent|dot|circle|disc|before|after",th:"text-height:auto|font-size|text-size|max-size",ti:"text-indent",tj:"text-justify:auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|tibetan",to:"text-outline:${1:0} ${2:0} ${3:#000}",tov:"text-overflow:ellipsis|clip",tr:"text-replace",trf:"transform:${1}|skewX(${1:angle})|skewY(${1:angle})|scale(${1:x}, ${2:y})|scaleX(${1:x})|scaleY(${1:y})|scaleZ(${1:z})|scale3d(${1:x}, ${2:y}, ${3:z})|rotate(${1:angle})|rotateX(${1:angle})|rotateY(${1:angle})|rotateZ(${1:angle})|translate(${1:x}, ${2:y})|translateX(${1:x})|translateY(${1:y})|translateZ(${1:z})|translate3d(${1:tx}, ${2:ty}, ${3:tz})",trfo:"transform-origin",trfs:"transform-style:preserve-3d",trs:"transition:${1:prop} ${2:time}",trsde:"transition-delay:${1:time}",trsdu:"transition-duration:${1:time}",trsp:"transition-property:${1:prop}",trstf:"transition-timing-function:${1:fn}",tsh:"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000}",tt:"text-transform:uppercase|lowercase|capitalize|none",tw:"text-wrap:none|normal|unrestricted|suppress",us:"user-select:none",v:"visibility:hidden|visible|collapse",va:"vertical-align:top|super|text-top|middle|baseline|bottom|text-bottom|sub",w:"width",whs:"white-space:nowrap|pre|pre-wrap|pre-line|normal",whsc:"white-space-collapse:normal|keep-all|loose|break-strict|break-all",wid:"widows",wm:"writing-mode:lr-tb|lr-tb|lr-bt|rl-tb|rl-bt|tb-rl|tb-lr|bt-lr|bt-rl",wob:"word-break:normal|keep-all|break-all",wos:"word-spacing",wow:"word-wrap:none|unrestricted|suppress|break-word|normal",z:"z-index",zom:"zoom:1"}},oa={latin:{common:["lorem","ipsum","dolor","sit","amet","consectetur","adipisicing","elit"],words:["exercitationem","perferendis","perspiciatis","laborum","eveniet","sunt","iure","nam","nobis","eum","cum","officiis","excepturi","odio","consectetur","quasi","aut","quisquam","vel","eligendi","itaque","non","odit","tempore","quaerat","dignissimos","facilis","neque","nihil","expedita","vitae","vero","ipsum","nisi","animi","cumque","pariatur","velit","modi","natus","iusto","eaque","sequi","illo","sed","ex","et","voluptatibus","tempora","veritatis","ratione","assumenda","incidunt","nostrum","placeat","aliquid","fuga","provident","praesentium","rem","necessitatibus","suscipit","adipisci","quidem","possimus","voluptas","debitis","sint","accusantium","unde","sapiente","voluptate","qui","aspernatur","laudantium","soluta","amet","quo","aliquam","saepe","culpa","libero","ipsa","dicta","reiciendis","nesciunt","doloribus","autem","impedit","minima","maiores","repudiandae","ipsam","obcaecati","ullam","enim","totam","delectus","ducimus","quis","voluptates","dolores","molestiae","harum","dolorem","quia","voluptatem","molestias","magni","distinctio","omnis","illum","dolorum","voluptatum","ea","quas","quam","corporis","quae","blanditiis","atque","deserunt","laboriosam","earum","consequuntur","hic","cupiditate","quibusdam","accusamus","ut","rerum","error","minus","eius","ab","ad","nemo","fugit","officia","at","in","id","quos","reprehenderit","numquam","iste","fugiat","sit","inventore","beatae","repellendus","magnam","recusandae","quod","explicabo","doloremque","aperiam","consequatur","asperiores","commodi","optio","dolor","labore","temporibus","repellat","veniam","architecto","est","esse","mollitia","nulla","a","similique","eos","alias","dolore","tenetur","deleniti","porro","facere","maxime","corrupti"]},ru:{common:["\u0434\u0430\u043B\u0435\u043A\u043E-\u0434\u0430\u043B\u0435\u043A\u043E","\u0437\u0430","\u0441\u043B\u043E\u0432\u0435\u0441\u043D\u044B\u043C\u0438","\u0433\u043E\u0440\u0430\u043C\u0438","\u0432 \u0441\u0442\u0440\u0430\u043D\u0435","\u0433\u043B\u0430\u0441\u043D\u044B\u0445","\u0438 \u0441\u043E\u0433\u043B\u0430\u0441\u043D\u044B\u0445","\u0436\u0438\u0432\u0443\u0442","\u0440\u044B\u0431\u043D\u044B\u0435","\u0442\u0435\u043A\u0441\u0442\u044B"],words:["\u0432\u0434\u0430\u043B\u0438","\u043E\u0442 \u0432\u0441\u0435\u0445","\u043E\u043D\u0438","\u0431\u0443\u043A\u0432\u0435\u043D\u043D\u044B\u0445","\u0434\u043E\u043C\u0430\u0445","\u043D\u0430 \u0431\u0435\u0440\u0435\u0433\u0443","\u0441\u0435\u043C\u0430\u043D\u0442\u0438\u043A\u0430","\u0431\u043E\u043B\u044C\u0448\u043E\u0433\u043E","\u044F\u0437\u044B\u043A\u043E\u0432\u043E\u0433\u043E","\u043E\u043A\u0435\u0430\u043D\u0430","\u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0438\u0439","\u0440\u0443\u0447\u0435\u0435\u043A","\u0434\u0430\u043B\u044C","\u0436\u0443\u0440\u0447\u0438\u0442","\u043F\u043E \u0432\u0441\u0435\u0439","\u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0438\u0432\u0430\u0435\u0442","\u0435\u0435","\u0432\u0441\u0435\u043C\u0438","\u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u043C\u0438","\u043F\u0440\u0430\u0432\u0438\u043B\u0430\u043C\u0438","\u044D\u0442\u0430","\u043F\u0430\u0440\u0430\u0434\u0438\u0433\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0430\u044F","\u0441\u0442\u0440\u0430\u043D\u0430","\u043A\u043E\u0442\u043E\u0440\u043E\u0439","\u0436\u0430\u0440\u0435\u043D\u043D\u044B\u0435","\u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u044F","\u0437\u0430\u043B\u0435\u0442\u0430\u044E\u0442","\u043F\u0440\u044F\u043C\u043E","\u0440\u043E\u0442","\u0434\u0430\u0436\u0435","\u0432\u0441\u0435\u043C\u043E\u0433\u0443\u0449\u0430\u044F","\u043F\u0443\u043D\u043A\u0442\u0443\u0430\u0446\u0438\u044F","\u043D\u0435","\u0438\u043C\u0435\u0435\u0442","\u0432\u043B\u0430\u0441\u0442\u0438","\u043D\u0430\u0434","\u0440\u044B\u0431\u043D\u044B\u043C\u0438","\u0442\u0435\u043A\u0441\u0442\u0430\u043C\u0438","\u0432\u0435\u0434\u0443\u0449\u0438\u043C\u0438","\u0431\u0435\u0437\u043E\u0440\u0444\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u043D\u044B\u0439","\u043E\u0431\u0440\u0430\u0437","\u0436\u0438\u0437\u043D\u0438","\u043E\u0434\u043D\u0430\u0436\u0434\u044B","\u043E\u0434\u043D\u0430","\u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0430\u044F","\u0441\u0442\u0440\u043E\u0447\u043A\u0430","\u0440\u044B\u0431\u043D\u043E\u0433\u043E","\u0442\u0435\u043A\u0441\u0442\u0430","\u0438\u043C\u0435\u043D\u0438","lorem","ipsum","\u0440\u0435\u0448\u0438\u043B\u0430","\u0432\u044B\u0439\u0442\u0438","\u0431\u043E\u043B\u044C\u0448\u043E\u0439","\u043C\u0438\u0440","\u0433\u0440\u0430\u043C\u043C\u0430\u0442\u0438\u043A\u0438","\u0432\u0435\u043B\u0438\u043A\u0438\u0439","\u043E\u043A\u0441\u043C\u043E\u043A\u0441","\u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0430\u043B","\u043E","\u0437\u043B\u044B\u0445","\u0437\u0430\u043F\u044F\u0442\u044B\u0445","\u0434\u0438\u043A\u0438\u0445","\u0437\u043D\u0430\u043A\u0430\u0445","\u0432\u043E\u043F\u0440\u043E\u0441\u0430","\u043A\u043E\u0432\u0430\u0440\u043D\u044B\u0445","\u0442\u043E\u0447\u043A\u0430\u0445","\u0437\u0430\u043F\u044F\u0442\u043E\u0439","\u043D\u043E","\u0442\u0435\u043A\u0441\u0442","\u0434\u0430\u043B","\u0441\u0431\u0438\u0442\u044C","\u0441\u0435\u0431\u044F","\u0442\u043E\u043B\u043A\u0443","\u043E\u043D","\u0441\u043E\u0431\u0440\u0430\u043B","\u0441\u0435\u043C\u044C","\u0441\u0432\u043E\u0438\u0445","\u0437\u0430\u0433\u043B\u0430\u0432\u043D\u044B\u0445","\u0431\u0443\u043A\u0432","\u043F\u043E\u0434\u043F\u043E\u044F\u0441\u0430\u043B","\u0438\u043D\u0438\u0446\u0438\u0430\u043B","\u0437\u0430","\u043F\u043E\u044F\u0441","\u043F\u0443\u0441\u0442\u0438\u043B\u0441\u044F","\u0434\u043E\u0440\u043E\u0433\u0443","\u0432\u0437\u043E\u0431\u0440\u0430\u0432\u0448\u0438\u0441\u044C","\u043F\u0435\u0440\u0432\u0443\u044E","\u0432\u0435\u0440\u0448\u0438\u043D\u0443","\u043A\u0443\u0440\u0441\u0438\u0432\u043D\u044B\u0445","\u0433\u043E\u0440","\u0431\u0440\u043E\u0441\u0438\u043B","\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439","\u0432\u0437\u0433\u043B\u044F\u0434","\u043D\u0430\u0437\u0430\u0434","\u0441\u0438\u043B\u0443\u044D\u0442","\u0441\u0432\u043E\u0435\u0433\u043E","\u0440\u043E\u0434\u043D\u043E\u0433\u043E","\u0433\u043E\u0440\u043E\u0434\u0430","\u0431\u0443\u043A\u0432\u043E\u0433\u0440\u0430\u0434","\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A","\u0434\u0435\u0440\u0435\u0432\u043D\u0438","\u0430\u043B\u0444\u0430\u0432\u0438\u0442","\u043F\u043E\u0434\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A","\u0441\u0432\u043E\u0435\u0433\u043E","\u043F\u0435\u0440\u0435\u0443\u043B\u043A\u0430","\u0433\u0440\u0443\u0441\u0442\u043D\u044B\u0439","\u0440\u0435\u0442\u043E\u0440\u0438\u0447\u0435\u0441\u043A\u0438\u0439","\u0432\u043E\u043F\u0440\u043E\u0441","\u0441\u043A\u0430\u0442\u0438\u043B\u0441\u044F","\u0435\u0433\u043E","\u0449\u0435\u043A\u0435","\u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u043B","\u0441\u0432\u043E\u0439","\u043F\u0443\u0442\u044C","\u0434\u043E\u0440\u043E\u0433\u0435","\u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043B","\u0440\u0443\u043A\u043E\u043F\u0438\u0441\u044C","\u043E\u043D\u0430","\u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0434\u0438\u043B\u0430","\u043C\u043E\u0435\u0439","\u0432\u0441\u0435","\u043F\u0435\u0440\u0435\u043F\u0438\u0441\u044B\u0432\u0430\u0435\u0442\u0441\u044F","\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E","\u0440\u0430\u0437","\u0435\u0434\u0438\u043D\u0441\u0442\u0432\u0435\u043D\u043D\u043E\u0435","\u0447\u0442\u043E","\u043C\u0435\u043D\u044F","\u043E\u0441\u0442\u0430\u043B\u043E\u0441\u044C","\u044D\u0442\u043E","\u043F\u0440\u0438\u0441\u0442\u0430\u0432\u043A\u0430","\u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0439\u0441\u044F","\u0442\u044B","\u043B\u0443\u0447\u0448\u0435","\u0441\u0432\u043E\u044E","\u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u0443\u044E","\u0441\u0442\u0440\u0430\u043D\u0443","\u043F\u043E\u0441\u043B\u0443\u0448\u0430\u0432\u0448\u0438\u0441\u044C","\u0440\u0443\u043A\u043E\u043F\u0438\u0441\u0438","\u043D\u0430\u0448","\u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u043B","\u0441\u0432\u043E\u0439","\u043F\u0443\u0442\u044C","\u0432\u0441\u043A\u043E\u0440\u0435","\u0435\u043C\u0443","\u043F\u043E\u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043B\u0441\u044F","\u043A\u043E\u0432\u0430\u0440\u043D\u044B\u0439","\u0441\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043B\u044C","\u0440\u0435\u043A\u043B\u0430\u043C\u043D\u044B\u0445","\u0442\u0435\u043A\u0441\u0442\u043E\u0432","\u043D\u0430\u043F\u043E\u0438\u0432\u0448\u0438\u0439","\u044F\u0437\u044B\u043A\u043E\u043C","\u0440\u0435\u0447\u044C\u044E","\u0437\u0430\u043C\u0430\u043D\u0438\u0432\u0448\u0438\u0439","\u0441\u0432\u043E\u0435","\u0430\u0433\u0435\u043D\u0442\u0441\u0442\u0432\u043E","\u043A\u043E\u0442\u043E\u0440\u043E\u0435","\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043B\u043E","\u0441\u043D\u043E\u0432\u0430","\u0441\u043D\u043E\u0432\u0430","\u0441\u0432\u043E\u0438\u0445","\u043F\u0440\u043E\u0435\u043A\u0442\u0430\u0445","\u0435\u0441\u043B\u0438","\u043F\u0435\u0440\u0435\u043F\u0438\u0441\u0430\u043B\u0438","\u0442\u043E","\u0436\u0438\u0432\u0435\u0442","\u0442\u0430\u043C","\u0434\u043E","\u0441\u0438\u0445","\u043F\u043E\u0440"]},sp:{common:["mujer","uno","dolor","m\xE1s","de","poder","mismo","si"],words:["ejercicio","preferencia","perspicacia","laboral","pa\xF1o","suntuoso","molde","namibia","planeador","mirar","dem\xE1s","oficinista","excepci\xF3n","odio","consecuencia","casi","auto","chicharra","velo","elixir","ataque","no","odio","temporal","cu\xF3rum","dign\xEDsimo","facilismo","letra","nihilista","expedici\xF3n","alma","alveolar","aparte","le\xF3n","animal","como","paria","belleza","modo","natividad","justo","ataque","s\xE9quito","pillo","sed","ex","y","voluminoso","temporalidad","verdades","racional","asunci\xF3n","incidente","marejada","placenta","amanecer","fuga","previsor","presentaci\xF3n","lejos","necesariamente","sospechoso","adiposidad","quind\xEDo","p\xF3cima","voluble","d\xE9bito","sinti\xF3","accesorio","falda","sapiencia","volutas","queso","permacultura","laudo","soluciones","entero","pan","litro","tonelada","culpa","libertario","mosca","dictado","reincidente","nascimiento","dolor","escolar","impedimento","m\xEDnima","mayores","repugnante","dulce","obcecado","monta\xF1a","enigma","total","delet\xE9reo","d\xE9cima","c\xE1bala","fotograf\xEDa","dolores","molesto","olvido","paciencia","resiliencia","voluntad","molestias","magn\xEDfico","distinci\xF3n","ovni","marejada","cerro","torre","y","abogada","manantial","corporal","agua","crep\xFAsculo","ataque","desierto","laboriosamente","angustia","afortunado","alma","encefalograma","materialidad","cosas","o","renuncia","error","menos","conejo","abad\xEDa","analfabeto","remo","fugacidad","oficio","en","alm\xE1cigo","vos","pan","represi\xF3n","n\xFAmeros","triste","refugiado","trote","inventor","corchea","repelente","magma","recusado","patr\xF3n","expl\xEDcito","paloma","s\xEDndrome","inmune","autoinmune","comodidad","ley","vietnamita","demonio","tasmania","repeler","ap\xE9ndice","arquitecto","columna","yugo","computador","mula","a","prop\xF3sito","fantas\xEDa","alias","rayo","tenedor","deleznable","ventana","cara","anemia","corrupto"]}},la={wordCount:30,skipCommon:!1,lang:"latin"},ca=function(o,t){t=Object.assign({},la,t);var e=oa[t.lang]||oa.latin,n=!t.skipCommon&&!Ze(o);return o.repeat||Ie(o.parent)?(o.value=He(e,t.wordCount,n),o.name=P(o.parent.name)):(o.parent.value=He(e,t.wordCount,n),o.remove()),o},fa=/^lorem([a-z]*)(\d*)$/,pa=function(o,t){var a=[na[o]||na.html];Array.isArray(t)?t.forEach(function(e){a.push("string"==typeof e?na[e]:e)}):"object"==typeof t&&a.push(t);var n=new Qr(a.filter(Boolean));return"css"!==o&&n.get(0).set(fa,$t),n},ha={lang:"en",locale:"en-US",charset:"UTF-8"},da=new Set(["css","sass","scss","less","stylus","sss"]),ma={syntax:"html",field:function(n,t){return t||""},text:null,profile:null,variables:{},snippets:{},addons:null,format:null},ga=new Set(["html","xml","xsl","jsx","js","pug","slim","haml","css","sass","scss","less","sss","stylus"]),ba=function(o,t){var e=o.getTokenTypeAt(t||o.getCursor());return e&&/^property\b/.test(e)},zi={html:function(n,t){return null===n.getTokenTypeAt(t||n.getCursor())},css:ba,less:ba,sass:ba,scss:ba},ya="[[::emmet-cursor::]]",xa=function(n,t){return void 0===t&&(t=""),t},Ki="emmet-abbreviation",Gi=45,Aa=function(e){return jn(e.map(function(e){return new Oa(e.key,e.value)}))},Oa=function(o,t){this.key=o,this.value=t,this.property=null;var e=t&&t.match(/^([a-z\-]+)(?:\s*:\s*([^\n\r]+))?$/);e&&(this.property=e[1],this.value=e[2]),this.dependencies=[]},ja={defaulValue:{}};Oa.prototype.addDependency=function(e){this.dependencies.push(e)},ja.defaulValue.get=function(){return null==this.value?null:Rn(this.value)[0]},Oa.prototype.keywords=function(){var d=[],n=new Set,r=0,i,t;for(this.property&&d.push(this);r=this.end},Ea.prototype.limit=function(n,t){return new this.constructor(this.string,n,t)},Ea.prototype.peek=function(){return this.string.charCodeAt(this.pos)},Ea.prototype.next=function(){if(this.pos"),Xi=function(o){var t=o.pos;if(or(o,Ja,Ka,!0)){var e=Fa(o,t);return e.type="comment",e}return null},Qi=rr(""),Ji=function(o){var t=o.pos;if(or(o,Qi,Yi,!0)){var e=Fa(o,t);return e.type="cdata",e}return null},$i={xml:!1,special:["script","style"],empty:["img","meta","link","br","base","hr","area","wbr"]},Zi=function(o,t,e){this.dom=o,this.type=t,this.syntax=e};Zi.prototype.nodeForPoint=function(o,t){for(var e=this.dom.firstChild,n=null;e;)mn(cr(e),o,t)?(n=e,e=e.firstChild):e=e.nextSibling;return n};var es=function(o,r,e){null==e&&"string"==typeof o&&(e=o.length),this.string=o,this.pos=this.start=r||0,this.end=e};es.prototype.eof=function(){return this.pos>=this.end},es.prototype.limit=function(n,t){return new this.constructor(this.string,n,t)},es.prototype.peek=function(){return this.string.charCodeAt(this.pos)},es.prototype.next=function(){if(this.pos=gn(this.pos,this._sof)},t.prototype.eof=function(){return 0<=gn(this.pos,this._eof)},t.prototype.limit=function(n,o){return new this.constructor(this.editor,n,{from:n,to:o})},t.prototype.peek=function(){var o=this.pos,t=(o.line,o.ch),e=this.editor.getLine(this.pos.line);return t=this._lineLength(this.pos.line)&&(this.pos.line++,this.pos.ch=0),this.eof()&&(this.pos=Object.assign({},this._eof)),e}return NaN},t.prototype.backUp=function(a){var t=this,e=this.editor.constructor,n=this.pos,r=n.line,i=n.ch;for(i-=a||1;0<=r&&0>i;)r--,i+=t._lineLength(r);return this.pos=0>r||0>i?e.Pos(0,0):e.Pos(r,i),this.peek()},t.prototype.current=function(){return this.substring(this.start,this.pos)},t.prototype.substring=function(n,t){return this.editor.getRange(n,t)},t.prototype.error=function(n){var t=new Error(n+" at line "+this.pos.line+", column "+this.pos.ch);return t.originalMessage=n,t.pos=this.pos,t.string=this.string,t},t.prototype._lineLength=function(n){var t=n===this.editor.lastLine();return this.editor.getLine(n).length+(t?0:1)},t}(es),ns="emmet-open-tag",os="emmet-close-tag",rs={emmetExpandAbbreviation:function(a){if(a.somethingSelected())return a.constructor.Pass;var t=a.getCursor(),e=An(a,t),n=!1;if(e)n=xn(a,e.model.ast,e.find());else{var r=bn(a,t);if(r){var i={from:{line:t.line,ch:r.location},to:{line:t.line,ch:r.location+r.abbreviation.length}};n=xn(a,r.abbreviation,i)}}return Sn(a),n||a.constructor.Pass},emmetInsertLineBreak:function(d){var t=d.getCursor();if("xml"===d.getModeAt(t).name){var e=(Object.assign({},t,{ch:t.ch+1}),d.getTokenAt(t)),n=d.getTokenAt(Object.assign({},t,{ch:t.ch+1}));if("tag bracket"===e.type&&">"===e.string&&"tag bracket"===n.type&&"t.alpha||0.5>=t.size))&&(1===A?n(t):2===A&&o(t))}function a(e,t){return t||(t=e,e=0),e+~~(Math.random()*(t-e+1))}function i(e,t){var n=!1;return function(){n||(e.apply(this,arguments),n=!0,setTimeout(function(){n=!1},t))}}function s(){h&&(O.clearRect(0,0,k,T),P=new Date().getTime(),!y&&(y=P),_=(P-y)/1e3,y=P,0=this.size-(this.bMin+p.snapOffset+this.bGutterSize)&&(e=this.size-(this.bMin+this.bGutterSize)),k.call(this,e),p.onDrag&&p.onDrag())},E=function(){var e=t.getComputedStyle(this.parent),n=this.parent[m]-parseFloat(e[b])-parseFloat(e[v]);this.size=this.a[s]()[u]+this.b[s]()[u]+this.aGutterSize+this.bGutterSize,this.percentage=Math.min(100*(this.size/n),100),this.start=this.a[s]()[f]},k=function(e){this.a.style[u]=a+"("+e/this.size*this.percentage+"% - "+this.aGutterSize+"px)",this.b.style[u]=a+"("+(this.percentage-e/this.size*this.percentage)+"% - "+this.bGutterSize+"px)"},T=function(){var e=this,t=e.a,n=e.b;t[s]()[u]n?n+1:16*n?e+6*((t-e)*n):1>2*n?t:2>3*n?e+6*((t-e)*(.66666-n)):e},c=function(t,n,o){var r,a;return a=.5>=o?o*(n+1):o+n-o*n,r=2*o-a,{r:f(r,a,t+.33333),g:f(r,a,t),b:f(r,a,t-.33333)}},x=function(t,n,o){var r,a,s,d,l,p,c;return d=S(t,n,o),l=C(t,n,o),r=d-l,c=d+l,a=l===d?0:t===d?(60*(n-o)/r+360)%360:n===d?60*(o-t)/r+120:60*(t-n)/r+240,s=c/2,p=0===s?0:1===s?1:.5>=s?r/c:r/(2-c),{h:a,s:p,l:s}},y=function(n,o,r,a){return null==a?"hsl("+m(t(180*n/s),360)+","+t(100*o)+"%,"+t(100*r)+"%)":"hsla("+m(t(180*n/s),360)+","+t(100*o)+"%,"+t(100*r)+"%,"+a+")"},u=function(t){var n,o,r,a,e,i;return i=document.createElement("span"),document.body.appendChild(i),i.style.backgroundColor=t,e=getComputedStyle(i).backgroundColor,document.body.removeChild(i),r=/^rgb\((\d+), (\d+), (\d+)\)$/.exec(e),r||(r=/^rgba\((\d+), (\d+), (\d+), ([\d.]+)\)$/.exec(e)),a=parseInt(r[1]),o=parseInt(r[2]),n=parseInt(r[3]),r[4]?{r:a/255,g:o/255,b:n/255,a:parseFloat(r[4])}:{r:a/255,g:o/255,b:n/255}},e=function(e){var t,n;return n=document.createElement("span"),document.body.appendChild(n),n.style.backgroundColor=e,t=0e&&(e+=t),e},v=function(e,t,n){return t+(n-t)*C(1,S(0,e))},p=function(){function e(f,E,b){var T,d,e,g,h,i,I,k,l,m,N,A,p,L,r,R,t,u,v,w,x;for(this.radius=f,this.width=E,this.lightness=b,L=this.radius,v=this.width,d=this.canvas=document.createElement("canvas"),d.width=d.height=2*L,e=d.getContext("2d"),N=e.createImageData(d.width,d.height),h=N.data,(x=m=0,r=d.height);0<=r?mr;x=0<=r?++m:--m)for(w=A=0,R=d.width;0<=R?AR;w=0<=R?++A:--A)I=x-L,i=w-L,g=o(I*I+i*i),g>L+1.5||(g-=10,u=S(0,C(1,g/(L-v/2-10))),l=n(I,i)/(2*s),t=c(l,u,this.lightness),p=t.r,k=t.g,T=t.b,h[4*(x*d.width+w)+0]=255*p,h[4*(x*d.width+w)+1]=255*k,h[4*(x*d.width+w)+2]=255*T,h[4*(x*d.width+w)+3]=255);e.putImageData(N,0,0)}return e.prototype.drawHSLCircle=function(t,n){var o,r,a,e;return t.width=t.height=2*this.radius,o=t.getContext("2d"),e=this.width,a=this.radius,r=v(n,e,a),o.save(),o.fillStyle="rgba(0,0,0,0.3)",o.beginPath(),o.arc(a,a,a,0,2*s),o.fill(),o.fillStyle="black",o.beginPath(),o.arc(a,a,r,0,2*s),o.arc(a,a,r-e,0,2*s,!0),o.fill(),o.globalCompositeOperation="source-in",o.drawImage(this.canvas,0,0),o.restore()},e}(),i=function(e){return"string"==typeof e&&(e=u(e)),null!=e.r&&null!=e.g&&null!=e.b?(e=x(e.r,e.g,e.b),e.h=e.h*s/180):null!=e.h&&null!=e.s&&null!=e.l&&(e.h=e.h*s/180),e},a=function(){function e(e){this.color=i(e),this.refColor=this.color,this.el=E(),this.circleContainer=this.el.appendChild(l.call(this)),this.lSlider=this.el.appendChild(b.call(this)),this.colorPreview=this.el.appendChild(f.call(this)),d.call(this),this.setLightness(this.color.l)}var d,l,f,h,b,E,T,w;return T=80,w=25,e.prototype.setHue=function(e){var n,o,r;return this.color.h=e,r=v(this.color.s,w,T)-w/2,o=T-w/2,g(this.hueKnob,{left:t(o+Math.cos(e)*r+6-1)+"px",top:t(o+Math.sin(e)*r+6-1)+"px"}),this.colorPreview.style.backgroundColor=this.lKnob.style.backgroundColor=this.hueKnob.style.backgroundColor=y(this.color.h,this.color.s,this.color.l),n=y(this.color.h,this.color.s,.5),this.lSlider.style.backgroundImage="-webkit-linear-gradient(bottom, black, "+n+" 50%, white)",this.lSlider.style.backgroundImage="-moz-linear-gradient(bottom, black, "+n+" 50%, white)",this.emit("changed")},e.prototype.setSaturation=function(e){return this.color.s=e,this.circle.drawHSLCircle(this.circleCanvas,e),this.setHue(this.color.h)},e.prototype.setLightness=function(e){return this.color.l=e,this.circle=new p(T,w,e),this.lKnob.style.top=(1-e)*this.lSlider._height-11+"px",this.setSaturation(this.color.s)},e.prototype.setHSL=function(e,t,n){return this.color.h=m(e,360)*s/180,this.color.s=S(0,C(1,t)),n=S(0,C(1,n)),this.setLightness(n)},e.prototype.getHSL=function(){return{h:m(180*this.color.h/s,360),s:this.color.s,l:this.color.l}},e.prototype.setRGB=function(t,n,o){var r,a,e,i;return e=x(t,n,o),r=e.h,i=e.s,a=e.l,this.setHSL(r,i,a)},e.prototype.getRGB=function(){return c(this.color.h/(2*s),this.color.s,this.color.l)},e.prototype.getCSS=function(){return y(this.color.h,this.color.s,this.color.l)},e.prototype.setCSS=function(t){var n,o,r,e;return e=u(t),r=e.r,o=e.g,n=e.b,this.setRGB(r,o,n)},e.prototype.on=function(e,t){var n;return null==this._listeners&&(this._listeners={}),(null==(n=this._listeners)[e]?n[e]=[]:n[e]).push(t)},e.prototype.emit=function(){var t,n,o,a,i,e,s,d;if(n=arguments[0],t=2<=arguments.length?r.call(arguments,1):[],this._listeners){for(s=null==(e=this._listeners[n])?[]:e,d=[],(o=0,i=s.length);o=7*s/8||p<=-7*s/8?t.style.cursor="ew-resize":s/8<=p&&p<3*s/8||-7*s/8HSL":"HEX24>RGB>HSL","HEX32>HSLA":"HEX32>RGBA>HSLA","HEX24>CMYK":"HEX24>RGB>CMY>CMYK","RGB>CMYK":"RGB>CMY>CMYK"},i=Color.Space=function(t,n){s[n]&&(n=s[n]);var o=n.split(">");if("object"==typeof t&&0<=t[0]){for(var r=o[0],d={},l=0,p;l>0)+","+(e.G>>0)+","+(e.B>>0)+")"},i.RGBA_W3=function(e){var t="number"==typeof e.A?e.A/255:1;return"rgba("+(e.R>>0)+","+(e.G>>0)+","+(e.B>>0)+","+t+")"},i.W3_RGB=function(e){return e=e.substr(4,e.length-5).split(","),{R:parseInt(e[0],10),G:parseInt(e[1],10),B:parseInt(e[2],10)}},i.W3_RGBA=function(e){return e=e.substr(5,e.length-6).split(","),{R:parseInt(e[0],10),G:parseInt(e[1],10),B:parseInt(e[2],10),A:255*parseFloat(e[3])}},i.HSL_W3=function(e){return"hsl("+(e.H+.5>>0)+","+(e.S+.5>>0)+"%,"+(e.L+.5>>0)+"%)"},i.HSLA_W3=function(e){var t="number"==typeof e.A?e.A/255:1;return"hsla("+(e.H+.5>>0)+","+(e.S+.5>>0)+"%,"+(e.L+.5>>0)+"%,"+t+")"},i.W3_HSL=function(e){var t=e.indexOf("(")+1,n=e.indexOf(")");return e=e.substr(t,n-t).split(","),{H:parseInt(e[0],10),S:parseInt(e[1],10),L:parseInt(e[2],10)}},i.W3_HSLA=function(e){var t=e.indexOf("(")+1,n=e.indexOf(")");return e=e.substr(t,n-t).split(","),{H:parseInt(e[0],10),S:parseInt(e[1],10),L:parseInt(e[2],10),A:255*parseFloat(e[3],10)}},i.W3_HEX=i.W3_HEX24=function(e){return"#"===e.substr(0,1)&&(e=e.substr(1)),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),parseInt("0x"+e,16)},i.W3_HEX32=function(e){return"#"===e.substr(0,1)&&(e=e.substr(1)),6===e.length?parseInt("0xFF"+e,10):parseInt("0x"+e,16)},i.HEX_W3=i.HEX24_W3=function(e,t){t||(t=6),e||(e=0);var n=e.toString(16),o;for(o=n.length;ot;)n=n.substr(1),o--;return"#"+n},i.HEX32_W3=function(e){return i.HEX_W3(e,8)},i.HEX_RGB=i.HEX24_RGB=function(e){return{R:e>>16,G:255&e>>8,B:255&e}},i.HEX32_RGBA=function(e){return{R:255&e>>>16,G:255&e>>>8,B:255&e,A:e>>>24}},i.RGBA_HEX32=function(e){return(e.A<<24|e.R<<16|e.G<<8|e.B)>>>0},i.RGB_HEX24=i.RGB_HEX=function(e){return 0>e.R&&(e.R=0),0>e.G&&(e.G=0),0>e.B&&(e.B=0),255c?p/(e+d):p/(2-e-d);var i=((e-o)/6+p/2)/p,g=((e-a)/6+p/2)/p,l=((e-s)/6+p/2)/p;o===e?u=l-g:a===e?u=1/3+i-l:s===e&&(u=2/3+g-i),0>u&&(u+=1),1c&&(c+=1),1r?r*(1+o):r+o-o*r,d=2*r-l,i=n+1/3,0>i&&(i+=1),16*i?d+6*(l-d)*i:1>2*i?l:2>3*i?d+6*((l-d)*(2/3-i)):d,i=n,0>i&&(i+=1),16*i?d+6*(l-d)*i:1>2*i?l:2>3*i?d+6*((l-d)*(2/3-i)):d,i=n-1/3,0>i&&(i+=1),16*i?d+6*(l-d)*i:1>2*i?l:2>3*i?d+6*((l-d)*(2/3-i)):d),{R:255*a,G:255*e,B:255*s,A:t.A}},i.HSVA_RGBA=i.HSV_RGB=function(t){var r=t.H/360,a=t.S/100,s=t.V/100,d,l,p,c,u,i;if(0==a)d=l=p=o(255*s);else switch(1<=r&&(r=0),r=6*r,c=r-n(r),u=o(255*s*(1-a)),p=o(255*s*(1-a*c)),i=o(255*s*(1-a*(1-c))),s=o(255*s),n(r)){case 0:d=s,l=i,p=u;break;case 1:d=p,l=s,p=u;break;case 2:d=u,l=s,p=i;break;case 3:d=u,l=p,p=s;break;case 4:d=i,l=u,p=s;break;case 5:d=s,l=u,p=p;}return{R:d,G:l,B:p,A:t.A}}}(),Inlet=function(){function e(b,C){function c(){var e=d.value+"",t=N.getCursor(!0),n=w(t,"number");if(n){var o={line:t.line,ch:n.start},r={line:t.line,ch:n.end};N.dragging=!0,N.replaceRange(e,o,r)}}function S(n){if(!N.somethingSelected()){I=n.target;var a=N.getCursor(!0),d=N.getTokenAt(a);cursorOffset=N.cursorCoords(!0,"page");var l=N.cursorCoords(!0,L).left,o=w(a,"number"),p=w(a,"hsl"),r=w(a,"hex"),s=w(a,"rgb"),t=w(a,"boolean"),c=cursorOffset.top-h;cursorOffset.topHSL>RGB>HEX24>W3"),P(picked,"hex")})}else if(p){var g=p.string;e=new thistle.Picker(g),e.setCSS(g),e.presentModal(m,c),e.on("changed",function(){picked=e.getCSS(),P(picked,"hsl")})}else if(s){var g=s.string;e=new thistle.Picker(g),e.setCSS(g),e.presentModal(m,c),e.on("changed",function(){picked=e.getCSS(),picked=Color.Space(picked,"W3>HSL>RGB>W3"),P(picked,"rgb")})}}}function T(e){var t,n;return t=0===e?[-100,100]:[3*-e,5*e],t[0]=d&&t.ch<=l)return e=null,{start:d,end:l,string:a};e=o.exec(r)}}}var N=b,d,e,A;C||(C={}),C.picker||(C.picker={}),C.slider||(C.slider={}),C.clicker||(C.clicker={});var g=C.container||document.body,h=C.picker.topOffset||220,i=C.picker.bottomOffset||16,f=C.picker.topBoundary||250,k=C.picker.leftOffset||75,l=C.slider.yOffset||15,m=C.slider.xOffset||0,n=C.slider.width,L=C.horizontalMode||"page",o=C.fixedContainer,p=C.slider.callback||function(){},r=C.picker.callback||function(){},s=C.clicker.callback||function(){},t=N.getWrapperElement();t.addEventListener("mouseup",S),document.body.addEventListener("mouseup",function(e){e.target===I||e.target===v||e.target===d||e.target===u||e.target===A||(v.style.visibility="hidden",u.style.visibility="hidden")}),N.setOption("onKeyEvent",function(){if(event=1==arguments.length?arguments[0]:arguments[1],event.keyCode==y||event.keyCode==O){if("visible"===v.style.visibility)return d.stepDown(1),c(),!0;event.altKey&&S()}else if(event.keyCode==E||event.keyCode==R){if("visible"===v.style.visibility)return d.stepUp(1),c(),!0;event.altKey&&S()}else v.style.visibility="hidden"});var u=document.createElement("div");u.className="inlet_clicker",u.style.visibility="hidden",u.style.position="absolute",g.appendChild(u);var A=document.createElement("input");A.className="checkbox",A.setAttribute("type","checkbox"),A.addEventListener("change",function(){var t=A.checked+"",n=N.getCursor(!0),o=w(n,"boolean");if(o){var e={line:n.line,ch:o.start},r={line:n.line,ch:o.end};N.replaceRange(t,e,r)}}),u.appendChild(A);var v=document.createElement("div");v.className="inlet_slider",v.style.visibility="hidden",n&&(v.style.width=n),v.style.position=o?"fixed":"absolute",v.style.top=0,g.appendChild(v);var d=document.createElement("input");d.className="range",d.setAttribute("type","range"),d.addEventListener("input",c),d.addEventListener("change",c);var x=-1=a.start&&(n.unshift(a.comment),this.leading.splice(r,1),this.trailing.splice(r,1));n.length&&(e.innerComments=n)}},e.prototype.findTrailingComments=function(e,t){var n=[];if(0=t.end.offset&&n.unshift(r.comment);return this.trailing.length=0,n}var a=this.stack[this.stack.length-1];if(a&&a.node.trailingComments){var i=a.node.trailingComments[0];i&&i.range[0]>=t.end.offset&&(n=a.node.trailingComments,delete a.node.trailingComments)}return n},e.prototype.findLeadingComments=function(e,t){for(var n=[],o,r;0=t.start.offset);)o=this.stack.pop().node;if(o){for(var a=o.leadingComments?o.leadingComments.length:0,s=a-1,i;0<=s;--s)i=o.leadingComments[s],i.range[1]<=t.start.offset&&(n.unshift(i),o.leadingComments.splice(s,1));return o.leadingComments&&0===o.leadingComments.length&&delete o.leadingComments,n}for(var s=this.leading.length-1,r;0<=s;--s)r=this.leading[s],r.start<=t.start.offset&&(n.unshift(r.comment),this.leading.splice(s,1));return n},e.prototype.visitNode=function(e,t){if(!(e.type===o.Syntax.Program&&0":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.sourceType=t&&"module"===t.sourceType?"module":"script",this.lookahead=null,this.hasLineTerminator=!1,this.context={allowIn:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:"module"===this.sourceType},this.tokens=[],this.startMarker={index:0,lineNumber:this.scanner.lineNumber,lineStart:0},this.lastMarker={index:0,lineNumber:this.scanner.lineNumber,lineStart:0},this.nextToken(),this.lastMarker={index:this.scanner.index,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart}}return e.prototype.throwError=function(e){for(var t=[],n=1;n>="===e||">>>="===e||"&="===e||"^="===e||"|="===e},e.prototype.isolateCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,o=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=e.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=t,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=o,r},e.prototype.inheritCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,o=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=e.call(this);return this.context.isBindingElement=this.context.isBindingElement&&t,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=o||this.context.firstCoverInitializedNameError,r},e.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():!this.hasLineTerminator&&(this.lookahead.type!==i.Token.EOF&&!this.match("}")&&this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.lineNumber=this.startMarker.lineNumber,this.lastMarker.lineStart=this.startMarker.lineStart)},e.prototype.parsePrimaryExpression=function(){var e=this.createNode(),t,n,o,a;switch(this.lookahead.type){case i.Token.Identifier:"module"===this.sourceType&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),t=this.finalize(e,new l.Identifier(this.nextToken().value));break;case i.Token.NumericLiteral:case i.Token.StringLiteral:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,r.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,o=this.nextToken(),a=this.getTokenRaw(o),t=this.finalize(e,new l.Literal(o.value,a));break;case i.Token.BooleanLiteral:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,o=this.nextToken(),o.value="true"===o.value,a=this.getTokenRaw(o),t=this.finalize(e,new l.Literal(o.value,a));break;case i.Token.NullLiteral:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,o=this.nextToken(),o.value=null,a=this.getTokenRaw(o),t=this.finalize(e,new l.Literal(o.value,a));break;case i.Token.Template:t=this.parseTemplateLiteral();break;case i.Token.Punctuator:n=this.lookahead.value,"("===n?(this.context.isBindingElement=!1,t=this.inheritCoverGrammar(this.parseGroupExpression)):"["===n?t=this.inheritCoverGrammar(this.parseArrayInitializer):"{"===n?t=this.inheritCoverGrammar(this.parseObjectInitializer):"/"===n||"/="===n?(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,o=this.nextRegexToken(),a=this.getTokenRaw(o),t=this.finalize(e,new l.RegexLiteral(o.value,a,o.regex))):this.throwUnexpectedToken(this.nextToken());break;case i.Token.Keyword:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?t=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?t=this.finalize(e,new l.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?t=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),t=this.finalize(e,new l.ThisExpression)):this.matchKeyword("class")?t=this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:this.throwUnexpectedToken(this.nextToken());}return t},e.prototype.parseSpreadElement=function(){var e=this.createNode();this.expect("...");var t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(e,new l.SpreadElement(t))},e.prototype.parseArrayInitializer=function(){var e=this.createNode(),t=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),t.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),t.push(n)}else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(e,new l.ArrayExpression(t))},e.prototype.parsePropertyMethod=function(e){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var t=this.context.strict,n=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&e.firstRestricted&&this.tolerateUnexpectedToken(e.firstRestricted,e.message),this.context.strict&&e.stricted&&this.tolerateUnexpectedToken(e.stricted,e.message),this.context.strict=t,n},e.prototype.parsePropertyMethodFunction=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters(),o=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new l.FunctionExpression(null,n.params,o,!1))},e.prototype.parseObjectPropertyKey=function(){var e=this.createNode(),t=this.nextToken(),n=null;switch(t.type){case i.Token.StringLiteral:case i.Token.NumericLiteral:this.context.strict&&t.octal&&this.tolerateUnexpectedToken(t,r.Messages.StrictOctalLiteral);var o=this.getTokenRaw(t);n=this.finalize(e,new l.Literal(t.value,o));break;case i.Token.Identifier:case i.Token.BooleanLiteral:case i.Token.NullLiteral:case i.Token.Keyword:n=this.finalize(e,new l.Identifier(t.value));break;case i.Token.Punctuator:"["===t.value?(n=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):this.throwUnexpectedToken(t);break;default:this.throwUnexpectedToken(t);}return n},e.prototype.isPropertyKey=function(e,t){return e.type===d.Syntax.Identifier&&e.name===t||e.type===d.Syntax.Literal&&e.value===t},e.prototype.parseObjectProperty=function(e){var t=this.createNode(),n=this.lookahead,o=!1,a=!1,s=!1,d,p,c;n.type===i.Token.Identifier?(this.nextToken(),p=this.finalize(t,new l.Identifier(n.value))):this.match("*")?this.nextToken():(o=this.match("["),p=this.parseObjectPropertyKey());var u=this.qualifiedPropertyName(this.lookahead);if(n.type===i.Token.Identifier&&"get"===n.value&&u)d="get",o=this.match("["),p=this.parseObjectPropertyKey(),this.context.allowYield=!1,c=this.parseGetterMethod();else if(n.type===i.Token.Identifier&&"set"===n.value&&u)d="set",o=this.match("["),p=this.parseObjectPropertyKey(),c=this.parseSetterMethod();else if(n.type===i.Token.Punctuator&&"*"===n.value&&u)d="init",o=this.match("["),p=this.parseObjectPropertyKey(),c=this.parseGeneratorMethod(),a=!0;else if(p||this.throwUnexpectedToken(this.lookahead),d="init",this.match(":"))!o&&this.isPropertyKey(p,"__proto__")&&(e.value&&this.tolerateError(r.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),c=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))c=this.parsePropertyMethodFunction(),a=!0;else if(n.type===i.Token.Identifier){var h=this.finalize(t,new l.Identifier(n.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),s=!0;var m=this.isolateCoverGrammar(this.parseAssignmentExpression);c=this.finalize(t,new l.AssignmentPattern(h,m))}else s=!0,c=h}else this.throwUnexpectedToken(this.nextToken());return this.finalize(t,new l.Property(d,p,o,c,a,s))},e.prototype.parseObjectInitializer=function(){var e=this.createNode();this.expect("{");for(var t=[],n={value:!1};!this.match("}");)t.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(e,new l.ObjectExpression(t))},e.prototype.parseTemplateHead=function(){o.assert(this.lookahead.head,"Template literal must start with a template head");var e=this.createNode(),t=this.nextToken(),n={raw:t.value.raw,cooked:t.value.cooked};return this.finalize(e,new l.TemplateElement(n,t.tail))},e.prototype.parseTemplateElement=function(){this.lookahead.type!==i.Token.Template&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),n={raw:t.value.raw,cooked:t.value.cooked};return this.finalize(e,new l.TemplateElement(n,t.tail))},e.prototype.parseTemplateLiteral=function(){var e=this.createNode(),t=[],n=[],o=this.parseTemplateHead();for(n.push(o);!o.tail;)t.push(this.parseExpression()),o=this.parseTemplateElement(),n.push(o);return this.finalize(e,new l.TemplateLiteral(n,t))},e.prototype.reinterpretExpressionAsPattern=function(e){switch(e.type){case d.Syntax.Identifier:case d.Syntax.MemberExpression:case d.Syntax.RestElement:case d.Syntax.AssignmentPattern:break;case d.Syntax.SpreadElement:e.type=d.Syntax.RestElement,this.reinterpretExpressionAsPattern(e.argument);break;case d.Syntax.ArrayExpression:e.type=d.Syntax.ArrayPattern;for(var t=0;t")||this.expect("=>"),e={type:p,params:[]};else{var t=this.lookahead,n=[];if(this.match("..."))e=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),e={type:p,params:[e]};else{var o=!1;if(this.context.isBindingElement=!0,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var r=[];for(this.context.isAssignmentTarget=!1,r.push(e);this.startMarker.index")||this.expect("=>"),this.context.isBindingElement=!1;for(var a=0;a")&&(e.type===d.Syntax.Identifier&&"yield"===e.name&&(o=!0,e={type:p,params:[e]}),!o)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===d.Syntax.SequenceExpression)for(var a=0;a=o);){for(;2")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var o=this.reinterpretAsCoverFormalsList(e);if(o){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var a=this.context.strict,i=this.context.allowYield;this.context.allowYield=!0;var s=this.startNode(t);this.expect("=>");var c=this.match("{")?this.parseFunctionSourceElements():this.isolateCoverGrammar(this.parseAssignmentExpression),u=c.type!==d.Syntax.BlockStatement;this.context.strict&&o.firstRestricted&&this.throwUnexpectedToken(o.firstRestricted,o.message),this.context.strict&&o.stricted&&this.tolerateUnexpectedToken(o.stricted,o.message),e=this.finalize(s,new l.ArrowFunctionExpression(o.params,c,u)),this.context.strict=a,this.context.allowYield=i}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(r.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===d.Syntax.Identifier){var h=e;this.scanner.isRestrictedWord(h.name)&&this.tolerateUnexpectedToken(n,r.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(h.name)&&this.tolerateUnexpectedToken(n,r.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),n=this.nextToken();var m=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new l.AssignmentExpression(n.value,e,m)),this.context.firstCoverInitializedNameError=null}}return e},e.prototype.parseExpression=function(){var e=this.lookahead,t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){for(var n=[t];this.startMarker.index",t.TokenName[n.Identifier]="Identifier",t.TokenName[n.Keyword]="Keyword",t.TokenName[n.NullLiteral]="Null",t.TokenName[n.NumericLiteral]="Numeric",t.TokenName[n.Punctuator]="Punctuator",t.TokenName[n.StringLiteral]="String",t.TokenName[n.RegularExpression]="RegularExpression",t.TokenName[n.Template]="Template"},function(t,n,o){"use strict";function r(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function a(e){return"01234567".indexOf(e)}var i=o(4),s=o(5),d=o(9),l=o(7),p=function(){function t(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.length=e.length,this.index=0,this.lineNumber=0=this.length},t.prototype.throwUnexpectedToken=function(e){void 0===e&&(e=s.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},t.prototype.tolerateUnexpectedToken=function(){this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,s.Messages.UnexpectedTokenIllegal)},t.prototype.skipSingleLineComment=function(e){var t,n,o;for(this.trackComment&&(t=[],n=this.index-e,o={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{}});!this.eof();){var r=this.source.charCodeAt(this.index);if(++this.index,d.Character.isLineTerminator(r)){if(this.trackComment){o.end={line:this.lineNumber,column:this.index-this.lineStart-1};var a={multiLine:!1,slice:[n+e,this.index-1],range:[n,this.index-1],loc:o};t.push(a)}return 13===r&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t}}if(this.trackComment){o.end={line:this.lineNumber,column:this.index-this.lineStart};var a={multiLine:!1,slice:[n+e,this.index],range:[n,this.index],loc:o};t.push(a)}return t},t.prototype.skipMultiLineComment=function(){var e,t,n;for(this.trackComment&&(e=[],t=this.index-2,n={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var o=this.source.charCodeAt(this.index);if(d.Character.isLineTerminator(o))13===o&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===o){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var r={multiLine:!0,slice:[t+2,this.index-2],range:[t,this.index],loc:n};e.push(r)}return e}++this.index}else++this.index}if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var r={multiLine:!0,slice:[t+2,this.index],range:[t,this.index],loc:n};e.push(r)}return this.tolerateUnexpectedToken(),e},t.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index,n;!this.eof();)if(n=this.source.charCodeAt(this.index),d.Character.isWhiteSpace(n))++this.index;else if(d.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t=!0;else if(47===n){if(n=this.source.charCodeAt(this.index+1),47===n){this.index+=2;var o=this.skipSingleLineComment(2);this.trackComment&&(e=e.concat(o)),t=!0}else if(42===n){this.index+=2;var o=this.skipMultiLineComment();this.trackComment&&(e=e.concat(o))}else break;}else if(t&&45===n){if(45===this.source.charCodeAt(this.index+1)&&62===this.source.charCodeAt(this.index+2)){this.index+=3;var o=this.skipSingleLineComment(3);this.trackComment&&(e=e.concat(o))}else break;}else if(60!==n)break;else if("!--"===this.source.slice(this.index+1,this.index+4)){this.index+=4;var o=this.skipSingleLineComment(4);this.trackComment&&(e=e.concat(o))}else break;return e},t.prototype.isFutureReservedWord=function(e){return"enum"===e||"export"===e||"import"===e||"super"===e},t.prototype.isStrictModeReservedWord=function(e){return"implements"===e||"interface"===e||"package"===e||"private"===e||"protected"===e||"public"===e||"static"===e||"yield"===e||"let"===e},t.prototype.isRestrictedWord=function(e){return"eval"===e||"arguments"===e},t.prototype.isKeyword=function(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1;}},t.prototype.codePointAt=function(e){var t=this.source.charCodeAt(e);if(55296<=t&&56319>=t){var n=this.source.charCodeAt(e+1);if(56320<=n&&57343>=n){var o=t;t=1024*(o-55296)+n-56320+65536}}return t},t.prototype.scanHexEscape=function(t){for(var n="u"===t?4:2,o=0,a=0;at)return this.index=e,this.getComplexIdentifier();if(d.Character.isIdentifierPart(t))++this.index;else break}return this.source.slice(e,this.index)},t.prototype.getComplexIdentifier=function(){var e=this.codePointAt(this.index),t=d.Character.fromCodePoint(e);this.index+=t.length;var n;for(92===e&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):(n=this.scanHexEscape("u"),e=n.charCodeAt(0),(!n||"\\"===n||!d.Character.isIdentifierStart(e))&&this.throwUnexpectedToken()),t=n);!this.eof()&&(e=this.codePointAt(this.index),!!d.Character.isIdentifierPart(e));)n=d.Character.fromCodePoint(e),t+=n,this.index+=n.length,92===e&&(t=t.substr(0,t.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):(n=this.scanHexEscape("u"),e=n.charCodeAt(0),(!n||"\\"===n||!d.Character.isIdentifierPart(e))&&this.throwUnexpectedToken()),t+=n);return t},t.prototype.octalToDecimal=function(e){var t="0"!==e,n=a(e);return!this.eof()&&d.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+a(this.source[this.index++]),0<="0123".indexOf(e)&&!this.eof()&&d.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+a(this.source[this.index++]))),{code:n,octal:t}},t.prototype.scanIdentifier=function(){var e=this.index,t=92===this.source.charCodeAt(e)?this.getComplexIdentifier():this.getIdentifier(),n;return n=1===t.length?l.Token.Identifier:this.isKeyword(t)?l.Token.Keyword:"null"===t?l.Token.NullLiteral:"true"===t||"false"===t?l.Token.BooleanLiteral:l.Token.Identifier,{type:n,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.scanPunctuator=function(){var e={type:l.Token.Punctuator,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index},t=this.source[this.index];return"("===t||"{"===t?("{"===t&&this.curlyStack.push("{"),++this.index):"."===t?(++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,t="...")):"}"===t?(++this.index,this.curlyStack.pop()):")"===t||";"===t||","===t||"["===t||"]"===t||":"===t||"?"===t||"~"===t?++this.index:(t=this.source.substr(this.index,4),">>>="===t?this.index+=4:(t=t.substr(0,3),"==="===t||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:(t=t.substr(0,2),"&&"===t||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],0<="<>=!+-*%&|^/".indexOf(t)&&++this.index)))),this.index===e.start&&this.throwUnexpectedToken(),e.end=this.index,e.value=t,e},t.prototype.scanHexLiteral=function(e){for(var t="";!this.eof()&&!!d.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),d.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:l.Token.NumericLiteral,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.scanBinaryLiteral=function(e){for(var t="",n;!this.eof()&&(n=this.source[this.index],"0"===n||"1"===n);)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),this.eof()||(n=this.source.charCodeAt(this.index),(d.Character.isIdentifierStart(n)||d.Character.isDecimalDigit(n))&&this.throwUnexpectedToken()),{type:l.Token.NumericLiteral,value:parseInt(t,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.scanOctalLiteral=function(e,t){var n="",o=!1;for(d.Character.isOctalDigit(e.charCodeAt(0))?(o=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&!!d.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return o||0!==n.length||this.throwUnexpectedToken(),(d.Character.isIdentifierStart(this.source.charCodeAt(this.index))||d.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:l.Token.NumericLiteral,value:parseInt(n,8),octal:o,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1,t;e=i?e(i):o}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o));try{RegExp(r)}catch(t){this.throwUnexpectedToken(s.Messages.InvalidRegExp)}try{return new RegExp(t,n)}catch(e){return null}},t.prototype.scanRegExpBody=function(){var e=this.source[this.index];i.assert("/"===e,"Regular expression literal must start with a slash");for(var t=this.source[this.index++],n=!1,o=!1;!this.eof();)if(e=this.source[this.index++],t+=e,"\\"===e)e=this.source[this.index++],d.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),t+=e;else if(d.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);else if(n)"]"===e&&(n=!1);else if("/"===e){o=!0;break}else"["===e&&(n=!0);o||this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);var r=t.substr(1,t.length-2);return{value:r,literal:t}},t.prototype.scanRegExpFlags=function(){for(var e="",t="",n;!this.eof()&&(n=this.source[this.index],!!d.Character.isIdentifierPart(n.charCodeAt(0)));)if(++this.index,"\\"!==n||this.eof())t+=n,e+=n;else if(n=this.source[this.index],"u"===n){++this.index;var o=this.index;if(n=this.scanHexEscape("u"),n)for(t+=n,e+="\\u";oe&&d.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},t)}();n.Scanner=p},function(t,n){"use strict";var o={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\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-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\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\u0AF9\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-\u0C39\u0C3D\u0C58-\u0C5A\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\u0D5F-\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-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\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\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\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\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};n.Character={fromCodePoint:function(t){return 65536>t?e(t):e(55296+(t-65536>>10))+e(56320+(1023&t-65536))},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||5760<=e&&0<=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStart:function(e){return 36===e||95===e||65<=e&&90>=e||97<=e&&122>=e||92===e||128<=e&&o.NonAsciiIdentifierStart.test(n.Character.fromCodePoint(e))},isIdentifierPart:function(e){return 36===e||95===e||65<=e&&90>=e||97<=e&&122>=e||48<=e&&57>=e||92===e||128<=e&&o.NonAsciiIdentifierPart.test(n.Character.fromCodePoint(e))},isDecimalDigit:function(e){return 48<=e&&57>=e},isHexDigit:function(e){return 48<=e&&57>=e||65<=e&&70>=e||97<=e&&102>=e},isOctalDigit:function(e){return 48<=e&&55>=e}}},function(e,t,n){"use strict";var o=n(2),r=function(){return function(e){this.type=o.Syntax.ArrayExpression,this.elements=e}}();t.ArrayExpression=r;var a=function(){return function(e){this.type=o.Syntax.ArrayPattern,this.elements=e}}();t.ArrayPattern=a;var i=function(){return function(e,t,n){this.type=o.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n}}();t.ArrowFunctionExpression=i;var s=function(){return function(e,t,n){this.type=o.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=n}}();t.AssignmentExpression=s;var d=function(){return function(e,t){this.type=o.Syntax.AssignmentPattern,this.left=e,this.right=t}}();t.AssignmentPattern=d;var l=function(){return function(e,t,n){this.type="||"===e||"&&"===e?o.Syntax.LogicalExpression:o.Syntax.BinaryExpression,this.operator=e,this.left=t,this.right=n}}();t.BinaryExpression=l;var p=function(){return function(e){this.type=o.Syntax.BlockStatement,this.body=e}}();t.BlockStatement=p;var c=function(){return function(e){this.type=o.Syntax.BreakStatement,this.label=e}}();t.BreakStatement=c;var u=function(){return function(e,t){this.type=o.Syntax.CallExpression,this.callee=e,this.arguments=t}}();t.CallExpression=u;var h=function(){return function(e,t){this.type=o.Syntax.CatchClause,this.param=e,this.body=t}}();t.CatchClause=h;var m=function(){return function(e){this.type=o.Syntax.ClassBody,this.body=e}}();t.ClassBody=m;var g=function(){return function(e,t,n){this.type=o.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=n}}();t.ClassDeclaration=g;var f=function(){return function(e,t,n){this.type=o.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=n}}();t.ClassExpression=f;var y=function(){return function(e,t){this.type=o.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t}}();t.ComputedMemberExpression=y;var b=function(){return function(e,t,n){this.type=o.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n}}();t.ConditionalExpression=b;var v=function(){return function(e){this.type=o.Syntax.ContinueStatement,this.label=e}}();t.ContinueStatement=v;var x=function(){return function(){this.type=o.Syntax.DebuggerStatement}}();t.DebuggerStatement=x;var C=function(){return function(e,t){this.type=o.Syntax.ExpressionStatement,this.expression=e,this.directive=t}}();t.Directive=C;var S=function(){return function(e,t){this.type=o.Syntax.DoWhileStatement,this.body=e,this.test=t}}();t.DoWhileStatement=S;var E=function(){return function(){this.type=o.Syntax.EmptyStatement}}();t.EmptyStatement=E;var k=function(){return function(e){this.type=o.Syntax.ExportAllDeclaration,this.source=e}}();t.ExportAllDeclaration=k;var T=function(){return function(e){this.type=o.Syntax.ExportDefaultDeclaration,this.declaration=e}}();t.ExportDefaultDeclaration=T;var w=function(){return function(e,t,n){this.type=o.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=n}}();t.ExportNamedDeclaration=w;var I=function(){return function(e,t){this.type=o.Syntax.ExportSpecifier,this.exported=t,this.local=e}}();t.ExportSpecifier=I;var N=function(){return function(e){this.type=o.Syntax.ExpressionStatement,this.expression=e}}();t.ExpressionStatement=N;var A=function(){return function(e,t,n){this.type=o.Syntax.ForInStatement,this.left=e,this.right=t,this.body=n,this.each=!1}}();t.ForInStatement=A;var L=function(){return function(e,t,n){this.type=o.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=n}}();t.ForOfStatement=L;var R=function(){return function(e,t,n,r){this.type=o.Syntax.ForStatement,this.init=e,this.test=t,this.update=n,this.body=r}}();t.ForStatement=R;var O=function(){return function(e,t,n,r){this.type=o.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=r,this.expression=!1}}();t.FunctionDeclaration=O;var P=function(){return function(e,t,n,r){this.type=o.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=r,this.expression=!1}}();t.FunctionExpression=P;var _=function(){return function(e){this.type=o.Syntax.Identifier,this.name=e}}();t.Identifier=_;var D=function(){return function(e,t,n){this.type=o.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=n}}();t.IfStatement=D;var M=function(){return function(e,t){this.type=o.Syntax.ImportDeclaration,this.specifiers=e,this.source=t}}();t.ImportDeclaration=M;var F=function(){return function(e){this.type=o.Syntax.ImportDefaultSpecifier,this.local=e}}();t.ImportDefaultSpecifier=F;var B=function(){return function(e){this.type=o.Syntax.ImportNamespaceSpecifier,this.local=e}}();t.ImportNamespaceSpecifier=B;var U=function(){return function(e,t){this.type=o.Syntax.ImportSpecifier,this.local=e,this.imported=t}}();t.ImportSpecifier=U;var V=function(){return function(e,t){this.type=o.Syntax.LabeledStatement,this.label=e,this.body=t}}();t.LabeledStatement=V;var W=function(){return function(e,t){this.type=o.Syntax.Literal,this.value=e,this.raw=t}}();t.Literal=W;var H=function(){return function(e,t){this.type=o.Syntax.MetaProperty,this.meta=e,this.property=t}}();t.MetaProperty=H;var j=function(){return function(e,t,n,r,a){this.type=o.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=n,this.kind=r,this.static=a}}();t.MethodDefinition=j;var q=function(){return function(e,t){this.type=o.Syntax.NewExpression,this.callee=e,this.arguments=t}}();t.NewExpression=q;var z=function(){return function(e){this.type=o.Syntax.ObjectExpression,this.properties=e}}();t.ObjectExpression=z;var K=function(){return function(e){this.type=o.Syntax.ObjectPattern,this.properties=e}}();t.ObjectPattern=K;var G=function(){return function(e,t){this.type=o.Syntax.Program,this.body=e,this.sourceType=t}}();t.Program=G;var X=function(){return function(e,t,n,r,a,i){this.type=o.Syntax.Property,this.key=t,this.computed=n,this.value=r,this.kind=e,this.method=a,this.shorthand=i}}();t.Property=X;var Q=function(){return function(e,t,n){this.type=o.Syntax.Literal,this.value=e,this.raw=t,this.regex=n}}();t.RegexLiteral=Q;var Y=function(){return function(e){this.type=o.Syntax.RestElement,this.argument=e}}();t.RestElement=Y;var J=function(){return function(e){this.type=o.Syntax.ReturnStatement,this.argument=e}}();t.ReturnStatement=J;var $=function(){return function(e){this.type=o.Syntax.SequenceExpression,this.expressions=e}}();t.SequenceExpression=$;var Z=function(){return function(e){this.type=o.Syntax.SpreadElement,this.argument=e}}();t.SpreadElement=Z;var ee=function(){return function(e,t){this.type=o.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t}}();t.StaticMemberExpression=ee;var te=function(){return function(){this.type=o.Syntax.Super}}();t.Super=te;var ne=function(){return function(e,t){this.type=o.Syntax.SwitchCase,this.test=e,this.consequent=t}}();t.SwitchCase=ne;var oe=function(){return function(e,t){this.type=o.Syntax.SwitchStatement,this.discriminant=e,this.cases=t}}();t.SwitchStatement=oe;var re=function(){return function(e,t){this.type=o.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t}}();t.TaggedTemplateExpression=re;var ae=function(){return function(e,t){this.type=o.Syntax.TemplateElement,this.value=e,this.tail=t}}();t.TemplateElement=ae;var ie=function(){return function(e,t){this.type=o.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t}}();t.TemplateLiteral=ie;var se=function(){return function(){this.type=o.Syntax.ThisExpression}}();t.ThisExpression=se;var de=function(){return function(e){this.type=o.Syntax.ThrowStatement,this.argument=e}}();t.ThrowStatement=de;var le=function(){return function(e,t,n){this.type=o.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=n}}();t.TryStatement=le;var pe=function(){return function(e,t){this.type=o.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0}}();t.UnaryExpression=pe;var ce=function(){return function(e,t,n){this.type=o.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=n}}();t.UpdateExpression=ce;var ue=function(){return function(e,t){this.type=o.Syntax.VariableDeclaration,this.declarations=e,this.kind=t}}();t.VariableDeclaration=ue;var he=function(){return function(e,t){this.type=o.Syntax.VariableDeclarator,this.id=e,this.init=t}}();t.VariableDeclarator=he;var me=function(){return function(e,t){this.type=o.Syntax.WhileStatement,this.test=e,this.body=t}}();t.WhileStatement=me;var ge=function(){return function(e,t){this.type=o.Syntax.WithStatement,this.object=e,this.body=t}}();t.WithStatement=ge;var fe=function(){return function(e,t){this.type=o.Syntax.YieldExpression,this.argument=e,this.delegate=t}}();t.YieldExpression=fe},function(t,n,o){"use strict";function r(e){var t;switch(e.type){case p.JSXSyntax.JSXIdentifier:t=e.name;break;case p.JSXSyntax.JSXNamespacedName:var n=e;t=r(n.namespace)+":"+r(n.name);break;case p.JSXSyntax.JSXMemberExpression:var o=e;t=r(o.object)+"."+r(o.property);}return t}var a=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=o(9),s=o(7),d=o(3),l=o(12),p=o(13),c=o(10),u=o(14),h;(function(e){e[e.Identifier=100]="Identifier",e[e.Text=101]="Text"})(h||(h={})),s.TokenName[h.Identifier]="JSXIdentifier",s.TokenName[h.Text]="JSXText";var m=function(t){function n(e,n,o){t.call(this,e,n,o)}return a(n,t),n.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():t.prototype.parsePrimaryExpression.call(this)},n.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.lineNumber,this.scanner.lineStart=this.startMarker.lineStart},n.prototype.finishJSX=function(){this.nextToken()},n.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},n.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},n.prototype.scanXHTMLEntity=function(){for(var t="&",n="",o;!this.scanner.eof();){if(o=this.scanner.source[this.scanner.index++],";"===o){if("#"===n[0]){n=n.substr(1);var r="x"===n[0],a=r?parseInt("0"+n,16):parseInt(n,10);t=e(a)}else l.XHTMLEntities[n]?t=l.XHTMLEntities[n]:t+=o;break}n+=o,t+=o}return t},n.prototype.lexJSX=function(){var e=this.scanner.source.charCodeAt(this.scanner.index);if(60===e||62===e||47===e||58===e||61===e||123===e||125===e){var t=this.scanner.source[this.scanner.index++];return{type:s.Token.Punctuator,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(34===e||39===e){for(var n=this.scanner.index,o=this.scanner.source[this.scanner.index++],r="",a;!this.scanner.eof()&&(a=this.scanner.source[this.scanner.index++],a!==o);)r+="&"===a?this.scanXHTMLEntity():a;return{type:s.Token.StringLiteral,value:r,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(46===e){var d=this.scanner.source.charCodeAt(this.scanner.index+1),l=this.scanner.source.charCodeAt(this.scanner.index+2),t=46===d&&46===l?"...":".",n=this.scanner.index;return this.scanner.index+=t.length,{type:s.Token.Punctuator,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(i.Character.isIdentifierStart(e)&&92!==e){var n=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var a=this.scanner.source.charCodeAt(this.scanner.index);if(i.Character.isIdentifierPart(a)&&92!==a)++this.scanner.index;else if(45===a)++this.scanner.index;else break}var p=this.scanner.source.slice(n,this.scanner.index);return{type:h.Identifier,value:p,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}this.scanner.throwUnexpectedToken()},n.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.lineNumber=this.scanner.lineNumber,this.startMarker.lineStart=this.scanner.lineStart;var e=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(e)),e},n.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.lineNumber=this.scanner.lineNumber,this.startMarker.lineStart=this.scanner.lineStart;for(var e=this.scanner.index,t="",n;!this.scanner.eof()&&(n=this.scanner.source[this.scanner.index],"{"!==n&&"<"!==n);)++this.scanner.index,t+=n,i.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index);this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart;var o={type:h.Text,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index};return 0");)t=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute(),e.push(t);return e},n.prototype.parseJSXOpeningElement=function(){var e=this.createJSXNode();this.expectJSX("<");var t=this.parseJSXElementName(),n=this.parseJSXAttributes(),o=this.matchJSX("/");return o&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new u.JSXOpeningElement(t,o,n))},n.prototype.parseJSXBoundaryElement=function(){var e=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var t=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(e,new u.JSXClosingElement(t))}var n=this.parseJSXElementName(),o=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new u.JSXOpeningElement(n,r,o))},n.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart,this.finalize(e,new u.JSXEmptyExpression)},n.prototype.parseJSXExpression=function(){var e;return this.matchJSX("}")?e=this.parseJSXEmptyExpression():(this.finishJSX(),e=this.parseAssignmentExpression(),this.startJSX()),e},n.prototype.parseJSXExpressionContainer=function(){var e=this.createJSXNode();this.expectJSX("{");var t=this.parseJSXExpression();return this.expectJSX("}"),this.finalize(e,new u.JSXExpressionContainer(t))},n.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),n=this.nextJSXText();if(n.start",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",lang:"\u27E8",rang:"\u27E9"}},function(e,t){"use strict";t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,n){"use strict";var o=n(13),r=function(){return function(e){this.type=o.JSXSyntax.JSXClosingElement,this.name=e}}();t.JSXClosingElement=r;var a=function(){return function(e,t,n){this.type=o.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=n}}();t.JSXElement=a;var i=function(){return function(){this.type=o.JSXSyntax.JSXEmptyExpression}}();t.JSXEmptyExpression=i;var s=function(){return function(e){this.type=o.JSXSyntax.JSXExpressionContainer,this.expression=e}}();t.JSXExpressionContainer=s;var d=function(){return function(e){this.type=o.JSXSyntax.JSXIdentifier,this.name=e}}();t.JSXIdentifier=d;var l=function(){return function(e,t){this.type=o.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t}}();t.JSXMemberExpression=l;var p=function(){return function(e,t){this.type=o.JSXSyntax.JSXAttribute,this.name=e,this.value=t}}();t.JSXAttribute=p;var c=function(){return function(e,t){this.type=o.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t}}();t.JSXNamespacedName=c;var u=function(){return function(e,t,n){this.type=o.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=n}}();t.JSXOpeningElement=u;var h=function(){return function(e){this.type=o.JSXSyntax.JSXSpreadAttribute,this.argument=e}}();t.JSXSpreadAttribute=h;var m=function(){return function(e,t){this.type=o.JSXSyntax.JSXText,this.value=e,this.raw=t}}();t.JSXText=m},function(e,t,n){"use strict";var o=n(8),r=n(6),a=n(7),i=function(){function e(){this.values=[],this.curly=this.paren=-1}return e.prototype.beforeFunctionExpression=function(e){return 0<=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(e)},e.prototype.isRegexStart=function(){var e=this.values[this.values.length-1],t=null!==e;switch(e){case"this":case"]":t=!1;break;case")":var n=this.values[this.paren-1];t="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(t=!1,"function"===this.values[this.curly-3]){var o=this.values[this.curly-4];t=!!o&&!this.beforeFunctionExpression(o)}else if("function"===this.values[this.curly-4]){var r=this.values[this.curly-5];t=!r||!this.beforeFunctionExpression(r)}}return t},(e.prototype.push=function(e){e.type===a.Token.Punctuator||e.type===a.Token.Keyword?("{"===e.value?this.curly=this.values.length:"("===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e)}(),s=function(){function e(e,t){this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=!!t&&"boolean"==typeof t.tolerant&&t.tolerant,this.scanner=new o.Scanner(e,this.errorHandler),this.scanner.trackComment=!!t&&"boolean"==typeof t.comment&&t.comment,this.trackRange=!!t&&"boolean"==typeof t.range&&t.range,this.trackLoc=!!t&&"boolean"==typeof t.loc&&t.loc,this.buffer=[],this.reader=new i}return e.prototype.errors=function(){return this.errorHandler.errors},e.prototype.getNextToken=function(){if(0===this.buffer.length){var t=this.scanner.scanComments();if(this.scanner.trackComment)for(var n=0;nn?e[t++]=n:2048>n?(e[t++]=192|n>>6,e[t++]=128|63&n):55296==(64512&n)&&r+1>18,e[t++]=128|63&n>>12,e[t++]=128|63&n>>6,e[t++]=128|63&n):(e[t++]=224|n>>12,e[t++]=128|63&n>>6,e[t++]=128|63&n);return e},n=function(l){for(var e=[],t=0,r=0,n;tn)e[r++]=d(n);else if(191n){var o=l[t++];e[r++]=d((31&n)<<6|63&o)}else if(239n){var o=l[t++],i=l[t++],a=l[t++],p=((7&n)<<18|(63&o)<<12|(63&i)<<6|63&a)-65536;e[r++]=d(55296+(p>>10)),e[r++]=d(56320+(1023&p))}else{var o=l[t++],i=l[t++];e[r++]=d((15&n)<<12|(63&o)<<6|63&i)}return e.join("")};a.base64={y:null,b:null,_:null,g:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(d,e){if(!Array.isArray(d))throw Error("encodeByteArray takes an array as a parameter");this.O();for(var t=e?this._:this.y,r=[],n=0;n>6,l=63&s;c||(l=64,i||(u=64)),r.push(t[o>>2],t[(3&o)<<4|a>>4],t[u],t[l])}return r.join("")},encodeString:function(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(i(n),e)},decodeString:function(o,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(o):n(this.decodeStringToByteArray(o,e))},decodeStringToByteArray:function(d,e){this.O();for(var t=e?this.g:this.b,r=[],n=0;n>4),64!=s){if(r.push(240&a<<4|s>>2),64!=c){r.push(192&s<<6|c)}}}return r},O:function(){if(!this.y){this.y={},this.b={},this._={},this.g={};for(var t=0;t=this.ENCODED_VALS_BASE.length&&(this.b[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.g[this.ENCODED_VALS.charAt(t)]=t)}}},a.base64Encode=function(t){var e=i(t);return a.base64.encodeByteArray(e,!0)},a.base64Decode=function(t){try{return a.base64.decodeString(t,!0)}catch(t){console.error("base64Decode failed: ",t)}return null}},function(n,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.jsonEval=function(t){return JSON.parse(t)},e.stringify=function(t){return JSON.stringify(t)}},function(n,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.contains=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},a.safeGet=function(n,e){if(Object.prototype.hasOwnProperty.call(n,e))return n[e]},a.forEach=function(n,e){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(t,n[t])},a.extend=function(n,e){return a.forEach(e,function(e,t){n[e]=t}),n},a.clone=function(t){return a.extend({},t)},a.isNonNullObject=function(t){return"object"==typeof t&&null!==t},a.isEmpty=function(n){for(var e in n)return!1;return!0},a.getCount=function(n){var e=0;for(var t in n)e++;return e},a.map=function(a,e,t){var r={};for(var n in a)r[n]=e.call(t,a[n],n,a);return r},a.findKey=function(o,e,t){for(var r in o)if(e.call(t,o[r],r,o))return r},a.findValue=function(t,e,r){var n=a.findKey(t,e,r);return n&&t[n]},a.getAnyKey=function(n){for(var e in n)return e},a.getValues=function(o){var e=[],t=0;for(var r in o)e[t++]=o[r];return e},a.every=function(n,e){for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&!e(t,n[t]))return!1;return!0}},,,,,,,,,,,,,,,,,,,,,,,,,,function(n,e,t){t(58),n.exports=t(6).default},function(a,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(59),n=(t.n(r),t(63)),o=(t.n(n),t(64));t.n(o)},function(e,t,o){(function(e){var t=function(){if(void 0!==e)return e;if(void 0!==a)return a;if("undefined"!=typeof self)return self;throw Error("unable to locate global object")}();"undefined"==typeof Promise&&(t.Promise=Promise=o(60))}).call(t,o(12))},function(d,e,t){(function(p){!function(e){function m(){}function n(n,e){return function(){n.apply(e,arguments)}}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this.T=[],g(t,this)}function i(i,s){for(;3===i._state;)i=i._value;return 0===i._state?void i.T.push(s):void(i._handled=!0,o.A(function(){var e=1===i._state?s.onFulfilled:s.onRejected;if(null===e)return void(1===i._state?a:c)(s.promise,i._value);var t;try{t=e(i._value)}catch(t){return void c(s.promise,t)}a(s.promise,t)}))}function a(a,e){try{if(e===a)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var i=e.then;if(e instanceof o)return a._state=3,a._value=e,void s(a);if("function"==typeof i)return void g(n(i,e),a)}a._state=1,a._value=e,s(a)}catch(e){c(a,e)}}function c(n,e){n._state=2,n._value=e,s(n)}function s(n){2===n._state&&0===n.T.length&&o.A(function(){n._handled||o.j(n._value)});for(var e=0,t=n.T.length;e>>0;if("function"!=typeof a)throw new TypeError("predicate must be a function");for(var r=arguments[1],n=0,o;n>>0;if("function"!=typeof a)throw new TypeError("predicate must be a function");for(var r=arguments[1],n=0,o;n":""+o}),n=this.serviceName+": "+n+" ("+t+").";var o=new s(t,n);for(var r in d)d.hasOwnProperty(r)&&"_"!==r.slice(-1)&&(o[r]=d[r]);return o},t}();e.ErrorFactory=a},function(a,s,e){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var d=e(29),n=e(30);s.decode=function(o){var e={},s={},l={},p="";try{var u=o.split(".");e=n.jsonEval(d.base64Decode(u[0])||""),s=n.jsonEval(d.base64Decode(u[1])||""),p=u[2],l=s.d||{},delete s.d}catch(t){}return{header:e,claims:s,data:l,signature:p}},s.isValidTimestamp=function(t){var e=s.decode(t).claims,a=Math.floor(new Date().getTime()/1e3),i,r;return"object"==typeof e&&(e.hasOwnProperty("nbf")?i=e.nbf:e.hasOwnProperty("iat")&&(i=e.iat),r=e.hasOwnProperty("exp")?e.exp:i+86400),a&&i&&r&&a>=i&&a<=r},s.issuedAtTime=function(t){var e=s.decode(t).claims;return"object"==typeof e&&e.hasOwnProperty("iat")?e.iat:null},s.isValidFormat=function(t){var e=s.decode(t),o=e.claims;return!!e.signature&&!!o&&"object"==typeof o&&o.hasOwnProperty("iat")},s.isAdmin=function(t){var e=s.decode(t).claims;return"object"==typeof e&&!0===e.admin}},function(o,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(31);e.querystring=function(n){var o=[];return r.forEach(n,function(t,e){Array.isArray(e)?e.forEach(function(e){o.push(encodeURIComponent(t)+"="+encodeURIComponent(e))}):o.push(encodeURIComponent(t)+"="+encodeURIComponent(e))}),o.length?"&"+o.join("&"):""},e.querystringDecode=function(n){var o={};return n.replace(/^\?/,"").split("&").forEach(function(t){if(t){var e=t.split("=");o[e[0]]=e[1]}}),o}},function(a,e,t){"use strict";var r=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t])};return function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=t(72),o=function(n){function e(){var e=n.call(this)||this;e.D=[],e.I=[],e.x=[],e.F=[],e.L=0,e.R=0,e.blockSize=64,e.F[0]=128;for(var o=1;or;r++)t[r]=d.charCodeAt(l)<<24|d.charCodeAt(l+1)<<16|d.charCodeAt(l+2)<<8|d.charCodeAt(l+3),l+=4;else for(var r=0;16>r;r++)t[r]=d[l]<<24|d[l+1]<<16|d[l+2]<<8|d[l+3],l+=4;for(var r=16,n;80>r;r++)n=t[r-3]^t[r-8]^t[r-14]^t[r-16],t[r]=4294967295&(n<<1|n>>>31);for(var o=this.D[0],p=this.D[1],s=this.D[2],c=this.D[3],u=this.D[4],r=0,h,i;80>r;r++){40>r?20>r?(h=c^p&(s^c),i=1518500249):(h=p^s^c,i=1859775393):60>r?(h=p&s|c&(p|s),i=2400959708):(h=p^s^c,i=3395469782);var n=4294967295&(o<<5|o>>>27)+h+u+i+t[r];u=c,c=s,s=4294967295&(p<<30|p>>>2),p=o,o=n}this.D[0]=4294967295&this.D[0]+o,this.D[1]=4294967295&this.D[1]+p,this.D[2]=4294967295&this.D[2]+s,this.D[3]=4294967295&this.D[3]+c,this.D[4]=4294967295&this.D[4]+u},e.prototype.update=function(a,s){if(null!=a){void 0===s&&(s=a.length);for(var t=s-this.blockSize,r=0,n=this.I,o=this.L;rthis.L?this.update(this.F,56-this.L):this.update(this.F,this.blockSize-(this.L-56));for(var t=this.blockSize-1;56<=t;t--)this.I[t]=255&e,e/=256;this.B(this.I);for(var r=0,t=0;5>t;t++)for(var n=24;0<=n;n-=8)a[r]=255&this.D[t]>>n,++r;return a},e}(n.Hash);e.Sha1=o},function(o,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=function(){return function(){this.blockSize=-1}}();e.Hash=t},function(n,e){"use strict";function s(a,i){if("object"!=typeof a||null===a)return!1;for(var t=0,r=i,n;t 4. Need to update it?");}var i=a+" failed: ";return i+=r+" argument "}function t(n,e,t,i){if((!i||t)&&"string"!=typeof t)throw Error(a(n,e,i)+"must be a valid firebase namespace.")}Object.defineProperty(e,"__esModule",{value:!0}),e.validateArgCount=function(a,e,t,r){var n;if(rt&&(n=0===t?"none":"no more than "+t),n){var o=a+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+n+".";throw Error(o)}},e.errorPrefix=a,e.validateNamespace=t,e.validateCallback=function(n,e,t,i){if((!i||t)&&"function"!=typeof t)throw Error(a(n,e,i)+"must be a valid function.")},e.validateContextObject=function(n,e,t,i){if((!i||t)&&("object"!=typeof t||null===t))throw Error(a(n,e,i)+"must be a valid context object.")}},function(o,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(28);e.stringToByteArray=function(n){for(var e=[],t=0,s=0,o;s=o){var i=o-55296;s++,r.assert(so?e[t++]=o:2048>o?(e[t++]=192|o>>6,e[t++]=128|63&o):65536>o?(e[t++]=224|o>>12,e[t++]=128|63&o>>6,e[t++]=128|63&o):(e[t++]=240|o>>18,e[t++]=128|63&o>>12,e[t++]=128|63&o>>6,e[t++]=128|63&o)}return e},e.stringLength=function(o){for(var e=0,t=0,r;tr?e++:2048>r?e+=2:55296<=r&&56319>=r?(e+=4,t++):e+=3;return e}}])}().default;try{webpackJsonpFirebase([4],{76:function(o,t,n){n(77)},77:function(o,t,Kn){var ed=Math.floor,d=Math.max;(function(e){(function(){function td(e){return"string"==typeof e}function e(e){return"boolean"==typeof e}function nd(){}function i(o){var r=typeof o;if("object"==r){if(!o)return"null";if(o instanceof Array)return"array";if(o instanceof Object)return r;var n=Object.prototype.toString.call(o);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof o.length&&void 0!==o.splice&&void 0!==o.propertyIsEnumerable&&!o.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||void 0!==o.call&&void 0!==o.propertyIsEnumerable&&!o.propertyIsEnumerable("call"))return"function"}else if("function"==r&&void 0===o.call)return"object";return r}function r(e){return null===e}function od(e){return"array"==i(e)}function rd(e){var t=i(e);return"array"==t||"object"==t&&"number"==typeof e.length}function a(e){return"function"==i(e)}function ad(e){var o=typeof e;return"object"==o&&null!=e||"function"==o}function s(e){return e.call.apply(e.bind,arguments)}function h(o,r){if(!o)throw Error();if(2")&&(e=e.replace(Bd,">")),-1!=e.indexOf("\"")&&(e=e.replace(Ud,""")),-1!=e.indexOf("'")&&(e=e.replace(Vd,"'")),-1!=e.indexOf("\0")&&(e=e.replace(Wd,"�")),e):e}function g(e,t){return-1!=e.indexOf(t)}function b(e,t){return et?1:0}function w(e,t){t.unshift(e),p.call(this,v.apply(null,t)),t.shift()}function y(e){throw new w("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1))}function I(t,n){var e=t.length,o=td(t)?t.split(""):t;for(--e;0<=e;--e)e in o&&n.call(void 0,o[e],e,t)}function T(t){t:{for(var n=Te,e=t.length,a=td(t)?t.split(""):t,r=0;rn?null:td(t)?t.charAt(n):t[n]}function A(e,t){return 0<=jd(e,t)}function k(o,t){t=jd(o,t);var n;return(n=0<=t)&&Array.prototype.splice.call(o,t,1),n}function E(o,t){var n=0;I(o,function(e,a){t.call(void 0,e,a,o)&&1==Array.prototype.splice.call(o,a,1).length&&n++})}function N(){return Array.prototype.concat.apply([],arguments)}function S(o){var t=o.length;if(0"),n=n.join("")}return n=t.createElement(n),o&&(td(o)?n.className=o:od(o)?n.className=o.join(" "):Dt(n,o)),2e.keyCode||void 0!=e.returnValue)){t:{var i=!1;if(0==e.keyCode)try{e.keyCode=-1;break t}catch(e){i=!0}(i||void 0==e.returnValue)&&(e.returnValue=!0)}for(e=[],i=t.b;i;i=i.parentNode)e.push(i);for(a=a.type,i=e.length-1;0<=i;i--){t.b=e[i];var r=on(e[i],a,!0,t);s=s&&r}for(i=0;i>4),64!=o&&(t(240&r<<4|o>>2),64!=a&&t(192&o<<6|a))}}function Pn(){if(!Yl){Yl={},Jl={};for(var e=0;65>e;e++)Yl[e]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e),Jl[Yl[e]]=e,62<=e&&(Jl["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(e)]=e)}}function Cn(e,t){this.g=[],this.v=e,this.o=t||null,this.f=this.a=!1,this.c=void 0,this.u=this.w=this.i=!1,this.h=0,this.b=null,this.l=0}function Rn(o,t,r){o.a=!0,o.c=r,o.f=!t,Un(o)}function _n(e){if(e.a){if(!e.u)throw new jn;e.u=!1}}function Dn(e,t){Ln(e,null,t,void 0)}function Ln(o,t,n,e){o.g.push([t,n,e]),o.a&&Un(o)}function xn(e){return Kd(e.g,function(e){return a(e[1])})}function Un(d){if(d.h&&d.a&&xn(d)){var t=d.h,n=$l[t];n&&(Ld.clearTimeout(n.a),delete $l[t]),d.h=0}d.b&&(d.b.l--,delete d.b),t=d.c;for(var e=n=!1;d.g.length&&!d.i;){var i=d.g.shift(),r=i[0],o=i[1];if(i=i[2],r=d.f?o:r)try{var a=r.call(i||d.o,t);void 0!==a&&(d.f=d.f&&(a==t||a instanceof Error),d.c=t=a),(K(t)||"function"==typeof Ld.Promise&&t instanceof Ld.Promise)&&(e=!0,d.i=!0)}catch(e){t=e,d.f=!0,xn(d)||(n=!0)}}d.c=t,e&&(a=f(d.m,d,!0),e=f(d.m,d,!1),t instanceof Cn?(Ln(t,a,e),t.w=!0):t.then(a,e)),n&&(t=new Vn(t),$l[t.a]=t,d.h=t.a)}function jn(){p.call(this)}function Mn(){p.call(this)}function Vn(e){this.a=Ld.setTimeout(f(this.c,this),0),this.b=e}function Fn(e,t){this.b=-1,this.b=ep,this.f=Ld.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=e,this.h=t,this.l=Ld.Int32Array?new Int32Array(64):Array(64),Zl||(Zl=Ld.Int32Array?new Int32Array(rp):rp),this.reset()}function qn(d){for(var t=d.f,n=d.l,e=0,i=0;it;t++){i=0|n[t-15],e=0|n[t-2];var r=0|(0|n[t-16])+((i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3),o=0|(0|n[t-7])+((e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10);n[t]=0|r+o}e=0|d.a[0],i=0|d.a[1];var a=0|d.a[2],s=0|d.a[3],p=0|d.a[4],u=0|d.a[5],h=0|d.a[6];for(r=0|d.a[7],t=0;64>t;t++){var m=0|((e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10))+(e&i^e&a^i&a);o=p&u^~p&h,r=0|r+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7)),o=0|o+(0|Zl[t]),o=0|r+(0|o+(0|n[t])),r=h,h=u,u=p,p=0|s+o,s=a,a=i,i=e,e=0|o+m}d.a[0]=0|d.a[0]+e,d.a[1]=0|d.a[1]+i,d.a[2]=0|d.a[2]+a,d.a[3]=0|d.a[3]+s,d.a[4]=0|d.a[4]+p,d.a[5]=0|d.a[5]+u,d.a[6]=0|d.a[6]+h,d.a[7]=0|d.a[7]+r}function Xn(t,n,e){void 0===e&&(e=n.length);var i=0,r=t.c;if(td(n))for(;i=o&&o==(0|o)))throw Error("message must be a byte array");t.f[r++]=o,r==t.b&&(qn(t),r=0)}}t.c=r,t.g+=e}function Bn(){Fn.call(this,8,ap)}function Hn(t){if(t.P&&"function"==typeof t.P)return t.P();if(td(t))return t.split("");if(rd(t)){for(var n=[],e=t.length,o=0;ot)throw Error("Bad port number "+t);e.i=t}else e.i=null}function Zn(o,t,n){t instanceof ae?(o.a=t,pe(o.a,o.f)):(n||(t=re(t,pp)),o.a=new ae(t,0,o.f))}function Qn(o,t,n){o.a.set(t,n)}function te(e,t){return e.a.get(t)}function ne(e){return e instanceof Jn?new Jn(e):new Jn(e,void 0)}function ee(o,t){var n=new Jn(null,void 0);return Yn(n,"https"),o&&(n.b=o),t&&(n.g=t),n}function ie(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function re(t,n,e){return td(t)?(t=encodeURI(t).replace(n,oe),e&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function oe(e){return e=e.charCodeAt(0),"%"+(15&e>>4).toString(16)+(15&e).toString(16)}function ae(o,t,n){this.b=this.a=null,this.c=o||null,this.f=!!n}function se(o){o.a||(o.a=new Tn,o.b=0,o.c&&zn(o.c,function(t,n){ce(o,decodeURIComponent(t.replace(/\+/g," ")),n)}))}function ue(a){var t=Wn(a);if(void 0===t)throw Error("Keys are undefined");var n=new ae(null,0,void 0);a=Hn(a);for(var e=0;e2*e.c&&An(e)))}function fe(e,t){return se(e),t=de(e,t),kn(e.a.b,t)}function le(o,t,n){he(o,t),0n;n++){e=t[n];try{return new ActiveXObject(e),o.f=e}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return o.f}function we(e){hn.call(this),this.headers=new Tn,this.w=e||null,this.b=!1,this.v=this.a=null,this.g=this.I=this.i="",this.c=this.G=this.h=this.A=!1,this.f=0,this.m=null,this.l=hp,this.o=this.N=!1}function ye(a,t,n,e,i){if(a.a)throw Error("[goog.net.XhrIo] Object is active with another request="+a.i+"; newUri="+t);n=n?n.toUpperCase():"GET",a.i=t,a.g="",a.I=n,a.A=!1,a.b=!0,a.a=a.w?a.w.a():up.a(),a.v=me(a.w?a.w:up),a.a.onreadystatechange=f(a.Ab,a);try{En(a.J,Re(a,"Opening Xhr")),a.G=!0,a.a.open(n,t+"",!0),a.G=!1}catch(e){return En(a.J,Re(a,"Error opening Xhr: "+e.message)),void Ae(a,e)}t=e||"";var r=new Tn(a.headers);i&&Gn(i,function(e,t){r.set(t,e)}),i=T(r.S()),e=Ld.FormData&&t instanceof Ld.FormData,!A(yp,n)||i||e||r.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),r.forEach(function(e,t){this.a.setRequestHeader(t,e)},a),a.l&&(a.a.responseType=a.l),"withCredentials"in a.a&&a.a.withCredentials!==a.N&&(a.a.withCredentials=a.N);try{Se(a),0e||$d&&ll&&!(9",s=Rt(s),o.document.write(Ct(s)),o.document.close())):o=s.open(Nt(t),d,o),o)try{o.focus()}catch(e){}return o}function ze(o){return new $(function(t){function n(){mn(2e3).then(function(){return o&&!o.closed?n():void t()})}return n()})}function Je(){var e=null;return new $(function(t){"complete"==Ld.document.readyState?t():(e=function(){t()},tn(window,"load",e))}).s(function(t){throw nn(window,"load",e),t})}function Ye(){return $e(void 0)?Je().then(function(){return new $(function(o,t){var n=Ld.document,e=setTimeout(function(){t(Error("Cordova framework is not ready."))},1e3);n.addEventListener("deviceready",function(){clearTimeout(e),o()},!1)})}):nt(Error("Cordova must run in an Android or iOS file scheme."))}function $e(e){return e=e||ii(),"file:"===ui()&&e.toLowerCase().match(/iphone|ipad|ipod|android/)}function Ze(){var e=Ld.window;try{return e&&e!=e.top}catch(e){return!1}}function Qe(){return Nd.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":Nd.INTERNAL.hasOwnProperty("node")?"Node":"Browser"}function ti(){var e=Qe();return"ReactNative"===e||"Node"===e}function ni(e){var t=e.toLowerCase();return g(t,"opera/")||g(t,"opr/")||g(t,"opios/")?"Opera":g(t,"iemobile")?"IEMobile":g(t,"msie")||g(t,"trident/")?"IE":g(t,"edge/")?"Edge":g(t,"firefox/")?Sp:g(t,"silk/")?"Silk":g(t,"blackberry")?"Blackberry":g(t,"webos")?"Webos":!g(t,"safari/")||g(t,"chrome/")||g(t,"crios/")||g(t,"android")?(g(t,"chrome/")||g(t,"crios/"))&&!g(t,"edge/")?Ep:g(t,"android")?"Android":(e=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==e.length?e[1]:"Other":"Safari"}function ei(o,t){t=t||[];var n=[],a={},r;for(r in kp)a[kp[r]]=!0;for(r=0;rt)throw Error("Short delay should be less than long delay!");this.c=o,this.b=t,o=n||ii(),e=e||Qe(),this.a=He(o)||"ReactNative"===e}function bi(){var e=Ld.document;return!e||void 0===e.visibilityState||"visible"==e.visibilityState}function wi(){var o=Ld.document,r=null;return bi()||!o?tt():new $(function(t){r=function(){bi()&&(o.removeEventListener("visibilitychange",r,!1),t())},o.addEventListener("visibilitychange",r,!1)}).s(function(t){throw o.removeEventListener("visibilitychange",r,!1),t})}function yi(e){try{var t=new Date(parseInt(e,10));if(!isNaN(t.getTime())&&!/[^0-9]/.test(e))return t.toUTCString()}catch(e){}return null}function Ii(o,t,n){wp?Object.defineProperty(o,t,{configurable:!0,enumerable:!0,value:n}):o[t]=n}function Ti(o,t){if(t)for(var n in t)t.hasOwnProperty(n)&&Ii(o,n,t[n])}function Ai(e){var t={};return Ti(t,e),t}function ki(o){var t={},e;for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e]);return t}function Ei(o,r){if(!r||!r.length)return!0;if(!o)return!1;for(var a=0,e;a Auth section -> Sign in method tab.",o):"http"==n||"https"==n?r=v("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",o):t="operation-not-supported-in-this-environment",Oi.call(this,t,r)}function lr(o,t,n){Oi.call(this,o,n),o=t||{},o.sb&&Ii(this,"email",o.sb),o.Y&&Ii(this,"phoneNumber",o.Y),o.credential&&Ii(this,"credential",o.credential)}function dr(o){if(o.code){var t=o.code||"";0==t.indexOf(Dp)&&(t=t.substring(Dp.length));var n={credential:sr(o)};if(o.email)n.sb=o.email;else{if(!o.phoneNumber)return new Oi(t,o.message||void 0);n.Y=o.phoneNumber}return new lr(t,n,o.message)}return null}function pr(e){this.f=e}function vr(o,t,n){var e="Node"==Qe();if(!(e=Ld.XMLHttpRequest||e&&Nd.INTERNAL.node&&Nd.INTERNAL.node.XMLHttpRequest))throw new Oi("internal-error","The XMLHttpRequest compatibility library was not found.");this.b=o,o=t||{},this.i=o.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.l=o.secureTokenTimeout||Jp,this.c=L(o.secureTokenHeaders||$p),this.g=o.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.h=o.firebaseTimeout||Zp,this.a=L(o.firebaseHeaders||ec),n&&(this.a["X-Client-Version"]=n,this.c["X-Client-Version"]=n),this.f=new je,this.o=new pr(e)}function mr(e,t){t?e.a["X-Firebase-Locale"]=t:delete e.a["X-Firebase-Locale"]}function gr(e,t){t?(e.a["X-Client-Version"]=t,e.c["X-Client-Version"]=t):(delete e.a["X-Client-Version"],delete e.c["X-Client-Version"])}function br(s,t,n,e,i,r,o){mi()?(Be()?s=f(s.m,s):(tc||(tc=new $(function(e,t){wr(e,t)})),s=f(s.u,s)),s(t,n,e,i,r,o)):n&&n(null)}function wr(e,t){((window.gapi||{}).client||{}).request?e():(Ld[oc]=function(){((window.gapi||{}).client||{}).request?e():t(Error("CORS_UNSUPPORTED"))},Dn(_e(At(nc,{onload:oc})),function(){t(Error("CORS_UNSUPPORTED"))}))}function yr(o,t){return new $(function(n,e){"refresh_token"==t.grant_type&&t.refresh_token||"authorization_code"==t.grant_type&&t.code?br(o,o.i+"?key="+encodeURIComponent(o.b),function(o){o?o.error?e(Mr(o)):o.access_token&&o.refresh_token?n(o):e(new Oi("internal-error")):e(new Oi("network-request-failed"))},"POST",""+ue(t),o.c,o.l.get()):e(new Oi("internal-error"))})}function Ir(d,t,l,e,i,n){var r=ne(d.g+t);Qn(r,"key",d.b),n&&Qn(r,"cb",""+Pd());var a="GET"==l;if(a)for(var o in e)e.hasOwnProperty(o)&&Qn(r,o,e[o]);return new $(function(s,n){br(d,""+r,function(e){e?e.error?n(Mr(e,i||{})):s(e):n(new Oi("network-request-failed"))},l,a?void 0:jt(fi(e)),d.a,d.h.get())})}function Tr(e){if(!bp.test(e.email))throw new Oi("invalid-email")}function Ar(e){"email"in e&&Tr(e)}function ud(e,t){return yd(e,dc,{identifier:t,continueUri:si()?Ke():"http://localhost"}).then(function(e){return e.allProviders||[]})}function Er(e){return yd(e,mc,{}).then(function(e){return e.authorizedDomains||[]})}function Nr(e){if(!e[Yp])throw new Oi("internal-error")}function hd(e){if(!(e.phoneNumber||e.temporaryProof)){if(!e.sessionInfo)throw new Oi("missing-verification-id");if(!e.code)throw new Oi("missing-verification-code")}else if(!e.phoneNumber||!e.temporaryProof)throw new Oi("internal-error")}function md(e,t){return yd(e,bc,t)}function Pr(o,t,r){return yd(o,pc,{idToken:t,deleteProvider:r})}function Cr(e){if(!e.requestUri||!e.sessionId&&!e.postBody)throw new Oi("internal-error")}function gd(e){var t=null;if(e.needConfirmation?(e.code="account-exists-with-different-credential",t=dr(e)):"FEDERATED_USER_ID_ALREADY_LINKED"==e.errorMessage?(e.code="credential-already-in-use",t=dr(e)):"EMAIL_EXISTS"==e.errorMessage?(e.code="email-already-in-use",t=dr(e)):e.errorMessage&&(t=jr(e.errorMessage)),t)throw t;if(!e[Yp])throw new Oi("internal-error")}function fd(e,t){return t.returnIdpCredential=!0,yd(e,Ec,t)}function Dr(e,t){return t.returnIdpCredential=!0,yd(e,Tc,t)}function Lr(e,t){return t.returnIdpCredential=!0,t.autoCreate=!1,yd(e,kc,t)}function xr(e){if(!e.oobCode)throw new Oi("invalid-action-code")}function yd(o,t,n){if(!Ei(n,t.ea))return nt(new Oi("internal-error"));var e=t.zb||"POST",r;return tt(n).then(t.D).then(function(){return t.T&&(n.returnSecureToken=!0),Ir(o,t.endpoint,e,n,t.Pb,t.nb||!1)}).then(function(e){return r=e}).then(t.O).then(function(){if(!t.ga)return r;if(!(t.ga in r))throw new Oi("internal-error");return r[t.ga]})}function jr(e){return Mr({error:{errors:[{message:e}],code:400,message:e}})}function Mr(o,t){var a=(o.error&&o.error.errors&&o.error.errors[0]||{}).reason||"",e={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(a=e[a]?new Oi(e[a]):null)return a;for(var i in a=o.error&&o.error.message||"",e={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash"},x(e,t||{}),t=(t=a.match(/^[^\s]+\s*:\s*(.*)$/))&&1t.c?Xn(t,op,56-t.c):Xn(t,op,t.b-(t.c-56));for(var e=63;56<=e;e--)t.f[e]=255&n,n/=256;for(qn(t),e=n=0;e>a;return Nn(o)}function jo(d,t,n,e){var i=xo(),r=new cr(t,e,null,i,new Oi("no-auth-event")),o=ri("BuildInfo.packageName",Ld);if("string"!=typeof o)throw new Oi("invalid-cordova-configuration");var l=ri("BuildInfo.displayName",Ld),s={};if(ii().toLowerCase().match(/iphone|ipad|ipod/))s.ibi=o;else{if(!ii().toLowerCase().match(/android/))return nt(new Oi("operation-not-supported-in-this-environment"));s.apn=o}l&&(s.appDisplayName=l),i=Uo(i),s.sessionId=i;var p=Zr(d.u,d.i,d.l,t,n,null,e,d.m,s,d.o);return d.ba().then(function(){var e=d.h;return d.A.a.set(qc,r.B(),e)}).then(function(){var t=ri("cordova.plugins.browsertab.isAvailable",Ld);if("function"!=typeof t)throw new Oi("invalid-cordova-configuration");var o=null;t(function(e){if(e){if("function"!=typeof(o=ri("cordova.plugins.browsertab.openUrl",Ld)))throw new Oi("invalid-cordova-configuration");o(p)}else{if("function"!=typeof(o=ri("cordova.InAppBrowser.open",Ld)))throw new Oi("invalid-cordova-configuration");e=ii(),e=e.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||e.match(/(iPad|iPhone|iPod).*OS 8_\d/i),d.a=o(p,e?"_blank":"_system","location=yes")}})})}function Mo(o,t){for(var n=0;ne.f&&(e.a=e.f),t)}function la(e,t){da(e),e.b=mn(fa(e,t)).then(function(){return e.l?tt():wi()}).then(function(){return e.h()}).then(function(){la(e,!0)}).s(function(t){e.i(t)&&la(e,!1)})}function da(e){e.b&&(e.b.cancel(),e.b=null)}function pa(e){this.f=e,this.b=this.a=null,this.c=0}function va(o,t){var n=t[Yp],e=t.refreshToken;t=ma(t.expiresIn),o.b=n,o.c=t,o.a=e}function ma(e){return Pd()+1e3*parseInt(e,10)}function ga(e,t){return yr(e.f,t).then(function(t){return e.b=t.access_token,e.c=ma(t.expires_in),e.a=t.refresh_token,{accessToken:e.b,expirationTime:e.c,refreshToken:e.a}}).s(function(t){throw"auth/user-token-expired"==t.code&&(e.a=null),t})}function ba(e,t){this.a=e||null,this.b=t||null,Ti(this,{lastSignInTime:yi(t||null),creationTime:yi(e||null)})}function wa(e){return new ba(e.a,e.b)}function ya(a,s,d,e,i,r){Ti(this,{uid:a,displayName:e||null,photoURL:i||null,email:d||null,phoneNumber:r||null,providerId:s})}function Ia(o,t){for(var n in Xt.call(this,o),t)this[n]=t[n]}function Ta(o,t,n){this.A=[],this.G=o.apiKey,this.o=o.appName,this.w=o.authDomain||null,o=Nd.SDK_VERSION?ei(Nd.SDK_VERSION):null,this.c=new vr(this.G,Vr(Oc),o),this.h=new pa(this.c),Ca(this,t[Yp]),va(this.h,t),Ii(this,"refreshToken",this.h.a),La(this,n||{}),hn.call(this),this.I=!1,this.w&&ai()&&(this.a=Zo(this.w,this.G,this.o)),this.N=[],this.i=null,this.l=Sa(this),this.U=f(this.Ga,this);var e=this;this.ha=null,this.ra=function(n){e.na(n.h)},this.W=null,this.R=[],this.qa=function(n){ka(e,n.f)},this.V=null}function Sd(e,t){e.W&&nn(e.W,"languageCodeChanged",e.ra),(e.W=t)&&$t(t,"languageCodeChanged",e.ra)}function ka(e,t){e.R=t,gr(e.c,Nd.SDK_VERSION?ei(Nd.SDK_VERSION,e.R):null)}function Ea(e,t){e.V&&nn(e.V,"frameworkChanged",e.qa),(e.V=t)&&$t(t,"frameworkChanged",e.qa)}function Na(e){try{return Nd.app(e.o).auth()}catch(t){throw new Oi("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+e.o+"'!")}}function Sa(e){return new ha(function(){return e.F(!0)},function(e){return e&&"auth/network-request-failed"==e.code},function(){var t=e.h.c-Pd()-3e5;return 0i||i>=Jc.length)throw new Oi("internal-error","Argument validator received an unsupported number of arguments.");n=Jc[i],e=(e?"":n+" argument ")+(t.name?"\""+t.name+"\" ":"")+"must be "+t.K+".";break t}e=null}}if(e)throw new Oi("argument-error",s+" failed: "+e)}function Ds(o,n){return{name:o||"",K:"a valid string",optional:!!n,M:td}}function Ls(){return{name:"opt_forceRefresh",K:"a boolean",optional:!0,M:e}}function xs(e,t){return{name:e||"",K:"a valid object",optional:!!t,M:ad}}function Us(e,t){return{name:e||"",K:"a function",optional:!!t,M:a}}function js(e,t){return{name:e||"",K:"null",optional:!!t,M:r}}function Ms(){return{name:"",K:"an HTML element",optional:!1,M:function(e){return!!(e&&e instanceof Element)}}}function Vs(){return{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(e){return!!(e&&e instanceof ps)}}}function Fs(){return{name:"app",K:"an instance of Firebase App",optional:!0,M:function(e){return!!(e&&e instanceof Nd.app.App)}}}function Ks(o){return{name:o?o+"Credential":"credential",K:o?"a valid "+o+" credential":"a valid credential",optional:!1,M:function(r){if(!r)return!1;var a=!o||r.providerId===o;return r.wa&&a}}}function qs(){return{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(e){return!!(e&&e.providerId&&e.hasOwnProperty&&e.hasOwnProperty("isOAuthProvider"))}}}function Xs(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(e){return!!(e&&td(e.type)&&a(e.verify))}}}function Bs(o,t,n,e){return{name:n||"",K:o.K+" or "+t.K,optional:!!e,M:function(n){return o.M(n)||t.M(n)}}}function Hs(d,t,n,e,i,r){if(Ii(this,"type","recaptcha"),this.b=this.c=null,this.m=!1,this.l=t,this.a=n||{theme:"light",type:"image"},this.g=[],this.a[eu])throw new Oi("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.h="invisible"===this.a[tu],!_t(t)||!this.h&&_t(t).hasChildNodes())throw new Oi("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.u=new vr(d,r||null,i||null),this.o=e||function(){return null};var o=this;this.i=[];var a=this.a[$c];this.a[$c]=function(e){if(Ws(o,e),"function"==typeof a)a(e);else if("string"==typeof a){var t=ri(a,Ld);"function"==typeof t&&t(e)}};var l=this.a[Zc];this.a[Zc]=function(){if(Ws(o,null),"function"==typeof l)l();else if("string"==typeof l){var e=ri(l,Ld);"function"==typeof e&&e()}}}function Ws(o,t){for(var n=0;n>>0),Od=0,Pd=Date.now||function(){return+new Date},_d;id(p,Error),p.prototype.name="CustomError";var Dd=String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Md=/&/g,Fd=//g,Ud=/"/g,Vd=/'/g,Wd=/\x00/g,Hd=/[\x00&<>"']/;id(w,p),w.prototype.name="AssertionError";var jd=Array.prototype.indexOf?function(o,t,n){return Array.prototype.indexOf.call(o,t,n)}:function(t,n,e){if(e=null==e?0:0>e?d(0,t.length+e):e,td(t))return td(n)&&1==n.length?t.indexOf(n,e):-1;for(;eparseFloat(rl)){ol=il+"";break t}}ol=rl}var sl={},dl=Ld.document,ll;ll=dl&&$d?M()||("CSS1Compat"==dl.compatMode?parseInt(ol,10):5):void 0,q.prototype.get=function(){if(0"),Rt(""),Rt("
");var Nl={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"},Al={'"':"\\\"","\\":"\\\\","/":"\\/","":"\\b"," ":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"," ":"\\u000b"},Ll=/\uffff/.test("\uFFFF")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,Rl=0,Ol={};Kt.prototype.oa=!1,Kt.prototype.ta=function(){if(this.Fa)for(;this.Fa.length;)this.Fa.shift()()};var Pl=Object.freeze||function(e){return e},_l=!$d||9<=+ll,Dl=$d&&!V("9"),Ml=function(){if(!Ld.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});return Ld.addEventListener("test",nd,t),Ld.removeEventListener("test",nd,t),e}();Xt.prototype.c=function(){this.Bb=!1},id(Bt,Xt);var Fl=Pl({2:"touch",3:"pen",4:"mouse"});Bt.prototype.c=function(){Bt.ib.c.call(this);var e=this.a;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,Dl)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}},Bt.prototype.g=function(){return this.a};var Bl="closure_listenable_"+(0|1e6*Math.random()),Ul=0,Vl="closure_lm_"+(0|1e6*Math.random()),Wl={},Hl=0,jl="__closure_events_fn_"+(1e9*Math.random()>>>0);id(hn,Kt),hn.prototype[Bl]=!0,hn.prototype.removeEventListener=function(o,t,n,e){nn(this,o,t,n,e)},hn.prototype.ta=function(){if(hn.ib.ta.call(this),this.u){var o=this.u,n=0,e;for(e in o.a){for(var t=o.a[e],a=0;a=yn(this).value)for(a(t)&&(t=t()),o=new gn(o,t+"",this.f),n&&(o.a=n),n="log:"+o.b,(o=Ld.console)&&o.timeStamp&&o.timeStamp(n),(o=Ld.msWriteProfilerMark)&&o(n),n=this;n;)n=n.a};var Xl={},Ql=null;_d=Tn.prototype,_d.P=function(){An(this);for(var e=[],t=0;t=--t.l&&t.cancel()}this.v?this.v.call(this.o,this):this.u=!0,this.a||(e=new Mn,_n(this),Rn(this,!1,e))}},Cn.prototype.m=function(e,t){this.i=!1,Rn(this,e,t)},Cn.prototype.A=function(e){_n(this),Rn(this,!0,e)},Cn.prototype.then=function(a,t,n){var e=new $(function(e,t){o=e,i=t}),o,i;return Ln(this,o,function(n){n instanceof Mn?e.cancel():i(n)}),e.then(a,t,n)},F(Cn),id(jn,p),jn.prototype.message="Deferred has already fired",jn.prototype.name="AlreadyCalledError",id(Mn,p),Mn.prototype.message="Deferred was canceled",Mn.prototype.name="CanceledError",Vn.prototype.c=function(){throw delete $l[this.a],this.b};var $l={},Zl;id(Fn,function(){this.b=-1});for(var ep=64,tp=[],np=0;npthis.c-3e4?this.a?ga(this,{grant_type:"refresh_token",refresh_token:this.a}):tt(null):tt({accessToken:this.b,expirationTime:this.c,refreshToken:this.a})},ba.prototype.B=function(){return{lastLoginAt:this.b,createdAt:this.a}},id(Ia,Xt),id(Ta,hn),Ta.prototype.na=function(e){this.ha=e,mr(this.c,e)},Ta.prototype.$=function(){return this.ha},Ta.prototype.Ka=function(){return S(this.R)},Ta.prototype.Ga=function(){this.l.b&&(da(this.l),this.l.start())},Ii(Ta.prototype,"providerId","firebase"),_d=Ta.prototype,_d.reload=function(){var e=this;return Za(this,Ua(this).then(function(){return qa(e).then(function(){return _a(e)}).then(xa)}))},_d.F=function(e){var o=this;return Za(this,Ua(this).then(function(){return o.h.getToken(e)}).then(function(e){if(!e)throw new Oi("internal-error");return e.accessToken!=o.pa&&(Ca(o,e.accessToken),fn(o,new Ia("tokenChanged"))),Fa(o,"refreshToken",e.refreshToken),e.accessToken}))},_d.getToken=function(e){return Tp["firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead."]||(Tp["firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead."]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead.")),this.F(e)},_d.kc=function(o){if(!(o=o.users)||!o.length)throw new Oi("internal-error");o=o[0],La(this,{uid:o.localId,displayName:o.displayName,photoURL:o.photoUrl,email:o.email,emailVerified:!!o.emailVerified,phoneNumber:o.phoneNumber,lastLoginAt:o.lastLoginAt,createdAt:o.createdAt});for(var t=Ha(o),n=0;nthis.o&&(this.o=0),0==this.o&&Ss(this)&&Pa(Ss(this)),this.removeAuthTokenListener(o)},_d.addAuthTokenListener=function(e){var t=this;this.m.push(e),Rs(this,this.i.then(function(){t.l||A(t.m,e)&&e(Os(t))}))},_d.removeAuthTokenListener=function(e){E(this.m,function(t){return t==e})},_d.delete=function(){this.l=!0;for(var e=0;et?n.push(o.substring(r,t)):n.push(o.substring(r,r+e));return n},m.each=function(o,a){if(Array.isArray(o))for(var e=0;er,r=Math.abs(r),2.2250738585072014e-308<=r?(o=Math.min(t(Math.log(r)/Math.LN2),1023),n=o+1023,i=g(r*Math.pow(2,52-o)-4503599627370496)):(n=0,i=g(r/5e-324))),s=[],a=52;a;a-=1)s.push(i%2?1:0),i=t(i/2);for(a=11;a;a-=1)s.push(n%2?1:0),n=t(n/2);s.push(e?1:0),s.reverse(),d=s.join("");var l="";for(a=0;64>a;a+=8){var p=parseInt(d.substr(a,8),2).toString(16);1===p.length&&(p="0"+p),l+=p}return l.toLowerCase()},m.isChromeExtensionContentScript=function(){return"object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href)},m.isWindowsStoreApp=function(){return"object"==typeof Windows&&"object"==typeof Windows.UI},m.errorForServerCode=function(o,e){var t="Unknown Error";"too_big"===o?t="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"==o?t="Client doesn't have permission to access the desired data.":"unavailable"==o&&(t="The service is unavailable");var n=Error(o+" at "+e.path+": "+t);return n.code=o.toUpperCase(),n},m.e=/^-?\d{1,10}$/,m.tryParseInt=function(t){if(m.e.test(t)){var o=+t;if(-2147483648<=o&&2147483647>=o)return o}return null},m.exceptionGuard=function(t){try{t()}catch(t){setTimeout(function(){var e=t.stack||"";throw m.warn("Exception was thrown by user callback.",e),t},0)}},m.callUserCallback=function(t){for(var o=[],n=1;n=this.n.length?null:this.n[this.i]},o.prototype.getLength=function(){return this.n.length-this.i},o.prototype.popFront=function(){var e=this.i;return e=this.n.length)return null;for(var e=[],t=this.i;t=this.n.length},o.relativePath=function(e,t){var n=e.getFront(),r=t.getFront();if(null===n)return t;if(n===r)return o.relativePath(e.popFront(),t.popFront());throw Error("INTERNAL ERROR: innerPath ("+t+") is not within outerPath ("+e+")")},o.comparePaths=function(r,e){for(var t=r.slice(),n=e.slice(),i=0,o;io.getLength())return!1;for(;et.MAX_PATH_LENGTH_BYTES)throw Error(this.o+"has a key path longer than "+t.MAX_PATH_LENGTH_BYTES+" bytes ("+this.l+").");if(this.u.length>t.MAX_PATH_DEPTH)throw Error(this.o+"path specified exceeds the maximum depth that can be written ("+t.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},t.prototype.toErrorString=function(){return 0==this.u.length?"":"in property '"+this.u.join(".")+"'"},t}();e.ValidationPath=o},function(r,e,t){"use strict";var n=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(o,e){for(var t in e)e.hasOwnProperty(t)&&(o[t]=e[t])};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=t(15),d=t(1),i=t(5),l=t(16),c,a;e.setNodeFromJSON=function(t){c=t},e.setMaxNode=function(t){a=t};var s=function(o){function e(){return null!==o&&o.apply(this,arguments)||this}return n(e,o),e.prototype.compare=function(o,e){var t=o.node.getPriority(),n=e.node.getPriority(),r=t.compareTo(n);return 0===r?d.nameCompare(o.name,e.name):r},e.prototype.isDefinedOn=function(t){return!t.getPriority().isEmpty()},e.prototype.indexedValueChanged=function(n,e){return!n.getPriority().equals(e.getPriority())},e.prototype.minPost=function(){return i.NamedNode.MIN},e.prototype.maxPost=function(){return new i.NamedNode(d.MAX_NAME,new l.LeafNode("[PRIORITY-POST]",a))},e.prototype.makePost=function(o,e){var t=c(o);return new i.NamedNode(e,new l.LeafNode("[PRIORITY-POST]",t))},e.prototype.toString=function(){return".priority"},e}(o.Index);e.PriorityIndex=s,e.PRIORITY_INDEX=new s},function(m,g,e){"use strict";var n=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(o,e){for(var t in e)e.hasOwnProperty(t)&&(o[t]=e[t])};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(g,"__esModule",{value:!0});var b=e(0),t=e(1),o=e(17),v=e(5),r=e(37),l=e(3),a=e(10),s=e(39),p=e(16),d=e(41),c=function(){function p(o,a,t){this._=o,this.y=a,this.g=t,this.m=null,this.y&&r.validatePriorityNode(this.y),this._.isEmpty()&&b.assert(!this.y||this.y.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(p,"EMPTY_NODE",{get:function(){return u||(u=new p(new o.SortedMap(d.NAME_COMPARATOR),null,s.IndexMap.Default))},enumerable:!0,configurable:!0}),p.prototype.isLeafNode=function(){return!1},p.prototype.getPriority=function(){return this.y||u},p.prototype.updatePriority=function(e){return this._.isEmpty()?this:new p(this._,e,this.g)},p.prototype.getImmediateChild=function(n){if(".priority"===n)return this.getPriority();var e=this._.get(n);return null===e?u:e},p.prototype.getChild=function(n){var e=n.getFront();return null===e?this:this.getImmediateChild(e).getChild(n.popFront())},p.prototype.hasChild=function(t){return null!==this._.get(t)},p.prototype.updateImmediateChild=function(e,t){if(b.assert(t,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(t);var n=new v.NamedNode(e,t),o,r,a;return t.isEmpty()?(o=this._.remove(e),r=this.g.removeFromIndexes(n,this._)):(o=this._.insert(e,t),r=this.g.addToIndexes(n,this._)),a=o.isEmpty()?u:this.y,new p(o,a,r)},p.prototype.updateChild=function(o,e){var t=o.getFront();if(null===t)return e;b.assert(".priority"!==o.getFront()||1===o.getLength(),".priority must be the last token in a path");var n=this.getImmediateChild(t).updateChild(o.popFront(),e);return this.updateImmediateChild(t,n)},p.prototype.isEmpty=function(){return this._.isEmpty()},p.prototype.numChildren=function(){return this._.count()},p.prototype.val=function(e){if(this.isEmpty())return null;var d={},n=0,r=0,i=!0;if(this.forEachChild(l.PRIORITY_INDEX,function(t,o){d[t]=o.val(e),n++,i&&p.e.test(t)?r=Math.max(r,+t):i=!1}),!e&&i&&r<2*n){var o=[];for(var a in d)o[a]=d[a];return o}return e&&!this.getPriority().isEmpty()&&(d[".priority"]=this.getPriority().val()),d},p.prototype.hash=function(){if(null===this.m){var o="";this.getPriority().isEmpty()||(o+="priority:"+r.priorityHashText(this.getPriority().val())+":"),this.forEachChild(l.PRIORITY_INDEX,function(e,t){var n=t.hash();""!==n&&(o+=":"+e+":"+n)}),this.m=""==o?"":t.sha1(o)}return this.m},p.prototype.getPredecessorChildName=function(o,e,t){var n=this.C(t);if(n){var r=n.getPredecessorKey(new v.NamedNode(o,e));return r?r.name:null}return this._.getPredecessorKey(o)},p.prototype.getFirstChildName=function(o){var e=this.C(o);if(e){var t=e.minKey();return t&&t.name}return this._.minKey()},p.prototype.getFirstChild=function(n){var e=this.getFirstChildName(n);return e?new v.NamedNode(e,this._.get(e)):null},p.prototype.getLastChildName=function(o){var e=this.C(o);if(e){var t=e.maxKey();return t&&t.name}return this._.maxKey()},p.prototype.getLastChild=function(n){var e=this.getLastChildName(n);return e?new v.NamedNode(e,this._.get(e)):null},p.prototype.forEachChild=function(o,r){var e=this.C(o);return e?e.inorderTraversal(function(t){return r(t.name,t.node)}):this._.inorderTraversal(r)},p.prototype.getIterator=function(t){return this.getIteratorFrom(t.minPost(),t)},p.prototype.getIteratorFrom=function(o,e){var t=this.C(e);if(t)return t.getIteratorFrom(o,function(t){return t});for(var n=this._.getIteratorFrom(o.name,v.NamedNode.Wrap),r=n.peek();null!=r&&0>e.compare(r,o);)n.getNext(),r=n.peek();return n},p.prototype.getReverseIterator=function(t){return this.getReverseIteratorFrom(t.maxPost(),t)},p.prototype.getReverseIteratorFrom=function(o,e){var t=this.C(e);if(t)return t.getReverseIteratorFrom(o,function(t){return t});for(var n=this._.getReverseIteratorFrom(o.name,v.NamedNode.Wrap),r=n.peek();null!=r&&0p.S/3&&o.stringLength(e)>p.S)throw Error(i+"contains a string greater than "+p.S+" utf8 bytes "+a.toErrorString()+" ('"+e.substring(0,50)+"...')");if(e&&"object"==typeof e){var s=!1,d=!1;if(c.forEach(e,function(e,t){if(".value"===e)s=!0;else if(".priority"!==e&&".sv"!==e&&(d=!0,!p.isValidKey(e)))throw Error(i+" contains an invalid key ("+e+") "+a.toErrorString()+". Keys must be non-empty strings and can't contain \".\", \"#\", \"$\", \"/\", \"[\", or \"]\"");a.push(e),p.validateFirebaseData(i,t,a),a.pop()}),s&&d)throw Error(i+" contains \".value\" child "+a.toErrorString()+" in addition to actual children.")}},p.validateFirebaseMergePaths=function(r,e){var n,i;for(n=0;ni)a=this.I?a.left:a.right;else{if(0===i){this.O.push(a);break}this.O.push(a),a=this.I?a.right:a.left}}return t.prototype.getNext=function(){if(0===this.O.length)return null;var n=this.O.pop(),t;if(t=this.R?this.R(n.key,n.value):{key:n.key,value:n.value},this.I)for(n=n.left;!n.isEmpty();)this.O.push(n),n=n.right;else for(n=n.right;!n.isEmpty();)this.O.push(n),n=n.left;return t},t.prototype.hasNext=function(){return 0n?r.copy(null,null,null,r.left.insert(o,e,t),null):0===n?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(o,e,t)),r.D()},a.prototype.M=function(){if(this.left.isEmpty())return d.EMPTY_NODE;var t=this;return t.left.L()||t.left.left.L()||(t=t.F()),t=t.copy(null,null,null,t.left.M(),null),t.D()},a.prototype.remove=function(o,e){var t,n;if(t=this,0>e(o,t.key))t.left.isEmpty()||t.left.L()||t.left.left.L()||(t=t.F()),t=t.copy(null,null,null,t.left.remove(o,e),null);else{if(t.left.L()&&(t=t.x()),t.right.isEmpty()||t.right.L()||t.right.left.L()||(t=t.k()),0===e(o,t.key)){if(t.right.isEmpty())return d.EMPTY_NODE;n=t.right.A(),t=t.copy(n.key,n.value,null,null,t.right.M())}t=t.copy(null,null,null,null,t.right.remove(o,e))}return t.D()},a.prototype.L=function(){return this.color},a.prototype.D=function(){var t=this;return t.right.L()&&!t.left.L()&&(t=t.W()),t.left.L()&&t.left.left.L()&&(t=t.x()),t.left.L()&&t.right.L()&&(t=t.j()),t},a.prototype.F=function(){var t=this.j();return t.right.left.L()&&(t=t.copy(null,null,null,null,t.right.x()),t=t.W(),t=t.j()),t},a.prototype.k=function(){var t=this.j();return t.left.left.L()&&(t=t.x(),t=t.j()),t},a.prototype.W=function(){var e=this.copy(null,null,a.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},a.prototype.x=function(){var e=this.copy(null,null,a.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},a.prototype.j=function(){var n=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,n,e)},a.prototype.V=function(){var t=this.Q();return Math.pow(2,t)<=this.count()+1},a.prototype.Q=function(){var t;if(this.L()&&this.left.L())throw Error("Red node has red child("+this.key+","+this.value+")");if(this.right.L())throw Error("Right child of ("+this.key+","+this.value+") is red");if((t=this.left.Q())!==this.right.Q())throw Error("Black depths differ");return t+(this.L()?0:1)},a.RED=!0,a.BLACK=!1,a}();e.LLRBNode=r;var t=function(){function t(){}return t.prototype.copy=function(){return this},t.prototype.insert=function(n,e){return new r(n,e,null)},t.prototype.remove=function(){return this},t.prototype.count=function(){return 0},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(){return!1},t.prototype.reverseTraversal=function(){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.Q=function(){return 0},t.prototype.L=function(){return!1},t}();e.LLRBEmptyNode=t;var d=function(){function o(e,t){void 0===t&&(t=o.EMPTY_NODE),this.U=e,this.B=t}return o.prototype.insert=function(e,t){return new o(this.U,this.B.insert(e,t,this.U).copy(null,null,r.BLACK,null,null))},o.prototype.remove=function(e){return new o(this.U,this.B.remove(e,this.U).copy(null,null,r.BLACK,null,null))},o.prototype.get=function(o){for(var e=this.B,n;!e.isEmpty();){if(0===(n=this.U(o,e.key)))return e.value;0>n?e=e.left:0r?e=e.left:0.firebaseio.com instead"),n&&"undefined"!=n||o.fatal("Cannot parse Firebase url. Please use https://.firebaseio.com"),e.secure||o.warnIfPageIsSecure();var r="ws"===e.scheme||"wss"===e.scheme;return{repoInfo:new i.RepoInfo(e.host,e.secure,n,r),path:new t.Path(e.pathString)}},d.parseURL=function(r){var d="",m="",g="",f="",y=!0,b="https",v=443;if("string"==typeof r){var x=r.indexOf("//");0<=x&&(b=r.substring(0,x-1),r=r.substring(x+2));var l=r.indexOf("/");-1===l&&(l=r.length),d=r.substring(0,l),f=p(r.substring(l));var h=d.split(".");3===h.length?(m=h[1],g=h[0].toLowerCase()):2===h.length&&(m=h[0]),0<=(x=d.indexOf(":"))&&(y="https"===b||"wss"===b,v=parseInt(d.substring(x+1),10))}return{host:d,port:v,domain:m,subdomain:g,secure:y,scheme:b,pathString:f}}},function(d,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l=t(0),r=t(0),p=t(13),i=t(14),n=function(){function t(o,a,t,n,r){void 0===r&&(r=""),this.secure=a,this.namespace=t,this.webSocketOnly=n,this.persistenceKey=r,this.host=o.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=p.PersistentStorage.get("host:"+o)||this.host}return t.prototype.needsQueryParam=function(){return this.host!==this.internalHost},t.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},t.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},t.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},t.prototype.updateHost=function(t){t!==this.internalHost&&(this.internalHost=t,this.isCacheableHost()&&p.PersistentStorage.set("host:"+this.host,this.internalHost))},t.prototype.connectionURL=function(a,s){l.assert("string"==typeof a,"typeof type must == string"),l.assert("object"==typeof s,"typeof params must == object");var d;if(a===i.WEBSOCKET)d=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if(a!==i.LONG_POLLING)throw Error("Unknown connection type: "+a);d=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(s.ns=this.namespace);var n=[];return r.forEach(s,function(o,e){n.push(o+"="+e)}),d+n.join("&")},t.prototype.toString=function(){var t=this.toURLString();return this.persistenceKey&&(t+="<"+this.persistenceKey+">"),t},t.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},t}();e.RepoInfo=n},function(d,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l=t(0),r=t(7),i=t(1),p=t(0),n=function(){function t(n,o){this.Ie=n,this.Oe=o}return t.prototype.cancel=function(n){l.validateArgCount("OnDisconnect.cancel",0,1,arguments.length),l.validateCallback("OnDisconnect.cancel",1,n,!0);var e=new p.Deferred;return this.Ie.onDisconnectCancel(this.Oe,e.wrapCallback(n)),e.promise},t.prototype.remove=function(n){l.validateArgCount("OnDisconnect.remove",0,1,arguments.length),r.validateWritablePath("OnDisconnect.remove",this.Oe),l.validateCallback("OnDisconnect.remove",1,n,!0);var e=new p.Deferred;return this.Ie.onDisconnectSet(this.Oe,null,e.wrapCallback(n)),e.promise},t.prototype.set=function(o,e){l.validateArgCount("OnDisconnect.set",1,2,arguments.length),r.validateWritablePath("OnDisconnect.set",this.Oe),r.validateFirebaseDataArg("OnDisconnect.set",1,o,this.Oe,!1),l.validateCallback("OnDisconnect.set",2,e,!0);var t=new p.Deferred;return this.Ie.onDisconnectSet(this.Oe,o,t.wrapCallback(e)),t.promise},t.prototype.setWithPriority=function(a,e,t){l.validateArgCount("OnDisconnect.setWithPriority",2,3,arguments.length),r.validateWritablePath("OnDisconnect.setWithPriority",this.Oe),r.validateFirebaseDataArg("OnDisconnect.setWithPriority",1,a,this.Oe,!1),r.validatePriority("OnDisconnect.setWithPriority",2,e,!1),l.validateCallback("OnDisconnect.setWithPriority",3,t,!0);var n=new p.Deferred;return this.Ie.onDisconnectSetWithPriority(this.Oe,a,e,n.wrapCallback(t)),n.promise},t.prototype.update=function(o,e){if(l.validateArgCount("OnDisconnect.update",1,2,arguments.length),r.validateWritablePath("OnDisconnect.update",this.Oe),Array.isArray(o)){for(var t={},n=0;n=e)throw Error("Query.limitToFirst: First argument must be a positive integer.");if(this.Ae.hasLimit())throw Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new h(this.repo,this.path,this.Ae.limitToFirst(e),this.De)},h.prototype.limitToLast=function(e){if(c.validateArgCount("Query.limitToLast",1,1,arguments.length),"number"!=typeof e||n(e)!==e||0>=e)throw Error("Query.limitToLast: First argument must be a positive integer.");if(this.Ae.hasLimit())throw Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new h(this.repo,this.path,this.Ae.limitToLast(e),this.De)},h.prototype.orderByChild=function(e){if(c.validateArgCount("Query.orderByChild",1,1,arguments.length),"$key"===e)throw Error("Query.orderByChild: \"$key\" is invalid. Use Query.orderByKey() instead.");if("$priority"===e)throw Error("Query.orderByChild: \"$priority\" is invalid. Use Query.orderByPriority() instead.");if("$value"===e)throw Error("Query.orderByChild: \"$value\" is invalid. Use Query.orderByValue() instead.");y.validatePathString("Query.orderByChild",1,e,!1),this.Fe("Query.orderByChild");var t=new l.Path(e);if(t.isEmpty())throw Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");var n=new s.PathIndex(t),o=this.Ae.orderBy(n);return h.Me(o),new h(this.repo,this.path,o,!0)},h.prototype.orderByKey=function(){c.validateArgCount("Query.orderByKey",0,0,arguments.length),this.Fe("Query.orderByKey");var e=this.Ae.orderBy(i.KEY_INDEX);return h.Me(e),new h(this.repo,this.path,e,!0)},h.prototype.orderByPriority=function(){c.validateArgCount("Query.orderByPriority",0,0,arguments.length),this.Fe("Query.orderByPriority");var e=this.Ae.orderBy(o.PRIORITY_INDEX);return h.Me(e),new h(this.repo,this.path,e,!0)},h.prototype.orderByValue=function(){c.validateArgCount("Query.orderByValue",0,0,arguments.length),this.Fe("Query.orderByValue");var e=this.Ae.orderBy(a.VALUE_INDEX);return h.Me(e),new h(this.repo,this.path,e,!0)},h.prototype.startAt=function(e,t){void 0===e&&(e=null),c.validateArgCount("Query.startAt",0,2,arguments.length),y.validateFirebaseDataArg("Query.startAt",1,e,this.path,!0),y.validateKey("Query.startAt",2,t,!0);var n=this.Ae.startAt(e,t);if(h.Le(n),h.Me(n),this.Ae.hasStart())throw Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===e&&(e=null,t=null),new h(this.repo,this.path,n,this.De)},h.prototype.endAt=function(e,t){void 0===e&&(e=null),c.validateArgCount("Query.endAt",0,2,arguments.length),y.validateFirebaseDataArg("Query.endAt",1,e,this.path,!0),y.validateKey("Query.endAt",2,t,!0);var n=this.Ae.endAt(e,t);if(h.Le(n),h.Me(n),this.Ae.hasEnd())throw Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new h(this.repo,this.path,n,this.De)},h.prototype.equalTo=function(n,e){if(c.validateArgCount("Query.equalTo",1,2,arguments.length),y.validateFirebaseDataArg("Query.equalTo",1,n,this.path,!1),y.validateKey("Query.equalTo",2,e,!0),this.Ae.hasStart())throw Error("Query.equalTo: Starting point was already set (by another call to startAt or equalTo).");if(this.Ae.hasEnd())throw Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.startAt(n,e).endAt(n,e)},h.prototype.toString=function(){return c.validateArgCount("Query.toString",0,0,arguments.length),""+this.repo+this.path.toUrlEncodedString()},h.prototype.toJSON=function(){return c.validateArgCount("Query.toJSON",0,1,arguments.length),""+this},h.prototype.queryObject=function(){return this.Ae.getQueryObject()},h.prototype.queryIdentifier=function(){var n=this.queryObject(),e=u.ObjectToUniqueKey(n);return"{}"===e?"default":e},h.prototype.isEqual=function(e){if(c.validateArgCount("Query.isEqual",1,1,arguments.length),!(e instanceof h))throw Error("Query.isEqual failed: First argument must be an instance of firebase.database.Query.");var t=this.repo===e.repo,n=this.path.equals(e.path),o=this.queryIdentifier()===e.queryIdentifier();return t&&n&&o},h.xe=function(o,e,a){var n={cancel:null,context:null};if(e&&a)n.cancel=e,c.validateCallback(o,3,n.cancel,!0),n.context=a,c.validateContextObject(o,4,n.context,!0);else if(e)if("object"==typeof e&&null!==e)n.context=e;else{if("function"!=typeof e)throw Error(c.errorPrefix(o,3,!0)+" must either be a cancel callback or a context object.");n.cancel=e}return n},Object.defineProperty(h.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),h}(),f;e.Query=h},function(r,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t(0),o=t(1),a=t(0),s;e.setMaxNode=function(t){s=t},e.priorityHashText=function(t){return"number"==typeof t?"number:"+o.doubleToIEEE754String(t):"string:"+t},e.validatePriorityNode=function(o){if(o.isLeafNode()){var e=o.val();n.assert("string"==typeof e||"number"==typeof e||"object"==typeof e&&a.contains(e,".sv"),"Priority must be a string or number.")}else n.assert(o===s||o.isEmpty(),"priority of unexpected type.");n.assert(o===s||o.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")}},function(d,e,t){"use strict";var n=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(o,e){for(var t in e)e.hasOwnProperty(t)&&(o[t]=e[t])};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=t(15),i=t(5),o=t(1),a=t(11),s=function(r){function e(){return null!==r&&r.apply(this,arguments)||this}return n(e,r),e.prototype.compare=function(r,e){var t=r.node.compareTo(e.node);return 0===t?o.nameCompare(r.name,e.name):t},e.prototype.isDefinedOn=function(){return!0},e.prototype.indexedValueChanged=function(n,e){return!n.equals(e)},e.prototype.minPost=function(){return i.NamedNode.MIN},e.prototype.maxPost=function(){return i.NamedNode.MAX},e.prototype.makePost=function(o,e){var t=a.nodeFromJSON(o);return new i.NamedNode(e,t)},e.prototype.toString=function(){return".value"},e}(r.Index);e.ValueIndex=s,e.VALUE_INDEX=new s},function(d,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var m=t(0),i=t(40),o=t(0),a=t(5),n=t(3),s=t(10),g={},l=function(){function l(n,o){this.ke=n,this.We=o}return Object.defineProperty(l,"Default",{get:function(){return m.assert(n.PRIORITY_INDEX,"ChildrenNode.ts has not been loaded"),p=p||new l({".priority":g},{".priority":n.PRIORITY_INDEX})},enumerable:!0,configurable:!0}),l.prototype.get=function(n){var e=o.safeGet(this.ke,n);if(!e)throw Error("No index defined for "+n);return e===g?null:e},l.prototype.hasIndex=function(t){return o.contains(this.We,""+t)},l.prototype.addIndex=function(e,t){m.assert(e!==s.KEY_INDEX,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var n=[],r=!1,u=t.getIterator(a.NamedNode.Wrap),c=u.getNext();c;)r=r||e.isDefinedOn(c.node),n.push(c),c=u.getNext();var p=r?i.buildChildSet(n,e.getCompare()):g;var d=""+e,h=o.clone(this.We);h[d]=e;var f=o.clone(this.ke);return f[d]=p,new l(f,h)},l.prototype.addToIndexes=function(s,t){var n=this;return new l(o.map(this.ke,function(r,e){var u=o.safeGet(n.We,e);if(m.assert(u,"Missing index implementation for "+e),r===g){if(u.isDefinedOn(s.node)){for(var l=[],c=t.getIterator(a.NamedNode.Wrap),p=c.getNext();p;)p.name!=s.name&&l.push(p),p=c.getNext();return l.push(s),i.buildChildSet(l,u.getCompare())}return g}var d=t.get(s.name),h=r;return d&&(h=h.remove(new a.NamedNode(s.name,d))),h.insert(s,s.node)}),this.We)},l.prototype.removeFromIndexes=function(i,t){return new l(o.map(this.ke,function(n){if(n===g)return n;var e=t.get(i.name);return e?n.remove(new a.NamedNode(i.name,e)):n}),this.We)},l}(),p;e.IndexMap=l},function(o,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var d=t(17),r=t(17),i=function(){function t(n){this.count=function(t){return parseInt(Math.log(t)/0.6931471805599453,10)}(n+1),this.je=this.count-1;var o=function(t){return parseInt(Array(t+1).join("1"),2)}(this.count);this.Ve=n+1&o}return t.prototype.nextBitIsOne=function(){var t=!(this.Ve&1<=this.pn?(this.de("Secondary connection is healthy."),this.nn=!0,this.tn.markConnectionHealthy(),this.dn()):(this.de("sending ping on secondary."),this.tn.send({t:"c",d:{t:"p",d:{}}}))},t.prototype.dn=function(){this.tn.start(),this.de("sending client ack on secondary"),this.tn.send({t:"c",d:{t:"a",d:{}}}),this.de("Ending transmission on primary"),this.Yt.send({t:"c",d:{t:"n",d:{}}}),this.Zt=this.tn,this.tryCleanupConnection()},t.prototype.sn=function(o){var e=l.requireKey("t",o),t=l.requireKey("d",o);"c"==e?this.fn(t):"d"==e&&this.wt(t)},t.prototype.wt=function(t){this._n(),this.Ut(t)},t.prototype._n=function(){this.nn||0>=--this.zt&&(this.de("Primary connection is healthy."),this.nn=!0,this.Yt.markConnectionHealthy())},t.prototype.fn=function(o){var e=l.requireKey("t",o);if("d"in o){var t=o.d;if("h"===e)this.yn(t);else if("n"===e){this.de("recvd end transmission on primary"),this.en=this.tn;for(var n=0;ndocument.domain=\""+document.domain+"\";");var d=""+s+"";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(d),this.myIFrame.doc.close()}catch(t){m.log("frame writing exception"),t.stack&&m.log(t.stack),m.log(t)}}}return a.Dn=function(){var n=document.createElement("iframe");if(n.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(n);try{n.contentWindow.document||m.log("No IE domain setting required")}catch(t){var e=document.domain;n.src="javascript:void((function(){document.open();document.domain='"+e+"';document.close();})())"}return n.contentDocument?n.doc=n.contentDocument:n.contentWindow?n.doc=n.contentWindow.document:n.document&&(n.doc=n.document),n},a.prototype.close=function(){var e=this;if(this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout(function(){null!==e.myIFrame&&(document.body.removeChild(e.myIFrame),e.myIFrame=null)},0)),f.isNodeSdk()&&this.myID){var t={};t[p.FIREBASE_LONGPOLL_DISCONN_FRAME_PARAM]="t",t[p.FIREBASE_LONGPOLL_ID_PARAM]=this.myID,t[p.FIREBASE_LONGPOLL_PW_PARAM]=this.myPW;var n=this.urlFn(t);a.nodeRestRequest(n)}var r=this.onDisconnect;r&&(this.onDisconnect=null,r())},a.prototype.startLongPoll=function(n,e){for(this.myID=n,this.myPW=e,this.alive=!0;this.Mn(););},a.prototype.Mn=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.count()<(0=this.pendingSegs[0].d.length+30+n.length;)a=this.pendingSegs.shift(),n=n+"&"+p.FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM+r+"="+a.seg+"&"+p.FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET+r+"="+a.ts+"&"+p.FIREBASE_LONGPOLL_DATA_PARAM+r+"="+a.d,r++;return e+=n,this.Ln(e,this.currentSerial),!0}return!1},a.prototype.enqueueSegment=function(o,r,a){this.pendingSegs.push({seg:o,ts:r,d:a}),this.alive&&this.Mn()},a.prototype.Ln=function(o,e){var t=this;this.outstandingRequests.add(e,1);var n=function(){t.outstandingRequests.remove(e),t.Mn()},r=setTimeout(n,25000);this.addTag(o,function(){clearTimeout(r),n()})},a.prototype.addTag=function(o,r){var e=this;f.isNodeSdk()?this.doNodeLongPoll(o,r):setTimeout(function(){try{if(!e.sendNewPolls)return;var t=e.myIFrame.doc.createElement("script");t.type="text/javascript",t.async=!0,t.src=o,t.onload=t.onreadystatechange=function(){var n=t.readyState;n&&"loaded"!==n&&"complete"!==n||(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),r())},t.onerror=function(){m.log("Long-poll script failed to load: "+o),e.sendNewPolls=!1,e.close()},e.myIFrame.doc.body.appendChild(t)}catch(t){}},1)},a}();p.FirebaseIFrameScriptHolder=l},function(o,r,t){"use strict";(function(n){Object.defineProperty(r,"__esModule",{value:!0});var e=t(6),i=t(0),o=t(1),a=t(25),m=t(14),u=t(0),l=t(13),s=t(0),h=t(0),p=null;"undefined"==typeof MozWebSocket?"undefined"!=typeof WebSocket&&(p=WebSocket):p=MozWebSocket,r.setWebSocketImpl=function(t){p=t};var d=function(){function d(t,e,n,r){this.connId=t,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.de=o.logWrapper(this.connId),this.$=a.StatsManager.getCollection(e),this.connURL=d.Fn(e,n,r)}return d.Fn=function(o,e,t){var n={};return n[m.VERSION_PARAM]=m.PROTOCOL_VERSION,!h.isNodeSdk()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf(m.FORGE_DOMAIN)&&(n[m.REFERER_PARAM]=m.FORGE_REF),e&&(n[m.TRANSPORT_SESSION_PARAM]=e),t&&(n[m.LAST_SESSION_PARAM]=t),o.connectionURL(m.WEBSOCKET,n)},d.prototype.open=function(i,t){var d=this;this.onDisconnect=t,this.onMessage=i,this.de("Websocket connecting to "+this.connURL),this.bn=!1,l.PersistentStorage.set("previous_websocket_failure",!0);try{if(h.isNodeSdk()){var r=u.CONSTANTS.NODE_ADMIN?"AdminNode":"Node",o={headers:{"User-Agent":"Firebase/"+m.PROTOCOL_VERSION+"/"+e.default.SDK_VERSION+"/"+n.platform+"/"+r}},a=n.env,s=0==this.connURL.indexOf("wss://")?a.HTTPS_PROXY||a.https_proxy:a.HTTP_PROXY||a.http_proxy;s&&(o.proxy={origin:s}),this.mySock=new p(this.connURL,[],o)}else this.mySock=new p(this.connURL)}catch(t){this.de("Error instantiating WebSocket.");var g=t.message||t.data;return g&&this.de(g),void this.wn()}this.mySock.onopen=function(){d.de("Websocket connected."),d.bn=!0},this.mySock.onclose=function(){d.de("Websocket connection was disconnected."),d.mySock=null,d.wn()},this.mySock.onmessage=function(t){d.handleIncomingFrame(t)},this.mySock.onerror=function(n){d.de("WebSocket error. Closing connection.");var e=n.message||n.data;e&&d.de(e),d.wn()}},d.prototype.start=function(){},d.forceDisallow=function(){d.On=!0},d.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var o=/Android ([0-9]{0,}\.[0-9]{0,})/,n=navigator.userAgent.match(o);n&&1parseFloat(n[1])&&(t=!0)}return!t&&null!==p&&!d.On},d.previouslyFailed=function(){return l.PersistentStorage.isInMemoryStorage||!0===l.PersistentStorage.get("previous_websocket_failure")},d.prototype.markConnectionHealthy=function(){l.PersistentStorage.remove("previous_websocket_failure")},d.prototype.xn=function(o){if(this.frames.push(o),this.frames.length==this.totalFrames){var e=this.frames.join("");this.frames=null;var t=s.jsonEval(e);this.onMessage(t)}},d.prototype.kn=function(t){this.totalFrames=t,this.frames=[]},d.prototype.Wn=function(n){if(i.assert(null===this.frames,"We already have a frame buffer"),6>=n.length){var o=+n;if(!isNaN(o))return this.kn(o),null}return this.kn(1),n},d.prototype.handleIncomingFrame=function(o){if(null!==this.mySock){var e=o.data;if(this.bytesReceived+=e.length,this.$.incrementCounter("bytes_received",e.length),this.resetKeepAlive(),null!==this.frames)this.xn(e);else{var t=this.Wn(e);null!==t&&this.xn(t)}}},d.prototype.send=function(a){this.resetKeepAlive();var e=s.stringify(a);this.bytesSent+=e.length,this.$.incrementCounter("bytes_sent",e.length);var t=o.splitStringBySize(e,16384);1=this.me.compare(this.getStartPost(),t)&&0>=this.me.compare(t,this.getEndPost())},r.prototype.updateChild=function(a,e,t,n,r,i){return this.matches(new p.NamedNode(e,t))||(t=o.ChildrenNode.EMPTY_NODE),this.Vn.updateChild(a,e,t,n,r,i)},r.prototype.updateFullNode=function(a,e,t){e.isLeafNode()&&(e=o.ChildrenNode.EMPTY_NODE);var n=e.withIndex(this.me);n=n.updatePriority(o.ChildrenNode.EMPTY_NODE);var r=this;return e.forEachChild(l.PRIORITY_INDEX,function(a,e){r.matches(new p.NamedNode(a,e))||(n=n.updateImmediateChild(a,o.ChildrenNode.EMPTY_NODE))}),this.Vn.updateFullNode(a,n,t)},r.prototype.updatePriority=function(t){return t},r.prototype.filtersNodes=function(){return!0},r.prototype.getIndexedFilter=function(){return this.Vn},r.prototype.getIndex=function(){return this.me},r.qn=function(n){if(n.hasStart()){var e=n.getIndexStartName();return n.getIndex().makePost(n.getIndexStartValue(),e)}return n.getIndex().minPost()},r.Bn=function(n){if(n.hasEnd()){var e=n.getIndexEndName();return n.getIndex().makePost(n.getIndexEndValue(),e)}return n.getIndex().maxPost()},r}();e.RangedFilter=r},,,,,,,,,,,,,,,,,,,,,,function(o,e,t){o.exports=t(79)},function(m,e,t){"use strict";function n(e){var t=e.INTERNAL.registerService("database",function(o,e,t){return u.RepoManager.getInstance().databaseFromApp(o,t)},{Reference:a.Reference,Query:o.Query,Database:i.Database,enableLogging:s.enableLogging,INTERNAL:l,ServerValue:p,TEST_ACCESS:g},null,!0);y.isNodeSdk()&&(m.exports=t)}Object.defineProperty(e,"__esModule",{value:!0});var r=t(6),i=t(32);e.Database=i.Database;var o=t(36);e.Query=o.Query;var a=t(21);e.Reference=a.Reference;var s=t(1);e.enableLogging=s.enableLogging;var u=t(26),l=t(111),g=t(112),y=t(0),p=i.Database.ServerValue;e.ServerValue=p,e.registerDatabase=n,n(r.default);var b=t(22);e.DataSnapshot=b.DataSnapshot;var f=t(35);e.OnDisconnect=f.OnDisconnect},function(o,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t(0),r=function(){function t(t){this.Hn=t,this.Gn="firebase:"}return t.prototype.set=function(o,e){null==e?this.Hn.removeItem(this.Kn(o)):this.Hn.setItem(this.Kn(o),n.stringify(e))},t.prototype.get=function(o){var e=this.Hn.getItem(this.Kn(o));return null==e?null:n.jsonEval(e)},t.prototype.remove=function(t){this.Hn.removeItem(this.Kn(t))},t.prototype.Kn=function(t){return this.Gn+t},t.prototype.toString=function(){return""+this.Hn},t}();e.DOMStorageWrapper=r},function(o,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t(0),r=function(){function t(){this.Yn={},this.isInMemoryStorage=!0}return t.prototype.set=function(n,e){null==e?delete this.Yn[n]:this.Yn[n]=e},t.prototype.get=function(t){return n.contains(this.Yn,t)?this.Yn[t]:null},t.prototype.remove=function(t){delete this.Yn[t]},t}();e.MemoryStorage=r},function(o,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t(0),r=function(){function t(n,o){this.committed=n,this.snapshot=o}return t.prototype.toJSON=function(){return n.validateArgCount("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},t}();e.TransactionResult=r},function(o,e,t){"use strict";var d=Math.floor;Object.defineProperty(e,"__esModule",{value:!0});var l=t(0);e.nextPushId=function(){var o="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",e=0,t=[];return function(n){var r=n===e;e=n;var i=Array(8),s;for(s=7;0<=s;s--)i[s]=o.charAt(n%64),n=d(n/64);l.assert(0===n,"Cannot push at time == 0");var a=i.join("");if(r){for(s=11;0<=s&&63===t[s];s--)t[s]=0;t[s]++}else for(s=0;12>s;s++)t[s]=d(64*Math.random());for(s=0;12>s;s++)a+=o.charAt(t[s]);return l.assert(20===a.length,"nextPushId: Length should be 20."),a}}()},function(d,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l=t(22),r=t(85),p=t(0),i=t(0),n=function(){function n(o,r,t){this.Xn=o,this.zn=r,this.Jn=t}return n.prototype.respondsTo=function(t){return"value"===t},n.prototype.createEvent=function(o,e){var t=e.getQueryParams().getIndex();return new r.DataEvent("value",this,new l.DataSnapshot(o.snapshotNode,e.getRef(),t))},n.prototype.getEventRunner=function(o){var e=this.Jn;if("cancel"===o.getEventType()){i.assert(this.zn,"Raising a cancel event on a listener with no cancel callback");var t=this.zn;return function(){t.call(e,o.error)}}var n=this.Xn;return function(){n.call(e,o.snapshot)}},n.prototype.createCancelEvent=function(n,e){return this.zn?new r.CancelEvent(this,n,e):null},n.prototype.matches=function(e){return e instanceof n&&(!e.Xn||!this.Xn||e.Xn===this.Xn&&e.Jn===this.Jn)},n.prototype.hasAnyCallback=function(){return null!==this.Xn},n}();e.ValueEventRegistration=n;var o=function(){function o(o,r,t){this.$n=o,this.zn=r,this.Jn=t}return o.prototype.respondsTo=function(n){var e="children_added"===n?"child_added":n;return e="children_removed"==e?"child_removed":e,p.contains(this.$n,e)},o.prototype.createCancelEvent=function(n,e){return this.zn?new r.CancelEvent(this,n,e):null},o.prototype.createEvent=function(a,e){i.assert(null!=a.childName,"Child events should have a childName.");var t=e.getRef().child(a.childName),n=e.getQueryParams().getIndex();return new r.DataEvent(a.type,this,new l.DataSnapshot(a.snapshotNode,t,n),a.prevName)},o.prototype.getEventRunner=function(o){var e=this.Jn;if("cancel"===o.getEventType()){i.assert(this.zn,"Raising a cancel event on a listener with no cancel callback");var t=this.zn;return function(){t.call(e,o.error)}}var n=this.$n[o.eventType];return function(){n.call(e,o.snapshot,o.prevName)}},o.prototype.matches=function(a){if(a instanceof o){if(!this.$n||!a.$n)return!0;if(this.Jn===a.Jn){var e=p.getCount(a.$n);if(e===p.getCount(this.$n)){if(1===e){var t=p.getAnyKey(a.$n),n=p.getAnyKey(this.$n);return!(n!==t||a.$n[t]&&this.$n[n]&&a.$n[t]!==this.$n[n])}return p.every(this.$n,function(t,e){return a.$n[t]===e})}}}return!1},o.prototype.hasAnyCallback=function(){return null!==this.$n},o}();e.ChildEventRegistration=o},function(a,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t(0),r=function(){function t(o,a,t,n){this.eventType=o,this.eventRegistration=a,this.snapshot=t,this.prevName=n}return t.prototype.getPath=function(){var t=this.snapshot.getRef();return"value"===this.eventType?t.path:t.getParent().path},t.prototype.getEventType=function(){return this.eventType},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.getPath()+":"+this.eventType+":"+n.stringify(this.snapshot.exportVal())},t}();e.DataEvent=r;var i=function(){function t(o,r,t){this.eventRegistration=o,this.error=r,this.path=t}return t.prototype.getPath=function(){return this.path},t.prototype.getEventType=function(){return"cancel"},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.path+":cancel"},t}();e.CancelEvent=i},function(m,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var g=t(0),b=t(1),i=t(87),r=t(4),o=t(0),v=t(23),n=t(88),u=t(89),h=t(8),c=t(46),x=t(2),a=t(47),s=t(95),d=function(){function m(t){this.Zn=t,this.er=v.ImmutableTree.Empty,this.tr=new s.WriteTree,this.nr={},this.rr={}}return m.prototype.applyUserOverwrite=function(o,e,t,n){return this.tr.addOverwrite(o,e,t,n),n?this.ir(new c.Overwrite(h.OperationSource.User,o,e)):[]},m.prototype.applyUserMerge=function(o,e,t){this.tr.addMerge(o,e,t);var n=v.ImmutableTree.fromObject(e);return this.ir(new u.Merge(h.OperationSource.User,o,n))},m.prototype.ackUserWrite=function(a,e){void 0===e&&(e=!1);var t=this.tr.getWrite(a);if(this.tr.removeWrite(a)){var n=v.ImmutableTree.Empty;return null==t.snap?o.forEach(t.children,function(o,e){n=n.set(new x.Path(o),e)}):n=n.set(x.Path.Empty,!0),this.ir(new i.AckUserWrite(t.path,n,e))}return[]},m.prototype.applyServerOverwrite=function(n,e){return this.ir(new c.Overwrite(h.OperationSource.Server,n,e))},m.prototype.applyServerMerge=function(o,e){var t=v.ImmutableTree.fromObject(e);return this.ir(new u.Merge(h.OperationSource.Server,o,t))},m.prototype.applyListenComplete=function(t){return this.ir(new n.ListenComplete(h.OperationSource.Server,t))},m.prototype.applyTaggedQueryOverwrite=function(e,t,n){var r=this.or(n);if(null!=r){var i=m.ar(r),o=i.path,a=i.queryId,s=x.Path.relativePath(o,e),d=new c.Overwrite(h.OperationSource.forServerTaggedQuery(a),s,t);return this.sr(o,d)}return[]},m.prototype.applyTaggedQueryMerge=function(e,t,n){var r=this.or(n);if(r){var i=m.ar(r),o=i.path,a=i.queryId,s=x.Path.relativePath(o,e),d=v.ImmutableTree.fromObject(t),l=new u.Merge(h.OperationSource.forServerTaggedQuery(a),s,d);return this.sr(o,l)}return[]},m.prototype.applyTaggedListenComplete=function(e,t){var d=this.or(t);if(d){var r=m.ar(d),i=r.path,o=r.queryId,a=x.Path.relativePath(i,e),s=new n.ListenComplete(h.OperationSource.forServerTaggedQuery(o),a);return this.sr(i,s)}return[]},m.prototype.addEventRegistration=function(e,t){var d=e.path,i=null,o=!1;this.er.foreachOnPath(d,function(r,e){var t=x.Path.relativePath(r,d);i=i||e.getCompleteServerCache(t),o=o||e.hasCompleteView()});var n=this.er.get(d);n?(o=o||n.hasCompleteView(),i=i||n.getCompleteServerCache(x.Path.Empty)):(n=new a.SyncPoint,this.er=this.er.set(d,n));var u;null==i?(u=!1,i=r.ChildrenNode.EMPTY_NODE,this.er.subtree(d).foreachChild(function(o,e){var t=e.getCompleteServerCache(x.Path.Empty);t&&(i=i.updateImmediateChild(o,t))})):u=!0;var l=n.viewExistsForQuery(e);if(!l&&!e.getQueryParams().loadsAllData()){var f=m.ur(e);g.assert(!(f in this.rr),"View does not exist, but we have a tag");var c=m.lr();this.rr[f]=c,this.nr["_"+c]=f}var p=this.tr.childWrites(d),b=n.addEventRegistration(e,t,p,i,u);if(!l&&!o){var y=n.viewForQuery(e);b=b.concat(this.hr(e,y))}return b},m.prototype.removeEventRegistration=function(e,t,n){var r=this,i=e.path,o=this.er.get(i),a=[];if(o&&("default"===e.queryIdentifier()||o.viewExistsForQuery(e))){var s=o.removeEventRegistration(e,t,n);o.isEmpty()&&(this.er=this.er.remove(i));var u=s.removed;a=s.events;var l=-1!==u.findIndex(function(t){return t.getQueryParams().loadsAllData()}),h=this.er.findOnPath(i,function(n,e){return e.hasCompleteView()});if(l&&!h){var g=this.er.subtree(i);if(!g.isEmpty())for(var p=this.cr(g),d=0;dthis.Gr,"Stacking an older write on top of newer ones"),void 0===s&&(s=!0),this.Hr.push({path:o,snap:a,writeId:i,visible:s}),s&&(this.Br=this.Br.addWrite(o,a)),this.Gr=i},d.prototype.addMerge=function(o,r,a){m.assert(a>this.Gr,"Stacking an older merge on top of newer ones"),this.Hr.push({path:o,children:r,writeId:a,visible:!0}),this.Br=this.Br.addWrites(o,r),this.Gr=a},d.prototype.getWrite=function(o){for(var e=0,t;e=e&&this.Kr(d,t.path)?o=!1:t.path.contains(d.path)&&(a=!0)),s--;if(o){if(a)return this.Yr(),!0;if(t.snap)this.Br=this.Br.removeWrite(t.path);else{var l=t.children;n.forEach(l,function(n){i.Br=i.Br.removeWrite(t.path.child(n))})}return!0}return!1},d.prototype.getCompleteWriteData=function(t){return this.Br.getCompleteNode(t)},d.prototype.calcCompleteEventCache=function(o,e,t,n){if(t||n){var u=this.Br.childCompoundWrite(o);if(!n&&u.isEmpty())return e;if(n||null!=e||u.hasCompleteWrite(g.Path.Empty)){var a=function(a){return(a.visible||n)&&(!t||!~t.indexOf(a.writeId))&&(a.path.contains(o)||o.contains(a.path))},s=d.Xr(this.Hr,a,o),l=e||c.ChildrenNode.EMPTY_NODE;return s.apply(l)}return null}var h=this.Br.getCompleteNode(o);if(null!=h)return h;var m=this.Br.childCompoundWrite(o);if(m.isEmpty())return e;if(null!=e||m.hasCompleteWrite(g.Path.Empty)){var l=e||c.ChildrenNode.EMPTY_NODE;return m.apply(l)}return null},d.prototype.calcCompleteEventChildren=function(o,e){var s=c.ChildrenNode.EMPTY_NODE,t=this.Br.getCompleteNode(o);if(t)return t.isLeafNode()||t.forEachChild(a.PRIORITY_INDEX,function(n,e){s=s.updateImmediateChild(n,e)}),s;if(e){var n=this.Br.childCompoundWrite(o);return e.forEachChild(a.PRIORITY_INDEX,function(o,e){var t=n.childCompoundWrite(new g.Path(o)).apply(e);s=s.updateImmediateChild(o,t)}),n.getCompleteChildren().forEach(function(t){s=s.updateImmediateChild(t.name,t.node)}),s}return this.Br.childCompoundWrite(o).getCompleteChildren().forEach(function(t){s=s.updateImmediateChild(t.name,t.node)}),s},d.prototype.calcEventCacheAfterServerOverwrite=function(i,e,t,n){m.assert(t||n,"Either existingEventSnap or existingServerSnap must exist");var r=i.child(e);if(this.Br.hasCompleteWrite(r))return null;var o=this.Br.childCompoundWrite(r);return o.isEmpty()?n.getChild(e):o.apply(n.getChild(e))},d.prototype.calcCompleteChild=function(o,e,t){var n=o.child(e),r=this.Br.getCompleteNode(n);return null==r?t.isCompleteForChild(e)?this.Br.childCompoundWrite(n).apply(t.getNode().getImmediateChild(e)):null:r},d.prototype.shadowingWrite=function(t){return this.Br.getCompleteNode(t)},d.prototype.calcIndexedSlice=function(o,e,t,n,r,i){var a=this.Br.childCompoundWrite(o),u=a.getCompleteNode(g.Path.Empty),l;if(null!=u)l=u;else{if(null==e)return[];l=a.apply(e)}if(l=l.withIndex(i),l.isEmpty()||l.isLeafNode())return[];for(var s=[],h=i.getCompare(),c=r?l.getReverseIteratorFrom(t,i):l.getIteratorFrom(t,i),p=c.getNext();p&&s.lengthl.status){try{r=o.jsonEval(l.responseText)}catch(t){p.warn("Failed to parse JSON response for "+s+": "+l.responseText)}t(null,r)}else 401!==l.status&&404!==l.status&&p.warn("Got unsuccessful REST response for "+s+" Status: "+l.status),t(l.status);t=null}},l.open("GET",s,!0),l.send()})},d}(i.ServerActions);e.ReadonlyRestClient=s},function(m,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var g=t(0),n=t(1),r=t(10),o=t(3),a=t(38),s=t(42),i=t(24),l=t(108),u=t(56),c=t(0),p=function(){function d(){this.fi=!1,this._i=!1,this.yi=!1,this.vi=!1,this.gi=!1,this.mi=0,this.Ci="",this.Ei=null,this.Ni="",this.Pi=null,this.bi="",this.me=o.PRIORITY_INDEX}return d.prototype.hasStart=function(){return this._i},d.prototype.isViewFromLeft=function(){return""===this.Ci?this._i:this.Ci===d.Si.VIEW_FROM_LEFT},d.prototype.getIndexStartValue=function(){return g.assert(this._i,"Only valid if start has been set"),this.Ei},d.prototype.getIndexStartName=function(){return g.assert(this._i,"Only valid if start has been set"),this.yi?this.Ni:n.MIN_NAME},d.prototype.hasEnd=function(){return this.vi},d.prototype.getIndexEndValue=function(){return g.assert(this.vi,"Only valid if end has been set"),this.Pi},d.prototype.getIndexEndName=function(){return g.assert(this.vi,"Only valid if end has been set"),this.gi?this.bi:n.MAX_NAME},d.prototype.hasLimit=function(){return this.fi},d.prototype.hasAnchoredLimit=function(){return this.fi&&""!==this.Ci},d.prototype.getLimit=function(){return g.assert(this.fi,"Only valid if limit has been set"),this.mi},d.prototype.getIndex=function(){return this.me},d.prototype.Ti=function(){var e=new d;return e.fi=this.fi,e.mi=this.mi,e._i=this._i,e.Ei=this.Ei,e.yi=this.yi,e.Ni=this.Ni,e.vi=this.vi,e.Pi=this.Pi,e.gi=this.gi,e.bi=this.bi,e.me=this.me,e.Ci=this.Ci,e},d.prototype.limit=function(n){var e=this.Ti();return e.fi=!0,e.mi=n,e.Ci="",e},d.prototype.limitToFirst=function(e){var t=this.Ti();return t.fi=!0,t.mi=e,t.Ci=d.Si.VIEW_FROM_LEFT,t},d.prototype.limitToLast=function(e){var t=this.Ti();return t.fi=!0,t.mi=e,t.Ci=d.Si.VIEW_FROM_RIGHT,t},d.prototype.startAt=function(o,e){var t=this.Ti();return t._i=!0,void 0===o&&(o=null),t.Ei=o,null==e?(t.yi=!1,t.Ni=""):(t.yi=!0,t.Ni=e),t},d.prototype.endAt=function(o,e){var t=this.Ti();return t.vi=!0,void 0===o&&(o=null),t.Pi=o,void 0===e?(t.gi=!1,t.bi=""):(t.gi=!0,t.bi=e),t},d.prototype.orderBy=function(n){var e=this.Ti();return e.me=n,e},d.prototype.getQueryObject=function(){var e=d.Si,t={};if(this._i&&(t[e.INDEX_START_VALUE]=this.Ei,this.yi&&(t[e.INDEX_START_NAME]=this.Ni)),this.vi&&(t[e.INDEX_END_VALUE]=this.Pi,this.gi&&(t[e.INDEX_END_NAME]=this.bi)),this.fi){t[e.LIMIT]=this.mi;var n=this.Ci;""===n&&(n=this.isViewFromLeft()?e.VIEW_FROM_LEFT:e.VIEW_FROM_RIGHT),t[e.VIEW_FROM]=n}return this.me!==o.PRIORITY_INDEX&&(t[e.INDEX]=""+this.me),t},d.prototype.loadsAllData=function(){return!(this._i||this.vi||this.fi)},d.prototype.isDefault=function(){return this.loadsAllData()&&this.me==o.PRIORITY_INDEX},d.prototype.getNodeFilter=function(){return this.loadsAllData()?new i.IndexedFilter(this.getIndex()):this.hasLimit()?new l.LimitedFilter(this):new u.RangedFilter(this)},d.prototype.toRestQueryStringParameters=function(){var e=d.wi,t={};if(this.isDefault())return t;var n;return this.me===o.PRIORITY_INDEX?n=e.PRIORITY_INDEX:this.me===a.VALUE_INDEX?n=e.VALUE_INDEX:this.me===r.KEY_INDEX?n=e.KEY_INDEX:(g.assert(this.me instanceof s.PathIndex,"Unrecognized index type!"),n=""+this.me),t[e.ORDER_BY]=c.stringify(n),this._i&&(t[e.START_AT]=c.stringify(this.Ei),this.yi&&(t[e.START_AT]+=","+c.stringify(this.Ni))),this.vi&&(t[e.END_AT]=c.stringify(this.Pi),this.gi&&(t[e.END_AT]+=","+c.stringify(this.bi))),this.fi&&(this.isViewFromLeft()?t[e.LIMIT_TO_FIRST]=this.mi:t[e.LIMIT_TO_LAST]=this.mi),t},d.Si={INDEX_START_VALUE:"sp",INDEX_START_NAME:"sn",INDEX_END_VALUE:"ep",INDEX_END_NAME:"en",LIMIT:"l",VIEW_FROM:"vf",VIEW_FROM_LEFT:"l",VIEW_FROM_RIGHT:"r",INDEX:"i"},d.wi={ORDER_BY:"orderBy",PRIORITY_INDEX:"$priority",VALUE_INDEX:"$value",KEY_INDEX:"$key",START_AT:"startAt",END_AT:"endAt",LIMIT_TO_FIRST:"limitToFirst",LIMIT_TO_LAST:"limitToLast"},d.DEFAULT=new d,d}();e.QueryParams=p},function(d,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t(56),m=t(4),i=t(5),o=t(0),a=t(9),r=function(){function t(t){this.Ii=new n.RangedFilter(t),this.me=t.getIndex(),this.mi=t.getLimit(),this.Ri=!t.isViewFromLeft()}return t.prototype.updateChild=function(o,e,t,n,r,a){return this.Ii.matches(new i.NamedNode(e,t))||(t=m.ChildrenNode.EMPTY_NODE),o.getImmediateChild(e).equals(t)?o:o.numChildren()=this.me.compare(this.Ii.getStartPost(),a):0>=this.me.compare(a,this.Ii.getEndPost())))break;n=n.updateImmediateChild(a.name,a.node),o++}}else{n=e.withIndex(this.me),n=n.updatePriority(m.ChildrenNode.EMPTY_NODE);var r=void 0,u,l,h;if(this.Ri){r=n.getReverseIterator(this.me),u=this.Ii.getEndPost(),l=this.Ii.getStartPost();var c=this.me.getCompare();h=function(n,e){return c(e,n)}}else r=n.getIterator(this.me),u=this.Ii.getStartPost(),l=this.Ii.getEndPost(),h=this.me.getCompare();for(var o=0,p=!1,a;r.hasNext();){a=r.getNext(),!p&&0>=h(u,a)&&(p=!0);var s=p&&o=h(a,l);s?o++:n=n.updateImmediateChild(a.name,m.ChildrenNode.EMPTY_NODE)}}return this.Ii.getIndexedFilter().updateFullNode(i,n,t)},t.prototype.updatePriority=function(t){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.Ii.getIndexedFilter()},t.prototype.getIndex=function(){return this.me},t.prototype.Oi=function(s,e,t,n,r){var u;if(this.Ri){var l=this.me.getCompare();u=function(n,e){return l(e,n)}}else u=this.me.getCompare();var h=s;o.assert(h.numChildren()==this.mi,"");var c=new i.NamedNode(e,t),p=this.Ri?h.getFirstChild(this.me):h.getLastChild(this.me),d=this.Ii.matches(c);if(h.hasChild(e)){for(var f=h.getImmediateChild(e),b=n.getChildAfterChild(this.me,p,this.Ri);null!=b&&(b.name==e||h.hasChild(b.name));)b=n.getChildAfterChild(this.me,b,this.Ri);var y=null==b?1:u(b,c);if(d&&!t.isEmpty()&&0<=y)return null!=r&&r.trackChildChange(a.Change.childChangedChange(e,t,f)),h.updateImmediateChild(e,t);null!=r&&r.trackChildChange(a.Change.childRemovedChange(e,f));var v=h.updateImmediateChild(e,m.ChildrenNode.EMPTY_NODE);return null!=b&&this.Ii.matches(b)?(null!=r&&r.trackChildChange(a.Change.childAddedChange(b.name,b.node)),v.updateImmediateChild(b.name,b.node)):v}return t.isEmpty()?s:d&&0<=u(p,c)?(null!=r&&(r.trackChildChange(a.Change.childRemovedChange(p.name,p.node)),r.trackChildChange(a.Change.childAddedChange(e,t))),h.updateImmediateChild(e,t).updateImmediateChild(p.name,m.ChildrenNode.EMPTY_NODE)):s},t}();e.LimitedFilter=r},function(m,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var x=t(0),i=t(21),o=t(22),a=t(2),n=t(110),s=t(3),l=t(1),h=t(43),c=t(7),p=t(0),d=t(11),u=t(4),f=t(18),k;!function(t){t[t.RUN=0]="RUN",t[t.SENT=1]="SENT",t[t.COMPLETED=2]="COMPLETED",t[t.SENT_NEEDS_ABORT=3]="SENT_NEEDS_ABORT",t[t.NEEDS_ABORT=4]="NEEDS_ABORT"}(k=e.TransactionStatus||(e.TransactionStatus={})),f.Repo.Ai=25,f.Repo.prototype.ie=function(){this.Di=new n.Tree},f.Repo.prototype.startTransaction=function(r,a,f,v){this.de("transaction on "+r);var A=function(){},L=new i.Reference(this,r);L.on("value",A);var y={path:r,update:a,onComplete:f,status:null,order:l.LUIDGenerator(),applyLocally:v,retryCount:0,unwatcher:function(){L.off("value",A)},abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},g=this.Mi(r);y.currentInputSnapshot=g;var m=y.update(g.val());if(!(void 0===m)){c.validateFirebaseData("transaction failed: Data returned ",m,y.path),y.status=k.RUN;var R=this.Di.subTree(r),N=R.getValue()||[];N.push(y),R.setValue(N);var O;"object"==typeof m&&null!==m&&p.contains(m,".priority")?(O=p.safeGet(m,".priority"),x.assert(c.isValidPriority(O),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):O=(this.ue.calcCompleteEventCache(r)||u.ChildrenNode.EMPTY_NODE).getPriority().val(),O=O;var b=this.generateServerValues(),S=d.nodeFromJSON(m,O),T=h.resolveDeferredValueSnapshot(S,b);y.currentOutputSnapshotRaw=S,y.currentOutputSnapshotResolved=T,y.currentWriteId=this.pe();var w=this.ue.applyUserOverwrite(r,T,y.currentWriteId,y.applyLocally);this.K.raiseEventsForChangedPath(r,w),this.Li()}else if(y.unwatcher(),y.currentOutputSnapshotRaw=null,y.currentOutputSnapshotResolved=null,y.onComplete){var I=new o.DataSnapshot(y.currentInputSnapshot,new i.Reference(this,y.path),s.PRIORITY_INDEX);y.onComplete(null,!1,I)}},f.Repo.prototype.Mi=function(n,e){return this.ue.calcCompleteEventCache(n,e)||u.ChildrenNode.EMPTY_NODE},f.Repo.prototype.Li=function(o){var r=this;if(void 0===o&&(o=this.Di),o||this.Fi(o),null!==o.getValue()){var e=this.xi(o);x.assert(0=f.Repo.Ai)C=!0,E="maxretry",n=n.concat(this.ue.ackUserWrite(g.currentWriteId,!0));else{var N=this.Mi(g.path,y);g.currentInputSnapshot=N;var L=r[v].update(N.val());if(void 0!==L){c.validateFirebaseData("transaction failed: Data returned ",L,g.path);var P=d.nodeFromJSON(L),S="object"==typeof L&&null!=L&&p.contains(L,".priority");S||(P=P.updatePriority(N.getPriority()));var T=g.currentWriteId,w=this.generateServerValues(),I=h.resolveDeferredValueSnapshot(P,w);g.currentOutputSnapshotRaw=P,g.currentOutputSnapshotResolved=I,g.currentWriteId=this.pe(),y.splice(y.indexOf(T),1),n=n.concat(this.ue.applyUserOverwrite(g.path,I,g.currentWriteId,g.applyLocally)),n=n.concat(this.ue.ackUserWrite(T,!0))}else C=!0,E="nodata",n=n.concat(this.ue.ackUserWrite(g.currentWriteId,!0))}if(this.K.raiseEventsForChangedPath(e,n),n=[],C&&(r[v].status=k.COMPLETED,function(t){setTimeout(t,0)}(r[v].unwatcher),r[v].onComplete))if("nodata"===E){var R=new i.Reference(this,r[v].path),O=r[v].currentInputSnapshot,A=new o.DataSnapshot(O,R,s.PRIORITY_INDEX);t.push(r[v].onComplete.bind(null,null,!1,A))}else t.push(r[v].onComplete.bind(null,Error(E),!1,null))}this.Fi(this.Di);for(var v=0;v=n)t.push(n);else if(2047>=n)t.push(192|n>>6,128|63&n);else if(55296==(64512&n)){var r=e>18,128|63&n>>12,128|63&n>>6,128|63&n)}else t.push(239,191,189)}else 56320==(64512&n)?t.push(239,191,189):t.push(224|n>>12,128|63&n>>6,128|63&n);return new Uint8Array(t)}function w(n){var t;try{t=decodeURIComponent(n)}catch(e){throw g(ee.DATA_URL,"Malformed data URL.")}return E(t)}function T(d,t){switch(d){case ee.BASE64:var e=-1!==t.indexOf("-"),n=-1!==t.indexOf("_");if(e||n){var r=e?"-":"_";throw g(d,"Invalid character '"+r+"' found: is it base64url encoded?")}break;case ee.BASE64URL:var o=-1!==t.indexOf("+"),i=-1!==t.indexOf("/");if(o||i){var r=o?"+":"/";throw g(d,"Invalid character '"+r+"' found: is it base64 encoded?")}t=t.replace(/-/g,"+").replace(/_/g,"/");}var a;try{a=atob(t)}catch(t){throw g(d,"Invalid character found")}for(var s=new Uint8Array(a.length),l=0;l=t.length)&&n.substring(n.length-t.length)===t}function C(e){switch(e){case It.RUNNING:case It.PAUSING:case It.CANCELING:return ae.RUNNING;case It.PAUSED:return ae.PAUSED;case It.SUCCESS:return ae.SUCCESS;case It.CANCELED:return ae.CANCELED;case It.ERROR:default:return ae.ERROR;}}function S(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function k(o,t){for(var e in o)S(o,e)&&t(e,o[e])}function I(n){if(null==n)return{};var o={};return k(n,function(e,t){o[e]=t}),o}function L(e){return new Promise(e)}function O(e){return Promise.resolve(e)}function x(e){return Promise.reject(e)}function P(e){return null!=e}function _(e){return void 0!==e}function D(e){return"function"==typeof e}function M(e){return"object"==typeof e}function B(e){return M(e)&&null!==e}function U(e){return M(e)&&!Array.isArray(e)}function W(e){return"string"==typeof e||e instanceof String}function F(e){return"number"==typeof e||e instanceof Number}function H(e){return j()&&e instanceof Blob}function j(){return"undefined"!=typeof Blob}function q(n){var t;try{t=JSON.parse(n)}catch(e){return null}return U(t)?t:null}function V(n){if(0==n.length)return null;var t=n.lastIndexOf("/");return-1===t?"":n.slice(0,t)}function z(o,t){var e=t.split("/").filter(function(e){return 0e.length?e:(e=e,K(e))}function Z(){function a(n,o){return $(o)}function t(n,t){return P(t)?+t:t}function e(a,t){if(!(W(t)&&0t;t++)n+=(""+Math.random()).slice(2);return n}();i["Content-Type"]="multipart/related; boundary="+a;var s=it(t,n,r),u=De(s,e),c="--"+a+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+u+"\r\n--"+a+"\r\nContent-Type: "+s.contentType+"\r\n\r\n",l=fe.getBlob(c,n,"\r\n--"+a+"--");if(null===l)throw ke();var p={name:s.fullPath},d=Q(o),m=h.maxUploadRetryTime(),g=new de(d,"POST",Ze(h,e),m);return g.urlParams=p,g.headers=i,g.body=l.uploadData(),g.errorHandler=et(t),g}function dt(o,t){var e;try{e=o.getResponseHeader("X-Goog-Upload-Status")}catch(e){$e(!1)}return $e(Qe(t||["active"],e)),e}function lt(i,t,e,n,r){var o=t.bucketOnlyServerUrl(),a=it(t,n,r),s={name:a.fullPath},d=Q(o),c={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":n.size(),"X-Goog-Upload-Header-Content-Type":a.contentType,"Content-Type":"application/json; charset=utf-8"},l=De(a,e),u=i.maxUploadRetryTime(),p=new de(d,"POST",function(e){dt(e);var t;try{t=e.getResponseHeader("X-Goog-Upload-URL")}catch(e){$e(!1)}return $e(W(t)),t},u);return p.urlParams=s,p.headers=c,p.body=l,p.errorHandler=et(t),p}function pt(i,t,e,d){function n(e){var t=dt(e,["active","final"]),r;try{r=e.getResponseHeader("X-Goog-Upload-Size-Received")}catch(e){$e(!1)}var n=parseInt(r,10);return $e(!isNaN(n)),new _e(n,d.size(),"final"===t)}var o=i.maxUploadRetryTime(),r=new de(e,"POST",n,o);return r.headers={"X-Goog-Upload-Command":"query"},r.errorHandler=et(t),r}function ct(d,x,e,C,t,r,n,o){function a(e,t){var n=dt(e,["active","final"]),a=i.current+l,s=C.size(),d;return d="final"===n?Ze(x,r)(e,t):null,new _e(a,s,"final"===n,d)}var i=new _e(0,0);if(n?(i.current=n.current,i.total=n.total):(i.current=0,i.total=C.size()),C.size()!==i.total)throw f();var s=i.total-i.current,l=s;0s&&(s*=2);var d;1===l?(l=2,d=0):d=1e3*(s+Math.random()),o(d)}}function a(e){m||(m=!0,h||(null===u?e||(l=1):(e||(l=2),clearTimeout(u),o(0))))}var s=1,u=null,c=!1,l=0,h=!1,m=!1;return o(0),setTimeout(function(){c=!0,a(!0)},e),a}function mt(e){e(!1)}function gt(n,t){null!==t&&0][;base64],");var e=r[1]||null;null!=e&&(this.base64=R(e,";base64"),this.contentType=this.base64?e.substring(0,e.length-7):e),this.rest=o.substring(o.indexOf(",")+1)}return e}(),oe={STATE_CHANGED:"state_changed"},It={RUNNING:"running",PAUSING:"pausing",PAUSED:"paused",SUCCESS:"success",CANCELING:"canceling",CANCELED:"canceled",ERROR:"error"},ae={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"},Nt;!function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"}(Nt||(Nt={}));var At=function(){function e(){var n=this;this.o=!1,this.i=new XMLHttpRequest,this.a=Nt.NO_ERROR,this.s=L(function(t){n.i.addEventListener("abort",function(){n.a=Nt.ABORT,t(n)}),n.i.addEventListener("error",function(){n.a=Nt.NETWORK_ERROR,t(n)}),n.i.addEventListener("load",function(){t(n)})})}return e.prototype.send=function(a,t,e,n){var r=this;if(this.o)throw y("cannot .send() more than once");return this.o=!0,this.i.open(t,a,!0),P(n)&&k(n,function(n,t){r.i.setRequestHeader(n,""+t)}),P(e)?this.i.send(e):this.i.send(),this.s},e.prototype.getErrorCode=function(){if(!this.o)throw y("cannot .getErrorCode() before sending");return this.a},e.prototype.getStatus=function(){if(!this.o)throw y("cannot .getStatus() before sending");try{return this.i.status}catch(e){return-1}},e.prototype.getResponseText=function(){if(!this.o)throw y("cannot .getResponseText() before sending");return this.i.responseText},e.prototype.abort=function(){this.i.abort()},e.prototype.getResponseHeader=function(e){return this.i.getResponseHeader(e)},e.prototype.addUploadProgressListener=function(e){P(this.i.upload)&&this.i.upload.addEventListener("progress",e)},e.prototype.removeUploadProgressListener=function(e){P(this.i.upload)&&this.i.upload.removeEventListener("progress",e)},e}(),ue=function(){function e(){}return e.prototype.createXhrIo=function(){return new At},e}(),ce=function(){function r(n,o){this.bucket=n,this.u=o}return Object.defineProperty(r.prototype,"path",{get:function(){return this.u},enumerable:!0,configurable:!0}),r.prototype.fullServerUrl=function(){var e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)},r.prototype.bucketOnlyServerUrl=function(){return"/b/"+encodeURIComponent(this.bucket)+"/o"},r.makeFromBucketSpec=function(t){var e;try{e=r.makeFromUrl(t)}catch(e){return new r(t,"")}if(""===e.path)return e;throw l(t)},r.makeFromUrl=function(t){function e(e){"/"===e.path.charAt(e.path.length-1)&&(e.u=e.u.slice(0,-1))}function h(e){e.u=decodeURIComponent(e.path)}for(var m=null,o=/^gs:\/\/([A-Za-z0-9.\-]+)(\/(.*))?$/i,g={bucket:1,path:3},y=/^https?:\/\/firebasestorage\.googleapis\.com\/v[A-Za-z0-9_]+\/b\/([A-Za-z0-9.\-]+)\/o(\/([^?#]*).*)?$/i,b={bucket:1,path:3},v=[{regex:o,indices:g,postModify:e},{regex:y,indices:b,postModify:h}],c=0;c262144*this.g&&(this.g*=2)},e.prototype.q=function(){var o=this;this.z(function(t){var e=nt(o.U,o.T,o.O),n=o.U.makeRequest(e,t);o.m=n,n.getPromise().then(function(t){o.m=null,o.N=t,o.P(It.SUCCESS)},o.x)})},e.prototype.H=function(){var o=this;this.z(function(t){var e=st(o.U,o.T,o.O,o.A,o.N),n=o.U.makeRequest(e,t);o.m=n,n.getPromise().then(function(t){o.m=null,o.N=t,o.B(o.A.size()),o.P(It.SUCCESS)},o.I)})},e.prototype.B=function(n){var t=this.p;this.p=n,this.p!==t&&this.V()},e.prototype.P=function(n){if(this.k!==n)switch(n){case It.CANCELING:case It.PAUSING:this.k=n,null!==this.m&&this.m.cancel();break;case It.RUNNING:var t=this.k===It.PAUSED;this.k=n,t&&(this.V(),this.M());break;case It.PAUSED:this.k=n,this.V();break;case It.CANCELED:this.v=c(),this.k=n,this.V();break;case It.ERROR:case It.SUCCESS:this.k=n,this.V();}},e.prototype.L=function(){switch(this.k){case It.PAUSING:this.P(It.PAUSED);break;case It.CANCELING:this.P(It.CANCELED);break;case It.RUNNING:this.M();}},Object.defineProperty(e.prototype,"snapshot",{get:function(){var e=C(this.k);return new be(this.p,this.A.size(),e,this.N,this,this.w)},enumerable:!0,configurable:!0}),e.prototype.on=function(o,t,e,s){function n(e){try{return void i(e)}catch(e){}try{if(d(e),!(_(e.next)||_(e.error)||_(e.complete)))throw""}catch(e){throw a}}function r(o){function t(t,r){null!==o&&Fe("on",o,arguments);var n=new ve(t,r,s);return l.K(n),function(){l.Z(n)}}return t}void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===s&&(s=void 0);var a="Expected a function or an Object with one of `next`, `error`, `complete` properties.",i=ze(!0).validator,d=qe(null,!0).validator;Fe("on",[Ve(function(){if(o!==oe.STATE_CHANGED)throw"Expected one of the event types: ["+oe.STATE_CHANGED+"]."}),qe(n,!0),ze(!0),ze(!0)],arguments);var l=this,c=[qe(function(e){if(null===e)throw a;n(e)}),ze(!0),ze(!0)];return _(t)||_(e)||_(s)?r(null)(t,e,s):r(c)},e.prototype.then=function(n,t){return this.D.then(n,t)},e.prototype.catch=function(e){return this.then(null,e)},e.prototype.K=function(e){this._.push(e),this.J(e)},e.prototype.Z=function(e){Je(this._,e)},e.prototype.V=function(){var n=this;this.Q(),Ye(this._).forEach(function(t){n.J(t)})},e.prototype.Q=function(){if(null!==this.y){var e=!0;switch(C(this.k)){case ae.SUCCESS:ut(this.y.bind(null,this.snapshot))();break;case ae.CANCELED:case ae.ERROR:ut(this.R.bind(null,this.v))();break;default:e=!1;}e&&(this.y=null,this.R=null)}},e.prototype.J=function(e){switch(C(this.k)){case ae.RUNNING:case ae.PAUSED:null!==e.next&&ut(e.next.bind(e,this.snapshot))();break;case ae.SUCCESS:null!==e.complete&&ut(e.complete.bind(e))();break;case ae.CANCELED:case ae.ERROR:null!==e.error&&ut(e.error.bind(e,this.v))();break;default:null!==e.error&&ut(e.error.bind(e,this.v))();}},e.prototype.resume=function(){Fe("resume",[],arguments);var e=this.k===It.PAUSED||this.k===It.PAUSING;return e&&this.P(It.RUNNING),e},e.prototype.pause=function(){Fe("pause",[],arguments);var e=this.k===It.RUNNING;return e&&this.P(It.PAUSING),e},e.prototype.cancel=function(){Fe("cancel",[],arguments);var e=this.k===It.RUNNING||this.k===It.PAUSING;return e&&this.P(It.CANCELING),e},e}(),ge=function(){function o(n,o){this.authWrapper=n,this.location=o instanceof ce?o:ce.makeFromUrl(o)}return o.prototype.toString=function(){return Fe("toString",[],arguments),"gs://"+this.location.bucket+"/"+this.location.path},o.prototype.newRef=function(t,e){return new o(t,e)},o.prototype.mappings=function(){return Z()},o.prototype.child=function(o){Fe("child",[Ve()],arguments);var t=z(this.location.path,o),e=new ce(this.location.bucket,t);return this.newRef(this.authWrapper,e)},Object.defineProperty(o.prototype,"parent",{get:function(){var n=V(this.location.path);if(null===n)return null;var t=new ce(this.location.bucket,n);return this.newRef(this.authWrapper,t)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"root",{get:function(){var e=new ce(this.location.bucket,"");return this.newRef(this.authWrapper,e)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"bucket",{get:function(){return this.location.bucket},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"fullPath",{get:function(){return this.location.path},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"name",{get:function(){return K(this.location.path)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"storage",{get:function(){return this.authWrapper.service()},enumerable:!0,configurable:!0}),o.prototype.put=function(n,t){return void 0===t&&(t=null),Fe("put",[We(),He(!0)],arguments),this.Y("put"),new me(this,this.authWrapper,this.location,this.mappings(),new fe(n),t)},o.prototype.putString=function(a,t,e){void 0===t&&(t=ee.RAW),Fe("putString",[Ve(),Ve(b,!0),He(!0)],arguments),this.Y("putString");var n=v(t,a),r=I(e);return!P(r.contentType)&&P(n.contentType)&&(r.contentType=n.contentType),new me(this,this.authWrapper,this.location,this.mappings(),new fe(n.data,!0),r)},o.prototype.delete=function(){Fe("delete",[],arguments),this.Y("delete");var o=this;return this.authWrapper.getAuthToken().then(function(t){var e=rt(o.authWrapper,o.location);return o.authWrapper.makeRequest(e,t).getPromise()})},o.prototype.getMetadata=function(){Fe("getMetadata",[],arguments),this.Y("getMetadata");var o=this;return this.authWrapper.getAuthToken().then(function(t){var e=nt(o.authWrapper,o.location,o.mappings());return o.authWrapper.makeRequest(e,t).getPromise()})},o.prototype.updateMetadata=function(o){Fe("updateMetadata",[He()],arguments),this.Y("updateMetadata");var t=this;return this.authWrapper.getAuthToken().then(function(e){var n=ot(t.authWrapper,t.location,o,t.mappings());return t.authWrapper.makeRequest(n,e).getPromise()})},o.prototype.getDownloadURL=function(){return Fe("getDownloadURL",[],arguments),this.Y("getDownloadURL"),this.getMetadata().then(function(n){var t=n.downloadURLs[0];if(P(t))return t;throw d()})},o.prototype.Y=function(e){if(""===this.location.path)throw m(e)},o}(),Lt=function(){function e(e){this.D=x(e)}return e.prototype.getPromise=function(){return this.D},e.prototype.cancel=function(e){void 0===e&&(e=!1)},e}(),Re=function(){function e(){this.$={},this.tt=-9007199254740991}return e.prototype.addRequest=function(o){function t(){delete n.$[e]}var e=this.tt;this.tt++,this.$[e]=o;var n=this;o.getPromise().then(t,t)},e.prototype.clear=function(){k(this.$,function(n,t){t&&t.cancel(!0)}),this.$={}},e}(),Ee=function(){function e(t,s,n,r,o){if(this.et=null,this.nt=!1,this.rt=t,null!==this.rt){var i=this.rt.options;P(i)&&(this.et=e.ot(i))}this.it=s,this.at=n,this.st=o,this.ut=r,this.ct=12e4,this.lt=6e4,this.ht=new Re}return e.ot=function(n){var t=n.storageBucket||null;return null==t?null:ce.makeFromBucketSpec(t).bucket},e.prototype.getAuthToken=function(){return null!==this.rt&&P(this.rt.INTERNAL)&&P(this.rt.INTERNAL.getToken)?this.rt.INTERNAL.getToken().then(function(e){return null===e?null:e.accessToken},function(){return null}):O(null)},e.prototype.bucket=function(){if(this.nt)throw h();return this.et},e.prototype.service=function(){return this.ut},e.prototype.makeStorageReference=function(e){return this.it(this,e)},e.prototype.makeRequest=function(o,t){if(this.nt)return new Lt(h());var e=this.at(o,t,this.st);return this.ht.addRequest(e),e},e.prototype.deleteApp=function(){this.nt=!0,this.rt=null,this.ht.clear()},e.prototype.maxUploadRetryTime=function(){return this.lt},e.prototype.setMaxUploadRetryTime=function(e){this.lt=e},e.prototype.maxOperationRetryTime=function(){return this.ct},e.prototype.setMaxOperationRetryTime=function(e){this.ct=e},e}(),we=function(){function e(d,p,e,n,r,o,i,a,s,u,c){this.pt=null,this.ft=null,this.y=null,this.R=null,this.dt=!1,this._t=!1,this.vt=d,this.bt=p,this.mt=e,this.gt=n,this.yt=r.slice(),this.Rt=o.slice(),this.Et=i,this.wt=a,this.Ut=u,this.Tt=s,this.st=c;var l=this;this.D=L(function(n,t){l.y=n,l.R=t,l.M()})}return e.prototype.M=function(){function o(n,a){function l(n){var t=n.loaded,e=n.lengthComputable?n.total:-1;null!==d.Ut&&d.Ut(t,e)}if(a)return void n(!1,new Ue(!1,null,!0));var e=d.st.createXhrIo();d.pt=e,null!==d.Ut&&e.addUploadProgressListener(l),e.send(d.vt,d.bt,d.gt,d.mt).then(function(t){null!==d.Ut&&t.removeUploadProgressListener(l),d.pt=null,t=t;var e=t.getErrorCode()===Nt.NO_ERROR,r=t.getStatus();if(!e||d.At(r)){var i=t.getErrorCode()===Nt.ABORT;return void n(!1,new Ue(!1,null,i))}var a=Qe(d.yt,r);n(!0,new Ue(a,t))})}function t(n,t){var o=d.y,l=d.R,i=t.xhr;if(t.wasSuccessCode)try{var a=d.Et(i,i.getResponseText());_(a)?o(a):o()}catch(e){l(e)}else if(null!==i){var p=r();p.setServerResponseProp(i.getResponseText()),l(d.wt?d.wt(i,p):p)}else if(t.canceled){var p=d._t?h():c();l(p)}else{var p=s();l(p)}}var d=this;this.dt?t(!1,new Ue(!1,null,!0)):this.ft=ht(o,t,this.Tt)},e.prototype.getPromise=function(){return this.D},e.prototype.cancel=function(e){this.dt=!0,this._t=e||!1,null!==this.ft&&mt(this.ft),null!==this.pt&&this.pt.abort()},e.prototype.At=function(e){var t=Qe([408,429],e),n=Qe(this.Rt,e);return 500<=e&&600>e||t||n},e}(),Ue=function(){function e(o,r,e){this.wasSuccessCode=o,this.xhr=r,this.canceled=!!e}return e}(),Te=function(){function e(r,a,e){if(this.et=null,this.U=new Ee(r,function(n,t){return new ge(n,t)},yt,this,a),this.rt=r,null!=e)this.et=ce.makeFromBucketSpec(e);else{var n=this.U.bucket();null!=n&&(this.et=new ce(n,""))}this.Nt=new Rt(this)}return e.prototype.ref=function(e){if(Fe("ref",[Ve(function(e){if(/^[A-Za-z]+:\/\//.test(e))throw"Expected child path but got a URL, use refFromURL instead."},!0)],arguments),null==this.et)throw Error("No Storage Bucket defined in Firebase Options.");var t=new ge(this.U,this.et);return null==e?t:t.child(e)},e.prototype.refFromURL=function(e){return Fe("refFromURL",[Ve(function(e){if(!/^[A-Za-z]+:\/\//.test(e))throw"Expected full URL but got a child path, use ref instead.";try{ce.makeFromUrl(e)}catch(e){throw"Expected valid full URL but got an invalid one."}},!1)],arguments),new ge(this.U,e)},Object.defineProperty(e.prototype,"maxUploadRetryTime",{get:function(){return this.U.maxUploadRetryTime()},enumerable:!0,configurable:!0}),e.prototype.setMaxUploadRetryTime=function(e){Fe("setMaxUploadRetryTime",[je()],arguments),this.U.setMaxUploadRetryTime(e)},Object.defineProperty(e.prototype,"maxOperationRetryTime",{get:function(){return this.U.maxOperationRetryTime()},enumerable:!0,configurable:!0}),e.prototype.setMaxOperationRetryTime=function(e){Fe("setMaxOperationRetryTime",[je()],arguments),this.U.setMaxOperationRetryTime(e)},Object.defineProperty(e.prototype,"app",{get:function(){return this.rt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"INTERNAL",{get:function(){return this.Nt},enumerable:!0,configurable:!0}),e}(),Rt=function(){function e(e){this.ut=e}return e.prototype.delete=function(){return this.ut.U.deleteApp(),O(void 0)},e}();t.registerStorage=vt;var Ne="storage";vt(xt.default)}},[118])}catch(e){throw Error("Cannot instantiate firebase-storage.js - be sure to load firebase-app.js first.")}try{webpackJsonpFirebase([1],{113:function(o,t,e){e(114)},114:function(Mn,t,e){"use strict";function n(){return qt}function r(e){qt=e}function So(s,t){for(var e=[],n=2;nn)throw new Ht(Gt.INVALID_ARGUMENT,"Function "+o+"() requires between "+e+" and "+n+" arguments, but was called with "+O(t.length,"argument")+".")}function y(o,t,e,n){if(!(t instanceof Array)||t.lengthr.indexOf(t))throw new Ht(Gt.INVALID_ARGUMENT,"Unknown option '"+t+"' passed to function "+o+"(). Available options: "+r.join(", "))})}function A(a,t,e,n){var r=k(n);return new Ht(Gt.INVALID_ARGUMENT,"Function "+a+"() requires its "+R(e)+" argument to be a "+t+", but it was: "+r)}function R(e){return 1===e?"first":2===e?"second":3===e?"third":e+"th"}function O(n,t){return n+" "+t+(1===n?"":"s")}function P(n,t){return nt?1:0}function L(n,t){return null!==n&&void 0!==n?t&&n.equals(t):n===t}function x(o,t){if(o.length!==t.length)return!1;for(var e=0;et?1:n===t?0:isNaN(n)?isNaN(t)?0:-1:1}function U(n,t){return n===t?0!==n||1/n==1/t:n!==n&&t!==t}function V(e){return null===e||void 0===e}function j(e){return _e(e)&&e<=Me&&e>=Oe}function W(o,t,e){if(e.equals(ge.INSTANCE)){if(t!==Le.EQUAL)throw new Ht(Gt.INVALID_ARGUMENT,"Invalid query. You can only perform equals comparisons on null.");return new Be(o)}if(e.equals(Ie.NAN)){if(t!==Le.EQUAL)throw new Ht(Gt.INVALID_ARGUMENT,"Invalid query. You can only perform equals comparisons on NaN.");return new Ue(o)}return new xe(o,t,e)}function q(e){return e===Gt.OK?Wo("Treated status OK as error"):e===Gt.CANCELLED||e===Gt.UNKNOWN||e===Gt.DEADLINE_EXCEEDED||e===Gt.RESOURCE_EXHAUSTED||e===Gt.INTERNAL||e===Gt.UNAVAILABLE||e===Gt.UNAUTHENTICATED?!1:e===Gt.INVALID_ARGUMENT||e===Gt.NOT_FOUND||e===Gt.ALREADY_EXISTS||e===Gt.PERMISSION_DENIED||e===Gt.FAILED_PRECONDITION||e===Gt.ABORTED||e===Gt.OUT_OF_RANGE||e===Gt.UNIMPLEMENTED||e===Gt.DATA_LOSS||Wo("Unknown status code: "+e)}function H(n){var t=cn[n];if(void 0!==t)return z(t)}function z(e){if(void 0===e)return o("GRPC error has no .code"),Gt.UNKNOWN;return e===cn.OK?Gt.OK:e===cn.CANCELLED?Gt.CANCELLED:e===cn.UNKNOWN?Gt.UNKNOWN:e===cn.DEADLINE_EXCEEDED?Gt.DEADLINE_EXCEEDED:e===cn.RESOURCE_EXHAUSTED?Gt.RESOURCE_EXHAUSTED:e===cn.INTERNAL?Gt.INTERNAL:e===cn.UNAVAILABLE?Gt.UNAVAILABLE:e===cn.UNAUTHENTICATED?Gt.UNAUTHENTICATED:e===cn.INVALID_ARGUMENT?Gt.INVALID_ARGUMENT:e===cn.NOT_FOUND?Gt.NOT_FOUND:e===cn.ALREADY_EXISTS?Gt.ALREADY_EXISTS:e===cn.PERMISSION_DENIED?Gt.PERMISSION_DENIED:e===cn.FAILED_PRECONDITION?Gt.FAILED_PRECONDITION:e===cn.ABORTED?Gt.ABORTED:e===cn.OUT_OF_RANGE?Gt.OUT_OF_RANGE:e===cn.UNIMPLEMENTED?Gt.UNIMPLEMENTED:e===cn.DATA_LOSS?Gt.DATA_LOSS:Wo("Unknown status code: "+e)}function K(e){if(void 0===e)return cn.OK;return e===Gt.OK?cn.OK:e===Gt.CANCELLED?cn.CANCELLED:e===Gt.UNKNOWN?cn.UNKNOWN:e===Gt.DEADLINE_EXCEEDED?cn.DEADLINE_EXCEEDED:e===Gt.RESOURCE_EXHAUSTED?cn.RESOURCE_EXHAUSTED:e===Gt.INTERNAL?cn.INTERNAL:e===Gt.UNAVAILABLE?cn.UNAVAILABLE:e===Gt.UNAUTHENTICATED?cn.UNAUTHENTICATED:e===Gt.INVALID_ARGUMENT?cn.INVALID_ARGUMENT:e===Gt.NOT_FOUND?cn.NOT_FOUND:e===Gt.ALREADY_EXISTS?cn.ALREADY_EXISTS:e===Gt.PERMISSION_DENIED?cn.PERMISSION_DENIED:e===Gt.FAILED_PRECONDITION?cn.FAILED_PRECONDITION:e===Gt.ABORTED?cn.ABORTED:e===Gt.OUT_OF_RANGE?cn.OUT_OF_RANGE:e===Gt.UNIMPLEMENTED?cn.UNIMPLEMENTED:e===Gt.DATA_LOSS?cn.DATA_LOSS:Wo("Unknown status code: "+e)}function G(e){return 200===e?Gt.OK:400===e?Gt.INVALID_ARGUMENT:401===e?Gt.UNAUTHENTICATED:403===e?Gt.PERMISSION_DENIED:404===e?Gt.NOT_FOUND:409===e?Gt.ABORTED:416===e?Gt.OUT_OF_RANGE:429===e?Gt.RESOURCE_EXHAUSTED:499===e?Gt.CANCELLED:500===e?Gt.UNKNOWN:501===e?Gt.UNIMPLEMENTED:503===e?Gt.UNAVAILABLE:504===e?Gt.DEADLINE_EXCEEDED:200<=e&&300>e?Gt.OK:400<=e&&500>e?Gt.FAILED_PRECONDITION:500<=e&&600>e?Gt.INTERNAL:Gt.UNKNOWN}function X(){return ln}function Q(){return fn}function Y(){return dn}function J(){return pn}function $(n,t){0i||i>t-2)&&Wo("Invalid encoded resource path: \""+n+"\""),n.charAt(i+1)){case ir:var a=n.substring(o,i),s=void 0;0===r.length?s=a:(r+=a,s=r,r=""),e.push(s);break;case sr:r+=n.substring(o,i),r+="\0";break;case lr:r+=n.substring(o,i+1);break;default:Wo("Invalid encoded resource path: \""+n+"\"");}o=i+2}return new re(e)}function lt(n,t){Ho(0===t,"Unexpected upgrade from version "+t),n.createObjectStore(pr.store,{keyPath:pr.keyPath}),n.createObjectStore(ur.store,{keyPath:ur.keyPath}),n.createObjectStore(yr.store,{keyPath:yr.keyPath}).createIndex(yr.documentTargetsIndex,yr.documentTargetsKeyPath,{unique:!0}),n.createObjectStore(fr.store,{keyPath:fr.keyPath}).createIndex(fr.queryTargetsIndexName,fr.queryTargetsKeyPath,{unique:!0}),n.createObjectStore(hr.store),n.createObjectStore(gr.store),n.createObjectStore(dr.store),n.createObjectStore(br.store)}function ct(o){return new Gn(function(r,e){o.onsuccess=function(e){var t=e.target.result;r(t)},o.onerror=function(n){e(n.target.error)}})}function dt(e){return Ho("string"==typeof e,"Persisting non-string stream token not supported."),e}function pt(e){return mt(e,ur.store)}function ut(e){return mt(e,hr.store)}function ht(e){return mt(e,pr.store)}function mt(n,t){return n instanceof Cr?n.store(t):Wo("Invalid transaction object provided!")}function gt(e){return bt(e,fr.store)}function ft(e){return bt(e,br.store)}function yt(e){return bt(e,yr.store)}function bt(n,t){return n instanceof Cr?n.store(t):Wo("Invalid transaction object provided!")}function vt(e){return e instanceof Cr?e.store(gr.store):Wo("Invalid transaction object provided!")}function Et(e){return e.path.toArray()}function St(e){return void 0!==e.documents}function Ct(e){if(!e)return new ao;switch(e.type){case"gapi":return new co(e.client,e.sessionIndex||"0");case"provider":return e.client;default:throw new Ht(Gt.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type");}}function Tt(e){return kt(e,["next","error","complete"])}function kt(a,s){if("object"!=typeof a||null===a)return!1;for(var e=a,n=0,r=s,o;nt.query.docComparator(r,a.doc),"Got added events in wrong order"),r=a.doc,{type:"added",doc:o,oldIndex:-1,newIndex:e++}})}var d=t.oldDocs;return t.docChanges.map(function(e){var n=new Oo(s,e.doc.key,e.doc,t.fromCache),o=-1,l=-1;return e.type!==Ln.Added&&(o=d.indexOf(e.doc.key),Ho(0<=o,"Index for document not found"),d=d.delete(e.doc.key)),e.type!==Ln.Removed&&(d=d.add(e.doc),l=d.indexOf(e.doc.key)),{type:_t(e.type),doc:n,oldIndex:o,newIndex:l}})}function _t(e){return e===Ln.Added?"added":e===Ln.Modified||e===Ln.Metadata?"modified":e===Ln.Removed?"removed":Wo("Unknown change type: "+e)}function Dt(e){e.INTERNAL.registerService("firestore",function(e){return new ko(e)},h(na))}function Mt(e){Dt(e)}var Ft=Number.POSITIVE_INFINITY,Bt=String.fromCharCode,Ut=Math.min,Vt=Math.floor;Object.defineProperty(t,"__esModule",{value:!0});var zo=e(6),jt=zo.default.SDK_VERSION,Qt;!function(e){e[e.DEBUG=0]="DEBUG",e[e.ERROR=1]="ERROR",e[e.SILENT=2]="SILENT"}(Qt||(Qt={}));var qt=Qt.ERROR,Kt=function(){function n(){}return n.setPlatform=function(t){n.platform&&Wo("Platform already defined"),n.platform=t},n.getPlatform=function(){return n.platform||Wo("Platform not set"),n.platform},n}(),Wt=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),Gt={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},Ht=function(o){function t(t,a){var n=o.call(this,a)||this;return n.code=t,n.message=a,n.name="FirebaseError",n.toString=function(){return n.name+": [code="+n.code+"]: "+n.message},n}return Wt(t,o),t}(Error),zt=function(){function e(){}return e.newId=function(){for(var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="",e=0;20>e;e++)t+=o.charAt(Vt(Math.random()*o.length));return Ho(20===t.length,"Invalid auto ID: "+t),t},e}(),Xt=function(){function n(e){F(),this.e=e}return n.fromBase64String=function(t){m("Blob.fromBase64String",arguments,1),b("Blob.fromBase64String","string",1,t),F();try{return new n(Kt.getPlatform().atob(t))}catch(e){throw new Ht(Gt.INVALID_ARGUMENT,"Failed to construct Blob from Base64 string: "+e)}},n.fromUint8Array=function(t){if(m("Blob.fromUint8Array",arguments,1),M(),!(t instanceof Uint8Array))throw A("Blob.fromUint8Array","Uint8Array",1,t);return new n(Array.prototype.map.call(t,function(e){return Bt(e)}).join(""))},n.prototype.toBase64=function(){return m("Blob.toBase64",arguments,0),F(),Kt.getPlatform().btoa(this.e)},n.prototype.toUint8Array=function(){m("Blob.toUint8Array",arguments,0),M();for(var n=new Uint8Array(this.e.length),t=0;tn||90o||180o.length&&Wo("offset "+t+" out of range "+o.length),void 0===e?e=o.length-t:e>o.length-t&&Wo("length "+e+" out of range "+(o.length-t)),this.segments=o,this.offset=t,this.len=e},o.prototype.construct=function(o,t,e){var n=Object.create(Object.getPrototypeOf(this));return n.init(o,t,e),n},Object.defineProperty(o.prototype,"length",{get:function(){return this.len},enumerable:!0,configurable:!0}),o.prototype.equals=function(t){return 0===o.comparator(this,t)},o.prototype.child=function(t){var r=this.segments.slice(this.offset,this.limit());return t instanceof o?t.forEach(function(e){r.push(e)}):"string"==typeof t?r.push(t):Wo("Unknown parameter type for Path.child(): "+t),this.construct(r)},o.prototype.limit=function(){return this.offset+this.length},o.prototype.popFirst=function(e){return e=void 0===e?1:e,Ho(this.length>=e,"Can't call popFirst() with less segments"),this.construct(this.segments,this.offset+e,this.length-e)},o.prototype.popLast=function(){return Ho(!this.isEmpty(),"Can't call popLast() on empty path"),this.construct(this.segments,this.offset,this.length-1)},o.prototype.firstSegment=function(){return Ho(!this.isEmpty(),"Can't call firstSegment() on empty path"),this.segments[this.offset]},o.prototype.lastSegment=function(){return Ho(!this.isEmpty(),"Can't call lastSegment() on empty path"),this.segments[this.limit()-1]},o.prototype.get=function(e){return Ho(eo)return 1}return a.lengtht.length?1:0},o}(),re=function(n){function o(){return null!==n&&n.apply(this,arguments)||this}return ee(o,n),o.prototype.canonicalString=function(){return this.toArray().join("/")},o.prototype.toString=function(){return this.canonicalString()},o.fromString=function(e){if(0<=e.indexOf("//"))throw new Ht(Gt.INVALID_ARGUMENT,"Invalid path ("+e+"). Paths must not contain // in them.");return new o(e.split("/").filter(function(e){return 0e?t=t.left:0n?t=t.left:0n?e=e.left:(t+=e.left.size+1,e=e.right)}return-1},o.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(o.prototype,"size",{get:function(){return this.root.size},enumerable:!0,configurable:!0}),o.prototype.minKey=function(){return this.root.minKey()},o.prototype.maxKey=function(){return this.root.maxKey()},o.prototype.inorderTraversal=function(e){return this.root.inorderTraversal(e)},o.prototype.forEach=function(o){this.inorderTraversal(function(t,e){return o(t,e),!1})},o.prototype.reverseTraversal=function(e){return this.root.reverseTraversal(e)},o.prototype.getIterator=function(e){return new he(this.root,null,this.comparator,!1,e)},o.prototype.getIteratorFrom=function(n,t){return new he(this.root,n,this.comparator,!1,t)},o.prototype.getReverseIterator=function(e){return new he(this.root,null,this.comparator,!0,e)},o.prototype.getReverseIteratorFrom=function(n,t){return new he(this.root,n,this.comparator,!0,t)},o}(),he=function(){function e(a,s,e,n,r){this.resultGenerator=r||null,this.isReverse=n,this.nodeStack=[];for(var o=1;!a.isEmpty();)if(o=s?e(a.key,s):1,n&&(o*=-1),0>o)a=this.isReverse?a.left:a.right;else{if(0===o){this.nodeStack.push(a);break}this.nodeStack.push(a),a=this.isReverse?a.right:a.left}}return e.prototype.getNext=function(){Ho(0r?n.copy(null,null,null,n.left.insert(a,t,e),null):0===r?n.copy(null,t,null,null,null):n.copy(null,null,null,null,n.right.insert(a,t,e)),n.fixUp()},a.prototype.removeMin=function(){if(this.left.isEmpty())return a.EMPTY;var t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()},a.prototype.remove=function(t,e){var n=this,o;if(0>e(t,n.key))n.left.isEmpty()||n.left.isRed()||n.left.left.isRed()||(n=n.moveRedLeft()),n=n.copy(null,null,null,n.left.remove(t,e),null);else{if(n.left.isRed()&&(n=n.rotateRight()),n.right.isEmpty()||n.right.isRed()||n.right.left.isRed()||(n=n.moveRedRight()),0===e(t,n.key)){if(n.right.isEmpty())return a.EMPTY;o=n.right.min(),n=n.copy(o.key,o.value,null,null,n.right.removeMin())}n=n.copy(null,null,null,null,n.right.remove(t,e))}return n.fixUp()},a.prototype.isRed=function(){return this.color},a.prototype.fixUp=function(){var e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e},a.prototype.moveRedLeft=function(){var e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e},a.prototype.moveRedRight=function(){var e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e},a.prototype.rotateLeft=function(){var t=this.copy(null,null,a.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},a.prototype.rotateRight=function(){var t=this.copy(null,null,a.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},a.prototype.colorFlip=function(){var n=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,n,t)},a.prototype.checkMaxDepth=function(){var e=this.check();return Math.pow(2,e)<=this.size+1},a.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw Wo("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed())throw Wo("Right child of ("+this.key+","+this.value+") is red");var e=this.left.check();if(e!==this.right.check())throw Wo("Black depths differ");return e+(this.isRed()?0:1)},a.EMPTY=null,a.RED=!0,a.BLACK=!1,a}(),fe=function(){function e(){this.size=0}return e.prototype.copy=function(){return this},e.prototype.insert=function(n,t){return new le(n,t)},e.prototype.remove=function(){return this},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(){return!1},e.prototype.reverseTraversal=function(){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.isRed=function(){return!1},e.prototype.checkMaxDepth=function(){return!0},e.prototype.check=function(){return 0},e}();le.EMPTY=new fe;var de=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),ye;!function(e){e[e.NullValue=0]="NullValue",e[e.BooleanValue=1]="BooleanValue",e[e.NumberValue=2]="NumberValue",e[e.TimestampValue=3]="TimestampValue",e[e.StringValue=4]="StringValue",e[e.BlobValue=5]="BlobValue",e[e.RefValue=6]="RefValue",e[e.GeoPointValue=7]="GeoPointValue",e[e.ArrayValue=8]="ArrayValue",e[e.ObjectValue=9]="ObjectValue"}(ye||(ye={}));var pe=function(){function e(){}return e.prototype.toString=function(){var e=this.value();return null===e?"null":""+e},e.prototype.defaultCompareTo=function(e){return Ho(this.typeOrder!==e.typeOrder,"Default compareTo should not be used for values of same type."),P(this.typeOrder,e.typeOrder)},e}(),ge=function(n){function o(){var t=n.call(this)||this;return t.typeOrder=ye.NullValue,t.internalValue=null,t}return de(o,n),o.prototype.value=function(){return null},o.prototype.equals=function(e){return e instanceof o},o.prototype.compareTo=function(e){return e instanceof o?0:this.defaultCompareTo(e)},o.INSTANCE=new o,o}(pe),ve=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.BooleanValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.equals=function(e){return e instanceof n&&this.internalValue===e.internalValue},n.prototype.compareTo=function(e){return e instanceof n?P(this,e):this.defaultCompareTo(e)},n.of=function(e){return e?n.TRUE:n.FALSE},n.TRUE=new n(!0),n.FALSE=new n(!1),n}(pe),be=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.NumberValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.compareTo=function(e){return e instanceof n?B(this.internalValue,e.internalValue):this.defaultCompareTo(e)},n}(pe),we=function(n){function o(t){return n.call(this,t)||this}return de(o,n),o.prototype.equals=function(e){return e instanceof o&&U(this.internalValue,e.internalValue)},o}(be),Ie=function(o){function n(t){var r=o.call(this,t)||this;return r.internalValue=t,r}return de(n,o),n.prototype.equals=function(e){return e instanceof n&&U(this.internalValue,e.internalValue)},n.NAN=new n(NaN),n.POSITIVE_INFINITY=new n(1/0),n.NEGATIVE_INFINITY=new n(-1/0),n}(be),Te=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.StringValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.equals=function(e){return e instanceof n&&this.internalValue===e.internalValue},n.prototype.compareTo=function(e){return e instanceof n?P(this.internalValue,e.internalValue):this.defaultCompareTo(e)},n}(pe),Ee=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.TimestampValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue.toDate()},n.prototype.equals=function(e){return e instanceof n&&this.internalValue.equals(e.internalValue)},n.prototype.compareTo=function(e){return e instanceof n?this.internalValue.compareTo(e.internalValue):e instanceof Se?-1:this.defaultCompareTo(e)},n}(pe),Se=function(o){function n(t){var r=o.call(this)||this;return r.localWriteTime=t,r.typeOrder=ye.TimestampValue,r}return de(n,o),n.prototype.value=function(){return null},n.prototype.equals=function(e){return e instanceof n&&this.localWriteTime.equals(e.localWriteTime)},n.prototype.compareTo=function(e){return e instanceof n?this.localWriteTime.compareTo(e.localWriteTime):e instanceof Ee?1:this.defaultCompareTo(e)},n.prototype.toString=function(){return""},n}(pe),Ce=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.BlobValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.equals=function(e){return e instanceof n&&this.internalValue.n(e.internalValue)},n.prototype.compareTo=function(e){return e instanceof n?this.internalValue.r(e.internalValue):this.defaultCompareTo(e)},n}(pe),De=function(o){function r(t,a){var n=o.call(this)||this;return n.databaseId=t,n.key=a,n.typeOrder=ye.RefValue,n}return de(r,o),r.prototype.value=function(){return this.key},r.prototype.equals=function(e){return e instanceof r&&this.key.equals(e.key)&&this.databaseId.equals(e.databaseId)},r.prototype.compareTo=function(e){if(e instanceof r){var t=this.databaseId.compareTo(e.databaseId);return 0===t?ae.comparator(this.key,e.key):t}return this.defaultCompareTo(e)},r}(pe),ke=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.GeoPointValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.equals=function(e){return e instanceof n&&this.internalValue.n(e.internalValue)},n.prototype.compareTo=function(e){return e instanceof n?this.internalValue.r(e.internalValue):this.defaultCompareTo(e)},n}(pe),Ne=function(o){function s(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.ObjectValue,r}return de(s,o),s.prototype.value=function(){var o={};return this.internalValue.inorderTraversal(function(t,e){o[t]=e.value()}),o},s.prototype.forEach=function(e){this.internalValue.inorderTraversal(e)},s.prototype.equals=function(e){if(e instanceof s){for(var t=this.internalValue.getIterator(),n=e.internalValue.getIterator();t.hasNext()&&n.hasNext();){var r=t.getNext(),o=n.getNext();if(r.key!==o.key||!r.value.equals(o.value))return!1}return!t.hasNext()&&!n.hasNext()}return!1},s.prototype.compareTo=function(e){if(e instanceof s){for(var t=this.internalValue.getIterator(),n=e.internalValue.getIterator();t.hasNext()&&n.hasNext();){var r=t.getNext(),o=n.getNext(),i=P(r.key,o.key)||r.value.compareTo(o.value);if(i)return i}return P(t.hasNext(),n.hasNext())}return this.defaultCompareTo(e)},s.prototype.set=function(e,t){if(Ho(!e.isEmpty(),"Cannot set field for empty path on ObjectValue"),1===e.length)return this.setChild(e.firstSegment(),t);var n=this.child(e.firstSegment());n instanceof s||(n=s.EMPTY);var r=n.set(e.popFirst(),t);return this.setChild(e.firstSegment(),r)},s.prototype.delete=function(e){if(Ho(!e.isEmpty(),"Cannot delete field for empty path on ObjectValue"),1===e.length)return new s(this.internalValue.remove(e.firstSegment()));var t=this.child(e.firstSegment());if(t instanceof s){var n=t.delete(e.popFirst());return new s(this.internalValue.insert(e.firstSegment(),n))}return this},s.prototype.contains=function(e){return void 0!==this.field(e)},s.prototype.field=function(e){Ho(!e.isEmpty(),"Can't get field of empty path");var o=this;return e.forEach(function(e){o=o instanceof s?o.internalValue.get(e)||void 0:void 0}),o},s.prototype.toString=function(){return JSON.stringify(this.value())},s.prototype.child=function(e){return this.internalValue.get(e)||void 0},s.prototype.setChild=function(e,t){return new s(this.internalValue.insert(e,t))},s.EMPTY=new s(new ce(P)),s}(pe),Ae=function(o){function a(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.ArrayValue,r}return de(a,o),a.prototype.value=function(){return this.internalValue.map(function(e){return e.value()})},a.prototype.forEach=function(e){this.internalValue.forEach(e)},a.prototype.equals=function(e){if(e instanceof a){if(this.internalValue.length!==e.internalValue.length)return!1;for(var t=0;t="===t?n.GREATER_THAN_OR_EQUAL:">"===t?n.GREATER_THAN:Wo("Unknown relation: "+t)},n.prototype.toString=function(){return this.name},n.prototype.equals=function(e){return this.name===e.name},n.LESS_THAN=new n("<"),n.LESS_THAN_OR_EQUAL=new n("<="),n.EQUAL=new n("=="),n.GREATER_THAN=new n(">"),n.GREATER_THAN_OR_EQUAL=new n(">="),n}(),xe=function(){function n(o,r,e){this.field=o,this.op=r,this.value=e}return n.prototype.matches=function(o){if(this.field.isKeyField()){Ho(this.value instanceof De,"Comparing on key, but filter value not a RefValue");var t=this.value,e=ae.comparator(o.key,t.key);return this.matchesComparison(e)}var n=o.field(this.field);return void 0!==n&&this.matchesValue(n)},n.prototype.matchesValue=function(e){return this.value.typeOrder===e.typeOrder&&this.matchesComparison(e.compareTo(this.value))},n.prototype.matchesComparison=function(e){switch(this.op){case Le.LESS_THAN:return 0>e;case Le.LESS_THAN_OR_EQUAL:return 0>=e;case Le.EQUAL:return 0===e;case Le.GREATER_THAN:return 0=e:0>e},e.prototype.equals=function(o){if(null===o)return!1;if(this.before!==o.before||this.position.length!==o.position.length)return!1;for(var t=0;to,"timestamp nanoseconds out of range"+o),Ho(-62135596800<=n,"timestamp seconds out of range: "+n),Ho(253402300800>n,"timestamp seconds out of range"+n)}return a.now=function(){return a.fromEpochMilliseconds(Date.now())},a.fromDate=function(t){return a.fromEpochMilliseconds(t.getTime())},a.fromEpochMilliseconds=function(t){var e=Vt(t/1e3);return new a(e,1e6*(t-1e3*e))},a.fromISOString=function(t){var e=0,n=Ke.exec(t);if(Ho(!!n,"invalid timestamp: "+t),n[1]){var s=n[1];s=(s+"000000000").substr(0,9),e=parseInt(s,10)}var o=new Date(t);return new a(Vt(o.getTime()/1e3),e)},a.prototype.toDate=function(){return new Date(this.toEpochMilliseconds())},a.prototype.toEpochMilliseconds=function(){return 1e3*this.seconds+this.nanos/1e6},a.prototype.compareTo=function(e){return this.seconds===e.seconds?P(this.nanos,e.nanos):P(this.seconds,e.seconds)},a.prototype.equals=function(e){return e.seconds===this.seconds&&e.nanos===this.nanos},a.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanos="+this.nanos+")"},a}(),Ge=function(){function o(e){this.timestamp=e}return o.fromMicroseconds=function(t){var e=Vt(t/1e6);return new o(new We(e,1e3*(t%1e6)))},o.fromTimestamp=function(t){return new o(t)},o.forDeletedDoc=function(){return o.MIN},o.prototype.compareTo=function(e){return this.timestamp.compareTo(e.timestamp)},o.prototype.equals=function(e){return this.timestamp.equals(e.timestamp)},o.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanos/1e3},o.prototype.toString=function(){return"SnapshotVersion("+this.timestamp+")"},o.prototype.toTimestamp=function(){return this.timestamp},o.MIN=new o(new We(0,0)),o}(),He;!function(e){e[e.Listen=0]="Listen",e[e.ExistenceFilterMismatch=1]="ExistenceFilterMismatch",e[e.LimboResolution=2]="LimboResolution"}(He||(He={}));var me=function(){function n(a,s,e,n,r){void 0===n&&(n=Ge.MIN),void 0===r&&(r=i()),this.query=a,this.targetId=s,this.purpose=e,this.snapshotVersion=n,this.resumeToken=r}return n.prototype.update=function(t){return new n(this.query,this.targetId,this.purpose,t.snapshotVersion,t.resumeToken)},n.prototype.equals=function(e){return this.targetId===e.targetId&&this.purpose===e.purpose&&this.snapshotVersion.equals(e.snapshotVersion)&&this.resumeToken===e.resumeToken&&this.query.equals(e.query)},n}(),Xe=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ye=function(){function e(e){this.fields=e}return e.prototype.equals=function(e){return x(this.fields,e.fields)},e}(),Je=function(){function n(){}return n.prototype.equals=function(t){return t instanceof n},n.instance=new n,n}(),$e=function(){function e(n,o){this.field=n,this.transform=o}return e.prototype.equals=function(e){return this.field.equals(e.field)&&this.transform.equals(e.transform)},e}(),Ze=function(){function e(n,o){this.version=n,this.transformResults=o}return e}(),tn;!function(e){e[e.Set=0]="Set",e[e.Patch=1]="Patch",e[e.Transform=2]="Transform",e[e.Delete=3]="Delete"}(tn||(tn={}));var ze=function(){function n(n,o){this.updateTime=n,this.exists=o,Ho(void 0===n||void 0===o,"Precondition can specify \"exists\" or \"updateTime\" but not both")}return n.exists=function(t){return new n(void 0,t)},n.updateTime=function(t){return new n(t)},Object.defineProperty(n.prototype,"isNone",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!0,configurable:!0}),n.prototype.isValidFor=function(e){return void 0===this.updateTime?void 0===this.exists?(Ho(this.isNone,"Precondition should be empty"),!0):this.exists?e instanceof se:null===e||e instanceof ue:e instanceof se&&e.version.equals(this.updateTime)},n.prototype.equals=function(e){return L(this.updateTime,e.updateTime)&&this.exists===e.exists},n.NONE=new n,n}(),nn=function(){function e(){}return e.prototype.verifyKeyMatches=function(e){null!=e&&Ho(e.key.equals(this.key),"Can only apply a mutation to a document with the same key")},e.getPostMutationVersion=function(e){return e instanceof se?e.version:Ge.MIN},e}(),rn=function(a){function n(t,i,n){var r=a.call(this)||this;return r.key=t,r.value=i,r.precondition=n,r.type=tn.Set,r}return Xe(n,a),n.prototype.applyToRemoteDocument=function(o,t){this.verifyKeyMatches(o),Ho(null==t.transformResults,"Transform results received by SetMutation.");var e=nn.getPostMutationVersion(o);return new se(this.key,e,this.value,{hasLocalMutations:!1})},n.prototype.applyToLocalView=function(e){if(this.verifyKeyMatches(e),!this.precondition.isValidFor(e))return e;var t=nn.getPostMutationVersion(e);return new se(this.key,t,this.value,{hasLocalMutations:!0})},n.prototype.equals=function(e){return e instanceof n&&this.key.equals(e.key)&&this.value.equals(e.value)&&this.precondition.equals(e.precondition)},n}(nn),on=function(a){function n(t,s,n,r){var o=a.call(this)||this;return o.key=t,o.data=s,o.fieldMask=n,o.precondition=r,o.type=tn.Patch,o}return Xe(n,a),n.prototype.applyToRemoteDocument=function(o,t){if(this.verifyKeyMatches(o),Ho(null==t.transformResults,"Transform results received by PatchMutation."),!this.precondition.isValidFor(o))return o;var e=nn.getPostMutationVersion(o),n=this.patchDocument(o);return new se(this.key,e,n,{hasLocalMutations:!1})},n.prototype.applyToLocalView=function(e){if(this.verifyKeyMatches(e),!this.precondition.isValidFor(e))return e;var t=nn.getPostMutationVersion(e),n=this.patchDocument(e);return new se(this.key,t,n,{hasLocalMutations:!0})},n.prototype.equals=function(e){return e instanceof n&&this.key.equals(e.key)&&this.fieldMask.equals(e.fieldMask)&&this.precondition.equals(e.precondition)},n.prototype.patchDocument=function(n){var t;return t=n instanceof se?n.data:Ne.EMPTY,this.patchObject(t)},n.prototype.patchObject=function(a){for(var t=0,e=this.fieldMask.fields;t>Jn<=o?e|this.generatorId:(e|this.generatorId)-(1<",o),e=this.store.put(o)):(So("SimpleDb","PUT",this.store.name,o,t),e=this.store.put(t,o)),ct(e)},e.prototype.get=function(o){var t=this;return ct(this.store.get(o)).next(function(e){return void 0===e&&(e=null),So("SimpleDb","GET",t.store.name,o,e),e})},e.prototype.delete=function(e){return So("SimpleDb","DELETE",this.store.name,e),ct(this.store.delete(e))},e.prototype.loadAll=function(o,t){var e=this.cursor(this.options(o,t)),n=[];return this.iterateCursor(e,function(o,t){n.push(t)}).next(function(){return n})},e.prototype.deleteAll=function(o,t){So("SimpleDb","DELETE ALL",this.store.name);var e=this.options(o,t);e.keysOnly=!1;var n=this.cursor(e);return this.iterateCursor(n,function(o,t,e){return e.delete()})},e.prototype.iterate=function(o,t){var e;t?e=o:(e={},t=o);var n=this.cursor(e);return this.iterateCursor(n,t)},e.prototype.iterateCursor=function(a,s){var e=[];return new Gn(function(n,r){a.onerror=function(e){r(e.target.error)},a.onsuccess=function(r){var t=r.target.result;if(!t)return void n();var d=new Sr(t),i=s(t.primaryKey,t.value,d);i instanceof Gn&&e.push(i),d.isDone?n():null===d.skipToKey?t.continue():t.continue(d.skipToKey)}}).next(function(){return Gn.waitFor(e)})},e.prototype.options=function(o,r){var a;return void 0!==o&&("string"==typeof o?a=o:(Ho(void 0===r,"3rd argument must not be defined if 2nd is a range."),r=o)),{index:a,range:r}},e.prototype.cursor=function(o){var t="next";if(o.reverse&&(t="prev"),o.index){var e=this.store.index(o.index);return o.keysOnly?e.openKeyCursor(o.range,t):e.openCursor(o.range,t)}return this.store.openCursor(o.range,t)},e}(),kr=function(){function o(n,o){this.userId=n,this.serializer=o,this.garbageCollector=null}return o.forUser=function(t,e){return Ho(""!==t.uid,"UserID must not be an empty string."),new o(t.isUnauthenticated()?"":t.uid,e)},o.prototype.start=function(r){var e=this;return o.loadNextBatchIdFromDb(r).next(function(n){return e.nextBatchId=n,ht(r).get(e.userId)}).next(function(n){return n||(n=new pr(e.userId,nr,"")),e.metadata=n,e.metadata.lastAcknowledgedBatchId>=e.nextBatchId?e.checkEmpty(r).next(function(n){return Ho(n,"Reset nextBatchID is only possible when the queue is empty"),e.metadata.lastAcknowledgedBatchId=nr,ht(r).put(e.metadata)}):Gn.resolve()})},o.loadNextBatchIdFromDb=function(n){var a=nr;return pt(n).iterate({reverse:!0},function(e,t,n){var r=e[0];if(e[1]>a&&(a=t.batchId),""===r)n.done();else{var o=_(r);n.skip([o])}}).next(function(){return a+1})},o.prototype.checkEmpty=function(o){var a=!0,e=IDBKeyRange.bound(this.keyForBatchId(Number.NEGATIVE_INFINITY),this.keyForBatchId(Number.POSITIVE_INFINITY));return pt(o).iterate({range:e},function(e,t,n){a=!1,n.done()}).next(function(){return a})},o.prototype.getNextBatchId=function(){return Gn.resolve(this.nextBatchId)},o.prototype.getHighestAcknowledgedBatchId=function(){return Gn.resolve(this.metadata.lastAcknowledgedBatchId)},o.prototype.acknowledgeBatch=function(o,t,e){var n=t.batchId;return Ho(n>this.metadata.lastAcknowledgedBatchId,"Mutation batchIDs must be acknowledged in order"),this.metadata.lastAcknowledgedBatchId=n,this.metadata.lastStreamToken=dt(e),ht(o).put(this.metadata)},o.prototype.getLastStreamToken=function(){return Gn.resolve(this.metadata.lastStreamToken)},o.prototype.setLastStreamToken=function(n,t){return this.metadata.lastStreamToken=dt(t),ht(n).put(this.metadata)},o.prototype.addMutationBatch=function(d,t,e){var n=this,r=this.nextBatchId;this.nextBatchId++;var o=new or(r,t,e),i=this.serializer.toDbMutationBatch(this.userId,o);return pt(d).put(i).next(function(){for(var t=[],o=0,i=e;os,"Should have found mutation after "+s),n=e.serializer.fromDbMutationBatch(t)),r.done()}).next(function(){return n})},o.prototype.getAllMutationBatches=function(o){var r=this,e=IDBKeyRange.bound(this.keyForBatchId(nr),this.keyForBatchId(Number.POSITIVE_INFINITY));return pt(o).loadAll(e).next(function(e){return e.map(function(e){return r.serializer.fromDbMutationBatch(e)})})},o.prototype.getAllMutationBatchesThroughBatchId=function(o,t){var e=this,n=IDBKeyRange.bound(this.keyForBatchId(nr),this.keyForBatchId(t));return pt(o).loadAll(n).next(function(n){return n.map(function(n){return e.serializer.fromDbMutationBatch(n)})})},o.prototype.getAllMutationBatchesAffectingDocumentKey=function(d,t){var e=this,n=hr.prefixForPath(this.userId,t.path),r=IDBKeyRange.lowerBound(n),a=[];return ut(d).iterate({range:r},function(n,r,o){var i=n[0],s=n[1],p=n[2],c=st(s);if(i!==e.userId||!t.path.equals(c))return void o.done();var l=e.keyForBatchId(p);return pt(d).get(l).next(function(o){null===o&&Wo("Dangling document-mutation reference found: "+n+" which points to "+l),a.push(e.serializer.fromDbMutationBatch(o))})}).next(function(){return a})},o.prototype.getAllMutationBatchesAffectingQuery=function(d,t){var l=this;Ho(!t.isDocumentQuery(),"Document queries shouldn't go down this path");var n=t.path,r=n.length+1,e=hr.prefixForPath(this.userId,n),o=(e[1],IDBKeyRange.lowerBound(e)),p=new en(P);return ut(d).iterate({range:o},function(o,t,e){var i=o[0],a=o[1],s=o[2],d=st(a);return i===l.userId&&n.isPrefixOf(d)?void(d.length===r&&(p=p.add(s))):void e.done()}).next(function(){var n=[],e=[];return p.forEach(function(t){var o=l.keyForBatchId(t);e.push(pt(d).get(o).next(function(e){null===e&&Wo("Dangling document-mutation reference found, which points to "+o),n.push(l.serializer.fromDbMutationBatch(e))}))}),Gn.waitFor(e).next(function(){return n})})},o.prototype.removeMutationBatches=function(d,t){for(var p=pt(d),e=ut(d),n=[],o=this,r=0,a=t,i;rthis.metadata.highestTargetId?(this.metadata.highestTargetId=n,r.next(function(){return ft(a).put(br.key,e.metadata)})):r},e.prototype.removeQueryData=function(n,t){return this.removeMatchingKeysForTargetId(n,t.targetId).next(function(){gt(n).delete(t.targetId)})},e.prototype.getQueryData=function(a,s){var e=this,t=s.canonicalId(),n=IDBKeyRange.bound([t,Number.NEGATIVE_INFINITY],[t,Ft]),d=null;return gt(a).iterate({range:n,index:fr.queryTargetsIndexName},function(n,t,r){var o=e.serializer.fromDbTarget(t);s.equals(o.query)&&(d=o,r.done())}).next(function(){return d})},e.prototype.addMatchingKeys=function(a,t,i){var n=[],r=yt(a);return t.forEach(function(o){var t=rt(o.path);n.push(r.put(new yr(i,t)))}),Gn.waitFor(n)},e.prototype.removeMatchingKeys=function(a,t,s){var n=this,r=[],o=yt(a);return t.forEach(function(a){var t=rt(a.path);r.push(o.delete([s,t])),null!==n.garbageCollector&&n.garbageCollector.addPotentialGarbageKey(a)}),Gn.waitFor(r)},e.prototype.removeMatchingKeysForTargetId=function(o,t){var e=yt(o),n=IDBKeyRange.bound([t],[t+1],!1,!0);return this.notifyGCForRemovedKeys(o,n).next(function(){return e.delete(n)})},e.prototype.notifyGCForRemovedKeys=function(o,t){var a=this,n=yt(o);return null!==this.garbageCollector&&this.garbageCollector.isEager?n.iterate({range:t,keysOnly:!0},function(e){var t=st(e[1]),n=new ae(t);Ho(null!==a.garbageCollector,"GarbageCollector for query cache set to null during key removal."),a.garbageCollector.addPotentialGarbageKey(n)}):Gn.resolve()},e.prototype.getMatchingKeysForTargetId=function(a,t){var e=IDBKeyRange.bound([t],[t+1],!1,!0),i=yt(a),s=J();return i.iterate({range:e,keysOnly:!0},function(e){var t=st(e[1]),n=new ae(t);s=s.add(n)}).next(function(){return s})},e.prototype.setGarbageCollector=function(e){this.garbageCollector=e},e.prototype.containsKey=function(a,t){Ho(null!==a,"Persistence Transaction cannot be null for query cache containsKey");var e=rt(t.path),n=IDBKeyRange.bound([e],[D(e)],!1,!0),i=0;return yt(a).iterate({index:yr.documentTargetsIndex,keysOnly:!0,range:n},function(o,t,e){i++,e.done()}).next(function(){return 0t?(o("Persistence owner-lease is in the future. Discarding.",n),1):n.ownerId===this.getZombiedOwnerId()))},r.prototype.scheduleOwnerLeaseRefreshes=function(){var n=this;this.ownerLeaseRefreshHandle=setInterval(function(){n.runTransaction("Refresh owner timestamp",function(t){return t.store(dr.store).put("owner",new dr(n.ownerId,Date.now()))}).catch(function(t){o(t),n.stopOwnerLeaseRefreshes()})},4e3)},r.prototype.stopOwnerLeaseRefreshes=function(){this.ownerLeaseRefreshHandle&&(clearInterval(this.ownerLeaseRefreshHandle),this.ownerLeaseRefreshHandle=null)},r.prototype.attachWindowUnloadHook=function(){var e=this;this.windowUnloadHandler=function(){e.setZombiedOwnerId(e.ownerId),e.shutdown()},window.addEventListener("unload",this.windowUnloadHandler)},r.prototype.detachWindowUnloadHook=function(){this.windowUnloadHandler&&(window.removeEventListener("unload",this.windowUnloadHandler),this.windowUnloadHandler=null)},r.prototype.getZombiedOwnerId=function(){try{var e=window.localStorage.getItem(this.zombiedOwnerLocalStorageKey());return So("IndexedDbPersistence","Zombied ownerID from LocalStorage:",e),e}catch(e){return o("Failed to get zombie owner id.",e),null}},r.prototype.setZombiedOwnerId=function(e){try{null===e?window.localStorage.removeItem(this.zombiedOwnerLocalStorageKey()):window.localStorage.setItem(this.zombiedOwnerLocalStorageKey(),e)}catch(e){o("Failed to set zombie owner id.",e)}},r.prototype.zombiedOwnerLocalStorageKey=function(){return this.localStoragePrefix+"zombiedOwnerId"},r.prototype.generateOwnerId=function(){return zt.newId()},r.MAIN_DATABASE="main",r}(),Or=function(){function e(n,o){this.remoteDocumentCache=n,this.mutationQueue=o}return e.prototype.getDocument=function(o,t){var e=this;return this.remoteDocumentCache.getEntry(o,t).next(function(n){return e.computeLocalDocument(o,t,n)})},e.prototype.getDocuments=function(a,t){var i=this,n=[],r=X();return t.forEach(function(o){n.push(i.getDocument(a,o).next(function(e){e||(e=new ue(o,Ge.forDeletedDoc())),r=r.insert(o,e)}))}),Gn.waitFor(n).next(function(){return r})},e.prototype.getDocumentsMatchingQuery=function(n,t){return ae.isDocumentKey(t.path)?this.getDocumentsMatchingDocumentQuery(n,t.path):this.getDocumentsMatchingCollectionQuery(n,t)},e.prototype.getDocumentsMatchingDocumentQuery=function(n,t){return this.getDocument(n,new ae(t)).next(function(n){var t=Q();return n instanceof se&&(t=t.insert(n.key,n)),t})},e.prototype.getDocumentsMatchingCollectionQuery=function(a,i){var t=this,e;return this.remoteDocumentCache.getDocumentsMatchingQuery(a,i).next(function(n){return t.computeLocalDocuments(a,n)}).next(function(n){return e=n,t.mutationQueue.getAllMutationBatchesAffectingQuery(a,i)}).next(function(n){for(var r=J(),o=0,i=n;on,"Acknowledged batches can't be rejected."),t})}).next(function(){return i.removeMutationBatch(e,t)}).next(function(o){return n=o,i.mutationQueue.performConsistencyCheck(e)}).next(function(){return i.localDocuments.getDocuments(e,n)})})},e.prototype.getLastStreamToken=function(){var n=this;return this.persistence.runTransaction("Get last stream token",function(t){return n.mutationQueue.getLastStreamToken(t)})},e.prototype.setLastStreamToken=function(o){var t=this;return this.persistence.runTransaction("Set last stream token",function(e){return t.mutationQueue.setLastStreamToken(e,o)})},e.prototype.getLastRemoteSnapshotVersion=function(){return this.queryCache.getLastRemoteSnapshotVersion()},e.prototype.applyRemoteEvent=function(i){var p=this,e=new Pr(this.remoteDocuments);return this.persistence.runTransaction("Apply remote event",function(c){var r=[];d(i.targetChanges,function(e,t){var n=p.targetIds[e];if(n){var o=t.mapping;if(o)if(o instanceof vn)r.push(p.queryCache.removeMatchingKeysForTargetId(c,e).next(function(){return p.queryCache.addMatchingKeys(c,o.documents,e)}));else{if(!(o instanceof bn))return Wo("Unknown mapping type: "+JSON.stringify(o));r.push(p.queryCache.removeMatchingKeys(c,o.removedDocuments,e).next(function(){return p.queryCache.addMatchingKeys(c,o.addedDocuments,e)}))}var a=t.resumeToken;0=n.compareTo(t)||u(this.targetIds)},e.prototype.shouldHoldBatchResult=function(e){return!this.isRemoteUpToVersion(e)||0r.version.compareTo(l))&&(r=n.applyToRemoteDocument(d,r,s),r?e.addEntry(r):Ho(!o,"Mutation batch "+n+" applied to document "+o+" resulted in null"))})}),r},e}(),xr=function(){function e(){this.mutationQueue=[],this.nextBatchId=1,this.highestAcknowledgedBatchId=nr,this.lastStreamToken=i(),this.garbageCollector=null,this.batchesByDocumentKey=new en(Yn.compareByKey)}return e.prototype.start=function(){return 0===this.mutationQueue.length&&(this.nextBatchId=1,this.highestAcknowledgedBatchId=nr),Ho(this.highestAcknowledgedBatchIdthis.highestAcknowledgedBatchId,"Mutation batchIDs must be acknowledged in order");var r=this.indexOfExistingBatchId(n,"acknowledged"),o=this.mutationQueue[r];return Ho(n===o.batchId,"Queue ordering failure: expected batch "+n+", got batch "+o.batchId),Ho(!o.isTombstone(),"Can't acknowledge a previously removed batch"),this.highestAcknowledgedBatchId=n,this.lastStreamToken=e,Gn.resolve()},e.prototype.getLastStreamToken=function(){return Gn.resolve(this.lastStreamToken)},e.prototype.setLastStreamToken=function(n,t){return this.lastStreamToken=t,Gn.resolve()},e.prototype.addMutationBatch=function(d,t,e){Ho(0!==e.length,"Mutation batches should not be empty");var n=this.nextBatchId;this.nextBatchId++,0n?0:n,o;rn?n=0:n>=e?n=e:n++,Gn.resolve(this.getAllLiveMutationBatchesBeforeIndex(n))},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(a,s){var e=this,t=new Yn(s,0),n=new Yn(s,Ft),o=[];return this.batchesByDocumentKey.forEachInRange([t,n],function(n){Ho(s.equals(n.key),"Should only iterate over a single key's batches");var t=e.findMutationBatch(n.targetOrBatchId);Ho(null!==t,"Batches in the index must exist in the main table"),o.push(t)}),Gn.resolve(o)},e.prototype.getAllMutationBatchesAffectingQuery=function(d,t){var l=this,n=t.path,r=n.length+1,e=n;ae.isDocumentKey(e)||(e=e.child(""));var o=new Yn(new ae(e),0),a=new en(P);this.batchesByDocumentKey.forEachWhile(function(o){var t=o.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(a=a.add(o.targetOrBatchId)),!0)},o);var i=[];return a.forEach(function(n){var t=l.findMutationBatch(n);null!==t&&i.push(t)}),Gn.resolve(i)},e.prototype.removeMutationBatches=function(c,t){var e=t.length;Ho(0t||t>=this.mutationQueue.length)return null;var e=this.mutationQueue[t];return Ho(e.batchId===o,"If found batch must match"),e.isTombstone()?null:e},e}(),_r=function(){function e(){this.queries=new jn(function(e){return e.canonicalId()}),this.lastRemoteSnapshotVersion=Ge.MIN,this.highestTargetId=0,this.references=new Xn}return e.prototype.start=function(){return Gn.resolve()},e.prototype.getLastRemoteSnapshotVersion=function(){return this.lastRemoteSnapshotVersion},e.prototype.getHighestTargetId=function(){return this.highestTargetId},e.prototype.setLastRemoteSnapshotVersion=function(n,t){return this.lastRemoteSnapshotVersion=t,Gn.resolve()},e.prototype.addQueryData=function(o,t){this.queries.set(t.query,t);var e=t.targetId;return e>this.highestTargetId&&(this.highestTargetId=e),Gn.resolve()},e.prototype.removeQueryData=function(n,t){return this.queries.delete(t.query),this.references.removeReferencesForId(t.targetId),Gn.resolve()},e.prototype.getQueryData=function(o,t){var e=this.queries.get(t)||null;return Gn.resolve(e)},e.prototype.addMatchingKeys=function(o,t,e){return this.references.addReferences(t,e),Gn.resolve()},e.prototype.removeMatchingKeys=function(o,t,e){return this.references.removeReferences(t,e),Gn.resolve()},e.prototype.removeMatchingKeysForTargetId=function(n,t){return this.references.removeReferencesForId(t),Gn.resolve()},e.prototype.getMatchingKeysForTargetId=function(o,t){var e=this.references.referencesForId(t);return Gn.resolve(e)},e.prototype.setGarbageCollector=function(e){this.references.setGarbageCollector(e)},e.prototype.containsKey=function(n,t){return this.references.containsKey(n,t)},e}(),Dr=function(){function e(){this.docs=X()}return e.prototype.addEntry=function(n,t){return this.docs=this.docs.insert(t.key,t),Gn.resolve()},e.prototype.removeEntry=function(n,t){return this.docs=this.docs.remove(t),Gn.resolve()},e.prototype.getEntry=function(n,t){return Gn.resolve(this.docs.get(t))},e.prototype.getDocumentsMatchingQuery=function(d,t){for(var e=Q(),n=new ae(t.path.child("")),r=this.docs.getIteratorFrom(n);r.hasNext();){var o=r.getNext(),i=o.key,a=o.value;if(!t.path.isPrefixOf(i.path))break;a instanceof se&&t.matches(a)&&(e=e.insert(a.key,a))}return Gn.resolve(e)},e}(),Mr=function(){function e(){this.mutationQueues={},this.remoteDocumentCache=new Dr,this.queryCache=new _r,this.started=!1}return e.prototype.start=function(){return Ho(!this.started,"MemoryPersistence double-started!"),this.started=!0,Promise.resolve()},e.prototype.shutdown=function(){return Ho(this.started,"MemoryPersistence shutdown without start!"),this.started=!1,Promise.resolve()},e.prototype.getMutationQueue=function(n){var t=this.mutationQueues[n.toKey()];return t||(t=new xr,this.mutationQueues[n.toKey()]=t),t},e.prototype.getQueryCache=function(){return this.queryCache},e.prototype.getRemoteDocumentCache=function(){return this.remoteDocumentCache},e.prototype.runTransaction=function(n,t){return So("MemoryPersistence","Starting transaction:",n),t(new Fr).toPromise()},e}(),Fr=function(){return function(){}}(),Br=function(){function e(){this.isEager=!1}return e.prototype.addGarbageSource=function(){},e.prototype.removeGarbageSource=function(){},e.prototype.addPotentialGarbageKey=function(){},e.prototype.collectGarbage=function(){return Gn.resolve(J())},e}(),Ur=function(){function e(){var o=this;this.promise=new Promise(function(t,e){o.resolve=t,o.reject=e})}return e}(),Vr=function(){function e(o,r,e){this.initialDelayMs=o,this.backoffFactor=r,this.maxDelayMs=e,this.reset()}return e.prototype.reset=function(){this.currentBaseMs=0},e.prototype.resetToMax=function(){this.currentBaseMs=this.maxDelayMs},e.prototype.backoffAndWait=function(){var n=new Ur,t=this.currentBaseMs+this.jitterDelayMs();return 0this.maxDelayMs&&(this.currentBaseMs=this.maxDelayMs),n.promise},e.prototype.jitterDelayMs=function(){return(Math.random()-.5)*this.currentBaseMs},e}(),Hr=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),Wr;!function(e){e[e.Initial=0]="Initial",e[e.Auth=1]="Auth",e[e.Open=2]="Open",e[e.Error=3]="Error",e[e.Backoff=4]="Backoff",e[e.Stopped=5]="Stopped"}(Wr||(Wr={}));var Zn=function(){function e(o,a,e,n){this.queue=o,this.connection=a,this.credentialsProvider=e,this.idle=!1,this.stream=null,this.listener=null,this.backoff=new Vr(n||1e3,1.5,6e4),this.state=Wr.Initial}return e.prototype.isStarted=function(){return this.state===Wr.Backoff||this.state===Wr.Auth||this.state===Wr.Open},e.prototype.isOpen=function(){return this.state===Wr.Open},e.prototype.start=function(e){return this.state===Wr.Error?void this.performBackoff(e):void(Ho(this.state===Wr.Initial,"Already started"),this.listener=e,this.auth())},e.prototype.stop=function(){this.isStarted()&&this.close(Wr.Stopped)},e.prototype.inhibitBackoff=function(){Ho(!this.isStarted(),"Can only inhibit backoff in a stopped state"),this.state=Wr.Initial,this.backoff.reset()},e.prototype.markIdle=function(){var e=this;this.idle=!0,this.queue.schedule(function(){return e.handleIdleCloseTimer()},6e4).catch(function(e){Ho(e.code===Gt.CANCELLED,"Received unexpected error in idle timeout closure. Expected CANCELLED, but was: "+e)})},e.prototype.sendRequest=function(e){this.cancelIdleCheck(),this.stream.send(e)},e.prototype.handleIdleCloseTimer=function(){return this.isOpen()&&this.idle?this.close(Wr.Initial):Promise.resolve()},e.prototype.cancelIdleCheck=function(){this.idle=!1},e.prototype.close=function(r,t){Ho(r==Wr.Error||V(t),"Can't provide an error when not in an error state."),this.cancelIdleCheck(),r==Wr.Error?t&&t.code===Gt.RESOURCE_EXHAUSTED&&(o(""+t),o("Using maximum backoff delay to prevent overloading the backend."),this.backoff.resetToMax()):this.backoff.reset(),null!==this.stream&&(this.tearDown(),this.stream.close(),this.stream=null),this.state=r;var e=this.listener;return this.listener=null,r==Wr.Stopped?Promise.resolve():e.onClose(t)},e.prototype.tearDown=function(){},e.prototype.auth=function(){var o=this;Ho(this.state===Wr.Initial,"Must be in initial state to auth"),this.state=Wr.Auth,this.credentialsProvider.getToken(!1).then(function(t){o.startStream(t)},function(t){o.queue.schedule(function(){if(o.state!==Wr.Stopped){var e=new Ht(Gt.UNKNOWN,"Fetching auth token failed: "+t.message);return o.handleStreamClose(e)}return Promise.resolve()})})},e.prototype.startStream=function(o){var a=this;if(this.state!==Wr.Stopped){Ho(this.state===Wr.Auth,"Trying to start stream in a non-auth state");var e=function(e,t){a.queue.schedule(function(){return a.stream===e?t():Promise.resolve()})};if(null!==this.listener){var n=this.startRpc(o);this.stream=n,this.stream.onOpen(function(){e(n,function(){return Ho(a.state===Wr.Auth,"Expected stream to be in state auth, but was "+a.state),a.state=Wr.Open,a.listener.onOpen()})}),this.stream.onClose(function(o){e(n,function(){return a.handleStreamClose(o)})}),this.stream.onMessage(function(o){e(n,function(){return a.onMessage(o)})})}}},e.prototype.performBackoff=function(n){var t=this;Ho(this.state===Wr.Error,"Should only perform backoff in an error case"),this.state=Wr.Backoff,this.backoff.backoffAndWait().then(function(){t.queue.schedule(function(){return t.state===Wr.Stopped?Promise.resolve():(t.state=Wr.Initial,t.start(n),Ho(t.isStarted(),"PersistentStream should have started"),Promise.resolve())})})},e.prototype.handleStreamClose=function(e){return Ho(this.isStarted(),"Can't handle server close on non-started stream"),So("PersistentStream","close with error: "+e),this.stream=null,this.close(Wr.Error,e)},e}(),jr=function(d){function t(t,l,n,r,o,i){var a=d.call(this,l,n,r,i)||this;return a.databaseInfo=t,a.serializer=o,a}return Hr(t,d),t.prototype.startRpc=function(e){return this.connection.openStream("Listen",e)},t.prototype.onMessage=function(o){this.backoff.reset();var t=this.serializer.fromWatchChange(o),e=this.serializer.versionFromListenResponse(o);return this.listener.onWatchChange(t,e)},t.prototype.watch=function(o){var t={database:this.serializer.encodedDatabaseId,addTarget:this.serializer.toTarget(o)},e=this.serializer.toListenRequestLabels(o);e&&(t.labels=e),this.sendRequest(t)},t.prototype.unwatch=function(n){var t={};t.database=this.serializer.encodedDatabaseId,t.removeTarget=n,this.sendRequest(t)},t}(Zn),qr=function(d){function t(t,l,n,r,o,i){var a=d.call(this,l,n,r,i)||this;return a.databaseInfo=t,a.serializer=o,a.y=!1,a}return Hr(t,d),Object.defineProperty(t.prototype,"handshakeComplete",{get:function(){return this.y},enumerable:!0,configurable:!0}),t.prototype.start=function(t){this.y=!1,d.prototype.start.call(this,t)},t.prototype.tearDown=function(){this.y&&this.writeMutations([])},t.prototype.startRpc=function(e){return this.connection.openStream("Write",e)},t.prototype.onMessage=function(o){if(Ho(!!o.streamToken,"Got a write response without a stream token"),this.lastStreamToken=o.streamToken,this.y){this.backoff.reset();var t=this.serializer.fromWriteResults(o.writeResults),e=this.serializer.fromVersion(o.commitTime);return this.listener.onMutationResult(e,t)}return Ho(!o.writeResults||0===o.writeResults.length,"Got mutation results for handshake"),this.y=!0,this.listener.onHandshakeComplete()},t.prototype.writeHandshake=function(){Ho(this.isOpen(),"Writing handshake requires an opened stream"),Ho(!this.y,"Handshake already completed");var e={};e.database=this.serializer.encodedDatabaseId,this.sendRequest(e)},t.prototype.writeMutations=function(o){var r=this;Ho(this.isOpen(),"Writing mutations requires an opened stream"),Ho(this.y,"Handshake must be complete before writing mutations"),Ho(0this.pendingWrites.length},e.prototype.outstandingWrites=function(){return this.pendingWrites.length},e.prototype.commit=function(e){Ho(this.canWriteMutations(),"commit called when batches can't be written"),this.lastBatchSeen=e.batchId,this.pendingWrites.push(e),this.shouldStartWriteStream()?this.startWriteStream():this.isNetworkEnabled()&&this.writeStream.handshakeComplete&&this.writeStream.writeMutations(e.mutations)},e.prototype.shouldStartWriteStream=function(){return this.isNetworkEnabled()&&!this.writeStream.isStarted()&&0t.indexOf("Firestore Test Simulated Error")&&setTimeout(function(){throw e},0),e}).then(function(){r.operationInProgress=!1})}),this.tail},e.prototype.verifyOperationInProgress=function(){Ho(this.operationInProgress,"verifyOpInProgress() called when no op in progress on this queue.")},e.prototype.drain=function(o){var t=this;return this.delayedOperations.forEach(function(e){e.handle&&(clearTimeout(e.handle),o?t.scheduleInternal(e.op).then(e.deferred.resolve,e.deferred.reject):e.deferred.reject(new Ht(Gt.CANCELLED,"Operation cancelled by shutdown")))}),this.delayedOperations=[],this.delayedOperationsCount=0,this.schedule(function(){return Promise.resolve()})},e}(),oo=function(){function e(e){this.uid=e}return e.prototype.isUnauthenticated=function(){return null==this.uid},e.prototype.toKey=function(){return this.isUnauthenticated()?"anonymous-user":"uid:"+this.uid},e.prototype.equals=function(e){return e.uid===this.uid},e.UNAUTHENTICATED=new e(null),e.GOOGLE_CREDENTIALS=new e("google-credentials-uid"),e.FIRST_PARTY=new e("first-party-uid"),e}(),io=function(){function e(n,o){this.user=o,this.type="OAuth",this.authHeaders={Authorization:"Bearer "+n}}return e}(),ao=function(){function e(){this.userListener=null}return e.prototype.getToken=function(){return Promise.resolve(null)},e.prototype.setUserChangeListener=function(e){Ho(!this.userListener,"Can only call setUserChangeListener() once."),this.userListener=e,e(oo.UNAUTHENTICATED)},e.prototype.removeUserChangeListener=function(){Ho(null!==this.userListener,"removeUserChangeListener() when no listener registered"),this.userListener=null},e}(),so=function(){function e(n){var o=this;this.app=n,this.tokenListener=null,this.userCounter=0,this.userListener=null,this.tokenListener=function(){var e=o.getUser();o.currentUser&&e.equals(o.currentUser)||(o.currentUser=e,o.userCounter++,o.userListener&&o.userListener(o.currentUser))},this.userCounter=0,this.app.INTERNAL.addAuthTokenListener(this.tokenListener)}return e.prototype.getToken=function(o){var r=this;Ho(null!=this.tokenListener,"getToken cannot be called after listener removed.");var e=this.userCounter;return this.app.INTERNAL.getToken(o).then(function(n){if(r.userCounter!==e)throw new Ht(Gt.ABORTED,"getToken aborted due to uid change.");return n?(Ho("string"==typeof n.accessToken,"Invalid tokenData returned from getToken():"+n),new io(n.accessToken,r.currentUser)):null})},e.prototype.setUserChangeListener=function(e){Ho(!this.userListener,"Can only call setUserChangeListener() once."),this.userListener=e,this.currentUser&&e(this.currentUser)},e.prototype.removeUserChangeListener=function(){Ho(null!=this.tokenListener,"removeUserChangeListener() called twice"),Ho(null!==this.userListener,"removeUserChangeListener() called when no listener registered"),this.app.INTERNAL.removeAuthTokenListener(this.tokenListener),this.tokenListener=null,this.userListener=null},e.prototype.getUser=function(){"function"!=typeof this.app.INTERNAL.getUid&&Wo("This version of the Firestore SDK requires at least version 3.7.0 of firebase.js.");var e=this.app.INTERNAL.getUid();return Ho(null===e||"string"==typeof e,"Received invalid UID: "+e),new oo(e)},e}(),uo=function(){function e(n,o){this.gapi=n,this.sessionIndex=o,this.type="FirstParty",this.user=oo.FIRST_PARTY,Ho(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,"unexpected gapi interface")}return Object.defineProperty(e.prototype,"authHeaders",{get:function(){return{Authorization:this.gapi.auth.getAuthHeaderValueForFirstParty([]),"X-Goog-AuthUser":this.sessionIndex}},enumerable:!0,configurable:!0}),e}(),co=function(){function e(n,o){this.gapi=n,this.sessionIndex=o,Ho(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,"unexpected gapi interface")}return e.prototype.getToken=function(){return Promise.resolve(new uo(this.gapi,this.sessionIndex))},e.prototype.setUserChangeListener=function(e){e(oo.FIRST_PARTY)},e.prototype.removeUserChangeListener=function(){},e}(),ho=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),lo=function(){function e(){}return e.delete=function(){return fo.instance},e.serverTimestamp=function(){return po.instance},e}(),fo=function(n){function t(){return n.call(this)||this}return ho(t,n),t.instance=new t,t}(lo),po=function(n){function t(){return n.call(this)||this}return ho(t,n),t.instance=new t,t}(lo),yo=s(lo,"Use FieldValue.() instead."),Xr=/^__.*__$/,go=function(){function e(o,r,e){this.data=o,this.fieldMask=r,this.fieldTransforms=e}return e.prototype.toMutations=function(o,t){var e=[];return null===this.fieldMask?e.push(new rn(o,this.data,t)):e.push(new on(o,this.data,this.fieldMask,t)),0=n.docs.size,"Too many documents returned on a document query");var t=n.docs.get(e.q);s.next(new Oo(e.firestore,e.q,t,n.fromCache))}},error:t}),o=this._.listen(Pe.atPath(this.q.path),n,a);return function(){n.mute(),e._.unlisten(o)}},o.prototype.get=function(){var o=this;return m("DocumentReference.get",arguments,0),new Promise(function(a,e){var i=o.onSnapshotInternal({includeQueryMetadataChanges:!0,includeDocumentMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(n){i(),!n.exists&&n.metadata.fromCache?e(new Ht(Gt.ABORTED,"Failed to get document because the client is offline.")):a(n)},error:e})})},o}(),Oo=function(){function e(o,a,e,n){this.Q=o,this.q=a,this.nt=e,this.rt=n}return e.prototype.data=function(){if(m("DocumentSnapshot.data",arguments,0),!this.nt)throw new Ht(Gt.NOT_FOUND,"This document doesn't exist. Check doc.exists to make sure the document exists before calling doc.data().");return this.convertObject(this.nt.data)},e.prototype.get=function(n){if(m("DocumentSnapshot.get",arguments,1),!this.nt)throw new Ht(Gt.NOT_FOUND,"This document doesn't exist. Check doc.exists to make sure the document exists before calling doc.get().");var t=this.nt.data.field(At("DocumentSnapshot.get",n));return void 0===t?void 0:this.convertValue(t)},Object.defineProperty(e.prototype,"id",{get:function(){return this.q.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ref",{get:function(){return new Ro(this.q,this.Q)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"exists",{get:function(){return null!==this.nt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return{hasPendingWrites:null!==this.nt&&this.nt.hasLocalMutations,fromCache:this.rt}},enumerable:!0,configurable:!0}),e.prototype.convertObject=function(o){var a=this,e={};return o.forEach(function(n,t){e[n]=a.convertValue(t)}),e},e.prototype.convertValue=function(r){if(r instanceof Ne)return this.convertObject(r);if(r instanceof Ae)return this.convertArray(r);if(r instanceof De){var t=r.value(),e=this.Q.ensureClientConfigured().databaseId();return r.databaseId.equals(e)||o("Document "+this.q.path+" contains a document reference within a different database ("+r.databaseId.projectId+"/"+r.databaseId.database+") which is not supported. It will be treated as a reference in the current database ("+e.projectId+"/"+e.database+") instead."),new Ro(t,this.Q)}return r.value()},e.prototype.convertArray=function(n){var o=this;return n.internalValue.map(function(e){return o.convertValue(e)})},e}(),Mo=function(){function s(n,o){this.ot=n,this.firestore=o}return s.prototype.where=function(t,e,n){m("Query.where",arguments,3),b("Query.where","string",2,e),I("Query.where",3,n);var d=At("Query.where",t),i;if(!d.isKeyField())i=this.firestore._dataConverter.parseQueryValue("Query.where",n);else if("string"==typeof n){if(-1!==n.indexOf("/"))throw new Ht(Gt.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a valid document ID if the first parameter is FieldPath.documentId(), but it contains a slash.");if(""===n)throw new Ht(Gt.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a valid document ID if the first parameter is FieldPath.documentId(), but it was an empty string.");var o=this.ot.path.child(new re([n]));Ho(0==o.length%2,"Path should be a document key"),i=new De(this.firestore._databaseId,new ae(o))}else{if(!(n instanceof Ro))throw new Ht(Gt.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a string or a DocumentReference if the first parameter is FieldPath.documentId(), but it was: "+k(n)+".");i=new De(this.firestore._databaseId,n.q)}var a=W(d,Le.fromString(e),i);return this.validateNewFilter(a),new s(this.ot.addFilter(a),this.firestore)},s.prototype.orderBy=function(t,e){f("Query.orderBy",arguments,1,2),v("Query.orderBy","string",2,e);var n;if(void 0===e||"asc"===e)n=Fe.ASCENDING;else{if("desc"!==e)throw new Ht(Gt.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+e+"', expected 'asc' or 'desc'.");n=Fe.DESCENDING}if(null!==this.ot.startAt)throw new Ht(Gt.INVALID_ARGUMENT,"Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");if(null!==this.ot.endAt)throw new Ht(Gt.INVALID_ARGUMENT,"Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");var r=At("Query.orderBy",t),o=new qe(r,n);return this.validateNewOrderBy(o),new s(this.ot.addOrderBy(o),this.firestore)},s.prototype.limit=function(t){if(m("Query.limit",arguments,1),b("Query.limit","number",1,t),0>=t)throw new Ht(Gt.INVALID_ARGUMENT,"Invalid Query. Query limit ("+t+") is invalid. Limit must be positive.");return new s(this.ot.withLimit(t),this.firestore)},s.prototype.startAt=function(t){for(var e=[],n=1;nn.length)throw new Ht(Gt.INVALID_ARGUMENT,"Too many arguments provided to "+d+"(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses");for(var r=[],o=0,i;o, or >=) must be on the same field. But you have inequality filters on '"+t+"' and '"+o.field+"'");var e=this.ot.getFirstOrderByField();null!==e&&this.validateOrderByAndInequalityMatch(o.field,e)}},s.prototype.validateNewOrderBy=function(n){if(null===this.ot.getFirstOrderByField()){var t=this.ot.getInequalityFilterField();null!==t&&this.validateOrderByAndInequalityMatch(t,n.field)}},s.prototype.validateOrderByAndInequalityMatch=function(n,t){if(!t.equals(n))throw new Ht(Gt.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+n+"' and so you must also use '"+n+"' as your first Query.orderBy(), but your first Query.orderBy() is on field '"+t+"' instead.")},s}(),_o=function(){function e(o,r,e){this.Q=o,this.it=r,this.at=e,this._cachedChanges=null,this.metadata={fromCache:e.fromCache,hasPendingWrites:e.hasPendingWrites}}return Object.defineProperty(e.prototype,"docs",{get:function(){var n=[];return this.forEach(function(t){return n.push(t)}),n},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return this.at.docs.isEmpty()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.at.docs.size},enumerable:!0,configurable:!0}),e.prototype.forEach=function(o,t){var e=this;f("QuerySnapshot.forEach",arguments,1,2),b("QuerySnapshot.forEach","function",1,o),this.at.docs.forEach(function(n){o.call(t,e.convertToDocumentImpl(n))})},Object.defineProperty(e.prototype,"query",{get:function(){return new Mo(this.it,this.Q)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"docChanges",{get:function(){return this._cachedChanges||(this._cachedChanges=xt(this.Q,this.at)),this._cachedChanges},enumerable:!0,configurable:!0}),e.prototype.convertToDocumentImpl=function(e){return new Oo(this.Q,e.key,e,this.metadata.fromCache)},e}(),Po=function(o){function t(t,a){var n=o.call(this,Pe.atPath(t),a)||this;if(1!=t.length%2)throw new Ht(Gt.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+t.canonicalString()+" has "+t.length);return n}return To(t,o),Object.defineProperty(t.prototype,"id",{get:function(){return this.ot.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this.ot.path.popLast();return e.isEmpty()?null:new Ro(new ae(e),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this.ot.path.canonicalString()},enumerable:!0,configurable:!0}),t.prototype.doc=function(n){if(f("CollectionReference.doc",arguments,0,1),0===arguments.length&&(n=zt.newId()),b("CollectionReference.doc","string",1,n),""===n)throw new Ht(Gt.INVALID_ARGUMENT,"Document path must be a non-empty string");var t=re.fromString(n);return Ro.forPath(this.ot.path.child(t),this.firestore)},t.prototype.add=function(n){m("CollectionReference.add",arguments,1),b("CollectionReference.add","object",1,n);var t=this.doc();return t.set(n).then(function(){return t})},t}(Mo),Lo=s(ko,"Use firebase.firestore() instead."),Qr=s(No,"Use firebase.firestore().runTransaction() instead."),Yr=s(Ao,"Use firebase.firestore().batch() instead."),Jr=s(Ro,"Use firebase.firestore().doc() instead."),$r=s(Oo),Zr=s(Mo),ea=s(_o),ta=s(Po,"Use firebase.firestore().collection() instead."),na={Firestore:Lo,GeoPoint:Go,Blob:Yt,Transaction:Qr,WriteBatch:Yr,DocumentReference:Jr,DocumentSnapshot:$r,Query:Zr,QuerySnapshot:ea,CollectionReference:ta,FieldPath:Pn,FieldValue:yo,setLogLevel:ko.setLogLevel};t.registerFirestore=Mt,Mt(zo.default)},115:function(e,t,n){var a=Math.floor,d=Math.max;(function(t){(function(){function s(e){return"string"==typeof e}function o(){}function i(o){var r=typeof o;if("object"==r){if(!o)return"null";if(o instanceof Array)return"array";if(o instanceof Object)return r;var e=Object.prototype.toString.call(o);if("[object Window]"==e)return"object";if("[object Array]"==e||"number"==typeof o.length&&void 0!==o.splice&&void 0!==o.propertyIsEnumerable&&!o.propertyIsEnumerable("splice"))return"array";if("[object Function]"==e||void 0!==o.call&&void 0!==o.propertyIsEnumerable&&!o.propertyIsEnumerable("call"))return"function"}else if("function"==r&&void 0===o.call)return"object";return r}function l(e){return"array"==i(e)}function c(n){var t=i(n);return"array"==t||"object"==t&&"number"==typeof n.length}function h(e){return"function"==i(e)}function m(n){var o=typeof n;return"object"==o&&null!=n||"function"==o}function n(e){return e.call.apply(e.bind,arguments)}function p(o,a){if(!o)throw Error();if(2t?1:0}function j(n,t){t.unshift(n),u.call(this,v.apply(null,t)),t.shift()}function G(e){throw new j("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1))}function $(){0!=Ao&&(Lo[this[k]||(this[k]=++q)]=this),this.i=this.i,this.w=this.w}function w(a){t:{for(var t=qe,e=a.length,n=s(a)?a.split(""):a,r=0;rt?null:s(a)?a.charAt(t):a[t]}function Z(n){if(!l(n))for(var t=n.length-1;0<=t;t--)delete n[t];n.length=0}function _e(){return Array.prototype.concat.apply([],arguments)}function et(o){var t=o.length;if(0n.keyCode||void 0!=n.returnValue)){t:{var r=!1;if(0==n.keyCode)try{n.keyCode=-1;break t}catch(e){r=!0}(r||void 0==n.returnValue)&&(n.returnValue=!0)}for(n=[],r=t.a;r;r=r.parentNode)n.push(r);for(a=a.type,r=n.length-1;0<=r;r--){t.a=n[r];var o=Tt(n[r],a,!0,t);s=s&&o}for(r=0;rt.b&&(t.b++,n.next=t.a,t.a=n)}dr=!1}function zt(t,e){Lt.call(this),this.b=t||1,this.a=e||Io,this.f=f(this.ib,this),this.g=No()}function Kt(e){e.$=!1,e.K&&(e.a.clearTimeout(e.K),e.K=null)}function Gt(o,r,a){if(h(o))a&&(o=f(o,a));else{if(!o||"function"!=typeof o.handleEvent)throw Error("Invalid listener argument");o=f(o.handleEvent,o)}return 2147483647<+r?-1:Io.setTimeout(o,r||0)}function Xt(o,t,e){$.call(this),this.f=null==e?o:f(o,e),this.c=t,this.b=f(this.bb,this),this.a=[]}function Qt(e){e.X=Gt(e.b,e.c),e.f.apply(null,e.a)}function Yt(e){$.call(this),this.b=e,this.a={}}function C(e){y(e.a,function(n,t){this.a.hasOwnProperty(t)&&Et(n)},e),e.a={}}function Jt(o,t,e){this.reset(o,t,e,void 0,void 0)}function $t(e){this.f=e,this.b=this.c=this.a=null}function Zt(n,t){this.name=n,this.value=t}function D(e){return e.c?e.c:e.a?D(e.a):(G("Root logger has no level set."),null)}function en(o){xr||(xr=new $t(""),vr[""]=xr,xr.c=yr);var t;if(!(t=vr[o])){t=new $t(o);var e=o.lastIndexOf("."),n=o.substr(e+1);e=en(o.substr(0,e)),e.b||(e.b={}),e.b[n]=t,t.a=e,vr[o]=t}return t}function tn(n,t){n&&n.log(gr,t,void 0)}function E(n,t){n&&n.log(fr,t,void 0)}function nn(n,t){n&&n.log(br,t,void 0)}function F(){this.a=en("goog.labs.net.webChannel.WebChannelDebug"),this.b=!0}function on(d,t,e,n,r,o){ln(d,function(){if(!d.b)i=o;else if(o){for(var i="",a=o.split("&"),s=0,p;so.length)){var i=o[1];if(l(i)&&!(1>i.length)){var a=i[0];if("noop"!=a&&"stop"!=a&&"close"!=a)for(var s=1;se;e++){n=t[e];try{return new ActiveXObject(n),o.b=n}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return o.b}function Sn(o,t,e,n){this.i=o,this.b=t,this.f=e,this.T=n||1,this.N=new Yt(this),this.S=Tr,o=this.H=new zt,o.b=wr,o.K&&o.$?(Kt(o),o.start()):o.K&&Kt(o),this.j=null,this.c=!1,this.m=this.g=this.h=this.J=this.D=this.U=this.w=null,this.s=[],this.a=null,this.F=0,this.l=this.o=null,this.C=-1,this.B=!1,this.P=0,this.I=null,this.M=!1}function K(n,t){return 0===n?"Non-200 return code ("+t+")":1===n?"XMLHTTP failure (no data)":2===n?"HttpConnection timeout":"Unknown error"}function En(o,t,e){o.J=1,o.h=Gn(P(t)),o.m=e,o.M=!0,Tn(o,null)}function kn(o,t,e,n){o.J=1,o.h=Gn(P(t)),o.m=null,o.M=e,Tn(o,n)}function Tn(t,e){t.D=No(),Ln(t),t.g=P(t.h),Q(t.g,"t",t.T),t.F=0,t.a=t.i.da(t.i.ia()?e:null),0t)&&(3!=t||Mo||a.a.V())){a.B||4!=t||7==e||un(8==e||0>=n?3:2),On(a);var r=a.a.W();a.C=r,(e=a.a.V())||dn(a.b,function(){return"No response text for uri "+a.g+" status "+r}),a.c=200==r,rn(a.b,a.o,a.g,a.f,a.T,t,r),a.c?(a.M?(In(a,t,e),Mo&&a.c&&3==t&&Nn(a)):(an(a.b,a.f,e,null),Dn(a,e)),4==t&&_n(a),a.c&&!a.B&&(4==t?a.i.ua(a):(a.c=!1,Ln(a)))):(400==r&&0t.length?Nr:(t=t.substr(n,e),o.F=n+e,t))}function Ln(t){t.U=No()+t.S,Rn(t,t.S)}function Rn(n,t){if(null!=n.w)throw Error("WatchDog timer not null");n.w=fn(f(n.cb,n),t)}function On(e){e.w&&(Io.clearTimeout(e.w),e.w=null)}function Pn(e){e.i.Ja()||e.B||e.i.ua(e)}function _n(n){On(n);var t=n.I;t&&"function"==typeof t.Z&&t.Z(),n.I=null,Kt(n.H),C(n.N),n.a&&(t=n.a,n.a=null,t.abort(),t.Z())}function Dn(n,t){try{n.i.Ma(n,t),un(4)}catch(t){I(n.b,t,"Error in httprequest callback")}}function Mn(o){if(o.v&&"function"==typeof o.v)return o.v();if(s(o))return o.split("");if(c(o)){for(var t=[],e=o.length,n=0;n2*n.c&&Vn(n),!0)}function Vn(a){if(a.c!=a.a.length){for(var t=0,e=0,n;tt)throw Error("Bad port number "+t);n.i=t}else n.i=null}function zn(o,t,e){t instanceof Zn?(o.c=t,ao(o.c,o.h)):(e||(t=Jn(t,Pr)),o.c=new Zn(t,o.h))}function Kn(o,t,e){o.c.set(t,e)}function Q(n,t,e){l(e)||(e=[e+""]),no(n.c,t,e)}function Gn(t){return Kn(t,"zx",a(2147483648*Math.random()).toString(36)+Math.abs(a(2147483648*Math.random())^No()).toString(36)),t}function Xn(e){return e instanceof Hn?P(e):new Hn(e,void 0)}function Qn(a,t,e,n){var r=new Hn(null,void 0);return a&&L(r,a),t&&jn(r,t),e&&qn(r,e),n&&(r.a=n),r}function Yn(n,t){return n?t?decodeURI(n.replace(/%25/g,"%2525")):decodeURIComponent(n):""}function Jn(o,t,e){return s(o)?(o=encodeURI(o).replace(t,$n),e&&(o=o.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),o):null}function $n(e){return e=e.charCodeAt(0),"%"+(15&e>>4).toString(16)+(15&e).toString(16)}function Zn(n,t){this.b=this.a=null,this.c=n||null,this.f=!!t}function eo(o){o.a||(o.a=new Bn,o.b=0,o.c&&O(o.c,function(t,e){o.add(decodeURIComponent(t.replace(/\+/g," ")),e)}))}function R(n,t){eo(n),t=ro(n,t),Wn(n.a.b,t)&&(n.c=null,n.b-=n.a.get(t).length,Un(n.a,t))}function to(n,t){return eo(n),t=ro(n,t),Wn(n.a.b,t)}function no(o,t,e){R(o,t),0=e.f}function be(n,t){return n.b?n.b==t:!!n.a&&n.a.contains(t)}function ce(n,t){n.a?n.a.add(t):n.b=t}function ae(n,t){n.b&&n.b==t?n.b=null:n.a&&n.a.contains(t)&&Un(n.a.a,S(t))}function de(n){if(null!=n.b)return n.c.concat(n.b.s);if(null!=n.a&&0!=n.a.a.c){var o=n.c;return Oo(n.a.v(),function(e){o=o.concat(e.s)}),o}return et(n.c)}function ee(n,t){n.c=n.c.concat(t)}function fe(){}function ge(){this.a=new fe}function he(o,a,e){var i=e||"";try{Fn(o,function(e,t){var n=e;m(e)&&(n=Pt(e)),a.push(i+t+"="+encodeURIComponent(n))})}catch(e){throw a.push(i+"type="+encodeURIComponent("_badmap")),e}}function ie(o,t){var e=new F;dn(e,"TestLoadImage: loading "+o);var n=new Image;n.onload=b(je,e,n,"TestLoadImage: loaded",!0,t),n.onerror=b(je,e,n,"TestLoadImage: error",!1,t),n.onabort=b(je,e,n,"TestLoadImage: abort",!1,t),n.ontimeout=b(je,e,n,"TestLoadImage: timeout",!1,t),Io.setTimeout(function(){n.ontimeout&&n.ontimeout()},1e4),n.src=o}function je(a,t,e,n,r){try{dn(a,e),t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,r(n)}catch(t){I(a,t)}}function ke(e){Lt.call(this),this.headers=new Bn,this.F=e||null,this.f=!1,this.D=this.a=null,this.M=this.s="",this.j=0,this.g="",this.h=this.I=this.o=this.H=!1,this.l=0,this.B=null,this.N=Br,this.C=this.m=!1}function T(e){return Fo&<(9)&&"number"==typeof e.timeout&&void 0!==e.ontimeout}function qe(e){return"content-type"==e.toLowerCase()}function Co(n,t){n.f=!1,n.a&&(n.h=!0,n.a.abort(),n.h=!1),n.g=t,n.j=5,oe(n),te(n)}function oe(e){e.H||(e.H=!0,e.dispatchEvent("complete"),e.dispatchEvent("error"))}function re(s){if(s.f&&void 0!==wo)if(s.D[1]&&4==pe(s)&&2==s.W())nn(s.b,M(s,"Local request error detected and ignored"));else if(s.o&&4==pe(s))Gt(s.La,0,s);else if(s.dispatchEvent("readystatechange"),4==pe(s)){nn(s.b,M(s,"Request complete")),s.f=!1;try{var t=s.W();t:switch(t){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var e=!0;break t;default:e=!1;}var n;if(!(n=e)){var r;if(r=0===t){var o=(s.s+"").match(Ar)[1]||null;if(!o&&Io.self&&Io.self.location){var d=Io.self.location.protocol;o=d.substr(0,d.length-1)}r=!le.test(o?o.toLowerCase():"")}n=r}n?(s.dispatchEvent("complete"),s.dispatchEvent("success")):(s.j=6,s.g=s.Ga()+" ["+s.W()+"]",oe(s))}finally{te(s)}}}function te(a,t){if(a.a){se(a);var e=a.a,n=a.D[0]?o:null;a.a=null,a.D=null,t||a.dispatchEvent("ready");try{e.onreadystatechange=n}catch(t){(a=a.b)&&a.log(mr,"Problem encountered resetting onreadystatechange: "+t.message,void 0)}}}function se(e){e.a&&e.C&&(e.a.ontimeout=null),e.B&&(Io.clearTimeout(e.B),e.B=null)}function pe(e){return e.a?e.a.readyState:0}function M(n,t){return t+" ["+n.M+" "+n.s+" "+n.W()+"]"}function U(n){var o="";return y(n,function(e,t){o+=t,o+=":",o+=e,o+="\r\n"}),o}function ue(a,t,e){t:{for(n in e){var n=!1;break t}n=!0}if(n)return a;if(e=U(e),s(a)){if(t=encodeURIComponent(t+""),e=null==e?"":"="+encodeURIComponent(e+""),t+=e){if(e=a.indexOf("#"),0>e&&(e=a.length),0>(n=a.indexOf("?"))||n>e){n=e;var r=""}else r=a.substring(n+1,e);a=[a.substr(0,n),r,a.substr(e)],e=a[1],a[1]=t?e?e+"&"+t:t:e,a=a[0]+(a[1]?"?"+a[1]:"")+a[2]}return a}return Kn(a,t,e),a}function ve(e){this.ya=0,this.g=[],this.a=new F,this.H=new go,this.ja=this.wa=this.F=this.ka=this.b=this.J=this.j=this.U=this.h=this.M=this.i=null,this.Ua=this.P=0,this.la=this.B=this.o=this.m=this.l=this.f=null,this.s=this.xa=this.N=-1,this.T=this.w=this.C=0,this.S=e&&e.supportsCrossDomainXhr||!1,this.I="",this.c=new bo(e&&e.concurrentRequestLimit),this.ma=new ge,this.D=!e||void 0===e.backgroundChannelTest||e.backgroundChannelTest,this.Ta=e&&e.fastHandshake||!1,e&&e.Ea&&this.a.Ea()}function we(t){if(dn(t.a,"disconnect()"),xe(t),3==t.G){var e=t.P++,n=P(t.F);Kn(n,"SID",t.I),Kn(n,"RID",e),Kn(n,"TYPE","terminate"),He(t,n),e=new Sn(t,t.a,e,void 0),e.J=2,e.h=Gn(P(n)),n=!1,Io.navigator&&Io.navigator.sendBeacon&&(n=Io.navigator.sendBeacon(""+e.h,"")),!n&&Io.Image&&(new Image().src=e.h,n=!0),n||(e.a=e.i.da(null),e.a.fa(e.h)),e.D=No(),Ln(e)}V(t)}function xe(e){e.B&&(e.B.abort(),e.B=null),e.b&&(e.b.cancel(),e.b=null),e.m&&(Io.clearTimeout(e.m),e.m=null),Eo(e),e.c.cancel(),e.l&&(Io.clearTimeout(e.l),e.l=null)}function ye(n,t){1e3==n.g.length&&H(n.a,function(){return"Already have 1000 queued maps upon queueing "+Pt(t)}),n.g.push(new yo(n.Ua++,t)),3==n.G&&Ce(n)}function Ce(e){xo(e.c)||e.l||(e.l=fn(f(e.Oa,e),0),e.C=0)}function De(o,t){var e=o.c;return(e.b?1:e.a?e.a.u():0)>=o.c.f-(o.l?1:0)?(H(o.a,"Unexpected retry request is scheduled."),!1):o.l?(dn(o.a,"Use the retry request that is already scheduled."),o.g=t.s.concat(o.g),!0):!(1==o.G||2==o.G||2<=o.C||(dn(o.a,"Going to retry POST"),o.l=fn(f(o.Oa,o,t),Be(o,o.C)),o.C++,0))}function Ee(o,t){var e=t?t.f:o.P++;var n=P(o.F);Kn(n,"SID",o.I),Kn(n,"RID",e),Kn(n,"AID",o.N),He(o,n),o.h&&o.i&&ue(n,o.h,o.i),e=new Sn(o,o.a,e,o.C+1),null===o.h&&(e.j=o.i),t&&(o.g=t.s.concat(o.g)),t=ze(o,e),e.setTimeout(10000+Math.round(1e4*Math.random())),ce(o.c,e),En(e,n,t)}function He(n,o){n.f&&Fn({},function(e,t){Kn(o,t,e)})}function ze(r,t){var e=Math.min(r.g.length,1e3),n=r.f?f(r.f.Va,r.f,r):null;t:for(var o=r.g,i=-1,a;;){a=["count="+e],-1==i?0(c-=i))i=d(0,o[p].a-100),s=!1;else try{he(u,a,"req"+c+"_")}catch(e){n&&n(u)}}if(s){n=a.join("&");break t}}return r=r.g.splice(0,e),t.s=r,n}function Ge(n){if(!n.b&&!n.m){n.T=1;var t=n.Na;cr||jt(),dr||(cr(),dr=!0),lr.add(t,n),n.w=0}}function Ie(e){return e.b||e.m?(H(e.a,"Request already in progress"),!1):!(3<=e.w||(dn(e.a,"Going to retry GET"),e.T++,e.m=fn(f(e.Na,e),Be(e,e.w)),e.w++,0))}function Je(o,t,e){dn(o.a,"Test Connection Finished");var n=t.m;n&&vo(o.c,n),o.la=e,o.s=t.f,dn(o.a,"connectChannel_()"),o.F=Ae(o,o.ka),Ce(o)}function So(n,t){dn(n.a,"Test Connection Failed"),n.s=t.f,Fe(n,2)}function Eo(e){null!=e.o&&(Io.clearTimeout(e.o),e.o=null)}function Be(o,t){var e=5e3+a(1e4*Math.random());return o.ra()||(dn(o.a,"Inactive channel"),e*=2),e*t}function Fe(r,t){if(ln(r.a,"Error code "+t),2==t){var e=null;r.f&&(e=null);var n=f(r.hb,r);e||(e=new Hn("//www.google.com/images/cleardot.gif"),Io.location&&"http"==Io.location.protocol||L(e,"https"),Gn(e)),ie(""+e,n)}else mn(2);dn(r.a,"HttpChannel: error - "+t),r.G=0,r.f&&r.f.Ba(t),V(r),xe(r)}function V(n){if(n.G=0,n.s=-1,n.f){var t=de(n.c);0==t.length&&0==n.g.length||(dn(n.a,function(){return"Number of undelivered maps, pending: "+t.length+", outgoing: "+n.g.length}),n.c.c.length=0,et(n.g),n.g.length=0),n.f.Aa()}}function Ae(n,t){return t=ko(n,null,t),dn(n.a,"GetForwardChannelUri: "+t),t}function Ke(o,t,e){return t=ko(o,o.ia()?t:null,e),dn(o.a,"GetBackChannelUri: "+t),t}function ko(a,t,e){var n=Xn(e);if(""!=n.b)t&&jn(n,t+"."+n.b),qn(n,n.i);else{var r=Io.location,i;i=t?t+"."+r.hostname:r.hostname,n=Qn(r.protocol,i,r.port,e)}return a.U&&y(a.U,function(o,t){Kn(n,t,o)}),t=a.j,e=a.J,t&&e&&Kn(n,t,e),Kn(n,"VER",a.oa),He(a,n),n}function Le(){}function Me(){for(var t=arguments[0],e=1,n;ethis.c)throw Error(Ur);this.a=new Pe,this.b=new fo,this.g=null,this.ba()}function Ve(n){if("function"==typeof n.Z)n.Z();else for(var t in n)n[t]=null}function Xe(n,t){this.a=n,this.b=t}function Ye(o){if(this.a=[],o)t:{if(o instanceof Ye){var t=o.O();if(o=o.v(),0>=this.u()){for(var e=this.a,n=0;n>1,o[n].a>e.a);)o[t]=o[n],t=n;o[t]=e}function $e(){Ye.call(this)}function To(n,t){this.f=new $e,Ue.call(this,n,t)}function X(o,t,e,n){this.l=o,this.j=!!n,To.call(this,t,e)}var wo=wo||{},Io=this,k="closure_uid_"+(1e9*Math.random()>>>0),q=0,No=Date.now||function(){return+new Date},t;r(u,Error),u.prototype.name="CustomError";var g=String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};r(j,u),j.prototype.name="AssertionError";var Ao=0,Lo={};$.prototype.i=!1,$.prototype.Z=function(){},$.prototype.A=function(){if(this.w)for(;this.w.length;)this.w.shift()()};var Ro=Array.prototype.indexOf?function(n,t){return Array.prototype.indexOf.call(n,t,void 0)}:function(o,t){if(s(o))return s(t)&&1==t.length?o.indexOf(t,0):-1;for(var e=0;eparseFloat(Ho)){Wo=qo+"";break t}}Wo=Ho}var zo={},Ko=Io.document,Go;Go=Ko&&Fo?dt()||("CSS1Compat"==Ko.compatMode?parseInt(Wo,10):5):void 0;var Xo=Object.freeze||function(e){return e},Qo=!Fo||9<=+Go,Yo=Fo&&!lt("9"),Jo=function(){if(!Io.addEventListener||!Object.defineProperty)return!1;var n=!1,t=Object.defineProperty({},"passive",{get:function(){n=!0}});return Io.addEventListener("test",o,t),Io.removeEventListener("test",o,t),n}();pt.prototype.b=function(){this.Pa=!1},r(A,pt);var $o=Xo({2:"touch",3:"pen",4:"mouse"});A.prototype.b=function(){A.L.b.call(this);var e=this.c;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,Yo)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}};var Zo="closure_listenable_"+(0|1e6*Math.random()),er=0;mt.prototype.add=function(s,t,e,n,d){var o=""+s;(s=this.a[o])||(s=this.a[o]=[],this.b++);var i=yt(s,t,n,d);return-1>>0);r(Lt,$),Lt.prototype[Zo]=!0,t=Lt.prototype,t.addEventListener=function(o,t,e,n){bt(this,o,t,e,n)},t.removeEventListener=function(o,t,e,n){St(this,o,t,e,n)},t.dispatchEvent=function(d){var t=this.J,n;if(t)for(n=[];t;t=t.J)n.push(t);t=this.P;var e=d.type||d;if(s(d))d=new pt(d,t);else if(d instanceof pt)d.target=d.target||t;else{var r=d;d=new pt(e,t),at(d,r)}if(r=!0,n)for(var o=n.length-1,i;0<=o;o--)i=d.a=n[o],r=B(i,e,!0,d)&&r;if(i=d.a=t,r=B(i,e,!0,d)&&r,r=B(i,e,!1,d)&&r,n)for(o=0;o=D(this).value)for(h(t)&&(t=t()),o=new Jt(o,t+"",this.f),e&&(o.a=e),e=this;e;)e=e.a};var vr={},xr=null;F.prototype.Ea=function(){this.b=!1};var Cr=new Lt;r(cn,pt),r(hn,pt),r(J,pt);var Sr={NO_ERROR:0,jb:1,qb:2,pb:3,mb:4,ob:5,rb:6,Ra:7,TIMEOUT:8,ub:9},Er={lb:"complete",yb:"success",Sa:"error",Ra:"abort",wb:"ready",xb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",vb:"progress",nb:"downloadprogress",zb:"uploadprogress"};yn.prototype.a=null;var kr;r(vn,yn),kr=new vn;var Tr=45e3,wr=250,Ir={},Nr={};t=Sn.prototype,t.setTimeout=function(e){this.S=e},t.fb=function(n){n=n.target;var t=this.I;t&&3==pe(n)?(dn(this.b,"Throttling readystatechange."),t.Xa()):this.Qa(n)},t.Qa=function(n){try{n==this.a?wn(this):tn(this.b.a,"Called back with an unexpected xmlhttp")}catch(e){if(dn(this.b,"Failed call to OnXmlHttpReadyStateChanged_"),this.a&&this.a.V()){var t=this;I(this.b,e,function(){return"ResponseText: "+t.a.V()})}else I(this.b,e,"No response text")}},t.eb=function(){var n=pe(this.a),t=this.a.V();this.Ft&&this.la&&0==this.w&&!this.o&&(this.o=fn(f(this.$a,this),6e3)))}else if(this.b==n&&Eo(this),!/^[\s\xa0]*$/.test(t))for(t=e=this.ma.a.parse(t),e=0;et-this.g)){for(var e;0this.c&&0=r)o=void 0;else{if(1==r)Z(n);else{n[0]=n.pop(),n=0,l=l.a,r=l.length;for(var i=l[n];n>1;){var a=2*n+1,s=2*n+2;if(a=si.a)break;l[n]=l[a],n=a}l[n]=i}o=o.b}o.apply(this,[t])}},t.na=function(e){To.L.na.call(this,e),this.sa()},t.ba=function(){To.L.ba.call(this),this.sa()},t.A=function(){To.L.A.call(this),Io.clearTimeout(void 0),Z(this.f.a),this.f=null},r(X,To),X.prototype.qa=function(){var o=new ke,t=this.l;return t&&t.forEach(function(t,e){o.headers.set(e,t)}),this.j&&(o.m=!0),o},X.prototype.ta=function(e){return!e.i&&!e.a},Ne.prototype.createWebChannel=Ne.prototype.a,Oe.prototype.send=Oe.prototype.l,Oe.prototype.open=Oe.prototype.j,Oe.prototype.close=Oe.prototype.close,Sr.NO_ERROR=0,Sr.TIMEOUT=8,Sr.HTTP_ERROR=6,Er.COMPLETE="complete",po.EventType=Mr,Mr.OPEN="a",Mr.CLOSE="b",Mr.ERROR="c",Mr.MESSAGE="d",Lt.prototype.listen=Lt.prototype.aa,X.prototype.getObject=X.prototype.ea,X.prototype.releaseObject=X.prototype.gb,ke.prototype.listenOnce=ke.prototype.Ha,ke.prototype.getLastError=ke.prototype.Za,ke.prototype.getLastErrorCode=ke.prototype.Fa,ke.prototype.getStatus=ke.prototype.W,ke.prototype.getStatusText=ke.prototype.Ga,ke.prototype.getResponseJson=ke.prototype.Ya,ke.prototype.getResponseText=ke.prototype.V,ke.prototype.getResponseText=ke.prototype.V,ke.prototype.send=ke.prototype.fa,e.exports={createWebChannelTransport:ne,ErrorCode:Sr,EventType:Er,WebChannel:po,XhrIoPool:X}}).call(void 0===t?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:t)}).call(t,n(12))}},[113])}catch(e){throw Error("Cannot instantiate firebase-firestore.js - be sure to load firebase-app.js first.")} \ No newline at end of file diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit index b4446ae..e4e9978 100755 --- a/git-hooks/pre-commit +++ b/git-hooks/pre-commit @@ -1,9 +1,9 @@ #!/bin/sh # RUN PRETTIER -jsjsonfiles=$(git diff --staged --name-only | grep ".*\.\(js\|json\)") -echo "$jsjsonfiles" | xargs ./node_modules/.bin/prettier --single-quote --use-tabs --write -echo "$jsjsonfiles" | xargs git add +filesToPrettify=$(git diff --staged --name-only | grep ".*\.\(js\|json\|css\|md\)") +echo "$fileToPrettify" | xargs ./node_modules/.bin/prettier --single-quote --use-tabs --write +echo "$fileToPrettify" | xargs git add # Fetch .js or .json filed from staged files jsfiles=$(git diff --staged --name-only --diff-filter=ACM | grep '\.js$') @@ -11,7 +11,7 @@ jsfiles=$(git diff --staged --name-only --diff-filter=ACM | grep '\.js$') [ -z "$jsfiles" ] && exit 0 # ESLINT CHECK -eslintresult=$(./node_modules/.bin/eslint --ignore-pattern '/src/lib/*' --color $jsfiles --quiet) +eslintresult=$(./node_modules/.bin/eslint --ignore-pattern '/src/lib/*' --fix --color $jsfiles --quiet) if [[ $eslintresult != "" ]]; then echo "$eslintresult" diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..2f09c62 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,77 @@ +/*eslint-env node*/ + +const fs = require('fs'); +const gulp = require('gulp'); +const useref = require('gulp-useref'); +const cleanCSS = require('gulp-clean-css'); +const babelMinify = require('babel-minify'); + +function minifyJs(fileName) { + const content = fs.readFileSync(fileName, "utf8"); + const minifiedContent = babelMinify(content).code; + fs.writeFileSync(fileName, minifiedContent); + console.log(`[${fileName}]: ${content.length}kb -> ${minifiedContent.length}kb`) +} +gulp.task('copyFiles', [], function() { + gulp + .src('src/lib/codemirror/theme/*') + .pipe(gulp.dest('app/lib/codemirror/theme')); + gulp + .src('src/lib/codemirror/mode/**/*') + .pipe(gulp.dest('app/lib/codemirror/mode')); + gulp + .src('src/lib/transpilers/*') + .pipe(gulp.dest('app/lib/transpilers')); + gulp.src('src/partials/*').pipe(gulp.dest('app/partials')); + gulp.src('src/lib/screenlog.js').pipe(gulp.dest('app/lib')); + gulp.src('src/icon-48.png').pipe(gulp.dest('app')); + gulp + .src([ + 'src/FiraCode.ttf', + 'src/Fixedsys.ttf', + 'src/Inconsolata.ttf', + 'src/Monoid.ttf' + ]) + .pipe(gulp.dest('app')); +}); + +gulp.task('useRef', ['copyFiles'], function() { + return gulp + .src('src/index.html') + .pipe(useref()) + .pipe(gulp.dest('app')); +}); + +gulp.task('minify', ['useRef'], function() { + minifyJs('app/script.js'); + minifyJs('app/vendor.js'); + minifyJs('app/lib/screenlog.js'); + + gulp.src('app/*.css') + .pipe(cleanCSS({ debug: true }, (details) => { + console.log(`${details.name}: ${details.stats.originalSize}`); + console.log(`${details.name}: ${details.stats.minifiedSize}`); + })) + .pipe(gulp.dest('app')); +}); + +gulp.task('generate-service-worker', ['minify'], function(callback) { + var swPrecache = require('sw-precache'); + var rootDir = 'app'; + + swPrecache.write( + `${rootDir}/service-worker.js`, + { + staticFileGlobs: [ + rootDir + '/**/*.{js,html,css,png,jpg,gif,svg,eot,ttf,woff}' + ], + stripPrefix: `${rootDir}/`, + + // has to be increased to around 2.8mb for sass.worker.js + maximumFileSizeToCacheInBytes: 2900000 + }, + callback + ); +}); + +gulp.task('default', ['generate-service-worker']); diff --git a/package.json b/package.json index d40471f..ed1afb9 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,15 @@ "main": "index.html", "devDependencies": { "babel-eslint": "^7.2.3", + "babel-minify": "^0.2.0", "eslint": "^4.1.1", "eslint-config-prettier": "^2.3.0", - "prettier": "^1.5.2" + "gulp": "^3.9.1", + "gulp-clean-css": "^3.9.2", + "gulp-uglify": "^3.0.0", + "gulp-useref": "^3.1.3", + "prettier": "^1.10.2", + "sw-precache": "^5.2.0" }, "scripts": { "install": "ln -sf ../../git-hooks/pre-commit .git/hooks/pre-commit" @@ -16,7 +22,12 @@ "type": "git", "url": "git+https://github.com/chinchang/web-maker.git" }, - "keywords": ["frontend", "playground", "web", "editor"], + "keywords": [ + "frontend", + "playground", + "web", + "editor" + ], "author": "Kushagra Gour", "license": "MIT", "bugs": { @@ -24,6 +35,7 @@ }, "homepage": "https://webmakerapp.com", "dependencies": { + "@emmetio/codemirror-plugin": "^0.3.5", "babel-polyfill": "^6.23.0", "babel-standalone": "^6.25.0" } diff --git a/src/auth.js b/src/auth.js new file mode 100644 index 0000000..b39e023 --- /dev/null +++ b/src/auth.js @@ -0,0 +1,28 @@ +window.logout = function logout() { + firebase.auth().signOut(); +}; +function login(providerName) { + var provider; + if (providerName === 'facebook') { + provider = new firebase.auth.FacebookAuthProvider(); + } else if (providerName === 'twitter') { + provider = new firebase.auth.TwitterAuthProvider(); + } else if (providerName === 'google') { + provider = new firebase.auth.GoogleAuthProvider(); + provider.addScope('https://www.googleapis.com/auth/userinfo.profile'); + } else { + provider = new firebase.auth.GithubAuthProvider(); + } + + return firebase + .auth() + .signInWithPopup(provider) + .then(function() {}) + .catch(function(error) { + alert( + 'You have already signed up with the same email using different social login' + ); + utils.log(error); + }); +} +window.login = login; diff --git a/src/db.js b/src/db.js new file mode 100644 index 0000000..3e91a0f --- /dev/null +++ b/src/db.js @@ -0,0 +1,140 @@ +(() => { + const FAUX_DELAY = 1; + + var db; + var dbPromise; + + var local = { + get: (obj, cb) => { + const retVal = {}; + if (typeof obj === 'string') { + retVal[obj] = JSON.parse(window.localStorage.getItem(obj)); + setTimeout(() => cb(retVal), FAUX_DELAY); + } else { + Object.keys(obj).forEach(key => { + const val = window.localStorage.getItem(key); + retVal[key] = + val === undefined || val === null ? obj[key] : JSON.parse(val); + }); + setTimeout(() => cb(retVal), FAUX_DELAY); + } + }, + set: (obj, cb) => { + Object.keys(obj).forEach(key => { + window.localStorage.setItem(key, JSON.stringify(obj[key])); + }); + /* eslint-disable consistent-return */ + setTimeout(() => { + if (cb) { + return cb(); + } + }, FAUX_DELAY); + /* eslint-enable consistent-return */ + } + }; + const dbLocalAlias = chrome && chrome.storage ? chrome.storage.local : local; + const dbSyncAlias = chrome && chrome.storage ? chrome.storage.sync : local; + + async function getDb() { + if (dbPromise) { + return dbPromise; + } + utils.log('Initializing firestore'); + dbPromise = new Promise((resolve, reject) => { + if (db) { + return resolve(db); + } + return firebase + .firestore() + .enablePersistence() + .then(function() { + // Initialize Cloud Firestore through firebase + db = firebase.firestore(); + utils.log('firebase db ready', db); + resolve(db); + }) + .catch(function(err) { + reject(err.code); + if (err.code === 'failed-precondition') { + // Multiple tabs open, persistence can only be enabled + // in one tab at a a time. + // ... + } else if (err.code === 'unimplemented') { + // The current browser does not support all of the + // features required to enable persistence + // ... + } + }); + }); + return dbPromise; + } + + async function getUserLastSeenVersion() { + const d = deferred(); + // Will be chrome.storage.sync in extension environment, + // otherwise will fallback to localstorage + dbSyncAlias.get( + { + lastSeenVersion: '' + }, + result => { + d.resolve(result.lastSeenVersion); + } + ); + return d.promise; + // Might consider getting actual value from remote db. + // Not critical right now. + } + + async function setUserLastSeenVersion(version) { + if (window.IS_EXTENSION) { + chrome.storage.sync.set( + { + lastSeenVersion: version + }, + function() {} + ); + return; + } + // Settings the lastSeenVersion in localStorage also because next time we need + // to fetch it irrespective of the user being logged in or out + local.set({ lastSeenVersion: version }); + if (window.user) { + const remoteDb = await getDb(); + remoteDb + .doc(`users/${window.user.uid}`) + .update({ lastSeenVersion: version }); + } + } + + async function getUser(userId) { + const remoteDb = await getDb(); + return remoteDb.doc(`users/${userId}`).get().then(doc => { + if (!doc.exists) + return remoteDb.doc(`users/${userId}`).set({}, { merge: true }); + const user = doc.data(); + Object.assign(window.user, user); + return user; + }); + } + + function getSettings(defaultSettings) { + const d = deferred(); + // Will be chrome.storage.sync in extension environment, + // otherwise will fallback to localstorage + dbSyncAlias.get(defaultSettings, result => { + d.resolve(result); + }); + return d.promise; + } + + window.db = { + getDb, + getUser, + getUserLastSeenVersion, + setUserLastSeenVersion, + getSettings, + local: dbLocalAlias, + sync: dbSyncAlias + }; +})(); diff --git a/src/index.html b/src/index.html index f529491..650c049 100644 --- a/src/index.html +++ b/src/index.html @@ -2,22 +2,43 @@ Web Maker + + + + - - - + + + + + + +