(function(){var moduleFactory=function($){var module=this;$.require().script("mvc/view","mvc/lang.string.rsplit").done(function(){var exports=function(){var myEval=function(script){eval(script)},rSplit=$.String.rsplit,extend=$.extend,isArray=$.isArray,returnReg=/\r\n/g,retReg=/\r/g,newReg=/\n/g,nReg=/\n/,slashReg=/\\/g,quoteReg=/"/g,singleQuoteReg=/'/g,tabReg=/\t/g,leftBracket=/\{/g,rightBracket=/\}/g,quickFunc=/\s*\(([\$\w]+)\)\s*->([^\n]*)/,clean=function(e){return e.replace(slashReg,"\\\\").replace(newReg,"\\n").replace(quoteReg,'\\"').replace(tabReg,"\\t")},escapeHTML=function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(quoteReg,"&#34;").replace(singleQuoteReg,"&#39;")},$View=$.View,bracketNum=function(e){var t=e.match(leftBracket),n=e.match(rightBracket);return(t?t.length:0)-(n?n.length:0)},EJS=function(e){if(this.constructor!=EJS){var t=new EJS(e);return function(e,n){return t.render(e,n)}}if(typeof e=="function"){this.template={fn:e};return}extend(this,EJS.options,e),this.template=compile(this.text,this.type,this.name)};$&&($.EJS=EJS),EJS.prototype.render=function(e,t){e=e||{},this._extra_helpers=t;var n=new EJS.Helpers(e,t||{});return this.template.fn.call(e,e,n)},extend(EJS,{text:function(e){if(typeof e=="string")return e;if(e===null||e===undefined)return"";var t=e.hookup&&function(t,n){e.hookup.call(e,t,n)}||typeof e=="function"&&e||isArray(e)&&function(t,n){for(var r=0;r<e.length;r++)e[r].hookup?e[r].hookup(t,n):e[r](t,n)};return t?"data-view-id='"+$View.hookup(t)+"'":e.toString?e+"":""},clean:function(e){return typeof e=="string"?escapeHTML(e):typeof e=="number"?e:EJS.text(e)},options:{type:"<",ext:".ejs"}});var scan=function(e,t,n){var r=rSplit(t,nReg),i=0;for(;i<r.length;i++)scanline(e,r[i],n)},scanline=function(e,t,n){e.lines++;var r=rSplit(t,e.splitter),i;for(var s=0;s<r.length;s++)i=r[s],i!==null&&n(i,e)},makeScanner=function(e,t){var n={};return extend(n,{left:e+"@",right:"@"+t,dLeft:e+"@@",dRight:"@@"+t,eeLeft:e+"@==",eLeft:e+"@=",cmnt:e+"@#",cleanLeft:e+"@~",scan:scan,lines:0}),n.splitter=RegExp("("+[n.dLeft,n.dRight,n.eeLeft,n.eLeft,n.cmnt,n.left,n.right+"\n",n.right,"\n"].join(")|(").replace(/\[/g,"\\[").replace(/\]/g,"\\]")+")"),n},compile=function(e,t,n){e=e.replace(returnReg,"\n").replace(retReg,"\n"),t=t||"<";var r="___v1ew.push(",i=r,s="var ___v1ew = [];",o="return ___v1ew.join('')",u=new EJS.Buffer([s],[]),a="",f=function(e){u.push(r,'"',clean(e),'");')},l=null,c=function(){a=""},h="));",p=[];scan(makeScanner(t,t==="["?"]":">"),e||"",function(e,t){var n;if(l===null)switch(e){case"\n":a+="\n",f(a),u.cr(),c();break;case t.left:case t.eLeft:case t.eeLeft:case t.cmnt:l=e,a.length>0&&f(a),c();break;case t.dLeft:a+=t.left;break;default:a+=e}else switch(e){case t.right:switch(l){case t.left:n=bracketNum(a);var r=p.length&&n==-1?p.pop():";";r===h&&u.push(o),u.push(a,r),n===1&&p.push(";");break;case t.eLeft:n=bracketNum(a),n&&p.push(h);if(quickFunc.test(a)){var d=a.match(quickFunc);a="function(__){var "+d[1]+"=$(__);"+d[2]+"}"}u.push(i,$.globalNamespace+".EJS.clean(",a,n?s:h);break;case t.eeLeft:n=bracketNum(a),n&&p.push(h),u.push(i,$.globalNamespace+".EJS.text(",a,n?s:h)}l=null,c();break;case t.dRight:a+=t.right;break;default:a+=e}}),a.length>0&&u.push(r,'"',clean(a)+'");');var d=u.close(),v={out:"try { with(_VIEW) { with (_CONTEXT) {"+d+" "+o+"}}}catch(e){e.lineNumber=null;throw e;}"};return myEval.call(v,"this.fn = (function(_CONTEXT,_VIEW){"+v.out+"});"),v};EJS.Buffer=function(e,t){this.line=[],this.script=[],this.post=t,this.push.apply(this,e)},EJS.Buffer.prototype={push:function(){this.line.push.apply(this.line,arguments)},cr:function(){this.script.push(this.line.join(""),"\n"),this.line=[]},close:function(){return this.line.length>0&&(this.script.push(this.line.join("")),this.line=[]),this.post.length&&this.push.apply(this,this.post),this.script.push(";"),this.script.join("")}},EJS.Helpers=function(e,t){this._data=e,this._extras=t,extend(this,t)},EJS.Helpers.prototype={plugin:function(e){var t=$.makeArray(arguments),n=t.shift();return function(e){var r=$(e);r[n].apply(r,t)}},view:function(e,t,n){return n=n||this._extras,t=t||this._data,$View(e,t,n)}},$View.register({suffix:"ejs",script:function(e,t){return $.globalNamespace+".EJS(function(_CONTEXT,_VIEW) { "+(new EJS({text:t,name:e})).template.out+" })"},renderer:function(e,t){return EJS({text:t,name:e})}})};exports(),module.resolveWith(exports)})};dispatch("mvc/view.ejs").containing(moduleFactory).to("Foundry/2.1 Modules")})();