jquery-3.3.1.js 271 KB

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