(function(n){function o(i,r,f,o){var s={data:o||o===0||o===!1?o:r?r.data:{},_wrap:r?r._wrap:null,tmpl:null,parent:r||null,nodes:[],calls:d,nest:g,wrap:nt,html:tt,update:it};return i&&n.extend(s,i,{nodes:[],parent:r}),f&&(s.tmpl=f,s._ctnt=s._ctnt||s.tmpl(n,s),s.key=++e,(c.length?u:t)[e]=s),s}function s(t,i,u){var f,e=u?n.map(u,function(n){return typeof n=="string"?t.key?n.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+r+'="'+t.key+'" $2'):n:s(n,t,n._ctnt)}):t;return i?e:(e=e.join(""),e.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(t,i,r,u){f=n(r).get();b(f);i&&(f=l(i).concat(f));u&&(f=f.concat(l(u)))}),f?f:l(e))}function l(t){var i=document.createElement("div");return i.innerHTML=t,n.makeArray(i.childNodes)}function p(t){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+n.trim(t).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(t,i,r,u,f,e,o){var c=n.tmpl.tag[r],l,s,a;if(!c)throw"Unknown template tag: "+r;return l=c._default||[],e&&!/\w$/.test(f)&&(f+=e,e=""),f?(f=h(f),o=o?","+h(o)+")":e?")":"",s=e?f.indexOf(".")>-1?f+h(e):"("+f+").call($item"+o:f,a=e?s:"(typeof("+f+")==='function'?("+f+").call($item):("+f+"))"):a=s=l.$1||"null",u=h(u),"');"+c[i?"close":"open"].split("$notnull_1").join(f?"typeof("+f+")!=='undefined' && ("+f+")!=null":"true").split("$1a").join(a).split("$1").join(s).split("$2").join(u||l.$2||"")+"__.push('"})+"');}return __;")}function w(t,i){t._wrap=s(t,!0,n.isArray(i)?i:[v.test(i)?i:n(i).html()]).join("")}function h(n){return n?n.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function k(n){var t=document.createElement("div");return t.appendChild(n.cloneNode(!0)),t.innerHTML}function b(f){function p(f){function p(n){n=n+a;s=v[n]=v[n]||o(s,t[s.parent.key+a]||s.parent)}var y,h=f,c,s,l;if(l=f.getAttribute(r)){while(h.parentNode&&(h=h.parentNode).nodeType===1&&!(y=h.getAttribute(r)));y!==l&&(h=h.parentNode?h.nodeType===11?0:h.getAttribute(r)||0:0,(s=t[l])||(s=u[l],s=o(s,t[h]||u[h]),s.key=++e,t[e]=s),i&&p(l));f.removeAttribute(r)}else i&&(s=n.data(f,"tmplItem"))&&(p(s.key),t[s.key]=s,h=n.data(f.parentNode,"tmplItem"),h=h?h.key:0);if(s){for(c=s;c&&c.key!=h;)c.nodes.push(f),c=c.parent;delete s._ctnt;delete s._wrap;n.data(f,"tmplItem",s)}}for(var a="_"+i,c,l,v={},h,s=0,y=f.length;s=0;h--)p(l[h]);p(c)}}function d(n,t,i,r){if(!n)return c.pop();c.push({_:n,tmpl:t,item:this,data:i,options:r})}function g(t,i,r){return n.tmpl(n.template(t),i,r,this)}function nt(t,i){var r=t.options||{};return r.wrapped=i,n.tmpl(n.template(t.tmpl),t.data,r,t.item)}function tt(t,i){var r=this._wrap;return n.map(n(n.isArray(r)?r.join(""):r).filter(t||"*"),function(n){return i?n.innerText||n.textContent:n.outerHTML||k(n)})}function it(){var t=this.nodes;n.tmpl(null,null,null,this).insertBefore(t[0]);n(t).remove()}var a=n.fn.domManip,r="_tmplitem",v=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,t={},u={},f,y={key:0,data:{}},e=0,i=0,c=[];n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(r,u){n.fn[r]=function(e){var o=[],h=n(e),c,s,a,v,l=this.length===1&&this[0].parentNode;if(f=t||{},l&&l.nodeType===11&&l.childNodes.length===1&&h.length===1)h[u](this[0]),o=this;else{for(s=0,a=h.length;s0?this.clone(!0):this).get(),n(h[s])[u](c),o=o.concat(c);i=0;o=this.pushStack(o,r,h.selector)}return v=f,f=null,n.tmpl.complete(v),o}});n.fn.extend({tmpl:function(t,i,r){return n.tmpl(this[0],t,i,r)},tmplItem:function(){return n.tmplItem(this[0])},template:function(t){return n.template(t,this[0])},domManip:function(r,u,e){if(r[0]&&n.isArray(r[0])){for(var o=n.makeArray(arguments),s=r[0],l=s.length,h=0,c;h").join(">").split('"').join(""").split("'").join("'")}});n.extend(n.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(){t={}},afterManip:function(t,r,u){var f=r.nodeType===11?n.makeArray(r.childNodes):r.nodeType===1?[r]:[];u.call(t,r);b(f);i++}})})(jQuery)