jquery.js 257 KB

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