(function(){var e=function(e){var t=this;e.require().script("mvc/controller","mvc/view").done(function(){var n=function(){var t=steal.URI||steal.File;e.Controller.getFolder=function(){return e.String.underscore(this.fullName.replace(/\./g,"/")).replace("/Controllers","")},e.Controller._calculatePosition=function(n,r,i){var s=n.fullName.split("."),o=s.slice(0);o.splice(0,2);var u=o.join("/"),a=s.length>2&&s[1]=="Controllers",f=a?e.String.underscore(s[0]):e.String.underscore(s.join("/")),l=e.String.underscore(o.join("/")).toLowerCase(),c=typeof r=="string"&&/\.[\w\d]+$/.test(r)?"":e.View.ext;return typeof r=="string"?r.substr(0,2)!="//"&&(r="//"+t(f).join("views/"+(r.indexOf("/")!==-1?r:(a?l+"/":"")+r))+c):r||(r="//"+t(f).join("views/"+(a?l+"/":"")+i.replace(/\.|#/g,"").replace(/ /g,"_"))+c),r};var n=function(t){var n={};if(t)if(e.isArray(t))for(var r=0;r<t.length;r++)e.extend(n,t[r]);else e.extend(n,t);else{this._default_helpers&&(n=this._default_helpers);var i=window,s=this.constructor.fullName.split(/\./);for(var o=0;o<s.length;o++)i&&(typeof i.Helpers=="object"&&e.extend(n,i.Helpers),i=i[s[o]]);i&&typeof i.Helpers=="object"&&e.extend(n,i.Helpers),this._default_helpers=n}return n};e.Controller.prototype.view=function(t,r,i){typeof t!="string"&&!i&&(i=r,r=t,t=null),t=e.Controller._calculatePosition(this.Class,t,this.called),r=r||this;var s=n.call(this,i);return e.View(t,r,s)}};n(),t.resolveWith(n)})};dispatch("mvc/controller.view").containing(e).to("Foundry/2.1 Modules")})();