UNPKG

37 kBJavaScriptView Raw
1var require=function(e,t){var r=require.resolve(e,t||"/"),n=require.modules[r];if(!n)throw Error("Failed to resolve module "+e+", tried "+r);var s=require.cache[r],i=s?s.exports:n();return i};require.paths=[],require.modules={},require.cache={},require.extensions=[".js",".coffee",".json"],require._core={assert:!0,events:!0,fs:!0,path:!0,vm:!0},require.resolve=function(){return function(e,t){function r(e){if(e=o.normalize(e),require.modules[e])return e;for(var t=0;require.extensions.length>t;t++){var r=require.extensions[t];if(require.modules[e+r])return e+r}}function n(e){e=e.replace(/\/+$/,"");var t=o.normalize(e+"/package.json");if(require.modules[t]){var n=require.modules[t](),s=n.browserify;if("object"==typeof s&&s.main){var i=r(o.resolve(e,s.main));if(i)return i}else if("string"==typeof s){var i=r(o.resolve(e,s));if(i)return i}else if(n.main){var i=r(o.resolve(e,n.main));if(i)return i}}return r(e+"/index")}function s(e,t){for(var s=i(t),o=0;s.length>o;o++){var a=s[o],c=r(a+"/"+e);if(c)return c;var l=n(a+"/"+e);if(l)return l}var c=r(e);return c?c:void 0}function i(e){var t;t="/"===e?[""]:o.normalize(e).split("/");for(var r=[],n=t.length-1;n>=0;n--)if("node_modules"!==t[n]){var s=t.slice(0,n+1).join("/")+"/node_modules";r.push(s)}return r}if(t||(t="/"),require._core[e])return e;var o=require.modules.path();t=o.resolve("/",t);var a=t||"/";if(e.match(/^(?:\.\.?\/|\/)/)){var c=r(o.resolve(a,e))||n(o.resolve(a,e));if(c)return c}var l=s(e,a);if(l)return l;throw Error("Cannot find module '"+e+"'")}}(),require.alias=function(e,t){var r=require.modules.path(),n=null;try{n=require.resolve(e+"/package.json","/")}catch(s){n=require.resolve(e,"/")}for(var i=r.dirname(n),o=(Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t})(require.modules),a=0;o.length>a;a++){var c=o[a];if(c.slice(0,i.length+1)===i+"/"){var l=c.slice(i.length);require.modules[t+l]=require.modules[i+l]}else c===i&&(require.modules[t]=require.modules[i])}},function(){var e={},t="undefined"!=typeof window?window:{},r=!1;require.define=function(n,s){!r&&require.modules.__browserify_process&&(e=require.modules.__browserify_process(),r=!0);var i=require._core[n]?"":require.modules.path().dirname(n),o=function(e){var t=require(e,i),r=require.cache[require.resolve(e,i)];return r&&null===r.parent&&(r.parent=a),t};o.resolve=function(e){return require.resolve(e,i)},o.modules=require.modules,o.define=require.define,o.cache=require.cache;var a={id:n,filename:n,exports:{},loaded:!1,parent:null};require.modules[n]=function(){return require.cache[n]=a,s.call(a.exports,o,a,a.exports,i,n,e,t),a.loaded=!0,a.exports}}}(),require.define("path",function(e,t,r,n,s,i){function o(e,t){for(var r=[],n=0;e.length>n;n++)t(e[n],n,e)&&r.push(e[n]);return r}function a(e,t){for(var r=0,n=e.length;n>=0;n--){var s=e[n];"."==s?e.splice(n,1):".."===s?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var c=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;r.resolve=function(){for(var e="",t=!1,r=arguments.length;r>=-1&&!t;r--){var n=r>=0?arguments[r]:i.cwd();"string"==typeof n&&n&&(e=n+"/"+e,t="/"===n.charAt(0))}return e=a(o(e.split("/"),function(e){return!!e}),!t).join("/"),(t?"/":"")+e||"."},r.normalize=function(e){var t="/"===e.charAt(0),r="/"===e.slice(-1);return e=a(o(e.split("/"),function(e){return!!e}),!t).join("/"),e||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(o(e,function(e){return e&&"string"==typeof e}).join("/"))},r.dirname=function(e){var t=c.exec(e)[1]||"",r=!1;return t?1===t.length||r&&3>=t.length&&":"===t.charAt(1)?t:t.substring(0,t.length-1):"."},r.basename=function(e,t){var r=c.exec(e)[2]||"";return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},r.extname=function(e){return c.exec(e)[3]||""},r.relative=function(e,t){function n(e){for(var t=0;e.length>t&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var s=n(e.split("/")),i=n(t.split("/")),o=Math.min(s.length,i.length),a=o,c=0;o>c;c++)if(s[c]!==i[c]){a=c;break}for(var l=[],c=a;s.length>c;c++)l.push("..");return l=l.concat(i.slice(a)),l.join("/")}}),require.define("__browserify_process",function(e,t,r,n,s,i){var i=t.exports={};i.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",function(e){if(e.source===window&&"browserify-tick"===e.data&&(e.stopPropagation(),r.length>0)){var t=r.shift();t()}},!0),function(e){r.push(e),window.postMessage("browserify-tick","*")}}return function(e){setTimeout(e,0)}}(),i.title="browser",i.browser=!0,i.env={},i.argv=[],i.binding=function(t){if("evals"===t)return e("vm");throw Error("No such module. (Possibly not yet loaded)")},function(){var t,r="/";i.cwd=function(){return r},i.chdir=function(n){t||(t=e("path")),r=t.resolve(n,r)}}()}),require.define("/haml-coffee.coffee",function(e,t){(function(){var r,n,s,i,o,a,c,l,u,h;c=e("./nodes/node"),l=e("./nodes/text"),o=e("./nodes/haml"),r=e("./nodes/code"),n=e("./nodes/comment"),i=e("./nodes/filter"),s=e("./nodes/directive"),h=e("./util/text").whitespace,u=e("./util/text").indent,t.exports=a=function(){function e(e){var t,r,n,s,i,o,a,c,l,u,h,p,f,d,m,v,g,w,x,b,y,k,T,C,_,$,L,A,q,E,P,O;if(this.options=null!=e?e:{},null==(x=(n=this.options).placement)&&(n.placement="global"),null==(b=(s=this.options).dependencies)&&(s.dependencies={hc:"hamlcoffee"}),null==(_=(l=this.options).escapeHtml)&&(l.escapeHtml=!0),null==($=(u=this.options).escapeAttributes)&&(u.escapeAttributes=!0),null==(L=(h=this.options).cleanValue)&&(h.cleanValue=!0),null==(A=(p=this.options).uglify)&&(p.uglify=!1),null==(q=(f=this.options).basename)&&(f.basename=!1),null==(E=(d=this.options).extendScope)&&(d.extendScope=!1),null==(P=(m=this.options).format)&&(m.format="html5"),null==(O=(v=this.options).hyphenateDataAttrs)&&(v.hyphenateDataAttrs=!0),null==(y=(i=this.options).preserveTags)&&(i.preserveTags="pre,textarea"),null==(k=(o=this.options).selfCloseTags)&&(o.selfCloseTags="meta,img,link,br,hr,input,area,param,col,base"),"global"===this.options.placement)if(null==(T=(a=this.options).name)&&(a.name="test"),null==(C=(c=this.options).namespace)&&(c.namespace="window.HAML"),r=(""+this.options.namespace+"."+this.options.name).replace(/(\s|-)+/g,"_").split(/\./),this.options.name=this.options.basename?r.pop().split(/\/|\\/).pop():r.pop(),this.options.namespace=r.shift(),this.intro="",0!==r.length)for(g=0,w=r.length;w>g;g++)t=r[g],this.options.namespace+="."+t,this.intro+=""+this.options.namespace+" ?= {}\n";else this.intro+=""+this.options.namespace+" ?= {}\n"}return e.VERSION="1.11.0",e.prototype.indentChanged=function(){return this.currentIndent!==this.previousIndent},e.prototype.isIndent=function(){return this.currentIndent>this.previousIndent},e.prototype.updateTabSize=function(){return 0===this.tabSize?this.tabSize=this.currentIndent-this.previousIndent:void 0},e.prototype.updateBlockLevel=function(){if(this.currentBlockLevel=this.currentIndent/this.tabSize,this.currentBlockLevel-Math.floor(this.currentBlockLevel)>0)throw"Indentation error in line "+this.lineNumber;if((this.currentIndent-this.previousIndent)/this.tabSize>1&&!this.node.isCommented())throw"Block level too deep in line "+this.lineNumber;return this.delta=this.previousBlockLevel-this.currentBlockLevel},e.prototype.updateCodeBlockLevel=function(e){return this.currentCodeBlockLevel=e instanceof r?e.codeBlockLevel+1:e.codeBlockLevel},e.prototype.updateParent=function(){return this.isIndent()?this.pushParent():this.popParent()},e.prototype.pushParent=function(){return this.stack.push(this.parentNode),this.parentNode=this.node},e.prototype.popParent=function(){var e,t,r,n;for(n=[],e=t=0,r=this.delta-1;r>=0?r>=t:t>=r;e=r>=0?++t:--t)n.push(this.parentNode=this.stack.pop());return n},e.prototype.getNodeOptions=function(e){return null==e&&(e={}),{parentNode:e.parentNode||this.parentNode,blockLevel:e.blockLevel||this.currentBlockLevel,codeBlockLevel:e.codeBlockLevel||this.currentCodeBlockLevel,escapeHtml:e.escapeHtml||this.options.escapeHtml,escapeAttributes:e.escapeAttributes||this.options.escapeAttributes,cleanValue:e.cleanValue||this.options.cleanValue,format:e.format||this.options.format,hyphenateDataAttrs:e.hyphenateDataAttrs||this.options.format,preserveTags:e.preserveTags||this.options.preserveTags,selfCloseTags:e.selfCloseTags||this.options.selfCloseTags,uglify:e.uglify||this.options.uglify,placement:e.placement||this.options.placement,namespace:e.namespace||this.options.namespace,name:e.name||this.options.name}},e.prototype.nodeFactory=function(e){var t,a,c;return null==e&&(e=""),a=this.getNodeOptions(),t=e.match(/^:(escaped|preserve|css|javascript|plain|cdata|coffeescript)/)?new i(e,a):e.match(/^(\/|-#)(.*)/)?new n(e,a):e.match(/^(-#|-|=|!=|\&=|~)\s*(.*)/)?new r(e,a):e.match(/^(%|#[^{]|\.|\!)(.*)/)?new o(e,a):e.match(/^\+(.*)/)?new s(e,a):new l(e,a),null!=(c=a.parentNode)&&c.addChild(t),t},e.prototype.parse=function(e){var t,r,n,s,o,a,u,h;for(null==e&&(e=""),this.lineNumber=this.previousIndent=this.tabSize=this.currentBlockLevel=this.previousBlockLevel=0,this.currentCodeBlockLevel=this.previousCodeBlockLevel=0,this.node=null,this.stack=[],this.root=this.parentNode=new c("",this.getNodeOptions()),s=e.split("\n");void 0!==(n=s.shift());){if(this.node instanceof i&&!this.exitFilter)if(/^(\s)*$/.test(n))this.node.addChild(new l("",this.getNodeOptions({parentNode:this.node})));else{if(o=n.match(/^(\s*)(.*)/),u=o[1],r=o[2],this.node.blockLevel>=u.length/2){this.exitFilter=!0,s.unshift(n);continue}a=n.match(RegExp("^\\s{"+(2*this.node.blockLevel+2)+"}(.*)")),a&&this.node.addChild(new l(a[1],this.getNodeOptions({parentNode:this.node})))}else{if(this.exitFilter=!1,o=n.match(/^(\s*)(.*)/),u=o[1],r=o[2],/^\s*$/.test(n))continue;for(;/^[%.#].*[{(]/.test(r)&&!/^(\s*)[-=&!~.%#</]/.test(s[0])&&/([-\w]+[\w:-]*\w?)\s*=|('\w+[\w:-]*\w?')\s*=|("\w+[\w:-]*\w?")\s*=|(\w+[\w:-]*\w?):|('[-\w]+[\w:-]*\w?'):|("[-\w]+[\w:-]*\w?"):|:(\w+[\w:-]*\w?)\s*=>|:?'([-\w]+[\w:-]*\w?)'\s*=>|:?"([-\w]+[\w:-]*\w?)"\s*=>/.test(s[0]);)t=s.shift(),r=r.replace(/(\s)+\|\s*$/,""),r+=" "+t.match(/^\s*(.*?)(\s+\|\s*)?$/)[1],this.lineNumber++;if(r.match(/(\s)+\|\s*$/))for(r=r.replace(/(\s)+\|\s*$/," ");null!=(h=s[0])?h.match(/(\s)+\|$/):void 0;)r+=s.shift().match(/^(\s*)(.*)/)[2].replace(/(\s)+\|\s*$/,""),this.lineNumber++;this.currentIndent=u.length,this.indentChanged()&&(this.updateTabSize(),this.updateBlockLevel(),this.updateParent(),this.updateCodeBlockLevel(this.parentNode)),this.node=this.nodeFactory(r),this.previousBlockLevel=this.currentBlockLevel,this.previousIndent=this.currentIndent}this.lineNumber++}return this.evaluate(this.root)},e.prototype.evaluate=function(e){var t,r,n,s;for(s=e.children,r=0,n=s.length;n>r;r++)t=s[r],this.evaluate(t);return e.evaluate()},e.prototype.render=function(){switch(this.options.placement){case"amd":return this.renderAmd();case"standalone":return this.renderStandalone();default:return this.renderGlobal()}},e.prototype.renderStandalone=function(){var e;return e="return (context) ->\n (->\n"+u(this.precompile(),2)+"\n ).call(context)"},e.prototype.renderAmd=function(){var e,t,r,n,s,i,o,a;/^hamlcoffee/.test(this.options.dependencies.hc)&&(this.options.customHtmlEscape="hc.escape",this.options.customCleanValue="hc.cleanValue",this.options.customPreserve="hc.preserve",this.options.customFindAndPreserve="hc.findAndPreserve",this.options.customSurround="hc.surround",this.options.customSucceed="hc.succeed",this.options.customPrecede="hc.precede",this.options.customReference="hc.reference"),r=[],s=[],o=this.options.dependencies;for(n in o)t=o[n],r.push(t),s.push(n);i=u(this.precompile(),4),a=this.findDependencies(i);for(n in a)t=a[n],r.push(t),s.push(n);return 0!==r.length?(r=function(){var t,n,s;for(s=[],t=0,n=r.length;n>t;t++)e=r[t],s.push("'"+e+"'");return s}(),r="["+r+"], ("+s.join(", ")+")"):r="","define "+r+" ->\n (context) ->\n render = ->\n \n"+i+"\n render.call(context)"},e.prototype.renderGlobal=function(){var e;return e=this.intro,this.options.extendScope?(e+=""+this.options.namespace+"['"+this.options.name+"'] = (context) -> ( ->\n",e+=" `with (context || {}) {`\n",e+=""+u(this.precompile(),1),e+="`}`\n",e+=").call(context)"):(e+=""+this.options.namespace+"['"+this.options.name+"'] = (context) -> ( ->\n",e+=""+u(this.precompile(),1),e+=").call(context)"),e},e.prototype.precompile=function(){var e,t;return t="",e=this.createCode(),-1!==e.indexOf("$e")&&(t+=this.options.customHtmlEscape?"$e = "+this.options.customHtmlEscape+"\n":"$e = (text, escape) ->\n \"#{ text }\"\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/'/g, '&#39;')\n .replace(/\\//g, '&#47;')\n .replace(/\"/g, '&quot;')\n"),-1!==e.indexOf("$c")&&(this.options.customCleanValue?t+="$c = "+this.options.customCleanValue+"\n":(t+="$c = (text) ->\n",t+=" switch text\n",t+=" when null, undefined then ''\n",t+=" when true, false then '“' + text\n",t+=" else text\n")),(-1!==e.indexOf("$p")||-1!==e.indexOf("$fp"))&&(t+=this.options.customPreserve?"$p = "+this.options.customPreserve+"\n":"$p = (text) -> text.replace /\\n/g, '&#x000A;'\n"),-1!==e.indexOf("$fp")&&(t+=this.options.customFindAndPreserve?"$fp = "+this.options.customFindAndPreserve+"\n":"$fp = (text) ->\n text.replace /<("+this.options.preserveTags.split(",").join("|")+')>([^]*?)<\\/\\1>/g, (str, tag, content) ->\n "<#{ tag }>#{ $p content }</#{ tag }>"\n'),-1!==e.indexOf("surround")&&(t+=this.options.customSurround?"surround = (start, end, fn) => "+this.options.customSurround+".call(@, start, end, fn)\n":"surround = (start, end, fn) => start + fn.call(@)?.replace(/^s+|s+$/g, '') + end\n"),-1!==e.indexOf("succeed")&&(t+=this.options.customSucceed?"succeed = (start, end, fn) => "+this.options.customSucceed+".call(@, start, end, fn)\n":"succeed = (end, fn) => fn.call(@)?.replace(/s+$/g, '') + end\n"),-1!==e.indexOf("precede")&&(t+=this.options.customPrecede?"precede = (start, end, fn) => "+this.options.customPrecede+".call(@, start, end, fn)\n":"precede = (start, fn) => start + fn.call(@)?.replace(/^s+/g, '')\n"),-1!==e.indexOf("$r")&&(t+=this.options.customReference?"$r = "+this.options.customReference+"\n":"$r = (object, prefix) ->\n name = if prefix then prefix + '_' else ''\n\n if typeof(object.hamlObjectRef) is 'function'\n name += object.hamlObjectRef()\n else\n name += (object.constructor?.name || 'object').replace(/W+/g, '_').replace(/([a-zd])([A-Z])/g, '$1_$2').toLowerCase()\n\n id = if typeof(object.to_key) is 'function'\n object.to_key()\n else if typeof(object.id) is 'function'\n object.id()\n else if object.id\n object.id\n else\n object\n\n result = \"class='#{ name }'\"\n result += \" id='#{ name }_#{ id }'\" if id\n"),t+="$o = []\n",t+=""+e+"\n",t+='return $o.join("\\n")'+this.convertBooleans(e)+this.removeEmptyIDAndClass(e)+this.cleanupWhitespace(e)+"\n"},e.prototype.createCode=function(){var e,t,r,n,s,i,o,a,c,l;for(t=[],this.lines=[],c=this.root.children,s=0,o=c.length;o>s;s++)e=c[s],this.lines=this.lines.concat(e.render());for(this.lines=this.combineText(this.lines),this.blockLevel=0,l=this.lines,i=0,a=l.length;a>i;i++)if(r=l[i],null!==r)switch(r.type){case"text":t.push(""+h(r.cw)+this.getBuffer(this.blockLevel)+'.push "'+h(r.hw)+r.text+'"');break;case"run":"end"!==r.block?t.push(""+h(r.cw)+r.code):(t.push(""+h(r.cw)+r.code.replace("$buffer",this.getBuffer(this.blockLevel))),this.blockLevel-=1);break;case"insert":n="",r.findAndPreserve&&(n+="$fp "),r.preserve&&(n+="$p "),r.escape&&(n+="$e "),this.options.cleanValue&&(n+="$c "),t.push(""+h(r.cw)+this.getBuffer(this.blockLevel)+'.push "'+h(r.hw)+'" + '+n+r.code),"start"===r.block&&(this.blockLevel+=1,t.push(""+h(r.cw+1)+this.getBuffer(this.blockLevel)+" = []"))}return t.join("\n")},e.prototype.getBuffer=function(e){return e>0?"$o"+e:"$o"},e.prototype.combineText=function(e){var t,r,n;for(t=[];void 0!==(r=e.shift());){if("text"===r.type)for(;e[0]&&"text"===e[0].type&&r.cw===e[0].cw;)n=e.shift(),r.text+="\\n"+h(n.hw)+n.text;t.push(r)}return t},e.prototype.convertBooleans=function(e){return-1!==e.indexOf("$c")?"xhtml"===this.options.format?".replace(/\\s(\\w+)='“true'/mg, \" $1='$1'\").replace(/\\s(\\w+)='“false'/mg, '')":".replace(/\\s(\\w+)='“true'/mg, ' $1').replace(/\\s(\\w+)='“false'/mg, '')":""},e.prototype.removeEmptyIDAndClass=function(e){return-1!==e.indexOf("id=")||-1!==e.indexOf("class=")?'.replace(/\\s(?:id|class)=([\'"])(\\1)/mg, "")':""},e.prototype.cleanupWhitespace=function(e){return/\u0091|\u0092/.test(e)?".replace(/[\\s\\n]*\\u0091/mg, '').replace(/\\u0092[\\s\\n]*/mg, '')":""},e.prototype.findDependencies=function(e){var t,r,n,s,i;for(i=/require(?:\s+|\()(['"])(.+?)(\1)\)?/gm,t={};r=i.exec(e);)n=r[2],s=n.split("/").pop(),t[s]=n;return t},e}()}).call(this)}),require.define("/nodes/node.coffee",function(e,t){(function(){var r,n;n=e("../util/text").escapeHTML,t.exports=r=function(){function e(e,t){this.expression=null!=e?e:"",null==t&&(t={}),this.parentNode=t.parentNode,this.children=[],this.opener=this.closer=null,this.silent=!1,this.preserveTags=t.preserveTags.split(","),this.preserve=!1,this.wsRemoval={around:!1,inside:!1},this.escapeHtml=t.escapeHtml,this.escapeAttributes=t.escapeAttributes,this.cleanValue=t.cleanValue,this.format=t.format,this.hyphenateDataAttrs=t.hyphenateDataAttrs,this.selfCloseTags=t.selfCloseTags.split(","),this.uglify=t.uglify,this.codeBlockLevel=t.codeBlockLevel,this.blockLevel=t.blockLevel,this.placement=t.placement,this.namespace=t.namespace,this.name=t.name}return e.CLEAR_WHITESPACE_LEFT="‘",e.CLEAR_WHITESPACE_RIGHT="’",e.prototype.addChild=function(e){return this.children.push(e),this},e.prototype.getOpener=function(){return this.wsRemoval.around&&this.opener.text&&(this.opener.text=e.CLEAR_WHITESPACE_LEFT+this.opener.text),this.wsRemoval.inside&&this.opener.text&&(this.opener.text+=e.CLEAR_WHITESPACE_RIGHT),this.opener},e.prototype.getCloser=function(){return this.wsRemoval.inside&&this.closer.text&&(this.closer.text=e.CLEAR_WHITESPACE_LEFT+this.closer.text),this.wsRemoval.around&&this.closer.text&&(this.closer.text+=e.CLEAR_WHITESPACE_RIGHT),this.closer},e.prototype.isPreserved=function(){return this.preserve?!0:this.parentNode?this.parentNode.isPreserved():!1},e.prototype.isCommented=function(){return"Comment"===this.constructor.name?!0:this.parentNode?this.parentNode.isCommented():!1},e.prototype.markText=function(e,t){return null==t&&(t=!1),{type:"text",cw:this.codeBlockLevel,hw:this.uglify?0:this.blockLevel-this.codeBlockLevel,text:t?n(e):e}},e.prototype.markRunningCode=function(e){return{type:"run",cw:this.codeBlockLevel,code:e}},e.prototype.markInsertingCode=function(e,t,r,n){return null==t&&(t=!1),null==r&&(r=!1),null==n&&(n=!1),{type:"insert",cw:this.codeBlockLevel,hw:this.uglify?0:this.blockLevel-this.codeBlockLevel,escape:t,preserve:r,findAndPreserve:n,code:e}},e.prototype.evaluate=function(){},e.prototype.render=function(){var e,t,r,n,s,i,o,a,c,l,u,h,p,f,d,m,v,g,w;if(t=[],this.silent)return t;if(0===this.children.length)this.opener&&this.closer?(n=this.getOpener(),n.text+=this.getCloser().text,t.push(n)):!this.preserve&&this.isPreserved()?t.push(this.getOpener()):t.push(this.getOpener());else if(this.opener&&this.closer)if(this.preserve){for(this.wsRemoval.inside=!0,t.push(this.getOpener()),d=this.children,s=0,c=d.length;c>s;s++)for(e=d[s],m=e.render(),i=0,l=m.length;l>i;i++)r=m[i],r.hw=this.blockLevel,t.push(r);t.push(this.getCloser())}else{for(t.push(this.getOpener()),v=this.children,o=0,u=v.length;u>o;o++)e=v[o],t=t.concat(e.render());t.push(this.getCloser())}else if(this.opener)for(t.push(this.getOpener()),g=this.children,a=0,h=g.length;h>a;a++)e=g[a],t=t.concat(e.render());else for(w=this.children,f=0,p=w.length;p>f;f++)e=w[f],t.push(this.markText(e.render().text));return t},e}()}).call(this)}),require.define("/util/text.coffee",function(e,t){(function(){t.exports={whitespace:function(e){var t;for(e=2*e,t=[];e>t.length;)t.push(" ");return t.join("")},escapeQuotes:function(e){return e?e.replace(/"/g,'\\"').replace(/\\\\\"/g,'\\"'):""},unescapeQuotes:function(e){return e?e.replace(/\\"/g,'"'):""},escapeHTML:function(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;"):""},preserve:function(e){return e?e.replace(/<(pre|textarea)>(.*?)<\/\1>/g,function(e){return e.replace("\\n","&#x000A;")}):void 0},indent:function(e,r){return e.replace(/^(.*)$/gm,t.exports.whitespace(r)+"$1")}}}).call(this)}),require.define("/nodes/text.coffee",function(e,t){(function(){var r,n,s,i,o={}.hasOwnProperty,a=function(e,t){function r(){this.constructor=e}for(var n in t)o.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};r=e("./node"),s=e("../util/text").escapeQuotes,t.exports=n=function(e){function t(){return i=t.__super__.constructor.apply(this,arguments)}return a(t,e),t.prototype.evaluate=function(){return this.opener=this.markText(s(this.expression))},t}(r)}).call(this)}),require.define("/nodes/haml.coffee",function(e,t){(function(){var r,n,s,i,o={}.hasOwnProperty,a=function(e,t){function r(){this.constructor=e}for(var n in t)o.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};n=e("./node"),s=e("../util/text").escapeQuotes,t.exports=r=function(e){function t(){return i=t.__super__.constructor.apply(this,arguments)}return a(t,e),t.prototype.evaluate=function(){var e,t,r,n,i,o;return o=this.parseExpression(this.expression),o.doctype?this.opener=this.markText(""+s(this.buildDocType(o.doctype))):this.isNotSelfClosing(o.tag)?(i=this.buildHtmlTagPrefix(o),o.assignment?(n=o.assignment.match(/^(=|!=|&=|~)\s*(.*)$/),r=n[1],e=n[2],"~"===r?t="#{$fp "+e+" }":"&="===r||"="===r&&this.escapeHtml?t=this.preserve?this.cleanValue?"#{ $p($e($c("+e+"))) }":"#{ $p($e("+e+")) }":this.cleanValue?"#{ $e($c("+e+")) }":"#{ $e("+e+") }":("!="===r||"="===r&&!this.escapeHtml)&&(t=this.preserve?this.cleanValue?"#{ $p($c("+e+")) }":"#{ $p("+e+") }":this.cleanValue?"#{ $c("+e+") }":"#{ "+e+" }"),this.opener=this.markText(""+i+">"+t),this.closer=this.markText("</"+o.tag+">")):o.text?(this.opener=this.markText(""+i+">"+o.text),this.closer=this.markText("</"+o.tag+">")):(this.opener=this.markText(i+">"),this.closer=this.markText("</"+o.tag+">"))):(o.tag=o.tag.replace(/\/$/,""),i=this.buildHtmlTagPrefix(o),this.opener=this.markText(""+i+("xhtml"===this.format?" /":"")+">"))},t.prototype.parseExpression=function(e){var t,r,n,i,o,a,c,l;if(o=this.parseTag(e),-1!==this.preserveTags.indexOf(o.tag)&&(this.preserve=!0),n=this.interpolateCodeAttribute(null!=(c=o.ids)?c.pop():void 0,!0),r=o.classes,t={},o.attributes){l=o.attributes;for(i in l)a=l[i],"id"===i?n?n+="_"+this.interpolateCodeAttribute(a,!0):n=this.interpolateCodeAttribute(a,!0):"class"===i?(r||(r=[]),r.push(a)):t[i]=a}return{doctype:o.doctype,tag:o.tag,id:n,classes:r,text:s(o.text),attributes:t,assignment:o.assignment,reference:o.reference}},t.prototype.parseTag=function(e){var t,r,n,s,i,o,a,c,l,u,h,p,f,d,m,v,g,w,x,b,y,k,T,C,_,$,L,A,q,E,P,O,D,B;try{if(o=null!=(E=e.match(/^(\!{3}.*)/))?E[1]:void 0)return{doctype:o};if(l=e.match(/^((?:[#%\.][a-z0-9_:\-]*[\/]?)+)/i)[0],w=e.substring(l.length),w.match(/^[{([]/)){for(g="",u="",x="",P=["[","{","(","[","{","("],_=0,A=P.length;A>_;_++)if(b=P[_],b===w[0]){for(a=function(){switch(b){case"{":return"}";case"(":return")";case"[":return"]"}}(),m=0,v=$=0,O=w.length;O>=0?O>=$:$>=O;v=O>=0?++$:--$)if(s=w[v],s===b&&(m+=1),s===a){if(1===m)break;m-=1}switch(b){case"{":x+=w.substring(0,v+1),w=w.substring(v+1);break;case"(":u+=w.substring(0,v+1),w=w.substring(v+1);break;case"[":g=w.substring(1,v),w=w.substring(v+1)}}t=w||""}else g="",u="",x="",t=w;for(n={},D=[this.parseAttributes(u),this.parseAttributes(x)],L=0,q=D.length;q>L;L++){r=D[L];for(f in r)T=r[f],n[f]=T}return(C=null!=(B=t.match(/^[<>]{0,2}/))?B[0]:void 0)&&(t=t.substring(C.length))," "===t[0]&&(t=t.substring(1)),t&&!t.match(/^(=|!=|&=|~)/)&&(k=t.replace(/^ /,""),t=void 0),C&&(-1!==C.indexOf(">")&&(this.wsRemoval.around=!0),-1!==C.indexOf("<")&&(this.wsRemoval.inside=!0,this.preserve=!0)),y=l.match(/\%([a-z_\-][a-z0-9_:\-]*[\/]?)/i),p=l.match(/\#([a-z_\-][a-z0-9_\-]*)/gi),i=l.match(/\.([a-z0-9_\-]*)/gi),{tag:y?y[1]:"div",ids:p?function(){var e,t,r;for(r=[],e=0,t=p.length;t>e;e++)h=p[e],r.push("'"+h.substr(1)+"'");return r}():void 0,classes:i?function(){var e,t,r;for(r=[],e=0,t=i.length;t>e;e++)d=i[e],r.push("'"+d.substr(1)+"'");return r}():void 0,attributes:n,assignment:t,reference:g,text:k}}catch(I){throw c=I,Error("Unable to parse tag from "+e+": "+c)}},t.prototype.parseAttributes=function(e){var t,r,n,s,i,o,a,c,l,u,h,p,f,d,m,v,g,w,x,b,y,k,T,C,_,$,L,A,q,E;if(r={},void 0===e)return r;for(x=e.substring(0,1),e=e.replace(/(=|:|=>)\s*('([^\\']|\\\\|\\')*'|"([^\\"]|\\\\|\\")*")/g,function(e,t,r){return t+(null!=r?r.replace(/(:|=|=>)/g,"$1"):void 0)}),u=0,g=0,p=[],"("===x?(w=1,s=e.length-1):(w=0,s=e.length),d=y=w;s>=w?s>y:y>s;d=s>=w?++y:--y)n=e[d],"("===n&&(u+=1,1===u&&(g=d)),")"===n&&(1===u?0!==g&&1!==d-g&&p.push({start:g,end:d}):u-=1);for($=p.reverse(),k=0,C=$.length;C>k;k++)h=$[k],e=e.substring(0,h.start)+e.substring(h.start,h.end).replace(/(:|=|=>)/g,"$1")+e.substring(h.end);switch(x){case"(":l=/\(\s*([-\w]+[\w:-]*\w?)\s*=|\s+([-\w]+[\w:-]*\w?)\s*=|\(\s*('\w+[\w:-]*\w?')\s*=|\s+('\w+[\w:-]*\w?')\s*=|\(\s*("\w+[\w:-]*\w?")\s*=|\s+("\w+[\w:-]*\w?")\s*=/g;break;case"{":l=/[{,]\s*(\w+[\w:-]*\w?)\s*:|[{,]\s*('[-\w]+[\w:-]*\w?')\s*:|[{,]\s*("[-\w]+[\w:-]*\w?")\s*:|[{,]\s*:(\w+[\w:-]*\w?)\s*=>|[{,]\s*:?'([-\w]+[\w:-]*\w?)'\s*=>|[{,]\s*:?"([-\w]+[\w:-]*\w?)"\s*=>/g}for(f=e.split(l).filter(Boolean),o=!1,i=!1;f.length;)if(c=f.splice(0,2),1===c.length)t=c[0].replace(/^[\s({]+|[\s)}]+$/g,""),r[t]="true";else switch(a=null!=(L=c[0])?L.replace(/^\s+|\s+$/g,"").replace(/^:/,""):void 0,(v=a.match(/^("|')(.*)\1$/))&&(a=v[2]),b=null!=(A=c[1])?A.replace(/^\s+|[\s,]+$/g,"").replace(/\u0090/g,""):void 0,"data"!==a||b?a&&b&&o&&(a=this.hyphenateDataAttrs?"data-"+a.replace("_","-"):"data-"+a,/}\s*$/.test(b)&&(o=!1)):(o=!0,i=!0),x){case"(":if(b=b.replace(/^\s+|[\s)]+$/g,""),m=null!=(q=/^(['"])/.exec(b))?q[1]:void 0,d=b.lastIndexOf(m),d>1){for(E=b.substring(d+1).split(" "),T=0,_=E.length;_>T;T++)t=E[T],t&&(r[t]="true");b=b.substring(0,d+1)}r[a]=b;break;case"{":r[a]=b.replace(/^\s+|[\s}]+$/g,"")}return i&&delete r.data,r},t.prototype.buildHtmlTagPrefix=function(e){var t,r,n,s,i,o,a,c,l,u,h;if(a=["<"+e.tag],e.classes){if(n=!1,t=function(){var t,r,s,i;for(s=e.classes,i=[],t=0,r=s.length;r>t;t++)o=s[t],o=this.interpolateCodeAttribute(o,!0),-1!==o.indexOf("#{")&&(n=!0),i.push(o);return i}.call(this),n&&t.length>1){for(r="#{ [",l=0,u=t.length;u>l;l++)i=t[l],r+=""+this.quoteAndEscapeAttributeValue(i,!0)+",";r=r.substring(0,r.length-1)+"].sort().join(' ').replace(/^\\s+|\\s+$/g, '') }"}else r=t.sort().join(" ");a.push("class='"+r+"'")}if(e.id&&a.push("id='"+e.id+"'"),e.reference&&(e.attributes&&(delete e.attributes["class"],delete e.attributes.id),a.push("#{$r("+e.reference+")}")),e.attributes){h=e.attributes;for(s in h)c=h[s],"true"===c||"false"===c?"true"===c&&("html5"===this.format?a.push(""+s):a.push(""+s+"="+this.quoteAndEscapeAttributeValue(s))):a.push(""+s+"="+this.quoteAndEscapeAttributeValue(this.interpolateCodeAttribute(c)))}return a.join(" ")},t.prototype.interpolateCodeAttribute=function(e,t){var r;return null==t&&(t=!1),e?(e.match(/^("|').*\1$/)||(e=this.escapeAttributes?this.cleanValue?"#{ $e($c("+e+")) }":"#{ $e("+e+") }":this.cleanValue?"#{ $c("+e+") }":"#{ ("+e+") }"),t&&(r=e.match(/^("|')(.*)\1$/))&&(e=r[2]),e):void 0},t.prototype.quoteAndEscapeAttributeValue=function(e,t){var r,n,i,o,a,c,l,u;return null==t&&(t=!1),e?((a=e.match(/^("|')(.*)\1$/))&&(e=a[2]),u=this.splitInterpolations(e),o=!1,n=!1,i=!1,u=function(){var e,t,r;for(r=[],e=0,t=u.length;t>e;e++)l=u[e],"#{"===l.slice(0,2)?(-1===l.indexOf("$e")&&-1===l.indexOf("$c")&&(this.escapeAttributes?l=this.cleanValue?"#{ $e($c("+l.slice(2,-1)+")) }":"#{ $e("+l.slice(2,-1)+") }":this.cleanValue&&(l="#{ $c("+l.slice(2,-1)+") }")),i=!0):(o||(o=-1!==l.indexOf("'")),n||(n=-1!==l.indexOf('"'))),r.push(l);return r}.call(this),t?c=i?'"'+u.join("")+'"':"'"+u.join("")+"'":(n||o||(c="'"+u.join("")+"'"),o&&!n&&(c='\\"'+u.join("")+'\\"'),n&&!o&&(r=function(){var e,t,r;for(r=[],e=0,t=u.length;t>e;e++)l=u[e],r.push(s(l));return r}(),c="'"+r.join("")+"'"),o&&n&&(r=function(){var e,t,r;for(r=[],e=0,t=u.length;t>e;e++)l=u[e],r.push(s(l).replace(/'/g,"&#39;"));return r}(),c="'"+r.join("")+"'")),c):void 0},t.prototype.splitInterpolations=function(e){var t,r,n,s,i,o,a,c;for(n=0,i=0,o=[],s=a=0,c=e.length;c>=0?c>a:a>c;s=c>=0?++a:--a)t=e[s],r=e.slice(s,+(s+1)+1||9e9),"{"===t&&(n+=1),"#{"===r&&0===n&&(o.push(e.slice(i,s)),i=s),"}"===t&&(n-=1,0===n&&(o.push(e.slice(i,+s+1||9e9)),i=s+1));return o.push(e.slice(i,e.length)),o.filter(Boolean)},t.prototype.buildDocType=function(e){switch(""+this.format+" "+e){case"xhtml !!! XML":return"<?xml version='1.0' encoding='utf-8' ?>";case"xhtml !!!":return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';case"xhtml !!! 1.1":return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">';case"xhtml !!! mobile":return'<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">';case"xhtml !!! basic":return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">';case"xhtml !!! frameset":return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">';case"xhtml !!! 5":case"html5 !!!":return"<!DOCTYPE html>";case"html5 !!! XML":case"html4 !!! XML":return"";case"html4 !!!":return'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';case"html4 !!! frameset":return'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';case"html4 !!! strict":return'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'}},t.prototype.isNotSelfClosing=function(e){return-1===this.selfCloseTags.indexOf(e)&&!e.match(/\/$/)},t}(n)}).call(this)}),require.define("/nodes/code.coffee",function(e,t){(function(){var r,n,s,i={}.hasOwnProperty,o=function(e,t){function r(){this.constructor=e}for(var n in t)i.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};n=e("./node"),t.exports=r=function(e){function t(){return s=t.__super__.constructor.apply(this,arguments)}return o(t,e),t.prototype.evaluate=function(){var e,t,r,n;return t=this.expression.match(/(-|!=|\&=|=|~)\s?(.*)?/),n=t[1],e=t[2],"-"!==n?"~"===n?this.opener=this.escapeHtml?this.markInsertingCode(e,!0,!1,!0):this.markInsertingCode(e,!1,!1,!0):(r="&="===n||"="===n&&this.escapeHtml,0!==this.children.length&&e.match(/(->|=>)$/)?(this.opener=this.markInsertingCode(e,r,!1,!1),this.opener.block="start",this.closer=this.markRunningCode(' $buffer.join "\\n"'),this.closer.block="end"):this.opener=this.markInsertingCode(e,r)):(this.opener=this.markRunningCode(e),0!==this.children.length&&this.opener.code.match(/(->|=>)/)?this.closer=this.markRunningCode(" ''"):void 0)},t}(n)}).call(this)}),require.define("/nodes/comment.coffee",function(e,t){(function(){var r,n,s,i,o={}.hasOwnProperty,a=function(e,t){function r(){this.constructor=e}for(var n in t)o.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e
2};n=e("./node"),s=e("../util/text").escapeQuotes,t.exports=r=function(e){function t(){return i=t.__super__.constructor.apply(this,arguments)}return a(t,e),t.prototype.evaluate=function(){var e,t,r,n;switch(n=this.expression.match(/(-#|\/\[|\/)\s?(.*)?/),t=n[0],r=n[1],e=n[2],r){case"-#":return this.silent=!0,this.opener=this.markText("");case"/[":return this.opener=this.markText("<!--["+e+">"),this.closer=this.markText("<![endif]-->");case"/":return e?(this.opener=this.markText("<!-- "+s(e)),this.closer=this.markText(" -->")):(this.opener=this.markText("<!--"),this.closer=this.markText("-->"))}},t}(n)}).call(this)}),require.define("/nodes/filter.coffee",function(e,t){(function(){var r,n,s,i,o,a={}.hasOwnProperty,c=function(e,t){function r(){this.constructor=e}for(var n in t)a.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};n=e("./node"),i=e("../util/text").whitespace,s=e("../util/text").unescapeQuotes,t.exports=r=function(e){function t(){return o=t.__super__.constructor.apply(this,arguments)}return c(t,e),t.prototype.evaluate=function(){var e;return this.filter=null!=(e=this.expression.match(/:(escaped|preserve|css|javascript|coffeescript|plain|cdata|coffeescript)(.*)?/))?e[1]:void 0},t.prototype.render=function(){var e,t,r,n,s,i,o,a,c,l;switch(r=[],this.filter){case"escaped":for(c=this.children,s=0,o=c.length;o>s;s++)e=c[s],r.push(this.markText(e.render()[0].text,!0));break;case"preserve":for(n="",l=this.children,i=0,a=l.length;a>i;i++)e=l[i],n+=""+e.render()[0].text+"&#x000A;";n=n.replace(/\&\#x000A;$/,""),r.push(this.markText(n));break;case"plain":this.renderFilterContent(0,r);break;case"css":"html5"===this.format?r.push(this.markText("<style>")):r.push(this.markText("<style type='text/css'>")),"xhtml"===this.format&&r.push(this.markText(" /*<![CDATA[*/")),t="xhtml"===this.format?2:1,this.renderFilterContent(t,r),"xhtml"===this.format&&r.push(this.markText(" /*]]>*/")),r.push(this.markText("</style>"));break;case"javascript":"html5"===this.format?r.push(this.markText("<script>")):r.push(this.markText("<script type='text/javascript'>")),"xhtml"===this.format&&r.push(this.markText(" //<![CDATA[")),t="xhtml"===this.format?2:1,this.renderFilterContent(t,r),"xhtml"===this.format&&r.push(this.markText(" //]]>")),r.push(this.markText("</script>"));break;case"cdata":r.push(this.markText("<![CDATA[")),this.renderFilterContent(2,r),r.push(this.markText("]]>"));break;case"coffeescript":this.renderFilterContent(0,r,"run")}return r},t.prototype.renderFilterContent=function(e,t,r){var n,o,a,c,l,u,h,p,f,d,m,v;for(null==r&&(r="text"),o=[],c=0,m=this.children,u=0,f=m.length;f>u;u++)n=m[u],o.push(n.render()[0].text);for(v=[],h=0,d=o.length;d>h;h++)if(l=o[h],""===l)v.push(c+=1);else{switch(r){case"text":for(a=p=0;c>=0?c>p:p>c;a=c>=0?++p:--p)t.push(this.markText(""));t.push(this.markText(""+i(e)+l));break;case"run":t.push(this.markRunningCode(""+s(l)))}v.push(c=0)}return v},t}(n)}).call(this)}),require.define("/nodes/directive.coffee",function(e,t){(function(){var r,n,s,i,o={}.hasOwnProperty,a=function(e,t){function r(){this.constructor=e}for(var n in t)o.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};s=e("path"),n=e("./node"),t.exports=r=function(e){function t(){return i=t.__super__.constructor.apply(this,arguments)}return a(t,e),t.prototype.directives={include:function(e){var t,r,n,s,i;try{i=e.match(/\s*['"](.*)['"](?:,\s*(.*))?\s*/),i[0],n=i[1],t=i[2]}catch(o){throw r=o,Error("Failed to parse the include directive from "+e)}return t||(t="this"),s=function(){switch(this.placement){case"global":return""+this.namespace+"['"+n+"'].apply("+t+")";case"amd":return"require('"+n+"').apply("+t+")";default:throw Error("Include directive not available when placement is "+this.placement)}}.call(this),this.opener=this.markInsertingCode(s,!1)}},t.prototype.evaluate=function(){var e,t,r,n,s;e=Object.keys(this.directives).join("|");try{s=this.expression.match(RegExp("\\+("+e+")(.*)")),s[0],r=s[1],n=s[2]}catch(i){throw t=i,Error("Unable to recognize directive from "+this.expression)}return this.directives[r].call(this,n)},t}(n)}).call(this)}),require.define("/hamlc.coffee",function(e,t,r,n,s,i){(function(){var r,n,s,o;s=e("fs"),n=e("./haml-coffee"),r=i.browser?window.CoffeeScript:e("coffee-script"),o={},t.exports={compile:function(e,t){var s,i;return null==t&&(t={}),s=new n(t),s.parse(e),i=Function(r.compile(s.precompile(),{bare:!0})),function(e){return i.call(e)}},template:function(e,t,s,i){var o;return null==i&&(i={}),i.namespace=s,i.name=t,o=new n(i),o.parse(e),r.compile(o.render())},__express:function(e,r,n){var i,a;r&&r.constructor&&r.call&&r.apply&&(n=r,r={});try{return r.cache&&o[e]?n(null,o[e](r)):(r.filename=e,a=s.readFileSync(e,"utf8"),r.cache?(o[e]=t.exports.compile(a,r),n(null,o[e](r))):n(null,t.exports.compile(a,r)(r)))}catch(c){return i=c,n(i)}}}}).call(this)}),require.define("fs",function(){});
\No newline at end of file