Files
RoboCommander/node_modules/nwsapi/dist/nwsapi.min.js

7 lines
35 KiB
JavaScript
Raw Normal View History

2026-04-05 16:14:49 -04:00
/*!
* NWSAPI 2.0.9 - Fast CSS Selectors API Engine
* Copyright (c) 2007-2018 Diego Perini
* See http://nwbox.com/license
*/
(function Export(global,factory){'use strict';if(typeof module=='object'&&typeof exports=='object'){module.exports=factory;}else if(typeof define=='function'&&define['amd']){define(factory);}else{global.NW||(global.NW={});global.NW.Dom=factory(global,Export);}})(this,function Factory(global,Export){var version='nwsapi-2.0.9',doc=global.document,root=doc.documentElement,WSP='[\\x20\\t\\r\\n\\f]',CFG={operators:'[~*^$|]=|=',combinators:'[\\x20\\t>+~](?=[^>+~])'},NOT={double_enc:'(?=(?:[^"]*["][^"]*["])*[^"]*$)',single_enc:"(?=(?:[^']*['][^']*['])*[^']*$)",parens_enc:'(?![^\\x28]*\\x29)',square_enc:'(?![^\\x5b]*\\x5d)'},REX={HasEscapes:RegExp('\\\\'),HexNumbers:RegExp('^[0-9a-fA-F]'),EscOrQuote:RegExp('^\\\\|[\\x22\\x27]'),RegExpChar:RegExp('(?:(?!\\\\)[\\\\^$.*+?()[\\]{}|\\/])','g'),TrimSpaces:RegExp('[\\n\\r\\f]+|^'+WSP+'+|'+WSP+'+$','g'),FixEscapes:RegExp('\\\\([0-9a-fA-F]{1,6}'+WSP+'?|.)|([\\x22\\x27])','g'),CombineWSP:RegExp('[\\n\\r\\f\\x20]+'+NOT.single_enc+NOT.double_enc,'g'),TabCharWSP:RegExp('(\\x20?\\t+\\x20?)'+NOT.single_enc+NOT.double_enc,'g'),CommaGroup:RegExp(WSP+'+,'+WSP+'+'+NOT.single_enc+NOT.double_enc,'g'),SplitGroup:RegExp(WSP+'?,'+WSP+'?'+NOT.square_enc+NOT.parens_enc,'g')},GROUPS={linguistic:'(dir|lang)\\x28\\s?([-\\w]{2,})\\s?(?:\\x29|$)',logicalsel:'(matches|not)\\x28\\s?([^()]*|[^\\x28]*\\x28[^\\x29]*\\x29)\\s?(?:\\x29|$)',treestruct:'(nth(?:-last)?(?:-child|-of-type))(?:\\x28\\s?(even|odd|(?:[-+]?\\d*)(?:n\\s?[-+]?\\s?\\d*)?)\\s?(?:\\x29|$))',locationpc:'(link|visited|target|scope)\\b',useraction:'(hover|active|focus|focus-within)\\b',structural:'(root|empty|(?:(?:first|last|only)(?:-child|-of-type)))\\b',pseudoelem:':?(after|before|first-letter|first-line|selection|placeholder)\\b',inputstate:'(enabled|disabled|read-only|read-write|placeholder-shown|default)\\b',inputvalue:'(checked|indeterminate|required|optional|valid|invalid|in-range|out-of-range)\\b'},Patterns={treestruct:RegExp('^:(?:'+GROUPS.treestruct+')(.*)','i'),structural:RegExp('^:(?:'+GROUPS.structural+')(.*)','i'),linguistic:RegExp('^:(?:'+GROUPS.linguistic+')(.*)','i'),pseudoelem:RegExp('^:(?:'+GROUPS.pseudoelem+')(.*)','i'),useraction:RegExp('^:(?:'+GROUPS.useraction+')(.*)','i'),inputstate:RegExp('^:(?:'+GROUPS.inputstate+')(.*)','i'),inputvalue:RegExp('^:(?:'+GROUPS.inputvalue+')(.*)','i'),locationpc:RegExp('^:(?:'+GROUPS.locationpc+')(.*)','i'),logicalsel:RegExp('^:(?:'+GROUPS.logicalsel+')(.*)','i'),children:RegExp('^'+WSP+'?\\>'+WSP+'?(.*)'),adjacent:RegExp('^'+WSP+'?\\+'+WSP+'?(.*)'),relative:RegExp('^'+WSP+'?\\~'+WSP+'?(.*)'),ancestor:RegExp('^'+WSP+'+(.*)'),universal:RegExp('^\\*(.*)'),namespace:RegExp('^(\\w+|\\*)?\\|(.*)')},RTL=RegExp('^[\\u0591-\\u08ff\\ufb1d-\\ufdfd\\ufe70-\\ufefc ]+$'),qsNotArgs='Not enough arguments',qsInvalid=' is not a valid selector',reNthElem=RegExp('(:nth(?:-last)?-child)','i'),reNthType=RegExp('(:nth(?:-last)?-of-type)','i'),reOptimizer,reSimpleNot,reValidator,Config={FASTCOMMA:true,IDS_DUPES:true,SIMPLENOT:true,LOGERRORS:true,VERBOSITY:true},NAMESPACE,QUIRKS_MODE,HTML_DOCUMENT,ATTR_STD_OPS={'=':1,'^=':1,'$=':1,'|=':1,'*=':1,'~=':1},HTML_TABLE={'accept':1,'accept-charset':1,'align':1,'alink':1,'axis':1,'bgcolor':1,'charset':1,'checked':1,'clear':1,'codetype':1,'color':1,'compact':1,'declare':1,'defer':1,'dir':1,'direction':1,'disabled':1,'enctype':1,'face':1,'frame':1,'hreflang':1,'http-equiv':1,'lang':1,'language':1,'link':1,'media':1,'method':1,'multiple':1,'nohref':1,'noresize':1,'noshade':1,'nowrap':1,'readonly':1,'rel':1,'rev':1,'rules':1,'scope':1,'scrolling':1,'selected':1,'shape':1,'target':1,'text':1,'type':1,'valign':1,'valuetype':1,'vlink':1},Combinators={},Selectors={},Operators={'=':{p1:'^',p2:'$',p3:'true'},'^=':{p1:'^',p2:'',p3:'true'},'$=':{p1:'',p2:'$',p3:'true'},'*=':{p1:'',p2:'',p3:'true'},'|=':{p1:'^',p2:'(-|$)',p3:'true'},'~=':{p1:'(^|\\s)',p2:'(\\s|$)',p3:'true'}},concatCall=function(nodes,callback){var i=0,l=nodes.length,list=Array(l);while(l>i){if(false===callback(list[i]=nodes[i]))break;++i;}return list;},toArray=function(nodes){var l=nodes.length,list=Array(l);while(l){