main.min.js 284 KB

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