":r=n>o;break;case">=":r=n>=o;break;default:return this}return isNaN(r)&&e.find_parent(Ne)?this:r})),e(Ot,(function(e,t){var n=this.condition._eval(e,t);if(n===this.condition)return this;var i=n?this.consequent:this.alternative,r=i._eval(e,t);return r===i?this:r})),e(an,(function(e,t){var n,i=this.fixed_value();if(!i)return this;if(D(i,"_eval"))n=i._eval();else{if(this._eval=c,n=i._eval(e,t),delete this._eval,n===i)return this;i._eval=function(){return n}}if(n&&"object"==typeof n){var r=this.definition().escaped;if(r&&t>r)return this}return n}));var r={Array:Array,Math:Math,Number:Number,Object:Object,String:String},o=Ui({Math:["E","LN10","LN2","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"],Number:["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]});e(St,(function(e,t){if(e.option("unsafe")){var n=this.property;if(n instanceof de&&(n=n._eval(e,t))===this.property)return this;var i,a=this.expression;if(Ci(a)){var s,u="hasOwnProperty"===a.name&&"call"===n&&(s=e.parent()&&e.parent().args)&&s&&s[0]&&s[0].evaluate(e);if(null==(u=u instanceof vt?u.expression:u)||u.thedef&&u.thedef.undeclared)return this.clone();var c=o.get(a.name);if(!c||!c.has(n))return this;i=r[a.name]}else{if(!(i=a._eval(e,t+1))||i===a||!D(i,n))return this;if("function"==typeof i)switch(n){case"name":return i.node.name?i.node.name.name:"";case"length":return i.node.argnames.length;default:return this}}return i[n]}return this})),e(Et,(function(e,t){var n=this.expression;if(e.option("unsafe")&&n instanceof St){var i,o=n.property;if(o instanceof de&&(o=o._eval(e,t))===n.property)return this;var a=n.expression;if(Ci(a)){var s="hasOwnProperty"===a.name&&"call"===o&&this.args[0]&&this.args[0].evaluate(e);if(null==(s=s instanceof vt?s.expression:s)||s.thedef&&s.thedef.undeclared)return this.clone();var u=Xi.get(a.name);if(!u||!u.has(o))return this;i=r[a.name]}else{if((i=a._eval(e,t+1))===a||!i)return this;var c=Hi.get(i.constructor.name);if(!c||!c.has(o))return this}for(var l=[],f=0,p=this.args.length;f=":return r.operator="<",r;case">":return r.operator="<=",r}switch(o){case"==":return r.operator="!=",r;case"!=":return r.operator="==",r;case"===":return r.operator="!==",r;case"!==":return r.operator="===",r;case"&&":return r.operator="||",r.left=r.left.negate(e,i),r.right=r.right.negate(e),n(this,r,i);case"||":return r.operator="&&",r.left=r.left.negate(e,i),r.right=r.right.negate(e),n(this,r,i);case"??":return r.right=r.right.negate(e),n(this,r,i)}return t(this)}))}((function(e,t){e.DEFMETHOD("negate",(function(e,n){return t.call(this,e,n)}))}));var zi=E("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError");Et.DEFMETHOD("is_expr_pure",(function(e){if(e.option("unsafe")){var t=this.expression,n=this.args&&this.args[0]&&this.args[0].evaluate(e);if(t.expression&&"hasOwnProperty"===t.expression.name&&(null==n||n.thedef&&n.thedef.undeclared))return!1;if(Ci(t)&&zi.has(t.name))return!0;let i;if(t instanceof vt&&Ci(t.expression)&&(i=Xi.get(t.expression.name))&&i.has(t.property))return!0}return!!b(this,wn)||!e.pure_funcs(this)})),de.DEFMETHOD("is_call_pure",s),vt.DEFMETHOD("is_call_pure",(function(e){if(!e.option("unsafe"))return;const t=this.expression;let n;return t instanceof Rt?n=Hi.get("Array"):t.is_boolean()?n=Hi.get("Boolean"):t.is_number(e)?n=Hi.get("Number"):t instanceof hn?n=Hi.get("RegExp"):t.is_string(e)?n=Hi.get("String"):this.may_throw_on_access(e)||(n=Hi.get("Object")),n&&n.has(this.property)}));const Wi=new Set(["Number","String","Array","Object","Function","Promise"]);function Yi(e){return e&&e.aborts()}!function(e){function t(e,t){for(var n=e.length;--n>=0;)if(e[n].has_side_effects(t))return!0;return!1}e(de,u),e(Te,s),e(pn,s),e(ln,s),e(ve,(function(e){return t(this.body,e)})),e(Et,(function(e){return!(this.is_expr_pure(e)||this.expression.is_call_pure(e)&&!this.expression.has_side_effects(e))||t(this.args,e)})),e(nt,(function(e){return this.expression.has_side_effects(e)||t(this.body,e)})),e(ot,(function(e){return this.expression.has_side_effects(e)||t(this.body,e)})),e(at,(function(e){return t(this.body,e)||this.bcatch&&this.bcatch.has_side_effects(e)||this.bfinally&&this.bfinally.has_side_effects(e)})),e(tt,(function(e){return this.condition.has_side_effects(e)||this.body&&this.body.has_side_effects(e)||this.alternative&&this.alternative.has_side_effects(e)})),e(be,(function(e){return this.body.has_side_effects(e)})),e(ge,(function(e){return this.body.has_side_effects(e)})),e(Pe,s),e(Pt,(function(e){return!(!this.extends||!this.extends.has_side_effects(e))||t(this.properties,e)})),e(Ct,(function(e){return this.left.has_side_effects(e)||this.right.has_side_effects(e)})),e(Ft,u),e(Ot,(function(e){return this.condition.has_side_effects(e)||this.consequent.has_side_effects(e)||this.alternative.has_side_effects(e)})),e(Tt,(function(e){return Li.has(this.operator)||this.expression.has_side_effects(e)})),e(an,(function(e){return!this.is_declared(e)&&!Wi.has(this.name)})),e(Zt,s),e(Ht,s),e(wt,(function(e){return t(this.properties,e)})),e(xt,(function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.value.has_side_effects(e)})),e(Vt,(function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.static&&this.value&&this.value.has_side_effects(e)})),e(Lt,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(It,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(kt,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(Rt,(function(e){return t(this.elements,e)})),e(vt,(function(e){return this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)})),e(At,(function(e){return this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)||this.property.has_side_effects(e)})),e(Dt,(function(e){return t(this.expressions,e)})),e(ct,(function(e){return t(this.definitions,e)})),e(_t,(function(){return this.value})),e(ze,s),e(Xe,(function(e){return t(this.segments,e)}))}((function(e,t){e.DEFMETHOD("has_side_effects",t)})),function(e){function t(e,t){for(var n=e.length;--n>=0;)if(e[n].may_throw(t))return!0;return!1}e(de,u),e(pn,s),e(Te,s),e(Pe,s),e(Ht,s),e(ln,s),e(Pt,(function(e){return!(!this.extends||!this.extends.may_throw(e))||t(this.properties,e)})),e(Rt,(function(e){return t(this.elements,e)})),e(Ft,(function(e){return!!this.right.may_throw(e)||!(!e.has_directive("use strict")&&"="==this.operator&&this.left instanceof an)&&this.left.may_throw(e)})),e(Ct,(function(e){return this.left.may_throw(e)||this.right.may_throw(e)})),e(ve,(function(e){return t(this.body,e)})),e(Et,(function(e){return!!t(this.args,e)||!this.is_expr_pure(e)&&(!!this.expression.may_throw(e)||(!(this.expression instanceof Pe)||t(this.expression.body,e)))})),e(ot,(function(e){return this.expression.may_throw(e)||t(this.body,e)})),e(Ot,(function(e){return this.condition.may_throw(e)||this.consequent.may_throw(e)||this.alternative.may_throw(e)})),e(ct,(function(e){return t(this.definitions,e)})),e(vt,(function(e){return this.expression.may_throw_on_access(e)||this.expression.may_throw(e)})),e(tt,(function(e){return this.condition.may_throw(e)||this.body&&this.body.may_throw(e)||this.alternative&&this.alternative.may_throw(e)})),e(be,(function(e){return this.body.may_throw(e)})),e(wt,(function(e){return t(this.properties,e)})),e(xt,(function(e){return this.value.may_throw(e)})),e(Vt,(function(e){return this.computed_key()&&this.key.may_throw(e)||this.static&&this.value&&this.value.may_throw(e)})),e(Lt,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(It,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(kt,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(qe,(function(e){return this.value&&this.value.may_throw(e)})),e(Dt,(function(e){return t(this.expressions,e)})),e(ge,(function(e){return this.body.may_throw(e)})),e(At,(function(e){return this.expression.may_throw_on_access(e)||this.expression.may_throw(e)||this.property.may_throw(e)})),e(nt,(function(e){return this.expression.may_throw(e)||t(this.body,e)})),e(an,(function(e){return!this.is_declared(e)&&!Wi.has(this.name)})),e(Zt,s),e(at,(function(e){return this.bcatch?this.bcatch.may_throw(e):t(this.body,e)||this.bfinally&&this.bfinally.may_throw(e)})),e(Tt,(function(e){return!("typeof"==this.operator&&this.expression instanceof an)&&this.expression.may_throw(e)})),e(_t,(function(e){return!!this.value&&this.value.may_throw(e)}))}((function(e,t){e.DEFMETHOD("may_throw",t)})),function(e){function t(e){let t=!0;return Cn(this,n=>{if(n instanceof an){if(oi(this,16))return t=!1,Fn;var r=n.definition();if(i(r,this.enclosed)&&!this.variables.has(r.name)){if(e){var o=e.find_variable(n);if(r.undeclared?!o:o===r)return t="f",!0}return t=!1,Fn}return!0}if(n instanceof ln&&this instanceof Ke)return t=!1,Fn}),t}e(de,s),e(pn,u),e(Pt,(function(e){if(this.extends&&!this.extends.is_constant_expression(e))return!1;for(const t of this.properties){if(t.computed_key()&&!t.key.is_constant_expression(e))return!1;if(t.static&&t.value&&!t.value.is_constant_expression(e))return!1}return t.call(this,e)})),e(Pe,t),e(Tt,(function(){return this.expression.is_constant_expression()})),e(Ct,(function(){return this.left.is_constant_expression()&&this.right.is_constant_expression()})),e(Rt,(function(){return this.elements.every(e=>e.is_constant_expression())})),e(wt,(function(){return this.properties.every(e=>e.is_constant_expression())})),e(xt,(function(){return!(this.key instanceof de)&&this.value.is_constant_expression()}))}((function(e,t){e.DEFMETHOD("is_constant_expression",t)})),function(e){function t(){for(var e=0;e{if(e instanceof Ht){const n=e.definition();!t&&!n.global||o.has(n.id)||o.set(n.id,n)}}),n.value){if(n.name instanceof Ge)n.walk(_);else{var r=n.name.definition();g(c,r.id,n.value),r.chained||n.name.fixed_value()!==n.value||a.set(r.id,n)}n.value.has_side_effects(e)&&n.value.walk(_)}})),!0}return h(r,s)}}));t.walk(_),_=new Mn(h),o.forEach((function(e){var t=c.get(e.id);t&&t.forEach((function(e){e.walk(_)}))}));var d=new Rn((function(s,c,_){var h=d.parent();if(i){const e=r(s);if(e instanceof an){var E=e.definition(),g=o.has(E.id);if(s instanceof Ft){if(!g||a.has(E.id)&&a.get(E.id)!==s)return Di(h,s,s.right.transform(d))}else if(!g)return _?f.skip:p(dn,s,{value:0})}}if(l===t){if(s.name&&(s instanceof Kt&&!S(e.option("keep_classnames"),(E=s.name.definition()).name)||s instanceof Be&&!S(e.option("keep_fnames"),(E=s.name.definition()).name))&&(!o.has(E.id)||E.orig.length>1)&&(s.name=null),s instanceof Pe&&!(s instanceof Ve))for(var D=!e.option("keep_fargs"),v=s.argnames,A=v.length;--A>=0;){var T=v[A];T instanceof Le&&(T=T.expression),T instanceof Mt&&(T=T.left),T instanceof Ge||o.has(T.definition().id)?D=!1:(ai(T,1),D&&(v.pop(),e[T.unreferenced()?"warn":"info"]("Dropping unused function argument {name} [{file}:{line},{col}]",R(T))))}if((s instanceof Ue||s instanceof Bt)&&s!==t){const t=s.name.definition();if(!(t.global&&!n||o.has(t.id))){if(e[s.name.unreferenced()?"warn":"info"]("Dropping unused function {name} [{file}:{line},{col}]",R(s.name)),t.eliminated++,s instanceof Bt){const t=s.drop_side_effect_free(e);if(t)return p(ge,s,{body:t})}return _?f.skip:p(Te,s)}}if(s instanceof ct&&!(h instanceof we&&h.init===s)){var y=!(h instanceof Ie||s instanceof lt),b=[],C=[],O=[],F=[];switch(s.definitions.forEach((function(t){t.value&&(t.value=t.value.transform(d));var n=t.name instanceof Ge,r=n?new Yn(null,{name:""}):t.name.definition();if(y&&r.global)return O.push(t);if(!i&&!y||n&&(t.name.names.length||t.name.is_array||1!=e.option("pure_getters"))||o.has(r.id)){if(t.value&&a.has(r.id)&&a.get(r.id)!==t&&(t.value=t.value.drop_side_effect_free(e)),t.name instanceof Xt){var c=u.get(r.id);if(c.length>1&&(!t.value||r.orig.indexOf(t.name)>r.eliminated)){if(e.warn("Dropping duplicated definition of variable {name} [{file}:{line},{col}]",R(t.name)),t.value){var l=p(an,t.name,t.name);r.references.push(l);var f=p(Ft,t,{operator:"=",left:l,right:t.value});a.get(r.id)===t&&a.set(r.id,f),F.push(f.transform(d))}return m(c,t),void r.eliminated++}}t.value?(F.length>0&&(O.length>0?(F.push(t.value),t.value=Ei(t.value,F)):b.push(p(ge,s,{body:Ei(s,F)})),F=[]),O.push(t)):C.push(t)}else if(r.orig[0]instanceof tn){(_=t.value&&t.value.drop_side_effect_free(e))&&F.push(_),t.value=null,C.push(t)}else{var _;(_=t.value&&t.value.drop_side_effect_free(e))?(n||e.warn("Side effects in initialization of unused variable {name} [{file}:{line},{col}]",R(t.name)),F.push(_)):n||e[t.name.unreferenced()?"warn":"info"]("Dropping unused variable {name} [{file}:{line},{col}]",R(t.name)),r.eliminated++}})),(C.length>0||O.length>0)&&(s.definitions=C.concat(O),b.push(s)),F.length>0&&b.push(p(ge,s,{body:Ei(s,F)})),b.length){case 0:return _?f.skip:p(Te,s);case 1:return b[0];default:return _?f.splice(b):p(Ae,s,{body:b})}}if(s instanceof Re)return c(s,this),s.init instanceof Ae&&(M=s.init,s.init=M.body.pop(),M.body.push(s)),s.init instanceof ge?s.init=s.init.body:Ai(s.init)&&(s.init=null),M?_?f.splice(M.body):M:s;if(s instanceof be&&s.body instanceof Re){if(c(s,this),s.body instanceof Ae){var M=s.body;return s.body=M.body.pop(),M.body.push(s),_?f.splice(M.body):M}return s}if(s instanceof Ae)return c(s,this),_&&s.body.every(Ti)?f.splice(s.body):s;if(s instanceof ke){const e=l;return l=s,c(s,this),l=e,s}}function R(e){return{name:e.name,file:e.start.file,line:e.start.line,col:e.start.col}}}));function h(e,n){var i;const s=r(e);if(s instanceof an&&!di(e.left,zt)&&t.variables.get(s.name)===(i=s.definition()))return e instanceof Ft&&(e.right.walk(_),i.chained||e.left.fixed_value()!==e.right||a.set(i.id,e)),!0;if(e instanceof an){if(i=e.definition(),!o.has(i.id)&&(o.set(i.id,i),i.orig[0]instanceof tn)){const e=i.scope.is_block_scope()&&i.scope.get_defun_scope().variables.get(i.name);e&&o.set(e.id,e)}return!0}if(e instanceof ke){var u=l;return l=e,n(),l=u,!0}}t.transform(d)})),ke.DEFMETHOD("hoist_declarations",(function(e){var t=this;if(e.has_directive("use asm"))return t;if(!Array.isArray(t.body))return t;var n=e.option("hoist_funs"),i=e.option("hoist_vars");if(n||i){var r=[],o=[],a=new Map,s=0,u=0;Cn(t,e=>e instanceof ke&&e!==t||(e instanceof lt?(++u,!0):void 0)),i=i&&u>1;var c=new Rn((function(u){if(u!==t){if(u instanceof Ee)return r.push(u),p(Te,u);if(n&&u instanceof Ue&&!(c.parent()instanceof ht)&&c.parent()===t)return o.push(u),p(Te,u);if(i&&u instanceof lt){u.definitions.forEach((function(e){e.name instanceof Ge||(a.set(e.name.name,e),++s)}));var l=u.to_assignments(e),f=c.parent();if(f instanceof we&&f.init===u){if(null==l){var _=u.definitions[0].name;return p(an,_,_)}return l}return f instanceof Re&&f.init===u?l:l?p(ge,u,{body:l}):p(Te,u)}if(u instanceof ke)return u}}));if(t=t.transform(c),s>0){var l=[];const e=t instanceof Pe,n=e?t.args_as_names():null;if(a.forEach((t,i)=>{e&&n.some(e=>e.name===t.name.name)?a.delete(i):((t=t.clone()).value=null,l.push(t),a.set(i,t))}),l.length>0){for(var f=0;f"string"==typeof e.key)){a(o,this);const e=new Map,t=[];return c.properties.forEach((function(n){t.push(p(_t,o,{name:s(r,n.key,e),value:n.value}))})),i.set(u.id,e),f.splice(t)}}else if(o instanceof St&&o.expression instanceof an){const e=i.get(o.expression.definition().id);if(e){const t=e.get(String(Ni(o.property))),n=p(an,o,{name:t.name,scope:o.expression.scope,thedef:t});return n.reference({}),n}}function s(e,n,i){const r=p(e.CTOR,e,{name:t.make_var_name(e.name+"_"+n),scope:t}),o=t.def_variable(r);return i.set(String(n),o),t.enclosed.push(o),r}}));return t.transform(r)})),function(e){function t(e,t,n){var i=e.length;if(!i)return null;for(var r=[],o=!1,a=0;a0&&(u[0].body=s.concat(u[0].body)),e.body=u;n=u[u.length-1];){var d=n.body[n.body.length-1];if(d instanceof Ze&&t.loopcontrol_target(d)===e&&n.body.pop(),n.body.length||n instanceof ot&&(o||n.expression.has_side_effects(t)))break;u.pop()===o&&(o=null)}if(0==u.length)return p(Ae,e,{body:s.concat(p(ge,e.expression,{body:e.expression}))}).optimize(t);if(1==u.length&&(u[0]===a||u[0]===o)){var m=!1,h=new Mn((function(t){if(m||t instanceof Pe||t instanceof ge)return!0;t instanceof Ze&&h.loopcontrol_target(t)===e&&(m=!0)}));if(e.walk(h),!m){var E,g=u[0].body.slice();return(E=u[0].expression)&&g.unshift(p(ge,E,{body:E})),g.unshift(p(ge,e.expression,{body:e.expression})),p(Ae,e,{body:g}).optimize(t)}}return e;function D(e,n){n&&!Yi(n)?n.body=n.body.concat(e.body):xi(t,e,s)}})),ci(at,(function(e,t){if(wi(e.body,t),e.bcatch&&e.bfinally&&e.bfinally.body.every(Ai)&&(e.bfinally=null),t.option("dead_code")&&e.body.every(Ai)){var n=[];return e.bcatch&&xi(t,e.bcatch,n),e.bfinally&&n.push(...e.bfinally.body),p(Ae,e,{body:n}).optimize(t)}return e})),ct.DEFMETHOD("remove_initializers",(function(){var e=[];this.definitions.forEach((function(t){t.name instanceof Ht?(t.value=null,e.push(t)):Cn(t.name,n=>{n instanceof Ht&&e.push(p(_t,t,{name:n,value:null}))})})),this.definitions=e})),ct.DEFMETHOD("to_assignments",(function(e){var t=e.option("reduce_vars"),n=this.definitions.reduce((function(e,n){if(!n.value||n.name instanceof Ge){if(n.value){var i=p(_t,n,{name:n.name,value:n.value}),r=p(lt,n,{definitions:[i]});e.push(r)}}else{var o=p(an,n.name,n.name);e.push(p(Ft,n,{operator:"=",left:o,right:n.value})),t&&(o.definition().fixed=!1)}return(n=n.name.definition()).eliminated++,n.replaced--,e}),[]);return 0==n.length?null:Ei(this,n)})),ci(ct,(function(e){return 0==e.definitions.length?p(Te,e):e})),ci(mt,(function(e){return e})),ci(Et,(function(e,t){var n=e.expression,i=n;cr(e,t,e.args);var r=e.args.every(e=>!(e instanceof Le));if(t.option("reduce_vars")&&i instanceof an&&!b(e,Nn)){const e=i.fixed_value();Ji(e,t)||(i=e)}var o=i instanceof Pe;if(t.option("unused")&&r&&o&&!i.uses_arguments&&!i.pinned()){for(var a=0,s=0,u=0,c=e.args.length;u=i.argnames.length;if(l||oi(i.argnames[u],1)){if(D=e.args[u].drop_side_effect_free(t))e.args[a++]=D;else if(!l){e.args[a++]=p(dn,e.args[u],{value:0});continue}}else e.args[a++]=e.args[u];s=a}e.args.length=s}if(t.option("unsafe"))if(Ci(n))switch(n.name){case"Array":if(1!=e.args.length)return p(Rt,e,{elements:e.args}).optimize(t);if(e.args[0]instanceof dn&&e.args[0].value<=11){const t=[];for(let n=0;n=1&&e.args.length<=2&&e.args.every(e=>{var n=e.evaluate(t);return f.push(n),e!==n})&&y(f[0])){let[n,i]=f;n=A(new RegExp(n).source);const r=p(hn,e,{value:{source:n,flags:i}});if(r._eval(t)!==r)return r;t.warn("Error converting {expr} [{file}:{line},{col}]",{expr:e.print_to_string(),file:e.start.file,line:e.start.line,col:e.start.col})}}else if(n instanceof vt)switch(n.property){case"toString":if(0==e.args.length&&!n.expression.may_throw_on_access(t))return p(Ct,e,{left:p(_n,e,{value:""}),operator:"+",right:n.expression}).optimize(t);break;case"join":if(n.expression instanceof Rt)e:{var _;if(!(e.args.length>0&&(_=e.args[0].evaluate(t))===e.args[0])){var d,m=[],h=[];for(u=0,c=n.expression.elements.length;u0&&(m.push(p(_n,e,{value:h.join(_)})),h.length=0),m.push(E))}return h.length>0&&m.push(p(_n,e,{value:h.join(_)})),0==m.length?p(_n,e,{value:""}):1==m.length?m[0].is_string(t)?m[0]:p(Ct,m[0],{operator:"+",left:p(_n,e,{value:""}),right:m[0]}):""==_?(d=m[0].is_string(t)||m[1].is_string(t)?m.shift():p(_n,e,{value:""}),m.reduce((function(e,t){return p(Ct,t,{operator:"+",left:e,right:t})}),d).optimize(t)):((D=e.clone()).expression=D.expression.clone(),D.expression.expression=D.expression.expression.clone(),D.expression.expression.elements=m,Ki(t,e,D));var D}}break;case"charAt":if(n.expression.is_string(t)){var S=e.args[0],v=S?S.evaluate(t):0;if(v!==S)return p(At,n,{expression:n.expression,property:gi(0|v,S||n)}).optimize(t)}break;case"apply":if(2==e.args.length&&e.args[1]instanceof Rt)return(P=e.args[1].elements.slice()).unshift(e.args[0]),p(Et,e,{expression:p(vt,n,{expression:n.expression,property:"call"}),args:P}).optimize(t);break;case"call":var T=n.expression;if(T instanceof an&&(T=T.fixed_value()),T instanceof Pe&&!T.contains_this())return(e.args.length?Ei(this,[e.args[0],p(Et,e,{expression:n.expression,args:e.args.slice(1)})]):p(Et,e,{expression:n.expression,args:[]})).optimize(t)}if(t.option("unsafe_Function")&&Ci(n)&&"Function"==n.name){if(0==e.args.length)return p(Be,e,{argnames:[],body:[]}).optimize(t);if(e.args.every(e=>e instanceof _n))try{var C=fe(R="n(function("+e.args.slice(0,-1).map((function(e){return e.value})).join(",")+"){"+e.args[e.args.length-1].value+"})"),O={ie8:t.option("ie8")};C.figure_out_scope(O);var F,M=new ui(t.options);(C=C.transform(M)).figure_out_scope(O),jn.reset(),C.compute_char_frequency(O),C.mangle_names(O),Cn(C,e=>{if(pi(e))return F=e,Fn});var R=Un();return Ae.prototype._codegen.call(F,F,R),e.args=[p(_n,e,{value:F.argnames.map((function(e){return e.print_to_string()})).join(",")}),p(_n,e.args[e.args.length-1],{value:R.get().replace(/^{|}$/g,"")})],e}catch(n){if(!(n instanceof te))throw n;t.warn("Error parsing code passed to new Function [{file}:{line},{col}]",e.args[e.args.length-1].start),t.warn(n.toString())}}var w=o&&i.body[0],x=o&&!i.is_generator&&!i.async,N=x&&t.option("inline")&&!e.is_expr_pure(t);if(N&&w instanceof qe){let n=w.value;if(!n||n.is_constant_expression()){n=n?n.clone(!0):p(Sn,e);const i=e.args.concat(n);return Ei(e,i).optimize(t)}if(1===i.argnames.length&&i.argnames[0]instanceof qt&&e.args.length<2&&n instanceof an&&n.name===i.argnames[0].name){let n;return e.args[0]instanceof St&&(n=t.parent())instanceof Et&&n.expression===e?Ei(e,[p(dn,e,{value:0}),e.args[0].optimize(t)]):(e.args[0]||p(Sn)).optimize(t)}}if(N){var k,I,L=-1;let o,a,s;if(r&&!i.uses_arguments&&!i.pinned()&&!(t.parent()instanceof Pt)&&!(i.name&&i instanceof Be)&&(a=function(e){var n=i.body,r=n.length;if(t.option("inline")<3)return 1==r&&B(e);e=null;for(var o=0;o!e.value))return!1}else{if(e)return!1;a instanceof Te||(e=a)}}return B(e)}(w))&&(n===i||b(e,xn)||t.option("unused")&&1==(o=n.definition()).references.length&&!er(t,o)&&i.is_constant_expression(n.scope))&&!b(e,wn|Nn)&&!i.contains_this()&&function(){var n=new Set;do{if((k=t.parent(++L)).is_block_scope()&&k.block_scope&&k.block_scope.variables.forEach((function(e){n.add(e.name)})),k instanceof st)k.argname&&n.add(k.argname.name);else if(k instanceof Ce)I=[];else if(k instanceof an&&k.fixed_value()instanceof ke)return!1}while(!(k instanceof ke));var r=!(k instanceof Ie)||t.toplevel.vars,o=t.option("inline");return!!function(e,t){for(var n=i.body.length,r=0;r=0;){var s=o.definitions[a].name;if(s instanceof Ge||e.has(s.name)||Mi.has(s.name)||k.var_names().has(s.name))return!1;I&&I.push(s.definition())}}}return!0}(n,o>=3&&r)&&(!!function(e,t){for(var n=0,r=i.argnames.length;n=2&&r)&&(!!function(){var t=new Set;const n=e=>{if(e instanceof ke){var n=new Set;return e.enclosed.forEach((function(e){n.add(e.name)})),e.variables.forEach((function(e){n.delete(e)})),n.forEach((function(e){t.add(e)})),!0}};for(let t=0;t=0;){var s=o.definitions[a].name;if(s instanceof Ge||t.has(s.name))return!1}}return!0}()&&(!I||0==I.length||!ir(i,I))))}()&&(s=mi(t))&&!tr(s,i)&&!function(){let e,n=0;for(;e=t.parent(n++);){if(e instanceof Mt)return!0;if(e instanceof ve)break}return!1}()&&!(k instanceof Pt))return ai(i,256),s.add_child_scope(i),Ei(e,function(n){var r=[],o=[];if(function(t,n){for(var r=i.argnames.length,o=e.args.length;--o>=r;)n.push(e.args[o]);for(o=r;--o>=0;){var a=i.argnames[o],s=e.args[o];if(oi(a,1)||!a.name||k.var_names().has(a.name))s&&n.push(s);else{var u=p(Xt,a,a);a.definition().orig.push(u),!s&&I&&(s=p(Sn,e)),K(t,n,u,s)}}t.reverse(),n.reverse()}(r,o),function(e,t){for(var n=t.length,r=0,o=i.body.length;re.name!=l.name)){var f=i.variables.get(l.name),_=p(an,l,l);f.references.push(_),t.splice(n++,0,p(Ft,c,{operator:"=",left:_,right:p(Sn,l)}))}}}}(r,o),o.push(n),r.length){const e=k.body.indexOf(t.parent(L-1))+1;k.body.splice(e,0,p(lt,i,{definitions:r}))}return o.map(e=>e.clone(!0))}(a)).optimize(t)}if(x&&t.option("side_effects")&&i.body.every(Ai)){var P=e.args.concat(p(Sn,e));return Ei(e,P).optimize(t)}if(t.option("negate_iife")&&t.parent()instanceof ge&&bi(e))return e.negate(t,!0);var V=e.evaluate(t);return V!==e?(V=gi(V,e).optimize(t),Ki(t,V,e)):e;function B(t){return t?t instanceof qe?t.value?t.value.clone(!0):p(Sn,e):t instanceof ge?p(yt,t,{operator:"void",expression:t.body.clone(!0)}):void 0:p(Sn,e)}function K(t,n,i,r){var o=i.definition();k.variables.set(i.name,o),k.enclosed.push(o),k.var_names().has(i.name)||(k.add_var_name(i.name),t.push(p(_t,i,{name:i,value:null})));var a=p(an,i,i);o.references.push(a),r&&n.push(p(Ft,e,{operator:"=",left:a,right:r.clone()}))}})),ci(gt,(function(e,t){return t.option("unsafe")&&Ci(e.expression)&&["Object","RegExp","Function","Error","Array"].includes(e.expression.name)?p(Et,e,e).transform(t):e})),ci(Dt,(function(e,t){if(!t.option("side_effects"))return e;var n,i,r=[];n=Pn(t),i=e.expressions.length-1,e.expressions.forEach((function(e,o){o0&&ki(r[o],t);)o--;o0)return(n=this.clone()).right=Ei(this.right,t.slice(o)),(t=t.slice(0,o)).push(n),Ei(this,t).optimize(e)}}return this}));var Qi=E("== === != !== * & | ^");function er(e,t){for(var n,i=0;n=e.parent(i);i++)if(n instanceof Pe||n instanceof Pt){var r=n.name;if(r&&r.definition()===t)break}return n}function tr(e,t){for(const n of t.enclosed){if(t.variables.has(n.name))continue;const i=e.find_variable(n.name);if(i){if(i===n)continue;return!0}}return!1}function nr(e,t){return e instanceof an||e.TYPE===t.TYPE}function ir(e,t){const n=e=>{if(e instanceof an&&i(e.definition(),t))return Fn};return On(e,(t,i)=>{if(t instanceof ke&&t!==e){var r=i.parent();if(r instanceof Et&&r.expression===t)return;return!Cn(t,n)||Fn}})}ci(Ct,(function(e,t){function n(){return e.left.is_constant()||e.right.is_constant()||!e.left.has_side_effects(t)&&!e.right.has_side_effects(t)}function i(t){if(n()){t&&(e.operator=t);var i=e.left;e.left=e.right,e.right=i}}if(Qi.has(e.operator)&&e.right.is_constant()&&!e.left.is_constant()&&(e.left instanceof Ct&&ce[e.left.operator]>=ce[e.operator]||i()),e=e.lift_sequences(t),t.option("comparisons"))switch(e.operator){case"===":case"!==":var r=!0;(e.left.is_string(t)&&e.right.is_string(t)||e.left.is_number(t)&&e.right.is_number(t)||e.left.is_boolean()&&e.right.is_boolean()||e.left.equivalent_to(e.right))&&(e.operator=e.operator.substr(0,2));case"==":case"!=":if(!r&&ki(e.left,t))e.left=p(gn,e.left);else if(t.option("typeofs")&&e.left instanceof _n&&"undefined"==e.left.value&&e.right instanceof yt&&"typeof"==e.right.operator){var o=e.right.expression;(o instanceof an?!o.is_declared(t):o instanceof St&&t.option("ie8"))||(e.right=o,e.left=p(Sn,e.left).optimize(t),2==e.operator.length&&(e.operator+="="))}else if(e.left instanceof an&&e.right instanceof an&&e.left.definition()===e.right.definition()&&((u=e.left.fixed_value())instanceof Rt||u instanceof Pe||u instanceof wt||u instanceof Pt))return p("="==e.operator[0]?bn:yn,e);break;case"&&":case"||":var a=e.left;if(a.operator==e.operator&&(a=a.right),a instanceof Ct&&a.operator==("&&"==e.operator?"!==":"===")&&e.right instanceof Ct&&a.operator==e.right.operator&&(ki(a.left,t)&&e.right.left instanceof gn||a.left instanceof gn&&ki(e.right.left,t))&&!a.right.has_side_effects(t)&&a.right.equivalent_to(e.right.right)){var s=p(Ct,e,{operator:a.operator.slice(0,-1),left:p(gn,e),right:a.right});return a!==e.left&&(s=p(Ct,e,{operator:e.operator,left:e.left.left,right:s})),s}}var u;if("+"==e.operator&&t.in_boolean_context()){var c=e.left.evaluate(t),l=e.right.evaluate(t);if(c&&"string"==typeof c)return t.warn("+ in boolean context always true [{file}:{line},{col}]",e.start),Ei(e,[e.right,p(bn,e)]).optimize(t);if(l&&"string"==typeof l)return t.warn("+ in boolean context always true [{file}:{line},{col}]",e.start),Ei(e,[e.left,p(bn,e)]).optimize(t)}if(t.option("comparisons")&&e.is_boolean()){if(!(t.parent()instanceof Ct)||t.parent()instanceof Ft){var f=p(yt,e,{operator:"!",expression:e.negate(t,Pn(t))});e=Ki(t,e,f)}if(t.option("unsafe_comps"))switch(e.operator){case"<":i(">");break;case"<=":i(">=")}}if("+"==e.operator){if(e.right instanceof _n&&""==e.right.getValue()&&e.left.is_string(t))return e.left;if(e.left instanceof _n&&""==e.left.getValue()&&e.right.is_string(t))return e.right;if(e.left instanceof Ct&&"+"==e.left.operator&&e.left.left instanceof _n&&""==e.left.left.getValue()&&e.right.is_string(t))return e.left=e.left.right,e.transform(t)}if(t.option("evaluate")){switch(e.operator){case"&&":if(!(c=!!oi(e.left,2)||!oi(e.left,4)&&e.left.evaluate(t)))return t.warn("Condition left of && always false [{file}:{line},{col}]",e.start),Di(t.parent(),t.self(),e.left).optimize(t);if(!(c instanceof de))return t.warn("Condition left of && always true [{file}:{line},{col}]",e.start),Ei(e,[e.left,e.right]).optimize(t);if(l=e.right.evaluate(t)){if(!(l instanceof de)){if("&&"==(_=t.parent()).operator&&_.left===t.self()||t.in_boolean_context())return t.warn("Dropping side-effect-free && [{file}:{line},{col}]",e.start),e.left.optimize(t)}}else{if(t.in_boolean_context())return t.warn("Boolean && always false [{file}:{line},{col}]",e.start),Ei(e,[e.left,p(yn,e)]).optimize(t);ai(e,4)}if("||"==e.left.operator)if(!(d=e.left.right.evaluate(t)))return p(Ot,e,{condition:e.left.left,consequent:e.right,alternative:e.left.right}).optimize(t);break;case"||":var _,d;if(!(c=!!oi(e.left,2)||!oi(e.left,4)&&e.left.evaluate(t)))return t.warn("Condition left of || always false [{file}:{line},{col}]",e.start),Ei(e,[e.left,e.right]).optimize(t);if(!(c instanceof de))return t.warn("Condition left of || always true [{file}:{line},{col}]",e.start),Di(t.parent(),t.self(),e.left).optimize(t);if(l=e.right.evaluate(t)){if(!(l instanceof de)){if(t.in_boolean_context())return t.warn("Boolean || always true [{file}:{line},{col}]",e.start),Ei(e,[e.left,p(bn,e)]).optimize(t);ai(e,2)}}else if("||"==(_=t.parent()).operator&&_.left===t.self()||t.in_boolean_context())return t.warn("Dropping side-effect-free || [{file}:{line},{col}]",e.start),e.left.optimize(t);if("&&"==e.left.operator)if((d=e.left.right.evaluate(t))&&!(d instanceof de))return p(Ot,e,{condition:e.left.left,consequent:e.left.right,alternative:e.right}).optimize(t);break;case"??":if(ar(e.left))return e.right;if(!((c=e.left.evaluate(t))instanceof de))return null==c?e.right:e.left;if(t.in_boolean_context()){const n=e.right.evaluate(t);if(!(n instanceof de||n))return e.left}}var m=!0;switch(e.operator){case"+":if(e.left instanceof pn&&e.right instanceof Ct&&"+"==e.right.operator&&e.right.is_string(t)){var h=(g=p(Ct,e,{operator:"+",left:e.left,right:e.right.left})).optimize(t);g!==h&&(e=p(Ct,e,{operator:"+",left:h,right:e.right.right}))}if(e.right instanceof pn&&e.left instanceof Ct&&"+"==e.left.operator&&e.left.is_string(t)){var E=(g=p(Ct,e,{operator:"+",left:e.left.right,right:e.right})).optimize(t);g!==E&&(e=p(Ct,e,{operator:"+",left:e.left.left,right:E}))}if(e.left instanceof Ct&&"+"==e.left.operator&&e.left.is_string(t)&&e.right instanceof Ct&&"+"==e.right.operator&&e.right.is_string(t)){var g,D=(g=p(Ct,e,{operator:"+",left:e.left.right,right:e.right.left})).optimize(t);g!==D&&(e=p(Ct,e,{operator:"+",left:p(Ct,e.left,{operator:"+",left:e.left.left,right:D}),right:e.right.right}))}if(e.right instanceof yt&&"-"==e.right.operator&&e.left.is_number(t)){e=p(Ct,e,{operator:"-",left:e.left,right:e.right.expression});break}if(e.left instanceof yt&&"-"==e.left.operator&&n()&&e.right.is_number(t)){e=p(Ct,e,{operator:"-",left:e.right,right:e.left.expression});break}if(e.left instanceof Xe){h=e.left;if((E=e.right.evaluate(t))!=e.right)return h.segments[h.segments.length-1].value+=E.toString(),h}if(e.right instanceof Xe){E=e.right;if((h=e.left.evaluate(t))!=e.left)return E.segments[0].value=h.toString()+E.segments[0].value,E}if(e.left instanceof Xe&&e.right instanceof Xe){var S=(h=e.left).segments;E=e.right;S[S.length-1].value+=E.segments[0].value;for(var v=1;v=ce[e.operator])){var A=p(Ct,e,{operator:e.operator,left:e.right,right:e.left});e=e.right instanceof pn&&!(e.left instanceof pn)?Ki(t,A,e):Ki(t,e,A)}m&&e.is_number(t)&&(e.right instanceof Ct&&e.right.operator==e.operator&&(e=p(Ct,e,{operator:e.operator,left:p(Ct,e.left,{operator:e.operator,left:e.left,right:e.right.left,start:e.left.start,end:e.right.left.end}),right:e.right.right})),e.right instanceof pn&&e.left instanceof Ct&&e.left.operator==e.operator&&(e.left.left instanceof pn?e=p(Ct,e,{operator:e.operator,left:p(Ct,e.left,{operator:e.operator,left:e.left.left,right:e.right,start:e.left.left.start,end:e.right.end}),right:e.left.right}):e.left.right instanceof pn&&(e=p(Ct,e,{operator:e.operator,left:p(Ct,e.left,{operator:e.operator,left:e.left.right,right:e.right,start:e.left.right.start,end:e.right.end}),right:e.left.left}))),e.left instanceof Ct&&e.left.operator==e.operator&&e.left.right instanceof pn&&e.right instanceof Ct&&e.right.operator==e.operator&&e.right.left instanceof pn&&(e=p(Ct,e,{operator:e.operator,left:p(Ct,e.left,{operator:e.operator,left:p(Ct,e.left.left,{operator:e.operator,left:e.left.right,right:e.right.left,start:e.left.right.start,end:e.right.left.end}),right:e.left.left}),right:e.right.right})))}}if(e.right instanceof Ct&&e.right.operator==e.operator&&(Ii.has(e.operator)||"+"==e.operator&&(e.right.left.is_string(t)||e.left.is_string(t)&&e.right.right.is_string(t))))return e.left=p(Ct,e.left,{operator:e.operator,left:e.left,right:e.right.left}),e.right=e.right.right,e.transform(t);var T=e.evaluate(t);return T!==e?(T=gi(T,e).optimize(t),Ki(t,T,e)):e})),ci(sn,(function(e){return e})),ci(an,(function(e,t){if(!t.option("ie8")&&Ci(e)&&(!e.scope.uses_with||!t.find_parent(Ne)))switch(e.name){case"undefined":return p(Sn,e).optimize(t);case"NaN":return p(Dn,e).optimize(t);case"Infinity":return p(An,e).optimize(t)}var n=t.parent();if(t.option("reduce_vars")&&Pi(e,n)!==e){const f=e.definition();if(t.top_retain&&f.global&&t.top_retain(f))return f.fixed=!1,f.should_replace=!1,f.single_use=!1,e;var i=e.fixed_value(),r=f.single_use&&!(n instanceof Et&&n.is_expr_pure(t)||b(n,Nn));if(r&&(i instanceof Pe||i instanceof Pt))if(Ji(i,t))r=!1;else if(f.scope!==e.scope&&(1==f.escaped||oi(i,16)||function(e){for(var t,n=0;t=e.parent(n++);){if(t instanceof me)return!1;if(t instanceof Rt||t instanceof Nt||t instanceof wt)return!0}return!1}(t)))r=!1;else if(er(t,f))r=!1;else if((f.scope!==e.scope||f.orig[0]instanceof qt)&&"f"==(r=i.is_constant_expression(e.scope))){var o=e.scope;do{(o instanceof Ue||pi(o))&&ai(o,16)}while(o=o.parent_scope)}if(r&&i instanceof Pe){const o=mi(t);r=f.scope===e.scope&&!tr(o,i)||n instanceof Et&&n.expression===e&&!tr(o,i)}if(r&&i instanceof Pt){r=(!i.extends||!i.extends.may_throw(t)&&!i.extends.has_side_effects(t))&&!i.properties.some(e=>e.may_throw(t)||e.has_side_effects(t))}if(r&&i){if(i instanceof Bt&&(ai(i,256),i=p(Kt,i,i)),i instanceof Ue&&(ai(i,256),i=p(Be,i,i)),f.recursive_refs>0&&i.name instanceof $t){const e=i.name.definition();let t=i.variables.get(i.name.name),n=t&&t.orig[0];n instanceof Jt||(n=p(Jt,i.name,i.name),n.scope=i,i.name=n,t=i.def_function(n)),Cn(i,n=>{n instanceof an&&n.definition()===e&&(n.thedef=t,t.references.push(n))})}return(i instanceof Pe||i instanceof Pt)&&mi(t).add_child_scope(i),i.optimize(t)}if(i&&void 0===f.should_replace){let e;if(i instanceof ln)f.orig[0]instanceof qt||!f.references.every(e=>f.scope===e.scope)||(e=i);else{var a=i.evaluate(t);a===i||!t.option("unsafe_regexp")&&a instanceof RegExp||(e=gi(a,i))}if(e){var s,u=e.optimize(t).size();Cn(i,e=>{if(e instanceof an)return Fn})?s=function(){var n=e.optimize(t);return n===e?n.clone(!0):n}:(u=Math.min(u,i.size()),s=function(){var n=Vi(e.optimize(t),i);return n===e||n===i?n.clone(!0):n});var c=f.name.length,l=0;t.option("unused")&&!t.exposed(f)&&(l=(c+2+u)/(f.references.length-f.assignments)),f.should_replace=u<=c+l&&s}else f.should_replace=!1}if(f.should_replace)return f.should_replace()}return e})),ci(Sn,(function(e,t){if(t.option("unsafe_undefined")){var n=hi(t,"undefined");if(n){var i=p(an,e,{name:"undefined",scope:n.scope,thedef:n});return ai(i,8),i}}var r=Pi(t.self(),t.parent());return r&&nr(r,e)?e:p(yt,e,{operator:"void",expression:p(dn,e,{value:0})})})),ci(An,(function(e,t){var n=Pi(t.self(),t.parent());return n&&nr(n,e)?e:!t.option("keep_infinity")||n&&!nr(n,e)||hi(t,"Infinity")?p(Ct,e,{operator:"/",left:p(dn,e,{value:1}),right:p(dn,e,{value:0})}):e})),ci(Dn,(function(e,t){var n=Pi(t.self(),t.parent());return n&&!nr(n,e)||hi(t,"NaN")?p(Ct,e,{operator:"/",left:p(dn,e,{value:0}),right:p(dn,e,{value:0})}):e}));const rr=E("+ - / * % >> << >>> | ^ &"),or=E("* | ^ &");function ar(e){let t;return e instanceof gn||ki(e)||e instanceof an&&(t=e.definition().fixed)instanceof de&&ar(t)}function sr(e,t){return e instanceof an&&(e=e.fixed_value()),!!e&&(!(e instanceof Pe||e instanceof Pt)||(!(e instanceof Pe&&e.contains_this())||t.parent()instanceof gt))}function ur(e,t){return t.in_boolean_context()?Ki(t,e,Ei(e,[e,p(bn,e)]).optimize(t)):e}function cr(e,t,n){for(var i=0;i0&&s.args.length==u.args.length&&s.expression.equivalent_to(u.expression)&&!e.condition.has_side_effects(t)&&!s.expression.has_side_effects(t)&&"number"==typeof(o=function(){for(var e=s.args,t=u.args,n=0,i=e.length;n=2020&&function(e,t,n){if(t.may_throw(n))return!1;let i;if(e instanceof Ct&&"=="===e.operator&&((i=ar(e.left)&&e.left)||(i=ar(e.right)&&e.right))&&(i===e.left?e.right:e.left).equivalent_to(t))return!0;if(e instanceof Ct&&"||"===e.operator){let n,i;const r=e=>{if(!(e instanceof Ct)||"==="!==e.operator&&"=="!==e.operator)return!1;let r,o=0;return e.left instanceof gn&&(o++,n=e,r=e.right),e.right instanceof gn&&(o++,n=e,r=e.left),ki(e.left)&&(o++,i=e,r=e.right),ki(e.right)&&(o++,i=e,r=e.left),1===o&&!!r.equivalent_to(t)};if(!r(e.left))return!1;if(!r(e.right))return!1;if(n&&i&&n!==i)return!0}return!1}(a,u,t))return p(Ct,e,{operator:"??",left:u,right:s}).optimize(t);if(u instanceof Dt&&s.equivalent_to(u.expressions[u.expressions.length-1]))return Ei(e,[p(Ct,e,{operator:"||",left:a,right:Ei(e,u.expressions.slice(0,-1))}),s]).optimize(t);if(u instanceof Ct&&"&&"==u.operator&&s.equivalent_to(u.right))return p(Ct,e,{operator:"&&",left:p(Ct,e,{operator:"||",left:a,right:u.left}),right:s}).optimize(t);if(s instanceof Ot&&s.alternative.equivalent_to(u))return p(Ot,e,{condition:p(Ct,e,{left:e.condition,operator:"&&",right:s.condition}),consequent:s.consequent,alternative:u});if(s.equivalent_to(u))return Ei(e,[e.condition,s]).optimize(t);if(s instanceof Ct&&"||"==s.operator&&s.right.equivalent_to(u))return p(Ct,e,{operator:"||",left:p(Ct,e,{operator:"&&",left:e.condition,right:s.left}),right:u}).optimize(t);var l=t.in_boolean_context();return _(e.consequent)?d(e.alternative)?f(e.condition):p(Ct,e,{operator:"||",left:f(e.condition),right:e.alternative}):d(e.consequent)?_(e.alternative)?f(e.condition.negate(t)):p(Ct,e,{operator:"&&",left:f(e.condition.negate(t)),right:e.alternative}):_(e.alternative)?p(Ct,e,{operator:"||",left:f(e.condition.negate(t)),right:e.consequent}):d(e.alternative)?p(Ct,e,{operator:"&&",left:f(e.condition),right:e.consequent}):e;function f(e){return e.is_boolean()?e:p(yt,e,{operator:"!",expression:e.negate(t)})}function _(e){return e instanceof bn||l&&e instanceof pn&&e.getValue()||e instanceof yt&&"!"==e.operator&&e.expression instanceof pn&&!e.expression.getValue()}function d(e){return e instanceof yn||l&&e instanceof pn&&!e.getValue()||e instanceof yt&&"!"==e.operator&&e.expression instanceof pn&&e.expression.getValue()}})),ci(Tn,(function(e,t){if(t.in_boolean_context())return p(dn,e,{value:+e.value});var n=t.parent();return t.option("booleans_as_integers")?(n instanceof Ct&&("==="==n.operator||"!=="==n.operator)&&(n.operator=n.operator.replace(/=$/,"")),p(dn,e,{value:+e.value})):t.option("booleans")?n instanceof Ct&&("=="==n.operator||"!="==n.operator)?(t.warn("Non-strict equality against boolean: {operator} {value} [{file}:{line},{col}]",{operator:n.operator,value:e.value,file:n.start.file,line:n.start.line,col:n.start.col}),p(dn,e,{value:+e.value})):p(yt,e,{operator:"!",expression:p(dn,e,{value:1-e.value})}):e})),ci(At,(function(e,t){var n,i=e.expression,r=e.property;if(t.option("properties")){var o=r.evaluate(t);if(o!==r){if("string"==typeof o)if("undefined"==o)o=void 0;else(A=parseFloat(o)).toString()==o&&(o=A);r=e.property=Vi(r,gi(o,r).transform(t));var a=""+o;if(J(a)&&a.length<=r.size()+1)return p(vt,e,{expression:i,property:a,quote:r.quote}).optimize(t)}}e:if(t.option("arguments")&&i instanceof an&&"arguments"==i.name&&1==i.definition().orig.length&&(n=i.scope)instanceof Pe&&n.uses_arguments&&!(n instanceof Ke)&&r instanceof dn){for(var s=r.getValue(),u=new Set,c=n.argnames,l=0;l1)&&(_=null)}else if(!_&&!t.option("keep_fargs")&&s=n.argnames.length;)_=p(qt,n,{name:n.make_var_name("argument_"+n.argnames.length),scope:n}),n.argnames.push(_),n.enclosed.push(n.def_variable(_));if(_){var m=p(an,e,_);return m.reference({}),si(_,1),m}}if(Pi(e,t.parent()))return e;if(o!==r){var h=e.flatten_object(a,t);h&&(i=e.expression=h.expression,r=e.property=h.property)}if(t.option("properties")&&t.option("side_effects")&&r instanceof dn&&i instanceof Rt){s=r.getValue();var E=i.elements,g=E[s];e:if(sr(g,t)){for(var D=!0,S=[],v=E.length;--v>s;){(A=E[v].drop_side_effect_free(t))&&(S.unshift(A),D&&A.has_side_effects(t)&&(D=!1))}if(g instanceof Le)break e;for(g=g instanceof vn?p(Sn,g):g,D||S.unshift(g);--v>=0;){var A;if((A=E[v])instanceof Le)break e;(A=A.drop_side_effect_free(t))?S.unshift(A):s--}return D?(S.push(g),Ei(e,S).optimize(t)):p(At,e,{expression:p(Rt,i,{elements:S}),property:p(dn,r,{value:s})})}}var T=e.evaluate(t);return T!==e?Ki(t,T=gi(T,e).optimize(t),e):e})),Pe.DEFMETHOD("contains_this",(function(){return Cn(this,e=>e instanceof ln?Fn:e!==this&&e instanceof ke&&!(e instanceof Ke)||void 0)})),St.DEFMETHOD("flatten_object",(function(e,t){if(t.option("properties")){var n=t.option("unsafe_arrows")&&t.option("ecma")>=2015,i=this.expression;if(i instanceof wt)for(var r=i.properties,o=r.length;--o>=0;){var a=r[o];if(""+(a instanceof Lt?a.key.name:a.key)==e){if(!r.every(e=>e instanceof Nt||n&&e instanceof Lt&&!e.is_generator))break;if(!sr(a.value,t))break;return p(At,this,{expression:p(Rt,i,{elements:r.map((function(e){var t=e.value;t instanceof Ve&&(t=p(Be,t,t));var n=e.key;return n instanceof de&&!(n instanceof jt)?Ei(e,[n,t]):t}))}),property:p(dn,this,{value:o})})}}}})),ci(vt,(function(e,t){"arguments"!=e.property&&"caller"!=e.property||t.warn("Function.prototype.{prop} not supported [{file}:{line},{col}]",{prop:e.property,file:e.start.file,line:e.start.line,col:e.start.col});const n=t.parent();if(Pi(e,n))return e;if(t.option("unsafe_proto")&&e.expression instanceof vt&&"prototype"==e.expression.property){var i=e.expression.expression;if(Ci(i))switch(i.name){case"Array":e.expression=p(Rt,e.expression,{elements:[]});break;case"Function":e.expression=p(Be,e.expression,{argnames:[],body:[]});break;case"Number":e.expression=p(dn,e.expression,{value:0});break;case"Object":e.expression=p(wt,e.expression,{properties:[]});break;case"RegExp":e.expression=p(hn,e.expression,{value:{source:"t",flags:""}});break;case"String":e.expression=p(_n,e.expression,{value:""})}}if(!(n instanceof Et&&b(n,Nn))){const n=e.flatten_object(e.property,t);if(n)return n.optimize(t)}let r=e.evaluate(t);return r!==e?(r=gi(r,e).optimize(t),Ki(t,r,e)):e})),ci(Rt,(function(e,t){var n=ur(e,t);return n!==e?n:cr(e,0,e.elements)})),ci(wt,(function(e,t){var n=ur(e,t);if(n!==e)return n;for(var i=e.properties,r=0;r=2015&&!e.name&&!e.is_generator&&!e.uses_arguments&&!e.pinned()){if(!Cn(e,e=>{if(e instanceof ln)return Fn}))return p(Ke,e,e).optimize(t)}return e})),ci(Pt,(function(e){return e})),ci(et,(function(e,t){return e.expression&&!e.is_star&&ki(e.expression,t)&&(e.expression=null),e})),ci(Xe,(function(e,t){if(!t.option("evaluate")||t.parent()instanceof He)return e;for(var n=[],i=0;i=2015&&(!(n instanceof RegExp)||n.test(e.key+""))){var i=e.key,r=e.value;if((r instanceof Ke&&Array.isArray(r.body)&&!r.contains_this()||r instanceof Be)&&!r.name)return p(Lt,e,{async:r.async,is_generator:r.is_generator,key:i instanceof de?i:p(jt,e,{name:i}),value:p(Ve,r,r),quote:e.quote})}return e})),ci(Ge,(function(e,t){if(1==t.option("pure_getters")&&t.option("unused")&&!e.is_array&&Array.isArray(e.names)&&!function(e){for(var t=[/^VarDef$/,/^(Const|Let|Var)$/,/^Export$/],n=0,i=0,r=t.length;n1)throw new Error("inline source map only works with singular input");n.sourceMap.content=(i=e[f],r=void 0,(r=/(?:^|[^.])\/\/# sourceMappingURL=data:application\/json(;[\w=-]*)?;base64,([+/0-9A-Za-z]*=*)\s*$/.exec(i))?mr(r[2]):(de.warn("inline source map not found"),null))}c=n.parse.toplevel}s&&"strict"!==n.mangle.properties.keep_quoted&&pr(c,s),n.wrap&&(c=c.wrap_commonjs(n.wrap)),n.enclose&&(c=c.wrap_enclose(n.enclose)),u&&(u.rename=Date.now()),u&&(u.compress=Date.now()),n.compress&&(c=new ui(n.compress).compress(c)),u&&(u.scope=Date.now()),n.mangle&&c.figure_out_scope(n.mangle),u&&(u.mangle=Date.now()),n.mangle&&(jn.reset(),c.compute_char_frequency(n.mangle),c.mangle_names(n.mangle)),u&&(u.properties=Date.now()),n.mangle&&n.mangle.properties&&(c=dr(c,n.mangle.properties)),u&&(u.output=Date.now());var p={};if(n.output.ast&&(p.ast=c),!D(n.output,"code")||n.output.code){if(n.sourceMap&&("string"==typeof n.sourceMap.content&&(n.sourceMap.content=JSON.parse(n.sourceMap.content)),n.output.source_map=function(e){e=o(e,{file:null,root:null,orig:null,orig_line_diff:0,dest_line_diff:0});var n=new t.SourceMapGenerator({file:e.file,sourceRoot:e.root}),i=e.orig&&new t.SourceMapConsumer(e.orig);return i&&i.sources.forEach((function(e){var t=i.sourceContentFor(e,!0);t&&n.setSourceContent(e,t)})),{add:function(t,r,o,a,s,u){if(i){var c=i.originalPositionFor({line:a,column:s});if(null===c.source)return;t=c.source,a=c.line,s=c.column,u=c.name||u}n.addMapping({generated:{line:r+e.dest_line_diff,column:o},original:{line:a+e.orig_line_diff,column:s},source:t,name:u})},get:function(){return n},toString:function(){return JSON.stringify(n.toJSON())}}}({file:n.sourceMap.filename,orig:n.sourceMap.content,root:n.sourceMap.root}),n.sourceMap.includeSources)){if(e instanceof Ie)throw new Error("original source content unavailable");for(var f in e)D(e,f)&&n.output.source_map.get().setSourceContent(f,e[f])}delete n.output.ast,delete n.output.code;var _=Un(n.output);if(c.print(_),p.code=_.get(),n.sourceMap)if(n.sourceMap.asObject?p.map=n.output.source_map.get().toJSON():p.map=n.output.source_map.toString(),"inline"==n.sourceMap.url){var d="object"==typeof p.map?JSON.stringify(p.map):p.map;p.code+="\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,"+hr(d)}else n.sourceMap.url&&(p.code+="\n//# sourceMappingURL="+n.sourceMap.url)}return n.nameCache&&n.mangle&&(n.mangle.cache&&(n.nameCache.vars=Dr(n.mangle.cache)),n.mangle.properties&&n.mangle.properties.cache&&(n.nameCache.props=Dr(n.mangle.properties.cache))),u&&(u.end=Date.now(),p.timings={parse:.001*(u.rename-u.parse),rename:.001*(u.compress-u.rename),compress:.001*(u.scope-u.compress),scope:.001*(u.mangle-u.scope),mangle:.001*(u.properties-u.mangle),properties:.001*(u.output-u.properties),output:.001*(u.end-u.output),total:.001*(u.end-u.start)}),l.length&&(p.warnings=l),p}catch(e){return{error:e}}finally{de.warn_function=a}}!function(){var e=function(e){for(var t=!0,n=0;n1||e.guardedHandlers&&e.guardedHandlers.length)throw new Error("Multiple catch clauses are not supported.");return new at({start:i(e),end:r(e),body:s(e.block).body,bcatch:s(t[0]),bfinally:e.finalizer?new ut(s(e.finalizer)):null})},Property:function(e){var t=e.key,n={start:i(t||e.value),end:r(e.value),key:"Identifier"==t.type?t.name:t.value,value:s(e.value)};return e.computed&&(n.key=s(e.key)),e.method?(n.is_generator=e.value.generator,n.async=e.value.async,e.computed?n.key=s(e.key):n.key=new jt({name:n.key}),new Lt(n)):"init"==e.kind?("Identifier"!=t.type&&"Literal"!=t.type&&(n.key=s(t)),new Nt(n)):("string"!=typeof n.key&&"number"!=typeof n.key||(n.key=new jt({name:n.key})),n.value=new Ve(n.value),"get"==e.kind?new It(n):"set"==e.kind?new kt(n):"method"==e.kind?(n.async=e.value.async,n.is_generator=e.value.generator,n.quote=e.computed?'"':null,new Lt(n)):void 0)},MethodDefinition:function(e){var t={start:i(e),end:r(e),key:e.computed?s(e.key):new jt({name:e.key.name||e.key.value}),value:s(e.value),static:e.static};return"get"==e.kind?new It(t):"set"==e.kind?new kt(t):(t.is_generator=e.value.generator,t.async=e.value.async,new Lt(t))},FieldDefinition:function(e){let t;if(e.computed)t=s(e.key);else{if("Identifier"!==e.key.type)throw new Error("Non-Identifier key in FieldDefinition");t=s(e.key)}return new Vt({start:i(e),end:r(e),key:t,value:s(e.value),static:e.static})},ArrayExpression:function(e){return new Rt({start:i(e),end:r(e),elements:e.elements.map((function(e){return null===e?new vn:s(e)}))})},ObjectExpression:function(e){return new wt({start:i(e),end:r(e),properties:e.properties.map((function(e){return"SpreadElement"===e.type||(e.type="Property"),s(e)}))})},SequenceExpression:function(e){return new Dt({start:i(e),end:r(e),expressions:e.expressions.map(s)})},MemberExpression:function(e){return new(e.computed?At:vt)({start:i(e),end:r(e),property:e.computed?s(e.property):e.property.name,expression:s(e.object)})},SwitchCase:function(e){return new(e.test?ot:rt)({start:i(e),end:r(e),expression:s(e.test),body:e.consequent.map(s)})},VariableDeclaration:function(e){return new("const"===e.kind?pt:"let"===e.kind?ft:lt)({start:i(e),end:r(e),definitions:e.declarations.map(s)})},ImportDeclaration:function(e){var t=null,n=null;return e.specifiers.forEach((function(e){"ImportSpecifier"===e.type?(n||(n=[]),n.push(new dt({start:i(e),end:r(e),foreign_name:s(e.imported),name:s(e.local)}))):"ImportDefaultSpecifier"===e.type?t=s(e.local):"ImportNamespaceSpecifier"===e.type&&(n||(n=[]),n.push(new dt({start:i(e),end:r(e),foreign_name:new rn({name:"*"}),name:s(e.local)})))})),new mt({start:i(e),end:r(e),imported_name:t,imported_names:n,module_name:s(e.source)})},ExportAllDeclaration:function(e){return new ht({start:i(e),end:r(e),exported_names:[new dt({name:new un({name:"*"}),foreign_name:new un({name:"*"})})],module_name:s(e.source)})},ExportNamedDeclaration:function(e){return new ht({start:i(e),end:r(e),exported_definition:s(e.declaration),exported_names:e.specifiers&&e.specifiers.length?e.specifiers.map((function(e){return new dt({foreign_name:s(e.exported),name:s(e.local)})})):null,module_name:s(e.source)})},ExportDefaultDeclaration:function(e){return new ht({start:i(e),end:r(e),exported_value:s(e.declaration),is_default:!0})},Literal:function(e){var t=e.value,n={start:i(e),end:r(e)},o=e.regex;if(o&&o.pattern)return n.value={source:o.pattern,flags:o.flags},new hn(n);if(o){const i=e.raw||t,r=i.match(/^\/(.*)\/(\w*)$/);if(!r)throw new Error("Invalid regex source "+i);const[o,a,s]=r;return n.value={source:a,flags:s},new hn(n)}if(null===t)return new gn(n);switch(typeof t){case"string":return n.value=t,new _n(n);case"number":return n.value=t,new dn(n);case"boolean":return new(t?bn:yn)(n)}},MetaProperty:function(e){if("new"===e.meta.name&&"target"===e.property.name)return new Gt({start:i(e),end:r(e)})},Identifier:function(e){var t=a[a.length-2];return new("LabeledStatement"==t.type?on:"VariableDeclarator"==t.type&&t.id===e?"const"==t.kind?Wt:"let"==t.kind?Yt:Xt:/Import.*Specifier/.test(t.type)?t.local===e?nn:rn:"ExportSpecifier"==t.type?t.local===e?sn:un:"FunctionExpression"==t.type?t.id===e?Jt:qt:"FunctionDeclaration"==t.type?t.id===e?$t:qt:"ArrowFunctionExpression"==t.type?t.params.includes(e)?qt:an:"ClassExpression"==t.type?t.id===e?en:an:"Property"==t.type?t.key===e&&t.computed||t.value===e?an:jt:"FieldDefinition"==t.type?t.key===e&&t.computed||t.value===e?an:Zt:"ClassDeclaration"==t.type?t.id===e?Qt:an:"MethodDefinition"==t.type?t.computed?an:jt:"CatchClause"==t.type?tn:"BreakStatement"==t.type||"ContinueStatement"==t.type?cn:an)({start:i(e),end:r(e),name:e.name})},BigIntLiteral:e=>new mn({start:i(e),end:r(e),value:e.value})};function n(e){if("Literal"==e.type)return null!=e.raw?e.raw:e.value+""}function i(e){var t=e.loc,i=t&&t.start,r=e.range;return new _e({file:t&&t.source,line:i&&i.line,col:i&&i.column,pos:r?r[0]:e.start,endline:i&&i.line,endcol:i&&i.column,endpos:r?r[0]:e.start,raw:n(e)})}function r(e){var t=e.loc,i=t&&t.end,r=e.range;return new _e({file:t&&t.source,line:i&&i.line,col:i&&i.column,pos:r?r[1]:e.end,endline:i&&i.line,endcol:i&&i.column,endpos:r?r[1]:e.end,raw:n(e)})}function o(e,n,o){var a="function From_Moz_"+e+"(M){\n";a+="return new U2."+n.name+"({\nstart: my_start_token(M),\nend: my_end_token(M)";var c="function To_Moz_"+e+"(M){\n";c+="return {\ntype: "+JSON.stringify(e),o&&o.split(/\s*,\s*/).forEach((function(e){var t=/([a-z0-9$_]+)([=@>%])([a-z0-9$_]+)/i.exec(e);if(!t)throw new Error("Can't understand property map: "+e);var n=t[1],i=t[2],r=t[3];switch(a+=",\n"+r+": ",c+=",\n"+n+": ",i){case"@":a+="M."+n+".map(from_moz)",c+="M."+r+".map(to_moz)";break;case">":a+="from_moz(M."+n+")",c+="to_moz(M."+r+")";break;case"=":a+="M."+n,c+="M."+r;break;case"%":a+="from_moz(M."+n+").body",c+="to_moz_block(M)";break;default:throw new Error("Can't understand operator in propmap: "+e)}})),a+="\n})\n}",c+="\n}\n}",a=new Function("U2","my_start_token","my_end_token","from_moz","return("+a+")")(kn,i,r,s),c=new Function("to_moz","to_moz_block","to_moz_scope","return("+c+")")(l,_,d),t[e]=a,u(n,c)}t.UpdateExpression=t.UnaryExpression=function(e){return new(("prefix"in e?e.prefix:"UnaryExpression"==e.type)?yt:bt)({start:i(e),end:r(e),operator:e.operator,expression:s(e.argument)})},t.ClassDeclaration=t.ClassExpression=function(e){return new("ClassDeclaration"===e.type?Bt:Kt)({start:i(e),end:r(e),name:s(e.id),extends:s(e.superClass),properties:e.body.body.map(s)})},o("EmptyStatement",Te),o("BlockStatement",Ae,"body@body"),o("IfStatement",tt,"test>condition, consequent>body, alternate>alternative"),o("LabeledStatement",be,"label>label, body>body"),o("BreakStatement",Ze,"label>label"),o("ContinueStatement",Je,"label>label"),o("WithStatement",Ne,"object>expression, body>body"),o("SwitchStatement",nt,"discriminant>expression, cases@body"),o("ReturnStatement",qe,"argument>value"),o("ThrowStatement",$e,"argument>value"),o("WhileStatement",Me,"test>condition, body>body"),o("DoWhileStatement",Fe,"test>condition, body>body"),o("ForStatement",Re,"init>init, test>condition, update>step, body>body"),o("ForInStatement",we,"left>init, right>object, body>body"),o("ForOfStatement",xe,"left>init, right>object, body>body, await=await"),o("AwaitExpression",Qe,"argument>expression"),o("YieldExpression",et,"argument>expression, delegate=is_star"),o("DebuggerStatement",he),o("VariableDeclarator",_t,"id>name, init>value"),o("CatchClause",st,"param>argname, body%body"),o("ThisExpression",ln),o("Super",fn),o("BinaryExpression",Ct,"operator=operator, left>left, right>right"),o("LogicalExpression",Ct,"operator=operator, left>left, right>right"),o("AssignmentExpression",Ft,"operator=operator, left>left, right>right"),o("ConditionalExpression",Ot,"test>condition, consequent>consequent, alternate>alternative"),o("NewExpression",gt,"callee>expression, arguments@args"),o("CallExpression",Et,"callee>expression, arguments@args"),u(Ie,(function(e){return d("Program",e)})),u(Le,(function(e){return{type:f()?"RestElement":"SpreadElement",argument:l(e.expression)}})),u(He,(function(e){return{type:"TaggedTemplateExpression",tag:l(e.prefix),quasi:l(e.template_string)}})),u(Xe,(function(e){for(var t=[],n=[],i=0;i({type:"BigIntLiteral",value:e.value})),Tn.DEFMETHOD("to_mozilla_ast",pn.prototype.to_mozilla_ast),gn.DEFMETHOD("to_mozilla_ast",pn.prototype.to_mozilla_ast),vn.DEFMETHOD("to_mozilla_ast",(function(){return null})),ve.DEFMETHOD("to_mozilla_ast",Ae.prototype.to_mozilla_ast),Pe.DEFMETHOD("to_mozilla_ast",Be.prototype.to_mozilla_ast);var a=null;function s(e){a.push(e);var n=null!=e?t[e.type](e):null;return a.pop(),n}function u(e,t){e.DEFMETHOD("to_mozilla_ast",(function(e){return n=this,i=t(this,e),r=n.start,o=n.end,r&&o?(null!=r.pos&&null!=o.endpos&&(i.range=[r.pos,o.endpos]),r.line&&(i.loc={start:{line:r.line,column:r.col},end:o.endline?{line:o.endline,column:o.endcol}:null},r.file&&(i.loc.source=r.file)),i):i;var n,i,r,o}))}de.from_mozilla_ast=function(e){var t=a;a=[];var n=s(e);return a=t,n};var c=null;function l(e){null===c&&(c=[]),c.push(e);var t=null!=e?e.to_mozilla_ast(c[c.length-2]):null;return c.pop(),0===c.length&&(c=null),t}function f(){for(var e=c.length;e--;)if(c[e]instanceof Ge)return!0;return!1}function _(e){return{type:"BlockStatement",body:e.body.map(l)}}function d(e,t){var n=t.body.map(l);return t.body[0]instanceof ge&&t.body[0].body instanceof _n&&n.unshift(l(new Te(t.body[0]))),{type:e,body:n}}}(),e.AST_Accessor=Ve,e.AST_Array=Rt,e.AST_Arrow=Ke,e.AST_Assign=Ft,e.AST_Atom=En,e.AST_Await=Qe,e.AST_Binary=Ct,e.AST_Block=ve,e.AST_BlockStatement=Ae,e.AST_Boolean=Tn,e.AST_Break=Ze,e.AST_Call=Et,e.AST_Case=ot,e.AST_Catch=st,e.AST_Class=Pt,e.AST_ClassExpression=Kt,e.AST_ConciseMethod=Lt,e.AST_Conditional=Ot,e.AST_Const=pt,e.AST_Constant=pn,e.AST_Continue=Je,e.AST_DWLoop=Oe,e.AST_Debugger=he,e.AST_DefClass=Bt,e.AST_Default=rt,e.AST_DefaultAssign=Mt,e.AST_Definitions=ct,e.AST_Defun=Ue,e.AST_Destructuring=Ge,e.AST_Directive=Ee,e.AST_Do=Fe,e.AST_Dot=vt,e.AST_EmptyStatement=Te,e.AST_Exit=Ye,e.AST_Expansion=Le,e.AST_Export=ht,e.AST_False=yn,e.AST_Finally=ut,e.AST_For=Re,e.AST_ForIn=we,e.AST_ForOf=xe,e.AST_Function=Be,e.AST_Hole=vn,e.AST_If=tt,e.AST_Import=mt,e.AST_Infinity=An,e.AST_IterationStatement=Ce,e.AST_Jump=We,e.AST_Label=on,e.AST_LabelRef=cn,e.AST_LabeledStatement=be,e.AST_Lambda=Pe,e.AST_Let=ft,e.AST_LoopControl=je,e.AST_NaN=Dn,e.AST_NameMapping=dt,e.AST_New=gt,e.AST_NewTarget=Gt,e.AST_Node=de,e.AST_Null=gn,e.AST_Number=dn,e.AST_Object=wt,e.AST_ObjectGetter=It,e.AST_ObjectKeyVal=Nt,e.AST_ObjectProperty=xt,e.AST_ObjectSetter=kt,e.AST_PrefixedTemplateString=He,e.AST_PropAccess=St,e.AST_RegExp=hn,e.AST_Return=qe,e.AST_Scope=ke,e.AST_Sequence=Dt,e.AST_SimpleStatement=ge,e.AST_Statement=me,e.AST_StatementWithBody=ye,e.AST_String=_n,e.AST_Sub=At,e.AST_Super=fn,e.AST_Switch=nt,e.AST_SwitchBranch=it,e.AST_Symbol=Ut,e.AST_SymbolBlockDeclaration=zt,e.AST_SymbolCatch=tn,e.AST_SymbolClass=en,e.AST_SymbolConst=Wt,e.AST_SymbolDeclaration=Ht,e.AST_SymbolDefClass=Qt,e.AST_SymbolDefun=$t,e.AST_SymbolExport=sn,e.AST_SymbolExportForeign=un,e.AST_SymbolFunarg=qt,e.AST_SymbolImport=nn,e.AST_SymbolImportForeign=rn,e.AST_SymbolLambda=Jt,e.AST_SymbolLet=Yt,e.AST_SymbolMethod=jt,e.AST_SymbolRef=an,e.AST_SymbolVar=Xt,e.AST_TemplateSegment=ze,e.AST_TemplateString=Xe,e.AST_This=ln,e.AST_Throw=$e,e.AST_Token=_e,e.AST_Toplevel=Ie,e.AST_True=bn,e.AST_Try=at,e.AST_Unary=Tt,e.AST_UnaryPostfix=bt,e.AST_UnaryPrefix=yt,e.AST_Undefined=Sn,e.AST_Var=lt,e.AST_VarDef=_t,e.AST_While=Me,e.AST_With=Ne,e.AST_Yield=et,e.Compressor=ui,e.OutputStream=Un,e.TreeTransformer=Rn,e.TreeWalker=Mn,e._INLINE=xn,e._JS_Parse_Error=te,e._NOINLINE=Nn,e._PURE=wn,e._has_annotation=b,e._tokenizer=oe,e.base54=jn,e.default_options=Zn,e.defaults=o,e.mangle_properties=dr,e.minify=Sr,e.parse=fe,e.push_uniq=_,e.reserve_quoted_keys=pr,e.string_template=d,e.to_ascii=mr}));
//# sourceMappingURL=bundle.min.js.map
node_modules/terser/CHANGELOG.md 0000666 00000032223 15042511722 0012343 0 ustar 00 # Changelog
## v4.8.1
- Security fix for RegExps that should not be evaluated (regexp DDOS)
## v4.8.0
- Support for numeric separators (`million = 1_000_000`) was added.
- Assigning properties to a class is now assumed to be pure.
- Fixed bug where `yield` wasn't considered a valid property key in generators.
## v4.7.0
- A bug was fixed where an arrow function would have the wrong size
- `arguments` object is now considered safe to retrieve properties from (useful for `length`, or `0`) even when `pure_getters` is not set.
- Fixed erroneous `const` declarations without value (which is invalid) in some corner cases when using `collapse_vars`.
## v4.6.13
- Fixed issue where ES5 object properties were being turned into ES6 object properties due to more lax unicode rules.
- Fixed parsing of BigInt with lowercase `e` in them.
## v4.6.12
- Fixed subtree comparison code, making it see that `[1,[2, 3]]` is different from `[1, 2, [3]]`
- Printing of unicode identifiers has been improved
## v4.6.11
- Read unused classes' properties and method keys, to figure out if they use other variables.
- Prevent inlining into block scopes when there are name collisions
- Functions are no longer inlined into parameter defaults, because they live in their own special scope.
- When inlining identity functions, take into account the fact they may be used to drop `this` in function calls.
- Nullish coalescing operator (`x ?? y`), plus basic optimization for it.
- Template literals in binary expressions such as `+` have been further optimized
## v4.6.10
- Do not use reduce_vars when classes are present
## v4.6.9
- Check if block scopes actually exist in blocks
## v4.6.8
- Take into account "executed bits" of classes like static properties or computed keys, when checking if a class evaluation might throw or have side effects.
## v4.6.7
- Some new performance gains through a `AST_Node.size()` method which measures a node's source code length without printing it to a string first.
- An issue with setting `--comments` to `false` in the CLI has been fixed.
- Fixed some issues with inlining
- `unsafe_symbols` compress option was added, which turns `Symbol("name")` into just `Symbol()`
- Brought back compress performance improvement through the `AST_Node.equivalent_to(other)` method (which was reverted in v4.6.6).
## v4.6.6
(hotfix release)
- Reverted code to 4.6.4 to allow for more time to investigate an issue.
## v4.6.5 (REVERTED)
- Improved compress performance through using a new method to see if two nodes are equivalent, instead of printing them to a string.
## v4.6.4
- The `"some"` value in the `comments` output option now preserves `@lic` and other important comments when using `//`
- `` is now better escaped in regex, and in comments, when using the `inline_script` output option
- Fixed an issue when transforming `new RegExp` into `/.../` when slashes are included in the source
- `AST_Node.prototype.constructor` now exists, allowing for easier debugging of crashes
- Multiple if statements with the same consequents are now collapsed
- Typescript typings improvements
- Optimizations while looking for surrogate pairs in strings
## v4.6.3
- Annotations such as `/*#__NOINLINE__*/` and `/*#__PURE__*/` may now be preserved using the `preserve_annotations` output option
- A TypeScript definition update for the `keep_quoted` output option.
## v4.6.2
- A bug where functions were inlined into other functions with scope conflicts has been fixed.
- `/*#__NOINLINE__*/` annotation fixed for more use cases where inlining happens.
## v4.6.1
- Fixed an issue where a class is duplicated by reduce_vars when there's a recursive reference to the class.
## v4.6.0
- Fixed issues with recursive class references.
- BigInt evaluation has been prevented, stopping Terser from evaluating BigInts like it would do regular numbers.
- Class property support has been added
## v4.5.1
(hotfix release)
- Fixed issue where `() => ({})[something]` was not parenthesised correctly.
## v4.5.0
- Inlining has been improved
- An issue where keep_fnames combined with functions declared through variables was causing name shadowing has been fixed
- You can now set the ES version through their year
- The output option `keep_numbers` has been added, which prevents Terser from turning `1000` into `1e3` and such
- Internal small optimisations and refactors
## v4.4.3
- Number and BigInt parsing has been fixed
- `/*#__INLINE__*/` annotation fixed for arrow functions with non-block bodies.
- Functional tests have been added, using [this repository](https://github.com/terser/terser-functional-tests).
- A memory leak, where the entire AST lives on after compression, has been plugged.
## v4.4.2
- Fixed a problem with inlining identity functions
## v4.4.1
*note:* This introduced a feature, therefore it should have been a minor release.
- Fixed a crash when `unsafe` was enabled.
- An issue has been fixed where `let` statements might be collapsed out of their scope.
- Some error messages have been improved by adding quotes around variable names.
## v4.4.0
- Added `/*#__INLINE__*/` and `/*#__NOINLINE__*/` annotations for calls. If a call has one of these, it either forces or forbids inlining.
## v4.3.11
- Fixed a problem where `window` was considered safe to access, even though there are situations where it isn't (Node.js, workers...)
- Fixed an error where `++` and `--` were considered side-effect free
- `Number(x)` now needs both `unsafe` and and `unsafe_math` to be compressed into `+x` because `x` might be a `BigInt`
- `keep_fnames` now correctly supports regexes when the function is in a variable declaration
## v4.3.10
- Fixed syntax error when repeated semicolons were encountered in classes
- Fixed invalid output caused by the creation of empty sequences internally
- Scopes are now updated when scopes are inlined into them
## v4.3.9
- Fixed issue with mangle's `keep_fnames` option, introduced when adding code to keep variable names of anonymous functions
## v4.3.8
- Typescript typings fix
## v4.3.7
- Parsing of regex options in the CLI (which broke in v4.3.5) was fixed.
- typescript definition updates
## v4.3.6
(crash hotfix)
## v4.3.5
- Fixed an issue with DOS line endings strings separated by `\` and a new line.
- Improved fix for the output size regression related to unused references within the extends section of a class.
- Variable names of anonymous functions (eg: `const x = () => { ... }` or `var func = function () {...}`) are now preserved when keep_fnames is true.
- Fixed performance degradation introduced for large payloads in v4.2.0
## v4.3.4
- Fixed a regression where the output size was increased when unused classes were referred to in the extends clause of a class.
- Small typescript typings fixes.
- Comments with `@preserve`, `@license`, `@cc_on` as well as comments starting with `/*!` and `/**!` are now preserved by default.
## v4.3.3
- Fixed a problem where parsing template strings would mix up octal notation and a slash followed by a zero representing a null character.
- Started accepting the name `async` in destructuring arguments with default value.
- Now Terser takes into account side effects inside class `extends` clauses.
- Added parens whenever there's a comment between a return statement and the returned value, to prevent issues with ASI.
- Stopped using raw RegExp objects, since the spec is going to continue to evolve. This ensures Terser is able to process new, unknown RegExp flags and features. This is a breaking change in the AST node AST_RegExp.
## v4.3.2
- Typescript typing fix
- Ensure that functions can't be inlined, by reduce_vars, into places where they're accessing variables with the same name, but from somewhere else.
## v4.3.1
- Fixed an issue from 4.3.0 where any block scope within a for loop erroneously had its parent set to the function scopee
- Fixed an issue where compressing IIFEs with argument expansions would result in some parameters becoming undefined
- addEventListener options argument's properties are now part of the DOM properties list.
## v4.3.0
- Do not drop computed object keys with side effects
- Functions passed to other functions in calls are now wrapped in parentheses by default, which speeds up loading most modules
- Objects with computed properties are now less likely to be hoisted
- Speed and memory efficiency optimizations
- Fixed scoping issues with `try` and `switch`
## v4.2.1
- Minor refactors
- Fixed a bug similar to #369 in collapse_vars
- Functions can no longer be inlined into a place where they're going to be compared with themselves.
- reduce_funcs option is now legacy, as using reduce_vars without reduce_funcs caused some weird corner cases. As a result, it is now implied in reduce_vars and can't be turned off without turning off reduce_vars.
- Bug which would cause a random stack overflow has now been fixed.
## v4.2.0
- When the source map URL is `inline`, don't write it to a file.
- Fixed output parens when a lambda literal is the tag on a tagged template string.
- The `mangle.properties.undeclared` option was added. This enables the property mangler to mangle properties of variables which can be found in the name cache, but whose properties are not known to this Terser run.
- The v8 bug where the toString and source representations of regexes like `RegExp("\\\n")` includes an actual newline is now fixed.
- Now we're guaranteed to not have duplicate comments in the output
- Domprops updates
## v4.1.4
- Fixed a crash when inlining a function into somewhere else when it has interdependent, non-removable variables.
## v4.1.3
- Several issues with the `reduce_vars` option were fixed.
- Starting this version, we only have a dist/bundle.min.js
## v4.1.2
- The hotfix was hotfixed
## v4.1.1
- Fixed a bug where toplevel scopes were being mixed up with lambda scopes
## v4.1.0
- Internal functions were replaced by `Object.assign`, `Array.prototype.some`, `Array.prototype.find` and `Array.prototype.every`.
- A serious issue where some ESM-native code was broken was fixed.
- Performance improvements were made.
- Support for BigInt was added.
- Inline efficiency was improved. Functions are now being inlined more proactively instead of being inlined only after another Compressor pass.
## v4.0.2
(Hotfix release. Reverts unmapped segments PR [#342](https://github.com/terser/terser/pull/342), which will be put back on Terser when the upstream issue is resolved)
## v4.0.1
- Collisions between the arguments of inlined functions and names in the outer scope are now being avoided while inlining
- Unmapped segments are now preserved when compressing a file which has source maps
- Default values of functions are now correctly converted from Mozilla AST to Terser AST
- JSON ⊂ ECMAScript spec (if you don't know what this is you don't need to)
- Export AST_* classes to library users
- Fixed issue with `collapse_vars` when functions are created with the same name as a variable which already exists
- Added `MutationObserverInit` (Object with options for initialising a mutation observer) properties to the DOM property list
- Custom `Error` subclasses are now internally used instead of old-school Error inheritance hacks.
- Documentation fixes
- Performance optimizations
## v4.0.0
- **breaking change**: The `variables` property of all scopes has become a standard JavaScript `Map` as opposed to the old bespoke `Dictionary` object.
- Typescript definitions were fixed
- `terser --help` was fixed
- The public interface was cleaned up
- Fixed optimisation of `Array` and `new Array`
- Added the `keep_quoted=strict` mode to mangle_props, which behaves more like Google Closure Compiler by mangling all unquoted property names, instead of reserving quoted property names automatically.
- Fixed parent functions' parameters being shadowed in some cases
- Allowed Terser to run in a situation where there are custom functions attached to Object.prototype
- And more bug fixes, optimisations and internal changes
## v3.17.0
- More DOM properties added to --mangle-properties's DOM property list
- Closed issue where if 2 functions had the same argument name, Terser would not inline them together properly
- Fixed issue with `hasOwnProperty.call`
- You can now list files to minify in a Terser config file
- Started replacing `new Array()` with an array literal
- Started using ES6 capabilities like `Set` and the `includes` method for strings and arrays
## v3.16.1
- Fixed issue where Terser being imported with `import` would cause it not to work due to the `__esModule` property. (PR #254 was submitted, which was nice, but since it wasn't a pure commonJS approach I decided to go with my own solution)
## v3.16.0
- No longer leaves names like Array or Object or window as a SimpleStatement (statement which is just a single expression).
- Add support for sections sourcemaps (IndexedSourceMapConsumer)
- Drops node.js v4 and starts using commonJS
- Is now built with rollup
## v3.15.0
- Inlined spread syntax (`[...[1, 2, 3], 4, 5] => [1, 2, 3, 4, 5]`) in arrays and objects.
- Fixed typo in compressor warning
- Fixed inline source map input bug
- Fixed parsing of template literals with unnecessary escapes (Like `\\a`)
node_modules/terser/bin/terser 0000666 00000040674 15042511722 0012542 0 ustar 00 #!/usr/bin/env node
// -*- js -*-
/* eslint-env node */
"use strict";
require("../tools/exit.js");
var fs = require("fs");
var info = require("../package.json");
var path = require("path");
var program = require("commander");
var Terser = require("..");
try {
require("source-map-support").install();
} catch (err) {}
const skip_keys = new Set([ "cname", "parent_scope", "scope", "uses_eval", "uses_with", "_var_name_cache" ]);
var files = {};
var options = {
compress: false,
mangle: false
};
program.version(info.name + " " + info.version);
program.parseArgv = program.parse;
program.parse = undefined;
if (process.argv.includes("ast")) program.helpInformation = describe_ast;
else if (process.argv.includes("options")) program.helpInformation = function() {
var text = [];
var options = Terser.default_options();
for (var option in options) {
text.push("--" + (option === "output" ? "beautify" : option === "sourceMap" ? "source-map" : option) + " options:");
text.push(format_object(options[option]));
text.push("");
}
return text.join("\n");
};
program.option("-p, --parse ", "Specify parser options.", parse_js());
program.option("-c, --compress [options]", "Enable compressor/specify compressor options.", parse_js());
program.option("-m, --mangle [options]", "Mangle names/specify mangler options.", parse_js());
program.option("--mangle-props [options]", "Mangle properties/specify mangler options.", parse_js());
program.option("-b, --beautify [options]", "Beautify output/specify output options.", parse_js());
program.option("-o, --output ", "Output file (default STDOUT).");
program.option("--comments [filter]", "Preserve copyright comments in the output.");
program.option("--config-file ", "Read minify() options from JSON file.");
program.option("-d, --define [=value]", "Global definitions.", parse_js("define"));
program.option("--ecma ", "Specify ECMAScript release: 5, 2015, 2016 or 2017...");
program.option("-e, --enclose [arg[,...][:value[,...]]]", "Embed output in a big function with configurable arguments and values.");
program.option("--ie8", "Support non-standard Internet Explorer 8.");
program.option("--keep-classnames", "Do not mangle/drop class names.");
program.option("--keep-fnames", "Do not mangle/drop function names. Useful for code relying on Function.prototype.name.");
program.option("--module", "Input is an ES6 module");
program.option("--name-cache ", "File to hold mangled name mappings.");
program.option("--rename", "Force symbol expansion.");
program.option("--no-rename", "Disable symbol expansion.");
program.option("--safari10", "Support non-standard Safari 10.");
program.option("--source-map [options]", "Enable source map/specify source map options.", parse_js());
program.option("--timings", "Display operations run time on STDERR.");
program.option("--toplevel", "Compress and/or mangle variables in toplevel scope.");
program.option("--verbose", "Print diagnostic messages.");
program.option("--warn", "Print warning messages.");
program.option("--wrap ", "Embed everything as a function with “exports” corresponding to “name” globally.");
program.arguments("[files...]").parseArgv(process.argv);
if (program.configFile) {
options = JSON.parse(read_file(program.configFile));
}
if (!program.output && program.sourceMap && program.sourceMap.url != "inline") {
fatal("ERROR: cannot write source map to STDOUT");
}
[
"compress",
"enclose",
"ie8",
"mangle",
"module",
"safari10",
"sourceMap",
"toplevel",
"wrap"
].forEach(function(name) {
if (name in program) {
options[name] = program[name];
}
});
if ("ecma" in program) {
if (program.ecma != (program.ecma | 0)) fatal("ERROR: ecma must be an integer");
const ecma = program.ecma | 0;
if (ecma > 5 && ecma < 2015)
options.ecma = ecma + 2009;
else
options.ecma = ecma;
}
if (program.beautify) {
options.output = typeof program.beautify == "object" ? program.beautify : {};
if (!("beautify" in options.output)) {
options.output.beautify = true;
}
}
if (program.comments) {
if (typeof options.output != "object") options.output = {};
options.output.comments = typeof program.comments == "string" ? (program.comments == "false" ? false : program.comments) : "some";
}
if (program.define) {
if (typeof options.compress != "object") options.compress = {};
if (typeof options.compress.global_defs != "object") options.compress.global_defs = {};
for (var expr in program.define) {
options.compress.global_defs[expr] = program.define[expr];
}
}
if (program.keepClassnames) {
options.keep_classnames = true;
}
if (program.keepFnames) {
options.keep_fnames = true;
}
if (program.mangleProps) {
if (program.mangleProps.domprops) {
delete program.mangleProps.domprops;
} else {
if (typeof program.mangleProps != "object") program.mangleProps = {};
if (!Array.isArray(program.mangleProps.reserved)) program.mangleProps.reserved = [];
}
if (typeof options.mangle != "object") options.mangle = {};
options.mangle.properties = program.mangleProps;
}
if (program.nameCache) {
options.nameCache = JSON.parse(read_file(program.nameCache, "{}"));
}
if (program.output == "ast") {
options.output = {
ast: true,
code: false
};
}
if (program.parse) {
if (!program.parse.acorn && !program.parse.spidermonkey) {
options.parse = program.parse;
} else if (program.sourceMap && program.sourceMap.content == "inline") {
fatal("ERROR: inline source map only works with built-in parser");
}
}
if (~program.rawArgs.indexOf("--rename")) {
options.rename = true;
} else if (!program.rename) {
options.rename = false;
}
var convert_path = function(name) {
return name;
};
if (typeof program.sourceMap == "object" && "base" in program.sourceMap) {
convert_path = function() {
var base = program.sourceMap.base;
delete options.sourceMap.base;
return function(name) {
return path.relative(base, name);
};
}();
}
if (program.verbose) {
options.warnings = "verbose";
} else if (program.warn) {
options.warnings = true;
}
let filesList;
if (options.files && options.files.length) {
filesList = options.files;
delete options.files;
} else if (program.args.length) {
filesList = program.args;
}
if (filesList) {
simple_glob(filesList).forEach(function(name) {
files[convert_path(name)] = read_file(name);
});
run();
} else {
var chunks = [];
process.stdin.setEncoding("utf8");
process.stdin.on("data", function(chunk) {
chunks.push(chunk);
}).on("end", function() {
files = [ chunks.join("") ];
run();
});
process.stdin.resume();
}
function convert_ast(fn) {
return Terser.AST_Node.from_mozilla_ast(Object.keys(files).reduce(fn, null));
}
function run() {
Terser.AST_Node.warn_function = function(msg) {
print_error("WARN: " + msg);
};
var content = program.sourceMap && program.sourceMap.content;
if (content && content !== "inline") {
options.sourceMap.content = read_file(content, content);
}
if (program.timings) options.timings = true;
try {
if (program.parse) {
if (program.parse.acorn) {
files = convert_ast(function(toplevel, name) {
return require("acorn").parse(files[name], {
ecmaVersion: 2018,
locations: true,
program: toplevel,
sourceFile: name,
sourceType: options.module || program.parse.module ? "module" : "script"
});
});
} else if (program.parse.spidermonkey) {
files = convert_ast(function(toplevel, name) {
var obj = JSON.parse(files[name]);
if (!toplevel) return obj;
toplevel.body = toplevel.body.concat(obj.body);
return toplevel;
});
}
}
} catch (ex) {
fatal(ex);
}
var result = Terser.minify(files, options);
if (result.error) {
var ex = result.error;
if (ex.name == "SyntaxError") {
print_error("Parse error at " + ex.filename + ":" + ex.line + "," + ex.col);
var col = ex.col;
var lines = files[ex.filename].split(/\r?\n/);
var line = lines[ex.line - 1];
if (!line && !col) {
line = lines[ex.line - 2];
col = line.length;
}
if (line) {
var limit = 70;
if (col > limit) {
line = line.slice(col - limit);
col = limit;
}
print_error(line.slice(0, 80));
print_error(line.slice(0, col).replace(/\S/g, " ") + "^");
}
}
if (ex.defs) {
print_error("Supported options:");
print_error(format_object(ex.defs));
}
fatal(ex);
} else if (program.output == "ast") {
if (!options.compress && !options.mangle) {
result.ast.figure_out_scope({});
}
print(JSON.stringify(result.ast, function(key, value) {
if (value) switch (key) {
case "thedef":
return symdef(value);
case "enclosed":
return value.length ? value.map(symdef) : undefined;
case "variables":
case "functions":
case "globals":
return value.size ? collect_from_map(value, symdef) : undefined;
}
if (skip_keys.has(key)) return;
if (value instanceof Terser.AST_Token) return;
if (value instanceof Map) return;
if (value instanceof Terser.AST_Node) {
var result = {
_class: "AST_" + value.TYPE
};
if (value.block_scope) {
result.variables = value.block_scope.variables;
result.functions = value.block_scope.functions;
result.enclosed = value.block_scope.enclosed;
}
value.CTOR.PROPS.forEach(function(prop) {
if (prop === "block_scope") return;
result[prop] = value[prop];
});
return result;
}
return value;
}, 2));
} else if (program.output == "spidermonkey") {
print(JSON.stringify(Terser.minify(result.code, {
compress: false,
mangle: false,
output: {
ast: true,
code: false
}
}).ast.to_mozilla_ast(), null, 2));
} else if (program.output) {
fs.writeFileSync(program.output, result.code);
if (options.sourceMap.url !== "inline" && result.map) {
fs.writeFileSync(program.output + ".map", result.map);
}
} else {
print(result.code);
}
if (program.nameCache) {
fs.writeFileSync(program.nameCache, JSON.stringify(options.nameCache));
}
if (result.timings) for (var phase in result.timings) {
print_error("- " + phase + ": " + result.timings[phase].toFixed(3) + "s");
}
}
function fatal(message) {
if (message instanceof Error) message = message.stack.replace(/^\S*?Error:/, "ERROR:");
print_error(message);
process.exit(1);
}
// A file glob function that only supports "*" and "?" wildcards in the basename.
// Example: "foo/bar/*baz??.*.js"
// Argument `glob` may be a string or an array of strings.
// Returns an array of strings. Garbage in, garbage out.
function simple_glob(glob) {
if (Array.isArray(glob)) {
return [].concat.apply([], glob.map(simple_glob));
}
if (glob && glob.match(/[*?]/)) {
var dir = path.dirname(glob);
try {
var entries = fs.readdirSync(dir);
} catch (ex) {}
if (entries) {
var pattern = "^" + path.basename(glob)
.replace(/[.+^$[\]\\(){}]/g, "\\$&")
.replace(/\*/g, "[^/\\\\]*")
.replace(/\?/g, "[^/\\\\]") + "$";
var mod = process.platform === "win32" ? "i" : "";
var rx = new RegExp(pattern, mod);
var results = entries.filter(function(name) {
return rx.test(name);
}).map(function(name) {
return path.join(dir, name);
});
if (results.length) return results;
}
}
return [ glob ];
}
function read_file(path, default_value) {
try {
return fs.readFileSync(path, "utf8");
} catch (ex) {
if ((ex.code == "ENOENT" || ex.code == "ENAMETOOLONG") && default_value != null) return default_value;
fatal(ex);
}
}
function parse_js(flag) {
return function(value, options) {
options = options || {};
try {
Terser.parse(value, {
expression: true
}).walk(new Terser.TreeWalker(function(node) {
if (node instanceof Terser.AST_Assign) {
var name = node.left.print_to_string();
var value = node.right;
if (flag) {
options[name] = value;
} else if (value instanceof Terser.AST_Array) {
options[name] = value.elements.map(to_string);
} else if (value instanceof Terser.AST_RegExp) {
value = value.value;
options[name] = new RegExp(value.source, value.flags);
} else {
options[name] = to_string(value);
}
return true;
}
if (node instanceof Terser.AST_Symbol || node instanceof Terser.AST_PropAccess) {
var name = node.print_to_string();
options[name] = true;
return true;
}
if (!(node instanceof Terser.AST_Sequence)) throw node;
function to_string(value) {
return value instanceof Terser.AST_Constant ? value.getValue() : value.print_to_string({
quote_keys: true
});
}
}));
} catch(ex) {
if (flag) {
fatal("Error parsing arguments for '" + flag + "': " + value);
} else {
options[value] = null;
}
}
return options;
};
}
function symdef(def) {
var ret = (1e6 + def.id) + " " + def.name;
if (def.mangled_name) ret += " " + def.mangled_name;
return ret;
}
function collect_from_map(map, callback) {
var result = [];
map.forEach(function (def) {
result.push(callback(def));
});
return result;
}
function format_object(obj) {
var lines = [];
var padding = "";
Object.keys(obj).map(function(name) {
if (padding.length < name.length) padding = Array(name.length + 1).join(" ");
return [ name, JSON.stringify(obj[name]) ];
}).forEach(function(tokens) {
lines.push(" " + tokens[0] + padding.slice(tokens[0].length - 2) + tokens[1]);
});
return lines.join("\n");
}
function print_error(msg) {
process.stderr.write(msg);
process.stderr.write("\n");
}
function print(txt) {
process.stdout.write(txt);
process.stdout.write("\n");
}
function describe_ast() {
var out = Terser.OutputStream({ beautify: true });
function doitem(ctor) {
out.print("AST_" + ctor.TYPE);
var props = ctor.SELF_PROPS.filter(function(prop) {
return !/^\$/.test(prop);
});
if (props.length > 0) {
out.space();
out.with_parens(function() {
props.forEach(function(prop, i) {
if (i) out.space();
out.print(prop);
});
});
}
if (ctor.documentation) {
out.space();
out.print_string(ctor.documentation);
}
if (ctor.SUBCLASSES.length > 0) {
out.space();
out.with_block(function() {
ctor.SUBCLASSES.forEach(function(ctor, i) {
out.indent();
doitem(ctor);
out.newline();
});
});
}
}
doitem(Terser.AST_Node);
return out + "\n";
}
node_modules/terser/bin/uglifyjs 0000666 00000000366 15042511722 0013064 0 ustar 00 #!/usr/bin/env node
// -*- js -*-
/* eslint-env node */
"use strict";
process.stderr.write( "DEPRECATION WARNING: uglifyjs binary will soon be discontinued!\n");
process.stderr.write("Please use \"terser\" instead.\n\n");
require("./terser");
node_modules/terser/tools/exit.js 0000666 00000000725 15042511722 0013203 0 ustar 00 // workaround for tty output truncation upon process.exit()
var exit = process.exit;
process.exit = function() {
var args = [].slice.call(arguments);
process.once("uncaughtException", function() {
(function callback() {
if (process.stdout.bufferSize || process.stderr.bufferSize) {
setImmediate(callback);
} else {
exit.apply(process, args);
}
})();
});
throw exit;
};
node_modules/terser/tools/domprops.js 0000666 00000353707 15042511722 0014110 0 ustar 00 export var domprops = [
"$&",
"$'",
"$*",
"$+",
"$1",
"$2",
"$3",
"$4",
"$5",
"$6",
"$7",
"$8",
"$9",
"$_",
"$`",
"$input",
"@@iterator",
"ABORT_ERR",
"ACTIVE",
"ACTIVE_ATTRIBUTES",
"ACTIVE_TEXTURE",
"ACTIVE_UNIFORMS",
"ADDITION",
"ALIASED_LINE_WIDTH_RANGE",
"ALIASED_POINT_SIZE_RANGE",
"ALLOW_KEYBOARD_INPUT",
"ALLPASS",
"ALPHA",
"ALPHA_BITS",
"ALT_MASK",
"ALWAYS",
"ANY_TYPE",
"ANY_UNORDERED_NODE_TYPE",
"ARRAY_BUFFER",
"ARRAY_BUFFER_BINDING",
"ATTACHED_SHADERS",
"ATTRIBUTE_NODE",
"AT_TARGET",
"AddSearchProvider",
"AnalyserNode",
"AnimationEvent",
"AnonXMLHttpRequest",
"ApplicationCache",
"ApplicationCacheErrorEvent",
"Array",
"ArrayBuffer",
"Attr",
"Audio",
"AudioBuffer",
"AudioBufferSourceNode",
"AudioContext",
"AudioDestinationNode",
"AudioListener",
"AudioNode",
"AudioParam",
"AudioProcessingEvent",
"AudioStreamTrack",
"AutocompleteErrorEvent",
"BACK",
"BAD_BOUNDARYPOINTS_ERR",
"BANDPASS",
"BLEND",
"BLEND_COLOR",
"BLEND_DST_ALPHA",
"BLEND_DST_RGB",
"BLEND_EQUATION",
"BLEND_EQUATION_ALPHA",
"BLEND_EQUATION_RGB",
"BLEND_SRC_ALPHA",
"BLEND_SRC_RGB",
"BLUE_BITS",
"BLUR",
"BOOL",
"BOOLEAN_TYPE",
"BOOL_VEC2",
"BOOL_VEC3",
"BOOL_VEC4",
"BOTH",
"BROWSER_DEFAULT_WEBGL",
"BUBBLING_PHASE",
"BUFFER_SIZE",
"BUFFER_USAGE",
"BYTE",
"BYTES_PER_ELEMENT",
"BarProp",
"BaseHref",
"BatteryManager",
"BeforeLoadEvent",
"BeforeUnloadEvent",
"BiquadFilterNode",
"Blob",
"BlobEvent",
"Boolean",
"CAPTURING_PHASE",
"CCW",
"CDATASection",
"CDATA_SECTION_NODE",
"CHANGE",
"CHARSET_RULE",
"CHECKING",
"CLAMP_TO_EDGE",
"CLICK",
"CLOSED",
"CLOSING",
"COLOR_ATTACHMENT0",
"COLOR_BUFFER_BIT",
"COLOR_CLEAR_VALUE",
"COLOR_WRITEMASK",
"COMMENT_NODE",
"COMPILE_STATUS",
"COMPRESSED_RGBA_S3TC_DXT1_EXT",
"COMPRESSED_RGBA_S3TC_DXT3_EXT",
"COMPRESSED_RGBA_S3TC_DXT5_EXT",
"COMPRESSED_RGB_S3TC_DXT1_EXT",
"COMPRESSED_TEXTURE_FORMATS",
"CONNECTING",
"CONSTANT_ALPHA",
"CONSTANT_COLOR",
"CONSTRAINT_ERR",
"CONTEXT_LOST_WEBGL",
"CONTROL_MASK",
"COUNTER_STYLE_RULE",
"CSS",
"CSS2Properties",
"CSSCharsetRule",
"CSSConditionRule",
"CSSCounterStyleRule",
"CSSFontFaceRule",
"CSSFontFeatureValuesRule",
"CSSGroupingRule",
"CSSImportRule",
"CSSKeyframeRule",
"CSSKeyframesRule",
"CSSMediaRule",
"CSSMozDocumentRule",
"CSSNameSpaceRule",
"CSSPageRule",
"CSSPrimitiveValue",
"CSSRule",
"CSSRuleList",
"CSSStyleDeclaration",
"CSSStyleRule",
"CSSStyleSheet",
"CSSSupportsRule",
"CSSUnknownRule",
"CSSValue",
"CSSValueList",
"CSSVariablesDeclaration",
"CSSVariablesRule",
"CSSViewportRule",
"CSS_ATTR",
"CSS_CM",
"CSS_COUNTER",
"CSS_CUSTOM",
"CSS_DEG",
"CSS_DIMENSION",
"CSS_EMS",
"CSS_EXS",
"CSS_FILTER_BLUR",
"CSS_FILTER_BRIGHTNESS",
"CSS_FILTER_CONTRAST",
"CSS_FILTER_CUSTOM",
"CSS_FILTER_DROP_SHADOW",
"CSS_FILTER_GRAYSCALE",
"CSS_FILTER_HUE_ROTATE",
"CSS_FILTER_INVERT",
"CSS_FILTER_OPACITY",
"CSS_FILTER_REFERENCE",
"CSS_FILTER_SATURATE",
"CSS_FILTER_SEPIA",
"CSS_GRAD",
"CSS_HZ",
"CSS_IDENT",
"CSS_IN",
"CSS_INHERIT",
"CSS_KHZ",
"CSS_MATRIX",
"CSS_MATRIX3D",
"CSS_MM",
"CSS_MS",
"CSS_NUMBER",
"CSS_PC",
"CSS_PERCENTAGE",
"CSS_PERSPECTIVE",
"CSS_PRIMITIVE_VALUE",
"CSS_PT",
"CSS_PX",
"CSS_RAD",
"CSS_RECT",
"CSS_RGBCOLOR",
"CSS_ROTATE",
"CSS_ROTATE3D",
"CSS_ROTATEX",
"CSS_ROTATEY",
"CSS_ROTATEZ",
"CSS_S",
"CSS_SCALE",
"CSS_SCALE3D",
"CSS_SCALEX",
"CSS_SCALEY",
"CSS_SCALEZ",
"CSS_SKEW",
"CSS_SKEWX",
"CSS_SKEWY",
"CSS_STRING",
"CSS_TRANSLATE",
"CSS_TRANSLATE3D",
"CSS_TRANSLATEX",
"CSS_TRANSLATEY",
"CSS_TRANSLATEZ",
"CSS_UNKNOWN",
"CSS_URI",
"CSS_VALUE_LIST",
"CSS_VH",
"CSS_VMAX",
"CSS_VMIN",
"CSS_VW",
"CULL_FACE",
"CULL_FACE_MODE",
"CURRENT_PROGRAM",
"CURRENT_VERTEX_ATTRIB",
"CUSTOM",
"CW",
"CanvasGradient",
"CanvasPattern",
"CanvasRenderingContext2D",
"CaretPosition",
"ChannelMergerNode",
"ChannelSplitterNode",
"CharacterData",
"ClientRect",
"ClientRectList",
"Clipboard",
"ClipboardEvent",
"CloseEvent",
"Collator",
"CommandEvent",
"Comment",
"CompositionEvent",
"Console",
"Controllers",
"ConvolverNode",
"Counter",
"Crypto",
"CryptoKey",
"CustomEvent",
"DATABASE_ERR",
"DATA_CLONE_ERR",
"DATA_ERR",
"DBLCLICK",
"DECR",
"DECR_WRAP",
"DELETE_STATUS",
"DEPTH_ATTACHMENT",
"DEPTH_BITS",
"DEPTH_BUFFER_BIT",
"DEPTH_CLEAR_VALUE",
"DEPTH_COMPONENT",
"DEPTH_COMPONENT16",
"DEPTH_FUNC",
"DEPTH_RANGE",
"DEPTH_STENCIL",
"DEPTH_STENCIL_ATTACHMENT",
"DEPTH_TEST",
"DEPTH_WRITEMASK",
"DIRECTION_DOWN",
"DIRECTION_LEFT",
"DIRECTION_RIGHT",
"DIRECTION_UP",
"DISABLED",
"DISPATCH_REQUEST_ERR",
"DITHER",
"DOCUMENT_FRAGMENT_NODE",
"DOCUMENT_NODE",
"DOCUMENT_POSITION_CONTAINED_BY",
"DOCUMENT_POSITION_CONTAINS",
"DOCUMENT_POSITION_DISCONNECTED",
"DOCUMENT_POSITION_FOLLOWING",
"DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC",
"DOCUMENT_POSITION_PRECEDING",
"DOCUMENT_TYPE_NODE",
"DOMCursor",
"DOMError",
"DOMException",
"DOMImplementation",
"DOMImplementationLS",
"DOMMatrix",
"DOMMatrixReadOnly",
"DOMParser",
"DOMPoint",
"DOMPointReadOnly",
"DOMQuad",
"DOMRect",
"DOMRectList",
"DOMRectReadOnly",
"DOMRequest",
"DOMSTRING_SIZE_ERR",
"DOMSettableTokenList",
"DOMStringList",
"DOMStringMap",
"DOMTokenList",
"DOMTransactionEvent",
"DOM_DELTA_LINE",
"DOM_DELTA_PAGE",
"DOM_DELTA_PIXEL",
"DOM_INPUT_METHOD_DROP",
"DOM_INPUT_METHOD_HANDWRITING",
"DOM_INPUT_METHOD_IME",
"DOM_INPUT_METHOD_KEYBOARD",
"DOM_INPUT_METHOD_MULTIMODAL",
"DOM_INPUT_METHOD_OPTION",
"DOM_INPUT_METHOD_PASTE",
"DOM_INPUT_METHOD_SCRIPT",
"DOM_INPUT_METHOD_UNKNOWN",
"DOM_INPUT_METHOD_VOICE",
"DOM_KEY_LOCATION_JOYSTICK",
"DOM_KEY_LOCATION_LEFT",
"DOM_KEY_LOCATION_MOBILE",
"DOM_KEY_LOCATION_NUMPAD",
"DOM_KEY_LOCATION_RIGHT",
"DOM_KEY_LOCATION_STANDARD",
"DOM_VK_0",
"DOM_VK_1",
"DOM_VK_2",
"DOM_VK_3",
"DOM_VK_4",
"DOM_VK_5",
"DOM_VK_6",
"DOM_VK_7",
"DOM_VK_8",
"DOM_VK_9",
"DOM_VK_A",
"DOM_VK_ACCEPT",
"DOM_VK_ADD",
"DOM_VK_ALT",
"DOM_VK_ALTGR",
"DOM_VK_AMPERSAND",
"DOM_VK_ASTERISK",
"DOM_VK_AT",
"DOM_VK_ATTN",
"DOM_VK_B",
"DOM_VK_BACKSPACE",
"DOM_VK_BACK_QUOTE",
"DOM_VK_BACK_SLASH",
"DOM_VK_BACK_SPACE",
"DOM_VK_C",
"DOM_VK_CANCEL",
"DOM_VK_CAPS_LOCK",
"DOM_VK_CIRCUMFLEX",
"DOM_VK_CLEAR",
"DOM_VK_CLOSE_BRACKET",
"DOM_VK_CLOSE_CURLY_BRACKET",
"DOM_VK_CLOSE_PAREN",
"DOM_VK_COLON",
"DOM_VK_COMMA",
"DOM_VK_CONTEXT_MENU",
"DOM_VK_CONTROL",
"DOM_VK_CONVERT",
"DOM_VK_CRSEL",
"DOM_VK_CTRL",
"DOM_VK_D",
"DOM_VK_DECIMAL",
"DOM_VK_DELETE",
"DOM_VK_DIVIDE",
"DOM_VK_DOLLAR",
"DOM_VK_DOUBLE_QUOTE",
"DOM_VK_DOWN",
"DOM_VK_E",
"DOM_VK_EISU",
"DOM_VK_END",
"DOM_VK_ENTER",
"DOM_VK_EQUALS",
"DOM_VK_EREOF",
"DOM_VK_ESCAPE",
"DOM_VK_EXCLAMATION",
"DOM_VK_EXECUTE",
"DOM_VK_EXSEL",
"DOM_VK_F",
"DOM_VK_F1",
"DOM_VK_F10",
"DOM_VK_F11",
"DOM_VK_F12",
"DOM_VK_F13",
"DOM_VK_F14",
"DOM_VK_F15",
"DOM_VK_F16",
"DOM_VK_F17",
"DOM_VK_F18",
"DOM_VK_F19",
"DOM_VK_F2",
"DOM_VK_F20",
"DOM_VK_F21",
"DOM_VK_F22",
"DOM_VK_F23",
"DOM_VK_F24",
"DOM_VK_F25",
"DOM_VK_F26",
"DOM_VK_F27",
"DOM_VK_F28",
"DOM_VK_F29",
"DOM_VK_F3",
"DOM_VK_F30",
"DOM_VK_F31",
"DOM_VK_F32",
"DOM_VK_F33",
"DOM_VK_F34",
"DOM_VK_F35",
"DOM_VK_F36",
"DOM_VK_F4",
"DOM_VK_F5",
"DOM_VK_F6",
"DOM_VK_F7",
"DOM_VK_F8",
"DOM_VK_F9",
"DOM_VK_FINAL",
"DOM_VK_FRONT",
"DOM_VK_G",
"DOM_VK_GREATER_THAN",
"DOM_VK_H",
"DOM_VK_HANGUL",
"DOM_VK_HANJA",
"DOM_VK_HASH",
"DOM_VK_HELP",
"DOM_VK_HK_TOGGLE",
"DOM_VK_HOME",
"DOM_VK_HYPHEN_MINUS",
"DOM_VK_I",
"DOM_VK_INSERT",
"DOM_VK_J",
"DOM_VK_JUNJA",
"DOM_VK_K",
"DOM_VK_KANA",
"DOM_VK_KANJI",
"DOM_VK_L",
"DOM_VK_LEFT",
"DOM_VK_LEFT_TAB",
"DOM_VK_LESS_THAN",
"DOM_VK_M",
"DOM_VK_META",
"DOM_VK_MODECHANGE",
"DOM_VK_MULTIPLY",
"DOM_VK_N",
"DOM_VK_NONCONVERT",
"DOM_VK_NUMPAD0",
"DOM_VK_NUMPAD1",
"DOM_VK_NUMPAD2",
"DOM_VK_NUMPAD3",
"DOM_VK_NUMPAD4",
"DOM_VK_NUMPAD5",
"DOM_VK_NUMPAD6",
"DOM_VK_NUMPAD7",
"DOM_VK_NUMPAD8",
"DOM_VK_NUMPAD9",
"DOM_VK_NUM_LOCK",
"DOM_VK_O",
"DOM_VK_OEM_1",
"DOM_VK_OEM_102",
"DOM_VK_OEM_2",
"DOM_VK_OEM_3",
"DOM_VK_OEM_4",
"DOM_VK_OEM_5",
"DOM_VK_OEM_6",
"DOM_VK_OEM_7",
"DOM_VK_OEM_8",
"DOM_VK_OEM_COMMA",
"DOM_VK_OEM_MINUS",
"DOM_VK_OEM_PERIOD",
"DOM_VK_OEM_PLUS",
"DOM_VK_OPEN_BRACKET",
"DOM_VK_OPEN_CURLY_BRACKET",
"DOM_VK_OPEN_PAREN",
"DOM_VK_P",
"DOM_VK_PA1",
"DOM_VK_PAGEDOWN",
"DOM_VK_PAGEUP",
"DOM_VK_PAGE_DOWN",
"DOM_VK_PAGE_UP",
"DOM_VK_PAUSE",
"DOM_VK_PERCENT",
"DOM_VK_PERIOD",
"DOM_VK_PIPE",
"DOM_VK_PLAY",
"DOM_VK_PLUS",
"DOM_VK_PRINT",
"DOM_VK_PRINTSCREEN",
"DOM_VK_PROCESSKEY",
"DOM_VK_PROPERITES",
"DOM_VK_Q",
"DOM_VK_QUESTION_MARK",
"DOM_VK_QUOTE",
"DOM_VK_R",
"DOM_VK_REDO",
"DOM_VK_RETURN",
"DOM_VK_RIGHT",
"DOM_VK_S",
"DOM_VK_SCROLL_LOCK",
"DOM_VK_SELECT",
"DOM_VK_SEMICOLON",
"DOM_VK_SEPARATOR",
"DOM_VK_SHIFT",
"DOM_VK_SLASH",
"DOM_VK_SLEEP",
"DOM_VK_SPACE",
"DOM_VK_SUBTRACT",
"DOM_VK_T",
"DOM_VK_TAB",
"DOM_VK_TILDE",
"DOM_VK_U",
"DOM_VK_UNDERSCORE",
"DOM_VK_UNDO",
"DOM_VK_UNICODE",
"DOM_VK_UP",
"DOM_VK_V",
"DOM_VK_VOLUME_DOWN",
"DOM_VK_VOLUME_MUTE",
"DOM_VK_VOLUME_UP",
"DOM_VK_W",
"DOM_VK_WIN",
"DOM_VK_WINDOW",
"DOM_VK_WIN_ICO_00",
"DOM_VK_WIN_ICO_CLEAR",
"DOM_VK_WIN_ICO_HELP",
"DOM_VK_WIN_OEM_ATTN",
"DOM_VK_WIN_OEM_AUTO",
"DOM_VK_WIN_OEM_BACKTAB",
"DOM_VK_WIN_OEM_CLEAR",
"DOM_VK_WIN_OEM_COPY",
"DOM_VK_WIN_OEM_CUSEL",
"DOM_VK_WIN_OEM_ENLW",
"DOM_VK_WIN_OEM_FINISH",
"DOM_VK_WIN_OEM_FJ_JISHO",
"DOM_VK_WIN_OEM_FJ_LOYA",
"DOM_VK_WIN_OEM_FJ_MASSHOU",
"DOM_VK_WIN_OEM_FJ_ROYA",
"DOM_VK_WIN_OEM_FJ_TOUROKU",
"DOM_VK_WIN_OEM_JUMP",
"DOM_VK_WIN_OEM_PA1",
"DOM_VK_WIN_OEM_PA2",
"DOM_VK_WIN_OEM_PA3",
"DOM_VK_WIN_OEM_RESET",
"DOM_VK_WIN_OEM_WSCTRL",
"DOM_VK_X",
"DOM_VK_XF86XK_ADD_FAVORITE",
"DOM_VK_XF86XK_APPLICATION_LEFT",
"DOM_VK_XF86XK_APPLICATION_RIGHT",
"DOM_VK_XF86XK_AUDIO_CYCLE_TRACK",
"DOM_VK_XF86XK_AUDIO_FORWARD",
"DOM_VK_XF86XK_AUDIO_LOWER_VOLUME",
"DOM_VK_XF86XK_AUDIO_MEDIA",
"DOM_VK_XF86XK_AUDIO_MUTE",
"DOM_VK_XF86XK_AUDIO_NEXT",
"DOM_VK_XF86XK_AUDIO_PAUSE",
"DOM_VK_XF86XK_AUDIO_PLAY",
"DOM_VK_XF86XK_AUDIO_PREV",
"DOM_VK_XF86XK_AUDIO_RAISE_VOLUME",
"DOM_VK_XF86XK_AUDIO_RANDOM_PLAY",
"DOM_VK_XF86XK_AUDIO_RECORD",
"DOM_VK_XF86XK_AUDIO_REPEAT",
"DOM_VK_XF86XK_AUDIO_REWIND",
"DOM_VK_XF86XK_AUDIO_STOP",
"DOM_VK_XF86XK_AWAY",
"DOM_VK_XF86XK_BACK",
"DOM_VK_XF86XK_BACK_FORWARD",
"DOM_VK_XF86XK_BATTERY",
"DOM_VK_XF86XK_BLUE",
"DOM_VK_XF86XK_BLUETOOTH",
"DOM_VK_XF86XK_BOOK",
"DOM_VK_XF86XK_BRIGHTNESS_ADJUST",
"DOM_VK_XF86XK_CALCULATOR",
"DOM_VK_XF86XK_CALENDAR",
"DOM_VK_XF86XK_CD",
"DOM_VK_XF86XK_CLOSE",
"DOM_VK_XF86XK_COMMUNITY",
"DOM_VK_XF86XK_CONTRAST_ADJUST",
"DOM_VK_XF86XK_COPY",
"DOM_VK_XF86XK_CUT",
"DOM_VK_XF86XK_CYCLE_ANGLE",
"DOM_VK_XF86XK_DISPLAY",
"DOM_VK_XF86XK_DOCUMENTS",
"DOM_VK_XF86XK_DOS",
"DOM_VK_XF86XK_EJECT",
"DOM_VK_XF86XK_EXCEL",
"DOM_VK_XF86XK_EXPLORER",
"DOM_VK_XF86XK_FAVORITES",
"DOM_VK_XF86XK_FINANCE",
"DOM_VK_XF86XK_FORWARD",
"DOM_VK_XF86XK_FRAME_BACK",
"DOM_VK_XF86XK_FRAME_FORWARD",
"DOM_VK_XF86XK_GAME",
"DOM_VK_XF86XK_GO",
"DOM_VK_XF86XK_GREEN",
"DOM_VK_XF86XK_HIBERNATE",
"DOM_VK_XF86XK_HISTORY",
"DOM_VK_XF86XK_HOME_PAGE",
"DOM_VK_XF86XK_HOT_LINKS",
"DOM_VK_XF86XK_I_TOUCH",
"DOM_VK_XF86XK_KBD_BRIGHTNESS_DOWN",
"DOM_VK_XF86XK_KBD_BRIGHTNESS_UP",
"DOM_VK_XF86XK_KBD_LIGHT_ON_OFF",
"DOM_VK_XF86XK_LAUNCH0",
"DOM_VK_XF86XK_LAUNCH1",
"DOM_VK_XF86XK_LAUNCH2",
"DOM_VK_XF86XK_LAUNCH3",
"DOM_VK_XF86XK_LAUNCH4",
"DOM_VK_XF86XK_LAUNCH5",
"DOM_VK_XF86XK_LAUNCH6",
"DOM_VK_XF86XK_LAUNCH7",
"DOM_VK_XF86XK_LAUNCH8",
"DOM_VK_XF86XK_LAUNCH9",
"DOM_VK_XF86XK_LAUNCH_A",
"DOM_VK_XF86XK_LAUNCH_B",
"DOM_VK_XF86XK_LAUNCH_C",
"DOM_VK_XF86XK_LAUNCH_D",
"DOM_VK_XF86XK_LAUNCH_E",
"DOM_VK_XF86XK_LAUNCH_F",
"DOM_VK_XF86XK_LIGHT_BULB",
"DOM_VK_XF86XK_LOG_OFF",
"DOM_VK_XF86XK_MAIL",
"DOM_VK_XF86XK_MAIL_FORWARD",
"DOM_VK_XF86XK_MARKET",
"DOM_VK_XF86XK_MEETING",
"DOM_VK_XF86XK_MEMO",
"DOM_VK_XF86XK_MENU_KB",
"DOM_VK_XF86XK_MENU_PB",
"DOM_VK_XF86XK_MESSENGER",
"DOM_VK_XF86XK_MON_BRIGHTNESS_DOWN",
"DOM_VK_XF86XK_MON_BRIGHTNESS_UP",
"DOM_VK_XF86XK_MUSIC",
"DOM_VK_XF86XK_MY_COMPUTER",
"DOM_VK_XF86XK_MY_SITES",
"DOM_VK_XF86XK_NEW",
"DOM_VK_XF86XK_NEWS",
"DOM_VK_XF86XK_OFFICE_HOME",
"DOM_VK_XF86XK_OPEN",
"DOM_VK_XF86XK_OPEN_URL",
"DOM_VK_XF86XK_OPTION",
"DOM_VK_XF86XK_PASTE",
"DOM_VK_XF86XK_PHONE",
"DOM_VK_XF86XK_PICTURES",
"DOM_VK_XF86XK_POWER_DOWN",
"DOM_VK_XF86XK_POWER_OFF",
"DOM_VK_XF86XK_RED",
"DOM_VK_XF86XK_REFRESH",
"DOM_VK_XF86XK_RELOAD",
"DOM_VK_XF86XK_REPLY",
"DOM_VK_XF86XK_ROCKER_DOWN",
"DOM_VK_XF86XK_ROCKER_ENTER",
"DOM_VK_XF86XK_ROCKER_UP",
"DOM_VK_XF86XK_ROTATE_WINDOWS",
"DOM_VK_XF86XK_ROTATION_KB",
"DOM_VK_XF86XK_ROTATION_PB",
"DOM_VK_XF86XK_SAVE",
"DOM_VK_XF86XK_SCREEN_SAVER",
"DOM_VK_XF86XK_SCROLL_CLICK",
"DOM_VK_XF86XK_SCROLL_DOWN",
"DOM_VK_XF86XK_SCROLL_UP",
"DOM_VK_XF86XK_SEARCH",
"DOM_VK_XF86XK_SEND",
"DOM_VK_XF86XK_SHOP",
"DOM_VK_XF86XK_SPELL",
"DOM_VK_XF86XK_SPLIT_SCREEN",
"DOM_VK_XF86XK_STANDBY",
"DOM_VK_XF86XK_START",
"DOM_VK_XF86XK_STOP",
"DOM_VK_XF86XK_SUBTITLE",
"DOM_VK_XF86XK_SUPPORT",
"DOM_VK_XF86XK_SUSPEND",
"DOM_VK_XF86XK_TASK_PANE",
"DOM_VK_XF86XK_TERMINAL",
"DOM_VK_XF86XK_TIME",
"DOM_VK_XF86XK_TOOLS",
"DOM_VK_XF86XK_TOP_MENU",
"DOM_VK_XF86XK_TO_DO_LIST",
"DOM_VK_XF86XK_TRAVEL",
"DOM_VK_XF86XK_USER1KB",
"DOM_VK_XF86XK_USER2KB",
"DOM_VK_XF86XK_USER_PB",
"DOM_VK_XF86XK_UWB",
"DOM_VK_XF86XK_VENDOR_HOME",
"DOM_VK_XF86XK_VIDEO",
"DOM_VK_XF86XK_VIEW",
"DOM_VK_XF86XK_WAKE_UP",
"DOM_VK_XF86XK_WEB_CAM",
"DOM_VK_XF86XK_WHEEL_BUTTON",
"DOM_VK_XF86XK_WLAN",
"DOM_VK_XF86XK_WORD",
"DOM_VK_XF86XK_WWW",
"DOM_VK_XF86XK_XFER",
"DOM_VK_XF86XK_YELLOW",
"DOM_VK_XF86XK_ZOOM_IN",
"DOM_VK_XF86XK_ZOOM_OUT",
"DOM_VK_Y",
"DOM_VK_Z",
"DOM_VK_ZOOM",
"DONE",
"DONT_CARE",
"DOWNLOADING",
"DRAGDROP",
"DST_ALPHA",
"DST_COLOR",
"DYNAMIC_DRAW",
"DataChannel",
"DataTransfer",
"DataTransferItem",
"DataTransferItemList",
"DataView",
"Date",
"DateTimeFormat",
"DelayNode",
"DesktopNotification",
"DesktopNotificationCenter",
"DeviceLightEvent",
"DeviceMotionEvent",
"DeviceOrientationEvent",
"DeviceProximityEvent",
"DeviceStorage",
"DeviceStorageChangeEvent",
"Document",
"DocumentFragment",
"DocumentType",
"DragEvent",
"DynamicsCompressorNode",
"E",
"ELEMENT_ARRAY_BUFFER",
"ELEMENT_ARRAY_BUFFER_BINDING",
"ELEMENT_NODE",
"EMPTY",
"ENCODING_ERR",
"ENDED",
"END_TO_END",
"END_TO_START",
"ENTITY_NODE",
"ENTITY_REFERENCE_NODE",
"EPSILON",
"EQUAL",
"EQUALPOWER",
"ERROR",
"EXPONENTIAL_DISTANCE",
"Element",
"ElementQuery",
"Entity",
"EntityReference",
"Error",
"ErrorEvent",
"EvalError",
"Event",
"EventException",
"EventSource",
"EventTarget",
"External",
"FASTEST",
"FIDOSDK",
"FILTER_ACCEPT",
"FILTER_INTERRUPT",
"FILTER_REJECT",
"FILTER_SKIP",
"FINISHED_STATE",
"FIRST_ORDERED_NODE_TYPE",
"FLOAT",
"FLOAT_MAT2",
"FLOAT_MAT3",
"FLOAT_MAT4",
"FLOAT_VEC2",
"FLOAT_VEC3",
"FLOAT_VEC4",
"FOCUS",
"FONT_FACE_RULE",
"FONT_FEATURE_VALUES_RULE",
"FRAGMENT_SHADER",
"FRAGMENT_SHADER_DERIVATIVE_HINT_OES",
"FRAMEBUFFER",
"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",
"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",
"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",
"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",
"FRAMEBUFFER_BINDING",
"FRAMEBUFFER_COMPLETE",
"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",
"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",
"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",
"FRAMEBUFFER_UNSUPPORTED",
"FRONT",
"FRONT_AND_BACK",
"FRONT_FACE",
"FUNC_ADD",
"FUNC_REVERSE_SUBTRACT",
"FUNC_SUBTRACT",
"Feed",
"FeedEntry",
"File",
"FileError",
"FileList",
"FileReader",
"FindInPage",
"Float32Array",
"Float64Array",
"FocusEvent",
"FontFace",
"FormData",
"Function",
"GENERATE_MIPMAP_HINT",
"GEQUAL",
"GREATER",
"GREEN_BITS",
"GainNode",
"Gamepad",
"GamepadButton",
"GamepadEvent",
"GestureEvent",
"HAVE_CURRENT_DATA",
"HAVE_ENOUGH_DATA",
"HAVE_FUTURE_DATA",
"HAVE_METADATA",
"HAVE_NOTHING",
"HEADERS_RECEIVED",
"HIDDEN",
"HIERARCHY_REQUEST_ERR",
"HIGHPASS",
"HIGHSHELF",
"HIGH_FLOAT",
"HIGH_INT",
"HORIZONTAL",
"HORIZONTAL_AXIS",
"HRTF",
"HTMLAllCollection",
"HTMLAnchorElement",
"HTMLAppletElement",
"HTMLAreaElement",
"HTMLAudioElement",
"HTMLBRElement",
"HTMLBaseElement",
"HTMLBaseFontElement",
"HTMLBlockquoteElement",
"HTMLBodyElement",
"HTMLButtonElement",
"HTMLCanvasElement",
"HTMLCollection",
"HTMLCommandElement",
"HTMLContentElement",
"HTMLDListElement",
"HTMLDataElement",
"HTMLDataListElement",
"HTMLDetailsElement",
"HTMLDialogElement",
"HTMLDirectoryElement",
"HTMLDivElement",
"HTMLDocument",
"HTMLElement",
"HTMLEmbedElement",
"HTMLFieldSetElement",
"HTMLFontElement",
"HTMLFormControlsCollection",
"HTMLFormElement",
"HTMLFrameElement",
"HTMLFrameSetElement",
"HTMLHRElement",
"HTMLHeadElement",
"HTMLHeadingElement",
"HTMLHtmlElement",
"HTMLIFrameElement",
"HTMLImageElement",
"HTMLInputElement",
"HTMLIsIndexElement",
"HTMLKeygenElement",
"HTMLLIElement",
"HTMLLabelElement",
"HTMLLegendElement",
"HTMLLinkElement",
"HTMLMapElement",
"HTMLMarqueeElement",
"HTMLMediaElement",
"HTMLMenuElement",
"HTMLMenuItemElement",
"HTMLMetaElement",
"HTMLMeterElement",
"HTMLModElement",
"HTMLOListElement",
"HTMLObjectElement",
"HTMLOptGroupElement",
"HTMLOptionElement",
"HTMLOptionsCollection",
"HTMLOutputElement",
"HTMLParagraphElement",
"HTMLParamElement",
"HTMLPictureElement",
"HTMLPreElement",
"HTMLProgressElement",
"HTMLPropertiesCollection",
"HTMLQuoteElement",
"HTMLScriptElement",
"HTMLSelectElement",
"HTMLShadowElement",
"HTMLSourceElement",
"HTMLSpanElement",
"HTMLStyleElement",
"HTMLTableCaptionElement",
"HTMLTableCellElement",
"HTMLTableColElement",
"HTMLTableElement",
"HTMLTableRowElement",
"HTMLTableSectionElement",
"HTMLTemplateElement",
"HTMLTextAreaElement",
"HTMLTimeElement",
"HTMLTitleElement",
"HTMLTrackElement",
"HTMLUListElement",
"HTMLUnknownElement",
"HTMLVideoElement",
"HashChangeEvent",
"Headers",
"History",
"ICE_CHECKING",
"ICE_CLOSED",
"ICE_COMPLETED",
"ICE_CONNECTED",
"ICE_FAILED",
"ICE_GATHERING",
"ICE_WAITING",
"IDBCursor",
"IDBCursorWithValue",
"IDBDatabase",
"IDBDatabaseException",
"IDBFactory",
"IDBFileHandle",
"IDBFileRequest",
"IDBIndex",
"IDBKeyRange",
"IDBMutableFile",
"IDBObjectStore",
"IDBOpenDBRequest",
"IDBRequest",
"IDBTransaction",
"IDBVersionChangeEvent",
"IDLE",
"IMPLEMENTATION_COLOR_READ_FORMAT",
"IMPLEMENTATION_COLOR_READ_TYPE",
"IMPORT_RULE",
"INCR",
"INCR_WRAP",
"INDEX_SIZE_ERR",
"INT",
"INT_VEC2",
"INT_VEC3",
"INT_VEC4",
"INUSE_ATTRIBUTE_ERR",
"INVALID_ACCESS_ERR",
"INVALID_CHARACTER_ERR",
"INVALID_ENUM",
"INVALID_EXPRESSION_ERR",
"INVALID_FRAMEBUFFER_OPERATION",
"INVALID_MODIFICATION_ERR",
"INVALID_NODE_TYPE_ERR",
"INVALID_OPERATION",
"INVALID_STATE_ERR",
"INVALID_VALUE",
"INVERSE_DISTANCE",
"INVERT",
"IceCandidate",
"Image",
"ImageBitmap",
"ImageData",
"Infinity",
"InputEvent",
"InputMethodContext",
"InstallTrigger",
"Int16Array",
"Int32Array",
"Int8Array",
"Intent",
"InternalError",
"Intl",
"IsSearchProviderInstalled",
"Iterator",
"JSON",
"KEEP",
"KEYDOWN",
"KEYFRAMES_RULE",
"KEYFRAME_RULE",
"KEYPRESS",
"KEYUP",
"KeyEvent",
"KeyboardEvent",
"LENGTHADJUST_SPACING",
"LENGTHADJUST_SPACINGANDGLYPHS",
"LENGTHADJUST_UNKNOWN",
"LEQUAL",
"LESS",
"LINEAR",
"LINEAR_DISTANCE",
"LINEAR_MIPMAP_LINEAR",
"LINEAR_MIPMAP_NEAREST",
"LINES",
"LINE_LOOP",
"LINE_STRIP",
"LINE_WIDTH",
"LINK_STATUS",
"LIVE",
"LN10",
"LN2",
"LOADED",
"LOADING",
"LOG10E",
"LOG2E",
"LOWPASS",
"LOWSHELF",
"LOW_FLOAT",
"LOW_INT",
"LSException",
"LSParserFilter",
"LUMINANCE",
"LUMINANCE_ALPHA",
"LocalMediaStream",
"Location",
"MAX_COMBINED_TEXTURE_IMAGE_UNITS",
"MAX_CUBE_MAP_TEXTURE_SIZE",
"MAX_FRAGMENT_UNIFORM_VECTORS",
"MAX_RENDERBUFFER_SIZE",
"MAX_SAFE_INTEGER",
"MAX_TEXTURE_IMAGE_UNITS",
"MAX_TEXTURE_MAX_ANISOTROPY_EXT",
"MAX_TEXTURE_SIZE",
"MAX_VALUE",
"MAX_VARYING_VECTORS",
"MAX_VERTEX_ATTRIBS",
"MAX_VERTEX_TEXTURE_IMAGE_UNITS",
"MAX_VERTEX_UNIFORM_VECTORS",
"MAX_VIEWPORT_DIMS",
"MEDIA_ERR_ABORTED",
"MEDIA_ERR_DECODE",
"MEDIA_ERR_ENCRYPTED",
"MEDIA_ERR_NETWORK",
"MEDIA_ERR_SRC_NOT_SUPPORTED",
"MEDIA_KEYERR_CLIENT",
"MEDIA_KEYERR_DOMAIN",
"MEDIA_KEYERR_HARDWARECHANGE",
"MEDIA_KEYERR_OUTPUT",
"MEDIA_KEYERR_SERVICE",
"MEDIA_KEYERR_UNKNOWN",
"MEDIA_RULE",
"MEDIUM_FLOAT",
"MEDIUM_INT",
"META_MASK",
"MIN_SAFE_INTEGER",
"MIN_VALUE",
"MIRRORED_REPEAT",
"MODE_ASYNCHRONOUS",
"MODE_SYNCHRONOUS",
"MODIFICATION",
"MOUSEDOWN",
"MOUSEDRAG",
"MOUSEMOVE",
"MOUSEOUT",
"MOUSEOVER",
"MOUSEUP",
"MOZ_KEYFRAMES_RULE",
"MOZ_KEYFRAME_RULE",
"MOZ_SOURCE_CURSOR",
"MOZ_SOURCE_ERASER",
"MOZ_SOURCE_KEYBOARD",
"MOZ_SOURCE_MOUSE",
"MOZ_SOURCE_PEN",
"MOZ_SOURCE_TOUCH",
"MOZ_SOURCE_UNKNOWN",
"MSGESTURE_FLAG_BEGIN",
"MSGESTURE_FLAG_CANCEL",
"MSGESTURE_FLAG_END",
"MSGESTURE_FLAG_INERTIA",
"MSGESTURE_FLAG_NONE",
"MSPOINTER_TYPE_MOUSE",
"MSPOINTER_TYPE_PEN",
"MSPOINTER_TYPE_TOUCH",
"MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE",
"MS_ASYNC_CALLBACK_STATUS_CANCEL",
"MS_ASYNC_CALLBACK_STATUS_CHOOSEANY",
"MS_ASYNC_CALLBACK_STATUS_ERROR",
"MS_ASYNC_CALLBACK_STATUS_JOIN",
"MS_ASYNC_OP_STATUS_CANCELED",
"MS_ASYNC_OP_STATUS_ERROR",
"MS_ASYNC_OP_STATUS_SUCCESS",
"MS_MANIPULATION_STATE_ACTIVE",
"MS_MANIPULATION_STATE_CANCELLED",
"MS_MANIPULATION_STATE_COMMITTED",
"MS_MANIPULATION_STATE_DRAGGING",
"MS_MANIPULATION_STATE_INERTIA",
"MS_MANIPULATION_STATE_PRESELECT",
"MS_MANIPULATION_STATE_SELECTING",
"MS_MANIPULATION_STATE_STOPPED",
"MS_MEDIA_ERR_ENCRYPTED",
"MS_MEDIA_KEYERR_CLIENT",
"MS_MEDIA_KEYERR_DOMAIN",
"MS_MEDIA_KEYERR_HARDWARECHANGE",
"MS_MEDIA_KEYERR_OUTPUT",
"MS_MEDIA_KEYERR_SERVICE",
"MS_MEDIA_KEYERR_UNKNOWN",
"Map",
"Math",
"MediaController",
"MediaDevices",
"MediaElementAudioSourceNode",
"MediaEncryptedEvent",
"MediaError",
"MediaKeyError",
"MediaKeyEvent",
"MediaKeyMessageEvent",
"MediaKeyNeededEvent",
"MediaKeySession",
"MediaKeyStatusMap",
"MediaKeySystemAccess",
"MediaKeys",
"MediaList",
"MediaQueryList",
"MediaQueryListEvent",
"MediaRecorder",
"MediaSource",
"MediaStream",
"MediaStreamAudioDestinationNode",
"MediaStreamAudioSourceNode",
"MediaStreamEvent",
"MediaStreamTrack",
"MediaStreamTrackEvent",
"MessageChannel",
"MessageEvent",
"MessagePort",
"Methods",
"MimeType",
"MimeTypeArray",
"MouseEvent",
"MouseScrollEvent",
"MozAnimation",
"MozAnimationDelay",
"MozAnimationDirection",
"MozAnimationDuration",
"MozAnimationFillMode",
"MozAnimationIterationCount",
"MozAnimationName",
"MozAnimationPlayState",
"MozAnimationTimingFunction",
"MozAppearance",
"MozBackfaceVisibility",
"MozBinding",
"MozBorderBottomColors",
"MozBorderEnd",
"MozBorderEndColor",
"MozBorderEndStyle",
"MozBorderEndWidth",
"MozBorderImage",
"MozBorderLeftColors",
"MozBorderRightColors",
"MozBorderStart",
"MozBorderStartColor",
"MozBorderStartStyle",
"MozBorderStartWidth",
"MozBorderTopColors",
"MozBoxAlign",
"MozBoxDirection",
"MozBoxFlex",
"MozBoxOrdinalGroup",
"MozBoxOrient",
"MozBoxPack",
"MozBoxSizing",
"MozCSSKeyframeRule",
"MozCSSKeyframesRule",
"MozColumnCount",
"MozColumnFill",
"MozColumnGap",
"MozColumnRule",
"MozColumnRuleColor",
"MozColumnRuleStyle",
"MozColumnRuleWidth",
"MozColumnWidth",
"MozColumns",
"MozContactChangeEvent",
"MozFloatEdge",
"MozFontFeatureSettings",
"MozFontLanguageOverride",
"MozForceBrokenImageIcon",
"MozHyphens",
"MozImageRegion",
"MozMarginEnd",
"MozMarginStart",
"MozMmsEvent",
"MozMmsMessage",
"MozMobileMessageThread",
"MozOSXFontSmoothing",
"MozOrient",
"MozOutlineRadius",
"MozOutlineRadiusBottomleft",
"MozOutlineRadiusBottomright",
"MozOutlineRadiusTopleft",
"MozOutlineRadiusTopright",
"MozPaddingEnd",
"MozPaddingStart",
"MozPerspective",
"MozPerspectiveOrigin",
"MozPowerManager",
"MozSettingsEvent",
"MozSmsEvent",
"MozSmsMessage",
"MozStackSizing",
"MozTabSize",
"MozTextAlignLast",
"MozTextDecorationColor",
"MozTextDecorationLine",
"MozTextDecorationStyle",
"MozTextSizeAdjust",
"MozTransform",
"MozTransformOrigin",
"MozTransformStyle",
"MozTransition",
"MozTransitionDelay",
"MozTransitionDuration",
"MozTransitionProperty",
"MozTransitionTimingFunction",
"MozUserFocus",
"MozUserInput",
"MozUserModify",
"MozUserSelect",
"MozWindowDragging",
"MozWindowShadow",
"MutationEvent",
"MutationObserver",
"MutationRecord",
"NAMESPACE_ERR",
"NAMESPACE_RULE",
"NEAREST",
"NEAREST_MIPMAP_LINEAR",
"NEAREST_MIPMAP_NEAREST",
"NEGATIVE_INFINITY",
"NETWORK_EMPTY",
"NETWORK_ERR",
"NETWORK_IDLE",
"NETWORK_LOADED",
"NETWORK_LOADING",
"NETWORK_NO_SOURCE",
"NEVER",
"NEW",
"NEXT",
"NEXT_NO_DUPLICATE",
"NICEST",
"NODE_AFTER",
"NODE_BEFORE",
"NODE_BEFORE_AND_AFTER",
"NODE_INSIDE",
"NONE",
"NON_TRANSIENT_ERR",
"NOTATION_NODE",
"NOTCH",
"NOTEQUAL",
"NOT_ALLOWED_ERR",
"NOT_FOUND_ERR",
"NOT_READABLE_ERR",
"NOT_SUPPORTED_ERR",
"NO_DATA_ALLOWED_ERR",
"NO_ERR",
"NO_ERROR",
"NO_MODIFICATION_ALLOWED_ERR",
"NUMBER_TYPE",
"NUM_COMPRESSED_TEXTURE_FORMATS",
"NaN",
"NamedNodeMap",
"Navigator",
"NearbyLinks",
"NetworkInformation",
"Node",
"NodeFilter",
"NodeIterator",
"NodeList",
"Notation",
"Notification",
"NotifyPaintEvent",
"Number",
"NumberFormat",
"OBSOLETE",
"ONE",
"ONE_MINUS_CONSTANT_ALPHA",
"ONE_MINUS_CONSTANT_COLOR",
"ONE_MINUS_DST_ALPHA",
"ONE_MINUS_DST_COLOR",
"ONE_MINUS_SRC_ALPHA",
"ONE_MINUS_SRC_COLOR",
"OPEN",
"OPENED",
"OPENING",
"ORDERED_NODE_ITERATOR_TYPE",
"ORDERED_NODE_SNAPSHOT_TYPE",
"OUT_OF_MEMORY",
"Object",
"OfflineAudioCompletionEvent",
"OfflineAudioContext",
"OfflineResourceList",
"Option",
"OscillatorNode",
"OverflowEvent",
"PACK_ALIGNMENT",
"PAGE_RULE",
"PARSE_ERR",
"PATHSEG_ARC_ABS",
"PATHSEG_ARC_REL",
"PATHSEG_CLOSEPATH",
"PATHSEG_CURVETO_CUBIC_ABS",
"PATHSEG_CURVETO_CUBIC_REL",
"PATHSEG_CURVETO_CUBIC_SMOOTH_ABS",
"PATHSEG_CURVETO_CUBIC_SMOOTH_REL",
"PATHSEG_CURVETO_QUADRATIC_ABS",
"PATHSEG_CURVETO_QUADRATIC_REL",
"PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS",
"PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL",
"PATHSEG_LINETO_ABS",
"PATHSEG_LINETO_HORIZONTAL_ABS",
"PATHSEG_LINETO_HORIZONTAL_REL",
"PATHSEG_LINETO_REL",
"PATHSEG_LINETO_VERTICAL_ABS",
"PATHSEG_LINETO_VERTICAL_REL",
"PATHSEG_MOVETO_ABS",
"PATHSEG_MOVETO_REL",
"PATHSEG_UNKNOWN",
"PATH_EXISTS_ERR",
"PEAKING",
"PERMISSION_DENIED",
"PERSISTENT",
"PI",
"PLAYING_STATE",
"POINTS",
"POLYGON_OFFSET_FACTOR",
"POLYGON_OFFSET_FILL",
"POLYGON_OFFSET_UNITS",
"POSITION_UNAVAILABLE",
"POSITIVE_INFINITY",
"PREV",
"PREV_NO_DUPLICATE",
"PROCESSING_INSTRUCTION_NODE",
"PageChangeEvent",
"PageTransitionEvent",
"PaintRequest",
"PaintRequestList",
"PannerNode",
"Path2D",
"Performance",
"PerformanceEntry",
"PerformanceMark",
"PerformanceMeasure",
"PerformanceNavigation",
"PerformanceResourceTiming",
"PerformanceTiming",
"PeriodicWave",
"Plugin",
"PluginArray",
"PopStateEvent",
"PopupBlockedEvent",
"ProcessingInstruction",
"ProgressEvent",
"Promise",
"PropertyNodeList",
"Proxy",
"PushManager",
"PushSubscription",
"Q",
"QUOTA_ERR",
"QUOTA_EXCEEDED_ERR",
"QueryInterface",
"READ_ONLY",
"READ_ONLY_ERR",
"READ_WRITE",
"RED_BITS",
"REMOVAL",
"RENDERBUFFER",
"RENDERBUFFER_ALPHA_SIZE",
"RENDERBUFFER_BINDING",
"RENDERBUFFER_BLUE_SIZE",
"RENDERBUFFER_DEPTH_SIZE",
"RENDERBUFFER_GREEN_SIZE",
"RENDERBUFFER_HEIGHT",
"RENDERBUFFER_INTERNAL_FORMAT",
"RENDERBUFFER_RED_SIZE",
"RENDERBUFFER_STENCIL_SIZE",
"RENDERBUFFER_WIDTH",
"RENDERER",
"RENDERING_INTENT_ABSOLUTE_COLORIMETRIC",
"RENDERING_INTENT_AUTO",
"RENDERING_INTENT_PERCEPTUAL",
"RENDERING_INTENT_RELATIVE_COLORIMETRIC",
"RENDERING_INTENT_SATURATION",
"RENDERING_INTENT_UNKNOWN",
"REPEAT",
"REPLACE",
"RGB",
"RGB565",
"RGB5_A1",
"RGBA",
"RGBA4",
"RGBColor",
"ROTATION_CLOCKWISE",
"ROTATION_COUNTERCLOCKWISE",
"RTCDataChannelEvent",
"RTCIceCandidate",
"RTCPeerConnectionIceEvent",
"RTCRtpReceiver",
"RTCRtpSender",
"RTCSessionDescription",
"RTCStatsReport",
"RadioNodeList",
"Range",
"RangeError",
"RangeException",
"RecordErrorEvent",
"Rect",
"ReferenceError",
"RegExp",
"Request",
"Response",
"SAMPLER_2D",
"SAMPLER_CUBE",
"SAMPLES",
"SAMPLE_ALPHA_TO_COVERAGE",
"SAMPLE_BUFFERS",
"SAMPLE_COVERAGE",
"SAMPLE_COVERAGE_INVERT",
"SAMPLE_COVERAGE_VALUE",
"SAWTOOTH",
"SCHEDULED_STATE",
"SCISSOR_BOX",
"SCISSOR_TEST",
"SCROLL_PAGE_DOWN",
"SCROLL_PAGE_UP",
"SDP_ANSWER",
"SDP_OFFER",
"SDP_PRANSWER",
"SECURITY_ERR",
"SELECT",
"SERIALIZE_ERR",
"SEVERITY_ERROR",
"SEVERITY_FATAL_ERROR",
"SEVERITY_WARNING",
"SHADER_COMPILER",
"SHADER_TYPE",
"SHADING_LANGUAGE_VERSION",
"SHIFT_MASK",
"SHORT",
"SHOWING",
"SHOW_ALL",
"SHOW_ATTRIBUTE",
"SHOW_CDATA_SECTION",
"SHOW_COMMENT",
"SHOW_DOCUMENT",
"SHOW_DOCUMENT_FRAGMENT",
"SHOW_DOCUMENT_TYPE",
"SHOW_ELEMENT",
"SHOW_ENTITY",
"SHOW_ENTITY_REFERENCE",
"SHOW_NOTATION",
"SHOW_PROCESSING_INSTRUCTION",
"SHOW_TEXT",
"SINE",
"SOUNDFIELD",
"SQLException",
"SQRT1_2",
"SQRT2",
"SQUARE",
"SRC_ALPHA",
"SRC_ALPHA_SATURATE",
"SRC_COLOR",
"START_TO_END",
"START_TO_START",
"STATIC_DRAW",
"STENCIL_ATTACHMENT",
"STENCIL_BACK_FAIL",
"STENCIL_BACK_FUNC",
"STENCIL_BACK_PASS_DEPTH_FAIL",
"STENCIL_BACK_PASS_DEPTH_PASS",
"STENCIL_BACK_REF",
"STENCIL_BACK_VALUE_MASK",
"STENCIL_BACK_WRITEMASK",
"STENCIL_BITS",
"STENCIL_BUFFER_BIT",
"STENCIL_CLEAR_VALUE",
"STENCIL_FAIL",
"STENCIL_FUNC",
"STENCIL_INDEX",
"STENCIL_INDEX8",
"STENCIL_PASS_DEPTH_FAIL",
"STENCIL_PASS_DEPTH_PASS",
"STENCIL_REF",
"STENCIL_TEST",
"STENCIL_VALUE_MASK",
"STENCIL_WRITEMASK",
"STREAM_DRAW",
"STRING_TYPE",
"STYLE_RULE",
"SUBPIXEL_BITS",
"SUPPORTS_RULE",
"SVGAElement",
"SVGAltGlyphDefElement",
"SVGAltGlyphElement",
"SVGAltGlyphItemElement",
"SVGAngle",
"SVGAnimateColorElement",
"SVGAnimateElement",
"SVGAnimateMotionElement",
"SVGAnimateTransformElement",
"SVGAnimatedAngle",
"SVGAnimatedBoolean",
"SVGAnimatedEnumeration",
"SVGAnimatedInteger",
"SVGAnimatedLength",
"SVGAnimatedLengthList",
"SVGAnimatedNumber",
"SVGAnimatedNumberList",
"SVGAnimatedPreserveAspectRatio",
"SVGAnimatedRect",
"SVGAnimatedString",
"SVGAnimatedTransformList",
"SVGAnimationElement",
"SVGCircleElement",
"SVGClipPathElement",
"SVGColor",
"SVGComponentTransferFunctionElement",
"SVGCursorElement",
"SVGDefsElement",
"SVGDescElement",
"SVGDiscardElement",
"SVGDocument",
"SVGElement",
"SVGElementInstance",
"SVGElementInstanceList",
"SVGEllipseElement",
"SVGException",
"SVGFEBlendElement",
"SVGFEColorMatrixElement",
"SVGFEComponentTransferElement",
"SVGFECompositeElement",
"SVGFEConvolveMatrixElement",
"SVGFEDiffuseLightingElement",
"SVGFEDisplacementMapElement",
"SVGFEDistantLightElement",
"SVGFEDropShadowElement",
"SVGFEFloodElement",
"SVGFEFuncAElement",
"SVGFEFuncBElement",
"SVGFEFuncGElement",
"SVGFEFuncRElement",
"SVGFEGaussianBlurElement",
"SVGFEImageElement",
"SVGFEMergeElement",
"SVGFEMergeNodeElement",
"SVGFEMorphologyElement",
"SVGFEOffsetElement",
"SVGFEPointLightElement",
"SVGFESpecularLightingElement",
"SVGFESpotLightElement",
"SVGFETileElement",
"SVGFETurbulenceElement",
"SVGFilterElement",
"SVGFontElement",
"SVGFontFaceElement",
"SVGFontFaceFormatElement",
"SVGFontFaceNameElement",
"SVGFontFaceSrcElement",
"SVGFontFaceUriElement",
"SVGForeignObjectElement",
"SVGGElement",
"SVGGeometryElement",
"SVGGlyphElement",
"SVGGlyphRefElement",
"SVGGradientElement",
"SVGGraphicsElement",
"SVGHKernElement",
"SVGImageElement",
"SVGLength",
"SVGLengthList",
"SVGLineElement",
"SVGLinearGradientElement",
"SVGMPathElement",
"SVGMarkerElement",
"SVGMaskElement",
"SVGMatrix",
"SVGMetadataElement",
"SVGMissingGlyphElement",
"SVGNumber",
"SVGNumberList",
"SVGPaint",
"SVGPathElement",
"SVGPathSeg",
"SVGPathSegArcAbs",
"SVGPathSegArcRel",
"SVGPathSegClosePath",
"SVGPathSegCurvetoCubicAbs",
"SVGPathSegCurvetoCubicRel",
"SVGPathSegCurvetoCubicSmoothAbs",
"SVGPathSegCurvetoCubicSmoothRel",
"SVGPathSegCurvetoQuadraticAbs",
"SVGPathSegCurvetoQuadraticRel",
"SVGPathSegCurvetoQuadraticSmoothAbs",
"SVGPathSegCurvetoQuadraticSmoothRel",
"SVGPathSegLinetoAbs",
"SVGPathSegLinetoHorizontalAbs",
"SVGPathSegLinetoHorizontalRel",
"SVGPathSegLinetoRel",
"SVGPathSegLinetoVerticalAbs",
"SVGPathSegLinetoVerticalRel",
"SVGPathSegList",
"SVGPathSegMovetoAbs",
"SVGPathSegMovetoRel",
"SVGPatternElement",
"SVGPoint",
"SVGPointList",
"SVGPolygonElement",
"SVGPolylineElement",
"SVGPreserveAspectRatio",
"SVGRadialGradientElement",
"SVGRect",
"SVGRectElement",
"SVGRenderingIntent",
"SVGSVGElement",
"SVGScriptElement",
"SVGSetElement",
"SVGStopElement",
"SVGStringList",
"SVGStyleElement",
"SVGSwitchElement",
"SVGSymbolElement",
"SVGTRefElement",
"SVGTSpanElement",
"SVGTextContentElement",
"SVGTextElement",
"SVGTextPathElement",
"SVGTextPositioningElement",
"SVGTitleElement",
"SVGTransform",
"SVGTransformList",
"SVGUnitTypes",
"SVGUseElement",
"SVGVKernElement",
"SVGViewElement",
"SVGViewSpec",
"SVGZoomAndPan",
"SVGZoomEvent",
"SVG_ANGLETYPE_DEG",
"SVG_ANGLETYPE_GRAD",
"SVG_ANGLETYPE_RAD",
"SVG_ANGLETYPE_UNKNOWN",
"SVG_ANGLETYPE_UNSPECIFIED",
"SVG_CHANNEL_A",
"SVG_CHANNEL_B",
"SVG_CHANNEL_G",
"SVG_CHANNEL_R",
"SVG_CHANNEL_UNKNOWN",
"SVG_COLORTYPE_CURRENTCOLOR",
"SVG_COLORTYPE_RGBCOLOR",
"SVG_COLORTYPE_RGBCOLOR_ICCCOLOR",
"SVG_COLORTYPE_UNKNOWN",
"SVG_EDGEMODE_DUPLICATE",
"SVG_EDGEMODE_NONE",
"SVG_EDGEMODE_UNKNOWN",
"SVG_EDGEMODE_WRAP",
"SVG_FEBLEND_MODE_COLOR",
"SVG_FEBLEND_MODE_COLOR_BURN",
"SVG_FEBLEND_MODE_COLOR_DODGE",
"SVG_FEBLEND_MODE_DARKEN",
"SVG_FEBLEND_MODE_DIFFERENCE",
"SVG_FEBLEND_MODE_EXCLUSION",
"SVG_FEBLEND_MODE_HARD_LIGHT",
"SVG_FEBLEND_MODE_HUE",
"SVG_FEBLEND_MODE_LIGHTEN",
"SVG_FEBLEND_MODE_LUMINOSITY",
"SVG_FEBLEND_MODE_MULTIPLY",
"SVG_FEBLEND_MODE_NORMAL",
"SVG_FEBLEND_MODE_OVERLAY",
"SVG_FEBLEND_MODE_SATURATION",
"SVG_FEBLEND_MODE_SCREEN",
"SVG_FEBLEND_MODE_SOFT_LIGHT",
"SVG_FEBLEND_MODE_UNKNOWN",
"SVG_FECOLORMATRIX_TYPE_HUEROTATE",
"SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA",
"SVG_FECOLORMATRIX_TYPE_MATRIX",
"SVG_FECOLORMATRIX_TYPE_SATURATE",
"SVG_FECOLORMATRIX_TYPE_UNKNOWN",
"SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE",
"SVG_FECOMPONENTTRANSFER_TYPE_GAMMA",
"SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY",
"SVG_FECOMPONENTTRANSFER_TYPE_LINEAR",
"SVG_FECOMPONENTTRANSFER_TYPE_TABLE",
"SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN",
"SVG_FECOMPOSITE_OPERATOR_ARITHMETIC",
"SVG_FECOMPOSITE_OPERATOR_ATOP",
"SVG_FECOMPOSITE_OPERATOR_IN",
"SVG_FECOMPOSITE_OPERATOR_OUT",
"SVG_FECOMPOSITE_OPERATOR_OVER",
"SVG_FECOMPOSITE_OPERATOR_UNKNOWN",
"SVG_FECOMPOSITE_OPERATOR_XOR",
"SVG_INVALID_VALUE_ERR",
"SVG_LENGTHTYPE_CM",
"SVG_LENGTHTYPE_EMS",
"SVG_LENGTHTYPE_EXS",
"SVG_LENGTHTYPE_IN",
"SVG_LENGTHTYPE_MM",
"SVG_LENGTHTYPE_NUMBER",
"SVG_LENGTHTYPE_PC",
"SVG_LENGTHTYPE_PERCENTAGE",
"SVG_LENGTHTYPE_PT",
"SVG_LENGTHTYPE_PX",
"SVG_LENGTHTYPE_UNKNOWN",
"SVG_MARKERUNITS_STROKEWIDTH",
"SVG_MARKERUNITS_UNKNOWN",
"SVG_MARKERUNITS_USERSPACEONUSE",
"SVG_MARKER_ORIENT_ANGLE",
"SVG_MARKER_ORIENT_AUTO",
"SVG_MARKER_ORIENT_UNKNOWN",
"SVG_MASKTYPE_ALPHA",
"SVG_MASKTYPE_LUMINANCE",
"SVG_MATRIX_NOT_INVERTABLE",
"SVG_MEETORSLICE_MEET",
"SVG_MEETORSLICE_SLICE",
"SVG_MEETORSLICE_UNKNOWN",
"SVG_MORPHOLOGY_OPERATOR_DILATE",
"SVG_MORPHOLOGY_OPERATOR_ERODE",
"SVG_MORPHOLOGY_OPERATOR_UNKNOWN",
"SVG_PAINTTYPE_CURRENTCOLOR",
"SVG_PAINTTYPE_NONE",
"SVG_PAINTTYPE_RGBCOLOR",
"SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR",
"SVG_PAINTTYPE_UNKNOWN",
"SVG_PAINTTYPE_URI",
"SVG_PAINTTYPE_URI_CURRENTCOLOR",
"SVG_PAINTTYPE_URI_NONE",
"SVG_PAINTTYPE_URI_RGBCOLOR",
"SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR",
"SVG_PRESERVEASPECTRATIO_NONE",
"SVG_PRESERVEASPECTRATIO_UNKNOWN",
"SVG_PRESERVEASPECTRATIO_XMAXYMAX",
"SVG_PRESERVEASPECTRATIO_XMAXYMID",
"SVG_PRESERVEASPECTRATIO_XMAXYMIN",
"SVG_PRESERVEASPECTRATIO_XMIDYMAX",
"SVG_PRESERVEASPECTRATIO_XMIDYMID",
"SVG_PRESERVEASPECTRATIO_XMIDYMIN",
"SVG_PRESERVEASPECTRATIO_XMINYMAX",
"SVG_PRESERVEASPECTRATIO_XMINYMID",
"SVG_PRESERVEASPECTRATIO_XMINYMIN",
"SVG_SPREADMETHOD_PAD",
"SVG_SPREADMETHOD_REFLECT",
"SVG_SPREADMETHOD_REPEAT",
"SVG_SPREADMETHOD_UNKNOWN",
"SVG_STITCHTYPE_NOSTITCH",
"SVG_STITCHTYPE_STITCH",
"SVG_STITCHTYPE_UNKNOWN",
"SVG_TRANSFORM_MATRIX",
"SVG_TRANSFORM_ROTATE",
"SVG_TRANSFORM_SCALE",
"SVG_TRANSFORM_SKEWX",
"SVG_TRANSFORM_SKEWY",
"SVG_TRANSFORM_TRANSLATE",
"SVG_TRANSFORM_UNKNOWN",
"SVG_TURBULENCE_TYPE_FRACTALNOISE",
"SVG_TURBULENCE_TYPE_TURBULENCE",
"SVG_TURBULENCE_TYPE_UNKNOWN",
"SVG_UNIT_TYPE_OBJECTBOUNDINGBOX",
"SVG_UNIT_TYPE_UNKNOWN",
"SVG_UNIT_TYPE_USERSPACEONUSE",
"SVG_WRONG_TYPE_ERR",
"SVG_ZOOMANDPAN_DISABLE",
"SVG_ZOOMANDPAN_MAGNIFY",
"SVG_ZOOMANDPAN_UNKNOWN",
"SYNTAX_ERR",
"SavedPages",
"Screen",
"ScreenOrientation",
"Script",
"ScriptProcessorNode",
"ScrollAreaEvent",
"SecurityPolicyViolationEvent",
"Selection",
"ServiceWorker",
"ServiceWorkerContainer",
"ServiceWorkerRegistration",
"SessionDescription",
"Set",
"ShadowRoot",
"SharedWorker",
"SimpleGestureEvent",
"SpeechSynthesisEvent",
"SpeechSynthesisUtterance",
"StopIteration",
"Storage",
"StorageEvent",
"String",
"StyleSheet",
"StyleSheetList",
"SubtleCrypto",
"Symbol",
"SyntaxError",
"TEMPORARY",
"TEXTPATH_METHODTYPE_ALIGN",
"TEXTPATH_METHODTYPE_STRETCH",
"TEXTPATH_METHODTYPE_UNKNOWN",
"TEXTPATH_SPACINGTYPE_AUTO",
"TEXTPATH_SPACINGTYPE_EXACT",
"TEXTPATH_SPACINGTYPE_UNKNOWN",
"TEXTURE",
"TEXTURE0",
"TEXTURE1",
"TEXTURE10",
"TEXTURE11",
"TEXTURE12",
"TEXTURE13",
"TEXTURE14",
"TEXTURE15",
"TEXTURE16",
"TEXTURE17",
"TEXTURE18",
"TEXTURE19",
"TEXTURE2",
"TEXTURE20",
"TEXTURE21",
"TEXTURE22",
"TEXTURE23",
"TEXTURE24",
"TEXTURE25",
"TEXTURE26",
"TEXTURE27",
"TEXTURE28",
"TEXTURE29",
"TEXTURE3",
"TEXTURE30",
"TEXTURE31",
"TEXTURE4",
"TEXTURE5",
"TEXTURE6",
"TEXTURE7",
"TEXTURE8",
"TEXTURE9",
"TEXTURE_2D",
"TEXTURE_BINDING_2D",
"TEXTURE_BINDING_CUBE_MAP",
"TEXTURE_CUBE_MAP",
"TEXTURE_CUBE_MAP_NEGATIVE_X",
"TEXTURE_CUBE_MAP_NEGATIVE_Y",
"TEXTURE_CUBE_MAP_NEGATIVE_Z",
"TEXTURE_CUBE_MAP_POSITIVE_X",
"TEXTURE_CUBE_MAP_POSITIVE_Y",
"TEXTURE_CUBE_MAP_POSITIVE_Z",
"TEXTURE_MAG_FILTER",
"TEXTURE_MAX_ANISOTROPY_EXT",
"TEXTURE_MIN_FILTER",
"TEXTURE_WRAP_S",
"TEXTURE_WRAP_T",
"TEXT_NODE",
"TIMEOUT",
"TIMEOUT_ERR",
"TOO_LARGE_ERR",
"TRANSACTION_INACTIVE_ERR",
"TRIANGLE",
"TRIANGLES",
"TRIANGLE_FAN",
"TRIANGLE_STRIP",
"TYPE_BACK_FORWARD",
"TYPE_ERR",
"TYPE_MISMATCH_ERR",
"TYPE_NAVIGATE",
"TYPE_RELOAD",
"TYPE_RESERVED",
"Text",
"TextDecoder",
"TextEncoder",
"TextEvent",
"TextMetrics",
"TextTrack",
"TextTrackCue",
"TextTrackCueList",
"TextTrackList",
"TimeEvent",
"TimeRanges",
"Touch",
"TouchEvent",
"TouchList",
"TrackEvent",
"TransitionEvent",
"TreeWalker",
"TypeError",
"UIEvent",
"UNCACHED",
"UNKNOWN_ERR",
"UNKNOWN_RULE",
"UNMASKED_RENDERER_WEBGL",
"UNMASKED_VENDOR_WEBGL",
"UNORDERED_NODE_ITERATOR_TYPE",
"UNORDERED_NODE_SNAPSHOT_TYPE",
"UNPACK_ALIGNMENT",
"UNPACK_COLORSPACE_CONVERSION_WEBGL",
"UNPACK_FLIP_Y_WEBGL",
"UNPACK_PREMULTIPLY_ALPHA_WEBGL",
"UNSCHEDULED_STATE",
"UNSENT",
"UNSIGNED_BYTE",
"UNSIGNED_INT",
"UNSIGNED_SHORT",
"UNSIGNED_SHORT_4_4_4_4",
"UNSIGNED_SHORT_5_5_5_1",
"UNSIGNED_SHORT_5_6_5",
"UNSPECIFIED_EVENT_TYPE_ERR",
"UPDATEREADY",
"URIError",
"URL",
"URLSearchParams",
"URLUnencoded",
"URL_MISMATCH_ERR",
"UTC",
"Uint16Array",
"Uint32Array",
"Uint8Array",
"Uint8ClampedArray",
"UserMessageHandler",
"UserMessageHandlersNamespace",
"UserProximityEvent",
"VALIDATE_STATUS",
"VALIDATION_ERR",
"VARIABLES_RULE",
"VENDOR",
"VERSION",
"VERSION_CHANGE",
"VERSION_ERR",
"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",
"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",
"VERTEX_ATTRIB_ARRAY_ENABLED",
"VERTEX_ATTRIB_ARRAY_NORMALIZED",
"VERTEX_ATTRIB_ARRAY_POINTER",
"VERTEX_ATTRIB_ARRAY_SIZE",
"VERTEX_ATTRIB_ARRAY_STRIDE",
"VERTEX_ATTRIB_ARRAY_TYPE",
"VERTEX_SHADER",
"VERTICAL",
"VERTICAL_AXIS",
"VER_ERR",
"VIEWPORT",
"VIEWPORT_RULE",
"VTTCue",
"VTTRegion",
"ValidityState",
"VideoStreamTrack",
"WEBKIT_FILTER_RULE",
"WEBKIT_KEYFRAMES_RULE",
"WEBKIT_KEYFRAME_RULE",
"WEBKIT_REGION_RULE",
"WRONG_DOCUMENT_ERR",
"WaveShaperNode",
"WeakMap",
"WeakSet",
"WebGLActiveInfo",
"WebGLBuffer",
"WebGLContextEvent",
"WebGLFramebuffer",
"WebGLProgram",
"WebGLRenderbuffer",
"WebGLRenderingContext",
"WebGLShader",
"WebGLShaderPrecisionFormat",
"WebGLTexture",
"WebGLUniformLocation",
"WebGLVertexArray",
"WebKitAnimationEvent",
"WebKitBlobBuilder",
"WebKitCSSFilterRule",
"WebKitCSSFilterValue",
"WebKitCSSKeyframeRule",
"WebKitCSSKeyframesRule",
"WebKitCSSMatrix",
"WebKitCSSRegionRule",
"WebKitCSSTransformValue",
"WebKitDataCue",
"WebKitGamepad",
"WebKitMediaKeyError",
"WebKitMediaKeyMessageEvent",
"WebKitMediaKeySession",
"WebKitMediaKeys",
"WebKitMediaSource",
"WebKitMutationObserver",
"WebKitNamespace",
"WebKitPlaybackTargetAvailabilityEvent",
"WebKitPoint",
"WebKitShadowRoot",
"WebKitSourceBuffer",
"WebKitSourceBufferList",
"WebKitTransitionEvent",
"WebSocket",
"WheelEvent",
"Window",
"Worker",
"XMLDocument",
"XMLHttpRequest",
"XMLHttpRequestEventTarget",
"XMLHttpRequestException",
"XMLHttpRequestProgressEvent",
"XMLHttpRequestUpload",
"XMLSerializer",
"XMLStylesheetProcessingInstruction",
"XPathEvaluator",
"XPathException",
"XPathExpression",
"XPathNSResolver",
"XPathResult",
"XSLTProcessor",
"ZERO",
"_XD0M_",
"_YD0M_",
"__defineGetter__",
"__defineSetter__",
"__lookupGetter__",
"__lookupSetter__",
"__opera",
"__proto__",
"_browserjsran",
"a",
"aLink",
"abbr",
"abort",
"abs",
"absolute",
"acceleration",
"accelerationIncludingGravity",
"accelerator",
"accept",
"acceptCharset",
"acceptNode",
"accessKey",
"accessKeyLabel",
"accuracy",
"acos",
"acosh",
"action",
"actionURL",
"active",
"activeCues",
"activeElement",
"activeSourceBuffers",
"activeSourceCount",
"activeTexture",
"add",
"addBehavior",
"addCandidate",
"addColorStop",
"addCue",
"addElement",
"addEventListener",
"addFilter",
"addFromString",
"addFromUri",
"addIceCandidate",
"addImport",
"addListener",
"addNamed",
"addPageRule",
"addPath",
"addPointer",
"addRange",
"addRegion",
"addRule",
"addSearchEngine",
"addSourceBuffer",
"addStream",
"addTextTrack",
"addTrack",
"addWakeLockListener",
"addedNodes",
"additionalName",
"additiveSymbols",
"addons",
"adoptNode",
"adr",
"advance",
"alert",
"algorithm",
"align",
"align-content",
"align-items",
"align-self",
"alignContent",
"alignItems",
"alignSelf",
"alignmentBaseline",
"alinkColor",
"all",
"allSettled",
"allowFullscreen",
"allowedDirections",
"alpha",
"alt",
"altGraphKey",
"altHtml",
"altKey",
"altLeft",
"altitude",
"altitudeAccuracy",
"amplitude",
"ancestorOrigins",
"anchor",
"anchorNode",
"anchorOffset",
"anchors",
"angle",
"animVal",
"animate",
"animatedInstanceRoot",
"animatedNormalizedPathSegList",
"animatedPathSegList",
"animatedPoints",
"animation",
"animation-delay",
"animation-direction",
"animation-duration",
"animation-fill-mode",
"animation-iteration-count",
"animation-name",
"animation-play-state",
"animation-timing-function",
"animationDelay",
"animationDirection",
"animationDuration",
"animationFillMode",
"animationIterationCount",
"animationName",
"animationPlayState",
"animationStartTime",
"animationTimingFunction",
"animationsPaused",
"anniversary",
"any",
"app",
"appCodeName",
"appMinorVersion",
"appName",
"appNotifications",
"appVersion",
"append",
"appendBuffer",
"appendChild",
"appendData",
"appendItem",
"appendMedium",
"appendNamed",
"appendRule",
"appendStream",
"appendWindowEnd",
"appendWindowStart",
"applets",
"applicationCache",
"apply",
"applyElement",
"arc",
"arcTo",
"archive",
"areas",
"arguments",
"arrayBuffer",
"asin",
"asinh",
"assert",
"assign",
"async",
"atEnd",
"atan",
"atan2",
"atanh",
"atob",
"attachEvent",
"attachShader",
"attachShadow",
"attachments",
"attack",
"attrChange",
"attrName",
"attributeFilter",
"attributeName",
"attributeNamespace",
"attributeOldValue",
"attributes",
"audioTracks",
"autoIncrement",
"autobuffer",
"autocapitalize",
"autocomplete",
"autocorrect",
"autofocus",
"autoplay",
"availHeight",
"availLeft",
"availTop",
"availWidth",
"availability",
"available",
"aversion",
"axes",
"axis",
"azimuth",
"b",
"back",
"backface-visibility",
"backfaceVisibility",
"background",
"background-attachment",
"background-blend-mode",
"background-clip",
"background-color",
"background-image",
"background-origin",
"background-position",
"background-repeat",
"background-size",
"backgroundAttachment",
"backgroundBlendMode",
"backgroundClip",
"backgroundColor",
"backgroundImage",
"backgroundOrigin",
"backgroundPosition",
"backgroundPositionX",
"backgroundPositionY",
"backgroundRepeat",
"backgroundSize",
"badInput",
"balance",
"baseFrequencyX",
"baseFrequencyY",
"baseNode",
"baseOffset",
"baseURI",
"baseVal",
"baselineShift",
"battery",
"bday",
"beginElement",
"beginElementAt",
"beginPath",
"behavior",
"behaviorCookie",
"behaviorPart",
"behaviorUrns",
"beta",
"bezierCurveTo",
"bgColor",
"bgProperties",
"bias",
"big",
"binaryType",
"bind",
"bindAttribLocation",
"bindBuffer",
"bindFramebuffer",
"bindRenderbuffer",
"bindTexture",
"blendColor",
"blendEquation",
"blendEquationSeparate",
"blendFunc",
"blendFuncSeparate",
"blink",
"blob",
"blockDirection",
"blue",
"blur",
"body",
"bodyUsed",
"bold",
"bookmarks",
"booleanValue",
"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",
"borderBottom",
"borderBottomColor",
"borderBottomLeftRadius",
"borderBottomRightRadius",
"borderBottomStyle",
"borderBottomWidth",
"borderCollapse",
"borderColor",
"borderColorDark",
"borderColorLight",
"borderImage",
"borderImageOutset",
"borderImageRepeat",
"borderImageSlice",
"borderImageSource",
"borderImageWidth",
"borderLeft",
"borderLeftColor",
"borderLeftStyle",
"borderLeftWidth",
"borderRadius",
"borderRight",
"borderRightColor",
"borderRightStyle",
"borderRightWidth",
"borderSpacing",
"borderStyle",
"borderTop",
"borderTopColor",
"borderTopLeftRadius",
"borderTopRightRadius",
"borderTopStyle",
"borderTopWidth",
"borderWidth",
"bottom",
"bottomMargin",
"bound",
"boundElements",
"boundingClientRect",
"boundingHeight",
"boundingLeft",
"boundingTop",
"boundingWidth",
"bounds",
"box-decoration-break",
"box-shadow",
"box-sizing",
"boxDecorationBreak",
"boxShadow",
"boxSizing",
"breakAfter",
"breakBefore",
"breakInside",
"browserLanguage",
"btoa",
"bubbles",
"buffer",
"bufferData",
"bufferDepth",
"bufferSize",
"bufferSubData",
"buffered",
"bufferedAmount",
"buildID",
"buildNumber",
"button",
"buttonID",
"buttons",
"byteLength",
"byteOffset",
"c",
"call",
"caller",
"canBeFormatted",
"canBeMounted",
"canBeShared",
"canHaveChildren",
"canHaveHTML",
"canPlayType",
"cancel",
"cancelAnimationFrame",
"cancelBubble",
"cancelScheduledValues",
"cancelable",
"candidate",
"canvas",
"caption",
"caption-side",
"captionSide",
"capture",
"captureEvents",
"captureStackTrace",
"caretPositionFromPoint",
"caretRangeFromPoint",
"cast",
"catch",
"category",
"cbrt",
"cd",
"ceil",
"cellIndex",
"cellPadding",
"cellSpacing",
"cells",
"ch",
"chOff",
"chain",
"challenge",
"changedTouches",
"channel",
"channelCount",
"channelCountMode",
"channelInterpretation",
"char",
"charAt",
"charCode",
"charCodeAt",
"charIndex",
"characterData",
"characterDataOldValue",
"characterSet",
"charging",
"chargingTime",
"charset",
"checkEnclosure",
"checkFramebufferStatus",
"checkIntersection",
"checkValidity",
"checked",
"childElementCount",
"childList",
"childNodes",
"children",
"chrome",
"ciphertext",
"cite",
"classList",
"className",
"classid",
"clear",
"clearAttributes",
"clearColor",
"clearData",
"clearDepth",
"clearImmediate",
"clearInterval",
"clearMarks",
"clearMeasures",
"clearParameters",
"clearRect",
"clearResourceTimings",
"clearShadow",
"clearStencil",
"clearTimeout",
"clearWatch",
"click",
"clickCount",
"clientHeight",
"clientInformation",
"clientLeft",
"clientRect",
"clientRects",
"clientTop",
"clientWidth",
"clientX",
"clientY",
"clip",
"clip-path",
"clip-rule",
"clipBottom",
"clipLeft",
"clipPath",
"clipPathUnits",
"clipRight",
"clipRule",
"clipTop",
"clipboardData",
"clone",
"cloneContents",
"cloneNode",
"cloneRange",
"close",
"closePath",
"closed",
"closest",
"clz",
"clz32",
"cmp",
"code",
"codeBase",
"codePointAt",
"codeType",
"colSpan",
"collapse",
"collapseToEnd",
"collapseToStart",
"collapsed",
"collect",
"colno",
"color",
"color-interpolation",
"color-interpolation-filters",
"colorDepth",
"colorInterpolation",
"colorInterpolationFilters",
"colorMask",
"colorType",
"cols",
"columnCount",
"columnFill",
"columnGap",
"columnNumber",
"columnRule",
"columnRuleColor",
"columnRuleStyle",
"columnRuleWidth",
"columnSpan",
"columnWidth",
"columns",
"command",
"commitPreferences",
"commonAncestorContainer",
"compact",
"compareBoundaryPoints",
"compareDocumentPosition",
"compareEndPoints",
"compareNode",
"comparePoint",
"compatMode",
"compatible",
"compile",
"compileShader",
"complete",
"componentFromPoint",
"compositionEndOffset",
"compositionStartOffset",
"compressedTexImage2D",
"compressedTexSubImage2D",
"concat",
"conditionText",
"coneInnerAngle",
"coneOuterAngle",
"coneOuterGain",
"confirm",
"confirmComposition",
"confirmSiteSpecificTrackingException",
"confirmWebWideTrackingException",
"connect",
"connectEnd",
"connectStart",
"connected",
"connection",
"connectionSpeed",
"console",
"consolidate",
"constrictionActive",
"constructor",
"contactID",
"contains",
"containsNode",
"content",
"contentDocument",
"contentEditable",
"contentOverflow",
"contentScriptType",
"contentStyleType",
"contentType",
"contentWindow",
"context",
"contextMenu",
"contextmenu",
"continue",
"continuous",
"control",
"controller",
"controls",
"convertToSpecifiedUnits",
"cookie",
"cookieEnabled",
"coords",
"copyFromChannel",
"copyTexImage2D",
"copyTexSubImage2D",
"copyToChannel",
"copyWithin",
"correspondingElement",
"correspondingUseElement",
"cos",
"cosh",
"count",
"counter-increment",
"counter-reset",
"counterIncrement",
"counterReset",
"cpuClass",
"cpuSleepAllowed",
"create",
"createAnalyser",
"createAnswer",
"createAttribute",
"createAttributeNS",
"createBiquadFilter",
"createBuffer",
"createBufferSource",
"createCDATASection",
"createCSSStyleSheet",
"createCaption",
"createChannelMerger",
"createChannelSplitter",
"createComment",
"createContextualFragment",
"createControlRange",
"createConvolver",
"createDTMFSender",
"createDataChannel",
"createDelay",
"createDelayNode",
"createDocument",
"createDocumentFragment",
"createDocumentType",
"createDynamicsCompressor",
"createElement",
"createElementNS",
"createEntityReference",
"createEvent",
"createEventObject",
"createExpression",
"createFramebuffer",
"createFunction",
"createGain",
"createGainNode",
"createHTMLDocument",
"createImageBitmap",
"createImageData",
"createIndex",
"createJavaScriptNode",
"createLinearGradient",
"createMediaElementSource",
"createMediaKeys",
"createMediaStreamDestination",
"createMediaStreamSource",
"createMutableFile",
"createNSResolver",
"createNodeIterator",
"createNotification",
"createObjectStore",
"createObjectURL",
"createOffer",
"createOscillator",
"createPanner",
"createPattern",
"createPeriodicWave",
"createPopup",
"createProcessingInstruction",
"createProgram",
"createRadialGradient",
"createRange",
"createRangeCollection",
"createRenderbuffer",
"createSVGAngle",
"createSVGLength",
"createSVGMatrix",
"createSVGNumber",
"createSVGPathSegArcAbs",
"createSVGPathSegArcRel",
"createSVGPathSegClosePath",
"createSVGPathSegCurvetoCubicAbs",
"createSVGPathSegCurvetoCubicRel",
"createSVGPathSegCurvetoCubicSmoothAbs",
"createSVGPathSegCurvetoCubicSmoothRel",
"createSVGPathSegCurvetoQuadraticAbs",
"createSVGPathSegCurvetoQuadraticRel",
"createSVGPathSegCurvetoQuadraticSmoothAbs",
"createSVGPathSegCurvetoQuadraticSmoothRel",
"createSVGPathSegLinetoAbs",
"createSVGPathSegLinetoHorizontalAbs",
"createSVGPathSegLinetoHorizontalRel",
"createSVGPathSegLinetoRel",
"createSVGPathSegLinetoVerticalAbs",
"createSVGPathSegLinetoVerticalRel",
"createSVGPathSegMovetoAbs",
"createSVGPathSegMovetoRel",
"createSVGPoint",
"createSVGRect",
"createSVGTransform",
"createSVGTransformFromMatrix",
"createScriptProcessor",
"createSession",
"createShader",
"createShadowRoot",
"createStereoPanner",
"createStyleSheet",
"createTBody",
"createTFoot",
"createTHead",
"createTextNode",
"createTextRange",
"createTexture",
"createTouch",
"createTouchList",
"createTreeWalker",
"createWaveShaper",
"creationTime",
"crossOrigin",
"crypto",
"csi",
"cssFloat",
"cssRules",
"cssText",
"cssValueType",
"ctrlKey",
"ctrlLeft",
"cues",
"cullFace",
"currentNode",
"currentPage",
"currentScale",
"currentScript",
"currentSrc",
"currentState",
"currentStyle",
"currentTarget",
"currentTime",
"currentTranslate",
"currentView",
"cursor",
"curve",
"customError",
"cx",
"cy",
"d",
"data",
"dataFld",
"dataFormatAs",
"dataPageSize",
"dataSrc",
"dataTransfer",
"database",
"dataset",
"dateTime",
"db",
"debug",
"debuggerEnabled",
"declare",
"decode",
"decodeAudioData",
"decodeURI",
"decodeURIComponent",
"decodingInfo",
"decrypt",
"default",
"defaultCharset",
"defaultChecked",
"defaultMuted",
"defaultPlaybackRate",
"defaultPrevented",
"defaultSelected",
"defaultStatus",
"defaultURL",
"defaultValue",
"defaultView",
"defaultstatus",
"defer",
"defineMagicFunction",
"defineMagicVariable",
"defineProperties",
"defineProperty",
"delayTime",
"delete",
"deleteBuffer",
"deleteCaption",
"deleteCell",
"deleteContents",
"deleteData",
"deleteDatabase",
"deleteFramebuffer",
"deleteFromDocument",
"deleteIndex",
"deleteMedium",
"deleteObjectStore",
"deleteProgram",
"deleteRenderbuffer",
"deleteRow",
"deleteRule",
"deleteShader",
"deleteTFoot",
"deleteTHead",
"deleteTexture",
"deliverChangeRecords",
"delivery",
"deliveryInfo",
"deliveryStatus",
"deliveryTimestamp",
"delta",
"deltaMode",
"deltaX",
"deltaY",
"deltaZ",
"depthFunc",
"depthMask",
"depthRange",
"deriveBits",
"deriveKey",
"description",
"deselectAll",
"designMode",
"destination",
"destinationURL",
"detach",
"detachEvent",
"detachShader",
"detail",
"detune",
"devicePixelRatio",
"deviceXDPI",
"deviceYDPI",
"diffuseConstant",
"digest",
"dimensions",
"dir",
"dirName",
"direction",
"dirxml",
"disable",
"disableVertexAttribArray",
"disabled",
"dischargingTime",
"disconnect",
"dispatchEvent",
"display",
"distanceModel",
"divisor",
"djsapi",
"djsproxy",
"doImport",
"doNotTrack",
"doScroll",
"doctype",
"document",
"documentElement",
"documentMode",
"documentURI",
"dolphin",
"dolphinGameCenter",
"dolphininfo",
"dolphinmeta",
"domComplete",
"domContentLoadedEventEnd",
"domContentLoadedEventStart",
"domInteractive",
"domLoading",
"domain",
"domainLookupEnd",
"domainLookupStart",
"dominant-baseline",
"dominantBaseline",
"done",
"dopplerFactor",
"download",
"dragDrop",
"draggable",
"drawArrays",
"drawArraysInstancedANGLE",
"drawCustomFocusRing",
"drawElements",
"drawElementsInstancedANGLE",
"drawFocusIfNeeded",
"drawImage",
"drawImageFromRect",
"drawSystemFocusRing",
"drawingBufferHeight",
"drawingBufferWidth",
"dropEffect",
"droppedVideoFrames",
"dropzone",
"dump",
"duplicate",
"duration",
"dvname",
"dvnum",
"dx",
"dy",
"dynsrc",
"e",
"edgeMode",
"effectAllowed",
"elapsedTime",
"elementFromPoint",
"elements",
"elevation",
"ellipse",
"email",
"embeds",
"empty",
"empty-cells",
"emptyCells",
"enable",
"enableBackground",
"enableStyleSheetsForSet",
"enableVertexAttribArray",
"enabled",
"enabledPlugin",
"encode",
"encodeURI",
"encodeURIComponent",
"encoding",
"encrypt",
"enctype",
"end",
"endContainer",
"endElement",
"endElementAt",
"endOfStream",
"endOffset",
"endTime",
"ended",
"endsWith",
"entities",
"entries",
"entryType",
"enumerate",
"enumerateEditable",
"error",
"errorCode",
"escape",
"eval",
"evaluate",
"event",
"eventPhase",
"every",
"exception",
"exec",
"execCommand",
"execCommandShowHelp",
"execScript",
"exitFullscreen",
"exitPointerLock",
"exp",
"expand",
"expandEntityReferences",
"expando",
"expansion",
"expiryDate",
"explicitOriginalTarget",
"expm1",
"exponent",
"exponentialRampToValueAtTime",
"exportKey",
"extend",
"extensions",
"extentNode",
"extentOffset",
"external",
"externalResourcesRequired",
"extractContents",
"extractable",
"f",
"face",
"factoryReset",
"fallback",
"familyName",
"farthestViewportElement",
"fastSeek",
"fatal",
"fetch",
"fetchStart",
"fftSize",
"fgColor",
"fileCreatedDate",
"fileHandle",
"fileModifiedDate",
"fileName",
"fileSize",
"fileUpdatedDate",
"filename",
"files",
"fill",
"fill-opacity",
"fill-rule",
"fillOpacity",
"fillRect",
"fillRule",
"fillStyle",
"fillText",
"filter",
"filterResX",
"filterResY",
"filterUnits",
"filters",
"finally",
"find",
"findIndex",
"findRule",
"findText",
"finish",
"fireEvent",
"firstChild",
"firstElementChild",
"firstPage",
"fixed",
"flex",
"flex-basis",
"flex-direction",
"flex-flow",
"flex-grow",
"flex-shrink",
"flex-wrap",
"flexBasis",
"flexDirection",
"flexFlow",
"flexGrow",
"flexShrink",
"flexWrap",
"flipX",
"flipY",
"float",
"flood-color",
"flood-opacity",
"floodColor",
"floodOpacity",
"floor",
"flush",
"focus",
"focusNode",
"focusOffset",
"font",
"font-family",
"font-feature-settings",
"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",
"fontFamily",
"fontFeatureSettings",
"fontKerning",
"fontLanguageOverride",
"fontSize",
"fontSizeAdjust",
"fontSmoothingEnabled",
"fontStretch",
"fontStyle",
"fontSynthesis",
"fontVariant",
"fontVariantAlternates",
"fontVariantCaps",
"fontVariantEastAsian",
"fontVariantLigatures",
"fontVariantNumeric",
"fontVariantPosition",
"fontWeight",
"fontcolor",
"fonts",
"fontsize",
"for",
"forEach",
"forceRedraw",
"form",
"formAction",
"formEnctype",
"formMethod",
"formNoValidate",
"formTarget",
"format",
"formatToParts",
"forms",
"forward",
"fr",
"frame",
"frameBorder",
"frameElement",
"frameSpacing",
"framebufferRenderbuffer",
"framebufferTexture2D",
"frames",
"freeSpace",
"freeze",
"frequency",
"frequencyBinCount",
"from",
"fromCharCode",
"fromCodePoint",
"fromElement",
"frontFace",
"fround",
"fullScreen",
"fullscreenElement",
"fullscreenEnabled",
"fx",
"fy",
"gain",
"gamepad",
"gamma",
"genderIdentity",
"generateKey",
"generateMipmap",
"generateRequest",
"geolocation",
"gestureObject",
"get",
"getActiveAttrib",
"getActiveUniform",
"getAdjacentText",
"getAll",
"getAllResponseHeaders",
"getAsFile",
"getAsString",
"getAttachedShaders",
"getAttribLocation",
"getAttribute",
"getAttributeNS",
"getAttributeNode",
"getAttributeNodeNS",
"getAudioTracks",
"getBBox",
"getBattery",
"getBlob",
"getBookmark",
"getBoundingClientRect",
"getBufferParameter",
"getByteFrequencyData",
"getByteTimeDomainData",
"getCSSCanvasContext",
"getCTM",
"getCandidateWindowClientRect",
"getChannelData",
"getCharNumAtPosition",
"getClientRect",
"getClientRects",
"getCompositionAlternatives",
"getComputedStyle",
"getComputedTextLength",
"getConfiguration",
"getContext",
"getContextAttributes",
"getCounterValue",
"getCueAsHTML",
"getCueById",
"getCurrentPosition",
"getCurrentTime",
"getData",
"getDatabaseNames",
"getDate",
"getDay",
"getDefaultComputedStyle",
"getDestinationInsertionPoints",
"getDistributedNodes",
"getEditable",
"getElementById",
"getElementsByClassName",
"getElementsByName",
"getElementsByTagName",
"getElementsByTagNameNS",
"getEnclosureList",
"getEndPositionOfChar",
"getEntries",
"getEntriesByName",
"getEntriesByType",
"getError",
"getExtension",
"getExtentOfChar",
"getFeature",
"getFile",
"getFloat32",
"getFloat64",
"getFloatFrequencyData",
"getFloatTimeDomainData",
"getFloatValue",
"getFramebufferAttachmentParameter",
"getFrequencyResponse",
"getFullYear",
"getGamepads",
"getHours",
"getImageData",
"getInt16",
"getInt32",
"getInt8",
"getIntersectionList",
"getItem",
"getItems",
"getKey",
"getLineDash",
"getLocalStreams",
"getMarks",
"getMatchedCSSRules",
"getMeasures",
"getMetadata",
"getMilliseconds",
"getMinutes",
"getModifierState",
"getMonth",
"getNamedItem",
"getNamedItemNS",
"getNotifier",
"getNumberOfChars",
"getOverrideHistoryNavigationMode",
"getOverrideStyle",
"getOwnPropertyDescriptor",
"getOwnPropertyNames",
"getOwnPropertySymbols",
"getParameter",
"getPathSegAtLength",
"getPointAtLength",
"getPreference",
"getPreferenceDefault",
"getPresentationAttribute",
"getPreventDefault",
"getProgramInfoLog",
"getProgramParameter",
"getPropertyCSSValue",
"getPropertyPriority",
"getPropertyShorthand",
"getPropertyValue",
"getPrototypeOf",
"getRGBColorValue",
"getRandomValues",
"getRangeAt",
"getReceivers",
"getRectValue",
"getRegistration",
"getRemoteStreams",
"getRenderbufferParameter",
"getResponseHeader",
"getRoot",
"getRotationOfChar",
"getSVGDocument",
"getScreenCTM",
"getSeconds",
"getSelection",
"getSenders",
"getShaderInfoLog",
"getShaderParameter",
"getShaderPrecisionFormat",
"getShaderSource",
"getSimpleDuration",
"getSiteIcons",
"getSources",
"getSpeculativeParserUrls",
"getStartPositionOfChar",
"getStartTime",
"getStats",
"getStorageUpdates",
"getStreamById",
"getStringValue",
"getSubStringLength",
"getSubscription",
"getSupportedExtensions",
"getTexParameter",
"getTime",
"getTimezoneOffset",
"getTotalLength",
"getTrackById",
"getTracks",
"getTransformToElement",
"getUTCDate",
"getUTCDay",
"getUTCFullYear",
"getUTCHours",
"getUTCMilliseconds",
"getUTCMinutes",
"getUTCMonth",
"getUTCSeconds",
"getUint16",
"getUint32",
"getUint8",
"getUniform",
"getUniformLocation",
"getUserMedia",
"getValues",
"getVarDate",
"getVariableValue",
"getVertexAttrib",
"getVertexAttribOffset",
"getVideoPlaybackQuality",
"getVideoTracks",
"getWakeLockState",
"getYear",
"givenName",
"global",
"globalAlpha",
"globalCompositeOperation",
"glyphOrientationHorizontal",
"glyphOrientationVertical",
"glyphRef",
"go",
"gradientTransform",
"gradientUnits",
"grammars",
"green",
"group",
"groupCollapsed",
"groupEnd",
"hardwareConcurrency",
"has",
"hasAttribute",
"hasAttributeNS",
"hasAttributes",
"hasChildNodes",
"hasComposition",
"hasExtension",
"hasFeature",
"hasFocus",
"hasLayout",
"hasOwnProperty",
"hash",
"head",
"headers",
"heading",
"height",
"hidden",
"hide",
"hideFocus",
"high",
"hint",
"history",
"honorificPrefix",
"honorificSuffix",
"horizontalOverflow",
"host",
"hostname",
"href",
"hreflang",
"hspace",
"html5TagCheckInerface",
"htmlFor",
"htmlText",
"httpEquiv",
"hwTimestamp",
"hypot",
"iccId",
"iceConnectionState",
"iceGatheringState",
"icon",
"id",
"identifier",
"identity",
"ignoreBOM",
"ignoreCase",
"image-orientation",
"image-rendering",
"imageOrientation",
"imageRendering",
"images",
"ime-mode",
"imeMode",
"implementation",
"importKey",
"importNode",
"importStylesheet",
"imports",
"impp",
"imul",
"in1",
"in2",
"inBandMetadataTrackDispatchType",
"inRange",
"includes",
"incremental",
"indeterminate",
"index",
"indexNames",
"indexOf",
"indexedDB",
"inertiaDestinationX",
"inertiaDestinationY",
"info",
"init",
"initAnimationEvent",
"initBeforeLoadEvent",
"initClipboardEvent",
"initCloseEvent",
"initCommandEvent",
"initCompositionEvent",
"initCustomEvent",
"initData",
"initDeviceMotionEvent",
"initDeviceOrientationEvent",
"initDragEvent",
"initErrorEvent",
"initEvent",
"initFocusEvent",
"initGestureEvent",
"initHashChangeEvent",
"initKeyEvent",
"initKeyboardEvent",
"initMSManipulationEvent",
"initMessageEvent",
"initMouseEvent",
"initMouseScrollEvent",
"initMouseWheelEvent",
"initMutationEvent",
"initNSMouseEvent",
"initOverflowEvent",
"initPageEvent",
"initPageTransitionEvent",
"initPointerEvent",
"initPopStateEvent",
"initProgressEvent",
"initScrollAreaEvent",
"initSimpleGestureEvent",
"initStorageEvent",
"initTextEvent",
"initTimeEvent",
"initTouchEvent",
"initTransitionEvent",
"initUIEvent",
"initWebKitAnimationEvent",
"initWebKitTransitionEvent",
"initWebKitWheelEvent",
"initWheelEvent",
"initialTime",
"initialize",
"initiatorType",
"inner",
"innerHTML",
"innerHeight",
"innerText",
"innerWidth",
"input",
"inputBuffer",
"inputEncoding",
"inputMethod",
"insertAdjacentElement",
"insertAdjacentHTML",
"insertAdjacentText",
"insertBefore",
"insertCell",
"insertData",
"insertItemBefore",
"insertNode",
"insertRow",
"insertRule",
"instanceRoot",
"intercept",
"interimResults",
"internalSubset",
"intersectsNode",
"interval",
"invalidIteratorState",
"inverse",
"invertSelf",
"is",
"is2D",
"isAlternate",
"isArray",
"isBingCurrentSearchDefault",
"isBuffer",
"isCandidateWindowVisible",
"isChar",
"isCollapsed",
"isComposing",
"isContentEditable",
"isContentHandlerRegistered",
"isContextLost",
"isDefaultNamespace",
"isDisabled",
"isEnabled",
"isEqual",
"isEqualNode",
"isExtensible",
"isFinite",
"isFramebuffer",
"isFrozen",
"isGenerator",
"isId",
"isInjected",
"isInteger",
"isMap",
"isMultiLine",
"isNaN",
"isOpen",
"isPointInFill",
"isPointInPath",
"isPointInRange",
"isPointInStroke",
"isPrefAlternate",
"isPrimary",
"isProgram",
"isPropertyImplicit",
"isProtocolHandlerRegistered",
"isPrototypeOf",
"isRenderbuffer",
"isSafeInteger",
"isSameNode",
"isSealed",
"isShader",
"isSupported",
"isTextEdit",
"isTexture",
"isTrusted",
"isTypeSupported",
"isView",
"isolation",
"italics",
"item",
"itemId",
"itemProp",
"itemRef",
"itemScope",
"itemType",
"itemValue",
"iterateNext",
"iterator",
"javaEnabled",
"jobTitle",
"join",
"json",
"justify-content",
"justifyContent",
"k1",
"k2",
"k3",
"k4",
"kernelMatrix",
"kernelUnitLengthX",
"kernelUnitLengthY",
"kerning",
"key",
"keyCode",
"keyFor",
"keyIdentifier",
"keyLightEnabled",
"keyLocation",
"keyPath",
"keySystem",
"keyText",
"keyUsage",
"keys",
"keytype",
"kind",
"knee",
"label",
"labels",
"lang",
"language",
"languages",
"largeArcFlag",
"lastChild",
"lastElementChild",
"lastEventId",
"lastIndex",
"lastIndexOf",
"lastMatch",
"lastMessageSubject",
"lastMessageType",
"lastModified",
"lastModifiedDate",
"lastPage",
"lastParen",
"lastState",
"lastStyleSheetSet",
"latitude",
"layerX",
"layerY",
"layoutFlow",
"layoutGrid",
"layoutGridChar",
"layoutGridLine",
"layoutGridMode",
"layoutGridType",
"lbound",
"left",
"leftContext",
"leftMargin",
"length",
"lengthAdjust",
"lengthComputable",
"letter-spacing",
"letterSpacing",
"level",
"lighting-color",
"lightingColor",
"limitingConeAngle",
"line",
"line-height",
"lineAlign",
"lineBreak",
"lineCap",
"lineDashOffset",
"lineHeight",
"lineJoin",
"lineNumber",
"lineTo",
"lineWidth",
"linearRampToValueAtTime",
"lineno",
"link",
"linkColor",
"linkProgram",
"links",
"list",
"list-style",
"list-style-image",
"list-style-position",
"list-style-type",
"listStyle",
"listStyleImage",
"listStylePosition",
"listStyleType",
"listener",
"load",
"loadEventEnd",
"loadEventStart",
"loadTimes",
"loaded",
"localDescription",
"localName",
"localStorage",
"locale",
"localeCompare",
"location",
"locationbar",
"lock",
"lockedFile",
"log",
"log10",
"log1p",
"log2",
"logicalXDPI",
"logicalYDPI",
"longDesc",
"longitude",
"lookupNamespaceURI",
"lookupPrefix",
"loop",
"loopEnd",
"loopStart",
"looping",
"low",
"lower",
"lowerBound",
"lowerOpen",
"lowsrc",
"m11",
"m12",
"m13",
"m14",
"m21",
"m22",
"m23",
"m24",
"m31",
"m32",
"m33",
"m34",
"m41",
"m42",
"m43",
"m44",
"manifest",
"map",
"mapping",
"margin",
"margin-bottom",
"margin-left",
"margin-right",
"margin-top",
"marginBottom",
"marginHeight",
"marginLeft",
"marginRight",
"marginTop",
"marginWidth",
"mark",
"marker",
"marker-end",
"marker-mid",
"marker-offset",
"marker-start",
"markerEnd",
"markerHeight",
"markerMid",
"markerOffset",
"markerStart",
"markerUnits",
"markerWidth",
"marks",
"mask",
"mask-type",
"maskContentUnits",
"maskType",
"maskUnits",
"match",
"matchMedia",
"matchMedium",
"matches",
"matrix",
"matrixTransform",
"max",
"max-height",
"max-width",
"maxAlternatives",
"maxChannelCount",
"maxConnectionsPerServer",
"maxDecibels",
"maxDistance",
"maxHeight",
"maxLength",
"maxTouchPoints",
"maxValue",
"maxWidth",
"measure",
"measureText",
"media",
"mediaCapabilities",
"mediaDevices",
"mediaElement",
"mediaGroup",
"mediaKeys",
"mediaText",
"meetOrSlice",
"memory",
"menubar",
"mergeAttributes",
"message",
"messageClass",
"messageHandlers",
"metaKey",
"method",
"mimeType",
"mimeTypes",
"min",
"min-height",
"min-width",
"minDecibels",
"minHeight",
"minValue",
"minWidth",
"miterLimit",
"mix-blend-mode",
"mixBlendMode",
"mode",
"modify",
"mount",
"move",
"moveBy",
"moveEnd",
"moveFirst",
"moveFocusDown",
"moveFocusLeft",
"moveFocusRight",
"moveFocusUp",
"moveNext",
"moveRow",
"moveStart",
"moveTo",
"moveToBookmark",
"moveToElementText",
"moveToPoint",
"mozAdd",
"mozAnimationStartTime",
"mozAnon",
"mozApps",
"mozAudioCaptured",
"mozAudioChannelType",
"mozAutoplayEnabled",
"mozCancelAnimationFrame",
"mozCancelFullScreen",
"mozCancelRequestAnimationFrame",
"mozCaptureStream",
"mozCaptureStreamUntilEnded",
"mozClearDataAt",
"mozContact",
"mozContacts",
"mozCreateFileHandle",
"mozCurrentTransform",
"mozCurrentTransformInverse",
"mozCursor",
"mozDash",
"mozDashOffset",
"mozDecodedFrames",
"mozExitPointerLock",
"mozFillRule",
"mozFragmentEnd",
"mozFrameDelay",
"mozFullScreen",
"mozFullScreenElement",
"mozFullScreenEnabled",
"mozGetAll",
"mozGetAllKeys",
"mozGetAsFile",
"mozGetDataAt",
"mozGetMetadata",
"mozGetUserMedia",
"mozHasAudio",
"mozHasItem",
"mozHidden",
"mozImageSmoothingEnabled",
"mozIndexedDB",
"mozInnerScreenX",
"mozInnerScreenY",
"mozInputSource",
"mozIsTextField",
"mozItem",
"mozItemCount",
"mozItems",
"mozLength",
"mozLockOrientation",
"mozMatchesSelector",
"mozMovementX",
"mozMovementY",
"mozOpaque",
"mozOrientation",
"mozPaintCount",
"mozPaintedFrames",
"mozParsedFrames",
"mozPay",
"mozPointerLockElement",
"mozPresentedFrames",
"mozPreservesPitch",
"mozPressure",
"mozPrintCallback",
"mozRTCIceCandidate",
"mozRTCPeerConnection",
"mozRTCSessionDescription",
"mozRemove",
"mozRequestAnimationFrame",
"mozRequestFullScreen",
"mozRequestPointerLock",
"mozSetDataAt",
"mozSetImageElement",
"mozSourceNode",
"mozSrcObject",
"mozSystem",
"mozTCPSocket",
"mozTextStyle",
"mozTypesAt",
"mozUnlockOrientation",
"mozUserCancelled",
"mozVisibilityState",
"msAnimation",
"msAnimationDelay",
"msAnimationDirection",
"msAnimationDuration",
"msAnimationFillMode",
"msAnimationIterationCount",
"msAnimationName",
"msAnimationPlayState",
"msAnimationStartTime",
"msAnimationTimingFunction",
"msBackfaceVisibility",
"msBlockProgression",
"msCSSOMElementFloatMetrics",
"msCaching",
"msCachingEnabled",
"msCancelRequestAnimationFrame",
"msCapsLockWarningOff",
"msClearImmediate",
"msClose",
"msContentZoomChaining",
"msContentZoomFactor",
"msContentZoomLimit",
"msContentZoomLimitMax",
"msContentZoomLimitMin",
"msContentZoomSnap",
"msContentZoomSnapPoints",
"msContentZoomSnapType",
"msContentZooming",
"msConvertURL",
"msCrypto",
"msDoNotTrack",
"msElementsFromPoint",
"msElementsFromRect",
"msExitFullscreen",
"msExtendedCode",
"msFillRule",
"msFirstPaint",
"msFlex",
"msFlexAlign",
"msFlexDirection",
"msFlexFlow",
"msFlexItemAlign",
"msFlexLinePack",
"msFlexNegative",
"msFlexOrder",
"msFlexPack",
"msFlexPositive",
"msFlexPreferredSize",
"msFlexWrap",
"msFlowFrom",
"msFlowInto",
"msFontFeatureSettings",
"msFullscreenElement",
"msFullscreenEnabled",
"msGetInputContext",
"msGetRegionContent",
"msGetUntransformedBounds",
"msGraphicsTrustStatus",
"msGridColumn",
"msGridColumnAlign",
"msGridColumnSpan",
"msGridColumns",
"msGridRow",
"msGridRowAlign",
"msGridRowSpan",
"msGridRows",
"msHidden",
"msHighContrastAdjust",
"msHyphenateLimitChars",
"msHyphenateLimitLines",
"msHyphenateLimitZone",
"msHyphens",
"msImageSmoothingEnabled",
"msImeAlign",
"msIndexedDB",
"msInterpolationMode",
"msIsStaticHTML",
"msKeySystem",
"msKeys",
"msLaunchUri",
"msLockOrientation",
"msManipulationViewsEnabled",
"msMatchMedia",
"msMatchesSelector",
"msMaxTouchPoints",
"msOrientation",
"msOverflowStyle",
"msPerspective",
"msPerspectiveOrigin",
"msPlayToDisabled",
"msPlayToPreferredSourceUri",
"msPlayToPrimary",
"msPointerEnabled",
"msRegionOverflow",
"msReleasePointerCapture",
"msRequestAnimationFrame",
"msRequestFullscreen",
"msSaveBlob",
"msSaveOrOpenBlob",
"msScrollChaining",
"msScrollLimit",
"msScrollLimitXMax",
"msScrollLimitXMin",
"msScrollLimitYMax",
"msScrollLimitYMin",
"msScrollRails",
"msScrollSnapPointsX",
"msScrollSnapPointsY",
"msScrollSnapType",
"msScrollSnapX",
"msScrollSnapY",
"msScrollTranslation",
"msSetImmediate",
"msSetMediaKeys",
"msSetPointerCapture",
"msTextCombineHorizontal",
"msTextSizeAdjust",
"msToBlob",
"msTouchAction",
"msTouchSelect",
"msTraceAsyncCallbackCompleted",
"msTraceAsyncCallbackStarting",
"msTraceAsyncOperationCompleted",
"msTraceAsyncOperationStarting",
"msTransform",
"msTransformOrigin",
"msTransformStyle",
"msTransition",
"msTransitionDelay",
"msTransitionDuration",
"msTransitionProperty",
"msTransitionTimingFunction",
"msUnlockOrientation",
"msUpdateAsyncCallbackRelation",
"msUserSelect",
"msVisibilityState",
"msWrapFlow",
"msWrapMargin",
"msWrapThrough",
"msWriteProfilerMark",
"msZoom",
"msZoomTo",
"mt",
"multiEntry",
"multiSelectionObj",
"multiline",
"multiple",
"multiply",
"multiplySelf",
"mutableFile",
"muted",
"n",
"name",
"nameProp",
"namedItem",
"namedRecordset",
"names",
"namespaceURI",
"namespaces",
"naturalHeight",
"naturalWidth",
"navigate",
"navigation",
"navigationMode",
"navigationStart",
"navigator",
"near",
"nearestViewportElement",
"negative",
"netscape",
"networkState",
"newScale",
"newTranslate",
"newURL",
"newValue",
"newValueSpecifiedUnits",
"newVersion",
"newhome",
"next",
"nextElementSibling",
"nextNode",
"nextPage",
"nextSibling",
"nickname",
"noHref",
"noResize",
"noShade",
"noValidate",
"noWrap",
"nodeName",
"nodeType",
"nodeValue",
"normalize",
"normalizedPathSegList",
"notationName",
"notations",
"note",
"noteGrainOn",
"noteOff",
"noteOn",
"now",
"numOctaves",
"number",
"numberOfChannels",
"numberOfInputs",
"numberOfItems",
"numberOfOutputs",
"numberValue",
"oMatchesSelector",
"object",
"object-fit",
"object-position",
"objectFit",
"objectPosition",
"objectStore",
"objectStoreNames",
"observe",
"of",
"offscreenBuffering",
"offset",
"offsetHeight",
"offsetLeft",
"offsetNode",
"offsetParent",
"offsetTop",
"offsetWidth",
"offsetX",
"offsetY",
"ok",
"oldURL",
"oldValue",
"oldVersion",
"olderShadowRoot",
"onLine",
"onabort",
"onactivate",
"onactive",
"onaddstream",
"onaddtrack",
"onafterprint",
"onafterscriptexecute",
"onafterupdate",
"onaudioend",
"onaudioprocess",
"onaudiostart",
"onautocomplete",
"onautocompleteerror",
"onbeforeactivate",
"onbeforecopy",
"onbeforecut",
"onbeforedeactivate",
"onbeforeeditfocus",
"onbeforepaste",
"onbeforeprint",
"onbeforescriptexecute",
"onbeforeunload",
"onbeforeupdate",
"onblocked",
"onblur",
"onbounce",
"onboundary",
"oncached",
"oncancel",
"oncandidatewindowhide",
"oncandidatewindowshow",
"oncandidatewindowupdate",
"oncanplay",
"oncanplaythrough",
"once",
"oncellchange",
"onchange",
"onchargingchange",
"onchargingtimechange",
"onchecking",
"onclick",
"onclose",
"oncompassneedscalibration",
"oncomplete",
"oncontextmenu",
"oncontrolselect",
"oncopy",
"oncuechange",
"oncut",
"ondataavailable",
"ondatachannel",
"ondatasetchanged",
"ondatasetcomplete",
"ondblclick",
"ondeactivate",
"ondevicelight",
"ondevicemotion",
"ondeviceorientation",
"ondeviceproximity",
"ondischargingtimechange",
"ondisplay",
"ondownloading",
"ondrag",
"ondragend",
"ondragenter",
"ondragleave",
"ondragover",
"ondragstart",
"ondrop",
"ondurationchange",
"onemptied",
"onencrypted",
"onend",
"onended",
"onenter",
"onerror",
"onerrorupdate",
"onexit",
"onfilterchange",
"onfinish",
"onfocus",
"onfocusin",
"onfocusout",
"onfullscreenchange",
"onfullscreenerror",
"ongesturechange",
"ongestureend",
"ongesturestart",
"ongotpointercapture",
"onhashchange",
"onhelp",
"onicecandidate",
"oniceconnectionstatechange",
"oninactive",
"oninput",
"oninvalid",
"onkeydown",
"onkeypress",
"onkeyup",
"onlanguagechange",
"onlayoutcomplete",
"onlevelchange",
"onload",
"onloadeddata",
"onloadedmetadata",
"onloadend",
"onloadstart",
"onlosecapture",
"onlostpointercapture",
"only",
"onmark",
"onmessage",
"onmousedown",
"onmouseenter",
"onmouseleave",
"onmousemove",
"onmouseout",
"onmouseover",
"onmouseup",
"onmousewheel",
"onmove",
"onmoveend",
"onmovestart",
"onmozfullscreenchange",
"onmozfullscreenerror",
"onmozorientationchange",
"onmozpointerlockchange",
"onmozpointerlockerror",
"onmscontentzoom",
"onmsfullscreenchange",
"onmsfullscreenerror",
"onmsgesturechange",
"onmsgesturedoubletap",
"onmsgestureend",
"onmsgesturehold",
"onmsgesturestart",
"onmsgesturetap",
"onmsgotpointercapture",
"onmsinertiastart",
"onmslostpointercapture",
"onmsmanipulationstatechanged",
"onmsneedkey",
"onmsorientationchange",
"onmspointercancel",
"onmspointerdown",
"onmspointerenter",
"onmspointerhover",
"onmspointerleave",
"onmspointermove",
"onmspointerout",
"onmspointerover",
"onmspointerup",
"onmssitemodejumplistitemremoved",
"onmsthumbnailclick",
"onnegotiationneeded",
"onnomatch",
"onnoupdate",
"onobsolete",
"onoffline",
"ononline",
"onopen",
"onorientationchange",
"onpagechange",
"onpagehide",
"onpageshow",
"onpaste",
"onpause",
"onplay",
"onplaying",
"onpluginstreamstart",
"onpointercancel",
"onpointerdown",
"onpointerenter",
"onpointerleave",
"onpointerlockchange",
"onpointerlockerror",
"onpointermove",
"onpointerout",
"onpointerover",
"onpointerup",
"onpopstate",
"onprogress",
"onpropertychange",
"onratechange",
"onreadystatechange",
"onremovestream",
"onremovetrack",
"onreset",
"onresize",
"onresizeend",
"onresizestart",
"onresourcetimingbufferfull",
"onresult",
"onresume",
"onrowenter",
"onrowexit",
"onrowsdelete",
"onrowsinserted",
"onscroll",
"onsearch",
"onseeked",
"onseeking",
"onselect",
"onselectionchange",
"onselectstart",
"onshow",
"onsignalingstatechange",
"onsoundend",
"onsoundstart",
"onspeechend",
"onspeechstart",
"onstalled",
"onstart",
"onstatechange",
"onstop",
"onstorage",
"onstoragecommit",
"onsubmit",
"onsuccess",
"onsuspend",
"ontextinput",
"ontimeout",
"ontimeupdate",
"ontoggle",
"ontouchcancel",
"ontouchend",
"ontouchmove",
"ontouchstart",
"ontransitionend",
"onunload",
"onupdateready",
"onupgradeneeded",
"onuserproximity",
"onversionchange",
"onvoiceschanged",
"onvolumechange",
"onwaiting",
"onwarning",
"onwebkitanimationend",
"onwebkitanimationiteration",
"onwebkitanimationstart",
"onwebkitcurrentplaybacktargetiswirelesschanged",
"onwebkitfullscreenchange",
"onwebkitfullscreenerror",
"onwebkitkeyadded",
"onwebkitkeyerror",
"onwebkitkeymessage",
"onwebkitneedkey",
"onwebkitorientationchange",
"onwebkitplaybacktargetavailabilitychanged",
"onwebkitpointerlockchange",
"onwebkitpointerlockerror",
"onwebkitresourcetimingbufferfull",
"onwebkittransitionend",
"onwheel",
"onzoom",
"opacity",
"open",
"openCursor",
"openDatabase",
"openKeyCursor",
"opener",
"opera",
"operationType",
"operator",
"opr",
"optimum",
"options",
"order",
"orderX",
"orderY",
"ordered",
"org",
"orient",
"orientAngle",
"orientType",
"orientation",
"origin",
"originalTarget",
"orphans",
"oscpu",
"outerHTML",
"outerHeight",
"outerText",
"outerWidth",
"outline",
"outline-color",
"outline-offset",
"outline-style",
"outline-width",
"outlineColor",
"outlineOffset",
"outlineStyle",
"outlineWidth",
"outputBuffer",
"overflow",
"overflow-x",
"overflow-y",
"overflowX",
"overflowY",
"overrideMimeType",
"oversample",
"ownerDocument",
"ownerElement",
"ownerNode",
"ownerRule",
"ownerSVGElement",
"owningElement",
"p1",
"p2",
"p3",
"p4",
"pad",
"padding",
"padding-bottom",
"padding-left",
"padding-right",
"padding-top",
"paddingBottom",
"paddingLeft",
"paddingRight",
"paddingTop",
"page",
"page-break-after",
"page-break-before",
"page-break-inside",
"pageBreakAfter",
"pageBreakBefore",
"pageBreakInside",
"pageCount",
"pageX",
"pageXOffset",
"pageY",
"pageYOffset",
"pages",
"paint-order",
"paintOrder",
"paintRequests",
"paintType",
"palette",
"panningModel",
"parent",
"parentElement",
"parentNode",
"parentRule",
"parentStyleSheet",
"parentTextEdit",
"parentWindow",
"parse",
"parseFloat",
"parseFromString",
"parseInt",
"participants",
"passive",
"password",
"pasteHTML",
"path",
"pathLength",
"pathSegList",
"pathSegType",
"pathSegTypeAsLetter",
"pathname",
"pattern",
"patternContentUnits",
"patternMismatch",
"patternTransform",
"patternUnits",
"pause",
"pauseAnimations",
"pauseOnExit",
"paused",
"pending",
"performance",
"permission",
"persisted",
"personalbar",
"perspective",
"perspective-origin",
"perspectiveOrigin",
"phoneticFamilyName",
"phoneticGivenName",
"photo",
"ping",
"pitch",
"pixelBottom",
"pixelDepth",
"pixelHeight",
"pixelLeft",
"pixelRight",
"pixelStorei",
"pixelTop",
"pixelUnitToMillimeterX",
"pixelUnitToMillimeterY",
"pixelWidth",
"placeholder",
"platform",
"play",
"playbackRate",
"playbackState",
"playbackTime",
"played",
"plugins",
"pluginspage",
"pname",
"pointer-events",
"pointerBeforeReferenceNode",
"pointerEnabled",
"pointerEvents",
"pointerId",
"pointerLockElement",
"pointerType",
"points",
"pointsAtX",
"pointsAtY",
"pointsAtZ",
"polygonOffset",
"pop",
"popupWindowFeatures",
"popupWindowName",
"popupWindowURI",
"port",
"port1",
"port2",
"ports",
"posBottom",
"posHeight",
"posLeft",
"posRight",
"posTop",
"posWidth",
"position",
"positionAlign",
"postError",
"postMessage",
"poster",
"pow",
"powerOff",
"preMultiplySelf",
"precision",
"preferredStyleSheetSet",
"preferredStylesheetSet",
"prefix",
"preload",
"prepend",
"preserveAlpha",
"preserveAspectRatio",
"preserveAspectRatioString",
"pressed",
"pressure",
"prevValue",
"preventDefault",
"preventExtensions",
"previousElementSibling",
"previousNode",
"previousPage",
"previousScale",
"previousSibling",
"previousTranslate",
"primaryKey",
"primitiveType",
"primitiveUnits",
"principals",
"print",
"privateKey",
"probablySupportsContext",
"process",
"processIceMessage",
"product",
"productSub",
"profile",
"profileEnd",
"profiles",
"prompt",
"properties",
"propertyIsEnumerable",
"propertyName",
"protocol",
"protocolLong",
"prototype",
"pseudoClass",
"pseudoElement",
"publicId",
"publicKey",
"published",
"push",
"pushNotification",
"pushState",
"put",
"putImageData",
"quadraticCurveTo",
"qualifier",
"queryCommandEnabled",
"queryCommandIndeterm",
"queryCommandState",
"queryCommandSupported",
"queryCommandText",
"queryCommandValue",
"querySelector",
"querySelectorAll",
"quote",
"quotes",
"r",
"r1",
"r2",
"race",
"radiogroup",
"radiusX",
"radiusY",
"random",
"range",
"rangeCount",
"rangeMax",
"rangeMin",
"rangeOffset",
"rangeOverflow",
"rangeParent",
"rangeUnderflow",
"rate",
"ratio",
"raw",
"read",
"readAsArrayBuffer",
"readAsBinaryString",
"readAsBlob",
"readAsDataURL",
"readAsText",
"readOnly",
"readPixels",
"readReportRequested",
"readyState",
"reason",
"reboot",
"receiver",
"receivers",
"recordNumber",
"recordset",
"rect",
"red",
"redirectCount",
"redirectEnd",
"redirectStart",
"reduce",
"reduceRight",
"reduction",
"refDistance",
"refX",
"refY",
"referenceNode",
"referrer",
"refresh",
"region",
"regionAnchorX",
"regionAnchorY",
"regionId",
"regions",
"register",
"registerContentHandler",
"registerElement",
"registerProtocolHandler",
"reject",
"rel",
"relList",
"relatedNode",
"relatedTarget",
"release",
"releaseCapture",
"releaseEvents",
"releasePointerCapture",
"releaseShaderCompiler",
"reliable",
"reload",
"remainingSpace",
"remoteDescription",
"remove",
"removeAllRanges",
"removeAttribute",
"removeAttributeNS",
"removeAttributeNode",
"removeBehavior",
"removeChild",
"removeCue",
"removeEventListener",
"removeFilter",
"removeImport",
"removeItem",
"removeListener",
"removeNamedItem",
"removeNamedItemNS",
"removeNode",
"removeParameter",
"removeProperty",
"removeRange",
"removeRegion",
"removeRule",
"removeSiteSpecificTrackingException",
"removeSourceBuffer",
"removeStream",
"removeTrack",
"removeVariable",
"removeWakeLockListener",
"removeWebWideTrackingException",
"removedNodes",
"renderbufferStorage",
"renderedBuffer",
"renderingMode",
"repeat",
"replace",
"replaceAdjacentText",
"replaceChild",
"replaceData",
"replaceId",
"replaceItem",
"replaceNode",
"replaceState",
"replaceTrack",
"replaceWholeText",
"reportValidity",
"requestAnimationFrame",
"requestAutocomplete",
"requestData",
"requestFullscreen",
"requestMediaKeySystemAccess",
"requestPermission",
"requestPointerLock",
"requestStart",
"requestingWindow",
"required",
"requiredExtensions",
"requiredFeatures",
"reset",
"resetTransform",
"resize",
"resizeBy",
"resizeTo",
"resolve",
"response",
"responseBody",
"responseEnd",
"responseStart",
"responseText",
"responseType",
"responseURL",
"responseXML",
"restore",
"result",
"resultType",
"resume",
"returnValue",
"rev",
"reverse",
"reversed",
"revocable",
"revokeObjectURL",
"rgbColor",
"right",
"rightContext",
"rightMargin",
"rolloffFactor",
"root",
"rootElement",
"rotate",
"rotateAxisAngle",
"rotateAxisAngleSelf",
"rotateFromVector",
"rotateFromVectorSelf",
"rotateSelf",
"rotation",
"rotationRate",
"round",
"rowIndex",
"rowSpan",
"rows",
"rubyAlign",
"rubyOverhang",
"rubyPosition",
"rules",
"runtime",
"runtimeStyle",
"rx",
"ry",
"safari",
"sampleCoverage",
"sampleRate",
"sandbox",
"save",
"scale",
"scale3d",
"scale3dSelf",
"scaleNonUniform",
"scaleNonUniformSelf",
"scaleSelf",
"scheme",
"scissor",
"scope",
"scopeName",
"scoped",
"screen",
"screenBrightness",
"screenEnabled",
"screenLeft",
"screenPixelToMillimeterX",
"screenPixelToMillimeterY",
"screenTop",
"screenX",
"screenY",
"scripts",
"scroll",
"scroll-behavior",
"scrollAmount",
"scrollBehavior",
"scrollBy",
"scrollByLines",
"scrollByPages",
"scrollDelay",
"scrollHeight",
"scrollIntoView",
"scrollIntoViewIfNeeded",
"scrollLeft",
"scrollLeftMax",
"scrollMaxX",
"scrollMaxY",
"scrollTo",
"scrollTop",
"scrollTopMax",
"scrollWidth",
"scrollX",
"scrollY",
"scrollbar3dLightColor",
"scrollbarArrowColor",
"scrollbarBaseColor",
"scrollbarDarkShadowColor",
"scrollbarFaceColor",
"scrollbarHighlightColor",
"scrollbarShadowColor",
"scrollbarTrackColor",
"scrollbars",
"scrolling",
"sdp",
"sdpMLineIndex",
"sdpMid",
"seal",
"search",
"searchBox",
"searchBoxJavaBridge_",
"searchParams",
"sectionRowIndex",
"secureConnectionStart",
"security",
"seed",
"seekable",
"seeking",
"select",
"selectAllChildren",
"selectNode",
"selectNodeContents",
"selectNodes",
"selectSingleNode",
"selectSubString",
"selected",
"selectedIndex",
"selectedOptions",
"selectedStyleSheetSet",
"selectedStylesheetSet",
"selection",
"selectionDirection",
"selectionEnd",
"selectionStart",
"selector",
"selectorText",
"self",
"send",
"sendAsBinary",
"sendBeacon",
"sender",
"sentTimestamp",
"separator",
"serializeToString",
"serviceWorker",
"sessionId",
"sessionStorage",
"set",
"setActive",
"setAlpha",
"setAttribute",
"setAttributeNS",
"setAttributeNode",
"setAttributeNodeNS",
"setBaseAndExtent",
"setBingCurrentSearchDefault",
"setCapture",
"setColor",
"setCompositeOperation",
"setCurrentTime",
"setCustomValidity",
"setData",
"setDate",
"setDragImage",
"setEnd",
"setEndAfter",
"setEndBefore",
"setEndPoint",
"setFillColor",
"setFilterRes",
"setFloat32",
"setFloat64",
"setFloatValue",
"setFullYear",
"setHours",
"setImmediate",
"setInt16",
"setInt32",
"setInt8",
"setInterval",
"setItem",
"setLineCap",
"setLineDash",
"setLineJoin",
"setLineWidth",
"setLocalDescription",
"setMatrix",
"setMatrixValue",
"setMediaKeys",
"setMilliseconds",
"setMinutes",
"setMiterLimit",
"setMonth",
"setNamedItem",
"setNamedItemNS",
"setNonUserCodeExceptions",
"setOrientToAngle",
"setOrientToAuto",
"setOrientation",
"setOverrideHistoryNavigationMode",
"setPaint",
"setParameter",
"setPeriodicWave",
"setPointerCapture",
"setPosition",
"setPreference",
"setProperty",
"setPrototypeOf",
"setRGBColor",
"setRGBColorICCColor",
"setRadius",
"setRangeText",
"setRemoteDescription",
"setRequestHeader",
"setResizable",
"setResourceTimingBufferSize",
"setRotate",
"setScale",
"setSeconds",
"setSelectionRange",
"setServerCertificate",
"setShadow",
"setSkewX",
"setSkewY",
"setStart",
"setStartAfter",
"setStartBefore",
"setStdDeviation",
"setStringValue",
"setStrokeColor",
"setSuggestResult",
"setTargetAtTime",
"setTargetValueAtTime",
"setTime",
"setTimeout",
"setTransform",
"setTranslate",
"setUTCDate",
"setUTCFullYear",
"setUTCHours",
"setUTCMilliseconds",
"setUTCMinutes",
"setUTCMonth",
"setUTCSeconds",
"setUint16",
"setUint32",
"setUint8",
"setUri",
"setValueAtTime",
"setValueCurveAtTime",
"setVariable",
"setVelocity",
"setVersion",
"setYear",
"settingName",
"settingValue",
"sex",
"shaderSource",
"shadowBlur",
"shadowColor",
"shadowOffsetX",
"shadowOffsetY",
"shadowRoot",
"shape",
"shape-rendering",
"shapeRendering",
"sheet",
"shift",
"shiftKey",
"shiftLeft",
"show",
"showHelp",
"showModal",
"showModalDialog",
"showModelessDialog",
"showNotification",
"sidebar",
"sign",
"signalingState",
"sin",
"singleNodeValue",
"sinh",
"size",
"sizeToContent",
"sizes",
"skewX",
"skewXSelf",
"skewY",
"skewYSelf",
"slice",
"slope",
"small",
"smil",
"smooth",
"smoothingTimeConstant",
"snapToLines",
"snapshotItem",
"snapshotLength",
"some",
"sort",
"source",
"sourceBuffer",
"sourceBuffers",
"sourceIndex",
"spacing",
"span",
"speakAs",
"speaking",
"specified",
"specularConstant",
"specularExponent",
"speechSynthesis",
"speed",
"speedOfSound",
"spellcheck",
"splice",
"split",
"splitText",
"spreadMethod",
"sqrt",
"src",
"srcElement",
"srcFilter",
"srcUrn",
"srcdoc",
"srclang",
"srcset",
"stack",
"stackTraceLimit",
"stacktrace",
"standalone",
"standby",
"start",
"startContainer",
"startIce",
"startOffset",
"startRendering",
"startTime",
"startsWith",
"state",
"status",
"statusMessage",
"statusText",
"statusbar",
"stdDeviationX",
"stdDeviationY",
"stencilFunc",
"stencilFuncSeparate",
"stencilMask",
"stencilMaskSeparate",
"stencilOp",
"stencilOpSeparate",
"step",
"stepDown",
"stepMismatch",
"stepUp",
"sticky",
"stitchTiles",
"stop",
"stop-color",
"stop-opacity",
"stopColor",
"stopImmediatePropagation",
"stopOpacity",
"stopPropagation",
"storageArea",
"storageName",
"storageStatus",
"storeSiteSpecificTrackingException",
"storeWebWideTrackingException",
"stpVersion",
"stream",
"strike",
"stringValue",
"stringify",
"stroke",
"stroke-dasharray",
"stroke-dashoffset",
"stroke-linecap",
"stroke-linejoin",
"stroke-miterlimit",
"stroke-opacity",
"stroke-width",
"strokeDasharray",
"strokeDashoffset",
"strokeLinecap",
"strokeLinejoin",
"strokeMiterlimit",
"strokeOpacity",
"strokeRect",
"strokeStyle",
"strokeText",
"strokeWidth",
"style",
"styleFloat",
"styleMedia",
"styleSheet",
"styleSheetSets",
"styleSheets",
"sub",
"subarray",
"subject",
"submit",
"subscribe",
"substr",
"substring",
"substringData",
"subtle",
"subtree",
"suffix",
"suffixes",
"summary",
"sup",
"supports",
"surfaceScale",
"surroundContents",
"suspend",
"suspendRedraw",
"swapCache",
"swapNode",
"sweepFlag",
"symbols",
"system",
"systemCode",
"systemId",
"systemLanguage",
"systemXDPI",
"systemYDPI",
"tBodies",
"tFoot",
"tHead",
"tabIndex",
"table",
"table-layout",
"tableLayout",
"tableValues",
"tag",
"tagName",
"tagUrn",
"tags",
"taintEnabled",
"takeRecords",
"tan",
"tanh",
"target",
"targetElement",
"targetTouches",
"targetX",
"targetY",
"tel",
"terminate",
"test",
"texImage2D",
"texParameterf",
"texParameteri",
"texSubImage2D",
"text",
"text-align",
"text-anchor",
"text-decoration",
"text-decoration-color",
"text-decoration-line",
"text-decoration-style",
"text-indent",
"text-overflow",
"text-rendering",
"text-shadow",
"text-transform",
"textAlign",
"textAlignLast",
"textAnchor",
"textAutospace",
"textBaseline",
"textContent",
"textDecoration",
"textDecorationBlink",
"textDecorationColor",
"textDecorationLine",
"textDecorationLineThrough",
"textDecorationNone",
"textDecorationOverline",
"textDecorationStyle",
"textDecorationUnderline",
"textIndent",
"textJustify",
"textJustifyTrim",
"textKashida",
"textKashidaSpace",
"textLength",
"textOverflow",
"textRendering",
"textShadow",
"textTracks",
"textTransform",
"textUnderlinePosition",
"then",
"threadId",
"threshold",
"tiltX",
"tiltY",
"time",
"timeEnd",
"timeStamp",
"timeout",
"timestamp",
"timestampOffset",
"timing",
"title",
"toArray",
"toBlob",
"toDataURL",
"toDateString",
"toElement",
"toExponential",
"toFixed",
"toFloat32Array",
"toFloat64Array",
"toGMTString",
"toISOString",
"toJSON",
"toLocaleDateString",
"toLocaleFormat",
"toLocaleLowerCase",
"toLocaleString",
"toLocaleTimeString",
"toLocaleUpperCase",
"toLowerCase",
"toMethod",
"toPrecision",
"toSdp",
"toSource",
"toStaticHTML",
"toString",
"toStringTag",
"toTimeString",
"toUTCString",
"toUpperCase",
"toggle",
"toggleLongPressEnabled",
"tooLong",
"toolbar",
"top",
"topMargin",
"total",
"totalFrameDelay",
"totalVideoFrames",
"touchAction",
"touches",
"trace",
"track",
"transaction",
"transactions",
"transform",
"transform-origin",
"transform-style",
"transformOrigin",
"transformPoint",
"transformString",
"transformStyle",
"transformToDocument",
"transformToFragment",
"transition",
"transition-delay",
"transition-duration",
"transition-property",
"transition-timing-function",
"transitionDelay",
"transitionDuration",
"transitionProperty",
"transitionTimingFunction",
"translate",
"translateSelf",
"translationX",
"translationY",
"trim",
"trimLeft",
"trimRight",
"trueSpeed",
"trunc",
"truncate",
"type",
"typeDetail",
"typeMismatch",
"typeMustMatch",
"types",
"ubound",
"undefined",
"unescape",
"uneval",
"unicode-bidi",
"unicodeBidi",
"uniform1f",
"uniform1fv",
"uniform1i",
"uniform1iv",
"uniform2f",
"uniform2fv",
"uniform2i",
"uniform2iv",
"uniform3f",
"uniform3fv",
"uniform3i",
"uniform3iv",
"uniform4f",
"uniform4fv",
"uniform4i",
"uniform4iv",
"uniformMatrix2fv",
"uniformMatrix3fv",
"uniformMatrix4fv",
"unique",
"uniqueID",
"uniqueNumber",
"unitType",
"units",
"unloadEventEnd",
"unloadEventStart",
"unlock",
"unmount",
"unobserve",
"unpause",
"unpauseAnimations",
"unreadCount",
"unregister",
"unregisterContentHandler",
"unregisterProtocolHandler",
"unscopables",
"unselectable",
"unshift",
"unsubscribe",
"unsuspendRedraw",
"unsuspendRedrawAll",
"unwatch",
"unwrapKey",
"update",
"updateCommands",
"updateIce",
"updateInterval",
"updateSettings",
"updated",
"updating",
"upload",
"upper",
"upperBound",
"upperOpen",
"uri",
"url",
"urn",
"urns",
"usages",
"useCurrentView",
"useMap",
"useProgram",
"usedSpace",
"userAgent",
"userLanguage",
"username",
"v8BreakIterator",
"vAlign",
"vLink",
"valid",
"validateProgram",
"validationMessage",
"validity",
"value",
"valueAsDate",
"valueAsNumber",
"valueAsString",
"valueInSpecifiedUnits",
"valueMissing",
"valueOf",
"valueText",
"valueType",
"values",
"vector-effect",
"vectorEffect",
"velocityAngular",
"velocityExpansion",
"velocityX",
"velocityY",
"vendor",
"vendorSub",
"verify",
"version",
"vertexAttrib1f",
"vertexAttrib1fv",
"vertexAttrib2f",
"vertexAttrib2fv",
"vertexAttrib3f",
"vertexAttrib3fv",
"vertexAttrib4f",
"vertexAttrib4fv",
"vertexAttribDivisorANGLE",
"vertexAttribPointer",
"vertical",
"vertical-align",
"verticalAlign",
"verticalOverflow",
"vibrate",
"videoHeight",
"videoTracks",
"videoWidth",
"view",
"viewBox",
"viewBoxString",
"viewTarget",
"viewTargetString",
"viewport",
"viewportAnchorX",
"viewportAnchorY",
"viewportElement",
"visibility",
"visibilityState",
"visible",
"vlinkColor",
"voice",
"volume",
"vrml",
"vspace",
"w",
"wand",
"warn",
"wasClean",
"watch",
"watchPosition",
"webdriver",
"webkitAddKey",
"webkitAnimation",
"webkitAnimationDelay",
"webkitAnimationDirection",
"webkitAnimationDuration",
"webkitAnimationFillMode",
"webkitAnimationIterationCount",
"webkitAnimationName",
"webkitAnimationPlayState",
"webkitAnimationTimingFunction",
"webkitAppearance",
"webkitAudioContext",
"webkitAudioDecodedByteCount",
"webkitAudioPannerNode",
"webkitBackfaceVisibility",
"webkitBackground",
"webkitBackgroundAttachment",
"webkitBackgroundClip",
"webkitBackgroundColor",
"webkitBackgroundImage",
"webkitBackgroundOrigin",
"webkitBackgroundPosition",
"webkitBackgroundPositionX",
"webkitBackgroundPositionY",
"webkitBackgroundRepeat",
"webkitBackgroundSize",
"webkitBackingStorePixelRatio",
"webkitBorderImage",
"webkitBorderImageOutset",
"webkitBorderImageRepeat",
"webkitBorderImageSlice",
"webkitBorderImageSource",
"webkitBorderImageWidth",
"webkitBoxAlign",
"webkitBoxDirection",
"webkitBoxFlex",
"webkitBoxOrdinalGroup",
"webkitBoxOrient",
"webkitBoxPack",
"webkitBoxSizing",
"webkitCancelAnimationFrame",
"webkitCancelFullScreen",
"webkitCancelKeyRequest",
"webkitCancelRequestAnimationFrame",
"webkitClearResourceTimings",
"webkitClosedCaptionsVisible",
"webkitConvertPointFromNodeToPage",
"webkitConvertPointFromPageToNode",
"webkitCreateShadowRoot",
"webkitCurrentFullScreenElement",
"webkitCurrentPlaybackTargetIsWireless",
"webkitDirectionInvertedFromDevice",
"webkitDisplayingFullscreen",
"webkitEnterFullScreen",
"webkitEnterFullscreen",
"webkitExitFullScreen",
"webkitExitFullscreen",
"webkitExitPointerLock",
"webkitFullScreenKeyboardInputAllowed",
"webkitFullscreenElement",
"webkitFullscreenEnabled",
"webkitGenerateKeyRequest",
"webkitGetAsEntry",
"webkitGetDatabaseNames",
"webkitGetEntries",
"webkitGetEntriesByName",
"webkitGetEntriesByType",
"webkitGetFlowByName",
"webkitGetGamepads",
"webkitGetImageDataHD",
"webkitGetNamedFlows",
"webkitGetRegionFlowRanges",
"webkitGetUserMedia",
"webkitHasClosedCaptions",
"webkitHidden",
"webkitIDBCursor",
"webkitIDBDatabase",
"webkitIDBDatabaseError",
"webkitIDBDatabaseException",
"webkitIDBFactory",
"webkitIDBIndex",
"webkitIDBKeyRange",
"webkitIDBObjectStore",
"webkitIDBRequest",
"webkitIDBTransaction",
"webkitImageSmoothingEnabled",
"webkitIndexedDB",
"webkitInitMessageEvent",
"webkitIsFullScreen",
"webkitKeys",
"webkitLineDashOffset",
"webkitLockOrientation",
"webkitMatchesSelector",
"webkitMediaStream",
"webkitNotifications",
"webkitOfflineAudioContext",
"webkitOrientation",
"webkitPeerConnection00",
"webkitPersistentStorage",
"webkitPointerLockElement",
"webkitPostMessage",
"webkitPreservesPitch",
"webkitPutImageDataHD",
"webkitRTCPeerConnection",
"webkitRegionOverset",
"webkitRequestAnimationFrame",
"webkitRequestFileSystem",
"webkitRequestFullScreen",
"webkitRequestFullscreen",
"webkitRequestPointerLock",
"webkitResolveLocalFileSystemURL",
"webkitSetMediaKeys",
"webkitSetResourceTimingBufferSize",
"webkitShadowRoot",
"webkitShowPlaybackTargetPicker",
"webkitSlice",
"webkitSpeechGrammar",
"webkitSpeechGrammarList",
"webkitSpeechRecognition",
"webkitSpeechRecognitionError",
"webkitSpeechRecognitionEvent",
"webkitStorageInfo",
"webkitSupportsFullscreen",
"webkitTemporaryStorage",
"webkitTextSizeAdjust",
"webkitTransform",
"webkitTransformOrigin",
"webkitTransition",
"webkitTransitionDelay",
"webkitTransitionDuration",
"webkitTransitionProperty",
"webkitTransitionTimingFunction",
"webkitURL",
"webkitUnlockOrientation",
"webkitUserSelect",
"webkitVideoDecodedByteCount",
"webkitVisibilityState",
"webkitWirelessVideoPlaybackDisabled",
"webkitdropzone",
"webstore",
"weight",
"whatToShow",
"wheelDelta",
"wheelDeltaX",
"wheelDeltaY",
"which",
"white-space",
"whiteSpace",
"wholeText",
"widows",
"width",
"will-change",
"willChange",
"willValidate",
"window",
"withCredentials",
"word-break",
"word-spacing",
"word-wrap",
"wordBreak",
"wordSpacing",
"wordWrap",
"wrap",
"wrapKey",
"write",
"writeln",
"writingMode",
"x",
"x1",
"x2",
"xChannelSelector",
"xmlEncoding",
"xmlStandalone",
"xmlVersion",
"xmlbase",
"xmllang",
"xmlspace",
"y",
"y1",
"y2",
"yChannelSelector",
"yandex",
"z",
"z-index",
"zIndex",
"zoom",
"zoomAndPan",
"zoomRectScreen"
];
node_modules/terser/tools/node.js 0000666 00000000676 15042511722 0013164 0 ustar 00 import { minify } from "../lib/minify";
export function default_options() {
const defs = {};
Object.keys(infer_options({ 0: 0 })).forEach((component) => {
const options = infer_options({
[component]: {0: 0}
});
if (options) defs[component] = options;
});
return defs;
}
function infer_options(options) {
var result = minify("", options);
return result.error && result.error.defs;
}
node_modules/terser/tools/props.html 0000666 00000002700 15042511722 0013720 0 ustar 00
node_modules/terser/tools/terser.d.ts 0000666 00000045500 15042511722 0013772 0 ustar 00 ///
import { RawSourceMap } from 'source-map';
/** @deprecated since this versions basically do not exist */
type ECMA_UNOFFICIAL = 6 | 7 | 8 | 9 | 10 | 11;
export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | ECMA_UNOFFICIAL;
export interface ParseOptions {
bare_returns?: boolean;
ecma?: ECMA;
html5_comments?: boolean;
shebang?: boolean;
}
export interface CompressOptions {
arguments?: boolean;
arrows?: boolean;
booleans_as_integers?: boolean;
booleans?: boolean;
collapse_vars?: boolean;
comparisons?: boolean;
computed_props?: boolean;
conditionals?: boolean;
dead_code?: boolean;
defaults?: boolean;
directives?: boolean;
drop_console?: boolean;
drop_debugger?: boolean;
ecma?: ECMA;
evaluate?: boolean;
expression?: boolean;
global_defs?: object;
hoist_funs?: boolean;
hoist_props?: boolean;
hoist_vars?: boolean;
ie8?: boolean;
if_return?: boolean;
inline?: boolean | InlineFunctions;
join_vars?: boolean;
keep_classnames?: boolean | RegExp;
keep_fargs?: boolean;
keep_fnames?: boolean | RegExp;
keep_infinity?: boolean;
loops?: boolean;
module?: boolean;
negate_iife?: boolean;
passes?: number;
properties?: boolean;
pure_funcs?: string[];
pure_getters?: boolean | 'strict';
reduce_funcs?: boolean;
reduce_vars?: boolean;
sequences?: boolean | number;
side_effects?: boolean;
switches?: boolean;
toplevel?: boolean;
top_retain?: null | string | string[] | RegExp;
typeofs?: boolean;
unsafe_arrows?: boolean;
unsafe?: boolean;
unsafe_comps?: boolean;
unsafe_Function?: boolean;
unsafe_math?: boolean;
unsafe_symbols?: boolean;
unsafe_methods?: boolean;
unsafe_proto?: boolean;
unsafe_regexp?: boolean;
unsafe_undefined?: boolean;
unused?: boolean;
warnings?: boolean;
}
export enum InlineFunctions {
Disabled = 0,
SimpleFunctions = 1,
WithArguments = 2,
WithArgumentsAndVariables = 3
}
export interface MangleOptions {
eval?: boolean;
keep_classnames?: boolean | RegExp;
keep_fnames?: boolean | RegExp;
module?: boolean;
properties?: boolean | ManglePropertiesOptions;
reserved?: string[];
safari10?: boolean;
toplevel?: boolean;
}
export interface ManglePropertiesOptions {
builtins?: boolean;
debug?: boolean;
keep_quoted?: boolean | 'strict';
regex?: RegExp | string;
reserved?: string[];
}
export interface OutputOptions {
ascii_only?: boolean;
beautify?: boolean;
braces?: boolean;
comments?: boolean | 'all' | 'some' | RegExp | ( (node: AST_Node, comment: {
value: string,
type: 'comment1' | 'comment2' | 'comment3' | 'comment4',
pos: number,
line: number,
col: number,
}) => boolean );
ecma?: ECMA;
ie8?: boolean;
indent_level?: number;
indent_start?: number;
inline_script?: boolean;
keep_quoted_props?: boolean;
max_line_len?: number | false;
preamble?: string;
preserve_annotations?: boolean;
quote_keys?: boolean;
quote_style?: OutputQuoteStyle;
safari10?: boolean;
semicolons?: boolean;
shebang?: boolean;
shorthand?: boolean;
source_map?: SourceMapOptions;
webkit?: boolean;
width?: number;
wrap_iife?: boolean;
wrap_func_args?: boolean;
}
export enum OutputQuoteStyle {
PreferDouble = 0,
AlwaysSingle = 1,
AlwaysDouble = 2,
AlwaysOriginal = 3
}
export interface MinifyOptions {
compress?: boolean | CompressOptions;
ecma?: ECMA;
ie8?: boolean;
keep_classnames?: boolean | RegExp;
keep_fnames?: boolean | RegExp;
mangle?: boolean | MangleOptions;
module?: boolean;
nameCache?: object;
output?: OutputOptions;
parse?: ParseOptions;
safari10?: boolean;
sourceMap?: boolean | SourceMapOptions;
toplevel?: boolean;
warnings?: boolean | 'verbose';
}
export interface MinifyOutput {
ast?: AST_Node;
code?: string;
error?: Error;
map?: RawSourceMap | string;
warnings?: string[];
}
export interface SourceMapOptions {
/** Source map object, 'inline' or source map file content */
content?: RawSourceMap | string;
includeSources?: boolean;
filename?: string;
root?: string;
url?: string | 'inline';
}
declare function parse(text: string, options?: ParseOptions): AST_Node;
export class TreeWalker {
constructor(callback: (node: AST_Node, descend?: (node: AST_Node) => void) => boolean | undefined);
directives: object;
find_parent(type: AST_Node): AST_Node | undefined;
has_directive(type: string): boolean;
loopcontrol_target(node: AST_Node): AST_Node | undefined;
parent(n: number): AST_Node | undefined;
pop(): void;
push(node: AST_Node): void;
self(): AST_Node | undefined;
stack: AST_Node[];
visit: (node: AST_Node, descend: boolean) => any;
}
export class TreeTransformer extends TreeWalker {
constructor(
before: (node: AST_Node, descend?: (node: AST_Node, tw: TreeWalker) => void, in_list?: boolean) => AST_Node | undefined,
after?: (node: AST_Node, in_list?: boolean) => AST_Node | undefined
);
before: (node: AST_Node) => AST_Node;
after?: (node: AST_Node) => AST_Node;
}
export function push_uniq(array: T[], el: T): void;
export function minify(files: string | string[] | { [file: string]: string } | AST_Node, options?: MinifyOptions): MinifyOutput;
export class AST_Node {
constructor(props?: object);
static BASE?: AST_Node;
static PROPS: string[];
static SELF_PROPS: string[];
static SUBCLASSES: AST_Node[];
static documentation: string;
static propdoc?: Record;
static expressions?: AST_Node[];
static warn?: (text: string, props: any) => void;
static from_mozilla_ast?: (node: AST_Node) => any;
walk: (visitor: TreeWalker) => void;
print_to_string: (options?: OutputOptions) => string;
transform: (tt: TreeTransformer, in_list?: boolean) => AST_Node;
TYPE: string;
CTOR: typeof AST_Node;
}
declare class SymbolDef {
constructor(scope?: AST_Scope, orig?: object, init?: object);
name: string;
orig: AST_SymbolRef[];
init: AST_SymbolRef;
eliminated: number;
scope: AST_Scope;
references: AST_SymbolRef[];
replaced: number;
global: boolean;
export: boolean;
mangled_name: null | string;
undeclared: boolean;
id: number;
}
type ArgType = AST_SymbolFunarg | AST_DefaultAssign | AST_Destructuring | AST_Expansion;
declare class AST_Statement extends AST_Node {
constructor(props?: object);
}
declare class AST_Debugger extends AST_Statement {
constructor(props?: object);
}
declare class AST_Directive extends AST_Statement {
constructor(props?: object);
value: string;
quote: string;
}
declare class AST_SimpleStatement extends AST_Statement {
constructor(props?: object);
body: AST_Node[];
}
declare class AST_Block extends AST_Statement {
constructor(props?: object);
body: AST_Node[];
block_scope: AST_Scope | null;
}
declare class AST_BlockStatement extends AST_Block {
constructor(props?: object);
}
declare class AST_Scope extends AST_Block {
constructor(props?: object);
variables: any;
functions: any;
uses_with: boolean;
uses_eval: boolean;
parent_scope: AST_Scope | null;
enclosed: any;
cname: any;
}
declare class AST_Toplevel extends AST_Scope {
constructor(props?: object);
globals: any;
}
declare class AST_Lambda extends AST_Scope {
constructor(props?: object);
name: AST_SymbolDeclaration | null;
argnames: ArgType[];
uses_arguments: boolean;
is_generator: boolean;
async: boolean;
}
declare class AST_Accessor extends AST_Lambda {
constructor(props?: object);
}
declare class AST_Function extends AST_Lambda {
constructor(props?: object);
}
declare class AST_Arrow extends AST_Lambda {
constructor(props?: object);
}
declare class AST_Defun extends AST_Lambda {
constructor(props?: object);
}
declare class AST_Class extends AST_Scope {
constructor(props?: object);
name: AST_SymbolClass | AST_SymbolDefClass | null;
extends: AST_Node | null;
properties: AST_ObjectProperty[];
}
declare class AST_DefClass extends AST_Class {
constructor(props?: object);
}
declare class AST_ClassExpression extends AST_Class {
constructor(props?: object);
}
declare class AST_Switch extends AST_Block {
constructor(props?: object);
expression: AST_Node;
}
declare class AST_SwitchBranch extends AST_Block {
constructor(props?: object);
}
declare class AST_Default extends AST_SwitchBranch {
constructor(props?: object);
}
declare class AST_Case extends AST_SwitchBranch {
constructor(props?: object);
expression: AST_Node;
}
declare class AST_Try extends AST_Block {
constructor(props?: object);
bcatch: AST_Catch;
bfinally: null | AST_Finally;
}
declare class AST_Catch extends AST_Block {
constructor(props?: object);
argname: ArgType;
}
declare class AST_Finally extends AST_Block {
constructor(props?: object);
}
declare class AST_EmptyStatement extends AST_Statement {
constructor(props?: object);
}
declare class AST_StatementWithBody extends AST_Statement {
constructor(props?: object);
body: AST_Node[];
}
declare class AST_LabeledStatement extends AST_StatementWithBody {
constructor(props?: object);
label: AST_Label;
}
declare class AST_IterationStatement extends AST_StatementWithBody {
constructor(props?: object);
block_scope: AST_Scope | null;
}
declare class AST_DWLoop extends AST_IterationStatement {
constructor(props?: object);
condition: AST_Node;
}
declare class AST_Do extends AST_DWLoop {
constructor(props?: object);
}
declare class AST_While extends AST_DWLoop {
constructor(props?: object);
}
declare class AST_For extends AST_IterationStatement {
constructor(props?: object);
init: AST_Node | null;
condition: AST_Node | null;
step: AST_Node | null;
}
declare class AST_ForIn extends AST_IterationStatement {
constructor(props?: object);
init: AST_Node | null;
object: AST_Node;
}
declare class AST_ForOf extends AST_ForIn {
constructor(props?: object);
await: boolean;
}
declare class AST_With extends AST_StatementWithBody {
constructor(props?: object);
expression: AST_Node;
}
declare class AST_If extends AST_StatementWithBody {
constructor(props?: object);
condition: AST_Node;
alternative: AST_Node | null;
}
declare class AST_Jump extends AST_Statement {
constructor(props?: object);
}
declare class AST_Exit extends AST_Jump {
constructor(props?: object);
value: AST_Node | null;
}
declare class AST_Return extends AST_Exit {
constructor(props?: object);
}
declare class AST_Throw extends AST_Exit {
constructor(props?: object);
}
declare class AST_LoopControl extends AST_Jump {
constructor(props?: object);
label: null | AST_LabelRef;
}
declare class AST_Break extends AST_LoopControl {
constructor(props?: object);
}
declare class AST_Continue extends AST_LoopControl {
constructor(props?: object);
}
declare class AST_Definitions extends AST_Statement {
constructor(props?: object);
definitions: AST_VarDef[];
}
declare class AST_Var extends AST_Definitions {
constructor(props?: object);
}
declare class AST_Let extends AST_Definitions {
constructor(props?: object);
}
declare class AST_Const extends AST_Definitions {
constructor(props?: object);
}
declare class AST_Export extends AST_Statement {
constructor(props?: object);
exported_definition: AST_Definitions | AST_Lambda | AST_DefClass | null;
exported_value: AST_Node | null;
is_default: boolean;
exported_names: AST_NameMapping[];
module_name: AST_String;
}
declare class AST_Expansion extends AST_Node {
constructor(props?: object);
expression: AST_Node;
}
declare class AST_Destructuring extends AST_Node {
constructor(props?: object);
names: AST_Node[];
is_array: boolean;
}
declare class AST_PrefixedTemplateString extends AST_Node {
constructor(props?: object);
template_string: AST_TemplateString;
prefix: AST_Node;
}
declare class AST_TemplateString extends AST_Node {
constructor(props?: object);
segments: AST_Node[];
}
declare class AST_TemplateSegment extends AST_Node {
constructor(props?: object);
value: string;
raw: string;
}
declare class AST_NameMapping extends AST_Node {
constructor(props?: object);
foreign_name: AST_Symbol;
name: AST_SymbolExport | AST_SymbolImport;
}
declare class AST_Import extends AST_Node {
constructor(props?: object);
imported_name: null | AST_SymbolImport;
imported_names: AST_NameMapping[];
module_name: AST_String;
}
declare class AST_VarDef extends AST_Node {
constructor(props?: object);
name: AST_Destructuring | AST_SymbolConst | AST_SymbolLet | AST_SymbolVar;
value: AST_Node | null;
}
declare class AST_Call extends AST_Node {
constructor(props?: object);
expression: AST_Node;
args: AST_Node[];
}
declare class AST_New extends AST_Call {
constructor(props?: object);
}
declare class AST_Sequence extends AST_Node {
constructor(props?: object);
expressions: AST_Node[];
}
declare class AST_PropAccess extends AST_Node {
constructor(props?: object);
expression: AST_Node;
property: AST_Node | string;
}
declare class AST_Dot extends AST_PropAccess {
constructor(props?: object);
}
declare class AST_Sub extends AST_PropAccess {
constructor(props?: object);
}
declare class AST_Unary extends AST_Node {
constructor(props?: object);
operator: string;
expression: AST_Node;
}
declare class AST_UnaryPrefix extends AST_Unary {
constructor(props?: object);
}
declare class AST_UnaryPostfix extends AST_Unary {
constructor(props?: object);
}
declare class AST_Binary extends AST_Node {
constructor(props?: object);
operator: string;
left: AST_Node;
right: AST_Node;
}
declare class AST_Assign extends AST_Binary {
constructor(props?: object);
}
declare class AST_DefaultAssign extends AST_Binary {
constructor(props?: object);
}
declare class AST_Conditional extends AST_Node {
constructor(props?: object);
condition: AST_Node;
consequent: AST_Node;
alternative: AST_Node;
}
declare class AST_Array extends AST_Node {
constructor(props?: object);
elements: AST_Node[];
}
declare class AST_Object extends AST_Node {
constructor(props?: object);
properties: AST_ObjectProperty[];
}
declare class AST_ObjectProperty extends AST_Node {
constructor(props?: object);
key: string | number | AST_Node;
value: AST_Node;
}
declare class AST_ObjectKeyVal extends AST_ObjectProperty {
constructor(props?: object);
quote: string;
}
declare class AST_ObjectSetter extends AST_ObjectProperty {
constructor(props?: object);
quote: string;
static: boolean;
}
declare class AST_ObjectGetter extends AST_ObjectProperty {
constructor(props?: object);
quote: string;
static: boolean;
}
declare class AST_ConciseMethod extends AST_ObjectProperty {
constructor(props?: object);
quote: string;
static: boolean;
is_generator: boolean;
async: boolean;
}
declare class AST_Symbol extends AST_Node {
constructor(props?: object);
scope: AST_Scope;
name: string;
thedef: SymbolDef;
}
declare class AST_SymbolDeclaration extends AST_Symbol {
constructor(props?: object);
init: AST_Node | null;
}
declare class AST_SymbolVar extends AST_SymbolDeclaration {
constructor(props?: object);
}
declare class AST_SymbolFunarg extends AST_SymbolVar {
constructor(props?: object);
}
declare class AST_SymbolBlockDeclaration extends AST_SymbolDeclaration {
constructor(props?: object);
}
declare class AST_SymbolConst extends AST_SymbolBlockDeclaration {
constructor(props?: object);
}
declare class AST_SymbolLet extends AST_SymbolBlockDeclaration {
constructor(props?: object);
}
declare class AST_SymbolDefClass extends AST_SymbolBlockDeclaration {
constructor(props?: object);
}
declare class AST_SymbolCatch extends AST_SymbolBlockDeclaration {
constructor(props?: object);
}
declare class AST_SymbolImport extends AST_SymbolBlockDeclaration {
constructor(props?: object);
}
declare class AST_SymbolDefun extends AST_SymbolDeclaration {
constructor(props?: object);
}
declare class AST_SymbolLambda extends AST_SymbolDeclaration {
constructor(props?: object);
}
declare class AST_SymbolClass extends AST_SymbolDeclaration {
constructor(props?: object);
}
declare class AST_SymbolMethod extends AST_Symbol {
constructor(props?: object);
}
declare class AST_SymbolImportForeign extends AST_Symbol {
constructor(props?: object);
}
declare class AST_Label extends AST_Symbol {
constructor(props?: object);
references: AST_LoopControl | null;
}
declare class AST_SymbolRef extends AST_Symbol {
constructor(props?: object);
}
declare class AST_SymbolExport extends AST_SymbolRef {
constructor(props?: object);
}
declare class AST_SymbolExportForeign extends AST_Symbol {
constructor(props?: object);
}
declare class AST_LabelRef extends AST_Symbol {
constructor(props?: object);
}
declare class AST_This extends AST_Symbol {
constructor(props?: object);
}
declare class AST_Super extends AST_This {
constructor(props?: object);
}
declare class AST_NewTarget extends AST_Node {
constructor(props?: object);
}
declare class AST_Constant extends AST_Node {
constructor(props?: object);
}
declare class AST_String extends AST_Constant {
constructor(props?: object);
value: string;
quote: string;
}
declare class AST_Number extends AST_Constant {
constructor(props?: object);
value: number;
literal: string;
}
declare class AST_RegExp extends AST_Constant {
constructor(props?: object);
value: {
source: string,
flags: string
};
}
declare class AST_Atom extends AST_Constant {
constructor(props?: object);
}
declare class AST_Null extends AST_Atom {
constructor(props?: object);
}
declare class AST_NaN extends AST_Atom {
constructor(props?: object);
}
declare class AST_Undefined extends AST_Atom {
constructor(props?: object);
}
declare class AST_Hole extends AST_Atom {
constructor(props?: object);
}
declare class AST_Infinity extends AST_Atom {
constructor(props?: object);
}
declare class AST_Boolean extends AST_Atom {
constructor(props?: object);
}
declare class AST_False extends AST_Boolean {
constructor(props?: object);
}
declare class AST_True extends AST_Boolean {
constructor(props?: object);
}
declare class AST_Await extends AST_Node {
constructor(props?: object);
expression: AST_Node;
}
declare class AST_Yield extends AST_Node {
constructor(props?: object);
expression: AST_Node;
is_star: boolean;
}
node_modules/terser/tools/colorless-console.js 0000666 00000000406 15042511722 0015673 0 ustar 00 "use strict"
if (Number((/([0-9]+)\./.exec(process.version) || [])[1]) >= 10) {
var Console = require("console").Console;
global.console = new Console({
stdout: process.stdout,
stderr: process.stderr,
colorMode: false
});
}
node_modules/terser/LICENSE 0000666 00000002504 15042511722 0011536 0 ustar 00 UglifyJS is released under the BSD license:
Copyright 2012-2018 (c) Mihai Bazon
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
node_modules/terser/PATRONS.md 0000666 00000000562 15042511722 0012203 0 ustar 00 # Our patrons
These are the first-tier patrons from [Patreon](https://www.patreon.com/fabiosantoscode). My appreciation goes to everyone on this list for supporting the project!
* 38elements
* Alan Orozco
* Aria Buckles
* CKEditor
* Mariusz Nowak
* Nakshatra Mukhopadhyay
* Philippe Léger
* Piotrek Koszuliński
* Serhiy Shyyko
* Viktor Hubert
* 龙腾道
node_modules/terser/package.json 0000666 00000005273 15042511722 0013025 0 ustar 00 {
"name": "terser",
"description": "JavaScript parser, mangler/compressor and beautifier toolkit for ES6+",
"homepage": "https://terser.org",
"author": "Mihai Bazon (http://lisperator.net/)",
"license": "BSD-2-Clause",
"version": "4.8.1",
"engines": {
"node": ">=6.0.0"
},
"maintainers": [
"Fábio Santos "
],
"repository": "https://github.com/terser/terser",
"main": "dist/bundle.min.js",
"types": "tools/terser.d.ts",
"bin": {
"terser": "bin/terser"
},
"files": [
"bin",
"dist",
"tools",
"LICENSE",
"README.md",
"CHANGELOG.md",
"PATRONS.md"
],
"dependencies": {
"commander": "^2.20.0",
"source-map": "~0.6.1",
"source-map-support": "~0.5.12"
},
"devDependencies": {
"acorn": "^7.1.1",
"astring": "^1.4.1",
"eslint": "^6.3.0",
"eslump": "^2.0.0",
"mocha": "^7.1.2",
"mochallel": "^2.0.0",
"pre-commit": "^1.2.2",
"rimraf": "^3.0.0",
"rollup": "2.0.6",
"rollup-plugin-terser": "5.3.0",
"semver": "^7.1.3"
},
"scripts": {
"test": "npm run build -- --configTest && node test/run-tests.js",
"test:compress": "npm run build -- --configTest && node test/compress.js",
"test:mocha": "npm run build -- --configTest && node test/mocha.js",
"lint": "eslint lib",
"lint-fix": "eslint --fix lib",
"build": "rimraf dist/* && rollup --config --silent",
"prepare": "npm run build",
"postversion": "echo 'Remember to update the changelog!'"
},
"keywords": [
"uglify",
"terser",
"uglify-es",
"uglify-js",
"minify",
"minifier",
"javascript",
"ecmascript",
"es5",
"es6",
"es7",
"es8",
"es2015",
"es2016",
"es2017",
"async",
"await"
],
"eslintConfig": {
"parserOptions": {
"sourceType": "module"
},
"env": {
"es6": true
},
"globals": {
"describe": false,
"it": false,
"require": false,
"global": false,
"process": false
},
"rules": {
"brace-style": [
"error",
"1tbs",
{
"allowSingleLine": true
}
],
"quotes": [
"error",
"double",
"avoid-escape"
],
"no-debugger": "error",
"no-undef": "error",
"no-unused-vars": [
"error",
{
"varsIgnorePattern": "^_$"
}
],
"no-tabs": "error",
"semi": [
"error",
"always"
],
"no-extra-semi": "error",
"no-irregular-whitespace": "error",
"space-before-blocks": [
"error",
"always"
]
}
},
"pre-commit": [
"lint-fix",
"test"
]
}
node_modules/commander/index.js 0000666 00000124146 15042511722 0012646 0 ustar 00 /**
* Module dependencies.
*/
var EventEmitter = require('events').EventEmitter;
var spawn = require('child_process').spawn;
var path = require('path');
var dirname = path.dirname;
var basename = path.basename;
var fs = require('fs');
/**
* Inherit `Command` from `EventEmitter.prototype`.
*/
require('util').inherits(Command, EventEmitter);
/**
* Expose the root command.
*/
exports = module.exports = new Command();
/**
* Expose `Command`.
*/
exports.Command = Command;
/**
* Expose `Option`.
*/
exports.Option = Option;
/**
* Initialize a new `Option` with the given `flags` and `description`.
*
* @param {String} flags
* @param {String} description
* @api public
*/
function Option(flags, description) {
this.flags = flags;
this.required = flags.indexOf('<') >= 0; // A value must be supplied when the option is specified.
this.optional = flags.indexOf('[') >= 0; // A value is optional when the option is specified.
this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.
this.negate = flags.indexOf('-no-') !== -1;
flags = flags.split(/[ ,|]+/);
if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
this.long = flags.shift();
this.description = description || '';
}
/**
* Return option name.
*
* @return {String}
* @api private
*/
Option.prototype.name = function() {
return this.long.replace(/^--/, '');
};
/**
* Return option name, in a camelcase format that can be used
* as a object attribute key.
*
* @return {String}
* @api private
*/
Option.prototype.attributeName = function() {
return camelcase(this.name().replace(/^no-/, ''));
};
/**
* Check if `arg` matches the short or long flag.
*
* @param {String} arg
* @return {Boolean}
* @api private
*/
Option.prototype.is = function(arg) {
return this.short === arg || this.long === arg;
};
/**
* CommanderError class
* @class
*/
class CommanderError extends Error {
/**
* Constructs the CommanderError class
* @param {Number} exitCode suggested exit code which could be used with process.exit
* @param {String} code an id string representing the error
* @param {String} message human-readable description of the error
* @constructor
*/
constructor(exitCode, code, message) {
super(message);
// properly capture stack trace in Node.js
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.code = code;
this.exitCode = exitCode;
}
}
exports.CommanderError = CommanderError;
/**
* Initialize a new `Command`.
*
* @param {String} [name]
* @api public
*/
function Command(name) {
this.commands = [];
this.options = [];
this._execs = new Set();
this._allowUnknownOption = false;
this._args = [];
this._name = name || '';
this._optionValues = {};
this._storeOptionsAsProperties = true; // backwards compatible by default
this._passCommandToAction = true; // backwards compatible by default
this._actionResults = [];
this._helpFlags = '-h, --help';
this._helpDescription = 'output usage information';
this._helpShortFlag = '-h';
this._helpLongFlag = '--help';
}
/**
* Define a command.
*
* There are two styles of command: pay attention to where to put the description.
*
* Examples:
*
* // Command implemented using action handler (description is supplied separately to `.command`)
* program
* .command('clone [destination]')
* .description('clone a repository into a newly created directory')
* .action((source, destination) => {
* console.log('clone command called');
* });
*
* // Command implemented using separate executable file (description is second parameter to `.command`)
* program
* .command('start ', 'start named service')
* .command('stop [service]', 'stop named service, or all if no name supplied');
*
* @param {string} nameAndArgs - command name and arguments, args are `` or `[optional]` and last may also be `variadic...`
* @param {Object|string} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)
* @param {Object} [execOpts] - configuration options (for executable)
* @return {Command} returns new command for action handler, or top-level command for executable command
* @api public
*/
Command.prototype.command = function(nameAndArgs, actionOptsOrExecDesc, execOpts) {
var desc = actionOptsOrExecDesc;
var opts = execOpts;
if (typeof desc === 'object' && desc !== null) {
opts = desc;
desc = null;
}
opts = opts || {};
var args = nameAndArgs.split(/ +/);
var cmd = new Command(args.shift());
if (desc) {
cmd.description(desc);
this.executables = true;
this._execs.add(cmd._name);
if (opts.isDefault) this.defaultExecutable = cmd._name;
}
cmd._noHelp = !!opts.noHelp;
cmd._helpFlags = this._helpFlags;
cmd._helpDescription = this._helpDescription;
cmd._helpShortFlag = this._helpShortFlag;
cmd._helpLongFlag = this._helpLongFlag;
cmd._exitCallback = this._exitCallback;
cmd._storeOptionsAsProperties = this._storeOptionsAsProperties;
cmd._passCommandToAction = this._passCommandToAction;
cmd._executableFile = opts.executableFile; // Custom name for executable file
this.commands.push(cmd);
cmd.parseExpectedArgs(args);
cmd.parent = this;
if (desc) return this;
return cmd;
};
/**
* Define argument syntax for the top-level command.
*
* @api public
*/
Command.prototype.arguments = function(desc) {
return this.parseExpectedArgs(desc.split(/ +/));
};
/**
* Add an implicit `help [cmd]` subcommand
* which invokes `--help` for the given command.
*
* @api private
*/
Command.prototype.addImplicitHelpCommand = function() {
this.command('help [cmd]', 'display help for [cmd]');
};
/**
* Parse expected `args`.
*
* For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
*
* @param {Array} args
* @return {Command} for chaining
* @api public
*/
Command.prototype.parseExpectedArgs = function(args) {
if (!args.length) return;
var self = this;
args.forEach(function(arg) {
var argDetails = {
required: false,
name: '',
variadic: false
};
switch (arg[0]) {
case '<':
argDetails.required = true;
argDetails.name = arg.slice(1, -1);
break;
case '[':
argDetails.name = arg.slice(1, -1);
break;
}
if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') {
argDetails.variadic = true;
argDetails.name = argDetails.name.slice(0, -3);
}
if (argDetails.name) {
self._args.push(argDetails);
}
});
return this;
};
/**
* Register callback to use as replacement for calling process.exit.
*
* @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing
* @return {Command} for chaining
* @api public
*/
Command.prototype.exitOverride = function(fn) {
if (fn) {
this._exitCallback = fn;
} else {
this._exitCallback = function(err) {
if (err.code !== 'commander.executeSubCommandAsync') {
throw err;
} else {
// Async callback from spawn events, not useful to throw.
}
};
}
return this;
};
/**
* Call process.exit, and _exitCallback if defined.
*
* @param {Number} exitCode exit code for using with process.exit
* @param {String} code an id string representing the error
* @param {String} message human-readable description of the error
* @return never
* @api private
*/
Command.prototype._exit = function(exitCode, code, message) {
if (this._exitCallback) {
this._exitCallback(new CommanderError(exitCode, code, message));
// Expecting this line is not reached.
}
process.exit(exitCode);
};
/**
* Register callback `fn` for the command.
*
* Examples:
*
* program
* .command('help')
* .description('display verbose help')
* .action(function() {
* // output help here
* });
*
* @param {Function} fn
* @return {Command} for chaining
* @api public
*/
Command.prototype.action = function(fn) {
var self = this;
var listener = function(args, unknown) {
// Parse any so-far unknown options
args = args || [];
unknown = unknown || [];
var parsed = self.parseOptions(unknown);
// Output help if necessary
outputHelpIfRequested(self, parsed.unknown);
self._checkForMissingMandatoryOptions();
// If there are still any unknown options, then we simply
// die, unless someone asked for help, in which case we give it
// to them, and then we die.
if (parsed.unknown.length > 0) {
self.unknownOption(parsed.unknown[0]);
}
// Leftover arguments need to be pushed back. Fixes issue #56
if (parsed.args.length) args = parsed.args.concat(args);
self._args.forEach(function(arg, i) {
if (arg.required && args[i] == null) {
self.missingArgument(arg.name);
} else if (arg.variadic) {
if (i !== self._args.length - 1) {
self.variadicArgNotLast(arg.name);
}
args[i] = args.splice(i);
}
});
// The .action callback takes an extra parameter which is the command itself.
var expectedArgsCount = self._args.length;
var actionArgs = args.slice(0, expectedArgsCount);
if (self._passCommandToAction) {
actionArgs[expectedArgsCount] = self;
} else {
actionArgs[expectedArgsCount] = self.opts();
}
// Add the extra arguments so available too.
if (args.length > expectedArgsCount) {
actionArgs.push(args.slice(expectedArgsCount));
}
const actionResult = fn.apply(self, actionArgs);
// Remember result in case it is async. Assume parseAsync getting called on root.
let rootCommand = self;
while (rootCommand.parent) {
rootCommand = rootCommand.parent;
}
rootCommand._actionResults.push(actionResult);
};
var parent = this.parent || this;
var name = parent === this ? '*' : this._name;
parent.on('command:' + name, listener);
if (this._alias) parent.on('command:' + this._alias, listener);
return this;
};
/**
* Internal implementation shared by .option() and .requiredOption()
*
* @param {Object} config
* @param {String} flags
* @param {String} description
* @param {Function|*} [fn] - custom option processing function or default vaue
* @param {*} [defaultValue]
* @return {Command} for chaining
* @api private
*/
Command.prototype._optionEx = function(config, flags, description, fn, defaultValue) {
var self = this,
option = new Option(flags, description),
oname = option.name(),
name = option.attributeName();
option.mandatory = !!config.mandatory;
// default as 3rd arg
if (typeof fn !== 'function') {
if (fn instanceof RegExp) {
// This is a bit simplistic (especially no error messages), and probably better handled by caller using custom option processing.
// No longer documented in README, but still present for backwards compatibility.
var regex = fn;
fn = function(val, def) {
var m = regex.exec(val);
return m ? m[0] : def;
};
} else {
defaultValue = fn;
fn = null;
}
}
// preassign default value for --no-*, [optional], , or plain flag if boolean value
if (option.negate || option.optional || option.required || typeof defaultValue === 'boolean') {
// when --no-foo we make sure default is true, unless a --foo option is already defined
if (option.negate) {
const positiveLongFlag = option.long.replace(/^--no-/, '--');
defaultValue = self.optionFor(positiveLongFlag) ? self._getOptionValue(name) : true;
}
// preassign only if we have a default
if (defaultValue !== undefined) {
self._setOptionValue(name, defaultValue);
option.defaultValue = defaultValue;
}
}
// register the option
this.options.push(option);
// when it's passed assign the value
// and conditionally invoke the callback
this.on('option:' + oname, function(val) {
// coercion
if (val !== null && fn) {
val = fn(val, self._getOptionValue(name) === undefined ? defaultValue : self._getOptionValue(name));
}
// unassigned or boolean value
if (typeof self._getOptionValue(name) === 'boolean' || typeof self._getOptionValue(name) === 'undefined') {
// if no value, negate false, and we have a default, then use it!
if (val == null) {
self._setOptionValue(name, option.negate
? false
: defaultValue || true);
} else {
self._setOptionValue(name, val);
}
} else if (val !== null) {
// reassign
self._setOptionValue(name, option.negate ? false : val);
}
});
return this;
};
/**
* Define option with `flags`, `description` and optional
* coercion `fn`.
*
* The `flags` string should contain both the short and long flags,
* separated by comma, a pipe or space. The following are all valid
* all will output this way when `--help` is used.
*
* "-p, --pepper"
* "-p|--pepper"
* "-p --pepper"
*
* Examples:
*
* // simple boolean defaulting to undefined
* program.option('-p, --pepper', 'add pepper');
*
* program.pepper
* // => undefined
*
* --pepper
* program.pepper
* // => true
*
* // simple boolean defaulting to true (unless non-negated option is also defined)
* program.option('-C, --no-cheese', 'remove cheese');
*
* program.cheese
* // => true
*
* --no-cheese
* program.cheese
* // => false
*
* // required argument
* program.option('-C, --chdir ', 'change the working directory');
*
* --chdir /tmp
* program.chdir
* // => "/tmp"
*
* // optional argument
* program.option('-c, --cheese [type]', 'add cheese [marble]');
*
* @param {String} flags
* @param {String} description
* @param {Function|*} [fn] - custom option processing function or default vaue
* @param {*} [defaultValue]
* @return {Command} for chaining
* @api public
*/
Command.prototype.option = function(flags, description, fn, defaultValue) {
return this._optionEx({}, flags, description, fn, defaultValue);
};
/*
* Add a required option which must have a value after parsing. This usually means
* the option must be specified on the command line. (Otherwise the same as .option().)
*
* The `flags` string should contain both the short and long flags, separated by comma, a pipe or space.
*
* @param {String} flags
* @param {String} description
* @param {Function|*} [fn] - custom option processing function or default vaue
* @param {*} [defaultValue]
* @return {Command} for chaining
* @api public
*/
Command.prototype.requiredOption = function(flags, description, fn, defaultValue) {
return this._optionEx({ mandatory: true }, flags, description, fn, defaultValue);
};
/**
* Allow unknown options on the command line.
*
* @param {Boolean} arg if `true` or omitted, no error will be thrown
* for unknown options.
* @api public
*/
Command.prototype.allowUnknownOption = function(arg) {
this._allowUnknownOption = arguments.length === 0 || arg;
return this;
};
/**
* Whether to store option values as properties on command object,
* or store separately (specify false). In both cases the option values can be accessed using .opts().
*
* @param {boolean} value
* @return {Command} Command for chaining
* @api public
*/
Command.prototype.storeOptionsAsProperties = function(value) {
this._storeOptionsAsProperties = (value === undefined) || value;
if (this.options.length) {
// This is for programmer, not end user.
console.error('Commander usage error: call storeOptionsAsProperties before adding options');
}
return this;
};
/**
* Whether to pass command to action handler,
* or just the options (specify false).
*
* @param {boolean} value
* @return {Command} Command for chaining
* @api public
*/
Command.prototype.passCommandToAction = function(value) {
this._passCommandToAction = (value === undefined) || value;
return this;
};
/**
* Store option value
*
* @param {String} key
* @param {Object} value
* @api private
*/
Command.prototype._setOptionValue = function(key, value) {
if (this._storeOptionsAsProperties) {
this[key] = value;
} else {
this._optionValues[key] = value;
}
};
/**
* Retrieve option value
*
* @param {String} key
* @return {Object} value
* @api private
*/
Command.prototype._getOptionValue = function(key) {
if (this._storeOptionsAsProperties) {
return this[key];
}
return this._optionValues[key];
};
/**
* Parse `argv`, setting options and invoking commands when defined.
*
* @param {Array} argv
* @return {Command} for chaining
* @api public
*/
Command.prototype.parse = function(argv) {
// implicit help
if (this.executables) this.addImplicitHelpCommand();
// store raw args
this.rawArgs = argv;
// guess name
this._name = this._name || basename(argv[1], '.js');
// github-style sub-commands with no sub-command
if (this.executables && argv.length < 3 && !this.defaultExecutable) {
// this user needs help
argv.push(this._helpLongFlag);
}
// process argv
var normalized = this.normalize(argv.slice(2));
var parsed = this.parseOptions(normalized);
var args = this.args = parsed.args;
var result = this.parseArgs(this.args, parsed.unknown);
if (args[0] === 'help' && args.length === 1) this.help();
// Note for future: we could return early if we found an action handler in parseArgs, as none of following code needed?
// --help
if (args[0] === 'help') {
args[0] = args[1];
args[1] = this._helpLongFlag;
} else {
// If calling through to executable subcommand we could check for help flags before failing,
// but a somewhat unlikely case since program options not passed to executable subcommands.
// Wait for reports to see if check needed and what usage pattern is.
this._checkForMissingMandatoryOptions();
}
// executable sub-commands
// (Debugging note for future: args[0] is not right if an action has been called)
var name = result.args[0];
var subCommand = null;
// Look for subcommand
if (name) {
subCommand = this.commands.find(function(command) {
return command._name === name;
});
}
// Look for alias
if (!subCommand && name) {
subCommand = this.commands.find(function(command) {
return command.alias() === name;
});
if (subCommand) {
name = subCommand._name;
args[0] = name;
}
}
// Look for default subcommand
if (!subCommand && this.defaultExecutable) {
name = this.defaultExecutable;
args.unshift(name);
subCommand = this.commands.find(function(command) {
return command._name === name;
});
}
if (this._execs.has(name)) {
return this.executeSubCommand(argv, args, parsed.unknown, subCommand ? subCommand._executableFile : undefined);
}
return result;
};
/**
* Parse `argv`, setting options and invoking commands when defined.
*
* Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.
*
* @param {Array} argv
* @return {Promise}
* @api public
*/
Command.prototype.parseAsync = function(argv) {
this.parse(argv);
return Promise.all(this._actionResults);
};
/**
* Execute a sub-command executable.
*
* @param {Array} argv
* @param {Array} args
* @param {Array} unknown
* @param {String} executableFile
* @api private
*/
Command.prototype.executeSubCommand = function(argv, args, unknown, executableFile) {
args = args.concat(unknown);
if (!args.length) this.help();
var isExplicitJS = false; // Whether to use node to launch "executable"
// executable
var pm = argv[1];
// name of the subcommand, like `pm-install`
var bin = basename(pm, path.extname(pm)) + '-' + args[0];
if (executableFile != null) {
bin = executableFile;
// Check for same extensions as we scan for below so get consistent launch behaviour.
var executableExt = path.extname(executableFile);
isExplicitJS = executableExt === '.js' || executableExt === '.ts' || executableExt === '.mjs';
}
// In case of globally installed, get the base dir where executable
// subcommand file should be located at
var baseDir;
var resolvedLink = fs.realpathSync(pm);
baseDir = dirname(resolvedLink);
// prefer local `./` to bin in the $PATH
var localBin = path.join(baseDir, bin);
// whether bin file is a js script with explicit `.js` or `.ts` extension
if (exists(localBin + '.js')) {
bin = localBin + '.js';
isExplicitJS = true;
} else if (exists(localBin + '.ts')) {
bin = localBin + '.ts';
isExplicitJS = true;
} else if (exists(localBin + '.mjs')) {
bin = localBin + '.mjs';
isExplicitJS = true;
} else if (exists(localBin)) {
bin = localBin;
}
args = args.slice(1);
var proc;
if (process.platform !== 'win32') {
if (isExplicitJS) {
args.unshift(bin);
// add executable arguments to spawn
args = incrementNodeInspectorPort(process.execArgv).concat(args);
proc = spawn(process.argv[0], args, { stdio: 'inherit' });
} else {
proc = spawn(bin, args, { stdio: 'inherit' });
}
} else {
args.unshift(bin);
// add executable arguments to spawn
args = incrementNodeInspectorPort(process.execArgv).concat(args);
proc = spawn(process.execPath, args, { stdio: 'inherit' });
}
var signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];
signals.forEach(function(signal) {
process.on(signal, function() {
if (proc.killed === false && proc.exitCode === null) {
proc.kill(signal);
}
});
});
// By default terminate process when spawned process terminates.
// Suppressing the exit if exitCallback defined is a bit messy and of limited use, but does allow process to stay running!
const exitCallback = this._exitCallback;
if (!exitCallback) {
proc.on('close', process.exit.bind(process));
} else {
proc.on('close', () => {
exitCallback(new CommanderError(process.exitCode || 0, 'commander.executeSubCommandAsync', '(close)'));
});
}
proc.on('error', function(err) {
if (err.code === 'ENOENT') {
console.error('error: %s(1) does not exist, try --help', bin);
} else if (err.code === 'EACCES') {
console.error('error: %s(1) not executable. try chmod or run with root', bin);
}
if (!exitCallback) {
process.exit(1);
} else {
const wrappedError = new CommanderError(1, 'commander.executeSubCommandAsync', '(error)');
wrappedError.nestedError = err;
exitCallback(wrappedError);
}
});
// Store the reference to the child process
this.runningCommand = proc;
};
/**
* Normalize `args`, splitting joined short flags. For example
* the arg "-abc" is equivalent to "-a -b -c".
* This also normalizes equal sign and splits "--abc=def" into "--abc def".
*
* @param {Array} args
* @return {Array}
* @api private
*/
Command.prototype.normalize = function(args) {
var ret = [],
arg,
lastOpt,
index,
short,
opt;
for (var i = 0, len = args.length; i < len; ++i) {
arg = args[i];
if (i > 0) {
lastOpt = this.optionFor(args[i - 1]);
}
if (arg === '--') {
// Honor option terminator
ret = ret.concat(args.slice(i));
break;
} else if (lastOpt && lastOpt.required) {
ret.push(arg);
} else if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {
short = arg.slice(0, 2);
opt = this.optionFor(short);
if (opt && (opt.required || opt.optional)) {
ret.push(short);
ret.push(arg.slice(2));
} else {
arg.slice(1).split('').forEach(function(c) {
ret.push('-' + c);
});
}
} else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) {
ret.push(arg.slice(0, index), arg.slice(index + 1));
} else {
ret.push(arg);
}
}
return ret;
};
/**
* Parse command `args`.
*
* When listener(s) are available those
* callbacks are invoked, otherwise the "*"
* event is emitted and those actions are invoked.
*
* @param {Array} args
* @return {Command} for chaining
* @api private
*/
Command.prototype.parseArgs = function(args, unknown) {
var name;
if (args.length) {
name = args[0];
if (this.listeners('command:' + name).length) {
this.emit('command:' + args.shift(), args, unknown);
} else {
this.emit('command:*', args, unknown);
}
} else {
outputHelpIfRequested(this, unknown);
// If there were no args and we have unknown options,
// then they are extraneous and we need to error.
if (unknown.length > 0 && !this.defaultExecutable) {
this.unknownOption(unknown[0]);
}
if (this.commands.length === 0 &&
this._args.filter(function(a) { return a.required; }).length === 0) {
this.emit('command:*');
}
}
return this;
};
/**
* Return an option matching `arg` if any.
*
* @param {String} arg
* @return {Option}
* @api private
*/
Command.prototype.optionFor = function(arg) {
for (var i = 0, len = this.options.length; i < len; ++i) {
if (this.options[i].is(arg)) {
return this.options[i];
}
}
};
/**
* Display an error message if a mandatory option does not have a value.
*
* @api private
*/
Command.prototype._checkForMissingMandatoryOptions = function() {
// Walk up hierarchy so can call from action handler after checking for displaying help.
for (var cmd = this; cmd; cmd = cmd.parent) {
cmd.options.forEach((anOption) => {
if (anOption.mandatory && (cmd._getOptionValue(anOption.attributeName()) === undefined)) {
cmd.missingMandatoryOptionValue(anOption);
}
});
}
};
/**
* Parse options from `argv` returning `argv`
* void of these options.
*
* @param {Array} argv
* @return {{args: Array, unknown: Array}}
* @api public
*/
Command.prototype.parseOptions = function(argv) {
var args = [],
len = argv.length,
literal,
option,
arg;
var unknownOptions = [];
// parse options
for (var i = 0; i < len; ++i) {
arg = argv[i];
// literal args after --
if (literal) {
args.push(arg);
continue;
}
if (arg === '--') {
literal = true;
continue;
}
// find matching Option
option = this.optionFor(arg);
// option is defined
if (option) {
// requires arg
if (option.required) {
arg = argv[++i];
if (arg == null) return this.optionMissingArgument(option);
this.emit('option:' + option.name(), arg);
// optional arg
} else if (option.optional) {
arg = argv[i + 1];
if (arg == null || (arg[0] === '-' && arg !== '-')) {
arg = null;
} else {
++i;
}
this.emit('option:' + option.name(), arg);
// flag
} else {
this.emit('option:' + option.name());
}
continue;
}
// looks like an option
if (arg.length > 1 && arg[0] === '-') {
unknownOptions.push(arg);
// If the next argument looks like it might be
// an argument for this option, we pass it on.
// If it isn't, then it'll simply be ignored
if ((i + 1) < argv.length && (argv[i + 1][0] !== '-' || argv[i + 1] === '-')) {
unknownOptions.push(argv[++i]);
}
continue;
}
// arg
args.push(arg);
}
return { args: args, unknown: unknownOptions };
};
/**
* Return an object containing options as key-value pairs
*
* @return {Object}
* @api public
*/
Command.prototype.opts = function() {
if (this._storeOptionsAsProperties) {
// Preserve original behaviour so backwards compatible when still using properties
var result = {},
len = this.options.length;
for (var i = 0; i < len; i++) {
var key = this.options[i].attributeName();
result[key] = key === this._versionOptionName ? this._version : this[key];
}
return result;
}
return this._optionValues;
};
/**
* Argument `name` is missing.
*
* @param {String} name
* @api private
*/
Command.prototype.missingArgument = function(name) {
const message = `error: missing required argument '${name}'`;
console.error(message);
this._exit(1, 'commander.missingArgument', message);
};
/**
* `Option` is missing an argument, but received `flag` or nothing.
*
* @param {Option} option
* @param {String} [flag]
* @api private
*/
Command.prototype.optionMissingArgument = function(option, flag) {
let message;
if (flag) {
message = `error: option '${option.flags}' argument missing, got '${flag}'`;
} else {
message = `error: option '${option.flags}' argument missing`;
}
console.error(message);
this._exit(1, 'commander.optionMissingArgument', message);
};
/**
* `Option` does not have a value, and is a mandatory option.
*
* @param {Option} option
* @api private
*/
Command.prototype.missingMandatoryOptionValue = function(option) {
const message = `error: required option '${option.flags}' not specified`;
console.error(message);
this._exit(1, 'commander.missingMandatoryOptionValue', message);
};
/**
* Unknown option `flag`.
*
* @param {String} flag
* @api private
*/
Command.prototype.unknownOption = function(flag) {
if (this._allowUnknownOption) return;
const message = `error: unknown option '${flag}'`;
console.error(message);
this._exit(1, 'commander.unknownOption', message);
};
/**
* Variadic argument with `name` is not the last argument as required.
*
* @param {String} name
* @api private
*/
Command.prototype.variadicArgNotLast = function(name) {
const message = `error: variadic arguments must be last '${name}'`;
console.error(message);
this._exit(1, 'commander.variadicArgNotLast', message);
};
/**
* Set the program version to `str`.
*
* This method auto-registers the "-V, --version" flag
* which will print the version number when passed.
*
* You can optionally supply the flags and description to override the defaults.
*
* @param {String} str
* @param {String} [flags]
* @param {String} [description]
* @return {Command} for chaining
* @api public
*/
Command.prototype.version = function(str, flags, description) {
if (arguments.length === 0) return this._version;
this._version = str;
flags = flags || '-V, --version';
description = description || 'output the version number';
var versionOption = new Option(flags, description);
this._versionOptionName = versionOption.long.substr(2) || 'version';
this.options.push(versionOption);
var self = this;
this.on('option:' + this._versionOptionName, function() {
process.stdout.write(str + '\n');
self._exit(0, 'commander.version', str);
});
return this;
};
/**
* Set the description to `str`.
*
* @param {String} str
* @param {Object} [argsDescription]
* @return {String|Command}
* @api public
*/
Command.prototype.description = function(str, argsDescription) {
if (arguments.length === 0) return this._description;
this._description = str;
this._argsDescription = argsDescription;
return this;
};
/**
* Set an alias for the command
*
* @param {String} alias
* @return {String|Command}
* @api public
*/
Command.prototype.alias = function(alias) {
var command = this;
if (this.commands.length !== 0) {
command = this.commands[this.commands.length - 1];
}
if (arguments.length === 0) return command._alias;
if (alias === command._name) throw new Error('Command alias can\'t be the same as its name');
command._alias = alias;
return this;
};
/**
* Set / get the command usage `str`.
*
* @param {String} [str]
* @return {String|Command}
* @api public
*/
Command.prototype.usage = function(str) {
var args = this._args.map(function(arg) {
return humanReadableArgName(arg);
});
var usage = '[options]' +
(this.commands.length ? ' [command]' : '') +
(this._args.length ? ' ' + args.join(' ') : '');
if (arguments.length === 0) return this._usage || usage;
this._usage = str;
return this;
};
/**
* Get or set the name of the command
*
* @param {String} [str]
* @return {String|Command}
* @api public
*/
Command.prototype.name = function(str) {
if (arguments.length === 0) return this._name;
this._name = str;
return this;
};
/**
* Return prepared commands.
*
* @return {Array}
* @api private
*/
Command.prototype.prepareCommands = function() {
return this.commands.filter(function(cmd) {
return !cmd._noHelp;
}).map(function(cmd) {
var args = cmd._args.map(function(arg) {
return humanReadableArgName(arg);
}).join(' ');
return [
cmd._name +
(cmd._alias ? '|' + cmd._alias : '') +
(cmd.options.length ? ' [options]' : '') +
(args ? ' ' + args : ''),
cmd._description
];
});
};
/**
* Return the largest command length.
*
* @return {Number}
* @api private
*/
Command.prototype.largestCommandLength = function() {
var commands = this.prepareCommands();
return commands.reduce(function(max, command) {
return Math.max(max, command[0].length);
}, 0);
};
/**
* Return the largest option length.
*
* @return {Number}
* @api private
*/
Command.prototype.largestOptionLength = function() {
var options = [].slice.call(this.options);
options.push({
flags: this._helpFlags
});
return options.reduce(function(max, option) {
return Math.max(max, option.flags.length);
}, 0);
};
/**
* Return the largest arg length.
*
* @return {Number}
* @api private
*/
Command.prototype.largestArgLength = function() {
return this._args.reduce(function(max, arg) {
return Math.max(max, arg.name.length);
}, 0);
};
/**
* Return the pad width.
*
* @return {Number}
* @api private
*/
Command.prototype.padWidth = function() {
var width = this.largestOptionLength();
if (this._argsDescription && this._args.length) {
if (this.largestArgLength() > width) {
width = this.largestArgLength();
}
}
if (this.commands && this.commands.length) {
if (this.largestCommandLength() > width) {
width = this.largestCommandLength();
}
}
return width;
};
/**
* Return help for options.
*
* @return {String}
* @api private
*/
Command.prototype.optionHelp = function() {
var width = this.padWidth();
var columns = process.stdout.columns || 80;
var descriptionWidth = columns - width - 4;
// Append the help information
return this.options.map(function(option) {
const fullDesc = option.description +
((!option.negate && option.defaultValue !== undefined) ? ' (default: ' + JSON.stringify(option.defaultValue) + ')' : '');
return pad(option.flags, width) + ' ' + optionalWrap(fullDesc, descriptionWidth, width + 2);
}).concat([pad(this._helpFlags, width) + ' ' + optionalWrap(this._helpDescription, descriptionWidth, width + 2)])
.join('\n');
};
/**
* Return command help documentation.
*
* @return {String}
* @api private
*/
Command.prototype.commandHelp = function() {
if (!this.commands.length) return '';
var commands = this.prepareCommands();
var width = this.padWidth();
var columns = process.stdout.columns || 80;
var descriptionWidth = columns - width - 4;
return [
'Commands:',
commands.map(function(cmd) {
var desc = cmd[1] ? ' ' + cmd[1] : '';
return (desc ? pad(cmd[0], width) : cmd[0]) + optionalWrap(desc, descriptionWidth, width + 2);
}).join('\n').replace(/^/gm, ' '),
''
].join('\n');
};
/**
* Return program help documentation.
*
* @return {String}
* @api private
*/
Command.prototype.helpInformation = function() {
var desc = [];
if (this._description) {
desc = [
this._description,
''
];
var argsDescription = this._argsDescription;
if (argsDescription && this._args.length) {
var width = this.padWidth();
var columns = process.stdout.columns || 80;
var descriptionWidth = columns - width - 5;
desc.push('Arguments:');
desc.push('');
this._args.forEach(function(arg) {
desc.push(' ' + pad(arg.name, width) + ' ' + wrap(argsDescription[arg.name], descriptionWidth, width + 4));
});
desc.push('');
}
}
var cmdName = this._name;
if (this._alias) {
cmdName = cmdName + '|' + this._alias;
}
var parentCmdNames = '';
for (var parentCmd = this.parent; parentCmd; parentCmd = parentCmd.parent) {
parentCmdNames = parentCmd.name() + ' ' + parentCmdNames;
}
var usage = [
'Usage: ' + parentCmdNames + cmdName + ' ' + this.usage(),
''
];
var cmds = [];
var commandHelp = this.commandHelp();
if (commandHelp) cmds = [commandHelp];
var options = [
'Options:',
'' + this.optionHelp().replace(/^/gm, ' '),
''
];
return usage
.concat(desc)
.concat(options)
.concat(cmds)
.join('\n');
};
/**
* Output help information for this command.
*
* When listener(s) are available for the helpLongFlag
* those callbacks are invoked.
*
* @api public
*/
Command.prototype.outputHelp = function(cb) {
if (!cb) {
cb = function(passthru) {
return passthru;
};
}
const cbOutput = cb(this.helpInformation());
if (typeof cbOutput !== 'string' && !Buffer.isBuffer(cbOutput)) {
throw new Error('outputHelp callback must return a string or a Buffer');
}
process.stdout.write(cbOutput);
this.emit(this._helpLongFlag);
};
/**
* You can pass in flags and a description to override the help
* flags and help description for your command.
*
* @param {String} [flags]
* @param {String} [description]
* @return {Command}
* @api public
*/
Command.prototype.helpOption = function(flags, description) {
this._helpFlags = flags || this._helpFlags;
this._helpDescription = description || this._helpDescription;
var splitFlags = this._helpFlags.split(/[ ,|]+/);
if (splitFlags.length > 1) this._helpShortFlag = splitFlags.shift();
this._helpLongFlag = splitFlags.shift();
return this;
};
/**
* Output help information and exit.
*
* @param {Function} [cb]
* @api public
*/
Command.prototype.help = function(cb) {
this.outputHelp(cb);
// exitCode: preserving original behaviour which was calling process.exit()
// message: do not have all displayed text available so only passing placeholder.
this._exit(process.exitCode || 0, 'commander.help', '(outputHelp)');
};
/**
* Camel-case the given `flag`
*
* @param {String} flag
* @return {String}
* @api private
*/
function camelcase(flag) {
return flag.split('-').reduce(function(str, word) {
return str + word[0].toUpperCase() + word.slice(1);
});
}
/**
* Pad `str` to `width`.
*
* @param {String} str
* @param {Number} width
* @return {String}
* @api private
*/
function pad(str, width) {
var len = Math.max(0, width - str.length);
return str + Array(len + 1).join(' ');
}
/**
* Wraps the given string with line breaks at the specified width while breaking
* words and indenting every but the first line on the left.
*
* @param {String} str
* @param {Number} width
* @param {Number} indent
* @return {String}
* @api private
*/
function wrap(str, width, indent) {
var regex = new RegExp('.{1,' + (width - 1) + '}([\\s\u200B]|$)|[^\\s\u200B]+?([\\s\u200B]|$)', 'g');
var lines = str.match(regex) || [];
return lines.map(function(line, i) {
if (line.slice(-1) === '\n') {
line = line.slice(0, line.length - 1);
}
return ((i > 0 && indent) ? Array(indent + 1).join(' ') : '') + line.trimRight();
}).join('\n');
}
/**
* Optionally wrap the given str to a max width of width characters per line
* while indenting with indent spaces. Do not wrap if insufficient width or
* string is manually formatted.
*
* @param {String} str
* @param {Number} width
* @param {Number} indent
* @return {String}
* @api private
*/
function optionalWrap(str, width, indent) {
// Detect manually wrapped and indented strings by searching for line breaks
// followed by multiple spaces/tabs.
if (str.match(/[\n]\s+/)) return str;
// Do not wrap to narrow columns (or can end up with a word per line).
const minWidth = 40;
if (width < minWidth) return str;
return wrap(str, width, indent);
}
/**
* Output help information if help flags specified
*
* @param {Command} cmd - command to output help for
* @param {Array} options - array of options to search for -h or --help
* @api private
*/
function outputHelpIfRequested(cmd, options) {
options = options || [];
for (var i = 0; i < options.length; i++) {
if (options[i] === cmd._helpLongFlag || options[i] === cmd._helpShortFlag) {
cmd.outputHelp();
// (Do not have all displayed text available so only passing placeholder.)
cmd._exit(0, 'commander.helpDisplayed', '(outputHelp)');
}
}
}
/**
* Takes an argument and returns its human readable equivalent for help usage.
*
* @param {Object} arg
* @return {String}
* @api private
*/
function humanReadableArgName(arg) {
var nameOutput = arg.name + (arg.variadic === true ? '...' : '');
return arg.required
? '<' + nameOutput + '>'
: '[' + nameOutput + ']';
}
// for versions before node v0.8 when there weren't `fs.existsSync`
function exists(file) {
try {
if (fs.statSync(file).isFile()) {
return true;
}
} catch (e) {
return false;
}
}
/**
* Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).
*
* @param {string[]} args - array of arguments from node.execArgv
* @returns {string[]}
* @api private
*/
function incrementNodeInspectorPort(args) {
// Testing for these options:
// --inspect[=[host:]port]
// --inspect-brk[=[host:]port]
// --inspect-port=[host:]port
return args.map((arg) => {
var result = arg;
if (arg.indexOf('--inspect') === 0) {
var debugOption;
var debugHost = '127.0.0.1';
var debugPort = '9229';
var match;
if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
// e.g. --inspect
debugOption = match[1];
} else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
debugOption = match[1];
if (/^\d+$/.test(match[3])) {
// e.g. --inspect=1234
debugPort = match[3];
} else {
// e.g. --inspect=localhost
debugHost = match[3];
}
} else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
// e.g. --inspect=localhost:1234
debugOption = match[1];
debugHost = match[3];
debugPort = match[4];
}
if (debugOption && debugPort !== '0') {
result = `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
}
}
return result;
});
}
node_modules/commander/typings/index.d.ts 0000666 00000022204 15042511722 0014567 0 ustar 00 // Type definitions for commander
// Original definitions by: Alan Agius , Marcelo Dezem , vvakame , Jules Randolph
///
declare namespace commander {
interface CommanderError extends Error {
code: string;
exitCode: number;
message: string;
nestedError?: string;
}
type CommanderErrorConstructor = { new (exitCode: number, code: string, message: string): CommanderError };
interface Option {
flags: string;
required: boolean; // A value must be supplied when the option is specified.
optional: boolean; // A value is optional when the option is specified.
mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line.
bool: boolean;
short?: string;
long: string;
description: string;
}
type OptionConstructor = { new (flags: string, description?: string): Option };
interface Command extends NodeJS.EventEmitter {
[key: string]: any; // options as properties
args: string[];
/**
* Set the program version to `str`.
*
* This method auto-registers the "-V, --version" flag
* which will print the version number when passed.
*
* You can optionally supply the flags and description to override the defaults.
*/
version(str: string, flags?: string, description?: string): Command;
/**
* Define a command, implemented using an action handler.
*
* @remarks
* The command description is supplied using `.description`, not as a parameter to `.command`.
*
* @example
* ```ts
* program
* .command('clone [destination]')
* .description('clone a repository into a newly created directory')
* .action((source, destination) => {
* console.log('clone command called');
* });
* ```
*
* @param nameAndArgs - command name and arguments, args are `` or `[optional]` and last may also be `variadic...`
* @param opts - configuration options
* @returns new command
*/
command(nameAndArgs: string, opts?: CommandOptions): Command;
/**
* Define a command, implemented in a separate executable file.
*
* @remarks
* The command description is supplied as the second parameter to `.command`.
*
* @example
* ```ts
* program
* .command('start ', 'start named service')
* .command('stop [service]', 'stop named serice, or all if no name supplied');
* ```
*
* @param nameAndArgs - command name and arguments, args are `` or `[optional]` and last may also be `variadic...`
* @param description - description of executable command
* @param opts - configuration options
* @returns top level command for chaining more command definitions
*/
command(nameAndArgs: string, description: string, opts?: commander.CommandOptions): Command;
/**
* Define argument syntax for the top-level command.
*
* @returns Command for chaining
*/
arguments(desc: string): Command;
/**
* Parse expected `args`.
*
* For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
*
* @returns Command for chaining
*/
parseExpectedArgs(args: string[]): Command;
/**
* Register callback to use as replacement for calling process.exit.
*/
exitOverride(callback?: (err: CommanderError) => never|void): Command;
/**
* Register callback `fn` for the command.
*
* @example
* program
* .command('help')
* .description('display verbose help')
* .action(function() {
* // output help here
* });
*
* @returns Command for chaining
*/
action(fn: (...args: any[]) => void | Promise): Command;
/**
* Define option with `flags`, `description` and optional
* coercion `fn`.
*
* The `flags` string should contain both the short and long flags,
* separated by comma, a pipe or space. The following are all valid
* all will output this way when `--help` is used.
*
* "-p, --pepper"
* "-p|--pepper"
* "-p --pepper"
*
* @example
* // simple boolean defaulting to false
* program.option('-p, --pepper', 'add pepper');
*
* --pepper
* program.pepper
* // => Boolean
*
* // simple boolean defaulting to true
* program.option('-C, --no-cheese', 'remove cheese');
*
* program.cheese
* // => true
*
* --no-cheese
* program.cheese
* // => false
*
* // required argument
* program.option('-C, --chdir ', 'change the working directory');
*
* --chdir /tmp
* program.chdir
* // => "/tmp"
*
* // optional argument
* program.option('-c, --cheese [type]', 'add cheese [marble]');
*
* @returns Command for chaining
*/
option(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command;
option(flags: string, description?: string, defaultValue?: any): Command;
/**
* Define a required option, which must have a value after parsing. This usually means
* the option must be specified on the command line. (Otherwise the same as .option().)
*
* The `flags` string should contain both the short and long flags, separated by comma, a pipe or space.
*/
requiredOption(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command;
requiredOption(flags: string, description?: string, defaultValue?: any): Command;
/**
* Whether to store option values as properties on command object,
* or store separately (specify false). In both cases the option values can be accessed using .opts().
*
* @return Command for chaining
*/
storeOptionsAsProperties(value?: boolean): Command;
/**
* Whether to pass command to action handler,
* or just the options (specify false).
*
* @return Command for chaining
*/
passCommandToAction(value?: boolean): Command;
/**
* Allow unknown options on the command line.
*
* @param [arg] if `true` or omitted, no error will be thrown for unknown options.
* @returns Command for chaining
*/
allowUnknownOption(arg?: boolean): Command;
/**
* Parse `argv`, setting options and invoking commands when defined.
*
* @returns Command for chaining
*/
parse(argv: string[]): Command;
/**
* Parse `argv`, setting options and invoking commands when defined.
*
* Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.
*
* @returns Promise
*/
parseAsync(argv: string[]): Promise;
/**
* Parse options from `argv` returning `argv` void of these options.
*/
parseOptions(argv: string[]): commander.ParseOptionsResult;
/**
* Return an object containing options as key-value pairs
*/
opts(): { [key: string]: any };
/**
* Set the description.
*
* @returns Command for chaining
*/
description(str: string, argsDescription?: {[argName: string]: string}): Command;
/**
* Get the description.
*/
description(): string;
/**
* Set an alias for the command.
*
* @returns Command for chaining
*/
alias(alias: string): Command;
/**
* Get alias for the command.
*/
alias(): string;
/**
* Set the command usage.
*
* @returns Command for chaining
*/
usage(str: string): Command;
/**
* Get the command usage.
*/
usage(): string;
/**
* Set the name of the command.
*
* @returns Command for chaining
*/
name(str: string): Command;
/**
* Get the name of the command.
*/
name(): string;
/**
* Output help information for this command.
*
* When listener(s) are available for the helpLongFlag
* those callbacks are invoked.
*/
outputHelp(cb?: (str: string) => string): void;
/**
* You can pass in flags and a description to override the help
* flags and help description for your command.
*/
helpOption(flags?: string, description?: string): Command;
/**
* Output help information and exit.
*/
help(cb?: (str: string) => string): never;
}
type CommandConstructor = { new (name?: string): Command };
interface CommandOptions {
noHelp?: boolean;
isDefault?: boolean;
executableFile?: string;
}
interface ParseOptionsResult {
args: string[];
unknown: string[];
}
interface CommanderStatic extends Command {
Command: CommandConstructor;
Option: OptionConstructor;
CommanderError:CommanderErrorConstructor;
}
}
declare const commander: commander.CommanderStatic;
export = commander;
node_modules/commander/Readme.md 0000666 00000055662 15042511722 0012726 0 ustar 00 # Commander.js
[](http://travis-ci.org/tj/commander.js)
[](https://www.npmjs.org/package/commander)
[](https://npmcharts.com/compare/commander?minimal=true)
[](https://packagephobia.now.sh/result?p=commander)
The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/commander-rb/commander).
Read this in other languages: English | [简体中文](./Readme_zh-CN.md)
- [Commander.js](#commanderjs)
- [Installation](#installation)
- [Declaring program variable](#declaring-program-variable)
- [Options](#options)
- [Common option types, boolean and value](#common-option-types-boolean-and-value)
- [Default option value](#default-option-value)
- [Other option types, negatable boolean and flag|value](#other-option-types-negatable-boolean-and-flagvalue)
- [Custom option processing](#custom-option-processing)
- [Required option](#required-option)
- [Version option](#version-option)
- [Commands](#commands)
- [Specify the argument syntax](#specify-the-argument-syntax)
- [Action handler (sub)commands](#action-handler-subcommands)
- [Git-style executable (sub)commands](#git-style-executable-subcommands)
- [Automated --help](#automated---help)
- [Custom help](#custom-help)
- [.usage and .name](#usage-and-name)
- [.outputHelp(cb)](#outputhelpcb)
- [.helpOption(flags, description)](#helpoptionflags-description)
- [.help(cb)](#helpcb)
- [Custom event listeners](#custom-event-listeners)
- [Bits and pieces](#bits-and-pieces)
- [Avoiding option name clashes](#avoiding-option-name-clashes)
- [TypeScript](#typescript)
- [Node options such as --harmony](#node-options-such-as---harmony)
- [Node debugging](#node-debugging)
- [Override exit handling](#override-exit-handling)
- [Examples](#examples)
- [License](#license)
- [Support](#support)
- [Commander for enterprise](#commander-for-enterprise)
## Installation
```bash
npm install commander
```
## Declaring _program_ variable
Commander exports a global object which is convenient for quick programs.
This is used in the examples in this README for brevity.
```js
const program = require('commander');
program.version('0.0.1');
```
For larger programs which may use commander in multiple ways, including unit testing, it is better to create a local Command object to use.
```js
const commander = require('commander');
const program = new commander.Command();
program.version('0.0.1');
```
## Options
Options are defined with the `.option()` method, also serving as documentation for the options. Each option can have a short flag (single character) and a long name, separated by a comma or space.
The options can be accessed as properties on the Command object. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. Multiple short flags may be combined as a single arg, for example `-abc` is equivalent to `-a -b -c`.
See also optional new behaviour to [avoid name clashes](#avoiding-option-name-clashes).
### Common option types, boolean and value
The two most used option types are a boolean flag, and an option which takes a value (declared using angle brackets). Both are `undefined` unless specified on command line.
```js
const program = require('commander');
program
.option('-d, --debug', 'output extra debugging')
.option('-s, --small', 'small pizza size')
.option('-p, --pizza-type ', 'flavour of pizza');
program.parse(process.argv);
if (program.debug) console.log(program.opts());
console.log('pizza details:');
if (program.small) console.log('- small pizza size');
if (program.pizzaType) console.log(`- ${program.pizzaType}`);
```
```bash
$ pizza-options -d
{ debug: true, small: undefined, pizzaType: undefined }
pizza details:
$ pizza-options -p
error: option '-p, --pizza-type ' argument missing
$ pizza-options -ds -p vegetarian
{ debug: true, small: true, pizzaType: 'vegetarian' }
pizza details:
- small pizza size
- vegetarian
$ pizza-options --pizza-type=cheese
pizza details:
- cheese
```
`program.parse(arguments)` processes the arguments, leaving any args not consumed by the options as the `program.args` array.
### Default option value
You can specify a default value for an option which takes a value.
```js
const program = require('commander');
program
.option('-c, --cheese ', 'add the specified type of cheese', 'blue');
program.parse(process.argv);
console.log(`cheese: ${program.cheese}`);
```
```bash
$ pizza-options
cheese: blue
$ pizza-options --cheese stilton
cheese: stilton
```
### Other option types, negatable boolean and flag|value
You can specify a boolean option long name with a leading `no-` to set the option value to false when used.
Defined alone this also makes the option true by default.
If you define `--foo` first, adding `--no-foo` does not change the default value from what it would
otherwise be. You can specify a default boolean value for a boolean flag and it can be overridden on command line.
```js
const program = require('commander');
program
.option('--no-sauce', 'Remove sauce')
.option('--cheese ', 'cheese flavour', 'mozzarella')
.option('--no-cheese', 'plain with no cheese')
.parse(process.argv);
const sauceStr = program.sauce ? 'sauce' : 'no sauce';
const cheeseStr = (program.cheese === false) ? 'no cheese' : `${program.cheese} cheese`;
console.log(`You ordered a pizza with ${sauceStr} and ${cheeseStr}`);
```
```bash
$ pizza-options
You ordered a pizza with sauce and mozzarella cheese
$ pizza-options --sauce
error: unknown option '--sauce'
$ pizza-options --cheese=blue
You ordered a pizza with sauce and blue cheese
$ pizza-options --no-sauce --no-cheese
You ordered a pizza with no sauce and no cheese
```
You can specify an option which functions as a flag but may also take a value (declared using square brackets).
```js
const program = require('commander');
program
.option('-c, --cheese [type]', 'Add cheese with optional type');
program.parse(process.argv);
if (program.cheese === undefined) console.log('no cheese');
else if (program.cheese === true) console.log('add cheese');
else console.log(`add cheese type ${program.cheese}`);
```
```bash
$ pizza-options
no cheese
$ pizza-options --cheese
add cheese
$ pizza-options --cheese mozzarella
add cheese type mozzarella
```
### Custom option processing
You may specify a function to do custom processing of option values. The callback function receives two parameters, the user specified value and the
previous value for the option. It returns the new value for the option.
This allows you to coerce the option value to the desired type, or accumulate values, or do entirely custom processing.
You can optionally specify the default/starting value for the option after the function.
```js
const program = require('commander');
function myParseInt(value, dummyPrevious) {
// parseInt takes a string and an optional radix
return parseInt(value);
}
function increaseVerbosity(dummyValue, previous) {
return previous + 1;
}
function collect(value, previous) {
return previous.concat([value]);
}
function commaSeparatedList(value, dummyPrevious) {
return value.split(',');
}
program
.option('-f, --float ', 'float argument', parseFloat)
.option('-i, --integer ', 'integer argument', myParseInt)
.option('-v, --verbose', 'verbosity that can be increased', increaseVerbosity, 0)
.option('-c, --collect ', 'repeatable value', collect, [])
.option('-l, --list ', 'comma separated list', commaSeparatedList)
;
program.parse(process.argv);
if (program.float !== undefined) console.log(`float: ${program.float}`);
if (program.integer !== undefined) console.log(`integer: ${program.integer}`);
if (program.verbose > 0) console.log(`verbosity: ${program.verbose}`);
if (program.collect.length > 0) console.log(program.collect);
if (program.list !== undefined) console.log(program.list);
```
```bash
$ custom -f 1e2
float: 100
$ custom --integer 2
integer: 2
$ custom -v -v -v
verbose: 3
$ custom -c a -c b -c c
[ 'a', 'b', 'c' ]
$ custom --list x,y,z
[ 'x', 'y', 'z' ]
```
### Required option
You may specify a required (mandatory) option using `.requiredOption`. The option must be specified on the command line, or by having a default value. The method is otherwise the same as `.option` in format, taking flags and description, and optional default value or custom processing.
```js
const program = require('commander');
program
.requiredOption('-c, --cheese ', 'pizza must have cheese');
program.parse(process.argv);
```
```
$ pizza
error: required option '-c, --cheese ' not specified
```
### Version option
The optional `version` method adds handling for displaying the command version. The default option flags are `-V` and `--version`, and when present the command prints the version number and exits.
```js
program.version('0.0.1');
```
```bash
$ ./examples/pizza -V
0.0.1
```
You may change the flags and description by passing additional parameters to the `version` method, using
the same syntax for flags as the `option` method. The version flags can be named anything, but a long name is required.
```js
program.version('0.0.1', '-v, --vers', 'output the current version');
```
## Commands
You can specify (sub)commands for your top-level command using `.command`. There are two ways these can be implemented: using an action handler attached to the command, or as a separate executable file (described in more detail later). In the first parameter to `.command` you specify the command name and any command arguments. The arguments may be `` or `[optional]`, and the last argument may also be `variadic...`.
For example:
```js
// Command implemented using action handler (description is supplied separately to `.command`)
// Returns new command for configuring.
program
.command('clone [destination]')
.description('clone a repository into a newly created directory')
.action((source, destination) => {
console.log('clone command called');
});
// Command implemented using separate executable file (description is second parameter to `.command`)
// Returns top-level command for adding more commands.
program
.command('start ', 'start named service')
.command('stop [service]', 'stop named service, or all if no name supplied');
```
### Specify the argument syntax
You use `.arguments` to specify the arguments for the top-level command, and for subcommands they are included in the `.command` call. Angled brackets (e.g. ``) indicate required input. Square brackets (e.g. `[optional]`) indicate optional input.
```js
const program = require('commander');
program
.version('0.1.0')
.arguments(' [env]')
.action(function (cmd, env) {
cmdValue = cmd;
envValue = env;
});
program.parse(process.argv);
if (typeof cmdValue === 'undefined') {
console.error('no command given!');
process.exit(1);
}
console.log('command:', cmdValue);
console.log('environment:', envValue || "no environment given");
```
The last argument of a command can be variadic, and only the last argument. To make an argument variadic you
append `...` to the argument name. For example:
```js
const program = require('commander');
program
.version('0.1.0')
.command('rmdir [otherDirs...]')
.action(function (dir, otherDirs) {
console.log('rmdir %s', dir);
if (otherDirs) {
otherDirs.forEach(function (oDir) {
console.log('rmdir %s', oDir);
});
}
});
program.parse(process.argv);
```
The variadic argument is passed to the action handler as an array. (And this also applies to `program.args`.)
### Action handler (sub)commands
You can add options to a command that uses an action handler.
The action handler gets passed a parameter for each argument you declared, and one additional argument which is the
command object itself. This command argument has the values for the command-specific options added as properties.
```js
const program = require('commander');
program
.command('rm ')
.option('-r, --recursive', 'Remove recursively')
.action(function (dir, cmdObj) {
console.log('remove ' + dir + (cmdObj.recursive ? ' recursively' : ''))
})
program.parse(process.argv)
```
You may supply an `async` action handler, in which case you call `.parseAsync` rather than `.parse`.
```js
async function run() { /* code goes here */ }
async function main() {
program
.command('run')
.action(run);
await program.parseAsync(process.argv);
}
```
A command's options on the command line are validated when the command is used. Any unknown options will be reported as an error. However, if an action-based command does not define an action, then the options are not validated.
Configuration options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the command from the generated help output.
### Git-style executable (sub)commands
When `.command()` is invoked with a description argument, this tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools.
Commander will search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-subcommand`, like `pm-install`, `pm-search`.
You can specify a custom name with the `executableFile` configuration option.
You handle the options for an executable (sub)command in the executable, and don't declare them at the top-level.
```js
// file: ./examples/pm
const program = require('commander');
program
.version('0.1.0')
.command('install [name]', 'install one or more packages')
.command('search [query]', 'search with optional query')
.command('update', 'update installed packages', {executableFile: 'myUpdateSubCommand'})
.command('list', 'list packages installed', {isDefault: true})
.parse(process.argv);
```
Configuration options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the command from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified.
Specifying a name with `executableFile` will override the default constructed name.
If the program is designed to be installed globally, make sure the executables have proper modes, like `755`.
## Automated --help
The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
```bash
$ ./examples/pizza --help
Usage: pizza [options]
An application for pizzas ordering
Options:
-V, --version output the version number
-p, --peppers Add peppers
-P, --pineapple Add pineapple
-b, --bbq Add bbq sauce
-c, --cheese Add the specified type of cheese (default: "marble")
-C, --no-cheese You do not want any cheese
-h, --help output usage information
```
### Custom help
You can display arbitrary `-h, --help` information
by listening for "--help". Commander will automatically
exit once you are done so that the remainder of your program
does not execute causing undesired behaviors, for example
in the following executable "stuff" will not output when
`--help` is used.
```js
#!/usr/bin/env node
const program = require('commander');
program
.version('0.1.0')
.option('-f, --foo', 'enable some foo')
.option('-b, --bar', 'enable some bar')
.option('-B, --baz', 'enable some baz');
// must be before .parse() since
// node's emit() is immediate
program.on('--help', function(){
console.log('')
console.log('Examples:');
console.log(' $ custom-help --help');
console.log(' $ custom-help -h');
});
program.parse(process.argv);
console.log('stuff');
```
Yields the following help output when `node script-name.js -h` or `node script-name.js --help` are run:
```Text
Usage: custom-help [options]
Options:
-h, --help output usage information
-V, --version output the version number
-f, --foo enable some foo
-b, --bar enable some bar
-B, --baz enable some baz
Examples:
$ custom-help --help
$ custom-help -h
```
### .usage and .name
These allow you to customise the usage description in the first line of the help. The name is otherwise
deduced from the (full) program arguments. Given:
```js
program
.name("my-command")
.usage("[global options] command")
```
The help will start with:
```Text
Usage: my-command [global options] command
```
### .outputHelp(cb)
Output help information without exiting.
Optional callback cb allows post-processing of help text before it is displayed.
If you want to display help by default (e.g. if no command was provided), you can use something like:
```js
const program = require('commander');
const colors = require('colors');
program
.version('0.1.0')
.command('getstream [url]', 'get stream URL')
.parse(process.argv);
if (!process.argv.slice(2).length) {
program.outputHelp(make_red);
}
function make_red(txt) {
return colors.red(txt); //display the help text in red on the console
}
```
### .helpOption(flags, description)
Override the default help flags and description.
```js
program
.helpOption('-e, --HELP', 'read more information');
```
### .help(cb)
Output help information and exit immediately.
Optional callback cb allows post-processing of help text before it is displayed.
## Custom event listeners
You can execute custom actions by listening to command and option events.
```js
program.on('option:verbose', function () {
process.env.VERBOSE = this.verbose;
});
// error on unknown commands
program.on('command:*', function () {
console.error('Invalid command: %s\nSee --help for a list of available commands.', program.args.join(' '));
process.exit(1);
});
```
## Bits and pieces
### Avoiding option name clashes
The original and default behaviour is that the option values are stored
as properties on the program, and the action handler is passed a
command object with the options values stored as properties.
This is very convenient to code, but the downside is possible clashes with
existing properties of Command.
There are two new routines to change the behaviour, and the default behaviour may change in the future:
- `storeOptionsAsProperties`: whether to store option values as properties on command object, or store separately (specify false) and access using `.opts()`
- `passCommandToAction`: whether to pass command to action handler,
or just the options (specify false)
```js
// file: ./examples/storeOptionsAsProperties.action.js
program
.storeOptionsAsProperties(false)
.passCommandToAction(false);
program
.name('my-program-name')
.option('-n,--name ');
program
.command('show')
.option('-a,--action ')
.action((options) => {
console.log(options.action);
});
program.parse(process.argv);
const programOptions = program.opts();
console.log(programOptions.name);
```
### TypeScript
The Commander package includes its TypeScript Definition file, but also requires the node types which you need to install yourself. e.g.
```bash
npm install commander
npm install --save-dev @types/node
```
If you use `ts-node` and git-style sub-commands written as `.ts` files, you need to call your program through node to get the sub-commands called correctly. e.g.
```bash
node -r ts-node/register pm.ts
```
### Node options such as `--harmony`
You can enable `--harmony` option in two ways:
- Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. (Note Windows does not support this pattern.)
- Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process.
### Node debugging
If you are using the node inspector for [debugging](https://nodejs.org/en/docs/guides/debugging-getting-started/) git-style executable (sub)commands using `node --inspect` et al,
the inspector port is incremented by 1 for the spawned subcommand.
### Override exit handling
By default Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override
this behaviour and optionally supply a callback. The default override throws a `CommanderError`.
The override callback is passed a `CommanderError` with properties `exitCode` number, `code` string, and `message`. The default override behaviour is to throw the error, except for async handling of executable subcommand completion which carries on. The normal display of error messages or version or help
is not affected by the override which is called after the display.
``` js
program.exitOverride();
try {
program.parse(process.argv);
} catch (err) {
// custom processing...
}
```
## Examples
```js
const program = require('commander');
program
.version('0.1.0')
.option('-C, --chdir ', 'change the working directory')
.option('-c, --config ', 'set config path. defaults to ./deploy.conf')
.option('-T, --no-tests', 'ignore test hook');
program
.command('setup [env]')
.description('run setup commands for all envs')
.option("-s, --setup_mode [mode]", "Which setup mode to use")
.action(function(env, options){
const mode = options.setup_mode || "normal";
env = env || 'all';
console.log('setup for %s env(s) with %s mode', env, mode);
});
program
.command('exec ')
.alias('ex')
.description('execute the given remote cmd')
.option("-e, --exec_mode ", "Which exec mode to use")
.action(function(cmd, options){
console.log('exec "%s" using %s mode', cmd, options.exec_mode);
}).on('--help', function() {
console.log('');
console.log('Examples:');
console.log('');
console.log(' $ deploy exec sequential');
console.log(' $ deploy exec async');
});
program
.command('*')
.action(function(env){
console.log('deploying "%s"', env);
});
program.parse(process.argv);
```
More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory.
## License
[MIT](https://github.com/tj/commander.js/blob/master/LICENSE)
## Support
Commander 4.x is supported on Node 8 and above, and is likely to work with Node 6 but not tested.
(For versions of Node below Node 6, use Commander 3.x or 2.x.)
The main forum for free and community support is the project [Issues](https://github.com/tj/commander.js/issues) on GitHub.
### Commander for enterprise
Available as part of the Tidelift Subscription
The maintainers of Commander and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-commander?utm_source=npm-commander&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
node_modules/commander/CHANGELOG.md 0000666 00000035650 15042511722 0013013 0 ustar 00 # Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). (Format adopted after v3.0.0.)
## [4.1.1] (2020-02-02)
### Fixed
* TypeScript definition for `.action()` should include Promise for async ([#1157])
## [4.1.0] (2020-01-06)
### Added
* two routines to change how option values are handled, and eliminate name clashes with command properties ([#933] [#1102])
* see storeOptionsAsProperties and passCommandToAction in README
* `.parseAsync` to use instead of `.parse` if supply async action handlers ([#806] [#1118])
### Fixed
* Remove trailing blanks from wrapped help text ([#1096])
### Changed
* update dependencies
* extend security coverage for Commander 2.x to 2020-02-03
* improvements to README
* improvements to TypeScript definition documentation
* move old versions out of main CHANGELOG
* removed explicit use of `ts-node` in tests
## [4.0.1] (2019-11-12)
### Fixed
* display help when requested, even if there are missing required options ([#1091])
## [4.0.0] (2019-11-02)
### Added
* automatically wrap and indent help descriptions for options and commands ([#1051])
* `.exitOverride()` allows override of calls to `process.exit` for additional error handling and to keep program running ([#1040])
* support for declaring required options with `.requiredOptions()` ([#1071])
* GitHub Actions support ([#1027])
* translation links in README
### Changed
* dev: switch tests from Sinon+Should to Jest with major rewrite of tests ([#1035])
* call default subcommand even when there are unknown options ([#1047])
* *Breaking* Commander is only officially supported on Node 8 and above, and requires Node 6 ([#1053])
### Fixed
* *Breaking* keep command object out of program.args when action handler called ([#1048])
* also, action handler now passed array of unknown arguments
* complain about unknown options when program argument supplied and action handler ([#1049])
* this changes parameters to `command:*` event to include unknown arguments
* removed deprecated `customFds` option from call to `child_process.spawn` ([#1052])
* rework TypeScript declarations to bring all types into imported namespace ([#1081])
### Migration Tips
#### Testing for no arguments
If you were previously using code like:
```js
if (!program.args.length) ...
```
a partial replacement is:
```js
if (program.rawArgs.length < 3) ...
```
## [4.0.0-1] Prerelease (2019-10-08)
(Released in 4.0.0)
## [4.0.0-0] Prerelease (2019-10-01)
(Released in 4.0.0)
## [2.20.1] (2019-09-29)
### Fixed
* Improve tracking of executable subcommands.
### Changed
* update development dependencies
## [3.0.2] (2019-09-27)
### Fixed
* Improve tracking of executable subcommands.
### Changed
* update development dependencies
## [3.0.1] (2019-08-30)
### Added
* .name and .usage to README ([#1010])
* Table of Contents to README ([#1010])
* TypeScript definition for `executableFile` in CommandOptions ([#1028])
### Changed
* consistently use `const` rather than `var` in README ([#1026])
### Fixed
* help for sub commands with custom executableFile ([#1018])
## [3.0.0] / 2019-08-08
* Add option to specify executable file name ([#999])
* e.g. `.command('clone', 'clone description', { executableFile: 'myClone' })`
* Change docs for `.command` to contrast action handler vs git-style executable. ([#938] [#990])
* **Breaking** Change TypeScript to use overloaded function for `.command`. ([#938] [#990])
* Change to use straight quotes around strings in error messages (like 'this' instead of `this') ([#915])
* Add TypeScript "reference types" for node ([#974])
* Add support for hyphen as an option argument in subcommands ([#697])
* Add support for a short option flag and its value to be concatenated for action handler subcommands ([#599])
* e.g. `-p 80` can also be supplied as `-p80`
* Add executable arguments to spawn in win32, for git-style executables ([#611])
* e.g. `node --harmony myCommand.js clone`
* Add parent command as prefix of subcommand in help ([#980])
* Add optional custom description to `.version` ([#963])
* e.g. `program.version('0.0.1', '-v, --vers', 'output the current version')`
* Add `.helpOption(flags, description)` routine to customise help flags and description ([#963])
* e.g. `.helpOption('-e, --HELP', 'read more information')`
* Fix behavior of --no-* options ([#795])
* can now define both `--foo` and `--no-foo`
* **Breaking** custom event listeners: `--no-foo` on cli now emits `option:no-foo` (previously `option:foo`)
* **Breaking** default value: defining `--no-foo` after defining `--foo` leaves the default value unchanged (previously set it to false)
* allow boolean default value, such as from environment ([#987])
* Increment inspector port for spawned subcommands ([#991])
* e.g. `node --inspect myCommand.js clone`
### Migration Tips
The custom event for a negated option like `--no-foo` is `option:no-foo` (previously `option:foo`).
```js
program
.option('--no-foo')
.on('option:no-foo', () => {
console.log('removing foo');
});
```
When using TypeScript, adding a command does not allow an explicit `undefined` for an unwanted executable description (e.g
for a command with an action handler).
```js
program
.command('action1', undefined, { noHelp: true }) // No longer valid
.command('action2', { noHelp: true }) // Correct
```
## 3.0.0-0 Prerelease / 2019-07-28
(Released as 3.0.0)
## 2.20.0 / 2019-04-02
* fix: resolve symbolic links completely when hunting for subcommands (#935)
* Update index.d.ts (#930)
* Update Readme.md (#924)
* Remove --save option as it isn't required anymore (#918)
* Add link to the license file (#900)
* Added example of receiving args from options (#858)
* Added missing semicolon (#882)
* Add extension to .eslintrc (#876)
## 2.19.0 / 2018-10-02
* Removed newline after Options and Commands headers (#864)
* Bugfix - Error output (#862)
* Fix to change default value to string (#856)
## 2.18.0 / 2018-09-07
* Standardize help output (#853)
* chmod 644 travis.yml (#851)
* add support for execute typescript subcommand via ts-node (#849)
## 2.17.1 / 2018-08-07
* Fix bug in command emit (#844)
## 2.17.0 / 2018-08-03
* fixed newline output after help information (#833)
* Fix to emit the action even without command (#778)
* npm update (#823)
## 2.16.0 / 2018-06-29
* Remove Makefile and `test/run` (#821)
* Make 'npm test' run on Windows (#820)
* Add badge to display install size (#807)
* chore: cache node_modules (#814)
* chore: remove Node.js 4 (EOL), add Node.js 10 (#813)
* fixed typo in readme (#812)
* Fix types (#804)
* Update eslint to resolve vulnerabilities in lodash (#799)
* updated readme with custom event listeners. (#791)
* fix tests (#794)
## 2.15.0 / 2018-03-07
* Update downloads badge to point to graph of downloads over time instead of duplicating link to npm
* Arguments description
## 2.14.1 / 2018-02-07
* Fix typing of help function
## 2.14.0 / 2018-02-05
* only register the option:version event once
* Fixes issue #727: Passing empty string for option on command is set to undefined
* enable eqeqeq rule
* resolves #754 add linter configuration to project
* resolves #560 respect custom name for version option
* document how to override the version flag
* document using options per command
## 2.13.0 / 2018-01-09
* Do not print default for --no-
* remove trailing spaces in command help
* Update CI's Node.js to LTS and latest version
* typedefs: Command and Option types added to commander namespace
## 2.12.2 / 2017-11-28
* fix: typings are not shipped
## 2.12.1 / 2017-11-23
* Move @types/node to dev dependency
## 2.12.0 / 2017-11-22
* add attributeName() method to Option objects
* Documentation updated for options with --no prefix
* typings: `outputHelp` takes a string as the first parameter
* typings: use overloads
* feat(typings): update to match js api
* Print default value in option help
* Fix translation error
* Fail when using same command and alias (#491)
* feat(typings): add help callback
* fix bug when description is add after command with options (#662)
* Format js code
* Rename History.md to CHANGELOG.md (#668)
* feat(typings): add typings to support TypeScript (#646)
* use current node
## 2.11.0 / 2017-07-03
* Fix help section order and padding (#652)
* feature: support for signals to subcommands (#632)
* Fixed #37, --help should not display first (#447)
* Fix translation errors. (#570)
* Add package-lock.json
* Remove engines
* Upgrade package version
* Prefix events to prevent conflicts between commands and options (#494)
* Removing dependency on graceful-readlink
* Support setting name in #name function and make it chainable
* Add .vscode directory to .gitignore (Visual Studio Code metadata)
* Updated link to ruby commander in readme files
## 2.10.0 / 2017-06-19
* Update .travis.yml. drop support for older node.js versions.
* Fix require arguments in README.md
* On SemVer you do not start from 0.0.1
* Add missing semi colon in readme
* Add save param to npm install
* node v6 travis test
* Update Readme_zh-CN.md
* Allow literal '--' to be passed-through as an argument
* Test subcommand alias help
* link build badge to master branch
* Support the alias of Git style sub-command
* added keyword commander for better search result on npm
* Fix Sub-Subcommands
* test node.js stable
* Fixes TypeError when a command has an option called `--description`
* Update README.md to make it beginner friendly and elaborate on the difference between angled and square brackets.
* Add chinese Readme file
## 2.9.0 / 2015-10-13
* Add option `isDefault` to set default subcommand #415 @Qix-
* Add callback to allow filtering or post-processing of help text #434 @djulien
* Fix `undefined` text in help information close #414 #416 @zhiyelee
## 2.8.1 / 2015-04-22
* Back out `support multiline description` Close #396 #397
## 2.8.0 / 2015-04-07
* Add `process.execArg` support, execution args like `--harmony` will be passed to sub-commands #387 @DigitalIO @zhiyelee
* Fix bug in Git-style sub-commands #372 @zhiyelee
* Allow commands to be hidden from help #383 @tonylukasavage
* When git-style sub-commands are in use, yet none are called, display help #382 @claylo
* Add ability to specify arguments syntax for top-level command #258 @rrthomas
* Support multiline descriptions #208 @zxqfox
## 2.7.1 / 2015-03-11
* Revert #347 (fix collisions when option and first arg have same name) which causes a bug in #367.
## 2.7.0 / 2015-03-09
* Fix git-style bug when installed globally. Close #335 #349 @zhiyelee
* Fix collisions when option and first arg have same name. Close #346 #347 @tonylukasavage
* Add support for camelCase on `opts()`. Close #353 @nkzawa
* Add node.js 0.12 and io.js to travis.yml
* Allow RegEx options. #337 @palanik
* Fixes exit code when sub-command failing. Close #260 #332 @pirelenito
* git-style `bin` files in $PATH make sense. Close #196 #327 @zhiyelee
## 2.6.0 / 2014-12-30
* added `Command#allowUnknownOption` method. Close #138 #318 @doozr @zhiyelee
* Add application description to the help msg. Close #112 @dalssoft
## 2.5.1 / 2014-12-15
* fixed two bugs incurred by variadic arguments. Close #291 @Quentin01 #302 @zhiyelee
## 2.5.0 / 2014-10-24
* add support for variadic arguments. Closes #277 @whitlockjc
## 2.4.0 / 2014-10-17
* fixed a bug on executing the coercion function of subcommands option. Closes #270
* added `Command.prototype.name` to retrieve command name. Closes #264 #266 @tonylukasavage
* added `Command.prototype.opts` to retrieve all the options as a simple object of key-value pairs. Closes #262 @tonylukasavage
* fixed a bug on subcommand name. Closes #248 @jonathandelgado
* fixed function normalize doesn’t honor option terminator. Closes #216 @abbr
## 2.3.0 / 2014-07-16
* add command alias'. Closes PR #210
* fix: Typos. Closes #99
* fix: Unused fs module. Closes #217
## 2.2.0 / 2014-03-29
* add passing of previous option value
* fix: support subcommands on windows. Closes #142
* Now the defaultValue passed as the second argument of the coercion function.
## 2.1.0 / 2013-11-21
* add: allow cflag style option params, unit test, fixes #174
## 2.0.0 / 2013-07-18
* remove input methods (.prompt, .confirm, etc)
## Older versions
* [1.x](./changelogs/CHANGELOG-1.md)
* [0.x](./changelogs/CHANGELOG-0.md)
[#599]: https://github.com/tj/commander.js/issues/599
[#611]: https://github.com/tj/commander.js/issues/611
[#697]: https://github.com/tj/commander.js/issues/697
[#795]: https://github.com/tj/commander.js/issues/795
[#806]: https://github.com/tj/commander.js/issues/806
[#915]: https://github.com/tj/commander.js/issues/915
[#938]: https://github.com/tj/commander.js/issues/938
[#963]: https://github.com/tj/commander.js/issues/963
[#974]: https://github.com/tj/commander.js/issues/974
[#980]: https://github.com/tj/commander.js/issues/980
[#987]: https://github.com/tj/commander.js/issues/987
[#990]: https://github.com/tj/commander.js/issues/990
[#991]: https://github.com/tj/commander.js/issues/991
[#993]: https://github.com/tj/commander.js/issues/993
[#999]: https://github.com/tj/commander.js/issues/999
[#1010]: https://github.com/tj/commander.js/pull/1010
[#1018]: https://github.com/tj/commander.js/pull/1018
[#1026]: https://github.com/tj/commander.js/pull/1026
[#1027]: https://github.com/tj/commander.js/pull/1027
[#1028]: https://github.com/tj/commander.js/pull/1028
[#1035]: https://github.com/tj/commander.js/pull/1035
[#1040]: https://github.com/tj/commander.js/pull/1040
[#1047]: https://github.com/tj/commander.js/pull/1047
[#1048]: https://github.com/tj/commander.js/pull/1048
[#1049]: https://github.com/tj/commander.js/pull/1049
[#1051]: https://github.com/tj/commander.js/pull/1051
[#1052]: https://github.com/tj/commander.js/pull/1052
[#1053]: https://github.com/tj/commander.js/pull/1053
[#1071]: https://github.com/tj/commander.js/pull/1071
[#1081]: https://github.com/tj/commander.js/pull/1081
[#1091]: https://github.com/tj/commander.js/pull/1091
[#1096]: https://github.com/tj/commander.js/pull/1096
[#1102]: https://github.com/tj/commander.js/pull/1102
[#1118]: https://github.com/tj/commander.js/pull/1118
[#1157]: https://github.com/tj/commander.js/pull/1157
[Unreleased]: https://github.com/tj/commander.js/compare/master...develop
[4.1.1]: https://github.com/tj/commander.js/compare/v4.0.0..v4.1.1
[4.1.0]: https://github.com/tj/commander.js/compare/v4.0.1..v4.1.0
[4.0.1]: https://github.com/tj/commander.js/compare/v4.0.0..v4.0.1
[4.0.0]: https://github.com/tj/commander.js/compare/v3.0.2..v4.0.0
[4.0.0-1]: https://github.com/tj/commander.js/compare/v4.0.0-0..v4.0.0-1
[4.0.0-0]: https://github.com/tj/commander.js/compare/v3.0.2...v4.0.0-0
[3.0.2]: https://github.com/tj/commander.js/compare/v3.0.1...v3.0.2
[3.0.1]: https://github.com/tj/commander.js/compare/v3.0.0...v3.0.1
[3.0.0]: https://github.com/tj/commander.js/compare/v2.20.1...v3.0.0
[2.20.1]: https://github.com/tj/commander.js/compare/v2.20.0...v2.20.1
node_modules/commander/LICENSE 0000666 00000002112 15042511722 0012172 0 ustar 00 (The MIT License)
Copyright (c) 2011 TJ Holowaychuk
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.
node_modules/commander/package.json 0000666 00000001641 15042511722 0013461 0 ustar 00 {
"name": "commander",
"version": "4.1.1",
"description": "the complete solution for node.js command-line programs",
"keywords": [
"commander",
"command",
"option",
"parser"
],
"author": "TJ Holowaychuk ",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/tj/commander.js.git"
},
"scripts": {
"lint": "eslint index.js \"tests/**/*.js\"",
"test": "jest && npm run test-typings",
"test-typings": "tsc -p tsconfig.json"
},
"main": "index",
"files": [
"index.js",
"typings/index.d.ts"
],
"dependencies": {},
"devDependencies": {
"@types/jest": "^24.0.23",
"@types/node": "^12.12.11",
"eslint": "^6.7.0",
"eslint-plugin-jest": "^22.21.0",
"jest": "^24.8.0",
"standard": "^14.3.1",
"typescript": "^3.7.2"
},
"typings": "typings/index.d.ts",
"engines": {
"node": ">= 6"
}
}
node_modules/.bin/terser 0000666 00000000456 15042511722 0011306 0 ustar 00 #!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../terser/bin/terser" "$@"
else
exec node "$basedir/../terser/bin/terser" "$@"
fi
node_modules/.bin/terser.cmd 0000777 00000000502 15042511722 0012043 0 ustar 00 @ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\terser\bin\terser" %*
node_modules/.bin/terser.ps1 0000666 00000001431 15042511722 0012002 0 ustar 00 #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../terser/bin/terser" $args
} else {
& "$basedir/node$exe" "$basedir/../terser/bin/terser" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../terser/bin/terser" $args
} else {
& "node$exe" "$basedir/../terser/bin/terser" $args
}
$ret=$LASTEXITCODE
}
exit $ret
node_modules/clean-css/index.js 0000666 00000000051 15042511722 0012535 0 ustar 00 module.exports = require('./lib/clean');
node_modules/clean-css/README.md 0000666 00000104035 15042511722 0012356 0 ustar 00
[](https://www.npmjs.com/package/clean-css)
[](https://travis-ci.org/jakubpawlowicz/clean-css)
[](https://ci.appveyor.com/project/jakubpawlowicz/clean-css/branch/master)
[](https://david-dm.org/jakubpawlowicz/clean-css)
[](https://npmcharts.com/compare/clean-css?minimal=true)
[](https://twitter.com/cleancss)
clean-css is a fast and efficient CSS optimizer for [Node.js](http://nodejs.org/) platform and [any modern browser](https://jakubpawlowicz.github.io/clean-css).
According to [tests](http://goalsmashers.github.io/css-minification-benchmark/) it is one of the best available.
**Table of Contents**
- [Node.js version support](#nodejs-version-support)
- [Install](#install)
- [Use](#use)
* [Important: 4.0 breaking changes](#important-40-breaking-changes)
* [What's new in version 4.1](#whats-new-in-version-41)
* [What's new in version 4.2](#whats-new-in-version-42)
* [Constructor options](#constructor-options)
* [Compatibility modes](#compatibility-modes)
* [Fetch option](#fetch-option)
* [Formatting options](#formatting-options)
* [Inlining options](#inlining-options)
* [Optimization levels](#optimization-levels)
+ [Level 0 optimizations](#level-0-optimizations)
+ [Level 1 optimizations](#level-1-optimizations)
+ [Level 2 optimizations](#level-2-optimizations)
* [Minify method](#minify-method)
* [Promise interface](#promise-interface)
* [CLI utility](#cli-utility)
- [FAQ](#faq)
* [How to optimize multiple files?](#how-to-optimize-multiple-files)
* [How to process remote `@import`s correctly?](#how-to-process-remote-imports-correctly)
* [How to apply arbitrary transformations to CSS properties?](#how-to-apply-arbitrary-transformations-to-css-properties)
* [How to specify a custom rounding precision?](#how-to-specify-a-custom-rounding-precision)
* [How to keep a CSS fragment intact?](#how-to-keep-a-css-fragment-intact)
* [How to preserve a comment block?](#how-to-preserve-a-comment-block)
* [How to rebase relative image URLs?](#how-to-rebase-relative-image-urls)
* [How to work with source maps?](#how-to-work-with-source-maps)
* [How to apply level 1 & 2 optimizations at the same time?](#how-to-apply-level-1--2-optimizations-at-the-same-time)
* [What level 2 optimizations do?](#what-level-2-optimizations-do)
* [How to use clean-css with build tools?](#how-to-use-clean-css-with-build-tools)
* [How to use clean-css from web browser?](#how-to-use-clean-css-from-web-browser)
- [Contributing](#contributing)
* [How to get started?](#how-to-get-started)
- [Acknowledgments](#acknowledgments)
- [License](#license)
# Node.js version support
clean-css requires Node.js 4.0+ (tested on Linux, OS X, and Windows)
# Install
```
npm install --save-dev clean-css
```
# Use
```js
var CleanCSS = require('clean-css');
var input = 'a{font-weight:bold;}';
var options = { /* options */ };
var output = new CleanCSS(options).minify(input);
```
## Important: 4.0 breaking changes
clean-css 4.0 introduces some breaking changes:
* API and CLI interfaces are split, so API stays in this repository while CLI moves to [clean-css-cli](https://github.com/jakubpawlowicz/clean-css-cli);
* `root`, `relativeTo`, and `target` options are replaced by a single `rebaseTo` option - this means that rebasing URLs and import inlining is much simpler but may not be (YMMV) as powerful as in 3.x;
* `debug` option is gone as stats are always provided in output object under `stats` property;
* `roundingPrecision` is disabled by default;
* `roundingPrecision` applies to **all** units now, not only `px` as in 3.x;
* `processImport` and `processImportFrom` are merged into `inline` option which defaults to `local`. Remote `@import` rules are **NOT** inlined by default anymore;
* splits `inliner: { request: ..., timeout: ... }` option into `inlineRequest` and `inlineTimeout` options;
* remote resources without a protocol, e.g. `//fonts.googleapis.com/css?family=Domine:700`, are not inlined anymore;
* changes default Internet Explorer compatibility from 9+ to 10+, to revert the old default use `{ compatibility: 'ie9' }` flag;
* renames `keepSpecialComments` to `specialComments`;
* moves `roundingPrecision` and `specialComments` to level 1 optimizations options, see examples;
* moves `mediaMerging`, `restructuring`, `semanticMerging`, and `shorthandCompacting` to level 2 optimizations options, see examples below;
* renames `shorthandCompacting` option to `mergeIntoShorthands`;
* level 1 optimizations are the new default, up to 3.x it was level 2;
* `keepBreaks` option is replaced with `{ format: 'keep-breaks' }` to ease transition;
* `sourceMap` option has to be a boolean from now on - to specify an input source map pass it a 2nd argument to `minify` method or via a hash instead;
* `aggressiveMerging` option is removed as aggressive merging is replaced by smarter override merging.
## What's new in version 4.1
clean-css 4.1 introduces the following changes / features:
* `inline: false` as an alias to `inline: ['none']`;
* `multiplePseudoMerging` compatibility flag controlling merging of rules with multiple pseudo classes / elements;
* `removeEmpty` flag in level 1 optimizations controlling removal of rules and nested blocks;
* `removeEmpty` flag in level 2 optimizations controlling removal of rules and nested blocks;
* `compatibility: { selectors: { mergeLimit: } }` flag in compatibility settings controlling maximum number of selectors in a single rule;
* `minify` method improved signature accepting a list of hashes for a predictable traversal;
* `selectorsSortingMethod` level 1 optimization allows `false` or `'none'` for disabling selector sorting;
* `fetch` option controlling a function for handling remote requests;
* new `font` shorthand and `font-*` longhand optimizers;
* removal of `optimizeFont` flag in level 1 optimizations due to new `font` shorthand optimizer;
* `skipProperties` flag in level 2 optimizations controlling which properties won't be optimized;
* new `animation` shorthand and `animation-*` longhand optimizers;
* `removeUnusedAtRules` level 2 optimization controlling removal of unused `@counter-style`, `@font-face`, `@keyframes`, and `@namespace` at rules;
* the [web interface](https://jakubpawlowicz.github.io/clean-css) gets an improved settings panel with "reset to defaults", instant option changes, and settings being persisted across sessions.
## What's new in version 4.2
clean-css 4.2 introduces the following changes / features:
* Adds `process` method for compatibility with optimize-css-assets-webpack-plugin;
* new `transition` property optimizer;
* preserves any CSS content between `/* clean-css ignore:start */` and `/* clean-css ignore:end */` comments;
* allows filtering based on selector in `transform` callback, see [example](#how-to-apply-arbitrary-transformations-to-css-properties);
* adds configurable line breaks via `format: { breakWith: 'lf' }` option.
## Constructor options
clean-css constructor accepts a hash as a parameter with the following options available:
* `compatibility` - controls compatibility mode used; defaults to `ie10+`; see [compatibility modes](#compatibility-modes) for examples;
* `fetch` - controls a function for handling remote requests; see [fetch option](#fetch-option) for examples (since 4.1.0);
* `format` - controls output CSS formatting; defaults to `false`; see [formatting options](#formatting-options) for examples;
* `inline` - controls `@import` inlining rules; defaults to `'local'`; see [inlining options](#inlining-options) for examples;
* `inlineRequest` - controls extra options for inlining remote `@import` rules, can be any of [HTTP(S) request options](https://nodejs.org/api/http.html#http_http_request_options_callback);
* `inlineTimeout` - controls number of milliseconds after which inlining a remote `@import` fails; defaults to 5000;
* `level` - controls optimization level used; defaults to `1`; see [optimization levels](#optimization-levels) for examples;
* `rebase` - controls URL rebasing; defaults to `true`;
* `rebaseTo` - controls a directory to which all URLs are rebased, most likely the directory under which the output file will live; defaults to the current directory;
* `returnPromise` - controls whether `minify` method returns a Promise object or not; defaults to `false`; see [promise interface](#promise-interface) for examples;
* `sourceMap` - controls whether an output source map is built; defaults to `false`;
* `sourceMapInlineSources` - controls embedding sources inside a source map's `sourcesContent` field; defaults to false.
## Compatibility modes
There is a certain number of compatibility mode shortcuts, namely:
* `new CleanCSS({ compatibility: '*' })` (default) - Internet Explorer 10+ compatibility mode
* `new CleanCSS({ compatibility: 'ie9' })` - Internet Explorer 9+ compatibility mode
* `new CleanCSS({ compatibility: 'ie8' })` - Internet Explorer 8+ compatibility mode
* `new CleanCSS({ compatibility: 'ie7' })` - Internet Explorer 7+ compatibility mode
Each of these modes is an alias to a [fine grained configuration](https://github.com/jakubpawlowicz/clean-css/blob/master/lib/options/compatibility.js), with the following options available:
```js
new CleanCSS({
compatibility: {
colors: {
opacity: true // controls `rgba()` / `hsla()` color support
},
properties: {
backgroundClipMerging: true, // controls background-clip merging into shorthand
backgroundOriginMerging: true, // controls background-origin merging into shorthand
backgroundSizeMerging: true, // controls background-size merging into shorthand
colors: true, // controls color optimizations
ieBangHack: false, // controls keeping IE bang hack
ieFilters: false, // controls keeping IE `filter` / `-ms-filter`
iePrefixHack: false, // controls keeping IE prefix hack
ieSuffixHack: false, // controls keeping IE suffix hack
merging: true, // controls property merging based on understandability
shorterLengthUnits: false, // controls shortening pixel units into `pc`, `pt`, or `in` units
spaceAfterClosingBrace: true, // controls keeping space after closing brace - `url() no-repeat` into `url()no-repeat`
urlQuotes: false, // controls keeping quoting inside `url()`
zeroUnits: true // controls removal of units `0` value
},
selectors: {
adjacentSpace: false, // controls extra space before `nav` element
ie7Hack: true, // controls removal of IE7 selector hacks, e.g. `*+html...`
mergeablePseudoClasses: [':active', ...], // controls a whitelist of mergeable pseudo classes
mergeablePseudoElements: ['::after', ...], // controls a whitelist of mergeable pseudo elements
mergeLimit: 8191, // controls maximum number of selectors in a single rule (since 4.1.0)
multiplePseudoMerging: true // controls merging of rules with multiple pseudo classes / elements (since 4.1.0)
},
units: {
ch: true, // controls treating `ch` as a supported unit
in: true, // controls treating `in` as a supported unit
pc: true, // controls treating `pc` as a supported unit
pt: true, // controls treating `pt` as a supported unit
rem: true, // controls treating `rem` as a supported unit
vh: true, // controls treating `vh` as a supported unit
vm: true, // controls treating `vm` as a supported unit
vmax: true, // controls treating `vmax` as a supported unit
vmin: true // controls treating `vmin` as a supported unit
}
}
})
```
You can also use a string when setting a compatibility mode, e.g.
```js
new CleanCSS({
compatibility: 'ie9,-properties.merging' // sets compatibility to IE9 mode with disabled property merging
})
```
## Fetch option
The `fetch` option accepts a function which handles remote resource fetching, e.g.
```js
var request = require('request');
var source = '@import url(http://example.com/path/to/stylesheet.css);';
new CleanCSS({
fetch: function (uri, inlineRequest, inlineTimeout, callback) {
request(uri, function (error, response, body) {
if (error) {
callback(error, null);
} else if (response && response.statusCode != 200) {
callback(response.statusCode, null);
} else {
callback(null, body);
}
});
}
}).minify(source);
```
This option provides a convenient way of overriding the default fetching logic if it doesn't support a particular feature, say CONNECT proxies.
Unless given, the default [loadRemoteResource](https://github.com/jakubpawlowicz/clean-css/blob/master/lib/reader/load-remote-resource.js) logic is used.
## Formatting options
By default output CSS is formatted without any whitespace unless a `format` option is given.
First of all there are two shorthands:
```js
new CleanCSS({
format: 'beautify' // formats output in a really nice way
})
```
and
```js
new CleanCSS({
format: 'keep-breaks' // formats output the default way but adds line breaks for improved readability
})
```
however `format` option also accept a fine-grained set of options:
```js
new CleanCSS({
format: {
breaks: { // controls where to insert breaks
afterAtRule: false, // controls if a line break comes after an at-rule; e.g. `@charset`; defaults to `false`
afterBlockBegins: false, // controls if a line break comes after a block begins; e.g. `@media`; defaults to `false`
afterBlockEnds: false, // controls if a line break comes after a block ends, defaults to `false`
afterComment: false, // controls if a line break comes after a comment; defaults to `false`
afterProperty: false, // controls if a line break comes after a property; defaults to `false`
afterRuleBegins: false, // controls if a line break comes after a rule begins; defaults to `false`
afterRuleEnds: false, // controls if a line break comes after a rule ends; defaults to `false`
beforeBlockEnds: false, // controls if a line break comes before a block ends; defaults to `false`
betweenSelectors: false // controls if a line break comes between selectors; defaults to `false`
},
breakWith: '\n', // controls the new line character, can be `'\r\n'` or `'\n'` (aliased as `'windows'` and `'unix'` or `'crlf'` and `'lf'`); defaults to system one, so former on Windows and latter on Unix
indentBy: 0, // controls number of characters to indent with; defaults to `0`
indentWith: 'space', // controls a character to indent with, can be `'space'` or `'tab'`; defaults to `'space'`
spaces: { // controls where to insert spaces
aroundSelectorRelation: false, // controls if spaces come around selector relations; e.g. `div > a`; defaults to `false`
beforeBlockBegins: false, // controls if a space comes before a block begins; e.g. `.block {`; defaults to `false`
beforeValue: false // controls if a space comes before a value; e.g. `width: 1rem`; defaults to `false`
},
wrapAt: false // controls maximum line length; defaults to `false`
}
})
```
## Inlining options
`inline` option whitelists which `@import` rules will be processed, e.g.
```js
new CleanCSS({
inline: ['local'] // default; enables local inlining only
})
```
```js
new CleanCSS({
inline: ['none'] // disables all inlining
})
```
```js
// introduced in clean-css 4.1.0
new CleanCSS({
inline: false // disables all inlining (alias to `['none']`)
})
```
```js
new CleanCSS({
inline: ['all'] // enables all inlining, same as ['local', 'remote']
})
```
```js
new CleanCSS({
inline: ['local', 'mydomain.example.com'] // enables local inlining plus given remote source
})
```
```js
new CleanCSS({
inline: ['local', 'remote', '!fonts.googleapis.com'] // enables all inlining but from given remote source
})
```
## Optimization levels
The `level` option can be either `0`, `1` (default), or `2`, e.g.
```js
new CleanCSS({
level: 2
})
```
or a fine-grained configuration given via a hash.
Please note that level 1 optimization options are generally safe while level 2 optimizations should be safe for most users.
### Level 0 optimizations
Level 0 optimizations simply means "no optimizations". Use it when you'd like to inline imports and / or rebase URLs but skip everything else.
### Level 1 optimizations
Level 1 optimizations (default) operate on single properties only, e.g. can remove units when not required, turn rgb colors to a shorter hex representation, remove comments, etc
Here is a full list of available options:
```js
new CleanCSS({
level: {
1: {
cleanupCharsets: true, // controls `@charset` moving to the front of a stylesheet; defaults to `true`
normalizeUrls: true, // controls URL normalization; defaults to `true`
optimizeBackground: true, // controls `background` property optimizations; defaults to `true`
optimizeBorderRadius: true, // controls `border-radius` property optimizations; defaults to `true`
optimizeFilter: true, // controls `filter` property optimizations; defaults to `true`
optimizeFont: true, // controls `font` property optimizations; defaults to `true`
optimizeFontWeight: true, // controls `font-weight` property optimizations; defaults to `true`
optimizeOutline: true, // controls `outline` property optimizations; defaults to `true`
removeEmpty: true, // controls removing empty rules and nested blocks; defaults to `true`
removeNegativePaddings: true, // controls removing negative paddings; defaults to `true`
removeQuotes: true, // controls removing quotes when unnecessary; defaults to `true`
removeWhitespace: true, // controls removing unused whitespace; defaults to `true`
replaceMultipleZeros: true, // contols removing redundant zeros; defaults to `true`
replaceTimeUnits: true, // controls replacing time units with shorter values; defaults to `true`
replaceZeroUnits: true, // controls replacing zero values with units; defaults to `true`
roundingPrecision: false, // rounds pixel values to `N` decimal places; `false` disables rounding; defaults to `false`
selectorsSortingMethod: 'standard', // denotes selector sorting method; can be `'natural'` or `'standard'`, `'none'`, or false (the last two since 4.1.0); defaults to `'standard'`
specialComments: 'all', // denotes a number of /*! ... */ comments preserved; defaults to `all`
tidyAtRules: true, // controls at-rules (e.g. `@charset`, `@import`) optimizing; defaults to `true`
tidyBlockScopes: true, // controls block scopes (e.g. `@media`) optimizing; defaults to `true`
tidySelectors: true, // controls selectors optimizing; defaults to `true`,
semicolonAfterLastProperty: false, // controls removing trailing semicolons in rule; defaults to `false` - means remove
transform: function () {} // defines a callback for fine-grained property optimization; defaults to no-op
}
}
});
```
There is an `all` shortcut for toggling all options at the same time, e.g.
```js
new CleanCSS({
level: {
1: {
all: false, // set all values to `false`
tidySelectors: true // turns on optimizing selectors
}
}
});
```
### Level 2 optimizations
Level 2 optimizations operate at rules or multiple properties level, e.g. can remove duplicate rules, remove properties redefined further down a stylesheet, or restructure rules by moving them around.
Please note that if level 2 optimizations are turned on then, unless explicitely disabled, level 1 optimizations are applied as well.
Here is a full list of available options:
```js
new CleanCSS({
level: {
2: {
mergeAdjacentRules: true, // controls adjacent rules merging; defaults to true
mergeIntoShorthands: true, // controls merging properties into shorthands; defaults to true
mergeMedia: true, // controls `@media` merging; defaults to true
mergeNonAdjacentRules: true, // controls non-adjacent rule merging; defaults to true
mergeSemantically: false, // controls semantic merging; defaults to false
overrideProperties: true, // controls property overriding based on understandability; defaults to true
removeEmpty: true, // controls removing empty rules and nested blocks; defaults to `true`
reduceNonAdjacentRules: true, // controls non-adjacent rule reducing; defaults to true
removeDuplicateFontRules: true, // controls duplicate `@font-face` removing; defaults to true
removeDuplicateMediaBlocks: true, // controls duplicate `@media` removing; defaults to true
removeDuplicateRules: true, // controls duplicate rules removing; defaults to true
removeUnusedAtRules: false, // controls unused at rule removing; defaults to false (available since 4.1.0)
restructureRules: false, // controls rule restructuring; defaults to false
skipProperties: [] // controls which properties won't be optimized, defaults to `[]` which means all will be optimized (since 4.1.0)
}
}
});
```
There is an `all` shortcut for toggling all options at the same time, e.g.
```js
new CleanCSS({
level: {
2: {
all: false, // sets all values to `false`
removeDuplicateRules: true // turns on removing duplicate rules
}
}
});
```
## Minify method
Once configured clean-css provides a `minify` method to optimize a given CSS, e.g.
```js
var output = new CleanCSS(options).minify(source);
```
The output of the `minify` method is a hash with following fields:
```js
console.log(output.styles); // optimized output CSS as a string
console.log(output.sourceMap); // output source map if requested with `sourceMap` option
console.log(output.errors); // a list of errors raised
console.log(output.warnings); // a list of warnings raised
console.log(output.stats.originalSize); // original content size after import inlining
console.log(output.stats.minifiedSize); // optimized content size
console.log(output.stats.timeSpent); // time spent on optimizations in milliseconds
console.log(output.stats.efficiency); // `(originalSize - minifiedSize) / originalSize`, e.g. 0.25 if size is reduced from 100 bytes to 75 bytes
```
The `minify` method also accepts an input source map, e.g.
```js
var output = new CleanCSS(options).minify(source, inputSourceMap);
```
or a callback invoked when optimizations are finished, e.g.
```js
new CleanCSS(options).minify(source, function (error, output) {
// `output` is the same as in the synchronous call above
});
```
## Promise interface
If you prefer clean-css to return a Promise object then you need to explicitely ask for it, e.g.
```js
new CleanCSS({ returnPromise: true })
.minify(source)
.then(function (output) { console.log(output.styles); })
.catch(function (error) { // deal with errors });
```
## CLI utility
Clean-css has an associated command line utility that can be installed separately using `npm install clean-css-cli`. For more detailed information, please visit https://github.com/jakubpawlowicz/clean-css-cli.
# FAQ
## How to optimize multiple files?
It can be done either by passing an array of paths, or, when sources are already available, a hash or an array of hashes:
```js
new CleanCSS().minify(['path/to/file/one', 'path/to/file/two']);
```
```js
new CleanCSS().minify({
'path/to/file/one': {
styles: 'contents of file one'
},
'path/to/file/two': {
styles: 'contents of file two'
}
});
```
```js
new CleanCSS().minify([
{'path/to/file/one': {styles: 'contents of file one'}},
{'path/to/file/two': {styles: 'contents of file two'}}
]);
```
Passing an array of hashes allows you to explicitly specify the order in which the input files are concatenated. Whereas when you use a single hash the order is determined by the [traversal order of object properties](http://2ality.com/2015/10/property-traversal-order-es6.html) - available since 4.1.0.
Important note - any `@import` rules already present in the hash will be resolved in memory.
## How to process remote `@import`s correctly?
In order to inline remote `@import` statements you need to provide a callback to minify method as fetching remote assets is an asynchronous operation, e.g.:
```js
var source = '@import url(http://example.com/path/to/remote/styles);';
new CleanCSS({ inline: ['remote'] }).minify(source, function (error, output) {
// output.styles
});
```
If you don't provide a callback, then remote `@import`s will be left as is.
## How to apply arbitrary transformations to CSS properties?
If clean-css doesn't perform a particular property optimization, you can use `transform` callback to apply it:
```js
var source = '.block{background-image:url(/path/to/image.png)}';
var output = new CleanCSS({
level: {
1: {
transform: function (propertyName, propertyValue, selector /* `selector` available since 4.2.0-pre */) {
if (propertyName == 'background-image' && propertyValue.indexOf('/path/to') > -1) {
return propertyValue.replace('/path/to', '../valid/path/to');
}
}
}
}
}).minify(source);
console.log(output.styles); # => .block{background-image:url(../valid/path/to/image.png)}
```
Note: returning `false` from `transform` callback will drop a property.
## How to specify a custom rounding precision?
The level 1 `roundingPrecision` optimization option accept a string with per-unit rounding precision settings, e.g.
```js
new CleanCSS({
level: {
1: {
roundingPrecision: 'all=3,px=5'
}
}
}).minify(source)
```
which sets all units rounding precision to 3 digits except `px` unit precision of 5 digits.
## How to keep a CSS fragment intact?
Note: available in the current master, to be released in 4.2.0.
Wrap the CSS fragment in special comments which instruct clean-css to preserve it, e.g.
```css
.block-1 {
color: red
}
/* clean-css ignore:start */
.block-special {
color: transparent
}
/* clean-css ignore:end */
.block-2 {
margin: 0
}
```
Optimizing this CSS will result in the following output:
```css
.block-1{color:red}
.block-special {
color: transparent
}
.block-2{margin:0}
```
## How to preserve a comment block?
Use the `/*!` notation instead of the standard one `/*`:
```css
/*!
Important comments included in optimized output.
*/
```
## How to rebase relative image URLs?
clean-css will handle it automatically for you in the following cases:
* when full paths to input files are passed in as options;
* when correct paths are passed in via a hash;
* when `rebaseTo` is used with any of above two.
## How to work with source maps?
To generate a source map, use `sourceMap: true` option, e.g.:
```js
new CleanCSS({ sourceMap: true, rebaseTo: pathToOutputDirectory })
.minify(source, function (error, output) {
// access output.sourceMap for SourceMapGenerator object
// see https://github.com/mozilla/source-map/#sourcemapgenerator for more details
});
```
You can also pass an input source map directly as a 2nd argument to `minify` method:
```js
new CleanCSS({ sourceMap: true, rebaseTo: pathToOutputDirectory })
.minify(source, inputSourceMap, function (error, output) {
// access output.sourceMap to access SourceMapGenerator object
// see https://github.com/mozilla/source-map/#sourcemapgenerator for more details
});
```
or even multiple input source maps at once:
```js
new CleanCSS({ sourceMap: true, rebaseTo: pathToOutputDirectory }).minify({
'path/to/source/1': {
styles: '...styles...',
sourceMap: '...source-map...'
},
'path/to/source/2': {
styles: '...styles...',
sourceMap: '...source-map...'
}
}, function (error, output) {
// access output.sourceMap as above
});
```
## How to apply level 1 & 2 optimizations at the same time?
Using the hash configuration specifying both optimization levels, e.g.
```js
new CleanCSS({
level: {
1: {
all: true,
normalizeUrls: false
},
2: {
restructureRules: true
}
}
})
```
will apply level 1 optimizations, except url normalization, and default level 2 optimizations with rule restructuring.
## What level 2 optimizations do?
All level 2 optimizations are dispatched [here](https://github.com/jakubpawlowicz/clean-css/blob/master/lib/optimizer/level-2/optimize.js#L67), and this is what they do:
* `recursivelyOptimizeBlocks` - does all the following operations on a nested block, like `@media` or `@keyframe`;
* `recursivelyOptimizeProperties` - optimizes properties in rulesets and flat at-rules, like @font-face, by splitting them into components (e.g. `margin` into `margin-(bottom|left|right|top)`), optimizing, and restoring them back. You may want to use `mergeIntoShorthands` option to control whether you want to turn multiple components into shorthands;
* `removeDuplicates` - gets rid of duplicate rulesets with exactly the same set of properties, e.g. when including a Sass / Less partial twice for no good reason;
* `mergeAdjacent` - merges adjacent rulesets with the same selector or rules;
* `reduceNonAdjacent` - identifies which properties are overridden in same-selector non-adjacent rulesets, and removes them;
* `mergeNonAdjacentBySelector` - identifies same-selector non-adjacent rulesets which can be moved (!) to be merged, requires all intermediate rulesets to not redefine the moved properties, or if redefined to have the same value;
* `mergeNonAdjacentByBody` - same as the one above but for same-selector non-adjacent rulesets;
* `restructure` - tries to reorganize different-selector different-rules rulesets so they take less space, e.g. `.one{padding:0}.two{margin:0}.one{margin-bottom:3px}` into `.two{margin:0}.one{padding:0;margin-bottom:3px}`;
* `removeDuplicateFontAtRules` - removes duplicated `@font-face` rules;
* `removeDuplicateMediaQueries` - removes duplicated `@media` nested blocks;
* `mergeMediaQueries` - merges non-adjacent `@media` at-rules by the same rules as `mergeNonAdjacentBy*` above;
## How to use clean-css with build tools?
There is a number of 3rd party plugins to popular build tools:
* [Broccoli](https://github.com/broccolijs/broccoli#broccoli): [broccoli-clean-css](https://github.com/shinnn/broccoli-clean-css)
* [Brunch](http://brunch.io/): [clean-css-brunch](https://github.com/brunch/clean-css-brunch)
* [Grunt](http://gruntjs.com): [grunt-contrib-cssmin](https://github.com/gruntjs/grunt-contrib-cssmin)
* [Gulp](http://gulpjs.com/): [gulp-clean-css](https://github.com/scniro/gulp-clean-css)
* [Gulp](http://gulpjs.com/): [using vinyl-map as a wrapper - courtesy of @sogko](https://github.com/jakubpawlowicz/clean-css/issues/342)
* [component-builder2](https://github.com/component/builder2.js): [builder-clean-css](https://github.com/poying/builder-clean-css)
* [Metalsmith](http://metalsmith.io): [metalsmith-clean-css](https://github.com/aymericbeaumet/metalsmith-clean-css)
* [Lasso](https://github.com/lasso-js/lasso): [lasso-clean-css](https://github.com/yomed/lasso-clean-css)
* [Start](https://github.com/start-runner/start): [start-clean-css](https://github.com/start-runner/clean-css)
## How to use clean-css from web browser?
* https://jakubpawlowicz.github.io/clean-css/ (official web interface)
* http://refresh-sf.com/
* http://adamburgess.github.io/clean-css-online/
# Contributing
See [CONTRIBUTING.md](https://github.com/jakubpawlowicz/clean-css/blob/master/CONTRIBUTING.md).
## How to get started?
First clone the sources:
```bash
git clone git@github.com:jakubpawlowicz/clean-css.git
```
then install dependencies:
```bash
cd clean-css
npm install
```
then use any of the following commands to verify your copy:
```bash
npm run bench # for clean-css benchmarks (see [test/bench.js](https://github.com/jakubpawlowicz/clean-css/blob/master/test/bench.js) for details)
npm run browserify # to create the browser-ready clean-css version
npm run check # to lint JS sources with [JSHint](https://github.com/jshint/jshint/)
npm test # to run all tests
```
# Acknowledgments
Sorted alphabetically by GitHub handle:
* [@abarre](https://github.com/abarre) (Anthony Barre) for improvements to `@import` processing;
* [@alexlamsl](https://github.com/alexlamsl) (Alex Lam S.L.) for testing early clean-css 4 versions, reporting bugs, and suggesting numerous improvements.
* [@altschuler](https://github.com/altschuler) (Simon Altschuler) for fixing `@import` processing inside comments;
* [@ben-eb](https://github.com/ben-eb) (Ben Briggs) for sharing ideas about CSS optimizations;
* [@davisjam](https://github.com/davisjam) (Jamie Davis) for disclosing ReDOS vulnerabilities;
* [@facelessuser](https://github.com/facelessuser) (Isaac) for pointing out a flaw in clean-css' stateless mode;
* [@grandrath](https://github.com/grandrath) (Martin Grandrath) for improving `minify` method source traversal in ES6;
* [@jmalonzo](https://github.com/jmalonzo) (Jan Michael Alonzo) for a patch removing node.js' old `sys` package;
* [@lukeapage](https://github.com/lukeapage) (Luke Page) for suggestions and testing the source maps feature;
Plus everyone else involved in [#125](https://github.com/jakubpawlowicz/clean-css/issues/125) for pushing it forward;
* [@madwizard-thomas](https://github.com/madwizard-thomas) for sharing ideas about `@import` inlining and URL rebasing.
* [@ngyikp](https://github.com/ngyikp) (Ng Yik Phang) for testing early clean-css 4 versions, reporting bugs, and suggesting numerous improvements.
* [@wagenet](https://github.com/wagenet) (Peter Wagenet) for suggesting improvements to `@import` inlining behavior;
* [@venemo](https://github.com/venemo) (Timur Kristóf) for an outstanding contribution of advanced property optimizer for 2.2 release;
* [@vvo](https://github.com/vvo) (Vincent Voyer) for a patch with better empty element regex and for inspiring us to do many performance improvements in 0.4 release;
* [@xhmikosr](https://github.com/xhmikosr) for suggesting new features, like option to remove special comments and strip out URLs quotation, and pointing out numerous improvements like JSHint, media queries, etc.
# License
clean-css is released under the [MIT License](https://github.com/jakubpawlowicz/clean-css/blob/master/LICENSE).
node_modules/clean-css/History.md 0000666 00000233405 15042511722 0013066 0 ustar 00 [4.2.4 / 2021-10-21](https://github.com/jakubpawlowicz/clean-css/compare/v4.2.3...v4.2.4)
==================
* Backports prototype pollution fix from 5.x branch.
* Backports correct decimal point regex from 5.x branch.
[4.2.3 / 2020-01-28](https://github.com/jakubpawlowicz/clean-css/compare/v4.2.2...v4.2.3)
==================
* Fixed issue [#1106](https://github.com/jakubpawlowicz/clean-css/issues/1106) - regression in handling RGBA/HSLA colors.
[4.2.2 / 2020-01-25](https://github.com/jakubpawlowicz/clean-css/compare/v4.2.1...v4.2.2)
==================
* Fixed error when property block has no value.
* Fixed issue [#1077](https://github.com/jakubpawlowicz/clean-css/issues/1077) - local fonts with color in name.
* Fixed issue [#1082](https://github.com/jakubpawlowicz/clean-css/issues/1082) - correctly convert colors if alpha >= 1.
* Fixed issue [#1085](https://github.com/jakubpawlowicz/clean-css/issues/1085) - prevent unquoting of grid elements.
[4.2.1 / 2018-08-07](https://github.com/jakubpawlowicz/clean-css/compare/v4.2.0...v4.2.1)
==================
* Fixes giving `breakWith` option via a string.
[4.2.0 / 2018-08-02](https://github.com/jakubpawlowicz/clean-css/compare/4.1...4.2.0)
==================
* Adds `process` method for compatibility with optimize-css-assets-webpack-plugin.
* Fixed issue [#861](https://github.com/jakubpawlowicz/clean-css/issues/861) - new `transition` property optimizer.
* Fixed issue [#895](https://github.com/jakubpawlowicz/clean-css/issues/895) - ignoring specific styles.
* Fixed issue [#947](https://github.com/jakubpawlowicz/clean-css/issues/947) - selector based filtering.
* Fixed issue [#964](https://github.com/jakubpawlowicz/clean-css/issues/964) - adds configurable line breaks.
* Fixed issue [#986](https://github.com/jakubpawlowicz/clean-css/issues/986) - level 2 optimizations and CSS 4 colors.
* Fixed issue [#1000](https://github.com/jakubpawlowicz/clean-css/issues/1000) - carriage return handling in tokenizer.
* Fixed issue [#1038](https://github.com/jakubpawlowicz/clean-css/issues/1038) - `font-variation-settings` quoting.
* Fixes ReDOS vulnerabilities in validator code.
[4.1.11 / 2018-03-06](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.10...v4.1.11)
==================
* Backports fixes to ReDOS vulnerabilities in validator code.
[4.1.10 / 2018-03-05](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.9...v4.1.10)
==================
* Fixed issue [#988](https://github.com/jakubpawlowicz/clean-css/issues/988) - edge case in dropping default animation-duration.
* Fixed issue [#989](https://github.com/jakubpawlowicz/clean-css/issues/989) - edge case in removing unused at rules.
* Fixed issue [#1001](https://github.com/jakubpawlowicz/clean-css/issues/1001) - corrupted tokenizer state.
* Fixed issue [#1006](https://github.com/jakubpawlowicz/clean-css/issues/1006) - edge case in handling invalid source maps.
* Fixed issue [#1008](https://github.com/jakubpawlowicz/clean-css/issues/1008) - edge case in breaking up `font` shorthand.
[4.1.9 / 2017-09-19](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.8...v4.1.9)
==================
* Fixed issue [#971](https://github.com/jakubpawlowicz/clean-css/issues/971) - edge case in removing unused at rules.
[4.1.8 / 2017-09-02](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.7...v4.1.8)
==================
* Fixed issue [#959](https://github.com/jakubpawlowicz/clean-css/issues/959) - regression in shortening long hex values.
* Fixed issue [#960](https://github.com/jakubpawlowicz/clean-css/issues/960) - better explanation of `efficiency` stat.
* Fixed issue [#965](https://github.com/jakubpawlowicz/clean-css/issues/965) - edge case in parsing comment endings.
* Fixed issue [#966](https://github.com/jakubpawlowicz/clean-css/issues/966) - remote `@import`s referenced from local ones.
[4.1.7 / 2017-07-14](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.6...v4.1.7)
==================
* Fixed issue [#957](https://github.com/jakubpawlowicz/clean-css/issues/957) - `0%` minification of `width` property.
[4.1.6 / 2017-07-08](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.5...v4.1.6)
==================
* Fixed issue [#887](https://github.com/jakubpawlowicz/clean-css/issues/887) - edge case in serializing comments.
* Fixed issue [#953](https://github.com/jakubpawlowicz/clean-css/issues/953) - beautify breaks attribute selectors.
[4.1.5 / 2017-06-29](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.4...v4.1.5)
==================
* Fixed issue [#945](https://github.com/jakubpawlowicz/clean-css/issues/945) - hex RGBA colors in IE filters.
* Fixed issue [#952](https://github.com/jakubpawlowicz/clean-css/issues/952) - parsing `@page` according to CSS3 spec.
[4.1.4 / 2017-06-14](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.3...v4.1.4)
==================
* Fixed issue [#950](https://github.com/jakubpawlowicz/clean-css/issues/950) - bug in removing unused `@font-face` rules.
[4.1.3 / 2017-05-18](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.2...v4.1.3)
==================
* Fixed issue [#946](https://github.com/jakubpawlowicz/clean-css/issues/946) - tokenizing `-ms-grid-columns` repeat syntax.
[4.1.2 / 2017-05-10](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.1...v4.1.2)
==================
* Fixed issue [#939](https://github.com/jakubpawlowicz/clean-css/issues/939) - semicolon after `@apply` at rule.
* Fixed issue [#940](https://github.com/jakubpawlowicz/clean-css/issues/940) - handling more `font` keywords.
* Fixed issue [#941](https://github.com/jakubpawlowicz/clean-css/issues/941) - breaking up vendor prefixed `animation`.
[4.1.1 / 2017-05-08](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.0...v4.1.1)
==================
* Fixed issue [#938](https://github.com/jakubpawlowicz/clean-css/issues/938) - removing unused at-rules with `!important`.
[4.1.0 / 2017-05-07](https://github.com/jakubpawlowicz/clean-css/compare/4.0...v4.1.0)
==================
* Improves longhand-into-shorthand merging mechanism in complex cases as with `border-*` shorthands.
* Fixed issue [#254](https://github.com/jakubpawlowicz/clean-css/issues/254) - adds `font` property optimizer.
* Fixed issue [#525](https://github.com/jakubpawlowicz/clean-css/issues/525) - restores `inherit`-based merging.
* Fixed issue [#755](https://github.com/jakubpawlowicz/clean-css/issues/755) - adds custom handling of remote requests.
* Fixed issue [#860](https://github.com/jakubpawlowicz/clean-css/issues/860) - adds `animation` property optimizer.
* Fixed issue [#862](https://github.com/jakubpawlowicz/clean-css/issues/862) - allows removing unused at rules.
* Fixed issue [#886](https://github.com/jakubpawlowicz/clean-css/issues/886) - better multi pseudo class / element merging.
* Fixed issue [#890](https://github.com/jakubpawlowicz/clean-css/issues/890) - adds toggle to disable empty tokens removal.
* Fixed issue [#893](https://github.com/jakubpawlowicz/clean-css/issues/893) - `inline: false` as alias to `inline: 'none'`.
* Fixed issue [#905](https://github.com/jakubpawlowicz/clean-css/issues/905) - allows disabling selector sorting.
* Fixed issue [#906](https://github.com/jakubpawlowicz/clean-css/issues/906) - improves usability of web UI settings.
* Fixed issue [#908](https://github.com/jakubpawlowicz/clean-css/issues/908) - improved `minify` method signature.
* Fixed issue [#916](https://github.com/jakubpawlowicz/clean-css/issues/916) - maximum number of merged selectors.
* Fixed issue [#920](https://github.com/jakubpawlowicz/clean-css/issues/920) - allows skipping certain properties in level 2 optimizations.
* Fixed issue [#934](https://github.com/jakubpawlowicz/clean-css/issues/934) - smarter longhand into shorthand merging.
[4.0.13 / 2017-05-10](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.12...v4.0.13)
==================
* Backports [#939](https://github.com/jakubpawlowicz/clean-css/issues/939) - semicolon after `@apply` at rule.
[4.0.12 / 2017-04-12](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.11...v4.0.12)
==================
* Fixed issue [#930](https://github.com/jakubpawlowicz/clean-css/issues/930) - regression in tidying selectors.
[4.0.11 / 2017-04-04](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.10...v4.0.11)
==================
* Fixed issue [#924](https://github.com/jakubpawlowicz/clean-css/issues/924) - `hsl` zero percent eager optimization.
[4.0.10 / 2017-03-22](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.9...v4.0.10)
==================
* Fixed issue [#917](https://github.com/jakubpawlowicz/clean-css/issues/917) - prevents grid area unquoting.
* Backported [#916](https://github.com/jakubpawlowicz/clean-css/issues/916) - maximum number of merged selectors.
* Refixed issue [#556](https://github.com/jakubpawlowicz/clean-css/issues/556) - IE backslash hacks.
[4.0.9 / 2017-03-15](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.8...v4.0.9)
==================
* Fixed issue [#902](https://github.com/jakubpawlowicz/clean-css/issues/902) - case insensitive attribute matchers.
* Fixed issue [#903](https://github.com/jakubpawlowicz/clean-css/issues/903) - web UI and source maps.
* Fixed issue [#907](https://github.com/jakubpawlowicz/clean-css/issues/907) - space after closing brace in `@supports`.
* Fixed issue [#910](https://github.com/jakubpawlowicz/clean-css/issues/910) - too aggressive precision optimizations.
[4.0.8 / 2017-02-22](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.7...v4.0.8)
==================
* Fixes edge case in remote stylesheet fetching.
* Fixed issue [#899](https://github.com/jakubpawlowicz/clean-css/issues/899) - regression in optimizing pseudo class arguments.
[4.0.7 / 2017-02-14](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.6...v4.0.7)
==================
* Fixed issue [#891](https://github.com/jakubpawlowicz/clean-css/issues/891) - merging vendor-prefixed pseudo-classes.
[4.0.6 / 2017-02-10](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.5...v4.0.6)
==================
* Fixed issue [#885](https://github.com/jakubpawlowicz/clean-css/issues/885) - unquoting `font-feature-settings`.
[4.0.5 / 2017-02-07](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.4...v4.0.5)
==================
* Fixed issue [#884](https://github.com/jakubpawlowicz/clean-css/issues/884) - handling absolute paths on Windows.
* Fixed issue [#881](https://github.com/jakubpawlowicz/clean-css/issues/881) - incorrect `require` arity.
* Fixed issue [#880](https://github.com/jakubpawlowicz/clean-css/issues/880) - incorrect token type identification.
[4.0.4 / 2017-02-04](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.3...v4.0.4)
==================
* Fixed issue [#879](https://github.com/jakubpawlowicz/clean-css/issues/879) - incorrect handling of spaces in paths.
* Fixed issue [#878](https://github.com/jakubpawlowicz/clean-css/issues/878) - invalid double backslash tokenization.
[4.0.3 / 2017-01-30](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.2...v4.0.3)
==================
* Fixed issue [#875](https://github.com/jakubpawlowicz/clean-css/issues/875) - invalid traversing in semantic merging.
[4.0.2 / 2017-01-26](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.1...v4.0.2)
==================
* Fixed issue [#874](https://github.com/jakubpawlowicz/clean-css/issues/874) - regression in at-rule tokenization.
[4.0.1 / 2017-01-25](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.0...v4.0.1)
==================
* Fixed issue [#866](https://github.com/jakubpawlowicz/clean-css/issues/866) - edge case in `inline` option.
* Fixed issue [#867](https://github.com/jakubpawlowicz/clean-css/issues/867) - skip optimizing variable values.
* Fixed issue [#868](https://github.com/jakubpawlowicz/clean-css/issues/868) - accept absolute paths in input hash.
* Fixed issue [#872](https://github.com/jakubpawlowicz/clean-css/issues/872) - edge case in CSS tokenization.
[4.0.0 / 2017-01-23](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.24...v4.0.0)
==================
* Adds more detailed error & warning messages on top of the new tokenizer.
* Disables restructuring optimizations by default until optimized in #533.
* Fixes a bug ignoring incorrect properties in complex restructuring.
* Requires Node.js 4.0+ to run.
* Removes `benchmark` API option as total time is always reported under `stats` property.
* Removes `debug` API switch as stats are always gathered and available under `stats` property.
* Replaces the old tokenizer with a new one which doesn't use any escaping.
* Replaces the old `@import` inlining with one on top of the new tokenizer.
* Re-enables `background-(clip|origin|size)` merging with `background` shorthand.
* Simplifies URL rebasing with a single `rebaseTo` option in API or inferred from `--output` in CLI.
* Splits `inliner` option into `inlineRequest` and `inlineTimeout`.
* Fixed issue [#209](https://github.com/jakubpawlowicz/clean-css/issues/209) - adds output formatting via `format` flag.
* Fixed issue [#290](https://github.com/jakubpawlowicz/clean-css/issues/290) - removes aggressive merging.
* Fixed issue [#432](https://github.com/jakubpawlowicz/clean-css/issues/432) - adds URLs normalization.
* Fixed issue [#460](https://github.com/jakubpawlowicz/clean-css/issues/460) - unescaped semicolon in selector.
* Fixed issue [#657](https://github.com/jakubpawlowicz/clean-css/issues/657) - adds property name validation.
* Fixed issue [#685](https://github.com/jakubpawlowicz/clean-css/issues/685) - adds lowercasing hex colors optimization.
* Fixed issue [#686](https://github.com/jakubpawlowicz/clean-css/issues/686) - adds rounding precision for all units.
* Fixed issue [#703](https://github.com/jakubpawlowicz/clean-css/issues/703) - changes default IE compatibility to 10+.
* Fixed issue [#731](https://github.com/jakubpawlowicz/clean-css/issues/731) - adds granular control over level 2 optimizations.
* Fixed issue [#739](https://github.com/jakubpawlowicz/clean-css/issues/739) - error when a closing brace is missing.
* Fixed issue [#750](https://github.com/jakubpawlowicz/clean-css/issues/750) - allows `width` overriding.
* Fixed issue [#756](https://github.com/jakubpawlowicz/clean-css/issues/756) - adds disabling font-weight optimizations.
* Fixed issue [#758](https://github.com/jakubpawlowicz/clean-css/issues/758) - ignores rules with empty selector.
* Fixed issue [#767](https://github.com/jakubpawlowicz/clean-css/issues/767) - disables remote `@import` inlining by default.
* Fixed issue [#773](https://github.com/jakubpawlowicz/clean-css/issues/773) - adds reordering based on selector specificity.
* Fixed issue [#785](https://github.com/jakubpawlowicz/clean-css/issues/785) - adds `@font-face` de-duplication.
* Fixed issue [#791](https://github.com/jakubpawlowicz/clean-css/issues/791) - resolves imports in-memory if possible.
* Fixed issue [#796](https://github.com/jakubpawlowicz/clean-css/issues/796) - semantic merging for `@media` blocks.
* Fixed issue [#801](https://github.com/jakubpawlowicz/clean-css/issues/801) - smarter `@import` inlining.
* Fixed issue [#806](https://github.com/jakubpawlowicz/clean-css/issues/806) - skip optimizing variable properties.
* Fixed issue [#817](https://github.com/jakubpawlowicz/clean-css/issues/817) - makes `off` disable rounding.
* Fixed issue [#818](https://github.com/jakubpawlowicz/clean-css/issues/818) - disables `px` rounding by default.
* Fixed issue [#828](https://github.com/jakubpawlowicz/clean-css/issues/828) - `-chrome-` hack support.
* Fixed issue [#829](https://github.com/jakubpawlowicz/clean-css/issues/829) - adds more strict selector merging rules.
* Fixed issue [#834](https://github.com/jakubpawlowicz/clean-css/issues/834) - adds extra line break in nested blocks.
* Fixed issue [#836](https://github.com/jakubpawlowicz/clean-css/issues/836) - enables level `0` optimizations.
* Fixed issue [#839](https://github.com/jakubpawlowicz/clean-css/issues/839) - allows URIs in import inlining rules.
* Fixed issue [#840](https://github.com/jakubpawlowicz/clean-css/issues/840) - allows input source map as map object.
* Fixed issue [#843](https://github.com/jakubpawlowicz/clean-css/issues/843) - regression in selector handling.
* Fixed issue [#845](https://github.com/jakubpawlowicz/clean-css/issues/845) - web compatibility of 4.0 branch.
* Fixed issue [#847](https://github.com/jakubpawlowicz/clean-css/issues/847) - regression in handling invalid selectors.
* Fixed issue [#849](https://github.com/jakubpawlowicz/clean-css/issues/849) - disables inlining protocol-less resources.
* Fixed issue [#856](https://github.com/jakubpawlowicz/clean-css/issues/856) - allows `minify` to return a promise.
* Fixed issue [#857](https://github.com/jakubpawlowicz/clean-css/issues/857) - normalizes CleanCSS API interface.
* Fixed issue [#863](https://github.com/jakubpawlowicz/clean-css/issues/863) - adds `transform` callback for custom optimizations.
[3.4.26 / 2017-05-10](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.25...v3.4.26)
==================
* Backports [#939](https://github.com/jakubpawlowicz/clean-css/issues/939) - semicolon after `@apply` at-rule.
[3.4.25 / 2017-02-22](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.24...v3.4.25)
==================
* Fixed issue [#897](https://github.com/jakubpawlowicz/clean-css/issues/897) - tokenization with escaped markers.
[3.4.24 / 2017-01-20](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.23...v3.4.24)
==================
* Fixed issue [#859](https://github.com/jakubpawlowicz/clean-css/issues/859) - avoid `-webkit-border-radius` optimizations.
[3.4.23 / 2016-12-17](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.22...v3.4.23)
==================
* Fixed issue [#844](https://github.com/jakubpawlowicz/clean-css/issues/844) - regression in property values extraction.
[3.4.22 / 2016-12-12](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.21...v3.4.22)
==================
* Fixed issue [#841](https://github.com/jakubpawlowicz/clean-css/issues/841) - disabled importing and files passed as array.
* Ignores `@import` at-rules if appearing after any non-`@import` rules.
[3.4.21 / 2016-11-16](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.20...v3.4.21)
==================
* Fixed issue [#821](https://github.com/jakubpawlowicz/clean-css/issues/821) - reducing non-adjacent rules.
* Fixed issue [#830](https://github.com/jakubpawlowicz/clean-css/issues/830) - reordering border-* properties.
* Fixed issue [#833](https://github.com/jakubpawlowicz/clean-css/issues/833) - moving `@media` queries.
[3.4.20 / 2016-09-26](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.19...v3.4.20)
==================
* Fixed issue [#814](https://github.com/jakubpawlowicz/clean-css/issues/814) - `:selection` rule merging.
[3.4.19 / 2016-07-25](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.18...v3.4.19)
==================
* Fixed issue [#795](https://github.com/jakubpawlowicz/clean-css/issues/795) - `!important` and override compacting.
[3.4.18 / 2016-06-15](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.17...v3.4.18)
==================
* Fixed issue [#787](https://github.com/jakubpawlowicz/clean-css/issues/787) - regression in processing data URIs.
[3.4.17 / 2016-06-04](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.16...v3.4.17)
==================
* Fixed issue [#783](https://github.com/jakubpawlowicz/clean-css/issues/783) - regression in processing data URIs.
[3.4.16 / 2016-06-02](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.15...v3.4.16)
==================
* Fixed issue [#781](https://github.com/jakubpawlowicz/clean-css/issues/781) - regression in override compacting.
* Fixed issue [#782](https://github.com/jakubpawlowicz/clean-css/issues/782) - regression in processing data URIs.
[3.4.15 / 2016-06-01](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.14...v3.4.15)
==================
* Fixed issue [#776](https://github.com/jakubpawlowicz/clean-css/issues/776) - edge case in quoted data URIs.
* Fixed issue [#779](https://github.com/jakubpawlowicz/clean-css/issues/779) - merging `background-(position|size)`.
* Fixed issue [#780](https://github.com/jakubpawlowicz/clean-css/issues/780) - space after inlined variables.
[3.4.14 / 2016-05-31](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.13...v3.4.14)
==================
* Fixed issue [#751](https://github.com/jakubpawlowicz/clean-css/issues/751) - stringifying CSS variables.
* Fixed issue [#763](https://github.com/jakubpawlowicz/clean-css/issues/763) - data URI SVG and quoting.
* Fixed issue [#765](https://github.com/jakubpawlowicz/clean-css/issues/765) - two values of border-radius.
* Fixed issue [#768](https://github.com/jakubpawlowicz/clean-css/issues/768) - invalid border-radius property.
[3.4.13 / 2016-05-23](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.12...v3.4.13)
==================
* Fixed issue [#734](https://github.com/jakubpawlowicz/clean-css/issues/769) - Node.js 6.x support.
[3.4.12 / 2016-04-09](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.11...v3.4.12)
==================
* Fixed issue [#734](https://github.com/jakubpawlowicz/clean-css/issues/734) - `--root` option edge case.
* Fixed issue [#758](https://github.com/jakubpawlowicz/clean-css/issues/758) - treats empty rule as unmergeable.
[3.4.11 / 2016-04-01](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.10...v3.4.11)
==================
* Fixed issue [#738](https://github.com/jakubpawlowicz/clean-css/issues/738) - edge case in comment processing.
* Fixed issue [#741](https://github.com/jakubpawlowicz/clean-css/issues/741) - HTTP proxy with HTTPS inlining.
* Fixed issue [#743](https://github.com/jakubpawlowicz/clean-css/issues/743) - background shorthand and source maps.
* Fixed issue [#745](https://github.com/jakubpawlowicz/clean-css/issues/745) - matching mixed case `!important`.
[3.4.10 / 2016-02-29](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.9...v3.4.10)
==================
* Fixed issue [#735](https://github.com/jakubpawlowicz/clean-css/issues/735) - whitespace removal with escaped chars.
[3.4.9 / 2016-01-03](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.8...v3.4.9)
==================
* Sped up merging by body advanced optimization.
* Fixed issue [#693](https://github.com/jakubpawlowicz/clean-css/issues/693) - restructuring edge case.
* Fixed issue [#711](https://github.com/jakubpawlowicz/clean-css/issues/711) - border fuzzy matching.
* Fixed issue [#714](https://github.com/jakubpawlowicz/clean-css/issues/714) - stringifying property level at rules.
* Fixed issue [#715](https://github.com/jakubpawlowicz/clean-css/issues/715) - stack too deep in comment scan.
[3.4.8 / 2015-11-13](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.7...v3.4.8)
==================
* Fixed issue [#676](https://github.com/jakubpawlowicz/clean-css/issues/676) - fuzzy matching unqoted data URIs.
[3.4.7 / 2015-11-10](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.6...v3.4.7)
==================
* Fixed issue [#692](https://github.com/jakubpawlowicz/clean-css/issues/692) - edge case in URL quoting.
* Fixed issue [#695](https://github.com/jakubpawlowicz/clean-css/issues/695) - shorthand overriding edge case.
* Fixed issue [#699](https://github.com/jakubpawlowicz/clean-css/issues/699) - IE9 transparent hack.
* Fixed issue [#701](https://github.com/jakubpawlowicz/clean-css/issues/701) - `url` quoting with hash arguments.
[3.4.6 / 2015-10-14](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.5...v3.4.6)
==================
* Fixed issue [#679](https://github.com/jakubpawlowicz/clean-css/issues/679) - wrong rebasing of remote URLs.
[3.4.5 / 2015-09-28](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.4...v3.4.5)
==================
* Fixed issue [#681](https://github.com/jakubpawlowicz/clean-css/issues/681) - property inheritance & restructuring.
* Fixed issue [#675](https://github.com/jakubpawlowicz/clean-css/issues/675) - overriding with `!important`.
[3.4.4 / 2015-09-21](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.3...v3.4.4)
==================
* Fixed issue [#626](https://github.com/jakubpawlowicz/clean-css/issues/626) - edge case in import rebasing.
* Fixed issue [#674](https://github.com/jakubpawlowicz/clean-css/issues/674) - adjacent merging order.
[3.4.3 / 2015-09-15](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.2...v3.4.3)
==================
* Fixed issue [#668](https://github.com/jakubpawlowicz/clean-css/issues/668) - node v4 path.join.
* Fixed issue [#669](https://github.com/jakubpawlowicz/clean-css/issues/669) - adjacent overriding with `!important`.
[3.4.2 / 2015-09-14](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.1...v3.4.2)
==================
* Fixed issue [#598](https://github.com/jakubpawlowicz/clean-css/issues/598) - restructuring border properties.
* Fixed issue [#654](https://github.com/jakubpawlowicz/clean-css/issues/654) - disables length optimizations.
* Fixed issue [#655](https://github.com/jakubpawlowicz/clean-css/issues/655) - shorthands override merging.
* Fixed issue [#660](https://github.com/jakubpawlowicz/clean-css/issues/660) - !important token overriding.
* Fixed issue [#662](https://github.com/jakubpawlowicz/clean-css/issues/662) - !important selector reducing.
* Fixed issue [#667](https://github.com/jakubpawlowicz/clean-css/issues/667) - rebasing remote URLs.
[3.4.1 / 2015-08-27](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.0...v3.4.1)
==================
* Fixed issue [#652](https://github.com/jakubpawlowicz/clean-css/issues/652) - order of restoring and removing tokens.
[3.4.0 / 2015-08-27](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.10...v3.4.0)
==================
* Adds an option for a fine-grained `@import` control.
* Adds unit compatibility switches to disable length optimizations.
* Adds inferring proxy settings from HTTP_PROXY environment variable.
* Adds support for Polymer / Web Components special selectors.
* Adds support for Polymer mixins.
* Adds testing source maps in batch mode.
* Unifies wrappers for simple & advanced optimizations.
* Fixed issue [#596](https://github.com/jakubpawlowicz/clean-css/issues/596) - support for !ie IE<8 hack.
* Fixed issue [#599](https://github.com/jakubpawlowicz/clean-css/issues/599) - support for inlined source maps.
* Fixed issue [#607](https://github.com/jakubpawlowicz/clean-css/issues/607) - adds better rule reordering.
* Fixed issue [#612](https://github.com/jakubpawlowicz/clean-css/issues/612) - adds HTTP proxy support.
* Fixed issue [#618](https://github.com/jakubpawlowicz/clean-css/issues/618) - adds safer function validation.
* Fixed issue [#625](https://github.com/jakubpawlowicz/clean-css/issues/625) - adds length unit optimizations.
* Fixed issue [#632](https://github.com/jakubpawlowicz/clean-css/issues/632) - adds disabling remote `import`s.
* Fixed issue [#635](https://github.com/jakubpawlowicz/clean-css/issues/635) - adds safer `0%` optimizations.
* Fixed issue [#644](https://github.com/jakubpawlowicz/clean-css/issues/644) - adds time unit optimizations.
* Fixed issue [#645](https://github.com/jakubpawlowicz/clean-css/issues/645) - adds bottom to top `media` merging.
* Fixed issue [#648](https://github.com/jakubpawlowicz/clean-css/issues/648) - adds property level at-rule support.
[3.3.10 / 2015-08-27](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.9...v3.3.10)
==================
* Adds better comments + keepBreaks handling.
* Adds better text normalizing in source maps mode.
* Fixes non-adjacent optimizations for source maps.
* Fixes removing unused items.
* Improves `outline` break up with source maps.
* Refixed issue [#629](https://github.com/jakubpawlowicz/clean-css/issues/629) - source maps & background shorthands.
[3.3.9 / 2015-08-09](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.8...v3.3.9)
==================
* Fixed issue [#640](https://github.com/jakubpawlowicz/clean-css/issues/640) - URI processing regression.
[3.3.8 / 2015-08-06](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.7...v3.3.8)
==================
* Fixed issue [#629](https://github.com/jakubpawlowicz/clean-css/issues/629) - source maps & background shorthands.
* Fixed issue [#630](https://github.com/jakubpawlowicz/clean-css/issues/630) - vendor prefixed flex optimizations.
* Fixed issue [#633](https://github.com/jakubpawlowicz/clean-css/issues/633) - handling data URI with brackets.
* Fixed issue [#634](https://github.com/jakubpawlowicz/clean-css/issues/634) - merging :placeholder selectors.
[3.3.7 / 2015-07-29](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.6...v3.3.7)
==================
* Fixed issue [#616](https://github.com/jakubpawlowicz/clean-css/issues/616) - ordering in restructuring.
[3.3.6 / 2015-07-14](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.5...v3.3.6)
==================
* Fixed issue [#620](https://github.com/jakubpawlowicz/clean-css/issues/620) - `bold` style in font shorthands.
[3.3.5 / 2015-07-01](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.4...v3.3.5)
==================
* Fixed issue [#608](https://github.com/jakubpawlowicz/clean-css/issues/608) - custom URI protocols handling.
[3.3.4 / 2015-06-24](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.3...v3.3.4)
==================
* Fixed issue [#610](https://github.com/jakubpawlowicz/clean-css/issues/610) - `border:inherit` restoring.
* Fixed issue [#611](https://github.com/jakubpawlowicz/clean-css/issues/611) - edge case in quote stripping.
[3.3.3 / 2015-06-16](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.2...v3.3.3)
==================
* Fixed issue [#603](https://github.com/jakubpawlowicz/clean-css/issues/603) - IE suffix hack defaults to on.
[3.3.2 / 2015-06-14](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.1...v3.3.2)
==================
* Fixed issue [#595](https://github.com/jakubpawlowicz/clean-css/issues/595) - more relaxed block matching.
* Fixed issue [#601](https://github.com/jakubpawlowicz/clean-css/issues/601) - percentage minifying inside `flex`.
* Fixed issue [#602](https://github.com/jakubpawlowicz/clean-css/issues/602) - backslash IE hacks after a space.
[3.3.1 / 2015-06-02](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.0...v3.3.1)
==================
* Fixed issue [#590](https://github.com/jakubpawlowicz/clean-css/issues/590) - edge case in `@import` processing.
[3.3.0 / 2015-05-31](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.11...v3.3.0)
==================
* Cleans up url rebase code getting rid of unnecessary state.
* Cleans up tokenizer code getting rid of unnecessary state.
* Moves source maps tracker into lib/source-maps/track.
* Moves tokenizer code into lib/tokenizer.
* Moves URL scanner into lib/urls/reduce (was named incorrectly before).
* Moves URL rebasing & rewriting into lib/urls.
* Fixed issue [#375](https://github.com/jakubpawlowicz/clean-css/issues/375) - unit compatibility switches.
* Fixed issue [#436](https://github.com/jakubpawlowicz/clean-css/issues/436) - refactors URI rewriting.
* Fixed issue [#448](https://github.com/jakubpawlowicz/clean-css/issues/448) - rebasing no protocol URIs.
* Fixed issue [#517](https://github.com/jakubpawlowicz/clean-css/issues/517) - turning off color optimizations.
* Fixed issue [#542](https://github.com/jakubpawlowicz/clean-css/issues/542) - space after closing brace in IE.
* Fixed issue [#562](https://github.com/jakubpawlowicz/clean-css/issues/562) - optimizing invalid color values.
* Fixed issue [#563](https://github.com/jakubpawlowicz/clean-css/issues/563) - `background:inherit` restoring.
* Fixed issue [#570](https://github.com/jakubpawlowicz/clean-css/issues/570) - rebasing "no-url()" imports.
* Fixed issue [#574](https://github.com/jakubpawlowicz/clean-css/issues/574) - rewriting internal URLs.
* Fixed issue [#575](https://github.com/jakubpawlowicz/clean-css/issues/575) - missing directory as a `target`.
* Fixed issue [#577](https://github.com/jakubpawlowicz/clean-css/issues/577) - `background-clip` into shorthand.
* Fixed issue [#579](https://github.com/jakubpawlowicz/clean-css/issues/579) - `background-origin` into shorthand.
* Fixed issue [#580](https://github.com/jakubpawlowicz/clean-css/issues/580) - mixed `@import` processing.
* Fixed issue [#582](https://github.com/jakubpawlowicz/clean-css/issues/582) - overriding with prefixed values.
* Fixed issue [#583](https://github.com/jakubpawlowicz/clean-css/issues/583) - URL quoting for SVG data.
* Fixed issue [#587](https://github.com/jakubpawlowicz/clean-css/issues/587) - too aggressive `border` reordering.
[3.2.11 / 2015-05-31](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.10...v3.2.11)
==================
* Fixed issue [#563](https://github.com/jakubpawlowicz/clean-css/issues/563) - `background:inherit` restoring.
* Fixed issue [#582](https://github.com/jakubpawlowicz/clean-css/issues/582) - overriding with prefixed values.
* Fixed issue [#583](https://github.com/jakubpawlowicz/clean-css/issues/583) - URL quoting for SVG data.
* Fixed issue [#587](https://github.com/jakubpawlowicz/clean-css/issues/587) - too aggressive `border` reordering.
[3.2.10 / 2015-05-14](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.9...v3.2.10)
==================
* Fixed issue [#572](https://github.com/jakubpawlowicz/clean-css/issues/572) - empty elements removal.
[3.2.9 / 2015-05-08](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.8...v3.2.9)
==================
* Fixed issue [#567](https://github.com/jakubpawlowicz/clean-css/issues/567) - merging colors as functions.
[3.2.8 / 2015-05-04](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.7...v3.2.8)
==================
* Fixed issue [#561](https://github.com/jakubpawlowicz/clean-css/issues/561) - restructuring special selectors.
[3.2.7 / 2015-05-03](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.6...v3.2.7)
==================
* Fixed issue [#551](https://github.com/jakubpawlowicz/clean-css/issues/551) - edge case in restructuring.
* Fixed issue [#553](https://github.com/jakubpawlowicz/clean-css/issues/553) - another style of SVG fallback.
* Fixed issue [#558](https://github.com/jakubpawlowicz/clean-css/issues/558) - units in same selector merging.
[3.2.6 / 2015-04-28](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.5...v3.2.6)
==================
* Fixed issue [#550](https://github.com/jakubpawlowicz/clean-css/issues/550) - proper `contentSources` tracking.
* Fixed issue [#556](https://github.com/jakubpawlowicz/clean-css/issues/556) - regression in IE backslash hacks.
[3.2.5 / 2015-04-25](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.4...v3.2.5)
==================
* Fixed issue [#543](https://github.com/jakubpawlowicz/clean-css/issues/543) - better "comment in body" handling.
* Fixed issue [#548](https://github.com/jakubpawlowicz/clean-css/issues/548) - regression in font minifying.
* Fixed issue [#549](https://github.com/jakubpawlowicz/clean-css/issues/549) - special comments in source maps.
[3.2.4 / 2015-04-24](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.3...v3.2.4)
==================
* Fixed issue [#544](https://github.com/jakubpawlowicz/clean-css/issues/544) - regression in same value merging.
* Fixed issue [#546](https://github.com/jakubpawlowicz/clean-css/issues/546) - IE<11 `calc()` issue.
[3.2.3 / 2015-04-22](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.2...v3.2.3)
==================
* Fixed issue [#541](https://github.com/jakubpawlowicz/clean-css/issues/541) - `outline-style:auto` in shorthand.
[3.2.2 / 2015-04-21](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.1...v3.2.2)
==================
* Fixed issue [#537](https://github.com/jakubpawlowicz/clean-css/issues/537) - regression in simple optimizer.
[3.2.1 / 2015-04-20](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.0...v3.2.1)
==================
* Fixed issue [#534](https://github.com/jakubpawlowicz/clean-css/issues/534) - wrong `@font-face` stringifying.
[3.2.0 / 2015-04-19](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.9...v3.2.0)
==================
* Bumps commander to 2.8.x.
* Fixes remote asset rebasing when passing data as a hash.
* Improves path resolution inside source maps.
* Makes `root` option implicitely default to `process.cwd()`.
* Fixed issue [#371](https://github.com/jakubpawlowicz/clean-css/issues/371) - `background` fallback with `none`.
* Fixed issue [#376](https://github.com/jakubpawlowicz/clean-css/issues/376) - option to disable `0[unit]` -> `0`.
* Fixed issue [#396](https://github.com/jakubpawlowicz/clean-css/issues/396) - better input source maps tracking.
* Fixed issue [#397](https://github.com/jakubpawlowicz/clean-css/issues/397) - support for source map sources.
* Fixed issue [#399](https://github.com/jakubpawlowicz/clean-css/issues/399) - support compacting with source maps.
* Fixed issue [#429](https://github.com/jakubpawlowicz/clean-css/issues/429) - unifies data tokenization.
* Fixed issue [#446](https://github.com/jakubpawlowicz/clean-css/issues/446) - `list-style` fuzzy matching.
* Fixed issue [#468](https://github.com/jakubpawlowicz/clean-css/issues/468) - bumps `source-map` to 0.4.x.
* Fixed issue [#480](https://github.com/jakubpawlowicz/clean-css/issues/480) - extracting uppercase property names.
* Fixed issue [#487](https://github.com/jakubpawlowicz/clean-css/issues/487) - source map paths under Windows.
* Fixed issue [#490](https://github.com/jakubpawlowicz/clean-css/issues/490) - vendor prefixed multivalue `background`.
* Fixed issue [#500](https://github.com/jakubpawlowicz/clean-css/issues/500) - merging duplicate adjacent properties.
* Fixed issue [#504](https://github.com/jakubpawlowicz/clean-css/issues/504) - keeping `url()` quotes.
* Fixed issue [#507](https://github.com/jakubpawlowicz/clean-css/issues/507) - merging longhands into many shorthands.
* Fixed issue [#508](https://github.com/jakubpawlowicz/clean-css/issues/508) - removing duplicate media queries.
* Fixed issue [#521](https://github.com/jakubpawlowicz/clean-css/issues/521) - unit optimizations inside `calc()`.
* Fixed issue [#524](https://github.com/jakubpawlowicz/clean-css/issues/524) - timeouts in `@import` inlining.
* Fixed issue [#526](https://github.com/jakubpawlowicz/clean-css/issues/526) - shorthand overriding into a function.
* Fixed issue [#528](https://github.com/jakubpawlowicz/clean-css/issues/528) - better support for IE<9 hacks.
* Fixed issue [#529](https://github.com/jakubpawlowicz/clean-css/issues/529) - wrong font weight minification.
[3.1.9 / 2015-04-04](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.8...v3.1.9)
==================
* Fixes issue [#511](https://github.com/jakubpawlowicz/clean-css/issues/511) - `)` advanced processing.
[3.1.8 / 2015-03-17](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.7...v3.1.8)
==================
* Fixes issue [#498](https://github.com/jakubpawlowicz/clean-css/issues/498) - reordering and flexbox.
* Fixes issue [#499](https://github.com/jakubpawlowicz/clean-css/issues/499) - too aggressive `-` removal.
[3.1.7 / 2015-03-16](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.6...v3.1.7)
==================
* Backports fix to [#480](https://github.com/jakubpawlowicz/clean-css/issues/480) - reordering and uppercase properties.
* Fixes issue [#496](https://github.com/jakubpawlowicz/clean-css/issues/496) - space after bracket removal.
[3.1.6 / 2015-03-12](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.5...v3.1.6)
==================
* Fixes issue [#489](https://github.com/jakubpawlowicz/clean-css/issues/489) - `AlphaImageLoader` IE filter.
[3.1.5 / 2015-03-06](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.4...v3.1.5)
==================
* Fixes issue [#483](https://github.com/jakubpawlowicz/clean-css/issues/483) - property order in restructuring.
[3.1.4 / 2015-03-04](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.3...v3.1.4)
==================
* Fixes issue [#472](https://github.com/jakubpawlowicz/clean-css/issues/472) - broken function minification.
* Fixes issue [#477](https://github.com/jakubpawlowicz/clean-css/issues/477) - `@import`s order in restructuring.
* Fixes issue [#478](https://github.com/jakubpawlowicz/clean-css/issues/478) - ultimate fix to brace whitespace.
[3.1.3 / 2015-03-03](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.2...v3.1.3)
==================
* Fixes issue [#464](https://github.com/jakubpawlowicz/clean-css/issues/464) - data URI with quoted braces.
* Fixes issue [#475](https://github.com/jakubpawlowicz/clean-css/issues/475) - whitespace after closing brace.
[3.1.2 / 2015-03-01](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.1...v3.1.2)
==================
* Refixed issue [#471](https://github.com/jakubpawlowicz/clean-css/issues/471) - correct order after restructuring.
* Fixes issue [#466](https://github.com/jakubpawlowicz/clean-css/issues/466) - rebuilding background shorthand.
* Fixes issue [#462](https://github.com/jakubpawlowicz/clean-css/issues/462) - escaped apostrophes in selectors.
[3.1.1 / 2015-02-27](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.0...v3.1.1)
==================
* Fixed issue [#469](https://github.com/jakubpawlowicz/clean-css/issues/469) - extracting broken property.
* Fixed issue [#470](https://github.com/jakubpawlowicz/clean-css/issues/470) - negative padding removal.
* Fixed issue [#471](https://github.com/jakubpawlowicz/clean-css/issues/471) - correct order after restructuring.
[3.1.0 / 2015-02-26](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.10...v3.1.0)
==================
* Adds `0deg` to `0` minification where possible.
* Adds better non-adjacent selector merging when body is the same.
* Adds official support for node.js 0.12.
* Adds official support for io.js 1.0.
* Adds restructuring optimizations to reorganize selectors, which vastly improves minification.
* Fixed issue [#158](https://github.com/jakubpawlowicz/clean-css/issues/158) - adds body-based selectors reduction.
* Fixed issue [#182](https://github.com/jakubpawlowicz/clean-css/issues/182) - removing space after closing brace.
* Fixed issue [#204](https://github.com/jakubpawlowicz/clean-css/issues/204) - `@media` merging.
* Fixed issue [#351](https://github.com/jakubpawlowicz/clean-css/issues/351) - remote `@import`s after content.
* Fixed issue [#357](https://github.com/jakubpawlowicz/clean-css/issues/357) - non-standard but valid URLs.
* Fixed issue [#416](https://github.com/jakubpawlowicz/clean-css/issues/416) - accepts hash as `minify` argument.
* Fixed issue [#419](https://github.com/jakubpawlowicz/clean-css/issues/419) - multiple input source maps.
* Fixed issue [#435](https://github.com/jakubpawlowicz/clean-css/issues/435) - `background-clip` in shorthand.
* Fixed issue [#439](https://github.com/jakubpawlowicz/clean-css/issues/439) - `background-origin` in shorthand.
* Fixed issue [#442](https://github.com/jakubpawlowicz/clean-css/issues/442) - space before adjacent `nav`.
* Fixed issue [#445](https://github.com/jakubpawlowicz/clean-css/issues/445) - regression issue in url processor.
* Fixed issue [#449](https://github.com/jakubpawlowicz/clean-css/issues/449) - warns of missing close braces.
* Fixed issue [#463](https://github.com/jakubpawlowicz/clean-css/issues/463) - relative remote `@import` URLs.
[3.0.10 / 2015-02-07](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.9...v3.0.10)
==================
* Fixed issue [#453](https://github.com/jakubpawlowicz/clean-css/issues/453) - double `background-repeat`.
* Fixed issue [#455](https://github.com/jakubpawlowicz/clean-css/issues/455) - property extracting regression.
[3.0.9 / 2015-02-04](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.8...v3.0.9)
==================
* Fixed issue [#452](https://github.com/jakubpawlowicz/clean-css/issues/452) - regression in advanced merging.
[3.0.8 / 2015-01-31](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.7...v3.0.8)
==================
* Fixed issue [#447](https://github.com/jakubpawlowicz/clean-css/issues/447) - `background-color` in shorthands.
* Fixed issue [#450](https://github.com/jakubpawlowicz/clean-css/issues/450) - name to hex color converting.
[3.0.7 / 2015-01-22](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.6...v3.0.7)
==================
* Fixed issue [#441](https://github.com/jakubpawlowicz/clean-css/issues/441) - hex to name color converting.
[3.0.6 / 2015-01-20](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.5...v3.0.6)
==================
* Refixed issue [#414](https://github.com/jakubpawlowicz/clean-css/issues/414) - source maps position fallback.
[3.0.5 / 2015-01-18](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.4...v3.0.5)
==================
* Fixed issue [#414](https://github.com/jakubpawlowicz/clean-css/issues/414) - source maps position fallback.
* Fixed issue [#433](https://github.com/jakubpawlowicz/clean-css/issues/433) - meging `!important` in shorthands.
[3.0.4 / 2015-01-11](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.3...v3.0.4)
==================
* Fixed issue [#314](https://github.com/jakubpawlowicz/clean-css/issues/314) - spaces inside `calc`.
[3.0.3 / 2015-01-07](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.2...v3.0.3)
==================
* Just a version bump as npm incorrectly things 2.2.23 is the latest one.
[3.0.2 / 2015-01-04](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.1...v3.0.2)
==================
* Fixed issue [#422](https://github.com/jakubpawlowicz/clean-css/issues/422) - handling `calc` as a unit.
[3.0.1 / 2014-12-19](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.0...v3.0.1)
==================
* Fixed issue [#410](https://github.com/jakubpawlowicz/clean-css/issues/410) - advanced merging and comments.
* Fixed issue [#411](https://github.com/jakubpawlowicz/clean-css/issues/411) - properties and important comments.
[3.0.0 / 2014-12-18](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.22...v3.0.0)
==================
* Adds more granular control over compatibility settings.
* Adds support for @counter-style at-rule.
* Adds `--source-map`/`sourceMap` switch for building input's source map.
* Adds `--skip-shorthand-compacting`/`shorthandComacting` option for disabling shorthand compacting.
* Allows `target` option to be a path to a folder instead of a file.
* Allows disabling rounding precision. By [@superlukas](https://github.com/superlukas).
* Breaks 2.x compatibility for using CleanCSS as a function.
* Changes `minify` method output to handle multiple outputs.
* Reworks minification to tokenize first then minify.
See [changes](https://github.com/jakubpawlowicz/clean-css/compare/b06f37d...dd8c14a).
* Removes support for node.js 0.8.x.
* Renames `noAdvanced` option into `advanced`.
* Renames `noAggressiveMerging` option into `aggressiveMerging`.
* Renames `noRebase` option into `rebase`.
* Speeds up advanced processing by shortening optimize loop.
* Fixed issue [#125](https://github.com/jakubpawlowicz/clean-css/issues/125) - source maps!
* Fixed issue [#344](https://github.com/jakubpawlowicz/clean-css/issues/344) - merging `background-size` into shorthand.
* Fixed issue [#352](https://github.com/jakubpawlowicz/clean-css/issues/352) - honors rebasing in imported stylesheets.
* Fixed issue [#360](https://github.com/jakubpawlowicz/clean-css/issues/360) - adds 7 extra CSS colors.
* Fixed issue [#363](https://github.com/jakubpawlowicz/clean-css/issues/363) - `rem` units overriding `px`.
* Fixed issue [#373](https://github.com/jakubpawlowicz/clean-css/issues/373) - proper `background` shorthand merging.
* Fixed issue [#395](https://github.com/jakubpawlowicz/clean-css/issues/395) - unescaped brackets in data URIs.
* Fixed issue [#398](https://github.com/jakubpawlowicz/clean-css/issues/398) - restoring important comments.
* Fixed issue [#400](https://github.com/jakubpawlowicz/clean-css/issues/400) - API to accept an array of filenames.
* Fixed issue [#403](https://github.com/jakubpawlowicz/clean-css/issues/403) - tracking input files in source maps.
* Fixed issue [#404](https://github.com/jakubpawlowicz/clean-css/issues/404) - no state sharing in API.
* Fixed issue [#405](https://github.com/jakubpawlowicz/clean-css/issues/405) - disables default `background-size` merging.
* Refixed issue [#304](https://github.com/jakubpawlowicz/clean-css/issues/304) - `background-position` merging.
[2.2.22 / 2014-12-13](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.21...v2.2.22)
==================
* Backports fix to issue [#304](https://github.com/jakubpawlowicz/clean-css/issues/304) - `background-position` merging.
[2.2.21 / 2014-12-10](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.20...v2.2.21)
==================
* Backports fix to issue [#373](https://github.com/jakubpawlowicz/clean-css/issues/373) - `background` shorthand merging.
[2.2.20 / 2014-12-02](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.19...v2.2.20)
==================
* Backports fix to issue [#390](https://github.com/jakubpawlowicz/clean-css/issues/390) - pseudo-class merging.
[2.2.19 / 2014-11-20](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.18...v2.2.19)
==================
* Fixed issue [#385](https://github.com/jakubpawlowicz/clean-css/issues/385) - edge cases in processing cut off data.
[2.2.18 / 2014-11-17](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.17...v2.2.18)
==================
* Fixed issue [#383](https://github.com/jakubpawlowicz/clean-css/issues/383) - rounding fractions once again.
[2.2.17 / 2014-11-09](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.16...v2.2.17)
==================
* Fixed issue [#380](https://github.com/jakubpawlowicz/clean-css/issues/380) - rounding fractions to a whole number.
[2.2.16 / 2014-09-16](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.15...v2.2.16)
==================
* Fixed issue [#359](https://github.com/jakubpawlowicz/clean-css/issues/359) - handling escaped double backslash.
* Fixed issue [#358](https://github.com/jakubpawlowicz/clean-css/issues/358) - property merging in compatibility mode.
* Fixed issue [#356](https://github.com/jakubpawlowicz/clean-css/issues/356) - preserving `*+html` hack.
* Fixed issue [#354](https://github.com/jakubpawlowicz/clean-css/issues/354) - `!important` overriding in shorthands.
[2.2.15 / 2014-09-01](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.14...v2.2.15)
==================
* Fixed issue [#343](https://github.com/jakubpawlowicz/clean-css/issues/343) - too aggressive `rgba`/`hsla` minification.
* Fixed issue [#345](https://github.com/jakubpawlowicz/clean-css/issues/345) - URL rebasing for document relative ones.
* Fixed issue [#346](https://github.com/jakubpawlowicz/clean-css/issues/346) - overriding `!important` by `!important`.
* Fixed issue [#350](https://github.com/jakubpawlowicz/clean-css/issues/350) - edge cases in `@import` processing.
[2.2.14 / 2014-08-25](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.13...v2.2.14)
==================
* Makes multival operations idempotent.
* Fixed issue [#339](https://github.com/jakubpawlowicz/clean-css/issues/339) - skips invalid properties.
* Fixed issue [#341](https://github.com/jakubpawlowicz/clean-css/issues/341) - ensure output is shorter than input.
[2.2.13 / 2014-08-12](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.12...v2.2.13)
==================
* Fixed issue [#337](https://github.com/jakubpawlowicz/clean-css/issues/337) - handling component importance.
[2.2.12 / 2014-08-02](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.11...v2.2.12)
==================
* Fixed issue with tokenizer removing first selector after an unknown @ rule.
* Fixed issue [#329](https://github.com/jakubpawlowicz/clean-css/issues/329) - `font` shorthands incorrectly processed.
* Fixed issue [#332](https://github.com/jakubpawlowicz/clean-css/issues/332) - `background` shorthand with colors.
* Refixed issue [#325](https://github.com/jakubpawlowicz/clean-css/issues/325) - invalid charset declarations.
[2.2.11 / 2014-07-28](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.10...v2.2.11)
==================
* Fixed issue [#326](https://github.com/jakubpawlowicz/clean-css/issues/326) - `background-size` regression.
[2.2.10 / 2014-07-27](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.9...v2.2.10)
==================
* Improved performance of advanced mode validators.
* Fixed issue [#307](https://github.com/jakubpawlowicz/clean-css/issues/307) - `background-color` in multiple backgrounds.
* Fixed issue [#322](https://github.com/jakubpawlowicz/clean-css/issues/322) - adds `background-size` support.
* Fixed issue [#323](https://github.com/jakubpawlowicz/clean-css/issues/323) - stripping variable references.
* Fixed issue [#325](https://github.com/jakubpawlowicz/clean-css/issues/325) - removing invalid `@charset` declarations.
[2.2.9 / 2014-07-23](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.8...v2.2.9)
==================
* Adds `background` normalization according to W3C spec.
* Fixed issue [#316](https://github.com/jakubpawlowicz/clean-css/issues/316) - incorrect `background` processing.
[2.2.8 / 2014-07-14](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.7...v2.2.8)
==================
* Fixed issue [#313](https://github.com/jakubpawlowicz/clean-css/issues/313) - processing comment marks in URLs.
* Fixed issue [#315](https://github.com/jakubpawlowicz/clean-css/issues/315) - `rgba`/`hsla` -> `transparent` in gradients.
[2.2.7 / 2014-07-10](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.6...v2.2.7)
==================
* Fixed issue [#304](https://github.com/jakubpawlowicz/clean-css/issues/304) - merging multiple backgrounds.
* Fixed issue [#312](https://github.com/jakubpawlowicz/clean-css/issues/312) - merging with mixed repeat.
[2.2.6 / 2014-07-05](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.5...v2.2.6)
==================
* Adds faster quote matching in QuoteScanner.
* Improves QuoteScanner to handle comments correctly.
* Fixed issue [#308](https://github.com/jakubpawlowicz/clean-css/issues/308) - parsing comments in quoted URLs.
* Fixed issue [#311](https://github.com/jakubpawlowicz/clean-css/issues/311) - leading/trailing decimal points.
[2.2.5 / 2014-06-29](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.4...v2.2.5)
==================
* Adds removing extra spaces around / in border-radius.
* Adds replacing same horizontal & vertical value in border-radius.
* Fixed issue [#305](https://github.com/jakubpawlowicz/clean-css/issues/305) - allows width keywords in `border-width`.
[2.2.4 / 2014-06-27](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.3...v2.2.4)
==================
* Fixed issue [#301](https://github.com/jakubpawlowicz/clean-css/issues/301) - proper `border-radius` processing.
* Fixed issue [#303](https://github.com/jakubpawlowicz/clean-css/issues/303) - correctly preserves viewport units.
[2.2.3 / 2014-06-24](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.2...v2.2.3)
==================
* Fixed issue [#302](https://github.com/jakubpawlowicz/clean-css/issues/302) - handling of `outline-style: auto`.
[2.2.2 / 2014-06-18](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.1...v2.2.2)
==================
* Fixed issue [#297](https://github.com/jakubpawlowicz/clean-css/issues/297) - `box-shadow` zeros minification.
[2.2.1 / 2014-06-14](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.0...v2.2.1)
==================
* Fixes new property optimizer for 'none' values.
* Fixed issue [#294](https://github.com/jakubpawlowicz/clean-css/issues/294) - space after `rgba`/`hsla` in IE<=11.
[2.2.0 / 2014-06-11](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.8...v2.2.0)
==================
* Adds a better algorithm for quotation marks' removal.
* Adds a better non-adjacent optimizer compatible with the upcoming new property optimizer.
* Adds minifying remote files directly from CLI.
* Adds `--rounding-precision` to control rounding precision.
* Moves quotation matching into a `QuoteScanner` class.
* Adds `npm run browserify` for creating embeddable version of clean-css.
* Fixed list-style-* advanced processing.
* Fixed issue [#134](https://github.com/jakubpawlowicz/clean-css/issues/134) - merges properties into shorthand form.
* Fixed issue [#164](https://github.com/jakubpawlowicz/clean-css/issues/164) - removes default values if not needed.
* Fixed issue [#168](https://github.com/jakubpawlowicz/clean-css/issues/168) - adds better property merging algorithm.
* Fixed issue [#173](https://github.com/jakubpawlowicz/clean-css/issues/173) - merges same properties if grouped.
* Fixed issue [#184](https://github.com/jakubpawlowicz/clean-css/issues/184) - uses `!important` for optimization opportunities.
* Fixed issue [#190](https://github.com/jakubpawlowicz/clean-css/issues/190) - uses shorthand to override another shorthand.
* Fixed issue [#197](https://github.com/jakubpawlowicz/clean-css/issues/197) - adds borders merging by understandability.
* Fixed issue [#210](https://github.com/jakubpawlowicz/clean-css/issues/210) - adds temporary workaround for aggressive merging.
* Fixed issue [#246](https://github.com/jakubpawlowicz/clean-css/issues/246) - removes IE hacks when not in compatibility mode.
* Fixed issue [#247](https://github.com/jakubpawlowicz/clean-css/issues/247) - removes deprecated `selectorsMergeMode` switch.
* Refixed issue [#250](https://github.com/jakubpawlowicz/clean-css/issues/250) - based on new quotation marks removal.
* Fixed issue [#257](https://github.com/jakubpawlowicz/clean-css/issues/257) - turns `rgba`/`hsla` to `transparent` if possible.
* Fixed issue [#265](https://github.com/jakubpawlowicz/clean-css/issues/265) - adds support for multiple input files.
* Fixed issue [#275](https://github.com/jakubpawlowicz/clean-css/issues/275) - handling transform properties.
* Fixed issue [#276](https://github.com/jakubpawlowicz/clean-css/issues/276) - corrects unicode handling.
* Fixed issue [#288](https://github.com/jakubpawlowicz/clean-css/issues/288) - adds smarter expression parsing.
* Fixed issue [#293](https://github.com/jakubpawlowicz/clean-css/issues/293) - handles escaped `@` symbols in class names and IDs.
[2.1.8 / 2014-03-28](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.7...v2.1.8)
==================
* Fixed issue [#267](https://github.com/jakubpawlowicz/clean-css/issues/267) - incorrect non-adjacent selector merging.
[2.1.7 / 2014-03-24](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.6...v2.1.7)
==================
* Fixed issue [#264](https://github.com/jakubpawlowicz/clean-css/issues/264) - `@import` statements inside comments.
[2.1.6 / 2014-03-10](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.5...v2.1.6)
==================
* Fixed issue [#258](https://github.com/jakubpawlowicz/clean-css/issues/258) - wrong `@import` handling in `EmptyRemoval`.
[2.1.5 / 2014-03-07](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.4...v2.1.5)
==================
* Fixed issue [#255](https://github.com/jakubpawlowicz/clean-css/issues/255) - incorrect processing of a trailing `-0`.
[2.1.4 / 2014-03-01](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.3...v2.1.4)
==================
* Fixed issue [#250](https://github.com/jakubpawlowicz/clean-css/issues/250) - correctly handle JSON data in quotations.
[2.1.3 / 2014-02-26](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.2...v2.1.3)
==================
* Fixed issue [#248](https://github.com/jakubpawlowicz/clean-css/issues/248) - incorrect merging for vendor selectors.
[2.1.2 / 2014-02-25](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.1...v2.1.2)
==================
* Fixed issue [#245](https://github.com/jakubpawlowicz/clean-css/issues/245) - incorrect handling of backslash IE hack.
[2.1.1 / 2014-02-18](https://github.com/jakubpawlowicz/clean-css/compare/v2.1.0...v2.1.1)
==================
* Adds faster selectors processing in advanced optimizer.
* Fixed issue [#241](https://github.com/jakubpawlowicz/clean-css/issues/241) - incorrect handling of `:not()` selectors.
[2.1.0 / 2014-02-13](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.8...v2.1.0)
==================
* Adds an optional callback to minify method.
* Deprecates `--selectors-merge-mode` / `selectorsMergeMode` in favor to `--compatibility` / `compatibility`.
* Fixes debug mode stats for stylesheets using `@import` statements.
* Skips empty removal if advanced processing is enabled.
* Fixed issue [#85](https://github.com/jakubpawlowicz/clean-css/issues/85) - resolving protocol `@import`s.
* Fixed issue [#160](https://github.com/jakubpawlowicz/clean-css/issues/160) - re-runs optimizer until a clean pass.
* Fixed issue [#161](https://github.com/jakubpawlowicz/clean-css/issues/161) - improves tokenizer performance.
* Fixed issue [#163](https://github.com/jakubpawlowicz/clean-css/issues/163) - round pixels to 2nd decimal place.
* Fixed issue [#165](https://github.com/jakubpawlowicz/clean-css/issues/165) - extra space after trailing parenthesis.
* Fixed issue [#186](https://github.com/jakubpawlowicz/clean-css/issues/186) - strip unit from `0rem`.
* Fixed issue [#207](https://github.com/jakubpawlowicz/clean-css/issues/207) - bug in parsing protocol `@import`s.
* Fixed issue [#213](https://github.com/jakubpawlowicz/clean-css/issues/213) - faster `rgb` to `hex` transforms.
* Fixed issue [#215](https://github.com/jakubpawlowicz/clean-css/issues/215) - leading zeros in numerical values.
* Fixed issue [#217](https://github.com/jakubpawlowicz/clean-css/issues/217) - whitespace inside attribute selectors and URLs.
* Fixed issue [#218](https://github.com/jakubpawlowicz/clean-css/issues/218) - `@import` statements cleanup.
* Fixed issue [#220](https://github.com/jakubpawlowicz/clean-css/issues/220) - selector between comments.
* Fixed issue [#223](https://github.com/jakubpawlowicz/clean-css/issues/223) - two-pass adjacent selectors merging.
* Fixed issue [#226](https://github.com/jakubpawlowicz/clean-css/issues/226) - don't minify `border:none` to `border:0`.
* Fixed issue [#229](https://github.com/jakubpawlowicz/clean-css/issues/229) - improved processing of fraction numbers.
* Fixed issue [#230](https://github.com/jakubpawlowicz/clean-css/issues/230) - better handling of zero values.
* Fixed issue [#235](https://github.com/jakubpawlowicz/clean-css/issues/235) - IE7 compatibility mode.
* Fixed issue [#236](https://github.com/jakubpawlowicz/clean-css/issues/236) - incorrect rebasing with nested `import`s.
[2.0.8 / 2014-02-07](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.7...v2.0.8)
==================
* Fixed issue [#232](https://github.com/jakubpawlowicz/clean-css/issues/232) - edge case in non-adjacent selectors merging.
[2.0.7 / 2014-01-16](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.6...v2.0.7)
==================
* Fixed issue [#208](https://github.com/jakubpawlowicz/clean-css/issues/208) - don't swallow `@page` and `@viewport`.
[2.0.6 / 2014-01-04](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.5...v2.0.6)
==================
* Fixed issue [#198](https://github.com/jakubpawlowicz/clean-css/issues/198) - process comments and `@import`s correctly.
* Fixed issue [#205](https://github.com/jakubpawlowicz/clean-css/issues/205) - freeze on broken `@import` declaration.
[2.0.5 / 2014-01-03](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.4...v2.0.5)
==================
* Fixed issue [#199](https://github.com/jakubpawlowicz/clean-css/issues/199) - keep line breaks with no advanced optimizations.
* Fixed issue [#203](https://github.com/jakubpawlowicz/clean-css/issues/203) - Buffer as a first argument to minify method.
[2.0.4 / 2013-12-19](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.3...v2.0.4)
==================
* Fixed issue [#193](https://github.com/jakubpawlowicz/clean-css/issues/193) - HSL color space normalization.
[2.0.3 / 2013-12-18](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.2...v2.0.3)
==================
* Fixed issue [#191](https://github.com/jakubpawlowicz/clean-css/issues/191) - leading numbers in `font`/`animation` names.
* Fixed issue [#192](https://github.com/jakubpawlowicz/clean-css/issues/192) - many `@import`s inside a comment.
[2.0.2 / 2013-11-18](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.1...v2.0.2)
==================
* Fixed issue [#177](https://github.com/jakubpawlowicz/clean-css/issues/177) - process broken content correctly.
[2.0.1 / 2013-11-14](https://github.com/jakubpawlowicz/clean-css/compare/v2.0.0...v2.0.1)
==================
* Fixed issue [#176](https://github.com/jakubpawlowicz/clean-css/issues/176) - hangs on `undefined` keyword.
[2.0.0 / 2013-11-04](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.7...v2.0.0)
==================
* Adds simplified and more advanced text escaping / restoring via `EscapeStore` class.
* Adds simplified and much faster empty elements removal.
* Adds missing `@import` processing to our benchmark (run via `npm run bench`).
* Adds CSS tokenizer which will make it possible to optimize content by reordering and/or merging selectors.
* Adds basic optimizer removing duplicate selectors from a list.
* Adds merging duplicate properties within a single selector's body.
* Adds merging adjacent selectors within a scope (single and multiple ones).
* Changes behavior of `--keep-line-breaks`/`keepBreaks` option to keep breaks after trailing braces only.
* Makes all multiple selectors ordered alphabetically (aids merging).
* Adds property overriding so more coarse properties override more granular ones.
* Adds reducing non-adjacent selectors.
* Adds `--skip-advanced`/`noAdvanced` switch to disable advanced optimizations.
* Adds reducing non-adjacent selectors when overridden by more complex selectors.
* Fixed issue [#138](https://github.com/jakubpawlowicz/clean-css/issues/138) - makes CleanCSS interface OO.
* Fixed issue [#139](https://github.com/jakubpawlowicz/clean-css/issues/138) - consistent error & warning handling.
* Fixed issue [#145](https://github.com/jakubpawlowicz/clean-css/issues/145) - debug mode in library too.
* Fixed issue [#157](https://github.com/jakubpawlowicz/clean-css/issues/157) - gets rid of `removeEmpty` option.
* Fixed issue [#159](https://github.com/jakubpawlowicz/clean-css/issues/159) - escaped quotes inside content.
* Fixed issue [#162](https://github.com/jakubpawlowicz/clean-css/issues/162) - strip quotes from Base64 encoded URLs.
* Fixed issue [#166](https://github.com/jakubpawlowicz/clean-css/issues/166) - `debug` formatting in CLI
* Fixed issue [#167](https://github.com/jakubpawlowicz/clean-css/issues/167) - `background:transparent` minification.
[1.1.7 / 2013-10-28](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.6...v1.1.7)
==================
* Fixed issue [#156](https://github.com/jakubpawlowicz/clean-css/issues/156) - `@import`s inside comments.
[1.1.6 / 2013-10-26](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.5...v1.1.6)
==================
* Fixed issue [#155](https://github.com/jakubpawlowicz/clean-css/issues/155) - broken irregular CSS content.
[1.1.5 / 2013-10-24](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.4...v1.1.5)
==================
* Fixed issue [#153](https://github.com/jakubpawlowicz/clean-css/issues/153) - `keepSpecialComments` `0`/`1` as a string.
[1.1.4 / 2013-10-23](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.3...v1.1.4)
==================
* Fixed issue [#152](https://github.com/jakubpawlowicz/clean-css/issues/152) - adds an option to disable rebasing.
[1.1.3 / 2013-10-04](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.2...v1.1.3)
==================
* Fixed issue [#150](https://github.com/jakubpawlowicz/clean-css/issues/150) - minifying `background:none`.
[1.1.2 / 2013-09-29](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.1...v1.1.2)
==================
* Fixed issue [#149](https://github.com/jakubpawlowicz/clean-css/issues/149) - shorthand `font` property.
[1.1.1 / 2013-09-07](https://github.com/jakubpawlowicz/clean-css/compare/v1.1.0...v1.1.1)
==================
* Fixed issue [#144](https://github.com/jakubpawlowicz/clean-css/issues/144) - skip URLs rebasing by default.
[1.1.0 / 2013-09-06](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.12...v1.1.0)
==================
* Renamed lib's `debug` option to `benchmark` when doing per-minification benchmarking.
* Added simplified comments processing & imports.
* Fixed issue [#43](https://github.com/jakubpawlowicz/clean-css/issues/43) - `--debug` switch for minification stats.
* Fixed issue [#65](https://github.com/jakubpawlowicz/clean-css/issues/65) - full color name / hex shortening.
* Fixed issue [#84](https://github.com/jakubpawlowicz/clean-css/issues/84) - support for `@import` with media queries.
* Fixed issue [#124](https://github.com/jakubpawlowicz/clean-css/issues/124) - raise error on broken imports.
* Fixed issue [#126](https://github.com/jakubpawlowicz/clean-css/issues/126) - proper CSS expressions handling.
* Fixed issue [#129](https://github.com/jakubpawlowicz/clean-css/issues/129) - rebasing imported URLs.
* Fixed issue [#130](https://github.com/jakubpawlowicz/clean-css/issues/130) - better code modularity.
* Fixed issue [#135](https://github.com/jakubpawlowicz/clean-css/issues/135) - require node.js 0.8+.
[1.0.12 / 2013-07-19](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.11...v1.0.12)
===================
* Fixed issue [#121](https://github.com/jakubpawlowicz/clean-css/issues/121) - ability to skip `@import` processing.
[1.0.11 / 2013-07-08](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.10...v1.0.11)
===================
* Fixed issue [#117](https://github.com/jakubpawlowicz/clean-css/issues/117) - line break escaping in comments.
[1.0.10 / 2013-06-13](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.9...v1.0.10)
===================
* Fixed issue [#114](https://github.com/jakubpawlowicz/clean-css/issues/114) - comments in imported stylesheets.
[1.0.9 / 2013-06-11](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.8...v1.0.9)
==================
* Fixed issue [#113](https://github.com/jakubpawlowicz/clean-css/issues/113) - `@import` in comments.
[1.0.8 / 2013-06-10](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.7...v1.0.8)
==================
* Fixed issue [#112](https://github.com/jakubpawlowicz/clean-css/issues/112) - reducing `box-shadow` zeros.
[1.0.7 / 2013-06-05](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.6...v1.0.7)
==================
* Support for `@import` URLs starting with `//`. By [@petetak](https://github.com/petetak).
[1.0.6 / 2013-06-04](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.5...v1.0.6)
==================
* Fixed issue [#110](https://github.com/jakubpawlowicz/clean-css/issues/110) - data URIs in URLs.
[1.0.5 / 2013-05-26](https://github.com/jakubpawlowicz/clean-css/compare/v1.0.4...v1.0.5)
==================
* Fixed issue [#107](https://github.com/jakubpawlowicz/clean-css/issues/107) - data URIs in imported stylesheets.
1.0.4 / 2013-05-23
==================
* Rewrite relative URLs in imported stylesheets. By [@bluej100](https://github.com/bluej100).
1.0.3 / 2013-05-20
==================
* Support alternative `@import` syntax with file name not wrapped inside `url()` statement.
By [@bluej100](https://github.com/bluej100).
1.0.2 / 2013-04-29
==================
* Fixed issue [#97](https://github.com/jakubpawlowicz/clean-css/issues/97) - `--remove-empty` & FontAwesome.
1.0.1 / 2013-04-08
==================
* Do not pick up `bench` and `test` while building `npm` package.
By [@sindresorhus](https://https://github.com/sindresorhus).
1.0.0 / 2013-03-30
==================
* Fixed issue [#2](https://github.com/jakubpawlowicz/clean-css/issues/2) - resolving `@import` rules.
* Fixed issue [#44](https://github.com/jakubpawlowicz/clean-css/issues/44) - examples in `--help`.
* Fixed issue [#46](https://github.com/jakubpawlowicz/clean-css/issues/46) - preserving special characters in URLs and attributes.
* Fixed issue [#80](https://github.com/jakubpawlowicz/clean-css/issues/80) - quotation in multi line strings.
* Fixed issue [#83](https://github.com/jakubpawlowicz/clean-css/issues/83) - HSL to hex color conversions.
* Fixed issue [#86](https://github.com/jakubpawlowicz/clean-css/issues/86) - broken `@charset` replacing.
* Fixed issue [#88](https://github.com/jakubpawlowicz/clean-css/issues/88) - removes space in `! important`.
* Fixed issue [#92](https://github.com/jakubpawlowicz/clean-css/issues/92) - uppercase hex to short versions.
0.10.2 / 2013-03-19
===================
* Fixed issue [#79](https://github.com/jakubpawlowicz/clean-css/issues/79) - node.js 0.10.x compatibility.
0.10.1 / 2013-02-14
===================
* Fixed issue [#66](https://github.com/jakubpawlowicz/clean-css/issues/66) - line breaks without extra spaces should
be handled correctly.
0.10.0 / 2013-02-09
===================
* Switched from [optimist](https://github.com/substack/node-optimist) to
[commander](https://github.com/visionmedia/commander.js) for CLI processing.
* Changed long options from `--removeempty` to `--remove-empty` and from `--keeplinebreaks` to `--keep-line-breaks`.
* Fixed performance issue with replacing multiple `@charset` declarations and issue
with line break after `@charset` when using `keepLineBreaks` option. By [@rrjaime](https://github.com/rrjamie).
* Removed Makefile in favor to `npm run` commands (e.g. `make check` -> `npm run check`).
* Fixed issue [#47](https://github.com/jakubpawlowicz/clean-css/issues/47) - commandline issues on Windows.
* Fixed issue [#49](https://github.com/jakubpawlowicz/clean-css/issues/49) - remove empty selectors from media query.
* Fixed issue [#52](https://github.com/jakubpawlowicz/clean-css/issues/52) - strip fraction zeros if not needed.
* Fixed issue [#58](https://github.com/jakubpawlowicz/clean-css/issues/58) - remove colon where possible.
* Fixed issue [#59](https://github.com/jakubpawlowicz/clean-css/issues/59) - content property handling.
0.9.1 / 2012-12-19
==================
* Fixed issue [#37](https://github.com/jakubpawlowicz/clean-css/issues/37) - converting
`white` and other colors in class names (reported by [@malgorithms](https://github.com/malgorithms)).
0.9.0 / 2012-12-15
==================
* Added stripping quotation from font names (if possible).
* Added stripping quotation from `@keyframes` declaration, `animation` and
`animation-name` property.
* Added stripping quotations from attributes' value (e.g. `[data-target='x']`).
* Added better hex->name and name->hex color shortening.
* Added `font: normal` and `font: bold` shortening the same way as `font-weight` is.
* Refactored shorthand selectors and added `border-radius`, `border-style`
and `border-color` shortening.
* Added `margin`, `padding` and `border-width` shortening.
* Added removing line break after commas.
* Fixed removing whitespace inside media query definition.
* Added removing line breaks after a comma, so all declarations are one-liners now.
* Speed optimizations (~10% despite many new features).
* Added [JSHint](https://github.com/jshint/jshint/) validation rules via `make check`.
0.8.3 / 2012-11-29
==================
* Fixed HSL/HSLA colors processing.
0.8.2 / 2012-10-31
==================
* Fixed shortening hex colors and their relation to hashes in URLs.
* Cleanup by [@XhmikosR](https://github.com/XhmikosR).
0.8.1 / 2012-10-28
==================
* Added better zeros processing for `rect(...)` syntax (clip property).
0.8.0 / 2012-10-21
==================
* Added removing URLs quotation if possible.
* Rewrote breaks processing.
* Added `keepBreaks`/`-b` option to keep line breaks in the minimized file.
* Reformatted [lib/clean.js](/lib/clean.js) so it's easier to follow the rules.
* Minimized test data is now minimized with line breaks so it's easier to
compare the changes line by line.
0.7.0 / 2012-10-14
==================
* Added stripping special comments to CLI (`--s0` and `--s1` options).
* Added stripping special comments to programmatic interface
(`keepSpecialComments` option).
0.6.0 / 2012-08-05
==================
* Full Windows support with tests (./test.bat).
0.5.0 / 2012-08-02
==================
* Made path to vows local.
* Explicit node.js 0.6 requirement.
0.4.2 / 2012-06-28
==================
* Updated binary `-v` option (version).
* Updated binary to output help when no options given (but not in piped mode).
* Added binary tests.
0.4.1 / 2012-06-10
==================
* Fixed stateless mode where calling `CleanCSS#process` directly was giving
errors (reported by [@facelessuser](https://github.com/facelessuser)).
0.4.0 / 2012-06-04
==================
* Speed improvements up to 4x thanks to the rewrite of comments and CSS' content
processing.
* Stripping empty CSS tags is now optional (see [bin/cleancss](/bin/cleancss) for details).
* Improved debugging mode (see [test/bench.js](/test/bench.js))
* Added `make bench` for a one-pass benchmark.
0.3.3 / 2012-05-27
==================
* Fixed tests, [package.json](/package.json) for development, and regex
for removing empty declarations (thanks to [@vvo](https://github.com/vvo)).
0.3.2 / 2012-01-17
==================
* Fixed output method under node.js 0.6 which incorrectly tried to close
`process.stdout`.
0.3.1 / 2011-12-16
==================
* Fixed cleaning up `0 0 0 0` expressions.
0.3.0 / 2011-11-29
==================
* Clean-css requires node.js 0.4.0+ to run.
* Removed node.js's 0.2.x 'sys' package dependency
(thanks to [@jmalonzo](https://github.com/jmalonzo) for a patch).
0.2.6 / 2011-11-27
==================
* Fixed expanding `+` signs in `calc()` when mixed up with adjacent `+` selector.
0.2.5 / 2011-11-27
==================
* Fixed issue with cleaning up spaces inside `calc`/`-moz-calc` declarations
(thanks to [@cvan](https://github.com/cvan) for reporting it).
* Fixed converting `#f00` to `red` in borders and gradients.
0.2.4 / 2011-05-25
==================
* Fixed problem with expanding `none` to `0` in partial/full background
declarations.
* Fixed including clean-css library from binary (global to local).
0.2.3 / 2011-04-18
==================
* Fixed problem with optimizing IE filters.
0.2.2 / 2011-04-17
==================
* Fixed problem with space before color in `border` property.
0.2.1 / 2011-03-19
==================
* Added stripping space before `!important` keyword.
* Updated repository location and author information in [package.json](/package.json).
0.2.0 / 2011-03-02
==================
* Added options parsing via optimist.
* Changed code inclusion (thus the version bump).
0.1.0 / 2011-02-27
==================
* First version of clean-css library.
* Implemented all basic CSS transformations.
node_modules/clean-css/lib/utils/is-https-resource.js 0000666 00000000235 15042511722 0016740 0 ustar 00 var HTTPS_RESOURCE_PATTERN = /^https:\/\//;
function isHttpsResource(uri) {
return HTTPS_RESOURCE_PATTERN.test(uri);
}
module.exports = isHttpsResource;
node_modules/clean-css/lib/utils/split.js 0000666 00000002131 15042511722 0014470 0 ustar 00 var Marker = require('../tokenizer/marker');
function split(value, separator) {
var openLevel = Marker.OPEN_ROUND_BRACKET;
var closeLevel = Marker.CLOSE_ROUND_BRACKET;
var level = 0;
var cursor = 0;
var lastStart = 0;
var lastValue;
var lastCharacter;
var len = value.length;
var parts = [];
if (value.indexOf(separator) == -1) {
return [value];
}
if (value.indexOf(openLevel) == -1) {
return value.split(separator);
}
while (cursor < len) {
if (value[cursor] == openLevel) {
level++;
} else if (value[cursor] == closeLevel) {
level--;
}
if (level === 0 && cursor > 0 && cursor + 1 < len && value[cursor] == separator) {
parts.push(value.substring(lastStart, cursor));
lastStart = cursor + 1;
}
cursor++;
}
if (lastStart < cursor + 1) {
lastValue = value.substring(lastStart);
lastCharacter = lastValue[lastValue.length - 1];
if (lastCharacter == separator) {
lastValue = lastValue.substring(0, lastValue.length - 1);
}
parts.push(lastValue);
}
return parts;
}
module.exports = split;
node_modules/clean-css/lib/utils/is-remote-resource.js 0000666 00000000246 15042511722 0017073 0 ustar 00 var REMOTE_RESOURCE_PATTERN = /^(\w+:\/\/|\/\/)/;
function isRemoteResource(uri) {
return REMOTE_RESOURCE_PATTERN.test(uri);
}
module.exports = isRemoteResource;
node_modules/clean-css/lib/utils/has-protocol.js 0000666 00000000234 15042511722 0015751 0 ustar 00 var NO_PROTOCOL_RESOURCE_PATTERN = /^\/\//;
function hasProtocol(uri) {
return !NO_PROTOCOL_RESOURCE_PATTERN.test(uri);
}
module.exports = hasProtocol;
node_modules/clean-css/lib/utils/override.js 0000666 00000001331 15042511722 0015155 0 ustar 00 function override(source1, source2) {
var target = {};
var key1;
var key2;
var item;
for (key1 in source1) {
item = source1[key1];
if (Array.isArray(item)) {
target[key1] = item.slice(0);
} else if (typeof item == 'object' && item !== null) {
target[key1] = override(item, {});
} else {
target[key1] = item;
}
}
for (key2 in source2) {
item = source2[key2];
if (key2 in target && Array.isArray(item)) {
target[key2] = item.slice(0);
} else if (key2 in target && typeof item == 'object' && item !== null) {
target[key2] = override(target[key2], item);
} else {
target[key2] = item;
}
}
return target;
}
module.exports = override;
node_modules/clean-css/lib/utils/clone-array.js 0000666 00000000361 15042511722 0015554 0 ustar 00 function cloneArray(array) {
var cloned = array.slice(0);
for (var i = 0, l = cloned.length; i < l; i++) {
if (Array.isArray(cloned[i]))
cloned[i] = cloneArray(cloned[i]);
}
return cloned;
}
module.exports = cloneArray;
node_modules/clean-css/lib/utils/format-position.js 0000666 00000000357 15042511722 0016477 0 ustar 00 function formatPosition(metadata) {
var line = metadata[0];
var column = metadata[1];
var source = metadata[2];
return source ?
source + ':' + line + ':' + column :
line + ':' + column;
}
module.exports = formatPosition;
node_modules/clean-css/lib/utils/is-import.js 0000666 00000000217 15042511722 0015263 0 ustar 00 var IMPORT_PREFIX_PATTERN = /^@import/i;
function isImport(value) {
return IMPORT_PREFIX_PATTERN.test(value);
}
module.exports = isImport;
node_modules/clean-css/lib/utils/natural-compare.js 0000666 00000001404 15042511722 0016431 0 ustar 00 // adapted from http://nedbatchelder.com/blog/200712.html#e20071211T054956
var NUMBER_PATTERN = /([0-9]+)/;
function naturalCompare(value1, value2) {
var keys1 = ('' + value1).split(NUMBER_PATTERN).map(tryParseInt);
var keys2 = ('' + value2).split(NUMBER_PATTERN).map(tryParseInt);
var key1;
var key2;
var compareFirst = Math.min(keys1.length, keys2.length);
var i, l;
for (i = 0, l = compareFirst; i < l; i++) {
key1 = keys1[i];
key2 = keys2[i];
if (key1 != key2) {
return key1 > key2 ? 1 : -1;
}
}
return keys1.length > keys2.length ? 1 : (keys1.length == keys2.length ? 0 : -1);
}
function tryParseInt(value) {
return ('' + parseInt(value)) == value ?
parseInt(value) :
value;
}
module.exports = naturalCompare;
node_modules/clean-css/lib/utils/is-http-resource.js 0000666 00000000230 15042511722 0016550 0 ustar 00 var HTTP_RESOURCE_PATTERN = /^http:\/\//;
function isHttpResource(uri) {
return HTTP_RESOURCE_PATTERN.test(uri);
}
module.exports = isHttpResource;
node_modules/clean-css/lib/utils/is-data-uri-resource.js 0000666 00000000267 15042511722 0017311 0 ustar 00 var DATA_URI_PATTERN = /^data:(\S*?)?(;charset=[^;]+)?(;[^,]+?)?,(.+)/;
function isDataUriResource(uri) {
return DATA_URI_PATTERN.test(uri);
}
module.exports = isDataUriResource;
node_modules/clean-css/lib/clean.js 0000666 00000012347 15042511722 0013271 0 ustar 00 /**
* Clean-css - https://github.com/jakubpawlowicz/clean-css
* Released under the terms of MIT license
*
* Copyright (C) 2017 JakubPawlowicz.com
*/
var level0Optimize = require('./optimizer/level-0/optimize');
var level1Optimize = require('./optimizer/level-1/optimize');
var level2Optimize = require('./optimizer/level-2/optimize');
var validator = require('./optimizer/validator');
var compatibilityFrom = require('./options/compatibility');
var fetchFrom = require('./options/fetch');
var formatFrom = require('./options/format').formatFrom;
var inlineFrom = require('./options/inline');
var inlineRequestFrom = require('./options/inline-request');
var inlineTimeoutFrom = require('./options/inline-timeout');
var OptimizationLevel = require('./options/optimization-level').OptimizationLevel;
var optimizationLevelFrom = require('./options/optimization-level').optimizationLevelFrom;
var rebaseFrom = require('./options/rebase');
var rebaseToFrom = require('./options/rebase-to');
var inputSourceMapTracker = require('./reader/input-source-map-tracker');
var readSources = require('./reader/read-sources');
var serializeStyles = require('./writer/simple');
var serializeStylesAndSourceMap = require('./writer/source-maps');
var CleanCSS = module.exports = function CleanCSS(options) {
options = options || {};
this.options = {
compatibility: compatibilityFrom(options.compatibility),
fetch: fetchFrom(options.fetch),
format: formatFrom(options.format),
inline: inlineFrom(options.inline),
inlineRequest: inlineRequestFrom(options.inlineRequest),
inlineTimeout: inlineTimeoutFrom(options.inlineTimeout),
level: optimizationLevelFrom(options.level),
rebase: rebaseFrom(options.rebase),
rebaseTo: rebaseToFrom(options.rebaseTo),
returnPromise: !!options.returnPromise,
sourceMap: !!options.sourceMap,
sourceMapInlineSources: !!options.sourceMapInlineSources
};
};
// for compatibility with optimize-css-assets-webpack-plugin
CleanCSS.process = function (input, opts) {
var cleanCss;
var optsTo = opts.to;
delete opts.to;
cleanCss = new CleanCSS(Object.assign({ returnPromise: true, rebaseTo: optsTo }, opts));
return cleanCss.minify(input)
.then(function(output) {
return { css: output.styles };
});
};
CleanCSS.prototype.minify = function (input, maybeSourceMap, maybeCallback) {
var options = this.options;
if (options.returnPromise) {
return new Promise(function (resolve, reject) {
minify(input, options, maybeSourceMap, function (errors, output) {
return errors ?
reject(errors) :
resolve(output);
});
});
} else {
return minify(input, options, maybeSourceMap, maybeCallback);
}
};
function minify(input, options, maybeSourceMap, maybeCallback) {
var sourceMap = typeof maybeSourceMap != 'function' ?
maybeSourceMap :
null;
var callback = typeof maybeCallback == 'function' ?
maybeCallback :
(typeof maybeSourceMap == 'function' ? maybeSourceMap : null);
var context = {
stats: {
efficiency: 0,
minifiedSize: 0,
originalSize: 0,
startedAt: Date.now(),
timeSpent: 0
},
cache: {
specificity: {}
},
errors: [],
inlinedStylesheets: [],
inputSourceMapTracker: inputSourceMapTracker(),
localOnly: !callback,
options: options,
source: null,
sourcesContent: {},
validator: validator(options.compatibility),
warnings: []
};
if (sourceMap) {
context.inputSourceMapTracker.track(undefined, sourceMap);
}
return runner(context.localOnly)(function () {
return readSources(input, context, function (tokens) {
var serialize = context.options.sourceMap ?
serializeStylesAndSourceMap :
serializeStyles;
var optimizedTokens = optimize(tokens, context);
var optimizedStyles = serialize(optimizedTokens, context);
var output = withMetadata(optimizedStyles, context);
return callback ?
callback(context.errors.length > 0 ? context.errors : null, output) :
output;
});
});
}
function runner(localOnly) {
// to always execute code asynchronously when a callback is given
// more at blog.izs.me/post/59142742143/designing-apis-for-asynchrony
return localOnly ?
function (callback) { return callback(); } :
process.nextTick;
}
function optimize(tokens, context) {
var optimized;
optimized = level0Optimize(tokens, context);
optimized = OptimizationLevel.One in context.options.level ?
level1Optimize(tokens, context) :
tokens;
optimized = OptimizationLevel.Two in context.options.level ?
level2Optimize(tokens, context, true) :
optimized;
return optimized;
}
function withMetadata(output, context) {
output.stats = calculateStatsFrom(output.styles, context);
output.errors = context.errors;
output.inlinedStylesheets = context.inlinedStylesheets;
output.warnings = context.warnings;
return output;
}
function calculateStatsFrom(styles, context) {
var finishedAt = Date.now();
var timeSpent = finishedAt - context.stats.startedAt;
delete context.stats.startedAt;
context.stats.timeSpent = timeSpent;
context.stats.efficiency = 1 - styles.length / context.stats.originalSize;
context.stats.minifiedSize = styles.length;
return context.stats;
}
node_modules/clean-css/lib/tokenizer/token.js 0000666 00000001477 15042511722 0015343 0 ustar 00 var Token = {
AT_RULE: 'at-rule', // e.g. `@import`, `@charset`
AT_RULE_BLOCK: 'at-rule-block', // e.g. `@font-face{...}`
AT_RULE_BLOCK_SCOPE: 'at-rule-block-scope', // e.g. `@font-face`
COMMENT: 'comment', // e.g. `/* comment */`
NESTED_BLOCK: 'nested-block', // e.g. `@media screen{...}`, `@keyframes animation {...}`
NESTED_BLOCK_SCOPE: 'nested-block-scope', // e.g. `@media`, `@keyframes`
PROPERTY: 'property', // e.g. `color:red`
PROPERTY_BLOCK: 'property-block', // e.g. `--var:{color:red}`
PROPERTY_NAME: 'property-name', // e.g. `color`
PROPERTY_VALUE: 'property-value', // e.g. `red`
RAW: 'raw', // e.g. anything between /* clean-css ignore:start */ and /* clean-css ignore:end */ comments
RULE: 'rule', // e.g `div > a{...}`
RULE_SCOPE: 'rule-scope' // e.g `div > a`
};
module.exports = Token;
node_modules/clean-css/lib/tokenizer/tokenize.js 0000666 00000061037 15042511722 0016051 0 ustar 00 var Marker = require('./marker');
var Token = require('./token');
var formatPosition = require('../utils/format-position');
var Level = {
BLOCK: 'block',
COMMENT: 'comment',
DOUBLE_QUOTE: 'double-quote',
RULE: 'rule',
SINGLE_QUOTE: 'single-quote'
};
var AT_RULES = [
'@charset',
'@import'
];
var BLOCK_RULES = [
'@-moz-document',
'@document',
'@-moz-keyframes',
'@-ms-keyframes',
'@-o-keyframes',
'@-webkit-keyframes',
'@keyframes',
'@media',
'@supports'
];
var IGNORE_END_COMMENT_PATTERN = /\/\* clean\-css ignore:end \*\/$/;
var IGNORE_START_COMMENT_PATTERN = /^\/\* clean\-css ignore:start \*\//;
var PAGE_MARGIN_BOXES = [
'@bottom-center',
'@bottom-left',
'@bottom-left-corner',
'@bottom-right',
'@bottom-right-corner',
'@left-bottom',
'@left-middle',
'@left-top',
'@right-bottom',
'@right-middle',
'@right-top',
'@top-center',
'@top-left',
'@top-left-corner',
'@top-right',
'@top-right-corner'
];
var EXTRA_PAGE_BOXES = [
'@footnote',
'@footnotes',
'@left',
'@page-float-bottom',
'@page-float-top',
'@right'
];
var REPEAT_PATTERN = /^\[\s{0,31}\d+\s{0,31}\]$/;
var RULE_WORD_SEPARATOR_PATTERN = /[\s\(]/;
var TAIL_BROKEN_VALUE_PATTERN = /[\s|\}]*$/;
function tokenize(source, externalContext) {
var internalContext = {
level: Level.BLOCK,
position: {
source: externalContext.source || undefined,
line: 1,
column: 0,
index: 0
}
};
return intoTokens(source, externalContext, internalContext, false);
}
function intoTokens(source, externalContext, internalContext, isNested) {
var allTokens = [];
var newTokens = allTokens;
var lastToken;
var ruleToken;
var ruleTokens = [];
var propertyToken;
var metadata;
var metadatas = [];
var level = internalContext.level;
var levels = [];
var buffer = [];
var buffers = [];
var serializedBuffer;
var serializedBufferPart;
var roundBracketLevel = 0;
var isQuoted;
var isSpace;
var isNewLineNix;
var isNewLineWin;
var isCarriageReturn;
var isCommentStart;
var wasCommentStart = false;
var isCommentEnd;
var wasCommentEnd = false;
var isCommentEndMarker;
var isEscaped;
var wasEscaped = false;
var isRaw = false;
var seekingValue = false;
var seekingPropertyBlockClosing = false;
var position = internalContext.position;
var lastCommentStartAt;
for (; position.index < source.length; position.index++) {
var character = source[position.index];
isQuoted = level == Level.SINGLE_QUOTE || level == Level.DOUBLE_QUOTE;
isSpace = character == Marker.SPACE || character == Marker.TAB;
isNewLineNix = character == Marker.NEW_LINE_NIX;
isNewLineWin = character == Marker.NEW_LINE_NIX && source[position.index - 1] == Marker.CARRIAGE_RETURN;
isCarriageReturn = character == Marker.CARRIAGE_RETURN && source[position.index + 1] && source[position.index + 1] != Marker.NEW_LINE_NIX;
isCommentStart = !wasCommentEnd && level != Level.COMMENT && !isQuoted && character == Marker.ASTERISK && source[position.index - 1] == Marker.FORWARD_SLASH;
isCommentEndMarker = !wasCommentStart && !isQuoted && character == Marker.FORWARD_SLASH && source[position.index - 1] == Marker.ASTERISK;
isCommentEnd = level == Level.COMMENT && isCommentEndMarker;
roundBracketLevel = Math.max(roundBracketLevel, 0);
metadata = buffer.length === 0 ?
[position.line, position.column, position.source] :
metadata;
if (isEscaped) {
// previous character was a backslash
buffer.push(character);
} else if (!isCommentEnd && level == Level.COMMENT) {
buffer.push(character);
} else if (!isCommentStart && !isCommentEnd && isRaw) {
buffer.push(character);
} else if (isCommentStart && (level == Level.BLOCK || level == Level.RULE) && buffer.length > 1) {
// comment start within block preceded by some content, e.g. div/*<--
metadatas.push(metadata);
buffer.push(character);
buffers.push(buffer.slice(0, buffer.length - 2));
buffer = buffer.slice(buffer.length - 2);
metadata = [position.line, position.column - 1, position.source];
levels.push(level);
level = Level.COMMENT;
} else if (isCommentStart) {
// comment start, e.g. /*<--
levels.push(level);
level = Level.COMMENT;
buffer.push(character);
} else if (isCommentEnd && isIgnoreStartComment(buffer)) {
// ignore:start comment end, e.g. /* clean-css ignore:start */<--
serializedBuffer = buffer.join('').trim() + character;
lastToken = [Token.COMMENT, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]];
newTokens.push(lastToken);
isRaw = true;
metadata = metadatas.pop() || null;
buffer = buffers.pop() || [];
} else if (isCommentEnd && isIgnoreEndComment(buffer)) {
// ignore:start comment end, e.g. /* clean-css ignore:end */<--
serializedBuffer = buffer.join('') + character;
lastCommentStartAt = serializedBuffer.lastIndexOf(Marker.FORWARD_SLASH + Marker.ASTERISK);
serializedBufferPart = serializedBuffer.substring(0, lastCommentStartAt);
lastToken = [Token.RAW, serializedBufferPart, [originalMetadata(metadata, serializedBufferPart, externalContext)]];
newTokens.push(lastToken);
serializedBufferPart = serializedBuffer.substring(lastCommentStartAt);
metadata = [position.line, position.column - serializedBufferPart.length + 1, position.source];
lastToken = [Token.COMMENT, serializedBufferPart, [originalMetadata(metadata, serializedBufferPart, externalContext)]];
newTokens.push(lastToken);
isRaw = false;
level = levels.pop();
metadata = metadatas.pop() || null;
buffer = buffers.pop() || [];
} else if (isCommentEnd) {
// comment end, e.g. /* comment */<--
serializedBuffer = buffer.join('').trim() + character;
lastToken = [Token.COMMENT, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]];
newTokens.push(lastToken);
level = levels.pop();
metadata = metadatas.pop() || null;
buffer = buffers.pop() || [];
} else if (isCommentEndMarker && source[position.index + 1] != Marker.ASTERISK) {
externalContext.warnings.push('Unexpected \'*/\' at ' + formatPosition([position.line, position.column, position.source]) + '.');
buffer = [];
} else if (character == Marker.SINGLE_QUOTE && !isQuoted) {
// single quotation start, e.g. a[href^='https<--
levels.push(level);
level = Level.SINGLE_QUOTE;
buffer.push(character);
} else if (character == Marker.SINGLE_QUOTE && level == Level.SINGLE_QUOTE) {
// single quotation end, e.g. a[href^='https'<--
level = levels.pop();
buffer.push(character);
} else if (character == Marker.DOUBLE_QUOTE && !isQuoted) {
// double quotation start, e.g. a[href^="<--
levels.push(level);
level = Level.DOUBLE_QUOTE;
buffer.push(character);
} else if (character == Marker.DOUBLE_QUOTE && level == Level.DOUBLE_QUOTE) {
// double quotation end, e.g. a[href^="https"<--
level = levels.pop();
buffer.push(character);
} else if (!isCommentStart && !isCommentEnd && character != Marker.CLOSE_ROUND_BRACKET && character != Marker.OPEN_ROUND_BRACKET && level != Level.COMMENT && !isQuoted && roundBracketLevel > 0) {
// character inside any function, e.g. hsla(.<--
buffer.push(character);
} else if (character == Marker.OPEN_ROUND_BRACKET && !isQuoted && level != Level.COMMENT && !seekingValue) {
// round open bracket, e.g. @import url(<--
buffer.push(character);
roundBracketLevel++;
} else if (character == Marker.CLOSE_ROUND_BRACKET && !isQuoted && level != Level.COMMENT && !seekingValue) {
// round open bracket, e.g. @import url(test.css)<--
buffer.push(character);
roundBracketLevel--;
} else if (character == Marker.SEMICOLON && level == Level.BLOCK && buffer[0] == Marker.AT) {
// semicolon ending rule at block level, e.g. @import '...';<--
serializedBuffer = buffer.join('').trim();
allTokens.push([Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
buffer = [];
} else if (character == Marker.COMMA && level == Level.BLOCK && ruleToken) {
// comma separator at block level, e.g. a,div,<--
serializedBuffer = buffer.join('').trim();
ruleToken[1].push([tokenScopeFrom(ruleToken[0]), serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext, ruleToken[1].length)]]);
buffer = [];
} else if (character == Marker.COMMA && level == Level.BLOCK && tokenTypeFrom(buffer) == Token.AT_RULE) {
// comma separator at block level, e.g. @import url(...) screen,<--
// keep iterating as end semicolon will create the token
buffer.push(character);
} else if (character == Marker.COMMA && level == Level.BLOCK) {
// comma separator at block level, e.g. a,<--
ruleToken = [tokenTypeFrom(buffer), [], []];
serializedBuffer = buffer.join('').trim();
ruleToken[1].push([tokenScopeFrom(ruleToken[0]), serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext, 0)]]);
buffer = [];
} else if (character == Marker.OPEN_CURLY_BRACKET && level == Level.BLOCK && ruleToken && ruleToken[0] == Token.NESTED_BLOCK) {
// open brace opening at-rule at block level, e.g. @media{<--
serializedBuffer = buffer.join('').trim();
ruleToken[1].push([Token.NESTED_BLOCK_SCOPE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
allTokens.push(ruleToken);
levels.push(level);
position.column++;
position.index++;
buffer = [];
ruleToken[2] = intoTokens(source, externalContext, internalContext, true);
ruleToken = null;
} else if (character == Marker.OPEN_CURLY_BRACKET && level == Level.BLOCK && tokenTypeFrom(buffer) == Token.NESTED_BLOCK) {
// open brace opening at-rule at block level, e.g. @media{<--
serializedBuffer = buffer.join('').trim();
ruleToken = ruleToken || [Token.NESTED_BLOCK, [], []];
ruleToken[1].push([Token.NESTED_BLOCK_SCOPE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
allTokens.push(ruleToken);
levels.push(level);
position.column++;
position.index++;
buffer = [];
ruleToken[2] = intoTokens(source, externalContext, internalContext, true);
ruleToken = null;
} else if (character == Marker.OPEN_CURLY_BRACKET && level == Level.BLOCK) {
// open brace opening rule at block level, e.g. div{<--
serializedBuffer = buffer.join('').trim();
ruleToken = ruleToken || [tokenTypeFrom(buffer), [], []];
ruleToken[1].push([tokenScopeFrom(ruleToken[0]), serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext, ruleToken[1].length)]]);
newTokens = ruleToken[2];
allTokens.push(ruleToken);
levels.push(level);
level = Level.RULE;
buffer = [];
} else if (character == Marker.OPEN_CURLY_BRACKET && level == Level.RULE && seekingValue) {
// open brace opening rule at rule level, e.g. div{--variable:{<--
ruleTokens.push(ruleToken);
ruleToken = [Token.PROPERTY_BLOCK, []];
propertyToken.push(ruleToken);
newTokens = ruleToken[1];
levels.push(level);
level = Level.RULE;
seekingValue = false;
} else if (character == Marker.OPEN_CURLY_BRACKET && level == Level.RULE && isPageMarginBox(buffer)) {
// open brace opening page-margin box at rule level, e.g. @page{@top-center{<--
serializedBuffer = buffer.join('').trim();
ruleTokens.push(ruleToken);
ruleToken = [Token.AT_RULE_BLOCK, [], []];
ruleToken[1].push([Token.AT_RULE_BLOCK_SCOPE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
newTokens.push(ruleToken);
newTokens = ruleToken[2];
levels.push(level);
level = Level.RULE;
buffer = [];
} else if (character == Marker.COLON && level == Level.RULE && !seekingValue) {
// colon at rule level, e.g. a{color:<--
serializedBuffer = buffer.join('').trim();
propertyToken = [Token.PROPERTY, [Token.PROPERTY_NAME, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]];
newTokens.push(propertyToken);
seekingValue = true;
buffer = [];
} else if (character == Marker.SEMICOLON && level == Level.RULE && propertyToken && ruleTokens.length > 0 && buffer.length > 0 && buffer[0] == Marker.AT) {
// semicolon at rule level for at-rule, e.g. a{--color:{@apply(--other-color);<--
serializedBuffer = buffer.join('').trim();
ruleToken[1].push([Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
buffer = [];
} else if (character == Marker.SEMICOLON && level == Level.RULE && propertyToken && buffer.length > 0) {
// semicolon at rule level, e.g. a{color:red;<--
serializedBuffer = buffer.join('').trim();
propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
propertyToken = null;
seekingValue = false;
buffer = [];
} else if (character == Marker.SEMICOLON && level == Level.RULE && propertyToken && buffer.length === 0) {
// semicolon after bracketed value at rule level, e.g. a{color:rgb(...);<--
propertyToken = null;
seekingValue = false;
} else if (character == Marker.SEMICOLON && level == Level.RULE && buffer.length > 0 && buffer[0] == Marker.AT) {
// semicolon for at-rule at rule level, e.g. a{@apply(--variable);<--
serializedBuffer = buffer.join('');
newTokens.push([Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
seekingValue = false;
buffer = [];
} else if (character == Marker.SEMICOLON && level == Level.RULE && seekingPropertyBlockClosing) {
// close brace after a property block at rule level, e.g. a{--custom:{color:red;};<--
seekingPropertyBlockClosing = false;
buffer = [];
} else if (character == Marker.SEMICOLON && level == Level.RULE && buffer.length === 0) {
// stray semicolon at rule level, e.g. a{;<--
// noop
} else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && seekingValue && buffer.length > 0 && ruleTokens.length > 0) {
// close brace at rule level, e.g. a{--color:{color:red}<--
serializedBuffer = buffer.join('');
propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
propertyToken = null;
ruleToken = ruleTokens.pop();
newTokens = ruleToken[2];
level = levels.pop();
seekingValue = false;
buffer = [];
} else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && buffer.length > 0 && buffer[0] == Marker.AT && ruleTokens.length > 0) {
// close brace at rule level for at-rule, e.g. a{--color:{@apply(--other-color)}<--
serializedBuffer = buffer.join('');
ruleToken[1].push([Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
propertyToken = null;
ruleToken = ruleTokens.pop();
newTokens = ruleToken[2];
level = levels.pop();
seekingValue = false;
buffer = [];
} else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && ruleTokens.length > 0) {
// close brace at rule level after space, e.g. a{--color:{color:red }<--
propertyToken = null;
ruleToken = ruleTokens.pop();
newTokens = ruleToken[2];
level = levels.pop();
seekingValue = false;
} else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && buffer.length > 0) {
// close brace at rule level, e.g. a{color:red}<--
serializedBuffer = buffer.join('');
propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
propertyToken = null;
ruleToken = ruleTokens.pop();
newTokens = allTokens;
level = levels.pop();
seekingValue = false;
buffer = [];
} else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && buffer.length > 0 && buffer[0] == Marker.AT) {
// close brace after at-rule at rule level, e.g. a{@apply(--variable)}<--
propertyToken = null;
ruleToken = null;
serializedBuffer = buffer.join('').trim();
newTokens.push([Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
newTokens = allTokens;
level = levels.pop();
seekingValue = false;
buffer = [];
} else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && levels[levels.length - 1] == Level.RULE) {
// close brace after a property block at rule level, e.g. a{--custom:{color:red;}<--
propertyToken = null;
ruleToken = ruleTokens.pop();
newTokens = ruleToken[2];
level = levels.pop();
seekingValue = false;
seekingPropertyBlockClosing = true;
buffer = [];
} else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE) {
// close brace after a rule, e.g. a{color:red;}<--
propertyToken = null;
ruleToken = null;
newTokens = allTokens;
level = levels.pop();
seekingValue = false;
} else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.BLOCK && !isNested && position.index <= source.length - 1) {
// stray close brace at block level, e.g. a{color:red}color:blue}<--
externalContext.warnings.push('Unexpected \'}\' at ' + formatPosition([position.line, position.column, position.source]) + '.');
buffer.push(character);
} else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.BLOCK) {
// close brace at block level, e.g. @media screen {...}<--
break;
} else if (character == Marker.OPEN_ROUND_BRACKET && level == Level.RULE && seekingValue) {
// round open bracket, e.g. a{color:hsla(<--
buffer.push(character);
roundBracketLevel++;
} else if (character == Marker.CLOSE_ROUND_BRACKET && level == Level.RULE && seekingValue && roundBracketLevel == 1) {
// round close bracket, e.g. a{color:hsla(0,0%,0%)<--
buffer.push(character);
serializedBuffer = buffer.join('').trim();
propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
roundBracketLevel--;
buffer = [];
} else if (character == Marker.CLOSE_ROUND_BRACKET && level == Level.RULE && seekingValue) {
// round close bracket within other brackets, e.g. a{width:calc((10rem / 2)<--
buffer.push(character);
roundBracketLevel--;
} else if (character == Marker.FORWARD_SLASH && source[position.index + 1] != Marker.ASTERISK && level == Level.RULE && seekingValue && buffer.length > 0) {
// forward slash within a property, e.g. a{background:url(image.png) 0 0/<--
serializedBuffer = buffer.join('').trim();
propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
propertyToken.push([Token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]]]);
buffer = [];
} else if (character == Marker.FORWARD_SLASH && source[position.index + 1] != Marker.ASTERISK && level == Level.RULE && seekingValue) {
// forward slash within a property after space, e.g. a{background:url(image.png) 0 0 /<--
propertyToken.push([Token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]]]);
buffer = [];
} else if (character == Marker.COMMA && level == Level.RULE && seekingValue && buffer.length > 0) {
// comma within a property, e.g. a{background:url(image.png),<--
serializedBuffer = buffer.join('').trim();
propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
propertyToken.push([Token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]]]);
buffer = [];
} else if (character == Marker.COMMA && level == Level.RULE && seekingValue) {
// comma within a property after space, e.g. a{background:url(image.png) ,<--
propertyToken.push([Token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]]]);
buffer = [];
} else if (character == Marker.CLOSE_SQUARE_BRACKET && propertyToken && propertyToken.length > 1 && buffer.length > 0 && isRepeatToken(buffer)) {
buffer.push(character);
serializedBuffer = buffer.join('').trim();
propertyToken[propertyToken.length - 1][1] += serializedBuffer;
buffer = [];
} else if ((isSpace || (isNewLineNix && !isNewLineWin)) && level == Level.RULE && seekingValue && propertyToken && buffer.length > 0) {
// space or *nix newline within property, e.g. a{margin:0 <--
serializedBuffer = buffer.join('').trim();
propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
buffer = [];
} else if (isNewLineWin && level == Level.RULE && seekingValue && propertyToken && buffer.length > 1) {
// win newline within property, e.g. a{margin:0\r\n<--
serializedBuffer = buffer.join('').trim();
propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
buffer = [];
} else if (isNewLineWin && level == Level.RULE && seekingValue) {
// win newline
buffer = [];
} else if (buffer.length == 1 && isNewLineWin) {
// ignore windows newline which is composed of two characters
buffer.pop();
} else if (buffer.length > 0 || !isSpace && !isNewLineNix && !isNewLineWin && !isCarriageReturn) {
// any character
buffer.push(character);
}
wasEscaped = isEscaped;
isEscaped = !wasEscaped && character == Marker.BACK_SLASH;
wasCommentStart = isCommentStart;
wasCommentEnd = isCommentEnd;
position.line = (isNewLineWin || isNewLineNix || isCarriageReturn) ? position.line + 1 : position.line;
position.column = (isNewLineWin || isNewLineNix || isCarriageReturn) ? 0 : position.column + 1;
}
if (seekingValue) {
externalContext.warnings.push('Missing \'}\' at ' + formatPosition([position.line, position.column, position.source]) + '.');
}
if (seekingValue && buffer.length > 0) {
serializedBuffer = buffer.join('').replace(TAIL_BROKEN_VALUE_PATTERN, '');
propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
buffer = [];
}
if (buffer.length > 0) {
externalContext.warnings.push('Invalid character(s) \'' + buffer.join('') + '\' at ' + formatPosition(metadata) + '. Ignoring.');
}
return allTokens;
}
function isIgnoreStartComment(buffer) {
return IGNORE_START_COMMENT_PATTERN.test(buffer.join('') + Marker.FORWARD_SLASH);
}
function isIgnoreEndComment(buffer) {
return IGNORE_END_COMMENT_PATTERN.test(buffer.join('') + Marker.FORWARD_SLASH);
}
function originalMetadata(metadata, value, externalContext, selectorFallbacks) {
var source = metadata[2];
return externalContext.inputSourceMapTracker.isTracking(source) ?
externalContext.inputSourceMapTracker.originalPositionFor(metadata, value.length, selectorFallbacks) :
metadata;
}
function tokenTypeFrom(buffer) {
var isAtRule = buffer[0] == Marker.AT || buffer[0] == Marker.UNDERSCORE;
var ruleWord = buffer.join('').split(RULE_WORD_SEPARATOR_PATTERN)[0];
if (isAtRule && BLOCK_RULES.indexOf(ruleWord) > -1) {
return Token.NESTED_BLOCK;
} else if (isAtRule && AT_RULES.indexOf(ruleWord) > -1) {
return Token.AT_RULE;
} else if (isAtRule) {
return Token.AT_RULE_BLOCK;
} else {
return Token.RULE;
}
}
function tokenScopeFrom(tokenType) {
if (tokenType == Token.RULE) {
return Token.RULE_SCOPE;
} else if (tokenType == Token.NESTED_BLOCK) {
return Token.NESTED_BLOCK_SCOPE;
} else if (tokenType == Token.AT_RULE_BLOCK) {
return Token.AT_RULE_BLOCK_SCOPE;
}
}
function isPageMarginBox(buffer) {
var serializedBuffer = buffer.join('').trim();
return PAGE_MARGIN_BOXES.indexOf(serializedBuffer) > -1 || EXTRA_PAGE_BOXES.indexOf(serializedBuffer) > -1;
}
function isRepeatToken(buffer) {
return REPEAT_PATTERN.test(buffer.join('') + Marker.CLOSE_SQUARE_BRACKET);
}
module.exports = tokenize;
node_modules/clean-css/lib/tokenizer/marker.js 0000666 00000000775 15042511722 0015504 0 ustar 00 var Marker = {
ASTERISK: '*',
AT: '@',
BACK_SLASH: '\\',
CARRIAGE_RETURN: '\r',
CLOSE_CURLY_BRACKET: '}',
CLOSE_ROUND_BRACKET: ')',
CLOSE_SQUARE_BRACKET: ']',
COLON: ':',
COMMA: ',',
DOUBLE_QUOTE: '"',
EXCLAMATION: '!',
FORWARD_SLASH: '/',
INTERNAL: '-clean-css-',
NEW_LINE_NIX: '\n',
OPEN_CURLY_BRACKET: '{',
OPEN_ROUND_BRACKET: '(',
OPEN_SQUARE_BRACKET: '[',
SEMICOLON: ';',
SINGLE_QUOTE: '\'',
SPACE: ' ',
TAB: '\t',
UNDERSCORE: '_'
};
module.exports = Marker;
node_modules/clean-css/lib/options/inline.js 0000666 00000000370 15042511722 0015151 0 ustar 00 function inlineOptionsFrom(rules) {
if (Array.isArray(rules)) {
return rules;
}
if (rules === false) {
return ['none'];
}
return undefined === rules ?
['local'] :
rules.split(',');
}
module.exports = inlineOptionsFrom;
node_modules/clean-css/lib/options/rebase-to.js 0000666 00000000227 15042511722 0015555 0 ustar 00 var path = require('path');
function rebaseToFrom(option) {
return option ? path.resolve(option) : process.cwd();
}
module.exports = rebaseToFrom;
node_modules/clean-css/lib/options/optimization-level.js 0000666 00000012673 15042511722 0017537 0 ustar 00 var roundingPrecisionFrom = require('./rounding-precision').roundingPrecisionFrom;
var override = require('../utils/override');
var OptimizationLevel = {
Zero: '0',
One: '1',
Two: '2'
};
var DEFAULTS = {};
DEFAULTS[OptimizationLevel.Zero] = {};
DEFAULTS[OptimizationLevel.One] = {
cleanupCharsets: true,
normalizeUrls: true,
optimizeBackground: true,
optimizeBorderRadius: true,
optimizeFilter: true,
optimizeFontWeight: true,
optimizeOutline: true,
removeEmpty: true,
removeNegativePaddings: true,
removeQuotes: true,
removeWhitespace: true,
replaceMultipleZeros: true,
replaceTimeUnits: true,
replaceZeroUnits: true,
roundingPrecision: roundingPrecisionFrom(undefined),
selectorsSortingMethod: 'standard',
specialComments: 'all',
tidyAtRules: true,
tidyBlockScopes: true,
tidySelectors: true,
transform: noop
};
DEFAULTS[OptimizationLevel.Two] = {
mergeAdjacentRules: true,
mergeIntoShorthands: true,
mergeMedia: true,
mergeNonAdjacentRules: true,
mergeSemantically: false,
overrideProperties: true,
removeEmpty: true,
reduceNonAdjacentRules: true,
removeDuplicateFontRules: true,
removeDuplicateMediaBlocks: true,
removeDuplicateRules: true,
removeUnusedAtRules: false,
restructureRules: false,
skipProperties: []
};
var ALL_KEYWORD_1 = '*';
var ALL_KEYWORD_2 = 'all';
var FALSE_KEYWORD_1 = 'false';
var FALSE_KEYWORD_2 = 'off';
var TRUE_KEYWORD_1 = 'true';
var TRUE_KEYWORD_2 = 'on';
var LIST_VALUE_SEPARATOR = ',';
var OPTION_SEPARATOR = ';';
var OPTION_VALUE_SEPARATOR = ':';
function noop() {}
function optimizationLevelFrom(source) {
var level = override(DEFAULTS, {});
var Zero = OptimizationLevel.Zero;
var One = OptimizationLevel.One;
var Two = OptimizationLevel.Two;
if (undefined === source) {
delete level[Two];
return level;
}
if (typeof source == 'string') {
source = parseInt(source);
}
if (typeof source == 'number' && source === parseInt(Two)) {
return level;
}
if (typeof source == 'number' && source === parseInt(One)) {
delete level[Two];
return level;
}
if (typeof source == 'number' && source === parseInt(Zero)) {
delete level[Two];
delete level[One];
return level;
}
if (typeof source == 'object') {
source = covertValuesToHashes(source);
}
if (One in source && 'roundingPrecision' in source[One]) {
source[One].roundingPrecision = roundingPrecisionFrom(source[One].roundingPrecision);
}
if (Two in source && 'skipProperties' in source[Two] && typeof(source[Two].skipProperties) == 'string') {
source[Two].skipProperties = source[Two].skipProperties.split(LIST_VALUE_SEPARATOR);
}
if (Zero in source || One in source || Two in source) {
level[Zero] = override(level[Zero], source[Zero]);
}
if (One in source && ALL_KEYWORD_1 in source[One]) {
level[One] = override(level[One], defaults(One, normalizeValue(source[One][ALL_KEYWORD_1])));
delete source[One][ALL_KEYWORD_1];
}
if (One in source && ALL_KEYWORD_2 in source[One]) {
level[One] = override(level[One], defaults(One, normalizeValue(source[One][ALL_KEYWORD_2])));
delete source[One][ALL_KEYWORD_2];
}
if (One in source || Two in source) {
level[One] = override(level[One], source[One]);
} else {
delete level[One];
}
if (Two in source && ALL_KEYWORD_1 in source[Two]) {
level[Two] = override(level[Two], defaults(Two, normalizeValue(source[Two][ALL_KEYWORD_1])));
delete source[Two][ALL_KEYWORD_1];
}
if (Two in source && ALL_KEYWORD_2 in source[Two]) {
level[Two] = override(level[Two], defaults(Two, normalizeValue(source[Two][ALL_KEYWORD_2])));
delete source[Two][ALL_KEYWORD_2];
}
if (Two in source) {
level[Two] = override(level[Two], source[Two]);
} else {
delete level[Two];
}
return level;
}
function defaults(level, value) {
var options = override(DEFAULTS[level], {});
var key;
for (key in options) {
if (typeof options[key] == 'boolean') {
options[key] = value;
}
}
return options;
}
function normalizeValue(value) {
switch (value) {
case FALSE_KEYWORD_1:
case FALSE_KEYWORD_2:
return false;
case TRUE_KEYWORD_1:
case TRUE_KEYWORD_2:
return true;
default:
return value;
}
}
function covertValuesToHashes(source) {
var clonedSource = override(source, {});
var level;
var i;
for (i = 0; i <= 2; i++) {
level = '' + i;
if (level in clonedSource && (clonedSource[level] === undefined || clonedSource[level] === false)) {
delete clonedSource[level];
}
if (level in clonedSource && clonedSource[level] === true) {
clonedSource[level] = {};
}
if (level in clonedSource && typeof clonedSource[level] == 'string') {
clonedSource[level] = covertToHash(clonedSource[level], level);
}
}
return clonedSource;
}
function covertToHash(asString, level) {
return asString
.split(OPTION_SEPARATOR)
.reduce(function (accumulator, directive) {
var parts = directive.split(OPTION_VALUE_SEPARATOR);
var name = parts[0];
var value = parts[1];
var normalizedValue = normalizeValue(value);
if (ALL_KEYWORD_1 == name || ALL_KEYWORD_2 == name) {
accumulator = override(accumulator, defaults(level, normalizedValue));
} else {
accumulator[name] = normalizedValue;
}
return accumulator;
}, {});
}
module.exports = {
OptimizationLevel: OptimizationLevel,
optimizationLevelFrom: optimizationLevelFrom,
};
node_modules/clean-css/lib/options/compatibility.js 0000666 00000011007 15042511722 0016543 0 ustar 00 var DEFAULTS = {
'*': {
colors: {
opacity: true // rgba / hsla
},
properties: {
backgroundClipMerging: true, // background-clip to shorthand
backgroundOriginMerging: true, // background-origin to shorthand
backgroundSizeMerging: true, // background-size to shorthand
colors: true, // any kind of color transformations, like `#ff00ff` to `#f0f` or `#fff` into `red`
ieBangHack: false, // !ie suffix hacks on IE<8
ieFilters: false, // whether to preserve `filter` and `-ms-filter` properties
iePrefixHack: false, // underscore / asterisk prefix hacks on IE
ieSuffixHack: false, // \9 suffix hacks on IE6-9
merging: true, // merging properties into one
shorterLengthUnits: false, // optimize pixel units into `pt`, `pc` or `in` units
spaceAfterClosingBrace: true, // 'url() no-repeat' to 'url()no-repeat'
urlQuotes: false, // whether to wrap content of `url()` into quotes or not
zeroUnits: true // 0[unit] -> 0
},
selectors: {
adjacentSpace: false, // div+ nav Android stock browser hack
ie7Hack: false, // *+html hack
mergeablePseudoClasses: [
':active',
':after',
':before',
':empty',
':checked',
':disabled',
':empty',
':enabled',
':first-child',
':first-letter',
':first-line',
':first-of-type',
':focus',
':hover',
':lang',
':last-child',
':last-of-type',
':link',
':not',
':nth-child',
':nth-last-child',
':nth-last-of-type',
':nth-of-type',
':only-child',
':only-of-type',
':root',
':target',
':visited'
], // selectors with these pseudo-classes can be merged as these are universally supported
mergeablePseudoElements: [
'::after',
'::before',
'::first-letter',
'::first-line'
], // selectors with these pseudo-elements can be merged as these are universally supported
mergeLimit: 8191, // number of rules that can be safely merged together
multiplePseudoMerging: true
},
units: {
ch: true,
in: true,
pc: true,
pt: true,
rem: true,
vh: true,
vm: true, // vm is vmin on IE9+ see https://developer.mozilla.org/en-US/docs/Web/CSS/length
vmax: true,
vmin: true,
vw: true
}
}
};
DEFAULTS.ie11 = DEFAULTS['*'];
DEFAULTS.ie10 = DEFAULTS['*'];
DEFAULTS.ie9 = merge(DEFAULTS['*'], {
properties: {
ieFilters: true,
ieSuffixHack: true
}
});
DEFAULTS.ie8 = merge(DEFAULTS.ie9, {
colors: {
opacity: false
},
properties: {
backgroundClipMerging: false,
backgroundOriginMerging: false,
backgroundSizeMerging: false,
iePrefixHack: true,
merging: false
},
selectors: {
mergeablePseudoClasses: [
':after',
':before',
':first-child',
':first-letter',
':focus',
':hover',
':visited'
],
mergeablePseudoElements: []
},
units: {
ch: false,
rem: false,
vh: false,
vm: false,
vmax: false,
vmin: false,
vw: false
}
});
DEFAULTS.ie7 = merge(DEFAULTS.ie8, {
properties: {
ieBangHack: true
},
selectors: {
ie7Hack: true,
mergeablePseudoClasses: [
':first-child',
':first-letter',
':hover',
':visited'
]
},
});
function compatibilityFrom(source) {
return merge(DEFAULTS['*'], calculateSource(source));
}
function merge(source, target) {
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
var value = source[key];
if (Object.prototype.hasOwnProperty.call(target, key) && typeof value === 'object' && !Array.isArray(value)) {
target[key] = merge(value, target[key] || {});
} else {
target[key] = key in target ? target[key] : value;
}
}
}
return target;
}
function calculateSource(source) {
if (typeof source == 'object')
return source;
if (!/[,\+\-]/.test(source))
return DEFAULTS[source] || DEFAULTS['*'];
var parts = source.split(',');
var template = parts[0] in DEFAULTS ?
DEFAULTS[parts.shift()] :
DEFAULTS['*'];
source = {};
parts.forEach(function (part) {
var isAdd = part[0] == '+';
var key = part.substring(1).split('.');
var group = key[0];
var option = key[1];
source[group] = source[group] || {};
source[group][option] = isAdd;
});
return merge(template, source);
}
module.exports = compatibilityFrom;
node_modules/clean-css/lib/options/format.js 0000666 00000012017 15042511722 0015164 0 ustar 00 var systemLineBreak = require('os').EOL;
var override = require('../utils/override');
var Breaks = {
AfterAtRule: 'afterAtRule',
AfterBlockBegins: 'afterBlockBegins',
AfterBlockEnds: 'afterBlockEnds',
AfterComment: 'afterComment',
AfterProperty: 'afterProperty',
AfterRuleBegins: 'afterRuleBegins',
AfterRuleEnds: 'afterRuleEnds',
BeforeBlockEnds: 'beforeBlockEnds',
BetweenSelectors: 'betweenSelectors'
};
var BreakWith = {
CarriageReturnLineFeed: '\r\n',
LineFeed: '\n',
System: systemLineBreak
};
var IndentWith = {
Space: ' ',
Tab: '\t'
};
var Spaces = {
AroundSelectorRelation: 'aroundSelectorRelation',
BeforeBlockBegins: 'beforeBlockBegins',
BeforeValue: 'beforeValue'
};
var DEFAULTS = {
breaks: breaks(false),
breakWith: BreakWith.System,
indentBy: 0,
indentWith: IndentWith.Space,
spaces: spaces(false),
wrapAt: false,
semicolonAfterLastProperty: false
};
var BEAUTIFY_ALIAS = 'beautify';
var KEEP_BREAKS_ALIAS = 'keep-breaks';
var OPTION_SEPARATOR = ';';
var OPTION_NAME_VALUE_SEPARATOR = ':';
var HASH_VALUES_OPTION_SEPARATOR = ',';
var HASH_VALUES_NAME_VALUE_SEPARATOR = '=';
var FALSE_KEYWORD_1 = 'false';
var FALSE_KEYWORD_2 = 'off';
var TRUE_KEYWORD_1 = 'true';
var TRUE_KEYWORD_2 = 'on';
function breaks(value) {
var breakOptions = {};
breakOptions[Breaks.AfterAtRule] = value;
breakOptions[Breaks.AfterBlockBegins] = value;
breakOptions[Breaks.AfterBlockEnds] = value;
breakOptions[Breaks.AfterComment] = value;
breakOptions[Breaks.AfterProperty] = value;
breakOptions[Breaks.AfterRuleBegins] = value;
breakOptions[Breaks.AfterRuleEnds] = value;
breakOptions[Breaks.BeforeBlockEnds] = value;
breakOptions[Breaks.BetweenSelectors] = value;
return breakOptions;
}
function spaces(value) {
var spaceOptions = {};
spaceOptions[Spaces.AroundSelectorRelation] = value;
spaceOptions[Spaces.BeforeBlockBegins] = value;
spaceOptions[Spaces.BeforeValue] = value;
return spaceOptions;
}
function formatFrom(source) {
if (source === undefined || source === false) {
return false;
}
if (typeof source == 'object' && 'breakWith' in source) {
source = override(source, { breakWith: mapBreakWith(source.breakWith) });
}
if (typeof source == 'object' && 'indentBy' in source) {
source = override(source, { indentBy: parseInt(source.indentBy) });
}
if (typeof source == 'object' && 'indentWith' in source) {
source = override(source, { indentWith: mapIndentWith(source.indentWith) });
}
if (typeof source == 'object') {
return override(DEFAULTS, source);
}
if (typeof source == 'object') {
return override(DEFAULTS, source);
}
if (typeof source == 'string' && source == BEAUTIFY_ALIAS) {
return override(DEFAULTS, {
breaks: breaks(true),
indentBy: 2,
spaces: spaces(true)
});
}
if (typeof source == 'string' && source == KEEP_BREAKS_ALIAS) {
return override(DEFAULTS, {
breaks: {
afterAtRule: true,
afterBlockBegins: true,
afterBlockEnds: true,
afterComment: true,
afterRuleEnds: true,
beforeBlockEnds: true
}
});
}
if (typeof source == 'string') {
return override(DEFAULTS, toHash(source));
}
return DEFAULTS;
}
function toHash(string) {
return string
.split(OPTION_SEPARATOR)
.reduce(function (accumulator, directive) {
var parts = directive.split(OPTION_NAME_VALUE_SEPARATOR);
var name = parts[0];
var value = parts[1];
if (name == 'breaks' || name == 'spaces') {
accumulator[name] = hashValuesToHash(value);
} else if (name == 'indentBy' || name == 'wrapAt') {
accumulator[name] = parseInt(value);
} else if (name == 'indentWith') {
accumulator[name] = mapIndentWith(value);
} else if (name == 'breakWith') {
accumulator[name] = mapBreakWith(value);
}
return accumulator;
}, {});
}
function hashValuesToHash(string) {
return string
.split(HASH_VALUES_OPTION_SEPARATOR)
.reduce(function (accumulator, directive) {
var parts = directive.split(HASH_VALUES_NAME_VALUE_SEPARATOR);
var name = parts[0];
var value = parts[1];
accumulator[name] = normalizeValue(value);
return accumulator;
}, {});
}
function normalizeValue(value) {
switch (value) {
case FALSE_KEYWORD_1:
case FALSE_KEYWORD_2:
return false;
case TRUE_KEYWORD_1:
case TRUE_KEYWORD_2:
return true;
default:
return value;
}
}
function mapBreakWith(value) {
switch (value) {
case 'windows':
case 'crlf':
case BreakWith.CarriageReturnLineFeed:
return BreakWith.CarriageReturnLineFeed;
case 'unix':
case 'lf':
case BreakWith.LineFeed:
return BreakWith.LineFeed;
default:
return systemLineBreak;
}
}
function mapIndentWith(value) {
switch (value) {
case 'space':
return IndentWith.Space;
case 'tab':
return IndentWith.Tab;
default:
return value;
}
}
module.exports = {
Breaks: Breaks,
Spaces: Spaces,
formatFrom: formatFrom
};
node_modules/clean-css/lib/options/rounding-precision.js 0000666 00000003655 15042511722 0017522 0 ustar 00 var override = require('../utils/override');
var INTEGER_PATTERN = /^\d+$/;
var ALL_UNITS = ['*', 'all'];
var DEFAULT_PRECISION = 'off'; // all precision changes are disabled
var DIRECTIVES_SEPARATOR = ','; // e.g. *=5,px=3
var DIRECTIVE_VALUE_SEPARATOR = '='; // e.g. *=5
function roundingPrecisionFrom(source) {
return override(defaults(DEFAULT_PRECISION), buildPrecisionFrom(source));
}
function defaults(value) {
return {
'ch': value,
'cm': value,
'em': value,
'ex': value,
'in': value,
'mm': value,
'pc': value,
'pt': value,
'px': value,
'q': value,
'rem': value,
'vh': value,
'vmax': value,
'vmin': value,
'vw': value,
'%': value
};
}
function buildPrecisionFrom(source) {
if (source === null || source === undefined) {
return {};
}
if (typeof source == 'boolean') {
return {};
}
if (typeof source == 'number' && source == -1) {
return defaults(DEFAULT_PRECISION);
}
if (typeof source == 'number') {
return defaults(source);
}
if (typeof source == 'string' && INTEGER_PATTERN.test(source)) {
return defaults(parseInt(source));
}
if (typeof source == 'string' && source == DEFAULT_PRECISION) {
return defaults(DEFAULT_PRECISION);
}
if (typeof source == 'object') {
return source;
}
return source
.split(DIRECTIVES_SEPARATOR)
.reduce(function (accumulator, directive) {
var directiveParts = directive.split(DIRECTIVE_VALUE_SEPARATOR);
var name = directiveParts[0];
var value = parseInt(directiveParts[1]);
if (isNaN(value) || value == -1) {
value = DEFAULT_PRECISION;
}
if (ALL_UNITS.indexOf(name) > -1) {
accumulator = override(accumulator, defaults(value));
} else {
accumulator[name] = value;
}
return accumulator;
}, {});
}
module.exports = {
DEFAULT: DEFAULT_PRECISION,
roundingPrecisionFrom: roundingPrecisionFrom
};
node_modules/clean-css/lib/options/inline-request.js 0000666 00000000734 15042511722 0016643 0 ustar 00 var url = require('url');
var override = require('../utils/override');
function inlineRequestFrom(option) {
return override(
/* jshint camelcase: false */
proxyOptionsFrom(process.env.HTTP_PROXY || process.env.http_proxy),
option || {}
);
}
function proxyOptionsFrom(httpProxy) {
return httpProxy ?
{
hostname: url.parse(httpProxy).hostname,
port: parseInt(url.parse(httpProxy).port)
} :
{};
}
module.exports = inlineRequestFrom;
node_modules/clean-css/lib/options/inline-timeout.js 0000666 00000000215 15042511722 0016633 0 ustar 00 var DEFAULT_TIMEOUT = 5000;
function inlineTimeoutFrom(option) {
return option || DEFAULT_TIMEOUT;
}
module.exports = inlineTimeoutFrom;
node_modules/clean-css/lib/options/rebase.js 0000666 00000000201 15042511722 0015125 0 ustar 00 function rebaseFrom(rebaseOption) {
return undefined === rebaseOption ? true : !!rebaseOption;
}
module.exports = rebaseFrom;
node_modules/clean-css/lib/options/fetch.js 0000666 00000000254 15042511722 0014765 0 ustar 00 var loadRemoteResource = require('../reader/load-remote-resource');
function fetchFrom(callback) {
return callback || loadRemoteResource;
}
module.exports = fetchFrom;
node_modules/clean-css/lib/writer/source-maps.js 0000666 00000005571 15042511722 0015762 0 ustar 00 var SourceMapGenerator = require('source-map').SourceMapGenerator;
var all = require('./helpers').all;
var isRemoteResource = require('../utils/is-remote-resource');
var isWindows = process.platform == 'win32';
var NIX_SEPARATOR_PATTERN = /\//g;
var UNKNOWN_SOURCE = '$stdin';
var WINDOWS_SEPARATOR = '\\';
function store(serializeContext, element) {
var fromString = typeof element == 'string';
var value = fromString ? element : element[1];
var mappings = fromString ? null : element[2];
var wrap = serializeContext.wrap;
wrap(serializeContext, value);
track(serializeContext, value, mappings);
serializeContext.output.push(value);
}
function wrap(serializeContext, value) {
if (serializeContext.column + value.length > serializeContext.format.wrapAt) {
track(serializeContext, serializeContext.format.breakWith, false);
serializeContext.output.push(serializeContext.format.breakWith);
}
}
function track(serializeContext, value, mappings) {
var parts = value.split('\n');
if (mappings) {
trackAllMappings(serializeContext, mappings);
}
serializeContext.line += parts.length - 1;
serializeContext.column = parts.length > 1 ? 0 : (serializeContext.column + parts.pop().length);
}
function trackAllMappings(serializeContext, mappings) {
for (var i = 0, l = mappings.length; i < l; i++) {
trackMapping(serializeContext, mappings[i]);
}
}
function trackMapping(serializeContext, mapping) {
var line = mapping[0];
var column = mapping[1];
var originalSource = mapping[2];
var source = originalSource;
var storedSource = source || UNKNOWN_SOURCE;
if (isWindows && source && !isRemoteResource(source)) {
storedSource = source.replace(NIX_SEPARATOR_PATTERN, WINDOWS_SEPARATOR);
}
serializeContext.outputMap.addMapping({
generated: {
line: serializeContext.line,
column: serializeContext.column
},
source: storedSource,
original: {
line: line,
column: column
}
});
if (serializeContext.inlineSources && (originalSource in serializeContext.sourcesContent)) {
serializeContext.outputMap.setSourceContent(storedSource, serializeContext.sourcesContent[originalSource]);
}
}
function serializeStylesAndSourceMap(tokens, context) {
var serializeContext = {
column: 0,
format: context.options.format,
indentBy: 0,
indentWith: '',
inlineSources: context.options.sourceMapInlineSources,
line: 1,
output: [],
outputMap: new SourceMapGenerator(),
sourcesContent: context.sourcesContent,
spaceAfterClosingBrace: context.options.compatibility.properties.spaceAfterClosingBrace,
store: store,
wrap: context.options.format.wrapAt ?
wrap :
function () { /* noop */ }
};
all(serializeContext, tokens);
return {
sourceMap: serializeContext.outputMap,
styles: serializeContext.output.join('')
};
}
module.exports = serializeStylesAndSourceMap;
node_modules/clean-css/lib/writer/simple.js 0000666 00000002427 15042511722 0015012 0 ustar 00 var all = require('./helpers').all;
function store(serializeContext, token) {
var value = typeof token == 'string' ?
token :
token[1];
var wrap = serializeContext.wrap;
wrap(serializeContext, value);
track(serializeContext, value);
serializeContext.output.push(value);
}
function wrap(serializeContext, value) {
if (serializeContext.column + value.length > serializeContext.format.wrapAt) {
track(serializeContext, serializeContext.format.breakWith);
serializeContext.output.push(serializeContext.format.breakWith);
}
}
function track(serializeContext, value) {
var parts = value.split('\n');
serializeContext.line += parts.length - 1;
serializeContext.column = parts.length > 1 ? 0 : (serializeContext.column + parts.pop().length);
}
function serializeStyles(tokens, context) {
var serializeContext = {
column: 0,
format: context.options.format,
indentBy: 0,
indentWith: '',
line: 1,
output: [],
spaceAfterClosingBrace: context.options.compatibility.properties.spaceAfterClosingBrace,
store: store,
wrap: context.options.format.wrapAt ?
wrap :
function () { /* noop */ }
};
all(serializeContext, tokens);
return {
styles: serializeContext.output.join('')
};
}
module.exports = serializeStyles;
node_modules/clean-css/lib/writer/one-time.js 0000666 00000002127 15042511722 0015233 0 ustar 00 var helpers = require('./helpers');
function store(serializeContext, token) {
serializeContext.output.push(typeof token == 'string' ? token : token[1]);
}
function context() {
var newContext = {
output: [],
store: store
};
return newContext;
}
function all(tokens) {
var oneTimeContext = context();
helpers.all(oneTimeContext, tokens);
return oneTimeContext.output.join('');
}
function body(tokens) {
var oneTimeContext = context();
helpers.body(oneTimeContext, tokens);
return oneTimeContext.output.join('');
}
function property(tokens, position) {
var oneTimeContext = context();
helpers.property(oneTimeContext, tokens, position, true);
return oneTimeContext.output.join('');
}
function rules(tokens) {
var oneTimeContext = context();
helpers.rules(oneTimeContext, tokens);
return oneTimeContext.output.join('');
}
function value(tokens) {
var oneTimeContext = context();
helpers.value(oneTimeContext, tokens);
return oneTimeContext.output.join('');
}
module.exports = {
all: all,
body: body,
property: property,
rules: rules,
value: value
};
node_modules/clean-css/lib/writer/helpers.js 0000666 00000016415 15042511722 0015165 0 ustar 00 var emptyCharacter = '';
var Breaks = require('../options/format').Breaks;
var Spaces = require('../options/format').Spaces;
var Marker = require('../tokenizer/marker');
var Token = require('../tokenizer/token');
function supportsAfterClosingBrace(token) {
return token[1][1] == 'background' || token[1][1] == 'transform' || token[1][1] == 'src';
}
function afterClosingBrace(token, valueIndex) {
return token[valueIndex][1][token[valueIndex][1].length - 1] == Marker.CLOSE_ROUND_BRACKET;
}
function afterComma(token, valueIndex) {
return token[valueIndex][1] == Marker.COMMA;
}
function afterSlash(token, valueIndex) {
return token[valueIndex][1] == Marker.FORWARD_SLASH;
}
function beforeComma(token, valueIndex) {
return token[valueIndex + 1] && token[valueIndex + 1][1] == Marker.COMMA;
}
function beforeSlash(token, valueIndex) {
return token[valueIndex + 1] && token[valueIndex + 1][1] == Marker.FORWARD_SLASH;
}
function inFilter(token) {
return token[1][1] == 'filter' || token[1][1] == '-ms-filter';
}
function disallowsSpace(context, token, valueIndex) {
return !context.spaceAfterClosingBrace && supportsAfterClosingBrace(token) && afterClosingBrace(token, valueIndex) ||
beforeSlash(token, valueIndex) ||
afterSlash(token, valueIndex) ||
beforeComma(token, valueIndex) ||
afterComma(token, valueIndex);
}
function rules(context, tokens) {
var store = context.store;
for (var i = 0, l = tokens.length; i < l; i++) {
store(context, tokens[i]);
if (i < l - 1) {
store(context, comma(context));
}
}
}
function body(context, tokens) {
var lastPropertyAt = lastPropertyIndex(tokens);
for (var i = 0, l = tokens.length; i < l; i++) {
property(context, tokens, i, lastPropertyAt);
}
}
function lastPropertyIndex(tokens) {
var index = tokens.length - 1;
for (; index >= 0; index--) {
if (tokens[index][0] != Token.COMMENT) {
break;
}
}
return index;
}
function property(context, tokens, position, lastPropertyAt) {
var store = context.store;
var token = tokens[position];
var propertyValue = token[2];
var isPropertyBlock = propertyValue && propertyValue[0] === Token.PROPERTY_BLOCK;
var needsSemicolon;
if ( context.format ) {
if ( context.format.semicolonAfterLastProperty || isPropertyBlock ) {
needsSemicolon = true;
} else if ( position < lastPropertyAt ) {
needsSemicolon = true;
} else {
needsSemicolon = false;
}
} else {
needsSemicolon = position < lastPropertyAt || isPropertyBlock;
}
var isLast = position === lastPropertyAt;
switch (token[0]) {
case Token.AT_RULE:
store(context, token);
store(context, semicolon(context, Breaks.AfterProperty, false));
break;
case Token.AT_RULE_BLOCK:
rules(context, token[1]);
store(context, openBrace(context, Breaks.AfterRuleBegins, true));
body(context, token[2]);
store(context, closeBrace(context, Breaks.AfterRuleEnds, false, isLast));
break;
case Token.COMMENT:
store(context, token);
break;
case Token.PROPERTY:
store(context, token[1]);
store(context, colon(context));
if (propertyValue) {
value(context, token);
}
store(context, needsSemicolon ? semicolon(context, Breaks.AfterProperty, isLast) : emptyCharacter);
break;
case Token.RAW:
store(context, token);
}
}
function value(context, token) {
var store = context.store;
var j, m;
if (token[2][0] == Token.PROPERTY_BLOCK) {
store(context, openBrace(context, Breaks.AfterBlockBegins, false));
body(context, token[2][1]);
store(context, closeBrace(context, Breaks.AfterBlockEnds, false, true));
} else {
for (j = 2, m = token.length; j < m; j++) {
store(context, token[j]);
if (j < m - 1 && (inFilter(token) || !disallowsSpace(context, token, j))) {
store(context, Marker.SPACE);
}
}
}
}
function allowsBreak(context, where) {
return context.format && context.format.breaks[where];
}
function allowsSpace(context, where) {
return context.format && context.format.spaces[where];
}
function openBrace(context, where, needsPrefixSpace) {
if (context.format) {
context.indentBy += context.format.indentBy;
context.indentWith = context.format.indentWith.repeat(context.indentBy);
return (needsPrefixSpace && allowsSpace(context, Spaces.BeforeBlockBegins) ? Marker.SPACE : emptyCharacter) +
Marker.OPEN_CURLY_BRACKET +
(allowsBreak(context, where) ? context.format.breakWith : emptyCharacter) +
context.indentWith;
} else {
return Marker.OPEN_CURLY_BRACKET;
}
}
function closeBrace(context, where, beforeBlockEnd, isLast) {
if (context.format) {
context.indentBy -= context.format.indentBy;
context.indentWith = context.format.indentWith.repeat(context.indentBy);
return (allowsBreak(context, Breaks.AfterProperty) || beforeBlockEnd && allowsBreak(context, Breaks.BeforeBlockEnds) ? context.format.breakWith : emptyCharacter) +
context.indentWith +
Marker.CLOSE_CURLY_BRACKET +
(isLast ? emptyCharacter : (allowsBreak(context, where) ? context.format.breakWith : emptyCharacter) + context.indentWith);
} else {
return Marker.CLOSE_CURLY_BRACKET;
}
}
function colon(context) {
return context.format ?
Marker.COLON + (allowsSpace(context, Spaces.BeforeValue) ? Marker.SPACE : emptyCharacter) :
Marker.COLON;
}
function semicolon(context, where, isLast) {
return context.format ?
Marker.SEMICOLON + (isLast || !allowsBreak(context, where) ? emptyCharacter : context.format.breakWith + context.indentWith) :
Marker.SEMICOLON;
}
function comma(context) {
return context.format ?
Marker.COMMA + (allowsBreak(context, Breaks.BetweenSelectors) ? context.format.breakWith : emptyCharacter) + context.indentWith :
Marker.COMMA;
}
function all(context, tokens) {
var store = context.store;
var token;
var isLast;
var i, l;
for (i = 0, l = tokens.length; i < l; i++) {
token = tokens[i];
isLast = i == l - 1;
switch (token[0]) {
case Token.AT_RULE:
store(context, token);
store(context, semicolon(context, Breaks.AfterAtRule, isLast));
break;
case Token.AT_RULE_BLOCK:
rules(context, token[1]);
store(context, openBrace(context, Breaks.AfterRuleBegins, true));
body(context, token[2]);
store(context, closeBrace(context, Breaks.AfterRuleEnds, false, isLast));
break;
case Token.NESTED_BLOCK:
rules(context, token[1]);
store(context, openBrace(context, Breaks.AfterBlockBegins, true));
all(context, token[2]);
store(context, closeBrace(context, Breaks.AfterBlockEnds, true, isLast));
break;
case Token.COMMENT:
store(context, token);
store(context, allowsBreak(context, Breaks.AfterComment) ? context.format.breakWith : emptyCharacter);
break;
case Token.RAW:
store(context, token);
break;
case Token.RULE:
rules(context, token[1]);
store(context, openBrace(context, Breaks.AfterRuleBegins, true));
body(context, token[2]);
store(context, closeBrace(context, Breaks.AfterRuleEnds, false, isLast));
break;
}
}
}
module.exports = {
all: all,
body: body,
property: property,
rules: rules,
value: value
};
node_modules/clean-css/lib/optimizer/validator.js 0000666 00000025551 15042511722 0016217 0 ustar 00 var functionNoVendorRegexStr = '[A-Z]+(\\-|[A-Z]|[0-9])+\\(.*?\\)';
var functionVendorRegexStr = '\\-(\\-|[A-Z]|[0-9])+\\(.*?\\)';
var variableRegexStr = 'var\\(\\-\\-[^\\)]+\\)';
var functionAnyRegexStr = '(' + variableRegexStr + '|' + functionNoVendorRegexStr + '|' + functionVendorRegexStr + ')';
var calcRegex = new RegExp('^(\\-moz\\-|\\-webkit\\-)?calc\\([^\\)]+\\)$', 'i');
var decimalRegex = /[0-9]/;
var functionAnyRegex = new RegExp('^' + functionAnyRegexStr + '$', 'i');
var hslColorRegex = /^hsl\(\s{0,31}[\-\.]?\d+\s{0,31},\s{0,31}\.?\d+%\s{0,31},\s{0,31}\.?\d+%\s{0,31}\)|hsla\(\s{0,31}[\-\.]?\d+\s{0,31},\s{0,31}\.?\d+%\s{0,31},\s{0,31}\.?\d+%\s{0,31},\s{0,31}\.?\d+\s{0,31}\)$/i;
var identifierRegex = /^(\-[a-z0-9_][a-z0-9\-_]*|[a-z][a-z0-9\-_]*)$/i;
var namedEntityRegex = /^[a-z]+$/i;
var prefixRegex = /^-([a-z0-9]|-)*$/i;
var rgbColorRegex = /^rgb\(\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[\d]{1,3}\s{0,31}\)|rgba\(\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[\.\d]+\s{0,31}\)$/i;
var timingFunctionRegex = /^(cubic\-bezier|steps)\([^\)]+\)$/;
var validTimeUnits = ['ms', 's'];
var urlRegex = /^url\([\s\S]+\)$/i;
var variableRegex = new RegExp('^' + variableRegexStr + '$', 'i');
var eightValueColorRegex = /^#[0-9a-f]{8}$/i;
var fourValueColorRegex = /^#[0-9a-f]{4}$/i;
var sixValueColorRegex = /^#[0-9a-f]{6}$/i;
var threeValueColorRegex = /^#[0-9a-f]{3}$/i;
var DECIMAL_DOT = '.';
var MINUS_SIGN = '-';
var PLUS_SIGN = '+';
var Keywords = {
'^': [
'inherit',
'initial',
'unset'
],
'*-style': [
'auto',
'dashed',
'dotted',
'double',
'groove',
'hidden',
'inset',
'none',
'outset',
'ridge',
'solid'
],
'*-timing-function': [
'ease',
'ease-in',
'ease-in-out',
'ease-out',
'linear',
'step-end',
'step-start'
],
'animation-direction': [
'alternate',
'alternate-reverse',
'normal',
'reverse'
],
'animation-fill-mode': [
'backwards',
'both',
'forwards',
'none'
],
'animation-iteration-count': [
'infinite'
],
'animation-name': [
'none'
],
'animation-play-state': [
'paused',
'running'
],
'background-attachment': [
'fixed',
'inherit',
'local',
'scroll'
],
'background-clip': [
'border-box',
'content-box',
'inherit',
'padding-box',
'text'
],
'background-origin': [
'border-box',
'content-box',
'inherit',
'padding-box'
],
'background-position': [
'bottom',
'center',
'left',
'right',
'top'
],
'background-repeat': [
'no-repeat',
'inherit',
'repeat',
'repeat-x',
'repeat-y',
'round',
'space'
],
'background-size': [
'auto',
'cover',
'contain'
],
'border-collapse': [
'collapse',
'inherit',
'separate'
],
'bottom': [
'auto'
],
'clear': [
'both',
'left',
'none',
'right'
],
'color': [
'transparent'
],
'cursor': [
'all-scroll',
'auto',
'col-resize',
'crosshair',
'default',
'e-resize',
'help',
'move',
'n-resize',
'ne-resize',
'no-drop',
'not-allowed',
'nw-resize',
'pointer',
'progress',
'row-resize',
's-resize',
'se-resize',
'sw-resize',
'text',
'vertical-text',
'w-resize',
'wait'
],
'display': [
'block',
'inline',
'inline-block',
'inline-table',
'list-item',
'none',
'table',
'table-caption',
'table-cell',
'table-column',
'table-column-group',
'table-footer-group',
'table-header-group',
'table-row',
'table-row-group'
],
'float': [
'left',
'none',
'right'
],
'left': [
'auto'
],
'font': [
'caption',
'icon',
'menu',
'message-box',
'small-caption',
'status-bar',
'unset'
],
'font-size': [
'large',
'larger',
'medium',
'small',
'smaller',
'x-large',
'x-small',
'xx-large',
'xx-small'
],
'font-stretch': [
'condensed',
'expanded',
'extra-condensed',
'extra-expanded',
'normal',
'semi-condensed',
'semi-expanded',
'ultra-condensed',
'ultra-expanded'
],
'font-style': [
'italic',
'normal',
'oblique'
],
'font-variant': [
'normal',
'small-caps'
],
'font-weight': [
'100',
'200',
'300',
'400',
'500',
'600',
'700',
'800',
'900',
'bold',
'bolder',
'lighter',
'normal'
],
'line-height': [
'normal'
],
'list-style-position': [
'inside',
'outside'
],
'list-style-type': [
'armenian',
'circle',
'decimal',
'decimal-leading-zero',
'disc',
'decimal|disc', // this is the default value of list-style-type, see comment in compactable.js
'georgian',
'lower-alpha',
'lower-greek',
'lower-latin',
'lower-roman',
'none',
'square',
'upper-alpha',
'upper-latin',
'upper-roman'
],
'overflow': [
'auto',
'hidden',
'scroll',
'visible'
],
'position': [
'absolute',
'fixed',
'relative',
'static'
],
'right': [
'auto'
],
'text-align': [
'center',
'justify',
'left',
'left|right', // this is the default value of list-style-type, see comment in compactable.js
'right'
],
'text-decoration': [
'line-through',
'none',
'overline',
'underline'
],
'text-overflow': [
'clip',
'ellipsis'
],
'top': [
'auto'
],
'vertical-align': [
'baseline',
'bottom',
'middle',
'sub',
'super',
'text-bottom',
'text-top',
'top'
],
'visibility': [
'collapse',
'hidden',
'visible'
],
'white-space': [
'normal',
'nowrap',
'pre'
],
'width': [
'inherit',
'initial',
'medium',
'thick',
'thin'
]
};
var Units = [
'%',
'ch',
'cm',
'em',
'ex',
'in',
'mm',
'pc',
'pt',
'px',
'rem',
'vh',
'vm',
'vmax',
'vmin',
'vw'
];
function isColor(value) {
return value != 'auto' &&
(
isKeyword('color')(value) ||
isHexColor(value) ||
isColorFunction(value) ||
isNamedEntity(value)
);
}
function isColorFunction(value) {
return isRgbColor(value) || isHslColor(value);
}
function isDynamicUnit(value) {
return calcRegex.test(value);
}
function isFunction(value) {
return functionAnyRegex.test(value);
}
function isHexColor(value) {
return threeValueColorRegex.test(value) || fourValueColorRegex.test(value) || sixValueColorRegex.test(value) || eightValueColorRegex.test(value);
}
function isHslColor(value) {
return hslColorRegex.test(value);
}
function isIdentifier(value) {
return identifierRegex.test(value);
}
function isImage(value) {
return value == 'none' || value == 'inherit' || isUrl(value);
}
function isKeyword(propertyName) {
return function(value) {
return Keywords[propertyName].indexOf(value) > -1;
};
}
function isNamedEntity(value) {
return namedEntityRegex.test(value);
}
function isNumber(value) {
return scanForNumber(value) == value.length;
}
function isRgbColor(value) {
return rgbColorRegex.test(value);
}
function isPrefixed(value) {
return prefixRegex.test(value);
}
function isPositiveNumber(value) {
return isNumber(value) &&
parseFloat(value) >= 0;
}
function isVariable(value) {
return variableRegex.test(value);
}
function isTime(value) {
var numberUpTo = scanForNumber(value);
return numberUpTo == value.length && parseInt(value) === 0 ||
numberUpTo > -1 && validTimeUnits.indexOf(value.slice(numberUpTo + 1)) > -1;
}
function isTimingFunction() {
var isTimingFunctionKeyword = isKeyword('*-timing-function');
return function (value) {
return isTimingFunctionKeyword(value) || timingFunctionRegex.test(value);
};
}
function isUnit(validUnits, value) {
var numberUpTo = scanForNumber(value);
return numberUpTo == value.length && parseInt(value) === 0 ||
numberUpTo > -1 && validUnits.indexOf(value.slice(numberUpTo + 1)) > -1 ||
value == 'auto' ||
value == 'inherit';
}
function isUrl(value) {
return urlRegex.test(value);
}
function isZIndex(value) {
return value == 'auto' ||
isNumber(value) ||
isKeyword('^')(value);
}
function scanForNumber(value) {
var hasDot = false;
var hasSign = false;
var character;
var i, l;
for (i = 0, l = value.length; i < l; i++) {
character = value[i];
if (i === 0 && (character == PLUS_SIGN || character == MINUS_SIGN)) {
hasSign = true;
} else if (i > 0 && hasSign && (character == PLUS_SIGN || character == MINUS_SIGN)) {
return i - 1;
} else if (character == DECIMAL_DOT && !hasDot) {
hasDot = true;
} else if (character == DECIMAL_DOT && hasDot) {
return i - 1;
} else if (decimalRegex.test(character)) {
continue;
} else {
return i - 1;
}
}
return i;
}
function validator(compatibility) {
var validUnits = Units.slice(0).filter(function (value) {
return !(value in compatibility.units) || compatibility.units[value] === true;
});
return {
colorOpacity: compatibility.colors.opacity,
isAnimationDirectionKeyword: isKeyword('animation-direction'),
isAnimationFillModeKeyword: isKeyword('animation-fill-mode'),
isAnimationIterationCountKeyword: isKeyword('animation-iteration-count'),
isAnimationNameKeyword: isKeyword('animation-name'),
isAnimationPlayStateKeyword: isKeyword('animation-play-state'),
isTimingFunction: isTimingFunction(),
isBackgroundAttachmentKeyword: isKeyword('background-attachment'),
isBackgroundClipKeyword: isKeyword('background-clip'),
isBackgroundOriginKeyword: isKeyword('background-origin'),
isBackgroundPositionKeyword: isKeyword('background-position'),
isBackgroundRepeatKeyword: isKeyword('background-repeat'),
isBackgroundSizeKeyword: isKeyword('background-size'),
isColor: isColor,
isColorFunction: isColorFunction,
isDynamicUnit: isDynamicUnit,
isFontKeyword: isKeyword('font'),
isFontSizeKeyword: isKeyword('font-size'),
isFontStretchKeyword: isKeyword('font-stretch'),
isFontStyleKeyword: isKeyword('font-style'),
isFontVariantKeyword: isKeyword('font-variant'),
isFontWeightKeyword: isKeyword('font-weight'),
isFunction: isFunction,
isGlobal: isKeyword('^'),
isHslColor: isHslColor,
isIdentifier: isIdentifier,
isImage: isImage,
isKeyword: isKeyword,
isLineHeightKeyword: isKeyword('line-height'),
isListStylePositionKeyword: isKeyword('list-style-position'),
isListStyleTypeKeyword: isKeyword('list-style-type'),
isNumber: isNumber,
isPrefixed: isPrefixed,
isPositiveNumber: isPositiveNumber,
isRgbColor: isRgbColor,
isStyleKeyword: isKeyword('*-style'),
isTime: isTime,
isUnit: isUnit.bind(null, validUnits),
isUrl: isUrl,
isVariable: isVariable,
isWidth: isKeyword('width'),
isZIndex: isZIndex
};
}
module.exports = validator;
node_modules/clean-css/lib/optimizer/hack.js 0000666 00000000205 15042511722 0015125 0 ustar 00 var Hack = {
ASTERISK: 'asterisk',
BANG: 'bang',
BACKSLASH: 'backslash',
UNDERSCORE: 'underscore'
};
module.exports = Hack;
node_modules/clean-css/lib/optimizer/restore-from-optimizing.js 0000666 00000003271 15042511722 0021040 0 ustar 00 var Hack = require('./hack');
var Marker = require('../tokenizer/marker');
var ASTERISK_HACK = '*';
var BACKSLASH_HACK = '\\';
var IMPORTANT_TOKEN = '!important';
var UNDERSCORE_HACK = '_';
var BANG_HACK = '!ie';
function restoreFromOptimizing(properties, restoreCallback) {
var property;
var restored;
var current;
var i;
for (i = properties.length - 1; i >= 0; i--) {
property = properties[i];
if (property.unused) {
continue;
}
if (!property.dirty && !property.important && !property.hack) {
continue;
}
if (restoreCallback) {
restored = restoreCallback(property);
property.value = restored;
} else {
restored = property.value;
}
if (property.important) {
restoreImportant(property);
}
if (property.hack) {
restoreHack(property);
}
if ('all' in property) {
current = property.all[property.position];
current[1][1] = property.name;
current.splice(2, current.length - 1);
Array.prototype.push.apply(current, restored);
}
}
}
function restoreImportant(property) {
property.value[property.value.length - 1][1] += IMPORTANT_TOKEN;
}
function restoreHack(property) {
if (property.hack[0] == Hack.UNDERSCORE) {
property.name = UNDERSCORE_HACK + property.name;
} else if (property.hack[0] == Hack.ASTERISK) {
property.name = ASTERISK_HACK + property.name;
} else if (property.hack[0] == Hack.BACKSLASH) {
property.value[property.value.length - 1][1] += BACKSLASH_HACK + property.hack[1];
} else if (property.hack[0] == Hack.BANG) {
property.value[property.value.length - 1][1] += Marker.SPACE + BANG_HACK;
}
}
module.exports = restoreFromOptimizing;
node_modules/clean-css/lib/optimizer/level-0/optimize.js 0000666 00000000204 15042511722 0017322 0 ustar 00 function level0Optimize(tokens) {
// noop as level 0 means no optimizations!
return tokens;
}
module.exports = level0Optimize;
node_modules/clean-css/lib/optimizer/level-2/merge-non-adjacent-by-selector.js 0000666 00000005005 15042511722 0023354 0 ustar 00 var canReorder = require('./reorderable').canReorder;
var extractProperties = require('./extract-properties');
var optimizeProperties = require('./properties/optimize');
var serializeRules = require('../../writer/one-time').rules;
var Token = require('../../tokenizer/token');
function mergeNonAdjacentBySelector(tokens, context) {
var specificityCache = context.cache.specificity;
var allSelectors = {};
var repeatedSelectors = [];
var i;
for (i = tokens.length - 1; i >= 0; i--) {
if (tokens[i][0] != Token.RULE)
continue;
if (tokens[i][2].length === 0)
continue;
var selector = serializeRules(tokens[i][1]);
allSelectors[selector] = [i].concat(allSelectors[selector] || []);
if (allSelectors[selector].length == 2)
repeatedSelectors.push(selector);
}
for (i = repeatedSelectors.length - 1; i >= 0; i--) {
var positions = allSelectors[repeatedSelectors[i]];
selectorIterator:
for (var j = positions.length - 1; j > 0; j--) {
var positionOne = positions[j - 1];
var tokenOne = tokens[positionOne];
var positionTwo = positions[j];
var tokenTwo = tokens[positionTwo];
directionIterator:
for (var direction = 1; direction >= -1; direction -= 2) {
var topToBottom = direction == 1;
var from = topToBottom ? positionOne + 1 : positionTwo - 1;
var to = topToBottom ? positionTwo : positionOne;
var delta = topToBottom ? 1 : -1;
var moved = topToBottom ? tokenOne : tokenTwo;
var target = topToBottom ? tokenTwo : tokenOne;
var movedProperties = extractProperties(moved);
while (from != to) {
var traversedProperties = extractProperties(tokens[from]);
from += delta;
// traversed then moved as we move selectors towards the start
var reorderable = topToBottom ?
canReorder(movedProperties, traversedProperties, specificityCache) :
canReorder(traversedProperties, movedProperties, specificityCache);
if (!reorderable && !topToBottom)
continue selectorIterator;
if (!reorderable && topToBottom)
continue directionIterator;
}
if (topToBottom) {
Array.prototype.push.apply(moved[2], target[2]);
target[2] = moved[2];
} else {
Array.prototype.push.apply(target[2], moved[2]);
}
optimizeProperties(target[2], true, true, context);
moved[2] = [];
}
}
}
}
module.exports = mergeNonAdjacentBySelector;
node_modules/clean-css/lib/optimizer/level-2/reduce-non-adjacent.js 0000666 00000012370 15042511722 0021301 0 ustar 00 var isMergeable = require('./is-mergeable');
var optimizeProperties = require('./properties/optimize');
var cloneArray = require('../../utils/clone-array');
var Token = require('../../tokenizer/token');
var serializeBody = require('../../writer/one-time').body;
var serializeRules = require('../../writer/one-time').rules;
function reduceNonAdjacent(tokens, context) {
var options = context.options;
var mergeablePseudoClasses = options.compatibility.selectors.mergeablePseudoClasses;
var mergeablePseudoElements = options.compatibility.selectors.mergeablePseudoElements;
var multiplePseudoMerging = options.compatibility.selectors.multiplePseudoMerging;
var candidates = {};
var repeated = [];
for (var i = tokens.length - 1; i >= 0; i--) {
var token = tokens[i];
if (token[0] != Token.RULE) {
continue;
} else if (token[2].length === 0) {
continue;
}
var selectorAsString = serializeRules(token[1]);
var isComplexAndNotSpecial = token[1].length > 1 &&
isMergeable(selectorAsString, mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging);
var wrappedSelectors = wrappedSelectorsFrom(token[1]);
var selectors = isComplexAndNotSpecial ?
[selectorAsString].concat(wrappedSelectors) :
[selectorAsString];
for (var j = 0, m = selectors.length; j < m; j++) {
var selector = selectors[j];
if (!candidates[selector])
candidates[selector] = [];
else
repeated.push(selector);
candidates[selector].push({
where: i,
list: wrappedSelectors,
isPartial: isComplexAndNotSpecial && j > 0,
isComplex: isComplexAndNotSpecial && j === 0
});
}
}
reduceSimpleNonAdjacentCases(tokens, repeated, candidates, options, context);
reduceComplexNonAdjacentCases(tokens, candidates, options, context);
}
function wrappedSelectorsFrom(list) {
var wrapped = [];
for (var i = 0; i < list.length; i++) {
wrapped.push([list[i][1]]);
}
return wrapped;
}
function reduceSimpleNonAdjacentCases(tokens, repeated, candidates, options, context) {
function filterOut(idx, bodies) {
return data[idx].isPartial && bodies.length === 0;
}
function reduceBody(token, newBody, processedCount, tokenIdx) {
if (!data[processedCount - tokenIdx - 1].isPartial)
token[2] = newBody;
}
for (var i = 0, l = repeated.length; i < l; i++) {
var selector = repeated[i];
var data = candidates[selector];
reduceSelector(tokens, data, {
filterOut: filterOut,
callback: reduceBody
}, options, context);
}
}
function reduceComplexNonAdjacentCases(tokens, candidates, options, context) {
var mergeablePseudoClasses = options.compatibility.selectors.mergeablePseudoClasses;
var mergeablePseudoElements = options.compatibility.selectors.mergeablePseudoElements;
var multiplePseudoMerging = options.compatibility.selectors.multiplePseudoMerging;
var localContext = {};
function filterOut(idx) {
return localContext.data[idx].where < localContext.intoPosition;
}
function collectReducedBodies(token, newBody, processedCount, tokenIdx) {
if (tokenIdx === 0)
localContext.reducedBodies.push(newBody);
}
allSelectors:
for (var complexSelector in candidates) {
var into = candidates[complexSelector];
if (!into[0].isComplex)
continue;
var intoPosition = into[into.length - 1].where;
var intoToken = tokens[intoPosition];
var reducedBodies = [];
var selectors = isMergeable(complexSelector, mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) ?
into[0].list :
[complexSelector];
localContext.intoPosition = intoPosition;
localContext.reducedBodies = reducedBodies;
for (var j = 0, m = selectors.length; j < m; j++) {
var selector = selectors[j];
var data = candidates[selector];
if (data.length < 2)
continue allSelectors;
localContext.data = data;
reduceSelector(tokens, data, {
filterOut: filterOut,
callback: collectReducedBodies
}, options, context);
if (serializeBody(reducedBodies[reducedBodies.length - 1]) != serializeBody(reducedBodies[0]))
continue allSelectors;
}
intoToken[2] = reducedBodies[0];
}
}
function reduceSelector(tokens, data, context, options, outerContext) {
var bodies = [];
var bodiesAsList = [];
var processedTokens = [];
for (var j = data.length - 1; j >= 0; j--) {
if (context.filterOut(j, bodies))
continue;
var where = data[j].where;
var token = tokens[where];
var clonedBody = cloneArray(token[2]);
bodies = bodies.concat(clonedBody);
bodiesAsList.push(clonedBody);
processedTokens.push(where);
}
optimizeProperties(bodies, true, false, outerContext);
var processedCount = processedTokens.length;
var propertyIdx = bodies.length - 1;
var tokenIdx = processedCount - 1;
while (tokenIdx >= 0) {
if ((tokenIdx === 0 || (bodies[propertyIdx] && bodiesAsList[tokenIdx].indexOf(bodies[propertyIdx]) > -1)) && propertyIdx > -1) {
propertyIdx--;
continue;
}
var newBody = bodies.splice(propertyIdx + 1);
context.callback(tokens[processedTokens[tokenIdx]], newBody, processedCount, tokenIdx);
tokenIdx--;
}
}
module.exports = reduceNonAdjacent;
node_modules/clean-css/lib/optimizer/level-2/optimize.js 0000666 00000007410 15042511722 0017332 0 ustar 00 var mergeAdjacent = require('./merge-adjacent');
var mergeMediaQueries = require('./merge-media-queries');
var mergeNonAdjacentByBody = require('./merge-non-adjacent-by-body');
var mergeNonAdjacentBySelector = require('./merge-non-adjacent-by-selector');
var reduceNonAdjacent = require('./reduce-non-adjacent');
var removeDuplicateFontAtRules = require('./remove-duplicate-font-at-rules');
var removeDuplicateMediaQueries = require('./remove-duplicate-media-queries');
var removeDuplicates = require('./remove-duplicates');
var removeUnusedAtRules = require('./remove-unused-at-rules');
var restructure = require('./restructure');
var optimizeProperties = require('./properties/optimize');
var OptimizationLevel = require('../../options/optimization-level').OptimizationLevel;
var Token = require('../../tokenizer/token');
function removeEmpty(tokens) {
for (var i = 0, l = tokens.length; i < l; i++) {
var token = tokens[i];
var isEmpty = false;
switch (token[0]) {
case Token.RULE:
isEmpty = token[1].length === 0 || token[2].length === 0;
break;
case Token.NESTED_BLOCK:
removeEmpty(token[2]);
isEmpty = token[2].length === 0;
break;
case Token.AT_RULE:
isEmpty = token[1].length === 0;
break;
case Token.AT_RULE_BLOCK:
isEmpty = token[2].length === 0;
}
if (isEmpty) {
tokens.splice(i, 1);
i--;
l--;
}
}
}
function recursivelyOptimizeBlocks(tokens, context) {
for (var i = 0, l = tokens.length; i < l; i++) {
var token = tokens[i];
if (token[0] == Token.NESTED_BLOCK) {
var isKeyframes = /@(-moz-|-o-|-webkit-)?keyframes/.test(token[1][0][1]);
level2Optimize(token[2], context, !isKeyframes);
}
}
}
function recursivelyOptimizeProperties(tokens, context) {
for (var i = 0, l = tokens.length; i < l; i++) {
var token = tokens[i];
switch (token[0]) {
case Token.RULE:
optimizeProperties(token[2], true, true, context);
break;
case Token.NESTED_BLOCK:
recursivelyOptimizeProperties(token[2], context);
}
}
}
function level2Optimize(tokens, context, withRestructuring) {
var levelOptions = context.options.level[OptimizationLevel.Two];
var reduced;
var i;
recursivelyOptimizeBlocks(tokens, context);
recursivelyOptimizeProperties(tokens, context);
if (levelOptions.removeDuplicateRules) {
removeDuplicates(tokens, context);
}
if (levelOptions.mergeAdjacentRules) {
mergeAdjacent(tokens, context);
}
if (levelOptions.reduceNonAdjacentRules) {
reduceNonAdjacent(tokens, context);
}
if (levelOptions.mergeNonAdjacentRules && levelOptions.mergeNonAdjacentRules != 'body') {
mergeNonAdjacentBySelector(tokens, context);
}
if (levelOptions.mergeNonAdjacentRules && levelOptions.mergeNonAdjacentRules != 'selector') {
mergeNonAdjacentByBody(tokens, context);
}
if (levelOptions.restructureRules && levelOptions.mergeAdjacentRules && withRestructuring) {
restructure(tokens, context);
mergeAdjacent(tokens, context);
}
if (levelOptions.restructureRules && !levelOptions.mergeAdjacentRules && withRestructuring) {
restructure(tokens, context);
}
if (levelOptions.removeDuplicateFontRules) {
removeDuplicateFontAtRules(tokens, context);
}
if (levelOptions.removeDuplicateMediaBlocks) {
removeDuplicateMediaQueries(tokens, context);
}
if (levelOptions.removeUnusedAtRules) {
removeUnusedAtRules(tokens, context);
}
if (levelOptions.mergeMedia) {
reduced = mergeMediaQueries(tokens, context);
for (i = reduced.length - 1; i >= 0; i--) {
level2Optimize(reduced[i][2], context, false);
}
}
if (levelOptions.removeEmpty) {
removeEmpty(tokens);
}
return tokens;
}
module.exports = level2Optimize;
node_modules/clean-css/lib/optimizer/level-2/restructure.js 0000666 00000030455 15042511722 0020066 0 ustar 00 var canReorderSingle = require('./reorderable').canReorderSingle;
var extractProperties = require('./extract-properties');
var isMergeable = require('./is-mergeable');
var tidyRuleDuplicates = require('./tidy-rule-duplicates');
var Token = require('../../tokenizer/token');
var cloneArray = require('../../utils/clone-array');
var serializeBody = require('../../writer/one-time').body;
var serializeRules = require('../../writer/one-time').rules;
function naturalSorter(a, b) {
return a > b ? 1 : -1;
}
function cloneAndMergeSelectors(propertyA, propertyB) {
var cloned = cloneArray(propertyA);
cloned[5] = cloned[5].concat(propertyB[5]);
return cloned;
}
function restructure(tokens, context) {
var options = context.options;
var mergeablePseudoClasses = options.compatibility.selectors.mergeablePseudoClasses;
var mergeablePseudoElements = options.compatibility.selectors.mergeablePseudoElements;
var mergeLimit = options.compatibility.selectors.mergeLimit;
var multiplePseudoMerging = options.compatibility.selectors.multiplePseudoMerging;
var specificityCache = context.cache.specificity;
var movableTokens = {};
var movedProperties = [];
var multiPropertyMoveCache = {};
var movedToBeDropped = [];
var maxCombinationsLevel = 2;
var ID_JOIN_CHARACTER = '%';
function sendToMultiPropertyMoveCache(position, movedProperty, allFits) {
for (var i = allFits.length - 1; i >= 0; i--) {
var fit = allFits[i][0];
var id = addToCache(movedProperty, fit);
if (multiPropertyMoveCache[id].length > 1 && processMultiPropertyMove(position, multiPropertyMoveCache[id])) {
removeAllMatchingFromCache(id);
break;
}
}
}
function addToCache(movedProperty, fit) {
var id = cacheId(fit);
multiPropertyMoveCache[id] = multiPropertyMoveCache[id] || [];
multiPropertyMoveCache[id].push([movedProperty, fit]);
return id;
}
function removeAllMatchingFromCache(matchId) {
var matchSelectors = matchId.split(ID_JOIN_CHARACTER);
var forRemoval = [];
var i;
for (var id in multiPropertyMoveCache) {
var selectors = id.split(ID_JOIN_CHARACTER);
for (i = selectors.length - 1; i >= 0; i--) {
if (matchSelectors.indexOf(selectors[i]) > -1) {
forRemoval.push(id);
break;
}
}
}
for (i = forRemoval.length - 1; i >= 0; i--) {
delete multiPropertyMoveCache[forRemoval[i]];
}
}
function cacheId(cachedTokens) {
var id = [];
for (var i = 0, l = cachedTokens.length; i < l; i++) {
id.push(serializeRules(cachedTokens[i][1]));
}
return id.join(ID_JOIN_CHARACTER);
}
function tokensToMerge(sourceTokens) {
var uniqueTokensWithBody = [];
var mergeableTokens = [];
for (var i = sourceTokens.length - 1; i >= 0; i--) {
if (!isMergeable(serializeRules(sourceTokens[i][1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging)) {
continue;
}
mergeableTokens.unshift(sourceTokens[i]);
if (sourceTokens[i][2].length > 0 && uniqueTokensWithBody.indexOf(sourceTokens[i]) == -1)
uniqueTokensWithBody.push(sourceTokens[i]);
}
return uniqueTokensWithBody.length > 1 ?
mergeableTokens :
[];
}
function shortenIfPossible(position, movedProperty) {
var name = movedProperty[0];
var value = movedProperty[1];
var key = movedProperty[4];
var valueSize = name.length + value.length + 1;
var allSelectors = [];
var qualifiedTokens = [];
var mergeableTokens = tokensToMerge(movableTokens[key]);
if (mergeableTokens.length < 2)
return;
var allFits = findAllFits(mergeableTokens, valueSize, 1);
var bestFit = allFits[0];
if (bestFit[1] > 0)
return sendToMultiPropertyMoveCache(position, movedProperty, allFits);
for (var i = bestFit[0].length - 1; i >=0; i--) {
allSelectors = bestFit[0][i][1].concat(allSelectors);
qualifiedTokens.unshift(bestFit[0][i]);
}
allSelectors = tidyRuleDuplicates(allSelectors);
dropAsNewTokenAt(position, [movedProperty], allSelectors, qualifiedTokens);
}
function fitSorter(fit1, fit2) {
return fit1[1] > fit2[1] ? 1 : (fit1[1] == fit2[1] ? 0 : -1);
}
function findAllFits(mergeableTokens, propertySize, propertiesCount) {
var combinations = allCombinations(mergeableTokens, propertySize, propertiesCount, maxCombinationsLevel - 1);
return combinations.sort(fitSorter);
}
function allCombinations(tokensVariant, propertySize, propertiesCount, level) {
var differenceVariants = [[tokensVariant, sizeDifference(tokensVariant, propertySize, propertiesCount)]];
if (tokensVariant.length > 2 && level > 0) {
for (var i = tokensVariant.length - 1; i >= 0; i--) {
var subVariant = Array.prototype.slice.call(tokensVariant, 0);
subVariant.splice(i, 1);
differenceVariants = differenceVariants.concat(allCombinations(subVariant, propertySize, propertiesCount, level - 1));
}
}
return differenceVariants;
}
function sizeDifference(tokensVariant, propertySize, propertiesCount) {
var allSelectorsSize = 0;
for (var i = tokensVariant.length - 1; i >= 0; i--) {
allSelectorsSize += tokensVariant[i][2].length > propertiesCount ? serializeRules(tokensVariant[i][1]).length : -1;
}
return allSelectorsSize - (tokensVariant.length - 1) * propertySize + 1;
}
function dropAsNewTokenAt(position, properties, allSelectors, mergeableTokens) {
var i, j, k, m;
var allProperties = [];
for (i = mergeableTokens.length - 1; i >= 0; i--) {
var mergeableToken = mergeableTokens[i];
for (j = mergeableToken[2].length - 1; j >= 0; j--) {
var mergeableProperty = mergeableToken[2][j];
for (k = 0, m = properties.length; k < m; k++) {
var property = properties[k];
var mergeablePropertyName = mergeableProperty[1][1];
var propertyName = property[0];
var propertyBody = property[4];
if (mergeablePropertyName == propertyName && serializeBody([mergeableProperty]) == propertyBody) {
mergeableToken[2].splice(j, 1);
break;
}
}
}
}
for (i = properties.length - 1; i >= 0; i--) {
allProperties.unshift(properties[i][3]);
}
var newToken = [Token.RULE, allSelectors, allProperties];
tokens.splice(position, 0, newToken);
}
function dropPropertiesAt(position, movedProperty) {
var key = movedProperty[4];
var toMove = movableTokens[key];
if (toMove && toMove.length > 1) {
if (!shortenMultiMovesIfPossible(position, movedProperty))
shortenIfPossible(position, movedProperty);
}
}
function shortenMultiMovesIfPossible(position, movedProperty) {
var candidates = [];
var propertiesAndMergableTokens = [];
var key = movedProperty[4];
var j, k;
var mergeableTokens = tokensToMerge(movableTokens[key]);
if (mergeableTokens.length < 2)
return;
movableLoop:
for (var value in movableTokens) {
var tokensList = movableTokens[value];
for (j = mergeableTokens.length - 1; j >= 0; j--) {
if (tokensList.indexOf(mergeableTokens[j]) == -1)
continue movableLoop;
}
candidates.push(value);
}
if (candidates.length < 2)
return false;
for (j = candidates.length - 1; j >= 0; j--) {
for (k = movedProperties.length - 1; k >= 0; k--) {
if (movedProperties[k][4] == candidates[j]) {
propertiesAndMergableTokens.unshift([movedProperties[k], mergeableTokens]);
break;
}
}
}
return processMultiPropertyMove(position, propertiesAndMergableTokens);
}
function processMultiPropertyMove(position, propertiesAndMergableTokens) {
var valueSize = 0;
var properties = [];
var property;
for (var i = propertiesAndMergableTokens.length - 1; i >= 0; i--) {
property = propertiesAndMergableTokens[i][0];
var fullValue = property[4];
valueSize += fullValue.length + (i > 0 ? 1 : 0);
properties.push(property);
}
var mergeableTokens = propertiesAndMergableTokens[0][1];
var bestFit = findAllFits(mergeableTokens, valueSize, properties.length)[0];
if (bestFit[1] > 0)
return false;
var allSelectors = [];
var qualifiedTokens = [];
for (i = bestFit[0].length - 1; i >= 0; i--) {
allSelectors = bestFit[0][i][1].concat(allSelectors);
qualifiedTokens.unshift(bestFit[0][i]);
}
allSelectors = tidyRuleDuplicates(allSelectors);
dropAsNewTokenAt(position, properties, allSelectors, qualifiedTokens);
for (i = properties.length - 1; i >= 0; i--) {
property = properties[i];
var index = movedProperties.indexOf(property);
delete movableTokens[property[4]];
if (index > -1 && movedToBeDropped.indexOf(index) == -1)
movedToBeDropped.push(index);
}
return true;
}
function boundToAnotherPropertyInCurrrentToken(property, movedProperty, token) {
var propertyName = property[0];
var movedPropertyName = movedProperty[0];
if (propertyName != movedPropertyName)
return false;
var key = movedProperty[4];
var toMove = movableTokens[key];
return toMove && toMove.indexOf(token) > -1;
}
for (var i = tokens.length - 1; i >= 0; i--) {
var token = tokens[i];
var isRule;
var j, k, m;
var samePropertyAt;
if (token[0] == Token.RULE) {
isRule = true;
} else if (token[0] == Token.NESTED_BLOCK) {
isRule = false;
} else {
continue;
}
// We cache movedProperties.length as it may change in the loop
var movedCount = movedProperties.length;
var properties = extractProperties(token);
movedToBeDropped = [];
var unmovableInCurrentToken = [];
for (j = properties.length - 1; j >= 0; j--) {
for (k = j - 1; k >= 0; k--) {
if (!canReorderSingle(properties[j], properties[k], specificityCache)) {
unmovableInCurrentToken.push(j);
break;
}
}
}
for (j = properties.length - 1; j >= 0; j--) {
var property = properties[j];
var movedSameProperty = false;
for (k = 0; k < movedCount; k++) {
var movedProperty = movedProperties[k];
if (movedToBeDropped.indexOf(k) == -1 && (!canReorderSingle(property, movedProperty, specificityCache) && !boundToAnotherPropertyInCurrrentToken(property, movedProperty, token) ||
movableTokens[movedProperty[4]] && movableTokens[movedProperty[4]].length === mergeLimit)) {
dropPropertiesAt(i + 1, movedProperty, token);
if (movedToBeDropped.indexOf(k) == -1) {
movedToBeDropped.push(k);
delete movableTokens[movedProperty[4]];
}
}
if (!movedSameProperty) {
movedSameProperty = property[0] == movedProperty[0] && property[1] == movedProperty[1];
if (movedSameProperty) {
samePropertyAt = k;
}
}
}
if (!isRule || unmovableInCurrentToken.indexOf(j) > -1)
continue;
var key = property[4];
if (movedSameProperty && movedProperties[samePropertyAt][5].length + property[5].length > mergeLimit) {
dropPropertiesAt(i + 1, movedProperties[samePropertyAt]);
movedProperties.splice(samePropertyAt, 1);
movableTokens[key] = [token];
movedSameProperty = false;
} else {
movableTokens[key] = movableTokens[key] || [];
movableTokens[key].push(token);
}
if (movedSameProperty) {
movedProperties[samePropertyAt] = cloneAndMergeSelectors(movedProperties[samePropertyAt], property);
} else {
movedProperties.push(property);
}
}
movedToBeDropped = movedToBeDropped.sort(naturalSorter);
for (j = 0, m = movedToBeDropped.length; j < m; j++) {
var dropAt = movedToBeDropped[j] - j;
movedProperties.splice(dropAt, 1);
}
}
var position = tokens[0] && tokens[0][0] == Token.AT_RULE && tokens[0][1].indexOf('@charset') === 0 ? 1 : 0;
for (; position < tokens.length - 1; position++) {
var isImportRule = tokens[position][0] === Token.AT_RULE && tokens[position][1].indexOf('@import') === 0;
var isComment = tokens[position][0] === Token.COMMENT;
if (!(isImportRule || isComment))
break;
}
for (i = 0; i < movedProperties.length; i++) {
dropPropertiesAt(position, movedProperties[i]);
}
}
module.exports = restructure;
node_modules/clean-css/lib/optimizer/level-2/extract-properties.js 0000666 00000003630 15042511722 0021336 0 ustar 00 // This extractor is used in level 2 optimizations
// IMPORTANT: Mind Token class and this code is not related!
// Properties will be tokenized in one step, see #429
var Token = require('../../tokenizer/token');
var serializeRules = require('../../writer/one-time').rules;
var serializeValue = require('../../writer/one-time').value;
function extractProperties(token) {
var properties = [];
var inSpecificSelector;
var property;
var name;
var value;
var i, l;
if (token[0] == Token.RULE) {
inSpecificSelector = !/[\.\+>~]/.test(serializeRules(token[1]));
for (i = 0, l = token[2].length; i < l; i++) {
property = token[2][i];
if (property[0] != Token.PROPERTY)
continue;
name = property[1][1];
if (name.length === 0)
continue;
if (name.indexOf('--') === 0)
continue;
value = serializeValue(property, i);
properties.push([
name,
value,
findNameRoot(name),
token[2][i],
name + ':' + value,
token[1],
inSpecificSelector
]);
}
} else if (token[0] == Token.NESTED_BLOCK) {
for (i = 0, l = token[2].length; i < l; i++) {
properties = properties.concat(extractProperties(token[2][i]));
}
}
return properties;
}
function findNameRoot(name) {
if (name == 'list-style')
return name;
if (name.indexOf('-radius') > 0)
return 'border-radius';
if (name == 'border-collapse' || name == 'border-spacing' || name == 'border-image')
return name;
if (name.indexOf('border-') === 0 && /^border\-\w+\-\w+$/.test(name))
return name.match(/border\-\w+/)[0];
if (name.indexOf('border-') === 0 && /^border\-\w+$/.test(name))
return 'border';
if (name.indexOf('text-') === 0)
return name;
if (name == '-chrome-')
return name;
return name.replace(/^\-\w+\-/, '').match(/([a-zA-Z]+)/)[0].toLowerCase();
}
module.exports = extractProperties;
node_modules/clean-css/lib/optimizer/level-2/remove-duplicates.js 0000666 00000001722 15042511722 0021122 0 ustar 00 var Token = require('../../tokenizer/token');
var serializeBody = require('../../writer/one-time').body;
var serializeRules = require('../../writer/one-time').rules;
function removeDuplicates(tokens) {
var matched = {};
var moreThanOnce = [];
var id, token;
var body, bodies;
for (var i = 0, l = tokens.length; i < l; i++) {
token = tokens[i];
if (token[0] != Token.RULE)
continue;
id = serializeRules(token[1]);
if (matched[id] && matched[id].length == 1)
moreThanOnce.push(id);
else
matched[id] = matched[id] || [];
matched[id].push(i);
}
for (i = 0, l = moreThanOnce.length; i < l; i++) {
id = moreThanOnce[i];
bodies = [];
for (var j = matched[id].length - 1; j >= 0; j--) {
token = tokens[matched[id][j]];
body = serializeBody(token[2]);
if (bodies.indexOf(body) > -1)
token[2] = [];
else
bodies.push(body);
}
}
}
module.exports = removeDuplicates;
node_modules/clean-css/lib/optimizer/level-2/compactable.js 0000666 00000062777 15042511722 0017765 0 ustar 00 // Contains the interpretation of CSS properties, as used by the property optimizer
var breakUp = require('./break-up');
var canOverride = require('./can-override');
var restore = require('./restore');
var override = require('../../utils/override');
// Properties to process
// Extend this object in order to add support for more properties in the optimizer.
//
// Each key in this object represents a CSS property and should be an object.
// Such an object contains properties that describe how the represented CSS property should be handled.
// Possible options:
//
// * components: array (Only specify for shorthand properties.)
// Contains the names of the granular properties this shorthand compacts.
//
// * canOverride: function
// Returns whether two tokens of this property can be merged with each other.
// This property has no meaning for shorthands.
//
// * defaultValue: string
// Specifies the default value of the property according to the CSS standard.
// For shorthand, this is used when every component is set to its default value, therefore it should be the shortest possible default value of all the components.
//
// * shortestValue: string
// Specifies the shortest possible value the property can possibly have.
// (Falls back to defaultValue if unspecified.)
//
// * breakUp: function (Only specify for shorthand properties.)
// Breaks the shorthand up to its components.
//
// * restore: function (Only specify for shorthand properties.)
// Puts the shorthand together from its components.
//
var compactable = {
'animation': {
canOverride: canOverride.generic.components([
canOverride.generic.time,
canOverride.generic.timingFunction,
canOverride.generic.time,
canOverride.property.animationIterationCount,
canOverride.property.animationDirection,
canOverride.property.animationFillMode,
canOverride.property.animationPlayState,
canOverride.property.animationName
]),
components: [
'animation-duration',
'animation-timing-function',
'animation-delay',
'animation-iteration-count',
'animation-direction',
'animation-fill-mode',
'animation-play-state',
'animation-name'
],
breakUp: breakUp.multiplex(breakUp.animation),
defaultValue: 'none',
restore: restore.multiplex(restore.withoutDefaults),
shorthand: true,
vendorPrefixes: [
'-moz-',
'-o-',
'-webkit-'
]
},
'animation-delay': {
canOverride: canOverride.generic.time,
componentOf: [
'animation'
],
defaultValue: '0s',
intoMultiplexMode: 'real',
vendorPrefixes: [
'-moz-',
'-o-',
'-webkit-'
]
},
'animation-direction': {
canOverride: canOverride.property.animationDirection,
componentOf: [
'animation'
],
defaultValue: 'normal',
intoMultiplexMode: 'real',
vendorPrefixes: [
'-moz-',
'-o-',
'-webkit-'
]
},
'animation-duration': {
canOverride: canOverride.generic.time,
componentOf: [
'animation'
],
defaultValue: '0s',
intoMultiplexMode: 'real',
keepUnlessDefault: 'animation-delay',
vendorPrefixes: [
'-moz-',
'-o-',
'-webkit-'
]
},
'animation-fill-mode': {
canOverride: canOverride.property.animationFillMode,
componentOf: [
'animation'
],
defaultValue: 'none',
intoMultiplexMode: 'real',
vendorPrefixes: [
'-moz-',
'-o-',
'-webkit-'
]
},
'animation-iteration-count': {
canOverride: canOverride.property.animationIterationCount,
componentOf: [
'animation'
],
defaultValue: '1',
intoMultiplexMode: 'real',
vendorPrefixes: [
'-moz-',
'-o-',
'-webkit-'
]
},
'animation-name': {
canOverride: canOverride.property.animationName,
componentOf: [
'animation'
],
defaultValue: 'none',
intoMultiplexMode: 'real',
vendorPrefixes: [
'-moz-',
'-o-',
'-webkit-'
]
},
'animation-play-state': {
canOverride: canOverride.property.animationPlayState,
componentOf: [
'animation'
],
defaultValue: 'running',
intoMultiplexMode: 'real',
vendorPrefixes: [
'-moz-',
'-o-',
'-webkit-'
]
},
'animation-timing-function': {
canOverride: canOverride.generic.timingFunction,
componentOf: [
'animation'
],
defaultValue: 'ease',
intoMultiplexMode: 'real',
vendorPrefixes: [
'-moz-',
'-o-',
'-webkit-'
]
},
'background': {
canOverride: canOverride.generic.components([
canOverride.generic.image,
canOverride.property.backgroundPosition,
canOverride.property.backgroundSize,
canOverride.property.backgroundRepeat,
canOverride.property.backgroundAttachment,
canOverride.property.backgroundOrigin,
canOverride.property.backgroundClip,
canOverride.generic.color
]),
components: [
'background-image',
'background-position',
'background-size',
'background-repeat',
'background-attachment',
'background-origin',
'background-clip',
'background-color'
],
breakUp: breakUp.multiplex(breakUp.background),
defaultValue: '0 0',
restore: restore.multiplex(restore.background),
shortestValue: '0',
shorthand: true
},
'background-attachment': {
canOverride: canOverride.property.backgroundAttachment,
componentOf: [
'background'
],
defaultValue: 'scroll',
intoMultiplexMode: 'real'
},
'background-clip': {
canOverride: canOverride.property.backgroundClip,
componentOf: [
'background'
],
defaultValue: 'border-box',
intoMultiplexMode: 'real',
shortestValue: 'border-box'
},
'background-color': {
canOverride: canOverride.generic.color,
componentOf: [
'background'
],
defaultValue: 'transparent',
intoMultiplexMode: 'real', // otherwise real color will turn into default since color appears in last multiplex only
multiplexLastOnly: true,
nonMergeableValue: 'none',
shortestValue: 'red'
},
'background-image': {
canOverride: canOverride.generic.image,
componentOf: [
'background'
],
defaultValue: 'none',
intoMultiplexMode: 'default'
},
'background-origin': {
canOverride: canOverride.property.backgroundOrigin,
componentOf: [
'background'
],
defaultValue: 'padding-box',
intoMultiplexMode: 'real',
shortestValue: 'border-box'
},
'background-position': {
canOverride: canOverride.property.backgroundPosition,
componentOf: [
'background'
],
defaultValue: ['0', '0'],
doubleValues: true,
intoMultiplexMode: 'real',
shortestValue: '0'
},
'background-repeat': {
canOverride: canOverride.property.backgroundRepeat,
componentOf: [
'background'
],
defaultValue: ['repeat'],
doubleValues: true,
intoMultiplexMode: 'real'
},
'background-size': {
canOverride: canOverride.property.backgroundSize,
componentOf: [
'background'
],
defaultValue: ['auto'],
doubleValues: true,
intoMultiplexMode: 'real',
shortestValue: '0 0'
},
'bottom': {
canOverride: canOverride.property.bottom,
defaultValue: 'auto'
},
'border': {
breakUp: breakUp.border,
canOverride: canOverride.generic.components([
canOverride.generic.unit,
canOverride.property.borderStyle,
canOverride.generic.color
]),
components: [
'border-width',
'border-style',
'border-color'
],
defaultValue: 'none',
overridesShorthands: [
'border-bottom',
'border-left',
'border-right',
'border-top'
],
restore: restore.withoutDefaults,
shorthand: true,
shorthandComponents: true
},
'border-bottom': {
breakUp: breakUp.border,
canOverride: canOverride.generic.components([
canOverride.generic.unit,
canOverride.property.borderStyle,
canOverride.generic.color
]),
components: [
'border-bottom-width',
'border-bottom-style',
'border-bottom-color'
],
defaultValue: 'none',
restore: restore.withoutDefaults,
shorthand: true
},
'border-bottom-color': {
canOverride: canOverride.generic.color,
componentOf: [
'border-bottom',
'border-color'
],
defaultValue: 'none'
},
'border-bottom-left-radius': {
canOverride: canOverride.generic.unit,
componentOf: [
'border-radius'
],
defaultValue: '0',
vendorPrefixes: [
'-moz-',
'-o-'
]
},
'border-bottom-right-radius': {
canOverride: canOverride.generic.unit,
componentOf: [
'border-radius'
],
defaultValue: '0',
vendorPrefixes: [
'-moz-',
'-o-'
]
},
'border-bottom-style': {
canOverride: canOverride.property.borderStyle,
componentOf: [
'border-bottom',
'border-style'
],
defaultValue: 'none'
},
'border-bottom-width': {
canOverride: canOverride.generic.unit,
componentOf: [
'border-bottom',
'border-width'
],
defaultValue: 'medium',
oppositeTo: 'border-top-width',
shortestValue: '0'
},
'border-collapse': {
canOverride: canOverride.property.borderCollapse,
defaultValue: 'separate'
},
'border-color': {
breakUp: breakUp.fourValues,
canOverride: canOverride.generic.components([
canOverride.generic.color,
canOverride.generic.color,
canOverride.generic.color,
canOverride.generic.color
]),
componentOf: [
'border'
],
components: [
'border-top-color',
'border-right-color',
'border-bottom-color',
'border-left-color'
],
defaultValue: 'none',
restore: restore.fourValues,
shortestValue: 'red',
shorthand: true
},
'border-left': {
breakUp: breakUp.border,
canOverride: canOverride.generic.components([
canOverride.generic.unit,
canOverride.property.borderStyle,
canOverride.generic.color
]),
components: [
'border-left-width',
'border-left-style',
'border-left-color'
],
defaultValue: 'none',
restore: restore.withoutDefaults,
shorthand: true
},
'border-left-color': {
canOverride: canOverride.generic.color,
componentOf: [
'border-color',
'border-left'
],
defaultValue: 'none'
},
'border-left-style': {
canOverride: canOverride.property.borderStyle,
componentOf: [
'border-left',
'border-style'
],
defaultValue: 'none'
},
'border-left-width': {
canOverride: canOverride.generic.unit,
componentOf: [
'border-left',
'border-width'
],
defaultValue: 'medium',
oppositeTo: 'border-right-width',
shortestValue: '0'
},
'border-radius': {
breakUp: breakUp.borderRadius,
canOverride: canOverride.generic.components([
canOverride.generic.unit,
canOverride.generic.unit,
canOverride.generic.unit,
canOverride.generic.unit
]),
components: [
'border-top-left-radius',
'border-top-right-radius',
'border-bottom-right-radius',
'border-bottom-left-radius'
],
defaultValue: '0',
restore: restore.borderRadius,
shorthand: true,
vendorPrefixes: [
'-moz-',
'-o-'
]
},
'border-right': {
breakUp: breakUp.border,
canOverride: canOverride.generic.components([
canOverride.generic.unit,
canOverride.property.borderStyle,
canOverride.generic.color
]),
components: [
'border-right-width',
'border-right-style',
'border-right-color'
],
defaultValue: 'none',
restore: restore.withoutDefaults,
shorthand: true
},
'border-right-color': {
canOverride: canOverride.generic.color,
componentOf: [
'border-color',
'border-right'
],
defaultValue: 'none'
},
'border-right-style': {
canOverride: canOverride.property.borderStyle,
componentOf: [
'border-right',
'border-style'
],
defaultValue: 'none'
},
'border-right-width': {
canOverride: canOverride.generic.unit,
componentOf: [
'border-right',
'border-width'
],
defaultValue: 'medium',
oppositeTo: 'border-left-width',
shortestValue: '0'
},
'border-style': {
breakUp: breakUp.fourValues,
canOverride: canOverride.generic.components([
canOverride.property.borderStyle,
canOverride.property.borderStyle,
canOverride.property.borderStyle,
canOverride.property.borderStyle
]),
componentOf: [
'border'
],
components: [
'border-top-style',
'border-right-style',
'border-bottom-style',
'border-left-style'
],
defaultValue: 'none',
restore: restore.fourValues,
shorthand: true
},
'border-top': {
breakUp: breakUp.border,
canOverride: canOverride.generic.components([
canOverride.generic.unit,
canOverride.property.borderStyle,
canOverride.generic.color
]),
components: [
'border-top-width',
'border-top-style',
'border-top-color'
],
defaultValue: 'none',
restore: restore.withoutDefaults,
shorthand: true
},
'border-top-color': {
canOverride: canOverride.generic.color,
componentOf: [
'border-color',
'border-top'
],
defaultValue: 'none'
},
'border-top-left-radius': {
canOverride: canOverride.generic.unit,
componentOf: [
'border-radius'
],
defaultValue: '0',
vendorPrefixes: [
'-moz-',
'-o-'
]
},
'border-top-right-radius': {
canOverride: canOverride.generic.unit,
componentOf: [
'border-radius'
],
defaultValue: '0',
vendorPrefixes: [
'-moz-',
'-o-'
]
},
'border-top-style': {
canOverride: canOverride.property.borderStyle,
componentOf: [
'border-style',
'border-top'
],
defaultValue: 'none'
},
'border-top-width': {
canOverride: canOverride.generic.unit,
componentOf: [
'border-top',
'border-width'
],
defaultValue: 'medium',
oppositeTo: 'border-bottom-width',
shortestValue: '0'
},
'border-width': {
breakUp: breakUp.fourValues,
canOverride: canOverride.generic.components([
canOverride.generic.unit,
canOverride.generic.unit,
canOverride.generic.unit,
canOverride.generic.unit
]),
componentOf: [
'border'
],
components: [
'border-top-width',
'border-right-width',
'border-bottom-width',
'border-left-width'
],
defaultValue: 'medium',
restore: restore.fourValues,
shortestValue: '0',
shorthand: true
},
'clear': {
canOverride: canOverride.property.clear,
defaultValue: 'none'
},
'color': {
canOverride: canOverride.generic.color,
defaultValue: 'transparent',
shortestValue: 'red'
},
'cursor': {
canOverride: canOverride.property.cursor,
defaultValue: 'auto'
},
'display': {
canOverride: canOverride.property.display,
},
'float': {
canOverride: canOverride.property.float,
defaultValue: 'none'
},
'font': {
breakUp: breakUp.font,
canOverride: canOverride.generic.components([
canOverride.property.fontStyle,
canOverride.property.fontVariant,
canOverride.property.fontWeight,
canOverride.property.fontStretch,
canOverride.generic.unit,
canOverride.generic.unit,
canOverride.property.fontFamily
]),
components: [
'font-style',
'font-variant',
'font-weight',
'font-stretch',
'font-size',
'line-height',
'font-family'
],
restore: restore.font,
shorthand: true
},
'font-family': {
canOverride: canOverride.property.fontFamily,
defaultValue: 'user|agent|specific'
},
'font-size': {
canOverride: canOverride.generic.unit,
defaultValue: 'medium',
shortestValue: '0'
},
'font-stretch': {
canOverride: canOverride.property.fontStretch,
defaultValue: 'normal'
},
'font-style': {
canOverride: canOverride.property.fontStyle,
defaultValue: 'normal'
},
'font-variant': {
canOverride: canOverride.property.fontVariant,
defaultValue: 'normal'
},
'font-weight': {
canOverride: canOverride.property.fontWeight,
defaultValue: 'normal',
shortestValue: '400'
},
'height': {
canOverride: canOverride.generic.unit,
defaultValue: 'auto',
shortestValue: '0'
},
'left': {
canOverride: canOverride.property.left,
defaultValue: 'auto'
},
'line-height': {
canOverride: canOverride.generic.unitOrNumber,
defaultValue: 'normal',
shortestValue: '0'
},
'list-style': {
canOverride: canOverride.generic.components([
canOverride.property.listStyleType,
canOverride.property.listStylePosition,
canOverride.property.listStyleImage
]),
components: [
'list-style-type',
'list-style-position',
'list-style-image'
],
breakUp: breakUp.listStyle,
restore: restore.withoutDefaults,
defaultValue: 'outside', // can't use 'disc' because that'd override default 'decimal' for
shortestValue: 'none',
shorthand: true
},
'list-style-image' : {
canOverride: canOverride.generic.image,
componentOf: [
'list-style'
],
defaultValue: 'none'
},
'list-style-position' : {
canOverride: canOverride.property.listStylePosition,
componentOf: [
'list-style'
],
defaultValue: 'outside',
shortestValue: 'inside'
},
'list-style-type' : {
canOverride: canOverride.property.listStyleType,
componentOf: [
'list-style'
],
// NOTE: we can't tell the real default value here, it's 'disc' for and 'decimal' for
// this is a hack, but it doesn't matter because this value will be either overridden or
// it will disappear at the final step anyway
defaultValue: 'decimal|disc',
shortestValue: 'none'
},
'margin': {
breakUp: breakUp.fourValues,
canOverride: canOverride.generic.components([
canOverride.generic.unit,
canOverride.generic.unit,
canOverride.generic.unit,
canOverride.generic.unit
]),
components: [
'margin-top',
'margin-right',
'margin-bottom',
'margin-left'
],
defaultValue: '0',
restore: restore.fourValues,
shorthand: true
},
'margin-bottom': {
canOverride: canOverride.generic.unit,
componentOf: [
'margin'
],
defaultValue: '0',
oppositeTo: 'margin-top'
},
'margin-left': {
canOverride: canOverride.generic.unit,
componentOf: [
'margin'
],
defaultValue: '0',
oppositeTo: 'margin-right'
},
'margin-right': {
canOverride: canOverride.generic.unit,
componentOf: [
'margin'
],
defaultValue: '0',
oppositeTo: 'margin-left'
},
'margin-top': {
canOverride: canOverride.generic.unit,
componentOf: [
'margin'
],
defaultValue: '0',
oppositeTo: 'margin-bottom'
},
'outline': {
canOverride: canOverride.generic.components([
canOverride.generic.color,
canOverride.property.outlineStyle,
canOverride.generic.unit
]),
components: [
'outline-color',
'outline-style',
'outline-width'
],
breakUp: breakUp.outline,
restore: restore.withoutDefaults,
defaultValue: '0',
shorthand: true
},
'outline-color': {
canOverride: canOverride.generic.color,
componentOf: [
'outline'
],
defaultValue: 'invert',
shortestValue: 'red'
},
'outline-style': {
canOverride: canOverride.property.outlineStyle,
componentOf: [
'outline'
],
defaultValue: 'none'
},
'outline-width': {
canOverride: canOverride.generic.unit,
componentOf: [
'outline'
],
defaultValue: 'medium',
shortestValue: '0'
},
'overflow': {
canOverride: canOverride.property.overflow,
defaultValue: 'visible'
},
'overflow-x': {
canOverride: canOverride.property.overflow,
defaultValue: 'visible'
},
'overflow-y': {
canOverride: canOverride.property.overflow,
defaultValue: 'visible'
},
'padding': {
breakUp: breakUp.fourValues,
canOverride: canOverride.generic.components([
canOverride.generic.unit,
canOverride.generic.unit,
canOverride.generic.unit,
canOverride.generic.unit
]),
components: [
'padding-top',
'padding-right',
'padding-bottom',
'padding-left'
],
defaultValue: '0',
restore: restore.fourValues,
shorthand: true
},
'padding-bottom': {
canOverride: canOverride.generic.unit,
componentOf: [
'padding'
],
defaultValue: '0',
oppositeTo: 'padding-top'
},
'padding-left': {
canOverride: canOverride.generic.unit,
componentOf: [
'padding'
],
defaultValue: '0',
oppositeTo: 'padding-right'
},
'padding-right': {
canOverride: canOverride.generic.unit,
componentOf: [
'padding'
],
defaultValue: '0',
oppositeTo: 'padding-left'
},
'padding-top': {
canOverride: canOverride.generic.unit,
componentOf: [
'padding'
],
defaultValue: '0',
oppositeTo: 'padding-bottom'
},
'position': {
canOverride: canOverride.property.position,
defaultValue: 'static'
},
'right': {
canOverride: canOverride.property.right,
defaultValue: 'auto'
},
'text-align': {
canOverride: canOverride.property.textAlign,
// NOTE: we can't tell the real default value here, as it depends on default text direction
// this is a hack, but it doesn't matter because this value will be either overridden or
// it will disappear anyway
defaultValue: 'left|right'
},
'text-decoration': {
canOverride: canOverride.property.textDecoration,
defaultValue: 'none'
},
'text-overflow': {
canOverride: canOverride.property.textOverflow,
defaultValue: 'none'
},
'text-shadow': {
canOverride: canOverride.property.textShadow,
defaultValue: 'none'
},
'top': {
canOverride: canOverride.property.top,
defaultValue: 'auto'
},
'transform': {
canOverride: canOverride.property.transform,
vendorPrefixes: [
'-moz-',
'-ms-',
'-webkit-'
]
},
'transition': {
breakUp: breakUp.multiplex(breakUp.transition),
canOverride: canOverride.generic.components([
canOverride.property.transitionProperty,
canOverride.generic.time,
canOverride.generic.timingFunction,
canOverride.generic.time
]),
components: [
'transition-property',
'transition-duration',
'transition-timing-function',
'transition-delay'
],
defaultValue: 'none',
restore: restore.multiplex(restore.withoutDefaults),
shorthand: true,
vendorPrefixes: [
'-moz-',
'-o-',
'-webkit-'
]
},
'transition-delay': {
canOverride: canOverride.generic.time,
componentOf: [
'transition'
],
defaultValue: '0s',
intoMultiplexMode: 'real',
vendorPrefixes: [
'-moz-',
'-o-',
'-webkit-'
]
},
'transition-duration': {
canOverride: canOverride.generic.time,
componentOf: [
'transition'
],
defaultValue: '0s',
intoMultiplexMode: 'real',
vendorPrefixes: [
'-moz-',
'-o-',
'-webkit-'
]
},
'transition-property': {
canOverride: canOverride.generic.propertyName,
componentOf: [
'transition'
],
defaultValue: 'all',
intoMultiplexMode: 'placeholder',
placeholderValue: '_', // it's a short value that won't match any property and still be a valid `transition-property`
vendorPrefixes: [
'-moz-',
'-o-',
'-webkit-'
]
},
'transition-timing-function': {
canOverride: canOverride.generic.timingFunction,
componentOf: [
'transition'
],
defaultValue: 'ease',
intoMultiplexMode: 'real',
vendorPrefixes: [
'-moz-',
'-o-',
'-webkit-'
]
},
'vertical-align': {
canOverride: canOverride.property.verticalAlign,
defaultValue: 'baseline'
},
'visibility': {
canOverride: canOverride.property.visibility,
defaultValue: 'visible'
},
'white-space': {
canOverride: canOverride.property.whiteSpace,
defaultValue: 'normal'
},
'width': {
canOverride: canOverride.generic.unit,
defaultValue: 'auto',
shortestValue: '0'
},
'z-index': {
canOverride: canOverride.property.zIndex,
defaultValue: 'auto'
}
};
function cloneDescriptor(propertyName, prefix) {
var clonedDescriptor = override(compactable[propertyName], {});
if ('componentOf' in clonedDescriptor) {
clonedDescriptor.componentOf = clonedDescriptor.componentOf.map(function (shorthandName) {
return prefix + shorthandName;
});
}
if ('components' in clonedDescriptor) {
clonedDescriptor.components = clonedDescriptor.components.map(function (longhandName) {
return prefix + longhandName;
});
}
if ('keepUnlessDefault' in clonedDescriptor) {
clonedDescriptor.keepUnlessDefault = prefix + clonedDescriptor.keepUnlessDefault;
}
return clonedDescriptor;
}
// generate vendor-prefixed properties
var vendorPrefixedCompactable = {};
for (var propertyName in compactable) {
var descriptor = compactable[propertyName];
if (!('vendorPrefixes' in descriptor)) {
continue;
}
for (var i = 0; i < descriptor.vendorPrefixes.length; i++) {
var prefix = descriptor.vendorPrefixes[i];
var clonedDescriptor = cloneDescriptor(propertyName, prefix);
delete clonedDescriptor.vendorPrefixes;
vendorPrefixedCompactable[prefix + propertyName] = clonedDescriptor;
}
delete descriptor.vendorPrefixes;
}
module.exports = override(compactable, vendorPrefixedCompactable);
node_modules/clean-css/lib/optimizer/level-2/remove-unused-at-rules.js 0000666 00000015177 15042511722 0022033 0 ustar 00 var populateComponents = require('./properties/populate-components');
var wrapForOptimizing = require('../wrap-for-optimizing').single;
var restoreFromOptimizing = require('../restore-from-optimizing');
var Token = require('../../tokenizer/token');
var animationNameRegex = /^(\-moz\-|\-o\-|\-webkit\-)?animation-name$/;
var animationRegex = /^(\-moz\-|\-o\-|\-webkit\-)?animation$/;
var keyframeRegex = /^@(\-moz\-|\-o\-|\-webkit\-)?keyframes /;
var importantRegex = /\s{0,31}!important$/;
var optionalMatchingQuotesRegex = /^(['"]?)(.*)\1$/;
function normalize(value) {
return value
.replace(optionalMatchingQuotesRegex, '$2')
.replace(importantRegex, '');
}
function removeUnusedAtRules(tokens, context) {
removeUnusedAtRule(tokens, matchCounterStyle, markCounterStylesAsUsed, context);
removeUnusedAtRule(tokens, matchFontFace, markFontFacesAsUsed, context);
removeUnusedAtRule(tokens, matchKeyframe, markKeyframesAsUsed, context);
removeUnusedAtRule(tokens, matchNamespace, markNamespacesAsUsed, context);
}
function removeUnusedAtRule(tokens, matchCallback, markCallback, context) {
var atRules = {};
var atRule;
var atRuleTokens;
var atRuleToken;
var zeroAt;
var i, l;
for (i = 0, l = tokens.length; i < l; i++) {
matchCallback(tokens[i], atRules);
}
if (Object.keys(atRules).length === 0) {
return;
}
markUsedAtRules(tokens, markCallback, atRules, context);
for (atRule in atRules) {
atRuleTokens = atRules[atRule];
for (i = 0, l = atRuleTokens.length; i < l; i++) {
atRuleToken = atRuleTokens[i];
zeroAt = atRuleToken[0] == Token.AT_RULE ? 1 : 2;
atRuleToken[zeroAt] = [];
}
}
}
function markUsedAtRules(tokens, markCallback, atRules, context) {
var boundMarkCallback = markCallback(atRules);
var i, l;
for (i = 0, l = tokens.length; i < l; i++) {
switch (tokens[i][0]) {
case Token.RULE:
boundMarkCallback(tokens[i], context);
break;
case Token.NESTED_BLOCK:
markUsedAtRules(tokens[i][2], markCallback, atRules, context);
}
}
}
function matchCounterStyle(token, atRules) {
var match;
if (token[0] == Token.AT_RULE_BLOCK && token[1][0][1].indexOf('@counter-style') === 0) {
match = token[1][0][1].split(' ')[1];
atRules[match] = atRules[match] || [];
atRules[match].push(token);
}
}
function markCounterStylesAsUsed(atRules) {
return function (token, context) {
var property;
var wrappedProperty;
var i, l;
for (i = 0, l = token[2].length; i < l; i++) {
property = token[2][i];
if (property[1][1] == 'list-style') {
wrappedProperty = wrapForOptimizing(property);
populateComponents([wrappedProperty], context.validator, context.warnings);
if (wrappedProperty.components[0].value[0][1] in atRules) {
delete atRules[property[2][1]];
}
restoreFromOptimizing([wrappedProperty]);
}
if (property[1][1] == 'list-style-type' && property[2][1] in atRules) {
delete atRules[property[2][1]];
}
}
};
}
function matchFontFace(token, atRules) {
var property;
var match;
var i, l;
if (token[0] == Token.AT_RULE_BLOCK && token[1][0][1] == '@font-face') {
for (i = 0, l = token[2].length; i < l; i++) {
property = token[2][i];
if (property[1][1] == 'font-family') {
match = normalize(property[2][1].toLowerCase());
atRules[match] = atRules[match] || [];
atRules[match].push(token);
break;
}
}
}
}
function markFontFacesAsUsed(atRules) {
return function (token, context) {
var property;
var wrappedProperty;
var component;
var normalizedMatch;
var i, l;
var j, m;
for (i = 0, l = token[2].length; i < l; i++) {
property = token[2][i];
if (property[1][1] == 'font') {
wrappedProperty = wrapForOptimizing(property);
populateComponents([wrappedProperty], context.validator, context.warnings);
component = wrappedProperty.components[6];
for (j = 0, m = component.value.length; j < m; j++) {
normalizedMatch = normalize(component.value[j][1].toLowerCase());
if (normalizedMatch in atRules) {
delete atRules[normalizedMatch];
}
}
restoreFromOptimizing([wrappedProperty]);
}
if (property[1][1] == 'font-family') {
for (j = 2, m = property.length; j < m; j++) {
normalizedMatch = normalize(property[j][1].toLowerCase());
if (normalizedMatch in atRules) {
delete atRules[normalizedMatch];
}
}
}
}
};
}
function matchKeyframe(token, atRules) {
var match;
if (token[0] == Token.NESTED_BLOCK && keyframeRegex.test(token[1][0][1])) {
match = token[1][0][1].split(' ')[1];
atRules[match] = atRules[match] || [];
atRules[match].push(token);
}
}
function markKeyframesAsUsed(atRules) {
return function (token, context) {
var property;
var wrappedProperty;
var component;
var i, l;
var j, m;
for (i = 0, l = token[2].length; i < l; i++) {
property = token[2][i];
if (animationRegex.test(property[1][1])) {
wrappedProperty = wrapForOptimizing(property);
populateComponents([wrappedProperty], context.validator, context.warnings);
component = wrappedProperty.components[7];
for (j = 0, m = component.value.length; j < m; j++) {
if (component.value[j][1] in atRules) {
delete atRules[component.value[j][1]];
}
}
restoreFromOptimizing([wrappedProperty]);
}
if (animationNameRegex.test(property[1][1])) {
for (j = 2, m = property.length; j < m; j++) {
if (property[j][1] in atRules) {
delete atRules[property[j][1]];
}
}
}
}
};
}
function matchNamespace(token, atRules) {
var match;
if (token[0] == Token.AT_RULE && token[1].indexOf('@namespace') === 0) {
match = token[1].split(' ')[1];
atRules[match] = atRules[match] || [];
atRules[match].push(token);
}
}
function markNamespacesAsUsed(atRules) {
var namespaceRegex = new RegExp(Object.keys(atRules).join('\\\||') + '\\\|', 'g');
return function (token) {
var match;
var scope;
var normalizedMatch;
var i, l;
var j, m;
for (i = 0, l = token[1].length; i < l; i++) {
scope = token[1][i];
match = scope[1].match(namespaceRegex);
for (j = 0, m = match.length; j < m; j++) {
normalizedMatch = match[j].substring(0, match[j].length - 1);
if (normalizedMatch in atRules) {
delete atRules[normalizedMatch];
}
}
}
};
}
module.exports = removeUnusedAtRules;
node_modules/clean-css/lib/optimizer/level-2/clone.js 0000666 00000001404 15042511722 0016567 0 ustar 00 var wrapSingle = require('../wrap-for-optimizing').single;
var Token = require('../../tokenizer/token');
function deep(property) {
var cloned = shallow(property);
for (var i = property.components.length - 1; i >= 0; i--) {
var component = shallow(property.components[i]);
component.value = property.components[i].value.slice(0);
cloned.components.unshift(component);
}
cloned.dirty = true;
cloned.value = property.value.slice(0);
return cloned;
}
function shallow(property) {
var cloned = wrapSingle([
Token.PROPERTY,
[Token.PROPERTY_NAME, property.name]
]);
cloned.important = property.important;
cloned.hack = property.hack;
cloned.unused = false;
return cloned;
}
module.exports = {
deep: deep,
shallow: shallow
};
node_modules/clean-css/lib/optimizer/level-2/specificities-overlap.js 0000666 00000001446 15042511722 0021766 0 ustar 00 var specificity = require('./specificity');
function specificitiesOverlap(selector1, selector2, cache) {
var specificity1;
var specificity2;
var i, l;
var j, m;
for (i = 0, l = selector1.length; i < l; i++) {
specificity1 = findSpecificity(selector1[i][1], cache);
for (j = 0, m = selector2.length; j < m; j++) {
specificity2 = findSpecificity(selector2[j][1], cache);
if (specificity1[0] === specificity2[0] && specificity1[1] === specificity2[1] && specificity1[2] === specificity2[2]) {
return true;
}
}
}
return false;
}
function findSpecificity(selector, cache) {
var value;
if (!(selector in cache)) {
cache[selector] = value = specificity(selector);
}
return value || cache[selector];
}
module.exports = specificitiesOverlap;
node_modules/clean-css/lib/optimizer/level-2/invalid-property-error.js 0000666 00000000474 15042511722 0022134 0 ustar 00 function InvalidPropertyError(message) {
this.name = 'InvalidPropertyError';
this.message = message;
this.stack = (new Error()).stack;
}
InvalidPropertyError.prototype = Object.create(Error.prototype);
InvalidPropertyError.prototype.constructor = InvalidPropertyError;
module.exports = InvalidPropertyError;
node_modules/clean-css/lib/optimizer/level-2/is-mergeable.js 0000666 00000015432 15042511722 0020031 0 ustar 00 var Marker = require('../../tokenizer/marker');
var split = require('../../utils/split');
var DEEP_SELECTOR_PATTERN = /\/deep\//;
var DOUBLE_COLON_PATTERN = /^::/;
var NOT_PSEUDO = ':not';
var PSEUDO_CLASSES_WITH_ARGUMENTS = [
':dir',
':lang',
':not',
':nth-child',
':nth-last-child',
':nth-last-of-type',
':nth-of-type'
];
var RELATION_PATTERN = /[>\+~]/;
var UNMIXABLE_PSEUDO_CLASSES = [
':after',
':before',
':first-letter',
':first-line',
':lang'
];
var UNMIXABLE_PSEUDO_ELEMENTS = [
'::after',
'::before',
'::first-letter',
'::first-line'
];
var Level = {
DOUBLE_QUOTE: 'double-quote',
SINGLE_QUOTE: 'single-quote',
ROOT: 'root'
};
function isMergeable(selector, mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) {
var singleSelectors = split(selector, Marker.COMMA);
var singleSelector;
var i, l;
for (i = 0, l = singleSelectors.length; i < l; i++) {
singleSelector = singleSelectors[i];
if (singleSelector.length === 0 ||
isDeepSelector(singleSelector) ||
(singleSelector.indexOf(Marker.COLON) > -1 && !areMergeable(singleSelector, extractPseudoFrom(singleSelector), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging))) {
return false;
}
}
return true;
}
function isDeepSelector(selector) {
return DEEP_SELECTOR_PATTERN.test(selector);
}
function extractPseudoFrom(selector) {
var list = [];
var character;
var buffer = [];
var level = Level.ROOT;
var roundBracketLevel = 0;
var isQuoted;
var isEscaped;
var isPseudo = false;
var isRelation;
var wasColon = false;
var index;
var len;
for (index = 0, len = selector.length; index < len; index++) {
character = selector[index];
isRelation = !isEscaped && RELATION_PATTERN.test(character);
isQuoted = level == Level.DOUBLE_QUOTE || level == Level.SINGLE_QUOTE;
if (isEscaped) {
buffer.push(character);
} else if (character == Marker.DOUBLE_QUOTE && level == Level.ROOT) {
buffer.push(character);
level = Level.DOUBLE_QUOTE;
} else if (character == Marker.DOUBLE_QUOTE && level == Level.DOUBLE_QUOTE) {
buffer.push(character);
level = Level.ROOT;
} else if (character == Marker.SINGLE_QUOTE && level == Level.ROOT) {
buffer.push(character);
level = Level.SINGLE_QUOTE;
} else if (character == Marker.SINGLE_QUOTE && level == Level.SINGLE_QUOTE) {
buffer.push(character);
level = Level.ROOT;
} else if (isQuoted) {
buffer.push(character);
} else if (character == Marker.OPEN_ROUND_BRACKET) {
buffer.push(character);
roundBracketLevel++;
} else if (character == Marker.CLOSE_ROUND_BRACKET && roundBracketLevel == 1 && isPseudo) {
buffer.push(character);
list.push(buffer.join(''));
roundBracketLevel--;
buffer = [];
isPseudo = false;
} else if (character == Marker.CLOSE_ROUND_BRACKET) {
buffer.push(character);
roundBracketLevel--;
} else if (character == Marker.COLON && roundBracketLevel === 0 && isPseudo && !wasColon) {
list.push(buffer.join(''));
buffer = [];
buffer.push(character);
} else if (character == Marker.COLON && roundBracketLevel === 0 && !wasColon) {
buffer = [];
buffer.push(character);
isPseudo = true;
} else if (character == Marker.SPACE && roundBracketLevel === 0 && isPseudo) {
list.push(buffer.join(''));
buffer = [];
isPseudo = false;
} else if (isRelation && roundBracketLevel === 0 && isPseudo) {
list.push(buffer.join(''));
buffer = [];
isPseudo = false;
} else {
buffer.push(character);
}
isEscaped = character == Marker.BACK_SLASH;
wasColon = character == Marker.COLON;
}
if (buffer.length > 0 && isPseudo) {
list.push(buffer.join(''));
}
return list;
}
function areMergeable(selector, matches, mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) {
return areAllowed(matches, mergeablePseudoClasses, mergeablePseudoElements) &&
needArguments(matches) &&
(matches.length < 2 || !someIncorrectlyChained(selector, matches)) &&
(matches.length < 2 || multiplePseudoMerging && allMixable(matches));
}
function areAllowed(matches, mergeablePseudoClasses, mergeablePseudoElements) {
var match;
var name;
var i, l;
for (i = 0, l = matches.length; i < l; i++) {
match = matches[i];
name = match.indexOf(Marker.OPEN_ROUND_BRACKET) > -1 ?
match.substring(0, match.indexOf(Marker.OPEN_ROUND_BRACKET)) :
match;
if (mergeablePseudoClasses.indexOf(name) === -1 && mergeablePseudoElements.indexOf(name) === -1) {
return false;
}
}
return true;
}
function needArguments(matches) {
var match;
var name;
var bracketOpensAt;
var hasArguments;
var i, l;
for (i = 0, l = matches.length; i < l; i++) {
match = matches[i];
bracketOpensAt = match.indexOf(Marker.OPEN_ROUND_BRACKET);
hasArguments = bracketOpensAt > -1;
name = hasArguments ?
match.substring(0, bracketOpensAt) :
match;
if (hasArguments && PSEUDO_CLASSES_WITH_ARGUMENTS.indexOf(name) == -1) {
return false;
}
if (!hasArguments && PSEUDO_CLASSES_WITH_ARGUMENTS.indexOf(name) > -1) {
return false;
}
}
return true;
}
function someIncorrectlyChained(selector, matches) {
var positionInSelector = 0;
var match;
var matchAt;
var nextMatch;
var nextMatchAt;
var name;
var nextName;
var areChained;
var i, l;
for (i = 0, l = matches.length; i < l; i++) {
match = matches[i];
nextMatch = matches[i + 1];
if (!nextMatch) {
break;
}
matchAt = selector.indexOf(match, positionInSelector);
nextMatchAt = selector.indexOf(match, matchAt + 1);
positionInSelector = nextMatchAt;
areChained = matchAt + match.length == nextMatchAt;
if (areChained) {
name = match.indexOf(Marker.OPEN_ROUND_BRACKET) > -1 ?
match.substring(0, match.indexOf(Marker.OPEN_ROUND_BRACKET)) :
match;
nextName = nextMatch.indexOf(Marker.OPEN_ROUND_BRACKET) > -1 ?
nextMatch.substring(0, nextMatch.indexOf(Marker.OPEN_ROUND_BRACKET)) :
nextMatch;
if (name != NOT_PSEUDO || nextName != NOT_PSEUDO) {
return true;
}
}
}
return false;
}
function allMixable(matches) {
var unmixableMatches = 0;
var match;
var i, l;
for (i = 0, l = matches.length; i < l; i++) {
match = matches[i];
if (isPseudoElement(match)) {
unmixableMatches += UNMIXABLE_PSEUDO_ELEMENTS.indexOf(match) > -1 ? 1 : 0;
} else {
unmixableMatches += UNMIXABLE_PSEUDO_CLASSES.indexOf(match) > -1 ? 1 : 0;
}
if (unmixableMatches > 1) {
return false;
}
}
return true;
}
function isPseudoElement(pseudo) {
return DOUBLE_COLON_PATTERN.test(pseudo);
}
module.exports = isMergeable;
node_modules/clean-css/lib/optimizer/level-2/restore-with-components.js 0000666 00000000477 15042511722 0022317 0 ustar 00 var compactable = require('./compactable');
function restoreWithComponents(property) {
var descriptor = compactable[property.name];
if (descriptor && descriptor.shorthand) {
return descriptor.restore(property, compactable);
} else {
return property.value;
}
}
module.exports = restoreWithComponents;
node_modules/clean-css/lib/optimizer/level-2/remove-duplicate-media-queries.js 0000666 00000001225 15042511722 0023465 0 ustar 00 var Token = require('../../tokenizer/token');
var serializeAll = require('../../writer/one-time').all;
var serializeRules = require('../../writer/one-time').rules;
function removeDuplicateMediaQueries(tokens) {
var candidates = {};
var candidate;
var token;
var key;
var i, l;
for (i = 0, l = tokens.length; i < l; i++) {
token = tokens[i];
if (token[0] != Token.NESTED_BLOCK) {
continue;
}
key = serializeRules(token[1]) + '%' + serializeAll(token[2]);
candidate = candidates[key];
if (candidate) {
candidate[2] = [];
}
candidates[key] = token;
}
}
module.exports = removeDuplicateMediaQueries;
node_modules/clean-css/lib/optimizer/level-2/specificity.js 0000666 00000004662 15042511722 0020013 0 ustar 00 var Marker = require('../../tokenizer/marker');
var Selector = {
ADJACENT_SIBLING: '+',
DESCENDANT: '>',
DOT: '.',
HASH: '#',
NON_ADJACENT_SIBLING: '~',
PSEUDO: ':'
};
var LETTER_PATTERN = /[a-zA-Z]/;
var NOT_PREFIX = ':not(';
var SEPARATOR_PATTERN = /[\s,\(>~\+]/;
function specificity(selector) {
var result = [0, 0, 0];
var character;
var isEscaped;
var isSingleQuoted;
var isDoubleQuoted;
var roundBracketLevel = 0;
var couldIntroduceNewTypeSelector;
var withinNotPseudoClass = false;
var wasPseudoClass = false;
var i, l;
for (i = 0, l = selector.length; i < l; i++) {
character = selector[i];
if (isEscaped) {
// noop
} else if (character == Marker.SINGLE_QUOTE && !isDoubleQuoted && !isSingleQuoted) {
isSingleQuoted = true;
} else if (character == Marker.SINGLE_QUOTE && !isDoubleQuoted && isSingleQuoted) {
isSingleQuoted = false;
} else if (character == Marker.DOUBLE_QUOTE && !isDoubleQuoted && !isSingleQuoted) {
isDoubleQuoted = true;
} else if (character == Marker.DOUBLE_QUOTE && isDoubleQuoted && !isSingleQuoted) {
isDoubleQuoted = false;
} else if (isSingleQuoted || isDoubleQuoted) {
continue;
} else if (roundBracketLevel > 0 && !withinNotPseudoClass) {
// noop
} else if (character == Marker.OPEN_ROUND_BRACKET) {
roundBracketLevel++;
} else if (character == Marker.CLOSE_ROUND_BRACKET && roundBracketLevel == 1) {
roundBracketLevel--;
withinNotPseudoClass = false;
} else if (character == Marker.CLOSE_ROUND_BRACKET) {
roundBracketLevel--;
} else if (character == Selector.HASH) {
result[0]++;
} else if (character == Selector.DOT || character == Marker.OPEN_SQUARE_BRACKET) {
result[1]++;
} else if (character == Selector.PSEUDO && !wasPseudoClass && !isNotPseudoClass(selector, i)) {
result[1]++;
withinNotPseudoClass = false;
} else if (character == Selector.PSEUDO) {
withinNotPseudoClass = true;
} else if ((i === 0 || couldIntroduceNewTypeSelector) && LETTER_PATTERN.test(character)) {
result[2]++;
}
isEscaped = character == Marker.BACK_SLASH;
wasPseudoClass = character == Selector.PSEUDO;
couldIntroduceNewTypeSelector = !isEscaped && SEPARATOR_PATTERN.test(character);
}
return result;
}
function isNotPseudoClass(selector, index) {
return selector.indexOf(NOT_PREFIX, index) === index;
}
module.exports = specificity;
node_modules/clean-css/lib/optimizer/level-2/rules-overlap.js 0000666 00000001124 15042511722 0020266 0 ustar 00 var MODIFIER_PATTERN = /\-\-.+$/;
function rulesOverlap(rule1, rule2, bemMode) {
var scope1;
var scope2;
var i, l;
var j, m;
for (i = 0, l = rule1.length; i < l; i++) {
scope1 = rule1[i][1];
for (j = 0, m = rule2.length; j < m; j++) {
scope2 = rule2[j][1];
if (scope1 == scope2) {
return true;
}
if (bemMode && withoutModifiers(scope1) == withoutModifiers(scope2)) {
return true;
}
}
}
return false;
}
function withoutModifiers(scope) {
return scope.replace(MODIFIER_PATTERN, '');
}
module.exports = rulesOverlap;
node_modules/clean-css/lib/optimizer/level-2/remove-duplicate-font-at-rules.js 0000666 00000001153 15042511722 0023433 0 ustar 00 var Token = require('../../tokenizer/token');
var serializeAll = require('../../writer/one-time').all;
var FONT_FACE_SCOPE = '@font-face';
function removeDuplicateFontAtRules(tokens) {
var fontAtRules = [];
var token;
var key;
var i, l;
for (i = 0, l = tokens.length; i < l; i++) {
token = tokens[i];
if (token[0] != Token.AT_RULE_BLOCK && token[1][0][1] != FONT_FACE_SCOPE) {
continue;
}
key = serializeAll([token]);
if (fontAtRules.indexOf(key) > -1) {
token[2] = [];
} else {
fontAtRules.push(key);
}
}
}
module.exports = removeDuplicateFontAtRules;
node_modules/clean-css/lib/optimizer/level-2/merge-non-adjacent-by-body.js 0000666 00000005554 15042511722 0022502 0 ustar 00 var isMergeable = require('./is-mergeable');
var sortSelectors = require('../level-1/sort-selectors');
var tidyRules = require('../level-1/tidy-rules');
var OptimizationLevel = require('../../options/optimization-level').OptimizationLevel;
var serializeBody = require('../../writer/one-time').body;
var serializeRules = require('../../writer/one-time').rules;
var Token = require('../../tokenizer/token');
function unsafeSelector(value) {
return /\.|\*| :/.test(value);
}
function isBemElement(token) {
var asString = serializeRules(token[1]);
return asString.indexOf('__') > -1 || asString.indexOf('--') > -1;
}
function withoutModifier(selector) {
return selector.replace(/--[^ ,>\+~:]+/g, '');
}
function removeAnyUnsafeElements(left, candidates) {
var leftSelector = withoutModifier(serializeRules(left[1]));
for (var body in candidates) {
var right = candidates[body];
var rightSelector = withoutModifier(serializeRules(right[1]));
if (rightSelector.indexOf(leftSelector) > -1 || leftSelector.indexOf(rightSelector) > -1)
delete candidates[body];
}
}
function mergeNonAdjacentByBody(tokens, context) {
var options = context.options;
var mergeSemantically = options.level[OptimizationLevel.Two].mergeSemantically;
var adjacentSpace = options.compatibility.selectors.adjacentSpace;
var selectorsSortingMethod = options.level[OptimizationLevel.One].selectorsSortingMethod;
var mergeablePseudoClasses = options.compatibility.selectors.mergeablePseudoClasses;
var mergeablePseudoElements = options.compatibility.selectors.mergeablePseudoElements;
var multiplePseudoMerging = options.compatibility.selectors.multiplePseudoMerging;
var candidates = {};
for (var i = tokens.length - 1; i >= 0; i--) {
var token = tokens[i];
if (token[0] != Token.RULE)
continue;
if (token[2].length > 0 && (!mergeSemantically && unsafeSelector(serializeRules(token[1]))))
candidates = {};
if (token[2].length > 0 && mergeSemantically && isBemElement(token))
removeAnyUnsafeElements(token, candidates);
var candidateBody = serializeBody(token[2]);
var oldToken = candidates[candidateBody];
if (oldToken &&
isMergeable(serializeRules(token[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) &&
isMergeable(serializeRules(oldToken[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging)) {
if (token[2].length > 0) {
token[1] = tidyRules(oldToken[1].concat(token[1]), false, adjacentSpace, false, context.warnings);
token[1] = token[1].length > 1 ? sortSelectors(token[1], selectorsSortingMethod) : token[1];
} else {
token[1] = oldToken[1].concat(token[1]);
}
oldToken[2] = [];
candidates[candidateBody] = null;
}
candidates[serializeBody(token[2])] = token;
}
}
module.exports = mergeNonAdjacentByBody;
node_modules/clean-css/lib/optimizer/level-2/break-up.js 0000666 00000052230 15042511722 0017200 0 ustar 00 var InvalidPropertyError = require('./invalid-property-error');
var wrapSingle = require('../wrap-for-optimizing').single;
var Token = require('../../tokenizer/token');
var Marker = require('../../tokenizer/marker');
var formatPosition = require('../../utils/format-position');
function _anyIsInherit(values) {
var i, l;
for (i = 0, l = values.length; i < l; i++) {
if (values[i][1] == 'inherit') {
return true;
}
}
return false;
}
function _colorFilter(validator) {
return function (value) {
return value[1] == 'invert' || validator.isColor(value[1]) || validator.isPrefixed(value[1]);
};
}
function _styleFilter(validator) {
return function (value) {
return value[1] != 'inherit' && validator.isStyleKeyword(value[1]) && !validator.isColorFunction(value[1]);
};
}
function _wrapDefault(name, property, compactable) {
var descriptor = compactable[name];
if (descriptor.doubleValues && descriptor.defaultValue.length == 2) {
return wrapSingle([
Token.PROPERTY,
[Token.PROPERTY_NAME, name],
[Token.PROPERTY_VALUE, descriptor.defaultValue[0]],
[Token.PROPERTY_VALUE, descriptor.defaultValue[1]]
]);
} else if (descriptor.doubleValues && descriptor.defaultValue.length == 1) {
return wrapSingle([
Token.PROPERTY,
[Token.PROPERTY_NAME, name],
[Token.PROPERTY_VALUE, descriptor.defaultValue[0]]
]);
} else {
return wrapSingle([
Token.PROPERTY,
[Token.PROPERTY_NAME, name],
[Token.PROPERTY_VALUE, descriptor.defaultValue]
]);
}
}
function _widthFilter(validator) {
return function (value) {
return value[1] != 'inherit' &&
(validator.isWidth(value[1]) || validator.isUnit(value[1]) && !validator.isDynamicUnit(value[1])) &&
!validator.isStyleKeyword(value[1]) &&
!validator.isColorFunction(value[1]);
};
}
function animation(property, compactable, validator) {
var duration = _wrapDefault(property.name + '-duration', property, compactable);
var timing = _wrapDefault(property.name + '-timing-function', property, compactable);
var delay = _wrapDefault(property.name + '-delay', property, compactable);
var iteration = _wrapDefault(property.name + '-iteration-count', property, compactable);
var direction = _wrapDefault(property.name + '-direction', property, compactable);
var fill = _wrapDefault(property.name + '-fill-mode', property, compactable);
var play = _wrapDefault(property.name + '-play-state', property, compactable);
var name = _wrapDefault(property.name + '-name', property, compactable);
var components = [duration, timing, delay, iteration, direction, fill, play, name];
var values = property.value;
var value;
var durationSet = false;
var timingSet = false;
var delaySet = false;
var iterationSet = false;
var directionSet = false;
var fillSet = false;
var playSet = false;
var nameSet = false;
var i;
var l;
if (property.value.length == 1 && property.value[0][1] == 'inherit') {
duration.value = timing.value = delay.value = iteration.value = direction.value = fill.value = play.value = name.value = property.value;
return components;
}
if (values.length > 1 && _anyIsInherit(values)) {
throw new InvalidPropertyError('Invalid animation values at ' + formatPosition(values[0][2][0]) + '. Ignoring.');
}
for (i = 0, l = values.length; i < l; i++) {
value = values[i];
if (validator.isTime(value[1]) && !durationSet) {
duration.value = [value];
durationSet = true;
} else if (validator.isTime(value[1]) && !delaySet) {
delay.value = [value];
delaySet = true;
} else if ((validator.isGlobal(value[1]) || validator.isTimingFunction(value[1])) && !timingSet) {
timing.value = [value];
timingSet = true;
} else if ((validator.isAnimationIterationCountKeyword(value[1]) || validator.isPositiveNumber(value[1])) && !iterationSet) {
iteration.value = [value];
iterationSet = true;
} else if (validator.isAnimationDirectionKeyword(value[1]) && !directionSet) {
direction.value = [value];
directionSet = true;
} else if (validator.isAnimationFillModeKeyword(value[1]) && !fillSet) {
fill.value = [value];
fillSet = true;
} else if (validator.isAnimationPlayStateKeyword(value[1]) && !playSet) {
play.value = [value];
playSet = true;
} else if ((validator.isAnimationNameKeyword(value[1]) || validator.isIdentifier(value[1])) && !nameSet) {
name.value = [value];
nameSet = true;
} else {
throw new InvalidPropertyError('Invalid animation value at ' + formatPosition(value[2][0]) + '. Ignoring.');
}
}
return components;
}
function background(property, compactable, validator) {
var image = _wrapDefault('background-image', property, compactable);
var position = _wrapDefault('background-position', property, compactable);
var size = _wrapDefault('background-size', property, compactable);
var repeat = _wrapDefault('background-repeat', property, compactable);
var attachment = _wrapDefault('background-attachment', property, compactable);
var origin = _wrapDefault('background-origin', property, compactable);
var clip = _wrapDefault('background-clip', property, compactable);
var color = _wrapDefault('background-color', property, compactable);
var components = [image, position, size, repeat, attachment, origin, clip, color];
var values = property.value;
var positionSet = false;
var clipSet = false;
var originSet = false;
var repeatSet = false;
var anyValueSet = false;
if (property.value.length == 1 && property.value[0][1] == 'inherit') {
// NOTE: 'inherit' is not a valid value for background-attachment
color.value = image.value = repeat.value = position.value = size.value = origin.value = clip.value = property.value;
return components;
}
if (property.value.length == 1 && property.value[0][1] == '0 0') {
return components;
}
for (var i = values.length - 1; i >= 0; i--) {
var value = values[i];
if (validator.isBackgroundAttachmentKeyword(value[1])) {
attachment.value = [value];
anyValueSet = true;
} else if (validator.isBackgroundClipKeyword(value[1]) || validator.isBackgroundOriginKeyword(value[1])) {
if (clipSet) {
origin.value = [value];
originSet = true;
} else {
clip.value = [value];
clipSet = true;
}
anyValueSet = true;
} else if (validator.isBackgroundRepeatKeyword(value[1])) {
if (repeatSet) {
repeat.value.unshift(value);
} else {
repeat.value = [value];
repeatSet = true;
}
anyValueSet = true;
} else if (validator.isBackgroundPositionKeyword(value[1]) || validator.isBackgroundSizeKeyword(value[1]) || validator.isUnit(value[1]) || validator.isDynamicUnit(value[1])) {
if (i > 0) {
var previousValue = values[i - 1];
if (previousValue[1] == Marker.FORWARD_SLASH) {
size.value = [value];
} else if (i > 1 && values[i - 2][1] == Marker.FORWARD_SLASH) {
size.value = [previousValue, value];
i -= 2;
} else {
if (!positionSet)
position.value = [];
position.value.unshift(value);
positionSet = true;
}
} else {
if (!positionSet)
position.value = [];
position.value.unshift(value);
positionSet = true;
}
anyValueSet = true;
} else if ((color.value[0][1] == compactable[color.name].defaultValue || color.value[0][1] == 'none') && (validator.isColor(value[1]) || validator.isPrefixed(value[1]))) {
color.value = [value];
anyValueSet = true;
} else if (validator.isUrl(value[1]) || validator.isFunction(value[1])) {
image.value = [value];
anyValueSet = true;
}
}
if (clipSet && !originSet)
origin.value = clip.value.slice(0);
if (!anyValueSet) {
throw new InvalidPropertyError('Invalid background value at ' + formatPosition(values[0][2][0]) + '. Ignoring.');
}
return components;
}
function borderRadius(property, compactable) {
var values = property.value;
var splitAt = -1;
for (var i = 0, l = values.length; i < l; i++) {
if (values[i][1] == Marker.FORWARD_SLASH) {
splitAt = i;
break;
}
}
if (splitAt === 0 || splitAt === values.length - 1) {
throw new InvalidPropertyError('Invalid border-radius value at ' + formatPosition(values[0][2][0]) + '. Ignoring.');
}
var target = _wrapDefault(property.name, property, compactable);
target.value = splitAt > -1 ?
values.slice(0, splitAt) :
values.slice(0);
target.components = fourValues(target, compactable);
var remainder = _wrapDefault(property.name, property, compactable);
remainder.value = splitAt > -1 ?
values.slice(splitAt + 1) :
values.slice(0);
remainder.components = fourValues(remainder, compactable);
for (var j = 0; j < 4; j++) {
target.components[j].multiplex = true;
target.components[j].value = target.components[j].value.concat(remainder.components[j].value);
}
return target.components;
}
function font(property, compactable, validator) {
var style = _wrapDefault('font-style', property, compactable);
var variant = _wrapDefault('font-variant', property, compactable);
var weight = _wrapDefault('font-weight', property, compactable);
var stretch = _wrapDefault('font-stretch', property, compactable);
var size = _wrapDefault('font-size', property, compactable);
var height = _wrapDefault('line-height', property, compactable);
var family = _wrapDefault('font-family', property, compactable);
var components = [style, variant, weight, stretch, size, height, family];
var values = property.value;
var fuzzyMatched = 4; // style, variant, weight, and stretch
var index = 0;
var isStretchSet = false;
var isStretchValid;
var isStyleSet = false;
var isStyleValid;
var isVariantSet = false;
var isVariantValid;
var isWeightSet = false;
var isWeightValid;
var isSizeSet = false;
var appendableFamilyName = false;
if (!values[index]) {
throw new InvalidPropertyError('Missing font values at ' + formatPosition(property.all[property.position][1][2][0]) + '. Ignoring.');
}
if (values.length == 1 && values[0][1] == 'inherit') {
style.value = variant.value = weight.value = stretch.value = size.value = height.value = family.value = values;
return components;
}
if (values.length == 1 && (validator.isFontKeyword(values[0][1]) || validator.isGlobal(values[0][1]) || validator.isPrefixed(values[0][1]))) {
values[0][1] = Marker.INTERNAL + values[0][1];
style.value = variant.value = weight.value = stretch.value = size.value = height.value = family.value = values;
return components;
}
if (values.length < 2 || !_anyIsFontSize(values, validator) || !_anyIsFontFamily(values, validator)) {
throw new InvalidPropertyError('Invalid font values at ' + formatPosition(property.all[property.position][1][2][0]) + '. Ignoring.');
}
if (values.length > 1 && _anyIsInherit(values)) {
throw new InvalidPropertyError('Invalid font values at ' + formatPosition(values[0][2][0]) + '. Ignoring.');
}
// fuzzy match style, variant, weight, and stretch on first elements
while (index < fuzzyMatched) {
isStretchValid = validator.isFontStretchKeyword(values[index][1]) || validator.isGlobal(values[index][1]);
isStyleValid = validator.isFontStyleKeyword(values[index][1]) || validator.isGlobal(values[index][1]);
isVariantValid = validator.isFontVariantKeyword(values[index][1]) || validator.isGlobal(values[index][1]);
isWeightValid = validator.isFontWeightKeyword(values[index][1]) || validator.isGlobal(values[index][1]);
if (isStyleValid && !isStyleSet) {
style.value = [values[index]];
isStyleSet = true;
} else if (isVariantValid && !isVariantSet) {
variant.value = [values[index]];
isVariantSet = true;
} else if (isWeightValid && !isWeightSet) {
weight.value = [values[index]];
isWeightSet = true;
} else if (isStretchValid && !isStretchSet) {
stretch.value = [values[index]];
isStretchSet = true;
} else if (isStyleValid && isStyleSet || isVariantValid && isVariantSet || isWeightValid && isWeightSet || isStretchValid && isStretchSet) {
throw new InvalidPropertyError('Invalid font style / variant / weight / stretch value at ' + formatPosition(values[0][2][0]) + '. Ignoring.');
} else {
break;
}
index++;
}
// now comes font-size ...
if (validator.isFontSizeKeyword(values[index][1]) || validator.isUnit(values[index][1]) && !validator.isDynamicUnit(values[index][1])) {
size.value = [values[index]];
isSizeSet = true;
index++;
} else {
throw new InvalidPropertyError('Missing font size at ' + formatPosition(values[0][2][0]) + '. Ignoring.');
}
if (!values[index]) {
throw new InvalidPropertyError('Missing font family at ' + formatPosition(values[0][2][0]) + '. Ignoring.');
}
// ... and perhaps line-height
if (isSizeSet && values[index] && values[index][1] == Marker.FORWARD_SLASH && values[index + 1] && (validator.isLineHeightKeyword(values[index + 1][1]) || validator.isUnit(values[index + 1][1]) || validator.isNumber(values[index + 1][1]))) {
height.value = [values[index + 1]];
index++;
index++;
}
// ... and whatever comes next is font-family
family.value = [];
while (values[index]) {
if (values[index][1] == Marker.COMMA) {
appendableFamilyName = false;
} else {
if (appendableFamilyName) {
family.value[family.value.length - 1][1] += Marker.SPACE + values[index][1];
} else {
family.value.push(values[index]);
}
appendableFamilyName = true;
}
index++;
}
if (family.value.length === 0) {
throw new InvalidPropertyError('Missing font family at ' + formatPosition(values[0][2][0]) + '. Ignoring.');
}
return components;
}
function _anyIsFontSize(values, validator) {
var value;
var i, l;
for (i = 0, l = values.length; i < l; i++) {
value = values[i];
if (validator.isFontSizeKeyword(value[1]) || validator.isUnit(value[1]) && !validator.isDynamicUnit(value[1]) || validator.isFunction(value[1])) {
return true;
}
}
return false;
}
function _anyIsFontFamily(values, validator) {
var value;
var i, l;
for (i = 0, l = values.length; i < l; i++) {
value = values[i];
if (validator.isIdentifier(value[1])) {
return true;
}
}
return false;
}
function fourValues(property, compactable) {
var componentNames = compactable[property.name].components;
var components = [];
var value = property.value;
if (value.length < 1)
return [];
if (value.length < 2)
value[1] = value[0].slice(0);
if (value.length < 3)
value[2] = value[0].slice(0);
if (value.length < 4)
value[3] = value[1].slice(0);
for (var i = componentNames.length - 1; i >= 0; i--) {
var component = wrapSingle([
Token.PROPERTY,
[Token.PROPERTY_NAME, componentNames[i]]
]);
component.value = [value[i]];
components.unshift(component);
}
return components;
}
function multiplex(splitWith) {
return function (property, compactable, validator) {
var splitsAt = [];
var values = property.value;
var i, j, l, m;
// find split commas
for (i = 0, l = values.length; i < l; i++) {
if (values[i][1] == ',')
splitsAt.push(i);
}
if (splitsAt.length === 0)
return splitWith(property, compactable, validator);
var splitComponents = [];
// split over commas, and into components
for (i = 0, l = splitsAt.length; i <= l; i++) {
var from = i === 0 ? 0 : splitsAt[i - 1] + 1;
var to = i < l ? splitsAt[i] : values.length;
var _property = _wrapDefault(property.name, property, compactable);
_property.value = values.slice(from, to);
splitComponents.push(splitWith(_property, compactable, validator));
}
var components = splitComponents[0];
// group component values from each split
for (i = 0, l = components.length; i < l; i++) {
components[i].multiplex = true;
for (j = 1, m = splitComponents.length; j < m; j++) {
components[i].value.push([Token.PROPERTY_VALUE, Marker.COMMA]);
Array.prototype.push.apply(components[i].value, splitComponents[j][i].value);
}
}
return components;
};
}
function listStyle(property, compactable, validator) {
var type = _wrapDefault('list-style-type', property, compactable);
var position = _wrapDefault('list-style-position', property, compactable);
var image = _wrapDefault('list-style-image', property, compactable);
var components = [type, position, image];
if (property.value.length == 1 && property.value[0][1] == 'inherit') {
type.value = position.value = image.value = [property.value[0]];
return components;
}
var values = property.value.slice(0);
var total = values.length;
var index = 0;
// `image` first...
for (index = 0, total = values.length; index < total; index++) {
if (validator.isUrl(values[index][1]) || values[index][1] == '0') {
image.value = [values[index]];
values.splice(index, 1);
break;
}
}
// ... then `position`
for (index = 0, total = values.length; index < total; index++) {
if (validator.isListStylePositionKeyword(values[index][1])) {
position.value = [values[index]];
values.splice(index, 1);
break;
}
}
// ... and what's left is a `type`
if (values.length > 0 && (validator.isListStyleTypeKeyword(values[0][1]) || validator.isIdentifier(values[0][1]))) {
type.value = [values[0]];
}
return components;
}
function transition(property, compactable, validator) {
var prop = _wrapDefault(property.name + '-property', property, compactable);
var duration = _wrapDefault(property.name + '-duration', property, compactable);
var timing = _wrapDefault(property.name + '-timing-function', property, compactable);
var delay = _wrapDefault(property.name + '-delay', property, compactable);
var components = [prop, duration, timing, delay];
var values = property.value;
var value;
var durationSet = false;
var delaySet = false;
var propSet = false;
var timingSet = false;
var i;
var l;
if (property.value.length == 1 && property.value[0][1] == 'inherit') {
prop.value = duration.value = timing.value = delay.value = property.value;
return components;
}
if (values.length > 1 && _anyIsInherit(values)) {
throw new InvalidPropertyError('Invalid animation values at ' + formatPosition(values[0][2][0]) + '. Ignoring.');
}
for (i = 0, l = values.length; i < l; i++) {
value = values[i];
if (validator.isTime(value[1]) && !durationSet) {
duration.value = [value];
durationSet = true;
} else if (validator.isTime(value[1]) && !delaySet) {
delay.value = [value];
delaySet = true;
} else if ((validator.isGlobal(value[1]) || validator.isTimingFunction(value[1])) && !timingSet) {
timing.value = [value];
timingSet = true;
} else if (validator.isIdentifier(value[1]) && !propSet) {
prop.value = [value];
propSet = true;
} else {
throw new InvalidPropertyError('Invalid animation value at ' + formatPosition(value[2][0]) + '. Ignoring.');
}
}
return components;
}
function widthStyleColor(property, compactable, validator) {
var descriptor = compactable[property.name];
var components = [
_wrapDefault(descriptor.components[0], property, compactable),
_wrapDefault(descriptor.components[1], property, compactable),
_wrapDefault(descriptor.components[2], property, compactable)
];
var color, style, width;
for (var i = 0; i < 3; i++) {
var component = components[i];
if (component.name.indexOf('color') > 0)
color = component;
else if (component.name.indexOf('style') > 0)
style = component;
else
width = component;
}
if ((property.value.length == 1 && property.value[0][1] == 'inherit') ||
(property.value.length == 3 && property.value[0][1] == 'inherit' && property.value[1][1] == 'inherit' && property.value[2][1] == 'inherit')) {
color.value = style.value = width.value = [property.value[0]];
return components;
}
var values = property.value.slice(0);
var match, matches;
// NOTE: usually users don't follow the required order of parts in this shorthand,
// so we'll try to parse it caring as little about order as possible
if (values.length > 0) {
matches = values.filter(_widthFilter(validator));
match = matches.length > 1 && (matches[0][1] == 'none' || matches[0][1] == 'auto') ? matches[1] : matches[0];
if (match) {
width.value = [match];
values.splice(values.indexOf(match), 1);
}
}
if (values.length > 0) {
match = values.filter(_styleFilter(validator))[0];
if (match) {
style.value = [match];
values.splice(values.indexOf(match), 1);
}
}
if (values.length > 0) {
match = values.filter(_colorFilter(validator))[0];
if (match) {
color.value = [match];
values.splice(values.indexOf(match), 1);
}
}
return components;
}
module.exports = {
animation: animation,
background: background,
border: widthStyleColor,
borderRadius: borderRadius,
font: font,
fourValues: fourValues,
listStyle: listStyle,
multiplex: multiplex,
outline: widthStyleColor,
transition: transition
};
node_modules/clean-css/lib/optimizer/level-2/merge-media-queries.js 0000666 00000006106 15042511722 0021322 0 ustar 00 var canReorder = require('./reorderable').canReorder;
var canReorderSingle = require('./reorderable').canReorderSingle;
var extractProperties = require('./extract-properties');
var rulesOverlap = require('./rules-overlap');
var serializeRules = require('../../writer/one-time').rules;
var OptimizationLevel = require('../../options/optimization-level').OptimizationLevel;
var Token = require('../../tokenizer/token');
function mergeMediaQueries(tokens, context) {
var mergeSemantically = context.options.level[OptimizationLevel.Two].mergeSemantically;
var specificityCache = context.cache.specificity;
var candidates = {};
var reduced = [];
for (var i = tokens.length - 1; i >= 0; i--) {
var token = tokens[i];
if (token[0] != Token.NESTED_BLOCK) {
continue;
}
var key = serializeRules(token[1]);
var candidate = candidates[key];
if (!candidate) {
candidate = [];
candidates[key] = candidate;
}
candidate.push(i);
}
for (var name in candidates) {
var positions = candidates[name];
positionLoop:
for (var j = positions.length - 1; j > 0; j--) {
var positionOne = positions[j];
var tokenOne = tokens[positionOne];
var positionTwo = positions[j - 1];
var tokenTwo = tokens[positionTwo];
directionLoop:
for (var direction = 1; direction >= -1; direction -= 2) {
var topToBottom = direction == 1;
var from = topToBottom ? positionOne + 1 : positionTwo - 1;
var to = topToBottom ? positionTwo : positionOne;
var delta = topToBottom ? 1 : -1;
var source = topToBottom ? tokenOne : tokenTwo;
var target = topToBottom ? tokenTwo : tokenOne;
var movedProperties = extractProperties(source);
while (from != to) {
var traversedProperties = extractProperties(tokens[from]);
from += delta;
if (mergeSemantically && allSameRulePropertiesCanBeReordered(movedProperties, traversedProperties, specificityCache)) {
continue;
}
if (!canReorder(movedProperties, traversedProperties, specificityCache))
continue directionLoop;
}
target[2] = topToBottom ?
source[2].concat(target[2]) :
target[2].concat(source[2]);
source[2] = [];
reduced.push(target);
continue positionLoop;
}
}
}
return reduced;
}
function allSameRulePropertiesCanBeReordered(movedProperties, traversedProperties, specificityCache) {
var movedProperty;
var movedRule;
var traversedProperty;
var traversedRule;
var i, l;
var j, m;
for (i = 0, l = movedProperties.length; i < l; i++) {
movedProperty = movedProperties[i];
movedRule = movedProperty[5];
for (j = 0, m = traversedProperties.length; j < m; j++) {
traversedProperty = traversedProperties[j];
traversedRule = traversedProperty[5];
if (rulesOverlap(movedRule, traversedRule, true) && !canReorderSingle(movedProperty, traversedProperty, specificityCache)) {
return false;
}
}
}
return true;
}
module.exports = mergeMediaQueries;
node_modules/clean-css/lib/optimizer/level-2/reorderable.js 0000666 00000007232 15042511722 0017762 0 ustar 00 // TODO: it'd be great to merge it with the other canReorder functionality
var rulesOverlap = require('./rules-overlap');
var specificitiesOverlap = require('./specificities-overlap');
var FLEX_PROPERTIES = /align\-items|box\-align|box\-pack|flex|justify/;
var BORDER_PROPERTIES = /^border\-(top|right|bottom|left|color|style|width|radius)/;
function canReorder(left, right, cache) {
for (var i = right.length - 1; i >= 0; i--) {
for (var j = left.length - 1; j >= 0; j--) {
if (!canReorderSingle(left[j], right[i], cache))
return false;
}
}
return true;
}
function canReorderSingle(left, right, cache) {
var leftName = left[0];
var leftValue = left[1];
var leftNameRoot = left[2];
var leftSelector = left[5];
var leftInSpecificSelector = left[6];
var rightName = right[0];
var rightValue = right[1];
var rightNameRoot = right[2];
var rightSelector = right[5];
var rightInSpecificSelector = right[6];
if (leftName == 'font' && rightName == 'line-height' || rightName == 'font' && leftName == 'line-height')
return false;
if (FLEX_PROPERTIES.test(leftName) && FLEX_PROPERTIES.test(rightName))
return false;
if (leftNameRoot == rightNameRoot && unprefixed(leftName) == unprefixed(rightName) && (vendorPrefixed(leftName) ^ vendorPrefixed(rightName)))
return false;
if (leftNameRoot == 'border' && BORDER_PROPERTIES.test(rightNameRoot) && (leftName == 'border' || leftName == rightNameRoot || (leftValue != rightValue && sameBorderComponent(leftName, rightName))))
return false;
if (rightNameRoot == 'border' && BORDER_PROPERTIES.test(leftNameRoot) && (rightName == 'border' || rightName == leftNameRoot || (leftValue != rightValue && sameBorderComponent(leftName, rightName))))
return false;
if (leftNameRoot == 'border' && rightNameRoot == 'border' && leftName != rightName && (isSideBorder(leftName) && isStyleBorder(rightName) || isStyleBorder(leftName) && isSideBorder(rightName)))
return false;
if (leftNameRoot != rightNameRoot)
return true;
if (leftName == rightName && leftNameRoot == rightNameRoot && (leftValue == rightValue || withDifferentVendorPrefix(leftValue, rightValue)))
return true;
if (leftName != rightName && leftNameRoot == rightNameRoot && leftName != leftNameRoot && rightName != rightNameRoot)
return true;
if (leftName != rightName && leftNameRoot == rightNameRoot && leftValue == rightValue)
return true;
if (rightInSpecificSelector && leftInSpecificSelector && !inheritable(leftNameRoot) && !inheritable(rightNameRoot) && !rulesOverlap(rightSelector, leftSelector, false))
return true;
if (!specificitiesOverlap(leftSelector, rightSelector, cache))
return true;
return false;
}
function vendorPrefixed(name) {
return /^\-(?:moz|webkit|ms|o)\-/.test(name);
}
function unprefixed(name) {
return name.replace(/^\-(?:moz|webkit|ms|o)\-/, '');
}
function sameBorderComponent(name1, name2) {
return name1.split('-').pop() == name2.split('-').pop();
}
function isSideBorder(name) {
return name == 'border-top' || name == 'border-right' || name == 'border-bottom' || name == 'border-left';
}
function isStyleBorder(name) {
return name == 'border-color' || name == 'border-style' || name == 'border-width';
}
function withDifferentVendorPrefix(value1, value2) {
return vendorPrefixed(value1) && vendorPrefixed(value2) && value1.split('-')[1] != value2.split('-')[2];
}
function inheritable(name) {
// According to http://www.w3.org/TR/CSS21/propidx.html
// Others will be catched by other, preceeding rules
return name == 'font' || name == 'line-height' || name == 'list-style';
}
module.exports = {
canReorder: canReorder,
canReorderSingle: canReorderSingle
};
node_modules/clean-css/lib/optimizer/level-2/properties/optimize.js 0000666 00000002717 15042511722 0021533 0 ustar 00 var mergeIntoShorthands = require('./merge-into-shorthands');
var overrideProperties = require('./override-properties');
var populateComponents = require('./populate-components');
var restoreWithComponents = require('../restore-with-components');
var wrapForOptimizing = require('../../wrap-for-optimizing').all;
var removeUnused = require('../../remove-unused');
var restoreFromOptimizing = require('../../restore-from-optimizing');
var OptimizationLevel = require('../../../options/optimization-level').OptimizationLevel;
function optimizeProperties(properties, withOverriding, withMerging, context) {
var levelOptions = context.options.level[OptimizationLevel.Two];
var _properties = wrapForOptimizing(properties, false, levelOptions.skipProperties);
var _property;
var i, l;
populateComponents(_properties, context.validator, context.warnings);
for (i = 0, l = _properties.length; i < l; i++) {
_property = _properties[i];
if (_property.block) {
optimizeProperties(_property.value[0][1], withOverriding, withMerging, context);
}
}
if (withMerging && levelOptions.mergeIntoShorthands) {
mergeIntoShorthands(_properties, context.validator);
}
if (withOverriding && levelOptions.overrideProperties) {
overrideProperties(_properties, withMerging, context.options.compatibility, context.validator);
}
restoreFromOptimizing(_properties, restoreWithComponents);
removeUnused(_properties);
}
module.exports = optimizeProperties;
node_modules/clean-css/lib/optimizer/level-2/properties/vendor-prefixes.js 0000666 00000000701 15042511722 0023002 0 ustar 00 var VENDOR_PREFIX_PATTERN = /(?:^|\W)(\-\w+\-)/g;
function unique(value) {
var prefixes = [];
var match;
while ((match = VENDOR_PREFIX_PATTERN.exec(value)) !== null) {
if (prefixes.indexOf(match[0]) == -1) {
prefixes.push(match[0]);
}
}
return prefixes;
}
function same(value1, value2) {
return unique(value1).sort().join(',') == unique(value2).sort().join(',');
}
module.exports = {
unique: unique,
same: same
};
node_modules/clean-css/lib/optimizer/level-2/properties/understandable.js 0000666 00000000550 15042511722 0022657 0 ustar 00 var sameVendorPrefixes = require('./vendor-prefixes').same;
function understandable(validator, value1, value2, _position, isPaired) {
if (!sameVendorPrefixes(value1, value2)) {
return false;
}
if (isPaired && validator.isVariable(value1) !== validator.isVariable(value2)) {
return false;
}
return true;
}
module.exports = understandable;
node_modules/clean-css/lib/optimizer/level-2/properties/is-component-of.js 0000666 00000001251 15042511722 0022700 0 ustar 00 var compactable = require('../compactable');
function isComponentOf(property1, property2, shallow) {
return isDirectComponentOf(property1, property2) ||
!shallow && !!compactable[property1.name].shorthandComponents && isSubComponentOf(property1, property2);
}
function isDirectComponentOf(property1, property2) {
var descriptor = compactable[property1.name];
return 'components' in descriptor && descriptor.components.indexOf(property2.name) > -1;
}
function isSubComponentOf(property1, property2) {
return property1
.components
.some(function (component) {
return isDirectComponentOf(component, property2);
});
}
module.exports = isComponentOf;
node_modules/clean-css/lib/optimizer/level-2/properties/has-inherit.js 0000666 00000000314 15042511722 0022075 0 ustar 00 function hasInherit(property) {
for (var i = property.value.length - 1; i >= 0; i--) {
if (property.value[i][1] == 'inherit')
return true;
}
return false;
}
module.exports = hasInherit;
node_modules/clean-css/lib/optimizer/level-2/properties/override-properties.js 0000666 00000034401 15042511722 0023677 0 ustar 00 var hasInherit = require('./has-inherit');
var everyValuesPair = require('./every-values-pair');
var findComponentIn = require('./find-component-in');
var isComponentOf = require('./is-component-of');
var isMergeableShorthand = require('./is-mergeable-shorthand');
var overridesNonComponentShorthand = require('./overrides-non-component-shorthand');
var sameVendorPrefixesIn = require('./vendor-prefixes').same;
var compactable = require('../compactable');
var deepClone = require('../clone').deep;
var restoreWithComponents = require('../restore-with-components');
var shallowClone = require('../clone').shallow;
var restoreFromOptimizing = require('../../restore-from-optimizing');
var Token = require('../../../tokenizer/token');
var Marker = require('../../../tokenizer/marker');
var serializeProperty = require('../../../writer/one-time').property;
function wouldBreakCompatibility(property, validator) {
for (var i = 0; i < property.components.length; i++) {
var component = property.components[i];
var descriptor = compactable[component.name];
var canOverride = descriptor && descriptor.canOverride || canOverride.sameValue;
var _component = shallowClone(component);
_component.value = [[Token.PROPERTY_VALUE, descriptor.defaultValue]];
if (!everyValuesPair(canOverride.bind(null, validator), _component, component)) {
return true;
}
}
return false;
}
function overrideIntoMultiplex(property, by) {
by.unused = true;
turnIntoMultiplex(by, multiplexSize(property));
property.value = by.value;
}
function overrideByMultiplex(property, by) {
by.unused = true;
property.multiplex = true;
property.value = by.value;
}
function overrideSimple(property, by) {
by.unused = true;
property.value = by.value;
}
function override(property, by) {
if (by.multiplex)
overrideByMultiplex(property, by);
else if (property.multiplex)
overrideIntoMultiplex(property, by);
else
overrideSimple(property, by);
}
function overrideShorthand(property, by) {
by.unused = true;
for (var i = 0, l = property.components.length; i < l; i++) {
override(property.components[i], by.components[i], property.multiplex);
}
}
function turnIntoMultiplex(property, size) {
property.multiplex = true;
if (compactable[property.name].shorthand) {
turnShorthandValueIntoMultiplex(property, size);
} else {
turnLonghandValueIntoMultiplex(property, size);
}
}
function turnShorthandValueIntoMultiplex(property, size) {
var component;
var i, l;
for (i = 0, l = property.components.length; i < l; i++) {
component = property.components[i];
if (!component.multiplex) {
turnLonghandValueIntoMultiplex(component, size);
}
}
}
function turnLonghandValueIntoMultiplex(property, size) {
var descriptor = compactable[property.name];
var withRealValue = descriptor.intoMultiplexMode == 'real';
var withValue = descriptor.intoMultiplexMode == 'real' ?
property.value.slice(0) :
(descriptor.intoMultiplexMode == 'placeholder' ? descriptor.placeholderValue : descriptor.defaultValue);
var i = multiplexSize(property);
var j;
var m = withValue.length;
for (; i < size; i++) {
property.value.push([Token.PROPERTY_VALUE, Marker.COMMA]);
if (Array.isArray(withValue)) {
for (j = 0; j < m; j++) {
property.value.push(withRealValue ? withValue[j] : [Token.PROPERTY_VALUE, withValue[j]]);
}
} else {
property.value.push(withRealValue ? withValue : [Token.PROPERTY_VALUE, withValue]);
}
}
}
function multiplexSize(component) {
var size = 0;
for (var i = 0, l = component.value.length; i < l; i++) {
if (component.value[i][1] == Marker.COMMA)
size++;
}
return size + 1;
}
function lengthOf(property) {
var fakeAsArray = [
Token.PROPERTY,
[Token.PROPERTY_NAME, property.name]
].concat(property.value);
return serializeProperty([fakeAsArray], 0).length;
}
function moreSameShorthands(properties, startAt, name) {
// Since we run the main loop in `compactOverrides` backwards, at this point some
// properties may not be marked as unused.
// We should consider reverting the order if possible
var count = 0;
for (var i = startAt; i >= 0; i--) {
if (properties[i].name == name && !properties[i].unused)
count++;
if (count > 1)
break;
}
return count > 1;
}
function overridingFunction(shorthand, validator) {
for (var i = 0, l = shorthand.components.length; i < l; i++) {
if (!anyValue(validator.isUrl, shorthand.components[i]) && anyValue(validator.isFunction, shorthand.components[i])) {
return true;
}
}
return false;
}
function anyValue(fn, property) {
for (var i = 0, l = property.value.length; i < l; i++) {
if (property.value[i][1] == Marker.COMMA)
continue;
if (fn(property.value[i][1]))
return true;
}
return false;
}
function wouldResultInLongerValue(left, right) {
if (!left.multiplex && !right.multiplex || left.multiplex && right.multiplex)
return false;
var multiplex = left.multiplex ? left : right;
var simple = left.multiplex ? right : left;
var component;
var multiplexClone = deepClone(multiplex);
restoreFromOptimizing([multiplexClone], restoreWithComponents);
var simpleClone = deepClone(simple);
restoreFromOptimizing([simpleClone], restoreWithComponents);
var lengthBefore = lengthOf(multiplexClone) + 1 + lengthOf(simpleClone);
if (left.multiplex) {
component = findComponentIn(multiplexClone, simpleClone);
overrideIntoMultiplex(component, simpleClone);
} else {
component = findComponentIn(simpleClone, multiplexClone);
turnIntoMultiplex(simpleClone, multiplexSize(multiplexClone));
overrideByMultiplex(component, multiplexClone);
}
restoreFromOptimizing([simpleClone], restoreWithComponents);
var lengthAfter = lengthOf(simpleClone);
return lengthBefore <= lengthAfter;
}
function isCompactable(property) {
return property.name in compactable;
}
function noneOverrideHack(left, right) {
return !left.multiplex &&
(left.name == 'background' || left.name == 'background-image') &&
right.multiplex &&
(right.name == 'background' || right.name == 'background-image') &&
anyLayerIsNone(right.value);
}
function anyLayerIsNone(values) {
var layers = intoLayers(values);
for (var i = 0, l = layers.length; i < l; i++) {
if (layers[i].length == 1 && layers[i][0][1] == 'none')
return true;
}
return false;
}
function intoLayers(values) {
var layers = [];
for (var i = 0, layer = [], l = values.length; i < l; i++) {
var value = values[i];
if (value[1] == Marker.COMMA) {
layers.push(layer);
layer = [];
} else {
layer.push(value);
}
}
layers.push(layer);
return layers;
}
function overrideProperties(properties, withMerging, compatibility, validator) {
var mayOverride, right, left, component;
var overriddenComponents;
var overriddenComponent;
var overridingComponent;
var overridable;
var i, j, k;
propertyLoop:
for (i = properties.length - 1; i >= 0; i--) {
right = properties[i];
if (!isCompactable(right))
continue;
if (right.block)
continue;
mayOverride = compactable[right.name].canOverride;
traverseLoop:
for (j = i - 1; j >= 0; j--) {
left = properties[j];
if (!isCompactable(left))
continue;
if (left.block)
continue;
if (left.unused || right.unused)
continue;
if (left.hack && !right.hack && !right.important || !left.hack && !left.important && right.hack)
continue;
if (left.important == right.important && left.hack[0] != right.hack[0])
continue;
if (left.important == right.important && (left.hack[0] != right.hack[0] || (left.hack[1] && left.hack[1] != right.hack[1])))
continue;
if (hasInherit(right))
continue;
if (noneOverrideHack(left, right))
continue;
if (right.shorthand && isComponentOf(right, left)) {
// maybe `left` can be overridden by `right` which is a shorthand?
if (!right.important && left.important)
continue;
if (!sameVendorPrefixesIn([left], right.components))
continue;
if (!anyValue(validator.isFunction, left) && overridingFunction(right, validator))
continue;
if (!isMergeableShorthand(right)) {
left.unused = true;
continue;
}
component = findComponentIn(right, left);
mayOverride = compactable[left.name].canOverride;
if (everyValuesPair(mayOverride.bind(null, validator), left, component)) {
left.unused = true;
}
} else if (right.shorthand && overridesNonComponentShorthand(right, left)) {
// `right` is a shorthand while `left` can be overriden by it, think `border` and `border-top`
if (!right.important && left.important) {
continue;
}
if (!sameVendorPrefixesIn([left], right.components)) {
continue;
}
if (!anyValue(validator.isFunction, left) && overridingFunction(right, validator)) {
continue;
}
overriddenComponents = left.shorthand ?
left.components:
[left];
for (k = overriddenComponents.length - 1; k >= 0; k--) {
overriddenComponent = overriddenComponents[k];
overridingComponent = findComponentIn(right, overriddenComponent);
mayOverride = compactable[overriddenComponent.name].canOverride;
if (!everyValuesPair(mayOverride.bind(null, validator), left, overridingComponent)) {
continue traverseLoop;
}
}
left.unused = true;
} else if (withMerging && left.shorthand && !right.shorthand && isComponentOf(left, right, true)) {
// maybe `right` can be pulled into `left` which is a shorthand?
if (right.important && !left.important)
continue;
if (!right.important && left.important) {
right.unused = true;
continue;
}
// Pending more clever algorithm in #527
if (moreSameShorthands(properties, i - 1, left.name))
continue;
if (overridingFunction(left, validator))
continue;
if (!isMergeableShorthand(left))
continue;
component = findComponentIn(left, right);
if (everyValuesPair(mayOverride.bind(null, validator), component, right)) {
var disabledBackgroundMerging =
!compatibility.properties.backgroundClipMerging && component.name.indexOf('background-clip') > -1 ||
!compatibility.properties.backgroundOriginMerging && component.name.indexOf('background-origin') > -1 ||
!compatibility.properties.backgroundSizeMerging && component.name.indexOf('background-size') > -1;
var nonMergeableValue = compactable[right.name].nonMergeableValue === right.value[0][1];
if (disabledBackgroundMerging || nonMergeableValue)
continue;
if (!compatibility.properties.merging && wouldBreakCompatibility(left, validator))
continue;
if (component.value[0][1] != right.value[0][1] && (hasInherit(left) || hasInherit(right)))
continue;
if (wouldResultInLongerValue(left, right))
continue;
if (!left.multiplex && right.multiplex)
turnIntoMultiplex(left, multiplexSize(right));
override(component, right);
left.dirty = true;
}
} else if (withMerging && left.shorthand && right.shorthand && left.name == right.name) {
// merge if all components can be merged
if (!left.multiplex && right.multiplex)
continue;
if (!right.important && left.important) {
right.unused = true;
continue propertyLoop;
}
if (right.important && !left.important) {
left.unused = true;
continue;
}
if (!isMergeableShorthand(right)) {
left.unused = true;
continue;
}
for (k = left.components.length - 1; k >= 0; k--) {
var leftComponent = left.components[k];
var rightComponent = right.components[k];
mayOverride = compactable[leftComponent.name].canOverride;
if (!everyValuesPair(mayOverride.bind(null, validator), leftComponent, rightComponent))
continue propertyLoop;
}
overrideShorthand(left, right);
left.dirty = true;
} else if (withMerging && left.shorthand && right.shorthand && isComponentOf(left, right)) {
// border is a shorthand but any of its components is a shorthand too
if (!left.important && right.important)
continue;
component = findComponentIn(left, right);
mayOverride = compactable[right.name].canOverride;
if (!everyValuesPair(mayOverride.bind(null, validator), component, right))
continue;
if (left.important && !right.important) {
right.unused = true;
continue;
}
var rightRestored = compactable[right.name].restore(right, compactable);
if (rightRestored.length > 1)
continue;
component = findComponentIn(left, right);
override(component, right);
right.dirty = true;
} else if (left.name == right.name) {
// two non-shorthands should be merged based on understandability
overridable = true;
if (right.shorthand) {
for (k = right.components.length - 1; k >= 0 && overridable; k--) {
overriddenComponent = left.components[k];
overridingComponent = right.components[k];
mayOverride = compactable[overridingComponent.name].canOverride;
overridable = overridable && everyValuesPair(mayOverride.bind(null, validator), overriddenComponent, overridingComponent);
}
} else {
mayOverride = compactable[right.name].canOverride;
overridable = everyValuesPair(mayOverride.bind(null, validator), left, right);
}
if (left.important && !right.important && overridable) {
right.unused = true;
continue;
}
if (!left.important && right.important && overridable) {
left.unused = true;
continue;
}
if (!overridable) {
continue;
}
left.unused = true;
}
}
}
}
module.exports = overrideProperties;
node_modules/clean-css/lib/optimizer/level-2/properties/overrides-non-component-shorthand.js 0000666 00000000532 15042511722 0026446 0 ustar 00 var compactable = require('../compactable');
function overridesNonComponentShorthand(property1, property2) {
return property1.name in compactable &&
'overridesShorthands' in compactable[property1.name] &&
compactable[property1.name].overridesShorthands.indexOf(property2.name) > -1;
}
module.exports = overridesNonComponentShorthand;
node_modules/clean-css/lib/optimizer/level-2/properties/merge-into-shorthands.js 0000666 00000030323 15042511722 0024106 0 ustar 00 var everyValuesPair = require('./every-values-pair');
var hasInherit = require('./has-inherit');
var populateComponents = require('./populate-components');
var compactable = require('../compactable');
var deepClone = require('../clone').deep;
var restoreWithComponents = require('../restore-with-components');
var restoreFromOptimizing = require('../../restore-from-optimizing');
var wrapSingle = require('../../wrap-for-optimizing').single;
var serializeBody = require('../../../writer/one-time').body;
var Token = require('../../../tokenizer/token');
function mergeIntoShorthands(properties, validator) {
var candidates = {};
var descriptor;
var componentOf;
var property;
var i, l;
var j, m;
// there is no shorthand property made up of less than 3 longhands
if (properties.length < 3) {
return;
}
for (i = 0, l = properties.length; i < l; i++) {
property = properties[i];
descriptor = compactable[property.name];
if (property.unused) {
continue;
}
if (property.hack) {
continue;
}
if (property.block) {
continue;
}
invalidateOrCompact(properties, i, candidates, validator);
if (descriptor && descriptor.componentOf) {
for (j = 0, m = descriptor.componentOf.length; j < m; j++) {
componentOf = descriptor.componentOf[j];
candidates[componentOf] = candidates[componentOf] || {};
candidates[componentOf][property.name] = property;
}
}
}
invalidateOrCompact(properties, i, candidates, validator);
}
function invalidateOrCompact(properties, position, candidates, validator) {
var invalidatedBy = properties[position];
var shorthandName;
var shorthandDescriptor;
var candidateComponents;
for (shorthandName in candidates) {
if (undefined !== invalidatedBy && shorthandName == invalidatedBy.name) {
continue;
}
shorthandDescriptor = compactable[shorthandName];
candidateComponents = candidates[shorthandName];
if (invalidatedBy && invalidates(candidates, shorthandName, invalidatedBy)) {
delete candidates[shorthandName];
continue;
}
if (shorthandDescriptor.components.length > Object.keys(candidateComponents).length) {
continue;
}
if (mixedImportance(candidateComponents)) {
continue;
}
if (!overridable(candidateComponents, shorthandName, validator)) {
continue;
}
if (!mergeable(candidateComponents)) {
continue;
}
if (mixedInherit(candidateComponents)) {
replaceWithInheritBestFit(properties, candidateComponents, shorthandName, validator);
} else {
replaceWithShorthand(properties, candidateComponents, shorthandName, validator);
}
}
}
function invalidates(candidates, shorthandName, invalidatedBy) {
var shorthandDescriptor = compactable[shorthandName];
var invalidatedByDescriptor = compactable[invalidatedBy.name];
var componentName;
if ('overridesShorthands' in shorthandDescriptor && shorthandDescriptor.overridesShorthands.indexOf(invalidatedBy.name) > -1) {
return true;
}
if (invalidatedByDescriptor && 'componentOf' in invalidatedByDescriptor) {
for (componentName in candidates[shorthandName]) {
if (invalidatedByDescriptor.componentOf.indexOf(componentName) > -1) {
return true;
}
}
}
return false;
}
function mixedImportance(components) {
var important;
var componentName;
for (componentName in components) {
if (undefined !== important && components[componentName].important != important) {
return true;
}
important = components[componentName].important;
}
return false;
}
function overridable(components, shorthandName, validator) {
var descriptor = compactable[shorthandName];
var newValuePlaceholder = [
Token.PROPERTY,
[Token.PROPERTY_NAME, shorthandName],
[Token.PROPERTY_VALUE, descriptor.defaultValue]
];
var newProperty = wrapSingle(newValuePlaceholder);
var component;
var mayOverride;
var i, l;
populateComponents([newProperty], validator, []);
for (i = 0, l = descriptor.components.length; i < l; i++) {
component = components[descriptor.components[i]];
mayOverride = compactable[component.name].canOverride;
if (!everyValuesPair(mayOverride.bind(null, validator), newProperty.components[i], component)) {
return false;
}
}
return true;
}
function mergeable(components) {
var lastCount = null;
var currentCount;
var componentName;
var component;
var descriptor;
var values;
for (componentName in components) {
component = components[componentName];
descriptor = compactable[componentName];
if (!('restore' in descriptor)) {
continue;
}
restoreFromOptimizing([component.all[component.position]], restoreWithComponents);
values = descriptor.restore(component, compactable);
currentCount = values.length;
if (lastCount !== null && currentCount !== lastCount) {
return false;
}
lastCount = currentCount;
}
return true;
}
function mixedInherit(components) {
var componentName;
var lastValue = null;
var currentValue;
for (componentName in components) {
currentValue = hasInherit(components[componentName]);
if (lastValue !== null && lastValue !== currentValue) {
return true;
}
lastValue = currentValue;
}
return false;
}
function replaceWithInheritBestFit(properties, candidateComponents, shorthandName, validator) {
var viaLonghands = buildSequenceWithInheritLonghands(candidateComponents, shorthandName, validator);
var viaShorthand = buildSequenceWithInheritShorthand(candidateComponents, shorthandName, validator);
var longhandTokensSequence = viaLonghands[0];
var shorthandTokensSequence = viaShorthand[0];
var isLonghandsShorter = serializeBody(longhandTokensSequence).length < serializeBody(shorthandTokensSequence).length;
var newTokensSequence = isLonghandsShorter ? longhandTokensSequence : shorthandTokensSequence;
var newProperty = isLonghandsShorter ? viaLonghands[1] : viaShorthand[1];
var newComponents = isLonghandsShorter ? viaLonghands[2] : viaShorthand[2];
var all = candidateComponents[Object.keys(candidateComponents)[0]].all;
var componentName;
var oldComponent;
var newComponent;
var newToken;
newProperty.position = all.length;
newProperty.shorthand = true;
newProperty.dirty = true;
newProperty.all = all;
newProperty.all.push(newTokensSequence[0]);
properties.push(newProperty);
for (componentName in candidateComponents) {
oldComponent = candidateComponents[componentName];
oldComponent.unused = true;
if (oldComponent.name in newComponents) {
newComponent = newComponents[oldComponent.name];
newToken = findTokenIn(newTokensSequence, componentName);
newComponent.position = all.length;
newComponent.all = all;
newComponent.all.push(newToken);
properties.push(newComponent);
}
}
}
function buildSequenceWithInheritLonghands(components, shorthandName, validator) {
var tokensSequence = [];
var inheritComponents = {};
var nonInheritComponents = {};
var descriptor = compactable[shorthandName];
var shorthandToken = [
Token.PROPERTY,
[Token.PROPERTY_NAME, shorthandName],
[Token.PROPERTY_VALUE, descriptor.defaultValue]
];
var newProperty = wrapSingle(shorthandToken);
var component;
var longhandToken;
var newComponent;
var nameMetadata;
var i, l;
populateComponents([newProperty], validator, []);
for (i = 0, l = descriptor.components.length; i < l; i++) {
component = components[descriptor.components[i]];
if (hasInherit(component)) {
longhandToken = component.all[component.position].slice(0, 2);
Array.prototype.push.apply(longhandToken, component.value);
tokensSequence.push(longhandToken);
newComponent = deepClone(component);
newComponent.value = inferComponentValue(components, newComponent.name);
newProperty.components[i] = newComponent;
inheritComponents[component.name] = deepClone(component);
} else {
newComponent = deepClone(component);
newComponent.all = component.all;
newProperty.components[i] = newComponent;
nonInheritComponents[component.name] = component;
}
}
nameMetadata = joinMetadata(nonInheritComponents, 1);
shorthandToken[1].push(nameMetadata);
restoreFromOptimizing([newProperty], restoreWithComponents);
shorthandToken = shorthandToken.slice(0, 2);
Array.prototype.push.apply(shorthandToken, newProperty.value);
tokensSequence.unshift(shorthandToken);
return [tokensSequence, newProperty, inheritComponents];
}
function inferComponentValue(components, propertyName) {
var descriptor = compactable[propertyName];
if ('oppositeTo' in descriptor) {
return components[descriptor.oppositeTo].value;
} else {
return [[Token.PROPERTY_VALUE, descriptor.defaultValue]];
}
}
function joinMetadata(components, at) {
var metadata = [];
var component;
var originalValue;
var componentMetadata;
var componentName;
for (componentName in components) {
component = components[componentName];
originalValue = component.all[component.position];
componentMetadata = originalValue[at][originalValue[at].length - 1];
Array.prototype.push.apply(metadata, componentMetadata);
}
return metadata.sort(metadataSorter);
}
function metadataSorter(metadata1, metadata2) {
var line1 = metadata1[0];
var line2 = metadata2[0];
var column1 = metadata1[1];
var column2 = metadata2[1];
if (line1 < line2) {
return -1;
} else if (line1 === line2) {
return column1 < column2 ? -1 : 1;
} else {
return 1;
}
}
function buildSequenceWithInheritShorthand(components, shorthandName, validator) {
var tokensSequence = [];
var inheritComponents = {};
var nonInheritComponents = {};
var descriptor = compactable[shorthandName];
var shorthandToken = [
Token.PROPERTY,
[Token.PROPERTY_NAME, shorthandName],
[Token.PROPERTY_VALUE, 'inherit']
];
var newProperty = wrapSingle(shorthandToken);
var component;
var longhandToken;
var nameMetadata;
var valueMetadata;
var i, l;
populateComponents([newProperty], validator, []);
for (i = 0, l = descriptor.components.length; i < l; i++) {
component = components[descriptor.components[i]];
if (hasInherit(component)) {
inheritComponents[component.name] = component;
} else {
longhandToken = component.all[component.position].slice(0, 2);
Array.prototype.push.apply(longhandToken, component.value);
tokensSequence.push(longhandToken);
nonInheritComponents[component.name] = deepClone(component);
}
}
nameMetadata = joinMetadata(inheritComponents, 1);
shorthandToken[1].push(nameMetadata);
valueMetadata = joinMetadata(inheritComponents, 2);
shorthandToken[2].push(valueMetadata);
tokensSequence.unshift(shorthandToken);
return [tokensSequence, newProperty, nonInheritComponents];
}
function findTokenIn(tokens, componentName) {
var i, l;
for (i = 0, l = tokens.length; i < l; i++) {
if (tokens[i][1][1] == componentName) {
return tokens[i];
}
}
}
function replaceWithShorthand(properties, candidateComponents, shorthandName, validator) {
var descriptor = compactable[shorthandName];
var nameMetadata;
var valueMetadata;
var newValuePlaceholder = [
Token.PROPERTY,
[Token.PROPERTY_NAME, shorthandName],
[Token.PROPERTY_VALUE, descriptor.defaultValue]
];
var all;
var newProperty = wrapSingle(newValuePlaceholder);
newProperty.shorthand = true;
newProperty.dirty = true;
populateComponents([newProperty], validator, []);
for (var i = 0, l = descriptor.components.length; i < l; i++) {
var component = candidateComponents[descriptor.components[i]];
newProperty.components[i] = deepClone(component);
newProperty.important = component.important;
all = component.all;
}
for (var componentName in candidateComponents) {
candidateComponents[componentName].unused = true;
}
nameMetadata = joinMetadata(candidateComponents, 1);
newValuePlaceholder[1].push(nameMetadata);
valueMetadata = joinMetadata(candidateComponents, 2);
newValuePlaceholder[2].push(valueMetadata);
newProperty.position = all.length;
newProperty.all = all;
newProperty.all.push(newValuePlaceholder);
properties.push(newProperty);
}
module.exports = mergeIntoShorthands;
node_modules/clean-css/lib/optimizer/level-2/properties/find-component-in.js 0000666 00000001671 15042511722 0023215 0 ustar 00 var compactable = require('../compactable');
function findComponentIn(shorthand, longhand) {
var comparator = nameComparator(longhand);
return findInDirectComponents(shorthand, comparator) || findInSubComponents(shorthand, comparator);
}
function nameComparator(to) {
return function (property) {
return to.name === property.name;
};
}
function findInDirectComponents(shorthand, comparator) {
return shorthand.components.filter(comparator)[0];
}
function findInSubComponents(shorthand, comparator) {
var shorthandComponent;
var longhandMatch;
var i, l;
if (!compactable[shorthand.name].shorthandComponents) {
return;
}
for (i = 0, l = shorthand.components.length; i < l; i++) {
shorthandComponent = shorthand.components[i];
longhandMatch = findInDirectComponents(shorthandComponent, comparator);
if (longhandMatch) {
return longhandMatch;
}
}
return;
}
module.exports = findComponentIn;
node_modules/clean-css/lib/optimizer/level-2/properties/populate-components.js 0000666 00000002377 15042511722 0023711 0 ustar 00 var compactable = require('../compactable');
var InvalidPropertyError = require('../invalid-property-error');
function populateComponents(properties, validator, warnings) {
var component;
var j, m;
for (var i = properties.length - 1; i >= 0; i--) {
var property = properties[i];
var descriptor = compactable[property.name];
if (descriptor && descriptor.shorthand) {
property.shorthand = true;
property.dirty = true;
try {
property.components = descriptor.breakUp(property, compactable, validator);
if (descriptor.shorthandComponents) {
for (j = 0, m = property.components.length; j < m; j++) {
component = property.components[j];
component.components = compactable[component.name].breakUp(component, compactable, validator);
}
}
} catch (e) {
if (e instanceof InvalidPropertyError) {
property.components = []; // this will set property.unused to true below
warnings.push(e.message);
} else {
throw e;
}
}
if (property.components.length > 0)
property.multiplex = property.components[0].multiplex;
else
property.unused = true;
}
}
}
module.exports = populateComponents;
node_modules/clean-css/lib/optimizer/level-2/properties/is-mergeable-shorthand.js 0000666 00000000400 15042511722 0024202 0 ustar 00 var Marker = require('../../../tokenizer/marker');
function isMergeableShorthand(shorthand) {
if (shorthand.name != 'font') {
return true;
}
return shorthand.value[0][1].indexOf(Marker.INTERNAL) == -1;
}
module.exports = isMergeableShorthand;
node_modules/clean-css/lib/optimizer/level-2/properties/every-values-pair.js 0000666 00000001414 15042511722 0023244 0 ustar 00 var Marker = require('../../../tokenizer/marker');
function everyValuesPair(fn, left, right) {
var leftSize = left.value.length;
var rightSize = right.value.length;
var total = Math.max(leftSize, rightSize);
var lowerBound = Math.min(leftSize, rightSize) - 1;
var leftValue;
var rightValue;
var position;
for (position = 0; position < total; position++) {
leftValue = left.value[position] && left.value[position][1] || leftValue;
rightValue = right.value[position] && right.value[position][1] || rightValue;
if (leftValue == Marker.COMMA || rightValue == Marker.COMMA) {
continue;
}
if (!fn(leftValue, rightValue, position, position <= lowerBound)) {
return false;
}
}
return true;
}
module.exports = everyValuesPair;
node_modules/clean-css/lib/optimizer/level-2/restore.js 0000666 00000023145 15042511722 0017160 0 ustar 00 var shallowClone = require('./clone').shallow;
var Token = require('../../tokenizer/token');
var Marker = require('../../tokenizer/marker');
function isInheritOnly(values) {
for (var i = 0, l = values.length; i < l; i++) {
var value = values[i][1];
if (value != 'inherit' && value != Marker.COMMA && value != Marker.FORWARD_SLASH)
return false;
}
return true;
}
function background(property, compactable, lastInMultiplex) {
var components = property.components;
var restored = [];
var needsOne, needsBoth;
function restoreValue(component) {
Array.prototype.unshift.apply(restored, component.value);
}
function isDefaultValue(component) {
var descriptor = compactable[component.name];
if (descriptor.doubleValues && descriptor.defaultValue.length == 1) {
return component.value[0][1] == descriptor.defaultValue[0] && (component.value[1] ? component.value[1][1] == descriptor.defaultValue[0] : true);
} else if (descriptor.doubleValues && descriptor.defaultValue.length != 1) {
return component.value[0][1] == descriptor.defaultValue[0] && (component.value[1] ? component.value[1][1] : component.value[0][1]) == descriptor.defaultValue[1];
} else {
return component.value[0][1] == descriptor.defaultValue;
}
}
for (var i = components.length - 1; i >= 0; i--) {
var component = components[i];
var isDefault = isDefaultValue(component);
if (component.name == 'background-clip') {
var originComponent = components[i - 1];
var isOriginDefault = isDefaultValue(originComponent);
needsOne = component.value[0][1] == originComponent.value[0][1];
needsBoth = !needsOne && (
(isOriginDefault && !isDefault) ||
(!isOriginDefault && !isDefault) ||
(!isOriginDefault && isDefault && component.value[0][1] != originComponent.value[0][1]));
if (needsOne) {
restoreValue(originComponent);
} else if (needsBoth) {
restoreValue(component);
restoreValue(originComponent);
}
i--;
} else if (component.name == 'background-size') {
var positionComponent = components[i - 1];
var isPositionDefault = isDefaultValue(positionComponent);
needsOne = !isPositionDefault && isDefault;
needsBoth = !needsOne &&
(isPositionDefault && !isDefault || !isPositionDefault && !isDefault);
if (needsOne) {
restoreValue(positionComponent);
} else if (needsBoth) {
restoreValue(component);
restored.unshift([Token.PROPERTY_VALUE, Marker.FORWARD_SLASH]);
restoreValue(positionComponent);
} else if (positionComponent.value.length == 1) {
restoreValue(positionComponent);
}
i--;
} else {
if (isDefault || compactable[component.name].multiplexLastOnly && !lastInMultiplex)
continue;
restoreValue(component);
}
}
if (restored.length === 0 && property.value.length == 1 && property.value[0][1] == '0')
restored.push(property.value[0]);
if (restored.length === 0)
restored.push([Token.PROPERTY_VALUE, compactable[property.name].defaultValue]);
if (isInheritOnly(restored))
return [restored[0]];
return restored;
}
function borderRadius(property, compactable) {
if (property.multiplex) {
var horizontal = shallowClone(property);
var vertical = shallowClone(property);
for (var i = 0; i < 4; i++) {
var component = property.components[i];
var horizontalComponent = shallowClone(property);
horizontalComponent.value = [component.value[0]];
horizontal.components.push(horizontalComponent);
var verticalComponent = shallowClone(property);
// FIXME: only shorthand compactor (see breakup#borderRadius) knows that border radius
// longhands have two values, whereas tokenizer does not care about populating 2nd value
// if it's missing, hence this fallback
verticalComponent.value = [component.value[1] || component.value[0]];
vertical.components.push(verticalComponent);
}
var horizontalValues = fourValues(horizontal, compactable);
var verticalValues = fourValues(vertical, compactable);
if (horizontalValues.length == verticalValues.length &&
horizontalValues[0][1] == verticalValues[0][1] &&
(horizontalValues.length > 1 ? horizontalValues[1][1] == verticalValues[1][1] : true) &&
(horizontalValues.length > 2 ? horizontalValues[2][1] == verticalValues[2][1] : true) &&
(horizontalValues.length > 3 ? horizontalValues[3][1] == verticalValues[3][1] : true)) {
return horizontalValues;
} else {
return horizontalValues.concat([[Token.PROPERTY_VALUE, Marker.FORWARD_SLASH]]).concat(verticalValues);
}
} else {
return fourValues(property, compactable);
}
}
function font(property, compactable) {
var components = property.components;
var restored = [];
var component;
var componentIndex = 0;
var fontFamilyIndex = 0;
if (property.value[0][1].indexOf(Marker.INTERNAL) === 0) {
property.value[0][1] = property.value[0][1].substring(Marker.INTERNAL.length);
return property.value;
}
// first four components are optional
while (componentIndex < 4) {
component = components[componentIndex];
if (component.value[0][1] != compactable[component.name].defaultValue) {
Array.prototype.push.apply(restored, component.value);
}
componentIndex++;
}
// then comes font-size
Array.prototype.push.apply(restored, components[componentIndex].value);
componentIndex++;
// then may come line-height
if (components[componentIndex].value[0][1] != compactable[components[componentIndex].name].defaultValue) {
Array.prototype.push.apply(restored, [[Token.PROPERTY_VALUE, Marker.FORWARD_SLASH]]);
Array.prototype.push.apply(restored, components[componentIndex].value);
}
componentIndex++;
// then comes font-family
while (components[componentIndex].value[fontFamilyIndex]) {
restored.push(components[componentIndex].value[fontFamilyIndex]);
if (components[componentIndex].value[fontFamilyIndex + 1]) {
restored.push([Token.PROPERTY_VALUE, Marker.COMMA]);
}
fontFamilyIndex++;
}
if (isInheritOnly(restored)) {
return [restored[0]];
}
return restored;
}
function fourValues(property) {
var components = property.components;
var value1 = components[0].value[0];
var value2 = components[1].value[0];
var value3 = components[2].value[0];
var value4 = components[3].value[0];
if (value1[1] == value2[1] && value1[1] == value3[1] && value1[1] == value4[1]) {
return [value1];
} else if (value1[1] == value3[1] && value2[1] == value4[1]) {
return [value1, value2];
} else if (value2[1] == value4[1]) {
return [value1, value2, value3];
} else {
return [value1, value2, value3, value4];
}
}
function multiplex(restoreWith) {
return function (property, compactable) {
if (!property.multiplex)
return restoreWith(property, compactable, true);
var multiplexSize = 0;
var restored = [];
var componentMultiplexSoFar = {};
var i, l;
// At this point we don't know what's the multiplex size, e.g. how many background layers are there
for (i = 0, l = property.components[0].value.length; i < l; i++) {
if (property.components[0].value[i][1] == Marker.COMMA)
multiplexSize++;
}
for (i = 0; i <= multiplexSize; i++) {
var _property = shallowClone(property);
// We split multiplex into parts and restore them one by one
for (var j = 0, m = property.components.length; j < m; j++) {
var componentToClone = property.components[j];
var _component = shallowClone(componentToClone);
_property.components.push(_component);
// The trick is some properties has more than one value, so we iterate over values looking for
// a multiplex separator - a comma
for (var k = componentMultiplexSoFar[_component.name] || 0, n = componentToClone.value.length; k < n; k++) {
if (componentToClone.value[k][1] == Marker.COMMA) {
componentMultiplexSoFar[_component.name] = k + 1;
break;
}
_component.value.push(componentToClone.value[k]);
}
}
// No we can restore shorthand value
var lastInMultiplex = i == multiplexSize;
var _restored = restoreWith(_property, compactable, lastInMultiplex);
Array.prototype.push.apply(restored, _restored);
if (i < multiplexSize)
restored.push([Token.PROPERTY_VALUE, Marker.COMMA]);
}
return restored;
};
}
function withoutDefaults(property, compactable) {
var components = property.components;
var restored = [];
for (var i = components.length - 1; i >= 0; i--) {
var component = components[i];
var descriptor = compactable[component.name];
if (component.value[0][1] != descriptor.defaultValue || ('keepUnlessDefault' in descriptor) && !isDefault(components, compactable, descriptor.keepUnlessDefault)) {
restored.unshift(component.value[0]);
}
}
if (restored.length === 0)
restored.push([Token.PROPERTY_VALUE, compactable[property.name].defaultValue]);
if (isInheritOnly(restored))
return [restored[0]];
return restored;
}
function isDefault(components, compactable, propertyName) {
var component;
var i, l;
for (i = 0, l = components.length; i < l; i++) {
component = components[i];
if (component.name == propertyName && component.value[0][1] == compactable[propertyName].defaultValue) {
return true;
}
}
return false;
}
module.exports = {
background: background,
borderRadius: borderRadius,
font: font,
fourValues: fourValues,
multiplex: multiplex,
withoutDefaults: withoutDefaults
};
node_modules/clean-css/lib/optimizer/level-2/tidy-rule-duplicates.js 0000666 00000000615 15042511722 0021543 0 ustar 00 function ruleSorter(s1, s2) {
return s1[1] > s2[1] ? 1 : -1;
}
function tidyRuleDuplicates(rules) {
var list = [];
var repeated = [];
for (var i = 0, l = rules.length; i < l; i++) {
var rule = rules[i];
if (repeated.indexOf(rule[1]) == -1) {
repeated.push(rule[1]);
list.push(rule);
}
}
return list.sort(ruleSorter);
}
module.exports = tidyRuleDuplicates;
node_modules/clean-css/lib/optimizer/level-2/can-override.js 0000666 00000024347 15042511722 0020060 0 ustar 00 var understandable = require('./properties/understandable');
function animationIterationCount(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !(validator.isAnimationIterationCountKeyword(value2) || validator.isPositiveNumber(value2))) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
}
return validator.isAnimationIterationCountKeyword(value2) || validator.isPositiveNumber(value2);
}
function animationName(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !(validator.isAnimationNameKeyword(value2) || validator.isIdentifier(value2))) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
}
return validator.isAnimationNameKeyword(value2) || validator.isIdentifier(value2);
}
function areSameFunction(validator, value1, value2) {
if (!validator.isFunction(value1) || !validator.isFunction(value2)) {
return false;
}
var function1Name = value1.substring(0, value1.indexOf('('));
var function2Name = value2.substring(0, value2.indexOf('('));
return function1Name === function2Name;
}
function backgroundPosition(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !(validator.isBackgroundPositionKeyword(value2) || validator.isGlobal(value2))) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
} else if (validator.isBackgroundPositionKeyword(value2) || validator.isGlobal(value2)) {
return true;
}
return unit(validator, value1, value2);
}
function backgroundSize(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !(validator.isBackgroundSizeKeyword(value2) || validator.isGlobal(value2))) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
} else if (validator.isBackgroundSizeKeyword(value2) || validator.isGlobal(value2)) {
return true;
}
return unit(validator, value1, value2);
}
function color(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !validator.isColor(value2)) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
} else if (!validator.colorOpacity && (validator.isRgbColor(value1) || validator.isHslColor(value1))) {
return false;
} else if (!validator.colorOpacity && (validator.isRgbColor(value2) || validator.isHslColor(value2))) {
return false;
} else if (validator.isColor(value1) && validator.isColor(value2)) {
return true;
}
return sameFunctionOrValue(validator, value1, value2);
}
function components(overrideCheckers) {
return function (validator, value1, value2, position) {
return overrideCheckers[position](validator, value1, value2);
};
}
function fontFamily(validator, value1, value2) {
return understandable(validator, value1, value2, 0, true);
}
function image(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !validator.isImage(value2)) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
} else if (validator.isImage(value2)) {
return true;
} else if (validator.isImage(value1)) {
return false;
}
return sameFunctionOrValue(validator, value1, value2);
}
function keyword(propertyName) {
return function(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !validator.isKeyword(propertyName)(value2)) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
}
return validator.isKeyword(propertyName)(value2);
};
}
function keywordWithGlobal(propertyName) {
return function(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !(validator.isKeyword(propertyName)(value2) || validator.isGlobal(value2))) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
}
return validator.isKeyword(propertyName)(value2) || validator.isGlobal(value2);
};
}
function propertyName(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !validator.isIdentifier(value2)) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
}
return validator.isIdentifier(value2);
}
function sameFunctionOrValue(validator, value1, value2) {
return areSameFunction(validator, value1, value2) ?
true :
value1 === value2;
}
function textShadow(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !(validator.isUnit(value2) || validator.isColor(value2) || validator.isGlobal(value2))) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
}
return validator.isUnit(value2) || validator.isColor(value2) || validator.isGlobal(value2);
}
function time(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !validator.isTime(value2)) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
} else if (validator.isTime(value1) && !validator.isTime(value2)) {
return false;
} else if (validator.isTime(value2)) {
return true;
} else if (validator.isTime(value1)) {
return false;
} else if (validator.isFunction(value1) && !validator.isPrefixed(value1) && validator.isFunction(value2) && !validator.isPrefixed(value2)) {
return true;
}
return sameFunctionOrValue(validator, value1, value2);
}
function timingFunction(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !(validator.isTimingFunction(value2) || validator.isGlobal(value2))) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
}
return validator.isTimingFunction(value2) || validator.isGlobal(value2);
}
function unit(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !validator.isUnit(value2)) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
} else if (validator.isUnit(value1) && !validator.isUnit(value2)) {
return false;
} else if (validator.isUnit(value2)) {
return true;
} else if (validator.isUnit(value1)) {
return false;
} else if (validator.isFunction(value1) && !validator.isPrefixed(value1) && validator.isFunction(value2) && !validator.isPrefixed(value2)) {
return true;
}
return sameFunctionOrValue(validator, value1, value2);
}
function unitOrKeywordWithGlobal(propertyName) {
var byKeyword = keywordWithGlobal(propertyName);
return function(validator, value1, value2) {
return unit(validator, value1, value2) || byKeyword(validator, value1, value2);
};
}
function unitOrNumber(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !(validator.isUnit(value2) || validator.isNumber(value2))) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
} else if ((validator.isUnit(value1) || validator.isNumber(value1)) && !(validator.isUnit(value2) || validator.isNumber(value2))) {
return false;
} else if (validator.isUnit(value2) || validator.isNumber(value2)) {
return true;
} else if (validator.isUnit(value1) || validator.isNumber(value1)) {
return false;
} else if (validator.isFunction(value1) && !validator.isPrefixed(value1) && validator.isFunction(value2) && !validator.isPrefixed(value2)) {
return true;
}
return sameFunctionOrValue(validator, value1, value2);
}
function zIndex(validator, value1, value2) {
if (!understandable(validator, value1, value2, 0, true) && !validator.isZIndex(value2)) {
return false;
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
return true;
}
return validator.isZIndex(value2);
}
module.exports = {
generic: {
color: color,
components: components,
image: image,
propertyName: propertyName,
time: time,
timingFunction: timingFunction,
unit: unit,
unitOrNumber: unitOrNumber
},
property: {
animationDirection: keywordWithGlobal('animation-direction'),
animationFillMode: keyword('animation-fill-mode'),
animationIterationCount: animationIterationCount,
animationName: animationName,
animationPlayState: keywordWithGlobal('animation-play-state'),
backgroundAttachment: keyword('background-attachment'),
backgroundClip: keywordWithGlobal('background-clip'),
backgroundOrigin: keyword('background-origin'),
backgroundPosition: backgroundPosition,
backgroundRepeat: keyword('background-repeat'),
backgroundSize: backgroundSize,
bottom: unitOrKeywordWithGlobal('bottom'),
borderCollapse: keyword('border-collapse'),
borderStyle: keywordWithGlobal('*-style'),
clear: keywordWithGlobal('clear'),
cursor: keywordWithGlobal('cursor'),
display: keywordWithGlobal('display'),
float: keywordWithGlobal('float'),
left: unitOrKeywordWithGlobal('left'),
fontFamily: fontFamily,
fontStretch: keywordWithGlobal('font-stretch'),
fontStyle: keywordWithGlobal('font-style'),
fontVariant: keywordWithGlobal('font-variant'),
fontWeight: keywordWithGlobal('font-weight'),
listStyleType: keywordWithGlobal('list-style-type'),
listStylePosition: keywordWithGlobal('list-style-position'),
outlineStyle: keywordWithGlobal('*-style'),
overflow: keywordWithGlobal('overflow'),
position: keywordWithGlobal('position'),
right: unitOrKeywordWithGlobal('right'),
textAlign: keywordWithGlobal('text-align'),
textDecoration: keywordWithGlobal('text-decoration'),
textOverflow: keywordWithGlobal('text-overflow'),
textShadow: textShadow,
top: unitOrKeywordWithGlobal('top'),
transform: sameFunctionOrValue,
verticalAlign: unitOrKeywordWithGlobal('vertical-align'),
visibility: keywordWithGlobal('visibility'),
whiteSpace: keywordWithGlobal('white-space'),
zIndex: zIndex
}
};
node_modules/clean-css/lib/optimizer/level-2/merge-adjacent.js 0000666 00000004221 15042511722 0020335 0 ustar 00 var isMergeable = require('./is-mergeable');
var optimizeProperties = require('./properties/optimize');
var sortSelectors = require('../level-1/sort-selectors');
var tidyRules = require('../level-1/tidy-rules');
var OptimizationLevel = require('../../options/optimization-level').OptimizationLevel;
var serializeBody = require('../../writer/one-time').body;
var serializeRules = require('../../writer/one-time').rules;
var Token = require('../../tokenizer/token');
function mergeAdjacent(tokens, context) {
var lastToken = [null, [], []];
var options = context.options;
var adjacentSpace = options.compatibility.selectors.adjacentSpace;
var selectorsSortingMethod = options.level[OptimizationLevel.One].selectorsSortingMethod;
var mergeablePseudoClasses = options.compatibility.selectors.mergeablePseudoClasses;
var mergeablePseudoElements = options.compatibility.selectors.mergeablePseudoElements;
var mergeLimit = options.compatibility.selectors.mergeLimit;
var multiplePseudoMerging = options.compatibility.selectors.multiplePseudoMerging;
for (var i = 0, l = tokens.length; i < l; i++) {
var token = tokens[i];
if (token[0] != Token.RULE) {
lastToken = [null, [], []];
continue;
}
if (lastToken[0] == Token.RULE && serializeRules(token[1]) == serializeRules(lastToken[1])) {
Array.prototype.push.apply(lastToken[2], token[2]);
optimizeProperties(lastToken[2], true, true, context);
token[2] = [];
} else if (lastToken[0] == Token.RULE && serializeBody(token[2]) == serializeBody(lastToken[2]) &&
isMergeable(serializeRules(token[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) &&
isMergeable(serializeRules(lastToken[1]), mergeablePseudoClasses, mergeablePseudoElements, multiplePseudoMerging) &&
lastToken[1].length < mergeLimit) {
lastToken[1] = tidyRules(lastToken[1].concat(token[1]), false, adjacentSpace, false, context.warnings);
lastToken[1] = lastToken.length > 1 ? sortSelectors(lastToken[1], selectorsSortingMethod) : lastToken[1];
token[2] = [];
} else {
lastToken = token;
}
}
}
module.exports = mergeAdjacent;
node_modules/clean-css/lib/optimizer/wrap-for-optimizing.js 0000666 00000011576 15042511722 0020160 0 ustar 00 var Hack = require('./hack');
var Marker = require('../tokenizer/marker');
var Token = require('../tokenizer/token');
var Match = {
ASTERISK: '*',
BACKSLASH: '\\',
BANG: '!',
BANG_SUFFIX_PATTERN: /!\w+$/,
IMPORTANT_TOKEN: '!important',
IMPORTANT_TOKEN_PATTERN: new RegExp('!important$', 'i'),
IMPORTANT_WORD: 'important',
IMPORTANT_WORD_PATTERN: new RegExp('important$', 'i'),
SUFFIX_BANG_PATTERN: /!$/,
UNDERSCORE: '_',
VARIABLE_REFERENCE_PATTERN: /var\(--.+\)$/
};
function wrapAll(properties, includeVariable, skipProperties) {
var wrapped = [];
var single;
var property;
var i;
for (i = properties.length - 1; i >= 0; i--) {
property = properties[i];
if (property[0] != Token.PROPERTY) {
continue;
}
if (!includeVariable && someVariableReferences(property)) {
continue;
}
if (skipProperties && skipProperties.indexOf(property[1][1]) > -1) {
continue;
}
single = wrapSingle(property);
single.all = properties;
single.position = i;
wrapped.unshift(single);
}
return wrapped;
}
function someVariableReferences(property) {
var i, l;
var value;
// skipping `property` and property name tokens
for (i = 2, l = property.length; i < l; i++) {
value = property[i];
if (value[0] != Token.PROPERTY_VALUE) {
continue;
}
if (isVariableReference(value[1])) {
return true;
}
}
return false;
}
function isVariableReference(value) {
return Match.VARIABLE_REFERENCE_PATTERN.test(value);
}
function isMultiplex(property) {
var value;
var i, l;
for (i = 3, l = property.length; i < l; i++) {
value = property[i];
if (value[0] == Token.PROPERTY_VALUE && (value[1] == Marker.COMMA || value[1] == Marker.FORWARD_SLASH)) {
return true;
}
}
return false;
}
function hackFrom(property) {
var match = false;
var name = property[1][1];
var lastValue = property[property.length - 1];
if (name[0] == Match.UNDERSCORE) {
match = [Hack.UNDERSCORE];
} else if (name[0] == Match.ASTERISK) {
match = [Hack.ASTERISK];
} else if (lastValue[1][0] == Match.BANG && !lastValue[1].match(Match.IMPORTANT_WORD_PATTERN)) {
match = [Hack.BANG];
} else if (lastValue[1].indexOf(Match.BANG) > 0 && !lastValue[1].match(Match.IMPORTANT_WORD_PATTERN) && Match.BANG_SUFFIX_PATTERN.test(lastValue[1])) {
match = [Hack.BANG];
} else if (lastValue[1].indexOf(Match.BACKSLASH) > 0 && lastValue[1].indexOf(Match.BACKSLASH) == lastValue[1].length - Match.BACKSLASH.length - 1) {
match = [Hack.BACKSLASH, lastValue[1].substring(lastValue[1].indexOf(Match.BACKSLASH) + 1)];
} else if (lastValue[1].indexOf(Match.BACKSLASH) === 0 && lastValue[1].length == 2) {
match = [Hack.BACKSLASH, lastValue[1].substring(1)];
}
return match;
}
function isImportant(property) {
if (property.length < 3)
return false;
var lastValue = property[property.length - 1];
if (Match.IMPORTANT_TOKEN_PATTERN.test(lastValue[1])) {
return true;
} else if (Match.IMPORTANT_WORD_PATTERN.test(lastValue[1]) && Match.SUFFIX_BANG_PATTERN.test(property[property.length - 2][1])) {
return true;
}
return false;
}
function stripImportant(property) {
var lastValue = property[property.length - 1];
var oneButLastValue = property[property.length - 2];
if (Match.IMPORTANT_TOKEN_PATTERN.test(lastValue[1])) {
lastValue[1] = lastValue[1].replace(Match.IMPORTANT_TOKEN_PATTERN, '');
} else {
lastValue[1] = lastValue[1].replace(Match.IMPORTANT_WORD_PATTERN, '');
oneButLastValue[1] = oneButLastValue[1].replace(Match.SUFFIX_BANG_PATTERN, '');
}
if (lastValue[1].length === 0) {
property.pop();
}
if (oneButLastValue[1].length === 0) {
property.pop();
}
}
function stripPrefixHack(property) {
property[1][1] = property[1][1].substring(1);
}
function stripSuffixHack(property, hackFrom) {
var lastValue = property[property.length - 1];
lastValue[1] = lastValue[1]
.substring(0, lastValue[1].indexOf(hackFrom[0] == Hack.BACKSLASH ? Match.BACKSLASH : Match.BANG))
.trim();
if (lastValue[1].length === 0) {
property.pop();
}
}
function wrapSingle(property) {
var importantProperty = isImportant(property);
if (importantProperty) {
stripImportant(property);
}
var whichHack = hackFrom(property);
if (whichHack[0] == Hack.ASTERISK || whichHack[0] == Hack.UNDERSCORE) {
stripPrefixHack(property);
} else if (whichHack[0] == Hack.BACKSLASH || whichHack[0] == Hack.BANG) {
stripSuffixHack(property, whichHack);
}
return {
block: property[2] && property[2][0] == Token.PROPERTY_BLOCK,
components: [],
dirty: false,
hack: whichHack,
important: importantProperty,
name: property[1][1],
multiplex: property.length > 3 ? isMultiplex(property) : false,
position: 0,
shorthand: false,
unused: false,
value: property.slice(2)
};
}
module.exports = {
all: wrapAll,
single: wrapSingle
};
node_modules/clean-css/lib/optimizer/level-1/shorten-rgb.js 0000666 00000000702 15042511722 0017720 0 ustar 00 function shortenRgb(red, green, blue) {
var normalizedRed = Math.max(0, Math.min(parseInt(red), 255));
var normalizedGreen = Math.max(0, Math.min(parseInt(green), 255));
var normalizedBlue = Math.max(0, Math.min(parseInt(blue), 255));
// Credit: Asen http://jsbin.com/UPUmaGOc/2/edit?js,console
return '#' + ('00000' + (normalizedRed << 16 | normalizedGreen << 8 | normalizedBlue).toString(16)).slice(-6);
}
module.exports = shortenRgb;
node_modules/clean-css/lib/optimizer/level-1/optimize.js 0000666 00000051122 15042511722 0017330 0 ustar 00 var shortenHex = require('./shorten-hex');
var shortenHsl = require('./shorten-hsl');
var shortenRgb = require('./shorten-rgb');
var sortSelectors = require('./sort-selectors');
var tidyRules = require('./tidy-rules');
var tidyBlock = require('./tidy-block');
var tidyAtRule = require('./tidy-at-rule');
var Hack = require('../hack');
var removeUnused = require('../remove-unused');
var restoreFromOptimizing = require('../restore-from-optimizing');
var wrapForOptimizing = require('../wrap-for-optimizing').all;
var OptimizationLevel = require('../../options/optimization-level').OptimizationLevel;
var Token = require('../../tokenizer/token');
var Marker = require('../../tokenizer/marker');
var formatPosition = require('../../utils/format-position');
var split = require('../../utils/split');
var serializeRules = require('../../writer/one-time').rules;
var IgnoreProperty = 'ignore-property';
var CHARSET_TOKEN = '@charset';
var CHARSET_REGEXP = new RegExp('^' + CHARSET_TOKEN, 'i');
var DEFAULT_ROUNDING_PRECISION = require('../../options/rounding-precision').DEFAULT;
var WHOLE_PIXEL_VALUE = /(?:^|\s|\()(-?\d+)px/;
var TIME_VALUE = /^(\-?[\d\.]+)(m?s)$/;
var HEX_VALUE_PATTERN = /[0-9a-f]/i;
var PROPERTY_NAME_PATTERN = /^(?:\-chrome\-|\-[\w\-]+\w|\w[\w\-]+\w|\-\-\S+)$/;
var IMPORT_PREFIX_PATTERN = /^@import/i;
var QUOTED_PATTERN = /^('.*'|".*")$/;
var QUOTED_BUT_SAFE_PATTERN = /^['"][a-zA-Z][a-zA-Z\d\-_]+['"]$/;
var URL_PREFIX_PATTERN = /^url\(/i;
var LOCAL_PREFIX_PATTERN = /^local\(/i;
var VARIABLE_NAME_PATTERN = /^--\S+$/;
function isLocal(value){
return LOCAL_PREFIX_PATTERN.test(value);
}
function isNegative(value) {
return value && value[1][0] == '-' && parseFloat(value[1]) < 0;
}
function isQuoted(value) {
return QUOTED_PATTERN.test(value);
}
function isUrl(value) {
return URL_PREFIX_PATTERN.test(value);
}
function normalizeUrl(value) {
return value
.replace(URL_PREFIX_PATTERN, 'url(')
.replace(/\\?\n|\\?\r\n/g, '');
}
function optimizeBackground(property) {
var values = property.value;
if (values.length == 1 && values[0][1] == 'none') {
values[0][1] = '0 0';
}
if (values.length == 1 && values[0][1] == 'transparent') {
values[0][1] = '0 0';
}
}
function optimizeBorderRadius(property) {
var values = property.value;
var spliceAt;
if (values.length == 3 && values[1][1] == '/' && values[0][1] == values[2][1]) {
spliceAt = 1;
} else if (values.length == 5 && values[2][1] == '/' && values[0][1] == values[3][1] && values[1][1] == values[4][1]) {
spliceAt = 2;
} else if (values.length == 7 && values[3][1] == '/' && values[0][1] == values[4][1] && values[1][1] == values[5][1] && values[2][1] == values[6][1]) {
spliceAt = 3;
} else if (values.length == 9 && values[4][1] == '/' && values[0][1] == values[5][1] && values[1][1] == values[6][1] && values[2][1] == values[7][1] && values[3][1] == values[8][1]) {
spliceAt = 4;
}
if (spliceAt) {
property.value.splice(spliceAt);
property.dirty = true;
}
}
/**
* @param {string} name
* @param {string} value
* @param {Object} compatibility
* @return {string}
*/
function optimizeColors(name, value, compatibility) {
if (!value.match(/#|rgb|hsl/gi)) {
return shortenHex(value);
}
value = value
.replace(/(rgb|hsl)a?\((\-?\d+),(\-?\d+\%?),(\-?\d+\%?),(0*[1-9]+[0-9]*(\.?\d*)?)\)/gi, function (match, colorFn, p1, p2, p3, alpha) {
return (parseInt(alpha, 10) >= 1 ? colorFn + '(' + [p1,p2,p3].join(',') + ')' : match);
})
.replace(/rgb\((\-?\d+),(\-?\d+),(\-?\d+)\)/gi, function (match, red, green, blue) {
return shortenRgb(red, green, blue);
})
.replace(/hsl\((-?\d+),(-?\d+)%?,(-?\d+)%?\)/gi, function (match, hue, saturation, lightness) {
return shortenHsl(hue, saturation, lightness);
})
.replace(/(^|[^='"])#([0-9a-f]{6})/gi, function (match, prefix, color, at, inputValue) {
var suffix = inputValue[at + match.length];
if (suffix && HEX_VALUE_PATTERN.test(suffix)) {
return match;
} else if (color[0] == color[1] && color[2] == color[3] && color[4] == color[5]) {
return (prefix + '#' + color[0] + color[2] + color[4]).toLowerCase();
} else {
return (prefix + '#' + color).toLowerCase();
}
})
.replace(/(^|[^='"])#([0-9a-f]{3})/gi, function (match, prefix, color) {
return prefix + '#' + color.toLowerCase();
})
.replace(/(rgb|rgba|hsl|hsla)\(([^\)]+)\)/gi, function (match, colorFunction, colorDef) {
var tokens = colorDef.split(',');
var colorFnLowercase = colorFunction && colorFunction.toLowerCase();
var applies = (colorFnLowercase == 'hsl' && tokens.length == 3) ||
(colorFnLowercase == 'hsla' && tokens.length == 4) ||
(colorFnLowercase == 'rgb' && tokens.length === 3 && colorDef.indexOf('%') > 0) ||
(colorFnLowercase == 'rgba' && tokens.length == 4 && colorDef.indexOf('%') > 0);
if (!applies) {
return match;
}
if (tokens[1].indexOf('%') == -1) {
tokens[1] += '%';
}
if (tokens[2].indexOf('%') == -1) {
tokens[2] += '%';
}
return colorFunction + '(' + tokens.join(',') + ')';
});
if (compatibility.colors.opacity && name.indexOf('background') == -1) {
value = value.replace(/(?:rgba|hsla)\(0,0%?,0%?,0\)/g, function (match) {
if (split(value, ',').pop().indexOf('gradient(') > -1) {
return match;
}
return 'transparent';
});
}
return shortenHex(value);
}
function optimizeFilter(property) {
if (property.value.length == 1) {
property.value[0][1] = property.value[0][1].replace(/progid:DXImageTransform\.Microsoft\.(Alpha|Chroma)(\W)/, function (match, filter, suffix) {
return filter.toLowerCase() + suffix;
});
}
property.value[0][1] = property.value[0][1]
.replace(/,(\S)/g, ', $1')
.replace(/ ?= ?/g, '=');
}
function optimizeFontWeight(property, atIndex) {
var value = property.value[atIndex][1];
if (value == 'normal') {
value = '400';
} else if (value == 'bold') {
value = '700';
}
property.value[atIndex][1] = value;
}
function optimizeMultipleZeros(property) {
var values = property.value;
var spliceAt;
if (values.length == 4 && values[0][1] === '0' && values[1][1] === '0' && values[2][1] === '0' && values[3][1] === '0') {
if (property.name.indexOf('box-shadow') > -1) {
spliceAt = 2;
} else {
spliceAt = 1;
}
}
if (spliceAt) {
property.value.splice(spliceAt);
property.dirty = true;
}
}
function optimizeOutline(property) {
var values = property.value;
if (values.length == 1 && values[0][1] == 'none') {
values[0][1] = '0';
}
}
function optimizePixelLengths(_, value, compatibility) {
if (!WHOLE_PIXEL_VALUE.test(value)) {
return value;
}
return value.replace(WHOLE_PIXEL_VALUE, function (match, val) {
var newValue;
var intVal = parseInt(val);
if (intVal === 0) {
return match;
}
if (compatibility.properties.shorterLengthUnits && compatibility.units.pt && intVal * 3 % 4 === 0) {
newValue = intVal * 3 / 4 + 'pt';
}
if (compatibility.properties.shorterLengthUnits && compatibility.units.pc && intVal % 16 === 0) {
newValue = intVal / 16 + 'pc';
}
if (compatibility.properties.shorterLengthUnits && compatibility.units.in && intVal % 96 === 0) {
newValue = intVal / 96 + 'in';
}
if (newValue) {
newValue = match.substring(0, match.indexOf(val)) + newValue;
}
return newValue && newValue.length < match.length ? newValue : match;
});
}
function optimizePrecision(_, value, precisionOptions) {
if (!precisionOptions.enabled || value.indexOf('.') === -1) {
return value;
}
return value
.replace(precisionOptions.decimalPointMatcher, '$1$2$3')
.replace(precisionOptions.zeroMatcher, function (match, integerPart, fractionPart, unit) {
var multiplier = precisionOptions.units[unit].multiplier;
var parsedInteger = parseInt(integerPart);
var integer = isNaN(parsedInteger) ? 0 : parsedInteger;
var fraction = parseFloat(fractionPart);
return Math.round((integer + fraction) * multiplier) / multiplier + unit;
});
}
function optimizeTimeUnits(_, value) {
if (!TIME_VALUE.test(value))
return value;
return value.replace(TIME_VALUE, function (match, val, unit) {
var newValue;
if (unit == 'ms') {
newValue = parseInt(val) / 1000 + 's';
} else if (unit == 's') {
newValue = parseFloat(val) * 1000 + 'ms';
}
return newValue.length < match.length ? newValue : match;
});
}
function optimizeUnits(name, value, unitsRegexp) {
if (/^(?:\-moz\-calc|\-webkit\-calc|calc|rgb|hsl|rgba|hsla)\(/.test(value)) {
return value;
}
if (name == 'flex' || name == '-ms-flex' || name == '-webkit-flex' || name == 'flex-basis' || name == '-webkit-flex-basis') {
return value;
}
if (value.indexOf('%') > 0 && (name == 'height' || name == 'max-height' || name == 'width' || name == 'max-width')) {
return value;
}
return value
.replace(unitsRegexp, '$1' + '0' + '$2')
.replace(unitsRegexp, '$1' + '0' + '$2');
}
function optimizeWhitespace(name, value) {
if (name.indexOf('filter') > -1 || value.indexOf(' ') == -1 || value.indexOf('expression') === 0) {
return value;
}
if (value.indexOf(Marker.SINGLE_QUOTE) > -1 || value.indexOf(Marker.DOUBLE_QUOTE) > -1) {
return value;
}
value = value.replace(/\s+/g, ' ');
if (value.indexOf('calc') > -1) {
value = value.replace(/\) ?\/ ?/g, ')/ ');
}
return value
.replace(/(\(;?)\s+/g, '$1')
.replace(/\s+(;?\))/g, '$1')
.replace(/, /g, ',');
}
function optimizeZeroDegUnit(_, value) {
if (value.indexOf('0deg') == -1) {
return value;
}
return value.replace(/\(0deg\)/g, '(0)');
}
function optimizeZeroUnits(name, value) {
if (value.indexOf('0') == -1) {
return value;
}
if (value.indexOf('-') > -1) {
value = value
.replace(/([^\w\d\-]|^)\-0([^\.]|$)/g, '$10$2')
.replace(/([^\w\d\-]|^)\-0([^\.]|$)/g, '$10$2');
}
return value
.replace(/(^|\s)0+([1-9])/g, '$1$2')
.replace(/(^|\D)\.0+(\D|$)/g, '$10$2')
.replace(/(^|\D)\.0+(\D|$)/g, '$10$2')
.replace(/\.([1-9]*)0+(\D|$)/g, function (match, nonZeroPart, suffix) {
return (nonZeroPart.length > 0 ? '.' : '') + nonZeroPart + suffix;
})
.replace(/(^|\D)0\.(\d)/g, '$1.$2');
}
function removeQuotes(name, value) {
if (name == 'content' || name.indexOf('font-variation-settings') > -1 || name.indexOf('font-feature-settings') > -1 || name == 'grid' || name.indexOf('grid-') > -1) {
return value;
}
return QUOTED_BUT_SAFE_PATTERN.test(value) ?
value.substring(1, value.length - 1) :
value;
}
function removeUrlQuotes(value) {
return /^url\(['"].+['"]\)$/.test(value) && !/^url\(['"].*[\*\s\(\)'"].*['"]\)$/.test(value) && !/^url\(['"]data:[^;]+;charset/.test(value) ?
value.replace(/["']/g, '') :
value;
}
function transformValue(propertyName, propertyValue, rule, transformCallback) {
var selector = serializeRules(rule);
var transformedValue = transformCallback(propertyName, propertyValue, selector);
if (transformedValue === undefined) {
return propertyValue;
} else if (transformedValue === false) {
return IgnoreProperty;
} else {
return transformedValue;
}
}
//
function optimizeBody(rule, properties, context) {
var options = context.options;
var levelOptions = options.level[OptimizationLevel.One];
var property, name, type, value;
var valueIsUrl;
var propertyToken;
var _properties = wrapForOptimizing(properties, true);
propertyLoop:
for (var i = 0, l = _properties.length; i < l; i++) {
property = _properties[i];
name = property.name;
if (!PROPERTY_NAME_PATTERN.test(name)) {
propertyToken = property.all[property.position];
context.warnings.push('Invalid property name \'' + name + '\' at ' + formatPosition(propertyToken[1][2][0]) + '. Ignoring.');
property.unused = true;
}
if (property.value.length === 0) {
propertyToken = property.all[property.position];
context.warnings.push('Empty property \'' + name + '\' at ' + formatPosition(propertyToken[1][2][0]) + '. Ignoring.');
property.unused = true;
}
if (property.hack && (
(property.hack[0] == Hack.ASTERISK || property.hack[0] == Hack.UNDERSCORE) && !options.compatibility.properties.iePrefixHack ||
property.hack[0] == Hack.BACKSLASH && !options.compatibility.properties.ieSuffixHack ||
property.hack[0] == Hack.BANG && !options.compatibility.properties.ieBangHack)) {
property.unused = true;
}
if (levelOptions.removeNegativePaddings && name.indexOf('padding') === 0 && (isNegative(property.value[0]) || isNegative(property.value[1]) || isNegative(property.value[2]) || isNegative(property.value[3]))) {
property.unused = true;
}
if (!options.compatibility.properties.ieFilters && isLegacyFilter(property)) {
property.unused = true;
}
if (property.unused) {
continue;
}
if (property.block) {
optimizeBody(rule, property.value[0][1], context);
continue;
}
if (VARIABLE_NAME_PATTERN.test(name)) {
continue;
}
for (var j = 0, m = property.value.length; j < m; j++) {
type = property.value[j][0];
value = property.value[j][1];
valueIsUrl = isUrl(value);
if (type == Token.PROPERTY_BLOCK) {
property.unused = true;
context.warnings.push('Invalid value token at ' + formatPosition(value[0][1][2][0]) + '. Ignoring.');
break;
}
if (valueIsUrl && !context.validator.isUrl(value)) {
property.unused = true;
context.warnings.push('Broken URL \'' + value + '\' at ' + formatPosition(property.value[j][2][0]) + '. Ignoring.');
break;
}
if (valueIsUrl) {
value = levelOptions.normalizeUrls ?
normalizeUrl(value) :
value;
value = !options.compatibility.properties.urlQuotes ?
removeUrlQuotes(value) :
value;
} else if (isQuoted(value) || isLocal(value)) {
value = levelOptions.removeQuotes ?
removeQuotes(name, value) :
value;
} else {
value = levelOptions.removeWhitespace ?
optimizeWhitespace(name, value) :
value;
value = optimizePrecision(name, value, options.precision);
value = optimizePixelLengths(name, value, options.compatibility);
value = levelOptions.replaceTimeUnits ?
optimizeTimeUnits(name, value) :
value;
value = levelOptions.replaceZeroUnits ?
optimizeZeroUnits(name, value) :
value;
if (options.compatibility.properties.zeroUnits) {
value = optimizeZeroDegUnit(name, value);
value = optimizeUnits(name, value, options.unitsRegexp);
}
if (options.compatibility.properties.colors) {
value = optimizeColors(name, value, options.compatibility);
}
}
value = transformValue(name, value, rule, levelOptions.transform);
if (value === IgnoreProperty) {
property.unused = true;
continue propertyLoop;
}
property.value[j][1] = value;
}
if (levelOptions.replaceMultipleZeros) {
optimizeMultipleZeros(property);
}
if (name == 'background' && levelOptions.optimizeBackground) {
optimizeBackground(property);
} else if (name.indexOf('border') === 0 && name.indexOf('radius') > 0 && levelOptions.optimizeBorderRadius) {
optimizeBorderRadius(property);
} else if (name == 'filter'&& levelOptions.optimizeFilter && options.compatibility.properties.ieFilters) {
optimizeFilter(property);
} else if (name == 'font-weight' && levelOptions.optimizeFontWeight) {
optimizeFontWeight(property, 0);
} else if (name == 'outline' && levelOptions.optimizeOutline) {
optimizeOutline(property);
}
}
restoreFromOptimizing(_properties);
removeUnused(_properties);
removeComments(properties, options);
}
function removeComments(tokens, options) {
var token;
var i;
for (i = 0; i < tokens.length; i++) {
token = tokens[i];
if (token[0] != Token.COMMENT) {
continue;
}
optimizeComment(token, options);
if (token[1].length === 0) {
tokens.splice(i, 1);
i--;
}
}
}
function optimizeComment(token, options) {
if (token[1][2] == Marker.EXCLAMATION && (options.level[OptimizationLevel.One].specialComments == 'all' || options.commentsKept < options.level[OptimizationLevel.One].specialComments)) {
options.commentsKept++;
return;
}
token[1] = [];
}
function cleanupCharsets(tokens) {
var hasCharset = false;
for (var i = 0, l = tokens.length; i < l; i++) {
var token = tokens[i];
if (token[0] != Token.AT_RULE)
continue;
if (!CHARSET_REGEXP.test(token[1]))
continue;
if (hasCharset || token[1].indexOf(CHARSET_TOKEN) == -1) {
tokens.splice(i, 1);
i--;
l--;
} else {
hasCharset = true;
tokens.splice(i, 1);
tokens.unshift([Token.AT_RULE, token[1].replace(CHARSET_REGEXP, CHARSET_TOKEN)]);
}
}
}
function buildUnitRegexp(options) {
var units = ['px', 'em', 'ex', 'cm', 'mm', 'in', 'pt', 'pc', '%'];
var otherUnits = ['ch', 'rem', 'vh', 'vm', 'vmax', 'vmin', 'vw'];
otherUnits.forEach(function (unit) {
if (options.compatibility.units[unit]) {
units.push(unit);
}
});
return new RegExp('(^|\\s|\\(|,)0(?:' + units.join('|') + ')(\\W|$)', 'g');
}
function buildPrecisionOptions(roundingPrecision) {
var precisionOptions = {
matcher: null,
units: {},
};
var optimizable = [];
var unit;
var value;
for (unit in roundingPrecision) {
value = roundingPrecision[unit];
if (value != DEFAULT_ROUNDING_PRECISION) {
precisionOptions.units[unit] = {};
precisionOptions.units[unit].value = value;
precisionOptions.units[unit].multiplier = Math.pow(10, value);
optimizable.push(unit);
}
}
if (optimizable.length > 0) {
precisionOptions.enabled = true;
precisionOptions.decimalPointMatcher = new RegExp('(\\d)\\.($|' + optimizable.join('|') + ')($|\\W)', 'g');
precisionOptions.zeroMatcher = new RegExp('(\\d*)(\\.\\d+)(' + optimizable.join('|') + ')', 'g');
}
return precisionOptions;
}
function isImport(token) {
return IMPORT_PREFIX_PATTERN.test(token[1]);
}
function isLegacyFilter(property) {
var value;
if (property.name == 'filter' || property.name == '-ms-filter') {
value = property.value[0][1];
return value.indexOf('progid') > -1 ||
value.indexOf('alpha') === 0 ||
value.indexOf('chroma') === 0;
} else {
return false;
}
}
function level1Optimize(tokens, context) {
var options = context.options;
var levelOptions = options.level[OptimizationLevel.One];
var ie7Hack = options.compatibility.selectors.ie7Hack;
var adjacentSpace = options.compatibility.selectors.adjacentSpace;
var spaceAfterClosingBrace = options.compatibility.properties.spaceAfterClosingBrace;
var format = options.format;
var mayHaveCharset = false;
var afterRules = false;
options.unitsRegexp = options.unitsRegexp || buildUnitRegexp(options);
options.precision = options.precision || buildPrecisionOptions(levelOptions.roundingPrecision);
options.commentsKept = options.commentsKept || 0;
for (var i = 0, l = tokens.length; i < l; i++) {
var token = tokens[i];
switch (token[0]) {
case Token.AT_RULE:
token[1] = isImport(token) && afterRules ? '' : token[1];
token[1] = levelOptions.tidyAtRules ? tidyAtRule(token[1]) : token[1];
mayHaveCharset = true;
break;
case Token.AT_RULE_BLOCK:
optimizeBody(token[1], token[2], context);
afterRules = true;
break;
case Token.NESTED_BLOCK:
token[1] = levelOptions.tidyBlockScopes ? tidyBlock(token[1], spaceAfterClosingBrace) : token[1];
level1Optimize(token[2], context);
afterRules = true;
break;
case Token.COMMENT:
optimizeComment(token, options);
break;
case Token.RULE:
token[1] = levelOptions.tidySelectors ? tidyRules(token[1], !ie7Hack, adjacentSpace, format, context.warnings) : token[1];
token[1] = token[1].length > 1 ? sortSelectors(token[1], levelOptions.selectorsSortingMethod) : token[1];
optimizeBody(token[1], token[2], context);
afterRules = true;
break;
}
if (token[0] == Token.COMMENT && token[1].length === 0 || levelOptions.removeEmpty && (token[1].length === 0 || (token[2] && token[2].length === 0))) {
tokens.splice(i, 1);
i--;
l--;
}
}
if (levelOptions.cleanupCharsets && mayHaveCharset) {
cleanupCharsets(tokens);
}
return tokens;
}
module.exports = level1Optimize;
node_modules/clean-css/lib/optimizer/level-1/tidy-rules.js 0000666 00000015474 15042511722 0017603 0 ustar 00 var Spaces = require('../../options/format').Spaces;
var Marker = require('../../tokenizer/marker');
var formatPosition = require('../../utils/format-position');
var CASE_ATTRIBUTE_PATTERN = /[\s"'][iI]\s*\]/;
var CASE_RESTORE_PATTERN = /([\d\w])([iI])\]/g;
var DOUBLE_QUOTE_CASE_PATTERN = /="([a-zA-Z][a-zA-Z\d\-_]+)"([iI])/g;
var DOUBLE_QUOTE_PATTERN = /="([a-zA-Z][a-zA-Z\d\-_]+)"(\s|\])/g;
var HTML_COMMENT_PATTERN = /^(?:(?:)\s*)+/;
var SINGLE_QUOTE_CASE_PATTERN = /='([a-zA-Z][a-zA-Z\d\-_]+)'([iI])/g;
var SINGLE_QUOTE_PATTERN = /='([a-zA-Z][a-zA-Z\d\-_]+)'(\s|\])/g;
var RELATION_PATTERN = /[>\+~]/;
var WHITESPACE_PATTERN = /\s/;
var ASTERISK_PLUS_HTML_HACK = '*+html ';
var ASTERISK_FIRST_CHILD_PLUS_HTML_HACK = '*:first-child+html ';
var LESS_THAN = '<';
function hasInvalidCharacters(value) {
var isEscaped;
var isInvalid = false;
var character;
var isQuote = false;
var i, l;
for (i = 0, l = value.length; i < l; i++) {
character = value[i];
if (isEscaped) {
// continue as always
} else if (character == Marker.SINGLE_QUOTE || character == Marker.DOUBLE_QUOTE) {
isQuote = !isQuote;
} else if (!isQuote && (character == Marker.CLOSE_CURLY_BRACKET || character == Marker.EXCLAMATION || character == LESS_THAN || character == Marker.SEMICOLON)) {
isInvalid = true;
break;
} else if (!isQuote && i === 0 && RELATION_PATTERN.test(character)) {
isInvalid = true;
break;
}
isEscaped = character == Marker.BACK_SLASH;
}
return isInvalid;
}
function removeWhitespace(value, format) {
var stripped = [];
var character;
var isNewLineNix;
var isNewLineWin;
var isEscaped;
var wasEscaped;
var isQuoted;
var isSingleQuoted;
var isDoubleQuoted;
var isAttribute;
var isRelation;
var isWhitespace;
var roundBracketLevel = 0;
var wasRelation = false;
var wasWhitespace = false;
var withCaseAttribute = CASE_ATTRIBUTE_PATTERN.test(value);
var spaceAroundRelation = format && format.spaces[Spaces.AroundSelectorRelation];
var i, l;
for (i = 0, l = value.length; i < l; i++) {
character = value[i];
isNewLineNix = character == Marker.NEW_LINE_NIX;
isNewLineWin = character == Marker.NEW_LINE_NIX && value[i - 1] == Marker.CARRIAGE_RETURN;
isQuoted = isSingleQuoted || isDoubleQuoted;
isRelation = !isAttribute && !isEscaped && roundBracketLevel === 0 && RELATION_PATTERN.test(character);
isWhitespace = WHITESPACE_PATTERN.test(character);
if (wasEscaped && isQuoted && isNewLineWin) {
// swallow escaped new windows lines in comments
stripped.pop();
stripped.pop();
} else if (isEscaped && isQuoted && isNewLineNix) {
// swallow escaped new *nix lines in comments
stripped.pop();
} else if (isEscaped) {
stripped.push(character);
} else if (character == Marker.OPEN_SQUARE_BRACKET && !isQuoted) {
stripped.push(character);
isAttribute = true;
} else if (character == Marker.CLOSE_SQUARE_BRACKET && !isQuoted) {
stripped.push(character);
isAttribute = false;
} else if (character == Marker.OPEN_ROUND_BRACKET && !isQuoted) {
stripped.push(character);
roundBracketLevel++;
} else if (character == Marker.CLOSE_ROUND_BRACKET && !isQuoted) {
stripped.push(character);
roundBracketLevel--;
} else if (character == Marker.SINGLE_QUOTE && !isQuoted) {
stripped.push(character);
isSingleQuoted = true;
} else if (character == Marker.DOUBLE_QUOTE && !isQuoted) {
stripped.push(character);
isDoubleQuoted = true;
} else if (character == Marker.SINGLE_QUOTE && isQuoted) {
stripped.push(character);
isSingleQuoted = false;
} else if (character == Marker.DOUBLE_QUOTE && isQuoted) {
stripped.push(character);
isDoubleQuoted = false;
} else if (isWhitespace && wasRelation && !spaceAroundRelation) {
continue;
} else if (!isWhitespace && wasRelation && spaceAroundRelation) {
stripped.push(Marker.SPACE);
stripped.push(character);
} else if (isWhitespace && (isAttribute || roundBracketLevel > 0) && !isQuoted) {
// skip space
} else if (isWhitespace && wasWhitespace && !isQuoted) {
// skip extra space
} else if ((isNewLineWin || isNewLineNix) && (isAttribute || roundBracketLevel > 0) && isQuoted) {
// skip newline
} else if (isRelation && wasWhitespace && !spaceAroundRelation) {
stripped.pop();
stripped.push(character);
} else if (isRelation && !wasWhitespace && spaceAroundRelation) {
stripped.push(Marker.SPACE);
stripped.push(character);
} else if (isWhitespace) {
stripped.push(Marker.SPACE);
} else {
stripped.push(character);
}
wasEscaped = isEscaped;
isEscaped = character == Marker.BACK_SLASH;
wasRelation = isRelation;
wasWhitespace = isWhitespace;
}
return withCaseAttribute ?
stripped.join('').replace(CASE_RESTORE_PATTERN, '$1 $2]') :
stripped.join('');
}
function removeQuotes(value) {
if (value.indexOf('\'') == -1 && value.indexOf('"') == -1) {
return value;
}
return value
.replace(SINGLE_QUOTE_CASE_PATTERN, '=$1 $2')
.replace(SINGLE_QUOTE_PATTERN, '=$1$2')
.replace(DOUBLE_QUOTE_CASE_PATTERN, '=$1 $2')
.replace(DOUBLE_QUOTE_PATTERN, '=$1$2');
}
function tidyRules(rules, removeUnsupported, adjacentSpace, format, warnings) {
var list = [];
var repeated = [];
function removeHTMLComment(rule, match) {
warnings.push('HTML comment \'' + match + '\' at ' + formatPosition(rule[2][0]) + '. Removing.');
return '';
}
for (var i = 0, l = rules.length; i < l; i++) {
var rule = rules[i];
var reduced = rule[1];
reduced = reduced.replace(HTML_COMMENT_PATTERN, removeHTMLComment.bind(null, rule));
if (hasInvalidCharacters(reduced)) {
warnings.push('Invalid selector \'' + rule[1] + '\' at ' + formatPosition(rule[2][0]) + '. Ignoring.');
continue;
}
reduced = removeWhitespace(reduced, format);
reduced = removeQuotes(reduced);
if (adjacentSpace && reduced.indexOf('nav') > 0) {
reduced = reduced.replace(/\+nav(\S|$)/, '+ nav$1');
}
if (removeUnsupported && reduced.indexOf(ASTERISK_PLUS_HTML_HACK) > -1) {
continue;
}
if (removeUnsupported && reduced.indexOf(ASTERISK_FIRST_CHILD_PLUS_HTML_HACK) > -1) {
continue;
}
if (reduced.indexOf('*') > -1) {
reduced = reduced
.replace(/\*([:#\.\[])/g, '$1')
.replace(/^(\:first\-child)?\+html/, '*$1+html');
}
if (repeated.indexOf(reduced) > -1) {
continue;
}
rule[1] = reduced;
repeated.push(reduced);
list.push(rule);
}
if (list.length == 1 && list[0][1].length === 0) {
warnings.push('Empty selector \'' + list[0][1] + '\' at ' + formatPosition(list[0][2][0]) + '. Ignoring.');
list = [];
}
return list;
}
module.exports = tidyRules;
node_modules/clean-css/lib/optimizer/level-1/shorten-hex.js 0000666 00000010613 15042511722 0017734 0 ustar 00 var COLORS = {
aliceblue: '#f0f8ff',
antiquewhite: '#faebd7',
aqua: '#0ff',
aquamarine: '#7fffd4',
azure: '#f0ffff',
beige: '#f5f5dc',
bisque: '#ffe4c4',
black: '#000',
blanchedalmond: '#ffebcd',
blue: '#00f',
blueviolet: '#8a2be2',
brown: '#a52a2a',
burlywood: '#deb887',
cadetblue: '#5f9ea0',
chartreuse: '#7fff00',
chocolate: '#d2691e',
coral: '#ff7f50',
cornflowerblue: '#6495ed',
cornsilk: '#fff8dc',
crimson: '#dc143c',
cyan: '#0ff',
darkblue: '#00008b',
darkcyan: '#008b8b',
darkgoldenrod: '#b8860b',
darkgray: '#a9a9a9',
darkgreen: '#006400',
darkgrey: '#a9a9a9',
darkkhaki: '#bdb76b',
darkmagenta: '#8b008b',
darkolivegreen: '#556b2f',
darkorange: '#ff8c00',
darkorchid: '#9932cc',
darkred: '#8b0000',
darksalmon: '#e9967a',
darkseagreen: '#8fbc8f',
darkslateblue: '#483d8b',
darkslategray: '#2f4f4f',
darkslategrey: '#2f4f4f',
darkturquoise: '#00ced1',
darkviolet: '#9400d3',
deeppink: '#ff1493',
deepskyblue: '#00bfff',
dimgray: '#696969',
dimgrey: '#696969',
dodgerblue: '#1e90ff',
firebrick: '#b22222',
floralwhite: '#fffaf0',
forestgreen: '#228b22',
fuchsia: '#f0f',
gainsboro: '#dcdcdc',
ghostwhite: '#f8f8ff',
gold: '#ffd700',
goldenrod: '#daa520',
gray: '#808080',
green: '#008000',
greenyellow: '#adff2f',
grey: '#808080',
honeydew: '#f0fff0',
hotpink: '#ff69b4',
indianred: '#cd5c5c',
indigo: '#4b0082',
ivory: '#fffff0',
khaki: '#f0e68c',
lavender: '#e6e6fa',
lavenderblush: '#fff0f5',
lawngreen: '#7cfc00',
lemonchiffon: '#fffacd',
lightblue: '#add8e6',
lightcoral: '#f08080',
lightcyan: '#e0ffff',
lightgoldenrodyellow: '#fafad2',
lightgray: '#d3d3d3',
lightgreen: '#90ee90',
lightgrey: '#d3d3d3',
lightpink: '#ffb6c1',
lightsalmon: '#ffa07a',
lightseagreen: '#20b2aa',
lightskyblue: '#87cefa',
lightslategray: '#778899',
lightslategrey: '#778899',
lightsteelblue: '#b0c4de',
lightyellow: '#ffffe0',
lime: '#0f0',
limegreen: '#32cd32',
linen: '#faf0e6',
magenta: '#ff00ff',
maroon: '#800000',
mediumaquamarine: '#66cdaa',
mediumblue: '#0000cd',
mediumorchid: '#ba55d3',
mediumpurple: '#9370db',
mediumseagreen: '#3cb371',
mediumslateblue: '#7b68ee',
mediumspringgreen: '#00fa9a',
mediumturquoise: '#48d1cc',
mediumvioletred: '#c71585',
midnightblue: '#191970',
mintcream: '#f5fffa',
mistyrose: '#ffe4e1',
moccasin: '#ffe4b5',
navajowhite: '#ffdead',
navy: '#000080',
oldlace: '#fdf5e6',
olive: '#808000',
olivedrab: '#6b8e23',
orange: '#ffa500',
orangered: '#ff4500',
orchid: '#da70d6',
palegoldenrod: '#eee8aa',
palegreen: '#98fb98',
paleturquoise: '#afeeee',
palevioletred: '#db7093',
papayawhip: '#ffefd5',
peachpuff: '#ffdab9',
peru: '#cd853f',
pink: '#ffc0cb',
plum: '#dda0dd',
powderblue: '#b0e0e6',
purple: '#800080',
rebeccapurple: '#663399',
red: '#f00',
rosybrown: '#bc8f8f',
royalblue: '#4169e1',
saddlebrown: '#8b4513',
salmon: '#fa8072',
sandybrown: '#f4a460',
seagreen: '#2e8b57',
seashell: '#fff5ee',
sienna: '#a0522d',
silver: '#c0c0c0',
skyblue: '#87ceeb',
slateblue: '#6a5acd',
slategray: '#708090',
slategrey: '#708090',
snow: '#fffafa',
springgreen: '#00ff7f',
steelblue: '#4682b4',
tan: '#d2b48c',
teal: '#008080',
thistle: '#d8bfd8',
tomato: '#ff6347',
turquoise: '#40e0d0',
violet: '#ee82ee',
wheat: '#f5deb3',
white: '#fff',
whitesmoke: '#f5f5f5',
yellow: '#ff0',
yellowgreen: '#9acd32'
};
var toHex = {};
var toName = {};
for (var name in COLORS) {
var hex = COLORS[name];
if (name.length < hex.length) {
toName[hex] = name;
} else {
toHex[name] = hex;
}
}
var toHexPattern = new RegExp('(^| |,|\\))(' + Object.keys(toHex).join('|') + ')( |,|\\)|$)', 'ig');
var toNamePattern = new RegExp('(' + Object.keys(toName).join('|') + ')([^a-f0-9]|$)', 'ig');
function hexConverter(match, prefix, colorValue, suffix) {
return prefix + toHex[colorValue.toLowerCase()] + suffix;
}
function nameConverter(match, colorValue, suffix) {
return toName[colorValue.toLowerCase()] + suffix;
}
function shortenHex(value) {
var hasHex = value.indexOf('#') > -1;
var shortened = value.replace(toHexPattern, hexConverter);
if (shortened != value) {
shortened = shortened.replace(toHexPattern, hexConverter);
}
return hasHex ?
shortened.replace(toNamePattern, nameConverter) :
shortened;
}
module.exports = shortenHex;
node_modules/clean-css/lib/optimizer/level-1/tidy-at-rule.js 0000666 00000000261 15042511722 0020006 0 ustar 00 function tidyAtRule(value) {
return value
.replace(/\s+/g, ' ')
.replace(/url\(\s+/g, 'url(')
.replace(/\s+\)/g, ')')
.trim();
}
module.exports = tidyAtRule;
node_modules/clean-css/lib/optimizer/level-1/tidy-block.js 0000666 00000001263 15042511722 0017532 0 ustar 00 var SUPPORTED_COMPACT_BLOCK_MATCHER = /^@media\W/;
function tidyBlock(values, spaceAfterClosingBrace) {
var withoutSpaceAfterClosingBrace;
var i;
for (i = values.length - 1; i >= 0; i--) {
withoutSpaceAfterClosingBrace = !spaceAfterClosingBrace && SUPPORTED_COMPACT_BLOCK_MATCHER.test(values[i][1]);
values[i][1] = values[i][1]
.replace(/\n|\r\n/g, ' ')
.replace(/\s+/g, ' ')
.replace(/(,|:|\() /g, '$1')
.replace(/ \)/g, ')')
.replace(/'([a-zA-Z][a-zA-Z\d\-_]+)'/, '$1')
.replace(/"([a-zA-Z][a-zA-Z\d\-_]+)"/, '$1')
.replace(withoutSpaceAfterClosingBrace ? /\) /g : null, ')');
}
return values;
}
module.exports = tidyBlock;
node_modules/clean-css/lib/optimizer/level-1/sort-selectors.js 0000666 00000001021 15042511722 0020451 0 ustar 00 var naturalCompare = require('../../utils/natural-compare');
function naturalSorter(scope1, scope2) {
return naturalCompare(scope1[1], scope2[1]);
}
function standardSorter(scope1, scope2) {
return scope1[1] > scope2[1] ? 1 : -1;
}
function sortSelectors(selectors, method) {
switch (method) {
case 'natural':
return selectors.sort(naturalSorter);
case 'standard':
return selectors.sort(standardSorter);
case 'none':
case false:
return selectors;
}
}
module.exports = sortSelectors;
node_modules/clean-css/lib/optimizer/level-1/shorten-hsl.js 0000666 00000002600 15042511722 0017733 0 ustar 00 // HSL to RGB converter. Both methods adapted from:
// http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript
function hslToRgb(h, s, l) {
var r, g, b;
// normalize hue orientation b/w 0 and 360 degrees
h = h % 360;
if (h < 0)
h += 360;
h = ~~h / 360;
if (s < 0)
s = 0;
else if (s > 100)
s = 100;
s = ~~s / 100;
if (l < 0)
l = 0;
else if (l > 100)
l = 100;
l = ~~l / 100;
if (s === 0) {
r = g = b = l; // achromatic
} else {
var q = l < 0.5 ?
l * (1 + s) :
l + s - l * s;
var p = 2 * l - q;
r = hueToRgb(p, q, h + 1/3);
g = hueToRgb(p, q, h);
b = hueToRgb(p, q, h - 1/3);
}
return [~~(r * 255), ~~(g * 255), ~~(b * 255)];
}
function hueToRgb(p, q, t) {
if (t < 0) t += 1;
if (t > 1) t -= 1;
if (t < 1/6) return p + (q - p) * 6 * t;
if (t < 1/2) return q;
if (t < 2/3) return p + (q - p) * (2/3 - t) * 6;
return p;
}
function shortenHsl(hue, saturation, lightness) {
var asRgb = hslToRgb(hue, saturation, lightness);
var redAsHex = asRgb[0].toString(16);
var greenAsHex = asRgb[1].toString(16);
var blueAsHex = asRgb[2].toString(16);
return '#' +
((redAsHex.length == 1 ? '0' : '') + redAsHex) +
((greenAsHex.length == 1 ? '0' : '') + greenAsHex) +
((blueAsHex.length == 1 ? '0' : '') + blueAsHex);
}
module.exports = shortenHsl;
node_modules/clean-css/lib/optimizer/remove-unused.js 0000666 00000000364 15042511722 0017023 0 ustar 00 function removeUnused(properties) {
for (var i = properties.length - 1; i >= 0; i--) {
var property = properties[i];
if (property.unused) {
property.all.splice(property.position, 1);
}
}
}
module.exports = removeUnused;
node_modules/clean-css/lib/reader/input-source-map-tracker.js 0000666 00000002547 15042511722 0020313 0 ustar 00 var SourceMapConsumer = require('source-map').SourceMapConsumer;
function inputSourceMapTracker() {
var maps = {};
return {
all: all.bind(null, maps),
isTracking: isTracking.bind(null, maps),
originalPositionFor: originalPositionFor.bind(null, maps),
track: track.bind(null, maps)
};
}
function all(maps) {
return maps;
}
function isTracking(maps, source) {
return source in maps;
}
function originalPositionFor(maps, metadata, range, selectorFallbacks) {
var line = metadata[0];
var column = metadata[1];
var source = metadata[2];
var position = {
line: line,
column: column + range
};
var originalPosition;
while (!originalPosition && position.column > column) {
position.column--;
originalPosition = maps[source].originalPositionFor(position);
}
if (!originalPosition || originalPosition.column < 0) {
return metadata;
}
if (originalPosition.line === null && line > 1 && selectorFallbacks > 0) {
return originalPositionFor(maps, [line - 1, column, source], range, selectorFallbacks - 1);
}
return originalPosition.line !== null ?
toMetadata(originalPosition) :
metadata;
}
function toMetadata(asHash) {
return [asHash.line, asHash.column, asHash.source];
}
function track(maps, source, data) {
maps[source] = new SourceMapConsumer(data);
}
module.exports = inputSourceMapTracker;
node_modules/clean-css/lib/reader/normalize-path.js 0000666 00000000306 15042511722 0016373 0 ustar 00 var UNIX_SEPARATOR = '/';
var WINDOWS_SEPARATOR_PATTERN = /\\/g;
function normalizePath(path) {
return path.replace(WINDOWS_SEPARATOR_PATTERN, UNIX_SEPARATOR);
}
module.exports = normalizePath;
node_modules/clean-css/lib/reader/restore-import.js 0000666 00000000204 15042511722 0016431 0 ustar 00 function restoreImport(uri, mediaQuery) {
return ('@import ' + uri + ' ' + mediaQuery).trim();
}
module.exports = restoreImport;
node_modules/clean-css/lib/reader/read-sources.js 0000666 00000031740 15042511722 0016043 0 ustar 00 var fs = require('fs');
var path = require('path');
var applySourceMaps = require('./apply-source-maps');
var extractImportUrlAndMedia = require('./extract-import-url-and-media');
var isAllowedResource = require('./is-allowed-resource');
var loadOriginalSources = require('./load-original-sources');
var normalizePath = require('./normalize-path');
var rebase = require('./rebase');
var rebaseLocalMap = require('./rebase-local-map');
var rebaseRemoteMap = require('./rebase-remote-map');
var restoreImport = require('./restore-import');
var tokenize = require('../tokenizer/tokenize');
var Token = require('../tokenizer/token');
var Marker = require('../tokenizer/marker');
var hasProtocol = require('../utils/has-protocol');
var isImport = require('../utils/is-import');
var isRemoteResource = require('../utils/is-remote-resource');
var UNKNOWN_URI = 'uri:unknown';
function readSources(input, context, callback) {
return doReadSources(input, context, function (tokens) {
return applySourceMaps(tokens, context, function () {
return loadOriginalSources(context, function () { return callback(tokens); });
});
});
}
function doReadSources(input, context, callback) {
if (typeof input == 'string') {
return fromString(input, context, callback);
} else if (Buffer.isBuffer(input)) {
return fromString(input.toString(), context, callback);
} else if (Array.isArray(input)) {
return fromArray(input, context, callback);
} else if (typeof input == 'object') {
return fromHash(input, context, callback);
}
}
function fromString(input, context, callback) {
context.source = undefined;
context.sourcesContent[undefined] = input;
context.stats.originalSize += input.length;
return fromStyles(input, context, { inline: context.options.inline }, callback);
}
function fromArray(input, context, callback) {
var inputAsImports = input.reduce(function (accumulator, uriOrHash) {
if (typeof uriOrHash === 'string') {
return addStringSource(uriOrHash, accumulator);
} else {
return addHashSource(uriOrHash, context, accumulator);
}
}, []);
return fromStyles(inputAsImports.join(''), context, { inline: ['all'] }, callback);
}
function fromHash(input, context, callback) {
var inputAsImports = addHashSource(input, context, []);
return fromStyles(inputAsImports.join(''), context, { inline: ['all'] }, callback);
}
function addStringSource(input, imports) {
imports.push(restoreAsImport(normalizeUri(input)));
return imports;
}
function addHashSource(input, context, imports) {
var uri;
var normalizedUri;
var source;
for (uri in input) {
source = input[uri];
normalizedUri = normalizeUri(uri);
imports.push(restoreAsImport(normalizedUri));
context.sourcesContent[normalizedUri] = source.styles;
if (source.sourceMap) {
trackSourceMap(source.sourceMap, normalizedUri, context);
}
}
return imports;
}
function normalizeUri(uri) {
var currentPath = path.resolve('');
var absoluteUri;
var relativeToCurrentPath;
var normalizedUri;
if (isRemoteResource(uri)) {
return uri;
}
absoluteUri = path.isAbsolute(uri) ?
uri :
path.resolve(uri);
relativeToCurrentPath = path.relative(currentPath, absoluteUri);
normalizedUri = normalizePath(relativeToCurrentPath);
return normalizedUri;
}
function trackSourceMap(sourceMap, uri, context) {
var parsedMap = typeof sourceMap == 'string' ?
JSON.parse(sourceMap) :
sourceMap;
var rebasedMap = isRemoteResource(uri) ?
rebaseRemoteMap(parsedMap, uri) :
rebaseLocalMap(parsedMap, uri || UNKNOWN_URI, context.options.rebaseTo);
context.inputSourceMapTracker.track(uri, rebasedMap);
}
function restoreAsImport(uri) {
return restoreImport('url(' + uri + ')', '') + Marker.SEMICOLON;
}
function fromStyles(styles, context, parentInlinerContext, callback) {
var tokens;
var rebaseConfig = {};
if (!context.source) {
rebaseConfig.fromBase = path.resolve('');
rebaseConfig.toBase = context.options.rebaseTo;
} else if (isRemoteResource(context.source)) {
rebaseConfig.fromBase = context.source;
rebaseConfig.toBase = context.source;
} else if (path.isAbsolute(context.source)) {
rebaseConfig.fromBase = path.dirname(context.source);
rebaseConfig.toBase = context.options.rebaseTo;
} else {
rebaseConfig.fromBase = path.dirname(path.resolve(context.source));
rebaseConfig.toBase = context.options.rebaseTo;
}
tokens = tokenize(styles, context);
tokens = rebase(tokens, context.options.rebase, context.validator, rebaseConfig);
return allowsAnyImports(parentInlinerContext.inline) ?
inline(tokens, context, parentInlinerContext, callback) :
callback(tokens);
}
function allowsAnyImports(inline) {
return !(inline.length == 1 && inline[0] == 'none');
}
function inline(tokens, externalContext, parentInlinerContext, callback) {
var inlinerContext = {
afterContent: false,
callback: callback,
errors: externalContext.errors,
externalContext: externalContext,
fetch: externalContext.options.fetch,
inlinedStylesheets: parentInlinerContext.inlinedStylesheets || externalContext.inlinedStylesheets,
inline: parentInlinerContext.inline,
inlineRequest: externalContext.options.inlineRequest,
inlineTimeout: externalContext.options.inlineTimeout,
isRemote: parentInlinerContext.isRemote || false,
localOnly: externalContext.localOnly,
outputTokens: [],
rebaseTo: externalContext.options.rebaseTo,
sourceTokens: tokens,
warnings: externalContext.warnings
};
return doInlineImports(inlinerContext);
}
function doInlineImports(inlinerContext) {
var token;
var i, l;
for (i = 0, l = inlinerContext.sourceTokens.length; i < l; i++) {
token = inlinerContext.sourceTokens[i];
if (token[0] == Token.AT_RULE && isImport(token[1])) {
inlinerContext.sourceTokens.splice(0, i);
return inlineStylesheet(token, inlinerContext);
} else if (token[0] == Token.AT_RULE || token[0] == Token.COMMENT) {
inlinerContext.outputTokens.push(token);
} else {
inlinerContext.outputTokens.push(token);
inlinerContext.afterContent = true;
}
}
inlinerContext.sourceTokens = [];
return inlinerContext.callback(inlinerContext.outputTokens);
}
function inlineStylesheet(token, inlinerContext) {
var uriAndMediaQuery = extractImportUrlAndMedia(token[1]);
var uri = uriAndMediaQuery[0];
var mediaQuery = uriAndMediaQuery[1];
var metadata = token[2];
return isRemoteResource(uri) ?
inlineRemoteStylesheet(uri, mediaQuery, metadata, inlinerContext) :
inlineLocalStylesheet(uri, mediaQuery, metadata, inlinerContext);
}
function inlineRemoteStylesheet(uri, mediaQuery, metadata, inlinerContext) {
var isAllowed = isAllowedResource(uri, true, inlinerContext.inline);
var originalUri = uri;
var isLoaded = uri in inlinerContext.externalContext.sourcesContent;
var isRuntimeResource = !hasProtocol(uri);
if (inlinerContext.inlinedStylesheets.indexOf(uri) > -1) {
inlinerContext.warnings.push('Ignoring remote @import of "' + uri + '" as it has already been imported.');
inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1);
return doInlineImports(inlinerContext);
} else if (inlinerContext.localOnly && inlinerContext.afterContent) {
inlinerContext.warnings.push('Ignoring remote @import of "' + uri + '" as no callback given and after other content.');
inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1);
return doInlineImports(inlinerContext);
} else if (isRuntimeResource) {
inlinerContext.warnings.push('Skipping remote @import of "' + uri + '" as no protocol given.');
inlinerContext.outputTokens = inlinerContext.outputTokens.concat(inlinerContext.sourceTokens.slice(0, 1));
inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1);
return doInlineImports(inlinerContext);
} else if (inlinerContext.localOnly && !isLoaded) {
inlinerContext.warnings.push('Skipping remote @import of "' + uri + '" as no callback given.');
inlinerContext.outputTokens = inlinerContext.outputTokens.concat(inlinerContext.sourceTokens.slice(0, 1));
inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1);
return doInlineImports(inlinerContext);
} else if (!isAllowed && inlinerContext.afterContent) {
inlinerContext.warnings.push('Ignoring remote @import of "' + uri + '" as resource is not allowed and after other content.');
inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1);
return doInlineImports(inlinerContext);
} else if (!isAllowed) {
inlinerContext.warnings.push('Skipping remote @import of "' + uri + '" as resource is not allowed.');
inlinerContext.outputTokens = inlinerContext.outputTokens.concat(inlinerContext.sourceTokens.slice(0, 1));
inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1);
return doInlineImports(inlinerContext);
}
inlinerContext.inlinedStylesheets.push(uri);
function whenLoaded(error, importedStyles) {
if (error) {
inlinerContext.errors.push('Broken @import declaration of "' + uri + '" - ' + error);
return process.nextTick(function () {
inlinerContext.outputTokens = inlinerContext.outputTokens.concat(inlinerContext.sourceTokens.slice(0, 1));
inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1);
doInlineImports(inlinerContext);
});
}
inlinerContext.inline = inlinerContext.externalContext.options.inline;
inlinerContext.isRemote = true;
inlinerContext.externalContext.source = originalUri;
inlinerContext.externalContext.sourcesContent[uri] = importedStyles;
inlinerContext.externalContext.stats.originalSize += importedStyles.length;
return fromStyles(importedStyles, inlinerContext.externalContext, inlinerContext, function (importedTokens) {
importedTokens = wrapInMedia(importedTokens, mediaQuery, metadata);
inlinerContext.outputTokens = inlinerContext.outputTokens.concat(importedTokens);
inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1);
return doInlineImports(inlinerContext);
});
}
return isLoaded ?
whenLoaded(null, inlinerContext.externalContext.sourcesContent[uri]) :
inlinerContext.fetch(uri, inlinerContext.inlineRequest, inlinerContext.inlineTimeout, whenLoaded);
}
function inlineLocalStylesheet(uri, mediaQuery, metadata, inlinerContext) {
var currentPath = path.resolve('');
var absoluteUri = path.isAbsolute(uri) ?
path.resolve(currentPath, uri[0] == '/' ? uri.substring(1) : uri) :
path.resolve(inlinerContext.rebaseTo, uri);
var relativeToCurrentPath = path.relative(currentPath, absoluteUri);
var importedStyles;
var isAllowed = isAllowedResource(uri, false, inlinerContext.inline);
var normalizedPath = normalizePath(relativeToCurrentPath);
var isLoaded = normalizedPath in inlinerContext.externalContext.sourcesContent;
if (inlinerContext.inlinedStylesheets.indexOf(absoluteUri) > -1) {
inlinerContext.warnings.push('Ignoring local @import of "' + uri + '" as it has already been imported.');
} else if (!isLoaded && (!fs.existsSync(absoluteUri) || !fs.statSync(absoluteUri).isFile())) {
inlinerContext.errors.push('Ignoring local @import of "' + uri + '" as resource is missing.');
} else if (!isAllowed && inlinerContext.afterContent) {
inlinerContext.warnings.push('Ignoring local @import of "' + uri + '" as resource is not allowed and after other content.');
} else if (inlinerContext.afterContent) {
inlinerContext.warnings.push('Ignoring local @import of "' + uri + '" as after other content.');
} else if (!isAllowed) {
inlinerContext.warnings.push('Skipping local @import of "' + uri + '" as resource is not allowed.');
inlinerContext.outputTokens = inlinerContext.outputTokens.concat(inlinerContext.sourceTokens.slice(0, 1));
} else {
importedStyles = isLoaded ?
inlinerContext.externalContext.sourcesContent[normalizedPath] :
fs.readFileSync(absoluteUri, 'utf-8');
inlinerContext.inlinedStylesheets.push(absoluteUri);
inlinerContext.inline = inlinerContext.externalContext.options.inline;
inlinerContext.externalContext.source = normalizedPath;
inlinerContext.externalContext.sourcesContent[normalizedPath] = importedStyles;
inlinerContext.externalContext.stats.originalSize += importedStyles.length;
return fromStyles(importedStyles, inlinerContext.externalContext, inlinerContext, function (importedTokens) {
importedTokens = wrapInMedia(importedTokens, mediaQuery, metadata);
inlinerContext.outputTokens = inlinerContext.outputTokens.concat(importedTokens);
inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1);
return doInlineImports(inlinerContext);
});
}
inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1);
return doInlineImports(inlinerContext);
}
function wrapInMedia(tokens, mediaQuery, metadata) {
if (mediaQuery) {
return [[Token.NESTED_BLOCK, [[Token.NESTED_BLOCK_SCOPE, '@media ' + mediaQuery, metadata]], tokens]];
} else {
return tokens;
}
}
module.exports = readSources;
node_modules/clean-css/lib/reader/match-data-uri.js 0000666 00000000255 15042511722 0016244 0 ustar 00 var DATA_URI_PATTERN = /^data:(\S*?)?(;charset=[^;]+)?(;[^,]+?)?,(.+)/;
function matchDataUri(uri) {
return DATA_URI_PATTERN.exec(uri);
}
module.exports = matchDataUri;
node_modules/clean-css/lib/reader/extract-import-url-and-media.js 0000666 00000001526 15042511722 0021045 0 ustar 00 var split = require('../utils/split');
var BRACE_PREFIX = /^\(/;
var BRACE_SUFFIX = /\)$/;
var IMPORT_PREFIX_PATTERN = /^@import/i;
var QUOTE_PREFIX_PATTERN = /['"]\s*/;
var QUOTE_SUFFIX_PATTERN = /\s*['"]/;
var URL_PREFIX_PATTERN = /^url\(\s*/i;
var URL_SUFFIX_PATTERN = /\s*\)/i;
function extractImportUrlAndMedia(atRuleValue) {
var uri;
var mediaQuery;
var stripped;
var parts;
stripped = atRuleValue
.replace(IMPORT_PREFIX_PATTERN, '')
.trim()
.replace(URL_PREFIX_PATTERN, '(')
.replace(URL_SUFFIX_PATTERN, ')')
.replace(QUOTE_PREFIX_PATTERN, '')
.replace(QUOTE_SUFFIX_PATTERN, '');
parts = split(stripped, ' ');
uri = parts[0]
.replace(BRACE_PREFIX, '')
.replace(BRACE_SUFFIX, '');
mediaQuery = parts.slice(1).join(' ');
return [uri, mediaQuery];
}
module.exports = extractImportUrlAndMedia;
node_modules/clean-css/lib/reader/apply-source-maps.js 0000666 00000017372 15042511722 0017035 0 ustar 00 var fs = require('fs');
var path = require('path');
var isAllowedResource = require('./is-allowed-resource');
var matchDataUri = require('./match-data-uri');
var rebaseLocalMap = require('./rebase-local-map');
var rebaseRemoteMap = require('./rebase-remote-map');
var Token = require('../tokenizer/token');
var hasProtocol = require('../utils/has-protocol');
var isDataUriResource = require('../utils/is-data-uri-resource');
var isRemoteResource = require('../utils/is-remote-resource');
var MAP_MARKER_PATTERN = /^\/\*# sourceMappingURL=(\S+) \*\/$/;
function applySourceMaps(tokens, context, callback) {
var applyContext = {
callback: callback,
fetch: context.options.fetch,
index: 0,
inline: context.options.inline,
inlineRequest: context.options.inlineRequest,
inlineTimeout: context.options.inlineTimeout,
inputSourceMapTracker: context.inputSourceMapTracker,
localOnly: context.localOnly,
processedTokens: [],
rebaseTo: context.options.rebaseTo,
sourceTokens: tokens,
warnings: context.warnings
};
return context.options.sourceMap && tokens.length > 0 ?
doApplySourceMaps(applyContext) :
callback(tokens);
}
function doApplySourceMaps(applyContext) {
var singleSourceTokens = [];
var lastSource = findTokenSource(applyContext.sourceTokens[0]);
var source;
var token;
var l;
for (l = applyContext.sourceTokens.length; applyContext.index < l; applyContext.index++) {
token = applyContext.sourceTokens[applyContext.index];
source = findTokenSource(token);
if (source != lastSource) {
singleSourceTokens = [];
lastSource = source;
}
singleSourceTokens.push(token);
applyContext.processedTokens.push(token);
if (token[0] == Token.COMMENT && MAP_MARKER_PATTERN.test(token[1])) {
return fetchAndApplySourceMap(token[1], source, singleSourceTokens, applyContext);
}
}
return applyContext.callback(applyContext.processedTokens);
}
function findTokenSource(token) {
var scope;
var metadata;
if (token[0] == Token.AT_RULE || token[0] == Token.COMMENT) {
metadata = token[2][0];
} else {
scope = token[1][0];
metadata = scope[2][0];
}
return metadata[2];
}
function fetchAndApplySourceMap(sourceMapComment, source, singleSourceTokens, applyContext) {
return extractInputSourceMapFrom(sourceMapComment, applyContext, function (inputSourceMap) {
if (inputSourceMap) {
applyContext.inputSourceMapTracker.track(source, inputSourceMap);
applySourceMapRecursively(singleSourceTokens, applyContext.inputSourceMapTracker);
}
applyContext.index++;
return doApplySourceMaps(applyContext);
});
}
function extractInputSourceMapFrom(sourceMapComment, applyContext, whenSourceMapReady) {
var uri = MAP_MARKER_PATTERN.exec(sourceMapComment)[1];
var absoluteUri;
var sourceMap;
var rebasedMap;
if (isDataUriResource(uri)) {
sourceMap = extractInputSourceMapFromDataUri(uri);
return whenSourceMapReady(sourceMap);
} else if (isRemoteResource(uri)) {
return loadInputSourceMapFromRemoteUri(uri, applyContext, function (sourceMap) {
var parsedMap;
if (sourceMap) {
parsedMap = JSON.parse(sourceMap);
rebasedMap = rebaseRemoteMap(parsedMap, uri);
whenSourceMapReady(rebasedMap);
} else {
whenSourceMapReady(null);
}
});
} else {
// at this point `uri` is already rebased, see lib/reader/rebase.js#rebaseSourceMapComment
// it is rebased to be consistent with rebasing other URIs
// however here we need to resolve it back to read it from disk
absoluteUri = path.resolve(applyContext.rebaseTo, uri);
sourceMap = loadInputSourceMapFromLocalUri(absoluteUri, applyContext);
if (sourceMap) {
rebasedMap = rebaseLocalMap(sourceMap, absoluteUri, applyContext.rebaseTo);
return whenSourceMapReady(rebasedMap);
} else {
return whenSourceMapReady(null);
}
}
}
function extractInputSourceMapFromDataUri(uri) {
var dataUriMatch = matchDataUri(uri);
var charset = dataUriMatch[2] ? dataUriMatch[2].split(/[=;]/)[2] : 'us-ascii';
var encoding = dataUriMatch[3] ? dataUriMatch[3].split(';')[1] : 'utf8';
var data = encoding == 'utf8' ? global.unescape(dataUriMatch[4]) : dataUriMatch[4];
var buffer = new Buffer(data, encoding);
buffer.charset = charset;
return JSON.parse(buffer.toString());
}
function loadInputSourceMapFromRemoteUri(uri, applyContext, whenLoaded) {
var isAllowed = isAllowedResource(uri, true, applyContext.inline);
var isRuntimeResource = !hasProtocol(uri);
if (applyContext.localOnly) {
applyContext.warnings.push('Cannot fetch remote resource from "' + uri + '" as no callback given.');
return whenLoaded(null);
} else if (isRuntimeResource) {
applyContext.warnings.push('Cannot fetch "' + uri + '" as no protocol given.');
return whenLoaded(null);
} else if (!isAllowed) {
applyContext.warnings.push('Cannot fetch "' + uri + '" as resource is not allowed.');
return whenLoaded(null);
}
applyContext.fetch(uri, applyContext.inlineRequest, applyContext.inlineTimeout, function (error, body) {
if (error) {
applyContext.warnings.push('Missing source map at "' + uri + '" - ' + error);
return whenLoaded(null);
}
whenLoaded(body);
});
}
function loadInputSourceMapFromLocalUri(uri, applyContext) {
var isAllowed = isAllowedResource(uri, false, applyContext.inline);
var sourceMap;
if (!fs.existsSync(uri) || !fs.statSync(uri).isFile()) {
applyContext.warnings.push('Ignoring local source map at "' + uri + '" as resource is missing.');
return null;
} else if (!isAllowed) {
applyContext.warnings.push('Cannot fetch "' + uri + '" as resource is not allowed.');
return null;
}
sourceMap = fs.readFileSync(uri, 'utf-8');
return JSON.parse(sourceMap);
}
function applySourceMapRecursively(tokens, inputSourceMapTracker) {
var token;
var i, l;
for (i = 0, l = tokens.length; i < l; i++) {
token = tokens[i];
switch (token[0]) {
case Token.AT_RULE:
applySourceMapTo(token, inputSourceMapTracker);
break;
case Token.AT_RULE_BLOCK:
applySourceMapRecursively(token[1], inputSourceMapTracker);
applySourceMapRecursively(token[2], inputSourceMapTracker);
break;
case Token.AT_RULE_BLOCK_SCOPE:
applySourceMapTo(token, inputSourceMapTracker);
break;
case Token.NESTED_BLOCK:
applySourceMapRecursively(token[1], inputSourceMapTracker);
applySourceMapRecursively(token[2], inputSourceMapTracker);
break;
case Token.NESTED_BLOCK_SCOPE:
applySourceMapTo(token, inputSourceMapTracker);
break;
case Token.COMMENT:
applySourceMapTo(token, inputSourceMapTracker);
break;
case Token.PROPERTY:
applySourceMapRecursively(token, inputSourceMapTracker);
break;
case Token.PROPERTY_BLOCK:
applySourceMapRecursively(token[1], inputSourceMapTracker);
break;
case Token.PROPERTY_NAME:
applySourceMapTo(token, inputSourceMapTracker);
break;
case Token.PROPERTY_VALUE:
applySourceMapTo(token, inputSourceMapTracker);
break;
case Token.RULE:
applySourceMapRecursively(token[1], inputSourceMapTracker);
applySourceMapRecursively(token[2], inputSourceMapTracker);
break;
case Token.RULE_SCOPE:
applySourceMapTo(token, inputSourceMapTracker);
}
}
return tokens;
}
function applySourceMapTo(token, inputSourceMapTracker) {
var value = token[1];
var metadata = token[2];
var newMetadata = [];
var i, l;
for (i = 0, l = metadata.length; i < l; i++) {
newMetadata.push(inputSourceMapTracker.originalPositionFor(metadata[i], value.length));
}
token[2] = newMetadata;
}
module.exports = applySourceMaps;
node_modules/clean-css/lib/reader/is-allowed-resource.js 0000666 00000004023 15042511722 0017326 0 ustar 00 var path = require('path');
var url = require('url');
var isRemoteResource = require('../utils/is-remote-resource');
var hasProtocol = require('../utils/has-protocol');
var HTTP_PROTOCOL = 'http:';
function isAllowedResource(uri, isRemote, rules) {
var match;
var absoluteUri;
var allowed = isRemote ? false : true;
var rule;
var isNegated;
var normalizedRule;
var i;
if (rules.length === 0) {
return false;
}
if (isRemote && !hasProtocol(uri)) {
uri = HTTP_PROTOCOL + uri;
}
match = isRemote ?
url.parse(uri).host :
uri;
absoluteUri = isRemote ?
uri :
path.resolve(uri);
for (i = 0; i < rules.length; i++) {
rule = rules[i];
isNegated = rule[0] == '!';
normalizedRule = rule.substring(1);
if (isNegated && isRemote && isRemoteRule(normalizedRule)) {
allowed = allowed && !isAllowedResource(uri, true, [normalizedRule]);
} else if (isNegated && !isRemote && !isRemoteRule(normalizedRule)) {
allowed = allowed && !isAllowedResource(uri, false, [normalizedRule]);
} else if (isNegated) {
allowed = allowed && true;
} else if (rule == 'all') {
allowed = true;
} else if (isRemote && rule == 'local') {
allowed = allowed || false;
} else if (isRemote && rule == 'remote') {
allowed = true;
} else if (!isRemote && rule == 'remote') {
allowed = false;
} else if (!isRemote && rule == 'local') {
allowed = true;
} else if (rule === match) {
allowed = true;
} else if (rule === uri) {
allowed = true;
} else if (isRemote && absoluteUri.indexOf(rule) === 0) {
allowed = true;
} else if (!isRemote && absoluteUri.indexOf(path.resolve(rule)) === 0) {
allowed = true;
} else if (isRemote != isRemoteRule(normalizedRule)) {
allowed = allowed && true;
} else {
allowed = false;
}
}
return allowed;
}
function isRemoteRule(rule) {
return isRemoteResource(rule) || url.parse(HTTP_PROTOCOL + '//' + rule).host == rule;
}
module.exports = isAllowedResource;
node_modules/clean-css/lib/reader/rebase-local-map.js 0000666 00000000676 15042511722 0016557 0 ustar 00 var path = require('path');
function rebaseLocalMap(sourceMap, sourceUri, rebaseTo) {
var currentPath = path.resolve('');
var absoluteUri = path.resolve(currentPath, sourceUri);
var absoluteUriDirectory = path.dirname(absoluteUri);
sourceMap.sources = sourceMap.sources.map(function(source) {
return path.relative(rebaseTo, path.resolve(absoluteUriDirectory, source));
});
return sourceMap;
}
module.exports = rebaseLocalMap;
node_modules/clean-css/lib/reader/load-remote-resource.js 0000666 00000003513 15042511722 0017501 0 ustar 00 var http = require('http');
var https = require('https');
var url = require('url');
var isHttpResource = require('../utils/is-http-resource');
var isHttpsResource = require('../utils/is-https-resource');
var override = require('../utils/override');
var HTTP_PROTOCOL = 'http:';
function loadRemoteResource(uri, inlineRequest, inlineTimeout, callback) {
var proxyProtocol = inlineRequest.protocol || inlineRequest.hostname;
var errorHandled = false;
var requestOptions;
var fetch;
requestOptions = override(
url.parse(uri),
inlineRequest || {}
);
if (inlineRequest.hostname !== undefined) {
// overwrite as we always expect a http proxy currently
requestOptions.protocol = inlineRequest.protocol || HTTP_PROTOCOL;
requestOptions.path = requestOptions.href;
}
fetch = (proxyProtocol && !isHttpsResource(proxyProtocol)) || isHttpResource(uri) ?
http.get :
https.get;
fetch(requestOptions, function (res) {
var chunks = [];
var movedUri;
if (errorHandled) {
return;
}
if (res.statusCode < 200 || res.statusCode > 399) {
return callback(res.statusCode, null);
} else if (res.statusCode > 299) {
movedUri = url.resolve(uri, res.headers.location);
return loadRemoteResource(movedUri, inlineRequest, inlineTimeout, callback);
}
res.on('data', function (chunk) {
chunks.push(chunk.toString());
});
res.on('end', function () {
var body = chunks.join('');
callback(null, body);
});
})
.on('error', function (res) {
if (errorHandled) {
return;
}
errorHandled = true;
callback(res.message, null);
})
.on('timeout', function () {
if (errorHandled) {
return;
}
errorHandled = true;
callback('timeout', null);
})
.setTimeout(inlineTimeout);
}
module.exports = loadRemoteResource;
node_modules/clean-css/lib/reader/rebase-remote-map.js 0000666 00000000512 15042511722 0016745 0 ustar 00 var path = require('path');
var url = require('url');
function rebaseRemoteMap(sourceMap, sourceUri) {
var sourceDirectory = path.dirname(sourceUri);
sourceMap.sources = sourceMap.sources.map(function(source) {
return url.resolve(sourceDirectory, source);
});
return sourceMap;
}
module.exports = rebaseRemoteMap;
node_modules/clean-css/lib/reader/rewrite-url.js 0000666 00000005215 15042511722 0015726 0 ustar 00 var path = require('path');
var url = require('url');
var DOUBLE_QUOTE = '"';
var SINGLE_QUOTE = '\'';
var URL_PREFIX = 'url(';
var URL_SUFFIX = ')';
var QUOTE_PREFIX_PATTERN = /^["']/;
var QUOTE_SUFFIX_PATTERN = /["']$/;
var ROUND_BRACKETS_PATTERN = /[\(\)]/;
var URL_PREFIX_PATTERN = /^url\(/i;
var URL_SUFFIX_PATTERN = /\)$/;
var WHITESPACE_PATTERN = /\s/;
var isWindows = process.platform == 'win32';
function rebase(uri, rebaseConfig) {
if (!rebaseConfig) {
return uri;
}
if (isAbsolute(uri) && !isRemote(rebaseConfig.toBase)) {
return uri;
}
if (isRemote(uri) || isSVGMarker(uri) || isInternal(uri)) {
return uri;
}
if (isData(uri)) {
return '\'' + uri + '\'';
}
if (isRemote(rebaseConfig.toBase)) {
return url.resolve(rebaseConfig.toBase, uri);
}
return rebaseConfig.absolute ?
normalize(absolute(uri, rebaseConfig)) :
normalize(relative(uri, rebaseConfig));
}
function isAbsolute(uri) {
return path.isAbsolute(uri);
}
function isSVGMarker(uri) {
return uri[0] == '#';
}
function isInternal(uri) {
return /^\w+:\w+/.test(uri);
}
function isRemote(uri) {
return /^[^:]+?:\/\//.test(uri) || uri.indexOf('//') === 0;
}
function isData(uri) {
return uri.indexOf('data:') === 0;
}
function absolute(uri, rebaseConfig) {
return path
.resolve(path.join(rebaseConfig.fromBase || '', uri))
.replace(rebaseConfig.toBase, '');
}
function relative(uri, rebaseConfig) {
return path.relative(rebaseConfig.toBase, path.join(rebaseConfig.fromBase || '', uri));
}
function normalize(uri) {
return isWindows ? uri.replace(/\\/g, '/') : uri;
}
function quoteFor(unquotedUrl) {
if (unquotedUrl.indexOf(SINGLE_QUOTE) > -1) {
return DOUBLE_QUOTE;
} else if (unquotedUrl.indexOf(DOUBLE_QUOTE) > -1) {
return SINGLE_QUOTE;
} else if (hasWhitespace(unquotedUrl) || hasRoundBrackets(unquotedUrl)) {
return SINGLE_QUOTE;
} else {
return '';
}
}
function hasWhitespace(url) {
return WHITESPACE_PATTERN.test(url);
}
function hasRoundBrackets(url) {
return ROUND_BRACKETS_PATTERN.test(url);
}
function rewriteUrl(originalUrl, rebaseConfig, pathOnly) {
var strippedUrl = originalUrl
.replace(URL_PREFIX_PATTERN, '')
.replace(URL_SUFFIX_PATTERN, '')
.trim();
var unquotedUrl = strippedUrl
.replace(QUOTE_PREFIX_PATTERN, '')
.replace(QUOTE_SUFFIX_PATTERN, '')
.trim();
var quote = strippedUrl[0] == SINGLE_QUOTE || strippedUrl[0] == DOUBLE_QUOTE ?
strippedUrl[0] :
quoteFor(unquotedUrl);
return pathOnly ?
rebase(unquotedUrl, rebaseConfig) :
URL_PREFIX + quote + rebase(unquotedUrl, rebaseConfig) + quote + URL_SUFFIX;
}
module.exports = rewriteUrl;
node_modules/clean-css/lib/reader/rebase.js 0000666 00000005034 15042511722 0014705 0 ustar 00 var extractImportUrlAndMedia = require('./extract-import-url-and-media');
var restoreImport = require('./restore-import');
var rewriteUrl = require('./rewrite-url');
var Token = require('../tokenizer/token');
var isImport = require('../utils/is-import');
var SOURCE_MAP_COMMENT_PATTERN = /^\/\*# sourceMappingURL=(\S+) \*\/$/;
function rebase(tokens, rebaseAll, validator, rebaseConfig) {
return rebaseAll ?
rebaseEverything(tokens, validator, rebaseConfig) :
rebaseAtRules(tokens, validator, rebaseConfig);
}
function rebaseEverything(tokens, validator, rebaseConfig) {
var token;
var i, l;
for (i = 0, l = tokens.length; i < l; i++) {
token = tokens[i];
switch (token[0]) {
case Token.AT_RULE:
rebaseAtRule(token, validator, rebaseConfig);
break;
case Token.AT_RULE_BLOCK:
rebaseProperties(token[2], validator, rebaseConfig);
break;
case Token.COMMENT:
rebaseSourceMapComment(token, rebaseConfig);
break;
case Token.NESTED_BLOCK:
rebaseEverything(token[2], validator, rebaseConfig);
break;
case Token.RULE:
rebaseProperties(token[2], validator, rebaseConfig);
break;
}
}
return tokens;
}
function rebaseAtRules(tokens, validator, rebaseConfig) {
var token;
var i, l;
for (i = 0, l = tokens.length; i < l; i++) {
token = tokens[i];
switch (token[0]) {
case Token.AT_RULE:
rebaseAtRule(token, validator, rebaseConfig);
break;
}
}
return tokens;
}
function rebaseAtRule(token, validator, rebaseConfig) {
if (!isImport(token[1])) {
return;
}
var uriAndMediaQuery = extractImportUrlAndMedia(token[1]);
var newUrl = rewriteUrl(uriAndMediaQuery[0], rebaseConfig);
var mediaQuery = uriAndMediaQuery[1];
token[1] = restoreImport(newUrl, mediaQuery);
}
function rebaseSourceMapComment(token, rebaseConfig) {
var matches = SOURCE_MAP_COMMENT_PATTERN.exec(token[1]);
if (matches && matches[1].indexOf('data:') === -1) {
token[1] = token[1].replace(matches[1], rewriteUrl(matches[1], rebaseConfig, true));
}
}
function rebaseProperties(properties, validator, rebaseConfig) {
var property;
var value;
var i, l;
var j, m;
for (i = 0, l = properties.length; i < l; i++) {
property = properties[i];
for (j = 2 /* 0 is Token.PROPERTY, 1 is name */, m = property.length; j < m; j++) {
value = property[j][1];
if (validator.isUrl(value)) {
property[j][1] = rewriteUrl(value, rebaseConfig);
}
}
}
}
module.exports = rebase;
node_modules/clean-css/lib/reader/load-original-sources.js 0000666 00000007366 15042511722 0017660 0 ustar 00 var fs = require('fs');
var path = require('path');
var isAllowedResource = require('./is-allowed-resource');
var hasProtocol = require('../utils/has-protocol');
var isRemoteResource = require('../utils/is-remote-resource');
function loadOriginalSources(context, callback) {
var loadContext = {
callback: callback,
fetch: context.options.fetch,
index: 0,
inline: context.options.inline,
inlineRequest: context.options.inlineRequest,
inlineTimeout: context.options.inlineTimeout,
localOnly: context.localOnly,
rebaseTo: context.options.rebaseTo,
sourcesContent: context.sourcesContent,
uriToSource: uriToSourceMapping(context.inputSourceMapTracker.all()),
warnings: context.warnings
};
return context.options.sourceMap && context.options.sourceMapInlineSources ?
doLoadOriginalSources(loadContext) :
callback();
}
function uriToSourceMapping(allSourceMapConsumers) {
var mapping = {};
var consumer;
var uri;
var source;
var i, l;
for (source in allSourceMapConsumers) {
consumer = allSourceMapConsumers[source];
for (i = 0, l = consumer.sources.length; i < l; i++) {
uri = consumer.sources[i];
source = consumer.sourceContentFor(uri, true);
mapping[uri] = source;
}
}
return mapping;
}
function doLoadOriginalSources(loadContext) {
var uris = Object.keys(loadContext.uriToSource);
var uri;
var source;
var total;
for (total = uris.length; loadContext.index < total; loadContext.index++) {
uri = uris[loadContext.index];
source = loadContext.uriToSource[uri];
if (source) {
loadContext.sourcesContent[uri] = source;
} else {
return loadOriginalSource(uri, loadContext);
}
}
return loadContext.callback();
}
function loadOriginalSource(uri, loadContext) {
var content;
if (isRemoteResource(uri)) {
return loadOriginalSourceFromRemoteUri(uri, loadContext, function (content) {
loadContext.index++;
loadContext.sourcesContent[uri] = content;
return doLoadOriginalSources(loadContext);
});
} else {
content = loadOriginalSourceFromLocalUri(uri, loadContext);
loadContext.index++;
loadContext.sourcesContent[uri] = content;
return doLoadOriginalSources(loadContext);
}
}
function loadOriginalSourceFromRemoteUri(uri, loadContext, whenLoaded) {
var isAllowed = isAllowedResource(uri, true, loadContext.inline);
var isRuntimeResource = !hasProtocol(uri);
if (loadContext.localOnly) {
loadContext.warnings.push('Cannot fetch remote resource from "' + uri + '" as no callback given.');
return whenLoaded(null);
} else if (isRuntimeResource) {
loadContext.warnings.push('Cannot fetch "' + uri + '" as no protocol given.');
return whenLoaded(null);
} else if (!isAllowed) {
loadContext.warnings.push('Cannot fetch "' + uri + '" as resource is not allowed.');
return whenLoaded(null);
}
loadContext.fetch(uri, loadContext.inlineRequest, loadContext.inlineTimeout, function (error, content) {
if (error) {
loadContext.warnings.push('Missing original source at "' + uri + '" - ' + error);
}
whenLoaded(content);
});
}
function loadOriginalSourceFromLocalUri(relativeUri, loadContext) {
var isAllowed = isAllowedResource(relativeUri, false, loadContext.inline);
var absoluteUri = path.resolve(loadContext.rebaseTo, relativeUri);
if (!fs.existsSync(absoluteUri) || !fs.statSync(absoluteUri).isFile()) {
loadContext.warnings.push('Ignoring local source map at "' + absoluteUri + '" as resource is missing.');
return null;
} else if (!isAllowed) {
loadContext.warnings.push('Cannot fetch "' + absoluteUri + '" as resource is not allowed.');
return null;
}
return fs.readFileSync(absoluteUri, 'utf8');
}
module.exports = loadOriginalSources;
node_modules/clean-css/LICENSE 0000666 00000002046 15042511722 0012103 0 ustar 00 Copyright (C) 2017 JakubPawlowicz.com
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.
node_modules/clean-css/package.json 0000666 00000002173 15042511722 0013365 0 ustar 00 {
"name": "clean-css",
"version": "4.2.4",
"author": "Jakub Pawlowicz (http://twitter.com/jakubpawlowicz)",
"description": "A well-tested CSS minifier",
"license": "MIT",
"keywords": [
"css",
"minifier"
],
"homepage": "https://github.com/jakubpawlowicz/clean-css",
"repository": {
"type": "git",
"url": "https://github.com/jakubpawlowicz/clean-css.git"
},
"bugs": {
"url": "https://github.com/jakubpawlowicz/clean-css/issues"
},
"main": "index.js",
"files": [
"lib",
"History.md",
"index.js",
"LICENSE"
],
"scripts": {
"browserify": "browserify --standalone CleanCSS index.js | uglifyjs --compress --mangle -o cleancss-browser.js",
"bench": "node ./test/bench.js",
"check": "jshint .",
"prepublish": "npm run check",
"test": "vows"
},
"dependencies": {
"source-map": "~0.6.0"
},
"devDependencies": {
"browserify": "^14.0.0",
"http-proxy": "1.x",
"jshint": "2.x",
"nock": "9.x",
"server-destroy": "1.x",
"uglify-js": ">=2.6.1",
"vows": "0.8.x"
},
"engines": {
"node": ">= 4.0"
}
}
sample-cli-config-file.conf 0000666 00000002051 15042511722 0011622 0 ustar 00 {
"caseSensitive": false,
"collapseBooleanAttributes": true,
"collapseInlineTagWhitespace": false,
"collapseWhitespace": true,
"conservativeCollapse": false,
"continueOnParseError": true,
"customAttrCollapse": ".*",
"decodeEntities": true,
"html5": true,
"ignoreCustomFragments": [
"<#[\\s\\S]*?#>",
"<%[\\s\\S]*?%>",
"<\\?[\\s\\S]*?\\?>"
],
"includeAutoGeneratedTags": false,
"keepClosingSlash": false,
"maxLineLength": 0,
"minifyCSS": true,
"minifyJS": true,
"preserveLineBreaks": false,
"preventAttributesEscaping": false,
"processConditionalComments": true,
"processScripts": [
"text/html"
],
"removeAttributeQuotes": true,
"removeComments": true,
"removeEmptyAttributes": true,
"removeEmptyElements": true,
"removeOptionalTags": true,
"removeRedundantAttributes": true,
"removeScriptTypeAttributes": true,
"removeStyleLinkTypeAttributes": true,
"removeTagWhitespace": true,
"sortAttributes": true,
"sortClassName": true,
"trimCustomFragments": true,
"useShortDoctype": true
}
src/tokenchain.js 0000666 00000003425 15042511722 0010023 0 ustar 00 'use strict';
function Sorter() {
}
Sorter.prototype.sort = function(tokens, fromIndex) {
fromIndex = fromIndex || 0;
for (var i = 0, len = this.keys.length; i < len; i++) {
var key = this.keys[i];
var token = key.slice(1);
var index = tokens.indexOf(token, fromIndex);
if (index !== -1) {
do {
if (index !== fromIndex) {
tokens.splice(index, 1);
tokens.splice(fromIndex, 0, token);
}
fromIndex++;
} while ((index = tokens.indexOf(token, fromIndex)) !== -1);
return this[key].sort(tokens, fromIndex);
}
}
return tokens;
};
function TokenChain() {
}
TokenChain.prototype = {
add: function(tokens) {
var self = this;
tokens.forEach(function(token) {
var key = '$' + token;
if (!self[key]) {
self[key] = [];
self[key].processed = 0;
}
self[key].push(tokens);
});
},
createSorter: function() {
var self = this;
var sorter = new Sorter();
sorter.keys = Object.keys(self).sort(function(j, k) {
var m = self[j].length;
var n = self[k].length;
return m < n ? 1 : m > n ? -1 : j < k ? -1 : j > k ? 1 : 0;
}).filter(function(key) {
if (self[key].processed < self[key].length) {
var token = key.slice(1);
var chain = new TokenChain();
self[key].forEach(function(tokens) {
var index;
while ((index = tokens.indexOf(token)) !== -1) {
tokens.splice(index, 1);
}
tokens.forEach(function(token) {
self['$' + token].processed++;
});
chain.add(tokens.slice(0));
});
sorter[key] = chain.createSorter();
return true;
}
return false;
});
return sorter;
}
};
module.exports = TokenChain;
src/htmlparser.js 0000666 00000047007 15042511722 0010065 0 ustar 00 /*!
* HTML Parser By John Resig (ejohn.org)
* Modified by Juriy "kangax" Zaytsev
* Original code by Erik Arvidsson, Mozilla Public License
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
*/
/*
* // Use like so:
* HTMLParser(htmlString, {
* start: function(tag, attrs, unary) {},
* end: function(tag) {},
* chars: function(text) {},
* comment: function(text) {}
* });
*
* // or to get an XML string:
* HTMLtoXML(htmlString);
*
* // or to get an XML DOM Document
* HTMLtoDOM(htmlString);
*
* // or to inject into an existing document/DOM node
* HTMLtoDOM(htmlString, document);
* HTMLtoDOM(htmlString, document.body);
*
*/
/* global ActiveXObject, DOMDocument */
'use strict';
var createMapFromString = require('./utils').createMapFromString;
function makeMap(values) {
return createMapFromString(values, true);
}
// Regular Expressions for parsing tags and attributes
var singleAttrIdentifier = /([^\s"'<>/=]+)/,
singleAttrAssigns = [/=/],
singleAttrValues = [
// attr value double quotes
/"([^"]*)"+/.source,
// attr value, single quotes
/'([^']*)'+/.source,
// attr value, no quotes
/([^ \t\n\f\r"'`=<>]+)/.source
],
// https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName
qnameCapture = (function() {
// based on https://www.npmjs.com/package/ncname
var combiningChar = '\\u0300-\\u0345\\u0360\\u0361\\u0483-\\u0486\\u0591-\\u05A1\\u05A3-\\u05B9\\u05BB-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u064B-\\u0652\\u0670\\u06D6-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0901-\\u0903\\u093C\\u093E-\\u094D\\u0951-\\u0954\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A02\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A70\\u0A71\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B43\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B82\\u0B83\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C01-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C82\\u0C83\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D43\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86-\\u0F8B\\u0F90-\\u0F95\\u0F97\\u0F99-\\u0FAD\\u0FB1-\\u0FB7\\u0FB9\\u20D0-\\u20DC\\u20E1\\u302A-\\u302F\\u3099\\u309A';
var digit = '0-9\\u0660-\\u0669\\u06F0-\\u06F9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE7-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29';
var extender = '\\xB7\\u02D0\\u02D1\\u0387\\u0640\\u0E46\\u0EC6\\u3005\\u3031-\\u3035\\u309D\\u309E\\u30FC-\\u30FE';
var letter = 'A-Za-z\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u0131\\u0134-\\u013E\\u0141-\\u0148\\u014A-\\u017E\\u0180-\\u01C3\\u01CD-\\u01F0\\u01F4\\u01F5\\u01FA-\\u0217\\u0250-\\u02A8\\u02BB-\\u02C1\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03CE\\u03D0-\\u03D6\\u03DA\\u03DC\\u03DE\\u03E0\\u03E2-\\u03F3\\u0401-\\u040C\\u040E-\\u044F\\u0451-\\u045C\\u045E-\\u0481\\u0490-\\u04C4\\u04C7\\u04C8\\u04CB\\u04CC\\u04D0-\\u04EB\\u04EE-\\u04F5\\u04F8\\u04F9\\u0531-\\u0556\\u0559\\u0561-\\u0586\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u063A\\u0641-\\u064A\\u0671-\\u06B7\\u06BA-\\u06BE\\u06C0-\\u06CE\\u06D0-\\u06D3\\u06D5\\u06E5\\u06E6\\u0905-\\u0939\\u093D\\u0958-\\u0961\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\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-\\u0A8B\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AE0\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B36-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB5\\u0BB7-\\u0BB9\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D60\\u0D61\\u0E01-\\u0E2E\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E45\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD\\u0EAE\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0F40-\\u0F47\\u0F49-\\u0F69\\u10A0-\\u10C5\\u10D0-\\u10F6\\u1100\\u1102\\u1103\\u1105-\\u1107\\u1109\\u110B\\u110C\\u110E-\\u1112\\u113C\\u113E\\u1140\\u114C\\u114E\\u1150\\u1154\\u1155\\u1159\\u115F-\\u1161\\u1163\\u1165\\u1167\\u1169\\u116D\\u116E\\u1172\\u1173\\u1175\\u119E\\u11A8\\u11AB\\u11AE\\u11AF\\u11B7\\u11B8\\u11BA\\u11BC-\\u11C2\\u11EB\\u11F0\\u11F9\\u1E00-\\u1E9B\\u1EA0-\\u1EF9\\u1F00-\\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\\u2126\\u212A\\u212B\\u212E\\u2180-\\u2182\\u3007\\u3021-\\u3029\\u3041-\\u3094\\u30A1-\\u30FA\\u3105-\\u312C\\u4E00-\\u9FA5\\uAC00-\\uD7A3';
var ncname = '[' + letter + '_][' + letter + digit + '\\.\\-_' + combiningChar + extender + ']*';
return '((?:' + ncname + '\\:)?' + ncname + ')';
})(),
startTagOpen = new RegExp('^<' + qnameCapture),
startTagClose = /^\s*(\/?)>/,
endTag = new RegExp('^<\\/' + qnameCapture + '[^>]*>'),
doctype = /^]+>/i;
var IS_REGEX_CAPTURING_BROKEN = false;
'x'.replace(/x(.)?/g, function(m, g) {
IS_REGEX_CAPTURING_BROKEN = g === '';
});
// Empty Elements
var empty = makeMap('area,base,basefont,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr');
// Inline Elements
var inline = makeMap('a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,noscript,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,svg,textarea,tt,u,var');
// Elements that you can, intentionally, leave open
// (and which close themselves)
var closeSelf = makeMap('colgroup,dd,dt,li,option,p,td,tfoot,th,thead,tr,source');
// Attributes that have their values filled in disabled='disabled'
var fillAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected');
// Special Elements (can contain anything)
var special = makeMap('script,style');
// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
var nonPhrasing = makeMap('address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,ol,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track,ul');
var reCache = {};
function attrForHandler(handler) {
var pattern = singleAttrIdentifier.source +
'(?:\\s*(' + joinSingleAttrAssigns(handler) + ')' +
'[ \\t\\n\\f\\r]*(?:' + singleAttrValues.join('|') + '))?';
if (handler.customAttrSurround) {
var attrClauses = [];
for (var i = handler.customAttrSurround.length - 1; i >= 0; i--) {
attrClauses[i] = '(?:' +
'(' + handler.customAttrSurround[i][0].source + ')\\s*' +
pattern +
'\\s*(' + handler.customAttrSurround[i][1].source + ')' +
')';
}
attrClauses.push('(?:' + pattern + ')');
pattern = '(?:' + attrClauses.join('|') + ')';
}
return new RegExp('^\\s*' + pattern);
}
function joinSingleAttrAssigns(handler) {
return singleAttrAssigns.concat(
handler.customAttrAssign || []
).map(function(assign) {
return '(?:' + assign.source + ')';
}).join('|');
}
function HTMLParser(html, handler) {
var stack = [], lastTag;
var attribute = attrForHandler(handler);
var last, prevTag, nextTag;
while (html) {
last = html;
// Make sure we're not in a script or style element
if (!lastTag || !special(lastTag)) {
var textEnd = html.indexOf('<');
if (textEnd === 0) {
// Comment:
if (/^');
if (commentEnd >= 0) {
if (handler.comment) {
handler.comment(html.substring(4, commentEnd));
}
html = html.substring(commentEnd + 3);
prevTag = '';
continue;
}
}
// https://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
if (/^');
if (conditionalEnd >= 0) {
if (handler.comment) {
handler.comment(html.substring(2, conditionalEnd + 1), true /* non-standard */);
}
html = html.substring(conditionalEnd + 2);
prevTag = '';
continue;
}
}
// Doctype:
var doctypeMatch = html.match(doctype);
if (doctypeMatch) {
if (handler.doctype) {
handler.doctype(doctypeMatch[0]);
}
html = html.substring(doctypeMatch[0].length);
prevTag = '';
continue;
}
// End tag:
var endTagMatch = html.match(endTag);
if (endTagMatch) {
html = html.substring(endTagMatch[0].length);
endTagMatch[0].replace(endTag, parseEndTag);
prevTag = '/' + endTagMatch[1].toLowerCase();
continue;
}
// Start tag:
var startTagMatch = parseStartTag(html);
if (startTagMatch) {
html = startTagMatch.rest;
handleStartTag(startTagMatch);
prevTag = startTagMatch.tagName.toLowerCase();
continue;
}
// Treat `<` as text
if (handler.continueOnParseError) {
textEnd = html.indexOf('<', 1);
}
}
var text;
if (textEnd >= 0) {
text = html.substring(0, textEnd);
html = html.substring(textEnd);
}
else {
text = html;
html = '';
}
// next tag
var nextTagMatch = parseStartTag(html);
if (nextTagMatch) {
nextTag = nextTagMatch.tagName;
}
else {
nextTagMatch = html.match(endTag);
if (nextTagMatch) {
nextTag = '/' + nextTagMatch[1];
}
else {
nextTag = '';
}
}
if (handler.chars) {
handler.chars(text, prevTag, nextTag);
}
prevTag = '';
}
else {
var stackedTag = lastTag.toLowerCase();
var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)' + stackedTag + '[^>]*>', 'i'));
html = html.replace(reStackedTag, function(all, text) {
if (stackedTag !== 'script' && stackedTag !== 'style' && stackedTag !== 'noscript') {
text = text
.replace(//g, '$1')
.replace(//g, '$1');
}
if (handler.chars) {
handler.chars(text);
}
return '';
});
parseEndTag('' + stackedTag + '>', stackedTag);
}
if (html === last) {
throw new Error('Parse Error: ' + html);
}
}
if (!handler.partialMarkup) {
// Clean up any remaining tags
parseEndTag();
}
function parseStartTag(input) {
var start = input.match(startTagOpen);
if (start) {
var match = {
tagName: start[1],
attrs: []
};
input = input.slice(start[0].length);
var end, attr;
while (!(end = input.match(startTagClose)) && (attr = input.match(attribute))) {
input = input.slice(attr[0].length);
match.attrs.push(attr);
}
if (end) {
match.unarySlash = end[1];
match.rest = input.slice(end[0].length);
return match;
}
}
}
function closeIfFound(tagName) {
if (findTag(tagName) >= 0) {
parseEndTag('', tagName);
return true;
}
}
function handleStartTag(match) {
var tagName = match.tagName;
var unarySlash = match.unarySlash;
if (handler.html5) {
if (lastTag === 'p' && nonPhrasing(tagName)) {
parseEndTag('', lastTag);
}
else if (tagName === 'tbody') {
closeIfFound('thead');
}
else if (tagName === 'tfoot') {
if (!closeIfFound('tbody')) {
closeIfFound('thead');
}
}
if (tagName === 'col' && findTag('colgroup') < 0) {
lastTag = 'colgroup';
stack.push({ tag: lastTag, attrs: [] });
if (handler.start) {
handler.start(lastTag, [], false, '');
}
}
}
if (!handler.html5 && !inline(tagName)) {
while (lastTag && inline(lastTag)) {
parseEndTag('', lastTag);
}
}
if (closeSelf(tagName) && lastTag === tagName) {
parseEndTag('', tagName);
}
var unary = empty(tagName) || tagName === 'html' && lastTag === 'head' || !!unarySlash;
var attrs = match.attrs.map(function(args) {
var name, value, customOpen, customClose, customAssign, quote;
var ncp = 7; // number of captured parts, scalar
// hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
if (args[3] === '') { delete args[3]; }
if (args[4] === '') { delete args[4]; }
if (args[5] === '') { delete args[5]; }
}
function populate(index) {
customAssign = args[index];
value = args[index + 1];
if (typeof value !== 'undefined') {
return '"';
}
value = args[index + 2];
if (typeof value !== 'undefined') {
return '\'';
}
value = args[index + 3];
if (typeof value === 'undefined' && fillAttrs(name)) {
value = name;
}
return '';
}
var j = 1;
if (handler.customAttrSurround) {
for (var i = 0, l = handler.customAttrSurround.length; i < l; i++, j += ncp) {
name = args[j + 1];
if (name) {
quote = populate(j + 2);
customOpen = args[j];
customClose = args[j + 6];
break;
}
}
}
if (!name && (name = args[j])) {
quote = populate(j + 1);
}
return {
name: name,
value: value,
customAssign: customAssign || '=',
customOpen: customOpen || '',
customClose: customClose || '',
quote: quote || ''
};
});
if (!unary) {
stack.push({ tag: tagName, attrs: attrs });
lastTag = tagName;
unarySlash = '';
}
if (handler.start) {
handler.start(tagName, attrs, unary, unarySlash);
}
}
function findTag(tagName) {
var pos;
var needle = tagName.toLowerCase();
for (pos = stack.length - 1; pos >= 0; pos--) {
if (stack[pos].tag.toLowerCase() === needle) {
break;
}
}
return pos;
}
function parseEndTag(tag, tagName) {
var pos;
// Find the closest opened tag of the same type
if (tagName) {
pos = findTag(tagName);
}
// If no tag name is provided, clean shop
else {
pos = 0;
}
if (pos >= 0) {
// Close all the open elements, up the stack
for (var i = stack.length - 1; i >= pos; i--) {
if (handler.end) {
handler.end(stack[i].tag, stack[i].attrs, i > pos || !tag);
}
}
// Remove the open elements from the stack
stack.length = pos;
lastTag = pos && stack[pos - 1].tag;
}
else if (tagName.toLowerCase() === 'br') {
if (handler.start) {
handler.start(tagName, [], true, '');
}
}
else if (tagName.toLowerCase() === 'p') {
if (handler.start) {
handler.start(tagName, [], false, '', true);
}
if (handler.end) {
handler.end(tagName, []);
}
}
}
}
exports.HTMLParser = HTMLParser;
exports.HTMLtoXML = function(html) {
var results = '';
new HTMLParser(html, {
start: function(tag, attrs, unary) {
results += '<' + tag;
for (var i = 0, len = attrs.length; i < len; i++) {
results += ' ' + attrs[i].name + '="' + (attrs[i].value || '').replace(/"/g, '"') + '"';
}
results += (unary ? '/' : '') + '>';
},
end: function(tag) {
results += '' + tag + '>';
},
chars: function(text) {
results += text;
},
comment: function(text) {
results += '';
},
ignore: function(text) {
results += text;
}
});
return results;
};
exports.HTMLtoDOM = function(html, doc) {
// There can be only one of these elements
var one = {
html: true,
head: true,
body: true,
title: true
};
// Enforce a structure for the document
var structure = {
link: 'head',
base: 'head'
};
if (doc) {
doc = doc.ownerDocument || doc.getOwnerDocument && doc.getOwnerDocument() || doc;
}
else if (typeof DOMDocument !== 'undefined') {
doc = new DOMDocument();
}
else if (typeof document !== 'undefined' && document.implementation && document.implementation.createDocument) {
doc = document.implementation.createDocument('', '', null);
}
else if (typeof ActiveX !== 'undefined') {
doc = new ActiveXObject('Msxml.DOMDocument');
}
var elems = [],
documentElement = doc.documentElement ||
doc.getDocumentElement && doc.getDocumentElement();
// If we're dealing with an empty document then we
// need to pre-populate it with the HTML document structure
if (!documentElement && doc.createElement) {
(function() {
var html = doc.createElement('html');
var head = doc.createElement('head');
head.appendChild(doc.createElement('title'));
html.appendChild(head);
html.appendChild(doc.createElement('body'));
doc.appendChild(html);
})();
}
// Find all the unique elements
if (doc.getElementsByTagName) {
for (var i in one) {
one[i] = doc.getElementsByTagName(i)[0];
}
}
// If we're working with a document, inject contents into
// the body element
var curParentNode = one.body;
new HTMLParser(html, {
start: function(tagName, attrs, unary) {
// If it's a pre-built element, then we can ignore
// its construction
if (one[tagName]) {
curParentNode = one[tagName];
return;
}
var elem = doc.createElement(tagName);
for (var attr in attrs) {
elem.setAttribute(attrs[attr].name, attrs[attr].value);
}
if (structure[tagName] && typeof one[structure[tagName]] !== 'boolean') {
one[structure[tagName]].appendChild(elem);
}
else if (curParentNode && curParentNode.appendChild) {
curParentNode.appendChild(elem);
}
if (!unary) {
elems.push(elem);
curParentNode = elem;
}
},
end: function(/* tag */) {
elems.length -= 1;
// Init the new parentNode
curParentNode = elems[elems.length - 1];
},
chars: function(text) {
curParentNode.appendChild(doc.createTextNode(text));
},
comment: function(/* text */) {
// create comment node
},
ignore: function(/* text */) {
// What to do here?
}
});
return doc;
};
src/utils.js 0000666 00000000647 15042511722 0007043 0 ustar 00 'use strict';
function createMap(values, ignoreCase) {
var map = {};
values.forEach(function(value) {
map[value] = 1;
});
return ignoreCase ? function(value) {
return map[value.toLowerCase()] === 1;
} : function(value) {
return map[value] === 1;
};
}
exports.createMap = createMap;
exports.createMapFromString = function(values, ignoreCase) {
return createMap(values.split(/,/), ignoreCase);
};
src/htmlminifier.js 0000666 00000132113 15042511722 0010364 0 ustar 00 'use strict';
var CleanCSS = require('clean-css');
var decode = require('he').decode;
var HTMLParser = require('./htmlparser').HTMLParser;
var RelateUrl = require('relateurl');
var TokenChain = require('./tokenchain');
var Terser = require('terser');
var utils = require('./utils');
function trimWhitespace(str) {
return str && str.replace(/^[ \n\r\t\f]+/, '').replace(/[ \n\r\t\f]+$/, '');
}
function collapseWhitespaceAll(str) {
// Non-breaking space is specifically handled inside the replacer function here:
return str && str.replace(/[ \n\r\t\f\xA0]+/g, function(spaces) {
return spaces === '\t' ? '\t' : spaces.replace(/(^|\xA0+)[^\xA0]+/g, '$1 ');
});
}
function collapseWhitespace(str, options, trimLeft, trimRight, collapseAll) {
var lineBreakBefore = '', lineBreakAfter = '';
if (options.preserveLineBreaks) {
str = str.replace(/^[ \n\r\t\f]*?[\n\r][ \n\r\t\f]*/, function() {
lineBreakBefore = '\n';
return '';
}).replace(/[ \n\r\t\f]*?[\n\r][ \n\r\t\f]*$/, function() {
lineBreakAfter = '\n';
return '';
});
}
if (trimLeft) {
// Non-breaking space is specifically handled inside the replacer function here:
str = str.replace(/^[ \n\r\t\f\xA0]+/, function(spaces) {
var conservative = !lineBreakBefore && options.conservativeCollapse;
if (conservative && spaces === '\t') {
return '\t';
}
return spaces.replace(/^[^\xA0]+/, '').replace(/(\xA0+)[^\xA0]+/g, '$1 ') || (conservative ? ' ' : '');
});
}
if (trimRight) {
// Non-breaking space is specifically handled inside the replacer function here:
str = str.replace(/[ \n\r\t\f\xA0]+$/, function(spaces) {
var conservative = !lineBreakAfter && options.conservativeCollapse;
if (conservative && spaces === '\t') {
return '\t';
}
return spaces.replace(/[^\xA0]+(\xA0+)/g, ' $1').replace(/[^\xA0]+$/, '') || (conservative ? ' ' : '');
});
}
if (collapseAll) {
// strip non space whitespace then compress spaces to one
str = collapseWhitespaceAll(str);
}
return lineBreakBefore + str + lineBreakAfter;
}
var createMapFromString = utils.createMapFromString;
// non-empty tags that will maintain whitespace around them
var inlineTags = createMapFromString('a,abbr,acronym,b,bdi,bdo,big,button,cite,code,del,dfn,em,font,i,ins,kbd,label,mark,math,nobr,object,q,rp,rt,rtc,ruby,s,samp,select,small,span,strike,strong,sub,sup,svg,textarea,time,tt,u,var');
// non-empty tags that will maintain whitespace within them
var inlineTextTags = createMapFromString('a,abbr,acronym,b,big,del,em,font,i,ins,kbd,mark,nobr,rp,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var');
// self-closing tags that will maintain whitespace around them
var selfClosingInlineTags = createMapFromString('comment,img,input,wbr');
function collapseWhitespaceSmart(str, prevTag, nextTag, options) {
var trimLeft = prevTag && !selfClosingInlineTags(prevTag);
if (trimLeft && !options.collapseInlineTagWhitespace) {
trimLeft = prevTag.charAt(0) === '/' ? !inlineTags(prevTag.slice(1)) : !inlineTextTags(prevTag);
}
var trimRight = nextTag && !selfClosingInlineTags(nextTag);
if (trimRight && !options.collapseInlineTagWhitespace) {
trimRight = nextTag.charAt(0) === '/' ? !inlineTextTags(nextTag.slice(1)) : !inlineTags(nextTag);
}
return collapseWhitespace(str, options, trimLeft, trimRight, prevTag && nextTag);
}
function isConditionalComment(text) {
return /^\[if\s[^\]]+]|\[endif]$/.test(text);
}
function isIgnoredComment(text, options) {
for (var i = 0, len = options.ignoreCustomComments.length; i < len; i++) {
if (options.ignoreCustomComments[i].test(text)) {
return true;
}
}
return false;
}
function isEventAttribute(attrName, options) {
var patterns = options.customEventAttributes;
if (patterns) {
for (var i = patterns.length; i--;) {
if (patterns[i].test(attrName)) {
return true;
}
}
return false;
}
return /^on[a-z]{3,}$/.test(attrName);
}
function canRemoveAttributeQuotes(value) {
// https://mathiasbynens.be/notes/unquoted-attribute-values
return /^[^ \t\n\f\r"'`=<>]+$/.test(value);
}
function attributesInclude(attributes, attribute) {
for (var i = attributes.length; i--;) {
if (attributes[i].name.toLowerCase() === attribute) {
return true;
}
}
return false;
}
function isAttributeRedundant(tag, attrName, attrValue, attrs) {
attrValue = attrValue ? trimWhitespace(attrValue.toLowerCase()) : '';
return (
tag === 'script' &&
attrName === 'language' &&
attrValue === 'javascript' ||
tag === 'form' &&
attrName === 'method' &&
attrValue === 'get' ||
tag === 'input' &&
attrName === 'type' &&
attrValue === 'text' ||
tag === 'script' &&
attrName === 'charset' &&
!attributesInclude(attrs, 'src') ||
tag === 'a' &&
attrName === 'name' &&
attributesInclude(attrs, 'id') ||
tag === 'area' &&
attrName === 'shape' &&
attrValue === 'rect'
);
}
// https://mathiasbynens.be/demo/javascript-mime-type
// https://developer.mozilla.org/en/docs/Web/HTML/Element/script#attr-type
var executableScriptsMimetypes = utils.createMap([
'text/javascript',
'text/ecmascript',
'text/jscript',
'application/javascript',
'application/x-javascript',
'application/ecmascript',
'module'
]);
var keepScriptsMimetypes = utils.createMap([
'module'
]);
function isScriptTypeAttribute(attrValue) {
attrValue = trimWhitespace(attrValue.split(/;/, 2)[0]).toLowerCase();
return attrValue === '' || executableScriptsMimetypes(attrValue);
}
function keepScriptTypeAttribute(attrValue) {
attrValue = trimWhitespace(attrValue.split(/;/, 2)[0]).toLowerCase();
return keepScriptsMimetypes(attrValue);
}
function isExecutableScript(tag, attrs) {
if (tag !== 'script') {
return false;
}
for (var i = 0, len = attrs.length; i < len; i++) {
var attrName = attrs[i].name.toLowerCase();
if (attrName === 'type') {
return isScriptTypeAttribute(attrs[i].value);
}
}
return true;
}
function isStyleLinkTypeAttribute(attrValue) {
attrValue = trimWhitespace(attrValue).toLowerCase();
return attrValue === '' || attrValue === 'text/css';
}
function isStyleSheet(tag, attrs) {
if (tag !== 'style') {
return false;
}
for (var i = 0, len = attrs.length; i < len; i++) {
var attrName = attrs[i].name.toLowerCase();
if (attrName === 'type') {
return isStyleLinkTypeAttribute(attrs[i].value);
}
}
return true;
}
var isSimpleBoolean = createMapFromString('allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible');
var isBooleanValue = createMapFromString('true,false');
function isBooleanAttribute(attrName, attrValue) {
return isSimpleBoolean(attrName) || attrName === 'draggable' && !isBooleanValue(attrValue);
}
function isUriTypeAttribute(attrName, tag) {
return (
/^(?:a|area|link|base)$/.test(tag) && attrName === 'href' ||
tag === 'img' && /^(?:src|longdesc|usemap)$/.test(attrName) ||
tag === 'object' && /^(?:classid|codebase|data|usemap)$/.test(attrName) ||
tag === 'q' && attrName === 'cite' ||
tag === 'blockquote' && attrName === 'cite' ||
(tag === 'ins' || tag === 'del') && attrName === 'cite' ||
tag === 'form' && attrName === 'action' ||
tag === 'input' && (attrName === 'src' || attrName === 'usemap') ||
tag === 'head' && attrName === 'profile' ||
tag === 'script' && (attrName === 'src' || attrName === 'for')
);
}
function isNumberTypeAttribute(attrName, tag) {
return (
/^(?:a|area|object|button)$/.test(tag) && attrName === 'tabindex' ||
tag === 'input' && (attrName === 'maxlength' || attrName === 'tabindex') ||
tag === 'select' && (attrName === 'size' || attrName === 'tabindex') ||
tag === 'textarea' && /^(?:rows|cols|tabindex)$/.test(attrName) ||
tag === 'colgroup' && attrName === 'span' ||
tag === 'col' && attrName === 'span' ||
(tag === 'th' || tag === 'td') && (attrName === 'rowspan' || attrName === 'colspan')
);
}
function isLinkType(tag, attrs, value) {
if (tag !== 'link') {
return false;
}
for (var i = 0, len = attrs.length; i < len; i++) {
if (attrs[i].name === 'rel' && attrs[i].value === value) {
return true;
}
}
}
function isMediaQuery(tag, attrs, attrName) {
return attrName === 'media' && (isLinkType(tag, attrs, 'stylesheet') || isStyleSheet(tag, attrs));
}
var srcsetTags = createMapFromString('img,source');
function isSrcset(attrName, tag) {
return attrName === 'srcset' && srcsetTags(tag);
}
function cleanAttributeValue(tag, attrName, attrValue, options, attrs) {
if (isEventAttribute(attrName, options)) {
attrValue = trimWhitespace(attrValue).replace(/^javascript:\s*/i, '');
return options.minifyJS(attrValue, true);
}
else if (attrName === 'class') {
attrValue = trimWhitespace(attrValue);
if (options.sortClassName) {
attrValue = options.sortClassName(attrValue);
}
else {
attrValue = collapseWhitespaceAll(attrValue);
}
return attrValue;
}
else if (isUriTypeAttribute(attrName, tag)) {
attrValue = trimWhitespace(attrValue);
return isLinkType(tag, attrs, 'canonical') ? attrValue : options.minifyURLs(attrValue);
}
else if (isNumberTypeAttribute(attrName, tag)) {
return trimWhitespace(attrValue);
}
else if (attrName === 'style') {
attrValue = trimWhitespace(attrValue);
if (attrValue) {
if (/;$/.test(attrValue) && !/?[0-9a-zA-Z]+;$/.test(attrValue)) {
attrValue = attrValue.replace(/\s*;$/, ';');
}
attrValue = options.minifyCSS(attrValue, 'inline');
}
return attrValue;
}
else if (isSrcset(attrName, tag)) {
// https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-srcset
attrValue = trimWhitespace(attrValue).split(/\s+,\s*|\s*,\s+/).map(function(candidate) {
var url = candidate;
var descriptor = '';
var match = candidate.match(/\s+([1-9][0-9]*w|[0-9]+(?:\.[0-9]+)?x)$/);
if (match) {
url = url.slice(0, -match[0].length);
var num = +match[1].slice(0, -1);
var suffix = match[1].slice(-1);
if (num !== 1 || suffix !== 'x') {
descriptor = ' ' + num + suffix;
}
}
return options.minifyURLs(url) + descriptor;
}).join(', ');
}
else if (isMetaViewport(tag, attrs) && attrName === 'content') {
attrValue = attrValue.replace(/\s+/g, '').replace(/[0-9]+\.[0-9]+/g, function(numString) {
// "0.90000" -> "0.9"
// "1.0" -> "1"
// "1.0001" -> "1.0001" (unchanged)
return (+numString).toString();
});
}
else if (isContentSecurityPolicy(tag, attrs) && attrName.toLowerCase() === 'content') {
return collapseWhitespaceAll(attrValue);
}
else if (options.customAttrCollapse && options.customAttrCollapse.test(attrName)) {
attrValue = attrValue.replace(/\n+|\r+|\s{2,}/g, '');
}
else if (tag === 'script' && attrName === 'type') {
attrValue = trimWhitespace(attrValue.replace(/\s*;\s*/g, ';'));
}
else if (isMediaQuery(tag, attrs, attrName)) {
attrValue = trimWhitespace(attrValue);
return options.minifyCSS(attrValue, 'media');
}
return attrValue;
}
function isMetaViewport(tag, attrs) {
if (tag !== 'meta') {
return false;
}
for (var i = 0, len = attrs.length; i < len; i++) {
if (attrs[i].name === 'name' && attrs[i].value === 'viewport') {
return true;
}
}
}
function isContentSecurityPolicy(tag, attrs) {
if (tag !== 'meta') {
return false;
}
for (var i = 0, len = attrs.length; i < len; i++) {
if (attrs[i].name.toLowerCase() === 'http-equiv' && attrs[i].value.toLowerCase() === 'content-security-policy') {
return true;
}
}
}
function ignoreCSS(id) {
return '/* clean-css ignore:start */' + id + '/* clean-css ignore:end */';
}
// Wrap CSS declarations for CleanCSS > 3.x
// See https://github.com/jakubpawlowicz/clean-css/issues/418
function wrapCSS(text, type) {
switch (type) {
case 'inline':
return '*{' + text + '}';
case 'media':
return '@media ' + text + '{a{top:0}}';
default:
return text;
}
}
function unwrapCSS(text, type) {
var matches;
switch (type) {
case 'inline':
matches = text.match(/^\*\{([\s\S]*)\}$/);
break;
case 'media':
matches = text.match(/^@media ([\s\S]*?)\s*{[\s\S]*}$/);
break;
}
return matches ? matches[1] : text;
}
function cleanConditionalComment(comment, options) {
return options.processConditionalComments ? comment.replace(/^(\[if\s[^\]]+]>)([\s\S]*?)( -1) {
return minify(text, options);
}
}
return text;
}
// Tag omission rules from https://html.spec.whatwg.org/multipage/syntax.html#optional-tags
// with the following deviations:
// - retain if followed by
// - , , , & follow https://www.w3.org/TR/html5/syntax.html#optional-tags
// - retain all tags which are adjacent to non-standard HTML tags
var optionalStartTags = createMapFromString('html,head,body,colgroup,tbody');
var optionalEndTags = createMapFromString('html,head,body,li,dt,dd,p,rb,rt,rtc,rp,optgroup,option,colgroup,caption,thead,tbody,tfoot,tr,td,th');
var headerTags = createMapFromString('meta,link,script,style,template,noscript');
var descriptionTags = createMapFromString('dt,dd');
var pBlockTags = createMapFromString('address,article,aside,blockquote,details,div,dl,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,main,menu,nav,ol,p,pre,section,table,ul');
var pInlineTags = createMapFromString('a,audio,del,ins,map,noscript,video');
var rubyTags = createMapFromString('rb,rt,rtc,rp');
var rtcTag = createMapFromString('rb,rtc,rp');
var optionTag = createMapFromString('option,optgroup');
var tableContentTags = createMapFromString('tbody,tfoot');
var tableSectionTags = createMapFromString('thead,tbody,tfoot');
var cellTags = createMapFromString('td,th');
var topLevelTags = createMapFromString('html,head,body');
var compactTags = createMapFromString('html,body');
var looseTags = createMapFromString('head,colgroup,caption');
var trailingTags = createMapFromString('dt,thead');
var htmlTags = createMapFromString('a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bdi,bdo,bgsound,big,blink,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,content,data,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,element,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,isindex,kbd,keygen,label,legend,li,link,listing,main,map,mark,marquee,menu,menuitem,meta,meter,multicol,nav,nobr,noembed,noframes,noscript,object,ol,optgroup,option,output,p,param,picture,plaintext,pre,progress,q,rb,rp,rt,rtc,ruby,s,samp,script,section,select,shadow,small,source,spacer,span,strike,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr,xmp');
function canRemoveParentTag(optionalStartTag, tag) {
switch (optionalStartTag) {
case 'html':
case 'head':
return true;
case 'body':
return !headerTags(tag);
case 'colgroup':
return tag === 'col';
case 'tbody':
return tag === 'tr';
}
return false;
}
function isStartTagMandatory(optionalEndTag, tag) {
switch (tag) {
case 'colgroup':
return optionalEndTag === 'colgroup';
case 'tbody':
return tableSectionTags(optionalEndTag);
}
return false;
}
function canRemovePrecedingTag(optionalEndTag, tag) {
switch (optionalEndTag) {
case 'html':
case 'head':
case 'body':
case 'colgroup':
case 'caption':
return true;
case 'li':
case 'optgroup':
case 'tr':
return tag === optionalEndTag;
case 'dt':
case 'dd':
return descriptionTags(tag);
case 'p':
return pBlockTags(tag);
case 'rb':
case 'rt':
case 'rp':
return rubyTags(tag);
case 'rtc':
return rtcTag(tag);
case 'option':
return optionTag(tag);
case 'thead':
case 'tbody':
return tableContentTags(tag);
case 'tfoot':
return tag === 'tbody';
case 'td':
case 'th':
return cellTags(tag);
}
return false;
}
var reEmptyAttribute = new RegExp(
'^(?:class|id|style|title|lang|dir|on(?:focus|blur|change|click|dblclick|mouse(' +
'?:down|up|over|move|out)|key(?:press|down|up)))$');
function canDeleteEmptyAttribute(tag, attrName, attrValue, options) {
var isValueEmpty = !attrValue || /^\s*$/.test(attrValue);
if (!isValueEmpty) {
return false;
}
if (typeof options.removeEmptyAttributes === 'function') {
return options.removeEmptyAttributes(attrName, tag);
}
return tag === 'input' && attrName === 'value' || reEmptyAttribute.test(attrName);
}
function hasAttrName(name, attrs) {
for (var i = attrs.length - 1; i >= 0; i--) {
if (attrs[i].name === name) {
return true;
}
}
return false;
}
function canRemoveElement(tag, attrs) {
switch (tag) {
case 'textarea':
return false;
case 'audio':
case 'script':
case 'video':
if (hasAttrName('src', attrs)) {
return false;
}
break;
case 'iframe':
if (hasAttrName('src', attrs) || hasAttrName('srcdoc', attrs)) {
return false;
}
break;
case 'object':
if (hasAttrName('data', attrs)) {
return false;
}
break;
case 'applet':
if (hasAttrName('code', attrs)) {
return false;
}
break;
}
return true;
}
function canCollapseWhitespace(tag) {
return !/^(?:script|style|pre|textarea)$/.test(tag);
}
function canTrimWhitespace(tag) {
return !/^(?:pre|textarea)$/.test(tag);
}
function normalizeAttr(attr, attrs, tag, options) {
var attrName = options.name(attr.name),
attrValue = attr.value;
if (options.decodeEntities && attrValue) {
attrValue = decode(attrValue, { isAttributeValue: true });
}
if (options.removeRedundantAttributes &&
isAttributeRedundant(tag, attrName, attrValue, attrs) ||
options.removeScriptTypeAttributes && tag === 'script' &&
attrName === 'type' && isScriptTypeAttribute(attrValue) && !keepScriptTypeAttribute(attrValue) ||
options.removeStyleLinkTypeAttributes && (tag === 'style' || tag === 'link') &&
attrName === 'type' && isStyleLinkTypeAttribute(attrValue)) {
return;
}
if (attrValue) {
attrValue = cleanAttributeValue(tag, attrName, attrValue, options, attrs);
}
if (options.removeEmptyAttributes &&
canDeleteEmptyAttribute(tag, attrName, attrValue, options)) {
return;
}
if (options.decodeEntities && attrValue) {
attrValue = attrValue.replace(/&(#?[0-9a-zA-Z]+;)/g, '&$1');
}
return {
attr: attr,
name: attrName,
value: attrValue
};
}
function buildAttr(normalized, hasUnarySlash, options, isLast, uidAttr) {
var attrName = normalized.name,
attrValue = normalized.value,
attr = normalized.attr,
attrQuote = attr.quote,
attrFragment,
emittedAttrValue;
if (typeof attrValue !== 'undefined' && (!options.removeAttributeQuotes ||
~attrValue.indexOf(uidAttr) || !canRemoveAttributeQuotes(attrValue))) {
if (!options.preventAttributesEscaping) {
if (typeof options.quoteCharacter === 'undefined') {
var apos = (attrValue.match(/'/g) || []).length;
var quot = (attrValue.match(/"/g) || []).length;
attrQuote = apos < quot ? '\'' : '"';
}
else {
attrQuote = options.quoteCharacter === '\'' ? '\'' : '"';
}
if (attrQuote === '"') {
attrValue = attrValue.replace(/"/g, '"');
}
else {
attrValue = attrValue.replace(/'/g, ''');
}
}
emittedAttrValue = attrQuote + attrValue + attrQuote;
if (!isLast && !options.removeTagWhitespace) {
emittedAttrValue += ' ';
}
}
// make sure trailing slash is not interpreted as HTML self-closing tag
else if (isLast && !hasUnarySlash && !/\/$/.test(attrValue)) {
emittedAttrValue = attrValue;
}
else {
emittedAttrValue = attrValue + ' ';
}
if (typeof attrValue === 'undefined' || options.collapseBooleanAttributes &&
isBooleanAttribute(attrName.toLowerCase(), attrValue.toLowerCase())) {
attrFragment = attrName;
if (!isLast) {
attrFragment += ' ';
}
}
else {
attrFragment = attrName + attr.customAssign + emittedAttrValue;
}
return attr.customOpen + attrFragment + attr.customClose;
}
function identity(value) {
return value;
}
function processOptions(values) {
var options = {
name: function(name) {
return name.toLowerCase();
},
canCollapseWhitespace: canCollapseWhitespace,
canTrimWhitespace: canTrimWhitespace,
html5: true,
ignoreCustomComments: [
/^!/,
/^\s*#/
],
ignoreCustomFragments: [
/<%[\s\S]*?%>/,
/<\?[\s\S]*?\?>/
],
includeAutoGeneratedTags: true,
log: identity,
minifyCSS: identity,
minifyJS: identity,
minifyURLs: identity
};
Object.keys(values).forEach(function(key) {
var value = values[key];
if (key === 'caseSensitive') {
if (value) {
options.name = identity;
}
}
else if (key === 'log') {
if (typeof value === 'function') {
options.log = value;
}
}
else if (key === 'minifyCSS' && typeof value !== 'function') {
if (!value) {
return;
}
if (typeof value !== 'object') {
value = {};
}
options.minifyCSS = function(text, type) {
text = text.replace(/(url\s*\(\s*)("|'|)(.*?)\2(\s*\))/ig, function(match, prefix, quote, url, suffix) {
return prefix + quote + options.minifyURLs(url) + quote + suffix;
});
var cleanCssOutput = new CleanCSS(value).minify(wrapCSS(text, type));
if (cleanCssOutput.errors.length > 0) {
cleanCssOutput.errors.forEach(options.log);
return text;
}
return unwrapCSS(cleanCssOutput.styles, type);
};
}
else if (key === 'minifyJS' && typeof value !== 'function') {
if (!value) {
return;
}
if (typeof value !== 'object') {
value = {};
}
(value.parse || (value.parse = {})).bare_returns = false;
options.minifyJS = function(text, inline) {
var start = text.match(/^\s*\s*$/, '') : text;
value.parse.bare_returns = inline;
var result = Terser.minify(code, value);
if (result.error) {
options.log(result.error);
return text;
}
return result.code.replace(/;$/, '');
};
}
else if (key === 'minifyURLs' && typeof value !== 'function') {
if (!value) {
return;
}
if (typeof value === 'string') {
value = { site: value };
}
else if (typeof value !== 'object') {
value = {};
}
options.minifyURLs = function(text) {
try {
return RelateUrl.relate(text, value);
}
catch (err) {
options.log(err);
return text;
}
};
}
else {
options[key] = value;
}
});
return options;
}
function uniqueId(value) {
var id;
do {
id = Math.random().toString(36).replace(/^0\.[0-9]*/, '');
} while (~value.indexOf(id));
return id;
}
var specialContentTags = createMapFromString('script,style');
function createSortFns(value, options, uidIgnore, uidAttr) {
var attrChains = options.sortAttributes && Object.create(null);
var classChain = options.sortClassName && new TokenChain();
function attrNames(attrs) {
return attrs.map(function(attr) {
return options.name(attr.name);
});
}
function shouldSkipUID(token, uid) {
return !uid || token.indexOf(uid) === -1;
}
function shouldSkipUIDs(token) {
return shouldSkipUID(token, uidIgnore) && shouldSkipUID(token, uidAttr);
}
function scan(input) {
var currentTag, currentType;
new HTMLParser(input, {
start: function(tag, attrs) {
if (attrChains) {
if (!attrChains[tag]) {
attrChains[tag] = new TokenChain();
}
attrChains[tag].add(attrNames(attrs).filter(shouldSkipUIDs));
}
for (var i = 0, len = attrs.length; i < len; i++) {
var attr = attrs[i];
if (classChain && attr.value && options.name(attr.name) === 'class') {
classChain.add(trimWhitespace(attr.value).split(/[ \t\n\f\r]+/).filter(shouldSkipUIDs));
}
else if (options.processScripts && attr.name.toLowerCase() === 'type') {
currentTag = tag;
currentType = attr.value;
}
}
},
end: function() {
currentTag = '';
},
chars: function(text) {
if (options.processScripts && specialContentTags(currentTag) &&
options.processScripts.indexOf(currentType) > -1) {
scan(text);
}
}
});
}
var log = options.log;
options.log = identity;
options.sortAttributes = false;
options.sortClassName = false;
scan(minify(value, options));
options.log = log;
if (attrChains) {
var attrSorters = Object.create(null);
for (var tag in attrChains) {
attrSorters[tag] = attrChains[tag].createSorter();
}
options.sortAttributes = function(tag, attrs) {
var sorter = attrSorters[tag];
if (sorter) {
var attrMap = Object.create(null);
var names = attrNames(attrs);
names.forEach(function(name, index) {
(attrMap[name] || (attrMap[name] = [])).push(attrs[index]);
});
sorter.sort(names).forEach(function(name, index) {
attrs[index] = attrMap[name].shift();
});
}
};
}
if (classChain) {
var sorter = classChain.createSorter();
options.sortClassName = function(value) {
return sorter.sort(value.split(/[ \n\f\r]+/)).join(' ');
};
}
}
function minify(value, options, partialMarkup) {
if (options.collapseWhitespace) {
value = collapseWhitespace(value, options, true, true);
}
var buffer = [],
charsPrevTag,
currentChars = '',
hasChars,
currentTag = '',
currentAttrs = [],
stackNoTrimWhitespace = [],
stackNoCollapseWhitespace = [],
optionalStartTag = '',
optionalEndTag = '',
ignoredMarkupChunks = [],
ignoredCustomMarkupChunks = [],
uidIgnore,
uidAttr,
uidPattern;
// temporarily replace ignored chunks with comments,
// so that we don't have to worry what's there.
// for all we care there might be
// completely-horribly-broken-alien-non-html-emoj-cthulhu-filled content
value = value.replace(/([\s\S]*?)/g, function(match, group1) {
if (!uidIgnore) {
uidIgnore = uniqueId(value);
var pattern = new RegExp('^' + uidIgnore + '([0-9]+)$');
if (options.ignoreCustomComments) {
options.ignoreCustomComments = options.ignoreCustomComments.slice();
}
else {
options.ignoreCustomComments = [];
}
options.ignoreCustomComments.push(pattern);
}
var token = '';
ignoredMarkupChunks.push(group1);
return token;
});
var customFragments = options.ignoreCustomFragments.map(function(re) {
return re.source;
});
if (customFragments.length) {
var reCustomIgnore = new RegExp('\\s*(?:' + customFragments.join('|') + ')+\\s*', 'g');
// temporarily replace custom ignored fragments with unique attributes
value = value.replace(reCustomIgnore, function(match) {
if (!uidAttr) {
uidAttr = uniqueId(value);
uidPattern = new RegExp('(\\s*)' + uidAttr + '([0-9]+)' + uidAttr + '(\\s*)', 'g');
if (options.minifyCSS) {
options.minifyCSS = (function(fn) {
return function(text, type) {
text = text.replace(uidPattern, function(match, prefix, index) {
var chunks = ignoredCustomMarkupChunks[+index];
return chunks[1] + uidAttr + index + uidAttr + chunks[2];
});
var ids = [];
new CleanCSS().minify(wrapCSS(text, type)).warnings.forEach(function(warning) {
var match = uidPattern.exec(warning);
if (match) {
var id = uidAttr + match[2] + uidAttr;
text = text.replace(id, ignoreCSS(id));
ids.push(id);
}
});
text = fn(text, type);
ids.forEach(function(id) {
text = text.replace(ignoreCSS(id), id);
});
return text;
};
})(options.minifyCSS);
}
if (options.minifyJS) {
options.minifyJS = (function(fn) {
return function(text, type) {
return fn(text.replace(uidPattern, function(match, prefix, index) {
var chunks = ignoredCustomMarkupChunks[+index];
return chunks[1] + uidAttr + index + uidAttr + chunks[2];
}), type);
};
})(options.minifyJS);
}
}
var token = uidAttr + ignoredCustomMarkupChunks.length + uidAttr;
ignoredCustomMarkupChunks.push(/^(\s*)[\s\S]*?(\s*)$/.exec(match));
return '\t' + token + '\t';
});
}
if (options.sortAttributes && typeof options.sortAttributes !== 'function' ||
options.sortClassName && typeof options.sortClassName !== 'function') {
createSortFns(value, options, uidIgnore, uidAttr);
}
function _canCollapseWhitespace(tag, attrs) {
return options.canCollapseWhitespace(tag, attrs, canCollapseWhitespace);
}
function _canTrimWhitespace(tag, attrs) {
return options.canTrimWhitespace(tag, attrs, canTrimWhitespace);
}
function removeStartTag() {
var index = buffer.length - 1;
while (index > 0 && !/^<[^/!]/.test(buffer[index])) {
index--;
}
buffer.length = Math.max(0, index);
}
function removeEndTag() {
var index = buffer.length - 1;
while (index > 0 && !/^<\//.test(buffer[index])) {
index--;
}
buffer.length = Math.max(0, index);
}
// look for trailing whitespaces, bypass any inline tags
function trimTrailingWhitespace(index, nextTag) {
for (var endTag = null; index >= 0 && _canTrimWhitespace(endTag); index--) {
var str = buffer[index];
var match = str.match(/^<\/([\w:-]+)>$/);
if (match) {
endTag = match[1];
}
else if (/>$/.test(str) || (buffer[index] = collapseWhitespaceSmart(str, null, nextTag, options))) {
break;
}
}
}
// look for trailing whitespaces from previously processed text
// which may not be trimmed due to a following comment or an empty
// element which has now been removed
function squashTrailingWhitespace(nextTag) {
var charsIndex = buffer.length - 1;
if (buffer.length > 1) {
var item = buffer[buffer.length - 1];
if (/^(?: may be omitted if first thing inside is not comment
// may be omitted if first thing inside is an element
// may be omitted if first thing inside is not space, comment, , ,