: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
// Go through the array, translating each of the items to their new values
if ( isArrayLike( elems ) ) {
for ( ; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
// Go through every key on the object,
value = callback( elems[ i ], i, arg );
// Flatten any nested arrays
// A global GUID counter for objects
// jQuery.support is not used in Core but other projects attach their
// properties to it so it needs to exist.
if ( typeof Symbol === "function" ) {
jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
// Populate the class2type map
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
class2type[ "[object " + name + "]" ] = name.toLowerCase();
function isArrayLike( obj ) {
// Support: real iOS 8.2 only (not reproducible in simulator)
// `in` check used to prevent JIT error (gh-2145)
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
var length = !!obj && "length" in obj && obj.length,
if ( isFunction( obj ) || isWindow( obj ) ) {
return type === "array" || length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj;
function nodeName( elem, name ) {
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
var whitespace = "[\\x20\\t\\r\\n\\f]";
var rtrimCSS = new RegExp(
"^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
// Note: an element does not contain itself
jQuery.contains = function( a, b ) {
var bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && (
// IE doesn't have `contains` on SVG.
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
// CSS string/identifier serialization
// https://drafts.csswg.org/cssom/#common-serializing-idioms
var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
function fcssescape( ch, asCodePoint ) {
// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
// Control characters and (dependent upon position) numbers get escaped as code points
return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
// Other potentially-special ASCII characters get backslash-escaped
jQuery.escapeSelector = function( sel ) {
return ( sel + "" ).replace( rcssescape, fcssescape );
var preferredDoc = document,
// Instance-specific data
expando = jQuery.expando,
classCache = createCache(),
tokenCache = createCache(),
compilerCache = createCache(),
nonnativeSelectorCache = createCache(),
sortOrder = function( a, b ) {
booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" +
"loop|multiple|open|readonly|required|scoped",
// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
// Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors
attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
"*([*^$|!~]?=)" + whitespace +
// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
pseudos = ":(" + identifier + ")(?:\\((" +
// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
// 1. quoted (capture 3; capture 4 or capture 5)
"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
// 3. anything else (capture 2)
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
rwhitespace = new RegExp( whitespace + "+", "g" ),
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" +
rdescend = new RegExp( whitespace + "|>" ),
rpseudo = new RegExp( pseudos ),
ridentifier = new RegExp( "^" + identifier + "$" ),
ID: new RegExp( "^#(" + identifier + ")" ),
CLASS: new RegExp( "^\\.(" + identifier + ")" ),
TAG: new RegExp( "^(" + identifier + "|[*])" ),
ATTR: new RegExp( "^" + attributes ),
PSEUDO: new RegExp( "^" + pseudos ),
"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
bool: new RegExp( "^(?:" + booleans + ")$", "i" ),
// For use in libraries implementing .is()
// We use this for POS matching in `select`
needsContext: new RegExp( "^" + whitespace +
"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
"*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
rinputs = /^(?:input|select|textarea|button)$/i,
// Easily-parseable/retrievable ID or TAG or CLASS selectors
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
// https://www.w3.org/TR/CSS21/syndata.html#escaped-characters
runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace +
"?|\\\\([^\\r\\n\\f])", "g" ),
funescape = function( escape, nonHex ) {
var high = "0x" + escape.slice( 1 ) - 0x10000;
// Strip the backslash prefix from a non-hex escape sequence
// Replace a hexadecimal escape sequence with the encoded Unicode code point
// For values outside the Basic Multilingual Plane (BMP), manually construct a
String.fromCharCode( high + 0x10000 ) :
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
// Used for iframes; see `setDocument`.
// Support: IE 9 - 11+, Edge 12 - 18+
// Removing the function wrapper causes a "Permission Denied"
unloadHandler = function() {
inDisabledFieldset = addCombinator(
return elem.disabled === true && nodeName( elem, "fieldset" );
{ dir: "parentNode", next: "legend" }
// Accessing document.activeElement can throw unexpectedly
// https://bugs.jquery.com/ticket/13393
function safeActiveElement() {
return document.activeElement;
// Optimize for push.apply( _, NodeList )
( arr = slice.call( preferredDoc.childNodes ) ),
// Support: Android <=4.0
// Detect silently failing push.apply
// eslint-disable-next-line no-unused-expressions
arr[ preferredDoc.childNodes.length ].nodeType;
apply: function( target, els ) {
pushNative.apply( target, slice.call( els ) );
call: function( target ) {
pushNative.apply( target, slice.call( arguments, 1 ) );
function find( selector, context, results, seed ) {
var m, i, elem, nid, match, groups, newSelector,
newContext = context && context.ownerDocument,
// nodeType defaults to 9, since context defaults to document
nodeType = context ? context.nodeType : 9;
// Return early from calls with invalid selector or context
if ( typeof selector !== "string" || !selector ||
nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
// Try to shortcut find operations (as opposed to filters) in HTML documents
context = context || document;
// If the selector is sufficiently simple, try using a "get*By*" DOM method
// (excepting DocumentFragment context, where the methods don't exist)
if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
if ( ( m = match[ 1 ] ) ) {
if ( ( elem = context.getElementById( m ) ) ) {
// getElementById can match elements by name instead of ID
push.call( results, elem );
// getElementById can match elements by name instead of ID
if ( newContext && ( elem = newContext.getElementById( m ) ) &&
find.contains( context, elem ) &&
push.call( results, elem );
} else if ( match[ 2 ] ) {
push.apply( results, context.getElementsByTagName( selector ) );
} else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) {
push.apply( results, context.getElementsByClassName( m ) );
// Take advantage of querySelectorAll
if ( !nonnativeSelectorCache[ selector + " " ] &&
( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) {
// qSA considers elements outside a scoping root when evaluating child or
// descendant combinators, which is not what we want.
// In such cases, we work around the behavior by prefixing every selector in the
// list with an ID selector referencing the scope context.
// The technique has to be used as well when a leading combinator is used
// as such selectors are not recognized by querySelectorAll.
// Thanks to Andrew Dupont for this technique.
( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) {
// Expand context for sibling selectors
newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
// We can use :scope instead of the ID hack if the browser
// supports it & if we're not changing the context.
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when
// strict-comparing two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
if ( newContext != context || !support.scope ) {
// Capture the context ID, setting it first if necessary
if ( ( nid = context.getAttribute( "id" ) ) ) {
nid = jQuery.escapeSelector( nid );
context.setAttribute( "id", ( nid = expando ) );
// Prefix every selector in the list
groups = tokenize( selector );
groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
toSelector( groups[ i ] );
newSelector = groups.join( "," );
newContext.querySelectorAll( newSelector )
nonnativeSelectorCache( selector, true );
context.removeAttribute( "id" );
return select( selector.replace( rtrimCSS, "$1" ), context, results, seed );
* Create key-value caches of limited size
* @returns {function(string, object)} Returns the Object data after storing it on itself with
* property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
* deleting the oldest entry
function cache( key, value ) {
// Use (key + " ") to avoid collision with native prototype properties
// (see https://github.com/jquery/sizzle/issues/157)
if ( keys.push( key + " " ) > Expr.cacheLength ) {
// Only keep the most recent entries
delete cache[ keys.shift() ];
return ( cache[ key + " " ] = value );
* Mark a function for special use by jQuery selector module
* @param {Function} fn The function to mark
function markFunction( fn ) {
* Support testing using an element
* @param {Function} fn Passed the created element and returns a boolean result
var el = document.createElement( "fieldset" );
// Remove from its parent by default
el.parentNode.removeChild( el );
* Returns a function to use in pseudos for input types