extjs-gpl
Version:
GPL licensed version of Sencha Ext JS
1 lines • 85.1 kB
JavaScript
"use strict";function _possibleConstructorReturn(a,b){if(!a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return !b||"object"!=typeof b&&"function"!=typeof b?a:b}function _inherits(b,a){if("function"!=typeof a&&null!==a){throw new TypeError("Super expression must either be null or a function, not "+typeof a)}b.prototype=Object.create(a&&a.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),a&&(Object.setPrototypeOf?Object.setPrototypeOf(b,a):b.__proto__=a)}function _classCallCheck(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function _defineProperty(c,a,b){return a in c?Object.defineProperty(c,a,{value:b,enumerable:!0,configurable:!0,writable:!0}):c[a]=b,c}var _get=function get(b,e,d){null===b&&(b=Function.prototype);var f=Object.getOwnPropertyDescriptor(b,e);if(void 0===f){var c=Object.getPrototypeOf(b);return null===c?void 0:get(c,e,d)}if("value" in f){return f.value}var a=f.get;if(void 0!==a){return a.call(d)}},_createClass=function(){function a(e,c){for(var b=0;b<c.length;b++){var d=c[b];d.enumerable=d.enumerable||!1,d.configurable=!0,"value" in d&&(d.writable=!0),Object.defineProperty(e,d.key,d)}}return function(d,b,c){return b&&a(d.prototype,b),c&&a(d,c),d}}(),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a};!function(b){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module){module.exports=b()}else{if("function"==typeof define&&define.amd){define([],b)}else{var a;a="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,a.Fashion=b()}}}(function(){return function a(c,g,e){function d(m,j){if(!g[m]){if(!c[m]){var i="function"==typeof require&&require;if(!j&&i){return i(m,!0)}if(b){return b(m,!0)}var k=Error("Cannot find module '"+m+"'");throw k.code="MODULE_NOT_FOUND",k}var h=g[m]={exports:{}};c[m][0].call(h.exports,function(l){var o=c[m][1][l];return d(o?o:l)},h,h.exports,a,c,g,e)}return g[m].exports}for(var b="function"==typeof require&&require,f=0;f<e.length;f++){d(e[f])}return d}({1:[function(d,g,b){var f,h=d("./src/export/Base.js"),c=d("./src/export/css/CssVariableManager.js"),e=new c;h.apply(h,(f={css:e,CssExport:c,Types:d("./src/export/type/Types.js"),ValueParser:d("./src/export/parse/ValueParser.js"),Type:d("./src/export/type/Type.js"),Bool:d("./src/export/type/Bool.js"),Literal:d("./src/export/type/Literal.js"),ParentheticalExpression:d("./src/export/type/ParentheticalExpression.js"),Text:d("./src/export/type/Text.js"),Numeric:d("./src/export/type/Numeric.js"),List:d("./src/export/type/List.js"),Map:d("./src/export/type/Map.js"),Color:d("./src/export/type/Color.js"),ColorRGBA:d("./src/export/type/ColorRGBA.js"),ColorHSLA:d("./src/export/type/ColorHSLA.js"),ColorStop:d("./src/export/type/ColorStop.js"),FunctionCall:d("./src/export/type/FunctionCall.js"),LinearGradient:d("./src/export/type/LinearGradient.js"),RadialGradient:d("./src/export/type/RadialGradient.js"),Statics:d("./src/export/type/Statics.js"),SourceBuilder:d("./src/export/type/SourceBuilder.js")},_defineProperty(f,"Types",d("./src/export/type/Types.js")),_defineProperty(f,"TypeVisitor",d("./src/export/type/TypeVisitor.js")),_defineProperty(f,"Output",d("./src/export/Output.js")),_defineProperty(f,"Runtime",d("./src/export/Runtime.js")),f)),g.exports=h},{"./src/export/Base.js":3,"./src/export/Output.js":4,"./src/export/Runtime.js":5,"./src/export/css/CssVariableManager.js":6,"./src/export/parse/ValueParser.js":7,"./src/export/type/Bool.js":8,"./src/export/type/Color.js":9,"./src/export/type/ColorHSLA.js":10,"./src/export/type/ColorRGBA.js":11,"./src/export/type/ColorStop.js":12,"./src/export/type/FunctionCall.js":13,"./src/export/type/LinearGradient.js":14,"./src/export/type/List.js":15,"./src/export/type/Literal.js":16,"./src/export/type/Map.js":17,"./src/export/type/Numeric.js":18,"./src/export/type/ParentheticalExpression.js":19,"./src/export/type/RadialGradient.js":20,"./src/export/type/SourceBuilder.js":21,"./src/export/type/Statics.js":22,"./src/export/type/Text.js":23,"./src/export/type/Type.js":24,"./src/export/type/TypeVisitor.js":25,"./src/export/type/Types.js":26}],2:[function(e,f,d){function c(h){return h.replace(/\-/g,"_").replace(/\//g,"_fs_").replace(/\\/g,"_bs_")}var b=function(){function h(){_classCallCheck(this,h),this.variableNameMap={}}return _createClass(h,[{key:"convertName",value:function(i){var k=this.variableNameMap,j=k[i];return void 0===j&&(j=k[i]=c(i)),j}}]),h}(),g=new b;f.exports={NameConverter:b,getJsName:function(h){return g.convertName(h)}}},{}],3:[function(k,f,z){function x(){}function r(E,D){if(E=E||{},D){for(var C in D){E[C]=D[C]}}return E}function h(C,D){C=C||{};var E,G,F;if(D){for(E in D){G=D[E],G&&G.constructor===Object?(F=C[E],F&&F.constructor===Object?h(F,G):C[E]=G):C[E]=G}}return C}function b(C,D){return D&&D.isFashionScanner?C+=": "+D.currentFile+":"+D.lineNumber:D&&(C+=": "+D.file+":"+D.lineNumber),C}function d(C){return C&&"function"==typeof C}function o(C,D){console.log(b("[DBG] "+C,D))}function i(C,D){console.log(b("[LOG] "+C,D))}function u(C,D){console.log(b("[INF] "+C,D))}function t(C,D){console.log(b("[WRN] "+C,D))}function s(C,D){console.log(b("[ERR] "+C,D))}function v(D,C){throw"string"!=typeof D&&(C=D,D=C.message,delete C.message),r(Error(D),C)}function l(D,E){var C;E&&(D=b(D,E),C=E.isFashionScanner?{file:E.currentFile,lineNumber:E.lineNumber}:{node:E,lineNumber:E.lineNumber,file:E.file}),v(D,C)}function m(G,F){for(var C=[],D=0;D<G.length;D++){var E=G[D];F(E,D)&&C.push(E)}return C}function j(F,D){for(var E=[],C=0;C<F.length;C++){E.push(D(F[C]))}return E}function w(C){return C.length&&C[0]}function c(C){return C.length&&C[C.length-1]}function B(C){return C.length>2?C.slice(1):[]}function e(I,E){for(var D,C,J,H,F=[],G={};I&&I!==E;I=Object.getPrototypeOf(I)){for(H=Object.getOwnPropertyNames(I),D=0,J=H.length;D<J;++D){C=H[D],G[C]||(G[C]=!0,F.push(C))}}return F}function q(H,D){Array.isArray(D)||(D=Array.prototype.slice.call(arguments,1));for(var F=H.prototype,C=0;C<D.length;C++){var G=D[C],E=G.prototype;e(E,n.prototype).forEach(function(I){I in E&&(I in F||(F[I]=E[I]))})}}function A(G,F,C){C=C||[],F=void 0===F?1000:F;for(var D=0;D<G.length;D++){var E=G[D];Array.isArray(E)&&F?A(E,F-1,C):C.push(E)}return C}var g=k("./../NameConverter.js"),n=function n(C){_classCallCheck(this,n),C&&h(this,C)},y=function(){function C(){_classCallCheck(this,C)}return _createClass(C,[{key:"first",value:function(){return w(this.items)}},{key:"last",value:function(){return c(this.items)}},{key:"tail",value:function(){return B(this.items)}}]),C}();y.prototype.items=null;var p=Object.create||function(C){return x.prototype=C,new x};f.exports={EmptyArray:[],getJsName:g.getJsName,chain:p,Base:n,BaseSet:y,apply:r,merge:h,createMessage:b,isFunction:d,debug:o,log:i,info:u,warn:t,error:s,raise:v,raiseAt:l,filter:m,convert:j,first:w,last:c,tail:B,mixin:q,flatten:A}},{"./../NameConverter.js":2}],4:[function(d,f,c){var g=d("./Base.js"),e=g.Base,b=function(i){function h(){_classCallCheck(this,h);var j=_possibleConstructorReturn(this,Object.getPrototypeOf(h).call(this));return j.output="",j}return _inherits(h,i),_createClass(h,[{key:"space",value:function(){this.add(" ")}},{key:"add",value:function(j){this.output+=j}},{key:"addComment",value:function(j){this.output+=j}},{key:"indent",value:function(){this.indentation+=this.indentstr}},{key:"unindent",value:function(){this.indentation=this.indentation.substr(this.indentstr.length)}},{key:"addln",value:function(j){this.output+="\n"+this.indentation+(j||"")}},{key:"addCommentLn",value:function(j){j&&0===j.indexOf("//")||this.addln(j)}},{key:"get",value:function(){return this.output}},{key:"indentln",value:function(j){this.addln(j),this.indent()}},{key:"unindentln",value:function(j){this.unindent(),this.addln(j)}},{key:"reset",value:function(){this.indentation="",this.output=""}}]),h}(e);g.apply(b.prototype,{indentation:"",output:"",isCompressed:!1,indentstr:" ",splitThreshold:1000000,selectorCount:0}),f.exports=b},{"./Base.js":3}],5:[function(k,f,m){var d=k("./Base.js"),n=d.Base,b=k("./type/Type.js"),r=k("./type/List.js"),o=k("./type/Bool.js"),e=k("./type/Color.js"),q=k("./type/ColorRGBA.js"),j=k("./type/Text.js"),i=k("./type/Literal.js"),h=k("./type/Statics.js"),g=k("./type/TypeVisitor.js"),l=k("./type/Types.js"),p=function(){function s(t){_classCallCheck(this,s),this.prev=t,this.map={}}return _createClass(s,[{key:"get",value:function(t){for(var v,w=this.map,u=this;w;){if(v=w[t]){return v}u=u.prev,w=u&&u.map}return v}},{key:"has",value:function(t){for(var v=this.map,u=this;v;){if(t in v){return !0}u=u.prev,v=u&&u.map}return !1}},{key:"put",value:function(t,u){return this.map[t]=u,u}},{key:"addEntries",value:function(u){this.prev&&this.prev.addEntries(u);for(var t in this.map){u[t]=this.map[t]}}},{key:"getEntries",value:function(t){return t=t||{},this.addEntries(t),t}}]),s}();d.apply(p.prototype,{$isScope:!0,map:void 0,prev:void 0,resetScope:void 0});var c=function(s){function u(v){_classCallCheck(this,u);var x=_possibleConstructorReturn(this,Object.getPrototypeOf(u).call(this,v)),w=x;return w.mixins={},w.functions={},w.processors=[],w.registered={box:h.boxType,unbox:h.unboxType,isArray:function(y){return Array.isArray(y)},getRuntime:function(){return w},handleArgs:function(B,E){for(var C,D={},A=0,z=0;z<B.length;z++){var y=B[z];if(void 0!==y){if(y===!0||y===!1){D[E[A]]=y,A++}else{if(void 0===y.type){for(C in y){D[C.replace(/^\$/,"")]=y[C]}}else{C=E[A],C instanceof Array?(C=C[0],D[C]=D[C]||new r,D[C].add(y)):(D[C]=y,A++)}}}}return D},sliceArgs:function(z,A,y){return this.getRuntime().sliceArgs(z,A,y).items},tailArgs:function(A,z){var y=Array.prototype.slice.call(z,A);return 1==y.length&&this.isArray(y)&&(y=y[0]),y}},x}return _inherits(u,s),_createClass(u,[{key:"bool",value:function(v){return new o(v)}},{key:"color",value:function t(x){var w=e.map[x],v=new q(w[0],w[1],w[2],w[3]);return v.stringified=x,v}},{key:"quote",value:function(v){return"string"===v.type?v:new j(""+v)}},{key:"unquote",value:function(v){return v.$isFashionType?v.unquote():new i(""+v)}},{key:"not",value:function(v){return this.box(0==this.unbox(v))}},{key:"reset",value:function(){this._currentScope=null,this._globalScope=this.createScope(),this._dynamics={}}},{key:"run",value:function(w,v){return this.load(w),this.compile(w),this.execute(v)}},{key:"createTypesBlock",value:function(x){x=x||this.types;for(var v,y=Object.getOwnPropertyNames(x),z=[],w=0;w<y.length;w++){v=y[w],z.push(v+" = Types."+v),z.push("__"+v+" = "+v)}return 0===z.length?"":"var "+z.join(",\n ")+";\n"}},{key:"createMethodBlock",value:function(y){y=y||this.constructor.prototype;for(var x,v,z=[];y;){x=Object.getOwnPropertyNames(y);for(var w=0;w<x.length;w++){v=x[w],"function"==typeof y[v]&&z.push("__rt_"+v+" = __rt."+v+".bind(__rt)")}y=Object.getPrototypeOf(y)}return 0===z.length?"":"var "+z.join(",\n ")+";\n"}},{key:"createPropertyBlock",value:function(){for(var v,x=Object.getOwnPropertyNames(this),y=[],w=0;w<x.length;w++){v=x[w],y.push("__rt_"+v+" = __rt."+v)}return 0===y.length?"":"var "+y.join(",\n ")+";\n"}},{key:"createPrefixedFunctionBody",value:function(v){return v=this.createTypesBlock()+this.createMethodBlock()+this.createPropertyBlock()+v}},{key:"createWrappedFn",value:function(v){return Function("Types","__rt","__gs","__udf","__dyn",this.createPrefixedFunctionBody(v))}},{key:"callWrappedFn",value:function(w,v){return w(d,this,this._globalScope,void 0,v||{})}},{key:"compile",value:function(w){var x,v=this;return this.code=w,x=this.createWrappedFn(w),this.fn=function(y,C,B){var A=y||v,z=B||{};return A.reset(),C&&(C.$isScope?A._globalScope=C:A._globalScope.map=C),B&&(A._dynamics=B),A._currentScope=A._globalScope,A._scopeStack=[A._currentScope],x(v.types,A,A._globalScope,void 0,z),A._globalScope},this.fn}},{key:"execute",value:function(v){return this.fn(this,v)}},{key:"load",value:function(v){return this.code=v,this}},{key:"registerProcessor",value:function(v){this.processors.push(new g(v))}},{key:"register",value:function(v){v.dynamic&&(d.error('Cannot register javascript function named "dynamic"'),delete v.dynamic),v.require&&(d.error('Cannot register javascript function named "require"'),delete v.require),d.apply(this.registered,v)}},{key:"isRegistered",value:function(v){return v=this.reserved[v]?"__"+v:v,!!this.registered[v]}},{key:"getGlobalScope",value:function(){return this._globalScope}},{key:"getCurrentScope",value:function(){return this._currentScope}},{key:"getRegisteredFunctions",value:function(){return this.registered}},{key:"getFunctions",value:function(){return this.functions}},{key:"getMixins",value:function(){return this.mixins}},{key:"createScope",value:function(w){var v=w||this._currentScope,x=new p(v);return this.pushScope(x)}},{key:"pushScope",value:function(v){return v.resetScope=this._currentScope,this._currentScope=v,v}},{key:"popScope",value:function(){return this._currentScope=this._currentScope.resetScope,this._currentScope}},{key:"get",value:function(v){var x=this.getScopeForName(v),w=x.map[v];return void 0===w&&(v in x.map||d.raise("Reference to undeclared variable : "+v)),this.box(w)}},{key:"getScopeForName",value:function(v){for(var w=this._currentScope;w;){if(v in w.map){return w}w=w.prev}return this._currentScope}},{key:"getDefault",value:function(v){if(null!=v&&void 0!==v){if(!v.$isFashionNull){return this.box(v)}if(this.constructor.allowNullDefaults){return v}}}},{key:"getGlobalDefault",value:function(v){var w=this._globalScope.get(v);return this.getDefault(w)}},{key:"getLocalDefault",value:function(v){var w=this._currentScope.get(v);return this.getDefault(w)}},{key:"setGlobal",value:function(w,y,x){var v=this._globalScope;return y&&y.$isFashionLiteral||(y=this.box(y)),y.ast=y.ast||this.getAstNode(x),v.map[w]=y,y}},{key:"setDynamic",value:function(x,z,y){var A,w=d.getJsName(x),v=this._globalScope;return z&&z.$isFashionLiteral||(z=this.box(z)),z.ast=z.ast||this.getAstNode(y),z.$referenceName||z.$constant?(A=z.clone(),A.$previousReference=z,z=A,z.ast=this.getAstNode(y)):z.$referenceName=x,v.map[w]=z,z}},{key:"setScoped",value:function(w,x){var v=this.getScopeForName(w);return x&&x.$isFashionLiteral||(x=this.box(x)),v.map[w]=x,x}},{key:"set",value:function(w,x){var v=this._currentScope;return x&&x.$isFashionLiteral||(x=this.box(x)),v.map[w]=x,x}},{key:"getDocs",value:function(v){if(this.docCache){return this.docCache.get(v)}}},{key:"getString",value:function(v){if(this.stringCache){return this.stringCache.get(v)}}},{key:"getAstNode",value:function(v){if(this.nodeCache){return this.nodeCache.get(v)}}},{key:"applySplat",value:function(v){return v.splat=!0,v}},{key:"sliceArgs",value:function(B,v,x){v=v||0,x=x||B.length;var z,C,D,A=[],w=[],y=", ";for(C=v;C<x;C++){D=B[C],D?D.splat&&D.$isFashionList?(z&&A.push(z),z=D,y=z.separator||y):A.push(D):z||A.push(D)}for(C=0;C<A.length;C++){D=A[C],y=D&&D.splatSeparator||y,w.push(A[C])}return z&&w.push.apply(w,z.items),new r(w,y)}},{key:"applySplatArgs",value:function(z){var v,x,B,A,y,w=[];for(x=0;x<z.length;x++){if(v=z[x],v&&v.splat&&v.$isFashionList){for(y=v.getItems(),A=0;A<y.length;A++){B=y[A],B&&(B.splatSeparator=v.separator),w.push(B)}}else{w.push(v)}v&&(v.splat=void 0)}return w}},{key:"warn",value:function(){d.warn.apply(d,arguments)}},{key:"debug",value:function(){d.debug.apply(d,arguments)}},{key:"setCaches",value:function(v){this.docCache=v.docCache,this.stringCache=v.stringCache,this.nodeCache=v.nodeCache}},{key:"copyRuntimeState",value:function(v){this._dynamics=v._dynamics,this.registered=v.registered,this.functions=v.functions,this.mixins=v.mixins}},{key:"test",value:function(v){return v=this.unbox(v),null!=v&&v!==!1}},{key:"and",value:function(w,v){return this.test(w)?v:w}},{key:"or",value:function(w,v){return this.test(w)?w:v}}]),u}(n);d.apply(c.prototype,{box:b.box,unbox:b.unbox,Scope:p,isFashionRuntime:!0,functions:null,code:null,fn:null,stringCache:null,docCache:null,types:l,_globalScope:null,_currentScope:null,_dynamics:null,context:null,reserved:{"if":!0,"else":!0}}),f.exports=c},{"./Base.js":3,"./type/Bool.js":8,"./type/Color.js":9,"./type/ColorRGBA.js":11,"./type/List.js":15,"./type/Literal.js":16,"./type/Statics.js":22,"./type/Text.js":23,"./type/Type.js":24,"./type/TypeVisitor.js":25,"./type/Types.js":26}],6:[function(e,g,b){var i=e("../Base.js"),f=e("../Runtime.js"),d=e("../parse/ValueParser.js"),h=e("../type/SourceBuilder.js"),c=function(){function j(){_classCallCheck(this,j),this.reset()}return _createClass(j,[{key:"reset",value:function(){this.initFns=[],this.calcFns=[],this.variableMap={},this.runtime=null}},{key:"createRuntime",value:function(){return new f}},{key:"getRuntime",value:function(){var m=this,k=m.runtime;if(!k){k=m.createRuntime();for(var l=0;l<m.initFns.length;l++){m.initFns[l](k)}m.runtime=k}return k}},{key:"calculate",value:function(p){var u,v,s,m,r,w,t,q=this,n=q.getRuntime(),l=new d,k=q.variableMap;v=new n.Scope;for(m in p){u=i.getJsName(m.replace(q.nameRe,"")),0!==u.indexOf("$")&&(u="$"+u),v.put(u,l.parse(p[m]))}n._globalScope=v,n._currentScope=v;for(var o=0;o<q.calcFns.length;o++){q.calcFns[o](n)}s=new h,p={};for(m in k){r=k[m];for(var o=0;o<r.length;o++){u=r[o],w="$"+i.getJsName(u),t=v.get(w),t&&(t.$isWrapper&&(t=t.value),p[u]=s.toSource(t))}}return p}},{key:"applyVariables",value:function(q){var r=this,k=r.variableMap;for(var l in k){var s=k[l],n=document.querySelectorAll(l);if(n){for(var p=0;p<n.length;p++){for(var o=0;o<s.length;o++){var m=s[o];n[p].style.setProperty("--"+m,q[m])}}}}}},{key:"setVariables",value:function(k){this.applyVariables(this.calculate(k))}},{key:"register",value:function(p,l,o){if(p&&this.initFns.push(p),l&&this.calcFns.push(l),o){var n=this.variableMap;for(var k in o){var m=n[k];m?m.push.apply(m,o[k]):n[k]=o[k]}}}},{key:"buildName",value:function(k){return k.replace(/^--/,"").replace(/^\$/,"")}},{key:"buildJsName",value:function(k){return i.getJsName(k)}},{key:"buildNames",value:function(m){var l,k={};for(l in m){k[l]=this.buildName(m[l])}return k}},{key:"buildJsNames",value:function(m){var l,k={};for(l in m){k[l]=this.buildJsName(m[l])}return k}},{key:"getVariables",value:function(){var r=this,k=r.variableMap,o={};for(var l in k){var s=k[l],n=document.querySelectorAll(l);if(n){for(var q=0;q<n.length;q++){for(var p=0;p<s.length;p++){var m=s[p];o[m]=n[q].style.getPropertyValue("--"+m)}}}}return o}}]),j}();i.apply(c.prototype,{$isExport:!0,nameRe:/^--/}),g.exports=c},{"../Base.js":3,"../Runtime.js":5,"../parse/ValueParser.js":7,"../type/SourceBuilder.js":21}],7:[function(j,e,m){var c=j("../Base.js"),b=j("../type/Type.js"),l=(j("../type/Statics.js"),j("../type/Types.js")),d=l.Color,i=l.Text,h=l.Numeric,q=l.List,n=l.Bool,g=l.Literal,p=l.ColorRGBA,o=l.ColorHSLA,f=l.FunctionCall,k=function(){function r(){_classCallCheck(this,r),this.index=0}return _createClass(r,[{key:"_advance",value:function(){for(var u,v=this,z="",y=v.str,t=y.length,s=!1,x=!1,w=0;v.index<t;){if(u=y[v.index],v.index++,u<=" "&&!s&&!w){if(z.length){break}}else{if(";"===u&&!s&&!x){break}if("("===u&&w++,")"===u&&w&&w--,","===u&&!s&&!x&&!w){if(z.length){v.index--;break}return u}"\\"===u&&s?(x=1,v.index++):('"'!==u&&"'"!==u||(s?s===u&&(iSstring=!1):s=u),x=!1,z+=u)}}return z}},{key:"parseValue",value:function(x){var w,y,z={number:/^(\d+)(px|pt|pc|cm|mm|in|em|rem|ex)?$/g,shortHexColor:/^#([A-Fa-f0-9]{3})$/,longHexColor:/^#([A-Fa-f0-9]{6})$/,functionCall:/^([A-Za-z0-9_]+)\((.*)\)$/,parenList:/^\((.*?)\)$/};if('"'===x[0]||"'"===x[0]){return y=x=x.substring(1,x.length-1),new i(y,x[0])}if("true"===x){return new n((!0))}if("false"===x){return new n((!1))}if("null"===x){return g.Null}if("none"===x){return g.None}if(c.Color.map[x]){var v=d.map[x],s=new p(v[0],v[1],v[2],v[3]);return s.stringified=x,s}if(w=z.number.exec(x)){return new h(parseFloat(w[1]),w[2])}if(w=z.shortHexColor.exec(x)){return p.fromHex(w[1])}if(w=z.longHexColor.exec(x)){return p.fromHex(w[1])}if(w=z.functionCall.exec(x)){var u=w[1],t=this.parse(w[2]).items;return"hsla"===u||"hsl"===u?new o(b.unbox(t[0]),b.unbox(t[1]),b.unbox(t[2]),b.unbox(t[3])||1):"rgba"===u||"rgb"===u?new p(b.unbox(t[0]),b.unbox(t[1]),b.unbox(t[2]),b.unbox(t[3])||1):new f(u,t)}return(w=z.parenList.exec(x))?new f(this.parse(w[1])):new c.Literal(x)}},{key:"parse",value:function(y){var v,w=this,x=[],t=[],s=null;for(w.str=y,w.index=0;v=w._advance();){x.push(v)}for(var u=0;u<x.length;u++){v=x[u].trim(),","===x[u+1]?(s=s||[],s.push(w.parseValue(v)),u++):s?(s.push(w.parseValue(v)),t.push(new q(s,", ")),s=null):t.push(w.parseValue(v))}return 1===t.length?t[0]:new q(t," ")}}]),r}();e.exports=k},{"../Base.js":3,"../type/Statics.js":22,"../type/Type.js":24,"../type/Types.js":26}],8:[function(d,e,c){var f=d("../Base.js"),b=d("./Type.js"),g=function(h){function i(k){_classCallCheck(this,i);var j=_possibleConstructorReturn(this,Object.getPrototypeOf(i).call(this));return j.value=!!k,j}return _inherits(i,h),_createClass(i,[{key:"doVisit",value:function(j){j.bool(this)}},{key:"toString",value:function(){return this.value?"true":"false"}},{key:"copy",value:function(){return new i(this.value)}}]),i}(b);f.apply(g.prototype,{type:"bool",$isFashionBool:!0,value:null}),g.True=new g((!0)),g.True.$constant=!0,g.False=new g((!1)),g.False.$constant=!0,e.exports=g},{"../Base.js":3,"./Type.js":24}],9:[function(e,f,d){var g=e("../Base.js"),c=e("./Type.js"),i=e("./Bool.js"),b=e("./Numeric.js"),h=function(j){function k(){return _classCallCheck(this,k),_possibleConstructorReturn(this,Object.getPrototypeOf(k).call(this))}return _inherits(k,j),_createClass(k,[{key:"toBoolean",value:function(){return i.True}},{key:"getRGBA",value:function(){return this}},{key:"getHSLA",value:function(){return this}}],[{key:"component",value:function(m,n){var l,p=k.units[n],o=k.types[n],q=k.comps[n];return l="hsla"==o?m.getHSLA():m.getRGBA(),new b(l[q],p)}},{key:"adjust",value:function(m,n,o){var l=m.getHSLA().copy(),q=k.comps[n],p=o.value;return l[q]+=p,l.h=k.constrainDegrees(l.h),l.s=k.constrainPercentage(l.s),l.l=k.constrainPercentage(l.l),l.getRGBA()}},{key:"constrainChannel",value:function(l){return Math.max(0,Math.min(l,255))}},{key:"constrainPercentage",value:function(l){return Math.max(0,Math.min(l,100))}},{key:"constrainDegrees",value:function(l){return l%=360,l<0?360+l:l}},{key:"constrainAlpha",value:function(l){return void 0===l?1:Math.max(0,Math.min(l,1))}}]),k}(c);g.apply(h,{units:{lightness:"%",saturation:"%",hue:"deg"},types:{red:"rgba",blue:"rgba",green:"rgba",alpha:"rgba",hue:"hsla",saturation:"hsla",lightness:"hsla"},comps:{red:"r",green:"g",blue:"b",alpha:"a",hue:"h",saturation:"s",lightness:"l"},map:{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5],transparent:[0,0,0,0]}}),g.apply(h.prototype,{type:"color",$isFashionColor:!0,$isFashionRGBA:!1,$isFashionHSLA:!1,$canUnbox:!1}),f.exports=h},{"../Base.js":3,"./Bool.js":8,"./Numeric.js":18,"./Type.js":24}],10:[function(d,e,c){var f=d("../Base.js"),g=d("./Color.js"),h=d("./ColorRGBA.js"),b=function(j){function i(p,o,m,k){_classCallCheck(this,i);var n=_possibleConstructorReturn(this,Object.getPrototypeOf(i).call(this));return n.h=g.constrainDegrees(p),n.s=o,n.l=m,void 0!==k&&(n.a=k),n}return _inherits(i,j),_createClass(i,[{key:"doVisit",value:function(k){k.hsla(this)}},{key:"operate",value:function(k,l){return this.getRGBA().operate(k,l)}},{key:"copy",value:function(){return new i(this.h,this.s,this.l,this.a)}},{key:"getRGBA",value:function(){return h.fromHSLA(this)}},{key:"toString",value:function(){return""+this.getRGBA()}},{key:"add",value:function(o,n,m,k){return new i(g.constrainDegrees(this.h+o),g.constrainPercentage(this.s+n),g.constrainPercentage(this.l+m),g.constrainAlpha(this.a*k))}},{key:"subtract",value:function(n,m,k){return this.add(-n,-m,-k)}},{key:"adjustLightness",value:function(k){return this.l=g.constrainPercentage(this.l+k),this}},{key:"adjustHue",value:function(k){return this.h=g.constrainDegrees(this.h+k),this}}],[{key:"fromRGBA",value:function(n){if(n.$isFashionHSLA){return n.clone()}var k=n.r/255,q=n.g/255,t=n.b/255,v=n.a,u=Math.max(k,q,t),o=Math.min(k,q,t),w=u-o,p=0,x=0,m=0.5*(u+o);return o!=u&&(x=m<0.5?w/(u+o):w/(2-u-o),p=k==u?60*(q-t)/w:q==u?120+60*(t-k)/w:240+60*(k-q)/w,p<0&&(p+=360),p>=360&&(p-=360)),new i(g.constrainDegrees(p),g.constrainPercentage(100*x),g.constrainPercentage(100*m),v)}}]),i}(g);h.prototype.getHSLA=function(){return b.fromRGBA(this)},f.apply(b.prototype,{type:"hsla",$isFashionHSLA:!0,h:null,s:null,l:null,a:1}),e.exports=b},{"../Base.js":3,"./Color.js":9,"./ColorRGBA.js":11}],11:[function(d,e,c){function b(i){var j=i.toString(16);return j.length<2&&(j="0"+j),j}var f=d("../Base.js"),g=d("./Color.js"),h=function(i){function j(o,n,k,l){_classCallCheck(this,j);var m=_possibleConstructorReturn(this,Object.getPrototypeOf(j).call(this));return m.r=Math.min(255,Math.max(0,o)),m.g=Math.min(255,Math.max(0,n)),m.b=Math.min(255,Math.max(0,k)),void 0!==l&&(m.a=Math.min(1,Math.max(0,l))),m}return _inherits(j,i),_createClass(j,[{key:"doVisit",value:function(k){k.rgba(this)}},{key:"copy",value:function(){return new j(this.r,this.g,this.b,this.a)}},{key:"getHSLA",value:function(){return null}},{key:"stringify",value:function(){var q=this,m=Math.round,p=m(q.r),o=m(q.g),k=m(q.b),l=q.a,n="";return n=1===l?"#"+b(p)+b(o)+b(k):"rgba("+p+", "+o+", "+k+", "+l+")",n=n.toLowerCase()}},{key:"getCompressedValue",value:function(m){var l=j.stringifiedMap[m],k=j.shortFormMap[m];return l&&(m=m.length>l.length?l:m),j.useShortValues&&k&&(m=m.length>k.length?k:m),m}},{key:"toString",value:function(){return this.stringified||(this.stringified=this.getCompressedValue(this.stringify())),this.stringified}},{key:"toIeHexStr",value:function(){var p=this,m=Math.round,o=m(p.r),n=m(p.g),k=m(p.b),l=m(255*p.a);return"#"+b(l)+b(o)+b(n)+b(k)}},{key:"add",value:function(n,m,k,l){return new j(this.r+n,this.g+m,this.b+k,this.a*l)}},{key:"subtract",value:function(m,l,k){return new j(this.r-m,this.g-l,this.b-k,this.a)}},{key:"multiply",value:function(k){return new j(this.r*k,this.g*k,this.b*k,this.a)}},{key:"divide",value:function(k){return new j(this.r/k,this.g/k,this.b/k,this.a)}}],[{key:"fromHex",value:function(o){"#"==o.charAt(0)&&(o=o.substr(1));var n,m,l;3===o.length?(n=parseInt(o.charAt(0),16),m=parseInt(o.charAt(1),16),l=parseInt(o.charAt(2),16),n=(n<<4)+n,m=(m<<4)+m,l=(l<<4)+l):(n=parseInt(o.substring(0,2),16),m=parseInt(o.substring(2,4),16),l=parseInt(o.substring(4,6),16));var k=new j(n,m,l);return j.preserveInputStrings&&(k.stringified="#"+o),k}},{key:"fromHSLA",value:function(o){function t(l){return l<0&&++l,l>1&&--l,6*l<1?x+(w-x)*l*6:2*l<1?w:3*l<2?x+(w-x)*(2/3-l)*6:x}if(o.$isFashionRGBA){return o.clone()}var m=o,p=m.h/360,y=m.s/100,n=m.l/100,v=m.a,w=n<=0.5?n*(y+1):n+y-n*y,x=2*n-w,k=g.constrainChannel(255*t(p+1/3)),q=g.constrainChannel(255*t(p)),u=g.constrainChannel(255*t(p-1/3));return new j(k,q,u,v)}}]),j}(g);f.apply(h,{stringifiedMap:{"rgba(0, 0, 0, 0)":"transparent"},shortFormMap:{},useShortValues:!0,preserveInputStrings:!1}),f.apply(h.prototype,{type:"rgba",$isFashionRGBA:!0,r:null,g:null,b:null,a:1,stringified:null,"+.number":function(i){var k=i.value,j=i.unit;switch(j){case"%":return this.getHSLA().adjustLightness(k).getRGBA();case"deg":return this.getHSLA().adjustHue(k).getRGBA();default:return this.add(k,k,k,1)}},"+.rgba":function(i){return this.add(i.r,i.g,i.b,i.a)},"+.hsla":function(i){return this.getHSLA().add(i.h,i.s,i.l)},"-.number":function(i){var k=i.value,j=i.unit;switch(j){case"%":return this.getHSLA().adjustLightness(-k).getRGBA();case"deg":return this.getHSLA().adjustHue(-k).getRGBA();default:return this.subtract(k,k,k)}},"-.rgba":function(i){return this.subtract(i.r,i.g,i.b)},"-.hsla":function(i){return this.getHSLA().subtract(i.h,i.s,i.l)},"*.number":function(i){return this.multiply(i.value)},"/.number":function(i){return this.divide(i.value)},"*.rgba":function(i){return new h(this.r*i.r,this.g*i.g,this.b*i.b,this.a*i.a)},"/.rgba":function(i){return new h(Math.floor(this.r/i.r),Math.floor(this.g/i.g),Math.floor(this.b/i.b),Math.floor(this.a/i.a))}}),e.exports=h,function(s,o,l,q){var n,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],r=Object.keys(l);for(r.sort(),n=0;n<r.length;n++){var j=r[n],k=l[j],m=new s(k[0],k[1],k[2],k[3]),p=m.stringify();o[p]=j}t.forEach(function(i){var u=i+i;t.forEach(function(v){var w=v+v;t.forEach(function(y){var A=y+y,x="#"+i+v+y,z="#"+u+w+A;if(q[z]){var B=q[z];x=B.length>x.length?x:B}q[z]=x})})})}(h,h.stringifiedMap,g.map,h.shortFormMap)},{"../Base.js":3,"./Color.js":9}],12:[function(f,g,e){var h=f("../Base.js"),d=f("./Type.js"),b=f("./Numeric.js"),c=function(j){function i(l,m){_classCallCheck(this,i);var k=_possibleConstructorReturn(this,Object.getPrototypeOf(i).call(this));return k.color=l,k.stop=m,k}return _inherits(i,j),_createClass(i,[{key:"doVisit",value:function(k){k.colorstop(this)}},{key:"descend",value:function(k){k.visit(this.color),k.visit(this.stop)}},{key:"toString",value:function(){var k=""+this.color,l=this.stop;return l&&(l=l.copy(),k+=" ",l.unit||(l.value*=100,l.unit="%"),k+=""+l),k}},{key:"toOriginalWebkitString",value:function(){var k=this.stop;return k||(k=new b(0,"%")),k=k.copy(),k.unit||(k.value*=100,k.unit="%"),"color-stop("+k+", "+this.color+")"}},{key:"copy",value:function(){return new i(this.color,this.stop)}}]),i}(d);h.apply(c.prototype,{type:"colorstop",$isFashionColorStop:!0,$canUnbox:!1,color:null,stop:null}),g.exports=c},{"../Base.js":3,"./Numeric.js":18,"./Type.js":24}],13:[function(d,f,c){var g=d("../Base.js"),b=d("./Type.js"),e=d("./List.js"),h=function(i){function j(m,l){_classCallCheck(this,j);var k=_possibleConstructorReturn(this,Object.getPrototypeOf(j).call(this));return k.name=m,Array.isArray(l)&&(l=new e(l)),k.args=l,k}return _inherits(j,i),_createClass(j,[{key:"toString",value:function(){var k,l=this.args;return k=Array.isArray(l)?l.join(", "):""+l,this.name+"("+k+")"}},{key:"doVisit",value:function(k){k.functioncall(this)}},{key:"descend",value:function(k){this.args&&k.visit(this.args)}},{key:"copy",value:function(){return new j(this.name,this.args&&this.args.copy())}}]),j}(b);g.apply(h.prototype,{type:"functioncall",$isFashionFunctionCall:!0,$canUnbox:!1,name:null,args:null}),f.exports=h},{"../Base.js":3,"./List.js":15,"./Type.js":24}],14:[function(d,e,c){var g=d("../Base.js"),b=d("./Type.js"),f=function(h){function i(j,k){_classCallCheck(this,i);var l=_possibleConstructorReturn(this,Object.getPrototypeOf(i).call(this));return l.position=j,l.stops=k,l}return _inherits(i,h),_createClass(i,[{key:"doVisit",value:function(j){j.lineargradient(this)}},{key:"descend",value:function(j){j.visit(this.position),j.visit(this.stops)}},{key:"copy",value:function(){return new i(this.position,this.stops)}},{key:"gradientPoints",value:function(j){}},{key:"operate",value:function(j,k){switch(j){case"!=":if("literal"==k.type&&("null"==k.value||"none"==k.value)){return !0}case"==":if("literal"==k.type&&("null"==k.value||"none"==k.value)){return !1}}return _get(Object.getPrototypeOf(i.prototype),"operate",this).call(this,j,k)}},{key:"supports",value:function(j){return !!this.vendorPrefixes[j.toLowerCase()]}},{key:"toString",value:function(){var j="linear-gradient(";return this.position&&(j+=this.position+", "),j+this.stops+")"}},{key:"toOriginalWebkitString",value:function(){var k,j=[],m=this.stops.items,l=m.length;for(j.push("top"),j.push("bottom"),k=0;k<l;k++){j.push(m[k].toOriginalWebkitString())}return"-webkit-gradient(linear, "+j.join(", ")+")"}},{key:"toPrefixedString",value:function(j){return"owg"===j?this.toOriginalWebkitString():j+(""+this)}}]),i}(b);g.apply(f.prototype,{type:"lineargradient",$isFashionLinearGradient:!0,$canUnbox:!1,position:null,stops:null,vendorPrefixes:{webkit:!0,moz:!0,svg:!0,pie:!0,css2:!0,o:!0,owg:!0}}),e.exports=f},{"../Base.js":3,"./Type.js":24}],15:[function(d,f,c){var g=d("../Base.js"),b=d("./Type.js"),e=function(h){function i(j,l){_classCallCheck(this,i);var k=_possibleConstructorReturn(this,Object.getPrototypeOf(i).call(this));return k.items=j||[],k.separator=void 0===l?" ":l,k}return _inherits(i,h),_createClass(i,[{key:"doVisit",value:function(j){j.list(this)}},{key:"descend",value:function(k){for(var j=0;j<this.items.length;j++){k.visit(this.items[j])}}},{key:"copy",value:function(){for(var k=this.items,j=k.length,l=[],m=0;m<j;m++){l.push(k[m].clone())}return new i(l,this.separator)}},{key:"clone",value:function(m,o){if(o&&this.matches(m)){return o.clone()}for(var k=this.items,j=k.length,l=[],n=0;n<j;n++){l.push(k[n].clone(m,o))}var p=new i(l,this.separator);return p.$referenceName=this.$referenceName,p.$referenceBase=this.$referenceBase,p.$previousReference=this.$previousReference,p}},{key:"add",value:function(j){return this.items.push(j)}},{key:"get",value:function(j){return this.items[j-1]||null}},{key:"operate",value:function(j,k){switch(j){case"!=":if(k.$isFashionLiteral&&("null"===k.value||"none"===k.value)){return !0}break;case"==":if(k.$isFashionLiteral&&("null"===k.value||"none"===k.value)){return !1}}return _get(Object.getPrototypeOf(i.prototype),"operate",this).call(this,j,k)}},{key:"supports",value:function(l){for(var j=0;j<this.items.length;j++){var k=this.items[j];if(k.supports(l)){return !0}}return !1}},{key:"toBoolean",value:function(){return !!this.items.length}},{key:"getItems",value:function(){return g.filter(this.items,function(j){var k=b.unbox(j);return null!==k&&void 0!==k})}},{key:"toString",value:function(){return this.items.join(this.separator)}},{key:"unquote",value:function(){for(var j=[],k=0;k<this.items.length;k++){this.items[k]&&j.push(this.items[k].unquote())}return new i(j,this.separator)}},{key:"toPrefixedString",value:function(m){for(var j=[],k=0;k<this.items.length;k++){var l=this.items[k];l&&j.push(l.toPrefixedString(m))}return j.join(this.separator)}},{key:"==.list",value:function(k){for(var l=this.separator==k.separator&&this.items.length==k.items.length,j=0;l&&j<this.items.length;++j){l=this.items[j].operate("==",k.items[j])}return l}}]),i}(b);g.apply(e.prototype,{type:"list",$isFashionList:!0,items:null,separator:null}),f.exports=e},{"../Base.js":3,"./Type.js":24}],16:[function(f,g,e){var h=f("../Base.js"),d=f("./Type.js"),b=f("./Numeric.js"),c=function(k){function j(m){_classCallCheck(this,j);var l=_possibleConstructorReturn(this,Object.getPrototypeOf(j).call(this));return l.value=m,l}return _inherits(j,k),_createClass(j,[{key:"doVisit",value:function(l){l.literal(this)}},{key:"getHash",value:function(){return this.value}},{key:"toString",value:function(){return this.value||""}},{key:"toBoolean",value:function(){return this.value.length}},{key:"copy",value:function(){return new j(this.value)}},{key:"+",value:function(l){return new j(this.value+l.getHash())}},{key:"+.number",value:function(l){return null===this.value?l:new j(this.value+(""+l))}},{key:"/",value:function(l){return new j(this.value+"/"+l.getHash())}},{key:"-",value:function(l){return new j(this.value+"-"+l.getHash())}},{key:"%",value:function(l){return new j(this.value+"%"+l.getHash())}},{key:"normalizeStart",value:function(l){var m=d.unbox(l)||0;return m>0&&(m-=1),m<0&&(m=this.value.length+m),m<0&&(m=0),m}},{key:"normalizeEnd",value:function(m){var l=d.unbox(m)||-1;return l>0&&(l-=1),l<0&&(l=this.value.length+l),l<0&&(l=0),l>0&&(l+=1),l}},{key:"slice",value:function(m,l){return m=this.normalizeStart(m),l=this.normalizeEnd(l),new j(this.value.slice(m,l))}},{key:"toUpperCase",value:function(){return new j(this.value.toUpperCase())}},{key:"toLowerCase",value:function(){return new j(this.value.toLowerCase())}},{key:"indexOf",value:function(m){var l=this.value.indexOf(m.value);if(l!==-1){return new b(l+1)}}},{key:"insert",value:function(n,l){var o=d.unbox(l)||0,m=this.value;return o>0&&(o=Math.min(o-1,m.length)),o<0&&(o=m.length+o+1,o=Math.max(o,0)),m=m.substring(0,o)+n.value+m.substring(o),new j(j.deEscape(m))}}],[{key:"tryCoerce",value:function(l){if(!l.$isFashionNumber){return l.$isFashionString?new j(l.value):l.$isFashionLiteral?l:new j(l.getHash())}}},{key:"deEscape",value:function(n){var l,m,o="";for(l=0;l<n.length;l++){m=n.charAt(l),"\\"===m&&(l++,m=n.charAt(l)),o+=m}return o}}]),j}(d);h.apply(c.prototype,{type:"literal",$isFashionLiteral:!0,value:null});var i=function(k){function j(l){return _classCallCheck(this,j),_possibleConstructorReturn(this,Object.getPrototypeOf(j).call(this,l||null))}return _inherits(j,k),_createClass(j,[{key:"copy",value:function(){return new j(this.value)}}]),j}(c);h.apply(i.prototype,{$isFashionNull:!0,$constant:!0}),i.prototype.$isFashionNull=!0,c.Null=new i(null),c.None=new c("none"),g.exports=c},{"../Base.js":3,"./Numeric.js":18,"./Type.js":24}],17:[function(g,e,i){var c=g("../Base.js"),k=g("./List.js"),b=g("./Type.js"),h=g("./Literal.js"),j=h.Null,f=g("./Numeric.js"),d=function(l){function m(q){_classCallCheck(this,m);var p=_possibleConstructorReturn(this,Object.getPrototypeOf(m).call(this,q));if(p.map={},q){for(var o=0;o<q.length-1;o+=2){var n=p.toKey(q[o]);q[o+1];p.map[n]=o+1}}return p}return _inherits(m,l),_createClass(m,[{key:"doVisit",value:function(n){n.map(this)}},{key:"descend",value:function(o){for(var n=0;n<this.items.length;n++){o.visit(this.items[n])}}},{key:"get",value:function(n){return n instanceof f&&(n=b.unbox(n)),"number"==typeof n?new k([this.items[2*n-2],this.items[2*n-1]]," "):(n=this.toKey(n),this.items[this.map[n]]||j)}},{key:"getItems",value:function(){for(var n=[],p=0;p<this.items.length-1;p+=2){var o=this.toKey(this.items[p]);n.push(this.map[o])}return n}},{key:"put",value:function(o,p){var n=this.toKey(o);this.map.hasOwnProperty(n)?this.items[this.map[n]]=p:(this.items.push(o,p),this.map[n]=this.items.length-1)}},{key:"toString",value:function(){for(var r="",p=0,o=0;o<this.items.length-1;o+=2){var n=this.toKey(this.items[o]),q=this.map[n];q&&(p>0&&(r+=", "),r+=n+": "+q,p++)}return r}},{key:"toKey",value:function(n){return""+this.unquoteKey(n)}},{key:"unquoteKey",value:function(n){return n.$isFashionType?n.unquote():n}}]),m}(k);c.apply(d.prototype,{type:"map",$isFashionMap:!0,$canUnbox:!1,map:null}),e.exports=d},{"../Base.js":3,"./List.js":15,"./Literal.js":16,"./Numeric.js":18,"./Type.js":24}],18:[function(f,g,e){var h=f("../Base.js"),d=f("./Type.js"),i=f("./Bool.js"),c=f("./Literal.js"),b=function(k){function j(o,n,p,m){_classCallCheck(this,j);var l=_possibleConstructorReturn(this,Object.getPrototypeOf(j).call(this));return l.value=o,l.unit=n,n&&!p?l.numeratorUnits=[n]:l.numeratorUnits=p||[],l.denominatorUnits=m||[],l}return _inherits(j,k),_createClass(j,[{key:"doVisit",value:function(l){l.number(this)}},{key:"unitless",value:function(){return(!this.numeratorUnits||!this.numeratorUnits.length)&&(!this.denominatorUnits||!this.denominatorUnits.length)}},{key:"getUnitStr",value:function(){this.normalizeUnits();var l=this.numeratorUnits.join("*");return this.denominatorUnits.length&&(l+="/"+this.denominatorUnits.join("*")),l}},{key:"getHash",value:function(){return this.value}},{key:"stringify",value:function(){this.normalizeUnits();var l,m=this.value;return l=Math.round(100000*m)/100000+"",l+this.getUnitStr()}},{key:"toString",value:function(){return this.stringify()}},{key:"toBoolean",value:function(){return !!this.unit||!!this.value}},{key:"copy",value:function(){return new j(this.value,this.unit)}},{key:"-.literal",value:function(l){return new c(0===this.value&&this.unitless()?"-"+l:""+this+"-"+l)}},{key:"-.string",value:function(l){return new c(0===this.value&&this.unitless()?"-"+l:""+this+"-"+l)}},{key:"-.number",value:function(l){var m=l.value;return"%"==l.unit&&l.unit!==this.unit&&(m=this.value*(l.value/100)),new j(this.value-m,this.unit||l.unit)}},{key:"+.literal",value:function(l){return new c(l.$isFashionString?""+this+l.value:""+this+(""+l))}},{key:"+.number",value:function(l){var m=l.value;return"%"==l.unit&&l.unit!==this.unit&&(m=this.value*(l.value/100)),new j(this.value+m,this.unit||l.unit)}},{key:"/",value:function(l){return new j(this.value/l.value,this.unit==l.unit?null:this.unit||l.unit)}},{key:"*",value:function(l){return new j(this.value*l.value,this.unit||l.unit)}},{key:"%",value:function(l){return new j(this.value%l.value,this.unit||l.unit)}},{key:"**",value:function(l){return new j(Math.pow(this.value,l.value),this.unit||l.unit)}},{key:"operate",value:function(l,m){var n;this.unit||m.unit;return m.$isFashionRGBA||m.$isFashionHSLA?new c(this+l+m):m.$isFashionNumber?this.numericOperate(l,m):m.$isFashionLiteral&&(n=this.tryCoerce(m))?this.performOperation(l,n):_get(Object.getPrototypeOf(j.prototype),"operate",this).call(this,l,m)}},{key:"tryNormalize",value:function(l){var n=l.value,m=l.unit;if(l.$isFashionNumber){switch(this.unit){case"mm":switch(m){case"in":return new j(25.4*n,"mm");case"cm":return new j(2.54*n,"mm")}break;case"cm":switch(m){case"in":return new j(2.54*n,"cm");case"mm":return new j(n/10,"cm")}break;case"in":switch(m){case"mm":return new j(n/25.4,"in");case"cm":return new j(n/2.54,"in")}break;case"ms":switch(m){case"s":return new j(1000*n,"ms")}break;case"s":switch(m){case"ms":return new j(n/1000,"s")}break;case"Hz":switch(m){case"kHz":return new j(1000*n,"Hz")}break;case"kHz":switch(m){case"Hz":return new j(n/1000,"kHz")}break;case"%":switch(m){default:return new j(n)}}}}},{key:"normalize",value:function(l){var m=this.tryNormalize(l);return void 0===m&&raise("Could not normalize "+this+" with "+l),m}},{key:"comparable",value:function(l){var n=this.unit,m=l.unit;return !!l.$isFashionNumber&&(n===m||"mm"===n&&("in"===m||"cm"===m)||"cm"===n&&("in"===m||"mm"===m)||"in"===n&&("mm"===m||"cm"===m)||"ms"===n&&"s"===m||"s"===n&&"ms"===m||"Hz"===n&&"kHz"===m||"kHz"===n&&"Hz"===m)}},{key:"normalizeUnits",value:function(){if(!this.normalized&&(this.normalized=!0,!this.unitless())){var l=this.removeCommonUnits(this.numeratorUnits,this.denominatorUnits);l.num=h.filter(l.num,function(m){return !!m}),l.den=h.filter(l.den,function(m){return !!m}),this.numeratorUnits=l.num,this.denominatorUnits=l.den}}},{key:"numericOperate",value:function(n,t){this.normalizeUnits(),t.normalizeUnits();var u,s=this,r=t,m=j.OPERATIONS,l=j.NON_COERCE_OPERATIONS,o=m[n];if(o){try{s.unitless()?s=s.coerceUnits(r.numeratorUnits,r.denominatorUnits):r=r.coerceUnits(s.numeratorUnits,s.denominatorUnits)}catch(q){if("=="==n){return i.False}if("!="==n){return i.True}throw q}}else{o=l[n]}if(o&&(u=o(s.value,r.value)),"number"==typeof u){var p=this.computeUnits(s,r,n);return new j(u,p.num.length?p.num[0]:null,p.num,p.den)}return new i(u)}},{key:"computeUnits",value:function(m,l,n){switch(n){case"*":return{num:m.numeratorUnits.slice().concat(l.numeratorUnits),den:m.denominatorUnits.slice().concat(l.denominatorUnits)};case"/":return{num:m.numeratorUnits.slice().concat(l.denominatorUnits),den:m.denominatorUnits.slice().concat(l.numeratorUnits)};default:return{num:m.numeratorUnits,den:m.denominatorUnits}}}},{key:"coerceUnits",value:function(l,m){var n=this.value;return this.unitless()||(n=n*this.coercionFactor(this.numeratorUnits,l)/this.coercionFactor(this.denominatorUnits,m)),new j(n,l&&l[0],l,m)}},{key:"coercionFactor",value:function(r,m){var s=this.removeCommonUnits(r,m),u=s.num,o=s.den;u.length===o.length&&this.convertable(u||o)||h.raise("Incompatible units: "+u.join("*")+" and "+o.join("*"));for(var q=0;q<u.length;q++){for(var n=u[q],p=0;p<o.length;p++){var l=o[p],t=this.conversionFactor(n,l);if(null!==t){return t}}}return 1}},{key:"conversionFactor",value:function(o,n){var p=j.CONVERTABLE_UNITS,l=j.CONVERSION_TABLE,m=null;return p[o]&&p[n]&&(m=l[p[o]][p[n]]),null===m&&p[n]&&p[o]&&(m=1/l[p[n]][p[o]]),m}},{key:"convertable",value:function(l){if(l&&!Array.isArray(l)&&(l=[l]),l&&l.length){for(var n=j.CONVERTABLE_UNITS,m=0;m<l.length;m++){if(void 0===n[l[m]]){return !1}}}return !0}},{key:"removeCommonUnits",value:function(n,o){var m,p,p,q={},l=[],r=[];for(m=0;m<n.length;m++){p=n[m],q[p]=(q[p]||0)+1}for(m=0;m<o.length;m++){p=o[m],q[p]=(q[p]||0)-1}for(m=0;m<n.length;m++){p=n[m],q[p]>0&&(l.push(p),q[p]--)}for(m=0;m<o.length;m++){p=o[m],q[p]<0&&(r.push(p),q[p]++)}return{num:l,den:r}}}],[{key:"tryGetNumber",value:function(l){if(/^\d*$/.test(l)&&(l=parseFloat(l)),!isNaN(l)){return new j(l)}}},{key:"tryCoerce",value:function(l){return l.$isFashionNumber?l:l.$isFashionLiteral?this.tryGetNumber(l.value):void 0}}]),j}(d);h.apply(b,{OPERATIONS:{"!=":function(j,k){return j!=k},"+":function(j,k){return j+k},"-":function(j,k){return j-k},"<=":function(j,k){return j<=k},"<":function(j,k){return j<k},">":function(j,k){return j>k},">=":function(j,k){return j>=k},"==":function(j,k){return j==k},"%":function(j,k){return Math.abs(j%k)}},NON_COERCE_OPERATIONS:{"*":function(j,k){return j*k},"**":function(j,k){return Math.pow(j,k)},"/":function(j,k){return j/k}},CONVERTABLE_UNITS:{"in":0,cm:1,pc:2,mm:3,pt:4,px:5},CONVERSION_TABLE:[[1,2.54,6,25.4,72,96],[null,1,2.36220473,10,28.3464567,37.795276],[null,null,1,4.23333333,12,16],[null,null,null,1,2.83464567,3.7795276],[null,null,null,null,1,1.3333333],[null,null,null,null,null,1]]}),h.apply(b.prototype,{type:"number",$isFashionNumber:!0,value:void 0,unit:void 0,numeratorUnits:void 0,denominatorUnits:void 0,normalized:!1}),g.exports=b},{"../Base.js":3,"./Bool.js":8,"./Literal.js":16,"./Type.js":24}],19:[function(e,f,d){var g=e("../Base.js"),c=e("./Type.js"),b=function(i){function h(k){_classCallCheck(this,h);var j=_possibleConstructorReturn(this,Object.getPrototypeOf(h).call(this));return j.value=k,j}return _inherits(h,i),_createClass(h,[{key:"toString",value:function(){return"("+this.value+")"}},{key:"doVisit",value:function(j){j.parenthetical(this)}}]),h}(c);g.apply(b.prototype,{value:null,type:"parenthetical"}),f.exports=b},{"../Base.js":3,"./Type.js":24}],20:[function(e,f,d){var g=e("../Base.js"),c=e("./Type.js"),b=function(h){function i(j,l,m){_classCallCheck(this,i);var k=_possibleConstructorReturn(this,Object.getPrototypeOf(i).call(this));return k.position=j,k.stops=m,k.shape=l,k}return _inherits(i,h),_createClass(i,[{key:"doVisit",value:function(j){j.radialgradient(this)}},{key:"descend",value:function(j){j.visit(this.position),j.visit(this.stops),j.visit(this.shape)}},{key:"copy",value:function(){return new i(this.position,this.shape,this.stops)}},{key:"toString",value:function(){var j="radial-gradient(";return this.position&&(j+=this.position+", "),this.shape&&(j+=this.shape+", "),j+this.stops+")"}},{key:"toOriginalWebkitString",value:function(){var k,j=[],m=this.stops.items,l=m.length;for(j.push("center 0%")