jquery-min.js 395 KB

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