axiom 0.44.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +6 -6
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +5 -5
- package/dist/chunk-3Q36GUCI.js +23 -0
- package/dist/chunk-3Q36GUCI.js.map +1 -0
- package/dist/{chunk-MCKVQ2IB.js → chunk-JSEK2D3F.js} +5 -19
- package/dist/chunk-JSEK2D3F.js.map +1 -0
- package/dist/{chunk-HW6E4M7S.js → chunk-N3RHEQMQ.js} +2 -2
- package/dist/{chunk-HW6E4M7S.js.map → chunk-N3RHEQMQ.js.map} +1 -1
- package/dist/{chunk-U3JDCQ3Y.js → chunk-QAIGRB75.js} +7 -7
- package/dist/{chunk-7NTVK3F4.js → chunk-R4CARCOX.js} +2 -2
- package/dist/{chunk-56V2A6IW.js → chunk-RSHQRY3F.js} +3 -3
- package/dist/{chunk-AAYRMTT6.js → chunk-SGAIMXRV.js} +24 -9
- package/dist/chunk-SGAIMXRV.js.map +1 -0
- package/dist/evals/online.cjs +31 -8
- package/dist/evals/online.cjs.map +1 -1
- package/dist/evals/online.d.cts +9 -4
- package/dist/evals/online.d.ts +9 -4
- package/dist/evals/online.js +3 -2
- package/dist/evals/online.js.map +1 -1
- package/dist/evals/scorers.cjs +13 -16
- package/dist/evals/scorers.cjs.map +1 -1
- package/dist/evals/scorers.js +2 -1
- package/dist/evals/scorers.js.map +1 -1
- package/dist/evals.cjs +22 -23
- package/dist/evals.cjs.map +1 -1
- package/dist/evals.js +8 -8
- package/dist/evals.js.map +1 -1
- package/dist/index.cjs +36 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/{run-vitest-4OEEDEHV.js → run-vitest-SYYO32TD.js} +5 -5
- package/package.json +1 -1
- package/dist/chunk-AAYRMTT6.js.map +0 -1
- package/dist/chunk-MCKVQ2IB.js.map +0 -1
- /package/dist/{chunk-U3JDCQ3Y.js.map → chunk-QAIGRB75.js.map} +0 -0
- /package/dist/{chunk-7NTVK3F4.js.map → chunk-R4CARCOX.js.map} +0 -0
- /package/dist/{chunk-56V2A6IW.js.map → chunk-RSHQRY3F.js.map} +0 -0
- /package/dist/{run-vitest-4OEEDEHV.js.map → run-vitest-SYYO32TD.js.map} +0 -0
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.5.0_jiti@2.6.1_postcss@8.5.6_tsx@4.20.4_typescript@5.9.2/node_modules/tsup/assets/cjs_shims.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/utils.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/exception.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers/block-helper-missing.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers/each.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers/helper-missing.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers/if.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers/log.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers/lookup.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers/with.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/decorators/inline.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/decorators.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/logger.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/internal/create-new-lookup-object.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/internal/proto-access.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/base.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/safe-string.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/internal/wrapHelper.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/runtime.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/no-conflict.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars.runtime.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/ast.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/parser.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/visitor.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/whitespace-control.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/helpers.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/base.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/compiler.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/binary-search.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/source-map.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/code-gen.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/javascript-compiler.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/printer.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/index.js","../src/prompt/parsers/handlebars.ts","../src/index.ts","../src/otel/initAxiomAI.ts","../package.json","../src/otel/utils/redaction.ts","../src/otel/withSpanBaggageKey.ts","../src/otel/vercel.ts","../src/otel/AxiomWrappedLanguageModelV1.ts","../src/otel/middleware.ts","../src/otel/semconv/attributes.ts","../src/otel/semconv/eval_proposal.ts","../src/otel/completionUtils.ts","../src/otel/utils/contentSanitizer.ts","../src/util/promptUtils.ts","../src/otel/utils/wrapperUtils.ts","../src/schema.ts","../src/otel/startActiveSpan.ts","../src/otel/utils/normalized.ts","../src/otel/streaming/aggregators.ts","../src/util/currentUnixTime.ts","../src/otel/AxiomWrappedLanguageModelV2.ts","../src/otel/AxiomWrappedLanguageModelV3.ts","../src/otel/withSpan.ts","../src/util/name-validation-runtime.ts","../src/online-evals/onlineEval.ts","../src/online-evals/executor.ts","../src/evals/deprecated.ts","../src/evals/scorer.factory.ts","../src/otel/wrapTool.ts","../src/util/typedEntries.ts","../src/app-scope.ts","../src/evals/context/global-flags.ts","../src/evals/context/storage.ts","../src/evals/context/manager.ts","../src/validate-flags.ts","../src/cli/utils/format-zod-errors.ts","../src/util/dot-path.ts","../src/util/zod-internals.ts","../src/util/deep-partial-schema.ts","../src/otel/utils/to-otel-attribute.ts","../src/otel/index.ts","../src/template.ts","../src/prompt/index.ts"],"sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL(`file:${__filename}`).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","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 (typeof Symbol === 'function' && context[Symbol.iterator]) {\n const newContext = [];\n const iterator = context[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 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.8';\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","/* global globalThis */\nexport default function(Handlebars) {\n /* istanbul ignore next */\n // https://mathiasbynens.be/notes/globalthis\n (function() {\n if (typeof globalThis === 'object') return;\n Object.prototype.__defineGetter__('__magic__', function() {\n return this;\n });\n __magic__.globalThis = __magic__; // eslint-disable-line no-undef\n delete Object.prototype.__magic__;\n })();\n\n const $Handlebars = globalThis.Handlebars;\n\n /* istanbul ignore next */\n Handlebars.noConflict = function() {\n if (globalThis.Handlebars === Handlebars) {\n globalThis.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 '<dir>/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 === null) {\n return 1; // aStr2 !== null\n }\n\n if (aStr2 === null) {\n return -1; // aStr1 !== null\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n/**\n * Strip any JSON XSSI avoidance prefix from the string (as documented\n * in the source maps specification), and then parse the string as\n * JSON.\n */\nfunction parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}\nexports.parseSourceMapInput = parseSourceMapInput;\n\n/**\n * Compute the URL of a source given the the source root, the source's\n * URL, and the source map's URL.\n */\nfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n sourceURL = sourceURL || '';\n\n if (sourceRoot) {\n // This follows what Chrome does.\n if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n sourceRoot += '/';\n }\n // The spec says:\n // Line 4: An optional source root, useful for relocating source\n // files on a server or removing repeated values in the\n // “sources” entry. This value is prepended to the individual\n // entries in the “source” field.\n sourceURL = sourceRoot + sourceURL;\n }\n\n // Historically, SourceMapConsumer did not take the sourceMapURL as\n // a parameter. This mode is still somewhat supported, which is why\n // this code block is conditional. However, it's preferable to pass\n // the source map URL to SourceMapConsumer, so that this function\n // can implement the source URL resolution algorithm as outlined in\n // the spec. This block is basically the equivalent of:\n // new URL(sourceURL, sourceMapURL).toString()\n // ... except it avoids using URL, which wasn't available in the\n // older releases of node still supported by this library.\n //\n // The spec says:\n // If the sources are not absolute URLs after prepending of the\n // “sourceRoot”, the sources are resolved relative to the\n // SourceMap (like resolving script src in a html document).\n if (sourceMapURL) {\n var parsed = urlParse(sourceMapURL);\n if (!parsed) {\n throw new Error(\"sourceMapURL could not be parsed\");\n }\n if (parsed.path) {\n // Strip the last path component, but keep the \"/\".\n var index = parsed.path.lastIndexOf('/');\n if (index >= 0) {\n parsed.path = parsed.path.substring(0, index + 1);\n }\n }\n sourceURL = join(urlGenerate(parsed), sourceURL);\n }\n\n return normalize(sourceURL);\n}\nexports.computeSourceURL = computeSourceURL;\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 util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 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 util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\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 base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var sourceRelative = sourceFile;\n if (sourceRoot !== null) {\n sourceRelative = util.relative(sourceRoot, sourceFile);\n }\n\n if (!generator._sources.has(sourceRelative)) {\n generator._sources.add(sourceRelative);\n }\n\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\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\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\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// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 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\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number is 1-based.\n * - column: Optional. the column number in the original source.\n * The column number is 0-based.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n needle.source = this._findSourceIndex(needle.source);\n if (needle.source < 0) {\n return [];\n }\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The first parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n if (sourceRoot) {\n sourceRoot = util.normalize(sourceRoot);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this._absoluteSources = this._sources.toArray().map(function (s) {\n return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n });\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this._sourceMapURL = aSourceMapURL;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Utility function to find the index of a source. Returns -1 if not\n * found.\n */\nBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n if (this._sources.has(relativeSource)) {\n return this._sources.indexOf(relativeSource);\n }\n\n // Maybe aSource is an absolute URL as returned by |sources|. In\n // this case we can't simply undo the transform.\n var i;\n for (i = 0; i < this._absoluteSources.length; ++i) {\n if (this._absoluteSources[i] == aSource) {\n return i;\n }\n }\n\n return -1;\n};\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @param String aSourceMapURL\n * The URL at which the source map can be found (optional)\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n smc._sourceMapURL = aSourceMapURL;\n smc._absoluteSources = smc._sources.toArray().map(function (s) {\n return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n });\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._absoluteSources.slice();\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n var index = this._findSourceIndex(aSource);\n if (index >= 0) {\n return this.sourcesContent[index];\n }\n\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + relativeSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The first parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based. \n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = null;\n if (mapping.name) {\n name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n }\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\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 SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex] || '';\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex] || '';\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n","/* global define, require */\nimport { isArray } from '../utils';\n\nlet SourceNode;\n\ntry {\n /* istanbul ignore next */\n if (typeof define !== 'function' || !define.amd) {\n // We don't support this in AMD environments. For these environments, we assume that\n // they are running on the browser and thus have no need for the source-map library.\n let SourceMap = require('source-map');\n SourceNode = SourceMap.SourceNode;\n }\n} catch (err) {\n /* NOP */\n}\n\n/* istanbul ignore if: tested but not covered in istanbul due to dist build */\nif (!SourceNode) {\n SourceNode = function(line, column, srcFile, chunks) {\n this.src = '';\n if (chunks) {\n this.add(chunks);\n }\n };\n /* istanbul ignore next */\n SourceNode.prototype = {\n add: function(chunks) {\n if (isArray(chunks)) {\n chunks = chunks.join('');\n }\n this.src += chunks;\n },\n prepend: function(chunks) {\n if (isArray(chunks)) {\n chunks = chunks.join('');\n }\n this.src = chunks + this.src;\n },\n toStringWithSourceMap: function() {\n return { code: this.toString() };\n },\n toString: function() {\n return this.src;\n }\n };\n}\n\nfunction castChunk(chunk, codeGen, loc) {\n if (isArray(chunk)) {\n let ret = [];\n\n for (let i = 0, len = chunk.length; i < len; i++) {\n ret.push(codeGen.wrap(chunk[i], loc));\n }\n return ret;\n } else if (typeof chunk === 'boolean' || typeof chunk === 'number') {\n // Handle primitives that the SourceNode will throw up on\n return chunk + '';\n }\n return chunk;\n}\n\nfunction CodeGen(srcFile) {\n this.srcFile = srcFile;\n this.source = [];\n}\n\nCodeGen.prototype = {\n isEmpty() {\n return !this.source.length;\n },\n prepend: function(source, loc) {\n this.source.unshift(this.wrap(source, loc));\n },\n push: function(source, loc) {\n this.source.push(this.wrap(source, loc));\n },\n\n merge: function() {\n let source = this.empty();\n this.each(function(line) {\n source.add([' ', line, '\\n']);\n });\n return source;\n },\n\n each: function(iter) {\n for (let i = 0, len = this.source.length; i < len; i++) {\n iter(this.source[i]);\n }\n },\n\n empty: function() {\n let loc = this.currentLocation || { start: {} };\n return new SourceNode(loc.start.line, loc.start.column, this.srcFile);\n },\n wrap: function(chunk, loc = this.currentLocation || { start: {} }) {\n if (chunk instanceof SourceNode) {\n return chunk;\n }\n\n chunk = castChunk(chunk, this, loc);\n\n return new SourceNode(\n loc.start.line,\n loc.start.column,\n this.srcFile,\n chunk\n );\n },\n\n functionCall: function(fn, type, params) {\n params = this.generateList(params);\n return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);\n },\n\n quotedString: function(str) {\n return (\n '\"' +\n (str + '')\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\"/g, '\\\\\"')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/\\u2028/g, '\\\\u2028') // Per Ecma-262 7.3 + 7.8.4\n .replace(/\\u2029/g, '\\\\u2029') +\n '\"'\n );\n },\n\n objectLiteral: function(obj) {\n let pairs = [];\n\n Object.keys(obj).forEach(key => {\n let value = castChunk(obj[key], this);\n if (value !== 'undefined') {\n pairs.push([this.quotedString(key), ':', value]);\n }\n });\n\n let ret = this.generateList(pairs);\n ret.prepend('{');\n ret.add('}');\n return ret;\n },\n\n generateList: function(entries) {\n let ret = this.empty();\n\n for (let i = 0, len = entries.length; i < len; i++) {\n if (i) {\n ret.add(',');\n }\n\n ret.add(castChunk(entries[i], this));\n }\n\n return ret;\n },\n\n generateArray: function(entries) {\n let ret = this.generateList(entries);\n ret.prepend('[');\n ret.add(']');\n\n return ret;\n }\n};\n\nexport default CodeGen;\n","import { COMPILER_REVISION, REVISION_CHANGES } from '../base';\nimport Exception from '../exception';\nimport { isArray } from '../utils';\nimport CodeGen from './code-gen';\n\nfunction Literal(value) {\n this.value = value;\n}\n\nfunction JavaScriptCompiler() {}\n\nJavaScriptCompiler.prototype = {\n // PUBLIC API: You can override these methods in a subclass to provide\n // alternative compiled forms for name lookup and buffering semantics\n nameLookup: function(parent, name /*, type */) {\n return this.internalNameLookup(parent, name);\n },\n depthedLookup: function(name) {\n return [\n this.aliasable('container.lookup'),\n '(depths, ',\n JSON.stringify(name),\n ')'\n ];\n },\n\n compilerInfo: function() {\n const revision = COMPILER_REVISION,\n versions = REVISION_CHANGES[revision];\n return [revision, versions];\n },\n\n appendToBuffer: function(source, location, explicit) {\n // Force a source as this simplifies the merge logic.\n if (!isArray(source)) {\n source = [source];\n }\n source = this.source.wrap(source, location);\n\n if (this.environment.isSimple) {\n return ['return ', source, ';'];\n } else if (explicit) {\n // This is a case where the buffer operation occurs as a child of another\n // construct, generally braces. We have to explicitly output these buffer\n // operations to ensure that the emitted code goes in the correct location.\n return ['buffer += ', source, ';'];\n } else {\n source.appendToBuffer = true;\n return source;\n }\n },\n\n initializeBuffer: function() {\n return this.quotedString('');\n },\n // END PUBLIC API\n internalNameLookup: function(parent, name) {\n this.lookupPropertyFunctionIsUsed = true;\n return ['lookupProperty(', parent, ',', JSON.stringify(name), ')'];\n },\n\n lookupPropertyFunctionIsUsed: false,\n\n compile: function(environment, options, context, asObject) {\n this.environment = environment;\n this.options = options;\n this.stringParams = this.options.stringParams;\n this.trackIds = this.options.trackIds;\n this.precompile = !asObject;\n\n this.name = this.environment.name;\n this.isChild = !!context;\n this.context = context || {\n decorators: [],\n programs: [],\n environments: []\n };\n\n this.preamble();\n\n this.stackSlot = 0;\n this.stackVars = [];\n this.aliases = {};\n this.registers = { list: [] };\n this.hashes = [];\n this.compileStack = [];\n this.inlineStack = [];\n this.blockParams = [];\n\n this.compileChildren(environment, options);\n\n this.useDepths =\n this.useDepths ||\n environment.useDepths ||\n environment.useDecorators ||\n this.options.compat;\n this.useBlockParams = this.useBlockParams || environment.useBlockParams;\n\n let opcodes = environment.opcodes,\n opcode,\n firstLoc,\n i,\n l;\n\n for (i = 0, l = opcodes.length; i < l; i++) {\n opcode = opcodes[i];\n\n this.source.currentLocation = opcode.loc;\n firstLoc = firstLoc || opcode.loc;\n this[opcode.opcode].apply(this, opcode.args);\n }\n\n // Flush any trailing content that might be pending.\n this.source.currentLocation = firstLoc;\n this.pushSource('');\n\n /* istanbul ignore next */\n if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {\n throw new Exception('Compile completed with content left on stack');\n }\n\n if (!this.decorators.isEmpty()) {\n this.useDecorators = true;\n\n this.decorators.prepend([\n 'var decorators = container.decorators, ',\n this.lookupPropertyFunctionVarDeclaration(),\n ';\\n'\n ]);\n this.decorators.push('return fn;');\n\n if (asObject) {\n this.decorators = Function.apply(this, [\n 'fn',\n 'props',\n 'container',\n 'depth0',\n 'data',\n 'blockParams',\n 'depths',\n this.decorators.merge()\n ]);\n } else {\n this.decorators.prepend(\n 'function(fn, props, container, depth0, data, blockParams, depths) {\\n'\n );\n this.decorators.push('}\\n');\n this.decorators = this.decorators.merge();\n }\n } else {\n this.decorators = undefined;\n }\n\n let fn = this.createFunctionContext(asObject);\n if (!this.isChild) {\n let ret = {\n compiler: this.compilerInfo(),\n main: fn\n };\n\n if (this.decorators) {\n ret.main_d = this.decorators; // eslint-disable-line camelcase\n ret.useDecorators = true;\n }\n\n let { programs, decorators } = this.context;\n for (i = 0, l = programs.length; i < l; i++) {\n if (programs[i]) {\n ret[i] = programs[i];\n if (decorators[i]) {\n ret[i + '_d'] = decorators[i];\n ret.useDecorators = true;\n }\n }\n }\n\n if (this.environment.usePartial) {\n ret.usePartial = true;\n }\n if (this.options.data) {\n ret.useData = true;\n }\n if (this.useDepths) {\n ret.useDepths = true;\n }\n if (this.useBlockParams) {\n ret.useBlockParams = true;\n }\n if (this.options.compat) {\n ret.compat = true;\n }\n\n if (!asObject) {\n ret.compiler = JSON.stringify(ret.compiler);\n\n this.source.currentLocation = { start: { line: 1, column: 0 } };\n ret = this.objectLiteral(ret);\n\n if (options.srcName) {\n ret = ret.toStringWithSourceMap({ file: options.destName });\n ret.map = ret.map && ret.map.toString();\n } else {\n ret = ret.toString();\n }\n } else {\n ret.compilerOptions = this.options;\n }\n\n return ret;\n } else {\n return fn;\n }\n },\n\n preamble: function() {\n // track the last context pushed into place to allow skipping the\n // getContext opcode when it would be a noop\n this.lastContext = 0;\n this.source = new CodeGen(this.options.srcName);\n this.decorators = new CodeGen(this.options.srcName);\n },\n\n createFunctionContext: function(asObject) {\n let varDeclarations = '';\n\n let locals = this.stackVars.concat(this.registers.list);\n if (locals.length > 0) {\n varDeclarations += ', ' + locals.join(', ');\n }\n\n // Generate minimizer alias mappings\n //\n // When using true SourceNodes, this will update all references to the given alias\n // as the source nodes are reused in situ. For the non-source node compilation mode,\n // aliases will not be used, but this case is already being run on the client and\n // we aren't concern about minimizing the template size.\n let aliasCount = 0;\n Object.keys(this.aliases).forEach(alias => {\n let node = this.aliases[alias];\n if (node.children && node.referenceCount > 1) {\n varDeclarations += ', alias' + ++aliasCount + '=' + alias;\n node.children[0] = 'alias' + aliasCount;\n }\n });\n\n if (this.lookupPropertyFunctionIsUsed) {\n varDeclarations += ', ' + this.lookupPropertyFunctionVarDeclaration();\n }\n\n let params = ['container', 'depth0', 'helpers', 'partials', 'data'];\n\n if (this.useBlockParams || this.useDepths) {\n params.push('blockParams');\n }\n if (this.useDepths) {\n params.push('depths');\n }\n\n // Perform a second pass over the output to merge content when possible\n let source = this.mergeSource(varDeclarations);\n\n if (asObject) {\n params.push(source);\n\n return Function.apply(this, params);\n } else {\n return this.source.wrap([\n 'function(',\n params.join(','),\n ') {\\n ',\n source,\n '}'\n ]);\n }\n },\n mergeSource: function(varDeclarations) {\n let isSimple = this.environment.isSimple,\n appendOnly = !this.forceBuffer,\n appendFirst,\n sourceSeen,\n bufferStart,\n bufferEnd;\n this.source.each(line => {\n if (line.appendToBuffer) {\n if (bufferStart) {\n line.prepend(' + ');\n } else {\n bufferStart = line;\n }\n bufferEnd = line;\n } else {\n if (bufferStart) {\n if (!sourceSeen) {\n appendFirst = true;\n } else {\n bufferStart.prepend('buffer += ');\n }\n bufferEnd.add(';');\n bufferStart = bufferEnd = undefined;\n }\n\n sourceSeen = true;\n if (!isSimple) {\n appendOnly = false;\n }\n }\n });\n\n if (appendOnly) {\n if (bufferStart) {\n bufferStart.prepend('return ');\n bufferEnd.add(';');\n } else if (!sourceSeen) {\n this.source.push('return \"\";');\n }\n } else {\n varDeclarations +=\n ', buffer = ' + (appendFirst ? '' : this.initializeBuffer());\n\n if (bufferStart) {\n bufferStart.prepend('return buffer + ');\n bufferEnd.add(';');\n } else {\n this.source.push('return buffer;');\n }\n }\n\n if (varDeclarations) {\n this.source.prepend(\n 'var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\\n')\n );\n }\n\n return this.source.merge();\n },\n\n lookupPropertyFunctionVarDeclaration: function() {\n return `\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n `.trim();\n },\n\n // [blockValue]\n //\n // On stack, before: hash, inverse, program, value\n // On stack, after: return value of blockHelperMissing\n //\n // The purpose of this opcode is to take a block of the form\n // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and\n // replace it on the stack with the result of properly\n // invoking blockHelperMissing.\n blockValue: function(name) {\n let blockHelperMissing = this.aliasable(\n 'container.hooks.blockHelperMissing'\n ),\n params = [this.contextName(0)];\n this.setupHelperArgs(name, 0, params);\n\n let blockName = this.popStack();\n params.splice(1, 0, blockName);\n\n this.push(this.source.functionCall(blockHelperMissing, 'call', params));\n },\n\n // [ambiguousBlockValue]\n //\n // On stack, before: hash, inverse, program, value\n // Compiler value, before: lastHelper=value of last found helper, if any\n // On stack, after, if no lastHelper: same as [blockValue]\n // On stack, after, if lastHelper: value\n ambiguousBlockValue: function() {\n // We're being a bit cheeky and reusing the options value from the prior exec\n let blockHelperMissing = this.aliasable(\n 'container.hooks.blockHelperMissing'\n ),\n params = [this.contextName(0)];\n this.setupHelperArgs('', 0, params, true);\n\n this.flushInline();\n\n let current = this.topStack();\n params.splice(1, 0, current);\n\n this.pushSource([\n 'if (!',\n this.lastHelper,\n ') { ',\n current,\n ' = ',\n this.source.functionCall(blockHelperMissing, 'call', params),\n '}'\n ]);\n },\n\n // [appendContent]\n //\n // On stack, before: ...\n // On stack, after: ...\n //\n // Appends the string value of `content` to the current buffer\n appendContent: function(content) {\n if (this.pendingContent) {\n content = this.pendingContent + content;\n } else {\n this.pendingLocation = this.source.currentLocation;\n }\n\n this.pendingContent = content;\n },\n\n // [append]\n //\n // On stack, before: value, ...\n // On stack, after: ...\n //\n // Coerces `value` to a String and appends it to the current buffer.\n //\n // If `value` is truthy, or 0, it is coerced into a string and appended\n // Otherwise, the empty string is appended\n append: function() {\n if (this.isInline()) {\n this.replaceStack(current => [' != null ? ', current, ' : \"\"']);\n\n this.pushSource(this.appendToBuffer(this.popStack()));\n } else {\n let local = this.popStack();\n this.pushSource([\n 'if (',\n local,\n ' != null) { ',\n this.appendToBuffer(local, undefined, true),\n ' }'\n ]);\n if (this.environment.isSimple) {\n this.pushSource([\n 'else { ',\n this.appendToBuffer(\"''\", undefined, true),\n ' }'\n ]);\n }\n }\n },\n\n // [appendEscaped]\n //\n // On stack, before: value, ...\n // On stack, after: ...\n //\n // Escape `value` and append it to the buffer\n appendEscaped: function() {\n this.pushSource(\n this.appendToBuffer([\n this.aliasable('container.escapeExpression'),\n '(',\n this.popStack(),\n ')'\n ])\n );\n },\n\n // [getContext]\n //\n // On stack, before: ...\n // On stack, after: ...\n // Compiler value, after: lastContext=depth\n //\n // Set the value of the `lastContext` compiler value to the depth\n getContext: function(depth) {\n this.lastContext = depth;\n },\n\n // [pushContext]\n //\n // On stack, before: ...\n // On stack, after: currentContext, ...\n //\n // Pushes the value of the current context onto the stack.\n pushContext: function() {\n this.pushStackLiteral(this.contextName(this.lastContext));\n },\n\n // [lookupOnContext]\n //\n // On stack, before: ...\n // On stack, after: currentContext[name], ...\n //\n // Looks up the value of `name` on the current context and pushes\n // it onto the stack.\n lookupOnContext: function(parts, falsy, strict, scoped) {\n let i = 0;\n\n if (!scoped && this.options.compat && !this.lastContext) {\n // The depthed query is expected to handle the undefined logic for the root level that\n // is implemented below, so we evaluate that directly in compat mode\n this.push(this.depthedLookup(parts[i++]));\n } else {\n this.pushContext();\n }\n\n this.resolvePath('context', parts, i, falsy, strict);\n },\n\n // [lookupBlockParam]\n //\n // On stack, before: ...\n // On stack, after: blockParam[name], ...\n //\n // Looks up the value of `parts` on the given block param and pushes\n // it onto the stack.\n lookupBlockParam: function(blockParamId, parts) {\n this.useBlockParams = true;\n\n this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);\n this.resolvePath('context', parts, 1);\n },\n\n // [lookupData]\n //\n // On stack, before: ...\n // On stack, after: data, ...\n //\n // Push the data lookup operator\n lookupData: function(depth, parts, strict) {\n if (!depth) {\n this.pushStackLiteral('data');\n } else {\n this.pushStackLiteral('container.data(data, ' + depth + ')');\n }\n\n this.resolvePath('data', parts, 0, true, strict);\n },\n\n resolvePath: function(type, parts, i, falsy, strict) {\n if (this.options.strict || this.options.assumeObjects) {\n this.push(\n strictLookup(this.options.strict && strict, this, parts, i, type)\n );\n return;\n }\n\n let len = parts.length;\n for (; i < len; i++) {\n /* eslint-disable no-loop-func */\n this.replaceStack(current => {\n let lookup = this.nameLookup(current, parts[i], type);\n // We want to ensure that zero and false are handled properly if the context (falsy flag)\n // needs to have the special handling for these values.\n if (!falsy) {\n return [' != null ? ', lookup, ' : ', current];\n } else {\n // Otherwise we can use generic falsy handling\n return [' && ', lookup];\n }\n });\n /* eslint-enable no-loop-func */\n }\n },\n\n // [resolvePossibleLambda]\n //\n // On stack, before: value, ...\n // On stack, after: resolved value, ...\n //\n // If the `value` is a lambda, replace it on the stack by\n // the return value of the lambda\n resolvePossibleLambda: function() {\n this.push([\n this.aliasable('container.lambda'),\n '(',\n this.popStack(),\n ', ',\n this.contextName(0),\n ')'\n ]);\n },\n\n // [pushStringParam]\n //\n // On stack, before: ...\n // On stack, after: string, currentContext, ...\n //\n // This opcode is designed for use in string mode, which\n // provides the string value of a parameter along with its\n // depth rather than resolving it immediately.\n pushStringParam: function(string, type) {\n this.pushContext();\n this.pushString(type);\n\n // If it's a subexpression, the string result\n // will be pushed after this opcode.\n if (type !== 'SubExpression') {\n if (typeof string === 'string') {\n this.pushString(string);\n } else {\n this.pushStackLiteral(string);\n }\n }\n },\n\n emptyHash: function(omitEmpty) {\n if (this.trackIds) {\n this.push('{}'); // hashIds\n }\n if (this.stringParams) {\n this.push('{}'); // hashContexts\n this.push('{}'); // hashTypes\n }\n this.pushStackLiteral(omitEmpty ? 'undefined' : '{}');\n },\n pushHash: function() {\n if (this.hash) {\n this.hashes.push(this.hash);\n }\n this.hash = { values: {}, types: [], contexts: [], ids: [] };\n },\n popHash: function() {\n let hash = this.hash;\n this.hash = this.hashes.pop();\n\n if (this.trackIds) {\n this.push(this.objectLiteral(hash.ids));\n }\n if (this.stringParams) {\n this.push(this.objectLiteral(hash.contexts));\n this.push(this.objectLiteral(hash.types));\n }\n\n this.push(this.objectLiteral(hash.values));\n },\n\n // [pushString]\n //\n // On stack, before: ...\n // On stack, after: quotedString(string), ...\n //\n // Push a quoted version of `string` onto the stack\n pushString: function(string) {\n this.pushStackLiteral(this.quotedString(string));\n },\n\n // [pushLiteral]\n //\n // On stack, before: ...\n // On stack, after: value, ...\n //\n // Pushes a value onto the stack. This operation prevents\n // the compiler from creating a temporary variable to hold\n // it.\n pushLiteral: function(value) {\n this.pushStackLiteral(value);\n },\n\n // [pushProgram]\n //\n // On stack, before: ...\n // On stack, after: program(guid), ...\n //\n // Push a program expression onto the stack. This takes\n // a compile-time guid and converts it into a runtime-accessible\n // expression.\n pushProgram: function(guid) {\n if (guid != null) {\n this.pushStackLiteral(this.programExpression(guid));\n } else {\n this.pushStackLiteral(null);\n }\n },\n\n // [registerDecorator]\n //\n // On stack, before: hash, program, params..., ...\n // On stack, after: ...\n //\n // Pops off the decorator's parameters, invokes the decorator,\n // and inserts the decorator into the decorators list.\n registerDecorator(paramSize, name) {\n let foundDecorator = this.nameLookup('decorators', name, 'decorator'),\n options = this.setupHelperArgs(name, paramSize);\n\n this.decorators.push([\n 'fn = ',\n this.decorators.functionCall(foundDecorator, '', [\n 'fn',\n 'props',\n 'container',\n options\n ]),\n ' || fn;'\n ]);\n },\n\n // [invokeHelper]\n //\n // On stack, before: hash, inverse, program, params..., ...\n // On stack, after: result of helper invocation\n //\n // Pops off the helper's parameters, invokes the helper,\n // and pushes the helper's return value onto the stack.\n //\n // If the helper is not found, `helperMissing` is called.\n invokeHelper: function(paramSize, name, isSimple) {\n let nonHelper = this.popStack(),\n helper = this.setupHelper(paramSize, name);\n\n let possibleFunctionCalls = [];\n\n if (isSimple) {\n // direct call to helper\n possibleFunctionCalls.push(helper.name);\n }\n // call a function from the input object\n possibleFunctionCalls.push(nonHelper);\n if (!this.options.strict) {\n possibleFunctionCalls.push(\n this.aliasable('container.hooks.helperMissing')\n );\n }\n\n let functionLookupCode = [\n '(',\n this.itemsSeparatedBy(possibleFunctionCalls, '||'),\n ')'\n ];\n let functionCall = this.source.functionCall(\n functionLookupCode,\n 'call',\n helper.callParams\n );\n this.push(functionCall);\n },\n\n itemsSeparatedBy: function(items, separator) {\n let result = [];\n result.push(items[0]);\n for (let i = 1; i < items.length; i++) {\n result.push(separator, items[i]);\n }\n return result;\n },\n // [invokeKnownHelper]\n //\n // On stack, before: hash, inverse, program, params..., ...\n // On stack, after: result of helper invocation\n //\n // This operation is used when the helper is known to exist,\n // so a `helperMissing` fallback is not required.\n invokeKnownHelper: function(paramSize, name) {\n let helper = this.setupHelper(paramSize, name);\n this.push(this.source.functionCall(helper.name, 'call', helper.callParams));\n },\n\n // [invokeAmbiguous]\n //\n // On stack, before: hash, inverse, program, params..., ...\n // On stack, after: result of disambiguation\n //\n // This operation is used when an expression like `{{foo}}`\n // is provided, but we don't know at compile-time whether it\n // is a helper or a path.\n //\n // This operation emits more code than the other options,\n // and can be avoided by passing the `knownHelpers` and\n // `knownHelpersOnly` flags at compile-time.\n invokeAmbiguous: function(name, helperCall) {\n this.useRegister('helper');\n\n let nonHelper = this.popStack();\n\n this.emptyHash();\n let helper = this.setupHelper(0, name, helperCall);\n\n let helperName = (this.lastHelper = this.nameLookup(\n 'helpers',\n name,\n 'helper'\n ));\n\n let lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')'];\n if (!this.options.strict) {\n lookup[0] = '(helper = ';\n lookup.push(\n ' != null ? helper : ',\n this.aliasable('container.hooks.helperMissing')\n );\n }\n\n this.push([\n '(',\n lookup,\n helper.paramsInit ? ['),(', helper.paramsInit] : [],\n '),',\n '(typeof helper === ',\n this.aliasable('\"function\"'),\n ' ? ',\n this.source.functionCall('helper', 'call', helper.callParams),\n ' : helper))'\n ]);\n },\n\n // [invokePartial]\n //\n // On stack, before: context, ...\n // On stack after: result of partial invocation\n //\n // This operation pops off a context, invokes a partial with that context,\n // and pushes the result of the invocation back.\n invokePartial: function(isDynamic, name, indent) {\n let params = [],\n options = this.setupParams(name, 1, params);\n\n if (isDynamic) {\n name = this.popStack();\n delete options.name;\n }\n\n if (indent) {\n options.indent = JSON.stringify(indent);\n }\n options.helpers = 'helpers';\n options.partials = 'partials';\n options.decorators = 'container.decorators';\n\n if (!isDynamic) {\n params.unshift(this.nameLookup('partials', name, 'partial'));\n } else {\n params.unshift(name);\n }\n\n if (this.options.compat) {\n options.depths = 'depths';\n }\n options = this.objectLiteral(options);\n params.push(options);\n\n this.push(this.source.functionCall('container.invokePartial', '', params));\n },\n\n // [assignToHash]\n //\n // On stack, before: value, ..., hash, ...\n // On stack, after: ..., hash, ...\n //\n // Pops a value off the stack and assigns it to the current hash\n assignToHash: function(key) {\n let value = this.popStack(),\n context,\n type,\n id;\n\n if (this.trackIds) {\n id = this.popStack();\n }\n if (this.stringParams) {\n type = this.popStack();\n context = this.popStack();\n }\n\n let hash = this.hash;\n if (context) {\n hash.contexts[key] = context;\n }\n if (type) {\n hash.types[key] = type;\n }\n if (id) {\n hash.ids[key] = id;\n }\n hash.values[key] = value;\n },\n\n pushId: function(type, name, child) {\n if (type === 'BlockParam') {\n this.pushStackLiteral(\n 'blockParams[' +\n name[0] +\n '].path[' +\n name[1] +\n ']' +\n (child ? ' + ' + JSON.stringify('.' + child) : '')\n );\n } else if (type === 'PathExpression') {\n this.pushString(name);\n } else if (type === 'SubExpression') {\n this.pushStackLiteral('true');\n } else {\n this.pushStackLiteral('null');\n }\n },\n\n // HELPERS\n\n compiler: JavaScriptCompiler,\n\n compileChildren: function(environment, options) {\n let children = environment.children,\n child,\n compiler;\n\n for (let i = 0, l = children.length; i < l; i++) {\n child = children[i];\n compiler = new this.compiler(); // eslint-disable-line new-cap\n\n let existing = this.matchExistingProgram(child);\n\n if (existing == null) {\n this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children\n let index = this.context.programs.length;\n child.index = index;\n child.name = 'program' + index;\n this.context.programs[index] = compiler.compile(\n child,\n options,\n this.context,\n !this.precompile\n );\n this.context.decorators[index] = compiler.decorators;\n this.context.environments[index] = child;\n\n this.useDepths = this.useDepths || compiler.useDepths;\n this.useBlockParams = this.useBlockParams || compiler.useBlockParams;\n child.useDepths = this.useDepths;\n child.useBlockParams = this.useBlockParams;\n } else {\n child.index = existing.index;\n child.name = 'program' + existing.index;\n\n this.useDepths = this.useDepths || existing.useDepths;\n this.useBlockParams = this.useBlockParams || existing.useBlockParams;\n }\n }\n },\n matchExistingProgram: function(child) {\n for (let i = 0, len = this.context.environments.length; i < len; i++) {\n let environment = this.context.environments[i];\n if (environment && environment.equals(child)) {\n return environment;\n }\n }\n },\n\n programExpression: function(guid) {\n let child = this.environment.children[guid],\n programParams = [child.index, 'data', child.blockParams];\n\n if (this.useBlockParams || this.useDepths) {\n programParams.push('blockParams');\n }\n if (this.useDepths) {\n programParams.push('depths');\n }\n\n return 'container.program(' + programParams.join(', ') + ')';\n },\n\n useRegister: function(name) {\n if (!this.registers[name]) {\n this.registers[name] = true;\n this.registers.list.push(name);\n }\n },\n\n push: function(expr) {\n if (!(expr instanceof Literal)) {\n expr = this.source.wrap(expr);\n }\n\n this.inlineStack.push(expr);\n return expr;\n },\n\n pushStackLiteral: function(item) {\n this.push(new Literal(item));\n },\n\n pushSource: function(source) {\n if (this.pendingContent) {\n this.source.push(\n this.appendToBuffer(\n this.source.quotedString(this.pendingContent),\n this.pendingLocation\n )\n );\n this.pendingContent = undefined;\n }\n\n if (source) {\n this.source.push(source);\n }\n },\n\n replaceStack: function(callback) {\n let prefix = ['('],\n stack,\n createdStack,\n usedLiteral;\n\n /* istanbul ignore next */\n if (!this.isInline()) {\n throw new Exception('replaceStack on non-inline');\n }\n\n // We want to merge the inline statement into the replacement statement via ','\n let top = this.popStack(true);\n\n if (top instanceof Literal) {\n // Literals do not need to be inlined\n stack = [top.value];\n prefix = ['(', stack];\n usedLiteral = true;\n } else {\n // Get or create the current stack name for use by the inline\n createdStack = true;\n let name = this.incrStack();\n\n prefix = ['((', this.push(name), ' = ', top, ')'];\n stack = this.topStack();\n }\n\n let item = callback.call(this, stack);\n\n if (!usedLiteral) {\n this.popStack();\n }\n if (createdStack) {\n this.stackSlot--;\n }\n this.push(prefix.concat(item, ')'));\n },\n\n incrStack: function() {\n this.stackSlot++;\n if (this.stackSlot > this.stackVars.length) {\n this.stackVars.push('stack' + this.stackSlot);\n }\n return this.topStackName();\n },\n topStackName: function() {\n return 'stack' + this.stackSlot;\n },\n flushInline: function() {\n let inlineStack = this.inlineStack;\n this.inlineStack = [];\n for (let i = 0, len = inlineStack.length; i < len; i++) {\n let entry = inlineStack[i];\n /* istanbul ignore if */\n if (entry instanceof Literal) {\n this.compileStack.push(entry);\n } else {\n let stack = this.incrStack();\n this.pushSource([stack, ' = ', entry, ';']);\n this.compileStack.push(stack);\n }\n }\n },\n isInline: function() {\n return this.inlineStack.length;\n },\n\n popStack: function(wrapped) {\n let inline = this.isInline(),\n item = (inline ? this.inlineStack : this.compileStack).pop();\n\n if (!wrapped && item instanceof Literal) {\n return item.value;\n } else {\n if (!inline) {\n /* istanbul ignore next */\n if (!this.stackSlot) {\n throw new Exception('Invalid stack pop');\n }\n this.stackSlot--;\n }\n return item;\n }\n },\n\n topStack: function() {\n let stack = this.isInline() ? this.inlineStack : this.compileStack,\n item = stack[stack.length - 1];\n\n /* istanbul ignore if */\n if (item instanceof Literal) {\n return item.value;\n } else {\n return item;\n }\n },\n\n contextName: function(context) {\n if (this.useDepths && context) {\n return 'depths[' + context + ']';\n } else {\n return 'depth' + context;\n }\n },\n\n quotedString: function(str) {\n return this.source.quotedString(str);\n },\n\n objectLiteral: function(obj) {\n return this.source.objectLiteral(obj);\n },\n\n aliasable: function(name) {\n let ret = this.aliases[name];\n if (ret) {\n ret.referenceCount++;\n return ret;\n }\n\n ret = this.aliases[name] = this.source.wrap(name);\n ret.aliasable = true;\n ret.referenceCount = 1;\n\n return ret;\n },\n\n setupHelper: function(paramSize, name, blockHelper) {\n let params = [],\n paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);\n let foundHelper = this.nameLookup('helpers', name, 'helper'),\n callContext = this.aliasable(\n `${this.contextName(0)} != null ? ${this.contextName(\n 0\n )} : (container.nullContext || {})`\n );\n\n return {\n params: params,\n paramsInit: paramsInit,\n name: foundHelper,\n callParams: [callContext].concat(params)\n };\n },\n\n setupParams: function(helper, paramSize, params) {\n let options = {},\n contexts = [],\n types = [],\n ids = [],\n objectArgs = !params,\n param;\n\n if (objectArgs) {\n params = [];\n }\n\n options.name = this.quotedString(helper);\n options.hash = this.popStack();\n\n if (this.trackIds) {\n options.hashIds = this.popStack();\n }\n if (this.stringParams) {\n options.hashTypes = this.popStack();\n options.hashContexts = this.popStack();\n }\n\n let inverse = this.popStack(),\n program = this.popStack();\n\n // Avoid setting fn and inverse if neither are set. This allows\n // helpers to do a check for `if (options.fn)`\n if (program || inverse) {\n options.fn = program || 'container.noop';\n options.inverse = inverse || 'container.noop';\n }\n\n // The parameters go on to the stack in order (making sure that they are evaluated in order)\n // so we need to pop them off the stack in reverse order\n let i = paramSize;\n while (i--) {\n param = this.popStack();\n params[i] = param;\n\n if (this.trackIds) {\n ids[i] = this.popStack();\n }\n if (this.stringParams) {\n types[i] = this.popStack();\n contexts[i] = this.popStack();\n }\n }\n\n if (objectArgs) {\n options.args = this.source.generateArray(params);\n }\n\n if (this.trackIds) {\n options.ids = this.source.generateArray(ids);\n }\n if (this.stringParams) {\n options.types = this.source.generateArray(types);\n options.contexts = this.source.generateArray(contexts);\n }\n\n if (this.options.data) {\n options.data = 'data';\n }\n if (this.useBlockParams) {\n options.blockParams = 'blockParams';\n }\n return options;\n },\n\n setupHelperArgs: function(helper, paramSize, params, useRegister) {\n let options = this.setupParams(helper, paramSize, params);\n options.loc = JSON.stringify(this.source.currentLocation);\n options = this.objectLiteral(options);\n if (useRegister) {\n this.useRegister('options');\n params.push('options');\n return ['options=', options];\n } else if (params) {\n params.push(options);\n return '';\n } else {\n return options;\n }\n }\n};\n\n(function() {\n const reservedWords = (\n 'break else new var' +\n ' case finally return void' +\n ' catch for switch while' +\n ' continue function this with' +\n ' default if throw' +\n ' delete in try' +\n ' do instanceof typeof' +\n ' abstract enum int short' +\n ' boolean export interface static' +\n ' byte extends long super' +\n ' char final native synchronized' +\n ' class float package throws' +\n ' const goto private transient' +\n ' debugger implements protected volatile' +\n ' double import public let yield await' +\n ' null true false'\n ).split(' ');\n\n const compilerWords = (JavaScriptCompiler.RESERVED_WORDS = {});\n\n for (let i = 0, l = reservedWords.length; i < l; i++) {\n compilerWords[reservedWords[i]] = true;\n }\n})();\n\n/**\n * @deprecated May be removed in the next major version\n */\nJavaScriptCompiler.isValidJavaScriptVariableName = function(name) {\n return (\n !JavaScriptCompiler.RESERVED_WORDS[name] &&\n /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name)\n );\n};\n\nfunction strictLookup(requireTerminal, compiler, parts, i, type) {\n let stack = compiler.popStack(),\n len = parts.length;\n if (requireTerminal) {\n len--;\n }\n\n for (; i < len; i++) {\n stack = compiler.nameLookup(stack, parts[i], type);\n }\n\n if (requireTerminal) {\n return [\n compiler.aliasable('container.strict'),\n '(',\n stack,\n ', ',\n compiler.quotedString(parts[i]),\n ', ',\n JSON.stringify(compiler.source.currentLocation),\n ' )'\n ];\n } else {\n return stack;\n }\n}\n\nexport default JavaScriptCompiler;\n","import runtime from './handlebars.runtime';\n\n// Compiler imports\nimport AST from './handlebars/compiler/ast';\nimport {\n parser as Parser,\n parse,\n parseWithoutProcessing\n} from './handlebars/compiler/base';\nimport { Compiler, compile, precompile } from './handlebars/compiler/compiler';\nimport JavaScriptCompiler from './handlebars/compiler/javascript-compiler';\nimport Visitor from './handlebars/compiler/visitor';\n\nimport noConflict from './handlebars/no-conflict';\n\nlet _create = runtime.create;\nfunction create() {\n let hb = _create();\n\n hb.compile = function(input, options) {\n return compile(input, options, hb);\n };\n hb.precompile = function(input, options) {\n return precompile(input, options, hb);\n };\n\n hb.AST = AST;\n hb.Compiler = Compiler;\n hb.JavaScriptCompiler = JavaScriptCompiler;\n hb.Parser = Parser;\n hb.parse = parse;\n hb.parseWithoutProcessing = parseWithoutProcessing;\n\n return hb;\n}\n\nlet inst = create();\ninst.create = create;\n\nnoConflict(inst);\n\ninst.Visitor = Visitor;\n\ninst['default'] = inst;\n\nexport default inst;\n","/* eslint-disable new-cap */\nimport Visitor from './visitor';\n\nexport function print(ast) {\n return new PrintVisitor().accept(ast);\n}\n\nexport function PrintVisitor() {\n this.padding = 0;\n}\n\nPrintVisitor.prototype = new Visitor();\n\nPrintVisitor.prototype.pad = function(string) {\n let out = '';\n\n for (let i = 0, l = this.padding; i < l; i++) {\n out += ' ';\n }\n\n out += string + '\\n';\n return out;\n};\n\nPrintVisitor.prototype.Program = function(program) {\n let out = '',\n body = program.body,\n i,\n l;\n\n if (program.blockParams) {\n let blockParams = 'BLOCK PARAMS: [';\n for (i = 0, l = program.blockParams.length; i < l; i++) {\n blockParams += ' ' + program.blockParams[i];\n }\n blockParams += ' ]';\n out += this.pad(blockParams);\n }\n\n for (i = 0, l = body.length; i < l; i++) {\n out += this.accept(body[i]);\n }\n\n this.padding--;\n\n return out;\n};\n\nPrintVisitor.prototype.MustacheStatement = function(mustache) {\n return this.pad('{{ ' + this.SubExpression(mustache) + ' }}');\n};\nPrintVisitor.prototype.Decorator = function(mustache) {\n return this.pad('{{ DIRECTIVE ' + this.SubExpression(mustache) + ' }}');\n};\n\nPrintVisitor.prototype.BlockStatement = PrintVisitor.prototype.DecoratorBlock = function(\n block\n) {\n let out = '';\n\n out += this.pad(\n (block.type === 'DecoratorBlock' ? 'DIRECTIVE ' : '') + 'BLOCK:'\n );\n this.padding++;\n out += this.pad(this.SubExpression(block));\n if (block.program) {\n out += this.pad('PROGRAM:');\n this.padding++;\n out += this.accept(block.program);\n this.padding--;\n }\n if (block.inverse) {\n if (block.program) {\n this.padding++;\n }\n out += this.pad('{{^}}');\n this.padding++;\n out += this.accept(block.inverse);\n this.padding--;\n if (block.program) {\n this.padding--;\n }\n }\n this.padding--;\n\n return out;\n};\n\nPrintVisitor.prototype.PartialStatement = function(partial) {\n let content = 'PARTIAL:' + partial.name.original;\n if (partial.params[0]) {\n content += ' ' + this.accept(partial.params[0]);\n }\n if (partial.hash) {\n content += ' ' + this.accept(partial.hash);\n }\n return this.pad('{{> ' + content + ' }}');\n};\nPrintVisitor.prototype.PartialBlockStatement = function(partial) {\n let content = 'PARTIAL BLOCK:' + partial.name.original;\n if (partial.params[0]) {\n content += ' ' + this.accept(partial.params[0]);\n }\n if (partial.hash) {\n content += ' ' + this.accept(partial.hash);\n }\n\n content += ' ' + this.pad('PROGRAM:');\n this.padding++;\n content += this.accept(partial.program);\n this.padding--;\n\n return this.pad('{{> ' + content + ' }}');\n};\n\nPrintVisitor.prototype.ContentStatement = function(content) {\n return this.pad(\"CONTENT[ '\" + content.value + \"' ]\");\n};\n\nPrintVisitor.prototype.CommentStatement = function(comment) {\n return this.pad(\"{{! '\" + comment.value + \"' }}\");\n};\n\nPrintVisitor.prototype.SubExpression = function(sexpr) {\n let params = sexpr.params,\n paramStrings = [],\n hash;\n\n for (let i = 0, l = params.length; i < l; i++) {\n paramStrings.push(this.accept(params[i]));\n }\n\n params = '[' + paramStrings.join(', ') + ']';\n\n hash = sexpr.hash ? ' ' + this.accept(sexpr.hash) : '';\n\n return this.accept(sexpr.path) + ' ' + params + hash;\n};\n\nPrintVisitor.prototype.PathExpression = function(id) {\n let path = id.parts.join('/');\n return (id.data ? '@' : '') + 'PATH:' + path;\n};\n\nPrintVisitor.prototype.StringLiteral = function(string) {\n return '\"' + string.value + '\"';\n};\n\nPrintVisitor.prototype.NumberLiteral = function(number) {\n return 'NUMBER{' + number.value + '}';\n};\n\nPrintVisitor.prototype.BooleanLiteral = function(bool) {\n return 'BOOLEAN{' + bool.value + '}';\n};\n\nPrintVisitor.prototype.UndefinedLiteral = function() {\n return 'UNDEFINED';\n};\n\nPrintVisitor.prototype.NullLiteral = function() {\n return 'NULL';\n};\n\nPrintVisitor.prototype.Hash = function(hash) {\n let pairs = hash.pairs,\n joinedPairs = [];\n\n for (let i = 0, l = pairs.length; i < l; i++) {\n joinedPairs.push(this.accept(pairs[i]));\n }\n\n return 'HASH{' + joinedPairs.join(', ') + '}';\n};\nPrintVisitor.prototype.HashPair = function(pair) {\n return pair.key + '=' + this.accept(pair.value);\n};\n/* eslint-enable new-cap */\n","// USAGE:\n// var handlebars = require('handlebars');\n/* eslint-env node */\n/* eslint-disable no-var */\n\n// var local = handlebars.create();\n\nvar handlebars = require('../dist/cjs/handlebars')['default'];\n\nvar printer = require('../dist/cjs/handlebars/compiler/printer');\nhandlebars.PrintVisitor = printer.PrintVisitor;\nhandlebars.print = printer.print;\n\nmodule.exports = handlebars;\n\n// Publish a Node.js require() handler for .handlebars and .hbs files\nfunction extension(module, filename) {\n var fs = require('fs');\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars.compile(templateString);\n}\n/* istanbul ignore else */\nif (typeof require !== 'undefined' && require.extensions) {\n require.extensions['.handlebars'] = extension;\n require.extensions['.hbs'] = extension;\n}\n","import Handlebars from 'handlebars';\n\n/**\n * Create a custom Handlebars environment that doesn't escape HTML entities.\n * Since prompt templates are intended for AI models (plain text) rather than HTML,\n * we disable HTML escaping to prevent characters like quotes and brackets\n * from being converted to HTML entities (e.g., ' -> ').\n */\nconst handlebarsNoEscape = Handlebars.create();\nhandlebarsNoEscape.Utils.escapeExpression = (str: any) => String(str);\n\n/**\n * Parses a Handlebars template with the provided context.\n *\n * Uses a custom Handlebars instance that disables HTML escaping, since the\n * output is intended for AI models (plain text) rather than HTML.\n *\n * @param prompt The Handlebars template string.\n * @param options An object containing the context.\n * @returns The rendered string.\n * @example\n * ```\n * const prompt = '{{#if isLoggedIn}}Hello, {{name}}!{{/if}}';\n * const context = {\n * isLoggedIn: true,\n * name: 'World'\n * };\n * const result = await handlebarsParse(prompt, { context });\n * console.log(result); // \"Hello, World!\" (if isLoggedIn is true)\n * ```\n */\nexport const handlebarsParse = async (\n prompt: string,\n { context }: { context: Record<string, any> },\n) => {\n const template = handlebarsNoEscape.compile(prompt);\n const result = template(context);\n return result ?? '';\n};\n","/**\n * Instrumentation\n */\n\nexport * from './otel/initAxiomAI';\nexport * from './otel/vercel';\nexport * from './otel/withSpan';\nimport { onlineEval as _onlineEval } from './online-evals/onlineEval';\nimport { warnOnlineEvalDeprecation } from './evals/deprecated';\n\n/** @deprecated Import from 'axiom/ai/evals/online' instead. */\nexport const onlineEval: typeof _onlineEval = (...args) => {\n warnOnlineEvalDeprecation();\n return _onlineEval(...args);\n};\n\nimport { createScorer } from './evals/scorer.factory';\nimport { warnScorerDeprecation } from './evals/deprecated';\n\n/** @deprecated Import from 'axiom/ai/evals/scorers' instead. */\nexport const Scorer = ((...args: unknown[]) => {\n warnScorerDeprecation('axiom/ai');\n return (createScorer as Function)(...args);\n}) as typeof createScorer;\n\n/** @deprecated Import from 'axiom/ai/evals/scorers' instead. */\nexport type { Score } from './evals/scorer.types';\n/** @deprecated Import from 'axiom/ai/evals/scorers' instead. */\nexport type { Scorer as ScorerType } from './evals/scorer.types';\n\nexport * from './otel/wrapTool';\nexport * from './otel/middleware';\nexport { type AxiomAIRedactionPolicy, RedactionPolicy } from './otel/utils/redaction';\n\n/**\n * App Scope\n */\n\nexport { createAppScope } from './app-scope';\n\n/**\n * Prompts\n */\n\n// Prompt and template functionality - marked as UNSAFE as these APIs are experimental\nexport type { Prompt as experimental_Prompt } from './types';\n\nexport { Type as experimental_Type } from './template';\nexport type {\n TSchema as experimental_TSchema,\n InferSchema as experimental_InferSchema,\n InferContext as experimental_InferContext,\n} from './template';\n\nexport { parse as experimental_parse, Template as experimental_Template } from './prompt';\n\nexport type {\n AxiomPromptMetadata as experimental_AxiomPromptMetadata,\n ParsedMessage as experimental_ParsedMessage,\n ParsedMessagesArray as experimental_ParsedMessagesArray,\n} from './types/metadata';\n","import type { Tracer } from '@opentelemetry/api';\nimport { trace } from '@opentelemetry/api';\nimport packageJson from '../../package.json';\nimport { AXIOM_AI_REDACTION_KEY, type AxiomAIRedactionPolicy } from './utils/redaction';\n\n// Global key to store tracer scope information across all execution contexts\nconst AXIOM_AI_SCOPE_KEY = Symbol.for('__axiom_ai_scope__');\n\ninterface TracerScope {\n name: string;\n version?: string;\n}\n\n/**\n * Extract scope information from a tracer, with fallback to package.json\n */\nfunction extractTracerScope(tracer: Tracer): TracerScope {\n const tracerAny = tracer as any;\n\n // Guard access to private fields with optional chaining\n // Note: These are internal OTEL fields that may change in future versions\n // _instrumentationScope is modern, instrumentationLibrary is legacy (<1.16)\n const name =\n tracerAny._instrumentationScope?.name ||\n tracerAny.instrumentationLibrary?.name ||\n packageJson.name;\n\n const version =\n tracerAny._instrumentationScope?.version ||\n tracerAny.instrumentationLibrary?.version ||\n packageJson.version;\n\n return { name, version };\n}\n\n/**\n * Register this in your `instrumentation.ts` to set up axiom.\n * This function stores the tracer's scope information globally to enable Context Propagation\n * and Instrumentation Scope. The tracer will be available across all execution contexts including Next.js.\n *\n * This function is idempotent - calling it multiple times with the same scope has no additional cost.\n *\n * @param config\n * @param config.tracer - The tracer that you are using in your application.\n * @param config.redactionPolicy - Optional redaction policy to control what data is captured in spans.\n */\nexport function initAxiomAI(config: { tracer: Tracer; redactionPolicy?: AxiomAIRedactionPolicy }) {\n const newScope = extractTracerScope(config.tracer);\n const existingScope = (globalThis as any)[AXIOM_AI_SCOPE_KEY] as TracerScope | undefined;\n\n // Check if already initialized with same scope (idempotent behavior)\n if (\n existingScope &&\n existingScope.name === newScope.name &&\n existingScope.version === newScope.version\n ) {\n return;\n }\n\n // Warn about double initialization with different scopes\n if (existingScope) {\n console.warn(\n '[AxiomAI] initAxiomAI() called multiple times with different scopes. ' +\n `Previous: ${existingScope.name}@${existingScope.version}, ` +\n `New: ${newScope.name}@${newScope.version}`,\n );\n }\n\n // Store scope information globally (works across Next.js contexts)\n (globalThis as any)[AXIOM_AI_SCOPE_KEY] = newScope;\n\n // Store redaction policy globally if provided\n if (config.redactionPolicy) {\n (globalThis as any)[AXIOM_AI_REDACTION_KEY] = config.redactionPolicy;\n }\n}\n\n/**\n * Get a tracer using the globally stored scope information\n * Fall back to package.json defaults if not set\n */\nexport function getGlobalTracer(): Tracer {\n // Get stored scope information or fall back to package defaults\n const scope = (globalThis as any)[AXIOM_AI_SCOPE_KEY] as TracerScope | undefined;\n\n // Warn if initAxiomAI was never called\n if (!scope) {\n const isDebug = process.env.AXIOM_DEBUG === 'true';\n if (!isDebug) {\n console.warn(\n '[AxiomAI] AXIOM_AI_SCOPE_KEY is undefined. This probably means that ' +\n 'initAxiomAI() was never called. ' +\n 'Make sure to call initAxiomAI({ tracer }) in your instrumentation setup.',\n );\n }\n }\n\n let { name, version } = scope || { name: packageJson.name, version: packageJson.version };\n\n if (!name || !version) {\n name = packageJson.name;\n version = packageJson.version;\n if (!name || !version) {\n name = 'axiom';\n version = 'unknown';\n }\n }\n\n // Use OpenTelemetry's standard global provider mechanism\n return trace.getTracer(name, version);\n}\n\n/**\n * Reset AxiomAI configuration (useful for testing)\n */\nexport function resetAxiomAI() {\n (globalThis as any)[AXIOM_AI_SCOPE_KEY] = undefined;\n (globalThis as any)[AXIOM_AI_REDACTION_KEY] = undefined;\n}\n","{\n \"name\": \"axiom\",\n \"version\": \"0.44.0\",\n \"type\": \"module\",\n \"author\": \"Axiom, Inc.\",\n \"contributors\": [\n \"Islam Shehata <islam@axiom.co>\",\n \"Chris Ehrlich <chris@axiom.co>\",\n \"Gabriel de Andrade <gabriel@axiom.co>\"\n ],\n \"scripts\": {\n \"dev\": \"tsup --watch\",\n \"build\": \"tsup && chmod +x dist/bin.js && pnpm check:vitest-entrypoints\",\n \"check:vitest-entrypoints\": \"node ./scripts/check-vitest-entrypoints.mjs\",\n \"format\": \"prettier --write .\",\n \"format:check\": \"prettier --check .\",\n \"lint\": \"eslint './**/*.{js,ts}'\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run\",\n \"test:watch\": \"vitest --watch\",\n \"publint\": \"npx publint\"\n },\n \"types\": \"./dist/index.d.ts\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"bin\": {\n \"axiom\": \"./dist/bin.js\"\n },\n \"exports\": {\n \"./ai\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"default\": \"./dist/index.cjs\"\n }\n },\n \"./ai/evals\": {\n \"import\": {\n \"types\": \"./dist/evals.d.ts\",\n \"default\": \"./dist/evals.js\"\n },\n \"require\": {\n \"types\": \"./dist/evals.d.cts\",\n \"default\": \"./dist/evals.cjs\"\n }\n },\n \"./ai/evals/aggregations\": {\n \"import\": {\n \"types\": \"./dist/evals/aggregations.d.ts\",\n \"default\": \"./dist/evals/aggregations.js\"\n },\n \"require\": {\n \"types\": \"./dist/evals/aggregations.d.cts\",\n \"default\": \"./dist/evals/aggregations.cjs\"\n }\n },\n \"./ai/evals/scorers\": {\n \"import\": {\n \"types\": \"./dist/evals/scorers.d.ts\",\n \"default\": \"./dist/evals/scorers.js\"\n },\n \"require\": {\n \"types\": \"./dist/evals/scorers.d.cts\",\n \"default\": \"./dist/evals/scorers.cjs\"\n }\n },\n \"./ai/evals/online\": {\n \"import\": {\n \"types\": \"./dist/evals/online.d.ts\",\n \"default\": \"./dist/evals/online.js\"\n },\n \"require\": {\n \"types\": \"./dist/evals/online.d.cts\",\n \"default\": \"./dist/evals/online.cjs\"\n }\n },\n \"./ai/config\": {\n \"import\": {\n \"types\": \"./dist/config.d.ts\",\n \"default\": \"./dist/config.js\"\n },\n \"require\": {\n \"types\": \"./dist/config.d.cts\",\n \"default\": \"./dist/config.cjs\"\n }\n },\n \"./ai/feedback\": {\n \"import\": {\n \"types\": \"./dist/feedback.d.ts\",\n \"default\": \"./dist/feedback.js\"\n },\n \"require\": {\n \"types\": \"./dist/feedback.d.cts\",\n \"default\": \"./dist/feedback.cjs\"\n }\n }\n },\n \"keywords\": [\n \"axiom\",\n \"logging\",\n \"ai\",\n \"otel\",\n \"opentelemetry\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/axiomhq/ai.git\",\n \"directory\": \"packages/ai\"\n },\n \"license\": \"MIT\",\n \"dependencies\": {\n \"@next/env\": \"^15.4.2\",\n \"@opentelemetry/auto-instrumentations-node\": \"^0.60.1\",\n \"@opentelemetry/context-async-hooks\": \"^2.0.1\",\n \"@opentelemetry/exporter-trace-otlp-http\": \"^0.202.0\",\n \"@opentelemetry/resources\": \"^2.0.1\",\n \"@opentelemetry/sdk-trace-node\": \"^2.0.1\",\n \"@opentelemetry/semantic-conventions\": \"^1.38.0\",\n \"@sinclair/typebox\": \"^0.34.37\",\n \"c12\": \"^3.3.3\",\n \"commander\": \"^14.0.0\",\n \"defu\": \"^6.1.4\",\n \"handlebars\": \"^4.7.8\",\n \"nanoid\": \"^5.1.5\",\n \"open\": \"^10.1.0\",\n \"vite-tsconfig-paths\": \"^5.1.4\",\n \"vitest\": \"^4.0.0\"\n },\n \"peerDependencies\": {\n \"@opentelemetry/api\": \"^1.9.0\",\n \"zod\": \"^3.25.0 || ^4.0.0\"\n },\n \"devDependencies\": {\n \"@ai-sdk/anthropicv1\": \"npm:@ai-sdk/anthropic@^1.2.12\",\n \"@ai-sdk/anthropicv2\": \"npm:@ai-sdk/anthropic@^2.0.57\",\n \"@ai-sdk/anthropicv3\": \"npm:@ai-sdk/anthropic@^3.0.9\",\n \"@ai-sdk/openaiv1\": \"npm:@ai-sdk/openai@^1.3.24\",\n \"@ai-sdk/openaiv2\": \"npm:@ai-sdk/openai@^2.0.88\",\n \"@ai-sdk/openaiv3\": \"npm:@ai-sdk/openai@^3.0.7\",\n \"@ai-sdk/providerv1\": \"npm:@ai-sdk/provider@^1.1.3\",\n \"@ai-sdk/providerv2\": \"npm:@ai-sdk/provider@^2.0.1\",\n \"@ai-sdk/providerv3\": \"npm:@ai-sdk/provider@^3.0.2\",\n \"@opentelemetry/api\": \"^1.9.0\",\n \"@opentelemetry/core\": \"^2.0.1\",\n \"@opentelemetry/sdk-trace-base\": \"^2.0.1\",\n \"@opentelemetry/sdk-trace-node\": \"^2.0.1\",\n \"@repo/eslint-config\": \"workspace:*\",\n \"@types/node\": \"^22.15.29\",\n \"@vitest/coverage-v8\": \"^4.0.0\",\n \"aiv4\": \"npm:ai@^4.3.19\",\n \"aiv5\": \"npm:ai@^5.0.118\",\n \"aiv6\": \"npm:ai@^6.0.6\",\n \"esbuild\": \"^0.25.8\",\n \"eslint\": \"catalog:\",\n \"msw\": \"^2.12.2\",\n \"prettier\": \"catalog:\",\n \"tinyrainbow\": \"^2.0.0\",\n \"tsup\": \"catalog:\",\n \"typescript\": \"catalog:\",\n \"vitest\": \"catalog:\",\n \"zod\": \"catalog:\"\n },\n \"files\": [\n \"dist\"\n ],\n \"packageManager\": \"pnpm@10.16.1\"\n}\n","import { context, propagation, type Baggage, type Span } from '@opentelemetry/api';\nimport { WITHSPAN_REDACTION_POLICY_KEY } from '../withSpanBaggageKey';\n\ntype CaptureMessageContent = 'full' | 'off';\n\nexport type AxiomAIRedactionPolicy = {\n captureMessageContent?: CaptureMessageContent;\n mirrorToolPayloadOnToolSpan?: boolean;\n};\n\nexport const RedactionPolicy = {\n /**\n * Includes message content on chat spans, and mirrors tool\n * payload on tool spans for more convenient querying.\n */\n AxiomDefault: {\n captureMessageContent: 'full',\n mirrorToolPayloadOnToolSpan: true,\n },\n /**\n * Redacts message content on chat spans, and does not put\n * tool payload on tool spans.\n */\n OpenTelemetryDefault: {\n captureMessageContent: 'off',\n mirrorToolPayloadOnToolSpan: false,\n },\n} as const satisfies Record<string, AxiomAIRedactionPolicy>;\n\n// Global key to store redaction policy across all execution contexts\nexport const AXIOM_AI_REDACTION_KEY = Symbol.for('__axiom_ai_redaction__');\n\n/**\n * Get the globally stored redaction policy\n * @returns The global redaction policy or undefined if not set\n */\nfunction getGlobalRedactionPolicy(): AxiomAIRedactionPolicy | undefined {\n return (globalThis as any)[AXIOM_AI_REDACTION_KEY];\n}\n\n/**\n * Resolves the effective redaction policy by merging global and per-call policies.\n * Per-call policies take precedence over global policies.\n *\n * @param globalPolicy - The global redaction policy from initAxiomAI\n * @param localPolicy - The per-call redaction policy from withSpan or middleware\n * @returns The effective redaction policy with all fields resolved\n */\nfunction getEffectiveRedactionPolicy(\n globalPolicy?: AxiomAIRedactionPolicy,\n localPolicy?: AxiomAIRedactionPolicy,\n): AxiomAIRedactionPolicy {\n // Per-call policy overrides global policy, with defaults\n return {\n captureMessageContent:\n localPolicy?.captureMessageContent ??\n globalPolicy?.captureMessageContent ??\n RedactionPolicy.AxiomDefault.captureMessageContent,\n mirrorToolPayloadOnToolSpan:\n localPolicy?.mirrorToolPayloadOnToolSpan ??\n globalPolicy?.mirrorToolPayloadOnToolSpan ??\n RedactionPolicy.AxiomDefault.mirrorToolPayloadOnToolSpan,\n };\n}\n\n/**\n * Get the active redaction policy\n */\nexport function getRedactionPolicy() {\n return getEffectiveRedactionPolicy(getGlobalRedactionPolicy(), getPerCallRedactionPolicy());\n}\n\n/**\n * Conditionally sets a span attribute based on the capture message content policy.\n * When policy is 'off', the attribute is not set at all.\n *\n * @param span - The OpenTelemetry span to set the attribute on\n * @param attribute - The attribute name/key\n * @param value - The attribute value\n * @param captureMessageContent - The capture policy ('full' sets attribute, 'off' skips it)\n */\nexport function handleMaybeRedactedAttribute(\n span: Span,\n attribute: string,\n value: any,\n captureMessageContent?: CaptureMessageContent,\n): void {\n if (captureMessageContent === 'full') {\n span.setAttribute(attribute, value);\n }\n\n // For 'off', don't set the attribute at all\n // Future: Could add callback-based redaction here\n}\n\n/**\n * Extracts the per-call redaction policy from OpenTelemetry baggage context.\n * This allows middleware and tools to access redaction policies passed via withSpan.\n *\n * @returns The per-call redaction policy or undefined if not set\n */\nfunction getPerCallRedactionPolicy(): AxiomAIRedactionPolicy | undefined {\n const baggage: Baggage = propagation.getBaggage(context.active()) || propagation.createBaggage();\n const serializedPolicy = baggage.getEntry(WITHSPAN_REDACTION_POLICY_KEY)?.value;\n\n if (!serializedPolicy) {\n return undefined;\n }\n\n try {\n return JSON.parse(serializedPolicy) as AxiomAIRedactionPolicy;\n } catch (error) {\n console.warn('[AxiomAI] Failed to parse redaction policy from baggage:', error);\n return undefined;\n }\n}\n","/**\n * We need a way to know that we're inside `withSpan`\n * Because we don't own `generateText` and similar functions,\n * we use OTel Baggage to propagate this information. Another\n * consideration might be to use AsyncLocalStorage in Node and\n * some kind of KV in workerd.\n */\nexport const WITHSPAN_BAGGAGE_KEY = '__withspan_gen_ai_call';\nexport const WITHSPAN_REDACTION_POLICY_KEY = '__withspan_redaction_policy';\n","import { type LanguageModelV1 } from '@ai-sdk/providerv1';\nimport { type LanguageModelV2 } from '@ai-sdk/providerv2';\nimport { type LanguageModelV3 } from '@ai-sdk/providerv3';\n\nimport { AxiomWrappedLanguageModelV1, isLanguageModelV1 } from './AxiomWrappedLanguageModelV1';\nimport { AxiomWrappedLanguageModelV2, isLanguageModelV2 } from './AxiomWrappedLanguageModelV2';\nimport { AxiomWrappedLanguageModelV3, isLanguageModelV3 } from './AxiomWrappedLanguageModelV3';\n\n/**\n * Wraps an AI SDK model to provide OpenTelemetry instrumentation.\n *\n * Supports AI SDK v4 (LanguageModelV1), v5 (LanguageModelV2) and v6 (LanguageModelV3) models.\n *\n * @param model - Language model implementing LanguageModelV1, LanguageModelV2 or LanguageModelV3 interface\n * @returns Wrapped model with identical interface but added instrumentation\n */\nexport function wrapAISDKModel<T extends LanguageModelV1 | LanguageModelV2 | LanguageModelV3>(\n model: T,\n): T {\n if (isLanguageModelV3(model)) {\n return new AxiomWrappedLanguageModelV3(model) as never as T;\n } else if (isLanguageModelV2(model)) {\n return new AxiomWrappedLanguageModelV2(model) as never as T;\n } else if (isLanguageModelV1(model)) {\n return new AxiomWrappedLanguageModelV1(model) as never as T;\n } else {\n console.warn('Unsupported AI SDK model. Not wrapping.');\n return model;\n }\n}\n","import { type LanguageModelV1, type LanguageModelV1CallOptions } from '@ai-sdk/providerv1';\nimport { axiomAIMiddlewareV1 } from './middleware';\n\nexport function isLanguageModelV1(model: unknown): model is LanguageModelV1 {\n return (\n model != null &&\n typeof model === 'object' &&\n 'specificationVersion' in model &&\n 'provider' in model &&\n 'modelId' in model &&\n (model as any).specificationVersion === 'v1' &&\n typeof (model as any).provider === 'string' &&\n typeof (model as any).modelId === 'string'\n );\n}\n\n/**\n * Wraps a LanguageModelV1 to provide OpenTelemetry instrumentation.\n *\n * Internally uses Axiom's telemetry middleware while maintaining a simple class-based API.\n *\n * @example\n * ```typescript\n * import { AxiomWrappedLanguageModelV1 } from '@axiom/ai';\n * import { openai } from '@ai-sdk/openai';\n *\n * const model = new AxiomWrappedLanguageModelV1(openai('gpt-3.5-turbo'));\n * ```\n *\n * For advanced use cases, you can also use the middleware directly:\n * ```typescript\n * import { wrapLanguageModel } from 'ai';\n * import { createAxiomTelemetryV1 } from '@axiom/ai';\n *\n * const model = wrapLanguageModel({\n * model: yourV1Model,\n * middleware: createAxiomTelemetryV1(),\n * });\n * ```\n */\nexport class AxiomWrappedLanguageModelV1 {\n constructor(model: LanguageModelV1) {\n const middleware = axiomAIMiddlewareV1();\n\n // Return the wrapped model directly from constructor\n return {\n specificationVersion: model.specificationVersion,\n provider: model.provider,\n modelId: model.modelId,\n defaultObjectGenerationMode: model.defaultObjectGenerationMode,\n supportsImageUrls: model.supportsImageUrls,\n supportsStructuredOutputs: model.supportsStructuredOutputs,\n supportsUrl: model.supportsUrl?.bind(model),\n\n doGenerate: async (params: LanguageModelV1CallOptions) => {\n return middleware.wrapGenerate!({\n doGenerate: () => model.doGenerate(params),\n doStream: () => model.doStream(params),\n params,\n model,\n });\n },\n\n doStream: async (params: LanguageModelV1CallOptions) => {\n return middleware.wrapStream!({\n doGenerate: () => model.doGenerate(params),\n doStream: () => model.doStream(params),\n params,\n model,\n });\n },\n } as LanguageModelV1;\n }\n}\n","import {\n type LanguageModelV1,\n type LanguageModelV1CallOptions,\n type LanguageModelV1Prompt,\n type LanguageModelV1StreamPart,\n} from '@ai-sdk/providerv1';\nimport {\n type LanguageModelV2,\n type LanguageModelV2CallOptions,\n type LanguageModelV2Middleware,\n type LanguageModelV2StreamPart,\n type LanguageModelV2Content,\n type LanguageModelV2ToolCall,\n type LanguageModelV2Usage,\n type LanguageModelV2ResponseMetadata,\n type LanguageModelV2FinishReason,\n type LanguageModelV2Prompt,\n} from '@ai-sdk/providerv2';\nimport {\n type LanguageModelV3,\n type LanguageModelV3CallOptions,\n type LanguageModelV3Middleware,\n type LanguageModelV3StreamPart,\n type LanguageModelV3Content,\n type LanguageModelV3ToolCall,\n type LanguageModelV3Usage,\n type LanguageModelV3ResponseMetadata,\n type LanguageModelV3FinishReason,\n type LanguageModelV3Prompt,\n} from '@ai-sdk/providerv3';\nimport { type LanguageModelV1Middleware } from 'aiv4';\n\nimport { type Span } from '@opentelemetry/api';\nimport { Attr } from './semconv/attributes';\nimport { createSimpleCompletion } from './completionUtils';\nimport {\n appendToolCalls,\n extractToolResultsFromPromptV2,\n extractToolResultsFromPromptV3,\n extractToolResultsFromRawPrompt,\n} from '../util/promptUtils';\nimport { sanitizeMultimodalContent } from './utils/contentSanitizer';\nimport {\n setScopeAttributes,\n setBaseAttributes,\n setRequestParameterAttributes,\n withSpanHandling,\n determineOutputTypeV1,\n determineOutputTypeV2,\n determineOutputTypeV3,\n classifyToolError,\n createStreamChildSpan,\n ensureNumber,\n type GenAiSpanContextV1,\n type GenAiSpanContextV2,\n type GenAiSpanContextV3,\n} from './utils/wrapperUtils';\nimport {\n promptV1ToOpenAI,\n promptV2ToOpenAI,\n promptV3ToOpenAI,\n normalizeV1ToolCalls,\n normalizeV2ToolCalls,\n normalizeV3ToolCalls,\n} from './utils/normalized';\nimport {\n ToolCallAggregator,\n TextAggregator,\n StreamStats,\n ToolCallAggregatorV2,\n TextAggregatorV2,\n StreamStatsV2,\n ToolCallAggregatorV3,\n TextAggregatorV3,\n StreamStatsV3,\n} from './streaming/aggregators';\nimport type { AxiomPromptMetadata } from '../types/metadata';\nimport { getRedactionPolicy, handleMaybeRedactedAttribute } from './utils/redaction';\n\nexport interface AxiomTelemetryConfig {\n // Future configuration options can be added here\n}\n\nconst appendPromptMetadataToSpan = (\n span: Span,\n messages: LanguageModelV1Prompt | LanguageModelV2Prompt | LanguageModelV3Prompt,\n) => {\n const lastMessage = messages?.[messages.length - 1];\n\n let axiomMeta: AxiomPromptMetadata | undefined;\n\n if ('providerMetadata' in lastMessage) {\n axiomMeta = lastMessage?.providerMetadata?._axiomMeta as AxiomPromptMetadata | undefined;\n } else if ('providerOptions' in lastMessage) {\n axiomMeta = lastMessage?.providerOptions?._axiomMeta as AxiomPromptMetadata | undefined;\n }\n\n if (axiomMeta) {\n if (axiomMeta.id) span.setAttribute(Attr.GenAI.PromptMetadata.ID, axiomMeta.id);\n if (axiomMeta.name) span.setAttribute(Attr.GenAI.PromptMetadata.Name, axiomMeta.name);\n if (axiomMeta.slug) span.setAttribute(Attr.GenAI.PromptMetadata.Slug, axiomMeta.slug);\n if (axiomMeta.version) span.setAttribute(Attr.GenAI.PromptMetadata.Version, axiomMeta.version);\n }\n};\n\n/**\n * Creates Axiom telemetry middleware for LanguageModelV1\n */\nexport function axiomAIMiddlewareV1(/* _config?: AxiomTelemetryConfig */): LanguageModelV1Middleware {\n return {\n wrapGenerate: async ({ doGenerate, params, model }) => {\n return withSpanHandling(\n model.modelId,\n async (span, commonContext, _lease) => {\n const context = commonContext as GenAiSpanContextV1;\n\n appendPromptMetadataToSpan(span, params.prompt);\n\n // Pre-call setup\n setScopeAttributes(span);\n setPreCallAttributesV1(span, params, context, model);\n\n const res = await doGenerate();\n\n // Store rawCall data in context for access in post-call processing\n context.rawCall = res.rawCall as { rawPrompt?: any[]; rawSettings?: any };\n\n // Post-call processing\n await setPostCallAttributesV1(span, res, context, model);\n\n return res;\n },\n { version: 'v1' },\n );\n },\n\n wrapStream: async ({ doStream, params, model }) => {\n return withSpanHandling(\n model.modelId,\n async (span, commonContext, lease) => {\n const context = commonContext as GenAiSpanContextV1;\n\n appendPromptMetadataToSpan(span, params.prompt);\n\n // Pre-call setup\n setScopeAttributes(span);\n setPreCallAttributesV1(span, params, context, model);\n\n const { stream, ...head } = await doStream();\n\n // Create child span for stream processing (provides granular visibility)\n const childSpan = createStreamChildSpan(span, `chat ${model.modelId} stream`);\n\n const stats = new StreamStats();\n const toolAggregator = new ToolCallAggregator();\n const textAggregator = new TextAggregator();\n\n return {\n ...head,\n stream: stream.pipeThrough(\n new TransformStream({\n transform(chunk: LanguageModelV1StreamPart, controller) {\n try {\n stats.feed(chunk);\n toolAggregator.handleChunk(chunk);\n textAggregator.feed(chunk);\n\n controller.enqueue(chunk);\n } catch (err) {\n classifyToolError(err, childSpan);\n childSpan.end();\n if (lease.owned) lease.end();\n controller.error(err);\n }\n },\n async flush(controller) {\n try {\n await setPostCallAttributesV1(\n span,\n {\n ...head,\n ...stats.result,\n toolCalls:\n toolAggregator.result.length > 0 ? toolAggregator.result : undefined,\n text: textAggregator.text,\n },\n context,\n model,\n );\n\n childSpan.end();\n if (lease.owned) lease.end();\n controller.terminate();\n } catch (err) {\n classifyToolError(err, childSpan);\n childSpan.end();\n if (lease.owned) lease.end();\n controller.error(err);\n }\n },\n }),\n ),\n };\n },\n { streaming: true, version: 'v1' }, // Don't auto-end span, we'll end it when stream completes\n );\n },\n };\n}\n\n/**\n * Creates unified Axiom telemetry middleware that works with V1, V2 and V3 models\n */\nexport function axiomAIMiddleware(config: { model: LanguageModelV1 }): LanguageModelV1Middleware;\nexport function axiomAIMiddleware(config: { model: LanguageModelV2 }): LanguageModelV2Middleware;\nexport function axiomAIMiddleware(config: { model: LanguageModelV3 }): LanguageModelV3Middleware;\nexport function axiomAIMiddleware(config: {\n model: LanguageModelV1 | LanguageModelV2 | LanguageModelV3;\n}) {\n if (config.model.specificationVersion === 'v1') {\n return axiomAIMiddlewareV1();\n } else if (config.model.specificationVersion === 'v2') {\n return axiomAIMiddlewareV2();\n } else if (config.model.specificationVersion === 'v3') {\n return axiomAIMiddlewareV3();\n } else {\n console.warn(\n // @ts-expect-error - not allowed at type level, but users can still do it...\n `Unsupported model specification version: ${JSON.stringify(config.model.specificationVersion)}. Creating no-op middleware instead.`,\n );\n return {};\n }\n}\n\n/**\n * Creates Axiom telemetry middleware for LanguageModelV2\n */\nexport function axiomAIMiddlewareV2(/* _config?: AxiomTelemetryConfig */): LanguageModelV2Middleware {\n return {\n wrapGenerate: async ({ doGenerate, params, model }) => {\n return withSpanHandling(\n model.modelId,\n async (span, commonContext, _lease) => {\n const context = commonContext as GenAiSpanContextV2;\n\n appendPromptMetadataToSpan(span, params.prompt);\n\n // Pre-call setup\n setScopeAttributes(span);\n setPreCallAttributesV2(span, params, context, model);\n\n const res = await doGenerate();\n\n // Post-call processing\n await setPostCallAttributesV2(span, res, context, model);\n\n return res;\n },\n { version: 'v2' },\n );\n },\n\n wrapStream: async ({ doStream, params, model }) => {\n return withSpanHandling(\n model.modelId,\n async (span, commonContext, lease) => {\n const context = commonContext as GenAiSpanContextV2;\n\n appendPromptMetadataToSpan(span, params.prompt);\n\n // Pre-call setup\n setScopeAttributes(span);\n setPreCallAttributesV2(span, params, context, model);\n\n const ret = await doStream();\n\n // Create child span for stream processing (provides granular visibility)\n const childSpan = createStreamChildSpan(span, `chat ${model.modelId} stream`);\n\n const stats = new StreamStatsV2();\n const toolAggregator = new ToolCallAggregatorV2();\n const textAggregator = new TextAggregatorV2();\n\n return {\n ...ret,\n stream: ret.stream.pipeThrough(\n new TransformStream({\n transform(chunk: LanguageModelV2StreamPart, controller) {\n try {\n stats.feed(chunk);\n toolAggregator.handleChunk(chunk);\n textAggregator.feed(chunk);\n\n controller.enqueue(chunk);\n } catch (err) {\n classifyToolError(err, childSpan);\n childSpan.end();\n if (lease.owned) lease.end();\n controller.error(err);\n }\n },\n async flush(controller) {\n try {\n const streamResult = {\n ...stats.result,\n content: [\n ...(textAggregator.text\n ? [{ type: 'text' as const, text: textAggregator.text }]\n : []),\n ...toolAggregator.result,\n ],\n };\n\n await setPostCallAttributesV2(span, streamResult, context, model);\n\n childSpan.end();\n if (lease.owned) lease.end();\n controller.terminate();\n } catch (err) {\n classifyToolError(err, childSpan);\n childSpan.end();\n if (lease.owned) lease.end();\n controller.error(err);\n }\n },\n }),\n ),\n };\n },\n { streaming: true, version: 'v2' }, // Don't auto-end span, we'll end it when stream completes\n );\n },\n };\n}\n\n// V1 helper functions (extracted from AxiomWrappedLanguageModelV1)\nfunction setPreCallAttributesV1(\n span: Span,\n options: LanguageModelV1CallOptions,\n context: GenAiSpanContextV1,\n model: LanguageModelV1,\n) {\n const redactionPolicy = getRedactionPolicy();\n\n const {\n prompt,\n maxTokens,\n frequencyPenalty,\n presencePenalty,\n temperature,\n topP,\n topK,\n seed,\n stopSequences,\n responseFormat,\n mode,\n } = options;\n\n // Set prompt attributes (full conversation history)\n const processedPrompt = promptV1ToOpenAI(prompt);\n context.originalPrompt = processedPrompt;\n\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Input.Messages,\n JSON.stringify(sanitizeMultimodalContent(processedPrompt)),\n redactionPolicy.captureMessageContent,\n );\n\n setBaseAttributes(span, model.provider, model.modelId);\n\n const outputType = determineOutputTypeV1({ responseFormat, mode });\n if (outputType) {\n span.setAttribute(Attr.GenAI.Output.Type, outputType);\n }\n\n setRequestParameterAttributes(span, {\n maxTokens,\n frequencyPenalty,\n presencePenalty,\n temperature,\n topP,\n topK,\n seed,\n stopSequences,\n });\n}\n\nasync function setPostCallAttributesV1(\n span: Span,\n result: any,\n context: GenAiSpanContextV1,\n _model: LanguageModelV1,\n) {\n const redactionPolicy = getRedactionPolicy();\n\n // Update prompt to include tool calls and tool results if they exist\n if (result.toolCalls && result.toolCalls.length > 0) {\n const originalPrompt = context.originalPrompt || [];\n\n // Normalize the tool calls to the common format\n const normalizedToolCalls = normalizeV1ToolCalls(result.toolCalls);\n\n // Note: rawCall might not be available in middleware, handle gracefully\n const toolResultsMap = context.rawCall?.rawPrompt\n ? extractToolResultsFromRawPrompt(context.rawCall.rawPrompt as any[])\n : new Map();\n\n const updatedPrompt = appendToolCalls(\n originalPrompt,\n normalizedToolCalls,\n toolResultsMap,\n result.text,\n );\n\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Input.Messages,\n JSON.stringify(sanitizeMultimodalContent(updatedPrompt)),\n redactionPolicy.captureMessageContent,\n );\n }\n\n // Create simple completion array with just assistant text\n if (result.text) {\n const completion = createSimpleCompletion({\n text: result.text,\n });\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Output.Messages,\n JSON.stringify(completion),\n redactionPolicy.captureMessageContent,\n );\n }\n\n if (result.response?.id) {\n span.setAttribute(Attr.GenAI.Response.ID, result.response.id);\n }\n if (result.response?.modelId) {\n span.setAttribute(Attr.GenAI.Response.Model, result.response.modelId);\n }\n\n const inputTokens = ensureNumber(result.usage?.promptTokens);\n if (inputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.InputTokens, inputTokens);\n }\n\n const outputTokens = ensureNumber(result.usage?.completionTokens);\n if (outputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.OutputTokens, outputTokens);\n }\n\n if (result.finishReason) {\n span.setAttribute(Attr.GenAI.Response.FinishReasons, JSON.stringify([result.finishReason]));\n }\n}\n\n// V2 helper functions (extracted from AxiomWrappedLanguageModelV2)\nfunction setPreCallAttributesV2(\n span: Span,\n options: LanguageModelV2CallOptions,\n context: GenAiSpanContextV2,\n model: LanguageModelV2,\n) {\n const redactionPolicy = getRedactionPolicy();\n\n setBaseAttributes(span, model.provider, model.modelId);\n\n const outputType = determineOutputTypeV2(options);\n if (outputType) {\n span.setAttribute(Attr.GenAI.Output.Type, outputType);\n }\n\n setRequestParameterAttributes(span, {\n maxTokens: options.maxOutputTokens,\n frequencyPenalty: options.frequencyPenalty,\n presencePenalty: options.presencePenalty,\n temperature: options.temperature,\n topP: options.topP,\n topK: options.topK,\n seed: options.seed,\n stopSequences: options.stopSequences,\n });\n\n const processedPrompt = promptV2ToOpenAI(options.prompt);\n\n // Store both the original V2 prompt and processed prompt for later use\n context.originalV2Prompt = options.prompt;\n context.originalPrompt = processedPrompt;\n\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Input.Messages,\n JSON.stringify(sanitizeMultimodalContent(processedPrompt)),\n redactionPolicy.captureMessageContent,\n );\n}\n\nasync function setPostCallAttributesV2(\n span: Span,\n result: {\n response?: LanguageModelV2ResponseMetadata;\n finishReason?: LanguageModelV2FinishReason;\n usage?: LanguageModelV2Usage;\n content?: Array<LanguageModelV2Content>;\n },\n context: GenAiSpanContextV2,\n _model: LanguageModelV2,\n) {\n const redactionPolicy = getRedactionPolicy();\n\n // Check if we have tool calls in this response\n const toolCalls = result.content?.filter(\n (c) => c.type === 'tool-call',\n ) as LanguageModelV2ToolCall[];\n\n // Only set response metadata once per span to prevent overwriting when generateText() makes multiple calls\n const alreadySet = (span as any).attributes?.[Attr.GenAI.Response.FinishReasons] !== undefined;\n\n if (!alreadySet) {\n if (result.response?.id) {\n span.setAttribute(Attr.GenAI.Response.ID, result.response.id);\n }\n if (result.response?.modelId) {\n span.setAttribute(Attr.GenAI.Response.Model, result.response.modelId);\n }\n\n const inputTokens = ensureNumber(result.usage?.inputTokens);\n if (inputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.InputTokens, inputTokens);\n }\n\n const outputTokens = ensureNumber(result.usage?.outputTokens);\n if (outputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.OutputTokens, outputTokens);\n }\n }\n\n // Update prompt to include tool calls and tool results if they exist\n if (toolCalls && toolCalls.length > 0) {\n const originalPrompt = context.originalPrompt || [];\n\n const normalizedToolCalls = normalizeV2ToolCalls(toolCalls);\n\n // Extract real tool results from the original V2 prompt structure\n const toolResultsMap = extractToolResultsFromPromptV2(context.originalV2Prompt || []);\n\n // Extract assistant text content from the response\n const textContent = result.content?.find((c) => c.type === 'text');\n const assistantText = textContent?.type === 'text' ? textContent.text : undefined;\n\n // Use the standard prompt utility to append tool calls\n const updatedPrompt = appendToolCalls(\n originalPrompt,\n normalizedToolCalls,\n toolResultsMap,\n assistantText,\n );\n\n // Update the prompt attribute with the complete conversation history\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Input.Messages,\n JSON.stringify(sanitizeMultimodalContent(updatedPrompt)),\n redactionPolicy.captureMessageContent,\n );\n }\n\n // Process tool calls and create child spans\n if (result.content && result.content.length > 0) {\n await processToolCallsAndCreateSpansV2(span, result.content);\n } else if (result.finishReason) {\n // For non-tool responses, still create completion array\n const completion = createSimpleCompletion({\n text: '',\n });\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Output.Messages,\n JSON.stringify(completion),\n redactionPolicy.captureMessageContent,\n );\n }\n\n // Store finish reason separately as per semantic conventions (only on first call to prevent overwriting)\n if (result.finishReason && !alreadySet) {\n span.setAttribute(Attr.GenAI.Response.FinishReasons, JSON.stringify([result.finishReason]));\n }\n}\n\nasync function processToolCallsAndCreateSpansV2(\n parentSpan: Span,\n content: Array<LanguageModelV2Content>,\n): Promise<void> {\n const redactionPolicy = getRedactionPolicy();\n\n // Extract text and tool calls from content\n const textContent = content.find((c) => c.type === 'text');\n const assistantText = textContent?.type === 'text' ? textContent.text : undefined;\n const toolCalls = content.filter((c) => c.type === 'tool-call') as LanguageModelV2ToolCall[];\n\n // Only set completion for final responses without tool calls\n if (toolCalls.length === 0) {\n // Create completion with multimodal content support\n const completion = [\n {\n role: 'assistant' as const,\n content: sanitizeMultimodalContent(\n content.length === 1 && assistantText ? assistantText : content,\n ),\n },\n ];\n\n // Set completion array as span attribute\n handleMaybeRedactedAttribute(\n parentSpan,\n Attr.GenAI.Output.Messages,\n JSON.stringify(completion),\n redactionPolicy.captureMessageContent,\n );\n }\n}\n\n/**\n * Creates Axiom telemetry middleware for LanguageModelV3\n */\nexport function axiomAIMiddlewareV3(/* _config?: AxiomTelemetryConfig */): LanguageModelV3Middleware {\n return {\n specificationVersion: 'v3',\n\n wrapGenerate: async ({ doGenerate, params, model }) => {\n return withSpanHandling(\n model.modelId,\n async (span, commonContext, _lease) => {\n const context = commonContext as GenAiSpanContextV3;\n\n appendPromptMetadataToSpan(span, params.prompt);\n\n // Pre-call setup\n setScopeAttributes(span);\n setPreCallAttributesV3(span, params, context, model);\n\n const res = await doGenerate();\n\n // Post-call processing\n await setPostCallAttributesV3(span, res, context, model);\n\n return res;\n },\n { version: 'v3' },\n );\n },\n\n wrapStream: async ({ doStream, params, model }) => {\n return withSpanHandling(\n model.modelId,\n async (span, commonContext, lease) => {\n const context = commonContext as GenAiSpanContextV3;\n\n appendPromptMetadataToSpan(span, params.prompt);\n\n // Pre-call setup\n setScopeAttributes(span);\n setPreCallAttributesV3(span, params, context, model);\n\n const ret = await doStream();\n\n // Create child span for stream processing (provides granular visibility)\n const childSpan = createStreamChildSpan(span, `chat ${model.modelId} stream`);\n\n const stats = new StreamStatsV3();\n const toolAggregator = new ToolCallAggregatorV3();\n const textAggregator = new TextAggregatorV3();\n\n return {\n ...ret,\n stream: ret.stream.pipeThrough(\n new TransformStream({\n transform(chunk: LanguageModelV3StreamPart, controller) {\n try {\n stats.feed(chunk);\n toolAggregator.handleChunk(chunk);\n textAggregator.feed(chunk);\n\n controller.enqueue(chunk);\n } catch (err) {\n classifyToolError(err, childSpan);\n childSpan.end();\n if (lease.owned) lease.end();\n controller.error(err);\n }\n },\n async flush(controller) {\n try {\n const statsResult = stats.result;\n\n await setPostCallAttributesV3(\n span,\n {\n response: statsResult.response,\n finishReason: statsResult.finishReason,\n usage: statsResult.usage,\n content:\n toolAggregator.result.length > 0\n ? toolAggregator.result\n : textAggregator.text\n ? [{ type: 'text' as const, text: textAggregator.text }]\n : [],\n warnings: [],\n },\n context,\n model,\n );\n\n childSpan.end();\n if (lease.owned) lease.end();\n controller.terminate();\n } catch (err) {\n classifyToolError(err, childSpan);\n childSpan.end();\n if (lease.owned) lease.end();\n controller.error(err);\n }\n },\n }),\n ),\n };\n },\n { streaming: true, version: 'v3' },\n );\n },\n };\n}\n\n// V3 helper functions\nfunction setPreCallAttributesV3(\n span: Span,\n options: LanguageModelV3CallOptions,\n context: GenAiSpanContextV3,\n model: LanguageModelV3,\n) {\n const redactionPolicy = getRedactionPolicy();\n\n setBaseAttributes(span, model.provider, model.modelId);\n\n const outputType = determineOutputTypeV3(options);\n if (outputType) {\n span.setAttribute(Attr.GenAI.Output.Type, outputType);\n }\n\n setRequestParameterAttributes(span, {\n maxTokens: options.maxOutputTokens,\n frequencyPenalty: options.frequencyPenalty,\n presencePenalty: options.presencePenalty,\n temperature: options.temperature,\n topP: options.topP,\n topK: options.topK,\n seed: options.seed,\n stopSequences: options.stopSequences,\n });\n\n const processedPrompt = promptV3ToOpenAI(options.prompt);\n\n // Store both the original V3 prompt and processed prompt for later use\n context.originalV3Prompt = options.prompt;\n context.originalPrompt = processedPrompt;\n\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Input.Messages,\n JSON.stringify(sanitizeMultimodalContent(processedPrompt)),\n redactionPolicy.captureMessageContent,\n );\n}\n\nasync function setPostCallAttributesV3(\n span: Span,\n result: {\n response?: LanguageModelV3ResponseMetadata;\n finishReason?: LanguageModelV3FinishReason;\n usage?: LanguageModelV3Usage;\n content?: Array<LanguageModelV3Content>;\n warnings: Array<unknown>;\n },\n context: GenAiSpanContextV3,\n _model: LanguageModelV3,\n) {\n const redactionPolicy = getRedactionPolicy();\n\n // Check if we have tool calls in this response\n const toolCalls = result.content?.filter(\n (c) => c.type === 'tool-call',\n ) as LanguageModelV3ToolCall[];\n\n // Only set response metadata once per span to prevent overwriting when generateText() makes multiple calls\n const alreadySet = (span as any).attributes?.[Attr.GenAI.Response.FinishReasons] !== undefined;\n\n if (!alreadySet) {\n if (result.response?.id) {\n span.setAttribute(Attr.GenAI.Response.ID, result.response.id);\n }\n if (result.response?.modelId) {\n span.setAttribute(Attr.GenAI.Response.Model, result.response.modelId);\n }\n\n // V3 has structured token usage - extract totals for OTel attributes\n // TODO: When OTel semantic conventions add support for cached/reasoning tokens,\n // add these attributes:\n // - result.usage?.inputTokens.cacheRead -> gen_ai.usage.cache_read_tokens (or similar)\n // - result.usage?.inputTokens.cacheWrite -> gen_ai.usage.cache_write_tokens (or similar)\n // - result.usage?.inputTokens.noCache -> gen_ai.usage.no_cache_tokens (or similar)\n // - result.usage?.outputTokens.reasoning -> gen_ai.usage.reasoning_tokens (or similar)\n // - result.usage?.outputTokens.text -> gen_ai.usage.text_tokens (or similar)\n // Access: result.usage?.inputTokens.cacheRead, result.usage?.outputTokens.reasoning, etc.\n const inputTokens = ensureNumber(result.usage?.inputTokens?.total);\n if (inputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.InputTokens, inputTokens);\n }\n\n const outputTokens = ensureNumber(result.usage?.outputTokens?.total);\n if (outputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.OutputTokens, outputTokens);\n }\n }\n\n // Update prompt to include tool calls and tool results if they exist\n if (toolCalls && toolCalls.length > 0) {\n const originalPrompt = context.originalPrompt || [];\n\n const normalizedToolCalls = normalizeV3ToolCalls(toolCalls);\n\n // Extract real tool results from the original V3 prompt structure\n const toolResultsMap = extractToolResultsFromPromptV3(context.originalV3Prompt || []);\n\n // Extract assistant text content from the response\n const textContent = result.content?.find((c) => c.type === 'text');\n const assistantText = textContent?.type === 'text' ? textContent.text : undefined;\n\n // Use the standard prompt utility to append tool calls\n const updatedPrompt = appendToolCalls(\n originalPrompt,\n normalizedToolCalls,\n toolResultsMap,\n assistantText,\n );\n\n // Update the prompt attribute with the complete conversation history\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Input.Messages,\n JSON.stringify(sanitizeMultimodalContent(updatedPrompt)),\n redactionPolicy.captureMessageContent,\n );\n }\n\n // Process content and create completion\n if (result.content && result.content.length > 0) {\n await processToolCallsAndCreateSpansV3(span, result.content);\n } else if (result.finishReason) {\n // For non-tool responses, still create completion array\n const completion = createSimpleCompletion({\n text: '',\n });\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Output.Messages,\n JSON.stringify(completion),\n redactionPolicy.captureMessageContent,\n );\n }\n\n // Store finish reason - V3 uses { unified, raw } structure, use unified for OTel\n // TODO: When OTel adds support for raw finish reasons, consider adding:\n // - result.finishReason.raw -> gen_ai.response.raw_finish_reason (or similar)\n // Access: result.finishReason?.raw\n if (result.finishReason && !alreadySet) {\n span.setAttribute(\n Attr.GenAI.Response.FinishReasons,\n JSON.stringify([result.finishReason.unified]),\n );\n }\n}\n\nasync function processToolCallsAndCreateSpansV3(\n parentSpan: Span,\n content: Array<LanguageModelV3Content>,\n): Promise<void> {\n const redactionPolicy = getRedactionPolicy();\n\n // Extract text and tool calls from content\n const textContent = content.find((c) => c.type === 'text');\n const assistantText = textContent?.type === 'text' ? textContent.text : undefined;\n const toolCalls = content.filter((c) => c.type === 'tool-call') as LanguageModelV3ToolCall[];\n\n // TODO: When OTel adds support for tool approval flow, track these:\n // - tool-approval-request stream parts with approvalId, toolCallId\n // - tool-approval-response parts in tool messages\n // Access: content.filter(c => c.type === 'tool-approval-request')\n // Also track dynamic/providerExecuted flags on tool calls:\n // - toolCall.dynamic -> gen_ai.tool.dynamic (or similar)\n // - toolCall.providerExecuted -> gen_ai.tool.provider_executed (or similar)\n\n // Only set completion for final responses without tool calls\n if (toolCalls.length === 0) {\n // Create completion with multimodal content support\n // Filter out V3-specific content types that aren't text\n const sanitizableContent = content.filter(\n (c) =>\n c.type === 'text' ||\n c.type === 'reasoning' ||\n c.type === 'file' ||\n c.type === 'source' ||\n c.type === 'tool-result',\n );\n\n const completion = [\n {\n role: 'assistant' as const,\n content: sanitizeMultimodalContent(\n sanitizableContent.length === 1 && assistantText ? assistantText : sanitizableContent,\n ),\n },\n ];\n\n // Set completion array as span attribute\n handleMaybeRedactedAttribute(\n parentSpan,\n Attr.GenAI.Output.Messages,\n JSON.stringify(completion),\n redactionPolicy.captureMessageContent,\n );\n }\n}\n","import {\n ATTR_ERROR_TYPE,\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n} from '@opentelemetry/semantic-conventions';\n\nimport {\n ATTR_EVAL_CASE_INDEX,\n ATTR_EVAL_CASE_EXPECTED,\n ATTR_EVAL_CASE_INPUT,\n ATTR_EVAL_CASE_OUTPUT,\n ATTR_EVAL_CASE_METADATA,\n ATTR_EVAL_CASE_SCORES,\n ATTR_EVAL_CASE_TRIALS,\n ATTR_EVAL_SCORE_PASSED,\n ATTR_EVAL_SCORE_IS_BOOLEAN,\n ATTR_EVAL_SCORE_VALUE,\n ATTR_EVAL_SCORE_NAME,\n ATTR_EVAL_SCORE_THRESHOLD,\n ATTR_EVAL_SCORE_METADATA,\n ATTR_EVAL_SCORE_AGGREGATION,\n ATTR_EVAL_SCORE_TRIALS,\n ATTR_EVAL_TASK_TYPE,\n ATTR_EVAL_TASK_NAME,\n ATTR_EVAL_TASK_OUTPUT,\n ATTR_EVAL_COLLECTION_NAME,\n ATTR_EVAL_COLLECTION_SIZE,\n ATTR_EVAL_ID,\n ATTR_EVAL_BASELINE_ID,\n ATTR_EVAL_BASELINE_NAME,\n ATTR_EVAL_BASELINE_VERSION,\n ATTR_EVAL_NAME,\n ATTR_EVAL_TAGS,\n ATTR_EVAL_TYPE,\n ATTR_EVAL_TRIALS,\n ATTR_EVAL_TRIAL_INDEX,\n ATTR_EVAL_TRIAL_ERROR,\n ATTR_EVAL_COLLECTION_ID,\n ATTR_EVAL_USER_NAME,\n ATTR_EVAL_USER_EMAIL,\n ATTR_EVAL_VERSION,\n ATTR_EVAL_RUN_ID,\n ATTR_EVAL_METADATA,\n ATTR_EVAL_CONFIG_FLAGS,\n ATTR_EVAL_CAPABILITY_NAME,\n ATTR_EVAL_STEP_NAME,\n} from './eval_proposal';\n\nimport {\n ATTR_ERROR_MESSAGE,\n ATTR_GEN_AI_AGENT_DESCRIPTION,\n ATTR_GEN_AI_AGENT_ID,\n ATTR_GEN_AI_AGENT_NAME,\n ATTR_GEN_AI_CONVERSATION_ID,\n ATTR_GEN_AI_INPUT_MESSAGES,\n ATTR_GEN_AI_OPERATION_NAME,\n ATTR_GEN_AI_OUTPUT_MESSAGES,\n ATTR_GEN_AI_OUTPUT_TYPE,\n ATTR_GEN_AI_PROVIDER_NAME,\n ATTR_GEN_AI_REQUEST_CHOICE_COUNT,\n ATTR_GEN_AI_REQUEST_ENCODING_FORMATS,\n ATTR_GEN_AI_REQUEST_FREQUENCY_PENALTY,\n ATTR_GEN_AI_REQUEST_MAX_TOKENS,\n ATTR_GEN_AI_REQUEST_MODEL,\n ATTR_GEN_AI_REQUEST_PRESENCE_PENALTY,\n ATTR_GEN_AI_REQUEST_SEED,\n ATTR_GEN_AI_REQUEST_STOP_SEQUENCES,\n ATTR_GEN_AI_REQUEST_TEMPERATURE,\n ATTR_GEN_AI_REQUEST_TOP_K,\n ATTR_GEN_AI_REQUEST_TOP_P,\n ATTR_GEN_AI_RESPONSE_FINISH_REASONS,\n ATTR_GEN_AI_RESPONSE_ID,\n ATTR_GEN_AI_RESPONSE_MODEL,\n ATTR_GEN_AI_TOOL_CALL_ID,\n ATTR_GEN_AI_TOOL_DESCRIPTION,\n ATTR_GEN_AI_TOOL_NAME,\n ATTR_GEN_AI_TOOL_TYPE,\n ATTR_GEN_AI_USAGE_INPUT_TOKENS,\n ATTR_GEN_AI_USAGE_OUTPUT_TOKENS,\n GEN_AI_OPERATION_NAME_VALUE_CHAT,\n GEN_AI_OPERATION_NAME_VALUE_CREATE_AGENT,\n GEN_AI_OPERATION_NAME_VALUE_EMBEDDINGS,\n GEN_AI_OPERATION_NAME_VALUE_EXECUTE_TOOL,\n GEN_AI_OPERATION_NAME_VALUE_GENERATE_CONTENT,\n GEN_AI_OPERATION_NAME_VALUE_INVOKE_AGENT,\n GEN_AI_OUTPUT_TYPE_VALUE_IMAGE,\n GEN_AI_OUTPUT_TYPE_VALUE_JSON,\n GEN_AI_OUTPUT_TYPE_VALUE_SPEECH,\n GEN_AI_OUTPUT_TYPE_VALUE_TEXT,\n GEN_AI_PROVIDER_NAME_VALUE_ANTHROPIC,\n GEN_AI_PROVIDER_NAME_VALUE_AWS_BEDROCK,\n GEN_AI_PROVIDER_NAME_VALUE_AZURE_AI_INFERENCE,\n GEN_AI_PROVIDER_NAME_VALUE_AZURE_AI_OPENAI,\n GEN_AI_PROVIDER_NAME_VALUE_COHERE,\n GEN_AI_PROVIDER_NAME_VALUE_DEEPSEEK,\n GEN_AI_PROVIDER_NAME_VALUE_GCP_GEMINI,\n GEN_AI_PROVIDER_NAME_VALUE_GCP_GEN_AI,\n GEN_AI_PROVIDER_NAME_VALUE_GCP_VERTEX_AI,\n GEN_AI_PROVIDER_NAME_VALUE_GROQ,\n GEN_AI_PROVIDER_NAME_VALUE_IBM_WATSONX_AI,\n GEN_AI_PROVIDER_NAME_VALUE_MISTRAL_AI,\n GEN_AI_PROVIDER_NAME_VALUE_OPENAI,\n GEN_AI_PROVIDER_NAME_VALUE_PERPLEXITY,\n GEN_AI_PROVIDER_NAME_VALUE_X_AI,\n} from '@opentelemetry/semantic-conventions/incubating';\n\n/**\n * PROPRIETARY ATTRIBUTES (o11y)\n *\n * @see: https://axiom.co/docs/ai-engineering/semantic-conventions\n */\n\nconst ATTR_AXIOM_GEN_AI_SCHEMA_URL = 'axiom.gen_ai.schema_url';\nconst ATTR_AXIOM_GEN_AI_SDK_NAME = 'axiom.gen_ai.sdk.name';\nconst ATTR_AXIOM_GEN_AI_SDK_VERSION = 'axiom.gen_ai.sdk.version';\nconst ATTR_GEN_AI_CAPABILITY_NAME = 'gen_ai.capability.name';\nconst ATTR_GEN_AI_STEP_NAME = 'gen_ai.step.name';\nconst ATTR_GEN_AI_TOOL_ARGUMENTS = 'gen_ai.tool.arguments'; // deprecated by OTel\nconst ATTR_GEN_AI_TOOL_MESSAGE = 'gen_ai.tool.message'; // deprecated by OTel\n\nconst GEN_AI_PROVIDER_NAME_VALUE_ASSEMBLYAI = 'assemblyai';\nconst GEN_AI_PROVIDER_NAME_VALUE_CEREBRAS = 'cerebras';\nconst GEN_AI_PROVIDER_NAME_VALUE_DEEPGRAM = 'deepgram';\nconst GEN_AI_PROVIDER_NAME_VALUE_DEEPINFRA = 'deepinfra';\nconst GEN_AI_PROVIDER_NAME_VALUE_ELEVENLABS = 'elevenlabs';\nconst GEN_AI_PROVIDER_NAME_VALUE_FAL = 'fal';\nconst GEN_AI_PROVIDER_NAME_VALUE_FIREWORKS = 'fireworks';\nconst GEN_AI_PROVIDER_NAME_VALUE_GLADIA = 'gladia';\nconst GEN_AI_PROVIDER_NAME_VALUE_HUME = 'hume';\nconst GEN_AI_PROVIDER_NAME_VALUE_LMNT = 'lmnt';\nconst GEN_AI_PROVIDER_NAME_VALUE_LUMA = 'luma';\nconst GEN_AI_PROVIDER_NAME_VALUE_REPLICATE = 'replicate';\nconst GEN_AI_PROVIDER_NAME_VALUE_REVAI = 'revai';\nconst GEN_AI_PROVIDER_NAME_VALUE_TOGETHERAI = 'togetherai';\nconst GEN_AI_PROVIDER_NAME_VALUE_VERCEL = 'vercel';\n\n/**\n * When adding something new here, please:\n * 1. Make sure it doesn't already exist as part of OTel Semantic Conventions (use that instead)\n * 2. Make sure to use standard naming schema, ie snake_case\n * 3. If a specific feature has an attribute you would like to use, extract it to the shared section\n *\n * Also Experimental Attributes should always be imported here and then used from the CustomAttributes object\n * because they are unstable.\n *\n * @see: https://github.com/open-telemetry/opentelemetry-js/tree/c89cb38d0fec39d54cf3fcb35c429a8129e9c909/semantic-conventions#unstable-semconv\n */\nexport const Attr = {\n __EXPERIMENTAL_Flag: (flagName: string) => `flag.${flagName}`,\n __EXPERIMENTAL_Fact: (factName: string) => `fact.${factName}`,\n Axiom: {\n GenAI: {\n SchemaURL: ATTR_AXIOM_GEN_AI_SCHEMA_URL,\n SDK: {\n Name: ATTR_AXIOM_GEN_AI_SDK_NAME,\n Version: ATTR_AXIOM_GEN_AI_SDK_VERSION,\n },\n },\n },\n GenAI: {\n PromptMetadata: {\n ID: 'axiom.gen_ai.prompt.id',\n Name: 'axiom.gen_ai.prompt.name',\n Slug: 'axiom.gen_ai.prompt.slug',\n Version: 'axiom.gen_ai.prompt.version',\n },\n /**\n * These two are used to identify the span\n */\n Capability: {\n Name: ATTR_GEN_AI_CAPABILITY_NAME,\n },\n Step: {\n Name: ATTR_GEN_AI_STEP_NAME,\n },\n Provider: {\n Name: ATTR_GEN_AI_PROVIDER_NAME,\n Name_Values: {\n Anthropic: GEN_AI_PROVIDER_NAME_VALUE_ANTHROPIC,\n AssemblyAI: GEN_AI_PROVIDER_NAME_VALUE_ASSEMBLYAI,\n AWSBedrock: GEN_AI_PROVIDER_NAME_VALUE_AWS_BEDROCK,\n AzureAIInference: GEN_AI_PROVIDER_NAME_VALUE_AZURE_AI_INFERENCE,\n AzureAIOpenAI: GEN_AI_PROVIDER_NAME_VALUE_AZURE_AI_OPENAI,\n Cerebras: GEN_AI_PROVIDER_NAME_VALUE_CEREBRAS,\n Cohere: GEN_AI_PROVIDER_NAME_VALUE_COHERE,\n Deepgram: GEN_AI_PROVIDER_NAME_VALUE_DEEPGRAM,\n DeepInfra: GEN_AI_PROVIDER_NAME_VALUE_DEEPINFRA,\n Deepseek: GEN_AI_PROVIDER_NAME_VALUE_DEEPSEEK,\n ElevenLabs: GEN_AI_PROVIDER_NAME_VALUE_ELEVENLABS,\n Fal: GEN_AI_PROVIDER_NAME_VALUE_FAL,\n Fireworks: GEN_AI_PROVIDER_NAME_VALUE_FIREWORKS,\n GCPGemini: GEN_AI_PROVIDER_NAME_VALUE_GCP_GEMINI,\n GCPGenAI: GEN_AI_PROVIDER_NAME_VALUE_GCP_GEN_AI,\n GCPVertexAI: GEN_AI_PROVIDER_NAME_VALUE_GCP_VERTEX_AI,\n Gladia: GEN_AI_PROVIDER_NAME_VALUE_GLADIA,\n Groq: GEN_AI_PROVIDER_NAME_VALUE_GROQ,\n Hume: GEN_AI_PROVIDER_NAME_VALUE_HUME,\n IBMWatsonxAI: GEN_AI_PROVIDER_NAME_VALUE_IBM_WATSONX_AI,\n Lmnt: GEN_AI_PROVIDER_NAME_VALUE_LMNT,\n Luma: GEN_AI_PROVIDER_NAME_VALUE_LUMA,\n MistralAI: GEN_AI_PROVIDER_NAME_VALUE_MISTRAL_AI,\n OpenAI: GEN_AI_PROVIDER_NAME_VALUE_OPENAI,\n Perplexity: GEN_AI_PROVIDER_NAME_VALUE_PERPLEXITY,\n Replicate: GEN_AI_PROVIDER_NAME_VALUE_REPLICATE,\n RevAI: GEN_AI_PROVIDER_NAME_VALUE_REVAI,\n TogetherAI: GEN_AI_PROVIDER_NAME_VALUE_TOGETHERAI,\n Vercel: GEN_AI_PROVIDER_NAME_VALUE_VERCEL,\n XAI: GEN_AI_PROVIDER_NAME_VALUE_X_AI,\n },\n },\n /**\n * Regular attributes\n */\n Agent: {\n Description: ATTR_GEN_AI_AGENT_DESCRIPTION, // not yet used by axiom-ai\n ID: ATTR_GEN_AI_AGENT_ID, // not yet used by axiom-ai\n Name: ATTR_GEN_AI_AGENT_NAME, // not yet used by axiom-ai\n },\n Conversation: {\n ID: ATTR_GEN_AI_CONVERSATION_ID, // not yet used by axiom-ai, anyway probably needs to be provided by user\n },\n Input: {\n Messages: ATTR_GEN_AI_INPUT_MESSAGES,\n },\n Operation: {\n Name: ATTR_GEN_AI_OPERATION_NAME,\n Name_Values: {\n /**\n * Note that \"text_completion\" is deprecated in favor of \"chat\" for both OpenAI and Anthropic\n */\n Chat: GEN_AI_OPERATION_NAME_VALUE_CHAT,\n CreateAgent: GEN_AI_OPERATION_NAME_VALUE_CREATE_AGENT,\n Embeddings: GEN_AI_OPERATION_NAME_VALUE_EMBEDDINGS,\n ExecuteTool: GEN_AI_OPERATION_NAME_VALUE_EXECUTE_TOOL,\n GenerateContent: GEN_AI_OPERATION_NAME_VALUE_GENERATE_CONTENT,\n InvokeAgent: GEN_AI_OPERATION_NAME_VALUE_INVOKE_AGENT,\n },\n },\n Output: {\n Messages: ATTR_GEN_AI_OUTPUT_MESSAGES,\n Type: ATTR_GEN_AI_OUTPUT_TYPE,\n Type_Values: {\n Text: GEN_AI_OUTPUT_TYPE_VALUE_TEXT,\n Json: GEN_AI_OUTPUT_TYPE_VALUE_JSON,\n Image: GEN_AI_OUTPUT_TYPE_VALUE_IMAGE,\n Speech: GEN_AI_OUTPUT_TYPE_VALUE_SPEECH,\n },\n },\n /**\n * The provider that is hosting the model, eg AWS Bedrock\n * There doesn't seem to be a semconv for this\n */\n Request: {\n ChoiceCount: ATTR_GEN_AI_REQUEST_CHOICE_COUNT, // not yet used by axiom-ai\n EncodingFormats: ATTR_GEN_AI_REQUEST_ENCODING_FORMATS, // not yet used by axiom-ai\n FrequencyPenalty: ATTR_GEN_AI_REQUEST_FREQUENCY_PENALTY,\n MaxTokens: ATTR_GEN_AI_REQUEST_MAX_TOKENS,\n /**\n * The model you asked for\n */\n Model: ATTR_GEN_AI_REQUEST_MODEL,\n PresencePenalty: ATTR_GEN_AI_REQUEST_PRESENCE_PENALTY,\n Seed: ATTR_GEN_AI_REQUEST_SEED,\n StopSequences: ATTR_GEN_AI_REQUEST_STOP_SEQUENCES,\n Temperature: ATTR_GEN_AI_REQUEST_TEMPERATURE,\n TopK: ATTR_GEN_AI_REQUEST_TOP_K,\n TopP: ATTR_GEN_AI_REQUEST_TOP_P,\n },\n Response: {\n FinishReasons: ATTR_GEN_AI_RESPONSE_FINISH_REASONS,\n ID: ATTR_GEN_AI_RESPONSE_ID,\n /**\n * The model that was actually used (might be different bc routing) - only ever get this from the response, otherwise omit\n */\n Model: ATTR_GEN_AI_RESPONSE_MODEL, // somehow not landing on the span for google models? check up on this...\n },\n Tool: {\n CallID: ATTR_GEN_AI_TOOL_CALL_ID,\n Description: ATTR_GEN_AI_TOOL_DESCRIPTION,\n Name: ATTR_GEN_AI_TOOL_NAME,\n Type: ATTR_GEN_AI_TOOL_TYPE,\n /**\n * Note, OTel Semantic Convention suggest only putting tool inputs/outputs on the parent chat span\n * But we at least want to give users THE OPTION to put them on the tool spans themselves as well\n * Because it enables a lot of things with querying\n * @see https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.37.0\n */\n Arguments: ATTR_GEN_AI_TOOL_ARGUMENTS,\n /**\n * Note, OTel Semantic Convention suggest only putting tool inputs/outputs on the parent chat span\n * But we at least want to give users THE OPTION to put them on the tool spans themselves as well\n * Because it enables a lot of things with querying\n * @see https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.37.0\n */\n Message: ATTR_GEN_AI_TOOL_MESSAGE,\n },\n Usage: {\n InputTokens: ATTR_GEN_AI_USAGE_INPUT_TOKENS,\n OutputTokens: ATTR_GEN_AI_USAGE_OUTPUT_TOKENS,\n },\n },\n Eval: {\n ID: ATTR_EVAL_ID,\n Name: ATTR_EVAL_NAME,\n Version: ATTR_EVAL_VERSION,\n Type: ATTR_EVAL_TYPE,\n Trials: ATTR_EVAL_TRIALS,\n Baseline: {\n ID: ATTR_EVAL_BASELINE_ID,\n Name: ATTR_EVAL_BASELINE_NAME,\n Version: ATTR_EVAL_BASELINE_VERSION,\n },\n Capability: {\n Name: ATTR_EVAL_CAPABILITY_NAME,\n },\n Step: {\n Name: ATTR_EVAL_STEP_NAME,\n },\n Tags: ATTR_EVAL_TAGS,\n Metadata: ATTR_EVAL_METADATA,\n Collection: {\n ID: ATTR_EVAL_COLLECTION_ID,\n Name: ATTR_EVAL_COLLECTION_NAME,\n Size: ATTR_EVAL_COLLECTION_SIZE,\n },\n Config: {\n Flags: ATTR_EVAL_CONFIG_FLAGS,\n },\n Run: {\n ID: ATTR_EVAL_RUN_ID,\n },\n Trial: {\n Index: ATTR_EVAL_TRIAL_INDEX,\n Error: ATTR_EVAL_TRIAL_ERROR,\n },\n Case: {\n Index: ATTR_EVAL_CASE_INDEX,\n Input: ATTR_EVAL_CASE_INPUT,\n Output: ATTR_EVAL_CASE_OUTPUT,\n Expected: ATTR_EVAL_CASE_EXPECTED,\n Scores: ATTR_EVAL_CASE_SCORES,\n Metadata: ATTR_EVAL_CASE_METADATA,\n Trials: ATTR_EVAL_CASE_TRIALS,\n },\n Task: {\n Output: ATTR_EVAL_TASK_OUTPUT,\n Name: ATTR_EVAL_TASK_NAME,\n Type: ATTR_EVAL_TASK_TYPE,\n },\n Score: {\n Name: ATTR_EVAL_SCORE_NAME,\n Value: ATTR_EVAL_SCORE_VALUE,\n Threshold: ATTR_EVAL_SCORE_THRESHOLD,\n Passed: ATTR_EVAL_SCORE_PASSED,\n IsBoolean: ATTR_EVAL_SCORE_IS_BOOLEAN,\n Metadata: ATTR_EVAL_SCORE_METADATA,\n Aggregation: ATTR_EVAL_SCORE_AGGREGATION,\n Trials: ATTR_EVAL_SCORE_TRIALS,\n },\n User: {\n Name: ATTR_EVAL_USER_NAME,\n Email: ATTR_EVAL_USER_EMAIL,\n },\n },\n Error: {\n Type: ATTR_ERROR_TYPE,\n Message: ATTR_ERROR_MESSAGE,\n },\n HTTP: {\n Response: {\n StatusCode: ATTR_HTTP_RESPONSE_STATUS_CODE,\n },\n },\n} as const;\n","// experiment\nexport const ATTR_EVAL_ID = 'eval.id' as const;\nexport const ATTR_EVAL_NAME = 'eval.name' as const;\nexport const ATTR_EVAL_VERSION = 'eval.version' as const;\nexport const ATTR_EVAL_TYPE = 'eval.type' as const;\nexport const ATTR_EVAL_TAGS = 'eval.tags' as const;\nexport const ATTR_EVAL_BASELINE_ID = 'eval.baseline.id' as const;\nexport const ATTR_EVAL_BASELINE_NAME = 'eval.baseline.name' as const;\nexport const ATTR_EVAL_BASELINE_VERSION = 'eval.baseline.version' as const;\nexport const ATTR_EVAL_METADATA = 'eval.metadata' as const;\nexport const ATTR_EVAL_TRIALS = 'eval.trials' as const;\n// capability\nexport const ATTR_EVAL_CAPABILITY_NAME = 'eval.capability.name' as const;\nexport const ATTR_EVAL_STEP_NAME = 'eval.step.name' as const;\n// collection\nexport const ATTR_EVAL_COLLECTION_ID = 'eval.collection.id' as const;\nexport const ATTR_EVAL_COLLECTION_SIZE = 'eval.collection.size' as const;\nexport const ATTR_EVAL_COLLECTION_NAME = 'eval.collection.name' as const;\n// config\nexport const ATTR_EVAL_CONFIG_FLAGS = 'eval.config.flags' as const;\n// case\nexport const ATTR_EVAL_CASE_INDEX = 'eval.case.index' as const;\nexport const ATTR_EVAL_CASE_INPUT = 'eval.case.input' as const;\nexport const ATTR_EVAL_CASE_OUTPUT = 'eval.case.output' as const;\nexport const ATTR_EVAL_CASE_EXPECTED = 'eval.case.expected' as const;\nexport const ATTR_EVAL_CASE_SCORES = 'eval.case.scores' as const;\nexport const ATTR_EVAL_CASE_METADATA = 'eval.case.metadata' as const;\nexport const ATTR_EVAL_CASE_TRIALS = 'eval.case.trials' as const;\n// trial\nexport const ATTR_EVAL_TRIAL_INDEX = 'eval.trial.index' as const;\nexport const ATTR_EVAL_TRIAL_ERROR = 'eval.trial.error' as const;\n// task\nexport const ATTR_EVAL_TASK_OUTPUT = 'eval.task.output' as const;\nexport const ATTR_EVAL_TASK_NAME = 'eval.task.name' as const;\nexport const ATTR_EVAL_TASK_TYPE = 'eval.task.type' as const;\n// run\nexport const ATTR_EVAL_RUN_ID = 'eval.run.id' as const;\n// score\nexport const ATTR_EVAL_SCORE_NAME = 'eval.score.name' as const;\nexport const ATTR_EVAL_SCORE_VALUE = 'eval.score.value' as const;\nexport const ATTR_EVAL_SCORE_THRESHOLD = 'eval.score.threshold' as const;\nexport const ATTR_EVAL_SCORE_PASSED = 'eval.score.passed' as const;\nexport const ATTR_EVAL_SCORE_IS_BOOLEAN = 'eval.score.is_boolean' as const;\nexport const ATTR_EVAL_SCORE_SCORER = 'eval.score.scorer' as const;\nexport const ATTR_EVAL_SCORE_METADATA = 'eval.score.metadata' as const;\nexport const ATTR_EVAL_SCORE_AGGREGATION = 'eval.score.aggregation' as const;\nexport const ATTR_EVAL_SCORE_TRIALS = 'eval.score.trials' as const;\n// user\nexport const ATTR_EVAL_USER_NAME = 'eval.user.name';\nexport const ATTR_EVAL_USER_EMAIL = 'eval.user.email';\n","/**\n * Utility functions for formatting tool calls in completion array format\n */\n\nimport type { LanguageModelV1FunctionToolCall } from '@ai-sdk/providerv1';\nimport { sanitizeMultimodalContent } from './utils/contentSanitizer';\nimport type {\n CompletionArray,\n FormatToolCallsOptions,\n FormattedCompletionResult,\n} from './completionTypes';\nimport type { OpenAIMessage, OpenAIAssistantMessage, OpenAIToolMessage } from './vercelTypes';\n\n/**\n * Converts OpenAI messages to completion array format\n */\nfunction convertToCompletionMessages(messages: OpenAIMessage[]): OpenAIMessage[] {\n return messages.map((message): OpenAIMessage => {\n switch (message.role) {\n case 'system':\n return {\n role: 'system',\n content: message.content,\n };\n\n case 'user':\n return {\n role: 'user',\n content: sanitizeMultimodalContent(message.content) as string | any[],\n };\n\n case 'assistant':\n return {\n role: 'assistant',\n content: sanitizeMultimodalContent(message.content) as string | null,\n tool_calls: message.tool_calls?.map((toolCall) => ({\n id: toolCall.id,\n type: 'function' as const,\n function: {\n name: toolCall.function.name,\n arguments: toolCall.function.arguments,\n },\n })),\n };\n\n case 'tool':\n return {\n role: 'tool',\n content: message.content,\n tool_call_id: message.tool_call_id,\n };\n\n default:\n throw new Error(`Unknown message role: ${(message as any).role}`);\n }\n });\n}\n\n/**\n * Creates tool result messages from tool execution results\n */\nfunction createToolResultMessages(\n toolResults: Array<{\n toolCallId: string;\n result: unknown;\n }>,\n): OpenAIToolMessage[] {\n return toolResults.map((result) => ({\n role: 'tool' as const,\n content: typeof result.result === 'string' ? result.result : JSON.stringify(result.result),\n tool_call_id: result.toolCallId,\n }));\n}\n\n/**\n * Main function to format tool calls in completion array format\n * Transforms AI SDK tool calls into the completion array structure\n */\nexport function formatToolCallsInCompletion(\n options: FormatToolCallsOptions,\n): FormattedCompletionResult {\n const { promptMessages = [], text, toolCalls = [], toolResults = [] } = options;\n\n // Convert prompt messages to completion format\n const historyMessages = convertToCompletionMessages(promptMessages);\n\n // Create assistant message with tool calls\n const assistantMessage: OpenAIAssistantMessage = {\n role: 'assistant',\n content: text ?? (toolCalls.length > 0 ? null : ''),\n };\n\n // Add tool calls if present\n if (toolCalls.length > 0) {\n assistantMessage.tool_calls = toolCalls.map((toolCall) => ({\n id: toolCall.id,\n type: 'function' as const,\n function: {\n name: toolCall.toolName,\n arguments: toolCall.args,\n },\n }));\n }\n\n // Create tool result messages\n const toolMessages = createToolResultMessages(toolResults);\n\n // Build complete completion array\n const completion: CompletionArray = [...historyMessages, assistantMessage, ...toolMessages];\n\n return {\n completion,\n assistantMessage,\n toolMessages,\n };\n}\n\n/**\n * Creates a simple completion array with just assistant text response\n * Used for V1 model wrapper where tool calls are handled separately\n */\nexport function createSimpleCompletion({ text }: { text?: string }): CompletionArray {\n // Create assistant message with text only\n const assistantMessage: OpenAIAssistantMessage = {\n role: 'assistant',\n content: text ?? '',\n };\n\n return [assistantMessage];\n}\n\n/**\n * Formats V2 tool calls for completion array\n * Convenience function for V2 model wrapper\n */\nexport function formatV2ToolCallsInCompletion({\n promptMessages = [],\n text,\n toolCalls = [],\n}: {\n promptMessages?: OpenAIMessage[];\n text?: string;\n toolCalls?: Array<{\n toolCallId: string;\n toolName: string;\n args: unknown;\n }>;\n}): CompletionArray {\n // Convert prompt messages\n const historyMessages = convertToCompletionMessages(promptMessages);\n\n // Create assistant message\n const assistantMessage: OpenAIAssistantMessage = {\n role: 'assistant',\n content: text ?? (toolCalls.length > 0 ? null : ''),\n };\n\n // Add tool calls if present\n if (toolCalls.length > 0) {\n assistantMessage.tool_calls = toolCalls.map((toolCall) => ({\n id: toolCall.toolCallId,\n type: 'function' as const,\n function: {\n name: toolCall.toolName,\n arguments:\n typeof toolCall.args === 'string' ? toolCall.args : JSON.stringify(toolCall.args),\n },\n }));\n }\n\n return [...historyMessages, assistantMessage];\n}\n\n/**\n * Aggregates tool call chunks for streaming responses\n * Handles partial tool calls and builds complete tool call objects\n */\nexport function aggregateStreamingToolCalls(\n chunks: Array<{\n toolCallId?: string;\n toolName?: string;\n argsTextDelta?: string;\n }>,\n): LanguageModelV1FunctionToolCall[] {\n const toolCallMap = new Map<\n string,\n {\n toolCallId: string;\n toolName: string;\n args: string;\n }\n >();\n\n for (const chunk of chunks) {\n if (!chunk.toolCallId) continue;\n\n const existing = toolCallMap.get(chunk.toolCallId);\n if (existing) {\n // Append args delta\n existing.args += chunk.argsTextDelta || '';\n } else {\n // Create new tool call entry\n toolCallMap.set(chunk.toolCallId, {\n toolCallId: chunk.toolCallId,\n toolName: chunk.toolName || '',\n args: chunk.argsTextDelta || '',\n });\n }\n }\n\n return Array.from(toolCallMap.values()).map((call) => ({\n ...call,\n toolCallType: 'function' as const,\n }));\n}\n","/**\n * Utilities for sanitizing multimodal content in telemetry data\n * Replaces large binary content with metadata while preserving structure\n */\n\nimport { createHash } from 'crypto';\n\ninterface ImageMetadata {\n format?: string;\n size_bytes?: number;\n hash: string;\n is_data_url: boolean;\n dimensions?: string;\n}\n\n/**\n * Extracts metadata from an image URL (data URL or external URL)\n */\nfunction extractImageMetadata(url: string): ImageMetadata {\n if (url.startsWith('data:')) {\n // Parse data URL: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ...\n const [header, base64Data] = url.split(',');\n const formatMatch = header.match(/data:image\\/(\\w+)/);\n const format = formatMatch?.[1];\n\n // Estimate size from base64 data\n const sizeBytes = base64Data ? Math.floor((base64Data.length * 3) / 4) : 0;\n\n // Create a short hash of the content for identification\n const hash = base64Data\n ? createHash('sha256').update(base64Data).digest('hex').slice(0, 16)\n : 'unknown';\n\n return {\n format,\n size_bytes: sizeBytes,\n hash,\n is_data_url: true,\n };\n } else {\n // External URL - create hash of the URL itself\n const hash = createHash('sha256').update(url).digest('hex').slice(0, 16);\n return {\n hash,\n is_data_url: false,\n };\n }\n}\n\n/**\n * Sanitizes an image URL by replacing large data URLs with metadata\n */\nfunction sanitizeImageUrl(url: string, detail?: string) {\n const metadata = extractImageMetadata(url);\n\n if (metadata.is_data_url) {\n // Replace data URL with reference\n const formatPart = metadata.format ? `:${metadata.format}` : '';\n const sizePart = metadata.size_bytes ? `:${metadata.size_bytes}b` : '';\n return {\n url: `[IMAGE${formatPart}${sizePart}:${metadata.hash}]`,\n detail,\n ...metadata,\n };\n } else {\n // Keep external URLs but add metadata\n return {\n url,\n detail,\n ...metadata,\n };\n }\n}\n\ntype SanitizedContent<T> = T extends readonly unknown[] ? unknown[] : T;\n\n/**\n * Sanitizes any multimodal content for telemetry purposes\n * This is the main function that should be used throughout the codebase\n */\nexport function sanitizeMultimodalContent<T>(content: T): SanitizedContent<T> {\n if (Array.isArray(content)) {\n return content.map((part) => {\n if (part && typeof part === 'object' && 'type' in part && part.type === 'image_url') {\n const imagePart = part;\n if (imagePart.image_url?.url) {\n return {\n ...part,\n image_url: sanitizeImageUrl(imagePart.image_url.url, imagePart.image_url.detail),\n };\n }\n }\n return part;\n }) as SanitizedContent<T>;\n }\n\n return content as SanitizedContent<T>;\n}\n","import type { LanguageModelV1FunctionToolCall } from '@ai-sdk/providerv1';\nimport type { NormalizedToolCall } from '../otel/utils/normalized';\nimport type { LanguageModelV2Prompt } from '@ai-sdk/providerv2';\nimport type { LanguageModelV3Prompt } from '@ai-sdk/providerv3';\nimport type { OpenAIMessage } from '../otel/vercelTypes';\n\nexport type ToolResultMap = Map<string, unknown>;\n\n/**\n * Appends tool calls and their results to a conversation prompt.\n *\n * This function takes an existing conversation prompt and adds:\n * 1. An assistant message containing the tool calls\n * 2. Tool result messages for each tool call with results\n *\n * @param prompt - The existing conversation prompt\n * @param toolCalls - The tool calls made by the assistant\n * @param toolResults - Map of tool names to their results\n * @param assistantContent - Optional assistant message content to include with tool calls\n * @returns Updated prompt with tool calls and results appended\n */\nexport function appendToolCalls(\n prompt: OpenAIMessage[],\n toolCalls: LanguageModelV1FunctionToolCall[] | NormalizedToolCall[],\n toolResults: ToolResultMap,\n assistantContent?: string | null,\n): OpenAIMessage[] {\n const updatedPrompt = [...prompt];\n\n // Add assistant message with tool calls\n updatedPrompt.push({\n role: 'assistant',\n content: assistantContent || null,\n tool_calls: toolCalls.map((toolCall) => ({\n id: toolCall.toolCallId,\n function: {\n name: toolCall.toolName,\n arguments:\n typeof toolCall.args === 'string' ? toolCall.args : JSON.stringify(toolCall.args),\n },\n type: 'function',\n })),\n });\n\n // Add tool result messages with real data\n for (const toolCall of toolCalls) {\n const realToolResult = toolResults.get(toolCall.toolName);\n\n if (realToolResult) {\n updatedPrompt.push({\n role: 'tool',\n tool_call_id: toolCall.toolCallId,\n content: JSON.stringify(realToolResult),\n });\n }\n }\n\n return updatedPrompt;\n}\n\n/**\n * Extracts tool results from a raw prompt array.\n *\n * Searches through different message formats to find tool results:\n * - Google AI format: user messages with functionResponse parts\n * - OpenAI format: tool role messages (future enhancement)\n *\n * @param rawPrompt - The raw prompt array from the model provider\n * @returns Map of tool names to their results\n */\n// TODO: @cje - This should be typed based on the specific provider's raw prompt format\n// but it needs to handle multiple providers (Google AI, OpenAI, etc.)\nexport function extractToolResultsFromRawPrompt(rawPrompt: any[]): Map<string, unknown> {\n const toolResultsMap = new Map<string, unknown>();\n\n if (!Array.isArray(rawPrompt)) {\n return toolResultsMap;\n }\n\n // Look for tool results in different message formats\n for (const message of rawPrompt) {\n // Google AI format: user message with functionResponse parts\n if (message?.role === 'user' && Array.isArray(message.parts)) {\n for (const part of message.parts) {\n if (part?.functionResponse) {\n const functionResponse = part.functionResponse;\n if (functionResponse.name && functionResponse.response) {\n // Store by function name since that's what we have access to\n toolResultsMap.set(\n functionResponse.name,\n functionResponse.response.content || functionResponse.response,\n );\n }\n }\n }\n }\n\n // OpenAI format: tool role messages with tool_call_id\n if (message?.role === 'tool' && message?.tool_call_id && message?.content) {\n // For OpenAI format, we'd need to map back from tool_call_id to tool name\n // This is more complex as we'd need to track the tool calls first\n // For now, we'll skip this but it could be implemented later\n }\n }\n\n return toolResultsMap;\n}\n\n/**\n * Extracts tool results from a V2 prompt structure.\n *\n * V2 prompts use a \"parts\" array structure where:\n * - Tool calls are in assistant messages as 'tool-call' parts\n * - Tool results are in 'tool' role messages as 'tool-result' parts with 'output' property\n *\n * @param prompt - The V2 prompt array\n * @returns Map of tool names to their results\n */\nexport function extractToolResultsFromPromptV2(\n prompt: LanguageModelV2Prompt,\n): Map<string, unknown> {\n const idToName = new Map<string, string>();\n const results = new Map<string, unknown>();\n\n // 1. Collect tool-call ids → names from assistant messages\n for (const message of prompt) {\n if (message.role === 'assistant' && Array.isArray(message.content)) {\n for (const part of message.content) {\n if (part.type === 'tool-call') {\n idToName.set(part.toolCallId, part.toolName);\n }\n }\n }\n }\n\n // 2. Collect tool results from tool role messages\n for (const message of prompt) {\n if (message.role === 'tool' && Array.isArray(message.content)) {\n for (const part of message.content) {\n // In V2, tool result parts have toolCallId and result properties\n if (part.toolCallId && part.output !== undefined) {\n const toolName = idToName.get(part.toolCallId);\n if (toolName) {\n results.set(toolName, part.output);\n }\n }\n }\n }\n }\n\n return results;\n}\n\n/**\n * Extracts tool results from a V3 prompt structure.\n *\n * V3 prompts are very similar to V2 but with slightly different typing:\n * - Tool calls are in assistant messages as 'tool-call' parts\n * - Tool results are in 'tool' role messages as 'tool-result' parts with 'output' property\n * - Also includes 'tool-approval-response' parts which we skip\n *\n * @param prompt - The V3 prompt array\n * @returns Map of tool names to their results\n */\nexport function extractToolResultsFromPromptV3(\n prompt: LanguageModelV3Prompt,\n): Map<string, unknown> {\n const idToName = new Map<string, string>();\n const results = new Map<string, unknown>();\n\n // 1. Collect tool-call ids → names from assistant messages\n for (const message of prompt) {\n if (message.role === 'assistant' && Array.isArray(message.content)) {\n for (const part of message.content) {\n if (part.type === 'tool-call') {\n idToName.set(part.toolCallId, part.toolName);\n }\n }\n }\n }\n\n // 2. Collect tool results from tool role messages\n for (const message of prompt) {\n if (message.role === 'tool' && Array.isArray(message.content)) {\n for (const part of message.content) {\n // In V3, tool result parts have toolCallId and output properties\n // Skip tool-approval-response parts\n if (part.type === 'tool-result' && part.toolCallId && part.output !== undefined) {\n const toolName = idToName.get(part.toolCallId);\n if (toolName) {\n results.set(toolName, part.output);\n }\n }\n }\n }\n }\n\n return results;\n}\n","import {\n trace,\n context,\n propagation,\n type Span,\n type Tracer,\n SpanStatusCode,\n type AttributeValue,\n} from '@opentelemetry/api';\nimport { Attr } from '../semconv/attributes';\nimport { SCHEMA_URL } from '../../schema';\nimport { WITHSPAN_BAGGAGE_KEY } from '../withSpanBaggageKey';\nimport { createStartActiveSpan } from '../startActiveSpan';\n\nimport { getGlobalTracer } from '../initAxiomAI';\nimport packageJson from '../../../package.json';\nimport type { OpenAIMessage } from '../vercelTypes';\nimport type { LanguageModelV2Prompt } from '@ai-sdk/providerv2';\nimport type { LanguageModelV3Prompt } from '@ai-sdk/providerv3';\n\n/**\n * Common span context discriminated union for V1, V2 and V3\n */\ntype GenAiSpanContext =\n | {\n version: 'v1';\n originalPrompt: OpenAIMessage[];\n rawCall?: {\n rawPrompt?: unknown[];\n rawSettings?: unknown;\n };\n }\n | {\n version: 'v2';\n originalPrompt: OpenAIMessage[];\n originalV2Prompt?: LanguageModelV2Prompt;\n }\n | {\n version: 'v3';\n originalPrompt: OpenAIMessage[];\n originalV3Prompt?: LanguageModelV3Prompt;\n };\n\nexport type GenAiSpanContextV1 = Extract<GenAiSpanContext, { version: 'v1' }>;\nexport type GenAiSpanContextV2 = Extract<GenAiSpanContext, { version: 'v2' }>;\nexport type GenAiSpanContextV3 = Extract<GenAiSpanContext, { version: 'v3' }>;\n\n/**\n * SpanLease represents ownership of a span's lifecycle\n * - owned: true means the middleware created the span and must end it\n * - owned: false means the span is owned by withSpan and middleware must NOT end it\n */\nexport interface SpanLease {\n owned: boolean;\n end: () => void;\n}\n\n/**\n * Safely converts a value to a number, handling string inputs from providers.\n * Some AI providers may return token counts as strings instead of numbers.\n *\n * @returns The numeric value, or undefined if the input is not a valid number\n */\nexport function ensureNumber(value: unknown): number | undefined {\n const v =\n typeof value === 'number' ? value : typeof value === 'string' ? Number(value) : undefined;\n if (Number.isNaN(v)) return undefined;\n if (v === Infinity || v === -Infinity) return undefined;\n return v;\n}\n\n/**\n * Classifies errors into low-cardinality types for OpenTelemetry error.type attribute\n * Reference: OTel spec § 7.22.5 for error.type guidelines\n *\n * Uses explicit mapping for useful error types, avoiding generic built-in errors\n * that are not actionable for observability dashboards.\n *\n * @returns string for actionable error types, undefined for unclassifiable errors\n */\nfunction classifyError(err: unknown): string | undefined {\n if (err == null) return undefined;\n\n if (err instanceof Error) {\n const name = err.name.toLowerCase();\n\n // Explicit mapping for actionable error types\n if (name.includes('timeout')) return 'timeout';\n if (name.includes('abort')) return 'timeout'; // AbortError often means timeout\n if (name.includes('network') || name.includes('fetch')) return 'network';\n if (name.includes('validation')) return 'validation';\n if (name.includes('auth')) return 'authentication';\n if (name.includes('parse') || name.includes('json')) return 'parsing';\n if (name.includes('permission') || name.includes('forbidden')) return 'authorization';\n if (name.includes('rate') && name.includes('limit')) return 'rate_limit';\n if (name.includes('quota') || name.includes('limit')) return 'quota_exceeded';\n\n // Skip generic built-in errors (TypeError, ReferenceError, etc.)\n // They're not useful for observability dashboards\n return undefined;\n }\n\n return undefined; // Handles primitives thrown as errors\n}\n\n/**\n * Classifies tool-specific errors using duck-typing for cross-vendor compatibility\n * Handles node-fetch version differences and external API error patterns\n *\n * @param err The error to classify\n * @param span The span to set error attributes on\n */\nexport function classifyToolError(err: unknown, span: Span): void {\n // Enhanced error handling for OpenTelemetry compliance\n if (err instanceof Error) {\n span.recordException(err); // Error objects are compatible with Exception interface\n } else {\n // Convert primitives to compatible format\n span.recordException({\n message: String(err),\n name: 'UnknownError',\n });\n }\n\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err instanceof Error ? err.message : String(err),\n });\n\n let errorType = 'unknown';\n let statusCode: string | number | undefined;\n\n // Duck-type check for common error patterns (don't rely on inheritance)\n if (err && typeof err === 'object') {\n const errObj = err as any;\n const name = errObj.name?.toLowerCase() || '';\n const message = errObj.message?.toLowerCase() || '';\n\n if (name.includes('timeout') || name.includes('abort') || message.includes('timeout')) {\n errorType = 'timeout';\n } else if (\n name.includes('validation') ||\n errObj.code === 'VALIDATION_ERROR' ||\n message.includes('validation')\n ) {\n errorType = 'validation';\n } else if (\n name.includes('fetch') ||\n name.includes('network') ||\n message.includes('network') ||\n message.includes('fetch failed')\n ) {\n errorType = 'network';\n // Handle both node-fetch v2 (.code) and v3 (.status) patterns\n statusCode = errObj.status || errObj.code;\n } else if (\n name.includes('auth') ||\n message.includes('auth') ||\n message.includes('unauthorized')\n ) {\n errorType = 'authentication';\n } else if (\n name.includes('permission') ||\n name.includes('forbidden') ||\n message.includes('forbidden')\n ) {\n errorType = 'authorization';\n } else if (\n name.includes('rate') &&\n (name.includes('limit') || message.includes('rate limit'))\n ) {\n errorType = 'rate_limit';\n } else if (\n name.includes('quota') ||\n message.includes('quota') ||\n message.includes('limit exceeded')\n ) {\n errorType = 'quota_exceeded';\n } else if (\n name.includes('parse') ||\n name.includes('json') ||\n message.includes('json') ||\n message.includes('parse')\n ) {\n errorType = 'parsing';\n }\n }\n\n // MANDATORY: Standard OpenTelemetry error attributes\n span.setAttribute(Attr.Error.Type, errorType);\n if (err instanceof Error && err.message) {\n span.setAttribute(Attr.Error.Message, err.message);\n }\n\n // Standard HTTP attributes for network errors\n if (statusCode !== undefined) {\n span.setAttribute(Attr.HTTP.Response.StatusCode, statusCode as AttributeValue);\n }\n}\n\n/**\n * Check if the current tracer provider is a no-op\n * Uses safer detection that works with bundling/minification\n */\nfunction isNoOpTracerProvider(): boolean {\n const provider = trace.getTracerProvider();\n\n // Check constructor name (may fail with bundling/minification)\n if (provider.constructor.name === 'NoopTracerProvider') {\n return true;\n }\n\n // Check if getTracer method exists before calling it (for test mocks)\n if (typeof (provider as any).getTracer !== 'function') {\n return true;\n }\n\n return false;\n}\n\n/**\n * Gets the appropriate tracer instance using global scope or fallbacks\n */\nexport function getTracer(): Tracer {\n const tracer = getGlobalTracer();\n\n if (isNoOpTracerProvider()) {\n const isDebug = process.env.AXIOM_DEBUG === 'true';\n if (!isDebug) {\n console.warn(\n '[AxiomAI] No TracerProvider registered - spans will be no-op. ' +\n 'Make sure to call initAxiomAI() after your OpenTelemetry SDK has started (sdk.start()).',\n );\n }\n }\n\n return tracer;\n}\n\n/**\n * Creates a standardized span name for GenAI operations\n */\nfunction createGenAISpanName(operation: string, suffix?: string): string {\n return suffix ? `${operation} ${suffix}` : operation;\n}\n\n/**\n * Sets common scope attributes on a span from baggage\n */\nexport function setScopeAttributes(span: Span): void {\n const bag = propagation.getActiveBaggage();\n\n if (bag) {\n const capability = bag.getEntry('capability')?.value;\n if (capability) {\n span.setAttribute(Attr.GenAI.Capability.Name, capability);\n }\n\n const step = bag.getEntry('step')?.value;\n if (step) {\n span.setAttribute(Attr.GenAI.Step.Name, step);\n }\n\n const conversationId = bag.getEntry('conversationId')?.value;\n if (conversationId) {\n span.setAttribute(Attr.GenAI.Conversation.ID, conversationId);\n }\n }\n}\n\n/**\n * Sets Axiom-specific base attributes on a span\n */\nexport function setAxiomBaseAttributes(span: Span): void {\n span.setAttributes({\n [Attr.Axiom.GenAI.SchemaURL]: SCHEMA_URL,\n [Attr.Axiom.GenAI.SDK.Name]: packageJson.name,\n [Attr.Axiom.GenAI.SDK.Version]: packageJson.version,\n });\n}\n\n/**\n * Sets common base attributes on a span\n */\nexport function setBaseAttributes(span: Span, provider: string, modelId: string): void {\n span.setAttributes({\n [Attr.GenAI.Operation.Name]: Attr.GenAI.Operation.Name_Values.Chat,\n [Attr.GenAI.Request.Model]: modelId,\n });\n\n const systemValue = mapVercelSDKProviderToOTelProvider(provider);\n if (systemValue) {\n span.setAttribute(Attr.GenAI.Provider.Name, systemValue);\n }\n\n setAxiomBaseAttributes(span);\n}\n\n/**\n * Sets common request parameter attributes on a span\n */\nexport function setRequestParameterAttributes(\n span: Span,\n params: {\n maxTokens?: number;\n frequencyPenalty?: number;\n presencePenalty?: number;\n temperature?: number;\n topP?: number;\n topK?: number;\n seed?: number;\n stopSequences?: string[];\n },\n): void {\n const {\n maxTokens,\n frequencyPenalty,\n presencePenalty,\n temperature,\n topP,\n topK,\n seed,\n stopSequences,\n } = params;\n\n if (maxTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Request.MaxTokens, maxTokens);\n }\n if (frequencyPenalty !== undefined) {\n span.setAttribute(Attr.GenAI.Request.FrequencyPenalty, frequencyPenalty);\n }\n if (presencePenalty !== undefined) {\n span.setAttribute(Attr.GenAI.Request.PresencePenalty, presencePenalty);\n }\n if (temperature !== undefined) {\n span.setAttribute(Attr.GenAI.Request.Temperature, temperature);\n }\n if (topP !== undefined) {\n span.setAttribute(Attr.GenAI.Request.TopP, topP);\n }\n if (topK !== undefined) {\n span.setAttribute(Attr.GenAI.Request.TopK, topK);\n }\n if (seed !== undefined) {\n span.setAttribute(Attr.GenAI.Request.Seed, seed);\n }\n if (stopSequences && stopSequences.length > 0) {\n span.setAttribute(Attr.GenAI.Request.StopSequences, JSON.stringify(stopSequences));\n }\n}\n\n/**\n * Creates a child span for stream processing\n * This provides granular visibility into stream consumption phases\n */\nexport function createStreamChildSpan(parentSpan: Span, operationName: string): Span {\n const tracer = getTracer();\n\n // Create child span by setting parent context\n const ctx = context.active();\n const spanContext = trace.setSpan(ctx, parentSpan);\n const childSpan = tracer.startSpan(operationName, undefined, spanContext);\n\n return childSpan;\n}\n\n/**\n * Records an error on a span with proper classification and attributes\n * Consolidates all error handling logic in one place\n */\nfunction recordSpanError(span: Span, err: unknown): void {\n // Enhanced error handling for OpenTelemetry compliance\n if (err instanceof Error) {\n span.recordException(err);\n } else {\n span.recordException({\n message: String(err),\n name: 'UnknownError',\n });\n }\n\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err instanceof Error ? err.message : String(err),\n });\n\n // MANDATORY: Add OpenTelemetry error attributes for cross-vendor compatibility\n const errorType = classifyError(err);\n span.setAttribute(Attr.Error.Type, errorType ?? 'unknown');\n\n // OPTIONAL: Add human-readable error message\n if (err instanceof Error && err.message) {\n span.setAttribute(Attr.Error.Message, err.message);\n }\n\n // For Vercel AI SDK specific errors, add HTTP status if available\n if (err && typeof err === 'object' && 'status' in err) {\n span.setAttribute(Attr.HTTP.Response.StatusCode, err.status as AttributeValue);\n }\n}\n\n/**\n * Common span handling logic for V1, V2 and V3\n * Returns a SpanLease that indicates whether the middleware owns the span\n */\nexport async function withSpanHandling<T>(\n modelId: string,\n operation: (span: Span, context: GenAiSpanContext, lease: SpanLease) => Promise<T>,\n options?: { streaming?: boolean; version?: 'v1' | 'v2' | 'v3' },\n): Promise<T> {\n const bag = propagation.getActiveBaggage();\n const isWithinWithSpan = bag?.getEntry(WITHSPAN_BAGGAGE_KEY)?.value === 'true';\n\n const spanContext: GenAiSpanContext =\n options?.version === 'v3'\n ? { version: 'v3', originalPrompt: [], originalV3Prompt: undefined }\n : options?.version === 'v2'\n ? { version: 'v2', originalPrompt: [], originalV2Prompt: undefined }\n : { version: 'v1', originalPrompt: [], rawCall: undefined };\n\n const name = createGenAISpanName(Attr.GenAI.Operation.Name_Values.Chat, modelId);\n\n if (isWithinWithSpan) {\n // Reuse existing span created by withSpan - we don't own it\n const activeSpan = trace.getActiveSpan();\n if (!activeSpan) {\n throw new Error('Expected active span when within withSpan');\n }\n activeSpan.updateName(name);\n\n const lease: SpanLease = {\n owned: false,\n end: () => {}, // No-op: we don't own this span\n };\n\n try {\n return await operation(activeSpan, spanContext, lease);\n } catch (err) {\n recordSpanError(activeSpan, err);\n throw err;\n }\n } else {\n // Create new span - we own it\n const tracer = getTracer();\n const startActiveSpan = createStartActiveSpan(tracer);\n\n return startActiveSpan(\n name,\n null,\n async (span) => {\n const lease: SpanLease = {\n owned: true,\n end: () => span.end(),\n };\n return await operation(span, spanContext, lease);\n },\n {\n manualEnd: options?.streaming ?? false,\n onError: (err, span) => {\n // createStartActiveSpan already calls span.recordException()\n // We only need to add our custom error classification attributes\n const errorType = classifyError(err);\n span.setAttribute(Attr.Error.Type, errorType ?? 'unknown');\n\n if (err instanceof Error && err.message) {\n span.setAttribute(Attr.Error.Message, err.message);\n }\n\n if (err && typeof err === 'object' && 'status' in err) {\n span.setAttribute(Attr.HTTP.Response.StatusCode, err.status as AttributeValue);\n }\n },\n },\n );\n }\n}\n\n/**\n * Sets common response attributes on a span\n */\nexport function setResponseAttributes(\n span: Span,\n response: {\n id?: string;\n modelId?: string;\n usage?: {\n inputTokens?: number;\n outputTokens?: number;\n promptTokens?: number;\n completionTokens?: number;\n };\n finishReason?: string;\n },\n): void {\n if (response.id) {\n span.setAttribute(Attr.GenAI.Response.ID, response.id);\n }\n if (response.modelId) {\n span.setAttribute(Attr.GenAI.Response.Model, response.modelId);\n }\n\n if (response.usage) {\n // Handle both V1 and V2 usage formats\n const inputTokens = ensureNumber(response.usage.inputTokens ?? response.usage.promptTokens);\n const outputTokens = ensureNumber(\n response.usage.outputTokens ?? response.usage.completionTokens,\n );\n\n if (inputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.InputTokens, inputTokens);\n }\n if (outputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.OutputTokens, outputTokens);\n }\n }\n\n if (response.finishReason) {\n span.setAttribute(Attr.GenAI.Response.FinishReasons, JSON.stringify([response.finishReason]));\n }\n}\n\n/**\n * Determines output type from response format - V1 version\n */\nexport function determineOutputTypeV1(options: {\n responseFormat?: { type?: string };\n mode?: { type?: string };\n}): string | undefined {\n if (options.responseFormat?.type) {\n switch (options.responseFormat.type) {\n case 'json':\n return Attr.GenAI.Output.Type_Values.Json;\n case 'text':\n return Attr.GenAI.Output.Type_Values.Text;\n }\n }\n\n if (options.mode?.type === 'object-json' || options.mode?.type === 'object-tool') {\n return Attr.GenAI.Output.Type_Values.Json;\n }\n\n if (options.mode?.type === 'regular') {\n return Attr.GenAI.Output.Type_Values.Text;\n }\n\n return undefined;\n}\n\n/**\n * Determines output type from response format - V2 version\n */\nexport function determineOutputTypeV2(options: {\n responseFormat?: { type?: string };\n}): string | undefined {\n if (options.responseFormat?.type) {\n switch (options.responseFormat.type) {\n case 'json':\n return Attr.GenAI.Output.Type_Values.Json;\n case 'text':\n return Attr.GenAI.Output.Type_Values.Text;\n }\n }\n\n return undefined;\n}\n\n/**\n * Determines output type from response format - V3 version\n * V3 uses the same response format structure as V2\n */\nexport function determineOutputTypeV3(options: {\n responseFormat?: { type?: string };\n}): string | undefined {\n if (options.responseFormat?.type) {\n switch (options.responseFormat.type) {\n case 'json':\n return Attr.GenAI.Output.Type_Values.Json;\n case 'text':\n return Attr.GenAI.Output.Type_Values.Text;\n }\n }\n\n return undefined;\n}\n\n/**\n * Maps AI SDK provider IDs to OpenTelemetry gen_ai.provider.name values\n *\n * @param vercelSDKProvider - The provider ID from the AI SDK\n * @returns The corresponding `gen_ai.provider.name` value, or `undefined` if no match is found\n */\nexport function mapVercelSDKProviderToOTelProvider(vercelSDKProvider: string): string | undefined {\n if (vercelSDKProvider === 'openai-compatible') {\n // we don't know the real provider\n return undefined;\n }\n\n // exact matches\n switch (vercelSDKProvider) {\n case 'amazon-bedrock':\n return Attr.GenAI.Provider.Name_Values.AWSBedrock;\n case 'anthropic':\n case 'anthropic.messages':\n return Attr.GenAI.Provider.Name_Values.Anthropic;\n case 'assemblyai':\n case 'assemblyai.transcription':\n return Attr.GenAI.Provider.Name_Values.AssemblyAI;\n case 'deepgram':\n case 'deepgram.transcription':\n return Attr.GenAI.Provider.Name_Values.Deepgram;\n case 'gateway': // `import { gateway } from 'ai'`\n return Attr.GenAI.Provider.Name_Values.Vercel;\n case 'gladia':\n case 'gladia.transcription':\n return Attr.GenAI.Provider.Name_Values.Gladia;\n case 'google':\n case 'google.generative-ai':\n return Attr.GenAI.Provider.Name_Values.GCPGemini;\n case 'groq':\n return Attr.GenAI.Provider.Name_Values.Groq;\n case 'mistral':\n return Attr.GenAI.Provider.Name_Values.MistralAI;\n case 'openai':\n return Attr.GenAI.Provider.Name_Values.OpenAI;\n case 'perplexity':\n return Attr.GenAI.Provider.Name_Values.Perplexity;\n case 'replicate':\n return Attr.GenAI.Provider.Name_Values.Replicate;\n case 'revai':\n case 'revai.transcription':\n return Attr.GenAI.Provider.Name_Values.RevAI;\n case 'togetherai':\n return Attr.GenAI.Provider.Name_Values.TogetherAI;\n case 'xai':\n return Attr.GenAI.Provider.Name_Values.XAI;\n\n // startswith + fall through\n default: {\n if (vercelSDKProvider.startsWith('azure.')) {\n return Attr.GenAI.Provider.Name_Values.AzureAIOpenAI;\n }\n if (vercelSDKProvider.startsWith('cerebras.')) {\n return Attr.GenAI.Provider.Name_Values.Cerebras;\n }\n if (vercelSDKProvider.startsWith('cohere.')) {\n return Attr.GenAI.Provider.Name_Values.Cohere;\n }\n if (vercelSDKProvider.startsWith('deepinfra.')) {\n return Attr.GenAI.Provider.Name_Values.DeepInfra;\n }\n if (vercelSDKProvider.startsWith('deepseek.')) {\n return Attr.GenAI.Provider.Name_Values.Deepseek;\n }\n if (vercelSDKProvider.startsWith('elevenlabs.')) {\n return Attr.GenAI.Provider.Name_Values.ElevenLabs;\n }\n if (vercelSDKProvider.startsWith('fal.')) {\n return Attr.GenAI.Provider.Name_Values.Fal;\n }\n if (vercelSDKProvider.startsWith('fireworks.')) {\n return Attr.GenAI.Provider.Name_Values.Fireworks;\n }\n if (vercelSDKProvider.startsWith('google.vertex.')) {\n return Attr.GenAI.Provider.Name_Values.GCPVertexAI;\n }\n if (vercelSDKProvider.startsWith('groq.')) {\n return Attr.GenAI.Provider.Name_Values.Groq;\n }\n if (vercelSDKProvider.startsWith('hume.')) {\n return Attr.GenAI.Provider.Name_Values.Hume;\n }\n if (vercelSDKProvider.startsWith('lmnt.')) {\n return Attr.GenAI.Provider.Name_Values.Lmnt;\n }\n if (vercelSDKProvider.startsWith('luma.')) {\n return Attr.GenAI.Provider.Name_Values.Luma;\n }\n if (vercelSDKProvider.startsWith('mistral.')) {\n return Attr.GenAI.Provider.Name_Values.MistralAI;\n }\n if (vercelSDKProvider.startsWith('openai.')) {\n return Attr.GenAI.Provider.Name_Values.OpenAI;\n }\n if (vercelSDKProvider.startsWith('vercel.')) {\n return Attr.GenAI.Provider.Name_Values.Vercel;\n }\n if (vercelSDKProvider.startsWith('vertex.anthropic.')) {\n return Attr.GenAI.Provider.Name_Values.GCPVertexAI;\n }\n if (vercelSDKProvider.startsWith('xai.')) {\n return Attr.GenAI.Provider.Name_Values.XAI;\n }\n\n // most other openai-compatible providers use {providerName}.{chat|completion|embedding|image}\n const s = vercelSDKProvider.split('.');\n if (s.length === 2) {\n return s[0];\n }\n\n // For unknown providers, don't set the attribute\n return undefined;\n }\n }\n}\n","export const SCHEMA_VERSION = '0.0.2';\nexport const SCHEMA_BASE_URL = 'https://axiom.co/ai/schemas/';\nexport const SCHEMA_URL = `${SCHEMA_BASE_URL}${SCHEMA_VERSION}`;\n","import { type Span, type SpanOptions, SpanStatusCode, type Tracer } from '@opentelemetry/api';\n\ninterface Callbacks {\n onSuccess?: (span: Span) => void;\n onError?: (error: unknown, span: Span) => void;\n onFinally?: (span: Span) => void;\n /**\n * If true, the operation will call span.end() manually.\n * Used for streaming operations where the span should remain open until stream consumption completes.\n */\n manualEnd?: boolean;\n}\n\nexport const createStartActiveSpan =\n (tracer: Tracer) =>\n async <T>(\n name: string,\n options: SpanOptions | null,\n fn: (span: Span) => Promise<T>,\n callbacks?: Callbacks,\n ): Promise<T> => {\n return tracer.startActiveSpan(name, { ...(options ?? {}) }, async (span) => {\n try {\n const result = await fn(span);\n\n callbacks?.onSuccess?.(span);\n\n return result;\n } catch (error) {\n callbacks?.onError?.(error, span);\n\n if (error instanceof Error) {\n span.recordException(error);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n }\n\n throw error;\n } finally {\n callbacks?.onFinally?.(span);\n\n // Only auto-end the span if manualEnd is not set\n // For streaming operations, the operation itself will call span.end() when the stream completes\n if (!callbacks?.manualEnd) {\n span.end();\n }\n }\n });\n };\n","import type {\n LanguageModelV1Prompt,\n LanguageModelV1FunctionToolCall,\n LanguageModelV1TextPart,\n LanguageModelV1ToolCallPart,\n} from '@ai-sdk/providerv1';\nimport type {\n LanguageModelV2Prompt,\n LanguageModelV2ToolCall,\n LanguageModelV2TextPart,\n LanguageModelV2ToolCallPart,\n LanguageModelV2ToolResultOutput,\n} from '@ai-sdk/providerv2';\nimport type {\n LanguageModelV3Prompt,\n LanguageModelV3ToolCall,\n LanguageModelV3TextPart,\n LanguageModelV3ToolCallPart,\n LanguageModelV3ToolResultOutput,\n} from '@ai-sdk/providerv3';\nimport type { OpenAIMessage, OpenAIContentPart } from '../vercelTypes';\n\n/**\n * Normalized tool call interface that can represent both V1 and V2 tool calls\n */\nexport interface NormalizedToolCall {\n toolCallId: string;\n toolName: string;\n args: string; // Always a JSON string for consistency\n toolCallType: 'function';\n}\n\n/**\n * Normalized result interface for both V1 and V2 generation results\n */\nexport interface NormalizedResult {\n text?: string;\n toolCalls?: NormalizedToolCall[];\n response?: { id?: string; modelId?: string };\n usage?: {\n promptTokens?: number;\n completionTokens?: number;\n inputTokens?: number;\n outputTokens?: number;\n };\n finishReason?: string;\n}\n\n/**\n * Normalizes a V1 tool call to the common format\n */\nfunction normalizeV1ToolCall(toolCall: LanguageModelV1FunctionToolCall): NormalizedToolCall {\n return {\n toolCallId: toolCall.toolCallId,\n toolName: toolCall.toolName,\n args: typeof toolCall.args === 'string' ? toolCall.args : JSON.stringify(toolCall.args),\n toolCallType: 'function',\n };\n}\n\n/**\n * Normalizes a V2 tool call to the common format\n */\nfunction normalizeV2ToolCall(toolCall: LanguageModelV2ToolCall): NormalizedToolCall {\n return {\n toolCallId: toolCall.toolCallId,\n toolName: toolCall.toolName,\n args:\n typeof toolCall.input === 'string'\n ? toolCall.input.replace(/:\\s+/g, ':')\n : JSON.stringify(toolCall.input),\n toolCallType: 'function',\n };\n}\n\n/**\n * Normalizes an array of V1 tool calls\n */\nexport function normalizeV1ToolCalls(\n toolCalls: LanguageModelV1FunctionToolCall[],\n): NormalizedToolCall[] {\n return toolCalls.map(normalizeV1ToolCall);\n}\n\n/**\n * Normalizes an array of V2 tool calls\n */\nexport function normalizeV2ToolCalls(toolCalls: LanguageModelV2ToolCall[]): NormalizedToolCall[] {\n return toolCalls.map(normalizeV2ToolCall);\n}\n\n/**\n * Normalizes a V3 tool call to the common format\n * V3 tool calls use `input` as a JSON string (similar to V2 but always string)\n */\nfunction normalizeV3ToolCall(toolCall: LanguageModelV3ToolCall): NormalizedToolCall {\n return {\n toolCallId: toolCall.toolCallId,\n toolName: toolCall.toolName,\n args: toolCall.input, // V3 input is always a string\n toolCallType: 'function',\n };\n}\n\n/**\n * Normalizes an array of V3 tool calls\n */\nexport function normalizeV3ToolCalls(toolCalls: LanguageModelV3ToolCall[]): NormalizedToolCall[] {\n return toolCalls.map(normalizeV3ToolCall);\n}\n\n/**\n * Converts a V1 prompt to OpenAI message format\n */\nexport function promptV1ToOpenAI(prompt: LanguageModelV1Prompt): OpenAIMessage[] {\n const results: OpenAIMessage[] = [];\n\n for (const message of prompt) {\n switch (message.role) {\n case 'system':\n results.push({\n role: 'system',\n content: message.content,\n });\n break;\n\n case 'assistant':\n const textPart = message.content.find((part) => part.type === 'text') as\n | LanguageModelV1TextPart\n | undefined;\n const toolCallParts = message.content.filter(\n (part) => part.type === 'tool-call',\n ) as LanguageModelV1ToolCallPart[];\n\n results.push({\n role: 'assistant',\n content: textPart?.text || null,\n ...(toolCallParts.length > 0\n ? {\n tool_calls: toolCallParts.map((part) => ({\n id: part.toolCallId,\n function: {\n name: part.toolName,\n arguments: JSON.stringify(part.args),\n },\n type: 'function',\n })),\n }\n : {}),\n });\n break;\n\n case 'user':\n results.push({\n role: 'user',\n content: message.content.map((part): OpenAIContentPart => {\n switch (part.type) {\n case 'text':\n return {\n type: 'text',\n text: part.text,\n };\n case 'image':\n return {\n type: 'image_url',\n image_url: {\n url: part.image.toString(),\n },\n };\n default:\n // Convert unknown content types to text for compatibility\n return {\n type: 'text',\n text:\n `[${part.type}]` +\n (typeof part === 'object' && part !== null\n ? JSON.stringify(part)\n : String(part)),\n };\n }\n }),\n });\n break;\n\n case 'tool':\n for (const part of message.content) {\n results.push({\n role: 'tool',\n tool_call_id: part.toolCallId,\n content: JSON.stringify(part.result),\n });\n }\n break;\n }\n }\n\n return results;\n}\n\n/**\n * Converts a V2 prompt to OpenAI message format\n */\nexport function promptV2ToOpenAI(prompt: LanguageModelV2Prompt): OpenAIMessage[] {\n const results: OpenAIMessage[] = [];\n\n for (const message of prompt) {\n switch (message.role) {\n case 'system':\n results.push({\n role: 'system',\n content: message.content,\n });\n break;\n\n case 'assistant':\n const textContent = message.content.find(\n (part): part is LanguageModelV2TextPart => part.type === 'text',\n );\n const toolCalls = message.content.filter(\n (part): part is LanguageModelV2ToolCallPart => part.type === 'tool-call',\n );\n\n results.push({\n role: 'assistant',\n content: textContent?.text || null,\n ...(toolCalls.length > 0\n ? {\n tool_calls: toolCalls.map((part) => ({\n id: part.toolCallId,\n function: {\n name: part.toolName,\n arguments:\n typeof part.input === 'string' ? part.input : JSON.stringify(part.input),\n },\n type: 'function',\n })),\n }\n : {}),\n });\n break;\n\n case 'user':\n results.push({\n role: 'user',\n content: message.content.map((part: any) => {\n switch (part.type) {\n case 'text':\n return {\n type: 'text',\n text: part.text,\n };\n case 'image':\n return {\n type: 'image_url',\n image_url: {\n url: part.image.toString(),\n },\n };\n default:\n // Handle unknown content types by passing them through\n return part as any;\n }\n }),\n });\n break;\n\n case 'tool':\n for (const part of message.content) {\n results.push({\n role: 'tool',\n tool_call_id: part.toolCallId,\n content: formatV2ToolCallOutput(part.output),\n });\n }\n break;\n }\n }\n\n return results;\n}\n\nfunction formatV2ToolCallOutput(output: LanguageModelV2ToolResultOutput) {\n switch (output.type) {\n case 'text':\n return output.value;\n case 'json':\n return typeof output.value === 'string' ? output.value : JSON.stringify(output.value);\n case 'error-text':\n return output.value;\n case 'error-json':\n return typeof output.value === 'string' ? output.value : JSON.stringify(output.value);\n case 'content':\n return JSON.stringify(output.value);\n }\n}\n\n/**\n * Converts a V3 prompt to OpenAI message format\n * V3 is very similar to V2 but with slightly different type structure\n */\nexport function promptV3ToOpenAI(prompt: LanguageModelV3Prompt): OpenAIMessage[] {\n const results: OpenAIMessage[] = [];\n\n for (const message of prompt) {\n switch (message.role) {\n case 'system':\n results.push({\n role: 'system',\n content: message.content,\n });\n break;\n\n case 'assistant':\n const textContent = message.content.find(\n (part): part is LanguageModelV3TextPart => part.type === 'text',\n );\n const toolCalls = message.content.filter(\n (part): part is LanguageModelV3ToolCallPart => part.type === 'tool-call',\n );\n\n results.push({\n role: 'assistant',\n content: textContent?.text || null,\n ...(toolCalls.length > 0\n ? {\n tool_calls: toolCalls.map((part) => ({\n id: part.toolCallId,\n function: {\n name: part.toolName,\n // V3 input can be unknown (usually object), convert to string\n arguments:\n typeof part.input === 'string' ? part.input : JSON.stringify(part.input),\n },\n type: 'function',\n })),\n }\n : {}),\n });\n break;\n\n case 'user':\n results.push({\n role: 'user',\n content: message.content.map((part: any) => {\n switch (part.type) {\n case 'text':\n return {\n type: 'text',\n text: part.text,\n };\n case 'file':\n // V3 files - represent as text with media type info\n return {\n type: 'text',\n text: `[file: ${part.mediaType}]`,\n };\n default:\n // Handle unknown content types by passing them through\n return part as any;\n }\n }),\n });\n break;\n\n case 'tool':\n for (const part of message.content) {\n // Skip tool-approval-response parts - they don't have output\n if (part.type === 'tool-result') {\n results.push({\n role: 'tool',\n tool_call_id: part.toolCallId,\n content: formatV3ToolCallOutput(part.output),\n });\n }\n }\n break;\n }\n }\n\n return results;\n}\n\nfunction formatV3ToolCallOutput(output: LanguageModelV3ToolResultOutput) {\n switch (output.type) {\n case 'text':\n return output.value;\n case 'json':\n return typeof output.value === 'string' ? output.value : JSON.stringify(output.value);\n case 'error-text':\n return output.value;\n case 'error-json':\n return typeof output.value === 'string' ? output.value : JSON.stringify(output.value);\n case 'content':\n return JSON.stringify(output.value);\n case 'execution-denied':\n return output.reason ?? 'Execution denied';\n }\n}\n","import {\n type LanguageModelV1StreamPart,\n type LanguageModelV1FunctionToolCall,\n type LanguageModelV1FinishReason,\n} from '@ai-sdk/providerv1';\n\nimport {\n type LanguageModelV2StreamPart,\n type LanguageModelV2ToolCall,\n type LanguageModelV2FinishReason,\n type LanguageModelV2Usage,\n type LanguageModelV2ResponseMetadata,\n} from '@ai-sdk/providerv2';\n\nimport {\n type LanguageModelV3StreamPart,\n type LanguageModelV3ToolCall,\n type LanguageModelV3FinishReason,\n type LanguageModelV3Usage,\n type LanguageModelV3ResponseMetadata,\n} from '@ai-sdk/providerv3';\n\nimport { currentUnixTime } from '../../util/currentUnixTime';\n\n// V1-specific aggregators (the original ones)\nexport class ToolCallAggregator {\n private readonly calls: Record<string, LanguageModelV1FunctionToolCall> = {};\n\n handleChunk(chunk: LanguageModelV1StreamPart): void {\n switch (chunk.type) {\n case 'tool-call':\n this.calls[chunk.toolCallId] = {\n toolCallType: chunk.toolCallType,\n toolCallId: chunk.toolCallId,\n toolName: chunk.toolName,\n args: chunk.args,\n };\n break;\n case 'tool-call-delta':\n if (!this.calls[chunk.toolCallId]) {\n this.calls[chunk.toolCallId] = {\n toolCallType: chunk.toolCallType,\n toolCallId: chunk.toolCallId,\n toolName: chunk.toolName,\n args: '',\n };\n }\n this.calls[chunk.toolCallId].args += chunk.argsTextDelta;\n break;\n }\n }\n\n get result(): LanguageModelV1FunctionToolCall[] {\n return Object.values(this.calls);\n }\n}\n\nexport class TextAggregator {\n private content = '';\n\n feed(chunk: LanguageModelV1StreamPart): void {\n if (chunk.type === 'text-delta') {\n this.content += chunk.textDelta;\n }\n }\n\n get text(): string | undefined {\n return this.content || undefined;\n }\n}\n\nexport class StreamStats {\n private startTime: number;\n private timeToFirstToken?: number;\n private _usage?: { promptTokens: number; completionTokens: number };\n private _finishReason?: LanguageModelV1FinishReason;\n private _responseId?: string;\n private _responseModelId?: string;\n\n constructor() {\n this.startTime = currentUnixTime();\n }\n\n feed(chunk: LanguageModelV1StreamPart): void {\n // Track time to first token on any chunk\n if (this.timeToFirstToken === undefined) {\n this.timeToFirstToken = currentUnixTime() - this.startTime;\n }\n\n switch (chunk.type) {\n case 'response-metadata':\n if (chunk.id) {\n this._responseId = chunk.id;\n }\n if (chunk.modelId) {\n this._responseModelId = chunk.modelId;\n }\n\n break;\n case 'finish':\n this._usage = chunk.usage;\n this._finishReason = chunk.finishReason;\n break;\n }\n }\n\n get result() {\n return {\n response:\n this._responseId || this._responseModelId\n ? {\n id: this._responseId,\n modelId: this._responseModelId,\n }\n : undefined,\n finishReason: this._finishReason,\n usage: this._usage,\n };\n }\n\n get firstTokenTime(): number | undefined {\n return this.timeToFirstToken;\n }\n}\n\n// V2-specific aggregators\nexport class ToolCallAggregatorV2 {\n private readonly calls: Record<string, LanguageModelV2ToolCall> = {};\n\n handleChunk(chunk: LanguageModelV2StreamPart): void {\n if (chunk.type === 'tool-call') {\n this.calls[chunk.toolCallId] = chunk;\n }\n }\n\n get result(): LanguageModelV2ToolCall[] {\n return Object.values(this.calls);\n }\n}\n\nexport class TextAggregatorV2 {\n private content = '';\n\n feed(chunk: LanguageModelV2StreamPart): void {\n // TODO: @cje - is this enough?\n switch (chunk.type) {\n case 'text-start':\n this.content = '';\n break;\n case 'text-delta':\n this.content += chunk.delta;\n break;\n case 'text-end':\n break;\n }\n }\n\n get text(): string | undefined {\n return this.content || undefined;\n }\n}\n\nexport class StreamStatsV2 {\n private startTime: number;\n private timeToFirstToken?: number;\n private _usage?: LanguageModelV2Usage;\n private _finishReason?: LanguageModelV2FinishReason;\n private _responseMetadata?: LanguageModelV2ResponseMetadata;\n\n constructor() {\n this.startTime = currentUnixTime();\n }\n\n feed(chunk: LanguageModelV2StreamPart): void {\n // Track time to first token on any chunk\n if (this.timeToFirstToken === undefined) {\n this.timeToFirstToken = currentUnixTime() - this.startTime;\n }\n\n switch (chunk.type) {\n case 'response-metadata':\n this._responseMetadata = {\n id: chunk.id,\n modelId: chunk.modelId,\n timestamp: chunk.timestamp,\n };\n break;\n case 'finish':\n this._usage = chunk.usage;\n this._finishReason = chunk.finishReason;\n break;\n }\n }\n\n get result() {\n return {\n response: this._responseMetadata,\n finishReason: this._finishReason,\n usage: this._usage,\n };\n }\n\n get firstTokenTime(): number | undefined {\n return this.timeToFirstToken;\n }\n}\n\n// V3-specific aggregators\nexport class ToolCallAggregatorV3 {\n private readonly calls: Record<string, LanguageModelV3ToolCall> = {};\n private readonly pendingInputs: Record<string, { toolName: string; input: string }> = {};\n\n handleChunk(chunk: LanguageModelV3StreamPart): void {\n switch (chunk.type) {\n case 'tool-call':\n this.calls[chunk.toolCallId] = chunk;\n break;\n case 'tool-input-start':\n this.pendingInputs[chunk.id] = { toolName: chunk.toolName, input: '' };\n break;\n case 'tool-input-delta':\n if (this.pendingInputs[chunk.id]) {\n this.pendingInputs[chunk.id].input += chunk.delta;\n }\n break;\n case 'tool-input-end':\n // Tool input streaming completed - the full tool-call chunk will follow\n break;\n }\n }\n\n get result(): LanguageModelV3ToolCall[] {\n return Object.values(this.calls);\n }\n}\n\nexport class TextAggregatorV3 {\n private content = '';\n\n feed(chunk: LanguageModelV3StreamPart): void {\n switch (chunk.type) {\n case 'text-start':\n this.content = '';\n break;\n case 'text-delta':\n this.content += chunk.delta;\n break;\n case 'text-end':\n break;\n }\n }\n\n get text(): string | undefined {\n return this.content || undefined;\n }\n}\n\nexport class StreamStatsV3 {\n private startTime: number;\n private timeToFirstToken?: number;\n private _usage?: LanguageModelV3Usage;\n private _finishReason?: LanguageModelV3FinishReason;\n private _responseMetadata?: LanguageModelV3ResponseMetadata;\n\n constructor() {\n this.startTime = currentUnixTime();\n }\n\n feed(chunk: LanguageModelV3StreamPart): void {\n // Track time to first token on any chunk\n if (this.timeToFirstToken === undefined) {\n this.timeToFirstToken = currentUnixTime() - this.startTime;\n }\n\n switch (chunk.type) {\n case 'response-metadata':\n this._responseMetadata = {\n id: chunk.id,\n modelId: chunk.modelId,\n timestamp: chunk.timestamp,\n };\n break;\n case 'finish':\n this._usage = chunk.usage;\n this._finishReason = chunk.finishReason;\n break;\n }\n }\n\n get result() {\n return {\n response: this._responseMetadata,\n finishReason: this._finishReason,\n usage: this._usage,\n };\n }\n\n get firstTokenTime(): number | undefined {\n return this.timeToFirstToken;\n }\n}\n","export function currentUnixTime(): number {\n return Date.now() / 1000;\n}\n","import { type LanguageModelV2, type LanguageModelV2CallOptions } from '@ai-sdk/providerv2';\nimport { axiomAIMiddlewareV2 } from './middleware';\n\nexport function isLanguageModelV2(model: any): model is LanguageModelV2 {\n return (\n model?.specificationVersion === 'v2' &&\n typeof model?.provider === 'string' &&\n typeof model?.modelId === 'string'\n );\n}\n\n/**\n * Wraps a LanguageModelV2 to provide OpenTelemetry instrumentation.\n *\n * Internally uses Axiom's telemetry middleware while maintaining a simple class-based API.\n *\n * @example\n * ```typescript\n * import { AxiomWrappedLanguageModelV2 } from '@axiom/ai';\n * import { anthropic } from '@ai-sdk/anthropic';\n *\n * const model = new AxiomWrappedLanguageModelV2(anthropic('claude-3-haiku-20240307'));\n * ```\n *\n * For advanced use cases, you can also use the middleware directly:\n * ```typescript\n * import { wrapLanguageModel } from 'ai';\n * import { createAxiomTelemetryV2 } from '@axiom/ai';\n *\n * const model = wrapLanguageModel({\n * model: yourV2Model,\n * middleware: createAxiomTelemetryV2(),\n * });\n * ```\n */\nexport class AxiomWrappedLanguageModelV2 {\n constructor(model: LanguageModelV2) {\n const middleware = axiomAIMiddlewareV2();\n\n // Return the wrapped model directly from constructor\n return {\n specificationVersion: model.specificationVersion,\n provider: model.provider,\n modelId: model.modelId,\n supportedUrls: model.supportedUrls,\n\n doGenerate: async (params: LanguageModelV2CallOptions) => {\n return middleware.wrapGenerate!({\n doGenerate: () => model.doGenerate(params),\n doStream: () => model.doStream(params),\n params,\n model,\n });\n },\n\n doStream: async (params: LanguageModelV2CallOptions) => {\n return middleware.wrapStream!({\n doGenerate: () => model.doGenerate(params),\n doStream: () => model.doStream(params),\n params,\n model,\n });\n },\n } as LanguageModelV2;\n }\n}\n","import { type LanguageModelV3, type LanguageModelV3CallOptions } from '@ai-sdk/providerv3';\nimport { axiomAIMiddlewareV3 } from './middleware';\n\nexport function isLanguageModelV3(model: unknown): model is LanguageModelV3 {\n return (\n model != null &&\n typeof model === 'object' &&\n 'specificationVersion' in model &&\n 'provider' in model &&\n 'modelId' in model &&\n (model as any).specificationVersion === 'v3' &&\n typeof (model as any).provider === 'string' &&\n typeof (model as any).modelId === 'string'\n );\n}\n\n/**\n * Wraps a LanguageModelV3 to provide OpenTelemetry instrumentation.\n *\n * Internally uses Axiom's telemetry middleware while maintaining a simple class-based API.\n *\n * @example\n * ```typescript\n * import { AxiomWrappedLanguageModelV3 } from '@axiom/ai';\n * import { anthropic } from '@ai-sdk/anthropic';\n *\n * const model = new AxiomWrappedLanguageModelV3(anthropic('claude-sonnet-4-20250514'));\n * ```\n *\n * For advanced use cases, you can also use the middleware directly:\n * ```typescript\n * import { wrapLanguageModel } from 'ai';\n * import { createAxiomTelemetryV3 } from '@axiom/ai';\n *\n * const model = wrapLanguageModel({\n * model: yourV3Model,\n * middleware: createAxiomTelemetryV3(),\n * });\n * ```\n */\nexport class AxiomWrappedLanguageModelV3 {\n constructor(model: LanguageModelV3) {\n const middleware = axiomAIMiddlewareV3();\n\n // Return the wrapped model directly from constructor\n return {\n specificationVersion: model.specificationVersion,\n provider: model.provider,\n modelId: model.modelId,\n supportedUrls: model.supportedUrls,\n\n doGenerate: async (params: LanguageModelV3CallOptions) => {\n return middleware.wrapGenerate!({\n doGenerate: () => model.doGenerate(params),\n doStream: () => model.doStream(params),\n params,\n model,\n });\n },\n\n doStream: async (params: LanguageModelV3CallOptions) => {\n return middleware.wrapStream!({\n doGenerate: () => model.doGenerate(params),\n doStream: () => model.doStream(params),\n params,\n model,\n });\n },\n } as LanguageModelV3;\n }\n}\n","import {\n context,\n propagation,\n trace,\n SpanStatusCode,\n type Span,\n type Baggage,\n type Tracer,\n} from '@opentelemetry/api';\n\nimport { WITHSPAN_BAGGAGE_KEY, WITHSPAN_REDACTION_POLICY_KEY } from './withSpanBaggageKey';\nimport { getTracer } from './utils/wrapperUtils';\nimport type { AxiomAIRedactionPolicy } from './utils/redaction';\nimport type { ValidateName } from '../util/name-validation';\nimport { isValidName } from '../util/name-validation-runtime';\n\n/**\n * Metadata for categorizing and tracking spans within the AI application.\n */\ntype WithSpanMeta = {\n /** High-level capability being performed (e.g., 'text_generation', 'chat', 'analysis') */\n capability: string;\n /** Specific step within the capability (e.g., 'generate_response', 'summarize', 'extract') */\n step: string;\n /** Optional conversation ID to correlate spans across a multi-turn conversation */\n conversationId?: string;\n};\n\n/**\n * Wrap Vercel AI SDK functions like `generateText` and `streamText` in an OpenTelemetry span.\n *\n * Automatically detects and handles different response types:\n * - **Response streams**: Keeps span alive during entire stream consumption\n * - **Streaming objects**: Warns about incorrect usage patterns\n * - **Regular objects**: Ends span immediately after function completion\n *\n * The span name will be updated by the AI SDK middleware from 'chat'\n * to a model-specific name like 'chat gpt-4o-mini' when used with wrapped models.\n *\n * @param meta - Span metadata for categorization and tracking\n * @param meta.capability - High-level capability being performed (e.g., 'customer_support', 'meeting_summarizer')\n * @param meta.step - Specific step within the capability (e.g., 'categorize_message', 'transcribe_audio')\n * @param fn - Function to execute within the span context. Receives the span as a parameter so you can add additional attributes.\n * @param opts - Optional configuration\n * @param opts.tracer - Custom OpenTelemetry tracer instance. Defaults to the tracer provided by `initAxiomAI`.\n * @param opts.timeoutMs - Timeout for abandoned streams. Defaults to 600,000 (10 minutes).\n * @param opts.redactionPolicy - Optional redaction policy to override global policy for this span.\n *\n * @returns Promise that resolves to the same value as the wrapped function\n *\n * @example \n * // Non-streaming usage\n * const result = await withSpan(\n * { capability: 'text_generation', step: 'generate' },\n * async (span) => {\n * span.setAttribute('user.id', userId); // can set attributes on the span\n * const result = await generateObject({ model, prompt });\n * // can do something with the result here, eg set additional attributes\n * return result\n * }\n * );\n *\n * @example \n * // Streaming usage with `@ai-sdk/react` in the frontend\n * ```ts\n * const response = withSpan(\n * { capability: 'chat', step: 'stream_chat' },\n * async (span) => {\n * span.setAttribute('user.id', userId);\n * const result = streamText({ model, messages });\n * return result.toUIMessageStreamResponse();\n * }\n * );\n * ```\n * \n * @example \n * // Streaming usage with express\n * ```ts\n * await withSpan(\n * { capability: 'chat', step: 'stream_chat' },\n * async (span) => {\n * span.setAttribute('user.id', userId);\n *\n * const { textStream } = streamText({ model, messages });\n *\n * // Keep span open during entire stream consumption\n * for await (const chunk of textStream) {\n * res.write(chunk);\n * }\n * }\n * );\n\n * res.end();\n * ```\n */\n/**\n * Options for withSpan configuration.\n */\nexport type WithSpanOptions = {\n /** Custom OpenTelemetry tracer instance */\n tracer?: Tracer;\n /** Timeout for abandoned streams (default: 600,000ms / 10 minutes) */\n timeoutMs?: number;\n /** Redaction policy to override global policy for this span */\n redactionPolicy?: AxiomAIRedactionPolicy;\n};\n\nexport function withSpan<Return, Capability extends string = string, Step extends string = string>(\n meta: WithSpanMeta & {\n capability: ValidateName<Capability>;\n step: ValidateName<Step>;\n },\n fn: (span: Span) => Promise<Return>,\n opts?: WithSpanOptions,\n): Promise<Return> {\n const tracer = opts?.tracer ?? getTracer();\n\n // Create span manually to control its lifecycle\n const span = tracer.startSpan('chat');\n const spanContext = trace.setSpan(context.active(), span);\n\n return context.with(spanContext, async () => {\n const capabilityValidation = isValidName(meta.capability);\n if (!capabilityValidation.valid) {\n console.warn(`[AxiomAI] Invalid capability name: ${capabilityValidation.error}. `);\n }\n\n const stepValidation = isValidName(meta.step);\n if (!stepValidation.valid) {\n console.warn(`[AxiomAI] Invalid step name: ${stepValidation.error}. `);\n }\n\n if (!span.isRecording()) {\n const provider = trace.getTracerProvider();\n const providerIsNoOp = provider.constructor.name === 'NoopTracerProvider';\n\n // We don't warn for other non-recording cases (sampling=DROP, etc.) as those may be intentional\n if (providerIsNoOp) {\n const isDebug = process.env.AXIOM_DEBUG === 'true';\n if (!isDebug) {\n console.warn(\n '[AxiomAI] No TracerProvider registered - spans are no-op. Make sure to call initAxiomAI() after your OpenTelemetry SDK has started.',\n );\n }\n }\n }\n\n const bag: Baggage = propagation.createBaggage({\n capability: { value: meta.capability },\n step: { value: meta.step },\n // TODO: maybe we can just check the active span name instead?\n [WITHSPAN_BAGGAGE_KEY]: { value: 'true' }, // Mark that we're inside withSpan\n // Store serialized redaction policy if provided\n ...(opts?.redactionPolicy && {\n [WITHSPAN_REDACTION_POLICY_KEY]: { value: JSON.stringify(opts.redactionPolicy) },\n }),\n // Store conversation ID if provided\n ...(meta.conversationId && {\n conversationId: { value: meta.conversationId },\n }),\n });\n\n const ctx = propagation.setBaggage(context.active(), bag);\n\n let spanEnded = false;\n const safeEndSpan = () => {\n if (!spanEnded) {\n spanEnded = true;\n span.end();\n }\n };\n\n // Timeout fallback for abandoned streams\n const timeoutMs = opts?.timeoutMs ?? 600_000; // 10 minutes default\n const timeoutId = setTimeout(() => {\n safeEndSpan();\n }, timeoutMs);\n\n try {\n const result = await context.with(ctx, () => fn(span));\n\n // Auto-detect Response streams and keep span alive during consumption\n if (result instanceof Response && result.body) {\n // Check if body is already locked\n if (result.body.locked) {\n console.warn('[AxiomAI] Response body is already locked, cannot instrument stream');\n clearTimeout(timeoutId);\n safeEndSpan();\n return result;\n }\n\n const originalReader = result.body.getReader();\n const wrappedStream = new ReadableStream({\n async pull(controller) {\n try {\n const { value, done } = await context.with(ctx, () => originalReader.read());\n if (done) {\n originalReader.releaseLock?.();\n clearTimeout(timeoutId);\n span.setStatus({ code: SpanStatusCode.OK });\n safeEndSpan();\n controller.close();\n } else {\n controller.enqueue(value);\n }\n } catch (err) {\n originalReader.releaseLock?.();\n clearTimeout(timeoutId);\n span.recordException(err as Error);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err instanceof Error ? err.message : String(err),\n });\n safeEndSpan();\n controller.error(err);\n }\n },\n async cancel(reason: unknown) {\n try {\n originalReader.releaseLock?.();\n clearTimeout(timeoutId);\n if (reason instanceof Error) {\n span.recordException(reason);\n } else if (reason) {\n span.recordException({ message: String(reason), name: 'CancelError' });\n }\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: reason instanceof Error ? reason.message : String(reason),\n });\n safeEndSpan();\n await originalReader.cancel(reason);\n } catch (_err) {\n // Ignore cancel errors\n }\n },\n });\n\n return new Response(wrappedStream, {\n status: result.status,\n statusText: result.statusText,\n headers: result.headers,\n }) as Return;\n }\n\n // Auto-detect Vercel AI SDK streaming objects (streamText returns object with textStream)\n if (result && typeof result === 'object' && 'textStream' in result) {\n console.warn(\n '[AxiomAI] Detected streaming object with textStream. For proper span lifecycle, call .toUIMessageStreamResponse() or similar inside withSpan, not after.',\n );\n clearTimeout(timeoutId);\n safeEndSpan(); // End span immediately to prevent memory leak\n return result;\n }\n\n // Non-stream path: end span immediately\n clearTimeout(timeoutId);\n span.setStatus({ code: SpanStatusCode.OK });\n safeEndSpan();\n return result;\n } catch (err) {\n clearTimeout(timeoutId);\n span.recordException(err as Error);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err instanceof Error ? err.message : String(err),\n });\n safeEndSpan();\n throw err;\n }\n });\n}\n","/**\n * Validates that a name contains only allowed characters (A-Z, a-z, 0-9, -, _)\n * and is not empty.\n *\n * @returns Object with validation result and optional error message\n */\nexport function isValidName(name: string): { valid: true } | { valid: false; error: string } {\n if (name === '') {\n return { valid: false, error: 'Name cannot be empty' };\n }\n\n const validPattern = /^[A-Za-z0-9_-]+$/;\n if (!validPattern.test(name)) {\n return {\n valid: false,\n error: `Invalid character in \"${name}\". Only A-Z, a-z, 0-9, -, _ allowed`,\n };\n }\n\n return { valid: true };\n}\n","import { context, trace, SpanStatusCode, type SpanContext } from '@opentelemetry/api';\nimport { getGlobalTracer } from '../otel/initAxiomAI';\nimport type {\n OnlineEvalScorerEntry,\n OnlineEvalScorerInput,\n SampledOnlineEvalScorer,\n Scorer,\n ScorerResult,\n ScorerSampling,\n} from './types';\nimport { executeScorer } from './executor';\nimport { Attr } from '../otel/semconv/attributes';\n\ntype ScorerEntry<TInput, TOutput> = OnlineEvalScorerEntry<TInput, TOutput, any>;\ntype ScorerInput<TInput, TOutput> = OnlineEvalScorerInput<TInput, TOutput, any>;\n\ntype InferScorerMetadata<TScorerEntry> =\n TScorerEntry extends SampledOnlineEvalScorer<any, any, any>\n ? InferScorerMetadata<TScorerEntry['scorer']>\n : TScorerEntry extends Scorer<any, any, infer TMetadata>\n ? TMetadata\n : TScorerEntry extends ScorerResult<infer TMetadata>\n ? TMetadata\n : never;\n\ntype InferScorerName<TScorerEntry> =\n TScorerEntry extends SampledOnlineEvalScorer<any, any, any>\n ? InferScorerName<TScorerEntry['scorer']>\n : TScorerEntry extends ScorerResult<any>\n ? TScorerEntry['name']\n : TScorerEntry extends Scorer<any, any, any>\n ? string\n : never;\n\ntype IsBroadString<T extends string> = string extends T ? true : false;\n\ntype DuplicateScorerNames<\n TEntries extends readonly unknown[],\n Seen extends string = never,\n Duplicates extends string = never,\n> = TEntries extends readonly [infer Head, ...infer Tail]\n ? InferScorerName<Head> extends infer ScorerName\n ? ScorerName extends string\n ? IsBroadString<ScorerName> extends true\n ? DuplicateScorerNames<Tail extends readonly unknown[] ? Tail : never, Seen, Duplicates>\n : ScorerName extends Seen\n ? DuplicateScorerNames<\n Tail extends readonly unknown[] ? Tail : never,\n Seen,\n Duplicates | ScorerName\n >\n : DuplicateScorerNames<\n Tail extends readonly unknown[] ? Tail : never,\n Seen | ScorerName,\n Duplicates\n >\n : DuplicateScorerNames<Tail extends readonly unknown[] ? Tail : never, Seen, Duplicates>\n : never\n : Duplicates;\n\ntype EnsureUniqueScorerNames<TEntries extends readonly unknown[]> = [\n DuplicateScorerNames<TEntries>,\n] extends [never]\n ? TEntries\n : never & {\n __axiomDuplicateScorerNames__: DuplicateScorerNames<TEntries>;\n };\n\ntype InferOnlineEvalResult<TScorers extends readonly unknown[]> = ScorerResult<\n InferScorerMetadata<TScorers[number]>\n>;\n\ntype InferOnlineEvalResultRecord<TScorers extends readonly unknown[]> = Partial<\n Record<Extract<InferScorerName<TScorers[number]>, string>, InferOnlineEvalResult<TScorers>>\n>;\n\ntype NormalizedScorerEntry<TInput, TOutput> = {\n name: string;\n scorer: ScorerInput<TInput, TOutput>;\n sampling?: ScorerSampling<TInput, TOutput>;\n};\n\n/**\n * Metadata for categorizing online evaluations.\n */\nexport type OnlineEvalMeta = {\n /** High-level capability being evaluated (e.g., 'qa', 'summarization') */\n capability: string;\n /** Specific step within the capability (e.g., 'answer', 'extract') */\n step?: string;\n /**\n * Explicit SpanContext to link the eval span to the originating generation span.\n * When omitted, the active span's context is used automatically.\n * Use this for deferred evaluation when onlineEval is called after the\n * originating span has completed.\n */\n link?: SpanContext;\n};\n\n/**\n * Options for online evaluation.\n */\nexport type OnlineEvalOptions<\n TInput,\n TOutput,\n TScorers extends readonly ScorerEntry<TInput, TOutput>[] = readonly ScorerEntry<\n TInput,\n TOutput\n >[],\n> = {\n /** Input to pass to scorers (optional - only needed for input+output scorers) */\n input?: TInput;\n /** Output to evaluate */\n output: TOutput;\n /** Scorers or precomputed scores. Supports optional per-scorer sampling. */\n scorers: EnsureUniqueScorerNames<TScorers>;\n};\n\n/**\n * Determines if an individual scorer should run based on sampling configuration.\n */\nasync function shouldSample<TInput, TOutput>(\n sampling: ScorerSampling<TInput, TOutput> | undefined,\n args: { input?: TInput; output: TOutput },\n): Promise<boolean> {\n if (sampling === undefined) return true;\n if (typeof sampling === 'number') {\n if (sampling >= 1) return true;\n if (sampling <= 0) return false;\n return Math.random() < sampling;\n }\n return Boolean(await sampling(args));\n}\n\nfunction isSampledScorerEntry<TInput, TOutput>(\n entry: ScorerEntry<TInput, TOutput>,\n): entry is SampledOnlineEvalScorer<TInput, TOutput, any> {\n return typeof entry === 'object' && entry !== null && 'scorer' in entry;\n}\n\nfunction resolveScorerName<TInput, TOutput>(scorer: ScorerInput<TInput, TOutput>): string {\n if (typeof scorer === 'function') {\n return scorer.name || 'unknown';\n }\n return scorer.name;\n}\n\nfunction normalizeScorerEntry<TInput, TOutput>(\n entry: ScorerEntry<TInput, TOutput>,\n): NormalizedScorerEntry<TInput, TOutput> {\n if (isSampledScorerEntry(entry)) {\n return {\n name: resolveScorerName(entry.scorer),\n scorer: entry.scorer,\n sampling: entry.sampling,\n };\n }\n\n return {\n name: resolveScorerName(entry),\n scorer: entry,\n };\n}\n\nfunction getDuplicateScorerNames<TInput, TOutput>(\n entries: readonly NormalizedScorerEntry<TInput, TOutput>[],\n): string[] {\n const nameCounts = new Map<string, number>();\n\n for (const entry of entries) {\n nameCounts.set(entry.name, (nameCounts.get(entry.name) ?? 0) + 1);\n }\n\n return [...nameCounts.entries()]\n .filter(([, count]) => count > 1)\n .map(([name]) => name)\n .sort();\n}\n\n/**\n * Run online evaluation scorers against production outputs.\n *\n * Returns a promise that resolves to scorer results. Use `void onlineEval(...)`\n * for fire-and-forget, or `await onlineEval(...)` when you need to wait for\n * completion (e.g., before flushing telemetry in short-lived processes).\n *\n * Each eval span links back to the originating generation span via an\n * OpenTelemetry span link. Parent/child hierarchy follows natural context\n * propagation — inside `withSpan` the eval is a child, outside it depends\n * on the active context.\n *\n * ## Usage Patterns\n *\n * **Inside withSpan (recommended):**\n * Active span is automatically detected and linked.\n * ```ts\n * await withSpan({ capability: 'qa', step: 'answer' }, async () => {\n * const response = await generateText({ ... });\n * void onlineEval(\n * { capability: 'qa', step: 'answer' },\n * { output: response.text, scorers: [formatScorer] }\n * );\n * return response.text;\n * });\n * ```\n *\n * **Deferred evaluation with explicit link:**\n * Pass the originating span's context for linking when evaluating later.\n * ```ts\n * let spanCtx: SpanContext;\n * const result = await withSpan({ ... }, async (span) => {\n * spanCtx = span.spanContext();\n * return await generateText({ ... });\n * });\n * void onlineEval({ ..., link: spanCtx }, { output: result, scorers });\n * ```\n *\n * **Awaiting for flush (short-lived processes):**\n * ```ts\n * await onlineEval({ ... }, { output, scorers });\n * await flushTelemetry();\n * ```\n *\n * @param meta - Evaluation metadata for categorization\n * @param meta.capability - High-level capability being evaluated\n * @param meta.step - Optional step within the capability\n * @param meta.link - Optional SpanContext to link to (auto-detected if omitted)\n * @param options - Evaluation configuration\n * @param options.input - Input to pass to scorers\n * @param options.output - Output to evaluate\n * @param options.scorers - Scorer entries with optional per-scorer sampling\n * @returns Promise resolving to scorer results keyed by scorer name\n */\nexport function onlineEval<\n TInput,\n TOutput,\n const TScorers extends readonly ScorerEntry<TInput, TOutput>[],\n>(\n meta: OnlineEvalMeta,\n options: OnlineEvalOptions<TInput, TOutput, TScorers>,\n): Promise<InferOnlineEvalResultRecord<TScorers>> {\n if (options.scorers.length === 0) {\n return Promise.resolve({});\n }\n\n const linkSpanContext = meta.link ?? trace.getSpan(context.active())?.spanContext();\n\n return executeOnlineEvalInternal(meta, options, linkSpanContext);\n}\n\nasync function executeOnlineEvalInternal<\n TInput,\n TOutput,\n const TScorers extends readonly ScorerEntry<TInput, TOutput>[],\n>(\n meta: OnlineEvalMeta,\n options: OnlineEvalOptions<TInput, TOutput, TScorers>,\n linkSpanContext: SpanContext | undefined,\n): Promise<InferOnlineEvalResultRecord<TScorers>> {\n const tracer = getGlobalTracer();\n\n const spanName = meta.step ? `eval ${meta.capability}/${meta.step}` : `eval ${meta.capability}`;\n\n const evalSpan = tracer.startSpan(\n spanName,\n linkSpanContext ? { links: [{ context: linkSpanContext }] } : {},\n );\n\n const evalAttrs: Record<string, string> = {\n [Attr.GenAI.Operation.Name]: 'eval',\n [Attr.Eval.Capability.Name]: meta.capability,\n [Attr.Eval.Tags]: JSON.stringify(['online']),\n };\n if (meta.step) {\n evalAttrs[Attr.Eval.Step.Name] = meta.step;\n }\n evalSpan.setAttributes(evalAttrs);\n\n try {\n const normalizedScorers = options.scorers.map((entry) => normalizeScorerEntry(entry));\n const duplicateScorerNames = getDuplicateScorerNames(normalizedScorers);\n if (duplicateScorerNames.length > 0) {\n throw new Error(\n `Duplicate scorer names are not allowed: ${duplicateScorerNames\n .map((name) => `\"${name}\"`)\n .join(', ')}`,\n );\n }\n\n const outcomes = await Promise.all(\n normalizedScorers.map(async (entry) => {\n try {\n const sampledIn = await shouldSample(entry.sampling, {\n input: options.input,\n output: options.output,\n });\n\n if (!sampledIn) {\n return { sampledOut: true as const };\n }\n\n return {\n sampledOut: false as const,\n result: await executeScorer(\n entry.scorer,\n options.input,\n options.output,\n evalSpan,\n meta,\n ),\n };\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n return {\n sampledOut: false as const,\n result: await executeScorer(\n {\n name: entry.name,\n score: null,\n error: error.message,\n },\n options.input,\n options.output,\n evalSpan,\n meta,\n ),\n };\n }\n }),\n );\n\n const results: Record<string, InferOnlineEvalResult<TScorers>> = {};\n let sampledOutCount = 0;\n\n for (const outcome of outcomes) {\n if (outcome.sampledOut) {\n sampledOutCount += 1;\n continue;\n }\n\n results[outcome.result.name] = outcome.result as InferOnlineEvalResult<TScorers>;\n }\n\n const failedCount = Object.values(results).filter((result) => result.error).length;\n const ranCount = Object.keys(results).length;\n\n evalSpan.setAttributes({\n 'axiom.eval.online.scorers.total': normalizedScorers.length,\n 'axiom.eval.online.scorers.ran': ranCount,\n 'axiom.eval.online.scorers.sampled_out': sampledOutCount,\n 'axiom.eval.online.scorers.failed': failedCount,\n });\n\n if (failedCount > 0) {\n evalSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: 'One or more scorers failed',\n });\n } else {\n evalSpan.setStatus({ code: SpanStatusCode.OK });\n }\n\n return results as InferOnlineEvalResultRecord<TScorers>;\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n evalSpan.recordException(error);\n evalSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n return {};\n } finally {\n evalSpan.end();\n }\n}\n","import { context, trace, SpanStatusCode, type Span } from '@opentelemetry/api';\nimport { getGlobalTracer } from '../otel/initAxiomAI';\nimport type { Scorer, ScorerResult } from './types';\nimport type { OnlineEvalMeta } from './onlineEval';\nimport { Attr } from '../otel/semconv/attributes';\n\ntype OnlineEvalScorerInput<TInput, TOutput> = Scorer<TInput, TOutput, any> | ScorerResult<any>;\n\nfunction setScorerSpanAttrs(\n scorerSpan: Span,\n scorerName: string,\n result: Pick<ScorerResult<any>, 'score' | 'metadata'>,\n meta?: OnlineEvalMeta,\n): void {\n const attrs: Record<string, string | number | boolean | undefined> = {\n [Attr.GenAI.Operation.Name]: 'eval.score',\n [Attr.Eval.Score.Name]: scorerName,\n [Attr.Eval.Tags]: JSON.stringify(['online']),\n [Attr.Eval.Score.Value]: result.score ?? undefined,\n [Attr.Eval.Capability.Name]: meta?.capability,\n [Attr.Eval.Step.Name]: meta?.step,\n };\n\n if (result.metadata && Object.keys(result.metadata).length > 0) {\n attrs[Attr.Eval.Score.Metadata] = JSON.stringify(result.metadata);\n }\n\n scorerSpan.setAttributes(attrs);\n}\n\n/**\n * Executes a single scorer or emits a precomputed scorer result.\n */\nexport async function executeScorer<TInput, TOutput>(\n scorer: OnlineEvalScorerInput<TInput, TOutput>,\n input: TInput | undefined,\n output: TOutput,\n parentSpan: Span,\n meta?: OnlineEvalMeta,\n): Promise<ScorerResult<any>> {\n const tracer = getGlobalTracer();\n const parentContext = trace.setSpan(context.active(), parentSpan);\n\n return context.with(parentContext, async () => {\n const scorerName =\n typeof scorer === 'function'\n ? // undefined/unknown case shouldn't happen, but better safe than sorry\n scorer.name || 'unknown'\n : scorer.name;\n const scorerSpan = tracer.startSpan(`score ${scorerName}`);\n\n try {\n const result =\n typeof scorer === 'function'\n ? ({\n ...(await scorer({\n input,\n output,\n })),\n name: scorerName,\n } satisfies ScorerResult)\n : scorer;\n\n setScorerSpanAttrs(scorerSpan, scorerName, result, meta);\n if (result.error) {\n const error = new Error(result.error);\n scorerSpan.recordException(error);\n scorerSpan.setAttributes({\n [Attr.Error.Message]: error.message,\n [Attr.Error.Type]: error.name,\n });\n scorerSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n } else {\n scorerSpan.setStatus({ code: SpanStatusCode.OK });\n }\n\n return result;\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n const failedResult: ScorerResult = {\n name: scorerName,\n score: null,\n error: error.message,\n };\n\n setScorerSpanAttrs(scorerSpan, scorerName, failedResult, meta);\n\n scorerSpan.recordException(error);\n scorerSpan.setAttributes({\n [Attr.Error.Message]: error.message,\n [Attr.Error.Type]: error.name,\n });\n scorerSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n\n return failedResult;\n } finally {\n scorerSpan.end();\n }\n });\n}\n","let scorerWarned = false;\n\nexport function warnScorerDeprecation(path: string): void {\n if (scorerWarned) return;\n scorerWarned = true;\n console.warn(\n `[axiom] Importing Scorer from '${path}' is deprecated. ` +\n `Use \"import { Scorer } from 'axiom/ai/evals/scorers'\" instead.`,\n );\n}\n\nlet onlineEvalWarned = false;\n\nexport function warnOnlineEvalDeprecation(): void {\n if (onlineEvalWarned) return;\n onlineEvalWarned = true;\n console.warn(\n `[axiom] Importing onlineEval from 'axiom/ai' is deprecated. ` +\n `Use \"import { onlineEval } from 'axiom/ai/evals/online'\" instead.`,\n );\n}\n","import { Attr } from '../otel/semconv/attributes';\nimport type { ValidateName } from '../util/name-validation';\nimport type { Score, Scorer, ScorerOptions } from './scorer.types';\n\n// Helper to force TypeScript to evaluate/simplify types\ntype Simplify<T> = { [K in keyof T]: T[K] } & {};\n\ntype ScorerReturnValue = number | boolean | Score;\ntype AwaitedValue<T> = T extends Promise<infer U> ? U : T;\ntype InferScorerMetadata<T> =\n AwaitedValue<T> extends Score<infer TMetadata> ? TMetadata : Record<string, any>;\ntype NormalizeScorerReturn<T, TMetadata extends Record<string, any>> =\n T extends Promise<any> ? Promise<Score<TMetadata>> : Score<TMetadata>;\n\n/**\n * Creates a scorer to be used in evals.\n *\n * Scorers need to return a number or a boolean. If returning a number, it is\n * suggested that this number is between 0 and 1.\n *\n * @example\n * const scorer = createScorer('exact-match',\n * (args: { output: string; expected: string; }) => {\n * return args.output === args.expected ? true : false;\n * }\n * );\n *\n * @example\n * // With aggregation for trials\n * import { PassAtK } from '@axiomhq/ai/evals/aggregations';\n * const scorer = createScorer('tool-called',\n * (args: { output: string }) => args.output.includes('tool') ? 1 : 0,\n * { aggregation: PassAtK({ threshold: 0.8 }) }\n * );\n */\nexport function createScorer<\n TArgs extends Record<string, any> = {},\n // Use tuple wrapping to prevent distributive conditional types\n TInput = [TArgs] extends [{ input: infer I }] ? I : unknown,\n TExpected = [TArgs] extends [{ expected: infer E }] ? Exclude<E, undefined> : unknown,\n TOutput = [TArgs] extends [{ output: infer O }] ? Exclude<O, undefined> : never,\n TExtra extends Record<string, any> = Simplify<\n Omit<TArgs, 'input' | 'expected' | 'output' | 'trialIndex'>\n >,\n TReturn extends ScorerReturnValue | Promise<ScorerReturnValue> =\n | ScorerReturnValue\n | Promise<ScorerReturnValue>,\n TName extends string = string,\n>(\n /**\n * The name of the scorer\n */\n name: ValidateName<TName>,\n /**\n * The scorer function. Can be sync or async.\n */\n fn: (args: TArgs) => TReturn,\n /**\n * Optional configuration for the scorer, including aggregation for trials.\n */\n options?: ScorerOptions,\n): [TOutput] extends [never]\n ? never\n : Scorer<\n TInput,\n TExpected,\n TOutput,\n TExtra,\n InferScorerMetadata<TReturn>,\n NormalizeScorerReturn<TReturn, InferScorerMetadata<TReturn>>\n > {\n const normalizeScore = (res: ScorerReturnValue): Score => {\n if (typeof res === 'number') {\n return { score: res };\n }\n if (typeof res === 'boolean') {\n return {\n score: res ? 1 : 0,\n metadata: {\n [Attr.Eval.Score.IsBoolean]: true,\n },\n };\n }\n // Score object with boolean score - convert and merge is_boolean into metadata\n if (typeof res.score === 'boolean') {\n return {\n score: res.score ? 1 : 0,\n metadata: {\n ...res.metadata,\n [Attr.Eval.Score.IsBoolean]: true,\n },\n };\n }\n return res;\n };\n\n const scorer: any = (args: TArgs) => {\n const res = fn(args);\n\n // If user returned a Promise, handle async\n if (res instanceof Promise) {\n return res.then(normalizeScore);\n }\n\n // Otherwise handle sync\n return normalizeScore(res);\n };\n\n // Attach name property to function for pre-execution access\n Object.defineProperty(scorer, 'name', {\n value: name,\n configurable: true,\n enumerable: true,\n });\n\n // Attach aggregation config if provided\n if (options?.aggregation) {\n Object.defineProperty(scorer, 'aggregation', {\n value: options.aggregation,\n configurable: true,\n enumerable: true,\n });\n }\n\n return scorer as [TOutput] extends [never]\n ? never\n : Scorer<\n TInput,\n TExpected,\n TOutput,\n TExtra,\n InferScorerMetadata<TReturn>,\n NormalizeScorerReturn<TReturn, InferScorerMetadata<TReturn>>\n >;\n}\n","import { type Span } from '@opentelemetry/api';\nimport { type Tool as ToolV4 } from 'aiv4';\nimport { type Tool as ToolV5 } from 'aiv5';\nimport { createStartActiveSpan } from './startActiveSpan';\nimport { Attr } from './semconv/attributes';\nimport { typedEntries } from '../util/typedEntries';\nimport {\n setAxiomBaseAttributes,\n getTracer,\n classifyToolError,\n setScopeAttributes,\n} from './utils/wrapperUtils';\nimport { getRedactionPolicy, handleMaybeRedactedAttribute } from './utils/redaction';\n\ntype Tool = ToolV4 | ToolV5;\ntype WrappedTool<T> = T extends Tool ? T : never;\n\ninterface ToolLike {\n execute?: (...args: any[]) => any;\n description?: string;\n [key: string]: any;\n}\n\n/**\n * Wraps a tool to create child spans when the tool's execute method is called.\n *\n * @param toolName The name of the tool (key from the tools object) - span name will be `execute_tool <toolName>`\n * @param tool The tool to wrap\n * @returns The same tool but with a wrapped execute method that creates spans\n */\nexport function wrapTool<T extends ToolLike>(toolName: string, tool: T): T {\n if (!tool || typeof tool !== 'object') {\n console.error('Invalid tool provided to wrapTool, returning unwrapped tool');\n return tool as T;\n }\n\n if (!('execute' in tool) || typeof tool.execute !== 'function') {\n console.error(\n 'Cannot wrap a tool that does not have an execute method, returning unwrapped tool',\n );\n return tool as T;\n }\n\n // After the type guard, we know execute exists and is a function\n const originalExecute = tool.execute as (...args: any[]) => any;\n\n return {\n ...tool,\n execute: async (...executeArgs: Parameters<typeof originalExecute>) => {\n const [args, opts] = executeArgs;\n const tracer = getTracer();\n const startActiveSpan = createStartActiveSpan(tracer);\n const spanName = `${Attr.GenAI.Operation.Name_Values.ExecuteTool} ${toolName}`;\n\n return startActiveSpan(spanName, null, async (span: Span) => {\n const redactionPolicy = getRedactionPolicy();\n\n setAxiomBaseAttributes(span);\n setScopeAttributes(span);\n\n // Handle different opts structures between AI SDK versions\n const toolCallId =\n opts && typeof opts === 'object'\n ? opts.toolCallId || opts.toolCall?.toolCallId\n : undefined;\n\n if (toolCallId) {\n span.setAttribute(Attr.GenAI.Tool.CallID, toolCallId);\n }\n\n span.setAttribute(Attr.GenAI.Operation.Name, Attr.GenAI.Operation.Name_Values.ExecuteTool);\n span.setAttribute(Attr.GenAI.Tool.Name, toolName);\n\n const type = args && typeof args === 'object' && 'type' in args ? args.type : 'function';\n span.setAttribute(Attr.GenAI.Tool.Type, type);\n\n if (tool.description) {\n span.setAttribute(Attr.GenAI.Tool.Description, tool.description);\n }\n\n if (redactionPolicy.mirrorToolPayloadOnToolSpan) {\n try {\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Tool.Arguments,\n JSON.stringify(args),\n redactionPolicy.captureMessageContent,\n );\n } catch (_error) {\n // Handle circular references or other JSON serialization errors\n span.setAttribute(Attr.GenAI.Tool.Arguments, '[Unable to serialize arguments]');\n }\n }\n\n try {\n // Execute the original tool function\n const result = await originalExecute(args, opts);\n\n // Conditionally set tool result message if mirroring is enabled\n if (redactionPolicy.mirrorToolPayloadOnToolSpan) {\n try {\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Tool.Message,\n JSON.stringify(result),\n redactionPolicy.captureMessageContent,\n );\n } catch (_error) {\n // Handle circular references or other JSON serialization errors\n span.setAttribute(Attr.GenAI.Tool.Message, '[Unable to serialize result]');\n }\n }\n\n return result;\n } catch (err) {\n classifyToolError(err, span);\n\n // Always re-throw tool errors to allow the calling code/AI SDK to decide\n // whether to handle gracefully or fail the parent span.\n throw err;\n }\n });\n },\n } as WrappedTool<T>;\n}\n\n/**\n * Wraps multiple tools to create child spans when their execute methods are called.\n *\n * @param tools An object containing tools to wrap\n * @returns The same object with all tools wrapped\n */\nexport function wrapTools<T extends Record<string, ToolLike>>(tools: T): T {\n if (!tools || typeof tools !== 'object') {\n console.error('Invalid tools object provided to wrapTools');\n return tools;\n }\n\n const wrappedTools = {} as T;\n\n for (const [toolName, tool] of typedEntries(tools)) {\n wrappedTools[toolName] = wrapTool(toolName as string, tool);\n }\n\n return wrappedTools;\n}\n","export function typedEntries<T extends object>(obj: T): [keyof T, T[keyof T]][] {\n return Object.entries(obj) as [keyof T, T[keyof T]][];\n}\n","import { getGlobalFlagOverrides } from './evals/context/global-flags';\nimport {\n getEvalContext,\n updateEvalContext,\n addOutOfScopeFlag,\n setConfigScope,\n} from './evals/context/storage';\nimport { validateCliFlags } from './validate-flags';\nimport {\n parsePath,\n dotNotationToNested,\n isValidPath,\n getValueAtPath,\n buildSchemaForPath,\n findSchemaAtPath,\n} from './util/dot-path';\nimport {\n getDef,\n getKind,\n getInnerType,\n getShape,\n isObjectSchema,\n assertZodV4,\n} from './util/zod-internals';\nimport { trace } from '@opentelemetry/api';\nimport { type z, type ZodObject, type ZodDefault, type ZodSchema } from 'zod';\nimport { toOtelAttribute } from './otel/utils/to-otel-attribute';\nimport { Attr } from './otel';\n\ntype DefaultMaxDepth = 8;\n\n// Helper to recursively check if a schema has defaults (including nested objects)\ntype HasDefaults<S> = S extends { _zod: { def: { defaultValue: unknown } } }\n ? true\n : S extends ZodObject<infer Shape>\n ? {\n [K in keyof Shape]: HasDefaults<Shape[K]>;\n } extends Record<keyof Shape, true>\n ? true\n : false\n : false;\n\n// Helper type to extract the underlying ZodObject from ZodDefault wrapper\ntype UnwrapSchema<T> = T extends ZodDefault<infer U> ? U : T;\n\n// Helper to check if ALL fields in a schema have defaults\ntype AllFieldsHaveDefaults<Schema> =\n // First check if the schema itself has an object-level default\n Schema extends { _zod: { def: { defaultValue: unknown } } }\n ? true\n : // Otherwise recursively check if all fields have defaults\n HasDefaults<UnwrapSchema<Schema>>;\n\ninterface AppScopeConfig<\n FlagSchema extends ZodObject<any> | undefined = undefined,\n FactSchema extends ZodObject<any> | undefined = undefined,\n> {\n flagSchema: FlagSchema;\n factSchema?: FactSchema;\n}\n\n/**\n * Recursive type to extract all possible paths from an object type.\n * Uses stack-based depth limiting for better performance.\n *\n * @template T - The object type to extract paths from\n * @template Stack - Internal stack counter (do not set manually)\n * @template MaxDepth - Maximum recursion depth (default: 8 for good balance)\n */\ntype ObjectPaths<\n T,\n Stack extends unknown[] = [],\n MaxDepth extends number = DefaultMaxDepth,\n> = Stack['length'] extends MaxDepth\n ? never\n : T extends object\n ? {\n [K in keyof T]-?: K extends string | number\n ? `${K}` | `${K}.${ObjectPaths<T[K], [1, ...Stack], MaxDepth>}`\n : never;\n }[keyof T]\n : never;\n\n// Type to get value at a specific path in an object\ntype ObjectPathValue<T, P extends string> = P extends keyof T\n ? T[P]\n : P extends `${infer K}.${infer Rest}`\n ? K extends keyof T\n ? ObjectPathValue<T[K], Rest>\n : never\n : never;\n\n/**\n * Generate deep nested paths from flag schema.\n *\n * @template T - ZodObject to extract paths from\n * @template MaxDepth - Maximum recursion depth (default: 8, override for deeper nesting)\n * @example\n * // Default 8-level depth\n * type Paths = DotPaths<MySchema>\n *\n * // Custom depth for deeper nesting (impacts performance)\n * type DeepPaths = DotPaths<MySchema, 12>\n */\nexport type DotPaths<T extends ZodObject<any>, MaxDepth extends number = DefaultMaxDepth> = {\n [NS in keyof T['shape']]:\n | (string & NS) // Include the namespace itself\n | {\n [P in ObjectPaths<\n z.output<UnwrapSchema<T['shape'][NS]>>,\n [],\n MaxDepth\n >]: `${string & NS}.${P}`;\n }[ObjectPaths<z.output<UnwrapSchema<T['shape'][NS]>>, [], MaxDepth>];\n}[keyof T['shape']];\n\ntype PathValue<T extends ZodObject<any>, P extends string> = P extends `${infer NS}.${infer Rest}`\n ? NS extends keyof T['shape']\n ? ObjectPathValue<z.output<UnwrapSchema<T['shape'][NS]>>, Rest>\n : never\n : P extends keyof T['shape']\n ? z.output<UnwrapSchema<T['shape'][P]>>\n : never;\n\ntype DotNotationFlagFunction<FS extends ZodObject<any> | undefined> =\n FS extends ZodObject<any> ? <P extends DotPaths<FS>>(path: P) => PathValue<FS, P> : never;\n\ntype FactFunction<SC extends ZodObject<any> | undefined> =\n SC extends ZodObject<any>\n ? <P extends DotPaths<SC> & string>(name: P, value: PathValue<SC, P>) => void\n : never;\n\ntype OverrideFlagsFunction<FS extends ZodObject<any> | undefined> =\n FS extends ZodObject<any>\n ? (partial: { [K in DotPaths<FS>]?: PathValue<FS, K> }) => void\n : (partial: Record<string, any>) => void;\n\ntype WithFlagsFunction<FS extends ZodObject<any> | undefined> =\n FS extends ZodObject<any>\n ? <T>(overrides: { [K in DotPaths<FS>]?: PathValue<FS, K> }, fn: () => T) => T\n : <T>(overrides: Record<string, any>, fn: () => T) => T;\n\ntype PickFlagsFunction<FS extends ZodObject<any> | undefined> =\n FS extends ZodObject<any>\n ? {\n // Spread arguments: pickFlags2('foo', 'bar')\n <K extends ReadonlyArray<DotPaths<FS> & string>>(...paths: K): K;\n // Array argument: pickFlags2(['foo', 'bar'])\n <K extends ReadonlyArray<DotPaths<FS> & string>>(paths: K): K;\n }\n : never;\n\nexport interface AppScope<\n FS extends ZodObject<any> | undefined,\n SC extends ZodObject<any> | undefined,\n> {\n flag: DotNotationFlagFunction<FS>;\n fact: FactFunction<SC>;\n overrideFlags: OverrideFlagsFunction<FS>;\n withFlags: WithFlagsFunction<FS>;\n pickFlags: PickFlagsFunction<FS>;\n getAllDefaultFlags: () => Record<string, any>;\n}\n\n/**\n * Check if a flag path is covered by the picked flags.\n * @param flagPath - The flag path to check (e.g., 'foo', 'foo.bar')\n * @param pickedFlags - Array of picked flag paths\n * @returns true if the flag is covered by picked flags\n */\nexport function isPickedFlag(flagPath: string, pickedFlags?: string[]): boolean {\n if (!pickedFlags) {\n // If no picked flags are provided, all flags are allowed\n return true;\n }\n\n if (pickedFlags.length === 0) {\n // If no flags are picked, all flags are allowed\n return true;\n }\n\n return pickedFlags.some((picked) => {\n // Exact match\n if (flagPath === picked) {\n return true;\n }\n // Nested match: flagPath starts with picked flag followed by a dot\n if (flagPath.startsWith(picked + '.')) {\n return true;\n }\n return false;\n });\n}\n\n// Helper to recursively validate that schemas don't contain union types\nfunction assertNoUnions(schema: unknown, path = 'schema'): void {\n if (!schema) return;\n\n const kind = getKind(schema);\n if (!kind) return;\n\n // Unwrap transparent containers\n if (kind === 'default' || kind === 'optional' || kind === 'nullable') {\n const innerType = getInnerType(schema);\n return assertNoUnions(innerType, path);\n }\n\n // Hard-fail on unions\n if (kind === 'union' || kind === 'discriminatedunion') {\n throw new Error(`[AxiomAI] Union types are not supported in flag schemas (found at \"${path}\")`);\n }\n\n // Recurse into compound types\n if (kind === 'object') {\n const shape = getShape(schema);\n if (shape) {\n for (const [k, v] of Object.entries(shape)) {\n assertNoUnions(v, `${path}.${k}`);\n }\n }\n } else if (kind === 'array') {\n const innerType = getInnerType(schema);\n if (innerType) {\n assertNoUnions(innerType, `${path}[]`);\n }\n } else if (kind === 'record') {\n const def = getDef(schema);\n const valueType = def?.valueType;\n if (valueType) {\n assertNoUnions(valueType, `${path}{}`);\n }\n }\n}\n\n/**\n * Recursively verify that all leaf fields in the schema have defaults.\n * Throws with a detailed error message listing all paths missing defaults.\n * TODO: this should probably be in an adapter, not the core lib...\n */\nfunction ensureAllDefaults(schema: unknown, path = ''): void {\n const missingDefaults: string[] = [];\n\n function checkDefaults(current: unknown, currentPath: string): void {\n if (!current) return;\n\n const kind = getKind(current);\n if (!kind) return;\n\n const def = getDef(current);\n const hasDefault = def?.defaultValue !== undefined;\n\n // Unwrap transparent containers and check their inner type\n if (kind === 'default') {\n // This has a default, we're done - no need to check inner type\n return;\n }\n\n if (kind === 'optional' || kind === 'nullable') {\n // Transparent wrappers - check inner type\n const innerType = getInnerType(current);\n return checkDefaults(innerType, currentPath);\n }\n\n // ZodRecord is not allowed\n if (kind === 'record') {\n throw new Error(\n `[AxiomAI] ZodRecord is not supported in flag schemas (found at \"${currentPath || 'root'}\")\\n` +\n `All flag fields must have known keys and defaults. Consider using z.object() instead.`,\n );\n }\n\n // For objects: if there's an object-level default, we're good\n // Otherwise, recursively check all fields\n if (kind === 'object') {\n if (hasDefault) {\n // Object-level default covers all nested fields\n return;\n }\n\n const shape = getShape(current);\n if (shape) {\n for (const [k, v] of Object.entries(shape)) {\n const nextPath = currentPath ? `${currentPath}.${k}` : k;\n checkDefaults(v, nextPath);\n }\n }\n return;\n }\n\n // For arrays: arrays are leaf types (no per-index access)\n // Just check if the array schema itself has a default\n if (kind === 'array') {\n if (!hasDefault) {\n missingDefaults.push(currentPath || 'root');\n }\n return;\n }\n\n // For all other types (primitives, etc): must have a default\n if (!hasDefault) {\n missingDefaults.push(currentPath || 'root');\n }\n }\n\n checkDefaults(schema, path);\n\n if (missingDefaults.length > 0) {\n throw new Error(\n `[AxiomAI] All flag fields must have defaults. Missing defaults for:\\n` +\n missingDefaults.map((p) => ` - ${p}`).join('\\n') +\n `\\n\\nAdd .default(value) to these fields or to their parent objects.`,\n );\n }\n}\n\n/**\n * Create a new application-level evaluation scope.\n *\n * @param config.flagSchema A zod object describing the schema for flags **(required)**\n * @param config.factSchema A zod object describing the schema for facts (optional)\n *\n * @example\n * import { z } from 'zod';\n *\n * const { flag, fact, withFlags, pickFlags, overrideFlags } = createAppScope({\n * flagSchema: z.object({\n * ui: z.object({\n * darkMode: z.boolean().default(false),\n * theme: z.object({\n * primary: z.string().default('#00f'),\n * }),\n * }),\n * api: z.object({ \n endpoint: z.string().default('/api') \n }),\n * }),\n * factSchema: z.object({\n * userAction: z.string(),\n * timing: z.number(),\n * }),\n * });\n *\n * // Typed flag access\n * const dark = flag('ui.darkMode'); // inferred boolean\n * const theme = flag('ui.theme'); // entire object\n * const primary = flag('ui.theme.primary'); // '#00f'\n * const endpoint = flag('api.endpoint'); // uses schema default\n *\n * // Typed fact recording\n * fact('userAction', 'clicked_button');\n * fact('timing', 1250);\n *\n * // Temporarily override flags for a block of code\n * withFlags({ 'ui.darkMode': true }, () => {\n * // code here, `ui.darkMode` will be true in this block and reset after\n * });\n *\n * // Override flags globally for the current evaluation run\n * overrideFlags({ 'api.endpoint': '/custom' });\n */\n// Overload: Require all fields to have defaults (compile-time check)\nexport function createAppScope<\n FlagSchema extends ZodObject<any>,\n FactSchema extends ZodObject<any> | undefined = undefined,\n>(\n config: AllFieldsHaveDefaults<FlagSchema> extends true\n ? AppScopeConfig<FlagSchema, FactSchema>\n : {\n flagSchema: FlagSchema;\n factSchema?: FactSchema;\n __error__: 'createAppScope: flagSchema must have .default() for all leaf fields';\n },\n): AppScope<FlagSchema, FactSchema>;\n\n// Implementation signature: Keep broad for internal use\nexport function createAppScope<\n FlagSchema extends ZodObject<any> | undefined = undefined,\n FactSchema extends ZodObject<any> | undefined = undefined,\n>(config: AppScopeConfig<FlagSchema, FactSchema>): AppScope<FlagSchema, FactSchema> {\n // Store schemas for runtime validation\n const flagSchemaConfig = config?.flagSchema;\n const factSchemaConfig = config?.factSchema;\n\n // Reject Zod v3 schemas\n if (flagSchemaConfig) {\n assertZodV4(flagSchemaConfig, 'flagSchema');\n }\n if (factSchemaConfig) {\n assertZodV4(factSchemaConfig, 'factSchema');\n }\n\n // reject union types\n if (flagSchemaConfig) {\n assertNoUnions(flagSchemaConfig, 'flagSchema');\n }\n\n // Ensure all fields have defaults\n if (flagSchemaConfig) {\n ensureAllDefaults(flagSchemaConfig);\n }\n\n // CLI validation with dot notation support\n if (flagSchemaConfig) {\n validateCliFlags(flagSchemaConfig);\n }\n\n // Helper to check if a path represents a namespace access (no dots after first segment)\n function isNamespaceAccess(segments: string[]): boolean {\n if (!flagSchemaConfig || segments.length === 0) return false;\n\n // For root namespace (like 'ui'), check if it exists in the ZodObject shape\n if (segments.length === 1) {\n return flagSchemaConfig.shape ? segments[0] in flagSchemaConfig.shape : false;\n }\n\n // For nested paths (like 'app.ui.layout'), need to check if the path points to an object schema\n const schema = findSchemaAtPath(flagSchemaConfig, segments);\n return isObjectSchema(schema);\n }\n\n // Helper function to check if a schema has complete defaults at runtime\n // This mirrors the compile-time AllFieldsHaveDefaults<> type\n\n // Recursively build object with all defaults from a Zod schema\n function buildObjectWithDefaults(schema: unknown): unknown {\n if (!schema) return undefined;\n\n const kind = getKind(schema);\n if (!kind) return undefined;\n\n // `directDefault`: default for the entire object\n // If this is not present, we try to construct the defaults from child fields (recursively)\n const directDefault = extractDefault(schema);\n if (directDefault !== undefined) {\n return directDefault;\n }\n\n // We can only collect defaults from child fields if we're dealing with an object (for a scalar, there are no children)\n if (kind === 'object') {\n const shape = getShape(schema);\n if (shape) {\n const result: Record<string, unknown> = {};\n\n for (const [key, fieldSchema] of Object.entries(shape)) {\n const fieldValue = buildObjectWithDefaults(fieldSchema);\n result[key] = fieldValue;\n }\n\n return result;\n }\n }\n\n // No direct default, and it's not an object\n return undefined;\n }\n\n function extractDefault(schema: unknown): unknown {\n if (!schema) return undefined;\n\n // Unwrap transparent containers first, checking for defaults at each level\n let current: unknown = schema;\n\n for (let i = 0; i < 10; i++) {\n const def = getDef(current);\n if (!def) break;\n\n // Check for default value at current level\n if (def.defaultValue !== undefined) {\n return typeof def.defaultValue === 'function' ? def.defaultValue() : def.defaultValue;\n }\n\n // Unwrap one level if possible\n const inner = getInnerType(current);\n if (inner) {\n current = inner;\n } else {\n // No more wrapping, stop here\n break;\n }\n }\n\n return undefined;\n }\n\n function validateFinalFlagValue(\n dotPath: string,\n value: unknown,\n ): { ok: true; parsed: unknown } | { ok: false } {\n if (!flagSchemaConfig) return { ok: true, parsed: value };\n\n const segments = parsePath(dotPath);\n\n // 1. Fast-path: validate directly with field-level schema\n const fieldSchema = findSchemaAtPath(flagSchemaConfig, segments);\n if (fieldSchema) {\n const direct = (fieldSchema as ZodSchema<any>).safeParse(value);\n if (direct.success) return { ok: true, parsed: direct.data };\n // If we have a field schema but validation failed, this is a real error\n return { ok: false };\n }\n\n // 2. If we don't have a field schema, check if the path is even valid in our schema\n // Don't validate values for paths that don't exist in the schema - just pass them through\n const hasValidNamespace = flagSchemaConfig.shape && segments[0] in flagSchemaConfig.shape;\n if (!hasValidNamespace) {\n // Invalid namespace - pass through without validation (for backward compatibility with fallback values)\n return { ok: true, parsed: value };\n }\n\n // 3. For valid namespaces but invalid paths, try nested object validation\n const nested = dotNotationToNested({ [dotPath]: value });\n const nestedResult = flagSchemaConfig.strict().partial().safeParse(nested);\n if (nestedResult.success) {\n const parsed = getValueAtPath(nestedResult.data, segments) ?? value;\n return { ok: true, parsed };\n }\n\n // 4. If nested validation failed but the namespace is valid, allow it for backward compatibility\n return { ok: true, parsed: value };\n }\n\n function hasUndefinedLeaves(obj: unknown): boolean {\n if (obj === undefined) return true;\n if (obj === null || typeof obj !== 'object') return false;\n return Object.values(obj).some((v) =>\n typeof v === 'object' && v !== null ? hasUndefinedLeaves(v) : v === undefined,\n );\n }\n\n /**\n * Get flag value with dot notation path support and schema validation.\n * All flag fields must have .default() values in the schema.\n * Precedence: CLI overrides -> Context overrides -> Schema defaults → Error\n *\n * @param path - Dot notation path to the flag (e.g., 'ui.theme' or 'api.timeout')\n * @returns The flag value or undefined if path is invalid\n */\n function flag<P extends string>(path: P): unknown {\n const segments = parsePath(path);\n\n const ctx = getEvalContext();\n const globalOverrides = getGlobalFlagOverrides();\n\n if (!isPickedFlag(path, ctx.pickedFlags)) {\n addOutOfScopeFlag(path);\n }\n\n let finalValue: any;\n let source: 'cli' | 'ctx' | 'schema' | undefined;\n\n // Flag precedence order:\n // 1. CLI overrides (getGlobalFlagOverrides)\n // 2. Eval context overrides (getEvalContext().flags)\n // 3. Schema/object defaults\n // 4. undefined + console.error\n\n // 1. Check CLI overrides first (highest priority)\n if (path in globalOverrides) {\n finalValue = globalOverrides[path];\n source = 'cli';\n }\n // 2. Check context overrides (from withFlags() or overrideFlags)\n else if (path in ctx.flags) {\n finalValue = ctx.flags[path];\n source = 'ctx';\n }\n // 3. Resolve from schema\n else {\n if (!flagSchemaConfig) {\n console.error(`[AxiomAI] Invalid flag: \"${path}\"`);\n return undefined;\n }\n\n // Check valid namespace\n const hasValidNamespace = flagSchemaConfig.shape && segments[0] in flagSchemaConfig.shape;\n if (!hasValidNamespace) {\n console.error(`[AxiomAI] Invalid flag: \"${path}\"`);\n return undefined;\n }\n\n const schemaForPath = findSchemaAtPath(flagSchemaConfig, segments);\n\n // If schema path doesn't exist, try extracting from parent object-level defaults\n if (!schemaForPath) {\n const namespaceSchema = findSchemaAtPath(flagSchemaConfig, [segments[0]]);\n if (namespaceSchema) {\n const namespaceObject = buildObjectWithDefaults(namespaceSchema);\n if (namespaceObject && typeof namespaceObject === 'object') {\n finalValue = getValueAtPath(namespaceObject, segments.slice(1));\n }\n }\n\n if (finalValue === undefined) {\n console.error(`[AxiomAI] Invalid flag: \"${path}\"`);\n return undefined;\n }\n }\n // Check if this is a namespace access (returning whole objects)\n else if (isNamespaceAccess(segments)) {\n finalValue = buildObjectWithDefaults(schemaForPath);\n\n // If buildObjectWithDefaults fails or returns incomplete object, try extracting from parent defaults\n if (finalValue === undefined || hasUndefinedLeaves(finalValue)) {\n const nsSchema = findSchemaAtPath(flagSchemaConfig, [segments[0]]);\n if (nsSchema) {\n const nsObj = buildObjectWithDefaults(nsSchema);\n if (nsObj && typeof nsObj === 'object') {\n const extracted = getValueAtPath(nsObj, segments.slice(1));\n if (extracted !== undefined) {\n finalValue = extracted;\n }\n }\n }\n }\n\n if (finalValue === undefined) {\n console.error(`[AxiomAI] Invalid flag: \"${path}\"`);\n return undefined;\n }\n }\n // Leaf access: try field-level default first\n else {\n finalValue = extractDefault(schemaForPath);\n\n // If no field-level default, try extracting from parent object-level default\n if (finalValue === undefined) {\n const nsSchema = findSchemaAtPath(flagSchemaConfig, [segments[0]]);\n if (nsSchema) {\n const nsObj = buildObjectWithDefaults(nsSchema);\n if (nsObj && typeof nsObj === 'object') {\n finalValue = getValueAtPath(nsObj, segments.slice(1));\n }\n }\n\n if (finalValue === undefined) {\n console.error(`[AxiomAI] Invalid flag: \"${path}\"`);\n return undefined;\n }\n }\n }\n\n source = 'schema';\n }\n\n // Validate only overrides (schema values are pre-validated)\n if (source !== 'schema') {\n const validation = validateFinalFlagValue(path, finalValue);\n if (!validation.ok) {\n console.error(`[AxiomAI] Invalid flag: \"${path}\" - value does not match schema`);\n }\n }\n\n updateEvalContext({ [path]: finalValue });\n\n const span = trace.getActiveSpan();\n if (span?.isRecording()) {\n const attr = toOtelAttribute(finalValue);\n if (attr) {\n span.setAttribute(Attr.__EXPERIMENTAL_Flag(path), attr);\n }\n }\n\n return finalValue;\n }\n\n /**\n * Record a typed fact value for tracking and telemetry with dot notation support.\n * @param name - The fact name/key\n */\n function fact<N extends string>(name: N, value: unknown): void {\n let finalValue = value;\n\n // Validate with schema if provided (but only log errors for now to match tests)\n if (factSchemaConfig) {\n const segments = parsePath(name);\n\n let success = true;\n // Fast path check - validate path exists in schema before creating nested object\n if (!isValidPath(factSchemaConfig, segments)) {\n success = false;\n } else {\n try {\n // Build a schema specific to this path that makes sibling fields optional\n const pathSchema = buildSchemaForPath(factSchemaConfig, segments);\n\n // Convert dot notation to nested object for validation\n const nested = dotNotationToNested({ [name]: value });\n const result = pathSchema.safeParse(nested);\n\n if (!result.success) {\n success = false;\n } else {\n finalValue = getValueAtPath(result.data, segments) ?? value;\n }\n } catch (_error) {\n // buildSchemaForPath can throw if schema structure is invalid\n success = false;\n }\n }\n\n if (!success) {\n console.error(`[AxiomAI] Invalid fact: \"${name}\"`);\n }\n }\n\n updateEvalContext(undefined, { [name]: finalValue });\n\n const span = trace.getActiveSpan();\n if (span?.isRecording()) {\n const attr = toOtelAttribute(finalValue);\n if (attr) {\n span.setAttribute(Attr.__EXPERIMENTAL_Fact(name), attr);\n }\n }\n }\n\n /**\n * Override flag values for the current evaluation context with type safety.\n * @param partial - Typed flag overrides that must match the flag schema paths and types\n */\n function overrideFlags(partial: Record<string, any>): void {\n const ctx = getEvalContext();\n Object.assign(ctx.flags, partial);\n }\n\n /**\n * Execute code with temporary flag overrides, automatically restoring original values.\n * @param overrides - Typed flag overrides that must match the flag schema paths and types\n * @param fn - Function to execute with the overridden flags\n * @returns The return value of the executed function\n */\n function withFlags<T>(overrides: Record<string, any>, fn: () => T): T {\n const ctx = getEvalContext();\n const originalFlags = { ...ctx.flags };\n\n // Apply overrides\n Object.assign(ctx.flags, overrides);\n\n try {\n return fn();\n } finally {\n // Restore original flags by clearing and reassigning\n Object.keys(ctx.flags).forEach((key) => delete ctx.flags[key]);\n Object.assign(ctx.flags, originalFlags);\n }\n }\n\n const pickFlags = ((...args: any[]) => {\n // Handle both array and spread arguments\n return args[0] && Array.isArray(args[0]) ? args[0] : args;\n }) as PickFlagsFunction<FlagSchema>;\n\n function flattenToDot(obj: any, prefix: string[] = [], out: Record<string, any> = {}) {\n if (obj && typeof obj === 'object' && !Array.isArray(obj)) {\n for (const [k, v] of Object.entries(obj)) {\n flattenToDot(v, [...prefix, k], out);\n }\n } else {\n if (prefix.length > 0) {\n out[prefix.join('.')] = obj;\n }\n }\n return out;\n }\n\n function getAllDefaultFlags(): Record<string, any> {\n if (!flagSchemaConfig) return {};\n const defaultsObj = buildObjectWithDefaults(flagSchemaConfig);\n if (defaultsObj && typeof defaultsObj === 'object') {\n return flattenToDot(defaultsObj as Record<string, any>);\n }\n return {};\n }\n\n const scope = {\n flag: flag as any as DotNotationFlagFunction<FlagSchema>,\n fact: fact as any as FactFunction<FactSchema>,\n overrideFlags: overrideFlags as any as OverrideFlagsFunction<FlagSchema>,\n withFlags: withFlags as any as WithFlagsFunction<FlagSchema>,\n pickFlags,\n getAllDefaultFlags,\n } as AppScope<FlagSchema, FactSchema>;\n\n // Expose scope to current eval context for downstream collection (suite-end summaries)\n setConfigScope(scope as any);\n\n return scope;\n}\n","/**\n * Global flag overrides storage for CLI flag functionality.\n * Uses globalThis for process-wide flag persistence.\n */\n\nconst GLOBAL_OVERRIDES_SYMBOL = Symbol.for('axiom.global_flag_overrides');\n\nfunction getRoot(): Record<string, any> {\n return (globalThis as any)[GLOBAL_OVERRIDES_SYMBOL] ?? {};\n}\n\nfunction setRoot(val: Record<string, any>): void {\n (globalThis as any)[GLOBAL_OVERRIDES_SYMBOL] = val;\n}\n\n/**\n * Set global flag overrides (called by CLI) - persists until cleared\n */\nexport function setGlobalFlagOverrides(overrides: Record<string, any>): void {\n setRoot(overrides);\n}\n\n/**\n * Get global flag overrides (called by flag functions)\n */\nexport function getGlobalFlagOverrides(): Record<string, any> {\n return getRoot();\n}\n\n/**\n * Clear global flag overrides (for testing)\n */\nexport function clearGlobalFlagOverrides(): void {\n setRoot({});\n}\n","import { trace } from '@opentelemetry/api';\nimport { createAsyncHook } from './manager';\nimport { type createAppScope } from '../../app-scope';\nimport type { ResolvedAxiomConfig } from '../../config/index';\nimport type { OutOfScopeFlagAccess } from '../eval.types';\n\n// Global fallback for config scope when called outside of eval context (e.g., module import time)\nconst CONFIG_SCOPE_SYMBOL = Symbol.for('axiom.eval.configScope');\nfunction getGlobalConfigScope(): ReturnType<typeof createAppScope> | undefined {\n return (globalThis as any)[CONFIG_SCOPE_SYMBOL];\n}\nfunction setGlobalConfigScope(scope: ReturnType<typeof createAppScope>) {\n (globalThis as any)[CONFIG_SCOPE_SYMBOL] = scope;\n}\n\n// Global storage for axiom config (accessible from reporters)\nconst AXIOM_CONFIG_SYMBOL = Symbol.for('axiom.eval.config');\nexport function getAxiomConfig(): ResolvedAxiomConfig | undefined {\n return (globalThis as any)[AXIOM_CONFIG_SYMBOL];\n}\nexport function setAxiomConfig(config: ResolvedAxiomConfig) {\n (globalThis as any)[AXIOM_CONFIG_SYMBOL] = config;\n}\n\n// Mini-context for in-process access\nexport const EVAL_CONTEXT = createAsyncHook<{\n flags: Record<string, any>;\n facts: Record<string, any>;\n configScope?: ReturnType<typeof createAppScope>;\n pickedFlags?: string[];\n outOfScopeFlags?: OutOfScopeFlagAccess[];\n parent?: EvalContextData<any, any>;\n overrides?: Record<string, any>;\n accessedFlagKeys?: string[];\n}>('eval-context');\n\nexport interface EvalContextData<Flags = any, Facts = any> {\n flags: Partial<Flags>;\n facts: Partial<Facts>;\n configScope?: ReturnType<typeof createAppScope>;\n pickedFlags?: string[];\n outOfScopeFlags?: OutOfScopeFlagAccess[];\n parent?: EvalContextData<Flags, Facts>;\n overrides?: Record<string, any>;\n accessedFlagKeys?: string[];\n}\n\nexport function getEvalContext<\n Flags extends Record<string, unknown> = any,\n Facts extends Record<string, unknown> = any,\n>(): EvalContextData<Flags, Facts> {\n const ctx = EVAL_CONTEXT.get();\n if (!ctx) {\n // Return empty context if none exists\n return {\n flags: {} as Partial<Flags>,\n facts: {} as Partial<Facts>,\n pickedFlags: undefined,\n outOfScopeFlags: undefined,\n };\n }\n return {\n flags: ctx.flags as Partial<Flags>,\n facts: ctx.facts as Partial<Facts>,\n pickedFlags: ctx.pickedFlags,\n outOfScopeFlags: ctx.outOfScopeFlags,\n parent: ctx.parent,\n overrides: ctx.overrides,\n accessedFlagKeys: ctx.accessedFlagKeys,\n };\n}\n\nexport function updateEvalContext(flags?: Record<string, any>, facts?: Record<string, any>) {\n const current = EVAL_CONTEXT.get();\n if (!current) {\n // Silently return - this is expected when running capabilities outside of eval\n return;\n }\n\n // Mutate the existing context (safe within the same async context)\n if (flags) {\n Object.assign(current.flags, flags);\n // Track accessed flag keys for runtime reporting\n if (!current.accessedFlagKeys) current.accessedFlagKeys = [];\n for (const key of Object.keys(flags)) {\n if (!current.accessedFlagKeys.includes(key)) {\n current.accessedFlagKeys.push(key);\n }\n }\n }\n if (facts) {\n Object.assign(current.facts, facts);\n }\n}\n\n/**\n * Parse stack trace to extract relevant frames, filtering out internal/framework frames\n */\nfunction parseStackTrace(stack: string): string[] {\n const lines = stack.split('\\n');\n const frames: string[] = [];\n\n for (const line of lines) {\n const trimmed = line.trim();\n\n if (!trimmed || !trimmed.startsWith('at ')) {\n continue;\n }\n\n // filter out frames that users likely don't care about\n if (\n trimmed.includes('node_modules') ||\n trimmed.includes('node:internal') ||\n trimmed.includes('addOutOfScopeFlag') ||\n trimmed.includes('storage.ts') ||\n // Keep app-scope.ts frames that aren't the flag() function itself\n (trimmed.includes('app-scope.ts') &&\n (trimmed.includes('flag (') || trimmed.includes('flag2 (')))\n ) {\n continue;\n }\n\n frames.push(trimmed.replace('at ', ''));\n }\n\n return frames.slice(0, 5);\n}\n\nexport function addOutOfScopeFlag(flagPath: string) {\n const current = EVAL_CONTEXT.get();\n if (!current) {\n console.warn('addOutOfScopeFlag called outside of evaluation context');\n return;\n }\n\n if (!current.outOfScopeFlags) {\n current.outOfScopeFlags = [];\n }\n\n const stack = new Error().stack || '';\n const stackTrace = parseStackTrace(stack);\n\n current.outOfScopeFlags.push({\n flagPath,\n accessedAt: Date.now(),\n stackTrace,\n });\n}\n\n// Helper: write to current span + context\nexport function putOnSpan(kind: 'flag' | 'fact', key: string, value: any) {\n const span = trace.getActiveSpan();\n if (span?.isRecording()) {\n span.setAttributes({ [`${kind}.${key}`]: value });\n }\n}\n\n/**\n * Resolve a flag value by walking the parent chain, checking overrides first\n */\nexport function resolveFlagValue<V>(ctx: EvalContextData<any, any>, key: string): V {\n // First check current context overrides\n if (ctx.overrides && key in ctx.overrides) {\n return ctx.overrides[key] as V;\n }\n\n // Then check current context flags\n if (key in ctx.flags) {\n return ctx.flags[key] as V;\n }\n\n // Walk up the parent chain\n if (ctx.parent) {\n return resolveFlagValue(ctx.parent, key);\n }\n\n // This should not happen\n // Return undefined as a fallback\n console.error(`[AxiomAI] Flag \"${key}\" not found in context, returning undefined`);\n return undefined as V;\n}\n\n/**\n * Create an overlay context that inherits from the current context\n * but isolates overrides to this specific execution context.\n */\nfunction createOverlayContext(overrides: Record<string, any>): any {\n const current = EVAL_CONTEXT.get();\n if (!current) {\n if (process.env.NODE_ENV !== 'test') {\n console.warn('createOverlayContext called outside of evaluation context');\n }\n return {\n flags: { ...overrides },\n facts: {},\n pickedFlags: [],\n outOfScopeFlags: [],\n overrides: { ...overrides },\n };\n }\n\n // Create merged flags for backwards compatibility\n const mergedFlags = { ...current.flags, ...overrides };\n\n return {\n ...current,\n flags: mergedFlags,\n parent: current,\n overrides: { ...overrides },\n };\n}\n\n/**\n * Execute a function with flag overrides that are isolated to the execution context.\n * This creates an overlay context that inherits from the current context but isolates\n * the overrides to prevent them from leaking to sibling operations.\n */\nexport function withFlagOverrides<T>(overrides: Record<string, any>, fn: () => T): T {\n const overlayContext = createOverlayContext(overrides);\n\n // Write overridden flags to span for observability\n for (const [key, value] of Object.entries(overrides)) {\n putOnSpan('flag', key, value);\n }\n\n return EVAL_CONTEXT.run(overlayContext, fn);\n}\n\nexport function withEvalContext<T>(\n options: {\n initialFlags?: Record<string, any>;\n pickedFlags?: string[];\n } = {},\n fn: () => T,\n): T {\n const { initialFlags = {}, pickedFlags = [] } = options;\n return EVAL_CONTEXT.run(\n {\n flags: { ...initialFlags },\n facts: {},\n pickedFlags,\n outOfScopeFlags: [],\n accessedFlagKeys: [],\n },\n fn,\n );\n}\n\n/**\n * Set the config scope for the current evaluation context.\n * This makes the scope available for global flag/fact access.\n *\n * Also stores a global fallback so suite-end summary can access schema defaults\n * even if createAppScope ran outside the active async context.\n */\nexport function setConfigScope(scope: ReturnType<typeof createAppScope>) {\n const current = EVAL_CONTEXT.get();\n if (current) {\n current.configScope = scope;\n }\n // Always set global fallback\n setGlobalConfigScope(scope);\n}\n\n/**\n * Get the config scope from the current evaluation context.\n * Falls back to global scope when no context is active.\n */\nexport function getConfigScope(): ReturnType<typeof createAppScope> | undefined {\n const current = EVAL_CONTEXT.get();\n return current?.configScope ?? getGlobalConfigScope();\n}\n\n/**\n * Get the picked flags from the current evaluation context.\n * Returns undefined if no picked flags are set or if called outside eval context.\n */\nexport function getPickedFlags(): string[] | undefined {\n return EVAL_CONTEXT.get()?.pickedFlags;\n}\n","import { createRequire } from 'node:module';\n\ninterface ContextManager<T = any> {\n getStore(): T | undefined;\n run<R>(value: T, fn: () => R): R;\n}\n\nconst CONTEXT_MANAGER_SYMBOL = Symbol.for('axiom.context_manager');\n\nfunction getGlobalContextManager(): ContextManager | undefined {\n return (globalThis as any)[CONTEXT_MANAGER_SYMBOL];\n}\n\nfunction setGlobalContextManager(manager: ContextManager): void {\n (globalThis as any)[CONTEXT_MANAGER_SYMBOL] = manager;\n}\n\nconst isNodeJS = typeof process !== 'undefined' && !!process.versions?.node;\n\nfunction getContextManager(): ContextManager {\n // Check global Symbol registry cache first (shared across VM contexts)\n const existing = getGlobalContextManager();\n if (existing) return existing;\n\n let manager: ContextManager;\n\n if (isNodeJS) {\n try {\n // Resolve AsyncLocalStorage in both ESM and CJS Node contexts without bundler interference\n let AsyncLocalStorage: any;\n\n // Use createRequire to obtain a require in ESM\n const req = createRequire(import.meta.url);\n try {\n AsyncLocalStorage = req('node:async_hooks').AsyncLocalStorage;\n } catch {\n AsyncLocalStorage = req('async_hooks').AsyncLocalStorage;\n }\n\n manager = new AsyncLocalStorage();\n } catch (error) {\n // Fallback if AsyncLocalStorage cannot be loaded\n console.warn('AsyncLocalStorage not available, using fallback context manager:', error);\n manager = createFallbackManager();\n }\n } else {\n // Browser/CF Workers - simple fallback (no warning needed here)\n console.warn('AsyncLocalStorage not available, using fallback context manager');\n manager = createFallbackManager();\n }\n\n // Cache using Symbol to share across VM contexts\n setGlobalContextManager(manager);\n\n return manager;\n}\n\nfunction createFallbackManager(): ContextManager {\n let currentContext: any = null;\n return {\n getStore: () => currentContext,\n run: <R>(value: any, fn: () => R): R => {\n const prev = currentContext;\n currentContext = value;\n try {\n return fn();\n } finally {\n currentContext = prev;\n }\n },\n };\n}\n\nexport function createAsyncHook<T>(_name: string) {\n return {\n get(): T | undefined {\n const manager = getContextManager();\n if (manager.getStore) {\n return manager.getStore();\n }\n return undefined;\n },\n run<R>(value: T, fn: () => R): R {\n const manager = getContextManager();\n return manager.run(value, fn);\n },\n };\n}\n\n/**\n * Reset the context manager singleton for tests.\n * This clears the global cache and forces a new AsyncLocalStorage instance to be created.\n * Useful for test isolation when needed.\n */\nexport function __resetContextManagerForTests(): void {\n delete (globalThis as any)[CONTEXT_MANAGER_SYMBOL];\n}\n","import { type ZodObject } from 'zod';\nimport { getGlobalFlagOverrides } from './evals/context/global-flags';\nimport { formatZodErrors, generateFlagExamples } from './cli/utils/format-zod-errors';\nimport { dotNotationToNested, isValidPath, parsePath } from './util/dot-path';\nimport { makeDeepPartial } from './util/deep-partial-schema';\nimport { assertZodV4 } from './util/zod-internals';\n\n/**\n * Validate CLI flag overrides against a schema early in eval execution.\n * Call this at the top of your eval file to fail fast on invalid flags.\n *\n * @param flagSchema - Zod schema to validate CLI flags against\n * @throws Error with helpful message if validation fails\n */\nexport function validateCliFlags(flagSchema: ZodObject<any>): void {\n assertZodV4(flagSchema, 'flagSchema');\n const globalOverrides = getGlobalFlagOverrides();\n\n if (Object.keys(globalOverrides).length === 0) {\n // No CLI flags provided, nothing to validate\n return;\n }\n\n validateFlags(flagSchema, globalOverrides);\n}\n\nfunction validateFlags(flagSchema: ZodObject<any>, globalOverrides: Record<string, any>): void {\n // First pass: check all paths exist in schema\n for (const [dotPath, _value] of Object.entries(globalOverrides)) {\n const segments = parsePath(dotPath);\n if (!isValidPath(flagSchema, segments)) {\n console.error('❌ Invalid CLI flags:');\n console.error(` • flag '${dotPath}': Invalid flag path`);\n console.error('\\n🔧 Fix your CLI flags and try again.\\n');\n process.exit(1);\n }\n }\n\n // Second pass: validate values using nested object approach with deep partial\n // This allows providing only some flags without requiring all nested objects\n const nestedObject = dotNotationToNested(globalOverrides);\n const deepPartialSchema = makeDeepPartial(flagSchema);\n const result = deepPartialSchema.safeParse(nestedObject);\n\n if (!result.success) {\n console.error('❌ Invalid CLI flags:');\n console.error(formatZodErrors(result.error));\n\n const examples = generateFlagExamples(result.error);\n if (examples.length > 0) {\n console.error('\\n💡 Valid examples:');\n examples.forEach((example) => console.error(` ${example}`));\n }\n\n console.error('\\n🔧 Fix your CLI flags and try again.\\n');\n process.exit(1);\n }\n}\n","import { type ZodError } from 'zod';\nimport type { ZodIssue } from 'zod/v3';\nimport type { $ZodIssue } from 'zod/v4/core';\n\n/**\n * Format ZodError issues into user-friendly CLI error messages\n */\nexport function formatZodErrors(error: ZodError): string {\n const issues = error.issues;\n const messages: string[] = [];\n\n for (const issue of issues) {\n const path = issue.path.join('.');\n const message = formatIssueMessage(issue, path);\n messages.push(` • ${message}`);\n }\n\n return messages.join('\\n');\n}\n\nfunction formatIssueMessage(issue: any, path: string): string {\n switch (issue.code) {\n case 'invalid_type':\n return `flag '${path}' expected ${issue.expected}, got ${JSON.stringify(issue.received)} (${typeof issue.received})`;\n\n case 'too_small':\n if (issue.type === 'number' || issue.origin === 'number') {\n return `flag '${path}' must be >= ${issue.minimum}, got ${issue.received}`;\n }\n return `flag '${path}' is too small: ${issue.message}`;\n\n case 'too_big':\n if (issue.type === 'number') {\n return `flag '${path}' must be <= ${issue.maximum}, got ${issue.received}`;\n }\n return `flag '${path}' is too big: ${issue.message}`;\n\n case 'invalid_enum_value':\n const options = issue.options.map((opt: any) => `\"${opt}\"`).join(', ');\n return `flag '${path}' must be one of: ${options}, got \"${issue.received}\"`;\n\n case 'invalid_value':\n // Handle enum validation errors\n if (issue.values && Array.isArray(issue.values)) {\n const values = issue.values.map((val: any) => `\"${val}\"`).join(', ');\n return `flag '${path}' must be one of: ${values}`;\n }\n return `flag '${path}': ${issue.message}`;\n\n case 'unrecognized_keys':\n // Handle unrecognized keys properly, especially when path is empty\n const keys = issue.keys || [];\n if (keys.length === 1) {\n return `unrecognized flag '${keys[0]}'`;\n } else if (keys.length > 1) {\n const keysList = keys.map((key: string) => `'${key}'`).join(', ');\n return `unrecognized flags ${keysList}`;\n }\n return `unrecognized keys in flags`;\n\n case 'custom':\n return `flag '${path}': ${issue.message}`;\n\n default:\n return `flag '${path}': ${issue.message}`;\n }\n}\n\n/**\n * Create helpful examples for CLI usage based on validation errors\n */\nexport function generateFlagExamples(error: ZodError): string[] {\n const examples: string[] = [];\n\n for (const issue of error.issues) {\n const path = issue.path.join('.');\n const example = generateExampleForIssue(issue, path);\n if (example && !examples.includes(example)) {\n examples.push(example);\n }\n }\n\n return examples.slice(0, 3); // Limit to 3 examples\n}\n\nfunction generateExampleForIssue(issue: ZodIssue | $ZodIssue, path: string): string | null {\n switch (issue.code) {\n case 'invalid_type':\n if (issue.expected === 'number') {\n return `--flag.${path}=0.7`;\n }\n if (issue.expected === 'boolean') {\n return `--flag.${path}=true`;\n }\n if (issue.expected === 'string') {\n return `--flag.${path}=\"value\"`;\n }\n break;\n\n case 'too_small':\n if (typeof issue.minimum === 'number' || typeof issue.minimum === 'bigint') {\n return `--flag.${path}=${issue.minimum}`;\n }\n break;\n\n case 'too_big':\n if (typeof issue.maximum === 'number' || typeof issue.maximum === 'bigint') {\n return `--flag.${path}=${issue.maximum}`;\n }\n break;\n\n case 'invalid_enum_value':\n if (issue.options.length > 0) {\n return `--flag.${path}=${issue.options[0]}`;\n }\n break;\n\n case 'invalid_value':\n if (issue.values && Array.isArray(issue.values) && issue.values.length > 0) {\n return `--flag.${path}=${String(issue.values[0])}`;\n }\n break;\n }\n\n return null;\n}\n","import { type ZodObject, type ZodSchema, type ZodType, z } from 'zod';\nimport { getDef, getShape, isObjectSchema, unwrapTransparent } from './zod-internals';\n\n/**\n * Parse a dot notation path into segments.\n * @param path - Dot notation path like \"ui.theme\" or \"api.timeout\"\n * @returns Array of path segments\n */\nexport function parsePath(path: string): string[] {\n return path.split('.');\n}\n\n/**\n * Transform dot notation object to nested object structure.\n * Example: {\"ui.theme\": \"dark\", \"config.name\": \"test\"}\n * -> {ui: {theme: \"dark\"}, config: {name: \"test\"}}\n */\nexport function dotNotationToNested(\n dotNotationObject: Record<string, unknown>,\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [dotPath, value] of Object.entries(dotNotationObject)) {\n const segments = parsePath(dotPath);\n let current: Record<string, unknown> = result;\n\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n\n if (i === segments.length - 1) {\n // Last segment - set the value\n current[segment] = value;\n } else {\n // Intermediate segment - ensure object exists\n if (!(segment in current) || typeof current[segment] !== 'object') {\n current[segment] = {};\n }\n current = current[segment] as Record<string, unknown>;\n }\n }\n }\n\n return result;\n}\n\n/**\n * Flatten nested object to dot notation.\n * Example: {ui: {theme: \"dark\"}, config: {name: \"test\"}}\n * -> {\"ui.theme\": \"dark\", \"config.name\": \"test\"}\n */\nexport function flattenObject(obj: Record<string, unknown>, prefix = ''): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n const newKey = prefix ? `${prefix}.${key}` : key;\n\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n Object.assign(result, flattenObject(value as Record<string, unknown>, newKey));\n } else {\n result[newKey] = value;\n }\n }\n\n return result;\n}\n\n/**\n * Check if a dot notation path exists in the schema.\n */\nexport function isValidPath(\n schema: ZodObject<Record<string, ZodType>>,\n segments: string[],\n): boolean {\n let currentSchema: ZodType = schema;\n\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const shape = getShape(currentSchema);\n\n if (!shape || !(segment in shape)) {\n return false;\n }\n\n if (i < segments.length - 1) {\n // Not the last segment, should be a ZodObject\n const nextSchema = shape[segment];\n\n // Handle wrapped schemas (ZodDefault, ZodOptional, etc.)\n const unwrappedSchema = unwrapTransparent(nextSchema);\n\n if (!isObjectSchema(unwrappedSchema)) {\n return false;\n }\n\n currentSchema = unwrappedSchema;\n }\n }\n\n return true;\n}\n\n/**\n * Get value at a specific path in a nested object.\n */\nexport function getValueAtPath(obj: unknown, segments: string[]): unknown {\n let current = obj;\n for (const segment of segments) {\n if (current == null || typeof current !== 'object' || !(segment in current)) {\n return undefined;\n }\n current = (current as Record<string, unknown>)[segment];\n }\n return current;\n}\n\n/**\n * Helper function to traverse schema object to find the field schema at a specific path.\n */\nexport function findSchemaAtPath(\n rootSchema: ZodObject<Record<string, ZodType>> | undefined,\n segments: string[],\n): ZodSchema | undefined {\n if (!rootSchema || segments.length === 0) return undefined;\n\n let current: ZodType = rootSchema;\n\n // ZodObject root - start with the shape\n if (segments.length > 0) {\n const rootShape = getShape(current);\n if (!rootShape || !(segments[0] in rootShape)) {\n return undefined;\n }\n current = rootShape[segments[0]];\n\n // Continue with remaining segments starting from index 1\n for (let i = 1; i < segments.length; i++) {\n const segment = segments[i];\n const def = getDef(current);\n if (!def) {\n return undefined;\n }\n\n // Unwrap transparent wrappers (ZodDefault, ZodOptional, ZodNullable, etc.)\n current = unwrapTransparent(current);\n if (!isObjectSchema(current)) {\n return undefined;\n }\n const shape = getShape(current);\n if (!shape) {\n return undefined;\n }\n const nextSchema = shape[segment];\n if (!nextSchema) {\n return undefined;\n }\n current = nextSchema;\n }\n return current as ZodSchema;\n }\n\n return current as ZodSchema;\n}\n\n/**\n * Build a schema that validates only a specific path within a larger schema structure.\n * This allows validation of partial nested objects where only the target field is required.\n *\n * For example, for path \"ui.theme.colors.primary\":\n * - Creates: z.object({ ui: z.object({ theme: z.object({ colors: z.object({ primary: leafSchema }).partial() }).partial() }).partial() }).strict()\n * - This allows recording just { ui: { theme: { colors: { primary: value } } } } without requiring siblings\n *\n * @param rootSchema - The root ZodObject schema\n * @param segments - Path segments (e.g. ['ui', 'theme', 'colors', 'primary'])\n * @returns A schema that validates the specific path with partial validation for siblings\n */\nexport function buildSchemaForPath(\n rootSchema: ZodObject<Record<string, ZodType>>,\n segments: string[],\n): ZodSchema {\n const pathKey = segments.join('.');\n\n // Find the leaf schema for the target field\n const leafSchema = findSchemaAtPath(rootSchema, segments);\n if (!leafSchema) {\n throw new Error(`Cannot find schema for path: ${pathKey}`);\n }\n\n // Build the schema from leaf back to root, making siblings optional at each level\n let currentSchema: ZodSchema = leafSchema;\n\n // Work backwards through the segments\n for (let i = segments.length - 1; i >= 0; i--) {\n const segment = segments[i];\n\n // Create an object schema with just this segment\n const objectSchema = z.object({ [segment]: currentSchema });\n\n // Make it partial (so siblings aren't required) and strict (so unknown keys are rejected)\n currentSchema = objectSchema.partial().strict();\n }\n\n return currentSchema;\n}\n","import type { ZodObject, ZodType } from 'zod';\n\n/**\n * Detect if a schema is from Zod v4.\n * v4 schemas have `_zod`, v3 schemas only have `_def`.\n */\nexport function isZodV4Schema(schema: unknown): boolean {\n if (!schema || typeof schema !== 'object') return false;\n const s = schema as Record<string, unknown>;\n return '_zod' in s;\n}\n\n/**\n * Assert that a schema is from Zod v4, throwing a helpful error if it isn't.\n */\nexport function assertZodV4(schema: unknown, context: string): void {\n if (!isZodV4Schema(schema)) {\n throw new Error(\n `[AxiomAI] Zod v4 schemas are required (detected in ${context}). Found unsupported Zod version.`,\n );\n }\n}\n\n/** Normalized schema kinds we care about */\nexport type ZodKind =\n | 'object'\n | 'optional'\n | 'default'\n | 'nullable'\n | 'readonly'\n | 'prefault'\n | 'nonoptional'\n | 'catch'\n | 'array'\n | 'record'\n | 'union'\n | 'discriminatedunion'\n | 'other';\n\n/** Minimal internal def shape we access (Zod v4) */\ninterface ZodInternalDef {\n type?: unknown;\n innerType?: ZodType<unknown>;\n element?: ZodType<unknown>;\n defaultValue?: unknown;\n shape?: Record<string, ZodType<unknown>>;\n valueType?: ZodType<unknown>;\n}\n\n/**\n * Get the internal def object from a Zod v4 schema.\n */\nexport function getDef(schema: unknown): ZodInternalDef | undefined {\n if (!schema || typeof schema !== 'object') return undefined;\n\n const s = schema as Record<string, unknown>;\n\n if (s._zod && typeof s._zod === 'object') {\n const zod = s._zod as Record<string, unknown>;\n if (zod.def && typeof zod.def === 'object') {\n return zod.def as ZodInternalDef;\n }\n }\n\n return undefined;\n}\n\n/**\n * Get the raw type string from a def (Zod v4).\n */\nfunction getDefRawType(def: ZodInternalDef | undefined): string | undefined {\n if (!def) return undefined;\n const raw = def.type;\n if (raw == null) return undefined;\n return typeof raw === 'string' ? raw : String(raw);\n}\n\nconst KNOWN_KINDS = new Set<ZodKind>([\n 'object',\n 'optional',\n 'default',\n 'nullable',\n 'readonly',\n 'prefault',\n 'nonoptional',\n 'catch',\n 'array',\n 'record',\n 'union',\n 'discriminatedunion',\n]);\n\n/**\n * Get the normalized ZodKind from a schema or def (Zod v4).\n */\nexport function getKind(schemaOrDef: unknown): ZodKind | undefined {\n // If it looks like a def already (has type), use it directly\n const def =\n schemaOrDef && typeof schemaOrDef === 'object' && 'type' in schemaOrDef\n ? (schemaOrDef as ZodInternalDef)\n : getDef(schemaOrDef);\n\n const raw = getDefRawType(def);\n if (!raw) return undefined;\n\n const normalized = raw.toLowerCase();\n return KNOWN_KINDS.has(normalized as ZodKind) ? (normalized as ZodKind) : 'other';\n}\n\n/**\n * Check if a schema is an object schema (has shape).\n */\nexport function isObjectSchema(schema: unknown): schema is ZodObject<Record<string, ZodType>> {\n if (!schema || typeof schema !== 'object') return false;\n\n if ('shape' in schema && typeof (schema as Record<string, unknown>).shape === 'object') {\n return true;\n }\n\n return getKind(schema) === 'object';\n}\n\n/**\n * Get the innerType from wrapper schemas (optional, nullable, default).\n */\nexport function getInnerType(schema: unknown): ZodType<unknown> | undefined {\n const def = getDef(schema);\n return def?.innerType;\n}\n\n/**\n * Get the element type from array schemas.\n */\nexport function getArrayElement(schema: unknown): ZodType<unknown> | undefined {\n const def = getDef(schema);\n return def?.element;\n}\n\n/**\n * Get the shape from an object schema (Zod v4).\n */\nexport function getShape(schema: unknown): Record<string, ZodType<unknown>> | undefined {\n if (!schema || typeof schema !== 'object') return undefined;\n\n // Direct shape property (Zod v4)\n const s = schema as Record<string, unknown>;\n if (s.shape && typeof s.shape === 'object') {\n return s.shape as Record<string, ZodType<unknown>>;\n }\n\n return undefined;\n}\n\n/**\n * Get the default value from a schema wrapped in ZodDefault.\n */\nexport function getDefaultValue(schema: unknown): unknown {\n const def = getDef(schema);\n return def?.defaultValue;\n}\n\nconst TRANSPARENT_WRAPPERS = [\n 'optional',\n 'nullable',\n 'default',\n 'readonly',\n 'prefault',\n 'nonoptional',\n 'catch', // transparent for schema structure, but alters error behavior\n];\n\n/**\n * Unwrap transparent wrappers (optional, nullable, default) to get the core schema.\n * Useful when you need to check the underlying type.\n */\nexport function unwrapTransparent(schema: ZodType<unknown>): ZodType<unknown> {\n let current: unknown = schema;\n\n for (let i = 0; i < 10; i++) {\n const kind = getKind(current);\n if (!kind) break;\n\n if (TRANSPARENT_WRAPPERS.includes(kind)) {\n const inner = getInnerType(current);\n if (!inner) break;\n current = inner;\n continue;\n }\n break;\n }\n\n return current as ZodType<unknown>;\n}\n","import { type ZodObject, type ZodType, z } from 'zod';\nimport {\n getKind,\n getInnerType,\n getArrayElement,\n isObjectSchema,\n getDefaultValue,\n} from './zod-internals';\n\n/**\n * Recursively makes all properties of a ZodObject schema optional (deep partial).\n * This is needed because Zod 4 removed the deprecated `.deepPartial()` method.\n *\n * When validating CLI flag overrides, we only want to validate the flags that are\n * provided, not require all nested objects to be fully specified.\n */\nexport function makeDeepPartial(schema: ZodObject<Record<string, ZodType>>): ZodType {\n const shape = schema.shape;\n const newShape: Record<string, ZodType> = {};\n\n for (const [key, value] of Object.entries(shape)) {\n newShape[key] = makeDeepPartialField(value as ZodType);\n }\n\n return z.object(newShape);\n}\n\n/**\n * Apply deep partial semantics to a single field of an object shape.\n */\nfunction makeDeepPartialField(fieldSchema: ZodType): ZodType {\n const kind = getKind(fieldSchema);\n\n // Plain object field - recurse and make optional\n if (isObjectSchema(fieldSchema)) {\n const partialObject = makeDeepPartial(fieldSchema as ZodObject<Record<string, ZodType>>);\n return partialObject.optional();\n }\n\n // Optional wrapper - check if inner type is an object\n if (kind === 'optional') {\n const inner = getInnerType(fieldSchema);\n if (inner && isObjectSchema(inner)) {\n const partialInner = makeDeepPartial(inner as ZodObject<Record<string, ZodType>>);\n return partialInner.optional();\n }\n // Already optional and not an object - preserve as-is\n return fieldSchema;\n }\n\n // Nullable wrapper - check if inner type is an object\n if (kind === 'nullable') {\n const inner = getInnerType(fieldSchema);\n if (inner && isObjectSchema(inner)) {\n const partialInner = makeDeepPartial(inner as ZodObject<Record<string, ZodType>>);\n return partialInner.nullable().optional();\n }\n // Nullable non-object - just make optional\n return fieldSchema.optional();\n }\n\n // Default wrapper - check if inner type is an object\n if (kind === 'default') {\n const inner = getInnerType(fieldSchema);\n const defaultValue = getDefaultValue(fieldSchema);\n\n if (inner && isObjectSchema(inner)) {\n const partialInner = makeDeepPartial(inner as ZodObject<Record<string, ZodType>>);\n // Reapply the default on the deep-partialled object, preserving function references for lazy defaults\n return (partialInner as ZodObject<Record<string, ZodType>>).default(defaultValue as any);\n }\n // Non-object with default - make optional to allow partial validation\n return fieldSchema.optional();\n }\n\n // Array wrapper - deep partial the element type if it's an object\n if (kind === 'array') {\n const element = getArrayElement(fieldSchema);\n if (element && isObjectSchema(element)) {\n const partialElement = makeDeepPartial(element as ZodObject<Record<string, ZodType>>);\n return z.array(partialElement).optional();\n }\n // Array of non-objects - just make optional\n return fieldSchema.optional();\n }\n\n // All other field types - just make optional\n return fieldSchema.optional();\n}\n","import { type AttributeValue } from '@opentelemetry/api';\n\nfunction toHomogeneousArray(input: unknown[]): AttributeValue | undefined {\n if (input.length === 0) return undefined;\n\n const converted: (string | number | boolean)[] = [];\n const types = new Set<string>();\n\n for (const item of input) {\n const converted_item = toOtelPrimitive(item);\n if (converted_item !== undefined) {\n converted.push(converted_item);\n types.add(typeof converted_item);\n }\n }\n\n if (converted.length === 0) return undefined;\n\n if (types.size > 1) {\n return converted.map((item) => String(item)) as AttributeValue;\n }\n\n return converted as AttributeValue;\n}\n\nfunction toOtelPrimitive(v: unknown): string | number | boolean | undefined {\n switch (typeof v) {\n case 'string':\n return v;\n case 'number':\n return Number.isFinite(v) ? v : undefined;\n case 'boolean':\n return v;\n case 'bigint':\n if (v >= Number.MIN_SAFE_INTEGER && v <= Number.MAX_SAFE_INTEGER) {\n return Number(v);\n }\n return v.toString();\n case 'function':\n case 'symbol':\n case 'undefined':\n return undefined;\n case 'object':\n if (v === null) return undefined;\n if (v instanceof Date) return v.toISOString();\n if (v instanceof Error) return v.message;\n // fallback: stringify object-ish values\n return safeStringify(v);\n }\n}\n\nfunction safeStringify(obj: unknown): string | undefined {\n try {\n // Convert BigInt -> Number inside objects so JSON.stringify won't throw.\n // Functions/undefined are dropped by JSON rules.\n const s = JSON.stringify(obj, (_k, val) =>\n typeof val === 'bigint' ? Number(val) : val instanceof Date ? val.toISOString() : val,\n );\n // Avoid empty/meaningless \"{}\" for Map/Set—stringify those explicitly\n if (s === '{}') {\n if (obj instanceof Map) {\n return JSON.stringify(Object.fromEntries(obj));\n }\n if (obj instanceof Set) {\n return JSON.stringify(Array.from(obj));\n }\n }\n return s ?? undefined;\n } catch {\n // As a last resort, use toString() if present\n try {\n const t = (obj as any)?.toString?.();\n return typeof t === 'string' ? t : undefined;\n } catch {\n return undefined;\n }\n }\n}\n\nexport function toOtelAttribute(input: unknown): AttributeValue | undefined {\n // primitives fast-path\n switch (typeof input) {\n case 'string':\n return input;\n case 'number':\n return Number.isFinite(input) ? input : undefined;\n case 'boolean':\n return input;\n case 'bigint':\n if (input >= Number.MIN_SAFE_INTEGER && input <= Number.MAX_SAFE_INTEGER) {\n return Number(input);\n }\n return input.toString();\n case 'function':\n case 'symbol':\n case 'undefined':\n return undefined;\n }\n\n // arrays -> homogeneous array of primitives\n if (Array.isArray(input)) {\n return toHomogeneousArray(input);\n }\n\n // date -> ISO string\n if (input instanceof Date) {\n return input.toISOString();\n }\n\n // null / objects -> JSON string\n if (input === null) return undefined;\n return safeStringify(input);\n}\n","export { withSpan } from './withSpan';\nexport { wrapAISDKModel } from './vercel';\nexport { Attr } from './semconv/attributes';\n","import { Type as TypeBox, type TSchema as TypeBoxSchema, type Static } from '@sinclair/typebox';\n\n/**\n * Template-friendly TypeBox types for use with Handlebars.\n *\n * These types are designed to be easily serializable and work well in template contexts\n * where data needs to be rendered as strings or used in conditionals and loops.\n *\n * All composite types (Array, Object, etc.) only accept other Template types.\n */\n\n// Brand to distinguish Template types from raw TypeBox types\ndeclare const SchemaBrand: unique symbol;\ntype TSchema<T extends TypeBoxSchema = TypeBoxSchema> = T & { [SchemaBrand]: true };\n\n/**\n * Utility type to infer TypeScript types from {@link TSchema}.\n */\nexport type InferSchema<T extends TSchema> = Static<T>;\n\n/**\n * Utility type to infer context types from {@link Prompt} arguments.\n *\n * Used with {@link parse} function to ensure type safety when providing context values.\n */\nexport type InferContext<T extends Record<string, TSchema>> = Static<\n ReturnType<typeof createObject<T>>\n>;\n\ntype OmitFirst<T extends any[]> = T extends [any, ...infer R] ? R : never;\n\n// Helper to create branded Template types\nconst createTemplateType = <T extends TypeBoxSchema>(schema: T): TSchema<T> => schema as TSchema<T>;\n\n// Primitive type creators\nconst createString = (...args: Parameters<typeof TypeBox.String>) =>\n createTemplateType(TypeBox.String(...args));\nconst createNumber = (...args: Parameters<typeof TypeBox.Number>) =>\n createTemplateType(TypeBox.Number(...args));\nconst createInteger = (...args: Parameters<typeof TypeBox.Integer>) =>\n createTemplateType(TypeBox.Integer(...args));\nconst createBoolean = (...args: Parameters<typeof TypeBox.Boolean>) =>\n createTemplateType(TypeBox.Boolean(...args));\nconst createNull = (...args: Parameters<typeof TypeBox.Null>) =>\n createTemplateType(TypeBox.Null(...args));\nconst createLiteral = <T extends string | number | boolean>(\n value: T,\n ...args: OmitFirst<Parameters<typeof TypeBox.Literal>>\n) => createTemplateType(TypeBox.Literal(value, ...args));\nconst createUndefined = (...args: Parameters<typeof TypeBox.Undefined>) =>\n createTemplateType(TypeBox.Undefined(...args));\n\n// Collection type creators - only accept Template types\nconst createArray = <T extends TSchema>(\n items: T,\n ...args: OmitFirst<Parameters<typeof TypeBox.Array>>\n) => createTemplateType(TypeBox.Array(items, ...args));\n\nconst createObject = <T extends Record<string, TSchema>>(\n properties: T,\n ...args: OmitFirst<Parameters<typeof TypeBox.Object>>\n) => createTemplateType(TypeBox.Object(properties, ...args));\n\nconst createRecord = <V extends TSchema>(\n value: V,\n ...args: OmitFirst<OmitFirst<Parameters<typeof TypeBox.Record>>>\n) => createTemplateType(TypeBox.Record(TypeBox.String(), value, ...args));\n\nconst createTuple = <T extends TSchema[]>(\n types: [...T],\n ...args: OmitFirst<Parameters<typeof TypeBox.Tuple>>\n) => {\n return createTemplateType(TypeBox.Tuple(types, ...args));\n};\n\n// Modifier type creators - only accept Template types\nconst createOptional = <T extends TSchema>(\n schema: T,\n ...args: OmitFirst<Parameters<typeof TypeBox.Optional>>\n) => createTemplateType(TypeBox.Optional(schema, true, ...args));\n\nconst createUnion = <T extends TSchema[]>(\n schemas: [...T],\n ...args: OmitFirst<Parameters<typeof TypeBox.Union>>\n) => createTemplateType(TypeBox.Union(schemas, ...args));\n\n// Export all template-friendly types as a namespace\nexport const Type = {\n // Primitives\n String: createString,\n Number: createNumber,\n Integer: createInteger,\n Boolean: createBoolean,\n Null: createNull,\n Undefined: createUndefined,\n\n // Literals\n Literal: createLiteral,\n\n // Collections - only accept Template types\n Array: createArray,\n Object: createObject,\n Record: createRecord,\n Tuple: createTuple,\n\n // Modifiers - only accept Template types\n Optional: createOptional,\n Union: createUnion,\n} as const;\n\n// Export the branded type for advanced usage\nexport type { TSchema };\n\n// Default export for convenience\nexport default Type;\n","import type { Prompt } from '../types';\nimport type { InferContext } from '../template';\nimport type { AxiomPromptMetadata, ParsedMessage, ParsedMessagesArray } from '../types/metadata';\n\nconst getParser = async () => {\n const handlebars = await import('./parsers/handlebars').then((m) => m.handlebarsParse);\n return handlebars;\n};\n\n/**\n * Parses a prompt template by replacing variables with provided context values.\n *\n * This function processes Handlebars templates in prompt messages and attaches metadata\n * for instrumentation and tracking.\n *\n * @experimental This API is experimental and may change in future versions.\n *\n * @param prompt - The {@link Prompt} template to parse\n * @param options - Parsing options\n * @param options.context - Context values to substitute into the template\n * @returns Promise that resolves to the parsed prompt with processed messages;\n */\nexport const parse = async <\n TPrompt extends Prompt,\n TMessages extends TPrompt['messages'] = TPrompt['messages'],\n>(\n prompt: TPrompt & { messages: TMessages },\n {\n context,\n }: {\n context: InferContext<TPrompt['arguments']>;\n },\n): Promise<Omit<TPrompt, 'messages'> & { messages: ParsedMessagesArray<TMessages> }> => {\n const messagesPromises = prompt.messages.map(async (message) => {\n const parser = await getParser();\n return {\n ...message,\n content: await parser(message.content, { context }),\n };\n });\n\n const parsedMessages: ParsedMessage[] = await Promise.all(messagesPromises);\n\n // Create metadata object from prompt\n const promptMetadata: AxiomPromptMetadata = {\n id: prompt.promptId,\n name: prompt.name,\n slug: prompt.slug,\n version: prompt.version,\n };\n\n // Attach metadata to the last message's providerOptions for detection in the wrapper\n // The Vercel SDK converts providerOptions -> providerMetadata in convertToLanguageModelMessage\n if (parsedMessages.length > 0) {\n const lastMessage = parsedMessages[parsedMessages.length - 1];\n lastMessage.providerOptions = {\n ...lastMessage.providerOptions,\n _axiomMeta: promptMetadata,\n };\n lastMessage.providerMetadata = {\n ...lastMessage.providerMetadata,\n _axiomMeta: promptMetadata,\n };\n }\n\n // Also create a Proxy for direct access in tests\n const messages = new Proxy(parsedMessages, {\n get(target: ParsedMessage[], prop: string | symbol, receiver: unknown): any {\n // Special metadata access\n if (prop === '_axiomMeta') {\n return promptMetadata;\n }\n // All other properties (array methods, indices, etc.)\n return Reflect.get(target, prop, receiver) as ParsedMessage | undefined;\n },\n }) as ParsedMessagesArray<TMessages>;\n\n return {\n ...prompt,\n messages: messages,\n };\n};\n\n// Re-export template types for convenience\nexport { Type as Template, type InferContext } from '../template';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAKM,kBAMO;AAXb;AAAA;AAAA;AAKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,OAClD,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEpC,IAAM,gBAAgC,iCAAiB;AAAA;AAAA;;;;;;;;;;;;;;;ACX9D,QAAM,SAAS;MACb,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;;AAGP,QAAM,WAAW;AAAjB,QACE,WAAW;AAEb,aAAS,WAAW,KAAK;AACvB,aAAO,OAAO,GAAG;;AAGZ,aAAS,OAAO,KAAuB;AAC5C,eAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AACzC,iBAAS,OAAO,UAAU,CAAC,GAAG;AAC5B,cAAI,OAAO,UAAU,eAAe,KAAK,UAAU,CAAC,GAAG,GAAG,GAAG;AAC3D,gBAAI,GAAG,IAAI,UAAU,CAAC,EAAE,GAAG;;;;AAKj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AO,WAAY,GAAG,IAAI;AAC5B;AAMO,IAAM,UAAU,IAAI,SAAoB;AAC7C,wBAAsB,UAAU;AAChC,SAAQ,aAA0B,GAAG,IAAI;AAC3C;","names":["isFunction","exports","context","context","context","context","options","ret","wrapper","context","ret","options","Handlebars","trace","parse","lexer","exports","parse","compile","context","exports","exports","exports","exports","exports","exports","sourceFile","exports","exports","exports","context","needle","section","exports","exports","context","exports","module","Handlebars","context","onlineEval","import_api","import_api","import_api","import_api","context","import_api","import_api","import_api","import_api","import_api","import_zod","import_zod","context","import_zod","import_api","import_zod","import_api","TypeBox","context","onlineEval"]}
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.5.0_jiti@2.6.1_postcss@8.5.6_tsx@4.20.4_typescript@5.9.2/node_modules/tsup/assets/cjs_shims.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/utils.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/exception.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers/block-helper-missing.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers/each.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers/helper-missing.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers/if.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers/log.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers/lookup.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers/with.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/helpers.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/decorators/inline.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/decorators.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/logger.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/internal/create-new-lookup-object.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/internal/proto-access.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/base.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/safe-string.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/internal/wrapHelper.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/runtime.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/no-conflict.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars.runtime.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/ast.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/parser.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/visitor.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/whitespace-control.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/helpers.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/base.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/compiler.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/binary-search.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js","../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/source-map.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/code-gen.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/javascript-compiler.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/handlebars/compiler/printer.js","../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/lib/index.js","../src/prompt/parsers/handlebars.ts","../src/index.ts","../src/otel/initAxiomAI.ts","../package.json","../src/otel/utils/redaction.ts","../src/otel/withSpanBaggageKey.ts","../src/otel/vercel.ts","../src/otel/AxiomWrappedLanguageModelV1.ts","../src/otel/middleware.ts","../src/otel/semconv/attributes.ts","../src/otel/semconv/eval_proposal.ts","../src/otel/completionUtils.ts","../src/otel/utils/contentSanitizer.ts","../src/util/promptUtils.ts","../src/otel/utils/wrapperUtils.ts","../src/schema.ts","../src/otel/startActiveSpan.ts","../src/otel/utils/normalized.ts","../src/otel/streaming/aggregators.ts","../src/util/currentUnixTime.ts","../src/otel/AxiomWrappedLanguageModelV2.ts","../src/otel/AxiomWrappedLanguageModelV3.ts","../src/otel/withSpan.ts","../src/util/name-validation-runtime.ts","../src/online-evals/onlineEval.ts","../src/online-evals/executor.ts","../src/evals/normalize-score.ts","../src/evals/deprecated.ts","../src/evals/scorer.factory.ts","../src/otel/wrapTool.ts","../src/util/typedEntries.ts","../src/app-scope.ts","../src/evals/context/global-flags.ts","../src/evals/context/storage.ts","../src/evals/context/manager.ts","../src/validate-flags.ts","../src/cli/utils/format-zod-errors.ts","../src/util/dot-path.ts","../src/util/zod-internals.ts","../src/util/deep-partial-schema.ts","../src/otel/utils/to-otel-attribute.ts","../src/otel/index.ts","../src/template.ts","../src/prompt/index.ts"],"sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL(`file:${__filename}`).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","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 (typeof Symbol === 'function' && context[Symbol.iterator]) {\n const newContext = [];\n const iterator = context[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 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.8';\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","/* global globalThis */\nexport default function(Handlebars) {\n /* istanbul ignore next */\n // https://mathiasbynens.be/notes/globalthis\n (function() {\n if (typeof globalThis === 'object') return;\n Object.prototype.__defineGetter__('__magic__', function() {\n return this;\n });\n __magic__.globalThis = __magic__; // eslint-disable-line no-undef\n delete Object.prototype.__magic__;\n })();\n\n const $Handlebars = globalThis.Handlebars;\n\n /* istanbul ignore next */\n Handlebars.noConflict = function() {\n if (globalThis.Handlebars === Handlebars) {\n globalThis.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 '<dir>/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 === null) {\n return 1; // aStr2 !== null\n }\n\n if (aStr2 === null) {\n return -1; // aStr1 !== null\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n/**\n * Strip any JSON XSSI avoidance prefix from the string (as documented\n * in the source maps specification), and then parse the string as\n * JSON.\n */\nfunction parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}\nexports.parseSourceMapInput = parseSourceMapInput;\n\n/**\n * Compute the URL of a source given the the source root, the source's\n * URL, and the source map's URL.\n */\nfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n sourceURL = sourceURL || '';\n\n if (sourceRoot) {\n // This follows what Chrome does.\n if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n sourceRoot += '/';\n }\n // The spec says:\n // Line 4: An optional source root, useful for relocating source\n // files on a server or removing repeated values in the\n // “sources” entry. This value is prepended to the individual\n // entries in the “source” field.\n sourceURL = sourceRoot + sourceURL;\n }\n\n // Historically, SourceMapConsumer did not take the sourceMapURL as\n // a parameter. This mode is still somewhat supported, which is why\n // this code block is conditional. However, it's preferable to pass\n // the source map URL to SourceMapConsumer, so that this function\n // can implement the source URL resolution algorithm as outlined in\n // the spec. This block is basically the equivalent of:\n // new URL(sourceURL, sourceMapURL).toString()\n // ... except it avoids using URL, which wasn't available in the\n // older releases of node still supported by this library.\n //\n // The spec says:\n // If the sources are not absolute URLs after prepending of the\n // “sourceRoot”, the sources are resolved relative to the\n // SourceMap (like resolving script src in a html document).\n if (sourceMapURL) {\n var parsed = urlParse(sourceMapURL);\n if (!parsed) {\n throw new Error(\"sourceMapURL could not be parsed\");\n }\n if (parsed.path) {\n // Strip the last path component, but keep the \"/\".\n var index = parsed.path.lastIndexOf('/');\n if (index >= 0) {\n parsed.path = parsed.path.substring(0, index + 1);\n }\n }\n sourceURL = join(urlGenerate(parsed), sourceURL);\n }\n\n return normalize(sourceURL);\n}\nexports.computeSourceURL = computeSourceURL;\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 util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 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 util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\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 base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var sourceRelative = sourceFile;\n if (sourceRoot !== null) {\n sourceRelative = util.relative(sourceRoot, sourceFile);\n }\n\n if (!generator._sources.has(sourceRelative)) {\n generator._sources.add(sourceRelative);\n }\n\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\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\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\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// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 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\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number is 1-based.\n * - column: Optional. the column number in the original source.\n * The column number is 0-based.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n needle.source = this._findSourceIndex(needle.source);\n if (needle.source < 0) {\n return [];\n }\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The first parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n if (sourceRoot) {\n sourceRoot = util.normalize(sourceRoot);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this._absoluteSources = this._sources.toArray().map(function (s) {\n return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n });\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this._sourceMapURL = aSourceMapURL;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Utility function to find the index of a source. Returns -1 if not\n * found.\n */\nBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n if (this._sources.has(relativeSource)) {\n return this._sources.indexOf(relativeSource);\n }\n\n // Maybe aSource is an absolute URL as returned by |sources|. In\n // this case we can't simply undo the transform.\n var i;\n for (i = 0; i < this._absoluteSources.length; ++i) {\n if (this._absoluteSources[i] == aSource) {\n return i;\n }\n }\n\n return -1;\n};\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @param String aSourceMapURL\n * The URL at which the source map can be found (optional)\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n smc._sourceMapURL = aSourceMapURL;\n smc._absoluteSources = smc._sources.toArray().map(function (s) {\n return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n });\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._absoluteSources.slice();\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n var index = this._findSourceIndex(aSource);\n if (index >= 0) {\n return this.sourcesContent[index];\n }\n\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + relativeSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The first parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based. \n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = null;\n if (mapping.name) {\n name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n }\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\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 SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex] || '';\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex] || '';\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n","/* global define, require */\nimport { isArray } from '../utils';\n\nlet SourceNode;\n\ntry {\n /* istanbul ignore next */\n if (typeof define !== 'function' || !define.amd) {\n // We don't support this in AMD environments. For these environments, we assume that\n // they are running on the browser and thus have no need for the source-map library.\n let SourceMap = require('source-map');\n SourceNode = SourceMap.SourceNode;\n }\n} catch (err) {\n /* NOP */\n}\n\n/* istanbul ignore if: tested but not covered in istanbul due to dist build */\nif (!SourceNode) {\n SourceNode = function(line, column, srcFile, chunks) {\n this.src = '';\n if (chunks) {\n this.add(chunks);\n }\n };\n /* istanbul ignore next */\n SourceNode.prototype = {\n add: function(chunks) {\n if (isArray(chunks)) {\n chunks = chunks.join('');\n }\n this.src += chunks;\n },\n prepend: function(chunks) {\n if (isArray(chunks)) {\n chunks = chunks.join('');\n }\n this.src = chunks + this.src;\n },\n toStringWithSourceMap: function() {\n return { code: this.toString() };\n },\n toString: function() {\n return this.src;\n }\n };\n}\n\nfunction castChunk(chunk, codeGen, loc) {\n if (isArray(chunk)) {\n let ret = [];\n\n for (let i = 0, len = chunk.length; i < len; i++) {\n ret.push(codeGen.wrap(chunk[i], loc));\n }\n return ret;\n } else if (typeof chunk === 'boolean' || typeof chunk === 'number') {\n // Handle primitives that the SourceNode will throw up on\n return chunk + '';\n }\n return chunk;\n}\n\nfunction CodeGen(srcFile) {\n this.srcFile = srcFile;\n this.source = [];\n}\n\nCodeGen.prototype = {\n isEmpty() {\n return !this.source.length;\n },\n prepend: function(source, loc) {\n this.source.unshift(this.wrap(source, loc));\n },\n push: function(source, loc) {\n this.source.push(this.wrap(source, loc));\n },\n\n merge: function() {\n let source = this.empty();\n this.each(function(line) {\n source.add([' ', line, '\\n']);\n });\n return source;\n },\n\n each: function(iter) {\n for (let i = 0, len = this.source.length; i < len; i++) {\n iter(this.source[i]);\n }\n },\n\n empty: function() {\n let loc = this.currentLocation || { start: {} };\n return new SourceNode(loc.start.line, loc.start.column, this.srcFile);\n },\n wrap: function(chunk, loc = this.currentLocation || { start: {} }) {\n if (chunk instanceof SourceNode) {\n return chunk;\n }\n\n chunk = castChunk(chunk, this, loc);\n\n return new SourceNode(\n loc.start.line,\n loc.start.column,\n this.srcFile,\n chunk\n );\n },\n\n functionCall: function(fn, type, params) {\n params = this.generateList(params);\n return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);\n },\n\n quotedString: function(str) {\n return (\n '\"' +\n (str + '')\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\"/g, '\\\\\"')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/\\u2028/g, '\\\\u2028') // Per Ecma-262 7.3 + 7.8.4\n .replace(/\\u2029/g, '\\\\u2029') +\n '\"'\n );\n },\n\n objectLiteral: function(obj) {\n let pairs = [];\n\n Object.keys(obj).forEach(key => {\n let value = castChunk(obj[key], this);\n if (value !== 'undefined') {\n pairs.push([this.quotedString(key), ':', value]);\n }\n });\n\n let ret = this.generateList(pairs);\n ret.prepend('{');\n ret.add('}');\n return ret;\n },\n\n generateList: function(entries) {\n let ret = this.empty();\n\n for (let i = 0, len = entries.length; i < len; i++) {\n if (i) {\n ret.add(',');\n }\n\n ret.add(castChunk(entries[i], this));\n }\n\n return ret;\n },\n\n generateArray: function(entries) {\n let ret = this.generateList(entries);\n ret.prepend('[');\n ret.add(']');\n\n return ret;\n }\n};\n\nexport default CodeGen;\n","import { COMPILER_REVISION, REVISION_CHANGES } from '../base';\nimport Exception from '../exception';\nimport { isArray } from '../utils';\nimport CodeGen from './code-gen';\n\nfunction Literal(value) {\n this.value = value;\n}\n\nfunction JavaScriptCompiler() {}\n\nJavaScriptCompiler.prototype = {\n // PUBLIC API: You can override these methods in a subclass to provide\n // alternative compiled forms for name lookup and buffering semantics\n nameLookup: function(parent, name /*, type */) {\n return this.internalNameLookup(parent, name);\n },\n depthedLookup: function(name) {\n return [\n this.aliasable('container.lookup'),\n '(depths, ',\n JSON.stringify(name),\n ')'\n ];\n },\n\n compilerInfo: function() {\n const revision = COMPILER_REVISION,\n versions = REVISION_CHANGES[revision];\n return [revision, versions];\n },\n\n appendToBuffer: function(source, location, explicit) {\n // Force a source as this simplifies the merge logic.\n if (!isArray(source)) {\n source = [source];\n }\n source = this.source.wrap(source, location);\n\n if (this.environment.isSimple) {\n return ['return ', source, ';'];\n } else if (explicit) {\n // This is a case where the buffer operation occurs as a child of another\n // construct, generally braces. We have to explicitly output these buffer\n // operations to ensure that the emitted code goes in the correct location.\n return ['buffer += ', source, ';'];\n } else {\n source.appendToBuffer = true;\n return source;\n }\n },\n\n initializeBuffer: function() {\n return this.quotedString('');\n },\n // END PUBLIC API\n internalNameLookup: function(parent, name) {\n this.lookupPropertyFunctionIsUsed = true;\n return ['lookupProperty(', parent, ',', JSON.stringify(name), ')'];\n },\n\n lookupPropertyFunctionIsUsed: false,\n\n compile: function(environment, options, context, asObject) {\n this.environment = environment;\n this.options = options;\n this.stringParams = this.options.stringParams;\n this.trackIds = this.options.trackIds;\n this.precompile = !asObject;\n\n this.name = this.environment.name;\n this.isChild = !!context;\n this.context = context || {\n decorators: [],\n programs: [],\n environments: []\n };\n\n this.preamble();\n\n this.stackSlot = 0;\n this.stackVars = [];\n this.aliases = {};\n this.registers = { list: [] };\n this.hashes = [];\n this.compileStack = [];\n this.inlineStack = [];\n this.blockParams = [];\n\n this.compileChildren(environment, options);\n\n this.useDepths =\n this.useDepths ||\n environment.useDepths ||\n environment.useDecorators ||\n this.options.compat;\n this.useBlockParams = this.useBlockParams || environment.useBlockParams;\n\n let opcodes = environment.opcodes,\n opcode,\n firstLoc,\n i,\n l;\n\n for (i = 0, l = opcodes.length; i < l; i++) {\n opcode = opcodes[i];\n\n this.source.currentLocation = opcode.loc;\n firstLoc = firstLoc || opcode.loc;\n this[opcode.opcode].apply(this, opcode.args);\n }\n\n // Flush any trailing content that might be pending.\n this.source.currentLocation = firstLoc;\n this.pushSource('');\n\n /* istanbul ignore next */\n if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {\n throw new Exception('Compile completed with content left on stack');\n }\n\n if (!this.decorators.isEmpty()) {\n this.useDecorators = true;\n\n this.decorators.prepend([\n 'var decorators = container.decorators, ',\n this.lookupPropertyFunctionVarDeclaration(),\n ';\\n'\n ]);\n this.decorators.push('return fn;');\n\n if (asObject) {\n this.decorators = Function.apply(this, [\n 'fn',\n 'props',\n 'container',\n 'depth0',\n 'data',\n 'blockParams',\n 'depths',\n this.decorators.merge()\n ]);\n } else {\n this.decorators.prepend(\n 'function(fn, props, container, depth0, data, blockParams, depths) {\\n'\n );\n this.decorators.push('}\\n');\n this.decorators = this.decorators.merge();\n }\n } else {\n this.decorators = undefined;\n }\n\n let fn = this.createFunctionContext(asObject);\n if (!this.isChild) {\n let ret = {\n compiler: this.compilerInfo(),\n main: fn\n };\n\n if (this.decorators) {\n ret.main_d = this.decorators; // eslint-disable-line camelcase\n ret.useDecorators = true;\n }\n\n let { programs, decorators } = this.context;\n for (i = 0, l = programs.length; i < l; i++) {\n if (programs[i]) {\n ret[i] = programs[i];\n if (decorators[i]) {\n ret[i + '_d'] = decorators[i];\n ret.useDecorators = true;\n }\n }\n }\n\n if (this.environment.usePartial) {\n ret.usePartial = true;\n }\n if (this.options.data) {\n ret.useData = true;\n }\n if (this.useDepths) {\n ret.useDepths = true;\n }\n if (this.useBlockParams) {\n ret.useBlockParams = true;\n }\n if (this.options.compat) {\n ret.compat = true;\n }\n\n if (!asObject) {\n ret.compiler = JSON.stringify(ret.compiler);\n\n this.source.currentLocation = { start: { line: 1, column: 0 } };\n ret = this.objectLiteral(ret);\n\n if (options.srcName) {\n ret = ret.toStringWithSourceMap({ file: options.destName });\n ret.map = ret.map && ret.map.toString();\n } else {\n ret = ret.toString();\n }\n } else {\n ret.compilerOptions = this.options;\n }\n\n return ret;\n } else {\n return fn;\n }\n },\n\n preamble: function() {\n // track the last context pushed into place to allow skipping the\n // getContext opcode when it would be a noop\n this.lastContext = 0;\n this.source = new CodeGen(this.options.srcName);\n this.decorators = new CodeGen(this.options.srcName);\n },\n\n createFunctionContext: function(asObject) {\n let varDeclarations = '';\n\n let locals = this.stackVars.concat(this.registers.list);\n if (locals.length > 0) {\n varDeclarations += ', ' + locals.join(', ');\n }\n\n // Generate minimizer alias mappings\n //\n // When using true SourceNodes, this will update all references to the given alias\n // as the source nodes are reused in situ. For the non-source node compilation mode,\n // aliases will not be used, but this case is already being run on the client and\n // we aren't concern about minimizing the template size.\n let aliasCount = 0;\n Object.keys(this.aliases).forEach(alias => {\n let node = this.aliases[alias];\n if (node.children && node.referenceCount > 1) {\n varDeclarations += ', alias' + ++aliasCount + '=' + alias;\n node.children[0] = 'alias' + aliasCount;\n }\n });\n\n if (this.lookupPropertyFunctionIsUsed) {\n varDeclarations += ', ' + this.lookupPropertyFunctionVarDeclaration();\n }\n\n let params = ['container', 'depth0', 'helpers', 'partials', 'data'];\n\n if (this.useBlockParams || this.useDepths) {\n params.push('blockParams');\n }\n if (this.useDepths) {\n params.push('depths');\n }\n\n // Perform a second pass over the output to merge content when possible\n let source = this.mergeSource(varDeclarations);\n\n if (asObject) {\n params.push(source);\n\n return Function.apply(this, params);\n } else {\n return this.source.wrap([\n 'function(',\n params.join(','),\n ') {\\n ',\n source,\n '}'\n ]);\n }\n },\n mergeSource: function(varDeclarations) {\n let isSimple = this.environment.isSimple,\n appendOnly = !this.forceBuffer,\n appendFirst,\n sourceSeen,\n bufferStart,\n bufferEnd;\n this.source.each(line => {\n if (line.appendToBuffer) {\n if (bufferStart) {\n line.prepend(' + ');\n } else {\n bufferStart = line;\n }\n bufferEnd = line;\n } else {\n if (bufferStart) {\n if (!sourceSeen) {\n appendFirst = true;\n } else {\n bufferStart.prepend('buffer += ');\n }\n bufferEnd.add(';');\n bufferStart = bufferEnd = undefined;\n }\n\n sourceSeen = true;\n if (!isSimple) {\n appendOnly = false;\n }\n }\n });\n\n if (appendOnly) {\n if (bufferStart) {\n bufferStart.prepend('return ');\n bufferEnd.add(';');\n } else if (!sourceSeen) {\n this.source.push('return \"\";');\n }\n } else {\n varDeclarations +=\n ', buffer = ' + (appendFirst ? '' : this.initializeBuffer());\n\n if (bufferStart) {\n bufferStart.prepend('return buffer + ');\n bufferEnd.add(';');\n } else {\n this.source.push('return buffer;');\n }\n }\n\n if (varDeclarations) {\n this.source.prepend(\n 'var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\\n')\n );\n }\n\n return this.source.merge();\n },\n\n lookupPropertyFunctionVarDeclaration: function() {\n return `\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n `.trim();\n },\n\n // [blockValue]\n //\n // On stack, before: hash, inverse, program, value\n // On stack, after: return value of blockHelperMissing\n //\n // The purpose of this opcode is to take a block of the form\n // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and\n // replace it on the stack with the result of properly\n // invoking blockHelperMissing.\n blockValue: function(name) {\n let blockHelperMissing = this.aliasable(\n 'container.hooks.blockHelperMissing'\n ),\n params = [this.contextName(0)];\n this.setupHelperArgs(name, 0, params);\n\n let blockName = this.popStack();\n params.splice(1, 0, blockName);\n\n this.push(this.source.functionCall(blockHelperMissing, 'call', params));\n },\n\n // [ambiguousBlockValue]\n //\n // On stack, before: hash, inverse, program, value\n // Compiler value, before: lastHelper=value of last found helper, if any\n // On stack, after, if no lastHelper: same as [blockValue]\n // On stack, after, if lastHelper: value\n ambiguousBlockValue: function() {\n // We're being a bit cheeky and reusing the options value from the prior exec\n let blockHelperMissing = this.aliasable(\n 'container.hooks.blockHelperMissing'\n ),\n params = [this.contextName(0)];\n this.setupHelperArgs('', 0, params, true);\n\n this.flushInline();\n\n let current = this.topStack();\n params.splice(1, 0, current);\n\n this.pushSource([\n 'if (!',\n this.lastHelper,\n ') { ',\n current,\n ' = ',\n this.source.functionCall(blockHelperMissing, 'call', params),\n '}'\n ]);\n },\n\n // [appendContent]\n //\n // On stack, before: ...\n // On stack, after: ...\n //\n // Appends the string value of `content` to the current buffer\n appendContent: function(content) {\n if (this.pendingContent) {\n content = this.pendingContent + content;\n } else {\n this.pendingLocation = this.source.currentLocation;\n }\n\n this.pendingContent = content;\n },\n\n // [append]\n //\n // On stack, before: value, ...\n // On stack, after: ...\n //\n // Coerces `value` to a String and appends it to the current buffer.\n //\n // If `value` is truthy, or 0, it is coerced into a string and appended\n // Otherwise, the empty string is appended\n append: function() {\n if (this.isInline()) {\n this.replaceStack(current => [' != null ? ', current, ' : \"\"']);\n\n this.pushSource(this.appendToBuffer(this.popStack()));\n } else {\n let local = this.popStack();\n this.pushSource([\n 'if (',\n local,\n ' != null) { ',\n this.appendToBuffer(local, undefined, true),\n ' }'\n ]);\n if (this.environment.isSimple) {\n this.pushSource([\n 'else { ',\n this.appendToBuffer(\"''\", undefined, true),\n ' }'\n ]);\n }\n }\n },\n\n // [appendEscaped]\n //\n // On stack, before: value, ...\n // On stack, after: ...\n //\n // Escape `value` and append it to the buffer\n appendEscaped: function() {\n this.pushSource(\n this.appendToBuffer([\n this.aliasable('container.escapeExpression'),\n '(',\n this.popStack(),\n ')'\n ])\n );\n },\n\n // [getContext]\n //\n // On stack, before: ...\n // On stack, after: ...\n // Compiler value, after: lastContext=depth\n //\n // Set the value of the `lastContext` compiler value to the depth\n getContext: function(depth) {\n this.lastContext = depth;\n },\n\n // [pushContext]\n //\n // On stack, before: ...\n // On stack, after: currentContext, ...\n //\n // Pushes the value of the current context onto the stack.\n pushContext: function() {\n this.pushStackLiteral(this.contextName(this.lastContext));\n },\n\n // [lookupOnContext]\n //\n // On stack, before: ...\n // On stack, after: currentContext[name], ...\n //\n // Looks up the value of `name` on the current context and pushes\n // it onto the stack.\n lookupOnContext: function(parts, falsy, strict, scoped) {\n let i = 0;\n\n if (!scoped && this.options.compat && !this.lastContext) {\n // The depthed query is expected to handle the undefined logic for the root level that\n // is implemented below, so we evaluate that directly in compat mode\n this.push(this.depthedLookup(parts[i++]));\n } else {\n this.pushContext();\n }\n\n this.resolvePath('context', parts, i, falsy, strict);\n },\n\n // [lookupBlockParam]\n //\n // On stack, before: ...\n // On stack, after: blockParam[name], ...\n //\n // Looks up the value of `parts` on the given block param and pushes\n // it onto the stack.\n lookupBlockParam: function(blockParamId, parts) {\n this.useBlockParams = true;\n\n this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);\n this.resolvePath('context', parts, 1);\n },\n\n // [lookupData]\n //\n // On stack, before: ...\n // On stack, after: data, ...\n //\n // Push the data lookup operator\n lookupData: function(depth, parts, strict) {\n if (!depth) {\n this.pushStackLiteral('data');\n } else {\n this.pushStackLiteral('container.data(data, ' + depth + ')');\n }\n\n this.resolvePath('data', parts, 0, true, strict);\n },\n\n resolvePath: function(type, parts, i, falsy, strict) {\n if (this.options.strict || this.options.assumeObjects) {\n this.push(\n strictLookup(this.options.strict && strict, this, parts, i, type)\n );\n return;\n }\n\n let len = parts.length;\n for (; i < len; i++) {\n /* eslint-disable no-loop-func */\n this.replaceStack(current => {\n let lookup = this.nameLookup(current, parts[i], type);\n // We want to ensure that zero and false are handled properly if the context (falsy flag)\n // needs to have the special handling for these values.\n if (!falsy) {\n return [' != null ? ', lookup, ' : ', current];\n } else {\n // Otherwise we can use generic falsy handling\n return [' && ', lookup];\n }\n });\n /* eslint-enable no-loop-func */\n }\n },\n\n // [resolvePossibleLambda]\n //\n // On stack, before: value, ...\n // On stack, after: resolved value, ...\n //\n // If the `value` is a lambda, replace it on the stack by\n // the return value of the lambda\n resolvePossibleLambda: function() {\n this.push([\n this.aliasable('container.lambda'),\n '(',\n this.popStack(),\n ', ',\n this.contextName(0),\n ')'\n ]);\n },\n\n // [pushStringParam]\n //\n // On stack, before: ...\n // On stack, after: string, currentContext, ...\n //\n // This opcode is designed for use in string mode, which\n // provides the string value of a parameter along with its\n // depth rather than resolving it immediately.\n pushStringParam: function(string, type) {\n this.pushContext();\n this.pushString(type);\n\n // If it's a subexpression, the string result\n // will be pushed after this opcode.\n if (type !== 'SubExpression') {\n if (typeof string === 'string') {\n this.pushString(string);\n } else {\n this.pushStackLiteral(string);\n }\n }\n },\n\n emptyHash: function(omitEmpty) {\n if (this.trackIds) {\n this.push('{}'); // hashIds\n }\n if (this.stringParams) {\n this.push('{}'); // hashContexts\n this.push('{}'); // hashTypes\n }\n this.pushStackLiteral(omitEmpty ? 'undefined' : '{}');\n },\n pushHash: function() {\n if (this.hash) {\n this.hashes.push(this.hash);\n }\n this.hash = { values: {}, types: [], contexts: [], ids: [] };\n },\n popHash: function() {\n let hash = this.hash;\n this.hash = this.hashes.pop();\n\n if (this.trackIds) {\n this.push(this.objectLiteral(hash.ids));\n }\n if (this.stringParams) {\n this.push(this.objectLiteral(hash.contexts));\n this.push(this.objectLiteral(hash.types));\n }\n\n this.push(this.objectLiteral(hash.values));\n },\n\n // [pushString]\n //\n // On stack, before: ...\n // On stack, after: quotedString(string), ...\n //\n // Push a quoted version of `string` onto the stack\n pushString: function(string) {\n this.pushStackLiteral(this.quotedString(string));\n },\n\n // [pushLiteral]\n //\n // On stack, before: ...\n // On stack, after: value, ...\n //\n // Pushes a value onto the stack. This operation prevents\n // the compiler from creating a temporary variable to hold\n // it.\n pushLiteral: function(value) {\n this.pushStackLiteral(value);\n },\n\n // [pushProgram]\n //\n // On stack, before: ...\n // On stack, after: program(guid), ...\n //\n // Push a program expression onto the stack. This takes\n // a compile-time guid and converts it into a runtime-accessible\n // expression.\n pushProgram: function(guid) {\n if (guid != null) {\n this.pushStackLiteral(this.programExpression(guid));\n } else {\n this.pushStackLiteral(null);\n }\n },\n\n // [registerDecorator]\n //\n // On stack, before: hash, program, params..., ...\n // On stack, after: ...\n //\n // Pops off the decorator's parameters, invokes the decorator,\n // and inserts the decorator into the decorators list.\n registerDecorator(paramSize, name) {\n let foundDecorator = this.nameLookup('decorators', name, 'decorator'),\n options = this.setupHelperArgs(name, paramSize);\n\n this.decorators.push([\n 'fn = ',\n this.decorators.functionCall(foundDecorator, '', [\n 'fn',\n 'props',\n 'container',\n options\n ]),\n ' || fn;'\n ]);\n },\n\n // [invokeHelper]\n //\n // On stack, before: hash, inverse, program, params..., ...\n // On stack, after: result of helper invocation\n //\n // Pops off the helper's parameters, invokes the helper,\n // and pushes the helper's return value onto the stack.\n //\n // If the helper is not found, `helperMissing` is called.\n invokeHelper: function(paramSize, name, isSimple) {\n let nonHelper = this.popStack(),\n helper = this.setupHelper(paramSize, name);\n\n let possibleFunctionCalls = [];\n\n if (isSimple) {\n // direct call to helper\n possibleFunctionCalls.push(helper.name);\n }\n // call a function from the input object\n possibleFunctionCalls.push(nonHelper);\n if (!this.options.strict) {\n possibleFunctionCalls.push(\n this.aliasable('container.hooks.helperMissing')\n );\n }\n\n let functionLookupCode = [\n '(',\n this.itemsSeparatedBy(possibleFunctionCalls, '||'),\n ')'\n ];\n let functionCall = this.source.functionCall(\n functionLookupCode,\n 'call',\n helper.callParams\n );\n this.push(functionCall);\n },\n\n itemsSeparatedBy: function(items, separator) {\n let result = [];\n result.push(items[0]);\n for (let i = 1; i < items.length; i++) {\n result.push(separator, items[i]);\n }\n return result;\n },\n // [invokeKnownHelper]\n //\n // On stack, before: hash, inverse, program, params..., ...\n // On stack, after: result of helper invocation\n //\n // This operation is used when the helper is known to exist,\n // so a `helperMissing` fallback is not required.\n invokeKnownHelper: function(paramSize, name) {\n let helper = this.setupHelper(paramSize, name);\n this.push(this.source.functionCall(helper.name, 'call', helper.callParams));\n },\n\n // [invokeAmbiguous]\n //\n // On stack, before: hash, inverse, program, params..., ...\n // On stack, after: result of disambiguation\n //\n // This operation is used when an expression like `{{foo}}`\n // is provided, but we don't know at compile-time whether it\n // is a helper or a path.\n //\n // This operation emits more code than the other options,\n // and can be avoided by passing the `knownHelpers` and\n // `knownHelpersOnly` flags at compile-time.\n invokeAmbiguous: function(name, helperCall) {\n this.useRegister('helper');\n\n let nonHelper = this.popStack();\n\n this.emptyHash();\n let helper = this.setupHelper(0, name, helperCall);\n\n let helperName = (this.lastHelper = this.nameLookup(\n 'helpers',\n name,\n 'helper'\n ));\n\n let lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')'];\n if (!this.options.strict) {\n lookup[0] = '(helper = ';\n lookup.push(\n ' != null ? helper : ',\n this.aliasable('container.hooks.helperMissing')\n );\n }\n\n this.push([\n '(',\n lookup,\n helper.paramsInit ? ['),(', helper.paramsInit] : [],\n '),',\n '(typeof helper === ',\n this.aliasable('\"function\"'),\n ' ? ',\n this.source.functionCall('helper', 'call', helper.callParams),\n ' : helper))'\n ]);\n },\n\n // [invokePartial]\n //\n // On stack, before: context, ...\n // On stack after: result of partial invocation\n //\n // This operation pops off a context, invokes a partial with that context,\n // and pushes the result of the invocation back.\n invokePartial: function(isDynamic, name, indent) {\n let params = [],\n options = this.setupParams(name, 1, params);\n\n if (isDynamic) {\n name = this.popStack();\n delete options.name;\n }\n\n if (indent) {\n options.indent = JSON.stringify(indent);\n }\n options.helpers = 'helpers';\n options.partials = 'partials';\n options.decorators = 'container.decorators';\n\n if (!isDynamic) {\n params.unshift(this.nameLookup('partials', name, 'partial'));\n } else {\n params.unshift(name);\n }\n\n if (this.options.compat) {\n options.depths = 'depths';\n }\n options = this.objectLiteral(options);\n params.push(options);\n\n this.push(this.source.functionCall('container.invokePartial', '', params));\n },\n\n // [assignToHash]\n //\n // On stack, before: value, ..., hash, ...\n // On stack, after: ..., hash, ...\n //\n // Pops a value off the stack and assigns it to the current hash\n assignToHash: function(key) {\n let value = this.popStack(),\n context,\n type,\n id;\n\n if (this.trackIds) {\n id = this.popStack();\n }\n if (this.stringParams) {\n type = this.popStack();\n context = this.popStack();\n }\n\n let hash = this.hash;\n if (context) {\n hash.contexts[key] = context;\n }\n if (type) {\n hash.types[key] = type;\n }\n if (id) {\n hash.ids[key] = id;\n }\n hash.values[key] = value;\n },\n\n pushId: function(type, name, child) {\n if (type === 'BlockParam') {\n this.pushStackLiteral(\n 'blockParams[' +\n name[0] +\n '].path[' +\n name[1] +\n ']' +\n (child ? ' + ' + JSON.stringify('.' + child) : '')\n );\n } else if (type === 'PathExpression') {\n this.pushString(name);\n } else if (type === 'SubExpression') {\n this.pushStackLiteral('true');\n } else {\n this.pushStackLiteral('null');\n }\n },\n\n // HELPERS\n\n compiler: JavaScriptCompiler,\n\n compileChildren: function(environment, options) {\n let children = environment.children,\n child,\n compiler;\n\n for (let i = 0, l = children.length; i < l; i++) {\n child = children[i];\n compiler = new this.compiler(); // eslint-disable-line new-cap\n\n let existing = this.matchExistingProgram(child);\n\n if (existing == null) {\n this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children\n let index = this.context.programs.length;\n child.index = index;\n child.name = 'program' + index;\n this.context.programs[index] = compiler.compile(\n child,\n options,\n this.context,\n !this.precompile\n );\n this.context.decorators[index] = compiler.decorators;\n this.context.environments[index] = child;\n\n this.useDepths = this.useDepths || compiler.useDepths;\n this.useBlockParams = this.useBlockParams || compiler.useBlockParams;\n child.useDepths = this.useDepths;\n child.useBlockParams = this.useBlockParams;\n } else {\n child.index = existing.index;\n child.name = 'program' + existing.index;\n\n this.useDepths = this.useDepths || existing.useDepths;\n this.useBlockParams = this.useBlockParams || existing.useBlockParams;\n }\n }\n },\n matchExistingProgram: function(child) {\n for (let i = 0, len = this.context.environments.length; i < len; i++) {\n let environment = this.context.environments[i];\n if (environment && environment.equals(child)) {\n return environment;\n }\n }\n },\n\n programExpression: function(guid) {\n let child = this.environment.children[guid],\n programParams = [child.index, 'data', child.blockParams];\n\n if (this.useBlockParams || this.useDepths) {\n programParams.push('blockParams');\n }\n if (this.useDepths) {\n programParams.push('depths');\n }\n\n return 'container.program(' + programParams.join(', ') + ')';\n },\n\n useRegister: function(name) {\n if (!this.registers[name]) {\n this.registers[name] = true;\n this.registers.list.push(name);\n }\n },\n\n push: function(expr) {\n if (!(expr instanceof Literal)) {\n expr = this.source.wrap(expr);\n }\n\n this.inlineStack.push(expr);\n return expr;\n },\n\n pushStackLiteral: function(item) {\n this.push(new Literal(item));\n },\n\n pushSource: function(source) {\n if (this.pendingContent) {\n this.source.push(\n this.appendToBuffer(\n this.source.quotedString(this.pendingContent),\n this.pendingLocation\n )\n );\n this.pendingContent = undefined;\n }\n\n if (source) {\n this.source.push(source);\n }\n },\n\n replaceStack: function(callback) {\n let prefix = ['('],\n stack,\n createdStack,\n usedLiteral;\n\n /* istanbul ignore next */\n if (!this.isInline()) {\n throw new Exception('replaceStack on non-inline');\n }\n\n // We want to merge the inline statement into the replacement statement via ','\n let top = this.popStack(true);\n\n if (top instanceof Literal) {\n // Literals do not need to be inlined\n stack = [top.value];\n prefix = ['(', stack];\n usedLiteral = true;\n } else {\n // Get or create the current stack name for use by the inline\n createdStack = true;\n let name = this.incrStack();\n\n prefix = ['((', this.push(name), ' = ', top, ')'];\n stack = this.topStack();\n }\n\n let item = callback.call(this, stack);\n\n if (!usedLiteral) {\n this.popStack();\n }\n if (createdStack) {\n this.stackSlot--;\n }\n this.push(prefix.concat(item, ')'));\n },\n\n incrStack: function() {\n this.stackSlot++;\n if (this.stackSlot > this.stackVars.length) {\n this.stackVars.push('stack' + this.stackSlot);\n }\n return this.topStackName();\n },\n topStackName: function() {\n return 'stack' + this.stackSlot;\n },\n flushInline: function() {\n let inlineStack = this.inlineStack;\n this.inlineStack = [];\n for (let i = 0, len = inlineStack.length; i < len; i++) {\n let entry = inlineStack[i];\n /* istanbul ignore if */\n if (entry instanceof Literal) {\n this.compileStack.push(entry);\n } else {\n let stack = this.incrStack();\n this.pushSource([stack, ' = ', entry, ';']);\n this.compileStack.push(stack);\n }\n }\n },\n isInline: function() {\n return this.inlineStack.length;\n },\n\n popStack: function(wrapped) {\n let inline = this.isInline(),\n item = (inline ? this.inlineStack : this.compileStack).pop();\n\n if (!wrapped && item instanceof Literal) {\n return item.value;\n } else {\n if (!inline) {\n /* istanbul ignore next */\n if (!this.stackSlot) {\n throw new Exception('Invalid stack pop');\n }\n this.stackSlot--;\n }\n return item;\n }\n },\n\n topStack: function() {\n let stack = this.isInline() ? this.inlineStack : this.compileStack,\n item = stack[stack.length - 1];\n\n /* istanbul ignore if */\n if (item instanceof Literal) {\n return item.value;\n } else {\n return item;\n }\n },\n\n contextName: function(context) {\n if (this.useDepths && context) {\n return 'depths[' + context + ']';\n } else {\n return 'depth' + context;\n }\n },\n\n quotedString: function(str) {\n return this.source.quotedString(str);\n },\n\n objectLiteral: function(obj) {\n return this.source.objectLiteral(obj);\n },\n\n aliasable: function(name) {\n let ret = this.aliases[name];\n if (ret) {\n ret.referenceCount++;\n return ret;\n }\n\n ret = this.aliases[name] = this.source.wrap(name);\n ret.aliasable = true;\n ret.referenceCount = 1;\n\n return ret;\n },\n\n setupHelper: function(paramSize, name, blockHelper) {\n let params = [],\n paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);\n let foundHelper = this.nameLookup('helpers', name, 'helper'),\n callContext = this.aliasable(\n `${this.contextName(0)} != null ? ${this.contextName(\n 0\n )} : (container.nullContext || {})`\n );\n\n return {\n params: params,\n paramsInit: paramsInit,\n name: foundHelper,\n callParams: [callContext].concat(params)\n };\n },\n\n setupParams: function(helper, paramSize, params) {\n let options = {},\n contexts = [],\n types = [],\n ids = [],\n objectArgs = !params,\n param;\n\n if (objectArgs) {\n params = [];\n }\n\n options.name = this.quotedString(helper);\n options.hash = this.popStack();\n\n if (this.trackIds) {\n options.hashIds = this.popStack();\n }\n if (this.stringParams) {\n options.hashTypes = this.popStack();\n options.hashContexts = this.popStack();\n }\n\n let inverse = this.popStack(),\n program = this.popStack();\n\n // Avoid setting fn and inverse if neither are set. This allows\n // helpers to do a check for `if (options.fn)`\n if (program || inverse) {\n options.fn = program || 'container.noop';\n options.inverse = inverse || 'container.noop';\n }\n\n // The parameters go on to the stack in order (making sure that they are evaluated in order)\n // so we need to pop them off the stack in reverse order\n let i = paramSize;\n while (i--) {\n param = this.popStack();\n params[i] = param;\n\n if (this.trackIds) {\n ids[i] = this.popStack();\n }\n if (this.stringParams) {\n types[i] = this.popStack();\n contexts[i] = this.popStack();\n }\n }\n\n if (objectArgs) {\n options.args = this.source.generateArray(params);\n }\n\n if (this.trackIds) {\n options.ids = this.source.generateArray(ids);\n }\n if (this.stringParams) {\n options.types = this.source.generateArray(types);\n options.contexts = this.source.generateArray(contexts);\n }\n\n if (this.options.data) {\n options.data = 'data';\n }\n if (this.useBlockParams) {\n options.blockParams = 'blockParams';\n }\n return options;\n },\n\n setupHelperArgs: function(helper, paramSize, params, useRegister) {\n let options = this.setupParams(helper, paramSize, params);\n options.loc = JSON.stringify(this.source.currentLocation);\n options = this.objectLiteral(options);\n if (useRegister) {\n this.useRegister('options');\n params.push('options');\n return ['options=', options];\n } else if (params) {\n params.push(options);\n return '';\n } else {\n return options;\n }\n }\n};\n\n(function() {\n const reservedWords = (\n 'break else new var' +\n ' case finally return void' +\n ' catch for switch while' +\n ' continue function this with' +\n ' default if throw' +\n ' delete in try' +\n ' do instanceof typeof' +\n ' abstract enum int short' +\n ' boolean export interface static' +\n ' byte extends long super' +\n ' char final native synchronized' +\n ' class float package throws' +\n ' const goto private transient' +\n ' debugger implements protected volatile' +\n ' double import public let yield await' +\n ' null true false'\n ).split(' ');\n\n const compilerWords = (JavaScriptCompiler.RESERVED_WORDS = {});\n\n for (let i = 0, l = reservedWords.length; i < l; i++) {\n compilerWords[reservedWords[i]] = true;\n }\n})();\n\n/**\n * @deprecated May be removed in the next major version\n */\nJavaScriptCompiler.isValidJavaScriptVariableName = function(name) {\n return (\n !JavaScriptCompiler.RESERVED_WORDS[name] &&\n /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name)\n );\n};\n\nfunction strictLookup(requireTerminal, compiler, parts, i, type) {\n let stack = compiler.popStack(),\n len = parts.length;\n if (requireTerminal) {\n len--;\n }\n\n for (; i < len; i++) {\n stack = compiler.nameLookup(stack, parts[i], type);\n }\n\n if (requireTerminal) {\n return [\n compiler.aliasable('container.strict'),\n '(',\n stack,\n ', ',\n compiler.quotedString(parts[i]),\n ', ',\n JSON.stringify(compiler.source.currentLocation),\n ' )'\n ];\n } else {\n return stack;\n }\n}\n\nexport default JavaScriptCompiler;\n","import runtime from './handlebars.runtime';\n\n// Compiler imports\nimport AST from './handlebars/compiler/ast';\nimport {\n parser as Parser,\n parse,\n parseWithoutProcessing\n} from './handlebars/compiler/base';\nimport { Compiler, compile, precompile } from './handlebars/compiler/compiler';\nimport JavaScriptCompiler from './handlebars/compiler/javascript-compiler';\nimport Visitor from './handlebars/compiler/visitor';\n\nimport noConflict from './handlebars/no-conflict';\n\nlet _create = runtime.create;\nfunction create() {\n let hb = _create();\n\n hb.compile = function(input, options) {\n return compile(input, options, hb);\n };\n hb.precompile = function(input, options) {\n return precompile(input, options, hb);\n };\n\n hb.AST = AST;\n hb.Compiler = Compiler;\n hb.JavaScriptCompiler = JavaScriptCompiler;\n hb.Parser = Parser;\n hb.parse = parse;\n hb.parseWithoutProcessing = parseWithoutProcessing;\n\n return hb;\n}\n\nlet inst = create();\ninst.create = create;\n\nnoConflict(inst);\n\ninst.Visitor = Visitor;\n\ninst['default'] = inst;\n\nexport default inst;\n","/* eslint-disable new-cap */\nimport Visitor from './visitor';\n\nexport function print(ast) {\n return new PrintVisitor().accept(ast);\n}\n\nexport function PrintVisitor() {\n this.padding = 0;\n}\n\nPrintVisitor.prototype = new Visitor();\n\nPrintVisitor.prototype.pad = function(string) {\n let out = '';\n\n for (let i = 0, l = this.padding; i < l; i++) {\n out += ' ';\n }\n\n out += string + '\\n';\n return out;\n};\n\nPrintVisitor.prototype.Program = function(program) {\n let out = '',\n body = program.body,\n i,\n l;\n\n if (program.blockParams) {\n let blockParams = 'BLOCK PARAMS: [';\n for (i = 0, l = program.blockParams.length; i < l; i++) {\n blockParams += ' ' + program.blockParams[i];\n }\n blockParams += ' ]';\n out += this.pad(blockParams);\n }\n\n for (i = 0, l = body.length; i < l; i++) {\n out += this.accept(body[i]);\n }\n\n this.padding--;\n\n return out;\n};\n\nPrintVisitor.prototype.MustacheStatement = function(mustache) {\n return this.pad('{{ ' + this.SubExpression(mustache) + ' }}');\n};\nPrintVisitor.prototype.Decorator = function(mustache) {\n return this.pad('{{ DIRECTIVE ' + this.SubExpression(mustache) + ' }}');\n};\n\nPrintVisitor.prototype.BlockStatement = PrintVisitor.prototype.DecoratorBlock = function(\n block\n) {\n let out = '';\n\n out += this.pad(\n (block.type === 'DecoratorBlock' ? 'DIRECTIVE ' : '') + 'BLOCK:'\n );\n this.padding++;\n out += this.pad(this.SubExpression(block));\n if (block.program) {\n out += this.pad('PROGRAM:');\n this.padding++;\n out += this.accept(block.program);\n this.padding--;\n }\n if (block.inverse) {\n if (block.program) {\n this.padding++;\n }\n out += this.pad('{{^}}');\n this.padding++;\n out += this.accept(block.inverse);\n this.padding--;\n if (block.program) {\n this.padding--;\n }\n }\n this.padding--;\n\n return out;\n};\n\nPrintVisitor.prototype.PartialStatement = function(partial) {\n let content = 'PARTIAL:' + partial.name.original;\n if (partial.params[0]) {\n content += ' ' + this.accept(partial.params[0]);\n }\n if (partial.hash) {\n content += ' ' + this.accept(partial.hash);\n }\n return this.pad('{{> ' + content + ' }}');\n};\nPrintVisitor.prototype.PartialBlockStatement = function(partial) {\n let content = 'PARTIAL BLOCK:' + partial.name.original;\n if (partial.params[0]) {\n content += ' ' + this.accept(partial.params[0]);\n }\n if (partial.hash) {\n content += ' ' + this.accept(partial.hash);\n }\n\n content += ' ' + this.pad('PROGRAM:');\n this.padding++;\n content += this.accept(partial.program);\n this.padding--;\n\n return this.pad('{{> ' + content + ' }}');\n};\n\nPrintVisitor.prototype.ContentStatement = function(content) {\n return this.pad(\"CONTENT[ '\" + content.value + \"' ]\");\n};\n\nPrintVisitor.prototype.CommentStatement = function(comment) {\n return this.pad(\"{{! '\" + comment.value + \"' }}\");\n};\n\nPrintVisitor.prototype.SubExpression = function(sexpr) {\n let params = sexpr.params,\n paramStrings = [],\n hash;\n\n for (let i = 0, l = params.length; i < l; i++) {\n paramStrings.push(this.accept(params[i]));\n }\n\n params = '[' + paramStrings.join(', ') + ']';\n\n hash = sexpr.hash ? ' ' + this.accept(sexpr.hash) : '';\n\n return this.accept(sexpr.path) + ' ' + params + hash;\n};\n\nPrintVisitor.prototype.PathExpression = function(id) {\n let path = id.parts.join('/');\n return (id.data ? '@' : '') + 'PATH:' + path;\n};\n\nPrintVisitor.prototype.StringLiteral = function(string) {\n return '\"' + string.value + '\"';\n};\n\nPrintVisitor.prototype.NumberLiteral = function(number) {\n return 'NUMBER{' + number.value + '}';\n};\n\nPrintVisitor.prototype.BooleanLiteral = function(bool) {\n return 'BOOLEAN{' + bool.value + '}';\n};\n\nPrintVisitor.prototype.UndefinedLiteral = function() {\n return 'UNDEFINED';\n};\n\nPrintVisitor.prototype.NullLiteral = function() {\n return 'NULL';\n};\n\nPrintVisitor.prototype.Hash = function(hash) {\n let pairs = hash.pairs,\n joinedPairs = [];\n\n for (let i = 0, l = pairs.length; i < l; i++) {\n joinedPairs.push(this.accept(pairs[i]));\n }\n\n return 'HASH{' + joinedPairs.join(', ') + '}';\n};\nPrintVisitor.prototype.HashPair = function(pair) {\n return pair.key + '=' + this.accept(pair.value);\n};\n/* eslint-enable new-cap */\n","// USAGE:\n// var handlebars = require('handlebars');\n/* eslint-env node */\n/* eslint-disable no-var */\n\n// var local = handlebars.create();\n\nvar handlebars = require('../dist/cjs/handlebars')['default'];\n\nvar printer = require('../dist/cjs/handlebars/compiler/printer');\nhandlebars.PrintVisitor = printer.PrintVisitor;\nhandlebars.print = printer.print;\n\nmodule.exports = handlebars;\n\n// Publish a Node.js require() handler for .handlebars and .hbs files\nfunction extension(module, filename) {\n var fs = require('fs');\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars.compile(templateString);\n}\n/* istanbul ignore else */\nif (typeof require !== 'undefined' && require.extensions) {\n require.extensions['.handlebars'] = extension;\n require.extensions['.hbs'] = extension;\n}\n","import Handlebars from 'handlebars';\n\n/**\n * Create a custom Handlebars environment that doesn't escape HTML entities.\n * Since prompt templates are intended for AI models (plain text) rather than HTML,\n * we disable HTML escaping to prevent characters like quotes and brackets\n * from being converted to HTML entities (e.g., ' -> ').\n */\nconst handlebarsNoEscape = Handlebars.create();\nhandlebarsNoEscape.Utils.escapeExpression = (str: any) => String(str);\n\n/**\n * Parses a Handlebars template with the provided context.\n *\n * Uses a custom Handlebars instance that disables HTML escaping, since the\n * output is intended for AI models (plain text) rather than HTML.\n *\n * @param prompt The Handlebars template string.\n * @param options An object containing the context.\n * @returns The rendered string.\n * @example\n * ```\n * const prompt = '{{#if isLoggedIn}}Hello, {{name}}!{{/if}}';\n * const context = {\n * isLoggedIn: true,\n * name: 'World'\n * };\n * const result = await handlebarsParse(prompt, { context });\n * console.log(result); // \"Hello, World!\" (if isLoggedIn is true)\n * ```\n */\nexport const handlebarsParse = async (\n prompt: string,\n { context }: { context: Record<string, any> },\n) => {\n const template = handlebarsNoEscape.compile(prompt);\n const result = template(context);\n return result ?? '';\n};\n","/**\n * Instrumentation\n */\n\nexport * from './otel/initAxiomAI';\nexport * from './otel/vercel';\nexport * from './otel/withSpan';\nimport { onlineEval as _onlineEval } from './online-evals/onlineEval';\nimport { warnOnlineEvalDeprecation } from './evals/deprecated';\n\n/** @deprecated Import from 'axiom/ai/evals/online' instead. */\nexport const onlineEval: typeof _onlineEval = (...args) => {\n warnOnlineEvalDeprecation();\n return _onlineEval(...args);\n};\n\nimport { createScorer } from './evals/scorer.factory';\nimport { warnScorerDeprecation } from './evals/deprecated';\n\n/** @deprecated Import from 'axiom/ai/evals/scorers' instead. */\nexport const Scorer = ((...args: unknown[]) => {\n warnScorerDeprecation('axiom/ai');\n return (createScorer as Function)(...args);\n}) as typeof createScorer;\n\n/** @deprecated Import from 'axiom/ai/evals/scorers' instead. */\nexport type { Score } from './evals/scorer.types';\n/** @deprecated Import from 'axiom/ai/evals/scorers' instead. */\nexport type { Scorer as ScorerType } from './evals/scorer.types';\n\nexport * from './otel/wrapTool';\nexport * from './otel/middleware';\nexport { type AxiomAIRedactionPolicy, RedactionPolicy } from './otel/utils/redaction';\n\n/**\n * App Scope\n */\n\nexport { createAppScope } from './app-scope';\n\n/**\n * Prompts\n */\n\n// Prompt and template functionality - marked as UNSAFE as these APIs are experimental\nexport type { Prompt as experimental_Prompt } from './types';\n\nexport { Type as experimental_Type } from './template';\nexport type {\n TSchema as experimental_TSchema,\n InferSchema as experimental_InferSchema,\n InferContext as experimental_InferContext,\n} from './template';\n\nexport { parse as experimental_parse, Template as experimental_Template } from './prompt';\n\nexport type {\n AxiomPromptMetadata as experimental_AxiomPromptMetadata,\n ParsedMessage as experimental_ParsedMessage,\n ParsedMessagesArray as experimental_ParsedMessagesArray,\n} from './types/metadata';\n","import type { Tracer } from '@opentelemetry/api';\nimport { trace } from '@opentelemetry/api';\nimport packageJson from '../../package.json';\nimport { AXIOM_AI_REDACTION_KEY, type AxiomAIRedactionPolicy } from './utils/redaction';\n\n// Global key to store tracer scope information across all execution contexts\nconst AXIOM_AI_SCOPE_KEY = Symbol.for('__axiom_ai_scope__');\n\ninterface TracerScope {\n name: string;\n version?: string;\n}\n\n/**\n * Extract scope information from a tracer, with fallback to package.json\n */\nfunction extractTracerScope(tracer: Tracer): TracerScope {\n const tracerAny = tracer as any;\n\n // Guard access to private fields with optional chaining\n // Note: These are internal OTEL fields that may change in future versions\n // _instrumentationScope is modern, instrumentationLibrary is legacy (<1.16)\n const name =\n tracerAny._instrumentationScope?.name ||\n tracerAny.instrumentationLibrary?.name ||\n packageJson.name;\n\n const version =\n tracerAny._instrumentationScope?.version ||\n tracerAny.instrumentationLibrary?.version ||\n packageJson.version;\n\n return { name, version };\n}\n\n/**\n * Register this in your `instrumentation.ts` to set up axiom.\n * This function stores the tracer's scope information globally to enable Context Propagation\n * and Instrumentation Scope. The tracer will be available across all execution contexts including Next.js.\n *\n * This function is idempotent - calling it multiple times with the same scope has no additional cost.\n *\n * @param config\n * @param config.tracer - The tracer that you are using in your application.\n * @param config.redactionPolicy - Optional redaction policy to control what data is captured in spans.\n */\nexport function initAxiomAI(config: { tracer: Tracer; redactionPolicy?: AxiomAIRedactionPolicy }) {\n const newScope = extractTracerScope(config.tracer);\n const existingScope = (globalThis as any)[AXIOM_AI_SCOPE_KEY] as TracerScope | undefined;\n\n // Check if already initialized with same scope (idempotent behavior)\n if (\n existingScope &&\n existingScope.name === newScope.name &&\n existingScope.version === newScope.version\n ) {\n return;\n }\n\n // Warn about double initialization with different scopes\n if (existingScope) {\n console.warn(\n '[AxiomAI] initAxiomAI() called multiple times with different scopes. ' +\n `Previous: ${existingScope.name}@${existingScope.version}, ` +\n `New: ${newScope.name}@${newScope.version}`,\n );\n }\n\n // Store scope information globally (works across Next.js contexts)\n (globalThis as any)[AXIOM_AI_SCOPE_KEY] = newScope;\n\n // Store redaction policy globally if provided\n if (config.redactionPolicy) {\n (globalThis as any)[AXIOM_AI_REDACTION_KEY] = config.redactionPolicy;\n }\n}\n\n/**\n * Get a tracer using the globally stored scope information\n * Fall back to package.json defaults if not set\n */\nexport function getGlobalTracer(): Tracer {\n // Get stored scope information or fall back to package defaults\n const scope = (globalThis as any)[AXIOM_AI_SCOPE_KEY] as TracerScope | undefined;\n\n // Warn if initAxiomAI was never called\n if (!scope) {\n const isDebug = process.env.AXIOM_DEBUG === 'true';\n if (!isDebug) {\n console.warn(\n '[AxiomAI] AXIOM_AI_SCOPE_KEY is undefined. This probably means that ' +\n 'initAxiomAI() was never called. ' +\n 'Make sure to call initAxiomAI({ tracer }) in your instrumentation setup.',\n );\n }\n }\n\n let { name, version } = scope || { name: packageJson.name, version: packageJson.version };\n\n if (!name || !version) {\n name = packageJson.name;\n version = packageJson.version;\n if (!name || !version) {\n name = 'axiom';\n version = 'unknown';\n }\n }\n\n // Use OpenTelemetry's standard global provider mechanism\n return trace.getTracer(name, version);\n}\n\n/**\n * Reset AxiomAI configuration (useful for testing)\n */\nexport function resetAxiomAI() {\n (globalThis as any)[AXIOM_AI_SCOPE_KEY] = undefined;\n (globalThis as any)[AXIOM_AI_REDACTION_KEY] = undefined;\n}\n","{\n \"name\": \"axiom\",\n \"version\": \"0.45.0\",\n \"type\": \"module\",\n \"author\": \"Axiom, Inc.\",\n \"contributors\": [\n \"Islam Shehata <islam@axiom.co>\",\n \"Chris Ehrlich <chris@axiom.co>\",\n \"Gabriel de Andrade <gabriel@axiom.co>\"\n ],\n \"scripts\": {\n \"dev\": \"tsup --watch\",\n \"build\": \"tsup && chmod +x dist/bin.js && pnpm check:vitest-entrypoints\",\n \"check:vitest-entrypoints\": \"node ./scripts/check-vitest-entrypoints.mjs\",\n \"format\": \"prettier --write .\",\n \"format:check\": \"prettier --check .\",\n \"lint\": \"eslint './**/*.{js,ts}'\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run\",\n \"test:watch\": \"vitest --watch\",\n \"publint\": \"npx publint\"\n },\n \"types\": \"./dist/index.d.ts\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"bin\": {\n \"axiom\": \"./dist/bin.js\"\n },\n \"exports\": {\n \"./ai\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"default\": \"./dist/index.cjs\"\n }\n },\n \"./ai/evals\": {\n \"import\": {\n \"types\": \"./dist/evals.d.ts\",\n \"default\": \"./dist/evals.js\"\n },\n \"require\": {\n \"types\": \"./dist/evals.d.cts\",\n \"default\": \"./dist/evals.cjs\"\n }\n },\n \"./ai/evals/aggregations\": {\n \"import\": {\n \"types\": \"./dist/evals/aggregations.d.ts\",\n \"default\": \"./dist/evals/aggregations.js\"\n },\n \"require\": {\n \"types\": \"./dist/evals/aggregations.d.cts\",\n \"default\": \"./dist/evals/aggregations.cjs\"\n }\n },\n \"./ai/evals/scorers\": {\n \"import\": {\n \"types\": \"./dist/evals/scorers.d.ts\",\n \"default\": \"./dist/evals/scorers.js\"\n },\n \"require\": {\n \"types\": \"./dist/evals/scorers.d.cts\",\n \"default\": \"./dist/evals/scorers.cjs\"\n }\n },\n \"./ai/evals/online\": {\n \"import\": {\n \"types\": \"./dist/evals/online.d.ts\",\n \"default\": \"./dist/evals/online.js\"\n },\n \"require\": {\n \"types\": \"./dist/evals/online.d.cts\",\n \"default\": \"./dist/evals/online.cjs\"\n }\n },\n \"./ai/config\": {\n \"import\": {\n \"types\": \"./dist/config.d.ts\",\n \"default\": \"./dist/config.js\"\n },\n \"require\": {\n \"types\": \"./dist/config.d.cts\",\n \"default\": \"./dist/config.cjs\"\n }\n },\n \"./ai/feedback\": {\n \"import\": {\n \"types\": \"./dist/feedback.d.ts\",\n \"default\": \"./dist/feedback.js\"\n },\n \"require\": {\n \"types\": \"./dist/feedback.d.cts\",\n \"default\": \"./dist/feedback.cjs\"\n }\n }\n },\n \"keywords\": [\n \"axiom\",\n \"logging\",\n \"ai\",\n \"otel\",\n \"opentelemetry\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/axiomhq/ai.git\",\n \"directory\": \"packages/ai\"\n },\n \"license\": \"MIT\",\n \"dependencies\": {\n \"@next/env\": \"^15.4.2\",\n \"@opentelemetry/auto-instrumentations-node\": \"^0.60.1\",\n \"@opentelemetry/context-async-hooks\": \"^2.0.1\",\n \"@opentelemetry/exporter-trace-otlp-http\": \"^0.202.0\",\n \"@opentelemetry/resources\": \"^2.0.1\",\n \"@opentelemetry/sdk-trace-node\": \"^2.0.1\",\n \"@opentelemetry/semantic-conventions\": \"^1.38.0\",\n \"@sinclair/typebox\": \"^0.34.37\",\n \"c12\": \"^3.3.3\",\n \"commander\": \"^14.0.0\",\n \"defu\": \"^6.1.4\",\n \"handlebars\": \"^4.7.8\",\n \"nanoid\": \"^5.1.5\",\n \"open\": \"^10.1.0\",\n \"vite-tsconfig-paths\": \"^5.1.4\",\n \"vitest\": \"^4.0.0\"\n },\n \"peerDependencies\": {\n \"@opentelemetry/api\": \"^1.9.0\",\n \"zod\": \"^3.25.0 || ^4.0.0\"\n },\n \"devDependencies\": {\n \"@ai-sdk/anthropicv1\": \"npm:@ai-sdk/anthropic@^1.2.12\",\n \"@ai-sdk/anthropicv2\": \"npm:@ai-sdk/anthropic@^2.0.57\",\n \"@ai-sdk/anthropicv3\": \"npm:@ai-sdk/anthropic@^3.0.9\",\n \"@ai-sdk/openaiv1\": \"npm:@ai-sdk/openai@^1.3.24\",\n \"@ai-sdk/openaiv2\": \"npm:@ai-sdk/openai@^2.0.88\",\n \"@ai-sdk/openaiv3\": \"npm:@ai-sdk/openai@^3.0.7\",\n \"@ai-sdk/providerv1\": \"npm:@ai-sdk/provider@^1.1.3\",\n \"@ai-sdk/providerv2\": \"npm:@ai-sdk/provider@^2.0.1\",\n \"@ai-sdk/providerv3\": \"npm:@ai-sdk/provider@^3.0.2\",\n \"@opentelemetry/api\": \"^1.9.0\",\n \"@opentelemetry/core\": \"^2.0.1\",\n \"@opentelemetry/sdk-trace-base\": \"^2.0.1\",\n \"@opentelemetry/sdk-trace-node\": \"^2.0.1\",\n \"@repo/eslint-config\": \"workspace:*\",\n \"@types/node\": \"^22.15.29\",\n \"@vitest/coverage-v8\": \"^4.0.0\",\n \"aiv4\": \"npm:ai@^4.3.19\",\n \"aiv5\": \"npm:ai@^5.0.118\",\n \"aiv6\": \"npm:ai@^6.0.6\",\n \"esbuild\": \"^0.25.8\",\n \"eslint\": \"catalog:\",\n \"msw\": \"^2.12.2\",\n \"prettier\": \"catalog:\",\n \"tinyrainbow\": \"^2.0.0\",\n \"tsup\": \"catalog:\",\n \"typescript\": \"catalog:\",\n \"vitest\": \"catalog:\",\n \"zod\": \"catalog:\"\n },\n \"files\": [\n \"dist\"\n ],\n \"packageManager\": \"pnpm@10.16.1\"\n}\n","import { context, propagation, type Baggage, type Span } from '@opentelemetry/api';\nimport { WITHSPAN_REDACTION_POLICY_KEY } from '../withSpanBaggageKey';\n\ntype CaptureMessageContent = 'full' | 'off';\n\nexport type AxiomAIRedactionPolicy = {\n captureMessageContent?: CaptureMessageContent;\n mirrorToolPayloadOnToolSpan?: boolean;\n};\n\nexport const RedactionPolicy = {\n /**\n * Includes message content on chat spans, and mirrors tool\n * payload on tool spans for more convenient querying.\n */\n AxiomDefault: {\n captureMessageContent: 'full',\n mirrorToolPayloadOnToolSpan: true,\n },\n /**\n * Redacts message content on chat spans, and does not put\n * tool payload on tool spans.\n */\n OpenTelemetryDefault: {\n captureMessageContent: 'off',\n mirrorToolPayloadOnToolSpan: false,\n },\n} as const satisfies Record<string, AxiomAIRedactionPolicy>;\n\n// Global key to store redaction policy across all execution contexts\nexport const AXIOM_AI_REDACTION_KEY = Symbol.for('__axiom_ai_redaction__');\n\n/**\n * Get the globally stored redaction policy\n * @returns The global redaction policy or undefined if not set\n */\nfunction getGlobalRedactionPolicy(): AxiomAIRedactionPolicy | undefined {\n return (globalThis as any)[AXIOM_AI_REDACTION_KEY];\n}\n\n/**\n * Resolves the effective redaction policy by merging global and per-call policies.\n * Per-call policies take precedence over global policies.\n *\n * @param globalPolicy - The global redaction policy from initAxiomAI\n * @param localPolicy - The per-call redaction policy from withSpan or middleware\n * @returns The effective redaction policy with all fields resolved\n */\nfunction getEffectiveRedactionPolicy(\n globalPolicy?: AxiomAIRedactionPolicy,\n localPolicy?: AxiomAIRedactionPolicy,\n): AxiomAIRedactionPolicy {\n // Per-call policy overrides global policy, with defaults\n return {\n captureMessageContent:\n localPolicy?.captureMessageContent ??\n globalPolicy?.captureMessageContent ??\n RedactionPolicy.AxiomDefault.captureMessageContent,\n mirrorToolPayloadOnToolSpan:\n localPolicy?.mirrorToolPayloadOnToolSpan ??\n globalPolicy?.mirrorToolPayloadOnToolSpan ??\n RedactionPolicy.AxiomDefault.mirrorToolPayloadOnToolSpan,\n };\n}\n\n/**\n * Get the active redaction policy\n */\nexport function getRedactionPolicy() {\n return getEffectiveRedactionPolicy(getGlobalRedactionPolicy(), getPerCallRedactionPolicy());\n}\n\n/**\n * Conditionally sets a span attribute based on the capture message content policy.\n * When policy is 'off', the attribute is not set at all.\n *\n * @param span - The OpenTelemetry span to set the attribute on\n * @param attribute - The attribute name/key\n * @param value - The attribute value\n * @param captureMessageContent - The capture policy ('full' sets attribute, 'off' skips it)\n */\nexport function handleMaybeRedactedAttribute(\n span: Span,\n attribute: string,\n value: any,\n captureMessageContent?: CaptureMessageContent,\n): void {\n if (captureMessageContent === 'full') {\n span.setAttribute(attribute, value);\n }\n\n // For 'off', don't set the attribute at all\n // Future: Could add callback-based redaction here\n}\n\n/**\n * Extracts the per-call redaction policy from OpenTelemetry baggage context.\n * This allows middleware and tools to access redaction policies passed via withSpan.\n *\n * @returns The per-call redaction policy or undefined if not set\n */\nfunction getPerCallRedactionPolicy(): AxiomAIRedactionPolicy | undefined {\n const baggage: Baggage = propagation.getBaggage(context.active()) || propagation.createBaggage();\n const serializedPolicy = baggage.getEntry(WITHSPAN_REDACTION_POLICY_KEY)?.value;\n\n if (!serializedPolicy) {\n return undefined;\n }\n\n try {\n return JSON.parse(serializedPolicy) as AxiomAIRedactionPolicy;\n } catch (error) {\n console.warn('[AxiomAI] Failed to parse redaction policy from baggage:', error);\n return undefined;\n }\n}\n","/**\n * We need a way to know that we're inside `withSpan`\n * Because we don't own `generateText` and similar functions,\n * we use OTel Baggage to propagate this information. Another\n * consideration might be to use AsyncLocalStorage in Node and\n * some kind of KV in workerd.\n */\nexport const WITHSPAN_BAGGAGE_KEY = '__withspan_gen_ai_call';\nexport const WITHSPAN_REDACTION_POLICY_KEY = '__withspan_redaction_policy';\n","import { type LanguageModelV1 } from '@ai-sdk/providerv1';\nimport { type LanguageModelV2 } from '@ai-sdk/providerv2';\nimport { type LanguageModelV3 } from '@ai-sdk/providerv3';\n\nimport { AxiomWrappedLanguageModelV1, isLanguageModelV1 } from './AxiomWrappedLanguageModelV1';\nimport { AxiomWrappedLanguageModelV2, isLanguageModelV2 } from './AxiomWrappedLanguageModelV2';\nimport { AxiomWrappedLanguageModelV3, isLanguageModelV3 } from './AxiomWrappedLanguageModelV3';\n\n/**\n * Wraps an AI SDK model to provide OpenTelemetry instrumentation.\n *\n * Supports AI SDK v4 (LanguageModelV1), v5 (LanguageModelV2) and v6 (LanguageModelV3) models.\n *\n * @param model - Language model implementing LanguageModelV1, LanguageModelV2 or LanguageModelV3 interface\n * @returns Wrapped model with identical interface but added instrumentation\n */\nexport function wrapAISDKModel<T extends LanguageModelV1 | LanguageModelV2 | LanguageModelV3>(\n model: T,\n): T {\n if (isLanguageModelV3(model)) {\n return new AxiomWrappedLanguageModelV3(model) as never as T;\n } else if (isLanguageModelV2(model)) {\n return new AxiomWrappedLanguageModelV2(model) as never as T;\n } else if (isLanguageModelV1(model)) {\n return new AxiomWrappedLanguageModelV1(model) as never as T;\n } else {\n console.warn('Unsupported AI SDK model. Not wrapping.');\n return model;\n }\n}\n","import { type LanguageModelV1, type LanguageModelV1CallOptions } from '@ai-sdk/providerv1';\nimport { axiomAIMiddlewareV1 } from './middleware';\n\nexport function isLanguageModelV1(model: unknown): model is LanguageModelV1 {\n return (\n model != null &&\n typeof model === 'object' &&\n 'specificationVersion' in model &&\n 'provider' in model &&\n 'modelId' in model &&\n (model as any).specificationVersion === 'v1' &&\n typeof (model as any).provider === 'string' &&\n typeof (model as any).modelId === 'string'\n );\n}\n\n/**\n * Wraps a LanguageModelV1 to provide OpenTelemetry instrumentation.\n *\n * Internally uses Axiom's telemetry middleware while maintaining a simple class-based API.\n *\n * @example\n * ```typescript\n * import { AxiomWrappedLanguageModelV1 } from '@axiom/ai';\n * import { openai } from '@ai-sdk/openai';\n *\n * const model = new AxiomWrappedLanguageModelV1(openai('gpt-3.5-turbo'));\n * ```\n *\n * For advanced use cases, you can also use the middleware directly:\n * ```typescript\n * import { wrapLanguageModel } from 'ai';\n * import { createAxiomTelemetryV1 } from '@axiom/ai';\n *\n * const model = wrapLanguageModel({\n * model: yourV1Model,\n * middleware: createAxiomTelemetryV1(),\n * });\n * ```\n */\nexport class AxiomWrappedLanguageModelV1 {\n constructor(model: LanguageModelV1) {\n const middleware = axiomAIMiddlewareV1();\n\n // Return the wrapped model directly from constructor\n return {\n specificationVersion: model.specificationVersion,\n provider: model.provider,\n modelId: model.modelId,\n defaultObjectGenerationMode: model.defaultObjectGenerationMode,\n supportsImageUrls: model.supportsImageUrls,\n supportsStructuredOutputs: model.supportsStructuredOutputs,\n supportsUrl: model.supportsUrl?.bind(model),\n\n doGenerate: async (params: LanguageModelV1CallOptions) => {\n return middleware.wrapGenerate!({\n doGenerate: () => model.doGenerate(params),\n doStream: () => model.doStream(params),\n params,\n model,\n });\n },\n\n doStream: async (params: LanguageModelV1CallOptions) => {\n return middleware.wrapStream!({\n doGenerate: () => model.doGenerate(params),\n doStream: () => model.doStream(params),\n params,\n model,\n });\n },\n } as LanguageModelV1;\n }\n}\n","import {\n type LanguageModelV1,\n type LanguageModelV1CallOptions,\n type LanguageModelV1Prompt,\n type LanguageModelV1StreamPart,\n} from '@ai-sdk/providerv1';\nimport {\n type LanguageModelV2,\n type LanguageModelV2CallOptions,\n type LanguageModelV2Middleware,\n type LanguageModelV2StreamPart,\n type LanguageModelV2Content,\n type LanguageModelV2ToolCall,\n type LanguageModelV2Usage,\n type LanguageModelV2ResponseMetadata,\n type LanguageModelV2FinishReason,\n type LanguageModelV2Prompt,\n} from '@ai-sdk/providerv2';\nimport {\n type LanguageModelV3,\n type LanguageModelV3CallOptions,\n type LanguageModelV3Middleware,\n type LanguageModelV3StreamPart,\n type LanguageModelV3Content,\n type LanguageModelV3ToolCall,\n type LanguageModelV3Usage,\n type LanguageModelV3ResponseMetadata,\n type LanguageModelV3FinishReason,\n type LanguageModelV3Prompt,\n} from '@ai-sdk/providerv3';\nimport { type LanguageModelV1Middleware } from 'aiv4';\n\nimport { type Span } from '@opentelemetry/api';\nimport { Attr } from './semconv/attributes';\nimport { createSimpleCompletion } from './completionUtils';\nimport {\n appendToolCalls,\n extractToolResultsFromPromptV2,\n extractToolResultsFromPromptV3,\n extractToolResultsFromRawPrompt,\n} from '../util/promptUtils';\nimport { sanitizeMultimodalContent } from './utils/contentSanitizer';\nimport {\n setScopeAttributes,\n setBaseAttributes,\n setRequestParameterAttributes,\n withSpanHandling,\n determineOutputTypeV1,\n determineOutputTypeV2,\n determineOutputTypeV3,\n classifyToolError,\n createStreamChildSpan,\n ensureNumber,\n type GenAiSpanContextV1,\n type GenAiSpanContextV2,\n type GenAiSpanContextV3,\n} from './utils/wrapperUtils';\nimport {\n promptV1ToOpenAI,\n promptV2ToOpenAI,\n promptV3ToOpenAI,\n normalizeV1ToolCalls,\n normalizeV2ToolCalls,\n normalizeV3ToolCalls,\n} from './utils/normalized';\nimport {\n ToolCallAggregator,\n TextAggregator,\n StreamStats,\n ToolCallAggregatorV2,\n TextAggregatorV2,\n StreamStatsV2,\n ToolCallAggregatorV3,\n TextAggregatorV3,\n StreamStatsV3,\n} from './streaming/aggregators';\nimport type { AxiomPromptMetadata } from '../types/metadata';\nimport { getRedactionPolicy, handleMaybeRedactedAttribute } from './utils/redaction';\n\nexport interface AxiomTelemetryConfig {\n // Future configuration options can be added here\n}\n\nconst appendPromptMetadataToSpan = (\n span: Span,\n messages: LanguageModelV1Prompt | LanguageModelV2Prompt | LanguageModelV3Prompt,\n) => {\n const lastMessage = messages?.[messages.length - 1];\n\n let axiomMeta: AxiomPromptMetadata | undefined;\n\n if ('providerMetadata' in lastMessage) {\n axiomMeta = lastMessage?.providerMetadata?._axiomMeta as AxiomPromptMetadata | undefined;\n } else if ('providerOptions' in lastMessage) {\n axiomMeta = lastMessage?.providerOptions?._axiomMeta as AxiomPromptMetadata | undefined;\n }\n\n if (axiomMeta) {\n if (axiomMeta.id) span.setAttribute(Attr.GenAI.PromptMetadata.ID, axiomMeta.id);\n if (axiomMeta.name) span.setAttribute(Attr.GenAI.PromptMetadata.Name, axiomMeta.name);\n if (axiomMeta.slug) span.setAttribute(Attr.GenAI.PromptMetadata.Slug, axiomMeta.slug);\n if (axiomMeta.version) span.setAttribute(Attr.GenAI.PromptMetadata.Version, axiomMeta.version);\n }\n};\n\n/**\n * Creates Axiom telemetry middleware for LanguageModelV1\n */\nexport function axiomAIMiddlewareV1(/* _config?: AxiomTelemetryConfig */): LanguageModelV1Middleware {\n return {\n wrapGenerate: async ({ doGenerate, params, model }) => {\n return withSpanHandling(\n model.modelId,\n async (span, commonContext, _lease) => {\n const context = commonContext as GenAiSpanContextV1;\n\n appendPromptMetadataToSpan(span, params.prompt);\n\n // Pre-call setup\n setScopeAttributes(span);\n setPreCallAttributesV1(span, params, context, model);\n\n const res = await doGenerate();\n\n // Store rawCall data in context for access in post-call processing\n context.rawCall = res.rawCall as { rawPrompt?: any[]; rawSettings?: any };\n\n // Post-call processing\n await setPostCallAttributesV1(span, res, context, model);\n\n return res;\n },\n { version: 'v1' },\n );\n },\n\n wrapStream: async ({ doStream, params, model }) => {\n return withSpanHandling(\n model.modelId,\n async (span, commonContext, lease) => {\n const context = commonContext as GenAiSpanContextV1;\n\n appendPromptMetadataToSpan(span, params.prompt);\n\n // Pre-call setup\n setScopeAttributes(span);\n setPreCallAttributesV1(span, params, context, model);\n\n const { stream, ...head } = await doStream();\n\n // Create child span for stream processing (provides granular visibility)\n const childSpan = createStreamChildSpan(span, `chat ${model.modelId} stream`);\n\n const stats = new StreamStats();\n const toolAggregator = new ToolCallAggregator();\n const textAggregator = new TextAggregator();\n\n return {\n ...head,\n stream: stream.pipeThrough(\n new TransformStream({\n transform(chunk: LanguageModelV1StreamPart, controller) {\n try {\n stats.feed(chunk);\n toolAggregator.handleChunk(chunk);\n textAggregator.feed(chunk);\n\n controller.enqueue(chunk);\n } catch (err) {\n classifyToolError(err, childSpan);\n childSpan.end();\n if (lease.owned) lease.end();\n controller.error(err);\n }\n },\n async flush(controller) {\n try {\n await setPostCallAttributesV1(\n span,\n {\n ...head,\n ...stats.result,\n toolCalls:\n toolAggregator.result.length > 0 ? toolAggregator.result : undefined,\n text: textAggregator.text,\n },\n context,\n model,\n );\n\n childSpan.end();\n if (lease.owned) lease.end();\n controller.terminate();\n } catch (err) {\n classifyToolError(err, childSpan);\n childSpan.end();\n if (lease.owned) lease.end();\n controller.error(err);\n }\n },\n }),\n ),\n };\n },\n { streaming: true, version: 'v1' }, // Don't auto-end span, we'll end it when stream completes\n );\n },\n };\n}\n\n/**\n * Creates unified Axiom telemetry middleware that works with V1, V2 and V3 models\n */\nexport function axiomAIMiddleware(config: { model: LanguageModelV1 }): LanguageModelV1Middleware;\nexport function axiomAIMiddleware(config: { model: LanguageModelV2 }): LanguageModelV2Middleware;\nexport function axiomAIMiddleware(config: { model: LanguageModelV3 }): LanguageModelV3Middleware;\nexport function axiomAIMiddleware(config: {\n model: LanguageModelV1 | LanguageModelV2 | LanguageModelV3;\n}) {\n if (config.model.specificationVersion === 'v1') {\n return axiomAIMiddlewareV1();\n } else if (config.model.specificationVersion === 'v2') {\n return axiomAIMiddlewareV2();\n } else if (config.model.specificationVersion === 'v3') {\n return axiomAIMiddlewareV3();\n } else {\n console.warn(\n // @ts-expect-error - not allowed at type level, but users can still do it...\n `Unsupported model specification version: ${JSON.stringify(config.model.specificationVersion)}. Creating no-op middleware instead.`,\n );\n return {};\n }\n}\n\n/**\n * Creates Axiom telemetry middleware for LanguageModelV2\n */\nexport function axiomAIMiddlewareV2(/* _config?: AxiomTelemetryConfig */): LanguageModelV2Middleware {\n return {\n wrapGenerate: async ({ doGenerate, params, model }) => {\n return withSpanHandling(\n model.modelId,\n async (span, commonContext, _lease) => {\n const context = commonContext as GenAiSpanContextV2;\n\n appendPromptMetadataToSpan(span, params.prompt);\n\n // Pre-call setup\n setScopeAttributes(span);\n setPreCallAttributesV2(span, params, context, model);\n\n const res = await doGenerate();\n\n // Post-call processing\n await setPostCallAttributesV2(span, res, context, model);\n\n return res;\n },\n { version: 'v2' },\n );\n },\n\n wrapStream: async ({ doStream, params, model }) => {\n return withSpanHandling(\n model.modelId,\n async (span, commonContext, lease) => {\n const context = commonContext as GenAiSpanContextV2;\n\n appendPromptMetadataToSpan(span, params.prompt);\n\n // Pre-call setup\n setScopeAttributes(span);\n setPreCallAttributesV2(span, params, context, model);\n\n const ret = await doStream();\n\n // Create child span for stream processing (provides granular visibility)\n const childSpan = createStreamChildSpan(span, `chat ${model.modelId} stream`);\n\n const stats = new StreamStatsV2();\n const toolAggregator = new ToolCallAggregatorV2();\n const textAggregator = new TextAggregatorV2();\n\n return {\n ...ret,\n stream: ret.stream.pipeThrough(\n new TransformStream({\n transform(chunk: LanguageModelV2StreamPart, controller) {\n try {\n stats.feed(chunk);\n toolAggregator.handleChunk(chunk);\n textAggregator.feed(chunk);\n\n controller.enqueue(chunk);\n } catch (err) {\n classifyToolError(err, childSpan);\n childSpan.end();\n if (lease.owned) lease.end();\n controller.error(err);\n }\n },\n async flush(controller) {\n try {\n const streamResult = {\n ...stats.result,\n content: [\n ...(textAggregator.text\n ? [{ type: 'text' as const, text: textAggregator.text }]\n : []),\n ...toolAggregator.result,\n ],\n };\n\n await setPostCallAttributesV2(span, streamResult, context, model);\n\n childSpan.end();\n if (lease.owned) lease.end();\n controller.terminate();\n } catch (err) {\n classifyToolError(err, childSpan);\n childSpan.end();\n if (lease.owned) lease.end();\n controller.error(err);\n }\n },\n }),\n ),\n };\n },\n { streaming: true, version: 'v2' }, // Don't auto-end span, we'll end it when stream completes\n );\n },\n };\n}\n\n// V1 helper functions (extracted from AxiomWrappedLanguageModelV1)\nfunction setPreCallAttributesV1(\n span: Span,\n options: LanguageModelV1CallOptions,\n context: GenAiSpanContextV1,\n model: LanguageModelV1,\n) {\n const redactionPolicy = getRedactionPolicy();\n\n const {\n prompt,\n maxTokens,\n frequencyPenalty,\n presencePenalty,\n temperature,\n topP,\n topK,\n seed,\n stopSequences,\n responseFormat,\n mode,\n } = options;\n\n // Set prompt attributes (full conversation history)\n const processedPrompt = promptV1ToOpenAI(prompt);\n context.originalPrompt = processedPrompt;\n\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Input.Messages,\n JSON.stringify(sanitizeMultimodalContent(processedPrompt)),\n redactionPolicy.captureMessageContent,\n );\n\n setBaseAttributes(span, model.provider, model.modelId);\n\n const outputType = determineOutputTypeV1({ responseFormat, mode });\n if (outputType) {\n span.setAttribute(Attr.GenAI.Output.Type, outputType);\n }\n\n setRequestParameterAttributes(span, {\n maxTokens,\n frequencyPenalty,\n presencePenalty,\n temperature,\n topP,\n topK,\n seed,\n stopSequences,\n });\n}\n\nasync function setPostCallAttributesV1(\n span: Span,\n result: any,\n context: GenAiSpanContextV1,\n _model: LanguageModelV1,\n) {\n const redactionPolicy = getRedactionPolicy();\n\n // Update prompt to include tool calls and tool results if they exist\n if (result.toolCalls && result.toolCalls.length > 0) {\n const originalPrompt = context.originalPrompt || [];\n\n // Normalize the tool calls to the common format\n const normalizedToolCalls = normalizeV1ToolCalls(result.toolCalls);\n\n // Note: rawCall might not be available in middleware, handle gracefully\n const toolResultsMap = context.rawCall?.rawPrompt\n ? extractToolResultsFromRawPrompt(context.rawCall.rawPrompt as any[])\n : new Map();\n\n const updatedPrompt = appendToolCalls(\n originalPrompt,\n normalizedToolCalls,\n toolResultsMap,\n result.text,\n );\n\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Input.Messages,\n JSON.stringify(sanitizeMultimodalContent(updatedPrompt)),\n redactionPolicy.captureMessageContent,\n );\n }\n\n // Create simple completion array with just assistant text\n if (result.text) {\n const completion = createSimpleCompletion({\n text: result.text,\n });\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Output.Messages,\n JSON.stringify(completion),\n redactionPolicy.captureMessageContent,\n );\n }\n\n if (result.response?.id) {\n span.setAttribute(Attr.GenAI.Response.ID, result.response.id);\n }\n if (result.response?.modelId) {\n span.setAttribute(Attr.GenAI.Response.Model, result.response.modelId);\n }\n\n const inputTokens = ensureNumber(result.usage?.promptTokens);\n if (inputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.InputTokens, inputTokens);\n }\n\n const outputTokens = ensureNumber(result.usage?.completionTokens);\n if (outputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.OutputTokens, outputTokens);\n }\n\n if (result.finishReason) {\n span.setAttribute(Attr.GenAI.Response.FinishReasons, JSON.stringify([result.finishReason]));\n }\n}\n\n// V2 helper functions (extracted from AxiomWrappedLanguageModelV2)\nfunction setPreCallAttributesV2(\n span: Span,\n options: LanguageModelV2CallOptions,\n context: GenAiSpanContextV2,\n model: LanguageModelV2,\n) {\n const redactionPolicy = getRedactionPolicy();\n\n setBaseAttributes(span, model.provider, model.modelId);\n\n const outputType = determineOutputTypeV2(options);\n if (outputType) {\n span.setAttribute(Attr.GenAI.Output.Type, outputType);\n }\n\n setRequestParameterAttributes(span, {\n maxTokens: options.maxOutputTokens,\n frequencyPenalty: options.frequencyPenalty,\n presencePenalty: options.presencePenalty,\n temperature: options.temperature,\n topP: options.topP,\n topK: options.topK,\n seed: options.seed,\n stopSequences: options.stopSequences,\n });\n\n const processedPrompt = promptV2ToOpenAI(options.prompt);\n\n // Store both the original V2 prompt and processed prompt for later use\n context.originalV2Prompt = options.prompt;\n context.originalPrompt = processedPrompt;\n\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Input.Messages,\n JSON.stringify(sanitizeMultimodalContent(processedPrompt)),\n redactionPolicy.captureMessageContent,\n );\n}\n\nasync function setPostCallAttributesV2(\n span: Span,\n result: {\n response?: LanguageModelV2ResponseMetadata;\n finishReason?: LanguageModelV2FinishReason;\n usage?: LanguageModelV2Usage;\n content?: Array<LanguageModelV2Content>;\n },\n context: GenAiSpanContextV2,\n _model: LanguageModelV2,\n) {\n const redactionPolicy = getRedactionPolicy();\n\n // Check if we have tool calls in this response\n const toolCalls = result.content?.filter(\n (c) => c.type === 'tool-call',\n ) as LanguageModelV2ToolCall[];\n\n // Only set response metadata once per span to prevent overwriting when generateText() makes multiple calls\n const alreadySet = (span as any).attributes?.[Attr.GenAI.Response.FinishReasons] !== undefined;\n\n if (!alreadySet) {\n if (result.response?.id) {\n span.setAttribute(Attr.GenAI.Response.ID, result.response.id);\n }\n if (result.response?.modelId) {\n span.setAttribute(Attr.GenAI.Response.Model, result.response.modelId);\n }\n\n const inputTokens = ensureNumber(result.usage?.inputTokens);\n if (inputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.InputTokens, inputTokens);\n }\n\n const outputTokens = ensureNumber(result.usage?.outputTokens);\n if (outputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.OutputTokens, outputTokens);\n }\n }\n\n // Update prompt to include tool calls and tool results if they exist\n if (toolCalls && toolCalls.length > 0) {\n const originalPrompt = context.originalPrompt || [];\n\n const normalizedToolCalls = normalizeV2ToolCalls(toolCalls);\n\n // Extract real tool results from the original V2 prompt structure\n const toolResultsMap = extractToolResultsFromPromptV2(context.originalV2Prompt || []);\n\n // Extract assistant text content from the response\n const textContent = result.content?.find((c) => c.type === 'text');\n const assistantText = textContent?.type === 'text' ? textContent.text : undefined;\n\n // Use the standard prompt utility to append tool calls\n const updatedPrompt = appendToolCalls(\n originalPrompt,\n normalizedToolCalls,\n toolResultsMap,\n assistantText,\n );\n\n // Update the prompt attribute with the complete conversation history\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Input.Messages,\n JSON.stringify(sanitizeMultimodalContent(updatedPrompt)),\n redactionPolicy.captureMessageContent,\n );\n }\n\n // Process tool calls and create child spans\n if (result.content && result.content.length > 0) {\n await processToolCallsAndCreateSpansV2(span, result.content);\n } else if (result.finishReason) {\n // For non-tool responses, still create completion array\n const completion = createSimpleCompletion({\n text: '',\n });\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Output.Messages,\n JSON.stringify(completion),\n redactionPolicy.captureMessageContent,\n );\n }\n\n // Store finish reason separately as per semantic conventions (only on first call to prevent overwriting)\n if (result.finishReason && !alreadySet) {\n span.setAttribute(Attr.GenAI.Response.FinishReasons, JSON.stringify([result.finishReason]));\n }\n}\n\nasync function processToolCallsAndCreateSpansV2(\n parentSpan: Span,\n content: Array<LanguageModelV2Content>,\n): Promise<void> {\n const redactionPolicy = getRedactionPolicy();\n\n // Extract text and tool calls from content\n const textContent = content.find((c) => c.type === 'text');\n const assistantText = textContent?.type === 'text' ? textContent.text : undefined;\n const toolCalls = content.filter((c) => c.type === 'tool-call') as LanguageModelV2ToolCall[];\n\n // Only set completion for final responses without tool calls\n if (toolCalls.length === 0) {\n // Create completion with multimodal content support\n const completion = [\n {\n role: 'assistant' as const,\n content: sanitizeMultimodalContent(\n content.length === 1 && assistantText ? assistantText : content,\n ),\n },\n ];\n\n // Set completion array as span attribute\n handleMaybeRedactedAttribute(\n parentSpan,\n Attr.GenAI.Output.Messages,\n JSON.stringify(completion),\n redactionPolicy.captureMessageContent,\n );\n }\n}\n\n/**\n * Creates Axiom telemetry middleware for LanguageModelV3\n */\nexport function axiomAIMiddlewareV3(/* _config?: AxiomTelemetryConfig */): LanguageModelV3Middleware {\n return {\n specificationVersion: 'v3',\n\n wrapGenerate: async ({ doGenerate, params, model }) => {\n return withSpanHandling(\n model.modelId,\n async (span, commonContext, _lease) => {\n const context = commonContext as GenAiSpanContextV3;\n\n appendPromptMetadataToSpan(span, params.prompt);\n\n // Pre-call setup\n setScopeAttributes(span);\n setPreCallAttributesV3(span, params, context, model);\n\n const res = await doGenerate();\n\n // Post-call processing\n await setPostCallAttributesV3(span, res, context, model);\n\n return res;\n },\n { version: 'v3' },\n );\n },\n\n wrapStream: async ({ doStream, params, model }) => {\n return withSpanHandling(\n model.modelId,\n async (span, commonContext, lease) => {\n const context = commonContext as GenAiSpanContextV3;\n\n appendPromptMetadataToSpan(span, params.prompt);\n\n // Pre-call setup\n setScopeAttributes(span);\n setPreCallAttributesV3(span, params, context, model);\n\n const ret = await doStream();\n\n // Create child span for stream processing (provides granular visibility)\n const childSpan = createStreamChildSpan(span, `chat ${model.modelId} stream`);\n\n const stats = new StreamStatsV3();\n const toolAggregator = new ToolCallAggregatorV3();\n const textAggregator = new TextAggregatorV3();\n\n return {\n ...ret,\n stream: ret.stream.pipeThrough(\n new TransformStream({\n transform(chunk: LanguageModelV3StreamPart, controller) {\n try {\n stats.feed(chunk);\n toolAggregator.handleChunk(chunk);\n textAggregator.feed(chunk);\n\n controller.enqueue(chunk);\n } catch (err) {\n classifyToolError(err, childSpan);\n childSpan.end();\n if (lease.owned) lease.end();\n controller.error(err);\n }\n },\n async flush(controller) {\n try {\n const statsResult = stats.result;\n\n await setPostCallAttributesV3(\n span,\n {\n response: statsResult.response,\n finishReason: statsResult.finishReason,\n usage: statsResult.usage,\n content:\n toolAggregator.result.length > 0\n ? toolAggregator.result\n : textAggregator.text\n ? [{ type: 'text' as const, text: textAggregator.text }]\n : [],\n warnings: [],\n },\n context,\n model,\n );\n\n childSpan.end();\n if (lease.owned) lease.end();\n controller.terminate();\n } catch (err) {\n classifyToolError(err, childSpan);\n childSpan.end();\n if (lease.owned) lease.end();\n controller.error(err);\n }\n },\n }),\n ),\n };\n },\n { streaming: true, version: 'v3' },\n );\n },\n };\n}\n\n// V3 helper functions\nfunction setPreCallAttributesV3(\n span: Span,\n options: LanguageModelV3CallOptions,\n context: GenAiSpanContextV3,\n model: LanguageModelV3,\n) {\n const redactionPolicy = getRedactionPolicy();\n\n setBaseAttributes(span, model.provider, model.modelId);\n\n const outputType = determineOutputTypeV3(options);\n if (outputType) {\n span.setAttribute(Attr.GenAI.Output.Type, outputType);\n }\n\n setRequestParameterAttributes(span, {\n maxTokens: options.maxOutputTokens,\n frequencyPenalty: options.frequencyPenalty,\n presencePenalty: options.presencePenalty,\n temperature: options.temperature,\n topP: options.topP,\n topK: options.topK,\n seed: options.seed,\n stopSequences: options.stopSequences,\n });\n\n const processedPrompt = promptV3ToOpenAI(options.prompt);\n\n // Store both the original V3 prompt and processed prompt for later use\n context.originalV3Prompt = options.prompt;\n context.originalPrompt = processedPrompt;\n\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Input.Messages,\n JSON.stringify(sanitizeMultimodalContent(processedPrompt)),\n redactionPolicy.captureMessageContent,\n );\n}\n\nasync function setPostCallAttributesV3(\n span: Span,\n result: {\n response?: LanguageModelV3ResponseMetadata;\n finishReason?: LanguageModelV3FinishReason;\n usage?: LanguageModelV3Usage;\n content?: Array<LanguageModelV3Content>;\n warnings: Array<unknown>;\n },\n context: GenAiSpanContextV3,\n _model: LanguageModelV3,\n) {\n const redactionPolicy = getRedactionPolicy();\n\n // Check if we have tool calls in this response\n const toolCalls = result.content?.filter(\n (c) => c.type === 'tool-call',\n ) as LanguageModelV3ToolCall[];\n\n // Only set response metadata once per span to prevent overwriting when generateText() makes multiple calls\n const alreadySet = (span as any).attributes?.[Attr.GenAI.Response.FinishReasons] !== undefined;\n\n if (!alreadySet) {\n if (result.response?.id) {\n span.setAttribute(Attr.GenAI.Response.ID, result.response.id);\n }\n if (result.response?.modelId) {\n span.setAttribute(Attr.GenAI.Response.Model, result.response.modelId);\n }\n\n // V3 has structured token usage - extract totals for OTel attributes\n // TODO: When OTel semantic conventions add support for cached/reasoning tokens,\n // add these attributes:\n // - result.usage?.inputTokens.cacheRead -> gen_ai.usage.cache_read_tokens (or similar)\n // - result.usage?.inputTokens.cacheWrite -> gen_ai.usage.cache_write_tokens (or similar)\n // - result.usage?.inputTokens.noCache -> gen_ai.usage.no_cache_tokens (or similar)\n // - result.usage?.outputTokens.reasoning -> gen_ai.usage.reasoning_tokens (or similar)\n // - result.usage?.outputTokens.text -> gen_ai.usage.text_tokens (or similar)\n // Access: result.usage?.inputTokens.cacheRead, result.usage?.outputTokens.reasoning, etc.\n const inputTokens = ensureNumber(result.usage?.inputTokens?.total);\n if (inputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.InputTokens, inputTokens);\n }\n\n const outputTokens = ensureNumber(result.usage?.outputTokens?.total);\n if (outputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.OutputTokens, outputTokens);\n }\n }\n\n // Update prompt to include tool calls and tool results if they exist\n if (toolCalls && toolCalls.length > 0) {\n const originalPrompt = context.originalPrompt || [];\n\n const normalizedToolCalls = normalizeV3ToolCalls(toolCalls);\n\n // Extract real tool results from the original V3 prompt structure\n const toolResultsMap = extractToolResultsFromPromptV3(context.originalV3Prompt || []);\n\n // Extract assistant text content from the response\n const textContent = result.content?.find((c) => c.type === 'text');\n const assistantText = textContent?.type === 'text' ? textContent.text : undefined;\n\n // Use the standard prompt utility to append tool calls\n const updatedPrompt = appendToolCalls(\n originalPrompt,\n normalizedToolCalls,\n toolResultsMap,\n assistantText,\n );\n\n // Update the prompt attribute with the complete conversation history\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Input.Messages,\n JSON.stringify(sanitizeMultimodalContent(updatedPrompt)),\n redactionPolicy.captureMessageContent,\n );\n }\n\n // Process content and create completion\n if (result.content && result.content.length > 0) {\n await processToolCallsAndCreateSpansV3(span, result.content);\n } else if (result.finishReason) {\n // For non-tool responses, still create completion array\n const completion = createSimpleCompletion({\n text: '',\n });\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Output.Messages,\n JSON.stringify(completion),\n redactionPolicy.captureMessageContent,\n );\n }\n\n // Store finish reason - V3 uses { unified, raw } structure, use unified for OTel\n // TODO: When OTel adds support for raw finish reasons, consider adding:\n // - result.finishReason.raw -> gen_ai.response.raw_finish_reason (or similar)\n // Access: result.finishReason?.raw\n if (result.finishReason && !alreadySet) {\n span.setAttribute(\n Attr.GenAI.Response.FinishReasons,\n JSON.stringify([result.finishReason.unified]),\n );\n }\n}\n\nasync function processToolCallsAndCreateSpansV3(\n parentSpan: Span,\n content: Array<LanguageModelV3Content>,\n): Promise<void> {\n const redactionPolicy = getRedactionPolicy();\n\n // Extract text and tool calls from content\n const textContent = content.find((c) => c.type === 'text');\n const assistantText = textContent?.type === 'text' ? textContent.text : undefined;\n const toolCalls = content.filter((c) => c.type === 'tool-call') as LanguageModelV3ToolCall[];\n\n // TODO: When OTel adds support for tool approval flow, track these:\n // - tool-approval-request stream parts with approvalId, toolCallId\n // - tool-approval-response parts in tool messages\n // Access: content.filter(c => c.type === 'tool-approval-request')\n // Also track dynamic/providerExecuted flags on tool calls:\n // - toolCall.dynamic -> gen_ai.tool.dynamic (or similar)\n // - toolCall.providerExecuted -> gen_ai.tool.provider_executed (or similar)\n\n // Only set completion for final responses without tool calls\n if (toolCalls.length === 0) {\n // Create completion with multimodal content support\n // Filter out V3-specific content types that aren't text\n const sanitizableContent = content.filter(\n (c) =>\n c.type === 'text' ||\n c.type === 'reasoning' ||\n c.type === 'file' ||\n c.type === 'source' ||\n c.type === 'tool-result',\n );\n\n const completion = [\n {\n role: 'assistant' as const,\n content: sanitizeMultimodalContent(\n sanitizableContent.length === 1 && assistantText ? assistantText : sanitizableContent,\n ),\n },\n ];\n\n // Set completion array as span attribute\n handleMaybeRedactedAttribute(\n parentSpan,\n Attr.GenAI.Output.Messages,\n JSON.stringify(completion),\n redactionPolicy.captureMessageContent,\n );\n }\n}\n","import {\n ATTR_ERROR_TYPE,\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n} from '@opentelemetry/semantic-conventions';\n\nimport {\n ATTR_EVAL_CASE_INDEX,\n ATTR_EVAL_CASE_EXPECTED,\n ATTR_EVAL_CASE_INPUT,\n ATTR_EVAL_CASE_OUTPUT,\n ATTR_EVAL_CASE_METADATA,\n ATTR_EVAL_CASE_SCORES,\n ATTR_EVAL_CASE_TRIALS,\n ATTR_EVAL_SCORE_PASSED,\n ATTR_EVAL_SCORE_IS_BOOLEAN,\n ATTR_EVAL_SCORE_VALUE,\n ATTR_EVAL_SCORE_NAME,\n ATTR_EVAL_SCORE_THRESHOLD,\n ATTR_EVAL_SCORE_METADATA,\n ATTR_EVAL_SCORE_AGGREGATION,\n ATTR_EVAL_SCORE_TRIALS,\n ATTR_EVAL_TASK_TYPE,\n ATTR_EVAL_TASK_NAME,\n ATTR_EVAL_TASK_OUTPUT,\n ATTR_EVAL_COLLECTION_NAME,\n ATTR_EVAL_COLLECTION_SIZE,\n ATTR_EVAL_ID,\n ATTR_EVAL_BASELINE_ID,\n ATTR_EVAL_BASELINE_NAME,\n ATTR_EVAL_BASELINE_VERSION,\n ATTR_EVAL_NAME,\n ATTR_EVAL_TAGS,\n ATTR_EVAL_TYPE,\n ATTR_EVAL_TRIALS,\n ATTR_EVAL_TRIAL_INDEX,\n ATTR_EVAL_TRIAL_ERROR,\n ATTR_EVAL_COLLECTION_ID,\n ATTR_EVAL_USER_NAME,\n ATTR_EVAL_USER_EMAIL,\n ATTR_EVAL_VERSION,\n ATTR_EVAL_RUN_ID,\n ATTR_EVAL_METADATA,\n ATTR_EVAL_CONFIG_FLAGS,\n ATTR_EVAL_CAPABILITY_NAME,\n ATTR_EVAL_STEP_NAME,\n} from './eval_proposal';\n\nimport {\n ATTR_ERROR_MESSAGE,\n ATTR_GEN_AI_AGENT_DESCRIPTION,\n ATTR_GEN_AI_AGENT_ID,\n ATTR_GEN_AI_AGENT_NAME,\n ATTR_GEN_AI_CONVERSATION_ID,\n ATTR_GEN_AI_INPUT_MESSAGES,\n ATTR_GEN_AI_OPERATION_NAME,\n ATTR_GEN_AI_OUTPUT_MESSAGES,\n ATTR_GEN_AI_OUTPUT_TYPE,\n ATTR_GEN_AI_PROVIDER_NAME,\n ATTR_GEN_AI_REQUEST_CHOICE_COUNT,\n ATTR_GEN_AI_REQUEST_ENCODING_FORMATS,\n ATTR_GEN_AI_REQUEST_FREQUENCY_PENALTY,\n ATTR_GEN_AI_REQUEST_MAX_TOKENS,\n ATTR_GEN_AI_REQUEST_MODEL,\n ATTR_GEN_AI_REQUEST_PRESENCE_PENALTY,\n ATTR_GEN_AI_REQUEST_SEED,\n ATTR_GEN_AI_REQUEST_STOP_SEQUENCES,\n ATTR_GEN_AI_REQUEST_TEMPERATURE,\n ATTR_GEN_AI_REQUEST_TOP_K,\n ATTR_GEN_AI_REQUEST_TOP_P,\n ATTR_GEN_AI_RESPONSE_FINISH_REASONS,\n ATTR_GEN_AI_RESPONSE_ID,\n ATTR_GEN_AI_RESPONSE_MODEL,\n ATTR_GEN_AI_TOOL_CALL_ID,\n ATTR_GEN_AI_TOOL_DESCRIPTION,\n ATTR_GEN_AI_TOOL_NAME,\n ATTR_GEN_AI_TOOL_TYPE,\n ATTR_GEN_AI_USAGE_INPUT_TOKENS,\n ATTR_GEN_AI_USAGE_OUTPUT_TOKENS,\n GEN_AI_OPERATION_NAME_VALUE_CHAT,\n GEN_AI_OPERATION_NAME_VALUE_CREATE_AGENT,\n GEN_AI_OPERATION_NAME_VALUE_EMBEDDINGS,\n GEN_AI_OPERATION_NAME_VALUE_EXECUTE_TOOL,\n GEN_AI_OPERATION_NAME_VALUE_GENERATE_CONTENT,\n GEN_AI_OPERATION_NAME_VALUE_INVOKE_AGENT,\n GEN_AI_OUTPUT_TYPE_VALUE_IMAGE,\n GEN_AI_OUTPUT_TYPE_VALUE_JSON,\n GEN_AI_OUTPUT_TYPE_VALUE_SPEECH,\n GEN_AI_OUTPUT_TYPE_VALUE_TEXT,\n GEN_AI_PROVIDER_NAME_VALUE_ANTHROPIC,\n GEN_AI_PROVIDER_NAME_VALUE_AWS_BEDROCK,\n GEN_AI_PROVIDER_NAME_VALUE_AZURE_AI_INFERENCE,\n GEN_AI_PROVIDER_NAME_VALUE_AZURE_AI_OPENAI,\n GEN_AI_PROVIDER_NAME_VALUE_COHERE,\n GEN_AI_PROVIDER_NAME_VALUE_DEEPSEEK,\n GEN_AI_PROVIDER_NAME_VALUE_GCP_GEMINI,\n GEN_AI_PROVIDER_NAME_VALUE_GCP_GEN_AI,\n GEN_AI_PROVIDER_NAME_VALUE_GCP_VERTEX_AI,\n GEN_AI_PROVIDER_NAME_VALUE_GROQ,\n GEN_AI_PROVIDER_NAME_VALUE_IBM_WATSONX_AI,\n GEN_AI_PROVIDER_NAME_VALUE_MISTRAL_AI,\n GEN_AI_PROVIDER_NAME_VALUE_OPENAI,\n GEN_AI_PROVIDER_NAME_VALUE_PERPLEXITY,\n GEN_AI_PROVIDER_NAME_VALUE_X_AI,\n} from '@opentelemetry/semantic-conventions/incubating';\n\n/**\n * PROPRIETARY ATTRIBUTES (o11y)\n *\n * @see: https://axiom.co/docs/ai-engineering/semantic-conventions\n */\n\nconst ATTR_AXIOM_GEN_AI_SCHEMA_URL = 'axiom.gen_ai.schema_url';\nconst ATTR_AXIOM_GEN_AI_SDK_NAME = 'axiom.gen_ai.sdk.name';\nconst ATTR_AXIOM_GEN_AI_SDK_VERSION = 'axiom.gen_ai.sdk.version';\nconst ATTR_GEN_AI_CAPABILITY_NAME = 'gen_ai.capability.name';\nconst ATTR_GEN_AI_STEP_NAME = 'gen_ai.step.name';\nconst ATTR_GEN_AI_TOOL_ARGUMENTS = 'gen_ai.tool.arguments'; // deprecated by OTel\nconst ATTR_GEN_AI_TOOL_MESSAGE = 'gen_ai.tool.message'; // deprecated by OTel\n\nconst GEN_AI_PROVIDER_NAME_VALUE_ASSEMBLYAI = 'assemblyai';\nconst GEN_AI_PROVIDER_NAME_VALUE_CEREBRAS = 'cerebras';\nconst GEN_AI_PROVIDER_NAME_VALUE_DEEPGRAM = 'deepgram';\nconst GEN_AI_PROVIDER_NAME_VALUE_DEEPINFRA = 'deepinfra';\nconst GEN_AI_PROVIDER_NAME_VALUE_ELEVENLABS = 'elevenlabs';\nconst GEN_AI_PROVIDER_NAME_VALUE_FAL = 'fal';\nconst GEN_AI_PROVIDER_NAME_VALUE_FIREWORKS = 'fireworks';\nconst GEN_AI_PROVIDER_NAME_VALUE_GLADIA = 'gladia';\nconst GEN_AI_PROVIDER_NAME_VALUE_HUME = 'hume';\nconst GEN_AI_PROVIDER_NAME_VALUE_LMNT = 'lmnt';\nconst GEN_AI_PROVIDER_NAME_VALUE_LUMA = 'luma';\nconst GEN_AI_PROVIDER_NAME_VALUE_REPLICATE = 'replicate';\nconst GEN_AI_PROVIDER_NAME_VALUE_REVAI = 'revai';\nconst GEN_AI_PROVIDER_NAME_VALUE_TOGETHERAI = 'togetherai';\nconst GEN_AI_PROVIDER_NAME_VALUE_VERCEL = 'vercel';\n\n/**\n * When adding something new here, please:\n * 1. Make sure it doesn't already exist as part of OTel Semantic Conventions (use that instead)\n * 2. Make sure to use standard naming schema, ie snake_case\n * 3. If a specific feature has an attribute you would like to use, extract it to the shared section\n *\n * Also Experimental Attributes should always be imported here and then used from the CustomAttributes object\n * because they are unstable.\n *\n * @see: https://github.com/open-telemetry/opentelemetry-js/tree/c89cb38d0fec39d54cf3fcb35c429a8129e9c909/semantic-conventions#unstable-semconv\n */\nexport const Attr = {\n __EXPERIMENTAL_Flag: (flagName: string) => `flag.${flagName}`,\n __EXPERIMENTAL_Fact: (factName: string) => `fact.${factName}`,\n Axiom: {\n GenAI: {\n SchemaURL: ATTR_AXIOM_GEN_AI_SCHEMA_URL,\n SDK: {\n Name: ATTR_AXIOM_GEN_AI_SDK_NAME,\n Version: ATTR_AXIOM_GEN_AI_SDK_VERSION,\n },\n },\n },\n GenAI: {\n PromptMetadata: {\n ID: 'axiom.gen_ai.prompt.id',\n Name: 'axiom.gen_ai.prompt.name',\n Slug: 'axiom.gen_ai.prompt.slug',\n Version: 'axiom.gen_ai.prompt.version',\n },\n /**\n * These two are used to identify the span\n */\n Capability: {\n Name: ATTR_GEN_AI_CAPABILITY_NAME,\n },\n Step: {\n Name: ATTR_GEN_AI_STEP_NAME,\n },\n Provider: {\n Name: ATTR_GEN_AI_PROVIDER_NAME,\n Name_Values: {\n Anthropic: GEN_AI_PROVIDER_NAME_VALUE_ANTHROPIC,\n AssemblyAI: GEN_AI_PROVIDER_NAME_VALUE_ASSEMBLYAI,\n AWSBedrock: GEN_AI_PROVIDER_NAME_VALUE_AWS_BEDROCK,\n AzureAIInference: GEN_AI_PROVIDER_NAME_VALUE_AZURE_AI_INFERENCE,\n AzureAIOpenAI: GEN_AI_PROVIDER_NAME_VALUE_AZURE_AI_OPENAI,\n Cerebras: GEN_AI_PROVIDER_NAME_VALUE_CEREBRAS,\n Cohere: GEN_AI_PROVIDER_NAME_VALUE_COHERE,\n Deepgram: GEN_AI_PROVIDER_NAME_VALUE_DEEPGRAM,\n DeepInfra: GEN_AI_PROVIDER_NAME_VALUE_DEEPINFRA,\n Deepseek: GEN_AI_PROVIDER_NAME_VALUE_DEEPSEEK,\n ElevenLabs: GEN_AI_PROVIDER_NAME_VALUE_ELEVENLABS,\n Fal: GEN_AI_PROVIDER_NAME_VALUE_FAL,\n Fireworks: GEN_AI_PROVIDER_NAME_VALUE_FIREWORKS,\n GCPGemini: GEN_AI_PROVIDER_NAME_VALUE_GCP_GEMINI,\n GCPGenAI: GEN_AI_PROVIDER_NAME_VALUE_GCP_GEN_AI,\n GCPVertexAI: GEN_AI_PROVIDER_NAME_VALUE_GCP_VERTEX_AI,\n Gladia: GEN_AI_PROVIDER_NAME_VALUE_GLADIA,\n Groq: GEN_AI_PROVIDER_NAME_VALUE_GROQ,\n Hume: GEN_AI_PROVIDER_NAME_VALUE_HUME,\n IBMWatsonxAI: GEN_AI_PROVIDER_NAME_VALUE_IBM_WATSONX_AI,\n Lmnt: GEN_AI_PROVIDER_NAME_VALUE_LMNT,\n Luma: GEN_AI_PROVIDER_NAME_VALUE_LUMA,\n MistralAI: GEN_AI_PROVIDER_NAME_VALUE_MISTRAL_AI,\n OpenAI: GEN_AI_PROVIDER_NAME_VALUE_OPENAI,\n Perplexity: GEN_AI_PROVIDER_NAME_VALUE_PERPLEXITY,\n Replicate: GEN_AI_PROVIDER_NAME_VALUE_REPLICATE,\n RevAI: GEN_AI_PROVIDER_NAME_VALUE_REVAI,\n TogetherAI: GEN_AI_PROVIDER_NAME_VALUE_TOGETHERAI,\n Vercel: GEN_AI_PROVIDER_NAME_VALUE_VERCEL,\n XAI: GEN_AI_PROVIDER_NAME_VALUE_X_AI,\n },\n },\n /**\n * Regular attributes\n */\n Agent: {\n Description: ATTR_GEN_AI_AGENT_DESCRIPTION, // not yet used by axiom-ai\n ID: ATTR_GEN_AI_AGENT_ID, // not yet used by axiom-ai\n Name: ATTR_GEN_AI_AGENT_NAME, // not yet used by axiom-ai\n },\n Conversation: {\n ID: ATTR_GEN_AI_CONVERSATION_ID, // not yet used by axiom-ai, anyway probably needs to be provided by user\n },\n Input: {\n Messages: ATTR_GEN_AI_INPUT_MESSAGES,\n },\n Operation: {\n Name: ATTR_GEN_AI_OPERATION_NAME,\n Name_Values: {\n /**\n * Note that \"text_completion\" is deprecated in favor of \"chat\" for both OpenAI and Anthropic\n */\n Chat: GEN_AI_OPERATION_NAME_VALUE_CHAT,\n CreateAgent: GEN_AI_OPERATION_NAME_VALUE_CREATE_AGENT,\n Embeddings: GEN_AI_OPERATION_NAME_VALUE_EMBEDDINGS,\n ExecuteTool: GEN_AI_OPERATION_NAME_VALUE_EXECUTE_TOOL,\n GenerateContent: GEN_AI_OPERATION_NAME_VALUE_GENERATE_CONTENT,\n InvokeAgent: GEN_AI_OPERATION_NAME_VALUE_INVOKE_AGENT,\n },\n },\n Output: {\n Messages: ATTR_GEN_AI_OUTPUT_MESSAGES,\n Type: ATTR_GEN_AI_OUTPUT_TYPE,\n Type_Values: {\n Text: GEN_AI_OUTPUT_TYPE_VALUE_TEXT,\n Json: GEN_AI_OUTPUT_TYPE_VALUE_JSON,\n Image: GEN_AI_OUTPUT_TYPE_VALUE_IMAGE,\n Speech: GEN_AI_OUTPUT_TYPE_VALUE_SPEECH,\n },\n },\n /**\n * The provider that is hosting the model, eg AWS Bedrock\n * There doesn't seem to be a semconv for this\n */\n Request: {\n ChoiceCount: ATTR_GEN_AI_REQUEST_CHOICE_COUNT, // not yet used by axiom-ai\n EncodingFormats: ATTR_GEN_AI_REQUEST_ENCODING_FORMATS, // not yet used by axiom-ai\n FrequencyPenalty: ATTR_GEN_AI_REQUEST_FREQUENCY_PENALTY,\n MaxTokens: ATTR_GEN_AI_REQUEST_MAX_TOKENS,\n /**\n * The model you asked for\n */\n Model: ATTR_GEN_AI_REQUEST_MODEL,\n PresencePenalty: ATTR_GEN_AI_REQUEST_PRESENCE_PENALTY,\n Seed: ATTR_GEN_AI_REQUEST_SEED,\n StopSequences: ATTR_GEN_AI_REQUEST_STOP_SEQUENCES,\n Temperature: ATTR_GEN_AI_REQUEST_TEMPERATURE,\n TopK: ATTR_GEN_AI_REQUEST_TOP_K,\n TopP: ATTR_GEN_AI_REQUEST_TOP_P,\n },\n Response: {\n FinishReasons: ATTR_GEN_AI_RESPONSE_FINISH_REASONS,\n ID: ATTR_GEN_AI_RESPONSE_ID,\n /**\n * The model that was actually used (might be different bc routing) - only ever get this from the response, otherwise omit\n */\n Model: ATTR_GEN_AI_RESPONSE_MODEL, // somehow not landing on the span for google models? check up on this...\n },\n Tool: {\n CallID: ATTR_GEN_AI_TOOL_CALL_ID,\n Description: ATTR_GEN_AI_TOOL_DESCRIPTION,\n Name: ATTR_GEN_AI_TOOL_NAME,\n Type: ATTR_GEN_AI_TOOL_TYPE,\n /**\n * Note, OTel Semantic Convention suggest only putting tool inputs/outputs on the parent chat span\n * But we at least want to give users THE OPTION to put them on the tool spans themselves as well\n * Because it enables a lot of things with querying\n * @see https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.37.0\n */\n Arguments: ATTR_GEN_AI_TOOL_ARGUMENTS,\n /**\n * Note, OTel Semantic Convention suggest only putting tool inputs/outputs on the parent chat span\n * But we at least want to give users THE OPTION to put them on the tool spans themselves as well\n * Because it enables a lot of things with querying\n * @see https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.37.0\n */\n Message: ATTR_GEN_AI_TOOL_MESSAGE,\n },\n Usage: {\n InputTokens: ATTR_GEN_AI_USAGE_INPUT_TOKENS,\n OutputTokens: ATTR_GEN_AI_USAGE_OUTPUT_TOKENS,\n },\n },\n Eval: {\n ID: ATTR_EVAL_ID,\n Name: ATTR_EVAL_NAME,\n Version: ATTR_EVAL_VERSION,\n Type: ATTR_EVAL_TYPE,\n Trials: ATTR_EVAL_TRIALS,\n Baseline: {\n ID: ATTR_EVAL_BASELINE_ID,\n Name: ATTR_EVAL_BASELINE_NAME,\n Version: ATTR_EVAL_BASELINE_VERSION,\n },\n Capability: {\n Name: ATTR_EVAL_CAPABILITY_NAME,\n },\n Step: {\n Name: ATTR_EVAL_STEP_NAME,\n },\n Tags: ATTR_EVAL_TAGS,\n Metadata: ATTR_EVAL_METADATA,\n Collection: {\n ID: ATTR_EVAL_COLLECTION_ID,\n Name: ATTR_EVAL_COLLECTION_NAME,\n Size: ATTR_EVAL_COLLECTION_SIZE,\n },\n Config: {\n Flags: ATTR_EVAL_CONFIG_FLAGS,\n },\n Run: {\n ID: ATTR_EVAL_RUN_ID,\n },\n Trial: {\n Index: ATTR_EVAL_TRIAL_INDEX,\n Error: ATTR_EVAL_TRIAL_ERROR,\n },\n Case: {\n Index: ATTR_EVAL_CASE_INDEX,\n Input: ATTR_EVAL_CASE_INPUT,\n Output: ATTR_EVAL_CASE_OUTPUT,\n Expected: ATTR_EVAL_CASE_EXPECTED,\n Scores: ATTR_EVAL_CASE_SCORES,\n Metadata: ATTR_EVAL_CASE_METADATA,\n Trials: ATTR_EVAL_CASE_TRIALS,\n },\n Task: {\n Output: ATTR_EVAL_TASK_OUTPUT,\n Name: ATTR_EVAL_TASK_NAME,\n Type: ATTR_EVAL_TASK_TYPE,\n },\n Score: {\n Name: ATTR_EVAL_SCORE_NAME,\n Value: ATTR_EVAL_SCORE_VALUE,\n Threshold: ATTR_EVAL_SCORE_THRESHOLD,\n Passed: ATTR_EVAL_SCORE_PASSED,\n IsBoolean: ATTR_EVAL_SCORE_IS_BOOLEAN,\n Metadata: ATTR_EVAL_SCORE_METADATA,\n Aggregation: ATTR_EVAL_SCORE_AGGREGATION,\n Trials: ATTR_EVAL_SCORE_TRIALS,\n },\n User: {\n Name: ATTR_EVAL_USER_NAME,\n Email: ATTR_EVAL_USER_EMAIL,\n },\n },\n Error: {\n Type: ATTR_ERROR_TYPE,\n Message: ATTR_ERROR_MESSAGE,\n },\n HTTP: {\n Response: {\n StatusCode: ATTR_HTTP_RESPONSE_STATUS_CODE,\n },\n },\n} as const;\n","// experiment\nexport const ATTR_EVAL_ID = 'eval.id' as const;\nexport const ATTR_EVAL_NAME = 'eval.name' as const;\nexport const ATTR_EVAL_VERSION = 'eval.version' as const;\nexport const ATTR_EVAL_TYPE = 'eval.type' as const;\nexport const ATTR_EVAL_TAGS = 'eval.tags' as const;\nexport const ATTR_EVAL_BASELINE_ID = 'eval.baseline.id' as const;\nexport const ATTR_EVAL_BASELINE_NAME = 'eval.baseline.name' as const;\nexport const ATTR_EVAL_BASELINE_VERSION = 'eval.baseline.version' as const;\nexport const ATTR_EVAL_METADATA = 'eval.metadata' as const;\nexport const ATTR_EVAL_TRIALS = 'eval.trials' as const;\n// capability\nexport const ATTR_EVAL_CAPABILITY_NAME = 'eval.capability.name' as const;\nexport const ATTR_EVAL_STEP_NAME = 'eval.step.name' as const;\n// collection\nexport const ATTR_EVAL_COLLECTION_ID = 'eval.collection.id' as const;\nexport const ATTR_EVAL_COLLECTION_SIZE = 'eval.collection.size' as const;\nexport const ATTR_EVAL_COLLECTION_NAME = 'eval.collection.name' as const;\n// config\nexport const ATTR_EVAL_CONFIG_FLAGS = 'eval.config.flags' as const;\n// case\nexport const ATTR_EVAL_CASE_INDEX = 'eval.case.index' as const;\nexport const ATTR_EVAL_CASE_INPUT = 'eval.case.input' as const;\nexport const ATTR_EVAL_CASE_OUTPUT = 'eval.case.output' as const;\nexport const ATTR_EVAL_CASE_EXPECTED = 'eval.case.expected' as const;\nexport const ATTR_EVAL_CASE_SCORES = 'eval.case.scores' as const;\nexport const ATTR_EVAL_CASE_METADATA = 'eval.case.metadata' as const;\nexport const ATTR_EVAL_CASE_TRIALS = 'eval.case.trials' as const;\n// trial\nexport const ATTR_EVAL_TRIAL_INDEX = 'eval.trial.index' as const;\nexport const ATTR_EVAL_TRIAL_ERROR = 'eval.trial.error' as const;\n// task\nexport const ATTR_EVAL_TASK_OUTPUT = 'eval.task.output' as const;\nexport const ATTR_EVAL_TASK_NAME = 'eval.task.name' as const;\nexport const ATTR_EVAL_TASK_TYPE = 'eval.task.type' as const;\n// run\nexport const ATTR_EVAL_RUN_ID = 'eval.run.id' as const;\n// score\nexport const ATTR_EVAL_SCORE_NAME = 'eval.score.name' as const;\nexport const ATTR_EVAL_SCORE_VALUE = 'eval.score.value' as const;\nexport const ATTR_EVAL_SCORE_THRESHOLD = 'eval.score.threshold' as const;\nexport const ATTR_EVAL_SCORE_PASSED = 'eval.score.passed' as const;\nexport const ATTR_EVAL_SCORE_IS_BOOLEAN = 'eval.score.is_boolean' as const;\nexport const ATTR_EVAL_SCORE_SCORER = 'eval.score.scorer' as const;\nexport const ATTR_EVAL_SCORE_METADATA = 'eval.score.metadata' as const;\nexport const ATTR_EVAL_SCORE_AGGREGATION = 'eval.score.aggregation' as const;\nexport const ATTR_EVAL_SCORE_TRIALS = 'eval.score.trials' as const;\n// user\nexport const ATTR_EVAL_USER_NAME = 'eval.user.name';\nexport const ATTR_EVAL_USER_EMAIL = 'eval.user.email';\n","/**\n * Utility functions for formatting tool calls in completion array format\n */\n\nimport type { LanguageModelV1FunctionToolCall } from '@ai-sdk/providerv1';\nimport { sanitizeMultimodalContent } from './utils/contentSanitizer';\nimport type {\n CompletionArray,\n FormatToolCallsOptions,\n FormattedCompletionResult,\n} from './completionTypes';\nimport type { OpenAIMessage, OpenAIAssistantMessage, OpenAIToolMessage } from './vercelTypes';\n\n/**\n * Converts OpenAI messages to completion array format\n */\nfunction convertToCompletionMessages(messages: OpenAIMessage[]): OpenAIMessage[] {\n return messages.map((message): OpenAIMessage => {\n switch (message.role) {\n case 'system':\n return {\n role: 'system',\n content: message.content,\n };\n\n case 'user':\n return {\n role: 'user',\n content: sanitizeMultimodalContent(message.content) as string | any[],\n };\n\n case 'assistant':\n return {\n role: 'assistant',\n content: sanitizeMultimodalContent(message.content) as string | null,\n tool_calls: message.tool_calls?.map((toolCall) => ({\n id: toolCall.id,\n type: 'function' as const,\n function: {\n name: toolCall.function.name,\n arguments: toolCall.function.arguments,\n },\n })),\n };\n\n case 'tool':\n return {\n role: 'tool',\n content: message.content,\n tool_call_id: message.tool_call_id,\n };\n\n default:\n throw new Error(`Unknown message role: ${(message as any).role}`);\n }\n });\n}\n\n/**\n * Creates tool result messages from tool execution results\n */\nfunction createToolResultMessages(\n toolResults: Array<{\n toolCallId: string;\n result: unknown;\n }>,\n): OpenAIToolMessage[] {\n return toolResults.map((result) => ({\n role: 'tool' as const,\n content: typeof result.result === 'string' ? result.result : JSON.stringify(result.result),\n tool_call_id: result.toolCallId,\n }));\n}\n\n/**\n * Main function to format tool calls in completion array format\n * Transforms AI SDK tool calls into the completion array structure\n */\nexport function formatToolCallsInCompletion(\n options: FormatToolCallsOptions,\n): FormattedCompletionResult {\n const { promptMessages = [], text, toolCalls = [], toolResults = [] } = options;\n\n // Convert prompt messages to completion format\n const historyMessages = convertToCompletionMessages(promptMessages);\n\n // Create assistant message with tool calls\n const assistantMessage: OpenAIAssistantMessage = {\n role: 'assistant',\n content: text ?? (toolCalls.length > 0 ? null : ''),\n };\n\n // Add tool calls if present\n if (toolCalls.length > 0) {\n assistantMessage.tool_calls = toolCalls.map((toolCall) => ({\n id: toolCall.id,\n type: 'function' as const,\n function: {\n name: toolCall.toolName,\n arguments: toolCall.args,\n },\n }));\n }\n\n // Create tool result messages\n const toolMessages = createToolResultMessages(toolResults);\n\n // Build complete completion array\n const completion: CompletionArray = [...historyMessages, assistantMessage, ...toolMessages];\n\n return {\n completion,\n assistantMessage,\n toolMessages,\n };\n}\n\n/**\n * Creates a simple completion array with just assistant text response\n * Used for V1 model wrapper where tool calls are handled separately\n */\nexport function createSimpleCompletion({ text }: { text?: string }): CompletionArray {\n // Create assistant message with text only\n const assistantMessage: OpenAIAssistantMessage = {\n role: 'assistant',\n content: text ?? '',\n };\n\n return [assistantMessage];\n}\n\n/**\n * Formats V2 tool calls for completion array\n * Convenience function for V2 model wrapper\n */\nexport function formatV2ToolCallsInCompletion({\n promptMessages = [],\n text,\n toolCalls = [],\n}: {\n promptMessages?: OpenAIMessage[];\n text?: string;\n toolCalls?: Array<{\n toolCallId: string;\n toolName: string;\n args: unknown;\n }>;\n}): CompletionArray {\n // Convert prompt messages\n const historyMessages = convertToCompletionMessages(promptMessages);\n\n // Create assistant message\n const assistantMessage: OpenAIAssistantMessage = {\n role: 'assistant',\n content: text ?? (toolCalls.length > 0 ? null : ''),\n };\n\n // Add tool calls if present\n if (toolCalls.length > 0) {\n assistantMessage.tool_calls = toolCalls.map((toolCall) => ({\n id: toolCall.toolCallId,\n type: 'function' as const,\n function: {\n name: toolCall.toolName,\n arguments:\n typeof toolCall.args === 'string' ? toolCall.args : JSON.stringify(toolCall.args),\n },\n }));\n }\n\n return [...historyMessages, assistantMessage];\n}\n\n/**\n * Aggregates tool call chunks for streaming responses\n * Handles partial tool calls and builds complete tool call objects\n */\nexport function aggregateStreamingToolCalls(\n chunks: Array<{\n toolCallId?: string;\n toolName?: string;\n argsTextDelta?: string;\n }>,\n): LanguageModelV1FunctionToolCall[] {\n const toolCallMap = new Map<\n string,\n {\n toolCallId: string;\n toolName: string;\n args: string;\n }\n >();\n\n for (const chunk of chunks) {\n if (!chunk.toolCallId) continue;\n\n const existing = toolCallMap.get(chunk.toolCallId);\n if (existing) {\n // Append args delta\n existing.args += chunk.argsTextDelta || '';\n } else {\n // Create new tool call entry\n toolCallMap.set(chunk.toolCallId, {\n toolCallId: chunk.toolCallId,\n toolName: chunk.toolName || '',\n args: chunk.argsTextDelta || '',\n });\n }\n }\n\n return Array.from(toolCallMap.values()).map((call) => ({\n ...call,\n toolCallType: 'function' as const,\n }));\n}\n","/**\n * Utilities for sanitizing multimodal content in telemetry data\n * Replaces large binary content with metadata while preserving structure\n */\n\nimport { createHash } from 'crypto';\n\ninterface ImageMetadata {\n format?: string;\n size_bytes?: number;\n hash: string;\n is_data_url: boolean;\n dimensions?: string;\n}\n\n/**\n * Extracts metadata from an image URL (data URL or external URL)\n */\nfunction extractImageMetadata(url: string): ImageMetadata {\n if (url.startsWith('data:')) {\n // Parse data URL: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ...\n const [header, base64Data] = url.split(',');\n const formatMatch = header.match(/data:image\\/(\\w+)/);\n const format = formatMatch?.[1];\n\n // Estimate size from base64 data\n const sizeBytes = base64Data ? Math.floor((base64Data.length * 3) / 4) : 0;\n\n // Create a short hash of the content for identification\n const hash = base64Data\n ? createHash('sha256').update(base64Data).digest('hex').slice(0, 16)\n : 'unknown';\n\n return {\n format,\n size_bytes: sizeBytes,\n hash,\n is_data_url: true,\n };\n } else {\n // External URL - create hash of the URL itself\n const hash = createHash('sha256').update(url).digest('hex').slice(0, 16);\n return {\n hash,\n is_data_url: false,\n };\n }\n}\n\n/**\n * Sanitizes an image URL by replacing large data URLs with metadata\n */\nfunction sanitizeImageUrl(url: string, detail?: string) {\n const metadata = extractImageMetadata(url);\n\n if (metadata.is_data_url) {\n // Replace data URL with reference\n const formatPart = metadata.format ? `:${metadata.format}` : '';\n const sizePart = metadata.size_bytes ? `:${metadata.size_bytes}b` : '';\n return {\n url: `[IMAGE${formatPart}${sizePart}:${metadata.hash}]`,\n detail,\n ...metadata,\n };\n } else {\n // Keep external URLs but add metadata\n return {\n url,\n detail,\n ...metadata,\n };\n }\n}\n\ntype SanitizedContent<T> = T extends readonly unknown[] ? unknown[] : T;\n\n/**\n * Sanitizes any multimodal content for telemetry purposes\n * This is the main function that should be used throughout the codebase\n */\nexport function sanitizeMultimodalContent<T>(content: T): SanitizedContent<T> {\n if (Array.isArray(content)) {\n return content.map((part) => {\n if (part && typeof part === 'object' && 'type' in part && part.type === 'image_url') {\n const imagePart = part;\n if (imagePart.image_url?.url) {\n return {\n ...part,\n image_url: sanitizeImageUrl(imagePart.image_url.url, imagePart.image_url.detail),\n };\n }\n }\n return part;\n }) as SanitizedContent<T>;\n }\n\n return content as SanitizedContent<T>;\n}\n","import type { LanguageModelV1FunctionToolCall } from '@ai-sdk/providerv1';\nimport type { NormalizedToolCall } from '../otel/utils/normalized';\nimport type { LanguageModelV2Prompt } from '@ai-sdk/providerv2';\nimport type { LanguageModelV3Prompt } from '@ai-sdk/providerv3';\nimport type { OpenAIMessage } from '../otel/vercelTypes';\n\nexport type ToolResultMap = Map<string, unknown>;\n\n/**\n * Appends tool calls and their results to a conversation prompt.\n *\n * This function takes an existing conversation prompt and adds:\n * 1. An assistant message containing the tool calls\n * 2. Tool result messages for each tool call with results\n *\n * @param prompt - The existing conversation prompt\n * @param toolCalls - The tool calls made by the assistant\n * @param toolResults - Map of tool names to their results\n * @param assistantContent - Optional assistant message content to include with tool calls\n * @returns Updated prompt with tool calls and results appended\n */\nexport function appendToolCalls(\n prompt: OpenAIMessage[],\n toolCalls: LanguageModelV1FunctionToolCall[] | NormalizedToolCall[],\n toolResults: ToolResultMap,\n assistantContent?: string | null,\n): OpenAIMessage[] {\n const updatedPrompt = [...prompt];\n\n // Add assistant message with tool calls\n updatedPrompt.push({\n role: 'assistant',\n content: assistantContent || null,\n tool_calls: toolCalls.map((toolCall) => ({\n id: toolCall.toolCallId,\n function: {\n name: toolCall.toolName,\n arguments:\n typeof toolCall.args === 'string' ? toolCall.args : JSON.stringify(toolCall.args),\n },\n type: 'function',\n })),\n });\n\n // Add tool result messages with real data\n for (const toolCall of toolCalls) {\n const realToolResult = toolResults.get(toolCall.toolName);\n\n if (realToolResult) {\n updatedPrompt.push({\n role: 'tool',\n tool_call_id: toolCall.toolCallId,\n content: JSON.stringify(realToolResult),\n });\n }\n }\n\n return updatedPrompt;\n}\n\n/**\n * Extracts tool results from a raw prompt array.\n *\n * Searches through different message formats to find tool results:\n * - Google AI format: user messages with functionResponse parts\n * - OpenAI format: tool role messages (future enhancement)\n *\n * @param rawPrompt - The raw prompt array from the model provider\n * @returns Map of tool names to their results\n */\n// TODO: @cje - This should be typed based on the specific provider's raw prompt format\n// but it needs to handle multiple providers (Google AI, OpenAI, etc.)\nexport function extractToolResultsFromRawPrompt(rawPrompt: any[]): Map<string, unknown> {\n const toolResultsMap = new Map<string, unknown>();\n\n if (!Array.isArray(rawPrompt)) {\n return toolResultsMap;\n }\n\n // Look for tool results in different message formats\n for (const message of rawPrompt) {\n // Google AI format: user message with functionResponse parts\n if (message?.role === 'user' && Array.isArray(message.parts)) {\n for (const part of message.parts) {\n if (part?.functionResponse) {\n const functionResponse = part.functionResponse;\n if (functionResponse.name && functionResponse.response) {\n // Store by function name since that's what we have access to\n toolResultsMap.set(\n functionResponse.name,\n functionResponse.response.content || functionResponse.response,\n );\n }\n }\n }\n }\n\n // OpenAI format: tool role messages with tool_call_id\n if (message?.role === 'tool' && message?.tool_call_id && message?.content) {\n // For OpenAI format, we'd need to map back from tool_call_id to tool name\n // This is more complex as we'd need to track the tool calls first\n // For now, we'll skip this but it could be implemented later\n }\n }\n\n return toolResultsMap;\n}\n\n/**\n * Extracts tool results from a V2 prompt structure.\n *\n * V2 prompts use a \"parts\" array structure where:\n * - Tool calls are in assistant messages as 'tool-call' parts\n * - Tool results are in 'tool' role messages as 'tool-result' parts with 'output' property\n *\n * @param prompt - The V2 prompt array\n * @returns Map of tool names to their results\n */\nexport function extractToolResultsFromPromptV2(\n prompt: LanguageModelV2Prompt,\n): Map<string, unknown> {\n const idToName = new Map<string, string>();\n const results = new Map<string, unknown>();\n\n // 1. Collect tool-call ids → names from assistant messages\n for (const message of prompt) {\n if (message.role === 'assistant' && Array.isArray(message.content)) {\n for (const part of message.content) {\n if (part.type === 'tool-call') {\n idToName.set(part.toolCallId, part.toolName);\n }\n }\n }\n }\n\n // 2. Collect tool results from tool role messages\n for (const message of prompt) {\n if (message.role === 'tool' && Array.isArray(message.content)) {\n for (const part of message.content) {\n // In V2, tool result parts have toolCallId and result properties\n if (part.toolCallId && part.output !== undefined) {\n const toolName = idToName.get(part.toolCallId);\n if (toolName) {\n results.set(toolName, part.output);\n }\n }\n }\n }\n }\n\n return results;\n}\n\n/**\n * Extracts tool results from a V3 prompt structure.\n *\n * V3 prompts are very similar to V2 but with slightly different typing:\n * - Tool calls are in assistant messages as 'tool-call' parts\n * - Tool results are in 'tool' role messages as 'tool-result' parts with 'output' property\n * - Also includes 'tool-approval-response' parts which we skip\n *\n * @param prompt - The V3 prompt array\n * @returns Map of tool names to their results\n */\nexport function extractToolResultsFromPromptV3(\n prompt: LanguageModelV3Prompt,\n): Map<string, unknown> {\n const idToName = new Map<string, string>();\n const results = new Map<string, unknown>();\n\n // 1. Collect tool-call ids → names from assistant messages\n for (const message of prompt) {\n if (message.role === 'assistant' && Array.isArray(message.content)) {\n for (const part of message.content) {\n if (part.type === 'tool-call') {\n idToName.set(part.toolCallId, part.toolName);\n }\n }\n }\n }\n\n // 2. Collect tool results from tool role messages\n for (const message of prompt) {\n if (message.role === 'tool' && Array.isArray(message.content)) {\n for (const part of message.content) {\n // In V3, tool result parts have toolCallId and output properties\n // Skip tool-approval-response parts\n if (part.type === 'tool-result' && part.toolCallId && part.output !== undefined) {\n const toolName = idToName.get(part.toolCallId);\n if (toolName) {\n results.set(toolName, part.output);\n }\n }\n }\n }\n }\n\n return results;\n}\n","import {\n trace,\n context,\n propagation,\n type Span,\n type Tracer,\n SpanStatusCode,\n type AttributeValue,\n} from '@opentelemetry/api';\nimport { Attr } from '../semconv/attributes';\nimport { SCHEMA_URL } from '../../schema';\nimport { WITHSPAN_BAGGAGE_KEY } from '../withSpanBaggageKey';\nimport { createStartActiveSpan } from '../startActiveSpan';\n\nimport { getGlobalTracer } from '../initAxiomAI';\nimport packageJson from '../../../package.json';\nimport type { OpenAIMessage } from '../vercelTypes';\nimport type { LanguageModelV2Prompt } from '@ai-sdk/providerv2';\nimport type { LanguageModelV3Prompt } from '@ai-sdk/providerv3';\n\n/**\n * Common span context discriminated union for V1, V2 and V3\n */\ntype GenAiSpanContext =\n | {\n version: 'v1';\n originalPrompt: OpenAIMessage[];\n rawCall?: {\n rawPrompt?: unknown[];\n rawSettings?: unknown;\n };\n }\n | {\n version: 'v2';\n originalPrompt: OpenAIMessage[];\n originalV2Prompt?: LanguageModelV2Prompt;\n }\n | {\n version: 'v3';\n originalPrompt: OpenAIMessage[];\n originalV3Prompt?: LanguageModelV3Prompt;\n };\n\nexport type GenAiSpanContextV1 = Extract<GenAiSpanContext, { version: 'v1' }>;\nexport type GenAiSpanContextV2 = Extract<GenAiSpanContext, { version: 'v2' }>;\nexport type GenAiSpanContextV3 = Extract<GenAiSpanContext, { version: 'v3' }>;\n\n/**\n * SpanLease represents ownership of a span's lifecycle\n * - owned: true means the middleware created the span and must end it\n * - owned: false means the span is owned by withSpan and middleware must NOT end it\n */\nexport interface SpanLease {\n owned: boolean;\n end: () => void;\n}\n\n/**\n * Safely converts a value to a number, handling string inputs from providers.\n * Some AI providers may return token counts as strings instead of numbers.\n *\n * @returns The numeric value, or undefined if the input is not a valid number\n */\nexport function ensureNumber(value: unknown): number | undefined {\n const v =\n typeof value === 'number' ? value : typeof value === 'string' ? Number(value) : undefined;\n if (Number.isNaN(v)) return undefined;\n if (v === Infinity || v === -Infinity) return undefined;\n return v;\n}\n\n/**\n * Classifies errors into low-cardinality types for OpenTelemetry error.type attribute\n * Reference: OTel spec § 7.22.5 for error.type guidelines\n *\n * Uses explicit mapping for useful error types, avoiding generic built-in errors\n * that are not actionable for observability dashboards.\n *\n * @returns string for actionable error types, undefined for unclassifiable errors\n */\nfunction classifyError(err: unknown): string | undefined {\n if (err == null) return undefined;\n\n if (err instanceof Error) {\n const name = err.name.toLowerCase();\n\n // Explicit mapping for actionable error types\n if (name.includes('timeout')) return 'timeout';\n if (name.includes('abort')) return 'timeout'; // AbortError often means timeout\n if (name.includes('network') || name.includes('fetch')) return 'network';\n if (name.includes('validation')) return 'validation';\n if (name.includes('auth')) return 'authentication';\n if (name.includes('parse') || name.includes('json')) return 'parsing';\n if (name.includes('permission') || name.includes('forbidden')) return 'authorization';\n if (name.includes('rate') && name.includes('limit')) return 'rate_limit';\n if (name.includes('quota') || name.includes('limit')) return 'quota_exceeded';\n\n // Skip generic built-in errors (TypeError, ReferenceError, etc.)\n // They're not useful for observability dashboards\n return undefined;\n }\n\n return undefined; // Handles primitives thrown as errors\n}\n\n/**\n * Classifies tool-specific errors using duck-typing for cross-vendor compatibility\n * Handles node-fetch version differences and external API error patterns\n *\n * @param err The error to classify\n * @param span The span to set error attributes on\n */\nexport function classifyToolError(err: unknown, span: Span): void {\n // Enhanced error handling for OpenTelemetry compliance\n if (err instanceof Error) {\n span.recordException(err); // Error objects are compatible with Exception interface\n } else {\n // Convert primitives to compatible format\n span.recordException({\n message: String(err),\n name: 'UnknownError',\n });\n }\n\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err instanceof Error ? err.message : String(err),\n });\n\n let errorType = 'unknown';\n let statusCode: string | number | undefined;\n\n // Duck-type check for common error patterns (don't rely on inheritance)\n if (err && typeof err === 'object') {\n const errObj = err as any;\n const name = errObj.name?.toLowerCase() || '';\n const message = errObj.message?.toLowerCase() || '';\n\n if (name.includes('timeout') || name.includes('abort') || message.includes('timeout')) {\n errorType = 'timeout';\n } else if (\n name.includes('validation') ||\n errObj.code === 'VALIDATION_ERROR' ||\n message.includes('validation')\n ) {\n errorType = 'validation';\n } else if (\n name.includes('fetch') ||\n name.includes('network') ||\n message.includes('network') ||\n message.includes('fetch failed')\n ) {\n errorType = 'network';\n // Handle both node-fetch v2 (.code) and v3 (.status) patterns\n statusCode = errObj.status || errObj.code;\n } else if (\n name.includes('auth') ||\n message.includes('auth') ||\n message.includes('unauthorized')\n ) {\n errorType = 'authentication';\n } else if (\n name.includes('permission') ||\n name.includes('forbidden') ||\n message.includes('forbidden')\n ) {\n errorType = 'authorization';\n } else if (\n name.includes('rate') &&\n (name.includes('limit') || message.includes('rate limit'))\n ) {\n errorType = 'rate_limit';\n } else if (\n name.includes('quota') ||\n message.includes('quota') ||\n message.includes('limit exceeded')\n ) {\n errorType = 'quota_exceeded';\n } else if (\n name.includes('parse') ||\n name.includes('json') ||\n message.includes('json') ||\n message.includes('parse')\n ) {\n errorType = 'parsing';\n }\n }\n\n // MANDATORY: Standard OpenTelemetry error attributes\n span.setAttribute(Attr.Error.Type, errorType);\n if (err instanceof Error && err.message) {\n span.setAttribute(Attr.Error.Message, err.message);\n }\n\n // Standard HTTP attributes for network errors\n if (statusCode !== undefined) {\n span.setAttribute(Attr.HTTP.Response.StatusCode, statusCode as AttributeValue);\n }\n}\n\n/**\n * Check if the current tracer provider is a no-op\n * Uses safer detection that works with bundling/minification\n */\nfunction isNoOpTracerProvider(): boolean {\n const provider = trace.getTracerProvider();\n\n // Check constructor name (may fail with bundling/minification)\n if (provider.constructor.name === 'NoopTracerProvider') {\n return true;\n }\n\n // Check if getTracer method exists before calling it (for test mocks)\n if (typeof (provider as any).getTracer !== 'function') {\n return true;\n }\n\n return false;\n}\n\n/**\n * Gets the appropriate tracer instance using global scope or fallbacks\n */\nexport function getTracer(): Tracer {\n const tracer = getGlobalTracer();\n\n if (isNoOpTracerProvider()) {\n const isDebug = process.env.AXIOM_DEBUG === 'true';\n if (!isDebug) {\n console.warn(\n '[AxiomAI] No TracerProvider registered - spans will be no-op. ' +\n 'Make sure to call initAxiomAI() after your OpenTelemetry SDK has started (sdk.start()).',\n );\n }\n }\n\n return tracer;\n}\n\n/**\n * Creates a standardized span name for GenAI operations\n */\nfunction createGenAISpanName(operation: string, suffix?: string): string {\n return suffix ? `${operation} ${suffix}` : operation;\n}\n\n/**\n * Sets common scope attributes on a span from baggage\n */\nexport function setScopeAttributes(span: Span): void {\n const bag = propagation.getActiveBaggage();\n\n if (bag) {\n const capability = bag.getEntry('capability')?.value;\n if (capability) {\n span.setAttribute(Attr.GenAI.Capability.Name, capability);\n }\n\n const step = bag.getEntry('step')?.value;\n if (step) {\n span.setAttribute(Attr.GenAI.Step.Name, step);\n }\n\n const conversationId = bag.getEntry('conversationId')?.value;\n if (conversationId) {\n span.setAttribute(Attr.GenAI.Conversation.ID, conversationId);\n }\n }\n}\n\n/**\n * Sets Axiom-specific base attributes on a span\n */\nexport function setAxiomBaseAttributes(span: Span): void {\n span.setAttributes({\n [Attr.Axiom.GenAI.SchemaURL]: SCHEMA_URL,\n [Attr.Axiom.GenAI.SDK.Name]: packageJson.name,\n [Attr.Axiom.GenAI.SDK.Version]: packageJson.version,\n });\n}\n\n/**\n * Sets common base attributes on a span\n */\nexport function setBaseAttributes(span: Span, provider: string, modelId: string): void {\n span.setAttributes({\n [Attr.GenAI.Operation.Name]: Attr.GenAI.Operation.Name_Values.Chat,\n [Attr.GenAI.Request.Model]: modelId,\n });\n\n const systemValue = mapVercelSDKProviderToOTelProvider(provider);\n if (systemValue) {\n span.setAttribute(Attr.GenAI.Provider.Name, systemValue);\n }\n\n setAxiomBaseAttributes(span);\n}\n\n/**\n * Sets common request parameter attributes on a span\n */\nexport function setRequestParameterAttributes(\n span: Span,\n params: {\n maxTokens?: number;\n frequencyPenalty?: number;\n presencePenalty?: number;\n temperature?: number;\n topP?: number;\n topK?: number;\n seed?: number;\n stopSequences?: string[];\n },\n): void {\n const {\n maxTokens,\n frequencyPenalty,\n presencePenalty,\n temperature,\n topP,\n topK,\n seed,\n stopSequences,\n } = params;\n\n if (maxTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Request.MaxTokens, maxTokens);\n }\n if (frequencyPenalty !== undefined) {\n span.setAttribute(Attr.GenAI.Request.FrequencyPenalty, frequencyPenalty);\n }\n if (presencePenalty !== undefined) {\n span.setAttribute(Attr.GenAI.Request.PresencePenalty, presencePenalty);\n }\n if (temperature !== undefined) {\n span.setAttribute(Attr.GenAI.Request.Temperature, temperature);\n }\n if (topP !== undefined) {\n span.setAttribute(Attr.GenAI.Request.TopP, topP);\n }\n if (topK !== undefined) {\n span.setAttribute(Attr.GenAI.Request.TopK, topK);\n }\n if (seed !== undefined) {\n span.setAttribute(Attr.GenAI.Request.Seed, seed);\n }\n if (stopSequences && stopSequences.length > 0) {\n span.setAttribute(Attr.GenAI.Request.StopSequences, JSON.stringify(stopSequences));\n }\n}\n\n/**\n * Creates a child span for stream processing\n * This provides granular visibility into stream consumption phases\n */\nexport function createStreamChildSpan(parentSpan: Span, operationName: string): Span {\n const tracer = getTracer();\n\n // Create child span by setting parent context\n const ctx = context.active();\n const spanContext = trace.setSpan(ctx, parentSpan);\n const childSpan = tracer.startSpan(operationName, undefined, spanContext);\n\n return childSpan;\n}\n\n/**\n * Records an error on a span with proper classification and attributes\n * Consolidates all error handling logic in one place\n */\nfunction recordSpanError(span: Span, err: unknown): void {\n // Enhanced error handling for OpenTelemetry compliance\n if (err instanceof Error) {\n span.recordException(err);\n } else {\n span.recordException({\n message: String(err),\n name: 'UnknownError',\n });\n }\n\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err instanceof Error ? err.message : String(err),\n });\n\n // MANDATORY: Add OpenTelemetry error attributes for cross-vendor compatibility\n const errorType = classifyError(err);\n span.setAttribute(Attr.Error.Type, errorType ?? 'unknown');\n\n // OPTIONAL: Add human-readable error message\n if (err instanceof Error && err.message) {\n span.setAttribute(Attr.Error.Message, err.message);\n }\n\n // For Vercel AI SDK specific errors, add HTTP status if available\n if (err && typeof err === 'object' && 'status' in err) {\n span.setAttribute(Attr.HTTP.Response.StatusCode, err.status as AttributeValue);\n }\n}\n\n/**\n * Common span handling logic for V1, V2 and V3\n * Returns a SpanLease that indicates whether the middleware owns the span\n */\nexport async function withSpanHandling<T>(\n modelId: string,\n operation: (span: Span, context: GenAiSpanContext, lease: SpanLease) => Promise<T>,\n options?: { streaming?: boolean; version?: 'v1' | 'v2' | 'v3' },\n): Promise<T> {\n const bag = propagation.getActiveBaggage();\n const isWithinWithSpan = bag?.getEntry(WITHSPAN_BAGGAGE_KEY)?.value === 'true';\n\n const spanContext: GenAiSpanContext =\n options?.version === 'v3'\n ? { version: 'v3', originalPrompt: [], originalV3Prompt: undefined }\n : options?.version === 'v2'\n ? { version: 'v2', originalPrompt: [], originalV2Prompt: undefined }\n : { version: 'v1', originalPrompt: [], rawCall: undefined };\n\n const name = createGenAISpanName(Attr.GenAI.Operation.Name_Values.Chat, modelId);\n\n if (isWithinWithSpan) {\n // Reuse existing span created by withSpan - we don't own it\n const activeSpan = trace.getActiveSpan();\n if (!activeSpan) {\n throw new Error('Expected active span when within withSpan');\n }\n activeSpan.updateName(name);\n\n const lease: SpanLease = {\n owned: false,\n end: () => {}, // No-op: we don't own this span\n };\n\n try {\n return await operation(activeSpan, spanContext, lease);\n } catch (err) {\n recordSpanError(activeSpan, err);\n throw err;\n }\n } else {\n // Create new span - we own it\n const tracer = getTracer();\n const startActiveSpan = createStartActiveSpan(tracer);\n\n return startActiveSpan(\n name,\n null,\n async (span) => {\n const lease: SpanLease = {\n owned: true,\n end: () => span.end(),\n };\n return await operation(span, spanContext, lease);\n },\n {\n manualEnd: options?.streaming ?? false,\n onError: (err, span) => {\n // createStartActiveSpan already calls span.recordException()\n // We only need to add our custom error classification attributes\n const errorType = classifyError(err);\n span.setAttribute(Attr.Error.Type, errorType ?? 'unknown');\n\n if (err instanceof Error && err.message) {\n span.setAttribute(Attr.Error.Message, err.message);\n }\n\n if (err && typeof err === 'object' && 'status' in err) {\n span.setAttribute(Attr.HTTP.Response.StatusCode, err.status as AttributeValue);\n }\n },\n },\n );\n }\n}\n\n/**\n * Sets common response attributes on a span\n */\nexport function setResponseAttributes(\n span: Span,\n response: {\n id?: string;\n modelId?: string;\n usage?: {\n inputTokens?: number;\n outputTokens?: number;\n promptTokens?: number;\n completionTokens?: number;\n };\n finishReason?: string;\n },\n): void {\n if (response.id) {\n span.setAttribute(Attr.GenAI.Response.ID, response.id);\n }\n if (response.modelId) {\n span.setAttribute(Attr.GenAI.Response.Model, response.modelId);\n }\n\n if (response.usage) {\n // Handle both V1 and V2 usage formats\n const inputTokens = ensureNumber(response.usage.inputTokens ?? response.usage.promptTokens);\n const outputTokens = ensureNumber(\n response.usage.outputTokens ?? response.usage.completionTokens,\n );\n\n if (inputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.InputTokens, inputTokens);\n }\n if (outputTokens !== undefined) {\n span.setAttribute(Attr.GenAI.Usage.OutputTokens, outputTokens);\n }\n }\n\n if (response.finishReason) {\n span.setAttribute(Attr.GenAI.Response.FinishReasons, JSON.stringify([response.finishReason]));\n }\n}\n\n/**\n * Determines output type from response format - V1 version\n */\nexport function determineOutputTypeV1(options: {\n responseFormat?: { type?: string };\n mode?: { type?: string };\n}): string | undefined {\n if (options.responseFormat?.type) {\n switch (options.responseFormat.type) {\n case 'json':\n return Attr.GenAI.Output.Type_Values.Json;\n case 'text':\n return Attr.GenAI.Output.Type_Values.Text;\n }\n }\n\n if (options.mode?.type === 'object-json' || options.mode?.type === 'object-tool') {\n return Attr.GenAI.Output.Type_Values.Json;\n }\n\n if (options.mode?.type === 'regular') {\n return Attr.GenAI.Output.Type_Values.Text;\n }\n\n return undefined;\n}\n\n/**\n * Determines output type from response format - V2 version\n */\nexport function determineOutputTypeV2(options: {\n responseFormat?: { type?: string };\n}): string | undefined {\n if (options.responseFormat?.type) {\n switch (options.responseFormat.type) {\n case 'json':\n return Attr.GenAI.Output.Type_Values.Json;\n case 'text':\n return Attr.GenAI.Output.Type_Values.Text;\n }\n }\n\n return undefined;\n}\n\n/**\n * Determines output type from response format - V3 version\n * V3 uses the same response format structure as V2\n */\nexport function determineOutputTypeV3(options: {\n responseFormat?: { type?: string };\n}): string | undefined {\n if (options.responseFormat?.type) {\n switch (options.responseFormat.type) {\n case 'json':\n return Attr.GenAI.Output.Type_Values.Json;\n case 'text':\n return Attr.GenAI.Output.Type_Values.Text;\n }\n }\n\n return undefined;\n}\n\n/**\n * Maps AI SDK provider IDs to OpenTelemetry gen_ai.provider.name values\n *\n * @param vercelSDKProvider - The provider ID from the AI SDK\n * @returns The corresponding `gen_ai.provider.name` value, or `undefined` if no match is found\n */\nexport function mapVercelSDKProviderToOTelProvider(vercelSDKProvider: string): string | undefined {\n if (vercelSDKProvider === 'openai-compatible') {\n // we don't know the real provider\n return undefined;\n }\n\n // exact matches\n switch (vercelSDKProvider) {\n case 'amazon-bedrock':\n return Attr.GenAI.Provider.Name_Values.AWSBedrock;\n case 'anthropic':\n case 'anthropic.messages':\n return Attr.GenAI.Provider.Name_Values.Anthropic;\n case 'assemblyai':\n case 'assemblyai.transcription':\n return Attr.GenAI.Provider.Name_Values.AssemblyAI;\n case 'deepgram':\n case 'deepgram.transcription':\n return Attr.GenAI.Provider.Name_Values.Deepgram;\n case 'gateway': // `import { gateway } from 'ai'`\n return Attr.GenAI.Provider.Name_Values.Vercel;\n case 'gladia':\n case 'gladia.transcription':\n return Attr.GenAI.Provider.Name_Values.Gladia;\n case 'google':\n case 'google.generative-ai':\n return Attr.GenAI.Provider.Name_Values.GCPGemini;\n case 'groq':\n return Attr.GenAI.Provider.Name_Values.Groq;\n case 'mistral':\n return Attr.GenAI.Provider.Name_Values.MistralAI;\n case 'openai':\n return Attr.GenAI.Provider.Name_Values.OpenAI;\n case 'perplexity':\n return Attr.GenAI.Provider.Name_Values.Perplexity;\n case 'replicate':\n return Attr.GenAI.Provider.Name_Values.Replicate;\n case 'revai':\n case 'revai.transcription':\n return Attr.GenAI.Provider.Name_Values.RevAI;\n case 'togetherai':\n return Attr.GenAI.Provider.Name_Values.TogetherAI;\n case 'xai':\n return Attr.GenAI.Provider.Name_Values.XAI;\n\n // startswith + fall through\n default: {\n if (vercelSDKProvider.startsWith('azure.')) {\n return Attr.GenAI.Provider.Name_Values.AzureAIOpenAI;\n }\n if (vercelSDKProvider.startsWith('cerebras.')) {\n return Attr.GenAI.Provider.Name_Values.Cerebras;\n }\n if (vercelSDKProvider.startsWith('cohere.')) {\n return Attr.GenAI.Provider.Name_Values.Cohere;\n }\n if (vercelSDKProvider.startsWith('deepinfra.')) {\n return Attr.GenAI.Provider.Name_Values.DeepInfra;\n }\n if (vercelSDKProvider.startsWith('deepseek.')) {\n return Attr.GenAI.Provider.Name_Values.Deepseek;\n }\n if (vercelSDKProvider.startsWith('elevenlabs.')) {\n return Attr.GenAI.Provider.Name_Values.ElevenLabs;\n }\n if (vercelSDKProvider.startsWith('fal.')) {\n return Attr.GenAI.Provider.Name_Values.Fal;\n }\n if (vercelSDKProvider.startsWith('fireworks.')) {\n return Attr.GenAI.Provider.Name_Values.Fireworks;\n }\n if (vercelSDKProvider.startsWith('google.vertex.')) {\n return Attr.GenAI.Provider.Name_Values.GCPVertexAI;\n }\n if (vercelSDKProvider.startsWith('groq.')) {\n return Attr.GenAI.Provider.Name_Values.Groq;\n }\n if (vercelSDKProvider.startsWith('hume.')) {\n return Attr.GenAI.Provider.Name_Values.Hume;\n }\n if (vercelSDKProvider.startsWith('lmnt.')) {\n return Attr.GenAI.Provider.Name_Values.Lmnt;\n }\n if (vercelSDKProvider.startsWith('luma.')) {\n return Attr.GenAI.Provider.Name_Values.Luma;\n }\n if (vercelSDKProvider.startsWith('mistral.')) {\n return Attr.GenAI.Provider.Name_Values.MistralAI;\n }\n if (vercelSDKProvider.startsWith('openai.')) {\n return Attr.GenAI.Provider.Name_Values.OpenAI;\n }\n if (vercelSDKProvider.startsWith('vercel.')) {\n return Attr.GenAI.Provider.Name_Values.Vercel;\n }\n if (vercelSDKProvider.startsWith('vertex.anthropic.')) {\n return Attr.GenAI.Provider.Name_Values.GCPVertexAI;\n }\n if (vercelSDKProvider.startsWith('xai.')) {\n return Attr.GenAI.Provider.Name_Values.XAI;\n }\n\n // most other openai-compatible providers use {providerName}.{chat|completion|embedding|image}\n const s = vercelSDKProvider.split('.');\n if (s.length === 2) {\n return s[0];\n }\n\n // For unknown providers, don't set the attribute\n return undefined;\n }\n }\n}\n","export const SCHEMA_VERSION = '0.0.2';\nexport const SCHEMA_BASE_URL = 'https://axiom.co/ai/schemas/';\nexport const SCHEMA_URL = `${SCHEMA_BASE_URL}${SCHEMA_VERSION}`;\n","import { type Span, type SpanOptions, SpanStatusCode, type Tracer } from '@opentelemetry/api';\n\ninterface Callbacks {\n onSuccess?: (span: Span) => void;\n onError?: (error: unknown, span: Span) => void;\n onFinally?: (span: Span) => void;\n /**\n * If true, the operation will call span.end() manually.\n * Used for streaming operations where the span should remain open until stream consumption completes.\n */\n manualEnd?: boolean;\n}\n\nexport const createStartActiveSpan =\n (tracer: Tracer) =>\n async <T>(\n name: string,\n options: SpanOptions | null,\n fn: (span: Span) => Promise<T>,\n callbacks?: Callbacks,\n ): Promise<T> => {\n return tracer.startActiveSpan(name, { ...(options ?? {}) }, async (span) => {\n try {\n const result = await fn(span);\n\n callbacks?.onSuccess?.(span);\n\n return result;\n } catch (error) {\n callbacks?.onError?.(error, span);\n\n if (error instanceof Error) {\n span.recordException(error);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n }\n\n throw error;\n } finally {\n callbacks?.onFinally?.(span);\n\n // Only auto-end the span if manualEnd is not set\n // For streaming operations, the operation itself will call span.end() when the stream completes\n if (!callbacks?.manualEnd) {\n span.end();\n }\n }\n });\n };\n","import type {\n LanguageModelV1Prompt,\n LanguageModelV1FunctionToolCall,\n LanguageModelV1TextPart,\n LanguageModelV1ToolCallPart,\n} from '@ai-sdk/providerv1';\nimport type {\n LanguageModelV2Prompt,\n LanguageModelV2ToolCall,\n LanguageModelV2TextPart,\n LanguageModelV2ToolCallPart,\n LanguageModelV2ToolResultOutput,\n} from '@ai-sdk/providerv2';\nimport type {\n LanguageModelV3Prompt,\n LanguageModelV3ToolCall,\n LanguageModelV3TextPart,\n LanguageModelV3ToolCallPart,\n LanguageModelV3ToolResultOutput,\n} from '@ai-sdk/providerv3';\nimport type { OpenAIMessage, OpenAIContentPart } from '../vercelTypes';\n\n/**\n * Normalized tool call interface that can represent both V1 and V2 tool calls\n */\nexport interface NormalizedToolCall {\n toolCallId: string;\n toolName: string;\n args: string; // Always a JSON string for consistency\n toolCallType: 'function';\n}\n\n/**\n * Normalized result interface for both V1 and V2 generation results\n */\nexport interface NormalizedResult {\n text?: string;\n toolCalls?: NormalizedToolCall[];\n response?: { id?: string; modelId?: string };\n usage?: {\n promptTokens?: number;\n completionTokens?: number;\n inputTokens?: number;\n outputTokens?: number;\n };\n finishReason?: string;\n}\n\n/**\n * Normalizes a V1 tool call to the common format\n */\nfunction normalizeV1ToolCall(toolCall: LanguageModelV1FunctionToolCall): NormalizedToolCall {\n return {\n toolCallId: toolCall.toolCallId,\n toolName: toolCall.toolName,\n args: typeof toolCall.args === 'string' ? toolCall.args : JSON.stringify(toolCall.args),\n toolCallType: 'function',\n };\n}\n\n/**\n * Normalizes a V2 tool call to the common format\n */\nfunction normalizeV2ToolCall(toolCall: LanguageModelV2ToolCall): NormalizedToolCall {\n return {\n toolCallId: toolCall.toolCallId,\n toolName: toolCall.toolName,\n args:\n typeof toolCall.input === 'string'\n ? toolCall.input.replace(/:\\s+/g, ':')\n : JSON.stringify(toolCall.input),\n toolCallType: 'function',\n };\n}\n\n/**\n * Normalizes an array of V1 tool calls\n */\nexport function normalizeV1ToolCalls(\n toolCalls: LanguageModelV1FunctionToolCall[],\n): NormalizedToolCall[] {\n return toolCalls.map(normalizeV1ToolCall);\n}\n\n/**\n * Normalizes an array of V2 tool calls\n */\nexport function normalizeV2ToolCalls(toolCalls: LanguageModelV2ToolCall[]): NormalizedToolCall[] {\n return toolCalls.map(normalizeV2ToolCall);\n}\n\n/**\n * Normalizes a V3 tool call to the common format\n * V3 tool calls use `input` as a JSON string (similar to V2 but always string)\n */\nfunction normalizeV3ToolCall(toolCall: LanguageModelV3ToolCall): NormalizedToolCall {\n return {\n toolCallId: toolCall.toolCallId,\n toolName: toolCall.toolName,\n args: toolCall.input, // V3 input is always a string\n toolCallType: 'function',\n };\n}\n\n/**\n * Normalizes an array of V3 tool calls\n */\nexport function normalizeV3ToolCalls(toolCalls: LanguageModelV3ToolCall[]): NormalizedToolCall[] {\n return toolCalls.map(normalizeV3ToolCall);\n}\n\n/**\n * Converts a V1 prompt to OpenAI message format\n */\nexport function promptV1ToOpenAI(prompt: LanguageModelV1Prompt): OpenAIMessage[] {\n const results: OpenAIMessage[] = [];\n\n for (const message of prompt) {\n switch (message.role) {\n case 'system':\n results.push({\n role: 'system',\n content: message.content,\n });\n break;\n\n case 'assistant':\n const textPart = message.content.find((part) => part.type === 'text') as\n | LanguageModelV1TextPart\n | undefined;\n const toolCallParts = message.content.filter(\n (part) => part.type === 'tool-call',\n ) as LanguageModelV1ToolCallPart[];\n\n results.push({\n role: 'assistant',\n content: textPart?.text || null,\n ...(toolCallParts.length > 0\n ? {\n tool_calls: toolCallParts.map((part) => ({\n id: part.toolCallId,\n function: {\n name: part.toolName,\n arguments: JSON.stringify(part.args),\n },\n type: 'function',\n })),\n }\n : {}),\n });\n break;\n\n case 'user':\n results.push({\n role: 'user',\n content: message.content.map((part): OpenAIContentPart => {\n switch (part.type) {\n case 'text':\n return {\n type: 'text',\n text: part.text,\n };\n case 'image':\n return {\n type: 'image_url',\n image_url: {\n url: part.image.toString(),\n },\n };\n default:\n // Convert unknown content types to text for compatibility\n return {\n type: 'text',\n text:\n `[${part.type}]` +\n (typeof part === 'object' && part !== null\n ? JSON.stringify(part)\n : String(part)),\n };\n }\n }),\n });\n break;\n\n case 'tool':\n for (const part of message.content) {\n results.push({\n role: 'tool',\n tool_call_id: part.toolCallId,\n content: JSON.stringify(part.result),\n });\n }\n break;\n }\n }\n\n return results;\n}\n\n/**\n * Converts a V2 prompt to OpenAI message format\n */\nexport function promptV2ToOpenAI(prompt: LanguageModelV2Prompt): OpenAIMessage[] {\n const results: OpenAIMessage[] = [];\n\n for (const message of prompt) {\n switch (message.role) {\n case 'system':\n results.push({\n role: 'system',\n content: message.content,\n });\n break;\n\n case 'assistant':\n const textContent = message.content.find(\n (part): part is LanguageModelV2TextPart => part.type === 'text',\n );\n const toolCalls = message.content.filter(\n (part): part is LanguageModelV2ToolCallPart => part.type === 'tool-call',\n );\n\n results.push({\n role: 'assistant',\n content: textContent?.text || null,\n ...(toolCalls.length > 0\n ? {\n tool_calls: toolCalls.map((part) => ({\n id: part.toolCallId,\n function: {\n name: part.toolName,\n arguments:\n typeof part.input === 'string' ? part.input : JSON.stringify(part.input),\n },\n type: 'function',\n })),\n }\n : {}),\n });\n break;\n\n case 'user':\n results.push({\n role: 'user',\n content: message.content.map((part: any) => {\n switch (part.type) {\n case 'text':\n return {\n type: 'text',\n text: part.text,\n };\n case 'image':\n return {\n type: 'image_url',\n image_url: {\n url: part.image.toString(),\n },\n };\n default:\n // Handle unknown content types by passing them through\n return part as any;\n }\n }),\n });\n break;\n\n case 'tool':\n for (const part of message.content) {\n results.push({\n role: 'tool',\n tool_call_id: part.toolCallId,\n content: formatV2ToolCallOutput(part.output),\n });\n }\n break;\n }\n }\n\n return results;\n}\n\nfunction formatV2ToolCallOutput(output: LanguageModelV2ToolResultOutput) {\n switch (output.type) {\n case 'text':\n return output.value;\n case 'json':\n return typeof output.value === 'string' ? output.value : JSON.stringify(output.value);\n case 'error-text':\n return output.value;\n case 'error-json':\n return typeof output.value === 'string' ? output.value : JSON.stringify(output.value);\n case 'content':\n return JSON.stringify(output.value);\n }\n}\n\n/**\n * Converts a V3 prompt to OpenAI message format\n * V3 is very similar to V2 but with slightly different type structure\n */\nexport function promptV3ToOpenAI(prompt: LanguageModelV3Prompt): OpenAIMessage[] {\n const results: OpenAIMessage[] = [];\n\n for (const message of prompt) {\n switch (message.role) {\n case 'system':\n results.push({\n role: 'system',\n content: message.content,\n });\n break;\n\n case 'assistant':\n const textContent = message.content.find(\n (part): part is LanguageModelV3TextPart => part.type === 'text',\n );\n const toolCalls = message.content.filter(\n (part): part is LanguageModelV3ToolCallPart => part.type === 'tool-call',\n );\n\n results.push({\n role: 'assistant',\n content: textContent?.text || null,\n ...(toolCalls.length > 0\n ? {\n tool_calls: toolCalls.map((part) => ({\n id: part.toolCallId,\n function: {\n name: part.toolName,\n // V3 input can be unknown (usually object), convert to string\n arguments:\n typeof part.input === 'string' ? part.input : JSON.stringify(part.input),\n },\n type: 'function',\n })),\n }\n : {}),\n });\n break;\n\n case 'user':\n results.push({\n role: 'user',\n content: message.content.map((part: any) => {\n switch (part.type) {\n case 'text':\n return {\n type: 'text',\n text: part.text,\n };\n case 'file':\n // V3 files - represent as text with media type info\n return {\n type: 'text',\n text: `[file: ${part.mediaType}]`,\n };\n default:\n // Handle unknown content types by passing them through\n return part as any;\n }\n }),\n });\n break;\n\n case 'tool':\n for (const part of message.content) {\n // Skip tool-approval-response parts - they don't have output\n if (part.type === 'tool-result') {\n results.push({\n role: 'tool',\n tool_call_id: part.toolCallId,\n content: formatV3ToolCallOutput(part.output),\n });\n }\n }\n break;\n }\n }\n\n return results;\n}\n\nfunction formatV3ToolCallOutput(output: LanguageModelV3ToolResultOutput) {\n switch (output.type) {\n case 'text':\n return output.value;\n case 'json':\n return typeof output.value === 'string' ? output.value : JSON.stringify(output.value);\n case 'error-text':\n return output.value;\n case 'error-json':\n return typeof output.value === 'string' ? output.value : JSON.stringify(output.value);\n case 'content':\n return JSON.stringify(output.value);\n case 'execution-denied':\n return output.reason ?? 'Execution denied';\n }\n}\n","import {\n type LanguageModelV1StreamPart,\n type LanguageModelV1FunctionToolCall,\n type LanguageModelV1FinishReason,\n} from '@ai-sdk/providerv1';\n\nimport {\n type LanguageModelV2StreamPart,\n type LanguageModelV2ToolCall,\n type LanguageModelV2FinishReason,\n type LanguageModelV2Usage,\n type LanguageModelV2ResponseMetadata,\n} from '@ai-sdk/providerv2';\n\nimport {\n type LanguageModelV3StreamPart,\n type LanguageModelV3ToolCall,\n type LanguageModelV3FinishReason,\n type LanguageModelV3Usage,\n type LanguageModelV3ResponseMetadata,\n} from '@ai-sdk/providerv3';\n\nimport { currentUnixTime } from '../../util/currentUnixTime';\n\n// V1-specific aggregators (the original ones)\nexport class ToolCallAggregator {\n private readonly calls: Record<string, LanguageModelV1FunctionToolCall> = {};\n\n handleChunk(chunk: LanguageModelV1StreamPart): void {\n switch (chunk.type) {\n case 'tool-call':\n this.calls[chunk.toolCallId] = {\n toolCallType: chunk.toolCallType,\n toolCallId: chunk.toolCallId,\n toolName: chunk.toolName,\n args: chunk.args,\n };\n break;\n case 'tool-call-delta':\n if (!this.calls[chunk.toolCallId]) {\n this.calls[chunk.toolCallId] = {\n toolCallType: chunk.toolCallType,\n toolCallId: chunk.toolCallId,\n toolName: chunk.toolName,\n args: '',\n };\n }\n this.calls[chunk.toolCallId].args += chunk.argsTextDelta;\n break;\n }\n }\n\n get result(): LanguageModelV1FunctionToolCall[] {\n return Object.values(this.calls);\n }\n}\n\nexport class TextAggregator {\n private content = '';\n\n feed(chunk: LanguageModelV1StreamPart): void {\n if (chunk.type === 'text-delta') {\n this.content += chunk.textDelta;\n }\n }\n\n get text(): string | undefined {\n return this.content || undefined;\n }\n}\n\nexport class StreamStats {\n private startTime: number;\n private timeToFirstToken?: number;\n private _usage?: { promptTokens: number; completionTokens: number };\n private _finishReason?: LanguageModelV1FinishReason;\n private _responseId?: string;\n private _responseModelId?: string;\n\n constructor() {\n this.startTime = currentUnixTime();\n }\n\n feed(chunk: LanguageModelV1StreamPart): void {\n // Track time to first token on any chunk\n if (this.timeToFirstToken === undefined) {\n this.timeToFirstToken = currentUnixTime() - this.startTime;\n }\n\n switch (chunk.type) {\n case 'response-metadata':\n if (chunk.id) {\n this._responseId = chunk.id;\n }\n if (chunk.modelId) {\n this._responseModelId = chunk.modelId;\n }\n\n break;\n case 'finish':\n this._usage = chunk.usage;\n this._finishReason = chunk.finishReason;\n break;\n }\n }\n\n get result() {\n return {\n response:\n this._responseId || this._responseModelId\n ? {\n id: this._responseId,\n modelId: this._responseModelId,\n }\n : undefined,\n finishReason: this._finishReason,\n usage: this._usage,\n };\n }\n\n get firstTokenTime(): number | undefined {\n return this.timeToFirstToken;\n }\n}\n\n// V2-specific aggregators\nexport class ToolCallAggregatorV2 {\n private readonly calls: Record<string, LanguageModelV2ToolCall> = {};\n\n handleChunk(chunk: LanguageModelV2StreamPart): void {\n if (chunk.type === 'tool-call') {\n this.calls[chunk.toolCallId] = chunk;\n }\n }\n\n get result(): LanguageModelV2ToolCall[] {\n return Object.values(this.calls);\n }\n}\n\nexport class TextAggregatorV2 {\n private content = '';\n\n feed(chunk: LanguageModelV2StreamPart): void {\n // TODO: @cje - is this enough?\n switch (chunk.type) {\n case 'text-start':\n this.content = '';\n break;\n case 'text-delta':\n this.content += chunk.delta;\n break;\n case 'text-end':\n break;\n }\n }\n\n get text(): string | undefined {\n return this.content || undefined;\n }\n}\n\nexport class StreamStatsV2 {\n private startTime: number;\n private timeToFirstToken?: number;\n private _usage?: LanguageModelV2Usage;\n private _finishReason?: LanguageModelV2FinishReason;\n private _responseMetadata?: LanguageModelV2ResponseMetadata;\n\n constructor() {\n this.startTime = currentUnixTime();\n }\n\n feed(chunk: LanguageModelV2StreamPart): void {\n // Track time to first token on any chunk\n if (this.timeToFirstToken === undefined) {\n this.timeToFirstToken = currentUnixTime() - this.startTime;\n }\n\n switch (chunk.type) {\n case 'response-metadata':\n this._responseMetadata = {\n id: chunk.id,\n modelId: chunk.modelId,\n timestamp: chunk.timestamp,\n };\n break;\n case 'finish':\n this._usage = chunk.usage;\n this._finishReason = chunk.finishReason;\n break;\n }\n }\n\n get result() {\n return {\n response: this._responseMetadata,\n finishReason: this._finishReason,\n usage: this._usage,\n };\n }\n\n get firstTokenTime(): number | undefined {\n return this.timeToFirstToken;\n }\n}\n\n// V3-specific aggregators\nexport class ToolCallAggregatorV3 {\n private readonly calls: Record<string, LanguageModelV3ToolCall> = {};\n private readonly pendingInputs: Record<string, { toolName: string; input: string }> = {};\n\n handleChunk(chunk: LanguageModelV3StreamPart): void {\n switch (chunk.type) {\n case 'tool-call':\n this.calls[chunk.toolCallId] = chunk;\n break;\n case 'tool-input-start':\n this.pendingInputs[chunk.id] = { toolName: chunk.toolName, input: '' };\n break;\n case 'tool-input-delta':\n if (this.pendingInputs[chunk.id]) {\n this.pendingInputs[chunk.id].input += chunk.delta;\n }\n break;\n case 'tool-input-end':\n // Tool input streaming completed - the full tool-call chunk will follow\n break;\n }\n }\n\n get result(): LanguageModelV3ToolCall[] {\n return Object.values(this.calls);\n }\n}\n\nexport class TextAggregatorV3 {\n private content = '';\n\n feed(chunk: LanguageModelV3StreamPart): void {\n switch (chunk.type) {\n case 'text-start':\n this.content = '';\n break;\n case 'text-delta':\n this.content += chunk.delta;\n break;\n case 'text-end':\n break;\n }\n }\n\n get text(): string | undefined {\n return this.content || undefined;\n }\n}\n\nexport class StreamStatsV3 {\n private startTime: number;\n private timeToFirstToken?: number;\n private _usage?: LanguageModelV3Usage;\n private _finishReason?: LanguageModelV3FinishReason;\n private _responseMetadata?: LanguageModelV3ResponseMetadata;\n\n constructor() {\n this.startTime = currentUnixTime();\n }\n\n feed(chunk: LanguageModelV3StreamPart): void {\n // Track time to first token on any chunk\n if (this.timeToFirstToken === undefined) {\n this.timeToFirstToken = currentUnixTime() - this.startTime;\n }\n\n switch (chunk.type) {\n case 'response-metadata':\n this._responseMetadata = {\n id: chunk.id,\n modelId: chunk.modelId,\n timestamp: chunk.timestamp,\n };\n break;\n case 'finish':\n this._usage = chunk.usage;\n this._finishReason = chunk.finishReason;\n break;\n }\n }\n\n get result() {\n return {\n response: this._responseMetadata,\n finishReason: this._finishReason,\n usage: this._usage,\n };\n }\n\n get firstTokenTime(): number | undefined {\n return this.timeToFirstToken;\n }\n}\n","export function currentUnixTime(): number {\n return Date.now() / 1000;\n}\n","import { type LanguageModelV2, type LanguageModelV2CallOptions } from '@ai-sdk/providerv2';\nimport { axiomAIMiddlewareV2 } from './middleware';\n\nexport function isLanguageModelV2(model: any): model is LanguageModelV2 {\n return (\n model?.specificationVersion === 'v2' &&\n typeof model?.provider === 'string' &&\n typeof model?.modelId === 'string'\n );\n}\n\n/**\n * Wraps a LanguageModelV2 to provide OpenTelemetry instrumentation.\n *\n * Internally uses Axiom's telemetry middleware while maintaining a simple class-based API.\n *\n * @example\n * ```typescript\n * import { AxiomWrappedLanguageModelV2 } from '@axiom/ai';\n * import { anthropic } from '@ai-sdk/anthropic';\n *\n * const model = new AxiomWrappedLanguageModelV2(anthropic('claude-3-haiku-20240307'));\n * ```\n *\n * For advanced use cases, you can also use the middleware directly:\n * ```typescript\n * import { wrapLanguageModel } from 'ai';\n * import { createAxiomTelemetryV2 } from '@axiom/ai';\n *\n * const model = wrapLanguageModel({\n * model: yourV2Model,\n * middleware: createAxiomTelemetryV2(),\n * });\n * ```\n */\nexport class AxiomWrappedLanguageModelV2 {\n constructor(model: LanguageModelV2) {\n const middleware = axiomAIMiddlewareV2();\n\n // Return the wrapped model directly from constructor\n return {\n specificationVersion: model.specificationVersion,\n provider: model.provider,\n modelId: model.modelId,\n supportedUrls: model.supportedUrls,\n\n doGenerate: async (params: LanguageModelV2CallOptions) => {\n return middleware.wrapGenerate!({\n doGenerate: () => model.doGenerate(params),\n doStream: () => model.doStream(params),\n params,\n model,\n });\n },\n\n doStream: async (params: LanguageModelV2CallOptions) => {\n return middleware.wrapStream!({\n doGenerate: () => model.doGenerate(params),\n doStream: () => model.doStream(params),\n params,\n model,\n });\n },\n } as LanguageModelV2;\n }\n}\n","import { type LanguageModelV3, type LanguageModelV3CallOptions } from '@ai-sdk/providerv3';\nimport { axiomAIMiddlewareV3 } from './middleware';\n\nexport function isLanguageModelV3(model: unknown): model is LanguageModelV3 {\n return (\n model != null &&\n typeof model === 'object' &&\n 'specificationVersion' in model &&\n 'provider' in model &&\n 'modelId' in model &&\n (model as any).specificationVersion === 'v3' &&\n typeof (model as any).provider === 'string' &&\n typeof (model as any).modelId === 'string'\n );\n}\n\n/**\n * Wraps a LanguageModelV3 to provide OpenTelemetry instrumentation.\n *\n * Internally uses Axiom's telemetry middleware while maintaining a simple class-based API.\n *\n * @example\n * ```typescript\n * import { AxiomWrappedLanguageModelV3 } from '@axiom/ai';\n * import { anthropic } from '@ai-sdk/anthropic';\n *\n * const model = new AxiomWrappedLanguageModelV3(anthropic('claude-sonnet-4-20250514'));\n * ```\n *\n * For advanced use cases, you can also use the middleware directly:\n * ```typescript\n * import { wrapLanguageModel } from 'ai';\n * import { createAxiomTelemetryV3 } from '@axiom/ai';\n *\n * const model = wrapLanguageModel({\n * model: yourV3Model,\n * middleware: createAxiomTelemetryV3(),\n * });\n * ```\n */\nexport class AxiomWrappedLanguageModelV3 {\n constructor(model: LanguageModelV3) {\n const middleware = axiomAIMiddlewareV3();\n\n // Return the wrapped model directly from constructor\n return {\n specificationVersion: model.specificationVersion,\n provider: model.provider,\n modelId: model.modelId,\n supportedUrls: model.supportedUrls,\n\n doGenerate: async (params: LanguageModelV3CallOptions) => {\n return middleware.wrapGenerate!({\n doGenerate: () => model.doGenerate(params),\n doStream: () => model.doStream(params),\n params,\n model,\n });\n },\n\n doStream: async (params: LanguageModelV3CallOptions) => {\n return middleware.wrapStream!({\n doGenerate: () => model.doGenerate(params),\n doStream: () => model.doStream(params),\n params,\n model,\n });\n },\n } as LanguageModelV3;\n }\n}\n","import {\n context,\n propagation,\n trace,\n SpanStatusCode,\n type Span,\n type Baggage,\n type Tracer,\n} from '@opentelemetry/api';\n\nimport { WITHSPAN_BAGGAGE_KEY, WITHSPAN_REDACTION_POLICY_KEY } from './withSpanBaggageKey';\nimport { getTracer } from './utils/wrapperUtils';\nimport type { AxiomAIRedactionPolicy } from './utils/redaction';\nimport type { ValidateName } from '../util/name-validation';\nimport { isValidName } from '../util/name-validation-runtime';\n\n/**\n * Metadata for categorizing and tracking spans within the AI application.\n */\ntype WithSpanMeta = {\n /** High-level capability being performed (e.g., 'text_generation', 'chat', 'analysis') */\n capability: string;\n /** Specific step within the capability (e.g., 'generate_response', 'summarize', 'extract') */\n step: string;\n /** Optional conversation ID to correlate spans across a multi-turn conversation */\n conversationId?: string;\n};\n\n/**\n * Wrap Vercel AI SDK functions like `generateText` and `streamText` in an OpenTelemetry span.\n *\n * Automatically detects and handles different response types:\n * - **Response streams**: Keeps span alive during entire stream consumption\n * - **Streaming objects**: Warns about incorrect usage patterns\n * - **Regular objects**: Ends span immediately after function completion\n *\n * The span name will be updated by the AI SDK middleware from 'chat'\n * to a model-specific name like 'chat gpt-4o-mini' when used with wrapped models.\n *\n * @param meta - Span metadata for categorization and tracking\n * @param meta.capability - High-level capability being performed (e.g., 'customer_support', 'meeting_summarizer')\n * @param meta.step - Specific step within the capability (e.g., 'categorize_message', 'transcribe_audio')\n * @param fn - Function to execute within the span context. Receives the span as a parameter so you can add additional attributes.\n * @param opts - Optional configuration\n * @param opts.tracer - Custom OpenTelemetry tracer instance. Defaults to the tracer provided by `initAxiomAI`.\n * @param opts.timeoutMs - Timeout for abandoned streams. Defaults to 600,000 (10 minutes).\n * @param opts.redactionPolicy - Optional redaction policy to override global policy for this span.\n *\n * @returns Promise that resolves to the same value as the wrapped function\n *\n * @example \n * // Non-streaming usage\n * const result = await withSpan(\n * { capability: 'text_generation', step: 'generate' },\n * async (span) => {\n * span.setAttribute('user.id', userId); // can set attributes on the span\n * const result = await generateObject({ model, prompt });\n * // can do something with the result here, eg set additional attributes\n * return result\n * }\n * );\n *\n * @example \n * // Streaming usage with `@ai-sdk/react` in the frontend\n * ```ts\n * const response = withSpan(\n * { capability: 'chat', step: 'stream_chat' },\n * async (span) => {\n * span.setAttribute('user.id', userId);\n * const result = streamText({ model, messages });\n * return result.toUIMessageStreamResponse();\n * }\n * );\n * ```\n * \n * @example \n * // Streaming usage with express\n * ```ts\n * await withSpan(\n * { capability: 'chat', step: 'stream_chat' },\n * async (span) => {\n * span.setAttribute('user.id', userId);\n *\n * const { textStream } = streamText({ model, messages });\n *\n * // Keep span open during entire stream consumption\n * for await (const chunk of textStream) {\n * res.write(chunk);\n * }\n * }\n * );\n\n * res.end();\n * ```\n */\n/**\n * Options for withSpan configuration.\n */\nexport type WithSpanOptions = {\n /** Custom OpenTelemetry tracer instance */\n tracer?: Tracer;\n /** Timeout for abandoned streams (default: 600,000ms / 10 minutes) */\n timeoutMs?: number;\n /** Redaction policy to override global policy for this span */\n redactionPolicy?: AxiomAIRedactionPolicy;\n};\n\nexport function withSpan<Return, Capability extends string = string, Step extends string = string>(\n meta: WithSpanMeta & {\n capability: ValidateName<Capability>;\n step: ValidateName<Step>;\n },\n fn: (span: Span) => Promise<Return>,\n opts?: WithSpanOptions,\n): Promise<Return> {\n const tracer = opts?.tracer ?? getTracer();\n\n // Create span manually to control its lifecycle\n const span = tracer.startSpan('chat');\n const spanContext = trace.setSpan(context.active(), span);\n\n return context.with(spanContext, async () => {\n const capabilityValidation = isValidName(meta.capability);\n if (!capabilityValidation.valid) {\n console.warn(`[AxiomAI] Invalid capability name: ${capabilityValidation.error}. `);\n }\n\n const stepValidation = isValidName(meta.step);\n if (!stepValidation.valid) {\n console.warn(`[AxiomAI] Invalid step name: ${stepValidation.error}. `);\n }\n\n if (!span.isRecording()) {\n const provider = trace.getTracerProvider();\n const providerIsNoOp = provider.constructor.name === 'NoopTracerProvider';\n\n // We don't warn for other non-recording cases (sampling=DROP, etc.) as those may be intentional\n if (providerIsNoOp) {\n const isDebug = process.env.AXIOM_DEBUG === 'true';\n if (!isDebug) {\n console.warn(\n '[AxiomAI] No TracerProvider registered - spans are no-op. Make sure to call initAxiomAI() after your OpenTelemetry SDK has started.',\n );\n }\n }\n }\n\n const bag: Baggage = propagation.createBaggage({\n capability: { value: meta.capability },\n step: { value: meta.step },\n // TODO: maybe we can just check the active span name instead?\n [WITHSPAN_BAGGAGE_KEY]: { value: 'true' }, // Mark that we're inside withSpan\n // Store serialized redaction policy if provided\n ...(opts?.redactionPolicy && {\n [WITHSPAN_REDACTION_POLICY_KEY]: { value: JSON.stringify(opts.redactionPolicy) },\n }),\n // Store conversation ID if provided\n ...(meta.conversationId && {\n conversationId: { value: meta.conversationId },\n }),\n });\n\n const ctx = propagation.setBaggage(context.active(), bag);\n\n let spanEnded = false;\n const safeEndSpan = () => {\n if (!spanEnded) {\n spanEnded = true;\n span.end();\n }\n };\n\n // Timeout fallback for abandoned streams\n const timeoutMs = opts?.timeoutMs ?? 600_000; // 10 minutes default\n const timeoutId = setTimeout(() => {\n safeEndSpan();\n }, timeoutMs);\n\n try {\n const result = await context.with(ctx, () => fn(span));\n\n // Auto-detect Response streams and keep span alive during consumption\n if (result instanceof Response && result.body) {\n // Check if body is already locked\n if (result.body.locked) {\n console.warn('[AxiomAI] Response body is already locked, cannot instrument stream');\n clearTimeout(timeoutId);\n safeEndSpan();\n return result;\n }\n\n const originalReader = result.body.getReader();\n const wrappedStream = new ReadableStream({\n async pull(controller) {\n try {\n const { value, done } = await context.with(ctx, () => originalReader.read());\n if (done) {\n originalReader.releaseLock?.();\n clearTimeout(timeoutId);\n span.setStatus({ code: SpanStatusCode.OK });\n safeEndSpan();\n controller.close();\n } else {\n controller.enqueue(value);\n }\n } catch (err) {\n originalReader.releaseLock?.();\n clearTimeout(timeoutId);\n span.recordException(err as Error);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err instanceof Error ? err.message : String(err),\n });\n safeEndSpan();\n controller.error(err);\n }\n },\n async cancel(reason: unknown) {\n try {\n originalReader.releaseLock?.();\n clearTimeout(timeoutId);\n if (reason instanceof Error) {\n span.recordException(reason);\n } else if (reason) {\n span.recordException({ message: String(reason), name: 'CancelError' });\n }\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: reason instanceof Error ? reason.message : String(reason),\n });\n safeEndSpan();\n await originalReader.cancel(reason);\n } catch (_err) {\n // Ignore cancel errors\n }\n },\n });\n\n return new Response(wrappedStream, {\n status: result.status,\n statusText: result.statusText,\n headers: result.headers,\n }) as Return;\n }\n\n // Auto-detect Vercel AI SDK streaming objects (streamText returns object with textStream)\n if (result && typeof result === 'object' && 'textStream' in result) {\n console.warn(\n '[AxiomAI] Detected streaming object with textStream. For proper span lifecycle, call .toUIMessageStreamResponse() or similar inside withSpan, not after.',\n );\n clearTimeout(timeoutId);\n safeEndSpan(); // End span immediately to prevent memory leak\n return result;\n }\n\n // Non-stream path: end span immediately\n clearTimeout(timeoutId);\n span.setStatus({ code: SpanStatusCode.OK });\n safeEndSpan();\n return result;\n } catch (err) {\n clearTimeout(timeoutId);\n span.recordException(err as Error);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err instanceof Error ? err.message : String(err),\n });\n safeEndSpan();\n throw err;\n }\n });\n}\n","/**\n * Validates that a name contains only allowed characters (A-Z, a-z, 0-9, -, _)\n * and is not empty.\n *\n * @returns Object with validation result and optional error message\n */\nexport function isValidName(name: string): { valid: true } | { valid: false; error: string } {\n if (name === '') {\n return { valid: false, error: 'Name cannot be empty' };\n }\n\n const validPattern = /^[A-Za-z0-9_-]+$/;\n if (!validPattern.test(name)) {\n return {\n valid: false,\n error: `Invalid character in \"${name}\". Only A-Z, a-z, 0-9, -, _ allowed`,\n };\n }\n\n return { valid: true };\n}\n","import { context, trace, SpanStatusCode, type SpanContext } from '@opentelemetry/api';\nimport { getGlobalTracer } from '../otel/initAxiomAI';\nimport type {\n OnlineEvalScorerEntry,\n OnlineEvalScorerInput,\n SampledOnlineEvalScorer,\n Scorer,\n ScorerResult,\n ScorerSampling,\n} from './types';\nimport { executeScorer } from './executor';\nimport { Attr } from '../otel/semconv/attributes';\n\ntype ScorerEntry<TInput, TOutput> = OnlineEvalScorerEntry<TInput, TOutput, any>;\ntype ScorerInput<TInput, TOutput> = OnlineEvalScorerInput<TInput, TOutput, any>;\n\ntype InferScorerMetadata<TScorerEntry> =\n TScorerEntry extends SampledOnlineEvalScorer<any, any, any>\n ? InferScorerMetadata<TScorerEntry['scorer']>\n : TScorerEntry extends Scorer<any, any, infer TMetadata>\n ? TMetadata\n : TScorerEntry extends ScorerResult<infer TMetadata>\n ? TMetadata\n : never;\n\ntype InferScorerName<TScorerEntry> =\n TScorerEntry extends SampledOnlineEvalScorer<any, any, any>\n ? InferScorerName<TScorerEntry['scorer']>\n : TScorerEntry extends ScorerResult<any>\n ? TScorerEntry['name']\n : TScorerEntry extends Scorer<any, any, any>\n ? string\n : never;\n\ntype IsBroadString<T extends string> = string extends T ? true : false;\n\ntype DuplicateScorerNames<\n TEntries extends readonly unknown[],\n Seen extends string = never,\n Duplicates extends string = never,\n> = TEntries extends readonly [infer Head, ...infer Tail]\n ? InferScorerName<Head> extends infer ScorerName\n ? ScorerName extends string\n ? IsBroadString<ScorerName> extends true\n ? DuplicateScorerNames<Tail extends readonly unknown[] ? Tail : never, Seen, Duplicates>\n : ScorerName extends Seen\n ? DuplicateScorerNames<\n Tail extends readonly unknown[] ? Tail : never,\n Seen,\n Duplicates | ScorerName\n >\n : DuplicateScorerNames<\n Tail extends readonly unknown[] ? Tail : never,\n Seen | ScorerName,\n Duplicates\n >\n : DuplicateScorerNames<Tail extends readonly unknown[] ? Tail : never, Seen, Duplicates>\n : never\n : Duplicates;\n\ntype EnsureUniqueScorerNames<TEntries extends readonly unknown[]> = [\n DuplicateScorerNames<TEntries>,\n] extends [never]\n ? TEntries\n : never & {\n __axiomDuplicateScorerNames__: DuplicateScorerNames<TEntries>;\n };\n\ntype InferOnlineEvalResult<TScorers extends readonly unknown[]> = ScorerResult<\n InferScorerMetadata<TScorers[number]>\n>;\n\ntype InferOnlineEvalResultRecord<TScorers extends readonly unknown[]> = Partial<\n Record<Extract<InferScorerName<TScorers[number]>, string>, InferOnlineEvalResult<TScorers>>\n>;\n\ntype NormalizedScorerEntry<TInput, TOutput> = {\n name: string;\n scorer: ScorerInput<TInput, TOutput>;\n sampling?: ScorerSampling<TInput, TOutput>;\n};\n\n/**\n * Metadata for categorizing online evaluations.\n */\nexport type OnlineEvalMeta = {\n /** High-level capability being evaluated (e.g., 'qa', 'summarization') */\n capability: string;\n /** Specific step within the capability (e.g., 'answer', 'extract') */\n step?: string;\n /**\n * Explicit SpanContext(s) to link the eval span to originating generation span(s).\n * When omitted, the active span's context is used automatically.\n * Use this for deferred evaluation when onlineEval is called after the\n * originating span has completed.\n * Supports both single context and multiple contexts for multi-span linking.\n */\n links?: SpanContext | SpanContext[];\n};\n\n/**\n * Options for online evaluation.\n */\nexport type OnlineEvalOptions<\n TInput,\n TOutput,\n TScorers extends readonly ScorerEntry<TInput, TOutput>[] = readonly ScorerEntry<\n TInput,\n TOutput\n >[],\n> = {\n /** Input to pass to scorers (optional - only needed for input+output scorers) */\n input?: TInput;\n /** Output to evaluate */\n output: TOutput;\n /** Scorers or precomputed scores. Supports optional per-scorer sampling. */\n scorers: EnsureUniqueScorerNames<TScorers>;\n};\n\n/**\n * Determines if an individual scorer should run based on sampling configuration.\n */\nasync function shouldSample<TInput, TOutput>(\n sampling: ScorerSampling<TInput, TOutput> | undefined,\n args: { input?: TInput; output: TOutput },\n): Promise<boolean> {\n if (sampling === undefined) return true;\n if (typeof sampling === 'number') {\n if (sampling >= 1) return true;\n if (sampling <= 0) return false;\n return Math.random() < sampling;\n }\n return Boolean(await sampling(args));\n}\n\nfunction isSampledScorerEntry<TInput, TOutput>(\n entry: ScorerEntry<TInput, TOutput>,\n): entry is SampledOnlineEvalScorer<TInput, TOutput, any> {\n return typeof entry === 'object' && entry !== null && 'scorer' in entry;\n}\n\nfunction resolveScorerName<TInput, TOutput>(scorer: ScorerInput<TInput, TOutput>): string {\n if (typeof scorer === 'function') {\n return scorer.name || 'unknown';\n }\n return scorer.name;\n}\n\nfunction normalizeScorerEntry<TInput, TOutput>(\n entry: ScorerEntry<TInput, TOutput>,\n): NormalizedScorerEntry<TInput, TOutput> {\n if (isSampledScorerEntry(entry)) {\n return {\n name: resolveScorerName(entry.scorer),\n scorer: entry.scorer,\n sampling: entry.sampling,\n };\n }\n\n return {\n name: resolveScorerName(entry),\n scorer: entry,\n };\n}\n\nfunction getDuplicateScorerNames<TInput, TOutput>(\n entries: readonly NormalizedScorerEntry<TInput, TOutput>[],\n): string[] {\n const nameCounts = new Map<string, number>();\n\n for (const entry of entries) {\n nameCounts.set(entry.name, (nameCounts.get(entry.name) ?? 0) + 1);\n }\n\n return [...nameCounts.entries()]\n .filter(([, count]) => count > 1)\n .map(([name]) => name)\n .sort();\n}\n\n/**\n * Run online evaluation scorers against production outputs.\n *\n * Returns a promise that resolves to scorer results. Use `void onlineEval(...)`\n * for fire-and-forget, or `await onlineEval(...)` when you need to wait for\n * completion (e.g., before flushing telemetry in short-lived processes).\n *\n * Each eval span links back to the originating generation span via an\n * OpenTelemetry span link. Parent/child hierarchy follows natural context\n * propagation — inside `withSpan` the eval is a child, outside it depends\n * on the active context.\n *\n * ## Usage Patterns\n *\n * **Inside withSpan (recommended):**\n * Active span is automatically detected and linked.\n * ```ts\n * await withSpan({ capability: 'qa', step: 'answer' }, async () => {\n * const response = await generateText({ ... });\n * void onlineEval(\n * { capability: 'qa', step: 'answer' },\n * { output: response.text, scorers: [formatScorer] }\n * );\n * return response.text;\n * });\n * ```\n *\n * **Deferred evaluation with explicit link:**\n * Pass the originating span's context for linking when evaluating later.\n * Supports single or multiple span contexts.\n * ```ts\n * let spanCtx: SpanContext;\n * const result = await withSpan({ ... }, async (span) => {\n * spanCtx = span.spanContext();\n * return await generateText({ ... });\n * });\n * void onlineEval({ ..., links: spanCtx }, { output: result, scorers });\n *\n * // Or link to multiple spans:\n * void onlineEval({ ..., links: [spanCtx1, spanCtx2] }, { output, scorers });\n * ```\n *\n * **Awaiting for flush (short-lived processes):**\n * ```ts\n * await onlineEval({ ... }, { output, scorers });\n * await flushTelemetry();\n * ```\n *\n * @param meta - Evaluation metadata for categorization\n * @param meta.capability - High-level capability being evaluated\n * @param meta.step - Optional step within the capability\n * @param meta.links - Optional SpanContext(s) to link to (auto-detected if omitted)\n * @param options - Evaluation configuration\n * @param options.input - Input to pass to scorers\n * @param options.output - Output to evaluate\n * @param options.scorers - Scorer entries with optional per-scorer sampling\n * @returns Promise resolving to scorer results keyed by scorer name\n */\nexport function onlineEval<\n TInput,\n TOutput,\n const TScorers extends readonly ScorerEntry<TInput, TOutput>[],\n>(\n meta: OnlineEvalMeta,\n options: OnlineEvalOptions<TInput, TOutput, TScorers>,\n): Promise<InferOnlineEvalResultRecord<TScorers>> {\n if (options.scorers.length === 0) {\n return Promise.resolve({});\n }\n\n const rawLinks = meta.links ?? trace.getSpan(context.active())?.spanContext();\n const linkContexts = rawLinks ? (Array.isArray(rawLinks) ? rawLinks : [rawLinks]) : [];\n\n return executeOnlineEvalInternal(meta, options, linkContexts);\n}\n\nasync function executeOnlineEvalInternal<\n TInput,\n TOutput,\n const TScorers extends readonly ScorerEntry<TInput, TOutput>[],\n>(\n meta: OnlineEvalMeta,\n options: OnlineEvalOptions<TInput, TOutput, TScorers>,\n linkContexts: SpanContext[],\n): Promise<InferOnlineEvalResultRecord<TScorers>> {\n const tracer = getGlobalTracer();\n\n const spanName = meta.step ? `eval ${meta.capability}/${meta.step}` : `eval ${meta.capability}`;\n\n const evalSpan = tracer.startSpan(\n spanName,\n linkContexts.length > 0 ? { links: linkContexts.map((ctx) => ({ context: ctx })) } : {},\n );\n\n const evalAttrs: Record<string, string> = {\n [Attr.GenAI.Operation.Name]: 'eval',\n [Attr.Eval.Capability.Name]: meta.capability,\n [Attr.Eval.Tags]: JSON.stringify(['online']),\n };\n if (meta.step) {\n evalAttrs[Attr.Eval.Step.Name] = meta.step;\n }\n evalSpan.setAttributes(evalAttrs);\n\n try {\n const normalizedScorers = options.scorers.map((entry) => normalizeScorerEntry(entry));\n const duplicateScorerNames = getDuplicateScorerNames(normalizedScorers);\n if (duplicateScorerNames.length > 0) {\n throw new Error(\n `Duplicate scorer names are not allowed: ${duplicateScorerNames\n .map((name) => `\"${name}\"`)\n .join(', ')}`,\n );\n }\n\n const outcomes = await Promise.all(\n normalizedScorers.map(async (entry) => {\n try {\n const sampledIn = await shouldSample(entry.sampling, {\n input: options.input,\n output: options.output,\n });\n\n if (!sampledIn) {\n return { sampledOut: true as const };\n }\n\n return {\n sampledOut: false as const,\n result: await executeScorer(\n entry.scorer,\n options.input,\n options.output,\n evalSpan,\n meta,\n ),\n };\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n return {\n sampledOut: false as const,\n result: await executeScorer(\n {\n name: entry.name,\n score: null,\n error: error.message,\n },\n options.input,\n options.output,\n evalSpan,\n meta,\n ),\n };\n }\n }),\n );\n\n const results: Record<string, InferOnlineEvalResult<TScorers>> = {};\n let sampledOutCount = 0;\n\n for (const outcome of outcomes) {\n if (outcome.sampledOut) {\n sampledOutCount += 1;\n continue;\n }\n\n results[outcome.result.name] = outcome.result as InferOnlineEvalResult<TScorers>;\n }\n\n const failedCount = Object.values(results).filter((result) => result.error).length;\n const ranCount = Object.keys(results).length;\n\n const scoresSummary: Record<string, ScorerResult> = {};\n for (const [name, result] of Object.entries(results)) {\n scoresSummary[name] = {\n name: result.name,\n score: result.score,\n ...(result.metadata &&\n Object.keys(result.metadata).length > 0 && { metadata: result.metadata }),\n ...(result.error && { error: result.error }),\n };\n }\n\n evalSpan.setAttributes({\n [Attr.Eval.Case.Scores]: JSON.stringify(scoresSummary),\n 'axiom.eval.online.scorers.total': normalizedScorers.length,\n 'axiom.eval.online.scorers.ran': ranCount,\n 'axiom.eval.online.scorers.sampled_out': sampledOutCount,\n 'axiom.eval.online.scorers.failed': failedCount,\n });\n\n if (failedCount > 0) {\n evalSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: 'One or more scorers failed',\n });\n } else {\n evalSpan.setStatus({ code: SpanStatusCode.OK });\n }\n\n return results as InferOnlineEvalResultRecord<TScorers>;\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n evalSpan.recordException(error);\n evalSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n return {};\n } finally {\n evalSpan.end();\n }\n}\n","import { context, trace, SpanStatusCode, type Span } from '@opentelemetry/api';\nimport { normalizeBooleanScore } from '../evals/normalize-score';\nimport { getGlobalTracer } from '../otel/initAxiomAI';\nimport type { Scorer, ScorerResult } from './types';\nimport type { OnlineEvalMeta } from './onlineEval';\nimport { Attr } from '../otel/semconv/attributes';\n\ntype OnlineEvalScorerInput<TInput, TOutput> = Scorer<TInput, TOutput, any> | ScorerResult<any>;\n\nfunction setScorerSpanAttrs(\n scorerSpan: Span,\n scorerName: string,\n result: Pick<ScorerResult<any>, 'score' | 'metadata'>,\n meta?: OnlineEvalMeta,\n): void {\n const { score: scoreValue, metadata } = normalizeBooleanScore(result.score, result.metadata);\n\n const attrs: Record<string, string | number | boolean | undefined> = {\n [Attr.GenAI.Operation.Name]: 'eval.score',\n [Attr.Eval.Score.Name]: scorerName,\n [Attr.Eval.Tags]: JSON.stringify(['online']),\n [Attr.Eval.Score.Value]: scoreValue ?? undefined,\n [Attr.Eval.Capability.Name]: meta?.capability,\n [Attr.Eval.Step.Name]: meta?.step,\n };\n\n if (metadata && Object.keys(metadata).length > 0) {\n attrs[Attr.Eval.Score.Metadata] = JSON.stringify(metadata);\n }\n\n scorerSpan.setAttributes(attrs);\n}\n\n/**\n * Executes a single scorer or emits a precomputed scorer result.\n */\nexport async function executeScorer<TInput, TOutput>(\n scorer: OnlineEvalScorerInput<TInput, TOutput>,\n input: TInput | undefined,\n output: TOutput,\n parentSpan: Span,\n meta?: OnlineEvalMeta,\n): Promise<ScorerResult<any>> {\n const tracer = getGlobalTracer();\n const parentContext = trace.setSpan(context.active(), parentSpan);\n\n return context.with(parentContext, async () => {\n const scorerName =\n typeof scorer === 'function'\n ? // undefined/unknown case shouldn't happen, but better safe than sorry\n scorer.name || 'unknown'\n : scorer.name;\n const scorerSpan = tracer.startSpan(`score ${scorerName}`);\n\n try {\n const result =\n typeof scorer === 'function'\n ? ({\n ...(await scorer({\n input,\n output,\n })),\n name: scorerName,\n } satisfies ScorerResult)\n : scorer;\n\n setScorerSpanAttrs(scorerSpan, scorerName, result, meta);\n if (result.error) {\n const error = new Error(result.error);\n scorerSpan.recordException(error);\n scorerSpan.setAttributes({\n [Attr.Error.Message]: error.message,\n [Attr.Error.Type]: error.name,\n });\n scorerSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n } else {\n scorerSpan.setStatus({ code: SpanStatusCode.OK });\n }\n\n return result;\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n const failedResult: ScorerResult = {\n name: scorerName,\n score: null,\n error: error.message,\n };\n\n setScorerSpanAttrs(scorerSpan, scorerName, failedResult, meta);\n\n scorerSpan.recordException(error);\n scorerSpan.setAttributes({\n [Attr.Error.Message]: error.message,\n [Attr.Error.Type]: error.name,\n });\n scorerSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n\n return failedResult;\n } finally {\n scorerSpan.end();\n }\n });\n}\n","import { Attr } from '../otel/semconv/attributes';\nimport type { Score } from './scorer.types';\n\n/**\n * Normalizes a boolean score to numeric (1/0) and adds eval.score.is_boolean\n * to metadata. Numbers and null pass through unchanged.\n */\nexport function normalizeBooleanScore(\n score: Score['score'],\n metadata?: Record<string, unknown>,\n): { score: number | null; metadata?: Record<string, unknown> } {\n if (typeof score !== 'boolean') {\n return { score, metadata };\n }\n return {\n score: score ? 1 : 0,\n metadata: { ...metadata, [Attr.Eval.Score.IsBoolean]: true },\n };\n}\n","let scorerWarned = false;\n\nexport function warnScorerDeprecation(path: string): void {\n if (scorerWarned) return;\n scorerWarned = true;\n console.warn(\n `[axiom] Importing Scorer from '${path}' is deprecated. ` +\n `Use \"import { Scorer } from 'axiom/ai/evals/scorers'\" instead.`,\n );\n}\n\nlet onlineEvalWarned = false;\n\nexport function warnOnlineEvalDeprecation(): void {\n if (onlineEvalWarned) return;\n onlineEvalWarned = true;\n console.warn(\n `[axiom] Importing onlineEval from 'axiom/ai' is deprecated. ` +\n `Use \"import { onlineEval } from 'axiom/ai/evals/online'\" instead.`,\n );\n}\n","import type { ValidateName } from '../util/name-validation';\nimport { normalizeBooleanScore } from './normalize-score';\nimport type { Score, Scorer, ScorerOptions } from './scorer.types';\n\n// Helper to force TypeScript to evaluate/simplify types\ntype Simplify<T> = { [K in keyof T]: T[K] } & {};\n\ntype ScorerReturnValue = number | boolean | Score;\ntype AwaitedValue<T> = T extends Promise<infer U> ? U : T;\ntype InferScorerMetadata<T> =\n AwaitedValue<T> extends Score<infer TMetadata> ? TMetadata : Record<string, any>;\ntype NormalizeScorerReturn<T, TMetadata extends Record<string, any>> =\n T extends Promise<any> ? Promise<Score<TMetadata>> : Score<TMetadata>;\n\n/**\n * Creates a scorer to be used in evals.\n *\n * Scorers need to return a number or a boolean. If returning a number, it is\n * suggested that this number is between 0 and 1.\n *\n * @example\n * const scorer = createScorer('exact-match',\n * (args: { output: string; expected: string; }) => {\n * return args.output === args.expected ? true : false;\n * }\n * );\n *\n * @example\n * // With aggregation for trials\n * import { PassAtK } from '@axiomhq/ai/evals/aggregations';\n * const scorer = createScorer('tool-called',\n * (args: { output: string }) => args.output.includes('tool') ? 1 : 0,\n * { aggregation: PassAtK({ threshold: 0.8 }) }\n * );\n */\nexport function createScorer<\n TArgs extends Record<string, any> = {},\n // Use tuple wrapping to prevent distributive conditional types\n TInput = [TArgs] extends [{ input: infer I }] ? I : unknown,\n TExpected = [TArgs] extends [{ expected: infer E }] ? Exclude<E, undefined> : unknown,\n TOutput = [TArgs] extends [{ output: infer O }] ? Exclude<O, undefined> : never,\n TExtra extends Record<string, any> = Simplify<\n Omit<TArgs, 'input' | 'expected' | 'output' | 'trialIndex'>\n >,\n TReturn extends ScorerReturnValue | Promise<ScorerReturnValue> =\n | ScorerReturnValue\n | Promise<ScorerReturnValue>,\n TName extends string = string,\n>(\n /**\n * The name of the scorer\n */\n name: ValidateName<TName>,\n /**\n * The scorer function. Can be sync or async.\n */\n fn: (args: TArgs) => TReturn,\n /**\n * Optional configuration for the scorer, including aggregation for trials.\n */\n options?: ScorerOptions,\n): [TOutput] extends [never]\n ? never\n : Scorer<\n TInput,\n TExpected,\n TOutput,\n TExtra,\n InferScorerMetadata<TReturn>,\n NormalizeScorerReturn<TReturn, InferScorerMetadata<TReturn>>\n > {\n const normalizeScore = (res: ScorerReturnValue): Score => {\n if (typeof res === 'number') {\n return { score: res };\n }\n if (typeof res === 'boolean') {\n return normalizeBooleanScore(res);\n }\n return normalizeBooleanScore(res.score, res.metadata);\n };\n\n const scorer: any = (args: TArgs) => {\n const res = fn(args);\n\n // If user returned a Promise, handle async\n if (res instanceof Promise) {\n return res.then(normalizeScore);\n }\n\n // Otherwise handle sync\n return normalizeScore(res);\n };\n\n // Attach name property to function for pre-execution access\n Object.defineProperty(scorer, 'name', {\n value: name,\n configurable: true,\n enumerable: true,\n });\n\n // Attach aggregation config if provided\n if (options?.aggregation) {\n Object.defineProperty(scorer, 'aggregation', {\n value: options.aggregation,\n configurable: true,\n enumerable: true,\n });\n }\n\n return scorer as [TOutput] extends [never]\n ? never\n : Scorer<\n TInput,\n TExpected,\n TOutput,\n TExtra,\n InferScorerMetadata<TReturn>,\n NormalizeScorerReturn<TReturn, InferScorerMetadata<TReturn>>\n >;\n}\n","import { type Span } from '@opentelemetry/api';\nimport { type Tool as ToolV4 } from 'aiv4';\nimport { type Tool as ToolV5 } from 'aiv5';\nimport { createStartActiveSpan } from './startActiveSpan';\nimport { Attr } from './semconv/attributes';\nimport { typedEntries } from '../util/typedEntries';\nimport {\n setAxiomBaseAttributes,\n getTracer,\n classifyToolError,\n setScopeAttributes,\n} from './utils/wrapperUtils';\nimport { getRedactionPolicy, handleMaybeRedactedAttribute } from './utils/redaction';\n\ntype Tool = ToolV4 | ToolV5;\ntype WrappedTool<T> = T extends Tool ? T : never;\n\ninterface ToolLike {\n execute?: (...args: any[]) => any;\n description?: string;\n [key: string]: any;\n}\n\n/**\n * Wraps a tool to create child spans when the tool's execute method is called.\n *\n * @param toolName The name of the tool (key from the tools object) - span name will be `execute_tool <toolName>`\n * @param tool The tool to wrap\n * @returns The same tool but with a wrapped execute method that creates spans\n */\nexport function wrapTool<T extends ToolLike>(toolName: string, tool: T): T {\n if (!tool || typeof tool !== 'object') {\n console.error('Invalid tool provided to wrapTool, returning unwrapped tool');\n return tool as T;\n }\n\n if (!('execute' in tool) || typeof tool.execute !== 'function') {\n console.error(\n 'Cannot wrap a tool that does not have an execute method, returning unwrapped tool',\n );\n return tool as T;\n }\n\n // After the type guard, we know execute exists and is a function\n const originalExecute = tool.execute as (...args: any[]) => any;\n\n return {\n ...tool,\n execute: async (...executeArgs: Parameters<typeof originalExecute>) => {\n const [args, opts] = executeArgs;\n const tracer = getTracer();\n const startActiveSpan = createStartActiveSpan(tracer);\n const spanName = `${Attr.GenAI.Operation.Name_Values.ExecuteTool} ${toolName}`;\n\n return startActiveSpan(spanName, null, async (span: Span) => {\n const redactionPolicy = getRedactionPolicy();\n\n setAxiomBaseAttributes(span);\n setScopeAttributes(span);\n\n // Handle different opts structures between AI SDK versions\n const toolCallId =\n opts && typeof opts === 'object'\n ? opts.toolCallId || opts.toolCall?.toolCallId\n : undefined;\n\n if (toolCallId) {\n span.setAttribute(Attr.GenAI.Tool.CallID, toolCallId);\n }\n\n span.setAttribute(Attr.GenAI.Operation.Name, Attr.GenAI.Operation.Name_Values.ExecuteTool);\n span.setAttribute(Attr.GenAI.Tool.Name, toolName);\n\n const type = args && typeof args === 'object' && 'type' in args ? args.type : 'function';\n span.setAttribute(Attr.GenAI.Tool.Type, type);\n\n if (tool.description) {\n span.setAttribute(Attr.GenAI.Tool.Description, tool.description);\n }\n\n if (redactionPolicy.mirrorToolPayloadOnToolSpan) {\n try {\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Tool.Arguments,\n JSON.stringify(args),\n redactionPolicy.captureMessageContent,\n );\n } catch (_error) {\n // Handle circular references or other JSON serialization errors\n span.setAttribute(Attr.GenAI.Tool.Arguments, '[Unable to serialize arguments]');\n }\n }\n\n try {\n // Execute the original tool function\n const result = await originalExecute(args, opts);\n\n // Conditionally set tool result message if mirroring is enabled\n if (redactionPolicy.mirrorToolPayloadOnToolSpan) {\n try {\n handleMaybeRedactedAttribute(\n span,\n Attr.GenAI.Tool.Message,\n JSON.stringify(result),\n redactionPolicy.captureMessageContent,\n );\n } catch (_error) {\n // Handle circular references or other JSON serialization errors\n span.setAttribute(Attr.GenAI.Tool.Message, '[Unable to serialize result]');\n }\n }\n\n return result;\n } catch (err) {\n classifyToolError(err, span);\n\n // Always re-throw tool errors to allow the calling code/AI SDK to decide\n // whether to handle gracefully or fail the parent span.\n throw err;\n }\n });\n },\n } as WrappedTool<T>;\n}\n\n/**\n * Wraps multiple tools to create child spans when their execute methods are called.\n *\n * @param tools An object containing tools to wrap\n * @returns The same object with all tools wrapped\n */\nexport function wrapTools<T extends Record<string, ToolLike>>(tools: T): T {\n if (!tools || typeof tools !== 'object') {\n console.error('Invalid tools object provided to wrapTools');\n return tools;\n }\n\n const wrappedTools = {} as T;\n\n for (const [toolName, tool] of typedEntries(tools)) {\n wrappedTools[toolName] = wrapTool(toolName as string, tool);\n }\n\n return wrappedTools;\n}\n","export function typedEntries<T extends object>(obj: T): [keyof T, T[keyof T]][] {\n return Object.entries(obj) as [keyof T, T[keyof T]][];\n}\n","import { getGlobalFlagOverrides } from './evals/context/global-flags';\nimport {\n getEvalContext,\n updateEvalContext,\n addOutOfScopeFlag,\n setConfigScope,\n} from './evals/context/storage';\nimport { validateCliFlags } from './validate-flags';\nimport {\n parsePath,\n dotNotationToNested,\n isValidPath,\n getValueAtPath,\n buildSchemaForPath,\n findSchemaAtPath,\n} from './util/dot-path';\nimport {\n getDef,\n getKind,\n getInnerType,\n getShape,\n isObjectSchema,\n assertZodV4,\n} from './util/zod-internals';\nimport { trace } from '@opentelemetry/api';\nimport { type z, type ZodObject, type ZodDefault, type ZodSchema } from 'zod';\nimport { toOtelAttribute } from './otel/utils/to-otel-attribute';\nimport { Attr } from './otel';\n\ntype DefaultMaxDepth = 8;\n\n// Helper to recursively check if a schema has defaults (including nested objects)\ntype HasDefaults<S> = S extends { _zod: { def: { defaultValue: unknown } } }\n ? true\n : S extends ZodObject<infer Shape>\n ? {\n [K in keyof Shape]: HasDefaults<Shape[K]>;\n } extends Record<keyof Shape, true>\n ? true\n : false\n : false;\n\n// Helper type to extract the underlying ZodObject from ZodDefault wrapper\ntype UnwrapSchema<T> = T extends ZodDefault<infer U> ? U : T;\n\n// Helper to check if ALL fields in a schema have defaults\ntype AllFieldsHaveDefaults<Schema> =\n // First check if the schema itself has an object-level default\n Schema extends { _zod: { def: { defaultValue: unknown } } }\n ? true\n : // Otherwise recursively check if all fields have defaults\n HasDefaults<UnwrapSchema<Schema>>;\n\ninterface AppScopeConfig<\n FlagSchema extends ZodObject<any> | undefined = undefined,\n FactSchema extends ZodObject<any> | undefined = undefined,\n> {\n flagSchema: FlagSchema;\n factSchema?: FactSchema;\n}\n\n/**\n * Recursive type to extract all possible paths from an object type.\n * Uses stack-based depth limiting for better performance.\n *\n * @template T - The object type to extract paths from\n * @template Stack - Internal stack counter (do not set manually)\n * @template MaxDepth - Maximum recursion depth (default: 8 for good balance)\n */\ntype ObjectPaths<\n T,\n Stack extends unknown[] = [],\n MaxDepth extends number = DefaultMaxDepth,\n> = Stack['length'] extends MaxDepth\n ? never\n : T extends object\n ? {\n [K in keyof T]-?: K extends string | number\n ? `${K}` | `${K}.${ObjectPaths<T[K], [1, ...Stack], MaxDepth>}`\n : never;\n }[keyof T]\n : never;\n\n// Type to get value at a specific path in an object\ntype ObjectPathValue<T, P extends string> = P extends keyof T\n ? T[P]\n : P extends `${infer K}.${infer Rest}`\n ? K extends keyof T\n ? ObjectPathValue<T[K], Rest>\n : never\n : never;\n\n/**\n * Generate deep nested paths from flag schema.\n *\n * @template T - ZodObject to extract paths from\n * @template MaxDepth - Maximum recursion depth (default: 8, override for deeper nesting)\n * @example\n * // Default 8-level depth\n * type Paths = DotPaths<MySchema>\n *\n * // Custom depth for deeper nesting (impacts performance)\n * type DeepPaths = DotPaths<MySchema, 12>\n */\nexport type DotPaths<T extends ZodObject<any>, MaxDepth extends number = DefaultMaxDepth> = {\n [NS in keyof T['shape']]:\n | (string & NS) // Include the namespace itself\n | {\n [P in ObjectPaths<\n z.output<UnwrapSchema<T['shape'][NS]>>,\n [],\n MaxDepth\n >]: `${string & NS}.${P}`;\n }[ObjectPaths<z.output<UnwrapSchema<T['shape'][NS]>>, [], MaxDepth>];\n}[keyof T['shape']];\n\ntype PathValue<T extends ZodObject<any>, P extends string> = P extends `${infer NS}.${infer Rest}`\n ? NS extends keyof T['shape']\n ? ObjectPathValue<z.output<UnwrapSchema<T['shape'][NS]>>, Rest>\n : never\n : P extends keyof T['shape']\n ? z.output<UnwrapSchema<T['shape'][P]>>\n : never;\n\ntype DotNotationFlagFunction<FS extends ZodObject<any> | undefined> =\n FS extends ZodObject<any> ? <P extends DotPaths<FS>>(path: P) => PathValue<FS, P> : never;\n\ntype FactFunction<SC extends ZodObject<any> | undefined> =\n SC extends ZodObject<any>\n ? <P extends DotPaths<SC> & string>(name: P, value: PathValue<SC, P>) => void\n : never;\n\ntype OverrideFlagsFunction<FS extends ZodObject<any> | undefined> =\n FS extends ZodObject<any>\n ? (partial: { [K in DotPaths<FS>]?: PathValue<FS, K> }) => void\n : (partial: Record<string, any>) => void;\n\ntype WithFlagsFunction<FS extends ZodObject<any> | undefined> =\n FS extends ZodObject<any>\n ? <T>(overrides: { [K in DotPaths<FS>]?: PathValue<FS, K> }, fn: () => T) => T\n : <T>(overrides: Record<string, any>, fn: () => T) => T;\n\ntype PickFlagsFunction<FS extends ZodObject<any> | undefined> =\n FS extends ZodObject<any>\n ? {\n // Spread arguments: pickFlags2('foo', 'bar')\n <K extends ReadonlyArray<DotPaths<FS> & string>>(...paths: K): K;\n // Array argument: pickFlags2(['foo', 'bar'])\n <K extends ReadonlyArray<DotPaths<FS> & string>>(paths: K): K;\n }\n : never;\n\nexport interface AppScope<\n FS extends ZodObject<any> | undefined,\n SC extends ZodObject<any> | undefined,\n> {\n flag: DotNotationFlagFunction<FS>;\n fact: FactFunction<SC>;\n overrideFlags: OverrideFlagsFunction<FS>;\n withFlags: WithFlagsFunction<FS>;\n pickFlags: PickFlagsFunction<FS>;\n getAllDefaultFlags: () => Record<string, any>;\n}\n\n/**\n * Check if a flag path is covered by the picked flags.\n * @param flagPath - The flag path to check (e.g., 'foo', 'foo.bar')\n * @param pickedFlags - Array of picked flag paths\n * @returns true if the flag is covered by picked flags\n */\nexport function isPickedFlag(flagPath: string, pickedFlags?: string[]): boolean {\n if (!pickedFlags) {\n // If no picked flags are provided, all flags are allowed\n return true;\n }\n\n if (pickedFlags.length === 0) {\n // If no flags are picked, all flags are allowed\n return true;\n }\n\n return pickedFlags.some((picked) => {\n // Exact match\n if (flagPath === picked) {\n return true;\n }\n // Nested match: flagPath starts with picked flag followed by a dot\n if (flagPath.startsWith(picked + '.')) {\n return true;\n }\n return false;\n });\n}\n\n// Helper to recursively validate that schemas don't contain union types\nfunction assertNoUnions(schema: unknown, path = 'schema'): void {\n if (!schema) return;\n\n const kind = getKind(schema);\n if (!kind) return;\n\n // Unwrap transparent containers\n if (kind === 'default' || kind === 'optional' || kind === 'nullable') {\n const innerType = getInnerType(schema);\n return assertNoUnions(innerType, path);\n }\n\n // Hard-fail on unions\n if (kind === 'union' || kind === 'discriminatedunion') {\n throw new Error(`[AxiomAI] Union types are not supported in flag schemas (found at \"${path}\")`);\n }\n\n // Recurse into compound types\n if (kind === 'object') {\n const shape = getShape(schema);\n if (shape) {\n for (const [k, v] of Object.entries(shape)) {\n assertNoUnions(v, `${path}.${k}`);\n }\n }\n } else if (kind === 'array') {\n const innerType = getInnerType(schema);\n if (innerType) {\n assertNoUnions(innerType, `${path}[]`);\n }\n } else if (kind === 'record') {\n const def = getDef(schema);\n const valueType = def?.valueType;\n if (valueType) {\n assertNoUnions(valueType, `${path}{}`);\n }\n }\n}\n\n/**\n * Recursively verify that all leaf fields in the schema have defaults.\n * Throws with a detailed error message listing all paths missing defaults.\n * TODO: this should probably be in an adapter, not the core lib...\n */\nfunction ensureAllDefaults(schema: unknown, path = ''): void {\n const missingDefaults: string[] = [];\n\n function checkDefaults(current: unknown, currentPath: string): void {\n if (!current) return;\n\n const kind = getKind(current);\n if (!kind) return;\n\n const def = getDef(current);\n const hasDefault = def?.defaultValue !== undefined;\n\n // Unwrap transparent containers and check their inner type\n if (kind === 'default') {\n // This has a default, we're done - no need to check inner type\n return;\n }\n\n if (kind === 'optional' || kind === 'nullable') {\n // Transparent wrappers - check inner type\n const innerType = getInnerType(current);\n return checkDefaults(innerType, currentPath);\n }\n\n // ZodRecord is not allowed\n if (kind === 'record') {\n throw new Error(\n `[AxiomAI] ZodRecord is not supported in flag schemas (found at \"${currentPath || 'root'}\")\\n` +\n `All flag fields must have known keys and defaults. Consider using z.object() instead.`,\n );\n }\n\n // For objects: if there's an object-level default, we're good\n // Otherwise, recursively check all fields\n if (kind === 'object') {\n if (hasDefault) {\n // Object-level default covers all nested fields\n return;\n }\n\n const shape = getShape(current);\n if (shape) {\n for (const [k, v] of Object.entries(shape)) {\n const nextPath = currentPath ? `${currentPath}.${k}` : k;\n checkDefaults(v, nextPath);\n }\n }\n return;\n }\n\n // For arrays: arrays are leaf types (no per-index access)\n // Just check if the array schema itself has a default\n if (kind === 'array') {\n if (!hasDefault) {\n missingDefaults.push(currentPath || 'root');\n }\n return;\n }\n\n // For all other types (primitives, etc): must have a default\n if (!hasDefault) {\n missingDefaults.push(currentPath || 'root');\n }\n }\n\n checkDefaults(schema, path);\n\n if (missingDefaults.length > 0) {\n throw new Error(\n `[AxiomAI] All flag fields must have defaults. Missing defaults for:\\n` +\n missingDefaults.map((p) => ` - ${p}`).join('\\n') +\n `\\n\\nAdd .default(value) to these fields or to their parent objects.`,\n );\n }\n}\n\n/**\n * Create a new application-level evaluation scope.\n *\n * @param config.flagSchema A zod object describing the schema for flags **(required)**\n * @param config.factSchema A zod object describing the schema for facts (optional)\n *\n * @example\n * import { z } from 'zod';\n *\n * const { flag, fact, withFlags, pickFlags, overrideFlags } = createAppScope({\n * flagSchema: z.object({\n * ui: z.object({\n * darkMode: z.boolean().default(false),\n * theme: z.object({\n * primary: z.string().default('#00f'),\n * }),\n * }),\n * api: z.object({ \n endpoint: z.string().default('/api') \n }),\n * }),\n * factSchema: z.object({\n * userAction: z.string(),\n * timing: z.number(),\n * }),\n * });\n *\n * // Typed flag access\n * const dark = flag('ui.darkMode'); // inferred boolean\n * const theme = flag('ui.theme'); // entire object\n * const primary = flag('ui.theme.primary'); // '#00f'\n * const endpoint = flag('api.endpoint'); // uses schema default\n *\n * // Typed fact recording\n * fact('userAction', 'clicked_button');\n * fact('timing', 1250);\n *\n * // Temporarily override flags for a block of code\n * withFlags({ 'ui.darkMode': true }, () => {\n * // code here, `ui.darkMode` will be true in this block and reset after\n * });\n *\n * // Override flags globally for the current evaluation run\n * overrideFlags({ 'api.endpoint': '/custom' });\n */\n// Overload: Require all fields to have defaults (compile-time check)\nexport function createAppScope<\n FlagSchema extends ZodObject<any>,\n FactSchema extends ZodObject<any> | undefined = undefined,\n>(\n config: AllFieldsHaveDefaults<FlagSchema> extends true\n ? AppScopeConfig<FlagSchema, FactSchema>\n : {\n flagSchema: FlagSchema;\n factSchema?: FactSchema;\n __error__: 'createAppScope: flagSchema must have .default() for all leaf fields';\n },\n): AppScope<FlagSchema, FactSchema>;\n\n// Implementation signature: Keep broad for internal use\nexport function createAppScope<\n FlagSchema extends ZodObject<any> | undefined = undefined,\n FactSchema extends ZodObject<any> | undefined = undefined,\n>(config: AppScopeConfig<FlagSchema, FactSchema>): AppScope<FlagSchema, FactSchema> {\n // Store schemas for runtime validation\n const flagSchemaConfig = config?.flagSchema;\n const factSchemaConfig = config?.factSchema;\n\n // Reject Zod v3 schemas\n if (flagSchemaConfig) {\n assertZodV4(flagSchemaConfig, 'flagSchema');\n }\n if (factSchemaConfig) {\n assertZodV4(factSchemaConfig, 'factSchema');\n }\n\n // reject union types\n if (flagSchemaConfig) {\n assertNoUnions(flagSchemaConfig, 'flagSchema');\n }\n\n // Ensure all fields have defaults\n if (flagSchemaConfig) {\n ensureAllDefaults(flagSchemaConfig);\n }\n\n // CLI validation with dot notation support\n if (flagSchemaConfig) {\n validateCliFlags(flagSchemaConfig);\n }\n\n // Helper to check if a path represents a namespace access (no dots after first segment)\n function isNamespaceAccess(segments: string[]): boolean {\n if (!flagSchemaConfig || segments.length === 0) return false;\n\n // For root namespace (like 'ui'), check if it exists in the ZodObject shape\n if (segments.length === 1) {\n return flagSchemaConfig.shape ? segments[0] in flagSchemaConfig.shape : false;\n }\n\n // For nested paths (like 'app.ui.layout'), need to check if the path points to an object schema\n const schema = findSchemaAtPath(flagSchemaConfig, segments);\n return isObjectSchema(schema);\n }\n\n // Helper function to check if a schema has complete defaults at runtime\n // This mirrors the compile-time AllFieldsHaveDefaults<> type\n\n // Recursively build object with all defaults from a Zod schema\n function buildObjectWithDefaults(schema: unknown): unknown {\n if (!schema) return undefined;\n\n const kind = getKind(schema);\n if (!kind) return undefined;\n\n // `directDefault`: default for the entire object\n // If this is not present, we try to construct the defaults from child fields (recursively)\n const directDefault = extractDefault(schema);\n if (directDefault !== undefined) {\n return directDefault;\n }\n\n // We can only collect defaults from child fields if we're dealing with an object (for a scalar, there are no children)\n if (kind === 'object') {\n const shape = getShape(schema);\n if (shape) {\n const result: Record<string, unknown> = {};\n\n for (const [key, fieldSchema] of Object.entries(shape)) {\n const fieldValue = buildObjectWithDefaults(fieldSchema);\n result[key] = fieldValue;\n }\n\n return result;\n }\n }\n\n // No direct default, and it's not an object\n return undefined;\n }\n\n function extractDefault(schema: unknown): unknown {\n if (!schema) return undefined;\n\n // Unwrap transparent containers first, checking for defaults at each level\n let current: unknown = schema;\n\n for (let i = 0; i < 10; i++) {\n const def = getDef(current);\n if (!def) break;\n\n // Check for default value at current level\n if (def.defaultValue !== undefined) {\n return typeof def.defaultValue === 'function' ? def.defaultValue() : def.defaultValue;\n }\n\n // Unwrap one level if possible\n const inner = getInnerType(current);\n if (inner) {\n current = inner;\n } else {\n // No more wrapping, stop here\n break;\n }\n }\n\n return undefined;\n }\n\n function validateFinalFlagValue(\n dotPath: string,\n value: unknown,\n ): { ok: true; parsed: unknown } | { ok: false } {\n if (!flagSchemaConfig) return { ok: true, parsed: value };\n\n const segments = parsePath(dotPath);\n\n // 1. Fast-path: validate directly with field-level schema\n const fieldSchema = findSchemaAtPath(flagSchemaConfig, segments);\n if (fieldSchema) {\n const direct = (fieldSchema as ZodSchema<any>).safeParse(value);\n if (direct.success) return { ok: true, parsed: direct.data };\n // If we have a field schema but validation failed, this is a real error\n return { ok: false };\n }\n\n // 2. If we don't have a field schema, check if the path is even valid in our schema\n // Don't validate values for paths that don't exist in the schema - just pass them through\n const hasValidNamespace = flagSchemaConfig.shape && segments[0] in flagSchemaConfig.shape;\n if (!hasValidNamespace) {\n // Invalid namespace - pass through without validation (for backward compatibility with fallback values)\n return { ok: true, parsed: value };\n }\n\n // 3. For valid namespaces but invalid paths, try nested object validation\n const nested = dotNotationToNested({ [dotPath]: value });\n const nestedResult = flagSchemaConfig.strict().partial().safeParse(nested);\n if (nestedResult.success) {\n const parsed = getValueAtPath(nestedResult.data, segments) ?? value;\n return { ok: true, parsed };\n }\n\n // 4. If nested validation failed but the namespace is valid, allow it for backward compatibility\n return { ok: true, parsed: value };\n }\n\n function hasUndefinedLeaves(obj: unknown): boolean {\n if (obj === undefined) return true;\n if (obj === null || typeof obj !== 'object') return false;\n return Object.values(obj).some((v) =>\n typeof v === 'object' && v !== null ? hasUndefinedLeaves(v) : v === undefined,\n );\n }\n\n /**\n * Get flag value with dot notation path support and schema validation.\n * All flag fields must have .default() values in the schema.\n * Precedence: CLI overrides -> Context overrides -> Schema defaults → Error\n *\n * @param path - Dot notation path to the flag (e.g., 'ui.theme' or 'api.timeout')\n * @returns The flag value or undefined if path is invalid\n */\n function flag<P extends string>(path: P): unknown {\n const segments = parsePath(path);\n\n const ctx = getEvalContext();\n const globalOverrides = getGlobalFlagOverrides();\n\n if (!isPickedFlag(path, ctx.pickedFlags)) {\n addOutOfScopeFlag(path);\n }\n\n let finalValue: any;\n let source: 'cli' | 'ctx' | 'schema' | undefined;\n\n // Flag precedence order:\n // 1. CLI overrides (getGlobalFlagOverrides)\n // 2. Eval context overrides (getEvalContext().flags)\n // 3. Schema/object defaults\n // 4. undefined + console.error\n\n // 1. Check CLI overrides first (highest priority)\n if (path in globalOverrides) {\n finalValue = globalOverrides[path];\n source = 'cli';\n }\n // 2. Check context overrides (from withFlags() or overrideFlags)\n else if (path in ctx.flags) {\n finalValue = ctx.flags[path];\n source = 'ctx';\n }\n // 3. Resolve from schema\n else {\n if (!flagSchemaConfig) {\n console.error(`[AxiomAI] Invalid flag: \"${path}\"`);\n return undefined;\n }\n\n // Check valid namespace\n const hasValidNamespace = flagSchemaConfig.shape && segments[0] in flagSchemaConfig.shape;\n if (!hasValidNamespace) {\n console.error(`[AxiomAI] Invalid flag: \"${path}\"`);\n return undefined;\n }\n\n const schemaForPath = findSchemaAtPath(flagSchemaConfig, segments);\n\n // If schema path doesn't exist, try extracting from parent object-level defaults\n if (!schemaForPath) {\n const namespaceSchema = findSchemaAtPath(flagSchemaConfig, [segments[0]]);\n if (namespaceSchema) {\n const namespaceObject = buildObjectWithDefaults(namespaceSchema);\n if (namespaceObject && typeof namespaceObject === 'object') {\n finalValue = getValueAtPath(namespaceObject, segments.slice(1));\n }\n }\n\n if (finalValue === undefined) {\n console.error(`[AxiomAI] Invalid flag: \"${path}\"`);\n return undefined;\n }\n }\n // Check if this is a namespace access (returning whole objects)\n else if (isNamespaceAccess(segments)) {\n finalValue = buildObjectWithDefaults(schemaForPath);\n\n // If buildObjectWithDefaults fails or returns incomplete object, try extracting from parent defaults\n if (finalValue === undefined || hasUndefinedLeaves(finalValue)) {\n const nsSchema = findSchemaAtPath(flagSchemaConfig, [segments[0]]);\n if (nsSchema) {\n const nsObj = buildObjectWithDefaults(nsSchema);\n if (nsObj && typeof nsObj === 'object') {\n const extracted = getValueAtPath(nsObj, segments.slice(1));\n if (extracted !== undefined) {\n finalValue = extracted;\n }\n }\n }\n }\n\n if (finalValue === undefined) {\n console.error(`[AxiomAI] Invalid flag: \"${path}\"`);\n return undefined;\n }\n }\n // Leaf access: try field-level default first\n else {\n finalValue = extractDefault(schemaForPath);\n\n // If no field-level default, try extracting from parent object-level default\n if (finalValue === undefined) {\n const nsSchema = findSchemaAtPath(flagSchemaConfig, [segments[0]]);\n if (nsSchema) {\n const nsObj = buildObjectWithDefaults(nsSchema);\n if (nsObj && typeof nsObj === 'object') {\n finalValue = getValueAtPath(nsObj, segments.slice(1));\n }\n }\n\n if (finalValue === undefined) {\n console.error(`[AxiomAI] Invalid flag: \"${path}\"`);\n return undefined;\n }\n }\n }\n\n source = 'schema';\n }\n\n // Validate only overrides (schema values are pre-validated)\n if (source !== 'schema') {\n const validation = validateFinalFlagValue(path, finalValue);\n if (!validation.ok) {\n console.error(`[AxiomAI] Invalid flag: \"${path}\" - value does not match schema`);\n }\n }\n\n updateEvalContext({ [path]: finalValue });\n\n const span = trace.getActiveSpan();\n if (span?.isRecording()) {\n const attr = toOtelAttribute(finalValue);\n if (attr) {\n span.setAttribute(Attr.__EXPERIMENTAL_Flag(path), attr);\n }\n }\n\n return finalValue;\n }\n\n /**\n * Record a typed fact value for tracking and telemetry with dot notation support.\n * @param name - The fact name/key\n */\n function fact<N extends string>(name: N, value: unknown): void {\n let finalValue = value;\n\n // Validate with schema if provided (but only log errors for now to match tests)\n if (factSchemaConfig) {\n const segments = parsePath(name);\n\n let success = true;\n // Fast path check - validate path exists in schema before creating nested object\n if (!isValidPath(factSchemaConfig, segments)) {\n success = false;\n } else {\n try {\n // Build a schema specific to this path that makes sibling fields optional\n const pathSchema = buildSchemaForPath(factSchemaConfig, segments);\n\n // Convert dot notation to nested object for validation\n const nested = dotNotationToNested({ [name]: value });\n const result = pathSchema.safeParse(nested);\n\n if (!result.success) {\n success = false;\n } else {\n finalValue = getValueAtPath(result.data, segments) ?? value;\n }\n } catch (_error) {\n // buildSchemaForPath can throw if schema structure is invalid\n success = false;\n }\n }\n\n if (!success) {\n console.error(`[AxiomAI] Invalid fact: \"${name}\"`);\n }\n }\n\n updateEvalContext(undefined, { [name]: finalValue });\n\n const span = trace.getActiveSpan();\n if (span?.isRecording()) {\n const attr = toOtelAttribute(finalValue);\n if (attr) {\n span.setAttribute(Attr.__EXPERIMENTAL_Fact(name), attr);\n }\n }\n }\n\n /**\n * Override flag values for the current evaluation context with type safety.\n * @param partial - Typed flag overrides that must match the flag schema paths and types\n */\n function overrideFlags(partial: Record<string, any>): void {\n const ctx = getEvalContext();\n Object.assign(ctx.flags, partial);\n }\n\n /**\n * Execute code with temporary flag overrides, automatically restoring original values.\n * @param overrides - Typed flag overrides that must match the flag schema paths and types\n * @param fn - Function to execute with the overridden flags\n * @returns The return value of the executed function\n */\n function withFlags<T>(overrides: Record<string, any>, fn: () => T): T {\n const ctx = getEvalContext();\n const originalFlags = { ...ctx.flags };\n\n // Apply overrides\n Object.assign(ctx.flags, overrides);\n\n try {\n return fn();\n } finally {\n // Restore original flags by clearing and reassigning\n Object.keys(ctx.flags).forEach((key) => delete ctx.flags[key]);\n Object.assign(ctx.flags, originalFlags);\n }\n }\n\n const pickFlags = ((...args: any[]) => {\n // Handle both array and spread arguments\n return args[0] && Array.isArray(args[0]) ? args[0] : args;\n }) as PickFlagsFunction<FlagSchema>;\n\n function flattenToDot(obj: any, prefix: string[] = [], out: Record<string, any> = {}) {\n if (obj && typeof obj === 'object' && !Array.isArray(obj)) {\n for (const [k, v] of Object.entries(obj)) {\n flattenToDot(v, [...prefix, k], out);\n }\n } else {\n if (prefix.length > 0) {\n out[prefix.join('.')] = obj;\n }\n }\n return out;\n }\n\n function getAllDefaultFlags(): Record<string, any> {\n if (!flagSchemaConfig) return {};\n const defaultsObj = buildObjectWithDefaults(flagSchemaConfig);\n if (defaultsObj && typeof defaultsObj === 'object') {\n return flattenToDot(defaultsObj as Record<string, any>);\n }\n return {};\n }\n\n const scope = {\n flag: flag as any as DotNotationFlagFunction<FlagSchema>,\n fact: fact as any as FactFunction<FactSchema>,\n overrideFlags: overrideFlags as any as OverrideFlagsFunction<FlagSchema>,\n withFlags: withFlags as any as WithFlagsFunction<FlagSchema>,\n pickFlags,\n getAllDefaultFlags,\n } as AppScope<FlagSchema, FactSchema>;\n\n // Expose scope to current eval context for downstream collection (suite-end summaries)\n setConfigScope(scope as any);\n\n return scope;\n}\n","/**\n * Global flag overrides storage for CLI flag functionality.\n * Uses globalThis for process-wide flag persistence.\n */\n\nconst GLOBAL_OVERRIDES_SYMBOL = Symbol.for('axiom.global_flag_overrides');\n\nfunction getRoot(): Record<string, any> {\n return (globalThis as any)[GLOBAL_OVERRIDES_SYMBOL] ?? {};\n}\n\nfunction setRoot(val: Record<string, any>): void {\n (globalThis as any)[GLOBAL_OVERRIDES_SYMBOL] = val;\n}\n\n/**\n * Set global flag overrides (called by CLI) - persists until cleared\n */\nexport function setGlobalFlagOverrides(overrides: Record<string, any>): void {\n setRoot(overrides);\n}\n\n/**\n * Get global flag overrides (called by flag functions)\n */\nexport function getGlobalFlagOverrides(): Record<string, any> {\n return getRoot();\n}\n\n/**\n * Clear global flag overrides (for testing)\n */\nexport function clearGlobalFlagOverrides(): void {\n setRoot({});\n}\n","import { trace } from '@opentelemetry/api';\nimport { createAsyncHook } from './manager';\nimport { type createAppScope } from '../../app-scope';\nimport type { ResolvedAxiomConfig } from '../../config/index';\nimport type { OutOfScopeFlagAccess } from '../eval.types';\n\n// Global fallback for config scope when called outside of eval context (e.g., module import time)\nconst CONFIG_SCOPE_SYMBOL = Symbol.for('axiom.eval.configScope');\nfunction getGlobalConfigScope(): ReturnType<typeof createAppScope> | undefined {\n return (globalThis as any)[CONFIG_SCOPE_SYMBOL];\n}\nfunction setGlobalConfigScope(scope: ReturnType<typeof createAppScope>) {\n (globalThis as any)[CONFIG_SCOPE_SYMBOL] = scope;\n}\n\n// Global storage for axiom config (accessible from reporters)\nconst AXIOM_CONFIG_SYMBOL = Symbol.for('axiom.eval.config');\nexport function getAxiomConfig(): ResolvedAxiomConfig | undefined {\n return (globalThis as any)[AXIOM_CONFIG_SYMBOL];\n}\nexport function setAxiomConfig(config: ResolvedAxiomConfig) {\n (globalThis as any)[AXIOM_CONFIG_SYMBOL] = config;\n}\n\n// Mini-context for in-process access\nexport const EVAL_CONTEXT = createAsyncHook<{\n flags: Record<string, any>;\n facts: Record<string, any>;\n configScope?: ReturnType<typeof createAppScope>;\n pickedFlags?: string[];\n outOfScopeFlags?: OutOfScopeFlagAccess[];\n parent?: EvalContextData<any, any>;\n overrides?: Record<string, any>;\n accessedFlagKeys?: string[];\n}>('eval-context');\n\nexport interface EvalContextData<Flags = any, Facts = any> {\n flags: Partial<Flags>;\n facts: Partial<Facts>;\n configScope?: ReturnType<typeof createAppScope>;\n pickedFlags?: string[];\n outOfScopeFlags?: OutOfScopeFlagAccess[];\n parent?: EvalContextData<Flags, Facts>;\n overrides?: Record<string, any>;\n accessedFlagKeys?: string[];\n}\n\nexport function getEvalContext<\n Flags extends Record<string, unknown> = any,\n Facts extends Record<string, unknown> = any,\n>(): EvalContextData<Flags, Facts> {\n const ctx = EVAL_CONTEXT.get();\n if (!ctx) {\n // Return empty context if none exists\n return {\n flags: {} as Partial<Flags>,\n facts: {} as Partial<Facts>,\n pickedFlags: undefined,\n outOfScopeFlags: undefined,\n };\n }\n return {\n flags: ctx.flags as Partial<Flags>,\n facts: ctx.facts as Partial<Facts>,\n pickedFlags: ctx.pickedFlags,\n outOfScopeFlags: ctx.outOfScopeFlags,\n parent: ctx.parent,\n overrides: ctx.overrides,\n accessedFlagKeys: ctx.accessedFlagKeys,\n };\n}\n\nexport function updateEvalContext(flags?: Record<string, any>, facts?: Record<string, any>) {\n const current = EVAL_CONTEXT.get();\n if (!current) {\n // Silently return - this is expected when running capabilities outside of eval\n return;\n }\n\n // Mutate the existing context (safe within the same async context)\n if (flags) {\n Object.assign(current.flags, flags);\n // Track accessed flag keys for runtime reporting\n if (!current.accessedFlagKeys) current.accessedFlagKeys = [];\n for (const key of Object.keys(flags)) {\n if (!current.accessedFlagKeys.includes(key)) {\n current.accessedFlagKeys.push(key);\n }\n }\n }\n if (facts) {\n Object.assign(current.facts, facts);\n }\n}\n\n/**\n * Parse stack trace to extract relevant frames, filtering out internal/framework frames\n */\nfunction parseStackTrace(stack: string): string[] {\n const lines = stack.split('\\n');\n const frames: string[] = [];\n\n for (const line of lines) {\n const trimmed = line.trim();\n\n if (!trimmed || !trimmed.startsWith('at ')) {\n continue;\n }\n\n // filter out frames that users likely don't care about\n if (\n trimmed.includes('node_modules') ||\n trimmed.includes('node:internal') ||\n trimmed.includes('addOutOfScopeFlag') ||\n trimmed.includes('storage.ts') ||\n // Keep app-scope.ts frames that aren't the flag() function itself\n (trimmed.includes('app-scope.ts') &&\n (trimmed.includes('flag (') || trimmed.includes('flag2 (')))\n ) {\n continue;\n }\n\n frames.push(trimmed.replace('at ', ''));\n }\n\n return frames.slice(0, 5);\n}\n\nexport function addOutOfScopeFlag(flagPath: string) {\n const current = EVAL_CONTEXT.get();\n if (!current) {\n console.warn('addOutOfScopeFlag called outside of evaluation context');\n return;\n }\n\n if (!current.outOfScopeFlags) {\n current.outOfScopeFlags = [];\n }\n\n const stack = new Error().stack || '';\n const stackTrace = parseStackTrace(stack);\n\n current.outOfScopeFlags.push({\n flagPath,\n accessedAt: Date.now(),\n stackTrace,\n });\n}\n\n// Helper: write to current span + context\nexport function putOnSpan(kind: 'flag' | 'fact', key: string, value: any) {\n const span = trace.getActiveSpan();\n if (span?.isRecording()) {\n span.setAttributes({ [`${kind}.${key}`]: value });\n }\n}\n\n/**\n * Resolve a flag value by walking the parent chain, checking overrides first\n */\nexport function resolveFlagValue<V>(ctx: EvalContextData<any, any>, key: string): V {\n // First check current context overrides\n if (ctx.overrides && key in ctx.overrides) {\n return ctx.overrides[key] as V;\n }\n\n // Then check current context flags\n if (key in ctx.flags) {\n return ctx.flags[key] as V;\n }\n\n // Walk up the parent chain\n if (ctx.parent) {\n return resolveFlagValue(ctx.parent, key);\n }\n\n // This should not happen\n // Return undefined as a fallback\n console.error(`[AxiomAI] Flag \"${key}\" not found in context, returning undefined`);\n return undefined as V;\n}\n\n/**\n * Create an overlay context that inherits from the current context\n * but isolates overrides to this specific execution context.\n */\nfunction createOverlayContext(overrides: Record<string, any>): any {\n const current = EVAL_CONTEXT.get();\n if (!current) {\n if (process.env.NODE_ENV !== 'test') {\n console.warn('createOverlayContext called outside of evaluation context');\n }\n return {\n flags: { ...overrides },\n facts: {},\n pickedFlags: [],\n outOfScopeFlags: [],\n overrides: { ...overrides },\n };\n }\n\n // Create merged flags for backwards compatibility\n const mergedFlags = { ...current.flags, ...overrides };\n\n return {\n ...current,\n flags: mergedFlags,\n parent: current,\n overrides: { ...overrides },\n };\n}\n\n/**\n * Execute a function with flag overrides that are isolated to the execution context.\n * This creates an overlay context that inherits from the current context but isolates\n * the overrides to prevent them from leaking to sibling operations.\n */\nexport function withFlagOverrides<T>(overrides: Record<string, any>, fn: () => T): T {\n const overlayContext = createOverlayContext(overrides);\n\n // Write overridden flags to span for observability\n for (const [key, value] of Object.entries(overrides)) {\n putOnSpan('flag', key, value);\n }\n\n return EVAL_CONTEXT.run(overlayContext, fn);\n}\n\nexport function withEvalContext<T>(\n options: {\n initialFlags?: Record<string, any>;\n pickedFlags?: string[];\n } = {},\n fn: () => T,\n): T {\n const { initialFlags = {}, pickedFlags = [] } = options;\n return EVAL_CONTEXT.run(\n {\n flags: { ...initialFlags },\n facts: {},\n pickedFlags,\n outOfScopeFlags: [],\n accessedFlagKeys: [],\n },\n fn,\n );\n}\n\n/**\n * Set the config scope for the current evaluation context.\n * This makes the scope available for global flag/fact access.\n *\n * Also stores a global fallback so suite-end summary can access schema defaults\n * even if createAppScope ran outside the active async context.\n */\nexport function setConfigScope(scope: ReturnType<typeof createAppScope>) {\n const current = EVAL_CONTEXT.get();\n if (current) {\n current.configScope = scope;\n }\n // Always set global fallback\n setGlobalConfigScope(scope);\n}\n\n/**\n * Get the config scope from the current evaluation context.\n * Falls back to global scope when no context is active.\n */\nexport function getConfigScope(): ReturnType<typeof createAppScope> | undefined {\n const current = EVAL_CONTEXT.get();\n return current?.configScope ?? getGlobalConfigScope();\n}\n\n/**\n * Get the picked flags from the current evaluation context.\n * Returns undefined if no picked flags are set or if called outside eval context.\n */\nexport function getPickedFlags(): string[] | undefined {\n return EVAL_CONTEXT.get()?.pickedFlags;\n}\n","import { createRequire } from 'node:module';\n\ninterface ContextManager<T = any> {\n getStore(): T | undefined;\n run<R>(value: T, fn: () => R): R;\n}\n\nconst CONTEXT_MANAGER_SYMBOL = Symbol.for('axiom.context_manager');\n\nfunction getGlobalContextManager(): ContextManager | undefined {\n return (globalThis as any)[CONTEXT_MANAGER_SYMBOL];\n}\n\nfunction setGlobalContextManager(manager: ContextManager): void {\n (globalThis as any)[CONTEXT_MANAGER_SYMBOL] = manager;\n}\n\nconst isNodeJS = typeof process !== 'undefined' && !!process.versions?.node;\n\nfunction getContextManager(): ContextManager {\n // Check global Symbol registry cache first (shared across VM contexts)\n const existing = getGlobalContextManager();\n if (existing) return existing;\n\n let manager: ContextManager;\n\n if (isNodeJS) {\n try {\n // Resolve AsyncLocalStorage in both ESM and CJS Node contexts without bundler interference\n let AsyncLocalStorage: any;\n\n // Use createRequire to obtain a require in ESM\n const req = createRequire(import.meta.url);\n try {\n AsyncLocalStorage = req('node:async_hooks').AsyncLocalStorage;\n } catch {\n AsyncLocalStorage = req('async_hooks').AsyncLocalStorage;\n }\n\n manager = new AsyncLocalStorage();\n } catch (error) {\n // Fallback if AsyncLocalStorage cannot be loaded\n console.warn('AsyncLocalStorage not available, using fallback context manager:', error);\n manager = createFallbackManager();\n }\n } else {\n // Browser/CF Workers - simple fallback (no warning needed here)\n console.warn('AsyncLocalStorage not available, using fallback context manager');\n manager = createFallbackManager();\n }\n\n // Cache using Symbol to share across VM contexts\n setGlobalContextManager(manager);\n\n return manager;\n}\n\nfunction createFallbackManager(): ContextManager {\n let currentContext: any = null;\n return {\n getStore: () => currentContext,\n run: <R>(value: any, fn: () => R): R => {\n const prev = currentContext;\n currentContext = value;\n try {\n return fn();\n } finally {\n currentContext = prev;\n }\n },\n };\n}\n\nexport function createAsyncHook<T>(_name: string) {\n return {\n get(): T | undefined {\n const manager = getContextManager();\n if (manager.getStore) {\n return manager.getStore();\n }\n return undefined;\n },\n run<R>(value: T, fn: () => R): R {\n const manager = getContextManager();\n return manager.run(value, fn);\n },\n };\n}\n\n/**\n * Reset the context manager singleton for tests.\n * This clears the global cache and forces a new AsyncLocalStorage instance to be created.\n * Useful for test isolation when needed.\n */\nexport function __resetContextManagerForTests(): void {\n delete (globalThis as any)[CONTEXT_MANAGER_SYMBOL];\n}\n","import { type ZodObject } from 'zod';\nimport { getGlobalFlagOverrides } from './evals/context/global-flags';\nimport { formatZodErrors, generateFlagExamples } from './cli/utils/format-zod-errors';\nimport { dotNotationToNested, isValidPath, parsePath } from './util/dot-path';\nimport { makeDeepPartial } from './util/deep-partial-schema';\nimport { assertZodV4 } from './util/zod-internals';\n\n/**\n * Validate CLI flag overrides against a schema early in eval execution.\n * Call this at the top of your eval file to fail fast on invalid flags.\n *\n * @param flagSchema - Zod schema to validate CLI flags against\n * @throws Error with helpful message if validation fails\n */\nexport function validateCliFlags(flagSchema: ZodObject<any>): void {\n assertZodV4(flagSchema, 'flagSchema');\n const globalOverrides = getGlobalFlagOverrides();\n\n if (Object.keys(globalOverrides).length === 0) {\n // No CLI flags provided, nothing to validate\n return;\n }\n\n validateFlags(flagSchema, globalOverrides);\n}\n\nfunction validateFlags(flagSchema: ZodObject<any>, globalOverrides: Record<string, any>): void {\n // First pass: check all paths exist in schema\n for (const [dotPath, _value] of Object.entries(globalOverrides)) {\n const segments = parsePath(dotPath);\n if (!isValidPath(flagSchema, segments)) {\n console.error('❌ Invalid CLI flags:');\n console.error(` • flag '${dotPath}': Invalid flag path`);\n console.error('\\n🔧 Fix your CLI flags and try again.\\n');\n process.exit(1);\n }\n }\n\n // Second pass: validate values using nested object approach with deep partial\n // This allows providing only some flags without requiring all nested objects\n const nestedObject = dotNotationToNested(globalOverrides);\n const deepPartialSchema = makeDeepPartial(flagSchema);\n const result = deepPartialSchema.safeParse(nestedObject);\n\n if (!result.success) {\n console.error('❌ Invalid CLI flags:');\n console.error(formatZodErrors(result.error));\n\n const examples = generateFlagExamples(result.error);\n if (examples.length > 0) {\n console.error('\\n💡 Valid examples:');\n examples.forEach((example) => console.error(` ${example}`));\n }\n\n console.error('\\n🔧 Fix your CLI flags and try again.\\n');\n process.exit(1);\n }\n}\n","import { type ZodError } from 'zod';\nimport type { ZodIssue } from 'zod/v3';\nimport type { $ZodIssue } from 'zod/v4/core';\n\n/**\n * Format ZodError issues into user-friendly CLI error messages\n */\nexport function formatZodErrors(error: ZodError): string {\n const issues = error.issues;\n const messages: string[] = [];\n\n for (const issue of issues) {\n const path = issue.path.join('.');\n const message = formatIssueMessage(issue, path);\n messages.push(` • ${message}`);\n }\n\n return messages.join('\\n');\n}\n\nfunction formatIssueMessage(issue: any, path: string): string {\n switch (issue.code) {\n case 'invalid_type':\n return `flag '${path}' expected ${issue.expected}, got ${JSON.stringify(issue.received)} (${typeof issue.received})`;\n\n case 'too_small':\n if (issue.type === 'number' || issue.origin === 'number') {\n return `flag '${path}' must be >= ${issue.minimum}, got ${issue.received}`;\n }\n return `flag '${path}' is too small: ${issue.message}`;\n\n case 'too_big':\n if (issue.type === 'number') {\n return `flag '${path}' must be <= ${issue.maximum}, got ${issue.received}`;\n }\n return `flag '${path}' is too big: ${issue.message}`;\n\n case 'invalid_enum_value':\n const options = issue.options.map((opt: any) => `\"${opt}\"`).join(', ');\n return `flag '${path}' must be one of: ${options}, got \"${issue.received}\"`;\n\n case 'invalid_value':\n // Handle enum validation errors\n if (issue.values && Array.isArray(issue.values)) {\n const values = issue.values.map((val: any) => `\"${val}\"`).join(', ');\n return `flag '${path}' must be one of: ${values}`;\n }\n return `flag '${path}': ${issue.message}`;\n\n case 'unrecognized_keys':\n // Handle unrecognized keys properly, especially when path is empty\n const keys = issue.keys || [];\n if (keys.length === 1) {\n return `unrecognized flag '${keys[0]}'`;\n } else if (keys.length > 1) {\n const keysList = keys.map((key: string) => `'${key}'`).join(', ');\n return `unrecognized flags ${keysList}`;\n }\n return `unrecognized keys in flags`;\n\n case 'custom':\n return `flag '${path}': ${issue.message}`;\n\n default:\n return `flag '${path}': ${issue.message}`;\n }\n}\n\n/**\n * Create helpful examples for CLI usage based on validation errors\n */\nexport function generateFlagExamples(error: ZodError): string[] {\n const examples: string[] = [];\n\n for (const issue of error.issues) {\n const path = issue.path.join('.');\n const example = generateExampleForIssue(issue, path);\n if (example && !examples.includes(example)) {\n examples.push(example);\n }\n }\n\n return examples.slice(0, 3); // Limit to 3 examples\n}\n\nfunction generateExampleForIssue(issue: ZodIssue | $ZodIssue, path: string): string | null {\n switch (issue.code) {\n case 'invalid_type':\n if (issue.expected === 'number') {\n return `--flag.${path}=0.7`;\n }\n if (issue.expected === 'boolean') {\n return `--flag.${path}=true`;\n }\n if (issue.expected === 'string') {\n return `--flag.${path}=\"value\"`;\n }\n break;\n\n case 'too_small':\n if (typeof issue.minimum === 'number' || typeof issue.minimum === 'bigint') {\n return `--flag.${path}=${issue.minimum}`;\n }\n break;\n\n case 'too_big':\n if (typeof issue.maximum === 'number' || typeof issue.maximum === 'bigint') {\n return `--flag.${path}=${issue.maximum}`;\n }\n break;\n\n case 'invalid_enum_value':\n if (issue.options.length > 0) {\n return `--flag.${path}=${issue.options[0]}`;\n }\n break;\n\n case 'invalid_value':\n if (issue.values && Array.isArray(issue.values) && issue.values.length > 0) {\n return `--flag.${path}=${String(issue.values[0])}`;\n }\n break;\n }\n\n return null;\n}\n","import { type ZodObject, type ZodSchema, type ZodType, z } from 'zod';\nimport { getDef, getShape, isObjectSchema, unwrapTransparent } from './zod-internals';\n\n/**\n * Parse a dot notation path into segments.\n * @param path - Dot notation path like \"ui.theme\" or \"api.timeout\"\n * @returns Array of path segments\n */\nexport function parsePath(path: string): string[] {\n return path.split('.');\n}\n\n/**\n * Transform dot notation object to nested object structure.\n * Example: {\"ui.theme\": \"dark\", \"config.name\": \"test\"}\n * -> {ui: {theme: \"dark\"}, config: {name: \"test\"}}\n */\nexport function dotNotationToNested(\n dotNotationObject: Record<string, unknown>,\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [dotPath, value] of Object.entries(dotNotationObject)) {\n const segments = parsePath(dotPath);\n let current: Record<string, unknown> = result;\n\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n\n if (i === segments.length - 1) {\n // Last segment - set the value\n current[segment] = value;\n } else {\n // Intermediate segment - ensure object exists\n if (!(segment in current) || typeof current[segment] !== 'object') {\n current[segment] = {};\n }\n current = current[segment] as Record<string, unknown>;\n }\n }\n }\n\n return result;\n}\n\n/**\n * Flatten nested object to dot notation.\n * Example: {ui: {theme: \"dark\"}, config: {name: \"test\"}}\n * -> {\"ui.theme\": \"dark\", \"config.name\": \"test\"}\n */\nexport function flattenObject(obj: Record<string, unknown>, prefix = ''): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n const newKey = prefix ? `${prefix}.${key}` : key;\n\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n Object.assign(result, flattenObject(value as Record<string, unknown>, newKey));\n } else {\n result[newKey] = value;\n }\n }\n\n return result;\n}\n\n/**\n * Check if a dot notation path exists in the schema.\n */\nexport function isValidPath(\n schema: ZodObject<Record<string, ZodType>>,\n segments: string[],\n): boolean {\n let currentSchema: ZodType = schema;\n\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const shape = getShape(currentSchema);\n\n if (!shape || !(segment in shape)) {\n return false;\n }\n\n if (i < segments.length - 1) {\n // Not the last segment, should be a ZodObject\n const nextSchema = shape[segment];\n\n // Handle wrapped schemas (ZodDefault, ZodOptional, etc.)\n const unwrappedSchema = unwrapTransparent(nextSchema);\n\n if (!isObjectSchema(unwrappedSchema)) {\n return false;\n }\n\n currentSchema = unwrappedSchema;\n }\n }\n\n return true;\n}\n\n/**\n * Get value at a specific path in a nested object.\n */\nexport function getValueAtPath(obj: unknown, segments: string[]): unknown {\n let current = obj;\n for (const segment of segments) {\n if (current == null || typeof current !== 'object' || !(segment in current)) {\n return undefined;\n }\n current = (current as Record<string, unknown>)[segment];\n }\n return current;\n}\n\n/**\n * Helper function to traverse schema object to find the field schema at a specific path.\n */\nexport function findSchemaAtPath(\n rootSchema: ZodObject<Record<string, ZodType>> | undefined,\n segments: string[],\n): ZodSchema | undefined {\n if (!rootSchema || segments.length === 0) return undefined;\n\n let current: ZodType = rootSchema;\n\n // ZodObject root - start with the shape\n if (segments.length > 0) {\n const rootShape = getShape(current);\n if (!rootShape || !(segments[0] in rootShape)) {\n return undefined;\n }\n current = rootShape[segments[0]];\n\n // Continue with remaining segments starting from index 1\n for (let i = 1; i < segments.length; i++) {\n const segment = segments[i];\n const def = getDef(current);\n if (!def) {\n return undefined;\n }\n\n // Unwrap transparent wrappers (ZodDefault, ZodOptional, ZodNullable, etc.)\n current = unwrapTransparent(current);\n if (!isObjectSchema(current)) {\n return undefined;\n }\n const shape = getShape(current);\n if (!shape) {\n return undefined;\n }\n const nextSchema = shape[segment];\n if (!nextSchema) {\n return undefined;\n }\n current = nextSchema;\n }\n return current as ZodSchema;\n }\n\n return current as ZodSchema;\n}\n\n/**\n * Build a schema that validates only a specific path within a larger schema structure.\n * This allows validation of partial nested objects where only the target field is required.\n *\n * For example, for path \"ui.theme.colors.primary\":\n * - Creates: z.object({ ui: z.object({ theme: z.object({ colors: z.object({ primary: leafSchema }).partial() }).partial() }).partial() }).strict()\n * - This allows recording just { ui: { theme: { colors: { primary: value } } } } without requiring siblings\n *\n * @param rootSchema - The root ZodObject schema\n * @param segments - Path segments (e.g. ['ui', 'theme', 'colors', 'primary'])\n * @returns A schema that validates the specific path with partial validation for siblings\n */\nexport function buildSchemaForPath(\n rootSchema: ZodObject<Record<string, ZodType>>,\n segments: string[],\n): ZodSchema {\n const pathKey = segments.join('.');\n\n // Find the leaf schema for the target field\n const leafSchema = findSchemaAtPath(rootSchema, segments);\n if (!leafSchema) {\n throw new Error(`Cannot find schema for path: ${pathKey}`);\n }\n\n // Build the schema from leaf back to root, making siblings optional at each level\n let currentSchema: ZodSchema = leafSchema;\n\n // Work backwards through the segments\n for (let i = segments.length - 1; i >= 0; i--) {\n const segment = segments[i];\n\n // Create an object schema with just this segment\n const objectSchema = z.object({ [segment]: currentSchema });\n\n // Make it partial (so siblings aren't required) and strict (so unknown keys are rejected)\n currentSchema = objectSchema.partial().strict();\n }\n\n return currentSchema;\n}\n","import type { ZodObject, ZodType } from 'zod';\n\n/**\n * Detect if a schema is from Zod v4.\n * v4 schemas have `_zod`, v3 schemas only have `_def`.\n */\nexport function isZodV4Schema(schema: unknown): boolean {\n if (!schema || typeof schema !== 'object') return false;\n const s = schema as Record<string, unknown>;\n return '_zod' in s;\n}\n\n/**\n * Assert that a schema is from Zod v4, throwing a helpful error if it isn't.\n */\nexport function assertZodV4(schema: unknown, context: string): void {\n if (!isZodV4Schema(schema)) {\n throw new Error(\n `[AxiomAI] Zod v4 schemas are required (detected in ${context}). Found unsupported Zod version.`,\n );\n }\n}\n\n/** Normalized schema kinds we care about */\nexport type ZodKind =\n | 'object'\n | 'optional'\n | 'default'\n | 'nullable'\n | 'readonly'\n | 'prefault'\n | 'nonoptional'\n | 'catch'\n | 'array'\n | 'record'\n | 'union'\n | 'discriminatedunion'\n | 'other';\n\n/** Minimal internal def shape we access (Zod v4) */\ninterface ZodInternalDef {\n type?: unknown;\n innerType?: ZodType<unknown>;\n element?: ZodType<unknown>;\n defaultValue?: unknown;\n shape?: Record<string, ZodType<unknown>>;\n valueType?: ZodType<unknown>;\n}\n\n/**\n * Get the internal def object from a Zod v4 schema.\n */\nexport function getDef(schema: unknown): ZodInternalDef | undefined {\n if (!schema || typeof schema !== 'object') return undefined;\n\n const s = schema as Record<string, unknown>;\n\n if (s._zod && typeof s._zod === 'object') {\n const zod = s._zod as Record<string, unknown>;\n if (zod.def && typeof zod.def === 'object') {\n return zod.def as ZodInternalDef;\n }\n }\n\n return undefined;\n}\n\n/**\n * Get the raw type string from a def (Zod v4).\n */\nfunction getDefRawType(def: ZodInternalDef | undefined): string | undefined {\n if (!def) return undefined;\n const raw = def.type;\n if (raw == null) return undefined;\n return typeof raw === 'string' ? raw : String(raw);\n}\n\nconst KNOWN_KINDS = new Set<ZodKind>([\n 'object',\n 'optional',\n 'default',\n 'nullable',\n 'readonly',\n 'prefault',\n 'nonoptional',\n 'catch',\n 'array',\n 'record',\n 'union',\n 'discriminatedunion',\n]);\n\n/**\n * Get the normalized ZodKind from a schema or def (Zod v4).\n */\nexport function getKind(schemaOrDef: unknown): ZodKind | undefined {\n // If it looks like a def already (has type), use it directly\n const def =\n schemaOrDef && typeof schemaOrDef === 'object' && 'type' in schemaOrDef\n ? (schemaOrDef as ZodInternalDef)\n : getDef(schemaOrDef);\n\n const raw = getDefRawType(def);\n if (!raw) return undefined;\n\n const normalized = raw.toLowerCase();\n return KNOWN_KINDS.has(normalized as ZodKind) ? (normalized as ZodKind) : 'other';\n}\n\n/**\n * Check if a schema is an object schema (has shape).\n */\nexport function isObjectSchema(schema: unknown): schema is ZodObject<Record<string, ZodType>> {\n if (!schema || typeof schema !== 'object') return false;\n\n if ('shape' in schema && typeof (schema as Record<string, unknown>).shape === 'object') {\n return true;\n }\n\n return getKind(schema) === 'object';\n}\n\n/**\n * Get the innerType from wrapper schemas (optional, nullable, default).\n */\nexport function getInnerType(schema: unknown): ZodType<unknown> | undefined {\n const def = getDef(schema);\n return def?.innerType;\n}\n\n/**\n * Get the element type from array schemas.\n */\nexport function getArrayElement(schema: unknown): ZodType<unknown> | undefined {\n const def = getDef(schema);\n return def?.element;\n}\n\n/**\n * Get the shape from an object schema (Zod v4).\n */\nexport function getShape(schema: unknown): Record<string, ZodType<unknown>> | undefined {\n if (!schema || typeof schema !== 'object') return undefined;\n\n // Direct shape property (Zod v4)\n const s = schema as Record<string, unknown>;\n if (s.shape && typeof s.shape === 'object') {\n return s.shape as Record<string, ZodType<unknown>>;\n }\n\n return undefined;\n}\n\n/**\n * Get the default value from a schema wrapped in ZodDefault.\n */\nexport function getDefaultValue(schema: unknown): unknown {\n const def = getDef(schema);\n return def?.defaultValue;\n}\n\nconst TRANSPARENT_WRAPPERS = [\n 'optional',\n 'nullable',\n 'default',\n 'readonly',\n 'prefault',\n 'nonoptional',\n 'catch', // transparent for schema structure, but alters error behavior\n];\n\n/**\n * Unwrap transparent wrappers (optional, nullable, default) to get the core schema.\n * Useful when you need to check the underlying type.\n */\nexport function unwrapTransparent(schema: ZodType<unknown>): ZodType<unknown> {\n let current: unknown = schema;\n\n for (let i = 0; i < 10; i++) {\n const kind = getKind(current);\n if (!kind) break;\n\n if (TRANSPARENT_WRAPPERS.includes(kind)) {\n const inner = getInnerType(current);\n if (!inner) break;\n current = inner;\n continue;\n }\n break;\n }\n\n return current as ZodType<unknown>;\n}\n","import { type ZodObject, type ZodType, z } from 'zod';\nimport {\n getKind,\n getInnerType,\n getArrayElement,\n isObjectSchema,\n getDefaultValue,\n} from './zod-internals';\n\n/**\n * Recursively makes all properties of a ZodObject schema optional (deep partial).\n * This is needed because Zod 4 removed the deprecated `.deepPartial()` method.\n *\n * When validating CLI flag overrides, we only want to validate the flags that are\n * provided, not require all nested objects to be fully specified.\n */\nexport function makeDeepPartial(schema: ZodObject<Record<string, ZodType>>): ZodType {\n const shape = schema.shape;\n const newShape: Record<string, ZodType> = {};\n\n for (const [key, value] of Object.entries(shape)) {\n newShape[key] = makeDeepPartialField(value as ZodType);\n }\n\n return z.object(newShape);\n}\n\n/**\n * Apply deep partial semantics to a single field of an object shape.\n */\nfunction makeDeepPartialField(fieldSchema: ZodType): ZodType {\n const kind = getKind(fieldSchema);\n\n // Plain object field - recurse and make optional\n if (isObjectSchema(fieldSchema)) {\n const partialObject = makeDeepPartial(fieldSchema as ZodObject<Record<string, ZodType>>);\n return partialObject.optional();\n }\n\n // Optional wrapper - check if inner type is an object\n if (kind === 'optional') {\n const inner = getInnerType(fieldSchema);\n if (inner && isObjectSchema(inner)) {\n const partialInner = makeDeepPartial(inner as ZodObject<Record<string, ZodType>>);\n return partialInner.optional();\n }\n // Already optional and not an object - preserve as-is\n return fieldSchema;\n }\n\n // Nullable wrapper - check if inner type is an object\n if (kind === 'nullable') {\n const inner = getInnerType(fieldSchema);\n if (inner && isObjectSchema(inner)) {\n const partialInner = makeDeepPartial(inner as ZodObject<Record<string, ZodType>>);\n return partialInner.nullable().optional();\n }\n // Nullable non-object - just make optional\n return fieldSchema.optional();\n }\n\n // Default wrapper - check if inner type is an object\n if (kind === 'default') {\n const inner = getInnerType(fieldSchema);\n const defaultValue = getDefaultValue(fieldSchema);\n\n if (inner && isObjectSchema(inner)) {\n const partialInner = makeDeepPartial(inner as ZodObject<Record<string, ZodType>>);\n // Reapply the default on the deep-partialled object, preserving function references for lazy defaults\n return (partialInner as ZodObject<Record<string, ZodType>>).default(defaultValue as any);\n }\n // Non-object with default - make optional to allow partial validation\n return fieldSchema.optional();\n }\n\n // Array wrapper - deep partial the element type if it's an object\n if (kind === 'array') {\n const element = getArrayElement(fieldSchema);\n if (element && isObjectSchema(element)) {\n const partialElement = makeDeepPartial(element as ZodObject<Record<string, ZodType>>);\n return z.array(partialElement).optional();\n }\n // Array of non-objects - just make optional\n return fieldSchema.optional();\n }\n\n // All other field types - just make optional\n return fieldSchema.optional();\n}\n","import { type AttributeValue } from '@opentelemetry/api';\n\nfunction toHomogeneousArray(input: unknown[]): AttributeValue | undefined {\n if (input.length === 0) return undefined;\n\n const converted: (string | number | boolean)[] = [];\n const types = new Set<string>();\n\n for (const item of input) {\n const converted_item = toOtelPrimitive(item);\n if (converted_item !== undefined) {\n converted.push(converted_item);\n types.add(typeof converted_item);\n }\n }\n\n if (converted.length === 0) return undefined;\n\n if (types.size > 1) {\n return converted.map((item) => String(item)) as AttributeValue;\n }\n\n return converted as AttributeValue;\n}\n\nfunction toOtelPrimitive(v: unknown): string | number | boolean | undefined {\n switch (typeof v) {\n case 'string':\n return v;\n case 'number':\n return Number.isFinite(v) ? v : undefined;\n case 'boolean':\n return v;\n case 'bigint':\n if (v >= Number.MIN_SAFE_INTEGER && v <= Number.MAX_SAFE_INTEGER) {\n return Number(v);\n }\n return v.toString();\n case 'function':\n case 'symbol':\n case 'undefined':\n return undefined;\n case 'object':\n if (v === null) return undefined;\n if (v instanceof Date) return v.toISOString();\n if (v instanceof Error) return v.message;\n // fallback: stringify object-ish values\n return safeStringify(v);\n }\n}\n\nfunction safeStringify(obj: unknown): string | undefined {\n try {\n // Convert BigInt -> Number inside objects so JSON.stringify won't throw.\n // Functions/undefined are dropped by JSON rules.\n const s = JSON.stringify(obj, (_k, val) =>\n typeof val === 'bigint' ? Number(val) : val instanceof Date ? val.toISOString() : val,\n );\n // Avoid empty/meaningless \"{}\" for Map/Set—stringify those explicitly\n if (s === '{}') {\n if (obj instanceof Map) {\n return JSON.stringify(Object.fromEntries(obj));\n }\n if (obj instanceof Set) {\n return JSON.stringify(Array.from(obj));\n }\n }\n return s ?? undefined;\n } catch {\n // As a last resort, use toString() if present\n try {\n const t = (obj as any)?.toString?.();\n return typeof t === 'string' ? t : undefined;\n } catch {\n return undefined;\n }\n }\n}\n\nexport function toOtelAttribute(input: unknown): AttributeValue | undefined {\n // primitives fast-path\n switch (typeof input) {\n case 'string':\n return input;\n case 'number':\n return Number.isFinite(input) ? input : undefined;\n case 'boolean':\n return input;\n case 'bigint':\n if (input >= Number.MIN_SAFE_INTEGER && input <= Number.MAX_SAFE_INTEGER) {\n return Number(input);\n }\n return input.toString();\n case 'function':\n case 'symbol':\n case 'undefined':\n return undefined;\n }\n\n // arrays -> homogeneous array of primitives\n if (Array.isArray(input)) {\n return toHomogeneousArray(input);\n }\n\n // date -> ISO string\n if (input instanceof Date) {\n return input.toISOString();\n }\n\n // null / objects -> JSON string\n if (input === null) return undefined;\n return safeStringify(input);\n}\n","export { withSpan } from './withSpan';\nexport { wrapAISDKModel } from './vercel';\nexport { Attr } from './semconv/attributes';\n","import { Type as TypeBox, type TSchema as TypeBoxSchema, type Static } from '@sinclair/typebox';\n\n/**\n * Template-friendly TypeBox types for use with Handlebars.\n *\n * These types are designed to be easily serializable and work well in template contexts\n * where data needs to be rendered as strings or used in conditionals and loops.\n *\n * All composite types (Array, Object, etc.) only accept other Template types.\n */\n\n// Brand to distinguish Template types from raw TypeBox types\ndeclare const SchemaBrand: unique symbol;\ntype TSchema<T extends TypeBoxSchema = TypeBoxSchema> = T & { [SchemaBrand]: true };\n\n/**\n * Utility type to infer TypeScript types from {@link TSchema}.\n */\nexport type InferSchema<T extends TSchema> = Static<T>;\n\n/**\n * Utility type to infer context types from {@link Prompt} arguments.\n *\n * Used with {@link parse} function to ensure type safety when providing context values.\n */\nexport type InferContext<T extends Record<string, TSchema>> = Static<\n ReturnType<typeof createObject<T>>\n>;\n\ntype OmitFirst<T extends any[]> = T extends [any, ...infer R] ? R : never;\n\n// Helper to create branded Template types\nconst createTemplateType = <T extends TypeBoxSchema>(schema: T): TSchema<T> => schema as TSchema<T>;\n\n// Primitive type creators\nconst createString = (...args: Parameters<typeof TypeBox.String>) =>\n createTemplateType(TypeBox.String(...args));\nconst createNumber = (...args: Parameters<typeof TypeBox.Number>) =>\n createTemplateType(TypeBox.Number(...args));\nconst createInteger = (...args: Parameters<typeof TypeBox.Integer>) =>\n createTemplateType(TypeBox.Integer(...args));\nconst createBoolean = (...args: Parameters<typeof TypeBox.Boolean>) =>\n createTemplateType(TypeBox.Boolean(...args));\nconst createNull = (...args: Parameters<typeof TypeBox.Null>) =>\n createTemplateType(TypeBox.Null(...args));\nconst createLiteral = <T extends string | number | boolean>(\n value: T,\n ...args: OmitFirst<Parameters<typeof TypeBox.Literal>>\n) => createTemplateType(TypeBox.Literal(value, ...args));\nconst createUndefined = (...args: Parameters<typeof TypeBox.Undefined>) =>\n createTemplateType(TypeBox.Undefined(...args));\n\n// Collection type creators - only accept Template types\nconst createArray = <T extends TSchema>(\n items: T,\n ...args: OmitFirst<Parameters<typeof TypeBox.Array>>\n) => createTemplateType(TypeBox.Array(items, ...args));\n\nconst createObject = <T extends Record<string, TSchema>>(\n properties: T,\n ...args: OmitFirst<Parameters<typeof TypeBox.Object>>\n) => createTemplateType(TypeBox.Object(properties, ...args));\n\nconst createRecord = <V extends TSchema>(\n value: V,\n ...args: OmitFirst<OmitFirst<Parameters<typeof TypeBox.Record>>>\n) => createTemplateType(TypeBox.Record(TypeBox.String(), value, ...args));\n\nconst createTuple = <T extends TSchema[]>(\n types: [...T],\n ...args: OmitFirst<Parameters<typeof TypeBox.Tuple>>\n) => {\n return createTemplateType(TypeBox.Tuple(types, ...args));\n};\n\n// Modifier type creators - only accept Template types\nconst createOptional = <T extends TSchema>(\n schema: T,\n ...args: OmitFirst<Parameters<typeof TypeBox.Optional>>\n) => createTemplateType(TypeBox.Optional(schema, true, ...args));\n\nconst createUnion = <T extends TSchema[]>(\n schemas: [...T],\n ...args: OmitFirst<Parameters<typeof TypeBox.Union>>\n) => createTemplateType(TypeBox.Union(schemas, ...args));\n\n// Export all template-friendly types as a namespace\nexport const Type = {\n // Primitives\n String: createString,\n Number: createNumber,\n Integer: createInteger,\n Boolean: createBoolean,\n Null: createNull,\n Undefined: createUndefined,\n\n // Literals\n Literal: createLiteral,\n\n // Collections - only accept Template types\n Array: createArray,\n Object: createObject,\n Record: createRecord,\n Tuple: createTuple,\n\n // Modifiers - only accept Template types\n Optional: createOptional,\n Union: createUnion,\n} as const;\n\n// Export the branded type for advanced usage\nexport type { TSchema };\n\n// Default export for convenience\nexport default Type;\n","import type { Prompt } from '../types';\nimport type { InferContext } from '../template';\nimport type { AxiomPromptMetadata, ParsedMessage, ParsedMessagesArray } from '../types/metadata';\n\nconst getParser = async () => {\n const handlebars = await import('./parsers/handlebars').then((m) => m.handlebarsParse);\n return handlebars;\n};\n\n/**\n * Parses a prompt template by replacing variables with provided context values.\n *\n * This function processes Handlebars templates in prompt messages and attaches metadata\n * for instrumentation and tracking.\n *\n * @experimental This API is experimental and may change in future versions.\n *\n * @param prompt - The {@link Prompt} template to parse\n * @param options - Parsing options\n * @param options.context - Context values to substitute into the template\n * @returns Promise that resolves to the parsed prompt with processed messages;\n */\nexport const parse = async <\n TPrompt extends Prompt,\n TMessages extends TPrompt['messages'] = TPrompt['messages'],\n>(\n prompt: TPrompt & { messages: TMessages },\n {\n context,\n }: {\n context: InferContext<TPrompt['arguments']>;\n },\n): Promise<Omit<TPrompt, 'messages'> & { messages: ParsedMessagesArray<TMessages> }> => {\n const messagesPromises = prompt.messages.map(async (message) => {\n const parser = await getParser();\n return {\n ...message,\n content: await parser(message.content, { context }),\n };\n });\n\n const parsedMessages: ParsedMessage[] = await Promise.all(messagesPromises);\n\n // Create metadata object from prompt\n const promptMetadata: AxiomPromptMetadata = {\n id: prompt.promptId,\n name: prompt.name,\n slug: prompt.slug,\n version: prompt.version,\n };\n\n // Attach metadata to the last message's providerOptions for detection in the wrapper\n // The Vercel SDK converts providerOptions -> providerMetadata in convertToLanguageModelMessage\n if (parsedMessages.length > 0) {\n const lastMessage = parsedMessages[parsedMessages.length - 1];\n lastMessage.providerOptions = {\n ...lastMessage.providerOptions,\n _axiomMeta: promptMetadata,\n };\n lastMessage.providerMetadata = {\n ...lastMessage.providerMetadata,\n _axiomMeta: promptMetadata,\n };\n }\n\n // Also create a Proxy for direct access in tests\n const messages = new Proxy(parsedMessages, {\n get(target: ParsedMessage[], prop: string | symbol, receiver: unknown): any {\n // Special metadata access\n if (prop === '_axiomMeta') {\n return promptMetadata;\n }\n // All other properties (array methods, indices, etc.)\n return Reflect.get(target, prop, receiver) as ParsedMessage | undefined;\n },\n }) as ParsedMessagesArray<TMessages>;\n\n return {\n ...prompt,\n messages: messages,\n };\n};\n\n// Re-export template types for convenience\nexport { Type as Template, type InferContext } from '../template';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAKM,kBAMO;AAXb;AAAA;AAAA;AAKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,OAClD,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEpC,IAAM,gBAAgC,iCAAiB;AAAA;AAAA;;;;;;;;;;;;;;;ACX9D,QAAM,SAAS;MACb,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;;AAGP,QAAM,WAAW;AAAjB,QACE,WAAW;AAEb,aAAS,WAAW,KAAK;AACvB,aAAO,OAAO,GAAG;;AAGZ,aAAS,OAAO,KAAuB;AAC5C,eAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AACzC,iBAAS,OAAO,UAAU,CAAC,GAAG;AAC5B,cAAI,OAAO,UAAU,eAAe,KAAK,UAAU,CAAC,GAAG,GAAG,GAAG;AAC3D,gBAAI,GAAG,IAAI,UAAU,CAAC,EAAE,GAAG;;;;AAKjC,aAAO;;AAGF,QAAI,WAAW,OAAO,UAAU;;AAKvC,QAAI,aAAa,SAAAA,YAAS,OAAO;AAC/B,aAAO,OAAO,UAAU;;AAI1B,QAAI,WAAW,GAAG,GAAG;AACnB,MAAAC,SAOO,aAPP,aAAa,SAAS,OAAO;AAC3B,eACE,OAAO,UAAU,cACjB,SAAS,KAAK,KAAK,MAAM;;;aAItB,aAAA;AAIF,QAAM,UACX,MAAM,WACN,SAAS,OAAO;AACd,aAAO,SAAS,OAAO,UAAU,WAC7B,SAAS,KAAK,KAAK,MAAM,mBACzB;;;AAID,aAAS,QAAQ,OAAO,OAAO;AACpC,eAAS,IAAI,GAAG,MAAM,MAAM,QAAQ,IAAI,KAAK,KAAK;AAChD,YAAI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A,EACF;AACF;;;A1CtEO,IAAMC,cAAiC,IAAI,SAAS;AACzD,4BAA0B;AAC1B,SAAO,WAAY,GAAG,IAAI;AAC5B;AAMO,IAAM,UAAU,IAAI,SAAoB;AAC7C,wBAAsB,UAAU;AAChC,SAAQ,aAA0B,GAAG,IAAI;AAC3C;","names":["isFunction","exports","context","context","context","context","options","ret","wrapper","context","ret","options","Handlebars","trace","parse","lexer","exports","parse","compile","context","exports","exports","exports","exports","exports","exports","sourceFile","exports","exports","exports","context","needle","section","exports","exports","context","exports","module","Handlebars","context","onlineEval","import_api","import_api","import_api","import_api","context","import_api","import_api","import_api","import_api","import_api","import_zod","import_zod","context","import_zod","import_api","import_zod","import_api","TypeBox","context","onlineEval"]}
|