jquery.js 281 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870
  1. /*!
  2. * jQuery JavaScript Library v3.5.1
  3. * https://jquery.com/
  4. *
  5. * Includes Sizzle.js
  6. * https://sizzlejs.com/
  7. *
  8. * Copyright JS Foundation and other contributors
  9. * Released under the MIT license
  10. * https://jquery.org/license
  11. */
  12. ( function( global, factory ) {
  13. "use strict";
  14. if ( typeof module === "object" && typeof module.exports === "object" ) {
  15. // For CommonJS and CommonJS-like environments where a proper `window`
  16. // is present, execute the factory and get jQuery.
  17. // For environments that do not have a `window` with a `document`
  18. // (such as Node.js), expose a factory as module.exports.
  19. // This accentuates the need for the creation of a real `window`.
  20. // e.g. var jQuery = require("jquery")(window);
  21. // See ticket #14549 for more info.
  22. module.exports = global.document ?
  23. factory( global, true ) :
  24. function( w ) {
  25. if ( !w.document ) {
  26. throw new Error( "jQuery requires a window with a document" );
  27. }
  28. return factory( w );
  29. };
  30. } else {
  31. factory( global );
  32. }
  33. // Pass this if window is not defined yet
  34. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  35. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  36. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  37. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  38. // enough that all such attempts are guarded in a try block.
  39. "use strict";
  40. var arr = [];
  41. var getProto = Object.getPrototypeOf;
  42. var slice = arr.slice;
  43. var flat = arr.flat ? function( array ) {
  44. return arr.flat.call( array );
  45. } : function( array ) {
  46. return arr.concat.apply( [], array );
  47. };
  48. var push = arr.push;
  49. var indexOf = arr.indexOf;
  50. var class2type = {};
  51. var toString = class2type.toString;
  52. var hasOwn = class2type.hasOwnProperty;
  53. var fnToString = hasOwn.toString;
  54. var ObjectFunctionString = fnToString.call( Object );
  55. var support = {};
  56. var isFunction = function isFunction( obj ) {
  57. // Support: Chrome <=57, Firefox <=52
  58. // In some browsers, typeof returns "function" for HTML <object> elements
  59. // (i.e., `typeof document.createElement( "object" ) === "function"`).
  60. // We don't want to classify *any* DOM node as a function.
  61. return typeof obj === "function" && typeof obj.nodeType !== "number";
  62. };
  63. var isWindow = function isWindow( obj ) {
  64. return obj != null && obj === obj.window;
  65. };
  66. var document = window.document;
  67. var preservedScriptAttributes = {
  68. type: true,
  69. src: true,
  70. nonce: true,
  71. noModule: true
  72. };
  73. function DOMEval( code, node, doc ) {
  74. doc = doc || document;
  75. var i, val,
  76. script = doc.createElement( "script" );
  77. script.text = code;
  78. if ( node ) {
  79. for ( i in preservedScriptAttributes ) {
  80. // Support: Firefox 64+, Edge 18+
  81. // Some browsers don't support the "nonce" property on scripts.
  82. // On the other hand, just using `getAttribute` is not enough as
  83. // the `nonce` attribute is reset to an empty string whenever it
  84. // becomes browsing-context connected.
  85. // See https://github.com/whatwg/html/issues/2369
  86. // See https://html.spec.whatwg.org/#nonce-attributes
  87. // The `node.getAttribute` check was added for the sake of
  88. // `jQuery.globalEval` so that it can fake a nonce-containing node
  89. // via an object.
  90. val = node[ i ] || node.getAttribute && node.getAttribute( i );
  91. if ( val ) {
  92. script.setAttribute( i, val );
  93. }
  94. }
  95. }
  96. doc.head.appendChild( script ).parentNode.removeChild( script );
  97. }
  98. function toType( obj ) {
  99. if ( obj == null ) {
  100. return obj + "";
  101. }
  102. // Support: Android <=2.3 only (functionish RegExp)
  103. return typeof obj === "object" || typeof obj === "function" ?
  104. class2type[ toString.call( obj ) ] || "object" :
  105. typeof obj;
  106. }
  107. /* global Symbol */
  108. // Defining this global in .eslintrc.json would create a danger of using the global
  109. // unguarded in another place, it seems safer to define global only for this module
  110. var
  111. version = "3.5.1",
  112. // Define a local copy of jQuery
  113. jQuery = function( selector, context ) {
  114. // The jQuery object is actually just the init constructor 'enhanced'
  115. // Need init if jQuery is called (just allow error to be thrown if not included)
  116. return new jQuery.fn.init( selector, context );
  117. };
  118. jQuery.fn = jQuery.prototype = {
  119. // The current version of jQuery being used
  120. jquery: version,
  121. constructor: jQuery,
  122. // The default length of a jQuery object is 0
  123. length: 0,
  124. toArray: function() {
  125. return slice.call( this );
  126. },
  127. // Get the Nth element in the matched element set OR
  128. // Get the whole matched element set as a clean array
  129. get: function( num ) {
  130. // Return all the elements in a clean array
  131. if ( num == null ) {
  132. return slice.call( this );
  133. }
  134. // Return just the one element from the set
  135. return num < 0 ? this[ num + this.length ] : this[ num ];
  136. },
  137. // Take an array of elements and push it onto the stack
  138. // (returning the new matched element set)
  139. pushStack: function( elems ) {
  140. // Build a new jQuery matched element set
  141. var ret = jQuery.merge( this.constructor(), elems );
  142. // Add the old object onto the stack (as a reference)
  143. ret.prevObject = this;
  144. // Return the newly-formed element set
  145. return ret;
  146. },
  147. // Execute a callback for every element in the matched set.
  148. each: function( callback ) {
  149. return jQuery.each( this, callback );
  150. },
  151. map: function( callback ) {
  152. return this.pushStack( jQuery.map( this, function( elem, i ) {
  153. return callback.call( elem, i, elem );
  154. } ) );
  155. },
  156. slice: function() {
  157. return this.pushStack( slice.apply( this, arguments ) );
  158. },
  159. first: function() {
  160. return this.eq( 0 );
  161. },
  162. last: function() {
  163. return this.eq( -1 );
  164. },
  165. even: function() {
  166. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  167. return ( i + 1 ) % 2;
  168. } ) );
  169. },
  170. odd: function() {
  171. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  172. return i % 2;
  173. } ) );
  174. },
  175. eq: function( i ) {
  176. var len = this.length,
  177. j = +i + ( i < 0 ? len : 0 );
  178. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  179. },
  180. end: function() {
  181. return this.prevObject || this.constructor();
  182. },
  183. // For internal use only.
  184. // Behaves like an Array's method, not like a jQuery method.
  185. push: push,
  186. sort: arr.sort,
  187. splice: arr.splice
  188. };
  189. jQuery.extend = jQuery.fn.extend = function() {
  190. var options, name, src, copy, copyIsArray, clone,
  191. target = arguments[ 0 ] || {},
  192. i = 1,
  193. length = arguments.length,
  194. deep = false;
  195. // Handle a deep copy situation
  196. if ( typeof target === "boolean" ) {
  197. deep = target;
  198. // Skip the boolean and the target
  199. target = arguments[ i ] || {};
  200. i++;
  201. }
  202. // Handle case when target is a string or something (possible in deep copy)
  203. if ( typeof target !== "object" && !isFunction( target ) ) {
  204. target = {};
  205. }
  206. // Extend jQuery itself if only one argument is passed
  207. if ( i === length ) {
  208. target = this;
  209. i--;
  210. }
  211. for ( ; i < length; i++ ) {
  212. // Only deal with non-null/undefined values
  213. if ( ( options = arguments[ i ] ) != null ) {
  214. // Extend the base object
  215. for ( name in options ) {
  216. copy = options[ name ];
  217. // Prevent Object.prototype pollution
  218. // Prevent never-ending loop
  219. if ( name === "__proto__" || target === copy ) {
  220. continue;
  221. }
  222. // Recurse if we're merging plain objects or arrays
  223. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  224. ( copyIsArray = Array.isArray( copy ) ) ) ) {
  225. src = target[ name ];
  226. // Ensure proper type for the source value
  227. if ( copyIsArray && !Array.isArray( src ) ) {
  228. clone = [];
  229. } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
  230. clone = {};
  231. } else {
  232. clone = src;
  233. }
  234. copyIsArray = false;
  235. // Never move original objects, clone them
  236. target[ name ] = jQuery.extend( deep, clone, copy );
  237. // Don't bring in undefined values
  238. } else if ( copy !== undefined ) {
  239. target[ name ] = copy;
  240. }
  241. }
  242. }
  243. }
  244. // Return the modified object
  245. return target;
  246. };
  247. jQuery.extend( {
  248. // Unique for each copy of jQuery on the page
  249. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  250. // Assume jQuery is ready without the ready module
  251. isReady: true,
  252. error: function( msg ) {
  253. throw new Error( msg );
  254. },
  255. noop: function() {},
  256. isPlainObject: function( obj ) {
  257. var proto, Ctor;
  258. // Detect obvious negatives
  259. // Use toString instead of jQuery.type to catch host objects
  260. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  261. return false;
  262. }
  263. proto = getProto( obj );
  264. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  265. if ( !proto ) {
  266. return true;
  267. }
  268. // Objects with prototype are plain iff they were constructed by a global Object function
  269. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  270. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  271. },
  272. isEmptyObject: function( obj ) {
  273. var name;
  274. for ( name in obj ) {
  275. return false;
  276. }
  277. return true;
  278. },
  279. // Evaluates a script in a provided context; falls back to the global one
  280. // if not specified.
  281. globalEval: function( code, options, doc ) {
  282. DOMEval( code, { nonce: options && options.nonce }, doc );
  283. },
  284. each: function( obj, callback ) {
  285. var length, i = 0;
  286. if ( isArrayLike( obj ) ) {
  287. length = obj.length;
  288. for ( ; i < length; i++ ) {
  289. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  290. break;
  291. }
  292. }
  293. } else {
  294. for ( i in obj ) {
  295. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  296. break;
  297. }
  298. }
  299. }
  300. return obj;
  301. },
  302. // results is for internal usage only
  303. makeArray: function( arr, results ) {
  304. var ret = results || [];
  305. if ( arr != null ) {
  306. if ( isArrayLike( Object( arr ) ) ) {
  307. jQuery.merge( ret,
  308. typeof arr === "string" ?
  309. [ arr ] : arr
  310. );
  311. } else {
  312. push.call( ret, arr );
  313. }
  314. }
  315. return ret;
  316. },
  317. inArray: function( elem, arr, i ) {
  318. return arr == null ? -1 : indexOf.call( arr, elem, i );
  319. },
  320. // Support: Android <=4.0 only, PhantomJS 1 only
  321. // push.apply(_, arraylike) throws on ancient WebKit
  322. merge: function( first, second ) {
  323. var len = +second.length,
  324. j = 0,
  325. i = first.length;
  326. for ( ; j < len; j++ ) {
  327. first[ i++ ] = second[ j ];
  328. }
  329. first.length = i;
  330. return first;
  331. },
  332. grep: function( elems, callback, invert ) {
  333. var callbackInverse,
  334. matches = [],
  335. i = 0,
  336. length = elems.length,
  337. callbackExpect = !invert;
  338. // Go through the array, only saving the items
  339. // that pass the validator function
  340. for ( ; i < length; i++ ) {
  341. callbackInverse = !callback( elems[ i ], i );
  342. if ( callbackInverse !== callbackExpect ) {
  343. matches.push( elems[ i ] );
  344. }
  345. }
  346. return matches;
  347. },
  348. // arg is for internal usage only
  349. map: function( elems, callback, arg ) {
  350. var length, value,
  351. i = 0,
  352. ret = [];
  353. // Go through the array, translating each of the items to their new values
  354. if ( isArrayLike( elems ) ) {
  355. length = elems.length;
  356. for ( ; i < length; i++ ) {
  357. value = callback( elems[ i ], i, arg );
  358. if ( value != null ) {
  359. ret.push( value );
  360. }
  361. }
  362. // Go through every key on the object,
  363. } else {
  364. for ( i in elems ) {
  365. value = callback( elems[ i ], i, arg );
  366. if ( value != null ) {
  367. ret.push( value );
  368. }
  369. }
  370. }
  371. // Flatten any nested arrays
  372. return flat( ret );
  373. },
  374. // A global GUID counter for objects
  375. guid: 1,
  376. // jQuery.support is not used in Core but other projects attach their
  377. // properties to it so it needs to exist.
  378. support: support
  379. } );
  380. if ( typeof Symbol === "function" ) {
  381. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  382. }
  383. // Populate the class2type map
  384. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  385. function( _i, name ) {
  386. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  387. } );
  388. function isArrayLike( obj ) {
  389. // Support: real iOS 8.2 only (not reproducible in simulator)
  390. // `in` check used to prevent JIT error (gh-2145)
  391. // hasOwn isn't used here due to false negatives
  392. // regarding Nodelist length in IE
  393. var length = !!obj && "length" in obj && obj.length,
  394. type = toType( obj );
  395. if ( isFunction( obj ) || isWindow( obj ) ) {
  396. return false;
  397. }
  398. return type === "array" || length === 0 ||
  399. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  400. }
  401. var Sizzle =
  402. /*!
  403. * Sizzle CSS Selector Engine v2.3.5
  404. * https://sizzlejs.com/
  405. *
  406. * Copyright JS Foundation and other contributors
  407. * Released under the MIT license
  408. * https://js.foundation/
  409. *
  410. * Date: 2020-03-14
  411. */
  412. ( function( window ) {
  413. var i,
  414. support,
  415. Expr,
  416. getText,
  417. isXML,
  418. tokenize,
  419. compile,
  420. select,
  421. outermostContext,
  422. sortInput,
  423. hasDuplicate,
  424. // Local document vars
  425. setDocument,
  426. document,
  427. docElem,
  428. documentIsHTML,
  429. rbuggyQSA,
  430. rbuggyMatches,
  431. matches,
  432. contains,
  433. // Instance-specific data
  434. expando = "sizzle" + 1 * new Date(),
  435. preferredDoc = window.document,
  436. dirruns = 0,
  437. done = 0,
  438. classCache = createCache(),
  439. tokenCache = createCache(),
  440. compilerCache = createCache(),
  441. nonnativeSelectorCache = createCache(),
  442. sortOrder = function( a, b ) {
  443. if ( a === b ) {
  444. hasDuplicate = true;
  445. }
  446. return 0;
  447. },
  448. // Instance methods
  449. hasOwn = ( {} ).hasOwnProperty,
  450. arr = [],
  451. pop = arr.pop,
  452. pushNative = arr.push,
  453. push = arr.push,
  454. slice = arr.slice,
  455. // Use a stripped-down indexOf as it's faster than native
  456. // https://jsperf.com/thor-indexof-vs-for/5
  457. indexOf = function( list, elem ) {
  458. var i = 0,
  459. len = list.length;
  460. for ( ; i < len; i++ ) {
  461. if ( list[ i ] === elem ) {
  462. return i;
  463. }
  464. }
  465. return -1;
  466. },
  467. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
  468. "ismap|loop|multiple|open|readonly|required|scoped",
  469. // Regular expressions
  470. // http://www.w3.org/TR/css3-selectors/#whitespace
  471. whitespace = "[\\x20\\t\\r\\n\\f]",
  472. // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
  473. identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
  474. "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
  475. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  476. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  477. // Operator (capture 2)
  478. "*([*^$|!~]?=)" + whitespace +
  479. // "Attribute values must be CSS identifiers [capture 5]
  480. // or strings [capture 3 or capture 4]"
  481. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
  482. whitespace + "*\\]",
  483. pseudos = ":(" + identifier + ")(?:\\((" +
  484. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  485. // 1. quoted (capture 3; capture 4 or capture 5)
  486. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  487. // 2. simple (capture 6)
  488. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  489. // 3. anything else (capture 2)
  490. ".*" +
  491. ")\\)|)",
  492. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  493. rwhitespace = new RegExp( whitespace + "+", "g" ),
  494. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
  495. whitespace + "+$", "g" ),
  496. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  497. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
  498. "*" ),
  499. rdescend = new RegExp( whitespace + "|>" ),
  500. rpseudo = new RegExp( pseudos ),
  501. ridentifier = new RegExp( "^" + identifier + "$" ),
  502. matchExpr = {
  503. "ID": new RegExp( "^#(" + identifier + ")" ),
  504. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  505. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  506. "ATTR": new RegExp( "^" + attributes ),
  507. "PSEUDO": new RegExp( "^" + pseudos ),
  508. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
  509. whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
  510. whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  511. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  512. // For use in libraries implementing .is()
  513. // We use this for POS matching in `select`
  514. "needsContext": new RegExp( "^" + whitespace +
  515. "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
  516. "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  517. },
  518. rhtml = /HTML$/i,
  519. rinputs = /^(?:input|select|textarea|button)$/i,
  520. rheader = /^h\d$/i,
  521. rnative = /^[^{]+\{\s*\[native \w/,
  522. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  523. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  524. rsibling = /[+~]/,
  525. // CSS escapes
  526. // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  527. runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),
  528. funescape = function( escape, nonHex ) {
  529. var high = "0x" + escape.slice( 1 ) - 0x10000;
  530. return nonHex ?
  531. // Strip the backslash prefix from a non-hex escape sequence
  532. nonHex :
  533. // Replace a hexadecimal escape sequence with the encoded Unicode code point
  534. // Support: IE <=11+
  535. // For values outside the Basic Multilingual Plane (BMP), manually construct a
  536. // surrogate pair
  537. high < 0 ?
  538. String.fromCharCode( high + 0x10000 ) :
  539. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  540. },
  541. // CSS string/identifier serialization
  542. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  543. rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  544. fcssescape = function( ch, asCodePoint ) {
  545. if ( asCodePoint ) {
  546. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  547. if ( ch === "\0" ) {
  548. return "\uFFFD";
  549. }
  550. // Control characters and (dependent upon position) numbers get escaped as code points
  551. return ch.slice( 0, -1 ) + "\\" +
  552. ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  553. }
  554. // Other potentially-special ASCII characters get backslash-escaped
  555. return "\\" + ch;
  556. },
  557. // Used for iframes
  558. // See setDocument()
  559. // Removing the function wrapper causes a "Permission Denied"
  560. // error in IE
  561. unloadHandler = function() {
  562. setDocument();
  563. },
  564. inDisabledFieldset = addCombinator(
  565. function( elem ) {
  566. return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
  567. },
  568. { dir: "parentNode", next: "legend" }
  569. );
  570. // Optimize for push.apply( _, NodeList )
  571. try {
  572. push.apply(
  573. ( arr = slice.call( preferredDoc.childNodes ) ),
  574. preferredDoc.childNodes
  575. );
  576. // Support: Android<4.0
  577. // Detect silently failing push.apply
  578. // eslint-disable-next-line no-unused-expressions
  579. arr[ preferredDoc.childNodes.length ].nodeType;
  580. } catch ( e ) {
  581. push = { apply: arr.length ?
  582. // Leverage slice if possible
  583. function( target, els ) {
  584. pushNative.apply( target, slice.call( els ) );
  585. } :
  586. // Support: IE<9
  587. // Otherwise append directly
  588. function( target, els ) {
  589. var j = target.length,
  590. i = 0;
  591. // Can't trust NodeList.length
  592. while ( ( target[ j++ ] = els[ i++ ] ) ) {}
  593. target.length = j - 1;
  594. }
  595. };
  596. }
  597. function Sizzle( selector, context, results, seed ) {
  598. var m, i, elem, nid, match, groups, newSelector,
  599. newContext = context && context.ownerDocument,
  600. // nodeType defaults to 9, since context defaults to document
  601. nodeType = context ? context.nodeType : 9;
  602. results = results || [];
  603. // Return early from calls with invalid selector or context
  604. if ( typeof selector !== "string" || !selector ||
  605. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  606. return results;
  607. }
  608. // Try to shortcut find operations (as opposed to filters) in HTML documents
  609. if ( !seed ) {
  610. setDocument( context );
  611. context = context || document;
  612. if ( documentIsHTML ) {
  613. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  614. // (excepting DocumentFragment context, where the methods don't exist)
  615. if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
  616. // ID selector
  617. if ( ( m = match[ 1 ] ) ) {
  618. // Document context
  619. if ( nodeType === 9 ) {
  620. if ( ( elem = context.getElementById( m ) ) ) {
  621. // Support: IE, Opera, Webkit
  622. // TODO: identify versions
  623. // getElementById can match elements by name instead of ID
  624. if ( elem.id === m ) {
  625. results.push( elem );
  626. return results;
  627. }
  628. } else {
  629. return results;
  630. }
  631. // Element context
  632. } else {
  633. // Support: IE, Opera, Webkit
  634. // TODO: identify versions
  635. // getElementById can match elements by name instead of ID
  636. if ( newContext && ( elem = newContext.getElementById( m ) ) &&
  637. contains( context, elem ) &&
  638. elem.id === m ) {
  639. results.push( elem );
  640. return results;
  641. }
  642. }
  643. // Type selector
  644. } else if ( match[ 2 ] ) {
  645. push.apply( results, context.getElementsByTagName( selector ) );
  646. return results;
  647. // Class selector
  648. } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
  649. context.getElementsByClassName ) {
  650. push.apply( results, context.getElementsByClassName( m ) );
  651. return results;
  652. }
  653. }
  654. // Take advantage of querySelectorAll
  655. if ( support.qsa &&
  656. !nonnativeSelectorCache[ selector + " " ] &&
  657. ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
  658. // Support: IE 8 only
  659. // Exclude object elements
  660. ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {
  661. newSelector = selector;
  662. newContext = context;
  663. // qSA considers elements outside a scoping root when evaluating child or
  664. // descendant combinators, which is not what we want.
  665. // In such cases, we work around the behavior by prefixing every selector in the
  666. // list with an ID selector referencing the scope context.
  667. // The technique has to be used as well when a leading combinator is used
  668. // as such selectors are not recognized by querySelectorAll.
  669. // Thanks to Andrew Dupont for this technique.
  670. if ( nodeType === 1 &&
  671. ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {
  672. // Expand context for sibling selectors
  673. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  674. context;
  675. // We can use :scope instead of the ID hack if the browser
  676. // supports it & if we're not changing the context.
  677. if ( newContext !== context || !support.scope ) {
  678. // Capture the context ID, setting it first if necessary
  679. if ( ( nid = context.getAttribute( "id" ) ) ) {
  680. nid = nid.replace( rcssescape, fcssescape );
  681. } else {
  682. context.setAttribute( "id", ( nid = expando ) );
  683. }
  684. }
  685. // Prefix every selector in the list
  686. groups = tokenize( selector );
  687. i = groups.length;
  688. while ( i-- ) {
  689. groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
  690. toSelector( groups[ i ] );
  691. }
  692. newSelector = groups.join( "," );
  693. }
  694. try {
  695. push.apply( results,
  696. newContext.querySelectorAll( newSelector )
  697. );
  698. return results;
  699. } catch ( qsaError ) {
  700. nonnativeSelectorCache( selector, true );
  701. } finally {
  702. if ( nid === expando ) {
  703. context.removeAttribute( "id" );
  704. }
  705. }
  706. }
  707. }
  708. }
  709. // All others
  710. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  711. }
  712. /**
  713. * Create key-value caches of limited size
  714. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  715. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  716. * deleting the oldest entry
  717. */
  718. function createCache() {
  719. var keys = [];
  720. function cache( key, value ) {
  721. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  722. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  723. // Only keep the most recent entries
  724. delete cache[ keys.shift() ];
  725. }
  726. return ( cache[ key + " " ] = value );
  727. }
  728. return cache;
  729. }
  730. /**
  731. * Mark a function for special use by Sizzle
  732. * @param {Function} fn The function to mark
  733. */
  734. function markFunction( fn ) {
  735. fn[ expando ] = true;
  736. return fn;
  737. }
  738. /**
  739. * Support testing using an element
  740. * @param {Function} fn Passed the created element and returns a boolean result
  741. */
  742. function assert( fn ) {
  743. var el = document.createElement( "fieldset" );
  744. try {
  745. return !!fn( el );
  746. } catch ( e ) {
  747. return false;
  748. } finally {
  749. // Remove from its parent by default
  750. if ( el.parentNode ) {
  751. el.parentNode.removeChild( el );
  752. }
  753. // release memory in IE
  754. el = null;
  755. }
  756. }
  757. /**
  758. * Adds the same handler for all of the specified attrs
  759. * @param {String} attrs Pipe-separated list of attributes
  760. * @param {Function} handler The method that will be applied
  761. */
  762. function addHandle( attrs, handler ) {
  763. var arr = attrs.split( "|" ),
  764. i = arr.length;
  765. while ( i-- ) {
  766. Expr.attrHandle[ arr[ i ] ] = handler;
  767. }
  768. }
  769. /**
  770. * Checks document order of two siblings
  771. * @param {Element} a
  772. * @param {Element} b
  773. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  774. */
  775. function siblingCheck( a, b ) {
  776. var cur = b && a,
  777. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  778. a.sourceIndex - b.sourceIndex;
  779. // Use IE sourceIndex if available on both nodes
  780. if ( diff ) {
  781. return diff;
  782. }
  783. // Check if b follows a
  784. if ( cur ) {
  785. while ( ( cur = cur.nextSibling ) ) {
  786. if ( cur === b ) {
  787. return -1;
  788. }
  789. }
  790. }
  791. return a ? 1 : -1;
  792. }
  793. /**
  794. * Returns a function to use in pseudos for input types
  795. * @param {String} type
  796. */
  797. function createInputPseudo( type ) {
  798. return function( elem ) {
  799. var name = elem.nodeName.toLowerCase();
  800. return name === "input" && elem.type === type;
  801. };
  802. }
  803. /**
  804. * Returns a function to use in pseudos for buttons
  805. * @param {String} type
  806. */
  807. function createButtonPseudo( type ) {
  808. return function( elem ) {
  809. var name = elem.nodeName.toLowerCase();
  810. return ( name === "input" || name === "button" ) && elem.type === type;
  811. };
  812. }
  813. /**
  814. * Returns a function to use in pseudos for :enabled/:disabled
  815. * @param {Boolean} disabled true for :disabled; false for :enabled
  816. */
  817. function createDisabledPseudo( disabled ) {
  818. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  819. return function( elem ) {
  820. // Only certain elements can match :enabled or :disabled
  821. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  822. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  823. if ( "form" in elem ) {
  824. // Check for inherited disabledness on relevant non-disabled elements:
  825. // * listed form-associated elements in a disabled fieldset
  826. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  827. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  828. // * option elements in a disabled optgroup
  829. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  830. // All such elements have a "form" property.
  831. if ( elem.parentNode && elem.disabled === false ) {
  832. // Option elements defer to a parent optgroup if present
  833. if ( "label" in elem ) {
  834. if ( "label" in elem.parentNode ) {
  835. return elem.parentNode.disabled === disabled;
  836. } else {
  837. return elem.disabled === disabled;
  838. }
  839. }
  840. // Support: IE 6 - 11
  841. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  842. return elem.isDisabled === disabled ||
  843. // Where there is no isDisabled, check manually
  844. /* jshint -W018 */
  845. elem.isDisabled !== !disabled &&
  846. inDisabledFieldset( elem ) === disabled;
  847. }
  848. return elem.disabled === disabled;
  849. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  850. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  851. // even exist on them, let alone have a boolean value.
  852. } else if ( "label" in elem ) {
  853. return elem.disabled === disabled;
  854. }
  855. // Remaining elements are neither :enabled nor :disabled
  856. return false;
  857. };
  858. }
  859. /**
  860. * Returns a function to use in pseudos for positionals
  861. * @param {Function} fn
  862. */
  863. function createPositionalPseudo( fn ) {
  864. return markFunction( function( argument ) {
  865. argument = +argument;
  866. return markFunction( function( seed, matches ) {
  867. var j,
  868. matchIndexes = fn( [], seed.length, argument ),
  869. i = matchIndexes.length;
  870. // Match elements found at the specified indexes
  871. while ( i-- ) {
  872. if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
  873. seed[ j ] = !( matches[ j ] = seed[ j ] );
  874. }
  875. }
  876. } );
  877. } );
  878. }
  879. /**
  880. * Checks a node for validity as a Sizzle context
  881. * @param {Element|Object=} context
  882. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  883. */
  884. function testContext( context ) {
  885. return context && typeof context.getElementsByTagName !== "undefined" && context;
  886. }
  887. // Expose support vars for convenience
  888. support = Sizzle.support = {};
  889. /**
  890. * Detects XML nodes
  891. * @param {Element|Object} elem An element or a document
  892. * @returns {Boolean} True iff elem is a non-HTML XML node
  893. */
  894. isXML = Sizzle.isXML = function( elem ) {
  895. var namespace = elem.namespaceURI,
  896. docElem = ( elem.ownerDocument || elem ).documentElement;
  897. // Support: IE <=8
  898. // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
  899. // https://bugs.jquery.com/ticket/4833
  900. return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
  901. };
  902. /**
  903. * Sets document-related variables once based on the current document
  904. * @param {Element|Object} [doc] An element or document object to use to set the document
  905. * @returns {Object} Returns the current document
  906. */
  907. setDocument = Sizzle.setDocument = function( node ) {
  908. var hasCompare, subWindow,
  909. doc = node ? node.ownerDocument || node : preferredDoc;
  910. // Return early if doc is invalid or already selected
  911. // Support: IE 11+, Edge 17 - 18+
  912. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  913. // two documents; shallow comparisons work.
  914. // eslint-disable-next-line eqeqeq
  915. if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
  916. return document;
  917. }
  918. // Update global variables
  919. document = doc;
  920. docElem = document.documentElement;
  921. documentIsHTML = !isXML( document );
  922. // Support: IE 9 - 11+, Edge 12 - 18+
  923. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  924. // Support: IE 11+, Edge 17 - 18+
  925. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  926. // two documents; shallow comparisons work.
  927. // eslint-disable-next-line eqeqeq
  928. if ( preferredDoc != document &&
  929. ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
  930. // Support: IE 11, Edge
  931. if ( subWindow.addEventListener ) {
  932. subWindow.addEventListener( "unload", unloadHandler, false );
  933. // Support: IE 9 - 10 only
  934. } else if ( subWindow.attachEvent ) {
  935. subWindow.attachEvent( "onunload", unloadHandler );
  936. }
  937. }
  938. // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
  939. // Safari 4 - 5 only, Opera <=11.6 - 12.x only
  940. // IE/Edge & older browsers don't support the :scope pseudo-class.
  941. // Support: Safari 6.0 only
  942. // Safari 6.0 supports :scope but it's an alias of :root there.
  943. support.scope = assert( function( el ) {
  944. docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
  945. return typeof el.querySelectorAll !== "undefined" &&
  946. !el.querySelectorAll( ":scope fieldset div" ).length;
  947. } );
  948. /* Attributes
  949. ---------------------------------------------------------------------- */
  950. // Support: IE<8
  951. // Verify that getAttribute really returns attributes and not properties
  952. // (excepting IE8 booleans)
  953. support.attributes = assert( function( el ) {
  954. el.className = "i";
  955. return !el.getAttribute( "className" );
  956. } );
  957. /* getElement(s)By*
  958. ---------------------------------------------------------------------- */
  959. // Check if getElementsByTagName("*") returns only elements
  960. support.getElementsByTagName = assert( function( el ) {
  961. el.appendChild( document.createComment( "" ) );
  962. return !el.getElementsByTagName( "*" ).length;
  963. } );
  964. // Support: IE<9
  965. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  966. // Support: IE<10
  967. // Check if getElementById returns elements by name
  968. // The broken getElementById methods don't pick up programmatically-set names,
  969. // so use a roundabout getElementsByName test
  970. support.getById = assert( function( el ) {
  971. docElem.appendChild( el ).id = expando;
  972. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  973. } );
  974. // ID filter and find
  975. if ( support.getById ) {
  976. Expr.filter[ "ID" ] = function( id ) {
  977. var attrId = id.replace( runescape, funescape );
  978. return function( elem ) {
  979. return elem.getAttribute( "id" ) === attrId;
  980. };
  981. };
  982. Expr.find[ "ID" ] = function( id, context ) {
  983. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  984. var elem = context.getElementById( id );
  985. return elem ? [ elem ] : [];
  986. }
  987. };
  988. } else {
  989. Expr.filter[ "ID" ] = function( id ) {
  990. var attrId = id.replace( runescape, funescape );
  991. return function( elem ) {
  992. var node = typeof elem.getAttributeNode !== "undefined" &&
  993. elem.getAttributeNode( "id" );
  994. return node && node.value === attrId;
  995. };
  996. };
  997. // Support: IE 6 - 7 only
  998. // getElementById is not reliable as a find shortcut
  999. Expr.find[ "ID" ] = function( id, context ) {
  1000. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1001. var node, i, elems,
  1002. elem = context.getElementById( id );
  1003. if ( elem ) {
  1004. // Verify the id attribute
  1005. node = elem.getAttributeNode( "id" );
  1006. if ( node && node.value === id ) {
  1007. return [ elem ];
  1008. }
  1009. // Fall back on getElementsByName
  1010. elems = context.getElementsByName( id );
  1011. i = 0;
  1012. while ( ( elem = elems[ i++ ] ) ) {
  1013. node = elem.getAttributeNode( "id" );
  1014. if ( node && node.value === id ) {
  1015. return [ elem ];
  1016. }
  1017. }
  1018. }
  1019. return [];
  1020. }
  1021. };
  1022. }
  1023. // Tag
  1024. Expr.find[ "TAG" ] = support.getElementsByTagName ?
  1025. function( tag, context ) {
  1026. if ( typeof context.getElementsByTagName !== "undefined" ) {
  1027. return context.getElementsByTagName( tag );
  1028. // DocumentFragment nodes don't have gEBTN
  1029. } else if ( support.qsa ) {
  1030. return context.querySelectorAll( tag );
  1031. }
  1032. } :
  1033. function( tag, context ) {
  1034. var elem,
  1035. tmp = [],
  1036. i = 0,
  1037. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  1038. results = context.getElementsByTagName( tag );
  1039. // Filter out possible comments
  1040. if ( tag === "*" ) {
  1041. while ( ( elem = results[ i++ ] ) ) {
  1042. if ( elem.nodeType === 1 ) {
  1043. tmp.push( elem );
  1044. }
  1045. }
  1046. return tmp;
  1047. }
  1048. return results;
  1049. };
  1050. // Class
  1051. Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
  1052. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  1053. return context.getElementsByClassName( className );
  1054. }
  1055. };
  1056. /* QSA/matchesSelector
  1057. ---------------------------------------------------------------------- */
  1058. // QSA and matchesSelector support
  1059. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  1060. rbuggyMatches = [];
  1061. // qSa(:focus) reports false when true (Chrome 21)
  1062. // We allow this because of a bug in IE8/9 that throws an error
  1063. // whenever `document.activeElement` is accessed on an iframe
  1064. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  1065. // See https://bugs.jquery.com/ticket/13378
  1066. rbuggyQSA = [];
  1067. if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
  1068. // Build QSA regex
  1069. // Regex strategy adopted from Diego Perini
  1070. assert( function( el ) {
  1071. var input;
  1072. // Select is set to empty string on purpose
  1073. // This is to test IE's treatment of not explicitly
  1074. // setting a boolean content attribute,
  1075. // since its presence should be enough
  1076. // https://bugs.jquery.com/ticket/12359
  1077. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  1078. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  1079. "<option selected=''></option></select>";
  1080. // Support: IE8, Opera 11-12.16
  1081. // Nothing should be selected when empty strings follow ^= or $= or *=
  1082. // The test attribute must be unknown in Opera but "safe" for WinRT
  1083. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  1084. if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
  1085. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  1086. }
  1087. // Support: IE8
  1088. // Boolean attributes and "value" are not treated correctly
  1089. if ( !el.querySelectorAll( "[selected]" ).length ) {
  1090. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  1091. }
  1092. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  1093. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  1094. rbuggyQSA.push( "~=" );
  1095. }
  1096. // Support: IE 11+, Edge 15 - 18+
  1097. // IE 11/Edge don't find elements on a `[name='']` query in some cases.
  1098. // Adding a temporary attribute to the document before the selection works
  1099. // around the issue.
  1100. // Interestingly, IE 10 & older don't seem to have the issue.
  1101. input = document.createElement( "input" );
  1102. input.setAttribute( "name", "" );
  1103. el.appendChild( input );
  1104. if ( !el.querySelectorAll( "[name='']" ).length ) {
  1105. rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
  1106. whitespace + "*(?:''|\"\")" );
  1107. }
  1108. // Webkit/Opera - :checked should return selected option elements
  1109. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1110. // IE8 throws error here and will not see later tests
  1111. if ( !el.querySelectorAll( ":checked" ).length ) {
  1112. rbuggyQSA.push( ":checked" );
  1113. }
  1114. // Support: Safari 8+, iOS 8+
  1115. // https://bugs.webkit.org/show_bug.cgi?id=136851
  1116. // In-page `selector#id sibling-combinator selector` fails
  1117. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  1118. rbuggyQSA.push( ".#.+[+~]" );
  1119. }
  1120. // Support: Firefox <=3.6 - 5 only
  1121. // Old Firefox doesn't throw on a badly-escaped identifier.
  1122. el.querySelectorAll( "\\\f" );
  1123. rbuggyQSA.push( "[\\r\\n\\f]" );
  1124. } );
  1125. assert( function( el ) {
  1126. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  1127. "<select disabled='disabled'><option/></select>";
  1128. // Support: Windows 8 Native Apps
  1129. // The type and name attributes are restricted during .innerHTML assignment
  1130. var input = document.createElement( "input" );
  1131. input.setAttribute( "type", "hidden" );
  1132. el.appendChild( input ).setAttribute( "name", "D" );
  1133. // Support: IE8
  1134. // Enforce case-sensitivity of name attribute
  1135. if ( el.querySelectorAll( "[name=d]" ).length ) {
  1136. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  1137. }
  1138. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  1139. // IE8 throws error here and will not see later tests
  1140. if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
  1141. rbuggyQSA.push( ":enabled", ":disabled" );
  1142. }
  1143. // Support: IE9-11+
  1144. // IE's :disabled selector does not pick up the children of disabled fieldsets
  1145. docElem.appendChild( el ).disabled = true;
  1146. if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
  1147. rbuggyQSA.push( ":enabled", ":disabled" );
  1148. }
  1149. // Support: Opera 10 - 11 only
  1150. // Opera 10-11 does not throw on post-comma invalid pseudos
  1151. el.querySelectorAll( "*,:x" );
  1152. rbuggyQSA.push( ",.*:" );
  1153. } );
  1154. }
  1155. if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
  1156. docElem.webkitMatchesSelector ||
  1157. docElem.mozMatchesSelector ||
  1158. docElem.oMatchesSelector ||
  1159. docElem.msMatchesSelector ) ) ) ) {
  1160. assert( function( el ) {
  1161. // Check to see if it's possible to do matchesSelector
  1162. // on a disconnected node (IE 9)
  1163. support.disconnectedMatch = matches.call( el, "*" );
  1164. // This should fail with an exception
  1165. // Gecko does not error, returns false instead
  1166. matches.call( el, "[s!='']:x" );
  1167. rbuggyMatches.push( "!=", pseudos );
  1168. } );
  1169. }
  1170. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
  1171. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
  1172. /* Contains
  1173. ---------------------------------------------------------------------- */
  1174. hasCompare = rnative.test( docElem.compareDocumentPosition );
  1175. // Element contains another
  1176. // Purposefully self-exclusive
  1177. // As in, an element does not contain itself
  1178. contains = hasCompare || rnative.test( docElem.contains ) ?
  1179. function( a, b ) {
  1180. var adown = a.nodeType === 9 ? a.documentElement : a,
  1181. bup = b && b.parentNode;
  1182. return a === bup || !!( bup && bup.nodeType === 1 && (
  1183. adown.contains ?
  1184. adown.contains( bup ) :
  1185. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  1186. ) );
  1187. } :
  1188. function( a, b ) {
  1189. if ( b ) {
  1190. while ( ( b = b.parentNode ) ) {
  1191. if ( b === a ) {
  1192. return true;
  1193. }
  1194. }
  1195. }
  1196. return false;
  1197. };
  1198. /* Sorting
  1199. ---------------------------------------------------------------------- */
  1200. // Document order sorting
  1201. sortOrder = hasCompare ?
  1202. function( a, b ) {
  1203. // Flag for duplicate removal
  1204. if ( a === b ) {
  1205. hasDuplicate = true;
  1206. return 0;
  1207. }
  1208. // Sort on method existence if only one input has compareDocumentPosition
  1209. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  1210. if ( compare ) {
  1211. return compare;
  1212. }
  1213. // Calculate position if both inputs belong to the same document
  1214. // Support: IE 11+, Edge 17 - 18+
  1215. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1216. // two documents; shallow comparisons work.
  1217. // eslint-disable-next-line eqeqeq
  1218. compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
  1219. a.compareDocumentPosition( b ) :
  1220. // Otherwise we know they are disconnected
  1221. 1;
  1222. // Disconnected nodes
  1223. if ( compare & 1 ||
  1224. ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
  1225. // Choose the first element that is related to our preferred document
  1226. // Support: IE 11+, Edge 17 - 18+
  1227. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1228. // two documents; shallow comparisons work.
  1229. // eslint-disable-next-line eqeqeq
  1230. if ( a == document || a.ownerDocument == preferredDoc &&
  1231. contains( preferredDoc, a ) ) {
  1232. return -1;
  1233. }
  1234. // Support: IE 11+, Edge 17 - 18+
  1235. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1236. // two documents; shallow comparisons work.
  1237. // eslint-disable-next-line eqeqeq
  1238. if ( b == document || b.ownerDocument == preferredDoc &&
  1239. contains( preferredDoc, b ) ) {
  1240. return 1;
  1241. }
  1242. // Maintain original order
  1243. return sortInput ?
  1244. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1245. 0;
  1246. }
  1247. return compare & 4 ? -1 : 1;
  1248. } :
  1249. function( a, b ) {
  1250. // Exit early if the nodes are identical
  1251. if ( a === b ) {
  1252. hasDuplicate = true;
  1253. return 0;
  1254. }
  1255. var cur,
  1256. i = 0,
  1257. aup = a.parentNode,
  1258. bup = b.parentNode,
  1259. ap = [ a ],
  1260. bp = [ b ];
  1261. // Parentless nodes are either documents or disconnected
  1262. if ( !aup || !bup ) {
  1263. // Support: IE 11+, Edge 17 - 18+
  1264. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1265. // two documents; shallow comparisons work.
  1266. /* eslint-disable eqeqeq */
  1267. return a == document ? -1 :
  1268. b == document ? 1 :
  1269. /* eslint-enable eqeqeq */
  1270. aup ? -1 :
  1271. bup ? 1 :
  1272. sortInput ?
  1273. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1274. 0;
  1275. // If the nodes are siblings, we can do a quick check
  1276. } else if ( aup === bup ) {
  1277. return siblingCheck( a, b );
  1278. }
  1279. // Otherwise we need full lists of their ancestors for comparison
  1280. cur = a;
  1281. while ( ( cur = cur.parentNode ) ) {
  1282. ap.unshift( cur );
  1283. }
  1284. cur = b;
  1285. while ( ( cur = cur.parentNode ) ) {
  1286. bp.unshift( cur );
  1287. }
  1288. // Walk down the tree looking for a discrepancy
  1289. while ( ap[ i ] === bp[ i ] ) {
  1290. i++;
  1291. }
  1292. return i ?
  1293. // Do a sibling check if the nodes have a common ancestor
  1294. siblingCheck( ap[ i ], bp[ i ] ) :
  1295. // Otherwise nodes in our document sort first
  1296. // Support: IE 11+, Edge 17 - 18+
  1297. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1298. // two documents; shallow comparisons work.
  1299. /* eslint-disable eqeqeq */
  1300. ap[ i ] == preferredDoc ? -1 :
  1301. bp[ i ] == preferredDoc ? 1 :
  1302. /* eslint-enable eqeqeq */
  1303. 0;
  1304. };
  1305. return document;
  1306. };
  1307. Sizzle.matches = function( expr, elements ) {
  1308. return Sizzle( expr, null, null, elements );
  1309. };
  1310. Sizzle.matchesSelector = function( elem, expr ) {
  1311. setDocument( elem );
  1312. if ( support.matchesSelector && documentIsHTML &&
  1313. !nonnativeSelectorCache[ expr + " " ] &&
  1314. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  1315. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  1316. try {
  1317. var ret = matches.call( elem, expr );
  1318. // IE 9's matchesSelector returns false on disconnected nodes
  1319. if ( ret || support.disconnectedMatch ||
  1320. // As well, disconnected nodes are said to be in a document
  1321. // fragment in IE 9
  1322. elem.document && elem.document.nodeType !== 11 ) {
  1323. return ret;
  1324. }
  1325. } catch ( e ) {
  1326. nonnativeSelectorCache( expr, true );
  1327. }
  1328. }
  1329. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  1330. };
  1331. Sizzle.contains = function( context, elem ) {
  1332. // Set document vars if needed
  1333. // Support: IE 11+, Edge 17 - 18+
  1334. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1335. // two documents; shallow comparisons work.
  1336. // eslint-disable-next-line eqeqeq
  1337. if ( ( context.ownerDocument || context ) != document ) {
  1338. setDocument( context );
  1339. }
  1340. return contains( context, elem );
  1341. };
  1342. Sizzle.attr = function( elem, name ) {
  1343. // Set document vars if needed
  1344. // Support: IE 11+, Edge 17 - 18+
  1345. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1346. // two documents; shallow comparisons work.
  1347. // eslint-disable-next-line eqeqeq
  1348. if ( ( elem.ownerDocument || elem ) != document ) {
  1349. setDocument( elem );
  1350. }
  1351. var fn = Expr.attrHandle[ name.toLowerCase() ],
  1352. // Don't get fooled by Object.prototype properties (jQuery #13807)
  1353. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  1354. fn( elem, name, !documentIsHTML ) :
  1355. undefined;
  1356. return val !== undefined ?
  1357. val :
  1358. support.attributes || !documentIsHTML ?
  1359. elem.getAttribute( name ) :
  1360. ( val = elem.getAttributeNode( name ) ) && val.specified ?
  1361. val.value :
  1362. null;
  1363. };
  1364. Sizzle.escape = function( sel ) {
  1365. return ( sel + "" ).replace( rcssescape, fcssescape );
  1366. };
  1367. Sizzle.error = function( msg ) {
  1368. throw new Error( "Syntax error, unrecognized expression: " + msg );
  1369. };
  1370. /**
  1371. * Document sorting and removing duplicates
  1372. * @param {ArrayLike} results
  1373. */
  1374. Sizzle.uniqueSort = function( results ) {
  1375. var elem,
  1376. duplicates = [],
  1377. j = 0,
  1378. i = 0;
  1379. // Unless we *know* we can detect duplicates, assume their presence
  1380. hasDuplicate = !support.detectDuplicates;
  1381. sortInput = !support.sortStable && results.slice( 0 );
  1382. results.sort( sortOrder );
  1383. if ( hasDuplicate ) {
  1384. while ( ( elem = results[ i++ ] ) ) {
  1385. if ( elem === results[ i ] ) {
  1386. j = duplicates.push( i );
  1387. }
  1388. }
  1389. while ( j-- ) {
  1390. results.splice( duplicates[ j ], 1 );
  1391. }
  1392. }
  1393. // Clear input after sorting to release objects
  1394. // See https://github.com/jquery/sizzle/pull/225
  1395. sortInput = null;
  1396. return results;
  1397. };
  1398. /**
  1399. * Utility function for retrieving the text value of an array of DOM nodes
  1400. * @param {Array|Element} elem
  1401. */
  1402. getText = Sizzle.getText = function( elem ) {
  1403. var node,
  1404. ret = "",
  1405. i = 0,
  1406. nodeType = elem.nodeType;
  1407. if ( !nodeType ) {
  1408. // If no nodeType, this is expected to be an array
  1409. while ( ( node = elem[ i++ ] ) ) {
  1410. // Do not traverse comment nodes
  1411. ret += getText( node );
  1412. }
  1413. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  1414. // Use textContent for elements
  1415. // innerText usage removed for consistency of new lines (jQuery #11153)
  1416. if ( typeof elem.textContent === "string" ) {
  1417. return elem.textContent;
  1418. } else {
  1419. // Traverse its children
  1420. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1421. ret += getText( elem );
  1422. }
  1423. }
  1424. } else if ( nodeType === 3 || nodeType === 4 ) {
  1425. return elem.nodeValue;
  1426. }
  1427. // Do not include comment or processing instruction nodes
  1428. return ret;
  1429. };
  1430. Expr = Sizzle.selectors = {
  1431. // Can be adjusted by the user
  1432. cacheLength: 50,
  1433. createPseudo: markFunction,
  1434. match: matchExpr,
  1435. attrHandle: {},
  1436. find: {},
  1437. relative: {
  1438. ">": { dir: "parentNode", first: true },
  1439. " ": { dir: "parentNode" },
  1440. "+": { dir: "previousSibling", first: true },
  1441. "~": { dir: "previousSibling" }
  1442. },
  1443. preFilter: {
  1444. "ATTR": function( match ) {
  1445. match[ 1 ] = match[ 1 ].replace( runescape, funescape );
  1446. // Move the given value to match[3] whether quoted or unquoted
  1447. match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
  1448. match[ 5 ] || "" ).replace( runescape, funescape );
  1449. if ( match[ 2 ] === "~=" ) {
  1450. match[ 3 ] = " " + match[ 3 ] + " ";
  1451. }
  1452. return match.slice( 0, 4 );
  1453. },
  1454. "CHILD": function( match ) {
  1455. /* matches from matchExpr["CHILD"]
  1456. 1 type (only|nth|...)
  1457. 2 what (child|of-type)
  1458. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  1459. 4 xn-component of xn+y argument ([+-]?\d*n|)
  1460. 5 sign of xn-component
  1461. 6 x of xn-component
  1462. 7 sign of y-component
  1463. 8 y of y-component
  1464. */
  1465. match[ 1 ] = match[ 1 ].toLowerCase();
  1466. if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
  1467. // nth-* requires argument
  1468. if ( !match[ 3 ] ) {
  1469. Sizzle.error( match[ 0 ] );
  1470. }
  1471. // numeric x and y parameters for Expr.filter.CHILD
  1472. // remember that false/true cast respectively to 0/1
  1473. match[ 4 ] = +( match[ 4 ] ?
  1474. match[ 5 ] + ( match[ 6 ] || 1 ) :
  1475. 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
  1476. match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
  1477. // other types prohibit arguments
  1478. } else if ( match[ 3 ] ) {
  1479. Sizzle.error( match[ 0 ] );
  1480. }
  1481. return match;
  1482. },
  1483. "PSEUDO": function( match ) {
  1484. var excess,
  1485. unquoted = !match[ 6 ] && match[ 2 ];
  1486. if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
  1487. return null;
  1488. }
  1489. // Accept quoted arguments as-is
  1490. if ( match[ 3 ] ) {
  1491. match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
  1492. // Strip excess characters from unquoted arguments
  1493. } else if ( unquoted && rpseudo.test( unquoted ) &&
  1494. // Get excess from tokenize (recursively)
  1495. ( excess = tokenize( unquoted, true ) ) &&
  1496. // advance to the next closing parenthesis
  1497. ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
  1498. // excess is a negative index
  1499. match[ 0 ] = match[ 0 ].slice( 0, excess );
  1500. match[ 2 ] = unquoted.slice( 0, excess );
  1501. }
  1502. // Return only captures needed by the pseudo filter method (type and argument)
  1503. return match.slice( 0, 3 );
  1504. }
  1505. },
  1506. filter: {
  1507. "TAG": function( nodeNameSelector ) {
  1508. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  1509. return nodeNameSelector === "*" ?
  1510. function() {
  1511. return true;
  1512. } :
  1513. function( elem ) {
  1514. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  1515. };
  1516. },
  1517. "CLASS": function( className ) {
  1518. var pattern = classCache[ className + " " ];
  1519. return pattern ||
  1520. ( pattern = new RegExp( "(^|" + whitespace +
  1521. ")" + className + "(" + whitespace + "|$)" ) ) && classCache(
  1522. className, function( elem ) {
  1523. return pattern.test(
  1524. typeof elem.className === "string" && elem.className ||
  1525. typeof elem.getAttribute !== "undefined" &&
  1526. elem.getAttribute( "class" ) ||
  1527. ""
  1528. );
  1529. } );
  1530. },
  1531. "ATTR": function( name, operator, check ) {
  1532. return function( elem ) {
  1533. var result = Sizzle.attr( elem, name );
  1534. if ( result == null ) {
  1535. return operator === "!=";
  1536. }
  1537. if ( !operator ) {
  1538. return true;
  1539. }
  1540. result += "";
  1541. /* eslint-disable max-len */
  1542. return operator === "=" ? result === check :
  1543. operator === "!=" ? result !== check :
  1544. operator === "^=" ? check && result.indexOf( check ) === 0 :
  1545. operator === "*=" ? check && result.indexOf( check ) > -1 :
  1546. operator === "$=" ? check && result.slice( -check.length ) === check :
  1547. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  1548. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  1549. false;
  1550. /* eslint-enable max-len */
  1551. };
  1552. },
  1553. "CHILD": function( type, what, _argument, first, last ) {
  1554. var simple = type.slice( 0, 3 ) !== "nth",
  1555. forward = type.slice( -4 ) !== "last",
  1556. ofType = what === "of-type";
  1557. return first === 1 && last === 0 ?
  1558. // Shortcut for :nth-*(n)
  1559. function( elem ) {
  1560. return !!elem.parentNode;
  1561. } :
  1562. function( elem, _context, xml ) {
  1563. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  1564. dir = simple !== forward ? "nextSibling" : "previousSibling",
  1565. parent = elem.parentNode,
  1566. name = ofType && elem.nodeName.toLowerCase(),
  1567. useCache = !xml && !ofType,
  1568. diff = false;
  1569. if ( parent ) {
  1570. // :(first|last|only)-(child|of-type)
  1571. if ( simple ) {
  1572. while ( dir ) {
  1573. node = elem;
  1574. while ( ( node = node[ dir ] ) ) {
  1575. if ( ofType ?
  1576. node.nodeName.toLowerCase() === name :
  1577. node.nodeType === 1 ) {
  1578. return false;
  1579. }
  1580. }
  1581. // Reverse direction for :only-* (if we haven't yet done so)
  1582. start = dir = type === "only" && !start && "nextSibling";
  1583. }
  1584. return true;
  1585. }
  1586. start = [ forward ? parent.firstChild : parent.lastChild ];
  1587. // non-xml :nth-child(...) stores cache data on `parent`
  1588. if ( forward && useCache ) {
  1589. // Seek `elem` from a previously-cached index
  1590. // ...in a gzip-friendly way
  1591. node = parent;
  1592. outerCache = node[ expando ] || ( node[ expando ] = {} );
  1593. // Support: IE <9 only
  1594. // Defend against cloned attroperties (jQuery gh-1709)
  1595. uniqueCache = outerCache[ node.uniqueID ] ||
  1596. ( outerCache[ node.uniqueID ] = {} );
  1597. cache = uniqueCache[ type ] || [];
  1598. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1599. diff = nodeIndex && cache[ 2 ];
  1600. node = nodeIndex && parent.childNodes[ nodeIndex ];
  1601. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  1602. // Fallback to seeking `elem` from the start
  1603. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  1604. // When found, cache indexes on `parent` and break
  1605. if ( node.nodeType === 1 && ++diff && node === elem ) {
  1606. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  1607. break;
  1608. }
  1609. }
  1610. } else {
  1611. // Use previously-cached element index if available
  1612. if ( useCache ) {
  1613. // ...in a gzip-friendly way
  1614. node = elem;
  1615. outerCache = node[ expando ] || ( node[ expando ] = {} );
  1616. // Support: IE <9 only
  1617. // Defend against cloned attroperties (jQuery gh-1709)
  1618. uniqueCache = outerCache[ node.uniqueID ] ||
  1619. ( outerCache[ node.uniqueID ] = {} );
  1620. cache = uniqueCache[ type ] || [];
  1621. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1622. diff = nodeIndex;
  1623. }
  1624. // xml :nth-child(...)
  1625. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  1626. if ( diff === false ) {
  1627. // Use the same loop as above to seek `elem` from the start
  1628. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  1629. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  1630. if ( ( ofType ?
  1631. node.nodeName.toLowerCase() === name :
  1632. node.nodeType === 1 ) &&
  1633. ++diff ) {
  1634. // Cache the index of each encountered element
  1635. if ( useCache ) {
  1636. outerCache = node[ expando ] ||
  1637. ( node[ expando ] = {} );
  1638. // Support: IE <9 only
  1639. // Defend against cloned attroperties (jQuery gh-1709)
  1640. uniqueCache = outerCache[ node.uniqueID ] ||
  1641. ( outerCache[ node.uniqueID ] = {} );
  1642. uniqueCache[ type ] = [ dirruns, diff ];
  1643. }
  1644. if ( node === elem ) {
  1645. break;
  1646. }
  1647. }
  1648. }
  1649. }
  1650. }
  1651. // Incorporate the offset, then check against cycle size
  1652. diff -= last;
  1653. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  1654. }
  1655. };
  1656. },
  1657. "PSEUDO": function( pseudo, argument ) {
  1658. // pseudo-class names are case-insensitive
  1659. // http://www.w3.org/TR/selectors/#pseudo-classes
  1660. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  1661. // Remember that setFilters inherits from pseudos
  1662. var args,
  1663. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  1664. Sizzle.error( "unsupported pseudo: " + pseudo );
  1665. // The user may use createPseudo to indicate that
  1666. // arguments are needed to create the filter function
  1667. // just as Sizzle does
  1668. if ( fn[ expando ] ) {
  1669. return fn( argument );
  1670. }
  1671. // But maintain support for old signatures
  1672. if ( fn.length > 1 ) {
  1673. args = [ pseudo, pseudo, "", argument ];
  1674. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  1675. markFunction( function( seed, matches ) {
  1676. var idx,
  1677. matched = fn( seed, argument ),
  1678. i = matched.length;
  1679. while ( i-- ) {
  1680. idx = indexOf( seed, matched[ i ] );
  1681. seed[ idx ] = !( matches[ idx ] = matched[ i ] );
  1682. }
  1683. } ) :
  1684. function( elem ) {
  1685. return fn( elem, 0, args );
  1686. };
  1687. }
  1688. return fn;
  1689. }
  1690. },
  1691. pseudos: {
  1692. // Potentially complex pseudos
  1693. "not": markFunction( function( selector ) {
  1694. // Trim the selector passed to compile
  1695. // to avoid treating leading and trailing
  1696. // spaces as combinators
  1697. var input = [],
  1698. results = [],
  1699. matcher = compile( selector.replace( rtrim, "$1" ) );
  1700. return matcher[ expando ] ?
  1701. markFunction( function( seed, matches, _context, xml ) {
  1702. var elem,
  1703. unmatched = matcher( seed, null, xml, [] ),
  1704. i = seed.length;
  1705. // Match elements unmatched by `matcher`
  1706. while ( i-- ) {
  1707. if ( ( elem = unmatched[ i ] ) ) {
  1708. seed[ i ] = !( matches[ i ] = elem );
  1709. }
  1710. }
  1711. } ) :
  1712. function( elem, _context, xml ) {
  1713. input[ 0 ] = elem;
  1714. matcher( input, null, xml, results );
  1715. // Don't keep the element (issue #299)
  1716. input[ 0 ] = null;
  1717. return !results.pop();
  1718. };
  1719. } ),
  1720. "has": markFunction( function( selector ) {
  1721. return function( elem ) {
  1722. return Sizzle( selector, elem ).length > 0;
  1723. };
  1724. } ),
  1725. "contains": markFunction( function( text ) {
  1726. text = text.replace( runescape, funescape );
  1727. return function( elem ) {
  1728. return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
  1729. };
  1730. } ),
  1731. // "Whether an element is represented by a :lang() selector
  1732. // is based solely on the element's language value
  1733. // being equal to the identifier C,
  1734. // or beginning with the identifier C immediately followed by "-".
  1735. // The matching of C against the element's language value is performed case-insensitively.
  1736. // The identifier C does not have to be a valid language name."
  1737. // http://www.w3.org/TR/selectors/#lang-pseudo
  1738. "lang": markFunction( function( lang ) {
  1739. // lang value must be a valid identifier
  1740. if ( !ridentifier.test( lang || "" ) ) {
  1741. Sizzle.error( "unsupported lang: " + lang );
  1742. }
  1743. lang = lang.replace( runescape, funescape ).toLowerCase();
  1744. return function( elem ) {
  1745. var elemLang;
  1746. do {
  1747. if ( ( elemLang = documentIsHTML ?
  1748. elem.lang :
  1749. elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
  1750. elemLang = elemLang.toLowerCase();
  1751. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  1752. }
  1753. } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
  1754. return false;
  1755. };
  1756. } ),
  1757. // Miscellaneous
  1758. "target": function( elem ) {
  1759. var hash = window.location && window.location.hash;
  1760. return hash && hash.slice( 1 ) === elem.id;
  1761. },
  1762. "root": function( elem ) {
  1763. return elem === docElem;
  1764. },
  1765. "focus": function( elem ) {
  1766. return elem === document.activeElement &&
  1767. ( !document.hasFocus || document.hasFocus() ) &&
  1768. !!( elem.type || elem.href || ~elem.tabIndex );
  1769. },
  1770. // Boolean properties
  1771. "enabled": createDisabledPseudo( false ),
  1772. "disabled": createDisabledPseudo( true ),
  1773. "checked": function( elem ) {
  1774. // In CSS3, :checked should return both checked and selected elements
  1775. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1776. var nodeName = elem.nodeName.toLowerCase();
  1777. return ( nodeName === "input" && !!elem.checked ) ||
  1778. ( nodeName === "option" && !!elem.selected );
  1779. },
  1780. "selected": function( elem ) {
  1781. // Accessing this property makes selected-by-default
  1782. // options in Safari work properly
  1783. if ( elem.parentNode ) {
  1784. // eslint-disable-next-line no-unused-expressions
  1785. elem.parentNode.selectedIndex;
  1786. }
  1787. return elem.selected === true;
  1788. },
  1789. // Contents
  1790. "empty": function( elem ) {
  1791. // http://www.w3.org/TR/selectors/#empty-pseudo
  1792. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  1793. // but not by others (comment: 8; processing instruction: 7; etc.)
  1794. // nodeType < 6 works because attributes (2) do not appear as children
  1795. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1796. if ( elem.nodeType < 6 ) {
  1797. return false;
  1798. }
  1799. }
  1800. return true;
  1801. },
  1802. "parent": function( elem ) {
  1803. return !Expr.pseudos[ "empty" ]( elem );
  1804. },
  1805. // Element/input types
  1806. "header": function( elem ) {
  1807. return rheader.test( elem.nodeName );
  1808. },
  1809. "input": function( elem ) {
  1810. return rinputs.test( elem.nodeName );
  1811. },
  1812. "button": function( elem ) {
  1813. var name = elem.nodeName.toLowerCase();
  1814. return name === "input" && elem.type === "button" || name === "button";
  1815. },
  1816. "text": function( elem ) {
  1817. var attr;
  1818. return elem.nodeName.toLowerCase() === "input" &&
  1819. elem.type === "text" &&
  1820. // Support: IE<8
  1821. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  1822. ( ( attr = elem.getAttribute( "type" ) ) == null ||
  1823. attr.toLowerCase() === "text" );
  1824. },
  1825. // Position-in-collection
  1826. "first": createPositionalPseudo( function() {
  1827. return [ 0 ];
  1828. } ),
  1829. "last": createPositionalPseudo( function( _matchIndexes, length ) {
  1830. return [ length - 1 ];
  1831. } ),
  1832. "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
  1833. return [ argument < 0 ? argument + length : argument ];
  1834. } ),
  1835. "even": createPositionalPseudo( function( matchIndexes, length ) {
  1836. var i = 0;
  1837. for ( ; i < length; i += 2 ) {
  1838. matchIndexes.push( i );
  1839. }
  1840. return matchIndexes;
  1841. } ),
  1842. "odd": createPositionalPseudo( function( matchIndexes, length ) {
  1843. var i = 1;
  1844. for ( ; i < length; i += 2 ) {
  1845. matchIndexes.push( i );
  1846. }
  1847. return matchIndexes;
  1848. } ),
  1849. "lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  1850. var i = argument < 0 ?
  1851. argument + length :
  1852. argument > length ?
  1853. length :
  1854. argument;
  1855. for ( ; --i >= 0; ) {
  1856. matchIndexes.push( i );
  1857. }
  1858. return matchIndexes;
  1859. } ),
  1860. "gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  1861. var i = argument < 0 ? argument + length : argument;
  1862. for ( ; ++i < length; ) {
  1863. matchIndexes.push( i );
  1864. }
  1865. return matchIndexes;
  1866. } )
  1867. }
  1868. };
  1869. Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
  1870. // Add button/input type pseudos
  1871. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  1872. Expr.pseudos[ i ] = createInputPseudo( i );
  1873. }
  1874. for ( i in { submit: true, reset: true } ) {
  1875. Expr.pseudos[ i ] = createButtonPseudo( i );
  1876. }
  1877. // Easy API for creating new setFilters
  1878. function setFilters() {}
  1879. setFilters.prototype = Expr.filters = Expr.pseudos;
  1880. Expr.setFilters = new setFilters();
  1881. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  1882. var matched, match, tokens, type,
  1883. soFar, groups, preFilters,
  1884. cached = tokenCache[ selector + " " ];
  1885. if ( cached ) {
  1886. return parseOnly ? 0 : cached.slice( 0 );
  1887. }
  1888. soFar = selector;
  1889. groups = [];
  1890. preFilters = Expr.preFilter;
  1891. while ( soFar ) {
  1892. // Comma and first run
  1893. if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
  1894. if ( match ) {
  1895. // Don't consume trailing commas as valid
  1896. soFar = soFar.slice( match[ 0 ].length ) || soFar;
  1897. }
  1898. groups.push( ( tokens = [] ) );
  1899. }
  1900. matched = false;
  1901. // Combinators
  1902. if ( ( match = rcombinators.exec( soFar ) ) ) {
  1903. matched = match.shift();
  1904. tokens.push( {
  1905. value: matched,
  1906. // Cast descendant combinators to space
  1907. type: match[ 0 ].replace( rtrim, " " )
  1908. } );
  1909. soFar = soFar.slice( matched.length );
  1910. }
  1911. // Filters
  1912. for ( type in Expr.filter ) {
  1913. if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
  1914. ( match = preFilters[ type ]( match ) ) ) ) {
  1915. matched = match.shift();
  1916. tokens.push( {
  1917. value: matched,
  1918. type: type,
  1919. matches: match
  1920. } );
  1921. soFar = soFar.slice( matched.length );
  1922. }
  1923. }
  1924. if ( !matched ) {
  1925. break;
  1926. }
  1927. }
  1928. // Return the length of the invalid excess
  1929. // if we're just parsing
  1930. // Otherwise, throw an error or return tokens
  1931. return parseOnly ?
  1932. soFar.length :
  1933. soFar ?
  1934. Sizzle.error( selector ) :
  1935. // Cache the tokens
  1936. tokenCache( selector, groups ).slice( 0 );
  1937. };
  1938. function toSelector( tokens ) {
  1939. var i = 0,
  1940. len = tokens.length,
  1941. selector = "";
  1942. for ( ; i < len; i++ ) {
  1943. selector += tokens[ i ].value;
  1944. }
  1945. return selector;
  1946. }
  1947. function addCombinator( matcher, combinator, base ) {
  1948. var dir = combinator.dir,
  1949. skip = combinator.next,
  1950. key = skip || dir,
  1951. checkNonElements = base && key === "parentNode",
  1952. doneName = done++;
  1953. return combinator.first ?
  1954. // Check against closest ancestor/preceding element
  1955. function( elem, context, xml ) {
  1956. while ( ( elem = elem[ dir ] ) ) {
  1957. if ( elem.nodeType === 1 || checkNonElements ) {
  1958. return matcher( elem, context, xml );
  1959. }
  1960. }
  1961. return false;
  1962. } :
  1963. // Check against all ancestor/preceding elements
  1964. function( elem, context, xml ) {
  1965. var oldCache, uniqueCache, outerCache,
  1966. newCache = [ dirruns, doneName ];
  1967. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  1968. if ( xml ) {
  1969. while ( ( elem = elem[ dir ] ) ) {
  1970. if ( elem.nodeType === 1 || checkNonElements ) {
  1971. if ( matcher( elem, context, xml ) ) {
  1972. return true;
  1973. }
  1974. }
  1975. }
  1976. } else {
  1977. while ( ( elem = elem[ dir ] ) ) {
  1978. if ( elem.nodeType === 1 || checkNonElements ) {
  1979. outerCache = elem[ expando ] || ( elem[ expando ] = {} );
  1980. // Support: IE <9 only
  1981. // Defend against cloned attroperties (jQuery gh-1709)
  1982. uniqueCache = outerCache[ elem.uniqueID ] ||
  1983. ( outerCache[ elem.uniqueID ] = {} );
  1984. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  1985. elem = elem[ dir ] || elem;
  1986. } else if ( ( oldCache = uniqueCache[ key ] ) &&
  1987. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  1988. // Assign to newCache so results back-propagate to previous elements
  1989. return ( newCache[ 2 ] = oldCache[ 2 ] );
  1990. } else {
  1991. // Reuse newcache so results back-propagate to previous elements
  1992. uniqueCache[ key ] = newCache;
  1993. // A match means we're done; a fail means we have to keep checking
  1994. if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
  1995. return true;
  1996. }
  1997. }
  1998. }
  1999. }
  2000. }
  2001. return false;
  2002. };
  2003. }
  2004. function elementMatcher( matchers ) {
  2005. return matchers.length > 1 ?
  2006. function( elem, context, xml ) {
  2007. var i = matchers.length;
  2008. while ( i-- ) {
  2009. if ( !matchers[ i ]( elem, context, xml ) ) {
  2010. return false;
  2011. }
  2012. }
  2013. return true;
  2014. } :
  2015. matchers[ 0 ];
  2016. }
  2017. function multipleContexts( selector, contexts, results ) {
  2018. var i = 0,
  2019. len = contexts.length;
  2020. for ( ; i < len; i++ ) {
  2021. Sizzle( selector, contexts[ i ], results );
  2022. }
  2023. return results;
  2024. }
  2025. function condense( unmatched, map, filter, context, xml ) {
  2026. var elem,
  2027. newUnmatched = [],
  2028. i = 0,
  2029. len = unmatched.length,
  2030. mapped = map != null;
  2031. for ( ; i < len; i++ ) {
  2032. if ( ( elem = unmatched[ i ] ) ) {
  2033. if ( !filter || filter( elem, context, xml ) ) {
  2034. newUnmatched.push( elem );
  2035. if ( mapped ) {
  2036. map.push( i );
  2037. }
  2038. }
  2039. }
  2040. }
  2041. return newUnmatched;
  2042. }
  2043. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  2044. if ( postFilter && !postFilter[ expando ] ) {
  2045. postFilter = setMatcher( postFilter );
  2046. }
  2047. if ( postFinder && !postFinder[ expando ] ) {
  2048. postFinder = setMatcher( postFinder, postSelector );
  2049. }
  2050. return markFunction( function( seed, results, context, xml ) {
  2051. var temp, i, elem,
  2052. preMap = [],
  2053. postMap = [],
  2054. preexisting = results.length,
  2055. // Get initial elements from seed or context
  2056. elems = seed || multipleContexts(
  2057. selector || "*",
  2058. context.nodeType ? [ context ] : context,
  2059. []
  2060. ),
  2061. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  2062. matcherIn = preFilter && ( seed || !selector ) ?
  2063. condense( elems, preMap, preFilter, context, xml ) :
  2064. elems,
  2065. matcherOut = matcher ?
  2066. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  2067. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  2068. // ...intermediate processing is necessary
  2069. [] :
  2070. // ...otherwise use results directly
  2071. results :
  2072. matcherIn;
  2073. // Find primary matches
  2074. if ( matcher ) {
  2075. matcher( matcherIn, matcherOut, context, xml );
  2076. }
  2077. // Apply postFilter
  2078. if ( postFilter ) {
  2079. temp = condense( matcherOut, postMap );
  2080. postFilter( temp, [], context, xml );
  2081. // Un-match failing elements by moving them back to matcherIn
  2082. i = temp.length;
  2083. while ( i-- ) {
  2084. if ( ( elem = temp[ i ] ) ) {
  2085. matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
  2086. }
  2087. }
  2088. }
  2089. if ( seed ) {
  2090. if ( postFinder || preFilter ) {
  2091. if ( postFinder ) {
  2092. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  2093. temp = [];
  2094. i = matcherOut.length;
  2095. while ( i-- ) {
  2096. if ( ( elem = matcherOut[ i ] ) ) {
  2097. // Restore matcherIn since elem is not yet a final match
  2098. temp.push( ( matcherIn[ i ] = elem ) );
  2099. }
  2100. }
  2101. postFinder( null, ( matcherOut = [] ), temp, xml );
  2102. }
  2103. // Move matched elements from seed to results to keep them synchronized
  2104. i = matcherOut.length;
  2105. while ( i-- ) {
  2106. if ( ( elem = matcherOut[ i ] ) &&
  2107. ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
  2108. seed[ temp ] = !( results[ temp ] = elem );
  2109. }
  2110. }
  2111. }
  2112. // Add elements to results, through postFinder if defined
  2113. } else {
  2114. matcherOut = condense(
  2115. matcherOut === results ?
  2116. matcherOut.splice( preexisting, matcherOut.length ) :
  2117. matcherOut
  2118. );
  2119. if ( postFinder ) {
  2120. postFinder( null, results, matcherOut, xml );
  2121. } else {
  2122. push.apply( results, matcherOut );
  2123. }
  2124. }
  2125. } );
  2126. }
  2127. function matcherFromTokens( tokens ) {
  2128. var checkContext, matcher, j,
  2129. len = tokens.length,
  2130. leadingRelative = Expr.relative[ tokens[ 0 ].type ],
  2131. implicitRelative = leadingRelative || Expr.relative[ " " ],
  2132. i = leadingRelative ? 1 : 0,
  2133. // The foundational matcher ensures that elements are reachable from top-level context(s)
  2134. matchContext = addCombinator( function( elem ) {
  2135. return elem === checkContext;
  2136. }, implicitRelative, true ),
  2137. matchAnyContext = addCombinator( function( elem ) {
  2138. return indexOf( checkContext, elem ) > -1;
  2139. }, implicitRelative, true ),
  2140. matchers = [ function( elem, context, xml ) {
  2141. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  2142. ( checkContext = context ).nodeType ?
  2143. matchContext( elem, context, xml ) :
  2144. matchAnyContext( elem, context, xml ) );
  2145. // Avoid hanging onto element (issue #299)
  2146. checkContext = null;
  2147. return ret;
  2148. } ];
  2149. for ( ; i < len; i++ ) {
  2150. if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
  2151. matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
  2152. } else {
  2153. matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
  2154. // Return special upon seeing a positional matcher
  2155. if ( matcher[ expando ] ) {
  2156. // Find the next relative operator (if any) for proper handling
  2157. j = ++i;
  2158. for ( ; j < len; j++ ) {
  2159. if ( Expr.relative[ tokens[ j ].type ] ) {
  2160. break;
  2161. }
  2162. }
  2163. return setMatcher(
  2164. i > 1 && elementMatcher( matchers ),
  2165. i > 1 && toSelector(
  2166. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  2167. tokens
  2168. .slice( 0, i - 1 )
  2169. .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
  2170. ).replace( rtrim, "$1" ),
  2171. matcher,
  2172. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  2173. j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
  2174. j < len && toSelector( tokens )
  2175. );
  2176. }
  2177. matchers.push( matcher );
  2178. }
  2179. }
  2180. return elementMatcher( matchers );
  2181. }
  2182. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  2183. var bySet = setMatchers.length > 0,
  2184. byElement = elementMatchers.length > 0,
  2185. superMatcher = function( seed, context, xml, results, outermost ) {
  2186. var elem, j, matcher,
  2187. matchedCount = 0,
  2188. i = "0",
  2189. unmatched = seed && [],
  2190. setMatched = [],
  2191. contextBackup = outermostContext,
  2192. // We must always have either seed elements or outermost context
  2193. elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
  2194. // Use integer dirruns iff this is the outermost matcher
  2195. dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
  2196. len = elems.length;
  2197. if ( outermost ) {
  2198. // Support: IE 11+, Edge 17 - 18+
  2199. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2200. // two documents; shallow comparisons work.
  2201. // eslint-disable-next-line eqeqeq
  2202. outermostContext = context == document || context || outermost;
  2203. }
  2204. // Add elements passing elementMatchers directly to results
  2205. // Support: IE<9, Safari
  2206. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  2207. for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
  2208. if ( byElement && elem ) {
  2209. j = 0;
  2210. // Support: IE 11+, Edge 17 - 18+
  2211. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2212. // two documents; shallow comparisons work.
  2213. // eslint-disable-next-line eqeqeq
  2214. if ( !context && elem.ownerDocument != document ) {
  2215. setDocument( elem );
  2216. xml = !documentIsHTML;
  2217. }
  2218. while ( ( matcher = elementMatchers[ j++ ] ) ) {
  2219. if ( matcher( elem, context || document, xml ) ) {
  2220. results.push( elem );
  2221. break;
  2222. }
  2223. }
  2224. if ( outermost ) {
  2225. dirruns = dirrunsUnique;
  2226. }
  2227. }
  2228. // Track unmatched elements for set filters
  2229. if ( bySet ) {
  2230. // They will have gone through all possible matchers
  2231. if ( ( elem = !matcher && elem ) ) {
  2232. matchedCount--;
  2233. }
  2234. // Lengthen the array for every element, matched or not
  2235. if ( seed ) {
  2236. unmatched.push( elem );
  2237. }
  2238. }
  2239. }
  2240. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  2241. // makes the latter nonnegative.
  2242. matchedCount += i;
  2243. // Apply set filters to unmatched elements
  2244. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  2245. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  2246. // no element matchers and no seed.
  2247. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  2248. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  2249. // numerically zero.
  2250. if ( bySet && i !== matchedCount ) {
  2251. j = 0;
  2252. while ( ( matcher = setMatchers[ j++ ] ) ) {
  2253. matcher( unmatched, setMatched, context, xml );
  2254. }
  2255. if ( seed ) {
  2256. // Reintegrate element matches to eliminate the need for sorting
  2257. if ( matchedCount > 0 ) {
  2258. while ( i-- ) {
  2259. if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
  2260. setMatched[ i ] = pop.call( results );
  2261. }
  2262. }
  2263. }
  2264. // Discard index placeholder values to get only actual matches
  2265. setMatched = condense( setMatched );
  2266. }
  2267. // Add matches to results
  2268. push.apply( results, setMatched );
  2269. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  2270. if ( outermost && !seed && setMatched.length > 0 &&
  2271. ( matchedCount + setMatchers.length ) > 1 ) {
  2272. Sizzle.uniqueSort( results );
  2273. }
  2274. }
  2275. // Override manipulation of globals by nested matchers
  2276. if ( outermost ) {
  2277. dirruns = dirrunsUnique;
  2278. outermostContext = contextBackup;
  2279. }
  2280. return unmatched;
  2281. };
  2282. return bySet ?
  2283. markFunction( superMatcher ) :
  2284. superMatcher;
  2285. }
  2286. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  2287. var i,
  2288. setMatchers = [],
  2289. elementMatchers = [],
  2290. cached = compilerCache[ selector + " " ];
  2291. if ( !cached ) {
  2292. // Generate a function of recursive functions that can be used to check each element
  2293. if ( !match ) {
  2294. match = tokenize( selector );
  2295. }
  2296. i = match.length;
  2297. while ( i-- ) {
  2298. cached = matcherFromTokens( match[ i ] );
  2299. if ( cached[ expando ] ) {
  2300. setMatchers.push( cached );
  2301. } else {
  2302. elementMatchers.push( cached );
  2303. }
  2304. }
  2305. // Cache the compiled function
  2306. cached = compilerCache(
  2307. selector,
  2308. matcherFromGroupMatchers( elementMatchers, setMatchers )
  2309. );
  2310. // Save selector and tokenization
  2311. cached.selector = selector;
  2312. }
  2313. return cached;
  2314. };
  2315. /**
  2316. * A low-level selection function that works with Sizzle's compiled
  2317. * selector functions
  2318. * @param {String|Function} selector A selector or a pre-compiled
  2319. * selector function built with Sizzle.compile
  2320. * @param {Element} context
  2321. * @param {Array} [results]
  2322. * @param {Array} [seed] A set of elements to match against
  2323. */
  2324. select = Sizzle.select = function( selector, context, results, seed ) {
  2325. var i, tokens, token, type, find,
  2326. compiled = typeof selector === "function" && selector,
  2327. match = !seed && tokenize( ( selector = compiled.selector || selector ) );
  2328. results = results || [];
  2329. // Try to minimize operations if there is only one selector in the list and no seed
  2330. // (the latter of which guarantees us context)
  2331. if ( match.length === 1 ) {
  2332. // Reduce context if the leading compound selector is an ID
  2333. tokens = match[ 0 ] = match[ 0 ].slice( 0 );
  2334. if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
  2335. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
  2336. context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
  2337. .replace( runescape, funescape ), context ) || [] )[ 0 ];
  2338. if ( !context ) {
  2339. return results;
  2340. // Precompiled matchers will still verify ancestry, so step up a level
  2341. } else if ( compiled ) {
  2342. context = context.parentNode;
  2343. }
  2344. selector = selector.slice( tokens.shift().value.length );
  2345. }
  2346. // Fetch a seed set for right-to-left matching
  2347. i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
  2348. while ( i-- ) {
  2349. token = tokens[ i ];
  2350. // Abort if we hit a combinator
  2351. if ( Expr.relative[ ( type = token.type ) ] ) {
  2352. break;
  2353. }
  2354. if ( ( find = Expr.find[ type ] ) ) {
  2355. // Search, expanding context for leading sibling combinators
  2356. if ( ( seed = find(
  2357. token.matches[ 0 ].replace( runescape, funescape ),
  2358. rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
  2359. context
  2360. ) ) ) {
  2361. // If seed is empty or no tokens remain, we can return early
  2362. tokens.splice( i, 1 );
  2363. selector = seed.length && toSelector( tokens );
  2364. if ( !selector ) {
  2365. push.apply( results, seed );
  2366. return results;
  2367. }
  2368. break;
  2369. }
  2370. }
  2371. }
  2372. }
  2373. // Compile and execute a filtering function if one is not provided
  2374. // Provide `match` to avoid retokenization if we modified the selector above
  2375. ( compiled || compile( selector, match ) )(
  2376. seed,
  2377. context,
  2378. !documentIsHTML,
  2379. results,
  2380. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  2381. );
  2382. return results;
  2383. };
  2384. // One-time assignments
  2385. // Sort stability
  2386. support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
  2387. // Support: Chrome 14-35+
  2388. // Always assume duplicates if they aren't passed to the comparison function
  2389. support.detectDuplicates = !!hasDuplicate;
  2390. // Initialize against the default document
  2391. setDocument();
  2392. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  2393. // Detached nodes confoundingly follow *each other*
  2394. support.sortDetached = assert( function( el ) {
  2395. // Should return 1, but returns 4 (following)
  2396. return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
  2397. } );
  2398. // Support: IE<8
  2399. // Prevent attribute/property "interpolation"
  2400. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  2401. if ( !assert( function( el ) {
  2402. el.innerHTML = "<a href='#'></a>";
  2403. return el.firstChild.getAttribute( "href" ) === "#";
  2404. } ) ) {
  2405. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  2406. if ( !isXML ) {
  2407. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  2408. }
  2409. } );
  2410. }
  2411. // Support: IE<9
  2412. // Use defaultValue in place of getAttribute("value")
  2413. if ( !support.attributes || !assert( function( el ) {
  2414. el.innerHTML = "<input/>";
  2415. el.firstChild.setAttribute( "value", "" );
  2416. return el.firstChild.getAttribute( "value" ) === "";
  2417. } ) ) {
  2418. addHandle( "value", function( elem, _name, isXML ) {
  2419. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  2420. return elem.defaultValue;
  2421. }
  2422. } );
  2423. }
  2424. // Support: IE<9
  2425. // Use getAttributeNode to fetch booleans when getAttribute lies
  2426. if ( !assert( function( el ) {
  2427. return el.getAttribute( "disabled" ) == null;
  2428. } ) ) {
  2429. addHandle( booleans, function( elem, name, isXML ) {
  2430. var val;
  2431. if ( !isXML ) {
  2432. return elem[ name ] === true ? name.toLowerCase() :
  2433. ( val = elem.getAttributeNode( name ) ) && val.specified ?
  2434. val.value :
  2435. null;
  2436. }
  2437. } );
  2438. }
  2439. return Sizzle;
  2440. } )( window );
  2441. jQuery.find = Sizzle;
  2442. jQuery.expr = Sizzle.selectors;
  2443. // Deprecated
  2444. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  2445. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  2446. jQuery.text = Sizzle.getText;
  2447. jQuery.isXMLDoc = Sizzle.isXML;
  2448. jQuery.contains = Sizzle.contains;
  2449. jQuery.escapeSelector = Sizzle.escape;
  2450. var dir = function( elem, dir, until ) {
  2451. var matched = [],
  2452. truncate = until !== undefined;
  2453. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  2454. if ( elem.nodeType === 1 ) {
  2455. if ( truncate && jQuery( elem ).is( until ) ) {
  2456. break;
  2457. }
  2458. matched.push( elem );
  2459. }
  2460. }
  2461. return matched;
  2462. };
  2463. var siblings = function( n, elem ) {
  2464. var matched = [];
  2465. for ( ; n; n = n.nextSibling ) {
  2466. if ( n.nodeType === 1 && n !== elem ) {
  2467. matched.push( n );
  2468. }
  2469. }
  2470. return matched;
  2471. };
  2472. var rneedsContext = jQuery.expr.match.needsContext;
  2473. function nodeName( elem, name ) {
  2474. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  2475. };
  2476. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  2477. // Implement the identical functionality for filter and not
  2478. function winnow( elements, qualifier, not ) {
  2479. if ( isFunction( qualifier ) ) {
  2480. return jQuery.grep( elements, function( elem, i ) {
  2481. return !!qualifier.call( elem, i, elem ) !== not;
  2482. } );
  2483. }
  2484. // Single element
  2485. if ( qualifier.nodeType ) {
  2486. return jQuery.grep( elements, function( elem ) {
  2487. return ( elem === qualifier ) !== not;
  2488. } );
  2489. }
  2490. // Arraylike of elements (jQuery, arguments, Array)
  2491. if ( typeof qualifier !== "string" ) {
  2492. return jQuery.grep( elements, function( elem ) {
  2493. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  2494. } );
  2495. }
  2496. // Filtered directly for both simple and complex selectors
  2497. return jQuery.filter( qualifier, elements, not );
  2498. }
  2499. jQuery.filter = function( expr, elems, not ) {
  2500. var elem = elems[ 0 ];
  2501. if ( not ) {
  2502. expr = ":not(" + expr + ")";
  2503. }
  2504. if ( elems.length === 1 && elem.nodeType === 1 ) {
  2505. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  2506. }
  2507. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  2508. return elem.nodeType === 1;
  2509. } ) );
  2510. };
  2511. jQuery.fn.extend( {
  2512. find: function( selector ) {
  2513. var i, ret,
  2514. len = this.length,
  2515. self = this;
  2516. if ( typeof selector !== "string" ) {
  2517. return this.pushStack( jQuery( selector ).filter( function() {
  2518. for ( i = 0; i < len; i++ ) {
  2519. if ( jQuery.contains( self[ i ], this ) ) {
  2520. return true;
  2521. }
  2522. }
  2523. } ) );
  2524. }
  2525. ret = this.pushStack( [] );
  2526. for ( i = 0; i < len; i++ ) {
  2527. jQuery.find( selector, self[ i ], ret );
  2528. }
  2529. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  2530. },
  2531. filter: function( selector ) {
  2532. return this.pushStack( winnow( this, selector || [], false ) );
  2533. },
  2534. not: function( selector ) {
  2535. return this.pushStack( winnow( this, selector || [], true ) );
  2536. },
  2537. is: function( selector ) {
  2538. return !!winnow(
  2539. this,
  2540. // If this is a positional/relative selector, check membership in the returned set
  2541. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  2542. typeof selector === "string" && rneedsContext.test( selector ) ?
  2543. jQuery( selector ) :
  2544. selector || [],
  2545. false
  2546. ).length;
  2547. }
  2548. } );
  2549. // Initialize a jQuery object
  2550. // A central reference to the root jQuery(document)
  2551. var rootjQuery,
  2552. // A simple way to check for HTML strings
  2553. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  2554. // Strict HTML recognition (#11290: must start with <)
  2555. // Shortcut simple #id case for speed
  2556. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  2557. init = jQuery.fn.init = function( selector, context, root ) {
  2558. var match, elem;
  2559. // HANDLE: $(""), $(null), $(undefined), $(false)
  2560. if ( !selector ) {
  2561. return this;
  2562. }
  2563. // Method init() accepts an alternate rootjQuery
  2564. // so migrate can support jQuery.sub (gh-2101)
  2565. root = root || rootjQuery;
  2566. // Handle HTML strings
  2567. if ( typeof selector === "string" ) {
  2568. if ( selector[ 0 ] === "<" &&
  2569. selector[ selector.length - 1 ] === ">" &&
  2570. selector.length >= 3 ) {
  2571. // Assume that strings that start and end with <> are HTML and skip the regex check
  2572. match = [ null, selector, null ];
  2573. } else {
  2574. match = rquickExpr.exec( selector );
  2575. }
  2576. // Match html or make sure no context is specified for #id
  2577. if ( match && ( match[ 1 ] || !context ) ) {
  2578. // HANDLE: $(html) -> $(array)
  2579. if ( match[ 1 ] ) {
  2580. context = context instanceof jQuery ? context[ 0 ] : context;
  2581. // Option to run scripts is true for back-compat
  2582. // Intentionally let the error be thrown if parseHTML is not present
  2583. jQuery.merge( this, jQuery.parseHTML(
  2584. match[ 1 ],
  2585. context && context.nodeType ? context.ownerDocument || context : document,
  2586. true
  2587. ) );
  2588. // HANDLE: $(html, props)
  2589. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  2590. for ( match in context ) {
  2591. // Properties of context are called as methods if possible
  2592. if ( isFunction( this[ match ] ) ) {
  2593. this[ match ]( context[ match ] );
  2594. // ...and otherwise set as attributes
  2595. } else {
  2596. this.attr( match, context[ match ] );
  2597. }
  2598. }
  2599. }
  2600. return this;
  2601. // HANDLE: $(#id)
  2602. } else {
  2603. elem = document.getElementById( match[ 2 ] );
  2604. if ( elem ) {
  2605. // Inject the element directly into the jQuery object
  2606. this[ 0 ] = elem;
  2607. this.length = 1;
  2608. }
  2609. return this;
  2610. }
  2611. // HANDLE: $(expr, $(...))
  2612. } else if ( !context || context.jquery ) {
  2613. return ( context || root ).find( selector );
  2614. // HANDLE: $(expr, context)
  2615. // (which is just equivalent to: $(context).find(expr)
  2616. } else {
  2617. return this.constructor( context ).find( selector );
  2618. }
  2619. // HANDLE: $(DOMElement)
  2620. } else if ( selector.nodeType ) {
  2621. this[ 0 ] = selector;
  2622. this.length = 1;
  2623. return this;
  2624. // HANDLE: $(function)
  2625. // Shortcut for document ready
  2626. } else if ( isFunction( selector ) ) {
  2627. return root.ready !== undefined ?
  2628. root.ready( selector ) :
  2629. // Execute immediately if ready is not present
  2630. selector( jQuery );
  2631. }
  2632. return jQuery.makeArray( selector, this );
  2633. };
  2634. // Give the init function the jQuery prototype for later instantiation
  2635. init.prototype = jQuery.fn;
  2636. // Initialize central reference
  2637. rootjQuery = jQuery( document );
  2638. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  2639. // Methods guaranteed to produce a unique set when starting from a unique set
  2640. guaranteedUnique = {
  2641. children: true,
  2642. contents: true,
  2643. next: true,
  2644. prev: true
  2645. };
  2646. jQuery.fn.extend( {
  2647. has: function( target ) {
  2648. var targets = jQuery( target, this ),
  2649. l = targets.length;
  2650. return this.filter( function() {
  2651. var i = 0;
  2652. for ( ; i < l; i++ ) {
  2653. if ( jQuery.contains( this, targets[ i ] ) ) {
  2654. return true;
  2655. }
  2656. }
  2657. } );
  2658. },
  2659. closest: function( selectors, context ) {
  2660. var cur,
  2661. i = 0,
  2662. l = this.length,
  2663. matched = [],
  2664. targets = typeof selectors !== "string" && jQuery( selectors );
  2665. // Positional selectors never match, since there's no _selection_ context
  2666. if ( !rneedsContext.test( selectors ) ) {
  2667. for ( ; i < l; i++ ) {
  2668. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  2669. // Always skip document fragments
  2670. if ( cur.nodeType < 11 && ( targets ?
  2671. targets.index( cur ) > -1 :
  2672. // Don't pass non-elements to Sizzle
  2673. cur.nodeType === 1 &&
  2674. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  2675. matched.push( cur );
  2676. break;
  2677. }
  2678. }
  2679. }
  2680. }
  2681. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  2682. },
  2683. // Determine the position of an element within the set
  2684. index: function( elem ) {
  2685. // No argument, return index in parent
  2686. if ( !elem ) {
  2687. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  2688. }
  2689. // Index in selector
  2690. if ( typeof elem === "string" ) {
  2691. return indexOf.call( jQuery( elem ), this[ 0 ] );
  2692. }
  2693. // Locate the position of the desired element
  2694. return indexOf.call( this,
  2695. // If it receives a jQuery object, the first element is used
  2696. elem.jquery ? elem[ 0 ] : elem
  2697. );
  2698. },
  2699. add: function( selector, context ) {
  2700. return this.pushStack(
  2701. jQuery.uniqueSort(
  2702. jQuery.merge( this.get(), jQuery( selector, context ) )
  2703. )
  2704. );
  2705. },
  2706. addBack: function( selector ) {
  2707. return this.add( selector == null ?
  2708. this.prevObject : this.prevObject.filter( selector )
  2709. );
  2710. }
  2711. } );
  2712. function sibling( cur, dir ) {
  2713. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  2714. return cur;
  2715. }
  2716. jQuery.each( {
  2717. parent: function( elem ) {
  2718. var parent = elem.parentNode;
  2719. return parent && parent.nodeType !== 11 ? parent : null;
  2720. },
  2721. parents: function( elem ) {
  2722. return dir( elem, "parentNode" );
  2723. },
  2724. parentsUntil: function( elem, _i, until ) {
  2725. return dir( elem, "parentNode", until );
  2726. },
  2727. next: function( elem ) {
  2728. return sibling( elem, "nextSibling" );
  2729. },
  2730. prev: function( elem ) {
  2731. return sibling( elem, "previousSibling" );
  2732. },
  2733. nextAll: function( elem ) {
  2734. return dir( elem, "nextSibling" );
  2735. },
  2736. prevAll: function( elem ) {
  2737. return dir( elem, "previousSibling" );
  2738. },
  2739. nextUntil: function( elem, _i, until ) {
  2740. return dir( elem, "nextSibling", until );
  2741. },
  2742. prevUntil: function( elem, _i, until ) {
  2743. return dir( elem, "previousSibling", until );
  2744. },
  2745. siblings: function( elem ) {
  2746. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  2747. },
  2748. children: function( elem ) {
  2749. return siblings( elem.firstChild );
  2750. },
  2751. contents: function( elem ) {
  2752. if ( elem.contentDocument != null &&
  2753. // Support: IE 11+
  2754. // <object> elements with no `data` attribute has an object
  2755. // `contentDocument` with a `null` prototype.
  2756. getProto( elem.contentDocument ) ) {
  2757. return elem.contentDocument;
  2758. }
  2759. // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
  2760. // Treat the template element as a regular one in browsers that
  2761. // don't support it.
  2762. if ( nodeName( elem, "template" ) ) {
  2763. elem = elem.content || elem;
  2764. }
  2765. return jQuery.merge( [], elem.childNodes );
  2766. }
  2767. }, function( name, fn ) {
  2768. jQuery.fn[ name ] = function( until, selector ) {
  2769. var matched = jQuery.map( this, fn, until );
  2770. if ( name.slice( -5 ) !== "Until" ) {
  2771. selector = until;
  2772. }
  2773. if ( selector && typeof selector === "string" ) {
  2774. matched = jQuery.filter( selector, matched );
  2775. }
  2776. if ( this.length > 1 ) {
  2777. // Remove duplicates
  2778. if ( !guaranteedUnique[ name ] ) {
  2779. jQuery.uniqueSort( matched );
  2780. }
  2781. // Reverse order for parents* and prev-derivatives
  2782. if ( rparentsprev.test( name ) ) {
  2783. matched.reverse();
  2784. }
  2785. }
  2786. return this.pushStack( matched );
  2787. };
  2788. } );
  2789. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  2790. // Convert String-formatted options into Object-formatted ones
  2791. function createOptions( options ) {
  2792. var object = {};
  2793. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  2794. object[ flag ] = true;
  2795. } );
  2796. return object;
  2797. }
  2798. /*
  2799. * Create a callback list using the following parameters:
  2800. *
  2801. * options: an optional list of space-separated options that will change how
  2802. * the callback list behaves or a more traditional option object
  2803. *
  2804. * By default a callback list will act like an event callback list and can be
  2805. * "fired" multiple times.
  2806. *
  2807. * Possible options:
  2808. *
  2809. * once: will ensure the callback list can only be fired once (like a Deferred)
  2810. *
  2811. * memory: will keep track of previous values and will call any callback added
  2812. * after the list has been fired right away with the latest "memorized"
  2813. * values (like a Deferred)
  2814. *
  2815. * unique: will ensure a callback can only be added once (no duplicate in the list)
  2816. *
  2817. * stopOnFalse: interrupt callings when a callback returns false
  2818. *
  2819. */
  2820. jQuery.Callbacks = function( options ) {
  2821. // Convert options from String-formatted to Object-formatted if needed
  2822. // (we check in cache first)
  2823. options = typeof options === "string" ?
  2824. createOptions( options ) :
  2825. jQuery.extend( {}, options );
  2826. var // Flag to know if list is currently firing
  2827. firing,
  2828. // Last fire value for non-forgettable lists
  2829. memory,
  2830. // Flag to know if list was already fired
  2831. fired,
  2832. // Flag to prevent firing
  2833. locked,
  2834. // Actual callback list
  2835. list = [],
  2836. // Queue of execution data for repeatable lists
  2837. queue = [],
  2838. // Index of currently firing callback (modified by add/remove as needed)
  2839. firingIndex = -1,
  2840. // Fire callbacks
  2841. fire = function() {
  2842. // Enforce single-firing
  2843. locked = locked || options.once;
  2844. // Execute callbacks for all pending executions,
  2845. // respecting firingIndex overrides and runtime changes
  2846. fired = firing = true;
  2847. for ( ; queue.length; firingIndex = -1 ) {
  2848. memory = queue.shift();
  2849. while ( ++firingIndex < list.length ) {
  2850. // Run callback and check for early termination
  2851. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  2852. options.stopOnFalse ) {
  2853. // Jump to end and forget the data so .add doesn't re-fire
  2854. firingIndex = list.length;
  2855. memory = false;
  2856. }
  2857. }
  2858. }
  2859. // Forget the data if we're done with it
  2860. if ( !options.memory ) {
  2861. memory = false;
  2862. }
  2863. firing = false;
  2864. // Clean up if we're done firing for good
  2865. if ( locked ) {
  2866. // Keep an empty list if we have data for future add calls
  2867. if ( memory ) {
  2868. list = [];
  2869. // Otherwise, this object is spent
  2870. } else {
  2871. list = "";
  2872. }
  2873. }
  2874. },
  2875. // Actual Callbacks object
  2876. self = {
  2877. // Add a callback or a collection of callbacks to the list
  2878. add: function() {
  2879. if ( list ) {
  2880. // If we have memory from a past run, we should fire after adding
  2881. if ( memory && !firing ) {
  2882. firingIndex = list.length - 1;
  2883. queue.push( memory );
  2884. }
  2885. ( function add( args ) {
  2886. jQuery.each( args, function( _, arg ) {
  2887. if ( isFunction( arg ) ) {
  2888. if ( !options.unique || !self.has( arg ) ) {
  2889. list.push( arg );
  2890. }
  2891. } else if ( arg && arg.length && toType( arg ) !== "string" ) {
  2892. // Inspect recursively
  2893. add( arg );
  2894. }
  2895. } );
  2896. } )( arguments );
  2897. if ( memory && !firing ) {
  2898. fire();
  2899. }
  2900. }
  2901. return this;
  2902. },
  2903. // Remove a callback from the list
  2904. remove: function() {
  2905. jQuery.each( arguments, function( _, arg ) {
  2906. var index;
  2907. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  2908. list.splice( index, 1 );
  2909. // Handle firing indexes
  2910. if ( index <= firingIndex ) {
  2911. firingIndex--;
  2912. }
  2913. }
  2914. } );
  2915. return this;
  2916. },
  2917. // Check if a given callback is in the list.
  2918. // If no argument is given, return whether or not list has callbacks attached.
  2919. has: function( fn ) {
  2920. return fn ?
  2921. jQuery.inArray( fn, list ) > -1 :
  2922. list.length > 0;
  2923. },
  2924. // Remove all callbacks from the list
  2925. empty: function() {
  2926. if ( list ) {
  2927. list = [];
  2928. }
  2929. return this;
  2930. },
  2931. // Disable .fire and .add
  2932. // Abort any current/pending executions
  2933. // Clear all callbacks and values
  2934. disable: function() {
  2935. locked = queue = [];
  2936. list = memory = "";
  2937. return this;
  2938. },
  2939. disabled: function() {
  2940. return !list;
  2941. },
  2942. // Disable .fire
  2943. // Also disable .add unless we have memory (since it would have no effect)
  2944. // Abort any pending executions
  2945. lock: function() {
  2946. locked = queue = [];
  2947. if ( !memory && !firing ) {
  2948. list = memory = "";
  2949. }
  2950. return this;
  2951. },
  2952. locked: function() {
  2953. return !!locked;
  2954. },
  2955. // Call all callbacks with the given context and arguments
  2956. fireWith: function( context, args ) {
  2957. if ( !locked ) {
  2958. args = args || [];
  2959. args = [ context, args.slice ? args.slice() : args ];
  2960. queue.push( args );
  2961. if ( !firing ) {
  2962. fire();
  2963. }
  2964. }
  2965. return this;
  2966. },
  2967. // Call all the callbacks with the given arguments
  2968. fire: function() {
  2969. self.fireWith( this, arguments );
  2970. return this;
  2971. },
  2972. // To know if the callbacks have already been called at least once
  2973. fired: function() {
  2974. return !!fired;
  2975. }
  2976. };
  2977. return self;
  2978. };
  2979. function Identity( v ) {
  2980. return v;
  2981. }
  2982. function Thrower( ex ) {
  2983. throw ex;
  2984. }
  2985. function adoptValue( value, resolve, reject, noValue ) {
  2986. var method;
  2987. try {
  2988. // Check for promise aspect first to privilege synchronous behavior
  2989. if ( value && isFunction( ( method = value.promise ) ) ) {
  2990. method.call( value ).done( resolve ).fail( reject );
  2991. // Other thenables
  2992. } else if ( value && isFunction( ( method = value.then ) ) ) {
  2993. method.call( value, resolve, reject );
  2994. // Other non-thenables
  2995. } else {
  2996. // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
  2997. // * false: [ value ].slice( 0 ) => resolve( value )
  2998. // * true: [ value ].slice( 1 ) => resolve()
  2999. resolve.apply( undefined, [ value ].slice( noValue ) );
  3000. }
  3001. // For Promises/A+, convert exceptions into rejections
  3002. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  3003. // Deferred#then to conditionally suppress rejection.
  3004. } catch ( value ) {
  3005. // Support: Android 4.0 only
  3006. // Strict mode functions invoked without .call/.apply get global-object context
  3007. reject.apply( undefined, [ value ] );
  3008. }
  3009. }
  3010. jQuery.extend( {
  3011. Deferred: function( func ) {
  3012. var tuples = [
  3013. // action, add listener, callbacks,
  3014. // ... .then handlers, argument index, [final state]
  3015. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  3016. jQuery.Callbacks( "memory" ), 2 ],
  3017. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  3018. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  3019. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  3020. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  3021. ],
  3022. state = "pending",
  3023. promise = {
  3024. state: function() {
  3025. return state;
  3026. },
  3027. always: function() {
  3028. deferred.done( arguments ).fail( arguments );
  3029. return this;
  3030. },
  3031. "catch": function( fn ) {
  3032. return promise.then( null, fn );
  3033. },
  3034. // Keep pipe for back-compat
  3035. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  3036. var fns = arguments;
  3037. return jQuery.Deferred( function( newDefer ) {
  3038. jQuery.each( tuples, function( _i, tuple ) {
  3039. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  3040. var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  3041. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  3042. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  3043. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  3044. deferred[ tuple[ 1 ] ]( function() {
  3045. var returned = fn && fn.apply( this, arguments );
  3046. if ( returned && isFunction( returned.promise ) ) {
  3047. returned.promise()
  3048. .progress( newDefer.notify )
  3049. .done( newDefer.resolve )
  3050. .fail( newDefer.reject );
  3051. } else {
  3052. newDefer[ tuple[ 0 ] + "With" ](
  3053. this,
  3054. fn ? [ returned ] : arguments
  3055. );
  3056. }
  3057. } );
  3058. } );
  3059. fns = null;
  3060. } ).promise();
  3061. },
  3062. then: function( onFulfilled, onRejected, onProgress ) {
  3063. var maxDepth = 0;
  3064. function resolve( depth, deferred, handler, special ) {
  3065. return function() {
  3066. var that = this,
  3067. args = arguments,
  3068. mightThrow = function() {
  3069. var returned, then;
  3070. // Support: Promises/A+ section 2.3.3.3.3
  3071. // https://promisesaplus.com/#point-59
  3072. // Ignore double-resolution attempts
  3073. if ( depth < maxDepth ) {
  3074. return;
  3075. }
  3076. returned = handler.apply( that, args );
  3077. // Support: Promises/A+ section 2.3.1
  3078. // https://promisesaplus.com/#point-48
  3079. if ( returned === deferred.promise() ) {
  3080. throw new TypeError( "Thenable self-resolution" );
  3081. }
  3082. // Support: Promises/A+ sections 2.3.3.1, 3.5
  3083. // https://promisesaplus.com/#point-54
  3084. // https://promisesaplus.com/#point-75
  3085. // Retrieve `then` only once
  3086. then = returned &&
  3087. // Support: Promises/A+ section 2.3.4
  3088. // https://promisesaplus.com/#point-64
  3089. // Only check objects and functions for thenability
  3090. ( typeof returned === "object" ||
  3091. typeof returned === "function" ) &&
  3092. returned.then;
  3093. // Handle a returned thenable
  3094. if ( isFunction( then ) ) {
  3095. // Special processors (notify) just wait for resolution
  3096. if ( special ) {
  3097. then.call(
  3098. returned,
  3099. resolve( maxDepth, deferred, Identity, special ),
  3100. resolve( maxDepth, deferred, Thrower, special )
  3101. );
  3102. // Normal processors (resolve) also hook into progress
  3103. } else {
  3104. // ...and disregard older resolution values
  3105. maxDepth++;
  3106. then.call(
  3107. returned,
  3108. resolve( maxDepth, deferred, Identity, special ),
  3109. resolve( maxDepth, deferred, Thrower, special ),
  3110. resolve( maxDepth, deferred, Identity,
  3111. deferred.notifyWith )
  3112. );
  3113. }
  3114. // Handle all other returned values
  3115. } else {
  3116. // Only substitute handlers pass on context
  3117. // and multiple values (non-spec behavior)
  3118. if ( handler !== Identity ) {
  3119. that = undefined;
  3120. args = [ returned ];
  3121. }
  3122. // Process the value(s)
  3123. // Default process is resolve
  3124. ( special || deferred.resolveWith )( that, args );
  3125. }
  3126. },
  3127. // Only normal processors (resolve) catch and reject exceptions
  3128. process = special ?
  3129. mightThrow :
  3130. function() {
  3131. try {
  3132. mightThrow();
  3133. } catch ( e ) {
  3134. if ( jQuery.Deferred.exceptionHook ) {
  3135. jQuery.Deferred.exceptionHook( e,
  3136. process.stackTrace );
  3137. }
  3138. // Support: Promises/A+ section 2.3.3.3.4.1
  3139. // https://promisesaplus.com/#point-61
  3140. // Ignore post-resolution exceptions
  3141. if ( depth + 1 >= maxDepth ) {
  3142. // Only substitute handlers pass on context
  3143. // and multiple values (non-spec behavior)
  3144. if ( handler !== Thrower ) {
  3145. that = undefined;
  3146. args = [ e ];
  3147. }
  3148. deferred.rejectWith( that, args );
  3149. }
  3150. }
  3151. };
  3152. // Support: Promises/A+ section 2.3.3.3.1
  3153. // https://promisesaplus.com/#point-57
  3154. // Re-resolve promises immediately to dodge false rejection from
  3155. // subsequent errors
  3156. if ( depth ) {
  3157. process();
  3158. } else {
  3159. // Call an optional hook to record the stack, in case of exception
  3160. // since it's otherwise lost when execution goes async
  3161. if ( jQuery.Deferred.getStackHook ) {
  3162. process.stackTrace = jQuery.Deferred.getStackHook();
  3163. }
  3164. window.setTimeout( process );
  3165. }
  3166. };
  3167. }
  3168. return jQuery.Deferred( function( newDefer ) {
  3169. // progress_handlers.add( ... )
  3170. tuples[ 0 ][ 3 ].add(
  3171. resolve(
  3172. 0,
  3173. newDefer,
  3174. isFunction( onProgress ) ?
  3175. onProgress :
  3176. Identity,
  3177. newDefer.notifyWith
  3178. )
  3179. );
  3180. // fulfilled_handlers.add( ... )
  3181. tuples[ 1 ][ 3 ].add(
  3182. resolve(
  3183. 0,
  3184. newDefer,
  3185. isFunction( onFulfilled ) ?
  3186. onFulfilled :
  3187. Identity
  3188. )
  3189. );
  3190. // rejected_handlers.add( ... )
  3191. tuples[ 2 ][ 3 ].add(
  3192. resolve(
  3193. 0,
  3194. newDefer,
  3195. isFunction( onRejected ) ?
  3196. onRejected :
  3197. Thrower
  3198. )
  3199. );
  3200. } ).promise();
  3201. },
  3202. // Get a promise for this deferred
  3203. // If obj is provided, the promise aspect is added to the object
  3204. promise: function( obj ) {
  3205. return obj != null ? jQuery.extend( obj, promise ) : promise;
  3206. }
  3207. },
  3208. deferred = {};
  3209. // Add list-specific methods
  3210. jQuery.each( tuples, function( i, tuple ) {
  3211. var list = tuple[ 2 ],
  3212. stateString = tuple[ 5 ];
  3213. // promise.progress = list.add
  3214. // promise.done = list.add
  3215. // promise.fail = list.add
  3216. promise[ tuple[ 1 ] ] = list.add;
  3217. // Handle state
  3218. if ( stateString ) {
  3219. list.add(
  3220. function() {
  3221. // state = "resolved" (i.e., fulfilled)
  3222. // state = "rejected"
  3223. state = stateString;
  3224. },
  3225. // rejected_callbacks.disable
  3226. // fulfilled_callbacks.disable
  3227. tuples[ 3 - i ][ 2 ].disable,
  3228. // rejected_handlers.disable
  3229. // fulfilled_handlers.disable
  3230. tuples[ 3 - i ][ 3 ].disable,
  3231. // progress_callbacks.lock
  3232. tuples[ 0 ][ 2 ].lock,
  3233. // progress_handlers.lock
  3234. tuples[ 0 ][ 3 ].lock
  3235. );
  3236. }
  3237. // progress_handlers.fire
  3238. // fulfilled_handlers.fire
  3239. // rejected_handlers.fire
  3240. list.add( tuple[ 3 ].fire );
  3241. // deferred.notify = function() { deferred.notifyWith(...) }
  3242. // deferred.resolve = function() { deferred.resolveWith(...) }
  3243. // deferred.reject = function() { deferred.rejectWith(...) }
  3244. deferred[ tuple[ 0 ] ] = function() {
  3245. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  3246. return this;
  3247. };
  3248. // deferred.notifyWith = list.fireWith
  3249. // deferred.resolveWith = list.fireWith
  3250. // deferred.rejectWith = list.fireWith
  3251. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  3252. } );
  3253. // Make the deferred a promise
  3254. promise.promise( deferred );
  3255. // Call given func if any
  3256. if ( func ) {
  3257. func.call( deferred, deferred );
  3258. }
  3259. // All done!
  3260. return deferred;
  3261. },
  3262. // Deferred helper
  3263. when: function( singleValue ) {
  3264. var
  3265. // count of uncompleted subordinates
  3266. remaining = arguments.length,
  3267. // count of unprocessed arguments
  3268. i = remaining,
  3269. // subordinate fulfillment data
  3270. resolveContexts = Array( i ),
  3271. resolveValues = slice.call( arguments ),
  3272. // the master Deferred
  3273. master = jQuery.Deferred(),
  3274. // subordinate callback factory
  3275. updateFunc = function( i ) {
  3276. return function( value ) {
  3277. resolveContexts[ i ] = this;
  3278. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  3279. if ( !( --remaining ) ) {
  3280. master.resolveWith( resolveContexts, resolveValues );
  3281. }
  3282. };
  3283. };
  3284. // Single- and empty arguments are adopted like Promise.resolve
  3285. if ( remaining <= 1 ) {
  3286. adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
  3287. !remaining );
  3288. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  3289. if ( master.state() === "pending" ||
  3290. isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  3291. return master.then();
  3292. }
  3293. }
  3294. // Multiple arguments are aggregated like Promise.all array elements
  3295. while ( i-- ) {
  3296. adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
  3297. }
  3298. return master.promise();
  3299. }
  3300. } );
  3301. // These usually indicate a programmer mistake during development,
  3302. // warn about them ASAP rather than swallowing them by default.
  3303. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  3304. jQuery.Deferred.exceptionHook = function( error, stack ) {
  3305. // Support: IE 8 - 9 only
  3306. // Console exists when dev tools are open, which can happen at any time
  3307. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  3308. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  3309. }
  3310. };
  3311. jQuery.readyException = function( error ) {
  3312. window.setTimeout( function() {
  3313. throw error;
  3314. } );
  3315. };
  3316. // The deferred used on DOM ready
  3317. var readyList = jQuery.Deferred();
  3318. jQuery.fn.ready = function( fn ) {
  3319. readyList
  3320. .then( fn )
  3321. // Wrap jQuery.readyException in a function so that the lookup
  3322. // happens at the time of error handling instead of callback
  3323. // registration.
  3324. .catch( function( error ) {
  3325. jQuery.readyException( error );
  3326. } );
  3327. return this;
  3328. };
  3329. jQuery.extend( {
  3330. // Is the DOM ready to be used? Set to true once it occurs.
  3331. isReady: false,
  3332. // A counter to track how many items to wait for before
  3333. // the ready event fires. See #6781
  3334. readyWait: 1,
  3335. // Handle when the DOM is ready
  3336. ready: function( wait ) {
  3337. // Abort if there are pending holds or we're already ready
  3338. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  3339. return;
  3340. }
  3341. // Remember that the DOM is ready
  3342. jQuery.isReady = true;
  3343. // If a normal DOM Ready event fired, decrement, and wait if need be
  3344. if ( wait !== true && --jQuery.readyWait > 0 ) {
  3345. return;
  3346. }
  3347. // If there are functions bound, to execute
  3348. readyList.resolveWith( document, [ jQuery ] );
  3349. }
  3350. } );
  3351. jQuery.ready.then = readyList.then;
  3352. // The ready event handler and self cleanup method
  3353. function completed() {
  3354. document.removeEventListener( "DOMContentLoaded", completed );
  3355. window.removeEventListener( "load", completed );
  3356. jQuery.ready();
  3357. }
  3358. // Catch cases where $(document).ready() is called
  3359. // after the browser event has already occurred.
  3360. // Support: IE <=9 - 10 only
  3361. // Older IE sometimes signals "interactive" too soon
  3362. if ( document.readyState === "complete" ||
  3363. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  3364. // Handle it asynchronously to allow scripts the opportunity to delay ready
  3365. window.setTimeout( jQuery.ready );
  3366. } else {
  3367. // Use the handy event callback
  3368. document.addEventListener( "DOMContentLoaded", completed );
  3369. // A fallback to window.onload, that will always work
  3370. window.addEventListener( "load", completed );
  3371. }
  3372. // Multifunctional method to get and set values of a collection
  3373. // The value/s can optionally be executed if it's a function
  3374. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  3375. var i = 0,
  3376. len = elems.length,
  3377. bulk = key == null;
  3378. // Sets many values
  3379. if ( toType( key ) === "object" ) {
  3380. chainable = true;
  3381. for ( i in key ) {
  3382. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  3383. }
  3384. // Sets one value
  3385. } else if ( value !== undefined ) {
  3386. chainable = true;
  3387. if ( !isFunction( value ) ) {
  3388. raw = true;
  3389. }
  3390. if ( bulk ) {
  3391. // Bulk operations run against the entire set
  3392. if ( raw ) {
  3393. fn.call( elems, value );
  3394. fn = null;
  3395. // ...except when executing function values
  3396. } else {
  3397. bulk = fn;
  3398. fn = function( elem, _key, value ) {
  3399. return bulk.call( jQuery( elem ), value );
  3400. };
  3401. }
  3402. }
  3403. if ( fn ) {
  3404. for ( ; i < len; i++ ) {
  3405. fn(
  3406. elems[ i ], key, raw ?
  3407. value :
  3408. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  3409. );
  3410. }
  3411. }
  3412. }
  3413. if ( chainable ) {
  3414. return elems;
  3415. }
  3416. // Gets
  3417. if ( bulk ) {
  3418. return fn.call( elems );
  3419. }
  3420. return len ? fn( elems[ 0 ], key ) : emptyGet;
  3421. };
  3422. // Matches dashed string for camelizing
  3423. var rmsPrefix = /^-ms-/,
  3424. rdashAlpha = /-([a-z])/g;
  3425. // Used by camelCase as callback to replace()
  3426. function fcamelCase( _all, letter ) {
  3427. return letter.toUpperCase();
  3428. }
  3429. // Convert dashed to camelCase; used by the css and data modules
  3430. // Support: IE <=9 - 11, Edge 12 - 15
  3431. // Microsoft forgot to hump their vendor prefix (#9572)
  3432. function camelCase( string ) {
  3433. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  3434. }
  3435. var acceptData = function( owner ) {
  3436. // Accepts only:
  3437. // - Node
  3438. // - Node.ELEMENT_NODE
  3439. // - Node.DOCUMENT_NODE
  3440. // - Object
  3441. // - Any
  3442. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  3443. };
  3444. function Data() {
  3445. this.expando = jQuery.expando + Data.uid++;
  3446. }
  3447. Data.uid = 1;
  3448. Data.prototype = {
  3449. cache: function( owner ) {
  3450. // Check if the owner object already has a cache
  3451. var value = owner[ this.expando ];
  3452. // If not, create one
  3453. if ( !value ) {
  3454. value = {};
  3455. // We can accept data for non-element nodes in modern browsers,
  3456. // but we should not, see #8335.
  3457. // Always return an empty object.
  3458. if ( acceptData( owner ) ) {
  3459. // If it is a node unlikely to be stringify-ed or looped over
  3460. // use plain assignment
  3461. if ( owner.nodeType ) {
  3462. owner[ this.expando ] = value;
  3463. // Otherwise secure it in a non-enumerable property
  3464. // configurable must be true to allow the property to be
  3465. // deleted when data is removed
  3466. } else {
  3467. Object.defineProperty( owner, this.expando, {
  3468. value: value,
  3469. configurable: true
  3470. } );
  3471. }
  3472. }
  3473. }
  3474. return value;
  3475. },
  3476. set: function( owner, data, value ) {
  3477. var prop,
  3478. cache = this.cache( owner );
  3479. // Handle: [ owner, key, value ] args
  3480. // Always use camelCase key (gh-2257)
  3481. if ( typeof data === "string" ) {
  3482. cache[ camelCase( data ) ] = value;
  3483. // Handle: [ owner, { properties } ] args
  3484. } else {
  3485. // Copy the properties one-by-one to the cache object
  3486. for ( prop in data ) {
  3487. cache[ camelCase( prop ) ] = data[ prop ];
  3488. }
  3489. }
  3490. return cache;
  3491. },
  3492. get: function( owner, key ) {
  3493. return key === undefined ?
  3494. this.cache( owner ) :
  3495. // Always use camelCase key (gh-2257)
  3496. owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
  3497. },
  3498. access: function( owner, key, value ) {
  3499. // In cases where either:
  3500. //
  3501. // 1. No key was specified
  3502. // 2. A string key was specified, but no value provided
  3503. //
  3504. // Take the "read" path and allow the get method to determine
  3505. // which value to return, respectively either:
  3506. //
  3507. // 1. The entire cache object
  3508. // 2. The data stored at the key
  3509. //
  3510. if ( key === undefined ||
  3511. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  3512. return this.get( owner, key );
  3513. }
  3514. // When the key is not a string, or both a key and value
  3515. // are specified, set or extend (existing objects) with either:
  3516. //
  3517. // 1. An object of properties
  3518. // 2. A key and value
  3519. //
  3520. this.set( owner, key, value );
  3521. // Since the "set" path can have two possible entry points
  3522. // return the expected data based on which path was taken[*]
  3523. return value !== undefined ? value : key;
  3524. },
  3525. remove: function( owner, key ) {
  3526. var i,
  3527. cache = owner[ this.expando ];
  3528. if ( cache === undefined ) {
  3529. return;
  3530. }
  3531. if ( key !== undefined ) {
  3532. // Support array or space separated string of keys
  3533. if ( Array.isArray( key ) ) {
  3534. // If key is an array of keys...
  3535. // We always set camelCase keys, so remove that.
  3536. key = key.map( camelCase );
  3537. } else {
  3538. key = camelCase( key );
  3539. // If a key with the spaces exists, use it.
  3540. // Otherwise, create an array by matching non-whitespace
  3541. key = key in cache ?
  3542. [ key ] :
  3543. ( key.match( rnothtmlwhite ) || [] );
  3544. }
  3545. i = key.length;
  3546. while ( i-- ) {
  3547. delete cache[ key[ i ] ];
  3548. }
  3549. }
  3550. // Remove the expando if there's no more data
  3551. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  3552. // Support: Chrome <=35 - 45
  3553. // Webkit & Blink performance suffers when deleting properties
  3554. // from DOM nodes, so set to undefined instead
  3555. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  3556. if ( owner.nodeType ) {
  3557. owner[ this.expando ] = undefined;
  3558. } else {
  3559. delete owner[ this.expando ];
  3560. }
  3561. }
  3562. },
  3563. hasData: function( owner ) {
  3564. var cache = owner[ this.expando ];
  3565. return cache !== undefined && !jQuery.isEmptyObject( cache );
  3566. }
  3567. };
  3568. var dataPriv = new Data();
  3569. var dataUser = new Data();
  3570. // Implementation Summary
  3571. //
  3572. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  3573. // 2. Improve the module's maintainability by reducing the storage
  3574. // paths to a single mechanism.
  3575. // 3. Use the same single mechanism to support "private" and "user" data.
  3576. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  3577. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  3578. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  3579. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  3580. rmultiDash = /[A-Z]/g;
  3581. function getData( data ) {
  3582. if ( data === "true" ) {
  3583. return true;
  3584. }
  3585. if ( data === "false" ) {
  3586. return false;
  3587. }
  3588. if ( data === "null" ) {
  3589. return null;
  3590. }
  3591. // Only convert to a number if it doesn't change the string
  3592. if ( data === +data + "" ) {
  3593. return +data;
  3594. }
  3595. if ( rbrace.test( data ) ) {
  3596. return JSON.parse( data );
  3597. }
  3598. return data;
  3599. }
  3600. function dataAttr( elem, key, data ) {
  3601. var name;
  3602. // If nothing was found internally, try to fetch any
  3603. // data from the HTML5 data-* attribute
  3604. if ( data === undefined && elem.nodeType === 1 ) {
  3605. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  3606. data = elem.getAttribute( name );
  3607. if ( typeof data === "string" ) {
  3608. try {
  3609. data = getData( data );
  3610. } catch ( e ) {}
  3611. // Make sure we set the data so it isn't changed later
  3612. dataUser.set( elem, key, data );
  3613. } else {
  3614. data = undefined;
  3615. }
  3616. }
  3617. return data;
  3618. }
  3619. jQuery.extend( {
  3620. hasData: function( elem ) {
  3621. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  3622. },
  3623. data: function( elem, name, data ) {
  3624. return dataUser.access( elem, name, data );
  3625. },
  3626. removeData: function( elem, name ) {
  3627. dataUser.remove( elem, name );
  3628. },
  3629. // TODO: Now that all calls to _data and _removeData have been replaced
  3630. // with direct calls to dataPriv methods, these can be deprecated.
  3631. _data: function( elem, name, data ) {
  3632. return dataPriv.access( elem, name, data );
  3633. },
  3634. _removeData: function( elem, name ) {
  3635. dataPriv.remove( elem, name );
  3636. }
  3637. } );
  3638. jQuery.fn.extend( {
  3639. data: function( key, value ) {
  3640. var i, name, data,
  3641. elem = this[ 0 ],
  3642. attrs = elem && elem.attributes;
  3643. // Gets all values
  3644. if ( key === undefined ) {
  3645. if ( this.length ) {
  3646. data = dataUser.get( elem );
  3647. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  3648. i = attrs.length;
  3649. while ( i-- ) {
  3650. // Support: IE 11 only
  3651. // The attrs elements can be null (#14894)
  3652. if ( attrs[ i ] ) {
  3653. name = attrs[ i ].name;
  3654. if ( name.indexOf( "data-" ) === 0 ) {
  3655. name = camelCase( name.slice( 5 ) );
  3656. dataAttr( elem, name, data[ name ] );
  3657. }
  3658. }
  3659. }
  3660. dataPriv.set( elem, "hasDataAttrs", true );
  3661. }
  3662. }
  3663. return data;
  3664. }
  3665. // Sets multiple values
  3666. if ( typeof key === "object" ) {
  3667. return this.each( function() {
  3668. dataUser.set( this, key );
  3669. } );
  3670. }
  3671. return access( this, function( value ) {
  3672. var data;
  3673. // The calling jQuery object (element matches) is not empty
  3674. // (and therefore has an element appears at this[ 0 ]) and the
  3675. // `value` parameter was not undefined. An empty jQuery object
  3676. // will result in `undefined` for elem = this[ 0 ] which will
  3677. // throw an exception if an attempt to read a data cache is made.
  3678. if ( elem && value === undefined ) {
  3679. // Attempt to get data from the cache
  3680. // The key will always be camelCased in Data
  3681. data = dataUser.get( elem, key );
  3682. if ( data !== undefined ) {
  3683. return data;
  3684. }
  3685. // Attempt to "discover" the data in
  3686. // HTML5 custom data-* attrs
  3687. data = dataAttr( elem, key );
  3688. if ( data !== undefined ) {
  3689. return data;
  3690. }
  3691. // We tried really hard, but the data doesn't exist.
  3692. return;
  3693. }
  3694. // Set the data...
  3695. this.each( function() {
  3696. // We always store the camelCased key
  3697. dataUser.set( this, key, value );
  3698. } );
  3699. }, null, value, arguments.length > 1, null, true );
  3700. },
  3701. removeData: function( key ) {
  3702. return this.each( function() {
  3703. dataUser.remove( this, key );
  3704. } );
  3705. }
  3706. } );
  3707. jQuery.extend( {
  3708. queue: function( elem, type, data ) {
  3709. var queue;
  3710. if ( elem ) {
  3711. type = ( type || "fx" ) + "queue";
  3712. queue = dataPriv.get( elem, type );
  3713. // Speed up dequeue by getting out quickly if this is just a lookup
  3714. if ( data ) {
  3715. if ( !queue || Array.isArray( data ) ) {
  3716. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  3717. } else {
  3718. queue.push( data );
  3719. }
  3720. }
  3721. return queue || [];
  3722. }
  3723. },
  3724. dequeue: function( elem, type ) {
  3725. type = type || "fx";
  3726. var queue = jQuery.queue( elem, type ),
  3727. startLength = queue.length,
  3728. fn = queue.shift(),
  3729. hooks = jQuery._queueHooks( elem, type ),
  3730. next = function() {
  3731. jQuery.dequeue( elem, type );
  3732. };
  3733. // If the fx queue is dequeued, always remove the progress sentinel
  3734. if ( fn === "inprogress" ) {
  3735. fn = queue.shift();
  3736. startLength--;
  3737. }
  3738. if ( fn ) {
  3739. // Add a progress sentinel to prevent the fx queue from being
  3740. // automatically dequeued
  3741. if ( type === "fx" ) {
  3742. queue.unshift( "inprogress" );
  3743. }
  3744. // Clear up the last queue stop function
  3745. delete hooks.stop;
  3746. fn.call( elem, next, hooks );
  3747. }
  3748. if ( !startLength && hooks ) {
  3749. hooks.empty.fire();
  3750. }
  3751. },
  3752. // Not public - generate a queueHooks object, or return the current one
  3753. _queueHooks: function( elem, type ) {
  3754. var key = type + "queueHooks";
  3755. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  3756. empty: jQuery.Callbacks( "once memory" ).add( function() {
  3757. dataPriv.remove( elem, [ type + "queue", key ] );
  3758. } )
  3759. } );
  3760. }
  3761. } );
  3762. jQuery.fn.extend( {
  3763. queue: function( type, data ) {
  3764. var setter = 2;
  3765. if ( typeof type !== "string" ) {
  3766. data = type;
  3767. type = "fx";
  3768. setter--;
  3769. }
  3770. if ( arguments.length < setter ) {
  3771. return jQuery.queue( this[ 0 ], type );
  3772. }
  3773. return data === undefined ?
  3774. this :
  3775. this.each( function() {
  3776. var queue = jQuery.queue( this, type, data );
  3777. // Ensure a hooks for this queue
  3778. jQuery._queueHooks( this, type );
  3779. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  3780. jQuery.dequeue( this, type );
  3781. }
  3782. } );
  3783. },
  3784. dequeue: function( type ) {
  3785. return this.each( function() {
  3786. jQuery.dequeue( this, type );
  3787. } );
  3788. },
  3789. clearQueue: function( type ) {
  3790. return this.queue( type || "fx", [] );
  3791. },
  3792. // Get a promise resolved when queues of a certain type
  3793. // are emptied (fx is the type by default)
  3794. promise: function( type, obj ) {
  3795. var tmp,
  3796. count = 1,
  3797. defer = jQuery.Deferred(),
  3798. elements = this,
  3799. i = this.length,
  3800. resolve = function() {
  3801. if ( !( --count ) ) {
  3802. defer.resolveWith( elements, [ elements ] );
  3803. }
  3804. };
  3805. if ( typeof type !== "string" ) {
  3806. obj = type;
  3807. type = undefined;
  3808. }
  3809. type = type || "fx";
  3810. while ( i-- ) {
  3811. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  3812. if ( tmp && tmp.empty ) {
  3813. count++;
  3814. tmp.empty.add( resolve );
  3815. }
  3816. }
  3817. resolve();
  3818. return defer.promise( obj );
  3819. }
  3820. } );
  3821. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  3822. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  3823. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  3824. var documentElement = document.documentElement;
  3825. var isAttached = function( elem ) {
  3826. return jQuery.contains( elem.ownerDocument, elem );
  3827. },
  3828. composed = { composed: true };
  3829. // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
  3830. // Check attachment across shadow DOM boundaries when possible (gh-3504)
  3831. // Support: iOS 10.0-10.2 only
  3832. // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
  3833. // leading to errors. We need to check for `getRootNode`.
  3834. if ( documentElement.getRootNode ) {
  3835. isAttached = function( elem ) {
  3836. return jQuery.contains( elem.ownerDocument, elem ) ||
  3837. elem.getRootNode( composed ) === elem.ownerDocument;
  3838. };
  3839. }
  3840. var isHiddenWithinTree = function( elem, el ) {
  3841. // isHiddenWithinTree might be called from jQuery#filter function;
  3842. // in that case, element will be second argument
  3843. elem = el || elem;
  3844. // Inline style trumps all
  3845. return elem.style.display === "none" ||
  3846. elem.style.display === "" &&
  3847. // Otherwise, check computed style
  3848. // Support: Firefox <=43 - 45
  3849. // Disconnected elements can have computed display: none, so first confirm that elem is
  3850. // in the document.
  3851. isAttached( elem ) &&
  3852. jQuery.css( elem, "display" ) === "none";
  3853. };
  3854. function adjustCSS( elem, prop, valueParts, tween ) {
  3855. var adjusted, scale,
  3856. maxIterations = 20,
  3857. currentValue = tween ?
  3858. function() {
  3859. return tween.cur();
  3860. } :
  3861. function() {
  3862. return jQuery.css( elem, prop, "" );
  3863. },
  3864. initial = currentValue(),
  3865. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  3866. // Starting value computation is required for potential unit mismatches
  3867. initialInUnit = elem.nodeType &&
  3868. ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  3869. rcssNum.exec( jQuery.css( elem, prop ) );
  3870. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  3871. // Support: Firefox <=54
  3872. // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
  3873. initial = initial / 2;
  3874. // Trust units reported by jQuery.css
  3875. unit = unit || initialInUnit[ 3 ];
  3876. // Iteratively approximate from a nonzero starting point
  3877. initialInUnit = +initial || 1;
  3878. while ( maxIterations-- ) {
  3879. // Evaluate and update our best guess (doubling guesses that zero out).
  3880. // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
  3881. jQuery.style( elem, prop, initialInUnit + unit );
  3882. if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
  3883. maxIterations = 0;
  3884. }
  3885. initialInUnit = initialInUnit / scale;
  3886. }
  3887. initialInUnit = initialInUnit * 2;
  3888. jQuery.style( elem, prop, initialInUnit + unit );
  3889. // Make sure we update the tween properties later on
  3890. valueParts = valueParts || [];
  3891. }
  3892. if ( valueParts ) {
  3893. initialInUnit = +initialInUnit || +initial || 0;
  3894. // Apply relative offset (+=/-=) if specified
  3895. adjusted = valueParts[ 1 ] ?
  3896. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  3897. +valueParts[ 2 ];
  3898. if ( tween ) {
  3899. tween.unit = unit;
  3900. tween.start = initialInUnit;
  3901. tween.end = adjusted;
  3902. }
  3903. }
  3904. return adjusted;
  3905. }
  3906. var defaultDisplayMap = {};
  3907. function getDefaultDisplay( elem ) {
  3908. var temp,
  3909. doc = elem.ownerDocument,
  3910. nodeName = elem.nodeName,
  3911. display = defaultDisplayMap[ nodeName ];
  3912. if ( display ) {
  3913. return display;
  3914. }
  3915. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  3916. display = jQuery.css( temp, "display" );
  3917. temp.parentNode.removeChild( temp );
  3918. if ( display === "none" ) {
  3919. display = "block";
  3920. }
  3921. defaultDisplayMap[ nodeName ] = display;
  3922. return display;
  3923. }
  3924. function showHide( elements, show ) {
  3925. var display, elem,
  3926. values = [],
  3927. index = 0,
  3928. length = elements.length;
  3929. // Determine new display value for elements that need to change
  3930. for ( ; index < length; index++ ) {
  3931. elem = elements[ index ];
  3932. if ( !elem.style ) {
  3933. continue;
  3934. }
  3935. display = elem.style.display;
  3936. if ( show ) {
  3937. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  3938. // check is required in this first loop unless we have a nonempty display value (either
  3939. // inline or about-to-be-restored)
  3940. if ( display === "none" ) {
  3941. values[ index ] = dataPriv.get( elem, "display" ) || null;
  3942. if ( !values[ index ] ) {
  3943. elem.style.display = "";
  3944. }
  3945. }
  3946. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  3947. values[ index ] = getDefaultDisplay( elem );
  3948. }
  3949. } else {
  3950. if ( display !== "none" ) {
  3951. values[ index ] = "none";
  3952. // Remember what we're overwriting
  3953. dataPriv.set( elem, "display", display );
  3954. }
  3955. }
  3956. }
  3957. // Set the display of the elements in a second loop to avoid constant reflow
  3958. for ( index = 0; index < length; index++ ) {
  3959. if ( values[ index ] != null ) {
  3960. elements[ index ].style.display = values[ index ];
  3961. }
  3962. }
  3963. return elements;
  3964. }
  3965. jQuery.fn.extend( {
  3966. show: function() {
  3967. return showHide( this, true );
  3968. },
  3969. hide: function() {
  3970. return showHide( this );
  3971. },
  3972. toggle: function( state ) {
  3973. if ( typeof state === "boolean" ) {
  3974. return state ? this.show() : this.hide();
  3975. }
  3976. return this.each( function() {
  3977. if ( isHiddenWithinTree( this ) ) {
  3978. jQuery( this ).show();
  3979. } else {
  3980. jQuery( this ).hide();
  3981. }
  3982. } );
  3983. }
  3984. } );
  3985. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  3986. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
  3987. var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
  3988. ( function() {
  3989. var fragment = document.createDocumentFragment(),
  3990. div = fragment.appendChild( document.createElement( "div" ) ),
  3991. input = document.createElement( "input" );
  3992. // Support: Android 4.0 - 4.3 only
  3993. // Check state lost if the name is set (#11217)
  3994. // Support: Windows Web Apps (WWA)
  3995. // `name` and `type` must use .setAttribute for WWA (#14901)
  3996. input.setAttribute( "type", "radio" );
  3997. input.setAttribute( "checked", "checked" );
  3998. input.setAttribute( "name", "t" );
  3999. div.appendChild( input );
  4000. // Support: Android <=4.1 only
  4001. // Older WebKit doesn't clone checked state correctly in fragments
  4002. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  4003. // Support: IE <=11 only
  4004. // Make sure textarea (and checkbox) defaultValue is properly cloned
  4005. div.innerHTML = "<textarea>x</textarea>";
  4006. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  4007. // Support: IE <=9 only
  4008. // IE <=9 replaces <option> tags with their contents when inserted outside of
  4009. // the select element.
  4010. div.innerHTML = "<option></option>";
  4011. support.option = !!div.lastChild;
  4012. } )();
  4013. // We have to close these tags to support XHTML (#13200)
  4014. var wrapMap = {
  4015. // XHTML parsers do not magically insert elements in the
  4016. // same way that tag soup parsers do. So we cannot shorten
  4017. // this by omitting <tbody> or other required elements.
  4018. thead: [ 1, "<table>", "</table>" ],
  4019. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  4020. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  4021. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  4022. _default: [ 0, "", "" ]
  4023. };
  4024. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  4025. wrapMap.th = wrapMap.td;
  4026. // Support: IE <=9 only
  4027. if ( !support.option ) {
  4028. wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
  4029. }
  4030. function getAll( context, tag ) {
  4031. // Support: IE <=9 - 11 only
  4032. // Use typeof to avoid zero-argument method invocation on host objects (#15151)
  4033. var ret;
  4034. if ( typeof context.getElementsByTagName !== "undefined" ) {
  4035. ret = context.getElementsByTagName( tag || "*" );
  4036. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  4037. ret = context.querySelectorAll( tag || "*" );
  4038. } else {
  4039. ret = [];
  4040. }
  4041. if ( tag === undefined || tag && nodeName( context, tag ) ) {
  4042. return jQuery.merge( [ context ], ret );
  4043. }
  4044. return ret;
  4045. }
  4046. // Mark scripts as having already been evaluated
  4047. function setGlobalEval( elems, refElements ) {
  4048. var i = 0,
  4049. l = elems.length;
  4050. for ( ; i < l; i++ ) {
  4051. dataPriv.set(
  4052. elems[ i ],
  4053. "globalEval",
  4054. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  4055. );
  4056. }
  4057. }
  4058. var rhtml = /<|&#?\w+;/;
  4059. function buildFragment( elems, context, scripts, selection, ignored ) {
  4060. var elem, tmp, tag, wrap, attached, j,
  4061. fragment = context.createDocumentFragment(),
  4062. nodes = [],
  4063. i = 0,
  4064. l = elems.length;
  4065. for ( ; i < l; i++ ) {
  4066. elem = elems[ i ];
  4067. if ( elem || elem === 0 ) {
  4068. // Add nodes directly
  4069. if ( toType( elem ) === "object" ) {
  4070. // Support: Android <=4.0 only, PhantomJS 1 only
  4071. // push.apply(_, arraylike) throws on ancient WebKit
  4072. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  4073. // Convert non-html into a text node
  4074. } else if ( !rhtml.test( elem ) ) {
  4075. nodes.push( context.createTextNode( elem ) );
  4076. // Convert html into DOM nodes
  4077. } else {
  4078. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  4079. // Deserialize a standard representation
  4080. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  4081. wrap = wrapMap[ tag ] || wrapMap._default;
  4082. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  4083. // Descend through wrappers to the right content
  4084. j = wrap[ 0 ];
  4085. while ( j-- ) {
  4086. tmp = tmp.lastChild;
  4087. }
  4088. // Support: Android <=4.0 only, PhantomJS 1 only
  4089. // push.apply(_, arraylike) throws on ancient WebKit
  4090. jQuery.merge( nodes, tmp.childNodes );
  4091. // Remember the top-level container
  4092. tmp = fragment.firstChild;
  4093. // Ensure the created nodes are orphaned (#12392)
  4094. tmp.textContent = "";
  4095. }
  4096. }
  4097. }
  4098. // Remove wrapper from fragment
  4099. fragment.textContent = "";
  4100. i = 0;
  4101. while ( ( elem = nodes[ i++ ] ) ) {
  4102. // Skip elements already in the context collection (trac-4087)
  4103. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  4104. if ( ignored ) {
  4105. ignored.push( elem );
  4106. }
  4107. continue;
  4108. }
  4109. attached = isAttached( elem );
  4110. // Append to fragment
  4111. tmp = getAll( fragment.appendChild( elem ), "script" );
  4112. // Preserve script evaluation history
  4113. if ( attached ) {
  4114. setGlobalEval( tmp );
  4115. }
  4116. // Capture executables
  4117. if ( scripts ) {
  4118. j = 0;
  4119. while ( ( elem = tmp[ j++ ] ) ) {
  4120. if ( rscriptType.test( elem.type || "" ) ) {
  4121. scripts.push( elem );
  4122. }
  4123. }
  4124. }
  4125. }
  4126. return fragment;
  4127. }
  4128. var
  4129. rkeyEvent = /^key/,
  4130. rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  4131. rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  4132. function returnTrue() {
  4133. return true;
  4134. }
  4135. function returnFalse() {
  4136. return false;
  4137. }
  4138. // Support: IE <=9 - 11+
  4139. // focus() and blur() are asynchronous, except when they are no-op.
  4140. // So expect focus to be synchronous when the element is already active,
  4141. // and blur to be synchronous when the element is not already active.
  4142. // (focus and blur are always synchronous in other supported browsers,
  4143. // this just defines when we can count on it).
  4144. function expectSync( elem, type ) {
  4145. return ( elem === safeActiveElement() ) === ( type === "focus" );
  4146. }
  4147. // Support: IE <=9 only
  4148. // Accessing document.activeElement can throw unexpectedly
  4149. // https://bugs.jquery.com/ticket/13393
  4150. function safeActiveElement() {
  4151. try {
  4152. return document.activeElement;
  4153. } catch ( err ) { }
  4154. }
  4155. function on( elem, types, selector, data, fn, one ) {
  4156. var origFn, type;
  4157. // Types can be a map of types/handlers
  4158. if ( typeof types === "object" ) {
  4159. // ( types-Object, selector, data )
  4160. if ( typeof selector !== "string" ) {
  4161. // ( types-Object, data )
  4162. data = data || selector;
  4163. selector = undefined;
  4164. }
  4165. for ( type in types ) {
  4166. on( elem, type, selector, data, types[ type ], one );
  4167. }
  4168. return elem;
  4169. }
  4170. if ( data == null && fn == null ) {
  4171. // ( types, fn )
  4172. fn = selector;
  4173. data = selector = undefined;
  4174. } else if ( fn == null ) {
  4175. if ( typeof selector === "string" ) {
  4176. // ( types, selector, fn )
  4177. fn = data;
  4178. data = undefined;
  4179. } else {
  4180. // ( types, data, fn )
  4181. fn = data;
  4182. data = selector;
  4183. selector = undefined;
  4184. }
  4185. }
  4186. if ( fn === false ) {
  4187. fn = returnFalse;
  4188. } else if ( !fn ) {
  4189. return elem;
  4190. }
  4191. if ( one === 1 ) {
  4192. origFn = fn;
  4193. fn = function( event ) {
  4194. // Can use an empty set, since event contains the info
  4195. jQuery().off( event );
  4196. return origFn.apply( this, arguments );
  4197. };
  4198. // Use same guid so caller can remove using origFn
  4199. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  4200. }
  4201. return elem.each( function() {
  4202. jQuery.event.add( this, types, fn, data, selector );
  4203. } );
  4204. }
  4205. /*
  4206. * Helper functions for managing events -- not part of the public interface.
  4207. * Props to Dean Edwards' addEvent library for many of the ideas.
  4208. */
  4209. jQuery.event = {
  4210. global: {},
  4211. add: function( elem, types, handler, data, selector ) {
  4212. var handleObjIn, eventHandle, tmp,
  4213. events, t, handleObj,
  4214. special, handlers, type, namespaces, origType,
  4215. elemData = dataPriv.get( elem );
  4216. // Only attach events to objects that accept data
  4217. if ( !acceptData( elem ) ) {
  4218. return;
  4219. }
  4220. // Caller can pass in an object of custom data in lieu of the handler
  4221. if ( handler.handler ) {
  4222. handleObjIn = handler;
  4223. handler = handleObjIn.handler;
  4224. selector = handleObjIn.selector;
  4225. }
  4226. // Ensure that invalid selectors throw exceptions at attach time
  4227. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  4228. if ( selector ) {
  4229. jQuery.find.matchesSelector( documentElement, selector );
  4230. }
  4231. // Make sure that the handler has a unique ID, used to find/remove it later
  4232. if ( !handler.guid ) {
  4233. handler.guid = jQuery.guid++;
  4234. }
  4235. // Init the element's event structure and main handler, if this is the first
  4236. if ( !( events = elemData.events ) ) {
  4237. events = elemData.events = Object.create( null );
  4238. }
  4239. if ( !( eventHandle = elemData.handle ) ) {
  4240. eventHandle = elemData.handle = function( e ) {
  4241. // Discard the second event of a jQuery.event.trigger() and
  4242. // when an event is called after a page has unloaded
  4243. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  4244. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  4245. };
  4246. }
  4247. // Handle multiple events separated by a space
  4248. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  4249. t = types.length;
  4250. while ( t-- ) {
  4251. tmp = rtypenamespace.exec( types[ t ] ) || [];
  4252. type = origType = tmp[ 1 ];
  4253. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  4254. // There *must* be a type, no attaching namespace-only handlers
  4255. if ( !type ) {
  4256. continue;
  4257. }
  4258. // If event changes its type, use the special event handlers for the changed type
  4259. special = jQuery.event.special[ type ] || {};
  4260. // If selector defined, determine special event api type, otherwise given type
  4261. type = ( selector ? special.delegateType : special.bindType ) || type;
  4262. // Update special based on newly reset type
  4263. special = jQuery.event.special[ type ] || {};
  4264. // handleObj is passed to all event handlers
  4265. handleObj = jQuery.extend( {
  4266. type: type,
  4267. origType: origType,
  4268. data: data,
  4269. handler: handler,
  4270. guid: handler.guid,
  4271. selector: selector,
  4272. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  4273. namespace: namespaces.join( "." )
  4274. }, handleObjIn );
  4275. // Init the event handler queue if we're the first
  4276. if ( !( handlers = events[ type ] ) ) {
  4277. handlers = events[ type ] = [];
  4278. handlers.delegateCount = 0;
  4279. // Only use addEventListener if the special events handler returns false
  4280. if ( !special.setup ||
  4281. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  4282. if ( elem.addEventListener ) {
  4283. elem.addEventListener( type, eventHandle );
  4284. }
  4285. }
  4286. }
  4287. if ( special.add ) {
  4288. special.add.call( elem, handleObj );
  4289. if ( !handleObj.handler.guid ) {
  4290. handleObj.handler.guid = handler.guid;
  4291. }
  4292. }
  4293. // Add to the element's handler list, delegates in front
  4294. if ( selector ) {
  4295. handlers.splice( handlers.delegateCount++, 0, handleObj );
  4296. } else {
  4297. handlers.push( handleObj );
  4298. }
  4299. // Keep track of which events have ever been used, for event optimization
  4300. jQuery.event.global[ type ] = true;
  4301. }
  4302. },
  4303. // Detach an event or set of events from an element
  4304. remove: function( elem, types, handler, selector, mappedTypes ) {
  4305. var j, origCount, tmp,
  4306. events, t, handleObj,
  4307. special, handlers, type, namespaces, origType,
  4308. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  4309. if ( !elemData || !( events = elemData.events ) ) {
  4310. return;
  4311. }
  4312. // Once for each type.namespace in types; type may be omitted
  4313. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  4314. t = types.length;
  4315. while ( t-- ) {
  4316. tmp = rtypenamespace.exec( types[ t ] ) || [];
  4317. type = origType = tmp[ 1 ];
  4318. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  4319. // Unbind all events (on this namespace, if provided) for the element
  4320. if ( !type ) {
  4321. for ( type in events ) {
  4322. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  4323. }
  4324. continue;
  4325. }
  4326. special = jQuery.event.special[ type ] || {};
  4327. type = ( selector ? special.delegateType : special.bindType ) || type;
  4328. handlers = events[ type ] || [];
  4329. tmp = tmp[ 2 ] &&
  4330. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  4331. // Remove matching events
  4332. origCount = j = handlers.length;
  4333. while ( j-- ) {
  4334. handleObj = handlers[ j ];
  4335. if ( ( mappedTypes || origType === handleObj.origType ) &&
  4336. ( !handler || handler.guid === handleObj.guid ) &&
  4337. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  4338. ( !selector || selector === handleObj.selector ||
  4339. selector === "**" && handleObj.selector ) ) {
  4340. handlers.splice( j, 1 );
  4341. if ( handleObj.selector ) {
  4342. handlers.delegateCount--;
  4343. }
  4344. if ( special.remove ) {
  4345. special.remove.call( elem, handleObj );
  4346. }
  4347. }
  4348. }
  4349. // Remove generic event handler if we removed something and no more handlers exist
  4350. // (avoids potential for endless recursion during removal of special event handlers)
  4351. if ( origCount && !handlers.length ) {
  4352. if ( !special.teardown ||
  4353. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  4354. jQuery.removeEvent( elem, type, elemData.handle );
  4355. }
  4356. delete events[ type ];
  4357. }
  4358. }
  4359. // Remove data and the expando if it's no longer used
  4360. if ( jQuery.isEmptyObject( events ) ) {
  4361. dataPriv.remove( elem, "handle events" );
  4362. }
  4363. },
  4364. dispatch: function( nativeEvent ) {
  4365. var i, j, ret, matched, handleObj, handlerQueue,
  4366. args = new Array( arguments.length ),
  4367. // Make a writable jQuery.Event from the native event object
  4368. event = jQuery.event.fix( nativeEvent ),
  4369. handlers = (
  4370. dataPriv.get( this, "events" ) || Object.create( null )
  4371. )[ event.type ] || [],
  4372. special = jQuery.event.special[ event.type ] || {};
  4373. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  4374. args[ 0 ] = event;
  4375. for ( i = 1; i < arguments.length; i++ ) {
  4376. args[ i ] = arguments[ i ];
  4377. }
  4378. event.delegateTarget = this;
  4379. // Call the preDispatch hook for the mapped type, and let it bail if desired
  4380. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  4381. return;
  4382. }
  4383. // Determine handlers
  4384. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  4385. // Run delegates first; they may want to stop propagation beneath us
  4386. i = 0;
  4387. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  4388. event.currentTarget = matched.elem;
  4389. j = 0;
  4390. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  4391. !event.isImmediatePropagationStopped() ) {
  4392. // If the event is namespaced, then each handler is only invoked if it is
  4393. // specially universal or its namespaces are a superset of the event's.
  4394. if ( !event.rnamespace || handleObj.namespace === false ||
  4395. event.rnamespace.test( handleObj.namespace ) ) {
  4396. event.handleObj = handleObj;
  4397. event.data = handleObj.data;
  4398. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  4399. handleObj.handler ).apply( matched.elem, args );
  4400. if ( ret !== undefined ) {
  4401. if ( ( event.result = ret ) === false ) {
  4402. event.preventDefault();
  4403. event.stopPropagation();
  4404. }
  4405. }
  4406. }
  4407. }
  4408. }
  4409. // Call the postDispatch hook for the mapped type
  4410. if ( special.postDispatch ) {
  4411. special.postDispatch.call( this, event );
  4412. }
  4413. return event.result;
  4414. },
  4415. handlers: function( event, handlers ) {
  4416. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  4417. handlerQueue = [],
  4418. delegateCount = handlers.delegateCount,
  4419. cur = event.target;
  4420. // Find delegate handlers
  4421. if ( delegateCount &&
  4422. // Support: IE <=9
  4423. // Black-hole SVG <use> instance trees (trac-13180)
  4424. cur.nodeType &&
  4425. // Support: Firefox <=42
  4426. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  4427. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  4428. // Support: IE 11 only
  4429. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  4430. !( event.type === "click" && event.button >= 1 ) ) {
  4431. for ( ; cur !== this; cur = cur.parentNode || this ) {
  4432. // Don't check non-elements (#13208)
  4433. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  4434. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  4435. matchedHandlers = [];
  4436. matchedSelectors = {};
  4437. for ( i = 0; i < delegateCount; i++ ) {
  4438. handleObj = handlers[ i ];
  4439. // Don't conflict with Object.prototype properties (#13203)
  4440. sel = handleObj.selector + " ";
  4441. if ( matchedSelectors[ sel ] === undefined ) {
  4442. matchedSelectors[ sel ] = handleObj.needsContext ?
  4443. jQuery( sel, this ).index( cur ) > -1 :
  4444. jQuery.find( sel, this, null, [ cur ] ).length;
  4445. }
  4446. if ( matchedSelectors[ sel ] ) {
  4447. matchedHandlers.push( handleObj );
  4448. }
  4449. }
  4450. if ( matchedHandlers.length ) {
  4451. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  4452. }
  4453. }
  4454. }
  4455. }
  4456. // Add the remaining (directly-bound) handlers
  4457. cur = this;
  4458. if ( delegateCount < handlers.length ) {
  4459. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  4460. }
  4461. return handlerQueue;
  4462. },
  4463. addProp: function( name, hook ) {
  4464. Object.defineProperty( jQuery.Event.prototype, name, {
  4465. enumerable: true,
  4466. configurable: true,
  4467. get: isFunction( hook ) ?
  4468. function() {
  4469. if ( this.originalEvent ) {
  4470. return hook( this.originalEvent );
  4471. }
  4472. } :
  4473. function() {
  4474. if ( this.originalEvent ) {
  4475. return this.originalEvent[ name ];
  4476. }
  4477. },
  4478. set: function( value ) {
  4479. Object.defineProperty( this, name, {
  4480. enumerable: true,
  4481. configurable: true,
  4482. writable: true,
  4483. value: value
  4484. } );
  4485. }
  4486. } );
  4487. },
  4488. fix: function( originalEvent ) {
  4489. return originalEvent[ jQuery.expando ] ?
  4490. originalEvent :
  4491. new jQuery.Event( originalEvent );
  4492. },
  4493. special: {
  4494. load: {
  4495. // Prevent triggered image.load events from bubbling to window.load
  4496. noBubble: true
  4497. },
  4498. click: {
  4499. // Utilize native event to ensure correct state for checkable inputs
  4500. setup: function( data ) {
  4501. // For mutual compressibility with _default, replace `this` access with a local var.
  4502. // `|| data` is dead code meant only to preserve the variable through minification.
  4503. var el = this || data;
  4504. // Claim the first handler
  4505. if ( rcheckableType.test( el.type ) &&
  4506. el.click && nodeName( el, "input" ) ) {
  4507. // dataPriv.set( el, "click", ... )
  4508. leverageNative( el, "click", returnTrue );
  4509. }
  4510. // Return false to allow normal processing in the caller
  4511. return false;
  4512. },
  4513. trigger: function( data ) {
  4514. // For mutual compressibility with _default, replace `this` access with a local var.
  4515. // `|| data` is dead code meant only to preserve the variable through minification.
  4516. var el = this || data;
  4517. // Force setup before triggering a click
  4518. if ( rcheckableType.test( el.type ) &&
  4519. el.click && nodeName( el, "input" ) ) {
  4520. leverageNative( el, "click" );
  4521. }
  4522. // Return non-false to allow normal event-path propagation
  4523. return true;
  4524. },
  4525. // For cross-browser consistency, suppress native .click() on links
  4526. // Also prevent it if we're currently inside a leveraged native-event stack
  4527. _default: function( event ) {
  4528. var target = event.target;
  4529. return rcheckableType.test( target.type ) &&
  4530. target.click && nodeName( target, "input" ) &&
  4531. dataPriv.get( target, "click" ) ||
  4532. nodeName( target, "a" );
  4533. }
  4534. },
  4535. beforeunload: {
  4536. postDispatch: function( event ) {
  4537. // Support: Firefox 20+
  4538. // Firefox doesn't alert if the returnValue field is not set.
  4539. if ( event.result !== undefined && event.originalEvent ) {
  4540. event.originalEvent.returnValue = event.result;
  4541. }
  4542. }
  4543. }
  4544. }
  4545. };
  4546. // Ensure the presence of an event listener that handles manually-triggered
  4547. // synthetic events by interrupting progress until reinvoked in response to
  4548. // *native* events that it fires directly, ensuring that state changes have
  4549. // already occurred before other listeners are invoked.
  4550. function leverageNative( el, type, expectSync ) {
  4551. // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
  4552. if ( !expectSync ) {
  4553. if ( dataPriv.get( el, type ) === undefined ) {
  4554. jQuery.event.add( el, type, returnTrue );
  4555. }
  4556. return;
  4557. }
  4558. // Register the controller as a special universal handler for all event namespaces
  4559. dataPriv.set( el, type, false );
  4560. jQuery.event.add( el, type, {
  4561. namespace: false,
  4562. handler: function( event ) {
  4563. var notAsync, result,
  4564. saved = dataPriv.get( this, type );
  4565. if ( ( event.isTrigger & 1 ) && this[ type ] ) {
  4566. // Interrupt processing of the outer synthetic .trigger()ed event
  4567. // Saved data should be false in such cases, but might be a leftover capture object
  4568. // from an async native handler (gh-4350)
  4569. if ( !saved.length ) {
  4570. // Store arguments for use when handling the inner native event
  4571. // There will always be at least one argument (an event object), so this array
  4572. // will not be confused with a leftover capture object.
  4573. saved = slice.call( arguments );
  4574. dataPriv.set( this, type, saved );
  4575. // Trigger the native event and capture its result
  4576. // Support: IE <=9 - 11+
  4577. // focus() and blur() are asynchronous
  4578. notAsync = expectSync( this, type );
  4579. this[ type ]();
  4580. result = dataPriv.get( this, type );
  4581. if ( saved !== result || notAsync ) {
  4582. dataPriv.set( this, type, false );
  4583. } else {
  4584. result = {};
  4585. }
  4586. if ( saved !== result ) {
  4587. // Cancel the outer synthetic event
  4588. event.stopImmediatePropagation();
  4589. event.preventDefault();
  4590. return result.value;
  4591. }
  4592. // If this is an inner synthetic event for an event with a bubbling surrogate
  4593. // (focus or blur), assume that the surrogate already propagated from triggering the
  4594. // native event and prevent that from happening again here.
  4595. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
  4596. // bubbling surrogate propagates *after* the non-bubbling base), but that seems
  4597. // less bad than duplication.
  4598. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
  4599. event.stopPropagation();
  4600. }
  4601. // If this is a native event triggered above, everything is now in order
  4602. // Fire an inner synthetic event with the original arguments
  4603. } else if ( saved.length ) {
  4604. // ...and capture the result
  4605. dataPriv.set( this, type, {
  4606. value: jQuery.event.trigger(
  4607. // Support: IE <=9 - 11+
  4608. // Extend with the prototype to reset the above stopImmediatePropagation()
  4609. jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
  4610. saved.slice( 1 ),
  4611. this
  4612. )
  4613. } );
  4614. // Abort handling of the native event
  4615. event.stopImmediatePropagation();
  4616. }
  4617. }
  4618. } );
  4619. }
  4620. jQuery.removeEvent = function( elem, type, handle ) {
  4621. // This "if" is needed for plain objects
  4622. if ( elem.removeEventListener ) {
  4623. elem.removeEventListener( type, handle );
  4624. }
  4625. };
  4626. jQuery.Event = function( src, props ) {
  4627. // Allow instantiation without the 'new' keyword
  4628. if ( !( this instanceof jQuery.Event ) ) {
  4629. return new jQuery.Event( src, props );
  4630. }
  4631. // Event object
  4632. if ( src && src.type ) {
  4633. this.originalEvent = src;
  4634. this.type = src.type;
  4635. // Events bubbling up the document may have been marked as prevented
  4636. // by a handler lower down the tree; reflect the correct value.
  4637. this.isDefaultPrevented = src.defaultPrevented ||
  4638. src.defaultPrevented === undefined &&
  4639. // Support: Android <=2.3 only
  4640. src.returnValue === false ?
  4641. returnTrue :
  4642. returnFalse;
  4643. // Create target properties
  4644. // Support: Safari <=6 - 7 only
  4645. // Target should not be a text node (#504, #13143)
  4646. this.target = ( src.target && src.target.nodeType === 3 ) ?
  4647. src.target.parentNode :
  4648. src.target;
  4649. this.currentTarget = src.currentTarget;
  4650. this.relatedTarget = src.relatedTarget;
  4651. // Event type
  4652. } else {
  4653. this.type = src;
  4654. }
  4655. // Put explicitly provided properties onto the event object
  4656. if ( props ) {
  4657. jQuery.extend( this, props );
  4658. }
  4659. // Create a timestamp if incoming event doesn't have one
  4660. this.timeStamp = src && src.timeStamp || Date.now();
  4661. // Mark it as fixed
  4662. this[ jQuery.expando ] = true;
  4663. };
  4664. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  4665. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  4666. jQuery.Event.prototype = {
  4667. constructor: jQuery.Event,
  4668. isDefaultPrevented: returnFalse,
  4669. isPropagationStopped: returnFalse,
  4670. isImmediatePropagationStopped: returnFalse,
  4671. isSimulated: false,
  4672. preventDefault: function() {
  4673. var e = this.originalEvent;
  4674. this.isDefaultPrevented = returnTrue;
  4675. if ( e && !this.isSimulated ) {
  4676. e.preventDefault();
  4677. }
  4678. },
  4679. stopPropagation: function() {
  4680. var e = this.originalEvent;
  4681. this.isPropagationStopped = returnTrue;
  4682. if ( e && !this.isSimulated ) {
  4683. e.stopPropagation();
  4684. }
  4685. },
  4686. stopImmediatePropagation: function() {
  4687. var e = this.originalEvent;
  4688. this.isImmediatePropagationStopped = returnTrue;
  4689. if ( e && !this.isSimulated ) {
  4690. e.stopImmediatePropagation();
  4691. }
  4692. this.stopPropagation();
  4693. }
  4694. };
  4695. // Includes all common event props including KeyEvent and MouseEvent specific props
  4696. jQuery.each( {
  4697. altKey: true,
  4698. bubbles: true,
  4699. cancelable: true,
  4700. changedTouches: true,
  4701. ctrlKey: true,
  4702. detail: true,
  4703. eventPhase: true,
  4704. metaKey: true,
  4705. pageX: true,
  4706. pageY: true,
  4707. shiftKey: true,
  4708. view: true,
  4709. "char": true,
  4710. code: true,
  4711. charCode: true,
  4712. key: true,
  4713. keyCode: true,
  4714. button: true,
  4715. buttons: true,
  4716. clientX: true,
  4717. clientY: true,
  4718. offsetX: true,
  4719. offsetY: true,
  4720. pointerId: true,
  4721. pointerType: true,
  4722. screenX: true,
  4723. screenY: true,
  4724. targetTouches: true,
  4725. toElement: true,
  4726. touches: true,
  4727. which: function( event ) {
  4728. var button = event.button;
  4729. // Add which for key events
  4730. if ( event.which == null && rkeyEvent.test( event.type ) ) {
  4731. return event.charCode != null ? event.charCode : event.keyCode;
  4732. }
  4733. // Add which for click: 1 === left; 2 === middle; 3 === right
  4734. if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
  4735. if ( button & 1 ) {
  4736. return 1;
  4737. }
  4738. if ( button & 2 ) {
  4739. return 3;
  4740. }
  4741. if ( button & 4 ) {
  4742. return 2;
  4743. }
  4744. return 0;
  4745. }
  4746. return event.which;
  4747. }
  4748. }, jQuery.event.addProp );
  4749. jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
  4750. jQuery.event.special[ type ] = {
  4751. // Utilize native event if possible so blur/focus sequence is correct
  4752. setup: function() {
  4753. // Claim the first handler
  4754. // dataPriv.set( this, "focus", ... )
  4755. // dataPriv.set( this, "blur", ... )
  4756. leverageNative( this, type, expectSync );
  4757. // Return false to allow normal processing in the caller
  4758. return false;
  4759. },
  4760. trigger: function() {
  4761. // Force setup before trigger
  4762. leverageNative( this, type );
  4763. // Return non-false to allow normal event-path propagation
  4764. return true;
  4765. },
  4766. delegateType: delegateType
  4767. };
  4768. } );
  4769. // Create mouseenter/leave events using mouseover/out and event-time checks
  4770. // so that event delegation works in jQuery.
  4771. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  4772. //
  4773. // Support: Safari 7 only
  4774. // Safari sends mouseenter too often; see:
  4775. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  4776. // for the description of the bug (it existed in older Chrome versions as well).
  4777. jQuery.each( {
  4778. mouseenter: "mouseover",
  4779. mouseleave: "mouseout",
  4780. pointerenter: "pointerover",
  4781. pointerleave: "pointerout"
  4782. }, function( orig, fix ) {
  4783. jQuery.event.special[ orig ] = {
  4784. delegateType: fix,
  4785. bindType: fix,
  4786. handle: function( event ) {
  4787. var ret,
  4788. target = this,
  4789. related = event.relatedTarget,
  4790. handleObj = event.handleObj;
  4791. // For mouseenter/leave call the handler if related is outside the target.
  4792. // NB: No relatedTarget if the mouse left/entered the browser window
  4793. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  4794. event.type = handleObj.origType;
  4795. ret = handleObj.handler.apply( this, arguments );
  4796. event.type = fix;
  4797. }
  4798. return ret;
  4799. }
  4800. };
  4801. } );
  4802. jQuery.fn.extend( {
  4803. on: function( types, selector, data, fn ) {
  4804. return on( this, types, selector, data, fn );
  4805. },
  4806. one: function( types, selector, data, fn ) {
  4807. return on( this, types, selector, data, fn, 1 );
  4808. },
  4809. off: function( types, selector, fn ) {
  4810. var handleObj, type;
  4811. if ( types && types.preventDefault && types.handleObj ) {
  4812. // ( event ) dispatched jQuery.Event
  4813. handleObj = types.handleObj;
  4814. jQuery( types.delegateTarget ).off(
  4815. handleObj.namespace ?
  4816. handleObj.origType + "." + handleObj.namespace :
  4817. handleObj.origType,
  4818. handleObj.selector,
  4819. handleObj.handler
  4820. );
  4821. return this;
  4822. }
  4823. if ( typeof types === "object" ) {
  4824. // ( types-object [, selector] )
  4825. for ( type in types ) {
  4826. this.off( type, selector, types[ type ] );
  4827. }
  4828. return this;
  4829. }
  4830. if ( selector === false || typeof selector === "function" ) {
  4831. // ( types [, fn] )
  4832. fn = selector;
  4833. selector = undefined;
  4834. }
  4835. if ( fn === false ) {
  4836. fn = returnFalse;
  4837. }
  4838. return this.each( function() {
  4839. jQuery.event.remove( this, types, fn, selector );
  4840. } );
  4841. }
  4842. } );
  4843. var
  4844. // Support: IE <=10 - 11, Edge 12 - 13 only
  4845. // In IE/Edge using regex groups here causes severe slowdowns.
  4846. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  4847. rnoInnerhtml = /<script|<style|<link/i,
  4848. // checked="checked" or checked
  4849. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  4850. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  4851. // Prefer a tbody over its parent table for containing new rows
  4852. function manipulationTarget( elem, content ) {
  4853. if ( nodeName( elem, "table" ) &&
  4854. nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  4855. return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
  4856. }
  4857. return elem;
  4858. }
  4859. // Replace/restore the type attribute of script elements for safe DOM manipulation
  4860. function disableScript( elem ) {
  4861. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  4862. return elem;
  4863. }
  4864. function restoreScript( elem ) {
  4865. if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
  4866. elem.type = elem.type.slice( 5 );
  4867. } else {
  4868. elem.removeAttribute( "type" );
  4869. }
  4870. return elem;
  4871. }
  4872. function cloneCopyEvent( src, dest ) {
  4873. var i, l, type, pdataOld, udataOld, udataCur, events;
  4874. if ( dest.nodeType !== 1 ) {
  4875. return;
  4876. }
  4877. // 1. Copy private data: events, handlers, etc.
  4878. if ( dataPriv.hasData( src ) ) {
  4879. pdataOld = dataPriv.get( src );
  4880. events = pdataOld.events;
  4881. if ( events ) {
  4882. dataPriv.remove( dest, "handle events" );
  4883. for ( type in events ) {
  4884. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  4885. jQuery.event.add( dest, type, events[ type ][ i ] );
  4886. }
  4887. }
  4888. }
  4889. }
  4890. // 2. Copy user data
  4891. if ( dataUser.hasData( src ) ) {
  4892. udataOld = dataUser.access( src );
  4893. udataCur = jQuery.extend( {}, udataOld );
  4894. dataUser.set( dest, udataCur );
  4895. }
  4896. }
  4897. // Fix IE bugs, see support tests
  4898. function fixInput( src, dest ) {
  4899. var nodeName = dest.nodeName.toLowerCase();
  4900. // Fails to persist the checked state of a cloned checkbox or radio button.
  4901. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  4902. dest.checked = src.checked;
  4903. // Fails to return the selected option to the default selected state when cloning options
  4904. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  4905. dest.defaultValue = src.defaultValue;
  4906. }
  4907. }
  4908. function domManip( collection, args, callback, ignored ) {
  4909. // Flatten any nested arrays
  4910. args = flat( args );
  4911. var fragment, first, scripts, hasScripts, node, doc,
  4912. i = 0,
  4913. l = collection.length,
  4914. iNoClone = l - 1,
  4915. value = args[ 0 ],
  4916. valueIsFunction = isFunction( value );
  4917. // We can't cloneNode fragments that contain checked, in WebKit
  4918. if ( valueIsFunction ||
  4919. ( l > 1 && typeof value === "string" &&
  4920. !support.checkClone && rchecked.test( value ) ) ) {
  4921. return collection.each( function( index ) {
  4922. var self = collection.eq( index );
  4923. if ( valueIsFunction ) {
  4924. args[ 0 ] = value.call( this, index, self.html() );
  4925. }
  4926. domManip( self, args, callback, ignored );
  4927. } );
  4928. }
  4929. if ( l ) {
  4930. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  4931. first = fragment.firstChild;
  4932. if ( fragment.childNodes.length === 1 ) {
  4933. fragment = first;
  4934. }
  4935. // Require either new content or an interest in ignored elements to invoke the callback
  4936. if ( first || ignored ) {
  4937. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  4938. hasScripts = scripts.length;
  4939. // Use the original fragment for the last item
  4940. // instead of the first because it can end up
  4941. // being emptied incorrectly in certain situations (#8070).
  4942. for ( ; i < l; i++ ) {
  4943. node = fragment;
  4944. if ( i !== iNoClone ) {
  4945. node = jQuery.clone( node, true, true );
  4946. // Keep references to cloned scripts for later restoration
  4947. if ( hasScripts ) {
  4948. // Support: Android <=4.0 only, PhantomJS 1 only
  4949. // push.apply(_, arraylike) throws on ancient WebKit
  4950. jQuery.merge( scripts, getAll( node, "script" ) );
  4951. }
  4952. }
  4953. callback.call( collection[ i ], node, i );
  4954. }
  4955. if ( hasScripts ) {
  4956. doc = scripts[ scripts.length - 1 ].ownerDocument;
  4957. // Reenable scripts
  4958. jQuery.map( scripts, restoreScript );
  4959. // Evaluate executable scripts on first document insertion
  4960. for ( i = 0; i < hasScripts; i++ ) {
  4961. node = scripts[ i ];
  4962. if ( rscriptType.test( node.type || "" ) &&
  4963. !dataPriv.access( node, "globalEval" ) &&
  4964. jQuery.contains( doc, node ) ) {
  4965. if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
  4966. // Optional AJAX dependency, but won't run scripts if not present
  4967. if ( jQuery._evalUrl && !node.noModule ) {
  4968. jQuery._evalUrl( node.src, {
  4969. nonce: node.nonce || node.getAttribute( "nonce" )
  4970. }, doc );
  4971. }
  4972. } else {
  4973. DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
  4974. }
  4975. }
  4976. }
  4977. }
  4978. }
  4979. }
  4980. return collection;
  4981. }
  4982. function remove( elem, selector, keepData ) {
  4983. var node,
  4984. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  4985. i = 0;
  4986. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  4987. if ( !keepData && node.nodeType === 1 ) {
  4988. jQuery.cleanData( getAll( node ) );
  4989. }
  4990. if ( node.parentNode ) {
  4991. if ( keepData && isAttached( node ) ) {
  4992. setGlobalEval( getAll( node, "script" ) );
  4993. }
  4994. node.parentNode.removeChild( node );
  4995. }
  4996. }
  4997. return elem;
  4998. }
  4999. jQuery.extend( {
  5000. htmlPrefilter: function( html ) {
  5001. return html;
  5002. },
  5003. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  5004. var i, l, srcElements, destElements,
  5005. clone = elem.cloneNode( true ),
  5006. inPage = isAttached( elem );
  5007. // Fix IE cloning issues
  5008. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  5009. !jQuery.isXMLDoc( elem ) ) {
  5010. // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
  5011. destElements = getAll( clone );
  5012. srcElements = getAll( elem );
  5013. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  5014. fixInput( srcElements[ i ], destElements[ i ] );
  5015. }
  5016. }
  5017. // Copy the events from the original to the clone
  5018. if ( dataAndEvents ) {
  5019. if ( deepDataAndEvents ) {
  5020. srcElements = srcElements || getAll( elem );
  5021. destElements = destElements || getAll( clone );
  5022. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  5023. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  5024. }
  5025. } else {
  5026. cloneCopyEvent( elem, clone );
  5027. }
  5028. }
  5029. // Preserve script evaluation history
  5030. destElements = getAll( clone, "script" );
  5031. if ( destElements.length > 0 ) {
  5032. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  5033. }
  5034. // Return the cloned set
  5035. return clone;
  5036. },
  5037. cleanData: function( elems ) {
  5038. var data, elem, type,
  5039. special = jQuery.event.special,
  5040. i = 0;
  5041. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  5042. if ( acceptData( elem ) ) {
  5043. if ( ( data = elem[ dataPriv.expando ] ) ) {
  5044. if ( data.events ) {
  5045. for ( type in data.events ) {
  5046. if ( special[ type ] ) {
  5047. jQuery.event.remove( elem, type );
  5048. // This is a shortcut to avoid jQuery.event.remove's overhead
  5049. } else {
  5050. jQuery.removeEvent( elem, type, data.handle );
  5051. }
  5052. }
  5053. }
  5054. // Support: Chrome <=35 - 45+
  5055. // Assign undefined instead of using delete, see Data#remove
  5056. elem[ dataPriv.expando ] = undefined;
  5057. }
  5058. if ( elem[ dataUser.expando ] ) {
  5059. // Support: Chrome <=35 - 45+
  5060. // Assign undefined instead of using delete, see Data#remove
  5061. elem[ dataUser.expando ] = undefined;
  5062. }
  5063. }
  5064. }
  5065. }
  5066. } );
  5067. jQuery.fn.extend( {
  5068. detach: function( selector ) {
  5069. return remove( this, selector, true );
  5070. },
  5071. remove: function( selector ) {
  5072. return remove( this, selector );
  5073. },
  5074. text: function( value ) {
  5075. return access( this, function( value ) {
  5076. return value === undefined ?
  5077. jQuery.text( this ) :
  5078. this.empty().each( function() {
  5079. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  5080. this.textContent = value;
  5081. }
  5082. } );
  5083. }, null, value, arguments.length );
  5084. },
  5085. append: function() {
  5086. return domManip( this, arguments, function( elem ) {
  5087. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  5088. var target = manipulationTarget( this, elem );
  5089. target.appendChild( elem );
  5090. }
  5091. } );
  5092. },
  5093. prepend: function() {
  5094. return domManip( this, arguments, function( elem ) {
  5095. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  5096. var target = manipulationTarget( this, elem );
  5097. target.insertBefore( elem, target.firstChild );
  5098. }
  5099. } );
  5100. },
  5101. before: function() {
  5102. return domManip( this, arguments, function( elem ) {
  5103. if ( this.parentNode ) {
  5104. this.parentNode.insertBefore( elem, this );
  5105. }
  5106. } );
  5107. },
  5108. after: function() {
  5109. return domManip( this, arguments, function( elem ) {
  5110. if ( this.parentNode ) {
  5111. this.parentNode.insertBefore( elem, this.nextSibling );
  5112. }
  5113. } );
  5114. },
  5115. empty: function() {
  5116. var elem,
  5117. i = 0;
  5118. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  5119. if ( elem.nodeType === 1 ) {
  5120. // Prevent memory leaks
  5121. jQuery.cleanData( getAll( elem, false ) );
  5122. // Remove any remaining nodes
  5123. elem.textContent = "";
  5124. }
  5125. }
  5126. return this;
  5127. },
  5128. clone: function( dataAndEvents, deepDataAndEvents ) {
  5129. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  5130. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  5131. return this.map( function() {
  5132. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  5133. } );
  5134. },
  5135. html: function( value ) {
  5136. return access( this, function( value ) {
  5137. var elem = this[ 0 ] || {},
  5138. i = 0,
  5139. l = this.length;
  5140. if ( value === undefined && elem.nodeType === 1 ) {
  5141. return elem.innerHTML;
  5142. }
  5143. // See if we can take a shortcut and just use innerHTML
  5144. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  5145. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  5146. value = jQuery.htmlPrefilter( value );
  5147. try {
  5148. for ( ; i < l; i++ ) {
  5149. elem = this[ i ] || {};
  5150. // Remove element nodes and prevent memory leaks
  5151. if ( elem.nodeType === 1 ) {
  5152. jQuery.cleanData( getAll( elem, false ) );
  5153. elem.innerHTML = value;
  5154. }
  5155. }
  5156. elem = 0;
  5157. // If using innerHTML throws an exception, use the fallback method
  5158. } catch ( e ) {}
  5159. }
  5160. if ( elem ) {
  5161. this.empty().append( value );
  5162. }
  5163. }, null, value, arguments.length );
  5164. },
  5165. replaceWith: function() {
  5166. var ignored = [];
  5167. // Make the changes, replacing each non-ignored context element with the new content
  5168. return domManip( this, arguments, function( elem ) {
  5169. var parent = this.parentNode;
  5170. if ( jQuery.inArray( this, ignored ) < 0 ) {
  5171. jQuery.cleanData( getAll( this ) );
  5172. if ( parent ) {
  5173. parent.replaceChild( elem, this );
  5174. }
  5175. }
  5176. // Force callback invocation
  5177. }, ignored );
  5178. }
  5179. } );
  5180. jQuery.each( {
  5181. appendTo: "append",
  5182. prependTo: "prepend",
  5183. insertBefore: "before",
  5184. insertAfter: "after",
  5185. replaceAll: "replaceWith"
  5186. }, function( name, original ) {
  5187. jQuery.fn[ name ] = function( selector ) {
  5188. var elems,
  5189. ret = [],
  5190. insert = jQuery( selector ),
  5191. last = insert.length - 1,
  5192. i = 0;
  5193. for ( ; i <= last; i++ ) {
  5194. elems = i === last ? this : this.clone( true );
  5195. jQuery( insert[ i ] )[ original ]( elems );
  5196. // Support: Android <=4.0 only, PhantomJS 1 only
  5197. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  5198. push.apply( ret, elems.get() );
  5199. }
  5200. return this.pushStack( ret );
  5201. };
  5202. } );
  5203. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  5204. var getStyles = function( elem ) {
  5205. // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
  5206. // IE throws on elements created in popups
  5207. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  5208. var view = elem.ownerDocument.defaultView;
  5209. if ( !view || !view.opener ) {
  5210. view = window;
  5211. }
  5212. return view.getComputedStyle( elem );
  5213. };
  5214. var swap = function( elem, options, callback ) {
  5215. var ret, name,
  5216. old = {};
  5217. // Remember the old values, and insert the new ones
  5218. for ( name in options ) {
  5219. old[ name ] = elem.style[ name ];
  5220. elem.style[ name ] = options[ name ];
  5221. }
  5222. ret = callback.call( elem );
  5223. // Revert the old values
  5224. for ( name in options ) {
  5225. elem.style[ name ] = old[ name ];
  5226. }
  5227. return ret;
  5228. };
  5229. var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
  5230. ( function() {
  5231. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  5232. // so they're executed at the same time to save the second computation.
  5233. function computeStyleTests() {
  5234. // This is a singleton, we need to execute it only once
  5235. if ( !div ) {
  5236. return;
  5237. }
  5238. container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
  5239. "margin-top:1px;padding:0;border:0";
  5240. div.style.cssText =
  5241. "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
  5242. "margin:auto;border:1px;padding:1px;" +
  5243. "width:60%;top:1%";
  5244. documentElement.appendChild( container ).appendChild( div );
  5245. var divStyle = window.getComputedStyle( div );
  5246. pixelPositionVal = divStyle.top !== "1%";
  5247. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  5248. reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
  5249. // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
  5250. // Some styles come back with percentage values, even though they shouldn't
  5251. div.style.right = "60%";
  5252. pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
  5253. // Support: IE 9 - 11 only
  5254. // Detect misreporting of content dimensions for box-sizing:border-box elements
  5255. boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
  5256. // Support: IE 9 only
  5257. // Detect overflow:scroll screwiness (gh-3699)
  5258. // Support: Chrome <=64
  5259. // Don't get tricked when zoom affects offsetWidth (gh-4029)
  5260. div.style.position = "absolute";
  5261. scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
  5262. documentElement.removeChild( container );
  5263. // Nullify the div so it wouldn't be stored in the memory and
  5264. // it will also be a sign that checks already performed
  5265. div = null;
  5266. }
  5267. function roundPixelMeasures( measure ) {
  5268. return Math.round( parseFloat( measure ) );
  5269. }
  5270. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
  5271. reliableTrDimensionsVal, reliableMarginLeftVal,
  5272. container = document.createElement( "div" ),
  5273. div = document.createElement( "div" );
  5274. // Finish early in limited (non-browser) environments
  5275. if ( !div.style ) {
  5276. return;
  5277. }
  5278. // Support: IE <=9 - 11 only
  5279. // Style of cloned element affects source element cloned (#8908)
  5280. div.style.backgroundClip = "content-box";
  5281. div.cloneNode( true ).style.backgroundClip = "";
  5282. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  5283. jQuery.extend( support, {
  5284. boxSizingReliable: function() {
  5285. computeStyleTests();
  5286. return boxSizingReliableVal;
  5287. },
  5288. pixelBoxStyles: function() {
  5289. computeStyleTests();
  5290. return pixelBoxStylesVal;
  5291. },
  5292. pixelPosition: function() {
  5293. computeStyleTests();
  5294. return pixelPositionVal;
  5295. },
  5296. reliableMarginLeft: function() {
  5297. computeStyleTests();
  5298. return reliableMarginLeftVal;
  5299. },
  5300. scrollboxSize: function() {
  5301. computeStyleTests();
  5302. return scrollboxSizeVal;
  5303. },
  5304. // Support: IE 9 - 11+, Edge 15 - 18+
  5305. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  5306. // set in CSS while `offset*` properties report correct values.
  5307. // Behavior in IE 9 is more subtle than in newer versions & it passes
  5308. // some versions of this test; make sure not to make it pass there!
  5309. reliableTrDimensions: function() {
  5310. var table, tr, trChild, trStyle;
  5311. if ( reliableTrDimensionsVal == null ) {
  5312. table = document.createElement( "table" );
  5313. tr = document.createElement( "tr" );
  5314. trChild = document.createElement( "div" );
  5315. table.style.cssText = "position:absolute;left:-11111px";
  5316. tr.style.height = "1px";
  5317. trChild.style.height = "9px";
  5318. documentElement
  5319. .appendChild( table )
  5320. .appendChild( tr )
  5321. .appendChild( trChild );
  5322. trStyle = window.getComputedStyle( tr );
  5323. reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
  5324. documentElement.removeChild( table );
  5325. }
  5326. return reliableTrDimensionsVal;
  5327. }
  5328. } );
  5329. } )();
  5330. function curCSS( elem, name, computed ) {
  5331. var width, minWidth, maxWidth, ret,
  5332. // Support: Firefox 51+
  5333. // Retrieving style before computed somehow
  5334. // fixes an issue with getting wrong values
  5335. // on detached elements
  5336. style = elem.style;
  5337. computed = computed || getStyles( elem );
  5338. // getPropertyValue is needed for:
  5339. // .css('filter') (IE 9 only, #12537)
  5340. // .css('--customProperty) (#3144)
  5341. if ( computed ) {
  5342. ret = computed.getPropertyValue( name ) || computed[ name ];
  5343. if ( ret === "" && !isAttached( elem ) ) {
  5344. ret = jQuery.style( elem, name );
  5345. }
  5346. // A tribute to the "awesome hack by Dean Edwards"
  5347. // Android Browser returns percentage for some values,
  5348. // but width seems to be reliably pixels.
  5349. // This is against the CSSOM draft spec:
  5350. // https://drafts.csswg.org/cssom/#resolved-values
  5351. if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
  5352. // Remember the original values
  5353. width = style.width;
  5354. minWidth = style.minWidth;
  5355. maxWidth = style.maxWidth;
  5356. // Put in the new values to get a computed value out
  5357. style.minWidth = style.maxWidth = style.width = ret;
  5358. ret = computed.width;
  5359. // Revert the changed values
  5360. style.width = width;
  5361. style.minWidth = minWidth;
  5362. style.maxWidth = maxWidth;
  5363. }
  5364. }
  5365. return ret !== undefined ?
  5366. // Support: IE <=9 - 11 only
  5367. // IE returns zIndex value as an integer.
  5368. ret + "" :
  5369. ret;
  5370. }
  5371. function addGetHookIf( conditionFn, hookFn ) {
  5372. // Define the hook, we'll check on the first run if it's really needed.
  5373. return {
  5374. get: function() {
  5375. if ( conditionFn() ) {
  5376. // Hook not needed (or it's not possible to use it due
  5377. // to missing dependency), remove it.
  5378. delete this.get;
  5379. return;
  5380. }
  5381. // Hook needed; redefine it so that the support test is not executed again.
  5382. return ( this.get = hookFn ).apply( this, arguments );
  5383. }
  5384. };
  5385. }
  5386. var cssPrefixes = [ "Webkit", "Moz", "ms" ],
  5387. emptyStyle = document.createElement( "div" ).style,
  5388. vendorProps = {};
  5389. // Return a vendor-prefixed property or undefined
  5390. function vendorPropName( name ) {
  5391. // Check for vendor prefixed names
  5392. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  5393. i = cssPrefixes.length;
  5394. while ( i-- ) {
  5395. name = cssPrefixes[ i ] + capName;
  5396. if ( name in emptyStyle ) {
  5397. return name;
  5398. }
  5399. }
  5400. }
  5401. // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
  5402. function finalPropName( name ) {
  5403. var final = jQuery.cssProps[ name ] || vendorProps[ name ];
  5404. if ( final ) {
  5405. return final;
  5406. }
  5407. if ( name in emptyStyle ) {
  5408. return name;
  5409. }
  5410. return vendorProps[ name ] = vendorPropName( name ) || name;
  5411. }
  5412. var
  5413. // Swappable if display is none or starts with table
  5414. // except "table", "table-cell", or "table-caption"
  5415. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  5416. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  5417. rcustomProp = /^--/,
  5418. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  5419. cssNormalTransform = {
  5420. letterSpacing: "0",
  5421. fontWeight: "400"
  5422. };
  5423. function setPositiveNumber( _elem, value, subtract ) {
  5424. // Any relative (+/-) values have already been
  5425. // normalized at this point
  5426. var matches = rcssNum.exec( value );
  5427. return matches ?
  5428. // Guard against undefined "subtract", e.g., when used as in cssHooks
  5429. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  5430. value;
  5431. }
  5432. function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
  5433. var i = dimension === "width" ? 1 : 0,
  5434. extra = 0,
  5435. delta = 0;
  5436. // Adjustment may not be necessary
  5437. if ( box === ( isBorderBox ? "border" : "content" ) ) {
  5438. return 0;
  5439. }
  5440. for ( ; i < 4; i += 2 ) {
  5441. // Both box models exclude margin
  5442. if ( box === "margin" ) {
  5443. delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
  5444. }
  5445. // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
  5446. if ( !isBorderBox ) {
  5447. // Add padding
  5448. delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  5449. // For "border" or "margin", add border
  5450. if ( box !== "padding" ) {
  5451. delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5452. // But still keep track of it otherwise
  5453. } else {
  5454. extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5455. }
  5456. // If we get here with a border-box (content + padding + border), we're seeking "content" or
  5457. // "padding" or "margin"
  5458. } else {
  5459. // For "content", subtract padding
  5460. if ( box === "content" ) {
  5461. delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  5462. }
  5463. // For "content" or "padding", subtract border
  5464. if ( box !== "margin" ) {
  5465. delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5466. }
  5467. }
  5468. }
  5469. // Account for positive content-box scroll gutter when requested by providing computedVal
  5470. if ( !isBorderBox && computedVal >= 0 ) {
  5471. // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
  5472. // Assuming integer scroll gutter, subtract the rest and round down
  5473. delta += Math.max( 0, Math.ceil(
  5474. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  5475. computedVal -
  5476. delta -
  5477. extra -
  5478. 0.5
  5479. // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
  5480. // Use an explicit zero to avoid NaN (gh-3964)
  5481. ) ) || 0;
  5482. }
  5483. return delta;
  5484. }
  5485. function getWidthOrHeight( elem, dimension, extra ) {
  5486. // Start with computed style
  5487. var styles = getStyles( elem ),
  5488. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
  5489. // Fake content-box until we know it's needed to know the true value.
  5490. boxSizingNeeded = !support.boxSizingReliable() || extra,
  5491. isBorderBox = boxSizingNeeded &&
  5492. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5493. valueIsBorderBox = isBorderBox,
  5494. val = curCSS( elem, dimension, styles ),
  5495. offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
  5496. // Support: Firefox <=54
  5497. // Return a confounding non-pixel value or feign ignorance, as appropriate.
  5498. if ( rnumnonpx.test( val ) ) {
  5499. if ( !extra ) {
  5500. return val;
  5501. }
  5502. val = "auto";
  5503. }
  5504. // Support: IE 9 - 11 only
  5505. // Use offsetWidth/offsetHeight for when box sizing is unreliable.
  5506. // In those cases, the computed value can be trusted to be border-box.
  5507. if ( ( !support.boxSizingReliable() && isBorderBox ||
  5508. // Support: IE 10 - 11+, Edge 15 - 18+
  5509. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  5510. // set in CSS while `offset*` properties report correct values.
  5511. // Interestingly, in some cases IE 9 doesn't suffer from this issue.
  5512. !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
  5513. // Fall back to offsetWidth/offsetHeight when value is "auto"
  5514. // This happens for inline elements with no explicit setting (gh-3571)
  5515. val === "auto" ||
  5516. // Support: Android <=4.1 - 4.3 only
  5517. // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
  5518. !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
  5519. // Make sure the element is visible & connected
  5520. elem.getClientRects().length ) {
  5521. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  5522. // Where available, offsetWidth/offsetHeight approximate border box dimensions.
  5523. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
  5524. // retrieved value as a content box dimension.
  5525. valueIsBorderBox = offsetProp in elem;
  5526. if ( valueIsBorderBox ) {
  5527. val = elem[ offsetProp ];
  5528. }
  5529. }
  5530. // Normalize "" and auto
  5531. val = parseFloat( val ) || 0;
  5532. // Adjust for the element's box model
  5533. return ( val +
  5534. boxModelAdjustment(
  5535. elem,
  5536. dimension,
  5537. extra || ( isBorderBox ? "border" : "content" ),
  5538. valueIsBorderBox,
  5539. styles,
  5540. // Provide the current computed size to request scroll gutter calculation (gh-3589)
  5541. val
  5542. )
  5543. ) + "px";
  5544. }
  5545. jQuery.extend( {
  5546. // Add in style property hooks for overriding the default
  5547. // behavior of getting and setting a style property
  5548. cssHooks: {
  5549. opacity: {
  5550. get: function( elem, computed ) {
  5551. if ( computed ) {
  5552. // We should always get a number back from opacity
  5553. var ret = curCSS( elem, "opacity" );
  5554. return ret === "" ? "1" : ret;
  5555. }
  5556. }
  5557. }
  5558. },
  5559. // Don't automatically add "px" to these possibly-unitless properties
  5560. cssNumber: {
  5561. "animationIterationCount": true,
  5562. "columnCount": true,
  5563. "fillOpacity": true,
  5564. "flexGrow": true,
  5565. "flexShrink": true,
  5566. "fontWeight": true,
  5567. "gridArea": true,
  5568. "gridColumn": true,
  5569. "gridColumnEnd": true,
  5570. "gridColumnStart": true,
  5571. "gridRow": true,
  5572. "gridRowEnd": true,
  5573. "gridRowStart": true,
  5574. "lineHeight": true,
  5575. "opacity": true,
  5576. "order": true,
  5577. "orphans": true,
  5578. "widows": true,
  5579. "zIndex": true,
  5580. "zoom": true
  5581. },
  5582. // Add in properties whose names you wish to fix before
  5583. // setting or getting the value
  5584. cssProps: {},
  5585. // Get and set the style property on a DOM Node
  5586. style: function( elem, name, value, extra ) {
  5587. // Don't set styles on text and comment nodes
  5588. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  5589. return;
  5590. }
  5591. // Make sure that we're working with the right name
  5592. var ret, type, hooks,
  5593. origName = camelCase( name ),
  5594. isCustomProp = rcustomProp.test( name ),
  5595. style = elem.style;
  5596. // Make sure that we're working with the right name. We don't
  5597. // want to query the value if it is a CSS custom property
  5598. // since they are user-defined.
  5599. if ( !isCustomProp ) {
  5600. name = finalPropName( origName );
  5601. }
  5602. // Gets hook for the prefixed version, then unprefixed version
  5603. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5604. // Check if we're setting a value
  5605. if ( value !== undefined ) {
  5606. type = typeof value;
  5607. // Convert "+=" or "-=" to relative numbers (#7345)
  5608. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  5609. value = adjustCSS( elem, name, ret );
  5610. // Fixes bug #9237
  5611. type = "number";
  5612. }
  5613. // Make sure that null and NaN values aren't set (#7116)
  5614. if ( value == null || value !== value ) {
  5615. return;
  5616. }
  5617. // If a number was passed in, add the unit (except for certain CSS properties)
  5618. // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
  5619. // "px" to a few hardcoded values.
  5620. if ( type === "number" && !isCustomProp ) {
  5621. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  5622. }
  5623. // background-* props affect original clone's values
  5624. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  5625. style[ name ] = "inherit";
  5626. }
  5627. // If a hook was provided, use that value, otherwise just set the specified value
  5628. if ( !hooks || !( "set" in hooks ) ||
  5629. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  5630. if ( isCustomProp ) {
  5631. style.setProperty( name, value );
  5632. } else {
  5633. style[ name ] = value;
  5634. }
  5635. }
  5636. } else {
  5637. // If a hook was provided get the non-computed value from there
  5638. if ( hooks && "get" in hooks &&
  5639. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  5640. return ret;
  5641. }
  5642. // Otherwise just get the value from the style object
  5643. return style[ name ];
  5644. }
  5645. },
  5646. css: function( elem, name, extra, styles ) {
  5647. var val, num, hooks,
  5648. origName = camelCase( name ),
  5649. isCustomProp = rcustomProp.test( name );
  5650. // Make sure that we're working with the right name. We don't
  5651. // want to modify the value if it is a CSS custom property
  5652. // since they are user-defined.
  5653. if ( !isCustomProp ) {
  5654. name = finalPropName( origName );
  5655. }
  5656. // Try prefixed name followed by the unprefixed name
  5657. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5658. // If a hook was provided get the computed value from there
  5659. if ( hooks && "get" in hooks ) {
  5660. val = hooks.get( elem, true, extra );
  5661. }
  5662. // Otherwise, if a way to get the computed value exists, use that
  5663. if ( val === undefined ) {
  5664. val = curCSS( elem, name, styles );
  5665. }
  5666. // Convert "normal" to computed value
  5667. if ( val === "normal" && name in cssNormalTransform ) {
  5668. val = cssNormalTransform[ name ];
  5669. }
  5670. // Make numeric if forced or a qualifier was provided and val looks numeric
  5671. if ( extra === "" || extra ) {
  5672. num = parseFloat( val );
  5673. return extra === true || isFinite( num ) ? num || 0 : val;
  5674. }
  5675. return val;
  5676. }
  5677. } );
  5678. jQuery.each( [ "height", "width" ], function( _i, dimension ) {
  5679. jQuery.cssHooks[ dimension ] = {
  5680. get: function( elem, computed, extra ) {
  5681. if ( computed ) {
  5682. // Certain elements can have dimension info if we invisibly show them
  5683. // but it must have a current display style that would benefit
  5684. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  5685. // Support: Safari 8+
  5686. // Table columns in Safari have non-zero offsetWidth & zero
  5687. // getBoundingClientRect().width unless display is changed.
  5688. // Support: IE <=11 only
  5689. // Running getBoundingClientRect on a disconnected node
  5690. // in IE throws an error.
  5691. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  5692. swap( elem, cssShow, function() {
  5693. return getWidthOrHeight( elem, dimension, extra );
  5694. } ) :
  5695. getWidthOrHeight( elem, dimension, extra );
  5696. }
  5697. },
  5698. set: function( elem, value, extra ) {
  5699. var matches,
  5700. styles = getStyles( elem ),
  5701. // Only read styles.position if the test has a chance to fail
  5702. // to avoid forcing a reflow.
  5703. scrollboxSizeBuggy = !support.scrollboxSize() &&
  5704. styles.position === "absolute",
  5705. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
  5706. boxSizingNeeded = scrollboxSizeBuggy || extra,
  5707. isBorderBox = boxSizingNeeded &&
  5708. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5709. subtract = extra ?
  5710. boxModelAdjustment(
  5711. elem,
  5712. dimension,
  5713. extra,
  5714. isBorderBox,
  5715. styles
  5716. ) :
  5717. 0;
  5718. // Account for unreliable border-box dimensions by comparing offset* to computed and
  5719. // faking a content-box to get border and padding (gh-3699)
  5720. if ( isBorderBox && scrollboxSizeBuggy ) {
  5721. subtract -= Math.ceil(
  5722. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  5723. parseFloat( styles[ dimension ] ) -
  5724. boxModelAdjustment( elem, dimension, "border", false, styles ) -
  5725. 0.5
  5726. );
  5727. }
  5728. // Convert to pixels if value adjustment is needed
  5729. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  5730. ( matches[ 3 ] || "px" ) !== "px" ) {
  5731. elem.style[ dimension ] = value;
  5732. value = jQuery.css( elem, dimension );
  5733. }
  5734. return setPositiveNumber( elem, value, subtract );
  5735. }
  5736. };
  5737. } );
  5738. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  5739. function( elem, computed ) {
  5740. if ( computed ) {
  5741. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  5742. elem.getBoundingClientRect().left -
  5743. swap( elem, { marginLeft: 0 }, function() {
  5744. return elem.getBoundingClientRect().left;
  5745. } )
  5746. ) + "px";
  5747. }
  5748. }
  5749. );
  5750. // These hooks are used by animate to expand properties
  5751. jQuery.each( {
  5752. margin: "",
  5753. padding: "",
  5754. border: "Width"
  5755. }, function( prefix, suffix ) {
  5756. jQuery.cssHooks[ prefix + suffix ] = {
  5757. expand: function( value ) {
  5758. var i = 0,
  5759. expanded = {},
  5760. // Assumes a single number if not a string
  5761. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  5762. for ( ; i < 4; i++ ) {
  5763. expanded[ prefix + cssExpand[ i ] + suffix ] =
  5764. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  5765. }
  5766. return expanded;
  5767. }
  5768. };
  5769. if ( prefix !== "margin" ) {
  5770. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  5771. }
  5772. } );
  5773. jQuery.fn.extend( {
  5774. css: function( name, value ) {
  5775. return access( this, function( elem, name, value ) {
  5776. var styles, len,
  5777. map = {},
  5778. i = 0;
  5779. if ( Array.isArray( name ) ) {
  5780. styles = getStyles( elem );
  5781. len = name.length;
  5782. for ( ; i < len; i++ ) {
  5783. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  5784. }
  5785. return map;
  5786. }
  5787. return value !== undefined ?
  5788. jQuery.style( elem, name, value ) :
  5789. jQuery.css( elem, name );
  5790. }, name, value, arguments.length > 1 );
  5791. }
  5792. } );
  5793. function Tween( elem, options, prop, end, easing ) {
  5794. return new Tween.prototype.init( elem, options, prop, end, easing );
  5795. }
  5796. jQuery.Tween = Tween;
  5797. Tween.prototype = {
  5798. constructor: Tween,
  5799. init: function( elem, options, prop, end, easing, unit ) {
  5800. this.elem = elem;
  5801. this.prop = prop;
  5802. this.easing = easing || jQuery.easing._default;
  5803. this.options = options;
  5804. this.start = this.now = this.cur();
  5805. this.end = end;
  5806. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  5807. },
  5808. cur: function() {
  5809. var hooks = Tween.propHooks[ this.prop ];
  5810. return hooks && hooks.get ?
  5811. hooks.get( this ) :
  5812. Tween.propHooks._default.get( this );
  5813. },
  5814. run: function( percent ) {
  5815. var eased,
  5816. hooks = Tween.propHooks[ this.prop ];
  5817. if ( this.options.duration ) {
  5818. this.pos = eased = jQuery.easing[ this.easing ](
  5819. percent, this.options.duration * percent, 0, 1, this.options.duration
  5820. );
  5821. } else {
  5822. this.pos = eased = percent;
  5823. }
  5824. this.now = ( this.end - this.start ) * eased + this.start;
  5825. if ( this.options.step ) {
  5826. this.options.step.call( this.elem, this.now, this );
  5827. }
  5828. if ( hooks && hooks.set ) {
  5829. hooks.set( this );
  5830. } else {
  5831. Tween.propHooks._default.set( this );
  5832. }
  5833. return this;
  5834. }
  5835. };
  5836. Tween.prototype.init.prototype = Tween.prototype;
  5837. Tween.propHooks = {
  5838. _default: {
  5839. get: function( tween ) {
  5840. var result;
  5841. // Use a property on the element directly when it is not a DOM element,
  5842. // or when there is no matching style property that exists.
  5843. if ( tween.elem.nodeType !== 1 ||
  5844. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  5845. return tween.elem[ tween.prop ];
  5846. }
  5847. // Passing an empty string as a 3rd parameter to .css will automatically
  5848. // attempt a parseFloat and fallback to a string if the parse fails.
  5849. // Simple values such as "10px" are parsed to Float;
  5850. // complex values such as "rotate(1rad)" are returned as-is.
  5851. result = jQuery.css( tween.elem, tween.prop, "" );
  5852. // Empty strings, null, undefined and "auto" are converted to 0.
  5853. return !result || result === "auto" ? 0 : result;
  5854. },
  5855. set: function( tween ) {
  5856. // Use step hook for back compat.
  5857. // Use cssHook if its there.
  5858. // Use .style if available and use plain properties where available.
  5859. if ( jQuery.fx.step[ tween.prop ] ) {
  5860. jQuery.fx.step[ tween.prop ]( tween );
  5861. } else if ( tween.elem.nodeType === 1 && (
  5862. jQuery.cssHooks[ tween.prop ] ||
  5863. tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
  5864. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  5865. } else {
  5866. tween.elem[ tween.prop ] = tween.now;
  5867. }
  5868. }
  5869. }
  5870. };
  5871. // Support: IE <=9 only
  5872. // Panic based approach to setting things on disconnected nodes
  5873. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  5874. set: function( tween ) {
  5875. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  5876. tween.elem[ tween.prop ] = tween.now;
  5877. }
  5878. }
  5879. };
  5880. jQuery.easing = {
  5881. linear: function( p ) {
  5882. return p;
  5883. },
  5884. swing: function( p ) {
  5885. return 0.5 - Math.cos( p * Math.PI ) / 2;
  5886. },
  5887. _default: "swing"
  5888. };
  5889. jQuery.fx = Tween.prototype.init;
  5890. // Back compat <1.8 extension point
  5891. jQuery.fx.step = {};
  5892. var
  5893. fxNow, inProgress,
  5894. rfxtypes = /^(?:toggle|show|hide)$/,
  5895. rrun = /queueHooks$/;
  5896. function schedule() {
  5897. if ( inProgress ) {
  5898. if ( document.hidden === false && window.requestAnimationFrame ) {
  5899. window.requestAnimationFrame( schedule );
  5900. } else {
  5901. window.setTimeout( schedule, jQuery.fx.interval );
  5902. }
  5903. jQuery.fx.tick();
  5904. }
  5905. }
  5906. // Animations created synchronously will run synchronously
  5907. function createFxNow() {
  5908. window.setTimeout( function() {
  5909. fxNow = undefined;
  5910. } );
  5911. return ( fxNow = Date.now() );
  5912. }
  5913. // Generate parameters to create a standard animation
  5914. function genFx( type, includeWidth ) {
  5915. var which,
  5916. i = 0,
  5917. attrs = { height: type };
  5918. // If we include width, step value is 1 to do all cssExpand values,
  5919. // otherwise step value is 2 to skip over Left and Right
  5920. includeWidth = includeWidth ? 1 : 0;
  5921. for ( ; i < 4; i += 2 - includeWidth ) {
  5922. which = cssExpand[ i ];
  5923. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  5924. }
  5925. if ( includeWidth ) {
  5926. attrs.opacity = attrs.width = type;
  5927. }
  5928. return attrs;
  5929. }
  5930. function createTween( value, prop, animation ) {
  5931. var tween,
  5932. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  5933. index = 0,
  5934. length = collection.length;
  5935. for ( ; index < length; index++ ) {
  5936. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  5937. // We're done with this property
  5938. return tween;
  5939. }
  5940. }
  5941. }
  5942. function defaultPrefilter( elem, props, opts ) {
  5943. var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
  5944. isBox = "width" in props || "height" in props,
  5945. anim = this,
  5946. orig = {},
  5947. style = elem.style,
  5948. hidden = elem.nodeType && isHiddenWithinTree( elem ),
  5949. dataShow = dataPriv.get( elem, "fxshow" );
  5950. // Queue-skipping animations hijack the fx hooks
  5951. if ( !opts.queue ) {
  5952. hooks = jQuery._queueHooks( elem, "fx" );
  5953. if ( hooks.unqueued == null ) {
  5954. hooks.unqueued = 0;
  5955. oldfire = hooks.empty.fire;
  5956. hooks.empty.fire = function() {
  5957. if ( !hooks.unqueued ) {
  5958. oldfire();
  5959. }
  5960. };
  5961. }
  5962. hooks.unqueued++;
  5963. anim.always( function() {
  5964. // Ensure the complete handler is called before this completes
  5965. anim.always( function() {
  5966. hooks.unqueued--;
  5967. if ( !jQuery.queue( elem, "fx" ).length ) {
  5968. hooks.empty.fire();
  5969. }
  5970. } );
  5971. } );
  5972. }
  5973. // Detect show/hide animations
  5974. for ( prop in props ) {
  5975. value = props[ prop ];
  5976. if ( rfxtypes.test( value ) ) {
  5977. delete props[ prop ];
  5978. toggle = toggle || value === "toggle";
  5979. if ( value === ( hidden ? "hide" : "show" ) ) {
  5980. // Pretend to be hidden if this is a "show" and
  5981. // there is still data from a stopped show/hide
  5982. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  5983. hidden = true;
  5984. // Ignore all other no-op show/hide data
  5985. } else {
  5986. continue;
  5987. }
  5988. }
  5989. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  5990. }
  5991. }
  5992. // Bail out if this is a no-op like .hide().hide()
  5993. propTween = !jQuery.isEmptyObject( props );
  5994. if ( !propTween && jQuery.isEmptyObject( orig ) ) {
  5995. return;
  5996. }
  5997. // Restrict "overflow" and "display" styles during box animations
  5998. if ( isBox && elem.nodeType === 1 ) {
  5999. // Support: IE <=9 - 11, Edge 12 - 15
  6000. // Record all 3 overflow attributes because IE does not infer the shorthand
  6001. // from identically-valued overflowX and overflowY and Edge just mirrors
  6002. // the overflowX value there.
  6003. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  6004. // Identify a display type, preferring old show/hide data over the CSS cascade
  6005. restoreDisplay = dataShow && dataShow.display;
  6006. if ( restoreDisplay == null ) {
  6007. restoreDisplay = dataPriv.get( elem, "display" );
  6008. }
  6009. display = jQuery.css( elem, "display" );
  6010. if ( display === "none" ) {
  6011. if ( restoreDisplay ) {
  6012. display = restoreDisplay;
  6013. } else {
  6014. // Get nonempty value(s) by temporarily forcing visibility
  6015. showHide( [ elem ], true );
  6016. restoreDisplay = elem.style.display || restoreDisplay;
  6017. display = jQuery.css( elem, "display" );
  6018. showHide( [ elem ] );
  6019. }
  6020. }
  6021. // Animate inline elements as inline-block
  6022. if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
  6023. if ( jQuery.css( elem, "float" ) === "none" ) {
  6024. // Restore the original display value at the end of pure show/hide animations
  6025. if ( !propTween ) {
  6026. anim.done( function() {
  6027. style.display = restoreDisplay;
  6028. } );
  6029. if ( restoreDisplay == null ) {
  6030. display = style.display;
  6031. restoreDisplay = display === "none" ? "" : display;
  6032. }
  6033. }
  6034. style.display = "inline-block";
  6035. }
  6036. }
  6037. }
  6038. if ( opts.overflow ) {
  6039. style.overflow = "hidden";
  6040. anim.always( function() {
  6041. style.overflow = opts.overflow[ 0 ];
  6042. style.overflowX = opts.overflow[ 1 ];
  6043. style.overflowY = opts.overflow[ 2 ];
  6044. } );
  6045. }
  6046. // Implement show/hide animations
  6047. propTween = false;
  6048. for ( prop in orig ) {
  6049. // General show/hide setup for this element animation
  6050. if ( !propTween ) {
  6051. if ( dataShow ) {
  6052. if ( "hidden" in dataShow ) {
  6053. hidden = dataShow.hidden;
  6054. }
  6055. } else {
  6056. dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
  6057. }
  6058. // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
  6059. if ( toggle ) {
  6060. dataShow.hidden = !hidden;
  6061. }
  6062. // Show elements before animating them
  6063. if ( hidden ) {
  6064. showHide( [ elem ], true );
  6065. }
  6066. /* eslint-disable no-loop-func */
  6067. anim.done( function() {
  6068. /* eslint-enable no-loop-func */
  6069. // The final step of a "hide" animation is actually hiding the element
  6070. if ( !hidden ) {
  6071. showHide( [ elem ] );
  6072. }
  6073. dataPriv.remove( elem, "fxshow" );
  6074. for ( prop in orig ) {
  6075. jQuery.style( elem, prop, orig[ prop ] );
  6076. }
  6077. } );
  6078. }
  6079. // Per-property setup
  6080. propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  6081. if ( !( prop in dataShow ) ) {
  6082. dataShow[ prop ] = propTween.start;
  6083. if ( hidden ) {
  6084. propTween.end = propTween.start;
  6085. propTween.start = 0;
  6086. }
  6087. }
  6088. }
  6089. }
  6090. function propFilter( props, specialEasing ) {
  6091. var index, name, easing, value, hooks;
  6092. // camelCase, specialEasing and expand cssHook pass
  6093. for ( index in props ) {
  6094. name = camelCase( index );
  6095. easing = specialEasing[ name ];
  6096. value = props[ index ];
  6097. if ( Array.isArray( value ) ) {
  6098. easing = value[ 1 ];
  6099. value = props[ index ] = value[ 0 ];
  6100. }
  6101. if ( index !== name ) {
  6102. props[ name ] = value;
  6103. delete props[ index ];
  6104. }
  6105. hooks = jQuery.cssHooks[ name ];
  6106. if ( hooks && "expand" in hooks ) {
  6107. value = hooks.expand( value );
  6108. delete props[ name ];
  6109. // Not quite $.extend, this won't overwrite existing keys.
  6110. // Reusing 'index' because we have the correct "name"
  6111. for ( index in value ) {
  6112. if ( !( index in props ) ) {
  6113. props[ index ] = value[ index ];
  6114. specialEasing[ index ] = easing;
  6115. }
  6116. }
  6117. } else {
  6118. specialEasing[ name ] = easing;
  6119. }
  6120. }
  6121. }
  6122. function Animation( elem, properties, options ) {
  6123. var result,
  6124. stopped,
  6125. index = 0,
  6126. length = Animation.prefilters.length,
  6127. deferred = jQuery.Deferred().always( function() {
  6128. // Don't match elem in the :animated selector
  6129. delete tick.elem;
  6130. } ),
  6131. tick = function() {
  6132. if ( stopped ) {
  6133. return false;
  6134. }
  6135. var currentTime = fxNow || createFxNow(),
  6136. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  6137. // Support: Android 2.3 only
  6138. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  6139. temp = remaining / animation.duration || 0,
  6140. percent = 1 - temp,
  6141. index = 0,
  6142. length = animation.tweens.length;
  6143. for ( ; index < length; index++ ) {
  6144. animation.tweens[ index ].run( percent );
  6145. }
  6146. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  6147. // If there's more to do, yield
  6148. if ( percent < 1 && length ) {
  6149. return remaining;
  6150. }
  6151. // If this was an empty animation, synthesize a final progress notification
  6152. if ( !length ) {
  6153. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  6154. }
  6155. // Resolve the animation and report its conclusion
  6156. deferred.resolveWith( elem, [ animation ] );
  6157. return false;
  6158. },
  6159. animation = deferred.promise( {
  6160. elem: elem,
  6161. props: jQuery.extend( {}, properties ),
  6162. opts: jQuery.extend( true, {
  6163. specialEasing: {},
  6164. easing: jQuery.easing._default
  6165. }, options ),
  6166. originalProperties: properties,
  6167. originalOptions: options,
  6168. startTime: fxNow || createFxNow(),
  6169. duration: options.duration,
  6170. tweens: [],
  6171. createTween: function( prop, end ) {
  6172. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  6173. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  6174. animation.tweens.push( tween );
  6175. return tween;
  6176. },
  6177. stop: function( gotoEnd ) {
  6178. var index = 0,
  6179. // If we are going to the end, we want to run all the tweens
  6180. // otherwise we skip this part
  6181. length = gotoEnd ? animation.tweens.length : 0;
  6182. if ( stopped ) {
  6183. return this;
  6184. }
  6185. stopped = true;
  6186. for ( ; index < length; index++ ) {
  6187. animation.tweens[ index ].run( 1 );
  6188. }
  6189. // Resolve when we played the last frame; otherwise, reject
  6190. if ( gotoEnd ) {
  6191. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  6192. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  6193. } else {
  6194. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  6195. }
  6196. return this;
  6197. }
  6198. } ),
  6199. props = animation.props;
  6200. propFilter( props, animation.opts.specialEasing );
  6201. for ( ; index < length; index++ ) {
  6202. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  6203. if ( result ) {
  6204. if ( isFunction( result.stop ) ) {
  6205. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  6206. result.stop.bind( result );
  6207. }
  6208. return result;
  6209. }
  6210. }
  6211. jQuery.map( props, createTween, animation );
  6212. if ( isFunction( animation.opts.start ) ) {
  6213. animation.opts.start.call( elem, animation );
  6214. }
  6215. // Attach callbacks from options
  6216. animation
  6217. .progress( animation.opts.progress )
  6218. .done( animation.opts.done, animation.opts.complete )
  6219. .fail( animation.opts.fail )
  6220. .always( animation.opts.always );
  6221. jQuery.fx.timer(
  6222. jQuery.extend( tick, {
  6223. elem: elem,
  6224. anim: animation,
  6225. queue: animation.opts.queue
  6226. } )
  6227. );
  6228. return animation;
  6229. }
  6230. jQuery.Animation = jQuery.extend( Animation, {
  6231. tweeners: {
  6232. "*": [ function( prop, value ) {
  6233. var tween = this.createTween( prop, value );
  6234. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  6235. return tween;
  6236. } ]
  6237. },
  6238. tweener: function( props, callback ) {
  6239. if ( isFunction( props ) ) {
  6240. callback = props;
  6241. props = [ "*" ];
  6242. } else {
  6243. props = props.match( rnothtmlwhite );
  6244. }
  6245. var prop,
  6246. index = 0,
  6247. length = props.length;
  6248. for ( ; index < length; index++ ) {
  6249. prop = props[ index ];
  6250. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  6251. Animation.tweeners[ prop ].unshift( callback );
  6252. }
  6253. },
  6254. prefilters: [ defaultPrefilter ],
  6255. prefilter: function( callback, prepend ) {
  6256. if ( prepend ) {
  6257. Animation.prefilters.unshift( callback );
  6258. } else {
  6259. Animation.prefilters.push( callback );
  6260. }
  6261. }
  6262. } );
  6263. jQuery.speed = function( speed, easing, fn ) {
  6264. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  6265. complete: fn || !fn && easing ||
  6266. isFunction( speed ) && speed,
  6267. duration: speed,
  6268. easing: fn && easing || easing && !isFunction( easing ) && easing
  6269. };
  6270. // Go to the end state if fx are off
  6271. if ( jQuery.fx.off ) {
  6272. opt.duration = 0;
  6273. } else {
  6274. if ( typeof opt.duration !== "number" ) {
  6275. if ( opt.duration in jQuery.fx.speeds ) {
  6276. opt.duration = jQuery.fx.speeds[ opt.duration ];
  6277. } else {
  6278. opt.duration = jQuery.fx.speeds._default;
  6279. }
  6280. }
  6281. }
  6282. // Normalize opt.queue - true/undefined/null -> "fx"
  6283. if ( opt.queue == null || opt.queue === true ) {
  6284. opt.queue = "fx";
  6285. }
  6286. // Queueing
  6287. opt.old = opt.complete;
  6288. opt.complete = function() {
  6289. if ( isFunction( opt.old ) ) {
  6290. opt.old.call( this );
  6291. }
  6292. if ( opt.queue ) {
  6293. jQuery.dequeue( this, opt.queue );
  6294. }
  6295. };
  6296. return opt;
  6297. };
  6298. jQuery.fn.extend( {
  6299. fadeTo: function( speed, to, easing, callback ) {
  6300. // Show any hidden elements after setting opacity to 0
  6301. return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
  6302. // Animate to the value specified
  6303. .end().animate( { opacity: to }, speed, easing, callback );
  6304. },
  6305. animate: function( prop, speed, easing, callback ) {
  6306. var empty = jQuery.isEmptyObject( prop ),
  6307. optall = jQuery.speed( speed, easing, callback ),
  6308. doAnimation = function() {
  6309. // Operate on a copy of prop so per-property easing won't be lost
  6310. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  6311. // Empty animations, or finishing resolves immediately
  6312. if ( empty || dataPriv.get( this, "finish" ) ) {
  6313. anim.stop( true );
  6314. }
  6315. };
  6316. doAnimation.finish = doAnimation;
  6317. return empty || optall.queue === false ?
  6318. this.each( doAnimation ) :
  6319. this.queue( optall.queue, doAnimation );
  6320. },
  6321. stop: function( type, clearQueue, gotoEnd ) {
  6322. var stopQueue = function( hooks ) {
  6323. var stop = hooks.stop;
  6324. delete hooks.stop;
  6325. stop( gotoEnd );
  6326. };
  6327. if ( typeof type !== "string" ) {
  6328. gotoEnd = clearQueue;
  6329. clearQueue = type;
  6330. type = undefined;
  6331. }
  6332. if ( clearQueue ) {
  6333. this.queue( type || "fx", [] );
  6334. }
  6335. return this.each( function() {
  6336. var dequeue = true,
  6337. index = type != null && type + "queueHooks",
  6338. timers = jQuery.timers,
  6339. data = dataPriv.get( this );
  6340. if ( index ) {
  6341. if ( data[ index ] && data[ index ].stop ) {
  6342. stopQueue( data[ index ] );
  6343. }
  6344. } else {
  6345. for ( index in data ) {
  6346. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  6347. stopQueue( data[ index ] );
  6348. }
  6349. }
  6350. }
  6351. for ( index = timers.length; index--; ) {
  6352. if ( timers[ index ].elem === this &&
  6353. ( type == null || timers[ index ].queue === type ) ) {
  6354. timers[ index ].anim.stop( gotoEnd );
  6355. dequeue = false;
  6356. timers.splice( index, 1 );
  6357. }
  6358. }
  6359. // Start the next in the queue if the last step wasn't forced.
  6360. // Timers currently will call their complete callbacks, which
  6361. // will dequeue but only if they were gotoEnd.
  6362. if ( dequeue || !gotoEnd ) {
  6363. jQuery.dequeue( this, type );
  6364. }
  6365. } );
  6366. },
  6367. finish: function( type ) {
  6368. if ( type !== false ) {
  6369. type = type || "fx";
  6370. }
  6371. return this.each( function() {
  6372. var index,
  6373. data = dataPriv.get( this ),
  6374. queue = data[ type + "queue" ],
  6375. hooks = data[ type + "queueHooks" ],
  6376. timers = jQuery.timers,
  6377. length = queue ? queue.length : 0;
  6378. // Enable finishing flag on private data
  6379. data.finish = true;
  6380. // Empty the queue first
  6381. jQuery.queue( this, type, [] );
  6382. if ( hooks && hooks.stop ) {
  6383. hooks.stop.call( this, true );
  6384. }
  6385. // Look for any active animations, and finish them
  6386. for ( index = timers.length; index--; ) {
  6387. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  6388. timers[ index ].anim.stop( true );
  6389. timers.splice( index, 1 );
  6390. }
  6391. }
  6392. // Look for any animations in the old queue and finish them
  6393. for ( index = 0; index < length; index++ ) {
  6394. if ( queue[ index ] && queue[ index ].finish ) {
  6395. queue[ index ].finish.call( this );
  6396. }
  6397. }
  6398. // Turn off finishing flag
  6399. delete data.finish;
  6400. } );
  6401. }
  6402. } );
  6403. jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {
  6404. var cssFn = jQuery.fn[ name ];
  6405. jQuery.fn[ name ] = function( speed, easing, callback ) {
  6406. return speed == null || typeof speed === "boolean" ?
  6407. cssFn.apply( this, arguments ) :
  6408. this.animate( genFx( name, true ), speed, easing, callback );
  6409. };
  6410. } );
  6411. // Generate shortcuts for custom animations
  6412. jQuery.each( {
  6413. slideDown: genFx( "show" ),
  6414. slideUp: genFx( "hide" ),
  6415. slideToggle: genFx( "toggle" ),
  6416. fadeIn: { opacity: "show" },
  6417. fadeOut: { opacity: "hide" },
  6418. fadeToggle: { opacity: "toggle" }
  6419. }, function( name, props ) {
  6420. jQuery.fn[ name ] = function( speed, easing, callback ) {
  6421. return this.animate( props, speed, easing, callback );
  6422. };
  6423. } );
  6424. jQuery.timers = [];
  6425. jQuery.fx.tick = function() {
  6426. var timer,
  6427. i = 0,
  6428. timers = jQuery.timers;
  6429. fxNow = Date.now();
  6430. for ( ; i < timers.length; i++ ) {
  6431. timer = timers[ i ];
  6432. // Run the timer and safely remove it when done (allowing for external removal)
  6433. if ( !timer() && timers[ i ] === timer ) {
  6434. timers.splice( i--, 1 );
  6435. }
  6436. }
  6437. if ( !timers.length ) {
  6438. jQuery.fx.stop();
  6439. }
  6440. fxNow = undefined;
  6441. };
  6442. jQuery.fx.timer = function( timer ) {
  6443. jQuery.timers.push( timer );
  6444. jQuery.fx.start();
  6445. };
  6446. jQuery.fx.interval = 13;
  6447. jQuery.fx.start = function() {
  6448. if ( inProgress ) {
  6449. return;
  6450. }
  6451. inProgress = true;
  6452. schedule();
  6453. };
  6454. jQuery.fx.stop = function() {
  6455. inProgress = null;
  6456. };
  6457. jQuery.fx.speeds = {
  6458. slow: 600,
  6459. fast: 200,
  6460. // Default speed
  6461. _default: 400
  6462. };
  6463. // Based off of the plugin by Clint Helfers, with permission.
  6464. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
  6465. jQuery.fn.delay = function( time, type ) {
  6466. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  6467. type = type || "fx";
  6468. return this.queue( type, function( next, hooks ) {
  6469. var timeout = window.setTimeout( next, time );
  6470. hooks.stop = function() {
  6471. window.clearTimeout( timeout );
  6472. };
  6473. } );
  6474. };
  6475. ( function() {
  6476. var input = document.createElement( "input" ),
  6477. select = document.createElement( "select" ),
  6478. opt = select.appendChild( document.createElement( "option" ) );
  6479. input.type = "checkbox";
  6480. // Support: Android <=4.3 only
  6481. // Default value for a checkbox should be "on"
  6482. support.checkOn = input.value !== "";
  6483. // Support: IE <=11 only
  6484. // Must access selectedIndex to make default options select
  6485. support.optSelected = opt.selected;
  6486. // Support: IE <=11 only
  6487. // An input loses its value after becoming a radio
  6488. input = document.createElement( "input" );
  6489. input.value = "t";
  6490. input.type = "radio";
  6491. support.radioValue = input.value === "t";
  6492. } )();
  6493. var boolHook,
  6494. attrHandle = jQuery.expr.attrHandle;
  6495. jQuery.fn.extend( {
  6496. attr: function( name, value ) {
  6497. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  6498. },
  6499. removeAttr: function( name ) {
  6500. return this.each( function() {
  6501. jQuery.removeAttr( this, name );
  6502. } );
  6503. }
  6504. } );
  6505. jQuery.extend( {
  6506. attr: function( elem, name, value ) {
  6507. var ret, hooks,
  6508. nType = elem.nodeType;
  6509. // Don't get/set attributes on text, comment and attribute nodes
  6510. if ( nType === 3 || nType === 8 || nType === 2 ) {
  6511. return;
  6512. }
  6513. // Fallback to prop when attributes are not supported
  6514. if ( typeof elem.getAttribute === "undefined" ) {
  6515. return jQuery.prop( elem, name, value );
  6516. }
  6517. // Attribute hooks are determined by the lowercase version
  6518. // Grab necessary hook if one is defined
  6519. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  6520. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  6521. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  6522. }
  6523. if ( value !== undefined ) {
  6524. if ( value === null ) {
  6525. jQuery.removeAttr( elem, name );
  6526. return;
  6527. }
  6528. if ( hooks && "set" in hooks &&
  6529. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  6530. return ret;
  6531. }
  6532. elem.setAttribute( name, value + "" );
  6533. return value;
  6534. }
  6535. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  6536. return ret;
  6537. }
  6538. ret = jQuery.find.attr( elem, name );
  6539. // Non-existent attributes return null, we normalize to undefined
  6540. return ret == null ? undefined : ret;
  6541. },
  6542. attrHooks: {
  6543. type: {
  6544. set: function( elem, value ) {
  6545. if ( !support.radioValue && value === "radio" &&
  6546. nodeName( elem, "input" ) ) {
  6547. var val = elem.value;
  6548. elem.setAttribute( "type", value );
  6549. if ( val ) {
  6550. elem.value = val;
  6551. }
  6552. return value;
  6553. }
  6554. }
  6555. }
  6556. },
  6557. removeAttr: function( elem, value ) {
  6558. var name,
  6559. i = 0,
  6560. // Attribute names can contain non-HTML whitespace characters
  6561. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  6562. attrNames = value && value.match( rnothtmlwhite );
  6563. if ( attrNames && elem.nodeType === 1 ) {
  6564. while ( ( name = attrNames[ i++ ] ) ) {
  6565. elem.removeAttribute( name );
  6566. }
  6567. }
  6568. }
  6569. } );
  6570. // Hooks for boolean attributes
  6571. boolHook = {
  6572. set: function( elem, value, name ) {
  6573. if ( value === false ) {
  6574. // Remove boolean attributes when set to false
  6575. jQuery.removeAttr( elem, name );
  6576. } else {
  6577. elem.setAttribute( name, name );
  6578. }
  6579. return name;
  6580. }
  6581. };
  6582. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
  6583. var getter = attrHandle[ name ] || jQuery.find.attr;
  6584. attrHandle[ name ] = function( elem, name, isXML ) {
  6585. var ret, handle,
  6586. lowercaseName = name.toLowerCase();
  6587. if ( !isXML ) {
  6588. // Avoid an infinite loop by temporarily removing this function from the getter
  6589. handle = attrHandle[ lowercaseName ];
  6590. attrHandle[ lowercaseName ] = ret;
  6591. ret = getter( elem, name, isXML ) != null ?
  6592. lowercaseName :
  6593. null;
  6594. attrHandle[ lowercaseName ] = handle;
  6595. }
  6596. return ret;
  6597. };
  6598. } );
  6599. var rfocusable = /^(?:input|select|textarea|button)$/i,
  6600. rclickable = /^(?:a|area)$/i;
  6601. jQuery.fn.extend( {
  6602. prop: function( name, value ) {
  6603. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  6604. },
  6605. removeProp: function( name ) {
  6606. return this.each( function() {
  6607. delete this[ jQuery.propFix[ name ] || name ];
  6608. } );
  6609. }
  6610. } );
  6611. jQuery.extend( {
  6612. prop: function( elem, name, value ) {
  6613. var ret, hooks,
  6614. nType = elem.nodeType;
  6615. // Don't get/set properties on text, comment and attribute nodes
  6616. if ( nType === 3 || nType === 8 || nType === 2 ) {
  6617. return;
  6618. }
  6619. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  6620. // Fix name and attach hooks
  6621. name = jQuery.propFix[ name ] || name;
  6622. hooks = jQuery.propHooks[ name ];
  6623. }
  6624. if ( value !== undefined ) {
  6625. if ( hooks && "set" in hooks &&
  6626. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  6627. return ret;
  6628. }
  6629. return ( elem[ name ] = value );
  6630. }
  6631. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  6632. return ret;
  6633. }
  6634. return elem[ name ];
  6635. },
  6636. propHooks: {
  6637. tabIndex: {
  6638. get: function( elem ) {
  6639. // Support: IE <=9 - 11 only
  6640. // elem.tabIndex doesn't always return the
  6641. // correct value when it hasn't been explicitly set
  6642. // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  6643. // Use proper attribute retrieval(#12072)
  6644. var tabindex = jQuery.find.attr( elem, "tabindex" );
  6645. if ( tabindex ) {
  6646. return parseInt( tabindex, 10 );
  6647. }
  6648. if (
  6649. rfocusable.test( elem.nodeName ) ||
  6650. rclickable.test( elem.nodeName ) &&
  6651. elem.href
  6652. ) {
  6653. return 0;
  6654. }
  6655. return -1;
  6656. }
  6657. }
  6658. },
  6659. propFix: {
  6660. "for": "htmlFor",
  6661. "class": "className"
  6662. }
  6663. } );
  6664. // Support: IE <=11 only
  6665. // Accessing the selectedIndex property
  6666. // forces the browser to respect setting selected
  6667. // on the option
  6668. // The getter ensures a default option is selected
  6669. // when in an optgroup
  6670. // eslint rule "no-unused-expressions" is disabled for this code
  6671. // since it considers such accessions noop
  6672. if ( !support.optSelected ) {
  6673. jQuery.propHooks.selected = {
  6674. get: function( elem ) {
  6675. /* eslint no-unused-expressions: "off" */
  6676. var parent = elem.parentNode;
  6677. if ( parent && parent.parentNode ) {
  6678. parent.parentNode.selectedIndex;
  6679. }
  6680. return null;
  6681. },
  6682. set: function( elem ) {
  6683. /* eslint no-unused-expressions: "off" */
  6684. var parent = elem.parentNode;
  6685. if ( parent ) {
  6686. parent.selectedIndex;
  6687. if ( parent.parentNode ) {
  6688. parent.parentNode.selectedIndex;
  6689. }
  6690. }
  6691. }
  6692. };
  6693. }
  6694. jQuery.each( [
  6695. "tabIndex",
  6696. "readOnly",
  6697. "maxLength",
  6698. "cellSpacing",
  6699. "cellPadding",
  6700. "rowSpan",
  6701. "colSpan",
  6702. "useMap",
  6703. "frameBorder",
  6704. "contentEditable"
  6705. ], function() {
  6706. jQuery.propFix[ this.toLowerCase() ] = this;
  6707. } );
  6708. // Strip and collapse whitespace according to HTML spec
  6709. // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
  6710. function stripAndCollapse( value ) {
  6711. var tokens = value.match( rnothtmlwhite ) || [];
  6712. return tokens.join( " " );
  6713. }
  6714. function getClass( elem ) {
  6715. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  6716. }
  6717. function classesToArray( value ) {
  6718. if ( Array.isArray( value ) ) {
  6719. return value;
  6720. }
  6721. if ( typeof value === "string" ) {
  6722. return value.match( rnothtmlwhite ) || [];
  6723. }
  6724. return [];
  6725. }
  6726. jQuery.fn.extend( {
  6727. addClass: function( value ) {
  6728. var classes, elem, cur, curValue, clazz, j, finalValue,
  6729. i = 0;
  6730. if ( isFunction( value ) ) {
  6731. return this.each( function( j ) {
  6732. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  6733. } );
  6734. }
  6735. classes = classesToArray( value );
  6736. if ( classes.length ) {
  6737. while ( ( elem = this[ i++ ] ) ) {
  6738. curValue = getClass( elem );
  6739. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  6740. if ( cur ) {
  6741. j = 0;
  6742. while ( ( clazz = classes[ j++ ] ) ) {
  6743. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  6744. cur += clazz + " ";
  6745. }
  6746. }
  6747. // Only assign if different to avoid unneeded rendering.
  6748. finalValue = stripAndCollapse( cur );
  6749. if ( curValue !== finalValue ) {
  6750. elem.setAttribute( "class", finalValue );
  6751. }
  6752. }
  6753. }
  6754. }
  6755. return this;
  6756. },
  6757. removeClass: function( value ) {
  6758. var classes, elem, cur, curValue, clazz, j, finalValue,
  6759. i = 0;
  6760. if ( isFunction( value ) ) {
  6761. return this.each( function( j ) {
  6762. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  6763. } );
  6764. }
  6765. if ( !arguments.length ) {
  6766. return this.attr( "class", "" );
  6767. }
  6768. classes = classesToArray( value );
  6769. if ( classes.length ) {
  6770. while ( ( elem = this[ i++ ] ) ) {
  6771. curValue = getClass( elem );
  6772. // This expression is here for better compressibility (see addClass)
  6773. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  6774. if ( cur ) {
  6775. j = 0;
  6776. while ( ( clazz = classes[ j++ ] ) ) {
  6777. // Remove *all* instances
  6778. while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
  6779. cur = cur.replace( " " + clazz + " ", " " );
  6780. }
  6781. }
  6782. // Only assign if different to avoid unneeded rendering.
  6783. finalValue = stripAndCollapse( cur );
  6784. if ( curValue !== finalValue ) {
  6785. elem.setAttribute( "class", finalValue );
  6786. }
  6787. }
  6788. }
  6789. }
  6790. return this;
  6791. },
  6792. toggleClass: function( value, stateVal ) {
  6793. var type = typeof value,
  6794. isValidValue = type === "string" || Array.isArray( value );
  6795. if ( typeof stateVal === "boolean" && isValidValue ) {
  6796. return stateVal ? this.addClass( value ) : this.removeClass( value );
  6797. }
  6798. if ( isFunction( value ) ) {
  6799. return this.each( function( i ) {
  6800. jQuery( this ).toggleClass(
  6801. value.call( this, i, getClass( this ), stateVal ),
  6802. stateVal
  6803. );
  6804. } );
  6805. }
  6806. return this.each( function() {
  6807. var className, i, self, classNames;
  6808. if ( isValidValue ) {
  6809. // Toggle individual class names
  6810. i = 0;
  6811. self = jQuery( this );
  6812. classNames = classesToArray( value );
  6813. while ( ( className = classNames[ i++ ] ) ) {
  6814. // Check each className given, space separated list
  6815. if ( self.hasClass( className ) ) {
  6816. self.removeClass( className );
  6817. } else {
  6818. self.addClass( className );
  6819. }
  6820. }
  6821. // Toggle whole class name
  6822. } else if ( value === undefined || type === "boolean" ) {
  6823. className = getClass( this );
  6824. if ( className ) {
  6825. // Store className if set
  6826. dataPriv.set( this, "__className__", className );
  6827. }
  6828. // If the element has a class name or if we're passed `false`,
  6829. // then remove the whole classname (if there was one, the above saved it).
  6830. // Otherwise bring back whatever was previously saved (if anything),
  6831. // falling back to the empty string if nothing was stored.
  6832. if ( this.setAttribute ) {
  6833. this.setAttribute( "class",
  6834. className || value === false ?
  6835. "" :
  6836. dataPriv.get( this, "__className__" ) || ""
  6837. );
  6838. }
  6839. }
  6840. } );
  6841. },
  6842. hasClass: function( selector ) {
  6843. var className, elem,
  6844. i = 0;
  6845. className = " " + selector + " ";
  6846. while ( ( elem = this[ i++ ] ) ) {
  6847. if ( elem.nodeType === 1 &&
  6848. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  6849. return true;
  6850. }
  6851. }
  6852. return false;
  6853. }
  6854. } );
  6855. var rreturn = /\r/g;
  6856. jQuery.fn.extend( {
  6857. val: function( value ) {
  6858. var hooks, ret, valueIsFunction,
  6859. elem = this[ 0 ];
  6860. if ( !arguments.length ) {
  6861. if ( elem ) {
  6862. hooks = jQuery.valHooks[ elem.type ] ||
  6863. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  6864. if ( hooks &&
  6865. "get" in hooks &&
  6866. ( ret = hooks.get( elem, "value" ) ) !== undefined
  6867. ) {
  6868. return ret;
  6869. }
  6870. ret = elem.value;
  6871. // Handle most common string cases
  6872. if ( typeof ret === "string" ) {
  6873. return ret.replace( rreturn, "" );
  6874. }
  6875. // Handle cases where value is null/undef or number
  6876. return ret == null ? "" : ret;
  6877. }
  6878. return;
  6879. }
  6880. valueIsFunction = isFunction( value );
  6881. return this.each( function( i ) {
  6882. var val;
  6883. if ( this.nodeType !== 1 ) {
  6884. return;
  6885. }
  6886. if ( valueIsFunction ) {
  6887. val = value.call( this, i, jQuery( this ).val() );
  6888. } else {
  6889. val = value;
  6890. }
  6891. // Treat null/undefined as ""; convert numbers to string
  6892. if ( val == null ) {
  6893. val = "";
  6894. } else if ( typeof val === "number" ) {
  6895. val += "";
  6896. } else if ( Array.isArray( val ) ) {
  6897. val = jQuery.map( val, function( value ) {
  6898. return value == null ? "" : value + "";
  6899. } );
  6900. }
  6901. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  6902. // If set returns undefined, fall back to normal setting
  6903. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  6904. this.value = val;
  6905. }
  6906. } );
  6907. }
  6908. } );
  6909. jQuery.extend( {
  6910. valHooks: {
  6911. option: {
  6912. get: function( elem ) {
  6913. var val = jQuery.find.attr( elem, "value" );
  6914. return val != null ?
  6915. val :
  6916. // Support: IE <=10 - 11 only
  6917. // option.text throws exceptions (#14686, #14858)
  6918. // Strip and collapse whitespace
  6919. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  6920. stripAndCollapse( jQuery.text( elem ) );
  6921. }
  6922. },
  6923. select: {
  6924. get: function( elem ) {
  6925. var value, option, i,
  6926. options = elem.options,
  6927. index = elem.selectedIndex,
  6928. one = elem.type === "select-one",
  6929. values = one ? null : [],
  6930. max = one ? index + 1 : options.length;
  6931. if ( index < 0 ) {
  6932. i = max;
  6933. } else {
  6934. i = one ? index : 0;
  6935. }
  6936. // Loop through all the selected options
  6937. for ( ; i < max; i++ ) {
  6938. option = options[ i ];
  6939. // Support: IE <=9 only
  6940. // IE8-9 doesn't update selected after form reset (#2551)
  6941. if ( ( option.selected || i === index ) &&
  6942. // Don't return options that are disabled or in a disabled optgroup
  6943. !option.disabled &&
  6944. ( !option.parentNode.disabled ||
  6945. !nodeName( option.parentNode, "optgroup" ) ) ) {
  6946. // Get the specific value for the option
  6947. value = jQuery( option ).val();
  6948. // We don't need an array for one selects
  6949. if ( one ) {
  6950. return value;
  6951. }
  6952. // Multi-Selects return an array
  6953. values.push( value );
  6954. }
  6955. }
  6956. return values;
  6957. },
  6958. set: function( elem, value ) {
  6959. var optionSet, option,
  6960. options = elem.options,
  6961. values = jQuery.makeArray( value ),
  6962. i = options.length;
  6963. while ( i-- ) {
  6964. option = options[ i ];
  6965. /* eslint-disable no-cond-assign */
  6966. if ( option.selected =
  6967. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  6968. ) {
  6969. optionSet = true;
  6970. }
  6971. /* eslint-enable no-cond-assign */
  6972. }
  6973. // Force browsers to behave consistently when non-matching value is set
  6974. if ( !optionSet ) {
  6975. elem.selectedIndex = -1;
  6976. }
  6977. return values;
  6978. }
  6979. }
  6980. }
  6981. } );
  6982. // Radios and checkboxes getter/setter
  6983. jQuery.each( [ "radio", "checkbox" ], function() {
  6984. jQuery.valHooks[ this ] = {
  6985. set: function( elem, value ) {
  6986. if ( Array.isArray( value ) ) {
  6987. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  6988. }
  6989. }
  6990. };
  6991. if ( !support.checkOn ) {
  6992. jQuery.valHooks[ this ].get = function( elem ) {
  6993. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  6994. };
  6995. }
  6996. } );
  6997. // Return jQuery for attributes-only inclusion
  6998. support.focusin = "onfocusin" in window;
  6999. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  7000. stopPropagationCallback = function( e ) {
  7001. e.stopPropagation();
  7002. };
  7003. jQuery.extend( jQuery.event, {
  7004. trigger: function( event, data, elem, onlyHandlers ) {
  7005. var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
  7006. eventPath = [ elem || document ],
  7007. type = hasOwn.call( event, "type" ) ? event.type : event,
  7008. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  7009. cur = lastElement = tmp = elem = elem || document;
  7010. // Don't do events on text and comment nodes
  7011. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  7012. return;
  7013. }
  7014. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  7015. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  7016. return;
  7017. }
  7018. if ( type.indexOf( "." ) > -1 ) {
  7019. // Namespaced trigger; create a regexp to match event type in handle()
  7020. namespaces = type.split( "." );
  7021. type = namespaces.shift();
  7022. namespaces.sort();
  7023. }
  7024. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  7025. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  7026. event = event[ jQuery.expando ] ?
  7027. event :
  7028. new jQuery.Event( type, typeof event === "object" && event );
  7029. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  7030. event.isTrigger = onlyHandlers ? 2 : 3;
  7031. event.namespace = namespaces.join( "." );
  7032. event.rnamespace = event.namespace ?
  7033. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  7034. null;
  7035. // Clean up the event in case it is being reused
  7036. event.result = undefined;
  7037. if ( !event.target ) {
  7038. event.target = elem;
  7039. }
  7040. // Clone any incoming data and prepend the event, creating the handler arg list
  7041. data = data == null ?
  7042. [ event ] :
  7043. jQuery.makeArray( data, [ event ] );
  7044. // Allow special events to draw outside the lines
  7045. special = jQuery.event.special[ type ] || {};
  7046. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  7047. return;
  7048. }
  7049. // Determine event propagation path in advance, per W3C events spec (#9951)
  7050. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  7051. if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
  7052. bubbleType = special.delegateType || type;
  7053. if ( !rfocusMorph.test( bubbleType + type ) ) {
  7054. cur = cur.parentNode;
  7055. }
  7056. for ( ; cur; cur = cur.parentNode ) {
  7057. eventPath.push( cur );
  7058. tmp = cur;
  7059. }
  7060. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  7061. if ( tmp === ( elem.ownerDocument || document ) ) {
  7062. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  7063. }
  7064. }
  7065. // Fire handlers on the event path
  7066. i = 0;
  7067. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  7068. lastElement = cur;
  7069. event.type = i > 1 ?
  7070. bubbleType :
  7071. special.bindType || type;
  7072. // jQuery handler
  7073. handle = (
  7074. dataPriv.get( cur, "events" ) || Object.create( null )
  7075. )[ event.type ] &&
  7076. dataPriv.get( cur, "handle" );
  7077. if ( handle ) {
  7078. handle.apply( cur, data );
  7079. }
  7080. // Native handler
  7081. handle = ontype && cur[ ontype ];
  7082. if ( handle && handle.apply && acceptData( cur ) ) {
  7083. event.result = handle.apply( cur, data );
  7084. if ( event.result === false ) {
  7085. event.preventDefault();
  7086. }
  7087. }
  7088. }
  7089. event.type = type;
  7090. // If nobody prevented the default action, do it now
  7091. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  7092. if ( ( !special._default ||
  7093. special._default.apply( eventPath.pop(), data ) === false ) &&
  7094. acceptData( elem ) ) {
  7095. // Call a native DOM method on the target with the same name as the event.
  7096. // Don't do default actions on window, that's where global variables be (#6170)
  7097. if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
  7098. // Don't re-trigger an onFOO event when we call its FOO() method
  7099. tmp = elem[ ontype ];
  7100. if ( tmp ) {
  7101. elem[ ontype ] = null;
  7102. }
  7103. // Prevent re-triggering of the same event, since we already bubbled it above
  7104. jQuery.event.triggered = type;
  7105. if ( event.isPropagationStopped() ) {
  7106. lastElement.addEventListener( type, stopPropagationCallback );
  7107. }
  7108. elem[ type ]();
  7109. if ( event.isPropagationStopped() ) {
  7110. lastElement.removeEventListener( type, stopPropagationCallback );
  7111. }
  7112. jQuery.event.triggered = undefined;
  7113. if ( tmp ) {
  7114. elem[ ontype ] = tmp;
  7115. }
  7116. }
  7117. }
  7118. }
  7119. return event.result;
  7120. },
  7121. // Piggyback on a donor event to simulate a different one
  7122. // Used only for `focus(in | out)` events
  7123. simulate: function( type, elem, event ) {
  7124. var e = jQuery.extend(
  7125. new jQuery.Event(),
  7126. event,
  7127. {
  7128. type: type,
  7129. isSimulated: true
  7130. }
  7131. );
  7132. jQuery.event.trigger( e, null, elem );
  7133. }
  7134. } );
  7135. jQuery.fn.extend( {
  7136. trigger: function( type, data ) {
  7137. return this.each( function() {
  7138. jQuery.event.trigger( type, data, this );
  7139. } );
  7140. },
  7141. triggerHandler: function( type, data ) {
  7142. var elem = this[ 0 ];
  7143. if ( elem ) {
  7144. return jQuery.event.trigger( type, data, elem, true );
  7145. }
  7146. }
  7147. } );
  7148. // Support: Firefox <=44
  7149. // Firefox doesn't have focus(in | out) events
  7150. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  7151. //
  7152. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  7153. // focus(in | out) events fire after focus & blur events,
  7154. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  7155. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  7156. if ( !support.focusin ) {
  7157. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  7158. // Attach a single capturing handler on the document while someone wants focusin/focusout
  7159. var handler = function( event ) {
  7160. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  7161. };
  7162. jQuery.event.special[ fix ] = {
  7163. setup: function() {
  7164. // Handle: regular nodes (via `this.ownerDocument`), window
  7165. // (via `this.document`) & document (via `this`).
  7166. var doc = this.ownerDocument || this.document || this,
  7167. attaches = dataPriv.access( doc, fix );
  7168. if ( !attaches ) {
  7169. doc.addEventListener( orig, handler, true );
  7170. }
  7171. dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
  7172. },
  7173. teardown: function() {
  7174. var doc = this.ownerDocument || this.document || this,
  7175. attaches = dataPriv.access( doc, fix ) - 1;
  7176. if ( !attaches ) {
  7177. doc.removeEventListener( orig, handler, true );
  7178. dataPriv.remove( doc, fix );
  7179. } else {
  7180. dataPriv.access( doc, fix, attaches );
  7181. }
  7182. }
  7183. };
  7184. } );
  7185. }
  7186. var location = window.location;
  7187. var nonce = { guid: Date.now() };
  7188. var rquery = ( /\?/ );
  7189. // Cross-browser xml parsing
  7190. jQuery.parseXML = function( data ) {
  7191. var xml;
  7192. if ( !data || typeof data !== "string" ) {
  7193. return null;
  7194. }
  7195. // Support: IE 9 - 11 only
  7196. // IE throws on parseFromString with invalid input.
  7197. try {
  7198. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  7199. } catch ( e ) {
  7200. xml = undefined;
  7201. }
  7202. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  7203. jQuery.error( "Invalid XML: " + data );
  7204. }
  7205. return xml;
  7206. };
  7207. var
  7208. rbracket = /\[\]$/,
  7209. rCRLF = /\r?\n/g,
  7210. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  7211. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  7212. function buildParams( prefix, obj, traditional, add ) {
  7213. var name;
  7214. if ( Array.isArray( obj ) ) {
  7215. // Serialize array item.
  7216. jQuery.each( obj, function( i, v ) {
  7217. if ( traditional || rbracket.test( prefix ) ) {
  7218. // Treat each array item as a scalar.
  7219. add( prefix, v );
  7220. } else {
  7221. // Item is non-scalar (array or object), encode its numeric index.
  7222. buildParams(
  7223. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  7224. v,
  7225. traditional,
  7226. add
  7227. );
  7228. }
  7229. } );
  7230. } else if ( !traditional && toType( obj ) === "object" ) {
  7231. // Serialize object item.
  7232. for ( name in obj ) {
  7233. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  7234. }
  7235. } else {
  7236. // Serialize scalar item.
  7237. add( prefix, obj );
  7238. }
  7239. }
  7240. // Serialize an array of form elements or a set of
  7241. // key/values into a query string
  7242. jQuery.param = function( a, traditional ) {
  7243. var prefix,
  7244. s = [],
  7245. add = function( key, valueOrFunction ) {
  7246. // If value is a function, invoke it and use its return value
  7247. var value = isFunction( valueOrFunction ) ?
  7248. valueOrFunction() :
  7249. valueOrFunction;
  7250. s[ s.length ] = encodeURIComponent( key ) + "=" +
  7251. encodeURIComponent( value == null ? "" : value );
  7252. };
  7253. if ( a == null ) {
  7254. return "";
  7255. }
  7256. // If an array was passed in, assume that it is an array of form elements.
  7257. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  7258. // Serialize the form elements
  7259. jQuery.each( a, function() {
  7260. add( this.name, this.value );
  7261. } );
  7262. } else {
  7263. // If traditional, encode the "old" way (the way 1.3.2 or older
  7264. // did it), otherwise encode params recursively.
  7265. for ( prefix in a ) {
  7266. buildParams( prefix, a[ prefix ], traditional, add );
  7267. }
  7268. }
  7269. // Return the resulting serialization
  7270. return s.join( "&" );
  7271. };
  7272. jQuery.fn.extend( {
  7273. serialize: function() {
  7274. return jQuery.param( this.serializeArray() );
  7275. },
  7276. serializeArray: function() {
  7277. return this.map( function() {
  7278. // Can add propHook for "elements" to filter or add form elements
  7279. var elements = jQuery.prop( this, "elements" );
  7280. return elements ? jQuery.makeArray( elements ) : this;
  7281. } )
  7282. .filter( function() {
  7283. var type = this.type;
  7284. // Use .is( ":disabled" ) so that fieldset[disabled] works
  7285. return this.name && !jQuery( this ).is( ":disabled" ) &&
  7286. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  7287. ( this.checked || !rcheckableType.test( type ) );
  7288. } )
  7289. .map( function( _i, elem ) {
  7290. var val = jQuery( this ).val();
  7291. if ( val == null ) {
  7292. return null;
  7293. }
  7294. if ( Array.isArray( val ) ) {
  7295. return jQuery.map( val, function( val ) {
  7296. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7297. } );
  7298. }
  7299. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7300. } ).get();
  7301. }
  7302. } );
  7303. var
  7304. r20 = /%20/g,
  7305. rhash = /#.*$/,
  7306. rantiCache = /([?&])_=[^&]*/,
  7307. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  7308. // #7653, #8125, #8152: local protocol detection
  7309. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  7310. rnoContent = /^(?:GET|HEAD)$/,
  7311. rprotocol = /^\/\//,
  7312. /* Prefilters
  7313. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  7314. * 2) These are called:
  7315. * - BEFORE asking for a transport
  7316. * - AFTER param serialization (s.data is a string if s.processData is true)
  7317. * 3) key is the dataType
  7318. * 4) the catchall symbol "*" can be used
  7319. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  7320. */
  7321. prefilters = {},
  7322. /* Transports bindings
  7323. * 1) key is the dataType
  7324. * 2) the catchall symbol "*" can be used
  7325. * 3) selection will start with transport dataType and THEN go to "*" if needed
  7326. */
  7327. transports = {},
  7328. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  7329. allTypes = "*/".concat( "*" ),
  7330. // Anchor tag for parsing the document origin
  7331. originAnchor = document.createElement( "a" );
  7332. originAnchor.href = location.href;
  7333. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  7334. function addToPrefiltersOrTransports( structure ) {
  7335. // dataTypeExpression is optional and defaults to "*"
  7336. return function( dataTypeExpression, func ) {
  7337. if ( typeof dataTypeExpression !== "string" ) {
  7338. func = dataTypeExpression;
  7339. dataTypeExpression = "*";
  7340. }
  7341. var dataType,
  7342. i = 0,
  7343. dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
  7344. if ( isFunction( func ) ) {
  7345. // For each dataType in the dataTypeExpression
  7346. while ( ( dataType = dataTypes[ i++ ] ) ) {
  7347. // Prepend if requested
  7348. if ( dataType[ 0 ] === "+" ) {
  7349. dataType = dataType.slice( 1 ) || "*";
  7350. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  7351. // Otherwise append
  7352. } else {
  7353. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  7354. }
  7355. }
  7356. }
  7357. };
  7358. }
  7359. // Base inspection function for prefilters and transports
  7360. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  7361. var inspected = {},
  7362. seekingTransport = ( structure === transports );
  7363. function inspect( dataType ) {
  7364. var selected;
  7365. inspected[ dataType ] = true;
  7366. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  7367. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  7368. if ( typeof dataTypeOrTransport === "string" &&
  7369. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  7370. options.dataTypes.unshift( dataTypeOrTransport );
  7371. inspect( dataTypeOrTransport );
  7372. return false;
  7373. } else if ( seekingTransport ) {
  7374. return !( selected = dataTypeOrTransport );
  7375. }
  7376. } );
  7377. return selected;
  7378. }
  7379. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  7380. }
  7381. // A special extend for ajax options
  7382. // that takes "flat" options (not to be deep extended)
  7383. // Fixes #9887
  7384. function ajaxExtend( target, src ) {
  7385. var key, deep,
  7386. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  7387. for ( key in src ) {
  7388. if ( src[ key ] !== undefined ) {
  7389. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  7390. }
  7391. }
  7392. if ( deep ) {
  7393. jQuery.extend( true, target, deep );
  7394. }
  7395. return target;
  7396. }
  7397. /* Handles responses to an ajax request:
  7398. * - finds the right dataType (mediates between content-type and expected dataType)
  7399. * - returns the corresponding response
  7400. */
  7401. function ajaxHandleResponses( s, jqXHR, responses ) {
  7402. var ct, type, finalDataType, firstDataType,
  7403. contents = s.contents,
  7404. dataTypes = s.dataTypes;
  7405. // Remove auto dataType and get content-type in the process
  7406. while ( dataTypes[ 0 ] === "*" ) {
  7407. dataTypes.shift();
  7408. if ( ct === undefined ) {
  7409. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  7410. }
  7411. }
  7412. // Check if we're dealing with a known content-type
  7413. if ( ct ) {
  7414. for ( type in contents ) {
  7415. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  7416. dataTypes.unshift( type );
  7417. break;
  7418. }
  7419. }
  7420. }
  7421. // Check to see if we have a response for the expected dataType
  7422. if ( dataTypes[ 0 ] in responses ) {
  7423. finalDataType = dataTypes[ 0 ];
  7424. } else {
  7425. // Try convertible dataTypes
  7426. for ( type in responses ) {
  7427. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  7428. finalDataType = type;
  7429. break;
  7430. }
  7431. if ( !firstDataType ) {
  7432. firstDataType = type;
  7433. }
  7434. }
  7435. // Or just use first one
  7436. finalDataType = finalDataType || firstDataType;
  7437. }
  7438. // If we found a dataType
  7439. // We add the dataType to the list if needed
  7440. // and return the corresponding response
  7441. if ( finalDataType ) {
  7442. if ( finalDataType !== dataTypes[ 0 ] ) {
  7443. dataTypes.unshift( finalDataType );
  7444. }
  7445. return responses[ finalDataType ];
  7446. }
  7447. }
  7448. /* Chain conversions given the request and the original response
  7449. * Also sets the responseXXX fields on the jqXHR instance
  7450. */
  7451. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  7452. var conv2, current, conv, tmp, prev,
  7453. converters = {},
  7454. // Work with a copy of dataTypes in case we need to modify it for conversion
  7455. dataTypes = s.dataTypes.slice();
  7456. // Create converters map with lowercased keys
  7457. if ( dataTypes[ 1 ] ) {
  7458. for ( conv in s.converters ) {
  7459. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  7460. }
  7461. }
  7462. current = dataTypes.shift();
  7463. // Convert to each sequential dataType
  7464. while ( current ) {
  7465. if ( s.responseFields[ current ] ) {
  7466. jqXHR[ s.responseFields[ current ] ] = response;
  7467. }
  7468. // Apply the dataFilter if provided
  7469. if ( !prev && isSuccess && s.dataFilter ) {
  7470. response = s.dataFilter( response, s.dataType );
  7471. }
  7472. prev = current;
  7473. current = dataTypes.shift();
  7474. if ( current ) {
  7475. // There's only work to do if current dataType is non-auto
  7476. if ( current === "*" ) {
  7477. current = prev;
  7478. // Convert response if prev dataType is non-auto and differs from current
  7479. } else if ( prev !== "*" && prev !== current ) {
  7480. // Seek a direct converter
  7481. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  7482. // If none found, seek a pair
  7483. if ( !conv ) {
  7484. for ( conv2 in converters ) {
  7485. // If conv2 outputs current
  7486. tmp = conv2.split( " " );
  7487. if ( tmp[ 1 ] === current ) {
  7488. // If prev can be converted to accepted input
  7489. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  7490. converters[ "* " + tmp[ 0 ] ];
  7491. if ( conv ) {
  7492. // Condense equivalence converters
  7493. if ( conv === true ) {
  7494. conv = converters[ conv2 ];
  7495. // Otherwise, insert the intermediate dataType
  7496. } else if ( converters[ conv2 ] !== true ) {
  7497. current = tmp[ 0 ];
  7498. dataTypes.unshift( tmp[ 1 ] );
  7499. }
  7500. break;
  7501. }
  7502. }
  7503. }
  7504. }
  7505. // Apply converter (if not an equivalence)
  7506. if ( conv !== true ) {
  7507. // Unless errors are allowed to bubble, catch and return them
  7508. if ( conv && s.throws ) {
  7509. response = conv( response );
  7510. } else {
  7511. try {
  7512. response = conv( response );
  7513. } catch ( e ) {
  7514. return {
  7515. state: "parsererror",
  7516. error: conv ? e : "No conversion from " + prev + " to " + current
  7517. };
  7518. }
  7519. }
  7520. }
  7521. }
  7522. }
  7523. }
  7524. return { state: "success", data: response };
  7525. }
  7526. jQuery.extend( {
  7527. // Counter for holding the number of active queries
  7528. active: 0,
  7529. // Last-Modified header cache for next request
  7530. lastModified: {},
  7531. etag: {},
  7532. ajaxSettings: {
  7533. url: location.href,
  7534. type: "GET",
  7535. isLocal: rlocalProtocol.test( location.protocol ),
  7536. global: true,
  7537. processData: true,
  7538. async: true,
  7539. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  7540. /*
  7541. timeout: 0,
  7542. data: null,
  7543. dataType: null,
  7544. username: null,
  7545. password: null,
  7546. cache: null,
  7547. throws: false,
  7548. traditional: false,
  7549. headers: {},
  7550. */
  7551. accepts: {
  7552. "*": allTypes,
  7553. text: "text/plain",
  7554. html: "text/html",
  7555. xml: "application/xml, text/xml",
  7556. json: "application/json, text/javascript"
  7557. },
  7558. contents: {
  7559. xml: /\bxml\b/,
  7560. html: /\bhtml/,
  7561. json: /\bjson\b/
  7562. },
  7563. responseFields: {
  7564. xml: "responseXML",
  7565. text: "responseText",
  7566. json: "responseJSON"
  7567. },
  7568. // Data converters
  7569. // Keys separate source (or catchall "*") and destination types with a single space
  7570. converters: {
  7571. // Convert anything to text
  7572. "* text": String,
  7573. // Text to html (true = no transformation)
  7574. "text html": true,
  7575. // Evaluate text as a json expression
  7576. "text json": JSON.parse,
  7577. // Parse text as xml
  7578. "text xml": jQuery.parseXML
  7579. },
  7580. // For options that shouldn't be deep extended:
  7581. // you can add your own custom options here if
  7582. // and when you create one that shouldn't be
  7583. // deep extended (see ajaxExtend)
  7584. flatOptions: {
  7585. url: true,
  7586. context: true
  7587. }
  7588. },
  7589. // Creates a full fledged settings object into target
  7590. // with both ajaxSettings and settings fields.
  7591. // If target is omitted, writes into ajaxSettings.
  7592. ajaxSetup: function( target, settings ) {
  7593. return settings ?
  7594. // Building a settings object
  7595. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  7596. // Extending ajaxSettings
  7597. ajaxExtend( jQuery.ajaxSettings, target );
  7598. },
  7599. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  7600. ajaxTransport: addToPrefiltersOrTransports( transports ),
  7601. // Main method
  7602. ajax: function( url, options ) {
  7603. // If url is an object, simulate pre-1.5 signature
  7604. if ( typeof url === "object" ) {
  7605. options = url;
  7606. url = undefined;
  7607. }
  7608. // Force options to be an object
  7609. options = options || {};
  7610. var transport,
  7611. // URL without anti-cache param
  7612. cacheURL,
  7613. // Response headers
  7614. responseHeadersString,
  7615. responseHeaders,
  7616. // timeout handle
  7617. timeoutTimer,
  7618. // Url cleanup var
  7619. urlAnchor,
  7620. // Request state (becomes false upon send and true upon completion)
  7621. completed,
  7622. // To know if global events are to be dispatched
  7623. fireGlobals,
  7624. // Loop variable
  7625. i,
  7626. // uncached part of the url
  7627. uncached,
  7628. // Create the final options object
  7629. s = jQuery.ajaxSetup( {}, options ),
  7630. // Callbacks context
  7631. callbackContext = s.context || s,
  7632. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  7633. globalEventContext = s.context &&
  7634. ( callbackContext.nodeType || callbackContext.jquery ) ?
  7635. jQuery( callbackContext ) :
  7636. jQuery.event,
  7637. // Deferreds
  7638. deferred = jQuery.Deferred(),
  7639. completeDeferred = jQuery.Callbacks( "once memory" ),
  7640. // Status-dependent callbacks
  7641. statusCode = s.statusCode || {},
  7642. // Headers (they are sent all at once)
  7643. requestHeaders = {},
  7644. requestHeadersNames = {},
  7645. // Default abort message
  7646. strAbort = "canceled",
  7647. // Fake xhr
  7648. jqXHR = {
  7649. readyState: 0,
  7650. // Builds headers hashtable if needed
  7651. getResponseHeader: function( key ) {
  7652. var match;
  7653. if ( completed ) {
  7654. if ( !responseHeaders ) {
  7655. responseHeaders = {};
  7656. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  7657. responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
  7658. ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
  7659. .concat( match[ 2 ] );
  7660. }
  7661. }
  7662. match = responseHeaders[ key.toLowerCase() + " " ];
  7663. }
  7664. return match == null ? null : match.join( ", " );
  7665. },
  7666. // Raw string
  7667. getAllResponseHeaders: function() {
  7668. return completed ? responseHeadersString : null;
  7669. },
  7670. // Caches the header
  7671. setRequestHeader: function( name, value ) {
  7672. if ( completed == null ) {
  7673. name = requestHeadersNames[ name.toLowerCase() ] =
  7674. requestHeadersNames[ name.toLowerCase() ] || name;
  7675. requestHeaders[ name ] = value;
  7676. }
  7677. return this;
  7678. },
  7679. // Overrides response content-type header
  7680. overrideMimeType: function( type ) {
  7681. if ( completed == null ) {
  7682. s.mimeType = type;
  7683. }
  7684. return this;
  7685. },
  7686. // Status-dependent callbacks
  7687. statusCode: function( map ) {
  7688. var code;
  7689. if ( map ) {
  7690. if ( completed ) {
  7691. // Execute the appropriate callbacks
  7692. jqXHR.always( map[ jqXHR.status ] );
  7693. } else {
  7694. // Lazy-add the new callbacks in a way that preserves old ones
  7695. for ( code in map ) {
  7696. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  7697. }
  7698. }
  7699. }
  7700. return this;
  7701. },
  7702. // Cancel the request
  7703. abort: function( statusText ) {
  7704. var finalText = statusText || strAbort;
  7705. if ( transport ) {
  7706. transport.abort( finalText );
  7707. }
  7708. done( 0, finalText );
  7709. return this;
  7710. }
  7711. };
  7712. // Attach deferreds
  7713. deferred.promise( jqXHR );
  7714. // Add protocol if not provided (prefilters might expect it)
  7715. // Handle falsy url in the settings object (#10093: consistency with old signature)
  7716. // We also use the url parameter if available
  7717. s.url = ( ( url || s.url || location.href ) + "" )
  7718. .replace( rprotocol, location.protocol + "//" );
  7719. // Alias method option to type as per ticket #12004
  7720. s.type = options.method || options.type || s.method || s.type;
  7721. // Extract dataTypes list
  7722. s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
  7723. // A cross-domain request is in order when the origin doesn't match the current origin.
  7724. if ( s.crossDomain == null ) {
  7725. urlAnchor = document.createElement( "a" );
  7726. // Support: IE <=8 - 11, Edge 12 - 15
  7727. // IE throws exception on accessing the href property if url is malformed,
  7728. // e.g. http://example.com:80x/
  7729. try {
  7730. urlAnchor.href = s.url;
  7731. // Support: IE <=8 - 11 only
  7732. // Anchor's host property isn't correctly set when s.url is relative
  7733. urlAnchor.href = urlAnchor.href;
  7734. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  7735. urlAnchor.protocol + "//" + urlAnchor.host;
  7736. } catch ( e ) {
  7737. // If there is an error parsing the URL, assume it is crossDomain,
  7738. // it can be rejected by the transport if it is invalid
  7739. s.crossDomain = true;
  7740. }
  7741. }
  7742. // Convert data if not already a string
  7743. if ( s.data && s.processData && typeof s.data !== "string" ) {
  7744. s.data = jQuery.param( s.data, s.traditional );
  7745. }
  7746. // Apply prefilters
  7747. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  7748. // If request was aborted inside a prefilter, stop there
  7749. if ( completed ) {
  7750. return jqXHR;
  7751. }
  7752. // We can fire global events as of now if asked to
  7753. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  7754. fireGlobals = jQuery.event && s.global;
  7755. // Watch for a new set of requests
  7756. if ( fireGlobals && jQuery.active++ === 0 ) {
  7757. jQuery.event.trigger( "ajaxStart" );
  7758. }
  7759. // Uppercase the type
  7760. s.type = s.type.toUpperCase();
  7761. // Determine if request has content
  7762. s.hasContent = !rnoContent.test( s.type );
  7763. // Save the URL in case we're toying with the If-Modified-Since
  7764. // and/or If-None-Match header later on
  7765. // Remove hash to simplify url manipulation
  7766. cacheURL = s.url.replace( rhash, "" );
  7767. // More options handling for requests with no content
  7768. if ( !s.hasContent ) {
  7769. // Remember the hash so we can put it back
  7770. uncached = s.url.slice( cacheURL.length );
  7771. // If data is available and should be processed, append data to url
  7772. if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
  7773. cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
  7774. // #9682: remove data so that it's not used in an eventual retry
  7775. delete s.data;
  7776. }
  7777. // Add or update anti-cache param if needed
  7778. if ( s.cache === false ) {
  7779. cacheURL = cacheURL.replace( rantiCache, "$1" );
  7780. uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +
  7781. uncached;
  7782. }
  7783. // Put hash and anti-cache on the URL that will be requested (gh-1732)
  7784. s.url = cacheURL + uncached;
  7785. // Change '%20' to '+' if this is encoded form body content (gh-2658)
  7786. } else if ( s.data && s.processData &&
  7787. ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
  7788. s.data = s.data.replace( r20, "+" );
  7789. }
  7790. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7791. if ( s.ifModified ) {
  7792. if ( jQuery.lastModified[ cacheURL ] ) {
  7793. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  7794. }
  7795. if ( jQuery.etag[ cacheURL ] ) {
  7796. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  7797. }
  7798. }
  7799. // Set the correct header, if data is being sent
  7800. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  7801. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  7802. }
  7803. // Set the Accepts header for the server, depending on the dataType
  7804. jqXHR.setRequestHeader(
  7805. "Accept",
  7806. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  7807. s.accepts[ s.dataTypes[ 0 ] ] +
  7808. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  7809. s.accepts[ "*" ]
  7810. );
  7811. // Check for headers option
  7812. for ( i in s.headers ) {
  7813. jqXHR.setRequestHeader( i, s.headers[ i ] );
  7814. }
  7815. // Allow custom headers/mimetypes and early abort
  7816. if ( s.beforeSend &&
  7817. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
  7818. // Abort if not done already and return
  7819. return jqXHR.abort();
  7820. }
  7821. // Aborting is no longer a cancellation
  7822. strAbort = "abort";
  7823. // Install callbacks on deferreds
  7824. completeDeferred.add( s.complete );
  7825. jqXHR.done( s.success );
  7826. jqXHR.fail( s.error );
  7827. // Get transport
  7828. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  7829. // If no transport, we auto-abort
  7830. if ( !transport ) {
  7831. done( -1, "No Transport" );
  7832. } else {
  7833. jqXHR.readyState = 1;
  7834. // Send global event
  7835. if ( fireGlobals ) {
  7836. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  7837. }
  7838. // If request was aborted inside ajaxSend, stop there
  7839. if ( completed ) {
  7840. return jqXHR;
  7841. }
  7842. // Timeout
  7843. if ( s.async && s.timeout > 0 ) {
  7844. timeoutTimer = window.setTimeout( function() {
  7845. jqXHR.abort( "timeout" );
  7846. }, s.timeout );
  7847. }
  7848. try {
  7849. completed = false;
  7850. transport.send( requestHeaders, done );
  7851. } catch ( e ) {
  7852. // Rethrow post-completion exceptions
  7853. if ( completed ) {
  7854. throw e;
  7855. }
  7856. // Propagate others as results
  7857. done( -1, e );
  7858. }
  7859. }
  7860. // Callback for when everything is done
  7861. function done( status, nativeStatusText, responses, headers ) {
  7862. var isSuccess, success, error, response, modified,
  7863. statusText = nativeStatusText;
  7864. // Ignore repeat invocations
  7865. if ( completed ) {
  7866. return;
  7867. }
  7868. completed = true;
  7869. // Clear timeout if it exists
  7870. if ( timeoutTimer ) {
  7871. window.clearTimeout( timeoutTimer );
  7872. }
  7873. // Dereference transport for early garbage collection
  7874. // (no matter how long the jqXHR object will be used)
  7875. transport = undefined;
  7876. // Cache response headers
  7877. responseHeadersString = headers || "";
  7878. // Set readyState
  7879. jqXHR.readyState = status > 0 ? 4 : 0;
  7880. // Determine if successful
  7881. isSuccess = status >= 200 && status < 300 || status === 304;
  7882. // Get response data
  7883. if ( responses ) {
  7884. response = ajaxHandleResponses( s, jqXHR, responses );
  7885. }
  7886. // Use a noop converter for missing script
  7887. if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) {
  7888. s.converters[ "text script" ] = function() {};
  7889. }
  7890. // Convert no matter what (that way responseXXX fields are always set)
  7891. response = ajaxConvert( s, response, jqXHR, isSuccess );
  7892. // If successful, handle type chaining
  7893. if ( isSuccess ) {
  7894. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7895. if ( s.ifModified ) {
  7896. modified = jqXHR.getResponseHeader( "Last-Modified" );
  7897. if ( modified ) {
  7898. jQuery.lastModified[ cacheURL ] = modified;
  7899. }
  7900. modified = jqXHR.getResponseHeader( "etag" );
  7901. if ( modified ) {
  7902. jQuery.etag[ cacheURL ] = modified;
  7903. }
  7904. }
  7905. // if no content
  7906. if ( status === 204 || s.type === "HEAD" ) {
  7907. statusText = "nocontent";
  7908. // if not modified
  7909. } else if ( status === 304 ) {
  7910. statusText = "notmodified";
  7911. // If we have data, let's convert it
  7912. } else {
  7913. statusText = response.state;
  7914. success = response.data;
  7915. error = response.error;
  7916. isSuccess = !error;
  7917. }
  7918. } else {
  7919. // Extract error from statusText and normalize for non-aborts
  7920. error = statusText;
  7921. if ( status || !statusText ) {
  7922. statusText = "error";
  7923. if ( status < 0 ) {
  7924. status = 0;
  7925. }
  7926. }
  7927. }
  7928. // Set data for the fake xhr object
  7929. jqXHR.status = status;
  7930. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  7931. // Success/Error
  7932. if ( isSuccess ) {
  7933. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  7934. } else {
  7935. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  7936. }
  7937. // Status-dependent callbacks
  7938. jqXHR.statusCode( statusCode );
  7939. statusCode = undefined;
  7940. if ( fireGlobals ) {
  7941. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  7942. [ jqXHR, s, isSuccess ? success : error ] );
  7943. }
  7944. // Complete
  7945. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  7946. if ( fireGlobals ) {
  7947. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  7948. // Handle the global AJAX counter
  7949. if ( !( --jQuery.active ) ) {
  7950. jQuery.event.trigger( "ajaxStop" );
  7951. }
  7952. }
  7953. }
  7954. return jqXHR;
  7955. },
  7956. getJSON: function( url, data, callback ) {
  7957. return jQuery.get( url, data, callback, "json" );
  7958. },
  7959. getScript: function( url, callback ) {
  7960. return jQuery.get( url, undefined, callback, "script" );
  7961. }
  7962. } );
  7963. jQuery.each( [ "get", "post" ], function( _i, method ) {
  7964. jQuery[ method ] = function( url, data, callback, type ) {
  7965. // Shift arguments if data argument was omitted
  7966. if ( isFunction( data ) ) {
  7967. type = type || callback;
  7968. callback = data;
  7969. data = undefined;
  7970. }
  7971. // The url can be an options object (which then must have .url)
  7972. return jQuery.ajax( jQuery.extend( {
  7973. url: url,
  7974. type: method,
  7975. dataType: type,
  7976. data: data,
  7977. success: callback
  7978. }, jQuery.isPlainObject( url ) && url ) );
  7979. };
  7980. } );
  7981. jQuery.ajaxPrefilter( function( s ) {
  7982. var i;
  7983. for ( i in s.headers ) {
  7984. if ( i.toLowerCase() === "content-type" ) {
  7985. s.contentType = s.headers[ i ] || "";
  7986. }
  7987. }
  7988. } );
  7989. jQuery._evalUrl = function( url, options, doc ) {
  7990. return jQuery.ajax( {
  7991. url: url,
  7992. // Make this explicit, since user can override this through ajaxSetup (#11264)
  7993. type: "GET",
  7994. dataType: "script",
  7995. cache: true,
  7996. async: false,
  7997. global: false,
  7998. // Only evaluate the response if it is successful (gh-4126)
  7999. // dataFilter is not invoked for failure responses, so using it instead
  8000. // of the default converter is kludgy but it works.
  8001. converters: {
  8002. "text script": function() {}
  8003. },
  8004. dataFilter: function( response ) {
  8005. jQuery.globalEval( response, options, doc );
  8006. }
  8007. } );
  8008. };
  8009. jQuery.fn.extend( {
  8010. wrapAll: function( html ) {
  8011. var wrap;
  8012. if ( this[ 0 ] ) {
  8013. if ( isFunction( html ) ) {
  8014. html = html.call( this[ 0 ] );
  8015. }
  8016. // The elements to wrap the target around
  8017. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  8018. if ( this[ 0 ].parentNode ) {
  8019. wrap.insertBefore( this[ 0 ] );
  8020. }
  8021. wrap.map( function() {
  8022. var elem = this;
  8023. while ( elem.firstElementChild ) {
  8024. elem = elem.firstElementChild;
  8025. }
  8026. return elem;
  8027. } ).append( this );
  8028. }
  8029. return this;
  8030. },
  8031. wrapInner: function( html ) {
  8032. if ( isFunction( html ) ) {
  8033. return this.each( function( i ) {
  8034. jQuery( this ).wrapInner( html.call( this, i ) );
  8035. } );
  8036. }
  8037. return this.each( function() {
  8038. var self = jQuery( this ),
  8039. contents = self.contents();
  8040. if ( contents.length ) {
  8041. contents.wrapAll( html );
  8042. } else {
  8043. self.append( html );
  8044. }
  8045. } );
  8046. },
  8047. wrap: function( html ) {
  8048. var htmlIsFunction = isFunction( html );
  8049. return this.each( function( i ) {
  8050. jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
  8051. } );
  8052. },
  8053. unwrap: function( selector ) {
  8054. this.parent( selector ).not( "body" ).each( function() {
  8055. jQuery( this ).replaceWith( this.childNodes );
  8056. } );
  8057. return this;
  8058. }
  8059. } );
  8060. jQuery.expr.pseudos.hidden = function( elem ) {
  8061. return !jQuery.expr.pseudos.visible( elem );
  8062. };
  8063. jQuery.expr.pseudos.visible = function( elem ) {
  8064. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  8065. };
  8066. jQuery.ajaxSettings.xhr = function() {
  8067. try {
  8068. return new window.XMLHttpRequest();
  8069. } catch ( e ) {}
  8070. };
  8071. var xhrSuccessStatus = {
  8072. // File protocol always yields status code 0, assume 200
  8073. 0: 200,
  8074. // Support: IE <=9 only
  8075. // #1450: sometimes IE returns 1223 when it should be 204
  8076. 1223: 204
  8077. },
  8078. xhrSupported = jQuery.ajaxSettings.xhr();
  8079. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  8080. support.ajax = xhrSupported = !!xhrSupported;
  8081. jQuery.ajaxTransport( function( options ) {
  8082. var callback, errorCallback;
  8083. // Cross domain only allowed if supported through XMLHttpRequest
  8084. if ( support.cors || xhrSupported && !options.crossDomain ) {
  8085. return {
  8086. send: function( headers, complete ) {
  8087. var i,
  8088. xhr = options.xhr();
  8089. xhr.open(
  8090. options.type,
  8091. options.url,
  8092. options.async,
  8093. options.username,
  8094. options.password
  8095. );
  8096. // Apply custom fields if provided
  8097. if ( options.xhrFields ) {
  8098. for ( i in options.xhrFields ) {
  8099. xhr[ i ] = options.xhrFields[ i ];
  8100. }
  8101. }
  8102. // Override mime type if needed
  8103. if ( options.mimeType && xhr.overrideMimeType ) {
  8104. xhr.overrideMimeType( options.mimeType );
  8105. }
  8106. // X-Requested-With header
  8107. // For cross-domain requests, seeing as conditions for a preflight are
  8108. // akin to a jigsaw puzzle, we simply never set it to be sure.
  8109. // (it can always be set on a per-request basis or even using ajaxSetup)
  8110. // For same-domain requests, won't change header if already provided.
  8111. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  8112. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  8113. }
  8114. // Set headers
  8115. for ( i in headers ) {
  8116. xhr.setRequestHeader( i, headers[ i ] );
  8117. }
  8118. // Callback
  8119. callback = function( type ) {
  8120. return function() {
  8121. if ( callback ) {
  8122. callback = errorCallback = xhr.onload =
  8123. xhr.onerror = xhr.onabort = xhr.ontimeout =
  8124. xhr.onreadystatechange = null;
  8125. if ( type === "abort" ) {
  8126. xhr.abort();
  8127. } else if ( type === "error" ) {
  8128. // Support: IE <=9 only
  8129. // On a manual native abort, IE9 throws
  8130. // errors on any property access that is not readyState
  8131. if ( typeof xhr.status !== "number" ) {
  8132. complete( 0, "error" );
  8133. } else {
  8134. complete(
  8135. // File: protocol always yields status 0; see #8605, #14207
  8136. xhr.status,
  8137. xhr.statusText
  8138. );
  8139. }
  8140. } else {
  8141. complete(
  8142. xhrSuccessStatus[ xhr.status ] || xhr.status,
  8143. xhr.statusText,
  8144. // Support: IE <=9 only
  8145. // IE9 has no XHR2 but throws on binary (trac-11426)
  8146. // For XHR2 non-text, let the caller handle it (gh-2498)
  8147. ( xhr.responseType || "text" ) !== "text" ||
  8148. typeof xhr.responseText !== "string" ?
  8149. { binary: xhr.response } :
  8150. { text: xhr.responseText },
  8151. xhr.getAllResponseHeaders()
  8152. );
  8153. }
  8154. }
  8155. };
  8156. };
  8157. // Listen to events
  8158. xhr.onload = callback();
  8159. errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
  8160. // Support: IE 9 only
  8161. // Use onreadystatechange to replace onabort
  8162. // to handle uncaught aborts
  8163. if ( xhr.onabort !== undefined ) {
  8164. xhr.onabort = errorCallback;
  8165. } else {
  8166. xhr.onreadystatechange = function() {
  8167. // Check readyState before timeout as it changes
  8168. if ( xhr.readyState === 4 ) {
  8169. // Allow onerror to be called first,
  8170. // but that will not handle a native abort
  8171. // Also, save errorCallback to a variable
  8172. // as xhr.onerror cannot be accessed
  8173. window.setTimeout( function() {
  8174. if ( callback ) {
  8175. errorCallback();
  8176. }
  8177. } );
  8178. }
  8179. };
  8180. }
  8181. // Create the abort callback
  8182. callback = callback( "abort" );
  8183. try {
  8184. // Do send the request (this may raise an exception)
  8185. xhr.send( options.hasContent && options.data || null );
  8186. } catch ( e ) {
  8187. // #14683: Only rethrow if this hasn't been notified as an error yet
  8188. if ( callback ) {
  8189. throw e;
  8190. }
  8191. }
  8192. },
  8193. abort: function() {
  8194. if ( callback ) {
  8195. callback();
  8196. }
  8197. }
  8198. };
  8199. }
  8200. } );
  8201. // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  8202. jQuery.ajaxPrefilter( function( s ) {
  8203. if ( s.crossDomain ) {
  8204. s.contents.script = false;
  8205. }
  8206. } );
  8207. // Install script dataType
  8208. jQuery.ajaxSetup( {
  8209. accepts: {
  8210. script: "text/javascript, application/javascript, " +
  8211. "application/ecmascript, application/x-ecmascript"
  8212. },
  8213. contents: {
  8214. script: /\b(?:java|ecma)script\b/
  8215. },
  8216. converters: {
  8217. "text script": function( text ) {
  8218. jQuery.globalEval( text );
  8219. return text;
  8220. }
  8221. }
  8222. } );
  8223. // Handle cache's special case and crossDomain
  8224. jQuery.ajaxPrefilter( "script", function( s ) {
  8225. if ( s.cache === undefined ) {
  8226. s.cache = false;
  8227. }
  8228. if ( s.crossDomain ) {
  8229. s.type = "GET";
  8230. }
  8231. } );
  8232. // Bind script tag hack transport
  8233. jQuery.ajaxTransport( "script", function( s ) {
  8234. // This transport only deals with cross domain or forced-by-attrs requests
  8235. if ( s.crossDomain || s.scriptAttrs ) {
  8236. var script, callback;
  8237. return {
  8238. send: function( _, complete ) {
  8239. script = jQuery( "<script>" )
  8240. .attr( s.scriptAttrs || {} )
  8241. .prop( { charset: s.scriptCharset, src: s.url } )
  8242. .on( "load error", callback = function( evt ) {
  8243. script.remove();
  8244. callback = null;
  8245. if ( evt ) {
  8246. complete( evt.type === "error" ? 404 : 200, evt.type );
  8247. }
  8248. } );
  8249. // Use native DOM manipulation to avoid our domManip AJAX trickery
  8250. document.head.appendChild( script[ 0 ] );
  8251. },
  8252. abort: function() {
  8253. if ( callback ) {
  8254. callback();
  8255. }
  8256. }
  8257. };
  8258. }
  8259. } );
  8260. var oldCallbacks = [],
  8261. rjsonp = /(=)\?(?=&|$)|\?\?/;
  8262. // Default jsonp settings
  8263. jQuery.ajaxSetup( {
  8264. jsonp: "callback",
  8265. jsonpCallback: function() {
  8266. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
  8267. this[ callback ] = true;
  8268. return callback;
  8269. }
  8270. } );
  8271. // Detect, normalize options and install callbacks for jsonp requests
  8272. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  8273. var callbackName, overwritten, responseContainer,
  8274. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  8275. "url" :
  8276. typeof s.data === "string" &&
  8277. ( s.contentType || "" )
  8278. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  8279. rjsonp.test( s.data ) && "data"
  8280. );
  8281. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  8282. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  8283. // Get callback name, remembering preexisting value associated with it
  8284. callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
  8285. s.jsonpCallback() :
  8286. s.jsonpCallback;
  8287. // Insert callback into url or form data
  8288. if ( jsonProp ) {
  8289. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  8290. } else if ( s.jsonp !== false ) {
  8291. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  8292. }
  8293. // Use data converter to retrieve json after script execution
  8294. s.converters[ "script json" ] = function() {
  8295. if ( !responseContainer ) {
  8296. jQuery.error( callbackName + " was not called" );
  8297. }
  8298. return responseContainer[ 0 ];
  8299. };
  8300. // Force json dataType
  8301. s.dataTypes[ 0 ] = "json";
  8302. // Install callback
  8303. overwritten = window[ callbackName ];
  8304. window[ callbackName ] = function() {
  8305. responseContainer = arguments;
  8306. };
  8307. // Clean-up function (fires after converters)
  8308. jqXHR.always( function() {
  8309. // If previous value didn't exist - remove it
  8310. if ( overwritten === undefined ) {
  8311. jQuery( window ).removeProp( callbackName );
  8312. // Otherwise restore preexisting value
  8313. } else {
  8314. window[ callbackName ] = overwritten;
  8315. }
  8316. // Save back as free
  8317. if ( s[ callbackName ] ) {
  8318. // Make sure that re-using the options doesn't screw things around
  8319. s.jsonpCallback = originalSettings.jsonpCallback;
  8320. // Save the callback name for future use
  8321. oldCallbacks.push( callbackName );
  8322. }
  8323. // Call if it was a function and we have a response
  8324. if ( responseContainer && isFunction( overwritten ) ) {
  8325. overwritten( responseContainer[ 0 ] );
  8326. }
  8327. responseContainer = overwritten = undefined;
  8328. } );
  8329. // Delegate to script
  8330. return "script";
  8331. }
  8332. } );
  8333. // Support: Safari 8 only
  8334. // In Safari 8 documents created via document.implementation.createHTMLDocument
  8335. // collapse sibling forms: the second one becomes a child of the first one.
  8336. // Because of that, this security measure has to be disabled in Safari 8.
  8337. // https://bugs.webkit.org/show_bug.cgi?id=137337
  8338. support.createHTMLDocument = ( function() {
  8339. var body = document.implementation.createHTMLDocument( "" ).body;
  8340. body.innerHTML = "<form></form><form></form>";
  8341. return body.childNodes.length === 2;
  8342. } )();
  8343. // Argument "data" should be string of html
  8344. // context (optional): If specified, the fragment will be created in this context,
  8345. // defaults to document
  8346. // keepScripts (optional): If true, will include scripts passed in the html string
  8347. jQuery.parseHTML = function( data, context, keepScripts ) {
  8348. if ( typeof data !== "string" ) {
  8349. return [];
  8350. }
  8351. if ( typeof context === "boolean" ) {
  8352. keepScripts = context;
  8353. context = false;
  8354. }
  8355. var base, parsed, scripts;
  8356. if ( !context ) {
  8357. // Stop scripts or inline event handlers from being executed immediately
  8358. // by using document.implementation
  8359. if ( support.createHTMLDocument ) {
  8360. context = document.implementation.createHTMLDocument( "" );
  8361. // Set the base href for the created document
  8362. // so any parsed elements with URLs
  8363. // are based on the document's URL (gh-2965)
  8364. base = context.createElement( "base" );
  8365. base.href = document.location.href;
  8366. context.head.appendChild( base );
  8367. } else {
  8368. context = document;
  8369. }
  8370. }
  8371. parsed = rsingleTag.exec( data );
  8372. scripts = !keepScripts && [];
  8373. // Single tag
  8374. if ( parsed ) {
  8375. return [ context.createElement( parsed[ 1 ] ) ];
  8376. }
  8377. parsed = buildFragment( [ data ], context, scripts );
  8378. if ( scripts && scripts.length ) {
  8379. jQuery( scripts ).remove();
  8380. }
  8381. return jQuery.merge( [], parsed.childNodes );
  8382. };
  8383. /**
  8384. * Load a url into a page
  8385. */
  8386. jQuery.fn.load = function( url, params, callback ) {
  8387. var selector, type, response,
  8388. self = this,
  8389. off = url.indexOf( " " );
  8390. if ( off > -1 ) {
  8391. selector = stripAndCollapse( url.slice( off ) );
  8392. url = url.slice( 0, off );
  8393. }
  8394. // If it's a function
  8395. if ( isFunction( params ) ) {
  8396. // We assume that it's the callback
  8397. callback = params;
  8398. params = undefined;
  8399. // Otherwise, build a param string
  8400. } else if ( params && typeof params === "object" ) {
  8401. type = "POST";
  8402. }
  8403. // If we have elements to modify, make the request
  8404. if ( self.length > 0 ) {
  8405. jQuery.ajax( {
  8406. url: url,
  8407. // If "type" variable is undefined, then "GET" method will be used.
  8408. // Make value of this field explicit since
  8409. // user can override it through ajaxSetup method
  8410. type: type || "GET",
  8411. dataType: "html",
  8412. data: params
  8413. } ).done( function( responseText ) {
  8414. // Save response for use in complete callback
  8415. response = arguments;
  8416. self.html( selector ?
  8417. // If a selector was specified, locate the right elements in a dummy div
  8418. // Exclude scripts to avoid IE 'Permission Denied' errors
  8419. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  8420. // Otherwise use the full result
  8421. responseText );
  8422. // If the request succeeds, this function gets "data", "status", "jqXHR"
  8423. // but they are ignored because response was set above.
  8424. // If it fails, this function gets "jqXHR", "status", "error"
  8425. } ).always( callback && function( jqXHR, status ) {
  8426. self.each( function() {
  8427. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  8428. } );
  8429. } );
  8430. }
  8431. return this;
  8432. };
  8433. jQuery.expr.pseudos.animated = function( elem ) {
  8434. return jQuery.grep( jQuery.timers, function( fn ) {
  8435. return elem === fn.elem;
  8436. } ).length;
  8437. };
  8438. jQuery.offset = {
  8439. setOffset: function( elem, options, i ) {
  8440. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  8441. position = jQuery.css( elem, "position" ),
  8442. curElem = jQuery( elem ),
  8443. props = {};
  8444. // Set position first, in-case top/left are set even on static elem
  8445. if ( position === "static" ) {
  8446. elem.style.position = "relative";
  8447. }
  8448. curOffset = curElem.offset();
  8449. curCSSTop = jQuery.css( elem, "top" );
  8450. curCSSLeft = jQuery.css( elem, "left" );
  8451. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  8452. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  8453. // Need to be able to calculate position if either
  8454. // top or left is auto and position is either absolute or fixed
  8455. if ( calculatePosition ) {
  8456. curPosition = curElem.position();
  8457. curTop = curPosition.top;
  8458. curLeft = curPosition.left;
  8459. } else {
  8460. curTop = parseFloat( curCSSTop ) || 0;
  8461. curLeft = parseFloat( curCSSLeft ) || 0;
  8462. }
  8463. if ( isFunction( options ) ) {
  8464. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  8465. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  8466. }
  8467. if ( options.top != null ) {
  8468. props.top = ( options.top - curOffset.top ) + curTop;
  8469. }
  8470. if ( options.left != null ) {
  8471. props.left = ( options.left - curOffset.left ) + curLeft;
  8472. }
  8473. if ( "using" in options ) {
  8474. options.using.call( elem, props );
  8475. } else {
  8476. if ( typeof props.top === "number" ) {
  8477. props.top += "px";
  8478. }
  8479. if ( typeof props.left === "number" ) {
  8480. props.left += "px";
  8481. }
  8482. curElem.css( props );
  8483. }
  8484. }
  8485. };
  8486. jQuery.fn.extend( {
  8487. // offset() relates an element's border box to the document origin
  8488. offset: function( options ) {
  8489. // Preserve chaining for setter
  8490. if ( arguments.length ) {
  8491. return options === undefined ?
  8492. this :
  8493. this.each( function( i ) {
  8494. jQuery.offset.setOffset( this, options, i );
  8495. } );
  8496. }
  8497. var rect, win,
  8498. elem = this[ 0 ];
  8499. if ( !elem ) {
  8500. return;
  8501. }
  8502. // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
  8503. // Support: IE <=11 only
  8504. // Running getBoundingClientRect on a
  8505. // disconnected node in IE throws an error
  8506. if ( !elem.getClientRects().length ) {
  8507. return { top: 0, left: 0 };
  8508. }
  8509. // Get document-relative position by adding viewport scroll to viewport-relative gBCR
  8510. rect = elem.getBoundingClientRect();
  8511. win = elem.ownerDocument.defaultView;
  8512. return {
  8513. top: rect.top + win.pageYOffset,
  8514. left: rect.left + win.pageXOffset
  8515. };
  8516. },
  8517. // position() relates an element's margin box to its offset parent's padding box
  8518. // This corresponds to the behavior of CSS absolute positioning
  8519. position: function() {
  8520. if ( !this[ 0 ] ) {
  8521. return;
  8522. }
  8523. var offsetParent, offset, doc,
  8524. elem = this[ 0 ],
  8525. parentOffset = { top: 0, left: 0 };
  8526. // position:fixed elements are offset from the viewport, which itself always has zero offset
  8527. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  8528. // Assume position:fixed implies availability of getBoundingClientRect
  8529. offset = elem.getBoundingClientRect();
  8530. } else {
  8531. offset = this.offset();
  8532. // Account for the *real* offset parent, which can be the document or its root element
  8533. // when a statically positioned element is identified
  8534. doc = elem.ownerDocument;
  8535. offsetParent = elem.offsetParent || doc.documentElement;
  8536. while ( offsetParent &&
  8537. ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
  8538. jQuery.css( offsetParent, "position" ) === "static" ) {
  8539. offsetParent = offsetParent.parentNode;
  8540. }
  8541. if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
  8542. // Incorporate borders into its offset, since they are outside its content origin
  8543. parentOffset = jQuery( offsetParent ).offset();
  8544. parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
  8545. parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
  8546. }
  8547. }
  8548. // Subtract parent offsets and element margins
  8549. return {
  8550. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  8551. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  8552. };
  8553. },
  8554. // This method will return documentElement in the following cases:
  8555. // 1) For the element inside the iframe without offsetParent, this method will return
  8556. // documentElement of the parent window
  8557. // 2) For the hidden or detached element
  8558. // 3) For body or html element, i.e. in case of the html node - it will return itself
  8559. //
  8560. // but those exceptions were never presented as a real life use-cases
  8561. // and might be considered as more preferable results.
  8562. //
  8563. // This logic, however, is not guaranteed and can change at any point in the future
  8564. offsetParent: function() {
  8565. return this.map( function() {
  8566. var offsetParent = this.offsetParent;
  8567. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  8568. offsetParent = offsetParent.offsetParent;
  8569. }
  8570. return offsetParent || documentElement;
  8571. } );
  8572. }
  8573. } );
  8574. // Create scrollLeft and scrollTop methods
  8575. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  8576. var top = "pageYOffset" === prop;
  8577. jQuery.fn[ method ] = function( val ) {
  8578. return access( this, function( elem, method, val ) {
  8579. // Coalesce documents and windows
  8580. var win;
  8581. if ( isWindow( elem ) ) {
  8582. win = elem;
  8583. } else if ( elem.nodeType === 9 ) {
  8584. win = elem.defaultView;
  8585. }
  8586. if ( val === undefined ) {
  8587. return win ? win[ prop ] : elem[ method ];
  8588. }
  8589. if ( win ) {
  8590. win.scrollTo(
  8591. !top ? val : win.pageXOffset,
  8592. top ? val : win.pageYOffset
  8593. );
  8594. } else {
  8595. elem[ method ] = val;
  8596. }
  8597. }, method, val, arguments.length );
  8598. };
  8599. } );
  8600. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  8601. // Add the top/left cssHooks using jQuery.fn.position
  8602. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  8603. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  8604. // getComputedStyle returns percent when specified for top/left/bottom/right;
  8605. // rather than make the css module depend on the offset module, just check for it here
  8606. jQuery.each( [ "top", "left" ], function( _i, prop ) {
  8607. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  8608. function( elem, computed ) {
  8609. if ( computed ) {
  8610. computed = curCSS( elem, prop );
  8611. // If curCSS returns percentage, fallback to offset
  8612. return rnumnonpx.test( computed ) ?
  8613. jQuery( elem ).position()[ prop ] + "px" :
  8614. computed;
  8615. }
  8616. }
  8617. );
  8618. } );
  8619. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  8620. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  8621. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
  8622. function( defaultExtra, funcName ) {
  8623. // Margin is only for outerHeight, outerWidth
  8624. jQuery.fn[ funcName ] = function( margin, value ) {
  8625. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  8626. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  8627. return access( this, function( elem, type, value ) {
  8628. var doc;
  8629. if ( isWindow( elem ) ) {
  8630. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  8631. return funcName.indexOf( "outer" ) === 0 ?
  8632. elem[ "inner" + name ] :
  8633. elem.document.documentElement[ "client" + name ];
  8634. }
  8635. // Get document width or height
  8636. if ( elem.nodeType === 9 ) {
  8637. doc = elem.documentElement;
  8638. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  8639. // whichever is greatest
  8640. return Math.max(
  8641. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  8642. elem.body[ "offset" + name ], doc[ "offset" + name ],
  8643. doc[ "client" + name ]
  8644. );
  8645. }
  8646. return value === undefined ?
  8647. // Get width or height on the element, requesting but not forcing parseFloat
  8648. jQuery.css( elem, type, extra ) :
  8649. // Set width or height on the element
  8650. jQuery.style( elem, type, value, extra );
  8651. }, type, chainable ? margin : undefined, chainable );
  8652. };
  8653. } );
  8654. } );
  8655. jQuery.each( [
  8656. "ajaxStart",
  8657. "ajaxStop",
  8658. "ajaxComplete",
  8659. "ajaxError",
  8660. "ajaxSuccess",
  8661. "ajaxSend"
  8662. ], function( _i, type ) {
  8663. jQuery.fn[ type ] = function( fn ) {
  8664. return this.on( type, fn );
  8665. };
  8666. } );
  8667. jQuery.fn.extend( {
  8668. bind: function( types, data, fn ) {
  8669. return this.on( types, null, data, fn );
  8670. },
  8671. unbind: function( types, fn ) {
  8672. return this.off( types, null, fn );
  8673. },
  8674. delegate: function( selector, types, data, fn ) {
  8675. return this.on( types, selector, data, fn );
  8676. },
  8677. undelegate: function( selector, types, fn ) {
  8678. // ( namespace ) or ( selector, types [, fn] )
  8679. return arguments.length === 1 ?
  8680. this.off( selector, "**" ) :
  8681. this.off( types, selector || "**", fn );
  8682. },
  8683. hover: function( fnOver, fnOut ) {
  8684. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  8685. }
  8686. } );
  8687. jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
  8688. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  8689. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  8690. function( _i, name ) {
  8691. // Handle event binding
  8692. jQuery.fn[ name ] = function( data, fn ) {
  8693. return arguments.length > 0 ?
  8694. this.on( name, null, data, fn ) :
  8695. this.trigger( name );
  8696. };
  8697. } );
  8698. // Support: Android <=4.0 only
  8699. // Make sure we trim BOM and NBSP
  8700. var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
  8701. // Bind a function to a context, optionally partially applying any
  8702. // arguments.
  8703. // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  8704. // However, it is not slated for removal any time soon
  8705. jQuery.proxy = function( fn, context ) {
  8706. var tmp, args, proxy;
  8707. if ( typeof context === "string" ) {
  8708. tmp = fn[ context ];
  8709. context = fn;
  8710. fn = tmp;
  8711. }
  8712. // Quick check to determine if target is callable, in the spec
  8713. // this throws a TypeError, but we will just return undefined.
  8714. if ( !isFunction( fn ) ) {
  8715. return undefined;
  8716. }
  8717. // Simulated bind
  8718. args = slice.call( arguments, 2 );
  8719. proxy = function() {
  8720. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  8721. };
  8722. // Set the guid of unique handler to the same of original handler, so it can be removed
  8723. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  8724. return proxy;
  8725. };
  8726. jQuery.holdReady = function( hold ) {
  8727. if ( hold ) {
  8728. jQuery.readyWait++;
  8729. } else {
  8730. jQuery.ready( true );
  8731. }
  8732. };
  8733. jQuery.isArray = Array.isArray;
  8734. jQuery.parseJSON = JSON.parse;
  8735. jQuery.nodeName = nodeName;
  8736. jQuery.isFunction = isFunction;
  8737. jQuery.isWindow = isWindow;
  8738. jQuery.camelCase = camelCase;
  8739. jQuery.type = toType;
  8740. jQuery.now = Date.now;
  8741. jQuery.isNumeric = function( obj ) {
  8742. // As of jQuery 3.0, isNumeric is limited to
  8743. // strings and numbers (primitives or objects)
  8744. // that can be coerced to finite numbers (gh-2662)
  8745. var type = jQuery.type( obj );
  8746. return ( type === "number" || type === "string" ) &&
  8747. // parseFloat NaNs numeric-cast false positives ("")
  8748. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  8749. // subtraction forces infinities to NaN
  8750. !isNaN( obj - parseFloat( obj ) );
  8751. };
  8752. jQuery.trim = function( text ) {
  8753. return text == null ?
  8754. "" :
  8755. ( text + "" ).replace( rtrim, "" );
  8756. };
  8757. // Register as a named AMD module, since jQuery can be concatenated with other
  8758. // files that may use define, but not via a proper concatenation script that
  8759. // understands anonymous AMD modules. A named AMD is safest and most robust
  8760. // way to register. Lowercase jquery is used because AMD module names are
  8761. // derived from file names, and jQuery is normally delivered in a lowercase
  8762. // file name. Do this after creating the global so that if an AMD module wants
  8763. // to call noConflict to hide this version of jQuery, it will work.
  8764. // Note that for maximum portability, libraries that are not jQuery should
  8765. // declare themselves as anonymous modules, and avoid setting a global if an
  8766. // AMD loader is present. jQuery is a special case. For more information, see
  8767. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  8768. if ( typeof define === "function" && define.amd ) {
  8769. define( "jquery", [], function() {
  8770. return jQuery;
  8771. } );
  8772. }
  8773. var
  8774. // Map over jQuery in case of overwrite
  8775. _jQuery = window.jQuery,
  8776. // Map over the $ in case of overwrite
  8777. _$ = window.$;
  8778. jQuery.noConflict = function( deep ) {
  8779. if ( window.$ === jQuery ) {
  8780. window.$ = _$;
  8781. }
  8782. if ( deep && window.jQuery === jQuery ) {
  8783. window.jQuery = _jQuery;
  8784. }
  8785. return jQuery;
  8786. };
  8787. // Expose jQuery and $ identifiers, even in AMD
  8788. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  8789. // and CommonJS for browser emulators (#13566)
  8790. if ( typeof noGlobal === "undefined" ) {
  8791. window.jQuery = window.$ = jQuery;
  8792. }
  8793. return jQuery;
  8794. } );