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

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