jquery-3.4.1.js 383 KB

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