jquery.js 286 KB

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