jquery.js 261 KB

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