(function(a){if(typeof exports=="object"&&typeof module=="object")a(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],a);else a(CodeMirror)})(function(a){"use strict";a.defineMode("css",function(b,c){var d=c.inline;if(!c.propertyKeywords)c=a.resolveMode("text/css");var e=b.indentUnit,f=c.tokenHooks,g=c.documentTypes||{},h=c.mediaTypes||{},i=c.mediaFeatures||{},j=c.mediaValueKeywords||{},k=c.propertyKeywords||{},l=c.nonStandardPropertyKeywords||{},m=c.fontProperties||{},n=c.counterDescriptors||{},o=c.colorKeywords||{},p=c.valueKeywords||{},q=c.allowNested,r=c.lineComment,s=c.supportsAtComponent===true;var t,u;function v(a,b){t=b;return a}function w(a,b){var c=a.next();if(f[c]){var d=f[c](a,b);if(d!==false)return d}if(c=="@"){a.eatWhile(/[\w\\\-]/);return v("def",a.current())}else if(c=="="||(c=="~"||c=="|")&&a.eat("=")){return v(null,"compare")}else if(c=='"'||c=="'"){b.tokenize=x(c);return b.tokenize(a,b)}else if(c=="#"){a.eatWhile(/[\w\\\-]/);return v("atom","hash")}else if(c=="!"){a.match(/^\s*\w*/);return v("keyword","important")}else if(/\d/.test(c)||c=="."&&a.eat(/\d/)){a.eatWhile(/[\w.%]/);return v("number","unit")}else if(c==="-"){if(/[\d.]/.test(a.peek())){a.eatWhile(/[\w.%]/);return v("number","unit")}else if(a.match(/^-[\w\\\-]*/)){a.eatWhile(/[\w\\\-]/);if(a.match(/^\s*:/,false))return v("variable-2","variable-definition");return v("variable-2","variable")}else if(a.match(/^\w+-/)){return v("meta","meta")}}else if(/[,+>*\/]/.test(c)){return v(null,"select-op")}else if(c=="."&&a.match(/^-?[_a-z][_a-z0-9-]*/i)){return v("qualifier","qualifier")}else if(/[:;{}\[\]\(\)]/.test(c)){return v(null,c)}else if(a.match(/[\w-.]+(?=\()/)){if(/^(url(-prefix)?|domain|regexp)$/.test(a.current().toLowerCase())){b.tokenize=y}return v("variable callee","variable")}else if(/[\w\\\-]/.test(c)){a.eatWhile(/[\w\\\-]/);return v("property","word")}else{return v(null,null)}}function x(a){return function(b,c){var d=false,e;while((e=b.next())!=null){if(e==a&&!d){if(a==")")b.backUp(1);break}d=!d&&e=="\\"}if(e==a||!d&&a!=")")c.tokenize=null;return v("string","string")}}function y(a,b){a.next();if(!a.match(/\s*[\"\')]/,false))b.tokenize=x(")");else b.tokenize=null;return v(null,"(")}function z(a,b,c){this.type=a;this.indent=b;this.prev=c}function A(a,b,c,d){a.context=new z(c,b.indentation()+(d===false?0:e),a.context);return c}function B(a){if(a.context.prev)a.context=a.context.prev;return a.context.type}function C(a,b,c){return F[c.context.type](a,b,c)}function D(a,b,c,d){for(var e=d||1;e>0;e--)c.context=c.context.prev;return C(a,b,c)}function E(a){var b=a.current().toLowerCase();if(p.hasOwnProperty(b))u="atom";else if(o.hasOwnProperty(b))u="keyword";else u="variable"}var F={};F.top=function(a,b,c){if(a=="{"){return A(c,b,"block")}else if(a=="}"&&c.context.prev){return B(c)}else if(s&&/@component/i.test(a)){return A(c,b,"atComponentBlock")}else if(/^@(-moz-)?document$/i.test(a)){return A(c,b,"documentTypes")}else if(/^@(media|supports|(-moz-)?document|import)$/i.test(a)){return A(c,b,"atBlock")}else if(/^@(font-face|counter-style)/i.test(a)){c.stateArg=a;return"restricted_atBlock_before"}else if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(a)){return"keyframes"}else if(a&&a.charAt(0)=="@"){return A(c,b,"at")}else if(a=="hash"){u="builtin"}else if(a=="word"){u="tag"}else if(a=="variable-definition"){return"maybeprop"}else if(a=="interpolation"){return A(c,b,"interpolation")}else if(a==":"){return"pseudo"}else if(q&&a=="("){return A(c,b,"parens")}return c.context.type};F.block=function(a,b,c){if(a=="word"){var d=b.current().toLowerCase();if(k.hasOwnProperty(d)){u="property";return"maybeprop"}else if(l.hasOwnProperty(d)){u="string-2";return"maybeprop"}else if(q){u=b.match(/^\s*:(?:\s|$)/,false)?"property":"tag";return"block"}else{u+=" error";return"maybeprop"}}else if(a=="meta"){return"block"}else if(!q&&(a=="hash"||a=="qualifier")){u="error";return"block"}else{return F.top(a,b,c)}};F.maybeprop=function(a,b,c){if(a==":")return A(c,b,"prop");return C(a,b,c)};F.prop=function(a,b,c){if(a==";")return B(c);if(a=="{"&&q)return A(c,b,"propBlock");if(a=="}"||a=="{")return D(a,b,c);if(a=="(")return A(c,b,"parens");if(a=="hash"&&!/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(b.current())){u+=" error"}else if(a=="word"){E(b)}else if(a=="interpolation"){return A(c,b,"interpolation")}return"prop"};F.propBlock=function(a,b,c){if(a=="}")return B(c);if(a=="word"){u="property";return"maybeprop"}return c.context.type};F.parens=function(a,b,c){if(a=="{"||a=="}")return D(a,b,c);if(a==")")return B(c);if(a=="(")return A(c,b,"parens");if(a=="interpolation")return A(c,b,"interpolation");if(a=="word")E(b);return"parens"};F.pseudo=function(a,b,c){if(a=="meta")return"pseudo";if(a=="word"){u="variable-3";return c.context.type}return C(a,b,c)};F.documentTypes=function(a,b,c){if(a=="word"&&g.hasOwnProperty(b.current())){u="tag";return c.context.type}else{return F.atBlock(a,b,c)}};F.atBlock=function(a,b,c){if(a=="(")return A(c,b,"atBlock_parens");if(a=="}"||a==";")return D(a,b,c);if(a=="{")return B(c)&&A(c,b,q?"block":"top");if(a=="interpolation")return A(c,b,"interpolation");if(a=="word"){var d=b.current().toLowerCase();if(d=="only"||d=="not"||d=="and"||d=="or")u="keyword";else if(h.hasOwnProperty(d))u="attribute";else if(i.hasOwnProperty(d))u="property";else if(j.hasOwnProperty(d))u="keyword";else if(k.hasOwnProperty(d))u="property";else if(l.hasOwnProperty(d))u="string-2";else if(p.hasOwnProperty(d))u="atom";else if(o.hasOwnProperty(d))u="keyword";else u="error"}return c.context.type};F.atComponentBlock=function(a,b,c){if(a=="}")return D(a,b,c);if(a=="{")return B(c)&&A(c,b,q?"block":"top",false);if(a=="word")u="error";return c.context.type};F.atBlock_parens=function(a,b,c){if(a==")")return B(c);if(a=="{"||a=="}")return D(a,b,c,2);return F.atBlock(a,b,c)};F.restricted_atBlock_before=function(a,b,c){if(a=="{")return A(c,b,"restricted_atBlock");if(a=="word"&&c.stateArg=="@counter-style"){u="variable";return"restricted_atBlock_before"}return C(a,b,c)};F.restricted_atBlock=function(a,b,c){if(a=="}"){c.stateArg=null;return B(c)}if(a=="word"){if(c.stateArg=="@font-face"&&!m.hasOwnProperty(b.current().toLowerCase())||c.stateArg=="@counter-style"&&!n.hasOwnProperty(b.current().toLowerCase()))u="error";else u="property";return"maybeprop"}return"restricted_atBlock"};F.keyframes=function(a,b,c){if(a=="word"){u="variable";return"keyframes"}if(a=="{")return A(c,b,"top");return C(a,b,c)};F.at=function(a,b,c){if(a==";")return B(c);if(a=="{"||a=="}")return D(a,b,c);if(a=="word")u="tag";else if(a=="hash")u="builtin";return"at"};F.interpolation=function(a,b,c){if(a=="}")return B(c);if(a=="{"||a==";")return D(a,b,c);if(a=="word")u="variable";else if(a!="variable"&&a!="("&&a!=")")u="error";return"interpolation"};return{startState:function(a){return{tokenize:null,state:d?"block":"top",stateArg:null,context:new z(d?"block":"top",a||0,null)}},token:function(a,b){if(!b.tokenize&&a.eatSpace())return null;var c=(b.tokenize||w)(a,b);if(c&&typeof c=="object"){t=c[1];c=c[0]}u=c;if(t!="comment")b.state=F[b.state](t,a,b);return u},indent:function(a,b){var c=a.context,d=b&&b.charAt(0);var f=c.indent;if(c.type=="prop"&&(d=="}"||d==")"))c=c.prev;if(c.prev){if(d=="}"&&(c.type=="block"||c.type=="top"||c.type=="interpolation"||c.type=="restricted_atBlock")){c=c.prev;f=c.indent}else if(d==")"&&(c.type=="parens"||c.type=="atBlock_parens")||d=="{"&&(c.type=="at"||c.type=="atBlock")){f=Math.max(0,c.indent-e)}}return f},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:r,fold:"brace"}});function b(a){var b={};for(var c=0;c