{ "version": 3, "sources": ["node_modules/handlebars/lib/handlebars/utils.js", "node_modules/handlebars/lib/handlebars/exception.js", "node_modules/handlebars/lib/handlebars/helpers/block-helper-missing.js", "node_modules/handlebars/lib/handlebars/helpers/each.js", "node_modules/handlebars/lib/handlebars/helpers/helper-missing.js", "node_modules/handlebars/lib/handlebars/helpers/if.js", "node_modules/handlebars/lib/handlebars/helpers/log.js", "node_modules/handlebars/lib/handlebars/helpers/lookup.js", "node_modules/handlebars/lib/handlebars/helpers/with.js", "node_modules/handlebars/lib/handlebars/helpers.js", "node_modules/handlebars/lib/handlebars/decorators/inline.js", "node_modules/handlebars/lib/handlebars/decorators.js", "node_modules/handlebars/lib/handlebars/logger.js", "node_modules/handlebars/lib/handlebars/internal/create-new-lookup-object.js", "node_modules/handlebars/lib/handlebars/internal/proto-access.js", "node_modules/handlebars/lib/handlebars/base.js", "node_modules/handlebars/lib/handlebars/safe-string.js", "node_modules/handlebars/lib/handlebars/internal/wrapHelper.js", "node_modules/handlebars/lib/handlebars/runtime.js", "node_modules/handlebars/lib/handlebars/no-conflict.js", "node_modules/handlebars/lib/handlebars.runtime.js", "node_modules/handlebars/lib/handlebars/compiler/ast.js", "node_modules/handlebars/lib/handlebars/compiler/parser.js", "node_modules/handlebars/lib/handlebars/compiler/visitor.js", "node_modules/handlebars/lib/handlebars/compiler/whitespace-control.js", "node_modules/handlebars/lib/handlebars/compiler/helpers.js", "node_modules/handlebars/lib/handlebars/compiler/base.js", "node_modules/handlebars/lib/handlebars/compiler/compiler.js", "node_modules/source-map/lib/base64.js", "node_modules/source-map/lib/base64-vlq.js", "node_modules/source-map/lib/util.js", "node_modules/source-map/lib/array-set.js", "node_modules/source-map/lib/mapping-list.js", "node_modules/source-map/lib/source-map-generator.js", "node_modules/source-map/lib/binary-search.js", "node_modules/source-map/lib/quick-sort.js", "node_modules/source-map/lib/source-map-consumer.js", "node_modules/source-map/lib/source-node.js", "node_modules/source-map/source-map.js", "node_modules/handlebars/lib/handlebars/compiler/code-gen.js", "node_modules/handlebars/lib/handlebars/compiler/javascript-compiler.js", "node_modules/handlebars/lib/handlebars.js", "node_modules/handlebars/lib/handlebars/compiler/printer.js", "node_modules/handlebars/lib/index.js", "src/hb/src/visitor.ts", "src/hb/src/symbols.ts", "src/hb/src/utils.ts", "src/hb/src/handlebars.ts", "src/hb/index.ts"], "sourcesContent": ["const escape = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`',\n '=': '='\n};\n\nconst badChars = /[&<>\"'`=]/g,\n possible = /[&<>\"'`=]/;\n\nfunction escapeChar(chr) {\n return escape[chr];\n}\n\nexport function extend(obj /* , ...source */) {\n for (let i = 1; i < arguments.length; i++) {\n for (let key in arguments[i]) {\n if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {\n obj[key] = arguments[i][key];\n }\n }\n }\n\n return obj;\n}\n\nexport let toString = Object.prototype.toString;\n\n// Sourced from lodash\n// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt\n/* eslint-disable func-style */\nlet isFunction = function(value) {\n return typeof value === 'function';\n};\n// fallback for older versions of Chrome and Safari\n/* istanbul ignore next */\nif (isFunction(/x/)) {\n isFunction = function(value) {\n return (\n typeof value === 'function' &&\n toString.call(value) === '[object Function]'\n );\n };\n}\nexport { isFunction };\n/* eslint-enable func-style */\n\n/* istanbul ignore next */\nexport const isArray =\n Array.isArray ||\n function(value) {\n return value && typeof value === 'object'\n ? toString.call(value) === '[object Array]'\n : false;\n };\n\n// Older IE versions do not directly support indexOf so we must implement our own, sadly.\nexport function indexOf(array, value) {\n for (let i = 0, len = array.length; i < len; i++) {\n if (array[i] === value) {\n return i;\n }\n }\n return -1;\n}\n\nexport function escapeExpression(string) {\n if (typeof string !== 'string') {\n // don't escape SafeStrings, since they're already safe\n if (string && string.toHTML) {\n return string.toHTML();\n } else if (string == null) {\n return '';\n } else if (!string) {\n return string + '';\n }\n\n // Force a string conversion as this will be done by the append regardless and\n // the regex test will do this transparently behind the scenes, causing issues if\n // an object's to string has escaped characters in it.\n string = '' + string;\n }\n\n if (!possible.test(string)) {\n return string;\n }\n return string.replace(badChars, escapeChar);\n}\n\nexport function isEmpty(value) {\n if (!value && value !== 0) {\n return true;\n } else if (isArray(value) && value.length === 0) {\n return true;\n } else {\n return false;\n }\n}\n\nexport function createFrame(object) {\n let frame = extend({}, object);\n frame._parent = object;\n return frame;\n}\n\nexport function blockParams(params, ids) {\n params.path = ids;\n return params;\n}\n\nexport function appendContextPath(contextPath, id) {\n return (contextPath ? contextPath + '.' : '') + id;\n}\n", "const errorProps = [\n 'description',\n 'fileName',\n 'lineNumber',\n 'endLineNumber',\n 'message',\n 'name',\n 'number',\n 'stack'\n];\n\nfunction Exception(message, node) {\n let loc = node && node.loc,\n line,\n endLineNumber,\n column,\n endColumn;\n\n if (loc) {\n line = loc.start.line;\n endLineNumber = loc.end.line;\n column = loc.start.column;\n endColumn = loc.end.column;\n\n message += ' - ' + line + ':' + column;\n }\n\n let tmp = Error.prototype.constructor.call(this, message);\n\n // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.\n for (let idx = 0; idx < errorProps.length; idx++) {\n this[errorProps[idx]] = tmp[errorProps[idx]];\n }\n\n /* istanbul ignore else */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, Exception);\n }\n\n try {\n if (loc) {\n this.lineNumber = line;\n this.endLineNumber = endLineNumber;\n\n // Work around issue under safari where we can't directly set the column value\n /* istanbul ignore next */\n if (Object.defineProperty) {\n Object.defineProperty(this, 'column', {\n value: column,\n enumerable: true\n });\n Object.defineProperty(this, 'endColumn', {\n value: endColumn,\n enumerable: true\n });\n } else {\n this.column = column;\n this.endColumn = endColumn;\n }\n }\n } catch (nop) {\n /* Ignore if the browser is very particular */\n }\n}\n\nException.prototype = new Error();\n\nexport default Exception;\n", "import { appendContextPath, createFrame, isArray } from '../utils';\n\nexport default function(instance) {\n instance.registerHelper('blockHelperMissing', function(context, options) {\n let inverse = options.inverse,\n fn = options.fn;\n\n if (context === true) {\n return fn(this);\n } else if (context === false || context == null) {\n return inverse(this);\n } else if (isArray(context)) {\n if (context.length > 0) {\n if (options.ids) {\n options.ids = [options.name];\n }\n\n return instance.helpers.each(context, options);\n } else {\n return inverse(this);\n }\n } else {\n if (options.data && options.ids) {\n let data = createFrame(options.data);\n data.contextPath = appendContextPath(\n options.data.contextPath,\n options.name\n );\n options = { data: data };\n }\n\n return fn(context, options);\n }\n });\n}\n", "import {\n appendContextPath,\n blockParams,\n createFrame,\n isArray,\n isFunction\n} from '../utils';\nimport Exception from '../exception';\n\nexport default function(instance) {\n instance.registerHelper('each', function(context, options) {\n if (!options) {\n throw new Exception('Must pass iterator to #each');\n }\n\n let fn = options.fn,\n inverse = options.inverse,\n i = 0,\n ret = '',\n data,\n contextPath;\n\n if (options.data && options.ids) {\n contextPath =\n appendContextPath(options.data.contextPath, options.ids[0]) + '.';\n }\n\n if (isFunction(context)) {\n context = context.call(this);\n }\n\n if (options.data) {\n data = createFrame(options.data);\n }\n\n function execIteration(field, index, last) {\n if (data) {\n data.key = field;\n data.index = index;\n data.first = index === 0;\n data.last = !!last;\n\n if (contextPath) {\n data.contextPath = contextPath + field;\n }\n }\n\n ret =\n ret +\n fn(context[field], {\n data: data,\n blockParams: blockParams(\n [context[field], field],\n [contextPath + field, null]\n )\n });\n }\n\n if (context && typeof context === 'object') {\n if (isArray(context)) {\n for (let j = context.length; i < j; i++) {\n if (i in context) {\n execIteration(i, i, i === context.length - 1);\n }\n }\n } else if (global.Symbol && context[global.Symbol.iterator]) {\n const newContext = [];\n const iterator = context[global.Symbol.iterator]();\n for (let it = iterator.next(); !it.done; it = iterator.next()) {\n newContext.push(it.value);\n }\n context = newContext;\n for (let j = context.length; i < j; i++) {\n execIteration(i, i, i === context.length - 1);\n }\n } else {\n let priorKey;\n\n Object.keys(context).forEach(key => {\n // We're running the iterations one step out of sync so we can detect\n // the last iteration without have to scan the object twice and create\n // an itermediate keys array.\n if (priorKey !== undefined) {\n execIteration(priorKey, i - 1);\n }\n priorKey = key;\n i++;\n });\n if (priorKey !== undefined) {\n execIteration(priorKey, i - 1, true);\n }\n }\n }\n\n if (i === 0) {\n ret = inverse(this);\n }\n\n return ret;\n });\n}\n", "import Exception from '../exception';\n\nexport default function(instance) {\n instance.registerHelper('helperMissing', function(/* [args, ]options */) {\n if (arguments.length === 1) {\n // A missing field in a {{foo}} construct.\n return undefined;\n } else {\n // Someone is actually trying to call something, blow up.\n throw new Exception(\n 'Missing helper: \"' + arguments[arguments.length - 1].name + '\"'\n );\n }\n });\n}\n", "import { isEmpty, isFunction } from '../utils';\nimport Exception from '../exception';\n\nexport default function(instance) {\n instance.registerHelper('if', function(conditional, options) {\n if (arguments.length != 2) {\n throw new Exception('#if requires exactly one argument');\n }\n if (isFunction(conditional)) {\n conditional = conditional.call(this);\n }\n\n // Default behavior is to render the positive path if the value is truthy and not empty.\n // The `includeZero` option may be set to treat the condtional as purely not empty based on the\n // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.\n if ((!options.hash.includeZero && !conditional) || isEmpty(conditional)) {\n return options.inverse(this);\n } else {\n return options.fn(this);\n }\n });\n\n instance.registerHelper('unless', function(conditional, options) {\n if (arguments.length != 2) {\n throw new Exception('#unless requires exactly one argument');\n }\n return instance.helpers['if'].call(this, conditional, {\n fn: options.inverse,\n inverse: options.fn,\n hash: options.hash\n });\n });\n}\n", "export default function(instance) {\n instance.registerHelper('log', function(/* message, options */) {\n let args = [undefined],\n options = arguments[arguments.length - 1];\n for (let i = 0; i < arguments.length - 1; i++) {\n args.push(arguments[i]);\n }\n\n let level = 1;\n if (options.hash.level != null) {\n level = options.hash.level;\n } else if (options.data && options.data.level != null) {\n level = options.data.level;\n }\n args[0] = level;\n\n instance.log(...args);\n });\n}\n", "export default function(instance) {\n instance.registerHelper('lookup', function(obj, field, options) {\n if (!obj) {\n // Note for 5.0: Change to \"obj == null\" in 5.0\n return obj;\n }\n return options.lookupProperty(obj, field);\n });\n}\n", "import {\n appendContextPath,\n blockParams,\n createFrame,\n isEmpty,\n isFunction\n} from '../utils';\nimport Exception from '../exception';\n\nexport default function(instance) {\n instance.registerHelper('with', function(context, options) {\n if (arguments.length != 2) {\n throw new Exception('#with requires exactly one argument');\n }\n if (isFunction(context)) {\n context = context.call(this);\n }\n\n let fn = options.fn;\n\n if (!isEmpty(context)) {\n let data = options.data;\n if (options.data && options.ids) {\n data = createFrame(options.data);\n data.contextPath = appendContextPath(\n options.data.contextPath,\n options.ids[0]\n );\n }\n\n return fn(context, {\n data: data,\n blockParams: blockParams([context], [data && data.contextPath])\n });\n } else {\n return options.inverse(this);\n }\n });\n}\n", "import registerBlockHelperMissing from './helpers/block-helper-missing';\nimport registerEach from './helpers/each';\nimport registerHelperMissing from './helpers/helper-missing';\nimport registerIf from './helpers/if';\nimport registerLog from './helpers/log';\nimport registerLookup from './helpers/lookup';\nimport registerWith from './helpers/with';\n\nexport function registerDefaultHelpers(instance) {\n registerBlockHelperMissing(instance);\n registerEach(instance);\n registerHelperMissing(instance);\n registerIf(instance);\n registerLog(instance);\n registerLookup(instance);\n registerWith(instance);\n}\n\nexport function moveHelperToHooks(instance, helperName, keepHelper) {\n if (instance.helpers[helperName]) {\n instance.hooks[helperName] = instance.helpers[helperName];\n if (!keepHelper) {\n delete instance.helpers[helperName];\n }\n }\n}\n", "import { extend } from '../utils';\n\nexport default function(instance) {\n instance.registerDecorator('inline', function(fn, props, container, options) {\n let ret = fn;\n if (!props.partials) {\n props.partials = {};\n ret = function(context, options) {\n // Create a new partials stack frame prior to exec.\n let original = container.partials;\n container.partials = extend({}, original, props.partials);\n let ret = fn(context, options);\n container.partials = original;\n return ret;\n };\n }\n\n props.partials[options.args[0]] = options.fn;\n\n return ret;\n });\n}\n", "import registerInline from './decorators/inline';\n\nexport function registerDefaultDecorators(instance) {\n registerInline(instance);\n}\n", "import { indexOf } from './utils';\n\nlet logger = {\n methodMap: ['debug', 'info', 'warn', 'error'],\n level: 'info',\n\n // Maps a given level value to the `methodMap` indexes above.\n lookupLevel: function(level) {\n if (typeof level === 'string') {\n let levelMap = indexOf(logger.methodMap, level.toLowerCase());\n if (levelMap >= 0) {\n level = levelMap;\n } else {\n level = parseInt(level, 10);\n }\n }\n\n return level;\n },\n\n // Can be overridden in the host environment\n log: function(level, ...message) {\n level = logger.lookupLevel(level);\n\n if (\n typeof console !== 'undefined' &&\n logger.lookupLevel(logger.level) <= level\n ) {\n let method = logger.methodMap[level];\n // eslint-disable-next-line no-console\n if (!console[method]) {\n method = 'log';\n }\n console[method](...message); // eslint-disable-line no-console\n }\n }\n};\n\nexport default logger;\n", "import { extend } from '../utils';\n\n/**\n * Create a new object with \"null\"-prototype to avoid truthy results on prototype properties.\n * The resulting object can be used with \"object[property]\" to check if a property exists\n * @param {...object} sources a varargs parameter of source objects that will be merged\n * @returns {object}\n */\nexport function createNewLookupObject(...sources) {\n return extend(Object.create(null), ...sources);\n}\n", "import { createNewLookupObject } from './create-new-lookup-object';\nimport * as logger from '../logger';\n\nconst loggedProperties = Object.create(null);\n\nexport function createProtoAccessControl(runtimeOptions) {\n let defaultMethodWhiteList = Object.create(null);\n defaultMethodWhiteList['constructor'] = false;\n defaultMethodWhiteList['__defineGetter__'] = false;\n defaultMethodWhiteList['__defineSetter__'] = false;\n defaultMethodWhiteList['__lookupGetter__'] = false;\n\n let defaultPropertyWhiteList = Object.create(null);\n // eslint-disable-next-line no-proto\n defaultPropertyWhiteList['__proto__'] = false;\n\n return {\n properties: {\n whitelist: createNewLookupObject(\n defaultPropertyWhiteList,\n runtimeOptions.allowedProtoProperties\n ),\n defaultValue: runtimeOptions.allowProtoPropertiesByDefault\n },\n methods: {\n whitelist: createNewLookupObject(\n defaultMethodWhiteList,\n runtimeOptions.allowedProtoMethods\n ),\n defaultValue: runtimeOptions.allowProtoMethodsByDefault\n }\n };\n}\n\nexport function resultIsAllowed(result, protoAccessControl, propertyName) {\n if (typeof result === 'function') {\n return checkWhiteList(protoAccessControl.methods, propertyName);\n } else {\n return checkWhiteList(protoAccessControl.properties, propertyName);\n }\n}\n\nfunction checkWhiteList(protoAccessControlForType, propertyName) {\n if (protoAccessControlForType.whitelist[propertyName] !== undefined) {\n return protoAccessControlForType.whitelist[propertyName] === true;\n }\n if (protoAccessControlForType.defaultValue !== undefined) {\n return protoAccessControlForType.defaultValue;\n }\n logUnexpecedPropertyAccessOnce(propertyName);\n return false;\n}\n\nfunction logUnexpecedPropertyAccessOnce(propertyName) {\n if (loggedProperties[propertyName] !== true) {\n loggedProperties[propertyName] = true;\n logger.log(\n 'error',\n `Handlebars: Access has been denied to resolve the property \"${propertyName}\" because it is not an \"own property\" of its parent.\\n` +\n `You can add a runtime option to disable the check or this warning:\\n` +\n `See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`\n );\n }\n}\n\nexport function resetLoggedProperties() {\n Object.keys(loggedProperties).forEach(propertyName => {\n delete loggedProperties[propertyName];\n });\n}\n", "import { createFrame, extend, toString } from './utils';\nimport Exception from './exception';\nimport { registerDefaultHelpers } from './helpers';\nimport { registerDefaultDecorators } from './decorators';\nimport logger from './logger';\nimport { resetLoggedProperties } from './internal/proto-access';\n\nexport const VERSION = '4.7.7';\nexport const COMPILER_REVISION = 8;\nexport const LAST_COMPATIBLE_COMPILER_REVISION = 7;\n\nexport const REVISION_CHANGES = {\n 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it\n 2: '== 1.0.0-rc.3',\n 3: '== 1.0.0-rc.4',\n 4: '== 1.x.x',\n 5: '== 2.0.0-alpha.x',\n 6: '>= 2.0.0-beta.1',\n 7: '>= 4.0.0 <4.3.0',\n 8: '>= 4.3.0'\n};\n\nconst objectType = '[object Object]';\n\nexport function HandlebarsEnvironment(helpers, partials, decorators) {\n this.helpers = helpers || {};\n this.partials = partials || {};\n this.decorators = decorators || {};\n\n registerDefaultHelpers(this);\n registerDefaultDecorators(this);\n}\n\nHandlebarsEnvironment.prototype = {\n constructor: HandlebarsEnvironment,\n\n logger: logger,\n log: logger.log,\n\n registerHelper: function(name, fn) {\n if (toString.call(name) === objectType) {\n if (fn) {\n throw new Exception('Arg not supported with multiple helpers');\n }\n extend(this.helpers, name);\n } else {\n this.helpers[name] = fn;\n }\n },\n unregisterHelper: function(name) {\n delete this.helpers[name];\n },\n\n registerPartial: function(name, partial) {\n if (toString.call(name) === objectType) {\n extend(this.partials, name);\n } else {\n if (typeof partial === 'undefined') {\n throw new Exception(\n `Attempting to register a partial called \"${name}\" as undefined`\n );\n }\n this.partials[name] = partial;\n }\n },\n unregisterPartial: function(name) {\n delete this.partials[name];\n },\n\n registerDecorator: function(name, fn) {\n if (toString.call(name) === objectType) {\n if (fn) {\n throw new Exception('Arg not supported with multiple decorators');\n }\n extend(this.decorators, name);\n } else {\n this.decorators[name] = fn;\n }\n },\n unregisterDecorator: function(name) {\n delete this.decorators[name];\n },\n /**\n * Reset the memory of illegal property accesses that have already been logged.\n * @deprecated should only be used in handlebars test-cases\n */\n resetLoggedPropertyAccesses() {\n resetLoggedProperties();\n }\n};\n\nexport let log = logger.log;\n\nexport { createFrame, logger };\n", "// Build out our basic SafeString type\nfunction SafeString(string) {\n this.string = string;\n}\n\nSafeString.prototype.toString = SafeString.prototype.toHTML = function() {\n return '' + this.string;\n};\n\nexport default SafeString;\n", "export function wrapHelper(helper, transformOptionsFn) {\n if (typeof helper !== 'function') {\n // This should not happen, but apparently it does in https://github.com/wycats/handlebars.js/issues/1639\n // We try to make the wrapper least-invasive by not wrapping it, if the helper is not a function.\n return helper;\n }\n let wrapper = function(/* dynamic arguments */) {\n const options = arguments[arguments.length - 1];\n arguments[arguments.length - 1] = transformOptionsFn(options);\n return helper.apply(this, arguments);\n };\n return wrapper;\n}\n", "import * as Utils from './utils';\nimport Exception from './exception';\nimport {\n COMPILER_REVISION,\n createFrame,\n LAST_COMPATIBLE_COMPILER_REVISION,\n REVISION_CHANGES\n} from './base';\nimport { moveHelperToHooks } from './helpers';\nimport { wrapHelper } from './internal/wrapHelper';\nimport {\n createProtoAccessControl,\n resultIsAllowed\n} from './internal/proto-access';\n\nexport function checkRevision(compilerInfo) {\n const compilerRevision = (compilerInfo && compilerInfo[0]) || 1,\n currentRevision = COMPILER_REVISION;\n\n if (\n compilerRevision >= LAST_COMPATIBLE_COMPILER_REVISION &&\n compilerRevision <= COMPILER_REVISION\n ) {\n return;\n }\n\n if (compilerRevision < LAST_COMPATIBLE_COMPILER_REVISION) {\n const runtimeVersions = REVISION_CHANGES[currentRevision],\n compilerVersions = REVISION_CHANGES[compilerRevision];\n throw new Exception(\n 'Template was precompiled with an older version of Handlebars than the current runtime. ' +\n 'Please update your precompiler to a newer version (' +\n runtimeVersions +\n ') or downgrade your runtime to an older version (' +\n compilerVersions +\n ').'\n );\n } else {\n // Use the embedded version info since the runtime doesn't know about this revision yet\n throw new Exception(\n 'Template was precompiled with a newer version of Handlebars than the current runtime. ' +\n 'Please update your runtime to a newer version (' +\n compilerInfo[1] +\n ').'\n );\n }\n}\n\nexport function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception('No environment passed to template');\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n templateSpec.main.decorator = templateSpec.main_d;\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as pseudo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n // backwards compatibility for precompiled templates with compiler-version 7 (<4.3.0)\n const templateWasPrecompiledWithCompilerV7 =\n templateSpec.compiler && templateSpec.compiler[0] === 7;\n\n function invokePartialWrapper(partial, context, options) {\n if (options.hash) {\n context = Utils.extend({}, context, options.hash);\n if (options.ids) {\n options.ids[0] = true;\n }\n }\n partial = env.VM.resolvePartial.call(this, partial, context, options);\n\n let extendedOptions = Utils.extend({}, options, {\n hooks: this.hooks,\n protoAccessControl: this.protoAccessControl\n });\n\n let result = env.VM.invokePartial.call(\n this,\n partial,\n context,\n extendedOptions\n );\n\n if (result == null && env.compile) {\n options.partials[options.name] = env.compile(\n partial,\n templateSpec.compilerOptions,\n env\n );\n result = options.partials[options.name](context, extendedOptions);\n }\n if (result != null) {\n if (options.indent) {\n let lines = result.split('\\n');\n for (let i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = options.indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\n 'The partial ' +\n options.name +\n ' could not be compiled when running in runtime-only mode'\n );\n }\n }\n\n // Just add water\n let container = {\n strict: function(obj, name, loc) {\n if (!obj || !(name in obj)) {\n throw new Exception('\"' + name + '\" not defined in ' + obj, {\n loc: loc\n });\n }\n return container.lookupProperty(obj, name);\n },\n lookupProperty: function(parent, propertyName) {\n let result = parent[propertyName];\n if (result == null) {\n return result;\n }\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return result;\n }\n\n if (resultIsAllowed(result, container.protoAccessControl, propertyName)) {\n return result;\n }\n return undefined;\n },\n lookup: function(depths, name) {\n const len = depths.length;\n for (let i = 0; i < len; i++) {\n let result = depths[i] && container.lookupProperty(depths[i], name);\n if (result != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n let ret = templateSpec[i];\n ret.decorator = templateSpec[i + '_d'];\n return ret;\n },\n\n programs: [],\n program: function(i, data, declaredBlockParams, blockParams, depths) {\n let programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths || blockParams || declaredBlockParams) {\n programWrapper = wrapProgram(\n this,\n i,\n fn,\n data,\n declaredBlockParams,\n blockParams,\n depths\n );\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = wrapProgram(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(value, depth) {\n while (value && depth--) {\n value = value._parent;\n }\n return value;\n },\n mergeIfNeeded: function(param, common) {\n let obj = param || common;\n\n if (param && common && param !== common) {\n obj = Utils.extend({}, common, param);\n }\n\n return obj;\n },\n // An empty object to use as replacement for null-contexts\n nullContext: Object.seal({}),\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n function ret(context, options = {}) {\n let data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n let depths,\n blockParams = templateSpec.useBlockParams ? [] : undefined;\n if (templateSpec.useDepths) {\n if (options.depths) {\n depths =\n context != options.depths[0]\n ? [context].concat(options.depths)\n : options.depths;\n } else {\n depths = [context];\n }\n }\n\n function main(context /*, options*/) {\n return (\n '' +\n templateSpec.main(\n container,\n context,\n container.helpers,\n container.partials,\n data,\n blockParams,\n depths\n )\n );\n }\n\n main = executeDecorators(\n templateSpec.main,\n main,\n container,\n options.depths || [],\n data,\n blockParams\n );\n return main(context, options);\n }\n\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n let mergedHelpers = Utils.extend({}, env.helpers, options.helpers);\n wrapHelpersToPassLookupProperty(mergedHelpers, container);\n container.helpers = mergedHelpers;\n\n if (templateSpec.usePartial) {\n // Use mergeIfNeeded here to prevent compiling global partials multiple times\n container.partials = container.mergeIfNeeded(\n options.partials,\n env.partials\n );\n }\n if (templateSpec.usePartial || templateSpec.useDecorators) {\n container.decorators = Utils.extend(\n {},\n env.decorators,\n options.decorators\n );\n }\n\n container.hooks = {};\n container.protoAccessControl = createProtoAccessControl(options);\n\n let keepHelperInHelpers =\n options.allowCallsToHelperMissing ||\n templateWasPrecompiledWithCompilerV7;\n moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers);\n moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers);\n } else {\n container.protoAccessControl = options.protoAccessControl; // internal option\n container.helpers = options.helpers;\n container.partials = options.partials;\n container.decorators = options.decorators;\n container.hooks = options.hooks;\n }\n };\n\n ret._child = function(i, data, blockParams, depths) {\n if (templateSpec.useBlockParams && !blockParams) {\n throw new Exception('must pass block params');\n }\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return wrapProgram(\n container,\n i,\n templateSpec[i],\n data,\n 0,\n blockParams,\n depths\n );\n };\n return ret;\n}\n\nexport function wrapProgram(\n container,\n i,\n fn,\n data,\n declaredBlockParams,\n blockParams,\n depths\n) {\n function prog(context, options = {}) {\n let currentDepths = depths;\n if (\n depths &&\n context != depths[0] &&\n !(context === container.nullContext && depths[0] === null)\n ) {\n currentDepths = [context].concat(depths);\n }\n\n return fn(\n container,\n context,\n container.helpers,\n container.partials,\n options.data || data,\n blockParams && [options.blockParams].concat(blockParams),\n currentDepths\n );\n }\n\n prog = executeDecorators(fn, prog, container, depths, data, blockParams);\n\n prog.program = i;\n prog.depth = depths ? depths.length : 0;\n prog.blockParams = declaredBlockParams || 0;\n return prog;\n}\n\n/**\n * This is currently part of the official API, therefore implementation details should not be changed.\n */\nexport function resolvePartial(partial, context, options) {\n if (!partial) {\n if (options.name === '@partial-block') {\n partial = options.data['partial-block'];\n } else {\n partial = options.partials[options.name];\n }\n } else if (!partial.call && !options.name) {\n // This is a dynamic partial that returned a string\n options.name = partial;\n partial = options.partials[partial];\n }\n return partial;\n}\n\nexport function invokePartial(partial, context, options) {\n // Use the current closure context to save the partial-block if this partial\n const currentPartialBlock = options.data && options.data['partial-block'];\n options.partial = true;\n if (options.ids) {\n options.data.contextPath = options.ids[0] || options.data.contextPath;\n }\n\n let partialBlock;\n if (options.fn && options.fn !== noop) {\n options.data = createFrame(options.data);\n // Wrapper function to get access to currentPartialBlock from the closure\n let fn = options.fn;\n partialBlock = options.data['partial-block'] = function partialBlockWrapper(\n context,\n options = {}\n ) {\n // Restore the partial-block from the closure for the execution of the block\n // i.e. the part inside the block of the partial call.\n options.data = createFrame(options.data);\n options.data['partial-block'] = currentPartialBlock;\n return fn(context, options);\n };\n if (fn.partials) {\n options.partials = Utils.extend({}, options.partials, fn.partials);\n }\n }\n\n if (partial === undefined && partialBlock) {\n partial = partialBlock;\n }\n\n if (partial === undefined) {\n throw new Exception('The partial ' + options.name + ' could not be found');\n } else if (partial instanceof Function) {\n return partial(context, options);\n }\n}\n\nexport function noop() {\n return '';\n}\n\nfunction initData(context, data) {\n if (!data || !('root' in data)) {\n data = data ? createFrame(data) : {};\n data.root = context;\n }\n return data;\n}\n\nfunction executeDecorators(fn, prog, container, depths, data, blockParams) {\n if (fn.decorator) {\n let props = {};\n prog = fn.decorator(\n prog,\n props,\n container,\n depths && depths[0],\n data,\n blockParams,\n depths\n );\n Utils.extend(prog, props);\n }\n return prog;\n}\n\nfunction wrapHelpersToPassLookupProperty(mergedHelpers, container) {\n Object.keys(mergedHelpers).forEach(helperName => {\n let helper = mergedHelpers[helperName];\n mergedHelpers[helperName] = passLookupPropertyOption(helper, container);\n });\n}\n\nfunction passLookupPropertyOption(helper, container) {\n const lookupProperty = container.lookupProperty;\n return wrapHelper(helper, options => {\n return Utils.extend({ lookupProperty }, options);\n });\n}\n", "export default function(Handlebars) {\n /* istanbul ignore next */\n let root = typeof global !== 'undefined' ? global : window,\n $Handlebars = root.Handlebars;\n /* istanbul ignore next */\n Handlebars.noConflict = function() {\n if (root.Handlebars === Handlebars) {\n root.Handlebars = $Handlebars;\n }\n return Handlebars;\n };\n}\n", "import * as base from './handlebars/base';\n\n// Each of these augment the Handlebars object. No need to setup here.\n// (This is done to easily share code between commonjs and browse envs)\nimport SafeString from './handlebars/safe-string';\nimport Exception from './handlebars/exception';\nimport * as Utils from './handlebars/utils';\nimport * as runtime from './handlebars/runtime';\n\nimport noConflict from './handlebars/no-conflict';\n\n// For compatibility and usage outside of module systems, make the Handlebars object a namespace\nfunction create() {\n let hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = SafeString;\n hb.Exception = Exception;\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function(spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}\n\nlet inst = create();\ninst.create = create;\n\nnoConflict(inst);\n\ninst['default'] = inst;\n\nexport default inst;\n", "let AST = {\n // Public API used to evaluate derived attributes regarding AST nodes\n helpers: {\n // a mustache is definitely a helper if:\n // * it is an eligible helper, and\n // * it has at least one parameter or hash segment\n helperExpression: function(node) {\n return (\n node.type === 'SubExpression' ||\n ((node.type === 'MustacheStatement' ||\n node.type === 'BlockStatement') &&\n !!((node.params && node.params.length) || node.hash))\n );\n },\n\n scopedId: function(path) {\n return /^\\.|this\\b/.test(path.original);\n },\n\n // an ID is simple if it only has one part, and that part is not\n // `..` or `this`.\n simpleId: function(path) {\n return (\n path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth\n );\n }\n }\n};\n\n// Must be exported as an object rather than the root of the module as the jison lexer\n// must modify the object to operate properly.\nexport default AST;\n", "// File ignored in coverage tests via setting in .istanbul.yml\n/* Jison generated parser */\nvar handlebars = (function(){\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"root\":3,\"program\":4,\"EOF\":5,\"program_repetition0\":6,\"statement\":7,\"mustache\":8,\"block\":9,\"rawBlock\":10,\"partial\":11,\"partialBlock\":12,\"content\":13,\"COMMENT\":14,\"CONTENT\":15,\"openRawBlock\":16,\"rawBlock_repetition0\":17,\"END_RAW_BLOCK\":18,\"OPEN_RAW_BLOCK\":19,\"helperName\":20,\"openRawBlock_repetition0\":21,\"openRawBlock_option0\":22,\"CLOSE_RAW_BLOCK\":23,\"openBlock\":24,\"block_option0\":25,\"closeBlock\":26,\"openInverse\":27,\"block_option1\":28,\"OPEN_BLOCK\":29,\"openBlock_repetition0\":30,\"openBlock_option0\":31,\"openBlock_option1\":32,\"CLOSE\":33,\"OPEN_INVERSE\":34,\"openInverse_repetition0\":35,\"openInverse_option0\":36,\"openInverse_option1\":37,\"openInverseChain\":38,\"OPEN_INVERSE_CHAIN\":39,\"openInverseChain_repetition0\":40,\"openInverseChain_option0\":41,\"openInverseChain_option1\":42,\"inverseAndProgram\":43,\"INVERSE\":44,\"inverseChain\":45,\"inverseChain_option0\":46,\"OPEN_ENDBLOCK\":47,\"OPEN\":48,\"mustache_repetition0\":49,\"mustache_option0\":50,\"OPEN_UNESCAPED\":51,\"mustache_repetition1\":52,\"mustache_option1\":53,\"CLOSE_UNESCAPED\":54,\"OPEN_PARTIAL\":55,\"partialName\":56,\"partial_repetition0\":57,\"partial_option0\":58,\"openPartialBlock\":59,\"OPEN_PARTIAL_BLOCK\":60,\"openPartialBlock_repetition0\":61,\"openPartialBlock_option0\":62,\"param\":63,\"sexpr\":64,\"OPEN_SEXPR\":65,\"sexpr_repetition0\":66,\"sexpr_option0\":67,\"CLOSE_SEXPR\":68,\"hash\":69,\"hash_repetition_plus0\":70,\"hashSegment\":71,\"ID\":72,\"EQUALS\":73,\"blockParams\":74,\"OPEN_BLOCK_PARAMS\":75,\"blockParams_repetition_plus0\":76,\"CLOSE_BLOCK_PARAMS\":77,\"path\":78,\"dataName\":79,\"STRING\":80,\"NUMBER\":81,\"BOOLEAN\":82,\"UNDEFINED\":83,\"NULL\":84,\"DATA\":85,\"pathSegments\":86,\"SEP\":87,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",5:\"EOF\",14:\"COMMENT\",15:\"CONTENT\",18:\"END_RAW_BLOCK\",19:\"OPEN_RAW_BLOCK\",23:\"CLOSE_RAW_BLOCK\",29:\"OPEN_BLOCK\",33:\"CLOSE\",34:\"OPEN_INVERSE\",39:\"OPEN_INVERSE_CHAIN\",44:\"INVERSE\",47:\"OPEN_ENDBLOCK\",48:\"OPEN\",51:\"OPEN_UNESCAPED\",54:\"CLOSE_UNESCAPED\",55:\"OPEN_PARTIAL\",60:\"OPEN_PARTIAL_BLOCK\",65:\"OPEN_SEXPR\",68:\"CLOSE_SEXPR\",72:\"ID\",73:\"EQUALS\",75:\"OPEN_BLOCK_PARAMS\",77:\"CLOSE_BLOCK_PARAMS\",80:\"STRING\",81:\"NUMBER\",82:\"BOOLEAN\",83:\"UNDEFINED\",84:\"NULL\",85:\"DATA\",87:\"SEP\"},\nproductions_: [0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],\nperformAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$\n) {\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1: return $$[$0-1]; \nbreak;\ncase 2:this.$ = yy.prepareProgram($$[$0]);\nbreak;\ncase 3:this.$ = $$[$0];\nbreak;\ncase 4:this.$ = $$[$0];\nbreak;\ncase 5:this.$ = $$[$0];\nbreak;\ncase 6:this.$ = $$[$0];\nbreak;\ncase 7:this.$ = $$[$0];\nbreak;\ncase 8:this.$ = $$[$0];\nbreak;\ncase 9:\n this.$ = {\n type: 'CommentStatement',\n value: yy.stripComment($$[$0]),\n strip: yy.stripFlags($$[$0], $$[$0]),\n loc: yy.locInfo(this._$)\n };\n \nbreak;\ncase 10:\n this.$ = {\n type: 'ContentStatement',\n original: $$[$0],\n value: $$[$0],\n loc: yy.locInfo(this._$)\n };\n \nbreak;\ncase 11:this.$ = yy.prepareRawBlock($$[$0-2], $$[$0-1], $$[$0], this._$);\nbreak;\ncase 12:this.$ = { path: $$[$0-3], params: $$[$0-2], hash: $$[$0-1] };\nbreak;\ncase 13:this.$ = yy.prepareBlock($$[$0-3], $$[$0-2], $$[$0-1], $$[$0], false, this._$);\nbreak;\ncase 14:this.$ = yy.prepareBlock($$[$0-3], $$[$0-2], $$[$0-1], $$[$0], true, this._$);\nbreak;\ncase 15:this.$ = { open: $$[$0-5], path: $$[$0-4], params: $$[$0-3], hash: $$[$0-2], blockParams: $$[$0-1], strip: yy.stripFlags($$[$0-5], $$[$0]) };\nbreak;\ncase 16:this.$ = { path: $$[$0-4], params: $$[$0-3], hash: $$[$0-2], blockParams: $$[$0-1], strip: yy.stripFlags($$[$0-5], $$[$0]) };\nbreak;\ncase 17:this.$ = { path: $$[$0-4], params: $$[$0-3], hash: $$[$0-2], blockParams: $$[$0-1], strip: yy.stripFlags($$[$0-5], $$[$0]) };\nbreak;\ncase 18:this.$ = { strip: yy.stripFlags($$[$0-1], $$[$0-1]), program: $$[$0] };\nbreak;\ncase 19:\n var inverse = yy.prepareBlock($$[$0-2], $$[$0-1], $$[$0], $$[$0], false, this._$),\n program = yy.prepareProgram([inverse], $$[$0-1].loc);\n program.chained = true;\n\n this.$ = { strip: $$[$0-2].strip, program: program, chain: true };\n \nbreak;\ncase 20:this.$ = $$[$0];\nbreak;\ncase 21:this.$ = {path: $$[$0-1], strip: yy.stripFlags($$[$0-2], $$[$0])};\nbreak;\ncase 22:this.$ = yy.prepareMustache($$[$0-3], $$[$0-2], $$[$0-1], $$[$0-4], yy.stripFlags($$[$0-4], $$[$0]), this._$);\nbreak;\ncase 23:this.$ = yy.prepareMustache($$[$0-3], $$[$0-2], $$[$0-1], $$[$0-4], yy.stripFlags($$[$0-4], $$[$0]), this._$);\nbreak;\ncase 24:\n this.$ = {\n type: 'PartialStatement',\n name: $$[$0-3],\n params: $$[$0-2],\n hash: $$[$0-1],\n indent: '',\n strip: yy.stripFlags($$[$0-4], $$[$0]),\n loc: yy.locInfo(this._$)\n };\n \nbreak;\ncase 25:this.$ = yy.preparePartialBlock($$[$0-2], $$[$0-1], $$[$0], this._$);\nbreak;\ncase 26:this.$ = { path: $$[$0-3], params: $$[$0-2], hash: $$[$0-1], strip: yy.stripFlags($$[$0-4], $$[$0]) };\nbreak;\ncase 27:this.$ = $$[$0];\nbreak;\ncase 28:this.$ = $$[$0];\nbreak;\ncase 29:\n this.$ = {\n type: 'SubExpression',\n path: $$[$0-3],\n params: $$[$0-2],\n hash: $$[$0-1],\n loc: yy.locInfo(this._$)\n };\n \nbreak;\ncase 30:this.$ = {type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$)};\nbreak;\ncase 31:this.$ = {type: 'HashPair', key: yy.id($$[$0-2]), value: $$[$0], loc: yy.locInfo(this._$)};\nbreak;\ncase 32:this.$ = yy.id($$[$0-1]);\nbreak;\ncase 33:this.$ = $$[$0];\nbreak;\ncase 34:this.$ = $$[$0];\nbreak;\ncase 35:this.$ = {type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$)};\nbreak;\ncase 36:this.$ = {type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$)};\nbreak;\ncase 37:this.$ = {type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$)};\nbreak;\ncase 38:this.$ = {type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$)};\nbreak;\ncase 39:this.$ = {type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$)};\nbreak;\ncase 40:this.$ = $$[$0];\nbreak;\ncase 41:this.$ = $$[$0];\nbreak;\ncase 42:this.$ = yy.preparePath(true, $$[$0], this._$);\nbreak;\ncase 43:this.$ = yy.preparePath(false, $$[$0], this._$);\nbreak;\ncase 44: $$[$0-2].push({part: yy.id($$[$0]), original: $$[$0], separator: $$[$0-1]}); this.$ = $$[$0-2]; \nbreak;\ncase 45:this.$ = [{part: yy.id($$[$0]), original: $$[$0]}];\nbreak;\ncase 46:this.$ = [];\nbreak;\ncase 47:$$[$0-1].push($$[$0]);\nbreak;\ncase 48:this.$ = [];\nbreak;\ncase 49:$$[$0-1].push($$[$0]);\nbreak;\ncase 50:this.$ = [];\nbreak;\ncase 51:$$[$0-1].push($$[$0]);\nbreak;\ncase 58:this.$ = [];\nbreak;\ncase 59:$$[$0-1].push($$[$0]);\nbreak;\ncase 64:this.$ = [];\nbreak;\ncase 65:$$[$0-1].push($$[$0]);\nbreak;\ncase 70:this.$ = [];\nbreak;\ncase 71:$$[$0-1].push($$[$0]);\nbreak;\ncase 78:this.$ = [];\nbreak;\ncase 79:$$[$0-1].push($$[$0]);\nbreak;\ncase 82:this.$ = [];\nbreak;\ncase 83:$$[$0-1].push($$[$0]);\nbreak;\ncase 86:this.$ = [];\nbreak;\ncase 87:$$[$0-1].push($$[$0]);\nbreak;\ncase 90:this.$ = [];\nbreak;\ncase 91:$$[$0-1].push($$[$0]);\nbreak;\ncase 94:this.$ = [];\nbreak;\ncase 95:$$[$0-1].push($$[$0]);\nbreak;\ncase 98:this.$ = [$$[$0]];\nbreak;\ncase 99:$$[$0-1].push($$[$0]);\nbreak;\ncase 100:this.$ = [$$[$0]];\nbreak;\ncase 101:$$[$0-1].push($$[$0]);\nbreak;\n}\n},\ntable: [{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],\ndefaultActions: {4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},\nparseError: function parseError (str, hash) {\n throw new Error(str);\n},\nparse: function parse(input) {\n var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = \"\", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n this.lexer.setInput(input);\n this.lexer.yy = this.yy;\n this.yy.lexer = this.lexer;\n this.yy.parser = this;\n if (typeof this.lexer.yylloc == \"undefined\")\n this.lexer.yylloc = {};\n var yyloc = this.lexer.yylloc;\n lstack.push(yyloc);\n var ranges = this.lexer.options && this.lexer.options.ranges;\n if (typeof this.yy.parseError === \"function\")\n this.parseError = this.yy.parseError;\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = self.lexer.lex() || 1;\n if (typeof token !== \"number\") {\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == \"undefined\") {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === \"undefined\" || !action.length || !action[0]) {\n var errStr = \"\";\n if (!recovering) {\n expected = [];\n for (p in table[state])\n if (this.terminals_[p] && p > 2) {\n expected.push(\"'\" + this.terminals_[p] + \"'\");\n }\n if (this.lexer.showPosition) {\n errStr = \"Parse error on line \" + (yylineno + 1) + \":\\n\" + this.lexer.showPosition() + \"\\nExpecting \" + expected.join(\", \") + \", got '\" + (this.terminals_[symbol] || symbol) + \"'\";\n } else {\n errStr = \"Parse error on line \" + (yylineno + 1) + \": Unexpected \" + (symbol == 1?\"end of input\":\"'\" + (this.terminals_[symbol] || symbol) + \"'\");\n }\n this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});\n }\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error(\"Parse Error: multiple actions possible at state: \" + state + \", token: \" + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(this.lexer.yytext);\n lstack.push(this.lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = this.lexer.yyleng;\n yytext = this.lexer.yytext;\n yylineno = this.lexer.yylineno;\n yyloc = this.lexer.yylloc;\n if (recovering > 0)\n recovering--;\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};\n if (ranges) {\n yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];\n }\n r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);\n if (typeof r !== \"undefined\") {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}\n};\n/* Jison generated lexer */\nvar lexer = (function(){\nvar lexer = ({EOF:1,\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\nsetInput:function (input) {\n this._input = input;\n this._more = this._less = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};\n if (this.options.ranges) this.yylloc.range = [0,0];\n this.offset = 0;\n return this;\n },\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) this.yylloc.range[1]++;\n\n this._input = this._input.slice(1);\n return ch;\n },\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length-len-1);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length-1);\n this.matched = this.matched.substr(0, this.matched.length-1);\n\n if (lines.length-1) this.yylineno -= lines.length-1;\n var r = this.yylloc.range;\n\n this.yylloc = {first_line: this.yylloc.first_line,\n last_line: this.yylineno+1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length:\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n return this;\n },\nmore:function () {\n this._more = true;\n return this;\n },\nless:function (n) {\n this.unput(this.match.slice(n));\n },\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\\n/g, \"\");\n },\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c+\"^\";\n },\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) this.done = true;\n\n var token,\n match,\n tempMatch,\n index,\n col,\n lines;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i=0;i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (!this.options.flex) break;\n }\n }\n if (match) {\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) this.yylineno += lines.length;\n this.yylloc = {first_line: this.yylloc.last_line,\n last_line: this.yylineno+1,\n first_column: this.yylloc.last_column,\n last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\\r?\\n?/)[0].length : this.yylloc.last_column + match[0].length};\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);\n if (this.done && this._input) this.done = false;\n if (token) return token;\n else return;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\\n'+this.showPosition(),\n {text: \"\", token: null, line: this.yylineno});\n }\n },\nlex:function lex () {\n var r = this.next();\n if (typeof r !== 'undefined') {\n return r;\n } else {\n return this.lex();\n }\n },\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\npopState:function popState () {\n return this.conditionStack.pop();\n },\n_currentRules:function _currentRules () {\n return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;\n },\ntopState:function () {\n return this.conditionStack[this.conditionStack.length-2];\n },\npushState:function begin (condition) {\n this.begin(condition);\n }});\nlexer.options = {};\nlexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START\n) {\n\n\nfunction strip(start, end) {\n return yy_.yytext = yy_.yytext.substring(start, yy_.yyleng - end + start);\n}\n\n\nvar YYSTATE=YY_START\nswitch($avoiding_name_collisions) {\ncase 0:\n if(yy_.yytext.slice(-2) === \"\\\\\\\\\") {\n strip(0,1);\n this.begin(\"mu\");\n } else if(yy_.yytext.slice(-1) === \"\\\\\") {\n strip(0,1);\n this.begin(\"emu\");\n } else {\n this.begin(\"mu\");\n }\n if(yy_.yytext) return 15;\n \nbreak;\ncase 1:return 15;\nbreak;\ncase 2:\n this.popState();\n return 15;\n \nbreak;\ncase 3:this.begin('raw'); return 15;\nbreak;\ncase 4:\n this.popState();\n // Should be using `this.topState()` below, but it currently\n // returns the second top instead of the first top. Opened an\n // issue about it at https://github.com/zaach/jison/issues/291\n if (this.conditionStack[this.conditionStack.length-1] === 'raw') {\n return 15;\n } else {\n strip(5, 9);\n return 'END_RAW_BLOCK';\n }\n \nbreak;\ncase 5: return 15; \nbreak;\ncase 6:\n this.popState();\n return 14;\n\nbreak;\ncase 7:return 65;\nbreak;\ncase 8:return 68;\nbreak;\ncase 9: return 19; \nbreak;\ncase 10:\n this.popState();\n this.begin('raw');\n return 23;\n \nbreak;\ncase 11:return 55;\nbreak;\ncase 12:return 60;\nbreak;\ncase 13:return 29;\nbreak;\ncase 14:return 47;\nbreak;\ncase 15:this.popState(); return 44;\nbreak;\ncase 16:this.popState(); return 44;\nbreak;\ncase 17:return 34;\nbreak;\ncase 18:return 39;\nbreak;\ncase 19:return 51;\nbreak;\ncase 20:return 48;\nbreak;\ncase 21:\n this.unput(yy_.yytext);\n this.popState();\n this.begin('com');\n\nbreak;\ncase 22:\n this.popState();\n return 14;\n\nbreak;\ncase 23:return 48;\nbreak;\ncase 24:return 73;\nbreak;\ncase 25:return 72;\nbreak;\ncase 26:return 72;\nbreak;\ncase 27:return 87;\nbreak;\ncase 28:// ignore whitespace\nbreak;\ncase 29:this.popState(); return 54;\nbreak;\ncase 30:this.popState(); return 33;\nbreak;\ncase 31:yy_.yytext = strip(1,2).replace(/\\\\\"/g,'\"'); return 80;\nbreak;\ncase 32:yy_.yytext = strip(1,2).replace(/\\\\'/g,\"'\"); return 80;\nbreak;\ncase 33:return 85;\nbreak;\ncase 34:return 82;\nbreak;\ncase 35:return 82;\nbreak;\ncase 36:return 83;\nbreak;\ncase 37:return 84;\nbreak;\ncase 38:return 81;\nbreak;\ncase 39:return 75;\nbreak;\ncase 40:return 77;\nbreak;\ncase 41:return 72;\nbreak;\ncase 42:yy_.yytext = yy_.yytext.replace(/\\\\([\\\\\\]])/g,'$1'); return 72;\nbreak;\ncase 43:return 'INVALID';\nbreak;\ncase 44:return 5;\nbreak;\n}\n};\nlexer.rules = [/^(?:[^\\x00]*?(?=(\\{\\{)))/,/^(?:[^\\x00]+)/,/^(?:[^\\x00]{2,}?(?=(\\{\\{|\\\\\\{\\{|\\\\\\\\\\{\\{|$)))/,/^(?:\\{\\{\\{\\{(?=[^\\/]))/,/^(?:\\{\\{\\{\\{\\/[^\\s!\"#%-,\\.\\/;->@\\[-\\^`\\{-~]+(?=[=}\\s\\/.])\\}\\}\\}\\})/,/^(?:[^\\x00]+?(?=(\\{\\{\\{\\{)))/,/^(?:[\\s\\S]*?--(~)?\\}\\})/,/^(?:\\()/,/^(?:\\))/,/^(?:\\{\\{\\{\\{)/,/^(?:\\}\\}\\}\\})/,/^(?:\\{\\{(~)?>)/,/^(?:\\{\\{(~)?#>)/,/^(?:\\{\\{(~)?#\\*?)/,/^(?:\\{\\{(~)?\\/)/,/^(?:\\{\\{(~)?\\^\\s*(~)?\\}\\})/,/^(?:\\{\\{(~)?\\s*else\\s*(~)?\\}\\})/,/^(?:\\{\\{(~)?\\^)/,/^(?:\\{\\{(~)?\\s*else\\b)/,/^(?:\\{\\{(~)?\\{)/,/^(?:\\{\\{(~)?&)/,/^(?:\\{\\{(~)?!--)/,/^(?:\\{\\{(~)?![\\s\\S]*?\\}\\})/,/^(?:\\{\\{(~)?\\*?)/,/^(?:=)/,/^(?:\\.\\.)/,/^(?:\\.(?=([=~}\\s\\/.)|])))/,/^(?:[\\/.])/,/^(?:\\s+)/,/^(?:\\}(~)?\\}\\})/,/^(?:(~)?\\}\\})/,/^(?:\"(\\\\[\"]|[^\"])*\")/,/^(?:'(\\\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\\s)])))/,/^(?:false(?=([~}\\s)])))/,/^(?:undefined(?=([~}\\s)])))/,/^(?:null(?=([~}\\s)])))/,/^(?:-?[0-9]+(?:\\.[0-9]+)?(?=([~}\\s)])))/,/^(?:as\\s+\\|)/,/^(?:\\|)/,/^(?:([^\\s!\"#%-,\\.\\/;->@\\[-\\^`\\{-~]+(?=([=~}\\s\\/.)|]))))/,/^(?:\\[(\\\\\\]|[^\\]])*\\])/,/^(?:.)/,/^(?:$)/];\nlexer.conditions = {\"mu\":{\"rules\":[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],\"inclusive\":false},\"emu\":{\"rules\":[2],\"inclusive\":false},\"com\":{\"rules\":[6],\"inclusive\":false},\"raw\":{\"rules\":[3,4,5],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,1,44],\"inclusive\":true}};\nreturn lexer;})()\nparser.lexer = lexer;\nfunction Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();export default handlebars;\n", "import Exception from '../exception';\n\nfunction Visitor() {\n this.parents = [];\n}\n\nVisitor.prototype = {\n constructor: Visitor,\n mutating: false,\n\n // Visits a given value. If mutating, will replace the value if necessary.\n acceptKey: function(node, name) {\n let value = this.accept(node[name]);\n if (this.mutating) {\n // Hacky sanity check: This may have a few false positives for type for the helper\n // methods but will generally do the right thing without a lot of overhead.\n if (value && !Visitor.prototype[value.type]) {\n throw new Exception(\n 'Unexpected node type \"' +\n value.type +\n '\" found when accepting ' +\n name +\n ' on ' +\n node.type\n );\n }\n node[name] = value;\n }\n },\n\n // Performs an accept operation with added sanity check to ensure\n // required keys are not removed.\n acceptRequired: function(node, name) {\n this.acceptKey(node, name);\n\n if (!node[name]) {\n throw new Exception(node.type + ' requires ' + name);\n }\n },\n\n // Traverses a given array. If mutating, empty respnses will be removed\n // for child elements.\n acceptArray: function(array) {\n for (let i = 0, l = array.length; i < l; i++) {\n this.acceptKey(array, i);\n\n if (!array[i]) {\n array.splice(i, 1);\n i--;\n l--;\n }\n }\n },\n\n accept: function(object) {\n if (!object) {\n return;\n }\n\n /* istanbul ignore next: Sanity code */\n if (!this[object.type]) {\n throw new Exception('Unknown type: ' + object.type, object);\n }\n\n if (this.current) {\n this.parents.unshift(this.current);\n }\n this.current = object;\n\n let ret = this[object.type](object);\n\n this.current = this.parents.shift();\n\n if (!this.mutating || ret) {\n return ret;\n } else if (ret !== false) {\n return object;\n }\n },\n\n Program: function(program) {\n this.acceptArray(program.body);\n },\n\n MustacheStatement: visitSubExpression,\n Decorator: visitSubExpression,\n\n BlockStatement: visitBlock,\n DecoratorBlock: visitBlock,\n\n PartialStatement: visitPartial,\n PartialBlockStatement: function(partial) {\n visitPartial.call(this, partial);\n\n this.acceptKey(partial, 'program');\n },\n\n ContentStatement: function(/* content */) {},\n CommentStatement: function(/* comment */) {},\n\n SubExpression: visitSubExpression,\n\n PathExpression: function(/* path */) {},\n\n StringLiteral: function(/* string */) {},\n NumberLiteral: function(/* number */) {},\n BooleanLiteral: function(/* bool */) {},\n UndefinedLiteral: function(/* literal */) {},\n NullLiteral: function(/* literal */) {},\n\n Hash: function(hash) {\n this.acceptArray(hash.pairs);\n },\n HashPair: function(pair) {\n this.acceptRequired(pair, 'value');\n }\n};\n\nfunction visitSubExpression(mustache) {\n this.acceptRequired(mustache, 'path');\n this.acceptArray(mustache.params);\n this.acceptKey(mustache, 'hash');\n}\nfunction visitBlock(block) {\n visitSubExpression.call(this, block);\n\n this.acceptKey(block, 'program');\n this.acceptKey(block, 'inverse');\n}\nfunction visitPartial(partial) {\n this.acceptRequired(partial, 'name');\n this.acceptArray(partial.params);\n this.acceptKey(partial, 'hash');\n}\n\nexport default Visitor;\n", "import Visitor from './visitor';\n\nfunction WhitespaceControl(options = {}) {\n this.options = options;\n}\nWhitespaceControl.prototype = new Visitor();\n\nWhitespaceControl.prototype.Program = function(program) {\n const doStandalone = !this.options.ignoreStandalone;\n\n let isRoot = !this.isRootSeen;\n this.isRootSeen = true;\n\n let body = program.body;\n for (let i = 0, l = body.length; i < l; i++) {\n let current = body[i],\n strip = this.accept(current);\n\n if (!strip) {\n continue;\n }\n\n let _isPrevWhitespace = isPrevWhitespace(body, i, isRoot),\n _isNextWhitespace = isNextWhitespace(body, i, isRoot),\n openStandalone = strip.openStandalone && _isPrevWhitespace,\n closeStandalone = strip.closeStandalone && _isNextWhitespace,\n inlineStandalone =\n strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;\n\n if (strip.close) {\n omitRight(body, i, true);\n }\n if (strip.open) {\n omitLeft(body, i, true);\n }\n\n if (doStandalone && inlineStandalone) {\n omitRight(body, i);\n\n if (omitLeft(body, i)) {\n // If we are on a standalone node, save the indent info for partials\n if (current.type === 'PartialStatement') {\n // Pull out the whitespace from the final line\n current.indent = /([ \\t]+$)/.exec(body[i - 1].original)[1];\n }\n }\n }\n if (doStandalone && openStandalone) {\n omitRight((current.program || current.inverse).body);\n\n // Strip out the previous content node if it's whitespace only\n omitLeft(body, i);\n }\n if (doStandalone && closeStandalone) {\n // Always strip the next node\n omitRight(body, i);\n\n omitLeft((current.inverse || current.program).body);\n }\n }\n\n return program;\n};\n\nWhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function(\n block\n) {\n this.accept(block.program);\n this.accept(block.inverse);\n\n // Find the inverse program that is involed with whitespace stripping.\n let program = block.program || block.inverse,\n inverse = block.program && block.inverse,\n firstInverse = inverse,\n lastInverse = inverse;\n\n if (inverse && inverse.chained) {\n firstInverse = inverse.body[0].program;\n\n // Walk the inverse chain to find the last inverse that is actually in the chain.\n while (lastInverse.chained) {\n lastInverse = lastInverse.body[lastInverse.body.length - 1].program;\n }\n }\n\n let strip = {\n open: block.openStrip.open,\n close: block.closeStrip.close,\n\n // Determine the standalone candiacy. Basically flag our content as being possibly standalone\n // so our parent can determine if we actually are standalone\n openStandalone: isNextWhitespace(program.body),\n closeStandalone: isPrevWhitespace((firstInverse || program).body)\n };\n\n if (block.openStrip.close) {\n omitRight(program.body, null, true);\n }\n\n if (inverse) {\n let inverseStrip = block.inverseStrip;\n\n if (inverseStrip.open) {\n omitLeft(program.body, null, true);\n }\n\n if (inverseStrip.close) {\n omitRight(firstInverse.body, null, true);\n }\n if (block.closeStrip.open) {\n omitLeft(lastInverse.body, null, true);\n }\n\n // Find standalone else statments\n if (\n !this.options.ignoreStandalone &&\n isPrevWhitespace(program.body) &&\n isNextWhitespace(firstInverse.body)\n ) {\n omitLeft(program.body);\n omitRight(firstInverse.body);\n }\n } else if (block.closeStrip.open) {\n omitLeft(program.body, null, true);\n }\n\n return strip;\n};\n\nWhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function(\n mustache\n) {\n return mustache.strip;\n};\n\nWhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function(\n node\n) {\n /* istanbul ignore next */\n let strip = node.strip || {};\n return {\n inlineStandalone: true,\n open: strip.open,\n close: strip.close\n };\n};\n\nfunction isPrevWhitespace(body, i, isRoot) {\n if (i === undefined) {\n i = body.length;\n }\n\n // Nodes that end with newlines are considered whitespace (but are special\n // cased for strip operations)\n let prev = body[i - 1],\n sibling = body[i - 2];\n if (!prev) {\n return isRoot;\n }\n\n if (prev.type === 'ContentStatement') {\n return (sibling || !isRoot ? /\\r?\\n\\s*?$/ : /(^|\\r?\\n)\\s*?$/).test(\n prev.original\n );\n }\n}\nfunction isNextWhitespace(body, i, isRoot) {\n if (i === undefined) {\n i = -1;\n }\n\n let next = body[i + 1],\n sibling = body[i + 2];\n if (!next) {\n return isRoot;\n }\n\n if (next.type === 'ContentStatement') {\n return (sibling || !isRoot ? /^\\s*?\\r?\\n/ : /^\\s*?(\\r?\\n|$)/).test(\n next.original\n );\n }\n}\n\n// Marks the node to the right of the position as omitted.\n// I.e. {{foo}}' ' will mark the ' ' node as omitted.\n//\n// If i is undefined, then the first child will be marked as such.\n//\n// If mulitple is truthy then all whitespace will be stripped out until non-whitespace\n// content is met.\nfunction omitRight(body, i, multiple) {\n let current = body[i == null ? 0 : i + 1];\n if (\n !current ||\n current.type !== 'ContentStatement' ||\n (!multiple && current.rightStripped)\n ) {\n return;\n }\n\n let original = current.value;\n current.value = current.value.replace(\n multiple ? /^\\s+/ : /^[ \\t]*\\r?\\n?/,\n ''\n );\n current.rightStripped = current.value !== original;\n}\n\n// Marks the node to the left of the position as omitted.\n// I.e. ' '{{foo}} will mark the ' ' node as omitted.\n//\n// If i is undefined then the last child will be marked as such.\n//\n// If mulitple is truthy then all whitespace will be stripped out until non-whitespace\n// content is met.\nfunction omitLeft(body, i, multiple) {\n let current = body[i == null ? body.length - 1 : i - 1];\n if (\n !current ||\n current.type !== 'ContentStatement' ||\n (!multiple && current.leftStripped)\n ) {\n return;\n }\n\n // We omit the last node if it's whitespace only and not preceded by a non-content node.\n let original = current.value;\n current.value = current.value.replace(multiple ? /\\s+$/ : /[ \\t]+$/, '');\n current.leftStripped = current.value !== original;\n return current.leftStripped;\n}\n\nexport default WhitespaceControl;\n", "import Exception from '../exception';\n\nfunction validateClose(open, close) {\n close = close.path ? close.path.original : close;\n\n if (open.path.original !== close) {\n let errorNode = { loc: open.path.loc };\n\n throw new Exception(\n open.path.original + \" doesn't match \" + close,\n errorNode\n );\n }\n}\n\nexport function SourceLocation(source, locInfo) {\n this.source = source;\n this.start = {\n line: locInfo.first_line,\n column: locInfo.first_column\n };\n this.end = {\n line: locInfo.last_line,\n column: locInfo.last_column\n };\n}\n\nexport function id(token) {\n if (/^\\[.*\\]$/.test(token)) {\n return token.substring(1, token.length - 1);\n } else {\n return token;\n }\n}\n\nexport function stripFlags(open, close) {\n return {\n open: open.charAt(2) === '~',\n close: close.charAt(close.length - 3) === '~'\n };\n}\n\nexport function stripComment(comment) {\n return comment.replace(/^\\{\\{~?!-?-?/, '').replace(/-?-?~?\\}\\}$/, '');\n}\n\nexport function preparePath(data, parts, loc) {\n loc = this.locInfo(loc);\n\n let original = data ? '@' : '',\n dig = [],\n depth = 0;\n\n for (let i = 0, l = parts.length; i < l; i++) {\n let part = parts[i].part,\n // If we have [] syntax then we do not treat path references as operators,\n // i.e. foo.[this] resolves to approximately context.foo['this']\n isLiteral = parts[i].original !== part;\n original += (parts[i].separator || '') + part;\n\n if (!isLiteral && (part === '..' || part === '.' || part === 'this')) {\n if (dig.length > 0) {\n throw new Exception('Invalid path: ' + original, { loc });\n } else if (part === '..') {\n depth++;\n }\n } else {\n dig.push(part);\n }\n }\n\n return {\n type: 'PathExpression',\n data,\n depth,\n parts: dig,\n original,\n loc\n };\n}\n\nexport function prepareMustache(path, params, hash, open, strip, locInfo) {\n // Must use charAt to support IE pre-10\n let escapeFlag = open.charAt(3) || open.charAt(2),\n escaped = escapeFlag !== '{' && escapeFlag !== '&';\n\n let decorator = /\\*/.test(open);\n return {\n type: decorator ? 'Decorator' : 'MustacheStatement',\n path,\n params,\n hash,\n escaped,\n strip,\n loc: this.locInfo(locInfo)\n };\n}\n\nexport function prepareRawBlock(openRawBlock, contents, close, locInfo) {\n validateClose(openRawBlock, close);\n\n locInfo = this.locInfo(locInfo);\n let program = {\n type: 'Program',\n body: contents,\n strip: {},\n loc: locInfo\n };\n\n return {\n type: 'BlockStatement',\n path: openRawBlock.path,\n params: openRawBlock.params,\n hash: openRawBlock.hash,\n program,\n openStrip: {},\n inverseStrip: {},\n closeStrip: {},\n loc: locInfo\n };\n}\n\nexport function prepareBlock(\n openBlock,\n program,\n inverseAndProgram,\n close,\n inverted,\n locInfo\n) {\n if (close && close.path) {\n validateClose(openBlock, close);\n }\n\n let decorator = /\\*/.test(openBlock.open);\n\n program.blockParams = openBlock.blockParams;\n\n let inverse, inverseStrip;\n\n if (inverseAndProgram) {\n if (decorator) {\n throw new Exception(\n 'Unexpected inverse block on decorator',\n inverseAndProgram\n );\n }\n\n if (inverseAndProgram.chain) {\n inverseAndProgram.program.body[0].closeStrip = close.strip;\n }\n\n inverseStrip = inverseAndProgram.strip;\n inverse = inverseAndProgram.program;\n }\n\n if (inverted) {\n inverted = inverse;\n inverse = program;\n program = inverted;\n }\n\n return {\n type: decorator ? 'DecoratorBlock' : 'BlockStatement',\n path: openBlock.path,\n params: openBlock.params,\n hash: openBlock.hash,\n program,\n inverse,\n openStrip: openBlock.strip,\n inverseStrip,\n closeStrip: close && close.strip,\n loc: this.locInfo(locInfo)\n };\n}\n\nexport function prepareProgram(statements, loc) {\n if (!loc && statements.length) {\n const firstLoc = statements[0].loc,\n lastLoc = statements[statements.length - 1].loc;\n\n /* istanbul ignore else */\n if (firstLoc && lastLoc) {\n loc = {\n source: firstLoc.source,\n start: {\n line: firstLoc.start.line,\n column: firstLoc.start.column\n },\n end: {\n line: lastLoc.end.line,\n column: lastLoc.end.column\n }\n };\n }\n }\n\n return {\n type: 'Program',\n body: statements,\n strip: {},\n loc: loc\n };\n}\n\nexport function preparePartialBlock(open, program, close, locInfo) {\n validateClose(open, close);\n\n return {\n type: 'PartialBlockStatement',\n name: open.path,\n params: open.params,\n hash: open.hash,\n program,\n openStrip: open.strip,\n closeStrip: close && close.strip,\n loc: this.locInfo(locInfo)\n };\n}\n", "import parser from './parser';\nimport WhitespaceControl from './whitespace-control';\nimport * as Helpers from './helpers';\nimport { extend } from '../utils';\n\nexport { parser };\n\nlet yy = {};\nextend(yy, Helpers);\n\nexport function parseWithoutProcessing(input, options) {\n // Just return if an already-compiled AST was passed in.\n if (input.type === 'Program') {\n return input;\n }\n\n parser.yy = yy;\n\n // Altering the shared object here, but this is ok as parser is a sync operation\n yy.locInfo = function(locInfo) {\n return new yy.SourceLocation(options && options.srcName, locInfo);\n };\n\n let ast = parser.parse(input);\n\n return ast;\n}\n\nexport function parse(input, options) {\n let ast = parseWithoutProcessing(input, options);\n let strip = new WhitespaceControl(options);\n\n return strip.accept(ast);\n}\n", "/* eslint-disable new-cap */\n\nimport Exception from '../exception';\nimport { isArray, indexOf, extend } from '../utils';\nimport AST from './ast';\n\nconst slice = [].slice;\n\nexport function Compiler() {}\n\n// the foundHelper register will disambiguate helper lookup from finding a\n// function in a context. This is necessary for mustache compatibility, which\n// requires that context functions in blocks are evaluated by blockHelperMissing,\n// and then proceed as if the resulting value was provided to blockHelperMissing.\n\nCompiler.prototype = {\n compiler: Compiler,\n\n equals: function(other) {\n let len = this.opcodes.length;\n if (other.opcodes.length !== len) {\n return false;\n }\n\n for (let i = 0; i < len; i++) {\n let opcode = this.opcodes[i],\n otherOpcode = other.opcodes[i];\n if (\n opcode.opcode !== otherOpcode.opcode ||\n !argEquals(opcode.args, otherOpcode.args)\n ) {\n return false;\n }\n }\n\n // We know that length is the same between the two arrays because they are directly tied\n // to the opcode behavior above.\n len = this.children.length;\n for (let i = 0; i < len; i++) {\n if (!this.children[i].equals(other.children[i])) {\n return false;\n }\n }\n\n return true;\n },\n\n guid: 0,\n\n compile: function(program, options) {\n this.sourceNode = [];\n this.opcodes = [];\n this.children = [];\n this.options = options;\n this.stringParams = options.stringParams;\n this.trackIds = options.trackIds;\n\n options.blockParams = options.blockParams || [];\n\n options.knownHelpers = extend(\n Object.create(null),\n {\n helperMissing: true,\n blockHelperMissing: true,\n each: true,\n if: true,\n unless: true,\n with: true,\n log: true,\n lookup: true\n },\n options.knownHelpers\n );\n\n return this.accept(program);\n },\n\n compileProgram: function(program) {\n let childCompiler = new this.compiler(), // eslint-disable-line new-cap\n result = childCompiler.compile(program, this.options),\n guid = this.guid++;\n\n this.usePartial = this.usePartial || result.usePartial;\n\n this.children[guid] = result;\n this.useDepths = this.useDepths || result.useDepths;\n\n return guid;\n },\n\n accept: function(node) {\n /* istanbul ignore next: Sanity code */\n if (!this[node.type]) {\n throw new Exception('Unknown type: ' + node.type, node);\n }\n\n this.sourceNode.unshift(node);\n let ret = this[node.type](node);\n this.sourceNode.shift();\n return ret;\n },\n\n Program: function(program) {\n this.options.blockParams.unshift(program.blockParams);\n\n let body = program.body,\n bodyLength = body.length;\n for (let i = 0; i < bodyLength; i++) {\n this.accept(body[i]);\n }\n\n this.options.blockParams.shift();\n\n this.isSimple = bodyLength === 1;\n this.blockParams = program.blockParams ? program.blockParams.length : 0;\n\n return this;\n },\n\n BlockStatement: function(block) {\n transformLiteralToPath(block);\n\n let program = block.program,\n inverse = block.inverse;\n\n program = program && this.compileProgram(program);\n inverse = inverse && this.compileProgram(inverse);\n\n let type = this.classifySexpr(block);\n\n if (type === 'helper') {\n this.helperSexpr(block, program, inverse);\n } else if (type === 'simple') {\n this.simpleSexpr(block);\n\n // now that the simple mustache is resolved, we need to\n // evaluate it by executing `blockHelperMissing`\n this.opcode('pushProgram', program);\n this.opcode('pushProgram', inverse);\n this.opcode('emptyHash');\n this.opcode('blockValue', block.path.original);\n } else {\n this.ambiguousSexpr(block, program, inverse);\n\n // now that the simple mustache is resolved, we need to\n // evaluate it by executing `blockHelperMissing`\n this.opcode('pushProgram', program);\n this.opcode('pushProgram', inverse);\n this.opcode('emptyHash');\n this.opcode('ambiguousBlockValue');\n }\n\n this.opcode('append');\n },\n\n DecoratorBlock(decorator) {\n let program = decorator.program && this.compileProgram(decorator.program);\n let params = this.setupFullMustacheParams(decorator, program, undefined),\n path = decorator.path;\n\n this.useDecorators = true;\n this.opcode('registerDecorator', params.length, path.original);\n },\n\n PartialStatement: function(partial) {\n this.usePartial = true;\n\n let program = partial.program;\n if (program) {\n program = this.compileProgram(partial.program);\n }\n\n let params = partial.params;\n if (params.length > 1) {\n throw new Exception(\n 'Unsupported number of partial arguments: ' + params.length,\n partial\n );\n } else if (!params.length) {\n if (this.options.explicitPartialContext) {\n this.opcode('pushLiteral', 'undefined');\n } else {\n params.push({ type: 'PathExpression', parts: [], depth: 0 });\n }\n }\n\n let partialName = partial.name.original,\n isDynamic = partial.name.type === 'SubExpression';\n if (isDynamic) {\n this.accept(partial.name);\n }\n\n this.setupFullMustacheParams(partial, program, undefined, true);\n\n let indent = partial.indent || '';\n if (this.options.preventIndent && indent) {\n this.opcode('appendContent', indent);\n indent = '';\n }\n\n this.opcode('invokePartial', isDynamic, partialName, indent);\n this.opcode('append');\n },\n PartialBlockStatement: function(partialBlock) {\n this.PartialStatement(partialBlock);\n },\n\n MustacheStatement: function(mustache) {\n this.SubExpression(mustache);\n\n if (mustache.escaped && !this.options.noEscape) {\n this.opcode('appendEscaped');\n } else {\n this.opcode('append');\n }\n },\n Decorator(decorator) {\n this.DecoratorBlock(decorator);\n },\n\n ContentStatement: function(content) {\n if (content.value) {\n this.opcode('appendContent', content.value);\n }\n },\n\n CommentStatement: function() {},\n\n SubExpression: function(sexpr) {\n transformLiteralToPath(sexpr);\n let type = this.classifySexpr(sexpr);\n\n if (type === 'simple') {\n this.simpleSexpr(sexpr);\n } else if (type === 'helper') {\n this.helperSexpr(sexpr);\n } else {\n this.ambiguousSexpr(sexpr);\n }\n },\n ambiguousSexpr: function(sexpr, program, inverse) {\n let path = sexpr.path,\n name = path.parts[0],\n isBlock = program != null || inverse != null;\n\n this.opcode('getContext', path.depth);\n\n this.opcode('pushProgram', program);\n this.opcode('pushProgram', inverse);\n\n path.strict = true;\n this.accept(path);\n\n this.opcode('invokeAmbiguous', name, isBlock);\n },\n\n simpleSexpr: function(sexpr) {\n let path = sexpr.path;\n path.strict = true;\n this.accept(path);\n this.opcode('resolvePossibleLambda');\n },\n\n helperSexpr: function(sexpr, program, inverse) {\n let params = this.setupFullMustacheParams(sexpr, program, inverse),\n path = sexpr.path,\n name = path.parts[0];\n\n if (this.options.knownHelpers[name]) {\n this.opcode('invokeKnownHelper', params.length, name);\n } else if (this.options.knownHelpersOnly) {\n throw new Exception(\n 'You specified knownHelpersOnly, but used the unknown helper ' + name,\n sexpr\n );\n } else {\n path.strict = true;\n path.falsy = true;\n\n this.accept(path);\n this.opcode(\n 'invokeHelper',\n params.length,\n path.original,\n AST.helpers.simpleId(path)\n );\n }\n },\n\n PathExpression: function(path) {\n this.addDepth(path.depth);\n this.opcode('getContext', path.depth);\n\n let name = path.parts[0],\n scoped = AST.helpers.scopedId(path),\n blockParamId = !path.depth && !scoped && this.blockParamIndex(name);\n\n if (blockParamId) {\n this.opcode('lookupBlockParam', blockParamId, path.parts);\n } else if (!name) {\n // Context reference, i.e. `{{foo .}}` or `{{foo ..}}`\n this.opcode('pushContext');\n } else if (path.data) {\n this.options.data = true;\n this.opcode('lookupData', path.depth, path.parts, path.strict);\n } else {\n this.opcode(\n 'lookupOnContext',\n path.parts,\n path.falsy,\n path.strict,\n scoped\n );\n }\n },\n\n StringLiteral: function(string) {\n this.opcode('pushString', string.value);\n },\n\n NumberLiteral: function(number) {\n this.opcode('pushLiteral', number.value);\n },\n\n BooleanLiteral: function(bool) {\n this.opcode('pushLiteral', bool.value);\n },\n\n UndefinedLiteral: function() {\n this.opcode('pushLiteral', 'undefined');\n },\n\n NullLiteral: function() {\n this.opcode('pushLiteral', 'null');\n },\n\n Hash: function(hash) {\n let pairs = hash.pairs,\n i = 0,\n l = pairs.length;\n\n this.opcode('pushHash');\n\n for (; i < l; i++) {\n this.pushParam(pairs[i].value);\n }\n while (i--) {\n this.opcode('assignToHash', pairs[i].key);\n }\n this.opcode('popHash');\n },\n\n // HELPERS\n opcode: function(name) {\n this.opcodes.push({\n opcode: name,\n args: slice.call(arguments, 1),\n loc: this.sourceNode[0].loc\n });\n },\n\n addDepth: function(depth) {\n if (!depth) {\n return;\n }\n\n this.useDepths = true;\n },\n\n classifySexpr: function(sexpr) {\n let isSimple = AST.helpers.simpleId(sexpr.path);\n\n let isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);\n\n // a mustache is an eligible helper if:\n // * its id is simple (a single part, not `this` or `..`)\n let isHelper = !isBlockParam && AST.helpers.helperExpression(sexpr);\n\n // if a mustache is an eligible helper but not a definite\n // helper, it is ambiguous, and will be resolved in a later\n // pass or at runtime.\n let isEligible = !isBlockParam && (isHelper || isSimple);\n\n // if ambiguous, we can possibly resolve the ambiguity now\n // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.\n if (isEligible && !isHelper) {\n let name = sexpr.path.parts[0],\n options = this.options;\n if (options.knownHelpers[name]) {\n isHelper = true;\n } else if (options.knownHelpersOnly) {\n isEligible = false;\n }\n }\n\n if (isHelper) {\n return 'helper';\n } else if (isEligible) {\n return 'ambiguous';\n } else {\n return 'simple';\n }\n },\n\n pushParams: function(params) {\n for (let i = 0, l = params.length; i < l; i++) {\n this.pushParam(params[i]);\n }\n },\n\n pushParam: function(val) {\n let value = val.value != null ? val.value : val.original || '';\n\n if (this.stringParams) {\n if (value.replace) {\n value = value.replace(/^(\\.?\\.\\/)*/g, '').replace(/\\//g, '.');\n }\n\n if (val.depth) {\n this.addDepth(val.depth);\n }\n this.opcode('getContext', val.depth || 0);\n this.opcode('pushStringParam', value, val.type);\n\n if (val.type === 'SubExpression') {\n // SubExpressions get evaluated and passed in\n // in string params mode.\n this.accept(val);\n }\n } else {\n if (this.trackIds) {\n let blockParamIndex;\n if (val.parts && !AST.helpers.scopedId(val) && !val.depth) {\n blockParamIndex = this.blockParamIndex(val.parts[0]);\n }\n if (blockParamIndex) {\n let blockParamChild = val.parts.slice(1).join('.');\n this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild);\n } else {\n value = val.original || value;\n if (value.replace) {\n value = value\n .replace(/^this(?:\\.|$)/, '')\n .replace(/^\\.\\//, '')\n .replace(/^\\.$/, '');\n }\n\n this.opcode('pushId', val.type, value);\n }\n }\n this.accept(val);\n }\n },\n\n setupFullMustacheParams: function(sexpr, program, inverse, omitEmpty) {\n let params = sexpr.params;\n this.pushParams(params);\n\n this.opcode('pushProgram', program);\n this.opcode('pushProgram', inverse);\n\n if (sexpr.hash) {\n this.accept(sexpr.hash);\n } else {\n this.opcode('emptyHash', omitEmpty);\n }\n\n return params;\n },\n\n blockParamIndex: function(name) {\n for (\n let depth = 0, len = this.options.blockParams.length;\n depth < len;\n depth++\n ) {\n let blockParams = this.options.blockParams[depth],\n param = blockParams && indexOf(blockParams, name);\n if (blockParams && param >= 0) {\n return [depth, param];\n }\n }\n }\n};\n\nexport function precompile(input, options, env) {\n if (\n input == null ||\n (typeof input !== 'string' && input.type !== 'Program')\n ) {\n throw new Exception(\n 'You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' +\n input\n );\n }\n\n options = options || {};\n if (!('data' in options)) {\n options.data = true;\n }\n if (options.compat) {\n options.useDepths = true;\n }\n\n let ast = env.parse(input, options),\n environment = new env.Compiler().compile(ast, options);\n return new env.JavaScriptCompiler().compile(environment, options);\n}\n\nexport function compile(input, options = {}, env) {\n if (\n input == null ||\n (typeof input !== 'string' && input.type !== 'Program')\n ) {\n throw new Exception(\n 'You must pass a string or Handlebars AST to Handlebars.compile. You passed ' +\n input\n );\n }\n\n options = extend({}, options);\n if (!('data' in options)) {\n options.data = true;\n }\n if (options.compat) {\n options.useDepths = true;\n }\n\n let compiled;\n\n function compileInput() {\n let ast = env.parse(input, options),\n environment = new env.Compiler().compile(ast, options),\n templateSpec = new env.JavaScriptCompiler().compile(\n environment,\n options,\n undefined,\n true\n );\n return env.template(templateSpec);\n }\n\n // Template is only compiled on first use and cached after that point.\n function ret(context, execOptions) {\n if (!compiled) {\n compiled = compileInput();\n }\n return compiled.call(this, context, execOptions);\n }\n ret._setup = function(setupOptions) {\n if (!compiled) {\n compiled = compileInput();\n }\n return compiled._setup(setupOptions);\n };\n ret._child = function(i, data, blockParams, depths) {\n if (!compiled) {\n compiled = compileInput();\n }\n return compiled._child(i, data, blockParams, depths);\n };\n return ret;\n}\n\nfunction argEquals(a, b) {\n if (a === b) {\n return true;\n }\n\n if (isArray(a) && isArray(b) && a.length === b.length) {\n for (let i = 0; i < a.length; i++) {\n if (!argEquals(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n}\n\nfunction transformLiteralToPath(sexpr) {\n if (!sexpr.path.parts) {\n let literal = sexpr.path;\n // Casting to string here to make false and 0 literal values play nicely with the rest\n // of the system.\n sexpr.path = {\n type: 'PathExpression',\n data: false,\n depth: 0,\n parts: [literal.original + ''],\n original: literal.original + '',\n loc: literal.loc\n };\n }\n}\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '