require-backend.min.js 654 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028
  1. /*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | 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=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.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 d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.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(null)},push:f,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){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},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?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.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,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),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):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.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,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"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=ha(),z=ha(),A=ha(),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=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),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")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=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)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){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 ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(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 ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(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 pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.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.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);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 p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' 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(".#.+[+~]")}),ja(function(a){var b=g.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=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.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===g||a.ownerDocument===v&&t(v,a)?-1:b===g||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,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||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 ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.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},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.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=ga.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=ga.selectors={cacheLength:50,createPseudo:ia,match:X,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(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===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]||ga.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]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.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(ca,da).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=ga.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(Q," ")+" ").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;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(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:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(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:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).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 Z.test(a.nodeName)},input:function(a){return Y.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:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(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]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.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=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[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?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(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=[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(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(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 ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(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 wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(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=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(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=[sa(ta(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 wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.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(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.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(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(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}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(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(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==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(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir: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},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),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=u.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.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.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.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(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 n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(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&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},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().done(c.resolve).fail(c.reject).progress(c.notify):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=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;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||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=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)n.access(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};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[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=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){
  3. return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.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=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.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 L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.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=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.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 typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.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,!1)),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=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.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)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.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.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!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&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(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)>=0: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 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,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&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)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},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?Z:$):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={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&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}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(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=$),this.each(function(){n.event.remove(this,a,c,b)})},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}});var aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ia={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,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(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 ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.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])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(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 this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(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 J(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&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),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),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qa[0].contentDocument,b.write(),b.close(),c=sa(a,b),qa.detach()),ra[a]=c),c}var ua=/^margin/,va=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wa=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xa(a,b,c){var d,e,f,g,h=a.style;return c=c||wa(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),va.test(g)&&ua.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 ya(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=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};var za=/^(none|table(?!-c[ea]).+)/,Aa=new RegExp("^("+Q+")(.*)$","i"),Ba=new RegExp("^([+-])=("+Q+")","i"),Ca={position:"absolute",visibility:"hidden",display:"block"},Da={letterSpacing:"0",fontWeight:"400"},Ea=["Webkit","O","Moz","ms"];function Fa(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Ea.length;while(e--)if(b=Ea[e]+c,b in a)return b;return d}function Ga(a,b,c){var d=Aa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Ha(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+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ia(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wa(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xa(a,b,f),(0>e||null==e)&&(e=a.style[b]),va.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Ha(a,b,c||(g?"border":"content"),d,f)+"px"}function Ja(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",ta(d.nodeName)))):(e=S(d),"none"===c&&e||L.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=xa(a,"opacity");return""===c?"1":c}}}},cssNumber:{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]=Fa(i,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=Ba.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.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]=Fa(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xa(a,b,d)),"normal"===e&&b in Da&&(e=Da[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?za.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Ca,function(){return Ia(a,b,d)}):Ia(a,b,d):void 0},set:function(a,c,d){var e=d&&wa(a);return Ga(a,c,d?Ha(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=ya(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xa,[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+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ua.test(a)||(n.cssHooks[a+b].set=Ga)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wa(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 Ja(this,!0)},hide:function(){return Ja(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Ka(a,b,c,d,e){return new Ka.prototype.init(a,b,c,d,e)}n.Tween=Ka,Ka.prototype={constructor:Ka,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ka.propHooks[this.prop];return a&&a.get?a.get(this):Ka.propHooks._default.get(this)},run:function(a){var b,c=Ka.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):Ka.propHooks._default.set(this),this}},Ka.prototype.init.prototype=Ka.prototype,Ka.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Ka.propHooks.scrollTop=Ka.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}},n.fx=Ka.prototype.init,n.fx.step={};var La,Ma,Na=/^(?:toggle|show|hide)$/,Oa=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pa=/queueHooks$/,Qa=[Va],Ra={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Oa.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Oa.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sa(){return setTimeout(function(){La=void 0}),La=n.now()}function Ta(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ua(a,b,c){for(var d,e=(Ra[b]||[]).concat(Ra["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Va(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.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?L.get(a,"olddisplay")||ta(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],Na.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?ta(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ua(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 Wa(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 Xa(a,b,c){var d,e,f=0,g=Qa.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=La||Sa(),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:{}},c),originalProperties:b,originalOptions:c,startTime:La||Sa(),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.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wa(k,j.opts.specialEasing);g>f;f++)if(d=Qa[f].call(j,a,k,j.opts))return d;return n.map(k,Ua,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(Xa,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Ra[c]=Ra[c]||[],Ra[c].unshift(b)},prefilter:function(a,b){b?Qa.unshift(a):Qa.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(S).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=Xa(this,n.extend({},a),f);(e||L.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=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pa.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=L.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(Ta(b,!0),a,d,e)}}),n.each({slideDown:Ta("show"),slideUp:Ta("hide"),slideToggle:Ta("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(La=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),La=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(){Ma||(Ma=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Ma),Ma=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Ya,Za,$a=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(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(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Za:Ya)),
  4. void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);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)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Za={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=$a[b]||n.find.attr;$a[b]=function(a,b,d){var e,f;return d||(f=$a[b],$a[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$a[b]=f),e}});var _a=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),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){return a.hasAttribute("tabindex")||_a.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ab=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ab," ").indexOf(b)>=0)return!0;return!1}});var bb=/\r/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(bb,""):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))}},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||(k.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(d.value,f)>=0)&&(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)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),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)},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)}});var cb=n.now(),db=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var eb=/#.*$/,fb=/([?&])_=[^&]*/,gb=/^(.*?):[ \t]*([^\r\n]*)$/gm,hb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ib=/^(?:GET|HEAD)$/,jb=/^\/\//,kb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lb={},mb={},nb="*/".concat("*"),ob=a.location.href,pb=kb.exec(ob.toLowerCase())||[];function qb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];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 rb(a,b,c,d){var e={},f=a===mb;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 sb(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 tb(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 ub(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:ob,type:"GET",isLocal:hb.test(pb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},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?sb(sb(a,n.ajaxSettings),b):sb(n.ajaxSettings,a)},ajaxPrefilter:qb(lb),ajaxTransport:qb(mb),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gb.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||ob)+"").replace(eb,"").replace(jb,pb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kb.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pb[1]&&h[2]===pb[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pb[3]||("http:"===pb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rb(lb,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ib.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(db.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fb.test(d)?d.replace(fb,"$1_="+cb++):d+(db.test(d)?"&":"?")+"_="+cb++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nb+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rb(mb,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tb(k,v,f)),u=ub(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},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({url:a,type:b,dataType:e,data:c,success:d})}}),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 this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}: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 a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vb=/%20/g,wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ab(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)Ab(c,a[c],b,e);return d.join("&").replace(vb,"+")},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")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!T.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(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bb=0,Cb={},Db={0:200,1223:204},Eb=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cb)Cb[a]()}),k.cors=!!Eb&&"withCredentials"in Eb,k.ajax=Eb=!!Eb,n.ajaxTransport(function(a){var b;return k.cors||Eb&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cb[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Db[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cb[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},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(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Fb=[],Gb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Fb.pop()||n.expando+"_"+cb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Gb.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gb.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(Gb,"$1"+e):b.jsonp!==!1&&(b.url+=(db.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(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Fb.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||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Hb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Hb)return Hb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(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,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,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};var Ib=a.document.documentElement;function Jb(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,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)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Jb(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||Ib;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ib})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Jb(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=ya(k.pixelPosition,function(a,c){return c?(c=xa(a,b),va.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 J(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.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Kb=a.jQuery,Lb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Lb),b&&a.jQuery===n&&(a.jQuery=Kb),n},typeof b===U&&(a.jQuery=a.$=n),n});
  5. //# sourceMappingURL=jquery.min.map;
  6. /*!
  7. * Bootstrap v3.3.7 (http://getbootstrap.com)
  8. * Copyright 2011-2016 Twitter, Inc.
  9. * Licensed under the MIT license
  10. */
  11. if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.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(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[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 e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.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(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.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(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){document===a.target||this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.7",c.TRANSITION_DURATION=150,c.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}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.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 e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);if(this.$element.trigger(g),!g.isDefaultPrevented())return f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=window.SVGElement&&c instanceof window.SVGElement,g=d?{top:0,left:0}:f?null:b.offset(),h={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},i=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,h,i,g)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(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},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.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>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){
  12. this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.7",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e<c&&"top";if("bottom"==this.affixed)return null!=c?!(e+this.unpin<=f.top)&&"bottom":!(e+g<=a-d)&&"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&e<=c?"top":null!=d&&i+j>=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
  13. define("bootstrap", ["jquery"], function(){});
  14. define('config',['module'], function (module) {
  15. return module.config();
  16. });
  17. require.config({
  18. urlArgs: "v=" + requirejs.s.contexts._.config.config.config.site.version,
  19. packages: [{
  20. name: 'moment',
  21. location: '../libs/moment',
  22. main: 'moment'
  23. }],
  24. paths: {
  25. 'config': 'require-config',
  26. 'bootstrap-checkbox': 'bootstrap-checkbox',
  27. 'bootstrap-radio': 'bootstrap-radio',
  28. 'bootstrap-switch': 'bootstrap-switch',
  29. 'form': 'require-form',
  30. 'table': 'require-table',
  31. 'upload': 'require-upload',
  32. 'drag': 'jquery.drag.min',
  33. 'drop': 'jquery.drop.min',
  34. 'echarts-theme': 'echarts-theme',
  35. 'adminlte': 'adminlte',
  36. //
  37. // 以下的包从bower的libs目录加载
  38. 'jquery': '../libs/jquery/dist/jquery.min',
  39. 'bootstrap': '../libs/bootstrap/dist/js/bootstrap.min',
  40. 'bootstrap-validator': '../libs/bootstrap-validator/dist/validator.min',
  41. 'bootstrap-typeahead': '../libs/bootstrap3-typeahead/bootstrap3-typeahead.min',
  42. 'bootstrap-tagsinput': '../libs/bootstrap-tagsinput/dist/bootstrap-tagsinput.min',
  43. 'bootstrap-dialog': '../libs/bootstrap3-dialog/dist/js/bootstrap-dialog.min',
  44. 'bootstrap-datetimepicker': '../libs/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min',
  45. 'bootstrap-select': '../libs/bootstrap-select/dist/js/bootstrap-select.min',
  46. 'bootstrap-table': '../libs/bootstrap-table/dist/bootstrap-table.min',
  47. 'bootstrap-table-export': '../libs/bootstrap-table/dist/extensions/export/bootstrap-table-export.min',
  48. 'bootstrap-table-mobile': '../libs/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile',
  49. 'bootstrap-table-advancedsearch': 'bootstrap-table-advancedsearch',
  50. 'bootstrap-table-lang': '../libs/bootstrap-table/dist/locale/bootstrap-table-zh-CN',
  51. 'typeahead': '../libs/typeahead.js/dist/typeahead.jquery.min',
  52. 'bloodhound': '../libs/typeahead.js/dist/bloodhound.min',
  53. 'tableexport': '../libs/tableExport.jquery.plugin/tableExport.min',
  54. 'dropzone': '../libs/dropzone/dist/min/dropzone-amd-module.min',
  55. 'less': '../libs/less/dist/less.min',
  56. 'dragsort': '../libs/dragsort/jquery.dragsort',
  57. 'sortable': '../libs/Sortable/Sortable.min',
  58. 'addtabs': '../libs/jquery-addtabs/jquery.addtabs',
  59. 'slimscroll': '../libs/jquery-slimscroll/jquery.slimscroll',
  60. 'crontab': '../libs/jqcron/src/jqCron.cn',
  61. 'summernote': '../libs/summernote/dist/lang/summernote-zh-CN.min',
  62. 'validator': '../libs/nice-validator/dist/local/zh-CN',
  63. 'plupload': '../libs/plupload/js/plupload.min',
  64. 'toastr': '../libs/toastr/toastr',
  65. 'jstree': '../libs/jstree/dist/jstree.min',
  66. 'layer': '../libs/layer/src/layer',
  67. 'echarts': '../libs/echarts/dist/echarts.min',
  68. 'cookie': '../libs/jquery.cookie/jquery.cookie',
  69. 'template': '../libs/art-template/dist/template-native',
  70. },
  71. // shim依赖配置
  72. shim: {
  73. 'bootstrap': ['jquery'],
  74. 'bootstrap-table': {
  75. deps: ['bootstrap', 'css!../libs/bootstrap-table/dist/bootstrap-table.min.css'],
  76. exports: '$.fn.bootstrapTable'
  77. },
  78. 'bootstrap-table-lang': {
  79. deps: ['bootstrap-table'],
  80. exports: '$.fn.bootstrapTable.defaults'
  81. },
  82. 'bootstrap-table-export': {
  83. deps: ['bootstrap-table', 'tableexport'],
  84. exports: '$.fn.bootstrapTable.defaults'
  85. },
  86. 'bootstrap-table-mobile': {
  87. deps: ['bootstrap-table'],
  88. exports: '$.fn.bootstrapTable.defaults'
  89. },
  90. 'bootstrap-table-advancedsearch': {
  91. deps: ['bootstrap-table'],
  92. exports: '$.fn.bootstrapTable.defaults'
  93. },
  94. 'tableexport': {
  95. deps: ['jquery'],
  96. exports: '$.fn.extend'
  97. },
  98. 'slimscroll': {
  99. deps: ['jquery'],
  100. exports: '$.fn.extend'
  101. },
  102. 'adminlte': {
  103. deps: ['bootstrap', 'slimscroll'],
  104. exports: '$.AdminLTE'
  105. },
  106. 'typeahead': {
  107. deps: ['jquery'],
  108. init: function ($) {
  109. return require.s.contexts._.registry['typeahead.js'].factory($);
  110. }
  111. },
  112. 'crontab': ['../libs/jqcron/src/jqCron', 'css!../libs/jqcron/src/jqCron.css'],
  113. 'bootstrap-checkbox': ['jquery'],
  114. 'bootstrap-radio': ['jquery'],
  115. 'bootstrap-switch': ['jquery'],
  116. 'bootstrap-dialog': ['css!../libs/bootstrap3-dialog/dist/css/bootstrap-dialog.min.css'],
  117. 'bootstrap-datetimepicker': [
  118. 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
  119. 'moment/locale/zh-cn'
  120. ],
  121. 'bootstrap-tagsinput': [
  122. 'css!../libs/bootstrap-tagsinput/dist/bootstrap-tagsinput-typeahead.css',
  123. 'css!../libs/bootstrap-tagsinput/dist/bootstrap-tagsinput.css',
  124. 'jquery',
  125. 'typeahead'
  126. ],
  127. 'bootstrap-select': ['css!../libs/bootstrap-select/dist/css/bootstrap-select.min.css', ],
  128. 'summernote': ['../libs/summernote/dist/summernote.min', 'css!../libs/summernote/dist/summernote.css'],
  129. // 'toastr': ['css!../libs/toastr/toastr.min.css'],
  130. 'jstree': ['css!../libs/jstree/dist/themes/default/style.css', ],
  131. 'plupload': {
  132. deps: [
  133. '../libs/plupload/js/moxie.min'
  134. ],
  135. exports: "plupload"
  136. },
  137. // 'layer': ['css!../libs/layer/build/skin/default/layer.css'],
  138. validator: {
  139. deps: ['../libs/nice-validator/dist/jquery.validator', 'css!../libs/nice-validator/dist/jquery.validator.css']
  140. }
  141. },
  142. baseUrl: requirejs.s.contexts._.config.config.config.site.cdnurl + '/assets/js/', //资源基础路径
  143. map: {
  144. '*': {
  145. 'css': '../libs/require-css/css.min'
  146. }
  147. },
  148. charset: 'utf-8' // 文件编码
  149. });
  150. require(['jquery', 'bootstrap', 'config'], function ($, undefined, Config) {
  151. // 配置语言包的路径
  152. var paths = {};
  153. paths['lang'] = (Config.subdomain == "1" ? '' : '/admin') + '/ajax/lang?callback=define&controllername=' + Config.controllername;
  154. // 避免目录冲突
  155. paths['backend/'] = 'backend/';
  156. require.config({paths: paths});
  157. // 初始化
  158. $(function () {
  159. require(['backend'], function (Module) {
  160. // 对相对地址进行处理
  161. $.ajaxSetup({
  162. beforeSend: function (xhr, setting) {
  163. setting.url = Module.api.fixurl(setting.url);
  164. }
  165. });
  166. // 绑定ESC关闭窗口事件
  167. $(window).keyup(function (e) {
  168. if (e.keyCode == 27) {
  169. if ($(".layui-layer").size() > 0) {
  170. var index = 0;
  171. $(".layui-layer").each(function () {
  172. index = Math.max(index, parseInt($(this).attr("times")));
  173. });
  174. if (index) {
  175. Module.api.layer.close(index);
  176. }
  177. }
  178. }
  179. });
  180. //加载相应模块
  181. require([Config.jsname], function (Controller) {
  182. Controller[Config.actionname] != undefined && Controller[Config.actionname]();
  183. });
  184. });
  185. });
  186. });
  187. define("require-backend", function(){});
  188. define('../libs/require-css/css.min',[],function(){if("undefined"==typeof window)return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,n=!1,r=!0;t[1]||t[7]?n=parseInt(t[1])<6||parseInt(t[7])<=9:t[2]||t[8]?r=!1:t[4]&&(n=parseInt(t[4])<18);var o={};o.pluginBuilder="./css-builder";var a,i,s,l=function(){a=document.createElement("style"),e.appendChild(a),i=a.styleSheet||a.sheet},u=0,d=[],c=function(e){u++,32==u&&(l(),u=0),i.addImport(e),a.onload=function(){f()}},f=function(){s();var e=d.shift();return e?(s=e[1],void c(e[0])):void(s=null)},h=function(e,t){if(i&&i.addImport||l(),i&&i.addImport)s?d.push([e,t]):(c(e),s=t);else{a.textContent='@import "'+e+'";';var n=setInterval(function(){try{a.sheet.cssRules,clearInterval(n),t()}catch(e){}},10)}},p=function(t,n){var o=document.createElement("link");if(o.type="text/css",o.rel="stylesheet",r)o.onload=function(){o.onload=function(){},setTimeout(n,7)};else var a=setInterval(function(){for(var e=0;e<document.styleSheets.length;e++){var t=document.styleSheets[e];if(t.href==o.href)return clearInterval(a),n()}},10);o.href=t,e.appendChild(o)};return o.normalize=function(e,t){return".css"==e.substr(e.length-4,4)&&(e=e.substr(0,e.length-4)),t(e)},o.load=function(e,t,r){(n?h:p)(t.toUrl(e+".css"),r)},o});
  189. /**
  190. @Name:layer v3.0.1 Web弹层组件
  191. @Author:贤心
  192. @Site:http://layer.layui.com
  193. @License:LGPL
  194. */
  195. ;!function(window, undefined){
  196. "use strict";
  197. var isLayui = window.layui && layui.define, $, win, ready = {
  198. getPath: function(){
  199. var js = document.scripts, script = js[js.length - 1], jsPath = script.src;
  200. if(script.getAttribute('merge')) return;
  201. return jsPath.substring(0, jsPath.lastIndexOf("/") + 1);
  202. }(),
  203. config: {}, end: {}, minIndex: 0, minLeft: [],
  204. btn: ['&#x786E;&#x5B9A;', '&#x53D6;&#x6D88;'],
  205. //五种原始层模式
  206. type: ['dialog', 'page', 'iframe', 'loading', 'tips']
  207. };
  208. //默认内置方法。
  209. var layer = {
  210. v: '3.0.1',
  211. ie: function(){ //ie版本
  212. var agent = navigator.userAgent.toLowerCase();
  213. return (!!window.ActiveXObject || "ActiveXObject" in window) ? (
  214. (agent.match(/msie\s(\d+)/) || [])[1] || '11' //由于ie11并没有msie的标识
  215. ) : false;
  216. }(),
  217. index: (window.layer && window.layer.v) ? 100000 : 0,
  218. path: ready.getPath,
  219. config: function(options, fn){
  220. options = options || {};
  221. layer.cache = ready.config = $.extend({}, ready.config, options);
  222. layer.path = ready.config.path || layer.path;
  223. typeof options.extend === 'string' && (options.extend = [options.extend]);
  224. if(ready.config.path) layer.ready();
  225. if(!options.extend) return this;
  226. isLayui
  227. ? layui.addcss('modules/layer/' + options.extend)
  228. : layer.link('skin/' + options.extend);
  229. return this;
  230. },
  231. //载入CSS配件
  232. link: function(href, fn, cssname){
  233. //未设置路径,则不主动加载css
  234. if(!layer.path) return;
  235. var head = $('head')[0], link = document.createElement('link');
  236. if(typeof fn === 'string') cssname = fn;
  237. var app = (cssname || href).replace(/\.|\//g, '');
  238. var id = 'layuicss-'+app, timeout = 0;
  239. link.rel = 'stylesheet';
  240. link.href = layer.path + href;
  241. link.id = id;
  242. if(!$('#'+ id)[0]){
  243. head.appendChild(link);
  244. }
  245. if(typeof fn !== 'function') return;
  246. //轮询css是否加载完毕
  247. (function poll() {
  248. if(++timeout > 8 * 1000 / 100){
  249. return window.console && console.error('layer.css: Invalid');
  250. };
  251. parseInt($('#'+id).css('width')) === 1989 ? fn() : setTimeout(poll, 100);
  252. }());
  253. },
  254. ready: function(callback){
  255. var cssname = 'skinlayercss', ver = '1110';
  256. isLayui ? layui.addcss('modules/layer/default/layer.css?v='+layer.v+ver, callback, cssname)
  257. : layer.link('skin/default/layer.css?v='+layer.v+ver, callback, cssname);
  258. return this;
  259. },
  260. //各种快捷引用
  261. alert: function(content, options, yes){
  262. var type = typeof options === 'function';
  263. if(type) yes = options;
  264. return layer.open($.extend({
  265. content: content,
  266. yes: yes
  267. }, type ? {} : options));
  268. },
  269. confirm: function(content, options, yes, cancel){
  270. var type = typeof options === 'function';
  271. if(type){
  272. cancel = yes;
  273. yes = options;
  274. }
  275. return layer.open($.extend({
  276. content: content,
  277. btn: ready.btn,
  278. yes: yes,
  279. btn2: cancel
  280. }, type ? {} : options));
  281. },
  282. msg: function(content, options, end){ //最常用提示层
  283. var type = typeof options === 'function', rskin = ready.config.skin;
  284. var skin = (rskin ? rskin + ' ' + rskin + '-msg' : '')||'layui-layer-msg';
  285. var anim = doms.anim.length - 1;
  286. if(type) end = options;
  287. return layer.open($.extend({
  288. content: content,
  289. time: 3000,
  290. shade: false,
  291. skin: skin,
  292. title: false,
  293. closeBtn: false,
  294. btn: false,
  295. resize: false,
  296. end: end
  297. }, (type && !ready.config.skin) ? {
  298. skin: skin + ' layui-layer-hui',
  299. anim: anim
  300. } : function(){
  301. options = options || {};
  302. if(options.icon === -1 || options.icon === undefined && !ready.config.skin){
  303. options.skin = skin + ' ' + (options.skin||'layui-layer-hui');
  304. }
  305. return options;
  306. }()));
  307. },
  308. load: function(icon, options){
  309. return layer.open($.extend({
  310. type: 3,
  311. icon: icon || 0,
  312. resize: false,
  313. shade: 0.01
  314. }, options));
  315. },
  316. tips: function(content, follow, options){
  317. return layer.open($.extend({
  318. type: 4,
  319. content: [content, follow],
  320. closeBtn: false,
  321. time: 3000,
  322. shade: false,
  323. resize: false,
  324. fixed: false,
  325. maxWidth: 210
  326. }, options));
  327. }
  328. };
  329. var Class = function(setings){
  330. var that = this;
  331. that.index = ++layer.index;
  332. that.config = $.extend({}, that.config, ready.config, setings);
  333. document.body ? that.creat() : setTimeout(function(){
  334. that.creat();
  335. }, 50);
  336. };
  337. Class.pt = Class.prototype;
  338. //缓存常用字符
  339. var doms = ['layui-layer', '.layui-layer-title', '.layui-layer-main', '.layui-layer-dialog', 'layui-layer-iframe', 'layui-layer-content', 'layui-layer-btn', 'layui-layer-close'];
  340. doms.anim = ['layer-anim', 'layer-anim-01', 'layer-anim-02', 'layer-anim-03', 'layer-anim-04', 'layer-anim-05', 'layer-anim-06'];
  341. //默认配置
  342. Class.pt.config = {
  343. type: 0,
  344. shade: 0.3,
  345. fixed: true,
  346. move: doms[1],
  347. title: '&#x4FE1;&#x606F;',
  348. offset: 'auto',
  349. area: 'auto',
  350. closeBtn: 1,
  351. time: 0, //0表示不自动关闭
  352. zIndex: 19891014,
  353. maxWidth: 360,
  354. anim: 0,
  355. icon: -1,
  356. moveType: 1,
  357. resize: true,
  358. scrollbar: true, //是否允许浏览器滚动条
  359. tips: 2
  360. };
  361. //容器
  362. Class.pt.vessel = function(conType, callback){
  363. var that = this, times = that.index, config = that.config;
  364. var zIndex = config.zIndex + times, titype = typeof config.title === 'object';
  365. var ismax = config.maxmin && (config.type === 1 || config.type === 2);
  366. var titleHTML = (config.title ? '<div class="layui-layer-title" style="'+ (titype ? config.title[1] : '') +'">'
  367. + (titype ? config.title[0] : config.title)
  368. + '</div>' : '');
  369. config.zIndex = zIndex;
  370. callback([
  371. //遮罩
  372. config.shade ? ('<div class="layui-layer-shade" id="layui-layer-shade'+ times +'" times="'+ times +'" style="'+ ('z-index:'+ (zIndex-1) +'; background-color:'+ (config.shade[1]||'#000') +'; opacity:'+ (config.shade[0]||config.shade) +'; filter:alpha(opacity='+ (config.shade[0]*100||config.shade*100) +');') +'"></div>') : '',
  373. //主体
  374. '<div class="'+ doms[0] + (' layui-layer-'+ready.type[config.type]) + (((config.type == 0 || config.type == 2) && !config.shade) ? ' layui-layer-border' : '') + ' ' + (config.skin||'') +'" id="'+ doms[0] + times +'" type="'+ ready.type[config.type] +'" times="'+ times +'" showtime="'+ config.time +'" conType="'+ (conType ? 'object' : 'string') +'" style="z-index: '+ zIndex +'; width:'+ config.area[0] + ';height:' + config.area[1] + (config.fixed ? '' : ';position:absolute;') +'">'
  375. + (conType && config.type != 2 ? '' : titleHTML)
  376. + '<div id="'+ (config.id||'') +'" class="layui-layer-content'+ ((config.type == 0 && config.icon !== -1) ? ' layui-layer-padding' :'') + (config.type == 3 ? ' layui-layer-loading'+config.icon : '') +'">'
  377. + (config.type == 0 && config.icon !== -1 ? '<i class="layui-layer-ico layui-layer-ico'+ config.icon +'"></i>' : '')
  378. + (config.type == 1 && conType ? '' : (config.content||''))
  379. + '</div>'
  380. + '<span class="layui-layer-setwin">'+ function(){
  381. var closebtn = ismax ? '<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>' : '';
  382. config.closeBtn && (closebtn += '<a class="layui-layer-ico '+ doms[7] +' '+ doms[7] + (config.title ? config.closeBtn : (config.type == 4 ? '1' : '2')) +'" href="javascript:;"></a>');
  383. return closebtn;
  384. }() + '</span>'
  385. + (config.btn ? function(){
  386. var button = '';
  387. typeof config.btn === 'string' && (config.btn = [config.btn]);
  388. for(var i = 0, len = config.btn.length; i < len; i++){
  389. button += '<a class="'+ doms[6] +''+ i +'">'+ config.btn[i] +'</a>'
  390. }
  391. return '<div class="'+ doms[6] +' layui-layer-btn-'+ (config.btnAlign||'') +'">'+ button +'</div>'
  392. }() : '')
  393. + (config.resize ? '<span class="layui-layer-resize"></span>' : '')
  394. + '</div>'
  395. ], titleHTML, $('<div class="layui-layer-move"></div>'));
  396. return that;
  397. };
  398. //创建骨架
  399. Class.pt.creat = function(){
  400. var that = this
  401. ,config = that.config
  402. ,times = that.index, nodeIndex
  403. ,content = config.content
  404. ,conType = typeof content === 'object'
  405. ,body = $('body');
  406. if($('#'+config.id)[0]) return;
  407. if(typeof config.area === 'string'){
  408. config.area = config.area === 'auto' ? ['', ''] : [config.area, ''];
  409. }
  410. //anim兼容旧版shift
  411. if(config.shift){
  412. config.anim = config.shift;
  413. }
  414. if(layer.ie == 6){
  415. config.fixed = false;
  416. }
  417. switch(config.type){
  418. case 0:
  419. config.btn = ('btn' in config) ? config.btn : ready.btn[0];
  420. layer.closeAll('dialog');
  421. break;
  422. case 2:
  423. var content = config.content = conType ? config.content : [config.content||'http://layer.layui.com', 'auto'];
  424. config.content = '<iframe scrolling="'+ (config.content[1]||'auto') +'" allowtransparency="true" id="'+ doms[4] +''+ times +'" name="'+ doms[4] +''+ times +'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="' + config.content[0] + '"></iframe>';
  425. break;
  426. case 3:
  427. delete config.title;
  428. delete config.closeBtn;
  429. config.icon === -1 && (config.icon === 0);
  430. layer.closeAll('loading');
  431. break;
  432. case 4:
  433. conType || (config.content = [config.content, 'body']);
  434. config.follow = config.content[1];
  435. config.content = config.content[0] + '<i class="layui-layer-TipsG"></i>';
  436. delete config.title;
  437. config.tips = typeof config.tips === 'object' ? config.tips : [config.tips, true];
  438. config.tipsMore || layer.closeAll('tips');
  439. break;
  440. }
  441. //建立容器
  442. that.vessel(conType, function(html, titleHTML, moveElem){
  443. body.append(html[0]);
  444. conType ? function(){
  445. (config.type == 2 || config.type == 4) ? function(){
  446. $('body').append(html[1]);
  447. }() : function(){
  448. if(!content.parents('.'+doms[0])[0]){
  449. content.data('display', content.css('display')).show().addClass('layui-layer-wrap').wrap(html[1]);
  450. $('#'+ doms[0] + times).find('.'+doms[5]).before(titleHTML);
  451. }
  452. }();
  453. }() : body.append(html[1]);
  454. $('.layui-layer-move')[0] || body.append(ready.moveElem = moveElem);
  455. that.layero = $('#'+ doms[0] + times);
  456. config.scrollbar || doms.html.css('overflow', 'hidden').attr('layer-full', times);
  457. }).auto(times);
  458. config.type == 2 && layer.ie == 6 && that.layero.find('iframe').attr('src', content[0]);
  459. //坐标自适应浏览器窗口尺寸
  460. config.type == 4 ? that.tips() : that.offset();
  461. if(config.fixed){
  462. win.on('resize', function(){
  463. that.offset();
  464. (/^\d+%$/.test(config.area[0]) || /^\d+%$/.test(config.area[1])) && that.auto(times);
  465. config.type == 4 && that.tips();
  466. });
  467. }
  468. config.time <= 0 || setTimeout(function(){
  469. layer.close(that.index)
  470. }, config.time);
  471. that.move().callback();
  472. //为兼容jQuery3.0的css动画影响元素尺寸计算
  473. if(doms.anim[config.anim]){
  474. that.layero.addClass(doms.anim[config.anim]).data('anim', true);
  475. };
  476. };
  477. //自适应
  478. Class.pt.auto = function(index){
  479. var that = this, config = that.config, layero = $('#'+ doms[0] + index);
  480. if(config.area[0] === '' && config.maxWidth > 0){
  481. //为了修复IE7下一个让人难以理解的bug
  482. if(layer.ie && layer.ie < 8 && config.btn){
  483. layero.width(layero.innerWidth());
  484. }
  485. layero.outerWidth() > config.maxWidth && layero.width(config.maxWidth);
  486. }
  487. var area = [layero.innerWidth(), layero.innerHeight()];
  488. var titHeight = layero.find(doms[1]).outerHeight() || 0;
  489. var btnHeight = layero.find('.'+doms[6]).outerHeight() || 0;
  490. function setHeight(elem){
  491. elem = layero.find(elem);
  492. elem.height(area[1] - titHeight - btnHeight - 2*(parseFloat(elem.css('padding'))|0));
  493. }
  494. switch(config.type){
  495. case 2:
  496. setHeight('iframe');
  497. break;
  498. default:
  499. if(config.area[1] === ''){
  500. if(config.fixed && area[1] >= win.height()){
  501. area[1] = win.height();
  502. setHeight('.'+doms[5]);
  503. }
  504. } else {
  505. setHeight('.'+doms[5]);
  506. }
  507. break;
  508. }
  509. return that;
  510. };
  511. //计算坐标
  512. Class.pt.offset = function(){
  513. var that = this, config = that.config, layero = that.layero;
  514. var area = [layero.outerWidth(), layero.outerHeight()];
  515. var type = typeof config.offset === 'object';
  516. that.offsetTop = (win.height() - area[1])/2;
  517. that.offsetLeft = (win.width() - area[0])/2;
  518. if(type){
  519. that.offsetTop = config.offset[0];
  520. that.offsetLeft = config.offset[1]||that.offsetLeft;
  521. } else if(config.offset !== 'auto'){
  522. if(config.offset === 't'){ //上
  523. that.offsetTop = 0;
  524. } else if(config.offset === 'r'){ //右
  525. that.offsetLeft = win.width() - area[0];
  526. } else if(config.offset === 'b'){ //下
  527. that.offsetTop = win.height() - area[1];
  528. } else if(config.offset === 'l'){ //左
  529. that.offsetLeft = 0;
  530. } else if(config.offset === 'lt'){ //左上角
  531. that.offsetTop = 0;
  532. that.offsetLeft = 0;
  533. } else if(config.offset === 'lb'){ //左下角
  534. that.offsetTop = win.height() - area[1];
  535. that.offsetLeft = 0;
  536. } else if(config.offset === 'rt'){ //右上角
  537. that.offsetTop = 0;
  538. that.offsetLeft = win.width() - area[0];
  539. } else if(config.offset === 'rb'){ //右下角
  540. that.offsetTop = win.height() - area[1];
  541. that.offsetLeft = win.width() - area[0];
  542. } else {
  543. that.offsetTop = config.offset;
  544. }
  545. }
  546. if(!config.fixed){
  547. that.offsetTop = /%$/.test(that.offsetTop) ?
  548. win.height()*parseFloat(that.offsetTop)/100
  549. : parseFloat(that.offsetTop);
  550. that.offsetLeft = /%$/.test(that.offsetLeft) ?
  551. win.width()*parseFloat(that.offsetLeft)/100
  552. : parseFloat(that.offsetLeft);
  553. that.offsetTop += win.scrollTop();
  554. that.offsetLeft += win.scrollLeft();
  555. }
  556. if(layero.attr('minLeft')){
  557. that.offsetTop = win.height() - (layero.find(doms[1]).outerHeight() || 0);
  558. that.offsetLeft = layero.css('left');
  559. }
  560. layero.css({top: that.offsetTop, left: that.offsetLeft});
  561. };
  562. //Tips
  563. Class.pt.tips = function(){
  564. var that = this, config = that.config, layero = that.layero;
  565. var layArea = [layero.outerWidth(), layero.outerHeight()], follow = $(config.follow);
  566. if(!follow[0]) follow = $('body');
  567. var goal = {
  568. width: follow.outerWidth(),
  569. height: follow.outerHeight(),
  570. top: follow.offset().top,
  571. left: follow.offset().left
  572. }, tipsG = layero.find('.layui-layer-TipsG');
  573. var guide = config.tips[0];
  574. config.tips[1] || tipsG.remove();
  575. goal.autoLeft = function(){
  576. if(goal.left + layArea[0] - win.width() > 0){
  577. goal.tipLeft = goal.left + goal.width - layArea[0];
  578. tipsG.css({right: 12, left: 'auto'});
  579. } else {
  580. goal.tipLeft = goal.left;
  581. };
  582. };
  583. //辨别tips的方位
  584. goal.where = [function(){ //上
  585. goal.autoLeft();
  586. goal.tipTop = goal.top - layArea[1] - 10;
  587. tipsG.removeClass('layui-layer-TipsB').addClass('layui-layer-TipsT').css('border-right-color', config.tips[1]);
  588. }, function(){ //右
  589. goal.tipLeft = goal.left + goal.width + 10;
  590. goal.tipTop = goal.top;
  591. tipsG.removeClass('layui-layer-TipsL').addClass('layui-layer-TipsR').css('border-bottom-color', config.tips[1]);
  592. }, function(){ //下
  593. goal.autoLeft();
  594. goal.tipTop = goal.top + goal.height + 10;
  595. tipsG.removeClass('layui-layer-TipsT').addClass('layui-layer-TipsB').css('border-right-color', config.tips[1]);
  596. }, function(){ //左
  597. goal.tipLeft = goal.left - layArea[0] - 10;
  598. goal.tipTop = goal.top;
  599. tipsG.removeClass('layui-layer-TipsR').addClass('layui-layer-TipsL').css('border-bottom-color', config.tips[1]);
  600. }];
  601. goal.where[guide-1]();
  602. /* 8*2为小三角形占据的空间 */
  603. if(guide === 1){
  604. goal.top - (win.scrollTop() + layArea[1] + 8*2) < 0 && goal.where[2]();
  605. } else if(guide === 2){
  606. win.width() - (goal.left + goal.width + layArea[0] + 8*2) > 0 || goal.where[3]()
  607. } else if(guide === 3){
  608. (goal.top - win.scrollTop() + goal.height + layArea[1] + 8*2) - win.height() > 0 && goal.where[0]();
  609. } else if(guide === 4){
  610. layArea[0] + 8*2 - goal.left > 0 && goal.where[1]()
  611. }
  612. layero.find('.'+doms[5]).css({
  613. 'background-color': config.tips[1],
  614. 'padding-right': (config.closeBtn ? '30px' : '')
  615. });
  616. layero.css({
  617. left: goal.tipLeft - (config.fixed ? win.scrollLeft() : 0),
  618. top: goal.tipTop - (config.fixed ? win.scrollTop() : 0)
  619. });
  620. }
  621. //拖拽层
  622. Class.pt.move = function(){
  623. var that = this
  624. ,config = that.config
  625. ,_DOC = $(document)
  626. ,layero = that.layero
  627. ,moveElem = layero.find(config.move)
  628. ,resizeElem = layero.find('.layui-layer-resize')
  629. ,dict = {};
  630. if(config.move){
  631. moveElem.css('cursor', 'move');
  632. }
  633. moveElem.on('mousedown', function(e){
  634. e.preventDefault();
  635. if(config.move){
  636. dict.moveStart = true;
  637. dict.offset = [
  638. e.clientX - parseFloat(layero.css('left'))
  639. ,e.clientY - parseFloat(layero.css('top'))
  640. ];
  641. ready.moveElem.css('cursor', 'move').show();
  642. }
  643. });
  644. resizeElem.on('mousedown', function(e){
  645. e.preventDefault();
  646. dict.resizeStart = true;
  647. dict.offset = [e.clientX, e.clientY];
  648. dict.area = [
  649. layero.outerWidth()
  650. ,layero.outerHeight()
  651. ];
  652. ready.moveElem.css('cursor', 'se-resize').show();
  653. });
  654. _DOC.on('mousemove', function(e){
  655. //拖拽移动
  656. if(dict.moveStart){
  657. var X = e.clientX - dict.offset[0]
  658. ,Y = e.clientY - dict.offset[1]
  659. ,fixed = layero.css('position') === 'fixed';
  660. e.preventDefault();
  661. dict.stX = fixed ? 0 : win.scrollLeft();
  662. dict.stY = fixed ? 0 : win.scrollTop();
  663. //控制元素不被拖出窗口外
  664. if(!config.moveOut){
  665. var setRig = win.width() - layero.outerWidth() + dict.stX
  666. ,setBot = win.height() - layero.outerHeight() + dict.stY;
  667. X < dict.stX && (X = dict.stX);
  668. X > setRig && (X = setRig);
  669. Y < dict.stY && (Y = dict.stY);
  670. Y > setBot && (Y = setBot);
  671. }
  672. layero.css({
  673. left: X
  674. ,top: Y
  675. });
  676. }
  677. //Resize
  678. if(config.resize && dict.resizeStart){
  679. var X = e.clientX - dict.offset[0]
  680. ,Y = e.clientY - dict.offset[1];
  681. e.preventDefault();
  682. layer.style(that.index, {
  683. width: dict.area[0] + X
  684. ,height: dict.area[1] + Y
  685. })
  686. dict.isResize = true;
  687. }
  688. }).on('mouseup', function(e){
  689. if(dict.moveStart){
  690. delete dict.moveStart;
  691. ready.moveElem.hide();
  692. config.moveEnd && config.moveEnd();
  693. }
  694. if(dict.resizeStart){
  695. delete dict.resizeStart;
  696. ready.moveElem.hide();
  697. }
  698. });
  699. return that;
  700. };
  701. Class.pt.callback = function(){
  702. var that = this, layero = that.layero, config = that.config;
  703. that.openLayer();
  704. if(config.success){
  705. if(config.type == 2){
  706. layero.find('iframe').on('load', function(){
  707. config.success(layero, that.index);
  708. });
  709. } else {
  710. config.success(layero, that.index);
  711. }
  712. }
  713. layer.ie == 6 && that.IE6(layero);
  714. //按钮
  715. layero.find('.'+ doms[6]).children('a').on('click', function(){
  716. var index = $(this).index();
  717. if(index === 0){
  718. if(config.yes){
  719. config.yes(that.index, layero)
  720. } else if(config['btn1']){
  721. config['btn1'](that.index, layero)
  722. } else {
  723. layer.close(that.index);
  724. }
  725. } else {
  726. var close = config['btn'+(index+1)] && config['btn'+(index+1)](that.index, layero);
  727. close === false || layer.close(that.index);
  728. }
  729. });
  730. //取消
  731. function cancel(){
  732. var close = config.cancel && config.cancel(that.index, layero);
  733. close === false || layer.close(that.index);
  734. }
  735. //右上角关闭回调
  736. layero.find('.'+ doms[7]).on('click', cancel);
  737. //点遮罩关闭
  738. if(config.shadeClose){
  739. $('#layui-layer-shade'+ that.index).on('click', function(){
  740. layer.close(that.index);
  741. });
  742. }
  743. //最小化
  744. layero.find('.layui-layer-min').on('click', function(){
  745. var min = config.min && config.min(layero);
  746. min === false || layer.min(that.index, config);
  747. });
  748. //全屏/还原
  749. layero.find('.layui-layer-max').on('click', function(){
  750. if($(this).hasClass('layui-layer-maxmin')){
  751. layer.restore(that.index);
  752. config.restore && config.restore(layero);
  753. } else {
  754. layer.full(that.index, config);
  755. setTimeout(function(){
  756. config.full && config.full(layero);
  757. }, 100);
  758. }
  759. });
  760. config.end && (ready.end[that.index] = config.end);
  761. };
  762. //for ie6 恢复select
  763. ready.reselect = function(){
  764. $.each($('select'), function(index , value){
  765. var sthis = $(this);
  766. if(!sthis.parents('.'+doms[0])[0]){
  767. (sthis.attr('layer') == 1 && $('.'+doms[0]).length < 1) && sthis.removeAttr('layer').show();
  768. }
  769. sthis = null;
  770. });
  771. };
  772. Class.pt.IE6 = function(layero){
  773. //隐藏select
  774. $('select').each(function(index , value){
  775. var sthis = $(this);
  776. if(!sthis.parents('.'+doms[0])[0]){
  777. sthis.css('display') === 'none' || sthis.attr({'layer' : '1'}).hide();
  778. }
  779. sthis = null;
  780. });
  781. };
  782. //需依赖原型的对外方法
  783. Class.pt.openLayer = function(){
  784. var that = this;
  785. //置顶当前窗口
  786. layer.zIndex = that.config.zIndex;
  787. layer.setTop = function(layero){
  788. var setZindex = function(){
  789. layer.zIndex++;
  790. layero.css('z-index', layer.zIndex + 1);
  791. };
  792. layer.zIndex = parseInt(layero[0].style.zIndex);
  793. layero.on('mousedown', setZindex);
  794. return layer.zIndex;
  795. };
  796. };
  797. ready.record = function(layero){
  798. var area = [
  799. layero.width(),
  800. layero.height(),
  801. layero.position().top,
  802. layero.position().left + parseFloat(layero.css('margin-left'))
  803. ];
  804. layero.find('.layui-layer-max').addClass('layui-layer-maxmin');
  805. layero.attr({area: area});
  806. };
  807. ready.rescollbar = function(index){
  808. if(doms.html.attr('layer-full') == index){
  809. if(doms.html[0].style.removeProperty){
  810. doms.html[0].style.removeProperty('overflow');
  811. } else {
  812. doms.html[0].style.removeAttribute('overflow');
  813. }
  814. doms.html.removeAttr('layer-full');
  815. }
  816. };
  817. /** 内置成员 */
  818. window.layer = layer;
  819. //获取子iframe的DOM
  820. layer.getChildFrame = function(selector, index){
  821. index = index || $('.'+doms[4]).attr('times');
  822. return $('#'+ doms[0] + index).find('iframe').contents().find(selector);
  823. };
  824. //得到当前iframe层的索引,子iframe时使用
  825. layer.getFrameIndex = function(name){
  826. return $('#'+ name).parents('.'+doms[4]).attr('times');
  827. };
  828. //iframe层自适应宽高
  829. layer.iframeAuto = function(index){
  830. if(!index) return;
  831. var heg = layer.getChildFrame('html', index).outerHeight();
  832. var layero = $('#'+ doms[0] + index);
  833. var titHeight = layero.find(doms[1]).outerHeight() || 0;
  834. var btnHeight = layero.find('.'+doms[6]).outerHeight() || 0;
  835. layero.css({height: heg + titHeight + btnHeight});
  836. layero.find('iframe').css({height: heg});
  837. };
  838. //重置iframe url
  839. layer.iframeSrc = function(index, url){
  840. $('#'+ doms[0] + index).find('iframe').attr('src', url);
  841. };
  842. //设定层的样式
  843. layer.style = function(index, options, limit){
  844. var layero = $('#'+ doms[0] + index)
  845. ,contElem = layero.find('.layui-layer-content')
  846. ,type = layero.attr('type')
  847. ,titHeight = layero.find(doms[1]).outerHeight() || 0
  848. ,btnHeight = layero.find('.'+doms[6]).outerHeight() || 0
  849. ,minLeft = layero.attr('minLeft');
  850. if(type === ready.type[3] || type === ready.type[4]){
  851. return;
  852. }
  853. if(!limit){
  854. if(parseFloat(options.width) <= 260){
  855. options.width = 260;
  856. };
  857. if(parseFloat(options.height) - titHeight - btnHeight <= 64){
  858. options.height = 64 + titHeight + btnHeight;
  859. };
  860. }
  861. layero.css(options);
  862. btnHeight = layero.find('.'+doms[6]).outerHeight();
  863. if(type === ready.type[2]){
  864. layero.find('iframe').css({
  865. height: parseFloat(options.height) - titHeight - btnHeight
  866. });
  867. } else {
  868. contElem.css({
  869. height: parseFloat(options.height) - titHeight - btnHeight
  870. - parseFloat(contElem.css('padding-top'))
  871. - parseFloat(contElem.css('padding-bottom'))
  872. })
  873. }
  874. };
  875. //最小化
  876. layer.min = function(index, options){
  877. var layero = $('#'+ doms[0] + index)
  878. ,titHeight = layero.find(doms[1]).outerHeight() || 0
  879. ,left = layero.attr('minLeft') || (181*ready.minIndex)+'px'
  880. ,position = layero.css('position');
  881. ready.record(layero);
  882. if(ready.minLeft[0]){
  883. left = ready.minLeft[0];
  884. ready.minLeft.shift();
  885. }
  886. layero.attr('position', position);
  887. layer.style(index, {
  888. width: 180
  889. ,height: titHeight
  890. ,left: left
  891. ,top: win.height() - titHeight
  892. ,position: 'fixed'
  893. ,overflow: 'hidden'
  894. }, true);
  895. layero.find('.layui-layer-min').hide();
  896. layero.attr('type') === 'page' && layero.find(doms[4]).hide();
  897. ready.rescollbar(index);
  898. if(!layero.attr('minLeft')){
  899. ready.minIndex++;
  900. }
  901. layero.attr('minLeft', left);
  902. };
  903. //还原
  904. layer.restore = function(index){
  905. var layero = $('#'+ doms[0] + index), area = layero.attr('area').split(',');
  906. var type = layero.attr('type');
  907. layer.style(index, {
  908. width: parseFloat(area[0]),
  909. height: parseFloat(area[1]),
  910. top: parseFloat(area[2]),
  911. left: parseFloat(area[3]),
  912. position: layero.attr('position'),
  913. overflow: 'visible'
  914. }, true);
  915. layero.find('.layui-layer-max').removeClass('layui-layer-maxmin');
  916. layero.find('.layui-layer-min').show();
  917. layero.attr('type') === 'page' && layero.find(doms[4]).show();
  918. ready.rescollbar(index);
  919. };
  920. //全屏
  921. layer.full = function(index){
  922. var layero = $('#'+ doms[0] + index), timer;
  923. ready.record(layero);
  924. if(!doms.html.attr('layer-full')){
  925. doms.html.css('overflow','hidden').attr('layer-full', index);
  926. }
  927. clearTimeout(timer);
  928. timer = setTimeout(function(){
  929. var isfix = layero.css('position') === 'fixed';
  930. layer.style(index, {
  931. top: isfix ? 0 : win.scrollTop(),
  932. left: isfix ? 0 : win.scrollLeft(),
  933. width: win.width(),
  934. height: win.height()
  935. }, true);
  936. layero.find('.layui-layer-min').hide();
  937. }, 100);
  938. };
  939. //改变title
  940. layer.title = function(name, index){
  941. var title = $('#'+ doms[0] + (index||layer.index)).find(doms[1]);
  942. title.html(name);
  943. };
  944. //关闭layer总方法
  945. layer.close = function(index){
  946. var layero = $('#'+ doms[0] + index), type = layero.attr('type'), closeAnim = 'layer-anim-close';
  947. if(!layero[0]) return;
  948. var WRAP = 'layui-layer-wrap', remove = function(){
  949. if(type === ready.type[1] && layero.attr('conType') === 'object'){
  950. layero.children(':not(.'+ doms[5] +')').remove();
  951. var wrap = layero.find('.'+WRAP);
  952. for(var i = 0; i < 2; i++){
  953. wrap.unwrap();
  954. }
  955. wrap.css('display', wrap.data('display')).removeClass(WRAP);
  956. } else {
  957. //低版本IE 回收 iframe
  958. if(type === ready.type[2]){
  959. try {
  960. var iframe = $('#'+doms[4]+index)[0];
  961. iframe.contentWindow.document.write('');
  962. iframe.contentWindow.close();
  963. layero.find('.'+doms[5])[0].removeChild(iframe);
  964. } catch(e){}
  965. }
  966. layero[0].innerHTML = '';
  967. layero.remove();
  968. }
  969. };
  970. if(layero.data('anim')){
  971. layero.addClass(closeAnim);
  972. }
  973. $('#layui-layer-moves, #layui-layer-shade' + index).remove();
  974. layer.ie == 6 && ready.reselect();
  975. ready.rescollbar(index);
  976. typeof ready.end[index] === 'function' && ready.end[index]();
  977. delete ready.end[index];
  978. if(layero.attr('minLeft')){
  979. ready.minIndex--;
  980. ready.minLeft.push(layero.attr('minLeft'));
  981. }
  982. setTimeout(function(){
  983. remove();
  984. }, ((layer.ie && layer.ie < 10) || !layero.data('anim')) ? 0 : 200);
  985. };
  986. //关闭所有层
  987. layer.closeAll = function(type){
  988. $.each($('.'+doms[0]), function(){
  989. var othis = $(this);
  990. var is = type ? (othis.attr('type') === type) : 1;
  991. is && layer.close(othis.attr('times'));
  992. is = null;
  993. });
  994. };
  995. /**
  996. 拓展模块,layui开始合并在一起
  997. */
  998. var cache = layer.cache||{}, skin = function(type){
  999. return (cache.skin ? (' ' + cache.skin + ' ' + cache.skin + '-'+type) : '');
  1000. };
  1001. //仿系统prompt
  1002. layer.prompt = function(options, yes){
  1003. var style = '';
  1004. options = options || {};
  1005. if(typeof options === 'function') yes = options;
  1006. if(options.area){
  1007. var area = options.area;
  1008. style = 'style="width: '+ area[0] +'; height: '+ area[1] + ';"';
  1009. delete options.area;
  1010. }
  1011. var prompt, content = options.formType == 2 ? '<textarea class="layui-layer-input"' + style +'>' + (options.value||'') +'</textarea>' : function(){
  1012. return '<input type="'+ (options.formType == 1 ? 'password' : 'text') +'" class="layui-layer-input" value="'+ (options.value||'') +'">';
  1013. }();
  1014. return layer.open($.extend({
  1015. type: 1
  1016. ,btn: ['&#x786E;&#x5B9A;','&#x53D6;&#x6D88;']
  1017. ,content: content
  1018. ,skin: 'layui-layer-prompt' + skin('prompt')
  1019. ,maxWidth: win.width()
  1020. ,success: function(layero){
  1021. prompt = layero.find('.layui-layer-input');
  1022. prompt.focus();
  1023. }
  1024. ,resize: false
  1025. ,yes: function(index){
  1026. var value = prompt.val();
  1027. if(value === ''){
  1028. prompt.focus();
  1029. } else if(value.length > (options.maxlength||500)) {
  1030. layer.tips('&#x6700;&#x591A;&#x8F93;&#x5165;'+ (options.maxlength || 500) +'&#x4E2A;&#x5B57;&#x6570;', prompt, {tips: 1});
  1031. } else {
  1032. yes && yes(value, index, prompt);
  1033. }
  1034. }
  1035. }, options));
  1036. };
  1037. //tab层
  1038. layer.tab = function(options){
  1039. options = options || {};
  1040. var tab = options.tab || {};
  1041. return layer.open($.extend({
  1042. type: 1,
  1043. skin: 'layui-layer-tab' + skin('tab'),
  1044. resize: false,
  1045. title: function(){
  1046. var len = tab.length, ii = 1, str = '';
  1047. if(len > 0){
  1048. str = '<span class="layui-layer-tabnow">'+ tab[0].title +'</span>';
  1049. for(; ii < len; ii++){
  1050. str += '<span>'+ tab[ii].title +'</span>';
  1051. }
  1052. }
  1053. return str;
  1054. }(),
  1055. content: '<ul class="layui-layer-tabmain">'+ function(){
  1056. var len = tab.length, ii = 1, str = '';
  1057. if(len > 0){
  1058. str = '<li class="layui-layer-tabli xubox_tab_layer">'+ (tab[0].content || 'no content') +'</li>';
  1059. for(; ii < len; ii++){
  1060. str += '<li class="layui-layer-tabli">'+ (tab[ii].content || 'no content') +'</li>';
  1061. }
  1062. }
  1063. return str;
  1064. }() +'</ul>',
  1065. success: function(layero){
  1066. var btn = layero.find('.layui-layer-title').children();
  1067. var main = layero.find('.layui-layer-tabmain').children();
  1068. btn.on('mousedown', function(e){
  1069. e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
  1070. var othis = $(this), index = othis.index();
  1071. othis.addClass('layui-layer-tabnow').siblings().removeClass('layui-layer-tabnow');
  1072. main.eq(index).show().siblings().hide();
  1073. typeof options.change === 'function' && options.change(index);
  1074. });
  1075. }
  1076. }, options));
  1077. };
  1078. //相册层
  1079. layer.photos = function(options, loop, key){
  1080. var dict = {};
  1081. options = options || {};
  1082. if(!options.photos) return;
  1083. var type = options.photos.constructor === Object;
  1084. var photos = type ? options.photos : {}, data = photos.data || [];
  1085. var start = photos.start || 0;
  1086. dict.imgIndex = (start|0) + 1;
  1087. options.img = options.img || 'img';
  1088. if(!type){ //页面直接获取
  1089. var parent = $(options.photos), pushData = function(){
  1090. data = [];
  1091. parent.find(options.img).each(function(index){
  1092. var othis = $(this);
  1093. othis.attr('layer-index', index);
  1094. data.push({
  1095. alt: othis.attr('alt'),
  1096. pid: othis.attr('layer-pid'),
  1097. src: othis.attr('layer-src') || othis.attr('src'),
  1098. thumb: othis.attr('src')
  1099. });
  1100. })
  1101. };
  1102. pushData();
  1103. if (data.length === 0) return;
  1104. loop || parent.on('click', options.img, function(){
  1105. var othis = $(this), index = othis.attr('layer-index');
  1106. layer.photos($.extend(options, {
  1107. photos: {
  1108. start: index,
  1109. data: data,
  1110. tab: options.tab
  1111. },
  1112. full: options.full
  1113. }), true);
  1114. pushData();
  1115. })
  1116. //不直接弹出
  1117. if(!loop) return;
  1118. } else if (data.length === 0){
  1119. return layer.msg('&#x6CA1;&#x6709;&#x56FE;&#x7247;');
  1120. }
  1121. //上一张
  1122. dict.imgprev = function(key){
  1123. dict.imgIndex--;
  1124. if(dict.imgIndex < 1){
  1125. dict.imgIndex = data.length;
  1126. }
  1127. dict.tabimg(key);
  1128. };
  1129. //下一张
  1130. dict.imgnext = function(key,errorMsg){
  1131. dict.imgIndex++;
  1132. if(dict.imgIndex > data.length){
  1133. dict.imgIndex = 1;
  1134. if (errorMsg) {return};
  1135. }
  1136. dict.tabimg(key)
  1137. };
  1138. //方向键
  1139. dict.keyup = function(event){
  1140. if(!dict.end){
  1141. var code = event.keyCode;
  1142. event.preventDefault();
  1143. if(code === 37){
  1144. dict.imgprev(true);
  1145. } else if(code === 39) {
  1146. dict.imgnext(true);
  1147. } else if(code === 27) {
  1148. layer.close(dict.index);
  1149. }
  1150. }
  1151. }
  1152. //切换
  1153. dict.tabimg = function(key){
  1154. if(data.length <= 1) return;
  1155. photos.start = dict.imgIndex - 1;
  1156. layer.close(dict.index);
  1157. layer.photos(options, true, key);
  1158. }
  1159. //一些动作
  1160. dict.event = function(){
  1161. dict.bigimg.hover(function(){
  1162. dict.imgsee.show();
  1163. }, function(){
  1164. dict.imgsee.hide();
  1165. });
  1166. dict.bigimg.find('.layui-layer-imgprev').on('click', function(event){
  1167. event.preventDefault();
  1168. dict.imgprev();
  1169. });
  1170. dict.bigimg.find('.layui-layer-imgnext').on('click', function(event){
  1171. event.preventDefault();
  1172. dict.imgnext();
  1173. });
  1174. $(document).on('keyup', dict.keyup);
  1175. };
  1176. //图片预加载
  1177. function loadImage(url, callback, error) {
  1178. var img = new Image();
  1179. img.src = url;
  1180. if(img.complete){
  1181. return callback(img);
  1182. }
  1183. img.onload = function(){
  1184. img.onload = null;
  1185. callback(img);
  1186. };
  1187. img.onerror = function(e){
  1188. img.onerror = null;
  1189. error(e);
  1190. };
  1191. };
  1192. dict.loadi = layer.load(1, {
  1193. shade: 'shade' in options ? false : 0.9,
  1194. scrollbar: false
  1195. });
  1196. loadImage(data[start].src, function(img){
  1197. layer.close(dict.loadi);
  1198. dict.index = layer.open($.extend({
  1199. type: 1,
  1200. area: function(){
  1201. var imgarea = [img.width, img.height];
  1202. var winarea = [$(window).width() - 100, $(window).height() - 100];
  1203. //如果 实际图片的宽或者高比 屏幕大(那么进行缩放)
  1204. if(!options.full && (imgarea[0]>winarea[0]||imgarea[1]>winarea[1])){
  1205. var wh = [imgarea[0]/winarea[0],imgarea[1]/winarea[1]];//取宽度缩放比例、高度缩放比例
  1206. if(wh[0] > wh[1]){//取缩放比例最大的进行缩放
  1207. imgarea[0] = imgarea[0]/wh[0];
  1208. imgarea[1] = imgarea[1]/wh[0];
  1209. } else if(wh[0] < wh[1]){
  1210. imgarea[0] = imgarea[0]/wh[1];
  1211. imgarea[1] = imgarea[1]/wh[1];
  1212. }
  1213. }
  1214. return [imgarea[0]+'px', imgarea[1]+'px'];
  1215. }(),
  1216. title: false,
  1217. shade: 0.9,
  1218. shadeClose: true,
  1219. closeBtn: false,
  1220. move: '.layui-layer-phimg img',
  1221. moveType: 1,
  1222. scrollbar: false,
  1223. moveOut: true,
  1224. anim: Math.random()*5|0,
  1225. skin: 'layui-layer-photos' + skin('photos'),
  1226. content: '<div class="layui-layer-phimg">'
  1227. +'<img src="'+ data[start].src +'" alt="'+ (data[start].alt||'') +'" layer-pid="'+ data[start].pid +'">'
  1228. +'<div class="layui-layer-imgsee">'
  1229. +(data.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>' : '')
  1230. +'<div class="layui-layer-imgbar" style="display:'+ (key ? 'block' : '') +'"><span class="layui-layer-imgtit"><a href="javascript:;">'+ (data[start].alt||'') +'</a><em>'+ dict.imgIndex +'/'+ data.length +'</em></span></div>'
  1231. +'</div>'
  1232. +'</div>',
  1233. success: function(layero, index){
  1234. dict.bigimg = layero.find('.layui-layer-phimg');
  1235. dict.imgsee = layero.find('.layui-layer-imguide,.layui-layer-imgbar');
  1236. dict.event(layero);
  1237. options.tab && options.tab(data[start], layero);
  1238. }, end: function(){
  1239. dict.end = true;
  1240. $(document).off('keyup', dict.keyup);
  1241. }
  1242. }, options));
  1243. }, function(){
  1244. layer.close(dict.loadi);
  1245. layer.msg('&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;', {
  1246. time: 30000,
  1247. btn: ['&#x4E0B;&#x4E00;&#x5F20;', '&#x4E0D;&#x770B;&#x4E86;'],
  1248. yes: function(){
  1249. data.length > 1 && dict.imgnext(true,true);
  1250. }
  1251. });
  1252. });
  1253. };
  1254. //主入口
  1255. ready.run = function(_$){
  1256. $ = _$;
  1257. win = $(window);
  1258. doms.html = $('html');
  1259. layer.open = function(deliver){
  1260. var o = new Class(deliver);
  1261. return o.index;
  1262. };
  1263. };
  1264. //加载方式
  1265. window.layui && layui.define ? (
  1266. layer.ready()
  1267. ,layui.define('jquery', function(exports){ //layui加载
  1268. layer.path = layui.cache.dir;
  1269. ready.run(layui.jquery);
  1270. //暴露模块
  1271. window.layer = layer;
  1272. exports('layer', layer);
  1273. })
  1274. ) : (
  1275. typeof define === 'function' ? define('layer',['jquery'], function(){ //requirejs加载
  1276. ready.run(window.jQuery);
  1277. return layer;
  1278. }) : function(){ //普通script标签加载
  1279. ready.run(window.jQuery);
  1280. layer.ready();
  1281. }()
  1282. );
  1283. }(window);
  1284. /*
  1285. * Toastr
  1286. * Copyright 2012-2015
  1287. * Authors: John Papa, Hans Fjällemark, and Tim Ferrell.
  1288. * All Rights Reserved.
  1289. * Use, reproduction, distribution, and modification of this code is subject to the terms and
  1290. * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php
  1291. *
  1292. * ARIA Support: Greta Krafsig
  1293. *
  1294. * Project: https://github.com/CodeSeven/toastr
  1295. */
  1296. /* global define */
  1297. (function (define) {
  1298. define('toastr',['jquery'], function ($) {
  1299. return (function () {
  1300. var $container;
  1301. var listener;
  1302. var toastId = 0;
  1303. var toastType = {
  1304. error: 'error',
  1305. info: 'info',
  1306. success: 'success',
  1307. warning: 'warning'
  1308. };
  1309. var toastr = {
  1310. clear: clear,
  1311. remove: remove,
  1312. error: error,
  1313. getContainer: getContainer,
  1314. info: info,
  1315. options: {},
  1316. subscribe: subscribe,
  1317. success: success,
  1318. version: '2.1.3',
  1319. warning: warning
  1320. };
  1321. var previousToast;
  1322. return toastr;
  1323. ////////////////
  1324. function error(message, title, optionsOverride) {
  1325. return notify({
  1326. type: toastType.error,
  1327. iconClass: getOptions().iconClasses.error,
  1328. message: message,
  1329. optionsOverride: optionsOverride,
  1330. title: title
  1331. });
  1332. }
  1333. function getContainer(options, create) {
  1334. if (!options) { options = getOptions(); }
  1335. $container = $('#' + options.containerId);
  1336. if ($container.length) {
  1337. return $container;
  1338. }
  1339. if (create) {
  1340. $container = createContainer(options);
  1341. }
  1342. return $container;
  1343. }
  1344. function info(message, title, optionsOverride) {
  1345. return notify({
  1346. type: toastType.info,
  1347. iconClass: getOptions().iconClasses.info,
  1348. message: message,
  1349. optionsOverride: optionsOverride,
  1350. title: title
  1351. });
  1352. }
  1353. function subscribe(callback) {
  1354. listener = callback;
  1355. }
  1356. function success(message, title, optionsOverride) {
  1357. return notify({
  1358. type: toastType.success,
  1359. iconClass: getOptions().iconClasses.success,
  1360. message: message,
  1361. optionsOverride: optionsOverride,
  1362. title: title
  1363. });
  1364. }
  1365. function warning(message, title, optionsOverride) {
  1366. return notify({
  1367. type: toastType.warning,
  1368. iconClass: getOptions().iconClasses.warning,
  1369. message: message,
  1370. optionsOverride: optionsOverride,
  1371. title: title
  1372. });
  1373. }
  1374. function clear($toastElement, clearOptions) {
  1375. var options = getOptions();
  1376. if (!$container) { getContainer(options); }
  1377. if (!clearToast($toastElement, options, clearOptions)) {
  1378. clearContainer(options);
  1379. }
  1380. }
  1381. function remove($toastElement) {
  1382. var options = getOptions();
  1383. if (!$container) { getContainer(options); }
  1384. if ($toastElement && $(':focus', $toastElement).length === 0) {
  1385. removeToast($toastElement);
  1386. return;
  1387. }
  1388. if ($container.children().length) {
  1389. $container.remove();
  1390. }
  1391. }
  1392. // internal functions
  1393. function clearContainer (options) {
  1394. var toastsToClear = $container.children();
  1395. for (var i = toastsToClear.length - 1; i >= 0; i--) {
  1396. clearToast($(toastsToClear[i]), options);
  1397. }
  1398. }
  1399. function clearToast ($toastElement, options, clearOptions) {
  1400. var force = clearOptions && clearOptions.force ? clearOptions.force : false;
  1401. if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {
  1402. $toastElement[options.hideMethod]({
  1403. duration: options.hideDuration,
  1404. easing: options.hideEasing,
  1405. complete: function () { removeToast($toastElement); }
  1406. });
  1407. return true;
  1408. }
  1409. return false;
  1410. }
  1411. function createContainer(options) {
  1412. $container = $('<div/>')
  1413. .attr('id', options.containerId)
  1414. .addClass(options.positionClass);
  1415. $container.appendTo($(options.target));
  1416. return $container;
  1417. }
  1418. function getDefaults() {
  1419. return {
  1420. tapToDismiss: true,
  1421. toastClass: 'toast',
  1422. containerId: 'toast-container',
  1423. debug: false,
  1424. showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery
  1425. showDuration: 300,
  1426. showEasing: 'swing', //swing and linear are built into jQuery
  1427. onShown: undefined,
  1428. hideMethod: 'fadeOut',
  1429. hideDuration: 1000,
  1430. hideEasing: 'swing',
  1431. onHidden: undefined,
  1432. closeMethod: false,
  1433. closeDuration: false,
  1434. closeEasing: false,
  1435. closeOnHover: true,
  1436. extendedTimeOut: 1000,
  1437. iconClasses: {
  1438. error: 'toast-error',
  1439. info: 'toast-info',
  1440. success: 'toast-success',
  1441. warning: 'toast-warning'
  1442. },
  1443. iconClass: 'toast-info',
  1444. positionClass: 'toast-top-right',
  1445. timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky
  1446. titleClass: 'toast-title',
  1447. messageClass: 'toast-message',
  1448. escapeHtml: false,
  1449. target: 'body',
  1450. closeHtml: '<button type="button">&times;</button>',
  1451. closeClass: 'toast-close-button',
  1452. newestOnTop: true,
  1453. preventDuplicates: false,
  1454. progressBar: false,
  1455. progressClass: 'toast-progress',
  1456. rtl: false
  1457. };
  1458. }
  1459. function publish(args) {
  1460. if (!listener) { return; }
  1461. listener(args);
  1462. }
  1463. function notify(map) {
  1464. var options = getOptions();
  1465. var iconClass = map.iconClass || options.iconClass;
  1466. if (typeof (map.optionsOverride) !== 'undefined') {
  1467. options = $.extend(options, map.optionsOverride);
  1468. iconClass = map.optionsOverride.iconClass || iconClass;
  1469. }
  1470. if (shouldExit(options, map)) { return; }
  1471. toastId++;
  1472. $container = getContainer(options, true);
  1473. var intervalId = null;
  1474. var $toastElement = $('<div/>');
  1475. var $titleElement = $('<div/>');
  1476. var $messageElement = $('<div/>');
  1477. var $progressElement = $('<div/>');
  1478. var $closeElement = $(options.closeHtml);
  1479. var progressBar = {
  1480. intervalId: null,
  1481. hideEta: null,
  1482. maxHideTime: null
  1483. };
  1484. var response = {
  1485. toastId: toastId,
  1486. state: 'visible',
  1487. startTime: new Date(),
  1488. options: options,
  1489. map: map
  1490. };
  1491. personalizeToast();
  1492. displayToast();
  1493. handleEvents();
  1494. publish(response);
  1495. if (options.debug && console) {
  1496. console.log(response);
  1497. }
  1498. return $toastElement;
  1499. function escapeHtml(source) {
  1500. if (source == null) {
  1501. source = '';
  1502. }
  1503. return source
  1504. .replace(/&/g, '&amp;')
  1505. .replace(/"/g, '&quot;')
  1506. .replace(/'/g, '&#39;')
  1507. .replace(/</g, '&lt;')
  1508. .replace(/>/g, '&gt;');
  1509. }
  1510. function personalizeToast() {
  1511. setIcon();
  1512. setTitle();
  1513. setMessage();
  1514. setCloseButton();
  1515. setProgressBar();
  1516. setRTL();
  1517. setSequence();
  1518. setAria();
  1519. }
  1520. function setAria() {
  1521. var ariaValue = '';
  1522. switch (map.iconClass) {
  1523. case 'toast-success':
  1524. case 'toast-info':
  1525. ariaValue = 'polite';
  1526. break;
  1527. default:
  1528. ariaValue = 'assertive';
  1529. }
  1530. $toastElement.attr('aria-live', ariaValue);
  1531. }
  1532. function handleEvents() {
  1533. if (options.closeOnHover) {
  1534. $toastElement.hover(stickAround, delayedHideToast);
  1535. }
  1536. if (!options.onclick && options.tapToDismiss) {
  1537. $toastElement.click(hideToast);
  1538. }
  1539. if (options.closeButton && $closeElement) {
  1540. $closeElement.click(function (event) {
  1541. if (event.stopPropagation) {
  1542. event.stopPropagation();
  1543. } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {
  1544. event.cancelBubble = true;
  1545. }
  1546. if (options.onCloseClick) {
  1547. options.onCloseClick(event);
  1548. }
  1549. hideToast(true);
  1550. });
  1551. }
  1552. if (options.onclick) {
  1553. $toastElement.click(function (event) {
  1554. options.onclick(event);
  1555. hideToast();
  1556. });
  1557. }
  1558. }
  1559. function displayToast() {
  1560. $toastElement.hide();
  1561. $toastElement[options.showMethod](
  1562. {duration: options.showDuration, easing: options.showEasing, complete: options.onShown}
  1563. );
  1564. if (options.timeOut > 0) {
  1565. intervalId = setTimeout(hideToast, options.timeOut);
  1566. progressBar.maxHideTime = parseFloat(options.timeOut);
  1567. progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
  1568. if (options.progressBar) {
  1569. progressBar.intervalId = setInterval(updateProgress, 10);
  1570. }
  1571. }
  1572. }
  1573. function setIcon() {
  1574. if (map.iconClass) {
  1575. $toastElement.addClass(options.toastClass).addClass(iconClass);
  1576. }
  1577. }
  1578. function setSequence() {
  1579. if (options.newestOnTop) {
  1580. $container.prepend($toastElement);
  1581. } else {
  1582. $container.append($toastElement);
  1583. }
  1584. }
  1585. function setTitle() {
  1586. if (map.title) {
  1587. var suffix = map.title;
  1588. if (options.escapeHtml) {
  1589. suffix = escapeHtml(map.title);
  1590. }
  1591. $titleElement.append(suffix).addClass(options.titleClass);
  1592. $toastElement.append($titleElement);
  1593. }
  1594. }
  1595. function setMessage() {
  1596. if (map.message) {
  1597. var suffix = map.message;
  1598. if (options.escapeHtml) {
  1599. suffix = escapeHtml(map.message);
  1600. }
  1601. $messageElement.append(suffix).addClass(options.messageClass);
  1602. $toastElement.append($messageElement);
  1603. }
  1604. }
  1605. function setCloseButton() {
  1606. if (options.closeButton) {
  1607. $closeElement.addClass(options.closeClass).attr('role', 'button');
  1608. $toastElement.prepend($closeElement);
  1609. }
  1610. }
  1611. function setProgressBar() {
  1612. if (options.progressBar) {
  1613. $progressElement.addClass(options.progressClass);
  1614. $toastElement.prepend($progressElement);
  1615. }
  1616. }
  1617. function setRTL() {
  1618. if (options.rtl) {
  1619. $toastElement.addClass('rtl');
  1620. }
  1621. }
  1622. function shouldExit(options, map) {
  1623. if (options.preventDuplicates) {
  1624. if (map.message === previousToast) {
  1625. return true;
  1626. } else {
  1627. previousToast = map.message;
  1628. }
  1629. }
  1630. return false;
  1631. }
  1632. function hideToast(override) {
  1633. var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod;
  1634. var duration = override && options.closeDuration !== false ?
  1635. options.closeDuration : options.hideDuration;
  1636. var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing;
  1637. if ($(':focus', $toastElement).length && !override) {
  1638. return;
  1639. }
  1640. clearTimeout(progressBar.intervalId);
  1641. return $toastElement[method]({
  1642. duration: duration,
  1643. easing: easing,
  1644. complete: function () {
  1645. removeToast($toastElement);
  1646. clearTimeout(intervalId);
  1647. if (options.onHidden && response.state !== 'hidden') {
  1648. options.onHidden();
  1649. }
  1650. response.state = 'hidden';
  1651. response.endTime = new Date();
  1652. publish(response);
  1653. }
  1654. });
  1655. }
  1656. function delayedHideToast() {
  1657. if (options.timeOut > 0 || options.extendedTimeOut > 0) {
  1658. intervalId = setTimeout(hideToast, options.extendedTimeOut);
  1659. progressBar.maxHideTime = parseFloat(options.extendedTimeOut);
  1660. progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
  1661. }
  1662. }
  1663. function stickAround() {
  1664. clearTimeout(intervalId);
  1665. progressBar.hideEta = 0;
  1666. $toastElement.stop(true, true)[options.showMethod](
  1667. {duration: options.showDuration, easing: options.showEasing}
  1668. );
  1669. }
  1670. function updateProgress() {
  1671. var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;
  1672. $progressElement.width(percentage + '%');
  1673. }
  1674. }
  1675. function getOptions() {
  1676. return $.extend({}, getDefaults(), toastr.options);
  1677. }
  1678. function removeToast($toastElement) {
  1679. if (!$container) { $container = getContainer(); }
  1680. if ($toastElement.is(':visible')) {
  1681. return;
  1682. }
  1683. $toastElement.remove();
  1684. $toastElement = null;
  1685. if ($container.children().length === 0) {
  1686. $container.remove();
  1687. previousToast = undefined;
  1688. }
  1689. }
  1690. })();
  1691. });
  1692. }(typeof define === 'function' && define.amd ? define : function (deps, factory) {
  1693. if (typeof module !== 'undefined' && module.exports) { //Node
  1694. module.exports = factory(require('jquery'));
  1695. } else {
  1696. window.toastr = factory(window.jQuery);
  1697. }
  1698. }));
  1699. define('backend',['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'config'], function ($, undefined, Toastr, Layer, Lang, Config) {
  1700. var Backend = {
  1701. config: {
  1702. //toastr默认配置
  1703. toastr: {
  1704. "closeButton": true,
  1705. "debug": false,
  1706. "newestOnTop": false,
  1707. "progressBar": false,
  1708. "positionClass": "toast-top-center",
  1709. "preventDuplicates": false,
  1710. "onclick": null,
  1711. "showDuration": "300",
  1712. "hideDuration": "1000",
  1713. "timeOut": "5000",
  1714. "extendedTimeOut": "1000",
  1715. "showEasing": "swing",
  1716. "hideEasing": "linear",
  1717. "showMethod": "fadeIn",
  1718. "hideMethod": "fadeOut"
  1719. }
  1720. },
  1721. api: {
  1722. ajax: function (options, success, failure) {
  1723. var index = Backend.api.layer.load();
  1724. options = $.extend({
  1725. type: "POST",
  1726. dataType: 'json',
  1727. success: function (data) {
  1728. Backend.api.layer.close(index);
  1729. if (data.hasOwnProperty("code")) {
  1730. var content = data.hasOwnProperty("content") && data.content != "" ? data.content : "";
  1731. if (data.code === 1) {
  1732. if (typeof success == 'function') {
  1733. var onAfterResult = success.call(undefined, content);
  1734. if (!onAfterResult) {
  1735. return false;
  1736. }
  1737. }
  1738. Toastr.success(content ? content : __('Operation completed'));
  1739. } else {
  1740. Toastr.error(content ? content : __('Operation failed'));
  1741. }
  1742. } else {
  1743. Toastr.error(__('Unknown data format'));
  1744. }
  1745. }, error: function () {
  1746. Backend.api.layer.close(index);
  1747. Toastr.error(__('Network error'));
  1748. }
  1749. }, options);
  1750. $.ajax(options);
  1751. },
  1752. //修复URL
  1753. fixurl: function (url) {
  1754. if (url.substr(0, 1) !== "/") {
  1755. var r = new RegExp('^(?:[a-z]+:)?//', 'i');
  1756. if (!r.test(url)) {
  1757. url = (Config.subdomain == "1" ? "" : "/" + Config.modulename) + "/" + url;
  1758. }
  1759. }
  1760. return url;
  1761. },
  1762. //查询Url参数
  1763. query: function (name, url) {
  1764. if (!url) {
  1765. url = window.location.href;
  1766. }
  1767. name = name.replace(/[\[\]]/g, "\\$&");
  1768. var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
  1769. results = regex.exec(url);
  1770. if (!results)
  1771. return null;
  1772. if (!results[2])
  1773. return '';
  1774. return decodeURIComponent(results[2].replace(/\+/g, " "));
  1775. },
  1776. //上传文件
  1777. upload: function (file, callback) {
  1778. var data = new FormData();
  1779. data.append("file", file);
  1780. $.ajax({
  1781. url: "ajax/upload",
  1782. data: data,
  1783. cache: false,
  1784. contentType: false,
  1785. processData: false,
  1786. type: 'POST',
  1787. dataType: 'json',
  1788. success: function (data) {
  1789. if (data.hasOwnProperty("code")) {
  1790. var content = data.hasOwnProperty("content") && data.content != "" ? data.content : "";
  1791. if (data.code === 1) {
  1792. $('.summernote').summernote("insertImage", data.content, 'filename');
  1793. Toastr.success(__('Operation completed'));
  1794. } else {
  1795. Toastr.error(content ? content : __('Operation failed'));
  1796. }
  1797. } else {
  1798. Toastr.error(__('Unknown data format'));
  1799. }
  1800. }, error: function () {
  1801. Toastr.error(__('Network error'));
  1802. }
  1803. });
  1804. },
  1805. open: function (url, title, options) {
  1806. title = title == undefined ? "" : title;
  1807. url = Backend.api.fixurl(url);
  1808. url = url + (url.indexOf("?") > -1 ? "&" : "?") + "dialog=1";
  1809. var area;
  1810. if ($(window).width() < 800) {
  1811. area = ["95%", "95%"];
  1812. } else {
  1813. area = ['800px', '600px'];
  1814. }
  1815. Backend.api.layer.open($.extend({
  1816. type: 2,
  1817. title: title,
  1818. shadeClose: true,
  1819. shade: false,
  1820. maxmin: true,
  1821. moveOut: true,
  1822. area: area,
  1823. content: url,
  1824. zIndex: Backend.api.layer.zIndex,
  1825. skin: 'layui-layer-noborder',
  1826. success: function (layero, index) {
  1827. //$(layero).removeClass("layui-layer-border");
  1828. Backend.api.layer.setTop(layero);
  1829. var frame = Backend.api.layer.getChildFrame('html', index);
  1830. var layerfooter = frame.find(".layer-footer");
  1831. Backend.api.layerfooter(layero, index);
  1832. //绑定事件
  1833. if (layerfooter.size() > 0) {
  1834. // 监听窗口内的元素及属性变化
  1835. // Firefox和Chrome早期版本中带有前缀
  1836. var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver
  1837. // 选择目标节点
  1838. var target = layerfooter[0];
  1839. // 创建观察者对象
  1840. var observer = new MutationObserver(function (mutations) {
  1841. Backend.api.layerfooter(layero, index);
  1842. mutations.forEach(function (mutation) {
  1843. });
  1844. });
  1845. // 配置观察选项:
  1846. var config = {attributes: true, childList: true, characterData: true, subtree: true}
  1847. // 传入目标节点和观察选项
  1848. observer.observe(target, config);
  1849. // 随后,你还可以停止观察
  1850. // observer.disconnect();
  1851. }
  1852. }
  1853. }, options ? options : {}));
  1854. return false;
  1855. },
  1856. layerfooter: function (layero, index) {
  1857. var frame = Backend.api.layer.getChildFrame('html', index);
  1858. var layerfooter = frame.find(".layer-footer");
  1859. if (layerfooter.size() > 0) {
  1860. $(".layui-layer-footer", layero).remove();
  1861. var footer = $("<div />").addClass('layui-layer-btn layui-layer-footer');
  1862. footer.html(layerfooter.html());
  1863. if ($(".row", footer).size() === 0) {
  1864. $(">", footer).wrapAll("<div class='row'></div>");
  1865. }
  1866. footer.insertAfter(layero.find('.layui-layer-content'));
  1867. }
  1868. var heg = frame.outerHeight();
  1869. var titHeight = layero.find('.layui-layer-title').outerHeight() || 0;
  1870. var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
  1871. var oldheg = heg + titHeight + btnHeight;
  1872. // 如果有.layer-footer或窗口小于600则重新排
  1873. if (layerfooter.size() > 0 || oldheg < 600) {
  1874. var footerHeight = layero.find('.layui-layer-footer').outerHeight() || 0;
  1875. footerHeight = 0;
  1876. if (oldheg >= 600) {
  1877. heg = Math.min(600, oldheg) - titHeight - btnHeight - footerHeight;
  1878. }
  1879. layero.css({height: heg + titHeight + btnHeight + footerHeight});
  1880. layero.find("iframe").css({height: heg});
  1881. }
  1882. if (layerfooter.size() > 0) {
  1883. footer.on("click", ".btn", function () {
  1884. if ($(this).hasClass("disabled") || $(this).parent().hasClass("disabled")) {
  1885. //return;
  1886. }
  1887. $(".btn:eq(" + $(this).index() + ")", layerfooter).trigger("click");
  1888. });
  1889. }
  1890. },
  1891. sidebar: function (params) {
  1892. colorArr = ['red', 'green', 'yellow', 'blue', 'teal', 'orange', 'purple'];
  1893. $colorNums = colorArr.length;
  1894. badgeList = {};
  1895. $.each(params, function (k, v) {
  1896. if (k.indexOf('/') > -1)
  1897. {
  1898. $url = Backend.api.fixurl(k);
  1899. } else
  1900. {
  1901. $url = k;
  1902. }
  1903. if ($.isArray(v))
  1904. {
  1905. $nums = typeof v[0] !== 'undefined' ? v[0] : 0;
  1906. $color = typeof v[1] !== 'undefined' ? v[1] : colorArr[(!isNaN($nums) ? $nums : $nums.length) % $colorNums];
  1907. $class = typeof v[2] !== 'undefined' ? v[2] : 'label';
  1908. } else
  1909. {
  1910. $nums = v;
  1911. $color = colorArr[(!isNaN($nums) ? $nums : $nums.length) % $colorNums];
  1912. $class = 'label';
  1913. }
  1914. //必须nums大于0才显示
  1915. badgeList[$url] = $nums > 0 ? '<small class="' + $class + ' pull-right bg-' + $color + '">' + $nums + '</small>' : '';
  1916. });
  1917. $.each(badgeList, function (k, v) {
  1918. var anchor = $(".treeview li a[addtabs][url='" + k + "']");
  1919. if (anchor) {
  1920. $(".pull-right-container", anchor).html(v);
  1921. $(".nav-addtabs li a[node-id='" + anchor.attr("addtabs") + "'] .pull-right-container").html(v);
  1922. }
  1923. });
  1924. },
  1925. success: function (options, callback) {
  1926. var type = typeof options === 'function';
  1927. if (type) {
  1928. callback = options;
  1929. }
  1930. return Backend.api.layer.msg(__('Operation completed'), $.extend({
  1931. offset: 0, icon: 1
  1932. }, type ? {} : options), callback);
  1933. },
  1934. error: function (options, callback) {
  1935. var type = typeof options === 'function';
  1936. if (type) {
  1937. callback = options;
  1938. }
  1939. return Backend.api.layer.msg(__('Operation failed'), $.extend({
  1940. offset: 0, icon: 2
  1941. }, type ? {} : options), callback);
  1942. },
  1943. toastr: Toastr,
  1944. layer: Layer
  1945. },
  1946. lang: function () {
  1947. var args = arguments,
  1948. string = args[0],
  1949. i = 1;
  1950. string = string.toLowerCase();
  1951. //string = typeof Lang[string] != 'undefined' ? Lang[string] : string;
  1952. if (typeof Lang[string] != 'undefined') {
  1953. if (typeof Lang[string] == 'object')
  1954. return Lang[string];
  1955. string = Lang[string];
  1956. } else if (string.indexOf('.') !== -1) {
  1957. var arr = string.split('.');
  1958. var current = Lang[arr[0]];
  1959. for (var i = 1; i < arr.length; i++) {
  1960. current = typeof current[arr[i]] != 'undefined' ? current[arr[i]] : '';
  1961. if (typeof current != 'object')
  1962. break;
  1963. }
  1964. if (typeof current == 'object')
  1965. return current;
  1966. string = current;
  1967. } else {
  1968. string = args[0];
  1969. }
  1970. return string.replace(/%((%)|s|d)/g, function (m) {
  1971. // m is the matched format, e.g. %s, %d
  1972. var val = null;
  1973. if (m[2]) {
  1974. val = m[2];
  1975. } else {
  1976. val = args[i];
  1977. // A switch statement so that the formatter can be extended. Default is %s
  1978. switch (m) {
  1979. case '%d':
  1980. val = parseFloat(val);
  1981. if (isNaN(val)) {
  1982. val = 0;
  1983. }
  1984. break;
  1985. }
  1986. i++;
  1987. }
  1988. return val;
  1989. });
  1990. }
  1991. };
  1992. //将Layer暴露到全局中去
  1993. window.Layer = Layer;
  1994. //将Toastr暴露到全局中去
  1995. window.Toastr = Toastr;
  1996. //将语言方法暴露到全局中去
  1997. window.__ = Backend.lang;
  1998. //将Backend渲染至全局,以便于在子框架中调用
  1999. window.Backend = Backend;
  2000. //Toastr定义
  2001. Toastr.options = Backend.config.toastr;
  2002. //点击包含.btn-dialog的元素时弹出dialog
  2003. $(document).on('click', '.btn-dialog', function (e) {
  2004. Backend.api.open(Backend.api.fixurl($(this).attr('href')), $(this).attr('title'));
  2005. e.preventDefault();
  2006. });
  2007. return Backend;
  2008. });
  2009. //! moment.js
  2010. //! version : 2.15.2
  2011. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  2012. //! license : MIT
  2013. //! momentjs.com
  2014. ;(function (global, factory) {
  2015. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  2016. typeof define === 'function' && define.amd ? define('moment/moment',factory) :
  2017. global.moment = factory()
  2018. }(this, function () { 'use strict';
  2019. var hookCallback;
  2020. function utils_hooks__hooks () {
  2021. return hookCallback.apply(null, arguments);
  2022. }
  2023. // This is done to register the method called with moment()
  2024. // without creating circular dependencies.
  2025. function setHookCallback (callback) {
  2026. hookCallback = callback;
  2027. }
  2028. function isArray(input) {
  2029. return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
  2030. }
  2031. function isObject(input) {
  2032. // IE8 will treat undefined and null as object if it wasn't for
  2033. // input != null
  2034. return input != null && Object.prototype.toString.call(input) === '[object Object]';
  2035. }
  2036. function isObjectEmpty(obj) {
  2037. var k;
  2038. for (k in obj) {
  2039. // even if its not own property I'd still call it non-empty
  2040. return false;
  2041. }
  2042. return true;
  2043. }
  2044. function isDate(input) {
  2045. return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
  2046. }
  2047. function map(arr, fn) {
  2048. var res = [], i;
  2049. for (i = 0; i < arr.length; ++i) {
  2050. res.push(fn(arr[i], i));
  2051. }
  2052. return res;
  2053. }
  2054. function hasOwnProp(a, b) {
  2055. return Object.prototype.hasOwnProperty.call(a, b);
  2056. }
  2057. function extend(a, b) {
  2058. for (var i in b) {
  2059. if (hasOwnProp(b, i)) {
  2060. a[i] = b[i];
  2061. }
  2062. }
  2063. if (hasOwnProp(b, 'toString')) {
  2064. a.toString = b.toString;
  2065. }
  2066. if (hasOwnProp(b, 'valueOf')) {
  2067. a.valueOf = b.valueOf;
  2068. }
  2069. return a;
  2070. }
  2071. function create_utc__createUTC (input, format, locale, strict) {
  2072. return createLocalOrUTC(input, format, locale, strict, true).utc();
  2073. }
  2074. function defaultParsingFlags() {
  2075. // We need to deep clone this object.
  2076. return {
  2077. empty : false,
  2078. unusedTokens : [],
  2079. unusedInput : [],
  2080. overflow : -2,
  2081. charsLeftOver : 0,
  2082. nullInput : false,
  2083. invalidMonth : null,
  2084. invalidFormat : false,
  2085. userInvalidated : false,
  2086. iso : false,
  2087. parsedDateParts : [],
  2088. meridiem : null
  2089. };
  2090. }
  2091. function getParsingFlags(m) {
  2092. if (m._pf == null) {
  2093. m._pf = defaultParsingFlags();
  2094. }
  2095. return m._pf;
  2096. }
  2097. var some;
  2098. if (Array.prototype.some) {
  2099. some = Array.prototype.some;
  2100. } else {
  2101. some = function (fun) {
  2102. var t = Object(this);
  2103. var len = t.length >>> 0;
  2104. for (var i = 0; i < len; i++) {
  2105. if (i in t && fun.call(this, t[i], i, t)) {
  2106. return true;
  2107. }
  2108. }
  2109. return false;
  2110. };
  2111. }
  2112. function valid__isValid(m) {
  2113. if (m._isValid == null) {
  2114. var flags = getParsingFlags(m);
  2115. var parsedParts = some.call(flags.parsedDateParts, function (i) {
  2116. return i != null;
  2117. });
  2118. var isNowValid = !isNaN(m._d.getTime()) &&
  2119. flags.overflow < 0 &&
  2120. !flags.empty &&
  2121. !flags.invalidMonth &&
  2122. !flags.invalidWeekday &&
  2123. !flags.nullInput &&
  2124. !flags.invalidFormat &&
  2125. !flags.userInvalidated &&
  2126. (!flags.meridiem || (flags.meridiem && parsedParts));
  2127. if (m._strict) {
  2128. isNowValid = isNowValid &&
  2129. flags.charsLeftOver === 0 &&
  2130. flags.unusedTokens.length === 0 &&
  2131. flags.bigHour === undefined;
  2132. }
  2133. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  2134. m._isValid = isNowValid;
  2135. }
  2136. else {
  2137. return isNowValid;
  2138. }
  2139. }
  2140. return m._isValid;
  2141. }
  2142. function valid__createInvalid (flags) {
  2143. var m = create_utc__createUTC(NaN);
  2144. if (flags != null) {
  2145. extend(getParsingFlags(m), flags);
  2146. }
  2147. else {
  2148. getParsingFlags(m).userInvalidated = true;
  2149. }
  2150. return m;
  2151. }
  2152. function isUndefined(input) {
  2153. return input === void 0;
  2154. }
  2155. // Plugins that add properties should also add the key here (null value),
  2156. // so we can properly clone ourselves.
  2157. var momentProperties = utils_hooks__hooks.momentProperties = [];
  2158. function copyConfig(to, from) {
  2159. var i, prop, val;
  2160. if (!isUndefined(from._isAMomentObject)) {
  2161. to._isAMomentObject = from._isAMomentObject;
  2162. }
  2163. if (!isUndefined(from._i)) {
  2164. to._i = from._i;
  2165. }
  2166. if (!isUndefined(from._f)) {
  2167. to._f = from._f;
  2168. }
  2169. if (!isUndefined(from._l)) {
  2170. to._l = from._l;
  2171. }
  2172. if (!isUndefined(from._strict)) {
  2173. to._strict = from._strict;
  2174. }
  2175. if (!isUndefined(from._tzm)) {
  2176. to._tzm = from._tzm;
  2177. }
  2178. if (!isUndefined(from._isUTC)) {
  2179. to._isUTC = from._isUTC;
  2180. }
  2181. if (!isUndefined(from._offset)) {
  2182. to._offset = from._offset;
  2183. }
  2184. if (!isUndefined(from._pf)) {
  2185. to._pf = getParsingFlags(from);
  2186. }
  2187. if (!isUndefined(from._locale)) {
  2188. to._locale = from._locale;
  2189. }
  2190. if (momentProperties.length > 0) {
  2191. for (i in momentProperties) {
  2192. prop = momentProperties[i];
  2193. val = from[prop];
  2194. if (!isUndefined(val)) {
  2195. to[prop] = val;
  2196. }
  2197. }
  2198. }
  2199. return to;
  2200. }
  2201. var updateInProgress = false;
  2202. // Moment prototype object
  2203. function Moment(config) {
  2204. copyConfig(this, config);
  2205. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  2206. // Prevent infinite loop in case updateOffset creates new moment
  2207. // objects.
  2208. if (updateInProgress === false) {
  2209. updateInProgress = true;
  2210. utils_hooks__hooks.updateOffset(this);
  2211. updateInProgress = false;
  2212. }
  2213. }
  2214. function isMoment (obj) {
  2215. return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
  2216. }
  2217. function absFloor (number) {
  2218. if (number < 0) {
  2219. // -0 -> 0
  2220. return Math.ceil(number) || 0;
  2221. } else {
  2222. return Math.floor(number);
  2223. }
  2224. }
  2225. function toInt(argumentForCoercion) {
  2226. var coercedNumber = +argumentForCoercion,
  2227. value = 0;
  2228. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  2229. value = absFloor(coercedNumber);
  2230. }
  2231. return value;
  2232. }
  2233. // compare two arrays, return the number of differences
  2234. function compareArrays(array1, array2, dontConvert) {
  2235. var len = Math.min(array1.length, array2.length),
  2236. lengthDiff = Math.abs(array1.length - array2.length),
  2237. diffs = 0,
  2238. i;
  2239. for (i = 0; i < len; i++) {
  2240. if ((dontConvert && array1[i] !== array2[i]) ||
  2241. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
  2242. diffs++;
  2243. }
  2244. }
  2245. return diffs + lengthDiff;
  2246. }
  2247. function warn(msg) {
  2248. if (utils_hooks__hooks.suppressDeprecationWarnings === false &&
  2249. (typeof console !== 'undefined') && console.warn) {
  2250. console.warn('Deprecation warning: ' + msg);
  2251. }
  2252. }
  2253. function deprecate(msg, fn) {
  2254. var firstTime = true;
  2255. return extend(function () {
  2256. if (utils_hooks__hooks.deprecationHandler != null) {
  2257. utils_hooks__hooks.deprecationHandler(null, msg);
  2258. }
  2259. if (firstTime) {
  2260. var args = [];
  2261. var arg;
  2262. for (var i = 0; i < arguments.length; i++) {
  2263. arg = '';
  2264. if (typeof arguments[i] === 'object') {
  2265. arg += '\n[' + i + '] ';
  2266. for (var key in arguments[0]) {
  2267. arg += key + ': ' + arguments[0][key] + ', ';
  2268. }
  2269. arg = arg.slice(0, -2); // Remove trailing comma and space
  2270. } else {
  2271. arg = arguments[i];
  2272. }
  2273. args.push(arg);
  2274. }
  2275. warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
  2276. firstTime = false;
  2277. }
  2278. return fn.apply(this, arguments);
  2279. }, fn);
  2280. }
  2281. var deprecations = {};
  2282. function deprecateSimple(name, msg) {
  2283. if (utils_hooks__hooks.deprecationHandler != null) {
  2284. utils_hooks__hooks.deprecationHandler(name, msg);
  2285. }
  2286. if (!deprecations[name]) {
  2287. warn(msg);
  2288. deprecations[name] = true;
  2289. }
  2290. }
  2291. utils_hooks__hooks.suppressDeprecationWarnings = false;
  2292. utils_hooks__hooks.deprecationHandler = null;
  2293. function isFunction(input) {
  2294. return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
  2295. }
  2296. function locale_set__set (config) {
  2297. var prop, i;
  2298. for (i in config) {
  2299. prop = config[i];
  2300. if (isFunction(prop)) {
  2301. this[i] = prop;
  2302. } else {
  2303. this['_' + i] = prop;
  2304. }
  2305. }
  2306. this._config = config;
  2307. // Lenient ordinal parsing accepts just a number in addition to
  2308. // number + (possibly) stuff coming from _ordinalParseLenient.
  2309. this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
  2310. }
  2311. function mergeConfigs(parentConfig, childConfig) {
  2312. var res = extend({}, parentConfig), prop;
  2313. for (prop in childConfig) {
  2314. if (hasOwnProp(childConfig, prop)) {
  2315. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  2316. res[prop] = {};
  2317. extend(res[prop], parentConfig[prop]);
  2318. extend(res[prop], childConfig[prop]);
  2319. } else if (childConfig[prop] != null) {
  2320. res[prop] = childConfig[prop];
  2321. } else {
  2322. delete res[prop];
  2323. }
  2324. }
  2325. }
  2326. for (prop in parentConfig) {
  2327. if (hasOwnProp(parentConfig, prop) &&
  2328. !hasOwnProp(childConfig, prop) &&
  2329. isObject(parentConfig[prop])) {
  2330. // make sure changes to properties don't modify parent config
  2331. res[prop] = extend({}, res[prop]);
  2332. }
  2333. }
  2334. return res;
  2335. }
  2336. function Locale(config) {
  2337. if (config != null) {
  2338. this.set(config);
  2339. }
  2340. }
  2341. var keys;
  2342. if (Object.keys) {
  2343. keys = Object.keys;
  2344. } else {
  2345. keys = function (obj) {
  2346. var i, res = [];
  2347. for (i in obj) {
  2348. if (hasOwnProp(obj, i)) {
  2349. res.push(i);
  2350. }
  2351. }
  2352. return res;
  2353. };
  2354. }
  2355. var defaultCalendar = {
  2356. sameDay : '[Today at] LT',
  2357. nextDay : '[Tomorrow at] LT',
  2358. nextWeek : 'dddd [at] LT',
  2359. lastDay : '[Yesterday at] LT',
  2360. lastWeek : '[Last] dddd [at] LT',
  2361. sameElse : 'L'
  2362. };
  2363. function locale_calendar__calendar (key, mom, now) {
  2364. var output = this._calendar[key] || this._calendar['sameElse'];
  2365. return isFunction(output) ? output.call(mom, now) : output;
  2366. }
  2367. var defaultLongDateFormat = {
  2368. LTS : 'h:mm:ss A',
  2369. LT : 'h:mm A',
  2370. L : 'MM/DD/YYYY',
  2371. LL : 'MMMM D, YYYY',
  2372. LLL : 'MMMM D, YYYY h:mm A',
  2373. LLLL : 'dddd, MMMM D, YYYY h:mm A'
  2374. };
  2375. function longDateFormat (key) {
  2376. var format = this._longDateFormat[key],
  2377. formatUpper = this._longDateFormat[key.toUpperCase()];
  2378. if (format || !formatUpper) {
  2379. return format;
  2380. }
  2381. this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
  2382. return val.slice(1);
  2383. });
  2384. return this._longDateFormat[key];
  2385. }
  2386. var defaultInvalidDate = 'Invalid date';
  2387. function invalidDate () {
  2388. return this._invalidDate;
  2389. }
  2390. var defaultOrdinal = '%d';
  2391. var defaultOrdinalParse = /\d{1,2}/;
  2392. function ordinal (number) {
  2393. return this._ordinal.replace('%d', number);
  2394. }
  2395. var defaultRelativeTime = {
  2396. future : 'in %s',
  2397. past : '%s ago',
  2398. s : 'a few seconds',
  2399. m : 'a minute',
  2400. mm : '%d minutes',
  2401. h : 'an hour',
  2402. hh : '%d hours',
  2403. d : 'a day',
  2404. dd : '%d days',
  2405. M : 'a month',
  2406. MM : '%d months',
  2407. y : 'a year',
  2408. yy : '%d years'
  2409. };
  2410. function relative__relativeTime (number, withoutSuffix, string, isFuture) {
  2411. var output = this._relativeTime[string];
  2412. return (isFunction(output)) ?
  2413. output(number, withoutSuffix, string, isFuture) :
  2414. output.replace(/%d/i, number);
  2415. }
  2416. function pastFuture (diff, output) {
  2417. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  2418. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  2419. }
  2420. var aliases = {};
  2421. function addUnitAlias (unit, shorthand) {
  2422. var lowerCase = unit.toLowerCase();
  2423. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  2424. }
  2425. function normalizeUnits(units) {
  2426. return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
  2427. }
  2428. function normalizeObjectUnits(inputObject) {
  2429. var normalizedInput = {},
  2430. normalizedProp,
  2431. prop;
  2432. for (prop in inputObject) {
  2433. if (hasOwnProp(inputObject, prop)) {
  2434. normalizedProp = normalizeUnits(prop);
  2435. if (normalizedProp) {
  2436. normalizedInput[normalizedProp] = inputObject[prop];
  2437. }
  2438. }
  2439. }
  2440. return normalizedInput;
  2441. }
  2442. var priorities = {};
  2443. function addUnitPriority(unit, priority) {
  2444. priorities[unit] = priority;
  2445. }
  2446. function getPrioritizedUnits(unitsObj) {
  2447. var units = [];
  2448. for (var u in unitsObj) {
  2449. units.push({unit: u, priority: priorities[u]});
  2450. }
  2451. units.sort(function (a, b) {
  2452. return a.priority - b.priority;
  2453. });
  2454. return units;
  2455. }
  2456. function makeGetSet (unit, keepTime) {
  2457. return function (value) {
  2458. if (value != null) {
  2459. get_set__set(this, unit, value);
  2460. utils_hooks__hooks.updateOffset(this, keepTime);
  2461. return this;
  2462. } else {
  2463. return get_set__get(this, unit);
  2464. }
  2465. };
  2466. }
  2467. function get_set__get (mom, unit) {
  2468. return mom.isValid() ?
  2469. mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
  2470. }
  2471. function get_set__set (mom, unit, value) {
  2472. if (mom.isValid()) {
  2473. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  2474. }
  2475. }
  2476. // MOMENTS
  2477. function stringGet (units) {
  2478. units = normalizeUnits(units);
  2479. if (isFunction(this[units])) {
  2480. return this[units]();
  2481. }
  2482. return this;
  2483. }
  2484. function stringSet (units, value) {
  2485. if (typeof units === 'object') {
  2486. units = normalizeObjectUnits(units);
  2487. var prioritized = getPrioritizedUnits(units);
  2488. for (var i = 0; i < prioritized.length; i++) {
  2489. this[prioritized[i].unit](units[prioritized[i].unit]);
  2490. }
  2491. } else {
  2492. units = normalizeUnits(units);
  2493. if (isFunction(this[units])) {
  2494. return this[units](value);
  2495. }
  2496. }
  2497. return this;
  2498. }
  2499. function zeroFill(number, targetLength, forceSign) {
  2500. var absNumber = '' + Math.abs(number),
  2501. zerosToFill = targetLength - absNumber.length,
  2502. sign = number >= 0;
  2503. return (sign ? (forceSign ? '+' : '') : '-') +
  2504. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
  2505. }
  2506. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
  2507. var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
  2508. var formatFunctions = {};
  2509. var formatTokenFunctions = {};
  2510. // token: 'M'
  2511. // padded: ['MM', 2]
  2512. // ordinal: 'Mo'
  2513. // callback: function () { this.month() + 1 }
  2514. function addFormatToken (token, padded, ordinal, callback) {
  2515. var func = callback;
  2516. if (typeof callback === 'string') {
  2517. func = function () {
  2518. return this[callback]();
  2519. };
  2520. }
  2521. if (token) {
  2522. formatTokenFunctions[token] = func;
  2523. }
  2524. if (padded) {
  2525. formatTokenFunctions[padded[0]] = function () {
  2526. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  2527. };
  2528. }
  2529. if (ordinal) {
  2530. formatTokenFunctions[ordinal] = function () {
  2531. return this.localeData().ordinal(func.apply(this, arguments), token);
  2532. };
  2533. }
  2534. }
  2535. function removeFormattingTokens(input) {
  2536. if (input.match(/\[[\s\S]/)) {
  2537. return input.replace(/^\[|\]$/g, '');
  2538. }
  2539. return input.replace(/\\/g, '');
  2540. }
  2541. function makeFormatFunction(format) {
  2542. var array = format.match(formattingTokens), i, length;
  2543. for (i = 0, length = array.length; i < length; i++) {
  2544. if (formatTokenFunctions[array[i]]) {
  2545. array[i] = formatTokenFunctions[array[i]];
  2546. } else {
  2547. array[i] = removeFormattingTokens(array[i]);
  2548. }
  2549. }
  2550. return function (mom) {
  2551. var output = '', i;
  2552. for (i = 0; i < length; i++) {
  2553. output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
  2554. }
  2555. return output;
  2556. };
  2557. }
  2558. // format date using native date object
  2559. function formatMoment(m, format) {
  2560. if (!m.isValid()) {
  2561. return m.localeData().invalidDate();
  2562. }
  2563. format = expandFormat(format, m.localeData());
  2564. formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
  2565. return formatFunctions[format](m);
  2566. }
  2567. function expandFormat(format, locale) {
  2568. var i = 5;
  2569. function replaceLongDateFormatTokens(input) {
  2570. return locale.longDateFormat(input) || input;
  2571. }
  2572. localFormattingTokens.lastIndex = 0;
  2573. while (i >= 0 && localFormattingTokens.test(format)) {
  2574. format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
  2575. localFormattingTokens.lastIndex = 0;
  2576. i -= 1;
  2577. }
  2578. return format;
  2579. }
  2580. var match1 = /\d/; // 0 - 9
  2581. var match2 = /\d\d/; // 00 - 99
  2582. var match3 = /\d{3}/; // 000 - 999
  2583. var match4 = /\d{4}/; // 0000 - 9999
  2584. var match6 = /[+-]?\d{6}/; // -999999 - 999999
  2585. var match1to2 = /\d\d?/; // 0 - 99
  2586. var match3to4 = /\d\d\d\d?/; // 999 - 9999
  2587. var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
  2588. var match1to3 = /\d{1,3}/; // 0 - 999
  2589. var match1to4 = /\d{1,4}/; // 0 - 9999
  2590. var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
  2591. var matchUnsigned = /\d+/; // 0 - inf
  2592. var matchSigned = /[+-]?\d+/; // -inf - inf
  2593. var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
  2594. var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  2595. var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
  2596. // any word (or two) characters or numbers including two/three word month in arabic.
  2597. // includes scottish gaelic two word and hyphenated months
  2598. var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
  2599. var regexes = {};
  2600. function addRegexToken (token, regex, strictRegex) {
  2601. regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
  2602. return (isStrict && strictRegex) ? strictRegex : regex;
  2603. };
  2604. }
  2605. function getParseRegexForToken (token, config) {
  2606. if (!hasOwnProp(regexes, token)) {
  2607. return new RegExp(unescapeFormat(token));
  2608. }
  2609. return regexes[token](config._strict, config._locale);
  2610. }
  2611. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  2612. function unescapeFormat(s) {
  2613. return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
  2614. return p1 || p2 || p3 || p4;
  2615. }));
  2616. }
  2617. function regexEscape(s) {
  2618. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  2619. }
  2620. var tokens = {};
  2621. function addParseToken (token, callback) {
  2622. var i, func = callback;
  2623. if (typeof token === 'string') {
  2624. token = [token];
  2625. }
  2626. if (typeof callback === 'number') {
  2627. func = function (input, array) {
  2628. array[callback] = toInt(input);
  2629. };
  2630. }
  2631. for (i = 0; i < token.length; i++) {
  2632. tokens[token[i]] = func;
  2633. }
  2634. }
  2635. function addWeekParseToken (token, callback) {
  2636. addParseToken(token, function (input, array, config, token) {
  2637. config._w = config._w || {};
  2638. callback(input, config._w, config, token);
  2639. });
  2640. }
  2641. function addTimeToArrayFromToken(token, input, config) {
  2642. if (input != null && hasOwnProp(tokens, token)) {
  2643. tokens[token](input, config._a, config, token);
  2644. }
  2645. }
  2646. var YEAR = 0;
  2647. var MONTH = 1;
  2648. var DATE = 2;
  2649. var HOUR = 3;
  2650. var MINUTE = 4;
  2651. var SECOND = 5;
  2652. var MILLISECOND = 6;
  2653. var WEEK = 7;
  2654. var WEEKDAY = 8;
  2655. var indexOf;
  2656. if (Array.prototype.indexOf) {
  2657. indexOf = Array.prototype.indexOf;
  2658. } else {
  2659. indexOf = function (o) {
  2660. // I know
  2661. var i;
  2662. for (i = 0; i < this.length; ++i) {
  2663. if (this[i] === o) {
  2664. return i;
  2665. }
  2666. }
  2667. return -1;
  2668. };
  2669. }
  2670. function daysInMonth(year, month) {
  2671. return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
  2672. }
  2673. // FORMATTING
  2674. addFormatToken('M', ['MM', 2], 'Mo', function () {
  2675. return this.month() + 1;
  2676. });
  2677. addFormatToken('MMM', 0, 0, function (format) {
  2678. return this.localeData().monthsShort(this, format);
  2679. });
  2680. addFormatToken('MMMM', 0, 0, function (format) {
  2681. return this.localeData().months(this, format);
  2682. });
  2683. // ALIASES
  2684. addUnitAlias('month', 'M');
  2685. // PRIORITY
  2686. addUnitPriority('month', 8);
  2687. // PARSING
  2688. addRegexToken('M', match1to2);
  2689. addRegexToken('MM', match1to2, match2);
  2690. addRegexToken('MMM', function (isStrict, locale) {
  2691. return locale.monthsShortRegex(isStrict);
  2692. });
  2693. addRegexToken('MMMM', function (isStrict, locale) {
  2694. return locale.monthsRegex(isStrict);
  2695. });
  2696. addParseToken(['M', 'MM'], function (input, array) {
  2697. array[MONTH] = toInt(input) - 1;
  2698. });
  2699. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  2700. var month = config._locale.monthsParse(input, token, config._strict);
  2701. // if we didn't find a month name, mark the date as invalid.
  2702. if (month != null) {
  2703. array[MONTH] = month;
  2704. } else {
  2705. getParsingFlags(config).invalidMonth = input;
  2706. }
  2707. });
  2708. // LOCALES
  2709. var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
  2710. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
  2711. function localeMonths (m, format) {
  2712. if (!m) {
  2713. return this._months;
  2714. }
  2715. return isArray(this._months) ? this._months[m.month()] :
  2716. this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
  2717. }
  2718. var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
  2719. function localeMonthsShort (m, format) {
  2720. if (!m) {
  2721. return this._monthsShort;
  2722. }
  2723. return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
  2724. this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
  2725. }
  2726. function units_month__handleStrictParse(monthName, format, strict) {
  2727. var i, ii, mom, llc = monthName.toLocaleLowerCase();
  2728. if (!this._monthsParse) {
  2729. // this is not used
  2730. this._monthsParse = [];
  2731. this._longMonthsParse = [];
  2732. this._shortMonthsParse = [];
  2733. for (i = 0; i < 12; ++i) {
  2734. mom = create_utc__createUTC([2000, i]);
  2735. this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
  2736. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  2737. }
  2738. }
  2739. if (strict) {
  2740. if (format === 'MMM') {
  2741. ii = indexOf.call(this._shortMonthsParse, llc);
  2742. return ii !== -1 ? ii : null;
  2743. } else {
  2744. ii = indexOf.call(this._longMonthsParse, llc);
  2745. return ii !== -1 ? ii : null;
  2746. }
  2747. } else {
  2748. if (format === 'MMM') {
  2749. ii = indexOf.call(this._shortMonthsParse, llc);
  2750. if (ii !== -1) {
  2751. return ii;
  2752. }
  2753. ii = indexOf.call(this._longMonthsParse, llc);
  2754. return ii !== -1 ? ii : null;
  2755. } else {
  2756. ii = indexOf.call(this._longMonthsParse, llc);
  2757. if (ii !== -1) {
  2758. return ii;
  2759. }
  2760. ii = indexOf.call(this._shortMonthsParse, llc);
  2761. return ii !== -1 ? ii : null;
  2762. }
  2763. }
  2764. }
  2765. function localeMonthsParse (monthName, format, strict) {
  2766. var i, mom, regex;
  2767. if (this._monthsParseExact) {
  2768. return units_month__handleStrictParse.call(this, monthName, format, strict);
  2769. }
  2770. if (!this._monthsParse) {
  2771. this._monthsParse = [];
  2772. this._longMonthsParse = [];
  2773. this._shortMonthsParse = [];
  2774. }
  2775. // TODO: add sorting
  2776. // Sorting makes sure if one month (or abbr) is a prefix of another
  2777. // see sorting in computeMonthsParse
  2778. for (i = 0; i < 12; i++) {
  2779. // make the regex if we don't have it already
  2780. mom = create_utc__createUTC([2000, i]);
  2781. if (strict && !this._longMonthsParse[i]) {
  2782. this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
  2783. this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
  2784. }
  2785. if (!strict && !this._monthsParse[i]) {
  2786. regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  2787. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  2788. }
  2789. // test the regex
  2790. if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
  2791. return i;
  2792. } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
  2793. return i;
  2794. } else if (!strict && this._monthsParse[i].test(monthName)) {
  2795. return i;
  2796. }
  2797. }
  2798. }
  2799. // MOMENTS
  2800. function setMonth (mom, value) {
  2801. var dayOfMonth;
  2802. if (!mom.isValid()) {
  2803. // No op
  2804. return mom;
  2805. }
  2806. if (typeof value === 'string') {
  2807. if (/^\d+$/.test(value)) {
  2808. value = toInt(value);
  2809. } else {
  2810. value = mom.localeData().monthsParse(value);
  2811. // TODO: Another silent failure?
  2812. if (typeof value !== 'number') {
  2813. return mom;
  2814. }
  2815. }
  2816. }
  2817. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  2818. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  2819. return mom;
  2820. }
  2821. function getSetMonth (value) {
  2822. if (value != null) {
  2823. setMonth(this, value);
  2824. utils_hooks__hooks.updateOffset(this, true);
  2825. return this;
  2826. } else {
  2827. return get_set__get(this, 'Month');
  2828. }
  2829. }
  2830. function getDaysInMonth () {
  2831. return daysInMonth(this.year(), this.month());
  2832. }
  2833. var defaultMonthsShortRegex = matchWord;
  2834. function monthsShortRegex (isStrict) {
  2835. if (this._monthsParseExact) {
  2836. if (!hasOwnProp(this, '_monthsRegex')) {
  2837. computeMonthsParse.call(this);
  2838. }
  2839. if (isStrict) {
  2840. return this._monthsShortStrictRegex;
  2841. } else {
  2842. return this._monthsShortRegex;
  2843. }
  2844. } else {
  2845. if (!hasOwnProp(this, '_monthsShortRegex')) {
  2846. this._monthsShortRegex = defaultMonthsShortRegex;
  2847. }
  2848. return this._monthsShortStrictRegex && isStrict ?
  2849. this._monthsShortStrictRegex : this._monthsShortRegex;
  2850. }
  2851. }
  2852. var defaultMonthsRegex = matchWord;
  2853. function monthsRegex (isStrict) {
  2854. if (this._monthsParseExact) {
  2855. if (!hasOwnProp(this, '_monthsRegex')) {
  2856. computeMonthsParse.call(this);
  2857. }
  2858. if (isStrict) {
  2859. return this._monthsStrictRegex;
  2860. } else {
  2861. return this._monthsRegex;
  2862. }
  2863. } else {
  2864. if (!hasOwnProp(this, '_monthsRegex')) {
  2865. this._monthsRegex = defaultMonthsRegex;
  2866. }
  2867. return this._monthsStrictRegex && isStrict ?
  2868. this._monthsStrictRegex : this._monthsRegex;
  2869. }
  2870. }
  2871. function computeMonthsParse () {
  2872. function cmpLenRev(a, b) {
  2873. return b.length - a.length;
  2874. }
  2875. var shortPieces = [], longPieces = [], mixedPieces = [],
  2876. i, mom;
  2877. for (i = 0; i < 12; i++) {
  2878. // make the regex if we don't have it already
  2879. mom = create_utc__createUTC([2000, i]);
  2880. shortPieces.push(this.monthsShort(mom, ''));
  2881. longPieces.push(this.months(mom, ''));
  2882. mixedPieces.push(this.months(mom, ''));
  2883. mixedPieces.push(this.monthsShort(mom, ''));
  2884. }
  2885. // Sorting makes sure if one month (or abbr) is a prefix of another it
  2886. // will match the longer piece.
  2887. shortPieces.sort(cmpLenRev);
  2888. longPieces.sort(cmpLenRev);
  2889. mixedPieces.sort(cmpLenRev);
  2890. for (i = 0; i < 12; i++) {
  2891. shortPieces[i] = regexEscape(shortPieces[i]);
  2892. longPieces[i] = regexEscape(longPieces[i]);
  2893. }
  2894. for (i = 0; i < 24; i++) {
  2895. mixedPieces[i] = regexEscape(mixedPieces[i]);
  2896. }
  2897. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  2898. this._monthsShortRegex = this._monthsRegex;
  2899. this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  2900. this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  2901. }
  2902. // FORMATTING
  2903. addFormatToken('Y', 0, 0, function () {
  2904. var y = this.year();
  2905. return y <= 9999 ? '' + y : '+' + y;
  2906. });
  2907. addFormatToken(0, ['YY', 2], 0, function () {
  2908. return this.year() % 100;
  2909. });
  2910. addFormatToken(0, ['YYYY', 4], 0, 'year');
  2911. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  2912. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  2913. // ALIASES
  2914. addUnitAlias('year', 'y');
  2915. // PRIORITIES
  2916. addUnitPriority('year', 1);
  2917. // PARSING
  2918. addRegexToken('Y', matchSigned);
  2919. addRegexToken('YY', match1to2, match2);
  2920. addRegexToken('YYYY', match1to4, match4);
  2921. addRegexToken('YYYYY', match1to6, match6);
  2922. addRegexToken('YYYYYY', match1to6, match6);
  2923. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  2924. addParseToken('YYYY', function (input, array) {
  2925. array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input);
  2926. });
  2927. addParseToken('YY', function (input, array) {
  2928. array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);
  2929. });
  2930. addParseToken('Y', function (input, array) {
  2931. array[YEAR] = parseInt(input, 10);
  2932. });
  2933. // HELPERS
  2934. function daysInYear(year) {
  2935. return isLeapYear(year) ? 366 : 365;
  2936. }
  2937. function isLeapYear(year) {
  2938. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  2939. }
  2940. // HOOKS
  2941. utils_hooks__hooks.parseTwoDigitYear = function (input) {
  2942. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  2943. };
  2944. // MOMENTS
  2945. var getSetYear = makeGetSet('FullYear', true);
  2946. function getIsLeapYear () {
  2947. return isLeapYear(this.year());
  2948. }
  2949. function createDate (y, m, d, h, M, s, ms) {
  2950. //can't just apply() to create a date:
  2951. //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
  2952. var date = new Date(y, m, d, h, M, s, ms);
  2953. //the date constructor remaps years 0-99 to 1900-1999
  2954. if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
  2955. date.setFullYear(y);
  2956. }
  2957. return date;
  2958. }
  2959. function createUTCDate (y) {
  2960. var date = new Date(Date.UTC.apply(null, arguments));
  2961. //the Date.UTC function remaps years 0-99 to 1900-1999
  2962. if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
  2963. date.setUTCFullYear(y);
  2964. }
  2965. return date;
  2966. }
  2967. // start-of-first-week - start-of-year
  2968. function firstWeekOffset(year, dow, doy) {
  2969. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  2970. fwd = 7 + dow - doy,
  2971. // first-week day local weekday -- which local weekday is fwd
  2972. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  2973. return -fwdlw + fwd - 1;
  2974. }
  2975. //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  2976. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  2977. var localWeekday = (7 + weekday - dow) % 7,
  2978. weekOffset = firstWeekOffset(year, dow, doy),
  2979. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  2980. resYear, resDayOfYear;
  2981. if (dayOfYear <= 0) {
  2982. resYear = year - 1;
  2983. resDayOfYear = daysInYear(resYear) + dayOfYear;
  2984. } else if (dayOfYear > daysInYear(year)) {
  2985. resYear = year + 1;
  2986. resDayOfYear = dayOfYear - daysInYear(year);
  2987. } else {
  2988. resYear = year;
  2989. resDayOfYear = dayOfYear;
  2990. }
  2991. return {
  2992. year: resYear,
  2993. dayOfYear: resDayOfYear
  2994. };
  2995. }
  2996. function weekOfYear(mom, dow, doy) {
  2997. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  2998. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  2999. resWeek, resYear;
  3000. if (week < 1) {
  3001. resYear = mom.year() - 1;
  3002. resWeek = week + weeksInYear(resYear, dow, doy);
  3003. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  3004. resWeek = week - weeksInYear(mom.year(), dow, doy);
  3005. resYear = mom.year() + 1;
  3006. } else {
  3007. resYear = mom.year();
  3008. resWeek = week;
  3009. }
  3010. return {
  3011. week: resWeek,
  3012. year: resYear
  3013. };
  3014. }
  3015. function weeksInYear(year, dow, doy) {
  3016. var weekOffset = firstWeekOffset(year, dow, doy),
  3017. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  3018. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  3019. }
  3020. // FORMATTING
  3021. addFormatToken('w', ['ww', 2], 'wo', 'week');
  3022. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  3023. // ALIASES
  3024. addUnitAlias('week', 'w');
  3025. addUnitAlias('isoWeek', 'W');
  3026. // PRIORITIES
  3027. addUnitPriority('week', 5);
  3028. addUnitPriority('isoWeek', 5);
  3029. // PARSING
  3030. addRegexToken('w', match1to2);
  3031. addRegexToken('ww', match1to2, match2);
  3032. addRegexToken('W', match1to2);
  3033. addRegexToken('WW', match1to2, match2);
  3034. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
  3035. week[token.substr(0, 1)] = toInt(input);
  3036. });
  3037. // HELPERS
  3038. // LOCALES
  3039. function localeWeek (mom) {
  3040. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  3041. }
  3042. var defaultLocaleWeek = {
  3043. dow : 0, // Sunday is the first day of the week.
  3044. doy : 6 // The week that contains Jan 1st is the first week of the year.
  3045. };
  3046. function localeFirstDayOfWeek () {
  3047. return this._week.dow;
  3048. }
  3049. function localeFirstDayOfYear () {
  3050. return this._week.doy;
  3051. }
  3052. // MOMENTS
  3053. function getSetWeek (input) {
  3054. var week = this.localeData().week(this);
  3055. return input == null ? week : this.add((input - week) * 7, 'd');
  3056. }
  3057. function getSetISOWeek (input) {
  3058. var week = weekOfYear(this, 1, 4).week;
  3059. return input == null ? week : this.add((input - week) * 7, 'd');
  3060. }
  3061. // FORMATTING
  3062. addFormatToken('d', 0, 'do', 'day');
  3063. addFormatToken('dd', 0, 0, function (format) {
  3064. return this.localeData().weekdaysMin(this, format);
  3065. });
  3066. addFormatToken('ddd', 0, 0, function (format) {
  3067. return this.localeData().weekdaysShort(this, format);
  3068. });
  3069. addFormatToken('dddd', 0, 0, function (format) {
  3070. return this.localeData().weekdays(this, format);
  3071. });
  3072. addFormatToken('e', 0, 0, 'weekday');
  3073. addFormatToken('E', 0, 0, 'isoWeekday');
  3074. // ALIASES
  3075. addUnitAlias('day', 'd');
  3076. addUnitAlias('weekday', 'e');
  3077. addUnitAlias('isoWeekday', 'E');
  3078. // PRIORITY
  3079. addUnitPriority('day', 11);
  3080. addUnitPriority('weekday', 11);
  3081. addUnitPriority('isoWeekday', 11);
  3082. // PARSING
  3083. addRegexToken('d', match1to2);
  3084. addRegexToken('e', match1to2);
  3085. addRegexToken('E', match1to2);
  3086. addRegexToken('dd', function (isStrict, locale) {
  3087. return locale.weekdaysMinRegex(isStrict);
  3088. });
  3089. addRegexToken('ddd', function (isStrict, locale) {
  3090. return locale.weekdaysShortRegex(isStrict);
  3091. });
  3092. addRegexToken('dddd', function (isStrict, locale) {
  3093. return locale.weekdaysRegex(isStrict);
  3094. });
  3095. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  3096. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  3097. // if we didn't get a weekday name, mark the date as invalid
  3098. if (weekday != null) {
  3099. week.d = weekday;
  3100. } else {
  3101. getParsingFlags(config).invalidWeekday = input;
  3102. }
  3103. });
  3104. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  3105. week[token] = toInt(input);
  3106. });
  3107. // HELPERS
  3108. function parseWeekday(input, locale) {
  3109. if (typeof input !== 'string') {
  3110. return input;
  3111. }
  3112. if (!isNaN(input)) {
  3113. return parseInt(input, 10);
  3114. }
  3115. input = locale.weekdaysParse(input);
  3116. if (typeof input === 'number') {
  3117. return input;
  3118. }
  3119. return null;
  3120. }
  3121. function parseIsoWeekday(input, locale) {
  3122. if (typeof input === 'string') {
  3123. return locale.weekdaysParse(input) % 7 || 7;
  3124. }
  3125. return isNaN(input) ? null : input;
  3126. }
  3127. // LOCALES
  3128. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
  3129. function localeWeekdays (m, format) {
  3130. if (!m) {
  3131. return this._weekdays;
  3132. }
  3133. return isArray(this._weekdays) ? this._weekdays[m.day()] :
  3134. this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
  3135. }
  3136. var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
  3137. function localeWeekdaysShort (m) {
  3138. return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
  3139. }
  3140. var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
  3141. function localeWeekdaysMin (m) {
  3142. return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
  3143. }
  3144. function day_of_week__handleStrictParse(weekdayName, format, strict) {
  3145. var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
  3146. if (!this._weekdaysParse) {
  3147. this._weekdaysParse = [];
  3148. this._shortWeekdaysParse = [];
  3149. this._minWeekdaysParse = [];
  3150. for (i = 0; i < 7; ++i) {
  3151. mom = create_utc__createUTC([2000, 1]).day(i);
  3152. this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
  3153. this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
  3154. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  3155. }
  3156. }
  3157. if (strict) {
  3158. if (format === 'dddd') {
  3159. ii = indexOf.call(this._weekdaysParse, llc);
  3160. return ii !== -1 ? ii : null;
  3161. } else if (format === 'ddd') {
  3162. ii = indexOf.call(this._shortWeekdaysParse, llc);
  3163. return ii !== -1 ? ii : null;
  3164. } else {
  3165. ii = indexOf.call(this._minWeekdaysParse, llc);
  3166. return ii !== -1 ? ii : null;
  3167. }
  3168. } else {
  3169. if (format === 'dddd') {
  3170. ii = indexOf.call(this._weekdaysParse, llc);
  3171. if (ii !== -1) {
  3172. return ii;
  3173. }
  3174. ii = indexOf.call(this._shortWeekdaysParse, llc);
  3175. if (ii !== -1) {
  3176. return ii;
  3177. }
  3178. ii = indexOf.call(this._minWeekdaysParse, llc);
  3179. return ii !== -1 ? ii : null;
  3180. } else if (format === 'ddd') {
  3181. ii = indexOf.call(this._shortWeekdaysParse, llc);
  3182. if (ii !== -1) {
  3183. return ii;
  3184. }
  3185. ii = indexOf.call(this._weekdaysParse, llc);
  3186. if (ii !== -1) {
  3187. return ii;
  3188. }
  3189. ii = indexOf.call(this._minWeekdaysParse, llc);
  3190. return ii !== -1 ? ii : null;
  3191. } else {
  3192. ii = indexOf.call(this._minWeekdaysParse, llc);
  3193. if (ii !== -1) {
  3194. return ii;
  3195. }
  3196. ii = indexOf.call(this._weekdaysParse, llc);
  3197. if (ii !== -1) {
  3198. return ii;
  3199. }
  3200. ii = indexOf.call(this._shortWeekdaysParse, llc);
  3201. return ii !== -1 ? ii : null;
  3202. }
  3203. }
  3204. }
  3205. function localeWeekdaysParse (weekdayName, format, strict) {
  3206. var i, mom, regex;
  3207. if (this._weekdaysParseExact) {
  3208. return day_of_week__handleStrictParse.call(this, weekdayName, format, strict);
  3209. }
  3210. if (!this._weekdaysParse) {
  3211. this._weekdaysParse = [];
  3212. this._minWeekdaysParse = [];
  3213. this._shortWeekdaysParse = [];
  3214. this._fullWeekdaysParse = [];
  3215. }
  3216. for (i = 0; i < 7; i++) {
  3217. // make the regex if we don't have it already
  3218. mom = create_utc__createUTC([2000, 1]).day(i);
  3219. if (strict && !this._fullWeekdaysParse[i]) {
  3220. this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
  3221. this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
  3222. this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
  3223. }
  3224. if (!this._weekdaysParse[i]) {
  3225. regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
  3226. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  3227. }
  3228. // test the regex
  3229. if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
  3230. return i;
  3231. } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
  3232. return i;
  3233. } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
  3234. return i;
  3235. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  3236. return i;
  3237. }
  3238. }
  3239. }
  3240. // MOMENTS
  3241. function getSetDayOfWeek (input) {
  3242. if (!this.isValid()) {
  3243. return input != null ? this : NaN;
  3244. }
  3245. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  3246. if (input != null) {
  3247. input = parseWeekday(input, this.localeData());
  3248. return this.add(input - day, 'd');
  3249. } else {
  3250. return day;
  3251. }
  3252. }
  3253. function getSetLocaleDayOfWeek (input) {
  3254. if (!this.isValid()) {
  3255. return input != null ? this : NaN;
  3256. }
  3257. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  3258. return input == null ? weekday : this.add(input - weekday, 'd');
  3259. }
  3260. function getSetISODayOfWeek (input) {
  3261. if (!this.isValid()) {
  3262. return input != null ? this : NaN;
  3263. }
  3264. // behaves the same as moment#day except
  3265. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  3266. // as a setter, sunday should belong to the previous week.
  3267. if (input != null) {
  3268. var weekday = parseIsoWeekday(input, this.localeData());
  3269. return this.day(this.day() % 7 ? weekday : weekday - 7);
  3270. } else {
  3271. return this.day() || 7;
  3272. }
  3273. }
  3274. var defaultWeekdaysRegex = matchWord;
  3275. function weekdaysRegex (isStrict) {
  3276. if (this._weekdaysParseExact) {
  3277. if (!hasOwnProp(this, '_weekdaysRegex')) {
  3278. computeWeekdaysParse.call(this);
  3279. }
  3280. if (isStrict) {
  3281. return this._weekdaysStrictRegex;
  3282. } else {
  3283. return this._weekdaysRegex;
  3284. }
  3285. } else {
  3286. if (!hasOwnProp(this, '_weekdaysRegex')) {
  3287. this._weekdaysRegex = defaultWeekdaysRegex;
  3288. }
  3289. return this._weekdaysStrictRegex && isStrict ?
  3290. this._weekdaysStrictRegex : this._weekdaysRegex;
  3291. }
  3292. }
  3293. var defaultWeekdaysShortRegex = matchWord;
  3294. function weekdaysShortRegex (isStrict) {
  3295. if (this._weekdaysParseExact) {
  3296. if (!hasOwnProp(this, '_weekdaysRegex')) {
  3297. computeWeekdaysParse.call(this);
  3298. }
  3299. if (isStrict) {
  3300. return this._weekdaysShortStrictRegex;
  3301. } else {
  3302. return this._weekdaysShortRegex;
  3303. }
  3304. } else {
  3305. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  3306. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  3307. }
  3308. return this._weekdaysShortStrictRegex && isStrict ?
  3309. this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
  3310. }
  3311. }
  3312. var defaultWeekdaysMinRegex = matchWord;
  3313. function weekdaysMinRegex (isStrict) {
  3314. if (this._weekdaysParseExact) {
  3315. if (!hasOwnProp(this, '_weekdaysRegex')) {
  3316. computeWeekdaysParse.call(this);
  3317. }
  3318. if (isStrict) {
  3319. return this._weekdaysMinStrictRegex;
  3320. } else {
  3321. return this._weekdaysMinRegex;
  3322. }
  3323. } else {
  3324. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  3325. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  3326. }
  3327. return this._weekdaysMinStrictRegex && isStrict ?
  3328. this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
  3329. }
  3330. }
  3331. function computeWeekdaysParse () {
  3332. function cmpLenRev(a, b) {
  3333. return b.length - a.length;
  3334. }
  3335. var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
  3336. i, mom, minp, shortp, longp;
  3337. for (i = 0; i < 7; i++) {
  3338. // make the regex if we don't have it already
  3339. mom = create_utc__createUTC([2000, 1]).day(i);
  3340. minp = this.weekdaysMin(mom, '');
  3341. shortp = this.weekdaysShort(mom, '');
  3342. longp = this.weekdays(mom, '');
  3343. minPieces.push(minp);
  3344. shortPieces.push(shortp);
  3345. longPieces.push(longp);
  3346. mixedPieces.push(minp);
  3347. mixedPieces.push(shortp);
  3348. mixedPieces.push(longp);
  3349. }
  3350. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  3351. // will match the longer piece.
  3352. minPieces.sort(cmpLenRev);
  3353. shortPieces.sort(cmpLenRev);
  3354. longPieces.sort(cmpLenRev);
  3355. mixedPieces.sort(cmpLenRev);
  3356. for (i = 0; i < 7; i++) {
  3357. shortPieces[i] = regexEscape(shortPieces[i]);
  3358. longPieces[i] = regexEscape(longPieces[i]);
  3359. mixedPieces[i] = regexEscape(mixedPieces[i]);
  3360. }
  3361. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  3362. this._weekdaysShortRegex = this._weekdaysRegex;
  3363. this._weekdaysMinRegex = this._weekdaysRegex;
  3364. this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  3365. this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  3366. this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
  3367. }
  3368. // FORMATTING
  3369. function hFormat() {
  3370. return this.hours() % 12 || 12;
  3371. }
  3372. function kFormat() {
  3373. return this.hours() || 24;
  3374. }
  3375. addFormatToken('H', ['HH', 2], 0, 'hour');
  3376. addFormatToken('h', ['hh', 2], 0, hFormat);
  3377. addFormatToken('k', ['kk', 2], 0, kFormat);
  3378. addFormatToken('hmm', 0, 0, function () {
  3379. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  3380. });
  3381. addFormatToken('hmmss', 0, 0, function () {
  3382. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
  3383. zeroFill(this.seconds(), 2);
  3384. });
  3385. addFormatToken('Hmm', 0, 0, function () {
  3386. return '' + this.hours() + zeroFill(this.minutes(), 2);
  3387. });
  3388. addFormatToken('Hmmss', 0, 0, function () {
  3389. return '' + this.hours() + zeroFill(this.minutes(), 2) +
  3390. zeroFill(this.seconds(), 2);
  3391. });
  3392. function meridiem (token, lowercase) {
  3393. addFormatToken(token, 0, 0, function () {
  3394. return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
  3395. });
  3396. }
  3397. meridiem('a', true);
  3398. meridiem('A', false);
  3399. // ALIASES
  3400. addUnitAlias('hour', 'h');
  3401. // PRIORITY
  3402. addUnitPriority('hour', 13);
  3403. // PARSING
  3404. function matchMeridiem (isStrict, locale) {
  3405. return locale._meridiemParse;
  3406. }
  3407. addRegexToken('a', matchMeridiem);
  3408. addRegexToken('A', matchMeridiem);
  3409. addRegexToken('H', match1to2);
  3410. addRegexToken('h', match1to2);
  3411. addRegexToken('HH', match1to2, match2);
  3412. addRegexToken('hh', match1to2, match2);
  3413. addRegexToken('hmm', match3to4);
  3414. addRegexToken('hmmss', match5to6);
  3415. addRegexToken('Hmm', match3to4);
  3416. addRegexToken('Hmmss', match5to6);
  3417. addParseToken(['H', 'HH'], HOUR);
  3418. addParseToken(['a', 'A'], function (input, array, config) {
  3419. config._isPm = config._locale.isPM(input);
  3420. config._meridiem = input;
  3421. });
  3422. addParseToken(['h', 'hh'], function (input, array, config) {
  3423. array[HOUR] = toInt(input);
  3424. getParsingFlags(config).bigHour = true;
  3425. });
  3426. addParseToken('hmm', function (input, array, config) {
  3427. var pos = input.length - 2;
  3428. array[HOUR] = toInt(input.substr(0, pos));
  3429. array[MINUTE] = toInt(input.substr(pos));
  3430. getParsingFlags(config).bigHour = true;
  3431. });
  3432. addParseToken('hmmss', function (input, array, config) {
  3433. var pos1 = input.length - 4;
  3434. var pos2 = input.length - 2;
  3435. array[HOUR] = toInt(input.substr(0, pos1));
  3436. array[MINUTE] = toInt(input.substr(pos1, 2));
  3437. array[SECOND] = toInt(input.substr(pos2));
  3438. getParsingFlags(config).bigHour = true;
  3439. });
  3440. addParseToken('Hmm', function (input, array, config) {
  3441. var pos = input.length - 2;
  3442. array[HOUR] = toInt(input.substr(0, pos));
  3443. array[MINUTE] = toInt(input.substr(pos));
  3444. });
  3445. addParseToken('Hmmss', function (input, array, config) {
  3446. var pos1 = input.length - 4;
  3447. var pos2 = input.length - 2;
  3448. array[HOUR] = toInt(input.substr(0, pos1));
  3449. array[MINUTE] = toInt(input.substr(pos1, 2));
  3450. array[SECOND] = toInt(input.substr(pos2));
  3451. });
  3452. // LOCALES
  3453. function localeIsPM (input) {
  3454. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  3455. // Using charAt should be more compatible.
  3456. return ((input + '').toLowerCase().charAt(0) === 'p');
  3457. }
  3458. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
  3459. function localeMeridiem (hours, minutes, isLower) {
  3460. if (hours > 11) {
  3461. return isLower ? 'pm' : 'PM';
  3462. } else {
  3463. return isLower ? 'am' : 'AM';
  3464. }
  3465. }
  3466. // MOMENTS
  3467. // Setting the hour should keep the time, because the user explicitly
  3468. // specified which hour he wants. So trying to maintain the same hour (in
  3469. // a new timezone) makes sense. Adding/subtracting hours does not follow
  3470. // this rule.
  3471. var getSetHour = makeGetSet('Hours', true);
  3472. var baseConfig = {
  3473. calendar: defaultCalendar,
  3474. longDateFormat: defaultLongDateFormat,
  3475. invalidDate: defaultInvalidDate,
  3476. ordinal: defaultOrdinal,
  3477. ordinalParse: defaultOrdinalParse,
  3478. relativeTime: defaultRelativeTime,
  3479. months: defaultLocaleMonths,
  3480. monthsShort: defaultLocaleMonthsShort,
  3481. week: defaultLocaleWeek,
  3482. weekdays: defaultLocaleWeekdays,
  3483. weekdaysMin: defaultLocaleWeekdaysMin,
  3484. weekdaysShort: defaultLocaleWeekdaysShort,
  3485. meridiemParse: defaultLocaleMeridiemParse
  3486. };
  3487. // internal storage for locale config files
  3488. var locales = {};
  3489. var globalLocale;
  3490. function normalizeLocale(key) {
  3491. return key ? key.toLowerCase().replace('_', '-') : key;
  3492. }
  3493. // pick the locale from the array
  3494. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  3495. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  3496. function chooseLocale(names) {
  3497. var i = 0, j, next, locale, split;
  3498. while (i < names.length) {
  3499. split = normalizeLocale(names[i]).split('-');
  3500. j = split.length;
  3501. next = normalizeLocale(names[i + 1]);
  3502. next = next ? next.split('-') : null;
  3503. while (j > 0) {
  3504. locale = loadLocale(split.slice(0, j).join('-'));
  3505. if (locale) {
  3506. return locale;
  3507. }
  3508. if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
  3509. //the next array item is better than a shallower substring of this one
  3510. break;
  3511. }
  3512. j--;
  3513. }
  3514. i++;
  3515. }
  3516. return null;
  3517. }
  3518. function loadLocale(name) {
  3519. var oldLocale = null;
  3520. // TODO: Find a better way to register and load all the locales in Node
  3521. if (!locales[name] && (typeof module !== 'undefined') &&
  3522. module && module.exports) {
  3523. try {
  3524. oldLocale = globalLocale._abbr;
  3525. require('./locale/' + name);
  3526. // because defineLocale currently also sets the global locale, we
  3527. // want to undo that for lazy loaded locales
  3528. locale_locales__getSetGlobalLocale(oldLocale);
  3529. } catch (e) { }
  3530. }
  3531. return locales[name];
  3532. }
  3533. // This function will load locale and then set the global locale. If
  3534. // no arguments are passed in, it will simply return the current global
  3535. // locale key.
  3536. function locale_locales__getSetGlobalLocale (key, values) {
  3537. var data;
  3538. if (key) {
  3539. if (isUndefined(values)) {
  3540. data = locale_locales__getLocale(key);
  3541. }
  3542. else {
  3543. data = defineLocale(key, values);
  3544. }
  3545. if (data) {
  3546. // moment.duration._locale = moment._locale = data;
  3547. globalLocale = data;
  3548. }
  3549. }
  3550. return globalLocale._abbr;
  3551. }
  3552. function defineLocale (name, config) {
  3553. if (config !== null) {
  3554. var parentConfig = baseConfig;
  3555. config.abbr = name;
  3556. if (locales[name] != null) {
  3557. deprecateSimple('defineLocaleOverride',
  3558. 'use moment.updateLocale(localeName, config) to change ' +
  3559. 'an existing locale. moment.defineLocale(localeName, ' +
  3560. 'config) should only be used for creating a new locale ' +
  3561. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
  3562. parentConfig = locales[name]._config;
  3563. } else if (config.parentLocale != null) {
  3564. if (locales[config.parentLocale] != null) {
  3565. parentConfig = locales[config.parentLocale]._config;
  3566. } else {
  3567. // treat as if there is no base config
  3568. deprecateSimple('parentLocaleUndefined',
  3569. 'specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/');
  3570. }
  3571. }
  3572. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  3573. // backwards compat for now: also set the locale
  3574. locale_locales__getSetGlobalLocale(name);
  3575. return locales[name];
  3576. } else {
  3577. // useful for testing
  3578. delete locales[name];
  3579. return null;
  3580. }
  3581. }
  3582. function updateLocale(name, config) {
  3583. if (config != null) {
  3584. var locale, parentConfig = baseConfig;
  3585. // MERGE
  3586. if (locales[name] != null) {
  3587. parentConfig = locales[name]._config;
  3588. }
  3589. config = mergeConfigs(parentConfig, config);
  3590. locale = new Locale(config);
  3591. locale.parentLocale = locales[name];
  3592. locales[name] = locale;
  3593. // backwards compat for now: also set the locale
  3594. locale_locales__getSetGlobalLocale(name);
  3595. } else {
  3596. // pass null for config to unupdate, useful for tests
  3597. if (locales[name] != null) {
  3598. if (locales[name].parentLocale != null) {
  3599. locales[name] = locales[name].parentLocale;
  3600. } else if (locales[name] != null) {
  3601. delete locales[name];
  3602. }
  3603. }
  3604. }
  3605. return locales[name];
  3606. }
  3607. // returns locale data
  3608. function locale_locales__getLocale (key) {
  3609. var locale;
  3610. if (key && key._locale && key._locale._abbr) {
  3611. key = key._locale._abbr;
  3612. }
  3613. if (!key) {
  3614. return globalLocale;
  3615. }
  3616. if (!isArray(key)) {
  3617. //short-circuit everything else
  3618. locale = loadLocale(key);
  3619. if (locale) {
  3620. return locale;
  3621. }
  3622. key = [key];
  3623. }
  3624. return chooseLocale(key);
  3625. }
  3626. function locale_locales__listLocales() {
  3627. return keys(locales);
  3628. }
  3629. function checkOverflow (m) {
  3630. var overflow;
  3631. var a = m._a;
  3632. if (a && getParsingFlags(m).overflow === -2) {
  3633. overflow =
  3634. a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
  3635. a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
  3636. a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
  3637. a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
  3638. a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
  3639. a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
  3640. -1;
  3641. if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
  3642. overflow = DATE;
  3643. }
  3644. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  3645. overflow = WEEK;
  3646. }
  3647. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  3648. overflow = WEEKDAY;
  3649. }
  3650. getParsingFlags(m).overflow = overflow;
  3651. }
  3652. return m;
  3653. }
  3654. // iso 8601 regex
  3655. // 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)
  3656. 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)?)?/;
  3657. var 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)?)?/;
  3658. var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
  3659. var isoDates = [
  3660. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  3661. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  3662. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  3663. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  3664. ['YYYY-DDD', /\d{4}-\d{3}/],
  3665. ['YYYY-MM', /\d{4}-\d\d/, false],
  3666. ['YYYYYYMMDD', /[+-]\d{10}/],
  3667. ['YYYYMMDD', /\d{8}/],
  3668. // YYYYMM is NOT allowed by the standard
  3669. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  3670. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  3671. ['YYYYDDD', /\d{7}/]
  3672. ];
  3673. // iso time formats and regexes
  3674. var isoTimes = [
  3675. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  3676. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  3677. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  3678. ['HH:mm', /\d\d:\d\d/],
  3679. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  3680. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  3681. ['HHmmss', /\d\d\d\d\d\d/],
  3682. ['HHmm', /\d\d\d\d/],
  3683. ['HH', /\d\d/]
  3684. ];
  3685. var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
  3686. // date from iso format
  3687. function configFromISO(config) {
  3688. var i, l,
  3689. string = config._i,
  3690. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  3691. allowTime, dateFormat, timeFormat, tzFormat;
  3692. if (match) {
  3693. getParsingFlags(config).iso = true;
  3694. for (i = 0, l = isoDates.length; i < l; i++) {
  3695. if (isoDates[i][1].exec(match[1])) {
  3696. dateFormat = isoDates[i][0];
  3697. allowTime = isoDates[i][2] !== false;
  3698. break;
  3699. }
  3700. }
  3701. if (dateFormat == null) {
  3702. config._isValid = false;
  3703. return;
  3704. }
  3705. if (match[3]) {
  3706. for (i = 0, l = isoTimes.length; i < l; i++) {
  3707. if (isoTimes[i][1].exec(match[3])) {
  3708. // match[2] should be 'T' or space
  3709. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  3710. break;
  3711. }
  3712. }
  3713. if (timeFormat == null) {
  3714. config._isValid = false;
  3715. return;
  3716. }
  3717. }
  3718. if (!allowTime && timeFormat != null) {
  3719. config._isValid = false;
  3720. return;
  3721. }
  3722. if (match[4]) {
  3723. if (tzRegex.exec(match[4])) {
  3724. tzFormat = 'Z';
  3725. } else {
  3726. config._isValid = false;
  3727. return;
  3728. }
  3729. }
  3730. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  3731. configFromStringAndFormat(config);
  3732. } else {
  3733. config._isValid = false;
  3734. }
  3735. }
  3736. // date from iso format or fallback
  3737. function configFromString(config) {
  3738. var matched = aspNetJsonRegex.exec(config._i);
  3739. if (matched !== null) {
  3740. config._d = new Date(+matched[1]);
  3741. return;
  3742. }
  3743. configFromISO(config);
  3744. if (config._isValid === false) {
  3745. delete config._isValid;
  3746. utils_hooks__hooks.createFromInputFallback(config);
  3747. }
  3748. }
  3749. utils_hooks__hooks.createFromInputFallback = deprecate(
  3750. 'value provided is not in a recognized ISO format. moment construction falls back to js Date(), ' +
  3751. 'which is not reliable across all browsers and versions. Non ISO date formats are ' +
  3752. 'discouraged and will be removed in an upcoming major release. Please refer to ' +
  3753. 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  3754. function (config) {
  3755. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  3756. }
  3757. );
  3758. // Pick the first defined of two or three arguments.
  3759. function defaults(a, b, c) {
  3760. if (a != null) {
  3761. return a;
  3762. }
  3763. if (b != null) {
  3764. return b;
  3765. }
  3766. return c;
  3767. }
  3768. function currentDateArray(config) {
  3769. // hooks is actually the exported moment object
  3770. var nowValue = new Date(utils_hooks__hooks.now());
  3771. if (config._useUTC) {
  3772. return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
  3773. }
  3774. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  3775. }
  3776. // convert an array to a date.
  3777. // the array should mirror the parameters below
  3778. // note: all values past the year are optional and will default to the lowest possible value.
  3779. // [year, month, day , hour, minute, second, millisecond]
  3780. function configFromArray (config) {
  3781. var i, date, input = [], currentDate, yearToUse;
  3782. if (config._d) {
  3783. return;
  3784. }
  3785. currentDate = currentDateArray(config);
  3786. //compute day of the year from weeks and weekdays
  3787. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  3788. dayOfYearFromWeekInfo(config);
  3789. }
  3790. //if the day of the year is set, figure out what it is
  3791. if (config._dayOfYear) {
  3792. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  3793. if (config._dayOfYear > daysInYear(yearToUse)) {
  3794. getParsingFlags(config)._overflowDayOfYear = true;
  3795. }
  3796. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  3797. config._a[MONTH] = date.getUTCMonth();
  3798. config._a[DATE] = date.getUTCDate();
  3799. }
  3800. // Default to current date.
  3801. // * if no year, month, day of month are given, default to today
  3802. // * if day of month is given, default month and year
  3803. // * if month is given, default only year
  3804. // * if year is given, don't default anything
  3805. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  3806. config._a[i] = input[i] = currentDate[i];
  3807. }
  3808. // Zero out whatever was not defaulted, including time
  3809. for (; i < 7; i++) {
  3810. config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
  3811. }
  3812. // Check for 24:00:00.000
  3813. if (config._a[HOUR] === 24 &&
  3814. config._a[MINUTE] === 0 &&
  3815. config._a[SECOND] === 0 &&
  3816. config._a[MILLISECOND] === 0) {
  3817. config._nextDay = true;
  3818. config._a[HOUR] = 0;
  3819. }
  3820. config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
  3821. // Apply timezone offset from input. The actual utcOffset can be changed
  3822. // with parseZone.
  3823. if (config._tzm != null) {
  3824. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  3825. }
  3826. if (config._nextDay) {
  3827. config._a[HOUR] = 24;
  3828. }
  3829. }
  3830. function dayOfYearFromWeekInfo(config) {
  3831. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
  3832. w = config._w;
  3833. if (w.GG != null || w.W != null || w.E != null) {
  3834. dow = 1;
  3835. doy = 4;
  3836. // TODO: We need to take the current isoWeekYear, but that depends on
  3837. // how we interpret now (local, utc, fixed offset). So create
  3838. // a now version of current config (take local/utc/offset flags, and
  3839. // create now).
  3840. weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);
  3841. week = defaults(w.W, 1);
  3842. weekday = defaults(w.E, 1);
  3843. if (weekday < 1 || weekday > 7) {
  3844. weekdayOverflow = true;
  3845. }
  3846. } else {
  3847. dow = config._locale._week.dow;
  3848. doy = config._locale._week.doy;
  3849. weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);
  3850. week = defaults(w.w, 1);
  3851. if (w.d != null) {
  3852. // weekday -- low day numbers are considered next week
  3853. weekday = w.d;
  3854. if (weekday < 0 || weekday > 6) {
  3855. weekdayOverflow = true;
  3856. }
  3857. } else if (w.e != null) {
  3858. // local weekday -- counting starts from begining of week
  3859. weekday = w.e + dow;
  3860. if (w.e < 0 || w.e > 6) {
  3861. weekdayOverflow = true;
  3862. }
  3863. } else {
  3864. // default to begining of week
  3865. weekday = dow;
  3866. }
  3867. }
  3868. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  3869. getParsingFlags(config)._overflowWeeks = true;
  3870. } else if (weekdayOverflow != null) {
  3871. getParsingFlags(config)._overflowWeekday = true;
  3872. } else {
  3873. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  3874. config._a[YEAR] = temp.year;
  3875. config._dayOfYear = temp.dayOfYear;
  3876. }
  3877. }
  3878. // constant that refers to the ISO standard
  3879. utils_hooks__hooks.ISO_8601 = function () {};
  3880. // date from string and format string
  3881. function configFromStringAndFormat(config) {
  3882. // TODO: Move this to another part of the creation flow to prevent circular deps
  3883. if (config._f === utils_hooks__hooks.ISO_8601) {
  3884. configFromISO(config);
  3885. return;
  3886. }
  3887. config._a = [];
  3888. getParsingFlags(config).empty = true;
  3889. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  3890. var string = '' + config._i,
  3891. i, parsedInput, tokens, token, skipped,
  3892. stringLength = string.length,
  3893. totalParsedInputLength = 0;
  3894. tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
  3895. for (i = 0; i < tokens.length; i++) {
  3896. token = tokens[i];
  3897. parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
  3898. // console.log('token', token, 'parsedInput', parsedInput,
  3899. // 'regex', getParseRegexForToken(token, config));
  3900. if (parsedInput) {
  3901. skipped = string.substr(0, string.indexOf(parsedInput));
  3902. if (skipped.length > 0) {
  3903. getParsingFlags(config).unusedInput.push(skipped);
  3904. }
  3905. string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
  3906. totalParsedInputLength += parsedInput.length;
  3907. }
  3908. // don't parse if it's not a known token
  3909. if (formatTokenFunctions[token]) {
  3910. if (parsedInput) {
  3911. getParsingFlags(config).empty = false;
  3912. }
  3913. else {
  3914. getParsingFlags(config).unusedTokens.push(token);
  3915. }
  3916. addTimeToArrayFromToken(token, parsedInput, config);
  3917. }
  3918. else if (config._strict && !parsedInput) {
  3919. getParsingFlags(config).unusedTokens.push(token);
  3920. }
  3921. }
  3922. // add remaining unparsed input length to the string
  3923. getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
  3924. if (string.length > 0) {
  3925. getParsingFlags(config).unusedInput.push(string);
  3926. }
  3927. // clear _12h flag if hour is <= 12
  3928. if (config._a[HOUR] <= 12 &&
  3929. getParsingFlags(config).bigHour === true &&
  3930. config._a[HOUR] > 0) {
  3931. getParsingFlags(config).bigHour = undefined;
  3932. }
  3933. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  3934. getParsingFlags(config).meridiem = config._meridiem;
  3935. // handle meridiem
  3936. config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
  3937. configFromArray(config);
  3938. checkOverflow(config);
  3939. }
  3940. function meridiemFixWrap (locale, hour, meridiem) {
  3941. var isPm;
  3942. if (meridiem == null) {
  3943. // nothing to do
  3944. return hour;
  3945. }
  3946. if (locale.meridiemHour != null) {
  3947. return locale.meridiemHour(hour, meridiem);
  3948. } else if (locale.isPM != null) {
  3949. // Fallback
  3950. isPm = locale.isPM(meridiem);
  3951. if (isPm && hour < 12) {
  3952. hour += 12;
  3953. }
  3954. if (!isPm && hour === 12) {
  3955. hour = 0;
  3956. }
  3957. return hour;
  3958. } else {
  3959. // this is not supposed to happen
  3960. return hour;
  3961. }
  3962. }
  3963. // date from string and array of format strings
  3964. function configFromStringAndArray(config) {
  3965. var tempConfig,
  3966. bestMoment,
  3967. scoreToBeat,
  3968. i,
  3969. currentScore;
  3970. if (config._f.length === 0) {
  3971. getParsingFlags(config).invalidFormat = true;
  3972. config._d = new Date(NaN);
  3973. return;
  3974. }
  3975. for (i = 0; i < config._f.length; i++) {
  3976. currentScore = 0;
  3977. tempConfig = copyConfig({}, config);
  3978. if (config._useUTC != null) {
  3979. tempConfig._useUTC = config._useUTC;
  3980. }
  3981. tempConfig._f = config._f[i];
  3982. configFromStringAndFormat(tempConfig);
  3983. if (!valid__isValid(tempConfig)) {
  3984. continue;
  3985. }
  3986. // if there is any input that was not parsed add a penalty for that format
  3987. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  3988. //or tokens
  3989. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  3990. getParsingFlags(tempConfig).score = currentScore;
  3991. if (scoreToBeat == null || currentScore < scoreToBeat) {
  3992. scoreToBeat = currentScore;
  3993. bestMoment = tempConfig;
  3994. }
  3995. }
  3996. extend(config, bestMoment || tempConfig);
  3997. }
  3998. function configFromObject(config) {
  3999. if (config._d) {
  4000. return;
  4001. }
  4002. var i = normalizeObjectUnits(config._i);
  4003. config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
  4004. return obj && parseInt(obj, 10);
  4005. });
  4006. configFromArray(config);
  4007. }
  4008. function createFromConfig (config) {
  4009. var res = new Moment(checkOverflow(prepareConfig(config)));
  4010. if (res._nextDay) {
  4011. // Adding is smart enough around DST
  4012. res.add(1, 'd');
  4013. res._nextDay = undefined;
  4014. }
  4015. return res;
  4016. }
  4017. function prepareConfig (config) {
  4018. var input = config._i,
  4019. format = config._f;
  4020. config._locale = config._locale || locale_locales__getLocale(config._l);
  4021. if (input === null || (format === undefined && input === '')) {
  4022. return valid__createInvalid({nullInput: true});
  4023. }
  4024. if (typeof input === 'string') {
  4025. config._i = input = config._locale.preparse(input);
  4026. }
  4027. if (isMoment(input)) {
  4028. return new Moment(checkOverflow(input));
  4029. } else if (isArray(format)) {
  4030. configFromStringAndArray(config);
  4031. } else if (isDate(input)) {
  4032. config._d = input;
  4033. } else if (format) {
  4034. configFromStringAndFormat(config);
  4035. } else {
  4036. configFromInput(config);
  4037. }
  4038. if (!valid__isValid(config)) {
  4039. config._d = null;
  4040. }
  4041. return config;
  4042. }
  4043. function configFromInput(config) {
  4044. var input = config._i;
  4045. if (input === undefined) {
  4046. config._d = new Date(utils_hooks__hooks.now());
  4047. } else if (isDate(input)) {
  4048. config._d = new Date(input.valueOf());
  4049. } else if (typeof input === 'string') {
  4050. configFromString(config);
  4051. } else if (isArray(input)) {
  4052. config._a = map(input.slice(0), function (obj) {
  4053. return parseInt(obj, 10);
  4054. });
  4055. configFromArray(config);
  4056. } else if (typeof(input) === 'object') {
  4057. configFromObject(config);
  4058. } else if (typeof(input) === 'number') {
  4059. // from milliseconds
  4060. config._d = new Date(input);
  4061. } else {
  4062. utils_hooks__hooks.createFromInputFallback(config);
  4063. }
  4064. }
  4065. function createLocalOrUTC (input, format, locale, strict, isUTC) {
  4066. var c = {};
  4067. if (typeof(locale) === 'boolean') {
  4068. strict = locale;
  4069. locale = undefined;
  4070. }
  4071. if ((isObject(input) && isObjectEmpty(input)) ||
  4072. (isArray(input) && input.length === 0)) {
  4073. input = undefined;
  4074. }
  4075. // object construction must be done this way.
  4076. // https://github.com/moment/moment/issues/1423
  4077. c._isAMomentObject = true;
  4078. c._useUTC = c._isUTC = isUTC;
  4079. c._l = locale;
  4080. c._i = input;
  4081. c._f = format;
  4082. c._strict = strict;
  4083. return createFromConfig(c);
  4084. }
  4085. function local__createLocal (input, format, locale, strict) {
  4086. return createLocalOrUTC(input, format, locale, strict, false);
  4087. }
  4088. var prototypeMin = deprecate(
  4089. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  4090. function () {
  4091. var other = local__createLocal.apply(null, arguments);
  4092. if (this.isValid() && other.isValid()) {
  4093. return other < this ? this : other;
  4094. } else {
  4095. return valid__createInvalid();
  4096. }
  4097. }
  4098. );
  4099. var prototypeMax = deprecate(
  4100. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  4101. function () {
  4102. var other = local__createLocal.apply(null, arguments);
  4103. if (this.isValid() && other.isValid()) {
  4104. return other > this ? this : other;
  4105. } else {
  4106. return valid__createInvalid();
  4107. }
  4108. }
  4109. );
  4110. // Pick a moment m from moments so that m[fn](other) is true for all
  4111. // other. This relies on the function fn to be transitive.
  4112. //
  4113. // moments should either be an array of moment objects or an array, whose
  4114. // first element is an array of moment objects.
  4115. function pickBy(fn, moments) {
  4116. var res, i;
  4117. if (moments.length === 1 && isArray(moments[0])) {
  4118. moments = moments[0];
  4119. }
  4120. if (!moments.length) {
  4121. return local__createLocal();
  4122. }
  4123. res = moments[0];
  4124. for (i = 1; i < moments.length; ++i) {
  4125. if (!moments[i].isValid() || moments[i][fn](res)) {
  4126. res = moments[i];
  4127. }
  4128. }
  4129. return res;
  4130. }
  4131. // TODO: Use [].sort instead?
  4132. function min () {
  4133. var args = [].slice.call(arguments, 0);
  4134. return pickBy('isBefore', args);
  4135. }
  4136. function max () {
  4137. var args = [].slice.call(arguments, 0);
  4138. return pickBy('isAfter', args);
  4139. }
  4140. var now = function () {
  4141. return Date.now ? Date.now() : +(new Date());
  4142. };
  4143. function Duration (duration) {
  4144. var normalizedInput = normalizeObjectUnits(duration),
  4145. years = normalizedInput.year || 0,
  4146. quarters = normalizedInput.quarter || 0,
  4147. months = normalizedInput.month || 0,
  4148. weeks = normalizedInput.week || 0,
  4149. days = normalizedInput.day || 0,
  4150. hours = normalizedInput.hour || 0,
  4151. minutes = normalizedInput.minute || 0,
  4152. seconds = normalizedInput.second || 0,
  4153. milliseconds = normalizedInput.millisecond || 0;
  4154. // representation for dateAddRemove
  4155. this._milliseconds = +milliseconds +
  4156. seconds * 1e3 + // 1000
  4157. minutes * 6e4 + // 1000 * 60
  4158. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  4159. // Because of dateAddRemove treats 24 hours as different from a
  4160. // day when working around DST, we need to store them separately
  4161. this._days = +days +
  4162. weeks * 7;
  4163. // It is impossible translate months into days without knowing
  4164. // which months you are are talking about, so we have to store
  4165. // it separately.
  4166. this._months = +months +
  4167. quarters * 3 +
  4168. years * 12;
  4169. this._data = {};
  4170. this._locale = locale_locales__getLocale();
  4171. this._bubble();
  4172. }
  4173. function isDuration (obj) {
  4174. return obj instanceof Duration;
  4175. }
  4176. function absRound (number) {
  4177. if (number < 0) {
  4178. return Math.round(-1 * number) * -1;
  4179. } else {
  4180. return Math.round(number);
  4181. }
  4182. }
  4183. // FORMATTING
  4184. function offset (token, separator) {
  4185. addFormatToken(token, 0, 0, function () {
  4186. var offset = this.utcOffset();
  4187. var sign = '+';
  4188. if (offset < 0) {
  4189. offset = -offset;
  4190. sign = '-';
  4191. }
  4192. return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
  4193. });
  4194. }
  4195. offset('Z', ':');
  4196. offset('ZZ', '');
  4197. // PARSING
  4198. addRegexToken('Z', matchShortOffset);
  4199. addRegexToken('ZZ', matchShortOffset);
  4200. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  4201. config._useUTC = true;
  4202. config._tzm = offsetFromString(matchShortOffset, input);
  4203. });
  4204. // HELPERS
  4205. // timezone chunker
  4206. // '+10:00' > ['10', '00']
  4207. // '-1530' > ['-15', '30']
  4208. var chunkOffset = /([\+\-]|\d\d)/gi;
  4209. function offsetFromString(matcher, string) {
  4210. var matches = ((string || '').match(matcher) || []);
  4211. var chunk = matches[matches.length - 1] || [];
  4212. var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  4213. var minutes = +(parts[1] * 60) + toInt(parts[2]);
  4214. return parts[0] === '+' ? minutes : -minutes;
  4215. }
  4216. // Return a moment from input, that is local/utc/zone equivalent to model.
  4217. function cloneWithOffset(input, model) {
  4218. var res, diff;
  4219. if (model._isUTC) {
  4220. res = model.clone();
  4221. diff = (isMoment(input) || isDate(input) ? input.valueOf() : local__createLocal(input).valueOf()) - res.valueOf();
  4222. // Use low-level api, because this fn is low-level api.
  4223. res._d.setTime(res._d.valueOf() + diff);
  4224. utils_hooks__hooks.updateOffset(res, false);
  4225. return res;
  4226. } else {
  4227. return local__createLocal(input).local();
  4228. }
  4229. }
  4230. function getDateOffset (m) {
  4231. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  4232. // https://github.com/moment/moment/pull/1871
  4233. return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
  4234. }
  4235. // HOOKS
  4236. // This function will be called whenever a moment is mutated.
  4237. // It is intended to keep the offset in sync with the timezone.
  4238. utils_hooks__hooks.updateOffset = function () {};
  4239. // MOMENTS
  4240. // keepLocalTime = true means only change the timezone, without
  4241. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  4242. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  4243. // +0200, so we adjust the time as needed, to be valid.
  4244. //
  4245. // Keeping the time actually adds/subtracts (one hour)
  4246. // from the actual represented time. That is why we call updateOffset
  4247. // a second time. In case it wants us to change the offset again
  4248. // _changeInProgress == true case, then we have to adjust, because
  4249. // there is no such time in the given timezone.
  4250. function getSetOffset (input, keepLocalTime) {
  4251. var offset = this._offset || 0,
  4252. localAdjust;
  4253. if (!this.isValid()) {
  4254. return input != null ? this : NaN;
  4255. }
  4256. if (input != null) {
  4257. if (typeof input === 'string') {
  4258. input = offsetFromString(matchShortOffset, input);
  4259. } else if (Math.abs(input) < 16) {
  4260. input = input * 60;
  4261. }
  4262. if (!this._isUTC && keepLocalTime) {
  4263. localAdjust = getDateOffset(this);
  4264. }
  4265. this._offset = input;
  4266. this._isUTC = true;
  4267. if (localAdjust != null) {
  4268. this.add(localAdjust, 'm');
  4269. }
  4270. if (offset !== input) {
  4271. if (!keepLocalTime || this._changeInProgress) {
  4272. add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);
  4273. } else if (!this._changeInProgress) {
  4274. this._changeInProgress = true;
  4275. utils_hooks__hooks.updateOffset(this, true);
  4276. this._changeInProgress = null;
  4277. }
  4278. }
  4279. return this;
  4280. } else {
  4281. return this._isUTC ? offset : getDateOffset(this);
  4282. }
  4283. }
  4284. function getSetZone (input, keepLocalTime) {
  4285. if (input != null) {
  4286. if (typeof input !== 'string') {
  4287. input = -input;
  4288. }
  4289. this.utcOffset(input, keepLocalTime);
  4290. return this;
  4291. } else {
  4292. return -this.utcOffset();
  4293. }
  4294. }
  4295. function setOffsetToUTC (keepLocalTime) {
  4296. return this.utcOffset(0, keepLocalTime);
  4297. }
  4298. function setOffsetToLocal (keepLocalTime) {
  4299. if (this._isUTC) {
  4300. this.utcOffset(0, keepLocalTime);
  4301. this._isUTC = false;
  4302. if (keepLocalTime) {
  4303. this.subtract(getDateOffset(this), 'm');
  4304. }
  4305. }
  4306. return this;
  4307. }
  4308. function setOffsetToParsedOffset () {
  4309. if (this._tzm) {
  4310. this.utcOffset(this._tzm);
  4311. } else if (typeof this._i === 'string') {
  4312. var tZone = offsetFromString(matchOffset, this._i);
  4313. if (tZone === 0) {
  4314. this.utcOffset(0, true);
  4315. } else {
  4316. this.utcOffset(offsetFromString(matchOffset, this._i));
  4317. }
  4318. }
  4319. return this;
  4320. }
  4321. function hasAlignedHourOffset (input) {
  4322. if (!this.isValid()) {
  4323. return false;
  4324. }
  4325. input = input ? local__createLocal(input).utcOffset() : 0;
  4326. return (this.utcOffset() - input) % 60 === 0;
  4327. }
  4328. function isDaylightSavingTime () {
  4329. return (
  4330. this.utcOffset() > this.clone().month(0).utcOffset() ||
  4331. this.utcOffset() > this.clone().month(5).utcOffset()
  4332. );
  4333. }
  4334. function isDaylightSavingTimeShifted () {
  4335. if (!isUndefined(this._isDSTShifted)) {
  4336. return this._isDSTShifted;
  4337. }
  4338. var c = {};
  4339. copyConfig(c, this);
  4340. c = prepareConfig(c);
  4341. if (c._a) {
  4342. var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a);
  4343. this._isDSTShifted = this.isValid() &&
  4344. compareArrays(c._a, other.toArray()) > 0;
  4345. } else {
  4346. this._isDSTShifted = false;
  4347. }
  4348. return this._isDSTShifted;
  4349. }
  4350. function isLocal () {
  4351. return this.isValid() ? !this._isUTC : false;
  4352. }
  4353. function isUtcOffset () {
  4354. return this.isValid() ? this._isUTC : false;
  4355. }
  4356. function isUtc () {
  4357. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  4358. }
  4359. // ASP.NET json date format regex
  4360. var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
  4361. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  4362. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  4363. // and further modified to allow for strings containing both week and day
  4364. var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;
  4365. function create__createDuration (input, key) {
  4366. var duration = input,
  4367. // matching against regexp is expensive, do it on demand
  4368. match = null,
  4369. sign,
  4370. ret,
  4371. diffRes;
  4372. if (isDuration(input)) {
  4373. duration = {
  4374. ms : input._milliseconds,
  4375. d : input._days,
  4376. M : input._months
  4377. };
  4378. } else if (typeof input === 'number') {
  4379. duration = {};
  4380. if (key) {
  4381. duration[key] = input;
  4382. } else {
  4383. duration.milliseconds = input;
  4384. }
  4385. } else if (!!(match = aspNetRegex.exec(input))) {
  4386. sign = (match[1] === '-') ? -1 : 1;
  4387. duration = {
  4388. y : 0,
  4389. d : toInt(match[DATE]) * sign,
  4390. h : toInt(match[HOUR]) * sign,
  4391. m : toInt(match[MINUTE]) * sign,
  4392. s : toInt(match[SECOND]) * sign,
  4393. ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
  4394. };
  4395. } else if (!!(match = isoRegex.exec(input))) {
  4396. sign = (match[1] === '-') ? -1 : 1;
  4397. duration = {
  4398. y : parseIso(match[2], sign),
  4399. M : parseIso(match[3], sign),
  4400. w : parseIso(match[4], sign),
  4401. d : parseIso(match[5], sign),
  4402. h : parseIso(match[6], sign),
  4403. m : parseIso(match[7], sign),
  4404. s : parseIso(match[8], sign)
  4405. };
  4406. } else if (duration == null) {// checks for null or undefined
  4407. duration = {};
  4408. } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
  4409. diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));
  4410. duration = {};
  4411. duration.ms = diffRes.milliseconds;
  4412. duration.M = diffRes.months;
  4413. }
  4414. ret = new Duration(duration);
  4415. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  4416. ret._locale = input._locale;
  4417. }
  4418. return ret;
  4419. }
  4420. create__createDuration.fn = Duration.prototype;
  4421. function parseIso (inp, sign) {
  4422. // We'd normally use ~~inp for this, but unfortunately it also
  4423. // converts floats to ints.
  4424. // inp may be undefined, so careful calling replace on it.
  4425. var res = inp && parseFloat(inp.replace(',', '.'));
  4426. // apply sign while we're at it
  4427. return (isNaN(res) ? 0 : res) * sign;
  4428. }
  4429. function positiveMomentsDifference(base, other) {
  4430. var res = {milliseconds: 0, months: 0};
  4431. res.months = other.month() - base.month() +
  4432. (other.year() - base.year()) * 12;
  4433. if (base.clone().add(res.months, 'M').isAfter(other)) {
  4434. --res.months;
  4435. }
  4436. res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
  4437. return res;
  4438. }
  4439. function momentsDifference(base, other) {
  4440. var res;
  4441. if (!(base.isValid() && other.isValid())) {
  4442. return {milliseconds: 0, months: 0};
  4443. }
  4444. other = cloneWithOffset(other, base);
  4445. if (base.isBefore(other)) {
  4446. res = positiveMomentsDifference(base, other);
  4447. } else {
  4448. res = positiveMomentsDifference(other, base);
  4449. res.milliseconds = -res.milliseconds;
  4450. res.months = -res.months;
  4451. }
  4452. return res;
  4453. }
  4454. // TODO: remove 'name' arg after deprecation is removed
  4455. function createAdder(direction, name) {
  4456. return function (val, period) {
  4457. var dur, tmp;
  4458. //invert the arguments, but complain about it
  4459. if (period !== null && !isNaN(+period)) {
  4460. deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
  4461. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
  4462. tmp = val; val = period; period = tmp;
  4463. }
  4464. val = typeof val === 'string' ? +val : val;
  4465. dur = create__createDuration(val, period);
  4466. add_subtract__addSubtract(this, dur, direction);
  4467. return this;
  4468. };
  4469. }
  4470. function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {
  4471. var milliseconds = duration._milliseconds,
  4472. days = absRound(duration._days),
  4473. months = absRound(duration._months);
  4474. if (!mom.isValid()) {
  4475. // No op
  4476. return;
  4477. }
  4478. updateOffset = updateOffset == null ? true : updateOffset;
  4479. if (milliseconds) {
  4480. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  4481. }
  4482. if (days) {
  4483. get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);
  4484. }
  4485. if (months) {
  4486. setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);
  4487. }
  4488. if (updateOffset) {
  4489. utils_hooks__hooks.updateOffset(mom, days || months);
  4490. }
  4491. }
  4492. var add_subtract__add = createAdder(1, 'add');
  4493. var add_subtract__subtract = createAdder(-1, 'subtract');
  4494. function getCalendarFormat(myMoment, now) {
  4495. var diff = myMoment.diff(now, 'days', true);
  4496. return diff < -6 ? 'sameElse' :
  4497. diff < -1 ? 'lastWeek' :
  4498. diff < 0 ? 'lastDay' :
  4499. diff < 1 ? 'sameDay' :
  4500. diff < 2 ? 'nextDay' :
  4501. diff < 7 ? 'nextWeek' : 'sameElse';
  4502. }
  4503. function moment_calendar__calendar (time, formats) {
  4504. // We want to compare the start of today, vs this.
  4505. // Getting start-of-today depends on whether we're local/utc/offset or not.
  4506. var now = time || local__createLocal(),
  4507. sod = cloneWithOffset(now, this).startOf('day'),
  4508. format = utils_hooks__hooks.calendarFormat(this, sod) || 'sameElse';
  4509. var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
  4510. return this.format(output || this.localeData().calendar(format, this, local__createLocal(now)));
  4511. }
  4512. function clone () {
  4513. return new Moment(this);
  4514. }
  4515. function isAfter (input, units) {
  4516. var localInput = isMoment(input) ? input : local__createLocal(input);
  4517. if (!(this.isValid() && localInput.isValid())) {
  4518. return false;
  4519. }
  4520. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  4521. if (units === 'millisecond') {
  4522. return this.valueOf() > localInput.valueOf();
  4523. } else {
  4524. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  4525. }
  4526. }
  4527. function isBefore (input, units) {
  4528. var localInput = isMoment(input) ? input : local__createLocal(input);
  4529. if (!(this.isValid() && localInput.isValid())) {
  4530. return false;
  4531. }
  4532. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  4533. if (units === 'millisecond') {
  4534. return this.valueOf() < localInput.valueOf();
  4535. } else {
  4536. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  4537. }
  4538. }
  4539. function isBetween (from, to, units, inclusivity) {
  4540. inclusivity = inclusivity || '()';
  4541. return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&
  4542. (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
  4543. }
  4544. function isSame (input, units) {
  4545. var localInput = isMoment(input) ? input : local__createLocal(input),
  4546. inputMs;
  4547. if (!(this.isValid() && localInput.isValid())) {
  4548. return false;
  4549. }
  4550. units = normalizeUnits(units || 'millisecond');
  4551. if (units === 'millisecond') {
  4552. return this.valueOf() === localInput.valueOf();
  4553. } else {
  4554. inputMs = localInput.valueOf();
  4555. return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
  4556. }
  4557. }
  4558. function isSameOrAfter (input, units) {
  4559. return this.isSame(input, units) || this.isAfter(input,units);
  4560. }
  4561. function isSameOrBefore (input, units) {
  4562. return this.isSame(input, units) || this.isBefore(input,units);
  4563. }
  4564. function diff (input, units, asFloat) {
  4565. var that,
  4566. zoneDelta,
  4567. delta, output;
  4568. if (!this.isValid()) {
  4569. return NaN;
  4570. }
  4571. that = cloneWithOffset(input, this);
  4572. if (!that.isValid()) {
  4573. return NaN;
  4574. }
  4575. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  4576. units = normalizeUnits(units);
  4577. if (units === 'year' || units === 'month' || units === 'quarter') {
  4578. output = monthDiff(this, that);
  4579. if (units === 'quarter') {
  4580. output = output / 3;
  4581. } else if (units === 'year') {
  4582. output = output / 12;
  4583. }
  4584. } else {
  4585. delta = this - that;
  4586. output = units === 'second' ? delta / 1e3 : // 1000
  4587. units === 'minute' ? delta / 6e4 : // 1000 * 60
  4588. units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
  4589. units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
  4590. units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
  4591. delta;
  4592. }
  4593. return asFloat ? output : absFloor(output);
  4594. }
  4595. function monthDiff (a, b) {
  4596. // difference in months
  4597. var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
  4598. // b is in (anchor - 1 month, anchor + 1 month)
  4599. anchor = a.clone().add(wholeMonthDiff, 'months'),
  4600. anchor2, adjust;
  4601. if (b - anchor < 0) {
  4602. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  4603. // linear across the month
  4604. adjust = (b - anchor) / (anchor - anchor2);
  4605. } else {
  4606. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  4607. // linear across the month
  4608. adjust = (b - anchor) / (anchor2 - anchor);
  4609. }
  4610. //check for negative zero, return zero if negative zero
  4611. return -(wholeMonthDiff + adjust) || 0;
  4612. }
  4613. utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  4614. utils_hooks__hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  4615. function toString () {
  4616. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  4617. }
  4618. function moment_format__toISOString () {
  4619. var m = this.clone().utc();
  4620. if (0 < m.year() && m.year() <= 9999) {
  4621. if (isFunction(Date.prototype.toISOString)) {
  4622. // native implementation is ~50x faster, use it when we can
  4623. return this.toDate().toISOString();
  4624. } else {
  4625. return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  4626. }
  4627. } else {
  4628. return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  4629. }
  4630. }
  4631. function format (inputString) {
  4632. if (!inputString) {
  4633. inputString = this.isUtc() ? utils_hooks__hooks.defaultFormatUtc : utils_hooks__hooks.defaultFormat;
  4634. }
  4635. var output = formatMoment(this, inputString);
  4636. return this.localeData().postformat(output);
  4637. }
  4638. function from (time, withoutSuffix) {
  4639. if (this.isValid() &&
  4640. ((isMoment(time) && time.isValid()) ||
  4641. local__createLocal(time).isValid())) {
  4642. return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
  4643. } else {
  4644. return this.localeData().invalidDate();
  4645. }
  4646. }
  4647. function fromNow (withoutSuffix) {
  4648. return this.from(local__createLocal(), withoutSuffix);
  4649. }
  4650. function to (time, withoutSuffix) {
  4651. if (this.isValid() &&
  4652. ((isMoment(time) && time.isValid()) ||
  4653. local__createLocal(time).isValid())) {
  4654. return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
  4655. } else {
  4656. return this.localeData().invalidDate();
  4657. }
  4658. }
  4659. function toNow (withoutSuffix) {
  4660. return this.to(local__createLocal(), withoutSuffix);
  4661. }
  4662. // If passed a locale key, it will set the locale for this
  4663. // instance. Otherwise, it will return the locale configuration
  4664. // variables for this instance.
  4665. function locale (key) {
  4666. var newLocaleData;
  4667. if (key === undefined) {
  4668. return this._locale._abbr;
  4669. } else {
  4670. newLocaleData = locale_locales__getLocale(key);
  4671. if (newLocaleData != null) {
  4672. this._locale = newLocaleData;
  4673. }
  4674. return this;
  4675. }
  4676. }
  4677. var lang = deprecate(
  4678. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  4679. function (key) {
  4680. if (key === undefined) {
  4681. return this.localeData();
  4682. } else {
  4683. return this.locale(key);
  4684. }
  4685. }
  4686. );
  4687. function localeData () {
  4688. return this._locale;
  4689. }
  4690. function startOf (units) {
  4691. units = normalizeUnits(units);
  4692. // the following switch intentionally omits break keywords
  4693. // to utilize falling through the cases.
  4694. switch (units) {
  4695. case 'year':
  4696. this.month(0);
  4697. /* falls through */
  4698. case 'quarter':
  4699. case 'month':
  4700. this.date(1);
  4701. /* falls through */
  4702. case 'week':
  4703. case 'isoWeek':
  4704. case 'day':
  4705. case 'date':
  4706. this.hours(0);
  4707. /* falls through */
  4708. case 'hour':
  4709. this.minutes(0);
  4710. /* falls through */
  4711. case 'minute':
  4712. this.seconds(0);
  4713. /* falls through */
  4714. case 'second':
  4715. this.milliseconds(0);
  4716. }
  4717. // weeks are a special case
  4718. if (units === 'week') {
  4719. this.weekday(0);
  4720. }
  4721. if (units === 'isoWeek') {
  4722. this.isoWeekday(1);
  4723. }
  4724. // quarters are also special
  4725. if (units === 'quarter') {
  4726. this.month(Math.floor(this.month() / 3) * 3);
  4727. }
  4728. return this;
  4729. }
  4730. function endOf (units) {
  4731. units = normalizeUnits(units);
  4732. if (units === undefined || units === 'millisecond') {
  4733. return this;
  4734. }
  4735. // 'date' is an alias for 'day', so it should be considered as such.
  4736. if (units === 'date') {
  4737. units = 'day';
  4738. }
  4739. return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
  4740. }
  4741. function to_type__valueOf () {
  4742. return this._d.valueOf() - ((this._offset || 0) * 60000);
  4743. }
  4744. function unix () {
  4745. return Math.floor(this.valueOf() / 1000);
  4746. }
  4747. function toDate () {
  4748. return new Date(this.valueOf());
  4749. }
  4750. function toArray () {
  4751. var m = this;
  4752. return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
  4753. }
  4754. function toObject () {
  4755. var m = this;
  4756. return {
  4757. years: m.year(),
  4758. months: m.month(),
  4759. date: m.date(),
  4760. hours: m.hours(),
  4761. minutes: m.minutes(),
  4762. seconds: m.seconds(),
  4763. milliseconds: m.milliseconds()
  4764. };
  4765. }
  4766. function toJSON () {
  4767. // new Date(NaN).toJSON() === null
  4768. return this.isValid() ? this.toISOString() : null;
  4769. }
  4770. function moment_valid__isValid () {
  4771. return valid__isValid(this);
  4772. }
  4773. function parsingFlags () {
  4774. return extend({}, getParsingFlags(this));
  4775. }
  4776. function invalidAt () {
  4777. return getParsingFlags(this).overflow;
  4778. }
  4779. function creationData() {
  4780. return {
  4781. input: this._i,
  4782. format: this._f,
  4783. locale: this._locale,
  4784. isUTC: this._isUTC,
  4785. strict: this._strict
  4786. };
  4787. }
  4788. // FORMATTING
  4789. addFormatToken(0, ['gg', 2], 0, function () {
  4790. return this.weekYear() % 100;
  4791. });
  4792. addFormatToken(0, ['GG', 2], 0, function () {
  4793. return this.isoWeekYear() % 100;
  4794. });
  4795. function addWeekYearFormatToken (token, getter) {
  4796. addFormatToken(0, [token, token.length], 0, getter);
  4797. }
  4798. addWeekYearFormatToken('gggg', 'weekYear');
  4799. addWeekYearFormatToken('ggggg', 'weekYear');
  4800. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  4801. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  4802. // ALIASES
  4803. addUnitAlias('weekYear', 'gg');
  4804. addUnitAlias('isoWeekYear', 'GG');
  4805. // PRIORITY
  4806. addUnitPriority('weekYear', 1);
  4807. addUnitPriority('isoWeekYear', 1);
  4808. // PARSING
  4809. addRegexToken('G', matchSigned);
  4810. addRegexToken('g', matchSigned);
  4811. addRegexToken('GG', match1to2, match2);
  4812. addRegexToken('gg', match1to2, match2);
  4813. addRegexToken('GGGG', match1to4, match4);
  4814. addRegexToken('gggg', match1to4, match4);
  4815. addRegexToken('GGGGG', match1to6, match6);
  4816. addRegexToken('ggggg', match1to6, match6);
  4817. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
  4818. week[token.substr(0, 2)] = toInt(input);
  4819. });
  4820. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  4821. week[token] = utils_hooks__hooks.parseTwoDigitYear(input);
  4822. });
  4823. // MOMENTS
  4824. function getSetWeekYear (input) {
  4825. return getSetWeekYearHelper.call(this,
  4826. input,
  4827. this.week(),
  4828. this.weekday(),
  4829. this.localeData()._week.dow,
  4830. this.localeData()._week.doy);
  4831. }
  4832. function getSetISOWeekYear (input) {
  4833. return getSetWeekYearHelper.call(this,
  4834. input, this.isoWeek(), this.isoWeekday(), 1, 4);
  4835. }
  4836. function getISOWeeksInYear () {
  4837. return weeksInYear(this.year(), 1, 4);
  4838. }
  4839. function getWeeksInYear () {
  4840. var weekInfo = this.localeData()._week;
  4841. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  4842. }
  4843. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  4844. var weeksTarget;
  4845. if (input == null) {
  4846. return weekOfYear(this, dow, doy).year;
  4847. } else {
  4848. weeksTarget = weeksInYear(input, dow, doy);
  4849. if (week > weeksTarget) {
  4850. week = weeksTarget;
  4851. }
  4852. return setWeekAll.call(this, input, week, weekday, dow, doy);
  4853. }
  4854. }
  4855. function setWeekAll(weekYear, week, weekday, dow, doy) {
  4856. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  4857. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  4858. this.year(date.getUTCFullYear());
  4859. this.month(date.getUTCMonth());
  4860. this.date(date.getUTCDate());
  4861. return this;
  4862. }
  4863. // FORMATTING
  4864. addFormatToken('Q', 0, 'Qo', 'quarter');
  4865. // ALIASES
  4866. addUnitAlias('quarter', 'Q');
  4867. // PRIORITY
  4868. addUnitPriority('quarter', 7);
  4869. // PARSING
  4870. addRegexToken('Q', match1);
  4871. addParseToken('Q', function (input, array) {
  4872. array[MONTH] = (toInt(input) - 1) * 3;
  4873. });
  4874. // MOMENTS
  4875. function getSetQuarter (input) {
  4876. return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
  4877. }
  4878. // FORMATTING
  4879. addFormatToken('D', ['DD', 2], 'Do', 'date');
  4880. // ALIASES
  4881. addUnitAlias('date', 'D');
  4882. // PRIOROITY
  4883. addUnitPriority('date', 9);
  4884. // PARSING
  4885. addRegexToken('D', match1to2);
  4886. addRegexToken('DD', match1to2, match2);
  4887. addRegexToken('Do', function (isStrict, locale) {
  4888. return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
  4889. });
  4890. addParseToken(['D', 'DD'], DATE);
  4891. addParseToken('Do', function (input, array) {
  4892. array[DATE] = toInt(input.match(match1to2)[0], 10);
  4893. });
  4894. // MOMENTS
  4895. var getSetDayOfMonth = makeGetSet('Date', true);
  4896. // FORMATTING
  4897. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  4898. // ALIASES
  4899. addUnitAlias('dayOfYear', 'DDD');
  4900. // PRIORITY
  4901. addUnitPriority('dayOfYear', 4);
  4902. // PARSING
  4903. addRegexToken('DDD', match1to3);
  4904. addRegexToken('DDDD', match3);
  4905. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  4906. config._dayOfYear = toInt(input);
  4907. });
  4908. // HELPERS
  4909. // MOMENTS
  4910. function getSetDayOfYear (input) {
  4911. var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
  4912. return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
  4913. }
  4914. // FORMATTING
  4915. addFormatToken('m', ['mm', 2], 0, 'minute');
  4916. // ALIASES
  4917. addUnitAlias('minute', 'm');
  4918. // PRIORITY
  4919. addUnitPriority('minute', 14);
  4920. // PARSING
  4921. addRegexToken('m', match1to2);
  4922. addRegexToken('mm', match1to2, match2);
  4923. addParseToken(['m', 'mm'], MINUTE);
  4924. // MOMENTS
  4925. var getSetMinute = makeGetSet('Minutes', false);
  4926. // FORMATTING
  4927. addFormatToken('s', ['ss', 2], 0, 'second');
  4928. // ALIASES
  4929. addUnitAlias('second', 's');
  4930. // PRIORITY
  4931. addUnitPriority('second', 15);
  4932. // PARSING
  4933. addRegexToken('s', match1to2);
  4934. addRegexToken('ss', match1to2, match2);
  4935. addParseToken(['s', 'ss'], SECOND);
  4936. // MOMENTS
  4937. var getSetSecond = makeGetSet('Seconds', false);
  4938. // FORMATTING
  4939. addFormatToken('S', 0, 0, function () {
  4940. return ~~(this.millisecond() / 100);
  4941. });
  4942. addFormatToken(0, ['SS', 2], 0, function () {
  4943. return ~~(this.millisecond() / 10);
  4944. });
  4945. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  4946. addFormatToken(0, ['SSSS', 4], 0, function () {
  4947. return this.millisecond() * 10;
  4948. });
  4949. addFormatToken(0, ['SSSSS', 5], 0, function () {
  4950. return this.millisecond() * 100;
  4951. });
  4952. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  4953. return this.millisecond() * 1000;
  4954. });
  4955. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  4956. return this.millisecond() * 10000;
  4957. });
  4958. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  4959. return this.millisecond() * 100000;
  4960. });
  4961. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  4962. return this.millisecond() * 1000000;
  4963. });
  4964. // ALIASES
  4965. addUnitAlias('millisecond', 'ms');
  4966. // PRIORITY
  4967. addUnitPriority('millisecond', 16);
  4968. // PARSING
  4969. addRegexToken('S', match1to3, match1);
  4970. addRegexToken('SS', match1to3, match2);
  4971. addRegexToken('SSS', match1to3, match3);
  4972. var token;
  4973. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  4974. addRegexToken(token, matchUnsigned);
  4975. }
  4976. function parseMs(input, array) {
  4977. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  4978. }
  4979. for (token = 'S'; token.length <= 9; token += 'S') {
  4980. addParseToken(token, parseMs);
  4981. }
  4982. // MOMENTS
  4983. var getSetMillisecond = makeGetSet('Milliseconds', false);
  4984. // FORMATTING
  4985. addFormatToken('z', 0, 0, 'zoneAbbr');
  4986. addFormatToken('zz', 0, 0, 'zoneName');
  4987. // MOMENTS
  4988. function getZoneAbbr () {
  4989. return this._isUTC ? 'UTC' : '';
  4990. }
  4991. function getZoneName () {
  4992. return this._isUTC ? 'Coordinated Universal Time' : '';
  4993. }
  4994. var momentPrototype__proto = Moment.prototype;
  4995. momentPrototype__proto.add = add_subtract__add;
  4996. momentPrototype__proto.calendar = moment_calendar__calendar;
  4997. momentPrototype__proto.clone = clone;
  4998. momentPrototype__proto.diff = diff;
  4999. momentPrototype__proto.endOf = endOf;
  5000. momentPrototype__proto.format = format;
  5001. momentPrototype__proto.from = from;
  5002. momentPrototype__proto.fromNow = fromNow;
  5003. momentPrototype__proto.to = to;
  5004. momentPrototype__proto.toNow = toNow;
  5005. momentPrototype__proto.get = stringGet;
  5006. momentPrototype__proto.invalidAt = invalidAt;
  5007. momentPrototype__proto.isAfter = isAfter;
  5008. momentPrototype__proto.isBefore = isBefore;
  5009. momentPrototype__proto.isBetween = isBetween;
  5010. momentPrototype__proto.isSame = isSame;
  5011. momentPrototype__proto.isSameOrAfter = isSameOrAfter;
  5012. momentPrototype__proto.isSameOrBefore = isSameOrBefore;
  5013. momentPrototype__proto.isValid = moment_valid__isValid;
  5014. momentPrototype__proto.lang = lang;
  5015. momentPrototype__proto.locale = locale;
  5016. momentPrototype__proto.localeData = localeData;
  5017. momentPrototype__proto.max = prototypeMax;
  5018. momentPrototype__proto.min = prototypeMin;
  5019. momentPrototype__proto.parsingFlags = parsingFlags;
  5020. momentPrototype__proto.set = stringSet;
  5021. momentPrototype__proto.startOf = startOf;
  5022. momentPrototype__proto.subtract = add_subtract__subtract;
  5023. momentPrototype__proto.toArray = toArray;
  5024. momentPrototype__proto.toObject = toObject;
  5025. momentPrototype__proto.toDate = toDate;
  5026. momentPrototype__proto.toISOString = moment_format__toISOString;
  5027. momentPrototype__proto.toJSON = toJSON;
  5028. momentPrototype__proto.toString = toString;
  5029. momentPrototype__proto.unix = unix;
  5030. momentPrototype__proto.valueOf = to_type__valueOf;
  5031. momentPrototype__proto.creationData = creationData;
  5032. // Year
  5033. momentPrototype__proto.year = getSetYear;
  5034. momentPrototype__proto.isLeapYear = getIsLeapYear;
  5035. // Week Year
  5036. momentPrototype__proto.weekYear = getSetWeekYear;
  5037. momentPrototype__proto.isoWeekYear = getSetISOWeekYear;
  5038. // Quarter
  5039. momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;
  5040. // Month
  5041. momentPrototype__proto.month = getSetMonth;
  5042. momentPrototype__proto.daysInMonth = getDaysInMonth;
  5043. // Week
  5044. momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek;
  5045. momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek;
  5046. momentPrototype__proto.weeksInYear = getWeeksInYear;
  5047. momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;
  5048. // Day
  5049. momentPrototype__proto.date = getSetDayOfMonth;
  5050. momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek;
  5051. momentPrototype__proto.weekday = getSetLocaleDayOfWeek;
  5052. momentPrototype__proto.isoWeekday = getSetISODayOfWeek;
  5053. momentPrototype__proto.dayOfYear = getSetDayOfYear;
  5054. // Hour
  5055. momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;
  5056. // Minute
  5057. momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;
  5058. // Second
  5059. momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;
  5060. // Millisecond
  5061. momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;
  5062. // Offset
  5063. momentPrototype__proto.utcOffset = getSetOffset;
  5064. momentPrototype__proto.utc = setOffsetToUTC;
  5065. momentPrototype__proto.local = setOffsetToLocal;
  5066. momentPrototype__proto.parseZone = setOffsetToParsedOffset;
  5067. momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;
  5068. momentPrototype__proto.isDST = isDaylightSavingTime;
  5069. momentPrototype__proto.isLocal = isLocal;
  5070. momentPrototype__proto.isUtcOffset = isUtcOffset;
  5071. momentPrototype__proto.isUtc = isUtc;
  5072. momentPrototype__proto.isUTC = isUtc;
  5073. // Timezone
  5074. momentPrototype__proto.zoneAbbr = getZoneAbbr;
  5075. momentPrototype__proto.zoneName = getZoneName;
  5076. // Deprecations
  5077. momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
  5078. momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
  5079. momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
  5080. momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
  5081. momentPrototype__proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
  5082. var momentPrototype = momentPrototype__proto;
  5083. function moment__createUnix (input) {
  5084. return local__createLocal(input * 1000);
  5085. }
  5086. function moment__createInZone () {
  5087. return local__createLocal.apply(null, arguments).parseZone();
  5088. }
  5089. function preParsePostFormat (string) {
  5090. return string;
  5091. }
  5092. var prototype__proto = Locale.prototype;
  5093. prototype__proto.calendar = locale_calendar__calendar;
  5094. prototype__proto.longDateFormat = longDateFormat;
  5095. prototype__proto.invalidDate = invalidDate;
  5096. prototype__proto.ordinal = ordinal;
  5097. prototype__proto.preparse = preParsePostFormat;
  5098. prototype__proto.postformat = preParsePostFormat;
  5099. prototype__proto.relativeTime = relative__relativeTime;
  5100. prototype__proto.pastFuture = pastFuture;
  5101. prototype__proto.set = locale_set__set;
  5102. // Month
  5103. prototype__proto.months = localeMonths;
  5104. prototype__proto.monthsShort = localeMonthsShort;
  5105. prototype__proto.monthsParse = localeMonthsParse;
  5106. prototype__proto.monthsRegex = monthsRegex;
  5107. prototype__proto.monthsShortRegex = monthsShortRegex;
  5108. // Week
  5109. prototype__proto.week = localeWeek;
  5110. prototype__proto.firstDayOfYear = localeFirstDayOfYear;
  5111. prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;
  5112. // Day of Week
  5113. prototype__proto.weekdays = localeWeekdays;
  5114. prototype__proto.weekdaysMin = localeWeekdaysMin;
  5115. prototype__proto.weekdaysShort = localeWeekdaysShort;
  5116. prototype__proto.weekdaysParse = localeWeekdaysParse;
  5117. prototype__proto.weekdaysRegex = weekdaysRegex;
  5118. prototype__proto.weekdaysShortRegex = weekdaysShortRegex;
  5119. prototype__proto.weekdaysMinRegex = weekdaysMinRegex;
  5120. // Hours
  5121. prototype__proto.isPM = localeIsPM;
  5122. prototype__proto.meridiem = localeMeridiem;
  5123. function lists__get (format, index, field, setter) {
  5124. var locale = locale_locales__getLocale();
  5125. var utc = create_utc__createUTC().set(setter, index);
  5126. return locale[field](utc, format);
  5127. }
  5128. function listMonthsImpl (format, index, field) {
  5129. if (typeof format === 'number') {
  5130. index = format;
  5131. format = undefined;
  5132. }
  5133. format = format || '';
  5134. if (index != null) {
  5135. return lists__get(format, index, field, 'month');
  5136. }
  5137. var i;
  5138. var out = [];
  5139. for (i = 0; i < 12; i++) {
  5140. out[i] = lists__get(format, i, field, 'month');
  5141. }
  5142. return out;
  5143. }
  5144. // ()
  5145. // (5)
  5146. // (fmt, 5)
  5147. // (fmt)
  5148. // (true)
  5149. // (true, 5)
  5150. // (true, fmt, 5)
  5151. // (true, fmt)
  5152. function listWeekdaysImpl (localeSorted, format, index, field) {
  5153. if (typeof localeSorted === 'boolean') {
  5154. if (typeof format === 'number') {
  5155. index = format;
  5156. format = undefined;
  5157. }
  5158. format = format || '';
  5159. } else {
  5160. format = localeSorted;
  5161. index = format;
  5162. localeSorted = false;
  5163. if (typeof format === 'number') {
  5164. index = format;
  5165. format = undefined;
  5166. }
  5167. format = format || '';
  5168. }
  5169. var locale = locale_locales__getLocale(),
  5170. shift = localeSorted ? locale._week.dow : 0;
  5171. if (index != null) {
  5172. return lists__get(format, (index + shift) % 7, field, 'day');
  5173. }
  5174. var i;
  5175. var out = [];
  5176. for (i = 0; i < 7; i++) {
  5177. out[i] = lists__get(format, (i + shift) % 7, field, 'day');
  5178. }
  5179. return out;
  5180. }
  5181. function lists__listMonths (format, index) {
  5182. return listMonthsImpl(format, index, 'months');
  5183. }
  5184. function lists__listMonthsShort (format, index) {
  5185. return listMonthsImpl(format, index, 'monthsShort');
  5186. }
  5187. function lists__listWeekdays (localeSorted, format, index) {
  5188. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  5189. }
  5190. function lists__listWeekdaysShort (localeSorted, format, index) {
  5191. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  5192. }
  5193. function lists__listWeekdaysMin (localeSorted, format, index) {
  5194. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  5195. }
  5196. locale_locales__getSetGlobalLocale('en', {
  5197. ordinalParse: /\d{1,2}(th|st|nd|rd)/,
  5198. ordinal : function (number) {
  5199. var b = number % 10,
  5200. output = (toInt(number % 100 / 10) === 1) ? 'th' :
  5201. (b === 1) ? 'st' :
  5202. (b === 2) ? 'nd' :
  5203. (b === 3) ? 'rd' : 'th';
  5204. return number + output;
  5205. }
  5206. });
  5207. // Side effect imports
  5208. utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);
  5209. utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);
  5210. var mathAbs = Math.abs;
  5211. function duration_abs__abs () {
  5212. var data = this._data;
  5213. this._milliseconds = mathAbs(this._milliseconds);
  5214. this._days = mathAbs(this._days);
  5215. this._months = mathAbs(this._months);
  5216. data.milliseconds = mathAbs(data.milliseconds);
  5217. data.seconds = mathAbs(data.seconds);
  5218. data.minutes = mathAbs(data.minutes);
  5219. data.hours = mathAbs(data.hours);
  5220. data.months = mathAbs(data.months);
  5221. data.years = mathAbs(data.years);
  5222. return this;
  5223. }
  5224. function duration_add_subtract__addSubtract (duration, input, value, direction) {
  5225. var other = create__createDuration(input, value);
  5226. duration._milliseconds += direction * other._milliseconds;
  5227. duration._days += direction * other._days;
  5228. duration._months += direction * other._months;
  5229. return duration._bubble();
  5230. }
  5231. // supports only 2.0-style add(1, 's') or add(duration)
  5232. function duration_add_subtract__add (input, value) {
  5233. return duration_add_subtract__addSubtract(this, input, value, 1);
  5234. }
  5235. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  5236. function duration_add_subtract__subtract (input, value) {
  5237. return duration_add_subtract__addSubtract(this, input, value, -1);
  5238. }
  5239. function absCeil (number) {
  5240. if (number < 0) {
  5241. return Math.floor(number);
  5242. } else {
  5243. return Math.ceil(number);
  5244. }
  5245. }
  5246. function bubble () {
  5247. var milliseconds = this._milliseconds;
  5248. var days = this._days;
  5249. var months = this._months;
  5250. var data = this._data;
  5251. var seconds, minutes, hours, years, monthsFromDays;
  5252. // if we have a mix of positive and negative values, bubble down first
  5253. // check: https://github.com/moment/moment/issues/2166
  5254. if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
  5255. (milliseconds <= 0 && days <= 0 && months <= 0))) {
  5256. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  5257. days = 0;
  5258. months = 0;
  5259. }
  5260. // The following code bubbles up values, see the tests for
  5261. // examples of what that means.
  5262. data.milliseconds = milliseconds % 1000;
  5263. seconds = absFloor(milliseconds / 1000);
  5264. data.seconds = seconds % 60;
  5265. minutes = absFloor(seconds / 60);
  5266. data.minutes = minutes % 60;
  5267. hours = absFloor(minutes / 60);
  5268. data.hours = hours % 24;
  5269. days += absFloor(hours / 24);
  5270. // convert days to months
  5271. monthsFromDays = absFloor(daysToMonths(days));
  5272. months += monthsFromDays;
  5273. days -= absCeil(monthsToDays(monthsFromDays));
  5274. // 12 months -> 1 year
  5275. years = absFloor(months / 12);
  5276. months %= 12;
  5277. data.days = days;
  5278. data.months = months;
  5279. data.years = years;
  5280. return this;
  5281. }
  5282. function daysToMonths (days) {
  5283. // 400 years have 146097 days (taking into account leap year rules)
  5284. // 400 years have 12 months === 4800
  5285. return days * 4800 / 146097;
  5286. }
  5287. function monthsToDays (months) {
  5288. // the reverse of daysToMonths
  5289. return months * 146097 / 4800;
  5290. }
  5291. function as (units) {
  5292. var days;
  5293. var months;
  5294. var milliseconds = this._milliseconds;
  5295. units = normalizeUnits(units);
  5296. if (units === 'month' || units === 'year') {
  5297. days = this._days + milliseconds / 864e5;
  5298. months = this._months + daysToMonths(days);
  5299. return units === 'month' ? months : months / 12;
  5300. } else {
  5301. // handle milliseconds separately because of floating point math errors (issue #1867)
  5302. days = this._days + Math.round(monthsToDays(this._months));
  5303. switch (units) {
  5304. case 'week' : return days / 7 + milliseconds / 6048e5;
  5305. case 'day' : return days + milliseconds / 864e5;
  5306. case 'hour' : return days * 24 + milliseconds / 36e5;
  5307. case 'minute' : return days * 1440 + milliseconds / 6e4;
  5308. case 'second' : return days * 86400 + milliseconds / 1000;
  5309. // Math.floor prevents floating point math errors here
  5310. case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
  5311. default: throw new Error('Unknown unit ' + units);
  5312. }
  5313. }
  5314. }
  5315. // TODO: Use this.as('ms')?
  5316. function duration_as__valueOf () {
  5317. return (
  5318. this._milliseconds +
  5319. this._days * 864e5 +
  5320. (this._months % 12) * 2592e6 +
  5321. toInt(this._months / 12) * 31536e6
  5322. );
  5323. }
  5324. function makeAs (alias) {
  5325. return function () {
  5326. return this.as(alias);
  5327. };
  5328. }
  5329. var asMilliseconds = makeAs('ms');
  5330. var asSeconds = makeAs('s');
  5331. var asMinutes = makeAs('m');
  5332. var asHours = makeAs('h');
  5333. var asDays = makeAs('d');
  5334. var asWeeks = makeAs('w');
  5335. var asMonths = makeAs('M');
  5336. var asYears = makeAs('y');
  5337. function duration_get__get (units) {
  5338. units = normalizeUnits(units);
  5339. return this[units + 's']();
  5340. }
  5341. function makeGetter(name) {
  5342. return function () {
  5343. return this._data[name];
  5344. };
  5345. }
  5346. var milliseconds = makeGetter('milliseconds');
  5347. var seconds = makeGetter('seconds');
  5348. var minutes = makeGetter('minutes');
  5349. var hours = makeGetter('hours');
  5350. var days = makeGetter('days');
  5351. var months = makeGetter('months');
  5352. var years = makeGetter('years');
  5353. function weeks () {
  5354. return absFloor(this.days() / 7);
  5355. }
  5356. var round = Math.round;
  5357. var thresholds = {
  5358. s: 45, // seconds to minute
  5359. m: 45, // minutes to hour
  5360. h: 22, // hours to day
  5361. d: 26, // days to month
  5362. M: 11 // months to year
  5363. };
  5364. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  5365. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  5366. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  5367. }
  5368. function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {
  5369. var duration = create__createDuration(posNegDuration).abs();
  5370. var seconds = round(duration.as('s'));
  5371. var minutes = round(duration.as('m'));
  5372. var hours = round(duration.as('h'));
  5373. var days = round(duration.as('d'));
  5374. var months = round(duration.as('M'));
  5375. var years = round(duration.as('y'));
  5376. var a = seconds < thresholds.s && ['s', seconds] ||
  5377. minutes <= 1 && ['m'] ||
  5378. minutes < thresholds.m && ['mm', minutes] ||
  5379. hours <= 1 && ['h'] ||
  5380. hours < thresholds.h && ['hh', hours] ||
  5381. days <= 1 && ['d'] ||
  5382. days < thresholds.d && ['dd', days] ||
  5383. months <= 1 && ['M'] ||
  5384. months < thresholds.M && ['MM', months] ||
  5385. years <= 1 && ['y'] || ['yy', years];
  5386. a[2] = withoutSuffix;
  5387. a[3] = +posNegDuration > 0;
  5388. a[4] = locale;
  5389. return substituteTimeAgo.apply(null, a);
  5390. }
  5391. // This function allows you to set the rounding function for relative time strings
  5392. function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {
  5393. if (roundingFunction === undefined) {
  5394. return round;
  5395. }
  5396. if (typeof(roundingFunction) === 'function') {
  5397. round = roundingFunction;
  5398. return true;
  5399. }
  5400. return false;
  5401. }
  5402. // This function allows you to set a threshold for relative time strings
  5403. function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {
  5404. if (thresholds[threshold] === undefined) {
  5405. return false;
  5406. }
  5407. if (limit === undefined) {
  5408. return thresholds[threshold];
  5409. }
  5410. thresholds[threshold] = limit;
  5411. return true;
  5412. }
  5413. function humanize (withSuffix) {
  5414. var locale = this.localeData();
  5415. var output = duration_humanize__relativeTime(this, !withSuffix, locale);
  5416. if (withSuffix) {
  5417. output = locale.pastFuture(+this, output);
  5418. }
  5419. return locale.postformat(output);
  5420. }
  5421. var iso_string__abs = Math.abs;
  5422. function iso_string__toISOString() {
  5423. // for ISO strings we do not use the normal bubbling rules:
  5424. // * milliseconds bubble up until they become hours
  5425. // * days do not bubble at all
  5426. // * months bubble up until they become years
  5427. // This is because there is no context-free conversion between hours and days
  5428. // (think of clock changes)
  5429. // and also not between days and months (28-31 days per month)
  5430. var seconds = iso_string__abs(this._milliseconds) / 1000;
  5431. var days = iso_string__abs(this._days);
  5432. var months = iso_string__abs(this._months);
  5433. var minutes, hours, years;
  5434. // 3600 seconds -> 60 minutes -> 1 hour
  5435. minutes = absFloor(seconds / 60);
  5436. hours = absFloor(minutes / 60);
  5437. seconds %= 60;
  5438. minutes %= 60;
  5439. // 12 months -> 1 year
  5440. years = absFloor(months / 12);
  5441. months %= 12;
  5442. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  5443. var Y = years;
  5444. var M = months;
  5445. var D = days;
  5446. var h = hours;
  5447. var m = minutes;
  5448. var s = seconds;
  5449. var total = this.asSeconds();
  5450. if (!total) {
  5451. // this is the same as C#'s (Noda) and python (isodate)...
  5452. // but not other JS (goog.date)
  5453. return 'P0D';
  5454. }
  5455. return (total < 0 ? '-' : '') +
  5456. 'P' +
  5457. (Y ? Y + 'Y' : '') +
  5458. (M ? M + 'M' : '') +
  5459. (D ? D + 'D' : '') +
  5460. ((h || m || s) ? 'T' : '') +
  5461. (h ? h + 'H' : '') +
  5462. (m ? m + 'M' : '') +
  5463. (s ? s + 'S' : '');
  5464. }
  5465. var duration_prototype__proto = Duration.prototype;
  5466. duration_prototype__proto.abs = duration_abs__abs;
  5467. duration_prototype__proto.add = duration_add_subtract__add;
  5468. duration_prototype__proto.subtract = duration_add_subtract__subtract;
  5469. duration_prototype__proto.as = as;
  5470. duration_prototype__proto.asMilliseconds = asMilliseconds;
  5471. duration_prototype__proto.asSeconds = asSeconds;
  5472. duration_prototype__proto.asMinutes = asMinutes;
  5473. duration_prototype__proto.asHours = asHours;
  5474. duration_prototype__proto.asDays = asDays;
  5475. duration_prototype__proto.asWeeks = asWeeks;
  5476. duration_prototype__proto.asMonths = asMonths;
  5477. duration_prototype__proto.asYears = asYears;
  5478. duration_prototype__proto.valueOf = duration_as__valueOf;
  5479. duration_prototype__proto._bubble = bubble;
  5480. duration_prototype__proto.get = duration_get__get;
  5481. duration_prototype__proto.milliseconds = milliseconds;
  5482. duration_prototype__proto.seconds = seconds;
  5483. duration_prototype__proto.minutes = minutes;
  5484. duration_prototype__proto.hours = hours;
  5485. duration_prototype__proto.days = days;
  5486. duration_prototype__proto.weeks = weeks;
  5487. duration_prototype__proto.months = months;
  5488. duration_prototype__proto.years = years;
  5489. duration_prototype__proto.humanize = humanize;
  5490. duration_prototype__proto.toISOString = iso_string__toISOString;
  5491. duration_prototype__proto.toString = iso_string__toISOString;
  5492. duration_prototype__proto.toJSON = iso_string__toISOString;
  5493. duration_prototype__proto.locale = locale;
  5494. duration_prototype__proto.localeData = localeData;
  5495. // Deprecations
  5496. duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);
  5497. duration_prototype__proto.lang = lang;
  5498. // Side effect imports
  5499. // FORMATTING
  5500. addFormatToken('X', 0, 0, 'unix');
  5501. addFormatToken('x', 0, 0, 'valueOf');
  5502. // PARSING
  5503. addRegexToken('x', matchSigned);
  5504. addRegexToken('X', matchTimestamp);
  5505. addParseToken('X', function (input, array, config) {
  5506. config._d = new Date(parseFloat(input, 10) * 1000);
  5507. });
  5508. addParseToken('x', function (input, array, config) {
  5509. config._d = new Date(toInt(input));
  5510. });
  5511. // Side effect imports
  5512. utils_hooks__hooks.version = '2.15.2';
  5513. setHookCallback(local__createLocal);
  5514. utils_hooks__hooks.fn = momentPrototype;
  5515. utils_hooks__hooks.min = min;
  5516. utils_hooks__hooks.max = max;
  5517. utils_hooks__hooks.now = now;
  5518. utils_hooks__hooks.utc = create_utc__createUTC;
  5519. utils_hooks__hooks.unix = moment__createUnix;
  5520. utils_hooks__hooks.months = lists__listMonths;
  5521. utils_hooks__hooks.isDate = isDate;
  5522. utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale;
  5523. utils_hooks__hooks.invalid = valid__createInvalid;
  5524. utils_hooks__hooks.duration = create__createDuration;
  5525. utils_hooks__hooks.isMoment = isMoment;
  5526. utils_hooks__hooks.weekdays = lists__listWeekdays;
  5527. utils_hooks__hooks.parseZone = moment__createInZone;
  5528. utils_hooks__hooks.localeData = locale_locales__getLocale;
  5529. utils_hooks__hooks.isDuration = isDuration;
  5530. utils_hooks__hooks.monthsShort = lists__listMonthsShort;
  5531. utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin;
  5532. utils_hooks__hooks.defineLocale = defineLocale;
  5533. utils_hooks__hooks.updateLocale = updateLocale;
  5534. utils_hooks__hooks.locales = locale_locales__listLocales;
  5535. utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort;
  5536. utils_hooks__hooks.normalizeUnits = normalizeUnits;
  5537. utils_hooks__hooks.relativeTimeRounding = duration_humanize__getSetRelativeTimeRounding;
  5538. utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;
  5539. utils_hooks__hooks.calendarFormat = getCalendarFormat;
  5540. utils_hooks__hooks.prototype = momentPrototype;
  5541. var _moment = utils_hooks__hooks;
  5542. return _moment;
  5543. }));
  5544. define('moment', ['moment/moment'], function (main) { return main; });
  5545. /*
  5546. * css.normalize.js
  5547. *
  5548. * CSS Normalization
  5549. *
  5550. * CSS paths are normalized based on an optional basePath and the RequireJS config
  5551. *
  5552. * Usage:
  5553. * normalize(css, fromBasePath, toBasePath);
  5554. *
  5555. * css: the stylesheet content to normalize
  5556. * fromBasePath: the absolute base path of the css relative to any root (but without ../ backtracking)
  5557. * toBasePath: the absolute new base path of the css relative to the same root
  5558. *
  5559. * Absolute dependencies are left untouched.
  5560. *
  5561. * Urls in the CSS are picked up by regular expressions.
  5562. * These will catch all statements of the form:
  5563. *
  5564. * url(*)
  5565. * url('*')
  5566. * url("*")
  5567. *
  5568. * @import '*'
  5569. * @import "*"
  5570. *
  5571. * (and so also @import url(*) variations)
  5572. *
  5573. * For urls needing normalization
  5574. *
  5575. */
  5576. define('../libs/require-css/normalize',[],function() {
  5577. // regular expression for removing double slashes
  5578. // eg http://www.example.com//my///url/here -> http://www.example.com/my/url/here
  5579. var slashes = /([^:])\/+/g
  5580. var removeDoubleSlashes = function(uri) {
  5581. return uri.replace(slashes, '$1/');
  5582. }
  5583. // given a relative URI, and two absolute base URIs, convert it from one base to another
  5584. var protocolRegEx = /[^\:\/]*:\/\/([^\/])*/;
  5585. var absUrlRegEx = /^(\/|data:)/;
  5586. function convertURIBase(uri, fromBase, toBase) {
  5587. if (uri.match(absUrlRegEx) || uri.match(protocolRegEx))
  5588. return uri;
  5589. uri = removeDoubleSlashes(uri);
  5590. // if toBase specifies a protocol path, ensure this is the same protocol as fromBase, if not
  5591. // use absolute path at fromBase
  5592. var toBaseProtocol = toBase.match(protocolRegEx);
  5593. var fromBaseProtocol = fromBase.match(protocolRegEx);
  5594. if (fromBaseProtocol && (!toBaseProtocol || toBaseProtocol[1] != fromBaseProtocol[1] || toBaseProtocol[2] != fromBaseProtocol[2]))
  5595. return absoluteURI(uri, fromBase);
  5596. else {
  5597. return relativeURI(absoluteURI(uri, fromBase), toBase);
  5598. }
  5599. };
  5600. // given a relative URI, calculate the absolute URI
  5601. function absoluteURI(uri, base) {
  5602. if (uri.substr(0, 2) == './')
  5603. uri = uri.substr(2);
  5604. // absolute urls are left in tact
  5605. if (uri.match(absUrlRegEx) || uri.match(protocolRegEx))
  5606. return uri;
  5607. var baseParts = base.split('/');
  5608. var uriParts = uri.split('/');
  5609. baseParts.pop();
  5610. while (curPart = uriParts.shift())
  5611. if (curPart == '..')
  5612. baseParts.pop();
  5613. else
  5614. baseParts.push(curPart);
  5615. return baseParts.join('/');
  5616. };
  5617. // given an absolute URI, calculate the relative URI
  5618. function relativeURI(uri, base) {
  5619. // reduce base and uri strings to just their difference string
  5620. var baseParts = base.split('/');
  5621. baseParts.pop();
  5622. base = baseParts.join('/') + '/';
  5623. i = 0;
  5624. while (base.substr(i, 1) == uri.substr(i, 1))
  5625. i++;
  5626. while (base.substr(i, 1) != '/')
  5627. i--;
  5628. base = base.substr(i + 1);
  5629. uri = uri.substr(i + 1);
  5630. // each base folder difference is thus a backtrack
  5631. baseParts = base.split('/');
  5632. var uriParts = uri.split('/');
  5633. out = '';
  5634. while (baseParts.shift())
  5635. out += '../';
  5636. // finally add uri parts
  5637. while (curPart = uriParts.shift())
  5638. out += curPart + '/';
  5639. return out.substr(0, out.length - 1);
  5640. };
  5641. var normalizeCSS = function(source, fromBase, toBase) {
  5642. fromBase = removeDoubleSlashes(fromBase);
  5643. toBase = removeDoubleSlashes(toBase);
  5644. var urlRegEx = /@import\s*("([^"]*)"|'([^']*)')|url\s*\((?!#)\s*(\s*"([^"]*)"|'([^']*)'|[^\)]*\s*)\s*\)/ig;
  5645. var result, url, source;
  5646. while (result = urlRegEx.exec(source)) {
  5647. url = result[3] || result[2] || result[5] || result[6] || result[4];
  5648. var newUrl;
  5649. newUrl = convertURIBase(url, fromBase, toBase);
  5650. var quoteLen = result[5] || result[6] ? 1 : 0;
  5651. source = source.substr(0, urlRegEx.lastIndex - url.length - quoteLen - 1) + newUrl + source.substr(urlRegEx.lastIndex - quoteLen - 1);
  5652. urlRegEx.lastIndex = urlRegEx.lastIndex + (newUrl.length - url.length);
  5653. }
  5654. return source;
  5655. };
  5656. normalizeCSS.convertURIBase = convertURIBase;
  5657. normalizeCSS.absoluteURI = absoluteURI;
  5658. normalizeCSS.relativeURI = relativeURI;
  5659. return normalizeCSS;
  5660. });
  5661. ;
  5662. define('../libs/require-css/css.min!../libs/bootstrap-table/dist/bootstrap-table.min',[],function(){});
  5663. /*
  5664. * bootstrap-table - v1.11.0 - 2016-07-02
  5665. * https://github.com/wenzhixin/bootstrap-table
  5666. * Copyright (c) 2016 zhixin wen
  5667. * Licensed MIT License
  5668. */
  5669. !function(a){"use strict";var b=null,c=function(a){var b=arguments,c=!0,d=1;return a=a.replace(/%s/g,function(){var a=b[d++];return"undefined"==typeof a?(c=!1,""):a}),c?a:""},d=function(b,c,d,e){var f="";return a.each(b,function(a,b){return b[c]===e?(f=b[d],!1):!0}),f},e=function(b,c){var d=-1;return a.each(b,function(a,b){return b.field===c?(d=a,!1):!0}),d},f=function(b){var c,d,e,f=0,g=[];for(c=0;c<b[0].length;c++)f+=b[0][c].colspan||1;for(c=0;c<b.length;c++)for(g[c]=[],d=0;f>d;d++)g[c][d]=!1;for(c=0;c<b.length;c++)for(d=0;d<b[c].length;d++){var h=b[c][d],i=h.rowspan||1,j=h.colspan||1,k=a.inArray(!1,g[c]);for(1===j&&(h.fieldIndex=k,"undefined"==typeof h.field&&(h.field=k)),e=0;i>e;e++)g[c+e][k]=!0;for(e=0;j>e;e++)g[c][k+e]=!0}},g=function(){if(null===b){var c,d,e=a("<p/>").addClass("fixed-table-scroll-inner"),f=a("<div/>").addClass("fixed-table-scroll-outer");f.append(e),a("body").append(f),c=e[0].offsetWidth,f.css("overflow","scroll"),d=e[0].offsetWidth,c===d&&(d=f[0].clientWidth),f.remove(),b=c-d}return b},h=function(b,d,e,f){var g=d;if("string"==typeof d){var h=d.split(".");h.length>1?(g=window,a.each(h,function(a,b){g=g[b]})):g=window[d]}return"object"==typeof g?g:"function"==typeof g?g.apply(b,e):!g&&"string"==typeof d&&c.apply(this,[d].concat(e))?c.apply(this,[d].concat(e)):f},i=function(b,c,d){var e=Object.getOwnPropertyNames(b),f=Object.getOwnPropertyNames(c),g="";if(d&&e.length!==f.length)return!1;for(var h=0;h<e.length;h++)if(g=e[h],a.inArray(g,f)>-1&&b[g]!==c[g])return!1;return!0},j=function(a){return"string"==typeof a?a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/`/g,"&#x60;"):a},k=function(b){var c=0;return b.children().each(function(){c<a(this).outerHeight(!0)&&(c=a(this).outerHeight(!0))}),c},l=function(a){for(var b in a){var c=b.split(/(?=[A-Z])/).join("-").toLowerCase();c!==b&&(a[c]=a[b],delete a[b])}return a},m=function(a,b,c){var d=a;if("string"!=typeof b||a.hasOwnProperty(b))return c?j(a[b]):a[b];var e=b.split(".");for(var f in e)d=d&&d[e[f]];return c?j(d):d},n=function(){return!!(navigator.userAgent.indexOf("MSIE ")>0||navigator.userAgent.match(/Trident.*rv\:11\./))},o=function(){Object.keys||(Object.keys=function(){var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=c.length;return function(e){if("object"!=typeof e&&("function"!=typeof e||null===e))throw new TypeError("Object.keys called on non-object");var f,g,h=[];for(f in e)a.call(e,f)&&h.push(f);if(b)for(g=0;d>g;g++)a.call(e,c[g])&&h.push(c[g]);return h}}())},p=function(b,c){this.options=c,this.$el=a(b),this.$el_=this.$el.clone(),this.timeoutId_=0,this.timeoutFooter_=0,this.init()};p.DEFAULTS={classes:"table table-hover",locale:void 0,height:void 0,undefinedText:"-",sortName:void 0,sortOrder:"asc",sortStable:!1,striped:!1,columns:[[]],data:[],dataField:"rows",method:"get",url:void 0,ajax:void 0,cache:!0,contentType:"application/json",dataType:"json",ajaxOptions:{},queryParams:function(a){return a},queryParamsType:"limit",responseHandler:function(a){return a},pagination:!1,onlyInfoPagination:!1,sidePagination:"client",totalRows:0,pageNumber:1,pageSize:10,pageList:[10,25,50,100],paginationHAlign:"right",paginationVAlign:"bottom",paginationDetailHAlign:"left",paginationPreText:"&lsaquo;",paginationNextText:"&rsaquo;",search:!1,searchOnEnterKey:!1,strictSearch:!1,searchAlign:"right",selectItemName:"btSelectItem",showHeader:!0,showFooter:!1,showColumns:!1,showPaginationSwitch:!1,showRefresh:!1,showToggle:!1,buttonsAlign:"right",smartDisplay:!0,escape:!1,minimumCountColumns:1,idField:void 0,uniqueId:void 0,cardView:!1,detailView:!1,detailFormatter:function(){return""},trimOnSearch:!0,clickToSelect:!1,singleSelect:!1,toolbar:void 0,toolbarAlign:"left",checkboxHeader:!0,sortable:!0,silentSort:!0,maintainSelected:!1,searchTimeOut:500,searchText:"",iconSize:void 0,buttonsClass:"default",iconsPrefix:"glyphicon",icons:{paginationSwitchDown:"glyphicon-collapse-down icon-chevron-down",paginationSwitchUp:"glyphicon-collapse-up icon-chevron-up",refresh:"glyphicon-refresh icon-refresh",toggle:"glyphicon-list-alt icon-list-alt",columns:"glyphicon-th icon-th",detailOpen:"glyphicon-plus icon-plus",detailClose:"glyphicon-minus icon-minus"},customSearch:a.noop,customSort:a.noop,rowStyle:function(){return{}},rowAttributes:function(){return{}},footerStyle:function(){return{}},onAll:function(){return!1},onClickCell:function(){return!1},onDblClickCell:function(){return!1},onClickRow:function(){return!1},onDblClickRow:function(){return!1},onSort:function(){return!1},onCheck:function(){return!1},onUncheck:function(){return!1},onCheckAll:function(){return!1},onUncheckAll:function(){return!1},onCheckSome:function(){return!1},onUncheckSome:function(){return!1},onLoadSuccess:function(){return!1},onLoadError:function(){return!1},onColumnSwitch:function(){return!1},onPageChange:function(){return!1},onSearch:function(){return!1},onToggle:function(){return!1},onPreBody:function(){return!1},onPostBody:function(){return!1},onPostHeader:function(){return!1},onExpandRow:function(){return!1},onCollapseRow:function(){return!1},onRefreshOptions:function(){return!1},onRefresh:function(){return!1},onResetView:function(){return!1}},p.LOCALES={},p.LOCALES["en-US"]=p.LOCALES.en={formatLoadingMessage:function(){return"Loading, please wait..."},formatRecordsPerPage:function(a){return c("%s rows per page",a)},formatShowingRows:function(a,b,d){return c("Showing %s to %s of %s rows",a,b,d)},formatDetailPagination:function(a){return c("Showing %s rows",a)},formatSearch:function(){return"Search"},formatNoMatches:function(){return"No matching records found"},formatPaginationSwitch:function(){return"Hide/Show pagination"},formatRefresh:function(){return"Refresh"},formatToggle:function(){return"Toggle"},formatColumns:function(){return"Columns"},formatAllRows:function(){return"All"}},a.extend(p.DEFAULTS,p.LOCALES["en-US"]),p.COLUMN_DEFAULTS={radio:!1,checkbox:!1,checkboxEnabled:!0,field:void 0,title:void 0,titleTooltip:void 0,"class":void 0,align:void 0,halign:void 0,falign:void 0,valign:void 0,width:void 0,sortable:!1,order:"asc",visible:!0,switchable:!0,clickToSelect:!0,formatter:void 0,footerFormatter:void 0,events:void 0,sorter:void 0,sortName:void 0,cellStyle:void 0,searchable:!0,searchFormatter:!0,cardVisible:!0},p.EVENTS={"all.bs.table":"onAll","click-cell.bs.table":"onClickCell","dbl-click-cell.bs.table":"onDblClickCell","click-row.bs.table":"onClickRow","dbl-click-row.bs.table":"onDblClickRow","sort.bs.table":"onSort","check.bs.table":"onCheck","uncheck.bs.table":"onUncheck","check-all.bs.table":"onCheckAll","uncheck-all.bs.table":"onUncheckAll","check-some.bs.table":"onCheckSome","uncheck-some.bs.table":"onUncheckSome","load-success.bs.table":"onLoadSuccess","load-error.bs.table":"onLoadError","column-switch.bs.table":"onColumnSwitch","page-change.bs.table":"onPageChange","search.bs.table":"onSearch","toggle.bs.table":"onToggle","pre-body.bs.table":"onPreBody","post-body.bs.table":"onPostBody","post-header.bs.table":"onPostHeader","expand-row.bs.table":"onExpandRow","collapse-row.bs.table":"onCollapseRow","refresh-options.bs.table":"onRefreshOptions","reset-view.bs.table":"onResetView","refresh.bs.table":"onRefresh"},p.prototype.init=function(){this.initLocale(),this.initContainer(),this.initTable(),this.initHeader(),this.initData(),this.initFooter(),this.initToolbar(),this.initPagination(),this.initBody(),this.initSearchText(),this.initServer()},p.prototype.initLocale=function(){if(this.options.locale){var b=this.options.locale.split(/-|_/);b[0].toLowerCase(),b[1]&&b[1].toUpperCase(),a.fn.bootstrapTable.locales[this.options.locale]?a.extend(this.options,a.fn.bootstrapTable.locales[this.options.locale]):a.fn.bootstrapTable.locales[b.join("-")]?a.extend(this.options,a.fn.bootstrapTable.locales[b.join("-")]):a.fn.bootstrapTable.locales[b[0]]&&a.extend(this.options,a.fn.bootstrapTable.locales[b[0]])}},p.prototype.initContainer=function(){this.$container=a(['<div class="bootstrap-table">','<div class="fixed-table-toolbar"></div>',"top"===this.options.paginationVAlign||"both"===this.options.paginationVAlign?'<div class="fixed-table-pagination" style="clear: both;"></div>':"",'<div class="fixed-table-container">','<div class="fixed-table-header"><table></table></div>','<div class="fixed-table-body">','<div class="fixed-table-loading">',this.options.formatLoadingMessage(),"</div>","</div>",'<div class="fixed-table-footer"><table><tr></tr></table></div>',"bottom"===this.options.paginationVAlign||"both"===this.options.paginationVAlign?'<div class="fixed-table-pagination"></div>':"","</div>","</div>"].join("")),this.$container.insertAfter(this.$el),this.$tableContainer=this.$container.find(".fixed-table-container"),this.$tableHeader=this.$container.find(".fixed-table-header"),this.$tableBody=this.$container.find(".fixed-table-body"),this.$tableLoading=this.$container.find(".fixed-table-loading"),this.$tableFooter=this.$container.find(".fixed-table-footer"),this.$toolbar=this.$container.find(".fixed-table-toolbar"),this.$pagination=this.$container.find(".fixed-table-pagination"),this.$tableBody.append(this.$el),this.$container.after('<div class="clearfix"></div>'),this.$el.addClass(this.options.classes),this.options.striped&&this.$el.addClass("table-striped"),-1!==a.inArray("table-no-bordered",this.options.classes.split(" "))&&this.$tableContainer.addClass("table-no-bordered")},p.prototype.initTable=function(){var b=this,c=[],d=[];if(this.$header=this.$el.find(">thead"),this.$header.length||(this.$header=a("<thead></thead>").appendTo(this.$el)),this.$header.find("tr").each(function(){var b=[];a(this).find("th").each(function(){"undefined"!=typeof a(this).data("field")&&a(this).data("field",a(this).data("field")+""),b.push(a.extend({},{title:a(this).html(),"class":a(this).attr("class"),titleTooltip:a(this).attr("title"),rowspan:a(this).attr("rowspan")?+a(this).attr("rowspan"):void 0,colspan:a(this).attr("colspan")?+a(this).attr("colspan"):void 0},a(this).data()))}),c.push(b)}),a.isArray(this.options.columns[0])||(this.options.columns=[this.options.columns]),this.options.columns=a.extend(!0,[],c,this.options.columns),this.columns=[],f(this.options.columns),a.each(this.options.columns,function(c,d){a.each(d,function(d,e){e=a.extend({},p.COLUMN_DEFAULTS,e),"undefined"!=typeof e.fieldIndex&&(b.columns[e.fieldIndex]=e),b.options.columns[c][d]=e})}),!this.options.data.length){var e=[];this.$el.find(">tbody>tr").each(function(c){var f={};f._id=a(this).attr("id"),f._class=a(this).attr("class"),f._data=l(a(this).data()),a(this).find(">td").each(function(d){for(var g,h,i=a(this),j=+i.attr("colspan")||1,k=+i.attr("rowspan")||1;e[c]&&e[c][d];d++);for(g=d;d+j>g;g++)for(h=c;c+k>h;h++)e[h]||(e[h]=[]),e[h][g]=!0;var m=b.columns[d].field;f[m]=a(this).html(),f["_"+m+"_id"]=a(this).attr("id"),f["_"+m+"_class"]=a(this).attr("class"),f["_"+m+"_rowspan"]=a(this).attr("rowspan"),f["_"+m+"_colspan"]=a(this).attr("colspan"),f["_"+m+"_title"]=a(this).attr("title"),f["_"+m+"_data"]=l(a(this).data())}),d.push(f)}),this.options.data=d,d.length&&(this.fromHtml=!0)}},p.prototype.initHeader=function(){var b=this,d={},e=[];this.header={fields:[],styles:[],classes:[],formatters:[],events:[],sorters:[],sortNames:[],cellStyles:[],searchables:[]},a.each(this.options.columns,function(f,g){e.push("<tr>"),0===f&&!b.options.cardView&&b.options.detailView&&e.push(c('<th class="detail" rowspan="%s"><div class="fht-cell"></div></th>',b.options.columns.length)),a.each(g,function(a,f){var g="",h="",i="",j="",k=c(' class="%s"',f["class"]),l=(b.options.sortOrder||f.order,"px"),m=f.width;if(void 0===f.width||b.options.cardView||"string"==typeof f.width&&-1!==f.width.indexOf("%")&&(l="%"),f.width&&"string"==typeof f.width&&(m=f.width.replace("%","").replace("px","")),h=c("text-align: %s; ",f.halign?f.halign:f.align),i=c("text-align: %s; ",f.align),j=c("vertical-align: %s; ",f.valign),j+=c("width: %s; ",!f.checkbox&&!f.radio||m?m?m+l:void 0:"36px"),"undefined"!=typeof f.fieldIndex){if(b.header.fields[f.fieldIndex]=f.field,b.header.styles[f.fieldIndex]=i+j,b.header.classes[f.fieldIndex]=k,b.header.formatters[f.fieldIndex]=f.formatter,b.header.events[f.fieldIndex]=f.events,b.header.sorters[f.fieldIndex]=f.sorter,b.header.sortNames[f.fieldIndex]=f.sortName,b.header.cellStyles[f.fieldIndex]=f.cellStyle,b.header.searchables[f.fieldIndex]=f.searchable,!f.visible)return;if(b.options.cardView&&!f.cardVisible)return;d[f.field]=f}e.push("<th"+c(' title="%s"',f.titleTooltip),f.checkbox||f.radio?c(' class="bs-checkbox %s"',f["class"]||""):k,c(' style="%s"',h+j),c(' rowspan="%s"',f.rowspan),c(' colspan="%s"',f.colspan),c(' data-field="%s"',f.field),"tabindex='0'",">"),e.push(c('<div class="th-inner %s">',b.options.sortable&&f.sortable?"sortable both":"")),g=f.title,f.checkbox&&(!b.options.singleSelect&&b.options.checkboxHeader&&(g='<input name="btSelectAll" type="checkbox" />'),b.header.stateField=f.field),f.radio&&(g="",b.header.stateField=f.field,b.options.singleSelect=!0),e.push(g),e.push("</div>"),e.push('<div class="fht-cell"></div>'),e.push("</div>"),e.push("</th>")}),e.push("</tr>")}),this.$header.html(e.join("")),this.$header.find("th[data-field]").each(function(){a(this).data(d[a(this).data("field")])}),this.$container.off("click",".th-inner").on("click",".th-inner",function(c){var d=a(this);return b.options.detailView&&d.closest(".bootstrap-table")[0]!==b.$container[0]?!1:void(b.options.sortable&&d.parent().data().sortable&&b.onSort(c))}),this.$header.children().children().off("keypress").on("keypress",function(c){if(b.options.sortable&&a(this).data().sortable){var d=c.keyCode||c.which;13==d&&b.onSort(c)}}),a(window).off("resize.bootstrap-table"),!this.options.showHeader||this.options.cardView?(this.$header.hide(),this.$tableHeader.hide(),this.$tableLoading.css("top",0)):(this.$header.show(),this.$tableHeader.show(),this.$tableLoading.css("top",this.$header.outerHeight()+1),this.getCaret(),a(window).on("resize.bootstrap-table",a.proxy(this.resetWidth,this))),this.$selectAll=this.$header.find('[name="btSelectAll"]'),this.$selectAll.off("click").on("click",function(){var c=a(this).prop("checked");b[c?"checkAll":"uncheckAll"](),b.updateSelected()})},p.prototype.initFooter=function(){!this.options.showFooter||this.options.cardView?this.$tableFooter.hide():this.$tableFooter.show()},p.prototype.initData=function(a,b){this.data="append"===b?this.data.concat(a):"prepend"===b?[].concat(a).concat(this.data):a||this.options.data,this.options.data="append"===b?this.options.data.concat(a):"prepend"===b?[].concat(a).concat(this.options.data):this.data,"server"!==this.options.sidePagination&&this.initSort()},p.prototype.initSort=function(){var b=this,c=this.options.sortName,d="desc"===this.options.sortOrder?-1:1,e=a.inArray(this.options.sortName,this.header.fields);return this.options.customSort!==a.noop?void this.options.customSort.apply(this,[this.options.sortName,this.options.sortOrder]):void(-1!==e&&(this.options.sortStable&&a.each(this.data,function(a,b){b.hasOwnProperty("_position")||(b._position=a)}),this.data.sort(function(f,g){b.header.sortNames[e]&&(c=b.header.sortNames[e]);var i=m(f,c,b.options.escape),j=m(g,c,b.options.escape),k=h(b.header,b.header.sorters[e],[i,j]);return void 0!==k?d*k:((void 0===i||null===i)&&(i=""),(void 0===j||null===j)&&(j=""),b.options.sortStable&&i===j&&(i=f._position,j=g._position),a.isNumeric(i)&&a.isNumeric(j)?(i=parseFloat(i),j=parseFloat(j),j>i?-1*d:d):i===j?0:("string"!=typeof i&&(i=i.toString()),-1===i.localeCompare(j)?-1*d:d))})))},p.prototype.onSort=function(b){var c="keypress"===b.type?a(b.currentTarget):a(b.currentTarget).parent(),d=this.$header.find("th").eq(c.index());return this.$header.add(this.$header_).find("span.order").remove(),this.options.sortName===c.data("field")?this.options.sortOrder="asc"===this.options.sortOrder?"desc":"asc":(this.options.sortName=c.data("field"),this.options.sortOrder="asc"===c.data("order")?"desc":"asc"),this.trigger("sort",this.options.sortName,this.options.sortOrder),c.add(d).data("order",this.options.sortOrder),this.getCaret(),"server"===this.options.sidePagination?void this.initServer(this.options.silentSort):(this.initSort(),void this.initBody())},p.prototype.initToolbar=function(){var b,d,e=this,f=[],g=0,i=0;this.$toolbar.find(".bs-bars").children().length&&a("body").append(a(this.options.toolbar)),this.$toolbar.html(""),("string"==typeof this.options.toolbar||"object"==typeof this.options.toolbar)&&a(c('<div class="bs-bars pull-%s"></div>',this.options.toolbarAlign)).appendTo(this.$toolbar).append(a(this.options.toolbar)),f=[c('<div class="columns columns-%s btn-group pull-%s">',this.options.buttonsAlign,this.options.buttonsAlign)],"string"==typeof this.options.icons&&(this.options.icons=h(null,this.options.icons)),this.options.showPaginationSwitch&&f.push(c('<button class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+'" type="button" name="paginationSwitch" title="%s">',this.options.formatPaginationSwitch()),c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.paginationSwitchDown),"</button>"),this.options.showRefresh&&f.push(c('<button class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+'" type="button" name="refresh" title="%s">',this.options.formatRefresh()),c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.refresh),"</button>"),this.options.showToggle&&f.push(c('<button class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+'" type="button" name="toggle" title="%s">',this.options.formatToggle()),c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.toggle),"</button>"),this.options.showColumns&&(f.push(c('<div class="keep-open btn-group" title="%s">',this.options.formatColumns()),'<button type="button" class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+' dropdown-toggle" data-toggle="dropdown">',c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.columns),' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">'),a.each(this.columns,function(a,b){if(!(b.radio||b.checkbox||e.options.cardView&&!b.cardVisible)){var d=b.visible?' checked="checked"':"";b.switchable&&(f.push(c('<li><label><input type="checkbox" data-field="%s" value="%s"%s> %s</label></li>',b.field,a,d,b.title)),i++)}}),f.push("</ul>","</div>")),f.push("</div>"),(this.showToolbar||f.length>2)&&this.$toolbar.append(f.join("")),this.options.showPaginationSwitch&&this.$toolbar.find('button[name="paginationSwitch"]').off("click").on("click",a.proxy(this.togglePagination,this)),this.options.showRefresh&&this.$toolbar.find('button[name="refresh"]').off("click").on("click",a.proxy(this.refresh,this)),this.options.showToggle&&this.$toolbar.find('button[name="toggle"]').off("click").on("click",function(){e.toggleView()}),this.options.showColumns&&(b=this.$toolbar.find(".keep-open"),i<=this.options.minimumCountColumns&&b.find("input").prop("disabled",!0),b.find("li").off("click").on("click",function(a){a.stopImmediatePropagation()}),b.find("input").off("click").on("click",function(){var b=a(this);e.toggleColumn(a(this).val(),b.prop("checked"),!1),e.trigger("column-switch",a(this).data("field"),b.prop("checked"))})),this.options.search&&(f=[],f.push('<div class="pull-'+this.options.searchAlign+' search">',c('<input class="form-control'+c(" input-%s",this.options.iconSize)+'" type="text" placeholder="%s">',this.options.formatSearch()),"</div>"),this.$toolbar.append(f.join("")),d=this.$toolbar.find(".search input"),d.off("keyup drop").on("keyup drop",function(b){e.options.searchOnEnterKey&&13!==b.keyCode||a.inArray(b.keyCode,[37,38,39,40])>-1||(clearTimeout(g),g=setTimeout(function(){e.onSearch(b)},e.options.searchTimeOut))}),n()&&d.off("mouseup").on("mouseup",function(a){clearTimeout(g),g=setTimeout(function(){e.onSearch(a)},e.options.searchTimeOut)}))},p.prototype.onSearch=function(b){var c=a.trim(a(b.currentTarget).val());this.options.trimOnSearch&&a(b.currentTarget).val()!==c&&a(b.currentTarget).val(c),c!==this.searchText&&(this.searchText=c,this.options.searchText=c,this.options.pageNumber=1,this.initSearch(),this.updatePagination(),this.trigger("search",c))},p.prototype.initSearch=function(){var b=this;if("server"!==this.options.sidePagination){if(this.options.customSearch!==a.noop)return void this.options.customSearch.apply(this,[this.searchText]);var c=this.searchText&&(this.options.escape?j(this.searchText):this.searchText).toLowerCase(),d=a.isEmptyObject(this.filterColumns)?null:this.filterColumns;this.data=d?a.grep(this.options.data,function(b){for(var c in d)if(a.isArray(d[c])&&-1===a.inArray(b[c],d[c])||b[c]!==d[c])return!1;return!0}):this.options.data,this.data=c?a.grep(this.data,function(d,f){for(var g=0;g<b.header.fields.length;g++)if(b.header.searchables[g]){var i,j=a.isNumeric(b.header.fields[g])?parseInt(b.header.fields[g],10):b.header.fields[g],k=b.columns[e(b.columns,j)];if("string"==typeof j){i=d;for(var l=j.split("."),m=0;m<l.length;m++)i=i[l[m]];k&&k.searchFormatter&&(i=h(k,b.header.formatters[g],[i,d,f],i))}else i=d[j];if("string"==typeof i||"number"==typeof i)if(b.options.strictSearch){if((i+"").toLowerCase()===c)return!0}else if(-1!==(i+"").toLowerCase().indexOf(c))return!0}return!1}):this.data}},p.prototype.initPagination=function(){if(!this.options.pagination)return void this.$pagination.hide();this.$pagination.show();var b,d,e,f,g,h,i,j,k,l=this,m=[],n=!1,o=this.getData(),p=this.options.pageList;if("server"!==this.options.sidePagination&&(this.options.totalRows=o.length),this.totalPages=0,this.options.totalRows){if(this.options.pageSize===this.options.formatAllRows())this.options.pageSize=this.options.totalRows,n=!0;else if(this.options.pageSize===this.options.totalRows){var q="string"==typeof this.options.pageList?this.options.pageList.replace("[","").replace("]","").replace(/ /g,"").toLowerCase().split(","):this.options.pageList;a.inArray(this.options.formatAllRows().toLowerCase(),q)>-1&&(n=!0)}this.totalPages=~~((this.options.totalRows-1)/this.options.pageSize)+1,this.options.totalPages=this.totalPages}if(this.totalPages>0&&this.options.pageNumber>this.totalPages&&(this.options.pageNumber=this.totalPages),this.pageFrom=(this.options.pageNumber-1)*this.options.pageSize+1,this.pageTo=this.options.pageNumber*this.options.pageSize,this.pageTo>this.options.totalRows&&(this.pageTo=this.options.totalRows),m.push('<div class="pull-'+this.options.paginationDetailHAlign+' pagination-detail">','<span class="pagination-info">',this.options.onlyInfoPagination?this.options.formatDetailPagination(this.options.totalRows):this.options.formatShowingRows(this.pageFrom,this.pageTo,this.options.totalRows),"</span>"),!this.options.onlyInfoPagination){m.push('<span class="page-list">');var r=[c('<span class="btn-group %s">',"top"===this.options.paginationVAlign||"both"===this.options.paginationVAlign?"dropdown":"dropup"),'<button type="button" class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+' dropdown-toggle" data-toggle="dropdown">','<span class="page-size">',n?this.options.formatAllRows():this.options.pageSize,"</span>",' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">'];if("string"==typeof this.options.pageList){var s=this.options.pageList.replace("[","").replace("]","").replace(/ /g,"").split(",");p=[],a.each(s,function(a,b){p.push(b.toUpperCase()===l.options.formatAllRows().toUpperCase()?l.options.formatAllRows():+b)})}for(a.each(p,function(a,b){if(!l.options.smartDisplay||0===a||p[a-1]<=l.options.totalRows){var d;d=n?b===l.options.formatAllRows()?' class="active"':"":b===l.options.pageSize?' class="active"':"",r.push(c('<li%s><a href="javascript:void(0)">%s</a></li>',d,b))}}),r.push("</ul></span>"),m.push(this.options.formatRecordsPerPage(r.join(""))),m.push("</span>"),m.push("</div>",'<div class="pull-'+this.options.paginationHAlign+' pagination">','<ul class="pagination'+c(" pagination-%s",this.options.iconSize)+'">','<li class="page-pre"><a href="javascript:void(0)">'+this.options.paginationPreText+"</a></li>"),this.totalPages<5?(d=1,e=this.totalPages):(d=this.options.pageNumber-2,e=d+4,1>d&&(d=1,e=5),e>this.totalPages&&(e=this.totalPages,d=e-4)),this.totalPages>=6&&(this.options.pageNumber>=3&&(m.push('<li class="page-first'+(1===this.options.pageNumber?" active":"")+'">','<a href="javascript:void(0)">',1,"</a>","</li>"),d++),this.options.pageNumber>=4&&(4==this.options.pageNumber||6==this.totalPages||7==this.totalPages?d--:m.push('<li class="page-first-separator disabled">','<a href="javascript:void(0)">...</a>',"</li>"),e--)),this.totalPages>=7&&this.options.pageNumber>=this.totalPages-2&&d--,6==this.totalPages?this.options.pageNumber>=this.totalPages-2&&e++:this.totalPages>=7&&(7==this.totalPages||this.options.pageNumber>=this.totalPages-3)&&e++,b=d;e>=b;b++)m.push('<li class="page-number'+(b===this.options.pageNumber?" active":"")+'">','<a href="javascript:void(0)">',b,"</a>","</li>");this.totalPages>=8&&this.options.pageNumber<=this.totalPages-4&&m.push('<li class="page-last-separator disabled">','<a href="javascript:void(0)">...</a>',"</li>"),this.totalPages>=6&&this.options.pageNumber<=this.totalPages-3&&m.push('<li class="page-last'+(this.totalPages===this.options.pageNumber?" active":"")+'">','<a href="javascript:void(0)">',this.totalPages,"</a>","</li>"),m.push('<li class="page-next"><a href="javascript:void(0)">'+this.options.paginationNextText+"</a></li>","</ul>","</div>")}this.$pagination.html(m.join("")),this.options.onlyInfoPagination||(f=this.$pagination.find(".page-list a"),g=this.$pagination.find(".page-first"),h=this.$pagination.find(".page-pre"),i=this.$pagination.find(".page-next"),j=this.$pagination.find(".page-last"),k=this.$pagination.find(".page-number"),this.options.smartDisplay&&(this.totalPages<=1&&this.$pagination.find("div.pagination").hide(),(p.length<2||this.options.totalRows<=p[0])&&this.$pagination.find("span.page-list").hide(),this.$pagination[this.getData().length?"show":"hide"]()),n&&(this.options.pageSize=this.options.formatAllRows()),f.off("click").on("click",a.proxy(this.onPageListChange,this)),g.off("click").on("click",a.proxy(this.onPageFirst,this)),h.off("click").on("click",a.proxy(this.onPagePre,this)),i.off("click").on("click",a.proxy(this.onPageNext,this)),j.off("click").on("click",a.proxy(this.onPageLast,this)),k.off("click").on("click",a.proxy(this.onPageNumber,this)))},p.prototype.updatePagination=function(b){b&&a(b.currentTarget).hasClass("disabled")||(this.options.maintainSelected||this.resetRows(),this.initPagination(),"server"===this.options.sidePagination?this.initServer():this.initBody(),this.trigger("page-change",this.options.pageNumber,this.options.pageSize))},p.prototype.onPageListChange=function(b){var c=a(b.currentTarget);c.parent().addClass("active").siblings().removeClass("active"),this.options.pageSize=c.text().toUpperCase()===this.options.formatAllRows().toUpperCase()?this.options.formatAllRows():+c.text(),this.$toolbar.find(".page-size").text(this.options.pageSize),this.updatePagination(b)},p.prototype.onPageFirst=function(a){this.options.pageNumber=1,this.updatePagination(a)},p.prototype.onPagePre=function(a){this.options.pageNumber-1===0?this.options.pageNumber=this.options.totalPages:this.options.pageNumber--,this.updatePagination(a)},p.prototype.onPageNext=function(a){this.options.pageNumber+1>this.options.totalPages?this.options.pageNumber=1:this.options.pageNumber++,this.updatePagination(a)},p.prototype.onPageLast=function(a){this.options.pageNumber=this.totalPages,this.updatePagination(a)},p.prototype.onPageNumber=function(b){this.options.pageNumber!==+a(b.currentTarget).text()&&(this.options.pageNumber=+a(b.currentTarget).text(),this.updatePagination(b))},p.prototype.initBody=function(b){var f=this,g=[],i=this.getData();this.trigger("pre-body",i),this.$body=this.$el.find(">tbody"),this.$body.length||(this.$body=a("<tbody></tbody>").appendTo(this.$el)),this.options.pagination&&"server"!==this.options.sidePagination||(this.pageFrom=1,this.pageTo=i.length);for(var k=this.pageFrom-1;k<this.pageTo;k++){var l,n=i[k],o={},p=[],q="",r={},s=[];if(o=h(this.options,this.options.rowStyle,[n,k],o),o&&o.css)for(l in o.css)p.push(l+": "+o.css[l]);if(r=h(this.options,this.options.rowAttributes,[n,k],r))for(l in r)s.push(c('%s="%s"',l,j(r[l])));n._data&&!a.isEmptyObject(n._data)&&a.each(n._data,function(a,b){"index"!==a&&(q+=c(' data-%s="%s"',a,b))}),g.push("<tr",c(" %s",s.join(" ")),c(' id="%s"',a.isArray(n)?void 0:n._id),c(' class="%s"',o.classes||(a.isArray(n)?void 0:n._class)),c(' data-index="%s"',k),c(' data-uniqueid="%s"',n[this.options.uniqueId]),c("%s",q),">"),this.options.cardView&&g.push(c('<td colspan="%s"><div class="card-views">',this.header.fields.length)),!this.options.cardView&&this.options.detailView&&g.push("<td>",'<a class="detail-icon" href="javascript:">',c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.detailOpen),"</a>","</td>"),a.each(this.header.fields,function(b,e){var i="",j=m(n,e,f.options.escape),l="",q={},r="",s=f.header.classes[b],t="",u="",v="",w="",x=f.columns[b];if(!(f.fromHtml&&"undefined"==typeof j||!x.visible||f.options.cardView&&!x.cardVisible)){if(o=c('style="%s"',p.concat(f.header.styles[b]).join("; ")),n["_"+e+"_id"]&&(r=c(' id="%s"',n["_"+e+"_id"])),n["_"+e+"_class"]&&(s=c(' class="%s"',n["_"+e+"_class"])),n["_"+e+"_rowspan"]&&(u=c(' rowspan="%s"',n["_"+e+"_rowspan"])),n["_"+e+"_colspan"]&&(v=c(' colspan="%s"',n["_"+e+"_colspan"])),n["_"+e+"_title"]&&(w=c(' title="%s"',n["_"+e+"_title"])),q=h(f.header,f.header.cellStyles[b],[j,n,k,e],q),q.classes&&(s=c(' class="%s"',q.classes)),q.css){var y=[];for(var z in q.css)y.push(z+": "+q.css[z]);o=c('style="%s"',y.concat(f.header.styles[b]).join("; "))}j=h(x,f.header.formatters[b],[j,n,k],j),n["_"+e+"_data"]&&!a.isEmptyObject(n["_"+e+"_data"])&&a.each(n["_"+e+"_data"],function(a,b){"index"!==a&&(t+=c(' data-%s="%s"',a,b))}),x.checkbox||x.radio?(l=x.checkbox?"checkbox":l,l=x.radio?"radio":l,i=[c(f.options.cardView?'<div class="card-view %s">':'<td class="bs-checkbox %s">',x["class"]||""),"<input"+c(' data-index="%s"',k)+c(' name="%s"',f.options.selectItemName)+c(' type="%s"',l)+c(' value="%s"',n[f.options.idField])+c(' checked="%s"',j===!0||j&&j.checked?"checked":void 0)+c(' disabled="%s"',!x.checkboxEnabled||j&&j.disabled?"disabled":void 0)+" />",f.header.formatters[b]&&"string"==typeof j?j:"",f.options.cardView?"</div>":"</td>"].join(""),n[f.header.stateField]=j===!0||j&&j.checked):(j="undefined"==typeof j||null===j?f.options.undefinedText:j,i=f.options.cardView?['<div class="card-view">',f.options.showHeader?c('<span class="title" %s>%s</span>',o,d(f.columns,"field","title",e)):"",c('<span class="value">%s</span>',j),"</div>"].join(""):[c("<td%s %s %s %s %s %s %s>",r,s,o,t,u,v,w),j,"</td>"].join(""),f.options.cardView&&f.options.smartDisplay&&""===j&&(i='<div class="card-view"></div>')),g.push(i)}}),this.options.cardView&&g.push("</div></td>"),g.push("</tr>")}g.length||g.push('<tr class="no-records-found">',c('<td colspan="%s">%s</td>',this.$header.find("th").length,this.options.formatNoMatches()),"</tr>"),this.$body.html(g.join("")),b||this.scrollTo(0),this.$body.find("> tr[data-index] > td").off("click dblclick").on("click dblclick",function(b){var d=a(this),g=d.parent(),h=f.data[g.data("index")],i=d[0].cellIndex,j=f.getVisibleFields(),k=j[f.options.detailView&&!f.options.cardView?i-1:i],l=f.columns[e(f.columns,k)],n=m(h,k,f.options.escape);if(!d.find(".detail-icon").length&&(f.trigger("click"===b.type?"click-cell":"dbl-click-cell",k,n,h,d),f.trigger("click"===b.type?"click-row":"dbl-click-row",h,g,k),
  5670. "click"===b.type&&f.options.clickToSelect&&l.clickToSelect)){var o=g.find(c('[name="%s"]',f.options.selectItemName));o.length&&o[0].click()}}),this.$body.find("> tr[data-index] > td > .detail-icon").off("click").on("click",function(){var b=a(this),d=b.parent().parent(),e=d.data("index"),g=i[e];if(d.next().is("tr.detail-view"))b.find("i").attr("class",c("%s %s",f.options.iconsPrefix,f.options.icons.detailOpen)),d.next().remove(),f.trigger("collapse-row",e,g);else{b.find("i").attr("class",c("%s %s",f.options.iconsPrefix,f.options.icons.detailClose)),d.after(c('<tr class="detail-view"><td colspan="%s"></td></tr>',d.find("td").length));var j=d.next().find("td"),k=h(f.options,f.options.detailFormatter,[e,g,j],"");1===j.length&&j.append(k),f.trigger("expand-row",e,g,j)}f.resetView()}),this.$selectItem=this.$body.find(c('[name="%s"]',this.options.selectItemName)),this.$selectItem.off("click").on("click",function(b){b.stopImmediatePropagation();var c=a(this),d=c.prop("checked"),e=f.data[c.data("index")];f.options.maintainSelected&&a(this).is(":radio")&&a.each(f.options.data,function(a,b){b[f.header.stateField]=!1}),e[f.header.stateField]=d,f.options.singleSelect&&(f.$selectItem.not(this).each(function(){f.data[a(this).data("index")][f.header.stateField]=!1}),f.$selectItem.filter(":checked").not(this).prop("checked",!1)),f.updateSelected(),f.trigger(d?"check":"uncheck",e,c)}),a.each(this.header.events,function(b,c){if(c){"string"==typeof c&&(c=h(null,c));var d=f.header.fields[b],e=a.inArray(d,f.getVisibleFields());f.options.detailView&&!f.options.cardView&&(e+=1);for(var g in c)f.$body.find(">tr:not(.no-records-found)").each(function(){var b=a(this),h=b.find(f.options.cardView?".card-view":"td").eq(e),i=g.indexOf(" "),j=g.substring(0,i),k=g.substring(i+1),l=c[g];h.find(k).off(j).on(j,function(a){var c=b.data("index"),e=f.data[c],g=e[d];l.apply(this,[a,g,e,c])})})}}),this.updateSelected(),this.resetView(),this.trigger("post-body",i)},p.prototype.initServer=function(b,c,d){var e,f=this,g={},i={searchText:this.searchText,sortName:this.options.sortName,sortOrder:this.options.sortOrder};this.options.pagination&&(i.pageSize=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize,i.pageNumber=this.options.pageNumber),(d||this.options.url||this.options.ajax)&&("limit"===this.options.queryParamsType&&(i={search:i.searchText,sort:i.sortName,order:i.sortOrder},this.options.pagination&&(i.offset=this.options.pageSize===this.options.formatAllRows()?0:this.options.pageSize*(this.options.pageNumber-1),i.limit=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize)),a.isEmptyObject(this.filterColumnsPartial)||(i.filter=JSON.stringify(this.filterColumnsPartial,null)),g=h(this.options,this.options.queryParams,[i],g),a.extend(g,c||{}),g!==!1&&(b||this.$tableLoading.show(),e=a.extend({},h(null,this.options.ajaxOptions),{type:this.options.method,url:d||this.options.url,data:"application/json"===this.options.contentType&&"post"===this.options.method?JSON.stringify(g):g,cache:this.options.cache,contentType:this.options.contentType,dataType:this.options.dataType,success:function(a){a=h(f.options,f.options.responseHandler,[a],a),f.load(a),f.trigger("load-success",a),b||f.$tableLoading.hide()},error:function(a){f.trigger("load-error",a.status,a),b||f.$tableLoading.hide()}}),this.options.ajax?h(this,this.options.ajax,[e],null):(this._xhr&&4!==this._xhr.readyState&&this._xhr.abort(),this._xhr=a.ajax(e))))},p.prototype.initSearchText=function(){if(this.options.search&&""!==this.options.searchText){var a=this.$toolbar.find(".search input");a.val(this.options.searchText),this.onSearch({currentTarget:a})}},p.prototype.getCaret=function(){var b=this;a.each(this.$header.find("th"),function(c,d){a(d).find(".sortable").removeClass("desc asc").addClass(a(d).data("field")===b.options.sortName?b.options.sortOrder:"both")})},p.prototype.updateSelected=function(){var b=this.$selectItem.filter(":enabled").length&&this.$selectItem.filter(":enabled").length===this.$selectItem.filter(":enabled").filter(":checked").length;this.$selectAll.add(this.$selectAll_).prop("checked",b),this.$selectItem.each(function(){a(this).closest("tr")[a(this).prop("checked")?"addClass":"removeClass"]("selected")})},p.prototype.updateRows=function(){var b=this;this.$selectItem.each(function(){b.data[a(this).data("index")][b.header.stateField]=a(this).prop("checked")})},p.prototype.resetRows=function(){var b=this;a.each(this.data,function(a,c){b.$selectAll.prop("checked",!1),b.$selectItem.prop("checked",!1),b.header.stateField&&(c[b.header.stateField]=!1)})},p.prototype.trigger=function(b){var c=Array.prototype.slice.call(arguments,1);b+=".bs.table",this.options[p.EVENTS[b]].apply(this.options,c),this.$el.trigger(a.Event(b),c),this.options.onAll(b,c),this.$el.trigger(a.Event("all.bs.table"),[b,c])},p.prototype.resetHeader=function(){clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(a.proxy(this.fitHeader,this),this.$el.is(":hidden")?100:0)},p.prototype.fitHeader=function(){var b,d,e,f,h=this;if(h.$el.is(":hidden"))return void(h.timeoutId_=setTimeout(a.proxy(h.fitHeader,h),100));if(b=this.$tableBody.get(0),d=b.scrollWidth>b.clientWidth&&b.scrollHeight>b.clientHeight+this.$header.outerHeight()?g():0,this.$el.css("margin-top",-this.$header.outerHeight()),e=a(":focus"),e.length>0){var i=e.parents("th");if(i.length>0){var j=i.attr("data-field");if(void 0!==j){var k=this.$header.find("[data-field='"+j+"']");k.length>0&&k.find(":input").addClass("focus-temp")}}}this.$header_=this.$header.clone(!0,!0),this.$selectAll_=this.$header_.find('[name="btSelectAll"]'),this.$tableHeader.css({"margin-right":d}).find("table").css("width",this.$el.outerWidth()).html("").attr("class",this.$el.attr("class")).append(this.$header_),f=a(".focus-temp:visible:eq(0)"),f.length>0&&(f.focus(),this.$header.find(".focus-temp").removeClass("focus-temp")),this.$header.find("th[data-field]").each(function(){h.$header_.find(c('th[data-field="%s"]',a(this).data("field"))).data(a(this).data())});var l=this.getVisibleFields(),m=this.$header_.find("th");this.$body.find(">tr:first-child:not(.no-records-found) > *").each(function(b){var d=a(this),e=b;h.options.detailView&&!h.options.cardView&&(0===b&&h.$header_.find("th.detail").find(".fht-cell").width(d.innerWidth()),e=b-1);var f=h.$header_.find(c('th[data-field="%s"]',l[e]));f.length>1&&(f=a(m[d[0].cellIndex])),f.find(".fht-cell").width(d.innerWidth())}),this.$tableBody.off("scroll").on("scroll",function(){h.$tableHeader.scrollLeft(a(this).scrollLeft()),h.options.showFooter&&!h.options.cardView&&h.$tableFooter.scrollLeft(a(this).scrollLeft())}),h.trigger("post-header")},p.prototype.resetFooter=function(){var b=this,d=b.getData(),e=[];this.options.showFooter&&!this.options.cardView&&(!this.options.cardView&&this.options.detailView&&e.push('<td><div class="th-inner">&nbsp;</div><div class="fht-cell"></div></td>'),a.each(this.columns,function(a,f){var g,i="",j="",k=[],l={},m=c(' class="%s"',f["class"]);if(f.visible&&(!b.options.cardView||f.cardVisible)){if(i=c("text-align: %s; ",f.falign?f.falign:f.align),j=c("vertical-align: %s; ",f.valign),l=h(null,b.options.footerStyle),l&&l.css)for(g in l.css)k.push(g+": "+l.css[g]);e.push("<td",m,c(' style="%s"',i+j+k.concat().join("; ")),">"),e.push('<div class="th-inner">'),e.push(h(f,f.footerFormatter,[d],"&nbsp;")||"&nbsp;"),e.push("</div>"),e.push('<div class="fht-cell"></div>'),e.push("</div>"),e.push("</td>")}}),this.$tableFooter.find("tr").html(e.join("")),this.$tableFooter.show(),clearTimeout(this.timeoutFooter_),this.timeoutFooter_=setTimeout(a.proxy(this.fitFooter,this),this.$el.is(":hidden")?100:0))},p.prototype.fitFooter=function(){var b,c,d;return clearTimeout(this.timeoutFooter_),this.$el.is(":hidden")?void(this.timeoutFooter_=setTimeout(a.proxy(this.fitFooter,this),100)):(c=this.$el.css("width"),d=c>this.$tableBody.width()?g():0,this.$tableFooter.css({"margin-right":d}).find("table").css("width",c).attr("class",this.$el.attr("class")),b=this.$tableFooter.find("td"),void this.$body.find(">tr:first-child:not(.no-records-found) > *").each(function(c){var d=a(this);b.eq(c).find(".fht-cell").width(d.innerWidth())}))},p.prototype.toggleColumn=function(a,b,d){if(-1!==a&&(this.columns[a].visible=b,this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns)){var e=this.$toolbar.find(".keep-open input").prop("disabled",!1);d&&e.filter(c('[value="%s"]',a)).prop("checked",b),e.filter(":checked").length<=this.options.minimumCountColumns&&e.filter(":checked").prop("disabled",!0)}},p.prototype.toggleRow=function(a,b,d){-1!==a&&this.$body.find("undefined"!=typeof a?c('tr[data-index="%s"]',a):c('tr[data-uniqueid="%s"]',b))[d?"show":"hide"]()},p.prototype.getVisibleFields=function(){var b=this,c=[];return a.each(this.header.fields,function(a,d){var f=b.columns[e(b.columns,d)];f.visible&&c.push(d)}),c},p.prototype.resetView=function(a){var b=0;if(a&&a.height&&(this.options.height=a.height),this.$selectAll.prop("checked",this.$selectItem.length>0&&this.$selectItem.length===this.$selectItem.filter(":checked").length),this.options.height){var c=k(this.$toolbar),d=k(this.$pagination),e=this.options.height-c-d;this.$tableContainer.css("height",e+"px")}return this.options.cardView?(this.$el.css("margin-top","0"),this.$tableContainer.css("padding-bottom","0"),void this.$tableFooter.hide()):(this.options.showHeader&&this.options.height?(this.$tableHeader.show(),this.resetHeader(),b+=this.$header.outerHeight()):(this.$tableHeader.hide(),this.trigger("post-header")),this.options.showFooter&&(this.resetFooter(),this.options.height&&(b+=this.$tableFooter.outerHeight()+1)),this.getCaret(),this.$tableContainer.css("padding-bottom",b+"px"),void this.trigger("reset-view"))},p.prototype.getData=function(b){return!this.searchText&&a.isEmptyObject(this.filterColumns)&&a.isEmptyObject(this.filterColumnsPartial)?b?this.options.data.slice(this.pageFrom-1,this.pageTo):this.options.data:b?this.data.slice(this.pageFrom-1,this.pageTo):this.data},p.prototype.load=function(b){var c=!1;"server"===this.options.sidePagination?(this.options.totalRows=b.total,c=b.fixedScroll,b=b[this.options.dataField]):a.isArray(b)||(c=b.fixedScroll,b=b.data),this.initData(b),this.initSearch(),this.initPagination(),this.initBody(c)},p.prototype.append=function(a){this.initData(a,"append"),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)},p.prototype.prepend=function(a){this.initData(a,"prepend"),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)},p.prototype.remove=function(b){var c,d,e=this.options.data.length;if(b.hasOwnProperty("field")&&b.hasOwnProperty("values")){for(c=e-1;c>=0;c--)d=this.options.data[c],d.hasOwnProperty(b.field)&&-1!==a.inArray(d[b.field],b.values)&&this.options.data.splice(c,1);e!==this.options.data.length&&(this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))}},p.prototype.removeAll=function(){this.options.data.length>0&&(this.options.data.splice(0,this.options.data.length),this.initSearch(),this.initPagination(),this.initBody(!0))},p.prototype.getRowByUniqueId=function(a){var b,c,d,e=this.options.uniqueId,f=this.options.data.length,g=null;for(b=f-1;b>=0;b--){if(c=this.options.data[b],c.hasOwnProperty(e))d=c[e];else{if(!c._data.hasOwnProperty(e))continue;d=c._data[e]}if("string"==typeof d?a=a.toString():"number"==typeof d&&(Number(d)===d&&d%1===0?a=parseInt(a):d===Number(d)&&0!==d&&(a=parseFloat(a))),d===a){g=c;break}}return g},p.prototype.removeByUniqueId=function(a){var b=this.options.data.length,c=this.getRowByUniqueId(a);c&&this.options.data.splice(this.options.data.indexOf(c),1),b!==this.options.data.length&&(this.initSearch(),this.initPagination(),this.initBody(!0))},p.prototype.updateByUniqueId=function(b){var c=this,d=a.isArray(b)?b:[b];a.each(d,function(b,d){var e;d.hasOwnProperty("id")&&d.hasOwnProperty("row")&&(e=a.inArray(c.getRowByUniqueId(d.id),c.options.data),-1!==e&&a.extend(c.options.data[e],d.row))}),this.initSearch(),this.initSort(),this.initBody(!0)},p.prototype.insertRow=function(a){a.hasOwnProperty("index")&&a.hasOwnProperty("row")&&(this.data.splice(a.index,0,a.row),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))},p.prototype.updateRow=function(b){var c=this,d=a.isArray(b)?b:[b];a.each(d,function(b,d){d.hasOwnProperty("index")&&d.hasOwnProperty("row")&&a.extend(c.options.data[d.index],d.row)}),this.initSearch(),this.initSort(),this.initBody(!0)},p.prototype.showRow=function(a){(a.hasOwnProperty("index")||a.hasOwnProperty("uniqueId"))&&this.toggleRow(a.index,a.uniqueId,!0)},p.prototype.hideRow=function(a){(a.hasOwnProperty("index")||a.hasOwnProperty("uniqueId"))&&this.toggleRow(a.index,a.uniqueId,!1)},p.prototype.getRowsHidden=function(b){var c=a(this.$body[0]).children().filter(":hidden"),d=0;if(b)for(;d<c.length;d++)a(c[d]).show();return c},p.prototype.mergeCells=function(b){var c,d,e,f=b.index,g=a.inArray(b.field,this.getVisibleFields()),h=b.rowspan||1,i=b.colspan||1,j=this.$body.find(">tr");if(this.options.detailView&&!this.options.cardView&&(g+=1),e=j.eq(f).find(">td").eq(g),!(0>f||0>g||f>=this.data.length)){for(c=f;f+h>c;c++)for(d=g;g+i>d;d++)j.eq(c).find(">td").eq(d).hide();e.attr("rowspan",h).attr("colspan",i).show()}},p.prototype.updateCell=function(a){a.hasOwnProperty("index")&&a.hasOwnProperty("field")&&a.hasOwnProperty("value")&&(this.data[a.index][a.field]=a.value,a.reinit!==!1&&(this.initSort(),this.initBody(!0)))},p.prototype.getOptions=function(){return this.options},p.prototype.getSelections=function(){var b=this;return a.grep(this.options.data,function(a){return a[b.header.stateField]})},p.prototype.getAllSelections=function(){var b=this;return a.grep(this.options.data,function(a){return a[b.header.stateField]})},p.prototype.checkAll=function(){this.checkAll_(!0)},p.prototype.uncheckAll=function(){this.checkAll_(!1)},p.prototype.checkInvert=function(){var b=this,c=b.$selectItem.filter(":enabled"),d=c.filter(":checked");c.each(function(){a(this).prop("checked",!a(this).prop("checked"))}),b.updateRows(),b.updateSelected(),b.trigger("uncheck-some",d),d=b.getSelections(),b.trigger("check-some",d)},p.prototype.checkAll_=function(a){var b;a||(b=this.getSelections()),this.$selectAll.add(this.$selectAll_).prop("checked",a),this.$selectItem.filter(":enabled").prop("checked",a),this.updateRows(),a&&(b=this.getSelections()),this.trigger(a?"check-all":"uncheck-all",b)},p.prototype.check=function(a){this.check_(!0,a)},p.prototype.uncheck=function(a){this.check_(!1,a)},p.prototype.check_=function(a,b){var d=this.$selectItem.filter(c('[data-index="%s"]',b)).prop("checked",a);this.data[b][this.header.stateField]=a,this.updateSelected(),this.trigger(a?"check":"uncheck",this.data[b],d)},p.prototype.checkBy=function(a){this.checkBy_(!0,a)},p.prototype.uncheckBy=function(a){this.checkBy_(!1,a)},p.prototype.checkBy_=function(b,d){if(d.hasOwnProperty("field")&&d.hasOwnProperty("values")){var e=this,f=[];a.each(this.options.data,function(g,h){if(!h.hasOwnProperty(d.field))return!1;if(-1!==a.inArray(h[d.field],d.values)){var i=e.$selectItem.filter(":enabled").filter(c('[data-index="%s"]',g)).prop("checked",b);h[e.header.stateField]=b,f.push(h),e.trigger(b?"check":"uncheck",h,i)}}),this.updateSelected(),this.trigger(b?"check-some":"uncheck-some",f)}},p.prototype.destroy=function(){this.$el.insertBefore(this.$container),a(this.options.toolbar).insertBefore(this.$el),this.$container.next().remove(),this.$container.remove(),this.$el.html(this.$el_.html()).css("margin-top","0").attr("class",this.$el_.attr("class")||"")},p.prototype.showLoading=function(){this.$tableLoading.show()},p.prototype.hideLoading=function(){this.$tableLoading.hide()},p.prototype.togglePagination=function(){this.options.pagination=!this.options.pagination;var a=this.$toolbar.find('button[name="paginationSwitch"] i');this.options.pagination?a.attr("class",this.options.iconsPrefix+" "+this.options.icons.paginationSwitchDown):a.attr("class",this.options.iconsPrefix+" "+this.options.icons.paginationSwitchUp),this.updatePagination()},p.prototype.refresh=function(a){a&&a.url&&(this.options.pageNumber=1),this.initServer(a&&a.silent,a&&a.query,a&&a.url),this.trigger("refresh",a)},p.prototype.resetWidth=function(){this.options.showHeader&&this.options.height&&this.fitHeader(),this.options.showFooter&&this.fitFooter()},p.prototype.showColumn=function(a){this.toggleColumn(e(this.columns,a),!0,!0)},p.prototype.hideColumn=function(a){this.toggleColumn(e(this.columns,a),!1,!0)},p.prototype.getHiddenColumns=function(){return a.grep(this.columns,function(a){return!a.visible})},p.prototype.getVisibleColumns=function(){return a.grep(this.columns,function(a){return a.visible})},p.prototype.toggleAllColumns=function(b){if(a.each(this.columns,function(a){this.columns[a].visible=b}),this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns){var c=this.$toolbar.find(".keep-open input").prop("disabled",!1);c.filter(":checked").length<=this.options.minimumCountColumns&&c.filter(":checked").prop("disabled",!0)}},p.prototype.showAllColumns=function(){this.toggleAllColumns(!0)},p.prototype.hideAllColumns=function(){this.toggleAllColumns(!1)},p.prototype.filterBy=function(b){this.filterColumns=a.isEmptyObject(b)?{}:b,this.options.pageNumber=1,this.initSearch(),this.updatePagination()},p.prototype.scrollTo=function(a){return"string"==typeof a&&(a="bottom"===a?this.$tableBody[0].scrollHeight:0),"number"==typeof a&&this.$tableBody.scrollTop(a),"undefined"==typeof a?this.$tableBody.scrollTop():void 0},p.prototype.getScrollPosition=function(){return this.scrollTo()},p.prototype.selectPage=function(a){a>0&&a<=this.options.totalPages&&(this.options.pageNumber=a,this.updatePagination())},p.prototype.prevPage=function(){this.options.pageNumber>1&&(this.options.pageNumber--,this.updatePagination())},p.prototype.nextPage=function(){this.options.pageNumber<this.options.totalPages&&(this.options.pageNumber++,this.updatePagination())},p.prototype.toggleView=function(){this.options.cardView=!this.options.cardView,this.initHeader(),this.initBody(),this.trigger("toggle",this.options.cardView)},p.prototype.refreshOptions=function(b){i(this.options,b,!0)||(this.options=a.extend(this.options,b),this.trigger("refresh-options",this.options),this.destroy(),this.init())},p.prototype.resetSearch=function(a){var b=this.$toolbar.find(".search input");b.val(a||""),this.onSearch({currentTarget:b})},p.prototype.expandRow_=function(a,b){var d=this.$body.find(c('> tr[data-index="%s"]',b));d.next().is("tr.detail-view")===(a?!1:!0)&&d.find("> td > .detail-icon").click()},p.prototype.expandRow=function(a){this.expandRow_(!0,a)},p.prototype.collapseRow=function(a){this.expandRow_(!1,a)},p.prototype.expandAllRows=function(b){if(b){var d=this.$body.find(c('> tr[data-index="%s"]',0)),e=this,f=null,g=!1,h=-1;if(d.next().is("tr.detail-view")?d.next().next().is("tr.detail-view")||(d.next().find(".detail-icon").click(),g=!0):(d.find("> td > .detail-icon").click(),g=!0),g)try{h=setInterval(function(){f=e.$body.find("tr.detail-view").last().find(".detail-icon"),f.length>0?f.click():clearInterval(h)},1)}catch(i){clearInterval(h)}}else for(var j=this.$body.children(),k=0;k<j.length;k++)this.expandRow_(!0,a(j[k]).data("index"))},p.prototype.collapseAllRows=function(b){if(b)this.expandRow_(!1,0);else for(var c=this.$body.children(),d=0;d<c.length;d++)this.expandRow_(!1,a(c[d]).data("index"))},p.prototype.updateFormatText=function(a,b){this.options[c("format%s",a)]&&("string"==typeof b?this.options[c("format%s",a)]=function(){return b}:"function"==typeof b&&(this.options[c("format%s",a)]=b)),this.initToolbar(),this.initPagination(),this.initBody()};var q=["getOptions","getSelections","getAllSelections","getData","load","append","prepend","remove","removeAll","insertRow","updateRow","updateCell","updateByUniqueId","removeByUniqueId","getRowByUniqueId","showRow","hideRow","getRowsHidden","mergeCells","checkAll","uncheckAll","checkInvert","check","uncheck","checkBy","uncheckBy","refresh","resetView","resetWidth","destroy","showLoading","hideLoading","showColumn","hideColumn","getHiddenColumns","getVisibleColumns","showAllColumns","hideAllColumns","filterBy","scrollTo","getScrollPosition","selectPage","prevPage","nextPage","togglePagination","toggleView","refreshOptions","resetSearch","expandRow","collapseRow","expandAllRows","collapseAllRows","updateFormatText"];a.fn.bootstrapTable=function(b){var c,d=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=a(this),f=e.data("bootstrap.table"),g=a.extend({},p.DEFAULTS,e.data(),"object"==typeof b&&b);if("string"==typeof b){if(a.inArray(b,q)<0)throw new Error("Unknown method: "+b);if(!f)return;c=f[b].apply(f,d),"destroy"===b&&e.removeData("bootstrap.table")}f||e.data("bootstrap.table",f=new p(this,g))}),"undefined"==typeof c?this:c},a.fn.bootstrapTable.Constructor=p,a.fn.bootstrapTable.defaults=p.DEFAULTS,a.fn.bootstrapTable.columnDefaults=p.COLUMN_DEFAULTS,a.fn.bootstrapTable.locales=p.LOCALES,a.fn.bootstrapTable.methods=q,a.fn.bootstrapTable.utils={sprintf:c,getFieldIndex:e,compareObjects:i,calculateObjectValue:h,getItemField:m,objectKeys:o,isIEBrowser:n},a(function(){a('[data-toggle="table"]').bootstrapTable()})}(jQuery);
  5671. define("bootstrap-table", ["bootstrap","css!../libs/bootstrap-table/dist/bootstrap-table.min.css"], (function (global) {
  5672. return function () {
  5673. var ret, fn;
  5674. return ret || global.$.fn.bootstrapTable;
  5675. };
  5676. }(this)));
  5677. /**
  5678. * Bootstrap Table Chinese translation
  5679. * Author: Zhixin Wen<wenzhixin2010@gmail.com>
  5680. */
  5681. (function ($) {
  5682. 'use strict';
  5683. $.fn.bootstrapTable.locales['zh-CN'] = {
  5684. formatLoadingMessage: function () {
  5685. return '正在努力地加载数据中,请稍候……';
  5686. },
  5687. formatRecordsPerPage: function (pageNumber) {
  5688. return '每页显示 ' + pageNumber + ' 条记录';
  5689. },
  5690. formatShowingRows: function (pageFrom, pageTo, totalRows) {
  5691. return '显示第 ' + pageFrom + ' 到第 ' + pageTo + ' 条记录,总共 ' + totalRows + ' 条记录';
  5692. },
  5693. formatSearch: function () {
  5694. return '搜索';
  5695. },
  5696. formatNoMatches: function () {
  5697. return '没有找到匹配的记录';
  5698. },
  5699. formatPaginationSwitch: function () {
  5700. return '隐藏/显示分页';
  5701. },
  5702. formatRefresh: function () {
  5703. return '刷新';
  5704. },
  5705. formatToggle: function () {
  5706. return '切换';
  5707. },
  5708. formatColumns: function () {
  5709. return '列';
  5710. },
  5711. formatExport: function () {
  5712. return '导出数据';
  5713. },
  5714. formatClearFilters: function () {
  5715. return '清空过滤';
  5716. }
  5717. };
  5718. $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']);
  5719. })(jQuery);
  5720. define("bootstrap-table-lang", ["bootstrap-table"], (function (global) {
  5721. return function () {
  5722. var ret, fn;
  5723. return ret || global.$.fn.bootstrapTable.defaults;
  5724. };
  5725. }(this)));
  5726. /**
  5727. * @author: Dennis Hernández
  5728. * @webSite: http://djhvscf.github.io/Blog
  5729. * @version: v1.1.0
  5730. */
  5731. !function ($) {
  5732. 'use strict';
  5733. var showHideColumns = function (that, checked) {
  5734. if (that.options.columnsHidden.length > 0 ) {
  5735. $.each(that.columns, function (i, column) {
  5736. if (that.options.columnsHidden.indexOf(column.field) !== -1) {
  5737. if (column.visible !== checked) {
  5738. that.toggleColumn($.fn.bootstrapTable.utils.getFieldIndex(that.columns, column.field), checked, true);
  5739. }
  5740. }
  5741. });
  5742. }
  5743. };
  5744. var resetView = function (that) {
  5745. if (that.options.height || that.options.showFooter) {
  5746. setTimeout(function(){
  5747. that.resetView.call(that);
  5748. }, 1);
  5749. }
  5750. };
  5751. var changeView = function (that, width, height) {
  5752. if (that.options.minHeight) {
  5753. if ((width <= that.options.minWidth) && (height <= that.options.minHeight)) {
  5754. conditionCardView(that);
  5755. } else if ((width > that.options.minWidth) && (height > that.options.minHeight)) {
  5756. conditionFullView(that);
  5757. }
  5758. } else {
  5759. if (width <= that.options.minWidth) {
  5760. conditionCardView(that);
  5761. } else if (width > that.options.minWidth) {
  5762. conditionFullView(that);
  5763. }
  5764. }
  5765. resetView(that);
  5766. };
  5767. var conditionCardView = function (that) {
  5768. changeTableView(that, false);
  5769. showHideColumns(that, false);
  5770. };
  5771. var conditionFullView = function (that) {
  5772. changeTableView(that, true);
  5773. showHideColumns(that, true);
  5774. };
  5775. var changeTableView = function (that, cardViewState) {
  5776. that.options.cardView = cardViewState;
  5777. that.toggleView();
  5778. };
  5779. var debounce = function(func,wait) {
  5780. var timeout;
  5781. return function() {
  5782. var context = this,
  5783. args = arguments;
  5784. var later = function() {
  5785. timeout = null;
  5786. func.apply(context,args);
  5787. };
  5788. clearTimeout(timeout);
  5789. timeout = setTimeout(later, wait);
  5790. };
  5791. };
  5792. $.extend($.fn.bootstrapTable.defaults, {
  5793. mobileResponsive: false,
  5794. minWidth: 562,
  5795. minHeight: undefined,
  5796. heightThreshold: 100, // just slightly larger than mobile chrome's auto-hiding toolbar
  5797. checkOnInit: true,
  5798. columnsHidden: []
  5799. });
  5800. var BootstrapTable = $.fn.bootstrapTable.Constructor,
  5801. _init = BootstrapTable.prototype.init;
  5802. BootstrapTable.prototype.init = function () {
  5803. _init.apply(this, Array.prototype.slice.apply(arguments));
  5804. if (!this.options.mobileResponsive) {
  5805. return;
  5806. }
  5807. if (!this.options.minWidth) {
  5808. return;
  5809. }
  5810. if (this.options.minWidth < 100 && this.options.resizable) {
  5811. console.log("The minWidth when the resizable extension is active should be greater or equal than 100");
  5812. this.options.minWidth = 100;
  5813. }
  5814. var that = this,
  5815. old = {
  5816. width: $(window).width(),
  5817. height: $(window).height()
  5818. };
  5819. $(window).on('resize orientationchange',debounce(function (evt) {
  5820. // reset view if height has only changed by at least the threshold.
  5821. var height = $(this).height(),
  5822. width = $(this).width();
  5823. if (Math.abs(old.height - height) > that.options.heightThreshold || old.width != width) {
  5824. changeView(that, width, height);
  5825. old = {
  5826. width: width,
  5827. height: height
  5828. };
  5829. }
  5830. },200));
  5831. if (this.options.checkOnInit) {
  5832. var height = $(window).height(),
  5833. width = $(window).width();
  5834. changeView(this, width, height);
  5835. old = {
  5836. width: width,
  5837. height: height
  5838. };
  5839. }
  5840. };
  5841. }(jQuery);
  5842. define("bootstrap-table-mobile", ["bootstrap-table"], (function (global) {
  5843. return function () {
  5844. var ret, fn;
  5845. return ret || global.$.fn.bootstrapTable.defaults;
  5846. };
  5847. }(this)));
  5848. /*
  5849. tableExport.jquery.plugin
  5850. Copyright (c) 2015-2017 hhurz, https://github.com/hhurz/tableExport.jquery.plugin
  5851. Original work Copyright (c) 2014 Giri Raj, https://github.com/kayalshri/
  5852. Licensed under the MIT License, http://opensource.org/licenses/mit-license
  5853. */
  5854. (function(c){c.fn.extend({tableExport:function(u){function S(b){var a=[];c(b).find("thead").first().find("th").each(function(b,d){void 0!==c(d).attr("data-field")?a[b]=c(d).attr("data-field"):a[b]=b.toString()});return a}function z(b,h,e,d,w){if(-1==c.inArray(e,a.ignoreRow)&&-1==c.inArray(e-d,a.ignoreRow)){var q=c(b).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display")||"always"==c(this).closest("table").data("tableexport-display"))}).find(h),
  5855. l=0;q.each(function(b){if("always"==c(this).data("tableexport-display")||"none"!=c(this).css("display")&&"hidden"!=c(this).css("visibility")&&"none"!=c(this).data("tableexport-display")){var d=b,h=!1;0<a.ignoreColumn.length&&("string"==typeof a.ignoreColumn[0]?H.length>d&&"undefined"!=typeof H[d]&&-1!=c.inArray(H[d],a.ignoreColumn)&&(h=!0):"number"!=typeof a.ignoreColumn[0]||-1==c.inArray(d,a.ignoreColumn)&&-1==c.inArray(d-q.length,a.ignoreColumn)||(h=!0));if(!1===h&&"function"===typeof w){var h=
  5856. 0,r,f=0;if("undefined"!=typeof A[e]&&0<A[e].length)for(d=0;d<=b;d++)"undefined"!=typeof A[e][d]&&(w(null,e,d),delete A[e][d],b++);c(this).is("[colspan]")&&(h=parseInt(c(this).attr("colspan")),l+=0<h?h-1:0);c(this).is("[rowspan]")&&(f=parseInt(c(this).attr("rowspan")));w(this,e,b);for(d=0;d<h-1;d++)w(null,e,b+d);if(f)for(r=1;r<f;r++)for("undefined"==typeof A[e+r]&&(A[e+r]=[]),A[e+r][b+l]="",d=1;d<h;d++)A[e+r][b+l-d]=""}}});if("undefined"!=typeof A[e]&&0<A[e].length)for(b=0;b<=A[e].length;b++)"undefined"!=
  5857. typeof A[e][b]&&(w(null,e,b),delete A[e][b])}}function Z(b,h){!0===a.consoleLog&&console.log(b.output());if("string"===a.outputMode)return b.output();if("base64"===a.outputMode)return F(b.output());if("window"===a.outputMode)window.open(URL.createObjectURL(b.output("blob")));else try{var e=b.output("blob");saveAs(e,a.fileName+".pdf")}catch(d){C(a.fileName+".pdf","data:application/pdf"+(h?"":";base64")+",",h?e:b.output())}}function aa(b,a,e){var d=0;"undefined"!=typeof e&&(d=e.colspan);if(0<=d){for(var h=
  5858. b.width,c=b.textPos.x,l=a.table.columns.indexOf(a.column),r=1;r<d;r++)h+=a.table.columns[l+r].width;1<d&&("right"===b.styles.halign?c=b.textPos.x+h-b.width:"center"===b.styles.halign&&(c=b.textPos.x+(h-b.width)/2));b.width=h;b.textPos.x=c;"undefined"!=typeof e&&1<e.rowspan&&(b.height*=e.rowspan);if("middle"===b.styles.valign||"bottom"===b.styles.valign)e=("string"===typeof b.text?b.text.split(/\r\n|\r|\n/g):b.text).length||1,2<e&&(b.textPos.y-=(2-1.15)/2*a.row.styles.fontSize*(e-2)/3);return!0}return!1}
  5859. function ba(b,a,e){"undefined"!=typeof e.images&&a.each(function(){var a=c(this).children();if(c(this).is("img")){var h=ca(this.src);e.images[h]={url:this.src,src:this.src}}"undefined"!=typeof a&&0<a.length&&ba(b,a,e)})}function ka(b,a){function h(b){if(b.url){var d=new Image;c=++q;d.crossOrigin="Anonymous";d.onerror=d.onload=function(){if(d.complete&&(0===d.src.indexOf("data:image/")&&(d.width=b.width||d.width||0,d.height=b.height||d.height||0),d.width+d.height)){var h=document.createElement("canvas"),
  5860. e=h.getContext("2d");h.width=d.width;h.height=d.height;e.drawImage(d,0,0);b.src=h.toDataURL("image/jpeg")}--q||a(c)};d.src=b.url}}var d,c=0,q=0;if("undefined"!=typeof b.images)for(d in b.images)b.images.hasOwnProperty(d)&&h(b.images[d]);(d=q)||(a(c),d=void 0);return d}function da(b,h,e){h.each(function(){var d=c(this).children();if(c(this).is("div")){var h=N(E(this,"background-color"),[255,255,255]),q=N(E(this,"border-top-color"),[0,0,0]),l=O(this,"border-top-width",a.jspdf.unit),r=this.getBoundingClientRect(),
  5861. f=this.offsetLeft*e.dw,g=this.offsetTop*e.dh,k=r.width*e.dw,r=r.height*e.dh;e.doc.setDrawColor.apply(void 0,q);e.doc.setFillColor.apply(void 0,h);e.doc.setLineWidth(l);e.doc.rect(b.x+f,b.y+g,k,r,l?"FD":"F")}else if(c(this).is("img")&&"undefined"!=typeof e.images&&(g=ca(this.src),h=e.images[g],"undefined"!=typeof h)){q=b.width/b.height;l=this.width/this.height;f=b.width;k=b.height;g=0;l<q?(k=Math.min(b.height,this.height),f=this.width*k/this.height):l>q&&(f=Math.min(b.width,this.width),k=this.height*
  5862. f/this.width);k<b.height&&(g=(b.height-k)/2);try{e.doc.addImage(h.src,b.textPos.x,b.y+g,f,k)}catch(oa){}b.textPos.x+=f}"undefined"!=typeof d&&0<d.length&&da(b,d,e)})}function P(b,a,e){return b.replace(new RegExp(a.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),e)}function ea(b){b=P(b||"0",a.numbers.html.thousandsSeparator,"");b=P(b,a.numbers.html.decimalMark,".");return"number"===typeof b||!1!==jQuery.isNumeric(b)?b:!1}function x(b,h,e){var d="";if(null!==b){var w=c(b),q;if(w[0].hasAttribute("data-tableexport-value"))q=
  5863. w.data("tableexport-value");else if(q=w.html(),"function"===typeof a.onCellHtmlData)q=a.onCellHtmlData(w,h,e,q);else if(""!=q){b=c.parseHTML(q);var l=0,r=0;q="";c.each(b,function(){if(c(this).is("input"))q+=w.find("input").eq(l++).val();else if(c(this).is("select"))q+=w.find("select option:selected").eq(r++).text();else if("undefined"===typeof c(this).html())q+=c(this).text();else if(void 0===jQuery().bootstrapTable||!0!==c(this).hasClass("filterControl"))q+=c(this).html()})}if(!0===a.htmlContent)d=
  5864. c.trim(q);else if(""!=q){var f=q.replace(/\n/g,"\u2028").replace(/<br\s*[\/]?>/gi,"\u2060");b=c("<div/>").html(f).contents();f="";c.each(b.text().split("\u2028"),function(b,a){0<b&&(f+=" ");f+=c.trim(a)});c.each(f.split("\u2060"),function(b,a){0<b&&(d+="\n");d+=c.trim(a).replace(/\u00AD/g,"")});if("json"==a.type||!1===a.numbers.output)b=ea(d),!1!==b&&(d=Number(b));else if(a.numbers.html.decimalMark!=a.numbers.output.decimalMark||a.numbers.html.thousandsSeparator!=a.numbers.output.thousandsSeparator)if(b=
  5865. ea(d),!1!==b){var g=(""+b).split(".");1==g.length&&(g[1]="");var k=3<g[0].length?g[0].length%3:0,d=(0>b?"-":"")+(a.numbers.output.thousandsSeparator?(k?g[0].substr(0,k)+a.numbers.output.thousandsSeparator:"")+g[0].substr(k).replace(/(\d{3})(?=\d)/g,"$1"+a.numbers.output.thousandsSeparator):g[0])+(g[1].length?a.numbers.output.decimalMark+g[1]:"")}}!0===a.escape&&(d=escape(d));"function"===typeof a.onCellData&&(d=a.onCellData(w,h,e,d))}return d}function la(b,a,e){return a+"-"+e.toLowerCase()}function N(b,
  5866. a){var h=/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.exec(b),d=a;h&&(d=[parseInt(h[1]),parseInt(h[2]),parseInt(h[3])]);return d}function fa(b){var a=E(b,"text-align"),e=E(b,"font-weight"),d=E(b,"font-style"),w="";"start"==a&&(a="rtl"==E(b,"direction")?"right":"left");700<=e&&(w="bold");"italic"==d&&(w+=d);""===w&&(w="normal");a={style:{align:a,bcolor:N(E(b,"background-color"),[255,255,255]),color:N(E(b,"color"),[0,0,0]),fstyle:w},colspan:parseInt(c(b).attr("colspan"))||0,rowspan:parseInt(c(b).attr("rowspan"))||
  5867. 0};null!==b&&(b=b.getBoundingClientRect(),a.rect={width:b.width,height:b.height});return a}function E(b,a){try{return window.getComputedStyle?(a=a.replace(/([a-z])([A-Z])/,la),window.getComputedStyle(b,null).getPropertyValue(a)):b.currentStyle?b.currentStyle[a]:b.style[a]}catch(e){}return""}function O(b,a,e){a=E(b,a).match(/\d+/);if(null!==a){a=a[0];b=b.parentElement;var d=document.createElement("div");d.style.overflow="hidden";d.style.visibility="hidden";b.appendChild(d);d.style.width=100+e;e=100/
  5868. d.offsetWidth;b.removeChild(d);return a*e}return 0}function T(){if(!(this instanceof T))return new T;this.SheetNames=[];this.Sheets={}}function ma(a){for(var b=new ArrayBuffer(a.length),e=new Uint8Array(b),d=0;d!=a.length;++d)e[d]=a.charCodeAt(d)&255;return b}function na(a){for(var b={},e={s:{c:1E7,r:1E7},e:{c:0,r:0}},d=0;d!=a.length;++d)for(var c=0;c!=a[d].length;++c){e.s.r>d&&(e.s.r=d);e.s.c>c&&(e.s.c=c);e.e.r<d&&(e.e.r=d);e.e.c<c&&(e.e.c=c);var f={v:a[d][c]};if(null!==f.v){var l=XLSX.utils.encode_cell({c:c,
  5869. r:d});if("number"===typeof f.v)f.t="n";else if("boolean"===typeof f.v)f.t="b";else if(f.v instanceof Date){f.t="n";f.z=XLSX.SSF._table[14];var r=f,g;g=(Date.parse(f.v)-new Date(Date.UTC(1899,11,30)))/864E5;r.v=g}else f.t="s";b[l]=f}}1E7>e.s.c&&(b["!ref"]=XLSX.utils.encode_range(e));return b}function ca(a){var b=0,c,d,f;if(0===a.length)return b;c=0;for(f=a.length;c<f;c++)d=a.charCodeAt(c),b=(b<<5)-b+d,b|=0;return b}function C(a,c,e){var b=window.navigator.userAgent;if(!1!==a&&(0<b.indexOf("MSIE ")||
  5870. b.match(/Trident.*rv\:11\./)))if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(new Blob([e]),a);else{if(c=document.createElement("iframe"))document.body.appendChild(c),c.setAttribute("style","display:none"),c.contentDocument.open("txt/html","replace"),c.contentDocument.write(e),c.contentDocument.close(),c.focus(),c.contentDocument.execCommand("SaveAs",!0,a),document.body.removeChild(c)}else if(b=document.createElement("a")){var h=null;b.style.display="none";!1!==a?b.download=
  5871. a:b.target="_blank";"object"==typeof e?(h=window.URL.createObjectURL(e),b.href=h):0<=c.toLowerCase().indexOf("base64,")?b.href=c+F(e):b.href=c+encodeURIComponent(e);document.body.appendChild(b);if(document.createEvent)null===Q&&(Q=document.createEvent("MouseEvents")),Q.initEvent("click",!0,!1),b.dispatchEvent(Q);else if(document.createEventObject)b.fireEvent("onclick");else if("function"==typeof b.onclick)b.onclick();h&&window.URL.revokeObjectURL(h);document.body.removeChild(b)}}function F(a){var b=
  5872. "",c,d,f,g,l,r,k=0;a=a.replace(/\x0d\x0a/g,"\n");d="";for(f=0;f<a.length;f++)g=a.charCodeAt(f),128>g?d+=String.fromCharCode(g):(127<g&&2048>g?d+=String.fromCharCode(g>>6|192):(d+=String.fromCharCode(g>>12|224),d+=String.fromCharCode(g>>6&63|128)),d+=String.fromCharCode(g&63|128));for(a=d;k<a.length;)c=a.charCodeAt(k++),d=a.charCodeAt(k++),f=a.charCodeAt(k++),g=c>>2,c=(c&3)<<4|d>>4,l=(d&15)<<2|f>>6,r=f&63,isNaN(d)?l=r=64:isNaN(f)&&(r=64),b=b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)+
  5873. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(r);return b}var a={consoleLog:!1,csvEnclosure:'"',csvSeparator:",",csvUseBOM:!0,displayTableName:!1,escape:!1,excelstyles:[],fileName:"tableExport",htmlContent:!1,ignoreColumn:[],ignoreRow:[],jsonScope:"all",jspdf:{orientation:"p",unit:"pt",format:"a4",margins:{left:20,
  5874. right:10,top:10,bottom:10},autotable:{styles:{cellPadding:2,rowHeight:12,fontSize:8,fillColor:255,textColor:50,fontStyle:"normal",overflow:"ellipsize",halign:"left",valign:"middle"},headerStyles:{fillColor:[52,73,94],textColor:255,fontStyle:"bold",halign:"center"},alternateRowStyles:{fillColor:245},tableExport:{onAfterAutotable:null,onBeforeAutotable:null,onTable:null,outputImages:!0}}},numbers:{html:{decimalMark:".",thousandsSeparator:","},output:{decimalMark:".",thousandsSeparator:","}},onCellData:null,
  5875. onCellHtmlData:null,outputMode:"file",pdfmake:{enabled:!1},tbodySelector:"tr",tfootSelector:"tr",theadSelector:"tr",tableName:"myTableName",type:"csv",worksheetName:"xlsWorksheetName"},t=this,Q=null,n=[],g=[],k=0,A=[],m="",H=[],y;c.extend(!0,a,u);H=S(t);if("csv"==a.type||"tsv"==a.type||"txt"==a.type){var D="",I=0,k=0,U=function(b,h,e){b.each(function(){m="";z(this,h,k,e+b.length,function(b,c,e){var d=m,h="";if(null!==b)if(b=x(b,c,e),c=null===b||""===b?"":b.toString(),"tsv"==a.type)b instanceof Date&&
  5876. b.toLocaleString(),h=P(c,"\t"," ");else if(b instanceof Date)h=a.csvEnclosure+b.toLocaleString()+a.csvEnclosure;else if(h=P(c,a.csvEnclosure,a.csvEnclosure+a.csvEnclosure),0<=h.indexOf(a.csvSeparator)||/[\r\n ]/g.test(h))h=a.csvEnclosure+h+a.csvEnclosure;m=d+(h+("tsv"==a.type?"\t":a.csvSeparator))});m=c.trim(m).substring(0,m.length-1);0<m.length&&(0<D.length&&(D+="\n"),D+=m);k++});return b.length},I=I+U(c(t).find("thead").first().find(a.theadSelector),"th,td",I);c(t).find("tbody").each(function(){I+=
  5877. U(c(this).find(a.tbodySelector),"td,th",I)});a.tfootSelector.length&&U(c(t).find("tfoot").first().find(a.tfootSelector),"td,th",I);D+="\n";!0===a.consoleLog&&console.log(D);if("string"===a.outputMode)return D;if("base64"===a.outputMode)return F(D);if("window"===a.outputMode){C(!1,"data:text/"+("csv"==a.type?"csv":"plain")+";charset=utf-8,",D);return}try{y=new Blob([D],{type:"text/"+("csv"==a.type?"csv":"plain")+";charset=utf-8"}),saveAs(y,a.fileName+"."+a.type,"csv"!=a.type||!1===a.csvUseBOM)}catch(b){C(a.fileName+
  5878. "."+a.type,"data:text/"+("csv"==a.type?"csv":"plain")+";charset=utf-8,"+("csv"==a.type&&a.csvUseBOM?"\ufeff":""),D)}}else if("sql"==a.type){var k=0,v="INSERT INTO `"+a.tableName+"` (",n=c(t).find("thead").first().find(a.theadSelector);n.each(function(){z(this,"th,td",k,n.length,function(a,c,e){v+="'"+x(a,c,e)+"',"});k++;v=c.trim(v);v=c.trim(v).substring(0,v.length-1)});v+=") VALUES ";c(t).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,
  5879. c(t).find("tfoot").find(a.tfootSelector));c(g).each(function(){m="";z(this,"td,th",k,n.length+g.length,function(a,c,e){m+="'"+x(a,c,e)+"',"});3<m.length&&(v+="("+m,v=c.trim(v).substring(0,v.length-1),v+="),");k++});v=c.trim(v).substring(0,v.length-1);v+=";";!0===a.consoleLog&&console.log(v);if("string"===a.outputMode)return v;if("base64"===a.outputMode)return F(v);try{y=new Blob([v],{type:"text/plain;charset=utf-8"}),saveAs(y,a.fileName+".sql")}catch(b){C(a.fileName+".sql","data:application/sql;charset=utf-8,",
  5880. v)}}else if("json"==a.type){var J=[],n=c(t).find("thead").first().find(a.theadSelector);n.each(function(){var a=[];z(this,"th,td",k,n.length,function(b,c,d){a.push(x(b,c,d))});J.push(a)});var V=[];c(t).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(t).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a={},h=0;z(this,"td,th",k,n.length+g.length,function(b,c,f){J.length?a[J[J.length-1][h]]=x(b,c,f):a[h]=x(b,c,f);h++});
  5881. !1===c.isEmptyObject(a)&&V.push(a);k++});u="";u="head"==a.jsonScope?JSON.stringify(J):"data"==a.jsonScope?JSON.stringify(V):JSON.stringify({header:J,data:V});!0===a.consoleLog&&console.log(u);if("string"===a.outputMode)return u;if("base64"===a.outputMode)return F(u);try{y=new Blob([u],{type:"application/json;charset=utf-8"}),saveAs(y,a.fileName+".json")}catch(b){C(a.fileName+".json","data:application/json;charset=utf-8;base64,",u)}}else if("xml"===a.type){var k=0,B='<?xml version="1.0" encoding="utf-8"?>',
  5882. B=B+"<tabledata><fields>",n=c(t).find("thead").first().find(a.theadSelector);n.each(function(){z(this,"th,td",k,n.length,function(a,c,e){B+="<field>"+x(a,c,e)+"</field>"});k++});var B=B+"</fields><data>",ga=1;c(t).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(t).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=1;m="";z(this,"td,th",k,n.length+g.length,function(b,c,d){m+="<column-"+a+">"+x(b,c,d)+"</column-"+a+
  5883. ">";a++});0<m.length&&"<column-1></column-1>"!=m&&(B+='<row id="'+ga+'">'+m+"</row>",ga++);k++});B+="</data></tabledata>";!0===a.consoleLog&&console.log(B);if("string"===a.outputMode)return B;if("base64"===a.outputMode)return F(B);try{y=new Blob([B],{type:"application/xml;charset=utf-8"}),saveAs(y,a.fileName+".xml")}catch(b){C(a.fileName+".xml","data:application/xml;charset=utf-8;base64,",B)}}else if("excel"==a.type||"xls"==a.type||"word"==a.type||"doc"==a.type){u="excel"==a.type||"xls"==a.type?"excel":
  5884. "word";var K="excel"==u?"xls":"doc",p='xmlns:x="urn:schemas-microsoft-com:office:'+u+'"',G="";c(t).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display"))}).each(function(){var b=c(this);k=0;H=S(this);G+="<table><thead>";n=b.find("thead").first().find(a.theadSelector);n.each(function(){m="";z(this,"th,td",k,n.length,function(b,e,d){if(null!==b){var h="";m+="<th";for(var f in a.excelstyles)if(a.excelstyles.hasOwnProperty(f)){var l=
  5885. c(b).css(a.excelstyles[f]);""!==l&&"0px none rgb(0, 0, 0)"!=l&&"rgba(0, 0, 0, 0)"!=l&&(h+=""===h?'style="':";",h+=a.excelstyles[f]+":"+l)}""!==h&&(m+=" "+h+'"');c(b).is("[colspan]")&&(m+=' colspan="'+c(b).attr("colspan")+'"');c(b).is("[rowspan]")&&(m+=' rowspan="'+c(b).attr("rowspan")+'"');m+=">"+x(b,e,d)+"</th>"}});0<m.length&&(G+="<tr>"+m+"</tr>");k++});G+="</thead><tbody>";b.find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,b.find("tfoot").find(a.tfootSelector));
  5886. c(g).each(function(){var b=c(this);m="";z(this,"td,th",k,n.length+g.length,function(e,d,h){if(null!==e){var f="",l=c(e).data("tableexport-msonumberformat");"undefined"==typeof l&&"function"===typeof a.onMsoNumberFormat&&(l=a.onMsoNumberFormat(e,d,h));"undefined"!=typeof l&&""!==l&&(f="style=\"mso-number-format:'"+l+"'");for(var g in a.excelstyles)a.excelstyles.hasOwnProperty(g)&&(l=c(e).css(a.excelstyles[g]),""===l&&(l=b.css(a.excelstyles[g])),""!==l&&"0px none rgb(0, 0, 0)"!=l&&"rgba(0, 0, 0, 0)"!=
  5887. l&&(f+=""===f?'style="':";",f+=a.excelstyles[g]+":"+l));m+="<td";""!==f&&(m+=" "+f+'"');c(e).is("[colspan]")&&(m+=' colspan="'+c(e).attr("colspan")+'"');c(e).is("[rowspan]")&&(m+=' rowspan="'+c(e).attr("rowspan")+'"');m+=">"+x(e,d,h).replace(/\n/g,"<br>")+"</td>"}});0<m.length&&(G+="<tr>"+m+"</tr>");k++});a.displayTableName&&(G+="<tr><td></td></tr><tr><td></td></tr><tr><td>"+x(c("<p>"+a.tableName+"</p>"))+"</td></tr>");G+="</tbody></table>";!0===a.consoleLog&&console.log(G)});p='<html xmlns:o="urn:schemas-microsoft-com:office:office" '+
  5888. p+' xmlns="http://www.w3.org/TR/REC-html40">'+('<meta http-equiv="content-type" content="application/vnd.ms-'+u+'; charset=UTF-8">')+"<head>";"excel"===u&&(p+="\x3c!--[if gte mso 9]>",p+="<xml>",p+="<x:ExcelWorkbook>",p+="<x:ExcelWorksheets>",p+="<x:ExcelWorksheet>",p+="<x:Name>",p+=a.worksheetName,p+="</x:Name>",p+="<x:WorksheetOptions>",p+="<x:DisplayGridlines/>",p+="</x:WorksheetOptions>",p+="</x:ExcelWorksheet>",p+="</x:ExcelWorksheets>",p+="</x:ExcelWorkbook>",p+="</xml>",p+="<![endif]--\x3e");
  5889. p+="<style>br {mso-data-placement:same-cell;}</style>";p+="</head>";p+="<body>";p+=G;p+="</body>";p+="</html>";!0===a.consoleLog&&console.log(p);if("string"===a.outputMode)return p;if("base64"===a.outputMode)return F(p);try{y=new Blob([p],{type:"application/vnd.ms-"+a.type}),saveAs(y,a.fileName+"."+K)}catch(b){C(a.fileName+"."+K,"data:application/vnd.ms-"+u+";base64,",p)}}else if("xlsx"==a.type){var ha=[],W=[],k=0,g=c(t).find("thead").first().find(a.theadSelector);c(t).find("tbody").each(function(){g.push.apply(g,
  5890. c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(t).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=[];z(this,"th,td",k,g.length,function(b,c,d){if("undefined"!==typeof b&&null!==b){var e=parseInt(b.getAttribute("colspan")),f=parseInt(b.getAttribute("rowspan"));b=x(b,c,d);""!==b&&b==+b&&(b=+b);W.forEach(function(b){if(k>=b.s.r&&k<=b.e.r&&a.length>=b.s.c&&a.length<=b.e.c)for(var c=0;c<=b.e.c-b.s.c;++c)a.push(null)});if(f||e)e=e||1,W.push({s:{r:k,c:a.length},
  5891. e:{r:k+(f||1)-1,c:a.length+e-1}});a.push(""!==b?b:null);if(e)for(f=0;f<e-1;++f)a.push(null)}});ha.push(a);k++});u=new T;K=na(ha);K["!merges"]=W;u.SheetNames.push(a.worksheetName);u.Sheets[a.worksheetName]=K;u=XLSX.write(u,{bookType:a.type,bookSST:!1,type:"binary"});try{y=new Blob([ma(u)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"}),saveAs(y,a.fileName+"."+a.type)}catch(b){C(a.fileName+"."+a.type,"data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8,",
  5892. y)}}else if("png"==a.type)html2canvas(c(t)[0]).then(function(b){b=b.toDataURL();for(var c=atob(b.substring(22)),e=new ArrayBuffer(c.length),d=new Uint8Array(e),f=0;f<c.length;f++)d[f]=c.charCodeAt(f);!0===a.consoleLog&&console.log(c);if("string"===a.outputMode)return c;if("base64"===a.outputMode)return F(b);if("window"===a.outputMode)window.open(b);else try{y=new Blob([e],{type:"image/png"}),saveAs(y,a.fileName+".png")}catch(q){C(a.fileName+".png","data:image/png,",y)}});else if("pdf"==a.type)if(!0===
  5893. a.pdfmake.enabled){var X=[],Y=[],k=0,n=c(this).find("thead").first().find(a.theadSelector);n.each(function(){var a=[];z(this,"th,td",k,n.length,function(b,c,f){a.push(x(b,c,f))});a.length&&Y.push(a);for(var c=X.length;c<a.length;c++)X.push("*");k++});c(this).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(this).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=[];z(this,"td,th",k,n.length+g.length,function(b,c,d){a.push(x(b,
  5894. c,d))});a.length&&Y.push(a);k++});pdfMake.createPdf({pageOrientation:"landscape",content:[{table:{headerRows:n.length,widths:X,body:Y}}]}).getBuffer(function(b){try{var c=new Blob([b],{type:"application/pdf"});saveAs(c,a.fileName+".pdf")}catch(e){C(a.fileName+".pdf","data:application/pdf;base64,",b)}})}else if(!1===a.jspdf.autotable){u={dim:{w:O(c(t).first().get(0),"width","mm"),h:O(c(t).first().get(0),"height","mm")},pagesplit:!1};var ia=new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format);
  5895. ia.addHTML(c(t).first(),a.jspdf.margins.left,a.jspdf.margins.top,u,function(){Z(ia,!1)})}else{var f=a.jspdf.autotable.tableExport;if("string"===typeof a.jspdf.format&&"bestfit"===a.jspdf.format.toLowerCase()){var L={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89]},R="",M="",ja=0;c(t).filter(":visible").each(function(){if("none"!=c(this).css("display")){var a=O(c(this).get(0),"width","pt");if(a>ja){a>L.a0[0]&&(R="a0",M="l");for(var f in L)L.hasOwnProperty(f)&&
  5896. L[f][1]>a&&(R=f,M="l",L[f][0]>a&&(M="p"));ja=a}}});a.jspdf.format=""===R?"a4":R;a.jspdf.orientation=""===M?"w":M}f.doc=new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format);!0===f.outputImages&&(f.images={});"undefined"!=typeof f.images&&(c(t).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display"))}).each(function(){var b=0;n=c(this).find("thead").find(a.theadSelector);c(this).find("tbody").each(function(){g.push.apply(g,
  5897. c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(this).find("tfoot").find(a.tfootSelector));c(g).each(function(){z(this,"td,th",n.length+b,n.length+g.length,function(a,b,d){"undefined"!==typeof a&&null!==a&&(b=c(a).children(),"undefined"!=typeof b&&0<b.length&&ba(a,b,f))});b++})}),n=[],g=[]);ka(f,function(b){c(t).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display"))}).each(function(){var b,
  5898. e=0;H=S(this);f.columns=[];f.rows=[];f.rowoptions={};if("function"===typeof f.onTable&&!1===f.onTable(c(this),a))return!0;a.jspdf.autotable.tableExport=null;var d=c.extend(!0,{},a.jspdf.autotable);a.jspdf.autotable.tableExport=f;d.margin={};c.extend(!0,d.margin,a.jspdf.margins);d.tableExport=f;"function"!==typeof d.beforePageContent&&(d.beforePageContent=function(a){1==a.pageCount&&a.table.rows.concat(a.table.headerRow).forEach(function(b){0<b.height&&(b.height+=(2-1.15)/2*b.styles.fontSize,a.table.height+=
  5899. (2-1.15)/2*b.styles.fontSize)})});"function"!==typeof d.createdHeaderCell&&(d.createdHeaderCell=function(a,b){a.styles=c.extend({},b.row.styles);if("undefined"!=typeof f.columns[b.column.dataKey]){var e=f.columns[b.column.dataKey];if("undefined"!=typeof e.rect){var g;a.contentWidth=e.rect.width;if("undefined"==typeof f.heightRatio||0===f.heightRatio)g=b.row.raw[b.column.dataKey].rowspan?b.row.raw[b.column.dataKey].rect.height/b.row.raw[b.column.dataKey].rowspan:b.row.raw[b.column.dataKey].rect.height,
  5900. f.heightRatio=a.styles.rowHeight/g;g=b.row.raw[b.column.dataKey].rect.height*f.heightRatio;g>a.styles.rowHeight&&(a.styles.rowHeight=g)}"undefined"!=typeof e.style&&!0!==e.style.hidden&&(a.styles.halign=e.style.align,"inherit"===d.styles.fillColor&&(a.styles.fillColor=e.style.bcolor),"inherit"===d.styles.textColor&&(a.styles.textColor=e.style.color),"inherit"===d.styles.fontStyle&&(a.styles.fontStyle=e.style.fstyle))}});"function"!==typeof d.createdCell&&(d.createdCell=function(a,b){var c=f.rowoptions[b.row.index+
  5901. ":"+b.column.dataKey];"undefined"!=typeof c&&"undefined"!=typeof c.style&&!0!==c.style.hidden&&(a.styles.halign=c.style.align,"inherit"===d.styles.fillColor&&(a.styles.fillColor=c.style.bcolor),"inherit"===d.styles.textColor&&(a.styles.textColor=c.style.color),"inherit"===d.styles.fontStyle&&(a.styles.fontStyle=c.style.fstyle))});"function"!==typeof d.drawHeaderCell&&(d.drawHeaderCell=function(a,b){var c=f.columns[b.column.dataKey];return(!0!==c.style.hasOwnProperty("hidden")||!0!==c.style.hidden)&&
  5902. 0<=c.rowIndex?aa(a,b,c):!1});"function"!==typeof d.drawCell&&(d.drawCell=function(a,b){var c=f.rowoptions[b.row.index+":"+b.column.dataKey];if(aa(a,b,c)){f.doc.rect(a.x,a.y,a.width,a.height,a.styles.fillStyle);if("undefined"!=typeof c&&"undefined"!=typeof c.kids&&0<c.kids.length){var d=a.height/c.rect.height;if(d>f.dh||"undefined"==typeof f.dh)f.dh=d;f.dw=a.width/c.rect.width;da(a,c.kids,f)}f.doc.autoTableText(a.text,a.textPos.x,a.textPos.y,{halign:a.styles.halign,valign:a.styles.valign})}return!1});
  5903. f.headerrows=[];n=c(this).find("thead").find(a.theadSelector);n.each(function(){b=0;f.headerrows[e]=[];z(this,"th,td",e,n.length,function(a,c,d){var g=fa(a);g.title=x(a,c,d);g.key=b++;g.rowIndex=e;f.headerrows[e].push(g)});e++});if(0<e)for(var k=e-1;0<=k;)c.each(f.headerrows[k],function(){var a=this;0<k&&null===this.rect&&(a=f.headerrows[k-1][this.key]);null!==a&&0<=a.rowIndex&&(!0!==a.style.hasOwnProperty("hidden")||!0!==a.style.hidden)&&f.columns.push(a)}),k=0<f.columns.length?-1:k-1;var m=0;g=
  5904. [];c(this).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(this).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=[];b=0;z(this,"td,th",e,n.length+g.length,function(d,e,g){if("undefined"===typeof f.columns[b]){var h={title:"",key:b,style:{hidden:!0}};f.columns.push(h)}"undefined"!==typeof d&&null!==d?(h=fa(d),h.kids=c(d).children()):(h=c.extend(!0,{},f.rowoptions[m+":"+(b-1)]),h.colspan=-1);f.rowoptions[m+":"+b++]=
  5905. h;a.push(x(d,e,g))});a.length&&(f.rows.push(a),m++);e++});if("function"===typeof f.onBeforeAutotable)f.onBeforeAutotable(c(this),f.columns,f.rows,d);f.doc.autoTable(f.columns,f.rows,d);if("function"===typeof f.onAfterAutotable)f.onAfterAutotable(c(this),d);a.jspdf.autotable.startY=f.doc.autoTableEndPosY()+d.margin.top});Z(f.doc,"undefined"!=typeof f.images&&!1===jQuery.isEmptyObject(f.images));"undefined"!=typeof f.headerrows&&(f.headerrows.length=0);"undefined"!=typeof f.columns&&(f.columns.length=
  5906. 0);"undefined"!=typeof f.rows&&(f.rows.length=0);delete f.doc;f.doc=null})}return this}})})(jQuery);
  5907. define("tableexport", ["jquery"], (function (global) {
  5908. return function () {
  5909. var ret, fn;
  5910. return ret || global.$.fn.extend;
  5911. };
  5912. }(this)));
  5913. /*
  5914. * bootstrap-table - v1.11.0 - 2016-07-02
  5915. * https://github.com/wenzhixin/bootstrap-table
  5916. * Copyright (c) 2016 zhixin wen
  5917. * Licensed MIT License
  5918. */
  5919. !function(a){"use strict";var b=a.fn.bootstrapTable.utils.sprintf,c={json:"JSON",xml:"XML",png:"PNG",csv:"CSV",txt:"TXT",sql:"SQL",doc:"MS-Word",excel:"MS-Excel",powerpoint:"MS-Powerpoint",pdf:"PDF"};a.extend(a.fn.bootstrapTable.defaults,{showExport:!1,exportDataType:"basic",exportTypes:["json","xml","csv","txt","sql","excel"],exportOptions:{}}),a.extend(a.fn.bootstrapTable.defaults.icons,{"export":"glyphicon-export icon-share"}),a.extend(a.fn.bootstrapTable.locales,{formatExport:function(){return"Export data"}}),a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales);var d=a.fn.bootstrapTable.Constructor,e=d.prototype.initToolbar;d.prototype.initToolbar=function(){if(this.showToolbar=this.options.showExport,e.apply(this,Array.prototype.slice.apply(arguments)),this.options.showExport){var d=this,f=this.$toolbar.find(">.btn-group"),g=f.find("div.export");if(!g.length){g=a(['<div class="export btn-group">','<button class="btn'+b(" btn-%s",this.options.buttonsClass)+b(" btn-%s",this.options.iconSize)+' dropdown-toggle" title="'+this.options.formatExport()+'" data-toggle="dropdown" type="button">',b('<i class="%s %s"></i> ',this.options.iconsPrefix,this.options.icons["export"]),'<span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">',"</ul>","</div>"].join("")).appendTo(f);var h=g.find(".dropdown-menu"),i=this.options.exportTypes;if("string"==typeof this.options.exportTypes){var j=this.options.exportTypes.slice(1,-1).replace(/ /g,"").split(",");i=[],a.each(j,function(a,b){i.push(b.slice(1,-1))})}a.each(i,function(a,b){c.hasOwnProperty(b)&&h.append(['<li data-type="'+b+'">','<a href="javascript:void(0)">',c[b],"</a>","</li>"].join(""))}),h.find("li").click(function(){var b=a(this).data("type"),c=function(){d.$el.tableExport(a.extend({},d.options.exportOptions,{type:b,escape:!1}))};if("all"===d.options.exportDataType&&d.options.pagination)d.$el.one("server"===d.options.sidePagination?"post-body.bs.table":"page-change.bs.table",function(){c(),d.togglePagination()}),d.togglePagination();else if("selected"===d.options.exportDataType){var e=d.getData(),f=d.getAllSelections();d.load(f),c(),d.load(e)}else c()})}}}}(jQuery);
  5920. define("bootstrap-table-export", ["bootstrap-table","tableexport"], (function (global) {
  5921. return function () {
  5922. var ret, fn;
  5923. return ret || global.$.fn.bootstrapTable.defaults;
  5924. };
  5925. }(this)));
  5926. /**
  5927. * @author: aperez <aperez@datadec.es>
  5928. * @version: v2.0.0
  5929. *
  5930. * @update Dennis Hernández <http://djhvscf.github.io/Blog>
  5931. */
  5932. !function ($) {
  5933. 'use strict';
  5934. var firstLoad = false;
  5935. var sprintf = $.fn.bootstrapTable.utils.sprintf;
  5936. var showAvdSearch = function (pColumns, that) {
  5937. var searchTitle = that.options.formatAdvancedSearch();
  5938. if (!$("#avdSearchModal" + "_" + that.options.idTable).hasClass("modal")) {
  5939. var vModal = sprintf("<div id=\"avdSearchModal%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"mySmallModalLabel\" aria-hidden=\"true\">", "_" + that.options.idTable);
  5940. vModal += "<div class=\"modal-dialog modal-xs\">";
  5941. vModal += " <div class=\"modal-content\">";
  5942. vModal += " <div class=\"modal-header\">";
  5943. vModal += " <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\" >&times;</button>";
  5944. vModal += sprintf(" <h4 class=\"modal-title\">%s</h4>", searchTitle);
  5945. vModal += " </div>";
  5946. vModal += " <div class=\"modal-body modal-body-custom\">";
  5947. vModal += sprintf(" <div class=\"container-fluid\" id=\"avdSearchModalContent%s\" style=\"padding-right: 0px;padding-left: 0px;\" >", "_" + that.options.idTable);
  5948. vModal += " </div>";
  5949. vModal += " </div>";
  5950. vModal += " <div class=\"modal-footer\">";
  5951. vModal += createFormBtn(that).join('');
  5952. vModal += " </div>";
  5953. vModal += " </div>";
  5954. vModal += " </div>";
  5955. vModal += "</div>";
  5956. $("body").append($(vModal));
  5957. var vFormAvd = createFormAvd(pColumns, that),
  5958. timeoutId = 0;
  5959. ;
  5960. $('#avdSearchModalContent' + "_" + that.options.idTable).append(vFormAvd.join(''));
  5961. if (that.options.sidePagination != 'server' || !that.options.url) {
  5962. $('#' + that.options.idForm).off('keyup blur', 'input').on('keyup blur', 'input', function (event) {
  5963. clearTimeout(timeoutId);
  5964. timeoutId = setTimeout(function () {
  5965. that.onColumnAdvancedSearch(event);
  5966. }, that.options.searchTimeOut);
  5967. });
  5968. } else {
  5969. }
  5970. // 提交搜索
  5971. $("#btnSubmitAvd" + "_" + that.options.idTable).click(function (event) {
  5972. that.onColumnAdvancedSearch();
  5973. });
  5974. // 重置搜索
  5975. $("#btnResetAvd" + "_" + that.options.idTable).click(function () {
  5976. $("#avdSearchModal" + "_" + that.options.idTable + " form")[0].reset();
  5977. that.onColumnAdvancedSearch();
  5978. });
  5979. $("#avdSearchModal" + "_" + that.options.idTable).modal();
  5980. } else {
  5981. $("#avdSearchModal" + "_" + that.options.idTable).modal();
  5982. }
  5983. };
  5984. var createFormAvd = function (pColumns, that) {
  5985. var htmlForm = [];
  5986. var opList = ['=', '>', '>=', '<', '<=', '!=', 'LIKE', 'LIKE %...%', 'NOT LIKE', 'IN(...)', 'NOT IN(...)', 'BETWEEN', 'NOT BETWEEN', 'IS NULL', 'IS NOT NULL'];
  5987. var selectList = [];
  5988. for (var i = 0; i < opList.length; i++) {
  5989. selectList.push("<option value='" + opList[i] + "'>" + opList[i] + "</option>");
  5990. }
  5991. var selectHtml = selectList.join('');
  5992. htmlForm.push(sprintf('<form class="form-horizontal" id="%s" action="%s" >', that.options.idForm, that.options.actionForm));
  5993. for (var i in pColumns) {
  5994. var vObjCol = pColumns[i];
  5995. if (!vObjCol.checkbox && vObjCol.field != 'operate' && vObjCol.visible && vObjCol.searchable) {
  5996. htmlForm.push('<div class="form-group">');
  5997. htmlForm.push(sprintf('<label class="col-sm-3 control-label">%s</label>', vObjCol.title));
  5998. if (that.options.sidePagination == 'server' && that.options.url) {
  5999. htmlForm.push('<div class="col-sm-2">');
  6000. htmlForm.push(sprintf('<select class="form-control" name="field-%s" data-name="%s">%s</select>', vObjCol.field, vObjCol.field, selectHtml));
  6001. htmlForm.push('</div>');
  6002. }
  6003. htmlForm.push('<div class="col-sm-6">');
  6004. htmlForm.push(sprintf('<input type="text" class="form-control input-md" name="%s" placeholder="%s" id="%s">', vObjCol.field, vObjCol.title, vObjCol.field));
  6005. htmlForm.push('</div>');
  6006. htmlForm.push('</div>');
  6007. }
  6008. }
  6009. htmlForm.push('</form>');
  6010. return htmlForm;
  6011. };
  6012. var createFormBtn = function (that) {
  6013. var htmlBtn = [];
  6014. var searchSubmit = that.options.formatAdvancedSubmitButton();
  6015. var searchReset = that.options.formatAdvancedResetButton();
  6016. var searchClose = that.options.formatAdvancedCloseButton();
  6017. htmlBtn.push('<div class="form-group">');
  6018. htmlBtn.push('<div class="col-sm-12 text-center">');
  6019. if (that.options.sidePagination == 'server' && that.options.url) {
  6020. htmlBtn.push(sprintf('<button type="button" id="btnSubmitAvd%s" class="btn btn-success" >%s</button> ', "_" + that.options.idTable, searchSubmit));
  6021. htmlBtn.push(sprintf('<button type="button" id="btnResetAvd%s" class="btn btn-default" >%s</button> ', "_" + that.options.idTable, searchReset));
  6022. } else {
  6023. htmlBtn.push(sprintf('<button type="button" id="btnCloseAvd%s" data-dismiss="modal" class="btn btn-default" >%s</button> ', "_" + that.options.idTable, searchClose));
  6024. }
  6025. htmlBtn.push('</div>');
  6026. htmlBtn.push('</div>');
  6027. return htmlBtn;
  6028. };
  6029. $.extend($.fn.bootstrapTable.defaults, {
  6030. advancedSearch: false,
  6031. idForm: 'advancedSearch',
  6032. actionForm: '',
  6033. idTable: undefined,
  6034. onColumnAdvancedSearch: function (field, text) {
  6035. return false;
  6036. }
  6037. });
  6038. $.extend($.fn.bootstrapTable.defaults.icons, {
  6039. advancedSearchIcon: 'glyphicon-search'
  6040. });
  6041. $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
  6042. 'column-advanced-search.bs.table': 'onColumnAdvancedSearch'
  6043. });
  6044. $.extend($.fn.bootstrapTable.locales, {
  6045. formatAdvancedSearch: function () {
  6046. return 'Advanced search';
  6047. },
  6048. formatAdvancedSubmitButton: function () {
  6049. return "Submit";
  6050. },
  6051. formatAdvancedResetButton: function () {
  6052. return "Reset";
  6053. },
  6054. formatAdvancedCloseButton: function () {
  6055. return "Close";
  6056. }
  6057. });
  6058. $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
  6059. var BootstrapTable = $.fn.bootstrapTable.Constructor,
  6060. _initToolbar = BootstrapTable.prototype.initToolbar,
  6061. _load = BootstrapTable.prototype.load,
  6062. _initSearch = BootstrapTable.prototype.initSearch;
  6063. BootstrapTable.prototype.initToolbar = function () {
  6064. _initToolbar.apply(this, Array.prototype.slice.apply(arguments));
  6065. if (!this.options.search) {
  6066. return;
  6067. }
  6068. if (!this.options.advancedSearch) {
  6069. return;
  6070. }
  6071. if (!this.options.idTable) {
  6072. return;
  6073. }
  6074. var that = this,
  6075. html = [];
  6076. html.push(sprintf('<div class="columns columns-%s btn-group pull-%s" role="group">', this.options.buttonsAlign, this.options.buttonsAlign));
  6077. html.push(sprintf('<button class="btn btn-default%s' + '" type="button" name="advancedSearch" title="%s">', that.options.iconSize === undefined ? '' : ' btn-' + that.options.iconSize, that.options.formatAdvancedSearch()));
  6078. html.push(sprintf('<i class="%s %s"></i>', that.options.iconsPrefix, that.options.icons.advancedSearchIcon))
  6079. html.push('</button></div>');
  6080. that.$toolbar.prepend(html.join(''));
  6081. that.$toolbar.find('button[name="advancedSearch"]')
  6082. .off('click').on('click', function () {
  6083. showAvdSearch(that.columns, that);
  6084. });
  6085. };
  6086. BootstrapTable.prototype.load = function (data) {
  6087. _load.apply(this, Array.prototype.slice.apply(arguments));
  6088. if (!this.options.advancedSearch) {
  6089. return;
  6090. }
  6091. if (typeof this.options.idTable === 'undefined') {
  6092. return;
  6093. } else {
  6094. if (!firstLoad) {
  6095. var height = parseInt($(".bootstrap-table").height());
  6096. height += 10;
  6097. $("#" + this.options.idTable).bootstrapTable("resetView", {height: height});
  6098. firstLoad = true;
  6099. }
  6100. }
  6101. };
  6102. BootstrapTable.prototype.initSearch = function () {
  6103. _initSearch.apply(this, Array.prototype.slice.apply(arguments));
  6104. if (!this.options.advancedSearch) {
  6105. return;
  6106. }
  6107. var that = this;
  6108. var fp = $.isEmptyObject(this.filterColumnsPartial) ? null : this.filterColumnsPartial;
  6109. this.data = fp ? $.grep(this.data, function (item, i) {
  6110. for (var key in fp) {
  6111. var fval = fp[key].toLowerCase();
  6112. var value = item[key];
  6113. value = $.fn.bootstrapTable.utils.calculateObjectValue(that.header,
  6114. that.header.formatters[$.inArray(key, that.header.fields)],
  6115. [value, item, i], value);
  6116. if (!($.inArray(key, that.header.fields) !== -1 &&
  6117. (typeof value === 'string' || typeof value === 'number') &&
  6118. (value + '').toLowerCase().indexOf(fval) !== -1)) {
  6119. return false;
  6120. }
  6121. }
  6122. return true;
  6123. }) : this.data;
  6124. };
  6125. BootstrapTable.prototype.onColumnAdvancedSearch = function (event) {
  6126. if (typeof event == 'undefined') {
  6127. var op = {};
  6128. var filter = {};
  6129. $("#avdSearchModalContent_" + this.options.idTable + " select").each(function () {
  6130. var name = $(this).data("name");
  6131. var sym = $(this).val();
  6132. var value = $("input[name='" + name + "']").val();
  6133. if (value == '' && sym.indexOf("NULL") == -1) {
  6134. return true;
  6135. }
  6136. op[name] = sym;
  6137. filter[name] = value;
  6138. });
  6139. // 追加查询关键字
  6140. this.options.pageNumber = 1;
  6141. this.refresh({query: {filter: JSON.stringify(filter), op: JSON.stringify(op)}});
  6142. } else {
  6143. var text = $.trim($(event.currentTarget).val());
  6144. var $field = $(event.currentTarget)[0].id;
  6145. if ($.isEmptyObject(this.filterColumnsPartial)) {
  6146. this.filterColumnsPartial = {};
  6147. }
  6148. if (text) {
  6149. this.filterColumnsPartial[$field] = text;
  6150. } else {
  6151. delete this.filterColumnsPartial[$field];
  6152. }
  6153. this.options.pageNumber = 1;
  6154. this.onSearch(event);
  6155. // this.updatePagination();
  6156. this.trigger('column-advanced-search', $field, text);
  6157. }
  6158. };
  6159. }(jQuery);
  6160. define("bootstrap-table-advancedsearch", ["bootstrap-table"], (function (global) {
  6161. return function () {
  6162. var ret, fn;
  6163. return ret || global.$.fn.bootstrapTable.defaults;
  6164. };
  6165. }(this)));
  6166. define('table',['jquery', 'bootstrap', 'backend', 'config', 'toastr', 'moment', 'bootstrap-table', 'bootstrap-table-lang', 'bootstrap-table-mobile', 'bootstrap-table-export', 'bootstrap-table-advancedsearch'], function ($, undefined, Backend, Config, Toastr, Moment) {
  6167. var Table = {
  6168. list: {},
  6169. // Bootstrap-table 基础配置
  6170. defaults: {
  6171. url: '',
  6172. sidePagination: 'server',
  6173. method: 'get',
  6174. toolbar: "#toolbar",
  6175. search: true,
  6176. advancedSearch: true,
  6177. idTable: 'advancedTable',
  6178. showExport: true,
  6179. pagination: true,
  6180. clickToSelect: true,
  6181. showRefresh: false,
  6182. locale: Config.language.replace('_', '-'),
  6183. showToggle: true,
  6184. showColumns: true,
  6185. sortName: 'id',
  6186. sortOrder: 'desc',
  6187. paginationFirstText: __("First"),
  6188. paginationPreText: __("Previous"),
  6189. paginationNextText: __("Next"),
  6190. paginationLastText: __("Last"),
  6191. mobileResponsive: true,
  6192. checkOnInit: true,
  6193. extend: {
  6194. index_url: '',
  6195. add_url: '',
  6196. edit_url: '',
  6197. del_url: '',
  6198. multi_url: '',
  6199. dragsort_url: 'ajax/weigh',
  6200. }
  6201. },
  6202. // Bootstrap-table 列配置
  6203. columnDefaults: {
  6204. align: 'center',
  6205. valign: 'middle',
  6206. },
  6207. config: {
  6208. firsttd: 'tbody tr td:first-child',
  6209. toolbar: '.toolbar',
  6210. refreshbtn: '.btn-refresh',
  6211. addbtn: '.btn-add',
  6212. editbtn: '.btn-edit',
  6213. delbtn: '.btn-del',
  6214. multibtn: '.btn-multi',
  6215. disabledbtn: '.btn-disabled',
  6216. editonebtn: '.btn-editone',
  6217. dragsortfield: 'weigh',
  6218. },
  6219. api: {
  6220. init: function (defaults, columnDefaults, locales) {
  6221. defaults = defaults ? defaults : {};
  6222. columnDefaults = columnDefaults ? columnDefaults : {};
  6223. locales = locales ? locales : {};
  6224. // 写入bootstrap-table默认配置
  6225. $.extend(true, $.fn.bootstrapTable.defaults, Table.defaults, defaults);
  6226. // 写入bootstrap-table column配置
  6227. $.extend($.fn.bootstrapTable.columnDefaults, Table.columnDefaults, columnDefaults);
  6228. // 写入bootstrap-table locale配置
  6229. $.extend($.fn.bootstrapTable.locales[Table.defaults.locale], {
  6230. formatAdvancedSearch: function () {
  6231. return __('Advanced search');
  6232. },
  6233. formatAdvancedSubmitButton: function () {
  6234. return __("Submit");
  6235. },
  6236. formatAdvancedResetButton: function () {
  6237. return __("Reset");
  6238. },
  6239. formatAdvancedCloseButton: function () {
  6240. return __("Close");
  6241. }
  6242. }, locales);
  6243. },
  6244. // 绑定事件
  6245. bindevent: function (table) {
  6246. //Bootstrap-table的父元素,包含table,toolbar,pagnation
  6247. var parenttable = table.closest('.bootstrap-table');
  6248. //Bootstrap-table配置
  6249. var options = table.bootstrapTable('getOptions');
  6250. //Bootstrap操作区
  6251. var toolbar = $(options.toolbar, parenttable);
  6252. //当刷新表格时
  6253. table.on('load-error.bs.table', function (status, res) {
  6254. Toastr.error(__('Unknown data format'));
  6255. });
  6256. //当刷新表格时
  6257. table.on('refresh.bs.table', function (e, settings, data) {
  6258. $(Table.config.refreshbtn, toolbar).find(".fa").addClass("fa-spin");
  6259. });
  6260. //当双击单元格时
  6261. table.on('dbl-click-row.bs.table', function (e, row, element, field) {
  6262. $(Table.config.editonebtn, element).trigger("click");
  6263. });
  6264. //当内容渲染完成后
  6265. table.on('post-body.bs.table', function (e, settings, json, xhr) {
  6266. $(Table.config.refreshbtn, toolbar).find(".fa").removeClass("fa-spin");
  6267. // 挺拽选择,需要重新绑定事件
  6268. require(['drag', 'drop'], function () {
  6269. $(Table.config.firsttd, table).drag("start", function (ev, dd) {
  6270. return $('<div class="selection" />').css('opacity', .65).appendTo(document.body);
  6271. }).drag(function (ev, dd) {
  6272. $(dd.proxy).css({
  6273. top: Math.min(ev.pageY, dd.startY),
  6274. left: Math.min(ev.pageX, dd.startX),
  6275. height: Math.abs(ev.pageY - dd.startY),
  6276. width: Math.abs(ev.pageX - dd.startX)
  6277. });
  6278. }).drag("end", function (ev, dd) {
  6279. $(dd.proxy).remove();
  6280. });
  6281. $(Table.config.firsttd, table).drop("start", function () {
  6282. Table.api.toggleattr(this);
  6283. }).drop(function () {
  6284. Table.api.toggleattr(this);
  6285. }).drop("end", function () {
  6286. Table.api.toggleattr(this);
  6287. });
  6288. $.drop({
  6289. multi: true
  6290. });
  6291. });
  6292. });
  6293. // 处理选中筛选框后按钮的状态统一变更
  6294. table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table', function () {
  6295. $(Table.config.disabledbtn, toolbar).toggleClass('disabled', !table.bootstrapTable('getSelections').length);
  6296. });
  6297. // 刷新按钮事件
  6298. $(toolbar).on('click', Table.config.refreshbtn, function () {
  6299. table.bootstrapTable('refresh');
  6300. });
  6301. // 添加按钮事件
  6302. $(toolbar).on('click', Table.config.addbtn, function () {
  6303. var ids = Table.api.selectedids(table);
  6304. Backend.api.open(options.extend.add_url + "/ids/" + ids.join(","), __('Add'));
  6305. });
  6306. // 编辑按钮事件
  6307. $(toolbar).on('click', Table.config.editbtn, function () {
  6308. var ids = Table.api.selectedids(table);
  6309. //循环弹出多个编辑框
  6310. $.each(ids, function (i, j) {
  6311. Backend.api.open(options.extend.edit_url + "/ids/" + j, __('Edit'));
  6312. });
  6313. });
  6314. // 批量操作按钮事件
  6315. $(toolbar).on('click', Table.config.multibtn, function () {
  6316. var ids = Table.api.selectedids(table);
  6317. Table.api.multi($(this).data("action"), ids, table, this);
  6318. });
  6319. // 批量删除按钮事件
  6320. $(toolbar).on('click', Table.config.delbtn, function () {
  6321. var that = this;
  6322. var ids = Table.api.selectedids(table);
  6323. var index = Backend.api.layer.confirm(
  6324. __('Are you sure you want to delete the %s selected item?', ids.length),
  6325. {icon: 3, title: __('Warning'), offset: 0, shadeClose: true},
  6326. function () {
  6327. Table.api.multi("del", ids, table, that);
  6328. Backend.api.layer.close(index);
  6329. }
  6330. );
  6331. });
  6332. // 拖拽排序
  6333. require(['dragsort'], function () {
  6334. //绑定拖动排序
  6335. $("tbody", table).dragsort({
  6336. itemSelector: 'tr',
  6337. dragSelector: "a.btn-dragsort",
  6338. dragEnd: function () {
  6339. var data = table.bootstrapTable('getData');
  6340. var current = data[parseInt($(this).data("index"))];
  6341. //改变的值和改变的ID集合
  6342. var ids = $.map($("tbody tr:visible", table), function (tr) {
  6343. return data[parseInt($(tr).data("index"))].id;
  6344. });
  6345. var changeid = current.id;
  6346. var pid = typeof current.pid != 'undefined' ? current.pid : '';
  6347. var options = {
  6348. url: table.bootstrapTable('getOptions').extend.dragsort_url,
  6349. data: {
  6350. ids: ids.join(','),
  6351. changeid: changeid,
  6352. pid: pid,
  6353. field: Table.config.dragsortfield,
  6354. orderway: table.bootstrapTable('getOptions').sortOrder,
  6355. table: table.bootstrapTable('getOptions').extend.table
  6356. }
  6357. };
  6358. Backend.api.ajax(options, function (content) {
  6359. Toastr.success(__('Operation completed'));
  6360. table.bootstrapTable('refresh');
  6361. });
  6362. },
  6363. placeHolderTemplate: ""
  6364. });
  6365. });
  6366. var id = table.attr("id");
  6367. Table.list[id] = table;
  6368. return table;
  6369. },
  6370. // 批量操作请求
  6371. multi: function (action, ids, table, element) {
  6372. var options = table.bootstrapTable('getOptions');
  6373. var url = action == "del" ? options.extend.del_url : options.extend.multi_url;
  6374. url = url + "/ids/" + ($.isArray(ids) ? ids.join(",") : ids);
  6375. var options = {url: url, data: {action: action, ids: ids, params: element ? $(element).data("params") : ''}};
  6376. Backend.api.ajax(options, function (content) {
  6377. Toastr.success(__('Operation completed'));
  6378. table.bootstrapTable('refresh');
  6379. });
  6380. },
  6381. // 单元格元素事件
  6382. events: {
  6383. operate: {
  6384. 'click .btn-editone': function (e, value, row, index) {
  6385. var options = $(this).closest('table').bootstrapTable('getOptions');
  6386. Backend.api.open(options.extend.edit_url + "/ids/" + row.id, __('Edit'));
  6387. },
  6388. 'click .btn-delone': function (e, value, row, index) {
  6389. var that = this;
  6390. var index = Backend.api.layer.confirm(
  6391. __('Are you sure you want to delete this item?'),
  6392. {icon: 3, title: __('Warning'), offset: [$(that).offset().top, $(that).offset().left - 260], shadeClose: true},
  6393. function () {
  6394. var table = $(that).closest('table');
  6395. Table.api.multi("del", row.id, table, that);
  6396. Backend.api.layer.close(index);
  6397. }
  6398. );
  6399. }
  6400. }
  6401. },
  6402. // 单元格数据格式化
  6403. formatter: {
  6404. icon: function (value, row, index) {
  6405. //渲染fontawesome图标
  6406. return '<i class="fa fa-' + value + '"></i> ' + value;
  6407. },
  6408. image: function (value, row, index) {
  6409. return '<img class="img-rounded img-sm" src="' + (value.indexOf("http") === 0 ? '' : Config.upload.cdnurl) + value + '" />';
  6410. },
  6411. status: function (value, row, index) {
  6412. //渲染状态
  6413. var html = '';
  6414. if (value == 'normal') {
  6415. html = '<span class="text-success"><i class="fa fa-circle"></i> ' + __('Normal') + '</span>';
  6416. } else {
  6417. html = '<span class="text-default"><i class="fa fa-circle"></i> ' + __('Hidden') + '</span>';
  6418. }
  6419. return html;
  6420. },
  6421. url: function (value, row, index) {
  6422. return '<a href="' + value + '" target="_blank" class="label bg-green">' + value + '</a>';
  6423. },
  6424. flag: function (value, row, index) {
  6425. var flagstext = __('Flags');
  6426. var flagscolor = {t: 'red', i: 'blue', r: 'green', h: 'yellow'};
  6427. if (!value)
  6428. return value;
  6429. //渲染Flag
  6430. var html = [];
  6431. var arr = value.split(',');
  6432. arr.forEach(function (value) {
  6433. html.push('<span class="label bg-' + (typeof flagscolor[value] != 'undefined' ? flagscolor[value] : 'primary') + '">' + (typeof flagstext[value] !== 'undefined' ? flagstext[value] : '') + '</span>');
  6434. });
  6435. return html.join(' ');
  6436. },
  6437. datetime: function (value, row, index) {
  6438. return value ? Moment(parseInt(value) * 1000).format("YYYY-MM-DD HH:mm:ss") : __('None');
  6439. },
  6440. operate: function (value, row, index, table) {
  6441. var showweigh = true;
  6442. var showedit = true;
  6443. var showdel = true;
  6444. if (typeof table != 'undefined') {
  6445. var options = table.bootstrapTable('getOptions');
  6446. if (options.extend.del_url == '')
  6447. showdel = false;
  6448. if (options.extend.edit_url == '')
  6449. showedit = false;
  6450. }
  6451. showweigh = typeof row[Table.config.dragsortfield] != 'undefined' ? true : false;
  6452. //行操作
  6453. var html = [];
  6454. if (showweigh)
  6455. html.push('<a href="javascript:;" class="btn btn-primary btn-dragsort btn-xs"><i class="fa fa-arrows"></i></a>');
  6456. if (showedit)
  6457. html.push('<a href="javascript:;" class="btn btn-success btn-editone btn-xs"><i class="fa fa-pencil"></i></a>');
  6458. if (showdel)
  6459. html.push('<a href="javascript:;" class="btn btn-danger btn-delone btn-xs"><i class="fa fa-trash"></i></a>');
  6460. return html.join(' ');
  6461. }
  6462. },
  6463. // 获取选中的条目ID集合
  6464. selectedids: function (table) {
  6465. return $.map(table.bootstrapTable('getSelections'), function (row) {
  6466. return row.id
  6467. });
  6468. },
  6469. // 切换复选框状态
  6470. toggleattr: function (table) {
  6471. $("input[type='checkbox']", table).trigger('click');
  6472. }
  6473. },
  6474. };
  6475. return Table;
  6476. });
  6477. /**
  6478. * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
  6479. * v1.5.1
  6480. *
  6481. * Copyright 2013, Moxiecode Systems AB
  6482. * Released under GPL License.
  6483. *
  6484. * License: http://www.plupload.com/license
  6485. * Contributing: http://www.plupload.com/contributing
  6486. *
  6487. * Date: 2016-11-14
  6488. */
  6489. !function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.moxie};"function"==typeof define&&define.amd?define("moxie",[],i):"object"==typeof module&&module.exports?module.exports=i():e.moxie=i()}(this||window,function(){!function(e,t){"use strict";function i(e,t){for(var i,n=[],r=0;r<e.length;++r){if(i=s[e[r]]||o(e[r]),!i)throw"module definition dependecy not found: "+e[r];n.push(i)}t.apply(null,n)}function n(e,n,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(n===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";i(n,function(){s[e]=r.apply(null,arguments)})}function r(e){return!!s[e]}function o(t){for(var i=e,n=t.split(/[.\/]/),r=0;r<n.length;++r){if(!i[n[r]])return;i=i[n[r]]}return i}function a(i){for(var n=0;n<i.length;n++){for(var r=e,o=i[n],a=o.split(/[.\/]/),u=0;u<a.length-1;++u)r[a[u]]===t&&(r[a[u]]={}),r=r[a[u]];r[a[a.length-1]]=s[o]}}var s={};n("moxie/core/utils/Basic",[],function(){function e(e){var t;return e===t?"undefined":null===e?"null":e.nodeType?"node":{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()}function t(){return n(!1,arguments)}function i(){return n(!0,arguments)}function n(t,i){var r,a=i[0];return o(i,function(i,s){s>0&&o(i,function(i,o){return i===r||t&&a[o]===r?!0:(e(a[o])===e(i)&&-1!==c(e(i),["array","object"])?n(t,[a[o],i]):a[o]=i,void 0)})}),a}function r(e,t){function i(){this.constructor=e}for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__parent__=t.prototype,e}function o(e,t){var i,n,r,o;if(e){try{i=e.length}catch(a){i=o}if(i===o||"number"!=typeof i){for(n in e)if(e.hasOwnProperty(n)&&t(e[n],n)===!1)return}else for(r=0;i>r;r++)if(t(e[r],r)===!1)return}}function a(t){var i;if(!t||"object"!==e(t))return!0;for(i in t)return!1;return!0}function s(t,i){function n(r){"function"===e(t[r])&&t[r](function(e){++r<o&&!e?n(r):i(e)})}var r=0,o=t.length;"function"!==e(i)&&(i=function(){}),t&&t.length||i(),n(r)}function u(e,t){var i=0,n=e.length,r=new Array(n);o(e,function(e,o){e(function(e){if(e)return t(e);var a=[].slice.call(arguments);a.shift(),r[o]=a,i++,i===n&&(r.unshift(null),t.apply(this,r))})})}function c(e,t){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e);for(var i=0,n=t.length;n>i;i++)if(t[i]===e)return i}return-1}function l(t,i){var n=[];"array"!==e(t)&&(t=[t]),"array"!==e(i)&&(i=[i]);for(var r in t)-1===c(t[r],i)&&n.push(t[r]);return n.length?n:!1}function d(e,t){var i=[];return o(e,function(e){-1!==c(e,t)&&i.push(e)}),i.length?i:null}function m(e){var t,i=[];for(t=0;t<e.length;t++)i[t]=e[t];return i}function h(e){return e?String.prototype.trim?String.prototype.trim.call(e):e.toString().replace(/^\s*/,"").replace(/\s*$/,""):e}function f(e){if("string"!=typeof e)return e;var t,i={t:1099511627776,g:1073741824,m:1048576,k:1024};return e=/^([0-9\.]+)([tmgk]?)$/.exec(e.toLowerCase().replace(/[^0-9\.tmkg]/g,"")),t=e[2],e=+e[1],i.hasOwnProperty(t)&&(e*=i[t]),Math.floor(e)}function p(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e(t)?t:""})}function g(e,t){var i=this;setTimeout(function(){e.call(i)},t||1)}var x=function(){var e=0;return function(t){var i,n=(new Date).getTime().toString(32);for(i=0;5>i;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}();return{guid:x,typeOf:e,extend:t,extendIf:i,inherit:r,each:o,isEmptyObj:a,inSeries:s,inParallel:u,inArray:c,arrayDiff:l,arrayIntersect:d,toArray:m,trim:h,sprintf:p,parseSizeStr:f,delay:g}}),n("moxie/core/utils/Encode",[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},i=function(e,i){if("function"==typeof window.atob)return i?t(window.atob(e)):window.atob(e);var n,r,o,a,s,u,c,l,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,h=0,f="",p=[];if(!e)return e;e+="";do a=d.indexOf(e.charAt(m++)),s=d.indexOf(e.charAt(m++)),u=d.indexOf(e.charAt(m++)),c=d.indexOf(e.charAt(m++)),l=a<<18|s<<12|u<<6|c,n=255&l>>16,r=255&l>>8,o=255&l,p[h++]=64==u?String.fromCharCode(n):64==c?String.fromCharCode(n,r):String.fromCharCode(n,r,o);while(m<e.length);return f=p.join(""),i?t(f):f},n=function(t,i){if(i&&(t=e(t)),"function"==typeof window.btoa)return window.btoa(t);var n,r,o,a,s,u,c,l,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,h=0,f="",p=[];if(!t)return t;do n=t.charCodeAt(m++),r=t.charCodeAt(m++),o=t.charCodeAt(m++),l=n<<16|r<<8|o,a=63&l>>18,s=63&l>>12,u=63&l>>6,c=63&l,p[h++]=d.charAt(a)+d.charAt(s)+d.charAt(u)+d.charAt(c);while(m<t.length);f=p.join("");var g=t.length%3;return(g?f.slice(0,g-3):f)+"===".slice(g||3)};return{utf8_encode:e,utf8_decode:t,atob:i,btoa:n}}),n("moxie/core/utils/Env",["moxie/core/utils/Basic"],function(e){function t(e,t,i){var n=0,r=0,o=0,a={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},s=function(e){return e=(""+e).replace(/[_\-+]/g,"."),e=e.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),e.length?e.split("."):[-8]},u=function(e){return e?isNaN(e)?a[e]||-7:parseInt(e,10):0};for(e=s(e),t=s(t),r=Math.max(e.length,t.length),n=0;r>n;n++)if(e[n]!=t[n]){if(e[n]=u(e[n]),t[n]=u(t[n]),e[n]<t[n]){o=-1;break}if(e[n]>t[n]){o=1;break}}if(!i)return o;switch(i){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var i=function(e){var t="",i="?",n="function",r="undefined",o="object",a="name",s="version",u={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},c={rgx:function(){for(var t,i,a,s,u,c,l,d=0,m=arguments;d<m.length;d+=2){var h=m[d],f=m[d+1];if(typeof t===r){t={};for(s in f)u=f[s],typeof u===o?t[u[0]]=e:t[u]=e}for(i=a=0;i<h.length;i++)if(c=h[i].exec(this.getUA())){for(s=0;s<f.length;s++)l=c[++a],u=f[s],typeof u===o&&u.length>0?2==u.length?t[u[0]]=typeof u[1]==n?u[1].call(this,l):u[1]:3==u.length?t[u[0]]=typeof u[1]!==n||u[1].exec&&u[1].test?l?l.replace(u[1],u[2]):e:l?u[1].call(this,l,u[2]):e:4==u.length&&(t[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):e):t[u]=l?l:e;break}if(c)break}return t},str:function(t,n){for(var r in n)if(typeof n[r]===o&&n[r].length>0){for(var a=0;a<n[r].length;a++)if(u.has(n[r][a],t))return r===i?e:r}else if(u.has(n[r],t))return r===i?e:r;return t}},l={browser:{oldsafari:{major:{1:["/8","/1","/3"],2:"/4","?":"/"},version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2000:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",RT:"ARM"}}}},d={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[a,s],[/\s(opr)\/([\w\.]+)/i],[[a,"Opera"],s],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i],[a,s],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[a,"IE"],s],[/(edge)\/((\d+)?[\w\.]+)/i],[a,s],[/(yabrowser)\/([\w\.]+)/i],[[a,"Yandex"],s],[/(comodo_dragon)\/([\w\.]+)/i],[[a,/_/g," "],s],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i],[a,s],[/(dolfin)\/([\w\.]+)/i],[[a,"Dolphin"],s],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[a,"Chrome"],s],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],[s,[a,"MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[s,[a,"Android Browser"]],[/FBAV\/([\w\.]+);/i],[s,[a,"Facebook"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[s,[a,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[s,a],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[a,[s,c.str,l.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[a,s],[/(navigator|netscape)\/([\w\.-]+)/i],[[a,"Netscape"],s],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[a,s]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[s,[a,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[a,s],[/rv\:([\w\.]+).*(gecko)/i],[s,a]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[a,s],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[a,[s,c.str,l.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[a,"Windows"],[s,c.str,l.os.windows.version]],[/\((bb)(10);/i],[[a,"BlackBerry"],s],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[a,s],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[a,"Symbian"],s],[/\((series40);/i],[a],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[a,"Firefox OS"],s],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[a,s],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[a,"Chromium OS"],s],[/(sunos)\s?([\w\.]+\d)*/i],[[a,"Solaris"],s],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[a,s],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[a,"iOS"],[s,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[a,"Mac OS"],[s,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[a,s]]},m=function(e){var i=e||(window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:t);this.getBrowser=function(){return c.rgx.apply(this,d.browser)},this.getEngine=function(){return c.rgx.apply(this,d.engine)},this.getOS=function(){return c.rgx.apply(this,d.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS()}},this.getUA=function(){return i},this.setUA=function(e){return i=e,this},this.setUA(i)};return m}(),n=function(){var t={define_property:function(){return!1}(),create_canvas:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))}(),return_response_type:function(t){try{if(-1!==e.inArray(t,["","text","document"]))return!0;if(window.XMLHttpRequest){var i=new XMLHttpRequest;if(i.open("get","/"),"responseType"in i)return i.responseType=t,i.responseType!==t?!1:!0}}catch(n){}return!1},use_data_uri:function(){var e=new Image;return e.onload=function(){t.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return t.use_data_uri&&("IE"!==o.browser||o.version>=9)},use_data_uri_of:function(e){return t.use_data_uri&&33e3>e||t.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var e=document.createElement("input");return e.setAttribute("type","file"),!e.disabled}};return function(i){var n=[].slice.call(arguments);return n.shift(),"function"===e.typeOf(t[i])?t[i].apply(this,n):!!t[i]}}(),r=(new i).getResult(),o={can:n,uaParser:i,browser:r.browser.name,version:r.browser.version,os:r.os.name,osVersion:r.os.version,verComp:t,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return o.OS=o.os,o}),n("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(e){function t(e,t){var i;for(i in e)if(e[i]===t)return i;return null}return{RuntimeError:function(){function i(e,i){this.code=e,this.name=t(n,e),this.message=this.name+(i||": RuntimeError "+this.code)}var n={NOT_INIT_ERR:1,EXCEPTION_ERR:3,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(i,n),i.prototype=Error.prototype,i}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": ImageError "+this.code}var n={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3};return e.extend(i,n),i.prototype=Error.prototype,i}(),FileException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": FileException "+this.code}var n={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(i,n),i.prototype=Error.prototype,i}(),DOMException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": DOMException "+this.code}var n={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(i,n),i.prototype=Error.prototype,i}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),n("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},i=function(e,t){if(!e.className)return!1;var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return i.test(e.className)},n=function(e,t){i(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(i,function(e,t,i){return" "===t&&" "===i?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,i){function n(e){var t,i,n=0,r=0;return e&&(i=e.getBoundingClientRect(),t="CSS1Compat"===c.compatMode?c.documentElement:c.body,n=i.left+t.scrollLeft,r=i.top+t.scrollTop),{x:n,y:r}}var r,o,a,s=0,u=0,c=document;if(t=t,i=i||c.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!c.documentMode||c.documentMode<8))return o=n(t),a=n(i),{x:o.x-a.x,y:o.y-a.y};for(r=t;r&&r!=i&&r.nodeType;)s+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!=i&&r.nodeType;)s-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;return{x:s,y:u}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:i,addClass:n,removeClass:r,getStyle:o,getPos:a,getSize:s}}),n("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(e,t,i){function n(){this.uid=i.guid()}var r={};return i.extend(n.prototype,{init:function(){this.uid||(this.uid=i.guid("uid_"))},addEventListener:function(e,t,n,o){var a,s=this;return this.hasOwnProperty("uid")||(this.uid=i.guid("uid_")),e=i.trim(e),/\s/.test(e)?(i.each(e.split(/\s+/),function(e){s.addEventListener(e,t,n,o)}),void 0):(e=e.toLowerCase(),n=parseInt(n,10)||0,a=r[this.uid]&&r[this.uid][e]||[],a.push({fn:t,priority:n,scope:o||this}),r[this.uid]||(r[this.uid]={}),r[this.uid][e]=a,void 0)},hasEventListener:function(e){var t=e?r[this.uid]&&r[this.uid][e]:r[this.uid];return t?t:!1},removeEventListener:function(e,t){var n,o,a=this;if(e=e.toLowerCase(),/\s/.test(e))return i.each(e.split(/\s+/),function(e){a.removeEventListener(e,t)}),void 0;if(n=r[this.uid]&&r[this.uid][e]){if(t){for(o=n.length-1;o>=0;o--)if(n[o].fn===t){n.splice(o,1);break}}else n=[];n.length||(delete r[this.uid][e],i.isEmptyObj(r[this.uid])&&delete r[this.uid])}},removeAllEventListeners:function(){r[this.uid]&&delete r[this.uid]},dispatchEvent:function(e){var n,o,a,s,u,c={},l=!0;if("string"!==i.typeOf(e)){if(s=e,"string"!==i.typeOf(s.type))throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);e=s.type,s.total!==u&&s.loaded!==u&&(c.total=s.total,c.loaded=s.loaded),c.async=s.async||!1}if(-1!==e.indexOf("::")?function(t){n=t[0],e=t[1]}(e.split("::")):n=this.uid,e=e.toLowerCase(),o=r[n]&&r[n][e]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),c.type=e,a.unshift(c);var d=[];i.each(o,function(e){a[0].target=e.scope,c.async?d.push(function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}):d.push(function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&i.inSeries(d,function(e){l=!e})}return l},bindOnce:function(e,t,i,n){var r=this;r.bind.call(this,e,function o(){return r.unbind(e,o),t.apply(this,arguments)},i,n)},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){var t="on"+e.type.toLowerCase();"function"===i.typeOf(this[t])&&this[t].apply(this,arguments)}),i.each(e,function(e){e="on"+e.toLowerCase(e),"undefined"===i.typeOf(t[e])&&(t[e]=null)})}}),n.instance=new n,n}),n("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(e,t,i,n){function r(e,n,o,s,u){var c,l=this,d=t.guid(n+"_"),m=u||"browser";e=e||{},a[d]=this,o=t.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},o),e.preferred_caps&&(m=r.getMode(s,e.preferred_caps,m)),c=function(){var e={};return{exec:function(t,i,n,r){return c[i]&&(e[t]||(e[t]={context:this,instance:new c[i]}),e[t].instance[n])?e[t].instance[n].apply(this,r):void 0},removeInstance:function(t){delete e[t]},removeAllInstances:function(){var i=this;t.each(e,function(e,n){"function"===t.typeOf(e.instance.destroy)&&e.instance.destroy.call(e.context),i.removeInstance(n)})}}}(),t.extend(this,{initialized:!1,uid:d,type:n,mode:r.getMode(s,e.required_caps,m),shimid:d+"_container",clients:0,options:e,can:function(e,i){var n=arguments[2]||o;if("string"===t.typeOf(e)&&"undefined"===t.typeOf(i)&&(e=r.parseCaps(e)),"object"===t.typeOf(e)){for(var a in e)if(!this.can(a,e[a],n))return!1;return!0}return"function"===t.typeOf(n[e])?n[e].call(this,i):i===n[e]},getShimContainer:function(){var e,n=i.get(this.shimid);return n||(e=i.get(this.options.container)||document.body,n=document.createElement("div"),n.id=this.shimid,n.className="moxie-shim moxie-shim-"+this.type,t.extend(n.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),e.appendChild(n),e=null),n},getShim:function(){return c},shimExec:function(e,t){var i=[].slice.call(arguments,2);return l.getShim().exec.call(this,this.uid,e,t,i)},exec:function(e,t){var i=[].slice.call(arguments,2);return l[e]&&l[e][t]?l[e][t].apply(this,i):l.shimExec.apply(this,arguments)},destroy:function(){if(l){var e=i.get(this.shimid);e&&e.parentNode.removeChild(e),c&&c.removeAllInstances(),this.unbindAll(),delete a[this.uid],this.uid=null,d=l=c=e=null}}}),this.mode&&e.required_caps&&!this.can(e.required_caps)&&(this.mode=!1)}var o={},a={};return r.order="html5,flash,silverlight,html4",r.getRuntime=function(e){return a[e]?a[e]:!1},r.addConstructor=function(e,t){t.prototype=n.instance,o[e]=t},r.getConstructor=function(e){return o[e]||null},r.getInfo=function(e){var t=r.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},r.parseCaps=function(e){var i={};return"string"!==t.typeOf(e)?e||{}:(t.each(e.split(","),function(e){i[e]=!0}),i)},r.can=function(e,t){var i,n,o=r.getConstructor(e);return o?(i=new o({required_caps:t}),n=i.mode,i.destroy(),!!n):!1},r.thatCan=function(e,t){var i=(t||r.order).split(/\s*,\s*/);for(var n in i)if(r.can(i[n],e))return i[n];return null},r.getMode=function(e,i,n){var r=null;if("undefined"===t.typeOf(n)&&(n="browser"),i&&!t.isEmptyObj(e)){if(t.each(i,function(i,n){if(e.hasOwnProperty(n)){var o=e[n](i);if("string"==typeof o&&(o=[o]),r){if(!(r=t.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==t.inArray(n,r)?n:r[0];if(r===!1)return!1}return n},r.capTrue=function(){return!0},r.capFalse=function(){return!1},r.capTest=function(e){return function(){return!!e}},r}),n("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(e,t,i,n){return function(){var e;i.extend(this,{connectRuntime:function(r){function o(i){var a,u;return i.length?(a=i.shift().toLowerCase(),(u=n.getConstructor(a))?(e=new u(r),e.bind("Init",function(){e.initialized=!0,setTimeout(function(){e.clients++,s.ruid=e.uid,s.trigger("RuntimeInit",e)},1)}),e.bind("Error",function(){e.destroy(),o(i)}),e.bind("Exception",function(e,i){var n=i.name+"(#"+i.code+")"+(i.message?", from: "+i.message:"");s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.EXCEPTION_ERR,n))}),e.mode?(e.init(),void 0):(e.trigger("Error"),void 0)):(o(i),void 0)):(s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),e=null,void 0)}var a,s=this;if("string"===i.typeOf(r)?a=r:"string"===i.typeOf(r.ruid)&&(a=r.ruid),a){if(e=n.getRuntime(a))return s.ruid=a,e.clients++,e;throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/\s*,\s*/))},disconnectRuntime:function(){e&&--e.clients<=0&&e.destroy(),e=null},getRuntime:function(){return e&&e.uid?e:e=null},exec:function(){return e?e.exec.apply(this,arguments):null},can:function(t){return e?e.can(t):!1}})}}),n("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(e,t,i){function n(o,a){function s(t,i,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new n(null,{type:o,size:i-t}),a.detach(s.substr(t,a.size)),a):null}i.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,i){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,i)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){if(this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),e=e||"","data:"==e.substr(0,5)){var i=e.indexOf(";base64,");this.type=e.substring(5,i),e=t.atob(e.substring(i+8))}this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return n}),n("moxie/core/I18n",["moxie/core/utils/Basic"],function(e){var t={};return{addI18n:function(i){return e.extend(t,i)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),n("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(e,t){var i="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",n={mimes:{},extensions:{},addMimeType:function(e){var t,i,n,r=e.split(/,/);for(t=0;t<r.length;t+=2){for(n=r[t+1].split(/ /),i=0;i<n.length;i++)this.mimes[n[i]]=r[t];this.extensions[r[t]]=n}},extList2mimes:function(t,i){var n,r,o,a,s=this,u=[];for(r=0;r<t.length;r++)for(n=t[r].extensions.split(/\s*,\s*/),o=0;o<n.length;o++){if("*"===n[o])return[];if(a=s.mimes[n[o]],a&&-1===e.inArray(a,u)&&u.push(a),i&&/^\w+$/.test(n[o]))u.push("."+n[o]);else if(!a)return[]}return u},mimes2exts:function(t){var i=this,n=[];return e.each(t,function(t){if("*"===t)return n=[],!1;var r=t.match(/^(\w+)\/(\*|\w+)$/);r&&("*"===r[2]?e.each(i.extensions,function(e,t){new RegExp("^"+r[1]+"/").test(t)&&[].push.apply(n,i.extensions[t])}):i.extensions[t]&&[].push.apply(n,i.extensions[t]))}),n},mimes2extList:function(i){var n=[],r=[];return"string"===e.typeOf(i)&&(i=e.trim(i).split(/\s*,\s*/)),r=this.mimes2exts(i),n.push({title:t.translate("Files"),extensions:r.length?r.join(","):"*"}),n.mimes=i,n},getFileExtension:function(e){var t=e&&e.match(/\.([^.]+)$/);return t?t[1].toLowerCase():""},getFileMime:function(e){return this.mimes[this.getFileExtension(e)]||""}};return n.addMimeType(i),n}),n("moxie/file/FileInput",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/I18n","moxie/runtime/Runtime","moxie/runtime/RuntimeClient"],function(e,t,i,n,r,o,a,s,u){function c(t){var o,c,d;if(-1!==e.inArray(e.typeOf(t),["string","node"])&&(t={browse_button:t}),c=n.get(t.browse_button),!c)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR);d={accept:[{title:a.translate("All Files"),extensions:"*"}],multiple:!1,required_caps:!1,container:c.parentNode||document.body},t=e.extend({},d,t),"string"==typeof t.required_caps&&(t.required_caps=s.parseCaps(t.required_caps)),"string"==typeof t.accept&&(t.accept=i.mimes2extList(t.accept)),o=n.get(t.container),o||(o=document.body),"static"===n.getStyle(o,"position")&&(o.style.position="relative"),o=c=null,u.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,shimid:null,files:null,init:function(){var i=this;i.bind("RuntimeInit",function(r,o){i.ruid=o.uid,i.shimid=o.shimid,i.bind("Ready",function(){i.trigger("Refresh")},999),i.bind("Refresh",function(){var i,r,a,s,u;a=n.get(t.browse_button),s=n.get(o.shimid),a&&(i=n.getPos(a,n.get(t.container)),r=n.getSize(a),u=parseInt(n.getStyle(a,"z-index"),10)||0,s&&e.extend(s.style,{top:i.y+"px",left:i.x+"px",width:r.w+"px",height:r.h+"px",zIndex:u+1})),s=a=null}),o.exec.call(i,"FileInput","init",t)}),i.connectRuntime(e.extend({},t,{required_caps:{select_file:!0}}))},getOption:function(e){return t[e]},setOption:function(e,n){if(t.hasOwnProperty(e)){var o=t[e];switch(e){case"accept":"string"==typeof n&&(n=i.mimes2extList(n));break;case"container":case"required_caps":throw new r.FileException(r.FileException.NO_MODIFICATION_ALLOWED_ERR)}t[e]=n,this.exec("FileInput","setOption",e,n),this.trigger("OptionChanged",e,n,o)}},disable:function(t){var i=this.getRuntime();i&&this.exec("FileInput","disable","undefined"===e.typeOf(t)?!0:t)},refresh:function(){this.trigger("Refresh")},destroy:function(){var t=this.getRuntime();t&&(t.exec.call(this,"FileInput","destroy"),this.disconnectRuntime()),"array"===e.typeOf(this.files)&&e.each(this.files,function(e){e.destroy()}),this.files=null,this.unbindAll()}}),this.handleEventProps(l)}var l=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];return c.prototype=o.instance,c}),n("moxie/file/File",["moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/file/Blob"],function(e,t,i){function n(n,r){r||(r={}),i.apply(this,arguments),this.type||(this.type=t.getFileMime(r.name));var o;if(r.name)o=r.name.replace(/\\/g,"/"),o=o.substr(o.lastIndexOf("/")+1);else if(this.type){var a=this.type.split("/")[0];o=e.guid((""!==a?a:"file")+"_"),t.extensions[this.type]&&(o+="."+t.extensions[this.type][0])}e.extend(this,{name:o||e.guid("file_"),relativePath:"",lastModifiedDate:r.lastModifiedDate||(new Date).toLocaleString()})}return n.prototype=i.prototype,n}),n("moxie/file/FileDrop",["moxie/core/I18n","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/core/utils/Env","moxie/file/File","moxie/runtime/RuntimeClient","moxie/core/EventTarget","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,u){function c(i){var r,o=this;"string"==typeof i&&(i={drop_zone:i}),r={accept:[{title:e.translate("All Files"),extensions:"*"}],required_caps:{drag_and_drop:!0}},i="object"==typeof i?n.extend({},r,i):r,i.container=t.get(i.drop_zone)||document.body,"static"===t.getStyle(i.container,"position")&&(i.container.style.position="relative"),"string"==typeof i.accept&&(i.accept=u.mimes2extList(i.accept)),a.call(o),n.extend(o,{uid:n.guid("uid_"),ruid:null,files:null,init:function(){o.bind("RuntimeInit",function(e,t){o.ruid=t.uid,t.exec.call(o,"FileDrop","init",i),o.dispatchEvent("ready")}),o.connectRuntime(i)},destroy:function(){var e=this.getRuntime();e&&(e.exec.call(this,"FileDrop","destroy"),this.disconnectRuntime()),this.files=null,this.unbindAll()}}),this.handleEventProps(l)}var l=["ready","dragenter","dragleave","drop","error"];return c.prototype=s.instance,c}),n("moxie/file/FileReader",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/Exceptions","moxie/core/EventTarget","moxie/file/Blob","moxie/runtime/RuntimeClient"],function(e,t,i,n,r,o){function a(){function n(e,n){if(this.trigger("loadstart"),this.readyState===a.LOADING)return this.trigger("error",new i.DOMException(i.DOMException.INVALID_STATE_ERR)),this.trigger("loadend"),void 0;if(!(n instanceof r))return this.trigger("error",new i.DOMException(i.DOMException.NOT_FOUND_ERR)),this.trigger("loadend"),void 0;
  6490. if(this.result=null,this.readyState=a.LOADING,n.isDetached()){var o=n.getSource();switch(e){case"readAsText":case"readAsBinaryString":this.result=o;break;case"readAsDataURL":this.result="data:"+n.type+";base64,"+t.btoa(o)}this.readyState=a.DONE,this.trigger("load"),this.trigger("loadend")}else this.connectRuntime(n.ruid),this.exec("FileReader","read",e,n)}o.call(this),e.extend(this,{uid:e.guid("uid_"),readyState:a.EMPTY,result:null,error:null,readAsBinaryString:function(e){n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){n.call(this,"readAsDataURL",e)},readAsText:function(e){n.call(this,"readAsText",e)},abort:function(){this.result=null,-1===e.inArray(this.readyState,[a.EMPTY,a.DONE])&&(this.readyState===a.LOADING&&(this.readyState=a.DONE),this.exec("FileReader","abort"),this.trigger("abort"),this.trigger("loadend"))},destroy:function(){this.abort(),this.exec("FileReader","destroy"),this.disconnectRuntime(),this.unbindAll()}}),this.handleEventProps(s),this.bind("Error",function(e,t){this.readyState=a.DONE,this.error=t},999),this.bind("Load",function(){this.readyState=a.DONE},999)}var s=["loadstart","progress","load","abort","error","loadend"];return a.EMPTY=0,a.LOADING=1,a.DONE=2,a.prototype=n.instance,a}),n("moxie/core/utils/Url",[],function(){var e=function(t,i){for(var n=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],r=n.length,o={http:80,https:443},a={},s=/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,u=s.exec(t||"");r--;)u[r]&&(a[n[r]]=u[r]);if(!a.scheme){i&&"string"!=typeof i||(i=e(i||document.location.href)),a.scheme=i.scheme,a.host=i.host,a.port=i.port;var c="";/^[^\/]/.test(a.path)&&(c=i.path,c=/\/[^\/]*\.[^\/]*$/.test(c)?c.replace(/\/[^\/]+$/,"/"):c.replace(/\/?$/,"/")),a.path=c+(a.path||"")}return a.port||(a.port=o[a.scheme]||80),a.port=parseInt(a.port,10),a.path||(a.path="/"),delete a.source,a},t=function(t){var i={http:80,https:443},n="object"==typeof t?t:e(t);return n.scheme+"://"+n.host+(n.port!==i[n.scheme]?":"+n.port:"")+n.path+(n.query?n.query:"")},i=function(t){function i(e){return[e.scheme,e.host,e.port].join("/")}return"string"==typeof t&&(t=e(t)),i(e())===i(t)};return{parseUrl:e,resolveUrl:t,hasSameOrigin:i}}),n("moxie/runtime/RuntimeTarget",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i){function n(){this.uid=e.guid("uid_"),t.call(this),this.destroy=function(){this.disconnectRuntime(),this.unbindAll()}}return n.prototype=i.instance,n}),n("moxie/file/FileReaderSync",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/utils/Encode"],function(e,t,i){return function(){function n(e,t){if(!t.isDetached()){var n=this.connectRuntime(t.ruid).exec.call(this,"FileReaderSync","read",e,t);return this.disconnectRuntime(),n}var r=t.getSource();switch(e){case"readAsBinaryString":return r;case"readAsDataURL":return"data:"+t.type+";base64,"+i.btoa(r);case"readAsText":for(var o="",a=0,s=r.length;s>a;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return n.call(this,"readAsDataURL",e)},readAsText:function(e){return n.call(this,"readAsText",e)}})}}),n("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(e,t,i){function n(){var e,n=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof i?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):n.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(i){t.each(n,function(e){i(e.value,e.name)}),e&&i(e.value,e.name)},destroy:function(){e=null,n=[]}})}return n}),n("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,u,c,l,d){function m(){this.uid=e.guid("uid_")}function h(){function i(e,t){return I.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?I[e]:A[e]:(l.can("define_property")?I[e]=t:A[e]=t,void 0):void 0}function u(t){function n(){R&&(R.destroy(),R=null),s.dispatchEvent("loadend"),s=null}function r(r){R.bind("LoadStart",function(e){i("readyState",h.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),L&&s.upload.dispatchEvent(e)}),R.bind("Progress",function(e){i("readyState")!==h.LOADING&&(i("readyState",h.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),R.bind("UploadProgress",function(e){L&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),R.bind("Load",function(t){i("readyState",h.DONE),i("status",Number(r.exec.call(R,"XMLHttpRequest","getStatus")||0)),i("statusText",f[i("status")]||""),i("response",r.exec.call(R,"XMLHttpRequest","getResponse",i("responseType"))),~e.inArray(i("responseType"),["text",""])?i("responseText",i("response")):"document"===i("responseType")&&i("responseXML",i("response")),U=r.exec.call(R,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),i("status")>0?(L&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(F=!0,s.dispatchEvent("error")),n()}),R.bind("Abort",function(e){s.dispatchEvent(e),n()}),R.bind("Error",function(e){F=!0,i("readyState",h.DONE),s.dispatchEvent("readystatechange"),M=!0,s.dispatchEvent(e),n()}),r.exec.call(R,"XMLHttpRequest","send",{url:x,method:v,async:T,user:y,password:w,headers:S,mimeType:D,encoding:O,responseType:s.responseType,withCredentials:s.withCredentials,options:k},t)}var s=this;E=(new Date).getTime(),R=new a,"string"==typeof k.required_caps&&(k.required_caps=o.parseCaps(k.required_caps)),k.required_caps=e.extend({},k.required_caps,{return_response_type:s.responseType}),t instanceof c&&(k.required_caps.send_multipart=!0),e.isEmptyObj(S)||(k.required_caps.send_custom_headers=!0),B||(k.required_caps.do_cors=!0),k.ruid?r(R.connectRuntime(k)):(R.bind("RuntimeInit",function(e,t){r(t)}),R.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),R.connectRuntime(k))}function g(){i("responseText",""),i("responseXML",null),i("response",null),i("status",0),i("statusText",""),E=b=null}var x,v,y,w,E,b,R,_,A=this,I={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},T=!0,S={},O=null,D=null,N=!1,C=!1,L=!1,M=!1,F=!1,B=!1,P=null,H=null,k={},U="";e.extend(this,I,{uid:e.guid("uid_"),upload:new m,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||n.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(v=o.toUpperCase()),~e.inArray(v,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=n.utf8_encode(a),l=r.parseUrl(a),B=r.hasSameOrigin(l),x=r.resolveUrl(a),(u||c)&&!B)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(y=u||l.user,w=c||l.pass,T=s||!0,T===!1&&(i("timeout")||i("withCredentials")||""!==i("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);N=!T,C=!1,S={},g.call(this),i("readyState",h.OPENED),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(i("readyState")!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||n.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy\-|sec\-)/.test(r)?!1:(S[r]?S[r]+=", "+o:S[r]=o,!0)},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(t){return t=t.toLowerCase(),F||~e.inArray(t,["set-cookie","set-cookie2"])?null:U&&""!==U&&(_||(_={},e.each(U.split(/\r\n/),function(t){var i=t.split(/:\s+/);2===i.length&&(i[0]=e.trim(i[0]),_[i[0].toLowerCase()]={header:i[0],value:e.trim(i[1])})})),_.hasOwnProperty(t))?_[t].header+": "+_[t].value:null},overrideMimeType:function(n){var r,o;if(~e.inArray(i("readyState"),[h.LOADING,h.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n=e.trim(n.toLowerCase()),/;/.test(n)&&(r=n.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(n=r[1],r[2]&&(o=r[2])),!d.mimes[n])throw new t.DOMException(t.DOMException.SYNTAX_ERR);P=n,H=o},send:function(i,r){if(k="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.readyState!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i instanceof s)k.ruid=i.ruid,D=i.type||"application/octet-stream";else if(i instanceof c){if(i.hasBlob()){var o=i.getBlob();k.ruid=o.ruid,D=o.type||"application/octet-stream"}}else"string"==typeof i&&(O="UTF-8",D="text/plain;charset=UTF-8",i=n.utf8_encode(i));this.withCredentials||(this.withCredentials=k.required_caps&&k.required_caps.send_browser_cookies&&!B),L=!N&&this.upload.hasEventListener(),F=!1,M=!i,N||(C=!0),u.call(this,i)},abort:function(){if(F=!0,N=!1,~e.inArray(i("readyState"),[h.UNSENT,h.OPENED,h.DONE]))i("readyState",h.UNSENT);else{if(i("readyState",h.DONE),C=!1,!R)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);R.getRuntime().exec.call(R,"XMLHttpRequest","abort",M),M=!0}},destroy:function(){R&&("function"===e.typeOf(R.destroy)&&R.destroy(),R=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}}),this.handleEventProps(p.concat(["readystatechange"])),this.upload.handleEventProps(p)}var f={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};m.prototype=i.instance;var p=["loadstart","progress","abort","error","load","timeout","loadend"];return h.UNSENT=0,h.OPENED=1,h.HEADERS_RECEIVED=2,h.LOADING=3,h.DONE=4,h.prototype=i.instance,h}),n("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i,n){function r(){function n(){l=d=0,c=this.result=null}function o(t,i){var n=this;u=i,n.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(n.state,[r.IDLE,r.DONE])&&a.call(n)},999),n.bind("TransportingComplete",function(){d=l,n.state=r.DONE,c=null,n.result=u.exec.call(n,"Transporter","getAsBlob",t||"")},999),n.state=r.BUSY,n.trigger("TransportingStarted"),a.call(n)}function a(){var e,i=this,n=l-d;m>n&&(m=n),e=t.btoa(c.substr(d,m)),u.exec.call(i,"Transporter","receive",e,l)}var s,u,c,l,d,m;i.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,i,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),m=r.chunk_size,n.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,i,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,i,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),n.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),n.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=n.instance,r}),n("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(e,t,i,n,r,o,a,s,u,c,l,d,m){function h(){function n(e){e||(e=this.exec("Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name)}function c(t){var n=e.typeOf(t);try{if(t instanceof h){if(!t.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);p.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new i.ImageError(i.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(n,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===n)"data:"===t.substr(0,5)?c.call(this,new l(null,{data:t}),arguments[1]):x.apply(this,arguments);else{if("node"!==n||"img"!==t.nodeName.toLowerCase())throw new i.DOMException(i.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function p(t,i){var n=this.connectRuntime(t.ruid);this.ruid=n.uid,n.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(i)?!0:i)}function g(t,i){function n(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){n(t)}),i&&"string"==typeof i.required_caps&&(i.required_caps=o.parseCaps(i.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},i))):n(this.connectRuntime(t.ruid))}function x(e,t){var i,n=this;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){c.apply(this,arguments)},resize:function(t){var n,r,o=this,a={x:0,y:0,width:o.width,height:o.height},s=e.extendIf({width:o.width,height:o.height,type:o.type||"image/jpeg",quality:90,crop:!1,fit:!0,preserveHeaders:!0,resample:"default",multipass:!0},t);try{if(!o.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);if(o.width>h.MAX_RESIZE_WIDTH||o.height>h.MAX_RESIZE_HEIGHT)throw new i.ImageError(i.ImageError.MAX_RESOLUTION_ERR);if(n=o.meta&&o.meta.tiff&&o.meta.tiff.Orientation||1,-1!==e.inArray(n,[5,6,7,8])){var u=s.width;s.width=s.height,s.height=u}if(s.crop){switch(r=Math.max(s.width/o.width,s.height/o.height),t.fit?(a.width=Math.min(Math.ceil(s.width/r),o.width),a.height=Math.min(Math.ceil(s.height/r),o.height),r=s.width/a.width):(a.width=Math.min(s.width,o.width),a.height=Math.min(s.height,o.height),r=1),"boolean"==typeof s.crop&&(s.crop="cc"),s.crop.toLowerCase().replace(/_/,"-")){case"rb":case"right-bottom":a.x=o.width-a.width,a.y=o.height-a.height;break;case"cb":case"center-bottom":a.x=Math.floor((o.width-a.width)/2),a.y=o.height-a.height;break;case"lb":case"left-bottom":a.x=0,a.y=o.height-a.height;break;case"lt":case"left-top":a.x=0,a.y=0;break;case"ct":case"center-top":a.x=Math.floor((o.width-a.width)/2),a.y=0;break;case"rt":case"right-top":a.x=o.width-a.width,a.y=0;break;case"rc":case"right-center":case"right-middle":a.x=o.width-a.width,a.y=Math.floor((o.height-a.height)/2);break;case"lc":case"left-center":case"left-middle":a.x=0,a.y=Math.floor((o.height-a.height)/2);break;case"cc":case"center-center":case"center-middle":default:a.x=Math.floor((o.width-a.width)/2),a.y=Math.floor((o.height-a.height)/2)}a.x=Math.max(a.x,0),a.y=Math.max(a.y,0)}else r=Math.min(s.width/o.width,s.height/o.height);this.exec("Image","resize",a,r,s)}catch(c){o.trigger("error",c.code)}},downsize:function(t){var i,n={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,preserveHeaders:!0,resample:"default"};i="object"==typeof t?e.extend(n,t):e.extend(n,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]}),this.resize(i)},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);var e=this.connectRuntime(this.ruid);return e.exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var i=this.getAsDataURL(e,t);return m.atob(i.substring(i.indexOf("base64,")+7))},embed:function(n,r){function o(t,r){var o=this;if(u.can("create_canvas")){var l=o.getAsCanvas();if(l)return n.appendChild(l),l=null,o.destroy(),c.trigger("embedded"),void 0}var d=o.getAsDataURL(t,r);if(!d)throw new i.ImageError(i.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",d.length))n.innerHTML='<img src="'+d+'" width="'+o.width+'" height="'+o.height+'" />',o.destroy(),c.trigger("embedded");else{var h=new s;h.bind("TransportingComplete",function(){a=c.connectRuntime(this.result.ruid),c.bind("Embedded",function(){e.extend(a.getShimContainer().style,{top:"0px",left:"0px",width:o.width+"px",height:o.height+"px"}),a=null},999),a.exec.call(c,"ImageView","display",this.result.uid,width,height),o.destroy()}),h.transport(m.atob(d.substring(d.indexOf("base64,")+7)),t,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:n})}}var a,c=this,l=e.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90},r);try{if(!(n=t.get(n)))throw new i.DOMException(i.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT;var d=new h;return d.bind("Resize",function(){o.call(this,l.type,l.quality)}),d.bind("Load",function(){d.downsize(l)}),this.meta.thumb&&this.meta.thumb.width>=l.width&&this.meta.thumb.height>=l.height?d.load(this.meta.thumb.data):d.clone(this,!1),d}catch(f){this.trigger("error",f.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}}),this.handleEventProps(f),this.bind("Load Resize",function(){n.call(this)},999)}var f=["progress","load","error","resize","embedded"];return h.MAX_RESIZE_WIDTH=8192,h.MAX_RESIZE_HEIGHT=8192,h.prototype=c.instance,h}),n("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue,l=e.extend({access_binary:u(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return o.can("access_binary")&&!!s.Image},display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:u(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:u(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==n.browser||n.verComp(n.version,9,">"))}()),filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),return_response_headers:c,return_response_type:function(e){return"json"===e&&window.JSON?!0:n.can("return_response_type",e)},return_status_code:c,report_upload_progress:u(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return o.can("access_binary")&&n.can("create_canvas")},select_file:function(){return n.can("use_fileinput")&&window.File},select_folder:function(){return o.can("select_file")&&("Chrome"===n.browser&&n.verComp(n.version,21,">=")||"Firefox"===n.browser&&n.verComp(n.version,42,">="))},select_multiple:function(){return!(!o.can("select_file")||"Safari"===n.browser&&"Windows"===n.os||"iOS"===n.os&&n.verComp(n.osVersion,"7.0.0",">")&&n.verComp(n.osVersion,"8.0.0","<"))},send_binary_string:u(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:u(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||o.can("send_binary_string")},slice_blob:u(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return o.can("slice_blob")&&o.can("send_multipart")},summon_file_dialog:function(){return o.can("select_file")&&("Firefox"===n.browser&&n.verComp(n.version,4,">=")||"Opera"===n.browser&&n.verComp(n.version,12,">=")||"IE"===n.browser&&n.verComp(n.version,10,">=")||!!~e.inArray(n.browser,["Chrome","Safari","Edge"]))},upload_filesize:c,use_http_method:c},arguments[2]);i.call(this,t,arguments[1]||a,l),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html5",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){function i(){function e(e,t,i){var n;if(!window.File.prototype.slice)return(n=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?n.call(e,t,i):null;try{return e.slice(),e.slice(t,i)}catch(r){return e.slice(t,i-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))}}return e.Blob=i}),n("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(e){function t(){this.returnValue=!1}function i(){this.cancelBubble=!0}var n={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=i,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),n.hasOwnProperty(o[r])||(n[o[r]]={}),l=n[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,i,o){var a,s;if(i=i.toLowerCase(),t[r]&&n[t[r]]&&n[t[r]][i]){a=n[t[r]][i];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(i,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+i,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete n[t[r]][i],e.isEmptyObj(n[t[r]])){delete n[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,i){t&&t[r]&&e.each(n[t[r]],function(e,n){a(t,n,i)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),n("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){var e,s;i.extend(this,{init:function(u){var c,l,d,m,h,f,p=this,g=p.getRuntime();e=u,d=e.accept.mimes||o.extList2mimes(e.accept,g.can("filter_by_extension")),l=g.getShimContainer(),l.innerHTML='<input id="'+g.uid+'" type="file" style="font-size:999px;opacity:0;"'+(e.multiple&&g.can("select_multiple")?"multiple":"")+(e.directory&&g.can("select_folder")?"webkitdirectory directory":"")+(d?' accept="'+d.join(",")+'"':"")+" />",c=n.get(g.uid),i.extend(c.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=n.get(e.browse_button),s=n.getStyle(m,"z-index")||"auto",g.can("summon_file_dialog")&&("static"===n.getStyle(m,"position")&&(m.style.position="relative"),r.addEvent(m,"click",function(e){var t=n.get(g.uid);t&&!t.disabled&&t.click(),e.preventDefault()},p.uid),p.bind("Refresh",function(){h=parseInt(s,10)||1,n.get(e.browse_button).style.zIndex=h,this.getRuntime().getShimContainer().style.zIndex=h-1})),f=g.can("summon_file_dialog")?m:l,r.addEvent(f,"mouseover",function(){p.trigger("mouseenter")},p.uid),r.addEvent(f,"mouseout",function(){p.trigger("mouseleave")},p.uid),r.addEvent(f,"mousedown",function(){p.trigger("mousedown")},p.uid),r.addEvent(n.get(e.container),"mouseup",function(){p.trigger("mouseup")},p.uid),c.onchange=function x(){if(p.files=[],i.each(this.files,function(i){var n="";return e.directory&&"."==i.name?!0:(i.webkitRelativePath&&(n="/"+i.webkitRelativePath.replace(/^\//,"")),i=new t(g.uid,i),i.relativePath=n,p.files.push(i),void 0)}),"IE"!==a.browser&&"IEMobile"!==a.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=x}p.files.length&&p.trigger("change")},p.trigger({type:"ready",async:!0}),l=null},setOption:function(e,t){var i=this.getRuntime(),r=n.get(i.uid);switch(e){case"accept":if(t){var a=t.mimes||o.extList2mimes(t,i.can("filter_by_extension"));r.setAttribute("accept",a.join(","))}else r.removeAttribute("accept");break;case"directory":t&&i.can("select_folder")?(r.setAttribute("directory",""),r.setAttribute("webkitdirectory","")):(r.removeAttribute("directory"),r.removeAttribute("webkitdirectory"));break;case"multiple":t&&i.can("select_multiple")?r.setAttribute("multiple",""):r.removeAttribute("multiple")}},disable:function(e){var t,i=this.getRuntime();(t=n.get(i.uid))&&(t.disabled=!!e)},destroy:function(){var t=this.getRuntime(),i=t.getShim(),o=t.getShimContainer(),a=e&&n.get(e.container),u=e&&n.get(e.browse_button);a&&r.removeAllEvents(a,this.uid),u&&(r.removeAllEvents(u,this.uid),u.style.zIndex=s),o&&(r.removeAllEvents(o,this.uid),o.innerHTML=""),i.removeInstance(this.uid),e=o=a=u=i=null}})}return e.FileInput=s}),n("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,t,i,n,r,o){function a(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var t=i.toArray(e.dataTransfer.types||[]);return-1!==i.inArray("Files",t)||-1!==i.inArray("public.file-url",t)||-1!==i.inArray("application/x-moz-file",t)}function a(e,i){if(u(e)){var n=new t(f,e);n.relativePath=i||"",p.push(n)}}function s(e){for(var t=[],n=0;n<e.length;n++)[].push.apply(t,e[n].extensions.split(/\s*,\s*/));return-1===i.inArray("*",t)?t:[]}function u(e){if(!g.length)return!0;var t=o.getFileExtension(e.name);return!t||-1!==i.inArray(t,g)}function c(e,t){var n=[];i.each(e,function(e){var t=e.webkitGetAsEntry();t&&(t.isFile?a(e.getAsFile(),t.fullPath):n.push(t))}),n.length?l(n,t):t()}function l(e,t){var n=[];i.each(e,function(e){n.push(function(t){d(e,t)})}),i.inSeries(n,function(){t()})}function d(e,t){e.isFile?e.file(function(i){a(i,e.fullPath),t()},function(){t()}):e.isDirectory?m(e,t):t()}function m(e,t){function i(e){r.readEntries(function(t){t.length?([].push.apply(n,t),i(e)):e()},e)}var n=[],r=e.createReader();i(function(){l(n,t)})}var h,f,p=[],g=[];i.extend(this,{init:function(t){var n,o=this;h=t,f=o.ruid,g=s(h.accept),n=h.container,r.addEvent(n,"dragover",function(t){e(t)&&(t.preventDefault(),t.dataTransfer.dropEffect="copy")},o.uid),r.addEvent(n,"drop",function(t){e(t)&&(t.preventDefault(),p=[],t.dataTransfer.items&&t.dataTransfer.items[0].webkitGetAsEntry?c(t.dataTransfer.items,function(){o.files=p,o.trigger("drop")}):(i.each(t.dataTransfer.files,function(e){a(e)}),o.files=p,o.trigger("drop")))},o.uid),r.addEvent(n,"dragenter",function(){o.trigger("dragenter")},o.uid),r.addEvent(n,"dragleave",function(){o.trigger("dragleave")},o.uid)},destroy:function(){r.removeAllEvents(h&&n.get(h.container),this.uid),f=p=g=h=null}})}return e.FileDrop=a}),n("moxie/runtime/html5/file/FileReader",["moxie/runtime/html5/Runtime","moxie/core/utils/Encode","moxie/core/utils/Basic"],function(e,t,i){function n(){function e(e){return t.atob(e.substring(e.indexOf("base64,")+7))}var n,r=!1;i.extend(this,{read:function(t,o){var a=this;a.result="",n=new window.FileReader,n.addEventListener("progress",function(e){a.trigger(e)}),n.addEventListener("load",function(t){a.result=r?e(n.result):n.result,a.trigger(t)}),n.addEventListener("error",function(e){a.trigger(e,n.error)}),n.addEventListener("loadend",function(e){n=null,a.trigger(e)}),"function"===i.typeOf(n[t])?(r=!1,n[t](o.getSource())):"readAsBinaryString"===t&&(r=!0,n.readAsDataURL(o.getSource()))},abort:function(){n&&n.abort()},destroy:function(){n=null}})}return e.FileReader=n}),n("moxie/runtime/html5/xhr/XMLHttpRequest",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/core/utils/Url","moxie/file/File","moxie/file/Blob","moxie/xhr/FormData","moxie/core/Exceptions","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,u){function c(){function e(e,t){var i,n,r=this;i=t.getBlob().getSource(),n=new window.FileReader,n.onload=function(){t.append(t.getBlobName(),new o(null,{type:i.type,data:n.result})),f.send.call(r,e,t)},n.readAsBinaryString(i)}function c(){return!window.XMLHttpRequest||"IE"===u.browser&&u.verComp(u.version,8,"<")?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;t<e.length;t++)try{return new ActiveXObject(e[t])}catch(i){}}():new window.XMLHttpRequest}function l(e){var t=e.responseXML,i=e.responseText;return"IE"===u.browser&&i&&t&&!t.documentElement&&/[^\/]+\/[^\+]+\+xml/.test(e.getResponseHeader("Content-Type"))&&(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.validateOnParse=!1,t.loadXML(i)),t&&("IE"===u.browser&&0!==t.parseError||!t.documentElement||"parsererror"===t.documentElement.tagName)?null:t}function d(e){var t="----moxieboundary"+(new Date).getTime(),i="--",n="\r\n",r="",a=this.getRuntime();if(!a.can("send_binary_string"))throw new s.RuntimeError(s.RuntimeError.NOT_SUPPORTED_ERR);return m.setRequestHeader("Content-Type","multipart/form-data; boundary="+t),e.each(function(e,a){r+=e instanceof o?i+t+n+'Content-Disposition: form-data; name="'+a+'"; filename="'+unescape(encodeURIComponent(e.name||"blob"))+'"'+n+"Content-Type: "+(e.type||"application/octet-stream")+n+n+e.getSource()+n:i+t+n+'Content-Disposition: form-data; name="'+a+'"'+n+n+unescape(encodeURIComponent(e))+n}),r+=i+t+i+n}var m,h,f=this;t.extend(this,{send:function(i,r){var s=this,l="Mozilla"===u.browser&&u.verComp(u.version,4,">=")&&u.verComp(u.version,7,"<"),f="Android Browser"===u.browser,p=!1;if(h=i.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),m=c(),m.open(i.method,i.url,i.async,i.user,i.password),r instanceof o)r.isDetached()&&(p=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),p=!0;else if((l||f)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return e.call(s,i,r),void 0;if(r instanceof a){var g=new window.FormData;
  6491. r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}m.upload?(i.withCredentials&&(m.withCredentials=!0),m.addEventListener("load",function(e){s.trigger(e)}),m.addEventListener("error",function(e){s.trigger(e)}),m.addEventListener("progress",function(e){s.trigger(e)}),m.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):m.onreadystatechange=function(){switch(m.readyState){case 1:break;case 2:break;case 3:var e,t;try{n.hasSameOrigin(i.url)&&(e=m.getResponseHeader("Content-Length")||0),m.responseText&&(t=m.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:m.onreadystatechange=function(){},0===m.status?s.trigger("error"):s.trigger("load")}},t.isEmptyObj(i.headers)||t.each(i.headers,function(e,t){m.setRequestHeader(t,e)}),""!==i.responseType&&"responseType"in m&&(m.responseType="json"!==i.responseType||u.can("return_response_type","json")?i.responseType:"text"),p?m.sendAsBinary?m.sendAsBinary(r):function(){for(var e=new Uint8Array(r.length),t=0;t<r.length;t++)e[t]=255&r.charCodeAt(t);m.send(e.buffer)}():m.send(r),s.trigger("loadstart")},getStatus:function(){try{if(m)return m.status}catch(e){}return 0},getResponse:function(e){var t=this.getRuntime();try{switch(e){case"blob":var n=new r(t.uid,m.response),o=m.getResponseHeader("Content-Disposition");if(o){var a=o.match(/filename=([\'\"'])([^\1]+)\1/);a&&(h=a[2])}return n.name=h,n.type||(n.type=i.getFileMime(h)),n;case"json":return u.can("return_response_type","json")?m.response:200===m.status&&window.JSON?JSON.parse(m.responseText):null;case"document":return l(m);default:return""!==m.responseText?m.responseText:null}}catch(s){return null}},getAllResponseHeaders:function(){try{return m.getAllResponseHeaders()}catch(e){}return""},abort:function(){m&&m.abort()},destroy:function(){f=h=null}})}return e.XMLHttpRequest=c}),n("moxie/runtime/html5/utils/BinaryReader",["moxie/core/utils/Basic"],function(e){function t(e){e instanceof ArrayBuffer?i.apply(this,arguments):n.apply(this,arguments)}function i(t){var i=new DataView(t);e.extend(this,{readByteAt:function(e){return i.getUint8(e)},writeByteAt:function(e,t){i.setUint8(e,t)},SEGMENT:function(e,n,r){switch(arguments.length){case 2:return t.slice(e,e+n);case 1:return t.slice(e);case 3:if(null===r&&(r=new ArrayBuffer),r instanceof ArrayBuffer){var o=new Uint8Array(this.length()-n+r.byteLength);e>0&&o.set(new Uint8Array(t.slice(0,e)),0),o.set(new Uint8Array(r),e),o.set(new Uint8Array(t.slice(e+n)),e+r.byteLength),this.clear(),t=o.buffer,i=new DataView(t);break}default:return t}},length:function(){return t?t.byteLength:0},clear:function(){i=t=null}})}function n(t){function i(e,i,n){n=3===arguments.length?n:t.length-i-1,t=t.substr(0,i)+e+t.substr(n+i)}e.extend(this,{readByteAt:function(e){return t.charCodeAt(e)},writeByteAt:function(e,t){i(String.fromCharCode(t),e,1)},SEGMENT:function(e,n,r){switch(arguments.length){case 1:return t.substr(e);case 2:return t.substr(e,n);case 3:i(null!==r?r:"",e,n);break;default:return t}},length:function(){return t?t.length:0},clear:function(){t=null}})}return e.extend(t.prototype,{littleEndian:!1,read:function(e,t){var i,n,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),r=0,i=0;t>r;r++)i|=this.readByteAt(e+r)<<Math.abs(n+8*r);return i},write:function(e,t,i){var n,r;if(e>this.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;i>r;r++)this.writeByteAt(e+r,255&t>>Math.abs(n+8*r))},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return t>2147483647?t-4294967296:t},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,i){for(var n=[],r=0;i>r;r++)n[r]=this[e](t+r);return n}}),t}),n("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,t){return function i(n){var r,o,a,s=[],u=0;if(r=new e(n),65496!==r.SHORT(0))throw r.clear(),new t.ImageError(t.ImageError.WRONG_FORMAT);for(o=2;o<=r.length();)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;u=r.SHORT(o+2)+2,a>=65505&&65519>=a&&s.push({hex:a,name:"APP"+(15&a),start:o,length:u,segment:r.SEGMENT(o,u)}),o+=u}return r.clear(),{headers:s,restore:function(t){var i,n,r;for(r=new e(t),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,i=s.length;i>n;n++)r.SEGMENT(o,0,s[n].segment),o+=s[n].length;return t=r.SEGMENT(),r.clear(),t},strip:function(t){var n,r,o,a;for(o=new i(t),r=o.headers,o.purge(),n=new e(t),a=r.length;a--;)n.SEGMENT(r[a].start,r[a].length,"");return t=n.SEGMENT(),n.clear(),t},get:function(e){for(var t=[],i=0,n=s.length;n>i;i++)s[i].name===e.toUpperCase()&&t.push(s[i].segment);return t},set:function(e,t){var i,n,r,o=[];for("string"==typeof t?o.push(t):o=t,i=n=0,r=s.length;r>i&&(s[i].name===e.toUpperCase()&&(s[i].segment=o[n],s[i].length=o[n].length,n++),!(n>=o.length));i++);},purge:function(){this.headers=s=[]}}}}),n("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,i,n){function r(o){function a(i,r){var o,a,s,u,c,m,h,f,p=this,g=[],x={},v={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},y={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(o=p.SHORT(i),a=0;o>a;a++)if(g=[],h=i+2+12*a,s=r[p.SHORT(h)],s!==t){if(u=v[p.SHORT(h+=2)],c=p.LONG(h+=2),m=y[u],!m)throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(h+=4,m*c>4&&(h=p.LONG(h)+d.tiffHeader),h+m*c>=this.length())throw new n.ImageError(n.ImageError.INVALID_META_ERR);"ASCII"!==u?(g=p.asArray(u,h,c),f=1==c?g[0]:g,x[s]=l.hasOwnProperty(s)&&"object"!=typeof f?l[s][f]:f):x[s]=e.trim(p.STRING(h,c).replace(/\0$/,""))}return x}function s(e,t,i){var n,r,o,a=0;if("string"==typeof t){var s=c[e.toLowerCase()];for(var u in s)if(s[u]===t){t=u;break}}n=d[e.toLowerCase()+"IFD"],r=this.SHORT(n);for(var l=0;r>l;l++)if(o=n+12*l+2,this.SHORT(o)==t){a=o+8;break}if(!a)return!1;try{this.write(a,i,4)}catch(m){return!1}return!0}var u,c,l,d,m,h;if(i.call(this,o),c={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},d={tiffHeader:10},m=d.tiffHeader,u={clear:this.clear},e.extend(this,{read:function(){try{return r.prototype.read.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},write:function(){try{return r.prototype.write.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return h||null},EXIF:function(){var t=null;if(d.exifIFD){try{t=a.call(this,d.exifIFD,c.exif)}catch(i){return null}if(t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n<t.ExifVersion.length;n++)r+=String.fromCharCode(t.ExifVersion[n]);t.ExifVersion=r}}return t},GPS:function(){var t=null;if(d.gpsIFD){try{t=a.call(this,d.gpsIFD,c.gps)}catch(i){return null}t.GPSVersionID&&"array"===e.typeOf(t.GPSVersionID)&&(t.GPSVersionID=t.GPSVersionID.join("."))}return t},thumb:function(){if(d.IFD1)try{var e=a.call(this,d.IFD1,c.thumb);if("JPEGInterchangeFormat"in e)return this.SEGMENT(d.tiffHeader+e.JPEGInterchangeFormat,e.JPEGInterchangeFormatLength)}catch(t){}return null},setExif:function(e,t){return"PixelXDimension"!==e&&"PixelYDimension"!==e?!1:s.call(this,"exif",e,t)},clear:function(){u.clear(),o=c=l=h=d=u=null}}),65505!==this.SHORT(0)||"EXIF\0"!==this.STRING(4,5).toUpperCase())throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(this.littleEndian=18761==this.SHORT(m),42!==this.SHORT(m+=2))throw new n.ImageError(n.ImageError.INVALID_META_ERR);d.IFD0=d.tiffHeader+this.LONG(m+=2),h=a.call(this,d.IFD0,c.tiff),"ExifIFDPointer"in h&&(d.exifIFD=d.tiffHeader+h.ExifIFDPointer,delete h.ExifIFDPointer),"GPSInfoIFDPointer"in h&&(d.gpsIFD=d.tiffHeader+h.GPSInfoIFDPointer,delete h.GPSInfoIFDPointer),e.isEmptyObj(h)&&(h=null);var f=this.LONG(d.IFD0+12*this.SHORT(d.IFD0)+2);f&&(d.IFD1=d.tiffHeader+f)}return r.prototype=i.prototype,r}),n("moxie/runtime/html5/image/JPEG",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEGHeaders","moxie/runtime/html5/utils/BinaryReader","moxie/runtime/html5/image/ExifParser"],function(e,t,i,n,r){function o(o){function a(e){var t,i,n=0;for(e||(e=c);n<=e.length();){if(t=e.SHORT(n+=2),t>=65472&&65475>=t)return n+=5,{height:e.SHORT(n),width:e.SHORT(n+=2)};i=e.SHORT(n+=2),n+=i-2}return null}function s(){var e,t,i=d.thumb();return i&&(e=new n(i),t=a(e),e.clear(),t)?(t.data=i,t):null}function u(){d&&l&&c&&(d.clear(),l.purge(),c.clear(),m=l=d=c=null)}var c,l,d,m;if(c=new n(o),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new i(o);try{d=new r(l.get("app1")[0])}catch(h){}m=a.call(this),e.extend(this,{type:"image/jpeg",size:c.length(),width:m&&m.width||0,height:m&&m.height||0,setExif:function(t,i){return d?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,i),l.set("app1",d.SEGMENT()),void 0):!1},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):l.restore(o)},stripHeaders:function(e){return l.strip(e)},purge:function(){u.call(this)}}),d&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS(),thumb:s()})}return o}),n("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(e,t,i){function n(n){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:s.LONG(t),height:s.LONG(t+=4)}):null}function o(){s&&(s.clear(),n=l=u=c=s=null)}function a(e){var t,i,n,r;return t=s.LONG(e),i=s.STRING(e+=4,4),n=e+=4,r=s.LONG(e+t),{length:t,type:i,start:n,CRC:r}}var s,u,c,l;s=new i(n),function(){var t=0,i=0,n=[35152,20039,3338,6666];for(i=0;i<n.length;i++,t+=2)if(n[i]!=s.SHORT(t))throw new e.ImageError(e.ImageError.WRONG_FORMAT)}(),l=r.call(this),t.extend(this,{type:"image/png",size:s.length(),width:l.width,height:l.height,purge:function(){o.call(this)}}),o.call(this)}return n}),n("moxie/runtime/html5/image/ImageInfo",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEG","moxie/runtime/html5/image/PNG"],function(e,t,i,n){return function(r){var o,a=[i,n];o=function(){for(var e=0;e<a.length;e++)try{return new a[e](r)}catch(i){}throw new t.ImageError(t.ImageError.WRONG_FORMAT)}(),e.extend(this,{type:"",size:0,width:0,height:0,setExif:function(){},writeHeaders:function(e){return e},stripHeaders:function(e){return e},purge:function(){r=null}}),e.extend(this,o),this.purge=function(){o.purge(),o=null}}}),n("moxie/runtime/html5/image/ResizerCanvas",[],function(){function e(i,n){var r=i.width,o=Math.floor(r*n),a=!1;(.5>n||n>2)&&(n=.5>n?.5:2,a=!0);var s=t(i,n);return a?e(s,o/s.width):s}function t(e,t){var i=e.width,n=e.height,r=Math.floor(i*t),o=Math.floor(n*t),a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(e,0,0,i,n,0,0,r,o),e=null,a}return{scale:e}}),n("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/ResizerCanvas","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,u){function c(){function e(){if(!v&&!g)throw new i.ImageError(i.DOMException.INVALID_STATE_ERR);return v||g}function c(){var t=e();return"canvas"==t.nodeName.toLowerCase()?t:(v=document.createElement("canvas"),v.width=t.width,v.height=t.height,v.getContext("2d").drawImage(t,0,0),v)}function l(e){return n.atob(e.substring(e.indexOf("base64,")+7))}function d(e,t){return"data:"+(t||"")+";base64,"+n.btoa(e)}function m(e){var t=this;g=new Image,g.onerror=function(){p.call(this),t.trigger("error",i.ImageError.WRONG_FORMAT)},g.onload=function(){t.trigger("load")},g.src="data:"==e.substr(0,5)?e:d(e,w.type)}function h(e,t){var n,r=this;return window.FileReader?(n=new FileReader,n.onload=function(){t(this.result)},n.onerror=function(){r.trigger("error",i.ImageError.WRONG_FORMAT)},n.readAsDataURL(e),void 0):t(e.getAsDataURL())}function f(e,i,n){t.inArray(n,[5,6,7,8])>-1&&(v.width=i,v.height=e);var r=v.getContext("2d");switch(n){case 2:r.translate(e,0),r.scale(-1,1);break;case 3:r.translate(e,i),r.rotate(Math.PI);break;case 4:r.translate(0,i),r.scale(1,-1);break;case 5:r.rotate(.5*Math.PI),r.scale(1,-1);break;case 6:r.rotate(.5*Math.PI),r.translate(0,-i);break;case 7:r.rotate(.5*Math.PI),r.translate(e,-i),r.scale(-1,1);break;case 8:r.rotate(-.5*Math.PI),r.translate(-e,0)}}function p(){x&&(x.purge(),x=null),g&&(g.src=""),y=g=v=w=null,b=!1}var g,x,v,y,w,E=this,b=!1,R=!0;t.extend(this,{loadFromBlob:function(e){var t=this,n=t.getRuntime(),r=arguments.length>1?arguments[1]:!0;if(!n.can("access_binary"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return w=e,e.isDetached()?(y=e.getSource(),m.call(this,y),void 0):(h.call(this,e.getSource(),function(e){r&&(y=l(e)),m.call(t,e)}),void 0)},loadFromImage:function(e,t){this.meta=e.meta,w=new o(null,{name:e.name,size:e.size,type:e.type}),m.call(this,t?y=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t,i=this.getRuntime();return!x&&y&&i.can("access_image_binary")&&(x=new a(y)),t={width:e().width||0,height:e().height||0,type:w.type||u.getFileMime(w.name),size:y&&y.length||w.size||0,name:w.name||"",meta:null},R&&(t.meta=x&&x.meta||this.meta||{},!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof r||(t.meta.thumb.data=new r(null,{type:"image/jpeg",data:t.meta.thumb.data}))),t},resize:function(t,i,n){var r=document.createElement("canvas");if(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(e(),t.x,t.y,t.width,t.height,0,0,r.width,r.height),v=s.scale(r,i),R=n.preserveHeaders,!R){var o=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1;f(v.width,v.height,o)}this.width=v.width,this.height=v.height,b=!0,this.trigger("Resize")},getAsCanvas:function(){return v||(v=c()),v.id=this.uid+"_canvas",v},getAsBlob:function(e,t){return e!==this.type?(b=!0,new o(null,{name:w.name||"",type:e,data:E.getAsDataURL(e,t)})):new o(null,{name:w.name||"",type:e,data:E.getAsBinaryString(e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!b)return g.src;if(c(),"image/jpeg"!==e)return v.toDataURL("image/png");try{return v.toDataURL("image/jpeg",t/100)}catch(i){return v.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!b)return y||(y=l(E.getAsDataURL(e,t))),y;if("image/jpeg"!==e)y=l(E.getAsDataURL(e,t));else{var i;t||(t=90),c();try{i=v.toDataURL("image/jpeg",t/100)}catch(n){i=v.toDataURL("image/jpeg")}y=l(i),x&&(y=x.stripHeaders(y),R&&(x.meta&&x.meta.exif&&x.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),y=x.writeHeaders(y)),x.purge(),x=null)}return b=!1,y},destroy:function(){E=null,p.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),n("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function s(e){var n=i.get(e);n&&"OBJECT"==n.nodeName&&("IE"===t.browser?(n.style.display="none",function r(){4==n.readyState?u(e):setTimeout(r,10)}()):n.parentNode.removeChild(n))}function u(e){var t=i.get(e);if(t){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}}function c(u){var c,m=this;u=e.extend({swf_url:t.swf_url},u),o.call(this,u,l,{access_binary:function(e){return e&&"browser"===m.mode},access_image_binary:function(e){return e&&"browser"===m.mode},display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===m.mode},resize_image:o.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!e.arrayDiff(t,["","text","document"])||"browser"===m.mode},return_status_code:function(t){return"browser"===m.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:function(e){return e&&"browser"===m.mode},send_browser_cookies:function(e){return e&&"browser"===m.mode},send_custom_headers:function(e){return e&&"browser"===m.mode},send_multipart:o.capTrue,slice_blob:function(e){return e&&"browser"===m.mode},stream_upload:function(e){return e&&"browser"===m.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===m.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},slice_blob:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),a()<11.3&&(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid)},shimExec:function(e,t){var i=[].slice.call(arguments,2);return m.getShim().exec(this.uid,e,t,i)},init:function(){var i,r,o;o=this.getShimContainer(),e.extend(o.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),i='<object id="'+this.uid+'" type="application/x-shockwave-flash" data="'+u.swf_url+'" ',"IE"===t.browser&&(i+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '),i+='width="100%" height="100%" style="outline:0"><param name="movie" value="'+u.swf_url+'" />'+'<param name="flashvars" value="uid='+escape(this.uid)+"&target="+t.global_event_dispatcher+'" />'+'<param name="wmode" value="transparent" />'+'<param name="allowscriptaccess" value="always" />'+"</object>","IE"===t.browser?(r=document.createElement("div"),o.appendChild(r),r.outerHTML=i,r=o=null):o.innerHTML=i,c=setTimeout(function(){m&&!m.initialized&&m.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){s(m.uid),e.call(m),clearTimeout(c),u=c=e=m=null}}(this.destroy)},d)}var l="flash",d={};return o.addConstructor(l,c),d}),n("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={slice:function(e,i,n,r){var o=this.getRuntime();return 0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),e=o.shimExec.call(this,"Blob","slice",i,n,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=i}),n("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Basic"],function(e,t,i){var n={init:function(e){var n=this,r=this.getRuntime();this.bind("Change",function(){var e=r.shimExec.call(n,"FileInput","getFiles");n.files=[],i.each(e,function(e){n.files.push(new t(r.uid,e))})},999),this.getRuntime().shimExec.call(this,"FileInput","init",{accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=n}),n("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n=this;return n.result="","readAsDataURL"===e&&(n.result="data:"+(t.type||"")+";base64,"),n.bind("Progress",function(t,r){r&&(n.result+=i(r,e))},999),n.getRuntime().shimExec.call(this,"FileReader","readAsBase64",t.uid)}};return e.FileReader=n}),n("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n,r=this.getRuntime();return(n=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(n="data:"+(t.type||"")+";base64,"+n),i(n,e,t.type)):null}};return e.FileReaderSync=n}),n("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={getAsBlob:function(e){var i=this.getRuntime(),n=i.shimExec.call(this,"Transporter","getAsBlob",e);return n?new t(i.uid,n):null}};return e.Transporter=i}),n("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/runtime/flash/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter","moxie/runtime/flash/runtime/Transporter"],function(e,t,i,n,r,o,a,s){var u={send:function(e,n){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,n)}function o(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),n=null,r()}function u(e,t){var i=new s;i.bind("TransportingComplete",function(){t(this.result)}),i.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),n instanceof a){var d;if(n.each(function(e,t){e instanceof i?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),n.hasBlob()){var m=n.getBlob();m.isDetached()?u(m,function(e){m.destroy(),o(d,e)}):o(d,m)}else n=null,r()}else n instanceof i?n.isDetached()?u(n,function(e){n.destroy(),n=e.uid,r()}):(n=n.uid,r()):r()},getResponse:function(e){var i,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new n(a.uid,o),"blob"===e)return o;try{if(i=new r,~t.inArray(e,["","text"]))return i.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(i.readAsText(o))}finally{o.destroy()}}return null},abort:function(){var e=this.getRuntime();e.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=u}),n("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(e,t,i,n,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(n,"Image","loadFromBlob",e.uid),n=r=null}var n=this,r=n.getRuntime();if(e.isDetached()){var o=new i;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getInfo:function(){var e=this.getRuntime(),t=e.shimExec.call(this,"Image","getInfo");return!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof n||(t.meta.thumb.data=new n(e.uid,t.meta.thumb.data)),t},getAsBlob:function(e,t){var i=this.getRuntime(),r=i.shimExec.call(this,"Image","getAsBlob",e,t);return r?new n(i.uid,r):null},getAsDataURL:function(){var e,t=this.getRuntime(),i=t.Image.getAsBlob.apply(this,arguments);return i?(e=new r,e.readAsDataURL(i)):null}};return e.Image=o}),n("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(e){var t,i,n,r,o,a=!1,s=null,u=0;try{try{s=new ActiveXObject("AgControl.AgControl"),s.IsVersionSupported(e)&&(a=!0),s=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(t=l.description,"1.0.30226.2"===t&&(t="2.0.30226.2"),i=t.split(".");i.length>3;)i.pop();for(;i.length<4;)i.push(0);for(n=e.split(".");n.length>4;)n.pop();do r=parseInt(n[u],10),o=parseInt(i[u],10),u++;while(u<n.length&&r===o);o>=r&&!isNaN(r)&&(a=!0)}}}catch(d){a=!1}return a}function s(s){var l,d=this;s=e.extend({xap_url:t.xap_url},s),o.call(this,s,u,{access_binary:o.capTrue,access_image_binary:o.capTrue,display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:o.capTrue,resize_image:o.capTrue,return_response_headers:function(e){return e&&"client"===d.mode},return_response_type:function(e){return"json"!==e?!0:!!window.JSON},return_status_code:function(t){return"client"===d.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:o.capTrue,send_browser_cookies:function(e){return e&&"browser"===d.mode},send_custom_headers:function(e){return e&&"client"===d.mode},send_multipart:o.capTrue,slice_blob:o.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:o.capTrue,use_http_method:function(t){return"client"===d.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),a("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid).content.Moxie},shimExec:function(e,t){var i=[].slice.call(arguments,2);return d.getShim().exec(this.uid,e,t,i)},init:function(){var e;e=this.getShimContainer(),e.innerHTML='<object id="'+this.uid+'" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;">'+'<param name="source" value="'+s.xap_url+'"/>'+'<param name="background" value="Transparent"/>'+'<param name="windowless" value="true"/>'+'<param name="enablehtmlaccess" value="true"/>'+'<param name="initParams" value="uid='+this.uid+",target="+t.global_event_dispatcher+'"/>'+"</object>",l=setTimeout(function(){d&&!d.initialized&&d.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(d),clearTimeout(l),s=l=e=d=null}}(this.destroy)},c)}var u="silverlight",c={};return o.addConstructor(u,s),c}),n("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(e,t,i){return e.Blob=t.extend({},i)}),n("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Basic"],function(e,t,i){function n(e){for(var t="",i=0;i<e.length;i++)t+=(""!==t?"|":"")+e[i].title+" | *."+e[i].extensions.replace(/,/g,";*.");return t}var r={init:function(e){var r=this,o=this.getRuntime();this.bind("Change",function(){var e=o.shimExec.call(r,"FileInput","getFiles");r.files=[],i.each(e,function(e){r.files.push(new t(o.uid,e))})},999),o.shimExec.call(this,"FileInput","init",n(e.accept),e.multiple),this.trigger("ready")},setOption:function(e,t){"accept"==e&&(t=n(t)),this.getRuntime().shimExec.call(this,"FileInput","setOption",e,t)}};return e.FileInput=r}),n("moxie/runtime/silverlight/file/FileDrop",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Dom","moxie/core/utils/Events"],function(e,t,i){var n={init:function(){var e,n=this,r=n.getRuntime();return e=r.getShimContainer(),i.addEvent(e,"dragover",function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"},n.uid),i.addEvent(e,"dragenter",function(e){e.preventDefault();var i=t.get(r.uid).dragEnter(e);i&&e.stopPropagation()},n.uid),i.addEvent(e,"drop",function(e){e.preventDefault();var i=t.get(r.uid).dragDrop(e);i&&e.stopPropagation()},n.uid),r.shimExec.call(this,"FileDrop","init")}};return e.FileDrop=n}),n("moxie/runtime/silverlight/file/FileReader",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/FileReader"],function(e,t,i){return e.FileReader=t.extend({},i)}),n("moxie/runtime/silverlight/file/FileReaderSync",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/FileReaderSync"],function(e,t,i){return e.FileReaderSync=t.extend({},i)}),n("moxie/runtime/silverlight/runtime/Transporter",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/runtime/Transporter"],function(e,t,i){return e.Transporter=t.extend({},i)
  6492. }),n("moxie/runtime/silverlight/xhr/XMLHttpRequest",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/xhr/XMLHttpRequest","moxie/runtime/silverlight/file/FileReaderSync","moxie/runtime/silverlight/runtime/Transporter"],function(e,t,i){return e.XMLHttpRequest=t.extend({},i)}),n("moxie/runtime/silverlight/image/Image",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/runtime/flash/image/Image"],function(e,t,i,n){return e.Image=t.extend({},n,{getInfo:function(){var e=this.getRuntime(),n=["tiff","exif","gps","thumb"],r={meta:{}},o=e.shimExec.call(this,"Image","getInfo");return o.meta&&(t.each(n,function(e){var t,i,n,a,s=o.meta[e];if(s&&s.keys)for(r.meta[e]={},i=0,n=s.keys.length;n>i;i++)t=s.keys[i],a=s[t],a&&(/^(\d|[1-9]\d+)$/.test(a)?a=parseInt(a,10):/^\d*\.\d+$/.test(a)&&(a=parseFloat(a)),r.meta[e][t]=a)}),!r.meta||!r.meta.thumb||r.meta.thumb.data instanceof i||(r.meta.thumb.data=new i(e.uid,r.meta.thumb.data))),r.width=parseInt(o.width,10),r.height=parseInt(o.height,10),r.size=parseInt(o.size,10),r.type=o.type,r.name=o.name,r},resize:function(e,t,i){this.getRuntime().shimExec.call(this,"Image","resize",e.x,e.y,e.width,e.height,t,i.preserveHeaders,i.resample)}})}),n("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue;i.call(this,t,a,{access_binary:u(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:!1,drag_and_drop:!1,filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),resize_image:function(){return s.Image&&o.can("access_binary")&&n.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return n.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return o.can("select_file")},summon_file_dialog:function(){return o.can("select_file")&&("Firefox"===n.browser&&n.verComp(n.version,4,">=")||"Opera"===n.browser&&n.verComp(n.version,12,">=")||"IE"===n.browser&&n.verComp(n.version,10,">=")||!!~e.inArray(n.browser,["Chrome","Safari"]))},upload_filesize:c,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html4",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){function e(){var o,c,d,m,h,f,p=this,g=p.getRuntime();f=i.guid("uid_"),o=g.getShimContainer(),s&&(d=n.get(s+"_form"),d&&i.extend(d.style,{top:"100%"})),m=document.createElement("form"),m.setAttribute("id",f+"_form"),m.setAttribute("method","post"),m.setAttribute("enctype","multipart/form-data"),m.setAttribute("encoding","multipart/form-data"),i.extend(m.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),h=document.createElement("input"),h.setAttribute("id",f),h.setAttribute("type","file"),h.setAttribute("accept",l.join(",")),i.extend(h.style,{fontSize:"999px",opacity:0}),m.appendChild(h),o.appendChild(m),i.extend(h.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===a.browser&&a.verComp(a.version,10,"<")&&i.extend(h.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),h.onchange=function(){var i;if(this.value){if(this.files){if(i=this.files[0],0===i.size)return m.parentNode.removeChild(m),void 0}else i={name:this.value};i=new t(g.uid,i),this.onchange=function(){},e.call(p),p.files=[i],h.setAttribute("id",i.uid),m.setAttribute("id",i.uid+"_form"),p.trigger("change"),h=m=null}},g.can("summon_file_dialog")&&(c=n.get(u.browse_button),r.removeEvent(c,"click",p.uid),r.addEvent(c,"click",function(e){h&&!h.disabled&&h.click(),e.preventDefault()},p.uid)),s=f,o=d=c=null}var s,u,c,l=[];i.extend(this,{init:function(t){var i,a=this,s=a.getRuntime();u=t,l=t.accept.mimes||o.extList2mimes(t.accept,s.can("filter_by_extension")),i=s.getShimContainer(),function(){var e,o,l;e=n.get(t.browse_button),c=n.getStyle(e,"z-index")||"auto",s.can("summon_file_dialog")&&("static"===n.getStyle(e,"position")&&(e.style.position="relative"),a.bind("Refresh",function(){o=parseInt(c,10)||1,n.get(u.browse_button).style.zIndex=o,this.getRuntime().getShimContainer().style.zIndex=o-1})),l=s.can("summon_file_dialog")?e:i,r.addEvent(l,"mouseover",function(){a.trigger("mouseenter")},a.uid),r.addEvent(l,"mouseout",function(){a.trigger("mouseleave")},a.uid),r.addEvent(l,"mousedown",function(){a.trigger("mousedown")},a.uid),r.addEvent(n.get(t.container),"mouseup",function(){a.trigger("mouseup")},a.uid),e=null}(),e.call(this),i=null,a.trigger({type:"ready",async:!0})},setOption:function(e,t){var i,r=this.getRuntime();"accept"==e&&(l=t.mimes||o.extList2mimes(t,r.can("filter_by_extension"))),i=n.get(s),i&&i.setAttribute("accept",l.join(","))},disable:function(e){var t;(t=n.get(s))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer(),o=u&&n.get(u.container),a=u&&n.get(u.browse_button);o&&r.removeAllEvents(o,this.uid),a&&(r.removeAllEvents(a,this.uid),a.style.zIndex=c),i&&(r.removeAllEvents(i,this.uid),i.innerHTML=""),t.removeInstance(this.uid),s=l=u=i=o=a=t=null}})}return e.FileInput=s}),n("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),n("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,t,i,n,r,o,a,s){function u(){function e(e){var t,n,r,a,s=this,u=!1;if(l){if(t=l.id.replace(/_iframe$/,""),n=i.get(t+"_form")){for(r=n.getElementsByTagName("input"),a=r.length;a--;)switch(r[a].getAttribute("type")){case"hidden":r[a].parentNode.removeChild(r[a]);break;case"file":u=!0}r=[],u||n.parentNode.removeChild(n),n=null}setTimeout(function(){o.removeEvent(l,"load",s.uid),l.parentNode&&l.parentNode.removeChild(l);var t=s.getRuntime().getShimContainer();t.children.length||t.parentNode.removeChild(t),t=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,m){function h(){var i=y.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='<iframe id="'+f+'_iframe" name="'+f+'_iframe" src="javascript:&quot;&quot;" style="display:none"></iframe>',l=r.firstChild,i.appendChild(l),o.addEvent(l,"load",function(){var i;try{i=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(i.title)?u=i.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(i.body.innerHTML),v.trigger({type:"progress",loaded:c.length,total:c.length}),x&&v.trigger({type:"uploadprogress",loaded:x.size||1025,total:x.size||1025}))}catch(r){if(!n.hasSameOrigin(d.url))return e.call(v,function(){v.trigger("error")}),void 0;u=404}e.call(v,function(){v.trigger("load")})},v.uid)}var f,p,g,x,v=this,y=v.getRuntime();if(u=c=null,m instanceof s&&m.hasBlob()){if(x=m.getBlob(),f=x.uid,g=i.get(f),p=i.get(f+"_form"),!p)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else f=t.guid("uid_"),p=document.createElement("form"),p.setAttribute("id",f+"_form"),p.setAttribute("method",d.method),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),y.getShimContainer().appendChild(p);p.setAttribute("target",f+"_iframe"),m instanceof s&&m.each(function(e,i){if(e instanceof a)g&&g.setAttribute("name",i);else{var n=document.createElement("input");t.extend(n,{type:"hidden",name:i,value:e}),g?p.insertBefore(n,g):p.appendChild(n)}}),p.setAttribute("action",d.url),h(),p.submit(),v.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*<pre[^>]*>/,"").replace(/<\/pre>\s*$/,""))}catch(i){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})}})}return e.XMLHttpRequest=u}),n("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),a(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"])}(this)});
  6493. define("../libs/plupload/js/moxie.min", function(){});
  6494. /**
  6495. * Plupload - multi-runtime File Uploader
  6496. * v2.2.0
  6497. *
  6498. * Copyright 2013, Moxiecode Systems AB
  6499. * Released under GPL License.
  6500. *
  6501. * License: http://www.plupload.com/license
  6502. * Contributing: http://www.plupload.com/contributing
  6503. *
  6504. * Date: 2016-11-14
  6505. */
  6506. !function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.plupload};"function"==typeof define&&define.amd?define("plupload",["./moxie"],i):"object"==typeof module&&module.exports?module.exports=i(require("./moxie")):e.plupload=i(e.moxie)}(this||window,function(e){!function(e,t,i){function n(e){function t(e,t,i){var r={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};r[e]?n[r[e]]=t:i||(n[e]=t)}var i=e.required_features,n={};return"string"==typeof i?l.each(i.split(/\s*,\s*/),function(e){t(e,!0)}):"object"==typeof i?l.each(i,function(e,i){t(i,e)}):i===!0&&(e.chunk_size>0&&(n.slice_blob=!0),l.isEmptyObj(e.resize)&&e.multipart||(n.send_binary_string=!0),l.each(e,function(e,i){t(i,!!e,!0)})),n}var r=window.setTimeout,s={},a=t.core.utils,o=t.runtime.Runtime,l={VERSION:"2.2.0",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:a.Mime.mimes,ua:a.Env,typeOf:a.Basic.typeOf,extend:a.Basic.extend,guid:a.Basic.guid,getAll:function(e){var t,i=[];"array"!==l.typeOf(e)&&(e=[e]);for(var n=e.length;n--;)t=l.get(e[n]),t&&i.push(t);return i.length?i:null},get:a.Dom.get,each:a.Basic.each,getPos:a.Dom.getPos,getSize:a.Dom.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return e?(""+e).replace(i,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:a.Basic.toArray,inArray:a.Basic.inArray,inSeries:a.Basic.inSeries,addI18n:t.core.I18n.addI18n,translate:t.core.I18n.translate,sprintf:a.Basic.sprintf,isEmptyObj:a.Basic.isEmptyObj,hasClass:a.Dom.hasClass,addClass:a.Dom.addClass,removeClass:a.Dom.removeClass,getStyle:a.Dom.getStyle,addEvent:a.Events.addEvent,removeEvent:a.Events.removeEvent,removeAllEvents:a.Events.removeAllEvents,cleanName:function(e){var t,i;for(i=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;t<i.length;t+=2)e=e.replace(i[t],i[t+1]);return e=e.replace(/\s+/g,"_"),e=e.replace(/[^a-z0-9_\-\.]+/gi,"")},buildUrl:function(e,t){var i="";return l.each(t,function(e,t){i+=(i?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(e)}),i&&(e+=(e.indexOf("?")>0?"&":"?")+i),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===i||/\D/.test(e))return l.translate("N/A");var n=Math.pow(1024,4);return e>n?t(e/n,1)+" "+l.translate("tb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("gb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("mb"):e>1024?Math.round(e/1024)+" "+l.translate("kb"):e+" "+l.translate("b")},parseSize:a.Basic.parseSizeStr,predictRuntime:function(e,t){var i,n;return i=new l.Uploader(e),n=o.thatCan(i.getOption().required_features,t||e.runtimes),i.destroy(),n},addFileFilter:function(e,t){s[e]=t}};l.addFileFilter("mime_types",function(e,t,i){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:l.FILE_EXTENSION_ERROR,message:l.translate("File extension error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("max_file_size",function(e,t,i){var n;e=l.parseSize(e),t.size!==n&&e&&t.size>e?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:l.FILE_DUPLICATE_ERROR,message:l.translate("Duplicate file error."),file:t}),i(!1),void 0;i(!0)}),l.Uploader=function(e){function a(){var e,t,i=0;if(this.state==l.STARTED){for(t=0;t<T.length;t++)e||T[t].status!=l.QUEUED?i++:(e=T[t],this.trigger("BeforeUpload",e)&&(e.status=l.UPLOADING,this.trigger("UploadFile",e)));i==T.length&&(this.state!==l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged")),this.trigger("UploadComplete",T))}}function u(e){e.percent=e.size>0?Math.ceil(100*(e.loaded/e.size)):100,d()}function d(){var e,t;for(w.reset(),e=0;e<T.length;e++)t=T[e],t.size!==i?(w.size+=t.origSize,w.loaded+=t.loaded*t.origSize/t.size):w.size=i,t.status==l.DONE?w.uploaded++:t.status==l.FAILED?w.failed++:w.queued++;w.size===i?w.percent=T.length>0?Math.ceil(100*(w.uploaded/T.length)):0:(w.bytesPerSec=Math.ceil(w.loaded/((+new Date-S||1)/1e3)),w.percent=w.size>0?Math.ceil(100*(w.loaded/w.size)):0)}function c(){var e=A[0]||P[0];return e?e.getRuntime().uid:!1}function f(e,t){if(e.ruid){var i=o.getInfo(e.ruid);if(i)return i.can(t)}return!1}function p(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",y),this.bind("BeforeUpload",m),this.bind("UploadFile",E),this.bind("UploadProgress",v),this.bind("StateChanged",b),this.bind("QueueChanged",d),this.bind("Error",z),this.bind("FileUploaded",R),this.bind("Destroy",O)}function g(e,i){var n=this,r=0,s=[],a={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:F,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};l.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(a[t]=e[t])}),e.browse_button&&l.each(e.browse_button,function(i){s.push(function(s){var u=new t.file.FileInput(l.extend({},a,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:i}));u.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),r++,A.push(this),s()},u.onchange=function(){n.addFile(this.files)},u.bind("mouseenter mouseleave mousedown mouseup",function(t){U||(e.browse_button_hover&&("mouseenter"===t.type?l.addClass(i,e.browse_button_hover):"mouseleave"===t.type&&l.removeClass(i,e.browse_button_hover)),e.browse_button_active&&("mousedown"===t.type?l.addClass(i,e.browse_button_active):"mouseup"===t.type&&l.removeClass(i,e.browse_button_active)))}),u.bind("mousedown",function(){n.trigger("Browse")}),u.bind("error runtimeerror",function(){u=null,s()}),u.init()})}),e.drop_element&&l.each(e.drop_element,function(e){s.push(function(i){var s=new t.file.FileDrop(l.extend({},a,{drop_zone:e}));s.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),dragdrop:e.can("drag_and_drop")}),r++,P.push(this),i()},s.ondrop=function(){n.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,i()}),s.init()})}),l.inSeries(s,function(){"function"==typeof i&&i(r)})}function h(e,n,r){var s=new t.image.Image;try{s.onload=function(){return n.width>this.width&&n.height>this.height&&n.quality===i&&n.preserve_headers&&!n.crop?(this.destroy(),r(e)):(s.downsize(n.width,n.height,n.crop,n.preserve_headers),void 0)},s.onresize=function(){r(this.getAsBlob(e.type,n.quality)),this.destroy()},s.onerror=function(){r(e)},s.load(e)}catch(a){r(e)}}function _(e,i,r){function s(e,i,n){var r=I[e];switch(e){case"max_file_size":"max_file_size"===e&&(I.max_file_size=I.filters.max_file_size=i);break;case"chunk_size":(i=l.parseSize(i))&&(I[e]=i,I.send_file_name=!0);break;case"multipart":I[e]=i,i||(I.send_file_name=!0);break;case"unique_names":I[e]=i,i&&(I.send_file_name=!0);break;case"filters":"array"===l.typeOf(i)&&(i={mime_types:i}),n?l.extend(I.filters,i):I.filters=i,i.mime_types&&("string"===l.typeOf(i.mime_types)&&(i.mime_types=t.core.utils.Mime.mimes2extList(i.mime_types)),i.mime_types.regexp=function(e){var t=[];return l.each(e,function(e){l.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(i.mime_types),I.filters.mime_types=i.mime_types);break;case"resize":I.resize=i?l.extend({preserve_headers:!0,crop:!1},i):!1;break;case"prevent_duplicates":I.prevent_duplicates=I.filters.prevent_duplicates=!!i;break;case"container":case"browse_button":case"drop_element":i="container"===e?l.get(i):l.getAll(i);case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":I[e]=i,n||(u=!0);break;default:I[e]=i}n||a.trigger("OptionChanged",e,i,r)}var a=this,u=!1;"object"==typeof e?l.each(e,function(e,t){s(t,e,r)}):s(e,i,r),r?(I.required_features=n(l.extend({},I)),F=n(l.extend({},I,{required_features:!0}))):u&&(a.trigger("Destroy"),g.call(a,I,function(e){e?(a.runtime=o.getInfo(c()).type,a.trigger("Init",{runtime:a.runtime}),a.trigger("PostInit")):a.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}))}function m(e,t){if(e.settings.unique_names){var i=t.name.match(/\.([^.]+)$/),n="part";i&&(n=i[1]),t.target_name=t.id+"."+n}}function E(e,i){function n(){d-->0?r(s,1e3):(i.loaded=p,e.trigger("Error",{code:l.HTTP_ERROR,message:l.translate("HTTP Error."),file:i,response:D.responseText,status:D.status,responseHeaders:D.getAllResponseHeaders()}))}function s(){var f,g,h,_={};i.status===l.UPLOADING&&e.state!==l.STOPPED&&(e.settings.send_file_name&&(_.name=i.target_name||i.name),u&&c.chunks&&a.size>u?(h=Math.min(u,a.size-p),f=a.slice(p,p+h)):(h=a.size,f=a),u&&c.chunks&&(e.settings.send_chunk_number?(_.chunk=Math.ceil(p/u),_.chunks=Math.ceil(a.size/u)):(_.offset=p,_.total=a.size)),D=new t.xhr.XMLHttpRequest,D.upload&&(D.upload.onprogress=function(t){i.loaded=Math.min(i.size,p+t.loaded),e.trigger("UploadProgress",i)}),D.onload=function(){return D.status>=400?(n(),void 0):(d=e.settings.max_retries,h<a.size?(f.destroy(),p+=h,i.loaded=Math.min(p,a.size),e.trigger("ChunkUploaded",i,{offset:i.loaded,total:a.size,response:D.responseText,status:D.status,responseHeaders:D.getAllResponseHeaders()}),"Android Browser"===l.ua.browser&&e.trigger("UploadProgress",i)):i.loaded=i.size,f=g=null,!p||p>=a.size?(i.size!=i.origSize&&(a.destroy(),a=null),e.trigger("UploadProgress",i),i.status=l.DONE,e.trigger("FileUploaded",i,{response:D.responseText,status:D.status,responseHeaders:D.getAllResponseHeaders()})):r(s,1),void 0)},D.onerror=function(){n()},D.onloadend=function(){this.destroy(),D=null},e.settings.multipart&&c.multipart?(D.open("post",o,!0),l.each(e.settings.headers,function(e,t){D.setRequestHeader(t,e)}),g=new t.xhr.FormData,l.each(l.extend(_,e.settings.multipart_params),function(e,t){g.append(t,e)}),g.append(e.settings.file_data_name,f),D.send(g,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:F,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(o=l.buildUrl(e.settings.url,l.extend(_,e.settings.multipart_params)),D.open("post",o,!0),D.setRequestHeader("Content-Type","application/octet-stream"),l.each(e.settings.headers,function(e,t){D.setRequestHeader(t,e)}),D.send(f,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:F,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})))}var a,o=e.settings.url,u=e.settings.chunk_size,d=e.settings.max_retries,c=e.features,p=0;i.loaded&&(p=i.loaded=u?u*Math.floor(i.loaded/u):0),a=i.getSource(),!l.isEmptyObj(e.settings.resize)&&f(a,"send_binary_string")&&-1!==l.inArray(a.type,["image/jpeg","image/png"])?h.call(this,a,e.settings.resize,function(e){a=e,i.size=e.size,s()}):s()}function v(e,t){u(t)}function b(e){if(e.state==l.STARTED)S=+new Date;else if(e.state==l.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==l.UPLOADING&&(e.files[t].status=l.QUEUED,d())}function y(){D&&D.abort()}function R(e){d(),r(function(){a.call(e)},1)}function z(e,t){t.code===l.INIT_ERROR?e.destroy():t.code===l.HTTP_ERROR&&(t.file.status=l.FAILED,u(t.file),e.state==l.STARTED&&(e.trigger("CancelUpload"),r(function(){a.call(e)},1)))}function O(e){e.stop(),l.each(T,function(e){e.destroy()}),T=[],A.length&&(l.each(A,function(e){e.destroy()}),A=[]),P.length&&(l.each(P,function(e){e.destroy()}),P=[]),F={},U=!1,S=D=null,w.reset()}var I,S,w,D,x=l.guid(),T=[],F={},A=[],P=[],U=!1;I={runtimes:o.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",flash_swf_url:"js/Moxie.swf",silverlight_xap_url:"js/Moxie.xap",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:!1,send_file_name:!0,send_chunk_number:!0},_.call(this,e,null,!0),w=new l.QueueProgress,l.extend(this,{id:x,uid:x,state:l.STOPPED,features:{},runtime:null,files:T,settings:I,total:w,init:function(){var e,t,i=this;return e=i.getOption("preinit"),"function"==typeof e?e(i):l.each(e,function(e,t){i.bind(t,e)}),p.call(i),l.each(["container","browse_button","drop_element"],function(e){return null===i.getOption(e)?(t={code:l.INIT_ERROR,message:l.sprintf(l.translate("%s specified, but cannot be found."),e)},!1):void 0}),t?i.trigger("Error",t):I.browse_button||I.drop_element?(g.call(i,I,function(e){var t=i.getOption("init");"function"==typeof t?t(i):l.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=o.getInfo(c()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}),void 0):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("You must specify either browse_button or drop_element.")})},setOption:function(e,t){_.call(this,e,t,!this.runtime)},getOption:function(e){return e?I[e]:I},refresh:function(){A.length&&l.each(A,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=l.STARTED&&(this.state=l.STARTED,this.trigger("StateChanged"),a.call(this))},stop:function(){this.state!=l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){U=arguments[0]!==i?arguments[0]:!0,A.length&&l.each(A,function(e){e.disable(U)}),this.trigger("DisableBrowse",U)},getFile:function(e){var t;for(t=T.length-1;t>=0;t--)if(T[t].id===e)return T[t]},addFile:function(e,i){function n(e,t){var i=[];l.each(u.settings.filters,function(t,n){s[n]&&i.push(function(i){s[n].call(u,t,e,function(e){i(!e)})})}),l.inSeries(i,t)}function a(e){var s=l.typeOf(e);if(e instanceof t.file.File){if(!e.ruid&&!e.isDetached()){if(!o)return!1;e.ruid=o,e.connectRuntime(o)}a(new l.File(e))}else e instanceof t.file.Blob?(a(e.getSource()),e.destroy()):e instanceof l.File?(i&&(e.name=i),d.push(function(t){n(e,function(i){i||(T.push(e),f.push(e),u.trigger("FileFiltered",e)),r(t,1)})})):-1!==l.inArray(s,["file","blob"])?a(new t.file.File(null,e)):"node"===s&&"filelist"===l.typeOf(e.files)?l.each(e.files,a):"array"===s&&(i=null,l.each(e,a))}var o,u=this,d=[],f=[];o=c(),a(e),d.length&&l.inSeries(d,function(){f.length&&u.trigger("FilesAdded",f)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=T.length-1;i>=0;i--)if(T[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var n=T.splice(e===i?0:e,t===i?T.length:t),r=!1;return this.state==l.STARTED&&(l.each(n,function(e){return e.status===l.UPLOADING?(r=!0,!1):void 0}),r&&this.stop()),this.trigger("FilesRemoved",n),l.each(n,function(e){e.destroy()}),r&&this.start(),n},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),i=[].slice.call(arguments),i.shift(),i.unshift(this);for(var n=0;n<t.length;n++)if(t[n].fn.apply(t[n].scope,i)===!1)return!1}return!0},bind:function(e,t,i,n){l.Uploader.prototype.bind.call(this,e,t,n,i)},destroy:function(){this.trigger("Destroy"),I=w=null,this.unbindAll()}})},l.Uploader.prototype=t.core.EventTarget.instance,l.File=function(){function e(e){l.extend(this,{id:l.guid(),name:e.name||e.fileName,type:e.type||"",size:e.size||e.fileSize,origSize:e.size||e.fileSize,loaded:0,percent:0,status:l.QUEUED,lastModifiedDate:e.lastModifiedDate||(new Date).toLocaleString(),getNative:function(){var e=this.getSource().getSource();return-1!==l.inArray(l.typeOf(e),["blob","file"])?e:null},getSource:function(){return t[this.id]?t[this.id]:null},destroy:function(){var e=this.getSource();e&&(e.destroy(),delete t[this.id])}}),t[this.id]=e}var t={};return e}(),l.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},e.plupload=l}(this,e)});
  6507. define('upload',['jquery', 'bootstrap', 'backend', 'config', 'plupload'], function ($, undefined, Backend, Config, Plupload) {
  6508. var Upload = {
  6509. list: {},
  6510. config: {
  6511. container: document.body,
  6512. classname: '.plupload',
  6513. },
  6514. api: {
  6515. //Plupload上传
  6516. plupload: function (element, onAfterUpload) {
  6517. element = typeof element == 'undefined' ? Upload.config.classname : element;
  6518. $(element, Upload.config.container).each(function () {
  6519. var id = $(this).prop("id");
  6520. var url = $(this).data("url");
  6521. var maxsize = $(this).data("maxsize");
  6522. var mimetype = $(this).data("mimetype");
  6523. var multipart = $(this).data("multipart");
  6524. //上传URL
  6525. url = url ? url : Config.upload.uploadurl;
  6526. //最大可上传
  6527. maxsize = maxsize ? maxsize : Config.upload.maxsize;
  6528. //文件类型
  6529. mimetype = mimetype ? mimetype : Config.upload.mimetype;
  6530. //请求的表单参数
  6531. multipart = multipart ? multipart : Config.upload.multipart;
  6532. Upload.list[id] = new Plupload.Uploader({
  6533. runtimes: 'html5,flash,silverlight,html4',
  6534. multi_selection: false, //是否允许多选批量上传
  6535. browse_button: id, // you can pass an id...
  6536. container: $(this).parent().get(0), //取按钮的上级元素
  6537. flash_swf_url: '/assets/libs/plupload/js/Moxie.swf',
  6538. silverlight_xap_url: '/assets/libs/plupload/js/Moxie.xap',
  6539. filters: {
  6540. max_file_size: maxsize,
  6541. mime_types: mimetype
  6542. },
  6543. url: url,
  6544. multipart_params: multipart,
  6545. init: {
  6546. PostInit: function () {
  6547. },
  6548. FilesAdded: function (up, files) {
  6549. Plupload.each(files, function (file) {
  6550. //这里可以改成其它的表现形式
  6551. //document.getElementById('filelist').innerHTML += '<div id="' + file.id + '">' + file.name + ' (' + plupload.formatSize(file.size) + ') <b></b></div>';
  6552. });
  6553. $("#" + id).data("bakup-html", $("#" + id).html());
  6554. //添加后立即上传
  6555. setTimeout(function () {
  6556. Upload.list[id].start();
  6557. }, 1);
  6558. },
  6559. UploadProgress: function (up, file) {
  6560. //这里可以改成其它的表现形式
  6561. //document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '<span>' + file.percent + "%</span>";
  6562. $("#" + id).prop("disabled", true).html("<i class='fa fa-upload'></i> 上传" + file.percent + "%");
  6563. },
  6564. FileUploaded: function (up, file, info) {
  6565. //还原按钮文字及状态
  6566. $("#" + id).prop("disabled", false).html($("#" + id).data("bakup-html"));
  6567. //这里可以改成其它的表现形式
  6568. //document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML += (' [Url]: ' + '<a href="' + url + '" target="_blank">' + url + '</a>');
  6569. //这里建议不修改
  6570. try {
  6571. var data = JSON.parse(info.response);
  6572. if (data.hasOwnProperty('code')) {
  6573. data.code = data.code == 200 ? 0 : data.code;
  6574. if (data.hasOwnProperty("url")) {
  6575. data.content = data.url;
  6576. }
  6577. $("input[data-plupload-id='" + id + "-text']").val(data.content);
  6578. var afterUpload = $("#" + id).data("after-upload");
  6579. if (afterUpload && typeof Upload.api.custom[afterUpload] == 'function') {
  6580. Upload.api.custom[afterUpload].call(info, id, data);
  6581. }
  6582. if (typeof onAfterUpload == 'function') {
  6583. onAfterUpload.call(info, id, data);
  6584. }
  6585. } else {
  6586. Toastr.error(e.message + "(code:-2)");
  6587. }
  6588. } catch (e) {
  6589. Toastr.error(e.message + "(code:-1)");
  6590. }
  6591. },
  6592. Error: function (up, err) {
  6593. Toastr.error(err.message + "(code:" + err.code + ")");
  6594. }
  6595. }
  6596. });
  6597. Upload.list[id].init();
  6598. });
  6599. },
  6600. // AJAX异步上传,主要用于Summernote上传回调
  6601. send: function (file, callback) {
  6602. var data = new FormData();
  6603. data.append("file", file);
  6604. $.each(Config.upload.multipart, function (k, v) {
  6605. data.append(k, v);
  6606. });
  6607. $.ajax({
  6608. url: Config.upload.uploadurl,
  6609. data: data,
  6610. cache: false,
  6611. contentType: false,
  6612. processData: false,
  6613. type: 'POST',
  6614. dataType: 'json',
  6615. success: function (data) {
  6616. if (data.hasOwnProperty("code")) {
  6617. data.code = data.code == 200 ? 1 : data.code;
  6618. if (data.hasOwnProperty("url")) {
  6619. data.content = data.url;
  6620. }
  6621. var content = data.hasOwnProperty("content") && data.content != "" ? data.content : "";
  6622. if (data.code === 1) {
  6623. // 如果回调存在,则直接调用回调
  6624. if (typeof callback == 'function') {
  6625. callback.call(this, data);
  6626. } else {
  6627. Toastr.success(content ? content : __('Operation completed'));
  6628. }
  6629. } else {
  6630. Toastr.error(content ? content : __('Operation failed'));
  6631. }
  6632. } else {
  6633. Toastr.error(__('Unknown data format'));
  6634. }
  6635. }, error: function () {
  6636. Toastr.error(__('Network error'));
  6637. }
  6638. });
  6639. },
  6640. custom: {
  6641. //自定义上传完成回调
  6642. afteruploadcallback: function (id, response) {
  6643. console.log(this, id, response);
  6644. alert("Custom Callback,Response URL:" + response.url);
  6645. },
  6646. },
  6647. }
  6648. };
  6649. return Upload;
  6650. });
  6651. /*!
  6652. * Validator v0.11.9 for Bootstrap 3, by @1000hz
  6653. * Copyright 2017 Cina Saffary
  6654. * Licensed under http://opensource.org/licenses/MIT
  6655. *
  6656. * https://github.com/1000hz/bootstrap-validator
  6657. */
  6658. +function(a){"use strict";function b(b){return b.is('[type="checkbox"]')?b.prop("checked"):b.is('[type="radio"]')?!!a('[name="'+b.attr("name")+'"]:checked').length:b.is("select[multiple]")?(b.val()||[]).length:b.val()}function c(b){return this.each(function(){var c=a(this),e=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b),f=c.data("bs.validator");(f||"destroy"!=b)&&(f||c.data("bs.validator",f=new d(this,e)),"string"==typeof b&&f[b]())})}var d=function(c,e){this.options=e,this.validators=a.extend({},d.VALIDATORS,e.custom),this.$element=a(c),this.$btn=a('button[type="submit"], input[type="submit"]').filter('[form="'+this.$element.attr("id")+'"]').add(this.$element.find('input[type="submit"], button[type="submit"]')),this.update(),this.$element.on("input.bs.validator change.bs.validator focusout.bs.validator",a.proxy(this.onInput,this)),this.$element.on("submit.bs.validator",a.proxy(this.onSubmit,this)),this.$element.on("reset.bs.validator",a.proxy(this.reset,this)),this.$element.find("[data-match]").each(function(){var c=a(this),d=c.attr("data-match");a(d).on("input.bs.validator",function(){b(c)&&c.trigger("input.bs.validator")})}),this.$inputs.filter(function(){return b(a(this))&&!a(this).closest(".has-error").length}).trigger("focusout"),this.$element.attr("novalidate",!0)};d.VERSION="0.11.9",d.INPUT_SELECTOR=':input:not([type="hidden"], [type="submit"], [type="reset"], button)',d.FOCUS_OFFSET=20,d.DEFAULTS={delay:500,html:!1,disable:!0,focus:!0,custom:{},errors:{match:"Does not match",minlength:"Not long enough"},feedback:{success:"glyphicon-ok",error:"glyphicon-remove"}},d.VALIDATORS={"native":function(a){var b=a[0];return b.checkValidity?!b.checkValidity()&&!b.validity.valid&&(b.validationMessage||"error!"):void 0},match:function(b){var c=b.attr("data-match");return b.val()!==a(c).val()&&d.DEFAULTS.errors.match},minlength:function(a){var b=a.attr("data-minlength");return a.val().length<b&&d.DEFAULTS.errors.minlength}},d.prototype.update=function(){var b=this;return this.$inputs=this.$element.find(d.INPUT_SELECTOR).add(this.$element.find('[data-validate="true"]')).not(this.$element.find('[data-validate="false"]').each(function(){b.clearErrors(a(this))})),this.toggleSubmit(),this},d.prototype.onInput=function(b){var c=this,d=a(b.target),e="focusout"!==b.type;this.$inputs.is(d)&&this.validateInput(d,e).done(function(){c.toggleSubmit()})},d.prototype.validateInput=function(c,d){var e=(b(c),c.data("bs.validator.errors"));c.is('[type="radio"]')&&(c=this.$element.find('input[name="'+c.attr("name")+'"]'));var f=a.Event("validate.bs.validator",{relatedTarget:c[0]});if(this.$element.trigger(f),!f.isDefaultPrevented()){var g=this;return this.runValidators(c).done(function(b){c.data("bs.validator.errors",b),b.length?d?g.defer(c,g.showErrors):g.showErrors(c):g.clearErrors(c),e&&b.toString()===e.toString()||(f=b.length?a.Event("invalid.bs.validator",{relatedTarget:c[0],detail:b}):a.Event("valid.bs.validator",{relatedTarget:c[0],detail:e}),g.$element.trigger(f)),g.toggleSubmit(),g.$element.trigger(a.Event("validated.bs.validator",{relatedTarget:c[0]}))})}},d.prototype.runValidators=function(c){function d(a){return c.attr("data-"+a+"-error")}function e(){var a=c[0].validity;return a.typeMismatch?c.attr("data-type-error"):a.patternMismatch?c.attr("data-pattern-error"):a.stepMismatch?c.attr("data-step-error"):a.rangeOverflow?c.attr("data-max-error"):a.rangeUnderflow?c.attr("data-min-error"):a.valueMissing?c.attr("data-required-error"):null}function f(){return c.attr("data-error")}function g(a){return d(a)||e()||f()}var h=[],i=a.Deferred();return c.data("bs.validator.deferred")&&c.data("bs.validator.deferred").reject(),c.data("bs.validator.deferred",i),a.each(this.validators,a.proxy(function(a,d){var e=null;!b(c)&&!c.attr("required")||void 0===c.attr("data-"+a)&&"native"!=a||!(e=d.call(this,c))||(e=g(a)||e,!~h.indexOf(e)&&h.push(e))},this)),!h.length&&b(c)&&c.attr("data-remote")?this.defer(c,function(){var d={};d[c.attr("name")]=b(c),a.get(c.attr("data-remote"),d).fail(function(a,b,c){h.push(g("remote")||c)}).always(function(){i.resolve(h)})}):i.resolve(h),i.promise()},d.prototype.validate=function(){var b=this;return a.when(this.$inputs.map(function(){return b.validateInput(a(this),!1)})).then(function(){b.toggleSubmit(),b.focusError()}),this},d.prototype.focusError=function(){if(this.options.focus){var b=this.$element.find(".has-error:first :input");0!==b.length&&(a("html, body").animate({scrollTop:b.offset().top-d.FOCUS_OFFSET},250),b.focus())}},d.prototype.showErrors=function(b){var c=this.options.html?"html":"text",d=b.data("bs.validator.errors"),e=b.closest(".form-group"),f=e.find(".help-block.with-errors"),g=e.find(".form-control-feedback");d.length&&(d=a("<ul/>").addClass("list-unstyled").append(a.map(d,function(b){return a("<li/>")[c](b)})),void 0===f.data("bs.validator.originalContent")&&f.data("bs.validator.originalContent",f.html()),f.empty().append(d),e.addClass("has-error has-danger"),e.hasClass("has-feedback")&&g.removeClass(this.options.feedback.success)&&g.addClass(this.options.feedback.error)&&e.removeClass("has-success"))},d.prototype.clearErrors=function(a){var c=a.closest(".form-group"),d=c.find(".help-block.with-errors"),e=c.find(".form-control-feedback");d.html(d.data("bs.validator.originalContent")),c.removeClass("has-error has-danger has-success"),c.hasClass("has-feedback")&&e.removeClass(this.options.feedback.error)&&e.removeClass(this.options.feedback.success)&&b(a)&&e.addClass(this.options.feedback.success)&&c.addClass("has-success")},d.prototype.hasErrors=function(){function b(){return!!(a(this).data("bs.validator.errors")||[]).length}return!!this.$inputs.filter(b).length},d.prototype.isIncomplete=function(){function c(){var c=b(a(this));return!("string"==typeof c?a.trim(c):c)}return!!this.$inputs.filter("[required]").filter(c).length},d.prototype.onSubmit=function(a){this.validate(),(this.isIncomplete()||this.hasErrors())&&a.preventDefault()},d.prototype.toggleSubmit=function(){this.options.disable&&this.$btn.toggleClass("disabled",this.isIncomplete()||this.hasErrors())},d.prototype.defer=function(b,c){return c=a.proxy(c,this,b),this.options.delay?(window.clearTimeout(b.data("bs.validator.timeout")),void b.data("bs.validator.timeout",window.setTimeout(c,this.options.delay))):c()},d.prototype.reset=function(){return this.$element.find(".form-control-feedback").removeClass(this.options.feedback.error).removeClass(this.options.feedback.success),this.$inputs.removeData(["bs.validator.errors","bs.validator.deferred"]).each(function(){var b=a(this),c=b.data("bs.validator.timeout");window.clearTimeout(c)&&b.removeData("bs.validator.timeout")}),this.$element.find(".help-block.with-errors").each(function(){var b=a(this),c=b.data("bs.validator.originalContent");b.removeData("bs.validator.originalContent").html(c)}),this.$btn.removeClass("disabled"),this.$element.find(".has-error, .has-danger, .has-success").removeClass("has-error has-danger has-success"),this},d.prototype.destroy=function(){return this.reset(),this.$element.removeAttr("novalidate").removeData("bs.validator").off(".bs.validator"),this.$inputs.off(".bs.validator"),this.options=null,this.validators=null,this.$element=null,this.$btn=null,this.$inputs=null,this};var e=a.fn.validator;a.fn.validator=c,a.fn.validator.Constructor=d,a.fn.validator.noConflict=function(){return a.fn.validator=e,this},a(window).on("load",function(){a('form[data-toggle="validator"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery);
  6659. define("bootstrap-validator", function(){});
  6660. !function ($) {
  6661. /* CHECKBOX PUBLIC CLASS DEFINITION
  6662. * ============================== */
  6663. var Checkbox = function (element, options) {
  6664. this.init(element, options);
  6665. }
  6666. Checkbox.prototype = {
  6667. constructor: Checkbox
  6668. , init: function (element, options) {
  6669. var $el = this.$element = $(element)
  6670. this.options = $.extend({}, $.fn.checkbox.defaults, options);
  6671. $el.before(this.options.template);
  6672. this.setState();
  6673. }
  6674. , setState: function () {
  6675. var $el = this.$element
  6676. , $parent = $el.closest('.checkbox');
  6677. $el.prop('disabled') && $parent.addClass('disabled');
  6678. $el.prop('checked') && $parent.addClass('checked');
  6679. }
  6680. , toggle: function () {
  6681. var ch = 'checked'
  6682. , $el = this.$element
  6683. , $parent = $el.closest('.checkbox')
  6684. , checked = $el.prop(ch)
  6685. , e = $.Event('toggle')
  6686. if ($el.prop('disabled') == false) {
  6687. $parent.toggleClass(ch) && checked ? $el.removeAttr(ch) : $el.prop(ch, ch);
  6688. $el.trigger(e).trigger('change');
  6689. }
  6690. }
  6691. , setCheck: function (option) {
  6692. var d = 'disabled'
  6693. , ch = 'checked'
  6694. , $el = this.$element
  6695. , $parent = $el.closest('.checkbox')
  6696. , checkAction = option == 'check' ? true : false
  6697. , e = $.Event(option)
  6698. $parent[checkAction ? 'addClass' : 'removeClass' ](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
  6699. $el.trigger(e).trigger('change');
  6700. }
  6701. }
  6702. /* CHECKBOX PLUGIN DEFINITION
  6703. * ======================== */
  6704. var old = $.fn.checkbox
  6705. $.fn.checkbox = function (option) {
  6706. return this.each(function () {
  6707. var $this = $(this)
  6708. , data = $this.data('checkbox')
  6709. , options = $.extend({}, $.fn.checkbox.defaults, $this.data(), typeof option == 'object' && option);
  6710. if (!data)
  6711. $this.data('checkbox', (data = new Checkbox(this, options)));
  6712. if (option == 'toggle')
  6713. data.toggle()
  6714. if (option == 'check' || option == 'uncheck')
  6715. data.setCheck(option)
  6716. else if (option)
  6717. data.setState();
  6718. });
  6719. }
  6720. $.fn.checkbox.defaults = {
  6721. template: '<span class="icons"><span class="first-icon fa fa-square-o"></span><span class="second-icon fa fa-check-square-o"></span></span>'
  6722. }
  6723. /* CHECKBOX NO CONFLICT
  6724. * ================== */
  6725. $.fn.checkbox.noConflict = function () {
  6726. $.fn.checkbox = old;
  6727. return this;
  6728. }
  6729. /* CHECKBOX DATA-API
  6730. * =============== */
  6731. $(document).on('click.checkbox.data-api', '[data-toggle^=checkbox], .checkbox', function (e) {
  6732. var $checkbox = $(e.target);
  6733. if (e.target.tagName != "A") {
  6734. e && e.preventDefault() && e.stopPropagation();
  6735. if (!$checkbox.hasClass('checkbox'))
  6736. $checkbox = $checkbox.closest('.checkbox');
  6737. $checkbox.find(':checkbox').checkbox('toggle');
  6738. }
  6739. });
  6740. $(function () {
  6741. $('[data-toggle="checkbox"]').each(function () {
  6742. var $checkbox = $(this);
  6743. $checkbox.checkbox();
  6744. });
  6745. });
  6746. }(window.jQuery);
  6747. define("bootstrap-checkbox", ["jquery"], function(){});
  6748. /* =============================================================
  6749. * flatui-radio v0.0.3
  6750. * ============================================================ */
  6751. !function ($) {
  6752. /* RADIO PUBLIC CLASS DEFINITION
  6753. * ============================== */
  6754. var Radio = function (element, options) {
  6755. this.init(element, options);
  6756. }
  6757. Radio.prototype = {
  6758. constructor: Radio
  6759. , init: function (element, options) {
  6760. var $el = this.$element = $(element)
  6761. this.options = $.extend({}, $.fn.radio.defaults, options);
  6762. $el.before(this.options.template);
  6763. this.setState();
  6764. }
  6765. , setState: function () {
  6766. var $el = this.$element
  6767. , $parent = $el.closest('.radio');
  6768. $el.prop('disabled') && $parent.addClass('disabled');
  6769. $el.prop('checked') && $parent.addClass('checked');
  6770. }
  6771. , toggle: function () {
  6772. var d = 'disabled'
  6773. , ch = 'checked'
  6774. , $el = this.$element
  6775. , checked = $el.prop(ch)
  6776. , $parent = $el.closest('.radio')
  6777. , $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
  6778. , $elemGroup = $parentWrap.find(':radio[name="' + $el.attr('name') + '"]')
  6779. , e = $.Event('toggle')
  6780. if ($el.prop(d) == false) {
  6781. $elemGroup.not($el).each(function () {
  6782. var $el = $(this)
  6783. , $parent = $(this).closest('.radio');
  6784. if ($el.prop(d) == false) {
  6785. $parent.removeClass(ch) && $el.removeAttr(ch).trigger('change');
  6786. }
  6787. });
  6788. if (checked == false)
  6789. $parent.addClass(ch) && $el.prop(ch, true);
  6790. $el.trigger(e);
  6791. if (checked !== $el.prop(ch)) {
  6792. $el.trigger('change');
  6793. }
  6794. }
  6795. }
  6796. , setCheck: function (option) {
  6797. var ch = 'checked'
  6798. , $el = this.$element
  6799. , $parent = $el.closest('.radio')
  6800. , checkAction = option == 'check' ? true : false
  6801. , checked = $el.prop(ch)
  6802. , $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
  6803. , $elemGroup = $parentWrap.find(':radio[name="' + $el['attr']('name') + '"]')
  6804. , e = $.Event(option)
  6805. $elemGroup.not($el).each(function () {
  6806. var $el = $(this)
  6807. , $parent = $(this).closest('.radio');
  6808. $parent.removeClass(ch) && $el.removeAttr(ch);
  6809. });
  6810. $parent[checkAction ? 'addClass' : 'removeClass'](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
  6811. $el.trigger(e);
  6812. if (checked !== $el.prop(ch)) {
  6813. $el.trigger('change');
  6814. }
  6815. }
  6816. }
  6817. /* RADIO PLUGIN DEFINITION
  6818. * ======================== */
  6819. var old = $.fn.radio
  6820. $.fn.radio = function (option) {
  6821. return this.each(function () {
  6822. var $this = $(this)
  6823. , data = $this.data('radio')
  6824. , options = $.extend({}, $.fn.radio.defaults, $this.data(), typeof option == 'object' && option);
  6825. if (!data)
  6826. $this.data('radio', (data = new Radio(this, options)));
  6827. if (option == 'toggle')
  6828. data.toggle()
  6829. if (option == 'check' || option == 'uncheck')
  6830. data.setCheck(option)
  6831. else if (option)
  6832. data.setState();
  6833. });
  6834. }
  6835. $.fn.radio.defaults = {
  6836. template: '<span class="icons"><span class="first-icon fa fa-circle-o"></span><span class="second-icon fa fa-dot-circle-o"></span></span>'
  6837. }
  6838. /* RADIO NO CONFLICT
  6839. * ================== */
  6840. $.fn.radio.noConflict = function () {
  6841. $.fn.radio = old;
  6842. return this;
  6843. }
  6844. /* RADIO DATA-API
  6845. * =============== */
  6846. $(document).on('click.radio.data-api', '[data-toggle^=radio], .radio', function (e) {
  6847. var $radio = $(e.target);
  6848. e && e.preventDefault() && e.stopPropagation();
  6849. if (!$radio.hasClass('radio'))
  6850. $radio = $radio.closest('.radio');
  6851. $radio.find(':radio').radio('toggle');
  6852. });
  6853. $(function () {
  6854. $('[data-toggle="radio"]').each(function () {
  6855. var $radio = $(this);
  6856. $radio.radio();
  6857. });
  6858. });
  6859. }(window.jQuery);
  6860. define("bootstrap-radio", ["jquery"], function(){});
  6861. /* ============================================================
  6862. * bootstrapSwitch v1.3 by Larentis Mattia @spiritualGuru
  6863. * http://www.larentis.eu/switch/
  6864. * ============================================================
  6865. * Licensed under the Apache License, Version 2.0
  6866. * http://www.apache.org/licenses/LICENSE-2.0
  6867. * ============================================================ */
  6868. !function ($) {
  6869. "use strict";
  6870. $.fn['bootstrapSwitch'] = function (method) {
  6871. var methods = {
  6872. init: function () {
  6873. return this.each(function () {
  6874. var $element = $(this)
  6875. , $div
  6876. , $switchLeft
  6877. , $switchRight
  6878. , $label
  6879. , myClasses = ""
  6880. , classes = $element.attr('class')
  6881. , color
  6882. , moving
  6883. , onLabel = "开"
  6884. , offLabel = "关"
  6885. , icon = false;
  6886. $.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) {
  6887. if (classes.indexOf(el) >= 0)
  6888. myClasses = el;
  6889. });
  6890. $element.addClass('has-switch');
  6891. if ($element.data('on') !== undefined)
  6892. color = "switch-" + $element.data('on');
  6893. if ($element.data('on-label') !== undefined)
  6894. onLabel = $element.data('on-label');
  6895. if ($element.data('off-label') !== undefined)
  6896. offLabel = $element.data('off-label');
  6897. if ($element.data('icon') !== undefined)
  6898. icon = $element.data('icon');
  6899. $switchLeft = $('<span>')
  6900. .addClass("switch-left")
  6901. .addClass(myClasses)
  6902. .addClass(color)
  6903. .html(onLabel);
  6904. color = '';
  6905. if ($element.data('off') !== undefined)
  6906. color = "switch-" + $element.data('off');
  6907. $switchRight = $('<span>')
  6908. .addClass("switch-right")
  6909. .addClass(myClasses)
  6910. .addClass(color)
  6911. .html(offLabel);
  6912. $label = $('<label>')
  6913. .html("&nbsp;")
  6914. .addClass(myClasses)
  6915. .attr('for', $element.find('input').attr('id'));
  6916. if (icon) {
  6917. $label.html('<i class="' + icon + '"></i>');
  6918. }
  6919. $div = $element.find(':checkbox').wrap($('<div>')).parent().data('animated', false);
  6920. if ($element.data('animated') !== false)
  6921. $div.addClass('switch-animate').data('animated', true);
  6922. $div
  6923. .append($switchLeft)
  6924. .append($label)
  6925. .append($switchRight);
  6926. $element.find('>div').addClass(
  6927. $element.find('input').is(':checked') ? 'switch-on' : 'switch-off'
  6928. );
  6929. if ($element.find('input').is(':disabled'))
  6930. $(this).addClass('deactivate');
  6931. var changeStatus = function ($this) {
  6932. $this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
  6933. };
  6934. $element.on('keydown', function (e) {
  6935. if (e.keyCode === 32) {
  6936. e.stopImmediatePropagation();
  6937. e.preventDefault();
  6938. changeStatus($(e.target).find('span:first'));
  6939. }
  6940. });
  6941. $switchLeft.on('click', function (e) {
  6942. changeStatus($(this));
  6943. });
  6944. $switchRight.on('click', function (e) {
  6945. changeStatus($(this));
  6946. });
  6947. $element.find('input').on('change', function (e) {
  6948. var $this = $(this)
  6949. , $element = $this.parent()
  6950. , thisState = $this.is(':checked')
  6951. , state = $element.is('.switch-off');
  6952. e.preventDefault();
  6953. $element.css('left', '');
  6954. if (state === thisState) {
  6955. if (thisState)
  6956. $element.removeClass('switch-off').addClass('switch-on');
  6957. else
  6958. $element.removeClass('switch-on').addClass('switch-off');
  6959. if ($element.data('animated') !== false)
  6960. $element.addClass("switch-animate");
  6961. $element.parent().trigger('switch-change', {'el': $this, 'value': thisState})
  6962. }
  6963. });
  6964. $element.find('label').on('mousedown touchstart', function (e) {
  6965. var $this = $(this);
  6966. moving = false;
  6967. e.preventDefault();
  6968. e.stopImmediatePropagation();
  6969. $this.closest('div').removeClass('switch-animate');
  6970. if ($this.closest('.has-switch').is('.deactivate'))
  6971. $this.unbind('click');
  6972. else {
  6973. $this.on('mousemove touchmove', function (e) {
  6974. var $element = $(this).closest('.switch')
  6975. , relativeX = (e.pageX || e.originalEvent.targetTouches[0].pageX) - $element.offset().left
  6976. , percent = (relativeX / $element.width()) * 100
  6977. , left = 25
  6978. , right = 75;
  6979. moving = true;
  6980. if (percent < left)
  6981. percent = left;
  6982. else if (percent > right)
  6983. percent = right;
  6984. $element.find('>div').css('left', (percent - right) + "%")
  6985. });
  6986. $this.on('click touchend', function (e) {
  6987. var $this = $(this)
  6988. , $target = $(e.target)
  6989. , $myCheckBox = $target.siblings('input');
  6990. e.stopImmediatePropagation();
  6991. e.preventDefault();
  6992. $this.unbind('mouseleave');
  6993. if (moving)
  6994. $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25));
  6995. else
  6996. $myCheckBox.prop("checked", !$myCheckBox.is(":checked"));
  6997. moving = false;
  6998. $myCheckBox.trigger('change');
  6999. });
  7000. $this.on('mouseleave', function (e) {
  7001. var $this = $(this)
  7002. , $myCheckBox = $this.siblings('input');
  7003. e.preventDefault();
  7004. e.stopImmediatePropagation();
  7005. $this.unbind('mouseleave');
  7006. $this.trigger('mouseup');
  7007. $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25)).trigger('change');
  7008. });
  7009. $this.on('mouseup', function (e) {
  7010. e.stopImmediatePropagation();
  7011. e.preventDefault();
  7012. $(this).unbind('mousemove');
  7013. });
  7014. }
  7015. });
  7016. }
  7017. );
  7018. },
  7019. toggleActivation: function () {
  7020. $(this).toggleClass('deactivate');
  7021. },
  7022. isActive: function () {
  7023. return !$(this).hasClass('deactivate');
  7024. },
  7025. setActive: function (active) {
  7026. if (active)
  7027. $(this).removeClass('deactivate');
  7028. else
  7029. $(this).addClass('deactivate');
  7030. },
  7031. toggleState: function (skipOnChange) {
  7032. var $input = $(this).find('input:checkbox');
  7033. $input.prop('checked', !$input.is(':checked')).trigger('change', skipOnChange);
  7034. },
  7035. setState: function (value, skipOnChange) {
  7036. $(this).find('input:checkbox').prop('checked', value).trigger('change', skipOnChange);
  7037. },
  7038. status: function () {
  7039. return $(this).find('input:checkbox').is(':checked');
  7040. },
  7041. destroy: function () {
  7042. var $div = $(this).find('div')
  7043. , $checkbox;
  7044. $div.find(':not(input:checkbox)').remove();
  7045. $checkbox = $div.children();
  7046. $checkbox.unwrap().unwrap();
  7047. $checkbox.unbind('change');
  7048. return $checkbox;
  7049. }
  7050. };
  7051. if (methods[method])
  7052. return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
  7053. else if (typeof method === 'object' || !method)
  7054. return methods.init.apply(this, arguments);
  7055. else
  7056. $.error('Method ' + method + ' does not exist!');
  7057. };
  7058. }(jQuery);
  7059. define("bootstrap-switch", ["jquery"], function(){});
  7060. define('form',['jquery', 'bootstrap', 'backend', 'config', 'toastr', 'upload', 'bootstrap-validator', 'bootstrap-checkbox', 'bootstrap-radio', 'bootstrap-switch'], function ($, undefined, Backend, Config, Toastr, Upload, undefined) {
  7061. var Form = {
  7062. config: {
  7063. },
  7064. api: {
  7065. submit: function (form, onBeforeSubmit, onAfterSubmit) {
  7066. if (form.size() == 0)
  7067. return Toastr.error("表单未初始化完成,无法提交");
  7068. //提交前事件
  7069. var beforeSubmit = form.data("before-submit");
  7070. //元素绑定函数
  7071. if (beforeSubmit && typeof Form.api.custom[beforeSubmit] == 'function') {
  7072. if (!Form.api.custom[beforeSubmit].call(form)) {
  7073. return false;
  7074. }
  7075. }
  7076. //自定义函数
  7077. if (typeof onBeforeSubmit == 'function') {
  7078. if (!onBeforeSubmit.call(form)) {
  7079. return false;
  7080. }
  7081. }
  7082. var type = form.attr("method");
  7083. type = type && (type == 'GET' || type == 'POST') ? type : 'GET';
  7084. url = form.attr("action");
  7085. url = url ? url : location.href;
  7086. $.ajax({
  7087. type: type,
  7088. url: url,
  7089. data: form.serialize(),
  7090. dataType: 'json',
  7091. success: function (data) {
  7092. if (data.hasOwnProperty("code")) {
  7093. var content = data.hasOwnProperty("content") && data.content != "" ? data.content : "";
  7094. if (data.code === 1) {
  7095. $('.form-group', form).removeClass('has-feedback has-success has-error');
  7096. //成功提交后事件
  7097. var afterSubmit = form.data("after-submit");
  7098. //元素绑定函数
  7099. if (afterSubmit && typeof Form.api.custom[afterSubmit] == 'function') {
  7100. if (!Form.api.custom[afterSubmit].call(form, content)) {
  7101. return false;
  7102. }
  7103. }
  7104. //自定义函数
  7105. if (typeof onAfterSubmit == 'function') {
  7106. if (!onAfterSubmit.call(form, content)) {
  7107. return false;
  7108. }
  7109. }
  7110. Toastr.success(content ? content : __('Operation completed'));
  7111. } else {
  7112. Toastr.error(content ? content : __('Operation failed'));
  7113. }
  7114. } else {
  7115. Toastr.error(__('Unknown data format'));
  7116. }
  7117. }, error: function () {
  7118. Toastr.error(__('Network error'));
  7119. }, complete: function (e) {
  7120. }
  7121. });
  7122. return false;
  7123. },
  7124. bindevent: function (form, onBeforeSubmit, onAfterSubmit) {
  7125. form.validator().on('submit', function (e) {
  7126. if (e.isDefaultPrevented()) {
  7127. //验证不通过
  7128. Toastr.error("验证失败,请检查表单输入是否正确");
  7129. //Backend.api.error();
  7130. } else {
  7131. //验证通过提交表单
  7132. Form.api.submit(form, onBeforeSubmit, function (content) {
  7133. if (typeof onAfterSubmit == 'function') {
  7134. if (!onAfterSubmit.call(form, content)) {
  7135. return false;
  7136. }
  7137. }
  7138. //提示及关闭当前窗口
  7139. parent.Layer.msg(__('Operation completed'), {
  7140. offset: 0, icon: 1
  7141. });
  7142. parent.$(".btn-refresh").trigger("click");
  7143. var index = parent.Layer.getFrameIndex(window.name);
  7144. parent.Layer.close(index);
  7145. });
  7146. return false;
  7147. }
  7148. });
  7149. // Activate the switches with icons
  7150. if ($('.switch').length != 0) {
  7151. $('.switch')['bootstrapSwitch']();
  7152. }
  7153. // Activate regular switches
  7154. if ($("[data-toggle='switch']").length != 0) {
  7155. $("[data-toggle='switch']").wrap('<div class="switch" />').parent().bootstrapSwitch();
  7156. }
  7157. //绑定select元素事件
  7158. if ($(".selectpicker", form).size() > 0) {
  7159. require(['bootstrap-select'], function () {
  7160. $('.selectpicker', form).selectpicker();
  7161. });
  7162. }
  7163. if ($(".typeahead").size() > 0 || $(".tagsinput").size() > 0) {
  7164. require(['bloodhound'], function () {
  7165. var remotesource = function (input) {
  7166. return new Bloodhound({
  7167. datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'),
  7168. queryTokenizer: Bloodhound.tokenizers.whitespace,
  7169. remote: {
  7170. url: '/ajax/typeahead?search=%QUERY&field=' + $(input).attr("name"),
  7171. wildcard: '%QUERY',
  7172. transform: function (data) {
  7173. return data.content.searchlist;
  7174. }
  7175. }
  7176. });
  7177. };
  7178. //绑定typeahead事件
  7179. if ($(".typeahead", form).size() > 0) {
  7180. require(['typeahead'], function () {
  7181. $(".typeahead", form).each(function () {
  7182. $(this).typeahead({
  7183. hint: true,
  7184. highlight: true,
  7185. minLength: 0
  7186. }, {
  7187. name: 'typeahead',
  7188. limit: 20,
  7189. displayKey: 'id',
  7190. source: remotesource(this),
  7191. templates: {
  7192. empty: '<li class="notfound">' + __('No matches found') + '</li>',
  7193. suggestion: function (item) {
  7194. return '<li>' + item.name + '</li>';
  7195. }
  7196. }
  7197. });
  7198. });
  7199. });
  7200. }
  7201. //绑定tagsinput事件
  7202. if ($(".tagsinput", form).size() > 0) {
  7203. require(['bootstrap-tagsinput'], function () {
  7204. $('.tagsinput', form).each(function () {
  7205. $(this).tagsinput({
  7206. freeInput: false,
  7207. typeaheadjs: {
  7208. name: 'tagsinput',
  7209. limit: 20,
  7210. displayKey: 'name',
  7211. valueKey: 'id',
  7212. source: remotesource(this),
  7213. templates: {
  7214. empty: '<li class="notfound">' + __('No matches found') + '</li>',
  7215. suggestion: function (item) {
  7216. return '<li>' + item.name + '</li>';
  7217. }
  7218. }
  7219. }
  7220. });
  7221. });
  7222. $('.bootstrap-tagsinput .twitter-typeahead').css('display', 'inline');
  7223. });
  7224. }
  7225. });
  7226. }
  7227. //绑定日期时间元素事件
  7228. if ($(".datetimepicker", form).size() > 0) {
  7229. require(['bootstrap-datetimepicker'], function () {
  7230. $('.datetimepicker', form).parent().css('position', 'relative');
  7231. $('.datetimepicker', form)
  7232. .datetimepicker({
  7233. format: 'YYYY-MM-DD HH:mm:ss',
  7234. icons: {
  7235. time: 'fa fa-clock-o',
  7236. date: 'fa fa-calendar',
  7237. up: 'fa fa-chevron-up',
  7238. down: 'fa fa-chevron-down',
  7239. previous: 'fa fa-chevron-left',
  7240. next: 'fa fa-chevron-right',
  7241. today: 'fa fa-history',
  7242. clear: 'fa fa-trash',
  7243. close: 'fa fa-remove'
  7244. },
  7245. showTodayButton: true,
  7246. showClose: true
  7247. });
  7248. });
  7249. }
  7250. //绑定summernote事件
  7251. if ($(".summernote", form).size() > 0) {
  7252. require(['summernote'], function () {
  7253. $(".summernote", form).summernote({
  7254. height: 250,
  7255. lang: 'zh-CN',
  7256. dialogsInBody: true,
  7257. callbacks: {
  7258. onChange: function (contents) {
  7259. $(this).val(contents);
  7260. $(this).trigger('change');
  7261. },
  7262. onInit: function () {
  7263. },
  7264. onImageUpload: function (files) {
  7265. var that = this;
  7266. //依次上传图片
  7267. for (var i = 0; i < files.length; i++) {
  7268. Upload.api.send(files[i], function (data) {
  7269. var url = Config.upload.cdnurl + data.content;
  7270. $(that).summernote("insertImage", url, 'filename');
  7271. });
  7272. }
  7273. }
  7274. }
  7275. });
  7276. });
  7277. }
  7278. //绑定plupload上传元素事件
  7279. if ($(".plupload", form).size() > 0) {
  7280. Upload.api.plupload();
  7281. }
  7282. },
  7283. custom: {}
  7284. },
  7285. };
  7286. return Form;
  7287. });
  7288. // jQuery List DragSort v0.5.2
  7289. // Website: http://dragsort.codeplex.com/
  7290. // License: http://dragsort.codeplex.com/license
  7291. (function($) {
  7292. $.fn.dragsort = function(options) {
  7293. if (options == "destroy") {
  7294. $(this.selector).trigger("dragsort-uninit");
  7295. return;
  7296. }
  7297. var opts = $.extend({}, $.fn.dragsort.defaults, options);
  7298. var lists = [];
  7299. var list = null, lastPos = null;
  7300. this.each(function(i, cont) {
  7301. //if list container is table, the browser automatically wraps rows in tbody if not specified so change list container to tbody so that children returns rows as user expected
  7302. if ($(cont).is("table") && $(cont).children().size() == 1 && $(cont).children().is("tbody"))
  7303. cont = $(cont).children().get(0);
  7304. var newList = {
  7305. draggedItem: null,
  7306. placeHolderItem: null,
  7307. pos: null,
  7308. offset: null,
  7309. offsetLimit: null,
  7310. scroll: null,
  7311. container: cont,
  7312. init: function() {
  7313. //set options to default values if not set
  7314. opts.tagName = $(this.container).children().size() == 0 ? "li" : $(this.container).children().get(0).tagName.toLowerCase();
  7315. if (opts.itemSelector == "")
  7316. opts.itemSelector = opts.tagName;
  7317. if (opts.dragSelector == "")
  7318. opts.dragSelector = opts.tagName;
  7319. if (opts.placeHolderTemplate == "")
  7320. opts.placeHolderTemplate = "<" + opts.tagName + ">&nbsp;</" + opts.tagName + ">";
  7321. //listidx allows reference back to correct list variable instance
  7322. $(this.container).attr("data-listidx", i).mousedown(this.grabItem).bind("dragsort-uninit", this.uninit);
  7323. this.styleDragHandlers(true);
  7324. },
  7325. uninit: function() {
  7326. var list = lists[$(this).attr("data-listidx")];
  7327. $(list.container).unbind("mousedown", list.grabItem).unbind("dragsort-uninit");
  7328. list.styleDragHandlers(false);
  7329. },
  7330. getItems: function() {
  7331. return $(this.container).children(opts.itemSelector);
  7332. },
  7333. styleDragHandlers: function(cursor) {
  7334. this.getItems().map(function() { return $(this).is(opts.dragSelector) ? this : $(this).find(opts.dragSelector).get(); }).css("cursor", cursor ? "pointer" : "");
  7335. },
  7336. grabItem: function(e) {
  7337. var list = lists[$(this).attr("data-listidx")];
  7338. var item = $(e.target).closest("[data-listidx] > " + opts.tagName).get(0);
  7339. var insideMoveableItem = list.getItems().filter(function() { return this == item; }).size() > 0;
  7340. //if not left click or if clicked on excluded element (e.g. text box) or not a moveable list item return
  7341. if (e.which != 1 || $(e.target).is(opts.dragSelectorExclude) || $(e.target).closest(opts.dragSelectorExclude).size() > 0 || !insideMoveableItem)
  7342. return;
  7343. //prevents selection, stops issue on Fx where dragging hyperlink doesn't work and on IE where it triggers mousemove even though mouse hasn't moved,
  7344. //does also stop being able to click text boxes hence dragging on text boxes by default is disabled in dragSelectorExclude
  7345. //e.preventDefault();
  7346. //change cursor to move while dragging
  7347. var dragHandle = e.target;
  7348. while (!$(dragHandle).is(opts.dragSelector)) {
  7349. if (dragHandle == this) return;
  7350. dragHandle = dragHandle.parentNode;
  7351. }
  7352. $(dragHandle).attr("data-cursor", $(dragHandle).css("cursor"));
  7353. $(dragHandle).css("cursor", "move");
  7354. //on mousedown wait for movement of mouse before triggering dragsort script (dragStart) to allow clicking of hyperlinks to work
  7355. var listElem = this;
  7356. var trigger = function() {
  7357. list.dragStart.call(listElem, e);
  7358. $(list.container).unbind("mousemove", trigger);
  7359. };
  7360. $(list.container).mousemove(trigger).mouseup(function() { $(list.container).unbind("mousemove", trigger); $(dragHandle).css("cursor", $(dragHandle).attr("data-cursor")); });
  7361. },
  7362. dragStart: function(e) {
  7363. if (list != null && list.draggedItem != null)
  7364. list.dropItem();
  7365. list = lists[$(this).attr("data-listidx")];
  7366. list.draggedItem = $(e.target).closest("[data-listidx] > " + opts.tagName)
  7367. //record current position so on dragend we know if the dragged item changed position or not, not using getItems to allow dragsort to restore dragged item to original location in relation to fixed items
  7368. list.draggedItem.attr("data-origpos", $(this).attr("data-listidx") + "-" + $(list.container).children().index(list.draggedItem));
  7369. //calculate mouse offset relative to draggedItem
  7370. var mt = parseInt(list.draggedItem.css("marginTop"));
  7371. var ml = parseInt(list.draggedItem.css("marginLeft"));
  7372. list.offset = list.draggedItem.offset();
  7373. list.offset.top = e.pageY - list.offset.top + (isNaN(mt) ? 0 : mt) - 1;
  7374. list.offset.left = e.pageX - list.offset.left + (isNaN(ml) ? 0 : ml) - 1;
  7375. //calculate box the dragged item can't be dragged outside of
  7376. if (!opts.dragBetween) {
  7377. var containerHeight = $(list.container).outerHeight() == 0 ? Math.max(1, Math.round(0.5 + list.getItems().size() * list.draggedItem.outerWidth() / $(list.container).outerWidth())) * list.draggedItem.outerHeight() : $(list.container).outerHeight();
  7378. list.offsetLimit = $(list.container).offset();
  7379. list.offsetLimit.right = list.offsetLimit.left + $(list.container).outerWidth() - list.draggedItem.outerWidth();
  7380. list.offsetLimit.bottom = list.offsetLimit.top + containerHeight - list.draggedItem.outerHeight();
  7381. }
  7382. //create placeholder item
  7383. var h = list.draggedItem.height();
  7384. var w = list.draggedItem.width();
  7385. if (opts.tagName == "tr") {
  7386. list.draggedItem.children().each(function() { $(this).width($(this).width()); });
  7387. list.placeHolderItem = list.draggedItem.clone().attr("data-placeholder", true);
  7388. list.draggedItem.after(list.placeHolderItem);
  7389. //list.placeHolderItem.children().each(function() { $(this).css({ borderWidth:0, width: $(this).width() + 1, height: $(this).height() + 1 }).html("&nbsp;"); });
  7390. list.placeHolderItem.children().each(function() { $(this).html("&nbsp;"); });
  7391. } else {
  7392. list.draggedItem.after(opts.placeHolderTemplate);
  7393. list.placeHolderItem = list.draggedItem.next().css({ height: h, width: w }).attr("data-placeholder", true);
  7394. }
  7395. if (opts.tagName == "td") {
  7396. var listTable = list.draggedItem.closest("table").get(0);
  7397. $("<table id='" + listTable.id + "' style='border-width: 0px;' class='dragSortItem " + listTable.className + "'><tr></tr></table>").appendTo("body").children().append(list.draggedItem);
  7398. }
  7399. //style draggedItem while dragging
  7400. var orig = list.draggedItem.attr("style");
  7401. list.draggedItem.attr("data-origstyle", orig ? orig : "");
  7402. list.draggedItem.css({ position: "absolute", opacity: 0.8, "z-index": 999, height: h, width: w });
  7403. //auto-scroll setup
  7404. list.scroll = { moveX: 0, moveY: 0, maxX: $(document).width() - $(window).width(), maxY: $(document).height() - $(window).height() };
  7405. list.scroll.scrollY = window.setInterval(function() {
  7406. if (opts.scrollContainer != window) {
  7407. $(opts.scrollContainer).scrollTop($(opts.scrollContainer).scrollTop() + list.scroll.moveY);
  7408. return;
  7409. }
  7410. var t = $(opts.scrollContainer).scrollTop();
  7411. if (list.scroll.moveY > 0 && t < list.scroll.maxY || list.scroll.moveY < 0 && t > 0) {
  7412. $(opts.scrollContainer).scrollTop(t + list.scroll.moveY);
  7413. list.draggedItem.css("top", list.draggedItem.offset().top + list.scroll.moveY + 1);
  7414. }
  7415. }, 10);
  7416. list.scroll.scrollX = window.setInterval(function() {
  7417. if (opts.scrollContainer != window) {
  7418. $(opts.scrollContainer).scrollLeft($(opts.scrollContainer).scrollLeft() + list.scroll.moveX);
  7419. return;
  7420. }
  7421. var l = $(opts.scrollContainer).scrollLeft();
  7422. if (list.scroll.moveX > 0 && l < list.scroll.maxX || list.scroll.moveX < 0 && l > 0) {
  7423. $(opts.scrollContainer).scrollLeft(l + list.scroll.moveX);
  7424. list.draggedItem.css("left", list.draggedItem.offset().left + list.scroll.moveX + 1);
  7425. }
  7426. }, 10);
  7427. //misc
  7428. $(lists).each(function(i, l) { l.createDropTargets(); l.buildPositionTable(); });
  7429. list.setPos(e.pageX, e.pageY);
  7430. $(document).bind("mousemove", list.swapItems);
  7431. $(document).bind("mouseup", list.dropItem);
  7432. if (opts.scrollContainer != window)
  7433. $(window).bind("wheel", list.wheel);
  7434. },
  7435. //set position of draggedItem
  7436. setPos: function(x, y) {
  7437. //remove mouse offset so mouse cursor remains in same place on draggedItem instead of top left corner
  7438. var top = y - this.offset.top;
  7439. var left = x - this.offset.left;
  7440. //limit top, left to within box draggedItem can't be dragged outside of
  7441. if (!opts.dragBetween) {
  7442. top = Math.min(this.offsetLimit.bottom, Math.max(top, this.offsetLimit.top));
  7443. left = Math.min(this.offsetLimit.right, Math.max(left, this.offsetLimit.left));
  7444. }
  7445. //adjust top & left calculations to parent offset
  7446. var parent = this.draggedItem.offsetParent().not("body").offset(); //offsetParent returns body even when it's static, if not static offset is only factoring margin
  7447. if (parent != null) {
  7448. top -= parent.top;
  7449. left -= parent.left;
  7450. }
  7451. //set x or y auto-scroll amount
  7452. if (opts.scrollContainer == window) {
  7453. y -= $(window).scrollTop();
  7454. x -= $(window).scrollLeft();
  7455. y = Math.max(0, y - $(window).height() + 5) + Math.min(0, y - 5);
  7456. x = Math.max(0, x - $(window).width() + 5) + Math.min(0, x - 5);
  7457. } else {
  7458. var cont = $(opts.scrollContainer);
  7459. var offset = cont.offset();
  7460. y = Math.max(0, y - cont.height() - offset.top) + Math.min(0, y - offset.top);
  7461. x = Math.max(0, x - cont.width() - offset.left) + Math.min(0, x - offset.left);
  7462. }
  7463. list.scroll.moveX = x == 0 ? 0 : x * opts.scrollSpeed / Math.abs(x);
  7464. list.scroll.moveY = y == 0 ? 0 : y * opts.scrollSpeed / Math.abs(y);
  7465. //move draggedItem to new mouse cursor location
  7466. this.draggedItem.css({ top: top, left: left });
  7467. },
  7468. //if scroll container is a div allow mouse wheel to scroll div instead of window when mouse is hovering over
  7469. wheel: function(e) {
  7470. if (list && opts.scrollContainer != window) {
  7471. var cont = $(opts.scrollContainer);
  7472. var offset = cont.offset();
  7473. e = e.originalEvent;
  7474. if (e.clientX > offset.left && e.clientX < offset.left + cont.width() && e.clientY > offset.top && e.clientY < offset.top + cont.height()) {
  7475. var deltaY = (e.deltaMode == 0 ? 1 : 10) * e.deltaY;
  7476. cont.scrollTop(cont.scrollTop() + deltaY);
  7477. e.preventDefault();
  7478. }
  7479. }
  7480. },
  7481. //build a table recording all the positions of the moveable list items
  7482. buildPositionTable: function() {
  7483. var pos = [];
  7484. this.getItems().not([list.draggedItem[0], list.placeHolderItem[0]]).each(function(i) {
  7485. var loc = $(this).offset();
  7486. loc.right = loc.left + $(this).outerWidth();
  7487. loc.bottom = loc.top + $(this).outerHeight();
  7488. loc.elm = this;
  7489. pos[i] = loc;
  7490. });
  7491. this.pos = pos;
  7492. },
  7493. dropItem: function() {
  7494. if (list.draggedItem == null)
  7495. return;
  7496. //list.draggedItem.attr("style", "") doesn't work on IE8 and jQuery 1.5 or lower
  7497. //list.draggedItem.removeAttr("style") doesn't work on chrome and jQuery 1.6 (works jQuery 1.5 or lower)
  7498. var orig = list.draggedItem.attr("data-origstyle");
  7499. list.draggedItem.attr("style", orig);
  7500. if (orig == "")
  7501. list.draggedItem.removeAttr("style");
  7502. list.draggedItem.removeAttr("data-origstyle");
  7503. list.styleDragHandlers(true);
  7504. list.placeHolderItem.before(list.draggedItem);
  7505. list.placeHolderItem.remove();
  7506. $("[data-droptarget], .dragSortItem").remove();
  7507. window.clearInterval(list.scroll.scrollY);
  7508. window.clearInterval(list.scroll.scrollX);
  7509. //if position changed call dragEnd
  7510. if (list.draggedItem.attr("data-origpos") != $(lists).index(list) + "-" + $(list.container).children().index(list.draggedItem))
  7511. if (opts.dragEnd.apply(list.draggedItem) == false) { //if dragEnd returns false revert order
  7512. var pos = list.draggedItem.attr("data-origpos").split('-');
  7513. var nextItem = $(lists[pos[0]].container).children().not(list.draggedItem).eq(pos[1]);
  7514. if (nextItem.size() > 0)
  7515. nextItem.before(list.draggedItem);
  7516. else if (pos[1] == 0) //was the only item in list
  7517. $(lists[pos[0]].container).prepend(list.draggedItem);
  7518. else //was the last item in list
  7519. $(lists[pos[0]].container).append(list.draggedItem);
  7520. }
  7521. list.draggedItem.removeAttr("data-origpos");
  7522. list.draggedItem = null;
  7523. $(document).unbind("mousemove", list.swapItems);
  7524. $(document).unbind("mouseup", list.dropItem);
  7525. if (opts.scrollContainer != window)
  7526. $(window).unbind("wheel", list.wheel);
  7527. return false;
  7528. },
  7529. //swap the draggedItem (represented visually by placeholder) with the list item the it has been dragged on top of
  7530. swapItems: function(e) {
  7531. if (list.draggedItem == null)
  7532. return false;
  7533. //move draggedItem to mouse location
  7534. list.setPos(e.pageX, e.pageY);
  7535. //retrieve list and item position mouse cursor is over
  7536. var ei = list.findPos(e.pageX, e.pageY);
  7537. var nlist = list;
  7538. for (var i = 0; ei == -1 && opts.dragBetween && i < lists.length; i++) {
  7539. ei = lists[i].findPos(e.pageX, e.pageY);
  7540. nlist = lists[i];
  7541. }
  7542. //if not over another moveable list item return
  7543. if (ei == -1)
  7544. return false;
  7545. //save fixed items locations
  7546. var children = function() { return $(nlist.container).children().not(nlist.draggedItem); };
  7547. var fixed = children().not(opts.itemSelector).each(function(i) { this.idx = children().index(this); });
  7548. //if moving draggedItem up or left place placeHolder before list item the dragged item is hovering over otherwise place it after
  7549. if (lastPos == null || lastPos.top > list.draggedItem.offset().top || lastPos.left > list.draggedItem.offset().left)
  7550. $(nlist.pos[ei].elm).before(list.placeHolderItem);
  7551. else
  7552. $(nlist.pos[ei].elm).after(list.placeHolderItem);
  7553. //restore fixed items location
  7554. fixed.each(function() {
  7555. var elm = children().eq(this.idx).get(0);
  7556. if (this != elm && children().index(this) < this.idx)
  7557. $(this).insertAfter(elm);
  7558. else if (this != elm)
  7559. $(this).insertBefore(elm);
  7560. });
  7561. //misc
  7562. $(lists).each(function(i, l) { l.createDropTargets(); l.buildPositionTable(); });
  7563. lastPos = list.draggedItem.offset();
  7564. return false;
  7565. },
  7566. //returns the index of the list item the mouse is over
  7567. findPos: function(x, y) {
  7568. for (var i = 0; i < this.pos.length; i++) {
  7569. if (this.pos[i].left < x && this.pos[i].right > x && this.pos[i].top < y && this.pos[i].bottom > y)
  7570. return i;
  7571. }
  7572. return -1;
  7573. },
  7574. //create drop targets which are placeholders at the end of other lists to allow dragging straight to the last position
  7575. createDropTargets: function() {
  7576. if (!opts.dragBetween)
  7577. return;
  7578. $(lists).each(function() {
  7579. var ph = $(this.container).find("[data-placeholder]");
  7580. var dt = $(this.container).find("[data-droptarget]");
  7581. if (ph.size() > 0 && dt.size() > 0)
  7582. dt.remove();
  7583. else if (ph.size() == 0 && dt.size() == 0) {
  7584. if (opts.tagName == "td")
  7585. $(opts.placeHolderTemplate).attr("data-droptarget", true).appendTo(this.container);
  7586. else
  7587. //list.placeHolderItem.clone().removeAttr("data-placeholder") crashes in IE7 and jquery 1.5.1 (doesn't in jquery 1.4.2 or IE8)
  7588. $(this.container).append(list.placeHolderItem.removeAttr("data-placeholder").clone().attr("data-droptarget", true));
  7589. list.placeHolderItem.attr("data-placeholder", true);
  7590. }
  7591. });
  7592. }
  7593. };
  7594. newList.init();
  7595. lists.push(newList);
  7596. });
  7597. return this;
  7598. };
  7599. $.fn.dragsort.defaults = {
  7600. itemSelector: "",
  7601. dragSelector: "",
  7602. dragSelectorExclude: "input, textarea",
  7603. dragEnd: function() { },
  7604. dragBetween: false,
  7605. placeHolderTemplate: "",
  7606. scrollContainer: window,
  7607. scrollSpeed: 5
  7608. };
  7609. })(jQuery);
  7610. define("dragsort", function(){});
  7611. /*!
  7612. * jquery.event.drag - v 2.2
  7613. * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com
  7614. * Open Source MIT License - http://threedubmedia.com/code/license
  7615. */
  7616. ;(function(e){e.fn.drag=function(k,g,j){var i=typeof k=="string"?k:"",h=e.isFunction(k)?k:e.isFunction(g)?g:null;if(i.indexOf("drag")!==0){i="drag"+i}j=(k==h?g:j)||{};return h?this.bind(i,j,h):this.trigger(i)};var b=e.event,a=b.special,d=a.drag={defaults:{which:1,distance:0,not:":input",handle:null,relative:false,drop:true,click:false},datakey:"dragdata",noBubble:true,add:function(i){var h=e.data(this,d.datakey),g=i.data||{};h.related+=1;e.each(d.defaults,function(j,k){if(g[j]!==undefined){h[j]=g[j]}})},remove:function(){e.data(this,d.datakey).related-=1},setup:function(){if(e.data(this,d.datakey)){return}var g=e.extend({related:0},d.defaults);e.data(this,d.datakey,g);b.add(this,"touchstart mousedown",d.init,g);if(this.attachEvent){this.attachEvent("ondragstart",d.dontstart)}},teardown:function(){var g=e.data(this,d.datakey)||{};if(g.related){return}e.removeData(this,d.datakey);b.remove(this,"touchstart mousedown",d.init);d.textselect(true);if(this.detachEvent){this.detachEvent("ondragstart",d.dontstart)}},init:function(i){if(d.touched){return}var g=i.data,h;if(i.which!=0&&g.which>0&&i.which!=g.which){return}if(e(i.target).is(g.not)){return}if(g.handle&&!e(i.target).closest(g.handle,i.currentTarget).length){return}d.touched=i.type=="touchstart"?this:null;g.propagates=1;g.mousedown=this;g.interactions=[d.interaction(this,g)];g.target=i.target;g.pageX=i.pageX;g.pageY=i.pageY;g.dragging=null;h=d.hijack(i,"draginit",g);if(!g.propagates){return}h=d.flatten(h);if(h&&h.length){g.interactions=[];e.each(h,function(){g.interactions.push(d.interaction(this,g))})}g.propagates=g.interactions.length;if(g.drop!==false&&a.drop){a.drop.handler(i,g)}d.textselect(false);if(d.touched){b.add(d.touched,"touchmove touchend",d.handler,g)}else{b.add(document,"mousemove mouseup",d.handler,g)}if(!d.touched||g.live){return false}},interaction:function(h,g){var i=e(h)[g.relative?"position":"offset"]()||{top:0,left:0};return{drag:h,callback:new d.callback(),droppable:[],offset:i}},handler:function(h){var g=h.data;switch(h.type){case !g.dragging&&"touchmove":h.preventDefault();case !g.dragging&&"mousemove":if(Math.pow(h.pageX-g.pageX,2)+Math.pow(h.pageY-g.pageY,2)<Math.pow(g.distance,2)){break}h.target=g.target;d.hijack(h,"dragstart",g);if(g.propagates){g.dragging=true}case"touchmove":h.preventDefault();case"mousemove":if(g.dragging){d.hijack(h,"drag",g);if(g.propagates){if(g.drop!==false&&a.drop){a.drop.handler(h,g)}break}h.type="mouseup"}case"touchend":case"mouseup":default:if(d.touched){b.remove(d.touched,"touchmove touchend",d.handler)}else{b.remove(document,"mousemove mouseup",d.handler)}if(g.dragging){if(g.drop!==false&&a.drop){a.drop.handler(h,g)}d.hijack(h,"dragend",g)}d.textselect(true);if(g.click===false&&g.dragging){e.data(g.mousedown,"suppress.click",new Date().getTime()+5)}g.dragging=d.touched=false;break}},hijack:function(h,o,r,p,k){if(!r){return}var q={event:h.originalEvent,type:h.type},m=o.indexOf("drop")?"drag":"drop",t,l=p||0,j,g,s,n=!isNaN(p)?p:r.interactions.length;h.type=o;h.originalEvent=null;r.results=[];do{if(j=r.interactions[l]){if(o!=="dragend"&&j.cancelled){continue}s=d.properties(h,r,j);j.results=[];e(k||j[m]||r.droppable).each(function(u,i){s.target=i;h.isPropagationStopped=function(){return false};t=i?b.dispatch.call(i,h,s):null;if(t===false){if(m=="drag"){j.cancelled=true;r.propagates-=1}if(o=="drop"){j[m][u]=null}}else{if(o=="dropinit"){j.droppable.push(d.element(t)||i)}}if(o=="dragstart"){j.proxy=e(d.element(t)||j.drag)[0]}j.results.push(t);delete h.result;if(o!=="dropinit"){return t}});r.results[l]=d.flatten(j.results);if(o=="dropinit"){j.droppable=d.flatten(j.droppable)}if(o=="dragstart"&&!j.cancelled){s.update()}}}while(++l<n);h.type=q.type;h.originalEvent=q.event;return d.flatten(r.results)},properties:function(i,g,h){var j=h.callback;j.drag=h.drag;j.proxy=h.proxy||h.drag;j.startX=g.pageX;j.startY=g.pageY;j.deltaX=i.pageX-g.pageX;j.deltaY=i.pageY-g.pageY;j.originalX=h.offset.left;j.originalY=h.offset.top;j.offsetX=j.originalX+j.deltaX;j.offsetY=j.originalY+j.deltaY;j.drop=d.flatten((h.drop||[]).slice());j.available=d.flatten((h.droppable||[]).slice());return j},element:function(g){if(g&&(g.jquery||g.nodeType==1)){return g}},flatten:function(g){return e.map(g,function(h){return h&&h.jquery?e.makeArray(h):h&&h.length?d.flatten(h):h})},textselect:function(g){e(document)[g?"unbind":"bind"]("selectstart",d.dontstart).css("MozUserSelect",g?"":"none");document.unselectable=g?"off":"on"},dontstart:function(){return false},callback:function(){}};d.callback.prototype={update:function(){if(a.drop&&this.available.length){e.each(this.available,function(g){a.drop.locate(this,g)})}}};var f=b.dispatch;b.dispatch=function(g){if(e.data(this,"suppress."+g.type)-new Date().getTime()>0){e.removeData(this,"suppress."+g.type);return}return f.apply(this,arguments)};var c=b.fixHooks.touchstart=b.fixHooks.touchmove=b.fixHooks.touchend=b.fixHooks.touchcancel={props:"clientX clientY pageX pageY screenX screenY".split(" "),filter:function(h,i){if(i){var g=(i.touches&&i.touches[0])||(i.changedTouches&&i.changedTouches[0])||null;if(g){e.each(c.props,function(j,k){h[k]=g[k]})}}return h}};a.draginit=a.dragstart=a.dragend=d})(jQuery);
  7617. define("drag", function(){});
  7618. /*!
  7619. * jquery.event.drop - v 2.2
  7620. * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com
  7621. * Open Source MIT License - http://threedubmedia.com/code/license
  7622. */
  7623. ;(function(d){d.fn.drop=function(i,e,h){var g=typeof i=="string"?i:"",f=d.isFunction(i)?i:d.isFunction(e)?e:null;if(g.indexOf("drop")!==0){g="drop"+g}h=(i==f?e:h)||{};return f?this.bind(g,h,f):this.trigger(g)};d.drop=function(e){e=e||{};b.multi=e.multi===true?Infinity:e.multi===false?1:!isNaN(e.multi)?e.multi:b.multi;b.delay=e.delay||b.delay;b.tolerance=d.isFunction(e.tolerance)?e.tolerance:e.tolerance===null?null:b.tolerance;b.mode=e.mode||b.mode||"intersect"};var c=d.event,a=c.special,b=d.event.special.drop={multi:1,delay:20,mode:"overlap",targets:[],datakey:"dropdata",noBubble:true,add:function(f){var e=d.data(this,b.datakey);e.related+=1},remove:function(){d.data(this,b.datakey).related-=1},setup:function(){if(d.data(this,b.datakey)){return}var e={related:0,active:[],anyactive:0,winner:0,location:{}};d.data(this,b.datakey,e);b.targets.push(this);return false},teardown:function(){var f=d.data(this,b.datakey)||{};if(f.related){return}d.removeData(this,b.datakey);var e=this;b.targets=d.grep(b.targets,function(g){return(g!==e)})},handler:function(g,e){var f,h;if(!e){return}switch(g.type){case"mousedown":case"touchstart":h=d(b.targets);if(typeof e.drop=="string"){h=h.filter(e.drop)}h.each(function(){var i=d.data(this,b.datakey);i.active=[];i.anyactive=0;i.winner=0});e.droppable=h;a.drag.hijack(g,"dropinit",e);break;case"mousemove":case"touchmove":b.event=g;if(!b.timer){b.tolerate(e)}break;case"mouseup":case"touchend":b.timer=clearTimeout(b.timer);if(e.propagates){a.drag.hijack(g,"drop",e);a.drag.hijack(g,"dropend",e)}break}},locate:function(k,h){var l=d.data(k,b.datakey),g=d(k),i=g.offset()||{},e=g.outerHeight(),j=g.outerWidth(),f={elem:k,width:j,height:e,top:i.top,left:i.left,right:i.left+j,bottom:i.top+e};if(l){l.location=f;l.index=h;l.elem=k}return f},contains:function(e,f){return((f[0]||f.left)>=e.left&&(f[0]||f.right)<=e.right&&(f[1]||f.top)>=e.top&&(f[1]||f.bottom)<=e.bottom)},modes:{intersect:function(f,e,g){return this.contains(g,[f.pageX,f.pageY])?1000000000:this.modes.overlap.apply(this,arguments)},overlap:function(f,e,g){return Math.max(0,Math.min(g.bottom,e.bottom)-Math.max(g.top,e.top))*Math.max(0,Math.min(g.right,e.right)-Math.max(g.left,e.left))},fit:function(f,e,g){return this.contains(g,e)?1:0},middle:function(f,e,g){return this.contains(g,[e.left+e.width*0.5,e.top+e.height*0.5])?1:0}},sort:function(f,e){return(e.winner-f.winner)||(f.index-e.index)},tolerate:function(q){var k,e,n,j,l,m,g,p=0,f,h=q.interactions.length,r=[b.event.pageX,b.event.pageY],o=b.tolerance||b.modes[b.mode];do{if(f=q.interactions[p]){if(!f){return}f.drop=[];l=[];m=f.droppable.length;if(o){n=b.locate(f.proxy)}k=0;do{if(g=f.droppable[k]){j=d.data(g,b.datakey);e=j.location;if(!e){continue}j.winner=o?o.call(b,b.event,n,e):b.contains(e,r)?1:0;l.push(j)}}while(++k<m);l.sort(b.sort);k=0;do{if(j=l[k]){if(j.winner&&f.drop.length<b.multi){if(!j.active[p]&&!j.anyactive){if(a.drag.hijack(b.event,"dropstart",q,p,j.elem)[0]!==false){j.active[p]=1;j.anyactive+=1}else{j.winner=0}}if(j.winner){f.drop.push(j.elem)}}else{if(j.active[p]&&j.anyactive==1){a.drag.hijack(b.event,"dropend",q,p,j.elem);j.active[p]=0;j.anyactive-=1}}}}while(++k<m)}}while(++p<h);if(b.last&&r[0]==b.last.pageX&&r[1]==b.last.pageY){delete b.timer}else{b.timer=setTimeout(function(){b.tolerate(q)},b.delay)}b.last=b.event}};a.dropinit=a.dropstart=a.dropend=b})(jQuery);
  7624. define("drop", function(){});
  7625. /**
  7626. * http://git.oschina.net/hbbcs/bootStrap-addTabs
  7627. * Created by joe on 2015-12-19.
  7628. * @param {type} options {
  7629. * content string||html 直接指定内容
  7630. * close bool 是否可以关闭
  7631. * monitor 监视的区域
  7632. * }
  7633. *
  7634. * @returns
  7635. */
  7636. $.fn.addtabs = function (options) {
  7637. var obj = $(this);
  7638. options = $.extend({
  7639. content: '', //直接指定所有页面TABS内容
  7640. close: true, //是否可以关闭
  7641. monitor: 'body', //监视的区域
  7642. nav: '.nav-addtabs',
  7643. tab: '.tab-addtabs',
  7644. iframeUse: true, //使用iframe还是ajax
  7645. iframeHeight: $(window).height() - 50, //固定TAB中IFRAME高度,根据需要自己修改
  7646. callback: function () {
  7647. //关闭后回调函数
  7648. }
  7649. }, options || {});
  7650. var navobj = $(options.nav);
  7651. var tabobj = $(options.tab);
  7652. if (history.pushState) {
  7653. //浏览器前进后退事件
  7654. $(window).on("popstate", function (e) {
  7655. var state = e.originalEvent.state;
  7656. $("a[addtabs=" + state.id + "]", options.monitor).data("pushstate", true).trigger("click");
  7657. });
  7658. }
  7659. $(options.monitor).on('click', '[addtabs]', function (e) {
  7660. if ($(this).attr('url').indexOf("javascript") !== 0) {
  7661. if ($(this).is("a")) {
  7662. e.preventDefault();
  7663. }
  7664. var id = $(this).attr('addtabs');
  7665. var title = $(this).attr('title') ? $(this).attr('title') : $.trim($(this).text());
  7666. var url = $(this).attr('url');
  7667. var content = options.content ? options.content : $(this).attr('content');
  7668. var ajax = $(this).attr('ajax') ? true : false;
  7669. var state = ({
  7670. url: url, title: title, id: id, content: content, ajax: ajax
  7671. });
  7672. document.title = title;
  7673. if (history.pushState && !$(this).data("pushstate")) {
  7674. window.history.pushState(state, title, url);
  7675. }
  7676. $(this).data("pushstate", null);
  7677. _add({
  7678. id: id,
  7679. title: $(this).attr('title') ? $(this).attr('title') : $(this).html(),
  7680. content: content,
  7681. url: url,
  7682. ajax: ajax
  7683. });
  7684. }
  7685. });
  7686. navobj.on('click', '.close-tab', function (e) {
  7687. id = $(this).prev("a").attr("aria-controls");
  7688. _close(id);
  7689. return false;
  7690. });
  7691. navobj.on('dblclick', 'li[role=presentation]', function (e) {
  7692. $(this).find(".close-tab").trigger("click");
  7693. });
  7694. navobj.on('click', 'li[role=presentation]', function (e) {
  7695. $("a[addtabs=" + $("a", this).attr("node-id") + "]").trigger("click");
  7696. });
  7697. $(window).resize(function () {
  7698. $("#nav").width($("#header > .navbar").width() - $(".sidebar-toggle").outerWidth() - $(".navbar-custom-menu").outerWidth() - 20);
  7699. _drop();
  7700. });
  7701. _add = function (opts) {
  7702. id = 'tab_' + opts.id;
  7703. url = opts.url;
  7704. url += (opts.url.indexOf("?") > -1 ? "&addtabs=1" : "?addtabs=1");
  7705. navobj.find("[role='presentation']").removeClass('active');
  7706. tabobj.find("[role='tabpanel']").removeClass('active');
  7707. //如果TAB不存在,创建一个新的TAB
  7708. if ($("#" + id).size() == 0) {
  7709. //创建新TAB的title
  7710. title = $('<li role="presentation" id="tab_' + id + '"><a href="#' + id + '" node-id="' + opts.id + '" aria-controls="' + id + '" role="tab" data-toggle="tab">' + opts.title + '</a></li>');
  7711. //是否允许关闭
  7712. if (options.close) {
  7713. title.append(' <i class="close-tab fa fa-remove"></i>');
  7714. }
  7715. //创建新TAB的内容
  7716. content = $('<div role="tabpanel" class="tab-pane" id="' + id + '"></div>');
  7717. //是否指定TAB内容
  7718. if (opts.content) {
  7719. content.append(opts.content);
  7720. } else if (options.iframeUse && !opts.ajax) {//没有内容,使用IFRAME打开链接
  7721. var height = options.iframeHeight;
  7722. content.append('<iframe src="' + url + '" width="100%" height="' + height + '%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe></div>');
  7723. } else {
  7724. $.get(url, function (data) {
  7725. content.append(data);
  7726. });
  7727. }
  7728. //加入TABS
  7729. if ($('.tabdrop li').size() > 0) {
  7730. $('.tabdrop ul').append(title);
  7731. } else {
  7732. navobj.append(title);
  7733. }
  7734. tabobj.append(content);
  7735. }
  7736. //激活TAB
  7737. $("#tab_" + id).addClass('active');
  7738. $("#" + id).addClass("active");
  7739. _drop();
  7740. };
  7741. _close = function (id) {
  7742. //如果关闭的是当前激活的TAB,激活他的前一个TAB
  7743. if (obj.find("li.active").attr('id') == "tab_" + id) {
  7744. if ($("#tab_" + id).prev().not(".tabdrop").size() > 0) {
  7745. $("#tab_" + id).prev().not(".tabdrop").find("a").trigger("click");
  7746. } else if ($("#tab_" + id).next().size() > 0) {
  7747. $("#tab_" + id).next().trigger("click");
  7748. }
  7749. }
  7750. //关闭TAB
  7751. $("#tab_" + id).remove();
  7752. $("#" + id).remove();
  7753. _drop();
  7754. options.callback();
  7755. };
  7756. _drop = function () {
  7757. //创建下拉标签
  7758. var dropdown = $('<li class="dropdown pull-right hide tabdrop"><a class="dropdown-toggle" data-toggle="dropdown" href="javascript:;">' +
  7759. '<i class="glyphicon glyphicon-align-justify"></i>' +
  7760. ' <b class="caret"></b></a><ul class="dropdown-menu"></ul></li>');
  7761. //检测是否已增加
  7762. if (!$('.tabdrop').html()) {
  7763. dropdown.prependTo(navobj);
  7764. } else {
  7765. dropdown = navobj.find('.tabdrop');
  7766. }
  7767. //检测是否有下拉样式
  7768. if (navobj.parent().is('.tabs-below')) {
  7769. dropdown.addClass('dropup');
  7770. }
  7771. var collection = 0;
  7772. var maxwidth = navobj.width() - 60;
  7773. var liwidth = 0;
  7774. //检查超过一行的标签页
  7775. var litabs = navobj.append(dropdown.find('li')).find('>li').not('.tabdrop');
  7776. var lisize = litabs.size();
  7777. litabs.each(function (i, j) {
  7778. liwidth += $(this).width();
  7779. if (collection == 0 && i == lisize - 1 && liwidth <= navobj.width()) {
  7780. return true;
  7781. }
  7782. if (liwidth > maxwidth) {
  7783. dropdown.find('ul').append($(this));
  7784. collection++;
  7785. }
  7786. });
  7787. //如果有超出的,显示下拉标签
  7788. if (collection > 0) {
  7789. dropdown.removeClass('hide');
  7790. if (dropdown.find('.active').length == 1) {
  7791. dropdown.addClass('active');
  7792. } else {
  7793. dropdown.removeClass('active');
  7794. }
  7795. } else {
  7796. dropdown.addClass('hide');
  7797. }
  7798. };
  7799. };
  7800. define("addtabs", function(){});
  7801. (function(c){var d=document,a='appendChild',i='styleSheet',s=d.createElement('style');s.type='text/css';d.getElementsByTagName('head')[0][a](s);s[i]?s[i].cssText=c:s[a](d.createTextNode(c));})
  7802. ('.fixed-table-container .bs-checkbox,.fixed-table-container .no-records-found{text-align:center}.fixed-table-body thead th .th-inner,.table td,.table th{box-sizing:border-box}.bootstrap-table .table{margin-bottom:0!important;border-bottom:1px solid #ddd;border-collapse:collapse!important;border-radius:1px}.bootstrap-table .table:not(.table-condensed),.bootstrap-table .table:not(.table-condensed)>tbody>tr>td,.bootstrap-table .table:not(.table-condensed)>tbody>tr>th,.bootstrap-table .table:not(.table-condensed)>tfoot>tr>td,.bootstrap-table .table:not(.table-condensed)>tfoot>tr>th,.bootstrap-table .table:not(.table-condensed)>thead>tr>td{padding:8px}.bootstrap-table .table.table-no-bordered>tbody>tr>td,.bootstrap-table .table.table-no-bordered>thead>tr>th{border-right:2px solid transparent}.bootstrap-table .table.table-no-bordered>tbody>tr>td:last-child{border-right:none}.fixed-table-container{position:relative;clear:both;border:1px solid #ddd;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.fixed-table-container.table-no-bordered{border:1px solid transparent}.fixed-table-footer,.fixed-table-header{overflow:hidden}.fixed-table-footer{border-top:1px solid #ddd}.fixed-table-body{overflow-x:auto;overflow-y:auto;height:100%}.fixed-table-container table{width:100%}.fixed-table-container thead th{height:0;padding:0;margin:0;border-left:1px solid #ddd}.fixed-table-container thead th:focus{outline:transparent solid 0}.fixed-table-container thead th:first-child{border-left:none;border-top-left-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px}.fixed-table-container tbody td .th-inner,.fixed-table-container thead th .th-inner{padding:8px;line-height:24px;vertical-align:top;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fixed-table-container thead th .sortable{cursor:pointer;background-position:right;background-repeat:no-repeat;padding-right:30px}.fixed-table-container thead th .both{background-image:url(\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC\')}.fixed-table-container thead th .asc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==)}.fixed-table-container thead th .desc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII=)}.fixed-table-container th.detail{width:30px}.fixed-table-container tbody td{border-left:1px solid #ddd}.fixed-table-container tbody tr:first-child td{border-top:none}.fixed-table-container tbody td:first-child{border-left:none}.fixed-table-container tbody .selected td{background-color:#f5f5f5}.fixed-table-container .bs-checkbox .th-inner{padding:8px 0}.fixed-table-container input[type=radio],.fixed-table-container input[type=checkbox]{margin:0 auto!important}.fixed-table-pagination .pagination-detail,.fixed-table-pagination div.pagination{margin-top:10px;margin-bottom:10px}.fixed-table-pagination div.pagination .pagination{margin:0}.fixed-table-pagination .pagination a{padding:6px 12px;line-height:1.428571429}.fixed-table-pagination .pagination-info{line-height:34px;margin-right:5px}.fixed-table-pagination .btn-group{position:relative;display:inline-block;vertical-align:middle}.fixed-table-pagination .dropup .dropdown-menu{margin-bottom:0}.fixed-table-pagination .page-list{display:inline-block}.fixed-table-toolbar .columns-left{margin-right:5px}.fixed-table-toolbar .columns-right{margin-left:5px}.fixed-table-toolbar .columns label{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.428571429}.fixed-table-toolbar .bs-bars,.fixed-table-toolbar .columns,.fixed-table-toolbar .search{position:relative;margin-top:10px;margin-bottom:10px;line-height:34px}.fixed-table-pagination li.disabled a{pointer-events:none;cursor:default}.fixed-table-loading{display:none;position:absolute;top:42px;right:0;bottom:0;left:0;z-index:99;background-color:#fff;text-align:center}.fixed-table-body .card-view .title{font-weight:700;display:inline-block;min-width:30%;text-align:left!important}.table td,.table th{vertical-align:middle}.fixed-table-toolbar .dropdown-menu{text-align:left;max-height:300px;overflow:auto}.fixed-table-toolbar .btn-group>.btn-group{display:inline-block;margin-left:-1px!important}.fixed-table-toolbar .btn-group>.btn-group>.btn{border-radius:0}.fixed-table-toolbar .btn-group>.btn-group:first-child>.btn{border-top-left-radius:4px;border-bottom-left-radius:4px}.fixed-table-toolbar .btn-group>.btn-group:last-child>.btn{border-top-right-radius:4px;border-bottom-right-radius:4px}.bootstrap-table .table>thead>tr>th{vertical-align:bottom;border-bottom:1px solid #ddd}.bootstrap-table .table thead>tr>th{padding:0;margin:0}.bootstrap-table .fixed-table-footer tbody>tr>td{padding:0!important}.bootstrap-table .fixed-table-footer .table{border-bottom:none;border-radius:0;padding:0!important}.pull-right .dropdown-menu{right:0;left:auto}p.fixed-table-scroll-inner{width:100%;height:200px}div.fixed-table-scroll-outer{top:0;left:0;visibility:hidden;width:200px;height:150px;overflow:hidden}');