/*! JsRender v0.9.83 (Beta): http://jsviews.com/#jsrender */ /*! **VERSION FOR WEB** (For NODE.JS see http://jsviews.com/download/jsrender-node.js) */ !function(e,t){var n=t.jQuery;"object"==typeof exports?module.exports=n?e(t,n):function(n){if(n&&!n.fn)throw"Provide jQuery or null";return e(t,n)}:"function"==typeof define&&define.amd?define(function(){return e(t)}):e(t,!1)}(function(e,t){"use strict";function n(e,t){return function(){var n,r=this,i=r.base;return r.base=e,n=t.apply(r,arguments),r.base=i,n}}function r(e,t){return ee(t)&&(t=n(e?e._d?e:n(s,e):s,t),t._d=1),t}function i(e,t){for(var n in t.props)Ve.test(n)&&(e[n]=r(e[n],t.props[n]))}function o(e){return e}function s(){return""}function a(e){try{throw console.log("JsRender dbg breakpoint: "+e),"dbg breakpoint"}catch(t){}return this.base?this.baseApply(arguments):e}function d(e){this.name=(t.link?"JsViews":"JsRender")+" Error",this.message=e||this.name}function u(e,t){for(var n in t)e[n]=t[n];return e}function l(e,t,n){return e?te(e)?l.apply(X,e):(ae.delimiters=[e,t,ge=n?n.charAt(0):ge],le=e.charAt(0),pe=e.charAt(1),ce=t.charAt(0),fe=t.charAt(1),e="\\"+le+"(\\"+ge+")?\\"+pe,t="\\"+ce+"\\"+fe,G="(?:(\\w+(?=[\\/\\s\\"+ce+"]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^\\"+ce+"]|\\"+ce+"(?!\\"+fe+"))*?)",se.rTag="(?:"+G+")",G=new RegExp("(?:"+e+G+"(\\/)?|\\"+le+"(\\"+ge+")?\\"+pe+"(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))"+t,"g"),se.rTmpl=new RegExp("<.*>|([^\\\\]|^)[{}]|"+e+".*"+t),ue):ae.delimiters}function p(e,t){t||e===!0||(t=e,e=void 0);var n,r,i,o,s=this,a=!t||"root"===t;if(e){if(o=t&&s.type===t&&s,!o)if(n=s.views,s._.useKey){for(r in n)if(o=t?n[r].get(e,t):n[r])break}else for(r=0,i=n.length;!o&&r0&&(s=n)){if(!s)if(/^\.\/[^\\:*?"<>]*$/.test(n))(a=ne[e=e||n])?n=a:s=document.getElementById(n);else if(t.fn&&!se.rTmpl.test(n))try{s=t(document).find(n)[0]}catch(d){}s&&(i?n=s.innerHTML:(o=s.getAttribute(Se),o?o!==Ie?(n=ne[o],delete ne[o]):t.fn&&(n=t.data(s)[Ie]):(e=e||(t.fn?Ie:n),n=j(e,s.innerHTML,r,i)),n.tmplName=e=e||o,e!==Ie&&(ne[e]=n),s.setAttribute(Se,e),t.fn&&t.data(s,Ie,n))),s=void 0}else n.fn||(n=void 0);return n}var s,a,d=n=n||"";if(0===i&&(i=void 0,d=o(d)),i=i||(n.markup?n:{}),i.tmplName=e,r&&(i._parentTmpl=r),!d&&n.markup&&(d=o(n.markup))&&d.fn&&(d=d.markup),void 0!==d)return d.fn||n.fn?d.fn&&(a=d):(n=V(d,i),O(d.replace(ye,"\\$&"),n)),a||(a=u(function(){return a.render.apply(a,arguments)},n),b(a)),e&&!r&&e!==Ie&&(Ue[e]=a),a}function C(e,n){return t.isFunction(e)?e.call(n):e}function T(e){var t,n=[],r=e.length;for(t=0;tF-(q||0))){if(q=S.slice(q,F+r.length),J!==!0)if(K=o||p[g-1].bd,P=K[K.length-1],P&&P.prm){for(;P.sb&&P.sb.prm;)P=P.sb;B=P.sb={path:P.sb,bnd:P.bnd}}else K.push(B={path:K.pop()});M=pe+":"+q+" onerror=''"+ce,J=f[M],J||(f[M]=!0,f[M]=J=O(M,n,!0)),J!==!0&&B&&(B._jsv=J,B.prm=l.bd,B.bnd=B.bnd||B.path&&B.path.indexOf("^")>=0)}return d?(d=!V,d?r:A+'"'):a?(a=!R,a?r:A+'"'):(w?(h[g]=F++,l=p[++g]={bd:[]},w):"")+(N?g?"":(c=S.slice(c,F),(i?(i=s=o=!1,"\b"):"\b,")+c+(c=F+r.length,u&&t.push(l.bd=[]),"\b")):k?(g&&I(e),u&&t.pop(),i=_,s=x,c=F+r.length,u&&(u=l.bd=t[i]=[],u.skp=!x),_+":"):_?_.split("^").join(".").replace(we,U)+(C?(l=p[++g]={bd:[]},v[g]=L,C):b):b?b:$?($=v[g]||$,v[g]=!1,l=p[--g],$+(C?(l=p[++g],v[g]=L,C):"")):T?(v[g]||I(e),","):m?"":(d=V,a=R,'"'))}I(e)}var i,o,s,a,d,u=t&&t[0],l={bd:u},p={0:l},c=0,f=(n?n.links:u&&(u.links=u.links||{}))||W.tmpl.links,g=0,v={},h={},m=(e+(n?" ":"")).replace(xe,r);return!g&&m||I(e)}function P(e,t,n){var r,i,o,s,a,d,u,l,p,c,f,g,v,h,m,w,x,_,b,y,k,j,C,T,A,R,$,M,E,N,F=0,S=de.useViews||t.useViews||t.tags||t.templates||t.helpers||t.converters,O="",q={},K=e.length;for(""+t===t?(_=n?'data-link="'+t.replace(_e," ").slice(1,-1)+'"':t,t=0):(_=t.tmplName||"unnamed",t.allowCode&&(q.allowCode=!0),t.debug&&(q.debug=!0),f=t.bnds,x=t.tmpls),r=0;r":s+o):(k&&(b=V(j,q),b.tmplName=_+"/"+o,b.useViews=b.useViews||S,P(k,b),S=b.useViews,x.push(b)),A||(y=o,S=S||o&&(!oe[o]||!oe[o].flow),T=O,O=""),C=e[r+1],C=C&&"else"===C[0]),E=M?";\ntry{\nret+=":"\n+",h="",m="",R&&(g||N||s&&s!==Ne)){if($=new Function("data,view,j,u"," // "+_+" "+F+" "+o+"\nreturn {"+a+"};"),$._er=M,$._tag=o,n)return $;U($,g),w='c("'+s+'",view,',c=!0,h=w+F+",",m=")"}if(O+=R?(n?(M?"try{\n":"")+"return ":E)+(c?(c=void 0,S=p=!0,w+(g?(f[F-1]=$,F):"{"+a+"}")+")"):">"===o?(u=!0,"h("+v[0]+")"):(l=!0,"((v="+v[0]+")!=null?v:"+(n?"null)":'"")'))):(d=!0,"\n{view:view,tmpl:"+(k?x.length:"0")+","+a+"},"),y&&!C){if(O="["+O.slice(0,-1)+"]",w='t("'+y+'",view,this,',n||g){if(O=new Function("data,view,j,u"," // "+_+" "+F+" "+y+"\nreturn "+O+";"),O._er=M,O._tag=y,g&&U(f[F-1]=O,g),n)return O;h=w+F+",undefined,",m=")"}O=T+E+w+(F||O)+")",g=0,y=0}M&&(S=!0,O+=";\n}catch(e){ret"+(n?"urn ":"+=")+h+"j._err(e,view,"+M+")"+m+";}"+(n?"":"ret=ret"))}O="// "+_+"\nvar v"+(d?",t=j._tag":"")+(p?",c=j._cnvt":"")+(u?",h=j._html":"")+(n?";\n":',ret=""\n')+(q.debug?"debugger;":"")+O+(n?"\n":";\nreturn ret;"),ae.debugMode!==!1&&(O="try {\n"+O+"\n}catch(e){\nreturn j._err(e, view);\n}");try{O=new Function("data,view,j,u",O)}catch(B){I("Compiled template code:\n\n"+O+'\n: "'+B.message+'"')}return t&&(t.fn=O,t.useViews=!!S),O}function B(e,t){return e&&e!==t?t?u(u({},t),e):e:t&&u({},t)}function L(e){return Ee[e]||(Ee[e]="&#"+e.charCodeAt(0)+";")}function Q(e){var t,n,r=[];if(typeof e===Fe)for(t in e)n=e[t],t!==Y&&e.hasOwnProperty(t)&&!ee(n)&&r.push({key:t,prop:n});return r}function H(e,n,r){var i=this.jquery&&(this[0]||S("Unknown template")),o=i.getAttribute(Se);return E.call(o?t.data(i)[Ie]:ne(i),e,n,r)}function D(e){return void 0!=e?Ae.test(e)&&(""+e).replace($e,L)||e:""}var Z=t===!1;t=t&&t.fn?t:e.jQuery;var z,G,W,X,Y,ee,te,ne,re,ie,oe,se,ae,de,ue,le,pe,ce,fe,ge,ve,he,me="v0.9.83",we=/^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,xe=/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(!*?[#~]?[\w$.^]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=\s*[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g,_e=/[ \t]*(\r\n|\n|\r)/g,be=/\\(['"])/g,ye=/['"\\]/g,ke=/(?:\x08|^)(onerror:)?(?:(~?)(([\w$_\.]+):)?([^\x08]+))\x08(,)?([^\x08]+)/gi,je=/^if\s/,Ce=/<(\w+)[>\s]/,Te=/[\x00`><"'&=]/g,Ae=/[\x00`><\"'&=]/,Ve=/^on[A-Z]|^convert(Back)?$/,Re=/^\#\d+_`[\s\S]*\/\d+_`$/,$e=Te,Me=0,Ee={"&":"&","<":"<",">":">","\0":"�","'":"'",'"':""","`":"`","=":"="},Ne="html",Fe="object",Se="data-jsv-tmpl",Ie="jsvTmpl",Oe="For #index in nested block use #getIndex().",Ue={},qe=e.jsrender,Je=qe&&t&&!t.render,Ke={template:{compile:j},tag:{compile:y},viewModel:{compile:A},helper:{},converter:{}};if(X={jsviews:me,sub:{View:_,Err:d,tmplFn:O,parse:K,extend:u,extendCtx:B,syntaxErr:I,onStore:{},addSetting:$,settings:{allowCode:!1},advSet:s,_ths:i,_tg:function(){},_cnvt:h,_tag:x,_er:S,_err:F,_html:D,_cp:o,_sq:function(e){return"constructor"===e&&I(""),e}},settings:{delimiters:l,advanced:function(e){return e?(u(de,e),se.advSet(),ue):de}},getCtx:o,map:M},(d.prototype=new Error).constructor=d,c.depends=function(){return[this.get("item"),"index"]},f.depends="index",_.prototype={get:p,getIndex:f,getRsc:w,getTmpl:v,hlp:g,_is:"view"},se=X.sub,ue=X.settings,!(qe||t&&t.render)){for(z in Ke)R(z,Ke[z]);re=X.converters,ie=X.helpers,oe=X.tags,se._tg.prototype={baseApply:k,cvtArgs:m},W=se.topView=new _,t?(t.fn.render=H,Y=t.expando,t.observable&&(u(se,t.views.sub),X.map=t.views.map)):(t={},Z&&(e.jsrender=t),t.renderFile=t.__express=t.compile=function(){throw"Node.js: use npm jsrender, or jsrender-node.js"},t.isFunction=function(e){return"function"==typeof e},t.isArray=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},se._jq=function(e){e!==t&&(u(e,t),t=e,t.fn.render=H,delete t.jsrender,Y=t.expando)},t.jsrender=me),ae=se.settings,ae.allowCode=!1,ee=t.isFunction,t.render=Ue,t.views=X,t.templates=ne=X.templates;for(ve in ae)$(ve);(ue.debugMode=function(e){return void 0===e?ae.debugMode:(ae.debugMode=e,ae.onError=e+""===e?new Function("","return '"+e+"';"):ee(e)?e:void 0,ue)})(!1),de=ae.advanced={useViews:!1,_jsv:!1},oe({"if":{render:function(e){var t=this,n=t.tagCtx,r=t.rendering.done||!e&&(arguments.length||!n.index)?"":(t.rendering.done=!0,t.selected=n.index,n.render(n.view,!0));return r},flow:!0},"for":{render:function(e){var t,n=!arguments.length,r=this,i=r.tagCtx,o="",s=0;return r.rendering.done||(t=n?i.view.data:e,void 0!==t&&(o+=i.render(t,n),s+=te(t)?t.length:1),(r.rendering.done=s)&&(r.selected=i.index)),o},flow:!0},props:{baseTag:"for",dataMap:M(Q),flow:!0},include:{flow:!0},"*":{render:o,flow:!0},":*":{render:o,flow:!0},dbg:ie.dbg=re.dbg=a}),re({html:D,attr:D,url:function(e){return void 0!=e?encodeURI(""+e):null===e?e:""}})}return ae=se.settings,te=(t||qe).isArray,ue.delimiters("{{","}}","^"),Je&&qe.views.sub._jq(t),t||qe},window); //# sourceMappingURL=jsrender.min.js.map