csso-rails 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a4e671786a2bdaebda60f673b55565de3e8a074
4
- data.tar.gz: 923beac5520261d02c2408b5f359ac4eaea0d14d
3
+ metadata.gz: f6857f18ae5b00e8a5e51298bed143e4f1f227ea
4
+ data.tar.gz: 38180727eafbffc218c8908947c9a81089c72852
5
5
  SHA512:
6
- metadata.gz: 56a35b3944f6b0426418a337aa7f78ccb6463efff18df744d96a5d00808a6ca62efe51c04ed9d85238628377ea20547256835a0b82b273336369fa7a0117f2f7
7
- data.tar.gz: c9a48b7596b6cf770c7bd7cc57dfbd07cf9b43163fd5dee088288ef1fef27ee12f921b25a60017bd6710720d64b81ab94b3ad27bd689359eecb36e5dd852208f
6
+ metadata.gz: c37c924022b0c797c17d7d4ac6f04d3d44a2ead9bb095d29810a81ca0833c8615fd139b86f2b378996aa08c1e1d0522710b5d82ee1f679557d9769f7d1545e02
7
+ data.tar.gz: d646dda9a53bb708eb3b88c9797b69cc52121bd6eb54199cb5c9238cdce5e27eea7e50a4c77eec63cf0ce7e2ae431257039c211e1c90c0af08e9f4dbad4b2f2e
data/Appraisals CHANGED
@@ -12,6 +12,7 @@ end
12
12
 
13
13
  appraise "sprockets-4" do
14
14
  gem "sprockets", "~>4.0.0.beta2"
15
+ gem 'sass', '>=3.3'
15
16
  end
16
17
 
17
18
  appraise "rails-4" do
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- csso-rails (0.4.1)
4
+ csso-rails (0.5.0)
5
5
  execjs (>= 1)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- csso-rails (0.4.0)
4
+ csso-rails (0.5.0)
5
5
  execjs (>= 1)
6
6
 
7
7
  GEM
@@ -115,4 +115,4 @@ DEPENDENCIES
115
115
  rake
116
116
 
117
117
  BUNDLED WITH
118
- 1.10.6
118
+ 1.11.2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- csso-rails (0.4.0)
4
+ csso-rails (0.5.0)
5
5
  execjs (>= 1)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- csso-rails (0.4.0)
4
+ csso-rails (0.5.0)
5
5
  execjs (>= 1)
6
6
 
7
7
  GEM
@@ -3,5 +3,6 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "sprockets", "~>4.0.0.beta2"
6
+ gem "sass", ">=3.3"
6
7
 
7
8
  gemspec :path => "../"
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- csso-rails (0.4.0)
4
+ csso-rails (0.5.0)
5
5
  execjs (>= 1)
6
6
 
7
7
  GEM
@@ -16,6 +16,7 @@ GEM
16
16
  minitest (5.8.4)
17
17
  rack (1.6.4)
18
18
  rake (11.1.0)
19
+ sass (3.4.21)
19
20
  sprockets (4.0.0.beta2)
20
21
  concurrent-ruby (~> 1.0)
21
22
  rack (> 1, < 3)
@@ -29,7 +30,8 @@ DEPENDENCIES
29
30
  csso-rails!
30
31
  minitest
31
32
  rake
33
+ sass (>= 3.3)
32
34
  sprockets (~> 4.0.0.beta2)
33
35
 
34
36
  BUNDLED WITH
35
- 1.10.6
37
+ 1.11.2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- csso-rails (0.4.0)
4
+ csso-rails (0.5.0)
5
5
  execjs (>= 1)
6
6
 
7
7
  GEM
data/lib/csso.rb CHANGED
@@ -36,6 +36,12 @@ module Csso
36
36
  end
37
37
  end
38
38
 
39
+ def self.optimize_with_sourcemap css, filename, structural_optimization=true
40
+ return nil unless css.is_a?(String)
41
+ return css if css.size <= 3
42
+ Csso.js_api.compress_with_sourcemap(css, filename, structural_optimization)
43
+ end
44
+
39
45
 
40
46
  class Optimizer
41
47
  def optimize(css, structural_optimization=true)
@@ -3,10 +3,20 @@ module Csso
3
3
  def self.call(input)
4
4
  require 'csso'
5
5
  #TODO: settings?
6
- #TODO: handle metadata somehow?
7
- {
8
- data: Csso.optimize(input[:data], true)
9
- }
6
+ if input[:metadata] && input[:metadata][:map]
7
+ css, map = Csso.optimize_with_sourcemap(input[:data],
8
+ # Sprockets::PathUtils.split_subpath(input[:load_path], input[:filename])
9
+ # sprockets seems to ignore filenames here, so we may save some mem:
10
+ 'uri'
11
+ )
12
+ map = Sprockets::SourceMapUtils.combine_source_maps(
13
+ input[:metadata][:map],
14
+ Sprockets::SourceMapUtils.decode_json_source_map(map)["mappings"]
15
+ )
16
+ { data: css, map: map }
17
+ else
18
+ { data: Csso.optimize(input[:data], true) }
19
+ end
10
20
  end
11
21
 
12
22
  # sprockets 2:
data/lib/csso/csso.js.erb CHANGED
@@ -25,8 +25,17 @@ console = {
25
25
 
26
26
  <%= file 'csso/dist/csso-browser.js' %>
27
27
 
28
- do_compression = function(css, disable_structural){
28
+ do_compression = function(css, structural){
29
29
  return csso.minify(css, {
30
- restructuring: !disable_structural
30
+ restructure: structural
31
31
  });
32
32
  };
33
+
34
+ do_compression_with_map = function(css, filename, structural){
35
+ var result = csso.minify(css, {
36
+ restructure: structural,
37
+ filename: filename,
38
+ sourceMap: true
39
+ });
40
+ return [result.css, result.map.toString()];
41
+ };
data/lib/csso/js_lib.rb CHANGED
@@ -15,7 +15,11 @@ module Csso
15
15
  end
16
16
 
17
17
  def compress css, structural_optimization=true
18
- @csso.call("do_compression", css, !structural_optimization)
18
+ @csso.call("do_compression", css, structural_optimization)
19
+ end
20
+
21
+ def compress_with_sourcemap css, filename, structural_optimization=true
22
+ @csso.call("do_compression_with_map", css, filename, structural_optimization)
19
23
  end
20
24
 
21
25
  end
data/lib/csso/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Csso
2
- VERSION = '0.4.1'
2
+ VERSION = '0.5.0'
3
3
  CSSO_JS_LIB = 'vendor/csso/csso.js'
4
4
  end
@@ -9,10 +9,16 @@ require 'csso'
9
9
  describe Csso do
10
10
 
11
11
  subject { Csso }
12
- let(:sprockets_env){
12
+ let(:sprockets_env_without_csso){
13
+ begin
14
+ require 'sprockets'
15
+ rescue LoadError
16
+ skip "Skipping sprockets integration, as there's no sprockets in this env"
17
+ end
13
18
  e = Sprockets::Environment.new(File.expand_path('../', File.dirname(__FILE__)))
14
19
  e.append_path 'fixtures'
15
20
  e.config = e.config.merge(gzip_enabled: false).freeze if e.respond_to? :config
21
+ # e.logger = Logger.new STDOUT
16
22
  e
17
23
  }
18
24
  let(:result_dir){
@@ -24,17 +30,15 @@ describe Csso do
24
30
  File.expand_path('manifest.json', result_dir)
25
31
  }
26
32
  let(:manifest){
33
+ sprockets_env
27
34
  Sprockets::Manifest.new(sprockets_env, result_dir, manifest_file)
28
35
  }
36
+ let(:sprockets_env){
37
+ subject.install(sprockets_env_without_csso)
38
+ sprockets_env_without_csso
39
+ }
29
40
 
30
41
  it "installs" do
31
- begin
32
- require 'sprockets'
33
- rescue LoadError
34
- skip "Skipping sprockets integration, as there's no sprockets in this env"
35
- end
36
-
37
- subject.install(sprockets_env)
38
42
  sprockets_env.css_compressor.must_equal Csso::Compressor
39
43
  manifest.environment.must_equal(sprockets_env)
40
44
  manifest.clobber
@@ -46,6 +50,23 @@ describe Csso do
46
50
  manifest.clobber
47
51
  end
48
52
 
53
+ it "compiles with sourcemap" do
54
+ manifest.clobber
55
+ begin
56
+ require 'sass'
57
+ rescue LoadError
58
+ skip 'No sass in this env, skipping'
59
+ end
60
+ manifest.compile('test2.css')
61
+ manifest.compile('test2.css.map')
62
+ json = JSON.load File.read(manifest_file)
63
+ json["assets"]["test2.css"].must_match /\.css$/
64
+ sprockets_env['test2.css'].source.must_equal '.class,.class .other_class{color:red}.something{color:#000}.test2{color:#00f}'
65
+ map = JSON.load(sprockets_env['test2.css.map'].source)
66
+ map["sources"].size.must_equal 4
67
+ manifest.clobber
68
+ end
69
+
49
70
  it "loads into rails" do
50
71
  begin
51
72
  require "rails"
@@ -0,0 +1,7 @@
1
+ /* LaLaLa */
2
+ //= require ./test.css
3
+ //= require ./test4.css
4
+
5
+ .test2{
6
+ color: #0000ff;
7
+ }
@@ -0,0 +1,3 @@
1
+ .something{
2
+ color: #000000;
3
+ }
@@ -0,0 +1,10 @@
1
+ @import 'test3';
2
+
3
+ $color: #ff0000;
4
+
5
+ .class {
6
+ .other_class{
7
+ // comment blablabla
8
+ color: $color;
9
+ }
10
+ }
data/vendor/csso/csso.js CHANGED
@@ -2,7 +2,7 @@
2
2
  THIS FILE IS AUTOGENERATED! DO NOT EDIT!
3
3
  See lib/csso/csso.js.erb instead.
4
4
 
5
- Based on 1.5.3 revision 9183f49fcbfb2fc1e737896deeeba485edbc52a9
5
+ Based on 1.7.0 revision f04a38a0d33fd8953ae911a80643af105897daa1
6
6
  */
7
7
 
8
8
  console = {
@@ -12,12 +12,22 @@ console = {
12
12
  }
13
13
  };
14
14
 
15
- !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.csso=e()}}(function(){return function e(t,r,n){function o(a,u){if(!r[a]){if(!t[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return o(r?r:e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(e,t,r){function n(e,t){for(;t<e.length;t++){var r=e[t][1];if("s"!==r&&"comment"!==r)break}return t}function o(e,t,r){for(t=n(e,t);r>=t;r--){var o=e[r][1];if("s"!==o&&"comment"!==o)break}return t>r?[]:e.slice(t,r+1).map(a).filter(Boolean)}function i(e){for(var t=[],r=e,n=2,i=n;i<r.length;i++)"operator"===r[i][1]&&","===r[i][2]&&(t.push({type:"Argument",info:{},sequence:o(r,n,i-1)}),n=i+1);var a=o(r,n,r.length-1);return(a.length||t.length)&&t.push({type:"Argument",info:{},sequence:a}),t}function a(e,t,r){if(e){var n=e[1];if(s.hasOwnProperty(n)&&"function"==typeof s[n])return s[n](e)}return null}var u=function(e){return{type:"StyleSheet",info:e[0],rules:e.filter(function(e,t){return t>=2&&"s"!==e[1]&&"comment"!==e[1]&&"unknown"!==e[1]}).map(a)}},s={atkeyword:!1,atruleb:function(e){return{type:"Atrule",info:e[0],name:e[2][2][2],expression:{type:"AtruleExpression",info:{},sequence:o(e,3,e.length-2)},block:a(e[e.length-1])}},atruler:function(e){return{type:"Atrule",info:e[0],name:e[2][2][2],expression:a(e[3]),block:a(e[4])}},atrulerq:function(e){return{type:"AtruleExpression",info:e[0],sequence:o(e,2,e.length-1)}},atrulers:u,atrules:function(e){return{type:"Atrule",info:e[0],name:e[2][2][2],expression:{type:"AtruleExpression",info:{},sequence:o(e,3,e.length-1)},block:null}},attrib:function(e){var t=2;t=n(e,2);var r=a(e[t]);e[t+1]&&"namespace"===e[t+1][1]&&(r.name+="|"+e[t+2][2],t+=2),t=n(e,t+1);var o=e[t]?e[t][2]:null;t=n(e,t+1);var i=a(e[t]);return{type:"Attribute",info:e[0],name:r,operator:o,value:i}},attrselector:!1,block:function(e){return{type:"Block",info:e[0],declarations:e.filter(function(e,t){return t>=2&&("declaration"===e[1]||"filter"===e[1])}).map(a)}},braces:function(e){return{type:"Braces",info:e[0],open:e[2],close:e[3],sequence:o(e,4,e.length-1)}},clazz:function(e){return{type:"Class",info:e[0],name:e[2][2]}},combinator:function(e){return{type:"Combinator",info:e[0],name:e[2]}},comment:!1,declaration:function(e){return{type:"Declaration",info:e[0],property:a(e[2]),value:a(e[3])}},decldelim:!1,delim:!1,dimension:function(e){return{type:"Dimension",info:e[0],value:e[2][2],unit:e[3][2]}},filter:function(e){return{type:"Declaration",info:e[0],property:a(e[2]),value:a(e[3])}},filterv:function(e){return{type:"Value",info:e[0],sequence:o(e,2,e.length-1)}},functionExpression:function(e){return{type:"Function",name:"expression",arguments:[{type:"Argument",sequence:[{type:"Raw",value:e[2]}]}]}},funktion:function(e){return{type:"Function",info:e[0],name:e[2][2],arguments:i(e[3])}},functionBody:!1,ident:function(e){return{type:"Identifier",info:e[0],name:e[2]}},important:function(e){return{type:"Important",info:e[0]}},namespace:!1,nth:function(e){return{type:"Nth",value:e[2]}},nthselector:function(e){return{type:"FunctionalPseudo",info:e[0],name:e[2][2],arguments:[{type:"Argument",sequence:e.filter(function(e,t){return t>=3&&"s"!==e[1]&&"comment"!==e[1]}).map(a)}]}},number:function(e){return{type:"Number",info:e[0],value:e[2]}},operator:function(e){return{type:"Operator",info:e[0],value:e[2]}},percentage:function(e){return{type:"Percentage",info:e[0],value:e[2][2]}},progid:function(e){return{type:"Progid",info:e[0],value:o(e,2,e.length-1)[0]}},property:function(e){return{type:"Property",info:e[0],name:e[2][2]}},pseudoc:function(e){var t=e[2];if("funktion"===t[1]){var r=t[2][2];return"not"===r?{type:"Negation",sequence:[s.simpleselector(t[3][2])]}:{type:"FunctionalPseudo",info:t[0],name:r,arguments:i(t[3])}}return{type:"PseudoClass",info:e[0],name:t[2]}},pseudoe:function(e){var t=e[2];return{type:"PseudoElement",info:e[0],name:t[2]}},raw:function(e){return{type:"Raw",info:e[0],value:e[2]}},ruleset:function(e){var t,r=a(e[2]);return 4===e.length?t=a(e[3]):(t=r,r=null),{type:"Ruleset",info:e[0],selector:r,block:t}},s:function(e){return{type:"Space",info:e[0]}},selector:function(e){var t="delim",r=!1,n=e.filter(function(e,n){var o=e[1];return("simpleselector"===o||"delim"===o)&&(t===o&&(r=!0),t=o),n>=2&&"simpleselector"===o}).map(a);return r||"delim"===t||0===n.length||0===n[n.length-1].sequence.length?null:{type:"Selector",info:e[0],selectors:n}},shash:function(e){return{type:"Id",info:e[0],name:e[2]}},simpleselector:function(e){for(var t=[],r=n(e,2),o=!1;r<e.length;r++){var i=e[r];switch(i[1]){case"combinator":o=!1,t.push(i);break;case"s":"combinator"!==t[t.length-1][1]&&(o=i);break;case"comment":break;case"namespace":t[t.length-1]=[{},"ident",t[t.length-1][2]+"|"+e[r+1][2]],r++;break;default:o&&t.push([o[0],"combinator"," "]),o=!1,t.push(i)}}return{type:"SimpleSelector",info:e[0],sequence:t.map(a)}},string:function(e){return{type:"String",info:e[0],value:e[2]}},stylesheet:u,unary:function(e){return{type:"Operator",info:e[0],value:e[2]}},unknown:!1,uri:function(e){return{type:"Url",info:e[0],value:o(e,2,e.length-1)[0]}},value:function(e){return{type:"Value",info:e[0],sequence:o(e,2,e.length-1)}},vhash:function(e){return{type:"Hash",info:e[0],value:e[2]}}};t.exports=a},{}],2:[function(e,t,r){function n(e,t,r,n){for(var o=[e.info,t],a=e[r],u=0;u<a.length;u++)o.push(i(a[u])),u!==a.length-1&&o.push(n.slice());return o}function o(e,t){for(var r=0;r<t.length;r++)e.push.apply(e,t[r].sequence.map(i)),r!==t.length-1&&e.push([{},"operator",","])}function i(e){switch(e.type){case"StyleSheet":return[e.info||{},"stylesheet"].concat(e.rules.map(i).filter(Boolean));case"Atrule":var t="atruler";e.block?"Block"===e.block.type&&(t="atruleb"):t="atrules";var r=[e.info,t,[{},"atkeyword",[{},"ident",e.name]]];return e.expression&&e.expression.sequence.length?"atruler"===t?r.push([e.expression.info,"atrulerq",[{},"s"," "]].concat(e.expression.sequence.map(i))):(r.push([{},"s"," "]),r=r.concat(e.expression.sequence.map(i))):"atruler"===t&&r.push([{},"atrulerq"]),e.block&&("atruler"===t?r.push([e.block.info,"atrulers"].concat(e.block.rules.map(i))):r.push(i(e.block))),r;case"Ruleset":return e.selector?[e.info,"ruleset",i(e.selector),i(e.block)]:[e.info,"ruleset",i(e.block)];case"Selector":return n(e,"selector","selectors",[{},"delim"]);case"SimpleSelector":var r=[e.info,"simpleselector"];return e.sequence.forEach(function(e){e=i(e),"ident"===e[1]&&/\|/.test(e[2])?r.push([{},"ident",e[2].split("|")[0]],[{},"namespace"],[{},"ident",e[2].split("|")[1]]):r.push(e)}),r;case"Negation":var a=n(e,"functionBody","sequence",[{},"delim"]);return[e.info,"pseudoc",[{},"funktion",[{},"ident","not"],a]];case"Attribute":var r=[e.info,"attrib"];return/\|/.test(e.name.name)?r=r.concat([[{},"ident",e.name.name.split("|")[0]],[{},"namespace"],[{},"ident",e.name.name.split("|")[1]]]):r.push([{},"ident",e.name.name]),e.operator&&r.push([{},"attrselector",e.operator]),e.value&&r.push(i(e.value)),r;case"FunctionalPseudo":if(/^nth-/.test(e.name)){var r=[e.info,"nthselector",[{},"ident",e.name]];return o(r,e.arguments),r}var a=[{},"functionBody"];return o(a,e.arguments),[e.info,"pseudoc",[{},"funktion",[{},"ident",e.name],a]];case"Function":var a=[{},"functionBody"];return o(a,e.arguments),"expression"===e.name?[{},"functionExpression",a[2][2]]:[e.info,"funktion",[{},"ident",e.name],a];case"Argument":return;case"Block":return n(e,"block","declarations",[{},"decldelim"]);case"Declaration":return[e.info,e.value.sequence.length&&"Progid"===e.value.sequence[0].type&&/(-[a-z]+-|[\*-_])?filter$/.test(e.property.name)?"filter":"declaration",i(e.property),i(e.value)];case"Braces":return[e.info,"braces",e.open,e.close].concat(e.sequence.map(i));case"Value":return[e.info,e.sequence.length&&"Progid"===e.sequence[0].type?"filterv":"value"].concat(e.sequence.map(i));case"Url":return[e.info,"uri",i(e.value)];case"Progid":return[e.info,"progid",i(e.value)];case"Property":return[e.info,"property",[{},"ident",e.name]];case"Combinator":return" "===e.name?[e.info,"s",e.name]:[e.info,"combinator",e.name];case"Identifier":return[e.info,"ident",e.name];case"PseudoElement":return[e.info,"pseudoe",[{},"ident",e.name]];case"PseudoClass":return[e.info,"pseudoc",[{},"ident",e.name]];case"Class":return[e.info,"clazz",[{},"ident",e.name]];case"Id":return[e.info,"shash",e.name];case"Nth":return[e.info,"nth",e.value];case"Hash":return[e.info,"vhash",e.value];case"Number":return[e.info,"number",e.value];case"Dimension":return[e.info,"dimension",[{},"number",e.value],[{},"ident",e.unit]];case"Operator":return[e.info,"+"===e.value||"-"===e.value?"unary":"operator",e.value];case"Raw":return[e.info,e.value&&/\S/.test(e.value)?"raw":"s",e.value];case"String":return[e.info,"string",e.value];case"Important":return[e.info,"important"];case"Percentage":return[e.info,"percentage",[{},"number",e.value]];case"Space":return[e.info,"s"," "];case"Comment":return[e.info,"comment",e.value];default:console.warn("Unknown node type:",e)}}t.exports=function(e){return e?i(e):[]}},{}],3:[function(e,t,r){function n(e,t){for(var r=0;r<e.length;r++)i(e[r],t,e,r)}function o(e,t,r){for(var n=0;n<e.length;n++)i(e[n],t,e,n),n!==e.length-1&&t.push(r)}function i(e,t,r,a){switch(e.type){case"Atrule":t.push("@",e.name),e.expression&&e.expression.sequence.length&&(t.push(" "),i(e.expression,t)),e.block?(t.push("{"),i(e.block,t),t.push("}")):t.push(";");break;case"Declaration":i(e.property,t),t.push(":"),i(e.value,t);break;case"Attribute":t.push("["),i(e.name,t),e.operator&&t.push(e.operator),e.value&&i(e.value,t),t.push("]");break;case"FunctionalPseudo":t.push(":",e.name,"("),o(e.arguments,t,","),t.push(")");break;case"Function":t.push(e.name,"("),o(e.arguments,t,","),t.push(")");break;case"Block":o(e.declarations,t,";");break;case"Ruleset":e.selector&&i(e.selector,t),t.push("{"),i(e.block,t),t.push("}");break;case"Selector":o(e.selectors,t,",");break;case"Negation":t.push(":not("),o(e.sequence,t,","),t.push(")");break;case"Braces":t.push(e.open),n(e.sequence,t),t.push(e.close);break;case"Argument":case"AtruleExpression":case"Value":case"SimpleSelector":n(e.sequence,t);break;case"StyleSheet":n(e.rules,t);break;case"Url":t.push("url("),i(e.value,t),t.push(")");break;case"Progid":i(e.value,t);break;case"Property":case"Combinator":case"Identifier":t.push(e.name);break;case"PseudoClass":t.push(":",e.name);break;case"PseudoElement":t.push("::",e.name);break;case"Class":t.push(".",e.name);break;case"Dimension":t.push(e.value,e.unit);break;case"Id":t.push("#",e.name);break;case"Hash":t.push("#",e.value);break;case"Nth":case"Number":case"String":case"Operator":case"Raw":t.push(e.value);break;case"Important":t.push("!important");break;case"Percentage":t.push(e.value,"%");break;case"Space":t.push(" ");break;case"Comment":t.push("/*",e.value,"*/");break;default:console.warn("Unknown node type:",e)}}t.exports=function(e){var t=[];return i(e,t),t.join("")}},{}],4:[function(e,t,r){function n(e,t,r){for(var n=0;n<e.length;n++){var o=e[n],i=t.call(this,o,r,e,n);null===i?(e.splice(n,1),n--):i&&i!==o&&e.splice(n,1,i)}}function o(e,t,r){for(var n=e.length-1;n>=0;n--){var o=e[n],i=t.call(this,o,r,e,n);null===i?e.splice(n,1):i&&i!==o&&e.splice(n,1,i)}}function i(e,t,r,o){switch(e.type){case"StyleSheet":n.call(this,e.rules,i,e);break;case"Atrule":return e.block&&i.call(this,e.block),this.fn(e,t,r,o);case"Ruleset":return this.fn(e,t,r,o)}}function a(e,t,r,n){switch(e.type){case"StyleSheet":o.call(this,e.rules,a,e);break;case"Atrule":return e.block&&a.call(this,e.block),this.fn(e,t,r,n);case"Ruleset":return this.fn(e,t,r,n)}}function u(e,t,r,o){switch(this.stack.push(e),e.type){case"Atrule":e.expression&&u.call(this,e.expression,e),e.block&&u.call(this,e.block,e);break;case"Declaration":u.call(this,e.property,e),u.call(this,e.value,e);break;case"Attribute":u.call(this,e.name,e),e.value&&u.call(this,e.value,e);break;case"FunctionalPseudo":case"Function":n.call(this,e.arguments,u,e);break;case"Block":n.call(this,e.declarations,u,e);break;case"Ruleset":e.selector&&u.call(this,e.selector,e),u.call(this,e.block,e);break;case"Selector":n.call(this,e.selectors,u,e);break;case"Argument":case"AtruleExpression":case"Braces":case"Negation":case"Value":case"SimpleSelector":n.call(this,e.sequence,u,e);break;case"StyleSheet":n.call(this,e.rules,u,e);break;case"Url":case"Progid":u.call(this,e.value,e);break;case"Property":case"Combinator":case"Dimension":case"Hash":case"Identifier":case"Important":case"Nth":case"Class":case"Id":case"Percentage":case"PseudoClass":case"PseudoElement":case"Space":case"Number":case"String":case"Operator":case"Raw":}return this.stack.pop(e),this.fn(e,t,r,o)}t.exports={all:function(e,t){u.call({fn:t,root:e,stack:[]},e)},rules:function(e,t){i.call({fn:t,root:e,stack:[]},e)},rulesRight:function(e,t){a.call({fn:t,root:e,stack:[]},e)}}},{}],5:[function(e,t,r){t.exports=function(e,t,r,n){if(e.block){if(this.root.firstAtrulesAllowed=!1,"Block"===e.block.type&&!e.block.declarations.length)return null;if("StyleSheet"===e.block.type&&!e.block.rules.length)return null}switch(e.name){case"charset":if(!e.expression.sequence.length)return null;if(n)return null;break;case"import":if(!this.root.firstAtrulesAllowed)return null;for(n-=1;n>=0;n--){var o=r[n];if("Atrule"!==o.type||"import"!==o.name&&"charset"!==o.name)return this.root.firstAtrulesAllowed=!1,null}}}},{}],6:[function(e,t,r){t.exports=function(e){return e.value.sequence.length?void 0:null}},{}],7:[function(e,t,r){t.exports=function(e){return e.selector&&e.block.declarations.length?void 0:null}},{}],8:[function(e,t,r){function n(e,t){switch(e.type){case"Important":case"Nth":return!0;case"Operator":return"+"!==e.value&&"-"!==e.value}if(t)switch(e.type){case"Function":case"Braces":case"Url":return!0}}t.exports=function(e,t,r,o){var i=r[o-1],a=r[o+1],u=i.type,s=a.type;return"Url"===u&&s||"Braces"===u&&"Identifier"===s||"Function"===u&&("Function"===s||"Hash"===s)||"Braces"===u&&"Operator"===s&&("+"===a.value||"-"===a.value)?void 0:"Identifier"===u&&"*"===i.name||"Identifier"===s&&"*"===a.name?null:n(a,!1)||n(i,!0)?null:void 0}},{}],9:[function(e,t,r){var n={Space:e("./Space.js"),Atrule:e("./Atrule.js"),Ruleset:e("./Ruleset.js"),Declaration:e("./Declaration.js")};t.exports=function(e,t,r,o){return n.hasOwnProperty(e.type)?n[e.type].call(this,e,t,r,o):void 0}},{"./Atrule.js":5,"./Declaration.js":6,"./Ruleset.js":7,"./Space.js":8}],10:[function(e,t,r){var n=e("./atrule/keyframes.js");t.exports=function(e,t,r,o){/^(-[a-z\d]+-)?keyframes$/.test(e.name)&&n(e,t,r,o)}},{"./atrule/keyframes.js":16}],11:[function(e,t,r){function n(e){return""!==e&&"-"!==e?(e=e.replace(o,"a"),!i.test(e)):void 0}var o=/\\([0-9A-Fa-f]{1,6})[ \t\n\f\r]?|\\./g,i=/^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;t.exports=function(e){var t=e.value;if(t&&"String"===t.type){var r=t.value.replace(/^(.)(.*)\1$/,"$2");n(r)&&(e.value={type:"Identifier",info:t.info,name:r})}}},{}],12:[function(e,t,r){var n=e("./Number.js").pack,o={deg:!0,grad:!0,rad:!0,turn:!0,s:!0,ms:!0,Hz:!0,kHz:!0,dpi:!0,dpcm:!0,dppx:!0};t.exports=function(e,t){var r=n(e.value),i=e.unit;if(e.value=r,"0"===r&&!o[i]){if("Value"===t.type&&"flex"===this.stack[this.stack.length-2].property.name)return;for(var a=this.stack.length-1;a>=0;a--){var u=this.stack[a];if("Function"===u.type&&"calc"===u.name)return;if("Braces"!==u.type&&"Argument"!==u.type)break}return{type:"Number",info:e.info,value:r}}}},{"./Number.js":13}],13:[function(e,t,r){function n(e){return e=String(e).replace(/^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,"$1$2$3"),(""===e||"-"===e)&&(e="0"),e}t.exports=function(e){e.value=n(e.value)},t.exports.pack=n},{}],14:[function(e,t,r){t.exports=function(e){var t=e.value;t=t.replace(/\\\n/g,""),e.value=t}},{}],15:[function(e,t,r){var n=e("./property/font.js"),o=e("./property/font-weight.js"),i=e("./property/background.js");t.exports=function(e,t){var r=t.property.name;/background$/.test(r)?i(e):/font$/.test(r)?n(e):/font-weight$/.test(r)&&o(e)}},{"./property/background.js":19,"./property/font-weight.js":20,"./property/font.js":21}],16:[function(e,t,r){t.exports=function(e){e.block.rules.forEach(function(e){e.selector.selectors.forEach(function(e){for(var t=e.sequence,r=0;r<t.length;r++){var n=t[r];"Percentage"===n.type&&"100"===n.value?t[r]={type:"Identifier",info:t[r].info,name:"to"}:"Identifier"===n.type&&"from"===n.name&&(t[r]={type:"Percentage",info:t[r].info,value:"0"})}})})}},{}],17:[function(e,t,r){function n(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?e+6*(t-e)*r:.5>r?t:2/3>r?e+(t-e)*(2/3-r)*6:e}function o(e,t,r,o){var i,a,u;if(0==t)i=a=u=r;else{var s=.5>r?r*(1+t):r+t-r*t,c=2*r-s;i=n(c,s,e+1/3),a=n(c,s,e),u=n(c,s,e-1/3)}return[Math.round(255*i),Math.round(255*a),Math.round(255*u),o]}function i(e){return e=e.toString(16),1===e.length?"0"+e:e}function a(e,t,r){for(var n=[],o=0;o<e.length;o++)for(var i=e[o].sequence,a=!1,u=0;u<i.length;u++){var s=i[u],c=s.type;switch(c){case"Number":case"Percentage":if(a)return;a=!0,n.push({type:c,value:Number(s.value)});break;case"Operator":if(a||"+"!==s.value)return;break;default:return}}if(n.length===t){if(4===n.length){if("Number"!==n[3].type)return;n[3].type="Alpha"}if(r){if(n[0].type!==n[1].type||n[0].type!==n[2].type)return}else{if("Number"!==n[0].type||"Percentage"!==n[1].type||"Percentage"!==n[2].type)return;n[0].type="Angle"}return n.map(function(e,t){var n=Math.max(0,e.value);switch(e.type){case"Number":n=Math.min(n,255);break;case"Percentage":if(n=Math.min(n,100)/100,!r)return n;n=255*n;break;case"Angle":return(n%360+360)%360/360;case"Alpha":return Math.min(n,1)}return Math.round(n)})}}function u(e,t,r,n){var u,s=e.name;if("rgba"===s||"hsla"===s){if(u=a(e.arguments,4,"rgba"===s),!u)return;if("hsla"===s&&(u=o.apply(null,u),e.name="rgba"),1!==u[3])return void e.arguments.forEach(function(e,t){var r=e.sequence[0];"Operator"===r.type&&(r=e.sequence[1]),e.sequence=[{type:"Number",info:r.info,value:l(u[t])}]});s="rgb"}if("hsl"===s){if(u=u||a(e.arguments,3,!1),!u)return;u=o.apply(null,u),s="rgb"}if("rgb"===s){if(u=u||a(e.arguments,3,!0),!u)return;var f=r&&n<r.length-1?r[n+1]:null;f&&"Space"!==f.type&&r.splice(n+1,0,{type:"Space"});var p={type:"Hash",info:e.info,value:i(u[0])+i(u[1])+i(u[2])};return c(p)||p}}function s(e,t){var r=t.type;if("Value"===r||"Function"===r){var n=e.name.toLowerCase(),o=f[n];if(o){if(o.length+1<=n.length)return{type:"Hash",info:e.info,value:o};"grey"===n&&(n="gray"),e.name=n}}}function c(e){var t=e.value.toLowerCase();return 6===t.length&&t[0]===t[1]&&t[2]===t[3]&&t[4]===t[5]&&(t=t[0]+t[2]+t[4]),p[t]?{type:"Identifier",info:e.info,name:p[t]}:void(e.value=t)}var l=e("./Number.js").pack,f={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",darkgrey:"a9a9a9",darkgreen:"006400",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",grey:"808080",green:"008000",greenyellow:"adff2f",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",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",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:"639",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"},p={800000:"maroon",800080:"purple",808000:"olive",808080:"gray","00ffff":"cyan",f0ffff:"azure",f5f5dc:"beige",ffe4c4:"bisque","000000":"black","0000ff":"blue",a52a2a:"brown",ff7f50:"coral",ffd700:"gold","008000":"green","4b0082":"indigo",fffff0:"ivory",f0e68c:"khaki","00ff00":"lime",faf0e6:"linen","000080":"navy",ffa500:"orange",da70d6:"orchid",cd853f:"peru",ffc0cb:"pink",dda0dd:"plum",f00:"red",ff0000:"red",fa8072:"salmon",a0522d:"sienna",c0c0c0:"silver",fffafa:"snow",d2b48c:"tan","008080":"teal",ff6347:"tomato",ee82ee:"violet",f5deb3:"wheat",ffffff:"white",ffff00:"yellow"};t.exports={compressFunction:u,compressIdent:s,compressHex:c}},{"./Number.js":13}],18:[function(e,t,r){var n={Atrule:e("./Atrule.js"),Attribute:e("./Attribute.js"),Value:e("./Value.js"),Dimension:e("./Dimension.js"),Percentage:e("./Number.js"),Number:e("./Number.js"),String:e("./String.js"),Hash:e("./color.js").compressHex,Identifier:e("./color.js").compressIdent,Function:e("./color.js").compressFunction};t.exports=function(e,t,r,o){return n.hasOwnProperty(e.type)?n[e.type].call(this,e,t,r,o):void 0}},{"./Atrule.js":10,"./Attribute.js":11,"./Dimension.js":12,"./Number.js":13,"./String.js":14,"./Value.js":15,"./color.js":17}],19:[function(e,t,r){t.exports=function(e){function t(){return o.length?o[o.length-1].type:void 0}function r(){"Space"===t()&&o.pop(),(!o.length||1===o.length&&"Important"===o[0].type)&&o.unshift({type:"Number",value:"0"},{type:"Space"},{type:"Number",value:"0"}),n.push.apply(n,o),o=[]}var n=[],o=[];e.sequence.forEach(function(e){return"Operator"===e.type&&","===e.value?(r(),void n.push(e)):void(("Identifier"!==e.type||"transparent"!==e.name&&"none"!==e.name&&"repeat"!==e.name&&"scroll"!==e.name)&&("Space"!==e.type||o.length&&"Space"!==t())&&o.push(e))}),r(),e.sequence=n}},{}],20:[function(e,t,r){t.exports=function(e){var t=e.sequence[0];if("Identifier"===t.type)switch(t.name){case"normal":e.sequence[0]={type:"Number",info:t.info,value:"400"};break;case"bold":e.sequence[0]={type:"Number",info:t.info,value:"700"}}}},{}],21:[function(e,t,r){t.exports=function(e){for(var t=e.sequence,r=t.length-1;r>=0;r--){var n=t[r];if("Identifier"===n.type)if("bold"===n.name)t[r]={type:"Number",info:e.info,value:"700"};else if("normal"===n.name){var o=r?t[r-1]:null;o&&"Operator"===o.type&&"/"===o.value?t.splice(--r,2):t.splice(r,1)}else if("medium"===n.name){var i=r<t.length-1?t[r+1]:null;i&&"Operator"===i.type||t.splice(r,1)}}for(var r=0;r<t.length;r++)"Space"===t[r].type&&(r&&r!==t.length-1&&"Space"!==t[r+1].type||(t.splice(r,1),r--));t.length||t.push({type:"Identifier",name:"normal"}),e.sequence=t}},{}],22:[function(e,t,r){function n(e){var t;return e?function(r,n,o){var i=(o?"":"("+((Date.now()-t)/1e3).toFixed(3)+"ms) ")+r;if(e>1&&n){var a=c(n,!0).trim();2===e&&a.length>256&&(a=a.substr(0,256)+"..."),i+="\n "+a+"\n"}console.error(i),t=Date.now()}:function(){}}function o(e){for(var t=e.length-1;t>-1;t--){var r=e[t];Array.isArray(r)&&(o(r),r.unshift({}))}}function i(e,t){for(var r,n=[],o=!1,i=t;i<e.length;i++){var a=e[i];if("comment"!==a[1]||"!"!==a[2].charAt(0))"s"!==a[1]&&(o=!0),n.push(a);else{if(o||r)break;r=a}}return{comment:r,stylesheet:[{},"stylesheet"].concat(n),offset:i}}function a(e,t,r,n){function o(e,t){l(i,t),n(e,i)}n("Compress block #"+r,null,!0);var i=u(e);return n("convertToInternal",i),i.firstAtrulesAllowed=e.firstAtrulesAllowed,o("clean",f),o("compress",p),t&&h(i,n),i}var u=e("./ast/gonzalesToInternal.js"),s=e("./ast/internalToGonzales.js"),c=e("./ast/translate.js"),l=e("./ast/walk.js").all,f=e("./clean"),p=e("./compress"),h=e("./restructure");t.exports=function(e,t){e=e||[{},"stylesheet"],t=t||{};var r=n(t.debug),u=t.restructuring||void 0===t.restructuring,c=[],l={offset:2},f=!0,p=1;"string"==typeof e[0]&&o([e]);do if(l=i(e,l.offset),l.stylesheet.firstAtrulesAllowed=f,l.stylesheet=a(l.stylesheet,u,p++,r),l.comment&&(c.length&&c.push({type:"Raw",value:"\n"}),c.push({type:"Comment",value:l.comment[2]}),l.stylesheet.rules.length&&c.push({type:"Raw",value:"\n"})),c.push.apply(c,l.stylesheet.rules),f&&c.length){var h=c[c.length-1];("Atrule"!==h.type||"import"!==h.name&&"charset"!==h.name)&&(f=!1)}while(l.offset<e.length);return t.outputAst&&"gonzales"!==t.outputAst?{type:"StyleSheet",rules:c}:s({type:"StyleSheet",rules:c})}},{"./ast/gonzalesToInternal.js":1,"./ast/internalToGonzales.js":2,"./ast/translate.js":3,"./ast/walk.js":4,"./clean":9,"./compress":18,"./restructure":24}],23:[function(e,t,r){var n=e("./utils.js");t.exports=function(e,t,r,o){var i=e.selector.selectors;if(i.length>1){for(var a=i.length-1;a>=1;a--)r.splice(o+1,0,{type:"Ruleset",info:n.copyObject(e.info),selector:{type:"Selector",info:n.copyObject(e.selector.info),selectors:[i[a]]},block:{type:"Block",info:n.copyObject(e.block.info),declarations:e.block.declarations.slice()}});e.selector.selectors=[e.selector.selectors[0]]}}},{"./utils.js":35}],24:[function(e,t,r){var n=e("../ast/walk.js").all,o=e("../ast/walk.js").rules,i=e("../ast/walk.js").rulesRight,a=e("./prepare/index.js"),u=e("./markShorthands.js"),s=e("./processShorthands.js"),c=e("./disjoinRuleset.js"),l=e("./rejoinRuleset.js"),f=e("./initialRejoinRuleset.js"),p=e("./rejoinAtrule.js"),h=e("./restructBlock.js"),d=e("./restructRuleset.js");t.exports=function(e,t){function r(r,o){n(e,o),t(r,e)}function y(r,n){o(e,function(e){return"Ruleset"===e.type?n.apply(this,arguments):void 0}),t(r,e)}function m(r,n){i(e,function(e){return"Ruleset"===e.type?n.apply(this,arguments):void 0}),t(r,e)}function g(r,n){i(e,function(e){return"Atrule"===e.type?n.apply(this,arguments):void 0}),t(r,e)}r("prepare",a),m("initialRejoinRuleset",f),g("rejoinAtrule",p),m("disjoin",c);var v=[];m("buildMaps",function(e,t){var r=t.info.selectorsMap;r||(r=t.info.selectorsMap={},t.info.shortDeclarations=v,t.info.lastShortSelector=null);var n=e.selector.selectors[0].info.s;n in r==!1&&(r[n]={props:{},shorts:{}})}),m("markShorthands",u),s(v),t("processShorthand",e),m("restructBlock",h),y("rejoinRuleset",l),m("restructRuleset",d)}},{"../ast/walk.js":4,"./disjoinRuleset.js":23,"./initialRejoinRuleset.js":25,"./markShorthands.js":26,"./prepare/index.js":28,"./processShorthands.js":30,"./rejoinAtrule.js":31,"./rejoinRuleset.js":32,"./restructBlock.js":33,"./restructRuleset.js":34}],25:[function(e,t,r){var n=e("./utils.js");t.exports=function(e,t,r,o){var i=e.selector.selectors,a=e.block;if(!a.declarations.length)return null;for(o-=1;o>=0;o--){var u=r[o];if("Ruleset"!==u.type)return;var s=u.selector.selectors,c=u.block;if(e.info.pseudoSignature!==u.info.pseudoSignature)return;var l=n.getHash(s),f=n.getHash(i);if(n.equalHash(f,l))return c.declarations.push.apply(c.declarations,a.declarations),null;if(!n.isCompatibleSignatures(e,u))return;var p=n.compareRulesets(e,u);if(!p.ne1.length&&!p.ne2.length)return n.addToSelector(s,i),null;for(var h=0;h<s.length;h++)for(var d=0;d<i.length;d++)if(s[h].info.compareMarker===i[d].info.compareMarker)return}}},{"./utils.js":35}],26:[function(e,t,r){function n(e,t){this.name=n.extractMain(e),this.important=t?4:0,this.sides={top:null,right:null,bottom:null,left:null}}var o=/vh|vw|vmin|vmax|vm|rem|\\9/,i=0,a=1,u=2,s=3,c=["top","right","bottom","left"],l={"margin-top":"top","margin-right":"right","margin-bottom":"bottom","margin-left":"left","padding-top":"top","padding-right":"right","padding-bottom":"bottom","padding-left":"left","border-top-color":"top","border-right-color":"right","border-bottom-color":"bottom","border-left-color":"left","border-top-width":"top","border-right-width":"right","border-bottom-width":"bottom","border-left-width":"left","border-top-style":"top","border-right-style":"right","border-bottom-style":"bottom","border-left-style":"left"},f={margin:"margin","margin-top":"margin","margin-right":"margin","margin-bottom":"margin","margin-left":"margin",padding:"padding","padding-top":"padding","padding-right":"padding","padding-bottom":"padding","padding-left":"padding","border-color":"border-color","border-top-color":"border-color","border-right-color":"border-color","border-bottom-color":"border-color","border-left-color":"border-color","border-width":"border-width","border-top-width":"border-width","border-right-width":"border-width","border-bottom-width":"border-width","border-left-width":"border-width","border-style":"border-style","border-top-style":"border-style","border-right-style":"border-style","border-bottom-style":"border-style","border-left-style":"border-style"};n.props=f,n.extractMain=function(e){return f[e]},n.prototype.impSum=function(){var e=0,t=0;for(var r in this.sides)this.sides[r]&&(e++,this.sides[r].important&&t++);return t===e?t:0},n.prototype.add=function(e,t,r,n){function o(e,t){h.push({s:t,node:e,important:n})}var f=this.sides,p=l[e],h=[];if(n=n?1:0,p){if(p in f){var d=f[p];return(!d||n&&!d.important)&&(f[p]={s:n?t.substring(0,t.length-10):t,node:r[0],important:n}),!0}}else if(e===this.name){for(var y=0;y<r.length;y++){var m=r[y];switch(m.type){case"Identifier":o(m,m.name);break;case"Number":o(m,m.value);break;case"Percentage":o(m,m.value+"%");break;case"Dimension":o(m,m.value+m.unit);break;case"Space":case"Important":break;default:return!1}}if(h.length>4)return!1;h[a]||(h[a]=h[i]),h[u]||(h[u]=h[i]),h[s]||(h[s]=h[a]);for(var y=0;4>y;y++)(!f[c[y]]||n&&!f[c[y]].important)&&(f[c[y]]=h[y]);return!0}},n.prototype.isOkToMinimize=function(){var e=this.sides.top,t=this.sides.right,r=this.sides.bottom,n=this.sides.left;if(e&&t&&r&&n){if(o.test([e.s,t.s,r.s,n.s].join(" ")))return!1;var i=e.important+t.important+r.important+n.important;return 0===i||4===i||i===this.important}return!1},n.prototype.getValue=function(){var e={type:"Value",info:{},sequence:[]},t=this.sides,r=[t.top,t.right,t.bottom,t.left];t.left.s===t.right.s&&(r.pop(),t.bottom.s===t.top.s&&(r.pop(),t.right.s===t.top.s&&r.pop())),e.sequence.push(r[i].node);for(var n=1;n<r.length;n++)e.sequence.push({type:"Space"},r[n].node);return this.impSum()&&e.sequence.push({type:"Important"}),e},n.prototype.getProperty=function(){return{type:"Property",info:{s:this.name},name:this.name}},t.exports=function(e,t){for(var r=e.block.declarations,o=e.selector.selectors[0].info.s,i=e.info.freezeID||"",a=t.info.selectorsMap[o].shorts,u=r.length-1;u>=0;u--){
16
- var s=r[u];if("Declaration"===s.type){var c=s.info,l=s.property.info.s,f=s.value,p="Important"===f.sequence[f.sequence.length-1].type;if(l in n.props){var h=i+n.extractMain(l),d=null;t.info.lastShortSelector&&o!==t.info.lastShortSelector||h in a&&(d=a[h],c.removeByShort=!0),d||(d=new n(l,p),c.replaceByShort=!0),d.add(l,f.info.s,f.sequence.slice(0),p),a[h]=d,t.info.shortDeclarations.push({info:d,block:r,declaration:s,pos:u}),t.info.lastShortSelector=o}}}}},{}],27:[function(e,t,r){function n(e){return e.sequence.some(function(e){switch(e.type){case"PseudoClass":case"PseudoElement":case"FunctionalPseudo":if(e.name in f==!1)return!0}})}function o(e){return e.selectors.map(function(e){return e.info.s}).sort().join(",")}function i(e){return e.selectors.some(function(e){return e.sequence.some(function(e){switch(e.type){case"PseudoClass":if(e.name in f==!1)return!0;break;case"PseudoElement":if(e.name in l==!1)return!0;break;case"FunctionalPseudo":return!0}})})}function a(e){var t=[];return e.selectors.forEach(function(e){n(e)&&t.push(e.info.s)}),t.sort().join(",")}function u(e,t){var r={},n=!1;return e.selectors.forEach(function(e){e.sequence.forEach(function(e){switch(e.type){case"PseudoClass":case"PseudoElement":case"FunctionalPseudo":t.hasOwnProperty(e.name)?n=!0:r[e.name]=1}})}),Object.keys(r).sort().join(",")+n}function s(e){var t={};e.selectors.forEach(function(e){var r=e.info;r.pseudo=n(e),r.sg=t,t[r.s]=!0})}var c={after:1,before:1},l={"first-letter":!0,"first-line":!0},f={link:!0,visited:!0,hover:!0,active:!0,"first-letter":!0,"first-line":!0};t.exports=function p(e){var t=e.selector,p=i(t);if(p){var r=e.info;r.freeze=p,r.freezeID=o(t),r.pseudoID=a(t),r.pseudoSignature=u(t,c),s(t)}}},{}],28:[function(e,t,r){function n(e){e.info.s=o(e)}var o=e("../../ast/translate.js"),i=e("./specificity.js"),a=e("./freeze.js"),u={Ruleset:a,Atrule:function(e,t){var r=e.name;/^(-[a-z\d]+-)?keyframes$/.test(r)&&e.block.rules.forEach(function(e){e.selector.selectors.forEach(function(e){e.info.compareMarker=e.info.s})})},SimpleSelector:function(e){for(var t,r=e.info,n=e.sequence,a="*",u=n.length-1;u>=0&&"Combinator"!==n[u].type;u--)t=n[u];"Identifier"===t.type&&(a=t.name),r.compareMarker=i(e)+","+a,r.s=o(e)},AtruleExpression:n,Declaration:n,Property:n,Value:n};t.exports=function(e,t){return u[e.type]?u[e.type].call(this,e,t):void 0}},{"../../ast/translate.js":3,"./freeze.js":27,"./specificity.js":29}],29:[function(e,t,r){var n=2,o=1,i=0;t.exports=function a(e){var a=[0,0,0];return e.sequence.forEach(function t(e){switch(e.type){case"SimpleSelector":case"Negation":e.sequence.forEach(t);break;case"Id":a[i]++;break;case"Class":case"Attribute":case"FunctionalPseudo":a[o]++;break;case"Identifier":"*"!==e.name&&a[n]++;break;case"PseudoElement":a[n]++;break;case"PseudoClass":var r=e.name.toLowerCase();"before"===r||"after"===r||"first-line"===r||"first-letter"===r?a[n]++:a[o]++}}),a}},{}],30:[function(e,t,r){function n(e){var t=e.declaration.info;if(t.removeByShort||t.replaceByShort){var r=e.info;if(r.isOkToMinimize())if(t.replaceByShort){var n={type:"Declaration",info:{},property:r.getProperty(),value:r.getValue()};n.info.s=o(n),e.block.splice(e.pos,1,n)}else e.block.splice(e.pos,1)}}var o=e("../ast/translate");t.exports=function(e){e.forEach(n)}},{"../ast/translate":3}],31:[function(e,t,r){function n(e){return"Atrule"===e.type&&"media"===e.name}t.exports=function(e,t,r,o){if(n(e)){var i=o?r[o-1]:null;if(i&&n(i))return e.expression.info.s===i.expression.info.s?(Array.prototype.push.apply(i.block.rules,e.block.rules),null):void 0}}},{}],32:[function(e,t,r){var n=e("./utils.js");t.exports=function(e,t,r,o){var i=e.selector.selectors,a=e.block.declarations;if(!a.length)return null;var u=i[0].info.compareMarker,s={};for(o+=1;o<r.length;o++){var c=r[o];if("Ruleset"!==c.type)return;if(e.info.pseudoSignature!==c.info.pseudoSignature)return;var l=c.selector.selectors[0],f=c.block.declarations,p=l.info.compareMarker;if(p in s)return;if(1!==i.length||i[0].info.s!==l.info.s){if(!n.isCompatibleSignatures(e,c))return;if(a.length===f.length){for(var h=!0,d=0;d<a.length;d++)if(a[d].info.s!==f[d].info.s){h=!1;break}if(h){for(var y=l.info.s,d=i.length;d>=0;d--)if(!d||y>i[d-1].info.s){i.splice(d,0,l);break}r.splice(o,1),o--;continue}}if(p===u)return;s[p]=!0}else a.push.apply(a,f),r.splice(o,1),o--}}},{"./utils.js":35}],33:[function(e,t,r){function n(e){var t;switch(e.type){case"Identifier":case"Function":t=o(e.name)}return t||""}function o(e){if("-"===e[0]){if(e in c)return c[e];var t=e.indexOf("-",2);if(-1!==t)return c[e]=e.substr(0,t+1)}return""}function i(e){if(e in l)return l[e];var t=e[0];"*"===t||"_"===t||"$"===t?e=e.substr(1):"/"===t&&"/"===e[1]?(t="//",e=e.substr(2)):t="";var r=o(e);return l[e]={prefix:t+r,hack:t,vendor:r,table:d[e.substr(r.length)]}}function a(e,t,r,o){var i=o?"freeze:":"";if(-1!==e.indexOf("background")||-1!==e.indexOf("filter")&&"Progid"===t[0].type)return i+r.info.s;for(var a="",u=0,s={},c={},l=0;l<t.length;l++)switch(a||(a=n(t[l])),t[l].type){case"Identifier":var f=t[l].name;"\\9"===f&&(u=1),p.test(e)&&h.test(f)&&(c[f]=!0);break;case"Function":var f=t[l].name;"rect"===f&&t[l].arguments.length<4&&(f="rect-backward"),s[f]=!0;break;case"Dimension":var d=t[l].unit;switch(d){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":c[d]=!0}}return i+e+"["+Object.keys(s)+"]"+Object.keys(c)+u+a}function u(e,t,r,n,o,u){var s=i(e),c=s.table;if(c)for(var l=0;l<c.length;l++){var f=a(s.prefix+c[l],n,o,u),p=t[f];if(p)return!r||p.important}}var s=e("./utils.js"),c={},l={},f={src:1},p=/display$/,h=/table|ruby|flex|-(flex)?box$|grid|contents|run-in/,d={"border-width":["border"],"border-style":["border"],"border-color":["border"],"border-top":["border"],"border-right":["border"],"border-bottom":["border"],"border-left":["border"],"border-top-width":["border-top","border-width","border"],"border-right-width":["border-right","border-width","border"],"border-bottom-width":["border-bottom","border-width","border"],"border-left-width":["border-left","border-width","border"],"border-top-style":["border-top","border-style","border"],"border-right-style":["border-right","border-style","border"],"border-bottom-style":["border-bottom","border-style","border"],"border-left-style":["border-left","border-style","border"],"border-top-color":["border-top","border-color","border"],"border-right-color":["border-right","border-color","border"],"border-bottom-color":["border-bottom","border-color","border"],"border-left-color":["border-left","border-color","border"],"margin-top":["margin"],"margin-right":["margin"],"margin-bottom":["margin"],"margin-left":["margin"],"padding-top":["padding"],"padding-right":["padding"],"padding-bottom":["padding"],"padding-left":["padding"],"font-style":["font"],"font-variant":["font"],"font-weight":["font"],"font-size":["font"],"font-family":["font"],"list-style-type":["list-style"],"list-style-position":["list-style"],"list-style-image":["list-style"]};t.exports=function(e,t){for(var r=e.info,n=e.selector.selectors[0].info,o=e.block.declarations,i=r.freeze,c=r.freezeID,l=r.pseudoID,p=n.pseudo,h=n.sg,d=t.info.selectorsMap[n.s].props,y=o.length-1;y>=0;y--){var m=o[y];if("Declaration"===m.type){var g=m.value.sequence,v="Important"===g[g.length-1].type,b=m.property.info.s,k=a(b,g,m,i),S=d[k];!f[b]&&S?(p&&c===S.freezeID||!p&&l===S.pseudoID||p&&l===S.pseudoID&&s.hashInHash(h,S.sg))&&(v&&!S.important?(d[k]={block:o,child:m,important:v,sg:h,freezeID:c,pseudoID:l},S.block.splice(S.block.indexOf(S.child),1)):o.splice(y,1)):u(b,d,v,g,m,i)?o.splice(y,1):(m.info.fingerprint=k,d[k]={block:o,child:m,important:v,sg:h,freezeID:c,pseudoID:l})}}return o.length?void 0:null}},{"./utils.js":35}],34:[function(e,t,r){function n(e){for(var t=0,r=0;r<e.length;r++)t+=e[r].info.s.length;return t}var o=e("./utils.js");t.exports=function(e,t,r,i){var a=e.selector.selectors,u=e.block;for(i-=1;i>=0;i--){var s=r[i];if("Ruleset"!==s.type)return;var c=s.selector.selectors,l=s.block;if(e.info.pseudoSignature!==s.info.pseudoSignature)return;var f=o.getHash(c),p=o.getHash(a);if(o.equalHash(p,f))return l.declarations.push.apply(l.declarations,u.declarations),null;var h=o.compareRulesets(e,s);if(h.eq.length)if(h.ne1.length||h.ne2.length)if(h.ne1.length&&!h.ne2.length){var d=a.length-2,y=n(a)+d-1,m=n(h.eq)+h.eq.length-1;m>y&&(o.addToSelector(c,a),e.block={type:"Block",info:u.info,declarations:h.ne1})}else if(!h.ne1.length&&h.ne2.length){var d=c.length-2,y=n(c)+d-1,m=n(h.eq)+h.eq.length-1;m>y&&(o.addToSelector(a,c),s.block={type:"Block",info:l.info,declarations:h.ne2})}else{var g={type:"Selector",info:{},selectors:o.addToSelector(c.slice(),a)},v=n(g.selectors)+g.selectors.length-1+2,m=n(h.eq)+h.eq.length-1;if(m>=v){var b={type:"Ruleset",info:{},selector:g,block:{type:"Block",info:{},declarations:h.eq}};return e.block={type:"Block",info:u.info,declarations:h.ne1},s.block={type:"Block",info:l.info,declarations:h.ne2.concat(h.ne2overrided)},void r.splice(i,0,b)}}else if(o.isCompatibleSignatures(e,s))return o.addToSelector(c,a),null;for(var k=0;k<c.length;k++)for(var S=0;S<a.length;S++)if(c[k].info.compareMarker===a[S].info.compareMarker)return}}},{"./utils.js":35}],35:[function(e,t,r){function n(e){var t={};for(var r in e)t[r]=e[r];return t}function o(e,t){for(var r in e)if(r in t==!1)return!1;for(var r in t)if(r in e==!1)return!1;return!0}function i(e){for(var t={},r=0;r<e.length;r++)t[e[r].info.s]=!0;return t}function a(e,t){for(var r in e)if(r in t==!1)return!1;return!0}function u(e,t){for(var r={eq:[],ne1:[],ne2:[],ne2overrided:[]},n=e.block.declarations,o=t.block.declarations,a=i(n),u=i(o),s={},c=0;c<n.length;c++)n[c].info.fingerprint&&(s[n[c].info.fingerprint]=!0);for(var c=0;c<n.length;c++){var l=n[c];l.info.s in u?r.eq.push(l):r.ne1.push(l)}for(var c=0;c<o.length;c++){var l=o[c];l.info.s in a==!1&&(l.info.fingerprint in s==!1?r.ne2.push(l):r.ne2overrided.push(l))}return r}function s(e,t){e:for(var r=0;r<t.length;r++){for(var n=t[r].info.s,o=e.length;o>0;o--){var i=e[o-1].info.s;if(i===n)continue e;if(n>i)break}e.splice(o,0,t[r])}return e}function c(e,t){var r=e.info,n=t.info;if(r.freezeID===n.freezeID)return!0;if(r.pseudoID===n.pseudoID)return!0;if(r.freeze&&n.freeze){var o=r.pseudoSignature,i=n.pseudoSignature;return o===i}return!r.freeze&&!n.freeze}t.exports={copyObject:n,equalHash:o,getHash:i,hashInHash:a,isCompatibleSignatures:c,compareRulesets:u,addToSelector:s}},{}],36:[function(e,t,r){var n=e("./parser"),o=e("./compressor"),i=e("./compressor/ast/translate"),a=e("./utils/walker"),u=e("./utils/translate"),s=e("./utils/stringify"),c=e("./utils/cleanInfo"),l=function(e,t,r){console.warn("`csso.justDoIt()` method is deprecated, use `csso.minify()` instead");var a=n(e,"stylesheet",r),u=o(a,{restructuring:!t,outputAst:"internal"});return i(u)},f=function(e,t){var r={outputAst:"internal"};if(t)for(var a in t)r[a]=t[a];var u=Date.now(),s=n(e,"stylesheet",!0);r.debug&&console.error("## parsing done in %d ms\n",Date.now()-u);var u=Date.now(),c=o(s,r);return r.debug&&console.error("## compressing done in %d ms\n",Date.now()-u),i(c)};t.exports={version:e("../package.json").version,minify:f,parse:n,compress:o,translate:u,walk:a,stringify:s,cleanInfo:c,justDoIt:l}},{"../package.json":44,"./compressor":22,"./compressor/ast/translate":3,"./parser":38,"./utils/cleanInfo":40,"./utils/stringify":41,"./utils/translate":42,"./utils/walker":43}],37:[function(e,t,r){t.exports={StringSQ:"StringSQ",StringDQ:"StringDQ",CommentML:"CommentML",CommentSL:"CommentSL",Newline:"Newline",Space:"Space",Tab:"Tab",ExclamationMark:"ExclamationMark",QuotationMark:"QuotationMark",NumberSign:"NumberSign",DollarSign:"DollarSign",PercentSign:"PercentSign",Ampersand:"Ampersand",Apostrophe:"Apostrophe",LeftParenthesis:"LeftParenthesis",RightParenthesis:"RightParenthesis",Asterisk:"Asterisk",PlusSign:"PlusSign",Comma:"Comma",HyphenMinus:"HyphenMinus",FullStop:"FullStop",Solidus:"Solidus",Colon:"Colon",Semicolon:"Semicolon",LessThanSign:"LessThanSign",EqualsSign:"EqualsSign",GreaterThanSign:"GreaterThanSign",QuestionMark:"QuestionMark",CommercialAt:"CommercialAt",LeftSquareBracket:"LeftSquareBracket",ReverseSolidus:"ReverseSolidus",RightSquareBracket:"RightSquareBracket",CircumflexAccent:"CircumflexAccent",LowLine:"LowLine",LeftCurlyBracket:"LeftCurlyBracket",VerticalLine:"VerticalLine",RightCurlyBracket:"RightCurlyBracket",Tilde:"Tilde",Identifier:"Identifier",DecimalNumber:"DecimalNumber"}},{}],38:[function(e,t,r){function n(e){e&&e.line>Ot&&(Ot=e.line)}function o(){throw new Error("Please check the validity of the CSS block starting from the line #"+Ht)}function i(e){var t=Et[e];return{offset:t.offset,line:t.line,column:t.column}}function a(e){var t;return t=Mt?[i(Ft),e]:[e]}function u(e){return V(e)||lt(e)||ze(e)||ne(e)||_e(e)||Tt(e)||fe(e)||he(e)||ve(e)||vt(e)}function s(){return V(Ft)?U():lt(Ft)?ft():ze(Ft)?Ee():ne(Ft)?oe():_e(Ft)?Re():Tt(Ft)?wt():fe(Ft)?pe():he(Ft)?de():ve(Ft)?ke():vt(Ft)?bt():void 0}function c(e){var t;return Et[e++].type!==Vt.CommercialAt?n(Et[e-1]):(t=ve(e))?t+1:n(Et[e])}function l(){var e=Ft;return Ft++,Mt?[i(e),Qt.AtkeywordType,ke()]:[Qt.AtkeywordType,ke()]}function f(e){return Et[e].type!==Vt.LeftSquareBracket?n(Et[e]):Et[e].right?Et[e].right-e+1:n(Et[e])}function p(e){var t=e;e++;var r=et(e);if(r&&(e+=r),!(r=ve(e,!0)))return n(Et[e]);if(e+=r,Et[e].type===Vt.VerticalLine&&Et[e+1].type!==Vt.EqualsSign){if(e++,!(r=ve(e,!0)))return n(Et[e]);e+=r}return(r=et(e))&&(e+=r),(r=g(e))?(e+=r,(r=et(e))&&(e+=r),(r=ve(e))||(r=lt(e))?(e+=r,(r=et(e))&&(e+=r),Et[e].type===Vt.RightSquareBracket?e-t:n(Et[e])):n(Et[e])):n(Et[e])}function h(){var e=Ft;Ft++;var t=Mt?[i(e),Qt.AttribType]:[Qt.AttribType];return t=t.concat(tt(),[ke()]),Et[Ft].type===Vt.VerticalLine&&Et[Ft+1].type!==Vt.EqualsSign&&t.push(Ae(),ke()),t=t.concat(tt(),[v()],tt(),[lt(Ft)?ft():ke()],tt()),Ft++,t}function d(e){var t=e;e++;var r=et(e);if(r&&(e+=r),(r=ve(e,!0))&&(e+=r),Et[e].type===Vt.VerticalLine&&Et[e+1].type!==Vt.EqualsSign){if(e++,!(r=ve(e,!0)))return n(Et[e]);e+=r}return(r=et(e))&&(e+=r),Et[e].type===Vt.RightSquareBracket?e-t:n(Et[e])}function y(){var e=Ft;Ft++;var t=(Mt?[i(e),Qt.AttribType]:[Qt.AttribType]).concat(tt(),[ke()]);return Et[Ft].type===Vt.VerticalLine&&Et[Ft+1].type!==Vt.EqualsSign&&t.push(Ae(),ke()),t=t.concat(tt()),Ft++,t}function m(){return p(Ft)?h():d(Ft)?y():void 0}function g(e){if(Et[e].type===Vt.EqualsSign)return 1;if(Et[e].type===Vt.VerticalLine&&(!Et[e+1]||Et[e+1].type!==Vt.EqualsSign))return 1;if(!Et[e+1]||Et[e+1].type!==Vt.EqualsSign)return n(Et[e]);switch(Et[e].type){case Vt.Tilde:case Vt.CircumflexAccent:case Vt.DollarSign:case Vt.Asterisk:case Vt.VerticalLine:return 2}return n(Et[e])}function v(){var e=Ft,t=Et[Ft++].value;return Et[Ft]&&Et[Ft].type===Vt.EqualsSign&&(t+=Et[Ft++].value),Mt?[i(e),Qt.AttrselectorType,t]:[Qt.AttrselectorType,t]}function b(e){var t,r=e;if(void 0!==Et[r].atrule_l)return Et[r].atrule_l;if(t=w(e))Et[e].atrule_type=1;else if(t=S(e))Et[e].atrule_type=2;else{if(!(t=I(e)))return n(Et[r]);Et[e].atrule_type=3}return Et[r].atrule_l=t,t}function k(){switch(Et[Ft].atrule_type){case 1:return A();case 2:return T();case 3:return D()}}function S(e){var t,r=e;return(t=c(e))?(e+=t,(t=mt(e))&&(e+=t),(t=C(e))?(e+=t,e-r):n(Et[e])):n(Et[e])}function T(){return(Mt?[i(Ft),Qt.AtrulebType,l()]:[Qt.AtrulebType,l()]).concat(gt()).concat([N()])}function w(e){var t,r=e;return(t=c(e))?(e+=t,(t=j(e))&&(e+=t),e<Et.length&&Et[e].type===Vt.LeftCurlyBracket?(e++,(t=q(e))&&(e+=t),e<Et.length&&Et[e].type===Vt.RightCurlyBracket?(e++,e-r):n(Et[e])):n(Et[e])):n(Et[e])}function A(){var e=Mt?[i(Ft),Qt.AtrulerType,l(),x()]:[Qt.AtrulerType,l(),x()];return Ft++,e.push(P()),Ft++,e}function j(e){return mt(e)}function x(){return a(Qt.AtrulerqType).concat(gt())}function q(e){var t,r=e;for((t=et(e))&&(e+=t);(t=Ye(e))||(t=b(e))||(t=et(e));)e+=t;return Et[e].atrulers_end=1,(t=et(e))&&(e+=t),e-r}function P(){for(var e=a(Qt.AtrulersType).concat(tt());!Et[Ft].atrulers_end;)et(Ft)?e=e.concat(tt()):Ye(Ft)?e.push(Je()):e.push(k());return e.concat(tt())}function I(e){var t,r=e;return(t=c(e))?(e+=t,(t=mt(e))&&(e+=t),e>=Et.length?e-r:Et[e].type!==Vt.Semicolon?n(Et[e]):(e++,e-r)):n(Et[e])}function D(){var e=(Mt?[i(Ft),Qt.AtrulesType,l()]:[Qt.AtrulesType,l()]).concat(gt());return Ft++,e}function C(e){return e<Et.length&&Et[e].type===Vt.LeftCurlyBracket?Et[e].right-e+1:n(Et[e])}function N(){var e=a(Qt.BlockType),t=Et[Ft].right;for(Ft++;t>Ft;)_(Ft)?e=e.concat(R()):o();return Ft=t+1,e}function _(e){var t;if(t=B(e))Et[e].bd_type=1;else if(t=z(e))Et[e].bd_type=2;else if(t=M(e))Et[e].bd_type=3;else{if(!(t=O(e)))return n(Et[e]);Et[e].bd_type=4}return t}function R(){switch(Et[Ft].bd_type){case 1:return L();case 2:return E();case 3:return F();case 4:return H()}}function B(e){var t,r=e;if((t=et(e))&&(e+=t),t=ie(e))Et[e].bd_filter=1,e+=t;else{if(!(t=J(e)))return n(Et[e]);Et[e].bd_decl=1,e+=t}return e<Et.length&&(t=Z(e))?(e+=t,(t=et(e))&&(e+=t),e-r):n(Et[e])}function L(){return tt().concat([Et[Ft].bd_filter?ae():W()]).concat([ee()]).concat(tt())}function z(e){var t,r=e;if((t=et(e))&&(e+=t),t=ie(e))Et[e].bd_filter=1,e+=t;else{if(!(t=J(e)))return n(Et[e]);Et[e].bd_decl=1,e+=t}return(t=et(e))&&(e+=t),e-r}function E(){return tt().concat([Et[Ft].bd_filter?ae():W()]).concat(tt())}function M(e){var t,r=e;return(t=et(e))&&(e+=t),(t=Z(e))?(e+=t,(t=et(e))&&(e+=t),e-r):n(Et[e])}function F(){return tt().concat([ee()]).concat(tt())}function O(e){return et(e)}function H(){return tt()}function V(e){return e>=Et.length||Et[e].type!==Vt.LeftParenthesis&&Et[e].type!==Vt.LeftSquareBracket?n(Et[e]):Et[e].right-e+1}function U(){var e=Ft,t=Ft,r=Et[Ft].right;Ft++;var n=gt();return Ft++,Mt?[i(e),Qt.BracesType,Et[t].value,Et[r].value].concat(n):[Qt.BracesType,Et[t].value,Et[r].value].concat(n)}function Q(e){var t,r=Et[e];return r.clazz_l?r.clazz_l:r.type===Vt.FullStop&&("DecimalNumber"!==Et[e+1].type||/\D/.test(Et[e+1].value)||e++,t=ve(e+1))?(r.clazz_l=t+1,t+1):n(r)}function $(){var e=Ft,t=Ft+Et[Ft].clazz_l;Ft++;var r=a(Qt.IdentType).concat(Lt(Ft,t-1));return Ft=t,Mt?[i(e),Qt.ClazzType,r]:[Qt.ClazzType,r]}function G(e){return Et[e].type===Vt.PlusSign||Et[e].type===Vt.GreaterThanSign||Et[e].type===Vt.Tilde?1:Et[e+0].type===Vt.Solidus&&Et[e+1].type===Vt.Identifier&&"deep"===Et[e+1].value&&Et[e+2].type===Vt.Solidus?3:n(Et[e])}function K(){var e=Et[Ft].value;return Et[Ft].type===Vt.Solidus?(e="/deep/",Ft+=3):Ft+=1,Mt?[i(Ft),Qt.CombinatorType,e]:[Qt.CombinatorType,e]}function X(e){return Et[e].type===Vt.CommentML?1:n(Et[e])}function Y(){var e=Ft,t=Et[Ft].value.substring(2),r=t.length;return"*"===t.charAt(r-2)&&"/"===t.charAt(r-1)&&(t=t.substring(0,r-2)),Ft++,Mt?[i(e),Qt.CommentType,t]:[Qt.CommentType,t]}function J(e){var t,r=e;return(t=He(e))?(e+=t,e<Et.length&&Et[e].type===Vt.Colon?(e++,(t=jt(e))?(e+=t,e-r):n(Et[e])):n(Et[e])):n(Et[e])}function W(){var e=Mt?[i(Ft),Qt.DeclarationType,Ve()]:[Qt.DeclarationType,Ve()];return Ft++,e.push(qt()),e}function Z(e){return e<Et.length&&Et[e].type===Vt.Semicolon?1:n(Et[e])}function ee(){var e=Ft;return Ft++,Mt?[i(e),Qt.DecldelimType]:[Qt.DecldelimType]}function te(e){return e<Et.length&&Et[e].type===Vt.Comma?1:n(e>=Et.length?Et[Et.length-1]:Et[e])}function re(){var e=Ft;return Ft++,Mt?[i(e),Qt.DelimType]:[Qt.DelimType]}function ne(e){var t,r=_e(e);return!r||r&&e+r>=Et.length?n(Et[e]):(t=_t(e+r))?r+t:n(Et[e])}function oe(){var e=Ft,t=Re(),r=Mt?[i(Ft),Qt.IdentType,Rt()]:[Qt.IdentType,Rt()];return Mt?[i(e),Qt.DimensionType,t,r]:[Qt.DimensionType,t,r]}function ie(e){var t,r=e;return(t=ue(e))?(e+=t,Et[e].type!==Vt.Colon?n(Et[e]):(e++,(t=ce(e))?(e+=t,e-r):n(Et[e]))):n(Et[e])}function ae(){var e=Mt?[i(Ft),Qt.FilterType,se()]:[Qt.FilterType,se()];return Ft++,e.push(le()),e}function ue(e){var t,r,o=e;if(e<Et.length){if("filter"===Et[e].value)t=1;else if(r=zt(e,2),"-filter"===r||"_filter"===r||"*filter"===r)t=2;else{if(r=zt(e,4),"-ms-filter"!==r)return n(Et[e]);t=4}return Et[o].filterp_l=t,e+=t,et(e)&&(e+=t),e-o}return n(Et[e])}function se(){var e=Ft,t=zt(Ft,Et[Ft].filterp_l),r=Mt?[i(e),Qt.IdentType,t]:[Qt.IdentType,t];return Ft+=Et[Ft].filterp_l,(Mt?[i(e),Qt.PropertyType,r]:[Qt.PropertyType,r]).concat(tt())}function ce(e){var t,r=e;if(!(t=Me(e)))return n(Et[e]);for(e+=t;t=Me(e);)e+=t;return Et[r].last_progid=e,e<Et.length&&(t=et(e))&&(e+=t),e<Et.length&&(t=Se(e))&&(e+=t),e-r}function le(){for(var e=a(Qt.FiltervType),t=Et[Ft].last_progid;t>Ft;)e.push(Fe());return e=e.concat(et(Ft)?tt():[]),Ft<Et.length&&Se(Ft)&&e.push(Te()),e}function fe(e){var t=e;return Et[e]&&"expression"===Et[e++].value?Et[e]&&Et[e].type===Vt.LeftParenthesis?Et[e].right-t+1:n(Et[e]):n(Et[e-1])}function pe(){var e=Ft;Ft++;var t=Lt(Ft+1,Et[Ft].right-1);return Ft=Et[Ft].right+1,Mt?[i(e),Qt.FunctionExpressionType,t]:[Qt.FunctionExpressionType,t]}function he(e){var t=e,r=ve(e);return r?(e+=r,e>=Et.length||Et[e].type!==Vt.LeftParenthesis?n(Et[e-1]):Et[e].right-t+1):n(Et[e])}function de(){var e=Ft,t=ke();Ft++;var r="not"!==t[Mt?2:1]?ye():me();return Mt?[i(e),Qt.FunktionType,t,r]:[Qt.FunktionType,t,r]}function ye(){for(var e,t=Ft,r=[];Et[Ft].type!==Vt.RightParenthesis;)dt(Ft)?(e=yt(),Mt&&"string"==typeof e[1]||"string"==typeof e[0]?r.push(e):r=r.concat(e)):Q(Ft)?r.push($()):o();return Ft++,(Mt?[i(t),Qt.FunctionBodyType]:[Qt.FunctionBodyType]).concat(r)}function me(){for(var e=Ft,t=[];Et[Ft].type!==Vt.RightParenthesis;)at(Ft)?t.push(st()):o();return Ft++,(Mt?[i(e),Qt.FunctionBodyType]:[Qt.FunctionBodyType]).concat(t)}function ge(e,t){for(var r="";e<Et.length&&(Et[e].type===Vt.DecimalNumber||Et[e].type===Vt.Identifier);e++)r+=Et[e].value;if(/^[0-9a-f]{1,6}$/i.test(r)){if(t)for(;r.length<6&&e<Et.length&&Et[e].type===Vt.QuestionMark;e++)r+=Et[e].value,t=!1;if(t&&Et[e]&&Et[e].type===Vt.HyphenMinus){var n=ge(e+1);if(n)return n}return e}}function ve(e,t){if(e>=Et.length)return n(Et[e]);var r=e,o=!1;if(Et[e].type===Vt.Identifier&&("U"===Et[e].value||"u"===Et[e].value)&&Et[e+1].type===Vt.PlusSign){var i=ge(e+2,!0);if(i)return Et[r].ident_last=i-1,i-r}if(Et[e].type===Vt.LowLine)return be(e,t);if(Et[e].type!==Vt.HyphenMinus&&Et[e].type!==Vt.Identifier&&Et[e].type!==Vt.DollarSign&&Et[e].type!==Vt.Asterisk)return n(Et[e]);for(e++,o=Et[e-1].type===Vt.Identifier;e<Et.length;e++)if(Et[e].type!==Vt.HyphenMinus&&Et[e].type!==Vt.LowLine){if(!(Et[e].type===Vt.Identifier||t&&Et[e].type===Vt.Colon||o&&Et[e].type===Vt.DecimalNumber))break;o=!0}return o||Et[r].type===Vt.Asterisk?(Et[r].ident_last=e-1,e-r):n(Et[e])}function be(e,t){var r=e;for(e++;e<Et.length&&(Et[e].type===Vt.HyphenMinus||Et[e].type===Vt.DecimalNumber||Et[e].type===Vt.LowLine||Et[e].type===Vt.Identifier||t&&Et[e].type===Vt.Colon);e++);return Et[r].ident_last=e-1,e-r}function ke(){var e=Ft,t=Lt(Ft,Et[Ft].ident_last);return Ft=Et[Ft].ident_last+1,Mt?[i(e),Qt.IdentType,t]:[Qt.IdentType,t]}function Se(e){var t,r=e;return Et[e++].type!==Vt.ExclamationMark?n(Et[e-1]):((t=et(e))&&(e+=t),"important"!==Et[e].value.toLowerCase()?n(Et[e]):e-r+1)}function Te(){var e=Ft;Ft++;var t=tt();return Ft++,(Mt?[i(e),Qt.ImportantType]:[Qt.ImportantType]).concat(t)}function we(e){return Et[e].type===Vt.VerticalLine?1:n(Et[e])}function Ae(){var e=Ft;return Ft++,Mt?[i(e),Qt.NamespaceType]:[Qt.NamespaceType]}function je(e){return xe(e)||Pe(e)}function xe(e){for(var t=e;e<Et.length&&(Et[e].type===Vt.DecimalNumber||"n"===Et[e].value);e++);return e!==t?(Et[t].nth_last=e-1,e-t):n(Et[e])}function qe(){var e=Ft;if(Et[Ft].nth_last){var t=Mt?[i(e),Qt.NthType,Lt(Ft,Et[Ft].nth_last)]:[Qt.NthType,Lt(Ft,Et[Ft].nth_last)];return Ft=Et[Ft].nth_last+1,t}return Mt?[i(e),Qt.NthType,Et[Ft++].value]:[Qt.NthType,Et[Ft++].value]}function Pe(e){return"even"===Et[e].value||"odd"===Et[e].value?1:n(Et[e])}function Ie(e){var t=e,r=0;if(Et[e++].type!==Vt.Colon)return n(Et[e-1]);if(r++,"nth"!==Et[e++].value||"-"!==Et[e++].value)return n(Et[e-1]);if(r+=2,"child"===Et[e].value)r+=1;else if("last-child"===Et[e].value+Et[e+1].value+Et[e+2].value)r+=3;else if("of-type"===Et[e].value+Et[e+1].value+Et[e+2].value)r+=3;else{if("last-of-type"!==Et[e].value+Et[e+1].value+Et[e+2].value+Et[e+3].value+Et[e+4].value)return n(Et[e]);r+=5}return Et[t+1].nthf_last=t+r-1,r}function De(){Ft++;var e=Lt(Ft,Et[Ft].nthf_last);return Ft=Et[Ft].nthf_last+1,e}function Ce(e){var t,r=e;if(!(t=Ie(e)))return n(Et[e]);if(e+=t,Et[e].type!==Vt.LeftParenthesis||!Et[e].right)return n(Et[e]);t++;for(var o=Et[e++].right;o>e;)if(t=et(e))e+=t;else if(t=vt(e))e+=t;else{if(!(t=je(e)))return n(Et[e]);e+=t}return o-r+1}function Ne(){var e=Mt?[i(Ft),Qt.IdentType,De()]:[Qt.IdentType,De()],t=Mt?[i(Ft),Qt.NthselectorType,e]:[Qt.NthselectorType,e];for(Ft++;Et[Ft].type!==Vt.RightParenthesis;)et(Ft)?t=t.concat(tt()):vt(Ft)?t.push(bt()):je(Ft)&&t.push(qe());return Ft++,t}function _e(e,t){if(e<Et.length&&Et[e].number_l)return Et[e].number_l;if(!t&&e<Et.length&&Et[e].type===Vt.HyphenMinus){var r=_e(e+1,!0);if(r)return Et[e].number_l=r+1,Et[e].number_l;n(Et[e])}return e<Et.length&&Et[e].type===Vt.DecimalNumber&&(!Et[e+1]||Et[e+1]&&Et[e+1].type!==Vt.FullStop)?(Et[e].number_l=1,Et[e].number_l):e<Et.length&&Et[e].type===Vt.DecimalNumber&&Et[e+1]&&Et[e+1].type===Vt.FullStop&&(!Et[e+2]||Et[e+2].type!==Vt.DecimalNumber)?(Et[e].number_l=2,Et[e].number_l):e<Et.length&&Et[e].type===Vt.FullStop&&Et[e+1].type===Vt.DecimalNumber?(Et[e].number_l=2,Et[e].number_l):e<Et.length&&Et[e].type===Vt.DecimalNumber&&Et[e+1]&&Et[e+1].type===Vt.FullStop&&Et[e+2]&&Et[e+2].type===Vt.DecimalNumber?(Et[e].number_l=3,Et[e].number_l):n(Et[e])}function Re(){for(var e="",t=Ft,r=Et[Ft].number_l,n=0;r>n;n++)e+=Et[Ft+n].value;return Ft+=r,Mt?[i(t),Qt.NumberType,e]:[Qt.NumberType,e]}function Be(e){return e<Et.length&&(Et[e].type===Vt.Solidus||Et[e].type===Vt.Comma||Et[e].type===Vt.Colon||Et[e].type===Vt.EqualsSign)?1:n(Et[e])}function Le(){return Mt?[i(Ft),Qt.OperatorType,Et[Ft++].value]:[Qt.OperatorType,Et[Ft++].value]}function ze(e){var t=_e(e);return!t||t&&e+t>=Et.length?n(Et[e]):Et[e+t].type===Vt.PercentSign?t+1:n(Et[e])}function Ee(){var e=Ft,t=Re();return Ft++,Mt?[i(e),Qt.PercentageType,t]:[Qt.PercentageType,t]}function Me(e){var t,r,o=e;return(t=et(e))&&(e+=t),e<Et.length-1&&"progid"===Et[e].value&&Et[e+1].type===Vt.Colon?(e+=2,(t=et(e))&&(e+=t),"DXImageTransform.Microsoft."!==(r=zt(e,4))?n(Et[e-1]):(e+=4,(t=ve(e))?(e+=t,(t=et(e))&&(e+=t),Et[e].type!==Vt.LeftParenthesis?n(Et[e]):(Et[o].progid_end=Et[e].right,e=Et[e].right+1,(t=et(e))&&(e+=t),e-o)):n(Et[e]))):n(Et[e])}function Fe(){var e=Ft,t=Et[Ft].progid_end;return(Mt?[i(e),Qt.ProgidType]:[Qt.ProgidType]).concat(tt()).concat([Oe(t)]).concat(tt())}function Oe(e){var t=Ft,r=Lt(Ft,e);return Ft=e+1,Mt?[i(t),Qt.RawType,r]:[Qt.RawType,r]}function He(e){var t,r=e;return(t=ve(e))?(e+=t,(t=et(e))&&(e+=t),e-r):n(Et[e])}function Ve(){var e=Ft;return(Mt?[i(e),Qt.PropertyType,ke()]:[Qt.PropertyType,ke()]).concat(tt())}function Ue(e){return $e(e)||Ke(e)}function Qe(){return $e(Ft)?Ge():Ke(Ft)?Xe():void 0}function $e(e){var t;return Et[e++].type!==Vt.Colon?n(Et[e-1]):Et[e++].type!==Vt.Colon?n(Et[e-1]):(t=ve(e))?t+2:n(Et[e])}function Ge(){var e=Ft;return Ft+=2,Mt?[i(e),Qt.PseudoeType,ke()]:[Qt.PseudoeType,ke()]}function Ke(e){var t;return Et[e++].type!==Vt.Colon?n(Et[e-1]):(t=he(e))||(t=ve(e))?t+1:n(Et[e])}function Xe(){var e=Ft;return Ft++,Mt?[i(e),Qt.PseudocType,he(Ft)?de():ke()]:[Qt.PseudocType,he(Ft)?de():ke()]}function Ye(e){var t,r=e;if(void 0!==Et[r].ruleset_l)return Et[r].ruleset_l;for(;t=rt(e);)e+=t;return(t=C(e))?(e+=t,Et[r].ruleset_l=e-r,e-r):n(Et[e])}function Je(){for(var e=a(Qt.RulesetType);!C(Ft);)e.push(nt());return e.push(N()),e}function We(e){return Et[e].type===Vt.Space?1:n(Et[e])}function Ze(){var e=Ft,t=Et[Ft].value;return Ft++,Mt?[i(e),Qt.SType,t]:[Qt.SType,t]}function et(e){for(var t,r=0;e<Et.length&&((t=We(e))||(t=X(e)));)e+=t,r+=t;return r?r:n(e>=Et.length?Et[Et.length-1]:Et[e])}function tt(){for(var e=[];Ft<Et.length;)if(We(Ft))e.push(Ze());else{if(!X(Ft))break;e.push(Y())}return e}function rt(e){var t,r=e;if(e<Et.length){for(;t=at(e)||te(e);)e+=t;return Et[r].selector_end=e-1,e-r}}function nt(){for(var e=a(Qt.SelectorType),t=Et[Ft].selector_end;t>=Ft;)e.push(te(Ft)?re():st());return e}function ot(e){if(Et[e].type!==Vt.NumberSign)return n(Et[e]);var t=Ct(e+1);return t?t+1:n(Et[e])}function it(){var e=Ft;return Ft++,Mt?[i(e),Qt.ShashType,Nt()]:[Qt.ShashType,Nt()]}function at(e){for(var t,r=e;e<Et.length&&(t=ut(e));)e+=t;return e-r?e-r:n(e>=Et.length?Et[Et.length-1]:Et[e])}function ut(e){return Ce(e)||G(e)||f(e)||Ue(e)||Q(e)||ot(e)||u(e)||et(e)||we(e)}function st(){for(var e,t=a(Qt.SimpleselectorType);Ft<Et.length&&ut(Ft);)e=ct(),e||o(),Mt&&"string"==typeof e[1]||"string"==typeof e[0]?t.push(e):t=t.concat(e);return t}function ct(){return Ce(Ft)?Ne():G(Ft)?K():f(Ft)?m():Ue(Ft)?Qe():Q(Ft)?$():ot(Ft)?it():u(Ft)?s():et(Ft)?tt():we(Ft)?Ae():void 0}function lt(e){return e<Et.length&&(Et[e].type===Vt.StringSQ||Et[e].type===Vt.StringDQ)?1:n(Et[e])}function ft(){var e=Ft;return Mt?[i(e),Qt.StringType,Et[Ft++].value]:[Qt.StringType,Et[Ft++].value]}function pt(e){for(var t,r=e;e<Et.length;)(t=et(e))?e+=t:(Ht=Et[e].line,(t=b(e))?e+=t:(t=Ye(e))?e+=t:(t=kt(e))?e+=t:o());return e-r}function ht(){for(var e=a(Qt.StylesheetType);Ft<Et.length;)et(Ft)?e=e.concat(tt()):(Ht=Et[Ft].line,Ye(Ft)?e.push(Je()):b(Ft)?e.push(k()):kt(Ft)?e.push(St()):o());return e}function dt(e){return It(e)||u(e)||et(e)||Be(e)}function yt(){return It(Ft)?Dt():u(Ft)?s():et(Ft)?tt():Be(Ft)?Le():void 0}function mt(e){for(var t,r=e;t=dt(e);)e+=t;return e-r}function gt(){for(var e,t=[];e=yt();)Mt&&"string"==typeof e[1]||"string"==typeof e[0]?t.push(e):t=t.concat(e);return t}function vt(e){return e<Et.length&&(Et[e].type===Vt.HyphenMinus||Et[e].type===Vt.PlusSign)?1:n(Et[e])}function bt(){var e=Ft;return Mt?[i(e),Qt.UnaryType,Et[Ft++].value]:[Qt.UnaryType,Et[Ft++].value]}function kt(e){return e<Et.length&&Et[e].type===Vt.CommentSL?1:n(Et[e])}function St(){var e=Ft;return Mt?[i(e),Qt.UnknownType,Et[Ft++].value]:[Qt.UnknownType,Et[Ft++].value]}function Tt(e){var t=e;return e<Et.length&&"url"!==Et[e++].value?n(Et[e-1]):Et[e]&&Et[e].type===Vt.LeftParenthesis?Et[e].right-t+1:n(Et[e])}function wt(){var e=Ft;if(Ft+=2,At(Ft)){var t=(Mt?[i(e),Qt.UriType]:[Qt.UriType]).concat(tt()).concat([ft()]).concat(tt());return Ft++,t}var t=(Mt?[i(e),Qt.UriType]:[Qt.UriType]).concat(tt()),r=Bt(Ft),n=Mt?[i(Ft),Qt.RawType,Lt(Ft,Ft+r)]:[Qt.RawType,Lt(Ft,Ft+r)];return t.push(n),Ft+=r+1,t=t.concat(tt()),Ft++,t}function At(e){var t=e,r=et(e);return r&&(e+=r),Et[e].type!==Vt.StringDQ&&Et[e].type!==Vt.StringSQ?n(Et[e]):(e++,(r=et(e))&&(e+=r),e-t)}function jt(e){for(var t,r=e;e<Et.length&&(t=xt(e));)e+=t;return e-r?e-r:n(Et[e])}function xt(e){return et(e)||It(e)||u(e)||C(e)||c(e)||Be(e)||Se(e)}function qt(){for(var e,t=a(Qt.ValueType);Ft<Et.length&&xt(Ft);)e=Pt(),Mt&&"string"==typeof e[1]||"string"==typeof e[0]?t.push(e):t=t.concat(e);return t}function Pt(){return et(Ft)?tt():It(Ft)?Dt():u(Ft)?s():C(Ft)?N():c(Ft)?l():Be(Ft)?Le():Se(Ft)?Te():void 0}function It(e){if(e>=Et.length||Et[e].type!==Vt.NumberSign)return n(Et[e]);var t=_t(e+1);return t?t+1:n(Et[e])}function Dt(){var e=Ft;return Ft++,Mt?[i(e),Qt.VhashType,Rt()]:[Qt.VhashType,Rt()]}function Ct(e){var t=e;if(Et[e].type!==Vt.HyphenMinus&&Et[e].type!==Vt.LowLine&&Et[e].type!==Vt.Identifier&&Et[e].type!==Vt.DecimalNumber)return n(Et[e]);for(e++;e<Et.length&&(Et[e].type===Vt.HyphenMinus||Et[e].type===Vt.LowLine||Et[e].type===Vt.Identifier||Et[e].type===Vt.DecimalNumber);e++);return Et[t].nm_name_last=e-1,e-t}function Nt(){var e=Lt(Ft,Et[Ft].nm_name_last);return Ft=Et[Ft].nm_name_last+1,e}function _t(e){return Et[e].type===Vt.Identifier?1:Et[e].type!==Vt.DecimalNumber?n(Et[e]):(e++,Et[e]&&Et[e].type===Vt.Identifier?2:1)}function Rt(){var e=Et[Ft].value;return Et[Ft++].type===Vt.DecimalNumber&&Ft<Et.length&&Et[Ft].type===Vt.Identifier&&(e+=Et[Ft++].value),e}function Bt(e){for(var t=e;e<Et.length;){var r=Et[e++].type;if(r===Vt.Space||r===Vt.LeftParenthesis||r===Vt.RightParenthesis)break}return e-t-2}function Lt(e,t){
17
- for(var r="",n=e;t>=n;n++)r+=Et[n].value;return r}function zt(e,t){if(!(e+t-1>=Et.length)){for(var r="",n=0;t>n;n++)r+=Et[e+n].value;return r}}var Et,Mt,Ft,Ot,Ht,Vt=e("./const.js"),Ut=e("./tokenize.js"),Qt={IdentType:"ident",AtkeywordType:"atkeyword",StringType:"string",ShashType:"shash",VhashType:"vhash",NumberType:"number",PercentageType:"percentage",DimensionType:"dimension",DecldelimType:"decldelim",SType:"s",AttrselectorType:"attrselector",AttribType:"attrib",NthType:"nth",NthselectorType:"nthselector",NamespaceType:"namespace",ClazzType:"clazz",PseudoeType:"pseudoe",PseudocType:"pseudoc",DelimType:"delim",StylesheetType:"stylesheet",AtrulebType:"atruleb",AtrulesType:"atrules",AtrulerqType:"atrulerq",AtrulersType:"atrulers",AtrulerType:"atruler",BlockType:"block",RulesetType:"ruleset",CombinatorType:"combinator",SimpleselectorType:"simpleselector",SelectorType:"selector",DeclarationType:"declaration",PropertyType:"property",ImportantType:"important",UnaryType:"unary",OperatorType:"operator",BracesType:"braces",ValueType:"value",ProgidType:"progid",FiltervType:"filterv",FilterType:"filter",CommentType:"comment",UriType:"uri",RawType:"raw",FunctionBodyType:"functionBody",FunktionType:"funktion",FunctionExpressionType:"functionExpression",UnknownType:"unknown"},$t={ident:function(){return ve(Ft)?ke():void 0},atkeyword:function(){return c(Ft)?l():void 0},string:function(){return lt(Ft)?ft():void 0},shash:function(){return ot(Ft)?it():void 0},vhash:function(){return It(Ft)?Dt():void 0},number:function(){return _e(Ft)?Re():void 0},percentage:function(){return ze(Ft)?Ee():void 0},dimension:function(){return ne(Ft)?oe():void 0},decldelim:function(){return Z(Ft)?ee():void 0},s:function(){return We(Ft)?Ze():void 0},attrselector:function(){return g(Ft)?v():void 0},attrib:function(){return f(Ft)?m():void 0},nth:function(){return je(Ft)?qe():void 0},nthselector:function(){return Ce(Ft)?Ne():void 0},namespace:function(){return we(Ft)?Ae():void 0},clazz:function(){return Q(Ft)?$():void 0},pseudoe:function(){return $e(Ft)?Ge():void 0},pseudoc:function(){return Ke(Ft)?Xe():void 0},delim:function(){return te(Ft)?re():void 0},stylesheet:function(){return pt(Ft)?ht():void 0},atruleb:function(){return S(Ft)?T():void 0},atrules:function(){return I(Ft)?D():void 0},atrulerq:function(){return j(Ft)?x():void 0},atrulers:function(){return q(Ft)?P():void 0},atruler:function(){return w(Ft)?A():void 0},block:function(){return C(Ft)?N():void 0},ruleset:function(){return Ye(Ft)?Je():void 0},combinator:function(){return G(Ft)?K():void 0},simpleselector:function(){return at(Ft)?st():void 0},selector:function(){return rt(Ft)?nt():void 0},declaration:function(){return J(Ft)?W():void 0},property:function(){return He(Ft)?Ve():void 0},important:function(){return Se(Ft)?Te():void 0},unary:function(){return vt(Ft)?bt():void 0},operator:function(){return Be(Ft)?Le():void 0},braces:function(){return V(Ft)?U():void 0},value:function(){return jt(Ft)?qt():void 0},progid:function(){return Me(Ft)?Fe():void 0},filterv:function(){return ce(Ft)?le():void 0},filter:function(){return ie(Ft)?ae():void 0},comment:function(){return X(Ft)?Y():void 0},uri:function(){return Tt(Ft)?wt():void 0},funktion:function(){return he(Ft)?de():void 0},functionExpression:function(){return fe(Ft)?pe():void 0},unknown:function(){return kt(Ft)?St():void 0}};t.exports=function(e,t,r){Et=Ut(e),t=t||"stylesheet",Mt=r,Ft=0,Ot=0;var n=$t[t]();return n||"stylesheet"!==t?n:Mt?[{},t]:[t]}},{"./const.js":37,"./tokenize.js":39}],39:[function(e,t,r){function n(e){return-1!=="0123456789".indexOf(e)}function o(e){function t(e,t,n,o){r.push({type:e,value:o,offset:g,line:t,column:n}),g=p}if(!e)return[];var r=[],o=!1;p=65279===e.charCodeAt(0)?1:0;var g=p;d=1,h=-1;for(var v,b,k,S=0;p<e.length;p++)v=e.charAt(p),b=e.charAt(p+1),"/"===v&&"*"===b?t(y.CommentML,d,p-h,a(e)):o||"/"!==v||"/"!==b?'"'===v||"'"===v?t('"'===v?y.StringDQ:y.StringSQ,d,p-h,s(e,v)):" "===v||"\n"===v||"\r"===v||" "===v||"\f"===v?t(y.Space,d,p-h,i(e)):v in m?(t(m[v],d,p-h,v),")"===v&&(o=!1),"{"===v&&S++,"}"===v&&S--):n(v)?t(y.DecimalNumber,d,p-h,c(e)):(t(y.Identifier,d,p-h,k=l(e)),o=o||"url"===k):S>0?(t(y.Identifier,d,p-h,k=l(e)),o=o||"url"===k):t(y.CommentSL,d,p-h,u(e));return f(r),r}function i(e){for(var t=p;p<e.length;p++){var r=e.charAt(p);if("\n"===r||"\f"===r)d++,h=p;else if("\r"===r)d++,"\n"===e.charAt(p+1)&&p++,h=p;else if(" "!==r&&" "!==r)break}return p--,e.substring(t,p+1)}function a(e){var t=p;for(p+=2;p<e.length;p++){if("*"===e.charAt(p)&&"/"===e.charAt(p+1)){p++;break}"\n"===e.charAt(p)&&(d++,h=p)}return e.substring(t,p+1)}function u(e){var t=p;for(p+=2;p<e.length&&("\n"!==e.charAt(p)&&"\r"!==e.charAt(p));p++);return e.substring(t,p+1)}function s(e,t){var r=p,n="";for(p+=1;p<e.length;p++)if("\\"===e.charAt(p)){var o=e.charAt(p+1);"\n"===o||"\f"===o?(n+=e.substring(r,p),r=p+2,p++):"\r"===o?(n+=e.substring(r,p),"\n"===e.charAt(p+2)&&p++,r=p+2,p++):p++}else if(e.charAt(p)===t)break;return n+e.substring(r,p+1)}function c(e){for(var t=p;p<e.length&&n(e.charAt(p));p++);return p--,e.substring(t,p+1)}function l(e){for(var t=p;"/"===e.charAt(p);)p++;for(;p<e.length;p++){var r=e.charAt(p);if("\\"===r)p++;else if(r in m&&"_"!==r)break}return p--,e.substring(t,p+1)}function f(e){for(var t,r=[],n=[],o=[],i=0;i<e.length;i++)switch(t=e[i],t.type){case y.LeftParenthesis:r.push(i);break;case y.RightParenthesis:r.length&&(e[r.pop()].right=i);break;case y.LeftSquareBracket:n.push(i);break;case y.RightSquareBracket:n.length&&(e[n.pop()].right=i);break;case y.LeftCurlyBracket:o.push(i);break;case y.RightCurlyBracket:o.length&&(e[o.pop()].right=i)}}var p,h,d,y=e("./const.js"),m={" ":y.Space,"\n":y.Newline,"\r":y.Newline," ":y.Tab,"!":y.ExclamationMark,'"':y.QuotationMark,"#":y.NumberSign,$:y.DollarSign,"%":y.PercentSign,"&":y.Ampersand,"'":y.Apostrophe,"(":y.LeftParenthesis,")":y.RightParenthesis,"*":y.Asterisk,"+":y.PlusSign,",":y.Comma,"-":y.HyphenMinus,".":y.FullStop,"/":y.Solidus,":":y.Colon,";":y.Semicolon,"<":y.LessThanSign,"=":y.EqualsSign,">":y.GreaterThanSign,"?":y.QuestionMark,"@":y.CommercialAt,"[":y.LeftSquareBracket,"]":y.RightSquareBracket,"^":y.CircumflexAccent,_:y.LowLine,"{":y.LeftCurlyBracket,"|":y.VerticalLine,"}":y.RightCurlyBracket,"~":y.Tilde};t.exports=o},{"./const.js":37}],40:[function(e,t,r){t.exports=function n(e){for(var t,r=e.slice(1),o=1;t=r[o];o++)Array.isArray(t)&&(r[o]=n(t));return r}},{}],41:[function(e,t,r){function n(e){return new Array(e+1).join(" ")}function o(e){return e.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/"/g,'\\"')}t.exports=function i(e,t){if(t=t||0,"string"==typeof e)return'"'+o(e)+'"';if(e&&e.constructor===Object){var r=Object.keys(e).map(function(r){return n(t+1)+'"'+o(r)+'": '+i(e[r],t+1)}).join(",\n");return"{"+(r?"\n"+r+"\n"+n(t):"")+"}"}if(Array.isArray(e)){var a=!0,r=e.map(function(e,r){var o=r?" ":"";return!Array.isArray(e)||a&&e.some(Array.isArray)||(o="\n"+n(t+1),a=!1),o+i(e,t+1)}).join(",");return/\n/.test(r)&&(r="\n"+n(t+1)+r+"\n"+n(t)),"["+r+"]"}return String(e)}},{}],42:[function(e,t,r){function n(e){P.push(e[q+1])}function o(e){for(var t=q+1;t<e.length;t++)x(e[t])}function i(e,t){for(;t<e.length;t++)x(e[t])}function a(e){x(e[q+1]),P.push("%")}function u(e){P.push("/*",e[q+1],"*/")}function s(e){P.push("."),x(e[q+1])}function c(e){P.push("@"),x(e[q+1])}function l(e){P.push("#",e[q+1])}function f(e){P.push("#",e[q+1])}function p(e){P.push("["),o(e),P.push("]")}function h(e){P.push("!"),o(e),P.push("important")}function d(e){P.push(":"),n(e[q+1]),P.push("("),i(e,q+2),P.push(")")}function y(e){n(e[q+1]),P.push("("),o(e[q+2]),P.push(")")}function m(e){x(e[q+1]),P.push(":"),x(e[q+2])}function g(e){x(e[q+1]),P.push(":"),x(e[q+2])}function v(e){P.push("{"),o(e),P.push("}")}function b(e){P.push(e[q+1]),i(e,q+3),P.push(e[q+2])}function k(e){o(e),P.push(";")}function S(e){x(e[q+1]),x(e[q+2]),P.push("{"),x(e[q+3]),P.push("}")}function T(e){P.push("::"),x(e[q+1])}function w(e){P.push(":"),x(e[q+1])}function A(e){P.push("url("),o(e),P.push(")")}function j(e){P.push("expression(",e[q+1],")")}function x(e){I[e[q]](e)}var q,P,I={unary:n,nth:n,combinator:n,ident:n,number:n,s:n,string:n,attrselector:n,operator:n,raw:n,unknown:n,simpleselector:o,dimension:o,selector:o,property:o,value:o,filterv:o,progid:o,ruleset:o,atruleb:o,atrulerq:o,atrulers:o,stylesheet:o,percentage:a,comment:u,clazz:s,atkeyword:c,shash:l,vhash:f,attrib:p,important:h,nthselector:d,funktion:y,declaration:m,filter:g,block:v,braces:b,atrules:k,atruler:S,pseudoe:T,pseudoc:w,uri:A,functionExpression:j,cdo:function(){P.push("cdo")},cdc:function(){P.push("cdc")},decldelim:function(){P.push(";")},namespace:function(){P.push("|")},delim:function(){P.push(",")}};t.exports=function(e,t){return q=t?1:0,P=[],x(e),P.join("")}},{}],43:[function(e,t,r){function n(e,t,r){switch(i(e,t,r),r.push(e),e[o+0]){case"simpleselector":case"dimension":case"selector":case"property":case"value":case"filterv":case"progid":case"ruleset":case"atruleb":case"atrulerq":case"atrulers":case"stylesheet":case"attrib":case"important":case"block":case"atrules":case"uri":for(var a=o+1;a<e.length;a++)n(e[a],e,r);break;case"percentage":case"clazz":case"atkeyword":case"pseudoe":case"pseudoc":n(e[o+1],e,r);break;case"declaration":case"filter":n(e[o+1],e,r),n(e[o+2],e,r);break;case"atruler":n(e[o+1],e,r),n(e[o+2],e,r),n(e[o+3],e,r);break;case"braces":for(var a=o+3;a<e.length;a++)n(e[a],e,r);break;case"nthselector":i(e[o+1],e,r);for(var a=o+2;a<e.length;a++)n(e[a],e,r);break;case"funktion":i(e[o+1],e,r),i(e[o+2],e,r),e=e[o+2],r.push(e);for(var a=o+1;a<e.length;a++)n(e[a],e,r);r.pop()}r.pop()}var o,i;t.exports=function(e,t,r){o=r?1:0,"function"==typeof t&&(i=t,n(e,null,[]))}},{}],44:[function(e,t,r){t.exports={name:"csso",description:"CSSO — CSS optimizer",version:"1.5.3",homepage:"https://github.com/css/csso",author:"Sergey Kryzhanovsky <skryzhanovsky@ya.ru> (https://github.com/afelix)",maintainers:[{name:"Roman Dvornov",email:"rdvornov@gmail.com","github-username":"lahmatiy"}],license:"MIT",repository:"css/csso",bugs:{url:"https://github.com/css/csso/issues"},bin:{csso:"./bin/csso"},main:"./lib/index",scripts:{test:"jscs . && mocha --reporter dot",browserify:"browserify --standalone csso lib/index.js | uglifyjs --compress --mangle -o dist/csso-browser.js","gh-pages":'git clone -b gh-pages https://github.com/css/csso.git .gh-pages && npm run browserify && cp dist/csso-browser.js .gh-pages/ && cd .gh-pages && git commit -am "update" && git push && cd .. && rm -rf .gh-pages',prepublish:"npm run browserify"},dependencies:{clap:"^1.0.9"},devDependencies:{browserify:"^13.0.0",jscs:"^2.6.0",mocha:"~2.3.3","uglify-js":"^2.6.1"},engines:{node:">=0.12.0"},files:["bin","dist/csso-browser.js","lib","HISTORY.md","LICENSE","README.md"]}},{}]},{},[36])(36)});
15
+ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.csso=e()}}(function(){return function e(t,r,n){function o(i,s){if(!r[i]){if(!t[i]){var u="function"==typeof require&&require;if(!s&&u)return u(i,!0);if(a)return a(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[i]={exports:{}};t[i][0].call(c.exports,function(e){var r=t[i][1][e];return o(r?r:e)},c,c.exports,e,t,r,n)}return r[i].exports}for(var a="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}({1:[function(e,t,r){function n(e){for(var t=new f,r=2;r<e.length;r++){var n=e[r],o=n[1];"s"!==o&&"comment"!==o&&"unknown"!==o&&t.insert(f.createItem(p(n)))}return{type:"StyleSheet",info:e[0],avoidRulesMerge:!1,rules:t,id:h++}}function o(e,t,r){return t instanceof f&&(t={type:"AtruleExpression",info:t.head?t.head.data.info:null,sequence:t,id:null}),{type:"Atrule",info:e[0],name:e[2][2][2],expression:t,block:r}}function a(e){return{type:"Declaration",info:e[0],property:p(e[2]),value:p(e[3]),id:0,length:0,fingerprint:null}}function i(e){for(var t=!1,r=e.length-1;r>=2;r--){var n=e[r][1];if("s"!==n&&"comment"!==n){if("important"!==n||t)break;t=!0}}return{type:"Value",info:e[0],important:t,sequence:l(e,2,r)}}function s(e){return p(e[u(e,2)])}function u(e,t){for(;t<e.length;t++){var r=e[t][1];if("s"!==r&&"comment"!==r)break}return t}function l(e,t,r){var n=new f;for(t=u(e,t);r>=t;r--){var o=e[r][1];if("s"!==o&&"comment"!==o)break}for(var a=t;r>=a;a++){var i=p(e[a]);i&&n.insert(f.createItem(i))}return n}function c(e){for(var t=new f,r=e,n=2,o=n;o<r.length;o++)"operator"===r[o][1]&&","===r[o][2]&&(t.insert(f.createItem({type:"Argument",info:{},sequence:l(r,n,o-1)})),n=o+1);var a=l(r,n,r.length-1);return(a.head||t.head)&&t.insert(f.createItem({type:"Argument",info:{},sequence:a})),t}function p(e){if(e){var t=e[1];if(d.hasOwnProperty(t)&&"function"==typeof d[t])return d[t](e)}return null}var f=e("../../utils/list.js"),h=0,d={atkeyword:!1,atruleb:function(e){return o(e,l(e,3,e.length-2),p(e[e.length-1]))},atruler:function(e){return o(e,p(e[3]),p(e[4]))},atrulerq:function(e){return{type:"AtruleExpression",info:e[0],sequence:l(e,2,e.length-1),id:null}},atrulers:n,atrules:function(e){return o(e,l(e,3,e.length-1),null)},attrib:function(e){var t,r=2,n=null,o=null,a=null;return r=u(e,2),t=p(e[r]),r=u(e,r+1),r<e.length&&(n=e[r][2],r=u(e,r+1),o=p(e[r]),r<e.length&&(r=u(e,r+1),r<e.length&&"attribFlags"===e[r][1]&&(a=e[r][2]))),{type:"Attribute",info:e[0],name:t,operator:n,value:o,flags:a}},attrselector:!1,block:function(e){for(var t=new f,r=2;r<e.length;r++){var n=e[r],o=n[1];("declaration"===o||"filter"===o)&&t.insert(f.createItem(p(n)))}return{type:"Block",info:e[0],declarations:t}},braces:function(e){return{type:"Braces",info:e[0],open:e[2],close:e[3],sequence:l(e,4,e.length-1)}},clazz:function(e){return{type:"Class",info:e[0],name:e[2][2]}},combinator:function(e){return{type:"Combinator",info:e[0],name:e[2]}},comment:!1,declaration:a,decldelim:!1,delim:!1,dimension:function(e){return{type:"Dimension",info:e[0],value:e[2][2],unit:e[3][2]}},filter:a,filterv:i,functionExpression:function(e){return{type:"Function",name:"expression",arguments:new f([{type:"Argument",sequence:new f([{type:"Raw",value:e[2]}])}])}},funktion:function(e){return{type:"Function",info:e[0],name:e[2][2],arguments:c(e[3])}},functionBody:!1,ident:function(e){return{type:"Identifier",info:e[0],name:e[2]}},namespace:!1,nth:function(e){return{type:"Nth",value:e[2]}},nthselector:function(e){return{type:"FunctionalPseudo",info:e[0],name:e[2][2],arguments:new f([{type:"Argument",sequence:new f(e.slice(3).filter(function(e){return"s"!==e[1]&&"comment"!==e[1]}).map(p))}])}},number:function(e){return{type:"Number",info:e[0],value:e[2]}},operator:function(e){return{type:"Operator",info:e[0],value:e[2]}},percentage:function(e){return{type:"Percentage",info:e[0],value:e[2][2]}},progid:function(e){return{type:"Progid",info:e[0],value:s(e)}},property:function(e){return{type:"Property",info:e[0],name:e[2][2]}},pseudoc:function(e){var t=e[2];if("funktion"===t[1]){var r=t[2][2];return"not"===r?{type:"Negation",sequence:d.selector(t[3]).selectors}:{type:"FunctionalPseudo",info:t[0],name:r,arguments:c(t[3])}}return{type:"PseudoClass",info:e[0],name:t[2]}},pseudoe:function(e){var t=e[2];return{type:"PseudoElement",info:e[0],name:t[2]}},raw:function(e){return{type:"Raw",info:e[0],value:e[2]}},ruleset:function(e){var t=p(e[2]),r=p(e[3]);return{type:"Ruleset",info:e[0],pseudoSignature:null,selector:t,block:r}},s:function(e){return{type:"Space",info:e[0]}},selector:function(e){for(var t="delim",r=new f,n=2;n<e.length;n++){var o=e[n],a=o[1];if("simpleselector"===a||"delim"===a){if(t===a){r=new f;break}t=a}"simpleselector"===a&&r.insert(f.createItem(p(o)))}return("delim"===t||!r.isEmpty()&&r.last().sequence.isEmpty())&&(r=new f),{type:"Selector",info:e[0],selectors:r}},shash:function(e){return{type:"Id",info:e[0],name:e[2]}},simpleselector:function(e){for(var t=new f,r=null,n=u(e,2);n<e.length;n++){var o=e[n];switch(o[1]){case"s":r||(r=[o[0],"combinator"," "]);break;case"comment":break;case"combinator":r=o;break;default:null!==r&&t.insert(f.createItem(p(r))),r=null,t.insert(f.createItem(p(o)))}}return{type:"SimpleSelector",info:e[0],sequence:t,id:null,compareMarker:null}},string:function(e){return{type:"String",info:e[0],value:e[2]}},stylesheet:n,unary:function(e){return{type:"Operator",info:e[0],value:e[2]}},unknown:!1,uri:function(e){return{type:"Url",info:e[0],value:s(e)}},value:i,vhash:function(e){return{type:"Hash",info:e[0],value:e[2]}}};t.exports=p},{"../../utils/list.js":44}],2:[function(e,t,r){function n(e,t,r,n){var o=[e.info,t],i=e[r];return i.each(function(e,t){o.push(a(e)),t.next&&o.push(n.slice())}),o}function o(e,t){t.each(function(t,r){e.push.apply(e,t.sequence.map(a)),r.next&&e.push([{},"operator",","])})}function a(e){switch(e.type){case"StyleSheet":return[e.info||{},"stylesheet"].concat(e.rules.map(a).filter(Boolean));case"Atrule":var t="atruler";e.block?"Block"===e.block.type&&(t="atruleb"):t="atrules";var r=[e.info,t,[{},"atkeyword",[{},"ident",e.name]]];return e.expression&&!e.expression.sequence.isEmpty()?"atruler"===t?r.push([e.expression.info,"atrulerq",[{},"s"," "]].concat(e.expression.sequence.map(a))):(r.push([{},"s"," "]),r=r.concat(e.expression.sequence.map(a))):"atruler"===t&&r.push([{},"atrulerq"]),e.block&&("atruler"===t?r.push([e.block.info,"atrulers"].concat(e.block.rules.map(a))):r.push(a(e.block))),r;case"Ruleset":return[e.info,"ruleset",a(e.selector),a(e.block)];case"Selector":return n(e,"selector","selectors",[{},"delim"]);case"SimpleSelector":var r=[e.info,"simpleselector"];return e.sequence.each(function(e){var t=a(e);"Combinator"===e.type&&"/deep/"===e.name?r.push([{},"s"," "],t,[{},"s"," "]):r.push(t)}),r;case"Negation":var i=n(e,"functionBody","sequence",[{},"delim"]);return[e.info,"pseudoc",[{},"funktion",[{},"ident","not"],i]];case"Attribute":var r=[e.info,"attrib"];return r.push([{},"ident",e.name.name]),null!==e.operator&&(r.push([{},"attrselector",e.operator]),null!==e.value&&(r.push(a(e.value)),null!==e.flags&&("String"!==e.value.type&&r.push([{},"s"," "]),r.push([{},"attribFlags",e.flags])))),r;case"FunctionalPseudo":if(/^nth-/.test(e.name)){var r=[e.info,"nthselector",[{},"ident",e.name]];return o(r,e.arguments),r}var i=[{},"functionBody"];return o(i,e.arguments),[e.info,"pseudoc",[{},"funktion",[{},"ident",e.name],i]];case"Function":var i=[{},"functionBody"];return o(i,e.arguments),"expression"===e.name?[{},"functionExpression",i[2][2]]:[e.info,"funktion",[{},"ident",e.name],i];case"Block":return n(e,"block","declarations",[{},"decldelim"]);case"Declaration":return[e.info,!e.value.sequence.isEmpty()&&"Progid"===e.value.sequence.first().type&&/(-[a-z]+-|[\*-_])?filter$/.test(e.property.name)?"filter":"declaration",a(e.property),a(e.value)];case"Braces":return[e.info,"braces",e.open,e.close].concat(e.sequence.map(a));case"Value":var r=[e.info,e.sequence.isEmpty()||"Progid"!==e.sequence.first().type?"value":"filterv"].concat(e.sequence.map(a));return e.important&&r.push([{},"important"]),r;case"Url":return[e.info,"uri",a(e.value)];case"Progid":return[e.info,"progid",a(e.value)];case"Property":return[e.info,"property",[{},"ident",e.name]];case"Combinator":return" "===e.name?[e.info,"s",e.name]:[e.info,"combinator",e.name];case"Identifier":return[e.info,"ident",e.name];case"PseudoElement":return[e.info,"pseudoe",[{},"ident",e.name]];case"PseudoClass":return[e.info,"pseudoc",[{},"ident",e.name]];case"Class":return[e.info,"clazz",[{},"ident",e.name]];case"Id":return[e.info,"shash",e.name];case"Nth":return[e.info,"nth",e.value];case"Hash":return[e.info,"vhash",e.value];case"Number":return[e.info,"number",e.value];case"Dimension":return[e.info,"dimension",[{},"number",e.value],[{},"ident",e.unit]];case"Operator":return[e.info,"+"===e.value||"-"===e.value?"unary":"operator",e.value];case"Raw":return[e.info,e.value&&/\S/.test(e.value)?"raw":"s",e.value];case"String":return[e.info,"string",e.value];case"Percentage":return[e.info,"percentage",[{},"number",e.value]];case"Space":return[e.info,"s"," "];case"Comment":return[e.info,"comment",e.value];default:throw new Error("Unknown node type: "+e.type)}}t.exports=a},{}],3:[function(e,t,r){function n(e){if("-"===e[0]){var t=e.indexOf("-",2);if(-1!==t)return e.substr(0,t+1)}return""}function o(e){if(i.call(s,e))return s[e];var t=e.toLowerCase(),r=n(t),o=t;return r&&(o=o.substr(r.length)),s[e]=Object.freeze({vendor:r,prefix:r,name:o})}function a(e){if(i.call(u,e))return u[e];var t=e.toLowerCase(),r=t[0];"*"===r||"_"===r||"$"===r?t=t.substr(1):"/"===r&&"/"===e[1]?(r="//",t=t.substr(2)):r="";var o=n(t),a=t;return o&&(a=a.substr(o.length)),u[e]=Object.freeze({hack:r,vendor:o,prefix:r+o,name:a})}var i=Object.prototype.hasOwnProperty,s=Object.create(null),u=Object.create(null);t.exports={keyword:o,property:a}},{}],4:[function(e,t,r){function n(e){return e.head&&e.head===e.tail?a(e.head.data):e.map(a).join("")}function o(e,t){return e.head&&e.head===e.tail?a(e.head.data):e.map(a).join(t)}function a(e){switch(e.type){case"StyleSheet":return n(e.rules);case"Atrule":var t="@"+e.name;return e.expression&&!e.expression.sequence.isEmpty()&&(t+=" "+a(e.expression)),e.block?t+"{"+a(e.block)+"}":t+";";case"Ruleset":return a(e.selector)+"{"+a(e.block)+"}";case"Selector":return o(e.selectors,",");case"SimpleSelector":return e.sequence.map(function(e){return"Combinator"===e.type&&"/deep/"===e.name?" "+a(e)+" ":a(e)}).join("");case"Declaration":return a(e.property)+":"+a(e.value);case"Property":return e.name;case"Value":return e.important?n(e.sequence)+"!important":n(e.sequence);case"Attribute":var t=a(e.name);return null!==e.operator&&(t+=e.operator,null!==e.value&&(t+=a(e.value),null!==e.flags&&(t+=("String"!==e.value.type?" ":"")+e.flags))),"["+t+"]";case"FunctionalPseudo":return":"+e.name+"("+o(e.arguments,",")+")";case"Function":return e.name+"("+o(e.arguments,",")+")";case"Block":return o(e.declarations,";");case"Negation":return":not("+o(e.sequence,",")+")";case"Braces":return e.open+n(e.sequence)+e.close;case"Argument":case"AtruleExpression":return n(e.sequence);case"Url":return"url("+a(e.value)+")";case"Progid":return a(e.value);case"Combinator":return e.name;case"Identifier":return e.name;case"PseudoClass":return":"+e.name;case"PseudoElement":return"::"+e.name;case"Class":return"."+e.name;case"Id":return"#"+e.name;case"Hash":return"#"+e.value;case"Dimension":return e.value+e.unit;case"Nth":return e.value;case"Number":return e.value;case"String":return e.value;case"Operator":return e.value;case"Raw":return e.value;case"Percentage":return e.value+"%";case"Space":return" ";case"Comment":return"/*"+e.value+"*/";default:throw new Error("Unknown node type: "+e.type)}}t.exports=a},{}],5:[function(e,t,r){function n(e,t){for(var r,o=0;o<e.children.length;o++)r=e.children[o],r instanceof p?n(r,t):t(r,e)}function o(e){var t,r=new c,o="",a=!1,i=null,s=null,u={line:1,column:0},l={generated:u};return n(e,function(e,n){null!==n.line&&null!==n.column?((i!==n.line||s!==n.column)&&r.addMapping({source:n.source,original:n,generated:u}),i=n.line,s=n.column,a=!0):a&&(r.addMapping(l),a=!1),o+=e,t=e.lastIndexOf("\n"),-1!==t?(u.line+=e.match(/\n/g).length,u.column=e.length-t-1):u.column+=e.length}),{css:o,map:r}}function a(e){return e.head&&e.head===e.tail?l(e.head.data):e.map(l).join("")}function i(e,t){return e.head&&e.head===e.tail?l(e.head.data):e.map(l).join(t)}function s(e){return new p(null,null,null,e)}function u(e,t){return e.primary?u(e.primary,t):new p(e.line,e.column-1,e.source,t)}function l(e){switch(e.type){case"StyleSheet":return s(e.rules.map(l));case"Atrule":var t=["@",e.name];return e.expression&&!e.expression.sequence.isEmpty()&&t.push(" ",l(e.expression)),e.block?t.push("{",l(e.block),"}"):t.push(";"),u(e.info,t);case"Ruleset":return s([l(e.selector),"{",l(e.block),"}"]);case"Selector":return s(e.selectors.map(l)).join(",");case"SimpleSelector":return u(e.info,e.sequence.map(function(e){return"Combinator"===e.type&&"/deep/"===e.name?" "+l(e)+" ":l(e)}));case"Block":return s(e.declarations.map(l)).join(";");case"Declaration":return u(e.info,[l(e.property),":",l(e.value)]);case"Value":return e.important?a(e.sequence)+"!important":a(e.sequence);case"Attribute":var r=l(e.name);return null!==e.operator&&(r+=e.operator,null!==e.value&&(r+=l(e.value),null!==e.flags&&(r+=("String"!==e.value.type?" ":"")+e.flags))),"["+r+"]";case"FunctionalPseudo":return":"+e.name+"("+i(e.arguments,",")+")";case"Function":return e.name+"("+i(e.arguments,",")+")";case"Negation":return":not("+i(e.sequence,",")+")";case"Braces":return e.open+a(e.sequence)+e.close;case"Argument":case"AtruleExpression":return a(e.sequence);case"Url":return"url("+l(e.value)+")";case"Progid":return l(e.value);case"Property":return e.name;case"Combinator":return e.name;case"Identifier":return e.name;case"PseudoClass":return":"+e.name;case"PseudoElement":return"::"+e.name;case"Class":return"."+e.name;case"Id":return"#"+e.name;case"Hash":return"#"+e.value;case"Dimension":return e.value+e.unit;case"Nth":return e.value;case"Number":return e.value;case"String":return e.value;case"Operator":return e.value;case"Raw":return e.value;case"Percentage":return e.value+"%";case"Space":return" ";case"Comment":return"/*"+e.value+"*/";default:throw new Error("Unknown node type: "+e.type)}}var c=e("source-map").SourceMapGenerator,p=e("source-map").SourceNode;t.exports=function(e){return o(s(l(e)))}},{"source-map":58}],6:[function(e,t,r){function n(e,t,r){switch(e.type){case"StyleSheet":var o=this.stylesheet;this.stylesheet=e,e.rules.each(n,this),this.stylesheet=o;break;case"Atrule":null!==e.block&&n.call(this,e.block),this.fn(e,t,r);break;case"Ruleset":this.fn(e,t,r)}}function o(e,t,r){switch(e.type){case"StyleSheet":var n=this.stylesheet;this.stylesheet=e,e.rules.eachRight(o,this),this.stylesheet=n;break;case"Atrule":null!==e.block&&o.call(this,e.block),this.fn(e,t,r);break;case"Ruleset":this.fn(e,t,r)}}function a(e,t,r){switch(e.type){case"StyleSheet":var n=this.stylesheet;this.stylesheet=e,e.rules.each(a,this),this.stylesheet=n;break;case"Atrule":null!==e.expression&&a.call(this,e.expression),null!==e.block&&a.call(this,e.block);break;case"Ruleset":this.ruleset=e,null!==e.selector&&a.call(this,e.selector),a.call(this,e.block),this.ruleset=null;break;case"Selector":var o=this.selector;this.selector=e,e.selectors.each(a,this),this.selector=o;break;case"Block":e.declarations.each(a,this);break;case"Declaration":this.declaration=e,a.call(this,e.property),a.call(this,e.value),this.declaration=null;break;case"Attribute":a.call(this,e.name),null!==e.value&&a.call(this,e.value);break;case"FunctionalPseudo":case"Function":this["function"]=e,e.arguments.each(a,this),this["function"]=null;break;case"Value":case"Argument":case"AtruleExpression":case"SimpleSelector":case"Braces":case"Negation":e.sequence.each(a,this);break;case"Url":case"Progid":a.call(this,e.value)}this.fn(e,t,r)}function i(e,t){var r={fn:t,root:e,stylesheet:null,ruleset:null,selector:null,declaration:null,"function":null};return r}t.exports={all:function(e,t){a.call(i(e,t),e)},rules:function(e,t){n.call(i(e,t),e)},rulesRight:function(e,t){o.call(i(e,t),e)}}},{}],7:[function(e,t,r){t.exports=function(e,t,r){if(e.block){if(this.root.firstAtrulesAllowed=!1,"Block"===e.block.type&&e.block.declarations.isEmpty())return void r.remove(t);if("StyleSheet"===e.block.type&&e.block.rules.isEmpty())return void r.remove(t)}switch(e.name){case"charset":if(e.expression.sequence.isEmpty())return void r.remove(t);if(t.prev)return void r.remove(t);break;case"import":if(!this.root.firstAtrulesAllowed)return void r.remove(t);r.prevUntil(t.prev,function(e){return"Atrule"!==e.type||"import"!==e.name&&"charset"!==e.name?(this.root.firstAtrulesAllowed=!1,r.remove(t),!0):void 0},this)}}},{}],8:[function(e,t,r){t.exports=function(e,t,r){e.value.sequence.isEmpty()&&r.remove(t)}},{}],9:[function(e,t,r){t.exports=function(e,t,r){null!==this.selector&&"*"===e.name&&t.next&&"Combinator"!==t.next.data.type&&r.remove(t)}},{}],10:[function(e,t,r){t.exports=function(e,t,r){(e.selector.selectors.isEmpty()||e.block.declarations.isEmpty())&&r.remove(t)}},{}],11:[function(e,t,r){function n(e,t){if("Operator"===e.type)return"+"!==e.value&&"-"!==e.value;if(t)switch(e.type){case"Function":case"Braces":case"Url":return!0}}t.exports=function(e,t,r){var o=t.prev&&t.prev.data,a=t.next&&t.next.data,i=o.type,s=a.type;return"Url"===i&&s||"Braces"===i&&"Identifier"===s||"Function"===i&&("Function"===s||"Hash"===s)||"Braces"===i&&"Operator"===s&&("+"===a.value||"-"===a.value)?void 0:n(a,!1)||n(o,!0)?void r.remove(t):void 0}},{}],12:[function(e,t,r){var n={Space:e("./Space.js"),Atrule:e("./Atrule.js"),Ruleset:e("./Ruleset.js"),Declaration:e("./Declaration.js"),Identifier:e("./Identifier.js")};t.exports=function(e,t,r){n.hasOwnProperty(e.type)&&n[e.type].call(this,e,t,r)}},{"./Atrule.js":7,"./Declaration.js":8,"./Identifier.js":9,"./Ruleset.js":10,"./Space.js":11}],13:[function(e,t,r){var n=e("../ast/names.js").keyword,o=e("./atrule/keyframes.js");t.exports=function(e){"keyframes"===n(e.name).name&&o(e)}},{"../ast/names.js":3,"./atrule/keyframes.js":20}],14:[function(e,t,r){function n(e){return""!==e&&"-"!==e?(e=e.replace(o,"a"),!a.test(e)):void 0}var o=/\\([0-9A-Fa-f]{1,6})[ \t\n\f\r]?|\\./g,a=/^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;t.exports=function(e){var t=e.value;if(t&&"String"===t.type){var r=t.value.replace(/^(.)(.*)\1$/,"$2");n(r)&&(e.value={type:"Identifier",info:t.info,name:r})}}},{}],15:[function(e,t,r){var n=e("./Number.js").pack,o={deg:!0,grad:!0,rad:!0,turn:!0,s:!0,ms:!0,Hz:!0,kHz:!0,dpi:!0,dpcm:!0,dppx:!0};t.exports=function(e,t){var r=n(e.value),a=e.unit;if(e.value=r,"0"===r&&this.declaration&&!o.hasOwnProperty(a)){if("flex"===this.declaration.property.name)return;if(this["function"]&&"calc"===this["function"].name)return;t.data={type:"Number",info:e.info,value:r}}}},{"./Number.js":16}],16:[function(e,t,r){function n(e){return e=String(e).replace(/^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,"$1$2$3"),(0===e.length||"-"===e)&&(e="0"),e}t.exports=function(e){e.value=n(e.value)},t.exports.pack=n},{}],17:[function(e,t,r){t.exports=function(e){var t=e.value;t=t.replace(/\\\n/g,""),e.value=t}},{}],18:[function(e,t,r){var n="\\\\[0-9a-f]{1,6}(\\r\\n|[ \\n\\r\\t\\f])?",o="("+n+"|\\\\[^\\n\\r\\f0-9a-fA-F])",a="\x00\b\x0B-",i=new RegExp("^("+o+"|[^\"'\\(\\)\\\\\\s"+a+"])*$","i");t.exports=function(e){var t=e.value;if("String"===t.type){var r=t.value[0],n=t.value.substr(1,t.value.length-2);n=n.replace(/\\\\/g,"/"),i.test(n)?e.value={type:"Raw",info:e.value.info,value:n}:e.value.value=-1===n.indexOf('"')?'"'+n+'"':r+n+r}}},{}],19:[function(e,t,r){var n=e("../ast/names.js").property,o={font:e("./property/font.js"),"font-weight":e("./property/font-weight.js"),background:e("./property/background.js")};t.exports=function(e){if(this.declaration){var t=n(this.declaration.property.name);o.hasOwnProperty(t.name)&&o[t.name](e)}}},{"../ast/names.js":3,"./property/background.js":23,"./property/font-weight.js":24,"./property/font.js":25}],20:[function(e,t,r){t.exports=function(e){e.block.rules.each(function(e){e.selector.selectors.each(function(e){e.sequence.each(function(e,t){"Percentage"===e.type&&"100"===e.value?t.data={type:"Identifier",info:e.info,name:"to"}:"Identifier"===e.type&&"from"===e.name&&(t.data={type:"Percentage",info:e.info,value:"0"})})})})}},{}],21:[function(e,t,r){function n(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?e+6*(t-e)*r:.5>r?t:2/3>r?e+(t-e)*(2/3-r)*6:e}function o(e,t,r,o){var a,i,s;if(0==t)a=i=s=r;else{var u=.5>r?r*(1+t):r+t-r*t,l=2*r-u;a=n(l,u,e+1/3),i=n(l,u,e),s=n(l,u,e-1/3)}return[Math.round(255*a),Math.round(255*i),Math.round(255*s),o]}function a(e){return e=e.toString(16),1===e.length?"0"+e:e}function i(e,t,r){for(var n=e.head,o=[];null!==n;){for(var a=n.data.sequence.head,i=!1;null!==a;){var s=a.data,u=s.type;switch(u){case"Number":case"Percentage":if(i)return;i=!0,o.push({type:u,value:Number(s.value)});break;case"Operator":if(i||"+"!==s.value)return;break;default:return}a=a.next}n=n.next}if(o.length===t){if(4===o.length){if("Number"!==o[3].type)return;o[3].type="Alpha"}if(r){if(o[0].type!==o[1].type||o[0].type!==o[2].type)return}else{if("Number"!==o[0].type||"Percentage"!==o[1].type||"Percentage"!==o[2].type)return;o[0].type="Angle"}return o.map(function(e){var t=Math.max(0,e.value);switch(e.type){case"Number":t=Math.min(t,255);break;case"Percentage":if(t=Math.min(t,100)/100,!r)return t;t=255*t;break;case"Angle":return(t%360+360)%360/360;case"Alpha":return Math.min(t,1)}return Math.round(t)})}}function s(e,t,r){var n,s=e.name;if("rgba"===s||"hsla"===s){if(n=i(e.arguments,4,"rgba"===s),!n)return;if("hsla"===s&&(n=o.apply(null,n),e.name="rgba"),1!==n[3])return void e.arguments.each(function(e){var t=e.sequence.head;"Operator"===t.data.type&&(t=t.next),e.sequence=new c([{type:"Number",info:t.data.info,value:p(n.shift())}])});s="rgb"}if("hsl"===s){if(n=n||i(e.arguments,3,!1),!n)return;n=o.apply(null,n),s="rgb"}if("rgb"===s){if(n=n||i(e.arguments,3,!0),!n)return;var u=t.next;u&&"Space"!==u.data.type&&r.insert(r.createItem({type:"Space"}),u),t.data={type:"Hash",info:e.info,value:a(n[0])+a(n[1])+a(n[2])},l(t.data,t)}}function u(e,t){if(null!==this.declaration){var r=e.name.toLowerCase();if(f.hasOwnProperty(r)){var n=f[r];n.length+1<=r.length?t.data={type:"Hash",info:e.info,value:n}:("grey"===r&&(r="gray"),e.name=r)}}}function l(e,t){var r=e.value.toLowerCase();6===r.length&&r[0]===r[1]&&r[2]===r[3]&&r[4]===r[5]&&(r=r[0]+r[2]+r[4]),h[r]?t.data={type:"Identifier",info:e.info,name:h[r]}:e.value=r}var c=e("../../utils/list.js"),p=e("./Number.js").pack,f={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",darkgrey:"a9a9a9",darkgreen:"006400",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",grey:"808080",green:"008000",greenyellow:"adff2f",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",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",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:"639",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"},h={800000:"maroon",800080:"purple",808000:"olive",808080:"gray","00ffff":"cyan",f0ffff:"azure",f5f5dc:"beige",ffe4c4:"bisque","000000":"black","0000ff":"blue",a52a2a:"brown",ff7f50:"coral",ffd700:"gold","008000":"green","4b0082":"indigo",fffff0:"ivory",f0e68c:"khaki","00ff00":"lime",faf0e6:"linen","000080":"navy",ffa500:"orange",da70d6:"orchid",cd853f:"peru",ffc0cb:"pink",dda0dd:"plum",f00:"red",ff0000:"red",fa8072:"salmon",a0522d:"sienna",c0c0c0:"silver",fffafa:"snow",d2b48c:"tan","008080":"teal",ff6347:"tomato",ee82ee:"violet",f5deb3:"wheat",ffffff:"white",ffff00:"yellow"};t.exports={compressFunction:s,compressIdent:u,compressHex:l}},{"../../utils/list.js":44,"./Number.js":16}],22:[function(e,t,r){var n={Atrule:e("./Atrule.js"),Attribute:e("./Attribute.js"),Value:e("./Value.js"),Dimension:e("./Dimension.js"),Percentage:e("./Number.js"),Number:e("./Number.js"),String:e("./String.js"),Url:e("./Url.js"),Hash:e("./color.js").compressHex,Identifier:e("./color.js").compressIdent,Function:e("./color.js").compressFunction};t.exports=function(e,t,r){n.hasOwnProperty(e.type)&&n[e.type].call(this,e,t,r)}},{"./Atrule.js":13,"./Attribute.js":14,"./Dimension.js":15,"./Number.js":16,"./String.js":17,"./Url.js":18,"./Value.js":19,"./color.js":21}],23:[function(e,t,r){var n=e("../../../utils/list.js");t.exports=function(e){function t(){return a.length?a[a.length-1].type:void 0}function r(){"Space"===t()&&a.pop(),a.length||a.unshift({type:"Number",value:"0"},{type:"Space"},{type:"Number",value:"0"}),o.push.apply(o,a),a=[]}var o=[],a=[];e.sequence.each(function(e){return"Operator"===e.type&&","===e.value?(r(),void o.push(e)):void(("Identifier"!==e.type||"transparent"!==e.name&&"none"!==e.name&&"repeat"!==e.name&&"scroll"!==e.name)&&("Space"!==e.type||a.length&&"Space"!==t())&&a.push(e))}),r(),e.sequence=new n(o)}},{"../../../utils/list.js":44}],24:[function(e,t,r){t.exports=function(e){var t=e.sequence.head.data;if("Identifier"===t.type)switch(t.name){case"normal":e.sequence.head.data={type:"Number",info:t.info,value:"400"};break;case"bold":e.sequence.head.data={type:"Number",info:t.info,value:"700"}}}},{}],25:[function(e,t,r){t.exports=function(e){var t=e.sequence;t.eachRight(function(e,t){if("Identifier"===e.type)if("bold"===e.name)t.data={type:"Number",info:e.info,value:"700"};else if("normal"===e.name){var r=t.prev;r&&"Operator"===r.data.type&&"/"===r.data.value&&this.remove(r),this.remove(t)}else if("medium"===e.name){var n=t.next;n&&"Operator"===n.data.type||this.remove(t)}}),t.each(function(e,t){"Space"===e.type&&(t.prev&&t.next&&"Space"!==t.next.data.type||this.remove(t))}),t.isEmpty()&&t.insert(t.createItem({type:"Identifier",name:"normal"}))}},{}],26:[function(e,t,r){function n(e){for(var t=e.length-1;t>-1;t--){var r=e[t];Array.isArray(r)&&(n(r),r.unshift({}))}}function o(e,t){for(var r,n=[],o=!1,a=t;a<e.length;a++){var i=e[a];if("comment"!==i[1]||"!"!==i[2].charAt(0))"s"!==i[1]&&(o=!0),n.push(i);else{if(o||r)break;r=i}}return{comment:r,stylesheet:[{},"stylesheet"].concat(n),offset:a}}function a(e,t,r,n){n("Compress block #"+r,null,!0);var o=s(e);return n("convertToInternal",o),o.firstAtrulesAllowed=e.firstAtrulesAllowed,l(o,c),n("clean",o),l(o,p),n("compress",o),t&&f(o,n),o}var i=e("../utils/list.js"),s=e("./ast/gonzalesToInternal.js"),u=e("./ast/internalToGonzales.js"),l=e("./ast/walk.js").all,c=e("./clean"),p=e("./compress"),f=e("./restructure");t.exports=function(e,t){e=e||[{},"stylesheet"],t=t||{};var r="function"==typeof t.logger?t.logger:Function(),s="restructure"in t?t.restructure:"restructuring"in t?t.restructuring:!0,l=new i,c={offset:2},p=!0,f=1;"string"==typeof e[0]&&n([e]);do if(c=o(e,c.offset),c.stylesheet.firstAtrulesAllowed=p,c.stylesheet=a(c.stylesheet,s,f++,r),c.comment&&(l.isEmpty()||l.insert(i.createItem({type:"Raw",value:"\n"})),l.insert(i.createItem({type:"Comment",value:c.comment[2]})),c.stylesheet.rules.isEmpty()||l.insert(i.createItem({type:"Raw",value:"\n"}))),l.appendList(c.stylesheet.rules),p&&!l.isEmpty()){var h=l.last();("Atrule"!==h.type||"import"!==h.name&&"charset"!==h.name)&&(p=!1)}while(c.offset<e.length);return t.outputAst&&"gonzales"!==t.outputAst?{type:"StyleSheet",rules:l}:u({type:"StyleSheet",rules:l})}},{"../utils/list.js":44,"./ast/gonzalesToInternal.js":1,"./ast/internalToGonzales.js":2,"./ast/walk.js":6,"./clean":12,"./compress":22,"./restructure":34}],27:[function(e,t,r){var n=e("./utils.js");t.exports=function(e,t,r){var o=e.selector.selectors,a=e.block;r.prevUntil(t.prev,function(i){if("Ruleset"!==i.type)return!0;if(e.pseudoSignature!==i.pseudoSignature)return!0;var s=i.selector.selectors,u=i.block;if(n.isEqualLists(s,o))return u.declarations.appendList(a.declarations),r.remove(t),!0;var l=n.compareDeclarations(a.declarations,u.declarations);return l.ne1.length||l.ne2.length?o.some(function(e){return s.some(function(t){return e.compareMarker===t.compareMarker})}):(n.addToSelector(s,o),r.remove(t),!0)})}},{"./utils.js":38}],28:[function(e,t,r){function n(e){return"Atrule"===e.type&&"media"===e.name}t.exports=function(e,t,r){if(n(e)){var o=t.prev&&t.prev.data;o&&n(o)&&e.expression.id===o.expression.id&&(o.block.rules.appendList(e.block.rules),o.info={primary:o.info,merged:e.info},r.remove(t))}}},{}],29:[function(e,t,r){var n=e("../../utils/list.js");t.exports=function(e,t,r){for(var o=e.selector.selectors;o.head!==o.tail;){var a=new n;a.insert(o.remove(o.head)),r.insert(r.createItem({type:"Ruleset",info:e.info,pseudoSignature:e.pseudoSignature,selector:{type:"Selector",info:e.selector.info,selectors:a},block:{type:"Block",info:e.block.info,declarations:e.block.declarations.copy()}}),t)}}},{"../../utils/list.js":44}],30:[function(e,t,r){function n(e){this.name=e,this.info=null,this.iehack=void 0,this.sides={top:null,right:null,bottom:null,left:null}}function o(e,t,r,o){var a=e.block.declarations,i=e.selector.selectors.first().id;return e.block.declarations.eachRight(function(e,s){var u=e.property.name;if(y.hasOwnProperty(u)){var p,f,h=y[u];o&&i!==o||h in t&&(f=c,p=t[h]),p&&p.add(u,e.value,e.info)||(f=l,p=new n(h),p.add(u,e.value,e.info)),t[h]=p,r.push({operation:f,block:a,item:s,shorthand:p}),o=i}}),o}function a(e,t){e.forEach(function(e){var r=e.shorthand;r.isOkToMinimize()&&(e.operation===l?e.item.data=t({
16
+ type:"Declaration",info:r.info,property:r.getProperty(),value:r.getValue(),id:0,length:0,fingerprint:null}):e.block.remove(e.item))})}var i=e("../../utils/list.js"),s=e("../ast/translate.js"),u=e("../ast/walk.js").rulesRight,l=1,c=2,p=0,f=1,h=2,d=3,m=["top","right","bottom","left"],g={"margin-top":"top","margin-right":"right","margin-bottom":"bottom","margin-left":"left","padding-top":"top","padding-right":"right","padding-bottom":"bottom","padding-left":"left","border-top-color":"top","border-right-color":"right","border-bottom-color":"bottom","border-left-color":"left","border-top-width":"top","border-right-width":"right","border-bottom-width":"bottom","border-left-width":"left","border-top-style":"top","border-right-style":"right","border-bottom-style":"bottom","border-left-style":"left"},y={margin:"margin","margin-top":"margin","margin-right":"margin","margin-bottom":"margin","margin-left":"margin",padding:"padding","padding-top":"padding","padding-right":"padding","padding-bottom":"padding","padding-left":"padding","border-color":"border-color","border-top-color":"border-color","border-right-color":"border-color","border-bottom-color":"border-color","border-left-color":"border-color","border-width":"border-width","border-top-width":"border-width","border-right-width":"border-width","border-bottom-width":"border-width","border-left-width":"border-width","border-style":"border-style","border-top-style":"border-style","border-right-style":"border-style","border-bottom-style":"border-style","border-left-style":"border-style"};n.prototype.getValueSequence=function(e,t){var r=[],n=!1,o=e.sequence.some(function(t){var o=!1;switch(t.type){case"Identifier":switch(t.name){case"\\9":return void(n=!0);case"inherit":case"initial":case"unset":case"revert":o=t.name}break;case"Dimension":switch(t.unit){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":o=t.unit}break;case"Number":case"Percentage":break;case"Space":return!1;default:return!0}r.push({node:t,special:o,important:e.important})});return o||r.length>t?!1:"boolean"==typeof this.iehack&&this.iehack!==n?!1:(this.iehack=n,r)},n.prototype.canOverride=function(e,t){var r=this.sides[e];return!r||t.important&&!r.important},n.prototype.add=function(e,t,r){function n(){var r=this.sides,n=g[e];if(n){if(n in r){var o=this.getValueSequence(t,1);if(!o||!o.length)return!1;for(var a in r)if(null!==r[a]&&r[a].special!==o[0].special)return!1;return this.canOverride(n,o[0])?(r[n]=o[0],!0):!0}}else if(e===this.name){var o=this.getValueSequence(t,4);if(!o||!o.length)return!1;switch(o.length){case 1:o[f]=o[p],o[h]=o[p],o[d]=o[p];break;case 2:o[h]=o[p],o[d]=o[f];break;case 3:o[d]=o[f]}for(var i=0;4>i;i++)for(var a in r)if(null!==r[a]&&r[a].special!==o[i].special)return!1;for(var i=0;4>i;i++)this.canOverride(m[i],o[i])&&(r[m[i]]=o[i]);return!0}}return n.call(this)?(this.info?this.info={primary:this.info,merged:r}:this.info=r,!0):!1},n.prototype.isOkToMinimize=function(){var e=this.sides.top,t=this.sides.right,r=this.sides.bottom,n=this.sides.left;if(e&&t&&r&&n){var o=e.important+t.important+r.important+n.important;return 0===o||4===o}return!1},n.prototype.getValue=function(){var e=[],t=this.sides,r=[t.top,t.right,t.bottom,t.left],n=[s(t.top.node),s(t.right.node),s(t.bottom.node),s(t.left.node)];n[d]===n[f]&&(r.pop(),n[h]===n[p]&&(r.pop(),n[f]===n[p]&&r.pop()));for(var o=0;o<r.length;o++)o&&e.push({type:"Space"}),e.push(r[o].node);return this.iehack&&e.push({type:"Space"},{type:"Identifier",info:{},name:"\\9"}),{type:"Value",info:{},important:t.top.important,sequence:new i(e)}},n.prototype.getProperty=function(){return{type:"Property",info:{},name:this.name}},t.exports=function(e,t){var r={},n=[];u(e,function(e){if("Ruleset"===e.type){var t,a,i=this.stylesheet,s=(e.pseudoSignature||"")+"|"+e.selector.selectors.first().id;r.hasOwnProperty(i.id)?t=r[i.id]:(t={lastShortSelector:null},r[i.id]=t),t.hasOwnProperty(s)?a=t[s]:(a={},t[s]=a),t.lastShortSelector=o.call(this,e,a,n,t.lastShortSelector)}}),a(n,t)}},{"../../utils/list.js":44,"../ast/translate.js":4,"../ast/walk.js":6}],31:[function(e,t,r){function n(e,t,r){var n=i(e).name;if("background"===n||"filter"===n&&"Progid"===t.value.sequence.first().type)return e+":"+l(t.value);var o=t.id,a=r[o];if(!a){var u="",c="",f={};t.value.sequence.each(function(e){switch(e.type){case"Identifier":var t=e.name;u||(u=s(t).vendor),"\\9"===t&&(c=t),p.hasOwnProperty(n)&&p[n].test(t)&&(f[t]=!0);break;case"Function":var t=e.name;u||(u=s(t).vendor),"rect"===t&&e.arguments.size<4&&(t="rect-backward"),f[t+"()"]=!0;break;case"Dimension":var r=e.unit;switch(r){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":f[r]=!0}}}),a="|"+Object.keys(f).sort()+"|"+c+u,r[o]=a}return e+a}function o(e,t,r){var o=i(t.property.name);if(f.hasOwnProperty(o.name))for(var a=f[o.name],s=0;s<a.length;s++){var u=n(o.prefix+a[s],t,r),l=e[u];if(l&&(!t.value.important||l.item.data.value.important))return l}}function a(e,t,r,a,i){var s=e.block.declarations;s.eachRight(function(e,t){var r=e.property.name,u=n(r,e,i),l=a[u];if(l&&!c.hasOwnProperty(r))e.value.important&&!l.item.data.value.important?(a[u]={block:s,item:t},l.block.remove(l.item),e.info={primary:e.info,merged:l.item.data.info}):(s.remove(t),l.item.data.info={primary:l.item.data.info,merged:e.info});else{var l=o(a,e,i);l?(s.remove(t),l.item.data.info={primary:l.item.data.info,merged:e.info}):(e.fingerprint=u,a[u]={block:s,item:t})}}),s.isEmpty()&&r.remove(t)}var i=e("../ast/names.js").property,s=e("../ast/names.js").keyword,u=e("../ast/walk.js").rulesRight,l=e("../ast/translate.js"),c={src:1},p={display:/table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,"text-align":/^(start|end|match-parent|justify-all)$/i},f={"border-width":["border"],"border-style":["border"],"border-color":["border"],"border-top":["border"],"border-right":["border"],"border-bottom":["border"],"border-left":["border"],"border-top-width":["border-top","border-width","border"],"border-right-width":["border-right","border-width","border"],"border-bottom-width":["border-bottom","border-width","border"],"border-left-width":["border-left","border-width","border"],"border-top-style":["border-top","border-style","border"],"border-right-style":["border-right","border-style","border"],"border-bottom-style":["border-bottom","border-style","border"],"border-left-style":["border-left","border-style","border"],"border-top-color":["border-top","border-color","border"],"border-right-color":["border-right","border-color","border"],"border-bottom-color":["border-bottom","border-color","border"],"border-left-color":["border-left","border-color","border"],"margin-top":["margin"],"margin-right":["margin"],"margin-bottom":["margin"],"margin-left":["margin"],"padding-top":["padding"],"padding-right":["padding"],"padding-bottom":["padding"],"padding-left":["padding"],"font-style":["font"],"font-variant":["font"],"font-weight":["font"],"font-size":["font"],"font-family":["font"],"list-style-type":["list-style"],"list-style-position":["list-style"],"list-style-image":["list-style"]};t.exports=function(e){var t={},r=Object.create(null);u(e,function(e,n,o){if("Ruleset"===e.type){var i,s,u=this.stylesheet,l=(e.pseudoSignature||"")+"|"+e.selector.selectors.first().id;t.hasOwnProperty(u.id)?i=t[u.id]:(i={},t[u.id]=i),i.hasOwnProperty(l)?s=i[l]:(s={},i[l]=s),a.call(this,e,n,o,s,r)}})}},{"../ast/names.js":3,"../ast/translate.js":4,"../ast/walk.js":6}],32:[function(e,t,r){var n=e("./utils.js");t.exports=function(e,t,r){var o=e.selector.selectors,a=e.block.declarations,i=o.first().compareMarker,s={};r.nextUntil(t.next,function(t,u){if("Ruleset"!==t.type)return!0;if(e.pseudoSignature!==t.pseudoSignature)return!0;var l=t.selector.selectors.head,c=t.block.declarations,p=l.data.compareMarker;if(p in s)return!0;if(o.head===o.tail&&o.first().id===l.data.id)return a.appendList(c),void r.remove(u);if(n.isEqualDeclarations(a,c)){var f=l.data.id;return o.some(function(e,t){var r=e.id;return f===r?!0:r>f?(o.insert(l,t),!0):t.next?void 0:(o.insert(l),!0)}),void r.remove(u)}return p===i?!0:void(s[p]=!0)})}},{"./utils.js":38}],33:[function(e,t,r){function n(e){var t=0;return e.each(function(e){t+=e.id.length+1}),t-1}function o(e){for(var t=0,r=0;r<e.length;r++)t+=e[r].length;return t+e.length-1}var a=e("../../utils/list.js"),i=e("./utils.js");t.exports=function(e,t,r){var s=this.stylesheet.avoidRulesMerge,u=e.selector.selectors,l=e.block,c=Object.create(null);r.prevUntil(t.prev,function(p,f){if("Ruleset"!==p.type)return!0;var h=p.selector.selectors,d=p.block;if(e.pseudoSignature!==p.pseudoSignature)return!0;for(var m=h.head;m;){if(m.data.compareMarker in c)return!0;m=m.next}if(i.isEqualLists(h,u))return d.declarations.appendList(l.declarations),r.remove(t),!0;var g=i.compareDeclarations(l.declarations,d.declarations);if(g.eq.length){if(!g.ne1.length&&!g.ne2.length)return i.addToSelector(u,h),r.remove(f),!0;if(!s)if(g.ne1.length&&!g.ne2.length){var y=n(u),v=o(g.eq);v>y&&(i.addToSelector(h,u),e.block.declarations=new a(g.ne1))}else if(!g.ne1.length&&g.ne2.length){var y=n(h),v=o(g.eq);v>y&&(i.addToSelector(u,h),p.block.declarations=new a(g.ne2))}else{var b={type:"Selector",info:{},selectors:i.addToSelector(h.copy(),u)},k=n(b.selectors)+2,v=o(g.eq);if(v>=k){var w={type:"Ruleset",info:{},pseudoSignature:e.pseudoSignature,selector:b,block:{type:"Block",info:{},declarations:new a(g.eq)}};return e.block.declarations=new a(g.ne1),p.block.declarations=new a(g.ne2.concat(g.ne2overrided)),r.insert(r.createItem(w),f),!0}}}h.each(function(e){c[e.compareMarker]=!0})})}},{"../../utils/list.js":44,"./utils.js":38}],34:[function(e,t,r){function n(){this.seed=0,this.map=Object.create(null)}var o=e("../ast/walk.js").rules,a=e("../ast/walk.js").rulesRight,i=e("../ast/translate.js"),s=e("./prepare/index.js"),u=e("./1-initialMergeRuleset.js"),l=e("./2-mergeAtrule.js"),c=e("./3-disjoinRuleset.js"),p=e("./4-restructShorthand.js"),f=e("./6-restructBlock.js"),h=e("./7-mergeRuleset.js"),d=e("./8-restructRuleset.js");n.prototype.resolve=function(e){var t=this.map[e];return t||(t=++this.seed,this.map[e]=t),t},t.exports=function(e,t){function r(r,n){o(e,function(e,t,r){"Ruleset"===e.type&&n.call(this,e,t,r)}),t(r,e)}function m(r,n){a(e,function(e,t,r){"Ruleset"===e.type&&n.call(this,e,t,r)}),t(r,e)}function g(r,n){a(e,function(e,t,r){"Atrule"===e.type&&n.call(this,e,t,r)}),t(r,e)}var y=function(){var e=new n,t=new n;return function(r){var n=r.property.name,o=i(r.value);return r.id=e.resolve(n)+(t.resolve(o)<<12),r.length=n.length+1+o.length,r}}();o(e,function(e){s(e,y)}),t("prepare",e),m("initialMergeRuleset",u),g("mergeAtrule",l),m("disjoinRuleset",c),p(e,y),t("restructShorthand",e),f(e),t("restructBlock",e),r("mergeRuleset",h),m("restructRuleset",d)}},{"../ast/translate.js":4,"../ast/walk.js":6,"./1-initialMergeRuleset.js":27,"./2-mergeAtrule.js":28,"./3-disjoinRuleset.js":29,"./4-restructShorthand.js":30,"./6-restructBlock.js":31,"./7-mergeRuleset.js":32,"./8-restructRuleset.js":33,"./prepare/index.js":35}],35:[function(e,t,r){var n=e("../../ast/names.js").keyword,o=e("../../ast/translate.js"),a=e("./processSelector.js");t.exports=function(e,t){switch(e.type){case"Ruleset":e.block.declarations.each(t),a(e);break;case"Atrule":e.expression&&(e.expression.id=o(e.expression)),"keyframes"===n(e.name).name&&(e.block.avoidRulesMerge=!0,e.block.rules.each(function(e){e.selector.selectors.each(function(e){e.compareMarker=e.id})}))}}},{"../../ast/names.js":3,"../../ast/translate.js":4,"./processSelector.js":36}],36:[function(e,t,r){var n=e("../../ast/translate.js"),o=e("./specificity.js"),a={"first-letter":!0,"first-line":!0,after:!0,before:!0},i={link:!0,visited:!0,hover:!0,active:!0,"first-letter":!0,"first-line":!0,after:!0,before:!0};t.exports=function(e){var t=Object.create(null),r=!1;e.selector.selectors.each(function(e){for(var s=e.sequence,u=s.tail,l="*";u&&u.prev&&"Combinator"!==u.prev.data.type;)u=u.prev;u&&"Identifier"===u.data.type&&(l=u.data.name),e.compareMarker=o(e)+","+l,e.id=n(e),e.sequence.each(function(e){switch(e.type){case"PseudoClass":i.hasOwnProperty(e.name)||(t[e.name]=!0,r=!0);break;case"PseudoElement":a.hasOwnProperty(e.name)||(t[e.name]=!0,r=!0);break;case"FunctionalPseudo":t[e.name]=!0,r=!0}})}),r&&(e.pseudoSignature=Object.keys(t).sort().join(","))}},{"../../ast/translate.js":4,"./specificity.js":37}],37:[function(e,t,r){t.exports=function(e){var t=0,r=0,n=0;return e.sequence.each(function o(e){switch(e.type){case"SimpleSelector":case"Negation":e.sequence.each(o);break;case"Id":t++;break;case"Class":case"Attribute":case"FunctionalPseudo":r++;break;case"Identifier":"*"!==e.name&&n++;break;case"PseudoElement":n++;break;case"PseudoClass":var a=e.name.toLowerCase();"before"===a||"after"===a||"first-line"===a||"first-letter"===a?n++:r++}}),[t,r,n]}},{}],38:[function(e,t,r){function n(e,t){for(var r=e.head,n=t.head;r&&n&&r.data.id===n.data.id;)r=r.next,n=n.next;return null===r&&null===n}function o(e,t){for(var r=e.head,n=t.head;r&&n&&r.data.id===n.data.id;)r=r.next,n=n.next;return null===r&&null===n}function a(e,t){for(var r={eq:[],ne1:[],ne2:[],ne2overrided:[]},n=Object.create(null),o=Object.create(null),a=t.head;a;a=a.next)o[a.data.id]=!0;for(var a=e.head;a;a=a.next){var i=a.data;i.fingerprint&&(n[i.fingerprint]=i.value.important),o[i.id]?(o[i.id]=!1,r.eq.push(i)):r.ne1.push(i)}for(var a=t.head;a;a=a.next){var i=a.data;o[i.id]&&(s.call(n,i.fingerprint)&&Number(n[i.fingerprint])>=Number(i.value.important)?r.ne2overrided.push(i):r.ne2.push(i))}return r}function i(e,t){return t.each(function(t){for(var r=t.id,n=e.head;n;){var o=n.data.id;if(o===r)return;if(o>r)break;n=n.next}e.insert(e.createItem(t),n)}),e}var s=Object.prototype.hasOwnProperty;t.exports={isEqualLists:n,isEqualDeclarations:o,compareDeclarations:a,addToSelector:i}},{}],39:[function(e,t,r){function n(e,t,r,n){return t.debug&&console.error("## "+e+" done in %d ms\n",Date.now()-r),n}function o(e){var t;return function(r,n){var o=r;if(n&&(o="["+((Date.now()-t)/1e3).toFixed(3)+"s] "+o),e>1&&n){var a=u(n,!0);2===e&&a.length>256&&(a=a.substr(0,256)+"..."),o+="\n "+a+"\n"}console.error(o),t=Date.now()}}function a(e){var t={};for(var r in e)t[r]=e[r];return t.outputAst="internal","function"!=typeof t.logger&&e.debug&&(t.logger=o(e.debug)),t}var i=e("./parser"),s=e("./compressor"),u=e("./compressor/ast/translate"),l=e("./compressor/ast/translateWithSourceMap"),c=e("./compressor/ast/walk"),p=e("./utils/walker"),f=e("./utils/translate"),h=e("./utils/stringify"),d=e("./utils/cleanInfo"),m=function(e,t,r){console.warn("`csso.justDoIt()` method is deprecated, use `csso.minify()` instead");var n=i(e,"stylesheet",r),o=s(n,{restructure:!t,outputAst:"internal"});return u(o)},g=function(e,t){t=t||{};var r,o=t.filename||"<unknown>",c=n("parsing",t,new Date,i(e,"stylesheet",{filename:o,positions:Boolean(t.sourceMap),needInfo:!0})),p=n("compress",t,new Date,s(c,a(t)));return r=t.sourceMap?n("translateWithSourceMap",t,new Date,function(){var t=l(p);return t.map._file=o,t.map.setSourceContent(o,e),t}()):n("translate",t,new Date,u(p))};t.exports={version:e("../package.json").version,minify:g,parse:i,compress:s,translate:f,walk:p,stringify:h,cleanInfo:d,internal:{fromGonzales:e("./compressor/ast/gonzalesToInternal"),toGonzales:e("./compressor/ast/internalToGonzales"),translate:u,translateWithSourceMap:l,walk:c.all,walkRules:c.rules,walkRulesRight:c.rulesRight},justDoIt:m}},{"../package.json":59,"./compressor":26,"./compressor/ast/gonzalesToInternal":1,"./compressor/ast/internalToGonzales":2,"./compressor/ast/translate":4,"./compressor/ast/translateWithSourceMap":5,"./compressor/ast/walk":6,"./parser":41,"./utils/cleanInfo":43,"./utils/stringify":45,"./utils/translate":46,"./utils/walker":47}],40:[function(e,t,r){r.TokenType={String:"String",Comment:"Comment",Unknown:"Unknown",Newline:"Newline",Space:"Space",Tab:"Tab",ExclamationMark:"ExclamationMark",QuotationMark:"QuotationMark",NumberSign:"NumberSign",DollarSign:"DollarSign",PercentSign:"PercentSign",Ampersand:"Ampersand",Apostrophe:"Apostrophe",LeftParenthesis:"LeftParenthesis",RightParenthesis:"RightParenthesis",Asterisk:"Asterisk",PlusSign:"PlusSign",Comma:"Comma",HyphenMinus:"HyphenMinus",FullStop:"FullStop",Solidus:"Solidus",Colon:"Colon",Semicolon:"Semicolon",LessThanSign:"LessThanSign",EqualsSign:"EqualsSign",GreaterThanSign:"GreaterThanSign",QuestionMark:"QuestionMark",CommercialAt:"CommercialAt",LeftSquareBracket:"LeftSquareBracket",ReverseSolidus:"ReverseSolidus",RightSquareBracket:"RightSquareBracket",CircumflexAccent:"CircumflexAccent",LowLine:"LowLine",LeftCurlyBracket:"LeftCurlyBracket",VerticalLine:"VerticalLine",RightCurlyBracket:"RightCurlyBracket",Tilde:"Tilde",Identifier:"Identifier",DecimalNumber:"DecimalNumber"},r.NodeType={AtkeywordType:"atkeyword",AtrulebType:"atruleb",AtrulerqType:"atrulerq",AtrulersType:"atrulers",AtrulerType:"atruler",AtrulesType:"atrules",AttribType:"attrib",AttrselectorType:"attrselector",BlockType:"block",BracesType:"braces",ClassType:"clazz",CombinatorType:"combinator",CommentType:"comment",DeclarationType:"declaration",DecldelimType:"decldelim",DelimType:"delim",DimensionType:"dimension",FilterType:"filter",FiltervType:"filterv",FunctionBodyType:"functionBody",FunctionExpressionType:"functionExpression",FunctionType:"funktion",IdentType:"ident",ImportantType:"important",NamespaceType:"namespace",NthselectorType:"nthselector",NthType:"nth",NumberType:"number",OperatorType:"operator",PercentageType:"percentage",ProgidType:"progid",PropertyType:"property",PseudocType:"pseudoc",PseudoeType:"pseudoe",RawType:"raw",RulesetType:"ruleset",SelectorType:"selector",ShashType:"shash",SimpleselectorType:"simpleselector",StringType:"string",StylesheetType:"stylesheet",SType:"s",UnaryType:"unary",UnknownType:"unknown",UriType:"uri",ValueType:"value",VhashType:"vhash"}},{}],41:[function(e,t,r){"use strict";function n(e){var t,r=new Error(e),n=1,o=1;throw pe.length&&(fe<pe.length?(n=pe[fe].line,o=pe[fe].column):(fe=pe.length-1,t=pe[fe].value.trimRight().split(/\n|\r\n?|\f/),n=pe[fe].line+t.length-1,o=t.length>1?t[t.length-1].length+1:pe[fe].column+t[t.length-1].length)),r.name="CssSyntaxError",r.parseError={line:n,column:o},r}function o(e){return fe<pe.length&&pe[fe].type===e?(fe++,!0):void n(e+" is expected")}function a(e,t){if(fe<pe.length){var r=pe[fe];if(r.type===he.Identifier&&r.value.toLowerCase()===e)return t&&fe++,!0}n("Identifier `"+e+"` is expected")}function i(e){if(fe<pe.length)for(var t=1,r=pe[fe].type;t<arguments.length;t++)if(r===arguments[t])return!0;n(e+" is expected")}function s(e){if(le&&e<pe.length){var t=pe[e];return{source:ce,offset:t.offset,line:t.line,column:t.column}}return null}function u(e){var t=[s(fe),de.StylesheetType];e:for(;fe<pe.length;)switch(pe[fe].type){case he.Space:t.push(ne());break;case he.Comment:t.push(_());break;case he.Unknown:t.push(se());break;case he.CommercialAt:t.push(p());break;case he.RightCurlyBracket:e||n("Unexpected right curly brace");break e;default:t.push(f())}return t}function l(e){for(e++;e<pe.length;e++){var t=pe[e].type;if(t===he.RightCurlyBracket)return!0;if(t===he.LeftCurlyBracket||t===he.CommercialAt)return!1}return!0}function c(){return o(he.CommercialAt),[s(fe-1),de.AtkeywordType,U()]}function p(){var e=[s(fe),de.AtrulesType,c(fe)];e:for(;fe<pe.length;)switch(pe[fe].type){case he.Semicolon:fe++;break e;case he.LeftCurlyBracket:if(l(fe))e[1]=de.AtrulebType,e.push(m());else{e[1]=de.AtrulerType,e.push([{},de.AtrulerqType].concat(e.splice(3))),fe++;var t=u(!0);t[1]=de.AtrulersType,e.push(t),fe++}break e;case he.Space:e.push(ne());break;case he.Comment:e.push(_());break;case he.Comma:e.push(W());break;case he.Colon:e.push(ee());break;case he.LeftParenthesis:e.push(S(ye));break;default:e.push(b(ye))}return e}function f(){return[s(fe),de.RulesetType,h(),m()]}function h(){var e=[s(fe),de.SelectorType];e:for(;fe<pe.length;)switch(pe[fe].type){case he.LeftCurlyBracket:break e;case he.Comma:e.push([s(fe++),de.DelimType]);break;default:e.push(d())}return e}function d(e){var t=[s(fe),de.SimpleselectorType];e:for(;fe<pe.length;)switch(pe[fe].type){case he.Comma:break e;case he.LeftCurlyBracket:e&&n("Unexpected input");break e;case he.RightParenthesis:e||n("Unexpected input");break e;case he.Space:t.push(ne());break;case he.Comment:t.push(_());break;case he.PlusSign:case he.GreaterThanSign:case he.Tilde:case he.Solidus:t.push(x());break;case he.FullStop:t.push(C());break;case he.LeftSquareBracket:t.push(k());break;case he.NumberSign:t.push(A());break;case he.Colon:t.push(ee());break;case he.HyphenMinus:case he.LowLine:case he.Identifier:case he.Asterisk:case he.DecimalNumber:t.push(J()||F(!1));break;default:n("Unexpected input")}return t}function m(){var e=[s(fe),de.BlockType];o(he.LeftCurlyBracket);e:for(;fe<pe.length;)switch(pe[fe].type){case he.RightCurlyBracket:break e;case he.Space:e.push(ne());break;case he.Comment:e.push(_());break;case he.Semicolon:e.push([s(fe++),de.DecldelimType]);break;default:e.push(g())}return o(he.RightCurlyBracket),e}function g(e){var t=fe,r=s(fe),n=y();o(he.Colon);for(var a=t;fe>a;a++)if("filter"===pe[a].value){if(Y(fe))return[r,de.FilterType,n,K()];break}return[r,de.DeclarationType,n,v(e)]}function y(){for(var e=s(fe),t="";fe<pe.length;){var r=pe[fe].type;if(r!==he.Solidus&&r!==he.Asterisk&&r!==he.DollarSign)break;t+=pe[fe++].value}return oe([e,de.PropertyType,[e,de.IdentType,t+D(!0)]])}function v(e){var t=[s(fe),de.ValueType];e:for(;fe<pe.length;)switch(pe[fe].type){case he.RightCurlyBracket:case he.Semicolon:break e;case he.RightParenthesis:e||n("Unexpected input");break e;case he.Space:t.push(ne());break;case he.Comment:t.push(_());break;case he.NumberSign:t.push(ue());break;case he.Solidus:case he.Comma:t.push(W());break;case he.LeftParenthesis:case he.LeftSquareBracket:t.push(S(be));break;case he.ExclamationMark:t.push(z());break;default:if(pe[fe].type===he.Identifier){var r=pe[fe].value;if(("U"===r||"u"===r)&&fe+1<pe.length&&pe[fe+1].type===he.PlusSign){fe+=2,t.push([s(fe),de.IdentType,r+"+"+B(!0)]);break}}t.push(b(be))}return t}function b(e){var t=fe;switch(pe[fe].type){case he.String:return ae();case he.FullStop:case he.DecimalNumber:case he.HyphenMinus:case he.PlusSign:var r=V();if(null!==r){if(fe<pe.length){if(pe[fe].type===he.PercentSign)return Q(t,r);if(pe[fe].type===he.Identifier)return P(t,r)}return r}if(pe[fe].type===he.HyphenMinus&&fe<pe.length&&(pe[fe+1].type===he.Identifier||pe[fe+1].type===he.HyphenMinus))break;if(pe[fe].type===he.HyphenMinus||pe[fe].type===he.PlusSign)return ie();n("Unexpected input");break;case he.HyphenMinus:case he.LowLine:case he.Identifier:break;default:n("Unexpected input")}var o=U();return fe<pe.length&&pe[fe].type===he.LeftParenthesis?(fe=t,T(e)):o}function k(){var e=[s(fe),de.AttribType];return o(he.LeftSquareBracket),oe(e),e.push(F(!0)),oe(e),fe<pe.length&&pe[fe].type!==he.RightSquareBracket&&(e.push(w()),oe(e),fe<pe.length&&pe[fe].type===he.String?e.push(ae()):e.push(U()),oe(e),fe<pe.length&&pe[fe].type===he.Identifier&&(e.push([s(fe),"attribFlags",pe[fe++].value]),oe(e))),o(he.RightSquareBracket),e}function w(){i("Attribute selector (=, ~=, ^=, $=, *=, |=)",he.EqualsSign,he.Tilde,he.CircumflexAccent,he.DollarSign,he.Asterisk,he.VerticalLine);var e,t=fe;return pe[fe].type===he.EqualsSign?(e="=",fe++):(e=pe[fe].value+"=",fe++,o(he.EqualsSign)),[s(t),de.AttrselectorType,e]}function S(e){i("Parenthesis or square bracket",he.LeftParenthesis,he.LeftSquareBracket);var t;t=pe[fe].type===he.LeftParenthesis?he.RightParenthesis:he.RightSquareBracket;var r=[s(fe),de.BracesType,pe[fe].value,null];fe++;e:for(;fe<pe.length;)switch(pe[fe].type){case t:r[3]=pe[fe].value;break e;case he.Space:r.push(ne());break;case he.Comment:r.push(_());break;case he.NumberSign:r.push(ue());break;case he.LeftParenthesis:case he.LeftSquareBracket:r.push(S(e));break;case he.Solidus:case he.Asterisk:case he.Comma:case he.Colon:r.push(W());break;default:r.push(b(e))}return o(t),r}function C(){var e=fe;return o(he.FullStop),[s(e),de.ClassType,U()]}function A(){var e=fe;return o(he.NumberSign),[s(e),de.ShashType,D()]}function x(){var e,t=s(fe);switch(pe[fe].type){case he.PlusSign:case he.GreaterThanSign:case he.Tilde:e=pe[fe].value,fe++;break;case he.Solidus:e="/deep/",fe++,a("deep",!0),o(he.Solidus);break;default:n("Combinator (+, >, ~, /deep/) is expected")}return[t,de.CombinatorType,e]}function _(){var e=pe[fe].value,t=e.length;return t>4&&"*"===e.charAt(t-2)&&"/"===e.charAt(t-1)&&(t-=2),[s(fe++),de.CommentType,e.substring(2,t)]}function j(){if(fe<pe.length&&pe[fe].type===he.Identifier){var e=pe[fe].value,t=e.indexOf("\\");return-1===t?(fe++,e):(pe[fe].value=e.substr(t),pe[fe].offset+=t,pe[fe].column+=t,e.substr(0,t))}n("Identifier is expected")}function P(e,t){return[s(e||fe),de.DimensionType,t||$(),[s(fe),de.IdentType,j()]]}function L(e,t){var r="",a=0,e=fe,t=U();for("expression"!==t[2]&&n("`expression` is expected"),o(he.LeftParenthesis);fe<pe.length;){if(pe[fe].type===he.RightParenthesis){if(0===a)break;a--}else pe[fe].type===he.LeftParenthesis&&a++;r+=pe[fe++].value}return o(he.RightParenthesis),[s(e),de.FunctionExpressionType,r]}function T(e){var t=E;if(fe+1<pe.length&&pe[fe].type===he.Identifier){var r=pe[fe].value;if(pe[fe+1].type===he.LeftParenthesis&&ke.hasOwnProperty(e)&&ke[e].hasOwnProperty(r))return ke[e][r](e)}return O(t,e)}function R(e){return O(q,e)}function M(e){return O(I,e)}function O(e,t){var r=fe,n=U();o(he.LeftParenthesis);var a=e(t);return o(he.RightParenthesis),[s(r),de.FunctionType,n,a]}function E(e){var t=[s(fe),de.FunctionBodyType];e:for(;fe<pe.length;)switch(pe[fe].type){case he.RightParenthesis:break e;case he.Space:t.push(ne());break;case he.Comment:t.push(_());break;case he.NumberSign:t.push(ue());break;case he.LeftParenthesis:case he.LeftSquareBracket:t.push(S(e));break;case he.Solidus:case he.Asterisk:case he.Comma:case he.Colon:case he.EqualsSign:t.push(W());break;default:t.push(b(e))}return t}function q(){var e=[s(fe),de.FunctionBodyType],t=!1;e:for(;fe<pe.length;)switch(pe[fe].type){case he.RightParenthesis:t||n("Simple selector is expected");break e;case he.Comma:t||n("Simple selector is expected"),t=!1,e.push([s(fe++),de.DelimType]);break;default:t=!0,e.push(d(!0))}return e}function I(){var e=[s(fe),de.FunctionBodyType];return oe(e),e.push(U(!0)),oe(e),fe<pe.length&&pe[fe].type===he.Comma&&(e.push(W(),v(!0)),oe(e)),e}function N(){var e=fe,t=[s(e),de.UriType],r=U();if("url"!==r[2]&&n("`url` is expected"),o(he.LeftParenthesis),oe(t),pe[fe].type===he.String)t.push(ae()),oe(t);else{for(var a=fe,i="";fe<pe.length;){var u=pe[fe].type;if(u===he.Space||u===he.LeftParenthesis||u===he.RightParenthesis)break;i+=pe[fe++].value}t.push([s(a),de.RawType,i]),oe(t)}return o(he.RightParenthesis),t}function B(e){for(var t="";fe<pe.length&&(pe[fe].type===he.DecimalNumber||pe[fe].type===he.Identifier);fe++)t+=pe[fe].value;if(/^[0-9a-f]{1,6}$/i.test(t)||n("Unexpected input"),e)for(;t.length<6&&fe<pe.length&&pe[fe].type===he.QuestionMark;fe++)t+=pe[fe].value,e=!1;if(e&&fe<pe.length&&pe[fe].type===he.HyphenMinus){fe++;var r=B(!1);r||n("Unexpected input"),t+="-"+r}return t}function D(e){var t="";if(fe<pe.length&&pe[fe].type===he.HyphenMinus&&(t="-",fe++,e&&fe<pe.length&&pe[fe].type===he.HyphenMinus&&(t="--",fe++)),i("Identifier",he.LowLine,he.Identifier),fe<pe.length)for(t+=pe[fe].value,fe++;fe<pe.length;fe++){var r=pe[fe].type;if(r!==he.LowLine&&r!==he.Identifier&&r!==he.DecimalNumber&&r!==he.HyphenMinus)break;t+=pe[fe].value}return t}function F(e){fe>=pe.length&&n("Unexpected end of input");var t,r=s(fe);return pe[fe].type===he.Asterisk?(e=!1,t="*",fe++):t=D(),fe<pe.length&&pe[fe].type===he.VerticalLine&&fe+1<pe.length&&pe[fe+1].type!==he.EqualsSign&&(t+="|",fe++,fe<pe.length&&(pe[fe].type===he.HyphenMinus||pe[fe].type===he.Identifier||pe[fe].type===he.LowLine?t+=D():pe[fe].type===he.Asterisk&&(e=!1,t+="*",fe++))),e&&fe<pe.length&&pe[fe].type===he.Colon&&(fe++,t+=":"+D()),[r,de.IdentType,t]}function U(e){return[s(fe),de.IdentType,D(e)]}function z(){o(he.ExclamationMark);var e=oe([s(fe-1),de.ImportantType]);return a("important",!0),e}function G(){i("Number, odd or even",he.Identifier,he.DecimalNumber);var e=fe,t=pe[fe].value;return pe[fe].type===he.DecimalNumber?fe+1<pe.length&&pe[fe+1].type===he.Identifier&&"n"===pe[fe+1].value&&(t+="n",fe++):"odd"!==t&&"even"!==t&&"n"!==t&&n("Unexpected identifier"),fe++,[s(e),de.NthType,t]}function H(){o(he.Colon),a("nth",!1);var e=[s(fe-1),de.NthselectorType,U()];o(he.LeftParenthesis);e:for(;fe<pe.length;)switch(pe[fe].type){case he.RightParenthesis:break e;case he.Space:e.push(ne());break;case he.Comment:e.push(_());break;case he.HyphenMinus:case he.PlusSign:e.push(ie());break;default:e.push(G())}return o(he.RightParenthesis),e}function V(){var e=fe,t=!1,r="",n=fe;return n<pe.length&&pe[n].type===he.HyphenMinus&&(r="-",n++),n<pe.length&&pe[n].type===he.DecimalNumber&&(t=!0,r+=pe[n].value,n++),n<pe.length&&pe[n].type===he.FullStop&&(r+=".",n++),n<pe.length&&pe[n].type===he.DecimalNumber&&(t=!0,r+=pe[n].value,n++),t?(fe=n,[s(e),de.NumberType,r]):null}function $(){var e=V();return e||n("Wrong number"),e}function W(){return i("Operator",he.Solidus,he.Asterisk,he.Comma,he.Colon,he.EqualsSign),[s(fe),de.OperatorType,pe[fe++].value]}function J(){var e=fe,t=V();return t?fe>=pe.length||pe[fe].type!==he.PercentSign?null:Q(e,t):null}function Q(e,t){return e||(e=fe),t||(t=$()),o(he.PercentSign),[s(e),de.PercentageType,t]}function K(){for(var e=[s(fe),de.FiltervType];Y(fe);)e.push(Z());return oe(e),fe<pe.length&&pe[fe].type===he.ExclamationMark&&e.push(z()),e}function X(e){for(var t=e;e<pe.length&&(pe[e].type===he.Space||pe[e].type===he.Comment);)e++;return e-t}function Y(e){var t=e;if(e+=X(e),e+1>=pe.length||"progid"!==pe[e+0].value||pe[e+1].type!==he.Colon)return!1;if(e+=2,e+=X(e),e+6>=pe.length||"DXImageTransform"!==pe[e+0].value||pe[e+1].type!==he.FullStop||"Microsoft"!==pe[e+2].value||pe[e+3].type!==he.FullStop||pe[e+4].type!==he.Identifier)return!1;if(e+=5,e+=X(e),e>=pe.length||pe[e].type!==he.LeftParenthesis)return!1;for(;e<pe.length&&pe[e++].type!==he.RightParenthesis;);return pe[t].progidEnd=e,!0}function Z(){var e=[s(fe),de.ProgidType],t=pe[fe].progidEnd,r="";t||Y(fe)||n("progid is expected"),oe(e);for(var o=fe;t>fe;fe++)r+=pe[fe].value;return e.push([s(o),de.RawType,r]),oe(e),e}function ee(){(fe>=pe.length||pe[fe].type!==he.Colon)&&n("Colon is expected"),fe+1>=pe.length&&(fe++,n("Colon or identifier is expected"));var e=pe[fe+1];return e.type===he.Colon?te():e.type===he.Identifier&&"nth"===e.value?H():re()}function te(){return o(he.Colon),o(he.Colon),[s(fe-2),de.PseudoeType,U()]}function re(){var e=fe,t=o(he.Colon)&&U();return fe<pe.length&&pe[fe].type===he.LeftParenthesis&&(fe=e+1,t=T(ve)),[s(e),de.PseudocType,t]}function ne(){return[s(fe),de.SType,pe[fe++].value]}function oe(e){e:for(;fe<pe.length;)switch(pe[fe].type){case he.Space:e.push(ne());break;case he.Comment:e.push(_());break;default:break e}return e}function ae(){return[s(fe),de.StringType,pe[fe++].value]}function ie(){return i("Unary operator",he.HyphenMinus,he.PlusSign),[s(fe),de.UnaryType,pe[fe++].value]}function se(){return o(he.Unknown),[s(fe-1),de.UnknownType,pe[fe-1].value]}function ue(){o(he.NumberSign),i("Number or identifier",he.DecimalNumber,he.Identifier);var e=pe[fe].value;return pe[fe++].type===he.DecimalNumber&&fe<pe.length&&pe[fe].type===he.Identifier&&(e+=pe[fe++].value),[s(fe-1),de.VhashType,e]}var le,ce,pe,fe,he=e("./const.js").TokenType,de=e("./const.js").NodeType,me=e("./tokenize.js"),ge=e("../utils/cleanInfo.js"),ye=1,ve=2,be=3,ke={};ke[ye]={url:N},ke[ve]={url:N,not:R},ke[be]={url:N,expression:L,"var":M};var we={atkeyword:c,atruleb:p,atruler:p,atrules:p,attrib:k,attrselector:w,block:m,braces:S,clazz:C,combinator:x,comment:_,declaration:g,dimension:P,filter:g,functionExpression:L,funktion:T,ident:U,important:z,nth:G,nthselector:H,number:$,operator:W,percentage:Q,progid:Z,property:y,pseudoc:re,pseudoe:te,ruleset:f,selector:h,shash:A,
17
+ simpleselector:d,string:ae,stylesheet:u,unary:ie,unknown:se,uri:N,value:v,vhash:ue};t.exports=function(e,t,r){var n;return r=r||{},r===!0&&(r={positions:!0,needInfo:!0}),le="positions"in r?r.positions||!1:r.needPositions||!1,ce=r.filename||"<unknown>",t=t||"stylesheet",fe=0,pe=me(e,r.line,r.column),pe.length&&(n=we[t]()),pe=null,n||"stylesheet"!==t||(n=[{},t]),n&&!r.needInfo&&(n=ge(n)),n}},{"../utils/cleanInfo.js":43,"./const.js":40,"./tokenize.js":42}],42:[function(e,t,r){"use strict";function n(e,t,r){function n(e,t,r,n){y.push({type:e,value:n,offset:b,line:t,column:r}),b=h}if(!e)return[];var o,m,g,y=[],v=!1,b=0,k=0;for(h=65279===e.charCodeAt(0)?1:0,b=h,f="undefined"==typeof t?1:t,p="undefined"==typeof r?-1:-r;h<e.length;h++)switch(o=e.charCodeAt(h),q>o?I[o]:0){case R:n(d.DecimalNumber,f,h-p,l(e));break;case M:case O:n(d.String,f,h-p,u(e,o));break;case L:n(d.Space,f,h-p,a(e));break;case T:if(o===A){if(m=e.charCodeAt(h+1),m===C){n(d.Comment,f,h-p,i(e));continue}if(m===A&&!v){if(k>0){for(var w=2;e.charCodeAt(h+w)===A;)w++;n(d.Identifier,f,h-p,g=c(e,w)),v=v||"url"===g}else n(d.Unknown,f,h-p,s(e));continue}}n(E[o],f,h-p,String.fromCharCode(o)),o===S?v=!1:o===j?k++:o===P&&k--;break;default:n(d.Identifier,f,h-p,g=c(e,0)),v=v||"url"===g}return y}function o(e,t){return e===g||e===y||e===v?(e===v&&h+1<t.length&&t.charCodeAt(h+1)===g&&h++,f++,p=h,!0):!1}function a(e){for(var t=h;h<e.length;h++){var r=e.charCodeAt(h);if(!o(r,e)&&r!==b&&r!==m)break}return h--,e.substring(t,h+1)}function i(e){var t=h;for(h+=2;h<e.length;h++){var r=e.charCodeAt(h);if(r===C){if(e.charCodeAt(h+1)===A){h++;break}}else o(r,e)}return e.substring(t,h+1)}function s(e){var t=h;for(h+=2;h<e.length&&!o(e.charCodeAt(h),e);h++);return e.substring(t,h+1)}function u(e,t){var r=h,n="";for(h++;h<e.length;h++){var a=e.charCodeAt(h);if(a===x){var i=h++;o(e.charCodeAt(h),e)&&(n+=e.substring(r,i),r=h+1)}else if(a===t)break}return n+e.substring(r,h+1)}function l(e){var t,r=h;for(h++;h<e.length&&(t=e.charCodeAt(h),!(48>t||t>57));h++);return h--,e.substring(r,h+1)}function c(e,t){var r=h;for(h+=t;h<e.length;h++){var n=e.charCodeAt(h);if(n===x){h++;for(var a=0;7>a&&h+a<e.length;a++)if(n=e.charCodeAt(h+a),6===a||!(n>=48&&57>=n||n>=65&&70>=n||n>=97&&102>=n)){a>0&&(h+=a-1,(n===b||n===m||o(n,e))&&h++);break}}else if(q>n&&N[n]===T)break}return h--,e.substring(r,h+1)}var p,f,h,d=e("./const.js").TokenType,m=9,g=10,y=12,v=13,b=32,k=34,w=39,S=41,C=42,A=47,x=92,_=95,j=123,P=125,L=1,T=2,R=3,M=4,O=5,E={9:d.Tab,10:d.Newline,13:d.Newline,32:d.Space,33:d.ExclamationMark,34:d.QuotationMark,35:d.NumberSign,36:d.DollarSign,37:d.PercentSign,38:d.Ampersand,39:d.Apostrophe,40:d.LeftParenthesis,41:d.RightParenthesis,42:d.Asterisk,43:d.PlusSign,44:d.Comma,45:d.HyphenMinus,46:d.FullStop,47:d.Solidus,58:d.Colon,59:d.Semicolon,60:d.LessThanSign,61:d.EqualsSign,62:d.GreaterThanSign,63:d.QuestionMark,64:d.CommercialAt,91:d.LeftSquareBracket,93:d.RightSquareBracket,94:d.CircumflexAccent,95:d.LowLine,123:d.LeftCurlyBracket,124:d.VerticalLine,125:d.RightCurlyBracket,126:d.Tilde},q=Math.max.apply(null,Object.keys(E))+1,I=new Uint32Array(q),N=new Uint32Array(q);Object.keys(E).forEach(function(e){I[Number(e)]=T,N[Number(e)]=T},I),N[_]=0;for(var B=48;57>=B;B++)I[B]=R;I[b]=L,I[m]=L,I[g]=L,I[v]=L,I[y]=L,I[w]=M,I[k]=O,t.exports=n},{"./const.js":40}],43:[function(e,t,r){t.exports=function n(e){for(var t,r=e.slice(1),o=1;t=r[o];o++)Array.isArray(t)&&(r[o]=n(t));return r}},{}],44:[function(e,t,r){function n(e){return{data:e,next:null,prev:null}}var o=function(e){if(this.cursor=null,this.head=null,this.tail=null,Array.isArray(e)){for(var t=null,r=0;r<e.length;r++){var o=n(e[r]);null!==t?t.next=o:this.head=o,o.prev=t,t=o}this.tail=t}};Object.defineProperty(o.prototype,"size",{get:function(){for(var e=0,t=this.head;t;)e++,t=t.next;return e}}),o.createItem=n,o.prototype.createItem=n,o.prototype.toArray=function(){for(var e=this.head,t=[];e;)t.push(e.data),e=e.next;return t},o.prototype.toJSON=function(){return this.toArray()},o.prototype.isEmpty=function(){return null===this.head},o.prototype.first=function(){return this.head&&this.head.data},o.prototype.last=function(){return this.tail&&this.tail.data},o.prototype.each=function(e,t){var r,n={prev:null,next:this.head,cursor:this.cursor};for(void 0===t&&(t=this),this.cursor=n;null!==n.next;)r=n.next,n.next=r.next,e.call(t,r.data,r,this);this.cursor=this.cursor.cursor},o.prototype.eachRight=function(e,t){var r,n={prev:this.tail,next:null,cursor:this.cursor};for(void 0===t&&(t=this),this.cursor=n;null!==n.prev;)r=n.prev,n.prev=r.prev,e.call(t,r.data,r,this);this.cursor=this.cursor.cursor},o.prototype.nextUntil=function(e,t,r){if(null!==e){var n,o={prev:null,next:e,cursor:this.cursor};for(void 0===r&&(r=this),this.cursor=o;null!==o.next&&(n=o.next,o.next=n.next,!t.call(r,n.data,n,this)););this.cursor=this.cursor.cursor}},o.prototype.prevUntil=function(e,t,r){if(null!==e){var n,o={prev:e,next:null,cursor:this.cursor};for(void 0===r&&(r=this),this.cursor=o;null!==o.prev&&(n=o.prev,o.prev=n.prev,!t.call(r,n.data,n,this)););this.cursor=this.cursor.cursor}},o.prototype.some=function(e,t){var r=this.head;for(void 0===t&&(t=this);null!==r;){if(e.call(t,r.data,r,this))return!0;r=r.next}return!1},o.prototype.map=function(e,t){var r=[],n=this.head;for(void 0===t&&(t=this);null!==n;)r.push(e.call(t,n.data,n,this)),n=n.next;return r},o.prototype.copy=function(){for(var e=new o,t=this.head;null!==t;)e.insert(n(t.data)),t=t.next;return e},o.prototype.updateCursors=function(e,t,r,n){for(var o=this.cursor;null!==o;)(t===!0||o.prev===e)&&(o.prev=t),(n===!0||o.next===r)&&(o.next=n),o=o.cursor},o.prototype.insert=function(e,t){if(void 0!==t&&null!==t)if(this.updateCursors(t.prev,e,t,e),null===t.prev){if(this.head!==t)throw new Error("before doesn't below to list");this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t;else this.updateCursors(this.tail,e,null,e),null!==this.tail?(this.tail.next=e,e.prev=this.tail):this.head=e,this.tail=e},o.prototype.remove=function(e){if(this.updateCursors(e,e.prev,e,e.next),null!==e.prev)e.prev.next=e.next;else{if(this.head!==e)throw new Error("item doesn't below to list");this.head=e.next}if(null!==e.next)e.next.prev=e.prev;else{if(this.tail!==e)throw new Error("item doesn't below to list");this.tail=e.prev}return e.prev=null,e.next=null,e},o.prototype.appendList=function(e){null!==e.head&&(this.updateCursors(this.tail,e.tail,null,e.head),null!==this.tail?(this.tail.next=e.head,e.head.prev=this.tail):this.head=e.head,this.tail=e.tail,e.head=null,e.tail=null)},t.exports=o},{}],45:[function(e,t,r){function n(e){return new Array(e+1).join(" ")}function o(e){return e.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/"/g,'\\"')}t.exports=function a(e,t){if(t=t||0,"string"==typeof e)return'"'+o(e)+'"';if(e&&e.constructor===Object){var r=Object.keys(e).map(function(r){return n(t+1)+'"'+o(r)+'": '+a(e[r],t+1)}).join(",\n");return"{"+(r?"\n"+r+"\n"+n(t):"")+"}"}if(Array.isArray(e)){var i=!0,r=e.map(function(e,r){var o=r?" ":"";return!Array.isArray(e)||i&&e.some(Array.isArray)||(o="\n"+n(t+1),i=!1),o+a(e,t+1)}).join(",");return/\n/.test(r)&&(r="\n"+n(t+1)+r+"\n"+n(t)),"["+r+"]"}return String(e)}},{}],46:[function(e,t,r){function n(e){P.push(e[j+1])}function o(e){for(var t=j+1;t<e.length;t++)_(e[t])}function a(e,t){for(;t<e.length;t++)_(e[t])}function i(e){_(e[j+1]),P.push("%")}function s(e){P.push("/*",e[j+1],"*/")}function u(e){P.push("."),_(e[j+1])}function l(e){P.push("@"),_(e[j+1])}function c(e){P.push("#",e[j+1])}function p(e){P.push("#",e[j+1])}function f(e){P.push("["),o(e),P.push("]")}function h(e){P.push("!"),o(e),P.push("important")}function d(e){P.push(":"),n(e[j+1]),P.push("("),a(e,j+2),P.push(")")}function m(e){n(e[j+1]),P.push("("),o(e[j+2]),P.push(")")}function g(e){_(e[j+1]),P.push(":"),_(e[j+2])}function y(e){_(e[j+1]),P.push(":"),_(e[j+2])}function v(e){P.push("{"),o(e),P.push("}")}function b(e){P.push(e[j+1]),a(e,j+3),P.push(e[j+2])}function k(e){o(e),P.push(";")}function w(e){_(e[j+1]),_(e[j+2]),P.push("{"),_(e[j+3]),P.push("}")}function S(e){P.push("::"),_(e[j+1])}function C(e){P.push(":"),_(e[j+1])}function A(e){P.push("url("),o(e),P.push(")")}function x(e){P.push("expression(",e[j+1],")")}function _(e){L[e[j]](e)}var j,P,L={unary:n,nth:n,combinator:n,ident:n,number:n,s:n,string:n,attrselector:n,operator:n,raw:n,unknown:n,attribFlags:n,simpleselector:o,dimension:o,selector:o,property:o,value:o,filterv:o,progid:o,ruleset:o,atruleb:o,atrulerq:o,atrulers:o,stylesheet:o,percentage:i,comment:s,clazz:u,atkeyword:l,shash:c,vhash:p,attrib:f,important:h,nthselector:d,funktion:m,declaration:g,filter:y,block:v,braces:b,atrules:k,atruler:w,pseudoe:S,pseudoc:C,uri:A,functionExpression:x,decldelim:function(){P.push(";")},delim:function(){P.push(",")}};t.exports=function(e,t){return j=t?1:0,P=[],_(e),P.join("")}},{}],47:[function(e,t,r){function n(e,t,r){switch(a(e,t,r),r.push(e),e[o+0]){case"simpleselector":case"dimension":case"selector":case"property":case"value":case"filterv":case"progid":case"ruleset":case"atruleb":case"atrulerq":case"atrulers":case"stylesheet":case"attrib":case"important":case"block":case"atrules":case"uri":for(var i=o+1;i<e.length;i++)n(e[i],e,r);break;case"percentage":case"clazz":case"atkeyword":case"pseudoe":case"pseudoc":n(e[o+1],e,r);break;case"declaration":case"filter":n(e[o+1],e,r),n(e[o+2],e,r);break;case"atruler":n(e[o+1],e,r),n(e[o+2],e,r),n(e[o+3],e,r);break;case"braces":for(var i=o+3;i<e.length;i++)n(e[i],e,r);break;case"nthselector":a(e[o+1],e,r);for(var i=o+2;i<e.length;i++)n(e[i],e,r);break;case"funktion":a(e[o+1],e,r),a(e[o+2],e,r),e=e[o+2],r.push(e);for(var i=o+1;i<e.length;i++)n(e[i],e,r);r.pop()}r.pop()}var o,a;t.exports=function(e,t,r){o=r?1:0,"function"==typeof t&&(a=t,n(e,null,[]))}},{}],48:[function(e,t,r){function n(){this._array=[],this._set={}}var o=e("./util");n.fromArray=function(e,t){for(var r=new n,o=0,a=e.length;a>o;o++)r.add(e[o],t);return r},n.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},n.prototype.add=function(e,t){var r=o.toSetString(e),n=this._set.hasOwnProperty(r),a=this._array.length;(!n||t)&&this._array.push(e),n||(this._set[r]=a)},n.prototype.has=function(e){var t=o.toSetString(e);return this._set.hasOwnProperty(t)},n.prototype.indexOf=function(e){var t=o.toSetString(e);if(this._set.hasOwnProperty(t))return this._set[t];throw new Error('"'+e+'" is not in the set.')},n.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},n.prototype.toArray=function(){return this._array.slice()},r.ArraySet=n},{"./util":57}],49:[function(e,t,r){function n(e){return 0>e?(-e<<1)+1:(e<<1)+0}function o(e){var t=1===(1&e),r=e>>1;return t?-r:r}var a=e("./base64"),i=5,s=1<<i,u=s-1,l=s;r.encode=function(e){var t,r="",o=n(e);do t=o&u,o>>>=i,o>0&&(t|=l),r+=a.encode(t);while(o>0);return r},r.decode=function(e,t,r){var n,s,c=e.length,p=0,f=0;do{if(t>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(s=a.decode(e.charCodeAt(t++)),-1===s)throw new Error("Invalid base64 digit: "+e.charAt(t-1));n=!!(s&l),s&=u,p+=s<<f,f+=i}while(n);r.value=o(p),r.rest=t}},{"./base64":50}],50:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(e){if(e>=0&&e<n.length)return n[e];throw new TypeError("Must be between 0 and 63: "+e)},r.decode=function(e){var t=65,r=90,n=97,o=122,a=48,i=57,s=43,u=47,l=26,c=52;return e>=t&&r>=e?e-t:e>=n&&o>=e?e-n+l:e>=a&&i>=e?e-a+c:e==s?62:e==u?63:-1}},{}],51:[function(e,t,r){function n(e,t,o,a,i,s){var u=Math.floor((t-e)/2)+e,l=i(o,a[u],!0);return 0===l?u:l>0?t-u>1?n(u,t,o,a,i,s):s==r.LEAST_UPPER_BOUND?t<a.length?t:-1:u:u-e>1?n(e,u,o,a,i,s):s==r.LEAST_UPPER_BOUND?u:0>e?-1:e}r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.search=function(e,t,o,a){if(0===t.length)return-1;var i=n(-1,t.length,e,t,o,a||r.GREATEST_LOWER_BOUND);if(0>i)return-1;for(;i-1>=0&&0===o(t[i],t[i-1],!0);)--i;return i}},{}],52:[function(e,t,r){function n(e,t){var r=e.generatedLine,n=t.generatedLine,o=e.generatedColumn,i=t.generatedColumn;return n>r||n==r&&i>=o||a.compareByGeneratedPositionsInflated(e,t)<=0}function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var a=e("./util");o.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},o.prototype.add=function(e){n(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(a.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},r.MappingList=o},{"./util":57}],53:[function(e,t,r){function n(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function o(e,t){return Math.round(e+Math.random()*(t-e))}function a(e,t,r,i){if(i>r){var s=o(r,i),u=r-1;n(e,s,i);for(var l=e[i],c=r;i>c;c++)t(e[c],l)<=0&&(u+=1,n(e,u,c));n(e,u+1,c);var p=u+1;a(e,t,r,p-1),a(e,t,p+1,i)}}r.quickSort=function(e,t){a(e,t,0,e.length-1)}},{}],54:[function(e,t,r){function n(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new i(t):new o(t)}function o(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=s.getArg(t,"version"),n=s.getArg(t,"sources"),o=s.getArg(t,"names",[]),a=s.getArg(t,"sourceRoot",null),i=s.getArg(t,"sourcesContent",null),u=s.getArg(t,"mappings"),c=s.getArg(t,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);n=n.map(s.normalize).map(function(e){return a&&s.isAbsolute(a)&&s.isAbsolute(e)?s.relative(a,e):e}),this._names=l.fromArray(o,!0),this._sources=l.fromArray(n,!0),this.sourceRoot=a,this.sourcesContent=i,this._mappings=u,this.file=c}function a(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function i(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=s.getArg(t,"version"),o=s.getArg(t,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new l,this._names=new l;var a={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=s.getArg(e,"offset"),r=s.getArg(t,"line"),o=s.getArg(t,"column");if(r<a.line||r===a.line&&o<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=t,{generatedOffset:{generatedLine:r+1,generatedColumn:o+1},consumer:new n(s.getArg(e,"map"))}})}var s=e("./util"),u=e("./binary-search"),l=e("./array-set").ArraySet,c=e("./base64-vlq"),p=e("./quick-sort").quickSort;n.fromSourceMap=function(e){return o.fromSourceMap(e)},n.prototype._version=3,n.prototype.__generatedMappings=null,Object.defineProperty(n.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),n.prototype.__originalMappings=null,Object.defineProperty(n.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),n.prototype._charIsMappingSeparator=function(e,t){var r=e.charAt(t);return";"===r||","===r},n.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},n.GENERATED_ORDER=1,n.ORIGINAL_ORDER=2,n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.prototype.eachMapping=function(e,t,r){var o,a=t||null,i=r||n.GENERATED_ORDER;switch(i){case n.GENERATED_ORDER:o=this._generatedMappings;break;case n.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;o.map(function(e){var t=null===e.source?null:this._sources.at(e.source);return null!=t&&null!=u&&(t=s.join(u,t)),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,a)},n.prototype.allGeneratedPositionsFor=function(e){var t=s.getArg(e,"line"),r={source:s.getArg(e,"source"),originalLine:t,originalColumn:s.getArg(e,"column",0)};if(null!=this.sourceRoot&&(r.source=s.relative(this.sourceRoot,r.source)),!this._sources.has(r.source))return[];r.source=this._sources.indexOf(r.source);var n=[],o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,u.LEAST_UPPER_BOUND);if(o>=0){var a=this._originalMappings[o];if(void 0===e.column)for(var i=a.originalLine;a&&a.originalLine===i;)n.push({line:s.getArg(a,"generatedLine",null),column:s.getArg(a,"generatedColumn",null),lastColumn:s.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++o];else for(var l=a.originalColumn;a&&a.originalLine===t&&a.originalColumn==l;)n.push({line:s.getArg(a,"generatedLine",null),column:s.getArg(a,"generatedColumn",null),lastColumn:s.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++o]}return n},r.SourceMapConsumer=n,o.prototype=Object.create(n.prototype),o.prototype.consumer=n,o.fromSourceMap=function(e){var t=Object.create(o.prototype),r=t._names=l.fromArray(e._names.toArray(),!0),n=t._sources=l.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var i=e._mappings.toArray().slice(),u=t.__generatedMappings=[],c=t.__originalMappings=[],f=0,h=i.length;h>f;f++){var d=i[f],m=new a;m.generatedLine=d.generatedLine,m.generatedColumn=d.generatedColumn,d.source&&(m.source=n.indexOf(d.source),m.originalLine=d.originalLine,m.originalColumn=d.originalColumn,d.name&&(m.name=r.indexOf(d.name)),c.push(m)),u.push(m)}return p(t.__originalMappings,s.compareByOriginalPositions),t},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?s.join(this.sourceRoot,e):e},this)}}),o.prototype._parseMappings=function(e,t){for(var r,n,o,i,u,l=1,f=0,h=0,d=0,m=0,g=0,y=e.length,v=0,b={},k={},w=[],S=[];y>v;)if(";"===e.charAt(v))l++,v++,f=0;else if(","===e.charAt(v))v++;else{for(r=new a,r.generatedLine=l,i=v;y>i&&!this._charIsMappingSeparator(e,i);i++);if(n=e.slice(v,i),o=b[n])v+=n.length;else{for(o=[];i>v;)c.decode(e,v,k),u=k.value,v=k.rest,o.push(u);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");b[n]=o}r.generatedColumn=f+o[0],f=r.generatedColumn,o.length>1&&(r.source=m+o[1],m+=o[1],r.originalLine=h+o[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=d+o[3],d=r.originalColumn,o.length>4&&(r.name=g+o[4],g+=o[4])),S.push(r),"number"==typeof r.originalLine&&w.push(r)}p(S,s.compareByGeneratedPositionsDeflated),this.__generatedMappings=S,p(w,s.compareByOriginalPositions),this.__originalMappings=w},o.prototype._findMapping=function(e,t,r,n,o,a){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return u.search(e,t,o,a)},o.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(t.generatedLine===r.generatedLine){t.lastGeneratedColumn=r.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(e){var t={generatedLine:s.getArg(e,"line"),generatedColumn:s.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",s.compareByGeneratedPositionsDeflated,s.getArg(e,"bias",n.GREATEST_LOWER_BOUND));if(r>=0){var o=this._generatedMappings[r];if(o.generatedLine===t.generatedLine){var a=s.getArg(o,"source",null);null!==a&&(a=this._sources.at(a),null!=this.sourceRoot&&(a=s.join(this.sourceRoot,a)));var i=s.getArg(o,"name",null);return null!==i&&(i=this._names.at(i)),{source:a,line:s.getArg(o,"originalLine",null),column:s.getArg(o,"originalColumn",null),name:i}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}):!1},o.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=s.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=s.urlParse(this.sourceRoot))){var n=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(n))return this.sourcesContent[this._sources.indexOf(n)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var t=s.getArg(e,"source");if(null!=this.sourceRoot&&(t=s.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};t=this._sources.indexOf(t);var r={source:t,originalLine:s.getArg(e,"line"),originalColumn:s.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,s.getArg(e,"bias",n.GREATEST_LOWER_BOUND));if(o>=0){var a=this._originalMappings[o];if(a.source===r.source)return{line:s.getArg(a,"generatedLine",null),column:s.getArg(a,"generatedColumn",null),lastColumn:s.getArg(a,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},r.BasicSourceMapConsumer=o,i.prototype=Object.create(n.prototype),i.prototype.constructor=n,i.prototype._version=3,Object.defineProperty(i.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}}),i.prototype.originalPositionFor=function(e){var t={generatedLine:s.getArg(e,"line"),generatedColumn:s.getArg(e,"column")},r=u.search(t,this._sections,function(e,t){var r=e.generatedLine-t.generatedOffset.generatedLine;return r?r:e.generatedColumn-t.generatedOffset.generatedColumn}),n=this._sections[r];return n?n.consumer.originalPositionFor({line:t.generatedLine-(n.generatedOffset.generatedLine-1),column:t.generatedColumn-(n.generatedOffset.generatedLine===t.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},i.prototype.sourceContentFor=function(e,t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r],o=n.consumer.sourceContentFor(e,!0);if(o)return o}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t];if(-1!==r.consumer.sources.indexOf(s.getArg(e,"source"))){var n=r.consumer.generatedPositionFor(e);if(n){var o={line:n.line+(r.generatedOffset.generatedLine-1),column:n.column+(r.generatedOffset.generatedLine===n.line?r.generatedOffset.generatedColumn-1:0)};return o}}}return{line:null,column:null}},i.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var n=this._sections[r],o=n.consumer._generatedMappings,a=0;a<o.length;a++){var i=o[a],u=n.consumer._sources.at(i.source);null!==n.consumer.sourceRoot&&(u=s.join(n.consumer.sourceRoot,u)),this._sources.add(u),u=this._sources.indexOf(u);var l=n.consumer._names.at(i.name);this._names.add(l),l=this._names.indexOf(l);var c={source:u,generatedLine:i.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:i.generatedColumn+(n.generatedOffset.generatedLine===i.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:i.originalLine,originalColumn:i.originalColumn,name:l};this.__generatedMappings.push(c),"number"==typeof c.originalLine&&this.__originalMappings.push(c)}p(this.__generatedMappings,s.compareByGeneratedPositionsDeflated),p(this.__originalMappings,s.compareByOriginalPositions)},r.IndexedSourceMapConsumer=i},{"./array-set":48,"./base64-vlq":49,"./binary-search":51,"./quick-sort":53,"./util":57}],55:[function(e,t,r){function n(e){e||(e={}),this._file=a.getArg(e,"file",null),this._sourceRoot=a.getArg(e,"sourceRoot",null),this._skipValidation=a.getArg(e,"skipValidation",!1),this._sources=new i,this._names=new i,this._mappings=new s,this._sourcesContents=null}var o=e("./base64-vlq"),a=e("./util"),i=e("./array-set").ArraySet,s=e("./mapping-list").MappingList;n.prototype._version=3,n.fromSourceMap=function(e){var t=e.sourceRoot,r=new n({file:e.file,sourceRoot:t});return e.eachMapping(function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=a.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)}),e.sources.forEach(function(t){var n=e.sourceContentFor(t);null!=n&&r.setSourceContent(t,n)}),r},n.prototype.addMapping=function(e){var t=a.getArg(e,"generated"),r=a.getArg(e,"original",null),n=a.getArg(e,"source",null),o=a.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,o),null==n||this._sources.has(n)||this._sources.add(n),null==o||this._names.has(o)||this._names.add(o),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:o})},n.prototype.setSourceContent=function(e,t){var r=e;null!=this._sourceRoot&&(r=a.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents={}),this._sourcesContents[a.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[a.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var o=this._sourceRoot;null!=o&&(n=a.relative(o,n));var s=new i,u=new i;this._mappings.unsortedForEach(function(t){if(t.source===n&&null!=t.originalLine){var i=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=i.source&&(t.source=i.source,null!=r&&(t.source=a.join(r,t.source)),null!=o&&(t.source=a.relative(o,t.source)),t.originalLine=i.line,t.originalColumn=i.column,null!=i.name&&(t.name=i.name))}var l=t.source;null==l||s.has(l)||s.add(l);var c=t.name;null==c||u.has(c)||u.add(c)},this),this._sources=s,this._names=u,e.sources.forEach(function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=a.join(r,t)),null!=o&&(t=a.relative(o,t)),this.setSourceContent(t,n))},this)},n.prototype._validateMapping=function(e,t,r,n){if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},n.prototype._serializeMappings=function(){for(var e,t,r,n=0,i=1,s=0,u=0,l=0,c=0,p="",f=this._mappings.toArray(),h=0,d=f.length;d>h;h++){if(e=f[h],e.generatedLine!==i)for(n=0;e.generatedLine!==i;)p+=";",i++;else if(h>0){if(!a.compareByGeneratedPositionsInflated(e,f[h-1]))continue;p+=","}p+=o.encode(e.generatedColumn-n),n=e.generatedColumn,null!=e.source&&(r=this._sources.indexOf(e.source),p+=o.encode(r-c),c=r,p+=o.encode(e.originalLine-1-u),u=e.originalLine-1,p+=o.encode(e.originalColumn-s),s=e.originalColumn,null!=e.name&&(t=this._names.indexOf(e.name),p+=o.encode(t-l),l=t))}return p},n.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=a.relative(t,e));var r=a.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},n.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},r.SourceMapGenerator=n},{"./array-set":48,"./base64-vlq":49,"./mapping-list":52,"./util":57}],56:[function(e,t,r){function n(e,t,r,n,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==o?null:o,this[u]=!0,null!=n&&this.add(n)}var o=e("./source-map-generator").SourceMapGenerator,a=e("./util"),i=/(\r?\n)/,s=10,u="$$$isSourceNode$$$";n.fromStringWithSourceMap=function(e,t,r){function o(e,t){if(null===e||void 0===e.source)s.add(t);else{var o=r?a.join(r,e.source):e.source;s.add(new n(e.originalLine,e.originalColumn,o,t,e.name))}}var s=new n,u=e.split(i),l=function(){var e=u.shift(),t=u.shift()||"";return e+t},c=1,p=0,f=null;return t.eachMapping(function(e){if(null!==f){if(!(c<e.generatedLine)){var t=u[0],r=t.substr(0,e.generatedColumn-p);return u[0]=t.substr(e.generatedColumn-p),p=e.generatedColumn,o(f,r),void(f=e)}o(f,l()),c++,p=0}for(;c<e.generatedLine;)s.add(l()),c++;if(p<e.generatedColumn){var t=u[0];s.add(t.substr(0,e.generatedColumn)),u[0]=t.substr(e.generatedColumn),p=e.generatedColumn}f=e},this),u.length>0&&(f&&o(f,l()),s.add(u.join(""))),t.sources.forEach(function(e){var n=t.sourceContentFor(e);null!=n&&(null!=r&&(e=a.join(r,e)),s.setSourceContent(e,n))}),s},n.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},n.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},n.prototype.walk=function(e){for(var t,r=0,n=this.children.length;n>r;r++)t=this.children[r],t[u]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},n.prototype.join=function(e){var t,r,n=this.children.length;if(n>0){for(t=[],r=0;n-1>r;r++)t.push(this.children[r]),t.push(e);t.push(this.children[r]),this.children=t}return this},n.prototype.replaceRight=function(e,t){var r=this.children[this.children.length-1];return r[u]?r.replaceRight(e,t):"string"==typeof r?this.children[this.children.length-1]=r.replace(e,t):this.children.push("".replace(e,t)),this},n.prototype.setSourceContent=function(e,t){this.sourceContents[a.toSetString(e)]=t},n.prototype.walkSourceContents=function(e){for(var t=0,r=this.children.length;r>t;t++)this.children[t][u]&&this.children[t].walkSourceContents(e);for(var n=Object.keys(this.sourceContents),t=0,r=n.length;r>t;t++)e(a.fromSetString(n[t]),this.sourceContents[n[t]])},n.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e},n.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},r=new o(e),n=!1,a=null,i=null,u=null,l=null;return this.walk(function(e,o){t.code+=e,null!==o.source&&null!==o.line&&null!==o.column?((a!==o.source||i!==o.line||u!==o.column||l!==o.name)&&r.addMapping({source:o.source,original:{line:o.line,column:o.column},generated:{line:t.line,column:t.column},name:o.name}),a=o.source,i=o.line,u=o.column,l=o.name,n=!0):n&&(r.addMapping({
18
+ generated:{line:t.line,column:t.column}}),a=null,n=!1);for(var c=0,p=e.length;p>c;c++)e.charCodeAt(c)===s?(t.line++,t.column=0,c+1===p?(a=null,n=!1):n&&r.addMapping({source:o.source,original:{line:o.line,column:o.column},generated:{line:t.line,column:t.column},name:o.name})):t.column++}),this.walkSourceContents(function(e,t){r.setSourceContent(e,t)}),{code:t.code,map:r}},r.SourceNode=n},{"./source-map-generator":55,"./util":57}],57:[function(e,t,r){function n(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')}function o(e){var t=e.match(m);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function a(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function i(e){var t=e,n=o(e);if(n){if(!n.path)return e;t=n.path}for(var i,s=r.isAbsolute(t),u=t.split(/\/+/),l=0,c=u.length-1;c>=0;c--)i=u[c],"."===i?u.splice(c,1):".."===i?l++:l>0&&(""===i?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return t=u.join("/"),""===t&&(t=s?"/":"."),n?(n.path=t,a(n)):t}function s(e,t){""===e&&(e="."),""===t&&(t=".");var r=o(t),n=o(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),a(r);if(r||t.match(g))return t;if(n&&!n.host&&!n.path)return n.host=t,a(n);var s="/"===t.charAt(0)?t:i(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=s,a(n)):s}function u(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(0>n)return t;if(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}function l(e){return"$"+e}function c(e){return e.substr(1)}function p(e,t,r){var n=e.source-t.source;return 0!==n?n:(n=e.originalLine-t.originalLine,0!==n?n:(n=e.originalColumn-t.originalColumn,0!==n||r?n:(n=e.generatedColumn-t.generatedColumn,0!==n?n:(n=e.generatedLine-t.generatedLine,0!==n?n:e.name-t.name))))}function f(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n?n:(n=e.generatedColumn-t.generatedColumn,0!==n||r?n:(n=e.source-t.source,0!==n?n:(n=e.originalLine-t.originalLine,0!==n?n:(n=e.originalColumn-t.originalColumn,0!==n?n:e.name-t.name))))}function h(e,t){return e===t?0:e>t?1:-1}function d(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r?r:(r=e.generatedColumn-t.generatedColumn,0!==r?r:(r=h(e.source,t.source),0!==r?r:(r=e.originalLine-t.originalLine,0!==r?r:(r=e.originalColumn-t.originalColumn,0!==r?r:h(e.name,t.name)))))}r.getArg=n;var m=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,g=/^data:.+\,.+$/;r.urlParse=o,r.urlGenerate=a,r.normalize=i,r.join=s,r.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(m)},r.relative=u,r.toSetString=l,r.fromSetString=c,r.compareByOriginalPositions=p,r.compareByGeneratedPositionsDeflated=f,r.compareByGeneratedPositionsInflated=d},{}],58:[function(e,t,r){r.SourceMapGenerator=e("./lib/source-map-generator").SourceMapGenerator,r.SourceMapConsumer=e("./lib/source-map-consumer").SourceMapConsumer,r.SourceNode=e("./lib/source-node").SourceNode},{"./lib/source-map-consumer":54,"./lib/source-map-generator":55,"./lib/source-node":56}],59:[function(e,t,r){t.exports={name:"csso",version:"1.7.0",description:"CSSO (CSS Optimizer) is a CSS minifier with structural optimisations",keywords:["css","minifier","minify","compress","optimisation"],homepage:"https://github.com/css/csso",author:"Sergey Kryzhanovsky <skryzhanovsky@ya.ru> (https://github.com/afelix)",maintainers:[{name:"Roman Dvornov",email:"rdvornov@gmail.com","github-username":"lahmatiy"}],license:"MIT",repository:"css/csso",bugs:{url:"https://github.com/css/csso/issues"},bin:{csso:"./bin/csso"},main:"./lib/index",eslintConfig:{env:{node:!0,mocha:!0,es6:!0},rules:{"no-undef":2,"no-unused-vars":[2,{vars:"all",args:"after-used"}]}},scripts:{test:"jscs lib && eslint lib test && mocha --reporter dot",hydrogen:"node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm --trace_hydrogen_file=code.cfg --print-opt-code bin/csso --stat -o /dev/null",coverage:"istanbul cover _mocha -- -R dot",coveralls:"istanbul cover _mocha --report lcovonly -- -R dot && cat ./coverage/lcov.info | coveralls",travis:"npm run test && npm run coveralls",browserify:"browserify --standalone csso lib/index.js | uglifyjs --compress --mangle -o dist/csso-browser.js","gh-pages":'git clone -b gh-pages https://github.com/css/csso.git .gh-pages && npm run browserify && cp dist/csso-browser.js .gh-pages/ && cd .gh-pages && git commit -am "update" && git push && cd .. && rm -rf .gh-pages',prepublish:"npm run browserify"},dependencies:{clap:"^1.0.9","source-map":"^0.5.3"},devDependencies:{browserify:"^13.0.0",coveralls:"^2.11.6",eslint:"^2.2.0",istanbul:"^0.4.2",jscs:"~2.10.0",mocha:"~2.4.2","uglify-js":"^2.6.1"},engines:{node:">=0.10.0"},files:["bin","dist/csso-browser.js","lib","HISTORY.md","LICENSE","README.md"]}},{}]},{},[39])(39)});
18
19
 
19
- do_compression = function(css, disable_structural){
20
+ do_compression = function(css, structural){
20
21
  return csso.minify(css, {
21
- restructuring: !disable_structural
22
+ restructure: structural
22
23
  });
23
24
  };
25
+
26
+ do_compression_with_map = function(css, filename, structural){
27
+ var result = csso.minify(css, {
28
+ restructure: structural,
29
+ filename: filename,
30
+ sourceMap: true
31
+ });
32
+ return [result.css, result.map.toString()];
33
+ };
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csso-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasily Fedoseyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-13 00:00:00.000000000 Z
11
+ date: 2016-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs
@@ -104,6 +104,9 @@ files:
104
104
  - spec/csso/csso_spec.rb
105
105
  - spec/csso/sprockets_integration_spec.rb
106
106
  - spec/fixtures/test.css
107
+ - spec/fixtures/test2.css
108
+ - spec/fixtures/test3.scss
109
+ - spec/fixtures/test4.scss
107
110
  - vendor/csso/csso.js
108
111
  homepage: https://github.com/Vasfed/csso-rails
109
112
  licenses:
@@ -133,3 +136,6 @@ test_files:
133
136
  - spec/csso/csso_spec.rb
134
137
  - spec/csso/sprockets_integration_spec.rb
135
138
  - spec/fixtures/test.css
139
+ - spec/fixtures/test2.css
140
+ - spec/fixtures/test3.scss
141
+ - spec/fixtures/test4.scss