{"version":3,"file":"ContextProvider-cd42143d.js","sources":["../../../node_modules/@ctrl/tinycolor/dist/module/util.js","../../../node_modules/@ctrl/tinycolor/dist/module/conversion.js","../../../node_modules/@ctrl/tinycolor/dist/module/css-color-names.js","../../../node_modules/@ctrl/tinycolor/dist/module/format-input.js","../../../node_modules/@ctrl/tinycolor/dist/module/index.js","../../src/theme/index.ts","../../src/components/GenericErrorTemplate.tsx","../../src/components/Error.tsx","../../../node_modules/@elastic/apm-rum-core/dist/es/error-logging/stack-trace.js","../../../node_modules/promise-polyfill/src/finally.js","../../../node_modules/promise-polyfill/src/allSettled.js","../../../node_modules/promise-polyfill/src/index.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/polyfills.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/utils.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/url.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/constants.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/context.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/truncate.js","../../../node_modules/@elastic/apm-rum-core/node_modules/stackframe/stackframe.js","../../../node_modules/@elastic/apm-rum-core/node_modules/error-stack-parser/error-stack-parser.js","../../../node_modules/@elastic/apm-rum-core/dist/es/error-logging/error-logging.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/queue.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/throttle.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/ndjson.js","../../../node_modules/@elastic/apm-rum-core/dist/es/performance-monitoring/span-base.js","../../../node_modules/@elastic/apm-rum-core/dist/es/performance-monitoring/span.js","../../../node_modules/@elastic/apm-rum-core/dist/es/state.js","../../../node_modules/@elastic/apm-rum-core/dist/es/performance-monitoring/capture-navigation.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/compress.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/http/response-status.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/http/fetch.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/patching/patch-utils.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/http/xhr.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/apm-server.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/event-handler.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/config-service.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/logging-service.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/service-factory.js","../../../node_modules/@elastic/apm-rum-core/dist/es/error-logging/index.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/patching/xhr-patch.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/patching/fetch-patch.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/patching/history-patch.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/patching/index.js","../../../node_modules/@elastic/apm-rum-core/dist/es/performance-monitoring/performance-monitoring.js","../../../node_modules/@elastic/apm-rum-core/dist/es/performance-monitoring/breakdown.js","../../../node_modules/@elastic/apm-rum-core/dist/es/performance-monitoring/transaction.js","../../../node_modules/@elastic/apm-rum-core/dist/es/performance-monitoring/metrics.js","../../../node_modules/@elastic/apm-rum-core/dist/es/performance-monitoring/transaction-service.js","../../../node_modules/@elastic/apm-rum-core/dist/es/performance-monitoring/index.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/observers/page-visibility.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/observers/page-clicks.js","../../../node_modules/@elastic/apm-rum-core/dist/es/common/instrument.js","../../../node_modules/@elastic/apm-rum-core/dist/es/bootstrap.js","../../../node_modules/@elastic/apm-rum-core/dist/es/index.js","../../../node_modules/@elastic/apm-rum/dist/es/apm-base.js","../../../node_modules/@elastic/apm-rum/dist/es/index.js","../../src/components/providers/ApmProvider.tsx","../../src/components/MessageReceiverIframe.tsx","../../src/components/ByocRegistration.tsx","../../src/components/providers/ContextProvider.tsx"],"sourcesContent":["/**\n * Take input from [0, n] and return it as [0, 1]\n * @hidden\n */\nexport function bound01(n, max) {\n if (isOnePointZero(n)) {\n n = '100%';\n }\n var isPercent = isPercentage(n);\n n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));\n // Automatically convert percentage into number\n if (isPercent) {\n n = parseInt(String(n * max), 10) / 100;\n }\n // Handle floating point rounding errors\n if (Math.abs(n - max) < 0.000001) {\n return 1;\n }\n // Convert into [0, 1] range if it isn't already\n if (max === 360) {\n // If n is a hue given in degrees,\n // wrap around out-of-range values into [0, 360] range\n // then convert into [0, 1].\n n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max));\n }\n else {\n // If n not a hue given in degrees\n // Convert into [0, 1] range if it isn't already.\n n = (n % max) / parseFloat(String(max));\n }\n return n;\n}\n/**\n * Force a number between 0 and 1\n * @hidden\n */\nexport function clamp01(val) {\n return Math.min(1, Math.max(0, val));\n}\n/**\n * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n * \n * @hidden\n */\nexport function isOnePointZero(n) {\n return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;\n}\n/**\n * Check to see if string passed in is a percentage\n * @hidden\n */\nexport function isPercentage(n) {\n return typeof n === 'string' && n.indexOf('%') !== -1;\n}\n/**\n * Return a valid alpha value [0,1] with all invalid values being set to 1\n * @hidden\n */\nexport function boundAlpha(a) {\n a = parseFloat(a);\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n return a;\n}\n/**\n * Replace a decimal with it's percentage value\n * @hidden\n */\nexport function convertToPercentage(n) {\n if (n <= 1) {\n return \"\".concat(Number(n) * 100, \"%\");\n }\n return n;\n}\n/**\n * Force a hex value to have 2 characters\n * @hidden\n */\nexport function pad2(c) {\n return c.length === 1 ? '0' + c : String(c);\n}\n","import { bound01, pad2 } from './util';\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// \n/**\n * Handle bounds / percentage checking to conform to CSS color spec\n * \n * *Assumes:* r, g, b in [0, 255] or [0, 1]\n * *Returns:* { r, g, b } in [0, 255]\n */\nexport function rgbToRgb(r, g, b) {\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255,\n };\n}\n/**\n * Converts an RGB color value to HSL.\n * *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n * *Returns:* { h, s, l } in [0,1]\n */\nexport function rgbToHsl(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n var max = Math.max(r, g, b);\n var min = Math.min(r, g, b);\n var h = 0;\n var s = 0;\n var l = (max + min) / 2;\n if (max === min) {\n s = 0;\n h = 0; // achromatic\n }\n else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n default:\n break;\n }\n h /= 6;\n }\n return { h: h, s: s, l: l };\n}\nfunction hue2rgb(p, q, t) {\n if (t < 0) {\n t += 1;\n }\n if (t > 1) {\n t -= 1;\n }\n if (t < 1 / 6) {\n return p + (q - p) * (6 * t);\n }\n if (t < 1 / 2) {\n return q;\n }\n if (t < 2 / 3) {\n return p + (q - p) * (2 / 3 - t) * 6;\n }\n return p;\n}\n/**\n * Converts an HSL color value to RGB.\n *\n * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n * *Returns:* { r, g, b } in the set [0, 255]\n */\nexport function hslToRgb(h, s, l) {\n var r;\n var g;\n var b;\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n if (s === 0) {\n // achromatic\n g = l;\n b = l;\n r = l;\n }\n else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n/**\n * Converts an RGB color value to HSV\n *\n * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n * *Returns:* { h, s, v } in [0,1]\n */\nexport function rgbToHsv(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n var max = Math.max(r, g, b);\n var min = Math.min(r, g, b);\n var h = 0;\n var v = max;\n var d = max - min;\n var s = max === 0 ? 0 : d / max;\n if (max === min) {\n h = 0; // achromatic\n }\n else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n default:\n break;\n }\n h /= 6;\n }\n return { h: h, s: s, v: v };\n}\n/**\n * Converts an HSV color value to RGB.\n *\n * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n * *Returns:* { r, g, b } in the set [0, 255]\n */\nexport function hsvToRgb(h, s, v) {\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n var i = Math.floor(h);\n var f = h - i;\n var p = v * (1 - s);\n var q = v * (1 - f * s);\n var t = v * (1 - (1 - f) * s);\n var mod = i % 6;\n var r = [v, q, p, p, t, v][mod];\n var g = [t, v, v, q, p, p][mod];\n var b = [p, p, t, v, v, q][mod];\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n/**\n * Converts an RGB color to hex\n *\n * Assumes r, g, and b are contained in the set [0, 255]\n * Returns a 3 or 6 character hex\n */\nexport function rgbToHex(r, g, b, allow3Char) {\n var hex = [\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n ];\n // Return a 3 character hex if possible\n if (allow3Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(hex[2].charAt(1))) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n return hex.join('');\n}\n/**\n * Converts an RGBA color plus alpha transparency to hex\n *\n * Assumes r, g, b are contained in the set [0, 255] and\n * a in [0, 1]. Returns a 4 or 8 character rgba hex\n */\n// eslint-disable-next-line max-params\nexport function rgbaToHex(r, g, b, a, allow4Char) {\n var hex = [\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n pad2(convertDecimalToHex(a)),\n ];\n // Return a 4 character hex if possible\n if (allow4Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(hex[2].charAt(1)) &&\n hex[3].startsWith(hex[3].charAt(1))) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n return hex.join('');\n}\n/**\n * Converts an RGBA color to an ARGB Hex8 string\n * Rarely used, but required for \"toFilter()\"\n */\nexport function rgbaToArgbHex(r, g, b, a) {\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n ];\n return hex.join('');\n}\n/** Converts a decimal to a hex value */\nexport function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\n/** Converts a hex value to a decimal */\nexport function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n}\n/** Parse a base-16 hex value into a base-10 integer */\nexport function parseIntFromHex(val) {\n return parseInt(val, 16);\n}\nexport function numberInputToObject(color) {\n return {\n r: color >> 16,\n g: (color & 0xff00) >> 8,\n b: color & 0xff,\n };\n}\n","// https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json\n/**\n * @hidden\n */\nexport var names = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkgrey: '#a9a9a9',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkslategrey: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n goldenrod: '#daa520',\n gold: '#ffd700',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n grey: '#808080',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavenderblush: '#fff0f5',\n lavender: '#e6e6fa',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgray: '#d3d3d3',\n lightgreen: '#90ee90',\n lightgrey: '#d3d3d3',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370db',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#db7093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\n","import { convertHexToDecimal, hslToRgb, hsvToRgb, parseIntFromHex, rgbToRgb } from './conversion';\nimport { names } from './css-color-names';\nimport { boundAlpha, convertToPercentage } from './util';\n/**\n * Given a string or object, convert that input to RGB\n *\n * Possible string inputs:\n * ```\n * \"red\"\n * \"#f00\" or \"f00\"\n * \"#ff0000\" or \"ff0000\"\n * \"#ff000000\" or \"ff000000\"\n * \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n * \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n * \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n * \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n * \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n * \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n * \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n * ```\n */\nexport function inputToRGB(color) {\n var rgb = { r: 0, g: 0, b: 0 };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n if (typeof color === 'string') {\n color = stringInputToObject(color);\n }\n if (typeof color === 'object') {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = 'hsv';\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = 'hsl';\n }\n if (Object.prototype.hasOwnProperty.call(color, 'a')) {\n a = color.a;\n }\n }\n a = boundAlpha(a);\n return {\n ok: ok,\n format: color.format || format,\n r: Math.min(255, Math.max(rgb.r, 0)),\n g: Math.min(255, Math.max(rgb.g, 0)),\n b: Math.min(255, Math.max(rgb.b, 0)),\n a: a,\n };\n}\n// \nvar CSS_INTEGER = '[-\\\\+]?\\\\d+%?';\n// \nvar CSS_NUMBER = '[-\\\\+]?\\\\d*\\\\.\\\\d+%?';\n// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\nvar CSS_UNIT = \"(?:\".concat(CSS_NUMBER, \")|(?:\").concat(CSS_INTEGER, \")\");\n// Actual matching.\n// Parentheses and commas are optional, but not required.\n// Whitespace can take the place of commas or opening paren\nvar PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\".concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")\\\\s*\\\\)?\");\nvar PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\".concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")\\\\s*\\\\)?\");\nvar matchers = {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),\n rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),\n hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),\n hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),\n hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),\n hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n};\n/**\n * Permissive string parsing. Take in a number of formats, and output an object\n * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\n */\nexport function stringInputToObject(color) {\n color = color.trim().toLowerCase();\n if (color.length === 0) {\n return false;\n }\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n }\n else if (color === 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: 'name' };\n }\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match = matchers.rgb.exec(color);\n if (match) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n match = matchers.rgba.exec(color);\n if (match) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n match = matchers.hsl.exec(color);\n if (match) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n match = matchers.hsla.exec(color);\n if (match) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n match = matchers.hsv.exec(color);\n if (match) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n match = matchers.hsva.exec(color);\n if (match) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n match = matchers.hex8.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? 'name' : 'hex8',\n };\n }\n match = matchers.hex6.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? 'name' : 'hex',\n };\n }\n match = matchers.hex4.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1] + match[1]),\n g: parseIntFromHex(match[2] + match[2]),\n b: parseIntFromHex(match[3] + match[3]),\n a: convertHexToDecimal(match[4] + match[4]),\n format: named ? 'name' : 'hex8',\n };\n }\n match = matchers.hex3.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1] + match[1]),\n g: parseIntFromHex(match[2] + match[2]),\n b: parseIntFromHex(match[3] + match[3]),\n format: named ? 'name' : 'hex',\n };\n }\n return false;\n}\n/**\n * Check to see if it looks like a CSS unit\n * (see `matchers` above for definition).\n */\nexport function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n}\n","import { numberInputToObject, rgbaToHex, rgbToHex, rgbToHsl, rgbToHsv } from './conversion';\nimport { names } from './css-color-names';\nimport { inputToRGB } from './format-input';\nimport { bound01, boundAlpha, clamp01 } from './util';\nvar TinyColor = /** @class */ (function () {\n function TinyColor(color, opts) {\n if (color === void 0) { color = ''; }\n if (opts === void 0) { opts = {}; }\n var _a;\n // If input is already a tinycolor, return itself\n if (color instanceof TinyColor) {\n // eslint-disable-next-line no-constructor-return\n return color;\n }\n if (typeof color === 'number') {\n color = numberInputToObject(color);\n }\n this.originalInput = color;\n var rgb = inputToRGB(color);\n this.originalInput = color;\n this.r = rgb.r;\n this.g = rgb.g;\n this.b = rgb.b;\n this.a = rgb.a;\n this.roundA = Math.round(100 * this.a) / 100;\n this.format = (_a = opts.format) !== null && _a !== void 0 ? _a : rgb.format;\n this.gradientType = opts.gradientType;\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this.r < 1) {\n this.r = Math.round(this.r);\n }\n if (this.g < 1) {\n this.g = Math.round(this.g);\n }\n if (this.b < 1) {\n this.b = Math.round(this.b);\n }\n this.isValid = rgb.ok;\n }\n TinyColor.prototype.isDark = function () {\n return this.getBrightness() < 128;\n };\n TinyColor.prototype.isLight = function () {\n return !this.isDark();\n };\n /**\n * Returns the perceived brightness of the color, from 0-255.\n */\n TinyColor.prototype.getBrightness = function () {\n // http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n };\n /**\n * Returns the perceived luminance of a color, from 0-1.\n */\n TinyColor.prototype.getLuminance = function () {\n // http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var R;\n var G;\n var B;\n var RsRGB = rgb.r / 255;\n var GsRGB = rgb.g / 255;\n var BsRGB = rgb.b / 255;\n if (RsRGB <= 0.03928) {\n R = RsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);\n }\n if (GsRGB <= 0.03928) {\n G = GsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);\n }\n if (BsRGB <= 0.03928) {\n B = BsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);\n }\n return 0.2126 * R + 0.7152 * G + 0.0722 * B;\n };\n /**\n * Returns the alpha value of a color, from 0-1.\n */\n TinyColor.prototype.getAlpha = function () {\n return this.a;\n };\n /**\n * Sets the alpha value on the current color.\n *\n * @param alpha - The new alpha value. The accepted range is 0-1.\n */\n TinyColor.prototype.setAlpha = function (alpha) {\n this.a = boundAlpha(alpha);\n this.roundA = Math.round(100 * this.a) / 100;\n return this;\n };\n /**\n * Returns the object as a HSVA object.\n */\n TinyColor.prototype.toHsv = function () {\n var hsv = rgbToHsv(this.r, this.g, this.b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };\n };\n /**\n * Returns the hsva values interpolated into a string with the following format:\n * \"hsva(xxx, xxx, xxx, xx)\".\n */\n TinyColor.prototype.toHsvString = function () {\n var hsv = rgbToHsv(this.r, this.g, this.b);\n var h = Math.round(hsv.h * 360);\n var s = Math.round(hsv.s * 100);\n var v = Math.round(hsv.v * 100);\n return this.a === 1 ? \"hsv(\".concat(h, \", \").concat(s, \"%, \").concat(v, \"%)\") : \"hsva(\".concat(h, \", \").concat(s, \"%, \").concat(v, \"%, \").concat(this.roundA, \")\");\n };\n /**\n * Returns the object as a HSLA object.\n */\n TinyColor.prototype.toHsl = function () {\n var hsl = rgbToHsl(this.r, this.g, this.b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };\n };\n /**\n * Returns the hsla values interpolated into a string with the following format:\n * \"hsla(xxx, xxx, xxx, xx)\".\n */\n TinyColor.prototype.toHslString = function () {\n var hsl = rgbToHsl(this.r, this.g, this.b);\n var h = Math.round(hsl.h * 360);\n var s = Math.round(hsl.s * 100);\n var l = Math.round(hsl.l * 100);\n return this.a === 1 ? \"hsl(\".concat(h, \", \").concat(s, \"%, \").concat(l, \"%)\") : \"hsla(\".concat(h, \", \").concat(s, \"%, \").concat(l, \"%, \").concat(this.roundA, \")\");\n };\n /**\n * Returns the hex value of the color.\n * @param allow3Char will shorten hex value to 3 char if possible\n */\n TinyColor.prototype.toHex = function (allow3Char) {\n if (allow3Char === void 0) { allow3Char = false; }\n return rgbToHex(this.r, this.g, this.b, allow3Char);\n };\n /**\n * Returns the hex value of the color -with a # appened.\n * @param allow3Char will shorten hex value to 3 char if possible\n */\n TinyColor.prototype.toHexString = function (allow3Char) {\n if (allow3Char === void 0) { allow3Char = false; }\n return '#' + this.toHex(allow3Char);\n };\n /**\n * Returns the hex 8 value of the color.\n * @param allow4Char will shorten hex value to 4 char if possible\n */\n TinyColor.prototype.toHex8 = function (allow4Char) {\n if (allow4Char === void 0) { allow4Char = false; }\n return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);\n };\n /**\n * Returns the hex 8 value of the color -with a # appened.\n * @param allow4Char will shorten hex value to 4 char if possible\n */\n TinyColor.prototype.toHex8String = function (allow4Char) {\n if (allow4Char === void 0) { allow4Char = false; }\n return '#' + this.toHex8(allow4Char);\n };\n /**\n * Returns the object as a RGBA object.\n */\n TinyColor.prototype.toRgb = function () {\n return {\n r: Math.round(this.r),\n g: Math.round(this.g),\n b: Math.round(this.b),\n a: this.a,\n };\n };\n /**\n * Returns the RGBA values interpolated into a string with the following format:\n * \"RGBA(xxx, xxx, xxx, xx)\".\n */\n TinyColor.prototype.toRgbString = function () {\n var r = Math.round(this.r);\n var g = Math.round(this.g);\n var b = Math.round(this.b);\n return this.a === 1 ? \"rgb(\".concat(r, \", \").concat(g, \", \").concat(b, \")\") : \"rgba(\".concat(r, \", \").concat(g, \", \").concat(b, \", \").concat(this.roundA, \")\");\n };\n /**\n * Returns the object as a RGBA object.\n */\n TinyColor.prototype.toPercentageRgb = function () {\n var fmt = function (x) { return \"\".concat(Math.round(bound01(x, 255) * 100), \"%\"); };\n return {\n r: fmt(this.r),\n g: fmt(this.g),\n b: fmt(this.b),\n a: this.a,\n };\n };\n /**\n * Returns the RGBA relative values interpolated into a string\n */\n TinyColor.prototype.toPercentageRgbString = function () {\n var rnd = function (x) { return Math.round(bound01(x, 255) * 100); };\n return this.a === 1\n ? \"rgb(\".concat(rnd(this.r), \"%, \").concat(rnd(this.g), \"%, \").concat(rnd(this.b), \"%)\")\n : \"rgba(\".concat(rnd(this.r), \"%, \").concat(rnd(this.g), \"%, \").concat(rnd(this.b), \"%, \").concat(this.roundA, \")\");\n };\n /**\n * The 'real' name of the color -if there is one.\n */\n TinyColor.prototype.toName = function () {\n if (this.a === 0) {\n return 'transparent';\n }\n if (this.a < 1) {\n return false;\n }\n var hex = '#' + rgbToHex(this.r, this.g, this.b, false);\n for (var _i = 0, _a = Object.entries(names); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n if (hex === value) {\n return key;\n }\n }\n return false;\n };\n TinyColor.prototype.toString = function (format) {\n var formatSet = Boolean(format);\n format = format !== null && format !== void 0 ? format : this.format;\n var formattedString = false;\n var hasAlpha = this.a < 1 && this.a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format.startsWith('hex') || format === 'name');\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === 'name' && this.a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === 'rgb') {\n formattedString = this.toRgbString();\n }\n if (format === 'prgb') {\n formattedString = this.toPercentageRgbString();\n }\n if (format === 'hex' || format === 'hex6') {\n formattedString = this.toHexString();\n }\n if (format === 'hex3') {\n formattedString = this.toHexString(true);\n }\n if (format === 'hex4') {\n formattedString = this.toHex8String(true);\n }\n if (format === 'hex8') {\n formattedString = this.toHex8String();\n }\n if (format === 'name') {\n formattedString = this.toName();\n }\n if (format === 'hsl') {\n formattedString = this.toHslString();\n }\n if (format === 'hsv') {\n formattedString = this.toHsvString();\n }\n return formattedString || this.toHexString();\n };\n TinyColor.prototype.toNumber = function () {\n return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);\n };\n TinyColor.prototype.clone = function () {\n return new TinyColor(this.toString());\n };\n /**\n * Lighten the color a given amount. Providing 100 will always return white.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.lighten = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return new TinyColor(hsl);\n };\n /**\n * Brighten the color a given amount, from 0 to 100.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.brighten = function (amount) {\n if (amount === void 0) { amount = 10; }\n var rgb = this.toRgb();\n rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));\n rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));\n rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));\n return new TinyColor(rgb);\n };\n /**\n * Darken the color a given amount, from 0 to 100.\n * Providing 100 will always return black.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.darken = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return new TinyColor(hsl);\n };\n /**\n * Mix the color with pure white, from 0 to 100.\n * Providing 0 will do nothing, providing 100 will always return white.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.tint = function (amount) {\n if (amount === void 0) { amount = 10; }\n return this.mix('white', amount);\n };\n /**\n * Mix the color with pure black, from 0 to 100.\n * Providing 0 will do nothing, providing 100 will always return black.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.shade = function (amount) {\n if (amount === void 0) { amount = 10; }\n return this.mix('black', amount);\n };\n /**\n * Desaturate the color a given amount, from 0 to 100.\n * Providing 100 will is the same as calling greyscale\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.desaturate = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return new TinyColor(hsl);\n };\n /**\n * Saturate the color a given amount, from 0 to 100.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.saturate = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return new TinyColor(hsl);\n };\n /**\n * Completely desaturates a color into greyscale.\n * Same as calling `desaturate(100)`\n */\n TinyColor.prototype.greyscale = function () {\n return this.desaturate(100);\n };\n /**\n * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n * Values outside of this range will be wrapped into this range.\n */\n TinyColor.prototype.spin = function (amount) {\n var hsl = this.toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return new TinyColor(hsl);\n };\n /**\n * Mix the current color a given amount with another color, from 0 to 100.\n * 0 means no mixing (return current color).\n */\n TinyColor.prototype.mix = function (color, amount) {\n if (amount === void 0) { amount = 50; }\n var rgb1 = this.toRgb();\n var rgb2 = new TinyColor(color).toRgb();\n var p = amount / 100;\n var rgba = {\n r: (rgb2.r - rgb1.r) * p + rgb1.r,\n g: (rgb2.g - rgb1.g) * p + rgb1.g,\n b: (rgb2.b - rgb1.b) * p + rgb1.b,\n a: (rgb2.a - rgb1.a) * p + rgb1.a,\n };\n return new TinyColor(rgba);\n };\n TinyColor.prototype.analogous = function (results, slices) {\n if (results === void 0) { results = 6; }\n if (slices === void 0) { slices = 30; }\n var hsl = this.toHsl();\n var part = 360 / slices;\n var ret = [this];\n for (hsl.h = (hsl.h - ((part * results) >> 1) + 720) % 360; --results;) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(new TinyColor(hsl));\n }\n return ret;\n };\n /**\n * taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js\n */\n TinyColor.prototype.complement = function () {\n var hsl = this.toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return new TinyColor(hsl);\n };\n TinyColor.prototype.monochromatic = function (results) {\n if (results === void 0) { results = 6; }\n var hsv = this.toHsv();\n var h = hsv.h;\n var s = hsv.s;\n var v = hsv.v;\n var res = [];\n var modification = 1 / results;\n while (results--) {\n res.push(new TinyColor({ h: h, s: s, v: v }));\n v = (v + modification) % 1;\n }\n return res;\n };\n TinyColor.prototype.splitcomplement = function () {\n var hsl = this.toHsl();\n var h = hsl.h;\n return [\n this,\n new TinyColor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),\n new TinyColor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l }),\n ];\n };\n /**\n * Compute how the color would appear on a background\n */\n TinyColor.prototype.onBackground = function (background) {\n var fg = this.toRgb();\n var bg = new TinyColor(background).toRgb();\n return new TinyColor({\n r: bg.r + (fg.r - bg.r) * fg.a,\n g: bg.g + (fg.g - bg.g) * fg.a,\n b: bg.b + (fg.b - bg.b) * fg.a,\n });\n };\n /**\n * Alias for `polyad(3)`\n */\n TinyColor.prototype.triad = function () {\n return this.polyad(3);\n };\n /**\n * Alias for `polyad(4)`\n */\n TinyColor.prototype.tetrad = function () {\n return this.polyad(4);\n };\n /**\n * Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)\n * monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...\n */\n TinyColor.prototype.polyad = function (n) {\n var hsl = this.toHsl();\n var h = hsl.h;\n var result = [this];\n var increment = 360 / n;\n for (var i = 1; i < n; i++) {\n result.push(new TinyColor({ h: (h + i * increment) % 360, s: hsl.s, l: hsl.l }));\n }\n return result;\n };\n /**\n * compare color vs current color\n */\n TinyColor.prototype.equals = function (color) {\n return this.toRgbString() === new TinyColor(color).toRgbString();\n };\n return TinyColor;\n}());\nexport { TinyColor };\n// kept for backwards compatability with v1\nexport function tinycolor(color, opts) {\n if (color === void 0) { color = ''; }\n if (opts === void 0) { opts = {}; }\n return new TinyColor(color, opts);\n}\n","import { BadgeProps, extendTheme, Tooltip } from '@chakra-ui/react'\nimport { tinycolor } from '@ctrl/tinycolor'\nimport { mergeDeep } from '@sitecore-feaas/sdk'\nimport { theme as defaultTheme, ChakraTheme } from '@chakra-ui/theme'\nimport './shared.types.js'\n\nTooltip.defaultProps = {\n placement: 'top',\n hasArrow: true\n}\nexport const sitecoreTheme = extendTheme({\n zIndexes: {\n navbar: 200,\n activeEntity: 100,\n editingOverlay: 50,\n menu: 90\n },\n styles: {\n global: {\n // FEAAS HACK: Undo body styles to avoid messing up with pages.\n // These are then set as [feaas-role=ui]\n body: {\n bg: null,\n color: null,\n fontSize: null,\n lineHeight: null,\n fontFamily: null\n },\n strong: {\n fontWeight: '600'\n }\n }\n },\n colors: {\n primary: {\n 50: tinycolor(tinycolor('FAF5FF').mix('EBF8FF', 24)).saturate(20).toHexString(),\n 100: tinycolor(tinycolor(tinycolor('E9D8FD').mix('BEE3F8', 24)).tint(25).saturate(20)).toHexString(),\n 200: tinycolor(tinycolor('D6BCFA').mix('90CDF4', 24)).saturate(20).toHexString(),\n 300: tinycolor(tinycolor('B794F4').mix('63B3ED', 24)).saturate(20).toHexString(),\n 400: tinycolor(\n tinycolor(tinycolor('9F7AEA').mix('4299E1', 24)).mix(tinycolor('805AD5').mix('3182CE', 24), 70).saturate(20)\n ).toHexString(),\n 500: '#5548d9',\n 600: tinycolor(tinycolor('6B46C1').mix('2B6CB0', 24)).saturate(20).toHexString(),\n 700: tinycolor(tinycolor('553C9A').mix('2C5282', 24)).saturate(20).toHexString(),\n 800: tinycolor(tinycolor('44337A').mix('2A4365', 24)).saturate(20).toHexString(),\n 900: tinycolor(tinycolor('322659').mix('1A365D', 24)).saturate(20).toHexString()\n },\n // primary: {\n // 50: '#F6F6FF',\n // 100: '#E3E0FF',\n // 200: '#C0BAFF',\n // 300: '#9A90FD',\n // 400: '#665AEC' /* tweaked for a11y */,\n // 500: '#5548D9' /* original brand color */,\n // 600: '#4A37D5',\n // 700: '#3B2CA9',\n // 800: '#312686',\n // 900: '#201D67',\n // },\n // gray: {\n // /* neutral untinted gray scale */\n // 50: tinycolor('FAFAFA').mix('F5F5F5').toHexString(),\n // 100: tinycolor('F5F5F5').mix('E5E5E5').toHexString(),\n // 200: '#E5E5E5',\n // 300: '#D4D4D4',\n // 400: '#A3A3A3',\n // 500: '#737373',\n // 600: '#525252',\n // 700: '#404040',\n // 800: '#262626',\n // 900: '#171717',\n // },\n gray: {\n /* new & improved slightly tinted gray scale */\n\n 50: tinycolor('FAFAFA').mix('F4F4F5').toHexString(),\n 100: tinycolor('F4F4F5').mix('E4E4E7').toHexString(),\n 200: '#E4E4E7',\n 300: '#D4D4D8',\n 400: '#94949D' /* adjusted for 3:1 contrast ratio */,\n 500: '#71717A',\n 600: '#52525B',\n 700: '#3F3F46',\n 800: '#27272A',\n 900: '#18181B'\n },\n blackAlpha: {\n 50: 'rgba(0,0,0,0.03)',\n 100: 'rgba(0,0,0,0.07)',\n 200: 'rgba(0,0,0,0.10)',\n 300: 'rgba(0,0,0,0.17)',\n 400: 'rgba(0,0,0,0.42)' /* adjusted for 3:1 contrast ratio */,\n 500: 'rgba(0,0,0,0.55)',\n 600: 'rgba(0,0,0,0.68)',\n 700: 'rgba(0,0,0,0.75)',\n 800: 'rgba(0,0,0,0.85)',\n 900: 'rgba(0,0,0,0.91)'\n },\n whiteAlpha: {\n 50: 'rgba(255,255,255,0.03)',\n 100: 'rgba(255,255,255,0.07)',\n 200: 'rgba(255,255,255,0.10)',\n 300: 'rgba(255,255,255,0.17)',\n 400: 'rgba(255,255,255,0.42)',\n 500: 'rgba(255,255,255,0.55)',\n 600: 'rgba(255,255,255,0.68)',\n 700: 'rgba(255,255,255,0.75)',\n 800: 'rgba(255,255,255,0.85)',\n 900: 'rgba(255,255,255,0.91)'\n },\n red: {\n 100: tinycolor('FED7D7').tint(25).toHexString()\n },\n orange: {\n 100: tinycolor('FEEBC8').tint(25).toHexString()\n },\n yellow: {\n 100: tinycolor('FEFCBF').tint(25).toHexString()\n },\n green: {\n 100: tinycolor('C6F6D5').tint(25).toHexString()\n },\n teal: {\n 50: tinycolor('E6FFFA').spin(1).toHexString(),\n 100: tinycolor(tinycolor('B2F5EA').spin(1)).tint(25).toHexString(),\n 200: tinycolor('81E6D9').spin(1).toHexString(),\n 300: tinycolor('4FD1C5').spin(1).toHexString(),\n 400: tinycolor('38B2AC').spin(1).toHexString(),\n 500: '#02999A',\n 600: tinycolor('2C7A7B').spin(1).toHexString(),\n 700: tinycolor('285E61').spin(1).toHexString(),\n 800: tinycolor('234E52').spin(1).toHexString(),\n 900: tinycolor('1D4044').spin(1).toHexString()\n },\n cyan: {\n 100: tinycolor('C4F1F9').tint(20).toHexString(),\n 500: tinycolor('00B5D8').shade(20).toHexString(),\n 600: tinycolor('00A3C4').shade(20).toHexString(),\n 700: tinycolor('0987A0').shade(20).toHexString(),\n 800: tinycolor('086F83').shade(20).toHexString(),\n 900: tinycolor('065666').shade(20).toHexString()\n },\n blue: {\n 100: tinycolor('BEE3F8').tint(25).toHexString()\n },\n purple: {\n 50: tinycolor(tinycolor('FAF5FF').mix('EBF8FF', 24)).saturate(20).toHexString(),\n 100: tinycolor(tinycolor(tinycolor('E9D8FD').mix('BEE3F8', 24)).tint(25).saturate(20)).toHexString(),\n 200: tinycolor(tinycolor('D6BCFA').mix('90CDF4', 24)).saturate(20).toHexString(),\n 300: tinycolor(tinycolor('B794F4').mix('63B3ED', 24)).saturate(20).toHexString(),\n 400: tinycolor(\n tinycolor(tinycolor('9F7AEA').mix('4299E1', 24)).mix(tinycolor('805AD5').mix('3182CE', 24), 70).saturate(20)\n ).toHexString(),\n 500: tinycolor(tinycolor('805AD5').mix('3182CE', 24)).saturate(20).toHexString(),\n 600: tinycolor(tinycolor('6B46C1').mix('2B6CB0', 24)).saturate(20).toHexString(),\n 700: tinycolor(tinycolor('553C9A').mix('2C5282', 24)).saturate(20).toHexString(),\n 800: tinycolor(tinycolor('44337A').mix('2A4365', 24)).saturate(20).toHexString(),\n 900: tinycolor(tinycolor('322659').mix('1A365D', 24)).saturate(20).toHexString()\n },\n pink: {\n 100: tinycolor('FED7E2').tint(25).toHexString()\n }\n },\n shadows: {\n outline: '0 0 0 3px rgba(85, 72, 217, 0.5)',\n stroke: '0 0 0 1px rgba(0,0,0,0.10)'\n },\n fontSizes: {\n xs: '0.6875rem',\n sm: '0.75rem',\n md: '0.875rem',\n lg: '1rem',\n xl: '1.125rem',\n '2xl': '1.25rem',\n '3xl': '1.5rem',\n '4xl': '1.875rem',\n '5xl': '2.25rem',\n '6xl': '3rem',\n '7xl': '3.75rem',\n '8xl': '4.5rem',\n '9xl': '6rem'\n },\n sizes: {\n 4.5: '1.125rem',\n 15: '3.75rem'\n },\n radii: {\n none: '0',\n sm: '0.125rem',\n base: '0.1875rem',\n md: '0.25rem',\n lg: '0.375rem',\n xl: '0.5rem',\n '2xl': '0.75rem',\n '3xl': '1rem'\n },\n semanticTokens: {\n colors: {\n 'chakra-body-bg': {\n _light: 'white',\n _dark: 'gray.800'\n },\n 'chakra-body-text': {\n _light: 'blackAlpha.800',\n _dark: 'whiteAlpha.900'\n },\n 'chakra-border-color': {\n _light: 'blackAlpha.200',\n _dark: 'whiteAlpha.300'\n },\n 'chakra-placeholder-color': {\n _light: 'blackAlpha.500',\n _dark: 'whiteAlpha.500'\n },\n 'primary-color': {\n _light: 'primary.500',\n _dark: 'primary.300'\n },\n 'border-color-subtle': {\n _light: 'blackAlpha.100',\n _dark: 'whiteAlpha.200'\n },\n 'border-color-a11y': {\n _light: 'blackAlpha.400',\n _dark: 'whiteAlpha.400'\n },\n 'border-color-a11y-hover': {\n _light: 'blackAlpha.600',\n _dark: 'whiteAlpha.500'\n }\n }\n },\n layerStyles: {\n bg: {\n white: { bg: 'white' },\n light: { bg: 'gray.50' },\n medium: { bg: 'gray.100' },\n dark: { bg: 'gray.200' }\n },\n sidebar: {\n white: { bg: 'white' },\n light: { bg: 'gray.50' },\n medium: { bg: 'gray.100' },\n dark: { bg: 'gray.200' }\n },\n footer: {\n white: { bg: 'white' },\n light: { bg: 'gray.50' },\n medium: { bg: 'gray.100' },\n dark: { bg: 'gray.200' }\n },\n light: {\n rounded: 'md',\n bg: 'gray.50',\n inset: {\n bg: 'gray.50',\n shadow: 'inner'\n }\n },\n medium: {\n rounded: 'md',\n bg: 'gray.100',\n inset: {\n bg: 'gray.100',\n shadow: 'inner'\n }\n },\n transparent: {\n rounded: 'md',\n bg: 'transparent',\n interactive: {\n transitionProperty: 'common',\n transitionDuration: 'normal',\n rounded: 'md',\n bg: 'transparent',\n _hover: { bg: 'blackAlpha.100' },\n _active: { bg: 'blackAlpha.200' }\n },\n selected: {\n transitionProperty: 'common',\n transitionDuration: 'normal',\n rounded: 'md',\n bg: 'primary.100',\n _active: { bg: 'primary.200' }\n }\n },\n outline: {\n rounded: 'md',\n bg: 'white',\n border: '1px solid',\n borderColor: 'chakra-border-color',\n interactive: {\n transitionProperty: 'common',\n transitionDuration: 'normal',\n border: '1px solid',\n borderColor: 'chakra-border-color',\n rounded: 'md',\n bg: 'white',\n _hover: { bg: 'gray.100' },\n _active: { bg: 'gray.100' }\n },\n selected: {\n transitionProperty: 'common',\n transitionDuration: 'normal',\n border: '1px solid',\n borderColor: 'chakra-border-color',\n rounded: 'md',\n bg: 'primary.100',\n _active: { bg: 'primary.200' }\n }\n },\n outline2: {\n rounded: 'md',\n bg: 'white',\n border: '1px solid',\n borderColor: 'chakra-border-color',\n interactive: {\n transitionProperty: 'common',\n transitionDuration: 'normal',\n border: '1px solid',\n borderColor: 'chakra-border-color',\n rounded: 'md',\n bg: 'white',\n _hover: {\n shadow: 'md'\n },\n _active: {\n bg: 'gray.200',\n shadow: 'base'\n }\n },\n selected: {\n transitionProperty: 'common',\n transitionDuration: 'normal',\n border: '1px solid',\n borderColor: 'chakra-border-color',\n rounded: 'md',\n bg: 'primary.100',\n _hover: { shadow: 'md' },\n _active: { bg: 'primary.200', shadow: 'base' }\n }\n },\n outline3: {\n rounded: 'md',\n bg: 'white',\n border: '1px solid',\n borderColor: 'chakra-border-color',\n interactive: {\n transitionProperty: 'common',\n transitionDuration: 'normal',\n border: '1px solid',\n borderColor: 'chakra-border-color',\n rounded: 'md',\n bg: 'white',\n _hover: { bg: 'gray.100' },\n _active: { bg: 'gray.200' }\n },\n selected: {\n transitionProperty: 'common',\n transitionDuration: 'normal',\n border: '1px solid',\n borderColor: 'primary.500',\n rounded: 'md',\n bg: 'white',\n _hover: { bg: 'gray.100' },\n _active: { bg: 'gray.200' }\n }\n },\n shadow: {\n rounded: 'md',\n bg: 'white',\n shadow: 'base',\n interactive: {\n transitionProperty: 'common',\n transitionDuration: 'normal',\n rounded: 'md',\n bg: 'white',\n shadow: 'base',\n _hover: {\n shadow: 'md'\n },\n _active: {\n bg: 'gray.200',\n shadow: 'base'\n }\n },\n selected: {\n transitionProperty: 'common',\n transitionDuration: 'normal',\n rounded: 'md',\n bg: 'primary.100',\n shadow: 'base',\n _hover: {\n shadow: 'md'\n },\n _active: { bg: 'primary.200', shadow: 'base' }\n }\n },\n white: {\n rounded: 'md',\n bg: 'white',\n interactive: {\n transitionProperty: 'common',\n transitionDuration: 'normal',\n rounded: 'md',\n bg: 'white',\n _hover: {\n shadow: 'md'\n },\n _active: {\n bg: 'gray.200',\n shadow: 'base'\n }\n },\n selected: {\n transitionProperty: 'common',\n transitionDuration: 'normal',\n rounded: 'md',\n bg: 'primary.100',\n _hover: {\n shadow: 'md'\n },\n _active: { bg: 'primary.200', shadow: 'base' }\n }\n },\n grayLight: {},\n gray: {},\n swatch: { minW: '8', maxW: '3xs', h: '8', rounded: 'md' }\n },\n components: {\n Alert: {\n baseStyle: {\n container: {\n rounded: 'md'\n },\n title: {\n fontWeight: 'semibold'\n }\n }\n },\n Badge: {\n baseStyle: {\n fontSize: 'sm'\n },\n defaultProps: {\n colorScheme: 'blackAlpha'\n }\n },\n Breadcrumb: {\n baseStyle: {\n link: {\n color: 'chakra-placeholder-color'\n },\n separator: {\n color: 'border-color-a11y'\n }\n }\n },\n Button: {\n baseStyle: {\n rounded: 'full',\n _hover: {\n _disabled: {\n bg: null\n }\n }\n },\n variants: {\n solid: {\n defaultProps: {\n colorScheme: 'primary'\n }\n },\n primary: {\n color: 'white',\n bg: 'primary.500',\n _hover: {\n bg: 'primary.600'\n },\n _active: {\n bg: 'primary.700'\n }\n },\n secondary: {\n border: '1px solid',\n borderColor: 'chakra-border-color',\n color: 'blackAlpha.600',\n _hover: {\n bg: 'blackAlpha.100'\n },\n _active: {\n bg: 'blackAlpha.200'\n }\n },\n subtle: {\n color: 'primary.600',\n _hover: {\n bg: 'blackAlpha.100'\n },\n _active: {\n bg: 'primary.100'\n }\n },\n minimal: {\n color: 'blackAlpha.600',\n _hover: {\n bg: 'blackAlpha.100'\n },\n _active: {\n bg: 'blackAlpha.200'\n }\n },\n navHorizontal: {\n px: '2',\n color: 'blackAlpha.600',\n rounded: 'md',\n _hover: {\n bg: 'blackAlpha.100'\n },\n _active: {\n bg: 'blackAlpha.200'\n }\n },\n navHorizontalActive: {\n px: '2',\n color: 'primary.600',\n rounded: 'md',\n bg: 'primary.100',\n _active: {\n bg: 'primary.200'\n }\n },\n navVertical: {\n px: '3',\n justifyContent: 'none',\n color: 'blackAlpha.600',\n rounded: 'md',\n _hover: {\n bg: 'blackAlpha.100'\n },\n _active: {\n bg: 'blackAlpha.200'\n }\n },\n navVerticalActive: {\n px: '3',\n justifyContent: 'none',\n color: 'primary.600',\n rounded: 'md',\n bg: 'primary.100',\n _active: {\n bg: 'primary.200'\n }\n },\n filter: {\n px: '3',\n color: 'blackAlpha.600',\n rounded: 'md',\n border: '1px solid',\n borderColor: 'chakra-border-color',\n _hover: {\n bg: 'blackAlpha.100'\n },\n _active: {\n bg: 'blackAlpha.200'\n }\n },\n filterActive: {\n px: '3',\n pr: '1',\n color: 'primary.600',\n rounded: 'md',\n bg: 'primary.100',\n _active: {\n bg: 'primary.200'\n }\n }\n },\n sizes: {\n lg: {\n fontSize: 'md'\n },\n sm: {\n fontSize: 'md'\n },\n xs: {\n fontSize: 'sm'\n }\n }\n },\n CloseButton: {\n baseStyle: {\n rounded: 'full'\n },\n sizes: {\n lg: {\n fontSize: 'md'\n }\n }\n },\n Checkbox: {\n baseStyle: {\n control: {\n borderColor: 'border-color-a11y',\n bg: 'white',\n _disabled: {\n bg: 'blackAlpha.200',\n borderColor: 'transparent'\n },\n _checked: {\n _disabled: {\n bg: 'blackAlpha.200',\n borderColor: 'transparent',\n color: 'chakra-placeholder-color'\n }\n }\n }\n },\n defaultProps: {\n colorScheme: 'primary'\n },\n sizes: {\n lg: {\n label: { fontSize: 'md' }\n }\n }\n },\n CircularProgress: {},\n Code: { defaultProps: { colorScheme: 'blackAlpha' } },\n Divider: {\n baseStyle: {\n borderColor: 'chakra-border-color',\n opacity: '1'\n }\n },\n Heading: {\n baseStyle: {\n fontWeight: 'semibold'\n },\n variants: {\n section: {\n color: 'chakra-placeholder-color',\n textTransform: 'uppercase',\n fontSize: 'sm'\n }\n },\n sizes: {\n '4xl': {\n fontSize: ['5xl', '6xl', '7xl'],\n lineHeight: [1]\n },\n '3xl': {\n fontSize: ['4xl', '5xl', '6xl'],\n lineHeight: [1.2, 1]\n },\n '2xl': {\n fontSize: ['3xl', '4xl', '5xl'],\n lineHeight: [1.2, 1.2, 1]\n },\n xl: {\n fontSize: ['2xl', '3xl', '4xl'],\n lineHeight: [1.33, 1.2, 1.2]\n },\n lg: {\n fontSize: ['xl', '2xl', '3xl'],\n lineHeight: [1.33, 1.33, 1.2]\n },\n sm: {\n fontSize: 'lg'\n }\n }\n },\n Icon: {\n defaultProps: {\n boxSize: '6'\n }\n },\n Input: {\n variants: {\n outline: {\n field: {\n borderColor: 'border-color-a11y',\n bg: 'white',\n _hover: {\n borderColor: 'border-color-a11y-hover'\n }\n },\n addon: {\n borderColor: 'border-color-a11y'\n }\n }\n },\n defaultProps: {\n focusBorderColor: 'primary.500'\n },\n sizes: {\n sm: {\n field: {\n fontSize: 'md',\n borderRadius: 'md'\n },\n addon: {\n borderRadius: 'md',\n fontSize: 'md'\n }\n }\n }\n },\n Link: {\n baseStyle: {\n color: 'primary.400'\n }\n },\n Modal: {\n defaultProps: {\n isCentered: true,\n scrollBehavior: 'inside'\n },\n baseStyle: {\n dialog: { rounded: 'xl' },\n header: { py: '6', px: '8' },\n body: { px: '8' },\n footer: { py: '6', px: '6' },\n closeButton: { top: '3', insetEnd: '3' },\n overlay: {\n bg: 'blackAlpha.500'\n }\n }\n },\n NumberInput: {\n variants: {\n outline: {\n field: {\n borderColor: 'border-color-a11y',\n bg: 'white',\n _hover: {\n borderColor: 'border-color-a11y-hover'\n }\n }\n }\n },\n defaultProps: {\n focusBorderColor: 'primary.500'\n },\n sizes: {\n sm: {\n field: {\n fontSize: 'md',\n borderRadius: 'md'\n }\n }\n }\n },\n Radio: {\n baseStyle: {\n control: {\n borderColor: 'border-color-a11y',\n bg: 'white',\n _disabled: {\n bg: 'blackAlpha.200',\n borderColor: 'transparent'\n },\n _checked: {\n _disabled: {\n bg: 'blackAlpha.200',\n borderColor: 'transparent',\n color: 'blackAlpha.500'\n }\n }\n }\n },\n defaultProps: {\n colorScheme: 'primary'\n },\n sizes: {\n lg: {\n label: { fontSize: 'md' }\n }\n }\n },\n Select: {\n variants: {\n outline: {\n field: {\n borderColor: 'border-color-a11y',\n bg: 'white',\n _hover: {\n borderColor: 'border-color-a11y-hover'\n }\n }\n }\n },\n defaultProps: {\n focusBorderColor: 'primary.500'\n }\n },\n Skeleton: {\n defaultProps: {\n startColor: 'blackAlpha.100',\n endColor: 'blackAlpha.300'\n }\n },\n Spinner: {\n baseStyle: {\n color: 'primary.500'\n }\n },\n Switch: {\n baseStyle: {\n track: {\n bg: 'border-color-a11y',\n _checked: {\n bg: 'teal'\n }\n }\n },\n defaultProps: {\n colorScheme: 'teal'\n }\n },\n Table: {\n baseStyle: {\n tr: {\n th: {\n fontSize: 'sm',\n fontWeight: 'semibold',\n textTransform: 'none',\n color: 'chakra-placeholder-color',\n letterSpacing: 'normal',\n borderColor: 'border-color-subtle'\n },\n td: {\n borderColor: 'border-color-subtle'\n }\n }\n },\n variants: {\n striped: {\n tr: {\n th: {\n borderColor: 'none'\n },\n td: {\n borderColor: 'none'\n }\n }\n }\n }\n },\n Tabs: {\n defaultProps: {\n colorScheme: 'primary'\n },\n variants: {\n line: {\n tablist: {\n borderColor: 'chakra-border-color'\n },\n tab: {\n fontWeight: 'semibold'\n }\n },\n 'soft-rounded': {\n tab: {\n color: 'blackAlpha.600'\n }\n },\n 'solid-rounded': {\n tab: {\n color: 'blackAlpha.600'\n }\n }\n }\n },\n Tag: {\n defaultProps: {\n colorScheme: 'blackAlpha'\n },\n // baseStyle: {\n // container: {\n // fontWeight: 'normal',\n // },\n // },\n sizes: {\n sm: {\n container: {\n fontSize: 'sm',\n px: '1.5'\n }\n },\n md: {\n container: {\n fontSize: 'md'\n }\n },\n lg: {\n container: {\n fontSize: 'md'\n }\n }\n },\n variants: {\n filter: {\n container: {\n backgroundColor: 'primary.100'\n }\n }\n }\n },\n Text: {\n variants: {\n subtle: {\n color: 'chakra-placeholder-color'\n },\n small: {\n color: 'chakra-placeholder-color',\n fontSize: 'sm'\n },\n tiny: {\n color: 'chakra-placeholder-color',\n fontSize: 'xs'\n },\n label: {\n color: 'chakra-placeholder-color',\n fontWeight: 'semibold'\n },\n labelsm: {\n color: 'chakra-placeholder-color',\n // fontSize: 'sm',\n fontWeight: 'semibold'\n // textTransform: 'uppercase',\n }\n }\n },\n Textarea: {\n baseStyle: {\n maxW: 'lg'\n },\n variants: {\n outline: {\n borderColor: 'border-color-a11y',\n bg: 'white',\n _hover: {\n borderColor: 'border-color-a11y-hover'\n }\n }\n },\n defaultProps: {\n focusBorderColor: 'primary.500'\n }\n }\n }\n})\n\nconst FEAASStyles = {\n zIndexes: {\n navbar: 200,\n activeEntity: 100,\n editingOverlay: 50,\n menu: 90\n },\n fontSizes: {\n 'icon-xl': '24px',\n 'icon-md': '16px',\n 'icon-lg': '18px',\n 'icon-sm': '14px'\n },\n sizes: {\n 'icon-xl': '24px',\n 'icon-md': '16px',\n 'icon-lg': '18px',\n 'icon-sm': '14px',\n container: {\n xxl: '1440px'\n }\n },\n styles: {\n global: {\n '.has-edited-entity #layout .entity-is-active .entity-is-active': { outline: 'none' },\n '.has-edited-entity #layout *': {\n pointerEvents: 'none !important'\n },\n '#overflow-wrapper': {\n transition: '.5s padding-bottom, .5s scroll-margin'\n },\n '.has-edited-entity #layout #navbar:before': {\n content: '\"\"',\n left: 0,\n right: 0,\n bottom: 0,\n top: 0,\n background: 'white',\n position: 'absolute',\n opacity: 0.5,\n display: 'block',\n zIndex: 2\n },\n '.has-active-entity #layout .entity-is-active': {\n position: 'relative',\n zIndex: 1\n },\n '.has-edited-entity #layout .entity-is-active': {\n outline: '20000px solid rgba(255,255,255,0.5)',\n position: 'relative',\n zIndex: 1\n },\n '.has-edited-entity #layout .entity-is-active *': {\n pointerEvents: 'all !important'\n },\n '.chakra-collapse[style*=\"height: auto\"]': {\n overflow: 'initial !important'\n },\n '.chakra-popover__popper.chakra-popover__popper, .chakra-menu__menu-button.chakra-menu__menu-button + div:not([class]), .chakra-menu__menu-button.chakra-menu__menu-button + span + div, .chakra-menu__menu-button + [style*=\"--popper-transform-origin\"]':\n {\n margin: '0'\n },\n '[feaas-role=\"ui\"] label': {\n userSelect: 'none'\n },\n '.chakra-icon path': {\n fill: 'currentColor'\n },\n '.chakra-portal': {\n position: 'relative'\n },\n // [feaas-role=\"ui\"] acts as body, all body styles are set here\n '[feaas-role=\"ui\"], :host': {\n lineHeight: 'base',\n bg: 'transparent',\n color: 'chakra-body-text',\n fontFamily: 'body',\n fontSize: 'md'\n },\n '[feaas-role=\"ui\"] strong': {\n fontWeight: '600'\n }\n }\n },\n components: {\n Icon: {\n defaultProps: {\n boxSize: '6'\n }\n },\n Alert: {\n // color the AlertTitle/AlertDescription to neutral colors\n baseStyle: {\n title: {\n color: 'chakra-body-text'\n },\n description: {\n color: 'chakra-body-text'\n }\n },\n // Chakra toasts use alert with \"solid\" variant, which is too bright. This\n // maps solid variant to subtle, making toasts look the same as alerts\n variants: {\n solid: (props: any) => {\n return mergeDeep(props.theme.components.Alert.variants.subtle(props), {\n container: {\n maxWidth: '320px'\n }\n })\n }\n }\n },\n // Switch may lose focus ring on the second click, this forces the ring to always be visible\n Switch: {\n baseStyle: {\n track: {\n _focus: {\n boxShadow: 'var(--chakra-shadows-outline) !important'\n }\n }\n }\n },\n // Buttons in new theme dont have the focus ring\n Button: {\n baseStyle: {\n _focus: {\n boxShadow: 'var(--chakra-shadows-outline) !important'\n }\n },\n // Buttons in SDS had some sort of a looking style by default variant, so this adds a new one\n defaultProps: {\n variant: 'default'\n },\n variants: {\n default: {\n background: 'transparent',\n _hover: { bg: 'blackAlpha.100' },\n _active: { bg: 'blackAlpha.200' }\n },\n dialogPane: {\n rounded: 'lg',\n px: '1',\n flexDirection: 'column',\n height: 'auto',\n display: 'flex',\n alignItems: 'stretch',\n textAlign: 'left',\n whiteSpace: 'wrap',\n boxShadow: 'none',\n border: '1px solid',\n borderColor: 'blackAlpha.200',\n bg: 'white',\n p: 0,\n _hover: {\n background: 'blackAlpha.100',\n _disabled: {\n bg: 'white',\n boxShadow: 'none',\n borderColor: 'blackAlpha.200',\n cursor: 'default'\n },\n _active: {\n borderColor: 'primary.500'\n }\n },\n _active: {\n borderColor: 'primary.500',\n _hover: {\n bg: 'white'\n }\n },\n _disabled: {\n opacity: 1,\n cursor: 'pointer'\n }\n },\n dialogItem: {\n rounded: 'lg',\n px: '1',\n _hover: {\n bg: 'blackAlpha.100',\n _disabled: {\n bg: 'transparent'\n }\n },\n _active: { bg: 'blackAlpha.200' },\n _disabled: { opacity: 1, cursor: 'default' },\n py: 0,\n color: 'blackAlpha.500'\n },\n chrome: (props: BadgeProps) => {\n // unfortunately using isSelected makes react complain, as Chakra passes it to DOM element\n const { colorScheme, selected, size } = props\n return {\n _hover: {\n bg: colorScheme + '.100',\n color: colorScheme + '.800'\n },\n _active: {\n bg: colorScheme + '.100',\n color: colorScheme + '.800'\n }\n }\n }\n }\n },\n Tag: {\n baseStyle: {\n container: {\n userSelect: 'none',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n minWidth: '1px',\n display: 'inline-block',\n lineHeight: '24px'\n }\n }\n },\n Badge: {\n baseStyle: {\n fontSize: 'sm',\n lineHeight: '1.6',\n userSelect: 'none',\n textTransform: 'none',\n fontWeight: 500,\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n minWidth: '1px',\n display: 'inline-block'\n },\n defaultProps: {\n colorScheme: 'blackAlpha'\n },\n\n variants: {\n clickable: (props: BadgeProps) => {\n // unfortunately using isSelected makes react complain, as Chakra passes it to DOM element\n const { colorScheme, selected, size } = props\n return {\n textTransform: 'none',\n fontWeight: '500',\n fontSize: size == 'sm' ? '12px' : '14px',\n lineHeight: size == 'sm' ? '18px' : '22px',\n variant: 'solid',\n cursor: 'pointer',\n display: 'flex',\n alignItems: 'center',\n _hover: {\n outlineStyle: 'solid'\n },\n _active: {\n outline: selected ? '1px solid' : null\n },\n outline: selected ? '1px solid' : null,\n outlineColor: `${colorScheme}.800`,\n bg: `${colorScheme}.100`,\n color: `${colorScheme}.800`\n }\n },\n datapath: (props: any) => ({\n ...defaultTheme.components.Badge.variants.subtle({\n colorScheme: 'green',\n ...props\n }),\n lineHeight: '1.6'\n })\n }\n },\n // Controversial: Makes focus ring on popover less random and jerky\n // When focus is inside the popover, it keeps a grey inactive-looking focus ring\n Popover: {\n defaultProps: {\n variant: 'default'\n },\n variants: {\n default: {\n content: {\n transition: 'box-shadow 0.2s',\n boxShadow: '0',\n _focusWithin: {\n transition: 'box-shadow 0.7s',\n boxShadow: '0 0 0 3px var(--chakra-colors-blackAlpha-200)',\n outline: '2px solid transparent',\n outlineOffset: '2px'\n },\n _focus: {\n transition: 'box-shadow 0.2s !important',\n boxShadow: 'var(--chakra-shadows-outline) !important',\n outline: '2px solid transparent',\n outlineOffset: '2px'\n }\n }\n }\n }\n },\n // This adds focus ring to the menu to look consistent with popover\n Menu: {\n defaultProps: {\n variant: 'default'\n },\n variants: {\n default: {\n list: {\n boxShadow: 'outline',\n transition: 'box-shadow 0.2s !important',\n _focusWithin: {\n boxShadow: 'outline',\n outline: '2px solid transparent',\n outlineOffset: '2px'\n }\n },\n divider: {\n borderBottomColor: 'blackAlpha.300'\n }\n },\n submenu: {\n list: {\n transition: 'box-shadow 0.2s !important',\n boxShadow: '0 0 0 3px var(--chakra-colors-blackAlpha-200)',\n _focusWithin: {\n boxShadow: 'outline',\n outline: '2px solid transparent',\n outlineOffset: '2px'\n }\n }\n }\n }\n },\n FormLabel: {\n variants: {\n subtle: {\n fontSize: 12,\n color: 'gray.700'\n }\n }\n },\n FormControl: {\n variants: {\n horizontal: {\n display: 'flex',\n alignItems: 'center',\n width: 'auto'\n }\n }\n },\n Link: {\n baseStyle: {\n color: 'gray.800',\n ':hover': {\n textDecoration: 'underline',\n color: 'primary.500'\n }\n }\n },\n Modal: {\n defaultProps: {\n isCentered: true,\n scrollBehavior: 'inside'\n },\n baseStyle: {\n dialog: { rounded: 'xl' },\n header: { py: '6', px: '8' },\n body: { px: '8', display: 'flex', minHeight: 1, width: '100%', alignItems: 'stretch' },\n footer: { py: '6', px: '6' },\n closeButton: { top: '3', insetEnd: '3' },\n overlay: {\n bg: 'blackAlpha.500'\n }\n }\n }\n }\n}\n\nfunction transformTheme(object: any, iterator: (arg: any) => any): any {\n const modified = iterator(object)\n if (modified !== undefined) {\n return modified\n }\n\n if (typeof object == 'string') {\n return object.replace(/(?:\\d+?.\\d+?|\\d+)rem/g, (n) => parseFloat(n) * 16 + 'px')\n }\n if (Array.isArray(object)) {\n return object.map((v) => transformTheme(v, iterator))\n }\n if (object && typeof object == 'object') {\n var copy: any = {}\n for (var property in object) {\n // hack - default to light theme\n copy[property] = transformTheme(object[property], iterator)\n }\n return copy\n }\n return object\n}\n\n/**\n * Make _light values default, to fix chakra inside web component as it can't use themes because of how :host selectors\n * are generated.\n */\nconst sitecoreThemeWithLightAsDefault = transformTheme(sitecoreTheme, (object) => {\n if (object === 'primary.500') return '#5548d9'\n if (object?._light) {\n return object?._light\n }\n}) as typeof sitecoreTheme\n\nconst combinedTheme = extendTheme(defaultTheme, sitecoreThemeWithLightAsDefault, FEAASStyles)\n/**\n * Turn all rems into pixels, so that components embedded to external sites dont get affected by their layout font size\n * settings. It's a first and foremost fix for integrating with Pages, which sets its font-size to small value,\n * affecting all the web components\n */\nconst pixelizedTheme = transformTheme(combinedTheme, (object) => {\n if (typeof object == 'string') {\n return object.replace(/(?:\\d+?.\\d+?|\\d+)rem/g, (n) => parseFloat(n) * 16 + 'px')\n }\n}) as typeof combinedTheme\nexport default pixelizedTheme as ChakraTheme\n","import * as React from 'react'\nimport { mdiLockOutline, mdiMapMarkerQuestionOutline, mdiAlertCircleOutline } from '@mdi/js'\nimport { Box, Container, Flex, Heading, Image, Text } from '@chakra-ui/react'\n\nexport interface GenericErrorTemplateProps {\n /** The title of the page */\n title: string\n /** Optional subtext of the page */\n subtext?: string\n /** Main error text */\n text: React.ReactNode | string\n /** Links */\n shortcuts?: React.ReactNode\n /** Variant types */\n variant: 'not-found' | 'access-denied' | 'error' | 'unauthorized'\n}\n\nexport const variants = {\n 'not-found': {\n color: 'purple',\n icon: mdiMapMarkerQuestionOutline,\n illustration: {\n colored: 'https://delivery-sitecore.sitecorecontenthub.cloud/api/public/content/spot-map-search',\n grayed: 'https://delivery-sitecore.sitecorecontenthub.cloud/api/public/content/spot-map-search-neutral'\n },\n label: 'Resource not found'\n },\n 'access-denied': {\n color: 'orange',\n icon: mdiLockOutline,\n illustration: {\n colored: 'https://delivery-sitecore.sitecorecontenthub.cloud/api/public/content/spot-lock',\n grayed: 'https://delivery-sitecore.sitecorecontenthub.cloud/api/public/content/spot-lock-neutral'\n },\n label: 'Access denied'\n },\n error: {\n color: 'red',\n icon: mdiAlertCircleOutline,\n illustration: {\n colored: 'https://delivery-sitecore.sitecorecontenthub.cloud/api/public/content/spot-alert',\n grayed: 'https://delivery-sitecore.sitecorecontenthub.cloud/api/public/content/spot-alert-neutral'\n },\n label: 'Error'\n },\n unauthorized: {\n color: 'red',\n icon: mdiAlertCircleOutline,\n illustration: {\n colored: 'https://delivery-sitecore.sitecorecontenthub.cloud/api/public/content/spot-stop',\n grayed: 'https://delivery-sitecore.sitecorecontenthub.cloud/api/public/content/spot-stop-neutral'\n },\n label: 'Unauthorized'\n },\n unavailable: {\n color: 'red',\n icon: mdiAlertCircleOutline,\n illustration: {\n colored: 'https://delivery-sitecore.sitecorecontenthub.cloud/api/public/content/spot-wrench-clock',\n grayed: 'https://delivery-sitecore.sitecorecontenthub.cloud/api/public/content/spot-wrench-clock-neutral'\n },\n label: 'Error'\n }\n}\n\nconst GenericErrorTemplate: React.FC = ({ title, subtext, text, variant, shortcuts }) => {\n const activeVariant = variants[variant]\n\n return (\n \n \n \n \n {activeVariant.label}\n \n \n {title}\n \n \n {subtext}\n \n \n {text}\n \n {shortcuts && (\n \n {shortcuts}\n \n )}\n \n \n \n )\n}\n\nexport { GenericErrorTemplate }\n","import { Box, Button, Flex, Icon, Link, VStack } from '@chakra-ui/react'\nimport { mdiAlertOutline } from '@mdi/js'\nimport { useNavigate } from 'react-router-dom'\nimport { useEffect } from 'react'\nimport { GenericErrorTemplate } from './GenericErrorTemplate.js'\n\nconst getVariant = (e: Error) => {\n switch (e.name) {\n case 'AuthError':\n return 'unauthorized'\n case 'TenantError':\n return 'access-denied'\n case 'LibraryError':\n return 'access-denied'\n default:\n return 'error'\n }\n}\nconst Error = ({ error, resetErrorBoundary }: { error: Error; resetErrorBoundary: () => void }) => {\n const navigate = useNavigate()\n useEffect(() => {\n if (error) {\n ;(document.querySelector('feaas-context')?.shadowRoot || document)\n ?.querySelector('feaas-loader-app, feaas-loader')\n ?.setAttribute('hidden', 'hidden')\n\n if ('Cypress' in window) {\n try {\n const e = error.cause || error\n // @ts-ignore\n window.Cypress.log(e.message, e.stack)\n } catch (e) {}\n }\n }\n }, [error])\n console.log(error.cause)\n return (\n \n \n {\n navigate('/logout')\n location.reload()\n }}\n mb={4}\n >\n Logout\n \n }\n />\n \n \n )\n}\n\nexport default Error\n","function filePathToFileName(fileUrl) {\n var origin = window.location.origin || window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '');\n\n if (fileUrl.indexOf(origin) > -1) {\n fileUrl = fileUrl.replace(origin + '/', '');\n }\n\n return fileUrl;\n}\n\nfunction cleanFilePath(filePath) {\n if (filePath === void 0) {\n filePath = '';\n }\n\n if (filePath === '') {\n filePath = '';\n }\n\n return filePath;\n}\n\nfunction isFileInline(fileUrl) {\n if (fileUrl) {\n return window.location.href.indexOf(fileUrl) === 0;\n }\n\n return false;\n}\n\nfunction normalizeStackFrames(stackFrames) {\n return stackFrames.map(function (frame) {\n if (frame.functionName) {\n frame.functionName = normalizeFunctionName(frame.functionName);\n }\n\n return frame;\n });\n}\n\nfunction normalizeFunctionName(fnName) {\n var parts = fnName.split('/');\n\n if (parts.length > 1) {\n fnName = ['Object', parts[parts.length - 1]].join('.');\n } else {\n fnName = parts[0];\n }\n\n fnName = fnName.replace(/.<$/gi, '.');\n fnName = fnName.replace(/^Anonymous function$/, '');\n parts = fnName.split('.');\n\n if (parts.length > 1) {\n fnName = parts[parts.length - 1];\n } else {\n fnName = parts[0];\n }\n\n return fnName;\n}\n\nfunction isValidStackTrace(stackTraces) {\n if (stackTraces.length === 0) {\n return false;\n }\n\n if (stackTraces.length === 1) {\n var stackTrace = stackTraces[0];\n return 'lineNumber' in stackTrace;\n }\n\n return true;\n}\n\nexport function createStackTraces(stackParser, errorEvent) {\n var error = errorEvent.error,\n filename = errorEvent.filename,\n lineno = errorEvent.lineno,\n colno = errorEvent.colno;\n var stackTraces = [];\n\n if (error) {\n try {\n stackTraces = stackParser.parse(error);\n } catch (e) {}\n }\n\n if (!isValidStackTrace(stackTraces)) {\n stackTraces = [{\n fileName: filename,\n lineNumber: lineno,\n columnNumber: colno\n }];\n }\n\n var normalizedStackTraces = normalizeStackFrames(stackTraces);\n return normalizedStackTraces.map(function (stack) {\n var fileName = stack.fileName,\n lineNumber = stack.lineNumber,\n columnNumber = stack.columnNumber,\n _stack$functionName = stack.functionName,\n functionName = _stack$functionName === void 0 ? '' : _stack$functionName;\n\n if (!fileName && !lineNumber) {\n return {};\n }\n\n if (!columnNumber && !lineNumber) {\n return {};\n }\n\n var filePath = cleanFilePath(fileName);\n var cleanedFileName = filePathToFileName(filePath);\n\n if (isFileInline(filePath)) {\n cleanedFileName = '(inline script)';\n }\n\n return {\n abs_path: fileName,\n filename: cleanedFileName,\n function: functionName,\n lineno: lineNumber,\n colno: columnNumber\n };\n });\n}\nexport function filterInvalidFrames(frames) {\n return frames.filter(function (_ref) {\n var filename = _ref.filename,\n lineno = _ref.lineno;\n return typeof filename !== 'undefined' && typeof lineno !== 'undefined';\n });\n}","/**\n * @this {Promise}\n */\nfunction finallyConstructor(callback) {\n var constructor = this.constructor;\n return this.then(\n function(value) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n // @ts-ignore\n return constructor.reject(reason);\n });\n }\n );\n}\n\nexport default finallyConstructor;\n","function allSettled(arr) {\n var P = this;\n return new P(function(resolve, reject) {\n if (!(arr && typeof arr.length !== 'undefined')) {\n return reject(\n new TypeError(\n typeof arr +\n ' ' +\n arr +\n ' is not iterable(cannot read property Symbol(Symbol.iterator))'\n )\n );\n }\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n function(e) {\n args[i] = { status: 'rejected', reason: e };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n );\n return;\n }\n }\n args[i] = { status: 'fulfilled', value: val };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n}\n\nexport default allSettled;\n","import promiseFinally from './finally';\nimport allSettled from './allSettled';\n\n// Store setTimeout reference so promise-polyfill will be unaffected by\n// other code modifying setTimeout (like sinon.useFakeTimers())\nvar setTimeoutFunc = setTimeout;\n\nfunction isArray(x) {\n return Boolean(x && typeof x.length !== 'undefined');\n}\n\nfunction noop() {}\n\n// Polyfill for Function.prototype.bind\nfunction bind(fn, thisArg) {\n return function() {\n fn.apply(thisArg, arguments);\n };\n}\n\n/**\n * @constructor\n * @param {Function} fn\n */\nfunction Promise(fn) {\n if (!(this instanceof Promise))\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n /** @type {!number} */\n this._state = 0;\n /** @type {!boolean} */\n this._handled = false;\n /** @type {Promise|undefined} */\n this._value = undefined;\n /** @type {!Array} */\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\n/**\n * @constructor\n */\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n // @ts-ignore\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = promiseFinally;\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.all accepts an array'));\n }\n\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.allSettled = allSettled;\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.race accepts an array'));\n }\n\n for (var i = 0, len = arr.length; i < len; i++) {\n Promise.resolve(arr[i]).then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n // @ts-ignore\n (typeof setImmediate === 'function' &&\n function(fn) {\n // @ts-ignore\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nexport default Promise;\n","import PromisePollyfill from 'promise-polyfill';\nimport { isBrowser } from './utils';\nvar local = {};\n\nif (isBrowser) {\n local = window;\n} else if (typeof self !== 'undefined') {\n local = self;\n}\n\nvar Promise = 'Promise' in local ? local.Promise : PromisePollyfill;\nexport { Promise };","import { Promise } from './polyfills';\nvar slice = [].slice;\nvar isBrowser = typeof window !== 'undefined';\nvar PERF = isBrowser && typeof performance !== 'undefined' ? performance : {};\n\nfunction isCORSSupported() {\n var xhr = new window.XMLHttpRequest();\n return 'withCredentials' in xhr;\n}\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToHex(buffer) {\n var hexOctets = [];\n\n for (var _i = 0; _i < buffer.length; _i++) {\n hexOctets.push(byteToHex[buffer[_i]]);\n }\n\n return hexOctets.join('');\n}\n\nvar destination = new Uint8Array(16);\n\nfunction rng() {\n if (typeof crypto != 'undefined' && typeof crypto.getRandomValues == 'function') {\n return crypto.getRandomValues(destination);\n } else if (typeof msCrypto != 'undefined' && typeof msCrypto.getRandomValues == 'function') {\n return msCrypto.getRandomValues(destination);\n }\n\n return destination;\n}\n\nfunction generateRandomId(length) {\n var id = bytesToHex(rng());\n return id.substr(0, length);\n}\n\nfunction getDtHeaderValue(span) {\n var dtVersion = '00';\n var dtUnSampledFlags = '00';\n var dtSampledFlags = '01';\n\n if (span && span.traceId && span.id && span.parentId) {\n var flags = span.sampled ? dtSampledFlags : dtUnSampledFlags;\n var id = span.sampled ? span.id : span.parentId;\n return dtVersion + '-' + span.traceId + '-' + id + '-' + flags;\n }\n}\n\nfunction parseDtHeaderValue(value) {\n var parsed = /^([\\da-f]{2})-([\\da-f]{32})-([\\da-f]{16})-([\\da-f]{2})$/.exec(value);\n\n if (parsed) {\n var flags = parsed[4];\n var sampled = flags !== '00';\n return {\n traceId: parsed[2],\n id: parsed[3],\n sampled: sampled\n };\n }\n}\n\nfunction isDtHeaderValid(header) {\n return /^[\\da-f]{2}-[\\da-f]{32}-[\\da-f]{16}-[\\da-f]{2}$/.test(header) && header.slice(3, 35) !== '00000000000000000000000000000000' && header.slice(36, 52) !== '0000000000000000';\n}\n\nfunction getTSHeaderValue(_ref) {\n var sampleRate = _ref.sampleRate;\n\n if (typeof sampleRate !== 'number' || String(sampleRate).length > 256) {\n return;\n }\n\n var NAMESPACE = 'es';\n var SEPARATOR = '=';\n return \"\" + NAMESPACE + SEPARATOR + \"s:\" + sampleRate;\n}\n\nfunction setRequestHeader(target, name, value) {\n if (typeof target.setRequestHeader === 'function') {\n target.setRequestHeader(name, value);\n } else if (target.headers && typeof target.headers.append === 'function') {\n target.headers.append(name, value);\n } else {\n target[name] = value;\n }\n}\n\nfunction checkSameOrigin(source, target) {\n var isSame = false;\n\n if (typeof target === 'string') {\n isSame = source === target;\n } else if (target && typeof target.test === 'function') {\n isSame = target.test(source);\n } else if (Array.isArray(target)) {\n target.forEach(function (t) {\n if (!isSame) {\n isSame = checkSameOrigin(source, t);\n }\n });\n }\n\n return isSame;\n}\n\nfunction isPlatformSupported() {\n return isBrowser && typeof Set === 'function' && typeof JSON.stringify === 'function' && PERF && typeof PERF.now === 'function' && isCORSSupported();\n}\n\nfunction setLabel(key, value, obj) {\n if (!obj || !key) return;\n var skey = removeInvalidChars(key);\n var valueType = typeof value;\n\n if (value != undefined && valueType !== 'boolean' && valueType !== 'number') {\n value = String(value);\n }\n\n obj[skey] = value;\n return obj;\n}\n\nfunction getServerTimingInfo(serverTimingEntries) {\n if (serverTimingEntries === void 0) {\n serverTimingEntries = [];\n }\n\n var serverTimingInfo = [];\n var entrySeparator = ', ';\n var valueSeparator = ';';\n\n for (var _i2 = 0; _i2 < serverTimingEntries.length; _i2++) {\n var _serverTimingEntries$ = serverTimingEntries[_i2],\n name = _serverTimingEntries$.name,\n duration = _serverTimingEntries$.duration,\n description = _serverTimingEntries$.description;\n var timingValue = name;\n\n if (description) {\n timingValue += valueSeparator + 'desc=' + description;\n }\n\n if (duration) {\n timingValue += valueSeparator + 'dur=' + duration;\n }\n\n serverTimingInfo.push(timingValue);\n }\n\n return serverTimingInfo.join(entrySeparator);\n}\n\nfunction getTimeOrigin() {\n return PERF.timing.fetchStart;\n}\n\nfunction stripQueryStringFromUrl(url) {\n return url && url.split('?')[0];\n}\n\nfunction isObject(value) {\n return value !== null && typeof value === 'object';\n}\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\n\nfunction baseExtend(dst, objs, deep) {\n for (var i = 0, ii = objs.length; i < ii; ++i) {\n var obj = objs[i];\n if (!isObject(obj) && !isFunction(obj)) continue;\n var keys = Object.keys(obj);\n\n for (var j = 0, jj = keys.length; j < jj; j++) {\n var key = keys[j];\n var src = obj[key];\n\n if (deep && isObject(src)) {\n if (!isObject(dst[key])) dst[key] = Array.isArray(src) ? [] : {};\n baseExtend(dst[key], [src], false);\n } else {\n dst[key] = src;\n }\n }\n }\n\n return dst;\n}\n\nfunction getElasticScript() {\n if (typeof document !== 'undefined') {\n var scripts = document.getElementsByTagName('script');\n\n for (var i = 0, l = scripts.length; i < l; i++) {\n var sc = scripts[i];\n\n if (sc.src.indexOf('elastic') > 0) {\n return sc;\n }\n }\n }\n}\n\nfunction getCurrentScript() {\n if (typeof document !== 'undefined') {\n var currentScript = document.currentScript;\n\n if (!currentScript) {\n return getElasticScript();\n }\n\n return currentScript;\n }\n}\n\nfunction extend(dst) {\n return baseExtend(dst, slice.call(arguments, 1), false);\n}\n\nfunction merge(dst) {\n return baseExtend(dst, slice.call(arguments, 1), true);\n}\n\nfunction isUndefined(obj) {\n return typeof obj === 'undefined';\n}\n\nfunction noop() {}\n\nfunction find(array, predicate, thisArg) {\n if (array == null) {\n throw new TypeError('array is null or not defined');\n }\n\n var o = Object(array);\n var len = o.length >>> 0;\n\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n\n var k = 0;\n\n while (k < len) {\n var kValue = o[k];\n\n if (predicate.call(thisArg, kValue, k, o)) {\n return kValue;\n }\n\n k++;\n }\n\n return undefined;\n}\n\nfunction removeInvalidChars(key) {\n return key.replace(/[.*\"]/g, '_');\n}\n\nfunction getLatestSpan(spans, typeFilter) {\n var latestSpan = null;\n\n for (var _i3 = 0; _i3 < spans.length; _i3++) {\n var span = spans[_i3];\n\n if (typeFilter && typeFilter(span.type) && (!latestSpan || latestSpan._end < span._end)) {\n latestSpan = span;\n }\n }\n\n return latestSpan;\n}\n\nfunction getLatestNonXHRSpan(spans) {\n return getLatestSpan(spans, function (type) {\n return String(type).indexOf('external') === -1;\n });\n}\n\nfunction getLatestXHRSpan(spans) {\n return getLatestSpan(spans, function (type) {\n return String(type).indexOf('external') !== -1;\n });\n}\n\nfunction getEarliestSpan(spans) {\n var earliestSpan = spans[0];\n\n for (var _i4 = 1; _i4 < spans.length; _i4++) {\n var span = spans[_i4];\n\n if (earliestSpan._start > span._start) {\n earliestSpan = span;\n }\n }\n\n return earliestSpan;\n}\n\nfunction now() {\n return PERF.now();\n}\n\nfunction getTime(time) {\n return typeof time === 'number' && time >= 0 ? time : now();\n}\n\nfunction getDuration(start, end) {\n if (isUndefined(end) || isUndefined(start)) {\n return null;\n }\n\n return parseInt(end - start);\n}\n\nfunction scheduleMacroTask(callback) {\n setTimeout(callback, 0);\n}\n\nfunction scheduleMicroTask(callback) {\n Promise.resolve().then(callback);\n}\n\nfunction isPerfTimelineSupported() {\n return typeof PERF.getEntriesByType === 'function';\n}\n\nfunction isPerfTypeSupported(type) {\n return typeof PerformanceObserver !== 'undefined' && PerformanceObserver.supportedEntryTypes && PerformanceObserver.supportedEntryTypes.indexOf(type) >= 0;\n}\n\nfunction isBeaconInspectionEnabled() {\n var flagName = '_elastic_inspect_beacon_';\n\n if (sessionStorage.getItem(flagName) != null) {\n return true;\n }\n\n if (!window.URL || !window.URLSearchParams) {\n return false;\n }\n\n try {\n var parsedUrl = new URL(window.location.href);\n var isFlagSet = parsedUrl.searchParams.has(flagName);\n\n if (isFlagSet) {\n sessionStorage.setItem(flagName, true);\n }\n\n return isFlagSet;\n } catch (e) {}\n\n return false;\n}\n\nexport { extend, merge, isUndefined, noop, baseExtend, bytesToHex, isCORSSupported, isObject, isFunction, isPlatformSupported, isDtHeaderValid, parseDtHeaderValue, getServerTimingInfo, getDtHeaderValue, getTSHeaderValue, getCurrentScript, getElasticScript, getTimeOrigin, generateRandomId, getEarliestSpan, getLatestNonXHRSpan, getLatestXHRSpan, getDuration, getTime, now, rng, checkSameOrigin, scheduleMacroTask, scheduleMicroTask, setLabel, setRequestHeader, stripQueryStringFromUrl, find, removeInvalidChars, PERF, isPerfTimelineSupported, isBrowser, isPerfTypeSupported, isBeaconInspectionEnabled };","import { isBrowser } from './utils';\n\nfunction isDefaultPort(port, protocol) {\n switch (protocol) {\n case 'http:':\n return port === '80';\n\n case 'https:':\n return port === '443';\n }\n\n return true;\n}\n\nvar RULES = [['#', 'hash'], ['?', 'query'], ['/', 'path'], ['@', 'auth', 1], [NaN, 'host', undefined, 1]];\nvar PROTOCOL_REGEX = /^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\S\\s]*)/i;\nexport var Url = function () {\n function Url(url) {\n var _this$extractProtocol = this.extractProtocol(url || ''),\n protocol = _this$extractProtocol.protocol,\n address = _this$extractProtocol.address,\n slashes = _this$extractProtocol.slashes;\n\n var relative = !protocol && !slashes;\n var location = this.getLocation();\n var instructions = RULES.slice();\n address = address.replace('\\\\', '/');\n\n if (!slashes) {\n instructions[2] = [NaN, 'path'];\n }\n\n var index;\n\n for (var i = 0; i < instructions.length; i++) {\n var instruction = instructions[i];\n var parse = instruction[0];\n var key = instruction[1];\n\n if (typeof parse === 'string') {\n index = address.indexOf(parse);\n\n if (~index) {\n var instLength = instruction[2];\n\n if (instLength) {\n var newIndex = address.lastIndexOf(parse);\n index = Math.max(index, newIndex);\n this[key] = address.slice(0, index);\n address = address.slice(index + instLength);\n } else {\n this[key] = address.slice(index);\n address = address.slice(0, index);\n }\n }\n } else {\n this[key] = address;\n address = '';\n }\n\n this[key] = this[key] || (relative && instruction[3] ? location[key] || '' : '');\n if (instruction[3]) this[key] = this[key].toLowerCase();\n }\n\n if (relative && this.path.charAt(0) !== '/') {\n this.path = '/' + this.path;\n }\n\n this.relative = relative;\n this.protocol = protocol || location.protocol;\n this.hostname = this.host;\n this.port = '';\n\n if (/:\\d+$/.test(this.host)) {\n var value = this.host.split(':');\n var port = value.pop();\n var hostname = value.join(':');\n\n if (isDefaultPort(port, this.protocol)) {\n this.host = hostname;\n } else {\n this.port = port;\n }\n\n this.hostname = hostname;\n }\n\n this.origin = this.protocol && this.host && this.protocol !== 'file:' ? this.protocol + '//' + this.host : 'null';\n this.href = this.toString();\n }\n\n var _proto = Url.prototype;\n\n _proto.toString = function toString() {\n var result = this.protocol;\n result += '//';\n\n if (this.auth) {\n var REDACTED = '[REDACTED]';\n var userpass = this.auth.split(':');\n var username = userpass[0] ? REDACTED : '';\n var password = userpass[1] ? ':' + REDACTED : '';\n result += username + password + '@';\n }\n\n result += this.host;\n result += this.path;\n result += this.query;\n result += this.hash;\n return result;\n };\n\n _proto.getLocation = function getLocation() {\n var globalVar = {};\n\n if (isBrowser) {\n globalVar = window;\n }\n\n return globalVar.location;\n };\n\n _proto.extractProtocol = function extractProtocol(url) {\n var match = PROTOCOL_REGEX.exec(url);\n return {\n protocol: match[1] ? match[1].toLowerCase() : '',\n slashes: !!match[2],\n address: match[3]\n };\n };\n\n return Url;\n}();\nexport function slugifyUrl(urlStr, depth) {\n if (depth === void 0) {\n depth = 2;\n }\n\n var parsedUrl = new Url(urlStr);\n var query = parsedUrl.query,\n path = parsedUrl.path;\n var pathParts = path.substring(1).split('/');\n var redactString = ':id';\n var wildcard = '*';\n var specialCharsRegex = /\\W|_/g;\n var digitsRegex = /[0-9]/g;\n var lowerCaseRegex = /[a-z]/g;\n var upperCaseRegex = /[A-Z]/g;\n var redactedParts = [];\n var redactedBefore = false;\n\n for (var index = 0; index < pathParts.length; index++) {\n var part = pathParts[index];\n\n if (redactedBefore || index > depth - 1) {\n if (part) {\n redactedParts.push(wildcard);\n }\n\n break;\n }\n\n var numberOfSpecialChars = (part.match(specialCharsRegex) || []).length;\n\n if (numberOfSpecialChars >= 2) {\n redactedParts.push(redactString);\n redactedBefore = true;\n continue;\n }\n\n var numberOfDigits = (part.match(digitsRegex) || []).length;\n\n if (numberOfDigits > 3 || part.length > 3 && numberOfDigits / part.length >= 0.3) {\n redactedParts.push(redactString);\n redactedBefore = true;\n continue;\n }\n\n var numberofUpperCase = (part.match(upperCaseRegex) || []).length;\n var numberofLowerCase = (part.match(lowerCaseRegex) || []).length;\n var lowerCaseRate = numberofLowerCase / part.length;\n var upperCaseRate = numberofUpperCase / part.length;\n\n if (part.length > 5 && (upperCaseRate > 0.3 && upperCaseRate < 0.6 || lowerCaseRate > 0.3 && lowerCaseRate < 0.6)) {\n redactedParts.push(redactString);\n redactedBefore = true;\n continue;\n }\n\n part && redactedParts.push(part);\n }\n\n var redacted = '/' + (redactedParts.length >= 2 ? redactedParts.join('/') : redactedParts.join('')) + (query ? '?{query}' : '');\n return redacted;\n}","var SCHEDULE = 'schedule';\nvar INVOKE = 'invoke';\nvar ADD_EVENT_LISTENER_STR = 'addEventListener';\nvar REMOVE_EVENT_LISTENER_STR = 'removeEventListener';\nvar RESOURCE_INITIATOR_TYPES = ['link', 'css', 'script', 'img', 'xmlhttprequest', 'fetch', 'beacon', 'iframe'];\nvar REUSABILITY_THRESHOLD = 5000;\nvar MAX_SPAN_DURATION = 5 * 60 * 1000;\nvar PAGE_LOAD_DELAY = 1000;\nvar PAGE_LOAD = 'page-load';\nvar ROUTE_CHANGE = 'route-change';\nvar TYPE_CUSTOM = 'custom';\nvar USER_INTERACTION = 'user-interaction';\nvar HTTP_REQUEST_TYPE = 'http-request';\nvar TEMPORARY_TYPE = 'temporary';\nvar NAME_UNKNOWN = 'Unknown';\nvar TRANSACTION_TYPE_ORDER = [PAGE_LOAD, ROUTE_CHANGE, USER_INTERACTION, HTTP_REQUEST_TYPE, TYPE_CUSTOM, TEMPORARY_TYPE];\nvar OUTCOME_SUCCESS = 'success';\nvar OUTCOME_FAILURE = 'failure';\nvar OUTCOME_UNKNOWN = 'unknown';\nvar USER_TIMING_THRESHOLD = 60;\nvar TRANSACTION_START = 'transaction:start';\nvar TRANSACTION_END = 'transaction:end';\nvar CONFIG_CHANGE = 'config:change';\nvar QUEUE_FLUSH = 'queue:flush';\nvar QUEUE_ADD_TRANSACTION = 'queue:add_transaction';\nvar XMLHTTPREQUEST = 'xmlhttprequest';\nvar FETCH = 'fetch';\nvar HISTORY = 'history';\nvar EVENT_TARGET = 'eventtarget';\nvar CLICK = 'click';\nvar ERROR = 'error';\nvar BEFORE_EVENT = ':before';\nvar AFTER_EVENT = ':after';\nvar LOCAL_CONFIG_KEY = 'elastic_apm_config';\nvar LONG_TASK = 'longtask';\nvar PAINT = 'paint';\nvar MEASURE = 'measure';\nvar NAVIGATION = 'navigation';\nvar RESOURCE = 'resource';\nvar FIRST_CONTENTFUL_PAINT = 'first-contentful-paint';\nvar LARGEST_CONTENTFUL_PAINT = 'largest-contentful-paint';\nvar FIRST_INPUT = 'first-input';\nvar LAYOUT_SHIFT = 'layout-shift';\nvar ERRORS = 'errors';\nvar TRANSACTIONS = 'transactions';\nvar CONFIG_SERVICE = 'ConfigService';\nvar LOGGING_SERVICE = 'LoggingService';\nvar TRANSACTION_SERVICE = 'TransactionService';\nvar APM_SERVER = 'ApmServer';\nvar PERFORMANCE_MONITORING = 'PerformanceMonitoring';\nvar ERROR_LOGGING = 'ErrorLogging';\nvar TRUNCATED_TYPE = '.truncated';\nvar KEYWORD_LIMIT = 1024;\nvar SESSION_TIMEOUT = 30 * 60000;\nvar HTTP_REQUEST_TIMEOUT = 10000;\nexport { SCHEDULE, INVOKE, ADD_EVENT_LISTENER_STR, REMOVE_EVENT_LISTENER_STR, RESOURCE_INITIATOR_TYPES, REUSABILITY_THRESHOLD, MAX_SPAN_DURATION, PAGE_LOAD_DELAY, PAGE_LOAD, ROUTE_CHANGE, NAME_UNKNOWN, TYPE_CUSTOM, USER_TIMING_THRESHOLD, TRANSACTION_START, TRANSACTION_END, CONFIG_CHANGE, QUEUE_FLUSH, QUEUE_ADD_TRANSACTION, XMLHTTPREQUEST, FETCH, HISTORY, EVENT_TARGET, CLICK, ERROR, BEFORE_EVENT, AFTER_EVENT, LOCAL_CONFIG_KEY, HTTP_REQUEST_TYPE, LONG_TASK, PAINT, MEASURE, NAVIGATION, RESOURCE, FIRST_CONTENTFUL_PAINT, LARGEST_CONTENTFUL_PAINT, KEYWORD_LIMIT, TEMPORARY_TYPE, USER_INTERACTION, TRANSACTION_TYPE_ORDER, ERRORS, TRANSACTIONS, CONFIG_SERVICE, LOGGING_SERVICE, TRANSACTION_SERVICE, APM_SERVER, PERFORMANCE_MONITORING, ERROR_LOGGING, TRUNCATED_TYPE, FIRST_INPUT, LAYOUT_SHIFT, OUTCOME_SUCCESS, OUTCOME_FAILURE, OUTCOME_UNKNOWN, SESSION_TIMEOUT, HTTP_REQUEST_TIMEOUT };","var _excluded = [\"tags\"];\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { Url } from './url';\nimport { PAGE_LOAD, NAVIGATION } from './constants';\nimport { getServerTimingInfo, PERF, isPerfTimelineSupported } from './utils';\nvar LEFT_SQUARE_BRACKET = 91;\nvar RIGHT_SQUARE_BRACKET = 93;\nvar EXTERNAL = 'external';\nvar RESOURCE = 'resource';\nvar HARD_NAVIGATION = 'hard-navigation';\n\nfunction getPortNumber(port, protocol) {\n if (port === '') {\n port = protocol === 'http:' ? '80' : protocol === 'https:' ? '443' : '';\n }\n\n return port;\n}\n\nfunction getResponseContext(perfTimingEntry) {\n var transferSize = perfTimingEntry.transferSize,\n encodedBodySize = perfTimingEntry.encodedBodySize,\n decodedBodySize = perfTimingEntry.decodedBodySize,\n serverTiming = perfTimingEntry.serverTiming;\n var respContext = {\n transfer_size: transferSize,\n encoded_body_size: encodedBodySize,\n decoded_body_size: decodedBodySize\n };\n var serverTimingStr = getServerTimingInfo(serverTiming);\n\n if (serverTimingStr) {\n respContext.headers = {\n 'server-timing': serverTimingStr\n };\n }\n\n return respContext;\n}\n\nfunction getDestination(parsedUrl) {\n var port = parsedUrl.port,\n protocol = parsedUrl.protocol,\n hostname = parsedUrl.hostname;\n var portNumber = getPortNumber(port, protocol);\n var ipv6Hostname = hostname.charCodeAt(0) === LEFT_SQUARE_BRACKET && hostname.charCodeAt(hostname.length - 1) === RIGHT_SQUARE_BRACKET;\n var address = hostname;\n\n if (ipv6Hostname) {\n address = hostname.slice(1, -1);\n }\n\n return {\n service: {\n resource: hostname + ':' + portNumber,\n name: '',\n type: ''\n },\n address: address,\n port: Number(portNumber)\n };\n}\n\nfunction getResourceContext(data) {\n var entry = data.entry,\n url = data.url;\n var parsedUrl = new Url(url);\n var destination = getDestination(parsedUrl);\n return {\n http: {\n url: url,\n response: getResponseContext(entry)\n },\n destination: destination\n };\n}\n\nfunction getExternalContext(data) {\n var url = data.url,\n method = data.method,\n target = data.target,\n response = data.response;\n var parsedUrl = new Url(url);\n var destination = getDestination(parsedUrl);\n var context = {\n http: {\n method: method,\n url: parsedUrl.href\n },\n destination: destination\n };\n var statusCode;\n\n if (target && typeof target.status !== 'undefined') {\n statusCode = target.status;\n } else if (response) {\n statusCode = response.status;\n }\n\n context.http.status_code = statusCode;\n return context;\n}\n\nfunction getNavigationContext(data) {\n var url = data.url;\n var parsedUrl = new Url(url);\n var destination = getDestination(parsedUrl);\n return {\n destination: destination\n };\n}\n\nexport function getPageContext() {\n return {\n page: {\n referer: document.referrer,\n url: location.href\n }\n };\n}\nexport function addSpanContext(span, data) {\n if (!data) {\n return;\n }\n\n var type = span.type;\n var context;\n\n switch (type) {\n case EXTERNAL:\n context = getExternalContext(data);\n break;\n\n case RESOURCE:\n context = getResourceContext(data);\n break;\n\n case HARD_NAVIGATION:\n context = getNavigationContext(data);\n break;\n }\n\n span.addContext(context);\n}\nexport function addTransactionContext(transaction, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n tags = _ref.tags,\n configContext = _objectWithoutPropertiesLoose(_ref, _excluded);\n\n var pageContext = getPageContext();\n var responseContext = {};\n\n if (transaction.type === PAGE_LOAD && isPerfTimelineSupported()) {\n var entries = PERF.getEntriesByType(NAVIGATION);\n\n if (entries && entries.length > 0) {\n responseContext = {\n response: getResponseContext(entries[0])\n };\n }\n }\n\n transaction.addContext(pageContext, responseContext, configContext);\n}","import { KEYWORD_LIMIT } from './constants';\nvar METADATA_MODEL = {\n service: {\n name: [KEYWORD_LIMIT, true],\n version: true,\n agent: {\n version: [KEYWORD_LIMIT, true]\n },\n environment: true\n },\n labels: {\n '*': true\n }\n};\nvar RESPONSE_MODEL = {\n '*': true,\n headers: {\n '*': true\n }\n};\nvar DESTINATION_MODEL = {\n address: [KEYWORD_LIMIT],\n service: {\n '*': [KEYWORD_LIMIT, true]\n }\n};\nvar CONTEXT_MODEL = {\n user: {\n id: true,\n email: true,\n username: true\n },\n tags: {\n '*': true\n },\n http: {\n response: RESPONSE_MODEL\n },\n destination: DESTINATION_MODEL,\n response: RESPONSE_MODEL\n};\nvar SPAN_MODEL = {\n name: [KEYWORD_LIMIT, true],\n type: [KEYWORD_LIMIT, true],\n id: [KEYWORD_LIMIT, true],\n trace_id: [KEYWORD_LIMIT, true],\n parent_id: [KEYWORD_LIMIT, true],\n transaction_id: [KEYWORD_LIMIT, true],\n subtype: true,\n action: true,\n context: CONTEXT_MODEL\n};\nvar TRANSACTION_MODEL = {\n name: true,\n parent_id: true,\n type: [KEYWORD_LIMIT, true],\n id: [KEYWORD_LIMIT, true],\n trace_id: [KEYWORD_LIMIT, true],\n span_count: {\n started: [KEYWORD_LIMIT, true]\n },\n context: CONTEXT_MODEL\n};\nvar ERROR_MODEL = {\n id: [KEYWORD_LIMIT, true],\n trace_id: true,\n transaction_id: true,\n parent_id: true,\n culprit: true,\n exception: {\n type: true\n },\n transaction: {\n type: true\n },\n context: CONTEXT_MODEL\n};\n\nfunction truncate(value, limit, required, placeholder) {\n if (limit === void 0) {\n limit = KEYWORD_LIMIT;\n }\n\n if (required === void 0) {\n required = false;\n }\n\n if (placeholder === void 0) {\n placeholder = 'N/A';\n }\n\n if (required && isEmpty(value)) {\n value = placeholder;\n }\n\n if (typeof value === 'string') {\n return value.substring(0, limit);\n }\n\n return value;\n}\n\nfunction isEmpty(value) {\n return value == null || value === '' || typeof value === 'undefined';\n}\n\nfunction replaceValue(target, key, currModel) {\n var value = truncate(target[key], currModel[0], currModel[1]);\n\n if (isEmpty(value)) {\n delete target[key];\n return;\n }\n\n target[key] = value;\n}\n\nfunction truncateModel(model, target, childTarget) {\n if (model === void 0) {\n model = {};\n }\n\n if (childTarget === void 0) {\n childTarget = target;\n }\n\n var keys = Object.keys(model);\n var emptyArr = [];\n\n var _loop = function _loop(i) {\n var currKey = keys[i];\n var currModel = model[currKey] === true ? emptyArr : model[currKey];\n\n if (!Array.isArray(currModel)) {\n truncateModel(currModel, target, childTarget[currKey]);\n } else {\n if (currKey === '*') {\n Object.keys(childTarget).forEach(function (key) {\n return replaceValue(childTarget, key, currModel);\n });\n } else {\n replaceValue(childTarget, currKey, currModel);\n }\n }\n };\n\n for (var i = 0; i < keys.length; i++) {\n _loop(i);\n }\n\n return target;\n}\n\nexport { truncate, truncateModel, SPAN_MODEL, TRANSACTION_MODEL, ERROR_MODEL, METADATA_MODEL, RESPONSE_MODEL };","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n function _indexOf(array, target) {\n if (typeof Array.prototype.indexOf === 'function') {\n return array.indexOf(target);\n } else {\n for (var i = 0; i < array.length; i++) {\n if (array[i] === target) {\n return i;\n }\n }\n return -1;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var regExp = /(.+?)(?:\\:(\\d+))?(?:\\:(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[\\(\\)]/g, ''));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function(line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function(line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = _indexOf(['eval', ''], locationParts[0]) > -1 ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function(line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function(line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join('@') || undefined;\n return new StackFrame(functionName,\n undefined,\n locationParts[0],\n locationParts[1],\n locationParts[2],\n line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(\n new StackFrame(\n match[3] || undefined,\n undefined,\n match[2],\n match[1],\n undefined,\n lines[i]\n )\n );\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function(line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function(line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?\n undefined : argsRaw.split(',');\n return new StackFrame(\n functionName,\n args,\n locationParts[0],\n locationParts[1],\n locationParts[2],\n line);\n }, this);\n }\n };\n}));\n\n","var _excluded = [\"tags\"];\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { createStackTraces, filterInvalidFrames } from './stack-trace';\nimport { generateRandomId, merge, extend } from '../common/utils';\nimport { getPageContext } from '../common/context';\nimport { truncateModel, ERROR_MODEL } from '../common/truncate';\nimport stackParser from 'error-stack-parser';\nvar IGNORE_KEYS = ['stack', 'message'];\n\nfunction getErrorProperties(error) {\n var propertyFound = false;\n var properties = {};\n Object.keys(error).forEach(function (key) {\n if (IGNORE_KEYS.indexOf(key) >= 0) {\n return;\n }\n\n var val = error[key];\n\n if (val == null || typeof val === 'function') {\n return;\n }\n\n if (typeof val === 'object') {\n if (typeof val.toISOString !== 'function') return;\n val = val.toISOString();\n }\n\n properties[key] = val;\n propertyFound = true;\n });\n\n if (propertyFound) {\n return properties;\n }\n}\n\nvar ErrorLogging = function () {\n function ErrorLogging(apmServer, configService, transactionService) {\n this._apmServer = apmServer;\n this._configService = configService;\n this._transactionService = transactionService;\n }\n\n var _proto = ErrorLogging.prototype;\n\n _proto.createErrorDataModel = function createErrorDataModel(errorEvent) {\n var frames = createStackTraces(stackParser, errorEvent);\n var filteredFrames = filterInvalidFrames(frames);\n var culprit = '(inline script)';\n var lastFrame = filteredFrames[filteredFrames.length - 1];\n\n if (lastFrame && lastFrame.filename) {\n culprit = lastFrame.filename;\n }\n\n var message = errorEvent.message,\n error = errorEvent.error;\n var errorMessage = message;\n var errorType = '';\n var errorContext = {};\n\n if (error && typeof error === 'object') {\n errorMessage = errorMessage || error.message;\n errorType = error.name;\n var customProperties = getErrorProperties(error);\n\n if (customProperties) {\n errorContext.custom = customProperties;\n }\n }\n\n if (!errorType) {\n if (errorMessage && errorMessage.indexOf(':') > -1) {\n errorType = errorMessage.split(':')[0];\n }\n }\n\n var currentTransaction = this._transactionService.getCurrentTransaction();\n\n var transactionContext = currentTransaction ? currentTransaction.context : {};\n\n var _this$_configService$ = this._configService.get('context'),\n tags = _this$_configService$.tags,\n configContext = _objectWithoutPropertiesLoose(_this$_configService$, _excluded);\n\n var pageContext = getPageContext();\n var context = merge({}, pageContext, transactionContext, configContext, errorContext);\n var errorObject = {\n id: generateRandomId(),\n culprit: culprit,\n exception: {\n message: errorMessage,\n stacktrace: filteredFrames,\n type: errorType\n },\n context: context\n };\n\n if (currentTransaction) {\n errorObject = extend(errorObject, {\n trace_id: currentTransaction.traceId,\n parent_id: currentTransaction.id,\n transaction_id: currentTransaction.id,\n transaction: {\n type: currentTransaction.type,\n sampled: currentTransaction.sampled\n }\n });\n }\n\n return truncateModel(ERROR_MODEL, errorObject);\n };\n\n _proto.logErrorEvent = function logErrorEvent(errorEvent) {\n if (typeof errorEvent === 'undefined') {\n return;\n }\n\n var errorObject = this.createErrorDataModel(errorEvent);\n\n if (typeof errorObject.exception.message === 'undefined') {\n return;\n }\n\n this._apmServer.addError(errorObject);\n };\n\n _proto.registerListeners = function registerListeners() {\n var _this = this;\n\n window.addEventListener('error', function (errorEvent) {\n return _this.logErrorEvent(errorEvent);\n });\n window.addEventListener('unhandledrejection', function (promiseRejectionEvent) {\n return _this.logPromiseEvent(promiseRejectionEvent);\n });\n };\n\n _proto.logPromiseEvent = function logPromiseEvent(promiseRejectionEvent) {\n var prefix = 'Unhandled promise rejection: ';\n var reason = promiseRejectionEvent.reason;\n\n if (reason == null) {\n reason = '';\n }\n\n var errorEvent;\n\n if (typeof reason.message === 'string') {\n var name = reason.name ? reason.name + ': ' : '';\n errorEvent = {\n error: reason,\n message: prefix + name + reason.message\n };\n } else {\n reason = typeof reason === 'object' ? '' : typeof reason === 'function' ? '' : reason;\n errorEvent = {\n message: prefix + reason\n };\n }\n\n this.logErrorEvent(errorEvent);\n };\n\n _proto.logError = function logError(messageOrError) {\n var errorEvent = {};\n\n if (typeof messageOrError === 'string') {\n errorEvent.message = messageOrError;\n } else {\n errorEvent.error = messageOrError;\n }\n\n return this.logErrorEvent(errorEvent);\n };\n\n return ErrorLogging;\n}();\n\nexport default ErrorLogging;","var Queue = function () {\n function Queue(onFlush, opts) {\n if (opts === void 0) {\n opts = {};\n }\n\n this.onFlush = onFlush;\n this.items = [];\n this.queueLimit = opts.queueLimit || -1;\n this.flushInterval = opts.flushInterval || 0;\n this.timeoutId = undefined;\n }\n\n var _proto = Queue.prototype;\n\n _proto._setTimer = function _setTimer() {\n var _this = this;\n\n this.timeoutId = setTimeout(function () {\n return _this.flush();\n }, this.flushInterval);\n };\n\n _proto._clear = function _clear() {\n if (typeof this.timeoutId !== 'undefined') {\n clearTimeout(this.timeoutId);\n this.timeoutId = undefined;\n }\n\n this.items = [];\n };\n\n _proto.flush = function flush() {\n this.onFlush(this.items);\n\n this._clear();\n };\n\n _proto.add = function add(item) {\n this.items.push(item);\n\n if (this.queueLimit !== -1 && this.items.length >= this.queueLimit) {\n this.flush();\n } else {\n if (typeof this.timeoutId === 'undefined') {\n this._setTimer();\n }\n }\n };\n\n return Queue;\n}();\n\nexport default Queue;","export default function throttle(fn, onThrottle, opts) {\n var context = this;\n var limit = opts.limit;\n var interval = opts.interval;\n var counter = 0;\n var timeoutId;\n return function () {\n counter++;\n\n if (typeof timeoutId === 'undefined') {\n timeoutId = setTimeout(function () {\n counter = 0;\n timeoutId = undefined;\n }, interval);\n }\n\n if (counter > limit && typeof onThrottle === 'function') {\n return onThrottle.apply(context, arguments);\n } else {\n return fn.apply(context, arguments);\n }\n };\n}","var NDJSON = function () {\n function NDJSON() {}\n\n NDJSON.stringify = function stringify(object) {\n return JSON.stringify(object) + '\\n';\n };\n\n return NDJSON;\n}();\n\nexport default NDJSON;","import { generateRandomId, setLabel, merge, getDuration, getTime } from '../common/utils';\nimport { NAME_UNKNOWN, TYPE_CUSTOM } from '../common/constants';\n\nvar SpanBase = function () {\n function SpanBase(name, type, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (!name) {\n name = NAME_UNKNOWN;\n }\n\n if (!type) {\n type = TYPE_CUSTOM;\n }\n\n this.name = name;\n this.type = type;\n this.options = options;\n this.id = options.id || generateRandomId(16);\n this.traceId = options.traceId;\n this.sampled = options.sampled;\n this.sampleRate = options.sampleRate;\n this.timestamp = options.timestamp;\n this._start = getTime(options.startTime);\n this._end = undefined;\n this.ended = false;\n this.outcome = undefined;\n this.onEnd = options.onEnd;\n }\n\n var _proto = SpanBase.prototype;\n\n _proto.ensureContext = function ensureContext() {\n if (!this.context) {\n this.context = {};\n }\n };\n\n _proto.addLabels = function addLabels(tags) {\n this.ensureContext();\n var ctx = this.context;\n\n if (!ctx.tags) {\n ctx.tags = {};\n }\n\n var keys = Object.keys(tags);\n keys.forEach(function (k) {\n return setLabel(k, tags[k], ctx.tags);\n });\n };\n\n _proto.addContext = function addContext() {\n for (var _len = arguments.length, context = new Array(_len), _key = 0; _key < _len; _key++) {\n context[_key] = arguments[_key];\n }\n\n if (context.length === 0) return;\n this.ensureContext();\n merge.apply(void 0, [this.context].concat(context));\n };\n\n _proto.end = function end(endTime) {\n if (this.ended) {\n return;\n }\n\n this.ended = true;\n this._end = getTime(endTime);\n this.callOnEnd();\n };\n\n _proto.callOnEnd = function callOnEnd() {\n if (typeof this.onEnd === 'function') {\n this.onEnd(this);\n }\n };\n\n _proto.duration = function duration() {\n return getDuration(this._start, this._end);\n };\n\n return SpanBase;\n}();\n\nexport default SpanBase;","function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport SpanBase from './span-base';\nimport { addSpanContext } from '../common/context';\n\nvar Span = function (_SpanBase) {\n _inheritsLoose(Span, _SpanBase);\n\n function Span(name, type, options) {\n var _this;\n\n _this = _SpanBase.call(this, name, type, options) || this;\n _this.parentId = _this.options.parentId;\n _this.subtype = undefined;\n _this.action = undefined;\n\n if (_this.type.indexOf('.') !== -1) {\n var fields = _this.type.split('.', 3);\n\n _this.type = fields[0];\n _this.subtype = fields[1];\n _this.action = fields[2];\n }\n\n _this.sync = _this.options.sync;\n return _this;\n }\n\n var _proto = Span.prototype;\n\n _proto.end = function end(endTime, data) {\n _SpanBase.prototype.end.call(this, endTime);\n\n addSpanContext(this, data);\n };\n\n return Span;\n}(SpanBase);\n\nexport default Span;","var __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar state = {\n bootstrapTime: null,\n lastHiddenStart: Number.MIN_SAFE_INTEGER\n};\nexport { __DEV__, state };","import Span from './span';\nimport { RESOURCE_INITIATOR_TYPES, MAX_SPAN_DURATION, USER_TIMING_THRESHOLD, PAGE_LOAD, RESOURCE, MEASURE } from '../common/constants';\nimport { stripQueryStringFromUrl, PERF, isPerfTimelineSupported } from '../common/utils';\nimport { state } from '../state';\nvar eventPairs = [['domainLookupStart', 'domainLookupEnd', 'Domain lookup'], ['connectStart', 'connectEnd', 'Making a connection to the server'], ['requestStart', 'responseEnd', 'Requesting and receiving the document'], ['domLoading', 'domInteractive', 'Parsing the document, executing sync. scripts'], ['domContentLoadedEventStart', 'domContentLoadedEventEnd', 'Fire \"DOMContentLoaded\" event'], ['loadEventStart', 'loadEventEnd', 'Fire \"load\" event']];\n\nfunction shouldCreateSpan(start, end, trStart, trEnd, baseTime) {\n if (baseTime === void 0) {\n baseTime = 0;\n }\n\n return typeof start === 'number' && typeof end === 'number' && start >= baseTime && end > start && start - baseTime >= trStart && end - baseTime <= trEnd && end - start < MAX_SPAN_DURATION && start - baseTime < MAX_SPAN_DURATION && end - baseTime < MAX_SPAN_DURATION;\n}\n\nfunction createNavigationTimingSpans(timings, baseTime, trStart, trEnd) {\n var spans = [];\n\n for (var i = 0; i < eventPairs.length; i++) {\n var start = timings[eventPairs[i][0]];\n var end = timings[eventPairs[i][1]];\n\n if (!shouldCreateSpan(start, end, trStart, trEnd, baseTime)) {\n continue;\n }\n\n var span = new Span(eventPairs[i][2], 'hard-navigation.browser-timing');\n var data = null;\n\n if (eventPairs[i][0] === 'requestStart') {\n span.pageResponse = true;\n data = {\n url: location.origin\n };\n }\n\n span._start = start - baseTime;\n span.end(end - baseTime, data);\n spans.push(span);\n }\n\n return spans;\n}\n\nfunction createResourceTimingSpan(resourceTimingEntry) {\n var name = resourceTimingEntry.name,\n initiatorType = resourceTimingEntry.initiatorType,\n startTime = resourceTimingEntry.startTime,\n responseEnd = resourceTimingEntry.responseEnd;\n var kind = 'resource';\n\n if (initiatorType) {\n kind += '.' + initiatorType;\n }\n\n var spanName = stripQueryStringFromUrl(name);\n var span = new Span(spanName, kind);\n span._start = startTime;\n span.end(responseEnd, {\n url: name,\n entry: resourceTimingEntry\n });\n return span;\n}\n\nfunction isCapturedByPatching(resourceStartTime, requestPatchTime) {\n return requestPatchTime != null && resourceStartTime > requestPatchTime;\n}\n\nfunction isIntakeAPIEndpoint(url) {\n return /intake\\/v\\d+\\/rum\\/events/.test(url);\n}\n\nfunction createResourceTimingSpans(entries, requestPatchTime, trStart, trEnd) {\n var spans = [];\n\n for (var i = 0; i < entries.length; i++) {\n var _entries$i = entries[i],\n initiatorType = _entries$i.initiatorType,\n name = _entries$i.name,\n startTime = _entries$i.startTime,\n responseEnd = _entries$i.responseEnd;\n\n if (RESOURCE_INITIATOR_TYPES.indexOf(initiatorType) === -1 || name == null) {\n continue;\n }\n\n if ((initiatorType === 'xmlhttprequest' || initiatorType === 'fetch') && (isIntakeAPIEndpoint(name) || isCapturedByPatching(startTime, requestPatchTime))) {\n continue;\n }\n\n if (shouldCreateSpan(startTime, responseEnd, trStart, trEnd)) {\n spans.push(createResourceTimingSpan(entries[i]));\n }\n }\n\n return spans;\n}\n\nfunction createUserTimingSpans(entries, trStart, trEnd) {\n var userTimingSpans = [];\n\n for (var i = 0; i < entries.length; i++) {\n var _entries$i2 = entries[i],\n name = _entries$i2.name,\n startTime = _entries$i2.startTime,\n duration = _entries$i2.duration;\n var end = startTime + duration;\n\n if (duration <= USER_TIMING_THRESHOLD || !shouldCreateSpan(startTime, end, trStart, trEnd)) {\n continue;\n }\n\n var kind = 'app';\n var span = new Span(name, kind);\n span._start = startTime;\n span.end(end);\n userTimingSpans.push(span);\n }\n\n return userTimingSpans;\n}\n\nvar NAVIGATION_TIMING_MARKS = ['fetchStart', 'domainLookupStart', 'domainLookupEnd', 'connectStart', 'connectEnd', 'requestStart', 'responseStart', 'responseEnd', 'domLoading', 'domInteractive', 'domContentLoadedEventStart', 'domContentLoadedEventEnd', 'domComplete', 'loadEventStart', 'loadEventEnd'];\nvar COMPRESSED_NAV_TIMING_MARKS = ['fs', 'ls', 'le', 'cs', 'ce', 'qs', 'rs', 're', 'dl', 'di', 'ds', 'de', 'dc', 'es', 'ee'];\n\nfunction getNavigationTimingMarks(timing) {\n var fetchStart = timing.fetchStart,\n navigationStart = timing.navigationStart,\n responseStart = timing.responseStart,\n responseEnd = timing.responseEnd;\n\n if (fetchStart >= navigationStart && responseStart >= fetchStart && responseEnd >= responseStart) {\n var marks = {};\n NAVIGATION_TIMING_MARKS.forEach(function (timingKey) {\n var m = timing[timingKey];\n\n if (m && m >= fetchStart) {\n marks[timingKey] = parseInt(m - fetchStart);\n }\n });\n return marks;\n }\n\n return null;\n}\n\nfunction getPageLoadMarks(timing) {\n var marks = getNavigationTimingMarks(timing);\n\n if (marks == null) {\n return null;\n }\n\n return {\n navigationTiming: marks,\n agent: {\n timeToFirstByte: marks.responseStart,\n domInteractive: marks.domInteractive,\n domComplete: marks.domComplete\n }\n };\n}\n\nfunction captureNavigation(transaction) {\n if (!transaction.captureTimings) {\n return;\n }\n\n var trEnd = transaction._end;\n\n if (transaction.type === PAGE_LOAD) {\n if (transaction.marks && transaction.marks.custom) {\n var customMarks = transaction.marks.custom;\n Object.keys(customMarks).forEach(function (key) {\n customMarks[key] += transaction._start;\n });\n }\n\n var trStart = 0;\n transaction._start = trStart;\n var timings = PERF.timing;\n createNavigationTimingSpans(timings, timings.fetchStart, trStart, trEnd).forEach(function (span) {\n span.traceId = transaction.traceId;\n span.sampled = transaction.sampled;\n\n if (span.pageResponse && transaction.options.pageLoadSpanId) {\n span.id = transaction.options.pageLoadSpanId;\n }\n\n transaction.spans.push(span);\n });\n transaction.addMarks(getPageLoadMarks(timings));\n }\n\n if (isPerfTimelineSupported()) {\n var _trStart = transaction._start;\n var resourceEntries = PERF.getEntriesByType(RESOURCE);\n createResourceTimingSpans(resourceEntries, state.bootstrapTime, _trStart, trEnd).forEach(function (span) {\n return transaction.spans.push(span);\n });\n var userEntries = PERF.getEntriesByType(MEASURE);\n createUserTimingSpans(userEntries, _trStart, trEnd).forEach(function (span) {\n return transaction.spans.push(span);\n });\n }\n}\n\nexport { getPageLoadMarks, captureNavigation, createNavigationTimingSpans, createResourceTimingSpans, createUserTimingSpans, NAVIGATION_TIMING_MARKS, COMPRESSED_NAV_TIMING_MARKS };","import { Promise } from './polyfills';\nimport { NAVIGATION_TIMING_MARKS, COMPRESSED_NAV_TIMING_MARKS } from '../performance-monitoring/capture-navigation';\nimport { isBeaconInspectionEnabled } from './utils';\n\nfunction compressStackFrames(frames) {\n return frames.map(function (frame) {\n return {\n ap: frame.abs_path,\n f: frame.filename,\n fn: frame.function,\n li: frame.lineno,\n co: frame.colno\n };\n });\n}\n\nfunction compressResponse(response) {\n return {\n ts: response.transfer_size,\n ebs: response.encoded_body_size,\n dbs: response.decoded_body_size\n };\n}\n\nfunction compressHTTP(http) {\n var compressed = {};\n var method = http.method,\n status_code = http.status_code,\n url = http.url,\n response = http.response;\n compressed.url = url;\n\n if (method) {\n compressed.mt = method;\n }\n\n if (status_code) {\n compressed.sc = status_code;\n }\n\n if (response) {\n compressed.r = compressResponse(response);\n }\n\n return compressed;\n}\n\nfunction compressContext(context) {\n if (!context) {\n return null;\n }\n\n var compressed = {};\n var page = context.page,\n http = context.http,\n response = context.response,\n destination = context.destination,\n user = context.user,\n custom = context.custom;\n\n if (page) {\n compressed.p = {\n rf: page.referer,\n url: page.url\n };\n }\n\n if (http) {\n compressed.h = compressHTTP(http);\n }\n\n if (response) {\n compressed.r = compressResponse(response);\n }\n\n if (destination) {\n var service = destination.service;\n compressed.dt = {\n se: {\n n: service.name,\n t: service.type,\n rc: service.resource\n },\n ad: destination.address,\n po: destination.port\n };\n }\n\n if (user) {\n compressed.u = {\n id: user.id,\n un: user.username,\n em: user.email\n };\n }\n\n if (custom) {\n compressed.cu = custom;\n }\n\n return compressed;\n}\n\nfunction compressMarks(marks) {\n if (!marks) {\n return null;\n }\n\n var compressedNtMarks = compressNavigationTimingMarks(marks.navigationTiming);\n var compressed = {\n nt: compressedNtMarks,\n a: compressAgentMarks(compressedNtMarks, marks.agent)\n };\n return compressed;\n}\n\nfunction compressNavigationTimingMarks(ntMarks) {\n if (!ntMarks) {\n return null;\n }\n\n var compressed = {};\n COMPRESSED_NAV_TIMING_MARKS.forEach(function (mark, index) {\n var mapping = NAVIGATION_TIMING_MARKS[index];\n compressed[mark] = ntMarks[mapping];\n });\n return compressed;\n}\n\nfunction compressAgentMarks(compressedNtMarks, agentMarks) {\n var compressed = {};\n\n if (compressedNtMarks) {\n compressed = {\n fb: compressedNtMarks.rs,\n di: compressedNtMarks.di,\n dc: compressedNtMarks.dc\n };\n }\n\n if (agentMarks) {\n var fp = agentMarks.firstContentfulPaint;\n var lp = agentMarks.largestContentfulPaint;\n\n if (fp) {\n compressed.fp = fp;\n }\n\n if (lp) {\n compressed.lp = lp;\n }\n }\n\n if (Object.keys(compressed).length === 0) {\n return null;\n }\n\n return compressed;\n}\n\nexport function compressMetadata(metadata) {\n var service = metadata.service,\n labels = metadata.labels;\n var agent = service.agent,\n language = service.language;\n return {\n se: {\n n: service.name,\n ve: service.version,\n a: {\n n: agent.name,\n ve: agent.version\n },\n la: {\n n: language.name\n },\n en: service.environment\n },\n l: labels\n };\n}\nexport function compressTransaction(transaction) {\n var spans = transaction.spans.map(function (span) {\n var spanData = {\n id: span.id,\n n: span.name,\n t: span.type,\n s: span.start,\n d: span.duration,\n c: compressContext(span.context),\n o: span.outcome,\n sr: span.sample_rate\n };\n\n if (span.parent_id !== transaction.id) {\n spanData.pid = span.parent_id;\n }\n\n if (span.sync === true) {\n spanData.sy = true;\n }\n\n if (span.subtype) {\n spanData.su = span.subtype;\n }\n\n if (span.action) {\n spanData.ac = span.action;\n }\n\n return spanData;\n });\n var tr = {\n id: transaction.id,\n tid: transaction.trace_id,\n n: transaction.name,\n t: transaction.type,\n d: transaction.duration,\n c: compressContext(transaction.context),\n k: compressMarks(transaction.marks),\n me: compressMetricsets(transaction.breakdown),\n y: spans,\n yc: {\n sd: spans.length\n },\n sm: transaction.sampled,\n sr: transaction.sample_rate,\n o: transaction.outcome\n };\n\n if (transaction.experience) {\n var _transaction$experien = transaction.experience,\n cls = _transaction$experien.cls,\n fid = _transaction$experien.fid,\n tbt = _transaction$experien.tbt,\n longtask = _transaction$experien.longtask;\n tr.exp = {\n cls: cls,\n fid: fid,\n tbt: tbt,\n lt: longtask\n };\n }\n\n if (transaction.session) {\n var _transaction$session = transaction.session,\n id = _transaction$session.id,\n sequence = _transaction$session.sequence;\n tr.ses = {\n id: id,\n seq: sequence\n };\n }\n\n return tr;\n}\nexport function compressError(error) {\n var exception = error.exception;\n var compressed = {\n id: error.id,\n cl: error.culprit,\n ex: {\n mg: exception.message,\n st: compressStackFrames(exception.stacktrace),\n t: error.type\n },\n c: compressContext(error.context)\n };\n var transaction = error.transaction;\n\n if (transaction) {\n compressed.tid = error.trace_id;\n compressed.pid = error.parent_id;\n compressed.xid = error.transaction_id;\n compressed.x = {\n t: transaction.type,\n sm: transaction.sampled\n };\n }\n\n return compressed;\n}\nexport function compressMetricsets(breakdowns) {\n return breakdowns.map(function (_ref) {\n var span = _ref.span,\n samples = _ref.samples;\n var isSpan = span != null;\n\n if (isSpan) {\n return {\n y: {\n t: span.type\n },\n sa: {\n ysc: {\n v: samples['span.self_time.count'].value\n },\n yss: {\n v: samples['span.self_time.sum.us'].value\n }\n }\n };\n }\n\n return {\n sa: {\n xdc: {\n v: samples['transaction.duration.count'].value\n },\n xds: {\n v: samples['transaction.duration.sum.us'].value\n },\n xbc: {\n v: samples['transaction.breakdown.count'].value\n }\n }\n };\n });\n}\nexport function compressPayload(params, type) {\n if (type === void 0) {\n type = 'gzip';\n }\n\n var isCompressionStreamSupported = typeof CompressionStream === 'function';\n return new Promise(function (resolve) {\n if (!isCompressionStreamSupported) {\n return resolve(params);\n }\n\n if (isBeaconInspectionEnabled()) {\n return resolve(params);\n }\n\n var payload = params.payload,\n headers = params.headers,\n beforeSend = params.beforeSend;\n var payloadStream = new Blob([payload]).stream();\n var compressedStream = payloadStream.pipeThrough(new CompressionStream(type));\n return new Response(compressedStream).blob().then(function (payload) {\n headers['Content-Encoding'] = type;\n return resolve({\n payload: payload,\n headers: headers,\n beforeSend: beforeSend\n });\n });\n });\n}","export function isResponseSuccessful(status) {\n if (status === 0 || status > 399 && status < 600) {\n return false;\n }\n\n return true;\n}","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport { HTTP_REQUEST_TIMEOUT } from '../constants';\nimport { isResponseSuccessful } from './response-status';\nexport var BYTE_LIMIT = 60 * 1000;\nexport function shouldUseFetchWithKeepAlive(method, payload) {\n if (!isFetchSupported()) {\n return false;\n }\n\n var isKeepAliveSupported = ('keepalive' in new Request(''));\n\n if (!isKeepAliveSupported) {\n return false;\n }\n\n var size = calculateSize(payload);\n return method === 'POST' && size < BYTE_LIMIT;\n}\nexport function sendFetchRequest(method, url, _ref) {\n var _ref$keepalive = _ref.keepalive,\n keepalive = _ref$keepalive === void 0 ? false : _ref$keepalive,\n _ref$timeout = _ref.timeout,\n timeout = _ref$timeout === void 0 ? HTTP_REQUEST_TIMEOUT : _ref$timeout,\n payload = _ref.payload,\n headers = _ref.headers,\n sendCredentials = _ref.sendCredentials;\n var timeoutConfig = {};\n\n if (typeof AbortController === 'function') {\n var controller = new AbortController();\n timeoutConfig.signal = controller.signal;\n setTimeout(function () {\n return controller.abort();\n }, timeout);\n }\n\n var fetchResponse;\n return window.fetch(url, _extends({\n body: payload,\n headers: headers,\n method: method,\n keepalive: keepalive,\n credentials: sendCredentials ? 'include' : 'omit'\n }, timeoutConfig)).then(function (response) {\n fetchResponse = response;\n return fetchResponse.text();\n }).then(function (responseText) {\n var bodyResponse = {\n url: url,\n status: fetchResponse.status,\n responseText: responseText\n };\n\n if (!isResponseSuccessful(fetchResponse.status)) {\n throw bodyResponse;\n }\n\n return bodyResponse;\n });\n}\nexport function isFetchSupported() {\n return typeof window.fetch === 'function' && typeof window.Request === 'function';\n}\n\nfunction calculateSize(payload) {\n if (!payload) {\n return 0;\n }\n\n if (payload instanceof Blob) {\n return payload.size;\n }\n\n return new Blob([payload]).size;\n}","export var globalState = {\n fetchInProgress: false\n};\nexport function apmSymbol(name) {\n return '__apm_symbol__' + name;\n}\n\nfunction isPropertyWritable(propertyDesc) {\n if (!propertyDesc) {\n return true;\n }\n\n if (propertyDesc.writable === false) {\n return false;\n }\n\n return !(typeof propertyDesc.get === 'function' && typeof propertyDesc.set === 'undefined');\n}\n\nfunction attachOriginToPatched(patched, original) {\n patched[apmSymbol('OriginalDelegate')] = original;\n}\n\nexport function patchMethod(target, name, patchFn) {\n var proto = target;\n\n while (proto && !proto.hasOwnProperty(name)) {\n proto = Object.getPrototypeOf(proto);\n }\n\n if (!proto && target[name]) {\n proto = target;\n }\n\n var delegateName = apmSymbol(name);\n var delegate;\n\n if (proto && !(delegate = proto[delegateName])) {\n delegate = proto[delegateName] = proto[name];\n var desc = proto && Object.getOwnPropertyDescriptor(proto, name);\n\n if (isPropertyWritable(desc)) {\n var patchDelegate = patchFn(delegate, delegateName, name);\n\n proto[name] = function () {\n return patchDelegate(this, arguments);\n };\n\n attachOriginToPatched(proto[name], delegate);\n }\n }\n\n return delegate;\n}\nexport var XHR_IGNORE = apmSymbol('xhrIgnore');\nexport var XHR_SYNC = apmSymbol('xhrSync');\nexport var XHR_URL = apmSymbol('xhrURL');\nexport var XHR_METHOD = apmSymbol('xhrMethod');","import { XHR_IGNORE } from '../patching/patch-utils';\nimport { isResponseSuccessful } from './response-status';\nimport { Promise } from '../polyfills';\nexport function sendXHR(method, url, _ref) {\n var _ref$timeout = _ref.timeout,\n timeout = _ref$timeout === void 0 ? HTTP_REQUEST_TIMEOUT : _ref$timeout,\n payload = _ref.payload,\n headers = _ref.headers,\n beforeSend = _ref.beforeSend,\n sendCredentials = _ref.sendCredentials;\n return new Promise(function (resolve, reject) {\n var xhr = new window.XMLHttpRequest();\n xhr[XHR_IGNORE] = true;\n xhr.open(method, url, true);\n xhr.timeout = timeout;\n xhr.withCredentials = sendCredentials;\n\n if (headers) {\n for (var header in headers) {\n if (headers.hasOwnProperty(header)) {\n xhr.setRequestHeader(header, headers[header]);\n }\n }\n }\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n var status = xhr.status,\n responseText = xhr.responseText;\n\n if (isResponseSuccessful(status)) {\n resolve(xhr);\n } else {\n reject({\n url: url,\n status: status,\n responseText: responseText\n });\n }\n }\n };\n\n xhr.onerror = function () {\n var status = xhr.status,\n responseText = xhr.responseText;\n reject({\n url: url,\n status: status,\n responseText: responseText\n });\n };\n\n var canSend = true;\n\n if (typeof beforeSend === 'function') {\n canSend = beforeSend({\n url: url,\n method: method,\n headers: headers,\n payload: payload,\n xhr: xhr\n });\n }\n\n if (canSend) {\n xhr.send(payload);\n } else {\n reject({\n url: url,\n status: 0,\n responseText: 'Request rejected by user configuration.'\n });\n }\n });\n}","import Queue from './queue';\nimport throttle from './throttle';\nimport NDJSON from './ndjson';\nimport { truncateModel, METADATA_MODEL } from './truncate';\nimport { ERRORS, HTTP_REQUEST_TIMEOUT, QUEUE_FLUSH, TRANSACTIONS } from './constants';\nimport { noop } from './utils';\nimport { Promise } from './polyfills';\nimport { compressMetadata, compressTransaction, compressError, compressPayload } from './compress';\nimport { __DEV__ } from '../state';\nimport { sendFetchRequest, shouldUseFetchWithKeepAlive } from './http/fetch';\nimport { sendXHR } from './http/xhr';\nvar THROTTLE_INTERVAL = 60000;\n\nvar ApmServer = function () {\n function ApmServer(configService, loggingService) {\n this._configService = configService;\n this._loggingService = loggingService;\n this.queue = undefined;\n this.throttleEvents = noop;\n }\n\n var _proto = ApmServer.prototype;\n\n _proto.init = function init() {\n var _this = this;\n\n var queueLimit = this._configService.get('queueLimit');\n\n var flushInterval = this._configService.get('flushInterval');\n\n var limit = this._configService.get('eventsLimit');\n\n var onFlush = function onFlush(events) {\n var promise = _this.sendEvents(events);\n\n if (promise) {\n promise.catch(function (reason) {\n _this._loggingService.warn('Failed sending events!', _this._constructError(reason));\n });\n }\n };\n\n this.queue = new Queue(onFlush, {\n queueLimit: queueLimit,\n flushInterval: flushInterval\n });\n this.throttleEvents = throttle(this.queue.add.bind(this.queue), function () {\n return _this._loggingService.warn('Dropped events due to throttling!');\n }, {\n limit: limit,\n interval: THROTTLE_INTERVAL\n });\n\n this._configService.observeEvent(QUEUE_FLUSH, function () {\n _this.queue.flush();\n });\n };\n\n _proto._postJson = function _postJson(endPoint, payload) {\n var _this2 = this;\n\n var headers = {\n 'Content-Type': 'application/x-ndjson'\n };\n\n var apmRequest = this._configService.get('apmRequest');\n\n var params = {\n payload: payload,\n headers: headers,\n beforeSend: apmRequest\n };\n return compressPayload(params).catch(function (error) {\n if (__DEV__) {\n _this2._loggingService.debug('Compressing the payload using CompressionStream API failed', error.message);\n }\n\n return params;\n }).then(function (result) {\n return _this2._makeHttpRequest('POST', endPoint, result);\n }).then(function (_ref) {\n var responseText = _ref.responseText;\n return responseText;\n });\n };\n\n _proto._constructError = function _constructError(reason) {\n var url = reason.url,\n status = reason.status,\n responseText = reason.responseText;\n\n if (typeof status == 'undefined') {\n return reason;\n }\n\n var message = url + ' HTTP status: ' + status;\n\n if (__DEV__ && responseText) {\n try {\n var serverErrors = [];\n var response = JSON.parse(responseText);\n\n if (response.errors && response.errors.length > 0) {\n response.errors.forEach(function (err) {\n return serverErrors.push(err.message);\n });\n message += ' ' + serverErrors.join(',');\n }\n } catch (e) {\n this._loggingService.debug('Error parsing response from APM server', e);\n }\n }\n\n return new Error(message);\n };\n\n _proto._makeHttpRequest = function _makeHttpRequest(method, url, _temp) {\n var _ref2 = _temp === void 0 ? {} : _temp,\n _ref2$timeout = _ref2.timeout,\n timeout = _ref2$timeout === void 0 ? HTTP_REQUEST_TIMEOUT : _ref2$timeout,\n payload = _ref2.payload,\n headers = _ref2.headers,\n beforeSend = _ref2.beforeSend;\n\n var sendCredentials = this._configService.get('sendCredentials');\n\n if (!beforeSend && shouldUseFetchWithKeepAlive(method, payload)) {\n return sendFetchRequest(method, url, {\n keepalive: true,\n timeout: timeout,\n payload: payload,\n headers: headers,\n sendCredentials: sendCredentials\n }).catch(function (reason) {\n if (reason instanceof TypeError) {\n return sendXHR(method, url, {\n timeout: timeout,\n payload: payload,\n headers: headers,\n beforeSend: beforeSend,\n sendCredentials: sendCredentials\n });\n }\n\n throw reason;\n });\n }\n\n return sendXHR(method, url, {\n timeout: timeout,\n payload: payload,\n headers: headers,\n beforeSend: beforeSend,\n sendCredentials: sendCredentials\n });\n };\n\n _proto.fetchConfig = function fetchConfig(serviceName, environment) {\n var _this3 = this;\n\n var _this$getEndpoints = this.getEndpoints(),\n configEndpoint = _this$getEndpoints.configEndpoint;\n\n if (!serviceName) {\n return Promise.reject('serviceName is required for fetching central config.');\n }\n\n configEndpoint += \"?service.name=\" + serviceName;\n\n if (environment) {\n configEndpoint += \"&service.environment=\" + environment;\n }\n\n var localConfig = this._configService.getLocalConfig();\n\n if (localConfig) {\n configEndpoint += \"&ifnonematch=\" + localConfig.etag;\n }\n\n var apmRequest = this._configService.get('apmRequest');\n\n return this._makeHttpRequest('GET', configEndpoint, {\n timeout: 5000,\n beforeSend: apmRequest\n }).then(function (xhr) {\n var status = xhr.status,\n responseText = xhr.responseText;\n\n if (status === 304) {\n return localConfig;\n } else {\n var remoteConfig = JSON.parse(responseText);\n var etag = xhr.getResponseHeader('etag');\n\n if (etag) {\n remoteConfig.etag = etag.replace(/[\"]/g, '');\n\n _this3._configService.setLocalConfig(remoteConfig, true);\n }\n\n return remoteConfig;\n }\n }).catch(function (reason) {\n var error = _this3._constructError(reason);\n\n return Promise.reject(error);\n });\n };\n\n _proto.createMetaData = function createMetaData() {\n var cfg = this._configService;\n var metadata = {\n service: {\n name: cfg.get('serviceName'),\n version: cfg.get('serviceVersion'),\n agent: {\n name: 'rum-js',\n version: cfg.version\n },\n language: {\n name: 'javascript'\n },\n environment: cfg.get('environment')\n },\n labels: cfg.get('context.tags')\n };\n return truncateModel(METADATA_MODEL, metadata);\n };\n\n _proto.addError = function addError(error) {\n var _this$throttleEvents;\n\n this.throttleEvents((_this$throttleEvents = {}, _this$throttleEvents[ERRORS] = error, _this$throttleEvents));\n };\n\n _proto.addTransaction = function addTransaction(transaction) {\n var _this$throttleEvents2;\n\n this.throttleEvents((_this$throttleEvents2 = {}, _this$throttleEvents2[TRANSACTIONS] = transaction, _this$throttleEvents2));\n };\n\n _proto.ndjsonErrors = function ndjsonErrors(errors, compress) {\n var key = compress ? 'e' : 'error';\n return errors.map(function (error) {\n var _NDJSON$stringify;\n\n return NDJSON.stringify((_NDJSON$stringify = {}, _NDJSON$stringify[key] = compress ? compressError(error) : error, _NDJSON$stringify));\n });\n };\n\n _proto.ndjsonMetricsets = function ndjsonMetricsets(metricsets) {\n return metricsets.map(function (metricset) {\n return NDJSON.stringify({\n metricset: metricset\n });\n }).join('');\n };\n\n _proto.ndjsonTransactions = function ndjsonTransactions(transactions, compress) {\n var _this4 = this;\n\n var key = compress ? 'x' : 'transaction';\n return transactions.map(function (tr) {\n var _NDJSON$stringify2;\n\n var spans = '',\n breakdowns = '';\n\n if (!compress) {\n if (tr.spans) {\n spans = tr.spans.map(function (span) {\n return NDJSON.stringify({\n span: span\n });\n }).join('');\n delete tr.spans;\n }\n\n if (tr.breakdown) {\n breakdowns = _this4.ndjsonMetricsets(tr.breakdown);\n delete tr.breakdown;\n }\n }\n\n return NDJSON.stringify((_NDJSON$stringify2 = {}, _NDJSON$stringify2[key] = compress ? compressTransaction(tr) : tr, _NDJSON$stringify2)) + spans + breakdowns;\n });\n };\n\n _proto.sendEvents = function sendEvents(events) {\n var _payload, _NDJSON$stringify3;\n\n if (events.length === 0) {\n return;\n }\n\n var transactions = [];\n var errors = [];\n\n for (var i = 0; i < events.length; i++) {\n var event = events[i];\n\n if (event[TRANSACTIONS]) {\n transactions.push(event[TRANSACTIONS]);\n }\n\n if (event[ERRORS]) {\n errors.push(event[ERRORS]);\n }\n }\n\n if (transactions.length === 0 && errors.length === 0) {\n return;\n }\n\n var cfg = this._configService;\n var payload = (_payload = {}, _payload[TRANSACTIONS] = transactions, _payload[ERRORS] = errors, _payload);\n var filteredPayload = cfg.applyFilters(payload);\n\n if (!filteredPayload) {\n this._loggingService.warn('Dropped payload due to filtering!');\n\n return;\n }\n\n var apiVersion = cfg.get('apiVersion');\n var compress = apiVersion > 2;\n var ndjson = [];\n var metadata = this.createMetaData();\n var metadataKey = compress ? 'm' : 'metadata';\n ndjson.push(NDJSON.stringify((_NDJSON$stringify3 = {}, _NDJSON$stringify3[metadataKey] = compress ? compressMetadata(metadata) : metadata, _NDJSON$stringify3)));\n ndjson = ndjson.concat(this.ndjsonErrors(filteredPayload[ERRORS], compress), this.ndjsonTransactions(filteredPayload[TRANSACTIONS], compress));\n var ndjsonPayload = ndjson.join('');\n\n var _this$getEndpoints2 = this.getEndpoints(),\n intakeEndpoint = _this$getEndpoints2.intakeEndpoint;\n\n return this._postJson(intakeEndpoint, ndjsonPayload);\n };\n\n _proto.getEndpoints = function getEndpoints() {\n var serverUrl = this._configService.get('serverUrl');\n\n var apiVersion = this._configService.get('apiVersion');\n\n var serverUrlPrefix = this._configService.get('serverUrlPrefix') || \"/intake/v\" + apiVersion + \"/rum/events\";\n var intakeEndpoint = serverUrl + serverUrlPrefix;\n var configEndpoint = serverUrl + \"/config/v1/rum/agents\";\n return {\n intakeEndpoint: intakeEndpoint,\n configEndpoint: configEndpoint\n };\n };\n\n return ApmServer;\n}();\n\nexport default ApmServer;","import { BEFORE_EVENT, AFTER_EVENT } from './constants';\n\nvar EventHandler = function () {\n function EventHandler() {\n this.observers = {};\n }\n\n var _proto = EventHandler.prototype;\n\n _proto.observe = function observe(name, fn) {\n var _this = this;\n\n if (typeof fn === 'function') {\n if (!this.observers[name]) {\n this.observers[name] = [];\n }\n\n this.observers[name].push(fn);\n return function () {\n var index = _this.observers[name].indexOf(fn);\n\n if (index > -1) {\n _this.observers[name].splice(index, 1);\n }\n };\n }\n };\n\n _proto.sendOnly = function sendOnly(name, args) {\n var obs = this.observers[name];\n\n if (obs) {\n obs.forEach(function (fn) {\n try {\n fn.apply(undefined, args);\n } catch (error) {\n console.log(error, error.stack);\n }\n });\n }\n };\n\n _proto.send = function send(name, args) {\n this.sendOnly(name + BEFORE_EVENT, args);\n this.sendOnly(name, args);\n this.sendOnly(name + AFTER_EVENT, args);\n };\n\n return EventHandler;\n}();\n\nexport default EventHandler;","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport { getCurrentScript, setLabel, merge, extend, isUndefined } from './utils';\nimport EventHandler from './event-handler';\nimport { CONFIG_CHANGE, LOCAL_CONFIG_KEY } from './constants';\n\nfunction getConfigFromScript() {\n var script = getCurrentScript();\n var config = getDataAttributesFromNode(script);\n return config;\n}\n\nfunction getDataAttributesFromNode(node) {\n if (!node) {\n return {};\n }\n\n var dataAttrs = {};\n var dataRegex = /^data-([\\w-]+)$/;\n var attrs = node.attributes;\n\n for (var i = 0; i < attrs.length; i++) {\n var attr = attrs[i];\n\n if (dataRegex.test(attr.nodeName)) {\n var key = attr.nodeName.match(dataRegex)[1];\n var camelCasedkey = key.split('-').map(function (value, index) {\n return index > 0 ? value.charAt(0).toUpperCase() + value.substring(1) : value;\n }).join('');\n dataAttrs[camelCasedkey] = attr.value || attr.nodeValue;\n }\n }\n\n return dataAttrs;\n}\n\nvar Config = function () {\n function Config() {\n this.config = {\n serviceName: '',\n serviceVersion: '',\n environment: '',\n serverUrl: 'http://localhost:8200',\n serverUrlPrefix: '',\n active: true,\n instrument: true,\n disableInstrumentations: [],\n logLevel: 'warn',\n breakdownMetrics: false,\n ignoreTransactions: [],\n eventsLimit: 80,\n queueLimit: -1,\n flushInterval: 500,\n distributedTracing: true,\n distributedTracingOrigins: [],\n distributedTracingHeaderName: 'traceparent',\n pageLoadTraceId: '',\n pageLoadSpanId: '',\n pageLoadSampled: false,\n pageLoadTransactionName: '',\n propagateTracestate: false,\n transactionSampleRate: 1.0,\n centralConfig: false,\n monitorLongtasks: true,\n apiVersion: 2,\n context: {},\n session: false,\n apmRequest: null,\n sendCredentials: false\n };\n this.events = new EventHandler();\n this.filters = [];\n this.version = '';\n }\n\n var _proto = Config.prototype;\n\n _proto.init = function init() {\n var scriptData = getConfigFromScript();\n this.setConfig(scriptData);\n };\n\n _proto.setVersion = function setVersion(version) {\n this.version = version;\n };\n\n _proto.addFilter = function addFilter(cb) {\n if (typeof cb !== 'function') {\n throw new Error('Argument to must be function');\n }\n\n this.filters.push(cb);\n };\n\n _proto.applyFilters = function applyFilters(data) {\n for (var i = 0; i < this.filters.length; i++) {\n data = this.filters[i](data);\n\n if (!data) {\n return;\n }\n }\n\n return data;\n };\n\n _proto.get = function get(key) {\n return key.split('.').reduce(function (obj, objKey) {\n return obj && obj[objKey];\n }, this.config);\n };\n\n _proto.setUserContext = function setUserContext(userContext) {\n if (userContext === void 0) {\n userContext = {};\n }\n\n var context = {};\n var _userContext = userContext,\n id = _userContext.id,\n username = _userContext.username,\n email = _userContext.email;\n\n if (typeof id === 'number' || typeof id === 'string') {\n context.id = id;\n }\n\n if (typeof username === 'string') {\n context.username = username;\n }\n\n if (typeof email === 'string') {\n context.email = email;\n }\n\n this.config.context.user = extend(this.config.context.user || {}, context);\n };\n\n _proto.setCustomContext = function setCustomContext(customContext) {\n if (customContext === void 0) {\n customContext = {};\n }\n\n this.config.context.custom = extend(this.config.context.custom || {}, customContext);\n };\n\n _proto.addLabels = function addLabels(tags) {\n var _this = this;\n\n if (!this.config.context.tags) {\n this.config.context.tags = {};\n }\n\n var keys = Object.keys(tags);\n keys.forEach(function (k) {\n return setLabel(k, tags[k], _this.config.context.tags);\n });\n };\n\n _proto.setConfig = function setConfig(properties) {\n if (properties === void 0) {\n properties = {};\n }\n\n var _properties = properties,\n transactionSampleRate = _properties.transactionSampleRate,\n serverUrl = _properties.serverUrl;\n\n if (serverUrl) {\n properties.serverUrl = serverUrl.replace(/\\/+$/, '');\n }\n\n if (!isUndefined(transactionSampleRate)) {\n if (transactionSampleRate < 0.0001 && transactionSampleRate > 0) {\n transactionSampleRate = 0.0001;\n }\n\n properties.transactionSampleRate = Math.round(transactionSampleRate * 10000) / 10000;\n }\n\n merge(this.config, properties);\n this.events.send(CONFIG_CHANGE, [this.config]);\n };\n\n _proto.validate = function validate(properties) {\n if (properties === void 0) {\n properties = {};\n }\n\n var requiredKeys = ['serviceName', 'serverUrl'];\n var allKeys = Object.keys(this.config);\n var errors = {\n missing: [],\n invalid: [],\n unknown: []\n };\n Object.keys(properties).forEach(function (key) {\n if (requiredKeys.indexOf(key) !== -1 && !properties[key]) {\n errors.missing.push(key);\n }\n\n if (allKeys.indexOf(key) === -1) {\n errors.unknown.push(key);\n }\n });\n\n if (properties.serviceName && !/^[a-zA-Z0-9 _-]+$/.test(properties.serviceName)) {\n errors.invalid.push({\n key: 'serviceName',\n value: properties.serviceName,\n allowed: 'a-z, A-Z, 0-9, _, -, '\n });\n }\n\n var sampleRate = properties.transactionSampleRate;\n\n if (typeof sampleRate !== 'undefined' && (typeof sampleRate !== 'number' || isNaN(sampleRate) || sampleRate < 0 || sampleRate > 1)) {\n errors.invalid.push({\n key: 'transactionSampleRate',\n value: sampleRate,\n allowed: 'Number between 0 and 1'\n });\n }\n\n return errors;\n };\n\n _proto.getLocalConfig = function getLocalConfig() {\n var storage = sessionStorage;\n\n if (this.config.session) {\n storage = localStorage;\n }\n\n var config = storage.getItem(LOCAL_CONFIG_KEY);\n\n if (config) {\n return JSON.parse(config);\n }\n };\n\n _proto.setLocalConfig = function setLocalConfig(config, merge) {\n if (config) {\n if (merge) {\n var prevConfig = this.getLocalConfig();\n config = _extends({}, prevConfig, config);\n }\n\n var storage = sessionStorage;\n\n if (this.config.session) {\n storage = localStorage;\n }\n\n storage.setItem(LOCAL_CONFIG_KEY, JSON.stringify(config));\n }\n };\n\n _proto.dispatchEvent = function dispatchEvent(name, args) {\n this.events.send(name, args);\n };\n\n _proto.observeEvent = function observeEvent(name, fn) {\n return this.events.observe(name, fn);\n };\n\n return Config;\n}();\n\nexport default Config;","import { noop } from './utils';\n\nvar LoggingService = function () {\n function LoggingService(spec) {\n if (spec === void 0) {\n spec = {};\n }\n\n this.levels = ['trace', 'debug', 'info', 'warn', 'error'];\n this.level = spec.level || 'warn';\n this.prefix = spec.prefix || '';\n this.resetLogMethods();\n }\n\n var _proto = LoggingService.prototype;\n\n _proto.shouldLog = function shouldLog(level) {\n return this.levels.indexOf(level) >= this.levels.indexOf(this.level);\n };\n\n _proto.setLevel = function setLevel(level) {\n if (level === this.level) {\n return;\n }\n\n this.level = level;\n this.resetLogMethods();\n };\n\n _proto.resetLogMethods = function resetLogMethods() {\n var _this = this;\n\n this.levels.forEach(function (level) {\n _this[level] = _this.shouldLog(level) ? log : noop;\n\n function log() {\n var normalizedLevel = level;\n\n if (level === 'trace' || level === 'debug') {\n normalizedLevel = 'info';\n }\n\n var args = arguments;\n args[0] = this.prefix + args[0];\n\n if (console) {\n var realMethod = console[normalizedLevel] || console.log;\n\n if (typeof realMethod === 'function') {\n realMethod.apply(console, args);\n }\n }\n }\n });\n };\n\n return LoggingService;\n}();\n\nexport default LoggingService;","var _serviceCreators;\n\nimport ApmServer from './apm-server';\nimport ConfigService from './config-service';\nimport LoggingService from './logging-service';\nimport { CONFIG_CHANGE, CONFIG_SERVICE, LOGGING_SERVICE, APM_SERVER } from './constants';\nimport { __DEV__ } from '../state';\nvar serviceCreators = (_serviceCreators = {}, _serviceCreators[CONFIG_SERVICE] = function () {\n return new ConfigService();\n}, _serviceCreators[LOGGING_SERVICE] = function () {\n return new LoggingService({\n prefix: '[Elastic APM] '\n });\n}, _serviceCreators[APM_SERVER] = function (factory) {\n var _factory$getService = factory.getService([CONFIG_SERVICE, LOGGING_SERVICE]),\n configService = _factory$getService[0],\n loggingService = _factory$getService[1];\n\n return new ApmServer(configService, loggingService);\n}, _serviceCreators);\n\nvar ServiceFactory = function () {\n function ServiceFactory() {\n this.instances = {};\n this.initialized = false;\n }\n\n var _proto = ServiceFactory.prototype;\n\n _proto.init = function init() {\n if (this.initialized) {\n return;\n }\n\n this.initialized = true;\n var configService = this.getService(CONFIG_SERVICE);\n configService.init();\n\n var _this$getService = this.getService([LOGGING_SERVICE, APM_SERVER]),\n loggingService = _this$getService[0],\n apmServer = _this$getService[1];\n\n configService.events.observe(CONFIG_CHANGE, function () {\n var logLevel = configService.get('logLevel');\n loggingService.setLevel(logLevel);\n });\n apmServer.init();\n };\n\n _proto.getService = function getService(name) {\n var _this = this;\n\n if (typeof name === 'string') {\n if (!this.instances[name]) {\n if (typeof serviceCreators[name] === 'function') {\n this.instances[name] = serviceCreators[name](this);\n } else if (__DEV__) {\n console.log('Cannot get service, No creator for: ' + name);\n }\n }\n\n return this.instances[name];\n } else if (Array.isArray(name)) {\n return name.map(function (n) {\n return _this.getService(n);\n });\n }\n };\n\n return ServiceFactory;\n}();\n\nexport { serviceCreators, ServiceFactory };","import ErrorLogging from './error-logging';\nimport { CONFIG_SERVICE, TRANSACTION_SERVICE, ERROR_LOGGING, APM_SERVER } from '../common/constants';\nimport { serviceCreators } from '../common/service-factory';\n\nfunction registerServices() {\n serviceCreators[ERROR_LOGGING] = function (serviceFactory) {\n var _serviceFactory$getSe = serviceFactory.getService([APM_SERVER, CONFIG_SERVICE, TRANSACTION_SERVICE]),\n apmServer = _serviceFactory$getSe[0],\n configService = _serviceFactory$getSe[1],\n transactionService = _serviceFactory$getSe[2];\n\n return new ErrorLogging(apmServer, configService, transactionService);\n };\n}\n\nexport { registerServices };","import { patchMethod, XHR_SYNC, XHR_URL, XHR_METHOD, XHR_IGNORE } from './patch-utils';\nimport { SCHEDULE, INVOKE, XMLHTTPREQUEST, ADD_EVENT_LISTENER_STR } from '../constants';\nexport function patchXMLHttpRequest(callback) {\n var XMLHttpRequestPrototype = XMLHttpRequest.prototype;\n\n if (!XMLHttpRequestPrototype || !XMLHttpRequestPrototype[ADD_EVENT_LISTENER_STR]) {\n return;\n }\n\n var READY_STATE_CHANGE = 'readystatechange';\n var LOAD = 'load';\n var ERROR = 'error';\n var TIMEOUT = 'timeout';\n var ABORT = 'abort';\n\n function invokeTask(task, status) {\n if (task.state !== INVOKE) {\n task.state = INVOKE;\n task.data.status = status;\n callback(INVOKE, task);\n }\n }\n\n function scheduleTask(task) {\n if (task.state === SCHEDULE) {\n return;\n }\n\n task.state = SCHEDULE;\n callback(SCHEDULE, task);\n var target = task.data.target;\n\n function addListener(name) {\n target[ADD_EVENT_LISTENER_STR](name, function (_ref) {\n var type = _ref.type;\n\n if (type === READY_STATE_CHANGE) {\n if (target.readyState === 4 && target.status !== 0) {\n invokeTask(task, 'success');\n }\n } else {\n var status = type === LOAD ? 'success' : type;\n invokeTask(task, status);\n }\n });\n }\n\n addListener(READY_STATE_CHANGE);\n addListener(LOAD);\n addListener(TIMEOUT);\n addListener(ERROR);\n addListener(ABORT);\n }\n\n var openNative = patchMethod(XMLHttpRequestPrototype, 'open', function () {\n return function (self, args) {\n if (!self[XHR_IGNORE]) {\n self[XHR_METHOD] = args[0];\n self[XHR_URL] = args[1];\n self[XHR_SYNC] = args[2] === false;\n }\n\n return openNative.apply(self, args);\n };\n });\n var sendNative = patchMethod(XMLHttpRequestPrototype, 'send', function () {\n return function (self, args) {\n if (self[XHR_IGNORE]) {\n return sendNative.apply(self, args);\n }\n\n var task = {\n source: XMLHTTPREQUEST,\n state: '',\n type: 'macroTask',\n data: {\n target: self,\n method: self[XHR_METHOD],\n sync: self[XHR_SYNC],\n url: self[XHR_URL],\n status: ''\n }\n };\n\n try {\n scheduleTask(task);\n return sendNative.apply(self, args);\n } catch (e) {\n invokeTask(task, ERROR);\n throw e;\n }\n };\n });\n}","import { Promise } from '../polyfills';\nimport { globalState } from './patch-utils';\nimport { SCHEDULE, INVOKE, FETCH } from '../constants';\nimport { scheduleMicroTask } from '../utils';\nimport { isFetchSupported } from '../http/fetch';\nexport function patchFetch(callback) {\n if (!isFetchSupported()) {\n return;\n }\n\n function scheduleTask(task) {\n task.state = SCHEDULE;\n callback(SCHEDULE, task);\n }\n\n function invokeTask(task) {\n task.state = INVOKE;\n callback(INVOKE, task);\n }\n\n function handleResponseError(task, error) {\n task.data.aborted = isAbortError(error);\n task.data.error = error;\n invokeTask(task);\n }\n\n function readStream(stream, task) {\n var reader = stream.getReader();\n\n var read = function read() {\n reader.read().then(function (_ref) {\n var done = _ref.done;\n\n if (done) {\n invokeTask(task);\n } else {\n read();\n }\n }, function (error) {\n handleResponseError(task, error);\n });\n };\n\n read();\n }\n\n var nativeFetch = window.fetch;\n\n window.fetch = function (input, init) {\n var fetchSelf = this;\n var args = arguments;\n var request, url;\n\n if (typeof input === 'string') {\n request = new Request(input, init);\n url = input;\n } else if (input) {\n request = input;\n url = request.url;\n } else {\n return nativeFetch.apply(fetchSelf, args);\n }\n\n var task = {\n source: FETCH,\n state: '',\n type: 'macroTask',\n data: {\n target: request,\n method: request.method,\n url: url,\n aborted: false\n }\n };\n return new Promise(function (resolve, reject) {\n globalState.fetchInProgress = true;\n scheduleTask(task);\n var promise;\n\n try {\n promise = nativeFetch.apply(fetchSelf, [request]);\n } catch (error) {\n reject(error);\n task.data.error = error;\n invokeTask(task);\n globalState.fetchInProgress = false;\n return;\n }\n\n promise.then(function (response) {\n var clonedResponse = response.clone ? response.clone() : {};\n resolve(response);\n scheduleMicroTask(function () {\n task.data.response = response;\n var body = clonedResponse.body;\n\n if (body) {\n readStream(body, task);\n } else {\n invokeTask(task);\n }\n });\n }, function (error) {\n reject(error);\n scheduleMicroTask(function () {\n handleResponseError(task, error);\n });\n });\n globalState.fetchInProgress = false;\n });\n };\n}\n\nfunction isAbortError(error) {\n return error && error.name === 'AbortError';\n}","import { INVOKE, HISTORY } from '../constants';\nexport function patchHistory(callback) {\n if (!window.history) {\n return;\n }\n\n var nativePushState = history.pushState;\n\n if (typeof nativePushState === 'function') {\n history.pushState = function (state, title, url) {\n var task = {\n source: HISTORY,\n data: {\n state: state,\n title: title,\n url: url\n }\n };\n callback(INVOKE, task);\n nativePushState.apply(this, arguments);\n };\n }\n}","import { patchXMLHttpRequest } from './xhr-patch';\nimport { patchFetch } from './fetch-patch';\nimport { patchHistory } from './history-patch';\nimport EventHandler from '../event-handler';\nimport { HISTORY, FETCH, XMLHTTPREQUEST } from '../constants';\nvar patchEventHandler = new EventHandler();\nvar alreadyPatched = false;\n\nfunction patchAll() {\n if (!alreadyPatched) {\n alreadyPatched = true;\n patchXMLHttpRequest(function (event, task) {\n patchEventHandler.send(XMLHTTPREQUEST, [event, task]);\n });\n patchFetch(function (event, task) {\n patchEventHandler.send(FETCH, [event, task]);\n });\n patchHistory(function (event, task) {\n patchEventHandler.send(HISTORY, [event, task]);\n });\n }\n\n return patchEventHandler;\n}\n\nexport { patchAll, patchEventHandler };","import { checkSameOrigin, isDtHeaderValid, parseDtHeaderValue, getDtHeaderValue, getTSHeaderValue, stripQueryStringFromUrl, setRequestHeader } from '../common/utils';\nimport { Url } from '../common/url';\nimport { patchEventHandler } from '../common/patching';\nimport { globalState } from '../common/patching/patch-utils';\nimport { SCHEDULE, INVOKE, TRANSACTION_END, AFTER_EVENT, FETCH, HISTORY, XMLHTTPREQUEST, HTTP_REQUEST_TYPE, OUTCOME_FAILURE, OUTCOME_SUCCESS, OUTCOME_UNKNOWN, QUEUE_ADD_TRANSACTION } from '../common/constants';\nimport { truncateModel, SPAN_MODEL, TRANSACTION_MODEL } from '../common/truncate';\nimport { __DEV__ } from '../state';\nvar SIMILAR_SPAN_TO_TRANSACTION_RATIO = 0.05;\nvar TRANSACTION_DURATION_THRESHOLD = 60000;\nexport function groupSmallContinuouslySimilarSpans(originalSpans, transDuration, threshold) {\n originalSpans.sort(function (spanA, spanB) {\n return spanA._start - spanB._start;\n });\n var spans = [];\n var lastCount = 1;\n originalSpans.forEach(function (span, index) {\n if (spans.length === 0) {\n spans.push(span);\n } else {\n var lastSpan = spans[spans.length - 1];\n var isContinuouslySimilar = lastSpan.type === span.type && lastSpan.subtype === span.subtype && lastSpan.action === span.action && lastSpan.name === span.name && span.duration() / transDuration < threshold && (span._start - lastSpan._end) / transDuration < threshold;\n var isLastSpan = originalSpans.length === index + 1;\n\n if (isContinuouslySimilar) {\n lastCount++;\n lastSpan._end = span._end;\n }\n\n if (lastCount > 1 && (!isContinuouslySimilar || isLastSpan)) {\n lastSpan.name = lastCount + 'x ' + lastSpan.name;\n lastCount = 1;\n }\n\n if (!isContinuouslySimilar) {\n spans.push(span);\n }\n }\n });\n return spans;\n}\nexport function adjustTransaction(transaction) {\n if (transaction.sampled) {\n var filterdSpans = transaction.spans.filter(function (span) {\n return span.duration() > 0 && span._start >= transaction._start && span._end <= transaction._end;\n });\n\n if (transaction.isManaged()) {\n var duration = transaction.duration();\n var similarSpans = groupSmallContinuouslySimilarSpans(filterdSpans, duration, SIMILAR_SPAN_TO_TRANSACTION_RATIO);\n transaction.spans = similarSpans;\n } else {\n transaction.spans = filterdSpans;\n }\n } else {\n transaction.resetFields();\n }\n\n return transaction;\n}\n\nvar PerformanceMonitoring = function () {\n function PerformanceMonitoring(apmServer, configService, loggingService, transactionService) {\n this._apmServer = apmServer;\n this._configService = configService;\n this._logginService = loggingService;\n this._transactionService = transactionService;\n }\n\n var _proto = PerformanceMonitoring.prototype;\n\n _proto.init = function init(flags) {\n var _this = this;\n\n if (flags === void 0) {\n flags = {};\n }\n\n this._configService.events.observe(TRANSACTION_END + AFTER_EVENT, function (tr) {\n var payload = _this.createTransactionPayload(tr);\n\n if (payload) {\n _this._apmServer.addTransaction(payload);\n\n _this._configService.dispatchEvent(QUEUE_ADD_TRANSACTION);\n }\n });\n\n if (flags[HISTORY]) {\n patchEventHandler.observe(HISTORY, this.getHistorySub());\n }\n\n if (flags[XMLHTTPREQUEST]) {\n patchEventHandler.observe(XMLHTTPREQUEST, this.getXHRSub());\n }\n\n if (flags[FETCH]) {\n patchEventHandler.observe(FETCH, this.getFetchSub());\n }\n };\n\n _proto.getHistorySub = function getHistorySub() {\n var transactionService = this._transactionService;\n return function (event, task) {\n if (task.source === HISTORY && event === INVOKE) {\n transactionService.startTransaction(task.data.title, 'route-change', {\n managed: true,\n canReuse: true\n });\n }\n };\n };\n\n _proto.getXHRSub = function getXHRSub() {\n var _this2 = this;\n\n return function (event, task) {\n if (task.source === XMLHTTPREQUEST && !globalState.fetchInProgress) {\n _this2.processAPICalls(event, task);\n }\n };\n };\n\n _proto.getFetchSub = function getFetchSub() {\n var _this3 = this;\n\n return function (event, task) {\n if (task.source === FETCH) {\n _this3.processAPICalls(event, task);\n }\n };\n };\n\n _proto.processAPICalls = function processAPICalls(event, task) {\n var configService = this._configService;\n var transactionService = this._transactionService;\n\n if (task.data && task.data.url) {\n var endpoints = this._apmServer.getEndpoints();\n\n var isOwnEndpoint = Object.keys(endpoints).some(function (endpoint) {\n return task.data.url.indexOf(endpoints[endpoint]) !== -1;\n });\n\n if (isOwnEndpoint) {\n return;\n }\n }\n\n if (event === SCHEDULE && task.data) {\n var data = task.data;\n var requestUrl = new Url(data.url);\n var spanName = data.method + ' ' + (requestUrl.relative ? requestUrl.path : stripQueryStringFromUrl(requestUrl.href));\n\n if (!transactionService.getCurrentTransaction()) {\n transactionService.startTransaction(spanName, HTTP_REQUEST_TYPE, {\n managed: true\n });\n }\n\n var span = transactionService.startSpan(spanName, 'external.http', {\n blocking: true\n });\n\n if (!span) {\n return;\n }\n\n var isDtEnabled = configService.get('distributedTracing');\n var dtOrigins = configService.get('distributedTracingOrigins');\n var currentUrl = new Url(window.location.href);\n var isSameOrigin = checkSameOrigin(requestUrl.origin, currentUrl.origin) || checkSameOrigin(requestUrl.origin, dtOrigins);\n var target = data.target;\n\n if (isDtEnabled && isSameOrigin && target) {\n this.injectDtHeader(span, target);\n var propagateTracestate = configService.get('propagateTracestate');\n\n if (propagateTracestate) {\n this.injectTSHeader(span, target);\n }\n } else if (__DEV__) {\n this._logginService.debug(\"Could not inject distributed tracing header to the request origin ('\" + requestUrl.origin + \"') from the current origin ('\" + currentUrl.origin + \"')\");\n }\n\n if (data.sync) {\n span.sync = data.sync;\n }\n\n data.span = span;\n } else if (event === INVOKE) {\n var _data = task.data;\n\n if (_data && _data.span) {\n var _span = _data.span,\n response = _data.response,\n _target = _data.target;\n var status;\n\n if (response) {\n status = response.status;\n } else {\n status = _target.status;\n }\n\n var outcome;\n\n if (_data.status != 'abort' && !_data.aborted) {\n if (status >= 400 || status == 0) {\n outcome = OUTCOME_FAILURE;\n } else {\n outcome = OUTCOME_SUCCESS;\n }\n } else {\n outcome = OUTCOME_UNKNOWN;\n }\n\n _span.outcome = outcome;\n var tr = transactionService.getCurrentTransaction();\n\n if (tr && tr.type === HTTP_REQUEST_TYPE) {\n tr.outcome = outcome;\n }\n\n transactionService.endSpan(_span, _data);\n }\n }\n };\n\n _proto.injectDtHeader = function injectDtHeader(span, target) {\n var headerName = this._configService.get('distributedTracingHeaderName');\n\n var headerValue = getDtHeaderValue(span);\n var isHeaderValid = isDtHeaderValid(headerValue);\n\n if (isHeaderValid && headerValue && headerName) {\n setRequestHeader(target, headerName, headerValue);\n }\n };\n\n _proto.injectTSHeader = function injectTSHeader(span, target) {\n var headerValue = getTSHeaderValue(span);\n\n if (headerValue) {\n setRequestHeader(target, 'tracestate', headerValue);\n }\n };\n\n _proto.extractDtHeader = function extractDtHeader(target) {\n var configService = this._configService;\n var headerName = configService.get('distributedTracingHeaderName');\n\n if (target) {\n return parseDtHeaderValue(target[headerName]);\n }\n };\n\n _proto.filterTransaction = function filterTransaction(tr) {\n var duration = tr.duration();\n\n if (!duration) {\n if (__DEV__) {\n var message = \"transaction(\" + tr.id + \", \" + tr.name + \") was discarded! \";\n\n if (duration === 0) {\n message += \"Transaction duration is 0\";\n } else {\n message += \"Transaction wasn't ended\";\n }\n\n this._logginService.debug(message);\n }\n\n return false;\n }\n\n if (tr.isManaged()) {\n if (duration > TRANSACTION_DURATION_THRESHOLD) {\n if (__DEV__) {\n this._logginService.debug(\"transaction(\" + tr.id + \", \" + tr.name + \") was discarded! Transaction duration (\" + duration + \") is greater than managed transaction threshold (\" + TRANSACTION_DURATION_THRESHOLD + \")\");\n }\n\n return false;\n }\n\n if (tr.sampled && tr.spans.length === 0) {\n if (__DEV__) {\n this._logginService.debug(\"transaction(\" + tr.id + \", \" + tr.name + \") was discarded! Transaction does not have any spans\");\n }\n\n return false;\n }\n }\n\n return true;\n };\n\n _proto.createTransactionDataModel = function createTransactionDataModel(transaction) {\n var transactionStart = transaction._start;\n var spans = transaction.spans.map(function (span) {\n var spanData = {\n id: span.id,\n transaction_id: transaction.id,\n parent_id: span.parentId || transaction.id,\n trace_id: transaction.traceId,\n name: span.name,\n type: span.type,\n subtype: span.subtype,\n action: span.action,\n sync: span.sync,\n start: parseInt(span._start - transactionStart),\n duration: span.duration(),\n context: span.context,\n outcome: span.outcome,\n sample_rate: span.sampleRate\n };\n return truncateModel(SPAN_MODEL, spanData);\n });\n var transactionData = {\n id: transaction.id,\n trace_id: transaction.traceId,\n session: transaction.session,\n name: transaction.name,\n type: transaction.type,\n duration: transaction.duration(),\n spans: spans,\n context: transaction.context,\n marks: transaction.marks,\n breakdown: transaction.breakdownTimings,\n span_count: {\n started: spans.length\n },\n sampled: transaction.sampled,\n sample_rate: transaction.sampleRate,\n experience: transaction.experience,\n outcome: transaction.outcome\n };\n return truncateModel(TRANSACTION_MODEL, transactionData);\n };\n\n _proto.createTransactionPayload = function createTransactionPayload(transaction) {\n var adjustedTransaction = adjustTransaction(transaction);\n var filtered = this.filterTransaction(adjustedTransaction);\n\n if (filtered) {\n return this.createTransactionDataModel(transaction);\n }\n };\n\n return PerformanceMonitoring;\n}();\n\nexport { PerformanceMonitoring as default };","import { getDuration, PERF } from '../common/utils';\nimport { PAGE_LOAD, TRUNCATED_TYPE } from '../common/constants';\nvar pageLoadBreakdowns = [['domainLookupStart', 'domainLookupEnd', 'DNS'], ['connectStart', 'connectEnd', 'TCP'], ['requestStart', 'responseStart', 'Request'], ['responseStart', 'responseEnd', 'Response'], ['domLoading', 'domComplete', 'Processing'], ['loadEventStart', 'loadEventEnd', 'Load']];\n\nfunction getValue(value) {\n return {\n value: value\n };\n}\n\nfunction calculateSelfTime(transaction) {\n var spans = transaction.spans,\n _start = transaction._start,\n _end = transaction._end;\n\n if (spans.length === 0) {\n return transaction.duration();\n }\n\n spans.sort(function (span1, span2) {\n return span1._start - span2._start;\n });\n var span = spans[0];\n var spanEnd = span._end;\n var spanStart = span._start;\n var lastContinuousEnd = spanEnd;\n var selfTime = spanStart - _start;\n\n for (var i = 1; i < spans.length; i++) {\n span = spans[i];\n spanStart = span._start;\n spanEnd = span._end;\n\n if (spanStart > lastContinuousEnd) {\n selfTime += spanStart - lastContinuousEnd;\n lastContinuousEnd = spanEnd;\n } else if (spanEnd > lastContinuousEnd) {\n lastContinuousEnd = spanEnd;\n }\n }\n\n if (lastContinuousEnd < _end) {\n selfTime += _end - lastContinuousEnd;\n }\n\n return selfTime;\n}\n\nfunction groupSpans(transaction) {\n var spanMap = {};\n var transactionSelfTime = calculateSelfTime(transaction);\n spanMap['app'] = {\n count: 1,\n duration: transactionSelfTime\n };\n var spans = transaction.spans;\n\n for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n var duration = span.duration();\n\n if (duration === 0 || duration == null) {\n continue;\n }\n\n var type = span.type,\n subtype = span.subtype;\n var key = type.replace(TRUNCATED_TYPE, '');\n\n if (subtype) {\n key += '.' + subtype;\n }\n\n if (!spanMap[key]) {\n spanMap[key] = {\n duration: 0,\n count: 0\n };\n }\n\n spanMap[key].count++;\n spanMap[key].duration += duration;\n }\n\n return spanMap;\n}\n\nfunction getSpanBreakdown(transactionDetails, _ref) {\n var details = _ref.details,\n _ref$count = _ref.count,\n count = _ref$count === void 0 ? 1 : _ref$count,\n duration = _ref.duration;\n return {\n transaction: transactionDetails,\n span: details,\n samples: {\n 'span.self_time.count': getValue(count),\n 'span.self_time.sum.us': getValue(duration)\n }\n };\n}\n\nexport function captureBreakdown(transaction, timings) {\n if (timings === void 0) {\n timings = PERF.timing;\n }\n\n var breakdowns = [];\n var trDuration = transaction.duration();\n var name = transaction.name,\n type = transaction.type,\n sampled = transaction.sampled;\n var transactionDetails = {\n name: name,\n type: type\n };\n breakdowns.push({\n transaction: transactionDetails,\n samples: {\n 'transaction.duration.count': getValue(1),\n 'transaction.duration.sum.us': getValue(trDuration),\n 'transaction.breakdown.count': getValue(sampled ? 1 : 0)\n }\n });\n\n if (!sampled) {\n return breakdowns;\n }\n\n if (type === PAGE_LOAD && timings) {\n for (var i = 0; i < pageLoadBreakdowns.length; i++) {\n var current = pageLoadBreakdowns[i];\n var start = timings[current[0]];\n var end = timings[current[1]];\n var duration = getDuration(start, end);\n\n if (duration === 0 || duration == null) {\n continue;\n }\n\n breakdowns.push(getSpanBreakdown(transactionDetails, {\n details: {\n type: current[2]\n },\n duration: duration\n }));\n }\n } else {\n var spanMap = groupSpans(transaction);\n Object.keys(spanMap).forEach(function (key) {\n var _key$split = key.split('.'),\n type = _key$split[0],\n subtype = _key$split[1];\n\n var _spanMap$key = spanMap[key],\n duration = _spanMap$key.duration,\n count = _spanMap$key.count;\n breakdowns.push(getSpanBreakdown(transactionDetails, {\n details: {\n type: type,\n subtype: subtype\n },\n duration: duration,\n count: count\n }));\n });\n }\n\n return breakdowns;\n}","function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport Span from './span';\nimport SpanBase from './span-base';\nimport { generateRandomId, merge, now, getTime, extend, removeInvalidChars } from '../common/utils';\nimport { REUSABILITY_THRESHOLD, TRUNCATED_TYPE } from '../common/constants';\nimport { captureBreakdown as _captureBreakdown } from './breakdown';\n\nvar Transaction = function (_SpanBase) {\n _inheritsLoose(Transaction, _SpanBase);\n\n function Transaction(name, type, options) {\n var _this;\n\n _this = _SpanBase.call(this, name, type, options) || this;\n _this.traceId = generateRandomId();\n _this.marks = undefined;\n _this.spans = [];\n _this._activeSpans = {};\n _this._activeTasks = new Set();\n _this.blocked = false;\n _this.captureTimings = false;\n _this.breakdownTimings = [];\n _this.sampleRate = _this.options.transactionSampleRate;\n _this.sampled = Math.random() <= _this.sampleRate;\n return _this;\n }\n\n var _proto = Transaction.prototype;\n\n _proto.addMarks = function addMarks(obj) {\n this.marks = merge(this.marks || {}, obj);\n };\n\n _proto.mark = function mark(key) {\n var skey = removeInvalidChars(key);\n\n var markTime = now() - this._start;\n\n var custom = {};\n custom[skey] = markTime;\n this.addMarks({\n custom: custom\n });\n };\n\n _proto.canReuse = function canReuse() {\n var threshold = this.options.reuseThreshold || REUSABILITY_THRESHOLD;\n return !!this.options.canReuse && !this.ended && now() - this._start < threshold;\n };\n\n _proto.redefine = function redefine(name, type, options) {\n if (name) {\n this.name = name;\n }\n\n if (type) {\n this.type = type;\n }\n\n if (options) {\n this.options.reuseThreshold = options.reuseThreshold;\n extend(this.options, options);\n }\n };\n\n _proto.startSpan = function startSpan(name, type, options) {\n var _this2 = this;\n\n if (this.ended) {\n return;\n }\n\n var opts = extend({}, options);\n\n opts.onEnd = function (trc) {\n _this2._onSpanEnd(trc);\n };\n\n opts.traceId = this.traceId;\n opts.sampled = this.sampled;\n opts.sampleRate = this.sampleRate;\n\n if (!opts.parentId) {\n opts.parentId = this.id;\n }\n\n var span = new Span(name, type, opts);\n this._activeSpans[span.id] = span;\n\n if (opts.blocking) {\n this.addTask(span.id);\n }\n\n return span;\n };\n\n _proto.isFinished = function isFinished() {\n return !this.blocked && this._activeTasks.size === 0;\n };\n\n _proto.detectFinish = function detectFinish() {\n if (this.isFinished()) this.end();\n };\n\n _proto.end = function end(endTime) {\n if (this.ended) {\n return;\n }\n\n this.ended = true;\n this._end = getTime(endTime);\n\n for (var sid in this._activeSpans) {\n var span = this._activeSpans[sid];\n span.type = span.type + TRUNCATED_TYPE;\n span.end(endTime);\n }\n\n this.callOnEnd();\n };\n\n _proto.captureBreakdown = function captureBreakdown() {\n this.breakdownTimings = _captureBreakdown(this);\n };\n\n _proto.block = function block(flag) {\n this.blocked = flag;\n\n if (!this.blocked) {\n this.detectFinish();\n }\n };\n\n _proto.addTask = function addTask(taskId) {\n if (!taskId) {\n taskId = 'task-' + generateRandomId(16);\n }\n\n this._activeTasks.add(taskId);\n\n return taskId;\n };\n\n _proto.removeTask = function removeTask(taskId) {\n var deleted = this._activeTasks.delete(taskId);\n\n deleted && this.detectFinish();\n };\n\n _proto.resetFields = function resetFields() {\n this.spans = [];\n this.sampleRate = 0;\n };\n\n _proto._onSpanEnd = function _onSpanEnd(span) {\n this.spans.push(span);\n delete this._activeSpans[span.id];\n this.removeTask(span.id);\n };\n\n _proto.isManaged = function isManaged() {\n return !!this.options.managed;\n };\n\n return Transaction;\n}(SpanBase);\n\nexport default Transaction;","import { LONG_TASK, LARGEST_CONTENTFUL_PAINT, FIRST_CONTENTFUL_PAINT, FIRST_INPUT, LAYOUT_SHIFT } from '../common/constants';\nimport { noop, PERF } from '../common/utils';\nimport Span from './span';\nexport var metrics = {\n fid: 0,\n fcp: 0,\n tbt: {\n start: Infinity,\n duration: 0\n },\n cls: {\n score: 0,\n firstEntryTime: Number.NEGATIVE_INFINITY,\n prevEntryTime: Number.NEGATIVE_INFINITY,\n currentSessionScore: 0\n },\n longtask: {\n count: 0,\n duration: 0,\n max: 0\n }\n};\nvar LONG_TASK_THRESHOLD = 50;\nexport function createLongTaskSpans(longtasks, agg) {\n var spans = [];\n\n for (var i = 0; i < longtasks.length; i++) {\n var _longtasks$i = longtasks[i],\n name = _longtasks$i.name,\n startTime = _longtasks$i.startTime,\n duration = _longtasks$i.duration,\n attribution = _longtasks$i.attribution;\n var end = startTime + duration;\n var span = new Span(\"Longtask(\" + name + \")\", LONG_TASK, {\n startTime: startTime\n });\n agg.count++;\n agg.duration += duration;\n agg.max = Math.max(duration, agg.max);\n\n if (attribution.length > 0) {\n var _attribution$ = attribution[0],\n _name = _attribution$.name,\n containerType = _attribution$.containerType,\n containerName = _attribution$.containerName,\n containerId = _attribution$.containerId;\n var customContext = {\n attribution: _name,\n type: containerType\n };\n\n if (containerName) {\n customContext.name = containerName;\n }\n\n if (containerId) {\n customContext.id = containerId;\n }\n\n span.addContext({\n custom: customContext\n });\n }\n\n span.end(end);\n spans.push(span);\n }\n\n return spans;\n}\nexport function createFirstInputDelaySpan(fidEntries) {\n var firstInput = fidEntries[0];\n\n if (firstInput) {\n var startTime = firstInput.startTime,\n processingStart = firstInput.processingStart;\n var span = new Span('First Input Delay', FIRST_INPUT, {\n startTime: startTime\n });\n span.end(processingStart);\n return span;\n }\n}\nexport function createTotalBlockingTimeSpan(tbtObject) {\n var start = tbtObject.start,\n duration = tbtObject.duration;\n var tbtSpan = new Span('Total Blocking Time', LONG_TASK, {\n startTime: start\n });\n tbtSpan.end(start + duration);\n return tbtSpan;\n}\nexport function calculateTotalBlockingTime(longtaskEntries) {\n longtaskEntries.forEach(function (entry) {\n var name = entry.name,\n startTime = entry.startTime,\n duration = entry.duration;\n\n if (startTime < metrics.fcp) {\n return;\n }\n\n if (name !== 'self' && name.indexOf('same-origin') === -1) {\n return;\n }\n\n metrics.tbt.start = Math.min(metrics.tbt.start, startTime);\n var blockingTime = duration - LONG_TASK_THRESHOLD;\n\n if (blockingTime > 0) {\n metrics.tbt.duration += blockingTime;\n }\n });\n}\nexport function calculateCumulativeLayoutShift(clsEntries) {\n clsEntries.forEach(function (entry) {\n if (!entry.hadRecentInput && entry.value) {\n var shouldCreateNewSession = entry.startTime - metrics.cls.firstEntryTime > 5000 || entry.startTime - metrics.cls.prevEntryTime > 1000;\n\n if (shouldCreateNewSession) {\n metrics.cls.firstEntryTime = entry.startTime;\n metrics.cls.currentSessionScore = 0;\n }\n\n metrics.cls.prevEntryTime = entry.startTime;\n metrics.cls.currentSessionScore += entry.value;\n metrics.cls.score = Math.max(metrics.cls.score, metrics.cls.currentSessionScore);\n }\n });\n}\nexport function captureObserverEntries(list, _ref) {\n var isHardNavigation = _ref.isHardNavigation,\n trStart = _ref.trStart;\n var longtaskEntries = list.getEntriesByType(LONG_TASK).filter(function (entry) {\n return entry.startTime >= trStart;\n });\n var longTaskSpans = createLongTaskSpans(longtaskEntries, metrics.longtask);\n var result = {\n spans: longTaskSpans,\n marks: {}\n };\n\n if (!isHardNavigation) {\n return result;\n }\n\n var lcpEntries = list.getEntriesByType(LARGEST_CONTENTFUL_PAINT);\n var lastLcpEntry = lcpEntries[lcpEntries.length - 1];\n\n if (lastLcpEntry) {\n var lcp = parseInt(lastLcpEntry.startTime);\n metrics.lcp = lcp;\n result.marks.largestContentfulPaint = lcp;\n }\n\n var timing = PERF.timing;\n var unloadDiff = timing.fetchStart - timing.navigationStart;\n var fcpEntry = list.getEntriesByName(FIRST_CONTENTFUL_PAINT)[0];\n\n if (fcpEntry) {\n var fcp = parseInt(unloadDiff >= 0 ? fcpEntry.startTime - unloadDiff : fcpEntry.startTime);\n metrics.fcp = fcp;\n result.marks.firstContentfulPaint = fcp;\n }\n\n var fidEntries = list.getEntriesByType(FIRST_INPUT);\n var fidSpan = createFirstInputDelaySpan(fidEntries);\n\n if (fidSpan) {\n metrics.fid = fidSpan.duration();\n result.spans.push(fidSpan);\n }\n\n calculateTotalBlockingTime(longtaskEntries);\n var clsEntries = list.getEntriesByType(LAYOUT_SHIFT);\n calculateCumulativeLayoutShift(clsEntries);\n return result;\n}\nexport var PerfEntryRecorder = function () {\n function PerfEntryRecorder(callback) {\n this.po = {\n observe: noop,\n disconnect: noop\n };\n\n if (window.PerformanceObserver) {\n this.po = new PerformanceObserver(callback);\n }\n }\n\n var _proto = PerfEntryRecorder.prototype;\n\n _proto.start = function start(type) {\n try {\n this.po.observe({\n type: type,\n buffered: true\n });\n } catch (_) {}\n };\n\n _proto.stop = function stop() {\n this.po.disconnect();\n };\n\n return PerfEntryRecorder;\n}();","import { Promise } from '../common/polyfills';\nimport Transaction from './transaction';\nimport { PerfEntryRecorder, captureObserverEntries, metrics, createTotalBlockingTimeSpan } from './metrics';\nimport { extend, getEarliestSpan, getLatestNonXHRSpan, getLatestXHRSpan, isPerfTypeSupported, generateRandomId } from '../common/utils';\nimport { captureNavigation } from './capture-navigation';\nimport { PAGE_LOAD, NAME_UNKNOWN, TRANSACTION_START, TRANSACTION_END, TEMPORARY_TYPE, TRANSACTION_TYPE_ORDER, LARGEST_CONTENTFUL_PAINT, LONG_TASK, PAINT, TRUNCATED_TYPE, FIRST_INPUT, LAYOUT_SHIFT, SESSION_TIMEOUT, PAGE_LOAD_DELAY } from '../common/constants';\nimport { addTransactionContext } from '../common/context';\nimport { __DEV__, state } from '../state';\nimport { slugifyUrl } from '../common/url';\n\nvar TransactionService = function () {\n function TransactionService(logger, config) {\n var _this = this;\n\n this._config = config;\n this._logger = logger;\n this.currentTransaction = undefined;\n this.respIntervalId = undefined;\n this.recorder = new PerfEntryRecorder(function (list) {\n var tr = _this.getCurrentTransaction();\n\n if (tr && tr.captureTimings) {\n var _tr$spans;\n\n var isHardNavigation = tr.type === PAGE_LOAD;\n\n var _captureObserverEntri = captureObserverEntries(list, {\n isHardNavigation: isHardNavigation,\n trStart: isHardNavigation ? 0 : tr._start\n }),\n spans = _captureObserverEntri.spans,\n marks = _captureObserverEntri.marks;\n\n (_tr$spans = tr.spans).push.apply(_tr$spans, spans);\n\n tr.addMarks({\n agent: marks\n });\n }\n });\n }\n\n var _proto = TransactionService.prototype;\n\n _proto.createCurrentTransaction = function createCurrentTransaction(name, type, options) {\n var tr = new Transaction(name, type, options);\n this.currentTransaction = tr;\n return tr;\n };\n\n _proto.getCurrentTransaction = function getCurrentTransaction() {\n if (this.currentTransaction && !this.currentTransaction.ended) {\n return this.currentTransaction;\n }\n };\n\n _proto.createOptions = function createOptions(options) {\n var config = this._config.config;\n var presetOptions = {\n transactionSampleRate: config.transactionSampleRate\n };\n var perfOptions = extend(presetOptions, options);\n\n if (perfOptions.managed) {\n perfOptions = extend({\n pageLoadTraceId: config.pageLoadTraceId,\n pageLoadSampled: config.pageLoadSampled,\n pageLoadSpanId: config.pageLoadSpanId,\n pageLoadTransactionName: config.pageLoadTransactionName\n }, perfOptions);\n }\n\n return perfOptions;\n };\n\n _proto.startManagedTransaction = function startManagedTransaction(name, type, perfOptions) {\n var tr = this.getCurrentTransaction();\n var isRedefined = false;\n\n if (!tr) {\n tr = this.createCurrentTransaction(name, type, perfOptions);\n } else if (tr.canReuse() && perfOptions.canReuse) {\n var redefineType = tr.type;\n var currentTypeOrder = TRANSACTION_TYPE_ORDER.indexOf(tr.type);\n var redefineTypeOrder = TRANSACTION_TYPE_ORDER.indexOf(type);\n\n if (currentTypeOrder >= 0 && redefineTypeOrder < currentTypeOrder) {\n redefineType = type;\n }\n\n if (__DEV__) {\n this._logger.debug(\"redefining transaction(\" + tr.id + \", \" + tr.name + \", \" + tr.type + \")\", 'to', \"(\" + (name || tr.name) + \", \" + redefineType + \")\", tr);\n }\n\n tr.redefine(name, redefineType, perfOptions);\n isRedefined = true;\n } else {\n if (__DEV__) {\n this._logger.debug(\"ending previous transaction(\" + tr.id + \", \" + tr.name + \")\", tr);\n }\n\n tr.end();\n tr = this.createCurrentTransaction(name, type, perfOptions);\n }\n\n if (tr.type === PAGE_LOAD) {\n if (!isRedefined) {\n this.recorder.start(LARGEST_CONTENTFUL_PAINT);\n this.recorder.start(PAINT);\n this.recorder.start(FIRST_INPUT);\n this.recorder.start(LAYOUT_SHIFT);\n }\n\n if (perfOptions.pageLoadTraceId) {\n tr.traceId = perfOptions.pageLoadTraceId;\n }\n\n if (perfOptions.pageLoadSampled) {\n tr.sampled = perfOptions.pageLoadSampled;\n }\n\n if (tr.name === NAME_UNKNOWN && perfOptions.pageLoadTransactionName) {\n tr.name = perfOptions.pageLoadTransactionName;\n }\n }\n\n if (!isRedefined && this._config.get('monitorLongtasks')) {\n this.recorder.start(LONG_TASK);\n }\n\n if (tr.sampled) {\n tr.captureTimings = true;\n }\n\n return tr;\n };\n\n _proto.startTransaction = function startTransaction(name, type, options) {\n var _this2 = this;\n\n var perfOptions = this.createOptions(options);\n var tr;\n var fireOnstartHook = true;\n\n if (perfOptions.managed) {\n var current = this.currentTransaction;\n tr = this.startManagedTransaction(name, type, perfOptions);\n\n if (current === tr) {\n fireOnstartHook = false;\n }\n } else {\n tr = new Transaction(name, type, perfOptions);\n }\n\n tr.onEnd = function () {\n return _this2.handleTransactionEnd(tr);\n };\n\n if (fireOnstartHook) {\n if (__DEV__) {\n this._logger.debug(\"startTransaction(\" + tr.id + \", \" + tr.name + \", \" + tr.type + \")\");\n }\n\n this._config.events.send(TRANSACTION_START, [tr]);\n }\n\n return tr;\n };\n\n _proto.handleTransactionEnd = function handleTransactionEnd(tr) {\n var _this3 = this;\n\n this.recorder.stop();\n var currentUrl = window.location.href;\n return Promise.resolve().then(function () {\n var name = tr.name,\n type = tr.type;\n var lastHiddenStart = state.lastHiddenStart;\n\n if (lastHiddenStart >= tr._start) {\n if (__DEV__) {\n _this3._logger.debug(\"transaction(\" + tr.id + \", \" + name + \", \" + type + \") was discarded! The page was hidden during the transaction!\");\n }\n\n return;\n }\n\n if (_this3.shouldIgnoreTransaction(name) || type === TEMPORARY_TYPE) {\n if (__DEV__) {\n _this3._logger.debug(\"transaction(\" + tr.id + \", \" + name + \", \" + type + \") is ignored\");\n }\n\n return;\n }\n\n if (type === PAGE_LOAD) {\n var pageLoadTransactionName = _this3._config.get('pageLoadTransactionName');\n\n if (name === NAME_UNKNOWN && pageLoadTransactionName) {\n tr.name = pageLoadTransactionName;\n }\n\n if (tr.captureTimings) {\n var cls = metrics.cls,\n fid = metrics.fid,\n tbt = metrics.tbt,\n longtask = metrics.longtask;\n\n if (tbt.duration > 0) {\n tr.spans.push(createTotalBlockingTimeSpan(tbt));\n }\n\n tr.experience = {};\n\n if (isPerfTypeSupported(LONG_TASK)) {\n tr.experience.tbt = tbt.duration;\n }\n\n if (isPerfTypeSupported(LAYOUT_SHIFT)) {\n tr.experience.cls = cls.score;\n }\n\n if (fid > 0) {\n tr.experience.fid = fid;\n }\n\n if (longtask.count > 0) {\n tr.experience.longtask = {\n count: longtask.count,\n sum: longtask.duration,\n max: longtask.max\n };\n }\n }\n\n _this3.setSession(tr);\n }\n\n if (tr.name === NAME_UNKNOWN) {\n tr.name = slugifyUrl(currentUrl);\n }\n\n captureNavigation(tr);\n\n _this3.adjustTransactionTime(tr);\n\n var breakdownMetrics = _this3._config.get('breakdownMetrics');\n\n if (breakdownMetrics) {\n tr.captureBreakdown();\n }\n\n var configContext = _this3._config.get('context');\n\n addTransactionContext(tr, configContext);\n\n _this3._config.events.send(TRANSACTION_END, [tr]);\n\n if (__DEV__) {\n _this3._logger.debug(\"end transaction(\" + tr.id + \", \" + tr.name + \", \" + tr.type + \")\", tr);\n }\n }, function (err) {\n if (__DEV__) {\n _this3._logger.debug(\"error ending transaction(\" + tr.id + \", \" + tr.name + \")\", err);\n }\n });\n };\n\n _proto.setSession = function setSession(tr) {\n var session = this._config.get('session');\n\n if (session) {\n if (typeof session == 'boolean') {\n tr.session = {\n id: generateRandomId(16),\n sequence: 1\n };\n } else {\n if (session.timestamp && Date.now() - session.timestamp > SESSION_TIMEOUT) {\n tr.session = {\n id: generateRandomId(16),\n sequence: 1\n };\n } else {\n tr.session = {\n id: session.id,\n sequence: session.sequence ? session.sequence + 1 : 1\n };\n }\n }\n\n var sessionConfig = {\n session: {\n id: tr.session.id,\n sequence: tr.session.sequence,\n timestamp: Date.now()\n }\n };\n\n this._config.setConfig(sessionConfig);\n\n this._config.setLocalConfig(sessionConfig, true);\n }\n };\n\n _proto.adjustTransactionTime = function adjustTransactionTime(transaction) {\n var spans = transaction.spans;\n var earliestSpan = getEarliestSpan(spans);\n\n if (earliestSpan && earliestSpan._start < transaction._start) {\n transaction._start = earliestSpan._start;\n }\n\n var latestSpan = getLatestNonXHRSpan(spans) || {};\n var latestSpanEnd = latestSpan._end || 0;\n\n if (transaction.type === PAGE_LOAD) {\n var transactionEndWithoutDelay = transaction._end - PAGE_LOAD_DELAY;\n var lcp = metrics.lcp || 0;\n var latestXHRSpan = getLatestXHRSpan(spans) || {};\n var latestXHRSpanEnd = latestXHRSpan._end || 0;\n transaction._end = Math.max(latestSpanEnd, latestXHRSpanEnd, lcp, transactionEndWithoutDelay);\n } else if (latestSpanEnd > transaction._end) {\n transaction._end = latestSpanEnd;\n }\n\n this.truncateSpans(spans, transaction._end);\n };\n\n _proto.truncateSpans = function truncateSpans(spans, transactionEnd) {\n for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n\n if (span._end > transactionEnd) {\n span._end = transactionEnd;\n span.type += TRUNCATED_TYPE;\n }\n\n if (span._start > transactionEnd) {\n span._start = transactionEnd;\n }\n }\n };\n\n _proto.shouldIgnoreTransaction = function shouldIgnoreTransaction(transactionName) {\n var ignoreList = this._config.get('ignoreTransactions');\n\n if (ignoreList && ignoreList.length) {\n for (var i = 0; i < ignoreList.length; i++) {\n var element = ignoreList[i];\n\n if (typeof element.test === 'function') {\n if (element.test(transactionName)) {\n return true;\n }\n } else if (element === transactionName) {\n return true;\n }\n }\n }\n\n return false;\n };\n\n _proto.startSpan = function startSpan(name, type, options) {\n var tr = this.getCurrentTransaction();\n\n if (!tr) {\n tr = this.createCurrentTransaction(undefined, TEMPORARY_TYPE, this.createOptions({\n canReuse: true,\n managed: true\n }));\n }\n\n var span = tr.startSpan(name, type, options);\n\n if (__DEV__) {\n this._logger.debug(\"startSpan(\" + name + \", \" + span.type + \")\", \"on transaction(\" + tr.id + \", \" + tr.name + \")\");\n }\n\n return span;\n };\n\n _proto.endSpan = function endSpan(span, context) {\n if (!span) {\n return;\n }\n\n if (__DEV__) {\n var tr = this.getCurrentTransaction();\n tr && this._logger.debug(\"endSpan(\" + span.name + \", \" + span.type + \")\", \"on transaction(\" + tr.id + \", \" + tr.name + \")\");\n }\n\n span.end(null, context);\n };\n\n return TransactionService;\n}();\n\nexport default TransactionService;","import PerformanceMonitoring from './performance-monitoring';\nimport TransactionService from './transaction-service';\nimport { APM_SERVER, CONFIG_SERVICE, LOGGING_SERVICE, TRANSACTION_SERVICE, PERFORMANCE_MONITORING } from '../common/constants';\nimport { serviceCreators } from '../common/service-factory';\n\nfunction registerServices() {\n serviceCreators[TRANSACTION_SERVICE] = function (serviceFactory) {\n var _serviceFactory$getSe = serviceFactory.getService([LOGGING_SERVICE, CONFIG_SERVICE]),\n loggingService = _serviceFactory$getSe[0],\n configService = _serviceFactory$getSe[1];\n\n return new TransactionService(loggingService, configService);\n };\n\n serviceCreators[PERFORMANCE_MONITORING] = function (serviceFactory) {\n var _serviceFactory$getSe2 = serviceFactory.getService([APM_SERVER, CONFIG_SERVICE, LOGGING_SERVICE, TRANSACTION_SERVICE]),\n apmServer = _serviceFactory$getSe2[0],\n configService = _serviceFactory$getSe2[1],\n loggingService = _serviceFactory$getSe2[2],\n transactionService = _serviceFactory$getSe2[3];\n\n return new PerformanceMonitoring(apmServer, configService, loggingService, transactionService);\n };\n}\n\nexport { registerServices };","import { QUEUE_ADD_TRANSACTION, QUEUE_FLUSH } from '../constants';\nimport { state } from '../../state';\nimport { now } from '../utils';\nexport function observePageVisibility(configService, transactionService) {\n if (document.visibilityState === 'hidden') {\n state.lastHiddenStart = 0;\n }\n\n var visibilityChangeHandler = function visibilityChangeHandler() {\n if (document.visibilityState === 'hidden') {\n onPageHidden(configService, transactionService);\n }\n };\n\n var pageHideHandler = function pageHideHandler() {\n return onPageHidden(configService, transactionService);\n };\n\n var useCapture = true;\n window.addEventListener('visibilitychange', visibilityChangeHandler, useCapture);\n window.addEventListener('pagehide', pageHideHandler, useCapture);\n return function () {\n window.removeEventListener('visibilitychange', visibilityChangeHandler, useCapture);\n window.removeEventListener('pagehide', pageHideHandler, useCapture);\n };\n}\n\nfunction onPageHidden(configService, transactionService) {\n var tr = transactionService.getCurrentTransaction();\n\n if (tr) {\n var unobserve = configService.observeEvent(QUEUE_ADD_TRANSACTION, function () {\n configService.dispatchEvent(QUEUE_FLUSH);\n state.lastHiddenStart = now();\n unobserve();\n });\n tr.end();\n } else {\n configService.dispatchEvent(QUEUE_FLUSH);\n state.lastHiddenStart = now();\n }\n}","import { USER_INTERACTION } from '../constants';\nexport function observePageClicks(transactionService) {\n var clickHandler = function clickHandler(event) {\n if (event.target instanceof Element) {\n createUserInteractionTransaction(transactionService, event.target);\n }\n };\n\n var eventName = 'click';\n var useCapture = true;\n window.addEventListener(eventName, clickHandler, useCapture);\n return function () {\n window.removeEventListener(eventName, clickHandler, useCapture);\n };\n}\n\nfunction createUserInteractionTransaction(transactionService, target) {\n var _getTransactionMetada = getTransactionMetadata(target),\n transactionName = _getTransactionMetada.transactionName,\n context = _getTransactionMetada.context;\n\n var tr = transactionService.startTransaction(\"Click - \" + transactionName, USER_INTERACTION, {\n managed: true,\n canReuse: true,\n reuseThreshold: 300\n });\n\n if (tr && context) {\n tr.addContext(context);\n }\n}\n\nfunction getTransactionMetadata(target) {\n var metadata = {\n transactionName: null,\n context: null\n };\n var tagName = target.tagName.toLowerCase();\n var transactionName = tagName;\n\n if (!!target.dataset.transactionName) {\n transactionName = target.dataset.transactionName;\n } else {\n var name = target.getAttribute('name');\n\n if (!!name) {\n transactionName = tagName + \"[\\\"\" + name + \"\\\"]\";\n }\n }\n\n metadata.transactionName = transactionName;\n var classes = target.getAttribute('class');\n\n if (classes) {\n metadata.context = {\n custom: {\n classes: classes\n }\n };\n }\n\n return metadata;\n}","import { XMLHTTPREQUEST, FETCH, HISTORY, PAGE_LOAD, ERROR, EVENT_TARGET, CLICK } from './constants';\nexport function getInstrumentationFlags(instrument, disabledInstrumentations) {\n var _flags;\n\n var flags = (_flags = {}, _flags[XMLHTTPREQUEST] = false, _flags[FETCH] = false, _flags[HISTORY] = false, _flags[PAGE_LOAD] = false, _flags[ERROR] = false, _flags[EVENT_TARGET] = false, _flags[CLICK] = false, _flags);\n\n if (!instrument) {\n return flags;\n }\n\n Object.keys(flags).forEach(function (key) {\n if (disabledInstrumentations.indexOf(key) === -1) {\n flags[key] = true;\n }\n });\n return flags;\n}","import { isPlatformSupported, isBrowser, now } from './common/utils';\nimport { patchAll } from './common/patching';\nimport { state } from './state';\nvar enabled = false;\nexport function bootstrap() {\n if (isPlatformSupported()) {\n patchAll();\n state.bootstrapTime = now();\n enabled = true;\n } else if (isBrowser) {\n console.log('[Elastic APM] platform is not supported!');\n }\n\n return enabled;\n}","import { registerServices as registerErrorServices } from './error-logging';\nimport { registerServices as registerPerfServices } from './performance-monitoring';\nimport { ServiceFactory } from './common/service-factory';\nimport { isPlatformSupported, scheduleMicroTask, scheduleMacroTask, isBrowser } from './common/utils';\nimport { patchAll, patchEventHandler } from './common/patching';\nimport { observePageVisibility, observePageClicks } from './common/observers';\nimport { PAGE_LOAD_DELAY, PAGE_LOAD, ERROR, CONFIG_SERVICE, LOGGING_SERVICE, TRANSACTION_SERVICE, APM_SERVER, PERFORMANCE_MONITORING, ERROR_LOGGING, EVENT_TARGET, CLICK } from './common/constants';\nimport { getInstrumentationFlags } from './common/instrument';\nimport afterFrame from './common/after-frame';\nimport { bootstrap } from './bootstrap';\nimport { createTracer } from './opentracing';\n\nfunction createServiceFactory() {\n registerPerfServices();\n registerErrorServices();\n var serviceFactory = new ServiceFactory();\n return serviceFactory;\n}\n\nexport { createServiceFactory, ServiceFactory, patchAll, patchEventHandler, isPlatformSupported, isBrowser, getInstrumentationFlags, createTracer, scheduleMicroTask, scheduleMacroTask, afterFrame, ERROR, PAGE_LOAD_DELAY, PAGE_LOAD, CONFIG_SERVICE, LOGGING_SERVICE, TRANSACTION_SERVICE, APM_SERVER, PERFORMANCE_MONITORING, ERROR_LOGGING, EVENT_TARGET, CLICK, bootstrap, observePageVisibility, observePageClicks };","import { getInstrumentationFlags, PAGE_LOAD_DELAY, PAGE_LOAD, ERROR, CONFIG_SERVICE, LOGGING_SERVICE, TRANSACTION_SERVICE, PERFORMANCE_MONITORING, ERROR_LOGGING, APM_SERVER, EVENT_TARGET, CLICK, observePageVisibility, observePageClicks } from '@elastic/apm-rum-core';\n\nvar ApmBase = function () {\n function ApmBase(serviceFactory, disable) {\n this._disable = disable;\n this.serviceFactory = serviceFactory;\n this._initialized = false;\n }\n\n var _proto = ApmBase.prototype;\n\n _proto.isEnabled = function isEnabled() {\n return !this._disable;\n };\n\n _proto.isActive = function isActive() {\n var configService = this.serviceFactory.getService(CONFIG_SERVICE);\n return this.isEnabled() && this._initialized && configService.get('active');\n };\n\n _proto.init = function init(config) {\n var _this = this;\n\n if (this.isEnabled() && !this._initialized) {\n this._initialized = true;\n\n var _this$serviceFactory$ = this.serviceFactory.getService([CONFIG_SERVICE, LOGGING_SERVICE, TRANSACTION_SERVICE]),\n configService = _this$serviceFactory$[0],\n loggingService = _this$serviceFactory$[1],\n transactionService = _this$serviceFactory$[2];\n\n configService.setVersion('5.12.0');\n this.config(config);\n var logLevel = configService.get('logLevel');\n loggingService.setLevel(logLevel);\n var isConfigActive = configService.get('active');\n\n if (isConfigActive) {\n this.serviceFactory.init();\n var flags = getInstrumentationFlags(configService.get('instrument'), configService.get('disableInstrumentations'));\n var performanceMonitoring = this.serviceFactory.getService(PERFORMANCE_MONITORING);\n performanceMonitoring.init(flags);\n\n if (flags[ERROR]) {\n var errorLogging = this.serviceFactory.getService(ERROR_LOGGING);\n errorLogging.registerListeners();\n }\n\n if (configService.get('session')) {\n var localConfig = configService.getLocalConfig();\n\n if (localConfig && localConfig.session) {\n configService.setConfig({\n session: localConfig.session\n });\n }\n }\n\n var sendPageLoad = function sendPageLoad() {\n return flags[PAGE_LOAD] && _this._sendPageLoadMetrics();\n };\n\n if (configService.get('centralConfig')) {\n this.fetchCentralConfig().then(sendPageLoad);\n } else {\n sendPageLoad();\n }\n\n observePageVisibility(configService, transactionService);\n\n if (flags[EVENT_TARGET] && flags[CLICK]) {\n observePageClicks(transactionService);\n }\n } else {\n this._disable = true;\n loggingService.warn('RUM agent is inactive');\n }\n }\n\n return this;\n };\n\n _proto.fetchCentralConfig = function fetchCentralConfig() {\n var _this$serviceFactory$2 = this.serviceFactory.getService([APM_SERVER, LOGGING_SERVICE, CONFIG_SERVICE]),\n apmServer = _this$serviceFactory$2[0],\n loggingService = _this$serviceFactory$2[1],\n configService = _this$serviceFactory$2[2];\n\n return apmServer.fetchConfig(configService.get('serviceName'), configService.get('environment')).then(function (config) {\n var transactionSampleRate = config['transaction_sample_rate'];\n\n if (transactionSampleRate) {\n transactionSampleRate = Number(transactionSampleRate);\n var _config2 = {\n transactionSampleRate: transactionSampleRate\n };\n\n var _configService$valida = configService.validate(_config2),\n invalid = _configService$valida.invalid;\n\n if (invalid.length === 0) {\n configService.setConfig(_config2);\n } else {\n var _invalid$ = invalid[0],\n key = _invalid$.key,\n value = _invalid$.value,\n allowed = _invalid$.allowed;\n loggingService.warn(\"invalid value \\\"\" + value + \"\\\" for \" + key + \". Allowed: \" + allowed + \".\");\n }\n }\n\n return config;\n }).catch(function (error) {\n loggingService.warn('failed fetching config:', error);\n });\n };\n\n _proto._sendPageLoadMetrics = function _sendPageLoadMetrics() {\n var tr = this.startTransaction(undefined, PAGE_LOAD, {\n managed: true,\n canReuse: true\n });\n\n if (!tr) {\n return;\n }\n\n tr.addTask(PAGE_LOAD);\n\n var sendPageLoadMetrics = function sendPageLoadMetrics() {\n setTimeout(function () {\n return tr.removeTask(PAGE_LOAD);\n }, PAGE_LOAD_DELAY);\n };\n\n if (document.readyState === 'complete') {\n sendPageLoadMetrics();\n } else {\n window.addEventListener('load', sendPageLoadMetrics);\n }\n };\n\n _proto.observe = function observe(name, fn) {\n var configService = this.serviceFactory.getService(CONFIG_SERVICE);\n configService.events.observe(name, fn);\n };\n\n _proto.config = function config(_config) {\n var _this$serviceFactory$3 = this.serviceFactory.getService([CONFIG_SERVICE, LOGGING_SERVICE]),\n configService = _this$serviceFactory$3[0],\n loggingService = _this$serviceFactory$3[1];\n\n var _configService$valida2 = configService.validate(_config),\n missing = _configService$valida2.missing,\n invalid = _configService$valida2.invalid,\n unknown = _configService$valida2.unknown;\n\n if (unknown.length > 0) {\n var message = 'Unknown config options are specified for RUM agent: ' + unknown.join(', ');\n loggingService.warn(message);\n }\n\n if (missing.length === 0 && invalid.length === 0) {\n configService.setConfig(_config);\n } else {\n var separator = ', ';\n var _message = \"RUM agent isn't correctly configured. \";\n\n if (missing.length > 0) {\n _message += missing.join(separator) + ' is missing';\n\n if (invalid.length > 0) {\n _message += separator;\n }\n }\n\n invalid.forEach(function (_ref, index) {\n var key = _ref.key,\n value = _ref.value,\n allowed = _ref.allowed;\n _message += key + \" \\\"\" + value + \"\\\" contains invalid characters! (allowed: \" + allowed + \")\" + (index !== invalid.length - 1 ? separator : '');\n });\n loggingService.error(_message);\n configService.setConfig({\n active: false\n });\n }\n };\n\n _proto.setUserContext = function setUserContext(userContext) {\n var configService = this.serviceFactory.getService(CONFIG_SERVICE);\n configService.setUserContext(userContext);\n };\n\n _proto.setCustomContext = function setCustomContext(customContext) {\n var configService = this.serviceFactory.getService(CONFIG_SERVICE);\n configService.setCustomContext(customContext);\n };\n\n _proto.addLabels = function addLabels(labels) {\n var configService = this.serviceFactory.getService(CONFIG_SERVICE);\n configService.addLabels(labels);\n };\n\n _proto.setInitialPageLoadName = function setInitialPageLoadName(name) {\n var configService = this.serviceFactory.getService(CONFIG_SERVICE);\n configService.setConfig({\n pageLoadTransactionName: name\n });\n };\n\n _proto.startTransaction = function startTransaction(name, type, options) {\n if (this.isEnabled()) {\n var transactionService = this.serviceFactory.getService(TRANSACTION_SERVICE);\n return transactionService.startTransaction(name, type, options);\n }\n };\n\n _proto.startSpan = function startSpan(name, type, options) {\n if (this.isEnabled()) {\n var transactionService = this.serviceFactory.getService(TRANSACTION_SERVICE);\n return transactionService.startSpan(name, type, options);\n }\n };\n\n _proto.getCurrentTransaction = function getCurrentTransaction() {\n if (this.isEnabled()) {\n var transactionService = this.serviceFactory.getService(TRANSACTION_SERVICE);\n return transactionService.getCurrentTransaction();\n }\n };\n\n _proto.captureError = function captureError(error) {\n if (this.isEnabled()) {\n var errorLogging = this.serviceFactory.getService(ERROR_LOGGING);\n return errorLogging.logError(error);\n }\n };\n\n _proto.addFilter = function addFilter(fn) {\n var configService = this.serviceFactory.getService(CONFIG_SERVICE);\n configService.addFilter(fn);\n };\n\n return ApmBase;\n}();\n\nexport { ApmBase as default };","import { createServiceFactory, bootstrap, isBrowser } from '@elastic/apm-rum-core';\nimport ApmBase from './apm-base';\n\nfunction getApmBase() {\n if (isBrowser && window.elasticApm) {\n return window.elasticApm;\n }\n\n var enabled = bootstrap();\n var serviceFactory = createServiceFactory();\n var apmBase = new ApmBase(serviceFactory, !enabled);\n\n if (isBrowser) {\n window.elasticApm = apmBase;\n }\n\n return apmBase;\n}\n\nvar apmBase = getApmBase();\nvar init = apmBase.init.bind(apmBase);\nexport default init;\nexport { init, apmBase, ApmBase, apmBase as apm };","import React, { createContext, useContext, useEffect, useState } from 'react'\nimport { ApmBase, init as initApm } from '@elastic/apm-rum'\nimport { EnvironmentContext, getEnvironment, EnvironmentName } from './EnvironmentProvider.js'\n\nexport const ApmContext = createContext({\n apm: null\n})\n\nconst ApmProvider = ({ children, environment }: { children: any; environment: EnvironmentName }) => {\n const env = useContext(EnvironmentContext)\n const [apm, setApm] = useState(null)\n\n if (localStorage['Sitecore.Components.ApmDisabled'] || location.hostname.match(/pages/)) return children\n\n useEffect(() => {\n setApm(\n initApm({\n serviceName: 'feaas-components-frontend',\n serverUrl: env.apmServer,\n environment: environment,\n active: environment !== 'localhost' && environment !== 'ci'\n })\n )\n }, [])\n\n useEffect(() => {\n if (!apm) return\n\n const transaction = apm.startTransaction(location.pathname, 'route-change')\n if (!transaction) return\n\n const span = transaction.startSpan('my-span')\n\n setTimeout(() => {\n span.end()\n transaction.end()\n }, 1000)\n }, [location.pathname])\n\n return {children}\n}\nexport default ApmProvider\n","import React, { useEffect, useRef, useState } from 'react'\nimport { Box } from '@chakra-ui/react'\nimport { useLibrary, useSDK } from '../hooks/useData.js'\n\n/**\n * Generic component that renders an iframe and receiving window messages from it.\n *\n * @param urlGetter - a callback to get the iframe url.\n * @param onMessageReceived - is called once a window message on iframe loaded url is received.\n * @param onFallback - fallback function to be run once a specific period has passed without messages (Make\n * sure that you include the messages check and the timeout logic)\n */\nconst MessageReceiverIframe = ({\n url,\n onMessageReceived,\n onMessageWaiting,\n onTimeout,\n timeout\n}: {\n url: string\n onMessageReceived: (message: { action: string; data: any }) => void\n onMessageWaiting: () => void\n onTimeout?: () => void\n timeout?: number\n}) => {\n const library = useLibrary()\n const sdk = useSDK()\n const iframeRef = useRef()\n\n useEffect(() => {\n if (url) {\n onMessageWaiting()\n const handler = (ev: MessageEvent<{ type: string; message: string }>) => {\n if (\n typeof ev.data === 'string' &&\n // get rid of events sent from frontend itself (frontend imports clientside)\n (ev.origin !== location.origin ||\n !(ev.source as Window).location.href.startsWith(location.origin + library.getPath())) &&\n // make sure that the message comes from this iframe or message comes from pages directly\n (url.startsWith(ev.origin) || ev.origin.startsWith(`https://pages`))\n ) {\n try {\n const json = JSON.parse(ev.data)\n onMessageReceived(json)\n } catch {\n sdk.log('FEAAS: Could not parse iframe message')\n }\n }\n }\n window.addEventListener('message', handler)\n\n if (onTimeout) {\n setTimeout(() => {\n onTimeout()\n }, timeout)\n }\n\n return () => window.removeEventListener('message', handler)\n }\n }, [url])\n\n // avoid opening render host iframe when within pages\n if (url.startsWith('https://xmc-') && location.hostname.includes('pages')) return\n\n return (\n \n \n \n )\n}\n\nexport default MessageReceiverIframe\n","import { DatasourceModel, ExternalComponent, ExternalComponentModel } from '@sitecore-feaas/sdk'\nimport MessageReceiverIframe from './MessageReceiverIframe.js'\nimport React, { useEffect, useState } from 'react'\nimport { useLibrary, useSDK } from '../hooks/useData.js'\n\nconst ByocRegistration = () => {\n const sdk = useSDK()\n const renderingHost = useSDK('renderingHost')\n const library = useLibrary()\n const registeredComponents = useSDK('renderingHost.registeredComponents')\n const expandedComponents = useSDK('renderingHost.expandedComponents')\n const registeredDatasources = useSDK('renderingHost.registeredDatasources')\n const [url, setUrl] = useState(library.getPreviewURL())\n\n // load url once rendering host fetching is done\n useEffect(() => {\n if (renderingHost.url) setUrl(library.getPreviewURL())\n }, [renderingHost.url, library.settings.externalPreviewURL])\n\n if (!url) return\n\n return (\n {\n renderingHost.set({ connectionStatus: 'loading' })\n }}\n onMessageReceived={(message) => {\n if (message.action === 'register-components') {\n const components = message.data.map((item: ExternalComponent) => ({\n id: item.name,\n ...item\n }))\n ExternalComponentModel.setComponents(components)\n ExternalComponentModel.updateComponents(registeredComponents, expandedComponents)\n sdk.log('FEAAS: Registered external components %O', registeredComponents)\n renderingHost.set({ connectionStatus: 'success' })\n } else if (message.action === 'register-datasources') {\n const datasources = message.data.map((d: any) => ({\n ...d,\n sample: d.sample || (d.schema ? DatasourceModel.schema.generate(d.schema) : null)\n }))\n DatasourceModel.setExternalDatasources(datasources)\n DatasourceModel.updateExternalDatasources(registeredDatasources)\n sdk.log('FEAAS: Registered external datasources %O', registeredDatasources)\n renderingHost.set({ connectionStatus: 'success' })\n }\n }}\n onTimeout={() => {\n if (renderingHost.connectionStatus === 'loading') {\n setUrl(library.getFallbackPreviewURL())\n /**\n * that's a second timeout in case the first finishes with no message,\n * wait same amount of time and if still no message, set status error\n */\n setTimeout(() => {\n if (renderingHost.connectionStatus === 'loading') {\n renderingHost.set({ connectionStatus: 'error' })\n }\n }, 10000)\n }\n }}\n timeout={10000}\n />\n )\n}\n\nexport default ByocRegistration\n","import { Auth0Provider } from '@auth0/auth0-react'\nimport { AppState } from '@auth0/auth0-react/dist/auth0-provider.js'\nimport { ChakraProvider, ChakraProviderProps, ChakraTheme, ModalProps } from '@chakra-ui/react'\nimport createCache from '@emotion/cache'\nimport { CacheProvider } from '@emotion/react'\nimport {\n AuthModel,\n DatasourceModel,\n ExternalComponent,\n ExternalComponentModel,\n LibraryModel\n} from '@sitecore-feaas/sdk'\nimport React, { Fragment, useMemo } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport type { CustomNavigateFunction } from '../../hooks/useWindowQueryUpdate.js'\nimport theme from '../../theme/index.js'\nimport Error from '../Error.js'\nimport MessageReceiverIframe from '../MessageReceiverIframe.js'\nimport ApmProvider from './ApmProvider.js'\nimport ConfirmationProvider from './ConfirmationProvider.js'\nimport { EnvironmentContext, EnvironmentName, environments, getEnvironment } from './EnvironmentProvider.js'\nimport LibraryProvider from './LibraryProvider.js'\nimport QueryStringProvider from './QueryStringProvider.js'\nimport SDKProvider, { SDKStatusCallback } from './SDKProvider.js'\nimport ByocRegistration from '../ByocRegistration.js'\nexport * from '../../exports.js'\nexport { AppContext }\nexport type { SDKStatusCallback }\n\ninterface FEAASContextProps {\n libraryId: LibraryModel['id']\n children?: any\n container?: HTMLElement | ShadowRoot\n backend?: string\n onStatusChange?: SDKStatusCallback\n auth?: Partial\n navigate?: (url: string, options?: object) => void\n chakraProps?: ChakraProviderProps\n modalProps?: Partial\n getTheme?: (theme: ChakraTheme) => ChakraTheme\n environment?: EnvironmentName\n handleErrors?: boolean\n}\n\nexport default function AppContext({\n children,\n libraryId,\n auth,\n onStatusChange,\n container,\n backend,\n navigate = (url: string, options?: object) => {},\n chakraProps,\n modalProps,\n environment = getEnvironment(),\n getTheme = (theme) => theme,\n handleErrors\n}: FEAASContextProps) {\n const chakraCache = useMemo(\n () =>\n /*@ts-ignore TS 4.9 FIXME*/\n createCache({\n key: 'feaas',\n container: container || document.head\n }),\n [container]\n )\n const onRedirectCallback = (appState: AppState) => {\n navigate(appState.returnTo, { replace: true })\n }\n const env = environments[environment]\n const Boundary = handleErrors ? ErrorBoundary : Fragment\n const BoundaryProps = handleErrors ? { FallbackComponent: Error } : undefined\n\n return (\n \n \n \n \n \n \n \n \n \n \n {children}\n \n \n \n \n \n \n \n \n \n \n \n )\n}\n"],"names":["bound01","n","max","isOnePointZero","isPercent","isPercentage","clamp01","val","boundAlpha","a","convertToPercentage","pad2","c","rgbToRgb","r","g","b","rgbToHsl","min","h","s","l","d","hue2rgb","p","q","t","hslToRgb","rgbToHsv","v","hsvToRgb","i","f","mod","rgbToHex","allow3Char","hex","rgbaToHex","allow4Char","convertDecimalToHex","convertHexToDecimal","parseIntFromHex","numberInputToObject","color","names","inputToRGB","rgb","ok","format","stringInputToObject","isValidCSSUnit","CSS_INTEGER","CSS_NUMBER","CSS_UNIT","PERMISSIVE_MATCH3","PERMISSIVE_MATCH4","matchers","named","match","TinyColor","opts","_a","R","G","B","RsRGB","GsRGB","BsRGB","alpha","hsv","hsl","fmt","x","rnd","_i","_b","key","value","formatSet","formattedString","hasAlpha","needsAlphaFormat","amount","hue","rgb1","rgb2","rgba","results","slices","part","ret","res","modification","background","fg","bg","result","increment","tinycolor","Tooltip","sitecoreTheme","extendTheme","FEAASStyles","props","mergeDeep","colorScheme","selected","size","defaultTheme","transformTheme","object","iterator","modified","copy","property","sitecoreThemeWithLightAsDefault","combinedTheme","pixelizedTheme","variants","mdiMapMarkerQuestionOutline","mdiLockOutline","mdiAlertCircleOutline","GenericErrorTemplate","title","subtext","text","variant","shortcuts","activeVariant","jsx","Container","jsxs","Flex","Box","Image","Heading","Text","getVariant","Error","error","resetErrorBoundary","navigate","useNavigate","useEffect","_c","e","VStack","Link","filePathToFileName","fileUrl","origin","cleanFilePath","filePath","isFileInline","normalizeStackFrames","stackFrames","frame","normalizeFunctionName","fnName","parts","isValidStackTrace","stackTraces","stackTrace","createStackTraces","stackParser","errorEvent","filename","lineno","colno","normalizedStackTraces","stack","fileName","lineNumber","columnNumber","_stack$functionName","functionName","cleanedFileName","filterInvalidFrames","frames","_ref","finallyConstructor","callback","constructor","reason","allSettled","arr","P","resolve","reject","args","remaining","then","setTimeoutFunc","isArray","noop","bind","fn","thisArg","Promise","doResolve","handle","self","deferred","cb","newValue","finale","len","Handler","onFulfilled","onRejected","promise","done","ex","prom","promiseFinally","err","local","isBrowser","PromisePollyfill","slice","PERF","isCORSSupported","xhr","byteToHex","bytesToHex","buffer","hexOctets","destination","rng","generateRandomId","length","id","getDtHeaderValue","span","dtVersion","dtUnSampledFlags","dtSampledFlags","flags","parseDtHeaderValue","parsed","sampled","isDtHeaderValid","header","getTSHeaderValue","sampleRate","NAMESPACE","SEPARATOR","setRequestHeader","target","name","checkSameOrigin","source","isSame","isPlatformSupported","setLabel","obj","skey","removeInvalidChars","valueType","getServerTimingInfo","serverTimingEntries","serverTimingInfo","entrySeparator","valueSeparator","_i2","_serverTimingEntries$","duration","description","timingValue","stripQueryStringFromUrl","url","isObject","isFunction","baseExtend","dst","objs","deep","ii","keys","j","jj","src","getElasticScript","scripts","sc","getCurrentScript","currentScript","extend","merge","isUndefined","getLatestSpan","spans","typeFilter","latestSpan","_i3","getLatestNonXHRSpan","type","getLatestXHRSpan","getEarliestSpan","earliestSpan","_i4","now","getTime","time","getDuration","start","end","scheduleMicroTask","isPerfTimelineSupported","isPerfTypeSupported","isBeaconInspectionEnabled","flagName","parsedUrl","isFlagSet","isDefaultPort","port","protocol","RULES","PROTOCOL_REGEX","Url","_this$extractProtocol","address","slashes","relative","location","instructions","index","instruction","parse","instLength","newIndex","hostname","_proto","REDACTED","userpass","username","password","globalVar","slugifyUrl","urlStr","depth","query","path","pathParts","redactString","wildcard","specialCharsRegex","digitsRegex","lowerCaseRegex","upperCaseRegex","redactedParts","redactedBefore","numberOfSpecialChars","numberOfDigits","numberofUpperCase","numberofLowerCase","lowerCaseRate","upperCaseRate","redacted","SCHEDULE","INVOKE","ADD_EVENT_LISTENER_STR","RESOURCE_INITIATOR_TYPES","REUSABILITY_THRESHOLD","MAX_SPAN_DURATION","PAGE_LOAD_DELAY","PAGE_LOAD","ROUTE_CHANGE","TYPE_CUSTOM","USER_INTERACTION","HTTP_REQUEST_TYPE","TEMPORARY_TYPE","NAME_UNKNOWN","TRANSACTION_TYPE_ORDER","OUTCOME_SUCCESS","OUTCOME_FAILURE","OUTCOME_UNKNOWN","USER_TIMING_THRESHOLD","TRANSACTION_START","TRANSACTION_END","CONFIG_CHANGE","QUEUE_FLUSH","QUEUE_ADD_TRANSACTION","XMLHTTPREQUEST","FETCH","HISTORY","EVENT_TARGET","CLICK","ERROR","BEFORE_EVENT","AFTER_EVENT","LOCAL_CONFIG_KEY","LONG_TASK","PAINT","MEASURE","NAVIGATION","RESOURCE","FIRST_CONTENTFUL_PAINT","LARGEST_CONTENTFUL_PAINT","FIRST_INPUT","LAYOUT_SHIFT","ERRORS","TRANSACTIONS","CONFIG_SERVICE","LOGGING_SERVICE","TRANSACTION_SERVICE","APM_SERVER","PERFORMANCE_MONITORING","ERROR_LOGGING","TRUNCATED_TYPE","KEYWORD_LIMIT","SESSION_TIMEOUT","HTTP_REQUEST_TIMEOUT","_excluded","_objectWithoutPropertiesLoose","excluded","sourceKeys","LEFT_SQUARE_BRACKET","RIGHT_SQUARE_BRACKET","EXTERNAL","HARD_NAVIGATION","getPortNumber","getResponseContext","perfTimingEntry","transferSize","encodedBodySize","decodedBodySize","serverTiming","respContext","serverTimingStr","getDestination","portNumber","ipv6Hostname","getResourceContext","data","entry","getExternalContext","method","response","context","statusCode","getNavigationContext","getPageContext","addSpanContext","addTransactionContext","transaction","_temp","configContext","pageContext","responseContext","entries","METADATA_MODEL","RESPONSE_MODEL","DESTINATION_MODEL","CONTEXT_MODEL","SPAN_MODEL","TRANSACTION_MODEL","ERROR_MODEL","truncate","limit","required","placeholder","isEmpty","replaceValue","currModel","truncateModel","model","childTarget","emptyArr","_loop","currKey","root","factory","module","this","_isNumber","StackFrame","require$$0","FIREFOX_SAFARI_STACK_REGEXP","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","_map","array","output","_filter","_indexOf","urlLike","regExp","filtered","line","tokens","locationParts","lineRE","lines","functionCall","argsRaw","IGNORE_KEYS","getErrorProperties","propertyFound","properties","ErrorLogging","apmServer","configService","transactionService","filteredFrames","culprit","lastFrame","message","errorMessage","errorType","errorContext","customProperties","currentTransaction","transactionContext","_this$_configService$","errorObject","_this","promiseRejectionEvent","prefix","messageOrError","ErrorLogging$1","Queue","onFlush","item","Queue$1","throttle","onThrottle","interval","counter","timeoutId","NDJSON","NDJSON$1","SpanBase","options","tags","ctx","k","_len","_key","endTime","SpanBase$1","_inheritsLoose","subClass","superClass","_setPrototypeOf","o","Span","_SpanBase","fields","Span$1","state","eventPairs","shouldCreateSpan","trStart","trEnd","baseTime","createNavigationTimingSpans","timings","createResourceTimingSpan","resourceTimingEntry","initiatorType","startTime","responseEnd","kind","spanName","isCapturedByPatching","resourceStartTime","requestPatchTime","isIntakeAPIEndpoint","createResourceTimingSpans","_entries$i","createUserTimingSpans","userTimingSpans","_entries$i2","NAVIGATION_TIMING_MARKS","COMPRESSED_NAV_TIMING_MARKS","getNavigationTimingMarks","timing","fetchStart","navigationStart","responseStart","marks","timingKey","m","getPageLoadMarks","captureNavigation","customMarks","_trStart","resourceEntries","userEntries","compressStackFrames","compressResponse","compressHTTP","http","compressed","status_code","compressContext","page","user","custom","service","compressMarks","compressedNtMarks","compressNavigationTimingMarks","compressAgentMarks","ntMarks","mark","mapping","agentMarks","fp","lp","compressMetadata","metadata","labels","agent","language","compressTransaction","spanData","tr","compressMetricsets","_transaction$experien","cls","fid","tbt","longtask","_transaction$session","sequence","compressError","exception","breakdowns","samples","isSpan","compressPayload","params","isCompressionStreamSupported","payload","headers","beforeSend","payloadStream","compressedStream","isResponseSuccessful","status","_extends","BYTE_LIMIT","shouldUseFetchWithKeepAlive","isFetchSupported","isKeepAliveSupported","calculateSize","sendFetchRequest","_ref$keepalive","keepalive","_ref$timeout","timeout","sendCredentials","timeoutConfig","controller","fetchResponse","responseText","bodyResponse","globalState","apmSymbol","isPropertyWritable","propertyDesc","attachOriginToPatched","patched","original","patchMethod","patchFn","proto","delegateName","delegate","desc","patchDelegate","XHR_IGNORE","XHR_SYNC","XHR_URL","XHR_METHOD","sendXHR","canSend","THROTTLE_INTERVAL","ApmServer","loggingService","queueLimit","flushInterval","events","endPoint","_this2","apmRequest","serverErrors","_ref2","_ref2$timeout","serviceName","environment","_this3","_this$getEndpoints","configEndpoint","localConfig","remoteConfig","etag","cfg","_this$throttleEvents","_this$throttleEvents2","errors","compress","_NDJSON$stringify","metricsets","metricset","transactions","_this4","_NDJSON$stringify2","_payload","_NDJSON$stringify3","event","filteredPayload","apiVersion","ndjson","metadataKey","ndjsonPayload","_this$getEndpoints2","intakeEndpoint","serverUrl","serverUrlPrefix","ApmServer$1","EventHandler","obs","EventHandler$1","getConfigFromScript","script","config","getDataAttributesFromNode","node","dataAttrs","dataRegex","attrs","attr","camelCasedkey","Config","scriptData","version","objKey","userContext","_userContext","email","customContext","_properties","transactionSampleRate","requiredKeys","allKeys","storage","prevConfig","ConfigService","LoggingService","spec","level","log","normalizedLevel","realMethod","LoggingService$1","_serviceCreators","serviceCreators","_factory$getService","ServiceFactory","_this$getService","logLevel","registerServices","serviceFactory","_serviceFactory$getSe","patchXMLHttpRequest","XMLHttpRequestPrototype","READY_STATE_CHANGE","LOAD","TIMEOUT","ABORT","invokeTask","task","scheduleTask","addListener","openNative","sendNative","patchFetch","handleResponseError","isAbortError","readStream","stream","reader","read","nativeFetch","input","init","fetchSelf","request","clonedResponse","body","patchHistory","nativePushState","patchEventHandler","alreadyPatched","patchAll","SIMILAR_SPAN_TO_TRANSACTION_RATIO","TRANSACTION_DURATION_THRESHOLD","groupSmallContinuouslySimilarSpans","originalSpans","transDuration","threshold","spanA","spanB","lastCount","lastSpan","isContinuouslySimilar","isLastSpan","adjustTransaction","filterdSpans","similarSpans","PerformanceMonitoring","endpoints","isOwnEndpoint","endpoint","requestUrl","isDtEnabled","dtOrigins","currentUrl","isSameOrigin","propagateTracestate","_data","_span","_target","outcome","headerName","headerValue","isHeaderValid","transactionStart","transactionData","adjustedTransaction","pageLoadBreakdowns","getValue","calculateSelfTime","_start","_end","span1","span2","spanEnd","spanStart","lastContinuousEnd","selfTime","groupSpans","spanMap","transactionSelfTime","subtype","getSpanBreakdown","transactionDetails","details","_ref$count","count","captureBreakdown","trDuration","current","_key$split","_spanMap$key","Transaction","markTime","trc","sid","_captureBreakdown","flag","taskId","deleted","Transaction$1","metrics","LONG_TASK_THRESHOLD","createLongTaskSpans","longtasks","agg","_longtasks$i","attribution","_attribution$","_name","containerType","containerName","containerId","createFirstInputDelaySpan","fidEntries","firstInput","processingStart","createTotalBlockingTimeSpan","tbtObject","tbtSpan","calculateTotalBlockingTime","longtaskEntries","blockingTime","calculateCumulativeLayoutShift","clsEntries","shouldCreateNewSession","captureObserverEntries","list","isHardNavigation","longTaskSpans","lcpEntries","lastLcpEntry","lcp","unloadDiff","fcpEntry","fcp","fidSpan","PerfEntryRecorder","TransactionService","logger","_tr$spans","_captureObserverEntri","presetOptions","perfOptions","isRedefined","redefineType","currentTypeOrder","redefineTypeOrder","fireOnstartHook","lastHiddenStart","pageLoadTransactionName","breakdownMetrics","session","sessionConfig","latestSpanEnd","transactionEndWithoutDelay","latestXHRSpan","latestXHRSpanEnd","transactionEnd","transactionName","ignoreList","element","TransactionService$1","_serviceFactory$getSe2","observePageVisibility","visibilityChangeHandler","onPageHidden","pageHideHandler","useCapture","unobserve","observePageClicks","clickHandler","createUserInteractionTransaction","eventName","_getTransactionMetada","getTransactionMetadata","tagName","classes","getInstrumentationFlags","instrument","disabledInstrumentations","_flags","enabled","bootstrap","createServiceFactory","registerPerfServices","registerErrorServices","ApmBase","disable","_this$serviceFactory$","isConfigActive","performanceMonitoring","errorLogging","sendPageLoad","_this$serviceFactory$2","_config2","_configService$valida","invalid","_invalid$","allowed","sendPageLoadMetrics","_config","_this$serviceFactory$3","_configService$valida2","missing","unknown","separator","_message","getApmBase","apmBase","ApmContext","createContext","ApmProvider","children","env","useContext","EnvironmentContext","apm","setApm","useState","initApm","MessageReceiverIframe","onMessageReceived","onMessageWaiting","onTimeout","library","useLibrary","sdk","useSDK","iframeRef","useRef","handler","ev","json","ByocRegistration","renderingHost","registeredComponents","expandedComponents","registeredDatasources","setUrl","components","ExternalComponentModel","datasources","DatasourceModel","AppContext","libraryId","auth","onStatusChange","container","backend","chakraProps","modalProps","getEnvironment","getTheme","theme","handleErrors","chakraCache","useMemo","createCache","onRedirectCallback","appState","environments","Boundary","ErrorBoundary","Fragment","BoundaryProps","Auth0Provider","CacheProvider","QueryStringProvider","ChakraProvider","SDKProvider","LibraryProvider","ConfirmationProvider"],"mappings":"sZAIO,SAASA,EAAQC,EAAGC,EAAK,CACxBC,GAAeF,CAAC,IAChBA,EAAI,QAER,IAAIG,EAAYC,GAAaJ,CAAC,EAO9B,OANAA,EAAIC,IAAQ,IAAMD,EAAI,KAAK,IAAIC,EAAK,KAAK,IAAI,EAAG,WAAWD,CAAC,CAAC,CAAC,EAE1DG,IACAH,EAAI,SAAS,OAAOA,EAAIC,CAAG,EAAG,EAAE,EAAI,KAGpC,KAAK,IAAID,EAAIC,CAAG,EAAI,KACb,GAGPA,IAAQ,IAIRD,GAAKA,EAAI,EAAKA,EAAIC,EAAOA,EAAMD,EAAIC,GAAO,WAAW,OAAOA,CAAG,CAAC,EAKhED,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J,YAAa,aACf,EACA,SAAU,CACR,UAAW,CACT,GAAI,iBACJ,YAAa,cACb,MAAO,gBACT,CACF,CACF,CACF,EACA,aAAc,CACZ,YAAa,SACf,EACA,MAAO,CACL,GAAI,CACF,MAAO,CAAE,SAAU,IAAK,CAC1B,CACF,CACF,EACA,OAAQ,CACN,SAAU,CACR,QAAS,CACP,MAAO,CACL,YAAa,oBACb,GAAI,QACJ,OAAQ,CACN,YAAa,yBACf,CACF,CACF,CACF,EACA,aAAc,CACZ,iBAAkB,aACpB,CACF,EACA,SAAU,CACR,aAAc,CACZ,WAAY,iBACZ,SAAU,gBACZ,CACF,EACA,QAAS,CACP,UAAW,CACT,MAAO,aACT,CACF,EACA,OAAQ,CACN,UAAW,CACT,MAAO,CACL,GAAI,oBACJ,SAAU,CACR,GAAI,MACN,CACF,CACF,EACA,aAAc,CACZ,YAAa,MACf,CACF,EACA,MAAO,CACL,UAAW,CACT,GAAI,CACF,GAAI,CACF,SAAU,KACV,WAAY,WACZ,cAAe,OACf,MAAO,2BACP,cAAe,SACf,YAAa,qBACf,EACA,GAAI,CACF,YAAa,qBACf,CACF,CACF,EACA,SAAU,CACR,QAAS,CACP,GAAI,CACF,GAAI,CACF,YAAa,MACf,EACA,GAAI,CACF,YAAa,MACf,CACF,CACF,CACF,CACF,EACA,KAAM,CACJ,aAAc,CACZ,YAAa,SACf,EACA,SAAU,CACR,KAAM,CACJ,QAAS,CACP,YAAa,qBACf,EACA,IAAK,CACH,WAAY,UACd,CACF,EACA,eAAgB,CACd,IAAK,CACH,MAAO,gBACT,CACF,EACA,gBAAiB,CACf,IAAK,CACH,MAAO,gBACT,CACF,CACF,CACF,EACA,IAAK,CACH,aAAc,CACZ,YAAa,YACf,EAMA,MAAO,CACL,GAAI,CACF,UAAW,CACT,SAAU,KACV,GAAI,KACN,CACF,EACA,GAAI,CACF,UAAW,CACT,SAAU,IACZ,CACF,EACA,GAAI,CACF,UAAW,CACT,SAAU,IACZ,CACF,CACF,EACA,S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