axe-core 4.7.1 → 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/README.md +4 -0
- package/axe.js +1644 -1618
- package/axe.min.js +2 -2
- package/package.json +2 -2
- package/sri-history.json +357 -349
package/axe.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! axe v4.7.
|
|
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.
|
|
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;
|
|
@@ -2986,640 +2365,1261 @@
|
|
|
2986
2365
|
args = currentArgs;
|
|
2987
2366
|
currentCallback = currentContext = currentArgs = null;
|
|
2988
2367
|
nextTick(function() {
|
|
2989
|
-
var
|
|
2368
|
+
var data;
|
|
2990
2369
|
if (hasOwnProperty.call(cache2, id)) {
|
|
2991
|
-
|
|
2370
|
+
data = cache2[id];
|
|
2992
2371
|
conf.emit('getasync', id, args, context);
|
|
2993
|
-
apply.call(cb,
|
|
2372
|
+
apply.call(cb, data.context, data.args);
|
|
2994
2373
|
} else {
|
|
2995
2374
|
currentCallback = cb;
|
|
2996
2375
|
currentContext = context;
|
|
2997
2376
|
currentArgs = args;
|
|
2998
2377
|
base.apply(context, args);
|
|
2999
2378
|
}
|
|
3000
|
-
});
|
|
3001
|
-
});
|
|
3002
|
-
conf.original = function() {
|
|
3003
|
-
var args, cb, origCb, result;
|
|
3004
|
-
if (!currentCallback) {
|
|
3005
|
-
return apply.call(original, this, arguments);
|
|
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
|
+
}
|
|
2497
|
+
};
|
|
2498
|
+
});
|
|
2499
|
+
var require_validate_stringifiable_value = __commonJS(function(exports, module) {
|
|
2500
|
+
'use strict';
|
|
2501
|
+
var ensureValue = require_valid_value();
|
|
2502
|
+
var stringifiable = require_validate_stringifiable();
|
|
2503
|
+
module.exports = function(value) {
|
|
2504
|
+
return stringifiable(ensureValue(value));
|
|
2505
|
+
};
|
|
2506
|
+
});
|
|
2507
|
+
var require_safe_to_string = __commonJS(function(exports, module) {
|
|
2508
|
+
'use strict';
|
|
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>';
|
|
2518
|
+
}
|
|
2519
|
+
};
|
|
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');
|
|
2561
|
+
}
|
|
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);
|
|
2568
|
+
return;
|
|
2569
|
+
}
|
|
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.');
|
|
2576
|
+
}
|
|
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';
|
|
3006
2596
|
}
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
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);
|
|
3013
2606
|
}
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
if (!cb2) {
|
|
3018
|
-
return void 0;
|
|
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');
|
|
3019
2610
|
}
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
} else {
|
|
3025
|
-
cache2[id] = {
|
|
3026
|
-
context: this,
|
|
3027
|
-
args: args2
|
|
3028
|
-
};
|
|
3029
|
-
conf.emit('setasync', id, typeof cb2 === 'function' ? 1 : cb2.length);
|
|
3030
|
-
}
|
|
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');
|
|
3031
2615
|
}
|
|
3032
|
-
if (typeof
|
|
3033
|
-
|
|
3034
|
-
} else {
|
|
3035
|
-
cb2.forEach(function(cb3) {
|
|
3036
|
-
result = apply.call(cb3, this, args2);
|
|
3037
|
-
}, this);
|
|
2616
|
+
if (typeof promise['finally'] !== 'function') {
|
|
2617
|
+
throw new Error('Memoizee error: Retrieved promise does not implement \'finally\' in \'done:finally\' mode');
|
|
3038
2618
|
}
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
origCb = currentCallback;
|
|
3042
|
-
currentCallback = currentContext = currentArgs = null;
|
|
3043
|
-
args.push(cb);
|
|
3044
|
-
result = apply.call(original, this, args);
|
|
3045
|
-
cb.cb = origCb;
|
|
3046
|
-
currentCallback = cb;
|
|
3047
|
-
return result;
|
|
3048
|
-
};
|
|
3049
|
-
conf.on('set', function(id) {
|
|
3050
|
-
if (!currentCallback) {
|
|
3051
|
-
conf['delete'](id);
|
|
3052
|
-
return;
|
|
2619
|
+
promise.done(onSuccess);
|
|
2620
|
+
promise['finally'](onFailure);
|
|
3053
2621
|
}
|
|
2622
|
+
});
|
|
2623
|
+
conf.on('get', function(id, args, context) {
|
|
2624
|
+
var promise;
|
|
3054
2625
|
if (waiting[id]) {
|
|
3055
|
-
|
|
3056
|
-
|
|
2626
|
+
++waiting[id];
|
|
2627
|
+
return;
|
|
2628
|
+
}
|
|
2629
|
+
promise = promises[id];
|
|
2630
|
+
var emit = function emit() {
|
|
2631
|
+
conf.emit('getasync', id, args, context);
|
|
2632
|
+
};
|
|
2633
|
+
if (isPromise(promise)) {
|
|
2634
|
+
if (typeof promise.done === 'function') {
|
|
2635
|
+
promise.done(emit);
|
|
3057
2636
|
} else {
|
|
3058
|
-
|
|
2637
|
+
promise.then(function() {
|
|
2638
|
+
nextTick(emit);
|
|
2639
|
+
});
|
|
3059
2640
|
}
|
|
3060
2641
|
} else {
|
|
3061
|
-
|
|
2642
|
+
emit();
|
|
3062
2643
|
}
|
|
3063
|
-
delete currentCallback.cb;
|
|
3064
|
-
currentCallback.id = id;
|
|
3065
|
-
currentCallback = null;
|
|
3066
2644
|
});
|
|
3067
2645
|
conf.on('delete', function(id) {
|
|
3068
|
-
|
|
3069
|
-
if (
|
|
2646
|
+
delete promises[id];
|
|
2647
|
+
if (waiting[id]) {
|
|
2648
|
+
delete waiting[id];
|
|
3070
2649
|
return;
|
|
3071
2650
|
}
|
|
3072
|
-
if (!cache2
|
|
2651
|
+
if (!hasOwnProperty.call(cache2, id)) {
|
|
3073
2652
|
return;
|
|
3074
2653
|
}
|
|
3075
|
-
result = cache2[id];
|
|
2654
|
+
var result = cache2[id];
|
|
3076
2655
|
delete cache2[id];
|
|
3077
|
-
conf.emit('deleteasync', id,
|
|
2656
|
+
conf.emit('deleteasync', id, [ result ]);
|
|
3078
2657
|
});
|
|
3079
2658
|
conf.on('clear', function() {
|
|
3080
2659
|
var oldCache = cache2;
|
|
3081
2660
|
cache2 = create(null);
|
|
3082
|
-
|
|
3083
|
-
|
|
2661
|
+
waiting = create(null);
|
|
2662
|
+
promises = create(null);
|
|
2663
|
+
conf.emit('clearasync', objectMap(oldCache, function(data) {
|
|
2664
|
+
return [ data ];
|
|
3084
2665
|
}));
|
|
3085
2666
|
});
|
|
3086
2667
|
};
|
|
3087
2668
|
});
|
|
3088
|
-
var
|
|
2669
|
+
var require_dispose = __commonJS(function() {
|
|
3089
2670
|
'use strict';
|
|
3090
|
-
var
|
|
3091
|
-
var
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
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;
|
|
2688
|
+
}
|
|
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
|
+
});
|
|
3096
2696
|
});
|
|
3097
|
-
return set2;
|
|
3098
2697
|
};
|
|
3099
2698
|
});
|
|
3100
|
-
var
|
|
2699
|
+
var require_max_timeout = __commonJS(function(exports, module) {
|
|
3101
2700
|
'use strict';
|
|
3102
|
-
module.exports =
|
|
3103
|
-
|
|
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');
|
|
2711
|
+
}
|
|
2712
|
+
return value;
|
|
3104
2713
|
};
|
|
3105
2714
|
});
|
|
3106
|
-
var
|
|
2715
|
+
var require_max_age = __commonJS(function() {
|
|
3107
2716
|
'use strict';
|
|
3108
|
-
var
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
2717
|
+
var aFrom = require_from();
|
|
2718
|
+
var forEach = require_for_each();
|
|
2719
|
+
var nextTick = require_next_tick();
|
|
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;
|
|
2726
|
+
var create = Object.create;
|
|
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();
|
|
2741
|
+
}
|
|
2742
|
+
if (!preFetchTimeouts) {
|
|
2743
|
+
return;
|
|
2744
|
+
}
|
|
2745
|
+
if (preFetchTimeouts[id]) {
|
|
2746
|
+
if (preFetchTimeouts[id] !== 'nextTick') {
|
|
2747
|
+
clearTimeout(preFetchTimeouts[id]);
|
|
2748
|
+
}
|
|
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) {
|
|
2761
|
+
return;
|
|
2762
|
+
}
|
|
2763
|
+
if (preFetchTimeouts[id] !== 'nextTick') {
|
|
2764
|
+
clearTimeout(preFetchTimeouts[id]);
|
|
2765
|
+
}
|
|
2766
|
+
delete preFetchTimeouts[id];
|
|
2767
|
+
});
|
|
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);
|
|
2773
|
+
}
|
|
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
|
+
});
|
|
3113
2804
|
}
|
|
3114
|
-
return String(stringifiable);
|
|
3115
|
-
} catch (e) {
|
|
3116
|
-
throw new TypeError('Passed argument cannot be stringifed');
|
|
3117
2805
|
}
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
var isCallable = require_is_callable();
|
|
3131
|
-
module.exports = function(value) {
|
|
3132
|
-
try {
|
|
3133
|
-
if (value && isCallable(value.toString)) {
|
|
3134
|
-
return value.toString();
|
|
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);
|
|
2815
|
+
}
|
|
2816
|
+
});
|
|
2817
|
+
preFetchTimeouts = {};
|
|
3135
2818
|
}
|
|
3136
|
-
return String(value);
|
|
3137
|
-
} catch (e) {
|
|
3138
|
-
return '<Non-coercible to string value>';
|
|
3139
|
-
}
|
|
3140
|
-
};
|
|
3141
|
-
});
|
|
3142
|
-
var require_to_short_string_representation = __commonJS(function(exports, module) {
|
|
3143
|
-
'use strict';
|
|
3144
|
-
var safeToString = require_safe_to_string();
|
|
3145
|
-
var reNewLine = /[\n\r\u2028\u2029]/g;
|
|
3146
|
-
module.exports = function(value) {
|
|
3147
|
-
var string = safeToString(value);
|
|
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
2819
|
});
|
|
3154
|
-
return string;
|
|
3155
2820
|
};
|
|
3156
2821
|
});
|
|
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() {
|
|
2822
|
+
var require_lru_queue = __commonJS(function(exports, module) {
|
|
3165
2823
|
'use strict';
|
|
3166
|
-
var
|
|
3167
|
-
var primitiveSet = require_primitive_set();
|
|
3168
|
-
var ensureString = require_validate_stringifiable_value();
|
|
3169
|
-
var toShortString = require_to_short_string_representation();
|
|
3170
|
-
var isPromise = require_is_promise();
|
|
3171
|
-
var nextTick = require_next_tick();
|
|
2824
|
+
var toPosInt = require_to_pos_integer();
|
|
3172
2825
|
var create = Object.create;
|
|
3173
|
-
var
|
|
3174
|
-
|
|
3175
|
-
var
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
}
|
|
3191
|
-
waiting[id] = 1;
|
|
3192
|
-
promises[id] = promise;
|
|
3193
|
-
var onSuccess = function onSuccess(result) {
|
|
3194
|
-
var count = waiting[id];
|
|
3195
|
-
if (isFailed) {
|
|
3196
|
-
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.');
|
|
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;
|
|
3197
2843
|
}
|
|
3198
|
-
|
|
2844
|
+
delete queue2[oldIndex];
|
|
2845
|
+
if (base !== oldIndex) {
|
|
3199
2846
|
return;
|
|
3200
2847
|
}
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
conf.emit('setasync', id, count);
|
|
3204
|
-
};
|
|
3205
|
-
var onFailure = function onFailure() {
|
|
3206
|
-
isFailed = true;
|
|
3207
|
-
if (!waiting[id]) {
|
|
3208
|
-
return;
|
|
2848
|
+
while (!hasOwnProperty2.call(queue2, ++base)) {
|
|
2849
|
+
continue;
|
|
3209
2850
|
}
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
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);
|
|
2851
|
+
},
|
|
2852
|
+
delete: del = function del(id) {
|
|
2853
|
+
var oldIndex = map[id];
|
|
2854
|
+
if (!oldIndex) {
|
|
2855
|
+
return;
|
|
3227
2856
|
}
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
2857
|
+
delete queue2[oldIndex];
|
|
2858
|
+
delete map[id];
|
|
2859
|
+
--size;
|
|
2860
|
+
if (base !== oldIndex) {
|
|
2861
|
+
return;
|
|
3231
2862
|
}
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
2863
|
+
if (!size) {
|
|
2864
|
+
index = 0;
|
|
2865
|
+
base = 1;
|
|
2866
|
+
return;
|
|
3236
2867
|
}
|
|
3237
|
-
|
|
3238
|
-
|
|
2868
|
+
while (!hasOwnProperty2.call(queue2, ++base)) {
|
|
2869
|
+
continue;
|
|
3239
2870
|
}
|
|
3240
|
-
|
|
3241
|
-
|
|
2871
|
+
},
|
|
2872
|
+
clear: function clear() {
|
|
2873
|
+
size = 0;
|
|
2874
|
+
base = 1;
|
|
2875
|
+
queue2 = create(null);
|
|
2876
|
+
map = create(null);
|
|
2877
|
+
index = 0;
|
|
3242
2878
|
}
|
|
3243
|
-
}
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
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) {
|
|
3248
2898
|
return;
|
|
3249
2899
|
}
|
|
3250
|
-
|
|
3251
|
-
var emit = function emit() {
|
|
3252
|
-
conf.emit('getasync', id, args, context);
|
|
3253
|
-
};
|
|
3254
|
-
if (isPromise(promise)) {
|
|
3255
|
-
if (typeof promise.done === 'function') {
|
|
3256
|
-
promise.done(emit);
|
|
3257
|
-
} else {
|
|
3258
|
-
promise.then(function() {
|
|
3259
|
-
nextTick(emit);
|
|
3260
|
-
});
|
|
3261
|
-
}
|
|
3262
|
-
} else {
|
|
3263
|
-
emit();
|
|
3264
|
-
}
|
|
2900
|
+
conf['delete'](id);
|
|
3265
2901
|
});
|
|
3266
|
-
conf.on('
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
2902
|
+
conf.on('get' + postfix, hit);
|
|
2903
|
+
conf.on('delete' + postfix, queue2['delete']);
|
|
2904
|
+
conf.on('clear' + postfix, queue2.clear);
|
|
2905
|
+
};
|
|
2906
|
+
});
|
|
2907
|
+
var require_ref_counter = __commonJS(function() {
|
|
2908
|
+
'use strict';
|
|
2909
|
+
var d2 = require_d();
|
|
2910
|
+
var extensions = require_registered_extensions();
|
|
2911
|
+
var create = Object.create;
|
|
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) {
|
|
3276
2924
|
delete cache2[id];
|
|
3277
|
-
conf.emit('deleteasync', id, [ result ]);
|
|
3278
2925
|
});
|
|
3279
|
-
conf.on('clear', function() {
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
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
|
+
})
|
|
3287
2954
|
});
|
|
3288
2955
|
};
|
|
3289
2956
|
});
|
|
3290
|
-
var
|
|
2957
|
+
var require_memoizee = __commonJS(function(exports, module) {
|
|
3291
2958
|
'use strict';
|
|
3292
|
-
var
|
|
3293
|
-
var
|
|
3294
|
-
var
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
})
|
|
3307
|
-
|
|
3308
|
-
|
|
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
|
+
}
|
|
3309
2981
|
}
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
}
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
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);
|
|
3318
3001
|
};
|
|
3319
3002
|
});
|
|
3320
|
-
var
|
|
3321
|
-
'use strict';
|
|
3322
|
-
module.exports = 2147483647;
|
|
3323
|
-
});
|
|
3324
|
-
var require_valid_timeout = __commonJS(function(exports, module) {
|
|
3003
|
+
var require_utils = __commonJS(function(exports) {
|
|
3325
3004
|
'use strict';
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
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
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
i++;
|
|
3332
3044
|
}
|
|
3333
|
-
return
|
|
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++;
|
|
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
|
|
3098
|
+
};
|
|
3099
|
+
exports.strReplacementsRev = {
|
|
3100
|
+
'\n': '\\n',
|
|
3101
|
+
'\r': '\\r',
|
|
3102
|
+
'\t': '\\t',
|
|
3103
|
+
'\f': '\\f',
|
|
3104
|
+
'\v': '\\v'
|
|
3105
|
+
};
|
|
3106
|
+
exports.singleQuoteEscapeChars = {
|
|
3107
|
+
n: '\n',
|
|
3108
|
+
r: '\r',
|
|
3109
|
+
t: '\t',
|
|
3110
|
+
f: '\f',
|
|
3111
|
+
'\\': '\\',
|
|
3112
|
+
'\'': '\''
|
|
3113
|
+
};
|
|
3114
|
+
exports.doubleQuotesEscapeChars = {
|
|
3115
|
+
n: '\n',
|
|
3116
|
+
r: '\r',
|
|
3117
|
+
t: '\t',
|
|
3118
|
+
f: '\f',
|
|
3119
|
+
'\\': '\\',
|
|
3120
|
+
'"': '"'
|
|
3334
3121
|
};
|
|
3335
3122
|
});
|
|
3336
|
-
var
|
|
3123
|
+
var require_parser_context = __commonJS(function(exports) {
|
|
3337
3124
|
'use strict';
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
var
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
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;
|
|
3168
|
+
}
|
|
3169
|
+
pos++;
|
|
3170
|
+
chr = str.charAt(pos);
|
|
3171
|
+
}
|
|
3172
|
+
return result;
|
|
3353
3173
|
}
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
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
|
+
}
|
|
3206
|
+
} else {
|
|
3207
|
+
return result;
|
|
3208
|
+
}
|
|
3209
|
+
pos++;
|
|
3210
|
+
chr = str.charAt(pos);
|
|
3362
3211
|
}
|
|
3363
|
-
|
|
3364
|
-
|
|
3212
|
+
return result;
|
|
3213
|
+
}
|
|
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);
|
|
3365
3221
|
}
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3222
|
+
return result;
|
|
3223
|
+
}
|
|
3224
|
+
function parse3() {
|
|
3225
|
+
var res = parseSelector();
|
|
3226
|
+
if (pos < l) {
|
|
3227
|
+
throw Error('Rule expected but "' + str.charAt(pos) + '" found.');
|
|
3370
3228
|
}
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3229
|
+
return res;
|
|
3230
|
+
}
|
|
3231
|
+
function parseSelector() {
|
|
3232
|
+
var selector = parseSingleSelector();
|
|
3233
|
+
if (!selector) {
|
|
3234
|
+
return null;
|
|
3376
3235
|
}
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
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
|
+
};
|
|
3246
|
+
}
|
|
3247
|
+
selector = parseSingleSelector();
|
|
3248
|
+
if (!selector) {
|
|
3249
|
+
throw Error('Rule expected after ",".');
|
|
3250
|
+
}
|
|
3251
|
+
res.selectors.push(selector);
|
|
3383
3252
|
}
|
|
3384
|
-
|
|
3385
|
-
|
|
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
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
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);
|
|
3351
|
+
}
|
|
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() {
|
|
@@ -5162,7 +5162,7 @@
|
|
|
5162
5162
|
return get_rule_default;
|
|
5163
5163
|
},
|
|
5164
5164
|
getScroll: function getScroll() {
|
|
5165
|
-
return
|
|
5165
|
+
return get_scroll_default;
|
|
5166
5166
|
},
|
|
5167
5167
|
getScrollState: function getScrollState() {
|
|
5168
5168
|
return get_scroll_state_default;
|
|
@@ -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,21 +6128,27 @@
|
|
|
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) {
|
|
6131
6136
|
return;
|
|
6132
6137
|
}
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
return;
|
|
6138
|
+
if (nodes instanceof window.Node || nodes instanceof abstract_virtual_node_default) {
|
|
6139
|
+
nodes = [ nodes ];
|
|
6140
|
+
} else {
|
|
6141
|
+
nodes = to_array_default(nodes);
|
|
6138
6142
|
}
|
|
6139
|
-
checkResult.relatedNodes =
|
|
6140
|
-
|
|
6143
|
+
checkResult.relatedNodes = [];
|
|
6144
|
+
nodes.forEach(function(node) {
|
|
6145
|
+
if (node instanceof abstract_virtual_node_default) {
|
|
6146
|
+
node = node.actualNode;
|
|
6147
|
+
}
|
|
6148
|
+
if (node instanceof window.Node) {
|
|
6149
|
+
var dqElm = new dq_element_default(node, options);
|
|
6150
|
+
checkResult.relatedNodes.push(dqElm);
|
|
6151
|
+
}
|
|
6141
6152
|
});
|
|
6142
6153
|
}
|
|
6143
6154
|
};
|
|
@@ -6597,7 +6608,7 @@
|
|
|
6597
6608
|
var errorTypes = Object.freeze([ 'EvalError', 'RangeError', 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError' ]);
|
|
6598
6609
|
function stringifyMessage(_ref2) {
|
|
6599
6610
|
var topic = _ref2.topic, channelId = _ref2.channelId, message = _ref2.message, messageId = _ref2.messageId, keepalive = _ref2.keepalive;
|
|
6600
|
-
var
|
|
6611
|
+
var data = {
|
|
6601
6612
|
channelId: channelId,
|
|
6602
6613
|
topic: topic,
|
|
6603
6614
|
messageId: messageId,
|
|
@@ -6605,28 +6616,28 @@
|
|
|
6605
6616
|
source: getSource2()
|
|
6606
6617
|
};
|
|
6607
6618
|
if (message instanceof Error) {
|
|
6608
|
-
|
|
6619
|
+
data.error = {
|
|
6609
6620
|
name: message.name,
|
|
6610
6621
|
message: message.message,
|
|
6611
6622
|
stack: message.stack
|
|
6612
6623
|
};
|
|
6613
6624
|
} else {
|
|
6614
|
-
|
|
6625
|
+
data.payload = message;
|
|
6615
6626
|
}
|
|
6616
|
-
return JSON.stringify(
|
|
6627
|
+
return JSON.stringify(data);
|
|
6617
6628
|
}
|
|
6618
6629
|
function parseMessage(dataString) {
|
|
6619
|
-
var
|
|
6630
|
+
var data;
|
|
6620
6631
|
try {
|
|
6621
|
-
|
|
6632
|
+
data = JSON.parse(dataString);
|
|
6622
6633
|
} catch (e) {
|
|
6623
6634
|
return;
|
|
6624
6635
|
}
|
|
6625
|
-
if (!isRespondableMessage(
|
|
6636
|
+
if (!isRespondableMessage(data)) {
|
|
6626
6637
|
return;
|
|
6627
6638
|
}
|
|
6628
|
-
var
|
|
6629
|
-
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;
|
|
6630
6641
|
return {
|
|
6631
6642
|
topic: topic,
|
|
6632
6643
|
message: message,
|
|
@@ -6700,22 +6711,22 @@
|
|
|
6700
6711
|
messageIds.push(uuid2);
|
|
6701
6712
|
return true;
|
|
6702
6713
|
}
|
|
6703
|
-
function postMessage(win,
|
|
6704
|
-
if (typeof replyHandler === 'function') {
|
|
6705
|
-
storeReplyHandler(data2.channelId, replyHandler, sendToParent);
|
|
6706
|
-
}
|
|
6714
|
+
function postMessage(win, data, sendToParent, replyHandler) {
|
|
6707
6715
|
sendToParent ? assertIsParentWindow(win) : assertIsFrameWindow(win);
|
|
6708
|
-
if (
|
|
6709
|
-
axe.log(
|
|
6716
|
+
if (data.message instanceof Error && !sendToParent) {
|
|
6717
|
+
axe.log(data.message);
|
|
6710
6718
|
return false;
|
|
6711
6719
|
}
|
|
6712
6720
|
var dataString = stringifyMessage(_extends({
|
|
6713
6721
|
messageId: createMessageId()
|
|
6714
|
-
},
|
|
6722
|
+
}, data));
|
|
6715
6723
|
var allowedOrigins = axe._audit.allowedOrigins;
|
|
6716
6724
|
if (!allowedOrigins || !allowedOrigins.length) {
|
|
6717
6725
|
return false;
|
|
6718
6726
|
}
|
|
6727
|
+
if (typeof replyHandler === 'function') {
|
|
6728
|
+
storeReplyHandler(data.channelId, replyHandler, sendToParent);
|
|
6729
|
+
}
|
|
6719
6730
|
allowedOrigins.forEach(function(origin) {
|
|
6720
6731
|
try {
|
|
6721
6732
|
win.postMessage(dataString, origin);
|
|
@@ -6747,12 +6758,12 @@
|
|
|
6747
6758
|
function createResponder(win, channelId) {
|
|
6748
6759
|
var sendToParent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
6749
6760
|
return function respond(message, keepalive, replyHandler) {
|
|
6750
|
-
var
|
|
6761
|
+
var data = {
|
|
6751
6762
|
channelId: channelId,
|
|
6752
6763
|
message: message,
|
|
6753
6764
|
keepalive: keepalive
|
|
6754
6765
|
};
|
|
6755
|
-
postMessage(win,
|
|
6766
|
+
postMessage(win, data, sendToParent, replyHandler);
|
|
6756
6767
|
};
|
|
6757
6768
|
}
|
|
6758
6769
|
function originIsAllowed(origin) {
|
|
@@ -6762,8 +6773,8 @@
|
|
|
6762
6773
|
function messageHandler(_ref3, topicHandler) {
|
|
6763
6774
|
var origin = _ref3.origin, dataString = _ref3.data, win = _ref3.source;
|
|
6764
6775
|
try {
|
|
6765
|
-
var
|
|
6766
|
-
var channelId =
|
|
6776
|
+
var data = parseMessage(dataString) || {};
|
|
6777
|
+
var channelId = data.channelId, message = data.message, messageId = data.messageId;
|
|
6767
6778
|
if (!originIsAllowed(origin) || !isNewMessage(messageId)) {
|
|
6768
6779
|
return;
|
|
6769
6780
|
}
|
|
@@ -6772,12 +6783,12 @@
|
|
|
6772
6783
|
return false;
|
|
6773
6784
|
}
|
|
6774
6785
|
try {
|
|
6775
|
-
if (
|
|
6786
|
+
if (data.topic) {
|
|
6776
6787
|
var responder = createResponder(win, channelId);
|
|
6777
6788
|
assertIsParentWindow(win);
|
|
6778
|
-
topicHandler(
|
|
6789
|
+
topicHandler(data, responder);
|
|
6779
6790
|
} else {
|
|
6780
|
-
callReplyHandler(win,
|
|
6791
|
+
callReplyHandler(win, data);
|
|
6781
6792
|
}
|
|
6782
6793
|
} catch (error) {
|
|
6783
6794
|
processError(win, error, channelId);
|
|
@@ -6787,8 +6798,8 @@
|
|
|
6787
6798
|
return false;
|
|
6788
6799
|
}
|
|
6789
6800
|
}
|
|
6790
|
-
function callReplyHandler(win,
|
|
6791
|
-
var channelId =
|
|
6801
|
+
function callReplyHandler(win, data) {
|
|
6802
|
+
var channelId = data.channelId, message = data.message, keepalive = data.keepalive;
|
|
6792
6803
|
var _ref4 = getReplyHandler(channelId) || {}, replyHandler = _ref4.replyHandler, sendToParent = _ref4.sendToParent;
|
|
6793
6804
|
if (!replyHandler) {
|
|
6794
6805
|
return;
|
|
@@ -6818,11 +6829,11 @@
|
|
|
6818
6829
|
window.removeEventListener('message', handler, false);
|
|
6819
6830
|
};
|
|
6820
6831
|
},
|
|
6821
|
-
post: function post(win,
|
|
6832
|
+
post: function post(win, data, replyHandler) {
|
|
6822
6833
|
if (typeof window.addEventListener !== 'function') {
|
|
6823
6834
|
return false;
|
|
6824
6835
|
}
|
|
6825
|
-
return postMessage(win,
|
|
6836
|
+
return postMessage(win, data, false, replyHandler);
|
|
6826
6837
|
}
|
|
6827
6838
|
};
|
|
6828
6839
|
function setDefaultFrameMessenger(respondable2) {
|
|
@@ -6832,16 +6843,16 @@
|
|
|
6832
6843
|
var postMessage2;
|
|
6833
6844
|
var topicHandlers = {};
|
|
6834
6845
|
function _respondable(win, topic, message, keepalive, replyHandler) {
|
|
6835
|
-
var
|
|
6846
|
+
var data = {
|
|
6836
6847
|
topic: topic,
|
|
6837
6848
|
message: message,
|
|
6838
6849
|
channelId: ''.concat(v4(), ':').concat(v4()),
|
|
6839
6850
|
keepalive: keepalive
|
|
6840
6851
|
};
|
|
6841
|
-
return postMessage2(win,
|
|
6852
|
+
return postMessage2(win, data, replyHandler);
|
|
6842
6853
|
}
|
|
6843
|
-
function messageListener(
|
|
6844
|
-
var topic =
|
|
6854
|
+
function messageListener(data, responder) {
|
|
6855
|
+
var topic = data.topic, message = data.message, keepalive = data.keepalive;
|
|
6845
6856
|
var topicHandler = topicHandlers[topic];
|
|
6846
6857
|
if (!topicHandler) {
|
|
6847
6858
|
return;
|
|
@@ -6913,12 +6924,12 @@
|
|
|
6913
6924
|
var timeout = setTimeout(function collectResultFramesTimeout() {
|
|
6914
6925
|
reject(err('Axe in frame timed out', node));
|
|
6915
6926
|
}, frameWaitTime);
|
|
6916
|
-
_respondable(win, 'axe.start', parameters, void 0, function(
|
|
6927
|
+
_respondable(win, 'axe.start', parameters, void 0, function(data) {
|
|
6917
6928
|
clearTimeout(timeout);
|
|
6918
|
-
if (
|
|
6919
|
-
resolve(
|
|
6929
|
+
if (data instanceof Error === false) {
|
|
6930
|
+
resolve(data);
|
|
6920
6931
|
} else {
|
|
6921
|
-
reject(
|
|
6932
|
+
reject(data);
|
|
6922
6933
|
}
|
|
6923
6934
|
});
|
|
6924
6935
|
}
|
|
@@ -6937,7 +6948,7 @@
|
|
|
6937
6948
|
function findBy(array, key, value) {
|
|
6938
6949
|
if (Array.isArray(array)) {
|
|
6939
6950
|
return array.find(function(obj) {
|
|
6940
|
-
return _typeof(obj) === 'object' && obj[key] === value;
|
|
6951
|
+
return obj !== null && _typeof(obj) === 'object' && Object.hasOwn(obj, key) && obj[key] === value;
|
|
6941
6952
|
});
|
|
6942
6953
|
}
|
|
6943
6954
|
}
|
|
@@ -7060,8 +7071,8 @@
|
|
|
7060
7071
|
_sendCommandToFrame(frameElement, params, callback, rej);
|
|
7061
7072
|
});
|
|
7062
7073
|
});
|
|
7063
|
-
q.then(function(
|
|
7064
|
-
resolve(merge_results_default(
|
|
7074
|
+
q.then(function(data) {
|
|
7075
|
+
resolve(merge_results_default(data, options));
|
|
7065
7076
|
})['catch'](reject);
|
|
7066
7077
|
}
|
|
7067
7078
|
function _contains(vNode, otherVNode) {
|
|
@@ -7319,14 +7330,6 @@
|
|
|
7319
7330
|
return find_up_virtual_default(get_node_from_tree_default(element), target);
|
|
7320
7331
|
}
|
|
7321
7332
|
var find_up_default = findUp;
|
|
7322
|
-
var import_memoizee = __toModule(require_memoizee());
|
|
7323
|
-
axe._memoizedFns = [];
|
|
7324
|
-
function memoizeImplementation(fn) {
|
|
7325
|
-
var memoized = (0, import_memoizee['default'])(fn);
|
|
7326
|
-
axe._memoizedFns.push(memoized);
|
|
7327
|
-
return memoized;
|
|
7328
|
-
}
|
|
7329
|
-
var memoize_default = memoizeImplementation;
|
|
7330
7333
|
function _rectsOverlap(rect1, rect2) {
|
|
7331
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);
|
|
7332
7335
|
}
|
|
@@ -7368,7 +7371,7 @@
|
|
|
7368
7371
|
return vNode.getComputedStylePropertyValue('opacity') === '0';
|
|
7369
7372
|
}
|
|
7370
7373
|
function scrollHidden(vNode) {
|
|
7371
|
-
var scroll =
|
|
7374
|
+
var scroll = get_scroll_default(vNode.actualNode);
|
|
7372
7375
|
var elHeight = parseInt(vNode.getComputedStylePropertyValue('height'));
|
|
7373
7376
|
var elWidth = parseInt(vNode.getComputedStylePropertyValue('width'));
|
|
7374
7377
|
return !!scroll && (elHeight === 0 || elWidth === 0);
|
|
@@ -7661,7 +7664,7 @@
|
|
|
7661
7664
|
vNode._stackingOrder = [ createContext(ROOT_ORDER, null) ];
|
|
7662
7665
|
(_rootGrid = rootGrid) !== null && _rootGrid !== void 0 ? _rootGrid : rootGrid = new Grid();
|
|
7663
7666
|
addNodeToGrid(rootGrid, vNode);
|
|
7664
|
-
if (
|
|
7667
|
+
if (get_scroll_default(vNode.actualNode)) {
|
|
7665
7668
|
var subGrid = new Grid(vNode);
|
|
7666
7669
|
vNode._subGrid = subGrid;
|
|
7667
7670
|
}
|
|
@@ -7685,7 +7688,7 @@
|
|
|
7685
7688
|
_vNode._stackingOrder = createStackingOrder(_vNode, parentVNode, nodeIndex++);
|
|
7686
7689
|
var scrollRegionParent = findScrollRegionParent(_vNode, parentVNode);
|
|
7687
7690
|
var grid = scrollRegionParent ? scrollRegionParent._subGrid : rootGrid;
|
|
7688
|
-
if (
|
|
7691
|
+
if (get_scroll_default(_vNode.actualNode)) {
|
|
7689
7692
|
var _subGrid = new Grid(_vNode);
|
|
7690
7693
|
_vNode._subGrid = _subGrid;
|
|
7691
7694
|
}
|
|
@@ -7816,7 +7819,7 @@
|
|
|
7816
7819
|
var scrollRegionParent = null;
|
|
7817
7820
|
var checkedNodes = [ vNode ];
|
|
7818
7821
|
while (parentVNode) {
|
|
7819
|
-
if (
|
|
7822
|
+
if (get_scroll_default(parentVNode.actualNode)) {
|
|
7820
7823
|
scrollRegionParent = parentVNode;
|
|
7821
7824
|
break;
|
|
7822
7825
|
}
|
|
@@ -9299,7 +9302,7 @@
|
|
|
9299
9302
|
slider: {
|
|
9300
9303
|
type: 'widget',
|
|
9301
9304
|
requiredAttrs: [ 'aria-valuenow' ],
|
|
9302
|
-
allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-orientation', 'aria-readonly', 'aria-valuetext' ],
|
|
9305
|
+
allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-orientation', 'aria-readonly', 'aria-required', 'aria-valuetext' ],
|
|
9303
9306
|
superclassRole: [ 'input', 'range' ],
|
|
9304
9307
|
accessibleNameRequired: true,
|
|
9305
9308
|
childrenPresentational: true
|
|
@@ -9337,7 +9340,7 @@
|
|
|
9337
9340
|
switch: {
|
|
9338
9341
|
type: 'widget',
|
|
9339
9342
|
requiredAttrs: [ 'aria-checked' ],
|
|
9340
|
-
allowedAttrs: [ 'aria-readonly' ],
|
|
9343
|
+
allowedAttrs: [ 'aria-readonly', 'aria-required' ],
|
|
9341
9344
|
superclassRole: [ 'checkbox' ],
|
|
9342
9345
|
accessibleNameRequired: true,
|
|
9343
9346
|
nameFromContent: true,
|
|
@@ -9951,7 +9954,7 @@
|
|
|
9951
9954
|
}, {
|
|
9952
9955
|
hasAccessibleName: true
|
|
9953
9956
|
} ],
|
|
9954
|
-
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' ]
|
|
9955
9958
|
},
|
|
9956
9959
|
usemap: {
|
|
9957
9960
|
matches: '[usemap]',
|
|
@@ -10747,9 +10750,13 @@
|
|
|
10747
10750
|
}
|
|
10748
10751
|
return false;
|
|
10749
10752
|
}
|
|
10750
|
-
var
|
|
10751
|
-
return ''
|
|
10752
|
-
|
|
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
|
+
};
|
|
10753
10760
|
function hasAccessibleName(vNode) {
|
|
10754
10761
|
var ariaLabelledby = sanitize_default(arialabelledby_text_default(vNode));
|
|
10755
10762
|
var ariaLabel = sanitize_default(_arialabelText(vNode));
|
|
@@ -10775,7 +10782,7 @@
|
|
|
10775
10782
|
fieldset: 'group',
|
|
10776
10783
|
figure: 'figure',
|
|
10777
10784
|
footer: function footer(vNode) {
|
|
10778
|
-
var sectioningElement = closest_default(vNode,
|
|
10785
|
+
var sectioningElement = closest_default(vNode, getSectioningElementSelector());
|
|
10779
10786
|
return !sectioningElement ? 'contentinfo' : null;
|
|
10780
10787
|
},
|
|
10781
10788
|
form: function form(vNode) {
|
|
@@ -10788,7 +10795,7 @@
|
|
|
10788
10795
|
h5: 'heading',
|
|
10789
10796
|
h6: 'heading',
|
|
10790
10797
|
header: function header(vNode) {
|
|
10791
|
-
var sectioningElement = closest_default(vNode,
|
|
10798
|
+
var sectioningElement = closest_default(vNode, getSectioningElementSelector());
|
|
10792
10799
|
return !sectioningElement ? 'banner' : null;
|
|
10793
10800
|
},
|
|
10794
10801
|
hr: 'separator',
|
|
@@ -12255,22 +12262,26 @@
|
|
|
12255
12262
|
return element instanceof window.Node;
|
|
12256
12263
|
}
|
|
12257
12264
|
var is_node_default = isNode;
|
|
12258
|
-
var
|
|
12265
|
+
var cacheKey = 'color.incompleteData';
|
|
12259
12266
|
var incompleteData = {
|
|
12260
12267
|
set: function set(key, reason) {
|
|
12261
12268
|
if (typeof key !== 'string') {
|
|
12262
12269
|
throw new Error('Incomplete data: key must be a string');
|
|
12263
12270
|
}
|
|
12271
|
+
var data = cache_default.get(cacheKey, function() {
|
|
12272
|
+
return {};
|
|
12273
|
+
});
|
|
12264
12274
|
if (reason) {
|
|
12265
12275
|
data[key] = reason;
|
|
12266
12276
|
}
|
|
12267
12277
|
return data[key];
|
|
12268
12278
|
},
|
|
12269
12279
|
get: function get(key) {
|
|
12270
|
-
|
|
12280
|
+
var data = cache_default.get(cacheKey);
|
|
12281
|
+
return data === null || data === void 0 ? void 0 : data[key];
|
|
12271
12282
|
},
|
|
12272
12283
|
clear: function clear() {
|
|
12273
|
-
|
|
12284
|
+
cache_default.set(cacheKey, {});
|
|
12274
12285
|
}
|
|
12275
12286
|
};
|
|
12276
12287
|
var incomplete_data_default = incompleteData;
|
|
@@ -15667,7 +15678,7 @@
|
|
|
15667
15678
|
}
|
|
15668
15679
|
var elHeight = parseInt(style.getPropertyValue('height'));
|
|
15669
15680
|
var elWidth = parseInt(style.getPropertyValue('width'));
|
|
15670
|
-
var scroll =
|
|
15681
|
+
var scroll = get_scroll_default(el);
|
|
15671
15682
|
var scrollableWithZeroHeight = scroll && elHeight === 0;
|
|
15672
15683
|
var scrollableWithZeroWidth = scroll && elWidth === 0;
|
|
15673
15684
|
var posAbsoluteOverflowHiddenAndSmall = style.getPropertyValue('position') === 'absolute' && (elHeight < 2 || elWidth < 2) && style.getPropertyValue('overflow') === 'hidden';
|
|
@@ -15722,7 +15733,7 @@
|
|
|
15722
15733
|
var vNode = get_node_from_tree_default(node);
|
|
15723
15734
|
var ancestor = vNode.parent;
|
|
15724
15735
|
while (ancestor) {
|
|
15725
|
-
if (
|
|
15736
|
+
if (get_scroll_default(ancestor.actualNode)) {
|
|
15726
15737
|
return ancestor.actualNode;
|
|
15727
15738
|
}
|
|
15728
15739
|
ancestor = ancestor.parent;
|
|
@@ -15867,7 +15878,6 @@
|
|
|
15867
15878
|
return true;
|
|
15868
15879
|
}
|
|
15869
15880
|
var visually_overlaps_default = visuallyOverlaps;
|
|
15870
|
-
var isXHTMLGlobal;
|
|
15871
15881
|
var nodeIndex2 = 0;
|
|
15872
15882
|
var VirtualNode = function(_abstract_virtual_nod) {
|
|
15873
15883
|
_inherits(VirtualNode, _abstract_virtual_nod);
|
|
@@ -15886,10 +15896,7 @@
|
|
|
15886
15896
|
_this4.nodeIndex = nodeIndex2++;
|
|
15887
15897
|
_this4._isHidden = null;
|
|
15888
15898
|
_this4._cache = {};
|
|
15889
|
-
|
|
15890
|
-
isXHTMLGlobal = is_xhtml_default(node.ownerDocument);
|
|
15891
|
-
}
|
|
15892
|
-
_this4._isXHTML = isXHTMLGlobal;
|
|
15899
|
+
_this4._isXHTML = is_xhtml_default(node.ownerDocument);
|
|
15893
15900
|
if (node.nodeName.toLowerCase() === 'input') {
|
|
15894
15901
|
var type2 = node.getAttribute('type');
|
|
15895
15902
|
type2 = _this4._isXHTML ? type2 : (type2 || '').toLowerCase();
|
|
@@ -16054,7 +16061,7 @@
|
|
|
16054
16061
|
} else {
|
|
16055
16062
|
if (exp.id) {
|
|
16056
16063
|
var _selectorMap$idsKey$e;
|
|
16057
|
-
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)) {
|
|
16058
16065
|
return;
|
|
16059
16066
|
}
|
|
16060
16067
|
nodes = selectorMap[idsKey][exp.id].filter(function(node) {
|
|
@@ -16106,7 +16113,9 @@
|
|
|
16106
16113
|
});
|
|
16107
16114
|
}
|
|
16108
16115
|
function cacheSelector(key, vNode, map) {
|
|
16109
|
-
map
|
|
16116
|
+
if (!Object.hasOwn(map, key)) {
|
|
16117
|
+
map[key] = [];
|
|
16118
|
+
}
|
|
16110
16119
|
map[key].push(vNode);
|
|
16111
16120
|
}
|
|
16112
16121
|
function cacheNodeSelectors(vNode, selectorMap) {
|
|
@@ -16331,46 +16340,46 @@
|
|
|
16331
16340
|
}
|
|
16332
16341
|
var process_aggregate_default = processAggregate;
|
|
16333
16342
|
var dataRegex = /\$\{\s?data\s?\}/g;
|
|
16334
|
-
function substitute(str,
|
|
16335
|
-
if (typeof
|
|
16336
|
-
return str.replace(dataRegex,
|
|
16343
|
+
function substitute(str, data) {
|
|
16344
|
+
if (typeof data === 'string') {
|
|
16345
|
+
return str.replace(dataRegex, data);
|
|
16337
16346
|
}
|
|
16338
|
-
for (var prop in
|
|
16339
|
-
if (
|
|
16347
|
+
for (var prop in data) {
|
|
16348
|
+
if (data.hasOwnProperty(prop)) {
|
|
16340
16349
|
var regex = new RegExp('\\${\\s?data\\.' + prop + '\\s?}', 'g');
|
|
16341
|
-
var replace = typeof
|
|
16350
|
+
var replace = typeof data[prop] === 'undefined' ? '' : String(data[prop]);
|
|
16342
16351
|
str = str.replace(regex, replace);
|
|
16343
16352
|
}
|
|
16344
16353
|
}
|
|
16345
16354
|
return str;
|
|
16346
16355
|
}
|
|
16347
|
-
function processMessage(message,
|
|
16356
|
+
function processMessage(message, data) {
|
|
16348
16357
|
if (!message) {
|
|
16349
16358
|
return;
|
|
16350
16359
|
}
|
|
16351
|
-
if (Array.isArray(
|
|
16352
|
-
|
|
16360
|
+
if (Array.isArray(data)) {
|
|
16361
|
+
data.values = data.join(', ');
|
|
16353
16362
|
if (typeof message.singular === 'string' && typeof message.plural === 'string') {
|
|
16354
|
-
var str2 =
|
|
16355
|
-
return substitute(str2,
|
|
16363
|
+
var str2 = data.length === 1 ? message.singular : message.plural;
|
|
16364
|
+
return substitute(str2, data);
|
|
16356
16365
|
}
|
|
16357
|
-
return substitute(message,
|
|
16366
|
+
return substitute(message, data);
|
|
16358
16367
|
}
|
|
16359
16368
|
if (typeof message === 'string') {
|
|
16360
|
-
return substitute(message,
|
|
16369
|
+
return substitute(message, data);
|
|
16361
16370
|
}
|
|
16362
|
-
if (typeof
|
|
16363
|
-
var _str = message[
|
|
16364
|
-
return substitute(_str,
|
|
16371
|
+
if (typeof data === 'string') {
|
|
16372
|
+
var _str = message[data];
|
|
16373
|
+
return substitute(_str, data);
|
|
16365
16374
|
}
|
|
16366
16375
|
var str = message['default'] || incompleteFallbackMessage();
|
|
16367
|
-
if (
|
|
16368
|
-
str = message[
|
|
16376
|
+
if (data && data.messageKey && message[data.messageKey]) {
|
|
16377
|
+
str = message[data.messageKey];
|
|
16369
16378
|
}
|
|
16370
|
-
return processMessage(str,
|
|
16379
|
+
return processMessage(str, data);
|
|
16371
16380
|
}
|
|
16372
16381
|
var process_message_default = processMessage;
|
|
16373
|
-
function getCheckMessage(checkId, type2,
|
|
16382
|
+
function getCheckMessage(checkId, type2, data) {
|
|
16374
16383
|
var check = axe._audit.data.checks[checkId];
|
|
16375
16384
|
if (!check) {
|
|
16376
16385
|
throw new Error('Cannot get message for unknown check: '.concat(checkId, '.'));
|
|
@@ -16378,7 +16387,7 @@
|
|
|
16378
16387
|
if (!check.messages[type2]) {
|
|
16379
16388
|
throw new Error('Check "'.concat(checkId, '"" does not have a "').concat(type2, '" message.'));
|
|
16380
16389
|
}
|
|
16381
|
-
return process_message_default(check.messages[type2],
|
|
16390
|
+
return process_message_default(check.messages[type2], data);
|
|
16382
16391
|
}
|
|
16383
16392
|
var get_check_message_default = getCheckMessage;
|
|
16384
16393
|
function getCheckOption(check, ruleID, options) {
|
|
@@ -16739,7 +16748,7 @@
|
|
|
16739
16748
|
return rule;
|
|
16740
16749
|
}
|
|
16741
16750
|
var get_rule_default = getRule;
|
|
16742
|
-
function
|
|
16751
|
+
function getScroll(elm) {
|
|
16743
16752
|
var buffer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
16744
16753
|
var overflowX = elm.scrollWidth > elm.clientWidth + buffer;
|
|
16745
16754
|
var overflowY = elm.scrollHeight > elm.clientHeight + buffer;
|
|
@@ -16761,9 +16770,10 @@
|
|
|
16761
16770
|
var overflowProp = style.getPropertyValue(prop);
|
|
16762
16771
|
return [ 'scroll', 'auto' ].includes(overflowProp);
|
|
16763
16772
|
}
|
|
16773
|
+
var get_scroll_default = memoize_default(getScroll);
|
|
16764
16774
|
function getElmScrollRecursive(root) {
|
|
16765
16775
|
return Array.from(root.children || root.childNodes || []).reduce(function(scrolls, elm) {
|
|
16766
|
-
var scroll =
|
|
16776
|
+
var scroll = get_scroll_default(elm);
|
|
16767
16777
|
if (scroll) {
|
|
16768
16778
|
scrolls.push(scroll);
|
|
16769
16779
|
}
|
|
@@ -16793,13 +16803,13 @@
|
|
|
16793
16803
|
throw new Error('axe.utils.getStyleSheetFactory should be invoked with an argument');
|
|
16794
16804
|
}
|
|
16795
16805
|
return function(options) {
|
|
16796
|
-
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;
|
|
16797
16807
|
var style = dynamicDoc.createElement('style');
|
|
16798
16808
|
if (isLink) {
|
|
16799
|
-
var text = dynamicDoc.createTextNode('@import "'.concat(
|
|
16809
|
+
var text = dynamicDoc.createTextNode('@import "'.concat(data.href, '"'));
|
|
16800
16810
|
style.appendChild(text);
|
|
16801
16811
|
} else {
|
|
16802
|
-
style.appendChild(dynamicDoc.createTextNode(
|
|
16812
|
+
style.appendChild(dynamicDoc.createTextNode(data));
|
|
16803
16813
|
}
|
|
16804
16814
|
dynamicDoc.head.appendChild(style);
|
|
16805
16815
|
return {
|
|
@@ -17030,9 +17040,9 @@
|
|
|
17030
17040
|
reject(request.responseText);
|
|
17031
17041
|
});
|
|
17032
17042
|
request.send();
|
|
17033
|
-
}).then(function(
|
|
17043
|
+
}).then(function(data) {
|
|
17034
17044
|
var result = options.convertDataToStylesheet({
|
|
17035
|
-
data:
|
|
17045
|
+
data: data,
|
|
17036
17046
|
isCrossOrigin: isCrossOrigin,
|
|
17037
17047
|
priority: priority,
|
|
17038
17048
|
root: options.rootNode,
|
|
@@ -17376,8 +17386,10 @@
|
|
|
17376
17386
|
retVal.parentShadowId = parentShadowId;
|
|
17377
17387
|
return retVal;
|
|
17378
17388
|
}
|
|
17379
|
-
var recycledLocalVariables = [];
|
|
17380
17389
|
function matchExpressions(domTree, expressions, filter) {
|
|
17390
|
+
var recycledLocalVariables = cache_default.get('qsa.recycledLocalVariables', function() {
|
|
17391
|
+
return [];
|
|
17392
|
+
});
|
|
17381
17393
|
var stack = [];
|
|
17382
17394
|
var vNodes = Array.isArray(domTree) ? domTree : [ domTree ];
|
|
17383
17395
|
var currentLevel = createLocalVariables(vNodes, expressions, null, domTree[0].shadowId, recycledLocalVariables.pop());
|
|
@@ -17505,10 +17517,10 @@
|
|
|
17505
17517
|
function getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet) {
|
|
17506
17518
|
return Array.from(rootNode.children).filter(filerStyleAndLinkAttributesInDocumentFragment).reduce(function(out, node) {
|
|
17507
17519
|
var nodeName2 = node.nodeName.toUpperCase();
|
|
17508
|
-
var
|
|
17520
|
+
var data = nodeName2 === 'STYLE' ? node.textContent : node;
|
|
17509
17521
|
var isLink = nodeName2 === 'LINK';
|
|
17510
17522
|
var stylesheet = convertDataToStylesheet({
|
|
17511
|
-
data:
|
|
17523
|
+
data: data,
|
|
17512
17524
|
isLink: isLink,
|
|
17513
17525
|
root: rootNode
|
|
17514
17526
|
});
|
|
@@ -17684,22 +17696,22 @@
|
|
|
17684
17696
|
return function(check) {
|
|
17685
17697
|
var sourceData = checksData[check.id] || {};
|
|
17686
17698
|
var messages = sourceData.messages || {};
|
|
17687
|
-
var
|
|
17688
|
-
delete
|
|
17699
|
+
var data = Object.assign({}, sourceData);
|
|
17700
|
+
delete data.messages;
|
|
17689
17701
|
if (!rule.reviewOnFail && check.result === void 0) {
|
|
17690
17702
|
if (_typeof(messages.incomplete) === 'object' && !Array.isArray(check.data)) {
|
|
17691
|
-
|
|
17703
|
+
data.message = getIncompleteReason(check.data, messages);
|
|
17692
17704
|
}
|
|
17693
|
-
if (!
|
|
17694
|
-
|
|
17705
|
+
if (!data.message) {
|
|
17706
|
+
data.message = messages.incomplete;
|
|
17695
17707
|
}
|
|
17696
17708
|
} else {
|
|
17697
|
-
|
|
17709
|
+
data.message = check.result === shouldBeTrue ? messages.pass : messages.fail;
|
|
17698
17710
|
}
|
|
17699
|
-
if (typeof
|
|
17700
|
-
|
|
17711
|
+
if (typeof data.message !== 'function') {
|
|
17712
|
+
data.message = process_message_default(data.message, check.data);
|
|
17701
17713
|
}
|
|
17702
|
-
extend_meta_data_default(check,
|
|
17714
|
+
extend_meta_data_default(check, data);
|
|
17703
17715
|
};
|
|
17704
17716
|
}
|
|
17705
17717
|
function publishMetaData(ruleResult) {
|
|
@@ -18316,8 +18328,11 @@
|
|
|
18316
18328
|
if (node.hasAttribute) {
|
|
18317
18329
|
if (node.nodeName.toUpperCase() === 'LABEL' && node.hasAttribute('for')) {
|
|
18318
18330
|
var _id2 = node.getAttribute('for');
|
|
18319
|
-
|
|
18320
|
-
|
|
18331
|
+
if (!idRefs.has(_id2)) {
|
|
18332
|
+
idRefs.set(_id2, [ node ]);
|
|
18333
|
+
} else {
|
|
18334
|
+
idRefs.get(_id2).push(node);
|
|
18335
|
+
}
|
|
18321
18336
|
}
|
|
18322
18337
|
for (var _i27 = 0; _i27 < refAttrs.length; ++_i27) {
|
|
18323
18338
|
var attr = refAttrs[_i27];
|
|
@@ -18325,10 +18340,20 @@
|
|
|
18325
18340
|
if (!attrValue) {
|
|
18326
18341
|
continue;
|
|
18327
18342
|
}
|
|
18328
|
-
var
|
|
18329
|
-
|
|
18330
|
-
|
|
18331
|
-
|
|
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();
|
|
18332
18357
|
}
|
|
18333
18358
|
}
|
|
18334
18359
|
}
|
|
@@ -18339,15 +18364,16 @@
|
|
|
18339
18364
|
}
|
|
18340
18365
|
}
|
|
18341
18366
|
function getAccessibleRefs(node) {
|
|
18367
|
+
var _idRefs$get;
|
|
18342
18368
|
node = node.actualNode || node;
|
|
18343
18369
|
var root = get_root_node_default2(node);
|
|
18344
18370
|
root = root.documentElement || root;
|
|
18345
18371
|
var idRefsByRoot = cache_default.get('idRefsByRoot', function() {
|
|
18346
|
-
return new
|
|
18372
|
+
return new Map();
|
|
18347
18373
|
});
|
|
18348
18374
|
var idRefs = idRefsByRoot.get(root);
|
|
18349
18375
|
if (!idRefs) {
|
|
18350
|
-
idRefs =
|
|
18376
|
+
idRefs = new Map();
|
|
18351
18377
|
idRefsByRoot.set(root, idRefs);
|
|
18352
18378
|
var refAttrs = Object.keys(standards_default.ariaAttrs).filter(function(attr) {
|
|
18353
18379
|
var type2 = standards_default.ariaAttrs[attr].type;
|
|
@@ -18355,7 +18381,7 @@
|
|
|
18355
18381
|
});
|
|
18356
18382
|
cacheIdRefs(root, idRefs, refAttrs);
|
|
18357
18383
|
}
|
|
18358
|
-
return idRefs
|
|
18384
|
+
return (_idRefs$get = idRefs.get(node.id)) !== null && _idRefs$get !== void 0 ? _idRefs$get : [];
|
|
18359
18385
|
}
|
|
18360
18386
|
var get_accessible_refs_default = getAccessibleRefs;
|
|
18361
18387
|
function isAriaRoleAllowedOnElement(node, role) {
|
|
@@ -20434,18 +20460,18 @@
|
|
|
20434
20460
|
if (Array.isArray(options[role])) {
|
|
20435
20461
|
allowed = unique_array_default(options[role].concat(allowed));
|
|
20436
20462
|
}
|
|
20437
|
-
var
|
|
20463
|
+
var _iterator14 = _createForOfIteratorHelper(virtualNode.attrNames), _step14;
|
|
20438
20464
|
try {
|
|
20439
|
-
for (
|
|
20440
|
-
var attrName =
|
|
20465
|
+
for (_iterator14.s(); !(_step14 = _iterator14.n()).done; ) {
|
|
20466
|
+
var attrName = _step14.value;
|
|
20441
20467
|
if (validate_attr_default(attrName) && !allowed.includes(attrName)) {
|
|
20442
20468
|
invalid.push(attrName);
|
|
20443
20469
|
}
|
|
20444
20470
|
}
|
|
20445
20471
|
} catch (err) {
|
|
20446
|
-
|
|
20472
|
+
_iterator14.e(err);
|
|
20447
20473
|
} finally {
|
|
20448
|
-
|
|
20474
|
+
_iterator14.f();
|
|
20449
20475
|
}
|
|
20450
20476
|
if (!invalid.length) {
|
|
20451
20477
|
return true;
|
|
@@ -21805,11 +21831,11 @@
|
|
|
21805
21831
|
return fgColor;
|
|
21806
21832
|
}
|
|
21807
21833
|
function findNodeInContexts(contexts, node) {
|
|
21808
|
-
var
|
|
21834
|
+
var _iterator15 = _createForOfIteratorHelper(contexts), _step15;
|
|
21809
21835
|
try {
|
|
21810
|
-
for (
|
|
21836
|
+
for (_iterator15.s(); !(_step15 = _iterator15.n()).done; ) {
|
|
21811
21837
|
var _context$vNode;
|
|
21812
|
-
var context =
|
|
21838
|
+
var context = _step15.value;
|
|
21813
21839
|
if (((_context$vNode = context.vNode) === null || _context$vNode === void 0 ? void 0 : _context$vNode.actualNode) === node) {
|
|
21814
21840
|
return context;
|
|
21815
21841
|
}
|
|
@@ -21819,9 +21845,9 @@
|
|
|
21819
21845
|
}
|
|
21820
21846
|
}
|
|
21821
21847
|
} catch (err) {
|
|
21822
|
-
|
|
21848
|
+
_iterator15.e(err);
|
|
21823
21849
|
} finally {
|
|
21824
|
-
|
|
21850
|
+
_iterator15.f();
|
|
21825
21851
|
}
|
|
21826
21852
|
}
|
|
21827
21853
|
function hasValidContrastRatio(bg, fg, fontSize, isBold) {
|
|
@@ -22717,8 +22743,8 @@
|
|
|
22717
22743
|
return (value || '').trim() !== '';
|
|
22718
22744
|
}
|
|
22719
22745
|
function hasLangEvaluate(node, options, virtualNode) {
|
|
22720
|
-
var
|
|
22721
|
-
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) {
|
|
22722
22748
|
this.data({
|
|
22723
22749
|
messageKey: 'noXHTML'
|
|
22724
22750
|
});
|
|
@@ -23276,10 +23302,10 @@
|
|
|
23276
23302
|
var minOffset = (options === null || options === void 0 ? void 0 : options.minOffset) || 24;
|
|
23277
23303
|
var closeNeighbors = [];
|
|
23278
23304
|
var closestOffset = minOffset;
|
|
23279
|
-
var
|
|
23305
|
+
var _iterator16 = _createForOfIteratorHelper(_findNearbyElms(vNode, minOffset)), _step16;
|
|
23280
23306
|
try {
|
|
23281
|
-
for (
|
|
23282
|
-
var vNeighbor =
|
|
23307
|
+
for (_iterator16.s(); !(_step16 = _iterator16.n()).done; ) {
|
|
23308
|
+
var vNeighbor = _step16.value;
|
|
23283
23309
|
if (get_role_type_default(vNeighbor) !== 'widget' || !_isFocusable(vNeighbor)) {
|
|
23284
23310
|
continue;
|
|
23285
23311
|
}
|
|
@@ -23291,9 +23317,9 @@
|
|
|
23291
23317
|
closeNeighbors.push(vNeighbor);
|
|
23292
23318
|
}
|
|
23293
23319
|
} catch (err) {
|
|
23294
|
-
|
|
23320
|
+
_iterator16.e(err);
|
|
23295
23321
|
} finally {
|
|
23296
|
-
|
|
23322
|
+
_iterator16.f();
|
|
23297
23323
|
}
|
|
23298
23324
|
if (closeNeighbors.length === 0) {
|
|
23299
23325
|
this.data({
|
|
@@ -23381,10 +23407,10 @@
|
|
|
23381
23407
|
function filterByElmsOverlap(vNode, nearbyElms) {
|
|
23382
23408
|
var fullyObscuringElms = [];
|
|
23383
23409
|
var partialObscuringElms = [];
|
|
23384
|
-
var
|
|
23410
|
+
var _iterator17 = _createForOfIteratorHelper(nearbyElms), _step17;
|
|
23385
23411
|
try {
|
|
23386
|
-
for (
|
|
23387
|
-
var vNeighbor =
|
|
23412
|
+
for (_iterator17.s(); !(_step17 = _iterator17.n()).done; ) {
|
|
23413
|
+
var vNeighbor = _step17.value;
|
|
23388
23414
|
if (!isDescendantNotInTabOrder(vNode, vNeighbor) && _hasVisualOverlap(vNode, vNeighbor) && getCssPointerEvents(vNeighbor) !== 'none') {
|
|
23389
23415
|
if (isEnclosedRect(vNode, vNeighbor)) {
|
|
23390
23416
|
fullyObscuringElms.push(vNeighbor);
|
|
@@ -23394,9 +23420,9 @@
|
|
|
23394
23420
|
}
|
|
23395
23421
|
}
|
|
23396
23422
|
} catch (err) {
|
|
23397
|
-
|
|
23423
|
+
_iterator17.e(err);
|
|
23398
23424
|
} finally {
|
|
23399
|
-
|
|
23425
|
+
_iterator17.f();
|
|
23400
23426
|
}
|
|
23401
23427
|
return {
|
|
23402
23428
|
fullyObscuringElms: fullyObscuringElms,
|
|
@@ -23617,12 +23643,12 @@
|
|
|
23617
23643
|
return 'continue';
|
|
23618
23644
|
}
|
|
23619
23645
|
var sameNameResults = incompleteResults.filter(function(_ref129, resultNum) {
|
|
23620
|
-
var
|
|
23621
|
-
return
|
|
23646
|
+
var data = _ref129.data;
|
|
23647
|
+
return data.name === name && resultNum !== index;
|
|
23622
23648
|
});
|
|
23623
23649
|
var isSameUrl = sameNameResults.every(function(_ref130) {
|
|
23624
|
-
var
|
|
23625
|
-
return isIdenticalObject(
|
|
23650
|
+
var data = _ref130.data;
|
|
23651
|
+
return isIdenticalObject(data.urlProps, urlProps);
|
|
23626
23652
|
});
|
|
23627
23653
|
if (sameNameResults.length && !isSameUrl) {
|
|
23628
23654
|
currentResult.result = void 0;
|
|
@@ -24152,19 +24178,19 @@
|
|
|
24152
24178
|
return;
|
|
24153
24179
|
}
|
|
24154
24180
|
var frameAncestry = r.node.ancestry.slice(0, -1);
|
|
24155
|
-
var
|
|
24181
|
+
var _iterator18 = _createForOfIteratorHelper(iframeResults), _step18;
|
|
24156
24182
|
try {
|
|
24157
|
-
for (
|
|
24158
|
-
var iframeResult =
|
|
24183
|
+
for (_iterator18.s(); !(_step18 = _iterator18.n()).done; ) {
|
|
24184
|
+
var iframeResult = _step18.value;
|
|
24159
24185
|
if (match_ancestry_default(frameAncestry, iframeResult.node.ancestry)) {
|
|
24160
24186
|
r.result = iframeResult.result;
|
|
24161
24187
|
break;
|
|
24162
24188
|
}
|
|
24163
24189
|
}
|
|
24164
24190
|
} catch (err) {
|
|
24165
|
-
|
|
24191
|
+
_iterator18.e(err);
|
|
24166
24192
|
} finally {
|
|
24167
|
-
|
|
24193
|
+
_iterator18.f();
|
|
24168
24194
|
}
|
|
24169
24195
|
});
|
|
24170
24196
|
iframeResults.forEach(function(r) {
|
|
@@ -24175,7 +24201,6 @@
|
|
|
24175
24201
|
return results;
|
|
24176
24202
|
}
|
|
24177
24203
|
var region_after_default = regionAfter;
|
|
24178
|
-
var landmarkRoles2 = get_aria_roles_by_type_default('landmark');
|
|
24179
24204
|
var implicitAriaLiveRoles = [ 'alert', 'log', 'status' ];
|
|
24180
24205
|
function regionEvaluate(node, options, virtualNode) {
|
|
24181
24206
|
this.data({
|
|
@@ -24226,6 +24251,7 @@
|
|
|
24226
24251
|
var node = virtualNode.actualNode;
|
|
24227
24252
|
var role = get_role_default(virtualNode);
|
|
24228
24253
|
var ariaLive = (node.getAttribute('aria-live') || '').toLowerCase().trim();
|
|
24254
|
+
var landmarkRoles2 = get_aria_roles_by_type_default('landmark');
|
|
24229
24255
|
if ([ 'assertive', 'polite' ].includes(ariaLive) || implicitAriaLiveRoles.includes(role)) {
|
|
24230
24256
|
return true;
|
|
24231
24257
|
}
|
|
@@ -24336,18 +24362,18 @@
|
|
|
24336
24362
|
if (!noImportant && node.style.getPropertyPriority(cssProperty) !== 'important' || multiLineOnly && !_isMultiline(node)) {
|
|
24337
24363
|
return true;
|
|
24338
24364
|
}
|
|
24339
|
-
var
|
|
24365
|
+
var data = {};
|
|
24340
24366
|
if (typeof minValue === 'number') {
|
|
24341
|
-
|
|
24367
|
+
data.minValue = minValue;
|
|
24342
24368
|
}
|
|
24343
24369
|
if (typeof maxValue === 'number') {
|
|
24344
|
-
|
|
24370
|
+
data.maxValue = maxValue;
|
|
24345
24371
|
}
|
|
24346
24372
|
var declaredPropValue = node.style.getPropertyValue(cssProperty);
|
|
24347
24373
|
if ([ 'inherit', 'unset', 'revert', 'revert-layer' ].includes(declaredPropValue)) {
|
|
24348
24374
|
this.data(_extends({
|
|
24349
24375
|
value: declaredPropValue
|
|
24350
|
-
},
|
|
24376
|
+
}, data));
|
|
24351
24377
|
return true;
|
|
24352
24378
|
}
|
|
24353
24379
|
var value = getNumberValue(node, {
|
|
@@ -24357,7 +24383,7 @@
|
|
|
24357
24383
|
});
|
|
24358
24384
|
this.data(_extends({
|
|
24359
24385
|
value: value
|
|
24360
|
-
},
|
|
24386
|
+
}, data));
|
|
24361
24387
|
if (typeof value !== 'number') {
|
|
24362
24388
|
return void 0;
|
|
24363
24389
|
}
|
|
@@ -24970,7 +24996,7 @@
|
|
|
24970
24996
|
}
|
|
24971
24997
|
function isLandmarkVirtual(virtualNode2) {
|
|
24972
24998
|
var actualNode = virtualNode2.actualNode;
|
|
24973
|
-
var
|
|
24999
|
+
var landmarkRoles2 = get_aria_roles_by_type_default('landmark');
|
|
24974
25000
|
var role = get_role_default(actualNode);
|
|
24975
25001
|
if (!role) {
|
|
24976
25002
|
return false;
|
|
@@ -24983,7 +25009,7 @@
|
|
|
24983
25009
|
var accessibleText2 = accessible_text_virtual_default(virtualNode2);
|
|
24984
25010
|
return !!accessibleText2;
|
|
24985
25011
|
}
|
|
24986
|
-
return
|
|
25012
|
+
return landmarkRoles2.indexOf(role) >= 0 || role === 'region';
|
|
24987
25013
|
}
|
|
24988
25014
|
return isLandmarkVirtual(virtualNode) && _isVisibleToScreenReaders(node);
|
|
24989
25015
|
}
|
|
@@ -25111,7 +25137,7 @@
|
|
|
25111
25137
|
}
|
|
25112
25138
|
var presentation_role_conflict_matches_default = presentationRoleConflictMatches;
|
|
25113
25139
|
function scrollableRegionFocusableMatches(node, virtualNode) {
|
|
25114
|
-
return
|
|
25140
|
+
return get_scroll_default(node, 13) !== void 0 && _isComboboxPopup(virtualNode) === false && isNoneEmptyElement(virtualNode);
|
|
25115
25141
|
}
|
|
25116
25142
|
function isNoneEmptyElement(vNode) {
|
|
25117
25143
|
return query_selector_all_default(vNode, '*').some(function(elm) {
|
|
@@ -26034,10 +26060,10 @@
|
|
|
26034
26060
|
value: function setAllowedOrigins(allowedOrigins) {
|
|
26035
26061
|
var defaultOrigin = getDefaultOrigin();
|
|
26036
26062
|
this.allowedOrigins = [];
|
|
26037
|
-
var
|
|
26063
|
+
var _iterator19 = _createForOfIteratorHelper(allowedOrigins), _step19;
|
|
26038
26064
|
try {
|
|
26039
|
-
for (
|
|
26040
|
-
var origin =
|
|
26065
|
+
for (_iterator19.s(); !(_step19 = _iterator19.n()).done; ) {
|
|
26066
|
+
var origin = _step19.value;
|
|
26041
26067
|
if (origin === constants_default.allOrigins) {
|
|
26042
26068
|
this.allowedOrigins = [ '*' ];
|
|
26043
26069
|
return;
|
|
@@ -26048,9 +26074,9 @@
|
|
|
26048
26074
|
}
|
|
26049
26075
|
}
|
|
26050
26076
|
} catch (err) {
|
|
26051
|
-
|
|
26077
|
+
_iterator19.e(err);
|
|
26052
26078
|
} finally {
|
|
26053
|
-
|
|
26079
|
+
_iterator19.f();
|
|
26054
26080
|
}
|
|
26055
26081
|
}
|
|
26056
26082
|
}, {
|
|
@@ -26417,12 +26443,12 @@
|
|
|
26417
26443
|
q.defer(function(res, rej) {
|
|
26418
26444
|
audit.run(context, options, res, rej);
|
|
26419
26445
|
});
|
|
26420
|
-
q.then(function(
|
|
26446
|
+
q.then(function(data) {
|
|
26421
26447
|
try {
|
|
26422
26448
|
if (options.performanceTimer) {
|
|
26423
26449
|
performance_timer_default.auditEnd();
|
|
26424
26450
|
}
|
|
26425
|
-
var results = merge_results_default(
|
|
26451
|
+
var results = merge_results_default(data.map(function(results2) {
|
|
26426
26452
|
return {
|
|
26427
26453
|
results: results2
|
|
26428
26454
|
};
|
|
@@ -26448,7 +26474,7 @@
|
|
|
26448
26474
|
});
|
|
26449
26475
|
}
|
|
26450
26476
|
var run_rules_default = runRules;
|
|
26451
|
-
function runCommand(
|
|
26477
|
+
function runCommand(data, keepalive, callback) {
|
|
26452
26478
|
var resolve = callback;
|
|
26453
26479
|
var reject = function reject2(err2) {
|
|
26454
26480
|
if (err2 instanceof Error === false) {
|
|
@@ -26456,12 +26482,12 @@
|
|
|
26456
26482
|
}
|
|
26457
26483
|
callback(err2);
|
|
26458
26484
|
};
|
|
26459
|
-
var context =
|
|
26485
|
+
var context = data && data.context || {};
|
|
26460
26486
|
if (context.hasOwnProperty('include') && !context.include.length) {
|
|
26461
26487
|
context.include = [ document ];
|
|
26462
26488
|
}
|
|
26463
|
-
var options =
|
|
26464
|
-
switch (
|
|
26489
|
+
var options = data && data.options || {};
|
|
26490
|
+
switch (data.command) {
|
|
26465
26491
|
case 'rules':
|
|
26466
26492
|
return run_rules_default(context, options, function(results, cleanup3) {
|
|
26467
26493
|
resolve(results);
|
|
@@ -26472,14 +26498,14 @@
|
|
|
26472
26498
|
return cleanup_default(resolve, reject);
|
|
26473
26499
|
|
|
26474
26500
|
default:
|
|
26475
|
-
if (axe._audit && axe._audit.commands && axe._audit.commands[
|
|
26476
|
-
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);
|
|
26477
26503
|
}
|
|
26478
26504
|
}
|
|
26479
26505
|
}
|
|
26480
26506
|
if (window.top !== window) {
|
|
26481
26507
|
_respondable.subscribe('axe.start', runCommand);
|
|
26482
|
-
_respondable.subscribe('axe.ping', function(
|
|
26508
|
+
_respondable.subscribe('axe.ping', function(data, keepalive, respond) {
|
|
26483
26509
|
respond({
|
|
26484
26510
|
axe: true
|
|
26485
26511
|
});
|
|
@@ -26759,10 +26785,10 @@
|
|
|
26759
26785
|
}
|
|
26760
26786
|
function setFrameSpec(partialResults) {
|
|
26761
26787
|
var frameStack = [];
|
|
26762
|
-
var
|
|
26788
|
+
var _iterator20 = _createForOfIteratorHelper(partialResults), _step20;
|
|
26763
26789
|
try {
|
|
26764
|
-
for (
|
|
26765
|
-
var partialResult =
|
|
26790
|
+
for (_iterator20.s(); !(_step20 = _iterator20.n()).done; ) {
|
|
26791
|
+
var partialResult = _step20.value;
|
|
26766
26792
|
var frameSpec = frameStack.shift();
|
|
26767
26793
|
if (!partialResult) {
|
|
26768
26794
|
continue;
|
|
@@ -26772,9 +26798,9 @@
|
|
|
26772
26798
|
frameStack.unshift.apply(frameStack, _toConsumableArray(frameSpecs));
|
|
26773
26799
|
}
|
|
26774
26800
|
} catch (err) {
|
|
26775
|
-
|
|
26801
|
+
_iterator20.e(err);
|
|
26776
26802
|
} finally {
|
|
26777
|
-
|
|
26803
|
+
_iterator20.f();
|
|
26778
26804
|
}
|
|
26779
26805
|
}
|
|
26780
26806
|
function getMergedFrameSpecs(_ref146) {
|
|
@@ -28535,7 +28561,7 @@
|
|
|
28535
28561
|
selector: '[aria-hidden="true"]',
|
|
28536
28562
|
matches: 'aria-hidden-focus-matches',
|
|
28537
28563
|
excludeHidden: false,
|
|
28538
|
-
tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412' ],
|
|
28564
|
+
tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'TTv5', 'TT6.a' ],
|
|
28539
28565
|
actIds: [ '6cfa84' ],
|
|
28540
28566
|
all: [ 'focusable-modal-open', 'focusable-disabled', 'focusable-not-tabbable' ],
|
|
28541
28567
|
any: [],
|
|
@@ -29012,7 +29038,7 @@
|
|
|
29012
29038
|
id: 'frame-title-unique',
|
|
29013
29039
|
selector: 'frame[title], iframe[title]',
|
|
29014
29040
|
matches: 'frame-title-has-text-matches',
|
|
29015
|
-
tags: [ 'cat.text-alternatives', 'wcag412', 'wcag2a', 'TTv5', 'TT12.
|
|
29041
|
+
tags: [ 'cat.text-alternatives', 'wcag412', 'wcag2a', 'TTv5', 'TT12.d' ],
|
|
29016
29042
|
actIds: [ '4b1c6c' ],
|
|
29017
29043
|
all: [],
|
|
29018
29044
|
any: [],
|
|
@@ -29022,7 +29048,7 @@
|
|
|
29022
29048
|
id: 'frame-title',
|
|
29023
29049
|
selector: 'frame, iframe',
|
|
29024
29050
|
matches: 'no-negative-tabindex-matches',
|
|
29025
|
-
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag412', 'section508', 'section508.22.i', 'TTv5', 'TT12.
|
|
29051
|
+
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag412', 'section508', 'section508.22.i', 'TTv5', 'TT12.d' ],
|
|
29026
29052
|
actIds: [ 'cae760' ],
|
|
29027
29053
|
all: [],
|
|
29028
29054
|
any: [ {
|
|
@@ -29367,7 +29393,7 @@
|
|
|
29367
29393
|
id: 'meta-refresh',
|
|
29368
29394
|
selector: 'meta[http-equiv="refresh"][content]',
|
|
29369
29395
|
excludeHidden: false,
|
|
29370
|
-
tags: [ 'cat.time-and-media', 'wcag2a', 'wcag221', 'TTv5', '
|
|
29396
|
+
tags: [ 'cat.time-and-media', 'wcag2a', 'wcag221', 'TTv5', 'TT8.a' ],
|
|
29371
29397
|
actIds: [ 'bc659a', 'bisz58' ],
|
|
29372
29398
|
all: [],
|
|
29373
29399
|
any: [ {
|
|
@@ -29411,7 +29437,7 @@
|
|
|
29411
29437
|
}, {
|
|
29412
29438
|
id: 'nested-interactive',
|
|
29413
29439
|
matches: 'nested-interactive-matches',
|
|
29414
|
-
tags: [ 'cat.keyboard', 'wcag2a', 'wcag412', 'TTv5', '
|
|
29440
|
+
tags: [ 'cat.keyboard', 'wcag2a', 'wcag412', 'TTv5', 'TT6.a' ],
|
|
29415
29441
|
actIds: [ '307n5z' ],
|
|
29416
29442
|
all: [],
|
|
29417
29443
|
any: [ 'no-focusable-content' ],
|
|
@@ -29537,7 +29563,7 @@
|
|
|
29537
29563
|
id: 'scrollable-region-focusable',
|
|
29538
29564
|
selector: '*:not(select,textarea)',
|
|
29539
29565
|
matches: 'scrollable-region-focusable-matches',
|
|
29540
|
-
tags: [ 'cat.keyboard', 'wcag2a', 'wcag211' ],
|
|
29566
|
+
tags: [ 'cat.keyboard', 'wcag2a', 'wcag211', 'TTv5', 'TT4.a' ],
|
|
29541
29567
|
actIds: [ '0ssw9k' ],
|
|
29542
29568
|
all: [],
|
|
29543
29569
|
any: [ 'focusable-content', 'focusable-element' ],
|
|
@@ -29558,7 +29584,7 @@
|
|
|
29558
29584
|
}, {
|
|
29559
29585
|
id: 'server-side-image-map',
|
|
29560
29586
|
selector: 'img[ismap]',
|
|
29561
|
-
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag211', 'section508', 'section508.22.f' ],
|
|
29587
|
+
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag211', 'section508', 'section508.22.f', 'TTv5', 'TT4.a' ],
|
|
29562
29588
|
all: [],
|
|
29563
29589
|
any: [],
|
|
29564
29590
|
none: [ 'exists' ]
|
|
@@ -29637,7 +29663,7 @@
|
|
|
29637
29663
|
id: 'td-headers-attr',
|
|
29638
29664
|
selector: 'table',
|
|
29639
29665
|
matches: 'table-or-grid-role-matches',
|
|
29640
|
-
tags: [ 'cat.tables', 'wcag2a', 'wcag131', 'section508', 'section508.22.g' ],
|
|
29666
|
+
tags: [ 'cat.tables', 'wcag2a', 'wcag131', 'section508', 'section508.22.g', 'TTv5', 'TT14.b' ],
|
|
29641
29667
|
actIds: [ 'a25f45' ],
|
|
29642
29668
|
all: [ 'td-headers-attr' ],
|
|
29643
29669
|
any: [],
|