: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
return nodeName( elem, "input" ) && elem.type === "button" ||
nodeName( elem, "button" );
return nodeName( elem, "input" ) && elem.type === "text" &&
// New HTML5 attribute values (e.g., "search") appear
// with elem.type === "text"
( ( attr = elem.getAttribute( "type" ) ) == null ||
attr.toLowerCase() === "text" );
// Position-in-collection
first: createPositionalPseudo( function() {
last: createPositionalPseudo( function( _matchIndexes, length ) {
eq: createPositionalPseudo( function( _matchIndexes, length, argument ) {
return [ argument < 0 ? argument + length : argument ];
even: createPositionalPseudo( function( matchIndexes, length ) {
for ( ; i < length; i += 2 ) {
odd: createPositionalPseudo( function( matchIndexes, length ) {
for ( ; i < length; i += 2 ) {
lt: createPositionalPseudo( function( matchIndexes, length, argument ) {
} else if ( argument > length ) {
gt: createPositionalPseudo( function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument;
for ( ; ++i < length; ) {
Expr.pseudos.nth = Expr.pseudos.eq;
// Add button/input type pseudos
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
Expr.pseudos[ i ] = createInputPseudo( i );
for ( i in { submit: true, reset: true } ) {
Expr.pseudos[ i ] = createButtonPseudo( i );
// Easy API for creating new setFilters
setFilters.prototype = Expr.filters = Expr.pseudos;
Expr.setFilters = new setFilters();
function tokenize( selector, parseOnly ) {
var matched, match, tokens, type,
soFar, groups, preFilters,
cached = tokenCache[ selector + " " ];
return parseOnly ? 0 : cached.slice( 0 );
preFilters = Expr.preFilter;
if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
// Don't consume trailing commas as valid
soFar = soFar.slice( match[ 0 ].length ) || soFar;
groups.push( ( tokens = [] ) );
if ( ( match = rleadingCombinator.exec( soFar ) ) ) {
// Cast descendant combinators to space
type: match[ 0 ].replace( rtrimCSS, " " )
soFar = soFar.slice( matched.length );
for ( type in Expr.filter ) {
if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
( match = preFilters[ type ]( match ) ) ) ) {
soFar = soFar.slice( matched.length );
// Return the length of the invalid excess
// Otherwise, throw an error or return tokens
tokenCache( selector, groups ).slice( 0 );
function toSelector( tokens ) {
selector += tokens[ i ].value;
function addCombinator( matcher, combinator, base ) {
var dir = combinator.dir,
checkNonElements = base && key === "parentNode",
return combinator.first ?
// Check against closest ancestor/preceding element
function( elem, context, xml ) {
while ( ( elem = elem[ dir ] ) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
return matcher( elem, context, xml );
// Check against all ancestor/preceding elements
function( elem, context, xml ) {
var oldCache, outerCache,
newCache = [ dirruns, doneName ];
// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
while ( ( elem = elem[ dir ] ) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
if ( matcher( elem, context, xml ) ) {
while ( ( elem = elem[ dir ] ) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
outerCache = elem[ expando ] || ( elem[ expando ] = {} );
if ( skip && nodeName( elem, skip ) ) {
elem = elem[ dir ] || elem;
} else if ( ( oldCache = outerCache[ key ] ) &&
oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
// Assign to newCache so results back-propagate to previous elements
return ( newCache[ 2 ] = oldCache[ 2 ] );
// Reuse newcache so results back-propagate to previous elements
outerCache[ key ] = newCache;
// A match means we're done; a fail means we have to keep checking
if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
function elementMatcher( matchers ) {
return matchers.length > 1 ?
function( elem, context, xml ) {
if ( !matchers[ i ]( elem, context, xml ) ) {
function multipleContexts( selector, contexts, results ) {
find( selector, contexts[ i ], results );
function condense( unmatched, map, filter, context, xml ) {
if ( ( elem = unmatched[ i ] ) ) {
if ( !filter || filter( elem, context, xml ) ) {
newUnmatched.push( elem );
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
if ( postFinder && !postFinder[ expando ] ) {
postFinder = setMatcher( postFinder, postSelector );
return markFunction( function( seed, results, context, xml ) {
var temp, i, elem, matcherOut,
preexisting = results.length,
// Get initial elements from seed or context
multipleContexts( selector || "*",
context.nodeType ? [ context ] : context, [] ),
// Prefilter to get matcher input, preserving a map for seed-results synchronization
matcherIn = preFilter && ( seed || !selector ) ?
condense( elems, preMap, preFilter, context, xml ) :
// If we have a postFinder, or filtered seed, or non-seed postFilter
// or preexisting results,
matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
// ...intermediate processing is necessary
// ...otherwise use results directly
matcher( matcherIn, matcherOut, context, xml );
temp = condense( matcherOut, postMap );
postFilter( temp, [], context, xml );
// Un-match failing elements by moving them back to matcherIn
if ( ( elem = temp[ i ] ) ) {
matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
if ( postFinder || preFilter ) {
// Get the final matcherOut by condensing this intermediate into postFinder contexts
if ( ( elem = matcherOut[ i ] ) ) {
// Restore matcherIn since elem is not yet a final match
temp.push( ( matcherIn[ i ] = elem ) );
postFinder( null, ( matcherOut = [] ), temp, xml );
// Move matched elements from seed to results to keep them synchronized
if ( ( elem = matcherOut[ i ] ) &&
( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) {
seed[ temp ] = !( results[ temp ] = elem );
// Add elements to results, through postFinder if defined
matcherOut.splice( preexisting, matcherOut.length ) :
postFinder( null, results, matcherOut, xml );
push.apply( results, matcherOut );
function matcherFromTokens( tokens ) {
var checkContext, matcher, j,
leadingRelative = Expr.relative[ tokens[ 0 ].type ],
implicitRelative = leadingRelative || Expr.relative[ " " ],
i = leadingRelative ? 1 : 0,
// The foundational matcher ensures that elements are reachable from top-level context(s)
matchContext = addCombinator( function( elem ) {
return elem === checkContext;
}, implicitRelative, true ),
matchAnyContext = addCombinator( function( elem ) {
return indexOf.call( checkContext, elem ) > -1;
}, implicitRelative, true ),
matchers = [ function( elem, context, xml ) {
// 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
var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || (
( checkContext = context ).nodeType ?
matchContext( elem, context, xml ) :
matchAnyContext( elem, context, xml ) );
// Avoid hanging onto element
// (see https://github.com/jquery/sizzle/issues/299)
if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
// Return special upon seeing a positional matcher
if ( matcher[ expando ] ) {
// Find the next relative operator (if any) for proper handling
if ( Expr.relative[ tokens[ j ].type ] ) {
i > 1 && elementMatcher( matchers ),
// If the preceding token was a descendant combinator, insert an implicit any-element `*`
.concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
).replace( rtrimCSS, "$1" ),
i < j && matcherFromTokens( tokens.slice( i, j ) ),
j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
j < len && toSelector( tokens )
matchers.push( matcher );
return elementMatcher( matchers );
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
var bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, outermost ) {
contextBackup = outermostContext,
// We must always have either seed elements or outermost context
elems = seed || byElement && Expr.find.TAG( "*", outermost ),
// Use integer dirruns iff this is the outermost matcher
dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
// 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
outermostContext = context == document || context || outermost;
// Add elements passing elementMatchers directly to results
// Support: iOS <=7 - 9 only
// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching
// elements by id. (see trac-14142)
for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
if ( byElement && elem ) {
// 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 ( !context && elem.ownerDocument != document ) {
while ( ( matcher = elementMatchers[ j++ ] ) ) {
if ( matcher( elem, context || document, xml ) ) {
push.call( results, elem );
// Track unmatched elements for set filters
// They will have gone through all possible matchers
if ( ( elem = !matcher && elem ) ) {