axe-core 4.7.2-canary.0e73be0 → 4.7.2-canary.16c5cfa
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/axe.js +1761 -1742
- package/axe.min.js +2 -2
- package/package.json +2 -2
- package/sri-history.json +3 -3
package/axe.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! axe v4.7.2-canary.
|
|
1
|
+
/*! axe v4.7.2-canary.16c5cfa
|
|
2
2
|
* Copyright (c) 2023 Deque Systems, Inc.
|
|
3
3
|
*
|
|
4
4
|
* Your use of this Source Code Form is subject to the terms of the Mozilla Public
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}, _typeof(obj);
|
|
23
23
|
}
|
|
24
24
|
var axe = axe || {};
|
|
25
|
-
axe.version = '4.7.2-canary.
|
|
25
|
+
axe.version = '4.7.2-canary.16c5cfa';
|
|
26
26
|
if (typeof define === 'function' && define.amd) {
|
|
27
27
|
define('axe-core', [], function() {
|
|
28
28
|
return axe;
|
|
@@ -532,879 +532,258 @@
|
|
|
532
532
|
__defNormalProp(obj, _typeof(key) !== 'symbol' ? key + '' : key, value);
|
|
533
533
|
return value;
|
|
534
534
|
};
|
|
535
|
-
var
|
|
535
|
+
var require_noop = __commonJS(function(exports, module) {
|
|
536
536
|
'use strict';
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
var i = 0;
|
|
556
|
-
while (i < len) {
|
|
557
|
-
var chr = s.charAt(i);
|
|
558
|
-
if (exports.identSpecialChars[chr]) {
|
|
559
|
-
result += '\\' + chr;
|
|
560
|
-
} else {
|
|
561
|
-
if (!(chr === '_' || chr === '-' || chr >= 'A' && chr <= 'Z' || chr >= 'a' && chr <= 'z' || i !== 0 && chr >= '0' && chr <= '9')) {
|
|
562
|
-
var charCode = chr.charCodeAt(0);
|
|
563
|
-
if ((charCode & 63488) === 55296) {
|
|
564
|
-
var extraCharCode = s.charCodeAt(i++);
|
|
565
|
-
if ((charCode & 64512) !== 55296 || (extraCharCode & 64512) !== 56320) {
|
|
566
|
-
throw Error('UCS-2(decode): illegal sequence');
|
|
567
|
-
}
|
|
568
|
-
charCode = ((charCode & 1023) << 10) + (extraCharCode & 1023) + 65536;
|
|
569
|
-
}
|
|
570
|
-
result += '\\' + charCode.toString(16) + ' ';
|
|
571
|
-
} else {
|
|
572
|
-
result += chr;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
i++;
|
|
537
|
+
module.exports = function() {};
|
|
538
|
+
});
|
|
539
|
+
var require_is_value = __commonJS(function(exports, module) {
|
|
540
|
+
'use strict';
|
|
541
|
+
var _undefined = require_noop()();
|
|
542
|
+
module.exports = function(val) {
|
|
543
|
+
return val !== _undefined && val !== null;
|
|
544
|
+
};
|
|
545
|
+
});
|
|
546
|
+
var require_normalize_options = __commonJS(function(exports, module) {
|
|
547
|
+
'use strict';
|
|
548
|
+
var isValue = require_is_value();
|
|
549
|
+
var forEach = Array.prototype.forEach;
|
|
550
|
+
var create = Object.create;
|
|
551
|
+
var process2 = function process2(src, obj) {
|
|
552
|
+
var key;
|
|
553
|
+
for (key in src) {
|
|
554
|
+
obj[key] = src[key];
|
|
576
555
|
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
var i = 0;
|
|
584
|
-
var replacement;
|
|
585
|
-
while (i < len) {
|
|
586
|
-
var chr = s.charAt(i);
|
|
587
|
-
if (chr === '"') {
|
|
588
|
-
chr = '\\"';
|
|
589
|
-
} else if (chr === '\\') {
|
|
590
|
-
chr = '\\\\';
|
|
591
|
-
} else if ((replacement = exports.strReplacementsRev[chr]) !== void 0) {
|
|
592
|
-
chr = replacement;
|
|
556
|
+
};
|
|
557
|
+
module.exports = function(opts1) {
|
|
558
|
+
var result = create(null);
|
|
559
|
+
forEach.call(arguments, function(options) {
|
|
560
|
+
if (!isValue(options)) {
|
|
561
|
+
return;
|
|
593
562
|
}
|
|
594
|
-
result
|
|
595
|
-
|
|
563
|
+
process2(Object(options), result);
|
|
564
|
+
});
|
|
565
|
+
return result;
|
|
566
|
+
};
|
|
567
|
+
});
|
|
568
|
+
var require_is_implemented = __commonJS(function(exports, module) {
|
|
569
|
+
'use strict';
|
|
570
|
+
module.exports = function() {
|
|
571
|
+
var sign = Math.sign;
|
|
572
|
+
if (typeof sign !== 'function') {
|
|
573
|
+
return false;
|
|
596
574
|
}
|
|
597
|
-
return
|
|
598
|
-
}
|
|
599
|
-
exports.escapeStr = escapeStr;
|
|
600
|
-
exports.identSpecialChars = {
|
|
601
|
-
'!': true,
|
|
602
|
-
'"': true,
|
|
603
|
-
'#': true,
|
|
604
|
-
$: true,
|
|
605
|
-
'%': true,
|
|
606
|
-
'&': true,
|
|
607
|
-
'\'': true,
|
|
608
|
-
'(': true,
|
|
609
|
-
')': true,
|
|
610
|
-
'*': true,
|
|
611
|
-
'+': true,
|
|
612
|
-
',': true,
|
|
613
|
-
'.': true,
|
|
614
|
-
'/': true,
|
|
615
|
-
';': true,
|
|
616
|
-
'<': true,
|
|
617
|
-
'=': true,
|
|
618
|
-
'>': true,
|
|
619
|
-
'?': true,
|
|
620
|
-
'@': true,
|
|
621
|
-
'[': true,
|
|
622
|
-
'\\': true,
|
|
623
|
-
']': true,
|
|
624
|
-
'^': true,
|
|
625
|
-
'`': true,
|
|
626
|
-
'{': true,
|
|
627
|
-
'|': true,
|
|
628
|
-
'}': true,
|
|
629
|
-
'~': true
|
|
575
|
+
return sign(10) === 1 && sign(-20) === -1;
|
|
630
576
|
};
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
577
|
+
});
|
|
578
|
+
var require_shim = __commonJS(function(exports, module) {
|
|
579
|
+
'use strict';
|
|
580
|
+
module.exports = function(value) {
|
|
581
|
+
value = Number(value);
|
|
582
|
+
if (isNaN(value) || value === 0) {
|
|
583
|
+
return value;
|
|
584
|
+
}
|
|
585
|
+
return value > 0 ? 1 : -1;
|
|
637
586
|
};
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
587
|
+
});
|
|
588
|
+
var require_sign = __commonJS(function(exports, module) {
|
|
589
|
+
'use strict';
|
|
590
|
+
module.exports = require_is_implemented()() ? Math.sign : require_shim();
|
|
591
|
+
});
|
|
592
|
+
var require_to_integer = __commonJS(function(exports, module) {
|
|
593
|
+
'use strict';
|
|
594
|
+
var sign = require_sign();
|
|
595
|
+
var abs = Math.abs;
|
|
596
|
+
var floor = Math.floor;
|
|
597
|
+
module.exports = function(value) {
|
|
598
|
+
if (isNaN(value)) {
|
|
599
|
+
return 0;
|
|
600
|
+
}
|
|
601
|
+
value = Number(value);
|
|
602
|
+
if (value === 0 || !isFinite(value)) {
|
|
603
|
+
return value;
|
|
604
|
+
}
|
|
605
|
+
return sign(value) * floor(abs(value));
|
|
645
606
|
};
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
607
|
+
});
|
|
608
|
+
var require_to_pos_integer = __commonJS(function(exports, module) {
|
|
609
|
+
'use strict';
|
|
610
|
+
var toInteger = require_to_integer();
|
|
611
|
+
var max2 = Math.max;
|
|
612
|
+
module.exports = function(value) {
|
|
613
|
+
return max2(0, toInteger(value));
|
|
653
614
|
};
|
|
654
615
|
});
|
|
655
|
-
var
|
|
616
|
+
var require_resolve_length = __commonJS(function(exports, module) {
|
|
656
617
|
'use strict';
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
function getStr(quote, escapeTable) {
|
|
665
|
-
var result = '';
|
|
666
|
-
pos++;
|
|
667
|
-
chr = str.charAt(pos);
|
|
668
|
-
while (pos < l) {
|
|
669
|
-
if (chr === quote) {
|
|
670
|
-
pos++;
|
|
671
|
-
return result;
|
|
672
|
-
} else if (chr === '\\') {
|
|
673
|
-
pos++;
|
|
674
|
-
chr = str.charAt(pos);
|
|
675
|
-
var esc = void 0;
|
|
676
|
-
if (chr === quote) {
|
|
677
|
-
result += quote;
|
|
678
|
-
} else if ((esc = escapeTable[chr]) !== void 0) {
|
|
679
|
-
result += esc;
|
|
680
|
-
} else if (utils_1.isHex(chr)) {
|
|
681
|
-
var hex = chr;
|
|
682
|
-
pos++;
|
|
683
|
-
chr = str.charAt(pos);
|
|
684
|
-
while (utils_1.isHex(chr)) {
|
|
685
|
-
hex += chr;
|
|
686
|
-
pos++;
|
|
687
|
-
chr = str.charAt(pos);
|
|
688
|
-
}
|
|
689
|
-
if (chr === ' ') {
|
|
690
|
-
pos++;
|
|
691
|
-
chr = str.charAt(pos);
|
|
692
|
-
}
|
|
693
|
-
result += String.fromCharCode(parseInt(hex, 16));
|
|
694
|
-
continue;
|
|
695
|
-
} else {
|
|
696
|
-
result += chr;
|
|
697
|
-
}
|
|
698
|
-
} else {
|
|
699
|
-
result += chr;
|
|
700
|
-
}
|
|
701
|
-
pos++;
|
|
702
|
-
chr = str.charAt(pos);
|
|
618
|
+
var toPosInt = require_to_pos_integer();
|
|
619
|
+
module.exports = function(optsLength, fnLength, isAsync) {
|
|
620
|
+
var length;
|
|
621
|
+
if (isNaN(optsLength)) {
|
|
622
|
+
length = fnLength;
|
|
623
|
+
if (!(length >= 0)) {
|
|
624
|
+
return 1;
|
|
703
625
|
}
|
|
704
|
-
|
|
626
|
+
if (isAsync && length) {
|
|
627
|
+
return length - 1;
|
|
628
|
+
}
|
|
629
|
+
return length;
|
|
705
630
|
}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
chr = str.charAt(pos);
|
|
709
|
-
while (pos < l) {
|
|
710
|
-
if (utils_1.isIdent(chr)) {
|
|
711
|
-
result += chr;
|
|
712
|
-
} else if (chr === '\\') {
|
|
713
|
-
pos++;
|
|
714
|
-
if (pos >= l) {
|
|
715
|
-
throw Error('Expected symbol but end of file reached.');
|
|
716
|
-
}
|
|
717
|
-
chr = str.charAt(pos);
|
|
718
|
-
if (utils_1.identSpecialChars[chr]) {
|
|
719
|
-
result += chr;
|
|
720
|
-
} else if (utils_1.isHex(chr)) {
|
|
721
|
-
var hex = chr;
|
|
722
|
-
pos++;
|
|
723
|
-
chr = str.charAt(pos);
|
|
724
|
-
while (utils_1.isHex(chr)) {
|
|
725
|
-
hex += chr;
|
|
726
|
-
pos++;
|
|
727
|
-
chr = str.charAt(pos);
|
|
728
|
-
}
|
|
729
|
-
if (chr === ' ') {
|
|
730
|
-
pos++;
|
|
731
|
-
chr = str.charAt(pos);
|
|
732
|
-
}
|
|
733
|
-
result += String.fromCharCode(parseInt(hex, 16));
|
|
734
|
-
continue;
|
|
735
|
-
} else {
|
|
736
|
-
result += chr;
|
|
737
|
-
}
|
|
738
|
-
} else {
|
|
739
|
-
return result;
|
|
740
|
-
}
|
|
741
|
-
pos++;
|
|
742
|
-
chr = str.charAt(pos);
|
|
743
|
-
}
|
|
744
|
-
return result;
|
|
631
|
+
if (optsLength === false) {
|
|
632
|
+
return false;
|
|
745
633
|
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
return result;
|
|
634
|
+
return toPosInt(optsLength);
|
|
635
|
+
};
|
|
636
|
+
});
|
|
637
|
+
var require_valid_callable = __commonJS(function(exports, module) {
|
|
638
|
+
'use strict';
|
|
639
|
+
module.exports = function(fn) {
|
|
640
|
+
if (typeof fn !== 'function') {
|
|
641
|
+
throw new TypeError(fn + ' is not a function');
|
|
755
642
|
}
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
643
|
+
return fn;
|
|
644
|
+
};
|
|
645
|
+
});
|
|
646
|
+
var require_valid_value = __commonJS(function(exports, module) {
|
|
647
|
+
'use strict';
|
|
648
|
+
var isValue = require_is_value();
|
|
649
|
+
module.exports = function(value) {
|
|
650
|
+
if (!isValue(value)) {
|
|
651
|
+
throw new TypeError('Cannot use null or undefined');
|
|
762
652
|
}
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
653
|
+
return value;
|
|
654
|
+
};
|
|
655
|
+
});
|
|
656
|
+
var require_iterate = __commonJS(function(exports, module) {
|
|
657
|
+
'use strict';
|
|
658
|
+
var callable = require_valid_callable();
|
|
659
|
+
var value = require_valid_value();
|
|
660
|
+
var bind = Function.prototype.bind;
|
|
661
|
+
var call = Function.prototype.call;
|
|
662
|
+
var keys = Object.keys;
|
|
663
|
+
var objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
664
|
+
module.exports = function(method, defVal) {
|
|
665
|
+
return function(obj, cb) {
|
|
666
|
+
var list, thisArg = arguments[2], compareFn = arguments[3];
|
|
667
|
+
obj = Object(value(obj));
|
|
668
|
+
callable(cb);
|
|
669
|
+
list = keys(obj);
|
|
670
|
+
if (compareFn) {
|
|
671
|
+
list.sort(typeof compareFn === 'function' ? bind.call(compareFn, obj) : void 0);
|
|
767
672
|
}
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
res = {
|
|
775
|
-
type: 'selectors',
|
|
776
|
-
selectors: [ selector ]
|
|
777
|
-
};
|
|
673
|
+
if (typeof method !== 'function') {
|
|
674
|
+
method = list[method];
|
|
675
|
+
}
|
|
676
|
+
return call.call(method, list, function(key, index) {
|
|
677
|
+
if (!objPropertyIsEnumerable.call(obj, key)) {
|
|
678
|
+
return defVal;
|
|
778
679
|
}
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
680
|
+
return call.call(cb, thisArg, obj[key], key, obj, index);
|
|
681
|
+
});
|
|
682
|
+
};
|
|
683
|
+
};
|
|
684
|
+
});
|
|
685
|
+
var require_for_each = __commonJS(function(exports, module) {
|
|
686
|
+
'use strict';
|
|
687
|
+
module.exports = require_iterate()('forEach');
|
|
688
|
+
});
|
|
689
|
+
var require_registered_extensions = __commonJS(function() {
|
|
690
|
+
'use strict';
|
|
691
|
+
});
|
|
692
|
+
var require_is_implemented2 = __commonJS(function(exports, module) {
|
|
693
|
+
'use strict';
|
|
694
|
+
module.exports = function() {
|
|
695
|
+
var assign = Object.assign, obj;
|
|
696
|
+
if (typeof assign !== 'function') {
|
|
697
|
+
return false;
|
|
698
|
+
}
|
|
699
|
+
obj = {
|
|
700
|
+
foo: 'raz'
|
|
701
|
+
};
|
|
702
|
+
assign(obj, {
|
|
703
|
+
bar: 'dwa'
|
|
704
|
+
}, {
|
|
705
|
+
trzy: 'trzy'
|
|
706
|
+
});
|
|
707
|
+
return obj.foo + obj.bar + obj.trzy === 'razdwatrzy';
|
|
708
|
+
};
|
|
709
|
+
});
|
|
710
|
+
var require_is_implemented3 = __commonJS(function(exports, module) {
|
|
711
|
+
'use strict';
|
|
712
|
+
module.exports = function() {
|
|
713
|
+
try {
|
|
714
|
+
Object.keys('primitive');
|
|
715
|
+
return true;
|
|
716
|
+
} catch (e) {
|
|
717
|
+
return false;
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
});
|
|
721
|
+
var require_shim2 = __commonJS(function(exports, module) {
|
|
722
|
+
'use strict';
|
|
723
|
+
var isValue = require_is_value();
|
|
724
|
+
var keys = Object.keys;
|
|
725
|
+
module.exports = function(object) {
|
|
726
|
+
return keys(isValue(object) ? Object(object) : object);
|
|
727
|
+
};
|
|
728
|
+
});
|
|
729
|
+
var require_keys = __commonJS(function(exports, module) {
|
|
730
|
+
'use strict';
|
|
731
|
+
module.exports = require_is_implemented3()() ? Object.keys : require_shim2();
|
|
732
|
+
});
|
|
733
|
+
var require_shim3 = __commonJS(function(exports, module) {
|
|
734
|
+
'use strict';
|
|
735
|
+
var keys = require_keys();
|
|
736
|
+
var value = require_valid_value();
|
|
737
|
+
var max2 = Math.max;
|
|
738
|
+
module.exports = function(dest, src) {
|
|
739
|
+
var error, i, length = max2(arguments.length, 2), assign;
|
|
740
|
+
dest = Object(value(dest));
|
|
741
|
+
assign = function assign(key) {
|
|
742
|
+
try {
|
|
743
|
+
dest[key] = src[key];
|
|
744
|
+
} catch (e) {
|
|
745
|
+
if (!error) {
|
|
746
|
+
error = e;
|
|
782
747
|
}
|
|
783
|
-
res.selectors.push(selector);
|
|
784
748
|
}
|
|
785
|
-
|
|
749
|
+
};
|
|
750
|
+
for (i = 1; i < length; ++i) {
|
|
751
|
+
src = arguments[i];
|
|
752
|
+
keys(src).forEach(assign);
|
|
786
753
|
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
return selector;
|
|
823
|
-
}
|
|
824
|
-
function parseRule() {
|
|
825
|
-
var rule = null;
|
|
826
|
-
while (pos < l) {
|
|
827
|
-
chr = str.charAt(pos);
|
|
828
|
-
if (chr === '*') {
|
|
829
|
-
pos++;
|
|
830
|
-
(rule = rule || {}).tagName = '*';
|
|
831
|
-
} else if (utils_1.isIdentStart(chr) || chr === '\\') {
|
|
832
|
-
(rule = rule || {}).tagName = getIdent();
|
|
833
|
-
} else if (chr === '.') {
|
|
834
|
-
pos++;
|
|
835
|
-
rule = rule || {};
|
|
836
|
-
(rule.classNames = rule.classNames || []).push(getIdent());
|
|
837
|
-
} else if (chr === '#') {
|
|
838
|
-
pos++;
|
|
839
|
-
(rule = rule || {}).id = getIdent();
|
|
840
|
-
} else if (chr === '[') {
|
|
841
|
-
pos++;
|
|
842
|
-
skipWhitespace();
|
|
843
|
-
var attr = {
|
|
844
|
-
name: getIdent()
|
|
845
|
-
};
|
|
846
|
-
skipWhitespace();
|
|
847
|
-
if (chr === ']') {
|
|
848
|
-
pos++;
|
|
849
|
-
} else {
|
|
850
|
-
var operator = '';
|
|
851
|
-
if (attrEqualityMods[chr]) {
|
|
852
|
-
operator = chr;
|
|
853
|
-
pos++;
|
|
854
|
-
chr = str.charAt(pos);
|
|
855
|
-
}
|
|
856
|
-
if (pos >= l) {
|
|
857
|
-
throw Error('Expected "=" but end of file reached.');
|
|
858
|
-
}
|
|
859
|
-
if (chr !== '=') {
|
|
860
|
-
throw Error('Expected "=" but "' + chr + '" found.');
|
|
861
|
-
}
|
|
862
|
-
attr.operator = operator + '=';
|
|
863
|
-
pos++;
|
|
864
|
-
skipWhitespace();
|
|
865
|
-
var attrValue = '';
|
|
866
|
-
attr.valueType = 'string';
|
|
867
|
-
if (chr === '"') {
|
|
868
|
-
attrValue = getStr('"', utils_1.doubleQuotesEscapeChars);
|
|
869
|
-
} else if (chr === '\'') {
|
|
870
|
-
attrValue = getStr('\'', utils_1.singleQuoteEscapeChars);
|
|
871
|
-
} else if (substitutesEnabled && chr === '$') {
|
|
872
|
-
pos++;
|
|
873
|
-
attrValue = getIdent();
|
|
874
|
-
attr.valueType = 'substitute';
|
|
875
|
-
} else {
|
|
876
|
-
while (pos < l) {
|
|
877
|
-
if (chr === ']') {
|
|
878
|
-
break;
|
|
879
|
-
}
|
|
880
|
-
attrValue += chr;
|
|
881
|
-
pos++;
|
|
882
|
-
chr = str.charAt(pos);
|
|
883
|
-
}
|
|
884
|
-
attrValue = attrValue.trim();
|
|
885
|
-
}
|
|
886
|
-
skipWhitespace();
|
|
887
|
-
if (pos >= l) {
|
|
888
|
-
throw Error('Expected "]" but end of file reached.');
|
|
889
|
-
}
|
|
890
|
-
if (chr !== ']') {
|
|
891
|
-
throw Error('Expected "]" but "' + chr + '" found.');
|
|
892
|
-
}
|
|
893
|
-
pos++;
|
|
894
|
-
attr.value = attrValue;
|
|
895
|
-
}
|
|
896
|
-
rule = rule || {};
|
|
897
|
-
(rule.attrs = rule.attrs || []).push(attr);
|
|
898
|
-
} else if (chr === ':') {
|
|
899
|
-
pos++;
|
|
900
|
-
var pseudoName = getIdent();
|
|
901
|
-
var pseudo = {
|
|
902
|
-
name: pseudoName
|
|
903
|
-
};
|
|
904
|
-
if (chr === '(') {
|
|
905
|
-
pos++;
|
|
906
|
-
var value = '';
|
|
907
|
-
skipWhitespace();
|
|
908
|
-
if (pseudos[pseudoName] === 'selector') {
|
|
909
|
-
pseudo.valueType = 'selector';
|
|
910
|
-
value = parseSelector();
|
|
911
|
-
} else {
|
|
912
|
-
pseudo.valueType = pseudos[pseudoName] || 'string';
|
|
913
|
-
if (chr === '"') {
|
|
914
|
-
value = getStr('"', utils_1.doubleQuotesEscapeChars);
|
|
915
|
-
} else if (chr === '\'') {
|
|
916
|
-
value = getStr('\'', utils_1.singleQuoteEscapeChars);
|
|
917
|
-
} else if (substitutesEnabled && chr === '$') {
|
|
918
|
-
pos++;
|
|
919
|
-
value = getIdent();
|
|
920
|
-
pseudo.valueType = 'substitute';
|
|
921
|
-
} else {
|
|
922
|
-
while (pos < l) {
|
|
923
|
-
if (chr === ')') {
|
|
924
|
-
break;
|
|
925
|
-
}
|
|
926
|
-
value += chr;
|
|
927
|
-
pos++;
|
|
928
|
-
chr = str.charAt(pos);
|
|
929
|
-
}
|
|
930
|
-
value = value.trim();
|
|
931
|
-
}
|
|
932
|
-
skipWhitespace();
|
|
933
|
-
}
|
|
934
|
-
if (pos >= l) {
|
|
935
|
-
throw Error('Expected ")" but end of file reached.');
|
|
936
|
-
}
|
|
937
|
-
if (chr !== ')') {
|
|
938
|
-
throw Error('Expected ")" but "' + chr + '" found.');
|
|
939
|
-
}
|
|
940
|
-
pos++;
|
|
941
|
-
pseudo.value = value;
|
|
942
|
-
}
|
|
943
|
-
rule = rule || {};
|
|
944
|
-
(rule.pseudos = rule.pseudos || []).push(pseudo);
|
|
945
|
-
} else {
|
|
946
|
-
break;
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
return rule;
|
|
950
|
-
}
|
|
951
|
-
return parse3();
|
|
952
|
-
}
|
|
953
|
-
exports.parseCssSelector = parseCssSelector;
|
|
954
|
-
});
|
|
955
|
-
var require_render = __commonJS(function(exports) {
|
|
956
|
-
'use strict';
|
|
957
|
-
Object.defineProperty(exports, '__esModule', {
|
|
958
|
-
value: true
|
|
959
|
-
});
|
|
960
|
-
var utils_1 = require_utils();
|
|
961
|
-
function renderEntity(entity) {
|
|
962
|
-
var res = '';
|
|
963
|
-
switch (entity.type) {
|
|
964
|
-
case 'ruleSet':
|
|
965
|
-
var currentEntity = entity.rule;
|
|
966
|
-
var parts = [];
|
|
967
|
-
while (currentEntity) {
|
|
968
|
-
if (currentEntity.nestingOperator) {
|
|
969
|
-
parts.push(currentEntity.nestingOperator);
|
|
970
|
-
}
|
|
971
|
-
parts.push(renderEntity(currentEntity));
|
|
972
|
-
currentEntity = currentEntity.rule;
|
|
973
|
-
}
|
|
974
|
-
res = parts.join(' ');
|
|
975
|
-
break;
|
|
976
|
-
|
|
977
|
-
case 'selectors':
|
|
978
|
-
res = entity.selectors.map(renderEntity).join(', ');
|
|
979
|
-
break;
|
|
980
|
-
|
|
981
|
-
case 'rule':
|
|
982
|
-
if (entity.tagName) {
|
|
983
|
-
if (entity.tagName === '*') {
|
|
984
|
-
res = '*';
|
|
985
|
-
} else {
|
|
986
|
-
res = utils_1.escapeIdentifier(entity.tagName);
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
if (entity.id) {
|
|
990
|
-
res += '#' + utils_1.escapeIdentifier(entity.id);
|
|
991
|
-
}
|
|
992
|
-
if (entity.classNames) {
|
|
993
|
-
res += entity.classNames.map(function(cn) {
|
|
994
|
-
return '.' + utils_1.escapeIdentifier(cn);
|
|
995
|
-
}).join('');
|
|
996
|
-
}
|
|
997
|
-
if (entity.attrs) {
|
|
998
|
-
res += entity.attrs.map(function(attr) {
|
|
999
|
-
if ('operator' in attr) {
|
|
1000
|
-
if (attr.valueType === 'substitute') {
|
|
1001
|
-
return '[' + utils_1.escapeIdentifier(attr.name) + attr.operator + '$' + attr.value + ']';
|
|
1002
|
-
} else {
|
|
1003
|
-
return '[' + utils_1.escapeIdentifier(attr.name) + attr.operator + utils_1.escapeStr(attr.value) + ']';
|
|
1004
|
-
}
|
|
1005
|
-
} else {
|
|
1006
|
-
return '[' + utils_1.escapeIdentifier(attr.name) + ']';
|
|
1007
|
-
}
|
|
1008
|
-
}).join('');
|
|
1009
|
-
}
|
|
1010
|
-
if (entity.pseudos) {
|
|
1011
|
-
res += entity.pseudos.map(function(pseudo) {
|
|
1012
|
-
if (pseudo.valueType) {
|
|
1013
|
-
if (pseudo.valueType === 'selector') {
|
|
1014
|
-
return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + renderEntity(pseudo.value) + ')';
|
|
1015
|
-
} else if (pseudo.valueType === 'substitute') {
|
|
1016
|
-
return ':' + utils_1.escapeIdentifier(pseudo.name) + '($' + pseudo.value + ')';
|
|
1017
|
-
} else if (pseudo.valueType === 'numeric') {
|
|
1018
|
-
return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + pseudo.value + ')';
|
|
1019
|
-
} else {
|
|
1020
|
-
return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + utils_1.escapeIdentifier(pseudo.value) + ')';
|
|
1021
|
-
}
|
|
1022
|
-
} else {
|
|
1023
|
-
return ':' + utils_1.escapeIdentifier(pseudo.name);
|
|
1024
|
-
}
|
|
1025
|
-
}).join('');
|
|
1026
|
-
}
|
|
1027
|
-
break;
|
|
1028
|
-
|
|
1029
|
-
default:
|
|
1030
|
-
throw Error('Unknown entity type: "' + entity.type + '".');
|
|
1031
|
-
}
|
|
1032
|
-
return res;
|
|
1033
|
-
}
|
|
1034
|
-
exports.renderEntity = renderEntity;
|
|
1035
|
-
});
|
|
1036
|
-
var require_lib = __commonJS(function(exports) {
|
|
1037
|
-
'use strict';
|
|
1038
|
-
Object.defineProperty(exports, '__esModule', {
|
|
1039
|
-
value: true
|
|
1040
|
-
});
|
|
1041
|
-
var parser_context_1 = require_parser_context();
|
|
1042
|
-
var render_1 = require_render();
|
|
1043
|
-
var CssSelectorParser3 = function() {
|
|
1044
|
-
function CssSelectorParser4() {
|
|
1045
|
-
this.pseudos = {};
|
|
1046
|
-
this.attrEqualityMods = {};
|
|
1047
|
-
this.ruleNestingOperators = {};
|
|
1048
|
-
this.substitutesEnabled = false;
|
|
1049
|
-
}
|
|
1050
|
-
CssSelectorParser4.prototype.registerSelectorPseudos = function() {
|
|
1051
|
-
var pseudos = [];
|
|
1052
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1053
|
-
pseudos[_i] = arguments[_i];
|
|
1054
|
-
}
|
|
1055
|
-
for (var _a = 0, pseudos_1 = pseudos; _a < pseudos_1.length; _a++) {
|
|
1056
|
-
var pseudo = pseudos_1[_a];
|
|
1057
|
-
this.pseudos[pseudo] = 'selector';
|
|
1058
|
-
}
|
|
1059
|
-
return this;
|
|
1060
|
-
};
|
|
1061
|
-
CssSelectorParser4.prototype.unregisterSelectorPseudos = function() {
|
|
1062
|
-
var pseudos = [];
|
|
1063
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1064
|
-
pseudos[_i] = arguments[_i];
|
|
1065
|
-
}
|
|
1066
|
-
for (var _a = 0, pseudos_2 = pseudos; _a < pseudos_2.length; _a++) {
|
|
1067
|
-
var pseudo = pseudos_2[_a];
|
|
1068
|
-
delete this.pseudos[pseudo];
|
|
1069
|
-
}
|
|
1070
|
-
return this;
|
|
1071
|
-
};
|
|
1072
|
-
CssSelectorParser4.prototype.registerNumericPseudos = function() {
|
|
1073
|
-
var pseudos = [];
|
|
1074
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1075
|
-
pseudos[_i] = arguments[_i];
|
|
1076
|
-
}
|
|
1077
|
-
for (var _a = 0, pseudos_3 = pseudos; _a < pseudos_3.length; _a++) {
|
|
1078
|
-
var pseudo = pseudos_3[_a];
|
|
1079
|
-
this.pseudos[pseudo] = 'numeric';
|
|
1080
|
-
}
|
|
1081
|
-
return this;
|
|
1082
|
-
};
|
|
1083
|
-
CssSelectorParser4.prototype.unregisterNumericPseudos = function() {
|
|
1084
|
-
var pseudos = [];
|
|
1085
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1086
|
-
pseudos[_i] = arguments[_i];
|
|
1087
|
-
}
|
|
1088
|
-
for (var _a = 0, pseudos_4 = pseudos; _a < pseudos_4.length; _a++) {
|
|
1089
|
-
var pseudo = pseudos_4[_a];
|
|
1090
|
-
delete this.pseudos[pseudo];
|
|
1091
|
-
}
|
|
1092
|
-
return this;
|
|
1093
|
-
};
|
|
1094
|
-
CssSelectorParser4.prototype.registerNestingOperators = function() {
|
|
1095
|
-
var operators = [];
|
|
1096
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1097
|
-
operators[_i] = arguments[_i];
|
|
1098
|
-
}
|
|
1099
|
-
for (var _a = 0, operators_1 = operators; _a < operators_1.length; _a++) {
|
|
1100
|
-
var operator = operators_1[_a];
|
|
1101
|
-
this.ruleNestingOperators[operator] = true;
|
|
1102
|
-
}
|
|
1103
|
-
return this;
|
|
1104
|
-
};
|
|
1105
|
-
CssSelectorParser4.prototype.unregisterNestingOperators = function() {
|
|
1106
|
-
var operators = [];
|
|
1107
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1108
|
-
operators[_i] = arguments[_i];
|
|
1109
|
-
}
|
|
1110
|
-
for (var _a = 0, operators_2 = operators; _a < operators_2.length; _a++) {
|
|
1111
|
-
var operator = operators_2[_a];
|
|
1112
|
-
delete this.ruleNestingOperators[operator];
|
|
1113
|
-
}
|
|
1114
|
-
return this;
|
|
1115
|
-
};
|
|
1116
|
-
CssSelectorParser4.prototype.registerAttrEqualityMods = function() {
|
|
1117
|
-
var mods = [];
|
|
1118
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1119
|
-
mods[_i] = arguments[_i];
|
|
1120
|
-
}
|
|
1121
|
-
for (var _a = 0, mods_1 = mods; _a < mods_1.length; _a++) {
|
|
1122
|
-
var mod = mods_1[_a];
|
|
1123
|
-
this.attrEqualityMods[mod] = true;
|
|
1124
|
-
}
|
|
1125
|
-
return this;
|
|
1126
|
-
};
|
|
1127
|
-
CssSelectorParser4.prototype.unregisterAttrEqualityMods = function() {
|
|
1128
|
-
var mods = [];
|
|
1129
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1130
|
-
mods[_i] = arguments[_i];
|
|
1131
|
-
}
|
|
1132
|
-
for (var _a = 0, mods_2 = mods; _a < mods_2.length; _a++) {
|
|
1133
|
-
var mod = mods_2[_a];
|
|
1134
|
-
delete this.attrEqualityMods[mod];
|
|
1135
|
-
}
|
|
1136
|
-
return this;
|
|
1137
|
-
};
|
|
1138
|
-
CssSelectorParser4.prototype.enableSubstitutes = function() {
|
|
1139
|
-
this.substitutesEnabled = true;
|
|
1140
|
-
return this;
|
|
1141
|
-
};
|
|
1142
|
-
CssSelectorParser4.prototype.disableSubstitutes = function() {
|
|
1143
|
-
this.substitutesEnabled = false;
|
|
1144
|
-
return this;
|
|
1145
|
-
};
|
|
1146
|
-
CssSelectorParser4.prototype.parse = function(str) {
|
|
1147
|
-
return parser_context_1.parseCssSelector(str, 0, this.pseudos, this.attrEqualityMods, this.ruleNestingOperators, this.substitutesEnabled);
|
|
1148
|
-
};
|
|
1149
|
-
CssSelectorParser4.prototype.render = function(path) {
|
|
1150
|
-
return render_1.renderEntity(path).trim();
|
|
1151
|
-
};
|
|
1152
|
-
return CssSelectorParser4;
|
|
1153
|
-
}();
|
|
1154
|
-
exports.CssSelectorParser = CssSelectorParser3;
|
|
1155
|
-
});
|
|
1156
|
-
var require_noop = __commonJS(function(exports, module) {
|
|
1157
|
-
'use strict';
|
|
1158
|
-
module.exports = function() {};
|
|
1159
|
-
});
|
|
1160
|
-
var require_is_value = __commonJS(function(exports, module) {
|
|
1161
|
-
'use strict';
|
|
1162
|
-
var _undefined = require_noop()();
|
|
1163
|
-
module.exports = function(val) {
|
|
1164
|
-
return val !== _undefined && val !== null;
|
|
1165
|
-
};
|
|
1166
|
-
});
|
|
1167
|
-
var require_normalize_options = __commonJS(function(exports, module) {
|
|
1168
|
-
'use strict';
|
|
1169
|
-
var isValue = require_is_value();
|
|
1170
|
-
var forEach = Array.prototype.forEach;
|
|
1171
|
-
var create = Object.create;
|
|
1172
|
-
var process2 = function process2(src, obj) {
|
|
1173
|
-
var key;
|
|
1174
|
-
for (key in src) {
|
|
1175
|
-
obj[key] = src[key];
|
|
1176
|
-
}
|
|
1177
|
-
};
|
|
1178
|
-
module.exports = function(opts1) {
|
|
1179
|
-
var result = create(null);
|
|
1180
|
-
forEach.call(arguments, function(options) {
|
|
1181
|
-
if (!isValue(options)) {
|
|
1182
|
-
return;
|
|
1183
|
-
}
|
|
1184
|
-
process2(Object(options), result);
|
|
1185
|
-
});
|
|
1186
|
-
return result;
|
|
1187
|
-
};
|
|
1188
|
-
});
|
|
1189
|
-
var require_is_implemented = __commonJS(function(exports, module) {
|
|
1190
|
-
'use strict';
|
|
1191
|
-
module.exports = function() {
|
|
1192
|
-
var sign = Math.sign;
|
|
1193
|
-
if (typeof sign !== 'function') {
|
|
1194
|
-
return false;
|
|
1195
|
-
}
|
|
1196
|
-
return sign(10) === 1 && sign(-20) === -1;
|
|
1197
|
-
};
|
|
1198
|
-
});
|
|
1199
|
-
var require_shim = __commonJS(function(exports, module) {
|
|
1200
|
-
'use strict';
|
|
1201
|
-
module.exports = function(value) {
|
|
1202
|
-
value = Number(value);
|
|
1203
|
-
if (isNaN(value) || value === 0) {
|
|
1204
|
-
return value;
|
|
1205
|
-
}
|
|
1206
|
-
return value > 0 ? 1 : -1;
|
|
1207
|
-
};
|
|
1208
|
-
});
|
|
1209
|
-
var require_sign = __commonJS(function(exports, module) {
|
|
1210
|
-
'use strict';
|
|
1211
|
-
module.exports = require_is_implemented()() ? Math.sign : require_shim();
|
|
1212
|
-
});
|
|
1213
|
-
var require_to_integer = __commonJS(function(exports, module) {
|
|
1214
|
-
'use strict';
|
|
1215
|
-
var sign = require_sign();
|
|
1216
|
-
var abs = Math.abs;
|
|
1217
|
-
var floor = Math.floor;
|
|
1218
|
-
module.exports = function(value) {
|
|
1219
|
-
if (isNaN(value)) {
|
|
1220
|
-
return 0;
|
|
1221
|
-
}
|
|
1222
|
-
value = Number(value);
|
|
1223
|
-
if (value === 0 || !isFinite(value)) {
|
|
1224
|
-
return value;
|
|
1225
|
-
}
|
|
1226
|
-
return sign(value) * floor(abs(value));
|
|
1227
|
-
};
|
|
1228
|
-
});
|
|
1229
|
-
var require_to_pos_integer = __commonJS(function(exports, module) {
|
|
1230
|
-
'use strict';
|
|
1231
|
-
var toInteger = require_to_integer();
|
|
1232
|
-
var max2 = Math.max;
|
|
1233
|
-
module.exports = function(value) {
|
|
1234
|
-
return max2(0, toInteger(value));
|
|
1235
|
-
};
|
|
1236
|
-
});
|
|
1237
|
-
var require_resolve_length = __commonJS(function(exports, module) {
|
|
1238
|
-
'use strict';
|
|
1239
|
-
var toPosInt = require_to_pos_integer();
|
|
1240
|
-
module.exports = function(optsLength, fnLength, isAsync) {
|
|
1241
|
-
var length;
|
|
1242
|
-
if (isNaN(optsLength)) {
|
|
1243
|
-
length = fnLength;
|
|
1244
|
-
if (!(length >= 0)) {
|
|
1245
|
-
return 1;
|
|
1246
|
-
}
|
|
1247
|
-
if (isAsync && length) {
|
|
1248
|
-
return length - 1;
|
|
1249
|
-
}
|
|
1250
|
-
return length;
|
|
1251
|
-
}
|
|
1252
|
-
if (optsLength === false) {
|
|
1253
|
-
return false;
|
|
1254
|
-
}
|
|
1255
|
-
return toPosInt(optsLength);
|
|
1256
|
-
};
|
|
1257
|
-
});
|
|
1258
|
-
var require_valid_callable = __commonJS(function(exports, module) {
|
|
1259
|
-
'use strict';
|
|
1260
|
-
module.exports = function(fn) {
|
|
1261
|
-
if (typeof fn !== 'function') {
|
|
1262
|
-
throw new TypeError(fn + ' is not a function');
|
|
1263
|
-
}
|
|
1264
|
-
return fn;
|
|
1265
|
-
};
|
|
1266
|
-
});
|
|
1267
|
-
var require_valid_value = __commonJS(function(exports, module) {
|
|
1268
|
-
'use strict';
|
|
1269
|
-
var isValue = require_is_value();
|
|
1270
|
-
module.exports = function(value) {
|
|
1271
|
-
if (!isValue(value)) {
|
|
1272
|
-
throw new TypeError('Cannot use null or undefined');
|
|
1273
|
-
}
|
|
1274
|
-
return value;
|
|
1275
|
-
};
|
|
1276
|
-
});
|
|
1277
|
-
var require_iterate = __commonJS(function(exports, module) {
|
|
1278
|
-
'use strict';
|
|
1279
|
-
var callable = require_valid_callable();
|
|
1280
|
-
var value = require_valid_value();
|
|
1281
|
-
var bind = Function.prototype.bind;
|
|
1282
|
-
var call = Function.prototype.call;
|
|
1283
|
-
var keys = Object.keys;
|
|
1284
|
-
var objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
1285
|
-
module.exports = function(method, defVal) {
|
|
1286
|
-
return function(obj, cb) {
|
|
1287
|
-
var list, thisArg = arguments[2], compareFn = arguments[3];
|
|
1288
|
-
obj = Object(value(obj));
|
|
1289
|
-
callable(cb);
|
|
1290
|
-
list = keys(obj);
|
|
1291
|
-
if (compareFn) {
|
|
1292
|
-
list.sort(typeof compareFn === 'function' ? bind.call(compareFn, obj) : void 0);
|
|
1293
|
-
}
|
|
1294
|
-
if (typeof method !== 'function') {
|
|
1295
|
-
method = list[method];
|
|
1296
|
-
}
|
|
1297
|
-
return call.call(method, list, function(key, index) {
|
|
1298
|
-
if (!objPropertyIsEnumerable.call(obj, key)) {
|
|
1299
|
-
return defVal;
|
|
1300
|
-
}
|
|
1301
|
-
return call.call(cb, thisArg, obj[key], key, obj, index);
|
|
1302
|
-
});
|
|
1303
|
-
};
|
|
1304
|
-
};
|
|
1305
|
-
});
|
|
1306
|
-
var require_for_each = __commonJS(function(exports, module) {
|
|
1307
|
-
'use strict';
|
|
1308
|
-
module.exports = require_iterate()('forEach');
|
|
1309
|
-
});
|
|
1310
|
-
var require_registered_extensions = __commonJS(function() {
|
|
1311
|
-
'use strict';
|
|
1312
|
-
});
|
|
1313
|
-
var require_is_implemented2 = __commonJS(function(exports, module) {
|
|
1314
|
-
'use strict';
|
|
1315
|
-
module.exports = function() {
|
|
1316
|
-
var assign = Object.assign, obj;
|
|
1317
|
-
if (typeof assign !== 'function') {
|
|
1318
|
-
return false;
|
|
1319
|
-
}
|
|
1320
|
-
obj = {
|
|
1321
|
-
foo: 'raz'
|
|
1322
|
-
};
|
|
1323
|
-
assign(obj, {
|
|
1324
|
-
bar: 'dwa'
|
|
1325
|
-
}, {
|
|
1326
|
-
trzy: 'trzy'
|
|
1327
|
-
});
|
|
1328
|
-
return obj.foo + obj.bar + obj.trzy === 'razdwatrzy';
|
|
1329
|
-
};
|
|
1330
|
-
});
|
|
1331
|
-
var require_is_implemented3 = __commonJS(function(exports, module) {
|
|
1332
|
-
'use strict';
|
|
1333
|
-
module.exports = function() {
|
|
1334
|
-
try {
|
|
1335
|
-
Object.keys('primitive');
|
|
1336
|
-
return true;
|
|
1337
|
-
} catch (e) {
|
|
1338
|
-
return false;
|
|
1339
|
-
}
|
|
1340
|
-
};
|
|
1341
|
-
});
|
|
1342
|
-
var require_shim2 = __commonJS(function(exports, module) {
|
|
1343
|
-
'use strict';
|
|
1344
|
-
var isValue = require_is_value();
|
|
1345
|
-
var keys = Object.keys;
|
|
1346
|
-
module.exports = function(object) {
|
|
1347
|
-
return keys(isValue(object) ? Object(object) : object);
|
|
1348
|
-
};
|
|
1349
|
-
});
|
|
1350
|
-
var require_keys = __commonJS(function(exports, module) {
|
|
1351
|
-
'use strict';
|
|
1352
|
-
module.exports = require_is_implemented3()() ? Object.keys : require_shim2();
|
|
1353
|
-
});
|
|
1354
|
-
var require_shim3 = __commonJS(function(exports, module) {
|
|
1355
|
-
'use strict';
|
|
1356
|
-
var keys = require_keys();
|
|
1357
|
-
var value = require_valid_value();
|
|
1358
|
-
var max2 = Math.max;
|
|
1359
|
-
module.exports = function(dest, src) {
|
|
1360
|
-
var error, i, length = max2(arguments.length, 2), assign;
|
|
1361
|
-
dest = Object(value(dest));
|
|
1362
|
-
assign = function assign(key) {
|
|
1363
|
-
try {
|
|
1364
|
-
dest[key] = src[key];
|
|
1365
|
-
} catch (e) {
|
|
1366
|
-
if (!error) {
|
|
1367
|
-
error = e;
|
|
1368
|
-
}
|
|
1369
|
-
}
|
|
1370
|
-
};
|
|
1371
|
-
for (i = 1; i < length; ++i) {
|
|
1372
|
-
src = arguments[i];
|
|
1373
|
-
keys(src).forEach(assign);
|
|
1374
|
-
}
|
|
1375
|
-
if (error !== void 0) {
|
|
1376
|
-
throw error;
|
|
1377
|
-
}
|
|
1378
|
-
return dest;
|
|
1379
|
-
};
|
|
1380
|
-
});
|
|
1381
|
-
var require_assign = __commonJS(function(exports, module) {
|
|
1382
|
-
'use strict';
|
|
1383
|
-
module.exports = require_is_implemented2()() ? Object.assign : require_shim3();
|
|
1384
|
-
});
|
|
1385
|
-
var require_is_object = __commonJS(function(exports, module) {
|
|
1386
|
-
'use strict';
|
|
1387
|
-
var isValue = require_is_value();
|
|
1388
|
-
var map = {
|
|
1389
|
-
function: true,
|
|
1390
|
-
object: true
|
|
1391
|
-
};
|
|
1392
|
-
module.exports = function(value) {
|
|
1393
|
-
return isValue(value) && map[_typeof(value)] || false;
|
|
1394
|
-
};
|
|
1395
|
-
});
|
|
1396
|
-
var require_custom = __commonJS(function(exports, module) {
|
|
1397
|
-
'use strict';
|
|
1398
|
-
var assign = require_assign();
|
|
1399
|
-
var isObject = require_is_object();
|
|
1400
|
-
var isValue = require_is_value();
|
|
1401
|
-
var captureStackTrace = Error.captureStackTrace;
|
|
1402
|
-
module.exports = function(message) {
|
|
1403
|
-
var err2 = new Error(message), code = arguments[1], ext = arguments[2];
|
|
1404
|
-
if (!isValue(ext)) {
|
|
1405
|
-
if (isObject(code)) {
|
|
1406
|
-
ext = code;
|
|
1407
|
-
code = null;
|
|
754
|
+
if (error !== void 0) {
|
|
755
|
+
throw error;
|
|
756
|
+
}
|
|
757
|
+
return dest;
|
|
758
|
+
};
|
|
759
|
+
});
|
|
760
|
+
var require_assign = __commonJS(function(exports, module) {
|
|
761
|
+
'use strict';
|
|
762
|
+
module.exports = require_is_implemented2()() ? Object.assign : require_shim3();
|
|
763
|
+
});
|
|
764
|
+
var require_is_object = __commonJS(function(exports, module) {
|
|
765
|
+
'use strict';
|
|
766
|
+
var isValue = require_is_value();
|
|
767
|
+
var map = {
|
|
768
|
+
function: true,
|
|
769
|
+
object: true
|
|
770
|
+
};
|
|
771
|
+
module.exports = function(value) {
|
|
772
|
+
return isValue(value) && map[_typeof(value)] || false;
|
|
773
|
+
};
|
|
774
|
+
});
|
|
775
|
+
var require_custom = __commonJS(function(exports, module) {
|
|
776
|
+
'use strict';
|
|
777
|
+
var assign = require_assign();
|
|
778
|
+
var isObject = require_is_object();
|
|
779
|
+
var isValue = require_is_value();
|
|
780
|
+
var captureStackTrace = Error.captureStackTrace;
|
|
781
|
+
module.exports = function(message) {
|
|
782
|
+
var err2 = new Error(message), code = arguments[1], ext = arguments[2];
|
|
783
|
+
if (!isValue(ext)) {
|
|
784
|
+
if (isObject(code)) {
|
|
785
|
+
ext = code;
|
|
786
|
+
code = null;
|
|
1408
787
|
}
|
|
1409
788
|
}
|
|
1410
789
|
if (isValue(ext)) {
|
|
@@ -1707,21 +1086,21 @@
|
|
|
1707
1086
|
var descriptors;
|
|
1708
1087
|
var base;
|
|
1709
1088
|
on = function on(type2, listener) {
|
|
1710
|
-
var
|
|
1089
|
+
var data;
|
|
1711
1090
|
callable(listener);
|
|
1712
1091
|
if (!hasOwnProperty2.call(this, '__ee__')) {
|
|
1713
|
-
|
|
1092
|
+
data = descriptor.value = create(null);
|
|
1714
1093
|
defineProperty(this, '__ee__', descriptor);
|
|
1715
1094
|
descriptor.value = null;
|
|
1716
1095
|
} else {
|
|
1717
|
-
|
|
1096
|
+
data = this.__ee__;
|
|
1718
1097
|
}
|
|
1719
|
-
if (!
|
|
1720
|
-
|
|
1721
|
-
} else if (_typeof(
|
|
1722
|
-
|
|
1098
|
+
if (!data[type2]) {
|
|
1099
|
+
data[type2] = listener;
|
|
1100
|
+
} else if (_typeof(data[type2]) === 'object') {
|
|
1101
|
+
data[type2].push(listener);
|
|
1723
1102
|
} else {
|
|
1724
|
-
|
|
1103
|
+
data[type2] = [ data[type2], listener ];
|
|
1725
1104
|
}
|
|
1726
1105
|
return this;
|
|
1727
1106
|
};
|
|
@@ -1737,21 +1116,21 @@
|
|
|
1737
1116
|
return this;
|
|
1738
1117
|
};
|
|
1739
1118
|
off = function off(type2, listener) {
|
|
1740
|
-
var
|
|
1119
|
+
var data, listeners, candidate, i;
|
|
1741
1120
|
callable(listener);
|
|
1742
1121
|
if (!hasOwnProperty2.call(this, '__ee__')) {
|
|
1743
1122
|
return this;
|
|
1744
1123
|
}
|
|
1745
|
-
|
|
1746
|
-
if (!
|
|
1124
|
+
data = this.__ee__;
|
|
1125
|
+
if (!data[type2]) {
|
|
1747
1126
|
return this;
|
|
1748
1127
|
}
|
|
1749
|
-
listeners =
|
|
1128
|
+
listeners = data[type2];
|
|
1750
1129
|
if (_typeof(listeners) === 'object') {
|
|
1751
1130
|
for (i = 0; candidate = listeners[i]; ++i) {
|
|
1752
1131
|
if (candidate === listener || candidate.__eeOnceListener__ === listener) {
|
|
1753
1132
|
if (listeners.length === 2) {
|
|
1754
|
-
|
|
1133
|
+
data[type2] = listeners[i ? 0 : 1];
|
|
1755
1134
|
} else {
|
|
1756
1135
|
listeners.splice(i, 1);
|
|
1757
1136
|
}
|
|
@@ -1759,7 +1138,7 @@
|
|
|
1759
1138
|
}
|
|
1760
1139
|
} else {
|
|
1761
1140
|
if (listeners === listener || listeners.__eeOnceListener__ === listener) {
|
|
1762
|
-
delete
|
|
1141
|
+
delete data[type2];
|
|
1763
1142
|
}
|
|
1764
1143
|
}
|
|
1765
1144
|
return this;
|
|
@@ -2844,782 +2223,1403 @@
|
|
|
2844
2223
|
map = [ [], [] ];
|
|
2845
2224
|
cache2 = create(null);
|
|
2846
2225
|
}
|
|
2847
|
-
};
|
|
2226
|
+
};
|
|
2227
|
+
};
|
|
2228
|
+
});
|
|
2229
|
+
var require_map = __commonJS(function(exports, module) {
|
|
2230
|
+
'use strict';
|
|
2231
|
+
var callable = require_valid_callable();
|
|
2232
|
+
var forEach = require_for_each();
|
|
2233
|
+
var call = Function.prototype.call;
|
|
2234
|
+
module.exports = function(obj, cb) {
|
|
2235
|
+
var result = {}, thisArg = arguments[2];
|
|
2236
|
+
callable(cb);
|
|
2237
|
+
forEach(obj, function(value, key, targetObj, index) {
|
|
2238
|
+
result[key] = call.call(cb, thisArg, value, key, targetObj, index);
|
|
2239
|
+
});
|
|
2240
|
+
return result;
|
|
2241
|
+
};
|
|
2242
|
+
});
|
|
2243
|
+
var require_next_tick = __commonJS(function(exports, module) {
|
|
2244
|
+
'use strict';
|
|
2245
|
+
var ensureCallable = function ensureCallable(fn) {
|
|
2246
|
+
if (typeof fn !== 'function') {
|
|
2247
|
+
throw new TypeError(fn + ' is not a function');
|
|
2248
|
+
}
|
|
2249
|
+
return fn;
|
|
2250
|
+
};
|
|
2251
|
+
var byObserver = function byObserver(Observer) {
|
|
2252
|
+
var node = document.createTextNode(''), queue2, currentQueue, i = 0;
|
|
2253
|
+
new Observer(function() {
|
|
2254
|
+
var callback;
|
|
2255
|
+
if (!queue2) {
|
|
2256
|
+
if (!currentQueue) {
|
|
2257
|
+
return;
|
|
2258
|
+
}
|
|
2259
|
+
queue2 = currentQueue;
|
|
2260
|
+
} else if (currentQueue) {
|
|
2261
|
+
queue2 = currentQueue.concat(queue2);
|
|
2262
|
+
}
|
|
2263
|
+
currentQueue = queue2;
|
|
2264
|
+
queue2 = null;
|
|
2265
|
+
if (typeof currentQueue === 'function') {
|
|
2266
|
+
callback = currentQueue;
|
|
2267
|
+
currentQueue = null;
|
|
2268
|
+
callback();
|
|
2269
|
+
return;
|
|
2270
|
+
}
|
|
2271
|
+
node.data = i = ++i % 2;
|
|
2272
|
+
while (currentQueue) {
|
|
2273
|
+
callback = currentQueue.shift();
|
|
2274
|
+
if (!currentQueue.length) {
|
|
2275
|
+
currentQueue = null;
|
|
2276
|
+
}
|
|
2277
|
+
callback();
|
|
2278
|
+
}
|
|
2279
|
+
}).observe(node, {
|
|
2280
|
+
characterData: true
|
|
2281
|
+
});
|
|
2282
|
+
return function(fn) {
|
|
2283
|
+
ensureCallable(fn);
|
|
2284
|
+
if (queue2) {
|
|
2285
|
+
if (typeof queue2 === 'function') {
|
|
2286
|
+
queue2 = [ queue2, fn ];
|
|
2287
|
+
} else {
|
|
2288
|
+
queue2.push(fn);
|
|
2289
|
+
}
|
|
2290
|
+
return;
|
|
2291
|
+
}
|
|
2292
|
+
queue2 = fn;
|
|
2293
|
+
node.data = i = ++i % 2;
|
|
2294
|
+
};
|
|
2295
|
+
};
|
|
2296
|
+
module.exports = function() {
|
|
2297
|
+
if ((typeof process === 'undefined' ? 'undefined' : _typeof(process)) === 'object' && process && typeof process.nextTick === 'function') {
|
|
2298
|
+
return process.nextTick;
|
|
2299
|
+
}
|
|
2300
|
+
if (typeof queueMicrotask === 'function') {
|
|
2301
|
+
return function(cb) {
|
|
2302
|
+
queueMicrotask(ensureCallable(cb));
|
|
2303
|
+
};
|
|
2304
|
+
}
|
|
2305
|
+
if ((typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object' && document) {
|
|
2306
|
+
if (typeof MutationObserver === 'function') {
|
|
2307
|
+
return byObserver(MutationObserver);
|
|
2308
|
+
}
|
|
2309
|
+
if (typeof WebKitMutationObserver === 'function') {
|
|
2310
|
+
return byObserver(WebKitMutationObserver);
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
if (typeof setImmediate === 'function') {
|
|
2314
|
+
return function(cb) {
|
|
2315
|
+
setImmediate(ensureCallable(cb));
|
|
2316
|
+
};
|
|
2317
|
+
}
|
|
2318
|
+
if (typeof setTimeout === 'function' || (typeof setTimeout === 'undefined' ? 'undefined' : _typeof(setTimeout)) === 'object') {
|
|
2319
|
+
return function(cb) {
|
|
2320
|
+
setTimeout(ensureCallable(cb), 0);
|
|
2321
|
+
};
|
|
2322
|
+
}
|
|
2323
|
+
return null;
|
|
2324
|
+
}();
|
|
2325
|
+
});
|
|
2326
|
+
var require_async = __commonJS(function() {
|
|
2327
|
+
'use strict';
|
|
2328
|
+
var aFrom = require_from();
|
|
2329
|
+
var objectMap = require_map();
|
|
2330
|
+
var mixin = require_mixin();
|
|
2331
|
+
var defineLength = require_define_length();
|
|
2332
|
+
var nextTick = require_next_tick();
|
|
2333
|
+
var slice = Array.prototype.slice;
|
|
2334
|
+
var apply = Function.prototype.apply;
|
|
2335
|
+
var create = Object.create;
|
|
2336
|
+
require_registered_extensions().async = function(tbi, conf) {
|
|
2337
|
+
var waiting = create(null), cache2 = create(null), base = conf.memoized, original = conf.original, currentCallback, currentContext, currentArgs;
|
|
2338
|
+
conf.memoized = defineLength(function(arg) {
|
|
2339
|
+
var args = arguments, last2 = args[args.length - 1];
|
|
2340
|
+
if (typeof last2 === 'function') {
|
|
2341
|
+
currentCallback = last2;
|
|
2342
|
+
args = slice.call(args, 0, -1);
|
|
2343
|
+
}
|
|
2344
|
+
return base.apply(currentContext = this, currentArgs = args);
|
|
2345
|
+
}, base);
|
|
2346
|
+
try {
|
|
2347
|
+
mixin(conf.memoized, base);
|
|
2348
|
+
} catch (ignore) {}
|
|
2349
|
+
conf.on('get', function(id) {
|
|
2350
|
+
var cb, context, args;
|
|
2351
|
+
if (!currentCallback) {
|
|
2352
|
+
return;
|
|
2353
|
+
}
|
|
2354
|
+
if (waiting[id]) {
|
|
2355
|
+
if (typeof waiting[id] === 'function') {
|
|
2356
|
+
waiting[id] = [ waiting[id], currentCallback ];
|
|
2357
|
+
} else {
|
|
2358
|
+
waiting[id].push(currentCallback);
|
|
2359
|
+
}
|
|
2360
|
+
currentCallback = null;
|
|
2361
|
+
return;
|
|
2362
|
+
}
|
|
2363
|
+
cb = currentCallback;
|
|
2364
|
+
context = currentContext;
|
|
2365
|
+
args = currentArgs;
|
|
2366
|
+
currentCallback = currentContext = currentArgs = null;
|
|
2367
|
+
nextTick(function() {
|
|
2368
|
+
var data;
|
|
2369
|
+
if (hasOwnProperty.call(cache2, id)) {
|
|
2370
|
+
data = cache2[id];
|
|
2371
|
+
conf.emit('getasync', id, args, context);
|
|
2372
|
+
apply.call(cb, data.context, data.args);
|
|
2373
|
+
} else {
|
|
2374
|
+
currentCallback = cb;
|
|
2375
|
+
currentContext = context;
|
|
2376
|
+
currentArgs = args;
|
|
2377
|
+
base.apply(context, args);
|
|
2378
|
+
}
|
|
2379
|
+
});
|
|
2380
|
+
});
|
|
2381
|
+
conf.original = function() {
|
|
2382
|
+
var args, cb, origCb, result;
|
|
2383
|
+
if (!currentCallback) {
|
|
2384
|
+
return apply.call(original, this, arguments);
|
|
2385
|
+
}
|
|
2386
|
+
args = aFrom(arguments);
|
|
2387
|
+
cb = function self2(err2) {
|
|
2388
|
+
var cb2, args2, id = self2.id;
|
|
2389
|
+
if (id == null) {
|
|
2390
|
+
nextTick(apply.bind(self2, this, arguments));
|
|
2391
|
+
return void 0;
|
|
2392
|
+
}
|
|
2393
|
+
delete self2.id;
|
|
2394
|
+
cb2 = waiting[id];
|
|
2395
|
+
delete waiting[id];
|
|
2396
|
+
if (!cb2) {
|
|
2397
|
+
return void 0;
|
|
2398
|
+
}
|
|
2399
|
+
args2 = aFrom(arguments);
|
|
2400
|
+
if (conf.has(id)) {
|
|
2401
|
+
if (err2) {
|
|
2402
|
+
conf['delete'](id);
|
|
2403
|
+
} else {
|
|
2404
|
+
cache2[id] = {
|
|
2405
|
+
context: this,
|
|
2406
|
+
args: args2
|
|
2407
|
+
};
|
|
2408
|
+
conf.emit('setasync', id, typeof cb2 === 'function' ? 1 : cb2.length);
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
if (typeof cb2 === 'function') {
|
|
2412
|
+
result = apply.call(cb2, this, args2);
|
|
2413
|
+
} else {
|
|
2414
|
+
cb2.forEach(function(cb3) {
|
|
2415
|
+
result = apply.call(cb3, this, args2);
|
|
2416
|
+
}, this);
|
|
2417
|
+
}
|
|
2418
|
+
return result;
|
|
2419
|
+
};
|
|
2420
|
+
origCb = currentCallback;
|
|
2421
|
+
currentCallback = currentContext = currentArgs = null;
|
|
2422
|
+
args.push(cb);
|
|
2423
|
+
result = apply.call(original, this, args);
|
|
2424
|
+
cb.cb = origCb;
|
|
2425
|
+
currentCallback = cb;
|
|
2426
|
+
return result;
|
|
2427
|
+
};
|
|
2428
|
+
conf.on('set', function(id) {
|
|
2429
|
+
if (!currentCallback) {
|
|
2430
|
+
conf['delete'](id);
|
|
2431
|
+
return;
|
|
2432
|
+
}
|
|
2433
|
+
if (waiting[id]) {
|
|
2434
|
+
if (typeof waiting[id] === 'function') {
|
|
2435
|
+
waiting[id] = [ waiting[id], currentCallback.cb ];
|
|
2436
|
+
} else {
|
|
2437
|
+
waiting[id].push(currentCallback.cb);
|
|
2438
|
+
}
|
|
2439
|
+
} else {
|
|
2440
|
+
waiting[id] = currentCallback.cb;
|
|
2441
|
+
}
|
|
2442
|
+
delete currentCallback.cb;
|
|
2443
|
+
currentCallback.id = id;
|
|
2444
|
+
currentCallback = null;
|
|
2445
|
+
});
|
|
2446
|
+
conf.on('delete', function(id) {
|
|
2447
|
+
var result;
|
|
2448
|
+
if (hasOwnProperty.call(waiting, id)) {
|
|
2449
|
+
return;
|
|
2450
|
+
}
|
|
2451
|
+
if (!cache2[id]) {
|
|
2452
|
+
return;
|
|
2453
|
+
}
|
|
2454
|
+
result = cache2[id];
|
|
2455
|
+
delete cache2[id];
|
|
2456
|
+
conf.emit('deleteasync', id, slice.call(result.args, 1));
|
|
2457
|
+
});
|
|
2458
|
+
conf.on('clear', function() {
|
|
2459
|
+
var oldCache = cache2;
|
|
2460
|
+
cache2 = create(null);
|
|
2461
|
+
conf.emit('clearasync', objectMap(oldCache, function(data) {
|
|
2462
|
+
return slice.call(data.args, 1);
|
|
2463
|
+
}));
|
|
2464
|
+
});
|
|
2465
|
+
};
|
|
2466
|
+
});
|
|
2467
|
+
var require_primitive_set = __commonJS(function(exports, module) {
|
|
2468
|
+
'use strict';
|
|
2469
|
+
var forEach = Array.prototype.forEach;
|
|
2470
|
+
var create = Object.create;
|
|
2471
|
+
module.exports = function(arg) {
|
|
2472
|
+
var set2 = create(null);
|
|
2473
|
+
forEach.call(arguments, function(name) {
|
|
2474
|
+
set2[name] = true;
|
|
2475
|
+
});
|
|
2476
|
+
return set2;
|
|
2477
|
+
};
|
|
2478
|
+
});
|
|
2479
|
+
var require_is_callable = __commonJS(function(exports, module) {
|
|
2480
|
+
'use strict';
|
|
2481
|
+
module.exports = function(obj) {
|
|
2482
|
+
return typeof obj === 'function';
|
|
2483
|
+
};
|
|
2484
|
+
});
|
|
2485
|
+
var require_validate_stringifiable = __commonJS(function(exports, module) {
|
|
2486
|
+
'use strict';
|
|
2487
|
+
var isCallable = require_is_callable();
|
|
2488
|
+
module.exports = function(stringifiable) {
|
|
2489
|
+
try {
|
|
2490
|
+
if (stringifiable && isCallable(stringifiable.toString)) {
|
|
2491
|
+
return stringifiable.toString();
|
|
2492
|
+
}
|
|
2493
|
+
return String(stringifiable);
|
|
2494
|
+
} catch (e) {
|
|
2495
|
+
throw new TypeError('Passed argument cannot be stringifed');
|
|
2496
|
+
}
|
|
2848
2497
|
};
|
|
2849
2498
|
});
|
|
2850
|
-
var
|
|
2499
|
+
var require_validate_stringifiable_value = __commonJS(function(exports, module) {
|
|
2851
2500
|
'use strict';
|
|
2852
|
-
var
|
|
2853
|
-
var
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
var result = {}, thisArg = arguments[2];
|
|
2857
|
-
callable(cb);
|
|
2858
|
-
forEach(obj, function(value, key, targetObj, index) {
|
|
2859
|
-
result[key] = call.call(cb, thisArg, value, key, targetObj, index);
|
|
2860
|
-
});
|
|
2861
|
-
return result;
|
|
2501
|
+
var ensureValue = require_valid_value();
|
|
2502
|
+
var stringifiable = require_validate_stringifiable();
|
|
2503
|
+
module.exports = function(value) {
|
|
2504
|
+
return stringifiable(ensureValue(value));
|
|
2862
2505
|
};
|
|
2863
2506
|
});
|
|
2864
|
-
var
|
|
2507
|
+
var require_safe_to_string = __commonJS(function(exports, module) {
|
|
2865
2508
|
'use strict';
|
|
2866
|
-
var
|
|
2867
|
-
|
|
2868
|
-
|
|
2509
|
+
var isCallable = require_is_callable();
|
|
2510
|
+
module.exports = function(value) {
|
|
2511
|
+
try {
|
|
2512
|
+
if (value && isCallable(value.toString)) {
|
|
2513
|
+
return value.toString();
|
|
2514
|
+
}
|
|
2515
|
+
return String(value);
|
|
2516
|
+
} catch (e) {
|
|
2517
|
+
return '<Non-coercible to string value>';
|
|
2869
2518
|
}
|
|
2870
|
-
return fn;
|
|
2871
2519
|
};
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2520
|
+
});
|
|
2521
|
+
var require_to_short_string_representation = __commonJS(function(exports, module) {
|
|
2522
|
+
'use strict';
|
|
2523
|
+
var safeToString = require_safe_to_string();
|
|
2524
|
+
var reNewLine = /[\n\r\u2028\u2029]/g;
|
|
2525
|
+
module.exports = function(value) {
|
|
2526
|
+
var string = safeToString(value);
|
|
2527
|
+
if (string.length > 100) {
|
|
2528
|
+
string = string.slice(0, 99) + '\u2026';
|
|
2529
|
+
}
|
|
2530
|
+
string = string.replace(reNewLine, function(_char) {
|
|
2531
|
+
return JSON.stringify(_char).slice(1, -1);
|
|
2532
|
+
});
|
|
2533
|
+
return string;
|
|
2534
|
+
};
|
|
2535
|
+
});
|
|
2536
|
+
var require_is_promise = __commonJS(function(exports, module) {
|
|
2537
|
+
module.exports = isPromise;
|
|
2538
|
+
module.exports['default'] = isPromise;
|
|
2539
|
+
function isPromise(obj) {
|
|
2540
|
+
return !!obj && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
|
|
2541
|
+
}
|
|
2542
|
+
});
|
|
2543
|
+
var require_promise = __commonJS(function() {
|
|
2544
|
+
'use strict';
|
|
2545
|
+
var objectMap = require_map();
|
|
2546
|
+
var primitiveSet = require_primitive_set();
|
|
2547
|
+
var ensureString = require_validate_stringifiable_value();
|
|
2548
|
+
var toShortString = require_to_short_string_representation();
|
|
2549
|
+
var isPromise = require_is_promise();
|
|
2550
|
+
var nextTick = require_next_tick();
|
|
2551
|
+
var create = Object.create;
|
|
2552
|
+
var supportedModes = primitiveSet('then', 'then:finally', 'done', 'done:finally');
|
|
2553
|
+
require_registered_extensions().promise = function(mode, conf) {
|
|
2554
|
+
var waiting = create(null), cache2 = create(null), promises = create(null);
|
|
2555
|
+
if (mode === true) {
|
|
2556
|
+
mode = null;
|
|
2557
|
+
} else {
|
|
2558
|
+
mode = ensureString(mode);
|
|
2559
|
+
if (!supportedModes[mode]) {
|
|
2560
|
+
throw new TypeError('\'' + toShortString(mode) + '\' is not valid promise mode');
|
|
2883
2561
|
}
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2562
|
+
}
|
|
2563
|
+
conf.on('set', function(id, ignore, promise) {
|
|
2564
|
+
var isFailed = false;
|
|
2565
|
+
if (!isPromise(promise)) {
|
|
2566
|
+
cache2[id] = promise;
|
|
2567
|
+
conf.emit('setasync', id, 1);
|
|
2890
2568
|
return;
|
|
2891
2569
|
}
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2570
|
+
waiting[id] = 1;
|
|
2571
|
+
promises[id] = promise;
|
|
2572
|
+
var onSuccess = function onSuccess(result) {
|
|
2573
|
+
var count = waiting[id];
|
|
2574
|
+
if (isFailed) {
|
|
2575
|
+
throw new Error('Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in \'done:finally\' mode)\nConsider to rely on \'then\' or \'done\' mode instead.');
|
|
2897
2576
|
}
|
|
2898
|
-
|
|
2577
|
+
if (!count) {
|
|
2578
|
+
return;
|
|
2579
|
+
}
|
|
2580
|
+
delete waiting[id];
|
|
2581
|
+
cache2[id] = result;
|
|
2582
|
+
conf.emit('setasync', id, count);
|
|
2583
|
+
};
|
|
2584
|
+
var onFailure = function onFailure() {
|
|
2585
|
+
isFailed = true;
|
|
2586
|
+
if (!waiting[id]) {
|
|
2587
|
+
return;
|
|
2588
|
+
}
|
|
2589
|
+
delete waiting[id];
|
|
2590
|
+
delete promises[id];
|
|
2591
|
+
conf['delete'](id);
|
|
2592
|
+
};
|
|
2593
|
+
var resolvedMode = mode;
|
|
2594
|
+
if (!resolvedMode) {
|
|
2595
|
+
resolvedMode = 'then';
|
|
2899
2596
|
}
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2597
|
+
if (resolvedMode === 'then') {
|
|
2598
|
+
var nextTickFailure = function nextTickFailure() {
|
|
2599
|
+
nextTick(onFailure);
|
|
2600
|
+
};
|
|
2601
|
+
promise = promise.then(function(result) {
|
|
2602
|
+
nextTick(onSuccess.bind(this, result));
|
|
2603
|
+
}, nextTickFailure);
|
|
2604
|
+
if (typeof promise['finally'] === 'function') {
|
|
2605
|
+
promise['finally'](nextTickFailure);
|
|
2606
|
+
}
|
|
2607
|
+
} else if (resolvedMode === 'done') {
|
|
2608
|
+
if (typeof promise.done !== 'function') {
|
|
2609
|
+
throw new Error('Memoizee error: Retrieved promise does not implement \'done\' in \'done\' mode');
|
|
2610
|
+
}
|
|
2611
|
+
promise.done(onSuccess, onFailure);
|
|
2612
|
+
} else if (resolvedMode === 'done:finally') {
|
|
2613
|
+
if (typeof promise.done !== 'function') {
|
|
2614
|
+
throw new Error('Memoizee error: Retrieved promise does not implement \'done\' in \'done:finally\' mode');
|
|
2615
|
+
}
|
|
2616
|
+
if (typeof promise['finally'] !== 'function') {
|
|
2617
|
+
throw new Error('Memoizee error: Retrieved promise does not implement \'finally\' in \'done:finally\' mode');
|
|
2910
2618
|
}
|
|
2619
|
+
promise.done(onSuccess);
|
|
2620
|
+
promise['finally'](onFailure);
|
|
2621
|
+
}
|
|
2622
|
+
});
|
|
2623
|
+
conf.on('get', function(id, args, context) {
|
|
2624
|
+
var promise;
|
|
2625
|
+
if (waiting[id]) {
|
|
2626
|
+
++waiting[id];
|
|
2911
2627
|
return;
|
|
2912
2628
|
}
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
};
|
|
2917
|
-
module.exports = function() {
|
|
2918
|
-
if ((typeof process === 'undefined' ? 'undefined' : _typeof(process)) === 'object' && process && typeof process.nextTick === 'function') {
|
|
2919
|
-
return process.nextTick;
|
|
2920
|
-
}
|
|
2921
|
-
if (typeof queueMicrotask === 'function') {
|
|
2922
|
-
return function(cb) {
|
|
2923
|
-
queueMicrotask(ensureCallable(cb));
|
|
2629
|
+
promise = promises[id];
|
|
2630
|
+
var emit = function emit() {
|
|
2631
|
+
conf.emit('getasync', id, args, context);
|
|
2924
2632
|
};
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2633
|
+
if (isPromise(promise)) {
|
|
2634
|
+
if (typeof promise.done === 'function') {
|
|
2635
|
+
promise.done(emit);
|
|
2636
|
+
} else {
|
|
2637
|
+
promise.then(function() {
|
|
2638
|
+
nextTick(emit);
|
|
2639
|
+
});
|
|
2640
|
+
}
|
|
2641
|
+
} else {
|
|
2642
|
+
emit();
|
|
2929
2643
|
}
|
|
2930
|
-
|
|
2931
|
-
|
|
2644
|
+
});
|
|
2645
|
+
conf.on('delete', function(id) {
|
|
2646
|
+
delete promises[id];
|
|
2647
|
+
if (waiting[id]) {
|
|
2648
|
+
delete waiting[id];
|
|
2649
|
+
return;
|
|
2932
2650
|
}
|
|
2651
|
+
if (!hasOwnProperty.call(cache2, id)) {
|
|
2652
|
+
return;
|
|
2653
|
+
}
|
|
2654
|
+
var result = cache2[id];
|
|
2655
|
+
delete cache2[id];
|
|
2656
|
+
conf.emit('deleteasync', id, [ result ]);
|
|
2657
|
+
});
|
|
2658
|
+
conf.on('clear', function() {
|
|
2659
|
+
var oldCache = cache2;
|
|
2660
|
+
cache2 = create(null);
|
|
2661
|
+
waiting = create(null);
|
|
2662
|
+
promises = create(null);
|
|
2663
|
+
conf.emit('clearasync', objectMap(oldCache, function(data) {
|
|
2664
|
+
return [ data ];
|
|
2665
|
+
}));
|
|
2666
|
+
});
|
|
2667
|
+
};
|
|
2668
|
+
});
|
|
2669
|
+
var require_dispose = __commonJS(function() {
|
|
2670
|
+
'use strict';
|
|
2671
|
+
var callable = require_valid_callable();
|
|
2672
|
+
var forEach = require_for_each();
|
|
2673
|
+
var extensions = require_registered_extensions();
|
|
2674
|
+
var apply = Function.prototype.apply;
|
|
2675
|
+
extensions.dispose = function(dispose, conf, options) {
|
|
2676
|
+
var del;
|
|
2677
|
+
callable(dispose);
|
|
2678
|
+
if (options.async && extensions.async || options.promise && extensions.promise) {
|
|
2679
|
+
conf.on('deleteasync', del = function del(id, resultArray) {
|
|
2680
|
+
apply.call(dispose, null, resultArray);
|
|
2681
|
+
});
|
|
2682
|
+
conf.on('clearasync', function(cache2) {
|
|
2683
|
+
forEach(cache2, function(result, id) {
|
|
2684
|
+
del(id, result);
|
|
2685
|
+
});
|
|
2686
|
+
});
|
|
2687
|
+
return;
|
|
2933
2688
|
}
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2689
|
+
conf.on('delete', del = function del(id, result) {
|
|
2690
|
+
dispose(result);
|
|
2691
|
+
});
|
|
2692
|
+
conf.on('clear', function(cache2) {
|
|
2693
|
+
forEach(cache2, function(result, id) {
|
|
2694
|
+
del(id, result);
|
|
2695
|
+
});
|
|
2696
|
+
});
|
|
2697
|
+
};
|
|
2698
|
+
});
|
|
2699
|
+
var require_max_timeout = __commonJS(function(exports, module) {
|
|
2700
|
+
'use strict';
|
|
2701
|
+
module.exports = 2147483647;
|
|
2702
|
+
});
|
|
2703
|
+
var require_valid_timeout = __commonJS(function(exports, module) {
|
|
2704
|
+
'use strict';
|
|
2705
|
+
var toPosInt = require_to_pos_integer();
|
|
2706
|
+
var maxTimeout = require_max_timeout();
|
|
2707
|
+
module.exports = function(value) {
|
|
2708
|
+
value = toPosInt(value);
|
|
2709
|
+
if (value > maxTimeout) {
|
|
2710
|
+
throw new TypeError(value + ' exceeds maximum possible timeout');
|
|
2943
2711
|
}
|
|
2944
|
-
return
|
|
2945
|
-
}
|
|
2712
|
+
return value;
|
|
2713
|
+
};
|
|
2946
2714
|
});
|
|
2947
|
-
var
|
|
2715
|
+
var require_max_age = __commonJS(function() {
|
|
2948
2716
|
'use strict';
|
|
2949
2717
|
var aFrom = require_from();
|
|
2950
|
-
var
|
|
2951
|
-
var mixin = require_mixin();
|
|
2952
|
-
var defineLength = require_define_length();
|
|
2718
|
+
var forEach = require_for_each();
|
|
2953
2719
|
var nextTick = require_next_tick();
|
|
2954
|
-
var
|
|
2955
|
-
var
|
|
2720
|
+
var isPromise = require_is_promise();
|
|
2721
|
+
var timeout = require_valid_timeout();
|
|
2722
|
+
var extensions = require_registered_extensions();
|
|
2723
|
+
var noop3 = Function.prototype;
|
|
2724
|
+
var max2 = Math.max;
|
|
2725
|
+
var min = Math.min;
|
|
2956
2726
|
var create = Object.create;
|
|
2957
|
-
|
|
2958
|
-
var
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2727
|
+
extensions.maxAge = function(maxAge, conf, options) {
|
|
2728
|
+
var timeouts, postfix, preFetchAge, preFetchTimeouts;
|
|
2729
|
+
maxAge = timeout(maxAge);
|
|
2730
|
+
if (!maxAge) {
|
|
2731
|
+
return;
|
|
2732
|
+
}
|
|
2733
|
+
timeouts = create(null);
|
|
2734
|
+
postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
|
|
2735
|
+
conf.on('set' + postfix, function(id) {
|
|
2736
|
+
timeouts[id] = setTimeout(function() {
|
|
2737
|
+
conf['delete'](id);
|
|
2738
|
+
}, maxAge);
|
|
2739
|
+
if (typeof timeouts[id].unref === 'function') {
|
|
2740
|
+
timeouts[id].unref();
|
|
2964
2741
|
}
|
|
2965
|
-
|
|
2966
|
-
}, base);
|
|
2967
|
-
try {
|
|
2968
|
-
mixin(conf.memoized, base);
|
|
2969
|
-
} catch (ignore) {}
|
|
2970
|
-
conf.on('get', function(id) {
|
|
2971
|
-
var cb, context, args;
|
|
2972
|
-
if (!currentCallback) {
|
|
2742
|
+
if (!preFetchTimeouts) {
|
|
2973
2743
|
return;
|
|
2974
2744
|
}
|
|
2975
|
-
if (
|
|
2976
|
-
if (
|
|
2977
|
-
|
|
2978
|
-
} else {
|
|
2979
|
-
waiting[id].push(currentCallback);
|
|
2745
|
+
if (preFetchTimeouts[id]) {
|
|
2746
|
+
if (preFetchTimeouts[id] !== 'nextTick') {
|
|
2747
|
+
clearTimeout(preFetchTimeouts[id]);
|
|
2980
2748
|
}
|
|
2981
|
-
|
|
2749
|
+
}
|
|
2750
|
+
preFetchTimeouts[id] = setTimeout(function() {
|
|
2751
|
+
delete preFetchTimeouts[id];
|
|
2752
|
+
}, preFetchAge);
|
|
2753
|
+
if (typeof preFetchTimeouts[id].unref === 'function') {
|
|
2754
|
+
preFetchTimeouts[id].unref();
|
|
2755
|
+
}
|
|
2756
|
+
});
|
|
2757
|
+
conf.on('delete' + postfix, function(id) {
|
|
2758
|
+
clearTimeout(timeouts[id]);
|
|
2759
|
+
delete timeouts[id];
|
|
2760
|
+
if (!preFetchTimeouts) {
|
|
2982
2761
|
return;
|
|
2983
2762
|
}
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
nextTick(function() {
|
|
2989
|
-
var data2;
|
|
2990
|
-
if (hasOwnProperty.call(cache2, id)) {
|
|
2991
|
-
data2 = cache2[id];
|
|
2992
|
-
conf.emit('getasync', id, args, context);
|
|
2993
|
-
apply.call(cb, data2.context, data2.args);
|
|
2994
|
-
} else {
|
|
2995
|
-
currentCallback = cb;
|
|
2996
|
-
currentContext = context;
|
|
2997
|
-
currentArgs = args;
|
|
2998
|
-
base.apply(context, args);
|
|
2999
|
-
}
|
|
3000
|
-
});
|
|
2763
|
+
if (preFetchTimeouts[id] !== 'nextTick') {
|
|
2764
|
+
clearTimeout(preFetchTimeouts[id]);
|
|
2765
|
+
}
|
|
2766
|
+
delete preFetchTimeouts[id];
|
|
3001
2767
|
});
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
2768
|
+
if (options.preFetch) {
|
|
2769
|
+
if (options.preFetch === true || isNaN(options.preFetch)) {
|
|
2770
|
+
preFetchAge = .333;
|
|
2771
|
+
} else {
|
|
2772
|
+
preFetchAge = max2(min(Number(options.preFetch), 1), 0);
|
|
3006
2773
|
}
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
2774
|
+
if (preFetchAge) {
|
|
2775
|
+
preFetchTimeouts = {};
|
|
2776
|
+
preFetchAge = (1 - preFetchAge) * maxAge;
|
|
2777
|
+
conf.on('get' + postfix, function(id, args, context) {
|
|
2778
|
+
if (!preFetchTimeouts[id]) {
|
|
2779
|
+
preFetchTimeouts[id] = 'nextTick';
|
|
2780
|
+
nextTick(function() {
|
|
2781
|
+
var result;
|
|
2782
|
+
if (preFetchTimeouts[id] !== 'nextTick') {
|
|
2783
|
+
return;
|
|
2784
|
+
}
|
|
2785
|
+
delete preFetchTimeouts[id];
|
|
2786
|
+
conf['delete'](id);
|
|
2787
|
+
if (options.async) {
|
|
2788
|
+
args = aFrom(args);
|
|
2789
|
+
args.push(noop3);
|
|
2790
|
+
}
|
|
2791
|
+
result = conf.memoized.apply(context, args);
|
|
2792
|
+
if (options.promise) {
|
|
2793
|
+
if (isPromise(result)) {
|
|
2794
|
+
if (typeof result.done === 'function') {
|
|
2795
|
+
result.done(noop3, noop3);
|
|
2796
|
+
} else {
|
|
2797
|
+
result.then(noop3, noop3);
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
});
|
|
2802
|
+
}
|
|
2803
|
+
});
|
|
2804
|
+
}
|
|
2805
|
+
}
|
|
2806
|
+
conf.on('clear' + postfix, function() {
|
|
2807
|
+
forEach(timeouts, function(id) {
|
|
2808
|
+
clearTimeout(id);
|
|
2809
|
+
});
|
|
2810
|
+
timeouts = {};
|
|
2811
|
+
if (preFetchTimeouts) {
|
|
2812
|
+
forEach(preFetchTimeouts, function(id) {
|
|
2813
|
+
if (id !== 'nextTick') {
|
|
2814
|
+
clearTimeout(id);
|
|
3030
2815
|
}
|
|
2816
|
+
});
|
|
2817
|
+
preFetchTimeouts = {};
|
|
2818
|
+
}
|
|
2819
|
+
});
|
|
2820
|
+
};
|
|
2821
|
+
});
|
|
2822
|
+
var require_lru_queue = __commonJS(function(exports, module) {
|
|
2823
|
+
'use strict';
|
|
2824
|
+
var toPosInt = require_to_pos_integer();
|
|
2825
|
+
var create = Object.create;
|
|
2826
|
+
var hasOwnProperty2 = Object.prototype.hasOwnProperty;
|
|
2827
|
+
module.exports = function(limit) {
|
|
2828
|
+
var size = 0, base = 1, queue2 = create(null), map = create(null), index = 0, del;
|
|
2829
|
+
limit = toPosInt(limit);
|
|
2830
|
+
return {
|
|
2831
|
+
hit: function hit(id) {
|
|
2832
|
+
var oldIndex = map[id], nuIndex = ++index;
|
|
2833
|
+
queue2[nuIndex] = id;
|
|
2834
|
+
map[id] = nuIndex;
|
|
2835
|
+
if (!oldIndex) {
|
|
2836
|
+
++size;
|
|
2837
|
+
if (size <= limit) {
|
|
2838
|
+
return;
|
|
2839
|
+
}
|
|
2840
|
+
id = queue2[base];
|
|
2841
|
+
del(id);
|
|
2842
|
+
return id;
|
|
3031
2843
|
}
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
cb2.forEach(function(cb3) {
|
|
3036
|
-
result = apply.call(cb3, this, args2);
|
|
3037
|
-
}, this);
|
|
2844
|
+
delete queue2[oldIndex];
|
|
2845
|
+
if (base !== oldIndex) {
|
|
2846
|
+
return;
|
|
3038
2847
|
}
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
return result;
|
|
3048
|
-
};
|
|
3049
|
-
conf.on('set', function(id) {
|
|
3050
|
-
if (!currentCallback) {
|
|
3051
|
-
conf['delete'](id);
|
|
3052
|
-
return;
|
|
3053
|
-
}
|
|
3054
|
-
if (waiting[id]) {
|
|
3055
|
-
if (typeof waiting[id] === 'function') {
|
|
3056
|
-
waiting[id] = [ waiting[id], currentCallback.cb ];
|
|
3057
|
-
} else {
|
|
3058
|
-
waiting[id].push(currentCallback.cb);
|
|
2848
|
+
while (!hasOwnProperty2.call(queue2, ++base)) {
|
|
2849
|
+
continue;
|
|
2850
|
+
}
|
|
2851
|
+
},
|
|
2852
|
+
delete: del = function del(id) {
|
|
2853
|
+
var oldIndex = map[id];
|
|
2854
|
+
if (!oldIndex) {
|
|
2855
|
+
return;
|
|
3059
2856
|
}
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
2857
|
+
delete queue2[oldIndex];
|
|
2858
|
+
delete map[id];
|
|
2859
|
+
--size;
|
|
2860
|
+
if (base !== oldIndex) {
|
|
2861
|
+
return;
|
|
2862
|
+
}
|
|
2863
|
+
if (!size) {
|
|
2864
|
+
index = 0;
|
|
2865
|
+
base = 1;
|
|
2866
|
+
return;
|
|
2867
|
+
}
|
|
2868
|
+
while (!hasOwnProperty2.call(queue2, ++base)) {
|
|
2869
|
+
continue;
|
|
2870
|
+
}
|
|
2871
|
+
},
|
|
2872
|
+
clear: function clear() {
|
|
2873
|
+
size = 0;
|
|
2874
|
+
base = 1;
|
|
2875
|
+
queue2 = create(null);
|
|
2876
|
+
map = create(null);
|
|
2877
|
+
index = 0;
|
|
3071
2878
|
}
|
|
3072
|
-
|
|
2879
|
+
};
|
|
2880
|
+
};
|
|
2881
|
+
});
|
|
2882
|
+
var require_max = __commonJS(function() {
|
|
2883
|
+
'use strict';
|
|
2884
|
+
var toPosInteger = require_to_pos_integer();
|
|
2885
|
+
var lruQueue = require_lru_queue();
|
|
2886
|
+
var extensions = require_registered_extensions();
|
|
2887
|
+
extensions.max = function(max2, conf, options) {
|
|
2888
|
+
var postfix, queue2, hit;
|
|
2889
|
+
max2 = toPosInteger(max2);
|
|
2890
|
+
if (!max2) {
|
|
2891
|
+
return;
|
|
2892
|
+
}
|
|
2893
|
+
queue2 = lruQueue(max2);
|
|
2894
|
+
postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
|
|
2895
|
+
conf.on('set' + postfix, hit = function hit(id) {
|
|
2896
|
+
id = queue2.hit(id);
|
|
2897
|
+
if (id === void 0) {
|
|
3073
2898
|
return;
|
|
3074
2899
|
}
|
|
3075
|
-
|
|
3076
|
-
delete cache2[id];
|
|
3077
|
-
conf.emit('deleteasync', id, slice.call(result.args, 1));
|
|
3078
|
-
});
|
|
3079
|
-
conf.on('clear', function() {
|
|
3080
|
-
var oldCache = cache2;
|
|
3081
|
-
cache2 = create(null);
|
|
3082
|
-
conf.emit('clearasync', objectMap(oldCache, function(data2) {
|
|
3083
|
-
return slice.call(data2.args, 1);
|
|
3084
|
-
}));
|
|
2900
|
+
conf['delete'](id);
|
|
3085
2901
|
});
|
|
2902
|
+
conf.on('get' + postfix, hit);
|
|
2903
|
+
conf.on('delete' + postfix, queue2['delete']);
|
|
2904
|
+
conf.on('clear' + postfix, queue2.clear);
|
|
3086
2905
|
};
|
|
3087
2906
|
});
|
|
3088
|
-
var
|
|
2907
|
+
var require_ref_counter = __commonJS(function() {
|
|
3089
2908
|
'use strict';
|
|
3090
|
-
var
|
|
2909
|
+
var d2 = require_d();
|
|
2910
|
+
var extensions = require_registered_extensions();
|
|
3091
2911
|
var create = Object.create;
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
2912
|
+
var defineProperties = Object.defineProperties;
|
|
2913
|
+
extensions.refCounter = function(ignore, conf, options) {
|
|
2914
|
+
var cache2, postfix;
|
|
2915
|
+
cache2 = create(null);
|
|
2916
|
+
postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
|
|
2917
|
+
conf.on('set' + postfix, function(id, length) {
|
|
2918
|
+
cache2[id] = length || 1;
|
|
2919
|
+
});
|
|
2920
|
+
conf.on('get' + postfix, function(id) {
|
|
2921
|
+
++cache2[id];
|
|
2922
|
+
});
|
|
2923
|
+
conf.on('delete' + postfix, function(id) {
|
|
2924
|
+
delete cache2[id];
|
|
2925
|
+
});
|
|
2926
|
+
conf.on('clear' + postfix, function() {
|
|
2927
|
+
cache2 = {};
|
|
2928
|
+
});
|
|
2929
|
+
defineProperties(conf.memoized, {
|
|
2930
|
+
deleteRef: d2(function() {
|
|
2931
|
+
var id = conf.get(arguments);
|
|
2932
|
+
if (id === null) {
|
|
2933
|
+
return null;
|
|
2934
|
+
}
|
|
2935
|
+
if (!cache2[id]) {
|
|
2936
|
+
return null;
|
|
2937
|
+
}
|
|
2938
|
+
if (!--cache2[id]) {
|
|
2939
|
+
conf['delete'](id);
|
|
2940
|
+
return true;
|
|
2941
|
+
}
|
|
2942
|
+
return false;
|
|
2943
|
+
}),
|
|
2944
|
+
getRefCount: d2(function() {
|
|
2945
|
+
var id = conf.get(arguments);
|
|
2946
|
+
if (id === null) {
|
|
2947
|
+
return 0;
|
|
2948
|
+
}
|
|
2949
|
+
if (!cache2[id]) {
|
|
2950
|
+
return 0;
|
|
2951
|
+
}
|
|
2952
|
+
return cache2[id];
|
|
2953
|
+
})
|
|
3096
2954
|
});
|
|
3097
|
-
return set2;
|
|
3098
2955
|
};
|
|
3099
2956
|
});
|
|
3100
|
-
var
|
|
2957
|
+
var require_memoizee = __commonJS(function(exports, module) {
|
|
3101
2958
|
'use strict';
|
|
3102
|
-
|
|
3103
|
-
|
|
2959
|
+
var normalizeOpts = require_normalize_options();
|
|
2960
|
+
var resolveLength = require_resolve_length();
|
|
2961
|
+
var plain = require_plain();
|
|
2962
|
+
module.exports = function(fn) {
|
|
2963
|
+
var options = normalizeOpts(arguments[1]), length;
|
|
2964
|
+
if (!options.normalizer) {
|
|
2965
|
+
length = options.length = resolveLength(options.length, fn.length, options.async);
|
|
2966
|
+
if (length !== 0) {
|
|
2967
|
+
if (options.primitive) {
|
|
2968
|
+
if (length === false) {
|
|
2969
|
+
options.normalizer = require_primitive();
|
|
2970
|
+
} else if (length > 1) {
|
|
2971
|
+
options.normalizer = require_get_primitive_fixed()(length);
|
|
2972
|
+
}
|
|
2973
|
+
} else if (length === false) {
|
|
2974
|
+
options.normalizer = require_get()();
|
|
2975
|
+
} else if (length === 1) {
|
|
2976
|
+
options.normalizer = require_get_1()();
|
|
2977
|
+
} else {
|
|
2978
|
+
options.normalizer = require_get_fixed()(length);
|
|
2979
|
+
}
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
if (options.async) {
|
|
2983
|
+
require_async();
|
|
2984
|
+
}
|
|
2985
|
+
if (options.promise) {
|
|
2986
|
+
require_promise();
|
|
2987
|
+
}
|
|
2988
|
+
if (options.dispose) {
|
|
2989
|
+
require_dispose();
|
|
2990
|
+
}
|
|
2991
|
+
if (options.maxAge) {
|
|
2992
|
+
require_max_age();
|
|
2993
|
+
}
|
|
2994
|
+
if (options.max) {
|
|
2995
|
+
require_max();
|
|
2996
|
+
}
|
|
2997
|
+
if (options.refCounter) {
|
|
2998
|
+
require_ref_counter();
|
|
2999
|
+
}
|
|
3000
|
+
return plain(fn, options);
|
|
3104
3001
|
};
|
|
3105
3002
|
});
|
|
3106
|
-
var
|
|
3003
|
+
var require_utils = __commonJS(function(exports) {
|
|
3107
3004
|
'use strict';
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3005
|
+
Object.defineProperty(exports, '__esModule', {
|
|
3006
|
+
value: true
|
|
3007
|
+
});
|
|
3008
|
+
function isIdentStart(c4) {
|
|
3009
|
+
return c4 >= 'a' && c4 <= 'z' || c4 >= 'A' && c4 <= 'Z' || c4 === '-' || c4 === '_';
|
|
3010
|
+
}
|
|
3011
|
+
exports.isIdentStart = isIdentStart;
|
|
3012
|
+
function isIdent(c4) {
|
|
3013
|
+
return c4 >= 'a' && c4 <= 'z' || c4 >= 'A' && c4 <= 'Z' || c4 >= '0' && c4 <= '9' || c4 === '-' || c4 === '_';
|
|
3014
|
+
}
|
|
3015
|
+
exports.isIdent = isIdent;
|
|
3016
|
+
function isHex(c4) {
|
|
3017
|
+
return c4 >= 'a' && c4 <= 'f' || c4 >= 'A' && c4 <= 'F' || c4 >= '0' && c4 <= '9';
|
|
3018
|
+
}
|
|
3019
|
+
exports.isHex = isHex;
|
|
3020
|
+
function escapeIdentifier(s) {
|
|
3021
|
+
var len = s.length;
|
|
3022
|
+
var result = '';
|
|
3023
|
+
var i = 0;
|
|
3024
|
+
while (i < len) {
|
|
3025
|
+
var chr = s.charAt(i);
|
|
3026
|
+
if (exports.identSpecialChars[chr]) {
|
|
3027
|
+
result += '\\' + chr;
|
|
3028
|
+
} else {
|
|
3029
|
+
if (!(chr === '_' || chr === '-' || chr >= 'A' && chr <= 'Z' || chr >= 'a' && chr <= 'z' || i !== 0 && chr >= '0' && chr <= '9')) {
|
|
3030
|
+
var charCode = chr.charCodeAt(0);
|
|
3031
|
+
if ((charCode & 63488) === 55296) {
|
|
3032
|
+
var extraCharCode = s.charCodeAt(i++);
|
|
3033
|
+
if ((charCode & 64512) !== 55296 || (extraCharCode & 64512) !== 56320) {
|
|
3034
|
+
throw Error('UCS-2(decode): illegal sequence');
|
|
3035
|
+
}
|
|
3036
|
+
charCode = ((charCode & 1023) << 10) + (extraCharCode & 1023) + 65536;
|
|
3037
|
+
}
|
|
3038
|
+
result += '\\' + charCode.toString(16) + ' ';
|
|
3039
|
+
} else {
|
|
3040
|
+
result += chr;
|
|
3041
|
+
}
|
|
3113
3042
|
}
|
|
3114
|
-
|
|
3115
|
-
}
|
|
3116
|
-
|
|
3043
|
+
i++;
|
|
3044
|
+
}
|
|
3045
|
+
return result;
|
|
3046
|
+
}
|
|
3047
|
+
exports.escapeIdentifier = escapeIdentifier;
|
|
3048
|
+
function escapeStr(s) {
|
|
3049
|
+
var len = s.length;
|
|
3050
|
+
var result = '';
|
|
3051
|
+
var i = 0;
|
|
3052
|
+
var replacement;
|
|
3053
|
+
while (i < len) {
|
|
3054
|
+
var chr = s.charAt(i);
|
|
3055
|
+
if (chr === '"') {
|
|
3056
|
+
chr = '\\"';
|
|
3057
|
+
} else if (chr === '\\') {
|
|
3058
|
+
chr = '\\\\';
|
|
3059
|
+
} else if ((replacement = exports.strReplacementsRev[chr]) !== void 0) {
|
|
3060
|
+
chr = replacement;
|
|
3061
|
+
}
|
|
3062
|
+
result += chr;
|
|
3063
|
+
i++;
|
|
3117
3064
|
}
|
|
3065
|
+
return '"' + result + '"';
|
|
3066
|
+
}
|
|
3067
|
+
exports.escapeStr = escapeStr;
|
|
3068
|
+
exports.identSpecialChars = {
|
|
3069
|
+
'!': true,
|
|
3070
|
+
'"': true,
|
|
3071
|
+
'#': true,
|
|
3072
|
+
$: true,
|
|
3073
|
+
'%': true,
|
|
3074
|
+
'&': true,
|
|
3075
|
+
'\'': true,
|
|
3076
|
+
'(': true,
|
|
3077
|
+
')': true,
|
|
3078
|
+
'*': true,
|
|
3079
|
+
'+': true,
|
|
3080
|
+
',': true,
|
|
3081
|
+
'.': true,
|
|
3082
|
+
'/': true,
|
|
3083
|
+
';': true,
|
|
3084
|
+
'<': true,
|
|
3085
|
+
'=': true,
|
|
3086
|
+
'>': true,
|
|
3087
|
+
'?': true,
|
|
3088
|
+
'@': true,
|
|
3089
|
+
'[': true,
|
|
3090
|
+
'\\': true,
|
|
3091
|
+
']': true,
|
|
3092
|
+
'^': true,
|
|
3093
|
+
'`': true,
|
|
3094
|
+
'{': true,
|
|
3095
|
+
'|': true,
|
|
3096
|
+
'}': true,
|
|
3097
|
+
'~': true
|
|
3118
3098
|
};
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
return stringifiable(ensureValue(value));
|
|
3099
|
+
exports.strReplacementsRev = {
|
|
3100
|
+
'\n': '\\n',
|
|
3101
|
+
'\r': '\\r',
|
|
3102
|
+
'\t': '\\t',
|
|
3103
|
+
'\f': '\\f',
|
|
3104
|
+
'\v': '\\v'
|
|
3126
3105
|
};
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
return value.toString();
|
|
3135
|
-
}
|
|
3136
|
-
return String(value);
|
|
3137
|
-
} catch (e) {
|
|
3138
|
-
return '<Non-coercible to string value>';
|
|
3139
|
-
}
|
|
3106
|
+
exports.singleQuoteEscapeChars = {
|
|
3107
|
+
n: '\n',
|
|
3108
|
+
r: '\r',
|
|
3109
|
+
t: '\t',
|
|
3110
|
+
f: '\f',
|
|
3111
|
+
'\\': '\\',
|
|
3112
|
+
'\'': '\''
|
|
3140
3113
|
};
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
if (string.length > 100) {
|
|
3149
|
-
string = string.slice(0, 99) + '\u2026';
|
|
3150
|
-
}
|
|
3151
|
-
string = string.replace(reNewLine, function(_char) {
|
|
3152
|
-
return JSON.stringify(_char).slice(1, -1);
|
|
3153
|
-
});
|
|
3154
|
-
return string;
|
|
3114
|
+
exports.doubleQuotesEscapeChars = {
|
|
3115
|
+
n: '\n',
|
|
3116
|
+
r: '\r',
|
|
3117
|
+
t: '\t',
|
|
3118
|
+
f: '\f',
|
|
3119
|
+
'\\': '\\',
|
|
3120
|
+
'"': '"'
|
|
3155
3121
|
};
|
|
3156
3122
|
});
|
|
3157
|
-
var
|
|
3158
|
-
module.exports = isPromise;
|
|
3159
|
-
module.exports['default'] = isPromise;
|
|
3160
|
-
function isPromise(obj) {
|
|
3161
|
-
return !!obj && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
|
|
3162
|
-
}
|
|
3163
|
-
});
|
|
3164
|
-
var require_promise = __commonJS(function() {
|
|
3123
|
+
var require_parser_context = __commonJS(function(exports) {
|
|
3165
3124
|
'use strict';
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
var
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
}
|
|
3210
|
-
delete waiting[id];
|
|
3211
|
-
delete promises[id];
|
|
3212
|
-
conf['delete'](id);
|
|
3213
|
-
};
|
|
3214
|
-
var resolvedMode = mode;
|
|
3215
|
-
if (!resolvedMode) {
|
|
3216
|
-
resolvedMode = 'then';
|
|
3217
|
-
}
|
|
3218
|
-
if (resolvedMode === 'then') {
|
|
3219
|
-
var nextTickFailure = function nextTickFailure() {
|
|
3220
|
-
nextTick(onFailure);
|
|
3221
|
-
};
|
|
3222
|
-
promise = promise.then(function(result) {
|
|
3223
|
-
nextTick(onSuccess.bind(this, result));
|
|
3224
|
-
}, nextTickFailure);
|
|
3225
|
-
if (typeof promise['finally'] === 'function') {
|
|
3226
|
-
promise['finally'](nextTickFailure);
|
|
3227
|
-
}
|
|
3228
|
-
} else if (resolvedMode === 'done') {
|
|
3229
|
-
if (typeof promise.done !== 'function') {
|
|
3230
|
-
throw new Error('Memoizee error: Retrieved promise does not implement \'done\' in \'done\' mode');
|
|
3231
|
-
}
|
|
3232
|
-
promise.done(onSuccess, onFailure);
|
|
3233
|
-
} else if (resolvedMode === 'done:finally') {
|
|
3234
|
-
if (typeof promise.done !== 'function') {
|
|
3235
|
-
throw new Error('Memoizee error: Retrieved promise does not implement \'done\' in \'done:finally\' mode');
|
|
3236
|
-
}
|
|
3237
|
-
if (typeof promise['finally'] !== 'function') {
|
|
3238
|
-
throw new Error('Memoizee error: Retrieved promise does not implement \'finally\' in \'done:finally\' mode');
|
|
3125
|
+
Object.defineProperty(exports, '__esModule', {
|
|
3126
|
+
value: true
|
|
3127
|
+
});
|
|
3128
|
+
var utils_1 = require_utils();
|
|
3129
|
+
function parseCssSelector(str, pos, pseudos, attrEqualityMods, ruleNestingOperators, substitutesEnabled) {
|
|
3130
|
+
var l = str.length;
|
|
3131
|
+
var chr = '';
|
|
3132
|
+
function getStr(quote, escapeTable) {
|
|
3133
|
+
var result = '';
|
|
3134
|
+
pos++;
|
|
3135
|
+
chr = str.charAt(pos);
|
|
3136
|
+
while (pos < l) {
|
|
3137
|
+
if (chr === quote) {
|
|
3138
|
+
pos++;
|
|
3139
|
+
return result;
|
|
3140
|
+
} else if (chr === '\\') {
|
|
3141
|
+
pos++;
|
|
3142
|
+
chr = str.charAt(pos);
|
|
3143
|
+
var esc = void 0;
|
|
3144
|
+
if (chr === quote) {
|
|
3145
|
+
result += quote;
|
|
3146
|
+
} else if ((esc = escapeTable[chr]) !== void 0) {
|
|
3147
|
+
result += esc;
|
|
3148
|
+
} else if (utils_1.isHex(chr)) {
|
|
3149
|
+
var hex = chr;
|
|
3150
|
+
pos++;
|
|
3151
|
+
chr = str.charAt(pos);
|
|
3152
|
+
while (utils_1.isHex(chr)) {
|
|
3153
|
+
hex += chr;
|
|
3154
|
+
pos++;
|
|
3155
|
+
chr = str.charAt(pos);
|
|
3156
|
+
}
|
|
3157
|
+
if (chr === ' ') {
|
|
3158
|
+
pos++;
|
|
3159
|
+
chr = str.charAt(pos);
|
|
3160
|
+
}
|
|
3161
|
+
result += String.fromCharCode(parseInt(hex, 16));
|
|
3162
|
+
continue;
|
|
3163
|
+
} else {
|
|
3164
|
+
result += chr;
|
|
3165
|
+
}
|
|
3166
|
+
} else {
|
|
3167
|
+
result += chr;
|
|
3239
3168
|
}
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
}
|
|
3243
|
-
});
|
|
3244
|
-
conf.on('get', function(id, args, context) {
|
|
3245
|
-
var promise;
|
|
3246
|
-
if (waiting[id]) {
|
|
3247
|
-
++waiting[id];
|
|
3248
|
-
return;
|
|
3169
|
+
pos++;
|
|
3170
|
+
chr = str.charAt(pos);
|
|
3249
3171
|
}
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3172
|
+
return result;
|
|
3173
|
+
}
|
|
3174
|
+
function getIdent() {
|
|
3175
|
+
var result = '';
|
|
3176
|
+
chr = str.charAt(pos);
|
|
3177
|
+
while (pos < l) {
|
|
3178
|
+
if (utils_1.isIdent(chr)) {
|
|
3179
|
+
result += chr;
|
|
3180
|
+
} else if (chr === '\\') {
|
|
3181
|
+
pos++;
|
|
3182
|
+
if (pos >= l) {
|
|
3183
|
+
throw Error('Expected symbol but end of file reached.');
|
|
3184
|
+
}
|
|
3185
|
+
chr = str.charAt(pos);
|
|
3186
|
+
if (utils_1.identSpecialChars[chr]) {
|
|
3187
|
+
result += chr;
|
|
3188
|
+
} else if (utils_1.isHex(chr)) {
|
|
3189
|
+
var hex = chr;
|
|
3190
|
+
pos++;
|
|
3191
|
+
chr = str.charAt(pos);
|
|
3192
|
+
while (utils_1.isHex(chr)) {
|
|
3193
|
+
hex += chr;
|
|
3194
|
+
pos++;
|
|
3195
|
+
chr = str.charAt(pos);
|
|
3196
|
+
}
|
|
3197
|
+
if (chr === ' ') {
|
|
3198
|
+
pos++;
|
|
3199
|
+
chr = str.charAt(pos);
|
|
3200
|
+
}
|
|
3201
|
+
result += String.fromCharCode(parseInt(hex, 16));
|
|
3202
|
+
continue;
|
|
3203
|
+
} else {
|
|
3204
|
+
result += chr;
|
|
3205
|
+
}
|
|
3257
3206
|
} else {
|
|
3258
|
-
|
|
3259
|
-
nextTick(emit);
|
|
3260
|
-
});
|
|
3207
|
+
return result;
|
|
3261
3208
|
}
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
}
|
|
3265
|
-
});
|
|
3266
|
-
conf.on('delete', function(id) {
|
|
3267
|
-
delete promises[id];
|
|
3268
|
-
if (waiting[id]) {
|
|
3269
|
-
delete waiting[id];
|
|
3270
|
-
return;
|
|
3271
|
-
}
|
|
3272
|
-
if (!hasOwnProperty.call(cache2, id)) {
|
|
3273
|
-
return;
|
|
3209
|
+
pos++;
|
|
3210
|
+
chr = str.charAt(pos);
|
|
3274
3211
|
}
|
|
3275
|
-
|
|
3276
|
-
delete cache2[id];
|
|
3277
|
-
conf.emit('deleteasync', id, [ result ]);
|
|
3278
|
-
});
|
|
3279
|
-
conf.on('clear', function() {
|
|
3280
|
-
var oldCache = cache2;
|
|
3281
|
-
cache2 = create(null);
|
|
3282
|
-
waiting = create(null);
|
|
3283
|
-
promises = create(null);
|
|
3284
|
-
conf.emit('clearasync', objectMap(oldCache, function(data2) {
|
|
3285
|
-
return [ data2 ];
|
|
3286
|
-
}));
|
|
3287
|
-
});
|
|
3288
|
-
};
|
|
3289
|
-
});
|
|
3290
|
-
var require_dispose = __commonJS(function() {
|
|
3291
|
-
'use strict';
|
|
3292
|
-
var callable = require_valid_callable();
|
|
3293
|
-
var forEach = require_for_each();
|
|
3294
|
-
var extensions = require_registered_extensions();
|
|
3295
|
-
var apply = Function.prototype.apply;
|
|
3296
|
-
extensions.dispose = function(dispose, conf, options) {
|
|
3297
|
-
var del;
|
|
3298
|
-
callable(dispose);
|
|
3299
|
-
if (options.async && extensions.async || options.promise && extensions.promise) {
|
|
3300
|
-
conf.on('deleteasync', del = function del(id, resultArray) {
|
|
3301
|
-
apply.call(dispose, null, resultArray);
|
|
3302
|
-
});
|
|
3303
|
-
conf.on('clearasync', function(cache2) {
|
|
3304
|
-
forEach(cache2, function(result, id) {
|
|
3305
|
-
del(id, result);
|
|
3306
|
-
});
|
|
3307
|
-
});
|
|
3308
|
-
return;
|
|
3309
|
-
}
|
|
3310
|
-
conf.on('delete', del = function del(id, result) {
|
|
3311
|
-
dispose(result);
|
|
3312
|
-
});
|
|
3313
|
-
conf.on('clear', function(cache2) {
|
|
3314
|
-
forEach(cache2, function(result, id) {
|
|
3315
|
-
del(id, result);
|
|
3316
|
-
});
|
|
3317
|
-
});
|
|
3318
|
-
};
|
|
3319
|
-
});
|
|
3320
|
-
var require_max_timeout = __commonJS(function(exports, module) {
|
|
3321
|
-
'use strict';
|
|
3322
|
-
module.exports = 2147483647;
|
|
3323
|
-
});
|
|
3324
|
-
var require_valid_timeout = __commonJS(function(exports, module) {
|
|
3325
|
-
'use strict';
|
|
3326
|
-
var toPosInt = require_to_pos_integer();
|
|
3327
|
-
var maxTimeout = require_max_timeout();
|
|
3328
|
-
module.exports = function(value) {
|
|
3329
|
-
value = toPosInt(value);
|
|
3330
|
-
if (value > maxTimeout) {
|
|
3331
|
-
throw new TypeError(value + ' exceeds maximum possible timeout');
|
|
3212
|
+
return result;
|
|
3332
3213
|
}
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
var timeout = require_valid_timeout();
|
|
3343
|
-
var extensions = require_registered_extensions();
|
|
3344
|
-
var noop3 = Function.prototype;
|
|
3345
|
-
var max2 = Math.max;
|
|
3346
|
-
var min = Math.min;
|
|
3347
|
-
var create = Object.create;
|
|
3348
|
-
extensions.maxAge = function(maxAge, conf, options) {
|
|
3349
|
-
var timeouts, postfix, preFetchAge, preFetchTimeouts;
|
|
3350
|
-
maxAge = timeout(maxAge);
|
|
3351
|
-
if (!maxAge) {
|
|
3352
|
-
return;
|
|
3214
|
+
function skipWhitespace() {
|
|
3215
|
+
chr = str.charAt(pos);
|
|
3216
|
+
var result = false;
|
|
3217
|
+
while (chr === ' ' || chr === '\t' || chr === '\n' || chr === '\r' || chr === '\f') {
|
|
3218
|
+
result = true;
|
|
3219
|
+
pos++;
|
|
3220
|
+
chr = str.charAt(pos);
|
|
3221
|
+
}
|
|
3222
|
+
return result;
|
|
3353
3223
|
}
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
conf['delete'](id);
|
|
3359
|
-
}, maxAge);
|
|
3360
|
-
if (typeof timeouts[id].unref === 'function') {
|
|
3361
|
-
timeouts[id].unref();
|
|
3224
|
+
function parse3() {
|
|
3225
|
+
var res = parseSelector();
|
|
3226
|
+
if (pos < l) {
|
|
3227
|
+
throw Error('Rule expected but "' + str.charAt(pos) + '" found.');
|
|
3362
3228
|
}
|
|
3363
|
-
|
|
3364
|
-
|
|
3229
|
+
return res;
|
|
3230
|
+
}
|
|
3231
|
+
function parseSelector() {
|
|
3232
|
+
var selector = parseSingleSelector();
|
|
3233
|
+
if (!selector) {
|
|
3234
|
+
return null;
|
|
3365
3235
|
}
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3236
|
+
var res = selector;
|
|
3237
|
+
chr = str.charAt(pos);
|
|
3238
|
+
while (chr === ',') {
|
|
3239
|
+
pos++;
|
|
3240
|
+
skipWhitespace();
|
|
3241
|
+
if (res.type !== 'selectors') {
|
|
3242
|
+
res = {
|
|
3243
|
+
type: 'selectors',
|
|
3244
|
+
selectors: [ selector ]
|
|
3245
|
+
};
|
|
3369
3246
|
}
|
|
3247
|
+
selector = parseSingleSelector();
|
|
3248
|
+
if (!selector) {
|
|
3249
|
+
throw Error('Rule expected after ",".');
|
|
3250
|
+
}
|
|
3251
|
+
res.selectors.push(selector);
|
|
3370
3252
|
}
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
if (!preFetchTimeouts) {
|
|
3382
|
-
return;
|
|
3383
|
-
}
|
|
3384
|
-
if (preFetchTimeouts[id] !== 'nextTick') {
|
|
3385
|
-
clearTimeout(preFetchTimeouts[id]);
|
|
3253
|
+
return res;
|
|
3254
|
+
}
|
|
3255
|
+
function parseSingleSelector() {
|
|
3256
|
+
skipWhitespace();
|
|
3257
|
+
var selector = {
|
|
3258
|
+
type: 'ruleSet'
|
|
3259
|
+
};
|
|
3260
|
+
var rule = parseRule();
|
|
3261
|
+
if (!rule) {
|
|
3262
|
+
return null;
|
|
3386
3263
|
}
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3264
|
+
var currentRule = selector;
|
|
3265
|
+
while (rule) {
|
|
3266
|
+
rule.type = 'rule';
|
|
3267
|
+
currentRule.rule = rule;
|
|
3268
|
+
currentRule = rule;
|
|
3269
|
+
skipWhitespace();
|
|
3270
|
+
chr = str.charAt(pos);
|
|
3271
|
+
if (pos >= l || chr === ',' || chr === ')') {
|
|
3272
|
+
break;
|
|
3273
|
+
}
|
|
3274
|
+
if (ruleNestingOperators[chr]) {
|
|
3275
|
+
var op = chr;
|
|
3276
|
+
pos++;
|
|
3277
|
+
skipWhitespace();
|
|
3278
|
+
rule = parseRule();
|
|
3279
|
+
if (!rule) {
|
|
3280
|
+
throw Error('Rule expected after "' + op + '".');
|
|
3281
|
+
}
|
|
3282
|
+
rule.nestingOperator = op;
|
|
3283
|
+
} else {
|
|
3284
|
+
rule = parseRule();
|
|
3285
|
+
if (rule) {
|
|
3286
|
+
rule.nestingOperator = null;
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
3394
3289
|
}
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3290
|
+
return selector;
|
|
3291
|
+
}
|
|
3292
|
+
function parseRule() {
|
|
3293
|
+
var rule = null;
|
|
3294
|
+
while (pos < l) {
|
|
3295
|
+
chr = str.charAt(pos);
|
|
3296
|
+
if (chr === '*') {
|
|
3297
|
+
pos++;
|
|
3298
|
+
(rule = rule || {}).tagName = '*';
|
|
3299
|
+
} else if (utils_1.isIdentStart(chr) || chr === '\\') {
|
|
3300
|
+
(rule = rule || {}).tagName = getIdent();
|
|
3301
|
+
} else if (chr === '.') {
|
|
3302
|
+
pos++;
|
|
3303
|
+
rule = rule || {};
|
|
3304
|
+
(rule.classNames = rule.classNames || []).push(getIdent());
|
|
3305
|
+
} else if (chr === '#') {
|
|
3306
|
+
pos++;
|
|
3307
|
+
(rule = rule || {}).id = getIdent();
|
|
3308
|
+
} else if (chr === '[') {
|
|
3309
|
+
pos++;
|
|
3310
|
+
skipWhitespace();
|
|
3311
|
+
var attr = {
|
|
3312
|
+
name: getIdent()
|
|
3313
|
+
};
|
|
3314
|
+
skipWhitespace();
|
|
3315
|
+
if (chr === ']') {
|
|
3316
|
+
pos++;
|
|
3317
|
+
} else {
|
|
3318
|
+
var operator = '';
|
|
3319
|
+
if (attrEqualityMods[chr]) {
|
|
3320
|
+
operator = chr;
|
|
3321
|
+
pos++;
|
|
3322
|
+
chr = str.charAt(pos);
|
|
3323
|
+
}
|
|
3324
|
+
if (pos >= l) {
|
|
3325
|
+
throw Error('Expected "=" but end of file reached.');
|
|
3326
|
+
}
|
|
3327
|
+
if (chr !== '=') {
|
|
3328
|
+
throw Error('Expected "=" but "' + chr + '" found.');
|
|
3329
|
+
}
|
|
3330
|
+
attr.operator = operator + '=';
|
|
3331
|
+
pos++;
|
|
3332
|
+
skipWhitespace();
|
|
3333
|
+
var attrValue = '';
|
|
3334
|
+
attr.valueType = 'string';
|
|
3335
|
+
if (chr === '"') {
|
|
3336
|
+
attrValue = getStr('"', utils_1.doubleQuotesEscapeChars);
|
|
3337
|
+
} else if (chr === '\'') {
|
|
3338
|
+
attrValue = getStr('\'', utils_1.singleQuoteEscapeChars);
|
|
3339
|
+
} else if (substitutesEnabled && chr === '$') {
|
|
3340
|
+
pos++;
|
|
3341
|
+
attrValue = getIdent();
|
|
3342
|
+
attr.valueType = 'substitute';
|
|
3343
|
+
} else {
|
|
3344
|
+
while (pos < l) {
|
|
3345
|
+
if (chr === ']') {
|
|
3346
|
+
break;
|
|
3347
|
+
}
|
|
3348
|
+
attrValue += chr;
|
|
3349
|
+
pos++;
|
|
3350
|
+
chr = str.charAt(pos);
|
|
3411
3351
|
}
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3352
|
+
attrValue = attrValue.trim();
|
|
3353
|
+
}
|
|
3354
|
+
skipWhitespace();
|
|
3355
|
+
if (pos >= l) {
|
|
3356
|
+
throw Error('Expected "]" but end of file reached.');
|
|
3357
|
+
}
|
|
3358
|
+
if (chr !== ']') {
|
|
3359
|
+
throw Error('Expected "]" but "' + chr + '" found.');
|
|
3360
|
+
}
|
|
3361
|
+
pos++;
|
|
3362
|
+
attr.value = attrValue;
|
|
3363
|
+
}
|
|
3364
|
+
rule = rule || {};
|
|
3365
|
+
(rule.attrs = rule.attrs || []).push(attr);
|
|
3366
|
+
} else if (chr === ':') {
|
|
3367
|
+
pos++;
|
|
3368
|
+
var pseudoName = getIdent();
|
|
3369
|
+
var pseudo = {
|
|
3370
|
+
name: pseudoName
|
|
3371
|
+
};
|
|
3372
|
+
if (chr === '(') {
|
|
3373
|
+
pos++;
|
|
3374
|
+
var value = '';
|
|
3375
|
+
skipWhitespace();
|
|
3376
|
+
if (pseudos[pseudoName] === 'selector') {
|
|
3377
|
+
pseudo.valueType = 'selector';
|
|
3378
|
+
value = parseSelector();
|
|
3379
|
+
} else {
|
|
3380
|
+
pseudo.valueType = pseudos[pseudoName] || 'string';
|
|
3381
|
+
if (chr === '"') {
|
|
3382
|
+
value = getStr('"', utils_1.doubleQuotesEscapeChars);
|
|
3383
|
+
} else if (chr === '\'') {
|
|
3384
|
+
value = getStr('\'', utils_1.singleQuoteEscapeChars);
|
|
3385
|
+
} else if (substitutesEnabled && chr === '$') {
|
|
3386
|
+
pos++;
|
|
3387
|
+
value = getIdent();
|
|
3388
|
+
pseudo.valueType = 'substitute';
|
|
3389
|
+
} else {
|
|
3390
|
+
while (pos < l) {
|
|
3391
|
+
if (chr === ')') {
|
|
3392
|
+
break;
|
|
3419
3393
|
}
|
|
3394
|
+
value += chr;
|
|
3395
|
+
pos++;
|
|
3396
|
+
chr = str.charAt(pos);
|
|
3420
3397
|
}
|
|
3398
|
+
value = value.trim();
|
|
3421
3399
|
}
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
if (preFetchTimeouts) {
|
|
3433
|
-
forEach(preFetchTimeouts, function(id) {
|
|
3434
|
-
if (id !== 'nextTick') {
|
|
3435
|
-
clearTimeout(id);
|
|
3436
|
-
}
|
|
3437
|
-
});
|
|
3438
|
-
preFetchTimeouts = {};
|
|
3439
|
-
}
|
|
3440
|
-
});
|
|
3441
|
-
};
|
|
3442
|
-
});
|
|
3443
|
-
var require_lru_queue = __commonJS(function(exports, module) {
|
|
3444
|
-
'use strict';
|
|
3445
|
-
var toPosInt = require_to_pos_integer();
|
|
3446
|
-
var create = Object.create;
|
|
3447
|
-
var hasOwnProperty2 = Object.prototype.hasOwnProperty;
|
|
3448
|
-
module.exports = function(limit) {
|
|
3449
|
-
var size = 0, base = 1, queue2 = create(null), map = create(null), index = 0, del;
|
|
3450
|
-
limit = toPosInt(limit);
|
|
3451
|
-
return {
|
|
3452
|
-
hit: function hit(id) {
|
|
3453
|
-
var oldIndex = map[id], nuIndex = ++index;
|
|
3454
|
-
queue2[nuIndex] = id;
|
|
3455
|
-
map[id] = nuIndex;
|
|
3456
|
-
if (!oldIndex) {
|
|
3457
|
-
++size;
|
|
3458
|
-
if (size <= limit) {
|
|
3459
|
-
return;
|
|
3400
|
+
skipWhitespace();
|
|
3401
|
+
}
|
|
3402
|
+
if (pos >= l) {
|
|
3403
|
+
throw Error('Expected ")" but end of file reached.');
|
|
3404
|
+
}
|
|
3405
|
+
if (chr !== ')') {
|
|
3406
|
+
throw Error('Expected ")" but "' + chr + '" found.');
|
|
3407
|
+
}
|
|
3408
|
+
pos++;
|
|
3409
|
+
pseudo.value = value;
|
|
3460
3410
|
}
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
delete queue2[oldIndex];
|
|
3466
|
-
if (base !== oldIndex) {
|
|
3467
|
-
return;
|
|
3468
|
-
}
|
|
3469
|
-
while (!hasOwnProperty2.call(queue2, ++base)) {
|
|
3470
|
-
continue;
|
|
3471
|
-
}
|
|
3472
|
-
},
|
|
3473
|
-
delete: del = function del(id) {
|
|
3474
|
-
var oldIndex = map[id];
|
|
3475
|
-
if (!oldIndex) {
|
|
3476
|
-
return;
|
|
3477
|
-
}
|
|
3478
|
-
delete queue2[oldIndex];
|
|
3479
|
-
delete map[id];
|
|
3480
|
-
--size;
|
|
3481
|
-
if (base !== oldIndex) {
|
|
3482
|
-
return;
|
|
3483
|
-
}
|
|
3484
|
-
if (!size) {
|
|
3485
|
-
index = 0;
|
|
3486
|
-
base = 1;
|
|
3487
|
-
return;
|
|
3488
|
-
}
|
|
3489
|
-
while (!hasOwnProperty2.call(queue2, ++base)) {
|
|
3490
|
-
continue;
|
|
3411
|
+
rule = rule || {};
|
|
3412
|
+
(rule.pseudos = rule.pseudos || []).push(pseudo);
|
|
3413
|
+
} else {
|
|
3414
|
+
break;
|
|
3491
3415
|
}
|
|
3492
|
-
},
|
|
3493
|
-
clear: function clear() {
|
|
3494
|
-
size = 0;
|
|
3495
|
-
base = 1;
|
|
3496
|
-
queue2 = create(null);
|
|
3497
|
-
map = create(null);
|
|
3498
|
-
index = 0;
|
|
3499
3416
|
}
|
|
3500
|
-
|
|
3501
|
-
};
|
|
3502
|
-
});
|
|
3503
|
-
var require_max = __commonJS(function() {
|
|
3504
|
-
'use strict';
|
|
3505
|
-
var toPosInteger = require_to_pos_integer();
|
|
3506
|
-
var lruQueue = require_lru_queue();
|
|
3507
|
-
var extensions = require_registered_extensions();
|
|
3508
|
-
extensions.max = function(max2, conf, options) {
|
|
3509
|
-
var postfix, queue2, hit;
|
|
3510
|
-
max2 = toPosInteger(max2);
|
|
3511
|
-
if (!max2) {
|
|
3512
|
-
return;
|
|
3417
|
+
return rule;
|
|
3513
3418
|
}
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
id = queue2.hit(id);
|
|
3518
|
-
if (id === void 0) {
|
|
3519
|
-
return;
|
|
3520
|
-
}
|
|
3521
|
-
conf['delete'](id);
|
|
3522
|
-
});
|
|
3523
|
-
conf.on('get' + postfix, hit);
|
|
3524
|
-
conf.on('delete' + postfix, queue2['delete']);
|
|
3525
|
-
conf.on('clear' + postfix, queue2.clear);
|
|
3526
|
-
};
|
|
3419
|
+
return parse3();
|
|
3420
|
+
}
|
|
3421
|
+
exports.parseCssSelector = parseCssSelector;
|
|
3527
3422
|
});
|
|
3528
|
-
var
|
|
3423
|
+
var require_render = __commonJS(function(exports) {
|
|
3529
3424
|
'use strict';
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
var
|
|
3534
|
-
|
|
3535
|
-
var
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
});
|
|
3544
|
-
conf.on('delete' + postfix, function(id) {
|
|
3545
|
-
delete cache2[id];
|
|
3546
|
-
});
|
|
3547
|
-
conf.on('clear' + postfix, function() {
|
|
3548
|
-
cache2 = {};
|
|
3549
|
-
});
|
|
3550
|
-
defineProperties(conf.memoized, {
|
|
3551
|
-
deleteRef: d2(function() {
|
|
3552
|
-
var id = conf.get(arguments);
|
|
3553
|
-
if (id === null) {
|
|
3554
|
-
return null;
|
|
3555
|
-
}
|
|
3556
|
-
if (!cache2[id]) {
|
|
3557
|
-
return null;
|
|
3558
|
-
}
|
|
3559
|
-
if (!--cache2[id]) {
|
|
3560
|
-
conf['delete'](id);
|
|
3561
|
-
return true;
|
|
3562
|
-
}
|
|
3563
|
-
return false;
|
|
3564
|
-
}),
|
|
3565
|
-
getRefCount: d2(function() {
|
|
3566
|
-
var id = conf.get(arguments);
|
|
3567
|
-
if (id === null) {
|
|
3568
|
-
return 0;
|
|
3569
|
-
}
|
|
3570
|
-
if (!cache2[id]) {
|
|
3571
|
-
return 0;
|
|
3425
|
+
Object.defineProperty(exports, '__esModule', {
|
|
3426
|
+
value: true
|
|
3427
|
+
});
|
|
3428
|
+
var utils_1 = require_utils();
|
|
3429
|
+
function renderEntity(entity) {
|
|
3430
|
+
var res = '';
|
|
3431
|
+
switch (entity.type) {
|
|
3432
|
+
case 'ruleSet':
|
|
3433
|
+
var currentEntity = entity.rule;
|
|
3434
|
+
var parts = [];
|
|
3435
|
+
while (currentEntity) {
|
|
3436
|
+
if (currentEntity.nestingOperator) {
|
|
3437
|
+
parts.push(currentEntity.nestingOperator);
|
|
3572
3438
|
}
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
if (length !== 0) {
|
|
3588
|
-
if (options.primitive) {
|
|
3589
|
-
if (length === false) {
|
|
3590
|
-
options.normalizer = require_primitive();
|
|
3591
|
-
} else if (length > 1) {
|
|
3592
|
-
options.normalizer = require_get_primitive_fixed()(length);
|
|
3593
|
-
}
|
|
3594
|
-
} else if (length === false) {
|
|
3595
|
-
options.normalizer = require_get()();
|
|
3596
|
-
} else if (length === 1) {
|
|
3597
|
-
options.normalizer = require_get_1()();
|
|
3439
|
+
parts.push(renderEntity(currentEntity));
|
|
3440
|
+
currentEntity = currentEntity.rule;
|
|
3441
|
+
}
|
|
3442
|
+
res = parts.join(' ');
|
|
3443
|
+
break;
|
|
3444
|
+
|
|
3445
|
+
case 'selectors':
|
|
3446
|
+
res = entity.selectors.map(renderEntity).join(', ');
|
|
3447
|
+
break;
|
|
3448
|
+
|
|
3449
|
+
case 'rule':
|
|
3450
|
+
if (entity.tagName) {
|
|
3451
|
+
if (entity.tagName === '*') {
|
|
3452
|
+
res = '*';
|
|
3598
3453
|
} else {
|
|
3599
|
-
|
|
3454
|
+
res = utils_1.escapeIdentifier(entity.tagName);
|
|
3600
3455
|
}
|
|
3601
3456
|
}
|
|
3457
|
+
if (entity.id) {
|
|
3458
|
+
res += '#' + utils_1.escapeIdentifier(entity.id);
|
|
3459
|
+
}
|
|
3460
|
+
if (entity.classNames) {
|
|
3461
|
+
res += entity.classNames.map(function(cn) {
|
|
3462
|
+
return '.' + utils_1.escapeIdentifier(cn);
|
|
3463
|
+
}).join('');
|
|
3464
|
+
}
|
|
3465
|
+
if (entity.attrs) {
|
|
3466
|
+
res += entity.attrs.map(function(attr) {
|
|
3467
|
+
if ('operator' in attr) {
|
|
3468
|
+
if (attr.valueType === 'substitute') {
|
|
3469
|
+
return '[' + utils_1.escapeIdentifier(attr.name) + attr.operator + '$' + attr.value + ']';
|
|
3470
|
+
} else {
|
|
3471
|
+
return '[' + utils_1.escapeIdentifier(attr.name) + attr.operator + utils_1.escapeStr(attr.value) + ']';
|
|
3472
|
+
}
|
|
3473
|
+
} else {
|
|
3474
|
+
return '[' + utils_1.escapeIdentifier(attr.name) + ']';
|
|
3475
|
+
}
|
|
3476
|
+
}).join('');
|
|
3477
|
+
}
|
|
3478
|
+
if (entity.pseudos) {
|
|
3479
|
+
res += entity.pseudos.map(function(pseudo) {
|
|
3480
|
+
if (pseudo.valueType) {
|
|
3481
|
+
if (pseudo.valueType === 'selector') {
|
|
3482
|
+
return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + renderEntity(pseudo.value) + ')';
|
|
3483
|
+
} else if (pseudo.valueType === 'substitute') {
|
|
3484
|
+
return ':' + utils_1.escapeIdentifier(pseudo.name) + '($' + pseudo.value + ')';
|
|
3485
|
+
} else if (pseudo.valueType === 'numeric') {
|
|
3486
|
+
return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + pseudo.value + ')';
|
|
3487
|
+
} else {
|
|
3488
|
+
return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + utils_1.escapeIdentifier(pseudo.value) + ')';
|
|
3489
|
+
}
|
|
3490
|
+
} else {
|
|
3491
|
+
return ':' + utils_1.escapeIdentifier(pseudo.name);
|
|
3492
|
+
}
|
|
3493
|
+
}).join('');
|
|
3494
|
+
}
|
|
3495
|
+
break;
|
|
3496
|
+
|
|
3497
|
+
default:
|
|
3498
|
+
throw Error('Unknown entity type: "' + entity.type + '".');
|
|
3602
3499
|
}
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3500
|
+
return res;
|
|
3501
|
+
}
|
|
3502
|
+
exports.renderEntity = renderEntity;
|
|
3503
|
+
});
|
|
3504
|
+
var require_lib = __commonJS(function(exports) {
|
|
3505
|
+
'use strict';
|
|
3506
|
+
Object.defineProperty(exports, '__esModule', {
|
|
3507
|
+
value: true
|
|
3508
|
+
});
|
|
3509
|
+
var parser_context_1 = require_parser_context();
|
|
3510
|
+
var render_1 = require_render();
|
|
3511
|
+
var CssSelectorParser3 = function() {
|
|
3512
|
+
function CssSelectorParser4() {
|
|
3513
|
+
this.pseudos = {};
|
|
3514
|
+
this.attrEqualityMods = {};
|
|
3515
|
+
this.ruleNestingOperators = {};
|
|
3516
|
+
this.substitutesEnabled = false;
|
|
3620
3517
|
}
|
|
3621
|
-
|
|
3622
|
-
|
|
3518
|
+
CssSelectorParser4.prototype.registerSelectorPseudos = function() {
|
|
3519
|
+
var pseudos = [];
|
|
3520
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3521
|
+
pseudos[_i] = arguments[_i];
|
|
3522
|
+
}
|
|
3523
|
+
for (var _a = 0, pseudos_1 = pseudos; _a < pseudos_1.length; _a++) {
|
|
3524
|
+
var pseudo = pseudos_1[_a];
|
|
3525
|
+
this.pseudos[pseudo] = 'selector';
|
|
3526
|
+
}
|
|
3527
|
+
return this;
|
|
3528
|
+
};
|
|
3529
|
+
CssSelectorParser4.prototype.unregisterSelectorPseudos = function() {
|
|
3530
|
+
var pseudos = [];
|
|
3531
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3532
|
+
pseudos[_i] = arguments[_i];
|
|
3533
|
+
}
|
|
3534
|
+
for (var _a = 0, pseudos_2 = pseudos; _a < pseudos_2.length; _a++) {
|
|
3535
|
+
var pseudo = pseudos_2[_a];
|
|
3536
|
+
delete this.pseudos[pseudo];
|
|
3537
|
+
}
|
|
3538
|
+
return this;
|
|
3539
|
+
};
|
|
3540
|
+
CssSelectorParser4.prototype.registerNumericPseudos = function() {
|
|
3541
|
+
var pseudos = [];
|
|
3542
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3543
|
+
pseudos[_i] = arguments[_i];
|
|
3544
|
+
}
|
|
3545
|
+
for (var _a = 0, pseudos_3 = pseudos; _a < pseudos_3.length; _a++) {
|
|
3546
|
+
var pseudo = pseudos_3[_a];
|
|
3547
|
+
this.pseudos[pseudo] = 'numeric';
|
|
3548
|
+
}
|
|
3549
|
+
return this;
|
|
3550
|
+
};
|
|
3551
|
+
CssSelectorParser4.prototype.unregisterNumericPseudos = function() {
|
|
3552
|
+
var pseudos = [];
|
|
3553
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3554
|
+
pseudos[_i] = arguments[_i];
|
|
3555
|
+
}
|
|
3556
|
+
for (var _a = 0, pseudos_4 = pseudos; _a < pseudos_4.length; _a++) {
|
|
3557
|
+
var pseudo = pseudos_4[_a];
|
|
3558
|
+
delete this.pseudos[pseudo];
|
|
3559
|
+
}
|
|
3560
|
+
return this;
|
|
3561
|
+
};
|
|
3562
|
+
CssSelectorParser4.prototype.registerNestingOperators = function() {
|
|
3563
|
+
var operators = [];
|
|
3564
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3565
|
+
operators[_i] = arguments[_i];
|
|
3566
|
+
}
|
|
3567
|
+
for (var _a = 0, operators_1 = operators; _a < operators_1.length; _a++) {
|
|
3568
|
+
var operator = operators_1[_a];
|
|
3569
|
+
this.ruleNestingOperators[operator] = true;
|
|
3570
|
+
}
|
|
3571
|
+
return this;
|
|
3572
|
+
};
|
|
3573
|
+
CssSelectorParser4.prototype.unregisterNestingOperators = function() {
|
|
3574
|
+
var operators = [];
|
|
3575
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3576
|
+
operators[_i] = arguments[_i];
|
|
3577
|
+
}
|
|
3578
|
+
for (var _a = 0, operators_2 = operators; _a < operators_2.length; _a++) {
|
|
3579
|
+
var operator = operators_2[_a];
|
|
3580
|
+
delete this.ruleNestingOperators[operator];
|
|
3581
|
+
}
|
|
3582
|
+
return this;
|
|
3583
|
+
};
|
|
3584
|
+
CssSelectorParser4.prototype.registerAttrEqualityMods = function() {
|
|
3585
|
+
var mods = [];
|
|
3586
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3587
|
+
mods[_i] = arguments[_i];
|
|
3588
|
+
}
|
|
3589
|
+
for (var _a = 0, mods_1 = mods; _a < mods_1.length; _a++) {
|
|
3590
|
+
var mod = mods_1[_a];
|
|
3591
|
+
this.attrEqualityMods[mod] = true;
|
|
3592
|
+
}
|
|
3593
|
+
return this;
|
|
3594
|
+
};
|
|
3595
|
+
CssSelectorParser4.prototype.unregisterAttrEqualityMods = function() {
|
|
3596
|
+
var mods = [];
|
|
3597
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3598
|
+
mods[_i] = arguments[_i];
|
|
3599
|
+
}
|
|
3600
|
+
for (var _a = 0, mods_2 = mods; _a < mods_2.length; _a++) {
|
|
3601
|
+
var mod = mods_2[_a];
|
|
3602
|
+
delete this.attrEqualityMods[mod];
|
|
3603
|
+
}
|
|
3604
|
+
return this;
|
|
3605
|
+
};
|
|
3606
|
+
CssSelectorParser4.prototype.enableSubstitutes = function() {
|
|
3607
|
+
this.substitutesEnabled = true;
|
|
3608
|
+
return this;
|
|
3609
|
+
};
|
|
3610
|
+
CssSelectorParser4.prototype.disableSubstitutes = function() {
|
|
3611
|
+
this.substitutesEnabled = false;
|
|
3612
|
+
return this;
|
|
3613
|
+
};
|
|
3614
|
+
CssSelectorParser4.prototype.parse = function(str) {
|
|
3615
|
+
return parser_context_1.parseCssSelector(str, 0, this.pseudos, this.attrEqualityMods, this.ruleNestingOperators, this.substitutesEnabled);
|
|
3616
|
+
};
|
|
3617
|
+
CssSelectorParser4.prototype.render = function(path) {
|
|
3618
|
+
return render_1.renderEntity(path).trim();
|
|
3619
|
+
};
|
|
3620
|
+
return CssSelectorParser4;
|
|
3621
|
+
}();
|
|
3622
|
+
exports.CssSelectorParser = CssSelectorParser3;
|
|
3623
3623
|
});
|
|
3624
3624
|
var require_doT = __commonJS(function(exports, module) {
|
|
3625
3625
|
(function() {
|
|
@@ -5649,12 +5649,20 @@
|
|
|
5649
5649
|
};
|
|
5650
5650
|
}();
|
|
5651
5651
|
var element_matches_default = matchesSelector;
|
|
5652
|
-
|
|
5653
|
-
|
|
5652
|
+
var import_memoizee = __toModule(require_memoizee());
|
|
5653
|
+
axe._memoizedFns = [];
|
|
5654
|
+
function memoizeImplementation(fn) {
|
|
5655
|
+
var memoized = (0, import_memoizee['default'])(fn);
|
|
5656
|
+
axe._memoizedFns.push(memoized);
|
|
5657
|
+
return memoized;
|
|
5658
|
+
}
|
|
5659
|
+
var memoize_default = memoizeImplementation;
|
|
5660
|
+
var isXHTML = memoize_default(function(doc) {
|
|
5661
|
+
if (!(doc !== null && doc !== void 0 && doc.createElement)) {
|
|
5654
5662
|
return false;
|
|
5655
5663
|
}
|
|
5656
5664
|
return doc.createElement('A').localName === 'A';
|
|
5657
|
-
}
|
|
5665
|
+
});
|
|
5658
5666
|
var is_xhtml_default = isXHTML;
|
|
5659
5667
|
function getShadowSelector(generateSelector2, elm) {
|
|
5660
5668
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -5687,7 +5695,6 @@
|
|
|
5687
5695
|
});
|
|
5688
5696
|
}
|
|
5689
5697
|
var get_shadow_selector_default = getShadowSelector;
|
|
5690
|
-
var xhtml;
|
|
5691
5698
|
var ignoredAttributes = [ 'class', 'style', 'id', 'selected', 'checked', 'disabled', 'tabindex', 'aria-checked', 'aria-selected', 'aria-invalid', 'aria-activedescendant', 'aria-busy', 'aria-disabled', 'aria-expanded', 'aria-grabbed', 'aria-pressed', 'aria-valuenow' ];
|
|
5692
5699
|
var MAXATTRIBUTELENGTH = 31;
|
|
5693
5700
|
var attrCharsRegex = /([\\"])/g;
|
|
@@ -5717,7 +5724,7 @@
|
|
|
5717
5724
|
return !ignoredAttributes.includes(at.name) && at.name.indexOf(':') === -1 && (!at.value || at.value.length < MAXATTRIBUTELENGTH);
|
|
5718
5725
|
}
|
|
5719
5726
|
function _getSelectorData(domTree) {
|
|
5720
|
-
var
|
|
5727
|
+
var data = {
|
|
5721
5728
|
classes: {},
|
|
5722
5729
|
tags: {},
|
|
5723
5730
|
attributes: {}
|
|
@@ -5730,18 +5737,18 @@
|
|
|
5730
5737
|
var node = current.actualNode;
|
|
5731
5738
|
if (!!node.querySelectorAll) {
|
|
5732
5739
|
var tag = node.nodeName;
|
|
5733
|
-
if (
|
|
5734
|
-
|
|
5740
|
+
if (data.tags[tag]) {
|
|
5741
|
+
data.tags[tag]++;
|
|
5735
5742
|
} else {
|
|
5736
|
-
|
|
5743
|
+
data.tags[tag] = 1;
|
|
5737
5744
|
}
|
|
5738
5745
|
if (node.classList) {
|
|
5739
5746
|
Array.from(node.classList).forEach(function(cl) {
|
|
5740
5747
|
var ind = escape_selector_default(cl);
|
|
5741
|
-
if (
|
|
5742
|
-
|
|
5748
|
+
if (data.classes[ind]) {
|
|
5749
|
+
data.classes[ind]++;
|
|
5743
5750
|
} else {
|
|
5744
|
-
|
|
5751
|
+
data.classes[ind] = 1;
|
|
5745
5752
|
}
|
|
5746
5753
|
});
|
|
5747
5754
|
}
|
|
@@ -5749,10 +5756,10 @@
|
|
|
5749
5756
|
Array.from(get_node_attributes_default(node)).filter(filterAttributes).forEach(function(at) {
|
|
5750
5757
|
var atnv = getAttributeNameValue(node, at);
|
|
5751
5758
|
if (atnv) {
|
|
5752
|
-
if (
|
|
5753
|
-
|
|
5759
|
+
if (data.attributes[atnv]) {
|
|
5760
|
+
data.attributes[atnv]++;
|
|
5754
5761
|
} else {
|
|
5755
|
-
|
|
5762
|
+
data.attributes[atnv] = 1;
|
|
5756
5763
|
}
|
|
5757
5764
|
}
|
|
5758
5765
|
});
|
|
@@ -5769,7 +5776,7 @@
|
|
|
5769
5776
|
while (currentLevel.length) {
|
|
5770
5777
|
_loop2();
|
|
5771
5778
|
}
|
|
5772
|
-
return
|
|
5779
|
+
return data;
|
|
5773
5780
|
}
|
|
5774
5781
|
function uncommonClasses(node, selectorData) {
|
|
5775
5782
|
var retVal = [];
|
|
@@ -5812,9 +5819,7 @@
|
|
|
5812
5819
|
}
|
|
5813
5820
|
}
|
|
5814
5821
|
function getBaseSelector(elm) {
|
|
5815
|
-
|
|
5816
|
-
xhtml = is_xhtml_default(document);
|
|
5817
|
-
}
|
|
5822
|
+
var xhtml = is_xhtml_default(document);
|
|
5818
5823
|
return escape_selector_default(xhtml ? elm.localName : elm.nodeName.toLowerCase());
|
|
5819
5824
|
}
|
|
5820
5825
|
function uncommonAttributes(node, selectorData) {
|
|
@@ -6123,8 +6128,8 @@
|
|
|
6123
6128
|
}
|
|
6124
6129
|
};
|
|
6125
6130
|
},
|
|
6126
|
-
data: function data(
|
|
6127
|
-
checkResult.data =
|
|
6131
|
+
data: function data(_data) {
|
|
6132
|
+
checkResult.data = _data;
|
|
6128
6133
|
},
|
|
6129
6134
|
relatedNodes: function relatedNodes(nodes) {
|
|
6130
6135
|
if (!window.Node) {
|
|
@@ -6603,7 +6608,7 @@
|
|
|
6603
6608
|
var errorTypes = Object.freeze([ 'EvalError', 'RangeError', 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError' ]);
|
|
6604
6609
|
function stringifyMessage(_ref2) {
|
|
6605
6610
|
var topic = _ref2.topic, channelId = _ref2.channelId, message = _ref2.message, messageId = _ref2.messageId, keepalive = _ref2.keepalive;
|
|
6606
|
-
var
|
|
6611
|
+
var data = {
|
|
6607
6612
|
channelId: channelId,
|
|
6608
6613
|
topic: topic,
|
|
6609
6614
|
messageId: messageId,
|
|
@@ -6611,28 +6616,28 @@
|
|
|
6611
6616
|
source: getSource2()
|
|
6612
6617
|
};
|
|
6613
6618
|
if (message instanceof Error) {
|
|
6614
|
-
|
|
6619
|
+
data.error = {
|
|
6615
6620
|
name: message.name,
|
|
6616
6621
|
message: message.message,
|
|
6617
6622
|
stack: message.stack
|
|
6618
6623
|
};
|
|
6619
6624
|
} else {
|
|
6620
|
-
|
|
6625
|
+
data.payload = message;
|
|
6621
6626
|
}
|
|
6622
|
-
return JSON.stringify(
|
|
6627
|
+
return JSON.stringify(data);
|
|
6623
6628
|
}
|
|
6624
6629
|
function parseMessage(dataString) {
|
|
6625
|
-
var
|
|
6630
|
+
var data;
|
|
6626
6631
|
try {
|
|
6627
|
-
|
|
6632
|
+
data = JSON.parse(dataString);
|
|
6628
6633
|
} catch (e) {
|
|
6629
6634
|
return;
|
|
6630
6635
|
}
|
|
6631
|
-
if (!isRespondableMessage(
|
|
6636
|
+
if (!isRespondableMessage(data)) {
|
|
6632
6637
|
return;
|
|
6633
6638
|
}
|
|
6634
|
-
var
|
|
6635
|
-
var message = _typeof(
|
|
6639
|
+
var _data2 = data, topic = _data2.topic, channelId = _data2.channelId, messageId = _data2.messageId, keepalive = _data2.keepalive;
|
|
6640
|
+
var message = _typeof(data.error) === 'object' ? buildErrorObject(data.error) : data.payload;
|
|
6636
6641
|
return {
|
|
6637
6642
|
topic: topic,
|
|
6638
6643
|
message: message,
|
|
@@ -6706,22 +6711,22 @@
|
|
|
6706
6711
|
messageIds.push(uuid2);
|
|
6707
6712
|
return true;
|
|
6708
6713
|
}
|
|
6709
|
-
function postMessage(win,
|
|
6710
|
-
if (typeof replyHandler === 'function') {
|
|
6711
|
-
storeReplyHandler(data2.channelId, replyHandler, sendToParent);
|
|
6712
|
-
}
|
|
6714
|
+
function postMessage(win, data, sendToParent, replyHandler) {
|
|
6713
6715
|
sendToParent ? assertIsParentWindow(win) : assertIsFrameWindow(win);
|
|
6714
|
-
if (
|
|
6715
|
-
axe.log(
|
|
6716
|
+
if (data.message instanceof Error && !sendToParent) {
|
|
6717
|
+
axe.log(data.message);
|
|
6716
6718
|
return false;
|
|
6717
6719
|
}
|
|
6718
6720
|
var dataString = stringifyMessage(_extends({
|
|
6719
6721
|
messageId: createMessageId()
|
|
6720
|
-
},
|
|
6722
|
+
}, data));
|
|
6721
6723
|
var allowedOrigins = axe._audit.allowedOrigins;
|
|
6722
6724
|
if (!allowedOrigins || !allowedOrigins.length) {
|
|
6723
6725
|
return false;
|
|
6724
6726
|
}
|
|
6727
|
+
if (typeof replyHandler === 'function') {
|
|
6728
|
+
storeReplyHandler(data.channelId, replyHandler, sendToParent);
|
|
6729
|
+
}
|
|
6725
6730
|
allowedOrigins.forEach(function(origin) {
|
|
6726
6731
|
try {
|
|
6727
6732
|
win.postMessage(dataString, origin);
|
|
@@ -6753,12 +6758,12 @@
|
|
|
6753
6758
|
function createResponder(win, channelId) {
|
|
6754
6759
|
var sendToParent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
6755
6760
|
return function respond(message, keepalive, replyHandler) {
|
|
6756
|
-
var
|
|
6761
|
+
var data = {
|
|
6757
6762
|
channelId: channelId,
|
|
6758
6763
|
message: message,
|
|
6759
6764
|
keepalive: keepalive
|
|
6760
6765
|
};
|
|
6761
|
-
postMessage(win,
|
|
6766
|
+
postMessage(win, data, sendToParent, replyHandler);
|
|
6762
6767
|
};
|
|
6763
6768
|
}
|
|
6764
6769
|
function originIsAllowed(origin) {
|
|
@@ -6768,8 +6773,8 @@
|
|
|
6768
6773
|
function messageHandler(_ref3, topicHandler) {
|
|
6769
6774
|
var origin = _ref3.origin, dataString = _ref3.data, win = _ref3.source;
|
|
6770
6775
|
try {
|
|
6771
|
-
var
|
|
6772
|
-
var channelId =
|
|
6776
|
+
var data = parseMessage(dataString) || {};
|
|
6777
|
+
var channelId = data.channelId, message = data.message, messageId = data.messageId;
|
|
6773
6778
|
if (!originIsAllowed(origin) || !isNewMessage(messageId)) {
|
|
6774
6779
|
return;
|
|
6775
6780
|
}
|
|
@@ -6778,12 +6783,12 @@
|
|
|
6778
6783
|
return false;
|
|
6779
6784
|
}
|
|
6780
6785
|
try {
|
|
6781
|
-
if (
|
|
6786
|
+
if (data.topic) {
|
|
6782
6787
|
var responder = createResponder(win, channelId);
|
|
6783
6788
|
assertIsParentWindow(win);
|
|
6784
|
-
topicHandler(
|
|
6789
|
+
topicHandler(data, responder);
|
|
6785
6790
|
} else {
|
|
6786
|
-
callReplyHandler(win,
|
|
6791
|
+
callReplyHandler(win, data);
|
|
6787
6792
|
}
|
|
6788
6793
|
} catch (error) {
|
|
6789
6794
|
processError(win, error, channelId);
|
|
@@ -6793,8 +6798,8 @@
|
|
|
6793
6798
|
return false;
|
|
6794
6799
|
}
|
|
6795
6800
|
}
|
|
6796
|
-
function callReplyHandler(win,
|
|
6797
|
-
var channelId =
|
|
6801
|
+
function callReplyHandler(win, data) {
|
|
6802
|
+
var channelId = data.channelId, message = data.message, keepalive = data.keepalive;
|
|
6798
6803
|
var _ref4 = getReplyHandler(channelId) || {}, replyHandler = _ref4.replyHandler, sendToParent = _ref4.sendToParent;
|
|
6799
6804
|
if (!replyHandler) {
|
|
6800
6805
|
return;
|
|
@@ -6824,11 +6829,11 @@
|
|
|
6824
6829
|
window.removeEventListener('message', handler, false);
|
|
6825
6830
|
};
|
|
6826
6831
|
},
|
|
6827
|
-
post: function post(win,
|
|
6832
|
+
post: function post(win, data, replyHandler) {
|
|
6828
6833
|
if (typeof window.addEventListener !== 'function') {
|
|
6829
6834
|
return false;
|
|
6830
6835
|
}
|
|
6831
|
-
return postMessage(win,
|
|
6836
|
+
return postMessage(win, data, false, replyHandler);
|
|
6832
6837
|
}
|
|
6833
6838
|
};
|
|
6834
6839
|
function setDefaultFrameMessenger(respondable2) {
|
|
@@ -6838,16 +6843,16 @@
|
|
|
6838
6843
|
var postMessage2;
|
|
6839
6844
|
var topicHandlers = {};
|
|
6840
6845
|
function _respondable(win, topic, message, keepalive, replyHandler) {
|
|
6841
|
-
var
|
|
6846
|
+
var data = {
|
|
6842
6847
|
topic: topic,
|
|
6843
6848
|
message: message,
|
|
6844
6849
|
channelId: ''.concat(v4(), ':').concat(v4()),
|
|
6845
6850
|
keepalive: keepalive
|
|
6846
6851
|
};
|
|
6847
|
-
return postMessage2(win,
|
|
6852
|
+
return postMessage2(win, data, replyHandler);
|
|
6848
6853
|
}
|
|
6849
|
-
function messageListener(
|
|
6850
|
-
var topic =
|
|
6854
|
+
function messageListener(data, responder) {
|
|
6855
|
+
var topic = data.topic, message = data.message, keepalive = data.keepalive;
|
|
6851
6856
|
var topicHandler = topicHandlers[topic];
|
|
6852
6857
|
if (!topicHandler) {
|
|
6853
6858
|
return;
|
|
@@ -6919,12 +6924,12 @@
|
|
|
6919
6924
|
var timeout = setTimeout(function collectResultFramesTimeout() {
|
|
6920
6925
|
reject(err('Axe in frame timed out', node));
|
|
6921
6926
|
}, frameWaitTime);
|
|
6922
|
-
_respondable(win, 'axe.start', parameters, void 0, function(
|
|
6927
|
+
_respondable(win, 'axe.start', parameters, void 0, function(data) {
|
|
6923
6928
|
clearTimeout(timeout);
|
|
6924
|
-
if (
|
|
6925
|
-
resolve(
|
|
6929
|
+
if (data instanceof Error === false) {
|
|
6930
|
+
resolve(data);
|
|
6926
6931
|
} else {
|
|
6927
|
-
reject(
|
|
6932
|
+
reject(data);
|
|
6928
6933
|
}
|
|
6929
6934
|
});
|
|
6930
6935
|
}
|
|
@@ -6943,7 +6948,7 @@
|
|
|
6943
6948
|
function findBy(array, key, value) {
|
|
6944
6949
|
if (Array.isArray(array)) {
|
|
6945
6950
|
return array.find(function(obj) {
|
|
6946
|
-
return _typeof(obj) === 'object' && obj[key] === value;
|
|
6951
|
+
return obj !== null && _typeof(obj) === 'object' && Object.hasOwn(obj, key) && obj[key] === value;
|
|
6947
6952
|
});
|
|
6948
6953
|
}
|
|
6949
6954
|
}
|
|
@@ -7066,8 +7071,8 @@
|
|
|
7066
7071
|
_sendCommandToFrame(frameElement, params, callback, rej);
|
|
7067
7072
|
});
|
|
7068
7073
|
});
|
|
7069
|
-
q.then(function(
|
|
7070
|
-
resolve(merge_results_default(
|
|
7074
|
+
q.then(function(data) {
|
|
7075
|
+
resolve(merge_results_default(data, options));
|
|
7071
7076
|
})['catch'](reject);
|
|
7072
7077
|
}
|
|
7073
7078
|
function _contains(vNode, otherVNode) {
|
|
@@ -7325,14 +7330,6 @@
|
|
|
7325
7330
|
return find_up_virtual_default(get_node_from_tree_default(element), target);
|
|
7326
7331
|
}
|
|
7327
7332
|
var find_up_default = findUp;
|
|
7328
|
-
var import_memoizee = __toModule(require_memoizee());
|
|
7329
|
-
axe._memoizedFns = [];
|
|
7330
|
-
function memoizeImplementation(fn) {
|
|
7331
|
-
var memoized = (0, import_memoizee['default'])(fn);
|
|
7332
|
-
axe._memoizedFns.push(memoized);
|
|
7333
|
-
return memoized;
|
|
7334
|
-
}
|
|
7335
|
-
var memoize_default = memoizeImplementation;
|
|
7336
7333
|
function _rectsOverlap(rect1, rect2) {
|
|
7337
7334
|
return (rect1.left | 0) < (rect2.right | 0) && (rect1.right | 0) > (rect2.left | 0) && (rect1.top | 0) < (rect2.bottom | 0) && (rect1.bottom | 0) > (rect2.top | 0);
|
|
7338
7335
|
}
|
|
@@ -9957,7 +9954,7 @@
|
|
|
9957
9954
|
}, {
|
|
9958
9955
|
hasAccessibleName: true
|
|
9959
9956
|
} ],
|
|
9960
|
-
allowedRoles: [ 'button', 'checkbox', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'scrollbar', 'separator', 'slider', 'switch', 'tab', 'treeitem', 'doc-cover' ]
|
|
9957
|
+
allowedRoles: [ 'button', 'checkbox', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'meter', 'option', 'progressbar', 'radio', 'scrollbar', 'separator', 'slider', 'switch', 'tab', 'treeitem', 'doc-cover' ]
|
|
9961
9958
|
},
|
|
9962
9959
|
usemap: {
|
|
9963
9960
|
matches: '[usemap]',
|
|
@@ -10753,9 +10750,13 @@
|
|
|
10753
10750
|
}
|
|
10754
10751
|
return false;
|
|
10755
10752
|
}
|
|
10756
|
-
var
|
|
10757
|
-
return ''
|
|
10758
|
-
|
|
10753
|
+
var getSectioningElementSelector = function getSectioningElementSelector() {
|
|
10754
|
+
return cache_default.get('sectioningElementSelector', function() {
|
|
10755
|
+
return get_elements_by_content_type_default('sectioning').map(function(nodeName2) {
|
|
10756
|
+
return ''.concat(nodeName2, ':not([role])');
|
|
10757
|
+
}).join(', ') + ' , main:not([role]), [role=article], [role=complementary], [role=main], [role=navigation], [role=region]';
|
|
10758
|
+
});
|
|
10759
|
+
};
|
|
10759
10760
|
function hasAccessibleName(vNode) {
|
|
10760
10761
|
var ariaLabelledby = sanitize_default(arialabelledby_text_default(vNode));
|
|
10761
10762
|
var ariaLabel = sanitize_default(_arialabelText(vNode));
|
|
@@ -10781,7 +10782,7 @@
|
|
|
10781
10782
|
fieldset: 'group',
|
|
10782
10783
|
figure: 'figure',
|
|
10783
10784
|
footer: function footer(vNode) {
|
|
10784
|
-
var sectioningElement = closest_default(vNode,
|
|
10785
|
+
var sectioningElement = closest_default(vNode, getSectioningElementSelector());
|
|
10785
10786
|
return !sectioningElement ? 'contentinfo' : null;
|
|
10786
10787
|
},
|
|
10787
10788
|
form: function form(vNode) {
|
|
@@ -10794,7 +10795,7 @@
|
|
|
10794
10795
|
h5: 'heading',
|
|
10795
10796
|
h6: 'heading',
|
|
10796
10797
|
header: function header(vNode) {
|
|
10797
|
-
var sectioningElement = closest_default(vNode,
|
|
10798
|
+
var sectioningElement = closest_default(vNode, getSectioningElementSelector());
|
|
10798
10799
|
return !sectioningElement ? 'banner' : null;
|
|
10799
10800
|
},
|
|
10800
10801
|
hr: 'separator',
|
|
@@ -12261,22 +12262,26 @@
|
|
|
12261
12262
|
return element instanceof window.Node;
|
|
12262
12263
|
}
|
|
12263
12264
|
var is_node_default = isNode;
|
|
12264
|
-
var
|
|
12265
|
+
var cacheKey = 'color.incompleteData';
|
|
12265
12266
|
var incompleteData = {
|
|
12266
12267
|
set: function set(key, reason) {
|
|
12267
12268
|
if (typeof key !== 'string') {
|
|
12268
12269
|
throw new Error('Incomplete data: key must be a string');
|
|
12269
12270
|
}
|
|
12271
|
+
var data = cache_default.get(cacheKey, function() {
|
|
12272
|
+
return {};
|
|
12273
|
+
});
|
|
12270
12274
|
if (reason) {
|
|
12271
12275
|
data[key] = reason;
|
|
12272
12276
|
}
|
|
12273
12277
|
return data[key];
|
|
12274
12278
|
},
|
|
12275
12279
|
get: function get(key) {
|
|
12276
|
-
|
|
12280
|
+
var data = cache_default.get(cacheKey);
|
|
12281
|
+
return data === null || data === void 0 ? void 0 : data[key];
|
|
12277
12282
|
},
|
|
12278
12283
|
clear: function clear() {
|
|
12279
|
-
|
|
12284
|
+
cache_default.set(cacheKey, {});
|
|
12280
12285
|
}
|
|
12281
12286
|
};
|
|
12282
12287
|
var incomplete_data_default = incompleteData;
|
|
@@ -15873,7 +15878,6 @@
|
|
|
15873
15878
|
return true;
|
|
15874
15879
|
}
|
|
15875
15880
|
var visually_overlaps_default = visuallyOverlaps;
|
|
15876
|
-
var isXHTMLGlobal;
|
|
15877
15881
|
var nodeIndex2 = 0;
|
|
15878
15882
|
var VirtualNode = function(_abstract_virtual_nod) {
|
|
15879
15883
|
_inherits(VirtualNode, _abstract_virtual_nod);
|
|
@@ -15892,10 +15896,7 @@
|
|
|
15892
15896
|
_this4.nodeIndex = nodeIndex2++;
|
|
15893
15897
|
_this4._isHidden = null;
|
|
15894
15898
|
_this4._cache = {};
|
|
15895
|
-
|
|
15896
|
-
isXHTMLGlobal = is_xhtml_default(node.ownerDocument);
|
|
15897
|
-
}
|
|
15898
|
-
_this4._isXHTML = isXHTMLGlobal;
|
|
15899
|
+
_this4._isXHTML = is_xhtml_default(node.ownerDocument);
|
|
15899
15900
|
if (node.nodeName.toLowerCase() === 'input') {
|
|
15900
15901
|
var type2 = node.getAttribute('type');
|
|
15901
15902
|
type2 = _this4._isXHTML ? type2 : (type2 || '').toLowerCase();
|
|
@@ -16060,7 +16061,7 @@
|
|
|
16060
16061
|
} else {
|
|
16061
16062
|
if (exp.id) {
|
|
16062
16063
|
var _selectorMap$idsKey$e;
|
|
16063
|
-
if (!selectorMap[idsKey] || !((_selectorMap$idsKey$e = selectorMap[idsKey][exp.id]) !== null && _selectorMap$idsKey$e !== void 0 && _selectorMap$idsKey$e.length)) {
|
|
16064
|
+
if (!selectorMap[idsKey] || !Object.hasOwn(selectorMap[idsKey], exp.id) || !((_selectorMap$idsKey$e = selectorMap[idsKey][exp.id]) !== null && _selectorMap$idsKey$e !== void 0 && _selectorMap$idsKey$e.length)) {
|
|
16064
16065
|
return;
|
|
16065
16066
|
}
|
|
16066
16067
|
nodes = selectorMap[idsKey][exp.id].filter(function(node) {
|
|
@@ -16112,7 +16113,9 @@
|
|
|
16112
16113
|
});
|
|
16113
16114
|
}
|
|
16114
16115
|
function cacheSelector(key, vNode, map) {
|
|
16115
|
-
map
|
|
16116
|
+
if (!Object.hasOwn(map, key)) {
|
|
16117
|
+
map[key] = [];
|
|
16118
|
+
}
|
|
16116
16119
|
map[key].push(vNode);
|
|
16117
16120
|
}
|
|
16118
16121
|
function cacheNodeSelectors(vNode, selectorMap) {
|
|
@@ -16337,46 +16340,46 @@
|
|
|
16337
16340
|
}
|
|
16338
16341
|
var process_aggregate_default = processAggregate;
|
|
16339
16342
|
var dataRegex = /\$\{\s?data\s?\}/g;
|
|
16340
|
-
function substitute(str,
|
|
16341
|
-
if (typeof
|
|
16342
|
-
return str.replace(dataRegex,
|
|
16343
|
+
function substitute(str, data) {
|
|
16344
|
+
if (typeof data === 'string') {
|
|
16345
|
+
return str.replace(dataRegex, data);
|
|
16343
16346
|
}
|
|
16344
|
-
for (var prop in
|
|
16345
|
-
if (
|
|
16347
|
+
for (var prop in data) {
|
|
16348
|
+
if (data.hasOwnProperty(prop)) {
|
|
16346
16349
|
var regex = new RegExp('\\${\\s?data\\.' + prop + '\\s?}', 'g');
|
|
16347
|
-
var replace = typeof
|
|
16350
|
+
var replace = typeof data[prop] === 'undefined' ? '' : String(data[prop]);
|
|
16348
16351
|
str = str.replace(regex, replace);
|
|
16349
16352
|
}
|
|
16350
16353
|
}
|
|
16351
16354
|
return str;
|
|
16352
16355
|
}
|
|
16353
|
-
function processMessage(message,
|
|
16356
|
+
function processMessage(message, data) {
|
|
16354
16357
|
if (!message) {
|
|
16355
16358
|
return;
|
|
16356
16359
|
}
|
|
16357
|
-
if (Array.isArray(
|
|
16358
|
-
|
|
16360
|
+
if (Array.isArray(data)) {
|
|
16361
|
+
data.values = data.join(', ');
|
|
16359
16362
|
if (typeof message.singular === 'string' && typeof message.plural === 'string') {
|
|
16360
|
-
var str2 =
|
|
16361
|
-
return substitute(str2,
|
|
16363
|
+
var str2 = data.length === 1 ? message.singular : message.plural;
|
|
16364
|
+
return substitute(str2, data);
|
|
16362
16365
|
}
|
|
16363
|
-
return substitute(message,
|
|
16366
|
+
return substitute(message, data);
|
|
16364
16367
|
}
|
|
16365
16368
|
if (typeof message === 'string') {
|
|
16366
|
-
return substitute(message,
|
|
16369
|
+
return substitute(message, data);
|
|
16367
16370
|
}
|
|
16368
|
-
if (typeof
|
|
16369
|
-
var _str = message[
|
|
16370
|
-
return substitute(_str,
|
|
16371
|
+
if (typeof data === 'string') {
|
|
16372
|
+
var _str = message[data];
|
|
16373
|
+
return substitute(_str, data);
|
|
16371
16374
|
}
|
|
16372
16375
|
var str = message['default'] || incompleteFallbackMessage();
|
|
16373
|
-
if (
|
|
16374
|
-
str = message[
|
|
16376
|
+
if (data && data.messageKey && message[data.messageKey]) {
|
|
16377
|
+
str = message[data.messageKey];
|
|
16375
16378
|
}
|
|
16376
|
-
return processMessage(str,
|
|
16379
|
+
return processMessage(str, data);
|
|
16377
16380
|
}
|
|
16378
16381
|
var process_message_default = processMessage;
|
|
16379
|
-
function getCheckMessage(checkId, type2,
|
|
16382
|
+
function getCheckMessage(checkId, type2, data) {
|
|
16380
16383
|
var check = axe._audit.data.checks[checkId];
|
|
16381
16384
|
if (!check) {
|
|
16382
16385
|
throw new Error('Cannot get message for unknown check: '.concat(checkId, '.'));
|
|
@@ -16384,7 +16387,7 @@
|
|
|
16384
16387
|
if (!check.messages[type2]) {
|
|
16385
16388
|
throw new Error('Check "'.concat(checkId, '"" does not have a "').concat(type2, '" message.'));
|
|
16386
16389
|
}
|
|
16387
|
-
return process_message_default(check.messages[type2],
|
|
16390
|
+
return process_message_default(check.messages[type2], data);
|
|
16388
16391
|
}
|
|
16389
16392
|
var get_check_message_default = getCheckMessage;
|
|
16390
16393
|
function getCheckOption(check, ruleID, options) {
|
|
@@ -16800,13 +16803,13 @@
|
|
|
16800
16803
|
throw new Error('axe.utils.getStyleSheetFactory should be invoked with an argument');
|
|
16801
16804
|
}
|
|
16802
16805
|
return function(options) {
|
|
16803
|
-
var
|
|
16806
|
+
var data = options.data, _options$isCrossOrigi = options.isCrossOrigin, isCrossOrigin = _options$isCrossOrigi === void 0 ? false : _options$isCrossOrigi, shadowId = options.shadowId, root = options.root, priority = options.priority, _options$isLink = options.isLink, isLink = _options$isLink === void 0 ? false : _options$isLink;
|
|
16804
16807
|
var style = dynamicDoc.createElement('style');
|
|
16805
16808
|
if (isLink) {
|
|
16806
|
-
var text = dynamicDoc.createTextNode('@import "'.concat(
|
|
16809
|
+
var text = dynamicDoc.createTextNode('@import "'.concat(data.href, '"'));
|
|
16807
16810
|
style.appendChild(text);
|
|
16808
16811
|
} else {
|
|
16809
|
-
style.appendChild(dynamicDoc.createTextNode(
|
|
16812
|
+
style.appendChild(dynamicDoc.createTextNode(data));
|
|
16810
16813
|
}
|
|
16811
16814
|
dynamicDoc.head.appendChild(style);
|
|
16812
16815
|
return {
|
|
@@ -17037,9 +17040,9 @@
|
|
|
17037
17040
|
reject(request.responseText);
|
|
17038
17041
|
});
|
|
17039
17042
|
request.send();
|
|
17040
|
-
}).then(function(
|
|
17043
|
+
}).then(function(data) {
|
|
17041
17044
|
var result = options.convertDataToStylesheet({
|
|
17042
|
-
data:
|
|
17045
|
+
data: data,
|
|
17043
17046
|
isCrossOrigin: isCrossOrigin,
|
|
17044
17047
|
priority: priority,
|
|
17045
17048
|
root: options.rootNode,
|
|
@@ -17383,8 +17386,10 @@
|
|
|
17383
17386
|
retVal.parentShadowId = parentShadowId;
|
|
17384
17387
|
return retVal;
|
|
17385
17388
|
}
|
|
17386
|
-
var recycledLocalVariables = [];
|
|
17387
17389
|
function matchExpressions(domTree, expressions, filter) {
|
|
17390
|
+
var recycledLocalVariables = cache_default.get('qsa.recycledLocalVariables', function() {
|
|
17391
|
+
return [];
|
|
17392
|
+
});
|
|
17388
17393
|
var stack = [];
|
|
17389
17394
|
var vNodes = Array.isArray(domTree) ? domTree : [ domTree ];
|
|
17390
17395
|
var currentLevel = createLocalVariables(vNodes, expressions, null, domTree[0].shadowId, recycledLocalVariables.pop());
|
|
@@ -17512,10 +17517,10 @@
|
|
|
17512
17517
|
function getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet) {
|
|
17513
17518
|
return Array.from(rootNode.children).filter(filerStyleAndLinkAttributesInDocumentFragment).reduce(function(out, node) {
|
|
17514
17519
|
var nodeName2 = node.nodeName.toUpperCase();
|
|
17515
|
-
var
|
|
17520
|
+
var data = nodeName2 === 'STYLE' ? node.textContent : node;
|
|
17516
17521
|
var isLink = nodeName2 === 'LINK';
|
|
17517
17522
|
var stylesheet = convertDataToStylesheet({
|
|
17518
|
-
data:
|
|
17523
|
+
data: data,
|
|
17519
17524
|
isLink: isLink,
|
|
17520
17525
|
root: rootNode
|
|
17521
17526
|
});
|
|
@@ -17691,22 +17696,22 @@
|
|
|
17691
17696
|
return function(check) {
|
|
17692
17697
|
var sourceData = checksData[check.id] || {};
|
|
17693
17698
|
var messages = sourceData.messages || {};
|
|
17694
|
-
var
|
|
17695
|
-
delete
|
|
17699
|
+
var data = Object.assign({}, sourceData);
|
|
17700
|
+
delete data.messages;
|
|
17696
17701
|
if (!rule.reviewOnFail && check.result === void 0) {
|
|
17697
17702
|
if (_typeof(messages.incomplete) === 'object' && !Array.isArray(check.data)) {
|
|
17698
|
-
|
|
17703
|
+
data.message = getIncompleteReason(check.data, messages);
|
|
17699
17704
|
}
|
|
17700
|
-
if (!
|
|
17701
|
-
|
|
17705
|
+
if (!data.message) {
|
|
17706
|
+
data.message = messages.incomplete;
|
|
17702
17707
|
}
|
|
17703
17708
|
} else {
|
|
17704
|
-
|
|
17709
|
+
data.message = check.result === shouldBeTrue ? messages.pass : messages.fail;
|
|
17705
17710
|
}
|
|
17706
|
-
if (typeof
|
|
17707
|
-
|
|
17711
|
+
if (typeof data.message !== 'function') {
|
|
17712
|
+
data.message = process_message_default(data.message, check.data);
|
|
17708
17713
|
}
|
|
17709
|
-
extend_meta_data_default(check,
|
|
17714
|
+
extend_meta_data_default(check, data);
|
|
17710
17715
|
};
|
|
17711
17716
|
}
|
|
17712
17717
|
function publishMetaData(ruleResult) {
|
|
@@ -18323,8 +18328,11 @@
|
|
|
18323
18328
|
if (node.hasAttribute) {
|
|
18324
18329
|
if (node.nodeName.toUpperCase() === 'LABEL' && node.hasAttribute('for')) {
|
|
18325
18330
|
var _id2 = node.getAttribute('for');
|
|
18326
|
-
|
|
18327
|
-
|
|
18331
|
+
if (!idRefs.has(_id2)) {
|
|
18332
|
+
idRefs.set(_id2, [ node ]);
|
|
18333
|
+
} else {
|
|
18334
|
+
idRefs.get(_id2).push(node);
|
|
18335
|
+
}
|
|
18328
18336
|
}
|
|
18329
18337
|
for (var _i27 = 0; _i27 < refAttrs.length; ++_i27) {
|
|
18330
18338
|
var attr = refAttrs[_i27];
|
|
@@ -18332,10 +18340,20 @@
|
|
|
18332
18340
|
if (!attrValue) {
|
|
18333
18341
|
continue;
|
|
18334
18342
|
}
|
|
18335
|
-
var
|
|
18336
|
-
|
|
18337
|
-
|
|
18338
|
-
|
|
18343
|
+
var _iterator13 = _createForOfIteratorHelper(token_list_default(attrValue)), _step13;
|
|
18344
|
+
try {
|
|
18345
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done; ) {
|
|
18346
|
+
var token = _step13.value;
|
|
18347
|
+
if (!idRefs.has(token)) {
|
|
18348
|
+
idRefs.set(token, [ node ]);
|
|
18349
|
+
} else {
|
|
18350
|
+
idRefs.get(token).push(node);
|
|
18351
|
+
}
|
|
18352
|
+
}
|
|
18353
|
+
} catch (err) {
|
|
18354
|
+
_iterator13.e(err);
|
|
18355
|
+
} finally {
|
|
18356
|
+
_iterator13.f();
|
|
18339
18357
|
}
|
|
18340
18358
|
}
|
|
18341
18359
|
}
|
|
@@ -18346,15 +18364,16 @@
|
|
|
18346
18364
|
}
|
|
18347
18365
|
}
|
|
18348
18366
|
function getAccessibleRefs(node) {
|
|
18367
|
+
var _idRefs$get;
|
|
18349
18368
|
node = node.actualNode || node;
|
|
18350
18369
|
var root = get_root_node_default2(node);
|
|
18351
18370
|
root = root.documentElement || root;
|
|
18352
18371
|
var idRefsByRoot = cache_default.get('idRefsByRoot', function() {
|
|
18353
|
-
return new
|
|
18372
|
+
return new Map();
|
|
18354
18373
|
});
|
|
18355
18374
|
var idRefs = idRefsByRoot.get(root);
|
|
18356
18375
|
if (!idRefs) {
|
|
18357
|
-
idRefs =
|
|
18376
|
+
idRefs = new Map();
|
|
18358
18377
|
idRefsByRoot.set(root, idRefs);
|
|
18359
18378
|
var refAttrs = Object.keys(standards_default.ariaAttrs).filter(function(attr) {
|
|
18360
18379
|
var type2 = standards_default.ariaAttrs[attr].type;
|
|
@@ -18362,7 +18381,7 @@
|
|
|
18362
18381
|
});
|
|
18363
18382
|
cacheIdRefs(root, idRefs, refAttrs);
|
|
18364
18383
|
}
|
|
18365
|
-
return idRefs
|
|
18384
|
+
return (_idRefs$get = idRefs.get(node.id)) !== null && _idRefs$get !== void 0 ? _idRefs$get : [];
|
|
18366
18385
|
}
|
|
18367
18386
|
var get_accessible_refs_default = getAccessibleRefs;
|
|
18368
18387
|
function isAriaRoleAllowedOnElement(node, role) {
|
|
@@ -20441,18 +20460,18 @@
|
|
|
20441
20460
|
if (Array.isArray(options[role])) {
|
|
20442
20461
|
allowed = unique_array_default(options[role].concat(allowed));
|
|
20443
20462
|
}
|
|
20444
|
-
var
|
|
20463
|
+
var _iterator14 = _createForOfIteratorHelper(virtualNode.attrNames), _step14;
|
|
20445
20464
|
try {
|
|
20446
|
-
for (
|
|
20447
|
-
var attrName =
|
|
20465
|
+
for (_iterator14.s(); !(_step14 = _iterator14.n()).done; ) {
|
|
20466
|
+
var attrName = _step14.value;
|
|
20448
20467
|
if (validate_attr_default(attrName) && !allowed.includes(attrName)) {
|
|
20449
20468
|
invalid.push(attrName);
|
|
20450
20469
|
}
|
|
20451
20470
|
}
|
|
20452
20471
|
} catch (err) {
|
|
20453
|
-
|
|
20472
|
+
_iterator14.e(err);
|
|
20454
20473
|
} finally {
|
|
20455
|
-
|
|
20474
|
+
_iterator14.f();
|
|
20456
20475
|
}
|
|
20457
20476
|
if (!invalid.length) {
|
|
20458
20477
|
return true;
|
|
@@ -21812,11 +21831,11 @@
|
|
|
21812
21831
|
return fgColor;
|
|
21813
21832
|
}
|
|
21814
21833
|
function findNodeInContexts(contexts, node) {
|
|
21815
|
-
var
|
|
21834
|
+
var _iterator15 = _createForOfIteratorHelper(contexts), _step15;
|
|
21816
21835
|
try {
|
|
21817
|
-
for (
|
|
21836
|
+
for (_iterator15.s(); !(_step15 = _iterator15.n()).done; ) {
|
|
21818
21837
|
var _context$vNode;
|
|
21819
|
-
var context =
|
|
21838
|
+
var context = _step15.value;
|
|
21820
21839
|
if (((_context$vNode = context.vNode) === null || _context$vNode === void 0 ? void 0 : _context$vNode.actualNode) === node) {
|
|
21821
21840
|
return context;
|
|
21822
21841
|
}
|
|
@@ -21826,9 +21845,9 @@
|
|
|
21826
21845
|
}
|
|
21827
21846
|
}
|
|
21828
21847
|
} catch (err) {
|
|
21829
|
-
|
|
21848
|
+
_iterator15.e(err);
|
|
21830
21849
|
} finally {
|
|
21831
|
-
|
|
21850
|
+
_iterator15.f();
|
|
21832
21851
|
}
|
|
21833
21852
|
}
|
|
21834
21853
|
function hasValidContrastRatio(bg, fg, fontSize, isBold) {
|
|
@@ -22724,8 +22743,8 @@
|
|
|
22724
22743
|
return (value || '').trim() !== '';
|
|
22725
22744
|
}
|
|
22726
22745
|
function hasLangEvaluate(node, options, virtualNode) {
|
|
22727
|
-
var
|
|
22728
|
-
if (options.attributes.includes('xml:lang') && options.attributes.includes('lang') && hasValue(virtualNode.attr('xml:lang')) && !hasValue(virtualNode.attr('lang')) && !
|
|
22746
|
+
var xhtml = typeof document !== 'undefined' ? is_xhtml_default(document) : false;
|
|
22747
|
+
if (options.attributes.includes('xml:lang') && options.attributes.includes('lang') && hasValue(virtualNode.attr('xml:lang')) && !hasValue(virtualNode.attr('lang')) && !xhtml) {
|
|
22729
22748
|
this.data({
|
|
22730
22749
|
messageKey: 'noXHTML'
|
|
22731
22750
|
});
|
|
@@ -23283,10 +23302,10 @@
|
|
|
23283
23302
|
var minOffset = (options === null || options === void 0 ? void 0 : options.minOffset) || 24;
|
|
23284
23303
|
var closeNeighbors = [];
|
|
23285
23304
|
var closestOffset = minOffset;
|
|
23286
|
-
var
|
|
23305
|
+
var _iterator16 = _createForOfIteratorHelper(_findNearbyElms(vNode, minOffset)), _step16;
|
|
23287
23306
|
try {
|
|
23288
|
-
for (
|
|
23289
|
-
var vNeighbor =
|
|
23307
|
+
for (_iterator16.s(); !(_step16 = _iterator16.n()).done; ) {
|
|
23308
|
+
var vNeighbor = _step16.value;
|
|
23290
23309
|
if (get_role_type_default(vNeighbor) !== 'widget' || !_isFocusable(vNeighbor)) {
|
|
23291
23310
|
continue;
|
|
23292
23311
|
}
|
|
@@ -23298,9 +23317,9 @@
|
|
|
23298
23317
|
closeNeighbors.push(vNeighbor);
|
|
23299
23318
|
}
|
|
23300
23319
|
} catch (err) {
|
|
23301
|
-
|
|
23320
|
+
_iterator16.e(err);
|
|
23302
23321
|
} finally {
|
|
23303
|
-
|
|
23322
|
+
_iterator16.f();
|
|
23304
23323
|
}
|
|
23305
23324
|
if (closeNeighbors.length === 0) {
|
|
23306
23325
|
this.data({
|
|
@@ -23388,10 +23407,10 @@
|
|
|
23388
23407
|
function filterByElmsOverlap(vNode, nearbyElms) {
|
|
23389
23408
|
var fullyObscuringElms = [];
|
|
23390
23409
|
var partialObscuringElms = [];
|
|
23391
|
-
var
|
|
23410
|
+
var _iterator17 = _createForOfIteratorHelper(nearbyElms), _step17;
|
|
23392
23411
|
try {
|
|
23393
|
-
for (
|
|
23394
|
-
var vNeighbor =
|
|
23412
|
+
for (_iterator17.s(); !(_step17 = _iterator17.n()).done; ) {
|
|
23413
|
+
var vNeighbor = _step17.value;
|
|
23395
23414
|
if (!isDescendantNotInTabOrder(vNode, vNeighbor) && _hasVisualOverlap(vNode, vNeighbor) && getCssPointerEvents(vNeighbor) !== 'none') {
|
|
23396
23415
|
if (isEnclosedRect(vNode, vNeighbor)) {
|
|
23397
23416
|
fullyObscuringElms.push(vNeighbor);
|
|
@@ -23401,9 +23420,9 @@
|
|
|
23401
23420
|
}
|
|
23402
23421
|
}
|
|
23403
23422
|
} catch (err) {
|
|
23404
|
-
|
|
23423
|
+
_iterator17.e(err);
|
|
23405
23424
|
} finally {
|
|
23406
|
-
|
|
23425
|
+
_iterator17.f();
|
|
23407
23426
|
}
|
|
23408
23427
|
return {
|
|
23409
23428
|
fullyObscuringElms: fullyObscuringElms,
|
|
@@ -23624,12 +23643,12 @@
|
|
|
23624
23643
|
return 'continue';
|
|
23625
23644
|
}
|
|
23626
23645
|
var sameNameResults = incompleteResults.filter(function(_ref129, resultNum) {
|
|
23627
|
-
var
|
|
23628
|
-
return
|
|
23646
|
+
var data = _ref129.data;
|
|
23647
|
+
return data.name === name && resultNum !== index;
|
|
23629
23648
|
});
|
|
23630
23649
|
var isSameUrl = sameNameResults.every(function(_ref130) {
|
|
23631
|
-
var
|
|
23632
|
-
return isIdenticalObject(
|
|
23650
|
+
var data = _ref130.data;
|
|
23651
|
+
return isIdenticalObject(data.urlProps, urlProps);
|
|
23633
23652
|
});
|
|
23634
23653
|
if (sameNameResults.length && !isSameUrl) {
|
|
23635
23654
|
currentResult.result = void 0;
|
|
@@ -24159,19 +24178,19 @@
|
|
|
24159
24178
|
return;
|
|
24160
24179
|
}
|
|
24161
24180
|
var frameAncestry = r.node.ancestry.slice(0, -1);
|
|
24162
|
-
var
|
|
24181
|
+
var _iterator18 = _createForOfIteratorHelper(iframeResults), _step18;
|
|
24163
24182
|
try {
|
|
24164
|
-
for (
|
|
24165
|
-
var iframeResult =
|
|
24183
|
+
for (_iterator18.s(); !(_step18 = _iterator18.n()).done; ) {
|
|
24184
|
+
var iframeResult = _step18.value;
|
|
24166
24185
|
if (match_ancestry_default(frameAncestry, iframeResult.node.ancestry)) {
|
|
24167
24186
|
r.result = iframeResult.result;
|
|
24168
24187
|
break;
|
|
24169
24188
|
}
|
|
24170
24189
|
}
|
|
24171
24190
|
} catch (err) {
|
|
24172
|
-
|
|
24191
|
+
_iterator18.e(err);
|
|
24173
24192
|
} finally {
|
|
24174
|
-
|
|
24193
|
+
_iterator18.f();
|
|
24175
24194
|
}
|
|
24176
24195
|
});
|
|
24177
24196
|
iframeResults.forEach(function(r) {
|
|
@@ -24182,7 +24201,6 @@
|
|
|
24182
24201
|
return results;
|
|
24183
24202
|
}
|
|
24184
24203
|
var region_after_default = regionAfter;
|
|
24185
|
-
var landmarkRoles2 = get_aria_roles_by_type_default('landmark');
|
|
24186
24204
|
var implicitAriaLiveRoles = [ 'alert', 'log', 'status' ];
|
|
24187
24205
|
function regionEvaluate(node, options, virtualNode) {
|
|
24188
24206
|
this.data({
|
|
@@ -24233,6 +24251,7 @@
|
|
|
24233
24251
|
var node = virtualNode.actualNode;
|
|
24234
24252
|
var role = get_role_default(virtualNode);
|
|
24235
24253
|
var ariaLive = (node.getAttribute('aria-live') || '').toLowerCase().trim();
|
|
24254
|
+
var landmarkRoles2 = get_aria_roles_by_type_default('landmark');
|
|
24236
24255
|
if ([ 'assertive', 'polite' ].includes(ariaLive) || implicitAriaLiveRoles.includes(role)) {
|
|
24237
24256
|
return true;
|
|
24238
24257
|
}
|
|
@@ -24343,18 +24362,18 @@
|
|
|
24343
24362
|
if (!noImportant && node.style.getPropertyPriority(cssProperty) !== 'important' || multiLineOnly && !_isMultiline(node)) {
|
|
24344
24363
|
return true;
|
|
24345
24364
|
}
|
|
24346
|
-
var
|
|
24365
|
+
var data = {};
|
|
24347
24366
|
if (typeof minValue === 'number') {
|
|
24348
|
-
|
|
24367
|
+
data.minValue = minValue;
|
|
24349
24368
|
}
|
|
24350
24369
|
if (typeof maxValue === 'number') {
|
|
24351
|
-
|
|
24370
|
+
data.maxValue = maxValue;
|
|
24352
24371
|
}
|
|
24353
24372
|
var declaredPropValue = node.style.getPropertyValue(cssProperty);
|
|
24354
24373
|
if ([ 'inherit', 'unset', 'revert', 'revert-layer' ].includes(declaredPropValue)) {
|
|
24355
24374
|
this.data(_extends({
|
|
24356
24375
|
value: declaredPropValue
|
|
24357
|
-
},
|
|
24376
|
+
}, data));
|
|
24358
24377
|
return true;
|
|
24359
24378
|
}
|
|
24360
24379
|
var value = getNumberValue(node, {
|
|
@@ -24364,7 +24383,7 @@
|
|
|
24364
24383
|
});
|
|
24365
24384
|
this.data(_extends({
|
|
24366
24385
|
value: value
|
|
24367
|
-
},
|
|
24386
|
+
}, data));
|
|
24368
24387
|
if (typeof value !== 'number') {
|
|
24369
24388
|
return void 0;
|
|
24370
24389
|
}
|
|
@@ -24977,7 +24996,7 @@
|
|
|
24977
24996
|
}
|
|
24978
24997
|
function isLandmarkVirtual(virtualNode2) {
|
|
24979
24998
|
var actualNode = virtualNode2.actualNode;
|
|
24980
|
-
var
|
|
24999
|
+
var landmarkRoles2 = get_aria_roles_by_type_default('landmark');
|
|
24981
25000
|
var role = get_role_default(actualNode);
|
|
24982
25001
|
if (!role) {
|
|
24983
25002
|
return false;
|
|
@@ -24990,7 +25009,7 @@
|
|
|
24990
25009
|
var accessibleText2 = accessible_text_virtual_default(virtualNode2);
|
|
24991
25010
|
return !!accessibleText2;
|
|
24992
25011
|
}
|
|
24993
|
-
return
|
|
25012
|
+
return landmarkRoles2.indexOf(role) >= 0 || role === 'region';
|
|
24994
25013
|
}
|
|
24995
25014
|
return isLandmarkVirtual(virtualNode) && _isVisibleToScreenReaders(node);
|
|
24996
25015
|
}
|
|
@@ -26041,10 +26060,10 @@
|
|
|
26041
26060
|
value: function setAllowedOrigins(allowedOrigins) {
|
|
26042
26061
|
var defaultOrigin = getDefaultOrigin();
|
|
26043
26062
|
this.allowedOrigins = [];
|
|
26044
|
-
var
|
|
26063
|
+
var _iterator19 = _createForOfIteratorHelper(allowedOrigins), _step19;
|
|
26045
26064
|
try {
|
|
26046
|
-
for (
|
|
26047
|
-
var origin =
|
|
26065
|
+
for (_iterator19.s(); !(_step19 = _iterator19.n()).done; ) {
|
|
26066
|
+
var origin = _step19.value;
|
|
26048
26067
|
if (origin === constants_default.allOrigins) {
|
|
26049
26068
|
this.allowedOrigins = [ '*' ];
|
|
26050
26069
|
return;
|
|
@@ -26055,9 +26074,9 @@
|
|
|
26055
26074
|
}
|
|
26056
26075
|
}
|
|
26057
26076
|
} catch (err) {
|
|
26058
|
-
|
|
26077
|
+
_iterator19.e(err);
|
|
26059
26078
|
} finally {
|
|
26060
|
-
|
|
26079
|
+
_iterator19.f();
|
|
26061
26080
|
}
|
|
26062
26081
|
}
|
|
26063
26082
|
}, {
|
|
@@ -26424,12 +26443,12 @@
|
|
|
26424
26443
|
q.defer(function(res, rej) {
|
|
26425
26444
|
audit.run(context, options, res, rej);
|
|
26426
26445
|
});
|
|
26427
|
-
q.then(function(
|
|
26446
|
+
q.then(function(data) {
|
|
26428
26447
|
try {
|
|
26429
26448
|
if (options.performanceTimer) {
|
|
26430
26449
|
performance_timer_default.auditEnd();
|
|
26431
26450
|
}
|
|
26432
|
-
var results = merge_results_default(
|
|
26451
|
+
var results = merge_results_default(data.map(function(results2) {
|
|
26433
26452
|
return {
|
|
26434
26453
|
results: results2
|
|
26435
26454
|
};
|
|
@@ -26455,7 +26474,7 @@
|
|
|
26455
26474
|
});
|
|
26456
26475
|
}
|
|
26457
26476
|
var run_rules_default = runRules;
|
|
26458
|
-
function runCommand(
|
|
26477
|
+
function runCommand(data, keepalive, callback) {
|
|
26459
26478
|
var resolve = callback;
|
|
26460
26479
|
var reject = function reject2(err2) {
|
|
26461
26480
|
if (err2 instanceof Error === false) {
|
|
@@ -26463,12 +26482,12 @@
|
|
|
26463
26482
|
}
|
|
26464
26483
|
callback(err2);
|
|
26465
26484
|
};
|
|
26466
|
-
var context =
|
|
26485
|
+
var context = data && data.context || {};
|
|
26467
26486
|
if (context.hasOwnProperty('include') && !context.include.length) {
|
|
26468
26487
|
context.include = [ document ];
|
|
26469
26488
|
}
|
|
26470
|
-
var options =
|
|
26471
|
-
switch (
|
|
26489
|
+
var options = data && data.options || {};
|
|
26490
|
+
switch (data.command) {
|
|
26472
26491
|
case 'rules':
|
|
26473
26492
|
return run_rules_default(context, options, function(results, cleanup3) {
|
|
26474
26493
|
resolve(results);
|
|
@@ -26479,14 +26498,14 @@
|
|
|
26479
26498
|
return cleanup_default(resolve, reject);
|
|
26480
26499
|
|
|
26481
26500
|
default:
|
|
26482
|
-
if (axe._audit && axe._audit.commands && axe._audit.commands[
|
|
26483
|
-
return axe._audit.commands[
|
|
26501
|
+
if (axe._audit && axe._audit.commands && axe._audit.commands[data.command]) {
|
|
26502
|
+
return axe._audit.commands[data.command](data, callback);
|
|
26484
26503
|
}
|
|
26485
26504
|
}
|
|
26486
26505
|
}
|
|
26487
26506
|
if (window.top !== window) {
|
|
26488
26507
|
_respondable.subscribe('axe.start', runCommand);
|
|
26489
|
-
_respondable.subscribe('axe.ping', function(
|
|
26508
|
+
_respondable.subscribe('axe.ping', function(data, keepalive, respond) {
|
|
26490
26509
|
respond({
|
|
26491
26510
|
axe: true
|
|
26492
26511
|
});
|
|
@@ -26766,10 +26785,10 @@
|
|
|
26766
26785
|
}
|
|
26767
26786
|
function setFrameSpec(partialResults) {
|
|
26768
26787
|
var frameStack = [];
|
|
26769
|
-
var
|
|
26788
|
+
var _iterator20 = _createForOfIteratorHelper(partialResults), _step20;
|
|
26770
26789
|
try {
|
|
26771
|
-
for (
|
|
26772
|
-
var partialResult =
|
|
26790
|
+
for (_iterator20.s(); !(_step20 = _iterator20.n()).done; ) {
|
|
26791
|
+
var partialResult = _step20.value;
|
|
26773
26792
|
var frameSpec = frameStack.shift();
|
|
26774
26793
|
if (!partialResult) {
|
|
26775
26794
|
continue;
|
|
@@ -26779,9 +26798,9 @@
|
|
|
26779
26798
|
frameStack.unshift.apply(frameStack, _toConsumableArray(frameSpecs));
|
|
26780
26799
|
}
|
|
26781
26800
|
} catch (err) {
|
|
26782
|
-
|
|
26801
|
+
_iterator20.e(err);
|
|
26783
26802
|
} finally {
|
|
26784
|
-
|
|
26803
|
+
_iterator20.f();
|
|
26785
26804
|
}
|
|
26786
26805
|
}
|
|
26787
26806
|
function getMergedFrameSpecs(_ref146) {
|