@mapbox/mapbox-gl-style-spec 14.7.0-beta.1 → 14.7.1

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.
package/dist/index.cjs CHANGED
@@ -250,6 +250,10 @@
250
250
  };
251
251
  var featureset = {
252
252
  experimental: true,
253
+ metadata: {
254
+ type: "*",
255
+ doc: "Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."
256
+ },
253
257
  selectors: {
254
258
  type: "array",
255
259
  value: "selector",
@@ -6473,7 +6477,8 @@
6473
6477
  interpolated: true,
6474
6478
  parameters: [
6475
6479
  "zoom",
6476
- "measure-light"
6480
+ "measure-light",
6481
+ "feature-state"
6477
6482
  ]
6478
6483
  },
6479
6484
  "property-type": "data-driven"
@@ -6504,7 +6509,8 @@
6504
6509
  interpolated: true,
6505
6510
  parameters: [
6506
6511
  "zoom",
6507
- "measure-light"
6512
+ "measure-light",
6513
+ "feature-state"
6508
6514
  ]
6509
6515
  },
6510
6516
  "property-type": "data-driven"
@@ -7618,6 +7624,32 @@
7618
7624
  }
7619
7625
  };
7620
7626
  var paint_background = {
7627
+ "background-pitch-alignment": {
7628
+ type: "enum",
7629
+ values: {
7630
+ map: {
7631
+ doc: "The background is aligned to the plane of the map."
7632
+ },
7633
+ viewport: {
7634
+ doc: "The background is aligned to the plane of the viewport, covering the whole screen."
7635
+ }
7636
+ },
7637
+ "default": "map",
7638
+ doc: "Orientation of background layer.",
7639
+ "sdk-support": {
7640
+ "basic functionality": {
7641
+ js: "3.8.0",
7642
+ android: "11.8.0",
7643
+ ios: "11.8.0"
7644
+ }
7645
+ },
7646
+ expression: {
7647
+ interpolated: false,
7648
+ parameters: [
7649
+ ]
7650
+ },
7651
+ "property-type": "data-constant"
7652
+ },
7621
7653
  "background-color": {
7622
7654
  type: "color",
7623
7655
  "default": "#000000",
@@ -8356,9 +8388,7 @@
8356
8388
  doc: "An array for configuring the fade-out effect for the front cutoff of content on pitched map views. It contains three values: start, range and final opacity. The start parameter defines the point at which the fade-out effect begins, with smaller values causing the effect to start earlier. The range parameter specifies how long the fade-out effect will last. A value of 0.0 for range makes content disappear immediately without a fade-out effect. The final opacity determines content opacity at the end of the fade-out effect. A value of 1.0 for final opacity means that the cutoff is completely disabled.",
8357
8389
  "sdk-support": {
8358
8390
  "basic functionality": {
8359
- js: "3.5.0",
8360
- android: "11.5.0",
8361
- ios: "11.5.0"
8391
+ js: "3.5.0"
8362
8392
  }
8363
8393
  }
8364
8394
  }
@@ -9234,16 +9264,22 @@
9234
9264
  js: "3.0.0",
9235
9265
  android: "11.0.0",
9236
9266
  ios: "11.0.0"
9267
+ },
9268
+ "data-driven styling": {
9269
+ js: "3.8.0",
9270
+ android: "11.8.0",
9271
+ ios: "11.8.0"
9237
9272
  }
9238
9273
  },
9239
9274
  expression: {
9240
9275
  interpolated: true,
9241
9276
  parameters: [
9242
9277
  "zoom",
9243
- "measure-light"
9278
+ "measure-light",
9279
+ "feature-state"
9244
9280
  ]
9245
9281
  },
9246
- "property-type": "data-constant"
9282
+ "property-type": "data-driven"
9247
9283
  },
9248
9284
  "fill-extrusion-line-width": {
9249
9285
  type: "number",
@@ -9898,1050 +9934,1058 @@
9898
9934
 
9899
9935
  var csscolorparser = {};
9900
9936
 
9901
- var parseCSSColor_1;
9902
- // (c) Dean McNamee <dean@gmail.com>, 2012.
9903
- //
9904
- // https://github.com/deanm/css-color-parser-js
9905
- //
9906
- // Permission is hereby granted, free of charge, to any person obtaining a copy
9907
- // of this software and associated documentation files (the "Software"), to
9908
- // deal in the Software without restriction, including without limitation the
9909
- // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9910
- // sell copies of the Software, and to permit persons to whom the Software is
9911
- // furnished to do so, subject to the following conditions:
9912
- //
9913
- // The above copyright notice and this permission notice shall be included in
9914
- // all copies or substantial portions of the Software.
9915
- //
9916
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9917
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9918
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
9919
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9920
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9921
- // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
9922
- // IN THE SOFTWARE.
9923
- // http://www.w3.org/TR/css3-color/
9924
- var kCSSColorTable = {
9925
- 'transparent': [
9926
- 0,
9927
- 0,
9928
- 0,
9929
- 0
9930
- ],
9931
- 'aliceblue': [
9932
- 240,
9933
- 248,
9934
- 255,
9935
- 1
9936
- ],
9937
- 'antiquewhite': [
9938
- 250,
9939
- 235,
9940
- 215,
9941
- 1
9942
- ],
9943
- 'aqua': [
9944
- 0,
9945
- 255,
9946
- 255,
9947
- 1
9948
- ],
9949
- 'aquamarine': [
9950
- 127,
9951
- 255,
9952
- 212,
9953
- 1
9954
- ],
9955
- 'azure': [
9956
- 240,
9957
- 255,
9958
- 255,
9959
- 1
9960
- ],
9961
- 'beige': [
9962
- 245,
9963
- 245,
9964
- 220,
9965
- 1
9966
- ],
9967
- 'bisque': [
9968
- 255,
9969
- 228,
9970
- 196,
9971
- 1
9972
- ],
9973
- 'black': [
9974
- 0,
9975
- 0,
9976
- 0,
9977
- 1
9978
- ],
9979
- 'blanchedalmond': [
9980
- 255,
9981
- 235,
9982
- 205,
9983
- 1
9984
- ],
9985
- 'blue': [
9986
- 0,
9987
- 0,
9988
- 255,
9989
- 1
9990
- ],
9991
- 'blueviolet': [
9992
- 138,
9993
- 43,
9994
- 226,
9995
- 1
9996
- ],
9997
- 'brown': [
9998
- 165,
9999
- 42,
10000
- 42,
10001
- 1
10002
- ],
10003
- 'burlywood': [
10004
- 222,
10005
- 184,
10006
- 135,
10007
- 1
10008
- ],
10009
- 'cadetblue': [
10010
- 95,
10011
- 158,
10012
- 160,
10013
- 1
10014
- ],
10015
- 'chartreuse': [
10016
- 127,
10017
- 255,
10018
- 0,
10019
- 1
10020
- ],
10021
- 'chocolate': [
10022
- 210,
10023
- 105,
10024
- 30,
10025
- 1
10026
- ],
10027
- 'coral': [
10028
- 255,
10029
- 127,
10030
- 80,
10031
- 1
10032
- ],
10033
- 'cornflowerblue': [
10034
- 100,
10035
- 149,
10036
- 237,
10037
- 1
10038
- ],
10039
- 'cornsilk': [
10040
- 255,
10041
- 248,
10042
- 220,
10043
- 1
10044
- ],
10045
- 'crimson': [
10046
- 220,
10047
- 20,
10048
- 60,
10049
- 1
10050
- ],
10051
- 'cyan': [
10052
- 0,
10053
- 255,
10054
- 255,
10055
- 1
10056
- ],
10057
- 'darkblue': [
10058
- 0,
10059
- 0,
10060
- 139,
10061
- 1
10062
- ],
10063
- 'darkcyan': [
10064
- 0,
10065
- 139,
10066
- 139,
10067
- 1
10068
- ],
10069
- 'darkgoldenrod': [
10070
- 184,
10071
- 134,
10072
- 11,
10073
- 1
10074
- ],
10075
- 'darkgray': [
10076
- 169,
10077
- 169,
10078
- 169,
10079
- 1
10080
- ],
10081
- 'darkgreen': [
10082
- 0,
10083
- 100,
10084
- 0,
10085
- 1
10086
- ],
10087
- 'darkgrey': [
10088
- 169,
10089
- 169,
10090
- 169,
10091
- 1
10092
- ],
10093
- 'darkkhaki': [
10094
- 189,
10095
- 183,
10096
- 107,
10097
- 1
10098
- ],
10099
- 'darkmagenta': [
10100
- 139,
10101
- 0,
10102
- 139,
10103
- 1
10104
- ],
10105
- 'darkolivegreen': [
10106
- 85,
10107
- 107,
10108
- 47,
10109
- 1
10110
- ],
10111
- 'darkorange': [
10112
- 255,
10113
- 140,
10114
- 0,
10115
- 1
10116
- ],
10117
- 'darkorchid': [
10118
- 153,
10119
- 50,
10120
- 204,
10121
- 1
10122
- ],
10123
- 'darkred': [
10124
- 139,
10125
- 0,
10126
- 0,
10127
- 1
10128
- ],
10129
- 'darksalmon': [
10130
- 233,
10131
- 150,
10132
- 122,
10133
- 1
10134
- ],
10135
- 'darkseagreen': [
10136
- 143,
10137
- 188,
10138
- 143,
10139
- 1
10140
- ],
10141
- 'darkslateblue': [
10142
- 72,
10143
- 61,
10144
- 139,
10145
- 1
10146
- ],
10147
- 'darkslategray': [
10148
- 47,
10149
- 79,
10150
- 79,
10151
- 1
10152
- ],
10153
- 'darkslategrey': [
10154
- 47,
10155
- 79,
10156
- 79,
10157
- 1
10158
- ],
10159
- 'darkturquoise': [
10160
- 0,
10161
- 206,
10162
- 209,
10163
- 1
10164
- ],
10165
- 'darkviolet': [
10166
- 148,
10167
- 0,
10168
- 211,
10169
- 1
10170
- ],
10171
- 'deeppink': [
10172
- 255,
10173
- 20,
10174
- 147,
10175
- 1
10176
- ],
10177
- 'deepskyblue': [
10178
- 0,
10179
- 191,
10180
- 255,
10181
- 1
10182
- ],
10183
- 'dimgray': [
10184
- 105,
10185
- 105,
10186
- 105,
10187
- 1
10188
- ],
10189
- 'dimgrey': [
10190
- 105,
10191
- 105,
10192
- 105,
10193
- 1
10194
- ],
10195
- 'dodgerblue': [
10196
- 30,
10197
- 144,
10198
- 255,
10199
- 1
10200
- ],
10201
- 'firebrick': [
10202
- 178,
10203
- 34,
10204
- 34,
10205
- 1
10206
- ],
10207
- 'floralwhite': [
10208
- 255,
10209
- 250,
10210
- 240,
10211
- 1
10212
- ],
10213
- 'forestgreen': [
10214
- 34,
10215
- 139,
10216
- 34,
10217
- 1
10218
- ],
10219
- 'fuchsia': [
10220
- 255,
10221
- 0,
10222
- 255,
10223
- 1
10224
- ],
10225
- 'gainsboro': [
10226
- 220,
10227
- 220,
10228
- 220,
10229
- 1
10230
- ],
10231
- 'ghostwhite': [
10232
- 248,
10233
- 248,
10234
- 255,
10235
- 1
10236
- ],
10237
- 'gold': [
10238
- 255,
10239
- 215,
10240
- 0,
10241
- 1
10242
- ],
10243
- 'goldenrod': [
10244
- 218,
10245
- 165,
10246
- 32,
10247
- 1
10248
- ],
10249
- 'gray': [
10250
- 128,
10251
- 128,
10252
- 128,
10253
- 1
10254
- ],
10255
- 'green': [
10256
- 0,
10257
- 128,
10258
- 0,
10259
- 1
10260
- ],
10261
- 'greenyellow': [
10262
- 173,
10263
- 255,
10264
- 47,
10265
- 1
10266
- ],
10267
- 'grey': [
10268
- 128,
10269
- 128,
10270
- 128,
10271
- 1
10272
- ],
10273
- 'honeydew': [
10274
- 240,
10275
- 255,
10276
- 240,
10277
- 1
10278
- ],
10279
- 'hotpink': [
10280
- 255,
10281
- 105,
10282
- 180,
10283
- 1
10284
- ],
10285
- 'indianred': [
10286
- 205,
10287
- 92,
10288
- 92,
10289
- 1
10290
- ],
10291
- 'indigo': [
10292
- 75,
10293
- 0,
10294
- 130,
10295
- 1
10296
- ],
10297
- 'ivory': [
10298
- 255,
10299
- 255,
10300
- 240,
10301
- 1
10302
- ],
10303
- 'khaki': [
10304
- 240,
10305
- 230,
10306
- 140,
10307
- 1
10308
- ],
10309
- 'lavender': [
10310
- 230,
10311
- 230,
10312
- 250,
10313
- 1
10314
- ],
10315
- 'lavenderblush': [
10316
- 255,
10317
- 240,
10318
- 245,
10319
- 1
10320
- ],
10321
- 'lawngreen': [
10322
- 124,
10323
- 252,
10324
- 0,
10325
- 1
10326
- ],
10327
- 'lemonchiffon': [
10328
- 255,
10329
- 250,
10330
- 205,
10331
- 1
10332
- ],
10333
- 'lightblue': [
10334
- 173,
10335
- 216,
10336
- 230,
10337
- 1
10338
- ],
10339
- 'lightcoral': [
10340
- 240,
10341
- 128,
10342
- 128,
10343
- 1
10344
- ],
10345
- 'lightcyan': [
10346
- 224,
10347
- 255,
10348
- 255,
10349
- 1
10350
- ],
10351
- 'lightgoldenrodyellow': [
10352
- 250,
10353
- 250,
10354
- 210,
10355
- 1
10356
- ],
10357
- 'lightgray': [
10358
- 211,
10359
- 211,
10360
- 211,
10361
- 1
10362
- ],
10363
- 'lightgreen': [
10364
- 144,
10365
- 238,
10366
- 144,
10367
- 1
10368
- ],
10369
- 'lightgrey': [
10370
- 211,
10371
- 211,
10372
- 211,
10373
- 1
10374
- ],
10375
- 'lightpink': [
10376
- 255,
10377
- 182,
10378
- 193,
10379
- 1
10380
- ],
10381
- 'lightsalmon': [
10382
- 255,
10383
- 160,
10384
- 122,
10385
- 1
10386
- ],
10387
- 'lightseagreen': [
10388
- 32,
10389
- 178,
10390
- 170,
10391
- 1
10392
- ],
10393
- 'lightskyblue': [
10394
- 135,
10395
- 206,
10396
- 250,
10397
- 1
10398
- ],
10399
- 'lightslategray': [
10400
- 119,
10401
- 136,
10402
- 153,
10403
- 1
10404
- ],
10405
- 'lightslategrey': [
10406
- 119,
10407
- 136,
10408
- 153,
10409
- 1
10410
- ],
10411
- 'lightsteelblue': [
10412
- 176,
10413
- 196,
10414
- 222,
10415
- 1
10416
- ],
10417
- 'lightyellow': [
10418
- 255,
10419
- 255,
10420
- 224,
10421
- 1
10422
- ],
10423
- 'lime': [
10424
- 0,
10425
- 255,
10426
- 0,
10427
- 1
10428
- ],
10429
- 'limegreen': [
10430
- 50,
10431
- 205,
10432
- 50,
10433
- 1
10434
- ],
10435
- 'linen': [
10436
- 250,
10437
- 240,
10438
- 230,
10439
- 1
10440
- ],
10441
- 'magenta': [
10442
- 255,
10443
- 0,
10444
- 255,
10445
- 1
10446
- ],
10447
- 'maroon': [
10448
- 128,
10449
- 0,
10450
- 0,
10451
- 1
10452
- ],
10453
- 'mediumaquamarine': [
10454
- 102,
10455
- 205,
10456
- 170,
10457
- 1
10458
- ],
10459
- 'mediumblue': [
10460
- 0,
10461
- 0,
10462
- 205,
10463
- 1
10464
- ],
10465
- 'mediumorchid': [
10466
- 186,
10467
- 85,
10468
- 211,
10469
- 1
10470
- ],
10471
- 'mediumpurple': [
10472
- 147,
10473
- 112,
10474
- 219,
10475
- 1
10476
- ],
10477
- 'mediumseagreen': [
10478
- 60,
10479
- 179,
10480
- 113,
10481
- 1
10482
- ],
10483
- 'mediumslateblue': [
10484
- 123,
10485
- 104,
10486
- 238,
10487
- 1
10488
- ],
10489
- 'mediumspringgreen': [
10490
- 0,
10491
- 250,
10492
- 154,
10493
- 1
10494
- ],
10495
- 'mediumturquoise': [
10496
- 72,
10497
- 209,
10498
- 204,
10499
- 1
10500
- ],
10501
- 'mediumvioletred': [
10502
- 199,
10503
- 21,
10504
- 133,
10505
- 1
10506
- ],
10507
- 'midnightblue': [
10508
- 25,
10509
- 25,
10510
- 112,
10511
- 1
10512
- ],
10513
- 'mintcream': [
10514
- 245,
10515
- 255,
10516
- 250,
10517
- 1
10518
- ],
10519
- 'mistyrose': [
10520
- 255,
10521
- 228,
10522
- 225,
10523
- 1
10524
- ],
10525
- 'moccasin': [
10526
- 255,
10527
- 228,
10528
- 181,
10529
- 1
10530
- ],
10531
- 'navajowhite': [
10532
- 255,
10533
- 222,
10534
- 173,
10535
- 1
10536
- ],
10537
- 'navy': [
10538
- 0,
10539
- 0,
10540
- 128,
10541
- 1
10542
- ],
10543
- 'oldlace': [
10544
- 253,
10545
- 245,
10546
- 230,
10547
- 1
10548
- ],
10549
- 'olive': [
10550
- 128,
10551
- 128,
10552
- 0,
10553
- 1
10554
- ],
10555
- 'olivedrab': [
10556
- 107,
10557
- 142,
10558
- 35,
10559
- 1
10560
- ],
10561
- 'orange': [
10562
- 255,
10563
- 165,
10564
- 0,
10565
- 1
10566
- ],
10567
- 'orangered': [
10568
- 255,
10569
- 69,
10570
- 0,
10571
- 1
10572
- ],
10573
- 'orchid': [
10574
- 218,
10575
- 112,
10576
- 214,
10577
- 1
10578
- ],
10579
- 'palegoldenrod': [
10580
- 238,
10581
- 232,
10582
- 170,
10583
- 1
10584
- ],
10585
- 'palegreen': [
10586
- 152,
10587
- 251,
10588
- 152,
10589
- 1
10590
- ],
10591
- 'paleturquoise': [
10592
- 175,
10593
- 238,
10594
- 238,
10595
- 1
10596
- ],
10597
- 'palevioletred': [
10598
- 219,
10599
- 112,
10600
- 147,
10601
- 1
10602
- ],
10603
- 'papayawhip': [
10604
- 255,
10605
- 239,
10606
- 213,
10607
- 1
10608
- ],
10609
- 'peachpuff': [
10610
- 255,
10611
- 218,
10612
- 185,
10613
- 1
10614
- ],
10615
- 'peru': [
10616
- 205,
10617
- 133,
10618
- 63,
10619
- 1
10620
- ],
10621
- 'pink': [
10622
- 255,
10623
- 192,
10624
- 203,
10625
- 1
10626
- ],
10627
- 'plum': [
10628
- 221,
10629
- 160,
10630
- 221,
10631
- 1
10632
- ],
10633
- 'powderblue': [
10634
- 176,
10635
- 224,
10636
- 230,
10637
- 1
10638
- ],
10639
- 'purple': [
10640
- 128,
10641
- 0,
10642
- 128,
10643
- 1
10644
- ],
10645
- 'rebeccapurple': [
10646
- 102,
10647
- 51,
10648
- 153,
10649
- 1
10650
- ],
10651
- 'red': [
10652
- 255,
10653
- 0,
10654
- 0,
10655
- 1
10656
- ],
10657
- 'rosybrown': [
10658
- 188,
10659
- 143,
10660
- 143,
10661
- 1
10662
- ],
10663
- 'royalblue': [
10664
- 65,
10665
- 105,
10666
- 225,
10667
- 1
10668
- ],
10669
- 'saddlebrown': [
10670
- 139,
10671
- 69,
10672
- 19,
10673
- 1
10674
- ],
10675
- 'salmon': [
10676
- 250,
10677
- 128,
10678
- 114,
10679
- 1
10680
- ],
10681
- 'sandybrown': [
10682
- 244,
10683
- 164,
10684
- 96,
10685
- 1
10686
- ],
10687
- 'seagreen': [
10688
- 46,
10689
- 139,
10690
- 87,
10691
- 1
10692
- ],
10693
- 'seashell': [
10694
- 255,
10695
- 245,
10696
- 238,
10697
- 1
10698
- ],
10699
- 'sienna': [
10700
- 160,
10701
- 82,
10702
- 45,
10703
- 1
10704
- ],
10705
- 'silver': [
10706
- 192,
10707
- 192,
10708
- 192,
10709
- 1
10710
- ],
10711
- 'skyblue': [
10712
- 135,
10713
- 206,
10714
- 235,
10715
- 1
10716
- ],
10717
- 'slateblue': [
10718
- 106,
10719
- 90,
10720
- 205,
10721
- 1
10722
- ],
10723
- 'slategray': [
10724
- 112,
10725
- 128,
10726
- 144,
10727
- 1
10728
- ],
10729
- 'slategrey': [
10730
- 112,
10731
- 128,
10732
- 144,
10733
- 1
10734
- ],
10735
- 'snow': [
10736
- 255,
10737
- 250,
10738
- 250,
10739
- 1
10740
- ],
10741
- 'springgreen': [
10742
- 0,
10743
- 255,
10744
- 127,
10745
- 1
10746
- ],
10747
- 'steelblue': [
10748
- 70,
10749
- 130,
10750
- 180,
10751
- 1
10752
- ],
10753
- 'tan': [
10754
- 210,
10755
- 180,
10756
- 140,
10757
- 1
10758
- ],
10759
- 'teal': [
10760
- 0,
10761
- 128,
10762
- 128,
10763
- 1
10764
- ],
10765
- 'thistle': [
10766
- 216,
10767
- 191,
10768
- 216,
10769
- 1
10770
- ],
10771
- 'tomato': [
10772
- 255,
10773
- 99,
10774
- 71,
10775
- 1
10776
- ],
10777
- 'turquoise': [
10778
- 64,
10779
- 224,
10780
- 208,
10781
- 1
10782
- ],
10783
- 'violet': [
10784
- 238,
10785
- 130,
10786
- 238,
10787
- 1
10788
- ],
10789
- 'wheat': [
10790
- 245,
10791
- 222,
10792
- 179,
10793
- 1
10794
- ],
10795
- 'white': [
10796
- 255,
10797
- 255,
10798
- 255,
10799
- 1
10800
- ],
10801
- 'whitesmoke': [
10802
- 245,
10803
- 245,
10804
- 245,
10805
- 1
10806
- ],
10807
- 'yellow': [
10808
- 255,
10809
- 255,
10810
- 0,
10811
- 1
10812
- ],
10813
- 'yellowgreen': [
10814
- 154,
10815
- 205,
10816
- 50,
10817
- 1
10818
- ]
10819
- };
10820
- function clamp_css_byte(i) {
10821
- // Clamp to integer 0 .. 255.
10822
- i = Math.round(i);
10823
- // Seems to be what Chrome does (vs truncation).
10824
- return i < 0 ? 0 : i > 255 ? 255 : i;
10825
- }
10826
- function clamp_css_float(f) {
10827
- // Clamp to float 0.0 .. 1.0.
10828
- return f < 0 ? 0 : f > 1 ? 1 : f;
10829
- }
10830
- function parse_css_int(str) {
10831
- // int or percentage.
10832
- if (str[str.length - 1] === '%')
10833
- return clamp_css_byte(parseFloat(str) / 100 * 255);
10834
- return clamp_css_byte(parseInt(str));
10835
- }
10836
- function parse_css_float(str) {
10837
- // float or percentage.
10838
- if (str[str.length - 1] === '%')
10839
- return clamp_css_float(parseFloat(str) / 100);
10840
- return clamp_css_float(parseFloat(str));
10841
- }
10842
- function css_hue_to_rgb(m1, m2, h) {
10843
- if (h < 0)
10844
- h += 1;
10845
- else if (h > 1)
10846
- h -= 1;
10847
- if (h * 6 < 1)
10848
- return m1 + (m2 - m1) * h * 6;
10849
- if (h * 2 < 1)
10850
- return m2;
10851
- if (h * 3 < 2)
10852
- return m1 + (m2 - m1) * (2 / 3 - h) * 6;
10853
- return m1;
10854
- }
10855
- function parseCSSColor(css_str) {
10856
- // Remove all whitespace, not compliant, but should just be more accepting.
10857
- var str = css_str.replace(/ /g, '').toLowerCase();
10858
- // Color keywords (and transparent) lookup.
10859
- if (str in kCSSColorTable)
10860
- return kCSSColorTable[str].slice();
10861
- // dup.
10862
- // #abc and #abc123 syntax.
10863
- if (str[0] === '#') {
10864
- if (str.length === 4) {
10865
- var iv = parseInt(str.substr(1), 16);
10866
- // TODO(deanm): Stricter parsing.
10867
- if (!(iv >= 0 && iv <= 4095))
10868
- return null;
10869
- // Covers NaN.
10870
- return [
10871
- (iv & 3840) >> 4 | (iv & 3840) >> 8,
10872
- iv & 240 | (iv & 240) >> 4,
10873
- iv & 15 | (iv & 15) << 4,
10874
- 1
10875
- ];
10876
- } else if (str.length === 7) {
10877
- var iv = parseInt(str.substr(1), 16);
10878
- // TODO(deanm): Stricter parsing.
10879
- if (!(iv >= 0 && iv <= 16777215))
10880
- return null;
10881
- // Covers NaN.
10882
- return [
10883
- (iv & 16711680) >> 16,
10884
- (iv & 65280) >> 8,
10885
- iv & 255,
10886
- 1
10887
- ];
10888
- }
10889
- return null;
10890
- }
10891
- var op = str.indexOf('('), ep = str.indexOf(')');
10892
- if (op !== -1 && ep + 1 === str.length) {
10893
- var fname = str.substr(0, op);
10894
- var params = str.substr(op + 1, ep - (op + 1)).split(',');
10895
- var alpha = 1;
10896
- // To allow case fallthrough.
10897
- switch (fname) {
10898
- case 'rgba':
10899
- if (params.length !== 4)
10900
- return null;
10901
- alpha = parse_css_float(params.pop());
10902
- // Fall through.
10903
- case 'rgb':
10904
- if (params.length !== 3)
10905
- return null;
10906
- return [
10907
- parse_css_int(params[0]),
10908
- parse_css_int(params[1]),
10909
- parse_css_int(params[2]),
10910
- alpha
10911
- ];
10912
- case 'hsla':
10913
- if (params.length !== 4)
10914
- return null;
10915
- alpha = parse_css_float(params.pop());
10916
- // Fall through.
10917
- case 'hsl':
10918
- if (params.length !== 3)
10919
- return null;
10920
- var h = (parseFloat(params[0]) % 360 + 360) % 360 / 360;
10921
- // 0 .. 1
10922
- // NOTE(deanm): According to the CSS spec s/l should only be
10923
- // percentages, but we don't bother and let float or percentage.
10924
- var s = parse_css_float(params[1]);
10925
- var l = parse_css_float(params[2]);
10926
- var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
10927
- var m1 = l * 2 - m2;
10928
- return [
10929
- clamp_css_byte(css_hue_to_rgb(m1, m2, h + 1 / 3) * 255),
10930
- clamp_css_byte(css_hue_to_rgb(m1, m2, h) * 255),
10931
- clamp_css_byte(css_hue_to_rgb(m1, m2, h - 1 / 3) * 255),
10932
- alpha
10933
- ];
10934
- default:
10935
- return null;
10936
- }
10937
- }
10938
- return null;
10939
- }
10940
- try {
10941
- parseCSSColor_1 = csscolorparser.parseCSSColor = parseCSSColor;
10942
- } catch (e) {
9937
+ var hasRequiredCsscolorparser;
9938
+
9939
+ function requireCsscolorparser () {
9940
+ if (hasRequiredCsscolorparser) return csscolorparser;
9941
+ hasRequiredCsscolorparser = 1;
9942
+ // (c) Dean McNamee <dean@gmail.com>, 2012.
9943
+ //
9944
+ // https://github.com/deanm/css-color-parser-js
9945
+ //
9946
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
9947
+ // of this software and associated documentation files (the "Software"), to
9948
+ // deal in the Software without restriction, including without limitation the
9949
+ // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9950
+ // sell copies of the Software, and to permit persons to whom the Software is
9951
+ // furnished to do so, subject to the following conditions:
9952
+ //
9953
+ // The above copyright notice and this permission notice shall be included in
9954
+ // all copies or substantial portions of the Software.
9955
+ //
9956
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9957
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9958
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
9959
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9960
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9961
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
9962
+ // IN THE SOFTWARE.
9963
+ // http://www.w3.org/TR/css3-color/
9964
+ var kCSSColorTable = {
9965
+ 'transparent': [
9966
+ 0,
9967
+ 0,
9968
+ 0,
9969
+ 0
9970
+ ],
9971
+ 'aliceblue': [
9972
+ 240,
9973
+ 248,
9974
+ 255,
9975
+ 1
9976
+ ],
9977
+ 'antiquewhite': [
9978
+ 250,
9979
+ 235,
9980
+ 215,
9981
+ 1
9982
+ ],
9983
+ 'aqua': [
9984
+ 0,
9985
+ 255,
9986
+ 255,
9987
+ 1
9988
+ ],
9989
+ 'aquamarine': [
9990
+ 127,
9991
+ 255,
9992
+ 212,
9993
+ 1
9994
+ ],
9995
+ 'azure': [
9996
+ 240,
9997
+ 255,
9998
+ 255,
9999
+ 1
10000
+ ],
10001
+ 'beige': [
10002
+ 245,
10003
+ 245,
10004
+ 220,
10005
+ 1
10006
+ ],
10007
+ 'bisque': [
10008
+ 255,
10009
+ 228,
10010
+ 196,
10011
+ 1
10012
+ ],
10013
+ 'black': [
10014
+ 0,
10015
+ 0,
10016
+ 0,
10017
+ 1
10018
+ ],
10019
+ 'blanchedalmond': [
10020
+ 255,
10021
+ 235,
10022
+ 205,
10023
+ 1
10024
+ ],
10025
+ 'blue': [
10026
+ 0,
10027
+ 0,
10028
+ 255,
10029
+ 1
10030
+ ],
10031
+ 'blueviolet': [
10032
+ 138,
10033
+ 43,
10034
+ 226,
10035
+ 1
10036
+ ],
10037
+ 'brown': [
10038
+ 165,
10039
+ 42,
10040
+ 42,
10041
+ 1
10042
+ ],
10043
+ 'burlywood': [
10044
+ 222,
10045
+ 184,
10046
+ 135,
10047
+ 1
10048
+ ],
10049
+ 'cadetblue': [
10050
+ 95,
10051
+ 158,
10052
+ 160,
10053
+ 1
10054
+ ],
10055
+ 'chartreuse': [
10056
+ 127,
10057
+ 255,
10058
+ 0,
10059
+ 1
10060
+ ],
10061
+ 'chocolate': [
10062
+ 210,
10063
+ 105,
10064
+ 30,
10065
+ 1
10066
+ ],
10067
+ 'coral': [
10068
+ 255,
10069
+ 127,
10070
+ 80,
10071
+ 1
10072
+ ],
10073
+ 'cornflowerblue': [
10074
+ 100,
10075
+ 149,
10076
+ 237,
10077
+ 1
10078
+ ],
10079
+ 'cornsilk': [
10080
+ 255,
10081
+ 248,
10082
+ 220,
10083
+ 1
10084
+ ],
10085
+ 'crimson': [
10086
+ 220,
10087
+ 20,
10088
+ 60,
10089
+ 1
10090
+ ],
10091
+ 'cyan': [
10092
+ 0,
10093
+ 255,
10094
+ 255,
10095
+ 1
10096
+ ],
10097
+ 'darkblue': [
10098
+ 0,
10099
+ 0,
10100
+ 139,
10101
+ 1
10102
+ ],
10103
+ 'darkcyan': [
10104
+ 0,
10105
+ 139,
10106
+ 139,
10107
+ 1
10108
+ ],
10109
+ 'darkgoldenrod': [
10110
+ 184,
10111
+ 134,
10112
+ 11,
10113
+ 1
10114
+ ],
10115
+ 'darkgray': [
10116
+ 169,
10117
+ 169,
10118
+ 169,
10119
+ 1
10120
+ ],
10121
+ 'darkgreen': [
10122
+ 0,
10123
+ 100,
10124
+ 0,
10125
+ 1
10126
+ ],
10127
+ 'darkgrey': [
10128
+ 169,
10129
+ 169,
10130
+ 169,
10131
+ 1
10132
+ ],
10133
+ 'darkkhaki': [
10134
+ 189,
10135
+ 183,
10136
+ 107,
10137
+ 1
10138
+ ],
10139
+ 'darkmagenta': [
10140
+ 139,
10141
+ 0,
10142
+ 139,
10143
+ 1
10144
+ ],
10145
+ 'darkolivegreen': [
10146
+ 85,
10147
+ 107,
10148
+ 47,
10149
+ 1
10150
+ ],
10151
+ 'darkorange': [
10152
+ 255,
10153
+ 140,
10154
+ 0,
10155
+ 1
10156
+ ],
10157
+ 'darkorchid': [
10158
+ 153,
10159
+ 50,
10160
+ 204,
10161
+ 1
10162
+ ],
10163
+ 'darkred': [
10164
+ 139,
10165
+ 0,
10166
+ 0,
10167
+ 1
10168
+ ],
10169
+ 'darksalmon': [
10170
+ 233,
10171
+ 150,
10172
+ 122,
10173
+ 1
10174
+ ],
10175
+ 'darkseagreen': [
10176
+ 143,
10177
+ 188,
10178
+ 143,
10179
+ 1
10180
+ ],
10181
+ 'darkslateblue': [
10182
+ 72,
10183
+ 61,
10184
+ 139,
10185
+ 1
10186
+ ],
10187
+ 'darkslategray': [
10188
+ 47,
10189
+ 79,
10190
+ 79,
10191
+ 1
10192
+ ],
10193
+ 'darkslategrey': [
10194
+ 47,
10195
+ 79,
10196
+ 79,
10197
+ 1
10198
+ ],
10199
+ 'darkturquoise': [
10200
+ 0,
10201
+ 206,
10202
+ 209,
10203
+ 1
10204
+ ],
10205
+ 'darkviolet': [
10206
+ 148,
10207
+ 0,
10208
+ 211,
10209
+ 1
10210
+ ],
10211
+ 'deeppink': [
10212
+ 255,
10213
+ 20,
10214
+ 147,
10215
+ 1
10216
+ ],
10217
+ 'deepskyblue': [
10218
+ 0,
10219
+ 191,
10220
+ 255,
10221
+ 1
10222
+ ],
10223
+ 'dimgray': [
10224
+ 105,
10225
+ 105,
10226
+ 105,
10227
+ 1
10228
+ ],
10229
+ 'dimgrey': [
10230
+ 105,
10231
+ 105,
10232
+ 105,
10233
+ 1
10234
+ ],
10235
+ 'dodgerblue': [
10236
+ 30,
10237
+ 144,
10238
+ 255,
10239
+ 1
10240
+ ],
10241
+ 'firebrick': [
10242
+ 178,
10243
+ 34,
10244
+ 34,
10245
+ 1
10246
+ ],
10247
+ 'floralwhite': [
10248
+ 255,
10249
+ 250,
10250
+ 240,
10251
+ 1
10252
+ ],
10253
+ 'forestgreen': [
10254
+ 34,
10255
+ 139,
10256
+ 34,
10257
+ 1
10258
+ ],
10259
+ 'fuchsia': [
10260
+ 255,
10261
+ 0,
10262
+ 255,
10263
+ 1
10264
+ ],
10265
+ 'gainsboro': [
10266
+ 220,
10267
+ 220,
10268
+ 220,
10269
+ 1
10270
+ ],
10271
+ 'ghostwhite': [
10272
+ 248,
10273
+ 248,
10274
+ 255,
10275
+ 1
10276
+ ],
10277
+ 'gold': [
10278
+ 255,
10279
+ 215,
10280
+ 0,
10281
+ 1
10282
+ ],
10283
+ 'goldenrod': [
10284
+ 218,
10285
+ 165,
10286
+ 32,
10287
+ 1
10288
+ ],
10289
+ 'gray': [
10290
+ 128,
10291
+ 128,
10292
+ 128,
10293
+ 1
10294
+ ],
10295
+ 'green': [
10296
+ 0,
10297
+ 128,
10298
+ 0,
10299
+ 1
10300
+ ],
10301
+ 'greenyellow': [
10302
+ 173,
10303
+ 255,
10304
+ 47,
10305
+ 1
10306
+ ],
10307
+ 'grey': [
10308
+ 128,
10309
+ 128,
10310
+ 128,
10311
+ 1
10312
+ ],
10313
+ 'honeydew': [
10314
+ 240,
10315
+ 255,
10316
+ 240,
10317
+ 1
10318
+ ],
10319
+ 'hotpink': [
10320
+ 255,
10321
+ 105,
10322
+ 180,
10323
+ 1
10324
+ ],
10325
+ 'indianred': [
10326
+ 205,
10327
+ 92,
10328
+ 92,
10329
+ 1
10330
+ ],
10331
+ 'indigo': [
10332
+ 75,
10333
+ 0,
10334
+ 130,
10335
+ 1
10336
+ ],
10337
+ 'ivory': [
10338
+ 255,
10339
+ 255,
10340
+ 240,
10341
+ 1
10342
+ ],
10343
+ 'khaki': [
10344
+ 240,
10345
+ 230,
10346
+ 140,
10347
+ 1
10348
+ ],
10349
+ 'lavender': [
10350
+ 230,
10351
+ 230,
10352
+ 250,
10353
+ 1
10354
+ ],
10355
+ 'lavenderblush': [
10356
+ 255,
10357
+ 240,
10358
+ 245,
10359
+ 1
10360
+ ],
10361
+ 'lawngreen': [
10362
+ 124,
10363
+ 252,
10364
+ 0,
10365
+ 1
10366
+ ],
10367
+ 'lemonchiffon': [
10368
+ 255,
10369
+ 250,
10370
+ 205,
10371
+ 1
10372
+ ],
10373
+ 'lightblue': [
10374
+ 173,
10375
+ 216,
10376
+ 230,
10377
+ 1
10378
+ ],
10379
+ 'lightcoral': [
10380
+ 240,
10381
+ 128,
10382
+ 128,
10383
+ 1
10384
+ ],
10385
+ 'lightcyan': [
10386
+ 224,
10387
+ 255,
10388
+ 255,
10389
+ 1
10390
+ ],
10391
+ 'lightgoldenrodyellow': [
10392
+ 250,
10393
+ 250,
10394
+ 210,
10395
+ 1
10396
+ ],
10397
+ 'lightgray': [
10398
+ 211,
10399
+ 211,
10400
+ 211,
10401
+ 1
10402
+ ],
10403
+ 'lightgreen': [
10404
+ 144,
10405
+ 238,
10406
+ 144,
10407
+ 1
10408
+ ],
10409
+ 'lightgrey': [
10410
+ 211,
10411
+ 211,
10412
+ 211,
10413
+ 1
10414
+ ],
10415
+ 'lightpink': [
10416
+ 255,
10417
+ 182,
10418
+ 193,
10419
+ 1
10420
+ ],
10421
+ 'lightsalmon': [
10422
+ 255,
10423
+ 160,
10424
+ 122,
10425
+ 1
10426
+ ],
10427
+ 'lightseagreen': [
10428
+ 32,
10429
+ 178,
10430
+ 170,
10431
+ 1
10432
+ ],
10433
+ 'lightskyblue': [
10434
+ 135,
10435
+ 206,
10436
+ 250,
10437
+ 1
10438
+ ],
10439
+ 'lightslategray': [
10440
+ 119,
10441
+ 136,
10442
+ 153,
10443
+ 1
10444
+ ],
10445
+ 'lightslategrey': [
10446
+ 119,
10447
+ 136,
10448
+ 153,
10449
+ 1
10450
+ ],
10451
+ 'lightsteelblue': [
10452
+ 176,
10453
+ 196,
10454
+ 222,
10455
+ 1
10456
+ ],
10457
+ 'lightyellow': [
10458
+ 255,
10459
+ 255,
10460
+ 224,
10461
+ 1
10462
+ ],
10463
+ 'lime': [
10464
+ 0,
10465
+ 255,
10466
+ 0,
10467
+ 1
10468
+ ],
10469
+ 'limegreen': [
10470
+ 50,
10471
+ 205,
10472
+ 50,
10473
+ 1
10474
+ ],
10475
+ 'linen': [
10476
+ 250,
10477
+ 240,
10478
+ 230,
10479
+ 1
10480
+ ],
10481
+ 'magenta': [
10482
+ 255,
10483
+ 0,
10484
+ 255,
10485
+ 1
10486
+ ],
10487
+ 'maroon': [
10488
+ 128,
10489
+ 0,
10490
+ 0,
10491
+ 1
10492
+ ],
10493
+ 'mediumaquamarine': [
10494
+ 102,
10495
+ 205,
10496
+ 170,
10497
+ 1
10498
+ ],
10499
+ 'mediumblue': [
10500
+ 0,
10501
+ 0,
10502
+ 205,
10503
+ 1
10504
+ ],
10505
+ 'mediumorchid': [
10506
+ 186,
10507
+ 85,
10508
+ 211,
10509
+ 1
10510
+ ],
10511
+ 'mediumpurple': [
10512
+ 147,
10513
+ 112,
10514
+ 219,
10515
+ 1
10516
+ ],
10517
+ 'mediumseagreen': [
10518
+ 60,
10519
+ 179,
10520
+ 113,
10521
+ 1
10522
+ ],
10523
+ 'mediumslateblue': [
10524
+ 123,
10525
+ 104,
10526
+ 238,
10527
+ 1
10528
+ ],
10529
+ 'mediumspringgreen': [
10530
+ 0,
10531
+ 250,
10532
+ 154,
10533
+ 1
10534
+ ],
10535
+ 'mediumturquoise': [
10536
+ 72,
10537
+ 209,
10538
+ 204,
10539
+ 1
10540
+ ],
10541
+ 'mediumvioletred': [
10542
+ 199,
10543
+ 21,
10544
+ 133,
10545
+ 1
10546
+ ],
10547
+ 'midnightblue': [
10548
+ 25,
10549
+ 25,
10550
+ 112,
10551
+ 1
10552
+ ],
10553
+ 'mintcream': [
10554
+ 245,
10555
+ 255,
10556
+ 250,
10557
+ 1
10558
+ ],
10559
+ 'mistyrose': [
10560
+ 255,
10561
+ 228,
10562
+ 225,
10563
+ 1
10564
+ ],
10565
+ 'moccasin': [
10566
+ 255,
10567
+ 228,
10568
+ 181,
10569
+ 1
10570
+ ],
10571
+ 'navajowhite': [
10572
+ 255,
10573
+ 222,
10574
+ 173,
10575
+ 1
10576
+ ],
10577
+ 'navy': [
10578
+ 0,
10579
+ 0,
10580
+ 128,
10581
+ 1
10582
+ ],
10583
+ 'oldlace': [
10584
+ 253,
10585
+ 245,
10586
+ 230,
10587
+ 1
10588
+ ],
10589
+ 'olive': [
10590
+ 128,
10591
+ 128,
10592
+ 0,
10593
+ 1
10594
+ ],
10595
+ 'olivedrab': [
10596
+ 107,
10597
+ 142,
10598
+ 35,
10599
+ 1
10600
+ ],
10601
+ 'orange': [
10602
+ 255,
10603
+ 165,
10604
+ 0,
10605
+ 1
10606
+ ],
10607
+ 'orangered': [
10608
+ 255,
10609
+ 69,
10610
+ 0,
10611
+ 1
10612
+ ],
10613
+ 'orchid': [
10614
+ 218,
10615
+ 112,
10616
+ 214,
10617
+ 1
10618
+ ],
10619
+ 'palegoldenrod': [
10620
+ 238,
10621
+ 232,
10622
+ 170,
10623
+ 1
10624
+ ],
10625
+ 'palegreen': [
10626
+ 152,
10627
+ 251,
10628
+ 152,
10629
+ 1
10630
+ ],
10631
+ 'paleturquoise': [
10632
+ 175,
10633
+ 238,
10634
+ 238,
10635
+ 1
10636
+ ],
10637
+ 'palevioletred': [
10638
+ 219,
10639
+ 112,
10640
+ 147,
10641
+ 1
10642
+ ],
10643
+ 'papayawhip': [
10644
+ 255,
10645
+ 239,
10646
+ 213,
10647
+ 1
10648
+ ],
10649
+ 'peachpuff': [
10650
+ 255,
10651
+ 218,
10652
+ 185,
10653
+ 1
10654
+ ],
10655
+ 'peru': [
10656
+ 205,
10657
+ 133,
10658
+ 63,
10659
+ 1
10660
+ ],
10661
+ 'pink': [
10662
+ 255,
10663
+ 192,
10664
+ 203,
10665
+ 1
10666
+ ],
10667
+ 'plum': [
10668
+ 221,
10669
+ 160,
10670
+ 221,
10671
+ 1
10672
+ ],
10673
+ 'powderblue': [
10674
+ 176,
10675
+ 224,
10676
+ 230,
10677
+ 1
10678
+ ],
10679
+ 'purple': [
10680
+ 128,
10681
+ 0,
10682
+ 128,
10683
+ 1
10684
+ ],
10685
+ 'rebeccapurple': [
10686
+ 102,
10687
+ 51,
10688
+ 153,
10689
+ 1
10690
+ ],
10691
+ 'red': [
10692
+ 255,
10693
+ 0,
10694
+ 0,
10695
+ 1
10696
+ ],
10697
+ 'rosybrown': [
10698
+ 188,
10699
+ 143,
10700
+ 143,
10701
+ 1
10702
+ ],
10703
+ 'royalblue': [
10704
+ 65,
10705
+ 105,
10706
+ 225,
10707
+ 1
10708
+ ],
10709
+ 'saddlebrown': [
10710
+ 139,
10711
+ 69,
10712
+ 19,
10713
+ 1
10714
+ ],
10715
+ 'salmon': [
10716
+ 250,
10717
+ 128,
10718
+ 114,
10719
+ 1
10720
+ ],
10721
+ 'sandybrown': [
10722
+ 244,
10723
+ 164,
10724
+ 96,
10725
+ 1
10726
+ ],
10727
+ 'seagreen': [
10728
+ 46,
10729
+ 139,
10730
+ 87,
10731
+ 1
10732
+ ],
10733
+ 'seashell': [
10734
+ 255,
10735
+ 245,
10736
+ 238,
10737
+ 1
10738
+ ],
10739
+ 'sienna': [
10740
+ 160,
10741
+ 82,
10742
+ 45,
10743
+ 1
10744
+ ],
10745
+ 'silver': [
10746
+ 192,
10747
+ 192,
10748
+ 192,
10749
+ 1
10750
+ ],
10751
+ 'skyblue': [
10752
+ 135,
10753
+ 206,
10754
+ 235,
10755
+ 1
10756
+ ],
10757
+ 'slateblue': [
10758
+ 106,
10759
+ 90,
10760
+ 205,
10761
+ 1
10762
+ ],
10763
+ 'slategray': [
10764
+ 112,
10765
+ 128,
10766
+ 144,
10767
+ 1
10768
+ ],
10769
+ 'slategrey': [
10770
+ 112,
10771
+ 128,
10772
+ 144,
10773
+ 1
10774
+ ],
10775
+ 'snow': [
10776
+ 255,
10777
+ 250,
10778
+ 250,
10779
+ 1
10780
+ ],
10781
+ 'springgreen': [
10782
+ 0,
10783
+ 255,
10784
+ 127,
10785
+ 1
10786
+ ],
10787
+ 'steelblue': [
10788
+ 70,
10789
+ 130,
10790
+ 180,
10791
+ 1
10792
+ ],
10793
+ 'tan': [
10794
+ 210,
10795
+ 180,
10796
+ 140,
10797
+ 1
10798
+ ],
10799
+ 'teal': [
10800
+ 0,
10801
+ 128,
10802
+ 128,
10803
+ 1
10804
+ ],
10805
+ 'thistle': [
10806
+ 216,
10807
+ 191,
10808
+ 216,
10809
+ 1
10810
+ ],
10811
+ 'tomato': [
10812
+ 255,
10813
+ 99,
10814
+ 71,
10815
+ 1
10816
+ ],
10817
+ 'turquoise': [
10818
+ 64,
10819
+ 224,
10820
+ 208,
10821
+ 1
10822
+ ],
10823
+ 'violet': [
10824
+ 238,
10825
+ 130,
10826
+ 238,
10827
+ 1
10828
+ ],
10829
+ 'wheat': [
10830
+ 245,
10831
+ 222,
10832
+ 179,
10833
+ 1
10834
+ ],
10835
+ 'white': [
10836
+ 255,
10837
+ 255,
10838
+ 255,
10839
+ 1
10840
+ ],
10841
+ 'whitesmoke': [
10842
+ 245,
10843
+ 245,
10844
+ 245,
10845
+ 1
10846
+ ],
10847
+ 'yellow': [
10848
+ 255,
10849
+ 255,
10850
+ 0,
10851
+ 1
10852
+ ],
10853
+ 'yellowgreen': [
10854
+ 154,
10855
+ 205,
10856
+ 50,
10857
+ 1
10858
+ ]
10859
+ };
10860
+ function clamp_css_byte(i) {
10861
+ // Clamp to integer 0 .. 255.
10862
+ i = Math.round(i);
10863
+ // Seems to be what Chrome does (vs truncation).
10864
+ return i < 0 ? 0 : i > 255 ? 255 : i;
10865
+ }
10866
+ function clamp_css_float(f) {
10867
+ // Clamp to float 0.0 .. 1.0.
10868
+ return f < 0 ? 0 : f > 1 ? 1 : f;
10869
+ }
10870
+ function parse_css_int(str) {
10871
+ // int or percentage.
10872
+ if (str[str.length - 1] === '%')
10873
+ return clamp_css_byte(parseFloat(str) / 100 * 255);
10874
+ return clamp_css_byte(parseInt(str));
10875
+ }
10876
+ function parse_css_float(str) {
10877
+ // float or percentage.
10878
+ if (str[str.length - 1] === '%')
10879
+ return clamp_css_float(parseFloat(str) / 100);
10880
+ return clamp_css_float(parseFloat(str));
10881
+ }
10882
+ function css_hue_to_rgb(m1, m2, h) {
10883
+ if (h < 0)
10884
+ h += 1;
10885
+ else if (h > 1)
10886
+ h -= 1;
10887
+ if (h * 6 < 1)
10888
+ return m1 + (m2 - m1) * h * 6;
10889
+ if (h * 2 < 1)
10890
+ return m2;
10891
+ if (h * 3 < 2)
10892
+ return m1 + (m2 - m1) * (2 / 3 - h) * 6;
10893
+ return m1;
10894
+ }
10895
+ function parseCSSColor(css_str) {
10896
+ // Remove all whitespace, not compliant, but should just be more accepting.
10897
+ var str = css_str.replace(/ /g, '').toLowerCase();
10898
+ // Color keywords (and transparent) lookup.
10899
+ if (str in kCSSColorTable)
10900
+ return kCSSColorTable[str].slice();
10901
+ // dup.
10902
+ // #abc and #abc123 syntax.
10903
+ if (str[0] === '#') {
10904
+ if (str.length === 4) {
10905
+ var iv = parseInt(str.substr(1), 16);
10906
+ // TODO(deanm): Stricter parsing.
10907
+ if (!(iv >= 0 && iv <= 4095))
10908
+ return null;
10909
+ // Covers NaN.
10910
+ return [
10911
+ (iv & 3840) >> 4 | (iv & 3840) >> 8,
10912
+ iv & 240 | (iv & 240) >> 4,
10913
+ iv & 15 | (iv & 15) << 4,
10914
+ 1
10915
+ ];
10916
+ } else if (str.length === 7) {
10917
+ var iv = parseInt(str.substr(1), 16);
10918
+ // TODO(deanm): Stricter parsing.
10919
+ if (!(iv >= 0 && iv <= 16777215))
10920
+ return null;
10921
+ // Covers NaN.
10922
+ return [
10923
+ (iv & 16711680) >> 16,
10924
+ (iv & 65280) >> 8,
10925
+ iv & 255,
10926
+ 1
10927
+ ];
10928
+ }
10929
+ return null;
10930
+ }
10931
+ var op = str.indexOf('('), ep = str.indexOf(')');
10932
+ if (op !== -1 && ep + 1 === str.length) {
10933
+ var fname = str.substr(0, op);
10934
+ var params = str.substr(op + 1, ep - (op + 1)).split(',');
10935
+ var alpha = 1;
10936
+ // To allow case fallthrough.
10937
+ switch (fname) {
10938
+ case 'rgba':
10939
+ if (params.length !== 4)
10940
+ return null;
10941
+ alpha = parse_css_float(params.pop());
10942
+ // Fall through.
10943
+ case 'rgb':
10944
+ if (params.length !== 3)
10945
+ return null;
10946
+ return [
10947
+ parse_css_int(params[0]),
10948
+ parse_css_int(params[1]),
10949
+ parse_css_int(params[2]),
10950
+ alpha
10951
+ ];
10952
+ case 'hsla':
10953
+ if (params.length !== 4)
10954
+ return null;
10955
+ alpha = parse_css_float(params.pop());
10956
+ // Fall through.
10957
+ case 'hsl':
10958
+ if (params.length !== 3)
10959
+ return null;
10960
+ var h = (parseFloat(params[0]) % 360 + 360) % 360 / 360;
10961
+ // 0 .. 1
10962
+ // NOTE(deanm): According to the CSS spec s/l should only be
10963
+ // percentages, but we don't bother and let float or percentage.
10964
+ var s = parse_css_float(params[1]);
10965
+ var l = parse_css_float(params[2]);
10966
+ var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
10967
+ var m1 = l * 2 - m2;
10968
+ return [
10969
+ clamp_css_byte(css_hue_to_rgb(m1, m2, h + 1 / 3) * 255),
10970
+ clamp_css_byte(css_hue_to_rgb(m1, m2, h) * 255),
10971
+ clamp_css_byte(css_hue_to_rgb(m1, m2, h - 1 / 3) * 255),
10972
+ alpha
10973
+ ];
10974
+ default:
10975
+ return null;
10976
+ }
10977
+ }
10978
+ return null;
10979
+ }
10980
+ try {
10981
+ csscolorparser.parseCSSColor = parseCSSColor;
10982
+ } catch (e) {
10983
+ }
10984
+ return csscolorparser;
10943
10985
  }
10944
10986
 
10987
+ var csscolorparserExports = requireCsscolorparser();
10988
+
10945
10989
  function number(a, b, t) {
10946
10990
  return a * (1 - t) + b * t;
10947
10991
  }
@@ -10982,7 +11026,7 @@
10982
11026
  if (typeof input !== 'string') {
10983
11027
  return void 0;
10984
11028
  }
10985
- const rgba = parseCSSColor_1(input);
11029
+ const rgba = csscolorparserExports.parseCSSColor(input);
10986
11030
  if (!rgba) {
10987
11031
  return void 0;
10988
11032
  }
@@ -14089,72 +14133,81 @@
14089
14133
  }
14090
14134
  }
14091
14135
 
14092
- var unitbezier = UnitBezier;
14093
- function UnitBezier(p1x, p1y, p2x, p2y) {
14094
- // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).
14095
- this.cx = 3 * p1x;
14096
- this.bx = 3 * (p2x - p1x) - this.cx;
14097
- this.ax = 1 - this.cx - this.bx;
14098
- this.cy = 3 * p1y;
14099
- this.by = 3 * (p2y - p1y) - this.cy;
14100
- this.ay = 1 - this.cy - this.by;
14101
- this.p1x = p1x;
14102
- this.p1y = p1y;
14103
- this.p2x = p2x;
14104
- this.p2y = p2y;
14105
- }
14106
- UnitBezier.prototype = {
14107
- sampleCurveX: function (t) {
14108
- // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.
14109
- return ((this.ax * t + this.bx) * t + this.cx) * t;
14110
- },
14111
- sampleCurveY: function (t) {
14112
- return ((this.ay * t + this.by) * t + this.cy) * t;
14113
- },
14114
- sampleCurveDerivativeX: function (t) {
14115
- return (3 * this.ax * t + 2 * this.bx) * t + this.cx;
14116
- },
14117
- solveCurveX: function (x, epsilon) {
14118
- if (epsilon === undefined)
14119
- epsilon = 0.000001;
14120
- if (x < 0)
14121
- return 0;
14122
- if (x > 1)
14123
- return 1;
14124
- var t = x;
14125
- // First try a few iterations of Newton's method - normally very fast.
14126
- for (var i = 0; i < 8; i++) {
14127
- var x2 = this.sampleCurveX(t) - x;
14128
- if (Math.abs(x2) < epsilon)
14129
- return t;
14130
- var d2 = this.sampleCurveDerivativeX(t);
14131
- if (Math.abs(d2) < 0.000001)
14132
- break;
14133
- t = t - x2 / d2;
14134
- }
14135
- // Fall back to the bisection method for reliability.
14136
- var t0 = 0;
14137
- var t1 = 1;
14138
- t = x;
14139
- for (i = 0; i < 20; i++) {
14140
- x2 = this.sampleCurveX(t);
14141
- if (Math.abs(x2 - x) < epsilon)
14142
- break;
14143
- if (x > x2) {
14144
- t0 = t;
14145
- } else {
14146
- t1 = t;
14147
- }
14148
- t = (t1 - t0) * 0.5 + t0;
14149
- }
14150
- return t;
14151
- },
14152
- solve: function (x, epsilon) {
14153
- return this.sampleCurveY(this.solveCurveX(x, epsilon));
14154
- }
14155
- };
14136
+ var unitbezier;
14137
+ var hasRequiredUnitbezier;
14138
+
14139
+ function requireUnitbezier () {
14140
+ if (hasRequiredUnitbezier) return unitbezier;
14141
+ hasRequiredUnitbezier = 1;
14142
+ unitbezier = UnitBezier;
14143
+ function UnitBezier(p1x, p1y, p2x, p2y) {
14144
+ // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).
14145
+ this.cx = 3 * p1x;
14146
+ this.bx = 3 * (p2x - p1x) - this.cx;
14147
+ this.ax = 1 - this.cx - this.bx;
14148
+ this.cy = 3 * p1y;
14149
+ this.by = 3 * (p2y - p1y) - this.cy;
14150
+ this.ay = 1 - this.cy - this.by;
14151
+ this.p1x = p1x;
14152
+ this.p1y = p1y;
14153
+ this.p2x = p2x;
14154
+ this.p2y = p2y;
14155
+ }
14156
+ UnitBezier.prototype = {
14157
+ sampleCurveX: function (t) {
14158
+ // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.
14159
+ return ((this.ax * t + this.bx) * t + this.cx) * t;
14160
+ },
14161
+ sampleCurveY: function (t) {
14162
+ return ((this.ay * t + this.by) * t + this.cy) * t;
14163
+ },
14164
+ sampleCurveDerivativeX: function (t) {
14165
+ return (3 * this.ax * t + 2 * this.bx) * t + this.cx;
14166
+ },
14167
+ solveCurveX: function (x, epsilon) {
14168
+ if (epsilon === undefined)
14169
+ epsilon = 0.000001;
14170
+ if (x < 0)
14171
+ return 0;
14172
+ if (x > 1)
14173
+ return 1;
14174
+ var t = x;
14175
+ // First try a few iterations of Newton's method - normally very fast.
14176
+ for (var i = 0; i < 8; i++) {
14177
+ var x2 = this.sampleCurveX(t) - x;
14178
+ if (Math.abs(x2) < epsilon)
14179
+ return t;
14180
+ var d2 = this.sampleCurveDerivativeX(t);
14181
+ if (Math.abs(d2) < 0.000001)
14182
+ break;
14183
+ t = t - x2 / d2;
14184
+ }
14185
+ // Fall back to the bisection method for reliability.
14186
+ var t0 = 0;
14187
+ var t1 = 1;
14188
+ t = x;
14189
+ for (i = 0; i < 20; i++) {
14190
+ x2 = this.sampleCurveX(t);
14191
+ if (Math.abs(x2 - x) < epsilon)
14192
+ break;
14193
+ if (x > x2) {
14194
+ t0 = t;
14195
+ } else {
14196
+ t1 = t;
14197
+ }
14198
+ t = (t1 - t0) * 0.5 + t0;
14199
+ }
14200
+ return t;
14201
+ },
14202
+ solve: function (x, epsilon) {
14203
+ return this.sampleCurveY(this.solveCurveX(x, epsilon));
14204
+ }
14205
+ };
14206
+ return unitbezier;
14207
+ }
14156
14208
 
14157
- var UnitBezier$1 = /*@__PURE__*/getDefaultExportFromCjs(unitbezier);
14209
+ var unitbezierExports = requireUnitbezier();
14210
+ var UnitBezier = /*@__PURE__*/getDefaultExportFromCjs(unitbezierExports);
14158
14211
 
14159
14212
  const Xn = 0.95047, Yn = 1, Zn = 1.08883, t0 = 4 / 29, t1 = 6 / 29, t2 = 3 * t1 * t1, t3 = t1 * t1 * t1, deg2rad = Math.PI / 180, rad2deg = 180 / Math.PI;
14160
14213
  function xyz2lab(t) {
@@ -14264,7 +14317,7 @@
14264
14317
  t = exponentialInterpolation(input, 1, lower, upper);
14265
14318
  } else if (interpolation.name === 'cubic-bezier') {
14266
14319
  const c = interpolation.controlPoints;
14267
- const ub = new UnitBezier$1(c[0], c[1], c[2], c[3]);
14320
+ const ub = new UnitBezier(c[0], c[1], c[2], c[3]);
14268
14321
  t = ub.solve(exponentialInterpolation(input, 1, lower, upper));
14269
14322
  }
14270
14323
  return t;
@@ -18294,7 +18347,7 @@ ${ JSON.stringify(filterExp, null, 2) }
18294
18347
  if (type !== 'string') {
18295
18348
  return [new ValidationError(key, value, `color expected, ${ type } found`)];
18296
18349
  }
18297
- if (parseCSSColor_1(value) === null) {
18350
+ if (csscolorparserExports.parseCSSColor(value) === null) {
18298
18351
  return [new ValidationError(key, value, `color expected, "${ value }" found`)];
18299
18352
  }
18300
18353
  return [];
@@ -19126,1059 +19179,1067 @@ Use an identity property function instead: ${ example }.`)];
19126
19179
 
19127
19180
  /* parser generated by jison 0.4.15 */
19128
19181
 
19129
- (function (exports) {
19130
- /*
19131
- Returns a Parser object of the following structure:
19182
+ var hasRequiredJsonlint;
19132
19183
 
19133
- Parser: {
19134
- yy: {}
19135
- }
19184
+ function requireJsonlint () {
19185
+ if (hasRequiredJsonlint) return jsonlint$1;
19186
+ hasRequiredJsonlint = 1;
19187
+ (function (exports) {
19188
+ /*
19189
+ Returns a Parser object of the following structure:
19136
19190
 
19137
- Parser.prototype: {
19138
- yy: {},
19139
- trace: function(),
19140
- symbols_: {associative list: name ==> number},
19141
- terminals_: {associative list: number ==> name},
19142
- productions_: [...],
19143
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
19144
- table: [...],
19145
- defaultActions: {...},
19146
- parseError: function(str, hash),
19147
- parse: function(input),
19191
+ Parser: {
19192
+ yy: {}
19193
+ }
19148
19194
 
19149
- lexer: {
19150
- EOF: 1,
19151
- parseError: function(str, hash),
19152
- setInput: function(input),
19153
- input: function(),
19154
- unput: function(str),
19155
- more: function(),
19156
- less: function(n),
19157
- pastInput: function(),
19158
- upcomingInput: function(),
19159
- showPosition: function(),
19160
- test_match: function(regex_match_array, rule_index),
19161
- next: function(),
19162
- lex: function(),
19163
- begin: function(condition),
19164
- popState: function(),
19165
- _currentRules: function(),
19166
- topState: function(),
19167
- pushState: function(condition),
19195
+ Parser.prototype: {
19196
+ yy: {},
19197
+ trace: function(),
19198
+ symbols_: {associative list: name ==> number},
19199
+ terminals_: {associative list: number ==> name},
19200
+ productions_: [...],
19201
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
19202
+ table: [...],
19203
+ defaultActions: {...},
19204
+ parseError: function(str, hash),
19205
+ parse: function(input),
19168
19206
 
19169
- options: {
19170
- ranges: boolean (optional: true ==> token location info will include a .range[] member)
19171
- flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
19172
- backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
19173
- },
19207
+ lexer: {
19208
+ EOF: 1,
19209
+ parseError: function(str, hash),
19210
+ setInput: function(input),
19211
+ input: function(),
19212
+ unput: function(str),
19213
+ more: function(),
19214
+ less: function(n),
19215
+ pastInput: function(),
19216
+ upcomingInput: function(),
19217
+ showPosition: function(),
19218
+ test_match: function(regex_match_array, rule_index),
19219
+ next: function(),
19220
+ lex: function(),
19221
+ begin: function(condition),
19222
+ popState: function(),
19223
+ _currentRules: function(),
19224
+ topState: function(),
19225
+ pushState: function(condition),
19174
19226
 
19175
- performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
19176
- rules: [...],
19177
- conditions: {associative list: name ==> set},
19178
- }
19179
- }
19227
+ options: {
19228
+ ranges: boolean (optional: true ==> token location info will include a .range[] member)
19229
+ flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
19230
+ backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
19231
+ },
19180
19232
 
19233
+ performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
19234
+ rules: [...],
19235
+ conditions: {associative list: name ==> set},
19236
+ }
19237
+ }
19181
19238
 
19182
- token location info (@$, _$, etc.): {
19183
- first_line: n,
19184
- last_line: n,
19185
- first_column: n,
19186
- last_column: n,
19187
- range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
19188
- }
19189
19239
 
19240
+ token location info (@$, _$, etc.): {
19241
+ first_line: n,
19242
+ last_line: n,
19243
+ first_column: n,
19244
+ last_column: n,
19245
+ range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
19246
+ }
19190
19247
 
19191
- the parseError function receives a 'hash' object with these members for lexer and parser errors: {
19192
- text: (matched text)
19193
- token: (the produced terminal token, if any)
19194
- line: (yylineno)
19195
- }
19196
- while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
19197
- loc: (yylloc)
19198
- expected: (string describing the set of expected tokens)
19199
- recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
19200
- }
19201
- */
19202
- var parser = (function () {
19203
- var o = function (k, v, o, l) {
19204
- for (o = o || {}, l = k.length; l--; o[k[l]] = v);
19205
- return o;
19206
- }, $V0 = [
19207
- 1,
19208
- 12
19209
- ], $V1 = [
19210
- 1,
19211
- 13
19212
- ], $V2 = [
19213
- 1,
19214
- 9
19215
- ], $V3 = [
19216
- 1,
19217
- 10
19218
- ], $V4 = [
19219
- 1,
19220
- 11
19221
- ], $V5 = [
19222
- 1,
19223
- 14
19224
- ], $V6 = [
19225
- 1,
19226
- 15
19227
- ], $V7 = [
19228
- 14,
19229
- 18,
19230
- 22,
19231
- 24
19232
- ], $V8 = [
19233
- 18,
19234
- 22
19235
- ], $V9 = [
19236
- 22,
19237
- 24
19238
- ];
19239
- var parser = {
19240
- trace: function trace() {
19241
- },
19242
- yy: {},
19243
- symbols_: {
19244
- 'error': 2,
19245
- 'JSONString': 3,
19246
- 'STRING': 4,
19247
- 'JSONNumber': 5,
19248
- 'NUMBER': 6,
19249
- 'JSONNullLiteral': 7,
19250
- 'NULL': 8,
19251
- 'JSONBooleanLiteral': 9,
19252
- 'TRUE': 10,
19253
- 'FALSE': 11,
19254
- 'JSONText': 12,
19255
- 'JSONValue': 13,
19256
- 'EOF': 14,
19257
- 'JSONObject': 15,
19258
- 'JSONArray': 16,
19259
- '{': 17,
19260
- '}': 18,
19261
- 'JSONMemberList': 19,
19262
- 'JSONMember': 20,
19263
- ':': 21,
19264
- ',': 22,
19265
- '[': 23,
19266
- ']': 24,
19267
- 'JSONElementList': 25,
19268
- '$accept': 0,
19269
- '$end': 1
19270
- },
19271
- terminals_: {
19272
- 2: 'error',
19273
- 4: 'STRING',
19274
- 6: 'NUMBER',
19275
- 8: 'NULL',
19276
- 10: 'TRUE',
19277
- 11: 'FALSE',
19278
- 14: 'EOF',
19279
- 17: '{',
19280
- 18: '}',
19281
- 21: ':',
19282
- 22: ',',
19283
- 23: '[',
19284
- 24: ']'
19285
- },
19286
- productions_: [
19287
- 0,
19288
- [
19289
- 3,
19290
- 1
19291
- ],
19292
- [
19293
- 5,
19294
- 1
19295
- ],
19296
- [
19297
- 7,
19298
- 1
19299
- ],
19300
- [
19301
- 9,
19302
- 1
19303
- ],
19304
- [
19305
- 9,
19306
- 1
19307
- ],
19308
- [
19309
- 12,
19310
- 2
19311
- ],
19312
- [
19313
- 13,
19314
- 1
19315
- ],
19316
- [
19317
- 13,
19318
- 1
19319
- ],
19320
- [
19321
- 13,
19322
- 1
19323
- ],
19324
- [
19325
- 13,
19326
- 1
19327
- ],
19328
- [
19329
- 13,
19330
- 1
19331
- ],
19332
- [
19333
- 13,
19334
- 1
19335
- ],
19336
- [
19337
- 15,
19338
- 2
19339
- ],
19340
- [
19341
- 15,
19342
- 3
19343
- ],
19344
- [
19345
- 20,
19346
- 3
19347
- ],
19348
- [
19349
- 19,
19350
- 1
19351
- ],
19352
- [
19353
- 19,
19354
- 3
19355
- ],
19356
- [
19357
- 16,
19358
- 2
19359
- ],
19360
- [
19361
- 16,
19362
- 3
19363
- ],
19364
- [
19365
- 25,
19366
- 1
19367
- ],
19368
- [
19369
- 25,
19370
- 3
19371
- ]
19372
- ],
19373
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
19374
- /* this == yyval */
19375
- var $0 = $$.length - 1;
19376
- switch (yystate) {
19377
- case 1:
19378
- // replace escaped characters with actual character
19379
- this.$ = new String(yytext.replace(/\\(\\|")/g, '$' + '1').replace(/\\n/g, '\n').replace(/\\r/g, '\r').replace(/\\t/g, '\t').replace(/\\v/g, '\x0B').replace(/\\f/g, '\f').replace(/\\b/g, '\b'));
19380
- this.$.__line__ = this._$.first_line;
19381
- break;
19382
- case 2:
19383
- this.$ = new Number(yytext);
19384
- this.$.__line__ = this._$.first_line;
19385
- break;
19386
- case 3:
19387
- this.$ = null;
19388
- break;
19389
- case 4:
19390
- this.$ = new Boolean(true);
19391
- this.$.__line__ = this._$.first_line;
19392
- break;
19393
- case 5:
19394
- this.$ = new Boolean(false);
19395
- this.$.__line__ = this._$.first_line;
19396
- break;
19397
- case 6:
19398
- return this.$ = $$[$0 - 1];
19399
- case 13:
19400
- this.$ = {};
19401
- Object.defineProperty(this.$, '__line__', {
19402
- value: this._$.first_line,
19403
- enumerable: false
19404
- });
19405
- break;
19406
- case 14:
19407
- case 19:
19408
- this.$ = $$[$0 - 1];
19409
- Object.defineProperty(this.$, '__line__', {
19410
- value: this._$.first_line,
19411
- enumerable: false
19412
- });
19413
- break;
19414
- case 15:
19415
- this.$ = [
19416
- $$[$0 - 2],
19417
- $$[$0]
19418
- ];
19419
- break;
19420
- case 16:
19421
- this.$ = {};
19422
- this.$[$$[$0][0]] = $$[$0][1];
19423
- break;
19424
- case 17:
19425
- this.$ = $$[$0 - 2];
19426
- $$[$0 - 2][$$[$0][0]] = $$[$0][1];
19427
- break;
19428
- case 18:
19429
- this.$ = [];
19430
- Object.defineProperty(this.$, '__line__', {
19431
- value: this._$.first_line,
19432
- enumerable: false
19433
- });
19434
- break;
19435
- case 20:
19436
- this.$ = [$$[$0]];
19437
- break;
19438
- case 21:
19439
- this.$ = $$[$0 - 2];
19440
- $$[$0 - 2].push($$[$0]);
19441
- break;
19442
- }
19443
- },
19444
- table: [
19445
- {
19446
- 3: 5,
19447
- 4: $V0,
19448
- 5: 6,
19449
- 6: $V1,
19450
- 7: 3,
19451
- 8: $V2,
19452
- 9: 4,
19453
- 10: $V3,
19454
- 11: $V4,
19455
- 12: 1,
19456
- 13: 2,
19457
- 15: 7,
19458
- 16: 8,
19459
- 17: $V5,
19460
- 23: $V6
19461
- },
19462
- { 1: [3] },
19463
- {
19464
- 14: [
19465
- 1,
19466
- 16
19467
- ]
19468
- },
19469
- o($V7, [
19470
- 2,
19471
- 7
19472
- ]),
19473
- o($V7, [
19474
- 2,
19475
- 8
19476
- ]),
19477
- o($V7, [
19478
- 2,
19479
- 9
19480
- ]),
19481
- o($V7, [
19482
- 2,
19483
- 10
19484
- ]),
19485
- o($V7, [
19486
- 2,
19487
- 11
19488
- ]),
19489
- o($V7, [
19490
- 2,
19491
- 12
19492
- ]),
19493
- o($V7, [
19494
- 2,
19495
- 3
19496
- ]),
19497
- o($V7, [
19498
- 2,
19499
- 4
19500
- ]),
19501
- o($V7, [
19502
- 2,
19503
- 5
19504
- ]),
19505
- o([
19506
- 14,
19507
- 18,
19508
- 21,
19509
- 22,
19510
- 24
19511
- ], [
19512
- 2,
19513
- 1
19514
- ]),
19515
- o($V7, [
19516
- 2,
19517
- 2
19518
- ]),
19519
- {
19520
- 3: 20,
19521
- 4: $V0,
19522
- 18: [
19523
- 1,
19524
- 17
19525
- ],
19526
- 19: 18,
19527
- 20: 19
19528
- },
19529
- {
19530
- 3: 5,
19531
- 4: $V0,
19532
- 5: 6,
19533
- 6: $V1,
19534
- 7: 3,
19535
- 8: $V2,
19536
- 9: 4,
19537
- 10: $V3,
19538
- 11: $V4,
19539
- 13: 23,
19540
- 15: 7,
19541
- 16: 8,
19542
- 17: $V5,
19543
- 23: $V6,
19544
- 24: [
19545
- 1,
19546
- 21
19547
- ],
19548
- 25: 22
19549
- },
19550
- {
19551
- 1: [
19552
- 2,
19553
- 6
19554
- ]
19555
- },
19556
- o($V7, [
19557
- 2,
19558
- 13
19559
- ]),
19560
- {
19561
- 18: [
19562
- 1,
19563
- 24
19564
- ],
19565
- 22: [
19566
- 1,
19567
- 25
19568
- ]
19569
- },
19570
- o($V8, [
19571
- 2,
19572
- 16
19573
- ]),
19574
- {
19575
- 21: [
19576
- 1,
19577
- 26
19578
- ]
19579
- },
19580
- o($V7, [
19581
- 2,
19582
- 18
19583
- ]),
19584
- {
19585
- 22: [
19586
- 1,
19587
- 28
19588
- ],
19589
- 24: [
19590
- 1,
19591
- 27
19592
- ]
19593
- },
19594
- o($V9, [
19595
- 2,
19596
- 20
19597
- ]),
19598
- o($V7, [
19599
- 2,
19600
- 14
19601
- ]),
19602
- {
19603
- 3: 20,
19604
- 4: $V0,
19605
- 20: 29
19606
- },
19607
- {
19608
- 3: 5,
19609
- 4: $V0,
19610
- 5: 6,
19611
- 6: $V1,
19612
- 7: 3,
19613
- 8: $V2,
19614
- 9: 4,
19615
- 10: $V3,
19616
- 11: $V4,
19617
- 13: 30,
19618
- 15: 7,
19619
- 16: 8,
19620
- 17: $V5,
19621
- 23: $V6
19622
- },
19623
- o($V7, [
19624
- 2,
19625
- 19
19626
- ]),
19627
- {
19628
- 3: 5,
19629
- 4: $V0,
19630
- 5: 6,
19631
- 6: $V1,
19632
- 7: 3,
19633
- 8: $V2,
19634
- 9: 4,
19635
- 10: $V3,
19636
- 11: $V4,
19637
- 13: 31,
19638
- 15: 7,
19639
- 16: 8,
19640
- 17: $V5,
19641
- 23: $V6
19642
- },
19643
- o($V8, [
19644
- 2,
19645
- 17
19646
- ]),
19647
- o($V8, [
19648
- 2,
19649
- 15
19650
- ]),
19651
- o($V9, [
19652
- 2,
19653
- 21
19654
- ])
19655
- ],
19656
- defaultActions: {
19657
- 16: [
19658
- 2,
19659
- 6
19660
- ]
19661
- },
19662
- parseError: function parseError(str, hash) {
19663
- if (hash.recoverable) {
19664
- this.trace(str);
19665
- } else {
19666
- throw new Error(str);
19667
- }
19668
- },
19669
- parse: function parse(input) {
19670
- var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
19671
- var args = lstack.slice.call(arguments, 1);
19672
- var lexer = Object.create(this.lexer);
19673
- var sharedState = { yy: {} };
19674
- for (var k in this.yy) {
19675
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
19676
- sharedState.yy[k] = this.yy[k];
19677
- }
19678
- }
19679
- lexer.setInput(input, sharedState.yy);
19680
- sharedState.yy.lexer = lexer;
19681
- sharedState.yy.parser = this;
19682
- if (typeof lexer.yylloc == 'undefined') {
19683
- lexer.yylloc = {};
19684
- }
19685
- var yyloc = lexer.yylloc;
19686
- lstack.push(yyloc);
19687
- var ranges = lexer.options && lexer.options.ranges;
19688
- if (typeof sharedState.yy.parseError === 'function') {
19689
- this.parseError = sharedState.yy.parseError;
19690
- } else {
19691
- this.parseError = Object.getPrototypeOf(this).parseError;
19692
- }
19693
- function lex() {
19694
- var token;
19695
- token = lexer.lex() || EOF;
19696
- if (typeof token !== 'number') {
19697
- token = self.symbols_[token] || token;
19698
- }
19699
- return token;
19700
- }
19701
- var symbol, state, action, r, yyval = {}, p, len, newState, expected;
19702
- while (true) {
19703
- state = stack[stack.length - 1];
19704
- if (this.defaultActions[state]) {
19705
- action = this.defaultActions[state];
19706
- } else {
19707
- if (symbol === null || typeof symbol == 'undefined') {
19708
- symbol = lex();
19709
- }
19710
- action = table[state] && table[state][symbol];
19711
- }
19712
- if (typeof action === 'undefined' || !action.length || !action[0]) {
19713
- var errStr = '';
19714
- expected = [];
19715
- for (p in table[state]) {
19716
- if (this.terminals_[p] && p > TERROR) {
19717
- expected.push('\'' + this.terminals_[p] + '\'');
19718
- }
19719
- }
19720
- if (lexer.showPosition) {
19721
- errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
19722
- } else {
19723
- errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
19724
- }
19725
- this.parseError(errStr, {
19726
- text: lexer.match,
19727
- token: this.terminals_[symbol] || symbol,
19728
- line: lexer.yylineno,
19729
- loc: yyloc,
19730
- expected: expected
19731
- });
19732
- }
19733
- if (action[0] instanceof Array && action.length > 1) {
19734
- throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
19735
- }
19736
- switch (action[0]) {
19737
- case 1:
19738
- stack.push(symbol);
19739
- vstack.push(lexer.yytext);
19740
- lstack.push(lexer.yylloc);
19741
- stack.push(action[1]);
19742
- symbol = null;
19743
- {
19744
- yyleng = lexer.yyleng;
19745
- yytext = lexer.yytext;
19746
- yylineno = lexer.yylineno;
19747
- yyloc = lexer.yylloc;
19748
- }
19749
- break;
19750
- case 2:
19751
- len = this.productions_[action[1]][1];
19752
- yyval.$ = vstack[vstack.length - len];
19753
- yyval._$ = {
19754
- first_line: lstack[lstack.length - (len || 1)].first_line,
19755
- last_line: lstack[lstack.length - 1].last_line,
19756
- first_column: lstack[lstack.length - (len || 1)].first_column,
19757
- last_column: lstack[lstack.length - 1].last_column
19758
- };
19759
- if (ranges) {
19760
- yyval._$.range = [
19761
- lstack[lstack.length - (len || 1)].range[0],
19762
- lstack[lstack.length - 1].range[1]
19763
- ];
19764
- }
19765
- r = this.performAction.apply(yyval, [
19766
- yytext,
19767
- yyleng,
19768
- yylineno,
19769
- sharedState.yy,
19770
- action[1],
19771
- vstack,
19772
- lstack
19773
- ].concat(args));
19774
- if (typeof r !== 'undefined') {
19775
- return r;
19776
- }
19777
- if (len) {
19778
- stack = stack.slice(0, -1 * len * 2);
19779
- vstack = vstack.slice(0, -1 * len);
19780
- lstack = lstack.slice(0, -1 * len);
19781
- }
19782
- stack.push(this.productions_[action[1]][0]);
19783
- vstack.push(yyval.$);
19784
- lstack.push(yyval._$);
19785
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
19786
- stack.push(newState);
19787
- break;
19788
- case 3:
19789
- return true;
19790
- }
19791
- }
19792
- return true;
19793
- }
19794
- };
19795
- /* generated by jison-lex 0.3.4 */
19796
- var lexer = (function () {
19797
- var lexer = {
19798
- EOF: 1,
19799
- parseError: function parseError(str, hash) {
19800
- if (this.yy.parser) {
19801
- this.yy.parser.parseError(str, hash);
19802
- } else {
19803
- throw new Error(str);
19804
- }
19805
- },
19806
- // resets the lexer, sets new input
19807
- setInput: function (input, yy) {
19808
- this.yy = yy || this.yy || {};
19809
- this._input = input;
19810
- this._more = this._backtrack = this.done = false;
19811
- this.yylineno = this.yyleng = 0;
19812
- this.yytext = this.matched = this.match = '';
19813
- this.conditionStack = ['INITIAL'];
19814
- this.yylloc = {
19815
- first_line: 1,
19816
- first_column: 0,
19817
- last_line: 1,
19818
- last_column: 0
19819
- };
19820
- if (this.options.ranges) {
19821
- this.yylloc.range = [
19822
- 0,
19823
- 0
19824
- ];
19825
- }
19826
- this.offset = 0;
19827
- return this;
19828
- },
19829
- // consumes and returns one char from the input
19830
- input: function () {
19831
- var ch = this._input[0];
19832
- this.yytext += ch;
19833
- this.yyleng++;
19834
- this.offset++;
19835
- this.match += ch;
19836
- this.matched += ch;
19837
- var lines = ch.match(/(?:\r\n?|\n).*/g);
19838
- if (lines) {
19839
- this.yylineno++;
19840
- this.yylloc.last_line++;
19841
- } else {
19842
- this.yylloc.last_column++;
19843
- }
19844
- if (this.options.ranges) {
19845
- this.yylloc.range[1]++;
19846
- }
19847
- this._input = this._input.slice(1);
19848
- return ch;
19849
- },
19850
- // unshifts one char (or a string) into the input
19851
- unput: function (ch) {
19852
- var len = ch.length;
19853
- var lines = ch.split(/(?:\r\n?|\n)/g);
19854
- this._input = ch + this._input;
19855
- this.yytext = this.yytext.substr(0, this.yytext.length - len);
19856
- //this.yyleng -= len;
19857
- this.offset -= len;
19858
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
19859
- this.match = this.match.substr(0, this.match.length - 1);
19860
- this.matched = this.matched.substr(0, this.matched.length - 1);
19861
- if (lines.length - 1) {
19862
- this.yylineno -= lines.length - 1;
19863
- }
19864
- var r = this.yylloc.range;
19865
- this.yylloc = {
19866
- first_line: this.yylloc.first_line,
19867
- last_line: this.yylineno + 1,
19868
- first_column: this.yylloc.first_column,
19869
- last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
19870
- };
19871
- if (this.options.ranges) {
19872
- this.yylloc.range = [
19873
- r[0],
19874
- r[0] + this.yyleng - len
19875
- ];
19876
- }
19877
- this.yyleng = this.yytext.length;
19878
- return this;
19879
- },
19880
- // When called from action, caches matched text and appends it on next action
19881
- more: function () {
19882
- this._more = true;
19883
- return this;
19884
- },
19885
- // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
19886
- reject: function () {
19887
- if (this.options.backtrack_lexer) {
19888
- this._backtrack = true;
19889
- } else {
19890
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
19891
- text: '',
19892
- token: null,
19893
- line: this.yylineno
19894
- });
19895
- }
19896
- return this;
19897
- },
19898
- // retain first n characters of the match
19899
- less: function (n) {
19900
- this.unput(this.match.slice(n));
19901
- },
19902
- // displays already matched input, i.e. for error messages
19903
- pastInput: function () {
19904
- var past = this.matched.substr(0, this.matched.length - this.match.length);
19905
- return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '');
19906
- },
19907
- // displays upcoming input, i.e. for error messages
19908
- upcomingInput: function () {
19909
- var next = this.match;
19910
- if (next.length < 20) {
19911
- next += this._input.substr(0, 20 - next.length);
19912
- }
19913
- return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '');
19914
- },
19915
- // displays the character position where the lexing error occurred, i.e. for error messages
19916
- showPosition: function () {
19917
- var pre = this.pastInput();
19918
- var c = new Array(pre.length + 1).join('-');
19919
- return pre + this.upcomingInput() + '\n' + c + '^';
19920
- },
19921
- // test the lexed token: return FALSE when not a match, otherwise return token
19922
- test_match: function (match, indexed_rule) {
19923
- var token, lines, backup;
19924
- if (this.options.backtrack_lexer) {
19925
- // save context
19926
- backup = {
19927
- yylineno: this.yylineno,
19928
- yylloc: {
19929
- first_line: this.yylloc.first_line,
19930
- last_line: this.last_line,
19931
- first_column: this.yylloc.first_column,
19932
- last_column: this.yylloc.last_column
19933
- },
19934
- yytext: this.yytext,
19935
- match: this.match,
19936
- matches: this.matches,
19937
- matched: this.matched,
19938
- yyleng: this.yyleng,
19939
- offset: this.offset,
19940
- _more: this._more,
19941
- _input: this._input,
19942
- yy: this.yy,
19943
- conditionStack: this.conditionStack.slice(0),
19944
- done: this.done
19945
- };
19946
- if (this.options.ranges) {
19947
- backup.yylloc.range = this.yylloc.range.slice(0);
19948
- }
19949
- }
19950
- lines = match[0].match(/(?:\r\n?|\n).*/g);
19951
- if (lines) {
19952
- this.yylineno += lines.length;
19953
- }
19954
- this.yylloc = {
19955
- first_line: this.yylloc.last_line,
19956
- last_line: this.yylineno + 1,
19957
- first_column: this.yylloc.last_column,
19958
- last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
19959
- };
19960
- this.yytext += match[0];
19961
- this.match += match[0];
19962
- this.matches = match;
19963
- this.yyleng = this.yytext.length;
19964
- if (this.options.ranges) {
19965
- this.yylloc.range = [
19966
- this.offset,
19967
- this.offset += this.yyleng
19968
- ];
19969
- }
19970
- this._more = false;
19971
- this._backtrack = false;
19972
- this._input = this._input.slice(match[0].length);
19973
- this.matched += match[0];
19974
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
19975
- if (this.done && this._input) {
19976
- this.done = false;
19977
- }
19978
- if (token) {
19979
- return token;
19980
- } else if (this._backtrack) {
19981
- // recover context
19982
- for (var k in backup) {
19983
- this[k] = backup[k];
19984
- }
19985
- return false; // rule action called reject() implying the next rule should be tested instead.
19986
- }
19987
- return false;
19988
- },
19989
- // return next match in input
19990
- next: function () {
19991
- if (this.done) {
19992
- return this.EOF;
19993
- }
19994
- if (!this._input) {
19995
- this.done = true;
19996
- }
19997
- var token, match, tempMatch, index;
19998
- if (!this._more) {
19999
- this.yytext = '';
20000
- this.match = '';
20001
- }
20002
- var rules = this._currentRules();
20003
- for (var i = 0; i < rules.length; i++) {
20004
- tempMatch = this._input.match(this.rules[rules[i]]);
20005
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
20006
- match = tempMatch;
20007
- index = i;
20008
- if (this.options.backtrack_lexer) {
20009
- token = this.test_match(tempMatch, rules[i]);
20010
- if (token !== false) {
20011
- return token;
20012
- } else if (this._backtrack) {
20013
- match = false;
20014
- continue; // rule action called reject() implying a rule MISmatch.
20015
- } else {
20016
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
20017
- return false;
20018
- }
20019
- } else if (!this.options.flex) {
20020
- break;
20021
- }
20022
- }
20023
- }
20024
- if (match) {
20025
- token = this.test_match(match, rules[index]);
20026
- if (token !== false) {
20027
- return token;
20028
- }
20029
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
20030
- return false;
20031
- }
20032
- if (this._input === '') {
20033
- return this.EOF;
20034
- } else {
20035
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
20036
- text: '',
20037
- token: null,
20038
- line: this.yylineno
20039
- });
20040
- }
20041
- },
20042
- // return next match that has a token
20043
- lex: function lex() {
20044
- var r = this.next();
20045
- if (r) {
20046
- return r;
20047
- } else {
20048
- return this.lex();
20049
- }
20050
- },
20051
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
20052
- begin: function begin(condition) {
20053
- this.conditionStack.push(condition);
20054
- },
20055
- // pop the previously active lexer condition state off the condition stack
20056
- popState: function popState() {
20057
- var n = this.conditionStack.length - 1;
20058
- if (n > 0) {
20059
- return this.conditionStack.pop();
20060
- } else {
20061
- return this.conditionStack[0];
20062
- }
20063
- },
20064
- // produce the lexer rule set which is active for the currently active lexer condition state
20065
- _currentRules: function _currentRules() {
20066
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
20067
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
20068
- } else {
20069
- return this.conditions['INITIAL'].rules;
20070
- }
20071
- },
20072
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
20073
- topState: function topState(n) {
20074
- n = this.conditionStack.length - 1 - Math.abs(n || 0);
20075
- if (n >= 0) {
20076
- return this.conditionStack[n];
20077
- } else {
20078
- return 'INITIAL';
20079
- }
20080
- },
20081
- // alias for begin(condition)
20082
- pushState: function pushState(condition) {
20083
- this.begin(condition);
20084
- },
20085
- // return the number of states currently on the stack
20086
- stateStackSize: function stateStackSize() {
20087
- return this.conditionStack.length;
20088
- },
20089
- options: {},
20090
- performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
20091
- switch ($avoiding_name_collisions) {
20092
- case 0:
20093
- /* skip whitespace */
20094
- break;
20095
- case 1:
20096
- return 6;
20097
- case 2:
20098
- yy_.yytext = yy_.yytext.substr(1, yy_.yyleng - 2);
20099
- return 4;
20100
- case 3:
20101
- return 17;
20102
- case 4:
20103
- return 18;
20104
- case 5:
20105
- return 23;
20106
- case 6:
20107
- return 24;
20108
- case 7:
20109
- return 22;
20110
- case 8:
20111
- return 21;
20112
- case 9:
20113
- return 10;
20114
- case 10:
20115
- return 11;
20116
- case 11:
20117
- return 8;
20118
- case 12:
20119
- return 14;
20120
- case 13:
20121
- return 'INVALID';
20122
- }
20123
- },
20124
- rules: [
20125
- /^(?:\s+)/,
20126
- /^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,
20127
- /^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,
20128
- /^(?:\{)/,
20129
- /^(?:\})/,
20130
- /^(?:\[)/,
20131
- /^(?:\])/,
20132
- /^(?:,)/,
20133
- /^(?::)/,
20134
- /^(?:true\b)/,
20135
- /^(?:false\b)/,
20136
- /^(?:null\b)/,
20137
- /^(?:$)/,
20138
- /^(?:.)/
20139
- ],
20140
- conditions: {
20141
- 'INITIAL': {
20142
- 'rules': [
20143
- 0,
20144
- 1,
20145
- 2,
20146
- 3,
20147
- 4,
20148
- 5,
20149
- 6,
20150
- 7,
20151
- 8,
20152
- 9,
20153
- 10,
20154
- 11,
20155
- 12,
20156
- 13
20157
- ],
20158
- 'inclusive': true
20159
- }
20160
- }
20161
- };
20162
- return lexer;
20163
- }());
20164
- parser.lexer = lexer;
20165
- function Parser() {
20166
- this.yy = {};
20167
- }
20168
- Parser.prototype = parser;
20169
- parser.Parser = Parser;
20170
- return new Parser();
20171
- }());
20172
- if (typeof commonjsRequire !== 'undefined' && 'object' !== 'undefined') {
20173
- exports.parser = parser;
20174
- exports.Parser = parser.Parser;
20175
- exports.parse = function () {
20176
- return parser.parse.apply(parser, arguments);
20177
- };
20178
- }
20179
- } (jsonlint$1));
20180
19248
 
20181
- var jsonlint = /*@__PURE__*/getDefaultExportFromCjs(jsonlint$1);
19249
+ the parseError function receives a 'hash' object with these members for lexer and parser errors: {
19250
+ text: (matched text)
19251
+ token: (the produced terminal token, if any)
19252
+ line: (yylineno)
19253
+ }
19254
+ while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
19255
+ loc: (yylloc)
19256
+ expected: (string describing the set of expected tokens)
19257
+ recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
19258
+ }
19259
+ */
19260
+ var parser = (function () {
19261
+ var o = function (k, v, o, l) {
19262
+ for (o = o || {}, l = k.length; l--; o[k[l]] = v);
19263
+ return o;
19264
+ }, $V0 = [
19265
+ 1,
19266
+ 12
19267
+ ], $V1 = [
19268
+ 1,
19269
+ 13
19270
+ ], $V2 = [
19271
+ 1,
19272
+ 9
19273
+ ], $V3 = [
19274
+ 1,
19275
+ 10
19276
+ ], $V4 = [
19277
+ 1,
19278
+ 11
19279
+ ], $V5 = [
19280
+ 1,
19281
+ 14
19282
+ ], $V6 = [
19283
+ 1,
19284
+ 15
19285
+ ], $V7 = [
19286
+ 14,
19287
+ 18,
19288
+ 22,
19289
+ 24
19290
+ ], $V8 = [
19291
+ 18,
19292
+ 22
19293
+ ], $V9 = [
19294
+ 22,
19295
+ 24
19296
+ ];
19297
+ var parser = {
19298
+ trace: function trace() {
19299
+ },
19300
+ yy: {},
19301
+ symbols_: {
19302
+ 'error': 2,
19303
+ 'JSONString': 3,
19304
+ 'STRING': 4,
19305
+ 'JSONNumber': 5,
19306
+ 'NUMBER': 6,
19307
+ 'JSONNullLiteral': 7,
19308
+ 'NULL': 8,
19309
+ 'JSONBooleanLiteral': 9,
19310
+ 'TRUE': 10,
19311
+ 'FALSE': 11,
19312
+ 'JSONText': 12,
19313
+ 'JSONValue': 13,
19314
+ 'EOF': 14,
19315
+ 'JSONObject': 15,
19316
+ 'JSONArray': 16,
19317
+ '{': 17,
19318
+ '}': 18,
19319
+ 'JSONMemberList': 19,
19320
+ 'JSONMember': 20,
19321
+ ':': 21,
19322
+ ',': 22,
19323
+ '[': 23,
19324
+ ']': 24,
19325
+ 'JSONElementList': 25,
19326
+ '$accept': 0,
19327
+ '$end': 1
19328
+ },
19329
+ terminals_: {
19330
+ 2: 'error',
19331
+ 4: 'STRING',
19332
+ 6: 'NUMBER',
19333
+ 8: 'NULL',
19334
+ 10: 'TRUE',
19335
+ 11: 'FALSE',
19336
+ 14: 'EOF',
19337
+ 17: '{',
19338
+ 18: '}',
19339
+ 21: ':',
19340
+ 22: ',',
19341
+ 23: '[',
19342
+ 24: ']'
19343
+ },
19344
+ productions_: [
19345
+ 0,
19346
+ [
19347
+ 3,
19348
+ 1
19349
+ ],
19350
+ [
19351
+ 5,
19352
+ 1
19353
+ ],
19354
+ [
19355
+ 7,
19356
+ 1
19357
+ ],
19358
+ [
19359
+ 9,
19360
+ 1
19361
+ ],
19362
+ [
19363
+ 9,
19364
+ 1
19365
+ ],
19366
+ [
19367
+ 12,
19368
+ 2
19369
+ ],
19370
+ [
19371
+ 13,
19372
+ 1
19373
+ ],
19374
+ [
19375
+ 13,
19376
+ 1
19377
+ ],
19378
+ [
19379
+ 13,
19380
+ 1
19381
+ ],
19382
+ [
19383
+ 13,
19384
+ 1
19385
+ ],
19386
+ [
19387
+ 13,
19388
+ 1
19389
+ ],
19390
+ [
19391
+ 13,
19392
+ 1
19393
+ ],
19394
+ [
19395
+ 15,
19396
+ 2
19397
+ ],
19398
+ [
19399
+ 15,
19400
+ 3
19401
+ ],
19402
+ [
19403
+ 20,
19404
+ 3
19405
+ ],
19406
+ [
19407
+ 19,
19408
+ 1
19409
+ ],
19410
+ [
19411
+ 19,
19412
+ 3
19413
+ ],
19414
+ [
19415
+ 16,
19416
+ 2
19417
+ ],
19418
+ [
19419
+ 16,
19420
+ 3
19421
+ ],
19422
+ [
19423
+ 25,
19424
+ 1
19425
+ ],
19426
+ [
19427
+ 25,
19428
+ 3
19429
+ ]
19430
+ ],
19431
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
19432
+ /* this == yyval */
19433
+ var $0 = $$.length - 1;
19434
+ switch (yystate) {
19435
+ case 1:
19436
+ // replace escaped characters with actual character
19437
+ this.$ = new String(yytext.replace(/\\(\\|")/g, '$' + '1').replace(/\\n/g, '\n').replace(/\\r/g, '\r').replace(/\\t/g, '\t').replace(/\\v/g, '\x0B').replace(/\\f/g, '\f').replace(/\\b/g, '\b'));
19438
+ this.$.__line__ = this._$.first_line;
19439
+ break;
19440
+ case 2:
19441
+ this.$ = new Number(yytext);
19442
+ this.$.__line__ = this._$.first_line;
19443
+ break;
19444
+ case 3:
19445
+ this.$ = null;
19446
+ break;
19447
+ case 4:
19448
+ this.$ = new Boolean(true);
19449
+ this.$.__line__ = this._$.first_line;
19450
+ break;
19451
+ case 5:
19452
+ this.$ = new Boolean(false);
19453
+ this.$.__line__ = this._$.first_line;
19454
+ break;
19455
+ case 6:
19456
+ return this.$ = $$[$0 - 1];
19457
+ case 13:
19458
+ this.$ = {};
19459
+ Object.defineProperty(this.$, '__line__', {
19460
+ value: this._$.first_line,
19461
+ enumerable: false
19462
+ });
19463
+ break;
19464
+ case 14:
19465
+ case 19:
19466
+ this.$ = $$[$0 - 1];
19467
+ Object.defineProperty(this.$, '__line__', {
19468
+ value: this._$.first_line,
19469
+ enumerable: false
19470
+ });
19471
+ break;
19472
+ case 15:
19473
+ this.$ = [
19474
+ $$[$0 - 2],
19475
+ $$[$0]
19476
+ ];
19477
+ break;
19478
+ case 16:
19479
+ this.$ = {};
19480
+ this.$[$$[$0][0]] = $$[$0][1];
19481
+ break;
19482
+ case 17:
19483
+ this.$ = $$[$0 - 2];
19484
+ $$[$0 - 2][$$[$0][0]] = $$[$0][1];
19485
+ break;
19486
+ case 18:
19487
+ this.$ = [];
19488
+ Object.defineProperty(this.$, '__line__', {
19489
+ value: this._$.first_line,
19490
+ enumerable: false
19491
+ });
19492
+ break;
19493
+ case 20:
19494
+ this.$ = [$$[$0]];
19495
+ break;
19496
+ case 21:
19497
+ this.$ = $$[$0 - 2];
19498
+ $$[$0 - 2].push($$[$0]);
19499
+ break;
19500
+ }
19501
+ },
19502
+ table: [
19503
+ {
19504
+ 3: 5,
19505
+ 4: $V0,
19506
+ 5: 6,
19507
+ 6: $V1,
19508
+ 7: 3,
19509
+ 8: $V2,
19510
+ 9: 4,
19511
+ 10: $V3,
19512
+ 11: $V4,
19513
+ 12: 1,
19514
+ 13: 2,
19515
+ 15: 7,
19516
+ 16: 8,
19517
+ 17: $V5,
19518
+ 23: $V6
19519
+ },
19520
+ { 1: [3] },
19521
+ {
19522
+ 14: [
19523
+ 1,
19524
+ 16
19525
+ ]
19526
+ },
19527
+ o($V7, [
19528
+ 2,
19529
+ 7
19530
+ ]),
19531
+ o($V7, [
19532
+ 2,
19533
+ 8
19534
+ ]),
19535
+ o($V7, [
19536
+ 2,
19537
+ 9
19538
+ ]),
19539
+ o($V7, [
19540
+ 2,
19541
+ 10
19542
+ ]),
19543
+ o($V7, [
19544
+ 2,
19545
+ 11
19546
+ ]),
19547
+ o($V7, [
19548
+ 2,
19549
+ 12
19550
+ ]),
19551
+ o($V7, [
19552
+ 2,
19553
+ 3
19554
+ ]),
19555
+ o($V7, [
19556
+ 2,
19557
+ 4
19558
+ ]),
19559
+ o($V7, [
19560
+ 2,
19561
+ 5
19562
+ ]),
19563
+ o([
19564
+ 14,
19565
+ 18,
19566
+ 21,
19567
+ 22,
19568
+ 24
19569
+ ], [
19570
+ 2,
19571
+ 1
19572
+ ]),
19573
+ o($V7, [
19574
+ 2,
19575
+ 2
19576
+ ]),
19577
+ {
19578
+ 3: 20,
19579
+ 4: $V0,
19580
+ 18: [
19581
+ 1,
19582
+ 17
19583
+ ],
19584
+ 19: 18,
19585
+ 20: 19
19586
+ },
19587
+ {
19588
+ 3: 5,
19589
+ 4: $V0,
19590
+ 5: 6,
19591
+ 6: $V1,
19592
+ 7: 3,
19593
+ 8: $V2,
19594
+ 9: 4,
19595
+ 10: $V3,
19596
+ 11: $V4,
19597
+ 13: 23,
19598
+ 15: 7,
19599
+ 16: 8,
19600
+ 17: $V5,
19601
+ 23: $V6,
19602
+ 24: [
19603
+ 1,
19604
+ 21
19605
+ ],
19606
+ 25: 22
19607
+ },
19608
+ {
19609
+ 1: [
19610
+ 2,
19611
+ 6
19612
+ ]
19613
+ },
19614
+ o($V7, [
19615
+ 2,
19616
+ 13
19617
+ ]),
19618
+ {
19619
+ 18: [
19620
+ 1,
19621
+ 24
19622
+ ],
19623
+ 22: [
19624
+ 1,
19625
+ 25
19626
+ ]
19627
+ },
19628
+ o($V8, [
19629
+ 2,
19630
+ 16
19631
+ ]),
19632
+ {
19633
+ 21: [
19634
+ 1,
19635
+ 26
19636
+ ]
19637
+ },
19638
+ o($V7, [
19639
+ 2,
19640
+ 18
19641
+ ]),
19642
+ {
19643
+ 22: [
19644
+ 1,
19645
+ 28
19646
+ ],
19647
+ 24: [
19648
+ 1,
19649
+ 27
19650
+ ]
19651
+ },
19652
+ o($V9, [
19653
+ 2,
19654
+ 20
19655
+ ]),
19656
+ o($V7, [
19657
+ 2,
19658
+ 14
19659
+ ]),
19660
+ {
19661
+ 3: 20,
19662
+ 4: $V0,
19663
+ 20: 29
19664
+ },
19665
+ {
19666
+ 3: 5,
19667
+ 4: $V0,
19668
+ 5: 6,
19669
+ 6: $V1,
19670
+ 7: 3,
19671
+ 8: $V2,
19672
+ 9: 4,
19673
+ 10: $V3,
19674
+ 11: $V4,
19675
+ 13: 30,
19676
+ 15: 7,
19677
+ 16: 8,
19678
+ 17: $V5,
19679
+ 23: $V6
19680
+ },
19681
+ o($V7, [
19682
+ 2,
19683
+ 19
19684
+ ]),
19685
+ {
19686
+ 3: 5,
19687
+ 4: $V0,
19688
+ 5: 6,
19689
+ 6: $V1,
19690
+ 7: 3,
19691
+ 8: $V2,
19692
+ 9: 4,
19693
+ 10: $V3,
19694
+ 11: $V4,
19695
+ 13: 31,
19696
+ 15: 7,
19697
+ 16: 8,
19698
+ 17: $V5,
19699
+ 23: $V6
19700
+ },
19701
+ o($V8, [
19702
+ 2,
19703
+ 17
19704
+ ]),
19705
+ o($V8, [
19706
+ 2,
19707
+ 15
19708
+ ]),
19709
+ o($V9, [
19710
+ 2,
19711
+ 21
19712
+ ])
19713
+ ],
19714
+ defaultActions: {
19715
+ 16: [
19716
+ 2,
19717
+ 6
19718
+ ]
19719
+ },
19720
+ parseError: function parseError(str, hash) {
19721
+ if (hash.recoverable) {
19722
+ this.trace(str);
19723
+ } else {
19724
+ throw new Error(str);
19725
+ }
19726
+ },
19727
+ parse: function parse(input) {
19728
+ var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
19729
+ var args = lstack.slice.call(arguments, 1);
19730
+ var lexer = Object.create(this.lexer);
19731
+ var sharedState = { yy: {} };
19732
+ for (var k in this.yy) {
19733
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
19734
+ sharedState.yy[k] = this.yy[k];
19735
+ }
19736
+ }
19737
+ lexer.setInput(input, sharedState.yy);
19738
+ sharedState.yy.lexer = lexer;
19739
+ sharedState.yy.parser = this;
19740
+ if (typeof lexer.yylloc == 'undefined') {
19741
+ lexer.yylloc = {};
19742
+ }
19743
+ var yyloc = lexer.yylloc;
19744
+ lstack.push(yyloc);
19745
+ var ranges = lexer.options && lexer.options.ranges;
19746
+ if (typeof sharedState.yy.parseError === 'function') {
19747
+ this.parseError = sharedState.yy.parseError;
19748
+ } else {
19749
+ this.parseError = Object.getPrototypeOf(this).parseError;
19750
+ }
19751
+ function lex() {
19752
+ var token;
19753
+ token = lexer.lex() || EOF;
19754
+ if (typeof token !== 'number') {
19755
+ token = self.symbols_[token] || token;
19756
+ }
19757
+ return token;
19758
+ }
19759
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
19760
+ while (true) {
19761
+ state = stack[stack.length - 1];
19762
+ if (this.defaultActions[state]) {
19763
+ action = this.defaultActions[state];
19764
+ } else {
19765
+ if (symbol === null || typeof symbol == 'undefined') {
19766
+ symbol = lex();
19767
+ }
19768
+ action = table[state] && table[state][symbol];
19769
+ }
19770
+ if (typeof action === 'undefined' || !action.length || !action[0]) {
19771
+ var errStr = '';
19772
+ expected = [];
19773
+ for (p in table[state]) {
19774
+ if (this.terminals_[p] && p > TERROR) {
19775
+ expected.push('\'' + this.terminals_[p] + '\'');
19776
+ }
19777
+ }
19778
+ if (lexer.showPosition) {
19779
+ errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
19780
+ } else {
19781
+ errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
19782
+ }
19783
+ this.parseError(errStr, {
19784
+ text: lexer.match,
19785
+ token: this.terminals_[symbol] || symbol,
19786
+ line: lexer.yylineno,
19787
+ loc: yyloc,
19788
+ expected: expected
19789
+ });
19790
+ }
19791
+ if (action[0] instanceof Array && action.length > 1) {
19792
+ throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
19793
+ }
19794
+ switch (action[0]) {
19795
+ case 1:
19796
+ stack.push(symbol);
19797
+ vstack.push(lexer.yytext);
19798
+ lstack.push(lexer.yylloc);
19799
+ stack.push(action[1]);
19800
+ symbol = null;
19801
+ {
19802
+ yyleng = lexer.yyleng;
19803
+ yytext = lexer.yytext;
19804
+ yylineno = lexer.yylineno;
19805
+ yyloc = lexer.yylloc;
19806
+ }
19807
+ break;
19808
+ case 2:
19809
+ len = this.productions_[action[1]][1];
19810
+ yyval.$ = vstack[vstack.length - len];
19811
+ yyval._$ = {
19812
+ first_line: lstack[lstack.length - (len || 1)].first_line,
19813
+ last_line: lstack[lstack.length - 1].last_line,
19814
+ first_column: lstack[lstack.length - (len || 1)].first_column,
19815
+ last_column: lstack[lstack.length - 1].last_column
19816
+ };
19817
+ if (ranges) {
19818
+ yyval._$.range = [
19819
+ lstack[lstack.length - (len || 1)].range[0],
19820
+ lstack[lstack.length - 1].range[1]
19821
+ ];
19822
+ }
19823
+ r = this.performAction.apply(yyval, [
19824
+ yytext,
19825
+ yyleng,
19826
+ yylineno,
19827
+ sharedState.yy,
19828
+ action[1],
19829
+ vstack,
19830
+ lstack
19831
+ ].concat(args));
19832
+ if (typeof r !== 'undefined') {
19833
+ return r;
19834
+ }
19835
+ if (len) {
19836
+ stack = stack.slice(0, -1 * len * 2);
19837
+ vstack = vstack.slice(0, -1 * len);
19838
+ lstack = lstack.slice(0, -1 * len);
19839
+ }
19840
+ stack.push(this.productions_[action[1]][0]);
19841
+ vstack.push(yyval.$);
19842
+ lstack.push(yyval._$);
19843
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
19844
+ stack.push(newState);
19845
+ break;
19846
+ case 3:
19847
+ return true;
19848
+ }
19849
+ }
19850
+ return true;
19851
+ }
19852
+ };
19853
+ /* generated by jison-lex 0.3.4 */
19854
+ var lexer = (function () {
19855
+ var lexer = {
19856
+ EOF: 1,
19857
+ parseError: function parseError(str, hash) {
19858
+ if (this.yy.parser) {
19859
+ this.yy.parser.parseError(str, hash);
19860
+ } else {
19861
+ throw new Error(str);
19862
+ }
19863
+ },
19864
+ // resets the lexer, sets new input
19865
+ setInput: function (input, yy) {
19866
+ this.yy = yy || this.yy || {};
19867
+ this._input = input;
19868
+ this._more = this._backtrack = this.done = false;
19869
+ this.yylineno = this.yyleng = 0;
19870
+ this.yytext = this.matched = this.match = '';
19871
+ this.conditionStack = ['INITIAL'];
19872
+ this.yylloc = {
19873
+ first_line: 1,
19874
+ first_column: 0,
19875
+ last_line: 1,
19876
+ last_column: 0
19877
+ };
19878
+ if (this.options.ranges) {
19879
+ this.yylloc.range = [
19880
+ 0,
19881
+ 0
19882
+ ];
19883
+ }
19884
+ this.offset = 0;
19885
+ return this;
19886
+ },
19887
+ // consumes and returns one char from the input
19888
+ input: function () {
19889
+ var ch = this._input[0];
19890
+ this.yytext += ch;
19891
+ this.yyleng++;
19892
+ this.offset++;
19893
+ this.match += ch;
19894
+ this.matched += ch;
19895
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
19896
+ if (lines) {
19897
+ this.yylineno++;
19898
+ this.yylloc.last_line++;
19899
+ } else {
19900
+ this.yylloc.last_column++;
19901
+ }
19902
+ if (this.options.ranges) {
19903
+ this.yylloc.range[1]++;
19904
+ }
19905
+ this._input = this._input.slice(1);
19906
+ return ch;
19907
+ },
19908
+ // unshifts one char (or a string) into the input
19909
+ unput: function (ch) {
19910
+ var len = ch.length;
19911
+ var lines = ch.split(/(?:\r\n?|\n)/g);
19912
+ this._input = ch + this._input;
19913
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
19914
+ //this.yyleng -= len;
19915
+ this.offset -= len;
19916
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
19917
+ this.match = this.match.substr(0, this.match.length - 1);
19918
+ this.matched = this.matched.substr(0, this.matched.length - 1);
19919
+ if (lines.length - 1) {
19920
+ this.yylineno -= lines.length - 1;
19921
+ }
19922
+ var r = this.yylloc.range;
19923
+ this.yylloc = {
19924
+ first_line: this.yylloc.first_line,
19925
+ last_line: this.yylineno + 1,
19926
+ first_column: this.yylloc.first_column,
19927
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
19928
+ };
19929
+ if (this.options.ranges) {
19930
+ this.yylloc.range = [
19931
+ r[0],
19932
+ r[0] + this.yyleng - len
19933
+ ];
19934
+ }
19935
+ this.yyleng = this.yytext.length;
19936
+ return this;
19937
+ },
19938
+ // When called from action, caches matched text and appends it on next action
19939
+ more: function () {
19940
+ this._more = true;
19941
+ return this;
19942
+ },
19943
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
19944
+ reject: function () {
19945
+ if (this.options.backtrack_lexer) {
19946
+ this._backtrack = true;
19947
+ } else {
19948
+ return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
19949
+ text: '',
19950
+ token: null,
19951
+ line: this.yylineno
19952
+ });
19953
+ }
19954
+ return this;
19955
+ },
19956
+ // retain first n characters of the match
19957
+ less: function (n) {
19958
+ this.unput(this.match.slice(n));
19959
+ },
19960
+ // displays already matched input, i.e. for error messages
19961
+ pastInput: function () {
19962
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
19963
+ return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '');
19964
+ },
19965
+ // displays upcoming input, i.e. for error messages
19966
+ upcomingInput: function () {
19967
+ var next = this.match;
19968
+ if (next.length < 20) {
19969
+ next += this._input.substr(0, 20 - next.length);
19970
+ }
19971
+ return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '');
19972
+ },
19973
+ // displays the character position where the lexing error occurred, i.e. for error messages
19974
+ showPosition: function () {
19975
+ var pre = this.pastInput();
19976
+ var c = new Array(pre.length + 1).join('-');
19977
+ return pre + this.upcomingInput() + '\n' + c + '^';
19978
+ },
19979
+ // test the lexed token: return FALSE when not a match, otherwise return token
19980
+ test_match: function (match, indexed_rule) {
19981
+ var token, lines, backup;
19982
+ if (this.options.backtrack_lexer) {
19983
+ // save context
19984
+ backup = {
19985
+ yylineno: this.yylineno,
19986
+ yylloc: {
19987
+ first_line: this.yylloc.first_line,
19988
+ last_line: this.last_line,
19989
+ first_column: this.yylloc.first_column,
19990
+ last_column: this.yylloc.last_column
19991
+ },
19992
+ yytext: this.yytext,
19993
+ match: this.match,
19994
+ matches: this.matches,
19995
+ matched: this.matched,
19996
+ yyleng: this.yyleng,
19997
+ offset: this.offset,
19998
+ _more: this._more,
19999
+ _input: this._input,
20000
+ yy: this.yy,
20001
+ conditionStack: this.conditionStack.slice(0),
20002
+ done: this.done
20003
+ };
20004
+ if (this.options.ranges) {
20005
+ backup.yylloc.range = this.yylloc.range.slice(0);
20006
+ }
20007
+ }
20008
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
20009
+ if (lines) {
20010
+ this.yylineno += lines.length;
20011
+ }
20012
+ this.yylloc = {
20013
+ first_line: this.yylloc.last_line,
20014
+ last_line: this.yylineno + 1,
20015
+ first_column: this.yylloc.last_column,
20016
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
20017
+ };
20018
+ this.yytext += match[0];
20019
+ this.match += match[0];
20020
+ this.matches = match;
20021
+ this.yyleng = this.yytext.length;
20022
+ if (this.options.ranges) {
20023
+ this.yylloc.range = [
20024
+ this.offset,
20025
+ this.offset += this.yyleng
20026
+ ];
20027
+ }
20028
+ this._more = false;
20029
+ this._backtrack = false;
20030
+ this._input = this._input.slice(match[0].length);
20031
+ this.matched += match[0];
20032
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
20033
+ if (this.done && this._input) {
20034
+ this.done = false;
20035
+ }
20036
+ if (token) {
20037
+ return token;
20038
+ } else if (this._backtrack) {
20039
+ // recover context
20040
+ for (var k in backup) {
20041
+ this[k] = backup[k];
20042
+ }
20043
+ return false; // rule action called reject() implying the next rule should be tested instead.
20044
+ }
20045
+ return false;
20046
+ },
20047
+ // return next match in input
20048
+ next: function () {
20049
+ if (this.done) {
20050
+ return this.EOF;
20051
+ }
20052
+ if (!this._input) {
20053
+ this.done = true;
20054
+ }
20055
+ var token, match, tempMatch, index;
20056
+ if (!this._more) {
20057
+ this.yytext = '';
20058
+ this.match = '';
20059
+ }
20060
+ var rules = this._currentRules();
20061
+ for (var i = 0; i < rules.length; i++) {
20062
+ tempMatch = this._input.match(this.rules[rules[i]]);
20063
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
20064
+ match = tempMatch;
20065
+ index = i;
20066
+ if (this.options.backtrack_lexer) {
20067
+ token = this.test_match(tempMatch, rules[i]);
20068
+ if (token !== false) {
20069
+ return token;
20070
+ } else if (this._backtrack) {
20071
+ match = false;
20072
+ continue; // rule action called reject() implying a rule MISmatch.
20073
+ } else {
20074
+ // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
20075
+ return false;
20076
+ }
20077
+ } else if (!this.options.flex) {
20078
+ break;
20079
+ }
20080
+ }
20081
+ }
20082
+ if (match) {
20083
+ token = this.test_match(match, rules[index]);
20084
+ if (token !== false) {
20085
+ return token;
20086
+ }
20087
+ // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
20088
+ return false;
20089
+ }
20090
+ if (this._input === '') {
20091
+ return this.EOF;
20092
+ } else {
20093
+ return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
20094
+ text: '',
20095
+ token: null,
20096
+ line: this.yylineno
20097
+ });
20098
+ }
20099
+ },
20100
+ // return next match that has a token
20101
+ lex: function lex() {
20102
+ var r = this.next();
20103
+ if (r) {
20104
+ return r;
20105
+ } else {
20106
+ return this.lex();
20107
+ }
20108
+ },
20109
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
20110
+ begin: function begin(condition) {
20111
+ this.conditionStack.push(condition);
20112
+ },
20113
+ // pop the previously active lexer condition state off the condition stack
20114
+ popState: function popState() {
20115
+ var n = this.conditionStack.length - 1;
20116
+ if (n > 0) {
20117
+ return this.conditionStack.pop();
20118
+ } else {
20119
+ return this.conditionStack[0];
20120
+ }
20121
+ },
20122
+ // produce the lexer rule set which is active for the currently active lexer condition state
20123
+ _currentRules: function _currentRules() {
20124
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
20125
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
20126
+ } else {
20127
+ return this.conditions['INITIAL'].rules;
20128
+ }
20129
+ },
20130
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
20131
+ topState: function topState(n) {
20132
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
20133
+ if (n >= 0) {
20134
+ return this.conditionStack[n];
20135
+ } else {
20136
+ return 'INITIAL';
20137
+ }
20138
+ },
20139
+ // alias for begin(condition)
20140
+ pushState: function pushState(condition) {
20141
+ this.begin(condition);
20142
+ },
20143
+ // return the number of states currently on the stack
20144
+ stateStackSize: function stateStackSize() {
20145
+ return this.conditionStack.length;
20146
+ },
20147
+ options: {},
20148
+ performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
20149
+ switch ($avoiding_name_collisions) {
20150
+ case 0:
20151
+ /* skip whitespace */
20152
+ break;
20153
+ case 1:
20154
+ return 6;
20155
+ case 2:
20156
+ yy_.yytext = yy_.yytext.substr(1, yy_.yyleng - 2);
20157
+ return 4;
20158
+ case 3:
20159
+ return 17;
20160
+ case 4:
20161
+ return 18;
20162
+ case 5:
20163
+ return 23;
20164
+ case 6:
20165
+ return 24;
20166
+ case 7:
20167
+ return 22;
20168
+ case 8:
20169
+ return 21;
20170
+ case 9:
20171
+ return 10;
20172
+ case 10:
20173
+ return 11;
20174
+ case 11:
20175
+ return 8;
20176
+ case 12:
20177
+ return 14;
20178
+ case 13:
20179
+ return 'INVALID';
20180
+ }
20181
+ },
20182
+ rules: [
20183
+ /^(?:\s+)/,
20184
+ /^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,
20185
+ /^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,
20186
+ /^(?:\{)/,
20187
+ /^(?:\})/,
20188
+ /^(?:\[)/,
20189
+ /^(?:\])/,
20190
+ /^(?:,)/,
20191
+ /^(?::)/,
20192
+ /^(?:true\b)/,
20193
+ /^(?:false\b)/,
20194
+ /^(?:null\b)/,
20195
+ /^(?:$)/,
20196
+ /^(?:.)/
20197
+ ],
20198
+ conditions: {
20199
+ 'INITIAL': {
20200
+ 'rules': [
20201
+ 0,
20202
+ 1,
20203
+ 2,
20204
+ 3,
20205
+ 4,
20206
+ 5,
20207
+ 6,
20208
+ 7,
20209
+ 8,
20210
+ 9,
20211
+ 10,
20212
+ 11,
20213
+ 12,
20214
+ 13
20215
+ ],
20216
+ 'inclusive': true
20217
+ }
20218
+ }
20219
+ };
20220
+ return lexer;
20221
+ }());
20222
+ parser.lexer = lexer;
20223
+ function Parser() {
20224
+ this.yy = {};
20225
+ }
20226
+ Parser.prototype = parser;
20227
+ parser.Parser = Parser;
20228
+ return new Parser();
20229
+ }());
20230
+ if (typeof commonjsRequire !== 'undefined' && 'object' !== 'undefined') {
20231
+ exports.parser = parser;
20232
+ exports.Parser = parser.Parser;
20233
+ exports.parse = function () {
20234
+ return parser.parse.apply(parser, arguments);
20235
+ };
20236
+ }
20237
+ } (jsonlint$1));
20238
+ return jsonlint$1;
20239
+ }
20240
+
20241
+ var jsonlintExports = requireJsonlint();
20242
+ var jsonlint = /*@__PURE__*/getDefaultExportFromCjs(jsonlintExports);
20182
20243
 
20183
20244
  function readStyle(style) {
20184
20245
  if (style instanceof String || typeof style === 'string' || ArrayBuffer.isView(style)) {