jquery.js 398 KB

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