@angular/platform-server 16.0.0-next.5 → 16.0.0-next.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.0.0-next.5
2
+ * @license Angular v16.0.0-next.6
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -897,6 +897,13 @@ var require_Node = __commonJS({
897
897
  set: function(v) {
898
898
  }
899
899
  },
900
+ innerText: {
901
+ get: function() {
902
+ return null;
903
+ },
904
+ set: function(v) {
905
+ }
906
+ },
900
907
  _countChildrenOfType: { value: function(type) {
901
908
  var sum = 0;
902
909
  for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) {
@@ -2924,6 +2931,19 @@ var require_Element = __commonJS({
2924
2931
  }
2925
2932
  }
2926
2933
  },
2934
+ innerText: {
2935
+ get: function() {
2936
+ var strings = [];
2937
+ recursiveGetText(this, strings);
2938
+ return strings.join("").replace(/[ \t\n\f\r]+/g, " ").trim();
2939
+ },
2940
+ set: function(newtext) {
2941
+ this.removeChildren();
2942
+ if (newtext !== null && newtext !== void 0 && newtext !== "") {
2943
+ this._appendChild(this.ownerDocument.createTextNode(newtext));
2944
+ }
2945
+ }
2946
+ },
2927
2947
  innerHTML: {
2928
2948
  get: function() {
2929
2949
  return this.serialize();
@@ -3627,6 +3647,17 @@ var require_Element = __commonJS({
3627
3647
  }
3628
3648
  this.value = v;
3629
3649
  }
3650
+ },
3651
+ innerText: {
3652
+ get: function() {
3653
+ return this.value;
3654
+ },
3655
+ set: function(v) {
3656
+ if (v === null || v === void 0) {
3657
+ v = "";
3658
+ }
3659
+ this.value = v;
3660
+ }
3630
3661
  }
3631
3662
  });
3632
3663
  Element._Attr = Attr;
@@ -3894,6 +3925,7 @@ var require_Text = __commonJS({
3894
3925
  nodeName: { value: "#text" },
3895
3926
  nodeValue,
3896
3927
  textContent: nodeValue,
3928
+ innerText: nodeValue,
3897
3929
  data: {
3898
3930
  get: nodeValue.get,
3899
3931
  set: function(v) {
@@ -3960,6 +3992,7 @@ var require_Comment = __commonJS({
3960
3992
  nodeName: { value: "#comment" },
3961
3993
  nodeValue,
3962
3994
  textContent: nodeValue,
3995
+ innerText: nodeValue,
3963
3996
  data: {
3964
3997
  get: nodeValue.get,
3965
3998
  set: function(v) {
@@ -3999,6 +4032,7 @@ var require_DocumentFragment = __commonJS({
3999
4032
  }
4000
4033
  },
4001
4034
  textContent: Object.getOwnPropertyDescriptor(Element.prototype, "textContent"),
4035
+ innerText: Object.getOwnPropertyDescriptor(Element.prototype, "innerText"),
4002
4036
  querySelector: { value: function(selector) {
4003
4037
  var nodes = this.querySelectorAll(selector);
4004
4038
  return nodes.length ? nodes[0] : null;
@@ -4068,6 +4102,7 @@ var require_ProcessingInstruction = __commonJS({
4068
4102
  } },
4069
4103
  nodeValue,
4070
4104
  textContent: nodeValue,
4105
+ innerText: nodeValue,
4071
4106
  data: {
4072
4107
  get: nodeValue.get,
4073
4108
  set: function(v) {
@@ -4619,3766 +4654,213 @@ var require_URL = __commonJS({
4619
4654
  if (this.scheme !== void 0)
4620
4655
  s += this.scheme + ":";
4621
4656
  if (this.isAbsolute()) {
4622
- s += "//";
4623
- if (this.username || this.password) {
4624
- s += this.username || "";
4625
- if (this.password) {
4626
- s += ":" + this.password;
4627
- }
4628
- s += "@";
4629
- }
4630
- if (this.host) {
4631
- s += this.host;
4632
- }
4633
- }
4634
- if (this.port !== void 0)
4635
- s += ":" + this.port;
4636
- if (this.path !== void 0)
4637
- s += this.path;
4638
- if (this.query !== void 0)
4639
- s += "?" + this.query;
4640
- if (this.fragment !== void 0)
4641
- s += "#" + this.fragment;
4642
- return s;
4643
- },
4644
- resolve: function(relative) {
4645
- var base = this;
4646
- var r = new URL(relative);
4647
- var t = new URL();
4648
- if (r.scheme !== void 0) {
4649
- t.scheme = r.scheme;
4650
- t.username = r.username;
4651
- t.password = r.password;
4652
- t.host = r.host;
4653
- t.port = r.port;
4654
- t.path = remove_dot_segments(r.path);
4655
- t.query = r.query;
4656
- } else {
4657
- t.scheme = base.scheme;
4658
- if (r.host !== void 0) {
4659
- t.username = r.username;
4660
- t.password = r.password;
4661
- t.host = r.host;
4662
- t.port = r.port;
4663
- t.path = remove_dot_segments(r.path);
4664
- t.query = r.query;
4665
- } else {
4666
- t.username = base.username;
4667
- t.password = base.password;
4668
- t.host = base.host;
4669
- t.port = base.port;
4670
- if (!r.path) {
4671
- t.path = base.path;
4672
- if (r.query !== void 0)
4673
- t.query = r.query;
4674
- else
4675
- t.query = base.query;
4676
- } else {
4677
- if (r.path.charAt(0) === "/") {
4678
- t.path = remove_dot_segments(r.path);
4679
- } else {
4680
- t.path = merge(base.path, r.path);
4681
- t.path = remove_dot_segments(t.path);
4682
- }
4683
- t.query = r.query;
4684
- }
4685
- }
4686
- }
4687
- t.fragment = r.fragment;
4688
- return t.toString();
4689
- function merge(basepath, refpath) {
4690
- if (base.host !== void 0 && !base.path)
4691
- return "/" + refpath;
4692
- var lastslash = basepath.lastIndexOf("/");
4693
- if (lastslash === -1)
4694
- return refpath;
4695
- else
4696
- return basepath.substring(0, lastslash + 1) + refpath;
4697
- }
4698
- function remove_dot_segments(path) {
4699
- if (!path)
4700
- return path;
4701
- var output = "";
4702
- while (path.length > 0) {
4703
- if (path === "." || path === "..") {
4704
- path = "";
4705
- break;
4706
- }
4707
- var twochars = path.substring(0, 2);
4708
- var threechars = path.substring(0, 3);
4709
- var fourchars = path.substring(0, 4);
4710
- if (threechars === "../") {
4711
- path = path.substring(3);
4712
- } else if (twochars === "./") {
4713
- path = path.substring(2);
4714
- } else if (threechars === "/./") {
4715
- path = "/" + path.substring(3);
4716
- } else if (twochars === "/." && path.length === 2) {
4717
- path = "/";
4718
- } else if (fourchars === "/../" || threechars === "/.." && path.length === 3) {
4719
- path = "/" + path.substring(4);
4720
- output = output.replace(/\/?[^\/]*$/, "");
4721
- } else {
4722
- var segment = path.match(/(\/?([^\/]*))/)[0];
4723
- output += segment;
4724
- path = path.substring(segment.length);
4725
- }
4726
- }
4727
- return output;
4728
- }
4729
- }
4730
- };
4731
- }
4732
- });
4733
-
4734
- // external/npm/node_modules/domino/lib/CustomEvent.js
4735
- var require_CustomEvent = __commonJS({
4736
- "external/npm/node_modules/domino/lib/CustomEvent.js"(exports, module) {
4737
- "use strict";
4738
- module.exports = CustomEvent;
4739
- var Event = require_Event();
4740
- function CustomEvent(type, dictionary) {
4741
- Event.call(this, type, dictionary);
4742
- }
4743
- CustomEvent.prototype = Object.create(Event.prototype, {
4744
- constructor: { value: CustomEvent }
4745
- });
4746
- }
4747
- });
4748
-
4749
- // external/npm/node_modules/domino/lib/events.js
4750
- var require_events = __commonJS({
4751
- "external/npm/node_modules/domino/lib/events.js"(exports, module) {
4752
- "use strict";
4753
- module.exports = {
4754
- Event: require_Event(),
4755
- UIEvent: require_UIEvent(),
4756
- MouseEvent: require_MouseEvent(),
4757
- CustomEvent: require_CustomEvent()
4758
- };
4759
- }
4760
- });
4761
-
4762
- // external/npm/node_modules/domino/lib/cssparser.js
4763
- var require_cssparser = __commonJS({
4764
- "external/npm/node_modules/domino/lib/cssparser.js"(exports) {
4765
- "use strict";
4766
- var parserlib = /* @__PURE__ */ Object.create(null);
4767
- (function() {
4768
- function EventTarget() {
4769
- this._listeners = /* @__PURE__ */ Object.create(null);
4770
- }
4771
- EventTarget.prototype = {
4772
- constructor: EventTarget,
4773
- addListener: function(type, listener) {
4774
- if (!this._listeners[type]) {
4775
- this._listeners[type] = [];
4776
- }
4777
- this._listeners[type].push(listener);
4778
- },
4779
- fire: function(event) {
4780
- if (typeof event === "string") {
4781
- event = { type: event };
4782
- }
4783
- if (typeof event.target !== "undefined") {
4784
- event.target = this;
4785
- }
4786
- if (typeof event.type === "undefined") {
4787
- throw new Error("Event object missing 'type' property.");
4788
- }
4789
- if (this._listeners[event.type]) {
4790
- var listeners = this._listeners[event.type].concat();
4791
- for (var i = 0, len = listeners.length; i < len; i++) {
4792
- listeners[i].call(this, event);
4793
- }
4794
- }
4795
- },
4796
- removeListener: function(type, listener) {
4797
- if (this._listeners[type]) {
4798
- var listeners = this._listeners[type];
4799
- for (var i = 0, len = listeners.length; i < len; i++) {
4800
- if (listeners[i] === listener) {
4801
- listeners.splice(i, 1);
4802
- break;
4803
- }
4804
- }
4805
- }
4806
- }
4807
- };
4808
- function StringReader(text) {
4809
- this._input = text.replace(/(\r|\n){1,2}/g, "\n");
4810
- this._line = 1;
4811
- this._col = 1;
4812
- this._cursor = 0;
4813
- }
4814
- StringReader.prototype = {
4815
- constructor: StringReader,
4816
- getCol: function() {
4817
- return this._col;
4818
- },
4819
- getLine: function() {
4820
- return this._line;
4821
- },
4822
- eof: function() {
4823
- return this._cursor === this._input.length;
4824
- },
4825
- peek: function(count) {
4826
- var c = null;
4827
- count = typeof count === "undefined" ? 1 : count;
4828
- if (this._cursor < this._input.length) {
4829
- c = this._input.charAt(this._cursor + count - 1);
4830
- }
4831
- return c;
4832
- },
4833
- read: function() {
4834
- var c = null;
4835
- if (this._cursor < this._input.length) {
4836
- if (this._input.charAt(this._cursor) === "\n") {
4837
- this._line++;
4838
- this._col = 1;
4839
- } else {
4840
- this._col++;
4841
- }
4842
- c = this._input.charAt(this._cursor++);
4843
- }
4844
- return c;
4845
- },
4846
- mark: function() {
4847
- this._bookmark = {
4848
- cursor: this._cursor,
4849
- line: this._line,
4850
- col: this._col
4851
- };
4852
- },
4853
- reset: function() {
4854
- if (this._bookmark) {
4855
- this._cursor = this._bookmark.cursor;
4856
- this._line = this._bookmark.line;
4857
- this._col = this._bookmark.col;
4858
- delete this._bookmark;
4859
- }
4860
- },
4861
- readTo: function(pattern) {
4862
- var buffer = "", c;
4863
- while (buffer.length < pattern.length || buffer.lastIndexOf(pattern) !== buffer.length - pattern.length) {
4864
- c = this.read();
4865
- if (c) {
4866
- buffer += c;
4867
- } else {
4868
- throw new Error('Expected "' + pattern + '" at line ' + this._line + ", col " + this._col + ".");
4869
- }
4870
- }
4871
- return buffer;
4872
- },
4873
- readWhile: function(filter) {
4874
- var buffer = "", c = this.read();
4875
- while (c !== null && filter(c)) {
4876
- buffer += c;
4877
- c = this.read();
4878
- }
4879
- return buffer;
4880
- },
4881
- readMatch: function(matcher) {
4882
- var source = this._input.substring(this._cursor), value = null;
4883
- if (typeof matcher === "string") {
4884
- if (source.indexOf(matcher) === 0) {
4885
- value = this.readCount(matcher.length);
4886
- }
4887
- } else if (matcher instanceof RegExp) {
4888
- if (matcher.test(source)) {
4889
- value = this.readCount(RegExp.lastMatch.length);
4890
- }
4891
- }
4892
- return value;
4893
- },
4894
- readCount: function(count) {
4895
- var buffer = "";
4896
- while (count--) {
4897
- buffer += this.read();
4898
- }
4899
- return buffer;
4900
- }
4901
- };
4902
- function SyntaxError2(message, line, col) {
4903
- Error.call(this);
4904
- this.name = this.constructor.name;
4905
- this.col = col;
4906
- this.line = line;
4907
- this.message = message;
4908
- }
4909
- SyntaxError2.prototype = Object.create(Error.prototype);
4910
- SyntaxError2.prototype.constructor = SyntaxError2;
4911
- function SyntaxUnit(text, line, col, type) {
4912
- this.col = col;
4913
- this.line = line;
4914
- this.text = text;
4915
- this.type = type;
4916
- }
4917
- SyntaxUnit.fromToken = function(token) {
4918
- return new SyntaxUnit(token.value, token.startLine, token.startCol);
4919
- };
4920
- SyntaxUnit.prototype = {
4921
- constructor: SyntaxUnit,
4922
- valueOf: function() {
4923
- return this.toString();
4924
- },
4925
- toString: function() {
4926
- return this.text;
4927
- }
4928
- };
4929
- function TokenStreamBase(input, tokenData) {
4930
- this._reader = input ? new StringReader(input.toString()) : null;
4931
- this._token = null;
4932
- this._tokenData = tokenData;
4933
- this._lt = [];
4934
- this._ltIndex = 0;
4935
- this._ltIndexCache = [];
4936
- }
4937
- TokenStreamBase.createTokenData = function(tokens) {
4938
- var nameMap = [], typeMap = /* @__PURE__ */ Object.create(null), tokenData = tokens.concat([]), i = 0, len = tokenData.length + 1;
4939
- tokenData.UNKNOWN = -1;
4940
- tokenData.unshift({ name: "EOF" });
4941
- for (; i < len; i++) {
4942
- nameMap.push(tokenData[i].name);
4943
- tokenData[tokenData[i].name] = i;
4944
- if (tokenData[i].text) {
4945
- typeMap[tokenData[i].text] = i;
4946
- }
4947
- }
4948
- tokenData.name = function(tt) {
4949
- return nameMap[tt];
4950
- };
4951
- tokenData.type = function(c) {
4952
- return typeMap[c];
4953
- };
4954
- return tokenData;
4955
- };
4956
- TokenStreamBase.prototype = {
4957
- constructor: TokenStreamBase,
4958
- match: function(tokenTypes, channel) {
4959
- if (!(tokenTypes instanceof Array)) {
4960
- tokenTypes = [tokenTypes];
4961
- }
4962
- var tt = this.get(channel), i = 0, len = tokenTypes.length;
4963
- while (i < len) {
4964
- if (tt === tokenTypes[i++]) {
4965
- return true;
4966
- }
4967
- }
4968
- this.unget();
4969
- return false;
4970
- },
4971
- mustMatch: function(tokenTypes, channel) {
4972
- var token;
4973
- if (!(tokenTypes instanceof Array)) {
4974
- tokenTypes = [tokenTypes];
4975
- }
4976
- if (!this.match.apply(this, arguments)) {
4977
- token = this.LT(1);
4978
- throw new SyntaxError2("Expected " + this._tokenData[tokenTypes[0]].name + " at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol);
4979
- }
4980
- },
4981
- advance: function(tokenTypes, channel) {
4982
- while (this.LA(0) !== 0 && !this.match(tokenTypes, channel)) {
4983
- this.get();
4984
- }
4985
- return this.LA(0);
4986
- },
4987
- get: function(channel) {
4988
- var tokenInfo = this._tokenData, i = 0, token, info;
4989
- if (this._lt.length && this._ltIndex >= 0 && this._ltIndex < this._lt.length) {
4990
- i++;
4991
- this._token = this._lt[this._ltIndex++];
4992
- info = tokenInfo[this._token.type];
4993
- while (info.channel !== void 0 && channel !== info.channel && this._ltIndex < this._lt.length) {
4994
- this._token = this._lt[this._ltIndex++];
4995
- info = tokenInfo[this._token.type];
4996
- i++;
4997
- }
4998
- if ((info.channel === void 0 || channel === info.channel) && this._ltIndex <= this._lt.length) {
4999
- this._ltIndexCache.push(i);
5000
- return this._token.type;
5001
- }
5002
- }
5003
- token = this._getToken();
5004
- if (token.type > -1 && !tokenInfo[token.type].hide) {
5005
- token.channel = tokenInfo[token.type].channel;
5006
- this._token = token;
5007
- this._lt.push(token);
5008
- this._ltIndexCache.push(this._lt.length - this._ltIndex + i);
5009
- if (this._lt.length > 5) {
5010
- this._lt.shift();
5011
- }
5012
- if (this._ltIndexCache.length > 5) {
5013
- this._ltIndexCache.shift();
5014
- }
5015
- this._ltIndex = this._lt.length;
5016
- }
5017
- info = tokenInfo[token.type];
5018
- if (info && (info.hide || info.channel !== void 0 && channel !== info.channel)) {
5019
- return this.get(channel);
5020
- } else {
5021
- return token.type;
5022
- }
5023
- },
5024
- LA: function(index) {
5025
- var total = index, tt;
5026
- if (index > 0) {
5027
- if (index > 5) {
5028
- throw new Error("Too much lookahead.");
5029
- }
5030
- while (total) {
5031
- tt = this.get();
5032
- total--;
5033
- }
5034
- while (total < index) {
5035
- this.unget();
5036
- total++;
5037
- }
5038
- } else if (index < 0) {
5039
- if (this._lt[this._ltIndex + index]) {
5040
- tt = this._lt[this._ltIndex + index].type;
5041
- } else {
5042
- throw new Error("Too much lookbehind.");
5043
- }
5044
- } else {
5045
- tt = this._token.type;
5046
- }
5047
- return tt;
5048
- },
5049
- LT: function(index) {
5050
- this.LA(index);
5051
- return this._lt[this._ltIndex + index - 1];
5052
- },
5053
- peek: function() {
5054
- return this.LA(1);
5055
- },
5056
- token: function() {
5057
- return this._token;
5058
- },
5059
- tokenName: function(tokenType) {
5060
- if (tokenType < 0 || tokenType > this._tokenData.length) {
5061
- return "UNKNOWN_TOKEN";
5062
- } else {
5063
- return this._tokenData[tokenType].name;
5064
- }
5065
- },
5066
- tokenType: function(tokenName) {
5067
- return this._tokenData[tokenName] || -1;
5068
- },
5069
- unget: function() {
5070
- if (this._ltIndexCache.length) {
5071
- this._ltIndex -= this._ltIndexCache.pop();
5072
- this._token = this._lt[this._ltIndex - 1];
5073
- } else {
5074
- throw new Error("Too much lookahead.");
5075
- }
5076
- }
5077
- };
5078
- parserlib.util = {
5079
- __proto__: null,
5080
- StringReader,
5081
- SyntaxError: SyntaxError2,
5082
- SyntaxUnit,
5083
- EventTarget,
5084
- TokenStreamBase
5085
- };
5086
- })();
5087
- (function() {
5088
- var EventTarget = parserlib.util.EventTarget, TokenStreamBase = parserlib.util.TokenStreamBase, StringReader = parserlib.util.StringReader, SyntaxError2 = parserlib.util.SyntaxError, SyntaxUnit = parserlib.util.SyntaxUnit;
5089
- var Colors = {
5090
- __proto__: null,
5091
- aliceblue: "#f0f8ff",
5092
- antiquewhite: "#faebd7",
5093
- aqua: "#00ffff",
5094
- aquamarine: "#7fffd4",
5095
- azure: "#f0ffff",
5096
- beige: "#f5f5dc",
5097
- bisque: "#ffe4c4",
5098
- black: "#000000",
5099
- blanchedalmond: "#ffebcd",
5100
- blue: "#0000ff",
5101
- blueviolet: "#8a2be2",
5102
- brown: "#a52a2a",
5103
- burlywood: "#deb887",
5104
- cadetblue: "#5f9ea0",
5105
- chartreuse: "#7fff00",
5106
- chocolate: "#d2691e",
5107
- coral: "#ff7f50",
5108
- cornflowerblue: "#6495ed",
5109
- cornsilk: "#fff8dc",
5110
- crimson: "#dc143c",
5111
- cyan: "#00ffff",
5112
- darkblue: "#00008b",
5113
- darkcyan: "#008b8b",
5114
- darkgoldenrod: "#b8860b",
5115
- darkgray: "#a9a9a9",
5116
- darkgrey: "#a9a9a9",
5117
- darkgreen: "#006400",
5118
- darkkhaki: "#bdb76b",
5119
- darkmagenta: "#8b008b",
5120
- darkolivegreen: "#556b2f",
5121
- darkorange: "#ff8c00",
5122
- darkorchid: "#9932cc",
5123
- darkred: "#8b0000",
5124
- darksalmon: "#e9967a",
5125
- darkseagreen: "#8fbc8f",
5126
- darkslateblue: "#483d8b",
5127
- darkslategray: "#2f4f4f",
5128
- darkslategrey: "#2f4f4f",
5129
- darkturquoise: "#00ced1",
5130
- darkviolet: "#9400d3",
5131
- deeppink: "#ff1493",
5132
- deepskyblue: "#00bfff",
5133
- dimgray: "#696969",
5134
- dimgrey: "#696969",
5135
- dodgerblue: "#1e90ff",
5136
- firebrick: "#b22222",
5137
- floralwhite: "#fffaf0",
5138
- forestgreen: "#228b22",
5139
- fuchsia: "#ff00ff",
5140
- gainsboro: "#dcdcdc",
5141
- ghostwhite: "#f8f8ff",
5142
- gold: "#ffd700",
5143
- goldenrod: "#daa520",
5144
- gray: "#808080",
5145
- grey: "#808080",
5146
- green: "#008000",
5147
- greenyellow: "#adff2f",
5148
- honeydew: "#f0fff0",
5149
- hotpink: "#ff69b4",
5150
- indianred: "#cd5c5c",
5151
- indigo: "#4b0082",
5152
- ivory: "#fffff0",
5153
- khaki: "#f0e68c",
5154
- lavender: "#e6e6fa",
5155
- lavenderblush: "#fff0f5",
5156
- lawngreen: "#7cfc00",
5157
- lemonchiffon: "#fffacd",
5158
- lightblue: "#add8e6",
5159
- lightcoral: "#f08080",
5160
- lightcyan: "#e0ffff",
5161
- lightgoldenrodyellow: "#fafad2",
5162
- lightgray: "#d3d3d3",
5163
- lightgrey: "#d3d3d3",
5164
- lightgreen: "#90ee90",
5165
- lightpink: "#ffb6c1",
5166
- lightsalmon: "#ffa07a",
5167
- lightseagreen: "#20b2aa",
5168
- lightskyblue: "#87cefa",
5169
- lightslategray: "#778899",
5170
- lightslategrey: "#778899",
5171
- lightsteelblue: "#b0c4de",
5172
- lightyellow: "#ffffe0",
5173
- lime: "#00ff00",
5174
- limegreen: "#32cd32",
5175
- linen: "#faf0e6",
5176
- magenta: "#ff00ff",
5177
- maroon: "#800000",
5178
- mediumaquamarine: "#66cdaa",
5179
- mediumblue: "#0000cd",
5180
- mediumorchid: "#ba55d3",
5181
- mediumpurple: "#9370d8",
5182
- mediumseagreen: "#3cb371",
5183
- mediumslateblue: "#7b68ee",
5184
- mediumspringgreen: "#00fa9a",
5185
- mediumturquoise: "#48d1cc",
5186
- mediumvioletred: "#c71585",
5187
- midnightblue: "#191970",
5188
- mintcream: "#f5fffa",
5189
- mistyrose: "#ffe4e1",
5190
- moccasin: "#ffe4b5",
5191
- navajowhite: "#ffdead",
5192
- navy: "#000080",
5193
- oldlace: "#fdf5e6",
5194
- olive: "#808000",
5195
- olivedrab: "#6b8e23",
5196
- orange: "#ffa500",
5197
- orangered: "#ff4500",
5198
- orchid: "#da70d6",
5199
- palegoldenrod: "#eee8aa",
5200
- palegreen: "#98fb98",
5201
- paleturquoise: "#afeeee",
5202
- palevioletred: "#d87093",
5203
- papayawhip: "#ffefd5",
5204
- peachpuff: "#ffdab9",
5205
- peru: "#cd853f",
5206
- pink: "#ffc0cb",
5207
- plum: "#dda0dd",
5208
- powderblue: "#b0e0e6",
5209
- purple: "#800080",
5210
- red: "#ff0000",
5211
- rosybrown: "#bc8f8f",
5212
- royalblue: "#4169e1",
5213
- saddlebrown: "#8b4513",
5214
- salmon: "#fa8072",
5215
- sandybrown: "#f4a460",
5216
- seagreen: "#2e8b57",
5217
- seashell: "#fff5ee",
5218
- sienna: "#a0522d",
5219
- silver: "#c0c0c0",
5220
- skyblue: "#87ceeb",
5221
- slateblue: "#6a5acd",
5222
- slategray: "#708090",
5223
- slategrey: "#708090",
5224
- snow: "#fffafa",
5225
- springgreen: "#00ff7f",
5226
- steelblue: "#4682b4",
5227
- tan: "#d2b48c",
5228
- teal: "#008080",
5229
- thistle: "#d8bfd8",
5230
- tomato: "#ff6347",
5231
- turquoise: "#40e0d0",
5232
- violet: "#ee82ee",
5233
- wheat: "#f5deb3",
5234
- white: "#ffffff",
5235
- whitesmoke: "#f5f5f5",
5236
- yellow: "#ffff00",
5237
- yellowgreen: "#9acd32",
5238
- currentColor: "The value of the 'color' property.",
5239
- activeBorder: "Active window border.",
5240
- activecaption: "Active window caption.",
5241
- appworkspace: "Background color of multiple document interface.",
5242
- background: "Desktop background.",
5243
- buttonface: "The face background color for 3-D elements that appear 3-D due to one layer of surrounding border.",
5244
- buttonhighlight: "The color of the border facing the light source for 3-D elements that appear 3-D due to one layer of surrounding border.",
5245
- buttonshadow: "The color of the border away from the light source for 3-D elements that appear 3-D due to one layer of surrounding border.",
5246
- buttontext: "Text on push buttons.",
5247
- captiontext: "Text in caption, size box, and scrollbar arrow box.",
5248
- graytext: "Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.",
5249
- greytext: "Greyed (disabled) text. This color is set to #000 if the current display driver does not support a solid grey color.",
5250
- highlight: "Item(s) selected in a control.",
5251
- highlighttext: "Text of item(s) selected in a control.",
5252
- inactiveborder: "Inactive window border.",
5253
- inactivecaption: "Inactive window caption.",
5254
- inactivecaptiontext: "Color of text in an inactive caption.",
5255
- infobackground: "Background color for tooltip controls.",
5256
- infotext: "Text color for tooltip controls.",
5257
- menu: "Menu background.",
5258
- menutext: "Text in menus.",
5259
- scrollbar: "Scroll bar gray area.",
5260
- threeddarkshadow: "The color of the darker (generally outer) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
5261
- threedface: "The face background color for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
5262
- threedhighlight: "The color of the lighter (generally outer) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
5263
- threedlightshadow: "The color of the darker (generally inner) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
5264
- threedshadow: "The color of the lighter (generally inner) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
5265
- window: "Window background.",
5266
- windowframe: "Window frame.",
5267
- windowtext: "Text in windows."
5268
- };
5269
- function Combinator(text, line, col) {
5270
- SyntaxUnit.call(this, text, line, col, Parser.COMBINATOR_TYPE);
5271
- this.type = "unknown";
5272
- if (/^\s+$/.test(text)) {
5273
- this.type = "descendant";
5274
- } else if (text === ">") {
5275
- this.type = "child";
5276
- } else if (text === "+") {
5277
- this.type = "adjacent-sibling";
5278
- } else if (text === "~") {
5279
- this.type = "sibling";
5280
- }
5281
- }
5282
- Combinator.prototype = new SyntaxUnit();
5283
- Combinator.prototype.constructor = Combinator;
5284
- function MediaFeature(name, value) {
5285
- SyntaxUnit.call(this, "(" + name + (value !== null ? ":" + value : "") + ")", name.startLine, name.startCol, Parser.MEDIA_FEATURE_TYPE);
5286
- this.name = name;
5287
- this.value = value;
5288
- }
5289
- MediaFeature.prototype = new SyntaxUnit();
5290
- MediaFeature.prototype.constructor = MediaFeature;
5291
- function MediaQuery(modifier, mediaType, features, line, col) {
5292
- SyntaxUnit.call(this, (modifier ? modifier + " " : "") + (mediaType ? mediaType : "") + (mediaType && features.length > 0 ? " and " : "") + features.join(" and "), line, col, Parser.MEDIA_QUERY_TYPE);
5293
- this.modifier = modifier;
5294
- this.mediaType = mediaType;
5295
- this.features = features;
5296
- }
5297
- MediaQuery.prototype = new SyntaxUnit();
5298
- MediaQuery.prototype.constructor = MediaQuery;
5299
- function Parser(options) {
5300
- EventTarget.call(this);
5301
- this.options = options || {};
5302
- this._tokenStream = null;
5303
- }
5304
- Parser.DEFAULT_TYPE = 0;
5305
- Parser.COMBINATOR_TYPE = 1;
5306
- Parser.MEDIA_FEATURE_TYPE = 2;
5307
- Parser.MEDIA_QUERY_TYPE = 3;
5308
- Parser.PROPERTY_NAME_TYPE = 4;
5309
- Parser.PROPERTY_VALUE_TYPE = 5;
5310
- Parser.PROPERTY_VALUE_PART_TYPE = 6;
5311
- Parser.SELECTOR_TYPE = 7;
5312
- Parser.SELECTOR_PART_TYPE = 8;
5313
- Parser.SELECTOR_SUB_PART_TYPE = 9;
5314
- Parser.prototype = function() {
5315
- var proto = new EventTarget(), prop, additions = {
5316
- __proto__: null,
5317
- constructor: Parser,
5318
- DEFAULT_TYPE: 0,
5319
- COMBINATOR_TYPE: 1,
5320
- MEDIA_FEATURE_TYPE: 2,
5321
- MEDIA_QUERY_TYPE: 3,
5322
- PROPERTY_NAME_TYPE: 4,
5323
- PROPERTY_VALUE_TYPE: 5,
5324
- PROPERTY_VALUE_PART_TYPE: 6,
5325
- SELECTOR_TYPE: 7,
5326
- SELECTOR_PART_TYPE: 8,
5327
- SELECTOR_SUB_PART_TYPE: 9,
5328
- _stylesheet: function() {
5329
- var tokenStream = this._tokenStream, count, token, tt;
5330
- this.fire("startstylesheet");
5331
- this._charset();
5332
- this._skipCruft();
5333
- while (tokenStream.peek() === Tokens.IMPORT_SYM) {
5334
- this._import();
5335
- this._skipCruft();
5336
- }
5337
- while (tokenStream.peek() === Tokens.NAMESPACE_SYM) {
5338
- this._namespace();
5339
- this._skipCruft();
5340
- }
5341
- tt = tokenStream.peek();
5342
- while (tt > Tokens.EOF) {
5343
- try {
5344
- switch (tt) {
5345
- case Tokens.MEDIA_SYM:
5346
- this._media();
5347
- this._skipCruft();
5348
- break;
5349
- case Tokens.PAGE_SYM:
5350
- this._page();
5351
- this._skipCruft();
5352
- break;
5353
- case Tokens.FONT_FACE_SYM:
5354
- this._font_face();
5355
- this._skipCruft();
5356
- break;
5357
- case Tokens.KEYFRAMES_SYM:
5358
- this._keyframes();
5359
- this._skipCruft();
5360
- break;
5361
- case Tokens.VIEWPORT_SYM:
5362
- this._viewport();
5363
- this._skipCruft();
5364
- break;
5365
- case Tokens.DOCUMENT_SYM:
5366
- this._document();
5367
- this._skipCruft();
5368
- break;
5369
- case Tokens.UNKNOWN_SYM:
5370
- tokenStream.get();
5371
- if (!this.options.strict) {
5372
- this.fire({
5373
- type: "error",
5374
- error: null,
5375
- message: "Unknown @ rule: " + tokenStream.LT(0).value + ".",
5376
- line: tokenStream.LT(0).startLine,
5377
- col: tokenStream.LT(0).startCol
5378
- });
5379
- count = 0;
5380
- while (tokenStream.advance([Tokens.LBRACE, Tokens.RBRACE]) === Tokens.LBRACE) {
5381
- count++;
5382
- }
5383
- while (count) {
5384
- tokenStream.advance([Tokens.RBRACE]);
5385
- count--;
5386
- }
5387
- } else {
5388
- throw new SyntaxError2("Unknown @ rule.", tokenStream.LT(0).startLine, tokenStream.LT(0).startCol);
5389
- }
5390
- break;
5391
- case Tokens.S:
5392
- this._readWhitespace();
5393
- break;
5394
- default:
5395
- if (!this._ruleset()) {
5396
- switch (tt) {
5397
- case Tokens.CHARSET_SYM:
5398
- token = tokenStream.LT(1);
5399
- this._charset(false);
5400
- throw new SyntaxError2("@charset not allowed here.", token.startLine, token.startCol);
5401
- case Tokens.IMPORT_SYM:
5402
- token = tokenStream.LT(1);
5403
- this._import(false);
5404
- throw new SyntaxError2("@import not allowed here.", token.startLine, token.startCol);
5405
- case Tokens.NAMESPACE_SYM:
5406
- token = tokenStream.LT(1);
5407
- this._namespace(false);
5408
- throw new SyntaxError2("@namespace not allowed here.", token.startLine, token.startCol);
5409
- default:
5410
- tokenStream.get();
5411
- this._unexpectedToken(tokenStream.token());
5412
- }
5413
- }
5414
- }
5415
- } catch (ex) {
5416
- if (ex instanceof SyntaxError2 && !this.options.strict) {
5417
- this.fire({
5418
- type: "error",
5419
- error: ex,
5420
- message: ex.message,
5421
- line: ex.line,
5422
- col: ex.col
5423
- });
5424
- } else {
5425
- throw ex;
5426
- }
5427
- }
5428
- tt = tokenStream.peek();
5429
- }
5430
- if (tt !== Tokens.EOF) {
5431
- this._unexpectedToken(tokenStream.token());
5432
- }
5433
- this.fire("endstylesheet");
5434
- },
5435
- _charset: function(emit) {
5436
- var tokenStream = this._tokenStream, charset, token, line, col;
5437
- if (tokenStream.match(Tokens.CHARSET_SYM)) {
5438
- line = tokenStream.token().startLine;
5439
- col = tokenStream.token().startCol;
5440
- this._readWhitespace();
5441
- tokenStream.mustMatch(Tokens.STRING);
5442
- token = tokenStream.token();
5443
- charset = token.value;
5444
- this._readWhitespace();
5445
- tokenStream.mustMatch(Tokens.SEMICOLON);
5446
- if (emit !== false) {
5447
- this.fire({
5448
- type: "charset",
5449
- charset,
5450
- line,
5451
- col
5452
- });
5453
- }
5454
- }
5455
- },
5456
- _import: function(emit) {
5457
- var tokenStream = this._tokenStream, uri, importToken, mediaList = [];
5458
- tokenStream.mustMatch(Tokens.IMPORT_SYM);
5459
- importToken = tokenStream.token();
5460
- this._readWhitespace();
5461
- tokenStream.mustMatch([Tokens.STRING, Tokens.URI]);
5462
- uri = tokenStream.token().value.replace(/^(?:url\()?["']?([^"']+?)["']?\)?$/, "$1");
5463
- this._readWhitespace();
5464
- mediaList = this._media_query_list();
5465
- tokenStream.mustMatch(Tokens.SEMICOLON);
5466
- this._readWhitespace();
5467
- if (emit !== false) {
5468
- this.fire({
5469
- type: "import",
5470
- uri,
5471
- media: mediaList,
5472
- line: importToken.startLine,
5473
- col: importToken.startCol
5474
- });
5475
- }
5476
- },
5477
- _namespace: function(emit) {
5478
- var tokenStream = this._tokenStream, line, col, prefix, uri;
5479
- tokenStream.mustMatch(Tokens.NAMESPACE_SYM);
5480
- line = tokenStream.token().startLine;
5481
- col = tokenStream.token().startCol;
5482
- this._readWhitespace();
5483
- if (tokenStream.match(Tokens.IDENT)) {
5484
- prefix = tokenStream.token().value;
5485
- this._readWhitespace();
5486
- }
5487
- tokenStream.mustMatch([Tokens.STRING, Tokens.URI]);
5488
- uri = tokenStream.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/, "$1");
5489
- this._readWhitespace();
5490
- tokenStream.mustMatch(Tokens.SEMICOLON);
5491
- this._readWhitespace();
5492
- if (emit !== false) {
5493
- this.fire({
5494
- type: "namespace",
5495
- prefix,
5496
- uri,
5497
- line,
5498
- col
5499
- });
5500
- }
5501
- },
5502
- _media: function() {
5503
- var tokenStream = this._tokenStream, line, col, mediaList;
5504
- tokenStream.mustMatch(Tokens.MEDIA_SYM);
5505
- line = tokenStream.token().startLine;
5506
- col = tokenStream.token().startCol;
5507
- this._readWhitespace();
5508
- mediaList = this._media_query_list();
5509
- tokenStream.mustMatch(Tokens.LBRACE);
5510
- this._readWhitespace();
5511
- this.fire({
5512
- type: "startmedia",
5513
- media: mediaList,
5514
- line,
5515
- col
5516
- });
5517
- while (true) {
5518
- if (tokenStream.peek() === Tokens.PAGE_SYM) {
5519
- this._page();
5520
- } else if (tokenStream.peek() === Tokens.FONT_FACE_SYM) {
5521
- this._font_face();
5522
- } else if (tokenStream.peek() === Tokens.VIEWPORT_SYM) {
5523
- this._viewport();
5524
- } else if (tokenStream.peek() === Tokens.DOCUMENT_SYM) {
5525
- this._document();
5526
- } else if (!this._ruleset()) {
5527
- break;
5528
- }
5529
- }
5530
- tokenStream.mustMatch(Tokens.RBRACE);
5531
- this._readWhitespace();
5532
- this.fire({
5533
- type: "endmedia",
5534
- media: mediaList,
5535
- line,
5536
- col
5537
- });
5538
- },
5539
- _media_query_list: function() {
5540
- var tokenStream = this._tokenStream, mediaList = [];
5541
- this._readWhitespace();
5542
- if (tokenStream.peek() === Tokens.IDENT || tokenStream.peek() === Tokens.LPAREN) {
5543
- mediaList.push(this._media_query());
5544
- }
5545
- while (tokenStream.match(Tokens.COMMA)) {
5546
- this._readWhitespace();
5547
- mediaList.push(this._media_query());
5548
- }
5549
- return mediaList;
5550
- },
5551
- _media_query: function() {
5552
- var tokenStream = this._tokenStream, type = null, ident = null, token = null, expressions = [];
5553
- if (tokenStream.match(Tokens.IDENT)) {
5554
- ident = tokenStream.token().value.toLowerCase();
5555
- if (ident !== "only" && ident !== "not") {
5556
- tokenStream.unget();
5557
- ident = null;
5558
- } else {
5559
- token = tokenStream.token();
5560
- }
5561
- }
5562
- this._readWhitespace();
5563
- if (tokenStream.peek() === Tokens.IDENT) {
5564
- type = this._media_type();
5565
- if (token === null) {
5566
- token = tokenStream.token();
5567
- }
5568
- } else if (tokenStream.peek() === Tokens.LPAREN) {
5569
- if (token === null) {
5570
- token = tokenStream.LT(1);
5571
- }
5572
- expressions.push(this._media_expression());
5573
- }
5574
- if (type === null && expressions.length === 0) {
5575
- return null;
5576
- } else {
5577
- this._readWhitespace();
5578
- while (tokenStream.match(Tokens.IDENT)) {
5579
- if (tokenStream.token().value.toLowerCase() !== "and") {
5580
- this._unexpectedToken(tokenStream.token());
5581
- }
5582
- this._readWhitespace();
5583
- expressions.push(this._media_expression());
5584
- }
5585
- }
5586
- return new MediaQuery(ident, type, expressions, token.startLine, token.startCol);
5587
- },
5588
- _media_type: function() {
5589
- return this._media_feature();
5590
- },
5591
- _media_expression: function() {
5592
- var tokenStream = this._tokenStream, feature = null, token, expression = null;
5593
- tokenStream.mustMatch(Tokens.LPAREN);
5594
- feature = this._media_feature();
5595
- this._readWhitespace();
5596
- if (tokenStream.match(Tokens.COLON)) {
5597
- this._readWhitespace();
5598
- token = tokenStream.LT(1);
5599
- expression = this._expression();
5600
- }
5601
- tokenStream.mustMatch(Tokens.RPAREN);
5602
- this._readWhitespace();
5603
- return new MediaFeature(feature, expression ? new SyntaxUnit(expression, token.startLine, token.startCol) : null);
5604
- },
5605
- _media_feature: function() {
5606
- var tokenStream = this._tokenStream;
5607
- this._readWhitespace();
5608
- tokenStream.mustMatch(Tokens.IDENT);
5609
- return SyntaxUnit.fromToken(tokenStream.token());
5610
- },
5611
- _page: function() {
5612
- var tokenStream = this._tokenStream, line, col, identifier = null, pseudoPage = null;
5613
- tokenStream.mustMatch(Tokens.PAGE_SYM);
5614
- line = tokenStream.token().startLine;
5615
- col = tokenStream.token().startCol;
5616
- this._readWhitespace();
5617
- if (tokenStream.match(Tokens.IDENT)) {
5618
- identifier = tokenStream.token().value;
5619
- if (identifier.toLowerCase() === "auto") {
5620
- this._unexpectedToken(tokenStream.token());
5621
- }
5622
- }
5623
- if (tokenStream.peek() === Tokens.COLON) {
5624
- pseudoPage = this._pseudo_page();
5625
- }
5626
- this._readWhitespace();
5627
- this.fire({
5628
- type: "startpage",
5629
- id: identifier,
5630
- pseudo: pseudoPage,
5631
- line,
5632
- col
5633
- });
5634
- this._readDeclarations(true, true);
5635
- this.fire({
5636
- type: "endpage",
5637
- id: identifier,
5638
- pseudo: pseudoPage,
5639
- line,
5640
- col
5641
- });
5642
- },
5643
- _margin: function() {
5644
- var tokenStream = this._tokenStream, line, col, marginSym = this._margin_sym();
5645
- if (marginSym) {
5646
- line = tokenStream.token().startLine;
5647
- col = tokenStream.token().startCol;
5648
- this.fire({
5649
- type: "startpagemargin",
5650
- margin: marginSym,
5651
- line,
5652
- col
5653
- });
5654
- this._readDeclarations(true);
5655
- this.fire({
5656
- type: "endpagemargin",
5657
- margin: marginSym,
5658
- line,
5659
- col
5660
- });
5661
- return true;
5662
- } else {
5663
- return false;
5664
- }
5665
- },
5666
- _margin_sym: function() {
5667
- var tokenStream = this._tokenStream;
5668
- if (tokenStream.match([
5669
- Tokens.TOPLEFTCORNER_SYM,
5670
- Tokens.TOPLEFT_SYM,
5671
- Tokens.TOPCENTER_SYM,
5672
- Tokens.TOPRIGHT_SYM,
5673
- Tokens.TOPRIGHTCORNER_SYM,
5674
- Tokens.BOTTOMLEFTCORNER_SYM,
5675
- Tokens.BOTTOMLEFT_SYM,
5676
- Tokens.BOTTOMCENTER_SYM,
5677
- Tokens.BOTTOMRIGHT_SYM,
5678
- Tokens.BOTTOMRIGHTCORNER_SYM,
5679
- Tokens.LEFTTOP_SYM,
5680
- Tokens.LEFTMIDDLE_SYM,
5681
- Tokens.LEFTBOTTOM_SYM,
5682
- Tokens.RIGHTTOP_SYM,
5683
- Tokens.RIGHTMIDDLE_SYM,
5684
- Tokens.RIGHTBOTTOM_SYM
5685
- ])) {
5686
- return SyntaxUnit.fromToken(tokenStream.token());
5687
- } else {
5688
- return null;
5689
- }
5690
- },
5691
- _pseudo_page: function() {
5692
- var tokenStream = this._tokenStream;
5693
- tokenStream.mustMatch(Tokens.COLON);
5694
- tokenStream.mustMatch(Tokens.IDENT);
5695
- return tokenStream.token().value;
5696
- },
5697
- _font_face: function() {
5698
- var tokenStream = this._tokenStream, line, col;
5699
- tokenStream.mustMatch(Tokens.FONT_FACE_SYM);
5700
- line = tokenStream.token().startLine;
5701
- col = tokenStream.token().startCol;
5702
- this._readWhitespace();
5703
- this.fire({
5704
- type: "startfontface",
5705
- line,
5706
- col
5707
- });
5708
- this._readDeclarations(true);
5709
- this.fire({
5710
- type: "endfontface",
5711
- line,
5712
- col
5713
- });
5714
- },
5715
- _viewport: function() {
5716
- var tokenStream = this._tokenStream, line, col;
5717
- tokenStream.mustMatch(Tokens.VIEWPORT_SYM);
5718
- line = tokenStream.token().startLine;
5719
- col = tokenStream.token().startCol;
5720
- this._readWhitespace();
5721
- this.fire({
5722
- type: "startviewport",
5723
- line,
5724
- col
5725
- });
5726
- this._readDeclarations(true);
5727
- this.fire({
5728
- type: "endviewport",
5729
- line,
5730
- col
5731
- });
5732
- },
5733
- _document: function() {
5734
- var tokenStream = this._tokenStream, token, functions = [], prefix = "";
5735
- tokenStream.mustMatch(Tokens.DOCUMENT_SYM);
5736
- token = tokenStream.token();
5737
- if (/^@\-([^\-]+)\-/.test(token.value)) {
5738
- prefix = RegExp.$1;
5739
- }
5740
- this._readWhitespace();
5741
- functions.push(this._document_function());
5742
- while (tokenStream.match(Tokens.COMMA)) {
5743
- this._readWhitespace();
5744
- functions.push(this._document_function());
5745
- }
5746
- tokenStream.mustMatch(Tokens.LBRACE);
5747
- this._readWhitespace();
5748
- this.fire({
5749
- type: "startdocument",
5750
- functions,
5751
- prefix,
5752
- line: token.startLine,
5753
- col: token.startCol
5754
- });
5755
- while (true) {
5756
- if (tokenStream.peek() === Tokens.PAGE_SYM) {
5757
- this._page();
5758
- } else if (tokenStream.peek() === Tokens.FONT_FACE_SYM) {
5759
- this._font_face();
5760
- } else if (tokenStream.peek() === Tokens.VIEWPORT_SYM) {
5761
- this._viewport();
5762
- } else if (tokenStream.peek() === Tokens.MEDIA_SYM) {
5763
- this._media();
5764
- } else if (!this._ruleset()) {
5765
- break;
5766
- }
5767
- }
5768
- tokenStream.mustMatch(Tokens.RBRACE);
5769
- this._readWhitespace();
5770
- this.fire({
5771
- type: "enddocument",
5772
- functions,
5773
- prefix,
5774
- line: token.startLine,
5775
- col: token.startCol
5776
- });
5777
- },
5778
- _document_function: function() {
5779
- var tokenStream = this._tokenStream, value;
5780
- if (tokenStream.match(Tokens.URI)) {
5781
- value = tokenStream.token().value;
5782
- this._readWhitespace();
5783
- } else {
5784
- value = this._function();
5785
- }
5786
- return value;
5787
- },
5788
- _operator: function(inFunction) {
5789
- var tokenStream = this._tokenStream, token = null;
5790
- if (tokenStream.match([Tokens.SLASH, Tokens.COMMA]) || inFunction && tokenStream.match([Tokens.PLUS, Tokens.STAR, Tokens.MINUS])) {
5791
- token = tokenStream.token();
5792
- this._readWhitespace();
5793
- }
5794
- return token ? PropertyValuePart.fromToken(token) : null;
5795
- },
5796
- _combinator: function() {
5797
- var tokenStream = this._tokenStream, value = null, token;
5798
- if (tokenStream.match([Tokens.PLUS, Tokens.GREATER, Tokens.TILDE])) {
5799
- token = tokenStream.token();
5800
- value = new Combinator(token.value, token.startLine, token.startCol);
5801
- this._readWhitespace();
5802
- }
5803
- return value;
5804
- },
5805
- _unary_operator: function() {
5806
- var tokenStream = this._tokenStream;
5807
- if (tokenStream.match([Tokens.MINUS, Tokens.PLUS])) {
5808
- return tokenStream.token().value;
5809
- } else {
5810
- return null;
5811
- }
5812
- },
5813
- _property: function() {
5814
- var tokenStream = this._tokenStream, value = null, hack = null, tokenValue, token, line, col;
5815
- if (tokenStream.peek() === Tokens.STAR && this.options.starHack) {
5816
- tokenStream.get();
5817
- token = tokenStream.token();
5818
- hack = token.value;
5819
- line = token.startLine;
5820
- col = token.startCol;
5821
- }
5822
- if (tokenStream.match(Tokens.IDENT)) {
5823
- token = tokenStream.token();
5824
- tokenValue = token.value;
5825
- if (tokenValue.charAt(0) === "_" && this.options.underscoreHack) {
5826
- hack = "_";
5827
- tokenValue = tokenValue.substring(1);
5828
- }
5829
- value = new PropertyName(tokenValue, hack, line || token.startLine, col || token.startCol);
5830
- this._readWhitespace();
5831
- }
5832
- return value;
5833
- },
5834
- _ruleset: function() {
5835
- var tokenStream = this._tokenStream, tt, selectors;
5836
- try {
5837
- selectors = this._selectors_group();
5838
- } catch (ex) {
5839
- if (ex instanceof SyntaxError2 && !this.options.strict) {
5840
- this.fire({
5841
- type: "error",
5842
- error: ex,
5843
- message: ex.message,
5844
- line: ex.line,
5845
- col: ex.col
5846
- });
5847
- tt = tokenStream.advance([Tokens.RBRACE]);
5848
- if (tt === Tokens.RBRACE) {
5849
- } else {
5850
- throw ex;
5851
- }
5852
- } else {
5853
- throw ex;
5854
- }
5855
- return true;
5856
- }
5857
- if (selectors) {
5858
- this.fire({
5859
- type: "startrule",
5860
- selectors,
5861
- line: selectors[0].line,
5862
- col: selectors[0].col
5863
- });
5864
- this._readDeclarations(true);
5865
- this.fire({
5866
- type: "endrule",
5867
- selectors,
5868
- line: selectors[0].line,
5869
- col: selectors[0].col
5870
- });
5871
- }
5872
- return selectors;
5873
- },
5874
- _selectors_group: function() {
5875
- var tokenStream = this._tokenStream, selectors = [], selector;
5876
- selector = this._selector();
5877
- if (selector !== null) {
5878
- selectors.push(selector);
5879
- while (tokenStream.match(Tokens.COMMA)) {
5880
- this._readWhitespace();
5881
- selector = this._selector();
5882
- if (selector !== null) {
5883
- selectors.push(selector);
5884
- } else {
5885
- this._unexpectedToken(tokenStream.LT(1));
5886
- }
5887
- }
5888
- }
5889
- return selectors.length ? selectors : null;
5890
- },
5891
- _selector: function() {
5892
- var tokenStream = this._tokenStream, selector = [], nextSelector = null, combinator = null, ws = null;
5893
- nextSelector = this._simple_selector_sequence();
5894
- if (nextSelector === null) {
5895
- return null;
5896
- }
5897
- selector.push(nextSelector);
5898
- do {
5899
- combinator = this._combinator();
5900
- if (combinator !== null) {
5901
- selector.push(combinator);
5902
- nextSelector = this._simple_selector_sequence();
5903
- if (nextSelector === null) {
5904
- this._unexpectedToken(tokenStream.LT(1));
5905
- } else {
5906
- selector.push(nextSelector);
5907
- }
5908
- } else {
5909
- if (this._readWhitespace()) {
5910
- ws = new Combinator(tokenStream.token().value, tokenStream.token().startLine, tokenStream.token().startCol);
5911
- combinator = this._combinator();
5912
- nextSelector = this._simple_selector_sequence();
5913
- if (nextSelector === null) {
5914
- if (combinator !== null) {
5915
- this._unexpectedToken(tokenStream.LT(1));
5916
- }
5917
- } else {
5918
- if (combinator !== null) {
5919
- selector.push(combinator);
5920
- } else {
5921
- selector.push(ws);
5922
- }
5923
- selector.push(nextSelector);
5924
- }
5925
- } else {
5926
- break;
5927
- }
5928
- }
5929
- } while (true);
5930
- return new Selector(selector, selector[0].line, selector[0].col);
5931
- },
5932
- _simple_selector_sequence: function() {
5933
- var tokenStream = this._tokenStream, elementName = null, modifiers = [], selectorText = "", components = [
5934
- function() {
5935
- return tokenStream.match(Tokens.HASH) ? new SelectorSubPart(tokenStream.token().value, "id", tokenStream.token().startLine, tokenStream.token().startCol) : null;
5936
- },
5937
- this._class,
5938
- this._attrib,
5939
- this._pseudo,
5940
- this._negation
5941
- ], i = 0, len = components.length, component = null, line, col;
5942
- line = tokenStream.LT(1).startLine;
5943
- col = tokenStream.LT(1).startCol;
5944
- elementName = this._type_selector();
5945
- if (!elementName) {
5946
- elementName = this._universal();
5947
- }
5948
- if (elementName !== null) {
5949
- selectorText += elementName;
5950
- }
5951
- while (true) {
5952
- if (tokenStream.peek() === Tokens.S) {
5953
- break;
5954
- }
5955
- while (i < len && component === null) {
5956
- component = components[i++].call(this);
5957
- }
5958
- if (component === null) {
5959
- if (selectorText === "") {
5960
- return null;
5961
- } else {
5962
- break;
5963
- }
5964
- } else {
5965
- i = 0;
5966
- modifiers.push(component);
5967
- selectorText += component.toString();
5968
- component = null;
5969
- }
5970
- }
5971
- return selectorText !== "" ? new SelectorPart(elementName, modifiers, selectorText, line, col) : null;
5972
- },
5973
- _type_selector: function() {
5974
- var tokenStream = this._tokenStream, ns = this._namespace_prefix(), elementName = this._element_name();
5975
- if (!elementName) {
5976
- if (ns) {
5977
- tokenStream.unget();
5978
- if (ns.length > 1) {
5979
- tokenStream.unget();
5980
- }
5981
- }
5982
- return null;
5983
- } else {
5984
- if (ns) {
5985
- elementName.text = ns + elementName.text;
5986
- elementName.col -= ns.length;
5987
- }
5988
- return elementName;
5989
- }
5990
- },
5991
- _class: function() {
5992
- var tokenStream = this._tokenStream, token;
5993
- if (tokenStream.match(Tokens.DOT)) {
5994
- tokenStream.mustMatch(Tokens.IDENT);
5995
- token = tokenStream.token();
5996
- return new SelectorSubPart("." + token.value, "class", token.startLine, token.startCol - 1);
5997
- } else {
5998
- return null;
5999
- }
6000
- },
6001
- _element_name: function() {
6002
- var tokenStream = this._tokenStream, token;
6003
- if (tokenStream.match(Tokens.IDENT)) {
6004
- token = tokenStream.token();
6005
- return new SelectorSubPart(token.value, "elementName", token.startLine, token.startCol);
6006
- } else {
6007
- return null;
6008
- }
6009
- },
6010
- _namespace_prefix: function() {
6011
- var tokenStream = this._tokenStream, value = "";
6012
- if (tokenStream.LA(1) === Tokens.PIPE || tokenStream.LA(2) === Tokens.PIPE) {
6013
- if (tokenStream.match([Tokens.IDENT, Tokens.STAR])) {
6014
- value += tokenStream.token().value;
6015
- }
6016
- tokenStream.mustMatch(Tokens.PIPE);
6017
- value += "|";
6018
- }
6019
- return value.length ? value : null;
6020
- },
6021
- _universal: function() {
6022
- var tokenStream = this._tokenStream, value = "", ns;
6023
- ns = this._namespace_prefix();
6024
- if (ns) {
6025
- value += ns;
6026
- }
6027
- if (tokenStream.match(Tokens.STAR)) {
6028
- value += "*";
6029
- }
6030
- return value.length ? value : null;
6031
- },
6032
- _attrib: function() {
6033
- var tokenStream = this._tokenStream, value = null, ns, token;
6034
- if (tokenStream.match(Tokens.LBRACKET)) {
6035
- token = tokenStream.token();
6036
- value = token.value;
6037
- value += this._readWhitespace();
6038
- ns = this._namespace_prefix();
6039
- if (ns) {
6040
- value += ns;
6041
- }
6042
- tokenStream.mustMatch(Tokens.IDENT);
6043
- value += tokenStream.token().value;
6044
- value += this._readWhitespace();
6045
- if (tokenStream.match([
6046
- Tokens.PREFIXMATCH,
6047
- Tokens.SUFFIXMATCH,
6048
- Tokens.SUBSTRINGMATCH,
6049
- Tokens.EQUALS,
6050
- Tokens.INCLUDES,
6051
- Tokens.DASHMATCH
6052
- ])) {
6053
- value += tokenStream.token().value;
6054
- value += this._readWhitespace();
6055
- tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]);
6056
- value += tokenStream.token().value;
6057
- value += this._readWhitespace();
6058
- }
6059
- tokenStream.mustMatch(Tokens.RBRACKET);
6060
- return new SelectorSubPart(value + "]", "attribute", token.startLine, token.startCol);
6061
- } else {
6062
- return null;
6063
- }
6064
- },
6065
- _pseudo: function() {
6066
- var tokenStream = this._tokenStream, pseudo = null, colons = ":", line, col;
6067
- if (tokenStream.match(Tokens.COLON)) {
6068
- if (tokenStream.match(Tokens.COLON)) {
6069
- colons += ":";
6070
- }
6071
- if (tokenStream.match(Tokens.IDENT)) {
6072
- pseudo = tokenStream.token().value;
6073
- line = tokenStream.token().startLine;
6074
- col = tokenStream.token().startCol - colons.length;
6075
- } else if (tokenStream.peek() === Tokens.FUNCTION) {
6076
- line = tokenStream.LT(1).startLine;
6077
- col = tokenStream.LT(1).startCol - colons.length;
6078
- pseudo = this._functional_pseudo();
6079
- }
6080
- if (pseudo) {
6081
- pseudo = new SelectorSubPart(colons + pseudo, "pseudo", line, col);
6082
- }
6083
- }
6084
- return pseudo;
6085
- },
6086
- _functional_pseudo: function() {
6087
- var tokenStream = this._tokenStream, value = null;
6088
- if (tokenStream.match(Tokens.FUNCTION)) {
6089
- value = tokenStream.token().value;
6090
- value += this._readWhitespace();
6091
- value += this._expression();
6092
- tokenStream.mustMatch(Tokens.RPAREN);
6093
- value += ")";
6094
- }
6095
- return value;
6096
- },
6097
- _expression: function() {
6098
- var tokenStream = this._tokenStream, value = "";
6099
- while (tokenStream.match([
6100
- Tokens.PLUS,
6101
- Tokens.MINUS,
6102
- Tokens.DIMENSION,
6103
- Tokens.NUMBER,
6104
- Tokens.STRING,
6105
- Tokens.IDENT,
6106
- Tokens.LENGTH,
6107
- Tokens.FREQ,
6108
- Tokens.ANGLE,
6109
- Tokens.TIME,
6110
- Tokens.RESOLUTION,
6111
- Tokens.SLASH
6112
- ])) {
6113
- value += tokenStream.token().value;
6114
- value += this._readWhitespace();
6115
- }
6116
- return value.length ? value : null;
6117
- },
6118
- _negation: function() {
6119
- var tokenStream = this._tokenStream, line, col, value = "", arg, subpart = null;
6120
- if (tokenStream.match(Tokens.NOT)) {
6121
- value = tokenStream.token().value;
6122
- line = tokenStream.token().startLine;
6123
- col = tokenStream.token().startCol;
6124
- value += this._readWhitespace();
6125
- arg = this._negation_arg();
6126
- value += arg;
6127
- value += this._readWhitespace();
6128
- tokenStream.match(Tokens.RPAREN);
6129
- value += tokenStream.token().value;
6130
- subpart = new SelectorSubPart(value, "not", line, col);
6131
- subpart.args.push(arg);
6132
- }
6133
- return subpart;
6134
- },
6135
- _negation_arg: function() {
6136
- var tokenStream = this._tokenStream, args = [
6137
- this._type_selector,
6138
- this._universal,
6139
- function() {
6140
- return tokenStream.match(Tokens.HASH) ? new SelectorSubPart(tokenStream.token().value, "id", tokenStream.token().startLine, tokenStream.token().startCol) : null;
6141
- },
6142
- this._class,
6143
- this._attrib,
6144
- this._pseudo
6145
- ], arg = null, i = 0, len = args.length, line, col, part;
6146
- line = tokenStream.LT(1).startLine;
6147
- col = tokenStream.LT(1).startCol;
6148
- while (i < len && arg === null) {
6149
- arg = args[i].call(this);
6150
- i++;
6151
- }
6152
- if (arg === null) {
6153
- this._unexpectedToken(tokenStream.LT(1));
6154
- }
6155
- if (arg.type === "elementName") {
6156
- part = new SelectorPart(arg, [], arg.toString(), line, col);
6157
- } else {
6158
- part = new SelectorPart(null, [arg], arg.toString(), line, col);
6159
- }
6160
- return part;
6161
- },
6162
- _declaration: function() {
6163
- var tokenStream = this._tokenStream, property = null, expr = null, prio = null, invalid = null, propertyName = "";
6164
- property = this._property();
6165
- if (property !== null) {
6166
- tokenStream.mustMatch(Tokens.COLON);
6167
- this._readWhitespace();
6168
- expr = this._expr();
6169
- if (!expr || expr.length === 0) {
6170
- this._unexpectedToken(tokenStream.LT(1));
6171
- }
6172
- prio = this._prio();
6173
- propertyName = property.toString();
6174
- if (this.options.starHack && property.hack === "*" || this.options.underscoreHack && property.hack === "_") {
6175
- propertyName = property.text;
6176
- }
6177
- try {
6178
- this._validateProperty(propertyName, expr);
6179
- } catch (ex) {
6180
- invalid = ex;
6181
- }
6182
- this.fire({
6183
- type: "property",
6184
- property,
6185
- value: expr,
6186
- important: prio,
6187
- line: property.line,
6188
- col: property.col,
6189
- invalid
6190
- });
6191
- return true;
6192
- } else {
6193
- return false;
6194
- }
6195
- },
6196
- _prio: function() {
6197
- var tokenStream = this._tokenStream, result = tokenStream.match(Tokens.IMPORTANT_SYM);
6198
- this._readWhitespace();
6199
- return result;
6200
- },
6201
- _expr: function(inFunction) {
6202
- var values = [], value = null, operator = null;
6203
- value = this._term(inFunction);
6204
- if (value !== null) {
6205
- values.push(value);
6206
- do {
6207
- operator = this._operator(inFunction);
6208
- if (operator) {
6209
- values.push(operator);
6210
- }
6211
- value = this._term(inFunction);
6212
- if (value === null) {
6213
- break;
6214
- } else {
6215
- values.push(value);
6216
- }
6217
- } while (true);
6218
- }
6219
- return values.length > 0 ? new PropertyValue(values, values[0].line, values[0].col) : null;
6220
- },
6221
- _term: function(inFunction) {
6222
- var tokenStream = this._tokenStream, unary = null, value = null, endChar = null, token, line, col;
6223
- unary = this._unary_operator();
6224
- if (unary !== null) {
6225
- line = tokenStream.token().startLine;
6226
- col = tokenStream.token().startCol;
6227
- }
6228
- if (tokenStream.peek() === Tokens.IE_FUNCTION && this.options.ieFilters) {
6229
- value = this._ie_function();
6230
- if (unary === null) {
6231
- line = tokenStream.token().startLine;
6232
- col = tokenStream.token().startCol;
6233
- }
6234
- } else if (inFunction && tokenStream.match([Tokens.LPAREN, Tokens.LBRACE, Tokens.LBRACKET])) {
6235
- token = tokenStream.token();
6236
- endChar = token.endChar;
6237
- value = token.value + this._expr(inFunction).text;
6238
- if (unary === null) {
6239
- line = tokenStream.token().startLine;
6240
- col = tokenStream.token().startCol;
6241
- }
6242
- tokenStream.mustMatch(Tokens.type(endChar));
6243
- value += endChar;
6244
- this._readWhitespace();
6245
- } else if (tokenStream.match([
6246
- Tokens.NUMBER,
6247
- Tokens.PERCENTAGE,
6248
- Tokens.LENGTH,
6249
- Tokens.ANGLE,
6250
- Tokens.TIME,
6251
- Tokens.FREQ,
6252
- Tokens.STRING,
6253
- Tokens.IDENT,
6254
- Tokens.URI,
6255
- Tokens.UNICODE_RANGE
6256
- ])) {
6257
- value = tokenStream.token().value;
6258
- if (unary === null) {
6259
- line = tokenStream.token().startLine;
6260
- col = tokenStream.token().startCol;
6261
- }
6262
- this._readWhitespace();
6263
- } else {
6264
- token = this._hexcolor();
6265
- if (token === null) {
6266
- if (unary === null) {
6267
- line = tokenStream.LT(1).startLine;
6268
- col = tokenStream.LT(1).startCol;
6269
- }
6270
- if (value === null) {
6271
- if (tokenStream.LA(3) === Tokens.EQUALS && this.options.ieFilters) {
6272
- value = this._ie_function();
6273
- } else {
6274
- value = this._function();
6275
- }
6276
- }
6277
- } else {
6278
- value = token.value;
6279
- if (unary === null) {
6280
- line = token.startLine;
6281
- col = token.startCol;
6282
- }
6283
- }
6284
- }
6285
- return value !== null ? new PropertyValuePart(unary !== null ? unary + value : value, line, col) : null;
6286
- },
6287
- _function: function() {
6288
- var tokenStream = this._tokenStream, functionText = null, expr = null, lt;
6289
- if (tokenStream.match(Tokens.FUNCTION)) {
6290
- functionText = tokenStream.token().value;
6291
- this._readWhitespace();
6292
- expr = this._expr(true);
6293
- functionText += expr;
6294
- if (this.options.ieFilters && tokenStream.peek() === Tokens.EQUALS) {
6295
- do {
6296
- if (this._readWhitespace()) {
6297
- functionText += tokenStream.token().value;
6298
- }
6299
- if (tokenStream.LA(0) === Tokens.COMMA) {
6300
- functionText += tokenStream.token().value;
6301
- }
6302
- tokenStream.match(Tokens.IDENT);
6303
- functionText += tokenStream.token().value;
6304
- tokenStream.match(Tokens.EQUALS);
6305
- functionText += tokenStream.token().value;
6306
- lt = tokenStream.peek();
6307
- while (lt !== Tokens.COMMA && lt !== Tokens.S && lt !== Tokens.RPAREN) {
6308
- tokenStream.get();
6309
- functionText += tokenStream.token().value;
6310
- lt = tokenStream.peek();
6311
- }
6312
- } while (tokenStream.match([Tokens.COMMA, Tokens.S]));
6313
- }
6314
- tokenStream.match(Tokens.RPAREN);
6315
- functionText += ")";
6316
- this._readWhitespace();
6317
- }
6318
- return functionText;
6319
- },
6320
- _ie_function: function() {
6321
- var tokenStream = this._tokenStream, functionText = null, lt;
6322
- if (tokenStream.match([Tokens.IE_FUNCTION, Tokens.FUNCTION])) {
6323
- functionText = tokenStream.token().value;
6324
- do {
6325
- if (this._readWhitespace()) {
6326
- functionText += tokenStream.token().value;
6327
- }
6328
- if (tokenStream.LA(0) === Tokens.COMMA) {
6329
- functionText += tokenStream.token().value;
6330
- }
6331
- tokenStream.match(Tokens.IDENT);
6332
- functionText += tokenStream.token().value;
6333
- tokenStream.match(Tokens.EQUALS);
6334
- functionText += tokenStream.token().value;
6335
- lt = tokenStream.peek();
6336
- while (lt !== Tokens.COMMA && lt !== Tokens.S && lt !== Tokens.RPAREN) {
6337
- tokenStream.get();
6338
- functionText += tokenStream.token().value;
6339
- lt = tokenStream.peek();
6340
- }
6341
- } while (tokenStream.match([Tokens.COMMA, Tokens.S]));
6342
- tokenStream.match(Tokens.RPAREN);
6343
- functionText += ")";
6344
- this._readWhitespace();
6345
- }
6346
- return functionText;
6347
- },
6348
- _hexcolor: function() {
6349
- var tokenStream = this._tokenStream, token = null, color;
6350
- if (tokenStream.match(Tokens.HASH)) {
6351
- token = tokenStream.token();
6352
- color = token.value;
6353
- if (!/#[a-f0-9]{3,6}/i.test(color)) {
6354
- throw new SyntaxError2("Expected a hex color but found '" + color + "' at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol);
6355
- }
6356
- this._readWhitespace();
6357
- }
6358
- return token;
6359
- },
6360
- _keyframes: function() {
6361
- var tokenStream = this._tokenStream, token, tt, name, prefix = "";
6362
- tokenStream.mustMatch(Tokens.KEYFRAMES_SYM);
6363
- token = tokenStream.token();
6364
- if (/^@\-([^\-]+)\-/.test(token.value)) {
6365
- prefix = RegExp.$1;
6366
- }
6367
- this._readWhitespace();
6368
- name = this._keyframe_name();
6369
- this._readWhitespace();
6370
- tokenStream.mustMatch(Tokens.LBRACE);
6371
- this.fire({
6372
- type: "startkeyframes",
6373
- name,
6374
- prefix,
6375
- line: token.startLine,
6376
- col: token.startCol
6377
- });
6378
- this._readWhitespace();
6379
- tt = tokenStream.peek();
6380
- while (tt === Tokens.IDENT || tt === Tokens.PERCENTAGE) {
6381
- this._keyframe_rule();
6382
- this._readWhitespace();
6383
- tt = tokenStream.peek();
6384
- }
6385
- this.fire({
6386
- type: "endkeyframes",
6387
- name,
6388
- prefix,
6389
- line: token.startLine,
6390
- col: token.startCol
6391
- });
6392
- this._readWhitespace();
6393
- tokenStream.mustMatch(Tokens.RBRACE);
6394
- },
6395
- _keyframe_name: function() {
6396
- var tokenStream = this._tokenStream;
6397
- tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]);
6398
- return SyntaxUnit.fromToken(tokenStream.token());
6399
- },
6400
- _keyframe_rule: function() {
6401
- var keyList = this._key_list();
6402
- this.fire({
6403
- type: "startkeyframerule",
6404
- keys: keyList,
6405
- line: keyList[0].line,
6406
- col: keyList[0].col
6407
- });
6408
- this._readDeclarations(true);
6409
- this.fire({
6410
- type: "endkeyframerule",
6411
- keys: keyList,
6412
- line: keyList[0].line,
6413
- col: keyList[0].col
6414
- });
6415
- },
6416
- _key_list: function() {
6417
- var tokenStream = this._tokenStream, keyList = [];
6418
- keyList.push(this._key());
6419
- this._readWhitespace();
6420
- while (tokenStream.match(Tokens.COMMA)) {
6421
- this._readWhitespace();
6422
- keyList.push(this._key());
6423
- this._readWhitespace();
6424
- }
6425
- return keyList;
6426
- },
6427
- _key: function() {
6428
- var tokenStream = this._tokenStream, token;
6429
- if (tokenStream.match(Tokens.PERCENTAGE)) {
6430
- return SyntaxUnit.fromToken(tokenStream.token());
6431
- } else if (tokenStream.match(Tokens.IDENT)) {
6432
- token = tokenStream.token();
6433
- if (/from|to/i.test(token.value)) {
6434
- return SyntaxUnit.fromToken(token);
6435
- }
6436
- tokenStream.unget();
6437
- }
6438
- this._unexpectedToken(tokenStream.LT(1));
6439
- },
6440
- _skipCruft: function() {
6441
- while (this._tokenStream.match([Tokens.S, Tokens.CDO, Tokens.CDC])) {
6442
- }
6443
- },
6444
- _readDeclarations: function(checkStart, readMargins) {
6445
- var tokenStream = this._tokenStream, tt;
6446
- this._readWhitespace();
6447
- if (checkStart) {
6448
- tokenStream.mustMatch(Tokens.LBRACE);
6449
- }
6450
- this._readWhitespace();
6451
- try {
6452
- while (true) {
6453
- if (tokenStream.match(Tokens.SEMICOLON) || readMargins && this._margin()) {
6454
- } else if (this._declaration()) {
6455
- if (!tokenStream.match(Tokens.SEMICOLON)) {
6456
- break;
6457
- }
6458
- } else {
6459
- break;
6460
- }
6461
- this._readWhitespace();
6462
- }
6463
- tokenStream.mustMatch(Tokens.RBRACE);
6464
- this._readWhitespace();
6465
- } catch (ex) {
6466
- if (ex instanceof SyntaxError2 && !this.options.strict) {
6467
- this.fire({
6468
- type: "error",
6469
- error: ex,
6470
- message: ex.message,
6471
- line: ex.line,
6472
- col: ex.col
6473
- });
6474
- tt = tokenStream.advance([Tokens.SEMICOLON, Tokens.RBRACE]);
6475
- if (tt === Tokens.SEMICOLON) {
6476
- this._readDeclarations(false, readMargins);
6477
- } else if (tt !== Tokens.RBRACE) {
6478
- throw ex;
6479
- }
6480
- } else {
6481
- throw ex;
6482
- }
6483
- }
6484
- },
6485
- _readWhitespace: function() {
6486
- var tokenStream = this._tokenStream, ws = "";
6487
- while (tokenStream.match(Tokens.S)) {
6488
- ws += tokenStream.token().value;
6489
- }
6490
- return ws;
6491
- },
6492
- _unexpectedToken: function(token) {
6493
- throw new SyntaxError2("Unexpected token '" + token.value + "' at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol);
6494
- },
6495
- _verifyEnd: function() {
6496
- if (this._tokenStream.LA(1) !== Tokens.EOF) {
6497
- this._unexpectedToken(this._tokenStream.LT(1));
6498
- }
6499
- },
6500
- _validateProperty: function(property, value) {
6501
- Validation.validate(property, value);
6502
- },
6503
- parse: function(input) {
6504
- this._tokenStream = new TokenStream(input, Tokens);
6505
- this._stylesheet();
6506
- },
6507
- parseStyleSheet: function(input) {
6508
- return this.parse(input);
6509
- },
6510
- parseMediaQuery: function(input) {
6511
- this._tokenStream = new TokenStream(input, Tokens);
6512
- var result = this._media_query();
6513
- this._verifyEnd();
6514
- return result;
6515
- },
6516
- parsePropertyValue: function(input) {
6517
- this._tokenStream = new TokenStream(input, Tokens);
6518
- this._readWhitespace();
6519
- var result = this._expr();
6520
- this._readWhitespace();
6521
- this._verifyEnd();
6522
- return result;
6523
- },
6524
- parseRule: function(input) {
6525
- this._tokenStream = new TokenStream(input, Tokens);
6526
- this._readWhitespace();
6527
- var result = this._ruleset();
6528
- this._readWhitespace();
6529
- this._verifyEnd();
6530
- return result;
6531
- },
6532
- parseSelector: function(input) {
6533
- this._tokenStream = new TokenStream(input, Tokens);
6534
- this._readWhitespace();
6535
- var result = this._selector();
6536
- this._readWhitespace();
6537
- this._verifyEnd();
6538
- return result;
6539
- },
6540
- parseStyleAttribute: function(input) {
6541
- input += "}";
6542
- this._tokenStream = new TokenStream(input, Tokens);
6543
- this._readDeclarations();
6544
- }
6545
- };
6546
- for (prop in additions) {
6547
- if (Object.prototype.hasOwnProperty.call(additions, prop)) {
6548
- proto[prop] = additions[prop];
6549
- }
6550
- }
6551
- return proto;
6552
- }();
6553
- var Properties = {
6554
- __proto__: null,
6555
- "align-items": "flex-start | flex-end | center | baseline | stretch",
6556
- "align-content": "flex-start | flex-end | center | space-between | space-around | stretch",
6557
- "align-self": "auto | flex-start | flex-end | center | baseline | stretch",
6558
- "-webkit-align-items": "flex-start | flex-end | center | baseline | stretch",
6559
- "-webkit-align-content": "flex-start | flex-end | center | space-between | space-around | stretch",
6560
- "-webkit-align-self": "auto | flex-start | flex-end | center | baseline | stretch",
6561
- "alignment-adjust": "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | <percentage> | <length>",
6562
- "alignment-baseline": "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",
6563
- "animation": 1,
6564
- "animation-delay": { multi: "<time>", comma: true },
6565
- "animation-direction": { multi: "normal | alternate", comma: true },
6566
- "animation-duration": { multi: "<time>", comma: true },
6567
- "animation-fill-mode": { multi: "none | forwards | backwards | both", comma: true },
6568
- "animation-iteration-count": { multi: "<number> | infinite", comma: true },
6569
- "animation-name": { multi: "none | <ident>", comma: true },
6570
- "animation-play-state": { multi: "running | paused", comma: true },
6571
- "animation-timing-function": 1,
6572
- "-moz-animation-delay": { multi: "<time>", comma: true },
6573
- "-moz-animation-direction": { multi: "normal | alternate", comma: true },
6574
- "-moz-animation-duration": { multi: "<time>", comma: true },
6575
- "-moz-animation-iteration-count": { multi: "<number> | infinite", comma: true },
6576
- "-moz-animation-name": { multi: "none | <ident>", comma: true },
6577
- "-moz-animation-play-state": { multi: "running | paused", comma: true },
6578
- "-ms-animation-delay": { multi: "<time>", comma: true },
6579
- "-ms-animation-direction": { multi: "normal | alternate", comma: true },
6580
- "-ms-animation-duration": { multi: "<time>", comma: true },
6581
- "-ms-animation-iteration-count": { multi: "<number> | infinite", comma: true },
6582
- "-ms-animation-name": { multi: "none | <ident>", comma: true },
6583
- "-ms-animation-play-state": { multi: "running | paused", comma: true },
6584
- "-webkit-animation-delay": { multi: "<time>", comma: true },
6585
- "-webkit-animation-direction": { multi: "normal | alternate", comma: true },
6586
- "-webkit-animation-duration": { multi: "<time>", comma: true },
6587
- "-webkit-animation-fill-mode": { multi: "none | forwards | backwards | both", comma: true },
6588
- "-webkit-animation-iteration-count": { multi: "<number> | infinite", comma: true },
6589
- "-webkit-animation-name": { multi: "none | <ident>", comma: true },
6590
- "-webkit-animation-play-state": { multi: "running | paused", comma: true },
6591
- "-o-animation-delay": { multi: "<time>", comma: true },
6592
- "-o-animation-direction": { multi: "normal | alternate", comma: true },
6593
- "-o-animation-duration": { multi: "<time>", comma: true },
6594
- "-o-animation-iteration-count": { multi: "<number> | infinite", comma: true },
6595
- "-o-animation-name": { multi: "none | <ident>", comma: true },
6596
- "-o-animation-play-state": { multi: "running | paused", comma: true },
6597
- "appearance": "icon | window | desktop | workspace | document | tooltip | dialog | button | push-button | hyperlink | radio | radio-button | checkbox | menu-item | tab | menu | menubar | pull-down-menu | pop-up-menu | list-menu | radio-group | checkbox-group | outline-tree | range | field | combo-box | signature | password | normal | none | inherit",
6598
- "azimuth": function(expression) {
6599
- var simple = "<angle> | leftwards | rightwards | inherit", direction = "left-side | far-left | left | center-left | center | center-right | right | far-right | right-side", behind = false, valid = false, part;
6600
- if (!ValidationTypes.isAny(expression, simple)) {
6601
- if (ValidationTypes.isAny(expression, "behind")) {
6602
- behind = true;
6603
- valid = true;
6604
- }
6605
- if (ValidationTypes.isAny(expression, direction)) {
6606
- valid = true;
6607
- if (!behind) {
6608
- ValidationTypes.isAny(expression, "behind");
6609
- }
6610
- }
6611
- }
6612
- if (expression.hasNext()) {
6613
- part = expression.next();
6614
- if (valid) {
6615
- throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
6616
- } else {
6617
- throw new ValidationError("Expected (<'azimuth'>) but found '" + part + "'.", part.line, part.col);
6618
- }
6619
- }
6620
- },
6621
- "backface-visibility": "visible | hidden",
6622
- "background": 1,
6623
- "background-attachment": { multi: "<attachment>", comma: true },
6624
- "background-clip": { multi: "<box>", comma: true },
6625
- "background-color": "<color> | inherit",
6626
- "background-image": { multi: "<bg-image>", comma: true },
6627
- "background-origin": { multi: "<box>", comma: true },
6628
- "background-position": { multi: "<bg-position>", comma: true },
6629
- "background-repeat": { multi: "<repeat-style>" },
6630
- "background-size": { multi: "<bg-size>", comma: true },
6631
- "baseline-shift": "baseline | sub | super | <percentage> | <length>",
6632
- "behavior": 1,
6633
- "binding": 1,
6634
- "bleed": "<length>",
6635
- "bookmark-label": "<content> | <attr> | <string>",
6636
- "bookmark-level": "none | <integer>",
6637
- "bookmark-state": "open | closed",
6638
- "bookmark-target": "none | <uri> | <attr>",
6639
- "border": "<border-width> || <border-style> || <color>",
6640
- "border-bottom": "<border-width> || <border-style> || <color>",
6641
- "border-bottom-color": "<color> | inherit",
6642
- "border-bottom-left-radius": "<x-one-radius>",
6643
- "border-bottom-right-radius": "<x-one-radius>",
6644
- "border-bottom-style": "<border-style>",
6645
- "border-bottom-width": "<border-width>",
6646
- "border-collapse": "collapse | separate | inherit",
6647
- "border-color": { multi: "<color> | inherit", max: 4 },
6648
- "border-image": 1,
6649
- "border-image-outset": { multi: "<length> | <number>", max: 4 },
6650
- "border-image-repeat": { multi: "stretch | repeat | round", max: 2 },
6651
- "border-image-slice": function(expression) {
6652
- var valid = false, numeric = "<number> | <percentage>", fill = false, count = 0, max = 4, part;
6653
- if (ValidationTypes.isAny(expression, "fill")) {
6654
- fill = true;
6655
- valid = true;
6656
- }
6657
- while (expression.hasNext() && count < max) {
6658
- valid = ValidationTypes.isAny(expression, numeric);
6659
- if (!valid) {
6660
- break;
6661
- }
6662
- count++;
6663
- }
6664
- if (!fill) {
6665
- ValidationTypes.isAny(expression, "fill");
6666
- } else {
6667
- valid = true;
6668
- }
6669
- if (expression.hasNext()) {
6670
- part = expression.next();
6671
- if (valid) {
6672
- throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
6673
- } else {
6674
- throw new ValidationError("Expected ([<number> | <percentage>]{1,4} && fill?) but found '" + part + "'.", part.line, part.col);
6675
- }
6676
- }
6677
- },
6678
- "border-image-source": "<image> | none",
6679
- "border-image-width": { multi: "<length> | <percentage> | <number> | auto", max: 4 },
6680
- "border-left": "<border-width> || <border-style> || <color>",
6681
- "border-left-color": "<color> | inherit",
6682
- "border-left-style": "<border-style>",
6683
- "border-left-width": "<border-width>",
6684
- "border-radius": function(expression) {
6685
- var valid = false, simple = "<length> | <percentage> | inherit", slash = false, count = 0, max = 8, part;
6686
- while (expression.hasNext() && count < max) {
6687
- valid = ValidationTypes.isAny(expression, simple);
6688
- if (!valid) {
6689
- if (String(expression.peek()) === "/" && count > 0 && !slash) {
6690
- slash = true;
6691
- max = count + 5;
6692
- expression.next();
6693
- } else {
6694
- break;
6695
- }
6696
- }
6697
- count++;
6698
- }
6699
- if (expression.hasNext()) {
6700
- part = expression.next();
6701
- if (valid) {
6702
- throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
6703
- } else {
6704
- throw new ValidationError("Expected (<'border-radius'>) but found '" + part + "'.", part.line, part.col);
6705
- }
6706
- }
6707
- },
6708
- "border-right": "<border-width> || <border-style> || <color>",
6709
- "border-right-color": "<color> | inherit",
6710
- "border-right-style": "<border-style>",
6711
- "border-right-width": "<border-width>",
6712
- "border-spacing": { multi: "<length> | inherit", max: 2 },
6713
- "border-style": { multi: "<border-style>", max: 4 },
6714
- "border-top": "<border-width> || <border-style> || <color>",
6715
- "border-top-color": "<color> | inherit",
6716
- "border-top-left-radius": "<x-one-radius>",
6717
- "border-top-right-radius": "<x-one-radius>",
6718
- "border-top-style": "<border-style>",
6719
- "border-top-width": "<border-width>",
6720
- "border-width": { multi: "<border-width>", max: 4 },
6721
- "bottom": "<margin-width> | inherit",
6722
- "-moz-box-align": "start | end | center | baseline | stretch",
6723
- "-moz-box-decoration-break": "slice |clone",
6724
- "-moz-box-direction": "normal | reverse | inherit",
6725
- "-moz-box-flex": "<number>",
6726
- "-moz-box-flex-group": "<integer>",
6727
- "-moz-box-lines": "single | multiple",
6728
- "-moz-box-ordinal-group": "<integer>",
6729
- "-moz-box-orient": "horizontal | vertical | inline-axis | block-axis | inherit",
6730
- "-moz-box-pack": "start | end | center | justify",
6731
- "-o-box-decoration-break": "slice | clone",
6732
- "-webkit-box-align": "start | end | center | baseline | stretch",
6733
- "-webkit-box-decoration-break": "slice |clone",
6734
- "-webkit-box-direction": "normal | reverse | inherit",
6735
- "-webkit-box-flex": "<number>",
6736
- "-webkit-box-flex-group": "<integer>",
6737
- "-webkit-box-lines": "single | multiple",
6738
- "-webkit-box-ordinal-group": "<integer>",
6739
- "-webkit-box-orient": "horizontal | vertical | inline-axis | block-axis | inherit",
6740
- "-webkit-box-pack": "start | end | center | justify",
6741
- "box-decoration-break": "slice | clone",
6742
- "box-shadow": function(expression) {
6743
- var part;
6744
- if (!ValidationTypes.isAny(expression, "none")) {
6745
- Validation.multiProperty("<shadow>", expression, true, Infinity);
6746
- } else {
6747
- if (expression.hasNext()) {
6748
- part = expression.next();
6749
- throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
6750
- }
6751
- }
6752
- },
6753
- "box-sizing": "content-box | border-box | inherit",
6754
- "break-after": "auto | always | avoid | left | right | page | column | avoid-page | avoid-column",
6755
- "break-before": "auto | always | avoid | left | right | page | column | avoid-page | avoid-column",
6756
- "break-inside": "auto | avoid | avoid-page | avoid-column",
6757
- "caption-side": "top | bottom | inherit",
6758
- "clear": "none | right | left | both | inherit",
6759
- "clip": 1,
6760
- "color": "<color> | inherit",
6761
- "color-profile": 1,
6762
- "column-count": "<integer> | auto",
6763
- "column-fill": "auto | balance",
6764
- "column-gap": "<length> | normal",
6765
- "column-rule": "<border-width> || <border-style> || <color>",
6766
- "column-rule-color": "<color>",
6767
- "column-rule-style": "<border-style>",
6768
- "column-rule-width": "<border-width>",
6769
- "column-span": "none | all",
6770
- "column-width": "<length> | auto",
6771
- "columns": 1,
6772
- "content": 1,
6773
- "counter-increment": 1,
6774
- "counter-reset": 1,
6775
- "crop": "<shape> | auto",
6776
- "cue": "cue-after | cue-before | inherit",
6777
- "cue-after": 1,
6778
- "cue-before": 1,
6779
- "cursor": 1,
6780
- "direction": "ltr | rtl | inherit",
6781
- "display": "inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | grid | inline-grid | run-in | ruby | ruby-base | ruby-text | ruby-base-container | ruby-text-container | contents | none | inherit | -moz-box | -moz-inline-block | -moz-inline-box | -moz-inline-grid | -moz-inline-stack | -moz-inline-table | -moz-grid | -moz-grid-group | -moz-grid-line | -moz-groupbox | -moz-deck | -moz-popup | -moz-stack | -moz-marker | -webkit-box | -webkit-inline-box | -ms-flexbox | -ms-inline-flexbox | flex | -webkit-flex | inline-flex | -webkit-inline-flex",
6782
- "dominant-baseline": 1,
6783
- "drop-initial-after-adjust": "central | middle | after-edge | text-after-edge | ideographic | alphabetic | mathematical | <percentage> | <length>",
6784
- "drop-initial-after-align": "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",
6785
- "drop-initial-before-adjust": "before-edge | text-before-edge | central | middle | hanging | mathematical | <percentage> | <length>",
6786
- "drop-initial-before-align": "caps-height | baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",
6787
- "drop-initial-size": "auto | line | <length> | <percentage>",
6788
- "drop-initial-value": "initial | <integer>",
6789
- "elevation": "<angle> | below | level | above | higher | lower | inherit",
6790
- "empty-cells": "show | hide | inherit",
6791
- "filter": 1,
6792
- "fit": "fill | hidden | meet | slice",
6793
- "fit-position": 1,
6794
- "flex": "<flex>",
6795
- "flex-basis": "<width>",
6796
- "flex-direction": "row | row-reverse | column | column-reverse",
6797
- "flex-flow": "<flex-direction> || <flex-wrap>",
6798
- "flex-grow": "<number>",
6799
- "flex-shrink": "<number>",
6800
- "flex-wrap": "nowrap | wrap | wrap-reverse",
6801
- "-webkit-flex": "<flex>",
6802
- "-webkit-flex-basis": "<width>",
6803
- "-webkit-flex-direction": "row | row-reverse | column | column-reverse",
6804
- "-webkit-flex-flow": "<flex-direction> || <flex-wrap>",
6805
- "-webkit-flex-grow": "<number>",
6806
- "-webkit-flex-shrink": "<number>",
6807
- "-webkit-flex-wrap": "nowrap | wrap | wrap-reverse",
6808
- "-ms-flex": "<flex>",
6809
- "-ms-flex-align": "start | end | center | stretch | baseline",
6810
- "-ms-flex-direction": "row | row-reverse | column | column-reverse | inherit",
6811
- "-ms-flex-order": "<number>",
6812
- "-ms-flex-pack": "start | end | center | justify",
6813
- "-ms-flex-wrap": "nowrap | wrap | wrap-reverse",
6814
- "float": "left | right | none | inherit",
6815
- "float-offset": 1,
6816
- "font": 1,
6817
- "font-family": 1,
6818
- "font-feature-settings": "<feature-tag-value> | normal | inherit",
6819
- "font-kerning": "auto | normal | none | initial | inherit | unset",
6820
- "font-size": "<absolute-size> | <relative-size> | <length> | <percentage> | inherit",
6821
- "font-size-adjust": "<number> | none | inherit",
6822
- "font-stretch": "normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | inherit",
6823
- "font-style": "normal | italic | oblique | inherit",
6824
- "font-variant": "normal | small-caps | inherit",
6825
- "font-variant-caps": "normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps",
6826
- "font-variant-position": "normal | sub | super | inherit | initial | unset",
6827
- "font-weight": "normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit",
6828
- "grid": 1,
6829
- "grid-area": 1,
6830
- "grid-auto-columns": 1,
6831
- "grid-auto-flow": 1,
6832
- "grid-auto-position": 1,
6833
- "grid-auto-rows": 1,
6834
- "grid-cell-stacking": "columns | rows | layer",
6835
- "grid-column": 1,
6836
- "grid-columns": 1,
6837
- "grid-column-align": "start | end | center | stretch",
6838
- "grid-column-sizing": 1,
6839
- "grid-column-start": 1,
6840
- "grid-column-end": 1,
6841
- "grid-column-span": "<integer>",
6842
- "grid-flow": "none | rows | columns",
6843
- "grid-layer": "<integer>",
6844
- "grid-row": 1,
6845
- "grid-rows": 1,
6846
- "grid-row-align": "start | end | center | stretch",
6847
- "grid-row-start": 1,
6848
- "grid-row-end": 1,
6849
- "grid-row-span": "<integer>",
6850
- "grid-row-sizing": 1,
6851
- "grid-template": 1,
6852
- "grid-template-areas": 1,
6853
- "grid-template-columns": 1,
6854
- "grid-template-rows": 1,
6855
- "hanging-punctuation": 1,
6856
- "height": "<margin-width> | <content-sizing> | inherit",
6857
- "hyphenate-after": "<integer> | auto",
6858
- "hyphenate-before": "<integer> | auto",
6859
- "hyphenate-character": "<string> | auto",
6860
- "hyphenate-lines": "no-limit | <integer>",
6861
- "hyphenate-resource": 1,
6862
- "hyphens": "none | manual | auto",
6863
- "icon": 1,
6864
- "image-orientation": "angle | auto",
6865
- "image-rendering": 1,
6866
- "image-resolution": 1,
6867
- "ime-mode": "auto | normal | active | inactive | disabled | inherit",
6868
- "inline-box-align": "initial | last | <integer>",
6869
- "justify-content": "flex-start | flex-end | center | space-between | space-around",
6870
- "-webkit-justify-content": "flex-start | flex-end | center | space-between | space-around",
6871
- "left": "<margin-width> | inherit",
6872
- "letter-spacing": "<length> | normal | inherit",
6873
- "line-height": "<number> | <length> | <percentage> | normal | inherit",
6874
- "line-break": "auto | loose | normal | strict",
6875
- "line-stacking": 1,
6876
- "line-stacking-ruby": "exclude-ruby | include-ruby",
6877
- "line-stacking-shift": "consider-shifts | disregard-shifts",
6878
- "line-stacking-strategy": "inline-line-height | block-line-height | max-height | grid-height",
6879
- "list-style": 1,
6880
- "list-style-image": "<uri> | none | inherit",
6881
- "list-style-position": "inside | outside | inherit",
6882
- "list-style-type": "disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none | inherit",
6883
- "margin": { multi: "<margin-width> | inherit", max: 4 },
6884
- "margin-bottom": "<margin-width> | inherit",
6885
- "margin-left": "<margin-width> | inherit",
6886
- "margin-right": "<margin-width> | inherit",
6887
- "margin-top": "<margin-width> | inherit",
6888
- "mark": 1,
6889
- "mark-after": 1,
6890
- "mark-before": 1,
6891
- "marks": 1,
6892
- "marquee-direction": 1,
6893
- "marquee-play-count": 1,
6894
- "marquee-speed": 1,
6895
- "marquee-style": 1,
6896
- "max-height": "<length> | <percentage> | <content-sizing> | none | inherit",
6897
- "max-width": "<length> | <percentage> | <content-sizing> | none | inherit",
6898
- "min-height": "<length> | <percentage> | <content-sizing> | contain-floats | -moz-contain-floats | -webkit-contain-floats | inherit",
6899
- "min-width": "<length> | <percentage> | <content-sizing> | contain-floats | -moz-contain-floats | -webkit-contain-floats | inherit",
6900
- "move-to": 1,
6901
- "nav-down": 1,
6902
- "nav-index": 1,
6903
- "nav-left": 1,
6904
- "nav-right": 1,
6905
- "nav-up": 1,
6906
- "object-fit": "fill | contain | cover | none | scale-down",
6907
- "object-position": "<bg-position>",
6908
- "opacity": "<number> | inherit",
6909
- "order": "<integer>",
6910
- "-webkit-order": "<integer>",
6911
- "orphans": "<integer> | inherit",
6912
- "outline": 1,
6913
- "outline-color": "<color> | invert | inherit",
6914
- "outline-offset": 1,
6915
- "outline-style": "<border-style> | inherit",
6916
- "outline-width": "<border-width> | inherit",
6917
- "overflow": "visible | hidden | scroll | auto | inherit",
6918
- "overflow-style": 1,
6919
- "overflow-wrap": "normal | break-word",
6920
- "overflow-x": 1,
6921
- "overflow-y": 1,
6922
- "padding": { multi: "<padding-width> | inherit", max: 4 },
6923
- "padding-bottom": "<padding-width> | inherit",
6924
- "padding-left": "<padding-width> | inherit",
6925
- "padding-right": "<padding-width> | inherit",
6926
- "padding-top": "<padding-width> | inherit",
6927
- "page": 1,
6928
- "page-break-after": "auto | always | avoid | left | right | inherit",
6929
- "page-break-before": "auto | always | avoid | left | right | inherit",
6930
- "page-break-inside": "auto | avoid | inherit",
6931
- "page-policy": 1,
6932
- "pause": 1,
6933
- "pause-after": 1,
6934
- "pause-before": 1,
6935
- "perspective": 1,
6936
- "perspective-origin": 1,
6937
- "phonemes": 1,
6938
- "pitch": 1,
6939
- "pitch-range": 1,
6940
- "play-during": 1,
6941
- "pointer-events": "auto | none | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | inherit",
6942
- "position": "static | relative | absolute | fixed | inherit",
6943
- "presentation-level": 1,
6944
- "punctuation-trim": 1,
6945
- "quotes": 1,
6946
- "rendering-intent": 1,
6947
- "resize": 1,
6948
- "rest": 1,
6949
- "rest-after": 1,
6950
- "rest-before": 1,
6951
- "richness": 1,
6952
- "right": "<margin-width> | inherit",
6953
- "rotation": 1,
6954
- "rotation-point": 1,
6955
- "ruby-align": 1,
6956
- "ruby-overhang": 1,
6957
- "ruby-position": 1,
6958
- "ruby-span": 1,
6959
- "size": 1,
6960
- "speak": "normal | none | spell-out | inherit",
6961
- "speak-header": "once | always | inherit",
6962
- "speak-numeral": "digits | continuous | inherit",
6963
- "speak-punctuation": "code | none | inherit",
6964
- "speech-rate": 1,
6965
- "src": 1,
6966
- "stress": 1,
6967
- "string-set": 1,
6968
- "table-layout": "auto | fixed | inherit",
6969
- "tab-size": "<integer> | <length>",
6970
- "target": 1,
6971
- "target-name": 1,
6972
- "target-new": 1,
6973
- "target-position": 1,
6974
- "text-align": "left | right | center | justify | match-parent | start | end | inherit",
6975
- "text-align-last": 1,
6976
- "text-decoration": 1,
6977
- "text-emphasis": 1,
6978
- "text-height": 1,
6979
- "text-indent": "<length> | <percentage> | inherit",
6980
- "text-justify": "auto | none | inter-word | inter-ideograph | inter-cluster | distribute | kashida",
6981
- "text-outline": 1,
6982
- "text-overflow": 1,
6983
- "text-rendering": "auto | optimizeSpeed | optimizeLegibility | geometricPrecision | inherit",
6984
- "text-shadow": 1,
6985
- "text-transform": "capitalize | uppercase | lowercase | none | inherit",
6986
- "text-wrap": "normal | none | avoid",
6987
- "top": "<margin-width> | inherit",
6988
- "-ms-touch-action": "auto | none | pan-x | pan-y | pan-left | pan-right | pan-up | pan-down | manipulation",
6989
- "touch-action": "auto | none | pan-x | pan-y | pan-left | pan-right | pan-up | pan-down | manipulation",
6990
- "transform": 1,
6991
- "transform-origin": 1,
6992
- "transform-style": 1,
6993
- "transition": 1,
6994
- "transition-delay": 1,
6995
- "transition-duration": 1,
6996
- "transition-property": 1,
6997
- "transition-timing-function": 1,
6998
- "unicode-bidi": "normal | embed | isolate | bidi-override | isolate-override | plaintext | inherit",
6999
- "user-modify": "read-only | read-write | write-only | inherit",
7000
- "user-select": "none | text | toggle | element | elements | all | inherit",
7001
- "vertical-align": "auto | use-script | baseline | sub | super | top | text-top | central | middle | bottom | text-bottom | <percentage> | <length> | inherit",
7002
- "visibility": "visible | hidden | collapse | inherit",
7003
- "voice-balance": 1,
7004
- "voice-duration": 1,
7005
- "voice-family": 1,
7006
- "voice-pitch": 1,
7007
- "voice-pitch-range": 1,
7008
- "voice-rate": 1,
7009
- "voice-stress": 1,
7010
- "voice-volume": 1,
7011
- "volume": 1,
7012
- "white-space": "normal | pre | nowrap | pre-wrap | pre-line | inherit | -pre-wrap | -o-pre-wrap | -moz-pre-wrap | -hp-pre-wrap",
7013
- "white-space-collapse": 1,
7014
- "widows": "<integer> | inherit",
7015
- "width": "<length> | <percentage> | <content-sizing> | auto | inherit",
7016
- "will-change": { multi: "<ident>", comma: true },
7017
- "word-break": "normal | keep-all | break-all",
7018
- "word-spacing": "<length> | normal | inherit",
7019
- "word-wrap": "normal | break-word",
7020
- "writing-mode": "horizontal-tb | vertical-rl | vertical-lr | lr-tb | rl-tb | tb-rl | bt-rl | tb-lr | bt-lr | lr-bt | rl-bt | lr | rl | tb | inherit",
7021
- "z-index": "<integer> | auto | inherit",
7022
- "zoom": "<number> | <percentage> | normal"
7023
- };
7024
- function PropertyName(text, hack, line, col) {
7025
- SyntaxUnit.call(this, text, line, col, Parser.PROPERTY_NAME_TYPE);
7026
- this.hack = hack;
7027
- }
7028
- PropertyName.prototype = new SyntaxUnit();
7029
- PropertyName.prototype.constructor = PropertyName;
7030
- PropertyName.prototype.toString = function() {
7031
- return (this.hack ? this.hack : "") + this.text;
7032
- };
7033
- function PropertyValue(parts, line, col) {
7034
- SyntaxUnit.call(this, parts.join(" "), line, col, Parser.PROPERTY_VALUE_TYPE);
7035
- this.parts = parts;
7036
- }
7037
- PropertyValue.prototype = new SyntaxUnit();
7038
- PropertyValue.prototype.constructor = PropertyValue;
7039
- function PropertyValueIterator(value) {
7040
- this._i = 0;
7041
- this._parts = value.parts;
7042
- this._marks = [];
7043
- this.value = value;
7044
- }
7045
- PropertyValueIterator.prototype.count = function() {
7046
- return this._parts.length;
7047
- };
7048
- PropertyValueIterator.prototype.isFirst = function() {
7049
- return this._i === 0;
7050
- };
7051
- PropertyValueIterator.prototype.hasNext = function() {
7052
- return this._i < this._parts.length;
7053
- };
7054
- PropertyValueIterator.prototype.mark = function() {
7055
- this._marks.push(this._i);
7056
- };
7057
- PropertyValueIterator.prototype.peek = function(count) {
7058
- return this.hasNext() ? this._parts[this._i + (count || 0)] : null;
7059
- };
7060
- PropertyValueIterator.prototype.next = function() {
7061
- return this.hasNext() ? this._parts[this._i++] : null;
7062
- };
7063
- PropertyValueIterator.prototype.previous = function() {
7064
- return this._i > 0 ? this._parts[--this._i] : null;
7065
- };
7066
- PropertyValueIterator.prototype.restore = function() {
7067
- if (this._marks.length) {
7068
- this._i = this._marks.pop();
7069
- }
7070
- };
7071
- function PropertyValuePart(text, line, col) {
7072
- SyntaxUnit.call(this, text, line, col, Parser.PROPERTY_VALUE_PART_TYPE);
7073
- this.type = "unknown";
7074
- var temp;
7075
- if (/^([+\-]?[\d\.]+)([a-z]+)$/i.test(text)) {
7076
- this.type = "dimension";
7077
- this.value = +RegExp.$1;
7078
- this.units = RegExp.$2;
7079
- switch (this.units.toLowerCase()) {
7080
- case "em":
7081
- case "rem":
7082
- case "ex":
7083
- case "px":
7084
- case "cm":
7085
- case "mm":
7086
- case "in":
7087
- case "pt":
7088
- case "pc":
7089
- case "ch":
7090
- case "vh":
7091
- case "vw":
7092
- case "vmax":
7093
- case "vmin":
7094
- this.type = "length";
7095
- break;
7096
- case "fr":
7097
- this.type = "grid";
7098
- break;
7099
- case "deg":
7100
- case "rad":
7101
- case "grad":
7102
- this.type = "angle";
7103
- break;
7104
- case "ms":
7105
- case "s":
7106
- this.type = "time";
7107
- break;
7108
- case "hz":
7109
- case "khz":
7110
- this.type = "frequency";
7111
- break;
7112
- case "dpi":
7113
- case "dpcm":
7114
- this.type = "resolution";
7115
- break;
7116
- }
7117
- } else if (/^([+\-]?[\d\.]+)%$/i.test(text)) {
7118
- this.type = "percentage";
7119
- this.value = +RegExp.$1;
7120
- } else if (/^([+\-]?\d+)$/i.test(text)) {
7121
- this.type = "integer";
7122
- this.value = +RegExp.$1;
7123
- } else if (/^([+\-]?[\d\.]+)$/i.test(text)) {
7124
- this.type = "number";
7125
- this.value = +RegExp.$1;
7126
- } else if (/^#([a-f0-9]{3,6})/i.test(text)) {
7127
- this.type = "color";
7128
- temp = RegExp.$1;
7129
- if (temp.length === 3) {
7130
- this.red = parseInt(temp.charAt(0) + temp.charAt(0), 16);
7131
- this.green = parseInt(temp.charAt(1) + temp.charAt(1), 16);
7132
- this.blue = parseInt(temp.charAt(2) + temp.charAt(2), 16);
7133
- } else {
7134
- this.red = parseInt(temp.substring(0, 2), 16);
7135
- this.green = parseInt(temp.substring(2, 4), 16);
7136
- this.blue = parseInt(temp.substring(4, 6), 16);
7137
- }
7138
- } else if (/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i.test(text)) {
7139
- this.type = "color";
7140
- this.red = +RegExp.$1;
7141
- this.green = +RegExp.$2;
7142
- this.blue = +RegExp.$3;
7143
- } else if (/^rgb\(\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)/i.test(text)) {
7144
- this.type = "color";
7145
- this.red = +RegExp.$1 * 255 / 100;
7146
- this.green = +RegExp.$2 * 255 / 100;
7147
- this.blue = +RegExp.$3 * 255 / 100;
7148
- } else if (/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\s*\)/i.test(text)) {
7149
- this.type = "color";
7150
- this.red = +RegExp.$1;
7151
- this.green = +RegExp.$2;
7152
- this.blue = +RegExp.$3;
7153
- this.alpha = +RegExp.$4;
7154
- } else if (/^rgba\(\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d\.]+)\s*\)/i.test(text)) {
7155
- this.type = "color";
7156
- this.red = +RegExp.$1 * 255 / 100;
7157
- this.green = +RegExp.$2 * 255 / 100;
7158
- this.blue = +RegExp.$3 * 255 / 100;
7159
- this.alpha = +RegExp.$4;
7160
- } else if (/^hsl\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)/i.test(text)) {
7161
- this.type = "color";
7162
- this.hue = +RegExp.$1;
7163
- this.saturation = +RegExp.$2 / 100;
7164
- this.lightness = +RegExp.$3 / 100;
7165
- } else if (/^hsla\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d\.]+)\s*\)/i.test(text)) {
7166
- this.type = "color";
7167
- this.hue = +RegExp.$1;
7168
- this.saturation = +RegExp.$2 / 100;
7169
- this.lightness = +RegExp.$3 / 100;
7170
- this.alpha = +RegExp.$4;
7171
- } else if (/^url\(["']?([^\)"']+)["']?\)/i.test(text)) {
7172
- this.type = "uri";
7173
- this.uri = RegExp.$1;
7174
- } else if (/^([^\(]+)\(/i.test(text)) {
7175
- this.type = "function";
7176
- this.name = RegExp.$1;
7177
- this.value = text;
7178
- } else if (/^"([^\n\r\f\\"]|\\\r\n|\\[^\r0-9a-f]|\\[0-9a-f]{1,6}(\r\n|[ \n\r\t\f])?)*"/i.test(text)) {
7179
- this.type = "string";
7180
- this.value = PropertyValuePart.parseString(text);
7181
- } else if (/^'([^\n\r\f\\']|\\\r\n|\\[^\r0-9a-f]|\\[0-9a-f]{1,6}(\r\n|[ \n\r\t\f])?)*'/i.test(text)) {
7182
- this.type = "string";
7183
- this.value = PropertyValuePart.parseString(text);
7184
- } else if (Colors[text.toLowerCase()]) {
7185
- this.type = "color";
7186
- temp = Colors[text.toLowerCase()].substring(1);
7187
- this.red = parseInt(temp.substring(0, 2), 16);
7188
- this.green = parseInt(temp.substring(2, 4), 16);
7189
- this.blue = parseInt(temp.substring(4, 6), 16);
7190
- } else if (/^[\,\/]$/.test(text)) {
7191
- this.type = "operator";
7192
- this.value = text;
7193
- } else if (/^[a-z\-_\u0080-\uFFFF][a-z0-9\-_\u0080-\uFFFF]*$/i.test(text)) {
7194
- this.type = "identifier";
7195
- this.value = text;
7196
- }
7197
- }
7198
- PropertyValuePart.prototype = new SyntaxUnit();
7199
- PropertyValuePart.prototype.constructor = PropertyValuePart;
7200
- PropertyValuePart.parseString = function(str) {
7201
- str = str.slice(1, -1);
7202
- var replacer = function(match, esc) {
7203
- if (/^(\n|\r\n|\r|\f)$/.test(esc)) {
7204
- return "";
7205
- }
7206
- var m = /^[0-9a-f]{1,6}/i.exec(esc);
7207
- if (m) {
7208
- var codePoint = parseInt(m[0], 16);
7209
- if (String.fromCodePoint) {
7210
- return String.fromCodePoint(codePoint);
7211
- } else {
7212
- return String.fromCharCode(codePoint);
7213
- }
7214
- }
7215
- return esc;
7216
- };
7217
- return str.replace(
7218
- /\\(\r\n|[^\r0-9a-f]|[0-9a-f]{1,6}(\r\n|[ \n\r\t\f])?)/ig,
7219
- replacer
7220
- );
7221
- };
7222
- PropertyValuePart.serializeString = function(value) {
7223
- var replacer = function(match, c) {
7224
- if (c === '"') {
7225
- return "\\" + c;
7226
- }
7227
- var cp = String.codePointAt ? String.codePointAt(0) : String.charCodeAt(0);
7228
- return "\\" + cp.toString(16) + " ";
7229
- };
7230
- return '"' + value.replace(/["\r\n\f]/g, replacer) + '"';
7231
- };
7232
- PropertyValuePart.fromToken = function(token) {
7233
- return new PropertyValuePart(token.value, token.startLine, token.startCol);
7234
- };
7235
- var Pseudos = {
7236
- __proto__: null,
7237
- ":first-letter": 1,
7238
- ":first-line": 1,
7239
- ":before": 1,
7240
- ":after": 1
7241
- };
7242
- Pseudos.ELEMENT = 1;
7243
- Pseudos.CLASS = 2;
7244
- Pseudos.isElement = function(pseudo) {
7245
- return pseudo.indexOf("::") === 0 || Pseudos[pseudo.toLowerCase()] === Pseudos.ELEMENT;
7246
- };
7247
- function Selector(parts, line, col) {
7248
- SyntaxUnit.call(this, parts.join(" "), line, col, Parser.SELECTOR_TYPE);
7249
- this.parts = parts;
7250
- this.specificity = Specificity.calculate(this);
7251
- }
7252
- Selector.prototype = new SyntaxUnit();
7253
- Selector.prototype.constructor = Selector;
7254
- function SelectorPart(elementName, modifiers, text, line, col) {
7255
- SyntaxUnit.call(this, text, line, col, Parser.SELECTOR_PART_TYPE);
7256
- this.elementName = elementName;
7257
- this.modifiers = modifiers;
7258
- }
7259
- SelectorPart.prototype = new SyntaxUnit();
7260
- SelectorPart.prototype.constructor = SelectorPart;
7261
- function SelectorSubPart(text, type, line, col) {
7262
- SyntaxUnit.call(this, text, line, col, Parser.SELECTOR_SUB_PART_TYPE);
7263
- this.type = type;
7264
- this.args = [];
7265
- }
7266
- SelectorSubPart.prototype = new SyntaxUnit();
7267
- SelectorSubPart.prototype.constructor = SelectorSubPart;
7268
- function Specificity(a, b, c, d) {
7269
- this.a = a;
7270
- this.b = b;
7271
- this.c = c;
7272
- this.d = d;
7273
- }
7274
- Specificity.prototype = {
7275
- constructor: Specificity,
7276
- compare: function(other) {
7277
- var comps = ["a", "b", "c", "d"], i, len;
7278
- for (i = 0, len = comps.length; i < len; i++) {
7279
- if (this[comps[i]] < other[comps[i]]) {
7280
- return -1;
7281
- } else if (this[comps[i]] > other[comps[i]]) {
7282
- return 1;
7283
- }
7284
- }
7285
- return 0;
7286
- },
7287
- valueOf: function() {
7288
- return this.a * 1e3 + this.b * 100 + this.c * 10 + this.d;
7289
- },
7290
- toString: function() {
7291
- return this.a + "," + this.b + "," + this.c + "," + this.d;
7292
- }
7293
- };
7294
- Specificity.calculate = function(selector) {
7295
- var i, len, part, b = 0, c = 0, d = 0;
7296
- function updateValues(part2) {
7297
- var i2, j, len2, num, elementName = part2.elementName ? part2.elementName.text : "", modifier;
7298
- if (elementName && elementName.charAt(elementName.length - 1) !== "*") {
7299
- d++;
7300
- }
7301
- for (i2 = 0, len2 = part2.modifiers.length; i2 < len2; i2++) {
7302
- modifier = part2.modifiers[i2];
7303
- switch (modifier.type) {
7304
- case "class":
7305
- case "attribute":
7306
- c++;
7307
- break;
7308
- case "id":
7309
- b++;
7310
- break;
7311
- case "pseudo":
7312
- if (Pseudos.isElement(modifier.text)) {
7313
- d++;
7314
- } else {
7315
- c++;
7316
- }
7317
- break;
7318
- case "not":
7319
- for (j = 0, num = modifier.args.length; j < num; j++) {
7320
- updateValues(modifier.args[j]);
7321
- }
7322
- }
7323
- }
7324
- }
7325
- for (i = 0, len = selector.parts.length; i < len; i++) {
7326
- part = selector.parts[i];
7327
- if (part instanceof SelectorPart) {
7328
- updateValues(part);
7329
- }
7330
- }
7331
- return new Specificity(0, b, c, d);
7332
- };
7333
- var h = /^[0-9a-fA-F]$/, nl = /\n|\r\n|\r|\f/;
7334
- function isHexDigit(c) {
7335
- return c !== null && h.test(c);
7336
- }
7337
- function isDigit(c) {
7338
- return c !== null && /\d/.test(c);
7339
- }
7340
- function isWhitespace(c) {
7341
- return c !== null && /\s/.test(c);
7342
- }
7343
- function isNewLine(c) {
7344
- return c !== null && nl.test(c);
7345
- }
7346
- function isNameStart(c) {
7347
- return c !== null && /[a-z_\u0080-\uFFFF\\]/i.test(c);
7348
- }
7349
- function isNameChar(c) {
7350
- return c !== null && (isNameStart(c) || /[0-9\-\\]/.test(c));
7351
- }
7352
- function isIdentStart(c) {
7353
- return c !== null && (isNameStart(c) || /\-\\/.test(c));
7354
- }
7355
- function mix(receiver, supplier) {
7356
- for (var prop in supplier) {
7357
- if (Object.prototype.hasOwnProperty.call(supplier, prop)) {
7358
- receiver[prop] = supplier[prop];
7359
- }
7360
- }
7361
- return receiver;
7362
- }
7363
- function TokenStream(input) {
7364
- TokenStreamBase.call(this, input, Tokens);
7365
- }
7366
- TokenStream.prototype = mix(new TokenStreamBase(), {
7367
- _getToken: function(channel) {
7368
- var c, reader = this._reader, token = null, startLine = reader.getLine(), startCol = reader.getCol();
7369
- c = reader.read();
7370
- while (c) {
7371
- switch (c) {
7372
- case "/":
7373
- if (reader.peek() === "*") {
7374
- token = this.commentToken(c, startLine, startCol);
7375
- } else {
7376
- token = this.charToken(c, startLine, startCol);
7377
- }
7378
- break;
7379
- case "|":
7380
- case "~":
7381
- case "^":
7382
- case "$":
7383
- case "*":
7384
- if (reader.peek() === "=") {
7385
- token = this.comparisonToken(c, startLine, startCol);
7386
- } else {
7387
- token = this.charToken(c, startLine, startCol);
7388
- }
7389
- break;
7390
- case '"':
7391
- case "'":
7392
- token = this.stringToken(c, startLine, startCol);
7393
- break;
7394
- case "#":
7395
- if (isNameChar(reader.peek())) {
7396
- token = this.hashToken(c, startLine, startCol);
7397
- } else {
7398
- token = this.charToken(c, startLine, startCol);
7399
- }
7400
- break;
7401
- case ".":
7402
- if (isDigit(reader.peek())) {
7403
- token = this.numberToken(c, startLine, startCol);
7404
- } else {
7405
- token = this.charToken(c, startLine, startCol);
7406
- }
7407
- break;
7408
- case "-":
7409
- if (reader.peek() === "-") {
7410
- token = this.htmlCommentEndToken(c, startLine, startCol);
7411
- } else if (isNameStart(reader.peek())) {
7412
- token = this.identOrFunctionToken(c, startLine, startCol);
7413
- } else {
7414
- token = this.charToken(c, startLine, startCol);
7415
- }
7416
- break;
7417
- case "!":
7418
- token = this.importantToken(c, startLine, startCol);
7419
- break;
7420
- case "@":
7421
- token = this.atRuleToken(c, startLine, startCol);
7422
- break;
7423
- case ":":
7424
- token = this.notToken(c, startLine, startCol);
7425
- break;
7426
- case "<":
7427
- token = this.htmlCommentStartToken(c, startLine, startCol);
7428
- break;
7429
- case "U":
7430
- case "u":
7431
- if (reader.peek() === "+") {
7432
- token = this.unicodeRangeToken(c, startLine, startCol);
7433
- break;
7434
- }
7435
- default:
7436
- if (isDigit(c)) {
7437
- token = this.numberToken(c, startLine, startCol);
7438
- } else if (isWhitespace(c)) {
7439
- token = this.whitespaceToken(c, startLine, startCol);
7440
- } else if (isIdentStart(c)) {
7441
- token = this.identOrFunctionToken(c, startLine, startCol);
7442
- } else {
7443
- token = this.charToken(c, startLine, startCol);
7444
- }
7445
- }
7446
- break;
7447
- }
7448
- if (!token && c === null) {
7449
- token = this.createToken(Tokens.EOF, null, startLine, startCol);
7450
- }
7451
- return token;
7452
- },
7453
- createToken: function(tt, value, startLine, startCol, options) {
7454
- var reader = this._reader;
7455
- options = options || {};
7456
- return {
7457
- value,
7458
- type: tt,
7459
- channel: options.channel,
7460
- endChar: options.endChar,
7461
- hide: options.hide || false,
7462
- startLine,
7463
- startCol,
7464
- endLine: reader.getLine(),
7465
- endCol: reader.getCol()
7466
- };
7467
- },
7468
- atRuleToken: function(first, startLine, startCol) {
7469
- var rule = first, reader = this._reader, tt = Tokens.CHAR, ident;
7470
- reader.mark();
7471
- ident = this.readName();
7472
- rule = first + ident;
7473
- tt = Tokens.type(rule.toLowerCase());
7474
- if (tt === Tokens.CHAR || tt === Tokens.UNKNOWN) {
7475
- if (rule.length > 1) {
7476
- tt = Tokens.UNKNOWN_SYM;
7477
- } else {
7478
- tt = Tokens.CHAR;
7479
- rule = first;
7480
- reader.reset();
7481
- }
7482
- }
7483
- return this.createToken(tt, rule, startLine, startCol);
7484
- },
7485
- charToken: function(c, startLine, startCol) {
7486
- var tt = Tokens.type(c);
7487
- var opts = {};
7488
- if (tt === -1) {
7489
- tt = Tokens.CHAR;
7490
- } else {
7491
- opts.endChar = Tokens[tt].endChar;
7492
- }
7493
- return this.createToken(tt, c, startLine, startCol, opts);
7494
- },
7495
- commentToken: function(first, startLine, startCol) {
7496
- var comment = this.readComment(first);
7497
- return this.createToken(Tokens.COMMENT, comment, startLine, startCol);
7498
- },
7499
- comparisonToken: function(c, startLine, startCol) {
7500
- var reader = this._reader, comparison = c + reader.read(), tt = Tokens.type(comparison) || Tokens.CHAR;
7501
- return this.createToken(tt, comparison, startLine, startCol);
7502
- },
7503
- hashToken: function(first, startLine, startCol) {
7504
- var name = this.readName(first);
7505
- return this.createToken(Tokens.HASH, name, startLine, startCol);
7506
- },
7507
- htmlCommentStartToken: function(first, startLine, startCol) {
7508
- var reader = this._reader, text = first;
7509
- reader.mark();
7510
- text += reader.readCount(3);
7511
- if (text === "<!--") {
7512
- return this.createToken(Tokens.CDO, text, startLine, startCol);
7513
- } else {
7514
- reader.reset();
7515
- return this.charToken(first, startLine, startCol);
7516
- }
7517
- },
7518
- htmlCommentEndToken: function(first, startLine, startCol) {
7519
- var reader = this._reader, text = first;
7520
- reader.mark();
7521
- text += reader.readCount(2);
7522
- if (text === "-->") {
7523
- return this.createToken(Tokens.CDC, text, startLine, startCol);
7524
- } else {
7525
- reader.reset();
7526
- return this.charToken(first, startLine, startCol);
7527
- }
7528
- },
7529
- identOrFunctionToken: function(first, startLine, startCol) {
7530
- var reader = this._reader, ident = this.readName(first), tt = Tokens.IDENT, uriFns = ["url(", "url-prefix(", "domain("];
7531
- if (reader.peek() === "(") {
7532
- ident += reader.read();
7533
- if (uriFns.indexOf(ident.toLowerCase()) > -1) {
7534
- tt = Tokens.URI;
7535
- ident = this.readURI(ident);
7536
- if (uriFns.indexOf(ident.toLowerCase()) > -1) {
7537
- tt = Tokens.FUNCTION;
7538
- }
7539
- } else {
7540
- tt = Tokens.FUNCTION;
7541
- }
7542
- } else if (reader.peek() === ":") {
7543
- if (ident.toLowerCase() === "progid") {
7544
- ident += reader.readTo("(");
7545
- tt = Tokens.IE_FUNCTION;
7546
- }
7547
- }
7548
- return this.createToken(tt, ident, startLine, startCol);
7549
- },
7550
- importantToken: function(first, startLine, startCol) {
7551
- var reader = this._reader, important = first, tt = Tokens.CHAR, temp, c;
7552
- reader.mark();
7553
- c = reader.read();
7554
- while (c) {
7555
- if (c === "/") {
7556
- if (reader.peek() !== "*") {
7557
- break;
7558
- } else {
7559
- temp = this.readComment(c);
7560
- if (temp === "") {
7561
- break;
7562
- }
7563
- }
7564
- } else if (isWhitespace(c)) {
7565
- important += c + this.readWhitespace();
7566
- } else if (/i/i.test(c)) {
7567
- temp = reader.readCount(8);
7568
- if (/mportant/i.test(temp)) {
7569
- important += c + temp;
7570
- tt = Tokens.IMPORTANT_SYM;
7571
- }
7572
- break;
7573
- } else {
7574
- break;
7575
- }
7576
- c = reader.read();
7577
- }
7578
- if (tt === Tokens.CHAR) {
7579
- reader.reset();
7580
- return this.charToken(first, startLine, startCol);
7581
- } else {
7582
- return this.createToken(tt, important, startLine, startCol);
7583
- }
7584
- },
7585
- notToken: function(first, startLine, startCol) {
7586
- var reader = this._reader, text = first;
7587
- reader.mark();
7588
- text += reader.readCount(4);
7589
- if (text.toLowerCase() === ":not(") {
7590
- return this.createToken(Tokens.NOT, text, startLine, startCol);
7591
- } else {
7592
- reader.reset();
7593
- return this.charToken(first, startLine, startCol);
7594
- }
7595
- },
7596
- numberToken: function(first, startLine, startCol) {
7597
- var reader = this._reader, value = this.readNumber(first), ident, tt = Tokens.NUMBER, c = reader.peek();
7598
- if (isIdentStart(c)) {
7599
- ident = this.readName(reader.read());
7600
- value += ident;
7601
- if (/^em$|^ex$|^px$|^gd$|^rem$|^vw$|^vh$|^vmax$|^vmin$|^ch$|^cm$|^mm$|^in$|^pt$|^pc$/i.test(ident)) {
7602
- tt = Tokens.LENGTH;
7603
- } else if (/^deg|^rad$|^grad$/i.test(ident)) {
7604
- tt = Tokens.ANGLE;
7605
- } else if (/^ms$|^s$/i.test(ident)) {
7606
- tt = Tokens.TIME;
7607
- } else if (/^hz$|^khz$/i.test(ident)) {
7608
- tt = Tokens.FREQ;
7609
- } else if (/^dpi$|^dpcm$/i.test(ident)) {
7610
- tt = Tokens.RESOLUTION;
7611
- } else {
7612
- tt = Tokens.DIMENSION;
7613
- }
7614
- } else if (c === "%") {
7615
- value += reader.read();
7616
- tt = Tokens.PERCENTAGE;
7617
- }
7618
- return this.createToken(tt, value, startLine, startCol);
7619
- },
7620
- stringToken: function(first, startLine, startCol) {
7621
- var delim = first, string = first, reader = this._reader, prev = first, tt = Tokens.STRING, c = reader.read();
7622
- while (c) {
7623
- string += c;
7624
- if (c === delim && prev !== "\\") {
7625
- break;
7626
- }
7627
- if (isNewLine(reader.peek()) && c !== "\\") {
7628
- tt = Tokens.INVALID;
7629
- break;
7630
- }
7631
- prev = c;
7632
- c = reader.read();
7633
- }
7634
- if (c === null) {
7635
- tt = Tokens.INVALID;
7636
- }
7637
- return this.createToken(tt, string, startLine, startCol);
7638
- },
7639
- unicodeRangeToken: function(first, startLine, startCol) {
7640
- var reader = this._reader, value = first, temp, tt = Tokens.CHAR;
7641
- if (reader.peek() === "+") {
7642
- reader.mark();
7643
- value += reader.read();
7644
- value += this.readUnicodeRangePart(true);
7645
- if (value.length === 2) {
7646
- reader.reset();
7647
- } else {
7648
- tt = Tokens.UNICODE_RANGE;
7649
- if (value.indexOf("?") === -1) {
7650
- if (reader.peek() === "-") {
7651
- reader.mark();
7652
- temp = reader.read();
7653
- temp += this.readUnicodeRangePart(false);
7654
- if (temp.length === 1) {
7655
- reader.reset();
7656
- } else {
7657
- value += temp;
7658
- }
7659
- }
7660
- }
7661
- }
7662
- }
7663
- return this.createToken(tt, value, startLine, startCol);
7664
- },
7665
- whitespaceToken: function(first, startLine, startCol) {
7666
- var value = first + this.readWhitespace();
7667
- return this.createToken(Tokens.S, value, startLine, startCol);
7668
- },
7669
- readUnicodeRangePart: function(allowQuestionMark) {
7670
- var reader = this._reader, part = "", c = reader.peek();
7671
- while (isHexDigit(c) && part.length < 6) {
7672
- reader.read();
7673
- part += c;
7674
- c = reader.peek();
7675
- }
7676
- if (allowQuestionMark) {
7677
- while (c === "?" && part.length < 6) {
7678
- reader.read();
7679
- part += c;
7680
- c = reader.peek();
7681
- }
7682
- }
7683
- return part;
7684
- },
7685
- readWhitespace: function() {
7686
- var reader = this._reader, whitespace = "", c = reader.peek();
7687
- while (isWhitespace(c)) {
7688
- reader.read();
7689
- whitespace += c;
7690
- c = reader.peek();
7691
- }
7692
- return whitespace;
7693
- },
7694
- readNumber: function(first) {
7695
- var reader = this._reader, number = first, hasDot = first === ".", c = reader.peek();
7696
- while (c) {
7697
- if (isDigit(c)) {
7698
- number += reader.read();
7699
- } else if (c === ".") {
7700
- if (hasDot) {
7701
- break;
7702
- } else {
7703
- hasDot = true;
7704
- number += reader.read();
7705
- }
7706
- } else {
7707
- break;
7708
- }
7709
- c = reader.peek();
7710
- }
7711
- return number;
7712
- },
7713
- readString: function() {
7714
- var reader = this._reader, delim = reader.read(), string = delim, prev = delim, c = reader.peek();
7715
- while (c) {
7716
- c = reader.read();
7717
- string += c;
7718
- if (c === delim && prev !== "\\") {
7719
- break;
7720
- }
7721
- if (isNewLine(reader.peek()) && c !== "\\") {
7722
- string = "";
7723
- break;
7724
- }
7725
- prev = c;
7726
- c = reader.peek();
7727
- }
7728
- if (c === null) {
7729
- string = "";
7730
- }
7731
- return string;
7732
- },
7733
- readURI: function(first) {
7734
- var reader = this._reader, uri = first, inner = "", c = reader.peek();
7735
- reader.mark();
7736
- while (c && isWhitespace(c)) {
7737
- reader.read();
7738
- c = reader.peek();
7739
- }
7740
- if (c === "'" || c === '"') {
7741
- inner = this.readString();
7742
- } else {
7743
- inner = this.readURL();
7744
- }
7745
- c = reader.peek();
7746
- while (c && isWhitespace(c)) {
7747
- reader.read();
7748
- c = reader.peek();
7749
- }
7750
- if (inner === "" || c !== ")") {
7751
- uri = first;
7752
- reader.reset();
7753
- } else {
7754
- uri += inner + reader.read();
7755
- }
7756
- return uri;
7757
- },
7758
- readURL: function() {
7759
- var reader = this._reader, url = "", c = reader.peek();
7760
- while (/^[!#$%&\\*-~]$/.test(c)) {
7761
- url += reader.read();
7762
- c = reader.peek();
7763
- }
7764
- return url;
7765
- },
7766
- readName: function(first) {
7767
- var reader = this._reader, ident = first || "", c = reader.peek();
7768
- while (true) {
7769
- if (c === "\\") {
7770
- ident += this.readEscape(reader.read());
7771
- c = reader.peek();
7772
- } else if (c && isNameChar(c)) {
7773
- ident += reader.read();
7774
- c = reader.peek();
7775
- } else {
7776
- break;
7777
- }
7778
- }
7779
- return ident;
7780
- },
7781
- readEscape: function(first) {
7782
- var reader = this._reader, cssEscape = first || "", i = 0, c = reader.peek();
7783
- if (isHexDigit(c)) {
7784
- do {
7785
- cssEscape += reader.read();
7786
- c = reader.peek();
7787
- } while (c && isHexDigit(c) && ++i < 6);
7788
- }
7789
- if (cssEscape.length === 3 && /\s/.test(c) || cssEscape.length === 7 || cssEscape.length === 1) {
7790
- reader.read();
7791
- } else {
7792
- c = "";
7793
- }
7794
- return cssEscape + c;
7795
- },
7796
- readComment: function(first) {
7797
- var reader = this._reader, comment = first || "", c = reader.read();
7798
- if (c === "*") {
7799
- while (c) {
7800
- comment += c;
7801
- if (comment.length > 2 && c === "*" && reader.peek() === "/") {
7802
- comment += reader.read();
7803
- break;
7804
- }
7805
- c = reader.read();
7806
- }
7807
- return comment;
7808
- } else {
7809
- return "";
7810
- }
7811
- }
7812
- });
7813
- var Tokens = [
7814
- { name: "CDO" },
7815
- { name: "CDC" },
7816
- { name: "S", whitespace: true },
7817
- { name: "COMMENT", comment: true, hide: true, channel: "comment" },
7818
- { name: "INCLUDES", text: "~=" },
7819
- { name: "DASHMATCH", text: "|=" },
7820
- { name: "PREFIXMATCH", text: "^=" },
7821
- { name: "SUFFIXMATCH", text: "$=" },
7822
- { name: "SUBSTRINGMATCH", text: "*=" },
7823
- { name: "STRING" },
7824
- { name: "IDENT" },
7825
- { name: "HASH" },
7826
- { name: "IMPORT_SYM", text: "@import" },
7827
- { name: "PAGE_SYM", text: "@page" },
7828
- { name: "MEDIA_SYM", text: "@media" },
7829
- { name: "FONT_FACE_SYM", text: "@font-face" },
7830
- { name: "CHARSET_SYM", text: "@charset" },
7831
- { name: "NAMESPACE_SYM", text: "@namespace" },
7832
- { name: "VIEWPORT_SYM", text: ["@viewport", "@-ms-viewport", "@-o-viewport"] },
7833
- { name: "DOCUMENT_SYM", text: ["@document", "@-moz-document"] },
7834
- { name: "UNKNOWN_SYM" },
7835
- { name: "KEYFRAMES_SYM", text: ["@keyframes", "@-webkit-keyframes", "@-moz-keyframes", "@-o-keyframes"] },
7836
- { name: "IMPORTANT_SYM" },
7837
- { name: "LENGTH" },
7838
- { name: "ANGLE" },
7839
- { name: "TIME" },
7840
- { name: "FREQ" },
7841
- { name: "DIMENSION" },
7842
- { name: "PERCENTAGE" },
7843
- { name: "NUMBER" },
7844
- { name: "URI" },
7845
- { name: "FUNCTION" },
7846
- { name: "UNICODE_RANGE" },
7847
- { name: "INVALID" },
7848
- { name: "PLUS", text: "+" },
7849
- { name: "GREATER", text: ">" },
7850
- { name: "COMMA", text: "," },
7851
- { name: "TILDE", text: "~" },
7852
- { name: "NOT" },
7853
- { name: "TOPLEFTCORNER_SYM", text: "@top-left-corner" },
7854
- { name: "TOPLEFT_SYM", text: "@top-left" },
7855
- { name: "TOPCENTER_SYM", text: "@top-center" },
7856
- { name: "TOPRIGHT_SYM", text: "@top-right" },
7857
- { name: "TOPRIGHTCORNER_SYM", text: "@top-right-corner" },
7858
- { name: "BOTTOMLEFTCORNER_SYM", text: "@bottom-left-corner" },
7859
- { name: "BOTTOMLEFT_SYM", text: "@bottom-left" },
7860
- { name: "BOTTOMCENTER_SYM", text: "@bottom-center" },
7861
- { name: "BOTTOMRIGHT_SYM", text: "@bottom-right" },
7862
- { name: "BOTTOMRIGHTCORNER_SYM", text: "@bottom-right-corner" },
7863
- { name: "LEFTTOP_SYM", text: "@left-top" },
7864
- { name: "LEFTMIDDLE_SYM", text: "@left-middle" },
7865
- { name: "LEFTBOTTOM_SYM", text: "@left-bottom" },
7866
- { name: "RIGHTTOP_SYM", text: "@right-top" },
7867
- { name: "RIGHTMIDDLE_SYM", text: "@right-middle" },
7868
- { name: "RIGHTBOTTOM_SYM", text: "@right-bottom" },
7869
- { name: "RESOLUTION", state: "media" },
7870
- { name: "IE_FUNCTION" },
7871
- { name: "CHAR" },
7872
- {
7873
- name: "PIPE",
7874
- text: "|"
7875
- },
7876
- {
7877
- name: "SLASH",
7878
- text: "/"
7879
- },
7880
- {
7881
- name: "MINUS",
7882
- text: "-"
7883
- },
7884
- {
7885
- name: "STAR",
7886
- text: "*"
7887
- },
7888
- {
7889
- name: "LBRACE",
7890
- endChar: "}",
7891
- text: "{"
7892
- },
7893
- {
7894
- name: "RBRACE",
7895
- text: "}"
7896
- },
7897
- {
7898
- name: "LBRACKET",
7899
- endChar: "]",
7900
- text: "["
7901
- },
7902
- {
7903
- name: "RBRACKET",
7904
- text: "]"
7905
- },
7906
- {
7907
- name: "EQUALS",
7908
- text: "="
7909
- },
7910
- {
7911
- name: "COLON",
7912
- text: ":"
7913
- },
7914
- {
7915
- name: "SEMICOLON",
7916
- text: ";"
7917
- },
7918
- {
7919
- name: "LPAREN",
7920
- endChar: ")",
7921
- text: "("
7922
- },
7923
- {
7924
- name: "RPAREN",
7925
- text: ")"
7926
- },
7927
- {
7928
- name: "DOT",
7929
- text: "."
7930
- }
7931
- ];
7932
- (function() {
7933
- var nameMap = [], typeMap = /* @__PURE__ */ Object.create(null);
7934
- Tokens.UNKNOWN = -1;
7935
- Tokens.unshift({ name: "EOF" });
7936
- for (var i = 0, len = Tokens.length; i < len; i++) {
7937
- nameMap.push(Tokens[i].name);
7938
- Tokens[Tokens[i].name] = i;
7939
- if (Tokens[i].text) {
7940
- if (Tokens[i].text instanceof Array) {
7941
- for (var j = 0; j < Tokens[i].text.length; j++) {
7942
- typeMap[Tokens[i].text[j]] = i;
7943
- }
7944
- } else {
7945
- typeMap[Tokens[i].text] = i;
7946
- }
7947
- }
7948
- }
7949
- Tokens.name = function(tt) {
7950
- return nameMap[tt];
7951
- };
7952
- Tokens.type = function(c) {
7953
- return typeMap[c] || -1;
7954
- };
7955
- })();
7956
- var Validation = {
7957
- validate: function(property, value) {
7958
- var name = property.toString().toLowerCase(), expression = new PropertyValueIterator(value), spec = Properties[name];
7959
- if (!spec) {
7960
- if (name.indexOf("-") !== 0) {
7961
- throw new ValidationError("Unknown property '" + property + "'.", property.line, property.col);
7962
- }
7963
- } else if (typeof spec !== "number") {
7964
- if (typeof spec === "string") {
7965
- if (spec.indexOf("||") > -1) {
7966
- this.groupProperty(spec, expression);
7967
- } else {
7968
- this.singleProperty(spec, expression, 1);
7969
- }
7970
- } else if (spec.multi) {
7971
- this.multiProperty(spec.multi, expression, spec.comma, spec.max || Infinity);
7972
- } else if (typeof spec === "function") {
7973
- spec(expression);
7974
- }
7975
- }
7976
- },
7977
- singleProperty: function(types, expression, max, partial) {
7978
- var result = false, value = expression.value, count = 0, part;
7979
- while (expression.hasNext() && count < max) {
7980
- result = ValidationTypes.isAny(expression, types);
7981
- if (!result) {
7982
- break;
7983
- }
7984
- count++;
7985
- }
7986
- if (!result) {
7987
- if (expression.hasNext() && !expression.isFirst()) {
7988
- part = expression.peek();
7989
- throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
7990
- } else {
7991
- throw new ValidationError("Expected (" + types + ") but found '" + value + "'.", value.line, value.col);
4657
+ s += "//";
4658
+ if (this.username || this.password) {
4659
+ s += this.username || "";
4660
+ if (this.password) {
4661
+ s += ":" + this.password;
7992
4662
  }
7993
- } else if (expression.hasNext()) {
7994
- part = expression.next();
7995
- throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
4663
+ s += "@";
7996
4664
  }
7997
- },
7998
- multiProperty: function(types, expression, comma, max) {
7999
- var result = false, value = expression.value, count = 0, part;
8000
- while (expression.hasNext() && !result && count < max) {
8001
- if (ValidationTypes.isAny(expression, types)) {
8002
- count++;
8003
- if (!expression.hasNext()) {
8004
- result = true;
8005
- } else if (comma) {
8006
- if (String(expression.peek()) === ",") {
8007
- part = expression.next();
8008
- } else {
8009
- break;
8010
- }
8011
- }
8012
- } else {
8013
- break;
8014
- }
4665
+ if (this.host) {
4666
+ s += this.host;
8015
4667
  }
8016
- if (!result) {
8017
- if (expression.hasNext() && !expression.isFirst()) {
8018
- part = expression.peek();
8019
- throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
4668
+ }
4669
+ if (this.port !== void 0)
4670
+ s += ":" + this.port;
4671
+ if (this.path !== void 0)
4672
+ s += this.path;
4673
+ if (this.query !== void 0)
4674
+ s += "?" + this.query;
4675
+ if (this.fragment !== void 0)
4676
+ s += "#" + this.fragment;
4677
+ return s;
4678
+ },
4679
+ resolve: function(relative) {
4680
+ var base = this;
4681
+ var r = new URL(relative);
4682
+ var t = new URL();
4683
+ if (r.scheme !== void 0) {
4684
+ t.scheme = r.scheme;
4685
+ t.username = r.username;
4686
+ t.password = r.password;
4687
+ t.host = r.host;
4688
+ t.port = r.port;
4689
+ t.path = remove_dot_segments(r.path);
4690
+ t.query = r.query;
4691
+ } else {
4692
+ t.scheme = base.scheme;
4693
+ if (r.host !== void 0) {
4694
+ t.username = r.username;
4695
+ t.password = r.password;
4696
+ t.host = r.host;
4697
+ t.port = r.port;
4698
+ t.path = remove_dot_segments(r.path);
4699
+ t.query = r.query;
4700
+ } else {
4701
+ t.username = base.username;
4702
+ t.password = base.password;
4703
+ t.host = base.host;
4704
+ t.port = base.port;
4705
+ if (!r.path) {
4706
+ t.path = base.path;
4707
+ if (r.query !== void 0)
4708
+ t.query = r.query;
4709
+ else
4710
+ t.query = base.query;
8020
4711
  } else {
8021
- part = expression.previous();
8022
- if (comma && String(part) === ",") {
8023
- throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
4712
+ if (r.path.charAt(0) === "/") {
4713
+ t.path = remove_dot_segments(r.path);
8024
4714
  } else {
8025
- throw new ValidationError("Expected (" + types + ") but found '" + value + "'.", value.line, value.col);
4715
+ t.path = merge(base.path, r.path);
4716
+ t.path = remove_dot_segments(t.path);
8026
4717
  }
4718
+ t.query = r.query;
8027
4719
  }
8028
- } else if (expression.hasNext()) {
8029
- part = expression.next();
8030
- throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
8031
4720
  }
8032
- },
8033
- groupProperty: function(types, expression, comma) {
8034
- var result = false, value = expression.value, typeCount = types.split("||").length, groups = { count: 0 }, partial = false, name, part;
8035
- while (expression.hasNext() && !result) {
8036
- name = ValidationTypes.isAnyOfGroup(expression, types);
8037
- if (name) {
8038
- if (groups[name]) {
8039
- break;
8040
- } else {
8041
- groups[name] = 1;
8042
- groups.count++;
8043
- partial = true;
8044
- if (groups.count === typeCount || !expression.hasNext()) {
8045
- result = true;
8046
- }
8047
- }
8048
- } else {
4721
+ }
4722
+ t.fragment = r.fragment;
4723
+ return t.toString();
4724
+ function merge(basepath, refpath) {
4725
+ if (base.host !== void 0 && !base.path)
4726
+ return "/" + refpath;
4727
+ var lastslash = basepath.lastIndexOf("/");
4728
+ if (lastslash === -1)
4729
+ return refpath;
4730
+ else
4731
+ return basepath.substring(0, lastslash + 1) + refpath;
4732
+ }
4733
+ function remove_dot_segments(path) {
4734
+ if (!path)
4735
+ return path;
4736
+ var output = "";
4737
+ while (path.length > 0) {
4738
+ if (path === "." || path === "..") {
4739
+ path = "";
8049
4740
  break;
8050
4741
  }
8051
- }
8052
- if (!result) {
8053
- if (partial && expression.hasNext()) {
8054
- part = expression.peek();
8055
- throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
4742
+ var twochars = path.substring(0, 2);
4743
+ var threechars = path.substring(0, 3);
4744
+ var fourchars = path.substring(0, 4);
4745
+ if (threechars === "../") {
4746
+ path = path.substring(3);
4747
+ } else if (twochars === "./") {
4748
+ path = path.substring(2);
4749
+ } else if (threechars === "/./") {
4750
+ path = "/" + path.substring(3);
4751
+ } else if (twochars === "/." && path.length === 2) {
4752
+ path = "/";
4753
+ } else if (fourchars === "/../" || threechars === "/.." && path.length === 3) {
4754
+ path = "/" + path.substring(4);
4755
+ output = output.replace(/\/?[^\/]*$/, "");
8056
4756
  } else {
8057
- throw new ValidationError("Expected (" + types + ") but found '" + value + "'.", value.line, value.col);
4757
+ var segment = path.match(/(\/?([^\/]*))/)[0];
4758
+ output += segment;
4759
+ path = path.substring(segment.length);
8058
4760
  }
8059
- } else if (expression.hasNext()) {
8060
- part = expression.next();
8061
- throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
8062
4761
  }
4762
+ return output;
8063
4763
  }
8064
- };
8065
- function ValidationError(message, line, col) {
8066
- this.col = col;
8067
- this.line = line;
8068
- this.message = message;
8069
- }
8070
- ValidationError.prototype = new Error();
8071
- var ValidationTypes = {
8072
- isLiteral: function(part, literals) {
8073
- var text = part.text.toString().toLowerCase(), args = literals.split(" | "), i, len, found = false;
8074
- for (i = 0, len = args.length; i < len && !found; i++) {
8075
- if (text === args[i].toLowerCase()) {
8076
- found = true;
8077
- }
8078
- }
8079
- return found;
8080
- },
8081
- isSimple: function(type) {
8082
- return !!this.simple[type];
8083
- },
8084
- isComplex: function(type) {
8085
- return !!this.complex[type];
8086
- },
8087
- isAny: function(expression, types) {
8088
- var args = types.split(" | "), i, len, found = false;
8089
- for (i = 0, len = args.length; i < len && !found && expression.hasNext(); i++) {
8090
- found = this.isType(expression, args[i]);
8091
- }
8092
- return found;
8093
- },
8094
- isAnyOfGroup: function(expression, types) {
8095
- var args = types.split(" || "), i, len, found = false;
8096
- for (i = 0, len = args.length; i < len && !found; i++) {
8097
- found = this.isType(expression, args[i]);
8098
- }
8099
- return found ? args[i - 1] : false;
8100
- },
8101
- isType: function(expression, type) {
8102
- var part = expression.peek(), result = false;
8103
- if (type.charAt(0) !== "<") {
8104
- result = this.isLiteral(part, type);
8105
- if (result) {
8106
- expression.next();
8107
- }
8108
- } else if (this.simple[type]) {
8109
- result = this.simple[type](part);
8110
- if (result) {
8111
- expression.next();
8112
- }
8113
- } else {
8114
- result = this.complex[type](expression);
8115
- }
8116
- return result;
8117
- },
8118
- simple: {
8119
- __proto__: null,
8120
- "<absolute-size>": function(part) {
8121
- return ValidationTypes.isLiteral(part, "xx-small | x-small | small | medium | large | x-large | xx-large");
8122
- },
8123
- "<attachment>": function(part) {
8124
- return ValidationTypes.isLiteral(part, "scroll | fixed | local");
8125
- },
8126
- "<attr>": function(part) {
8127
- return part.type === "function" && part.name === "attr";
8128
- },
8129
- "<bg-image>": function(part) {
8130
- return this["<image>"](part) || this["<gradient>"](part) || String(part) === "none";
8131
- },
8132
- "<gradient>": function(part) {
8133
- return part.type === "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial\-|linear\-)?gradient/i.test(part);
8134
- },
8135
- "<box>": function(part) {
8136
- return ValidationTypes.isLiteral(part, "padding-box | border-box | content-box");
8137
- },
8138
- "<content>": function(part) {
8139
- return part.type === "function" && part.name === "content";
8140
- },
8141
- "<relative-size>": function(part) {
8142
- return ValidationTypes.isLiteral(part, "smaller | larger");
8143
- },
8144
- "<ident>": function(part) {
8145
- return part.type === "identifier";
8146
- },
8147
- "<length>": function(part) {
8148
- if (part.type === "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?calc/i.test(part)) {
8149
- return true;
8150
- } else {
8151
- return part.type === "length" || part.type === "number" || part.type === "integer" || String(part) === "0";
8152
- }
8153
- },
8154
- "<color>": function(part) {
8155
- return part.type === "color" || String(part) === "transparent" || String(part) === "currentColor";
8156
- },
8157
- "<number>": function(part) {
8158
- return part.type === "number" || this["<integer>"](part);
8159
- },
8160
- "<integer>": function(part) {
8161
- return part.type === "integer";
8162
- },
8163
- "<line>": function(part) {
8164
- return part.type === "integer";
8165
- },
8166
- "<angle>": function(part) {
8167
- return part.type === "angle";
8168
- },
8169
- "<uri>": function(part) {
8170
- return part.type === "uri";
8171
- },
8172
- "<image>": function(part) {
8173
- return this["<uri>"](part);
8174
- },
8175
- "<percentage>": function(part) {
8176
- return part.type === "percentage" || String(part) === "0";
8177
- },
8178
- "<border-width>": function(part) {
8179
- return this["<length>"](part) || ValidationTypes.isLiteral(part, "thin | medium | thick");
8180
- },
8181
- "<border-style>": function(part) {
8182
- return ValidationTypes.isLiteral(part, "none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset");
8183
- },
8184
- "<content-sizing>": function(part) {
8185
- return ValidationTypes.isLiteral(part, "fill-available | -moz-available | -webkit-fill-available | max-content | -moz-max-content | -webkit-max-content | min-content | -moz-min-content | -webkit-min-content | fit-content | -moz-fit-content | -webkit-fit-content");
8186
- },
8187
- "<margin-width>": function(part) {
8188
- return this["<length>"](part) || this["<percentage>"](part) || ValidationTypes.isLiteral(part, "auto");
8189
- },
8190
- "<padding-width>": function(part) {
8191
- return this["<length>"](part) || this["<percentage>"](part);
8192
- },
8193
- "<shape>": function(part) {
8194
- return part.type === "function" && (part.name === "rect" || part.name === "inset-rect");
8195
- },
8196
- "<time>": function(part) {
8197
- return part.type === "time";
8198
- },
8199
- "<flex-grow>": function(part) {
8200
- return this["<number>"](part);
8201
- },
8202
- "<flex-shrink>": function(part) {
8203
- return this["<number>"](part);
8204
- },
8205
- "<width>": function(part) {
8206
- return this["<margin-width>"](part);
8207
- },
8208
- "<flex-basis>": function(part) {
8209
- return this["<width>"](part);
8210
- },
8211
- "<flex-direction>": function(part) {
8212
- return ValidationTypes.isLiteral(part, "row | row-reverse | column | column-reverse");
8213
- },
8214
- "<flex-wrap>": function(part) {
8215
- return ValidationTypes.isLiteral(part, "nowrap | wrap | wrap-reverse");
8216
- },
8217
- "<feature-tag-value>": function(part) {
8218
- return part.type === "function" && /^[A-Z0-9]{4}$/i.test(part);
8219
- }
8220
- },
8221
- complex: {
8222
- __proto__: null,
8223
- "<bg-position>": function(expression) {
8224
- var result = false, numeric = "<percentage> | <length>", xDir = "left | right", yDir = "top | bottom", count = 0;
8225
- while (expression.peek(count) && expression.peek(count).text !== ",") {
8226
- count++;
8227
- }
8228
- if (count < 3) {
8229
- if (ValidationTypes.isAny(expression, xDir + " | center | " + numeric)) {
8230
- result = true;
8231
- ValidationTypes.isAny(expression, yDir + " | center | " + numeric);
8232
- } else if (ValidationTypes.isAny(expression, yDir)) {
8233
- result = true;
8234
- ValidationTypes.isAny(expression, xDir + " | center");
8235
- }
8236
- } else {
8237
- if (ValidationTypes.isAny(expression, xDir)) {
8238
- if (ValidationTypes.isAny(expression, yDir)) {
8239
- result = true;
8240
- ValidationTypes.isAny(expression, numeric);
8241
- } else if (ValidationTypes.isAny(expression, numeric)) {
8242
- if (ValidationTypes.isAny(expression, yDir)) {
8243
- result = true;
8244
- ValidationTypes.isAny(expression, numeric);
8245
- } else if (ValidationTypes.isAny(expression, "center")) {
8246
- result = true;
8247
- }
8248
- }
8249
- } else if (ValidationTypes.isAny(expression, yDir)) {
8250
- if (ValidationTypes.isAny(expression, xDir)) {
8251
- result = true;
8252
- ValidationTypes.isAny(expression, numeric);
8253
- } else if (ValidationTypes.isAny(expression, numeric)) {
8254
- if (ValidationTypes.isAny(expression, xDir)) {
8255
- result = true;
8256
- ValidationTypes.isAny(expression, numeric);
8257
- } else if (ValidationTypes.isAny(expression, "center")) {
8258
- result = true;
8259
- }
8260
- }
8261
- } else if (ValidationTypes.isAny(expression, "center")) {
8262
- if (ValidationTypes.isAny(expression, xDir + " | " + yDir)) {
8263
- result = true;
8264
- ValidationTypes.isAny(expression, numeric);
8265
- }
8266
- }
8267
- }
8268
- return result;
8269
- },
8270
- "<bg-size>": function(expression) {
8271
- var result = false, numeric = "<percentage> | <length> | auto";
8272
- if (ValidationTypes.isAny(expression, "cover | contain")) {
8273
- result = true;
8274
- } else if (ValidationTypes.isAny(expression, numeric)) {
8275
- result = true;
8276
- ValidationTypes.isAny(expression, numeric);
8277
- }
8278
- return result;
8279
- },
8280
- "<repeat-style>": function(expression) {
8281
- var result = false, values = "repeat | space | round | no-repeat", part;
8282
- if (expression.hasNext()) {
8283
- part = expression.next();
8284
- if (ValidationTypes.isLiteral(part, "repeat-x | repeat-y")) {
8285
- result = true;
8286
- } else if (ValidationTypes.isLiteral(part, values)) {
8287
- result = true;
8288
- if (expression.hasNext() && ValidationTypes.isLiteral(expression.peek(), values)) {
8289
- expression.next();
8290
- }
8291
- }
8292
- }
8293
- return result;
8294
- },
8295
- "<shadow>": function(expression) {
8296
- var result = false, count = 0, inset = false, color = false;
8297
- if (expression.hasNext()) {
8298
- if (ValidationTypes.isAny(expression, "inset")) {
8299
- inset = true;
8300
- }
8301
- if (ValidationTypes.isAny(expression, "<color>")) {
8302
- color = true;
8303
- }
8304
- while (ValidationTypes.isAny(expression, "<length>") && count < 4) {
8305
- count++;
8306
- }
8307
- if (expression.hasNext()) {
8308
- if (!color) {
8309
- ValidationTypes.isAny(expression, "<color>");
8310
- }
8311
- if (!inset) {
8312
- ValidationTypes.isAny(expression, "inset");
8313
- }
8314
- }
8315
- result = count >= 2 && count <= 4;
4764
+ }
4765
+ };
4766
+ }
4767
+ });
4768
+
4769
+ // external/npm/node_modules/domino/lib/CustomEvent.js
4770
+ var require_CustomEvent = __commonJS({
4771
+ "external/npm/node_modules/domino/lib/CustomEvent.js"(exports, module) {
4772
+ "use strict";
4773
+ module.exports = CustomEvent;
4774
+ var Event = require_Event();
4775
+ function CustomEvent(type, dictionary) {
4776
+ Event.call(this, type, dictionary);
4777
+ }
4778
+ CustomEvent.prototype = Object.create(Event.prototype, {
4779
+ constructor: { value: CustomEvent }
4780
+ });
4781
+ }
4782
+ });
4783
+
4784
+ // external/npm/node_modules/domino/lib/events.js
4785
+ var require_events = __commonJS({
4786
+ "external/npm/node_modules/domino/lib/events.js"(exports, module) {
4787
+ "use strict";
4788
+ module.exports = {
4789
+ Event: require_Event(),
4790
+ UIEvent: require_UIEvent(),
4791
+ MouseEvent: require_MouseEvent(),
4792
+ CustomEvent: require_CustomEvent()
4793
+ };
4794
+ }
4795
+ });
4796
+
4797
+ // external/npm/node_modules/domino/lib/style_parser.js
4798
+ var require_style_parser = __commonJS({
4799
+ "external/npm/node_modules/domino/lib/style_parser.js"(exports) {
4800
+ "use strict";
4801
+ Object.defineProperty(exports, "__esModule", { value: true });
4802
+ exports.hyphenate = exports.parse = void 0;
4803
+ function parse(value) {
4804
+ const styles = [];
4805
+ let i = 0;
4806
+ let parenDepth = 0;
4807
+ let quote = 0;
4808
+ let valueStart = 0;
4809
+ let propStart = 0;
4810
+ let currentProp = null;
4811
+ while (i < value.length) {
4812
+ const token = value.charCodeAt(i++);
4813
+ switch (token) {
4814
+ case 40:
4815
+ parenDepth++;
4816
+ break;
4817
+ case 41:
4818
+ parenDepth--;
4819
+ break;
4820
+ case 39:
4821
+ if (quote === 0) {
4822
+ quote = 39;
4823
+ } else if (quote === 39 && value.charCodeAt(i - 1) !== 92) {
4824
+ quote = 0;
8316
4825
  }
8317
- return result;
8318
- },
8319
- "<x-one-radius>": function(expression) {
8320
- var result = false, simple = "<length> | <percentage> | inherit";
8321
- if (ValidationTypes.isAny(expression, simple)) {
8322
- result = true;
8323
- ValidationTypes.isAny(expression, simple);
4826
+ break;
4827
+ case 34:
4828
+ if (quote === 0) {
4829
+ quote = 34;
4830
+ } else if (quote === 34 && value.charCodeAt(i - 1) !== 92) {
4831
+ quote = 0;
8324
4832
  }
8325
- return result;
8326
- },
8327
- "<flex>": function(expression) {
8328
- var part, result = false;
8329
- if (ValidationTypes.isAny(expression, "none | inherit")) {
8330
- result = true;
8331
- } else {
8332
- if (ValidationTypes.isType(expression, "<flex-grow>")) {
8333
- if (expression.peek()) {
8334
- if (ValidationTypes.isType(expression, "<flex-shrink>")) {
8335
- if (expression.peek()) {
8336
- result = ValidationTypes.isType(expression, "<flex-basis>");
8337
- } else {
8338
- result = true;
8339
- }
8340
- } else if (ValidationTypes.isType(expression, "<flex-basis>")) {
8341
- result = expression.peek() === null;
8342
- }
8343
- } else {
8344
- result = true;
8345
- }
8346
- } else if (ValidationTypes.isType(expression, "<flex-basis>")) {
8347
- result = true;
8348
- }
4833
+ break;
4834
+ case 58:
4835
+ if (!currentProp && parenDepth === 0 && quote === 0) {
4836
+ currentProp = hyphenate(value.substring(propStart, i - 1).trim());
4837
+ valueStart = i;
8349
4838
  }
8350
- if (!result) {
8351
- part = expression.peek();
8352
- throw new ValidationError("Expected (none | [ <flex-grow> <flex-shrink>? || <flex-basis> ]) but found '" + expression.value.text + "'.", part.line, part.col);
4839
+ break;
4840
+ case 59:
4841
+ if (currentProp && valueStart > 0 && parenDepth === 0 && quote === 0) {
4842
+ const styleVal = value.substring(valueStart, i - 1).trim();
4843
+ styles.push(currentProp, styleVal);
4844
+ propStart = i;
4845
+ valueStart = 0;
4846
+ currentProp = null;
8353
4847
  }
8354
- return result;
8355
- }
4848
+ break;
8356
4849
  }
8357
- };
8358
- parserlib.css = {
8359
- __proto__: null,
8360
- Colors,
8361
- Combinator,
8362
- Parser,
8363
- PropertyName,
8364
- PropertyValue,
8365
- PropertyValuePart,
8366
- MediaFeature,
8367
- MediaQuery,
8368
- Selector,
8369
- SelectorPart,
8370
- SelectorSubPart,
8371
- Specificity,
8372
- TokenStream,
8373
- Tokens,
8374
- ValidationError
8375
- };
8376
- })();
8377
- (function() {
8378
- for (var prop in parserlib) {
8379
- exports[prop] = parserlib[prop];
8380
4850
  }
8381
- })();
4851
+ if (currentProp && valueStart) {
4852
+ const styleVal = value.slice(valueStart).trim();
4853
+ styles.push(currentProp, styleVal);
4854
+ }
4855
+ return styles;
4856
+ }
4857
+ exports.parse = parse;
4858
+ function hyphenate(value) {
4859
+ return value.replace(/[a-z][A-Z]/g, (v) => {
4860
+ return v.charAt(0) + "-" + v.charAt(1);
4861
+ }).toLowerCase();
4862
+ }
4863
+ exports.hyphenate = hyphenate;
8382
4864
  }
8383
4865
  });
8384
4866
 
@@ -8386,23 +4868,33 @@ var require_cssparser = __commonJS({
8386
4868
  var require_CSSStyleDeclaration = __commonJS({
8387
4869
  "external/npm/node_modules/domino/lib/CSSStyleDeclaration.js"(exports, module) {
8388
4870
  "use strict";
8389
- var parserlib = require_cssparser();
4871
+ var { parse } = require_style_parser();
8390
4872
  module.exports = CSSStyleDeclaration;
8391
4873
  function CSSStyleDeclaration(elt) {
8392
4874
  this._element = elt;
8393
4875
  }
8394
- function parseStyles(s) {
8395
- var parser = new parserlib.css.Parser();
8396
- var result = { property: /* @__PURE__ */ Object.create(null), priority: /* @__PURE__ */ Object.create(null) };
8397
- parser.addListener("property", function(e) {
8398
- if (e.invalid)
8399
- return;
8400
- result.property[e.property.text] = e.value.text;
8401
- if (e.important)
8402
- result.priority[e.property.text] = "important";
8403
- });
8404
- s = ("" + s).replace(/^;/, "");
8405
- parser.parseStyleAttribute(s);
4876
+ var IMPORTANT_BANG = "!important";
4877
+ function parseStyles(value) {
4878
+ const result = {
4879
+ property: {},
4880
+ priority: {}
4881
+ };
4882
+ if (!value) {
4883
+ return result;
4884
+ }
4885
+ const styleValues = parse(value);
4886
+ if (styleValues.length < 2) {
4887
+ return result;
4888
+ }
4889
+ for (let i = 0; i < styleValues.length; i += 2) {
4890
+ const name = styleValues[i];
4891
+ let value2 = styleValues[i + 1];
4892
+ if (value2.endsWith(IMPORTANT_BANG)) {
4893
+ result.priority[name] = "important";
4894
+ value2 = value2.slice(0, -IMPORTANT_BANG.length).trim();
4895
+ }
4896
+ result.property[name] = value2;
4897
+ }
8406
4898
  return result;
8407
4899
  }
8408
4900
  var NO_CHANGE = {};
@@ -8469,6 +4961,7 @@ var require_CSSStyleDeclaration = __commonJS({
8469
4961
  if (value !== NO_CHANGE) {
8470
4962
  value = "" + value;
8471
4963
  }
4964
+ value = value.trim();
8472
4965
  if (value === "") {
8473
4966
  this.removeProperty(property);
8474
4967
  return;
@@ -19959,29 +16452,6 @@ var require_lib = __commonJS({
19959
16452
  }
19960
16453
  });
19961
16454
  var domino = require_lib();
19962
- /*!
19963
- Parser-Lib
19964
- Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved.
19965
-
19966
- Permission is hereby granted, free of charge, to any person obtaining a copy
19967
- of this software and associated documentation files (the "Software"), to deal
19968
- in the Software without restriction, including without limitation the rights
19969
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19970
- copies of the Software, and to permit persons to whom the Software is
19971
- furnished to do so, subject to the following conditions:
19972
-
19973
- The above copyright notice and this permission notice shall be included in
19974
- all copies or substantial portions of the Software.
19975
-
19976
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19977
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19978
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19979
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19980
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19981
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19982
- THE SOFTWARE.
19983
-
19984
- */
19985
16455
 
19986
16456
  function setDomTypes() {
19987
16457
  // Make all Domino types available in the global env.
@@ -20084,10 +16554,10 @@ class PlatformState {
20084
16554
  getDocument() {
20085
16555
  return this._doc;
20086
16556
  }
20087
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
20088
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: PlatformState }); }
16557
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: PlatformState, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
16558
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: PlatformState }); }
20089
16559
  }
20090
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: PlatformState, decorators: [{
16560
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: PlatformState, decorators: [{
20091
16561
  type: Injectable
20092
16562
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
20093
16563
  type: Inject,
@@ -20098,10 +16568,10 @@ class ServerXhr {
20098
16568
  build() {
20099
16569
  return new xhr2.XMLHttpRequest();
20100
16570
  }
20101
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
20102
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerXhr }); }
16571
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
16572
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerXhr }); }
20103
16573
  }
20104
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerXhr, decorators: [{
16574
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerXhr, decorators: [{
20105
16575
  type: Injectable
20106
16576
  }] });
20107
16577
  const SERVER_HTTP_PROVIDERS = [
@@ -20216,10 +16686,10 @@ class ServerPlatformLocation {
20216
16686
  getState() {
20217
16687
  return undefined;
20218
16688
  }
20219
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerPlatformLocation, deps: [{ token: DOCUMENT }, { token: INITIAL_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
20220
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerPlatformLocation }); }
16689
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerPlatformLocation, deps: [{ token: DOCUMENT }, { token: INITIAL_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
16690
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerPlatformLocation }); }
20221
16691
  }
20222
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerPlatformLocation, decorators: [{
16692
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerPlatformLocation, decorators: [{
20223
16693
  type: Injectable
20224
16694
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
20225
16695
  type: Inject,
@@ -20245,18 +16715,10 @@ class ServerEventManagerPlugin /* extends EventManagerPlugin which is private */
20245
16715
  addEventListener(element, eventName, handler) {
20246
16716
  return ɵgetDOM().onAndCancel(element, eventName, handler);
20247
16717
  }
20248
- /** @deprecated No longer being used in Ivy code. To be removed in version 14. */
20249
- addGlobalEventListener(element, eventName, handler) {
20250
- const target = ɵgetDOM().getGlobalEventTarget(this.doc, element);
20251
- if (!target) {
20252
- throw new Error(`Unsupported event target ${target} for event ${eventName}`);
20253
- }
20254
- return this.addEventListener(target, eventName, handler);
20255
- }
20256
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
20257
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ }); }
16718
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
16719
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ }); }
20258
16720
  }
20259
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, decorators: [{
16721
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerEventManagerPlugin /* extends EventManagerPlugin which is private */, decorators: [{
20260
16722
  type: Injectable
20261
16723
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
20262
16724
  type: Inject,
@@ -20302,10 +16764,10 @@ class ServerRendererFactory2 {
20302
16764
  }
20303
16765
  begin() { }
20304
16766
  end() { }
20305
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerRendererFactory2, deps: [{ token: i1.EventManager }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i1.ɵSharedStylesHost }, { token: APP_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
20306
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerRendererFactory2 }); }
16767
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerRendererFactory2, deps: [{ token: i1.EventManager }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i1.ɵSharedStylesHost }, { token: APP_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
16768
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerRendererFactory2 }); }
20307
16769
  }
20308
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerRendererFactory2, decorators: [{
16770
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerRendererFactory2, decorators: [{
20309
16771
  type: Injectable
20310
16772
  }], ctorParameters: function () { return [{ type: i1.EventManager }, { type: i0.NgZone }, { type: Document, decorators: [{
20311
16773
  type: Inject,
@@ -20440,9 +16902,6 @@ class DefaultServerRenderer2 {
20440
16902
  }
20441
16903
  listen(target, eventName, callback) {
20442
16904
  checkNoSyntheticProp(eventName, 'listener');
20443
- if (typeof target === 'string') {
20444
- return this.eventManager.addGlobalEventListener(target, eventName, this.decoratePreventDefault(callback));
20445
- }
20446
16905
  return this.eventManager.addEventListener(target, eventName, this.decoratePreventDefault(callback));
20447
16906
  }
20448
16907
  decoratePreventDefault(eventHandler) {
@@ -20569,11 +17028,11 @@ function serializeTransferStateFactory(doc, appId, transferStore) {
20569
17028
  * this module.
20570
17029
  */
20571
17030
  class ServerTransferStateModule {
20572
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
20573
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerTransferStateModule }); }
20574
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerTransferStateModule }); }
17031
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
17032
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerTransferStateModule }); }
17033
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerTransferStateModule }); }
20575
17034
  }
20576
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerTransferStateModule, decorators: [{
17035
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerTransferStateModule, decorators: [{
20577
17036
  type: NgModule,
20578
17037
  args: [{}]
20579
17038
  }] });
@@ -20621,11 +17080,11 @@ const PLATFORM_SERVER_PROVIDERS = [
20621
17080
  * @publicApi
20622
17081
  */
20623
17082
  class ServerModule {
20624
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
20625
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] }); }
20626
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerModule, providers: PLATFORM_SERVER_PROVIDERS, imports: [HttpClientModule, NoopAnimationsModule, BrowserModule] }); }
17083
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
17084
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerModule, imports: [HttpClientModule, NoopAnimationsModule], exports: [BrowserModule] }); }
17085
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerModule, providers: PLATFORM_SERVER_PROVIDERS, imports: [HttpClientModule, NoopAnimationsModule, BrowserModule] }); }
20627
17086
  }
20628
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ServerModule, decorators: [{
17087
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ServerModule, decorators: [{
20629
17088
  type: NgModule,
20630
17089
  args: [{
20631
17090
  exports: [BrowserModule],
@@ -20823,7 +17282,7 @@ function renderApplication(bootstrap, options) {
20823
17282
  /**
20824
17283
  * @publicApi
20825
17284
  */
20826
- const VERSION = new Version('16.0.0-next.5');
17285
+ const VERSION = new Version('16.0.0-next.6');
20827
17286
 
20828
17287
  /// <reference types="node" />
20829
17288
  // This file only reexports content of the `src` folder. Keep it that way.