require-frontend.min.js 366 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811
  1. /*! jQuery v2.2.4 | (c) jQuery Foundation | jquery.org/license */
  2. !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c;
  3. }catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||d,e=c.documentElement,f=c.body,a.pageX=b.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ea.test(f)?this.mouseHooks:da.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=d),3===a.target.nodeType&&(a.target=a.target.parentNode),h.filter?h.filter(a,g):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ia()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ia()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ga:ha):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:ha,isPropagationStopped:ha,isImmediatePropagationStopped:ha,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ga,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ga,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ga,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),n.fn.extend({on:function(a,b,c,d){return ja(this,a,b,c,d)},one:function(a,b,c,d){return ja(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=ha),this.each(function(){n.event.remove(this,a,c,b)})}});var ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,la=/<script|<style|<link/i,ma=/checked\s*(?:[^=]|=\s*.checked.)/i,na=/^true\/(.*)/,oa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=wa[0].contentDocument,b.write(),b.close(),c=ya(a,b),wa.detach()),xa[a]=c),c}var Aa=/^margin/,Ba=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ca=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Ea=d.documentElement;!function(){var b,c,e,f,g=d.createElement("div"),h=d.createElement("div");if(h.style){h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",g.appendChild(h);function i(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",h.innerHTML="",Ea.appendChild(g);var d=a.getComputedStyle(h);b="1%"!==d.top,f="2px"===d.marginLeft,c="4px"===d.width,h.style.marginRight="50%",e="4px"===d.marginRight,Ea.removeChild(g)}n.extend(l,{pixelPosition:function(){return i(),b},boxSizingReliable:function(){return null==c&&i(),c},pixelMarginRight:function(){return null==c&&i(),e},reliableMarginLeft:function(){return null==c&&i(),f},reliableMarginRight:function(){var b,c=h.appendChild(d.createElement("div"));return c.style.cssText=h.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",h.style.width="1px",Ea.appendChild(g),b=!parseFloat(a.getComputedStyle(c).marginRight),Ea.removeChild(g),h.removeChild(c),b}})}}();function Fa(a,b,c){var d,e,f,g,h=a.style;return c=c||Ca(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Ba.test(g)&&Aa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0!==g?g+"":g}function Ga(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ha=/^(none|table(?!-c[ea]).+)/,Ia={position:"absolute",visibility:"hidden",display:"block"},Ja={letterSpacing:"0",fontWeight:"400"},Ka=["Webkit","O","Moz","ms"],La=d.createElement("div").style;function Ma(a){if(a in La)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ka.length;while(c--)if(a=Ka[c]+b,a in La)return a}function Na(a,b,c){var d=T.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Oa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Pa(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ca(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Fa(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ba.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Oa(a,b,c||(g?"border":"content"),d,f)+"px"}function Qa(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=N.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=N.access(d,"olddisplay",za(d.nodeName)))):(e=V(d),"none"===c&&e||N.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Fa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=T.exec(c))&&e[1]&&(c=W(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Fa(a,b,d)),"normal"===e&&b in Ja&&(e=Ja[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Ha.test(n.css(a,"display"))&&0===a.offsetWidth?Da(a,Ia,function(){return Pa(a,b,d)}):Pa(a,b,d):void 0},set:function(a,c,d){var e,f=d&&Ca(a),g=d&&Oa(a,b,d,"border-box"===n.css(a,"boxSizing",!1,f),f);return g&&(e=T.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=n.css(a,b)),Na(a,c,g)}}}),n.cssHooks.marginLeft=Ga(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Fa(a,"marginLeft"))||a.getBoundingClientRect().left-Da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),n.cssHooks.marginRight=Ga(l.reliableMarginRight,function(a,b){return b?Da(a,{display:"inline-block"},Fa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Aa.test(a)||(n.cssHooks[a+b].set=Na)}),n.fn.extend({css:function(a,b){return K(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ca(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Qa(this,!0)},hide:function(){return Qa(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function Ra(a,b,c,d,e){return new Ra.prototype.init(a,b,c,d,e)}n.Tween=Ra,Ra.prototype={constructor:Ra,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ra.propHooks[this.prop];return a&&a.get?a.get(this):Ra.propHooks._default.get(this)},run:function(a){var b,c=Ra.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ra.propHooks._default.set(this),this}},Ra.prototype.init.prototype=Ra.prototype,Ra.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},Ra.propHooks.scrollTop=Ra.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=Ra.prototype.init,n.fx.step={};var Sa,Ta,Ua=/^(?:toggle|show|hide)$/,Va=/queueHooks$/;function Wa(){return a.setTimeout(function(){Sa=void 0}),Sa=n.now()}function Xa(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=U[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ya(a,b,c){for(var d,e=(_a.tweeners[b]||[]).concat(_a.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Za(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&V(a),q=N.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?N.get(a,"olddisplay")||za(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Ua.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?za(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=N.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;N.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ya(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function $a(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function _a(a,b,c){var d,e,f=0,g=_a.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Sa||Wa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:Sa||Wa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for($a(k,j.opts.specialEasing);g>f;f++)if(d=_a.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,Ya,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(_a,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return W(c.elem,a,T.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],_a.tweeners[c]=_a.tweeners[c]||[],_a.tweeners[c].unshift(b)},prefilters:[Za],prefilter:function(a,b){b?_a.prefilters.unshift(a):_a.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=_a(this,n.extend({},a),f);(e||N.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=N.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Va.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=N.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Xa(b,!0),a,d,e)}}),n.each({slideDown:Xa("show"),slideUp:Xa("hide"),slideToggle:Xa("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Sa=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Sa=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ta||(Ta=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(Ta),Ta=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=d.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var ab,bb=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return K(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ab:void 0)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)}}),ab={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=bb[b]||n.find.attr;bb[b]=function(a,b,d){var e,f;return d||(f=bb[b],bb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,bb[b]=f),e}});var cb=/^(?:input|select|textarea|button)$/i,db=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return K(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),
  4. void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g,hb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(gb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(hb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(n.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var ib=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!ib.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),l=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},f||!o.trigger||o.trigger.apply(e,c)!==!1)){if(!f&&!o.noBubble&&!n.isWindow(e)){for(j=o.delegateType||q,ib.test(j+q)||(h=h.parentNode);h;h=h.parentNode)p.push(h),i=h;i===(e.ownerDocument||d)&&p.push(i.defaultView||i.parentWindow||a)}g=0;while((h=p[g++])&&!b.isPropagationStopped())b.type=g>1?j:o.bindType||q,m=(N.get(h,"events")||{})[b.type]&&N.get(h,"handle"),m&&m.apply(h,c),m=l&&h[l],m&&m.apply&&L(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=q,f||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!L(e)||l&&n.isFunction(e[q])&&!n.isWindow(e)&&(i=e[l],i&&(e[l]=null),n.event.triggered=q,e[q](),n.event.triggered=void 0,i&&(e[l]=i)),b.result}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b)}}),n.fn.extend({trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),l.focusin="onfocusin"in a,l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=N.access(d,b);e||d.addEventListener(a,c,!0),N.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=N.access(d,b)-1;e?N.access(d,b,e):(d.removeEventListener(a,c,!0),N.remove(d,b))}}});var jb=a.location,kb=n.now(),lb=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var mb=/#.*$/,nb=/([?&])_=[^&]*/,ob=/^(.*?):[ \t]*([^\r\n]*)$/gm,pb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,qb=/^(?:GET|HEAD)$/,rb=/^\/\//,sb={},tb={},ub="*/".concat("*"),vb=d.createElement("a");vb.href=jb.href;function wb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function xb(a,b,c,d){var e={},f=a===tb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function yb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function zb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Ab(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:jb.href,type:"GET",isLocal:pb.test(jb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ub,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?yb(yb(a,n.ajaxSettings),b):yb(n.ajaxSettings,a)},ajaxPrefilter:wb(sb),ajaxTransport:wb(tb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=n.ajaxSetup({},c),o=m.context||m,p=m.context&&(o.nodeType||o.jquery)?n(o):n.event,q=n.Deferred(),r=n.Callbacks("once memory"),s=m.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,getResponseHeader:function(a){var b;if(2===v){if(!h){h={};while(b=ob.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===v?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return v||(a=u[c]=u[c]||a,t[a]=b),this},overrideMimeType:function(a){return v||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>v)for(b in a)s[b]=[s[b],a[b]];else x.always(a[x.status]);return this},abort:function(a){var b=a||w;return e&&e.abort(b),z(0,b),this}};if(q.promise(x).complete=r.add,x.success=x.done,x.error=x.fail,m.url=((b||m.url||jb.href)+"").replace(mb,"").replace(rb,jb.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=n.trim(m.dataType||"*").toLowerCase().match(G)||[""],null==m.crossDomain){j=d.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=vb.protocol+"//"+vb.host!=j.protocol+"//"+j.host}catch(y){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=n.param(m.data,m.traditional)),xb(sb,m,c,x),2===v)return x;k=n.event&&m.global,k&&0===n.active++&&n.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!qb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(lb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=nb.test(f)?f.replace(nb,"$1_="+kb++):f+(lb.test(f)?"&":"?")+"_="+kb++)),m.ifModified&&(n.lastModified[f]&&x.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&x.setRequestHeader("If-None-Match",n.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+ub+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)x.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(o,x,m)===!1||2===v))return x.abort();w="abort";for(l in{success:1,error:1,complete:1})x[l](m[l]);if(e=xb(tb,m,c,x)){if(x.readyState=1,k&&p.trigger("ajaxSend",[x,m]),2===v)return x;m.async&&m.timeout>0&&(i=a.setTimeout(function(){x.abort("timeout")},m.timeout));try{v=1,e.send(t,z)}catch(y){if(!(2>v))throw y;z(-1,y)}}else z(-1,"No Transport");function z(b,c,d,h){var j,l,t,u,w,y=c;2!==v&&(v=2,i&&a.clearTimeout(i),e=void 0,g=h||"",x.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(u=zb(m,x,d)),u=Ab(m,u,x,j),j?(m.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(n.lastModified[f]=w),w=x.getResponseHeader("etag"),w&&(n.etag[f]=w)),204===b||"HEAD"===m.type?y="nocontent":304===b?y="notmodified":(y=u.state,l=u.data,t=u.error,j=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),x.status=b,x.statusText=(c||y)+"",j?q.resolveWith(o,[l,y,x]):q.rejectWith(o,[x,y,t]),x.statusCode(s),s=void 0,k&&p.trigger(j?"ajaxSuccess":"ajaxError",[x,m,j?l:t]),r.fireWith(o,[x,y]),k&&(p.trigger("ajaxComplete",[x,m]),--n.active||n.event.trigger("ajaxStop")))}return x},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return!n.expr.filters.visible(a)},n.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Bb=/%20/g,Cb=/\[\]$/,Db=/\r?\n/g,Eb=/^(?:submit|button|image|reset|file)$/i,Fb=/^(?:input|select|textarea|keygen)/i;function Gb(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Cb.test(a)?d(a,e):Gb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Gb(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Gb(c,a[c],b,e);return d.join("&").replace(Bb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Fb.test(this.nodeName)&&!Eb.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Db,"\r\n")}}):{name:b.name,value:c.replace(Db,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Hb={0:200,1223:204},Ib=n.ajaxSettings.xhr();l.cors=!!Ib&&"withCredentials"in Ib,l.ajax=Ib=!!Ib,n.ajaxTransport(function(b){var c,d;return l.cors||Ib&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Hb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=n("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Jb=[],Kb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Jb.pop()||n.expando+"_"+kb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Kb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Kb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Kb,"$1"+e):b.jsonp!==!1&&(b.url+=(lb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Jb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ca([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var Lb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Lb)return Lb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function Mb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(e=d.getBoundingClientRect(),c=Mb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ea})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;n.fn[a]=function(d){return K(this,function(a,d,e){var f=Mb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ga(l.pixelPosition,function(a,c){return c?(c=Fa(a,b),Ba.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return K(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)},size:function(){return this.length}}),n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Nb=a.jQuery,Ob=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Ob),b&&a.jQuery===n&&(a.jQuery=Nb),n},b||(a.jQuery=a.$=n),n});
  5. /*!
  6. * Bootstrap v3.4.1 (https://getbootstrap.com/)
  7. * Copyright 2011-2019 Twitter, Inc.
  8. * Licensed under the MIT license
  9. */
  10. if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(t){"use strict";var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||3<e[0])throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(n){"use strict";n.fn.emulateTransitionEnd=function(t){var e=!1,i=this;n(this).one("bsTransitionEnd",function(){e=!0});return setTimeout(function(){e||n(i).trigger(n.support.transition.end)},t),this},n(function(){n.support.transition=function o(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(t.style[i]!==undefined)return{end:e[i]};return!1}(),n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(s){"use strict";var e='[data-dismiss="alert"]',a=function(t){s(t).on("click",e,this.close)};a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.close=function(t){var e=s(this),i=e.attr("data-target");i||(i=(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),i="#"===i?[]:i;var o=s(document).find(i);function n(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),o.length||(o=e.closest(".alert")),o.trigger(t=s.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),s.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",n).emulateTransitionEnd(a.TRANSITION_DURATION):n())};var t=s.fn.alert;s.fn.alert=function o(i){return this.each(function(){var t=s(this),e=t.data("bs.alert");e||t.data("bs.alert",e=new a(this)),"string"==typeof i&&e[i].call(t)})},s.fn.alert.Constructor=a,s.fn.alert.noConflict=function(){return s.fn.alert=t,this},s(document).on("click.bs.alert.data-api",e,a.prototype.close)}(jQuery),function(s){"use strict";var n=function(t,e){this.$element=s(t),this.options=s.extend({},n.DEFAULTS,e),this.isLoading=!1};function i(o){return this.each(function(){var t=s(this),e=t.data("bs.button"),i="object"==typeof o&&o;e||t.data("bs.button",e=new n(this,i)),"toggle"==o?e.toggle():o&&e.setState(o)})}n.VERSION="3.4.1",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var e="disabled",i=this.$element,o=i.is("input")?"val":"html",n=i.data();t+="Text",null==n.resetText&&i.data("resetText",i[o]()),setTimeout(s.proxy(function(){i[o](null==n[t]?this.options[t]:n[t]),"loadingText"==t?(this.isLoading=!0,i.addClass(e).attr(e,e).prop(e,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(e).removeAttr(e).prop(e,!1))},this),0)},n.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var t=s.fn.button;s.fn.button=i,s.fn.button.Constructor=n,s.fn.button.noConflict=function(){return s.fn.button=t,this},s(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var e=s(t.target).closest(".btn");i.call(e,"toggle"),s(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),e.is("input,button")?e.trigger("focus"):e.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){s(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),function(p){"use strict";var c=function(t,e){this.$element=p(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=e,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",p.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",p.proxy(this.pause,this)).on("mouseleave.bs.carousel",p.proxy(this.cycle,this))};function r(n){return this.each(function(){var t=p(this),e=t.data("bs.carousel"),i=p.extend({},c.DEFAULTS,t.data(),"object"==typeof n&&n),o="string"==typeof n?n:i.slide;e||t.data("bs.carousel",e=new c(this,i)),"number"==typeof n?e.to(n):o?e[o]():i.interval&&e.pause().cycle()})}c.VERSION="3.4.1",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},c.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(p.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},c.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var o=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(o)},c.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(i<t?"next":"prev",this.$items.eq(t))},c.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&p.support.transition&&(this.$element.trigger(p.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(t,e){var i=this.$element.find(".item.active"),o=e||this.getItemForDirection(t,i),n=this.interval,s="next"==t?"left":"right",a=this;if(o.hasClass("active"))return this.sliding=!1;var r=o[0],l=p.Event("slide.bs.carousel",{relatedTarget:r,direction:s});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,n&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var h=p(this.$indicators.children()[this.getItemIndex(o)]);h&&h.addClass("active")}var d=p.Event("slid.bs.carousel",{relatedTarget:r,direction:s});return p.support.transition&&this.$element.hasClass("slide")?(o.addClass(t),"object"==typeof o&&o.length&&o[0].offsetWidth,i.addClass(s),o.addClass(s),i.one("bsTransitionEnd",function(){o.removeClass([t,s].join(" ")).addClass("active"),i.removeClass(["active",s].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger(d)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(i.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(d)),n&&this.cycle(),this}};var t=p.fn.carousel;p.fn.carousel=r,p.fn.carousel.Constructor=c,p.fn.carousel.noConflict=function(){return p.fn.carousel=t,this};var e=function(t){var e=p(this),i=e.attr("href");i&&(i=i.replace(/.*(?=#[^\s]+$)/,""));var o=e.attr("data-target")||i,n=p(document).find(o);if(n.hasClass("carousel")){var s=p.extend({},n.data(),e.data()),a=e.attr("data-slide-to");a&&(s.interval=!1),r.call(n,s),a&&n.data("bs.carousel").to(a),t.preventDefault()}};p(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),p(window).on("load",function(){p('[data-ride="carousel"]').each(function(){var t=p(this);r.call(t,t.data())})})}(jQuery),function(a){"use strict";var r=function(t,e){this.$element=a(t),this.options=a.extend({},r.DEFAULTS,e),this.$trigger=a('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function n(t){var e,i=t.attr("data-target")||(e=t.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"");return a(document).find(i)}function l(o){return this.each(function(){var t=a(this),e=t.data("bs.collapse"),i=a.extend({},r.DEFAULTS,t.data(),"object"==typeof o&&o);!e&&i.toggle&&/show|hide/.test(o)&&(i.toggle=!1),e||t.data("bs.collapse",e=new r(this,i)),"string"==typeof o&&e[o]()})}r.VERSION="3.4.1",r.TRANSITION_DURATION=350,r.DEFAULTS={toggle:!0},r.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},r.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(t=e.data("bs.collapse"))&&t.transitioning)){var i=a.Event("show.bs.collapse");if(this.$element.trigger(i),!i.isDefaultPrevented()){e&&e.length&&(l.call(e,"hide"),t||e.data("bs.collapse",null));var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var n=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return n.call(this);var s=a.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",a.proxy(n,this)).emulateTransitionEnd(r.TRANSITION_DURATION)[o](this.$element[0][s])}}}},r.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=a.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var e=this.dimension();this.$element[e](this.$element[e]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!a.support.transition)return i.call(this);this.$element[e](0).one("bsTransitionEnd",a.proxy(i,this)).emulateTransitionEnd(r.TRANSITION_DURATION)}}},r.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},r.prototype.getParent=function(){return a(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(t,e){var i=a(e);this.addAriaAndCollapsedClass(n(i),i)},this)).end()},r.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var t=a.fn.collapse;a.fn.collapse=l,a.fn.collapse.Constructor=r,a.fn.collapse.noConflict=function(){return a.fn.collapse=t,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var e=a(this);e.attr("data-target")||t.preventDefault();var i=n(e),o=i.data("bs.collapse")?"toggle":e.data();l.call(i,o)})}(jQuery),function(a){"use strict";var r='[data-toggle="dropdown"]',o=function(t){a(t).on("click.bs.dropdown",this.toggle)};function l(t){var e=t.attr("data-target");e||(e=(e=t.attr("href"))&&/#[A-Za-z]/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i="#"!==e?a(document).find(e):null;return i&&i.length?i:t.parent()}function s(o){o&&3===o.which||(a(".dropdown-backdrop").remove(),a(r).each(function(){var t=a(this),e=l(t),i={relatedTarget:this};e.hasClass("open")&&(o&&"click"==o.type&&/input|textarea/i.test(o.target.tagName)&&a.contains(e[0],o.target)||(e.trigger(o=a.Event("hide.bs.dropdown",i)),o.isDefaultPrevented()||(t.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",i)))))}))}o.VERSION="3.4.1",o.prototype.toggle=function(t){var e=a(this);if(!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(s(),!o){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",s);var n={relatedTarget:this};if(i.trigger(t=a.Event("show.bs.dropdown",n)),t.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),i.toggleClass("open").trigger(a.Event("shown.bs.dropdown",n))}return!1}},o.prototype.keydown=function(t){if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)){var e=a(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(!o&&27!=t.which||o&&27==t.which)return 27==t.which&&i.find(r).trigger("focus"),e.trigger("click");var n=i.find(".dropdown-menu li:not(.disabled):visible a");if(n.length){var s=n.index(t.target);38==t.which&&0<s&&s--,40==t.which&&s<n.length-1&&s++,~s||(s=0),n.eq(s).trigger("focus")}}}};var t=a.fn.dropdown;a.fn.dropdown=function e(i){return this.each(function(){var t=a(this),e=t.data("bs.dropdown");e||t.data("bs.dropdown",e=new o(this)),"string"==typeof i&&e[i].call(t)})},a.fn.dropdown.Constructor=o,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=t,this},a(document).on("click.bs.dropdown.data-api",s).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",r,o.prototype.toggle).on("keydown.bs.dropdown.data-api",r,o.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",o.prototype.keydown)}(jQuery),function(a){"use strict";var s=function(t,e){this.options=e,this.$body=a(document.body),this.$element=a(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom",this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};function r(o,n){return this.each(function(){var t=a(this),e=t.data("bs.modal"),i=a.extend({},s.DEFAULTS,t.data(),"object"==typeof o&&o);e||t.data("bs.modal",e=new s(this,i)),"string"==typeof o?e[o](n):i.show&&e.show(n)})}s.VERSION="3.4.1",s.TRANSITION_DURATION=300,s.BACKDROP_TRANSITION_DURATION=150,s.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},s.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},s.prototype.show=function(i){var o=this,t=a.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(t),this.isShown||t.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(t){a(t.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var t=a.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),t&&o.$element[0].offsetWidth,o.$element.addClass("in"),o.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:i});t?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(s.TRANSITION_DURATION):o.$element.trigger("focus").trigger(e)}))},s.prototype.hide=function(t){t&&t.preventDefault(),t=a.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(s.TRANSITION_DURATION):this.hideModal())},s.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(t){document===t.target||this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},s.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},s.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},s.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},s.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},s.prototype.backdrop=function(t){var e=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=a.support.transition&&i;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(t){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;o?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var n=function(){e.removeBackdrop(),t&&t()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",n).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):n()}else t&&t()},s.prototype.handleUpdate=function(){this.adjustDialog()},s.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},s.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},s.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},s.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";var n=this.scrollbarWidth;this.bodyIsOverflowing&&(this.$body.css("padding-right",t+n),a(this.fixedContent).each(function(t,e){var i=e.style.paddingRight,o=a(e).css("padding-right");a(e).data("padding-right",i).css("padding-right",parseFloat(o)+n+"px")}))},s.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad),a(this.fixedContent).each(function(t,e){var i=a(e).data("padding-right");a(e).removeData("padding-right"),e.style.paddingRight=i||""})},s.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var t=a.fn.modal;a.fn.modal=r,a.fn.modal.Constructor=s,a.fn.modal.noConflict=function(){return a.fn.modal=t,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var e=a(this),i=e.attr("href"),o=e.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,""),n=a(document).find(o),s=n.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(i)&&i},n.data(),e.data());e.is("a")&&t.preventDefault(),n.one("show.bs.modal",function(t){t.isDefaultPrevented()||n.one("hidden.bs.modal",function(){e.is(":visible")&&e.trigger("focus")})}),r.call(n,s,this)})}(jQuery),function(g){"use strict";var o=["sanitize","whiteList","sanitizeFn"],a=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],t={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,l=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function u(t,e){var i=t.nodeName.toLowerCase();if(-1!==g.inArray(i,e))return-1===g.inArray(i,a)||Boolean(t.nodeValue.match(r)||t.nodeValue.match(l));for(var o=g(e).filter(function(t,e){return e instanceof RegExp}),n=0,s=o.length;n<s;n++)if(i.match(o[n]))return!0;return!1}function n(t,e,i){if(0===t.length)return t;if(i&&"function"==typeof i)return i(t);if(!document.implementation||!document.implementation.createHTMLDocument)return t;var o=document.implementation.createHTMLDocument("sanitization");o.body.innerHTML=t;for(var n=g.map(e,function(t,e){return e}),s=g(o.body).find("*"),a=0,r=s.length;a<r;a++){var l=s[a],h=l.nodeName.toLowerCase();if(-1!==g.inArray(h,n))for(var d=g.map(l.attributes,function(t){return t}),p=[].concat(e["*"]||[],e[h]||[]),c=0,f=d.length;c<f;c++)u(d[c],p)||l.removeAttribute(d[c].nodeName);else l.parentNode.removeChild(l)}return o.body.innerHTML}var m=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};m.VERSION="3.4.1",m.TRANSITION_DURATION=150,m.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:t},m.prototype.init=function(t,e,i){if(this.enabled=!0,this.type=t,this.$element=g(e),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&g(document).find(g.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var o=this.options.trigger.split(" "),n=o.length;n--;){var s=o[n];if("click"==s)this.$element.on("click."+this.type,this.options.selector,g.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",r="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,g.proxy(this.enter,this)),this.$element.on(r+"."+this.type,this.options.selector,g.proxy(this.leave,this))}}this.options.selector?this._options=g.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},m.prototype.getDefaults=function(){return m.DEFAULTS},m.prototype.getOptions=function(t){var e=this.$element.data();for(var i in e)e.hasOwnProperty(i)&&-1!==g.inArray(i,o)&&delete e[i];return(t=g.extend({},this.getDefaults(),e,t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t.sanitize&&(t.template=n(t.template,t.whiteList,t.sanitizeFn)),t},m.prototype.getDelegateOptions=function(){var i={},o=this.getDefaults();return this._options&&g.each(this._options,function(t,e){o[t]!=e&&(i[t]=e)}),i},m.prototype.enter=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusin"==t.type?"focus":"hover"]=!0),e.tip().hasClass("in")||"in"==e.hoverState)e.hoverState="in";else{if(clearTimeout(e.timeout),e.hoverState="in",!e.options.delay||!e.options.delay.show)return e.show();e.timeout=setTimeout(function(){"in"==e.hoverState&&e.show()},e.options.delay.show)}},m.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},m.prototype.leave=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusout"==t.type?"focus":"hover"]=!1),!e.isInStateTrue()){if(clearTimeout(e.timeout),e.hoverState="out",!e.options.delay||!e.options.delay.hide)return e.hide();e.timeout=setTimeout(function(){"out"==e.hoverState&&e.hide()},e.options.delay.hide)}},m.prototype.show=function(){var t=g.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var e=g.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!e)return;var i=this,o=this.tip(),n=this.getUID(this.type);this.setContent(),o.attr("id",n),this.$element.attr("aria-describedby",n),this.options.animation&&o.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,r=a.test(s);r&&(s=s.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?o.appendTo(g(document).find(this.options.container)):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var l=this.getPosition(),h=o[0].offsetWidth,d=o[0].offsetHeight;if(r){var p=s,c=this.getPosition(this.$viewport);s="bottom"==s&&l.bottom+d>c.bottom?"top":"top"==s&&l.top-d<c.top?"bottom":"right"==s&&l.right+h>c.width?"left":"left"==s&&l.left-h<c.left?"right":s,o.removeClass(p).addClass(s)}var f=this.getCalculatedOffset(s,l,h,d);this.applyPlacement(f,s);var u=function(){var t=i.hoverState;i.$element.trigger("shown.bs."+i.type),i.hoverState=null,"out"==t&&i.leave(i)};g.support.transition&&this.$tip.hasClass("fade")?o.one("bsTransitionEnd",u).emulateTransitionEnd(m.TRANSITION_DURATION):u()}},m.prototype.applyPlacement=function(t,e){var i=this.tip(),o=i[0].offsetWidth,n=i[0].offsetHeight,s=parseInt(i.css("margin-top"),10),a=parseInt(i.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(a)&&(a=0),t.top+=s,t.left+=a,g.offset.setOffset(i[0],g.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},t),0),i.addClass("in");var r=i[0].offsetWidth,l=i[0].offsetHeight;"top"==e&&l!=n&&(t.top=t.top+n-l);var h=this.getViewportAdjustedDelta(e,t,r,l);h.left?t.left+=h.left:t.top+=h.top;var d=/top|bottom/.test(e),p=d?2*h.left-o+r:2*h.top-n+l,c=d?"offsetWidth":"offsetHeight";i.offset(t),this.replaceArrow(p,i[0][c],d)},m.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},m.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();this.options.html?(this.options.sanitize&&(e=n(e,this.options.whiteList,this.options.sanitizeFn)),t.find(".tooltip-inner").html(e)):t.find(".tooltip-inner").text(e),t.removeClass("fade in top bottom left right")},m.prototype.hide=function(t){var e=this,i=g(this.$tip),o=g.Event("hide.bs."+this.type);function n(){"in"!=e.hoverState&&i.detach(),e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),t&&t()}if(this.$element.trigger(o),!o.isDefaultPrevented())return i.removeClass("in"),g.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",n).emulateTransitionEnd(m.TRANSITION_DURATION):n(),this.hoverState=null,this},m.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},m.prototype.hasContent=function(){return this.getTitle()},m.prototype.getPosition=function(t){var e=(t=t||this.$element)[0],i="BODY"==e.tagName,o=e.getBoundingClientRect();null==o.width&&(o=g.extend({},o,{width:o.right-o.left,height:o.bottom-o.top}));var n=window.SVGElement&&e instanceof window.SVGElement,s=i?{top:0,left:0}:n?null:t.offset(),a={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},r=i?{width:g(window).width(),height:g(window).height()}:null;return g.extend({},o,a,r,s)},m.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},m.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;h<a.left?n.left=a.left-h:d>a.right&&(n.left=a.left+a.width-d)}return n},m.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},m.prototype.getUID=function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},m.prototype.tip=function(){if(!this.$tip&&(this.$tip=g(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},m.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},m.prototype.enable=function(){this.enabled=!0},m.prototype.disable=function(){this.enabled=!1},m.prototype.toggleEnabled=function(){this.enabled=!this.enabled},m.prototype.toggle=function(t){var e=this;t&&((e=g(t.currentTarget).data("bs."+this.type))||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e))),t?(e.inState.click=!e.inState.click,e.isInStateTrue()?e.enter(e):e.leave(e)):e.tip().hasClass("in")?e.leave(e):e.enter(e)},m.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})},m.prototype.sanitizeHtml=function(t){return n(t,this.options.whiteList,this.options.sanitizeFn)};var e=g.fn.tooltip;g.fn.tooltip=function i(o){return this.each(function(){var t=g(this),e=t.data("bs.tooltip"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.tooltip",e=new m(this,i)),"string"==typeof o&&e[o]())})},g.fn.tooltip.Constructor=m,g.fn.tooltip.noConflict=function(){return g.fn.tooltip=e,this}}(jQuery),function(n){"use strict";var s=function(t,e){this.init("popover",t,e)};if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");s.VERSION="3.4.1",s.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),((s.prototype=n.extend({},n.fn.tooltip.Constructor.prototype)).constructor=s).prototype.getDefaults=function(){return s.DEFAULTS},s.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();if(this.options.html){var o=typeof i;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===o&&(i=this.sanitizeHtml(i))),t.find(".popover-title").html(e),t.find(".popover-content").children().detach().end()["string"===o?"html":"append"](i)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(i);t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},s.prototype.hasContent=function(){return this.getTitle()||this.getContent()},s.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var t=n.fn.popover;n.fn.popover=function e(o){return this.each(function(){var t=n(this),e=t.data("bs.popover"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.popover",e=new s(this,i)),"string"==typeof o&&e[o]())})},n.fn.popover.Constructor=s,n.fn.popover.noConflict=function(){return n.fn.popover=t,this}}(jQuery),function(s){"use strict";function n(t,e){this.$body=s(document.body),this.$scrollElement=s(t).is(document.body)?s(window):s(t),this.options=s.extend({},n.DEFAULTS,e),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",s.proxy(this.process,this)),this.refresh(),this.process()}function e(o){return this.each(function(){var t=s(this),e=t.data("bs.scrollspy"),i="object"==typeof o&&o;e||t.data("bs.scrollspy",e=new n(this,i)),"string"==typeof o&&e[o]()})}n.VERSION="3.4.1",n.DEFAULTS={offset:10},n.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},n.prototype.refresh=function(){var t=this,o="offset",n=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),s.isWindow(this.$scrollElement[0])||(o="position",n=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=s(this),e=t.data("target")||t.attr("href"),i=/^#./.test(e)&&s(e);return i&&i.length&&i.is(":visible")&&[[i[o]().top+n,e]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},n.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),o<=e)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e<n[0])return this.activeTarget=null,this.clear();for(t=n.length;t--;)a!=s[t]&&e>=n[t]&&(n[t+1]===undefined||e<n[t+1])&&this.activate(s[t])},n.prototype.activate=function(t){this.activeTarget=t,this.clear();var e=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=s(e).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")},n.prototype.clear=function(){s(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var t=s.fn.scrollspy;s.fn.scrollspy=e,s.fn.scrollspy.Constructor=n,s.fn.scrollspy.noConflict=function(){return s.fn.scrollspy=t,this},s(window).on("load.bs.scrollspy.data-api",function(){s('[data-spy="scroll"]').each(function(){var t=s(this);e.call(t,t.data())})})}(jQuery),function(r){"use strict";var a=function(t){this.element=r(t)};function e(i){return this.each(function(){var t=r(this),e=t.data("bs.tab");e||t.data("bs.tab",e=new a(this)),"string"==typeof i&&e[i]()})}a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target");if(i||(i=(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var o=e.find(".active:last a"),n=r.Event("hide.bs.tab",{relatedTarget:t[0]}),s=r.Event("show.bs.tab",{relatedTarget:o[0]});if(o.trigger(n),t.trigger(s),!s.isDefaultPrevented()&&!n.isDefaultPrevented()){var a=r(document).find(i);this.activate(t.closest("li"),e),this.activate(a,a.parent(),function(){o.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:o[0]})})}}},a.prototype.activate=function(t,e,i){var o=e.find("> .active"),n=i&&r.support.transition&&(o.length&&o.hasClass("fade")||!!e.find("> .fade").length);function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),n?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}o.length&&n?o.one("bsTransitionEnd",s).emulateTransitionEnd(a.TRANSITION_DURATION):s(),o.removeClass("in")};var t=r.fn.tab;r.fn.tab=e,r.fn.tab.Constructor=a,r.fn.tab.noConflict=function(){return r.fn.tab=t,this};var i=function(t){t.preventDefault(),e.call(r(this),"show")};r(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(l){"use strict";var h=function(t,e){this.options=l.extend({},h.DEFAULTS,e);var i=this.options.target===h.DEFAULTS.target?l(this.options.target):l(document).find(this.options.target);this.$target=i.on("scroll.bs.affix.data-api",l.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",l.proxy(this.checkPositionWithEventLoop,this)),this.$element=l(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function i(o){return this.each(function(){var t=l(this),e=t.data("bs.affix"),i="object"==typeof o&&o;e||t.data("bs.affix",e=new h(this,i)),"string"==typeof o&&e[o]()})}h.VERSION="3.4.1",h.RESET="affix affix-top affix-bottom",h.DEFAULTS={offset:0,target:window},h.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return n<i&&"top";if("bottom"==this.affixed)return null!=i?!(n+this.unpin<=s.top)&&"bottom":!(n+a<=t-o)&&"bottom";var r=null==this.affixed,l=r?n:s.top;return null!=i&&n<=i?"top":null!=o&&t-o<=l+(r?a:e)&&"bottom"},h.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(h.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},h.prototype.checkPositionWithEventLoop=function(){setTimeout(l.proxy(this.checkPosition,this),1)},h.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),e=this.options.offset,i=e.top,o=e.bottom,n=Math.max(l(document).height(),l(document.body).height());"object"!=typeof e&&(o=i=e),"function"==typeof i&&(i=e.top(this.$element)),"function"==typeof o&&(o=e.bottom(this.$element));var s=this.getState(n,t,i,o);if(this.affixed!=s){null!=this.unpin&&this.$element.css("top","");var a="affix"+(s?"-"+s:""),r=l.Event(a+".bs.affix");if(this.$element.trigger(r),r.isDefaultPrevented())return;this.affixed=s,this.unpin="bottom"==s?this.getPinnedOffset():null,this.$element.removeClass(h.RESET).addClass(a).trigger(a.replace("affix","affixed")+".bs.affix")}"bottom"==s&&this.$element.offset({top:n-t-o})}};var t=l.fn.affix;l.fn.affix=i,l.fn.affix.Constructor=h,l.fn.affix.noConflict=function(){return l.fn.affix=t,this},l(window).on("load",function(){l('[data-spy="affix"]').each(function(){var t=l(this),e=t.data();e.offset=e.offset||{},null!=e.offsetBottom&&(e.offset.bottom=e.offsetBottom),null!=e.offsetTop&&(e.offset.top=e.offsetTop),i.call(t,e)})})}(jQuery);
  11. define("bootstrap", ["jquery"], function(){});
  12. require.config({
  13. urlArgs: "v=" + requirejs.s.contexts._.config.config.site.version,
  14. packages: [{
  15. name: 'moment',
  16. location: '../libs/moment',
  17. main: 'moment'
  18. }],
  19. //在打包压缩时将会把include中的模块合并到主文件中
  20. include: ['css', 'layer', 'toastr', 'fast', 'frontend', 'frontend-init'],
  21. paths: {
  22. 'lang': "empty:",
  23. 'form': 'require-form',
  24. 'table': 'require-table',
  25. 'upload': 'require-upload',
  26. 'validator': 'require-validator',
  27. 'drag': 'jquery.drag.min',
  28. 'drop': 'jquery.drop.min',
  29. 'dropzone': 'dropzone.min',
  30. 'echarts': 'echarts.min',
  31. 'echarts-theme': 'echarts-theme',
  32. 'adminlte': 'adminlte',
  33. 'bootstrap-table-commonsearch': 'bootstrap-table-commonsearch',
  34. 'bootstrap-table-template': 'bootstrap-table-template',
  35. //
  36. // 以下的包从bower的libs目录加载
  37. 'jquery': '../libs/jquery/dist/jquery.min',
  38. 'bootstrap': '../libs/bootstrap/dist/js/bootstrap.min',
  39. 'bootstrap-datetimepicker': '../libs/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min',
  40. 'bootstrap-daterangepicker': '../libs/bootstrap-daterangepicker/daterangepicker',
  41. 'bootstrap-select': '../libs/bootstrap-select/dist/js/bootstrap-select.min',
  42. 'bootstrap-select-lang': '../libs/bootstrap-select/dist/js/i18n/defaults-zh_CN',
  43. 'bootstrap-table': '../libs/bootstrap-table/dist/bootstrap-table.min',
  44. 'bootstrap-table-export': '../libs/bootstrap-table/dist/extensions/export/bootstrap-table-export.min',
  45. 'bootstrap-table-fixed-columns': '../libs/bootstrap-table/dist/extensions/fixed-columns/bootstrap-table-fixed-columns',
  46. 'bootstrap-table-mobile': '../libs/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile',
  47. 'bootstrap-table-lang': '../libs/bootstrap-table/dist/locale/bootstrap-table-zh-CN',
  48. 'bootstrap-table-jumpto': '../libs/bootstrap-table/dist/extensions/page-jumpto/bootstrap-table-jumpto',
  49. 'tableexport': '../libs/tableExport.jquery.plugin/tableExport.min',
  50. 'dragsort': '../libs/fastadmin-dragsort/jquery.dragsort',
  51. 'sortable': '../libs/Sortable/Sortable.min',
  52. 'addtabs': '../libs/fastadmin-addtabs/jquery.addtabs',
  53. 'slimscroll': '../libs/jquery-slimscroll/jquery.slimscroll',
  54. 'validator-core': '../libs/nice-validator/dist/jquery.validator',
  55. 'validator-lang': '../libs/nice-validator/dist/local/zh-CN',
  56. 'toastr': '../libs/toastr/toastr',
  57. 'jstree': '../libs/jstree/dist/jstree.min',
  58. 'layer': '../libs/fastadmin-layer/dist/layer',
  59. 'cookie': '../libs/jquery.cookie/jquery.cookie',
  60. 'cxselect': '../libs/fastadmin-cxselect/js/jquery.cxselect',
  61. 'template': '../libs/art-template/dist/template-native',
  62. 'selectpage': '../libs/fastadmin-selectpage/selectpage',
  63. 'citypicker': '../libs/fastadmin-citypicker/dist/js/city-picker.min',
  64. 'citypicker-data': '../libs/fastadmin-citypicker/dist/js/city-picker.data'
  65. },
  66. // shim依赖配置
  67. shim: {
  68. 'addons': ['frontend'],
  69. 'bootstrap': ['jquery'],
  70. 'bootstrap-table': {
  71. deps: [
  72. 'bootstrap',
  73. // 'css!../libs/bootstrap-table/dist/bootstrap-table.min.css'
  74. ],
  75. exports: '$.fn.bootstrapTable'
  76. },
  77. 'bootstrap-table-lang': {
  78. deps: ['bootstrap-table'],
  79. exports: '$.fn.bootstrapTable.defaults'
  80. },
  81. 'bootstrap-table-export': {
  82. deps: ['bootstrap-table', 'tableexport'],
  83. exports: '$.fn.bootstrapTable.defaults'
  84. },
  85. 'bootstrap-table-fixed-columns': {
  86. deps: ['bootstrap-table'],
  87. exports: '$.fn.bootstrapTable.defaults'
  88. },
  89. 'bootstrap-table-mobile': {
  90. deps: ['bootstrap-table'],
  91. exports: '$.fn.bootstrapTable.defaults'
  92. },
  93. 'bootstrap-table-advancedsearch': {
  94. deps: ['bootstrap-table'],
  95. exports: '$.fn.bootstrapTable.defaults'
  96. },
  97. 'bootstrap-table-commonsearch': {
  98. deps: ['bootstrap-table'],
  99. exports: '$.fn.bootstrapTable.defaults'
  100. },
  101. 'bootstrap-table-template': {
  102. deps: ['bootstrap-table', 'template'],
  103. exports: '$.fn.bootstrapTable.defaults'
  104. },
  105. 'bootstrap-table-jumpto': {
  106. deps: ['bootstrap-table'],
  107. exports: '$.fn.bootstrapTable.defaults'
  108. },
  109. 'tableexport': {
  110. deps: ['jquery'],
  111. exports: '$.fn.extend'
  112. },
  113. 'slimscroll': {
  114. deps: ['jquery'],
  115. exports: '$.fn.extend'
  116. },
  117. 'adminlte': {
  118. deps: ['bootstrap', 'slimscroll'],
  119. exports: '$.AdminLTE'
  120. },
  121. 'bootstrap-daterangepicker': [
  122. 'moment/locale/zh-cn'
  123. ],
  124. 'bootstrap-datetimepicker': [
  125. 'moment/locale/zh-cn',
  126. // 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
  127. ],
  128. // 'bootstrap-select': ['css!../libs/bootstrap-select/dist/css/bootstrap-select.min.css', ],
  129. 'bootstrap-select-lang': ['bootstrap-select'],
  130. // 'toastr': ['css!../libs/toastr/toastr.min.css'],
  131. 'jstree': ['css!../libs/jstree/dist/themes/default/style.css'],
  132. // 'layer': ['css!../libs/fastadmin-layer/dist/theme/default/layer.css'],
  133. // 'validator-core': ['css!../libs/nice-validator/dist/jquery.validator.css'],
  134. 'validator-lang': ['validator-core'],
  135. // 'selectpage': ['css!../libs/fastadmin-selectpage/selectpage.css'],
  136. 'citypicker': ['citypicker-data', 'css!../libs/fastadmin-citypicker/dist/css/city-picker.css']
  137. },
  138. baseUrl: requirejs.s.contexts._.config.config.site.cdnurl + '/assets/js/', //资源基础路径
  139. map: {
  140. '*': {
  141. 'css': '../libs/require-css/css.min'
  142. }
  143. },
  144. waitSeconds: 30,
  145. charset: 'utf-8' // 文件编码
  146. });
  147. require(['jquery', 'bootstrap'], function ($, undefined) {
  148. //初始配置
  149. var Config = requirejs.s.contexts._.config.config;
  150. //将Config渲染到全局
  151. window.Config = Config;
  152. // 配置语言包的路径
  153. var paths = {};
  154. paths['lang'] = Config.moduleurl + '/ajax/lang?callback=define&controllername=' + Config.controllername + '&lang=' + Config.language + '&v=' + Config.site.version;
  155. // 避免目录冲突
  156. paths['frontend/'] = 'frontend/';
  157. require.config({paths: paths});
  158. // 初始化
  159. $(function () {
  160. require(['fast'], function (Fast) {
  161. require(['frontend', 'frontend-init', 'addons'], function (Frontend, Addons) {
  162. //加载相应模块
  163. if (Config.jsname) {
  164. require([Config.jsname], function (Controller) {
  165. Controller[Config.actionname] != undefined && Controller[Config.actionname]();
  166. }, function (e) {
  167. console.error(e);
  168. // 这里可捕获模块加载的错误
  169. });
  170. }
  171. });
  172. });
  173. });
  174. });
  175. define("require-frontend", function(){});
  176. define('../libs/require-css/css.min',[],function(){if("undefined"==typeof window)return{load:function(a,b,c){c()}};var a=document.getElementsByTagName("head")[0],b=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,c=!1,d=!0;b[1]||b[7]?c=parseInt(b[1])<6||parseInt(b[7])<=9:b[2]||b[8]?d=!1:b[4]&&(c=parseInt(b[4])<18);var e={};e.pluginBuilder="./css-builder";var f,g,h,i=function(){f=document.createElement("style"),a.appendChild(f),g=f.styleSheet||f.sheet},j=0,k=[],l=function(a){g.addImport(a),f.onload=function(){m()},j++,31==j&&(i(),j=0)},m=function(){h();var a=k.shift();return a?(h=a[1],void l(a[0])):void(h=null)},n=function(a,b){if(g&&g.addImport||i(),g&&g.addImport)h?k.push([a,b]):(l(a),h=b);else{f.textContent='@import "'+a+'";';var c=setInterval(function(){try{f.sheet.cssRules,clearInterval(c),b()}catch(a){}},10)}},o=function(b,c){var e=document.createElement("link");if(e.type="text/css",e.rel="stylesheet",d)e.onload=function(){e.onload=function(){},setTimeout(c,7)};else var f=setInterval(function(){for(var a=0;a<document.styleSheets.length;a++){var b=document.styleSheets[a];if(b.href==e.href)return clearInterval(f),c()}},10);e.href=b,a.appendChild(e)};return e.normalize=function(a,b){return".css"==a.substr(a.length-4,4)&&(a=a.substr(0,a.length-4)),b(a)},e.load=function(a,b,d,e){(c?n:o)(b.toUrl(a+".css"),d)},e});
  177. /*! layer-v3.1.4 Web弹层组件 MIT License http://layer.layui.com/ By 贤心 */
  178. ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},f=r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},n.icon!==-1&&n.icon!==t||(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"&#x4FE1;&#x606F;",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,focusBtn:0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'<div class="layui-layer-title" style="'+(f?r.title[1]:"")+'">'+(f?r.title[0]:r.title)+"</div>":"";return r.zIndex=s,t([r.shade?'<div class="layui-layer-shade" id="layui-layer-shade'+a+'" times="'+a+'" style="'+("z-index:"+(s-1)+"; ")+'"></div>':"",'<div class="'+l[0]+(" layui-layer-"+o.type[r.type])+(0!=r.type&&2!=r.type||r.shade?"":" layui-layer-border")+" "+(r.skin||"")+'" id="'+l[0]+a+'" type="'+o.type[r.type]+'" times="'+a+'" showtime="'+r.time+'" conType="'+(e?"object":"string")+'" style="z-index: '+s+"; width:"+r.area[0]+";height:"+r.area[1]+(r.fixed?"":";position:absolute;")+'">'+(e&&2!=r.type?"":u)+'<div id="'+(r.id||"")+'" class="layui-layer-content'+(0==r.type&&r.icon!==-1?" layui-layer-padding":"")+(3==r.type?" layui-layer-loading"+r.icon:"")+'">'+(0==r.type&&r.icon!==-1?'<i class="layui-layer-ico layui-layer-ico'+r.icon+'"></i>':"")+(1==r.type&&e?"":r.content||"")+'</div><span class="layui-layer-setwin">'+function(){var e=c?'<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>':"";return r.closeBtn&&(e+='<a class="layui-layer-ico '+l[7]+" "+l[7]+(r.title?r.closeBtn:4==r.type?"1":"2")+'" href="javascript:;"></a>'),e}()+"</span>"+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t<i;t++)e+='<a class="'+l[6]+t+'" href="javascript:;">'+r.btn[t]+"</a>";return'<div class="'+l[6]+" layui-layer-btn-"+(r.btnAlign||"")+'">'+e+"</div>"}():"")+(r.resize?'<span class="layui-layer-resize"></span>':"")+"</div>"],u,i('<div class="layui-layer-move"></div>')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='<iframe scrolling="'+(t.content[1]||"auto")+'" allowtransparency="true" id="'+l[4]+a+'" name="'+l[4]+a+'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="'+t.content[0]+'"></iframe>';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'<i class="layui-layer-TipsG"></i>',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;a<c.stX&&(a=c.stX),a>f&&(a=f),o<c.stY&&(o=c.stY),o>u&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;if(t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),"number"==typeof a.focusBtn){var s=n.find("."+l[6]).children("a").eq(a.focusBtn);if(s.size()>0){var f=s.position(),c={width:s.outerWidth(),height:s.outerHeight(),left:f.left,top:f.top,marginTop:s.css("marginTop"),marginLeft:s.css("marginLeft")},u=i("<button class='layui-layer-confirm'></button>").css(c);n.find("."+l[6]).after(u),u.focus().click(function(){return s.trigger("click"),!1}).on("focus blur",function(e){s.toggleClass("focus","focus"===e.type)})}}n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'<textarea class="layui-layer-input"'+a+">"+(e.value||"")+"</textarea>":function(){return'<input type="'+(1==e.formType?"password":"text")+'" class="layui-layer-input" value="'+(e.value||"")+'">'}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("&#x6700;&#x591A;&#x8F93;&#x5165;"+(e.maxlength||500)+"&#x4E2A;&#x5B57;&#x6570;",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a='<span class="'+n+'">'+t[0].title+"</span>";i<e;i++)a+="<span>"+t[i].title+"</span>";return a}(),content:'<ul class="layui-layer-tabmain">'+function(){var e=t.length,i=1,a="";if(e>0)for(a='<li class="layui-layer-tabli '+n+'">'+(t[0].content||"no content")+"</li>";i<e;i++)a+='<li class="layui-layer-tabli">'+(t[i].content||"no content")+"</li>";return a}()+"</ul>",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("&#x6CA1;&#x6709;&#x56FE;&#x7247;")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:"shade"in t?t.shade:.9,scrollbar:"scrollbar"in t&&t.scrollbar}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]<r[1]&&(a[0]=a[0]/r[1],a[1]=a[1]/r[1])}return[a[0]+"px",a[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,isOutAnim:!1,skin:"layui-layer-photos"+c("photos"),content:'<div class="layui-layer-phimg"><img src="'+u[d].src+'" alt="'+(u[d].alt||"")+'" layer-pid="'+u[d].pid+'"><div class="layui-layer-imgsee">'+(u.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(a?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(u[d].alt||"")+"</a><em>"+s.imgIndex+"/"+u.length+"</em></span></div></div></div>",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;",{time:3e4,btn:["&#x4E0B;&#x4E00;&#x5F20;","&#x4E0D;&#x770B;&#x4E86;"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define('layer',["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);
  179. /*
  180. * Toastr
  181. * Copyright 2012-2015
  182. * Authors: John Papa, Hans Fjällemark, and Tim Ferrell.
  183. * All Rights Reserved.
  184. * Use, reproduction, distribution, and modification of this code is subject to the terms and
  185. * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php
  186. *
  187. * ARIA Support: Greta Krafsig
  188. *
  189. * Project: https://github.com/CodeSeven/toastr
  190. */
  191. /* global define */
  192. (function (define) {
  193. define('toastr',['jquery'], function ($) {
  194. return (function () {
  195. var $container;
  196. var listener;
  197. var toastId = 0;
  198. var toastType = {
  199. error: 'error',
  200. info: 'info',
  201. success: 'success',
  202. warning: 'warning'
  203. };
  204. var toastr = {
  205. clear: clear,
  206. remove: remove,
  207. error: error,
  208. getContainer: getContainer,
  209. info: info,
  210. options: {},
  211. subscribe: subscribe,
  212. success: success,
  213. version: '2.1.3',
  214. warning: warning
  215. };
  216. var previousToast;
  217. return toastr;
  218. ////////////////
  219. function error(message, title, optionsOverride) {
  220. return notify({
  221. type: toastType.error,
  222. iconClass: getOptions().iconClasses.error,
  223. message: message,
  224. optionsOverride: optionsOverride,
  225. title: title
  226. });
  227. }
  228. function getContainer(options, create) {
  229. if (!options) { options = getOptions(); }
  230. $container = $('#' + options.containerId);
  231. if ($container.length) {
  232. return $container;
  233. }
  234. if (create) {
  235. $container = createContainer(options);
  236. }
  237. return $container;
  238. }
  239. function info(message, title, optionsOverride) {
  240. return notify({
  241. type: toastType.info,
  242. iconClass: getOptions().iconClasses.info,
  243. message: message,
  244. optionsOverride: optionsOverride,
  245. title: title
  246. });
  247. }
  248. function subscribe(callback) {
  249. listener = callback;
  250. }
  251. function success(message, title, optionsOverride) {
  252. return notify({
  253. type: toastType.success,
  254. iconClass: getOptions().iconClasses.success,
  255. message: message,
  256. optionsOverride: optionsOverride,
  257. title: title
  258. });
  259. }
  260. function warning(message, title, optionsOverride) {
  261. return notify({
  262. type: toastType.warning,
  263. iconClass: getOptions().iconClasses.warning,
  264. message: message,
  265. optionsOverride: optionsOverride,
  266. title: title
  267. });
  268. }
  269. function clear($toastElement, clearOptions) {
  270. var options = getOptions();
  271. if (!$container) { getContainer(options); }
  272. if (!clearToast($toastElement, options, clearOptions)) {
  273. clearContainer(options);
  274. }
  275. }
  276. function remove($toastElement) {
  277. var options = getOptions();
  278. if (!$container) { getContainer(options); }
  279. if ($toastElement && $(':focus', $toastElement).length === 0) {
  280. removeToast($toastElement);
  281. return;
  282. }
  283. if ($container.children().length) {
  284. $container.remove();
  285. }
  286. }
  287. // internal functions
  288. function clearContainer (options) {
  289. var toastsToClear = $container.children();
  290. for (var i = toastsToClear.length - 1; i >= 0; i--) {
  291. clearToast($(toastsToClear[i]), options);
  292. }
  293. }
  294. function clearToast ($toastElement, options, clearOptions) {
  295. var force = clearOptions && clearOptions.force ? clearOptions.force : false;
  296. if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {
  297. $toastElement[options.hideMethod]({
  298. duration: options.hideDuration,
  299. easing: options.hideEasing,
  300. complete: function () { removeToast($toastElement); }
  301. });
  302. return true;
  303. }
  304. return false;
  305. }
  306. function createContainer(options) {
  307. $container = $('<div/>')
  308. .attr('id', options.containerId)
  309. .addClass(options.positionClass);
  310. $container.appendTo($(options.target));
  311. return $container;
  312. }
  313. function getDefaults() {
  314. return {
  315. tapToDismiss: true,
  316. toastClass: 'toast',
  317. containerId: 'toast-container',
  318. debug: false,
  319. showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery
  320. showDuration: 300,
  321. showEasing: 'swing', //swing and linear are built into jQuery
  322. onShown: undefined,
  323. hideMethod: 'fadeOut',
  324. hideDuration: 1000,
  325. hideEasing: 'swing',
  326. onHidden: undefined,
  327. closeMethod: false,
  328. closeDuration: false,
  329. closeEasing: false,
  330. closeOnHover: true,
  331. extendedTimeOut: 1000,
  332. iconClasses: {
  333. error: 'toast-error',
  334. info: 'toast-info',
  335. success: 'toast-success',
  336. warning: 'toast-warning'
  337. },
  338. iconClass: 'toast-info',
  339. positionClass: 'toast-top-right',
  340. timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky
  341. titleClass: 'toast-title',
  342. messageClass: 'toast-message',
  343. escapeHtml: false,
  344. target: 'body',
  345. closeHtml: '<button type="button">&times;</button>',
  346. closeClass: 'toast-close-button',
  347. newestOnTop: true,
  348. preventDuplicates: false,
  349. progressBar: false,
  350. progressClass: 'toast-progress',
  351. rtl: false
  352. };
  353. }
  354. function publish(args) {
  355. if (!listener) { return; }
  356. listener(args);
  357. }
  358. function notify(map) {
  359. var options = getOptions();
  360. var iconClass = map.iconClass || options.iconClass;
  361. if (typeof (map.optionsOverride) !== 'undefined') {
  362. options = $.extend(options, map.optionsOverride);
  363. iconClass = map.optionsOverride.iconClass || iconClass;
  364. }
  365. if (shouldExit(options, map)) { return; }
  366. toastId++;
  367. $container = getContainer(options, true);
  368. var intervalId = null;
  369. var $toastElement = $('<div/>');
  370. var $titleElement = $('<div/>');
  371. var $messageElement = $('<div/>');
  372. var $progressElement = $('<div/>');
  373. var $closeElement = $(options.closeHtml);
  374. var progressBar = {
  375. intervalId: null,
  376. hideEta: null,
  377. maxHideTime: null
  378. };
  379. var response = {
  380. toastId: toastId,
  381. state: 'visible',
  382. startTime: new Date(),
  383. options: options,
  384. map: map
  385. };
  386. personalizeToast();
  387. displayToast();
  388. handleEvents();
  389. publish(response);
  390. if (options.debug && console) {
  391. console.log(response);
  392. }
  393. return $toastElement;
  394. function escapeHtml(source) {
  395. if (source == null) {
  396. source = '';
  397. }
  398. return source
  399. .replace(/&/g, '&amp;')
  400. .replace(/"/g, '&quot;')
  401. .replace(/'/g, '&#39;')
  402. .replace(/</g, '&lt;')
  403. .replace(/>/g, '&gt;');
  404. }
  405. function personalizeToast() {
  406. setIcon();
  407. setTitle();
  408. setMessage();
  409. setCloseButton();
  410. setProgressBar();
  411. setRTL();
  412. setSequence();
  413. setAria();
  414. }
  415. function setAria() {
  416. var ariaValue = '';
  417. switch (map.iconClass) {
  418. case 'toast-success':
  419. case 'toast-info':
  420. ariaValue = 'polite';
  421. break;
  422. default:
  423. ariaValue = 'assertive';
  424. }
  425. $toastElement.attr('aria-live', ariaValue);
  426. }
  427. function handleEvents() {
  428. if (options.closeOnHover) {
  429. $toastElement.hover(stickAround, delayedHideToast);
  430. }
  431. if (!options.onclick && options.tapToDismiss) {
  432. $toastElement.click(hideToast);
  433. }
  434. if (options.closeButton && $closeElement) {
  435. $closeElement.click(function (event) {
  436. if (event.stopPropagation) {
  437. event.stopPropagation();
  438. } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {
  439. event.cancelBubble = true;
  440. }
  441. if (options.onCloseClick) {
  442. options.onCloseClick(event);
  443. }
  444. hideToast(true);
  445. });
  446. }
  447. if (options.onclick) {
  448. $toastElement.click(function (event) {
  449. options.onclick(event);
  450. hideToast();
  451. });
  452. }
  453. }
  454. function displayToast() {
  455. $toastElement.hide();
  456. $toastElement[options.showMethod](
  457. {duration: options.showDuration, easing: options.showEasing, complete: options.onShown}
  458. );
  459. if (options.timeOut > 0) {
  460. intervalId = setTimeout(hideToast, options.timeOut);
  461. progressBar.maxHideTime = parseFloat(options.timeOut);
  462. progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
  463. if (options.progressBar) {
  464. progressBar.intervalId = setInterval(updateProgress, 10);
  465. }
  466. }
  467. }
  468. function setIcon() {
  469. if (map.iconClass) {
  470. $toastElement.addClass(options.toastClass).addClass(iconClass);
  471. }
  472. }
  473. function setSequence() {
  474. if (options.newestOnTop) {
  475. $container.prepend($toastElement);
  476. } else {
  477. $container.append($toastElement);
  478. }
  479. }
  480. function setTitle() {
  481. if (map.title) {
  482. var suffix = map.title;
  483. if (options.escapeHtml) {
  484. suffix = escapeHtml(map.title);
  485. }
  486. $titleElement.append(suffix).addClass(options.titleClass);
  487. $toastElement.append($titleElement);
  488. }
  489. }
  490. function setMessage() {
  491. if (map.message) {
  492. var suffix = map.message;
  493. if (options.escapeHtml) {
  494. suffix = escapeHtml(map.message);
  495. }
  496. $messageElement.append(suffix).addClass(options.messageClass);
  497. $toastElement.append($messageElement);
  498. }
  499. }
  500. function setCloseButton() {
  501. if (options.closeButton) {
  502. $closeElement.addClass(options.closeClass).attr('role', 'button');
  503. $toastElement.prepend($closeElement);
  504. }
  505. }
  506. function setProgressBar() {
  507. if (options.progressBar) {
  508. $progressElement.addClass(options.progressClass);
  509. $toastElement.prepend($progressElement);
  510. }
  511. }
  512. function setRTL() {
  513. if (options.rtl) {
  514. $toastElement.addClass('rtl');
  515. }
  516. }
  517. function shouldExit(options, map) {
  518. if (options.preventDuplicates) {
  519. if (map.message === previousToast) {
  520. return true;
  521. } else {
  522. previousToast = map.message;
  523. }
  524. }
  525. return false;
  526. }
  527. function hideToast(override) {
  528. var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod;
  529. var duration = override && options.closeDuration !== false ?
  530. options.closeDuration : options.hideDuration;
  531. var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing;
  532. if ($(':focus', $toastElement).length && !override) {
  533. return;
  534. }
  535. clearTimeout(progressBar.intervalId);
  536. return $toastElement[method]({
  537. duration: duration,
  538. easing: easing,
  539. complete: function () {
  540. removeToast($toastElement);
  541. clearTimeout(intervalId);
  542. if (options.onHidden && response.state !== 'hidden') {
  543. options.onHidden();
  544. }
  545. response.state = 'hidden';
  546. response.endTime = new Date();
  547. publish(response);
  548. }
  549. });
  550. }
  551. function delayedHideToast() {
  552. if (options.timeOut > 0 || options.extendedTimeOut > 0) {
  553. intervalId = setTimeout(hideToast, options.extendedTimeOut);
  554. progressBar.maxHideTime = parseFloat(options.extendedTimeOut);
  555. progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
  556. }
  557. }
  558. function stickAround() {
  559. clearTimeout(intervalId);
  560. progressBar.hideEta = 0;
  561. $toastElement.stop(true, true)[options.showMethod](
  562. {duration: options.showDuration, easing: options.showEasing}
  563. );
  564. }
  565. function updateProgress() {
  566. var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;
  567. $progressElement.width(percentage + '%');
  568. }
  569. }
  570. function getOptions() {
  571. return $.extend({}, getDefaults(), toastr.options);
  572. }
  573. function removeToast($toastElement) {
  574. if (!$container) { $container = getContainer(); }
  575. if ($toastElement.is(':visible')) {
  576. return;
  577. }
  578. $toastElement.remove();
  579. $toastElement = null;
  580. if ($container.children().length === 0) {
  581. $container.remove();
  582. previousToast = undefined;
  583. }
  584. }
  585. })();
  586. });
  587. }(typeof define === 'function' && define.amd ? define : function (deps, factory) {
  588. if (typeof module !== 'undefined' && module.exports) { //Node
  589. module.exports = factory(require('jquery'));
  590. } else {
  591. window.toastr = factory(window.jQuery);
  592. }
  593. }));
  594. define('fast',['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, undefined, Toastr, Layer, Lang) {
  595. var Fast = {
  596. config: {
  597. //toastr默认配置
  598. toastr: {
  599. "closeButton": true,
  600. "debug": false,
  601. "newestOnTop": false,
  602. "progressBar": false,
  603. "positionClass": "toast-top-center",
  604. "preventDuplicates": false,
  605. "onclick": null,
  606. "showDuration": "300",
  607. "hideDuration": "1000",
  608. "timeOut": "5000",
  609. "extendedTimeOut": "1000",
  610. "showEasing": "swing",
  611. "hideEasing": "linear",
  612. "showMethod": "fadeIn",
  613. "hideMethod": "fadeOut"
  614. }
  615. },
  616. events: {
  617. //请求成功的回调
  618. onAjaxSuccess: function (ret, onAjaxSuccess) {
  619. var data = typeof ret.data !== 'undefined' ? ret.data : null;
  620. var msg = typeof ret.msg !== 'undefined' && ret.msg ? ret.msg : __('Operation completed');
  621. if (typeof onAjaxSuccess === 'function') {
  622. var result = onAjaxSuccess.call(this, data, ret);
  623. if (result === false)
  624. return;
  625. }
  626. Toastr.success(msg);
  627. },
  628. //请求错误的回调
  629. onAjaxError: function (ret, onAjaxError) {
  630. var data = typeof ret.data !== 'undefined' ? ret.data : null;
  631. if (typeof onAjaxError === 'function') {
  632. var result = onAjaxError.call(this, data, ret);
  633. if (result === false) {
  634. return;
  635. }
  636. }
  637. Toastr.error(ret.msg);
  638. },
  639. //服务器响应数据后
  640. onAjaxResponse: function (response) {
  641. try {
  642. var ret = typeof response === 'object' ? response : JSON.parse(response);
  643. if (!ret.hasOwnProperty('code')) {
  644. $.extend(ret, {code: -2, msg: response, data: null});
  645. }
  646. } catch (e) {
  647. var ret = {code: -1, msg: e.message, data: null};
  648. }
  649. return ret;
  650. }
  651. },
  652. api: {
  653. //发送Ajax请求
  654. ajax: function (options, success, error) {
  655. options = typeof options === 'string' ? {url: options} : options;
  656. var index;
  657. if (typeof options.loading === 'undefined' || options.loading) {
  658. index = Layer.load(options.loading || 0);
  659. }
  660. options = $.extend({
  661. type: "POST",
  662. dataType: "json",
  663. xhrFields: {
  664. withCredentials: true
  665. },
  666. success: function (ret) {
  667. index && Layer.close(index);
  668. ret = Fast.events.onAjaxResponse(ret);
  669. if (ret.code === 1) {
  670. Fast.events.onAjaxSuccess(ret, success);
  671. } else {
  672. Fast.events.onAjaxError(ret, error);
  673. }
  674. },
  675. error: function (xhr) {
  676. index && Layer.close(index);
  677. var ret = {code: xhr.status, msg: xhr.statusText, data: null};
  678. Fast.events.onAjaxError(ret, error);
  679. }
  680. }, options);
  681. return $.ajax(options);
  682. },
  683. //修复URL
  684. fixurl: function (url) {
  685. if (url.substr(0, 1) !== "/") {
  686. var r = new RegExp('^(?:[a-z]+:)?//', 'i');
  687. if (!r.test(url)) {
  688. url = Config.moduleurl + "/" + url;
  689. }
  690. } else if (url.substr(0, 8) === "/addons/") {
  691. url = Config.__PUBLIC__.replace(/(\/*$)/g, "") + url;
  692. }
  693. return url;
  694. },
  695. //获取修复后可访问的cdn链接
  696. cdnurl: function (url, domain) {
  697. var rule = new RegExp("^((?:[a-z]+:)?\\/\\/|data:image\\/)", "i");
  698. var url = rule.test(url) ? url : Config.upload.cdnurl + url;
  699. if (domain && !rule.test(url)) {
  700. domain = typeof domain === 'string' ? domain : location.origin;
  701. url = domain + url;
  702. }
  703. return url;
  704. },
  705. //查询Url参数
  706. query: function (name, url) {
  707. if (!url) {
  708. url = window.location.href;
  709. }
  710. name = name.replace(/[\[\]]/g, "\\$&");
  711. var regex = new RegExp("[?&/]" + name + "([=/]([^&#/?]*)|&|#|$)"),
  712. results = regex.exec(url);
  713. if (!results)
  714. return null;
  715. if (!results[2])
  716. return '';
  717. return decodeURIComponent(results[2].replace(/\+/g, " "));
  718. },
  719. //打开一个弹出窗口
  720. open: function (url, title, options) {
  721. title = options && options.title ? options.title : (title ? title : "");
  722. url = Fast.api.fixurl(url);
  723. url = url + (url.indexOf("?") > -1 ? "&" : "?") + "dialog=1";
  724. var area = Fast.config.openArea != undefined ? Fast.config.openArea : [$(window).width() > 800 ? '800px' : '95%', $(window).height() > 600 ? '600px' : '95%'];
  725. options = $.extend({
  726. type: 2,
  727. title: title,
  728. shadeClose: true,
  729. shade: false,
  730. maxmin: true,
  731. moveOut: true,
  732. area: area,
  733. content: url,
  734. zIndex: Layer.zIndex,
  735. success: function (layero, index) {
  736. var that = this;
  737. //存储callback事件
  738. $(layero).data("callback", that.callback);
  739. //$(layero).removeClass("layui-layer-border");
  740. Layer.setTop(layero);
  741. try {
  742. var frame = Layer.getChildFrame('html', index);
  743. var layerfooter = frame.find(".layer-footer");
  744. Fast.api.layerfooter(layero, index, that);
  745. //绑定事件
  746. if (layerfooter.size() > 0) {
  747. // 监听窗口内的元素及属性变化
  748. // Firefox和Chrome早期版本中带有前缀
  749. var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  750. if (MutationObserver) {
  751. // 选择目标节点
  752. var target = layerfooter[0];
  753. // 创建观察者对象
  754. var observer = new MutationObserver(function (mutations) {
  755. Fast.api.layerfooter(layero, index, that);
  756. mutations.forEach(function (mutation) {
  757. });
  758. });
  759. // 配置观察选项:
  760. var config = {attributes: true, childList: true, characterData: true, subtree: true}
  761. // 传入目标节点和观察选项
  762. observer.observe(target, config);
  763. // 随后,你还可以停止观察
  764. // observer.disconnect();
  765. }
  766. }
  767. } catch (e) {
  768. }
  769. if ($(layero).height() > $(window).height()) {
  770. //当弹出窗口大于浏览器可视高度时,重定位
  771. Layer.style(index, {
  772. top: 0,
  773. height: $(window).height()
  774. });
  775. }
  776. }
  777. }, options ? options : {});
  778. if ($(window).width() < 480 || (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream && top.$(".tab-pane.active").size() > 0)) {
  779. options.area = [top.$(".tab-pane.active").width() + "px", top.$(".tab-pane.active").height() + "px"];
  780. options.offset = [top.$(".tab-pane.active").scrollTop() + "px", "0px"];
  781. }
  782. return Layer.open(options);
  783. },
  784. //关闭窗口并回传数据
  785. close: function (data) {
  786. var index = parent.Layer.getFrameIndex(window.name);
  787. var callback = parent.$("#layui-layer" + index).data("callback");
  788. //再执行关闭
  789. parent.Layer.close(index);
  790. //再调用回传函数
  791. if (typeof callback === 'function') {
  792. callback.call(undefined, data);
  793. }
  794. },
  795. layerfooter: function (layero, index, that) {
  796. var frame = Layer.getChildFrame('html', index);
  797. var layerfooter = frame.find(".layer-footer");
  798. if (layerfooter.size() > 0) {
  799. $(".layui-layer-footer", layero).remove();
  800. var footer = $("<div />").addClass('layui-layer-btn layui-layer-footer');
  801. footer.html(layerfooter.html());
  802. if ($(".row", footer).size() === 0) {
  803. $(">", footer).wrapAll("<div class='row'></div>");
  804. }
  805. footer.insertAfter(layero.find('.layui-layer-content'));
  806. //绑定事件
  807. footer.on("click", ".btn", function () {
  808. if ($(this).hasClass("disabled") || $(this).parent().hasClass("disabled")) {
  809. return;
  810. }
  811. var index = footer.find('.btn').index(this);
  812. $(".btn:eq(" + index + ")", layerfooter).trigger("click");
  813. });
  814. var titHeight = layero.find('.layui-layer-title').outerHeight() || 0;
  815. var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
  816. //重设iframe高度
  817. $("iframe", layero).height(layero.height() - titHeight - btnHeight);
  818. }
  819. //修复iOS下弹出窗口的高度和iOS下iframe无法滚动的BUG
  820. if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
  821. var titHeight = layero.find('.layui-layer-title').outerHeight() || 0;
  822. var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
  823. $("iframe", layero).parent().css("height", layero.height() - titHeight - btnHeight);
  824. $("iframe", layero).css("height", "100%");
  825. }
  826. },
  827. success: function (options, callback) {
  828. var type = typeof options === 'function';
  829. if (type) {
  830. callback = options;
  831. }
  832. return Layer.msg(__('Operation completed'), $.extend({
  833. offset: 0, icon: 1
  834. }, type ? {} : options), callback);
  835. },
  836. error: function (options, callback) {
  837. var type = typeof options === 'function';
  838. if (type) {
  839. callback = options;
  840. }
  841. return Layer.msg(__('Operation failed'), $.extend({
  842. offset: 0, icon: 2
  843. }, type ? {} : options), callback);
  844. },
  845. msg: function (message, url) {
  846. var callback = typeof url === 'function' ? url : function () {
  847. if (typeof url !== 'undefined' && url) {
  848. location.href = url;
  849. }
  850. };
  851. Layer.msg(message, {
  852. time: 2000
  853. }, callback);
  854. },
  855. toastr: Toastr,
  856. layer: Layer
  857. },
  858. lang: function () {
  859. var args = arguments,
  860. string = args[0],
  861. i = 1;
  862. string = string.toLowerCase();
  863. //string = typeof Lang[string] != 'undefined' ? Lang[string] : string;
  864. if (typeof Lang !== 'undefined' && typeof Lang[string] !== 'undefined') {
  865. if (typeof Lang[string] == 'object')
  866. return Lang[string];
  867. string = Lang[string];
  868. } else if (string.indexOf('.') !== -1 && false) {
  869. var arr = string.split('.');
  870. var current = Lang[arr[0]];
  871. for (var i = 1; i < arr.length; i++) {
  872. current = typeof current[arr[i]] != 'undefined' ? current[arr[i]] : '';
  873. if (typeof current != 'object')
  874. break;
  875. }
  876. if (typeof current == 'object')
  877. return current;
  878. string = current;
  879. } else {
  880. string = args[0];
  881. }
  882. return string.replace(/%((%)|s|d)/g, function (m) {
  883. // m is the matched format, e.g. %s, %d
  884. var val = null;
  885. if (m[2]) {
  886. val = m[2];
  887. } else {
  888. val = args[i];
  889. // A switch statement so that the formatter can be extended. Default is %s
  890. switch (m) {
  891. case '%d':
  892. val = parseFloat(val);
  893. if (isNaN(val)) {
  894. val = 0;
  895. }
  896. break;
  897. }
  898. i++;
  899. }
  900. return val;
  901. });
  902. },
  903. init: function () {
  904. // 对相对地址进行处理
  905. $.ajaxSetup({
  906. beforeSend: function (xhr, setting) {
  907. setting.url = Fast.api.fixurl(setting.url);
  908. }
  909. });
  910. Layer.config({
  911. skin: 'layui-layer-fast'
  912. });
  913. // 绑定ESC关闭窗口事件
  914. $(window).keyup(function (e) {
  915. if (e.keyCode == 27) {
  916. if ($(".layui-layer").size() > 0) {
  917. var index = 0;
  918. $(".layui-layer").each(function () {
  919. index = Math.max(index, parseInt($(this).attr("times")));
  920. });
  921. if (index) {
  922. Layer.close(index);
  923. }
  924. }
  925. }
  926. });
  927. //公共代码
  928. //配置Toastr的参数
  929. Toastr.options = Fast.config.toastr;
  930. }
  931. };
  932. //将Layer暴露到全局中去
  933. window.Layer = Layer;
  934. //将Toastr暴露到全局中去
  935. window.Toastr = Toastr;
  936. //将语言方法暴露到全局中去
  937. window.__ = Fast.lang;
  938. //将Fast渲染至全局
  939. window.Fast = Fast;
  940. //默认初始化执行的代码
  941. Fast.init();
  942. return Fast;
  943. });
  944. /*!art-template - Template Engine | http://aui.github.com/artTemplate/*/
  945. !function(){function a(a){return a.replace(t,"").replace(u,",").replace(v,"").replace(w,"").replace(x,"").split(y)}function b(a){return"'"+a.replace(/('|\\)/g,"\\$1").replace(/\r/g,"\\r").replace(/\n/g,"\\n")+"'"}function c(c,d){function e(a){return m+=a.split(/\n/).length-1,k&&(a=a.replace(/\s+/g," ").replace(/<!--[\w\W]*?-->/g,"")),a&&(a=s[1]+b(a)+s[2]+"\n"),a}function f(b){var c=m;if(j?b=j(b,d):g&&(b=b.replace(/\n/g,function(){return m++,"$line="+m+";"})),0===b.indexOf("=")){var e=l&&!/^=[=#]/.test(b);if(b=b.replace(/^=[=#]?|[\s;]*$/g,""),e){var f=b.replace(/\s*\([^\)]+\)/,"");n[f]||/^(include|print)$/.test(f)||(b="$escape("+b+")")}else b="$string("+b+")";b=s[1]+b+s[2]}return g&&(b="$line="+c+";"+b),r(a(b),function(a){if(a&&!p[a]){var b;b="print"===a?u:"include"===a?v:n[a]?"$utils."+a:o[a]?"$helpers."+a:"$data."+a,w+=a+"="+b+",",p[a]=!0}}),b+"\n"}var g=d.debug,h=d.openTag,i=d.closeTag,j=d.parser,k=d.compress,l=d.escape,m=1,p={$data:1,$filename:1,$utils:1,$helpers:1,$out:1,$line:1},q="".trim,s=q?["$out='';","$out+=",";","$out"]:["$out=[];","$out.push(",");","$out.join('')"],t=q?"$out+=text;return $out;":"$out.push(text);",u="function(){var text=''.concat.apply('',arguments);"+t+"}",v="function(filename,data){data=data||$data;var text=$utils.$include(filename,data,$filename);"+t+"}",w="'use strict';var $utils=this,$helpers=$utils.$helpers,"+(g?"$line=0,":""),x=s[0],y="return new String("+s[3]+");";r(c.split(h),function(a){a=a.split(i);var b=a[0],c=a[1];1===a.length?x+=e(b):(x+=f(b),c&&(x+=e(c)))});var z=w+x+y;g&&(z="try{"+z+"}catch(e){throw {filename:$filename,name:'Render Error',message:e.message,line:$line,source:"+b(c)+".split(/\\n/)[$line-1].replace(/^\\s+/,'')};}");try{var A=new Function("$data","$filename",z);return A.prototype=n,A}catch(a){throw a.temp="function anonymous($data,$filename) {"+z+"}",a}}var d=function(a,b){return"string"==typeof b?q(b,{filename:a}):g(a,b)};d.version="3.0.0",d.config=function(a,b){e[a]=b};var e=d.defaults={openTag:"<%",closeTag:"%>",escape:!0,cache:!0,compress:!1,parser:null},f=d.cache={};d.render=function(a,b){return q(a)(b)};var g=d.renderFile=function(a,b){var c=d.get(a)||p({filename:a,name:"Render Error",message:"Template not found"});return b?c(b):c};d.get=function(a){var b;if(f[a])b=f[a];else if("object"==typeof document){var c=document.getElementById(a);if(c){var d=(c.value||c.innerHTML).replace(/^\s*|\s*$/g,"");b=q(d,{filename:a})}}return b};var h=function(a,b){return"string"!=typeof a&&(b=typeof a,"number"===b?a+="":a="function"===b?h(a.call(a)):""),a},i={"<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","&":"&#38;"},j=function(a){return i[a]},k=function(a){return h(a).replace(/&(?![\w#]+;)|[<>"']/g,j)},l=Array.isArray||function(a){return"[object Array]"==={}.toString.call(a)},m=function(a,b){var c,d;if(l(a))for(c=0,d=a.length;c<d;c++)b.call(a,a[c],c,a);else for(c in a)b.call(a,a[c],c)},n=d.utils={$helpers:{},$include:g,$string:h,$escape:k,$each:m};d.helper=function(a,b){o[a]=b};var o=d.helpers=n.$helpers;d.onerror=function(a){var b="Template Error\n\n";for(var c in a)b+="<"+c+">\n"+a[c]+"\n\n";"object"==typeof console&&console.error(b)};var p=function(a){return d.onerror(a),function(){return"{Template Error}"}},q=d.compile=function(a,b){function d(c){try{return new i(c,h)+""}catch(d){return b.debug?p(d)():(b.debug=!0,q(a,b)(c))}}b=b||{};for(var g in e)void 0===b[g]&&(b[g]=e[g]);var h=b.filename;try{var i=c(a,b)}catch(a){return a.filename=h||"anonymous",a.name="Syntax Error",p(a)}return d.prototype=i.prototype,d.toString=function(){return i.toString()},h&&b.cache&&(f[h]=d),d},r=n.$each,s="break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile,arguments,let,yield,undefined",t=/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|\s*\.\s*[$\w\.]+/g,u=/[^\w$]+/g,v=new RegExp(["\\b"+s.replace(/,/g,"\\b|\\b")+"\\b"].join("|"),"g"),w=/^\d[^,]*|,\d[^,]*/g,x=/^,+|,+$/g,y=/^$|,+/;"object"==typeof exports&&"undefined"!=typeof module?module.exports=d:"function"==typeof define?define('template',[],function(){return d}):this.template=d}();
  946. //! moment.js
  947. //! version : 2.26.0
  948. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  949. //! license : MIT
  950. //! momentjs.com
  951. ;(function (global, factory) {
  952. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  953. typeof define === 'function' && define.amd ? define('moment/moment',factory) :
  954. global.moment = factory()
  955. }(this, (function () { 'use strict';
  956. var hookCallback;
  957. function hooks() {
  958. return hookCallback.apply(null, arguments);
  959. }
  960. // This is done to register the method called with moment()
  961. // without creating circular dependencies.
  962. function setHookCallback(callback) {
  963. hookCallback = callback;
  964. }
  965. function isArray(input) {
  966. return (
  967. input instanceof Array ||
  968. Object.prototype.toString.call(input) === '[object Array]'
  969. );
  970. }
  971. function isObject(input) {
  972. // IE8 will treat undefined and null as object if it wasn't for
  973. // input != null
  974. return (
  975. input != null &&
  976. Object.prototype.toString.call(input) === '[object Object]'
  977. );
  978. }
  979. function hasOwnProp(a, b) {
  980. return Object.prototype.hasOwnProperty.call(a, b);
  981. }
  982. function isObjectEmpty(obj) {
  983. if (Object.getOwnPropertyNames) {
  984. return Object.getOwnPropertyNames(obj).length === 0;
  985. } else {
  986. var k;
  987. for (k in obj) {
  988. if (hasOwnProp(obj, k)) {
  989. return false;
  990. }
  991. }
  992. return true;
  993. }
  994. }
  995. function isUndefined(input) {
  996. return input === void 0;
  997. }
  998. function isNumber(input) {
  999. return (
  1000. typeof input === 'number' ||
  1001. Object.prototype.toString.call(input) === '[object Number]'
  1002. );
  1003. }
  1004. function isDate(input) {
  1005. return (
  1006. input instanceof Date ||
  1007. Object.prototype.toString.call(input) === '[object Date]'
  1008. );
  1009. }
  1010. function map(arr, fn) {
  1011. var res = [],
  1012. i;
  1013. for (i = 0; i < arr.length; ++i) {
  1014. res.push(fn(arr[i], i));
  1015. }
  1016. return res;
  1017. }
  1018. function extend(a, b) {
  1019. for (var i in b) {
  1020. if (hasOwnProp(b, i)) {
  1021. a[i] = b[i];
  1022. }
  1023. }
  1024. if (hasOwnProp(b, 'toString')) {
  1025. a.toString = b.toString;
  1026. }
  1027. if (hasOwnProp(b, 'valueOf')) {
  1028. a.valueOf = b.valueOf;
  1029. }
  1030. return a;
  1031. }
  1032. function createUTC(input, format, locale, strict) {
  1033. return createLocalOrUTC(input, format, locale, strict, true).utc();
  1034. }
  1035. function defaultParsingFlags() {
  1036. // We need to deep clone this object.
  1037. return {
  1038. empty: false,
  1039. unusedTokens: [],
  1040. unusedInput: [],
  1041. overflow: -2,
  1042. charsLeftOver: 0,
  1043. nullInput: false,
  1044. invalidEra: null,
  1045. invalidMonth: null,
  1046. invalidFormat: false,
  1047. userInvalidated: false,
  1048. iso: false,
  1049. parsedDateParts: [],
  1050. era: null,
  1051. meridiem: null,
  1052. rfc2822: false,
  1053. weekdayMismatch: false,
  1054. };
  1055. }
  1056. function getParsingFlags(m) {
  1057. if (m._pf == null) {
  1058. m._pf = defaultParsingFlags();
  1059. }
  1060. return m._pf;
  1061. }
  1062. var some;
  1063. if (Array.prototype.some) {
  1064. some = Array.prototype.some;
  1065. } else {
  1066. some = function (fun) {
  1067. var t = Object(this),
  1068. len = t.length >>> 0,
  1069. i;
  1070. for (i = 0; i < len; i++) {
  1071. if (i in t && fun.call(this, t[i], i, t)) {
  1072. return true;
  1073. }
  1074. }
  1075. return false;
  1076. };
  1077. }
  1078. function isValid(m) {
  1079. if (m._isValid == null) {
  1080. var flags = getParsingFlags(m),
  1081. parsedParts = some.call(flags.parsedDateParts, function (i) {
  1082. return i != null;
  1083. }),
  1084. isNowValid =
  1085. !isNaN(m._d.getTime()) &&
  1086. flags.overflow < 0 &&
  1087. !flags.empty &&
  1088. !flags.invalidEra &&
  1089. !flags.invalidMonth &&
  1090. !flags.invalidWeekday &&
  1091. !flags.weekdayMismatch &&
  1092. !flags.nullInput &&
  1093. !flags.invalidFormat &&
  1094. !flags.userInvalidated &&
  1095. (!flags.meridiem || (flags.meridiem && parsedParts));
  1096. if (m._strict) {
  1097. isNowValid =
  1098. isNowValid &&
  1099. flags.charsLeftOver === 0 &&
  1100. flags.unusedTokens.length === 0 &&
  1101. flags.bigHour === undefined;
  1102. }
  1103. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  1104. m._isValid = isNowValid;
  1105. } else {
  1106. return isNowValid;
  1107. }
  1108. }
  1109. return m._isValid;
  1110. }
  1111. function createInvalid(flags) {
  1112. var m = createUTC(NaN);
  1113. if (flags != null) {
  1114. extend(getParsingFlags(m), flags);
  1115. } else {
  1116. getParsingFlags(m).userInvalidated = true;
  1117. }
  1118. return m;
  1119. }
  1120. // Plugins that add properties should also add the key here (null value),
  1121. // so we can properly clone ourselves.
  1122. var momentProperties = (hooks.momentProperties = []),
  1123. updateInProgress = false;
  1124. function copyConfig(to, from) {
  1125. var i, prop, val;
  1126. if (!isUndefined(from._isAMomentObject)) {
  1127. to._isAMomentObject = from._isAMomentObject;
  1128. }
  1129. if (!isUndefined(from._i)) {
  1130. to._i = from._i;
  1131. }
  1132. if (!isUndefined(from._f)) {
  1133. to._f = from._f;
  1134. }
  1135. if (!isUndefined(from._l)) {
  1136. to._l = from._l;
  1137. }
  1138. if (!isUndefined(from._strict)) {
  1139. to._strict = from._strict;
  1140. }
  1141. if (!isUndefined(from._tzm)) {
  1142. to._tzm = from._tzm;
  1143. }
  1144. if (!isUndefined(from._isUTC)) {
  1145. to._isUTC = from._isUTC;
  1146. }
  1147. if (!isUndefined(from._offset)) {
  1148. to._offset = from._offset;
  1149. }
  1150. if (!isUndefined(from._pf)) {
  1151. to._pf = getParsingFlags(from);
  1152. }
  1153. if (!isUndefined(from._locale)) {
  1154. to._locale = from._locale;
  1155. }
  1156. if (momentProperties.length > 0) {
  1157. for (i = 0; i < momentProperties.length; i++) {
  1158. prop = momentProperties[i];
  1159. val = from[prop];
  1160. if (!isUndefined(val)) {
  1161. to[prop] = val;
  1162. }
  1163. }
  1164. }
  1165. return to;
  1166. }
  1167. // Moment prototype object
  1168. function Moment(config) {
  1169. copyConfig(this, config);
  1170. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  1171. if (!this.isValid()) {
  1172. this._d = new Date(NaN);
  1173. }
  1174. // Prevent infinite loop in case updateOffset creates new moment
  1175. // objects.
  1176. if (updateInProgress === false) {
  1177. updateInProgress = true;
  1178. hooks.updateOffset(this);
  1179. updateInProgress = false;
  1180. }
  1181. }
  1182. function isMoment(obj) {
  1183. return (
  1184. obj instanceof Moment || (obj != null && obj._isAMomentObject != null)
  1185. );
  1186. }
  1187. function warn(msg) {
  1188. if (
  1189. hooks.suppressDeprecationWarnings === false &&
  1190. typeof console !== 'undefined' &&
  1191. console.warn
  1192. ) {
  1193. console.warn('Deprecation warning: ' + msg);
  1194. }
  1195. }
  1196. function deprecate(msg, fn) {
  1197. var firstTime = true;
  1198. return extend(function () {
  1199. if (hooks.deprecationHandler != null) {
  1200. hooks.deprecationHandler(null, msg);
  1201. }
  1202. if (firstTime) {
  1203. var args = [],
  1204. arg,
  1205. i,
  1206. key;
  1207. for (i = 0; i < arguments.length; i++) {
  1208. arg = '';
  1209. if (typeof arguments[i] === 'object') {
  1210. arg += '\n[' + i + '] ';
  1211. for (key in arguments[0]) {
  1212. if (hasOwnProp(arguments[0], key)) {
  1213. arg += key + ': ' + arguments[0][key] + ', ';
  1214. }
  1215. }
  1216. arg = arg.slice(0, -2); // Remove trailing comma and space
  1217. } else {
  1218. arg = arguments[i];
  1219. }
  1220. args.push(arg);
  1221. }
  1222. warn(
  1223. msg +
  1224. '\nArguments: ' +
  1225. Array.prototype.slice.call(args).join('') +
  1226. '\n' +
  1227. new Error().stack
  1228. );
  1229. firstTime = false;
  1230. }
  1231. return fn.apply(this, arguments);
  1232. }, fn);
  1233. }
  1234. var deprecations = {};
  1235. function deprecateSimple(name, msg) {
  1236. if (hooks.deprecationHandler != null) {
  1237. hooks.deprecationHandler(name, msg);
  1238. }
  1239. if (!deprecations[name]) {
  1240. warn(msg);
  1241. deprecations[name] = true;
  1242. }
  1243. }
  1244. hooks.suppressDeprecationWarnings = false;
  1245. hooks.deprecationHandler = null;
  1246. function isFunction(input) {
  1247. return (
  1248. (typeof Function !== 'undefined' && input instanceof Function) ||
  1249. Object.prototype.toString.call(input) === '[object Function]'
  1250. );
  1251. }
  1252. function set(config) {
  1253. var prop, i;
  1254. for (i in config) {
  1255. if (hasOwnProp(config, i)) {
  1256. prop = config[i];
  1257. if (isFunction(prop)) {
  1258. this[i] = prop;
  1259. } else {
  1260. this['_' + i] = prop;
  1261. }
  1262. }
  1263. }
  1264. this._config = config;
  1265. // Lenient ordinal parsing accepts just a number in addition to
  1266. // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
  1267. // TODO: Remove "ordinalParse" fallback in next major release.
  1268. this._dayOfMonthOrdinalParseLenient = new RegExp(
  1269. (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
  1270. '|' +
  1271. /\d{1,2}/.source
  1272. );
  1273. }
  1274. function mergeConfigs(parentConfig, childConfig) {
  1275. var res = extend({}, parentConfig),
  1276. prop;
  1277. for (prop in childConfig) {
  1278. if (hasOwnProp(childConfig, prop)) {
  1279. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  1280. res[prop] = {};
  1281. extend(res[prop], parentConfig[prop]);
  1282. extend(res[prop], childConfig[prop]);
  1283. } else if (childConfig[prop] != null) {
  1284. res[prop] = childConfig[prop];
  1285. } else {
  1286. delete res[prop];
  1287. }
  1288. }
  1289. }
  1290. for (prop in parentConfig) {
  1291. if (
  1292. hasOwnProp(parentConfig, prop) &&
  1293. !hasOwnProp(childConfig, prop) &&
  1294. isObject(parentConfig[prop])
  1295. ) {
  1296. // make sure changes to properties don't modify parent config
  1297. res[prop] = extend({}, res[prop]);
  1298. }
  1299. }
  1300. return res;
  1301. }
  1302. function Locale(config) {
  1303. if (config != null) {
  1304. this.set(config);
  1305. }
  1306. }
  1307. var keys;
  1308. if (Object.keys) {
  1309. keys = Object.keys;
  1310. } else {
  1311. keys = function (obj) {
  1312. var i,
  1313. res = [];
  1314. for (i in obj) {
  1315. if (hasOwnProp(obj, i)) {
  1316. res.push(i);
  1317. }
  1318. }
  1319. return res;
  1320. };
  1321. }
  1322. var defaultCalendar = {
  1323. sameDay: '[Today at] LT',
  1324. nextDay: '[Tomorrow at] LT',
  1325. nextWeek: 'dddd [at] LT',
  1326. lastDay: '[Yesterday at] LT',
  1327. lastWeek: '[Last] dddd [at] LT',
  1328. sameElse: 'L',
  1329. };
  1330. function calendar(key, mom, now) {
  1331. var output = this._calendar[key] || this._calendar['sameElse'];
  1332. return isFunction(output) ? output.call(mom, now) : output;
  1333. }
  1334. function zeroFill(number, targetLength, forceSign) {
  1335. var absNumber = '' + Math.abs(number),
  1336. zerosToFill = targetLength - absNumber.length,
  1337. sign = number >= 0;
  1338. return (
  1339. (sign ? (forceSign ? '+' : '') : '-') +
  1340. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +
  1341. absNumber
  1342. );
  1343. }
  1344. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
  1345. localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
  1346. formatFunctions = {},
  1347. formatTokenFunctions = {};
  1348. // token: 'M'
  1349. // padded: ['MM', 2]
  1350. // ordinal: 'Mo'
  1351. // callback: function () { this.month() + 1 }
  1352. function addFormatToken(token, padded, ordinal, callback) {
  1353. var func = callback;
  1354. if (typeof callback === 'string') {
  1355. func = function () {
  1356. return this[callback]();
  1357. };
  1358. }
  1359. if (token) {
  1360. formatTokenFunctions[token] = func;
  1361. }
  1362. if (padded) {
  1363. formatTokenFunctions[padded[0]] = function () {
  1364. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  1365. };
  1366. }
  1367. if (ordinal) {
  1368. formatTokenFunctions[ordinal] = function () {
  1369. return this.localeData().ordinal(
  1370. func.apply(this, arguments),
  1371. token
  1372. );
  1373. };
  1374. }
  1375. }
  1376. function removeFormattingTokens(input) {
  1377. if (input.match(/\[[\s\S]/)) {
  1378. return input.replace(/^\[|\]$/g, '');
  1379. }
  1380. return input.replace(/\\/g, '');
  1381. }
  1382. function makeFormatFunction(format) {
  1383. var array = format.match(formattingTokens),
  1384. i,
  1385. length;
  1386. for (i = 0, length = array.length; i < length; i++) {
  1387. if (formatTokenFunctions[array[i]]) {
  1388. array[i] = formatTokenFunctions[array[i]];
  1389. } else {
  1390. array[i] = removeFormattingTokens(array[i]);
  1391. }
  1392. }
  1393. return function (mom) {
  1394. var output = '',
  1395. i;
  1396. for (i = 0; i < length; i++) {
  1397. output += isFunction(array[i])
  1398. ? array[i].call(mom, format)
  1399. : array[i];
  1400. }
  1401. return output;
  1402. };
  1403. }
  1404. // format date using native date object
  1405. function formatMoment(m, format) {
  1406. if (!m.isValid()) {
  1407. return m.localeData().invalidDate();
  1408. }
  1409. format = expandFormat(format, m.localeData());
  1410. formatFunctions[format] =
  1411. formatFunctions[format] || makeFormatFunction(format);
  1412. return formatFunctions[format](m);
  1413. }
  1414. function expandFormat(format, locale) {
  1415. var i = 5;
  1416. function replaceLongDateFormatTokens(input) {
  1417. return locale.longDateFormat(input) || input;
  1418. }
  1419. localFormattingTokens.lastIndex = 0;
  1420. while (i >= 0 && localFormattingTokens.test(format)) {
  1421. format = format.replace(
  1422. localFormattingTokens,
  1423. replaceLongDateFormatTokens
  1424. );
  1425. localFormattingTokens.lastIndex = 0;
  1426. i -= 1;
  1427. }
  1428. return format;
  1429. }
  1430. var defaultLongDateFormat = {
  1431. LTS: 'h:mm:ss A',
  1432. LT: 'h:mm A',
  1433. L: 'MM/DD/YYYY',
  1434. LL: 'MMMM D, YYYY',
  1435. LLL: 'MMMM D, YYYY h:mm A',
  1436. LLLL: 'dddd, MMMM D, YYYY h:mm A',
  1437. };
  1438. function longDateFormat(key) {
  1439. var format = this._longDateFormat[key],
  1440. formatUpper = this._longDateFormat[key.toUpperCase()];
  1441. if (format || !formatUpper) {
  1442. return format;
  1443. }
  1444. this._longDateFormat[key] = formatUpper
  1445. .match(formattingTokens)
  1446. .map(function (tok) {
  1447. if (
  1448. tok === 'MMMM' ||
  1449. tok === 'MM' ||
  1450. tok === 'DD' ||
  1451. tok === 'dddd'
  1452. ) {
  1453. return tok.slice(1);
  1454. }
  1455. return tok;
  1456. })
  1457. .join('');
  1458. return this._longDateFormat[key];
  1459. }
  1460. var defaultInvalidDate = 'Invalid date';
  1461. function invalidDate() {
  1462. return this._invalidDate;
  1463. }
  1464. var defaultOrdinal = '%d',
  1465. defaultDayOfMonthOrdinalParse = /\d{1,2}/;
  1466. function ordinal(number) {
  1467. return this._ordinal.replace('%d', number);
  1468. }
  1469. var defaultRelativeTime = {
  1470. future: 'in %s',
  1471. past: '%s ago',
  1472. s: 'a few seconds',
  1473. ss: '%d seconds',
  1474. m: 'a minute',
  1475. mm: '%d minutes',
  1476. h: 'an hour',
  1477. hh: '%d hours',
  1478. d: 'a day',
  1479. dd: '%d days',
  1480. w: 'a week',
  1481. ww: '%d weeks',
  1482. M: 'a month',
  1483. MM: '%d months',
  1484. y: 'a year',
  1485. yy: '%d years',
  1486. };
  1487. function relativeTime(number, withoutSuffix, string, isFuture) {
  1488. var output = this._relativeTime[string];
  1489. return isFunction(output)
  1490. ? output(number, withoutSuffix, string, isFuture)
  1491. : output.replace(/%d/i, number);
  1492. }
  1493. function pastFuture(diff, output) {
  1494. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  1495. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  1496. }
  1497. var aliases = {};
  1498. function addUnitAlias(unit, shorthand) {
  1499. var lowerCase = unit.toLowerCase();
  1500. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  1501. }
  1502. function normalizeUnits(units) {
  1503. return typeof units === 'string'
  1504. ? aliases[units] || aliases[units.toLowerCase()]
  1505. : undefined;
  1506. }
  1507. function normalizeObjectUnits(inputObject) {
  1508. var normalizedInput = {},
  1509. normalizedProp,
  1510. prop;
  1511. for (prop in inputObject) {
  1512. if (hasOwnProp(inputObject, prop)) {
  1513. normalizedProp = normalizeUnits(prop);
  1514. if (normalizedProp) {
  1515. normalizedInput[normalizedProp] = inputObject[prop];
  1516. }
  1517. }
  1518. }
  1519. return normalizedInput;
  1520. }
  1521. var priorities = {};
  1522. function addUnitPriority(unit, priority) {
  1523. priorities[unit] = priority;
  1524. }
  1525. function getPrioritizedUnits(unitsObj) {
  1526. var units = [],
  1527. u;
  1528. for (u in unitsObj) {
  1529. if (hasOwnProp(unitsObj, u)) {
  1530. units.push({ unit: u, priority: priorities[u] });
  1531. }
  1532. }
  1533. units.sort(function (a, b) {
  1534. return a.priority - b.priority;
  1535. });
  1536. return units;
  1537. }
  1538. function isLeapYear(year) {
  1539. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  1540. }
  1541. function absFloor(number) {
  1542. if (number < 0) {
  1543. // -0 -> 0
  1544. return Math.ceil(number) || 0;
  1545. } else {
  1546. return Math.floor(number);
  1547. }
  1548. }
  1549. function toInt(argumentForCoercion) {
  1550. var coercedNumber = +argumentForCoercion,
  1551. value = 0;
  1552. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  1553. value = absFloor(coercedNumber);
  1554. }
  1555. return value;
  1556. }
  1557. function makeGetSet(unit, keepTime) {
  1558. return function (value) {
  1559. if (value != null) {
  1560. set$1(this, unit, value);
  1561. hooks.updateOffset(this, keepTime);
  1562. return this;
  1563. } else {
  1564. return get(this, unit);
  1565. }
  1566. };
  1567. }
  1568. function get(mom, unit) {
  1569. return mom.isValid()
  1570. ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
  1571. : NaN;
  1572. }
  1573. function set$1(mom, unit, value) {
  1574. if (mom.isValid() && !isNaN(value)) {
  1575. if (
  1576. unit === 'FullYear' &&
  1577. isLeapYear(mom.year()) &&
  1578. mom.month() === 1 &&
  1579. mom.date() === 29
  1580. ) {
  1581. value = toInt(value);
  1582. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](
  1583. value,
  1584. mom.month(),
  1585. daysInMonth(value, mom.month())
  1586. );
  1587. } else {
  1588. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  1589. }
  1590. }
  1591. }
  1592. // MOMENTS
  1593. function stringGet(units) {
  1594. units = normalizeUnits(units);
  1595. if (isFunction(this[units])) {
  1596. return this[units]();
  1597. }
  1598. return this;
  1599. }
  1600. function stringSet(units, value) {
  1601. if (typeof units === 'object') {
  1602. units = normalizeObjectUnits(units);
  1603. var prioritized = getPrioritizedUnits(units),
  1604. i;
  1605. for (i = 0; i < prioritized.length; i++) {
  1606. this[prioritized[i].unit](units[prioritized[i].unit]);
  1607. }
  1608. } else {
  1609. units = normalizeUnits(units);
  1610. if (isFunction(this[units])) {
  1611. return this[units](value);
  1612. }
  1613. }
  1614. return this;
  1615. }
  1616. var match1 = /\d/, // 0 - 9
  1617. match2 = /\d\d/, // 00 - 99
  1618. match3 = /\d{3}/, // 000 - 999
  1619. match4 = /\d{4}/, // 0000 - 9999
  1620. match6 = /[+-]?\d{6}/, // -999999 - 999999
  1621. match1to2 = /\d\d?/, // 0 - 99
  1622. match3to4 = /\d\d\d\d?/, // 999 - 9999
  1623. match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999
  1624. match1to3 = /\d{1,3}/, // 0 - 999
  1625. match1to4 = /\d{1,4}/, // 0 - 9999
  1626. match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999
  1627. matchUnsigned = /\d+/, // 0 - inf
  1628. matchSigned = /[+-]?\d+/, // -inf - inf
  1629. matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
  1630. matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  1631. matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
  1632. // any word (or two) characters or numbers including two/three word month in arabic.
  1633. // includes scottish gaelic two word and hyphenated months
  1634. matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
  1635. regexes;
  1636. regexes = {};
  1637. function addRegexToken(token, regex, strictRegex) {
  1638. regexes[token] = isFunction(regex)
  1639. ? regex
  1640. : function (isStrict, localeData) {
  1641. return isStrict && strictRegex ? strictRegex : regex;
  1642. };
  1643. }
  1644. function getParseRegexForToken(token, config) {
  1645. if (!hasOwnProp(regexes, token)) {
  1646. return new RegExp(unescapeFormat(token));
  1647. }
  1648. return regexes[token](config._strict, config._locale);
  1649. }
  1650. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  1651. function unescapeFormat(s) {
  1652. return regexEscape(
  1653. s
  1654. .replace('\\', '')
  1655. .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (
  1656. matched,
  1657. p1,
  1658. p2,
  1659. p3,
  1660. p4
  1661. ) {
  1662. return p1 || p2 || p3 || p4;
  1663. })
  1664. );
  1665. }
  1666. function regexEscape(s) {
  1667. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  1668. }
  1669. var tokens = {};
  1670. function addParseToken(token, callback) {
  1671. var i,
  1672. func = callback;
  1673. if (typeof token === 'string') {
  1674. token = [token];
  1675. }
  1676. if (isNumber(callback)) {
  1677. func = function (input, array) {
  1678. array[callback] = toInt(input);
  1679. };
  1680. }
  1681. for (i = 0; i < token.length; i++) {
  1682. tokens[token[i]] = func;
  1683. }
  1684. }
  1685. function addWeekParseToken(token, callback) {
  1686. addParseToken(token, function (input, array, config, token) {
  1687. config._w = config._w || {};
  1688. callback(input, config._w, config, token);
  1689. });
  1690. }
  1691. function addTimeToArrayFromToken(token, input, config) {
  1692. if (input != null && hasOwnProp(tokens, token)) {
  1693. tokens[token](input, config._a, config, token);
  1694. }
  1695. }
  1696. var YEAR = 0,
  1697. MONTH = 1,
  1698. DATE = 2,
  1699. HOUR = 3,
  1700. MINUTE = 4,
  1701. SECOND = 5,
  1702. MILLISECOND = 6,
  1703. WEEK = 7,
  1704. WEEKDAY = 8;
  1705. function mod(n, x) {
  1706. return ((n % x) + x) % x;
  1707. }
  1708. var indexOf;
  1709. if (Array.prototype.indexOf) {
  1710. indexOf = Array.prototype.indexOf;
  1711. } else {
  1712. indexOf = function (o) {
  1713. // I know
  1714. var i;
  1715. for (i = 0; i < this.length; ++i) {
  1716. if (this[i] === o) {
  1717. return i;
  1718. }
  1719. }
  1720. return -1;
  1721. };
  1722. }
  1723. function daysInMonth(year, month) {
  1724. if (isNaN(year) || isNaN(month)) {
  1725. return NaN;
  1726. }
  1727. var modMonth = mod(month, 12);
  1728. year += (month - modMonth) / 12;
  1729. return modMonth === 1
  1730. ? isLeapYear(year)
  1731. ? 29
  1732. : 28
  1733. : 31 - ((modMonth % 7) % 2);
  1734. }
  1735. // FORMATTING
  1736. addFormatToken('M', ['MM', 2], 'Mo', function () {
  1737. return this.month() + 1;
  1738. });
  1739. addFormatToken('MMM', 0, 0, function (format) {
  1740. return this.localeData().monthsShort(this, format);
  1741. });
  1742. addFormatToken('MMMM', 0, 0, function (format) {
  1743. return this.localeData().months(this, format);
  1744. });
  1745. // ALIASES
  1746. addUnitAlias('month', 'M');
  1747. // PRIORITY
  1748. addUnitPriority('month', 8);
  1749. // PARSING
  1750. addRegexToken('M', match1to2);
  1751. addRegexToken('MM', match1to2, match2);
  1752. addRegexToken('MMM', function (isStrict, locale) {
  1753. return locale.monthsShortRegex(isStrict);
  1754. });
  1755. addRegexToken('MMMM', function (isStrict, locale) {
  1756. return locale.monthsRegex(isStrict);
  1757. });
  1758. addParseToken(['M', 'MM'], function (input, array) {
  1759. array[MONTH] = toInt(input) - 1;
  1760. });
  1761. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  1762. var month = config._locale.monthsParse(input, token, config._strict);
  1763. // if we didn't find a month name, mark the date as invalid.
  1764. if (month != null) {
  1765. array[MONTH] = month;
  1766. } else {
  1767. getParsingFlags(config).invalidMonth = input;
  1768. }
  1769. });
  1770. // LOCALES
  1771. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  1772. '_'
  1773. ),
  1774. defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(
  1775. '_'
  1776. ),
  1777. MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
  1778. defaultMonthsShortRegex = matchWord,
  1779. defaultMonthsRegex = matchWord;
  1780. function localeMonths(m, format) {
  1781. if (!m) {
  1782. return isArray(this._months)
  1783. ? this._months
  1784. : this._months['standalone'];
  1785. }
  1786. return isArray(this._months)
  1787. ? this._months[m.month()]
  1788. : this._months[
  1789. (this._months.isFormat || MONTHS_IN_FORMAT).test(format)
  1790. ? 'format'
  1791. : 'standalone'
  1792. ][m.month()];
  1793. }
  1794. function localeMonthsShort(m, format) {
  1795. if (!m) {
  1796. return isArray(this._monthsShort)
  1797. ? this._monthsShort
  1798. : this._monthsShort['standalone'];
  1799. }
  1800. return isArray(this._monthsShort)
  1801. ? this._monthsShort[m.month()]
  1802. : this._monthsShort[
  1803. MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'
  1804. ][m.month()];
  1805. }
  1806. function handleStrictParse(monthName, format, strict) {
  1807. var i,
  1808. ii,
  1809. mom,
  1810. llc = monthName.toLocaleLowerCase();
  1811. if (!this._monthsParse) {
  1812. // this is not used
  1813. this._monthsParse = [];
  1814. this._longMonthsParse = [];
  1815. this._shortMonthsParse = [];
  1816. for (i = 0; i < 12; ++i) {
  1817. mom = createUTC([2000, i]);
  1818. this._shortMonthsParse[i] = this.monthsShort(
  1819. mom,
  1820. ''
  1821. ).toLocaleLowerCase();
  1822. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  1823. }
  1824. }
  1825. if (strict) {
  1826. if (format === 'MMM') {
  1827. ii = indexOf.call(this._shortMonthsParse, llc);
  1828. return ii !== -1 ? ii : null;
  1829. } else {
  1830. ii = indexOf.call(this._longMonthsParse, llc);
  1831. return ii !== -1 ? ii : null;
  1832. }
  1833. } else {
  1834. if (format === 'MMM') {
  1835. ii = indexOf.call(this._shortMonthsParse, llc);
  1836. if (ii !== -1) {
  1837. return ii;
  1838. }
  1839. ii = indexOf.call(this._longMonthsParse, llc);
  1840. return ii !== -1 ? ii : null;
  1841. } else {
  1842. ii = indexOf.call(this._longMonthsParse, llc);
  1843. if (ii !== -1) {
  1844. return ii;
  1845. }
  1846. ii = indexOf.call(this._shortMonthsParse, llc);
  1847. return ii !== -1 ? ii : null;
  1848. }
  1849. }
  1850. }
  1851. function localeMonthsParse(monthName, format, strict) {
  1852. var i, mom, regex;
  1853. if (this._monthsParseExact) {
  1854. return handleStrictParse.call(this, monthName, format, strict);
  1855. }
  1856. if (!this._monthsParse) {
  1857. this._monthsParse = [];
  1858. this._longMonthsParse = [];
  1859. this._shortMonthsParse = [];
  1860. }
  1861. // TODO: add sorting
  1862. // Sorting makes sure if one month (or abbr) is a prefix of another
  1863. // see sorting in computeMonthsParse
  1864. for (i = 0; i < 12; i++) {
  1865. // make the regex if we don't have it already
  1866. mom = createUTC([2000, i]);
  1867. if (strict && !this._longMonthsParse[i]) {
  1868. this._longMonthsParse[i] = new RegExp(
  1869. '^' + this.months(mom, '').replace('.', '') + '$',
  1870. 'i'
  1871. );
  1872. this._shortMonthsParse[i] = new RegExp(
  1873. '^' + this.monthsShort(mom, '').replace('.', '') + '$',
  1874. 'i'
  1875. );
  1876. }
  1877. if (!strict && !this._monthsParse[i]) {
  1878. regex =
  1879. '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  1880. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  1881. }
  1882. // test the regex
  1883. if (
  1884. strict &&
  1885. format === 'MMMM' &&
  1886. this._longMonthsParse[i].test(monthName)
  1887. ) {
  1888. return i;
  1889. } else if (
  1890. strict &&
  1891. format === 'MMM' &&
  1892. this._shortMonthsParse[i].test(monthName)
  1893. ) {
  1894. return i;
  1895. } else if (!strict && this._monthsParse[i].test(monthName)) {
  1896. return i;
  1897. }
  1898. }
  1899. }
  1900. // MOMENTS
  1901. function setMonth(mom, value) {
  1902. var dayOfMonth;
  1903. if (!mom.isValid()) {
  1904. // No op
  1905. return mom;
  1906. }
  1907. if (typeof value === 'string') {
  1908. if (/^\d+$/.test(value)) {
  1909. value = toInt(value);
  1910. } else {
  1911. value = mom.localeData().monthsParse(value);
  1912. // TODO: Another silent failure?
  1913. if (!isNumber(value)) {
  1914. return mom;
  1915. }
  1916. }
  1917. }
  1918. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  1919. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  1920. return mom;
  1921. }
  1922. function getSetMonth(value) {
  1923. if (value != null) {
  1924. setMonth(this, value);
  1925. hooks.updateOffset(this, true);
  1926. return this;
  1927. } else {
  1928. return get(this, 'Month');
  1929. }
  1930. }
  1931. function getDaysInMonth() {
  1932. return daysInMonth(this.year(), this.month());
  1933. }
  1934. function monthsShortRegex(isStrict) {
  1935. if (this._monthsParseExact) {
  1936. if (!hasOwnProp(this, '_monthsRegex')) {
  1937. computeMonthsParse.call(this);
  1938. }
  1939. if (isStrict) {
  1940. return this._monthsShortStrictRegex;
  1941. } else {
  1942. return this._monthsShortRegex;
  1943. }
  1944. } else {
  1945. if (!hasOwnProp(this, '_monthsShortRegex')) {
  1946. this._monthsShortRegex = defaultMonthsShortRegex;
  1947. }
  1948. return this._monthsShortStrictRegex && isStrict
  1949. ? this._monthsShortStrictRegex
  1950. : this._monthsShortRegex;
  1951. }
  1952. }
  1953. function monthsRegex(isStrict) {
  1954. if (this._monthsParseExact) {
  1955. if (!hasOwnProp(this, '_monthsRegex')) {
  1956. computeMonthsParse.call(this);
  1957. }
  1958. if (isStrict) {
  1959. return this._monthsStrictRegex;
  1960. } else {
  1961. return this._monthsRegex;
  1962. }
  1963. } else {
  1964. if (!hasOwnProp(this, '_monthsRegex')) {
  1965. this._monthsRegex = defaultMonthsRegex;
  1966. }
  1967. return this._monthsStrictRegex && isStrict
  1968. ? this._monthsStrictRegex
  1969. : this._monthsRegex;
  1970. }
  1971. }
  1972. function computeMonthsParse() {
  1973. function cmpLenRev(a, b) {
  1974. return b.length - a.length;
  1975. }
  1976. var shortPieces = [],
  1977. longPieces = [],
  1978. mixedPieces = [],
  1979. i,
  1980. mom;
  1981. for (i = 0; i < 12; i++) {
  1982. // make the regex if we don't have it already
  1983. mom = createUTC([2000, i]);
  1984. shortPieces.push(this.monthsShort(mom, ''));
  1985. longPieces.push(this.months(mom, ''));
  1986. mixedPieces.push(this.months(mom, ''));
  1987. mixedPieces.push(this.monthsShort(mom, ''));
  1988. }
  1989. // Sorting makes sure if one month (or abbr) is a prefix of another it
  1990. // will match the longer piece.
  1991. shortPieces.sort(cmpLenRev);
  1992. longPieces.sort(cmpLenRev);
  1993. mixedPieces.sort(cmpLenRev);
  1994. for (i = 0; i < 12; i++) {
  1995. shortPieces[i] = regexEscape(shortPieces[i]);
  1996. longPieces[i] = regexEscape(longPieces[i]);
  1997. }
  1998. for (i = 0; i < 24; i++) {
  1999. mixedPieces[i] = regexEscape(mixedPieces[i]);
  2000. }
  2001. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  2002. this._monthsShortRegex = this._monthsRegex;
  2003. this._monthsStrictRegex = new RegExp(
  2004. '^(' + longPieces.join('|') + ')',
  2005. 'i'
  2006. );
  2007. this._monthsShortStrictRegex = new RegExp(
  2008. '^(' + shortPieces.join('|') + ')',
  2009. 'i'
  2010. );
  2011. }
  2012. // FORMATTING
  2013. addFormatToken('Y', 0, 0, function () {
  2014. var y = this.year();
  2015. return y <= 9999 ? zeroFill(y, 4) : '+' + y;
  2016. });
  2017. addFormatToken(0, ['YY', 2], 0, function () {
  2018. return this.year() % 100;
  2019. });
  2020. addFormatToken(0, ['YYYY', 4], 0, 'year');
  2021. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  2022. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  2023. // ALIASES
  2024. addUnitAlias('year', 'y');
  2025. // PRIORITIES
  2026. addUnitPriority('year', 1);
  2027. // PARSING
  2028. addRegexToken('Y', matchSigned);
  2029. addRegexToken('YY', match1to2, match2);
  2030. addRegexToken('YYYY', match1to4, match4);
  2031. addRegexToken('YYYYY', match1to6, match6);
  2032. addRegexToken('YYYYYY', match1to6, match6);
  2033. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  2034. addParseToken('YYYY', function (input, array) {
  2035. array[YEAR] =
  2036. input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
  2037. });
  2038. addParseToken('YY', function (input, array) {
  2039. array[YEAR] = hooks.parseTwoDigitYear(input);
  2040. });
  2041. addParseToken('Y', function (input, array) {
  2042. array[YEAR] = parseInt(input, 10);
  2043. });
  2044. // HELPERS
  2045. function daysInYear(year) {
  2046. return isLeapYear(year) ? 366 : 365;
  2047. }
  2048. // HOOKS
  2049. hooks.parseTwoDigitYear = function (input) {
  2050. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  2051. };
  2052. // MOMENTS
  2053. var getSetYear = makeGetSet('FullYear', true);
  2054. function getIsLeapYear() {
  2055. return isLeapYear(this.year());
  2056. }
  2057. function createDate(y, m, d, h, M, s, ms) {
  2058. // can't just apply() to create a date:
  2059. // https://stackoverflow.com/q/181348
  2060. var date;
  2061. // the date constructor remaps years 0-99 to 1900-1999
  2062. if (y < 100 && y >= 0) {
  2063. // preserve leap years using a full 400 year cycle, then reset
  2064. date = new Date(y + 400, m, d, h, M, s, ms);
  2065. if (isFinite(date.getFullYear())) {
  2066. date.setFullYear(y);
  2067. }
  2068. } else {
  2069. date = new Date(y, m, d, h, M, s, ms);
  2070. }
  2071. return date;
  2072. }
  2073. function createUTCDate(y) {
  2074. var date, args;
  2075. // the Date.UTC function remaps years 0-99 to 1900-1999
  2076. if (y < 100 && y >= 0) {
  2077. args = Array.prototype.slice.call(arguments);
  2078. // preserve leap years using a full 400 year cycle, then reset
  2079. args[0] = y + 400;
  2080. date = new Date(Date.UTC.apply(null, args));
  2081. if (isFinite(date.getUTCFullYear())) {
  2082. date.setUTCFullYear(y);
  2083. }
  2084. } else {
  2085. date = new Date(Date.UTC.apply(null, arguments));
  2086. }
  2087. return date;
  2088. }
  2089. // start-of-first-week - start-of-year
  2090. function firstWeekOffset(year, dow, doy) {
  2091. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  2092. fwd = 7 + dow - doy,
  2093. // first-week day local weekday -- which local weekday is fwd
  2094. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  2095. return -fwdlw + fwd - 1;
  2096. }
  2097. // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  2098. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  2099. var localWeekday = (7 + weekday - dow) % 7,
  2100. weekOffset = firstWeekOffset(year, dow, doy),
  2101. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  2102. resYear,
  2103. resDayOfYear;
  2104. if (dayOfYear <= 0) {
  2105. resYear = year - 1;
  2106. resDayOfYear = daysInYear(resYear) + dayOfYear;
  2107. } else if (dayOfYear > daysInYear(year)) {
  2108. resYear = year + 1;
  2109. resDayOfYear = dayOfYear - daysInYear(year);
  2110. } else {
  2111. resYear = year;
  2112. resDayOfYear = dayOfYear;
  2113. }
  2114. return {
  2115. year: resYear,
  2116. dayOfYear: resDayOfYear,
  2117. };
  2118. }
  2119. function weekOfYear(mom, dow, doy) {
  2120. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  2121. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  2122. resWeek,
  2123. resYear;
  2124. if (week < 1) {
  2125. resYear = mom.year() - 1;
  2126. resWeek = week + weeksInYear(resYear, dow, doy);
  2127. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  2128. resWeek = week - weeksInYear(mom.year(), dow, doy);
  2129. resYear = mom.year() + 1;
  2130. } else {
  2131. resYear = mom.year();
  2132. resWeek = week;
  2133. }
  2134. return {
  2135. week: resWeek,
  2136. year: resYear,
  2137. };
  2138. }
  2139. function weeksInYear(year, dow, doy) {
  2140. var weekOffset = firstWeekOffset(year, dow, doy),
  2141. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  2142. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  2143. }
  2144. // FORMATTING
  2145. addFormatToken('w', ['ww', 2], 'wo', 'week');
  2146. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  2147. // ALIASES
  2148. addUnitAlias('week', 'w');
  2149. addUnitAlias('isoWeek', 'W');
  2150. // PRIORITIES
  2151. addUnitPriority('week', 5);
  2152. addUnitPriority('isoWeek', 5);
  2153. // PARSING
  2154. addRegexToken('w', match1to2);
  2155. addRegexToken('ww', match1to2, match2);
  2156. addRegexToken('W', match1to2);
  2157. addRegexToken('WW', match1to2, match2);
  2158. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
  2159. input,
  2160. week,
  2161. config,
  2162. token
  2163. ) {
  2164. week[token.substr(0, 1)] = toInt(input);
  2165. });
  2166. // HELPERS
  2167. // LOCALES
  2168. function localeWeek(mom) {
  2169. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  2170. }
  2171. var defaultLocaleWeek = {
  2172. dow: 0, // Sunday is the first day of the week.
  2173. doy: 6, // The week that contains Jan 6th is the first week of the year.
  2174. };
  2175. function localeFirstDayOfWeek() {
  2176. return this._week.dow;
  2177. }
  2178. function localeFirstDayOfYear() {
  2179. return this._week.doy;
  2180. }
  2181. // MOMENTS
  2182. function getSetWeek(input) {
  2183. var week = this.localeData().week(this);
  2184. return input == null ? week : this.add((input - week) * 7, 'd');
  2185. }
  2186. function getSetISOWeek(input) {
  2187. var week = weekOfYear(this, 1, 4).week;
  2188. return input == null ? week : this.add((input - week) * 7, 'd');
  2189. }
  2190. // FORMATTING
  2191. addFormatToken('d', 0, 'do', 'day');
  2192. addFormatToken('dd', 0, 0, function (format) {
  2193. return this.localeData().weekdaysMin(this, format);
  2194. });
  2195. addFormatToken('ddd', 0, 0, function (format) {
  2196. return this.localeData().weekdaysShort(this, format);
  2197. });
  2198. addFormatToken('dddd', 0, 0, function (format) {
  2199. return this.localeData().weekdays(this, format);
  2200. });
  2201. addFormatToken('e', 0, 0, 'weekday');
  2202. addFormatToken('E', 0, 0, 'isoWeekday');
  2203. // ALIASES
  2204. addUnitAlias('day', 'd');
  2205. addUnitAlias('weekday', 'e');
  2206. addUnitAlias('isoWeekday', 'E');
  2207. // PRIORITY
  2208. addUnitPriority('day', 11);
  2209. addUnitPriority('weekday', 11);
  2210. addUnitPriority('isoWeekday', 11);
  2211. // PARSING
  2212. addRegexToken('d', match1to2);
  2213. addRegexToken('e', match1to2);
  2214. addRegexToken('E', match1to2);
  2215. addRegexToken('dd', function (isStrict, locale) {
  2216. return locale.weekdaysMinRegex(isStrict);
  2217. });
  2218. addRegexToken('ddd', function (isStrict, locale) {
  2219. return locale.weekdaysShortRegex(isStrict);
  2220. });
  2221. addRegexToken('dddd', function (isStrict, locale) {
  2222. return locale.weekdaysRegex(isStrict);
  2223. });
  2224. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  2225. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  2226. // if we didn't get a weekday name, mark the date as invalid
  2227. if (weekday != null) {
  2228. week.d = weekday;
  2229. } else {
  2230. getParsingFlags(config).invalidWeekday = input;
  2231. }
  2232. });
  2233. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  2234. week[token] = toInt(input);
  2235. });
  2236. // HELPERS
  2237. function parseWeekday(input, locale) {
  2238. if (typeof input !== 'string') {
  2239. return input;
  2240. }
  2241. if (!isNaN(input)) {
  2242. return parseInt(input, 10);
  2243. }
  2244. input = locale.weekdaysParse(input);
  2245. if (typeof input === 'number') {
  2246. return input;
  2247. }
  2248. return null;
  2249. }
  2250. function parseIsoWeekday(input, locale) {
  2251. if (typeof input === 'string') {
  2252. return locale.weekdaysParse(input) % 7 || 7;
  2253. }
  2254. return isNaN(input) ? null : input;
  2255. }
  2256. // LOCALES
  2257. function shiftWeekdays(ws, n) {
  2258. return ws.slice(n, 7).concat(ws.slice(0, n));
  2259. }
  2260. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  2261. '_'
  2262. ),
  2263. defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  2264. defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  2265. defaultWeekdaysRegex = matchWord,
  2266. defaultWeekdaysShortRegex = matchWord,
  2267. defaultWeekdaysMinRegex = matchWord;
  2268. function localeWeekdays(m, format) {
  2269. var weekdays = isArray(this._weekdays)
  2270. ? this._weekdays
  2271. : this._weekdays[
  2272. m && m !== true && this._weekdays.isFormat.test(format)
  2273. ? 'format'
  2274. : 'standalone'
  2275. ];
  2276. return m === true
  2277. ? shiftWeekdays(weekdays, this._week.dow)
  2278. : m
  2279. ? weekdays[m.day()]
  2280. : weekdays;
  2281. }
  2282. function localeWeekdaysShort(m) {
  2283. return m === true
  2284. ? shiftWeekdays(this._weekdaysShort, this._week.dow)
  2285. : m
  2286. ? this._weekdaysShort[m.day()]
  2287. : this._weekdaysShort;
  2288. }
  2289. function localeWeekdaysMin(m) {
  2290. return m === true
  2291. ? shiftWeekdays(this._weekdaysMin, this._week.dow)
  2292. : m
  2293. ? this._weekdaysMin[m.day()]
  2294. : this._weekdaysMin;
  2295. }
  2296. function handleStrictParse$1(weekdayName, format, strict) {
  2297. var i,
  2298. ii,
  2299. mom,
  2300. llc = weekdayName.toLocaleLowerCase();
  2301. if (!this._weekdaysParse) {
  2302. this._weekdaysParse = [];
  2303. this._shortWeekdaysParse = [];
  2304. this._minWeekdaysParse = [];
  2305. for (i = 0; i < 7; ++i) {
  2306. mom = createUTC([2000, 1]).day(i);
  2307. this._minWeekdaysParse[i] = this.weekdaysMin(
  2308. mom,
  2309. ''
  2310. ).toLocaleLowerCase();
  2311. this._shortWeekdaysParse[i] = this.weekdaysShort(
  2312. mom,
  2313. ''
  2314. ).toLocaleLowerCase();
  2315. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  2316. }
  2317. }
  2318. if (strict) {
  2319. if (format === 'dddd') {
  2320. ii = indexOf.call(this._weekdaysParse, llc);
  2321. return ii !== -1 ? ii : null;
  2322. } else if (format === 'ddd') {
  2323. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2324. return ii !== -1 ? ii : null;
  2325. } else {
  2326. ii = indexOf.call(this._minWeekdaysParse, llc);
  2327. return ii !== -1 ? ii : null;
  2328. }
  2329. } else {
  2330. if (format === 'dddd') {
  2331. ii = indexOf.call(this._weekdaysParse, llc);
  2332. if (ii !== -1) {
  2333. return ii;
  2334. }
  2335. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2336. if (ii !== -1) {
  2337. return ii;
  2338. }
  2339. ii = indexOf.call(this._minWeekdaysParse, llc);
  2340. return ii !== -1 ? ii : null;
  2341. } else if (format === 'ddd') {
  2342. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2343. if (ii !== -1) {
  2344. return ii;
  2345. }
  2346. ii = indexOf.call(this._weekdaysParse, llc);
  2347. if (ii !== -1) {
  2348. return ii;
  2349. }
  2350. ii = indexOf.call(this._minWeekdaysParse, llc);
  2351. return ii !== -1 ? ii : null;
  2352. } else {
  2353. ii = indexOf.call(this._minWeekdaysParse, llc);
  2354. if (ii !== -1) {
  2355. return ii;
  2356. }
  2357. ii = indexOf.call(this._weekdaysParse, llc);
  2358. if (ii !== -1) {
  2359. return ii;
  2360. }
  2361. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2362. return ii !== -1 ? ii : null;
  2363. }
  2364. }
  2365. }
  2366. function localeWeekdaysParse(weekdayName, format, strict) {
  2367. var i, mom, regex;
  2368. if (this._weekdaysParseExact) {
  2369. return handleStrictParse$1.call(this, weekdayName, format, strict);
  2370. }
  2371. if (!this._weekdaysParse) {
  2372. this._weekdaysParse = [];
  2373. this._minWeekdaysParse = [];
  2374. this._shortWeekdaysParse = [];
  2375. this._fullWeekdaysParse = [];
  2376. }
  2377. for (i = 0; i < 7; i++) {
  2378. // make the regex if we don't have it already
  2379. mom = createUTC([2000, 1]).day(i);
  2380. if (strict && !this._fullWeekdaysParse[i]) {
  2381. this._fullWeekdaysParse[i] = new RegExp(
  2382. '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$',
  2383. 'i'
  2384. );
  2385. this._shortWeekdaysParse[i] = new RegExp(
  2386. '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$',
  2387. 'i'
  2388. );
  2389. this._minWeekdaysParse[i] = new RegExp(
  2390. '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$',
  2391. 'i'
  2392. );
  2393. }
  2394. if (!this._weekdaysParse[i]) {
  2395. regex =
  2396. '^' +
  2397. this.weekdays(mom, '') +
  2398. '|^' +
  2399. this.weekdaysShort(mom, '') +
  2400. '|^' +
  2401. this.weekdaysMin(mom, '');
  2402. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  2403. }
  2404. // test the regex
  2405. if (
  2406. strict &&
  2407. format === 'dddd' &&
  2408. this._fullWeekdaysParse[i].test(weekdayName)
  2409. ) {
  2410. return i;
  2411. } else if (
  2412. strict &&
  2413. format === 'ddd' &&
  2414. this._shortWeekdaysParse[i].test(weekdayName)
  2415. ) {
  2416. return i;
  2417. } else if (
  2418. strict &&
  2419. format === 'dd' &&
  2420. this._minWeekdaysParse[i].test(weekdayName)
  2421. ) {
  2422. return i;
  2423. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  2424. return i;
  2425. }
  2426. }
  2427. }
  2428. // MOMENTS
  2429. function getSetDayOfWeek(input) {
  2430. if (!this.isValid()) {
  2431. return input != null ? this : NaN;
  2432. }
  2433. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  2434. if (input != null) {
  2435. input = parseWeekday(input, this.localeData());
  2436. return this.add(input - day, 'd');
  2437. } else {
  2438. return day;
  2439. }
  2440. }
  2441. function getSetLocaleDayOfWeek(input) {
  2442. if (!this.isValid()) {
  2443. return input != null ? this : NaN;
  2444. }
  2445. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  2446. return input == null ? weekday : this.add(input - weekday, 'd');
  2447. }
  2448. function getSetISODayOfWeek(input) {
  2449. if (!this.isValid()) {
  2450. return input != null ? this : NaN;
  2451. }
  2452. // behaves the same as moment#day except
  2453. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  2454. // as a setter, sunday should belong to the previous week.
  2455. if (input != null) {
  2456. var weekday = parseIsoWeekday(input, this.localeData());
  2457. return this.day(this.day() % 7 ? weekday : weekday - 7);
  2458. } else {
  2459. return this.day() || 7;
  2460. }
  2461. }
  2462. function weekdaysRegex(isStrict) {
  2463. if (this._weekdaysParseExact) {
  2464. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2465. computeWeekdaysParse.call(this);
  2466. }
  2467. if (isStrict) {
  2468. return this._weekdaysStrictRegex;
  2469. } else {
  2470. return this._weekdaysRegex;
  2471. }
  2472. } else {
  2473. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2474. this._weekdaysRegex = defaultWeekdaysRegex;
  2475. }
  2476. return this._weekdaysStrictRegex && isStrict
  2477. ? this._weekdaysStrictRegex
  2478. : this._weekdaysRegex;
  2479. }
  2480. }
  2481. function weekdaysShortRegex(isStrict) {
  2482. if (this._weekdaysParseExact) {
  2483. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2484. computeWeekdaysParse.call(this);
  2485. }
  2486. if (isStrict) {
  2487. return this._weekdaysShortStrictRegex;
  2488. } else {
  2489. return this._weekdaysShortRegex;
  2490. }
  2491. } else {
  2492. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  2493. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  2494. }
  2495. return this._weekdaysShortStrictRegex && isStrict
  2496. ? this._weekdaysShortStrictRegex
  2497. : this._weekdaysShortRegex;
  2498. }
  2499. }
  2500. function weekdaysMinRegex(isStrict) {
  2501. if (this._weekdaysParseExact) {
  2502. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2503. computeWeekdaysParse.call(this);
  2504. }
  2505. if (isStrict) {
  2506. return this._weekdaysMinStrictRegex;
  2507. } else {
  2508. return this._weekdaysMinRegex;
  2509. }
  2510. } else {
  2511. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  2512. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  2513. }
  2514. return this._weekdaysMinStrictRegex && isStrict
  2515. ? this._weekdaysMinStrictRegex
  2516. : this._weekdaysMinRegex;
  2517. }
  2518. }
  2519. function computeWeekdaysParse() {
  2520. function cmpLenRev(a, b) {
  2521. return b.length - a.length;
  2522. }
  2523. var minPieces = [],
  2524. shortPieces = [],
  2525. longPieces = [],
  2526. mixedPieces = [],
  2527. i,
  2528. mom,
  2529. minp,
  2530. shortp,
  2531. longp;
  2532. for (i = 0; i < 7; i++) {
  2533. // make the regex if we don't have it already
  2534. mom = createUTC([2000, 1]).day(i);
  2535. minp = regexEscape(this.weekdaysMin(mom, ''));
  2536. shortp = regexEscape(this.weekdaysShort(mom, ''));
  2537. longp = regexEscape(this.weekdays(mom, ''));
  2538. minPieces.push(minp);
  2539. shortPieces.push(shortp);
  2540. longPieces.push(longp);
  2541. mixedPieces.push(minp);
  2542. mixedPieces.push(shortp);
  2543. mixedPieces.push(longp);
  2544. }
  2545. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  2546. // will match the longer piece.
  2547. minPieces.sort(cmpLenRev);
  2548. shortPieces.sort(cmpLenRev);
  2549. longPieces.sort(cmpLenRev);
  2550. mixedPieces.sort(cmpLenRev);
  2551. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  2552. this._weekdaysShortRegex = this._weekdaysRegex;
  2553. this._weekdaysMinRegex = this._weekdaysRegex;
  2554. this._weekdaysStrictRegex = new RegExp(
  2555. '^(' + longPieces.join('|') + ')',
  2556. 'i'
  2557. );
  2558. this._weekdaysShortStrictRegex = new RegExp(
  2559. '^(' + shortPieces.join('|') + ')',
  2560. 'i'
  2561. );
  2562. this._weekdaysMinStrictRegex = new RegExp(
  2563. '^(' + minPieces.join('|') + ')',
  2564. 'i'
  2565. );
  2566. }
  2567. // FORMATTING
  2568. function hFormat() {
  2569. return this.hours() % 12 || 12;
  2570. }
  2571. function kFormat() {
  2572. return this.hours() || 24;
  2573. }
  2574. addFormatToken('H', ['HH', 2], 0, 'hour');
  2575. addFormatToken('h', ['hh', 2], 0, hFormat);
  2576. addFormatToken('k', ['kk', 2], 0, kFormat);
  2577. addFormatToken('hmm', 0, 0, function () {
  2578. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  2579. });
  2580. addFormatToken('hmmss', 0, 0, function () {
  2581. return (
  2582. '' +
  2583. hFormat.apply(this) +
  2584. zeroFill(this.minutes(), 2) +
  2585. zeroFill(this.seconds(), 2)
  2586. );
  2587. });
  2588. addFormatToken('Hmm', 0, 0, function () {
  2589. return '' + this.hours() + zeroFill(this.minutes(), 2);
  2590. });
  2591. addFormatToken('Hmmss', 0, 0, function () {
  2592. return (
  2593. '' +
  2594. this.hours() +
  2595. zeroFill(this.minutes(), 2) +
  2596. zeroFill(this.seconds(), 2)
  2597. );
  2598. });
  2599. function meridiem(token, lowercase) {
  2600. addFormatToken(token, 0, 0, function () {
  2601. return this.localeData().meridiem(
  2602. this.hours(),
  2603. this.minutes(),
  2604. lowercase
  2605. );
  2606. });
  2607. }
  2608. meridiem('a', true);
  2609. meridiem('A', false);
  2610. // ALIASES
  2611. addUnitAlias('hour', 'h');
  2612. // PRIORITY
  2613. addUnitPriority('hour', 13);
  2614. // PARSING
  2615. function matchMeridiem(isStrict, locale) {
  2616. return locale._meridiemParse;
  2617. }
  2618. addRegexToken('a', matchMeridiem);
  2619. addRegexToken('A', matchMeridiem);
  2620. addRegexToken('H', match1to2);
  2621. addRegexToken('h', match1to2);
  2622. addRegexToken('k', match1to2);
  2623. addRegexToken('HH', match1to2, match2);
  2624. addRegexToken('hh', match1to2, match2);
  2625. addRegexToken('kk', match1to2, match2);
  2626. addRegexToken('hmm', match3to4);
  2627. addRegexToken('hmmss', match5to6);
  2628. addRegexToken('Hmm', match3to4);
  2629. addRegexToken('Hmmss', match5to6);
  2630. addParseToken(['H', 'HH'], HOUR);
  2631. addParseToken(['k', 'kk'], function (input, array, config) {
  2632. var kInput = toInt(input);
  2633. array[HOUR] = kInput === 24 ? 0 : kInput;
  2634. });
  2635. addParseToken(['a', 'A'], function (input, array, config) {
  2636. config._isPm = config._locale.isPM(input);
  2637. config._meridiem = input;
  2638. });
  2639. addParseToken(['h', 'hh'], function (input, array, config) {
  2640. array[HOUR] = toInt(input);
  2641. getParsingFlags(config).bigHour = true;
  2642. });
  2643. addParseToken('hmm', function (input, array, config) {
  2644. var pos = input.length - 2;
  2645. array[HOUR] = toInt(input.substr(0, pos));
  2646. array[MINUTE] = toInt(input.substr(pos));
  2647. getParsingFlags(config).bigHour = true;
  2648. });
  2649. addParseToken('hmmss', function (input, array, config) {
  2650. var pos1 = input.length - 4,
  2651. pos2 = input.length - 2;
  2652. array[HOUR] = toInt(input.substr(0, pos1));
  2653. array[MINUTE] = toInt(input.substr(pos1, 2));
  2654. array[SECOND] = toInt(input.substr(pos2));
  2655. getParsingFlags(config).bigHour = true;
  2656. });
  2657. addParseToken('Hmm', function (input, array, config) {
  2658. var pos = input.length - 2;
  2659. array[HOUR] = toInt(input.substr(0, pos));
  2660. array[MINUTE] = toInt(input.substr(pos));
  2661. });
  2662. addParseToken('Hmmss', function (input, array, config) {
  2663. var pos1 = input.length - 4,
  2664. pos2 = input.length - 2;
  2665. array[HOUR] = toInt(input.substr(0, pos1));
  2666. array[MINUTE] = toInt(input.substr(pos1, 2));
  2667. array[SECOND] = toInt(input.substr(pos2));
  2668. });
  2669. // LOCALES
  2670. function localeIsPM(input) {
  2671. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  2672. // Using charAt should be more compatible.
  2673. return (input + '').toLowerCase().charAt(0) === 'p';
  2674. }
  2675. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i,
  2676. // Setting the hour should keep the time, because the user explicitly
  2677. // specified which hour they want. So trying to maintain the same hour (in
  2678. // a new timezone) makes sense. Adding/subtracting hours does not follow
  2679. // this rule.
  2680. getSetHour = makeGetSet('Hours', true);
  2681. function localeMeridiem(hours, minutes, isLower) {
  2682. if (hours > 11) {
  2683. return isLower ? 'pm' : 'PM';
  2684. } else {
  2685. return isLower ? 'am' : 'AM';
  2686. }
  2687. }
  2688. var baseConfig = {
  2689. calendar: defaultCalendar,
  2690. longDateFormat: defaultLongDateFormat,
  2691. invalidDate: defaultInvalidDate,
  2692. ordinal: defaultOrdinal,
  2693. dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
  2694. relativeTime: defaultRelativeTime,
  2695. months: defaultLocaleMonths,
  2696. monthsShort: defaultLocaleMonthsShort,
  2697. week: defaultLocaleWeek,
  2698. weekdays: defaultLocaleWeekdays,
  2699. weekdaysMin: defaultLocaleWeekdaysMin,
  2700. weekdaysShort: defaultLocaleWeekdaysShort,
  2701. meridiemParse: defaultLocaleMeridiemParse,
  2702. };
  2703. // internal storage for locale config files
  2704. var locales = {},
  2705. localeFamilies = {},
  2706. globalLocale;
  2707. function commonPrefix(arr1, arr2) {
  2708. var i,
  2709. minl = Math.min(arr1.length, arr2.length);
  2710. for (i = 0; i < minl; i += 1) {
  2711. if (arr1[i] !== arr2[i]) {
  2712. return i;
  2713. }
  2714. }
  2715. return minl;
  2716. }
  2717. function normalizeLocale(key) {
  2718. return key ? key.toLowerCase().replace('_', '-') : key;
  2719. }
  2720. // pick the locale from the array
  2721. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  2722. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  2723. function chooseLocale(names) {
  2724. var i = 0,
  2725. j,
  2726. next,
  2727. locale,
  2728. split;
  2729. while (i < names.length) {
  2730. split = normalizeLocale(names[i]).split('-');
  2731. j = split.length;
  2732. next = normalizeLocale(names[i + 1]);
  2733. next = next ? next.split('-') : null;
  2734. while (j > 0) {
  2735. locale = loadLocale(split.slice(0, j).join('-'));
  2736. if (locale) {
  2737. return locale;
  2738. }
  2739. if (
  2740. next &&
  2741. next.length >= j &&
  2742. commonPrefix(split, next) >= j - 1
  2743. ) {
  2744. //the next array item is better than a shallower substring of this one
  2745. break;
  2746. }
  2747. j--;
  2748. }
  2749. i++;
  2750. }
  2751. return globalLocale;
  2752. }
  2753. function loadLocale(name) {
  2754. var oldLocale = null,
  2755. aliasedRequire;
  2756. // TODO: Find a better way to register and load all the locales in Node
  2757. if (
  2758. locales[name] === undefined &&
  2759. typeof module !== 'undefined' &&
  2760. module &&
  2761. module.exports
  2762. ) {
  2763. try {
  2764. oldLocale = globalLocale._abbr;
  2765. aliasedRequire = require;
  2766. aliasedRequire('./locale/' + name);
  2767. getSetGlobalLocale(oldLocale);
  2768. } catch (e) {
  2769. // mark as not found to avoid repeating expensive file require call causing high CPU
  2770. // when trying to find en-US, en_US, en-us for every format call
  2771. locales[name] = null; // null means not found
  2772. }
  2773. }
  2774. return locales[name];
  2775. }
  2776. // This function will load locale and then set the global locale. If
  2777. // no arguments are passed in, it will simply return the current global
  2778. // locale key.
  2779. function getSetGlobalLocale(key, values) {
  2780. var data;
  2781. if (key) {
  2782. if (isUndefined(values)) {
  2783. data = getLocale(key);
  2784. } else {
  2785. data = defineLocale(key, values);
  2786. }
  2787. if (data) {
  2788. // moment.duration._locale = moment._locale = data;
  2789. globalLocale = data;
  2790. } else {
  2791. if (typeof console !== 'undefined' && console.warn) {
  2792. //warn user if arguments are passed but the locale could not be set
  2793. console.warn(
  2794. 'Locale ' + key + ' not found. Did you forget to load it?'
  2795. );
  2796. }
  2797. }
  2798. }
  2799. return globalLocale._abbr;
  2800. }
  2801. function defineLocale(name, config) {
  2802. if (config !== null) {
  2803. var locale,
  2804. parentConfig = baseConfig;
  2805. config.abbr = name;
  2806. if (locales[name] != null) {
  2807. deprecateSimple(
  2808. 'defineLocaleOverride',
  2809. 'use moment.updateLocale(localeName, config) to change ' +
  2810. 'an existing locale. moment.defineLocale(localeName, ' +
  2811. 'config) should only be used for creating a new locale ' +
  2812. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'
  2813. );
  2814. parentConfig = locales[name]._config;
  2815. } else if (config.parentLocale != null) {
  2816. if (locales[config.parentLocale] != null) {
  2817. parentConfig = locales[config.parentLocale]._config;
  2818. } else {
  2819. locale = loadLocale(config.parentLocale);
  2820. if (locale != null) {
  2821. parentConfig = locale._config;
  2822. } else {
  2823. if (!localeFamilies[config.parentLocale]) {
  2824. localeFamilies[config.parentLocale] = [];
  2825. }
  2826. localeFamilies[config.parentLocale].push({
  2827. name: name,
  2828. config: config,
  2829. });
  2830. return null;
  2831. }
  2832. }
  2833. }
  2834. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  2835. if (localeFamilies[name]) {
  2836. localeFamilies[name].forEach(function (x) {
  2837. defineLocale(x.name, x.config);
  2838. });
  2839. }
  2840. // backwards compat for now: also set the locale
  2841. // make sure we set the locale AFTER all child locales have been
  2842. // created, so we won't end up with the child locale set.
  2843. getSetGlobalLocale(name);
  2844. return locales[name];
  2845. } else {
  2846. // useful for testing
  2847. delete locales[name];
  2848. return null;
  2849. }
  2850. }
  2851. function updateLocale(name, config) {
  2852. if (config != null) {
  2853. var locale,
  2854. tmpLocale,
  2855. parentConfig = baseConfig;
  2856. if (locales[name] != null && locales[name].parentLocale != null) {
  2857. // Update existing child locale in-place to avoid memory-leaks
  2858. locales[name].set(mergeConfigs(locales[name]._config, config));
  2859. } else {
  2860. // MERGE
  2861. tmpLocale = loadLocale(name);
  2862. if (tmpLocale != null) {
  2863. parentConfig = tmpLocale._config;
  2864. }
  2865. config = mergeConfigs(parentConfig, config);
  2866. if (tmpLocale == null) {
  2867. // updateLocale is called for creating a new locale
  2868. // Set abbr so it will have a name (getters return
  2869. // undefined otherwise).
  2870. config.abbr = name;
  2871. }
  2872. locale = new Locale(config);
  2873. locale.parentLocale = locales[name];
  2874. locales[name] = locale;
  2875. }
  2876. // backwards compat for now: also set the locale
  2877. getSetGlobalLocale(name);
  2878. } else {
  2879. // pass null for config to unupdate, useful for tests
  2880. if (locales[name] != null) {
  2881. if (locales[name].parentLocale != null) {
  2882. locales[name] = locales[name].parentLocale;
  2883. if (name === getSetGlobalLocale()) {
  2884. getSetGlobalLocale(name);
  2885. }
  2886. } else if (locales[name] != null) {
  2887. delete locales[name];
  2888. }
  2889. }
  2890. }
  2891. return locales[name];
  2892. }
  2893. // returns locale data
  2894. function getLocale(key) {
  2895. var locale;
  2896. if (key && key._locale && key._locale._abbr) {
  2897. key = key._locale._abbr;
  2898. }
  2899. if (!key) {
  2900. return globalLocale;
  2901. }
  2902. if (!isArray(key)) {
  2903. //short-circuit everything else
  2904. locale = loadLocale(key);
  2905. if (locale) {
  2906. return locale;
  2907. }
  2908. key = [key];
  2909. }
  2910. return chooseLocale(key);
  2911. }
  2912. function listLocales() {
  2913. return keys(locales);
  2914. }
  2915. function checkOverflow(m) {
  2916. var overflow,
  2917. a = m._a;
  2918. if (a && getParsingFlags(m).overflow === -2) {
  2919. overflow =
  2920. a[MONTH] < 0 || a[MONTH] > 11
  2921. ? MONTH
  2922. : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
  2923. ? DATE
  2924. : a[HOUR] < 0 ||
  2925. a[HOUR] > 24 ||
  2926. (a[HOUR] === 24 &&
  2927. (a[MINUTE] !== 0 ||
  2928. a[SECOND] !== 0 ||
  2929. a[MILLISECOND] !== 0))
  2930. ? HOUR
  2931. : a[MINUTE] < 0 || a[MINUTE] > 59
  2932. ? MINUTE
  2933. : a[SECOND] < 0 || a[SECOND] > 59
  2934. ? SECOND
  2935. : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
  2936. ? MILLISECOND
  2937. : -1;
  2938. if (
  2939. getParsingFlags(m)._overflowDayOfYear &&
  2940. (overflow < YEAR || overflow > DATE)
  2941. ) {
  2942. overflow = DATE;
  2943. }
  2944. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  2945. overflow = WEEK;
  2946. }
  2947. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  2948. overflow = WEEKDAY;
  2949. }
  2950. getParsingFlags(m).overflow = overflow;
  2951. }
  2952. return m;
  2953. }
  2954. // iso 8601 regex
  2955. // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
  2956. var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
  2957. basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
  2958. tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
  2959. isoDates = [
  2960. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  2961. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  2962. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  2963. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  2964. ['YYYY-DDD', /\d{4}-\d{3}/],
  2965. ['YYYY-MM', /\d{4}-\d\d/, false],
  2966. ['YYYYYYMMDD', /[+-]\d{10}/],
  2967. ['YYYYMMDD', /\d{8}/],
  2968. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  2969. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  2970. ['YYYYDDD', /\d{7}/],
  2971. ['YYYYMM', /\d{6}/, false],
  2972. ['YYYY', /\d{4}/, false],
  2973. ],
  2974. // iso time formats and regexes
  2975. isoTimes = [
  2976. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  2977. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  2978. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  2979. ['HH:mm', /\d\d:\d\d/],
  2980. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  2981. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  2982. ['HHmmss', /\d\d\d\d\d\d/],
  2983. ['HHmm', /\d\d\d\d/],
  2984. ['HH', /\d\d/],
  2985. ],
  2986. aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
  2987. // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
  2988. rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
  2989. obsOffsets = {
  2990. UT: 0,
  2991. GMT: 0,
  2992. EDT: -4 * 60,
  2993. EST: -5 * 60,
  2994. CDT: -5 * 60,
  2995. CST: -6 * 60,
  2996. MDT: -6 * 60,
  2997. MST: -7 * 60,
  2998. PDT: -7 * 60,
  2999. PST: -8 * 60,
  3000. };
  3001. // date from iso format
  3002. function configFromISO(config) {
  3003. var i,
  3004. l,
  3005. string = config._i,
  3006. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  3007. allowTime,
  3008. dateFormat,
  3009. timeFormat,
  3010. tzFormat;
  3011. if (match) {
  3012. getParsingFlags(config).iso = true;
  3013. for (i = 0, l = isoDates.length; i < l; i++) {
  3014. if (isoDates[i][1].exec(match[1])) {
  3015. dateFormat = isoDates[i][0];
  3016. allowTime = isoDates[i][2] !== false;
  3017. break;
  3018. }
  3019. }
  3020. if (dateFormat == null) {
  3021. config._isValid = false;
  3022. return;
  3023. }
  3024. if (match[3]) {
  3025. for (i = 0, l = isoTimes.length; i < l; i++) {
  3026. if (isoTimes[i][1].exec(match[3])) {
  3027. // match[2] should be 'T' or space
  3028. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  3029. break;
  3030. }
  3031. }
  3032. if (timeFormat == null) {
  3033. config._isValid = false;
  3034. return;
  3035. }
  3036. }
  3037. if (!allowTime && timeFormat != null) {
  3038. config._isValid = false;
  3039. return;
  3040. }
  3041. if (match[4]) {
  3042. if (tzRegex.exec(match[4])) {
  3043. tzFormat = 'Z';
  3044. } else {
  3045. config._isValid = false;
  3046. return;
  3047. }
  3048. }
  3049. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  3050. configFromStringAndFormat(config);
  3051. } else {
  3052. config._isValid = false;
  3053. }
  3054. }
  3055. function extractFromRFC2822Strings(
  3056. yearStr,
  3057. monthStr,
  3058. dayStr,
  3059. hourStr,
  3060. minuteStr,
  3061. secondStr
  3062. ) {
  3063. var result = [
  3064. untruncateYear(yearStr),
  3065. defaultLocaleMonthsShort.indexOf(monthStr),
  3066. parseInt(dayStr, 10),
  3067. parseInt(hourStr, 10),
  3068. parseInt(minuteStr, 10),
  3069. ];
  3070. if (secondStr) {
  3071. result.push(parseInt(secondStr, 10));
  3072. }
  3073. return result;
  3074. }
  3075. function untruncateYear(yearStr) {
  3076. var year = parseInt(yearStr, 10);
  3077. if (year <= 49) {
  3078. return 2000 + year;
  3079. } else if (year <= 999) {
  3080. return 1900 + year;
  3081. }
  3082. return year;
  3083. }
  3084. function preprocessRFC2822(s) {
  3085. // Remove comments and folding whitespace and replace multiple-spaces with a single space
  3086. return s
  3087. .replace(/\([^)]*\)|[\n\t]/g, ' ')
  3088. .replace(/(\s\s+)/g, ' ')
  3089. .replace(/^\s\s*/, '')
  3090. .replace(/\s\s*$/, '');
  3091. }
  3092. function checkWeekday(weekdayStr, parsedInput, config) {
  3093. if (weekdayStr) {
  3094. // TODO: Replace the vanilla JS Date object with an independent day-of-week check.
  3095. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
  3096. weekdayActual = new Date(
  3097. parsedInput[0],
  3098. parsedInput[1],
  3099. parsedInput[2]
  3100. ).getDay();
  3101. if (weekdayProvided !== weekdayActual) {
  3102. getParsingFlags(config).weekdayMismatch = true;
  3103. config._isValid = false;
  3104. return false;
  3105. }
  3106. }
  3107. return true;
  3108. }
  3109. function calculateOffset(obsOffset, militaryOffset, numOffset) {
  3110. if (obsOffset) {
  3111. return obsOffsets[obsOffset];
  3112. } else if (militaryOffset) {
  3113. // the only allowed military tz is Z
  3114. return 0;
  3115. } else {
  3116. var hm = parseInt(numOffset, 10),
  3117. m = hm % 100,
  3118. h = (hm - m) / 100;
  3119. return h * 60 + m;
  3120. }
  3121. }
  3122. // date and time from ref 2822 format
  3123. function configFromRFC2822(config) {
  3124. var match = rfc2822.exec(preprocessRFC2822(config._i)),
  3125. parsedArray;
  3126. if (match) {
  3127. parsedArray = extractFromRFC2822Strings(
  3128. match[4],
  3129. match[3],
  3130. match[2],
  3131. match[5],
  3132. match[6],
  3133. match[7]
  3134. );
  3135. if (!checkWeekday(match[1], parsedArray, config)) {
  3136. return;
  3137. }
  3138. config._a = parsedArray;
  3139. config._tzm = calculateOffset(match[8], match[9], match[10]);
  3140. config._d = createUTCDate.apply(null, config._a);
  3141. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  3142. getParsingFlags(config).rfc2822 = true;
  3143. } else {
  3144. config._isValid = false;
  3145. }
  3146. }
  3147. // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
  3148. function configFromString(config) {
  3149. var matched = aspNetJsonRegex.exec(config._i);
  3150. if (matched !== null) {
  3151. config._d = new Date(+matched[1]);
  3152. return;
  3153. }
  3154. configFromISO(config);
  3155. if (config._isValid === false) {
  3156. delete config._isValid;
  3157. } else {
  3158. return;
  3159. }
  3160. configFromRFC2822(config);
  3161. if (config._isValid === false) {
  3162. delete config._isValid;
  3163. } else {
  3164. return;
  3165. }
  3166. if (config._strict) {
  3167. config._isValid = false;
  3168. } else {
  3169. // Final attempt, use Input Fallback
  3170. hooks.createFromInputFallback(config);
  3171. }
  3172. }
  3173. hooks.createFromInputFallback = deprecate(
  3174. 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
  3175. 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
  3176. 'discouraged and will be removed in an upcoming major release. Please refer to ' +
  3177. 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  3178. function (config) {
  3179. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  3180. }
  3181. );
  3182. // Pick the first defined of two or three arguments.
  3183. function defaults(a, b, c) {
  3184. if (a != null) {
  3185. return a;
  3186. }
  3187. if (b != null) {
  3188. return b;
  3189. }
  3190. return c;
  3191. }
  3192. function currentDateArray(config) {
  3193. // hooks is actually the exported moment object
  3194. var nowValue = new Date(hooks.now());
  3195. if (config._useUTC) {
  3196. return [
  3197. nowValue.getUTCFullYear(),
  3198. nowValue.getUTCMonth(),
  3199. nowValue.getUTCDate(),
  3200. ];
  3201. }
  3202. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  3203. }
  3204. // convert an array to a date.
  3205. // the array should mirror the parameters below
  3206. // note: all values past the year are optional and will default to the lowest possible value.
  3207. // [year, month, day , hour, minute, second, millisecond]
  3208. function configFromArray(config) {
  3209. var i,
  3210. date,
  3211. input = [],
  3212. currentDate,
  3213. expectedWeekday,
  3214. yearToUse;
  3215. if (config._d) {
  3216. return;
  3217. }
  3218. currentDate = currentDateArray(config);
  3219. //compute day of the year from weeks and weekdays
  3220. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  3221. dayOfYearFromWeekInfo(config);
  3222. }
  3223. //if the day of the year is set, figure out what it is
  3224. if (config._dayOfYear != null) {
  3225. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  3226. if (
  3227. config._dayOfYear > daysInYear(yearToUse) ||
  3228. config._dayOfYear === 0
  3229. ) {
  3230. getParsingFlags(config)._overflowDayOfYear = true;
  3231. }
  3232. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  3233. config._a[MONTH] = date.getUTCMonth();
  3234. config._a[DATE] = date.getUTCDate();
  3235. }
  3236. // Default to current date.
  3237. // * if no year, month, day of month are given, default to today
  3238. // * if day of month is given, default month and year
  3239. // * if month is given, default only year
  3240. // * if year is given, don't default anything
  3241. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  3242. config._a[i] = input[i] = currentDate[i];
  3243. }
  3244. // Zero out whatever was not defaulted, including time
  3245. for (; i < 7; i++) {
  3246. config._a[i] = input[i] =
  3247. config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];
  3248. }
  3249. // Check for 24:00:00.000
  3250. if (
  3251. config._a[HOUR] === 24 &&
  3252. config._a[MINUTE] === 0 &&
  3253. config._a[SECOND] === 0 &&
  3254. config._a[MILLISECOND] === 0
  3255. ) {
  3256. config._nextDay = true;
  3257. config._a[HOUR] = 0;
  3258. }
  3259. config._d = (config._useUTC ? createUTCDate : createDate).apply(
  3260. null,
  3261. input
  3262. );
  3263. expectedWeekday = config._useUTC
  3264. ? config._d.getUTCDay()
  3265. : config._d.getDay();
  3266. // Apply timezone offset from input. The actual utcOffset can be changed
  3267. // with parseZone.
  3268. if (config._tzm != null) {
  3269. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  3270. }
  3271. if (config._nextDay) {
  3272. config._a[HOUR] = 24;
  3273. }
  3274. // check for mismatching day of week
  3275. if (
  3276. config._w &&
  3277. typeof config._w.d !== 'undefined' &&
  3278. config._w.d !== expectedWeekday
  3279. ) {
  3280. getParsingFlags(config).weekdayMismatch = true;
  3281. }
  3282. }
  3283. function dayOfYearFromWeekInfo(config) {
  3284. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
  3285. w = config._w;
  3286. if (w.GG != null || w.W != null || w.E != null) {
  3287. dow = 1;
  3288. doy = 4;
  3289. // TODO: We need to take the current isoWeekYear, but that depends on
  3290. // how we interpret now (local, utc, fixed offset). So create
  3291. // a now version of current config (take local/utc/offset flags, and
  3292. // create now).
  3293. weekYear = defaults(
  3294. w.GG,
  3295. config._a[YEAR],
  3296. weekOfYear(createLocal(), 1, 4).year
  3297. );
  3298. week = defaults(w.W, 1);
  3299. weekday = defaults(w.E, 1);
  3300. if (weekday < 1 || weekday > 7) {
  3301. weekdayOverflow = true;
  3302. }
  3303. } else {
  3304. dow = config._locale._week.dow;
  3305. doy = config._locale._week.doy;
  3306. curWeek = weekOfYear(createLocal(), dow, doy);
  3307. weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
  3308. // Default to current week.
  3309. week = defaults(w.w, curWeek.week);
  3310. if (w.d != null) {
  3311. // weekday -- low day numbers are considered next week
  3312. weekday = w.d;
  3313. if (weekday < 0 || weekday > 6) {
  3314. weekdayOverflow = true;
  3315. }
  3316. } else if (w.e != null) {
  3317. // local weekday -- counting starts from beginning of week
  3318. weekday = w.e + dow;
  3319. if (w.e < 0 || w.e > 6) {
  3320. weekdayOverflow = true;
  3321. }
  3322. } else {
  3323. // default to beginning of week
  3324. weekday = dow;
  3325. }
  3326. }
  3327. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  3328. getParsingFlags(config)._overflowWeeks = true;
  3329. } else if (weekdayOverflow != null) {
  3330. getParsingFlags(config)._overflowWeekday = true;
  3331. } else {
  3332. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  3333. config._a[YEAR] = temp.year;
  3334. config._dayOfYear = temp.dayOfYear;
  3335. }
  3336. }
  3337. // constant that refers to the ISO standard
  3338. hooks.ISO_8601 = function () {};
  3339. // constant that refers to the RFC 2822 form
  3340. hooks.RFC_2822 = function () {};
  3341. // date from string and format string
  3342. function configFromStringAndFormat(config) {
  3343. // TODO: Move this to another part of the creation flow to prevent circular deps
  3344. if (config._f === hooks.ISO_8601) {
  3345. configFromISO(config);
  3346. return;
  3347. }
  3348. if (config._f === hooks.RFC_2822) {
  3349. configFromRFC2822(config);
  3350. return;
  3351. }
  3352. config._a = [];
  3353. getParsingFlags(config).empty = true;
  3354. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  3355. var string = '' + config._i,
  3356. i,
  3357. parsedInput,
  3358. tokens,
  3359. token,
  3360. skipped,
  3361. stringLength = string.length,
  3362. totalParsedInputLength = 0,
  3363. era;
  3364. tokens =
  3365. expandFormat(config._f, config._locale).match(formattingTokens) || [];
  3366. for (i = 0; i < tokens.length; i++) {
  3367. token = tokens[i];
  3368. parsedInput = (string.match(getParseRegexForToken(token, config)) ||
  3369. [])[0];
  3370. if (parsedInput) {
  3371. skipped = string.substr(0, string.indexOf(parsedInput));
  3372. if (skipped.length > 0) {
  3373. getParsingFlags(config).unusedInput.push(skipped);
  3374. }
  3375. string = string.slice(
  3376. string.indexOf(parsedInput) + parsedInput.length
  3377. );
  3378. totalParsedInputLength += parsedInput.length;
  3379. }
  3380. // don't parse if it's not a known token
  3381. if (formatTokenFunctions[token]) {
  3382. if (parsedInput) {
  3383. getParsingFlags(config).empty = false;
  3384. } else {
  3385. getParsingFlags(config).unusedTokens.push(token);
  3386. }
  3387. addTimeToArrayFromToken(token, parsedInput, config);
  3388. } else if (config._strict && !parsedInput) {
  3389. getParsingFlags(config).unusedTokens.push(token);
  3390. }
  3391. }
  3392. // add remaining unparsed input length to the string
  3393. getParsingFlags(config).charsLeftOver =
  3394. stringLength - totalParsedInputLength;
  3395. if (string.length > 0) {
  3396. getParsingFlags(config).unusedInput.push(string);
  3397. }
  3398. // clear _12h flag if hour is <= 12
  3399. if (
  3400. config._a[HOUR] <= 12 &&
  3401. getParsingFlags(config).bigHour === true &&
  3402. config._a[HOUR] > 0
  3403. ) {
  3404. getParsingFlags(config).bigHour = undefined;
  3405. }
  3406. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  3407. getParsingFlags(config).meridiem = config._meridiem;
  3408. // handle meridiem
  3409. config._a[HOUR] = meridiemFixWrap(
  3410. config._locale,
  3411. config._a[HOUR],
  3412. config._meridiem
  3413. );
  3414. // handle era
  3415. era = getParsingFlags(config).era;
  3416. if (era !== null) {
  3417. config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
  3418. }
  3419. configFromArray(config);
  3420. checkOverflow(config);
  3421. }
  3422. function meridiemFixWrap(locale, hour, meridiem) {
  3423. var isPm;
  3424. if (meridiem == null) {
  3425. // nothing to do
  3426. return hour;
  3427. }
  3428. if (locale.meridiemHour != null) {
  3429. return locale.meridiemHour(hour, meridiem);
  3430. } else if (locale.isPM != null) {
  3431. // Fallback
  3432. isPm = locale.isPM(meridiem);
  3433. if (isPm && hour < 12) {
  3434. hour += 12;
  3435. }
  3436. if (!isPm && hour === 12) {
  3437. hour = 0;
  3438. }
  3439. return hour;
  3440. } else {
  3441. // this is not supposed to happen
  3442. return hour;
  3443. }
  3444. }
  3445. // date from string and array of format strings
  3446. function configFromStringAndArray(config) {
  3447. var tempConfig,
  3448. bestMoment,
  3449. scoreToBeat,
  3450. i,
  3451. currentScore,
  3452. validFormatFound,
  3453. bestFormatIsValid = false;
  3454. if (config._f.length === 0) {
  3455. getParsingFlags(config).invalidFormat = true;
  3456. config._d = new Date(NaN);
  3457. return;
  3458. }
  3459. for (i = 0; i < config._f.length; i++) {
  3460. currentScore = 0;
  3461. validFormatFound = false;
  3462. tempConfig = copyConfig({}, config);
  3463. if (config._useUTC != null) {
  3464. tempConfig._useUTC = config._useUTC;
  3465. }
  3466. tempConfig._f = config._f[i];
  3467. configFromStringAndFormat(tempConfig);
  3468. if (isValid(tempConfig)) {
  3469. validFormatFound = true;
  3470. }
  3471. // if there is any input that was not parsed add a penalty for that format
  3472. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  3473. //or tokens
  3474. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  3475. getParsingFlags(tempConfig).score = currentScore;
  3476. if (!bestFormatIsValid) {
  3477. if (
  3478. scoreToBeat == null ||
  3479. currentScore < scoreToBeat ||
  3480. validFormatFound
  3481. ) {
  3482. scoreToBeat = currentScore;
  3483. bestMoment = tempConfig;
  3484. if (validFormatFound) {
  3485. bestFormatIsValid = true;
  3486. }
  3487. }
  3488. } else {
  3489. if (currentScore < scoreToBeat) {
  3490. scoreToBeat = currentScore;
  3491. bestMoment = tempConfig;
  3492. }
  3493. }
  3494. }
  3495. extend(config, bestMoment || tempConfig);
  3496. }
  3497. function configFromObject(config) {
  3498. if (config._d) {
  3499. return;
  3500. }
  3501. var i = normalizeObjectUnits(config._i),
  3502. dayOrDate = i.day === undefined ? i.date : i.day;
  3503. config._a = map(
  3504. [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
  3505. function (obj) {
  3506. return obj && parseInt(obj, 10);
  3507. }
  3508. );
  3509. configFromArray(config);
  3510. }
  3511. function createFromConfig(config) {
  3512. var res = new Moment(checkOverflow(prepareConfig(config)));
  3513. if (res._nextDay) {
  3514. // Adding is smart enough around DST
  3515. res.add(1, 'd');
  3516. res._nextDay = undefined;
  3517. }
  3518. return res;
  3519. }
  3520. function prepareConfig(config) {
  3521. var input = config._i,
  3522. format = config._f;
  3523. config._locale = config._locale || getLocale(config._l);
  3524. if (input === null || (format === undefined && input === '')) {
  3525. return createInvalid({ nullInput: true });
  3526. }
  3527. if (typeof input === 'string') {
  3528. config._i = input = config._locale.preparse(input);
  3529. }
  3530. if (isMoment(input)) {
  3531. return new Moment(checkOverflow(input));
  3532. } else if (isDate(input)) {
  3533. config._d = input;
  3534. } else if (isArray(format)) {
  3535. configFromStringAndArray(config);
  3536. } else if (format) {
  3537. configFromStringAndFormat(config);
  3538. } else {
  3539. configFromInput(config);
  3540. }
  3541. if (!isValid(config)) {
  3542. config._d = null;
  3543. }
  3544. return config;
  3545. }
  3546. function configFromInput(config) {
  3547. var input = config._i;
  3548. if (isUndefined(input)) {
  3549. config._d = new Date(hooks.now());
  3550. } else if (isDate(input)) {
  3551. config._d = new Date(input.valueOf());
  3552. } else if (typeof input === 'string') {
  3553. configFromString(config);
  3554. } else if (isArray(input)) {
  3555. config._a = map(input.slice(0), function (obj) {
  3556. return parseInt(obj, 10);
  3557. });
  3558. configFromArray(config);
  3559. } else if (isObject(input)) {
  3560. configFromObject(config);
  3561. } else if (isNumber(input)) {
  3562. // from milliseconds
  3563. config._d = new Date(input);
  3564. } else {
  3565. hooks.createFromInputFallback(config);
  3566. }
  3567. }
  3568. function createLocalOrUTC(input, format, locale, strict, isUTC) {
  3569. var c = {};
  3570. if (format === true || format === false) {
  3571. strict = format;
  3572. format = undefined;
  3573. }
  3574. if (locale === true || locale === false) {
  3575. strict = locale;
  3576. locale = undefined;
  3577. }
  3578. if (
  3579. (isObject(input) && isObjectEmpty(input)) ||
  3580. (isArray(input) && input.length === 0)
  3581. ) {
  3582. input = undefined;
  3583. }
  3584. // object construction must be done this way.
  3585. // https://github.com/moment/moment/issues/1423
  3586. c._isAMomentObject = true;
  3587. c._useUTC = c._isUTC = isUTC;
  3588. c._l = locale;
  3589. c._i = input;
  3590. c._f = format;
  3591. c._strict = strict;
  3592. return createFromConfig(c);
  3593. }
  3594. function createLocal(input, format, locale, strict) {
  3595. return createLocalOrUTC(input, format, locale, strict, false);
  3596. }
  3597. var prototypeMin = deprecate(
  3598. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  3599. function () {
  3600. var other = createLocal.apply(null, arguments);
  3601. if (this.isValid() && other.isValid()) {
  3602. return other < this ? this : other;
  3603. } else {
  3604. return createInvalid();
  3605. }
  3606. }
  3607. ),
  3608. prototypeMax = deprecate(
  3609. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  3610. function () {
  3611. var other = createLocal.apply(null, arguments);
  3612. if (this.isValid() && other.isValid()) {
  3613. return other > this ? this : other;
  3614. } else {
  3615. return createInvalid();
  3616. }
  3617. }
  3618. );
  3619. // Pick a moment m from moments so that m[fn](other) is true for all
  3620. // other. This relies on the function fn to be transitive.
  3621. //
  3622. // moments should either be an array of moment objects or an array, whose
  3623. // first element is an array of moment objects.
  3624. function pickBy(fn, moments) {
  3625. var res, i;
  3626. if (moments.length === 1 && isArray(moments[0])) {
  3627. moments = moments[0];
  3628. }
  3629. if (!moments.length) {
  3630. return createLocal();
  3631. }
  3632. res = moments[0];
  3633. for (i = 1; i < moments.length; ++i) {
  3634. if (!moments[i].isValid() || moments[i][fn](res)) {
  3635. res = moments[i];
  3636. }
  3637. }
  3638. return res;
  3639. }
  3640. // TODO: Use [].sort instead?
  3641. function min() {
  3642. var args = [].slice.call(arguments, 0);
  3643. return pickBy('isBefore', args);
  3644. }
  3645. function max() {
  3646. var args = [].slice.call(arguments, 0);
  3647. return pickBy('isAfter', args);
  3648. }
  3649. var now = function () {
  3650. return Date.now ? Date.now() : +new Date();
  3651. };
  3652. var ordering = [
  3653. 'year',
  3654. 'quarter',
  3655. 'month',
  3656. 'week',
  3657. 'day',
  3658. 'hour',
  3659. 'minute',
  3660. 'second',
  3661. 'millisecond',
  3662. ];
  3663. function isDurationValid(m) {
  3664. var key,
  3665. unitHasDecimal = false,
  3666. i;
  3667. for (key in m) {
  3668. if (
  3669. hasOwnProp(m, key) &&
  3670. !(
  3671. indexOf.call(ordering, key) !== -1 &&
  3672. (m[key] == null || !isNaN(m[key]))
  3673. )
  3674. ) {
  3675. return false;
  3676. }
  3677. }
  3678. for (i = 0; i < ordering.length; ++i) {
  3679. if (m[ordering[i]]) {
  3680. if (unitHasDecimal) {
  3681. return false; // only allow non-integers for smallest unit
  3682. }
  3683. if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
  3684. unitHasDecimal = true;
  3685. }
  3686. }
  3687. }
  3688. return true;
  3689. }
  3690. function isValid$1() {
  3691. return this._isValid;
  3692. }
  3693. function createInvalid$1() {
  3694. return createDuration(NaN);
  3695. }
  3696. function Duration(duration) {
  3697. var normalizedInput = normalizeObjectUnits(duration),
  3698. years = normalizedInput.year || 0,
  3699. quarters = normalizedInput.quarter || 0,
  3700. months = normalizedInput.month || 0,
  3701. weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
  3702. days = normalizedInput.day || 0,
  3703. hours = normalizedInput.hour || 0,
  3704. minutes = normalizedInput.minute || 0,
  3705. seconds = normalizedInput.second || 0,
  3706. milliseconds = normalizedInput.millisecond || 0;
  3707. this._isValid = isDurationValid(normalizedInput);
  3708. // representation for dateAddRemove
  3709. this._milliseconds =
  3710. +milliseconds +
  3711. seconds * 1e3 + // 1000
  3712. minutes * 6e4 + // 1000 * 60
  3713. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  3714. // Because of dateAddRemove treats 24 hours as different from a
  3715. // day when working around DST, we need to store them separately
  3716. this._days = +days + weeks * 7;
  3717. // It is impossible to translate months into days without knowing
  3718. // which months you are are talking about, so we have to store
  3719. // it separately.
  3720. this._months = +months + quarters * 3 + years * 12;
  3721. this._data = {};
  3722. this._locale = getLocale();
  3723. this._bubble();
  3724. }
  3725. function isDuration(obj) {
  3726. return obj instanceof Duration;
  3727. }
  3728. function absRound(number) {
  3729. if (number < 0) {
  3730. return Math.round(-1 * number) * -1;
  3731. } else {
  3732. return Math.round(number);
  3733. }
  3734. }
  3735. // compare two arrays, return the number of differences
  3736. function compareArrays(array1, array2, dontConvert) {
  3737. var len = Math.min(array1.length, array2.length),
  3738. lengthDiff = Math.abs(array1.length - array2.length),
  3739. diffs = 0,
  3740. i;
  3741. for (i = 0; i < len; i++) {
  3742. if (
  3743. (dontConvert && array1[i] !== array2[i]) ||
  3744. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
  3745. ) {
  3746. diffs++;
  3747. }
  3748. }
  3749. return diffs + lengthDiff;
  3750. }
  3751. // FORMATTING
  3752. function offset(token, separator) {
  3753. addFormatToken(token, 0, 0, function () {
  3754. var offset = this.utcOffset(),
  3755. sign = '+';
  3756. if (offset < 0) {
  3757. offset = -offset;
  3758. sign = '-';
  3759. }
  3760. return (
  3761. sign +
  3762. zeroFill(~~(offset / 60), 2) +
  3763. separator +
  3764. zeroFill(~~offset % 60, 2)
  3765. );
  3766. });
  3767. }
  3768. offset('Z', ':');
  3769. offset('ZZ', '');
  3770. // PARSING
  3771. addRegexToken('Z', matchShortOffset);
  3772. addRegexToken('ZZ', matchShortOffset);
  3773. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  3774. config._useUTC = true;
  3775. config._tzm = offsetFromString(matchShortOffset, input);
  3776. });
  3777. // HELPERS
  3778. // timezone chunker
  3779. // '+10:00' > ['10', '00']
  3780. // '-1530' > ['-15', '30']
  3781. var chunkOffset = /([\+\-]|\d\d)/gi;
  3782. function offsetFromString(matcher, string) {
  3783. var matches = (string || '').match(matcher),
  3784. chunk,
  3785. parts,
  3786. minutes;
  3787. if (matches === null) {
  3788. return null;
  3789. }
  3790. chunk = matches[matches.length - 1] || [];
  3791. parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  3792. minutes = +(parts[1] * 60) + toInt(parts[2]);
  3793. return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
  3794. }
  3795. // Return a moment from input, that is local/utc/zone equivalent to model.
  3796. function cloneWithOffset(input, model) {
  3797. var res, diff;
  3798. if (model._isUTC) {
  3799. res = model.clone();
  3800. diff =
  3801. (isMoment(input) || isDate(input)
  3802. ? input.valueOf()
  3803. : createLocal(input).valueOf()) - res.valueOf();
  3804. // Use low-level api, because this fn is low-level api.
  3805. res._d.setTime(res._d.valueOf() + diff);
  3806. hooks.updateOffset(res, false);
  3807. return res;
  3808. } else {
  3809. return createLocal(input).local();
  3810. }
  3811. }
  3812. function getDateOffset(m) {
  3813. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  3814. // https://github.com/moment/moment/pull/1871
  3815. return -Math.round(m._d.getTimezoneOffset());
  3816. }
  3817. // HOOKS
  3818. // This function will be called whenever a moment is mutated.
  3819. // It is intended to keep the offset in sync with the timezone.
  3820. hooks.updateOffset = function () {};
  3821. // MOMENTS
  3822. // keepLocalTime = true means only change the timezone, without
  3823. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  3824. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  3825. // +0200, so we adjust the time as needed, to be valid.
  3826. //
  3827. // Keeping the time actually adds/subtracts (one hour)
  3828. // from the actual represented time. That is why we call updateOffset
  3829. // a second time. In case it wants us to change the offset again
  3830. // _changeInProgress == true case, then we have to adjust, because
  3831. // there is no such time in the given timezone.
  3832. function getSetOffset(input, keepLocalTime, keepMinutes) {
  3833. var offset = this._offset || 0,
  3834. localAdjust;
  3835. if (!this.isValid()) {
  3836. return input != null ? this : NaN;
  3837. }
  3838. if (input != null) {
  3839. if (typeof input === 'string') {
  3840. input = offsetFromString(matchShortOffset, input);
  3841. if (input === null) {
  3842. return this;
  3843. }
  3844. } else if (Math.abs(input) < 16 && !keepMinutes) {
  3845. input = input * 60;
  3846. }
  3847. if (!this._isUTC && keepLocalTime) {
  3848. localAdjust = getDateOffset(this);
  3849. }
  3850. this._offset = input;
  3851. this._isUTC = true;
  3852. if (localAdjust != null) {
  3853. this.add(localAdjust, 'm');
  3854. }
  3855. if (offset !== input) {
  3856. if (!keepLocalTime || this._changeInProgress) {
  3857. addSubtract(
  3858. this,
  3859. createDuration(input - offset, 'm'),
  3860. 1,
  3861. false
  3862. );
  3863. } else if (!this._changeInProgress) {
  3864. this._changeInProgress = true;
  3865. hooks.updateOffset(this, true);
  3866. this._changeInProgress = null;
  3867. }
  3868. }
  3869. return this;
  3870. } else {
  3871. return this._isUTC ? offset : getDateOffset(this);
  3872. }
  3873. }
  3874. function getSetZone(input, keepLocalTime) {
  3875. if (input != null) {
  3876. if (typeof input !== 'string') {
  3877. input = -input;
  3878. }
  3879. this.utcOffset(input, keepLocalTime);
  3880. return this;
  3881. } else {
  3882. return -this.utcOffset();
  3883. }
  3884. }
  3885. function setOffsetToUTC(keepLocalTime) {
  3886. return this.utcOffset(0, keepLocalTime);
  3887. }
  3888. function setOffsetToLocal(keepLocalTime) {
  3889. if (this._isUTC) {
  3890. this.utcOffset(0, keepLocalTime);
  3891. this._isUTC = false;
  3892. if (keepLocalTime) {
  3893. this.subtract(getDateOffset(this), 'm');
  3894. }
  3895. }
  3896. return this;
  3897. }
  3898. function setOffsetToParsedOffset() {
  3899. if (this._tzm != null) {
  3900. this.utcOffset(this._tzm, false, true);
  3901. } else if (typeof this._i === 'string') {
  3902. var tZone = offsetFromString(matchOffset, this._i);
  3903. if (tZone != null) {
  3904. this.utcOffset(tZone);
  3905. } else {
  3906. this.utcOffset(0, true);
  3907. }
  3908. }
  3909. return this;
  3910. }
  3911. function hasAlignedHourOffset(input) {
  3912. if (!this.isValid()) {
  3913. return false;
  3914. }
  3915. input = input ? createLocal(input).utcOffset() : 0;
  3916. return (this.utcOffset() - input) % 60 === 0;
  3917. }
  3918. function isDaylightSavingTime() {
  3919. return (
  3920. this.utcOffset() > this.clone().month(0).utcOffset() ||
  3921. this.utcOffset() > this.clone().month(5).utcOffset()
  3922. );
  3923. }
  3924. function isDaylightSavingTimeShifted() {
  3925. if (!isUndefined(this._isDSTShifted)) {
  3926. return this._isDSTShifted;
  3927. }
  3928. var c = {},
  3929. other;
  3930. copyConfig(c, this);
  3931. c = prepareConfig(c);
  3932. if (c._a) {
  3933. other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
  3934. this._isDSTShifted =
  3935. this.isValid() && compareArrays(c._a, other.toArray()) > 0;
  3936. } else {
  3937. this._isDSTShifted = false;
  3938. }
  3939. return this._isDSTShifted;
  3940. }
  3941. function isLocal() {
  3942. return this.isValid() ? !this._isUTC : false;
  3943. }
  3944. function isUtcOffset() {
  3945. return this.isValid() ? this._isUTC : false;
  3946. }
  3947. function isUtc() {
  3948. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  3949. }
  3950. // ASP.NET json date format regex
  3951. var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
  3952. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  3953. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  3954. // and further modified to allow for strings containing both week and day
  3955. isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
  3956. function createDuration(input, key) {
  3957. var duration = input,
  3958. // matching against regexp is expensive, do it on demand
  3959. match = null,
  3960. sign,
  3961. ret,
  3962. diffRes;
  3963. if (isDuration(input)) {
  3964. duration = {
  3965. ms: input._milliseconds,
  3966. d: input._days,
  3967. M: input._months,
  3968. };
  3969. } else if (isNumber(input) || !isNaN(+input)) {
  3970. duration = {};
  3971. if (key) {
  3972. duration[key] = +input;
  3973. } else {
  3974. duration.milliseconds = +input;
  3975. }
  3976. } else if ((match = aspNetRegex.exec(input))) {
  3977. sign = match[1] === '-' ? -1 : 1;
  3978. duration = {
  3979. y: 0,
  3980. d: toInt(match[DATE]) * sign,
  3981. h: toInt(match[HOUR]) * sign,
  3982. m: toInt(match[MINUTE]) * sign,
  3983. s: toInt(match[SECOND]) * sign,
  3984. ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match
  3985. };
  3986. } else if ((match = isoRegex.exec(input))) {
  3987. sign = match[1] === '-' ? -1 : 1;
  3988. duration = {
  3989. y: parseIso(match[2], sign),
  3990. M: parseIso(match[3], sign),
  3991. w: parseIso(match[4], sign),
  3992. d: parseIso(match[5], sign),
  3993. h: parseIso(match[6], sign),
  3994. m: parseIso(match[7], sign),
  3995. s: parseIso(match[8], sign),
  3996. };
  3997. } else if (duration == null) {
  3998. // checks for null or undefined
  3999. duration = {};
  4000. } else if (
  4001. typeof duration === 'object' &&
  4002. ('from' in duration || 'to' in duration)
  4003. ) {
  4004. diffRes = momentsDifference(
  4005. createLocal(duration.from),
  4006. createLocal(duration.to)
  4007. );
  4008. duration = {};
  4009. duration.ms = diffRes.milliseconds;
  4010. duration.M = diffRes.months;
  4011. }
  4012. ret = new Duration(duration);
  4013. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  4014. ret._locale = input._locale;
  4015. }
  4016. if (isDuration(input) && hasOwnProp(input, '_isValid')) {
  4017. ret._isValid = input._isValid;
  4018. }
  4019. return ret;
  4020. }
  4021. createDuration.fn = Duration.prototype;
  4022. createDuration.invalid = createInvalid$1;
  4023. function parseIso(inp, sign) {
  4024. // We'd normally use ~~inp for this, but unfortunately it also
  4025. // converts floats to ints.
  4026. // inp may be undefined, so careful calling replace on it.
  4027. var res = inp && parseFloat(inp.replace(',', '.'));
  4028. // apply sign while we're at it
  4029. return (isNaN(res) ? 0 : res) * sign;
  4030. }
  4031. function positiveMomentsDifference(base, other) {
  4032. var res = {};
  4033. res.months =
  4034. other.month() - base.month() + (other.year() - base.year()) * 12;
  4035. if (base.clone().add(res.months, 'M').isAfter(other)) {
  4036. --res.months;
  4037. }
  4038. res.milliseconds = +other - +base.clone().add(res.months, 'M');
  4039. return res;
  4040. }
  4041. function momentsDifference(base, other) {
  4042. var res;
  4043. if (!(base.isValid() && other.isValid())) {
  4044. return { milliseconds: 0, months: 0 };
  4045. }
  4046. other = cloneWithOffset(other, base);
  4047. if (base.isBefore(other)) {
  4048. res = positiveMomentsDifference(base, other);
  4049. } else {
  4050. res = positiveMomentsDifference(other, base);
  4051. res.milliseconds = -res.milliseconds;
  4052. res.months = -res.months;
  4053. }
  4054. return res;
  4055. }
  4056. // TODO: remove 'name' arg after deprecation is removed
  4057. function createAdder(direction, name) {
  4058. return function (val, period) {
  4059. var dur, tmp;
  4060. //invert the arguments, but complain about it
  4061. if (period !== null && !isNaN(+period)) {
  4062. deprecateSimple(
  4063. name,
  4064. 'moment().' +
  4065. name +
  4066. '(period, number) is deprecated. Please use moment().' +
  4067. name +
  4068. '(number, period). ' +
  4069. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'
  4070. );
  4071. tmp = val;
  4072. val = period;
  4073. period = tmp;
  4074. }
  4075. dur = createDuration(val, period);
  4076. addSubtract(this, dur, direction);
  4077. return this;
  4078. };
  4079. }
  4080. function addSubtract(mom, duration, isAdding, updateOffset) {
  4081. var milliseconds = duration._milliseconds,
  4082. days = absRound(duration._days),
  4083. months = absRound(duration._months);
  4084. if (!mom.isValid()) {
  4085. // No op
  4086. return;
  4087. }
  4088. updateOffset = updateOffset == null ? true : updateOffset;
  4089. if (months) {
  4090. setMonth(mom, get(mom, 'Month') + months * isAdding);
  4091. }
  4092. if (days) {
  4093. set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
  4094. }
  4095. if (milliseconds) {
  4096. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  4097. }
  4098. if (updateOffset) {
  4099. hooks.updateOffset(mom, days || months);
  4100. }
  4101. }
  4102. var add = createAdder(1, 'add'),
  4103. subtract = createAdder(-1, 'subtract');
  4104. function isString(input) {
  4105. return typeof input === 'string' || input instanceof String;
  4106. }
  4107. // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
  4108. function isMomentInput(input) {
  4109. return (
  4110. isMoment(input) ||
  4111. isDate(input) ||
  4112. isString(input) ||
  4113. isNumber(input) ||
  4114. isNumberOrStringArray(input) ||
  4115. isMomentInputObject(input) ||
  4116. input === null ||
  4117. input === undefined
  4118. );
  4119. }
  4120. function isMomentInputObject(input) {
  4121. var objectTest = isObject(input) && !isObjectEmpty(input),
  4122. propertyTest = false,
  4123. properties = [
  4124. 'years',
  4125. 'year',
  4126. 'y',
  4127. 'months',
  4128. 'month',
  4129. 'M',
  4130. 'days',
  4131. 'day',
  4132. 'd',
  4133. 'dates',
  4134. 'date',
  4135. 'D',
  4136. 'hours',
  4137. 'hour',
  4138. 'h',
  4139. 'minutes',
  4140. 'minute',
  4141. 'm',
  4142. 'seconds',
  4143. 'second',
  4144. 's',
  4145. 'milliseconds',
  4146. 'millisecond',
  4147. 'ms',
  4148. ],
  4149. i,
  4150. property;
  4151. for (i = 0; i < properties.length; i += 1) {
  4152. property = properties[i];
  4153. propertyTest = propertyTest || hasOwnProp(input, property);
  4154. }
  4155. return objectTest && propertyTest;
  4156. }
  4157. function isNumberOrStringArray(input) {
  4158. var arrayTest = isArray(input),
  4159. dataTypeTest = false;
  4160. if (arrayTest) {
  4161. dataTypeTest =
  4162. input.filter(function (item) {
  4163. return !isNumber(item) && isString(input);
  4164. }).length === 0;
  4165. }
  4166. return arrayTest && dataTypeTest;
  4167. }
  4168. function isCalendarSpec(input) {
  4169. var objectTest = isObject(input) && !isObjectEmpty(input),
  4170. propertyTest = false,
  4171. properties = [
  4172. 'sameDay',
  4173. 'nextDay',
  4174. 'lastDay',
  4175. 'nextWeek',
  4176. 'lastWeek',
  4177. 'sameElse',
  4178. ],
  4179. i,
  4180. property;
  4181. for (i = 0; i < properties.length; i += 1) {
  4182. property = properties[i];
  4183. propertyTest = propertyTest || hasOwnProp(input, property);
  4184. }
  4185. return objectTest && propertyTest;
  4186. }
  4187. function getCalendarFormat(myMoment, now) {
  4188. var diff = myMoment.diff(now, 'days', true);
  4189. return diff < -6
  4190. ? 'sameElse'
  4191. : diff < -1
  4192. ? 'lastWeek'
  4193. : diff < 0
  4194. ? 'lastDay'
  4195. : diff < 1
  4196. ? 'sameDay'
  4197. : diff < 2
  4198. ? 'nextDay'
  4199. : diff < 7
  4200. ? 'nextWeek'
  4201. : 'sameElse';
  4202. }
  4203. function calendar$1(time, formats) {
  4204. // Support for single parameter, formats only overload to the calendar function
  4205. if (arguments.length === 1) {
  4206. if (isMomentInput(arguments[0])) {
  4207. time = arguments[0];
  4208. formats = undefined;
  4209. } else if (isCalendarSpec(arguments[0])) {
  4210. formats = arguments[0];
  4211. time = undefined;
  4212. }
  4213. }
  4214. // We want to compare the start of today, vs this.
  4215. // Getting start-of-today depends on whether we're local/utc/offset or not.
  4216. var now = time || createLocal(),
  4217. sod = cloneWithOffset(now, this).startOf('day'),
  4218. format = hooks.calendarFormat(this, sod) || 'sameElse',
  4219. output =
  4220. formats &&
  4221. (isFunction(formats[format])
  4222. ? formats[format].call(this, now)
  4223. : formats[format]);
  4224. return this.format(
  4225. output || this.localeData().calendar(format, this, createLocal(now))
  4226. );
  4227. }
  4228. function clone() {
  4229. return new Moment(this);
  4230. }
  4231. function isAfter(input, units) {
  4232. var localInput = isMoment(input) ? input : createLocal(input);
  4233. if (!(this.isValid() && localInput.isValid())) {
  4234. return false;
  4235. }
  4236. units = normalizeUnits(units) || 'millisecond';
  4237. if (units === 'millisecond') {
  4238. return this.valueOf() > localInput.valueOf();
  4239. } else {
  4240. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  4241. }
  4242. }
  4243. function isBefore(input, units) {
  4244. var localInput = isMoment(input) ? input : createLocal(input);
  4245. if (!(this.isValid() && localInput.isValid())) {
  4246. return false;
  4247. }
  4248. units = normalizeUnits(units) || 'millisecond';
  4249. if (units === 'millisecond') {
  4250. return this.valueOf() < localInput.valueOf();
  4251. } else {
  4252. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  4253. }
  4254. }
  4255. function isBetween(from, to, units, inclusivity) {
  4256. var localFrom = isMoment(from) ? from : createLocal(from),
  4257. localTo = isMoment(to) ? to : createLocal(to);
  4258. if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
  4259. return false;
  4260. }
  4261. inclusivity = inclusivity || '()';
  4262. return (
  4263. (inclusivity[0] === '('
  4264. ? this.isAfter(localFrom, units)
  4265. : !this.isBefore(localFrom, units)) &&
  4266. (inclusivity[1] === ')'
  4267. ? this.isBefore(localTo, units)
  4268. : !this.isAfter(localTo, units))
  4269. );
  4270. }
  4271. function isSame(input, units) {
  4272. var localInput = isMoment(input) ? input : createLocal(input),
  4273. inputMs;
  4274. if (!(this.isValid() && localInput.isValid())) {
  4275. return false;
  4276. }
  4277. units = normalizeUnits(units) || 'millisecond';
  4278. if (units === 'millisecond') {
  4279. return this.valueOf() === localInput.valueOf();
  4280. } else {
  4281. inputMs = localInput.valueOf();
  4282. return (
  4283. this.clone().startOf(units).valueOf() <= inputMs &&
  4284. inputMs <= this.clone().endOf(units).valueOf()
  4285. );
  4286. }
  4287. }
  4288. function isSameOrAfter(input, units) {
  4289. return this.isSame(input, units) || this.isAfter(input, units);
  4290. }
  4291. function isSameOrBefore(input, units) {
  4292. return this.isSame(input, units) || this.isBefore(input, units);
  4293. }
  4294. function diff(input, units, asFloat) {
  4295. var that, zoneDelta, output;
  4296. if (!this.isValid()) {
  4297. return NaN;
  4298. }
  4299. that = cloneWithOffset(input, this);
  4300. if (!that.isValid()) {
  4301. return NaN;
  4302. }
  4303. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  4304. units = normalizeUnits(units);
  4305. switch (units) {
  4306. case 'year':
  4307. output = monthDiff(this, that) / 12;
  4308. break;
  4309. case 'month':
  4310. output = monthDiff(this, that);
  4311. break;
  4312. case 'quarter':
  4313. output = monthDiff(this, that) / 3;
  4314. break;
  4315. case 'second':
  4316. output = (this - that) / 1e3;
  4317. break; // 1000
  4318. case 'minute':
  4319. output = (this - that) / 6e4;
  4320. break; // 1000 * 60
  4321. case 'hour':
  4322. output = (this - that) / 36e5;
  4323. break; // 1000 * 60 * 60
  4324. case 'day':
  4325. output = (this - that - zoneDelta) / 864e5;
  4326. break; // 1000 * 60 * 60 * 24, negate dst
  4327. case 'week':
  4328. output = (this - that - zoneDelta) / 6048e5;
  4329. break; // 1000 * 60 * 60 * 24 * 7, negate dst
  4330. default:
  4331. output = this - that;
  4332. }
  4333. return asFloat ? output : absFloor(output);
  4334. }
  4335. function monthDiff(a, b) {
  4336. if (a.date() < b.date()) {
  4337. // end-of-month calculations work correct when the start month has more
  4338. // days than the end month.
  4339. return -monthDiff(b, a);
  4340. }
  4341. // difference in months
  4342. var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
  4343. // b is in (anchor - 1 month, anchor + 1 month)
  4344. anchor = a.clone().add(wholeMonthDiff, 'months'),
  4345. anchor2,
  4346. adjust;
  4347. if (b - anchor < 0) {
  4348. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  4349. // linear across the month
  4350. adjust = (b - anchor) / (anchor - anchor2);
  4351. } else {
  4352. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  4353. // linear across the month
  4354. adjust = (b - anchor) / (anchor2 - anchor);
  4355. }
  4356. //check for negative zero, return zero if negative zero
  4357. return -(wholeMonthDiff + adjust) || 0;
  4358. }
  4359. hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  4360. hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  4361. function toString() {
  4362. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  4363. }
  4364. function toISOString(keepOffset) {
  4365. if (!this.isValid()) {
  4366. return null;
  4367. }
  4368. var utc = keepOffset !== true,
  4369. m = utc ? this.clone().utc() : this;
  4370. if (m.year() < 0 || m.year() > 9999) {
  4371. return formatMoment(
  4372. m,
  4373. utc
  4374. ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'
  4375. : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'
  4376. );
  4377. }
  4378. if (isFunction(Date.prototype.toISOString)) {
  4379. // native implementation is ~50x faster, use it when we can
  4380. if (utc) {
  4381. return this.toDate().toISOString();
  4382. } else {
  4383. return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)
  4384. .toISOString()
  4385. .replace('Z', formatMoment(m, 'Z'));
  4386. }
  4387. }
  4388. return formatMoment(
  4389. m,
  4390. utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'
  4391. );
  4392. }
  4393. /**
  4394. * Return a human readable representation of a moment that can
  4395. * also be evaluated to get a new moment which is the same
  4396. *
  4397. * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
  4398. */
  4399. function inspect() {
  4400. if (!this.isValid()) {
  4401. return 'moment.invalid(/* ' + this._i + ' */)';
  4402. }
  4403. var func = 'moment',
  4404. zone = '',
  4405. prefix,
  4406. year,
  4407. datetime,
  4408. suffix;
  4409. if (!this.isLocal()) {
  4410. func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
  4411. zone = 'Z';
  4412. }
  4413. prefix = '[' + func + '("]';
  4414. year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
  4415. datetime = '-MM-DD[T]HH:mm:ss.SSS';
  4416. suffix = zone + '[")]';
  4417. return this.format(prefix + year + datetime + suffix);
  4418. }
  4419. function format(inputString) {
  4420. if (!inputString) {
  4421. inputString = this.isUtc()
  4422. ? hooks.defaultFormatUtc
  4423. : hooks.defaultFormat;
  4424. }
  4425. var output = formatMoment(this, inputString);
  4426. return this.localeData().postformat(output);
  4427. }
  4428. function from(time, withoutSuffix) {
  4429. if (
  4430. this.isValid() &&
  4431. ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
  4432. ) {
  4433. return createDuration({ to: this, from: time })
  4434. .locale(this.locale())
  4435. .humanize(!withoutSuffix);
  4436. } else {
  4437. return this.localeData().invalidDate();
  4438. }
  4439. }
  4440. function fromNow(withoutSuffix) {
  4441. return this.from(createLocal(), withoutSuffix);
  4442. }
  4443. function to(time, withoutSuffix) {
  4444. if (
  4445. this.isValid() &&
  4446. ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
  4447. ) {
  4448. return createDuration({ from: this, to: time })
  4449. .locale(this.locale())
  4450. .humanize(!withoutSuffix);
  4451. } else {
  4452. return this.localeData().invalidDate();
  4453. }
  4454. }
  4455. function toNow(withoutSuffix) {
  4456. return this.to(createLocal(), withoutSuffix);
  4457. }
  4458. // If passed a locale key, it will set the locale for this
  4459. // instance. Otherwise, it will return the locale configuration
  4460. // variables for this instance.
  4461. function locale(key) {
  4462. var newLocaleData;
  4463. if (key === undefined) {
  4464. return this._locale._abbr;
  4465. } else {
  4466. newLocaleData = getLocale(key);
  4467. if (newLocaleData != null) {
  4468. this._locale = newLocaleData;
  4469. }
  4470. return this;
  4471. }
  4472. }
  4473. var lang = deprecate(
  4474. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  4475. function (key) {
  4476. if (key === undefined) {
  4477. return this.localeData();
  4478. } else {
  4479. return this.locale(key);
  4480. }
  4481. }
  4482. );
  4483. function localeData() {
  4484. return this._locale;
  4485. }
  4486. var MS_PER_SECOND = 1000,
  4487. MS_PER_MINUTE = 60 * MS_PER_SECOND,
  4488. MS_PER_HOUR = 60 * MS_PER_MINUTE,
  4489. MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
  4490. // actual modulo - handles negative numbers (for dates before 1970):
  4491. function mod$1(dividend, divisor) {
  4492. return ((dividend % divisor) + divisor) % divisor;
  4493. }
  4494. function localStartOfDate(y, m, d) {
  4495. // the date constructor remaps years 0-99 to 1900-1999
  4496. if (y < 100 && y >= 0) {
  4497. // preserve leap years using a full 400 year cycle, then reset
  4498. return new Date(y + 400, m, d) - MS_PER_400_YEARS;
  4499. } else {
  4500. return new Date(y, m, d).valueOf();
  4501. }
  4502. }
  4503. function utcStartOfDate(y, m, d) {
  4504. // Date.UTC remaps years 0-99 to 1900-1999
  4505. if (y < 100 && y >= 0) {
  4506. // preserve leap years using a full 400 year cycle, then reset
  4507. return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
  4508. } else {
  4509. return Date.UTC(y, m, d);
  4510. }
  4511. }
  4512. function startOf(units) {
  4513. var time, startOfDate;
  4514. units = normalizeUnits(units);
  4515. if (units === undefined || units === 'millisecond' || !this.isValid()) {
  4516. return this;
  4517. }
  4518. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  4519. switch (units) {
  4520. case 'year':
  4521. time = startOfDate(this.year(), 0, 1);
  4522. break;
  4523. case 'quarter':
  4524. time = startOfDate(
  4525. this.year(),
  4526. this.month() - (this.month() % 3),
  4527. 1
  4528. );
  4529. break;
  4530. case 'month':
  4531. time = startOfDate(this.year(), this.month(), 1);
  4532. break;
  4533. case 'week':
  4534. time = startOfDate(
  4535. this.year(),
  4536. this.month(),
  4537. this.date() - this.weekday()
  4538. );
  4539. break;
  4540. case 'isoWeek':
  4541. time = startOfDate(
  4542. this.year(),
  4543. this.month(),
  4544. this.date() - (this.isoWeekday() - 1)
  4545. );
  4546. break;
  4547. case 'day':
  4548. case 'date':
  4549. time = startOfDate(this.year(), this.month(), this.date());
  4550. break;
  4551. case 'hour':
  4552. time = this._d.valueOf();
  4553. time -= mod$1(
  4554. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  4555. MS_PER_HOUR
  4556. );
  4557. break;
  4558. case 'minute':
  4559. time = this._d.valueOf();
  4560. time -= mod$1(time, MS_PER_MINUTE);
  4561. break;
  4562. case 'second':
  4563. time = this._d.valueOf();
  4564. time -= mod$1(time, MS_PER_SECOND);
  4565. break;
  4566. }
  4567. this._d.setTime(time);
  4568. hooks.updateOffset(this, true);
  4569. return this;
  4570. }
  4571. function endOf(units) {
  4572. var time, startOfDate;
  4573. units = normalizeUnits(units);
  4574. if (units === undefined || units === 'millisecond' || !this.isValid()) {
  4575. return this;
  4576. }
  4577. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  4578. switch (units) {
  4579. case 'year':
  4580. time = startOfDate(this.year() + 1, 0, 1) - 1;
  4581. break;
  4582. case 'quarter':
  4583. time =
  4584. startOfDate(
  4585. this.year(),
  4586. this.month() - (this.month() % 3) + 3,
  4587. 1
  4588. ) - 1;
  4589. break;
  4590. case 'month':
  4591. time = startOfDate(this.year(), this.month() + 1, 1) - 1;
  4592. break;
  4593. case 'week':
  4594. time =
  4595. startOfDate(
  4596. this.year(),
  4597. this.month(),
  4598. this.date() - this.weekday() + 7
  4599. ) - 1;
  4600. break;
  4601. case 'isoWeek':
  4602. time =
  4603. startOfDate(
  4604. this.year(),
  4605. this.month(),
  4606. this.date() - (this.isoWeekday() - 1) + 7
  4607. ) - 1;
  4608. break;
  4609. case 'day':
  4610. case 'date':
  4611. time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
  4612. break;
  4613. case 'hour':
  4614. time = this._d.valueOf();
  4615. time +=
  4616. MS_PER_HOUR -
  4617. mod$1(
  4618. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  4619. MS_PER_HOUR
  4620. ) -
  4621. 1;
  4622. break;
  4623. case 'minute':
  4624. time = this._d.valueOf();
  4625. time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
  4626. break;
  4627. case 'second':
  4628. time = this._d.valueOf();
  4629. time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
  4630. break;
  4631. }
  4632. this._d.setTime(time);
  4633. hooks.updateOffset(this, true);
  4634. return this;
  4635. }
  4636. function valueOf() {
  4637. return this._d.valueOf() - (this._offset || 0) * 60000;
  4638. }
  4639. function unix() {
  4640. return Math.floor(this.valueOf() / 1000);
  4641. }
  4642. function toDate() {
  4643. return new Date(this.valueOf());
  4644. }
  4645. function toArray() {
  4646. var m = this;
  4647. return [
  4648. m.year(),
  4649. m.month(),
  4650. m.date(),
  4651. m.hour(),
  4652. m.minute(),
  4653. m.second(),
  4654. m.millisecond(),
  4655. ];
  4656. }
  4657. function toObject() {
  4658. var m = this;
  4659. return {
  4660. years: m.year(),
  4661. months: m.month(),
  4662. date: m.date(),
  4663. hours: m.hours(),
  4664. minutes: m.minutes(),
  4665. seconds: m.seconds(),
  4666. milliseconds: m.milliseconds(),
  4667. };
  4668. }
  4669. function toJSON() {
  4670. // new Date(NaN).toJSON() === null
  4671. return this.isValid() ? this.toISOString() : null;
  4672. }
  4673. function isValid$2() {
  4674. return isValid(this);
  4675. }
  4676. function parsingFlags() {
  4677. return extend({}, getParsingFlags(this));
  4678. }
  4679. function invalidAt() {
  4680. return getParsingFlags(this).overflow;
  4681. }
  4682. function creationData() {
  4683. return {
  4684. input: this._i,
  4685. format: this._f,
  4686. locale: this._locale,
  4687. isUTC: this._isUTC,
  4688. strict: this._strict,
  4689. };
  4690. }
  4691. addFormatToken('N', 0, 0, 'eraAbbr');
  4692. addFormatToken('NN', 0, 0, 'eraAbbr');
  4693. addFormatToken('NNN', 0, 0, 'eraAbbr');
  4694. addFormatToken('NNNN', 0, 0, 'eraName');
  4695. addFormatToken('NNNNN', 0, 0, 'eraNarrow');
  4696. addFormatToken('y', ['y', 1], 'yo', 'eraYear');
  4697. addFormatToken('y', ['yy', 2], 0, 'eraYear');
  4698. addFormatToken('y', ['yyy', 3], 0, 'eraYear');
  4699. addFormatToken('y', ['yyyy', 4], 0, 'eraYear');
  4700. addRegexToken('N', matchEraAbbr);
  4701. addRegexToken('NN', matchEraAbbr);
  4702. addRegexToken('NNN', matchEraAbbr);
  4703. addRegexToken('NNNN', matchEraName);
  4704. addRegexToken('NNNNN', matchEraNarrow);
  4705. addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (
  4706. input,
  4707. array,
  4708. config,
  4709. token
  4710. ) {
  4711. var era = config._locale.erasParse(input, token, config._strict);
  4712. if (era) {
  4713. getParsingFlags(config).era = era;
  4714. } else {
  4715. getParsingFlags(config).invalidEra = input;
  4716. }
  4717. });
  4718. addRegexToken('y', matchUnsigned);
  4719. addRegexToken('yy', matchUnsigned);
  4720. addRegexToken('yyy', matchUnsigned);
  4721. addRegexToken('yyyy', matchUnsigned);
  4722. addRegexToken('yo', matchEraYearOrdinal);
  4723. addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);
  4724. addParseToken(['yo'], function (input, array, config, token) {
  4725. var match;
  4726. if (config._locale._eraYearOrdinalRegex) {
  4727. match = input.match(config._locale._eraYearOrdinalRegex);
  4728. }
  4729. if (config._locale.eraYearOrdinalParse) {
  4730. array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
  4731. } else {
  4732. array[YEAR] = parseInt(input, 10);
  4733. }
  4734. });
  4735. function localeEras(m, format) {
  4736. var i,
  4737. l,
  4738. date,
  4739. eras = this._eras || getLocale('en')._eras;
  4740. for (i = 0, l = eras.length; i < l; ++i) {
  4741. switch (typeof eras[i].since) {
  4742. case 'string':
  4743. // truncate time
  4744. date = hooks(eras[i].since).startOf('day');
  4745. eras[i].since = date.valueOf();
  4746. break;
  4747. }
  4748. switch (typeof eras[i].until) {
  4749. case 'undefined':
  4750. eras[i].until = +Infinity;
  4751. break;
  4752. case 'string':
  4753. // truncate time
  4754. date = hooks(eras[i].until).startOf('day').valueOf();
  4755. eras[i].until = date.valueOf();
  4756. break;
  4757. }
  4758. }
  4759. return eras;
  4760. }
  4761. function localeErasParse(eraName, format, strict) {
  4762. var i,
  4763. l,
  4764. eras = this.eras(),
  4765. name,
  4766. abbr,
  4767. narrow;
  4768. eraName = eraName.toUpperCase();
  4769. for (i = 0, l = eras.length; i < l; ++i) {
  4770. name = eras[i].name.toUpperCase();
  4771. abbr = eras[i].abbr.toUpperCase();
  4772. narrow = eras[i].narrow.toUpperCase();
  4773. if (strict) {
  4774. switch (format) {
  4775. case 'N':
  4776. case 'NN':
  4777. case 'NNN':
  4778. if (abbr === eraName) {
  4779. return eras[i];
  4780. }
  4781. break;
  4782. case 'NNNN':
  4783. if (name === eraName) {
  4784. return eras[i];
  4785. }
  4786. break;
  4787. case 'NNNNN':
  4788. if (narrow === eraName) {
  4789. return eras[i];
  4790. }
  4791. break;
  4792. }
  4793. } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
  4794. return eras[i];
  4795. }
  4796. }
  4797. }
  4798. function localeErasConvertYear(era, year) {
  4799. var dir = era.since <= era.until ? +1 : -1;
  4800. if (year === undefined) {
  4801. return hooks(era.since).year();
  4802. } else {
  4803. return hooks(era.since).year() + (year - era.offset) * dir;
  4804. }
  4805. }
  4806. function getEraName() {
  4807. var i,
  4808. l,
  4809. val,
  4810. eras = this.localeData().eras();
  4811. for (i = 0, l = eras.length; i < l; ++i) {
  4812. // truncate time
  4813. val = this.startOf('day').valueOf();
  4814. if (eras[i].since <= val && val <= eras[i].until) {
  4815. return eras[i].name;
  4816. }
  4817. if (eras[i].until <= val && val <= eras[i].since) {
  4818. return eras[i].name;
  4819. }
  4820. }
  4821. return '';
  4822. }
  4823. function getEraNarrow() {
  4824. var i,
  4825. l,
  4826. val,
  4827. eras = this.localeData().eras();
  4828. for (i = 0, l = eras.length; i < l; ++i) {
  4829. // truncate time
  4830. val = this.startOf('day').valueOf();
  4831. if (eras[i].since <= val && val <= eras[i].until) {
  4832. return eras[i].narrow;
  4833. }
  4834. if (eras[i].until <= val && val <= eras[i].since) {
  4835. return eras[i].narrow;
  4836. }
  4837. }
  4838. return '';
  4839. }
  4840. function getEraAbbr() {
  4841. var i,
  4842. l,
  4843. val,
  4844. eras = this.localeData().eras();
  4845. for (i = 0, l = eras.length; i < l; ++i) {
  4846. // truncate time
  4847. val = this.startOf('day').valueOf();
  4848. if (eras[i].since <= val && val <= eras[i].until) {
  4849. return eras[i].abbr;
  4850. }
  4851. if (eras[i].until <= val && val <= eras[i].since) {
  4852. return eras[i].abbr;
  4853. }
  4854. }
  4855. return '';
  4856. }
  4857. function getEraYear() {
  4858. var i,
  4859. l,
  4860. dir,
  4861. val,
  4862. eras = this.localeData().eras();
  4863. for (i = 0, l = eras.length; i < l; ++i) {
  4864. dir = eras[i].since <= eras[i].until ? +1 : -1;
  4865. // truncate time
  4866. val = this.startOf('day').valueOf();
  4867. if (
  4868. (eras[i].since <= val && val <= eras[i].until) ||
  4869. (eras[i].until <= val && val <= eras[i].since)
  4870. ) {
  4871. return (
  4872. (this.year() - hooks(eras[i].since).year()) * dir +
  4873. eras[i].offset
  4874. );
  4875. }
  4876. }
  4877. return this.year();
  4878. }
  4879. function erasNameRegex(isStrict) {
  4880. if (!hasOwnProp(this, '_erasNameRegex')) {
  4881. computeErasParse.call(this);
  4882. }
  4883. return isStrict ? this._erasNameRegex : this._erasRegex;
  4884. }
  4885. function erasAbbrRegex(isStrict) {
  4886. if (!hasOwnProp(this, '_erasAbbrRegex')) {
  4887. computeErasParse.call(this);
  4888. }
  4889. return isStrict ? this._erasAbbrRegex : this._erasRegex;
  4890. }
  4891. function erasNarrowRegex(isStrict) {
  4892. if (!hasOwnProp(this, '_erasNarrowRegex')) {
  4893. computeErasParse.call(this);
  4894. }
  4895. return isStrict ? this._erasNarrowRegex : this._erasRegex;
  4896. }
  4897. function matchEraAbbr(isStrict, locale) {
  4898. return locale.erasAbbrRegex(isStrict);
  4899. }
  4900. function matchEraName(isStrict, locale) {
  4901. return locale.erasNameRegex(isStrict);
  4902. }
  4903. function matchEraNarrow(isStrict, locale) {
  4904. return locale.erasNarrowRegex(isStrict);
  4905. }
  4906. function matchEraYearOrdinal(isStrict, locale) {
  4907. return locale._eraYearOrdinalRegex || matchUnsigned;
  4908. }
  4909. function computeErasParse() {
  4910. var abbrPieces = [],
  4911. namePieces = [],
  4912. narrowPieces = [],
  4913. mixedPieces = [],
  4914. i,
  4915. l,
  4916. eras = this.eras();
  4917. for (i = 0, l = eras.length; i < l; ++i) {
  4918. namePieces.push(regexEscape(eras[i].name));
  4919. abbrPieces.push(regexEscape(eras[i].abbr));
  4920. narrowPieces.push(regexEscape(eras[i].narrow));
  4921. mixedPieces.push(regexEscape(eras[i].name));
  4922. mixedPieces.push(regexEscape(eras[i].abbr));
  4923. mixedPieces.push(regexEscape(eras[i].narrow));
  4924. }
  4925. this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  4926. this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
  4927. this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
  4928. this._erasNarrowRegex = new RegExp(
  4929. '^(' + narrowPieces.join('|') + ')',
  4930. 'i'
  4931. );
  4932. }
  4933. // FORMATTING
  4934. addFormatToken(0, ['gg', 2], 0, function () {
  4935. return this.weekYear() % 100;
  4936. });
  4937. addFormatToken(0, ['GG', 2], 0, function () {
  4938. return this.isoWeekYear() % 100;
  4939. });
  4940. function addWeekYearFormatToken(token, getter) {
  4941. addFormatToken(0, [token, token.length], 0, getter);
  4942. }
  4943. addWeekYearFormatToken('gggg', 'weekYear');
  4944. addWeekYearFormatToken('ggggg', 'weekYear');
  4945. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  4946. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  4947. // ALIASES
  4948. addUnitAlias('weekYear', 'gg');
  4949. addUnitAlias('isoWeekYear', 'GG');
  4950. // PRIORITY
  4951. addUnitPriority('weekYear', 1);
  4952. addUnitPriority('isoWeekYear', 1);
  4953. // PARSING
  4954. addRegexToken('G', matchSigned);
  4955. addRegexToken('g', matchSigned);
  4956. addRegexToken('GG', match1to2, match2);
  4957. addRegexToken('gg', match1to2, match2);
  4958. addRegexToken('GGGG', match1to4, match4);
  4959. addRegexToken('gggg', match1to4, match4);
  4960. addRegexToken('GGGGG', match1to6, match6);
  4961. addRegexToken('ggggg', match1to6, match6);
  4962. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
  4963. input,
  4964. week,
  4965. config,
  4966. token
  4967. ) {
  4968. week[token.substr(0, 2)] = toInt(input);
  4969. });
  4970. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  4971. week[token] = hooks.parseTwoDigitYear(input);
  4972. });
  4973. // MOMENTS
  4974. function getSetWeekYear(input) {
  4975. return getSetWeekYearHelper.call(
  4976. this,
  4977. input,
  4978. this.week(),
  4979. this.weekday(),
  4980. this.localeData()._week.dow,
  4981. this.localeData()._week.doy
  4982. );
  4983. }
  4984. function getSetISOWeekYear(input) {
  4985. return getSetWeekYearHelper.call(
  4986. this,
  4987. input,
  4988. this.isoWeek(),
  4989. this.isoWeekday(),
  4990. 1,
  4991. 4
  4992. );
  4993. }
  4994. function getISOWeeksInYear() {
  4995. return weeksInYear(this.year(), 1, 4);
  4996. }
  4997. function getISOWeeksInISOWeekYear() {
  4998. return weeksInYear(this.isoWeekYear(), 1, 4);
  4999. }
  5000. function getWeeksInYear() {
  5001. var weekInfo = this.localeData()._week;
  5002. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  5003. }
  5004. function getWeeksInWeekYear() {
  5005. var weekInfo = this.localeData()._week;
  5006. return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
  5007. }
  5008. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  5009. var weeksTarget;
  5010. if (input == null) {
  5011. return weekOfYear(this, dow, doy).year;
  5012. } else {
  5013. weeksTarget = weeksInYear(input, dow, doy);
  5014. if (week > weeksTarget) {
  5015. week = weeksTarget;
  5016. }
  5017. return setWeekAll.call(this, input, week, weekday, dow, doy);
  5018. }
  5019. }
  5020. function setWeekAll(weekYear, week, weekday, dow, doy) {
  5021. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  5022. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  5023. this.year(date.getUTCFullYear());
  5024. this.month(date.getUTCMonth());
  5025. this.date(date.getUTCDate());
  5026. return this;
  5027. }
  5028. // FORMATTING
  5029. addFormatToken('Q', 0, 'Qo', 'quarter');
  5030. // ALIASES
  5031. addUnitAlias('quarter', 'Q');
  5032. // PRIORITY
  5033. addUnitPriority('quarter', 7);
  5034. // PARSING
  5035. addRegexToken('Q', match1);
  5036. addParseToken('Q', function (input, array) {
  5037. array[MONTH] = (toInt(input) - 1) * 3;
  5038. });
  5039. // MOMENTS
  5040. function getSetQuarter(input) {
  5041. return input == null
  5042. ? Math.ceil((this.month() + 1) / 3)
  5043. : this.month((input - 1) * 3 + (this.month() % 3));
  5044. }
  5045. // FORMATTING
  5046. addFormatToken('D', ['DD', 2], 'Do', 'date');
  5047. // ALIASES
  5048. addUnitAlias('date', 'D');
  5049. // PRIORITY
  5050. addUnitPriority('date', 9);
  5051. // PARSING
  5052. addRegexToken('D', match1to2);
  5053. addRegexToken('DD', match1to2, match2);
  5054. addRegexToken('Do', function (isStrict, locale) {
  5055. // TODO: Remove "ordinalParse" fallback in next major release.
  5056. return isStrict
  5057. ? locale._dayOfMonthOrdinalParse || locale._ordinalParse
  5058. : locale._dayOfMonthOrdinalParseLenient;
  5059. });
  5060. addParseToken(['D', 'DD'], DATE);
  5061. addParseToken('Do', function (input, array) {
  5062. array[DATE] = toInt(input.match(match1to2)[0]);
  5063. });
  5064. // MOMENTS
  5065. var getSetDayOfMonth = makeGetSet('Date', true);
  5066. // FORMATTING
  5067. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  5068. // ALIASES
  5069. addUnitAlias('dayOfYear', 'DDD');
  5070. // PRIORITY
  5071. addUnitPriority('dayOfYear', 4);
  5072. // PARSING
  5073. addRegexToken('DDD', match1to3);
  5074. addRegexToken('DDDD', match3);
  5075. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  5076. config._dayOfYear = toInt(input);
  5077. });
  5078. // HELPERS
  5079. // MOMENTS
  5080. function getSetDayOfYear(input) {
  5081. var dayOfYear =
  5082. Math.round(
  5083. (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5
  5084. ) + 1;
  5085. return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
  5086. }
  5087. // FORMATTING
  5088. addFormatToken('m', ['mm', 2], 0, 'minute');
  5089. // ALIASES
  5090. addUnitAlias('minute', 'm');
  5091. // PRIORITY
  5092. addUnitPriority('minute', 14);
  5093. // PARSING
  5094. addRegexToken('m', match1to2);
  5095. addRegexToken('mm', match1to2, match2);
  5096. addParseToken(['m', 'mm'], MINUTE);
  5097. // MOMENTS
  5098. var getSetMinute = makeGetSet('Minutes', false);
  5099. // FORMATTING
  5100. addFormatToken('s', ['ss', 2], 0, 'second');
  5101. // ALIASES
  5102. addUnitAlias('second', 's');
  5103. // PRIORITY
  5104. addUnitPriority('second', 15);
  5105. // PARSING
  5106. addRegexToken('s', match1to2);
  5107. addRegexToken('ss', match1to2, match2);
  5108. addParseToken(['s', 'ss'], SECOND);
  5109. // MOMENTS
  5110. var getSetSecond = makeGetSet('Seconds', false);
  5111. // FORMATTING
  5112. addFormatToken('S', 0, 0, function () {
  5113. return ~~(this.millisecond() / 100);
  5114. });
  5115. addFormatToken(0, ['SS', 2], 0, function () {
  5116. return ~~(this.millisecond() / 10);
  5117. });
  5118. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  5119. addFormatToken(0, ['SSSS', 4], 0, function () {
  5120. return this.millisecond() * 10;
  5121. });
  5122. addFormatToken(0, ['SSSSS', 5], 0, function () {
  5123. return this.millisecond() * 100;
  5124. });
  5125. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  5126. return this.millisecond() * 1000;
  5127. });
  5128. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  5129. return this.millisecond() * 10000;
  5130. });
  5131. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  5132. return this.millisecond() * 100000;
  5133. });
  5134. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  5135. return this.millisecond() * 1000000;
  5136. });
  5137. // ALIASES
  5138. addUnitAlias('millisecond', 'ms');
  5139. // PRIORITY
  5140. addUnitPriority('millisecond', 16);
  5141. // PARSING
  5142. addRegexToken('S', match1to3, match1);
  5143. addRegexToken('SS', match1to3, match2);
  5144. addRegexToken('SSS', match1to3, match3);
  5145. var token, getSetMillisecond;
  5146. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  5147. addRegexToken(token, matchUnsigned);
  5148. }
  5149. function parseMs(input, array) {
  5150. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  5151. }
  5152. for (token = 'S'; token.length <= 9; token += 'S') {
  5153. addParseToken(token, parseMs);
  5154. }
  5155. getSetMillisecond = makeGetSet('Milliseconds', false);
  5156. // FORMATTING
  5157. addFormatToken('z', 0, 0, 'zoneAbbr');
  5158. addFormatToken('zz', 0, 0, 'zoneName');
  5159. // MOMENTS
  5160. function getZoneAbbr() {
  5161. return this._isUTC ? 'UTC' : '';
  5162. }
  5163. function getZoneName() {
  5164. return this._isUTC ? 'Coordinated Universal Time' : '';
  5165. }
  5166. var proto = Moment.prototype;
  5167. proto.add = add;
  5168. proto.calendar = calendar$1;
  5169. proto.clone = clone;
  5170. proto.diff = diff;
  5171. proto.endOf = endOf;
  5172. proto.format = format;
  5173. proto.from = from;
  5174. proto.fromNow = fromNow;
  5175. proto.to = to;
  5176. proto.toNow = toNow;
  5177. proto.get = stringGet;
  5178. proto.invalidAt = invalidAt;
  5179. proto.isAfter = isAfter;
  5180. proto.isBefore = isBefore;
  5181. proto.isBetween = isBetween;
  5182. proto.isSame = isSame;
  5183. proto.isSameOrAfter = isSameOrAfter;
  5184. proto.isSameOrBefore = isSameOrBefore;
  5185. proto.isValid = isValid$2;
  5186. proto.lang = lang;
  5187. proto.locale = locale;
  5188. proto.localeData = localeData;
  5189. proto.max = prototypeMax;
  5190. proto.min = prototypeMin;
  5191. proto.parsingFlags = parsingFlags;
  5192. proto.set = stringSet;
  5193. proto.startOf = startOf;
  5194. proto.subtract = subtract;
  5195. proto.toArray = toArray;
  5196. proto.toObject = toObject;
  5197. proto.toDate = toDate;
  5198. proto.toISOString = toISOString;
  5199. proto.inspect = inspect;
  5200. if (typeof Symbol !== 'undefined' && Symbol.for != null) {
  5201. proto[Symbol.for('nodejs.util.inspect.custom')] = function () {
  5202. return 'Moment<' + this.format() + '>';
  5203. };
  5204. }
  5205. proto.toJSON = toJSON;
  5206. proto.toString = toString;
  5207. proto.unix = unix;
  5208. proto.valueOf = valueOf;
  5209. proto.creationData = creationData;
  5210. proto.eraName = getEraName;
  5211. proto.eraNarrow = getEraNarrow;
  5212. proto.eraAbbr = getEraAbbr;
  5213. proto.eraYear = getEraYear;
  5214. proto.year = getSetYear;
  5215. proto.isLeapYear = getIsLeapYear;
  5216. proto.weekYear = getSetWeekYear;
  5217. proto.isoWeekYear = getSetISOWeekYear;
  5218. proto.quarter = proto.quarters = getSetQuarter;
  5219. proto.month = getSetMonth;
  5220. proto.daysInMonth = getDaysInMonth;
  5221. proto.week = proto.weeks = getSetWeek;
  5222. proto.isoWeek = proto.isoWeeks = getSetISOWeek;
  5223. proto.weeksInYear = getWeeksInYear;
  5224. proto.weeksInWeekYear = getWeeksInWeekYear;
  5225. proto.isoWeeksInYear = getISOWeeksInYear;
  5226. proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
  5227. proto.date = getSetDayOfMonth;
  5228. proto.day = proto.days = getSetDayOfWeek;
  5229. proto.weekday = getSetLocaleDayOfWeek;
  5230. proto.isoWeekday = getSetISODayOfWeek;
  5231. proto.dayOfYear = getSetDayOfYear;
  5232. proto.hour = proto.hours = getSetHour;
  5233. proto.minute = proto.minutes = getSetMinute;
  5234. proto.second = proto.seconds = getSetSecond;
  5235. proto.millisecond = proto.milliseconds = getSetMillisecond;
  5236. proto.utcOffset = getSetOffset;
  5237. proto.utc = setOffsetToUTC;
  5238. proto.local = setOffsetToLocal;
  5239. proto.parseZone = setOffsetToParsedOffset;
  5240. proto.hasAlignedHourOffset = hasAlignedHourOffset;
  5241. proto.isDST = isDaylightSavingTime;
  5242. proto.isLocal = isLocal;
  5243. proto.isUtcOffset = isUtcOffset;
  5244. proto.isUtc = isUtc;
  5245. proto.isUTC = isUtc;
  5246. proto.zoneAbbr = getZoneAbbr;
  5247. proto.zoneName = getZoneName;
  5248. proto.dates = deprecate(
  5249. 'dates accessor is deprecated. Use date instead.',
  5250. getSetDayOfMonth
  5251. );
  5252. proto.months = deprecate(
  5253. 'months accessor is deprecated. Use month instead',
  5254. getSetMonth
  5255. );
  5256. proto.years = deprecate(
  5257. 'years accessor is deprecated. Use year instead',
  5258. getSetYear
  5259. );
  5260. proto.zone = deprecate(
  5261. 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',
  5262. getSetZone
  5263. );
  5264. proto.isDSTShifted = deprecate(
  5265. 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',
  5266. isDaylightSavingTimeShifted
  5267. );
  5268. function createUnix(input) {
  5269. return createLocal(input * 1000);
  5270. }
  5271. function createInZone() {
  5272. return createLocal.apply(null, arguments).parseZone();
  5273. }
  5274. function preParsePostFormat(string) {
  5275. return string;
  5276. }
  5277. var proto$1 = Locale.prototype;
  5278. proto$1.calendar = calendar;
  5279. proto$1.longDateFormat = longDateFormat;
  5280. proto$1.invalidDate = invalidDate;
  5281. proto$1.ordinal = ordinal;
  5282. proto$1.preparse = preParsePostFormat;
  5283. proto$1.postformat = preParsePostFormat;
  5284. proto$1.relativeTime = relativeTime;
  5285. proto$1.pastFuture = pastFuture;
  5286. proto$1.set = set;
  5287. proto$1.eras = localeEras;
  5288. proto$1.erasParse = localeErasParse;
  5289. proto$1.erasConvertYear = localeErasConvertYear;
  5290. proto$1.erasAbbrRegex = erasAbbrRegex;
  5291. proto$1.erasNameRegex = erasNameRegex;
  5292. proto$1.erasNarrowRegex = erasNarrowRegex;
  5293. proto$1.months = localeMonths;
  5294. proto$1.monthsShort = localeMonthsShort;
  5295. proto$1.monthsParse = localeMonthsParse;
  5296. proto$1.monthsRegex = monthsRegex;
  5297. proto$1.monthsShortRegex = monthsShortRegex;
  5298. proto$1.week = localeWeek;
  5299. proto$1.firstDayOfYear = localeFirstDayOfYear;
  5300. proto$1.firstDayOfWeek = localeFirstDayOfWeek;
  5301. proto$1.weekdays = localeWeekdays;
  5302. proto$1.weekdaysMin = localeWeekdaysMin;
  5303. proto$1.weekdaysShort = localeWeekdaysShort;
  5304. proto$1.weekdaysParse = localeWeekdaysParse;
  5305. proto$1.weekdaysRegex = weekdaysRegex;
  5306. proto$1.weekdaysShortRegex = weekdaysShortRegex;
  5307. proto$1.weekdaysMinRegex = weekdaysMinRegex;
  5308. proto$1.isPM = localeIsPM;
  5309. proto$1.meridiem = localeMeridiem;
  5310. function get$1(format, index, field, setter) {
  5311. var locale = getLocale(),
  5312. utc = createUTC().set(setter, index);
  5313. return locale[field](utc, format);
  5314. }
  5315. function listMonthsImpl(format, index, field) {
  5316. if (isNumber(format)) {
  5317. index = format;
  5318. format = undefined;
  5319. }
  5320. format = format || '';
  5321. if (index != null) {
  5322. return get$1(format, index, field, 'month');
  5323. }
  5324. var i,
  5325. out = [];
  5326. for (i = 0; i < 12; i++) {
  5327. out[i] = get$1(format, i, field, 'month');
  5328. }
  5329. return out;
  5330. }
  5331. // ()
  5332. // (5)
  5333. // (fmt, 5)
  5334. // (fmt)
  5335. // (true)
  5336. // (true, 5)
  5337. // (true, fmt, 5)
  5338. // (true, fmt)
  5339. function listWeekdaysImpl(localeSorted, format, index, field) {
  5340. if (typeof localeSorted === 'boolean') {
  5341. if (isNumber(format)) {
  5342. index = format;
  5343. format = undefined;
  5344. }
  5345. format = format || '';
  5346. } else {
  5347. format = localeSorted;
  5348. index = format;
  5349. localeSorted = false;
  5350. if (isNumber(format)) {
  5351. index = format;
  5352. format = undefined;
  5353. }
  5354. format = format || '';
  5355. }
  5356. var locale = getLocale(),
  5357. shift = localeSorted ? locale._week.dow : 0,
  5358. i,
  5359. out = [];
  5360. if (index != null) {
  5361. return get$1(format, (index + shift) % 7, field, 'day');
  5362. }
  5363. for (i = 0; i < 7; i++) {
  5364. out[i] = get$1(format, (i + shift) % 7, field, 'day');
  5365. }
  5366. return out;
  5367. }
  5368. function listMonths(format, index) {
  5369. return listMonthsImpl(format, index, 'months');
  5370. }
  5371. function listMonthsShort(format, index) {
  5372. return listMonthsImpl(format, index, 'monthsShort');
  5373. }
  5374. function listWeekdays(localeSorted, format, index) {
  5375. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  5376. }
  5377. function listWeekdaysShort(localeSorted, format, index) {
  5378. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  5379. }
  5380. function listWeekdaysMin(localeSorted, format, index) {
  5381. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  5382. }
  5383. getSetGlobalLocale('en', {
  5384. eras: [
  5385. {
  5386. since: '0001-01-01',
  5387. until: +Infinity,
  5388. offset: 1,
  5389. name: 'Anno Domini',
  5390. narrow: 'AD',
  5391. abbr: 'AD',
  5392. },
  5393. {
  5394. since: '0000-12-31',
  5395. until: -Infinity,
  5396. offset: 1,
  5397. name: 'Before Christ',
  5398. narrow: 'BC',
  5399. abbr: 'BC',
  5400. },
  5401. ],
  5402. dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  5403. ordinal: function (number) {
  5404. var b = number % 10,
  5405. output =
  5406. toInt((number % 100) / 10) === 1
  5407. ? 'th'
  5408. : b === 1
  5409. ? 'st'
  5410. : b === 2
  5411. ? 'nd'
  5412. : b === 3
  5413. ? 'rd'
  5414. : 'th';
  5415. return number + output;
  5416. },
  5417. });
  5418. // Side effect imports
  5419. hooks.lang = deprecate(
  5420. 'moment.lang is deprecated. Use moment.locale instead.',
  5421. getSetGlobalLocale
  5422. );
  5423. hooks.langData = deprecate(
  5424. 'moment.langData is deprecated. Use moment.localeData instead.',
  5425. getLocale
  5426. );
  5427. var mathAbs = Math.abs;
  5428. function abs() {
  5429. var data = this._data;
  5430. this._milliseconds = mathAbs(this._milliseconds);
  5431. this._days = mathAbs(this._days);
  5432. this._months = mathAbs(this._months);
  5433. data.milliseconds = mathAbs(data.milliseconds);
  5434. data.seconds = mathAbs(data.seconds);
  5435. data.minutes = mathAbs(data.minutes);
  5436. data.hours = mathAbs(data.hours);
  5437. data.months = mathAbs(data.months);
  5438. data.years = mathAbs(data.years);
  5439. return this;
  5440. }
  5441. function addSubtract$1(duration, input, value, direction) {
  5442. var other = createDuration(input, value);
  5443. duration._milliseconds += direction * other._milliseconds;
  5444. duration._days += direction * other._days;
  5445. duration._months += direction * other._months;
  5446. return duration._bubble();
  5447. }
  5448. // supports only 2.0-style add(1, 's') or add(duration)
  5449. function add$1(input, value) {
  5450. return addSubtract$1(this, input, value, 1);
  5451. }
  5452. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  5453. function subtract$1(input, value) {
  5454. return addSubtract$1(this, input, value, -1);
  5455. }
  5456. function absCeil(number) {
  5457. if (number < 0) {
  5458. return Math.floor(number);
  5459. } else {
  5460. return Math.ceil(number);
  5461. }
  5462. }
  5463. function bubble() {
  5464. var milliseconds = this._milliseconds,
  5465. days = this._days,
  5466. months = this._months,
  5467. data = this._data,
  5468. seconds,
  5469. minutes,
  5470. hours,
  5471. years,
  5472. monthsFromDays;
  5473. // if we have a mix of positive and negative values, bubble down first
  5474. // check: https://github.com/moment/moment/issues/2166
  5475. if (
  5476. !(
  5477. (milliseconds >= 0 && days >= 0 && months >= 0) ||
  5478. (milliseconds <= 0 && days <= 0 && months <= 0)
  5479. )
  5480. ) {
  5481. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  5482. days = 0;
  5483. months = 0;
  5484. }
  5485. // The following code bubbles up values, see the tests for
  5486. // examples of what that means.
  5487. data.milliseconds = milliseconds % 1000;
  5488. seconds = absFloor(milliseconds / 1000);
  5489. data.seconds = seconds % 60;
  5490. minutes = absFloor(seconds / 60);
  5491. data.minutes = minutes % 60;
  5492. hours = absFloor(minutes / 60);
  5493. data.hours = hours % 24;
  5494. days += absFloor(hours / 24);
  5495. // convert days to months
  5496. monthsFromDays = absFloor(daysToMonths(days));
  5497. months += monthsFromDays;
  5498. days -= absCeil(monthsToDays(monthsFromDays));
  5499. // 12 months -> 1 year
  5500. years = absFloor(months / 12);
  5501. months %= 12;
  5502. data.days = days;
  5503. data.months = months;
  5504. data.years = years;
  5505. return this;
  5506. }
  5507. function daysToMonths(days) {
  5508. // 400 years have 146097 days (taking into account leap year rules)
  5509. // 400 years have 12 months === 4800
  5510. return (days * 4800) / 146097;
  5511. }
  5512. function monthsToDays(months) {
  5513. // the reverse of daysToMonths
  5514. return (months * 146097) / 4800;
  5515. }
  5516. function as(units) {
  5517. if (!this.isValid()) {
  5518. return NaN;
  5519. }
  5520. var days,
  5521. months,
  5522. milliseconds = this._milliseconds;
  5523. units = normalizeUnits(units);
  5524. if (units === 'month' || units === 'quarter' || units === 'year') {
  5525. days = this._days + milliseconds / 864e5;
  5526. months = this._months + daysToMonths(days);
  5527. switch (units) {
  5528. case 'month':
  5529. return months;
  5530. case 'quarter':
  5531. return months / 3;
  5532. case 'year':
  5533. return months / 12;
  5534. }
  5535. } else {
  5536. // handle milliseconds separately because of floating point math errors (issue #1867)
  5537. days = this._days + Math.round(monthsToDays(this._months));
  5538. switch (units) {
  5539. case 'week':
  5540. return days / 7 + milliseconds / 6048e5;
  5541. case 'day':
  5542. return days + milliseconds / 864e5;
  5543. case 'hour':
  5544. return days * 24 + milliseconds / 36e5;
  5545. case 'minute':
  5546. return days * 1440 + milliseconds / 6e4;
  5547. case 'second':
  5548. return days * 86400 + milliseconds / 1000;
  5549. // Math.floor prevents floating point math errors here
  5550. case 'millisecond':
  5551. return Math.floor(days * 864e5) + milliseconds;
  5552. default:
  5553. throw new Error('Unknown unit ' + units);
  5554. }
  5555. }
  5556. }
  5557. // TODO: Use this.as('ms')?
  5558. function valueOf$1() {
  5559. if (!this.isValid()) {
  5560. return NaN;
  5561. }
  5562. return (
  5563. this._milliseconds +
  5564. this._days * 864e5 +
  5565. (this._months % 12) * 2592e6 +
  5566. toInt(this._months / 12) * 31536e6
  5567. );
  5568. }
  5569. function makeAs(alias) {
  5570. return function () {
  5571. return this.as(alias);
  5572. };
  5573. }
  5574. var asMilliseconds = makeAs('ms'),
  5575. asSeconds = makeAs('s'),
  5576. asMinutes = makeAs('m'),
  5577. asHours = makeAs('h'),
  5578. asDays = makeAs('d'),
  5579. asWeeks = makeAs('w'),
  5580. asMonths = makeAs('M'),
  5581. asQuarters = makeAs('Q'),
  5582. asYears = makeAs('y');
  5583. function clone$1() {
  5584. return createDuration(this);
  5585. }
  5586. function get$2(units) {
  5587. units = normalizeUnits(units);
  5588. return this.isValid() ? this[units + 's']() : NaN;
  5589. }
  5590. function makeGetter(name) {
  5591. return function () {
  5592. return this.isValid() ? this._data[name] : NaN;
  5593. };
  5594. }
  5595. var milliseconds = makeGetter('milliseconds'),
  5596. seconds = makeGetter('seconds'),
  5597. minutes = makeGetter('minutes'),
  5598. hours = makeGetter('hours'),
  5599. days = makeGetter('days'),
  5600. months = makeGetter('months'),
  5601. years = makeGetter('years');
  5602. function weeks() {
  5603. return absFloor(this.days() / 7);
  5604. }
  5605. var round = Math.round,
  5606. thresholds = {
  5607. ss: 44, // a few seconds to seconds
  5608. s: 45, // seconds to minute
  5609. m: 45, // minutes to hour
  5610. h: 22, // hours to day
  5611. d: 26, // days to month/week
  5612. w: null, // weeks to month
  5613. M: 11, // months to year
  5614. };
  5615. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  5616. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  5617. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  5618. }
  5619. function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {
  5620. var duration = createDuration(posNegDuration).abs(),
  5621. seconds = round(duration.as('s')),
  5622. minutes = round(duration.as('m')),
  5623. hours = round(duration.as('h')),
  5624. days = round(duration.as('d')),
  5625. months = round(duration.as('M')),
  5626. weeks = round(duration.as('w')),
  5627. years = round(duration.as('y')),
  5628. a =
  5629. (seconds <= thresholds.ss && ['s', seconds]) ||
  5630. (seconds < thresholds.s && ['ss', seconds]) ||
  5631. (minutes <= 1 && ['m']) ||
  5632. (minutes < thresholds.m && ['mm', minutes]) ||
  5633. (hours <= 1 && ['h']) ||
  5634. (hours < thresholds.h && ['hh', hours]) ||
  5635. (days <= 1 && ['d']) ||
  5636. (days < thresholds.d && ['dd', days]);
  5637. if (thresholds.w != null) {
  5638. a =
  5639. a ||
  5640. (weeks <= 1 && ['w']) ||
  5641. (weeks < thresholds.w && ['ww', weeks]);
  5642. }
  5643. a = a ||
  5644. (months <= 1 && ['M']) ||
  5645. (months < thresholds.M && ['MM', months]) ||
  5646. (years <= 1 && ['y']) || ['yy', years];
  5647. a[2] = withoutSuffix;
  5648. a[3] = +posNegDuration > 0;
  5649. a[4] = locale;
  5650. return substituteTimeAgo.apply(null, a);
  5651. }
  5652. // This function allows you to set the rounding function for relative time strings
  5653. function getSetRelativeTimeRounding(roundingFunction) {
  5654. if (roundingFunction === undefined) {
  5655. return round;
  5656. }
  5657. if (typeof roundingFunction === 'function') {
  5658. round = roundingFunction;
  5659. return true;
  5660. }
  5661. return false;
  5662. }
  5663. // This function allows you to set a threshold for relative time strings
  5664. function getSetRelativeTimeThreshold(threshold, limit) {
  5665. if (thresholds[threshold] === undefined) {
  5666. return false;
  5667. }
  5668. if (limit === undefined) {
  5669. return thresholds[threshold];
  5670. }
  5671. thresholds[threshold] = limit;
  5672. if (threshold === 's') {
  5673. thresholds.ss = limit - 1;
  5674. }
  5675. return true;
  5676. }
  5677. function humanize(argWithSuffix, argThresholds) {
  5678. if (!this.isValid()) {
  5679. return this.localeData().invalidDate();
  5680. }
  5681. var withSuffix = false,
  5682. th = thresholds,
  5683. locale,
  5684. output;
  5685. if (typeof argWithSuffix === 'object') {
  5686. argThresholds = argWithSuffix;
  5687. argWithSuffix = false;
  5688. }
  5689. if (typeof argWithSuffix === 'boolean') {
  5690. withSuffix = argWithSuffix;
  5691. }
  5692. if (typeof argThresholds === 'object') {
  5693. th = Object.assign({}, thresholds, argThresholds);
  5694. if (argThresholds.s != null && argThresholds.ss == null) {
  5695. th.ss = argThresholds.s - 1;
  5696. }
  5697. }
  5698. locale = this.localeData();
  5699. output = relativeTime$1(this, !withSuffix, th, locale);
  5700. if (withSuffix) {
  5701. output = locale.pastFuture(+this, output);
  5702. }
  5703. return locale.postformat(output);
  5704. }
  5705. var abs$1 = Math.abs;
  5706. function sign(x) {
  5707. return (x > 0) - (x < 0) || +x;
  5708. }
  5709. function toISOString$1() {
  5710. // for ISO strings we do not use the normal bubbling rules:
  5711. // * milliseconds bubble up until they become hours
  5712. // * days do not bubble at all
  5713. // * months bubble up until they become years
  5714. // This is because there is no context-free conversion between hours and days
  5715. // (think of clock changes)
  5716. // and also not between days and months (28-31 days per month)
  5717. if (!this.isValid()) {
  5718. return this.localeData().invalidDate();
  5719. }
  5720. var seconds = abs$1(this._milliseconds) / 1000,
  5721. days = abs$1(this._days),
  5722. months = abs$1(this._months),
  5723. minutes,
  5724. hours,
  5725. years,
  5726. s,
  5727. total = this.asSeconds(),
  5728. totalSign,
  5729. ymSign,
  5730. daysSign,
  5731. hmsSign;
  5732. if (!total) {
  5733. // this is the same as C#'s (Noda) and python (isodate)...
  5734. // but not other JS (goog.date)
  5735. return 'P0D';
  5736. }
  5737. // 3600 seconds -> 60 minutes -> 1 hour
  5738. minutes = absFloor(seconds / 60);
  5739. hours = absFloor(minutes / 60);
  5740. seconds %= 60;
  5741. minutes %= 60;
  5742. // 12 months -> 1 year
  5743. years = absFloor(months / 12);
  5744. months %= 12;
  5745. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  5746. s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
  5747. totalSign = total < 0 ? '-' : '';
  5748. ymSign = sign(this._months) !== sign(total) ? '-' : '';
  5749. daysSign = sign(this._days) !== sign(total) ? '-' : '';
  5750. hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
  5751. return (
  5752. totalSign +
  5753. 'P' +
  5754. (years ? ymSign + years + 'Y' : '') +
  5755. (months ? ymSign + months + 'M' : '') +
  5756. (days ? daysSign + days + 'D' : '') +
  5757. (hours || minutes || seconds ? 'T' : '') +
  5758. (hours ? hmsSign + hours + 'H' : '') +
  5759. (minutes ? hmsSign + minutes + 'M' : '') +
  5760. (seconds ? hmsSign + s + 'S' : '')
  5761. );
  5762. }
  5763. var proto$2 = Duration.prototype;
  5764. proto$2.isValid = isValid$1;
  5765. proto$2.abs = abs;
  5766. proto$2.add = add$1;
  5767. proto$2.subtract = subtract$1;
  5768. proto$2.as = as;
  5769. proto$2.asMilliseconds = asMilliseconds;
  5770. proto$2.asSeconds = asSeconds;
  5771. proto$2.asMinutes = asMinutes;
  5772. proto$2.asHours = asHours;
  5773. proto$2.asDays = asDays;
  5774. proto$2.asWeeks = asWeeks;
  5775. proto$2.asMonths = asMonths;
  5776. proto$2.asQuarters = asQuarters;
  5777. proto$2.asYears = asYears;
  5778. proto$2.valueOf = valueOf$1;
  5779. proto$2._bubble = bubble;
  5780. proto$2.clone = clone$1;
  5781. proto$2.get = get$2;
  5782. proto$2.milliseconds = milliseconds;
  5783. proto$2.seconds = seconds;
  5784. proto$2.minutes = minutes;
  5785. proto$2.hours = hours;
  5786. proto$2.days = days;
  5787. proto$2.weeks = weeks;
  5788. proto$2.months = months;
  5789. proto$2.years = years;
  5790. proto$2.humanize = humanize;
  5791. proto$2.toISOString = toISOString$1;
  5792. proto$2.toString = toISOString$1;
  5793. proto$2.toJSON = toISOString$1;
  5794. proto$2.locale = locale;
  5795. proto$2.localeData = localeData;
  5796. proto$2.toIsoString = deprecate(
  5797. 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',
  5798. toISOString$1
  5799. );
  5800. proto$2.lang = lang;
  5801. // FORMATTING
  5802. addFormatToken('X', 0, 0, 'unix');
  5803. addFormatToken('x', 0, 0, 'valueOf');
  5804. // PARSING
  5805. addRegexToken('x', matchSigned);
  5806. addRegexToken('X', matchTimestamp);
  5807. addParseToken('X', function (input, array, config) {
  5808. config._d = new Date(parseFloat(input) * 1000);
  5809. });
  5810. addParseToken('x', function (input, array, config) {
  5811. config._d = new Date(toInt(input));
  5812. });
  5813. //! moment.js
  5814. hooks.version = '2.26.0';
  5815. setHookCallback(createLocal);
  5816. hooks.fn = proto;
  5817. hooks.min = min;
  5818. hooks.max = max;
  5819. hooks.now = now;
  5820. hooks.utc = createUTC;
  5821. hooks.unix = createUnix;
  5822. hooks.months = listMonths;
  5823. hooks.isDate = isDate;
  5824. hooks.locale = getSetGlobalLocale;
  5825. hooks.invalid = createInvalid;
  5826. hooks.duration = createDuration;
  5827. hooks.isMoment = isMoment;
  5828. hooks.weekdays = listWeekdays;
  5829. hooks.parseZone = createInZone;
  5830. hooks.localeData = getLocale;
  5831. hooks.isDuration = isDuration;
  5832. hooks.monthsShort = listMonthsShort;
  5833. hooks.weekdaysMin = listWeekdaysMin;
  5834. hooks.defineLocale = defineLocale;
  5835. hooks.updateLocale = updateLocale;
  5836. hooks.locales = listLocales;
  5837. hooks.weekdaysShort = listWeekdaysShort;
  5838. hooks.normalizeUnits = normalizeUnits;
  5839. hooks.relativeTimeRounding = getSetRelativeTimeRounding;
  5840. hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
  5841. hooks.calendarFormat = getCalendarFormat;
  5842. hooks.prototype = proto;
  5843. // currently HTML5 input type only supports 24-hour formats
  5844. hooks.HTML5_FMT = {
  5845. DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
  5846. DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
  5847. DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
  5848. DATE: 'YYYY-MM-DD', // <input type="date" />
  5849. TIME: 'HH:mm', // <input type="time" />
  5850. TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
  5851. TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
  5852. WEEK: 'GGGG-[W]WW', // <input type="week" />
  5853. MONTH: 'YYYY-MM', // <input type="month" />
  5854. };
  5855. return hooks;
  5856. })));
  5857. define('moment', ['moment/moment'], function (main) { return main; });
  5858. define('frontend',['fast', 'template', 'moment'], function (Fast, Template, Moment) {
  5859. var Frontend = {
  5860. api: Fast.api,
  5861. init: function () {
  5862. var si = {};
  5863. //发送验证码
  5864. $(document).on("click", ".btn-captcha", function (e) {
  5865. var type = $(this).data("type") ? $(this).data("type") : 'mobile';
  5866. var btn = this;
  5867. Frontend.api.sendcaptcha = function (btn, type, data, callback) {
  5868. $(btn).addClass("disabled", true).text("发送中...");
  5869. Frontend.api.ajax({url: $(btn).data("url"), data: data}, function (data, ret) {
  5870. clearInterval(si[type]);
  5871. var seconds = 60;
  5872. si[type] = setInterval(function () {
  5873. seconds--;
  5874. if (seconds <= 0) {
  5875. clearInterval(si);
  5876. $(btn).removeClass("disabled").text("发送验证码");
  5877. } else {
  5878. $(btn).addClass("disabled").text(seconds + "秒后可再次发送");
  5879. }
  5880. }, 1000);
  5881. if (typeof callback == 'function') {
  5882. callback.call(this, data, ret);
  5883. }
  5884. }, function () {
  5885. $(btn).removeClass("disabled").text('发送验证码');
  5886. });
  5887. };
  5888. if (['mobile', 'email'].indexOf(type) > -1) {
  5889. var element = $(this).data("input-id") ? $("#" + $(this).data("input-id")) : $("input[name='" + type + "']", $(this).closest("form"));
  5890. var text = type === 'email' ? '邮箱' : '手机号码';
  5891. if (element.val() === "") {
  5892. Layer.msg(text + "不能为空!");
  5893. element.focus();
  5894. return false;
  5895. } else if (type === 'mobile' && !element.val().match(/^1[3-9]\d{9}$/)) {
  5896. Layer.msg("请输入正确的" + text + "!");
  5897. element.focus();
  5898. return false;
  5899. } else if (type === 'email' && !element.val().match(/^[\w\+\-]+(\.[\w\+\-]+)*@[a-z\d\-]+(\.[a-z\d\-]+)*\.([a-z]{2,4})$/)) {
  5900. Layer.msg("请输入正确的" + text + "!");
  5901. element.focus();
  5902. return false;
  5903. }
  5904. element.isValid(function (v) {
  5905. if (v) {
  5906. var data = {event: $(btn).data("event")};
  5907. data[type] = element.val();
  5908. Frontend.api.sendcaptcha(btn, type, data);
  5909. } else {
  5910. Layer.msg("请确认已经输入了正确的" + text + "!");
  5911. }
  5912. });
  5913. } else {
  5914. var data = {event: $(btn).data("event")};
  5915. Frontend.api.sendcaptcha(btn, type, data, function (data, ret) {
  5916. Layer.open({title: false, area: ["400px", "430px"], content: "<img src='" + data.image + "' width='400' height='400' /><div class='text-center panel-title'>扫一扫关注公众号获取验证码</div>", type: 1});
  5917. });
  5918. }
  5919. return false;
  5920. });
  5921. //tooltip和popover
  5922. if (!('ontouchstart' in document.documentElement)) {
  5923. $('body').tooltip({selector: '[data-toggle="tooltip"]'});
  5924. }
  5925. $('body').popover({selector: '[data-toggle="popover"]'});
  5926. // 手机端左右滑动切换菜单栏
  5927. if ('ontouchstart' in document.documentElement) {
  5928. var startX, startY, moveEndX, moveEndY, relativeX, relativeY, element;
  5929. element = $('body', document);
  5930. element.on("touchstart", function (e) {
  5931. startX = e.originalEvent.changedTouches[0].pageX;
  5932. startY = e.originalEvent.changedTouches[0].pageY;
  5933. });
  5934. element.on("touchend", function (e) {
  5935. moveEndX = e.originalEvent.changedTouches[0].pageX;
  5936. moveEndY = e.originalEvent.changedTouches[0].pageY;
  5937. relativeX = moveEndX - startX;
  5938. relativeY = moveEndY - startY;
  5939. // 判断标准
  5940. //右滑
  5941. if (relativeX > 45) {
  5942. if ((Math.abs(relativeX) - Math.abs(relativeY)) > 50) {
  5943. element.addClass("sidebar-open");
  5944. }
  5945. }
  5946. //左滑
  5947. else if (relativeX < -45) {
  5948. if ((Math.abs(relativeX) - Math.abs(relativeY)) > 50) {
  5949. element.removeClass("sidebar-open");
  5950. }
  5951. }
  5952. });
  5953. }
  5954. $(document).on("click", ".sidebar-toggle", function () {
  5955. $("body").toggleClass("sidebar-open");
  5956. });
  5957. }
  5958. };
  5959. Frontend.api = $.extend(Fast.api, Frontend.api);
  5960. //将Template渲染至全局,以便于在子框架中调用
  5961. window.Template = Template;
  5962. //将Moment渲染至全局,以便于在子框架中调用
  5963. window.Moment = Moment;
  5964. //将Frontend渲染至全局,以便于在子框架中调用
  5965. window.Frontend = Frontend;
  5966. Frontend.init();
  5967. return Frontend;
  5968. });
  5969. define('frontend-init',['frontend'], function (Frontend) {
  5970. });