/*! * ECT CoffeeScript template engine v0.5.9 * https://github.com/baryshev/ect * * Copyright 2012-2014, Vadim M. Baryshev * Licensed under the MIT license * https://github.com/baryshev/ect/LICENSE * * Includes parts of node * https://github.com/joyent/node * Copyright Joyent, Inc. and other Node contributors * Released under the MIT license * * Includes Cross-Browser Split 1.1.1 * http://xregexp.com/ * Copyright 2007-2012 Steven Levithan * Released under the MIT license */ (function(){"use strict";var fs;var path;var CoffeeScript;var ECT=function(options){if(!(this instanceof ECT)){return new ECT(options)}this.options={open:"<%",close:"%>",ext:"",cache:true,watch:false,root:""};var ect=this,trimExp=/^[ \t]+|[ \t]+$/g,newlineExp=/\n/g,cache={},watchers={},indentChars={":":":",">":">"},escapeExp=/[&<>"]/,escapeAmpExp=/&/g,escapeLtExp=//g,escapeQuotExp=/"/g,regExpEscape=function(str){return String(str).replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},read=function(file){if(Object.prototype.toString.call(ect.options.root)==="[object Object]"){var data=file.split(".").reduce(function(currentContext,key){return currentContext[key]},ect.options.root);if(Object.prototype.toString.call(data)==="[object String]"){return data}else{throw new Error("Failed to load template "+file)}}else{try{return fs.readFileSync(file,"utf8")}catch(e){throw new Error("Failed to load template "+file)}}},compile=function(template){var lineNo=1,bufferStack=["__ectOutput"],bufferStackPointer=0,buffer=bufferStack[bufferStackPointer]+" = '",matches=template.split(new RegExp(regExpEscape(ect.options.open)+"((?:.|[\r\n])+?)(?:"+regExpEscape(ect.options.close)+"|$)")),output,text,command,line,prefix,postfix,newline,indentChar,indentation="",indent=false,indentStack=[],indentStackPointer=-1,baseIndent,lines,j;for(var i=0;i>0,res=[],i,val;if(typeof fun!=="function"){throw new TypeError}for(i=0;i>0,curr;if(typeof accumulator!=="function"){throw new TypeError("First argument is not callable")}if(arguments.length<2){if(len===0){throw new TypeError("Array length is 0 and no second argument")}curr=this[0];i=1}else{curr=arguments[1]}while(i>>0:limit>>>0;while(match=separator.exec(str)){lastIndex=match.index+match[0].length;if(lastIndex>lastLastIndex){output.push(str.slice(lastLastIndex,match.index));if(!compliantExecNpcg&&match.length>1){match[0].replace(separator2,function(){for(var i=1;i1&&match.index=limit){break}}if(separator.lastIndex===match.index){separator.lastIndex++}}if(lastLastIndex===str.length){if(lastLength||!separator.test("")){output.push("")}}else{output.push(str.slice(lastLastIndex))}return output.length>limit?output.slice(0,limit):output};String.prototype.split=function(separator,limit){return self(this,separator,limit)};return self}();if(typeof define==="function"&&define.amd){define("ect",["coffee-script"],function(cs){CoffeeScript=cs;return ECT})}else{CoffeeScript=window.CoffeeScript;window.ECT=ECT}path=function(){var normalizeArray=function(parts,allowAboveRoot){var up=0,i,last;for(i=parts.length-1;i>=0;i--){last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){while(up){parts.unshift("..");up--}}return parts},normalize=function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.slice(-1)==="/";path=normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};return{normalize:normalize}}();fs=function(){var readFileSync=function(file,encoding){var AJAX;if(window.XMLHttpRequest){AJAX=new XMLHttpRequest;if(AJAX.overrideMimeType){AJAX.overrideMimeType("text/html")}}else{AJAX=new ActiveXObject("Microsoft.XMLHTTP")}if(AJAX){AJAX.open("GET",file,false);AJAX.send(null);if(AJAX.status!==0&&(AJAX.status<200||AJAX.status>399)){throw new Error("Failed to load template "+file)}return AJAX.responseText}else{throw new Error("Failed to load template "+file)}},watch=function(){};return{readFileSync:readFileSync,watch:watch}}()}})(); //# sourceMappingURL=../ect.min.map