diff --git a/CHANGELOG.md b/CHANGELOG.md index 078885e0..32fae98b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ ## Change Log +### v2.7.5 (2016/12/09 13:49 +00:00) +- [#756](https://github.com/linkedin/dustjs/pull/756) Decrease security vulnerabilities by upgrading cli dependency (#754 #748) (@danactive) + +### v2.7.4 (2016/09/13 02:52 +00:00) +- [#744](https://github.com/linkedin/dustjs/pull/744) Don't use instanceof to determine if a Context is a Context. Instead use a flag on the instance itself so it can survive object merges. (@sethkinast) + +### v2.6.3 (2016/07/26 18:03 +00:00) +- [#736](https://github.com/linkedin/dustjs/pull/736) Prioritize resolution of .then (@brianmhunt) +- [#734](https://github.com/linkedin/dustjs/pull/734) Bump deps (@sethkinast) +- [#703](https://github.com/linkedin/dustjs/pull/703) Upgrade to peg.js 0.9 (@sethkinast) +- [#705](https://github.com/linkedin/dustjs/pull/705) When rendering with a Context object, use the templateName provided by the template (@sethkinast) +- [#701](https://github.com/linkedin/dustjs/pull/701) Fix stacktrace logging for IE8 (@sethkinast) +- [#700](https://github.com/linkedin/dustjs/pull/700) At `DEBUG` loglevel, log the full stack trace on errors (@r1b) +- [#690](https://github.com/linkedin/dustjs/pull/690) Update deps (@sethkinast) +- [#689](https://github.com/linkedin/dustjs/pull/689) Make the AMD loader pass the template directly rather than communicating via the cache (@aredridel) + ### v2.7.2 (2015/06/08 20:41 +00:00) - [#673](https://github.com/linkedin/dustjs/pull/673) Pass the current context to filters (@sethkinast) - [#676](https://github.com/linkedin/dustjs/pull/676) If a Promise is resolved with an array, iterate over it instead of rendering the whole array at once. Closes #674 (@sethkinast) diff --git a/bower.json b/bower.json index 912d7991..4fd6a6f8 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "dustjs-linkedin", - "version": "2.7.2", + "version": "2.7.5", "homepage": "https://github.com/linkedin/dustjs", "authors": [ "Veena Basavaraj ", diff --git a/dist/dust-core.js b/dist/dust-core.js index c503e947..2e181977 100644 --- a/dist/dust-core.js +++ b/dist/dust-core.js @@ -1,4 +1,4 @@ -/*! dustjs-linkedin - v2.7.2 +/*! dustjs-linkedin - v2.7.5 * http://dustjs.com/ * Copyright (c) 2021 Aleksander Williams; Released under the MIT License */ (function (root, factory) { @@ -11,7 +11,7 @@ } }(this, function() { var dust = { - "version": "2.7.2" + "version": "2.7.5" }, NONE = 'NONE', ERROR = 'ERROR', WARN = 'WARN', INFO = 'INFO', DEBUG = 'DEBUG', EMPTY_FUNC = function() {}; @@ -750,7 +750,7 @@ /** * Like Chunk#map but additionally resolves a thenable. If the thenable succeeds the callback is invoked with - * a new chunk that can be used to asynchronously render or write to it, otherwise if the thenable is rejected + * a new chunk that can be used to asynchronously render or write to it, otherwise if the thenable is rejected * then the error body is rendered if available, an error is logged, and the callback is never invoked. * @param {Chunk} The current chunk to insert a new chunk * @param thenable {Thenable} the target thenable to await @@ -765,8 +765,8 @@ try { callback(asyncChunk, data); } catch (err) { - // handle errors the same way Chunk#map would. This logic is only here since the thenable defers - // logic such that the try / catch in Chunk#map would not capture it. + // handle errors the same way Chunk#map would. This logic is only here since the thenable defers + // logic such that the try / catch in Chunk#map would not capture it. dust.log(err, ERROR); asyncChunk.setError(err); } diff --git a/dist/dust-core.min.js b/dist/dust-core.min.js index 0b8dc252..afdd05c7 100644 --- a/dist/dust-core.min.js +++ b/dist/dust-core.min.js @@ -1,4 +1,4 @@ -/*! dustjs-linkedin - v2.7.2 +/*! dustjs-linkedin - v2.7.5 * http://dustjs.com/ * Copyright (c) 2021 Aleksander Williams; Released under the MIT License */ -!function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define("dust.core",[],b):"object"==typeof exports?module.exports=b():a.dust=b()}(this,function(){function getTemplate(a,b){if(a)return"function"==typeof a&&a.template?a.template:dust.isTemplateFn(a)?a:b!==!1?dust.cache[a]:void 0}function load(a,b,c){if(!a)return b.setError(new Error("No template or template name provided to render"));var d=getTemplate(a,dust.config.cache);return d?d(b,Context.wrap(c,d.templateName)):dust.onLoad?b.map(function(b){function d(a,d){var f;if(a)return b.setError(a);if(f=getTemplate(d,!1)||getTemplate(e,dust.config.cache),!f){if(!dust.compile)return b.setError(new Error("Dust compiler not available"));f=dust.loadSource(dust.compile(d,e))}f(b,Context.wrap(c,f.templateName)).end()}var e=a;3===dust.onLoad.length?dust.onLoad(e,c.options,d):dust.onLoad(e,d)}):b.setError(new Error("Template Not Found: "+a))}function Context(a,b,c,d,e){void 0===a||a instanceof Stack||(a=new Stack(a)),this.stack=a,this.global=b,this.options=c,this.blocks=d,this.templateName=e,this._isContext=!0}function getWithResolvedData(a,b,c){return function(d){return a.push(d)._get(b,c)}}function Stack(a,b,c,d){this.tail=b,this.isObject=a&&"object"==typeof a,this.head=a,this.index=c,this.of=d}function Stub(a){this.head=new Chunk(this),this.callback=a,this.out=""}function Stream(){this.head=new Chunk(this)}function Chunk(a,b,c){this.root=a,this.next=b,this.data=[],this.flushable=!1,this.taps=c}function mapThenable(a,b,c,d,e){return a.map(function(a){b.then(function(b){try{e(a,b)}catch(c){dust.log(c,ERROR),a.setError(c)}},function(b){dust.log("Unhandled promise rejection in `"+c.getTemplateName()+"`",INFO),a.renderError(b,c,d).end()})})}function Tap(a,b){this.head=a,this.tail=b}var dust={version:"2.7.2"},NONE="NONE",ERROR="ERROR",WARN="WARN",INFO="INFO",DEBUG="DEBUG",EMPTY_FUNC=function(){};dust.config={whitespace:!1,amd:!1,cjs:!1,cache:!0},dust._aliases={write:"w",end:"e",map:"m",render:"r",reference:"f",section:"s",exists:"x",notexists:"nx",block:"b",partial:"p",helper:"h"},function(){var a,b,c={DEBUG:0,INFO:1,WARN:2,ERROR:3,NONE:4};"undefined"!=typeof console&&console.log?(a=console.log,b="function"==typeof a?function(){a.apply(console,arguments)}:function(){a(Array.prototype.slice.apply(arguments).join(" "))}):b=EMPTY_FUNC,dust.log=function(a,d){d=d||INFO,c[d]>=c[dust.debugLevel]&&(b("[DUST:"+d+"]",a),d===ERROR&&dust.debugLevel===DEBUG&&a instanceof Error&&a.stack&&b("[DUST:"+d+"]",a.stack))},dust.debugLevel=NONE,"undefined"!=typeof process&&process.env&&/\bdust\b/.test(process.env.DEBUG)&&(dust.debugLevel=DEBUG)}(),dust.helpers={},dust.cache={},dust.register=function(a,b){a&&(b.templateName=a,dust.config.cache!==!1&&(dust.cache[a]=b))},dust.render=function(a,b,c){var d=new Stub(c).head;try{load(a,d,b).end()}catch(e){d.setError(e)}},dust.stream=function(a,b){var c=new Stream,d=c.head;return dust.nextTick(function(){try{load(a,d,b).end()}catch(c){d.setError(c)}}),c},dust.loadSource=function(source){return eval(source)},Array.isArray?dust.isArray=Array.isArray:dust.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)},dust.nextTick=function(){return function(a){setTimeout(a,0)}}(),dust.isEmpty=function(a){return 0!==a&&(!(!dust.isArray(a)||a.length)||!a)},dust.isEmptyObject=function(a){var b;if(null===a)return!1;if(void 0===a)return!1;if(a.length>0)return!1;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b))return!1;return!0},dust.isTemplateFn=function(a){return"function"==typeof a&&a.__dustBody},dust.isThenable=function(a){return a&&("object"==typeof a||"function"==typeof a)&&"function"==typeof a.then},dust.isNonThenableFunction=function(a){return"function"==typeof a&&!dust.isThenable(a)},dust.isStreamable=function(a){return a&&"function"==typeof a.on&&"function"==typeof a.pipe},dust.filter=function(a,b,c,d){var e,f,g,h;if(c)for(e=0,f=c.length;e0){for(g=b.stack&&b.stack.head||{},g.$len=f,e=0;e"']/,AMP=/&/g,LT=//g,QUOT=/\"/g,SQUOT=/\'/g;dust.escapeHtml=function(a){return"string"==typeof a||a&&"function"==typeof a.toString?("string"!=typeof a&&(a=a.toString()),HCHARS.test(a)?a.replace(AMP,"&").replace(LT,"<").replace(GT,">").replace(QUOT,""").replace(SQUOT,"'"):a):a};var BS=/\\/g,FS=/\//g,CR=/\r/g,LS=/\u2028/g,PS=/\u2029/g,NL=/\n/g,LF=/\f/g,SQ=/'/g,DQ=/"/g,TB=/\t/g;return dust.escapeJs=function(a){return"string"==typeof a?a.replace(BS,"\\\\").replace(FS,"\\/").replace(DQ,'\\"').replace(SQ,"\\'").replace(CR,"\\r").replace(LS,"\\u2028").replace(PS,"\\u2029").replace(NL,"\\n").replace(LF,"\\f").replace(TB,"\\t"):a},dust.escapeJSON=function(a){return JSON?JSON.stringify(a).replace(LS,"\\u2028").replace(PS,"\\u2029").replace(LT,"\\u003c"):(dust.log("JSON is undefined; could not escape `"+a+"`",WARN),a)},dust}),"function"==typeof define&&define.amd&&define.amd.dust===!0&&define(["require","dust.core"],function(require,dust){return dust.onLoad=function(a,b){require([a],function(a){b(null,a)})},dust}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define("dust.core",[],b):"object"==typeof exports?module.exports=b():a.dust=b()}(this,function(){function getTemplate(a,b){if(a)return"function"==typeof a&&a.template?a.template:dust.isTemplateFn(a)?a:b!==!1?dust.cache[a]:void 0}function load(a,b,c){if(!a)return b.setError(new Error("No template or template name provided to render"));var d=getTemplate(a,dust.config.cache);return d?d(b,Context.wrap(c,d.templateName)):dust.onLoad?b.map(function(b){function d(a,d){var f;if(a)return b.setError(a);if(f=getTemplate(d,!1)||getTemplate(e,dust.config.cache),!f){if(!dust.compile)return b.setError(new Error("Dust compiler not available"));f=dust.loadSource(dust.compile(d,e))}f(b,Context.wrap(c,f.templateName)).end()}var e=a;3===dust.onLoad.length?dust.onLoad(e,c.options,d):dust.onLoad(e,d)}):b.setError(new Error("Template Not Found: "+a))}function Context(a,b,c,d,e){void 0===a||a instanceof Stack||(a=new Stack(a)),this.stack=a,this.global=b,this.options=c,this.blocks=d,this.templateName=e,this._isContext=!0}function getWithResolvedData(a,b,c){return function(d){return a.push(d)._get(b,c)}}function Stack(a,b,c,d){this.tail=b,this.isObject=a&&"object"==typeof a,this.head=a,this.index=c,this.of=d}function Stub(a){this.head=new Chunk(this),this.callback=a,this.out=""}function Stream(){this.head=new Chunk(this)}function Chunk(a,b,c){this.root=a,this.next=b,this.data=[],this.flushable=!1,this.taps=c}function mapThenable(a,b,c,d,e){return a.map(function(a){b.then(function(b){try{e(a,b)}catch(c){dust.log(c,ERROR),a.setError(c)}},function(b){dust.log("Unhandled promise rejection in `"+c.getTemplateName()+"`",INFO),a.renderError(b,c,d).end()})})}function Tap(a,b){this.head=a,this.tail=b}var dust={version:"2.7.5"},NONE="NONE",ERROR="ERROR",WARN="WARN",INFO="INFO",DEBUG="DEBUG",EMPTY_FUNC=function(){};dust.config={whitespace:!1,amd:!1,cjs:!1,cache:!0},dust._aliases={write:"w",end:"e",map:"m",render:"r",reference:"f",section:"s",exists:"x",notexists:"nx",block:"b",partial:"p",helper:"h"},function(){var a,b,c={DEBUG:0,INFO:1,WARN:2,ERROR:3,NONE:4};"undefined"!=typeof console&&console.log?(a=console.log,b="function"==typeof a?function(){a.apply(console,arguments)}:function(){a(Array.prototype.slice.apply(arguments).join(" "))}):b=EMPTY_FUNC,dust.log=function(a,d){d=d||INFO,c[d]>=c[dust.debugLevel]&&(b("[DUST:"+d+"]",a),d===ERROR&&dust.debugLevel===DEBUG&&a instanceof Error&&a.stack&&b("[DUST:"+d+"]",a.stack))},dust.debugLevel=NONE,"undefined"!=typeof process&&process.env&&/\bdust\b/.test(process.env.DEBUG)&&(dust.debugLevel=DEBUG)}(),dust.helpers={},dust.cache={},dust.register=function(a,b){a&&(b.templateName=a,dust.config.cache!==!1&&(dust.cache[a]=b))},dust.render=function(a,b,c){var d=new Stub(c).head;try{load(a,d,b).end()}catch(e){d.setError(e)}},dust.stream=function(a,b){var c=new Stream,d=c.head;return dust.nextTick(function(){try{load(a,d,b).end()}catch(c){d.setError(c)}}),c},dust.loadSource=function(source){return eval(source)},Array.isArray?dust.isArray=Array.isArray:dust.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)},dust.nextTick=function(){return function(a){setTimeout(a,0)}}(),dust.isEmpty=function(a){return 0!==a&&(!(!dust.isArray(a)||a.length)||!a)},dust.isEmptyObject=function(a){var b;if(null===a)return!1;if(void 0===a)return!1;if(a.length>0)return!1;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b))return!1;return!0},dust.isTemplateFn=function(a){return"function"==typeof a&&a.__dustBody},dust.isThenable=function(a){return a&&("object"==typeof a||"function"==typeof a)&&"function"==typeof a.then},dust.isNonThenableFunction=function(a){return"function"==typeof a&&!dust.isThenable(a)},dust.isStreamable=function(a){return a&&"function"==typeof a.on&&"function"==typeof a.pipe},dust.filter=function(a,b,c,d){var e,f,g,h;if(c)for(e=0,f=c.length;e0){for(g=b.stack&&b.stack.head||{},g.$len=f,e=0;e"']/,AMP=/&/g,LT=//g,QUOT=/\"/g,SQUOT=/\'/g;dust.escapeHtml=function(a){return"string"==typeof a||a&&"function"==typeof a.toString?("string"!=typeof a&&(a=a.toString()),HCHARS.test(a)?a.replace(AMP,"&").replace(LT,"<").replace(GT,">").replace(QUOT,""").replace(SQUOT,"'"):a):a};var BS=/\\/g,FS=/\//g,CR=/\r/g,LS=/\u2028/g,PS=/\u2029/g,NL=/\n/g,LF=/\f/g,SQ=/'/g,DQ=/"/g,TB=/\t/g;return dust.escapeJs=function(a){return"string"==typeof a?a.replace(BS,"\\\\").replace(FS,"\\/").replace(DQ,'\\"').replace(SQ,"\\'").replace(CR,"\\r").replace(LS,"\\u2028").replace(PS,"\\u2029").replace(NL,"\\n").replace(LF,"\\f").replace(TB,"\\t"):a},dust.escapeJSON=function(a){return JSON?JSON.stringify(a).replace(LS,"\\u2028").replace(PS,"\\u2029").replace(LT,"\\u003c"):(dust.log("JSON is undefined; could not escape `"+a+"`",WARN),a)},dust}),"function"==typeof define&&define.amd&&define.amd.dust===!0&&define(["require","dust.core"],function(require,dust){return dust.onLoad=function(a,b){require([a],function(a){b(null,a)})},dust}); diff --git a/dist/dust-full.js b/dist/dust-full.js index 975f509a..0b660313 100644 --- a/dist/dust-full.js +++ b/dist/dust-full.js @@ -1,4 +1,4 @@ -/*! dustjs-linkedin - v2.7.2 +/*! dustjs-linkedin - v2.7.5 * http://dustjs.com/ * Copyright (c) 2021 Aleksander Williams; Released under the MIT License */ (function (root, factory) { @@ -11,7 +11,7 @@ } }(this, function() { var dust = { - "version": "2.7.2" + "version": "2.7.5" }, NONE = 'NONE', ERROR = 'ERROR', WARN = 'WARN', INFO = 'INFO', DEBUG = 'DEBUG', EMPTY_FUNC = function() {}; diff --git a/dist/dust-full.min.js b/dist/dust-full.min.js index 756307c9..e63b99f2 100644 --- a/dist/dust-full.min.js +++ b/dist/dust-full.min.js @@ -1,5 +1,5 @@ -/*! dustjs-linkedin - v2.7.2 +/*! dustjs-linkedin - v2.7.5 * http://dustjs.com/ * Copyright (c) 2021 Aleksander Williams; Released under the MIT License */ -!function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define("dust.core",[],b):"object"==typeof exports?module.exports=b():a.dust=b()}(this,function(){function getTemplate(a,b){if(a)return"function"==typeof a&&a.template?a.template:dust.isTemplateFn(a)?a:b!==!1?dust.cache[a]:void 0}function load(a,b,c){if(!a)return b.setError(new Error("No template or template name provided to render"));var d=getTemplate(a,dust.config.cache);return d?d(b,Context.wrap(c,d.templateName)):dust.onLoad?b.map(function(b){function d(a,d){var f;if(a)return b.setError(a);if(f=getTemplate(d,!1)||getTemplate(e,dust.config.cache),!f){if(!dust.compile)return b.setError(new Error("Dust compiler not available"));f=dust.loadSource(dust.compile(d,e))}f(b,Context.wrap(c,f.templateName)).end()}var e=a;3===dust.onLoad.length?dust.onLoad(e,c.options,d):dust.onLoad(e,d)}):b.setError(new Error("Template Not Found: "+a))}function Context(a,b,c,d,e){void 0===a||a instanceof Stack||(a=new Stack(a)),this.stack=a,this.global=b,this.options=c,this.blocks=d,this.templateName=e,this._isContext=!0}function getWithResolvedData(a,b,c){return function(d){return a.push(d)._get(b,c)}}function Stack(a,b,c,d){this.tail=b,this.isObject=a&&"object"==typeof a,this.head=a,this.index=c,this.of=d}function Stub(a){this.head=new Chunk(this),this.callback=a,this.out=""}function Stream(){this.head=new Chunk(this)}function Chunk(a,b,c){this.root=a,this.next=b,this.data=[],this.flushable=!1,this.taps=c}function mapThenable(a,b,c,d,e){return a.map(function(a){b.then(function(b){try{e(a,b)}catch(c){dust.log(c,ERROR),a.setError(c)}},function(b){dust.log("Unhandled promise rejection in `"+c.getTemplateName()+"`",INFO),a.renderError(b,c,d).end()})})}function Tap(a,b){this.head=a,this.tail=b}var dust={version:"2.7.2"},NONE="NONE",ERROR="ERROR",WARN="WARN",INFO="INFO",DEBUG="DEBUG",EMPTY_FUNC=function(){};dust.config={whitespace:!1,amd:!1,cjs:!1,cache:!0},dust._aliases={write:"w",end:"e",map:"m",render:"r",reference:"f",section:"s",exists:"x",notexists:"nx",block:"b",partial:"p",helper:"h"},function(){var a,b,c={DEBUG:0,INFO:1,WARN:2,ERROR:3,NONE:4};"undefined"!=typeof console&&console.log?(a=console.log,b="function"==typeof a?function(){a.apply(console,arguments)}:function(){a(Array.prototype.slice.apply(arguments).join(" "))}):b=EMPTY_FUNC,dust.log=function(a,d){d=d||INFO,c[d]>=c[dust.debugLevel]&&(b("[DUST:"+d+"]",a),d===ERROR&&dust.debugLevel===DEBUG&&a instanceof Error&&a.stack&&b("[DUST:"+d+"]",a.stack))},dust.debugLevel=NONE,"undefined"!=typeof process&&process.env&&/\bdust\b/.test(process.env.DEBUG)&&(dust.debugLevel=DEBUG)}(),dust.helpers={},dust.cache={},dust.register=function(a,b){a&&(b.templateName=a,dust.config.cache!==!1&&(dust.cache[a]=b))},dust.render=function(a,b,c){var d=new Stub(c).head;try{load(a,d,b).end()}catch(e){d.setError(e)}},dust.stream=function(a,b){var c=new Stream,d=c.head;return dust.nextTick(function(){try{load(a,d,b).end()}catch(c){d.setError(c)}}),c},dust.loadSource=function(source){return eval(source)},Array.isArray?dust.isArray=Array.isArray:dust.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)},dust.nextTick=function(){return function(a){setTimeout(a,0)}}(),dust.isEmpty=function(a){return 0!==a&&(!(!dust.isArray(a)||a.length)||!a)},dust.isEmptyObject=function(a){var b;if(null===a)return!1;if(void 0===a)return!1;if(a.length>0)return!1;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b))return!1;return!0},dust.isTemplateFn=function(a){return"function"==typeof a&&a.__dustBody},dust.isThenable=function(a){return a&&("object"==typeof a||"function"==typeof a)&&"function"==typeof a.then},dust.isNonThenableFunction=function(a){return"function"==typeof a&&!dust.isThenable(a)},dust.isStreamable=function(a){return a&&"function"==typeof a.on&&"function"==typeof a.pipe},dust.filter=function(a,b,c,d){var e,f,g,h;if(c)for(e=0,f=c.length;e0){for(g=b.stack&&b.stack.head||{},g.$len=f,e=0;e"']/,AMP=/&/g,LT=//g,QUOT=/\"/g,SQUOT=/\'/g;dust.escapeHtml=function(a){return"string"==typeof a||a&&"function"==typeof a.toString?("string"!=typeof a&&(a=a.toString()),HCHARS.test(a)?a.replace(AMP,"&").replace(LT,"<").replace(GT,">").replace(QUOT,""").replace(SQUOT,"'"):a):a};var BS=/\\/g,FS=/\//g,CR=/\r/g,LS=/\u2028/g,PS=/\u2029/g,NL=/\n/g,LF=/\f/g,SQ=/'/g,DQ=/"/g,TB=/\t/g;return dust.escapeJs=function(a){return"string"==typeof a?a.replace(BS,"\\\\").replace(FS,"\\/").replace(DQ,'\\"').replace(SQ,"\\'").replace(CR,"\\r").replace(LS,"\\u2028").replace(PS,"\\u2029").replace(NL,"\\n").replace(LF,"\\f").replace(TB,"\\t"):a},dust.escapeJSON=function(a){return JSON?JSON.stringify(a).replace(LS,"\\u2028").replace(PS,"\\u2029").replace(LT,"\\u003c"):(dust.log("JSON is undefined; could not escape `"+a+"`",WARN),a)},dust}),function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define("dust.parse",["dust.core"],function(dust){return b(dust).parse}):"object"==typeof exports?module.exports=b(require("./dust")):b(a.dust)}(this,function(dust){var a=function(){"use strict";function a(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}function b(a,c,d,e){this.message=a,this.expected=c,this.found=d,this.location=e,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,b)}function c(a){function c(){return f(tc,sc)}function d(b){throw h(b,null,a.substring(tc,sc),f(tc,sc))}function e(b){var c,d,e=uc[b];if(e)return e;for(c=b-1;!uc[c];)c--;for(e=uc[c],e={line:e.line,column:e.column,seenCR:e.seenCR};cvc&&(vc=sc,wc=[]),wc.push(a))}function h(a,c,d,e){function f(a){var b=1;for(a.sort(function(a,b){return a.descriptionb.description?1:0});b1?g.slice(0,-1).join(", ")+" or "+g[a.length-1]:g[0],e=b?'"'+c(b)+'"':"end of input","Expected "+d+" but "+e+" found."}return null!==c&&f(c),new b(null!==a?a:g(c,d),c,d,e)}function i(){var a;return a=j()}function j(){var a,b,c;for(a=sc,b=[],c=k();c!==X;)b.push(c),c=k();return b!==X&&(tc=a,b=$(b)),a=b}function k(){var a;return a=K(),a===X&&(a=L(),a===X&&(a=l(),a===X&&(a=s(),a===X&&(a=u(),a===X&&(a=r(),a===X&&(a=H())))))),a}function l(){var b,c,d,e,f,h,i,k;if(xc++,b=sc,c=m(),c!==X){for(d=[],e=S();e!==X;)d.push(e),e=S();d!==X?(e=O(),e!==X?(f=j(),f!==X?(h=q(),h!==X?(i=n(),i===X&&(i=null),i!==X?(tc=sc,k=aa(c,f,h,i),k=k?void 0:X,k!==X?(tc=b,c=ba(c,f,h,i),b=c):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;if(b===X)if(b=sc,c=m(),c!==X){for(d=[],e=S();e!==X;)d.push(e),e=S();d!==X?(47===a.charCodeAt(sc)?(e=ca,sc++):(e=X,0===xc&&g(da)),e!==X?(f=O(),f!==X?(tc=b,c=ea(c),b=c):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(_)),b}function m(){var b,c,d,e,f,h,i;if(b=sc,c=N(),c!==X)if(fa.test(a.charAt(sc))?(d=a.charAt(sc),sc++):(d=X,0===xc&&g(ga)),d!==X){for(e=[],f=S();f!==X;)e.push(f),f=S();e!==X?(f=v(),f!==X?(h=o(),h!==X?(i=p(),i!==X?(tc=b,c=ha(d,f,h,i),b=c):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;else sc=b,b=X;return b}function n(){var b,c,d,e,f,h,i;if(xc++,b=sc,c=N(),c!==X)if(47===a.charCodeAt(sc)?(d=ca,sc++):(d=X,0===xc&&g(da)),d!==X){for(e=[],f=S();f!==X;)e.push(f),f=S();if(e!==X)if(f=v(),f!==X){for(h=[],i=S();i!==X;)h.push(i),i=S();h!==X?(i=O(),i!==X?(tc=b,c=ja(f),b=c):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;else sc=b,b=X}else sc=b,b=X;else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(ia)),b}function o(){var b,c,d,e;return b=sc,c=sc,58===a.charCodeAt(sc)?(d=ka,sc++):(d=X,0===xc&&g(la)),d!==X?(e=v(),e!==X?(tc=c,d=ma(e),c=d):(sc=c,c=X)):(sc=c,c=X),c===X&&(c=null),c!==X&&(tc=b,c=na(c)),b=c}function p(){var b,c,d,e,f,h,i;if(xc++,b=sc,c=[],d=sc,e=[],f=S(),f!==X)for(;f!==X;)e.push(f),f=S();else e=X;for(e!==X?(f=C(),f!==X?(61===a.charCodeAt(sc)?(h=pa,sc++):(h=X,0===xc&&g(qa)),h!==X?(i=w(),i===X&&(i=v(),i===X&&(i=F())),i!==X?(tc=d,e=ra(f,i),d=e):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X);d!==X;){if(c.push(d),d=sc,e=[],f=S(),f!==X)for(;f!==X;)e.push(f),f=S();else e=X;e!==X?(f=C(),f!==X?(61===a.charCodeAt(sc)?(h=pa,sc++):(h=X,0===xc&&g(qa)),h!==X?(i=w(),i===X&&(i=v(),i===X&&(i=F())),i!==X?(tc=d,e=ra(f,i),d=e):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)}return c!==X&&(tc=b,c=sa(c)),b=c,xc--,b===X&&(c=X,0===xc&&g(oa)),b}function q(){var b,c,d,e,f,h,i,k;for(xc++,b=sc,c=[],d=sc,e=N(),e!==X?(58===a.charCodeAt(sc)?(f=ka,sc++):(f=X,0===xc&&g(la)),f!==X?(h=C(),h!==X?(i=O(),i!==X?(k=j(),k!==X?(tc=d,e=ra(h,k),d=e):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X);d!==X;)c.push(d),d=sc,e=N(),e!==X?(58===a.charCodeAt(sc)?(f=ka,sc++):(f=X,0===xc&&g(la)),f!==X?(h=C(),h!==X?(i=O(),i!==X?(k=j(),k!==X?(tc=d,e=ra(h,k),d=e):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X);return c!==X&&(tc=b,c=ua(c)),b=c,xc--,b===X&&(c=X,0===xc&&g(ta)),b}function r(){var a,b,c,d,e;return xc++,a=sc,b=N(),b!==X?(c=v(),c!==X?(d=t(),d!==X?(e=O(),e!==X?(tc=a,b=wa(c,d),a=b):(sc=a,a=X)):(sc=a,a=X)):(sc=a,a=X)):(sc=a,a=X),xc--,a===X&&(b=X,0===xc&&g(va)),a}function s(){var b,c,d,e,f,h,i,j,k,l;if(xc++,b=sc,c=N(),c!==X)if(62===a.charCodeAt(sc)?(d=ya,sc++):(d=X,0===xc&&g(za)),d===X&&(43===a.charCodeAt(sc)?(d=Aa,sc++):(d=X,0===xc&&g(Ba))),d!==X){for(e=[],f=S();f!==X;)e.push(f),f=S();if(e!==X)if(f=sc,h=C(),h!==X&&(tc=f,h=Ca(d,h)),f=h,f===X&&(f=F()),f!==X)if(h=o(),h!==X)if(i=p(),i!==X){for(j=[],k=S();k!==X;)j.push(k),k=S();j!==X?(47===a.charCodeAt(sc)?(k=ca,sc++):(k=X,0===xc&&g(da)),k!==X?(l=O(),l!==X?(tc=b,c=Da(d,f,h,i),b=c):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;else sc=b,b=X;else sc=b,b=X;else sc=b,b=X}else sc=b,b=X;else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(xa)),b}function t(){var b,c,d,e,f;for(xc++,b=sc,c=[],d=sc,124===a.charCodeAt(sc)?(e=Fa,sc++):(e=X,0===xc&&g(Ga)),e!==X?(f=C(),f!==X?(tc=d,e=ma(f),d=e):(sc=d,d=X)):(sc=d,d=X);d!==X;)c.push(d),d=sc,124===a.charCodeAt(sc)?(e=Fa,sc++):(e=X,0===xc&&g(Ga)),e!==X?(f=C(),f!==X?(tc=d,e=ma(f),d=e):(sc=d,d=X)):(sc=d,d=X);return c!==X&&(tc=b,c=Ha(c)),b=c,xc--,b===X&&(c=X,0===xc&&g(Ea)),b}function u(){var b,c,d,e,f;return xc++,b=sc,c=N(),c!==X?(126===a.charCodeAt(sc)?(d=Ja,sc++):(d=X,0===xc&&g(Ka)),d!==X?(e=C(),e!==X?(f=O(),f!==X?(tc=b,c=La(e),b=c):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X),xc--,b===X&&(c=X,0===xc&&g(Ia)),b}function v(){var a,b;return xc++,a=sc,b=B(),b!==X&&(tc=a,b=Na(b)),a=b,a===X&&(a=sc,b=C(),b!==X&&(tc=a,b=Oa(b)),a=b),xc--,a===X&&(b=X,0===xc&&g(Ma)),a}function w(){var a,b;return xc++,a=sc,b=x(),b===X&&(b=A()),b!==X&&(tc=a,b=Qa(b)),a=b,xc--,a===X&&(b=X,0===xc&&g(Pa)),a}function x(){var b,c,d,e;return xc++,b=sc,c=A(),c!==X?(46===a.charCodeAt(sc)?(d=Sa,sc++):(d=X,0===xc&&g(Ta)),d!==X?(e=y(),e!==X?(tc=b,c=Ua(c,e),b=c):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X),xc--,b===X&&(c=X,0===xc&&g(Ra)),b}function y(){var b,c,d;if(xc++,b=sc,c=[],Wa.test(a.charAt(sc))?(d=a.charAt(sc),sc++):(d=X,0===xc&&g(Xa)),d!==X)for(;d!==X;)c.push(d),Wa.test(a.charAt(sc))?(d=a.charAt(sc),sc++):(d=X,0===xc&&g(Xa));else c=X;return c!==X&&(tc=b,c=Ya(c)),b=c,xc--,b===X&&(c=X,0===xc&&g(Va)),b}function z(){var b,c,d;return xc++,b=sc,45===a.charCodeAt(sc)?(c=$a,sc++):(c=X,0===xc&&g(_a)),c!==X?(d=y(),d!==X?(tc=b,c=ab(c,d),b=c):(sc=b,b=X)):(sc=b,b=X),xc--,b===X&&(c=X,0===xc&&g(Za)),b}function A(){var a,b;return xc++,a=z(),a===X&&(a=y()),xc--,a===X&&(b=X,0===xc&&g(bb)),a}function B(){var b,c,d,e;if(xc++,b=sc,c=C(),c===X&&(c=null),c!==X){if(d=[],e=E(),e===X&&(e=D()),e!==X)for(;e!==X;)d.push(e),e=E(),e===X&&(e=D());else d=X;d!==X?(tc=b,c=db(c,d),b=c):(sc=b,b=X)}else sc=b,b=X;if(b===X)if(b=sc,46===a.charCodeAt(sc)?(c=Sa,sc++):(c=X,0===xc&&g(Ta)),c!==X){for(d=[],e=E(),e===X&&(e=D());e!==X;)d.push(e),e=E(),e===X&&(e=D());d!==X?(tc=b,c=eb(d),b=c):(sc=b,b=X)}else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(cb)),b}function C(){var b,c,d,e;if(xc++,b=sc,gb.test(a.charAt(sc))?(c=a.charAt(sc),sc++):(c=X,0===xc&&g(hb)),c!==X){for(d=[],ib.test(a.charAt(sc))?(e=a.charAt(sc),sc++):(e=X,0===xc&&g(jb));e!==X;)d.push(e),ib.test(a.charAt(sc))?(e=a.charAt(sc),sc++):(e=X,0===xc&&g(jb));d!==X?(tc=b,c=kb(c,d),b=c):(sc=b,b=X)}else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(fb)),b}function D(){var b,c,d,e,f,h;if(xc++,b=sc,c=sc,d=P(),d!==X){if(e=sc,f=[],Wa.test(a.charAt(sc))?(h=a.charAt(sc),sc++):(h=X,0===xc&&g(Xa)),h!==X)for(;h!==X;)f.push(h),Wa.test(a.charAt(sc))?(h=a.charAt(sc),sc++):(h=X,0===xc&&g(Xa));else f=X;f!==X&&(tc=e,f=mb(f)),e=f,e===X&&(e=v()),e!==X?(f=Q(),f!==X?(tc=c,d=nb(e),c=d):(sc=c,c=X)):(sc=c,c=X)}else sc=c,c=X;return c!==X?(d=E(),d===X&&(d=null),d!==X?(tc=b,c=ob(c,d),b=c):(sc=b,b=X)):(sc=b,b=X),xc--,b===X&&(c=X,0===xc&&g(lb)),b}function E(){var b,c,d,e,f;if(xc++,b=sc,c=[],d=sc,46===a.charCodeAt(sc)?(e=Sa,sc++):(e=X,0===xc&&g(Ta)),e!==X?(f=C(),f!==X?(tc=d,e=qb(f),d=e):(sc=d,d=X)):(sc=d,d=X),d!==X)for(;d!==X;)c.push(d),d=sc,46===a.charCodeAt(sc)?(e=Sa,sc++):(e=X,0===xc&&g(Ta)),e!==X?(f=C(),f!==X?(tc=d,e=qb(f),d=e):(sc=d,d=X)):(sc=d,d=X);else c=X;return c!==X?(d=D(),d===X&&(d=null),d!==X?(tc=b,c=rb(c,d),b=c):(sc=b,b=X)):(sc=b,b=X),xc--,b===X&&(c=X,0===xc&&g(pb)),b}function F(){var b,c,d,e;if(xc++,b=sc,34===a.charCodeAt(sc)?(c=tb,sc++):(c=X,0===xc&&g(ub)),c!==X?(34===a.charCodeAt(sc)?(d=tb,sc++):(d=X,0===xc&&g(ub)),d!==X?(tc=b,c=vb(),b=c):(sc=b,b=X)):(sc=b,b=X),b===X&&(b=sc,34===a.charCodeAt(sc)?(c=tb,sc++):(c=X,0===xc&&g(ub)),c!==X?(d=I(),d!==X?(34===a.charCodeAt(sc)?(e=tb,sc++):(e=X,0===xc&&g(ub)),e!==X?(tc=b,c=wb(d),b=c):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X),b===X))if(b=sc,34===a.charCodeAt(sc)?(c=tb,sc++):(c=X,0===xc&&g(ub)),c!==X){if(d=[],e=G(),e!==X)for(;e!==X;)d.push(e),e=G();else d=X;d!==X?(34===a.charCodeAt(sc)?(e=tb,sc++):(e=X,0===xc&&g(ub)),e!==X?(tc=b,c=xb(d),b=c):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(sb)),b}function G(){var a,b;return a=u(),a===X&&(a=r(),a===X&&(a=sc,b=I(),b!==X&&(tc=a,b=yb(b)),a=b)),a}function H(){var b,c,d,e,f,h,i,j;if(xc++,b=sc,c=R(),c!==X){for(d=[],e=S();e!==X;)d.push(e),e=S();d!==X?(tc=b,c=Ab(c,d),b=c):(sc=b,b=X)}else sc=b,b=X;if(b===X){if(b=sc,c=[],d=sc,e=sc,xc++,f=M(),xc--,f===X?e=void 0:(sc=e,e=X),e!==X?(f=sc,xc++,h=K(),xc--,h===X?f=void 0:(sc=f,f=X),f!==X?(h=sc,xc++,i=L(),xc--,i===X?h=void 0:(sc=h,h=X),h!==X?(i=sc,xc++,j=R(),xc--,j===X?i=void 0:(sc=i,i=X),i!==X?(a.length>sc?(j=a.charAt(sc),sc++):(j=X,0===xc&&g(Bb)),j!==X?(tc=d,e=Cb(j),d=e):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X),d!==X)for(;d!==X;)c.push(d),d=sc,e=sc,xc++,f=M(),xc--,f===X?e=void 0:(sc=e,e=X),e!==X?(f=sc,xc++,h=K(),xc--,h===X?f=void 0:(sc=f,f=X),f!==X?(h=sc,xc++,i=L(),xc--,i===X?h=void 0:(sc=h,h=X),h!==X?(i=sc,xc++,j=R(),xc--,j===X?i=void 0:(sc=i,i=X),i!==X?(a.length>sc?(j=a.charAt(sc),sc++):(j=X,0===xc&&g(Bb)),j!==X?(tc=d,e=Cb(j),d=e):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X);else c=X;c!==X&&(tc=b,c=Db(c)),b=c}return xc--,b===X&&(c=X,0===xc&&g(zb)),b}function I(){var b,c,d,e,f;if(xc++,b=sc,c=[],d=sc,e=sc,xc++,f=M(),xc--,f===X?e=void 0:(sc=e,e=X),e!==X?(f=J(),f===X&&(Fb.test(a.charAt(sc))?(f=a.charAt(sc),sc++):(f=X,0===xc&&g(Gb))),f!==X?(tc=d,e=Cb(f),d=e):(sc=d,d=X)):(sc=d,d=X),d!==X)for(;d!==X;)c.push(d),d=sc,e=sc,xc++,f=M(),xc--,f===X?e=void 0:(sc=e,e=X),e!==X?(f=J(),f===X&&(Fb.test(a.charAt(sc))?(f=a.charAt(sc),sc++):(f=X,0===xc&&g(Gb))),f!==X?(tc=d,e=Cb(f),d=e):(sc=d,d=X)):(sc=d,d=X);else c=X;return c!==X&&(tc=b,c=Hb(c)),b=c,xc--,b===X&&(c=X,0===xc&&g(Eb)),b}function J(){var b,c;return b=sc,a.substr(sc,2)===Ib?(c=Ib,sc+=2):(c=X,0===xc&&g(Jb)),c!==X&&(tc=b,c=Kb()),b=c}function K(){var b,c,d,e,f,h;if(xc++,b=sc,a.substr(sc,2)===Mb?(c=Mb,sc+=2):(c=X,0===xc&&g(Nb)),c!==X){for(d=[],e=sc,f=sc,xc++,a.substr(sc,2)===Ob?(h=Ob,sc+=2):(h=X,0===xc&&g(Pb)),xc--,h===X?f=void 0:(sc=f,f=X),f!==X?(a.length>sc?(h=a.charAt(sc),sc++):(h=X,0===xc&&g(Bb)),h!==X?(tc=e,f=Qb(h),e=f):(sc=e,e=X)):(sc=e,e=X);e!==X;)d.push(e),e=sc,f=sc,xc++,a.substr(sc,2)===Ob?(h=Ob,sc+=2):(h=X,0===xc&&g(Pb)),xc--,h===X?f=void 0:(sc=f,f=X),f!==X?(a.length>sc?(h=a.charAt(sc),sc++):(h=X,0===xc&&g(Bb)),h!==X?(tc=e,f=Qb(h),e=f):(sc=e,e=X)):(sc=e,e=X);d!==X?(a.substr(sc,2)===Ob?(e=Ob,sc+=2):(e=X,0===xc&&g(Pb)),e!==X?(tc=b,c=Rb(d),b=c):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(Lb)),b}function L(){var b,c,d,e,f,h;if(xc++,b=sc,a.substr(sc,2)===Tb?(c=Tb,sc+=2):(c=X,0===xc&&g(Ub)),c!==X){for(d=[],e=sc,f=sc,xc++,a.substr(sc,2)===Vb?(h=Vb,sc+=2):(h=X,0===xc&&g(Wb)),xc--,h===X?f=void 0:(sc=f,f=X),f!==X?(a.length>sc?(h=a.charAt(sc),sc++):(h=X,0===xc&&g(Bb)),h!==X?(tc=e,f=Cb(h),e=f):(sc=e,e=X)):(sc=e,e=X);e!==X;)d.push(e),e=sc,f=sc,xc++,a.substr(sc,2)===Vb?(h=Vb,sc+=2):(h=X,0===xc&&g(Wb)),xc--,h===X?f=void 0:(sc=f,f=X),f!==X?(a.length>sc?(h=a.charAt(sc),sc++):(h=X,0===xc&&g(Bb)),h!==X?(tc=e,f=Cb(h),e=f):(sc=e,e=X)):(sc=e,e=X);d!==X?(a.substr(sc,2)===Vb?(e=Vb,sc+=2):(e=X,0===xc&&g(Wb)),e!==X?(tc=b,c=Xb(d),b=c):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(Sb)),b}function M(){var b,c,d,e,f,h,i,j,k,l;if(b=sc,c=N(),c!==X){for(d=[],e=S();e!==X;)d.push(e),e=S();if(d!==X)if(Yb.test(a.charAt(sc))?(e=a.charAt(sc),sc++):(e=X,0===xc&&g(Zb)),e!==X){for(f=[],h=S();h!==X;)f.push(h),h=S();if(f!==X){if(h=[],i=sc,j=sc,xc++,k=O(),xc--,k===X?j=void 0:(sc=j,j=X),j!==X?(k=sc,xc++,l=R(),xc--,l===X?k=void 0:(sc=k,k=X),k!==X?(a.length>sc?(l=a.charAt(sc),sc++):(l=X,0===xc&&g(Bb)),l!==X?(j=[j,k,l],i=j):(sc=i,i=X)):(sc=i,i=X)):(sc=i,i=X),i!==X)for(;i!==X;)h.push(i),i=sc,j=sc,xc++,k=O(),xc--,k===X?j=void 0:(sc=j,j=X),j!==X?(k=sc,xc++,l=R(),xc--,l===X?k=void 0:(sc=k,k=X),k!==X?(a.length>sc?(l=a.charAt(sc),sc++):(l=X,0===xc&&g(Bb)),l!==X?(j=[j,k,l],i=j):(sc=i,i=X)):(sc=i,i=X)):(sc=i,i=X);else h=X;if(h!==X){for(i=[],j=S();j!==X;)i.push(j),j=S();i!==X?(j=O(),j!==X?(c=[c,d,e,f,h,i,j],b=c):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X}else sc=b,b=X}else sc=b,b=X;else sc=b,b=X}else sc=b,b=X;return b===X&&(b=r()),b}function N(){var b;return 123===a.charCodeAt(sc)?(b=$b,sc++):(b=X,0===xc&&g(_b)),b}function O(){var b;return 125===a.charCodeAt(sc)?(b=ac,sc++):(b=X,0===xc&&g(bc)),b}function P(){var b;return 91===a.charCodeAt(sc)?(b=cc,sc++):(b=X,0===xc&&g(dc)),b}function Q(){var b;return 93===a.charCodeAt(sc)?(b=ec,sc++):(b=X,0===xc&&g(fc)),b}function R(){var b;return 10===a.charCodeAt(sc)?(b=gc,sc++):(b=X,0===xc&&g(hc)),b===X&&(a.substr(sc,2)===ic?(b=ic,sc+=2):(b=X,0===xc&&g(jc)),b===X&&(13===a.charCodeAt(sc)?(b=kc,sc++):(b=X,0===xc&&g(lc)),b===X&&(8232===a.charCodeAt(sc)?(b=mc,sc++):(b=X,0===xc&&g(nc)),b===X&&(8233===a.charCodeAt(sc)?(b=oc,sc++):(b=X,0===xc&&g(pc)))))),b}function S(){var b;return qc.test(a.charAt(sc))?(b=a.charAt(sc),sc++):(b=X,0===xc&&g(rc)),b===X&&(b=R()),b}function T(a){return parseInt(a.join(""),10)}function U(a){return a.location=c(),a}var V,W=arguments.length>1?arguments[1]:{},X={},Y={start:i},Z=i,$=function(a){var b=["body"].concat(a);return U(b)},_={type:"other",description:"section"},aa=function(a,b,c,e){return e&&a[1].text===e.text||d("Expected end tag for "+a[1].text+" but it was not found."),!0},ba=function(a,b,c,d){return c.push(["param",["literal","block"],b]),a.push(c,["filters"]),U(a)},ca="/",da={type:"literal",value:"/",description:'"/"'},ea=function(a){return a.push(["bodies"],["filters"]),U(a)},fa=/^[#?\^<+@%]/,ga={type:"class",value:"[#?^<+@%]",description:"[#?^<+@%]"},ha=function(a,b,c,d){return[a,b,c,d]},ia={type:"other",description:"end tag"},ja=function(a){return a},ka=":",la={type:"literal",value:":",description:'":"'},ma=function(a){return a},na=function(a){return a?["context",a]:["context"]},oa={type:"other",description:"params"},pa="=",qa={type:"literal",value:"=",description:'"="'},ra=function(a,b){return["param",["literal",a],b]},sa=function(a){return["params"].concat(a)},ta={type:"other",description:"bodies"},ua=function(a){return["bodies"].concat(a)},va={type:"other",description:"reference"},wa=function(a,b){return U(["reference",a,b])},xa={type:"other",description:"partial"},ya=">",za={type:"literal",value:">",description:'">"'},Aa="+",Ba={type:"literal",value:"+",description:'"+"'},Ca=function(a,b){return["literal",b]},Da=function(a,b,c,d){var e=">"===a?"partial":a;return U([e,b,c,d])},Ea={type:"other",description:"filters"},Fa="|",Ga={type:"literal",value:"|",description:'"|"'},Ha=function(a){return["filters"].concat(a)},Ia={type:"other",description:"special"},Ja="~",Ka={type:"literal",value:"~",description:'"~"'},La=function(a){return U(["special",a])},Ma={type:"other",description:"identifier"},Na=function(a){var b=["path"].concat(a);return b.text=a[1].join("."),b},Oa=function(a){var b=["key",a];return b.text=a,b},Pa={type:"other",description:"number"},Qa=function(a){return["literal",a]},Ra={type:"other",description:"float"},Sa=".",Ta={type:"literal",value:".",description:'"."'},Ua=function(a,b){return parseFloat(a+"."+b)},Va={type:"other",description:"unsigned_integer"},Wa=/^[0-9]/,Xa={type:"class",value:"[0-9]",description:"[0-9]"},Ya=function(a){return T(a)},Za={type:"other",description:"signed_integer"},$a="-",_a={type:"literal",value:"-",description:'"-"'},ab=function(a,b){return b*-1},bb={type:"other",description:"integer"},cb={type:"other",description:"path"},db=function(a,b){return b=b[0],a&&b?(b.unshift(a),U([!1,b])):U([!0,b])},eb=function(a){return U(a.length>0?[!0,a[0]]:[!0,[]])},fb={type:"other",description:"key"},gb=/^[a-zA-Z_$]/,hb={type:"class",value:"[a-zA-Z_$]",description:"[a-zA-Z_$]"},ib=/^[0-9a-zA-Z_$\-]/,jb={type:"class",value:"[0-9a-zA-Z_$-]",description:"[0-9a-zA-Z_$-]"},kb=function(a,b){return a+b.join("")},lb={type:"other",description:"array"},mb=function(a){return a.join("")},nb=function(a){return a},ob=function(a,b){return b?b.unshift(a):b=[a],b},pb={type:"other",description:"array_part"},qb=function(a){return a},rb=function(a,b){return b?a.concat(b):a},sb={type:"other",description:"inline"},tb='"',ub={type:"literal",value:'"',description:'"\\""'},vb=function(){return U(["literal",""])},wb=function(a){return U(["literal",a])},xb=function(a){return U(["body"].concat(a))},yb=function(a){return["buffer",a]},zb={type:"other",description:"buffer"},Ab=function(a,b){return U(["format",a,b.join("")])},Bb={type:"any",description:"any character"},Cb=function(a){return a},Db=function(a){return U(["buffer",a.join("")])},Eb={type:"other",description:"literal"},Fb=/^[^"]/,Gb={type:"class",value:'[^"]',description:'[^"]'},Hb=function(a){return a.join("")},Ib='\\"',Jb={type:"literal",value:'\\"',description:'"\\\\\\""'},Kb=function(){return'"'},Lb={type:"other",description:"raw"},Mb="{`",Nb={type:"literal",value:"{`",description:'"{`"'},Ob="`}",Pb={type:"literal",value:"`}",description:'"`}"' -},Qb=function(a){return a},Rb=function(a){return U(["raw",a.join("")])},Sb={type:"other",description:"comment"},Tb="{!",Ub={type:"literal",value:"{!",description:'"{!"'},Vb="!}",Wb={type:"literal",value:"!}",description:'"!}"'},Xb=function(a){return U(["comment",a.join("")])},Yb=/^[#?\^><+%:@\/~%]/,Zb={type:"class",value:"[#?^><+%:@/~%]",description:"[#?^><+%:@/~%]"},$b="{",_b={type:"literal",value:"{",description:'"{"'},ac="}",bc={type:"literal",value:"}",description:'"}"'},cc="[",dc={type:"literal",value:"[",description:'"["'},ec="]",fc={type:"literal",value:"]",description:'"]"'},gc="\n",hc={type:"literal",value:"\n",description:'"\\n"'},ic="\r\n",jc={type:"literal",value:"\r\n",description:'"\\r\\n"'},kc="\r",lc={type:"literal",value:"\r",description:'"\\r"'},mc="\u2028",nc={type:"literal",value:"\u2028",description:'"\\u2028"'},oc="\u2029",pc={type:"literal",value:"\u2029",description:'"\\u2029"'},qc=/^[\t\x0B\f \xA0\uFEFF]/,rc={type:"class",value:"[\\t\\v\\f \\u00A0\\uFEFF]",description:"[\\t\\v\\f \\u00A0\\uFEFF]"},sc=0,tc=0,uc=[{line:1,column:1,seenCR:!1}],vc=0,wc=[],xc=0;if("startRule"in W){if(!(W.startRule in Y))throw new Error("Can't start parsing from rule \""+W.startRule+'".');Z=Y[W.startRule]}if(V=Z(),V!==X&&sc===a.length)return V;throw V!==X&&sc=c[dust.debugLevel]&&(b("[DUST:"+d+"]",a),d===ERROR&&dust.debugLevel===DEBUG&&a instanceof Error&&a.stack&&b("[DUST:"+d+"]",a.stack))},dust.debugLevel=NONE,"undefined"!=typeof process&&process.env&&/\bdust\b/.test(process.env.DEBUG)&&(dust.debugLevel=DEBUG)}(),dust.helpers={},dust.cache={},dust.register=function(a,b){a&&(b.templateName=a,dust.config.cache!==!1&&(dust.cache[a]=b))},dust.render=function(a,b,c){var d=new Stub(c).head;try{load(a,d,b).end()}catch(e){d.setError(e)}},dust.stream=function(a,b){var c=new Stream,d=c.head;return dust.nextTick(function(){try{load(a,d,b).end()}catch(c){d.setError(c)}}),c},dust.loadSource=function(source){return eval(source)},Array.isArray?dust.isArray=Array.isArray:dust.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)},dust.nextTick=function(){return function(a){setTimeout(a,0)}}(),dust.isEmpty=function(a){return 0!==a&&(!(!dust.isArray(a)||a.length)||!a)},dust.isEmptyObject=function(a){var b;if(null===a)return!1;if(void 0===a)return!1;if(a.length>0)return!1;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b))return!1;return!0},dust.isTemplateFn=function(a){return"function"==typeof a&&a.__dustBody},dust.isThenable=function(a){return a&&("object"==typeof a||"function"==typeof a)&&"function"==typeof a.then},dust.isNonThenableFunction=function(a){return"function"==typeof a&&!dust.isThenable(a)},dust.isStreamable=function(a){return a&&"function"==typeof a.on&&"function"==typeof a.pipe},dust.filter=function(a,b,c,d){var e,f,g,h;if(c)for(e=0,f=c.length;e0){for(g=b.stack&&b.stack.head||{},g.$len=f,e=0;e"']/,AMP=/&/g,LT=//g,QUOT=/\"/g,SQUOT=/\'/g;dust.escapeHtml=function(a){return"string"==typeof a||a&&"function"==typeof a.toString?("string"!=typeof a&&(a=a.toString()),HCHARS.test(a)?a.replace(AMP,"&").replace(LT,"<").replace(GT,">").replace(QUOT,""").replace(SQUOT,"'"):a):a};var BS=/\\/g,FS=/\//g,CR=/\r/g,LS=/\u2028/g,PS=/\u2029/g,NL=/\n/g,LF=/\f/g,SQ=/'/g,DQ=/"/g,TB=/\t/g;return dust.escapeJs=function(a){return"string"==typeof a?a.replace(BS,"\\\\").replace(FS,"\\/").replace(DQ,'\\"').replace(SQ,"\\'").replace(CR,"\\r").replace(LS,"\\u2028").replace(PS,"\\u2029").replace(NL,"\\n").replace(LF,"\\f").replace(TB,"\\t"):a},dust.escapeJSON=function(a){return JSON?JSON.stringify(a).replace(LS,"\\u2028").replace(PS,"\\u2029").replace(LT,"\\u003c"):(dust.log("JSON is undefined; could not escape `"+a+"`",WARN),a)},dust}),function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define("dust.parse",["dust.core"],function(dust){return b(dust).parse}):"object"==typeof exports?module.exports=b(require("./dust")):b(a.dust)}(this,function(dust){var a=function(){"use strict";function a(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}function b(a,c,d,e){this.message=a,this.expected=c,this.found=d,this.location=e,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,b)}function c(a){function c(){return f(tc,sc)}function d(b){throw h(b,null,a.substring(tc,sc),f(tc,sc))}function e(b){var c,d,e=uc[b];if(e)return e;for(c=b-1;!uc[c];)c--;for(e=uc[c],e={line:e.line,column:e.column,seenCR:e.seenCR};cvc&&(vc=sc,wc=[]),wc.push(a))}function h(a,c,d,e){function f(a){var b=1;for(a.sort(function(a,b){return a.descriptionb.description?1:0});b1?g.slice(0,-1).join(", ")+" or "+g[a.length-1]:g[0],e=b?'"'+c(b)+'"':"end of input","Expected "+d+" but "+e+" found."}return null!==c&&f(c),new b(null!==a?a:g(c,d),c,d,e)}function i(){var a;return a=j()}function j(){var a,b,c;for(a=sc,b=[],c=k();c!==X;)b.push(c),c=k();return b!==X&&(tc=a,b=$(b)),a=b}function k(){var a;return a=K(),a===X&&(a=L(),a===X&&(a=l(),a===X&&(a=s(),a===X&&(a=u(),a===X&&(a=r(),a===X&&(a=H())))))),a}function l(){var b,c,d,e,f,h,i,k;if(xc++,b=sc,c=m(),c!==X){for(d=[],e=S();e!==X;)d.push(e),e=S();d!==X?(e=O(),e!==X?(f=j(),f!==X?(h=q(),h!==X?(i=n(),i===X&&(i=null),i!==X?(tc=sc,k=aa(c,f,h,i),k=k?void 0:X,k!==X?(tc=b,c=ba(c,f,h,i),b=c):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;if(b===X)if(b=sc,c=m(),c!==X){for(d=[],e=S();e!==X;)d.push(e),e=S();d!==X?(47===a.charCodeAt(sc)?(e=ca,sc++):(e=X,0===xc&&g(da)),e!==X?(f=O(),f!==X?(tc=b,c=ea(c),b=c):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(_)),b}function m(){var b,c,d,e,f,h,i;if(b=sc,c=N(),c!==X)if(fa.test(a.charAt(sc))?(d=a.charAt(sc),sc++):(d=X,0===xc&&g(ga)),d!==X){for(e=[],f=S();f!==X;)e.push(f),f=S();e!==X?(f=v(),f!==X?(h=o(),h!==X?(i=p(),i!==X?(tc=b,c=ha(d,f,h,i),b=c):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;else sc=b,b=X;return b}function n(){var b,c,d,e,f,h,i;if(xc++,b=sc,c=N(),c!==X)if(47===a.charCodeAt(sc)?(d=ca,sc++):(d=X,0===xc&&g(da)),d!==X){for(e=[],f=S();f!==X;)e.push(f),f=S();if(e!==X)if(f=v(),f!==X){for(h=[],i=S();i!==X;)h.push(i),i=S();h!==X?(i=O(),i!==X?(tc=b,c=ja(f),b=c):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;else sc=b,b=X}else sc=b,b=X;else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(ia)),b}function o(){var b,c,d,e;return b=sc,c=sc,58===a.charCodeAt(sc)?(d=ka,sc++):(d=X,0===xc&&g(la)),d!==X?(e=v(),e!==X?(tc=c,d=ma(e),c=d):(sc=c,c=X)):(sc=c,c=X),c===X&&(c=null),c!==X&&(tc=b,c=na(c)),b=c}function p(){var b,c,d,e,f,h,i;if(xc++,b=sc,c=[],d=sc,e=[],f=S(),f!==X)for(;f!==X;)e.push(f),f=S();else e=X;for(e!==X?(f=C(),f!==X?(61===a.charCodeAt(sc)?(h=pa,sc++):(h=X,0===xc&&g(qa)),h!==X?(i=w(),i===X&&(i=v(),i===X&&(i=F())),i!==X?(tc=d,e=ra(f,i),d=e):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X);d!==X;){if(c.push(d),d=sc,e=[],f=S(),f!==X)for(;f!==X;)e.push(f),f=S();else e=X;e!==X?(f=C(),f!==X?(61===a.charCodeAt(sc)?(h=pa,sc++):(h=X,0===xc&&g(qa)),h!==X?(i=w(),i===X&&(i=v(),i===X&&(i=F())),i!==X?(tc=d,e=ra(f,i),d=e):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)}return c!==X&&(tc=b,c=sa(c)),b=c,xc--,b===X&&(c=X,0===xc&&g(oa)),b}function q(){var b,c,d,e,f,h,i,k;for(xc++,b=sc,c=[],d=sc,e=N(),e!==X?(58===a.charCodeAt(sc)?(f=ka,sc++):(f=X,0===xc&&g(la)),f!==X?(h=C(),h!==X?(i=O(),i!==X?(k=j(),k!==X?(tc=d,e=ra(h,k),d=e):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X);d!==X;)c.push(d),d=sc,e=N(),e!==X?(58===a.charCodeAt(sc)?(f=ka,sc++):(f=X,0===xc&&g(la)),f!==X?(h=C(),h!==X?(i=O(),i!==X?(k=j(),k!==X?(tc=d,e=ra(h,k),d=e):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X);return c!==X&&(tc=b,c=ua(c)),b=c,xc--,b===X&&(c=X,0===xc&&g(ta)),b}function r(){var a,b,c,d,e;return xc++,a=sc,b=N(),b!==X?(c=v(),c!==X?(d=t(),d!==X?(e=O(),e!==X?(tc=a,b=wa(c,d),a=b):(sc=a,a=X)):(sc=a,a=X)):(sc=a,a=X)):(sc=a,a=X),xc--,a===X&&(b=X,0===xc&&g(va)),a}function s(){var b,c,d,e,f,h,i,j,k,l;if(xc++,b=sc,c=N(),c!==X)if(62===a.charCodeAt(sc)?(d=ya,sc++):(d=X,0===xc&&g(za)),d===X&&(43===a.charCodeAt(sc)?(d=Aa,sc++):(d=X,0===xc&&g(Ba))),d!==X){for(e=[],f=S();f!==X;)e.push(f),f=S();if(e!==X)if(f=sc,h=C(),h!==X&&(tc=f,h=Ca(d,h)),f=h,f===X&&(f=F()),f!==X)if(h=o(),h!==X)if(i=p(),i!==X){for(j=[],k=S();k!==X;)j.push(k),k=S();j!==X?(47===a.charCodeAt(sc)?(k=ca,sc++):(k=X,0===xc&&g(da)),k!==X?(l=O(),l!==X?(tc=b,c=Da(d,f,h,i),b=c):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;else sc=b,b=X;else sc=b,b=X;else sc=b,b=X}else sc=b,b=X;else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(xa)),b}function t(){var b,c,d,e,f;for(xc++,b=sc,c=[],d=sc,124===a.charCodeAt(sc)?(e=Fa,sc++):(e=X,0===xc&&g(Ga)),e!==X?(f=C(),f!==X?(tc=d,e=ma(f),d=e):(sc=d,d=X)):(sc=d,d=X);d!==X;)c.push(d),d=sc,124===a.charCodeAt(sc)?(e=Fa,sc++):(e=X,0===xc&&g(Ga)),e!==X?(f=C(),f!==X?(tc=d,e=ma(f),d=e):(sc=d,d=X)):(sc=d,d=X);return c!==X&&(tc=b,c=Ha(c)),b=c,xc--,b===X&&(c=X,0===xc&&g(Ea)),b}function u(){var b,c,d,e,f;return xc++,b=sc,c=N(),c!==X?(126===a.charCodeAt(sc)?(d=Ja,sc++):(d=X,0===xc&&g(Ka)),d!==X?(e=C(),e!==X?(f=O(),f!==X?(tc=b,c=La(e),b=c):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X),xc--,b===X&&(c=X,0===xc&&g(Ia)),b}function v(){var a,b;return xc++,a=sc,b=B(),b!==X&&(tc=a,b=Na(b)),a=b,a===X&&(a=sc,b=C(),b!==X&&(tc=a,b=Oa(b)),a=b),xc--,a===X&&(b=X,0===xc&&g(Ma)),a}function w(){var a,b;return xc++,a=sc,b=x(),b===X&&(b=A()),b!==X&&(tc=a,b=Qa(b)),a=b,xc--,a===X&&(b=X,0===xc&&g(Pa)),a}function x(){var b,c,d,e;return xc++,b=sc,c=A(),c!==X?(46===a.charCodeAt(sc)?(d=Sa,sc++):(d=X,0===xc&&g(Ta)),d!==X?(e=y(),e!==X?(tc=b,c=Ua(c,e),b=c):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X),xc--,b===X&&(c=X,0===xc&&g(Ra)),b}function y(){var b,c,d;if(xc++,b=sc,c=[],Wa.test(a.charAt(sc))?(d=a.charAt(sc),sc++):(d=X,0===xc&&g(Xa)),d!==X)for(;d!==X;)c.push(d),Wa.test(a.charAt(sc))?(d=a.charAt(sc),sc++):(d=X,0===xc&&g(Xa));else c=X;return c!==X&&(tc=b,c=Ya(c)),b=c,xc--,b===X&&(c=X,0===xc&&g(Va)),b}function z(){var b,c,d;return xc++,b=sc,45===a.charCodeAt(sc)?(c=$a,sc++):(c=X,0===xc&&g(_a)),c!==X?(d=y(),d!==X?(tc=b,c=ab(c,d),b=c):(sc=b,b=X)):(sc=b,b=X),xc--,b===X&&(c=X,0===xc&&g(Za)),b}function A(){var a,b;return xc++,a=z(),a===X&&(a=y()),xc--,a===X&&(b=X,0===xc&&g(bb)),a}function B(){var b,c,d,e;if(xc++,b=sc,c=C(),c===X&&(c=null),c!==X){if(d=[],e=E(),e===X&&(e=D()),e!==X)for(;e!==X;)d.push(e),e=E(),e===X&&(e=D());else d=X;d!==X?(tc=b,c=db(c,d),b=c):(sc=b,b=X)}else sc=b,b=X;if(b===X)if(b=sc,46===a.charCodeAt(sc)?(c=Sa,sc++):(c=X,0===xc&&g(Ta)),c!==X){for(d=[],e=E(),e===X&&(e=D());e!==X;)d.push(e),e=E(),e===X&&(e=D());d!==X?(tc=b,c=eb(d),b=c):(sc=b,b=X)}else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(cb)),b}function C(){var b,c,d,e;if(xc++,b=sc,gb.test(a.charAt(sc))?(c=a.charAt(sc),sc++):(c=X,0===xc&&g(hb)),c!==X){for(d=[],ib.test(a.charAt(sc))?(e=a.charAt(sc),sc++):(e=X,0===xc&&g(jb));e!==X;)d.push(e),ib.test(a.charAt(sc))?(e=a.charAt(sc),sc++):(e=X,0===xc&&g(jb));d!==X?(tc=b,c=kb(c,d),b=c):(sc=b,b=X)}else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(fb)),b}function D(){var b,c,d,e,f,h;if(xc++,b=sc,c=sc,d=P(),d!==X){if(e=sc,f=[],Wa.test(a.charAt(sc))?(h=a.charAt(sc),sc++):(h=X,0===xc&&g(Xa)),h!==X)for(;h!==X;)f.push(h),Wa.test(a.charAt(sc))?(h=a.charAt(sc),sc++):(h=X,0===xc&&g(Xa));else f=X;f!==X&&(tc=e,f=mb(f)),e=f,e===X&&(e=v()),e!==X?(f=Q(),f!==X?(tc=c,d=nb(e),c=d):(sc=c,c=X)):(sc=c,c=X)}else sc=c,c=X;return c!==X?(d=E(),d===X&&(d=null),d!==X?(tc=b,c=ob(c,d),b=c):(sc=b,b=X)):(sc=b,b=X),xc--,b===X&&(c=X,0===xc&&g(lb)),b}function E(){var b,c,d,e,f;if(xc++,b=sc,c=[],d=sc,46===a.charCodeAt(sc)?(e=Sa,sc++):(e=X,0===xc&&g(Ta)),e!==X?(f=C(),f!==X?(tc=d,e=qb(f),d=e):(sc=d,d=X)):(sc=d,d=X),d!==X)for(;d!==X;)c.push(d),d=sc,46===a.charCodeAt(sc)?(e=Sa,sc++):(e=X,0===xc&&g(Ta)),e!==X?(f=C(),f!==X?(tc=d,e=qb(f),d=e):(sc=d,d=X)):(sc=d,d=X);else c=X;return c!==X?(d=D(),d===X&&(d=null),d!==X?(tc=b,c=rb(c,d),b=c):(sc=b,b=X)):(sc=b,b=X),xc--,b===X&&(c=X,0===xc&&g(pb)),b}function F(){var b,c,d,e;if(xc++,b=sc,34===a.charCodeAt(sc)?(c=tb,sc++):(c=X,0===xc&&g(ub)),c!==X?(34===a.charCodeAt(sc)?(d=tb,sc++):(d=X,0===xc&&g(ub)),d!==X?(tc=b,c=vb(),b=c):(sc=b,b=X)):(sc=b,b=X),b===X&&(b=sc,34===a.charCodeAt(sc)?(c=tb,sc++):(c=X,0===xc&&g(ub)),c!==X?(d=I(),d!==X?(34===a.charCodeAt(sc)?(e=tb,sc++):(e=X,0===xc&&g(ub)),e!==X?(tc=b,c=wb(d),b=c):(sc=b,b=X)):(sc=b,b=X)):(sc=b,b=X),b===X))if(b=sc,34===a.charCodeAt(sc)?(c=tb,sc++):(c=X,0===xc&&g(ub)),c!==X){if(d=[],e=G(),e!==X)for(;e!==X;)d.push(e),e=G();else d=X;d!==X?(34===a.charCodeAt(sc)?(e=tb,sc++):(e=X,0===xc&&g(ub)),e!==X?(tc=b,c=xb(d),b=c):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(sb)),b}function G(){var a,b;return a=u(),a===X&&(a=r(),a===X&&(a=sc,b=I(),b!==X&&(tc=a,b=yb(b)),a=b)),a}function H(){var b,c,d,e,f,h,i,j;if(xc++,b=sc,c=R(),c!==X){for(d=[],e=S();e!==X;)d.push(e),e=S();d!==X?(tc=b,c=Ab(c,d),b=c):(sc=b,b=X)}else sc=b,b=X;if(b===X){if(b=sc,c=[],d=sc,e=sc,xc++,f=M(),xc--,f===X?e=void 0:(sc=e,e=X),e!==X?(f=sc,xc++,h=K(),xc--,h===X?f=void 0:(sc=f,f=X),f!==X?(h=sc,xc++,i=L(),xc--,i===X?h=void 0:(sc=h,h=X),h!==X?(i=sc,xc++,j=R(),xc--,j===X?i=void 0:(sc=i,i=X),i!==X?(a.length>sc?(j=a.charAt(sc),sc++):(j=X,0===xc&&g(Bb)),j!==X?(tc=d,e=Cb(j),d=e):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X),d!==X)for(;d!==X;)c.push(d),d=sc,e=sc,xc++,f=M(),xc--,f===X?e=void 0:(sc=e,e=X),e!==X?(f=sc,xc++,h=K(),xc--,h===X?f=void 0:(sc=f,f=X),f!==X?(h=sc,xc++,i=L(),xc--,i===X?h=void 0:(sc=h,h=X),h!==X?(i=sc,xc++,j=R(),xc--,j===X?i=void 0:(sc=i,i=X),i!==X?(a.length>sc?(j=a.charAt(sc),sc++):(j=X,0===xc&&g(Bb)),j!==X?(tc=d,e=Cb(j),d=e):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X)):(sc=d,d=X);else c=X;c!==X&&(tc=b,c=Db(c)),b=c}return xc--,b===X&&(c=X,0===xc&&g(zb)),b}function I(){var b,c,d,e,f;if(xc++,b=sc,c=[],d=sc,e=sc,xc++,f=M(),xc--,f===X?e=void 0:(sc=e,e=X),e!==X?(f=J(),f===X&&(Fb.test(a.charAt(sc))?(f=a.charAt(sc),sc++):(f=X,0===xc&&g(Gb))),f!==X?(tc=d,e=Cb(f),d=e):(sc=d,d=X)):(sc=d,d=X),d!==X)for(;d!==X;)c.push(d),d=sc,e=sc,xc++,f=M(),xc--,f===X?e=void 0:(sc=e,e=X),e!==X?(f=J(),f===X&&(Fb.test(a.charAt(sc))?(f=a.charAt(sc),sc++):(f=X,0===xc&&g(Gb))),f!==X?(tc=d,e=Cb(f),d=e):(sc=d,d=X)):(sc=d,d=X);else c=X;return c!==X&&(tc=b,c=Hb(c)),b=c,xc--,b===X&&(c=X,0===xc&&g(Eb)),b}function J(){var b,c;return b=sc,a.substr(sc,2)===Ib?(c=Ib,sc+=2):(c=X,0===xc&&g(Jb)),c!==X&&(tc=b,c=Kb()),b=c}function K(){var b,c,d,e,f,h;if(xc++,b=sc,a.substr(sc,2)===Mb?(c=Mb,sc+=2):(c=X,0===xc&&g(Nb)),c!==X){for(d=[],e=sc,f=sc,xc++,a.substr(sc,2)===Ob?(h=Ob,sc+=2):(h=X,0===xc&&g(Pb)),xc--,h===X?f=void 0:(sc=f,f=X),f!==X?(a.length>sc?(h=a.charAt(sc),sc++):(h=X,0===xc&&g(Bb)),h!==X?(tc=e,f=Qb(h),e=f):(sc=e,e=X)):(sc=e,e=X);e!==X;)d.push(e),e=sc,f=sc,xc++,a.substr(sc,2)===Ob?(h=Ob,sc+=2):(h=X,0===xc&&g(Pb)),xc--,h===X?f=void 0:(sc=f,f=X),f!==X?(a.length>sc?(h=a.charAt(sc),sc++):(h=X,0===xc&&g(Bb)),h!==X?(tc=e,f=Qb(h),e=f):(sc=e,e=X)):(sc=e,e=X);d!==X?(a.substr(sc,2)===Ob?(e=Ob,sc+=2):(e=X,0===xc&&g(Pb)),e!==X?(tc=b,c=Rb(d),b=c):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(Lb)),b}function L(){var b,c,d,e,f,h;if(xc++,b=sc,a.substr(sc,2)===Tb?(c=Tb,sc+=2):(c=X,0===xc&&g(Ub)),c!==X){for(d=[],e=sc,f=sc,xc++,a.substr(sc,2)===Vb?(h=Vb,sc+=2):(h=X,0===xc&&g(Wb)),xc--,h===X?f=void 0:(sc=f,f=X),f!==X?(a.length>sc?(h=a.charAt(sc),sc++):(h=X,0===xc&&g(Bb)),h!==X?(tc=e,f=Cb(h),e=f):(sc=e,e=X)):(sc=e,e=X);e!==X;)d.push(e),e=sc,f=sc,xc++,a.substr(sc,2)===Vb?(h=Vb,sc+=2):(h=X,0===xc&&g(Wb)),xc--,h===X?f=void 0:(sc=f,f=X),f!==X?(a.length>sc?(h=a.charAt(sc),sc++):(h=X,0===xc&&g(Bb)),h!==X?(tc=e,f=Cb(h),e=f):(sc=e,e=X)):(sc=e,e=X);d!==X?(a.substr(sc,2)===Vb?(e=Vb,sc+=2):(e=X,0===xc&&g(Wb)),e!==X?(tc=b,c=Xb(d),b=c):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X;return xc--,b===X&&(c=X,0===xc&&g(Sb)),b}function M(){var b,c,d,e,f,h,i,j,k,l;if(b=sc,c=N(),c!==X){for(d=[],e=S();e!==X;)d.push(e),e=S();if(d!==X)if(Yb.test(a.charAt(sc))?(e=a.charAt(sc),sc++):(e=X,0===xc&&g(Zb)),e!==X){for(f=[],h=S();h!==X;)f.push(h),h=S();if(f!==X){if(h=[],i=sc,j=sc,xc++,k=O(),xc--,k===X?j=void 0:(sc=j,j=X),j!==X?(k=sc,xc++,l=R(),xc--,l===X?k=void 0:(sc=k,k=X),k!==X?(a.length>sc?(l=a.charAt(sc),sc++):(l=X,0===xc&&g(Bb)),l!==X?(j=[j,k,l],i=j):(sc=i,i=X)):(sc=i,i=X)):(sc=i,i=X),i!==X)for(;i!==X;)h.push(i),i=sc,j=sc,xc++,k=O(),xc--,k===X?j=void 0:(sc=j,j=X),j!==X?(k=sc,xc++,l=R(),xc--,l===X?k=void 0:(sc=k,k=X),k!==X?(a.length>sc?(l=a.charAt(sc),sc++):(l=X,0===xc&&g(Bb)),l!==X?(j=[j,k,l],i=j):(sc=i,i=X)):(sc=i,i=X)):(sc=i,i=X);else h=X;if(h!==X){for(i=[],j=S();j!==X;)i.push(j),j=S();i!==X?(j=O(),j!==X?(c=[c,d,e,f,h,i,j],b=c):(sc=b,b=X)):(sc=b,b=X)}else sc=b,b=X}else sc=b,b=X}else sc=b,b=X;else sc=b,b=X}else sc=b,b=X;return b===X&&(b=r()),b}function N(){var b;return 123===a.charCodeAt(sc)?(b=$b,sc++):(b=X,0===xc&&g(_b)),b}function O(){var b;return 125===a.charCodeAt(sc)?(b=ac,sc++):(b=X,0===xc&&g(bc)),b}function P(){var b;return 91===a.charCodeAt(sc)?(b=cc,sc++):(b=X,0===xc&&g(dc)),b}function Q(){var b;return 93===a.charCodeAt(sc)?(b=ec,sc++):(b=X,0===xc&&g(fc)),b}function R(){var b;return 10===a.charCodeAt(sc)?(b=gc,sc++):(b=X,0===xc&&g(hc)),b===X&&(a.substr(sc,2)===ic?(b=ic,sc+=2):(b=X,0===xc&&g(jc)),b===X&&(13===a.charCodeAt(sc)?(b=kc,sc++):(b=X,0===xc&&g(lc)),b===X&&(8232===a.charCodeAt(sc)?(b=mc,sc++):(b=X,0===xc&&g(nc)),b===X&&(8233===a.charCodeAt(sc)?(b=oc,sc++):(b=X,0===xc&&g(pc)))))),b}function S(){var b;return qc.test(a.charAt(sc))?(b=a.charAt(sc),sc++):(b=X,0===xc&&g(rc)),b===X&&(b=R()),b}function T(a){return parseInt(a.join(""),10)}function U(a){return a.location=c(),a}var V,W=arguments.length>1?arguments[1]:{},X={},Y={start:i},Z=i,$=function(a){var b=["body"].concat(a);return U(b)},_={type:"other",description:"section"},aa=function(a,b,c,e){return e&&a[1].text===e.text||d("Expected end tag for "+a[1].text+" but it was not found."),!0},ba=function(a,b,c,d){return c.push(["param",["literal","block"],b]),a.push(c,["filters"]),U(a)},ca="/",da={type:"literal",value:"/",description:'"/"'},ea=function(a){return a.push(["bodies"],["filters"]),U(a)},fa=/^[#?\^<+@%]/,ga={type:"class",value:"[#?^<+@%]",description:"[#?^<+@%]"},ha=function(a,b,c,d){return[a,b,c,d]},ia={type:"other",description:"end tag"},ja=function(a){return a},ka=":",la={type:"literal",value:":",description:'":"'},ma=function(a){return a},na=function(a){return a?["context",a]:["context"]},oa={type:"other",description:"params"},pa="=",qa={type:"literal",value:"=",description:'"="'},ra=function(a,b){return["param",["literal",a],b]},sa=function(a){return["params"].concat(a)},ta={type:"other",description:"bodies"},ua=function(a){return["bodies"].concat(a)},va={type:"other",description:"reference"},wa=function(a,b){return U(["reference",a,b])},xa={type:"other",description:"partial"},ya=">",za={type:"literal",value:">",description:'">"'},Aa="+",Ba={type:"literal",value:"+",description:'"+"'},Ca=function(a,b){return["literal",b]},Da=function(a,b,c,d){var e=">"===a?"partial":a;return U([e,b,c,d])},Ea={type:"other",description:"filters"},Fa="|",Ga={type:"literal",value:"|",description:'"|"'},Ha=function(a){return["filters"].concat(a)},Ia={type:"other",description:"special"},Ja="~",Ka={type:"literal",value:"~",description:'"~"'},La=function(a){return U(["special",a])},Ma={type:"other",description:"identifier"},Na=function(a){var b=["path"].concat(a);return b.text=a[1].join("."),b},Oa=function(a){var b=["key",a];return b.text=a,b},Pa={type:"other",description:"number"},Qa=function(a){return["literal",a]},Ra={type:"other",description:"float"},Sa=".",Ta={type:"literal",value:".",description:'"."'},Ua=function(a,b){return parseFloat(a+"."+b)},Va={type:"other",description:"unsigned_integer"},Wa=/^[0-9]/,Xa={type:"class",value:"[0-9]",description:"[0-9]"},Ya=function(a){return T(a)},Za={type:"other",description:"signed_integer"},$a="-",_a={type:"literal",value:"-",description:'"-"'},ab=function(a,b){return b*-1},bb={type:"other",description:"integer"},cb={type:"other",description:"path"},db=function(a,b){return b=b[0],a&&b?(b.unshift(a),U([!1,b])):U([!0,b])},eb=function(a){return U(a.length>0?[!0,a[0]]:[!0,[]])},fb={type:"other",description:"key"},gb=/^[a-zA-Z_$]/,hb={type:"class",value:"[a-zA-Z_$]",description:"[a-zA-Z_$]"},ib=/^[0-9a-zA-Z_$\-]/,jb={type:"class",value:"[0-9a-zA-Z_$-]",description:"[0-9a-zA-Z_$-]"},kb=function(a,b){return a+b.join("")},lb={type:"other",description:"array"},mb=function(a){return a.join("")},nb=function(a){return a},ob=function(a,b){return b?b.unshift(a):b=[a],b},pb={type:"other",description:"array_part"},qb=function(a){return a},rb=function(a,b){return b?a.concat(b):a},sb={type:"other",description:"inline"},tb='"',ub={type:"literal",value:'"',description:'"\\""'},vb=function(){return U(["literal",""])},wb=function(a){return U(["literal",a])},xb=function(a){return U(["body"].concat(a))},yb=function(a){return["buffer",a]},zb={type:"other",description:"buffer"},Ab=function(a,b){return U(["format",a,b.join("")])},Bb={type:"any",description:"any character"},Cb=function(a){return a},Db=function(a){return U(["buffer",a.join("")])},Eb={type:"other",description:"literal"},Fb=/^[^"]/,Gb={type:"class",value:'[^"]',description:'[^"]'},Hb=function(a){return a.join("")},Ib='\\"',Jb={type:"literal",value:'\\"',description:'"\\\\\\""'},Kb=function(){return'"'},Lb={type:"other",description:"raw"},Mb="{`",Nb={type:"literal",value:"{`",description:'"{`"'},Ob="`}",Pb={type:"literal",value:"`}",description:'"`}"' +},Qb=function(a){return a},Rb=function(a){return U(["raw",a.join("")])},Sb={type:"other",description:"comment"},Tb="{!",Ub={type:"literal",value:"{!",description:'"{!"'},Vb="!}",Wb={type:"literal",value:"!}",description:'"!}"'},Xb=function(a){return U(["comment",a.join("")])},Yb=/^[#?\^><+%:@\/~%]/,Zb={type:"class",value:"[#?^><+%:@/~%]",description:"[#?^><+%:@/~%]"},$b="{",_b={type:"literal",value:"{",description:'"{"'},ac="}",bc={type:"literal",value:"}",description:'"}"'},cc="[",dc={type:"literal",value:"[",description:'"["'},ec="]",fc={type:"literal",value:"]",description:'"]"'},gc="\n",hc={type:"literal",value:"\n",description:'"\\n"'},ic="\r\n",jc={type:"literal",value:"\r\n",description:'"\\r\\n"'},kc="\r",lc={type:"literal",value:"\r",description:'"\\r"'},mc="\u2028",nc={type:"literal",value:"\u2028",description:'"\\u2028"'},oc="\u2029",pc={type:"literal",value:"\u2029",description:'"\\u2029"'},qc=/^[\t\x0B\f \xA0\uFEFF]/,rc={type:"class",value:"[\\t\\v\\f \\u00A0\\uFEFF]",description:"[\\t\\v\\f \\u00A0\\uFEFF]"},sc=0,tc=0,uc=[{line:1,column:1,seenCR:!1}],vc=0,wc=[],xc=0;if("startRule"in W){if(!(W.startRule in Y))throw new Error("Can't start parsing from rule \""+W.startRule+'".');Z=Y[W.startRule]}if(V=Z(),V!==X&&sc===a.length)return V;throw V!==X&&sc