vendor.min.js 211 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957
  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. /* ===================================================
  6. * bootstrap-transition.js v2.1.1
  7. * http://twitter.github.com/bootstrap/javascript.html#transitions
  8. * ===================================================
  9. * Copyright 2012 Twitter, Inc.
  10. *
  11. * Licensed under the Apache License, Version 2.0 (the "License");
  12. * you may not use this file except in compliance with the License.
  13. * You may obtain a copy of the License at
  14. *
  15. * http://www.apache.org/licenses/LICENSE-2.0
  16. *
  17. * Unless required by applicable law or agreed to in writing, software
  18. * distributed under the License is distributed on an "AS IS" BASIS,
  19. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  20. * See the License for the specific language governing permissions and
  21. * limitations under the License.
  22. * ========================================================== */
  23. !function ($) {
  24. $(function () {
  25. "use strict"; // jshint ;_;
  26. /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
  27. * ======================================================= */
  28. $.support.transition = (function () {
  29. var transitionEnd = (function () {
  30. var el = document.createElement('bootstrap')
  31. , transEndEventNames = {
  32. 'WebkitTransition' : 'webkitTransitionEnd'
  33. , 'MozTransition' : 'transitionend'
  34. , 'OTransition' : 'oTransitionEnd otransitionend'
  35. , 'transition' : 'transitionend'
  36. }
  37. , name
  38. for (name in transEndEventNames){
  39. if (el.style[name] !== undefined) {
  40. return transEndEventNames[name]
  41. }
  42. }
  43. }())
  44. return transitionEnd && {
  45. end: transitionEnd
  46. }
  47. })()
  48. })
  49. }(window.jQuery);/* ==========================================================
  50. * bootstrap-alert.js v2.1.1
  51. * http://twitter.github.com/bootstrap/javascript.html#alerts
  52. * ==========================================================
  53. * Copyright 2012 Twitter, Inc.
  54. *
  55. * Licensed under the Apache License, Version 2.0 (the "License");
  56. * you may not use this file except in compliance with the License.
  57. * You may obtain a copy of the License at
  58. *
  59. * http://www.apache.org/licenses/LICENSE-2.0
  60. *
  61. * Unless required by applicable law or agreed to in writing, software
  62. * distributed under the License is distributed on an "AS IS" BASIS,
  63. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  64. * See the License for the specific language governing permissions and
  65. * limitations under the License.
  66. * ========================================================== */
  67. !function ($) {
  68. "use strict"; // jshint ;_;
  69. /* ALERT CLASS DEFINITION
  70. * ====================== */
  71. var dismiss = '[data-dismiss="alert"]'
  72. , Alert = function (el) {
  73. $(el).on('click', dismiss, this.close)
  74. }
  75. Alert.prototype.close = function (e) {
  76. var $this = $(this)
  77. , selector = $this.attr('data-target')
  78. , $parent
  79. if (!selector) {
  80. selector = $this.attr('href')
  81. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
  82. }
  83. $parent = $(selector)
  84. e && e.preventDefault()
  85. $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
  86. $parent.trigger(e = $.Event('close'))
  87. if (e.isDefaultPrevented()) return
  88. $parent.removeClass('in')
  89. function removeElement() {
  90. $parent
  91. .trigger('closed')
  92. .remove()
  93. }
  94. $.support.transition && $parent.hasClass('fade') ?
  95. $parent.on($.support.transition.end, removeElement) :
  96. removeElement()
  97. }
  98. /* ALERT PLUGIN DEFINITION
  99. * ======================= */
  100. $.fn.alert = function (option) {
  101. return this.each(function () {
  102. var $this = $(this)
  103. , data = $this.data('alert')
  104. if (!data) $this.data('alert', (data = new Alert(this)))
  105. if (typeof option == 'string') data[option].call($this)
  106. })
  107. }
  108. $.fn.alert.Constructor = Alert
  109. /* ALERT DATA-API
  110. * ============== */
  111. $(function () {
  112. $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
  113. })
  114. }(window.jQuery);/* ============================================================
  115. * bootstrap-button.js v2.1.1
  116. * http://twitter.github.com/bootstrap/javascript.html#buttons
  117. * ============================================================
  118. * Copyright 2012 Twitter, Inc.
  119. *
  120. * Licensed under the Apache License, Version 2.0 (the "License");
  121. * you may not use this file except in compliance with the License.
  122. * You may obtain a copy of the License at
  123. *
  124. * http://www.apache.org/licenses/LICENSE-2.0
  125. *
  126. * Unless required by applicable law or agreed to in writing, software
  127. * distributed under the License is distributed on an "AS IS" BASIS,
  128. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  129. * See the License for the specific language governing permissions and
  130. * limitations under the License.
  131. * ============================================================ */
  132. !function ($) {
  133. "use strict"; // jshint ;_;
  134. /* BUTTON PUBLIC CLASS DEFINITION
  135. * ============================== */
  136. var Button = function (element, options) {
  137. this.$element = $(element)
  138. this.options = $.extend({}, $.fn.button.defaults, options)
  139. }
  140. Button.prototype.setState = function (state) {
  141. var d = 'disabled'
  142. , $el = this.$element
  143. , data = $el.data()
  144. , val = $el.is('input') ? 'val' : 'html'
  145. state = state + 'Text'
  146. data.resetText || $el.data('resetText', $el[val]())
  147. $el[val](data[state] || this.options[state])
  148. // push to event loop to allow forms to submit
  149. setTimeout(function () {
  150. state == 'loadingText' ?
  151. $el.addClass(d).attr(d, d) :
  152. $el.removeClass(d).removeAttr(d)
  153. }, 0)
  154. }
  155. Button.prototype.toggle = function () {
  156. var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
  157. $parent && $parent
  158. .find('.active')
  159. .removeClass('active')
  160. this.$element.toggleClass('active')
  161. }
  162. /* BUTTON PLUGIN DEFINITION
  163. * ======================== */
  164. $.fn.button = function (option) {
  165. return this.each(function () {
  166. var $this = $(this)
  167. , data = $this.data('button')
  168. , options = typeof option == 'object' && option
  169. if (!data) $this.data('button', (data = new Button(this, options)))
  170. if (option == 'toggle') data.toggle()
  171. else if (option) data.setState(option)
  172. })
  173. }
  174. $.fn.button.defaults = {
  175. loadingText: 'loading...'
  176. }
  177. $.fn.button.Constructor = Button
  178. /* BUTTON DATA-API
  179. * =============== */
  180. $(function () {
  181. $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
  182. var $btn = $(e.target)
  183. if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
  184. $btn.button('toggle')
  185. })
  186. })
  187. }(window.jQuery);/* ==========================================================
  188. * bootstrap-carousel.js v2.1.1
  189. * http://twitter.github.com/bootstrap/javascript.html#carousel
  190. * ==========================================================
  191. * Copyright 2012 Twitter, Inc.
  192. *
  193. * Licensed under the Apache License, Version 2.0 (the "License");
  194. * you may not use this file except in compliance with the License.
  195. * You may obtain a copy of the License at
  196. *
  197. * http://www.apache.org/licenses/LICENSE-2.0
  198. *
  199. * Unless required by applicable law or agreed to in writing, software
  200. * distributed under the License is distributed on an "AS IS" BASIS,
  201. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  202. * See the License for the specific language governing permissions and
  203. * limitations under the License.
  204. * ========================================================== */
  205. !function ($) {
  206. "use strict"; // jshint ;_;
  207. /* CAROUSEL CLASS DEFINITION
  208. * ========================= */
  209. var Carousel = function (element, options) {
  210. this.$element = $(element)
  211. this.options = options
  212. this.options.slide && this.slide(this.options.slide)
  213. this.options.pause == 'hover' && this.$element
  214. .on('mouseenter', $.proxy(this.pause, this))
  215. .on('mouseleave', $.proxy(this.cycle, this))
  216. }
  217. Carousel.prototype = {
  218. cycle: function (e) {
  219. if (!e) this.paused = false
  220. this.options.interval
  221. && !this.paused
  222. && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
  223. return this
  224. }
  225. , to: function (pos) {
  226. var $active = this.$element.find('.item.active')
  227. , children = $active.parent().children()
  228. , activePos = children.index($active)
  229. , that = this
  230. if (pos > (children.length - 1) || pos < 0) return
  231. if (this.sliding) {
  232. return this.$element.one('slid', function () {
  233. that.to(pos)
  234. })
  235. }
  236. if (activePos == pos) {
  237. return this.pause().cycle()
  238. }
  239. return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
  240. }
  241. , pause: function (e) {
  242. if (!e) this.paused = true
  243. if (this.$element.find('.next, .prev').length && $.support.transition.end) {
  244. this.$element.trigger($.support.transition.end)
  245. this.cycle()
  246. }
  247. clearInterval(this.interval)
  248. this.interval = null
  249. return this
  250. }
  251. , next: function () {
  252. if (this.sliding) return
  253. return this.slide('next')
  254. }
  255. , prev: function () {
  256. if (this.sliding) return
  257. return this.slide('prev')
  258. }
  259. , slide: function (type, next) {
  260. var $active = this.$element.find('.item.active')
  261. , $next = next || $active[type]()
  262. , isCycling = this.interval
  263. , direction = type == 'next' ? 'left' : 'right'
  264. , fallback = type == 'next' ? 'first' : 'last'
  265. , that = this
  266. , e = $.Event('slide', {
  267. relatedTarget: $next[0]
  268. })
  269. this.sliding = true
  270. isCycling && this.pause()
  271. $next = $next.length ? $next : this.$element.find('.item')[fallback]()
  272. if ($next.hasClass('active')) return
  273. if ($.support.transition && this.$element.hasClass('slide')) {
  274. this.$element.trigger(e)
  275. if (e.isDefaultPrevented()) return
  276. $next.addClass(type)
  277. $next[0].offsetWidth // force reflow
  278. $active.addClass(direction)
  279. $next.addClass(direction)
  280. this.$element.one($.support.transition.end, function () {
  281. $next.removeClass([type, direction].join(' ')).addClass('active')
  282. $active.removeClass(['active', direction].join(' '))
  283. that.sliding = false
  284. setTimeout(function () { that.$element.trigger('slid') }, 0)
  285. })
  286. } else {
  287. this.$element.trigger(e)
  288. if (e.isDefaultPrevented()) return
  289. $active.removeClass('active')
  290. $next.addClass('active')
  291. this.sliding = false
  292. this.$element.trigger('slid')
  293. }
  294. isCycling && this.cycle()
  295. return this
  296. }
  297. }
  298. /* CAROUSEL PLUGIN DEFINITION
  299. * ========================== */
  300. $.fn.carousel = function (option) {
  301. return this.each(function () {
  302. var $this = $(this)
  303. , data = $this.data('carousel')
  304. , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
  305. , action = typeof option == 'string' ? option : options.slide
  306. if (!data) $this.data('carousel', (data = new Carousel(this, options)))
  307. if (typeof option == 'number') data.to(option)
  308. else if (action) data[action]()
  309. else if (options.interval) data.cycle()
  310. })
  311. }
  312. $.fn.carousel.defaults = {
  313. interval: 5000
  314. , pause: 'hover'
  315. }
  316. $.fn.carousel.Constructor = Carousel
  317. /* CAROUSEL DATA-API
  318. * ================= */
  319. $(function () {
  320. $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
  321. var $this = $(this), href
  322. , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
  323. , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
  324. $target.carousel(options)
  325. e.preventDefault()
  326. })
  327. })
  328. }(window.jQuery);/* =============================================================
  329. * bootstrap-collapse.js v2.1.1
  330. * http://twitter.github.com/bootstrap/javascript.html#collapse
  331. * =============================================================
  332. * Copyright 2012 Twitter, Inc.
  333. *
  334. * Licensed under the Apache License, Version 2.0 (the "License");
  335. * you may not use this file except in compliance with the License.
  336. * You may obtain a copy of the License at
  337. *
  338. * http://www.apache.org/licenses/LICENSE-2.0
  339. *
  340. * Unless required by applicable law or agreed to in writing, software
  341. * distributed under the License is distributed on an "AS IS" BASIS,
  342. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  343. * See the License for the specific language governing permissions and
  344. * limitations under the License.
  345. * ============================================================ */
  346. !function ($) {
  347. "use strict"; // jshint ;_;
  348. /* COLLAPSE PUBLIC CLASS DEFINITION
  349. * ================================ */
  350. var Collapse = function (element, options) {
  351. this.$element = $(element)
  352. this.options = $.extend({}, $.fn.collapse.defaults, options)
  353. if (this.options.parent) {
  354. this.$parent = $(this.options.parent)
  355. }
  356. this.options.toggle && this.toggle()
  357. }
  358. Collapse.prototype = {
  359. constructor: Collapse
  360. , dimension: function () {
  361. var hasWidth = this.$element.hasClass('width')
  362. return hasWidth ? 'width' : 'height'
  363. }
  364. , show: function () {
  365. var dimension
  366. , scroll
  367. , actives
  368. , hasData
  369. if (this.transitioning) return
  370. dimension = this.dimension()
  371. scroll = $.camelCase(['scroll', dimension].join('-'))
  372. actives = this.$parent && this.$parent.find('> .accordion-group > .in')
  373. if (actives && actives.length) {
  374. hasData = actives.data('collapse')
  375. if (hasData && hasData.transitioning) return
  376. actives.collapse('hide')
  377. hasData || actives.data('collapse', null)
  378. }
  379. this.$element[dimension](0)
  380. this.transition('addClass', $.Event('show'), 'shown')
  381. $.support.transition && this.$element[dimension](this.$element[0][scroll])
  382. }
  383. , hide: function () {
  384. var dimension
  385. if (this.transitioning) return
  386. dimension = this.dimension()
  387. this.reset(this.$element[dimension]())
  388. this.transition('removeClass', $.Event('hide'), 'hidden')
  389. this.$element[dimension](0)
  390. }
  391. , reset: function (size) {
  392. var dimension = this.dimension()
  393. this.$element
  394. .removeClass('collapse')
  395. [dimension](size || 'auto')
  396. [0].offsetWidth
  397. this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
  398. return this
  399. }
  400. , transition: function (method, startEvent, completeEvent) {
  401. var that = this
  402. , complete = function () {
  403. if (startEvent.type == 'show') that.reset()
  404. that.transitioning = 0
  405. that.$element.trigger(completeEvent)
  406. }
  407. this.$element.trigger(startEvent)
  408. if (startEvent.isDefaultPrevented()) return
  409. this.transitioning = 1
  410. this.$element[method]('in')
  411. $.support.transition && this.$element.hasClass('collapse') ?
  412. this.$element.one($.support.transition.end, complete) :
  413. complete()
  414. }
  415. , toggle: function () {
  416. this[this.$element.hasClass('in') ? 'hide' : 'show']()
  417. }
  418. }
  419. /* COLLAPSIBLE PLUGIN DEFINITION
  420. * ============================== */
  421. $.fn.collapse = function (option) {
  422. return this.each(function () {
  423. var $this = $(this)
  424. , data = $this.data('collapse')
  425. , options = typeof option == 'object' && option
  426. if (!data) $this.data('collapse', (data = new Collapse(this, options)))
  427. if (typeof option == 'string') data[option]()
  428. })
  429. }
  430. $.fn.collapse.defaults = {
  431. toggle: true
  432. }
  433. $.fn.collapse.Constructor = Collapse
  434. /* COLLAPSIBLE DATA-API
  435. * ==================== */
  436. $(function () {
  437. $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
  438. var $this = $(this), href
  439. , target = $this.attr('data-target')
  440. || e.preventDefault()
  441. || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
  442. , option = $(target).data('collapse') ? 'toggle' : $this.data()
  443. $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
  444. $(target).collapse(option)
  445. })
  446. })
  447. }(window.jQuery);/* ============================================================
  448. * bootstrap-dropdown.js v2.1.1
  449. * http://twitter.github.com/bootstrap/javascript.html#dropdowns
  450. * ============================================================
  451. * Copyright 2012 Twitter, Inc.
  452. *
  453. * Licensed under the Apache License, Version 2.0 (the "License");
  454. * you may not use this file except in compliance with the License.
  455. * You may obtain a copy of the License at
  456. *
  457. * http://www.apache.org/licenses/LICENSE-2.0
  458. *
  459. * Unless required by applicable law or agreed to in writing, software
  460. * distributed under the License is distributed on an "AS IS" BASIS,
  461. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  462. * See the License for the specific language governing permissions and
  463. * limitations under the License.
  464. * ============================================================ */
  465. !function ($) {
  466. "use strict"; // jshint ;_;
  467. /* DROPDOWN CLASS DEFINITION
  468. * ========================= */
  469. var toggle = '[data-toggle=dropdown]'
  470. , Dropdown = function (element) {
  471. var $el = $(element).on('click.dropdown.data-api', this.toggle)
  472. $('html').on('click.dropdown.data-api', function () {
  473. $el.parent().removeClass('open')
  474. })
  475. }
  476. Dropdown.prototype = {
  477. constructor: Dropdown
  478. , toggle: function (e) {
  479. var $this = $(this)
  480. , $parent
  481. , isActive
  482. if ($this.is('.disabled, :disabled')) return
  483. $parent = getParent($this)
  484. isActive = $parent.hasClass('open')
  485. clearMenus()
  486. if (!isActive) {
  487. $parent.toggleClass('open')
  488. $this.focus()
  489. }
  490. return false
  491. }
  492. , keydown: function (e) {
  493. var $this
  494. , $items
  495. , $active
  496. , $parent
  497. , isActive
  498. , index
  499. if (!/(38|40|27)/.test(e.keyCode)) return
  500. $this = $(this)
  501. e.preventDefault()
  502. e.stopPropagation()
  503. if ($this.is('.disabled, :disabled')) return
  504. $parent = getParent($this)
  505. isActive = $parent.hasClass('open')
  506. if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
  507. $items = $('[role=menu] li:not(.divider) a', $parent)
  508. if (!$items.length) return
  509. index = $items.index($items.filter(':focus'))
  510. if (e.keyCode == 38 && index > 0) index-- // up
  511. if (e.keyCode == 40 && index < $items.length - 1) index++ // down
  512. if (!~index) index = 0
  513. $items
  514. .eq(index)
  515. .focus()
  516. }
  517. }
  518. function clearMenus() {
  519. getParent($(toggle))
  520. .removeClass('open')
  521. }
  522. function getParent($this) {
  523. var selector = $this.attr('data-target')
  524. , $parent
  525. if (!selector) {
  526. selector = $this.attr('href')
  527. selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
  528. }
  529. $parent = $(selector)
  530. $parent.length || ($parent = $this.parent())
  531. return $parent
  532. }
  533. /* DROPDOWN PLUGIN DEFINITION
  534. * ========================== */
  535. $.fn.dropdown = function (option) {
  536. return this.each(function () {
  537. var $this = $(this)
  538. , data = $this.data('dropdown')
  539. if (!data) $this.data('dropdown', (data = new Dropdown(this)))
  540. if (typeof option == 'string') data[option].call($this)
  541. })
  542. }
  543. $.fn.dropdown.Constructor = Dropdown
  544. /* APPLY TO STANDARD DROPDOWN ELEMENTS
  545. * =================================== */
  546. $(function () {
  547. $('html')
  548. .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
  549. $('body')
  550. .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
  551. .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
  552. .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
  553. })
  554. }(window.jQuery);/* =========================================================
  555. * bootstrap-modal.js v2.1.1
  556. * http://twitter.github.com/bootstrap/javascript.html#modals
  557. * =========================================================
  558. * Copyright 2012 Twitter, Inc.
  559. *
  560. * Licensed under the Apache License, Version 2.0 (the "License");
  561. * you may not use this file except in compliance with the License.
  562. * You may obtain a copy of the License at
  563. *
  564. * http://www.apache.org/licenses/LICENSE-2.0
  565. *
  566. * Unless required by applicable law or agreed to in writing, software
  567. * distributed under the License is distributed on an "AS IS" BASIS,
  568. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  569. * See the License for the specific language governing permissions and
  570. * limitations under the License.
  571. * ========================================================= */
  572. !function ($) {
  573. "use strict"; // jshint ;_;
  574. /* MODAL CLASS DEFINITION
  575. * ====================== */
  576. var Modal = function (element, options) {
  577. this.options = options
  578. this.$element = $(element)
  579. .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
  580. this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
  581. }
  582. Modal.prototype = {
  583. constructor: Modal
  584. , toggle: function () {
  585. return this[!this.isShown ? 'show' : 'hide']()
  586. }
  587. , show: function () {
  588. var that = this
  589. , e = $.Event('show')
  590. this.$element.trigger(e)
  591. if (this.isShown || e.isDefaultPrevented()) return
  592. $('body').addClass('modal-open')
  593. this.isShown = true
  594. this.escape()
  595. this.backdrop(function () {
  596. var transition = $.support.transition && that.$element.hasClass('fade')
  597. if (!that.$element.parent().length) {
  598. that.$element.appendTo(document.body) //don't move modals dom position
  599. }
  600. that.$element
  601. .show()
  602. if (transition) {
  603. that.$element[0].offsetWidth // force reflow
  604. }
  605. that.$element
  606. .addClass('in')
  607. .attr('aria-hidden', false)
  608. .focus()
  609. that.enforceFocus()
  610. transition ?
  611. that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
  612. that.$element.trigger('shown')
  613. })
  614. }
  615. , hide: function (e) {
  616. e && e.preventDefault()
  617. var that = this
  618. e = $.Event('hide')
  619. this.$element.trigger(e)
  620. if (!this.isShown || e.isDefaultPrevented()) return
  621. this.isShown = false
  622. $('body').removeClass('modal-open')
  623. this.escape()
  624. $(document).off('focusin.modal')
  625. this.$element
  626. .removeClass('in')
  627. .attr('aria-hidden', true)
  628. $.support.transition && this.$element.hasClass('fade') ?
  629. this.hideWithTransition() :
  630. this.hideModal()
  631. }
  632. , enforceFocus: function () {
  633. var that = this
  634. $(document).on('focusin.modal', function (e) {
  635. if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
  636. that.$element.focus()
  637. }
  638. })
  639. }
  640. , escape: function () {
  641. var that = this
  642. if (this.isShown && this.options.keyboard) {
  643. this.$element.on('keyup.dismiss.modal', function ( e ) {
  644. e.which == 27 && that.hide()
  645. })
  646. } else if (!this.isShown) {
  647. this.$element.off('keyup.dismiss.modal')
  648. }
  649. }
  650. , hideWithTransition: function () {
  651. var that = this
  652. , timeout = setTimeout(function () {
  653. that.$element.off($.support.transition.end)
  654. that.hideModal()
  655. }, 500)
  656. this.$element.one($.support.transition.end, function () {
  657. clearTimeout(timeout)
  658. that.hideModal()
  659. })
  660. }
  661. , hideModal: function (that) {
  662. this.$element
  663. .hide()
  664. .trigger('hidden')
  665. this.backdrop()
  666. }
  667. , removeBackdrop: function () {
  668. this.$backdrop.remove()
  669. this.$backdrop = null
  670. }
  671. , backdrop: function (callback) {
  672. var that = this
  673. , animate = this.$element.hasClass('fade') ? 'fade' : ''
  674. if (this.isShown && this.options.backdrop) {
  675. var doAnimate = $.support.transition && animate
  676. this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
  677. .appendTo(document.body)
  678. if (this.options.backdrop != 'static') {
  679. this.$backdrop.click($.proxy(this.hide, this))
  680. }
  681. if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
  682. this.$backdrop.addClass('in')
  683. doAnimate ?
  684. this.$backdrop.one($.support.transition.end, callback) :
  685. callback()
  686. } else if (!this.isShown && this.$backdrop) {
  687. this.$backdrop.removeClass('in')
  688. $.support.transition && this.$element.hasClass('fade')?
  689. this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
  690. this.removeBackdrop()
  691. } else if (callback) {
  692. callback()
  693. }
  694. }
  695. }
  696. /* MODAL PLUGIN DEFINITION
  697. * ======================= */
  698. $.fn.modal = function (option) {
  699. return this.each(function () {
  700. var $this = $(this)
  701. , data = $this.data('modal')
  702. , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
  703. if (!data) $this.data('modal', (data = new Modal(this, options)))
  704. if (typeof option == 'string') data[option]()
  705. else if (options.show) data.show()
  706. })
  707. }
  708. $.fn.modal.defaults = {
  709. backdrop: true
  710. , keyboard: true
  711. , show: true
  712. }
  713. $.fn.modal.Constructor = Modal
  714. /* MODAL DATA-API
  715. * ============== */
  716. $(function () {
  717. $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
  718. var $this = $(this)
  719. , href = $this.attr('href')
  720. , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
  721. , option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
  722. e.preventDefault()
  723. $target
  724. .modal(option)
  725. .one('hide', function () {
  726. $this.focus()
  727. })
  728. })
  729. })
  730. }(window.jQuery);/* ===========================================================
  731. * bootstrap-tooltip.js v2.1.1
  732. * http://twitter.github.com/bootstrap/javascript.html#tooltips
  733. * Inspired by the original jQuery.tipsy by Jason Frame
  734. * ===========================================================
  735. * Copyright 2012 Twitter, Inc.
  736. *
  737. * Licensed under the Apache License, Version 2.0 (the "License");
  738. * you may not use this file except in compliance with the License.
  739. * You may obtain a copy of the License at
  740. *
  741. * http://www.apache.org/licenses/LICENSE-2.0
  742. *
  743. * Unless required by applicable law or agreed to in writing, software
  744. * distributed under the License is distributed on an "AS IS" BASIS,
  745. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  746. * See the License for the specific language governing permissions and
  747. * limitations under the License.
  748. * ========================================================== */
  749. !function ($) {
  750. "use strict"; // jshint ;_;
  751. /* TOOLTIP PUBLIC CLASS DEFINITION
  752. * =============================== */
  753. var Tooltip = function (element, options) {
  754. this.init('tooltip', element, options)
  755. }
  756. Tooltip.prototype = {
  757. constructor: Tooltip
  758. , init: function (type, element, options) {
  759. var eventIn
  760. , eventOut
  761. this.type = type
  762. this.$element = $(element)
  763. this.options = this.getOptions(options)
  764. this.enabled = true
  765. if (this.options.trigger == 'click') {
  766. this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
  767. } else if (this.options.trigger != 'manual') {
  768. eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
  769. eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
  770. this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
  771. this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
  772. }
  773. this.options.selector ?
  774. (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
  775. this.fixTitle()
  776. }
  777. , getOptions: function (options) {
  778. options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
  779. if (options.delay && typeof options.delay == 'number') {
  780. options.delay = {
  781. show: options.delay
  782. , hide: options.delay
  783. }
  784. }
  785. return options
  786. }
  787. , enter: function (e) {
  788. var self = $(e.currentTarget)[this.type](this._options).data(this.type)
  789. if (!self.options.delay || !self.options.delay.show) return self.show()
  790. clearTimeout(this.timeout)
  791. self.hoverState = 'in'
  792. this.timeout = setTimeout(function() {
  793. if (self.hoverState == 'in') self.show()
  794. }, self.options.delay.show)
  795. }
  796. , leave: function (e) {
  797. var self = $(e.currentTarget)[this.type](this._options).data(this.type)
  798. if (this.timeout) clearTimeout(this.timeout)
  799. if (!self.options.delay || !self.options.delay.hide) return self.hide()
  800. self.hoverState = 'out'
  801. this.timeout = setTimeout(function() {
  802. if (self.hoverState == 'out') self.hide()
  803. }, self.options.delay.hide)
  804. }
  805. , show: function () {
  806. var $tip
  807. , inside
  808. , pos
  809. , actualWidth
  810. , actualHeight
  811. , placement
  812. , tp
  813. if (this.hasContent() && this.enabled) {
  814. $tip = this.tip()
  815. this.setContent()
  816. if (this.options.animation) {
  817. $tip.addClass('fade')
  818. }
  819. placement = typeof this.options.placement == 'function' ?
  820. this.options.placement.call(this, $tip[0], this.$element[0]) :
  821. this.options.placement
  822. inside = /in/.test(placement)
  823. $tip
  824. .remove()
  825. .css({ top: 0, left: 0, display: 'block' })
  826. .appendTo(inside ? this.$element : document.body)
  827. pos = this.getPosition(inside)
  828. actualWidth = $tip[0].offsetWidth
  829. actualHeight = $tip[0].offsetHeight
  830. switch (inside ? placement.split(' ')[1] : placement) {
  831. case 'bottom':
  832. tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
  833. break
  834. case 'top':
  835. tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
  836. break
  837. case 'left':
  838. tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
  839. break
  840. case 'right':
  841. tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
  842. break
  843. }
  844. $tip
  845. .css(tp)
  846. .addClass(placement)
  847. .addClass('in')
  848. }
  849. }
  850. , setContent: function () {
  851. var $tip = this.tip()
  852. , title = this.getTitle()
  853. $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
  854. $tip.removeClass('fade in top bottom left right')
  855. }
  856. , hide: function () {
  857. var that = this
  858. , $tip = this.tip()
  859. $tip.removeClass('in')
  860. function removeWithAnimation() {
  861. var timeout = setTimeout(function () {
  862. $tip.off($.support.transition.end).remove()
  863. }, 500)
  864. $tip.one($.support.transition.end, function () {
  865. clearTimeout(timeout)
  866. $tip.remove()
  867. })
  868. }
  869. $.support.transition && this.$tip.hasClass('fade') ?
  870. removeWithAnimation() :
  871. $tip.remove()
  872. return this
  873. }
  874. , fixTitle: function () {
  875. var $e = this.$element
  876. if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
  877. $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
  878. }
  879. }
  880. , hasContent: function () {
  881. return this.getTitle()
  882. }
  883. , getPosition: function (inside) {
  884. return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
  885. width: this.$element[0].offsetWidth
  886. , height: this.$element[0].offsetHeight
  887. })
  888. }
  889. , getTitle: function () {
  890. var title
  891. , $e = this.$element
  892. , o = this.options
  893. title = $e.attr('data-original-title')
  894. || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
  895. return title
  896. }
  897. , tip: function () {
  898. return this.$tip = this.$tip || $(this.options.template)
  899. }
  900. , validate: function () {
  901. if (!this.$element[0].parentNode) {
  902. this.hide()
  903. this.$element = null
  904. this.options = null
  905. }
  906. }
  907. , enable: function () {
  908. this.enabled = true
  909. }
  910. , disable: function () {
  911. this.enabled = false
  912. }
  913. , toggleEnabled: function () {
  914. this.enabled = !this.enabled
  915. }
  916. , toggle: function () {
  917. this[this.tip().hasClass('in') ? 'hide' : 'show']()
  918. }
  919. , destroy: function () {
  920. this.hide().$element.off('.' + this.type).removeData(this.type)
  921. }
  922. }
  923. /* TOOLTIP PLUGIN DEFINITION
  924. * ========================= */
  925. $.fn.tooltip = function ( option ) {
  926. return this.each(function () {
  927. var $this = $(this)
  928. , data = $this.data('tooltip')
  929. , options = typeof option == 'object' && option
  930. if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
  931. if (typeof option == 'string') data[option]()
  932. })
  933. }
  934. $.fn.tooltip.Constructor = Tooltip
  935. $.fn.tooltip.defaults = {
  936. animation: true
  937. , placement: 'top'
  938. , selector: false
  939. , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
  940. , trigger: 'hover'
  941. , title: ''
  942. , delay: 0
  943. , html: true
  944. }
  945. }(window.jQuery);
  946. /* ===========================================================
  947. * bootstrap-popover.js v2.1.1
  948. * http://twitter.github.com/bootstrap/javascript.html#popovers
  949. * ===========================================================
  950. * Copyright 2012 Twitter, Inc.
  951. *
  952. * Licensed under the Apache License, Version 2.0 (the "License");
  953. * you may not use this file except in compliance with the License.
  954. * You may obtain a copy of the License at
  955. *
  956. * http://www.apache.org/licenses/LICENSE-2.0
  957. *
  958. * Unless required by applicable law or agreed to in writing, software
  959. * distributed under the License is distributed on an "AS IS" BASIS,
  960. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  961. * See the License for the specific language governing permissions and
  962. * limitations under the License.
  963. * =========================================================== */
  964. !function ($) {
  965. "use strict"; // jshint ;_;
  966. /* POPOVER PUBLIC CLASS DEFINITION
  967. * =============================== */
  968. var Popover = function (element, options) {
  969. this.init('popover', element, options)
  970. }
  971. /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
  972. ========================================== */
  973. Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
  974. constructor: Popover
  975. , setContent: function () {
  976. var $tip = this.tip()
  977. , title = this.getTitle()
  978. , content = this.getContent()
  979. $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
  980. $tip.find('.popover-content > *')[this.options.html ? 'html' : 'text'](content)
  981. $tip.removeClass('fade top bottom left right in')
  982. }
  983. , hasContent: function () {
  984. return this.getTitle() || this.getContent()
  985. }
  986. , getContent: function () {
  987. var content
  988. , $e = this.$element
  989. , o = this.options
  990. content = $e.attr('data-content')
  991. || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
  992. return content
  993. }
  994. , tip: function () {
  995. if (!this.$tip) {
  996. this.$tip = $(this.options.template)
  997. }
  998. return this.$tip
  999. }
  1000. , destroy: function () {
  1001. this.hide().$element.off('.' + this.type).removeData(this.type)
  1002. }
  1003. })
  1004. /* POPOVER PLUGIN DEFINITION
  1005. * ======================= */
  1006. $.fn.popover = function (option) {
  1007. return this.each(function () {
  1008. var $this = $(this)
  1009. , data = $this.data('popover')
  1010. , options = typeof option == 'object' && option
  1011. if (!data) $this.data('popover', (data = new Popover(this, options)))
  1012. if (typeof option == 'string') data[option]()
  1013. })
  1014. }
  1015. $.fn.popover.Constructor = Popover
  1016. $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
  1017. placement: 'right'
  1018. , trigger: 'click'
  1019. , content: ''
  1020. , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
  1021. })
  1022. }(window.jQuery);/* =============================================================
  1023. * bootstrap-scrollspy.js v2.1.1
  1024. * http://twitter.github.com/bootstrap/javascript.html#scrollspy
  1025. * =============================================================
  1026. * Copyright 2012 Twitter, Inc.
  1027. *
  1028. * Licensed under the Apache License, Version 2.0 (the "License");
  1029. * you may not use this file except in compliance with the License.
  1030. * You may obtain a copy of the License at
  1031. *
  1032. * http://www.apache.org/licenses/LICENSE-2.0
  1033. *
  1034. * Unless required by applicable law or agreed to in writing, software
  1035. * distributed under the License is distributed on an "AS IS" BASIS,
  1036. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1037. * See the License for the specific language governing permissions and
  1038. * limitations under the License.
  1039. * ============================================================== */
  1040. !function ($) {
  1041. "use strict"; // jshint ;_;
  1042. /* SCROLLSPY CLASS DEFINITION
  1043. * ========================== */
  1044. function ScrollSpy(element, options) {
  1045. var process = $.proxy(this.process, this)
  1046. , $element = $(element).is('body') ? $(window) : $(element)
  1047. , href
  1048. this.options = $.extend({}, $.fn.scrollspy.defaults, options)
  1049. this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
  1050. this.selector = (this.options.target
  1051. || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
  1052. || '') + ' .nav li > a'
  1053. this.$body = $('body')
  1054. this.refresh()
  1055. this.process()
  1056. }
  1057. ScrollSpy.prototype = {
  1058. constructor: ScrollSpy
  1059. , refresh: function () {
  1060. var self = this
  1061. , $targets
  1062. this.offsets = $([])
  1063. this.targets = $([])
  1064. $targets = this.$body
  1065. .find(this.selector)
  1066. .map(function () {
  1067. var $el = $(this)
  1068. , href = $el.data('target') || $el.attr('href')
  1069. , $href = /^#\w/.test(href) && $(href)
  1070. return ( $href
  1071. && $href.length
  1072. && [[ $href.position().top, href ]] ) || null
  1073. })
  1074. .sort(function (a, b) { return a[0] - b[0] })
  1075. .each(function () {
  1076. self.offsets.push(this[0])
  1077. self.targets.push(this[1])
  1078. })
  1079. }
  1080. , process: function () {
  1081. var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
  1082. , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
  1083. , maxScroll = scrollHeight - this.$scrollElement.height()
  1084. , offsets = this.offsets
  1085. , targets = this.targets
  1086. , activeTarget = this.activeTarget
  1087. , i
  1088. if (scrollTop >= maxScroll) {
  1089. return activeTarget != (i = targets.last()[0])
  1090. && this.activate ( i )
  1091. }
  1092. for (i = offsets.length; i--;) {
  1093. activeTarget != targets[i]
  1094. && scrollTop >= offsets[i]
  1095. && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
  1096. && this.activate( targets[i] )
  1097. }
  1098. }
  1099. , activate: function (target) {
  1100. var active
  1101. , selector
  1102. this.activeTarget = target
  1103. $(this.selector)
  1104. .parent('.active')
  1105. .removeClass('active')
  1106. selector = this.selector
  1107. + '[data-target="' + target + '"],'
  1108. + this.selector + '[href="' + target + '"]'
  1109. active = $(selector)
  1110. .parent('li')
  1111. .addClass('active')
  1112. if (active.parent('.dropdown-menu').length) {
  1113. active = active.closest('li.dropdown').addClass('active')
  1114. }
  1115. active.trigger('activate')
  1116. }
  1117. }
  1118. /* SCROLLSPY PLUGIN DEFINITION
  1119. * =========================== */
  1120. $.fn.scrollspy = function (option) {
  1121. return this.each(function () {
  1122. var $this = $(this)
  1123. , data = $this.data('scrollspy')
  1124. , options = typeof option == 'object' && option
  1125. if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
  1126. if (typeof option == 'string') data[option]()
  1127. })
  1128. }
  1129. $.fn.scrollspy.Constructor = ScrollSpy
  1130. $.fn.scrollspy.defaults = {
  1131. offset: 10
  1132. }
  1133. /* SCROLLSPY DATA-API
  1134. * ================== */
  1135. $(window).on('load', function () {
  1136. $('[data-spy="scroll"]').each(function () {
  1137. var $spy = $(this)
  1138. $spy.scrollspy($spy.data())
  1139. })
  1140. })
  1141. }(window.jQuery);/* ========================================================
  1142. * bootstrap-tab.js v2.1.1
  1143. * http://twitter.github.com/bootstrap/javascript.html#tabs
  1144. * ========================================================
  1145. * Copyright 2012 Twitter, Inc.
  1146. *
  1147. * Licensed under the Apache License, Version 2.0 (the "License");
  1148. * you may not use this file except in compliance with the License.
  1149. * You may obtain a copy of the License at
  1150. *
  1151. * http://www.apache.org/licenses/LICENSE-2.0
  1152. *
  1153. * Unless required by applicable law or agreed to in writing, software
  1154. * distributed under the License is distributed on an "AS IS" BASIS,
  1155. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1156. * See the License for the specific language governing permissions and
  1157. * limitations under the License.
  1158. * ======================================================== */
  1159. !function ($) {
  1160. "use strict"; // jshint ;_;
  1161. /* TAB CLASS DEFINITION
  1162. * ==================== */
  1163. var Tab = function (element) {
  1164. this.element = $(element)
  1165. }
  1166. Tab.prototype = {
  1167. constructor: Tab
  1168. , show: function () {
  1169. var $this = this.element
  1170. , $ul = $this.closest('ul:not(.dropdown-menu)')
  1171. , selector = $this.attr('data-target')
  1172. , previous
  1173. , $target
  1174. , e
  1175. if (!selector) {
  1176. selector = $this.attr('href')
  1177. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
  1178. }
  1179. if ( $this.parent('li').hasClass('active') ) return
  1180. previous = $ul.find('.active a').last()[0]
  1181. e = $.Event('show', {
  1182. relatedTarget: previous
  1183. })
  1184. $this.trigger(e)
  1185. if (e.isDefaultPrevented()) return
  1186. $target = $(selector)
  1187. this.activate($this.parent('li'), $ul)
  1188. this.activate($target, $target.parent(), function () {
  1189. $this.trigger({
  1190. type: 'shown'
  1191. , relatedTarget: previous
  1192. })
  1193. })
  1194. }
  1195. , activate: function ( element, container, callback) {
  1196. var $active = container.find('> .active')
  1197. , transition = callback
  1198. && $.support.transition
  1199. && $active.hasClass('fade')
  1200. function next() {
  1201. $active
  1202. .removeClass('active')
  1203. .find('> .dropdown-menu > .active')
  1204. .removeClass('active')
  1205. element.addClass('active')
  1206. if (transition) {
  1207. element[0].offsetWidth // reflow for transition
  1208. element.addClass('in')
  1209. } else {
  1210. element.removeClass('fade')
  1211. }
  1212. if ( element.parent('.dropdown-menu') ) {
  1213. element.closest('li.dropdown').addClass('active')
  1214. }
  1215. callback && callback()
  1216. }
  1217. transition ?
  1218. $active.one($.support.transition.end, next) :
  1219. next()
  1220. $active.removeClass('in')
  1221. }
  1222. }
  1223. /* TAB PLUGIN DEFINITION
  1224. * ===================== */
  1225. $.fn.tab = function ( option ) {
  1226. return this.each(function () {
  1227. var $this = $(this)
  1228. , data = $this.data('tab')
  1229. if (!data) $this.data('tab', (data = new Tab(this)))
  1230. if (typeof option == 'string') data[option]()
  1231. })
  1232. }
  1233. $.fn.tab.Constructor = Tab
  1234. /* TAB DATA-API
  1235. * ============ */
  1236. $(function () {
  1237. $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
  1238. e.preventDefault()
  1239. $(this).tab('show')
  1240. })
  1241. })
  1242. }(window.jQuery);/* =============================================================
  1243. * bootstrap-typeahead.js v2.1.1
  1244. * http://twitter.github.com/bootstrap/javascript.html#typeahead
  1245. * =============================================================
  1246. * Copyright 2012 Twitter, Inc.
  1247. *
  1248. * Licensed under the Apache License, Version 2.0 (the "License");
  1249. * you may not use this file except in compliance with the License.
  1250. * You may obtain a copy of the License at
  1251. *
  1252. * http://www.apache.org/licenses/LICENSE-2.0
  1253. *
  1254. * Unless required by applicable law or agreed to in writing, software
  1255. * distributed under the License is distributed on an "AS IS" BASIS,
  1256. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1257. * See the License for the specific language governing permissions and
  1258. * limitations under the License.
  1259. * ============================================================ */
  1260. !function($){
  1261. "use strict"; // jshint ;_;
  1262. /* TYPEAHEAD PUBLIC CLASS DEFINITION
  1263. * ================================= */
  1264. var Typeahead = function (element, options) {
  1265. this.$element = $(element)
  1266. this.options = $.extend({}, $.fn.typeahead.defaults, options)
  1267. this.matcher = this.options.matcher || this.matcher
  1268. this.sorter = this.options.sorter || this.sorter
  1269. this.highlighter = this.options.highlighter || this.highlighter
  1270. this.updater = this.options.updater || this.updater
  1271. this.$menu = $(this.options.menu).appendTo('body')
  1272. this.source = this.options.source
  1273. this.shown = false
  1274. this.listen()
  1275. }
  1276. Typeahead.prototype = {
  1277. constructor: Typeahead
  1278. , select: function () {
  1279. var val = this.$menu.find('.active').attr('data-value')
  1280. this.$element
  1281. .val(this.updater(val))
  1282. .change()
  1283. return this.hide()
  1284. }
  1285. , updater: function (item) {
  1286. return item
  1287. }
  1288. , show: function () {
  1289. var pos = $.extend({}, this.$element.offset(), {
  1290. height: this.$element[0].offsetHeight
  1291. })
  1292. this.$menu.css({
  1293. top: pos.top + pos.height
  1294. , left: pos.left
  1295. })
  1296. this.$menu.show()
  1297. this.shown = true
  1298. return this
  1299. }
  1300. , hide: function () {
  1301. this.$menu.hide()
  1302. this.shown = false
  1303. return this
  1304. }
  1305. , lookup: function (event) {
  1306. var items
  1307. this.query = this.$element.val()
  1308. if (!this.query || this.query.length < this.options.minLength) {
  1309. return this.shown ? this.hide() : this
  1310. }
  1311. items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
  1312. return items ? this.process(items) : this
  1313. }
  1314. , process: function (items) {
  1315. var that = this
  1316. items = $.grep(items, function (item) {
  1317. return that.matcher(item)
  1318. })
  1319. items = this.sorter(items)
  1320. if (!items.length) {
  1321. return this.shown ? this.hide() : this
  1322. }
  1323. return this.render(items.slice(0, this.options.items)).show()
  1324. }
  1325. , matcher: function (item) {
  1326. return ~item.toLowerCase().indexOf(this.query.toLowerCase())
  1327. }
  1328. , sorter: function (items) {
  1329. var beginswith = []
  1330. , caseSensitive = []
  1331. , caseInsensitive = []
  1332. , item
  1333. while (item = items.shift()) {
  1334. if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
  1335. else if (~item.indexOf(this.query)) caseSensitive.push(item)
  1336. else caseInsensitive.push(item)
  1337. }
  1338. return beginswith.concat(caseSensitive, caseInsensitive)
  1339. }
  1340. , highlighter: function (item) {
  1341. var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
  1342. return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
  1343. return '<strong>' + match + '</strong>'
  1344. })
  1345. }
  1346. , render: function (items) {
  1347. var that = this
  1348. items = $(items).map(function (i, item) {
  1349. i = $(that.options.item).attr('data-value', item)
  1350. i.find('a').html(that.highlighter(item))
  1351. return i[0]
  1352. })
  1353. items.first().addClass('active')
  1354. this.$menu.html(items)
  1355. return this
  1356. }
  1357. , next: function (event) {
  1358. var active = this.$menu.find('.active').removeClass('active')
  1359. , next = active.next()
  1360. if (!next.length) {
  1361. next = $(this.$menu.find('li')[0])
  1362. }
  1363. next.addClass('active')
  1364. }
  1365. , prev: function (event) {
  1366. var active = this.$menu.find('.active').removeClass('active')
  1367. , prev = active.prev()
  1368. if (!prev.length) {
  1369. prev = this.$menu.find('li').last()
  1370. }
  1371. prev.addClass('active')
  1372. }
  1373. , listen: function () {
  1374. this.$element
  1375. .on('blur', $.proxy(this.blur, this))
  1376. .on('keypress', $.proxy(this.keypress, this))
  1377. .on('keyup', $.proxy(this.keyup, this))
  1378. if ($.browser.chrome || $.browser.webkit || $.browser.msie) {
  1379. this.$element.on('keydown', $.proxy(this.keydown, this))
  1380. }
  1381. this.$menu
  1382. .on('click', $.proxy(this.click, this))
  1383. .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
  1384. }
  1385. , move: function (e) {
  1386. if (!this.shown) return
  1387. switch(e.keyCode) {
  1388. case 9: // tab
  1389. case 13: // enter
  1390. case 27: // escape
  1391. e.preventDefault()
  1392. break
  1393. case 38: // up arrow
  1394. e.preventDefault()
  1395. this.prev()
  1396. break
  1397. case 40: // down arrow
  1398. e.preventDefault()
  1399. this.next()
  1400. break
  1401. }
  1402. e.stopPropagation()
  1403. }
  1404. , keydown: function (e) {
  1405. this.suppressKeyPressRepeat = !~$.inArray(e.keyCode, [40,38,9,13,27])
  1406. this.move(e)
  1407. }
  1408. , keypress: function (e) {
  1409. if (this.suppressKeyPressRepeat) return
  1410. this.move(e)
  1411. }
  1412. , keyup: function (e) {
  1413. switch(e.keyCode) {
  1414. case 40: // down arrow
  1415. case 38: // up arrow
  1416. break
  1417. case 9: // tab
  1418. case 13: // enter
  1419. if (!this.shown) return
  1420. this.select()
  1421. break
  1422. case 27: // escape
  1423. if (!this.shown) return
  1424. this.hide()
  1425. break
  1426. default:
  1427. this.lookup()
  1428. }
  1429. e.stopPropagation()
  1430. e.preventDefault()
  1431. }
  1432. , blur: function (e) {
  1433. var that = this
  1434. setTimeout(function () { that.hide() }, 150)
  1435. }
  1436. , click: function (e) {
  1437. e.stopPropagation()
  1438. e.preventDefault()
  1439. this.select()
  1440. }
  1441. , mouseenter: function (e) {
  1442. this.$menu.find('.active').removeClass('active')
  1443. $(e.currentTarget).addClass('active')
  1444. }
  1445. }
  1446. /* TYPEAHEAD PLUGIN DEFINITION
  1447. * =========================== */
  1448. $.fn.typeahead = function (option) {
  1449. return this.each(function () {
  1450. var $this = $(this)
  1451. , data = $this.data('typeahead')
  1452. , options = typeof option == 'object' && option
  1453. if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
  1454. if (typeof option == 'string') data[option]()
  1455. })
  1456. }
  1457. $.fn.typeahead.defaults = {
  1458. source: []
  1459. , items: 8
  1460. , menu: '<ul class="typeahead dropdown-menu"></ul>'
  1461. , item: '<li><a href="#"></a></li>'
  1462. , minLength: 1
  1463. }
  1464. $.fn.typeahead.Constructor = Typeahead
  1465. /* TYPEAHEAD DATA-API
  1466. * ================== */
  1467. $(function () {
  1468. $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
  1469. var $this = $(this)
  1470. if ($this.data('typeahead')) return
  1471. e.preventDefault()
  1472. $this.typeahead($this.data())
  1473. })
  1474. })
  1475. }(window.jQuery);
  1476. /* ==========================================================
  1477. * bootstrap-affix.js v2.1.1
  1478. * http://twitter.github.com/bootstrap/javascript.html#affix
  1479. * ==========================================================
  1480. * Copyright 2012 Twitter, Inc.
  1481. *
  1482. * Licensed under the Apache License, Version 2.0 (the "License");
  1483. * you may not use this file except in compliance with the License.
  1484. * You may obtain a copy of the License at
  1485. *
  1486. * http://www.apache.org/licenses/LICENSE-2.0
  1487. *
  1488. * Unless required by applicable law or agreed to in writing, software
  1489. * distributed under the License is distributed on an "AS IS" BASIS,
  1490. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1491. * See the License for the specific language governing permissions and
  1492. * limitations under the License.
  1493. * ========================================================== */
  1494. !function ($) {
  1495. "use strict"; // jshint ;_;
  1496. /* AFFIX CLASS DEFINITION
  1497. * ====================== */
  1498. var Affix = function (element, options) {
  1499. this.options = $.extend({}, $.fn.affix.defaults, options)
  1500. this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
  1501. this.$element = $(element)
  1502. this.checkPosition()
  1503. }
  1504. Affix.prototype.checkPosition = function () {
  1505. if (!this.$element.is(':visible')) return
  1506. var scrollHeight = $(document).height()
  1507. , scrollTop = this.$window.scrollTop()
  1508. , position = this.$element.offset()
  1509. , offset = this.options.offset
  1510. , offsetBottom = offset.bottom
  1511. , offsetTop = offset.top
  1512. , reset = 'affix affix-top affix-bottom'
  1513. , affix
  1514. if (typeof offset != 'object') offsetBottom = offsetTop = offset
  1515. if (typeof offsetTop == 'function') offsetTop = offset.top()
  1516. if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
  1517. affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
  1518. false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
  1519. 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
  1520. 'top' : false
  1521. if (this.affixed === affix) return
  1522. this.affixed = affix
  1523. this.unpin = affix == 'bottom' ? position.top - scrollTop : null
  1524. this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
  1525. }
  1526. /* AFFIX PLUGIN DEFINITION
  1527. * ======================= */
  1528. $.fn.affix = function (option) {
  1529. return this.each(function () {
  1530. var $this = $(this)
  1531. , data = $this.data('affix')
  1532. , options = typeof option == 'object' && option
  1533. if (!data) $this.data('affix', (data = new Affix(this, options)))
  1534. if (typeof option == 'string') data[option]()
  1535. })
  1536. }
  1537. $.fn.affix.Constructor = Affix
  1538. $.fn.affix.defaults = {
  1539. offset: 0
  1540. }
  1541. /* AFFIX DATA-API
  1542. * ============== */
  1543. $(window).on('load', function () {
  1544. $('[data-spy="affix"]').each(function () {
  1545. var $spy = $(this)
  1546. , data = $spy.data()
  1547. data.offset = data.offset || {}
  1548. data.offsetBottom && (data.offset.bottom = data.offsetBottom)
  1549. data.offsetTop && (data.offset.top = data.offsetTop)
  1550. $spy.affix(data)
  1551. })
  1552. })
  1553. }(window.jQuery);
  1554. // Underscore.js 1.4.0
  1555. // http://underscorejs.org
  1556. // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
  1557. // Underscore may be freely distributed under the MIT license.
  1558. (function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=r.unshift,l=i.toString,c=i.hasOwnProperty,h=r.forEach,p=r.map,d=r.reduce,v=r.reduceRight,m=r.filter,g=r.every,y=r.some,b=r.indexOf,w=r.lastIndexOf,E=Array.isArray,S=Object.keys,x=s.bind,T=function(e){if(e instanceof T)return e;if(!(this instanceof T))return new T(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=T),exports._=T):e._=T,T.VERSION="1.4.0";var N=T.each=T.forEach=function(e,t,r){if(h&&e.forEach===h)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else for(var o in e)if(T.has(e,o)&&t.call(r,e[o],o,e)===n)return};T.map=T.collect=function(e,t,n){var r=[];return p&&e.map===p?e.map(t,n):(N(e,function(e,i,s){r[r.length]=t.call(n,e,i,s)}),r)},T.reduce=T.foldl=T.inject=function(e,t,n,r){var i=arguments.length>2;if(d&&e.reduce===d)return r&&(t=T.bind(t,r)),i?e.reduce(t,n):e.reduce(t);N(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},T.reduceRight=T.foldr=function(e,t,n,r){var i=arguments.length>2;if(v&&e.reduceRight===v)return r&&(t=T.bind(t,r)),arguments.length>2?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=T.keys(e);s=o.length}N(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},T.find=T.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},T.filter=T.select=function(e,t,n){var r=[];return m&&e.filter===m?e.filter(t,n):(N(e,function(e,i,s){t.call(n,e,i,s)&&(r[r.length]=e)}),r)},T.reject=function(e,t,n){var r=[];return N(e,function(e,i,s){t.call(n,e,i,s)||(r[r.length]=e)}),r},T.every=T.all=function(e,t,r){t||(t=T.identity);var i=!0;return g&&e.every===g?e.every(t,r):(N(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=T.some=T.any=function(e,t,r){t||(t=T.identity);var i=!1;return y&&e.some===y?e.some(t,r):(N(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};T.contains=T.include=function(e,t){var n=!1;return b&&e.indexOf===b?e.indexOf(t)!=-1:(n=C(e,function(e){return e===t}),n)},T.invoke=function(e,t){var n=u.call(arguments,2);return T.map(e,function(e){return(T.isFunction(t)?t:e[t]).apply(e,n)})},T.pluck=function(e,t){return T.map(e,function(e){return e[t]})},T.where=function(e,t){return T.isEmpty(t)?[]:T.filter(e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},T.max=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&T.isEmpty(e))return-Infinity;var r={computed:-Infinity};return N(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},T.min=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&T.isEmpty(e))return Infinity;var r={computed:Infinity};return N(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})}),r.value},T.shuffle=function(e){var t,n=0,r=[];return N(e,function(e){t=T.random(n++),r[n-1]=r[t],r[t]=e}),r};var k=function(e){return T.isFunction(e)?e:function(t){return t[e]}};T.sortBy=function(e,t,n){var r=k(t);return T.pluck(T.map(e,function(e,t,i){return{value:e,index:t,criteria:r.call(n,e,t,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index<t.index?-1:1}),"value")};var L=function(e,t,n,r){var i={},s=k(t);return N(e,function(t,o){var u=s.call(n,t,o,e);r(i,u,t)}),i};T.groupBy=function(e,t,n){return L(e,t,n,function(e,t,n){(T.has(e,t)?e[t]:e[t]=[]).push(n)})},T.countBy=function(e,t,n){return L(e,t,n,function(e,t,n){T.has(e,t)||(e[t]=0),e[t]++})},T.sortedIndex=function(e,t,n,r){n=n==null?T.identity:k(n);var i=n.call(r,t),s=0,o=e.length;while(s<o){var u=s+o>>>1;n.call(r,e[u])<i?s=u+1:o=u}return s},T.toArray=function(e){return e?e.length===+e.length?u.call(e):T.values(e):[]},T.size=function(e){return e.length===+e.length?e.length:T.keys(e).length},T.first=T.head=T.take=function(e,t,n){return t!=null&&!n?u.call(e,0,t):e[0]},T.initial=function(e,t,n){return u.call(e,0,e.length-(t==null||n?1:t))},T.last=function(e,t,n){return t!=null&&!n?u.call(e,Math.max(e.length-t,0)):e[e.length-1]},T.rest=T.tail=T.drop=function(e,t,n){return u.call(e,t==null||n?1:t)},T.compact=function(e){return T.filter(e,function(e){return!!e})};var A=function(e,t,n){return N(e,function(e){T.isArray(e)?t?o.apply(n,e):A(e,t,n):n.push(e)}),n};T.flatten=function(e,t){return A(e,t,[])},T.without=function(e){return T.difference(e,u.call(arguments,1))},T.uniq=T.unique=function(e,t,n,r){var i=n?T.map(e,n,r):e,s=[],o=[];return N(i,function(n,r){if(t?!r||o[o.length-1]!==n:!T.contains(o,n))o.push(n),s.push(e[r])}),s},T.union=function(){return T.uniq(a.apply(r,arguments))},T.intersection=function(e){var t=u.call(arguments,1);return T.filter(T.uniq(e),function(e){return T.every(t,function(t){return T.indexOf(t,e)>=0})})},T.difference=function(e){var t=a.apply(r,u.call(arguments,1));return T.filter(e,function(e){return!T.contains(t,e)})},T.zip=function(){var e=u.call(arguments),t=T.max(T.pluck(e,"length")),n=new Array(t);for(var r=0;r<t;r++)n[r]=T.pluck(e,""+r);return n},T.object=function(e,t){var n={};for(var r=0,i=e.length;r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},T.indexOf=function(e,t,n){var r=0,i=e.length;if(n){if(typeof n!="number")return r=T.sortedIndex(e,t),e[r]===t?r:-1;r=n<0?Math.max(0,i+n):n}if(b&&e.indexOf===b)return e.indexOf(t,n);for(;r<i;r++)if(e[r]===t)return r;return-1},T.lastIndexOf=function(e,t,n){if(w&&e.lastIndexOf===w)return e.lastIndexOf(t,n);var r=n!=null?n:e.length;while(r--)if(e[r]===t)return r;return-1},T.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s};var O=function(){};T.bind=function(t,n){var r,i;if(t.bind===x&&x)return x.apply(t,u.call(arguments,1));if(!T.isFunction(t))throw new TypeError;return i=u.call(arguments,2),r=function(){if(this instanceof r){O.prototype=t.prototype;var e=new O,s=t.apply(e,i.concat(u.call(arguments)));return Object(s)===s?s:e}return t.apply(n,i.concat(u.call(arguments)))}},T.bindAll=function(e){var t=u.call(arguments,1);return t.length==0&&(t=T.functions(e)),N(t,function(t){e[t]=T.bind(e[t],e)}),e},T.memoize=function(e,t){var n={};return t||(t=T.identity),function(){var r=t.apply(this,arguments);return T.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},T.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},T.defer=function(e){return T.delay.apply(T,[e,1].concat(u.call(arguments,1)))},T.throttle=function(e,t){var n,r,i,s,o,u,a=T.debounce(function(){o=s=!1},t);return function(){n=this,r=arguments;var f=function(){i=null,o&&(u=e.apply(n,r)),a()};return i||(i=setTimeout(f,t)),s?o=!0:(s=!0,u=e.apply(n,r)),a(),u}},T.debounce=function(e,t,n){var r,i;return function(){var s=this,o=arguments,u=function(){r=null,n||(i=e.apply(s,o))},a=n&&!r;return clearTimeout(r),r=setTimeout(u,t),a&&(i=e.apply(s,o)),i}},T.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments),e=null,n)}},T.wrap=function(e,t){return function(){var n=[e];return o.apply(n,arguments),t.apply(this,n)}},T.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},T.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},T.keys=S||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)T.has(e,n)&&(t[t.length]=n);return t},T.values=function(e){var t=[];for(var n in e)T.has(e,n)&&t.push(e[n]);return t},T.pairs=function(e){var t=[];for(var n in e)T.has(e,n)&&t.push([n,e[n]]);return t},T.invert=function(e){var t={};for(var n in e)T.has(e,n)&&(t[e[n]]=n);return t},T.functions=T.methods=function(e){var t=[];for(var n in e)T.isFunction(e[n])&&t.push(n);return t.sort()},T.extend=function(e){return N(u.call(arguments,1),function(t){for(var n in t)e[n]=t[n]}),e},T.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return N(n,function(n){n in e&&(t[n]=e[n])}),t},T.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)T.contains(n,i)||(t[i]=e[i]);return t},T.defaults=function(e){return N(u.call(arguments,1),function(t){for(var n in t)e[n]==null&&(e[n]=t[n])}),e},T.clone=function(e){return T.isObject(e)?T.isArray(e)?e.slice():T.extend({},e):e},T.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof T&&(e=e._wrapped),t instanceof T&&(t=t._wrapped);var i=l.call(e);if(i!=l.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var o=0,u=!0;if(i=="[object Array]"){o=e.length,u=o==t.length;if(u)while(o--)if(!(u=M(e[o],t[o],n,r)))break}else{var a=e.constructor,f=t.constructor;if(a!==f&&!(T.isFunction(a)&&a instanceof a&&T.isFunction(f)&&f instanceof f))return!1;for(var c in e)if(T.has(e,c)){o++;if(!(u=T.has(t,c)&&M(e[c],t[c],n,r)))break}if(u){for(c in t)if(T.has(t,c)&&!(o--))break;u=!o}}return n.pop(),r.pop(),u};T.isEqual=function(e,t){return M(e,t,[],[])},T.isEmpty=function(e){if(e==null)return!0;if(T.isArray(e)||T.isString(e))return e.length===0;for(var t in e)if(T.has(e,t))return!1;return!0},T.isElement=function(e){return!!e&&e.nodeType===1},T.isArray=E||function(e){return l.call(e)=="[object Array]"},T.isObject=function(e){return e===Object(e)},N(["Arguments","Function","String","Number","Date","RegExp"],function(e){T["is"+e]=function(t){return l.call(t)=="[object "+e+"]"}}),T.isArguments(arguments)||(T.isArguments=function(e){return!!e&&!!T.has(e,"callee")}),typeof /./!="function"&&(T.isFunction=function(e){return typeof e=="function"}),T.isFinite=function(e){return T.isNumber(e)&&isFinite(e)},T.isNaN=function(e){return T.isNumber(e)&&e!=+e},T.isBoolean=function(e){return e===!0||e===!1||l.call(e)=="[object Boolean]"},T.isNull=function(e){return e===null},T.isUndefined=function(e){return e===void 0},T.has=function(e,t){return c.call(e,t)},T.noConflict=function(){return e._=t,this},T.identity=function(e){return e},T.times=function(e,t,n){for(var r=0;r<e;r++)t.call(n,r)},T.random=function(e,t){return t==null&&(t=e,e=0),e+(0|Math.random()*(t-e+1))};var _={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};_.unescape=T.invert(_.escape);var D={escape:new RegExp("["+T.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+T.keys(_.unescape).join("|")+")","g")};T.each(["escape","unescape"],function(e){T[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),T.result=function(e,t){if(e==null)return null;var n=e[t];return T.isFunction(n)?n.call(e):n},T.mixin=function(e){N(T.functions(e),function(t){var n=T[t]=e[t];T.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(T,e))}})};var P=0;T.uniqueId=function(e){var t=P++;return e?e+t:t},T.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;T.template=function(e,t,n){n=T.defaults({},n,T.templateSettings);var r=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),i=0,s="__p+='";e.replace(r,function(t,n,r,o,u){s+=e.slice(i,u).replace(j,function(e){return"\\"+B[e]}),s+=n?"'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?"'+\n((__t=("+r+"))==null?'':__t)+\n'":o?"';\n"+o+"\n__p+='":"",i=u+t.length}),s+="';\n",n.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{var o=new Function(n.variable||"obj","_",s)}catch(u){throw u.source=s,u}if(t)return o(t,T);var a=function(e){return o.call(this,e,T)};return a.source="function("+(n.variable||"obj")+"){\n"+s+"}",a},T.chain=function(e){return T(e).chain()};var F=function(e){return this._chain?T(e).chain():e};T.mixin(T),N(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];T.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),N(["concat","join","slice"],function(e){var t=r[e];T.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),T.extend(T.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);
  1559. // lib/handlebars/base.js
  1560. /*jshint eqnull:true*/
  1561. this.Handlebars = {};
  1562. (function(Handlebars) {
  1563. Handlebars.VERSION = "1.0.rc.1";
  1564. Handlebars.helpers = {};
  1565. Handlebars.partials = {};
  1566. Handlebars.registerHelper = function(name, fn, inverse) {
  1567. if(inverse) { fn.not = inverse; }
  1568. this.helpers[name] = fn;
  1569. };
  1570. Handlebars.registerPartial = function(name, str) {
  1571. this.partials[name] = str;
  1572. };
  1573. Handlebars.registerHelper('helperMissing', function(arg) {
  1574. if(arguments.length === 2) {
  1575. return undefined;
  1576. } else {
  1577. throw new Error("Could not find property '" + arg + "'");
  1578. }
  1579. });
  1580. var toString = Object.prototype.toString, functionType = "[object Function]";
  1581. Handlebars.registerHelper('blockHelperMissing', function(context, options) {
  1582. var inverse = options.inverse || function() {}, fn = options.fn;
  1583. var ret = "";
  1584. var type = toString.call(context);
  1585. if(type === functionType) { context = context.call(this); }
  1586. if(context === true) {
  1587. return fn(this);
  1588. } else if(context === false || context == null) {
  1589. return inverse(this);
  1590. } else if(type === "[object Array]") {
  1591. if(context.length > 0) {
  1592. return Handlebars.helpers.each(context, options);
  1593. } else {
  1594. return inverse(this);
  1595. }
  1596. } else {
  1597. return fn(context);
  1598. }
  1599. });
  1600. Handlebars.K = function() {};
  1601. Handlebars.createFrame = Object.create || function(object) {
  1602. Handlebars.K.prototype = object;
  1603. var obj = new Handlebars.K();
  1604. Handlebars.K.prototype = null;
  1605. return obj;
  1606. };
  1607. Handlebars.registerHelper('each', function(context, options) {
  1608. var fn = options.fn, inverse = options.inverse;
  1609. var ret = "", data;
  1610. if (options.data) {
  1611. data = Handlebars.createFrame(options.data);
  1612. }
  1613. if(context && context.length > 0) {
  1614. for(var i=0, j=context.length; i<j; i++) {
  1615. if (data) { data.index = i; }
  1616. ret = ret + fn(context[i], { data: data });
  1617. }
  1618. } else {
  1619. ret = inverse(this);
  1620. }
  1621. return ret;
  1622. });
  1623. Handlebars.registerHelper('if', function(context, options) {
  1624. var type = toString.call(context);
  1625. if(type === functionType) { context = context.call(this); }
  1626. if(!context || Handlebars.Utils.isEmpty(context)) {
  1627. return options.inverse(this);
  1628. } else {
  1629. return options.fn(this);
  1630. }
  1631. });
  1632. Handlebars.registerHelper('unless', function(context, options) {
  1633. var fn = options.fn, inverse = options.inverse;
  1634. options.fn = inverse;
  1635. options.inverse = fn;
  1636. return Handlebars.helpers['if'].call(this, context, options);
  1637. });
  1638. Handlebars.registerHelper('with', function(context, options) {
  1639. return options.fn(context);
  1640. });
  1641. Handlebars.registerHelper('log', function(context) {
  1642. Handlebars.log(context);
  1643. });
  1644. }(this.Handlebars));
  1645. ;
  1646. // lib/handlebars/compiler/parser.js
  1647. /* Jison generated parser */
  1648. var handlebars = (function(){
  1649. var parser = {trace: function trace() { },
  1650. yy: {},
  1651. symbols_: {"error":2,"root":3,"program":4,"EOF":5,"statements":6,"simpleInverse":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"OPEN_PARTIAL":24,"params":25,"hash":26,"DATA":27,"param":28,"STRING":29,"INTEGER":30,"BOOLEAN":31,"hashSegments":32,"hashSegment":33,"ID":34,"EQUALS":35,"pathSegments":36,"SEP":37,"$accept":0,"$end":1},
  1652. terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",27:"DATA",29:"STRING",30:"INTEGER",31:"BOOLEAN",34:"ID",35:"EQUALS",37:"SEP"},
  1653. productions_: [0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[17,1],[25,2],[25,1],[28,1],[28,1],[28,1],[28,1],[28,1],[26,1],[32,2],[32,1],[33,3],[33,3],[33,3],[33,3],[33,3],[21,1],[36,3],[36,1]],
  1654. performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
  1655. var $0 = $$.length - 1;
  1656. switch (yystate) {
  1657. case 1: return $$[$0-1];
  1658. break;
  1659. case 2: this.$ = new yy.ProgramNode($$[$0-2], $$[$0]);
  1660. break;
  1661. case 3: this.$ = new yy.ProgramNode($$[$0]);
  1662. break;
  1663. case 4: this.$ = new yy.ProgramNode([]);
  1664. break;
  1665. case 5: this.$ = [$$[$0]];
  1666. break;
  1667. case 6: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
  1668. break;
  1669. case 7: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1].inverse, $$[$0-1], $$[$0]);
  1670. break;
  1671. case 8: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0-1].inverse, $$[$0]);
  1672. break;
  1673. case 9: this.$ = $$[$0];
  1674. break;
  1675. case 10: this.$ = $$[$0];
  1676. break;
  1677. case 11: this.$ = new yy.ContentNode($$[$0]);
  1678. break;
  1679. case 12: this.$ = new yy.CommentNode($$[$0]);
  1680. break;
  1681. case 13: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
  1682. break;
  1683. case 14: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
  1684. break;
  1685. case 15: this.$ = $$[$0-1];
  1686. break;
  1687. case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
  1688. break;
  1689. case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true);
  1690. break;
  1691. case 18: this.$ = new yy.PartialNode($$[$0-1]);
  1692. break;
  1693. case 19: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1]);
  1694. break;
  1695. case 20:
  1696. break;
  1697. case 21: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]];
  1698. break;
  1699. case 22: this.$ = [[$$[$0-1]].concat($$[$0]), null];
  1700. break;
  1701. case 23: this.$ = [[$$[$0-1]], $$[$0]];
  1702. break;
  1703. case 24: this.$ = [[$$[$0]], null];
  1704. break;
  1705. case 25: this.$ = [[new yy.DataNode($$[$0])], null];
  1706. break;
  1707. case 26: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
  1708. break;
  1709. case 27: this.$ = [$$[$0]];
  1710. break;
  1711. case 28: this.$ = $$[$0];
  1712. break;
  1713. case 29: this.$ = new yy.StringNode($$[$0]);
  1714. break;
  1715. case 30: this.$ = new yy.IntegerNode($$[$0]);
  1716. break;
  1717. case 31: this.$ = new yy.BooleanNode($$[$0]);
  1718. break;
  1719. case 32: this.$ = new yy.DataNode($$[$0]);
  1720. break;
  1721. case 33: this.$ = new yy.HashNode($$[$0]);
  1722. break;
  1723. case 34: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
  1724. break;
  1725. case 35: this.$ = [$$[$0]];
  1726. break;
  1727. case 36: this.$ = [$$[$0-2], $$[$0]];
  1728. break;
  1729. case 37: this.$ = [$$[$0-2], new yy.StringNode($$[$0])];
  1730. break;
  1731. case 38: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])];
  1732. break;
  1733. case 39: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])];
  1734. break;
  1735. case 40: this.$ = [$$[$0-2], new yy.DataNode($$[$0])];
  1736. break;
  1737. case 41: this.$ = new yy.IdNode($$[$0]);
  1738. break;
  1739. case 42: $$[$0-2].push($$[$0]); this.$ = $$[$0-2];
  1740. break;
  1741. case 43: this.$ = [$$[$0]];
  1742. break;
  1743. }
  1744. },
  1745. table: [{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,27:[1,24],34:[1,26],36:25},{17:27,21:23,27:[1,24],34:[1,26],36:25},{17:28,21:23,27:[1,24],34:[1,26],36:25},{17:29,21:23,27:[1,24],34:[1,26],36:25},{21:30,34:[1,26],36:25},{1:[2,1]},{6:31,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,32],21:23,27:[1,24],34:[1,26],36:25},{10:33,20:[1,34]},{10:35,20:[1,34]},{18:[1,36]},{18:[2,24],21:41,25:37,26:38,27:[1,45],28:39,29:[1,42],30:[1,43],31:[1,44],32:40,33:46,34:[1,47],36:25},{18:[2,25]},{18:[2,41],27:[2,41],29:[2,41],30:[2,41],31:[2,41],34:[2,41],37:[1,48]},{18:[2,43],27:[2,43],29:[2,43],30:[2,43],31:[2,43],34:[2,43],37:[2,43]},{18:[1,49]},{18:[1,50]},{18:[1,51]},{18:[1,52],21:53,34:[1,26],36:25},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:54,34:[1,26],36:25},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:41,26:55,27:[1,45],28:56,29:[1,42],30:[1,43],31:[1,44],32:40,33:46,34:[1,47],36:25},{18:[2,23]},{18:[2,27],27:[2,27],29:[2,27],30:[2,27],31:[2,27],34:[2,27]},{18:[2,33],33:57,34:[1,58]},{18:[2,28],27:[2,28],29:[2,28],30:[2,28],31:[2,28],34:[2,28]},{18:[2,29],27:[2,29],29:[2,29],30:[2,29],31:[2,29],34:[2,29]},{18:[2,30],27:[2,30],29:[2,30],30:[2,30],31:[2,30],34:[2,30]},{18:[2,31],27:[2,31],29:[2,31],30:[2,31],31:[2,31],34:[2,31]},{18:[2,32],27:[2,32],29:[2,32],30:[2,32],31:[2,32],34:[2,32]},{18:[2,35],34:[2,35]},{18:[2,43],27:[2,43],29:[2,43],30:[2,43],31:[2,43],34:[2,43],35:[1,59],37:[2,43]},{34:[1,60]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,61]},{18:[1,62]},{18:[2,21]},{18:[2,26],27:[2,26],29:[2,26],30:[2,26],31:[2,26],34:[2,26]},{18:[2,34],34:[2,34]},{35:[1,59]},{21:63,27:[1,67],29:[1,64],30:[1,65],31:[1,66],34:[1,26],36:25},{18:[2,42],27:[2,42],29:[2,42],30:[2,42],31:[2,42],34:[2,42],37:[2,42]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,36],34:[2,36]},{18:[2,37],34:[2,37]},{18:[2,38],34:[2,38]},{18:[2,39],34:[2,39]},{18:[2,40],34:[2,40]}],
  1746. defaultActions: {16:[2,1],24:[2,25],38:[2,23],55:[2,21]},
  1747. parseError: function parseError(str, hash) {
  1748. throw new Error(str);
  1749. },
  1750. parse: function parse(input) {
  1751. var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
  1752. this.lexer.setInput(input);
  1753. this.lexer.yy = this.yy;
  1754. this.yy.lexer = this.lexer;
  1755. this.yy.parser = this;
  1756. if (typeof this.lexer.yylloc == "undefined")
  1757. this.lexer.yylloc = {};
  1758. var yyloc = this.lexer.yylloc;
  1759. lstack.push(yyloc);
  1760. var ranges = this.lexer.options && this.lexer.options.ranges;
  1761. if (typeof this.yy.parseError === "function")
  1762. this.parseError = this.yy.parseError;
  1763. function popStack(n) {
  1764. stack.length = stack.length - 2 * n;
  1765. vstack.length = vstack.length - n;
  1766. lstack.length = lstack.length - n;
  1767. }
  1768. function lex() {
  1769. var token;
  1770. token = self.lexer.lex() || 1;
  1771. if (typeof token !== "number") {
  1772. token = self.symbols_[token] || token;
  1773. }
  1774. return token;
  1775. }
  1776. var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
  1777. while (true) {
  1778. state = stack[stack.length - 1];
  1779. if (this.defaultActions[state]) {
  1780. action = this.defaultActions[state];
  1781. } else {
  1782. if (symbol === null || typeof symbol == "undefined") {
  1783. symbol = lex();
  1784. }
  1785. action = table[state] && table[state][symbol];
  1786. }
  1787. if (typeof action === "undefined" || !action.length || !action[0]) {
  1788. var errStr = "";
  1789. if (!recovering) {
  1790. expected = [];
  1791. for (p in table[state])
  1792. if (this.terminals_[p] && p > 2) {
  1793. expected.push("'" + this.terminals_[p] + "'");
  1794. }
  1795. if (this.lexer.showPosition) {
  1796. errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
  1797. } else {
  1798. errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
  1799. }
  1800. this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
  1801. }
  1802. }
  1803. if (action[0] instanceof Array && action.length > 1) {
  1804. throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
  1805. }
  1806. switch (action[0]) {
  1807. case 1:
  1808. stack.push(symbol);
  1809. vstack.push(this.lexer.yytext);
  1810. lstack.push(this.lexer.yylloc);
  1811. stack.push(action[1]);
  1812. symbol = null;
  1813. if (!preErrorSymbol) {
  1814. yyleng = this.lexer.yyleng;
  1815. yytext = this.lexer.yytext;
  1816. yylineno = this.lexer.yylineno;
  1817. yyloc = this.lexer.yylloc;
  1818. if (recovering > 0)
  1819. recovering--;
  1820. } else {
  1821. symbol = preErrorSymbol;
  1822. preErrorSymbol = null;
  1823. }
  1824. break;
  1825. case 2:
  1826. len = this.productions_[action[1]][1];
  1827. yyval.$ = vstack[vstack.length - len];
  1828. yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
  1829. if (ranges) {
  1830. yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
  1831. }
  1832. r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
  1833. if (typeof r !== "undefined") {
  1834. return r;
  1835. }
  1836. if (len) {
  1837. stack = stack.slice(0, -1 * len * 2);
  1838. vstack = vstack.slice(0, -1 * len);
  1839. lstack = lstack.slice(0, -1 * len);
  1840. }
  1841. stack.push(this.productions_[action[1]][0]);
  1842. vstack.push(yyval.$);
  1843. lstack.push(yyval._$);
  1844. newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
  1845. stack.push(newState);
  1846. break;
  1847. case 3:
  1848. return true;
  1849. }
  1850. }
  1851. return true;
  1852. }
  1853. };
  1854. /* Jison generated lexer */
  1855. var lexer = (function(){
  1856. var lexer = ({EOF:1,
  1857. parseError:function parseError(str, hash) {
  1858. if (this.yy.parser) {
  1859. this.yy.parser.parseError(str, hash);
  1860. } else {
  1861. throw new Error(str);
  1862. }
  1863. },
  1864. setInput:function (input) {
  1865. this._input = input;
  1866. this._more = this._less = this.done = false;
  1867. this.yylineno = this.yyleng = 0;
  1868. this.yytext = this.matched = this.match = '';
  1869. this.conditionStack = ['INITIAL'];
  1870. this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
  1871. if (this.options.ranges) this.yylloc.range = [0,0];
  1872. this.offset = 0;
  1873. return this;
  1874. },
  1875. input:function () {
  1876. var ch = this._input[0];
  1877. this.yytext += ch;
  1878. this.yyleng++;
  1879. this.offset++;
  1880. this.match += ch;
  1881. this.matched += ch;
  1882. var lines = ch.match(/(?:\r\n?|\n).*/g);
  1883. if (lines) {
  1884. this.yylineno++;
  1885. this.yylloc.last_line++;
  1886. } else {
  1887. this.yylloc.last_column++;
  1888. }
  1889. if (this.options.ranges) this.yylloc.range[1]++;
  1890. this._input = this._input.slice(1);
  1891. return ch;
  1892. },
  1893. unput:function (ch) {
  1894. var len = ch.length;
  1895. var lines = ch.split(/(?:\r\n?|\n)/g);
  1896. this._input = ch + this._input;
  1897. this.yytext = this.yytext.substr(0, this.yytext.length-len-1);
  1898. //this.yyleng -= len;
  1899. this.offset -= len;
  1900. var oldLines = this.match.split(/(?:\r\n?|\n)/g);
  1901. this.match = this.match.substr(0, this.match.length-1);
  1902. this.matched = this.matched.substr(0, this.matched.length-1);
  1903. if (lines.length-1) this.yylineno -= lines.length-1;
  1904. var r = this.yylloc.range;
  1905. this.yylloc = {first_line: this.yylloc.first_line,
  1906. last_line: this.yylineno+1,
  1907. first_column: this.yylloc.first_column,
  1908. last_column: lines ?
  1909. (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length:
  1910. this.yylloc.first_column - len
  1911. };
  1912. if (this.options.ranges) {
  1913. this.yylloc.range = [r[0], r[0] + this.yyleng - len];
  1914. }
  1915. return this;
  1916. },
  1917. more:function () {
  1918. this._more = true;
  1919. return this;
  1920. },
  1921. less:function (n) {
  1922. this.unput(this.match.slice(n));
  1923. },
  1924. pastInput:function () {
  1925. var past = this.matched.substr(0, this.matched.length - this.match.length);
  1926. return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
  1927. },
  1928. upcomingInput:function () {
  1929. var next = this.match;
  1930. if (next.length < 20) {
  1931. next += this._input.substr(0, 20-next.length);
  1932. }
  1933. return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
  1934. },
  1935. showPosition:function () {
  1936. var pre = this.pastInput();
  1937. var c = new Array(pre.length + 1).join("-");
  1938. return pre + this.upcomingInput() + "\n" + c+"^";
  1939. },
  1940. next:function () {
  1941. if (this.done) {
  1942. return this.EOF;
  1943. }
  1944. if (!this._input) this.done = true;
  1945. var token,
  1946. match,
  1947. tempMatch,
  1948. index,
  1949. col,
  1950. lines;
  1951. if (!this._more) {
  1952. this.yytext = '';
  1953. this.match = '';
  1954. }
  1955. var rules = this._currentRules();
  1956. for (var i=0;i < rules.length; i++) {
  1957. tempMatch = this._input.match(this.rules[rules[i]]);
  1958. if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
  1959. match = tempMatch;
  1960. index = i;
  1961. if (!this.options.flex) break;
  1962. }
  1963. }
  1964. if (match) {
  1965. lines = match[0].match(/(?:\r\n?|\n).*/g);
  1966. if (lines) this.yylineno += lines.length;
  1967. this.yylloc = {first_line: this.yylloc.last_line,
  1968. last_line: this.yylineno+1,
  1969. first_column: this.yylloc.last_column,
  1970. last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length};
  1971. this.yytext += match[0];
  1972. this.match += match[0];
  1973. this.matches = match;
  1974. this.yyleng = this.yytext.length;
  1975. if (this.options.ranges) {
  1976. this.yylloc.range = [this.offset, this.offset += this.yyleng];
  1977. }
  1978. this._more = false;
  1979. this._input = this._input.slice(match[0].length);
  1980. this.matched += match[0];
  1981. token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);
  1982. if (this.done && this._input) this.done = false;
  1983. if (token) return token;
  1984. else return;
  1985. }
  1986. if (this._input === "") {
  1987. return this.EOF;
  1988. } else {
  1989. return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
  1990. {text: "", token: null, line: this.yylineno});
  1991. }
  1992. },
  1993. lex:function lex() {
  1994. var r = this.next();
  1995. if (typeof r !== 'undefined') {
  1996. return r;
  1997. } else {
  1998. return this.lex();
  1999. }
  2000. },
  2001. begin:function begin(condition) {
  2002. this.conditionStack.push(condition);
  2003. },
  2004. popState:function popState() {
  2005. return this.conditionStack.pop();
  2006. },
  2007. _currentRules:function _currentRules() {
  2008. return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
  2009. },
  2010. topState:function () {
  2011. return this.conditionStack[this.conditionStack.length-2];
  2012. },
  2013. pushState:function begin(condition) {
  2014. this.begin(condition);
  2015. }});
  2016. lexer.options = {};
  2017. lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
  2018. var YYSTATE=YY_START
  2019. switch($avoiding_name_collisions) {
  2020. case 0:
  2021. if(yy_.yytext.slice(-1) !== "\\") this.begin("mu");
  2022. if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu");
  2023. if(yy_.yytext) return 14;
  2024. break;
  2025. case 1: return 14;
  2026. break;
  2027. case 2:
  2028. if(yy_.yytext.slice(-1) !== "\\") this.popState();
  2029. if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1);
  2030. return 14;
  2031. break;
  2032. case 3: return 24;
  2033. break;
  2034. case 4: return 16;
  2035. break;
  2036. case 5: return 20;
  2037. break;
  2038. case 6: return 19;
  2039. break;
  2040. case 7: return 19;
  2041. break;
  2042. case 8: return 23;
  2043. break;
  2044. case 9: return 23;
  2045. break;
  2046. case 10: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15;
  2047. break;
  2048. case 11: return 22;
  2049. break;
  2050. case 12: return 35;
  2051. break;
  2052. case 13: return 34;
  2053. break;
  2054. case 14: return 34;
  2055. break;
  2056. case 15: return 37;
  2057. break;
  2058. case 16: /*ignore whitespace*/
  2059. break;
  2060. case 17: this.popState(); return 18;
  2061. break;
  2062. case 18: this.popState(); return 18;
  2063. break;
  2064. case 19: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 29;
  2065. break;
  2066. case 20: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 29;
  2067. break;
  2068. case 21: yy_.yytext = yy_.yytext.substr(1); return 27;
  2069. break;
  2070. case 22: return 31;
  2071. break;
  2072. case 23: return 31;
  2073. break;
  2074. case 24: return 30;
  2075. break;
  2076. case 25: return 34;
  2077. break;
  2078. case 26: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 34;
  2079. break;
  2080. case 27: return 'INVALID';
  2081. break;
  2082. case 28: return 5;
  2083. break;
  2084. }
  2085. };
  2086. lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[} ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];
  2087. lexer.conditions = {"mu":{"rules":[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"INITIAL":{"rules":[0,1,28],"inclusive":true}};
  2088. return lexer;})()
  2089. parser.lexer = lexer;
  2090. function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;
  2091. return new Parser;
  2092. })();
  2093. if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
  2094. exports.parser = handlebars;
  2095. exports.Parser = handlebars.Parser;
  2096. exports.parse = function () { return handlebars.parse.apply(handlebars, arguments); }
  2097. exports.main = function commonjsMain(args) {
  2098. if (!args[1])
  2099. throw new Error('Usage: '+args[0]+' FILE');
  2100. var source, cwd;
  2101. if (typeof process !== 'undefined') {
  2102. source = require('fs').readFileSync(require('path').resolve(args[1]), "utf8");
  2103. } else {
  2104. source = require("file").path(require("file").cwd()).join(args[1]).read({charset: "utf-8"});
  2105. }
  2106. return exports.parser.parse(source);
  2107. }
  2108. if (typeof module !== 'undefined' && require.main === module) {
  2109. exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args);
  2110. }
  2111. };
  2112. ;
  2113. // lib/handlebars/compiler/base.js
  2114. Handlebars.Parser = handlebars;
  2115. Handlebars.parse = function(string) {
  2116. Handlebars.Parser.yy = Handlebars.AST;
  2117. return Handlebars.Parser.parse(string);
  2118. };
  2119. Handlebars.print = function(ast) {
  2120. return new Handlebars.PrintVisitor().accept(ast);
  2121. };
  2122. Handlebars.logger = {
  2123. DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
  2124. // override in the host environment
  2125. log: function(level, str) {}
  2126. };
  2127. Handlebars.log = function(level, str) { Handlebars.logger.log(level, str); };
  2128. ;
  2129. // lib/handlebars/compiler/ast.js
  2130. (function() {
  2131. Handlebars.AST = {};
  2132. Handlebars.AST.ProgramNode = function(statements, inverse) {
  2133. this.type = "program";
  2134. this.statements = statements;
  2135. if(inverse) { this.inverse = new Handlebars.AST.ProgramNode(inverse); }
  2136. };
  2137. Handlebars.AST.MustacheNode = function(rawParams, hash, unescaped) {
  2138. this.type = "mustache";
  2139. this.escaped = !unescaped;
  2140. this.hash = hash;
  2141. var id = this.id = rawParams[0];
  2142. var params = this.params = rawParams.slice(1);
  2143. // a mustache is an eligible helper if:
  2144. // * its id is simple (a single part, not `this` or `..`)
  2145. var eligibleHelper = this.eligibleHelper = id.isSimple;
  2146. // a mustache is definitely a helper if:
  2147. // * it is an eligible helper, and
  2148. // * it has at least one parameter or hash segment
  2149. this.isHelper = eligibleHelper && (params.length || hash);
  2150. // if a mustache is an eligible helper but not a definite
  2151. // helper, it is ambiguous, and will be resolved in a later
  2152. // pass or at runtime.
  2153. };
  2154. Handlebars.AST.PartialNode = function(id, context) {
  2155. this.type = "partial";
  2156. // TODO: disallow complex IDs
  2157. this.id = id;
  2158. this.context = context;
  2159. };
  2160. var verifyMatch = function(open, close) {
  2161. if(open.original !== close.original) {
  2162. throw new Handlebars.Exception(open.original + " doesn't match " + close.original);
  2163. }
  2164. };
  2165. Handlebars.AST.BlockNode = function(mustache, program, inverse, close) {
  2166. verifyMatch(mustache.id, close);
  2167. this.type = "block";
  2168. this.mustache = mustache;
  2169. this.program = program;
  2170. this.inverse = inverse;
  2171. if (this.inverse && !this.program) {
  2172. this.isInverse = true;
  2173. }
  2174. };
  2175. Handlebars.AST.ContentNode = function(string) {
  2176. this.type = "content";
  2177. this.string = string;
  2178. };
  2179. Handlebars.AST.HashNode = function(pairs) {
  2180. this.type = "hash";
  2181. this.pairs = pairs;
  2182. };
  2183. Handlebars.AST.IdNode = function(parts) {
  2184. this.type = "ID";
  2185. this.original = parts.join(".");
  2186. var dig = [], depth = 0;
  2187. for(var i=0,l=parts.length; i<l; i++) {
  2188. var part = parts[i];
  2189. if(part === "..") { depth++; }
  2190. else if(part === "." || part === "this") { this.isScoped = true; }
  2191. else { dig.push(part); }
  2192. }
  2193. this.parts = dig;
  2194. this.string = dig.join('.');
  2195. this.depth = depth;
  2196. // an ID is simple if it only has one part, and that part is not
  2197. // `..` or `this`.
  2198. this.isSimple = parts.length === 1 && !this.isScoped && depth === 0;
  2199. };
  2200. Handlebars.AST.DataNode = function(id) {
  2201. this.type = "DATA";
  2202. this.id = id;
  2203. };
  2204. Handlebars.AST.StringNode = function(string) {
  2205. this.type = "STRING";
  2206. this.string = string;
  2207. };
  2208. Handlebars.AST.IntegerNode = function(integer) {
  2209. this.type = "INTEGER";
  2210. this.integer = integer;
  2211. };
  2212. Handlebars.AST.BooleanNode = function(bool) {
  2213. this.type = "BOOLEAN";
  2214. this.bool = bool;
  2215. };
  2216. Handlebars.AST.CommentNode = function(comment) {
  2217. this.type = "comment";
  2218. this.comment = comment;
  2219. };
  2220. })();;
  2221. // lib/handlebars/utils.js
  2222. Handlebars.Exception = function(message) {
  2223. var tmp = Error.prototype.constructor.apply(this, arguments);
  2224. for (var p in tmp) {
  2225. if (tmp.hasOwnProperty(p)) { this[p] = tmp[p]; }
  2226. }
  2227. this.message = tmp.message;
  2228. };
  2229. Handlebars.Exception.prototype = new Error();
  2230. // Build out our basic SafeString type
  2231. Handlebars.SafeString = function(string) {
  2232. this.string = string;
  2233. };
  2234. Handlebars.SafeString.prototype.toString = function() {
  2235. return this.string.toString();
  2236. };
  2237. (function() {
  2238. var escape = {
  2239. "&": "&amp;",
  2240. "<": "&lt;",
  2241. ">": "&gt;",
  2242. '"': "&quot;",
  2243. "'": "&#x27;",
  2244. "`": "&#x60;"
  2245. };
  2246. var badChars = /[&<>"'`]/g;
  2247. var possible = /[&<>"'`]/;
  2248. var escapeChar = function(chr) {
  2249. return escape[chr] || "&amp;";
  2250. };
  2251. Handlebars.Utils = {
  2252. escapeExpression: function(string) {
  2253. // don't escape SafeStrings, since they're already safe
  2254. if (string instanceof Handlebars.SafeString) {
  2255. return string.toString();
  2256. } else if (string == null || string === false) {
  2257. return "";
  2258. }
  2259. if(!possible.test(string)) { return string; }
  2260. return string.replace(badChars, escapeChar);
  2261. },
  2262. isEmpty: function(value) {
  2263. if (typeof value === "undefined") {
  2264. return true;
  2265. } else if (value === null) {
  2266. return true;
  2267. } else if (value === false) {
  2268. return true;
  2269. } else if(Object.prototype.toString.call(value) === "[object Array]" && value.length === 0) {
  2270. return true;
  2271. } else {
  2272. return false;
  2273. }
  2274. }
  2275. };
  2276. })();;
  2277. // lib/handlebars/compiler/compiler.js
  2278. /*jshint eqnull:true*/
  2279. Handlebars.Compiler = function() {};
  2280. Handlebars.JavaScriptCompiler = function() {};
  2281. (function(Compiler, JavaScriptCompiler) {
  2282. // the foundHelper register will disambiguate helper lookup from finding a
  2283. // function in a context. This is necessary for mustache compatibility, which
  2284. // requires that context functions in blocks are evaluated by blockHelperMissing,
  2285. // and then proceed as if the resulting value was provided to blockHelperMissing.
  2286. Compiler.prototype = {
  2287. compiler: Compiler,
  2288. disassemble: function() {
  2289. var opcodes = this.opcodes, opcode, out = [], params, param;
  2290. for (var i=0, l=opcodes.length; i<l; i++) {
  2291. opcode = opcodes[i];
  2292. if (opcode.opcode === 'DECLARE') {
  2293. out.push("DECLARE " + opcode.name + "=" + opcode.value);
  2294. } else {
  2295. params = [];
  2296. for (var j=0; j<opcode.args.length; j++) {
  2297. param = opcode.args[j];
  2298. if (typeof param === "string") {
  2299. param = "\"" + param.replace("\n", "\\n") + "\"";
  2300. }
  2301. params.push(param);
  2302. }
  2303. out.push(opcode.opcode + " " + params.join(" "));
  2304. }
  2305. }
  2306. return out.join("\n");
  2307. },
  2308. guid: 0,
  2309. compile: function(program, options) {
  2310. this.children = [];
  2311. this.depths = {list: []};
  2312. this.options = options;
  2313. // These changes will propagate to the other compiler components
  2314. var knownHelpers = this.options.knownHelpers;
  2315. this.options.knownHelpers = {
  2316. 'helperMissing': true,
  2317. 'blockHelperMissing': true,
  2318. 'each': true,
  2319. 'if': true,
  2320. 'unless': true,
  2321. 'with': true,
  2322. 'log': true
  2323. };
  2324. if (knownHelpers) {
  2325. for (var name in knownHelpers) {
  2326. this.options.knownHelpers[name] = knownHelpers[name];
  2327. }
  2328. }
  2329. return this.program(program);
  2330. },
  2331. accept: function(node) {
  2332. return this[node.type](node);
  2333. },
  2334. program: function(program) {
  2335. var statements = program.statements, statement;
  2336. this.opcodes = [];
  2337. for(var i=0, l=statements.length; i<l; i++) {
  2338. statement = statements[i];
  2339. this[statement.type](statement);
  2340. }
  2341. this.isSimple = l === 1;
  2342. this.depths.list = this.depths.list.sort(function(a, b) {
  2343. return a - b;
  2344. });
  2345. return this;
  2346. },
  2347. compileProgram: function(program) {
  2348. var result = new this.compiler().compile(program, this.options);
  2349. var guid = this.guid++, depth;
  2350. this.usePartial = this.usePartial || result.usePartial;
  2351. this.children[guid] = result;
  2352. for(var i=0, l=result.depths.list.length; i<l; i++) {
  2353. depth = result.depths.list[i];
  2354. if(depth < 2) { continue; }
  2355. else { this.addDepth(depth - 1); }
  2356. }
  2357. return guid;
  2358. },
  2359. block: function(block) {
  2360. var mustache = block.mustache,
  2361. program = block.program,
  2362. inverse = block.inverse;
  2363. if (program) {
  2364. program = this.compileProgram(program);
  2365. }
  2366. if (inverse) {
  2367. inverse = this.compileProgram(inverse);
  2368. }
  2369. var type = this.classifyMustache(mustache);
  2370. if (type === "helper") {
  2371. this.helperMustache(mustache, program, inverse);
  2372. } else if (type === "simple") {
  2373. this.simpleMustache(mustache);
  2374. // now that the simple mustache is resolved, we need to
  2375. // evaluate it by executing `blockHelperMissing`
  2376. this.opcode('pushProgram', program);
  2377. this.opcode('pushProgram', inverse);
  2378. this.opcode('pushLiteral', '{}');
  2379. this.opcode('blockValue');
  2380. } else {
  2381. this.ambiguousMustache(mustache, program, inverse);
  2382. // now that the simple mustache is resolved, we need to
  2383. // evaluate it by executing `blockHelperMissing`
  2384. this.opcode('pushProgram', program);
  2385. this.opcode('pushProgram', inverse);
  2386. this.opcode('pushLiteral', '{}');
  2387. this.opcode('ambiguousBlockValue');
  2388. }
  2389. this.opcode('append');
  2390. },
  2391. hash: function(hash) {
  2392. var pairs = hash.pairs, pair, val;
  2393. this.opcode('push', '{}');
  2394. for(var i=0, l=pairs.length; i<l; i++) {
  2395. pair = pairs[i];
  2396. val = pair[1];
  2397. this.accept(val);
  2398. this.opcode('assignToHash', pair[0]);
  2399. }
  2400. },
  2401. partial: function(partial) {
  2402. var id = partial.id;
  2403. this.usePartial = true;
  2404. if(partial.context) {
  2405. this.ID(partial.context);
  2406. } else {
  2407. this.opcode('push', 'depth0');
  2408. }
  2409. this.opcode('invokePartial', id.original);
  2410. this.opcode('append');
  2411. },
  2412. content: function(content) {
  2413. this.opcode('appendContent', content.string);
  2414. },
  2415. mustache: function(mustache) {
  2416. var options = this.options;
  2417. var type = this.classifyMustache(mustache);
  2418. if (type === "simple") {
  2419. this.simpleMustache(mustache);
  2420. } else if (type === "helper") {
  2421. this.helperMustache(mustache);
  2422. } else {
  2423. this.ambiguousMustache(mustache);
  2424. }
  2425. if(mustache.escaped && !options.noEscape) {
  2426. this.opcode('appendEscaped');
  2427. } else {
  2428. this.opcode('append');
  2429. }
  2430. },
  2431. ambiguousMustache: function(mustache, program, inverse) {
  2432. var id = mustache.id, name = id.parts[0];
  2433. this.opcode('getContext', id.depth);
  2434. this.opcode('pushProgram', program);
  2435. this.opcode('pushProgram', inverse);
  2436. this.opcode('invokeAmbiguous', name);
  2437. },
  2438. simpleMustache: function(mustache, program, inverse) {
  2439. var id = mustache.id;
  2440. if (id.type === 'DATA') {
  2441. this.DATA(id);
  2442. } else if (id.parts.length) {
  2443. this.ID(id);
  2444. } else {
  2445. // Simplified ID for `this`
  2446. this.addDepth(id.depth);
  2447. this.opcode('getContext', id.depth);
  2448. this.opcode('pushContext');
  2449. }
  2450. this.opcode('resolvePossibleLambda');
  2451. },
  2452. helperMustache: function(mustache, program, inverse) {
  2453. var params = this.setupFullMustacheParams(mustache, program, inverse),
  2454. name = mustache.id.parts[0];
  2455. if (this.options.knownHelpers[name]) {
  2456. this.opcode('invokeKnownHelper', params.length, name);
  2457. } else if (this.knownHelpersOnly) {
  2458. throw new Error("You specified knownHelpersOnly, but used the unknown helper " + name);
  2459. } else {
  2460. this.opcode('invokeHelper', params.length, name);
  2461. }
  2462. },
  2463. ID: function(id) {
  2464. this.addDepth(id.depth);
  2465. this.opcode('getContext', id.depth);
  2466. var name = id.parts[0];
  2467. if (!name) {
  2468. this.opcode('pushContext');
  2469. } else {
  2470. this.opcode('lookupOnContext', id.parts[0]);
  2471. }
  2472. for(var i=1, l=id.parts.length; i<l; i++) {
  2473. this.opcode('lookup', id.parts[i]);
  2474. }
  2475. },
  2476. DATA: function(data) {
  2477. this.options.data = true;
  2478. this.opcode('lookupData', data.id);
  2479. },
  2480. STRING: function(string) {
  2481. this.opcode('pushString', string.string);
  2482. },
  2483. INTEGER: function(integer) {
  2484. this.opcode('pushLiteral', integer.integer);
  2485. },
  2486. BOOLEAN: function(bool) {
  2487. this.opcode('pushLiteral', bool.bool);
  2488. },
  2489. comment: function() {},
  2490. // HELPERS
  2491. opcode: function(name) {
  2492. this.opcodes.push({ opcode: name, args: [].slice.call(arguments, 1) });
  2493. },
  2494. declare: function(name, value) {
  2495. this.opcodes.push({ opcode: 'DECLARE', name: name, value: value });
  2496. },
  2497. addDepth: function(depth) {
  2498. if(isNaN(depth)) { throw new Error("EWOT"); }
  2499. if(depth === 0) { return; }
  2500. if(!this.depths[depth]) {
  2501. this.depths[depth] = true;
  2502. this.depths.list.push(depth);
  2503. }
  2504. },
  2505. classifyMustache: function(mustache) {
  2506. var isHelper = mustache.isHelper;
  2507. var isEligible = mustache.eligibleHelper;
  2508. var options = this.options;
  2509. // if ambiguous, we can possibly resolve the ambiguity now
  2510. if (isEligible && !isHelper) {
  2511. var name = mustache.id.parts[0];
  2512. if (options.knownHelpers[name]) {
  2513. isHelper = true;
  2514. } else if (options.knownHelpersOnly) {
  2515. isEligible = false;
  2516. }
  2517. }
  2518. if (isHelper) { return "helper"; }
  2519. else if (isEligible) { return "ambiguous"; }
  2520. else { return "simple"; }
  2521. },
  2522. pushParams: function(params) {
  2523. var i = params.length, param;
  2524. while(i--) {
  2525. param = params[i];
  2526. if(this.options.stringParams) {
  2527. if(param.depth) {
  2528. this.addDepth(param.depth);
  2529. }
  2530. this.opcode('getContext', param.depth || 0);
  2531. this.opcode('pushStringParam', param.string);
  2532. } else {
  2533. this[param.type](param);
  2534. }
  2535. }
  2536. },
  2537. setupMustacheParams: function(mustache) {
  2538. var params = mustache.params;
  2539. this.pushParams(params);
  2540. if(mustache.hash) {
  2541. this.hash(mustache.hash);
  2542. } else {
  2543. this.opcode('pushLiteral', '{}');
  2544. }
  2545. return params;
  2546. },
  2547. // this will replace setupMustacheParams when we're done
  2548. setupFullMustacheParams: function(mustache, program, inverse) {
  2549. var params = mustache.params;
  2550. this.pushParams(params);
  2551. this.opcode('pushProgram', program);
  2552. this.opcode('pushProgram', inverse);
  2553. if(mustache.hash) {
  2554. this.hash(mustache.hash);
  2555. } else {
  2556. this.opcode('pushLiteral', '{}');
  2557. }
  2558. return params;
  2559. }
  2560. };
  2561. var Literal = function(value) {
  2562. this.value = value;
  2563. };
  2564. JavaScriptCompiler.prototype = {
  2565. // PUBLIC API: You can override these methods in a subclass to provide
  2566. // alternative compiled forms for name lookup and buffering semantics
  2567. nameLookup: function(parent, name, type) {
  2568. if (/^[0-9]+$/.test(name)) {
  2569. return parent + "[" + name + "]";
  2570. } else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
  2571. return parent + "." + name;
  2572. }
  2573. else {
  2574. return parent + "['" + name + "']";
  2575. }
  2576. },
  2577. appendToBuffer: function(string) {
  2578. if (this.environment.isSimple) {
  2579. return "return " + string + ";";
  2580. } else {
  2581. return "buffer += " + string + ";";
  2582. }
  2583. },
  2584. initializeBuffer: function() {
  2585. return this.quotedString("");
  2586. },
  2587. namespace: "Handlebars",
  2588. // END PUBLIC API
  2589. compile: function(environment, options, context, asObject) {
  2590. this.environment = environment;
  2591. this.options = options || {};
  2592. Handlebars.log(Handlebars.logger.DEBUG, this.environment.disassemble() + "\n\n");
  2593. this.name = this.environment.name;
  2594. this.isChild = !!context;
  2595. this.context = context || {
  2596. programs: [],
  2597. aliases: { }
  2598. };
  2599. this.preamble();
  2600. this.stackSlot = 0;
  2601. this.stackVars = [];
  2602. this.registers = { list: [] };
  2603. this.compileStack = [];
  2604. this.compileChildren(environment, options);
  2605. var opcodes = environment.opcodes, opcode;
  2606. this.i = 0;
  2607. for(l=opcodes.length; this.i<l; this.i++) {
  2608. opcode = opcodes[this.i];
  2609. if(opcode.opcode === 'DECLARE') {
  2610. this[opcode.name] = opcode.value;
  2611. } else {
  2612. this[opcode.opcode].apply(this, opcode.args);
  2613. }
  2614. }
  2615. return this.createFunctionContext(asObject);
  2616. },
  2617. nextOpcode: function() {
  2618. var opcodes = this.environment.opcodes, opcode = opcodes[this.i + 1];
  2619. return opcodes[this.i + 1];
  2620. },
  2621. eat: function(opcode) {
  2622. this.i = this.i + 1;
  2623. },
  2624. preamble: function() {
  2625. var out = [];
  2626. if (!this.isChild) {
  2627. var namespace = this.namespace;
  2628. var copies = "helpers = helpers || " + namespace + ".helpers;";
  2629. if (this.environment.usePartial) { copies = copies + " partials = partials || " + namespace + ".partials;"; }
  2630. if (this.options.data) { copies = copies + " data = data || {};"; }
  2631. out.push(copies);
  2632. } else {
  2633. out.push('');
  2634. }
  2635. if (!this.environment.isSimple) {
  2636. out.push(", buffer = " + this.initializeBuffer());
  2637. } else {
  2638. out.push("");
  2639. }
  2640. // track the last context pushed into place to allow skipping the
  2641. // getContext opcode when it would be a noop
  2642. this.lastContext = 0;
  2643. this.source = out;
  2644. },
  2645. createFunctionContext: function(asObject) {
  2646. var locals = this.stackVars.concat(this.registers.list);
  2647. if(locals.length > 0) {
  2648. this.source[1] = this.source[1] + ", " + locals.join(", ");
  2649. }
  2650. // Generate minimizer alias mappings
  2651. if (!this.isChild) {
  2652. var aliases = [];
  2653. for (var alias in this.context.aliases) {
  2654. this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];
  2655. }
  2656. }
  2657. if (this.source[1]) {
  2658. this.source[1] = "var " + this.source[1].substring(2) + ";";
  2659. }
  2660. // Merge children
  2661. if (!this.isChild) {
  2662. this.source[1] += '\n' + this.context.programs.join('\n') + '\n';
  2663. }
  2664. if (!this.environment.isSimple) {
  2665. this.source.push("return buffer;");
  2666. }
  2667. var params = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"];
  2668. for(var i=0, l=this.environment.depths.list.length; i<l; i++) {
  2669. params.push("depth" + this.environment.depths.list[i]);
  2670. }
  2671. if (asObject) {
  2672. params.push(this.source.join("\n "));
  2673. return Function.apply(this, params);
  2674. } else {
  2675. var functionSource = 'function ' + (this.name || '') + '(' + params.join(',') + ') {\n ' + this.source.join("\n ") + '}';
  2676. Handlebars.log(Handlebars.logger.DEBUG, functionSource + "\n\n");
  2677. return functionSource;
  2678. }
  2679. },
  2680. // [blockValue]
  2681. //
  2682. // On stack, before: hash, inverse, program, value
  2683. // On stack, after: return value of blockHelperMissing
  2684. //
  2685. // The purpose of this opcode is to take a block of the form
  2686. // `{{#foo}}...{{/foo}}`, resolve the value of `foo`, and
  2687. // replace it on the stack with the result of properly
  2688. // invoking blockHelperMissing.
  2689. blockValue: function() {
  2690. this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
  2691. var params = ["depth0"];
  2692. this.setupParams(0, params);
  2693. this.replaceStack(function(current) {
  2694. params.splice(1, 0, current);
  2695. return current + " = blockHelperMissing.call(" + params.join(", ") + ")";
  2696. });
  2697. },
  2698. // [ambiguousBlockValue]
  2699. //
  2700. // On stack, before: hash, inverse, program, value
  2701. // Compiler value, before: lastHelper=value of last found helper, if any
  2702. // On stack, after, if no lastHelper: same as [blockValue]
  2703. // On stack, after, if lastHelper: value
  2704. ambiguousBlockValue: function() {
  2705. this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
  2706. var params = ["depth0"];
  2707. this.setupParams(0, params);
  2708. var current = this.topStack();
  2709. params.splice(1, 0, current);
  2710. this.source.push("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }");
  2711. },
  2712. // [appendContent]
  2713. //
  2714. // On stack, before: ...
  2715. // On stack, after: ...
  2716. //
  2717. // Appends the string value of `content` to the current buffer
  2718. appendContent: function(content) {
  2719. this.source.push(this.appendToBuffer(this.quotedString(content)));
  2720. },
  2721. // [append]
  2722. //
  2723. // On stack, before: value, ...
  2724. // On stack, after: ...
  2725. //
  2726. // Coerces `value` to a String and appends it to the current buffer.
  2727. //
  2728. // If `value` is truthy, or 0, it is coerced into a string and appended
  2729. // Otherwise, the empty string is appended
  2730. append: function() {
  2731. var local = this.popStack();
  2732. this.source.push("if(" + local + " || " + local + " === 0) { " + this.appendToBuffer(local) + " }");
  2733. if (this.environment.isSimple) {
  2734. this.source.push("else { " + this.appendToBuffer("''") + " }");
  2735. }
  2736. },
  2737. // [appendEscaped]
  2738. //
  2739. // On stack, before: value, ...
  2740. // On stack, after: ...
  2741. //
  2742. // Escape `value` and append it to the buffer
  2743. appendEscaped: function() {
  2744. var opcode = this.nextOpcode(), extra = "";
  2745. this.context.aliases.escapeExpression = 'this.escapeExpression';
  2746. if(opcode && opcode.opcode === 'appendContent') {
  2747. extra = " + " + this.quotedString(opcode.args[0]);
  2748. this.eat(opcode);
  2749. }
  2750. this.source.push(this.appendToBuffer("escapeExpression(" + this.popStack() + ")" + extra));
  2751. },
  2752. // [getContext]
  2753. //
  2754. // On stack, before: ...
  2755. // On stack, after: ...
  2756. // Compiler value, after: lastContext=depth
  2757. //
  2758. // Set the value of the `lastContext` compiler value to the depth
  2759. getContext: function(depth) {
  2760. if(this.lastContext !== depth) {
  2761. this.lastContext = depth;
  2762. }
  2763. },
  2764. // [lookupOnContext]
  2765. //
  2766. // On stack, before: ...
  2767. // On stack, after: currentContext[name], ...
  2768. //
  2769. // Looks up the value of `name` on the current context and pushes
  2770. // it onto the stack.
  2771. lookupOnContext: function(name) {
  2772. this.pushStack(this.nameLookup('depth' + this.lastContext, name, 'context'));
  2773. },
  2774. // [pushContext]
  2775. //
  2776. // On stack, before: ...
  2777. // On stack, after: currentContext, ...
  2778. //
  2779. // Pushes the value of the current context onto the stack.
  2780. pushContext: function() {
  2781. this.pushStackLiteral('depth' + this.lastContext);
  2782. },
  2783. // [resolvePossibleLambda]
  2784. //
  2785. // On stack, before: value, ...
  2786. // On stack, after: resolved value, ...
  2787. //
  2788. // If the `value` is a lambda, replace it on the stack by
  2789. // the return value of the lambda
  2790. resolvePossibleLambda: function() {
  2791. this.context.aliases.functionType = '"function"';
  2792. this.replaceStack(function(current) {
  2793. return "typeof " + current + " === functionType ? " + current + "() : " + current;
  2794. });
  2795. },
  2796. // [lookup]
  2797. //
  2798. // On stack, before: value, ...
  2799. // On stack, after: value[name], ...
  2800. //
  2801. // Replace the value on the stack with the result of looking
  2802. // up `name` on `value`
  2803. lookup: function(name) {
  2804. this.replaceStack(function(current) {
  2805. return current + " == null || " + current + " === false ? " + current + " : " + this.nameLookup(current, name, 'context');
  2806. });
  2807. },
  2808. // [lookupData]
  2809. //
  2810. // On stack, before: ...
  2811. // On stack, after: data[id], ...
  2812. //
  2813. // Push the result of looking up `id` on the current data
  2814. lookupData: function(id) {
  2815. this.pushStack(this.nameLookup('data', id, 'data'));
  2816. },
  2817. // [pushStringParam]
  2818. //
  2819. // On stack, before: ...
  2820. // On stack, after: string, currentContext, ...
  2821. //
  2822. // This opcode is designed for use in string mode, which
  2823. // provides the string value of a parameter along with its
  2824. // depth rather than resolving it immediately.
  2825. pushStringParam: function(string) {
  2826. this.pushStackLiteral('depth' + this.lastContext);
  2827. this.pushString(string);
  2828. },
  2829. // [pushString]
  2830. //
  2831. // On stack, before: ...
  2832. // On stack, after: quotedString(string), ...
  2833. //
  2834. // Push a quoted version of `string` onto the stack
  2835. pushString: function(string) {
  2836. this.pushStackLiteral(this.quotedString(string));
  2837. },
  2838. // [push]
  2839. //
  2840. // On stack, before: ...
  2841. // On stack, after: expr, ...
  2842. //
  2843. // Push an expression onto the stack
  2844. push: function(expr) {
  2845. this.pushStack(expr);
  2846. },
  2847. // [pushLiteral]
  2848. //
  2849. // On stack, before: ...
  2850. // On stack, after: value, ...
  2851. //
  2852. // Pushes a value onto the stack. This operation prevents
  2853. // the compiler from creating a temporary variable to hold
  2854. // it.
  2855. pushLiteral: function(value) {
  2856. this.pushStackLiteral(value);
  2857. },
  2858. // [pushProgram]
  2859. //
  2860. // On stack, before: ...
  2861. // On stack, after: program(guid), ...
  2862. //
  2863. // Push a program expression onto the stack. This takes
  2864. // a compile-time guid and converts it into a runtime-accessible
  2865. // expression.
  2866. pushProgram: function(guid) {
  2867. if (guid != null) {
  2868. this.pushStackLiteral(this.programExpression(guid));
  2869. } else {
  2870. this.pushStackLiteral(null);
  2871. }
  2872. },
  2873. // [invokeHelper]
  2874. //
  2875. // On stack, before: hash, inverse, program, params..., ...
  2876. // On stack, after: result of helper invocation
  2877. //
  2878. // Pops off the helper's parameters, invokes the helper,
  2879. // and pushes the helper's return value onto the stack.
  2880. //
  2881. // If the helper is not found, `helperMissing` is called.
  2882. invokeHelper: function(paramSize, name) {
  2883. this.context.aliases.helperMissing = 'helpers.helperMissing';
  2884. var helper = this.lastHelper = this.setupHelper(paramSize, name);
  2885. this.register('foundHelper', helper.name);
  2886. this.pushStack("foundHelper ? foundHelper.call(" +
  2887. helper.callParams + ") " + ": helperMissing.call(" +
  2888. helper.helperMissingParams + ")");
  2889. },
  2890. // [invokeKnownHelper]
  2891. //
  2892. // On stack, before: hash, inverse, program, params..., ...
  2893. // On stack, after: result of helper invocation
  2894. //
  2895. // This operation is used when the helper is known to exist,
  2896. // so a `helperMissing` fallback is not required.
  2897. invokeKnownHelper: function(paramSize, name) {
  2898. var helper = this.setupHelper(paramSize, name);
  2899. this.pushStack(helper.name + ".call(" + helper.callParams + ")");
  2900. },
  2901. // [invokeAmbiguous]
  2902. //
  2903. // On stack, before: hash, inverse, program, params..., ...
  2904. // On stack, after: result of disambiguation
  2905. //
  2906. // This operation is used when an expression like `{{foo}}`
  2907. // is provided, but we don't know at compile-time whether it
  2908. // is a helper or a path.
  2909. //
  2910. // This operation emits more code than the other options,
  2911. // and can be avoided by passing the `knownHelpers` and
  2912. // `knownHelpersOnly` flags at compile-time.
  2913. invokeAmbiguous: function(name) {
  2914. this.context.aliases.functionType = '"function"';
  2915. this.pushStackLiteral('{}');
  2916. var helper = this.setupHelper(0, name);
  2917. var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
  2918. this.register('foundHelper', helperName);
  2919. var nonHelper = this.nameLookup('depth' + this.lastContext, name, 'context');
  2920. var nextStack = this.nextStack();
  2921. this.source.push('if (foundHelper) { ' + nextStack + ' = foundHelper.call(' + helper.callParams + '); }');
  2922. this.source.push('else { ' + nextStack + ' = ' + nonHelper + '; ' + nextStack + ' = typeof ' + nextStack + ' === functionType ? ' + nextStack + '() : ' + nextStack + '; }');
  2923. },
  2924. // [invokePartial]
  2925. //
  2926. // On stack, before: context, ...
  2927. // On stack after: result of partial invocation
  2928. //
  2929. // This operation pops off a context, invokes a partial with that context,
  2930. // and pushes the result of the invocation back.
  2931. invokePartial: function(name) {
  2932. var params = [this.nameLookup('partials', name, 'partial'), "'" + name + "'", this.popStack(), "helpers", "partials"];
  2933. if (this.options.data) {
  2934. params.push("data");
  2935. }
  2936. this.context.aliases.self = "this";
  2937. this.pushStack("self.invokePartial(" + params.join(", ") + ");");
  2938. },
  2939. // [assignToHash]
  2940. //
  2941. // On stack, before: value, hash, ...
  2942. // On stack, after: hash, ...
  2943. //
  2944. // Pops a value and hash off the stack, assigns `hash[key] = value`
  2945. // and pushes the hash back onto the stack.
  2946. assignToHash: function(key) {
  2947. var value = this.popStack();
  2948. var hash = this.topStack();
  2949. this.source.push(hash + "['" + key + "'] = " + value + ";");
  2950. },
  2951. // HELPERS
  2952. compiler: JavaScriptCompiler,
  2953. compileChildren: function(environment, options) {
  2954. var children = environment.children, child, compiler;
  2955. for(var i=0, l=children.length; i<l; i++) {
  2956. child = children[i];
  2957. compiler = new this.compiler();
  2958. this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
  2959. var index = this.context.programs.length;
  2960. child.index = index;
  2961. child.name = 'program' + index;
  2962. this.context.programs[index] = compiler.compile(child, options, this.context);
  2963. }
  2964. },
  2965. programExpression: function(guid) {
  2966. this.context.aliases.self = "this";
  2967. if(guid == null) {
  2968. return "self.noop";
  2969. }
  2970. var child = this.environment.children[guid],
  2971. depths = child.depths.list, depth;
  2972. var programParams = [child.index, child.name, "data"];
  2973. for(var i=0, l = depths.length; i<l; i++) {
  2974. depth = depths[i];
  2975. if(depth === 1) { programParams.push("depth0"); }
  2976. else { programParams.push("depth" + (depth - 1)); }
  2977. }
  2978. if(depths.length === 0) {
  2979. return "self.program(" + programParams.join(", ") + ")";
  2980. } else {
  2981. programParams.shift();
  2982. return "self.programWithDepth(" + programParams.join(", ") + ")";
  2983. }
  2984. },
  2985. register: function(name, val) {
  2986. this.useRegister(name);
  2987. this.source.push(name + " = " + val + ";");
  2988. },
  2989. useRegister: function(name) {
  2990. if(!this.registers[name]) {
  2991. this.registers[name] = true;
  2992. this.registers.list.push(name);
  2993. }
  2994. },
  2995. pushStackLiteral: function(item) {
  2996. this.compileStack.push(new Literal(item));
  2997. return item;
  2998. },
  2999. pushStack: function(item) {
  3000. this.source.push(this.incrStack() + " = " + item + ";");
  3001. this.compileStack.push("stack" + this.stackSlot);
  3002. return "stack" + this.stackSlot;
  3003. },
  3004. replaceStack: function(callback) {
  3005. var item = callback.call(this, this.topStack());
  3006. this.source.push(this.topStack() + " = " + item + ";");
  3007. return "stack" + this.stackSlot;
  3008. },
  3009. nextStack: function(skipCompileStack) {
  3010. var name = this.incrStack();
  3011. this.compileStack.push("stack" + this.stackSlot);
  3012. return name;
  3013. },
  3014. incrStack: function() {
  3015. this.stackSlot++;
  3016. if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); }
  3017. return "stack" + this.stackSlot;
  3018. },
  3019. popStack: function() {
  3020. var item = this.compileStack.pop();
  3021. if (item instanceof Literal) {
  3022. return item.value;
  3023. } else {
  3024. this.stackSlot--;
  3025. return item;
  3026. }
  3027. },
  3028. topStack: function() {
  3029. var item = this.compileStack[this.compileStack.length - 1];
  3030. if (item instanceof Literal) {
  3031. return item.value;
  3032. } else {
  3033. return item;
  3034. }
  3035. },
  3036. quotedString: function(str) {
  3037. return '"' + str
  3038. .replace(/\\/g, '\\\\')
  3039. .replace(/"/g, '\\"')
  3040. .replace(/\n/g, '\\n')
  3041. .replace(/\r/g, '\\r') + '"';
  3042. },
  3043. setupHelper: function(paramSize, name) {
  3044. var params = [];
  3045. this.setupParams(paramSize, params);
  3046. var foundHelper = this.nameLookup('helpers', name, 'helper');
  3047. return {
  3048. params: params,
  3049. name: foundHelper,
  3050. callParams: ["depth0"].concat(params).join(", "),
  3051. helperMissingParams: ["depth0", this.quotedString(name)].concat(params).join(", ")
  3052. };
  3053. },
  3054. // the params and contexts arguments are passed in arrays
  3055. // to fill in
  3056. setupParams: function(paramSize, params) {
  3057. var options = [], contexts = [], param, inverse, program;
  3058. options.push("hash:" + this.popStack());
  3059. inverse = this.popStack();
  3060. program = this.popStack();
  3061. // Avoid setting fn and inverse if neither are set. This allows
  3062. // helpers to do a check for `if (options.fn)`
  3063. if (program || inverse) {
  3064. if (!program) {
  3065. this.context.aliases.self = "this";
  3066. program = "self.noop";
  3067. }
  3068. if (!inverse) {
  3069. this.context.aliases.self = "this";
  3070. inverse = "self.noop";
  3071. }
  3072. options.push("inverse:" + inverse);
  3073. options.push("fn:" + program);
  3074. }
  3075. for(var i=0; i<paramSize; i++) {
  3076. param = this.popStack();
  3077. params.push(param);
  3078. if(this.options.stringParams) {
  3079. contexts.push(this.popStack());
  3080. }
  3081. }
  3082. if (this.options.stringParams) {
  3083. options.push("contexts:[" + contexts.join(",") + "]");
  3084. }
  3085. if(this.options.data) {
  3086. options.push("data:data");
  3087. }
  3088. params.push("{" + options.join(",") + "}");
  3089. return params.join(", ");
  3090. }
  3091. };
  3092. var reservedWords = (
  3093. "break else new var" +
  3094. " case finally return void" +
  3095. " catch for switch while" +
  3096. " continue function this with" +
  3097. " default if throw" +
  3098. " delete in try" +
  3099. " do instanceof typeof" +
  3100. " abstract enum int short" +
  3101. " boolean export interface static" +
  3102. " byte extends long super" +
  3103. " char final native synchronized" +
  3104. " class float package throws" +
  3105. " const goto private transient" +
  3106. " debugger implements protected volatile" +
  3107. " double import public let yield"
  3108. ).split(" ");
  3109. var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
  3110. for(var i=0, l=reservedWords.length; i<l; i++) {
  3111. compilerWords[reservedWords[i]] = true;
  3112. }
  3113. JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
  3114. if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name)) {
  3115. return true;
  3116. }
  3117. return false;
  3118. };
  3119. })(Handlebars.Compiler, Handlebars.JavaScriptCompiler);
  3120. Handlebars.precompile = function(string, options) {
  3121. options = options || {};
  3122. var ast = Handlebars.parse(string);
  3123. var environment = new Handlebars.Compiler().compile(ast, options);
  3124. return new Handlebars.JavaScriptCompiler().compile(environment, options);
  3125. };
  3126. Handlebars.compile = function(string, options) {
  3127. options = options || {};
  3128. var compiled;
  3129. function compile() {
  3130. var ast = Handlebars.parse(string);
  3131. var environment = new Handlebars.Compiler().compile(ast, options);
  3132. var templateSpec = new Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
  3133. return Handlebars.template(templateSpec);
  3134. }
  3135. // Template is only compiled on first use and cached after that point.
  3136. return function(context, options) {
  3137. if (!compiled) {
  3138. compiled = compile();
  3139. }
  3140. return compiled.call(this, context, options);
  3141. };
  3142. };
  3143. ;
  3144. // lib/handlebars/runtime.js
  3145. Handlebars.VM = {
  3146. template: function(templateSpec) {
  3147. // Just add water
  3148. var container = {
  3149. escapeExpression: Handlebars.Utils.escapeExpression,
  3150. invokePartial: Handlebars.VM.invokePartial,
  3151. programs: [],
  3152. program: function(i, fn, data) {
  3153. var programWrapper = this.programs[i];
  3154. if(data) {
  3155. return Handlebars.VM.program(fn, data);
  3156. } else if(programWrapper) {
  3157. return programWrapper;
  3158. } else {
  3159. programWrapper = this.programs[i] = Handlebars.VM.program(fn);
  3160. return programWrapper;
  3161. }
  3162. },
  3163. programWithDepth: Handlebars.VM.programWithDepth,
  3164. noop: Handlebars.VM.noop
  3165. };
  3166. return function(context, options) {
  3167. options = options || {};
  3168. return templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
  3169. };
  3170. },
  3171. programWithDepth: function(fn, data, $depth) {
  3172. var args = Array.prototype.slice.call(arguments, 2);
  3173. return function(context, options) {
  3174. options = options || {};
  3175. return fn.apply(this, [context, options.data || data].concat(args));
  3176. };
  3177. },
  3178. program: function(fn, data) {
  3179. return function(context, options) {
  3180. options = options || {};
  3181. return fn(context, options.data || data);
  3182. };
  3183. },
  3184. noop: function() { return ""; },
  3185. invokePartial: function(partial, name, context, helpers, partials, data) {
  3186. var options = { helpers: helpers, partials: partials, data: data };
  3187. if(partial === undefined) {
  3188. throw new Handlebars.Exception("The partial " + name + " could not be found");
  3189. } else if(partial instanceof Function) {
  3190. return partial(context, options);
  3191. } else if (!Handlebars.compile) {
  3192. throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
  3193. } else {
  3194. partials[name] = Handlebars.compile(partial, {data: data !== undefined});
  3195. return partials[name](context, options);
  3196. }
  3197. }
  3198. };
  3199. Handlebars.template = Handlebars.VM.template;
  3200. ;