Comparing version 3.1.7 to 3.2.0
@@ -1,3 +0,3 @@ | ||
/*! Browser bundle of nunjucks 3.1.7 (slim, only works with precompiled templates) */ | ||
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.nunjucks=t():n.nunjucks=t()}("undefined"!=typeof self?self:this,function(){return function(n){var t={};function r(i){if(t[i])return t[i].exports;var e=t[i]={i:i,l:!1,exports:{}};return n[i].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=n,r.c=t,r.d=function(n,t,i){r.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:i})},r.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(t,"a",t),t},r.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r.p="",r(r.s=6)}([function(n,t){},function(n,t,r){"use strict";var i=Array.prototype,e=Object.prototype,u={"&":"&",'"':""","'":"'","<":"<",">":">"},o=/[&"'<>]/g;function f(n,t){return e.hasOwnProperty.call(n,t)}function c(n){return u[n]}function s(n,t,r){var i,e,u;if(n instanceof Error&&(n=(e=n).name+": "+e.message),Object.setPrototypeOf?Object.setPrototypeOf(i=Error(n),s.prototype):Object.defineProperty(i=this,"message",{enumerable:!1,writable:!0,value:n}),Object.defineProperty(i,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(i,this.constructor),e){var o=Object.getOwnPropertyDescriptor(e,"stack");(u=o&&(o.get||function(){return o.value}))||(u=function(){return e.stack})}else{var f=Error(n).stack;u=function(){return f}}return Object.defineProperty(i,"stack",{get:function(){return u.call(i)}}),Object.defineProperty(i,"cause",{value:e}),i.lineno=t,i.colno=r,i.firstUpdate=!0,i.Update=function(n){var t="("+(n||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?t+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(t+=" [Line "+this.lineno+"]")),t+="\n ",this.firstUpdate&&(t+=" "),this.message=t+(this.message||""),this.firstUpdate=!1,this},i}function a(n){return"[object Function]"===e.toString.call(n)}function h(n){return"[object Array]"===e.toString.call(n)}function l(n){return"[object String]"===e.toString.call(n)}function v(n){return"[object Object]"===e.toString.call(n)}function d(n){return Array.prototype.slice.call(n)}function p(n,t,r){return Array.prototype.indexOf.call(n||[],t,r)}function y(n){var t=[];for(var r in n)f(n,r)&&t.push(r);return t}(t=n.exports={}).hasOwnProp=f,t.t=function(n,r,i){if(i.Update||(i=new t.TemplateError(i)),i.Update(n),!r){var e=i;(i=Error(e.message)).name=e.name}return i},Object.setPrototypeOf?Object.setPrototypeOf(s.prototype,Error.prototype):s.prototype=Object.create(Error.prototype,{constructor:{value:s}}),t.TemplateError=s,t.escape=function(n){return n.replace(o,c)},t.isFunction=a,t.isArray=h,t.isString=l,t.isObject=v,t.groupBy=function(n,t){for(var r={},i=a(t)?t:function(n){return n[t]},e=0;e<n.length;e++){var u=n[e],o=i(u,e);(r[o]||(r[o]=[])).push(u)}return r},t.toArray=d,t.without=function(n){var t=[];if(!n)return t;for(var r=n.length,i=d(arguments).slice(1),e=-1;++e<r;)-1===p(i,n[e])&&t.push(n[e]);return t},t.repeat=function(n,t){for(var r="",i=0;i<t;i++)r+=n;return r},t.each=function(n,t,r){if(null!=n)if(i.forEach&&n.forEach===i.forEach)n.forEach(t,r);else if(n.length===+n.length)for(var e=0,u=n.length;e<u;e++)t.call(r,n[e],e,n)},t.map=function(n,t){var r=[];if(null==n)return r;if(i.map&&n.map===i.map)return n.map(t);for(var e=0;e<n.length;e++)r[r.length]=t(n[e],e);return n.length===+n.length&&(r.length=n.length),r},t.asyncIter=function(n,t,r){var i=-1;!function e(){++i<n.length?t(n[i],i,e,r):r()}()},t.asyncFor=function(n,t,r){var i=y(n||{}),e=i.length,u=-1;!function o(){var f=i[++u];u<e?t(f,n[f],u,e,o):r()}()},t.indexOf=p,t.keys=y,t.r=function(n){return y(n).map(function(t){return[t,n[t]]})},t.u=function(n){return y(n).map(function(t){return n[t]})},t.f=t.extend=function(n,t){return n=n||{},y(t).forEach(function(r){n[r]=t[r]}),n},t.inOperator=function(n,t){if(h(t)||l(t))return-1!==t.indexOf(n);if(v(t))return n in t;throw Error('Cannot use "in" operator to search for "'+n+'" in unexpected types.')}},function(n,t,r){"use strict";var i=r(1),e=Array.from,u="function"==typeof Symbol&&Symbol.iterator&&"function"==typeof e,o=function(){function n(n,t){this.variables={},this.parent=n,this.topLevel=!1,this.isolateWrites=t}var t=n.prototype;return t.set=function(n,t,r){var i=n.split("."),e=this.variables,u=this;if(r&&(u=this.resolve(i[0],!0)))u.set(n,t);else{for(var o=0;o<i.length-1;o++){var f=i[o];e[f]||(e[f]={}),e=e[f]}e[i[i.length-1]]=t}},t.get=function(n){var t=this.variables[n];return void 0!==t?t:null},t.lookup=function(n){var t=this.parent,r=this.variables[n];return void 0!==r?r:t&&t.lookup(n)},t.resolve=function(n,t){var r=t&&this.isolateWrites?void 0:this.parent;return void 0!==this.variables[n]?this:r&&r.resolve(n)},t.push=function(t){return new n(this,t)},t.pop=function(){return this.parent},n}();function f(n){return n&&Object.prototype.hasOwnProperty.call(n,"__keywords")}function c(n){var t=n.length;return 0===t?0:f(n[t-1])?t-1:t}function s(n){if("string"!=typeof n)return n;this.val=n,this.length=n.length}s.prototype=Object.create(String.prototype,{length:{writable:!0,configurable:!0,value:0}}),s.prototype.valueOf=function(){return this.val},s.prototype.toString=function(){return this.val},n.exports={Frame:o,makeMacro:function(n,t,r){var i=this;return function(){for(var e=arguments.length,u=Array(e),o=0;o<e;o++)u[o]=arguments[o];var s,a=c(u),h=function(n){var t=n.length;if(t){var r=n[t-1];if(f(r))return r}return{}}(u);if(a>n.length)s=u.slice(0,n.length),u.slice(s.length,a).forEach(function(n,r){r<t.length&&(h[t[r]]=n)}),s.push(h);else if(a<n.length){s=u.slice(0,a);for(var l=a;l<n.length;l++){var v=n[l];s.push(h[v]),delete h[v]}s.push(h)}else s=u;return r.apply(i,s)}},makeKeywordArgs:function(n){return n.__keywords=!0,n},numArgs:c,suppressValue:function(n,t){return n=void 0!==n&&null!==n?n:"",!t||n instanceof s||(n=i.escape(n.toString())),n},ensureDefined:function(n,t,r){if(null===n||void 0===n)throw new i.TemplateError("attempted to output null or undefined value",t+1,r+1);return n},memberLookup:function(n,t){if(void 0!==n&&null!==n)return"function"==typeof n[t]?function(){for(var r=arguments.length,i=Array(r),e=0;e<r;e++)i[e]=arguments[e];return n[t].apply(n,i)}:n[t]},contextOrFrameLookup:function(n,t,r){var i=t.lookup(r);return void 0!==i?i:n.lookup(r)},callWrap:function(n,t,r,i){if(!n)throw Error("Unable to call `"+t+"`, which is undefined or falsey");if("function"!=typeof n)throw Error("Unable to call `"+t+"`, which is not a function");return n.apply(r,i)},handleError:function(n,t,r){return n.lineno?n:new i.TemplateError(n,t,r)},isArray:i.isArray,keys:i.keys,SafeString:s,copySafeness:function(n,t){return n instanceof s?new s(t):t.toString()},markSafe:function(n){var t=typeof n;return"string"===t?new s(n):"function"!==t?n:function(t){var r=n.apply(this,arguments);return"string"==typeof r?new s(r):r}},asyncEach:function(n,t,r,e){if(i.isArray(n)){var u=n.length;i.asyncIter(n,function(n,i,e){switch(t){case 1:r(n,i,u,e);break;case 2:r(n[0],n[1],i,u,e);break;case 3:r(n[0],n[1],n[2],i,u,e);break;default:n.push(i,u,e),r.apply(this,n)}},e)}else i.asyncFor(n,function(n,t,i,e,u){r(n,t,i,e,u)},e)},asyncAll:function(n,t,r,e){var u,o,f=0;function c(n,t){f++,o[n]=t,f===u&&e(null,o.join(""))}if(i.isArray(n))if(u=n.length,o=Array(u),0===u)e(null,"");else for(var s=0;s<n.length;s++){var a=n[s];switch(t){case 1:r(a,s,u,c);break;case 2:r(a[0],a[1],s,u,c);break;case 3:r(a[0],a[1],a[2],s,u,c);break;default:a.push(s,u,c),r.apply(this,a)}}else{var h=i.keys(n||{});if(u=h.length,o=Array(u),0===u)e(null,"");else for(var l=0;l<h.length;l++){var v=h[l];r(v,n[v],l,u,c)}}},inOperator:i.inOperator,fromIterator:function(n){return"object"!=typeof n||null===n||i.isArray(n)?n:u&&Symbol.iterator in n?e(n):n}}},function(n,t,r){"use strict";var i=function(n){var t,r;function i(t){var r;return(r=n.call(this)||this).precompiled=t||{},r}return r=n,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,i.prototype.getSource=function(n){return this.precompiled[n]?{src:{type:"code",obj:this.precompiled[n]},path:n}:null},i}(r(4));n.exports={PrecompiledLoader:i}},function(n,t,r){"use strict";var i=r(0),e=r(5);n.exports=function(n){var t,r;function e(){return n.apply(this,arguments)||this}r=n,(t=e).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var u=e.prototype;return u.on=function(n,t){this.listeners=this.listeners||{},this.listeners[n]=this.listeners[n]||[],this.listeners[n].push(t)},u.emit=function(n){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];this.listeners&&this.listeners[n]&&this.listeners[n].forEach(function(n){n.apply(void 0,r)})},u.resolve=function(n,t){return i.resolve(i.dirname(n),t)},u.isRelative=function(n){return 0===n.indexOf("./")||0===n.indexOf("../")},e}(e)},function(n,t,r){"use strict";function i(n,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function e(n,t,r){return t&&i(n.prototype,t),r&&i(n,r),n}var u=r(1);function o(n,t,r){r=r||{},u.keys(r).forEach(function(t){var i,e;r[t]=(i=n.prototype[t],e=r[t],"function"!=typeof i||"function"!=typeof e?e:function(){var n=this.parent;this.parent=i;var t=e.apply(this,arguments);return this.parent=n,t})});var i=function(n){var r,i;function u(){return n.apply(this,arguments)||this}return i=n,(r=u).prototype=Object.create(i.prototype),r.prototype.constructor=r,r.__proto__=i,e(u,[{key:"typename",get:function(){return t}}]),u}(n);return u.f(i.prototype,r),i}var f=function(){function n(){this.init.apply(this,arguments)}return n.prototype.init=function(){},n.extend=function(n,t){return"object"==typeof n&&(t=n,n="anonymous"),o(this,n,t)},e(n,[{key:"typename",get:function(){return this.constructor.name}}]),n}();n.exports=f},function(n,t,r){"use strict";var i,e=r(1),u=r(7),o=u.Environment,f=u.Template,c=r(4),s=r(3),a=r(0),h=r(0),l=r(0),v=r(0),d=r(2),p=r(0),y=r(16);function w(n,t){var r;return t=t||{},e.isObject(n)&&(t=n,n=null),s.FileSystemLoader?r=new s.FileSystemLoader(n,{watch:t.watch,noCache:t.noCache}):s.WebLoader&&(r=new s.WebLoader(n,{useCache:t.web&&t.web.useCache,async:t.web&&t.web.async})),i=new o(r,t),t&&t.express&&i.express(t.express),i}n.exports={Environment:o,Template:f,Loader:c,FileSystemLoader:s.FileSystemLoader,PrecompiledLoader:s.PrecompiledLoader,WebLoader:s.WebLoader,compiler:h,parser:l,lexer:v,runtime:d,lib:e,nodes:p,installJinjaCompat:y,configure:w,reset:function(){i=void 0},compile:function(n,t,r,e){return i||w(),new f(n,t,r,e)},render:function(n,t,r){return i||w(),i.render(n,t,r)},renderString:function(n,t,r){return i||w(),i.renderString(n,t,r)},precompile:a?a.precompile:void 0,precompileString:a?a.precompileString:void 0}},function(n,t,r){"use strict";function i(n,t){n.prototype=Object.create(t.prototype),n.prototype.constructor=n,n.__proto__=t}var e=r(8),u=r(11),o=r(1),f=r(0),c=r(12),s=r(3),a=s.FileSystemLoader,h=s.WebLoader,l=s.PrecompiledLoader,v=r(13),d=r(14),p=r(5),y=r(2),w=y.handleError,b=y.Frame,m=r(15);function g(n,t,r){e(function(){n(t,r)})}var j={type:"code",obj:{root:function(n,t,r,i,e){try{e(null,"")}catch(n){e(w(n,null,null))}}}},E=function(n){function t(){return n.apply(this,arguments)||this}i(t,n);var r=t.prototype;return r.init=function(n,t){var r=this;t=this.opts=t||{},this.opts.dev=!!t.dev,this.opts.autoescape=null==t.autoescape||t.autoescape,this.opts.throwOnUndefined=!!t.throwOnUndefined,this.opts.trimBlocks=!!t.trimBlocks,this.opts.lstripBlocks=!!t.lstripBlocks,this.loaders=[],n?this.loaders=o.isArray(n)?n:[n]:a?this.loaders=[new a("views")]:h&&(this.loaders=[new h("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new l(window.nunjucksPrecompiled)),this.initCache(),this.globals=d(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],o.r(c).forEach(function(n){var t=n[0],i=n[1];return r.addFilter(t,i)}),o.r(v).forEach(function(n){var t=n[0],i=n[1];return r.addTest(t,i)})},r.initCache=function(){this.loaders.forEach(function(n){n.cache={},"function"==typeof n.on&&n.on("update",function(t){n.cache[t]=null})})},r.addExtension=function(n,t){return t.__name=n,this.extensions[n]=t,this.extensionsList.push(t),this},r.removeExtension=function(n){var t=this.getExtension(n);t&&(this.extensionsList=o.without(this.extensionsList,t),delete this.extensions[n])},r.getExtension=function(n){return this.extensions[n]},r.hasExtension=function(n){return!!this.extensions[n]},r.addGlobal=function(n,t){return this.globals[n]=t,this},r.getGlobal=function(n){if(void 0===this.globals[n])throw Error("global not found: "+n);return this.globals[n]},r.addFilter=function(n,t,r){var i=t;return r&&this.asyncFilters.push(n),this.filters[n]=i,this},r.getFilter=function(n){if(!this.filters[n])throw Error("filter not found: "+n);return this.filters[n]},r.addTest=function(n,t){return this.tests[n]=t,this},r.getTest=function(n){if(!this.tests[n])throw Error("test not found: "+n);return this.tests[n]},r.resolveTemplate=function(n,t,r){return!(!n.isRelative||!t)&&n.isRelative(r)&&n.resolve?n.resolve(t,r):r},r.getTemplate=function(n,t,r,i,e){var u,f=this,c=this,s=null;if(n&&n.raw&&(n=n.raw),o.isFunction(r)&&(e=r,r=null,t=t||!1),o.isFunction(t)&&(e=t,t=!1),n instanceof O)s=n;else{if("string"!=typeof n)throw Error("template names must be a string: "+n);for(var a=0;a<this.loaders.length;a++){var h=this.loaders[a];if(s=h.cache[this.resolveTemplate(h,r,n)])break}}if(s)return t&&s.compile(),e?void e(null,s):s;return o.asyncIter(this.loaders,function(t,i,e,u){function o(n,r){n?u(n):r?(r.loader=t,u(null,r)):e()}n=c.resolveTemplate(t,r,n),t.async?t.getSource(n,o):o(null,t.getSource(n))},function(r,o){if(o||r||i||(r=Error("template not found: "+n)),r){if(e)return void e(r);throw r}var c;o?(c=new O(o.src,f,o.path,t),o.noCache||(o.loader.cache[n]=c)):c=new O(j,f,"",t),e?e(null,c):u=c}),u},r.express=function(n){return m(this,n)},r.render=function(n,t,r){o.isFunction(t)&&(r=t,t=null);var i=null;return this.getTemplate(n,function(n,e){if(n&&r)g(r,n);else{if(n)throw n;i=e.render(t,r)}}),i},r.renderString=function(n,t,r,i){return o.isFunction(r)&&(i=r,r={}),new O(n,this,(r=r||{}).path).render(t,i)},r.waterfall=function(n,t,r){return u(n,t,r)},t}(p),k=function(n){function t(){return n.apply(this,arguments)||this}i(t,n);var r=t.prototype;return r.init=function(n,t,r){var i=this;this.env=r||new E,this.ctx=o.extend({},n),this.blocks={},this.exported=[],o.keys(t).forEach(function(n){i.addBlock(n,t[n])})},r.lookup=function(n){return n in this.env.globals&&!(n in this.ctx)?this.env.globals[n]:this.ctx[n]},r.setVariable=function(n,t){this.ctx[n]=t},r.getVariables=function(){return this.ctx},r.addBlock=function(n,t){return this.blocks[n]=this.blocks[n]||[],this.blocks[n].push(t),this},r.getBlock=function(n){if(!this.blocks[n])throw Error('unknown block "'+n+'"');return this.blocks[n][0]},r.getSuper=function(n,t,r,i,e,u){var f=o.indexOf(this.blocks[t]||[],r),c=this.blocks[t][f+1];if(-1===f||!c)throw Error('no super block available for "'+t+'"');c(n,this,i,e,u)},r.addExport=function(n){this.exported.push(n)},r.getExported=function(){var n=this,t={};return this.exported.forEach(function(r){t[r]=n.ctx[r]}),t},t}(p),O=function(n){function t(){return n.apply(this,arguments)||this}i(t,n);var r=t.prototype;return r.init=function(n,t,r,i){if(this.env=t||new E,o.isObject(n))switch(n.type){case"code":this.tmplProps=n.obj;break;case"string":this.tmplStr=n.obj;break;default:throw Error("Unexpected template object type "+n.type+"; expected 'code', or 'string'")}else{if(!o.isString(n))throw Error("src must be a string or an object describing the source");this.tmplStr=n}if(this.path=r,i)try{this.a()}catch(n){throw o.t(this.path,this.env.opts.dev,n)}else this.compiled=!1},r.render=function(n,t,r){var i=this;"function"==typeof n?(r=n,n={}):"function"==typeof t&&(r=t,t=null);var e=!t;try{this.compile()}catch(n){var u=o.t(this.path,this.env.opts.dev,n);if(r)return g(r,u);throw u}var f=new k(n||{},this.blocks,this.env),c=t?t.push(!0):new b;c.topLevel=!0;var s=null,a=!1;return this.rootRenderFunc(this.env,f,c,y,function(n,t){if(a){if(r)return;throw n}if(n&&(n=o.t(i.path,i.env.opts.dev,n),a=!0),r)e?g(r,n,t):r(n,t);else{if(n)throw n;s=t}}),s},r.getExported=function(n,t,r){"function"==typeof n&&(r=n,n={}),"function"==typeof t&&(r=t,t=null);try{this.compile()}catch(n){if(r)return r(n);throw n}var i=t?t.push():new b;i.topLevel=!0;var e=new k(n||{},this.blocks,this.env);this.rootRenderFunc(this.env,e,i,y,function(n){n?r(n,null):r(null,e.getExported())})},r.compile=function(){this.compiled||this.a()},r.a=function(){var n;if(this.tmplProps)n=this.tmplProps;else{var t=f.compile(this.tmplStr,this.env.asyncFilters,this.env.extensionsList,this.path,this.env.opts);n=Function(t)()}this.blocks=this.h(n),this.rootRenderFunc=n.root,this.compiled=!0},r.h=function(n){var t={};return o.keys(n).forEach(function(r){"b_"===r.slice(0,2)&&(t[r.slice(2)]=n[r])}),t},t}(p);n.exports={Environment:E,Template:O}},function(n,t,r){"use strict";var i=r(9),e=[],u=[],o=i.makeRequestCallFromTimer(function(){if(u.length)throw u.shift()});function f(n){var t;(t=e.length?e.pop():new c).task=n,i(t)}function c(){this.task=null}n.exports=f,c.prototype.call=function(){try{this.task.call()}catch(n){f.onerror?f.onerror(n):(u.push(n),o())}finally{this.task=null,e[e.length]=this}}},function(n,t,r){"use strict";!function(t){function r(n){e.length||(i(),!0),e[e.length]=n}n.exports=r;var i,e=[],u=0,o=1024;function f(){for(;u<e.length;){var n=u;if(u+=1,e[n].call(),u>o){for(var t=0,r=e.length-u;t<r;t++)e[t]=e[t+u];e.length-=u,u=0}}e.length=0,u=0,!1}var c,s,a,h=void 0!==t?t:self,l=h.MutationObserver||h.WebKitMutationObserver;function v(n){return function(){var t=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(t),clearInterval(r),n()}}}"function"==typeof l?(c=1,s=new l(f),a=document.createTextNode(""),s.observe(a,{characterData:!0}),i=function(){c=-c,a.data=c}):i=v(f),r.requestFlush=i,r.makeRequestCallFromTimer=v}(r(10))},function(n,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(n){"object"==typeof window&&(r=window)}n.exports=r},function(n,t,r){var i;!function(r){"use strict";var e=function(){var n=Array.prototype.slice.call(arguments);"function"==typeof n[0]&&n[0].apply(null,n.splice(1))},u=function(n){"function"==typeof setImmediate?setImmediate(n):"undefined"!=typeof process&&process.nextTick?process.nextTick(n):setTimeout(n,0)},o=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},f=function(n,t,r){var i=r?u:e;if(t=t||function(){},!o(n))return t(Error("First argument to waterfall must be an array of functions"));if(!n.length)return t();var f=function(n){return function(r){if(r)t.apply(null,arguments),t=function(){};else{var e=Array.prototype.slice.call(arguments,1),u=n.next();u?e.push(f(u)):e.push(t),i(function(){n.apply(null,e)})}}};f(function(n){var t=function(r){var i=function(){return n.length&&n[r].apply(null,arguments),i.next()};return i.next=function(){return r<n.length-1?t(r+1):null},i};return t(0)}(n))()};void 0===(i=function(){return f}.apply(t,[]))||(n.exports=i)}()},function(n,t,r){"use strict";var i=r(1),e=r(2);function u(n,t){return null===n||void 0===n||!1===n?t:n}function o(n){return n!=n}function f(n){var t=(n=u(n,"")).toLowerCase();return e.copySafeness(n,t.charAt(0).toUpperCase()+t.slice(1))}function c(n){if(i.isString(n))return n.split("");if(i.isObject(n))return i.r(n||{}).map(function(n){return{key:n[0],value:n[1]}});if(i.isArray(n))return n;throw new i.TemplateError("list filter: type not iterable")}function s(n){return e.copySafeness(n,n.replace(/^\s*|\s*$/g,""))}(t=n.exports={}).abs=Math.abs,t.batch=function(n,t,r){var i,e=[],u=[];for(i=0;i<n.length;i++)i%t==0&&u.length&&(e.push(u),u=[]),u.push(n[i]);if(u.length){if(r)for(i=u.length;i<t;i++)u.push(r);e.push(u)}return e},t.capitalize=f,t.center=function(n,t){if(n=u(n,""),t=t||80,n.length>=t)return n;var r=t-n.length,o=i.repeat(" ",r/2-r%2),f=i.repeat(" ",r/2);return e.copySafeness(n,o+n+f)},t.default=function(n,t,r){return r?n||t:void 0!==n?n:t},t.dictsort=function(n,t,r){if(!i.isObject(n))throw new i.TemplateError("dictsort filter: val must be an object");var e,u=[];for(var o in n)u.push([o,n[o]]);if(void 0===r||"key"===r)e=0;else{if("value"!==r)throw new i.TemplateError("dictsort filter: You can only sort by either key or value");e=1}return u.sort(function(n,r){var u=n[e],o=r[e];return t||(i.isString(u)&&(u=u.toUpperCase()),i.isString(o)&&(o=o.toUpperCase())),u>o?1:u===o?0:-1}),u},t.dump=function(n,t){return JSON.stringify(n,null,t)},t.escape=function(n){return n instanceof e.SafeString?n:(n=null===n||void 0===n?"":n,e.markSafe(i.escape(n.toString())))},t.safe=function(n){return n instanceof e.SafeString?n:(n=null===n||void 0===n?"":n,e.markSafe(n.toString()))},t.first=function(n){return n[0]},t.forceescape=function(n){return n=null===n||void 0===n?"":n,e.markSafe(i.escape(n.toString()))},t.groupby=function(n,t){return i.groupBy(n,t)},t.indent=function(n,t,r){if(""===(n=u(n,"")))return"";t=t||4;var o=n.split("\n"),f=i.repeat(" ",t),c=o.map(function(n,t){return 0!==t||r?""+f+n+"\n":n+"\n"}).join("");return e.copySafeness(n,c)},t.join=function(n,t,r){return t=t||"",r&&(n=i.map(n,function(n){return n[r]})),n.join(t)},t.last=function(n){return n[n.length-1]},t.length=function(n){var t=u(n,"");return void 0!==t?"function"==typeof Map&&t instanceof Map||"function"==typeof Set&&t instanceof Set?t.size:!i.isObject(t)||t instanceof e.SafeString?t.length:i.keys(t).length:0},t.list=c,t.lower=function(n){return(n=u(n,"")).toLowerCase()},t.nl2br=function(n){return null===n||void 0===n?"":e.copySafeness(n,n.replace(/\r\n|\n/g,"<br />\n"))},t.random=function(n){return n[Math.floor(Math.random()*n.length)]},t.rejectattr=function(n,t){return n.filter(function(n){return!n[t]})},t.selectattr=function(n,t){return n.filter(function(n){return!!n[t]})},t.replace=function(n,t,r,i){var u=n;if(t instanceof RegExp)return n.replace(t,r);void 0===i&&(i=-1);var o="";if("number"==typeof t)t=""+t;else if("string"!=typeof t)return n;if("number"==typeof n&&(n=""+n),"string"!=typeof n&&!(n instanceof e.SafeString))return n;if(""===t)return o=r+n.split("").join(r)+r,e.copySafeness(n,o);var f=n.indexOf(t);if(0===i||-1===f)return n;for(var c=0,s=0;f>-1&&(-1===i||s<i);)o+=n.substring(c,f)+r,c=f+t.length,s++,f=n.indexOf(t,c);return c<n.length&&(o+=n.substring(c)),e.copySafeness(u,o)},t.reverse=function(n){var t;return(t=i.isString(n)?c(n):i.map(n,function(n){return n})).reverse(),i.isString(n)?e.copySafeness(n,t.join("")):t},t.round=function(n,t,r){var i=Math.pow(10,t=t||0);return("ceil"===r?Math.ceil:"floor"===r?Math.floor:Math.round)(n*i)/i},t.slice=function(n,t,r){for(var i=Math.floor(n.length/t),e=n.length%t,u=[],o=0,f=0;f<t;f++){var c=o+f*i;f<e&&o++;var s=o+(f+1)*i,a=n.slice(c,s);r&&f>=e&&a.push(r),u.push(a)}return u},t.sum=function(n,t,r){return void 0===r&&(r=0),t&&(n=i.map(n,function(n){return n[t]})),r+n.reduce(function(n,t){return n+t},0)},t.sort=e.makeMacro(["value","reverse","case_sensitive","attribute"],[],function(n,t,r,e){var u=i.map(n,function(n){return n});return u.sort(function(n,u){var o=e?n[e]:n,f=e?u[e]:u;return!r&&i.isString(o)&&i.isString(f)&&(o=o.toLowerCase(),f=f.toLowerCase()),o<f?t?1:-1:o>f?t?-1:1:0}),u}),t.string=function(n){return e.copySafeness(n,n)},t.striptags=function(n,t){var r=s((n=u(n,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|<!--[\s\S]*?-->/gi,"")),i="";return i=t?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),e.copySafeness(n,i)},t.title=function(n){var t=(n=u(n,"")).split(" ").map(function(n){return f(n)});return e.copySafeness(n,t.join(" "))},t.trim=s,t.truncate=function(n,t,r,i){var o=n;if(n=u(n,""),t=t||255,n.length<=t)return n;if(r)n=n.substring(0,t);else{var f=n.lastIndexOf(" ",t);-1===f&&(f=t),n=n.substring(0,f)}return n+=void 0!==i&&null!==i?i:"...",e.copySafeness(o,n)},t.upper=function(n){return(n=u(n,"")).toUpperCase()},t.urlencode=function(n){var t=encodeURIComponent;return i.isString(n)?t(n):(i.isArray(n)?n:i.r(n)).map(function(n){var r=n[0],i=n[1];return t(r)+"="+t(i)}).join("&")};var a=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,h=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,l=/^https?:\/\/.*$/,v=/^www\./,d=/\.(?:org|net|com)(?:\:|\/|$)/;t.urlize=function(n,t,r){o(t)&&(t=1/0);var i=!0===r?' rel="nofollow"':"";return n.split(/(\s+)/).filter(function(n){return n&&n.length}).map(function(n){var r=n.match(a),e=r?r[1]:n,u=e.substr(0,t);return l.test(e)?'<a href="'+e+'"'+i+">"+u+"</a>":v.test(e)?'<a href="http://'+e+'"'+i+">"+u+"</a>":h.test(e)?'<a href="mailto:'+e+'">'+e+"</a>":d.test(e)?'<a href="http://'+e+'"'+i+">"+u+"</a>":n}).join("")},t.wordcount=function(n){var t=(n=u(n,""))?n.match(/\w+/g):null;return t?t.length:null},t.float=function(n,t){var r=parseFloat(n);return o(r)?t:r},t.int=function(n,t){var r=parseInt(n,10);return o(r)?t:r},t.d=t.default,t.e=t.escape},function(n,t,r){"use strict";var i=r(2).SafeString;t.callable=function(n){return"function"==typeof n},t.defined=function(n){return void 0!==n},t.divisibleby=function(n,t){return n%t==0},t.escaped=function(n){return n instanceof i},t.equalto=function(n,t){return n===t},t.eq=t.equalto,t.sameas=t.equalto,t.even=function(n){return n%2==0},t.falsy=function(n){return!n},t.ge=function(n,t){return n>=t},t.greaterthan=function(n,t){return n>t},t.gt=t.greaterthan,t.le=function(n,t){return n<=t},t.lessthan=function(n,t){return n<t},t.lt=t.lessthan,t.lower=function(n){return n.toLowerCase()===n},t.ne=function(n,t){return n!==t},t.null=function(n){return null===n},t.number=function(n){return"number"==typeof n},t.odd=function(n){return n%2==1},t.string=function(n){return"string"==typeof n},t.truthy=function(n){return!!n},t.undefined=function(n){return void 0===n},t.upper=function(n){return n.toUpperCase()===n},t.iterable=function(n){return"undefined"!=typeof Symbol?!!n[Symbol.iterator]:Array.isArray(n)||"string"==typeof n},t.mapping=function(n){var t=null!==n&&void 0!==n&&"object"==typeof n&&!Array.isArray(n);return Set?t&&!(n instanceof Set):t}},function(n,t,r){"use strict";n.exports=function(){return{range:function(n,t,r){void 0===t?(t=n,n=0,r=1):r||(r=1);var i=[];if(r>0)for(var e=n;e<t;e+=r)i.push(e);else for(var u=n;u>t;u+=r)i.push(u);return i},cycler:function(){return n=Array.prototype.slice.call(arguments),t=-1,{current:null,reset:function(){t=-1,this.current=null},next:function(){return++t>=n.length&&(t=0),this.current=n[t],this.current}};var n,t},joiner:function(n){return function(n){n=n||",";var t=!0;return function(){var r=t?"":n;return t=!1,r}}(n)}}}},function(n,t,r){var i=r(0);n.exports=function(n,t){function r(n,t){if(this.name=n,this.path=n,this.defaultEngine=t.defaultEngine,this.ext=i.extname(n),!this.ext&&!this.defaultEngine)throw Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return r.prototype.render=function(t,r){n.render(this.name,t,r)},t.set("view",r),t.set("nunjucksEnv",n),n}},function(n,t,r){n.exports=function(){"use strict";var n,t,r=this.runtime,i=this.lib,e=this.compiler.Compiler,u=this.parser.Parser,o=(this.nodes,this.lexer,r.contextOrFrameLookup),f=r.memberLookup;function c(n,t){return Object.prototype.hasOwnProperty.call(n,t)}e&&(n=e.prototype.assertType),u&&(t=u.prototype.parseAggregate),r.contextOrFrameLookup=function(n,t,r){var i=o.apply(this,arguments);if(void 0!==i)return i;switch(r){case"True":return!0;case"False":return!1;case"None":return null;default:return}};var s={pop:function(n){if(void 0===n)return this.pop();if(n>=this.length||n<0)throw Error("KeyError");return this.splice(n,1)},append:function(n){return this.push(n)},remove:function(n){for(var t=0;t<this.length;t++)if(this[t]===n)return this.splice(t,1);throw Error("ValueError")},count:function(n){for(var t=0,r=0;r<this.length;r++)this[r]===n&&t++;return t},index:function(n){var t;if(-1===(t=this.indexOf(n)))throw Error("ValueError");return t},find:function(n){return this.indexOf(n)},insert:function(n,t){return this.splice(n,0,t)}},a={items:function(){return i.r(this)},values:function(){return i.u(this)},keys:function(){return i.keys(this)},get:function(n,t){var r=this[n];return void 0===r&&(r=t),r},has_key:function(n){return c(this,n)},pop:function(n,t){var r=this[n];if(void 0===r&&void 0!==t)r=t;else{if(void 0===r)throw Error("KeyError");delete this[n]}return r},popitem:function(){var n=i.keys(this);if(!n.length)throw Error("KeyError");var t=n[0],r=this[t];return delete this[t],[t,r]},setdefault:function(n,t){return void 0===t&&(t=null),n in this||(this[n]=t),this[n]},update:function(n){return i.f(this,n),null}};return a.iteritems=a.items,a.itervalues=a.values,a.iterkeys=a.keys,r.memberLookup=function(n,t,e){return 4===arguments.length?function(n,t,i,e){n=n||[],null===t&&(t=e<0?n.length-1:0),null===i?i=e<0?-1:n.length:i<0&&(i+=n.length),t<0&&(t+=n.length);for(var u=[],o=t;!(o<0||o>n.length||e>0&&o>=i||e<0&&o<=i);o+=e)u.push(r.memberLookup(n,o));return u}.apply(this,arguments):(n=n||{},i.isArray(n)&&c(s,t)?s[t].bind(n):i.isObject(n)&&c(a,t)?a[t].bind(n):f.apply(this,arguments))},function(){r.contextOrFrameLookup=o,r.memberLookup=f,e&&(e.prototype.assertType=n),u&&(u.prototype.parseAggregate=t)}}}])}); | ||
/*! Browser bundle of nunjucks 3.2.0 (slim, only works with precompiled templates) */ | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.nunjucks=n():t.nunjucks=n()}("undefined"!=typeof self?self:this,function(){return function(t){var n={};function r(i){if(n[i])return n[i].exports;var e=n[i]={i:i,l:!1,exports:{}};return t[i].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=t,r.c=n,r.d=function(t,n,i){r.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=6)}([function(t,n){},function(t,n,r){"use strict";var i=Array.prototype,e=Object.prototype,u={"&":"&",'"':""","'":"'","<":"<",">":">"},o=/[&"'<>]/g;function f(t,n){return e.hasOwnProperty.call(t,n)}function c(t){return u[t]}function s(t,n,r){var i,e,u;if(t instanceof Error&&(t=(e=t).name+": "+e.message),Object.setPrototypeOf?Object.setPrototypeOf(i=Error(t),s.prototype):Object.defineProperty(i=this,"message",{enumerable:!1,writable:!0,value:t}),Object.defineProperty(i,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(i,this.constructor),e){var o=Object.getOwnPropertyDescriptor(e,"stack");(u=o&&(o.get||function(){return o.value}))||(u=function(){return e.stack})}else{var f=Error(t).stack;u=function(){return f}}return Object.defineProperty(i,"stack",{get:function(){return u.call(i)}}),Object.defineProperty(i,"cause",{value:e}),i.lineno=n,i.colno=r,i.firstUpdate=!0,i.Update=function(t){var n="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?n+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(n+=" [Line "+this.lineno+"]")),n+="\n ",this.firstUpdate&&(n+=" "),this.message=n+(this.message||""),this.firstUpdate=!1,this},i}function a(t){return"[object Function]"===e.toString.call(t)}function h(t){return"[object Array]"===e.toString.call(t)}function v(t){return"[object String]"===e.toString.call(t)}function l(t){return"[object Object]"===e.toString.call(t)}function d(t){return Array.prototype.slice.call(t)}function p(t,n,r){return Array.prototype.indexOf.call(t||[],n,r)}function y(t){var n=[];for(var r in t)f(t,r)&&n.push(r);return n}(n=t.exports={}).hasOwnProp=f,n.t=function(t,r,i){if(i.Update||(i=new n.TemplateError(i)),i.Update(t),!r){var e=i;(i=Error(e.message)).name=e.name}return i},Object.setPrototypeOf?Object.setPrototypeOf(s.prototype,Error.prototype):s.prototype=Object.create(Error.prototype,{constructor:{value:s}}),n.TemplateError=s,n.escape=function(t){return t.replace(o,c)},n.isFunction=a,n.isArray=h,n.isString=v,n.isObject=l,n.groupBy=function(t,n){for(var r={},i=a(n)?n:function(t){return t[n]},e=0;e<t.length;e++){var u=t[e],o=i(u,e);(r[o]||(r[o]=[])).push(u)}return r},n.toArray=d,n.without=function(t){var n=[];if(!t)return n;for(var r=t.length,i=d(arguments).slice(1),e=-1;++e<r;)-1===p(i,t[e])&&n.push(t[e]);return n},n.repeat=function(t,n){for(var r="",i=0;i<n;i++)r+=t;return r},n.each=function(t,n,r){if(null!=t)if(i.forEach&&t.forEach===i.forEach)t.forEach(n,r);else if(t.length===+t.length)for(var e=0,u=t.length;e<u;e++)n.call(r,t[e],e,t)},n.map=function(t,n){var r=[];if(null==t)return r;if(i.map&&t.map===i.map)return t.map(n);for(var e=0;e<t.length;e++)r[r.length]=n(t[e],e);return t.length===+t.length&&(r.length=t.length),r},n.asyncIter=function(t,n,r){var i=-1;!function e(){++i<t.length?n(t[i],i,e,r):r()}()},n.asyncFor=function(t,n,r){var i=y(t||{}),e=i.length,u=-1;!function o(){var f=i[++u];u<e?n(f,t[f],u,e,o):r()}()},n.indexOf=p,n.keys=y,n.r=function(t){return y(t).map(function(n){return[n,t[n]]})},n.u=function(t){return y(t).map(function(n){return t[n]})},n.f=n.extend=function(t,n){return t=t||{},y(n).forEach(function(r){t[r]=n[r]}),t},n.inOperator=function(t,n){if(h(n)||v(n))return-1!==n.indexOf(t);if(l(n))return t in n;throw Error('Cannot use "in" operator to search for "'+t+'" in unexpected types.')}},function(t,n,r){"use strict";var i=r(1),e=Array.from,u="function"==typeof Symbol&&Symbol.iterator&&"function"==typeof e,o=function(){function t(t,n){this.variables={},this.parent=t,this.topLevel=!1,this.isolateWrites=n}var n=t.prototype;return n.set=function(t,n,r){var i=t.split("."),e=this.variables,u=this;if(r&&(u=this.resolve(i[0],!0)))u.set(t,n);else{for(var o=0;o<i.length-1;o++){var f=i[o];e[f]||(e[f]={}),e=e[f]}e[i[i.length-1]]=n}},n.get=function(t){var n=this.variables[t];return void 0!==n?n:null},n.lookup=function(t){var n=this.parent,r=this.variables[t];return void 0!==r?r:n&&n.lookup(t)},n.resolve=function(t,n){var r=n&&this.isolateWrites?void 0:this.parent;return void 0!==this.variables[t]?this:r&&r.resolve(t)},n.push=function(n){return new t(this,n)},n.pop=function(){return this.parent},t}();function f(t){return t&&Object.prototype.hasOwnProperty.call(t,"__keywords")}function c(t){var n=t.length;return 0===n?0:f(t[n-1])?n-1:n}function s(t){if("string"!=typeof t)return t;this.val=t,this.length=t.length}s.prototype=Object.create(String.prototype,{length:{writable:!0,configurable:!0,value:0}}),s.prototype.valueOf=function(){return this.val},s.prototype.toString=function(){return this.val},t.exports={Frame:o,makeMacro:function(t,n,r){var i=this;return function(){for(var e=arguments.length,u=Array(e),o=0;o<e;o++)u[o]=arguments[o];var s,a=c(u),h=function(t){var n=t.length;if(n){var r=t[n-1];if(f(r))return r}return{}}(u);if(a>t.length)s=u.slice(0,t.length),u.slice(s.length,a).forEach(function(t,r){r<n.length&&(h[n[r]]=t)}),s.push(h);else if(a<t.length){s=u.slice(0,a);for(var v=a;v<t.length;v++){var l=t[v];s.push(h[l]),delete h[l]}s.push(h)}else s=u;return r.apply(i,s)}},makeKeywordArgs:function(t){return t.__keywords=!0,t},numArgs:c,suppressValue:function(t,n){return t=void 0!==t&&null!==t?t:"",!n||t instanceof s||(t=i.escape(t.toString())),t},ensureDefined:function(t,n,r){if(null===t||void 0===t)throw new i.TemplateError("attempted to output null or undefined value",n+1,r+1);return t},memberLookup:function(t,n){if(void 0!==t&&null!==t)return"function"==typeof t[n]?function(){for(var r=arguments.length,i=Array(r),e=0;e<r;e++)i[e]=arguments[e];return t[n].apply(t,i)}:t[n]},contextOrFrameLookup:function(t,n,r){var i=n.lookup(r);return void 0!==i?i:t.lookup(r)},callWrap:function(t,n,r,i){if(!t)throw Error("Unable to call `"+n+"`, which is undefined or falsey");if("function"!=typeof t)throw Error("Unable to call `"+n+"`, which is not a function");return t.apply(r,i)},handleError:function(t,n,r){return t.lineno?t:new i.TemplateError(t,n,r)},isArray:i.isArray,keys:i.keys,SafeString:s,copySafeness:function(t,n){return t instanceof s?new s(n):n.toString()},markSafe:function(t){var n=typeof t;return"string"===n?new s(t):"function"!==n?t:function(n){var r=t.apply(this,arguments);return"string"==typeof r?new s(r):r}},asyncEach:function(t,n,r,e){if(i.isArray(t)){var u=t.length;i.asyncIter(t,function(t,i,e){switch(n){case 1:r(t,i,u,e);break;case 2:r(t[0],t[1],i,u,e);break;case 3:r(t[0],t[1],t[2],i,u,e);break;default:t.push(i,u,e),r.apply(this,t)}},e)}else i.asyncFor(t,function(t,n,i,e,u){r(t,n,i,e,u)},e)},asyncAll:function(t,n,r,e){var u,o,f=0;function c(t,n){f++,o[t]=n,f===u&&e(null,o.join(""))}if(i.isArray(t))if(u=t.length,o=Array(u),0===u)e(null,"");else for(var s=0;s<t.length;s++){var a=t[s];switch(n){case 1:r(a,s,u,c);break;case 2:r(a[0],a[1],s,u,c);break;case 3:r(a[0],a[1],a[2],s,u,c);break;default:a.push(s,u,c),r.apply(this,a)}}else{var h=i.keys(t||{});if(u=h.length,o=Array(u),0===u)e(null,"");else for(var v=0;v<h.length;v++){var l=h[v];r(l,t[l],v,u,c)}}},inOperator:i.inOperator,fromIterator:function(t){return"object"!=typeof t||null===t||i.isArray(t)?t:u&&Symbol.iterator in t?e(t):t}}},function(t,n,r){"use strict";var i=function(t){var n,r;function i(n){var r;return(r=t.call(this)||this).precompiled=n||{},r}return r=t,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,i.prototype.getSource=function(t){return this.precompiled[t]?{src:{type:"code",obj:this.precompiled[t]},path:t}:null},i}(r(4));t.exports={PrecompiledLoader:i}},function(t,n,r){"use strict";var i=r(0),e=r(5).EmitterObj;t.exports=function(t){var n,r;function e(){return t.apply(this,arguments)||this}r=t,(n=e).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r;var u=e.prototype;return u.resolve=function(t,n){return i.resolve(i.dirname(t),n)},u.isRelative=function(t){return 0===t.indexOf("./")||0===t.indexOf("../")},e}(e)},function(t,n,r){"use strict";function i(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function e(t,n,r){return n&&i(t.prototype,n),r&&i(t,r),t}function u(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}var o=r(13),f=r(1);function c(t,n,r){r=r||{},f.keys(r).forEach(function(n){var i,e;r[n]=(i=t.prototype[n],e=r[n],"function"!=typeof i||"function"!=typeof e?e:function(){var t=this.parent;this.parent=i;var n=e.apply(this,arguments);return this.parent=t,n})});var i=function(t){function r(){return t.apply(this,arguments)||this}return u(r,t),e(r,[{key:"typename",get:function(){return n}}]),r}(t);return f.f(i.prototype,r),i}var s=function(){function t(){this.init.apply(this,arguments)}return t.prototype.init=function(){},t.extend=function(t,n){return"object"==typeof t&&(n=t,t="anonymous"),c(this,t,n)},e(t,[{key:"typename",get:function(){return this.constructor.name}}]),t}(),a=function(t){function n(){var n,r;return(n=r=t.call(this)||this).init.apply(n,arguments),r}return u(n,t),n.prototype.init=function(){},n.extend=function(t,n){return"object"==typeof t&&(n=t,t="anonymous"),c(this,t,n)},e(n,[{key:"typename",get:function(){return this.constructor.name}}]),n}(o);t.exports={Obj:s,EmitterObj:a}},function(t,n,r){"use strict";var i,e=r(1),u=r(7),o=u.Environment,f=u.Template,c=r(4),s=r(3),a=r(0),h=r(0),v=r(0),l=r(0),d=r(2),p=r(0),y=r(17);function b(t,n){var r;return n=n||{},e.isObject(t)&&(n=t,t=null),s.FileSystemLoader?r=new s.FileSystemLoader(t,{watch:n.watch,noCache:n.noCache}):s.WebLoader&&(r=new s.WebLoader(t,{useCache:n.web&&n.web.useCache,async:n.web&&n.web.async})),i=new o(r,n),n&&n.express&&i.express(n.express),i}t.exports={Environment:o,Template:f,Loader:c,FileSystemLoader:s.FileSystemLoader,NodeResolveLoader:s.NodeResolveLoader,PrecompiledLoader:s.PrecompiledLoader,WebLoader:s.WebLoader,compiler:h,parser:v,lexer:l,runtime:d,lib:e,nodes:p,installJinjaCompat:y,configure:b,reset:function(){i=void 0},compile:function(t,n,r,e){return i||b(),new f(t,n,r,e)},render:function(t,n,r){return i||b(),i.render(t,n,r)},renderString:function(t,n,r){return i||b(),i.renderString(t,n,r)},precompile:a?a.precompile:void 0,precompileString:a?a.precompileString:void 0}},function(t,n,r){"use strict";function i(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}var e=r(8),u=r(11),o=r(1),f=r(0),c=r(12),s=r(3),a=s.FileSystemLoader,h=s.WebLoader,v=s.PrecompiledLoader,l=r(14),d=r(15),p=r(5),y=p.Obj,b=p.EmitterObj,w=r(2),m=w.handleError,g=w.Frame,j=r(16);function E(t,n,r){e(function(){t(n,r)})}var O={type:"code",obj:{root:function(t,n,r,i,e){try{e(null,"")}catch(t){e(m(t,null,null))}}}},k=function(t){function n(){return t.apply(this,arguments)||this}i(n,t);var r=n.prototype;return r.init=function(t,n){var r=this;n=this.opts=n||{},this.opts.dev=!!n.dev,this.opts.autoescape=null==n.autoescape||n.autoescape,this.opts.throwOnUndefined=!!n.throwOnUndefined,this.opts.trimBlocks=!!n.trimBlocks,this.opts.lstripBlocks=!!n.lstripBlocks,this.loaders=[],t?this.loaders=o.isArray(t)?t:[t]:a?this.loaders=[new a("views")]:h&&(this.loaders=[new h("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new v(window.nunjucksPrecompiled)),this.a(),this.globals=d(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],o.r(c).forEach(function(t){var n=t[0],i=t[1];return r.addFilter(n,i)}),o.r(l).forEach(function(t){var n=t[0],i=t[1];return r.addTest(n,i)})},r.a=function(){var t=this;this.loaders.forEach(function(n){n.cache={},"function"==typeof n.on&&(n.on("update",function(r,i){n.cache[r]=null,t.emit("update",r,i,n)}),n.on("load",function(r,i){t.emit("load",r,i,n)}))})},r.invalidateCache=function(){this.loaders.forEach(function(t){t.cache={}})},r.addExtension=function(t,n){return n.__name=t,this.extensions[t]=n,this.extensionsList.push(n),this},r.removeExtension=function(t){var n=this.getExtension(t);n&&(this.extensionsList=o.without(this.extensionsList,n),delete this.extensions[t])},r.getExtension=function(t){return this.extensions[t]},r.hasExtension=function(t){return!!this.extensions[t]},r.addGlobal=function(t,n){return this.globals[t]=n,this},r.getGlobal=function(t){if(void 0===this.globals[t])throw Error("global not found: "+t);return this.globals[t]},r.addFilter=function(t,n,r){var i=n;return r&&this.asyncFilters.push(t),this.filters[t]=i,this},r.getFilter=function(t){if(!this.filters[t])throw Error("filter not found: "+t);return this.filters[t]},r.addTest=function(t,n){return this.tests[t]=n,this},r.getTest=function(t){if(!this.tests[t])throw Error("test not found: "+t);return this.tests[t]},r.resolveTemplate=function(t,n,r){return!(!t.isRelative||!n)&&t.isRelative(r)&&t.resolve?t.resolve(n,r):r},r.getTemplate=function(t,n,r,i,e){var u,f=this,c=this,s=null;if(t&&t.raw&&(t=t.raw),o.isFunction(r)&&(e=r,r=null,n=n||!1),o.isFunction(n)&&(e=n,n=!1),t instanceof S)s=t;else{if("string"!=typeof t)throw Error("template names must be a string: "+t);for(var a=0;a<this.loaders.length;a++){var h=this.loaders[a];if(s=h.cache[this.resolveTemplate(h,r,t)])break}}if(s)return n&&s.compile(),e?void e(null,s):s;return o.asyncIter(this.loaders,function(n,i,e,u){function o(t,r){t?u(t):r?(r.loader=n,u(null,r)):e()}t=c.resolveTemplate(n,r,t),n.async?n.getSource(t,o):o(null,n.getSource(t))},function(r,o){if(o||r||i||(r=Error("template not found: "+t)),r){if(e)return void e(r);throw r}var c;o?(c=new S(o.src,f,o.path,n),o.noCache||(o.loader.cache[t]=c)):c=new S(O,f,"",n),e?e(null,c):u=c}),u},r.express=function(t){return j(this,t)},r.render=function(t,n,r){o.isFunction(n)&&(r=n,n=null);var i=null;return this.getTemplate(t,function(t,e){if(t&&r)E(r,t);else{if(t)throw t;i=e.render(n,r)}}),i},r.renderString=function(t,n,r,i){return o.isFunction(r)&&(i=r,r={}),new S(t,this,(r=r||{}).path).render(n,i)},r.waterfall=function(t,n,r){return u(t,n,r)},n}(b),A=function(t){function n(){return t.apply(this,arguments)||this}i(n,t);var r=n.prototype;return r.init=function(t,n,r){var i=this;this.env=r||new k,this.ctx=o.extend({},t),this.blocks={},this.exported=[],o.keys(n).forEach(function(t){i.addBlock(t,n[t])})},r.lookup=function(t){return t in this.env.globals&&!(t in this.ctx)?this.env.globals[t]:this.ctx[t]},r.setVariable=function(t,n){this.ctx[t]=n},r.getVariables=function(){return this.ctx},r.addBlock=function(t,n){return this.blocks[t]=this.blocks[t]||[],this.blocks[t].push(n),this},r.getBlock=function(t){if(!this.blocks[t])throw Error('unknown block "'+t+'"');return this.blocks[t][0]},r.getSuper=function(t,n,r,i,e,u){var f=o.indexOf(this.blocks[n]||[],r),c=this.blocks[n][f+1];if(-1===f||!c)throw Error('no super block available for "'+n+'"');c(t,this,i,e,u)},r.addExport=function(t){this.exported.push(t)},r.getExported=function(){var t=this,n={};return this.exported.forEach(function(r){n[r]=t.ctx[r]}),n},n}(y),S=function(t){function n(){return t.apply(this,arguments)||this}i(n,t);var r=n.prototype;return r.init=function(t,n,r,i){if(this.env=n||new k,o.isObject(t))switch(t.type){case"code":this.tmplProps=t.obj;break;case"string":this.tmplStr=t.obj;break;default:throw Error("Unexpected template object type "+t.type+"; expected 'code', or 'string'")}else{if(!o.isString(t))throw Error("src must be a string or an object describing the source");this.tmplStr=t}if(this.path=r,i)try{this.h()}catch(t){throw o.t(this.path,this.env.opts.dev,t)}else this.compiled=!1},r.render=function(t,n,r){var i=this;"function"==typeof t?(r=t,t={}):"function"==typeof n&&(r=n,n=null);var e=!n;try{this.compile()}catch(t){var u=o.t(this.path,this.env.opts.dev,t);if(r)return E(r,u);throw u}var f=new A(t||{},this.blocks,this.env),c=n?n.push(!0):new g;c.topLevel=!0;var s=null,a=!1;return this.rootRenderFunc(this.env,f,c,w,function(t,n){if(a){if(r)return;throw t}if(t&&(t=o.t(i.path,i.env.opts.dev,t),a=!0),r)e?E(r,t,n):r(t,n);else{if(t)throw t;s=n}}),s},r.getExported=function(t,n,r){"function"==typeof t&&(r=t,t={}),"function"==typeof n&&(r=n,n=null);try{this.compile()}catch(t){if(r)return r(t);throw t}var i=n?n.push():new g;i.topLevel=!0;var e=new A(t||{},this.blocks,this.env);this.rootRenderFunc(this.env,e,i,w,function(t){t?r(t,null):r(null,e.getExported())})},r.compile=function(){this.compiled||this.h()},r.h=function(){var t;if(this.tmplProps)t=this.tmplProps;else{var n=f.compile(this.tmplStr,this.env.asyncFilters,this.env.extensionsList,this.path,this.env.opts);t=Function(n)()}this.blocks=this.v(t),this.rootRenderFunc=t.root,this.compiled=!0},r.v=function(t){var n={};return o.keys(t).forEach(function(r){"b_"===r.slice(0,2)&&(n[r.slice(2)]=t[r])}),n},n}(y);t.exports={Environment:k,Template:S}},function(t,n,r){"use strict";var i=r(9),e=[],u=[],o=i.makeRequestCallFromTimer(function(){if(u.length)throw u.shift()});function f(t){var n;(n=e.length?e.pop():new c).task=t,i(n)}function c(){this.task=null}t.exports=f,c.prototype.call=function(){try{this.task.call()}catch(t){f.onerror?f.onerror(t):(u.push(t),o())}finally{this.task=null,e[e.length]=this}}},function(t,n,r){"use strict";!function(n){function r(t){e.length||(i(),!0),e[e.length]=t}t.exports=r;var i,e=[],u=0,o=1024;function f(){for(;u<e.length;){var t=u;if(u+=1,e[t].call(),u>o){for(var n=0,r=e.length-u;n<r;n++)e[n]=e[n+u];e.length-=u,u=0}}e.length=0,u=0,!1}var c,s,a,h=void 0!==n?n:self,v=h.MutationObserver||h.WebKitMutationObserver;function l(t){return function(){var n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}"function"==typeof v?(c=1,s=new v(f),a=document.createTextNode(""),s.observe(a,{characterData:!0}),i=function(){c=-c,a.data=c}):i=l(f),r.requestFlush=i,r.makeRequestCallFromTimer=l}(r(10))},function(t,n){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,n,r){var i;!function(r){"use strict";var e=function(){var t=Array.prototype.slice.call(arguments);"function"==typeof t[0]&&t[0].apply(null,t.splice(1))},u=function(t){"function"==typeof setImmediate?setImmediate(t):"undefined"!=typeof process&&process.nextTick?process.nextTick(t):setTimeout(t,0)},o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},f=function(t,n,r){var i=r?u:e;if(n=n||function(){},!o(t))return n(Error("First argument to waterfall must be an array of functions"));if(!t.length)return n();var f=function(t){return function(r){if(r)n.apply(null,arguments),n=function(){};else{var e=Array.prototype.slice.call(arguments,1),u=t.next();u?e.push(f(u)):e.push(n),i(function(){t.apply(null,e)})}}};f(function(t){var n=function(r){var i=function(){return t.length&&t[r].apply(null,arguments),i.next()};return i.next=function(){return r<t.length-1?n(r+1):null},i};return n(0)}(t))()};void 0===(i=function(){return f}.apply(n,[]))||(t.exports=i)}()},function(t,n,r){"use strict";var i=r(1),e=r(2);function u(t,n){return null===t||void 0===t||!1===t?n:t}function o(t){return t!=t}function f(t){var n=(t=u(t,"")).toLowerCase();return e.copySafeness(t,n.charAt(0).toUpperCase()+n.slice(1))}function c(t){if(i.isString(t))return t.split("");if(i.isObject(t))return i.r(t||{}).map(function(t){return{key:t[0],value:t[1]}});if(i.isArray(t))return t;throw new i.TemplateError("list filter: type not iterable")}function s(t){return e.copySafeness(t,t.replace(/^\s*|\s*$/g,""))}(n=t.exports={}).abs=Math.abs,n.batch=function(t,n,r){var i,e=[],u=[];for(i=0;i<t.length;i++)i%n==0&&u.length&&(e.push(u),u=[]),u.push(t[i]);if(u.length){if(r)for(i=u.length;i<n;i++)u.push(r);e.push(u)}return e},n.capitalize=f,n.center=function(t,n){if(t=u(t,""),n=n||80,t.length>=n)return t;var r=n-t.length,o=i.repeat(" ",r/2-r%2),f=i.repeat(" ",r/2);return e.copySafeness(t,o+t+f)},n.default=function(t,n,r){return r?t||n:void 0!==t?t:n},n.dictsort=function(t,n,r){if(!i.isObject(t))throw new i.TemplateError("dictsort filter: val must be an object");var e,u=[];for(var o in t)u.push([o,t[o]]);if(void 0===r||"key"===r)e=0;else{if("value"!==r)throw new i.TemplateError("dictsort filter: You can only sort by either key or value");e=1}return u.sort(function(t,r){var u=t[e],o=r[e];return n||(i.isString(u)&&(u=u.toUpperCase()),i.isString(o)&&(o=o.toUpperCase())),u>o?1:u===o?0:-1}),u},n.dump=function(t,n){return JSON.stringify(t,null,n)},n.escape=function(t){return t instanceof e.SafeString?t:(t=null===t||void 0===t?"":t,e.markSafe(i.escape(t.toString())))},n.safe=function(t){return t instanceof e.SafeString?t:(t=null===t||void 0===t?"":t,e.markSafe(t.toString()))},n.first=function(t){return t[0]},n.forceescape=function(t){return t=null===t||void 0===t?"":t,e.markSafe(i.escape(t.toString()))},n.groupby=function(t,n){return i.groupBy(t,n)},n.indent=function(t,n,r){if(""===(t=u(t,"")))return"";n=n||4;var o=t.split("\n"),f=i.repeat(" ",n),c=o.map(function(t,n){return 0!==n||r?""+f+t+"\n":t+"\n"}).join("");return e.copySafeness(t,c)},n.join=function(t,n,r){return n=n||"",r&&(t=i.map(t,function(t){return t[r]})),t.join(n)},n.last=function(t){return t[t.length-1]},n.length=function(t){var n=u(t,"");return void 0!==n?"function"==typeof Map&&n instanceof Map||"function"==typeof Set&&n instanceof Set?n.size:!i.isObject(n)||n instanceof e.SafeString?n.length:i.keys(n).length:0},n.list=c,n.lower=function(t){return(t=u(t,"")).toLowerCase()},n.nl2br=function(t){return null===t||void 0===t?"":e.copySafeness(t,t.replace(/\r\n|\n/g,"<br />\n"))},n.random=function(t){return t[Math.floor(Math.random()*t.length)]},n.rejectattr=function(t,n){return t.filter(function(t){return!t[n]})},n.selectattr=function(t,n){return t.filter(function(t){return!!t[n]})},n.replace=function(t,n,r,i){var u=t;if(n instanceof RegExp)return t.replace(n,r);void 0===i&&(i=-1);var o="";if("number"==typeof n)n=""+n;else if("string"!=typeof n)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof e.SafeString))return t;if(""===n)return o=r+t.split("").join(r)+r,e.copySafeness(t,o);var f=t.indexOf(n);if(0===i||-1===f)return t;for(var c=0,s=0;f>-1&&(-1===i||s<i);)o+=t.substring(c,f)+r,c=f+n.length,s++,f=t.indexOf(n,c);return c<t.length&&(o+=t.substring(c)),e.copySafeness(u,o)},n.reverse=function(t){var n;return(n=i.isString(t)?c(t):i.map(t,function(t){return t})).reverse(),i.isString(t)?e.copySafeness(t,n.join("")):n},n.round=function(t,n,r){var i=Math.pow(10,n=n||0);return("ceil"===r?Math.ceil:"floor"===r?Math.floor:Math.round)(t*i)/i},n.slice=function(t,n,r){for(var i=Math.floor(t.length/n),e=t.length%n,u=[],o=0,f=0;f<n;f++){var c=o+f*i;f<e&&o++;var s=o+(f+1)*i,a=t.slice(c,s);r&&f>=e&&a.push(r),u.push(a)}return u},n.sum=function(t,n,r){return void 0===r&&(r=0),n&&(t=i.map(t,function(t){return t[n]})),r+t.reduce(function(t,n){return t+n},0)},n.sort=e.makeMacro(["value","reverse","case_sensitive","attribute"],[],function(t,n,r,e){var u=i.map(t,function(t){return t});return u.sort(function(t,u){var o=e?t[e]:t,f=e?u[e]:u;return!r&&i.isString(o)&&i.isString(f)&&(o=o.toLowerCase(),f=f.toLowerCase()),o<f?n?1:-1:o>f?n?-1:1:0}),u}),n.string=function(t){return e.copySafeness(t,t)},n.striptags=function(t,n){var r=s((t=u(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|<!--[\s\S]*?-->/gi,"")),i="";return i=n?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),e.copySafeness(t,i)},n.title=function(t){var n=(t=u(t,"")).split(" ").map(function(t){return f(t)});return e.copySafeness(t,n.join(" "))},n.trim=s,n.truncate=function(t,n,r,i){var o=t;if(t=u(t,""),n=n||255,t.length<=n)return t;if(r)t=t.substring(0,n);else{var f=t.lastIndexOf(" ",n);-1===f&&(f=n),t=t.substring(0,f)}return t+=void 0!==i&&null!==i?i:"...",e.copySafeness(o,t)},n.upper=function(t){return(t=u(t,"")).toUpperCase()},n.urlencode=function(t){var n=encodeURIComponent;return i.isString(t)?n(t):(i.isArray(t)?t:i.r(t)).map(function(t){var r=t[0],i=t[1];return n(r)+"="+n(i)}).join("&")};var a=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,h=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,v=/^https?:\/\/.*$/,l=/^www\./,d=/\.(?:org|net|com)(?:\:|\/|$)/;n.urlize=function(t,n,r){o(n)&&(n=1/0);var i=!0===r?' rel="nofollow"':"";return t.split(/(\s+)/).filter(function(t){return t&&t.length}).map(function(t){var r=t.match(a),e=r?r[1]:t,u=e.substr(0,n);return v.test(e)?'<a href="'+e+'"'+i+">"+u+"</a>":l.test(e)?'<a href="http://'+e+'"'+i+">"+u+"</a>":h.test(e)?'<a href="mailto:'+e+'">'+e+"</a>":d.test(e)?'<a href="http://'+e+'"'+i+">"+u+"</a>":t}).join("")},n.wordcount=function(t){var n=(t=u(t,""))?t.match(/\w+/g):null;return n?n.length:null},n.float=function(t,n){var r=parseFloat(t);return o(r)?n:r},n.int=function(t,n){var r=parseInt(t,10);return o(r)?n:r},n.d=n.default,n.e=n.escape},function(t,n,r){"use strict";var i,e="object"==typeof Reflect?Reflect:null,u=e&&"function"==typeof e.apply?e.apply:function(t,n,r){return Function.prototype.apply.call(t,n,r)};i=e&&"function"==typeof e.ownKeys?e.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function f(){f.init.call(this)}t.exports=f,f.EventEmitter=f,f.prototype.y=void 0,f.prototype.b=0,f.prototype.w=void 0;var c=10;function s(t){return void 0===t.w?f.defaultMaxListeners:t.w}function a(t,n,r,i){var e,u,o;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(void 0===(u=t.y)?(u=t.y=Object.create(null),t.b=0):(void 0!==u.newListener&&(t.emit("newListener",n,r.listener?r.listener:r),u=t.y),o=u[n]),void 0===o)o=u[n]=r,++t.b;else if("function"==typeof o?o=u[n]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(e=s(t))>0&&o.length>e&&!o.warned){o.warned=!0;var f=Error("Possible EventEmitter memory leak detected. "+o.length+" "+n+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=n,f.count=o.length,console&&console.warn&&console.warn(f)}return t}function h(t,n,r){var i={fired:!1,wrapFn:void 0,target:t,type:n,listener:r},e=function(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,u(this.listener,this.target,t))}.bind(i);return e.listener=r,i.wrapFn=e,e}function v(t,n,r){var i=t.y;if(void 0===i)return[];var e=i[n];return void 0===e?[]:"function"==typeof e?r?[e.listener||e]:[e]:r?function(t){for(var n=Array(t.length),r=0;r<n.length;++r)n[r]=t[r].listener||t[r];return n}(e):d(e,e.length)}function l(t){var n=this.y;if(void 0!==n){var r=n[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(t,n){for(var r=Array(n),i=0;i<n;++i)r[i]=t[i];return r}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");c=t}}),f.init=function(){void 0!==this.y&&this.y!==Object.getPrototypeOf(this).y||(this.y=Object.create(null),this.b=0),this.w=this.w||void 0},f.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this.w=t,this},f.prototype.getMaxListeners=function(){return s(this)},f.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var i="error"===t,e=this.y;if(void 0!==e)i=i&&void 0===e.error;else if(!i)return!1;if(i){var o;if(n.length>0&&(o=n[0]),o instanceof Error)throw o;var f=Error("Unhandled error."+(o?" ("+o.message+")":""));throw f.context=o,f}var c=e[t];if(void 0===c)return!1;if("function"==typeof c)u(c,this,n);else{var s=c.length,a=d(c,s);for(r=0;r<s;++r)u(a[r],this,n)}return!0},f.prototype.addListener=function(t,n){return a(this,t,n,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(t,n){return a(this,t,n,!0)},f.prototype.once=function(t,n){if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);return this.on(t,h(this,t,n)),this},f.prototype.prependOnceListener=function(t,n){if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);return this.prependListener(t,h(this,t,n)),this},f.prototype.removeListener=function(t,n){var r,i,e,u,o;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(i=this.y))return this;if(void 0===(r=i[t]))return this;if(r===n||r.listener===n)0==--this.b?this.y=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||n));else if("function"!=typeof r){for(e=-1,u=r.length-1;u>=0;u--)if(r[u]===n||r[u].listener===n){o=r[u].listener,e=u;break}if(e<0)return this;0===e?r.shift():function(t,n){for(;n+1<t.length;n++)t[n]=t[n+1];t.pop()}(r,e),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,o||n)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(t){var n,r,i;if(void 0===(r=this.y))return this;if(void 0===r.removeListener)return 0===arguments.length?(this.y=Object.create(null),this.b=0):void 0!==r[t]&&(0==--this.b?this.y=Object.create(null):delete r[t]),this;if(0===arguments.length){var e,u=Object.keys(r);for(i=0;i<u.length;++i)"removeListener"!==(e=u[i])&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this.y=Object.create(null),this.b=0,this}if("function"==typeof(n=r[t]))this.removeListener(t,n);else if(void 0!==n)for(i=n.length-1;i>=0;i--)this.removeListener(t,n[i]);return this},f.prototype.listeners=function(t){return v(this,t,!0)},f.prototype.rawListeners=function(t){return v(this,t,!1)},f.listenerCount=function(t,n){return"function"==typeof t.listenerCount?t.listenerCount(n):l.call(t,n)},f.prototype.listenerCount=l,f.prototype.eventNames=function(){return this.b>0?i(this.y):[]}},function(t,n,r){"use strict";var i=r(2).SafeString;n.callable=function(t){return"function"==typeof t},n.defined=function(t){return void 0!==t},n.divisibleby=function(t,n){return t%n==0},n.escaped=function(t){return t instanceof i},n.equalto=function(t,n){return t===n},n.eq=n.equalto,n.sameas=n.equalto,n.even=function(t){return t%2==0},n.falsy=function(t){return!t},n.ge=function(t,n){return t>=n},n.greaterthan=function(t,n){return t>n},n.gt=n.greaterthan,n.le=function(t,n){return t<=n},n.lessthan=function(t,n){return t<n},n.lt=n.lessthan,n.lower=function(t){return t.toLowerCase()===t},n.ne=function(t,n){return t!==n},n.null=function(t){return null===t},n.number=function(t){return"number"==typeof t},n.odd=function(t){return t%2==1},n.string=function(t){return"string"==typeof t},n.truthy=function(t){return!!t},n.undefined=function(t){return void 0===t},n.upper=function(t){return t.toUpperCase()===t},n.iterable=function(t){return"undefined"!=typeof Symbol?!!t[Symbol.iterator]:Array.isArray(t)||"string"==typeof t},n.mapping=function(t){var n=null!==t&&void 0!==t&&"object"==typeof t&&!Array.isArray(t);return Set?n&&!(t instanceof Set):n}},function(t,n,r){"use strict";t.exports=function(){return{range:function(t,n,r){void 0===n?(n=t,t=0,r=1):r||(r=1);var i=[];if(r>0)for(var e=t;e<n;e+=r)i.push(e);else for(var u=t;u>n;u+=r)i.push(u);return i},cycler:function(){return t=Array.prototype.slice.call(arguments),n=-1,{current:null,reset:function(){n=-1,this.current=null},next:function(){return++n>=t.length&&(n=0),this.current=t[n],this.current}};var t,n},joiner:function(t){return function(t){t=t||",";var n=!0;return function(){var r=n?"":t;return n=!1,r}}(t)}}}},function(t,n,r){var i=r(0);t.exports=function(t,n){function r(t,n){if(this.name=t,this.path=t,this.defaultEngine=n.defaultEngine,this.ext=i.extname(t),!this.ext&&!this.defaultEngine)throw Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return r.prototype.render=function(n,r){t.render(this.name,n,r)},n.set("view",r),n.set("nunjucksEnv",t),t}},function(t,n,r){t.exports=function(){"use strict";var t,n,r=this.runtime,i=this.lib,e=this.compiler.Compiler,u=this.parser.Parser,o=(this.nodes,this.lexer,r.contextOrFrameLookup),f=r.memberLookup;function c(t,n){return Object.prototype.hasOwnProperty.call(t,n)}e&&(t=e.prototype.assertType),u&&(n=u.prototype.parseAggregate),r.contextOrFrameLookup=function(t,n,r){var i=o.apply(this,arguments);if(void 0!==i)return i;switch(r){case"True":return!0;case"False":return!1;case"None":return null;default:return}};var s={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var n=0;n<this.length;n++)if(this[n]===t)return this.splice(n,1);throw Error("ValueError")},count:function(t){for(var n=0,r=0;r<this.length;r++)this[r]===t&&n++;return n},index:function(t){var n;if(-1===(n=this.indexOf(t)))throw Error("ValueError");return n},find:function(t){return this.indexOf(t)},insert:function(t,n){return this.splice(t,0,n)}},a={items:function(){return i.r(this)},values:function(){return i.u(this)},keys:function(){return i.keys(this)},get:function(t,n){var r=this[t];return void 0===r&&(r=n),r},has_key:function(t){return c(this,t)},pop:function(t,n){var r=this[t];if(void 0===r&&void 0!==n)r=n;else{if(void 0===r)throw Error("KeyError");delete this[t]}return r},popitem:function(){var t=i.keys(this);if(!t.length)throw Error("KeyError");var n=t[0],r=this[n];return delete this[n],[n,r]},setdefault:function(t,n){return void 0===n&&(n=null),t in this||(this[t]=n),this[t]},update:function(t){return i.f(this,t),null}};return a.iteritems=a.items,a.itervalues=a.values,a.iterkeys=a.keys,r.memberLookup=function(t,n,e){return 4===arguments.length?function(t,n,i,e){t=t||[],null===n&&(n=e<0?t.length-1:0),null===i?i=e<0?-1:t.length:i<0&&(i+=t.length),n<0&&(n+=t.length);for(var u=[],o=n;!(o<0||o>t.length||e>0&&o>=i||e<0&&o<=i);o+=e)u.push(r.memberLookup(t,o));return u}.apply(this,arguments):(t=t||{},i.isArray(t)&&c(s,n)?s[n].bind(t):i.isObject(t)&&c(a,n)?a[n].bind(t):f.apply(this,arguments))},function(){r.contextOrFrameLookup=o,r.memberLookup=f,e&&(e.prototype.assertType=t),u&&(u.prototype.parseAggregate=n)}}}])}); | ||
//# sourceMappingURL=nunjucks-slim.min.js.map |
Changelog | ||
========= | ||
3.2.0 (Mar 5 2019) | ||
------------------ | ||
* Adds [`NodeResolveLoader`](http://mozilla.github.io/nunjucks/api.html#noderesolveloader), | ||
a Loader that loads templates using node's | ||
[`require.resolve`](https://nodejs.org/api/modules.html#modules_all_together). | ||
Fixes [#1175](https://github.com/mozilla/nunjucks/issues/1175). | ||
* Emit 'load' events on `Environment` instances, to allow runtime dependency | ||
tracking. Fixes [#1153](https://github.com/mozilla/nunjucks/issues/1153). | ||
3.1.7 (Jan 12 2019) | ||
@@ -5,0 +15,0 @@ ------------------ |
@@ -31,3 +31,3 @@ # Contributing | ||
Please DO NOT ask "how do I?" or usage questions via GitHub issues. Instead, | ||
use the [https://groups.google.com/forum/#!forum/nunjucks](mailing list). | ||
use the [mailing list](https://groups.google.com/forum/#!forum/nunjucks). | ||
@@ -34,0 +34,0 @@ |
@@ -66,2 +66,3 @@ 'use strict'; | ||
FileSystemLoader: loaders.FileSystemLoader, | ||
NodeResolveLoader: loaders.NodeResolveLoader, | ||
PrecompiledLoader: loaders.PrecompiledLoader, | ||
@@ -68,0 +69,0 @@ WebLoader: loaders.WebLoader, |
{ | ||
"name": "nunjucks", | ||
"description": "A powerful templating engine with inheritance, asynchronous control, and more (jinja2 inspired)", | ||
"version": "3.1.7", | ||
"version": "3.2.0", | ||
"author": "James Long <longster@gmail.com>", | ||
@@ -76,3 +76,3 @@ "dependencies": { | ||
"test:instrument": "cross-env NODE_ENV=test scripts/bundle.js", | ||
"test:runner": "cross-env NODE_ENV=test scripts/testrunner.js", | ||
"test:runner": "cross-env NODE_ENV=test NODE_PATH=tests/test-node-pkgs scripts/testrunner.js", | ||
"test": "npm run lint && npm run test:instrument && npm run test:runner" | ||
@@ -79,0 +79,0 @@ }, |
@@ -17,3 +17,4 @@ 'use strict'; | ||
var Obj = require('./object'); // These are all the same for now, but shouldn't be passed straight | ||
var _require3 = require('./object'), | ||
Obj = _require3.Obj; // These are all the same for now, but shouldn't be passed straight | ||
// through | ||
@@ -102,13 +103,13 @@ | ||
_proto._emitFuncBegin = function _emitFuncBegin(name) { | ||
_proto._emitFuncBegin = function _emitFuncBegin(node, name) { | ||
this.buffer = 'output'; | ||
this._scopeClosers = ''; | ||
this._emitLine('function ' + name + '(env, context, frame, runtime, cb) {'); | ||
this._emitLine("function " + name + "(env, context, frame, runtime, cb) {"); | ||
this._emitLine('var lineno = null;'); | ||
this._emitLine("var lineno = " + node.lineno + ";"); | ||
this._emitLine('var colno = null;'); | ||
this._emitLine("var colno = " + node.colno + ";"); | ||
this._emitLine('var ' + this.buffer + ' = "";'); | ||
this._emitLine("var " + this.buffer + " = \"\";"); | ||
@@ -1361,3 +1362,3 @@ this._emitLine('try {'); | ||
this._emitFuncBegin('root'); | ||
this._emitFuncBegin(node, 'root'); | ||
@@ -1392,3 +1393,3 @@ this._emitLine('var parentTemplate = null;'); | ||
_this16._emitFuncBegin("b_" + name); | ||
_this16._emitFuncBegin(block, "b_" + name); | ||
@@ -1395,0 +1396,0 @@ var tmpFrame = new Frame(); |
@@ -24,3 +24,5 @@ 'use strict'; | ||
var Obj = require('./object'); | ||
var _require2 = require('./object'), | ||
Obj = _require2.Obj, | ||
EmitterObj = _require2.EmitterObj; | ||
@@ -61,7 +63,7 @@ var globalRuntime = require('./runtime'); | ||
/*#__PURE__*/ | ||
function (_Obj) { | ||
_inheritsLoose(Environment, _Obj); | ||
function (_EmitterObj) { | ||
_inheritsLoose(Environment, _EmitterObj); | ||
function Environment() { | ||
return _Obj.apply(this, arguments) || this; | ||
return _EmitterObj.apply(this, arguments) || this; | ||
} | ||
@@ -112,3 +114,4 @@ | ||
this.initCache(); | ||
this._initLoaders(); | ||
this.globals = globals(); | ||
@@ -134,11 +137,18 @@ this.filters = {}; | ||
_proto.initCache = function initCache() { | ||
// Caching and cache busting | ||
_proto._initLoaders = function _initLoaders() { | ||
var _this2 = this; | ||
this.loaders.forEach(function (loader) { | ||
// Caching and cache busting | ||
loader.cache = {}; | ||
if (typeof loader.on === 'function') { | ||
loader.on('update', function (template) { | ||
loader.cache[template] = null; | ||
loader.on('update', function (name, fullname) { | ||
loader.cache[name] = null; | ||
_this2.emit('update', name, fullname, loader); | ||
}); | ||
loader.on('load', function (name, source) { | ||
_this2.emit('load', name, source, loader); | ||
}); | ||
} | ||
@@ -148,2 +158,8 @@ }); | ||
_proto.invalidateCache = function invalidateCache() { | ||
this.loaders.forEach(function (loader) { | ||
loader.cache = {}; | ||
}); | ||
}; | ||
_proto.addExtension = function addExtension(name, extension) { | ||
@@ -226,3 +242,3 @@ extension.__name = name; | ||
_proto.getTemplate = function getTemplate(name, eagerCompile, parentName, ignoreMissing, cb) { | ||
var _this2 = this; | ||
var _this3 = this; | ||
@@ -295,5 +311,5 @@ var that = this; | ||
if (!info) { | ||
newTmpl = new Template(noopTmplSrc, _this2, '', eagerCompile); | ||
newTmpl = new Template(noopTmplSrc, _this3, '', eagerCompile); | ||
} else { | ||
newTmpl = new Template(info.src, _this2, info.path, eagerCompile); | ||
newTmpl = new Template(info.src, _this3, info.path, eagerCompile); | ||
@@ -379,11 +395,11 @@ if (!info.noCache) { | ||
return Environment; | ||
}(Obj); | ||
}(EmitterObj); | ||
var Context = | ||
/*#__PURE__*/ | ||
function (_Obj2) { | ||
_inheritsLoose(Context, _Obj2); | ||
function (_Obj) { | ||
_inheritsLoose(Context, _Obj); | ||
function Context() { | ||
return _Obj2.apply(this, arguments) || this; | ||
return _Obj.apply(this, arguments) || this; | ||
} | ||
@@ -394,3 +410,3 @@ | ||
_proto2.init = function init(ctx, blocks, env) { | ||
var _this3 = this; | ||
var _this4 = this; | ||
@@ -404,3 +420,3 @@ // Has to be tied to an environment so we can tap into its globals. | ||
lib.keys(blocks).forEach(function (name) { | ||
_this3.addBlock(name, blocks[name]); | ||
_this4.addBlock(name, blocks[name]); | ||
}); | ||
@@ -458,7 +474,7 @@ }; | ||
_proto2.getExported = function getExported() { | ||
var _this4 = this; | ||
var _this5 = this; | ||
var exported = {}; | ||
this.exported.forEach(function (name) { | ||
exported[name] = _this4.ctx[name]; | ||
exported[name] = _this5.ctx[name]; | ||
}); | ||
@@ -473,7 +489,7 @@ return exported; | ||
/*#__PURE__*/ | ||
function (_Obj3) { | ||
_inheritsLoose(Template, _Obj3); | ||
function (_Obj2) { | ||
_inheritsLoose(Template, _Obj2); | ||
function Template() { | ||
return _Obj3.apply(this, arguments) || this; | ||
return _Obj2.apply(this, arguments) || this; | ||
} | ||
@@ -519,3 +535,3 @@ | ||
_proto3.render = function render(ctx, parentFrame, cb) { | ||
var _this5 = this; | ||
var _this6 = this; | ||
@@ -564,3 +580,3 @@ if (typeof ctx === 'function') { | ||
if (err) { | ||
err = lib._prettifyError(_this5.path, _this5.env.opts.dev, err); | ||
err = lib._prettifyError(_this6.path, _this6.env.opts.dev, err); | ||
didError = true; | ||
@@ -567,0 +583,0 @@ } |
@@ -385,3 +385,3 @@ 'use strict'; | ||
if (this._matches(str)) { | ||
this.index += str.length; | ||
this.forwardN(str.length); | ||
return str; | ||
@@ -388,0 +388,0 @@ } |
@@ -7,11 +7,12 @@ 'use strict'; | ||
var Obj = require('./object'); | ||
var _require = require('./object'), | ||
EmitterObj = _require.EmitterObj; | ||
module.exports = | ||
/*#__PURE__*/ | ||
function (_Obj) { | ||
_inheritsLoose(Loader, _Obj); | ||
function (_EmitterObj) { | ||
_inheritsLoose(Loader, _EmitterObj); | ||
function Loader() { | ||
return _Obj.apply(this, arguments) || this; | ||
return _EmitterObj.apply(this, arguments) || this; | ||
} | ||
@@ -21,20 +22,2 @@ | ||
_proto.on = function on(name, func) { | ||
this.listeners = this.listeners || {}; | ||
this.listeners[name] = this.listeners[name] || []; | ||
this.listeners[name].push(func); | ||
}; | ||
_proto.emit = function emit(name) { | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
if (this.listeners && this.listeners[name]) { | ||
this.listeners[name].forEach(function (listener) { | ||
listener.apply(void 0, args); | ||
}); | ||
} | ||
}; | ||
_proto.resolve = function resolve(from, to) { | ||
@@ -49,2 +32,2 @@ return path.resolve(path.dirname(from), to); | ||
return Loader; | ||
}(Obj); | ||
}(EmitterObj); |
@@ -62,3 +62,3 @@ /* eslint-disable no-console */ | ||
if (event === 'change' && fullname in _this.pathsToNames) { | ||
_this.emit('update', _this.pathsToNames[fullname]); | ||
_this.emit('update', _this.pathsToNames[fullname], fullname); | ||
} | ||
@@ -96,3 +96,3 @@ }); | ||
this.pathsToNames[fullpath] = name; | ||
return { | ||
var source = { | ||
src: fs.readFileSync(fullpath, 'utf-8'), | ||
@@ -102,2 +102,4 @@ path: fullpath, | ||
}; | ||
this.emit('load', name, source); | ||
return source; | ||
}; | ||
@@ -108,5 +110,75 @@ | ||
var NodeResolveLoader = | ||
/*#__PURE__*/ | ||
function (_Loader2) { | ||
_inheritsLoose(NodeResolveLoader, _Loader2); | ||
function NodeResolveLoader(opts) { | ||
var _this2; | ||
_this2 = _Loader2.call(this) || this; | ||
opts = opts || {}; | ||
_this2.pathsToNames = {}; | ||
_this2.noCache = !!opts.noCache; | ||
if (opts.watch) { | ||
if (!chokidar) { | ||
throw new Error('watch requires chokidar to be installed'); | ||
} | ||
_this2.watcher = chokidar.watch(); | ||
_this2.watcher.on('change', function (fullname) { | ||
_this2.emit('update', _this2.pathsToNames[fullname], fullname); | ||
}); | ||
_this2.watcher.on('error', function (error) { | ||
console.log('Watcher error: ' + error); | ||
}); | ||
_this2.on('load', function (name, source) { | ||
_this2.watcher.add(source.path); | ||
}); | ||
} | ||
return _this2; | ||
} | ||
var _proto2 = NodeResolveLoader.prototype; | ||
_proto2.getSource = function getSource(name) { | ||
// Don't allow file-system traversal | ||
if (/^\.?\.?(\/|\\)/.test(name)) { | ||
return null; | ||
} | ||
if (/^[A-Z]:/.test(name)) { | ||
return null; | ||
} | ||
var fullpath; | ||
try { | ||
fullpath = require.resolve(name); | ||
} catch (e) { | ||
return null; | ||
} | ||
this.pathsToNames[fullpath] = name; | ||
var source = { | ||
src: fs.readFileSync(fullpath, 'utf-8'), | ||
path: fullpath, | ||
noCache: this.noCache | ||
}; | ||
this.emit('load', name, source); | ||
return source; | ||
}; | ||
return NodeResolveLoader; | ||
}(Loader); | ||
module.exports = { | ||
FileSystemLoader: FileSystemLoader, | ||
PrecompiledLoader: PrecompiledLoader | ||
PrecompiledLoader: PrecompiledLoader, | ||
NodeResolveLoader: NodeResolveLoader | ||
}; |
@@ -9,3 +9,4 @@ 'use strict'; | ||
var Obj = require('./object'); | ||
var _require = require('./object'), | ||
Obj = _require.Obj; | ||
@@ -12,0 +13,0 @@ function traverseAndCheck(obj, type, results) { |
@@ -9,2 +9,4 @@ 'use strict'; // A simple class system, more documentation to come | ||
var EventEmitter = require('events'); | ||
var lib = require('./lib'); | ||
@@ -89,2 +91,45 @@ | ||
module.exports = Obj; | ||
var EmitterObj = | ||
/*#__PURE__*/ | ||
function (_EventEmitter) { | ||
_inheritsLoose(EmitterObj, _EventEmitter); | ||
function EmitterObj() { | ||
var _this2; | ||
var _this; | ||
_this = _EventEmitter.call(this) || this; // Unfortunately necessary for backwards compatibility | ||
(_this2 = _this).init.apply(_this2, arguments); | ||
return _this; | ||
} | ||
var _proto2 = EmitterObj.prototype; | ||
_proto2.init = function init() {}; | ||
EmitterObj.extend = function extend(name, props) { | ||
if (typeof name === 'object') { | ||
props = name; | ||
name = 'anonymous'; | ||
} | ||
return extendClass(this, name, props); | ||
}; | ||
_createClass(EmitterObj, [{ | ||
key: "typename", | ||
get: function get() { | ||
return this.constructor.name; | ||
} | ||
}]); | ||
return EmitterObj; | ||
}(EventEmitter); | ||
module.exports = { | ||
Obj: Obj, | ||
EmitterObj: EmitterObj | ||
}; |
@@ -9,3 +9,3 @@ 'use strict'; | ||
var Obj = require('./object'); | ||
var Obj = require('./object').Obj; | ||
@@ -12,0 +12,0 @@ var lib = require('./lib'); |
@@ -42,2 +42,4 @@ 'use strict'; | ||
_proto.getSource = function getSource(name, cb) { | ||
var _this2 = this; | ||
var useCache = this.useCache; | ||
@@ -61,2 +63,4 @@ var result; | ||
_this2.emit('load', name, result); | ||
if (cb) { | ||
@@ -63,0 +67,0 @@ cb(null, result); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1734796
16137
4