!function(){"use strict";function encodeHTMLSource(){var encodeHTMLRules={"&":"&#38;","<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","/":"&#47;"},matchHTML=/&(?!#?\w+;)|<|>|"|'|\//g;return function(){return this?this.replace(matchHTML,function(m){return encodeHTMLRules[m]||m}):this}}function resolveDefs(c,block,def){return("string"==typeof block?block:block.toString()).replace(c.define||skip,function(m,code,assign,value){return 0===code.indexOf("def.")&&(code=code.substring(4)),code in def||(":"===assign?(c.defineParams&&value.replace(c.defineParams,function(m,param,v){def[code]={arg:param,text:v}}),code in def||(def[code]=value)):new Function("def","def['"+code+"']="+value)(def)),""}).replace(c.use||skip,function(m,code){c.useParams&&(code=code.replace(c.useParams,function(m,s,d,param){if(def[d]&&def[d].arg&&param){var rw=(d+":"+param).replace(/'|\\/g,"_");return def.__exp=def.__exp||{},def.__exp[rw]=def[d].text.replace(new RegExp("(^|[^\\w$])"+def[d].arg+"([^\\w$])","g"),"$1"+param+"$2"),s+"def.__exp['"+rw+"']"}}));var v=new Function("def","return "+code)(def);return v?resolveDefs(c,v,def):v})}function unescape(code){return code.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}var global,doT={version:"1.0.1",templateSettings:{evaluate:/\{\{([\s\S]+?(\}?)+)\}\}/g,interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,useParams:/(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,defineParams:/^\s*([\w$]+):([\s\S]+)/,conditional:/\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,varname:"it",strip:!0,append:!0,selfcontained:!1},template:void 0,compile:void 0};"undefined"!=typeof module&&module.exports?module.exports=doT:"function"==typeof define&&define.amd?define(function(){return doT}):(global=function(){return this||(0,eval)("this")}(),global.doT=doT),String.prototype.encodeHTML=encodeHTMLSource();var startend={append:{start:"'+(",end:")+'",endencode:"||'').toString().encodeHTML()+'"},split:{start:"';out+=(",end:");out+='",endencode:"||'').toString().encodeHTML();out+='"}},skip=/$^/;doT.template=function(tmpl,c,def){c=c||doT.templateSettings;var needhtmlencode,indv,cse=c.append?startend.append:startend.split,sid=0,str=c.use||c.define?resolveDefs(c,tmpl,def||{}):tmpl;str=("var out='"+(c.strip?str.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):str).replace(/'|\\/g,"\\$&").replace(c.interpolate||skip,function(m,code){return cse.start+unescape(code)+cse.end}).replace(c.encode||skip,function(m,code){return needhtmlencode=!0,cse.start+unescape(code)+cse.endencode}).replace(c.conditional||skip,function(m,elsecase,code){return elsecase?code?"';}else if("+unescape(code)+"){out+='":"';}else{out+='":code?"';if("+unescape(code)+"){out+='":"';}out+='"}).replace(c.iterate||skip,function(m,iterate,vname,iname){return iterate?(sid+=1,indv=iname||"i"+sid,iterate=unescape(iterate),"';var arr"+sid+"="+iterate+";if(arr"+sid+"){var "+vname+","+indv+"=-1,l"+sid+"=arr"+sid+".length-1;while("+indv+"<l"+sid+"){"+vname+"=arr"+sid+"["+indv+"+=1];out+='"):"';} } out+='"}).replace(c.evaluate||skip,function(m,code){return"';"+unescape(code)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|\}|^|\{)out\+='';/g,"$1").replace(/\+''/g,"").replace(/(\s|;|\}|^|\{)out\+=''\+/g,"$1out+="),needhtmlencode&&c.selfcontained&&(str="String.prototype.encodeHTML=("+encodeHTMLSource.toString()+"());"+str);try{return new Function(c.varname,str)}catch(e){throw"undefined"!=typeof console&&console.log("Could not create a template function: "+str),e}},doT.compile=function(tmpl,def){return doT.template(tmpl,null,def)}}();