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ACP,SAAU,kCACV,CAACA,CAAmB,EAAG,qBACzB,EACA,eAAgB,CACd,CAACA,CAAmB,EAAG,sCACzB,EACA,cAAe,CACb,SAAU,oCACZ,EACA,eAAgB,CACd,SAAU,qCACZ,EACA,SAAU,CACR,MAAO,CACL,SAAU,kCACV,CAACA,CAAmB,EAAG,qBACzB,EACA,WAAY,CACV,SAAU,uCACV,CAACA,CAAmB,EAAG,0BACzB,EACA,YAAa,CACX,SAAU,wCACV,CAACA,CAAmB,EAAG,2BACzB,CACF,EACA,uBAAwB,CACtB,CAACA,CAAmB,EAAG,wCACzB,CACF,EACA,sBAAuB,CACrB,KAAM,CAAE,QAAS,IAAM,4BAA6B,EACpD,SAAU,CACR,QAAS,+BACX,EACA,WAAY,CACV,QAAS,sBACX,EACA,gBAAiB,CACf,QAAS,kBACX,CACF,EACA,eAAgB,CACd,MAAO,CACL,SAAU,6BACZ,CACF,EACA,WAAY,CACV,SAAU,CACR,SAAU,CACR,wBAAyB,CACvB,CAACA,CAAmB,EAAG,2CACzB,EACA,eAAgB,CACd,CAACA,CAAmB,EAAG,iCACzB,EACA,IAAK,CACH,CAACA,CAAmB,EAAG,cACzB,EACA,IAAK,CACH,CAACA,CAAmB,EAAG,cACzB,EACA,MAAO,CACL,CAACA,CAAmB,EAAG,gBACzB,EACA,YAAa,CACX,CAACA,CAAmB,EAAG,uBACzB,EACA,OAAQ,CACN,CAACA,CAAmB,EAAG,iBACzB,EACA,WAAY,CACV,CAACA,CAAmB,EAAG,sBACzB,EACA,KAAM,CACJ,CAACA,CAAmB,EAAG,sBACzB,CACF,CACF,EACA,uBAAwB,CACtB,SAAU,CACR,SAAU,2CACV,CAACA,CAAmB,EAAG,8BACzB,CACF,EACA,OAAQ,CACN,aAAc,CACZ,CAACA,CAAmB,EAAG,UACzB,CACF,EACA,WAAY,CACV,WAAY,CACV,mBAAoB,CAClB,CAACA,CAAmB,EAAG,4BACzB,EACA,aAAc,CACZ,SAAU,2BACZ,EACA,eAAgB,CAC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SAAU,+BACZ,CACF,EACA,KAAM,CACJ,SAAU,CACR,cAAe,CACb,eAAgB,CACd,SAAU,2CACZ,CACF,CACF,CACF,CACF,EACA,WAAY,CACV,IAAK,CACH,CAACA,CAAmB,EAAG,aACzB,EACA,WAAY,CACV,SAAWE,GAAkB,yBAAyBA,CAAK,EAC7D,CACF,EACA,qBAAsB,CACpB,QAAS,CACP,SAAU,4BACZ,EACA,KAAM,CACJ,SAAU,uBACZ,CACF,EACA,mBAAoB,CAClB,KAAM,CACJ,SAAU,qDACZ,EACA,cAAe,CACb,SAAU,iEACZ,EACA,cAAe,CACb,SAAU,iEACZ,EACA,YAAa,CACX,SAAU,+DACZ,CACF,EACA,gBAAiB,CACf,oBAAqB,CACnB,CAACF,CAAmB,EAAG,wBACzB,CACF,EACA,oBAAqB,CACnB,gBAAiB,CACf,qBAAsB,CACpB,QAAS,sDACX,EACA,kBAAmB,CACjB,QAAS,2DACX,EACA,qBAAsB,CACpB,QAAS,yDACX,EACA,YAAa,CACX,QAAS,2CACX,EACA,wBAAyB,CACvB,QAAS,4DACX,EACA,aAAc,CACZ,QAAS,4CACX,EACA,aAAc,CACZ,QAAS,4CACX,EACA,aAAc,CACZ,QAAS,6CACX,EACA,cAAe,CACb,QAAS,8CACX,EACA,iBAAkB,CAChB,SAAU,gDACZ,EACA,8BAA+B,CAC7B,QAAS,gEACX,EACA,mCAAoC,CAClC,QAAS,6DACX,EACA,gCAAiC,CAC/B,QAAS,0DACX,EACA,sBAAuB,CACrB,QAAS,2DACX,EACA,0BAA2B,CACzB,UAAW,CACT,QAAS,4CACX,EACA,UAAW,CACT,QAAS,yCACX,EACA,kBAAmB,CACjB,QAAS,kDACX,EACA,yBAA0B,CACxB,QAAS,0DACX,EACA,iBAAkB,CAChB,QAAS,iDACX,EACA,YAAa,CACX,QAAS,kDACX,EACA,YAAa,CACX,QAAS,kDACX,CACF,CACF,EACA,cAAe,CACb,IAAK,CACH,SAAW3X,GAAgB,uBAAuBA,CAAG,EAC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cAG/CC,EAAmB,CAC9BC,EACAC,EACAhtC,OAEA,MAA4D+sC,EAAYC,EAAgBhtC,CAAO,EAEpFitC,EAAc,I,4ECxCZ,SAASC,GAAY,CAClC,OAAO,IAAI,IAAO,IAAI,IAAI,iBAA+D,CAAC,CAC5F,CCFe,SAASC,GAA4B,CAElD,MAAO,CADO,CAAE,GAAI,QAAS,KAAM,QAAS,KAAMD,CAAU,CAC/C,CACf,C","sources":["webpack://grafana/./packages/grafana-data/src/datetime/common.ts","webpack://grafana/./packages/grafana-data/src/datetime/datemath.ts","webpack://grafana/./packages/grafana-data/src/datetime/formats.ts","webpack://grafana/./packages/grafana-data/src/datetime/formatter.ts","webpack://grafana/./packages/grafana-data/src/datetime/moment_wrapper.ts","webpack://grafana/./packages/grafana-data/src/datetime/parser.ts","webpack://grafana/./packages/grafana-data/src/datetime/rangeutil.ts","webpack://grafana/./packages/grafana-data/src/events/EventBus.ts","webpack://grafana/./packages/grafana-data/src/events/eventFactory.ts","webpack://grafana/./packages/grafana-data/src/events/types.ts","webpack://grafana/./packages/grafana-data/src/monaco/languageRegistry.ts","webpack://grafana/./packages/grafana-data/src/rbac/rbac.ts","webpack://grafana/./packages/grafana-data/src/text/sanitize.ts","webpack://grafana/./packages/grafana-data/src/text/string.ts","webpack://grafana/./packages/grafana-data/src/themes/colorManipulator.ts","webpack://grafana/./packages/grafana-data/src/themes/context.tsx","webpack://grafana/./packages/grafana-data/src/themes/breakpoints.ts","webpack://grafana/./packages/grafana-data/src/themes/palette.ts","webpack://grafana/./packages/grafana-data/src/themes/createColors.ts","webpack://grafana/./packages/grafana-data/src/themes/createComponents.ts","webpack://grafana/./packages/grafana-data/src/themes/createShadows.ts","webpack://grafana/./packages/grafana-data/src/themes/createShape.ts","webpack://grafana/./packages/grafana-data/src/themes/createSpacing.ts","webpack://grafana/./packages/grafana-data/src/themes/createTransitions.ts","webpack://grafana/./packages/grafana-data/src/themes/createTypography.ts","webpack://grafana/./packages/grafana-data/src/themes/createV1Theme.ts","webpack://grafana/./packages/grafana-data/src/themes/createVisualizationColors.ts","webpack://grafana/./packages/grafana-data/src/themes/zIndex.ts","webpack://grafana/./packages/grafana-data/src/themes/createTheme.ts","webpack://grafana/./packages/grafana-data/src/themes/themeDefinitions/aubergine.ts","webpack://grafana/./packages/grafana-data/src/themes/themeDefinitions/debug.ts","webpack://grafana/./packages/grafana-data/src/themes/themeDefinitions/desertbloom.ts","webpack://grafana/./packages/grafana-data/src/themes/themeDefinitions/gildedgrove.ts","webpack://grafana/./packages/grafana-data/src/themes/themeDefinitions/mars.ts","webpack://grafana/./packages/grafana-data/src/themes/themeDefinitions/matrix.ts","webpack://grafana/./packages/grafana-data/src/themes/themeDefinitions/sapphiredusk.ts","webpack://grafana/./packages/grafana-data/src/themes/themeDefinitions/synthwave.ts","webpack://grafana/./packages/grafana-data/src/themes/themeDefinitions/tron.ts","webpack://grafana/./packages/grafana-data/src/themes/themeDefinitions/victorian.ts","webpack://grafana/./packages/grafana-data/src/themes/themeDefinitions/zen.ts","webpack://grafana/./packages/grafana-data/src/themes/themeDefinitions/gloom.ts","webpack://grafana/./packages/grafana-data/src/themes/registry.ts","webpack://grafana/./packages/grafana-data/src/types/dataFrame.ts","webpack://grafana/./packages/grafana-data/src/types/fieldColor.ts","webpack://grafana/./packages/grafana-data/src/types/icon.ts","webpack://grafana/./packages/grafana-data/src/types/orgs.ts","webpack://grafana/./packages/grafana-data/src/types/plugin.ts","webpack://grafana/./packages/grafana-data/src/types/theme.ts","webpack://grafana/./packages/grafana-data/src/types/time.ts","webpack://grafana/./packages/grafana-data/src/utils/Registry.ts","webpack://grafana/./packages/grafana-data/src/utils/deprecationWarning.ts","webpack://grafana/./packages/grafana-data/src/utils/selectUtils.ts","webpack://grafana/./packages/grafana-data/src/valueFormats/symbolFormatters.ts","webpack://grafana/./packages/grafana-data/src/valueFormats/arithmeticFormatters.ts","webpack://grafana/./packages/grafana-data/src/valueFormats/dateTimeFormatters.ts","webpack://grafana/./packages/grafana-data/src/valueFormats/categories.ts","webpack://grafana/./packages/grafana-data/src/valueFormats/valueFormats.ts","webpack://grafana/./packages/grafana-e2e-selectors/src/resolver.ts","webpack://grafana/./packages/grafana-e2e-selectors/src/selectors/constants.ts","webpack://grafana/./packages/grafana-e2e-selectors/src/selectors/components.ts","webpack://grafana/./packages/grafana-e2e-selectors/src/selectors/pages.ts","webpack://grafana/./packages/grafana-e2e-selectors/src/selectors/index.ts","webpack://grafana/./packages/grafana-runtime/src/config.ts","webpack://grafana/./packages/grafana-runtime/src/services/appEvents.ts","webpack://grafana/./packages/grafana-runtime/src/services/backendSrv.ts","webpack://grafana/./packages/grafana-runtime/src/utils/licensing.ts","webpack://grafana/./packages/grafana-schema/src/common/common.gen.ts","webpack://grafana/./packages/grafana-ui/src/components/Button/Button.tsx","webpack://grafana/./packages/grafana-ui/src/components/ErrorBoundary/ErrorWithStack.tsx","webpack://grafana/./packages/grafana-ui/src/components/Forms/commonStyles.ts","webpack://grafana/./packages/grafana-ui/src/components/Icon/Icon.tsx","webpack://grafana/./packages/grafana-ui/src/components/Icon/utils.ts","webpack://grafana/./packages/grafana-ui/src/components/IconButton/IconButton.tsx","webpack://grafana/./packages/grafana-ui/src/components/Input/AutoSizeInputContext.ts","webpack://grafana/./packages/grafana-ui/src/components/Input/Input.tsx","webpack://grafana/./packages/grafana-ui/src/components/Layout/Box/Box.tsx","webpack://grafana/./packages/grafana-ui/src/components/Layout/Stack/Stack.tsx","webpack://grafana/./packages/grafana-ui/src/components/Layout/utils/responsiveness.tsx","webpack://grafana/./packages/grafana-ui/src/components/Layout/utils/styles.ts","webpack://grafana/./packages/grafana-ui/src/components/LoadingPlaceholder/LoadingPlaceholder.tsx","webpack://grafana/./packages/grafana-ui/src/components/Monaco/suggestions.ts","webpack://grafana/./packages/grafana-ui/src/components/Monaco/CodeEditor.tsx","webpack://grafana/./packages/grafana-ui/src/utils/useAsyncDependency.ts","webpack://grafana/./packages/grafana-ui/src/components/Monaco/ReactMonacoEditorLazy.tsx","webpack://grafana/./packages/grafana-ui/src/components/Monaco/types.ts","webpack://grafana/./packages/grafana-ui/src/components/Portal/Portal.tsx","webpack://grafana/./packages/grafana-ui/src/components/ScrollContainer/ScrollIndicators.tsx","webpack://grafana/./packages/grafana-ui/src/components/ScrollContainer/ScrollContainer.tsx","webpack://grafana/./packages/grafana-ui/src/components/Select/MultiValue.tsx","webpack://grafana/./packages/grafana-ui/src/components/Select/CustomInput.tsx","webpack://grafana/./packages/grafana-ui/src/components/Select/DropdownIndicator.tsx","webpack://grafana/./packages/grafana-ui/src/components/Select/IndicatorsContainer.tsx","webpack://grafana/./packages/grafana-ui/src/components/Select/InputControl.tsx","webpack://grafana/./packages/grafana-ui/src/components/Select/SelectOptionGroup.tsx","webpack://grafana/./packages/grafana-ui/src/components/Select/SelectOptionGroupHeader.tsx","webpack://grafana/./packages/grafana-ui/src/components/Select/ValueContainer.tsx","webpack://grafana/./packages/grafana-ui/src/components/Select/utils.ts","webpack://grafana/./packages/grafana-ui/src/components/Select/SelectBase.tsx","webpack://grafana/./packages/grafana-ui/src/components/Select/Select.tsx","webpack://grafana/./packages/grafana-ui/src/components/Select/SelectContainer.tsx","webpack://grafana/./packages/grafana-ui/src/components/Select/SelectMenu.tsx","webpack://grafana/./packages/grafana-ui/src/utils/useDelayedSwitch.ts","webpack://grafana/./packages/grafana-ui/src/components/Select/SingleValue.tsx","webpack://grafana/./packages/grafana-ui/src/components/Select/getSelectStyles.ts","webpack://grafana/./packages/grafana-ui/src/components/Select/resetSelectStyles.ts","webpack://grafana/./packages/grafana-ui/src/components/Select/types.ts","webpack://grafana/./packages/grafana-ui/src/components/Spinner/Spinner.tsx","webpack://grafana/./packages/grafana-ui/src/components/Text/TruncatedText.tsx","webpack://grafana/./packages/grafana-ui/src/components/Text/Text.tsx","webpack://grafana/./packages/grafana-ui/src/components/Text/utils.ts","webpack://grafana/./packages/grafana-ui/src/components/Tooltip/Tooltip.tsx","webpack://grafana/./packages/grafana-ui/src/components/UsersIndicator/UserIcon.tsx","webpack://grafana/./packages/grafana-ui/src/components/transitions/FadeTransition.tsx","webpack://grafana/./packages/grafana-ui/src/components/transitions/SlideOutTransition.tsx","webpack://grafana/./packages/grafana-ui/src/themes/ThemeContext.tsx","webpack://grafana/./packages/grafana-ui/src/themes/mixins.ts","webpack://grafana/./packages/grafana-ui/src/themes/stylesFactory.ts","webpack://grafana/./packages/grafana-ui/src/types/icon.ts","webpack://grafana/./packages/grafana-ui/src/utils/i18n.tsx","webpack://grafana/./packages/grafana-ui/src/utils/keyframes.ts","webpack://grafana/./packages/grafana-ui/src/utils/tooltipUtils.ts","webpack://grafana/./public/app/core/app_events.ts","webpack://grafana/./public/app/core/config.ts","webpack://grafana/./public/app/core/monacoEnv.ts","webpack://grafana/./public/app/core/profiler.ts","webpack://grafana/./public/app/core/services/context_srv.ts","webpack://grafana/./public/app/core/time_series2.ts","webpack://grafana/./public/app/core/trustedTypePolicies.ts","webpack://grafana/./public/app/core/utils/ConfigProvider.tsx","webpack://grafana/./public/app/core/utils/CorsWorker.ts","webpack://grafana/./public/app/core/utils/auth.ts","webpack://grafana/./public/app/types/accessControl.ts","webpack://grafana/./public/app/types/acl.ts","webpack://grafana/./public/app/types/dashboard.ts","webpack://grafana/./public/app/types/events.ts","webpack://grafana/./public/app/types/explore.ts","webpack://grafana/./public/app/types/serviceaccount.ts","webpack://grafana/./public/app/types/appNotifications.ts","webpack://grafana/./public/app/types/store.ts","webpack://grafana/./public/lib/monaco-languages/kusto.ts","webpack://grafana/./public/lib/monaco-languages/index.ts"],"sourcesContent":["import { isEmpty } from 'lodash';\n\nimport { TimeZone, DefaultTimeZone } from '../types/time';\n\n/**\n * Used for helper functions handling time zones.\n *\n * @public\n */\nexport interface TimeZoneOptions {\n /**\n * Specify this if you want to override the timeZone used when parsing or formatting\n * a date and time value. If no timeZone is set, the default timeZone for the current\n * user is used.\n */\n timeZone?: TimeZone;\n}\n\n/**\n * The type describing date and time options. Used for all the helper functions\n * available to parse or format date and time values.\n *\n * @public\n */\nexport interface DateTimeOptions extends TimeZoneOptions {\n /**\n * Specify a {@link https://momentjs.com/docs/#/displaying/format | momentjs} format to\n * use a custom formatting pattern or parsing pattern. If no format is set,\n * then system configured default format is used.\n */\n format?: string;\n}\n\n/**\n * The type to describe the time zone resolver function that will be used to access\n * the default time zone of a user.\n *\n * @public\n */\nexport type TimeZoneResolver = () => TimeZone | undefined;\n\nlet defaultTimeZoneResolver: TimeZoneResolver = () => DefaultTimeZone;\n\n/**\n * Used by Grafana internals to set the {@link TimeZoneResolver} to access the current\n * user timeZone.\n *\n * @internal\n */\nexport const setTimeZoneResolver = (resolver: TimeZoneResolver) => {\n defaultTimeZoneResolver = resolver ?? defaultTimeZoneResolver;\n};\n\n/**\n * Used to get the current selected time zone. If a valid time zone is passed in the\n * options it will be returned. If no valid time zone is passed either the time zone\n * configured for the user account will be returned or the default for Grafana.\n *\n * @public\n */\nexport const getTimeZone = <T extends TimeZoneOptions>(options?: T): TimeZone => {\n if (options?.timeZone && !isEmpty(options.timeZone)) {\n return options.timeZone;\n }\n return defaultTimeZoneResolver() ?? DefaultTimeZone;\n};\n","import { isDate } from 'lodash';\n\nimport { TimeZone } from '@grafana/schema';\n\nimport {\n DateTime,\n dateTime,\n dateTimeAsMoment,\n dateTimeForTimeZone,\n DateTimeInput,\n DurationUnit,\n isDateTime,\n ISO_8601,\n} from './moment_wrapper';\n\nconst units: string[] = ['y', 'M', 'w', 'd', 'h', 'm', 's', 'Q'] satisfies DurationUnit[];\n\nconst isDurationUnit = (value: string): value is DurationUnit => {\n return units.includes(value);\n};\n\n/**\n * Determine if a string contains a relative date time.\n * @param text\n */\nexport function isMathString(text: string | DateTime | Date): boolean {\n if (!text) {\n return false;\n }\n\n if (typeof text === 'string' && (text.substring(0, 3) === 'now' || text.includes('||'))) {\n return true;\n } else {\n return false;\n }\n}\n\n/**\n * @deprecated use toDateTime instead\n * Parses different types input to a moment instance. There is a specific formatting language that can be used\n * if text arg is string. See unit tests for examples.\n * @param text\n * @param roundUp See parseDateMath function.\n * @param timezone Only string 'utc' is acceptable here, for anything else, local timezone is used.\n */\nexport function parse(\n text?: string | DateTime | Date | null,\n roundUp?: boolean,\n timezone?: TimeZone,\n fiscalYearStartMonth?: number\n): DateTime | undefined {\n if (!text) {\n return undefined;\n }\n return toDateTime(text, { roundUp, timezone, fiscalYearStartMonth });\n}\n\nexport interface ConversionOptions {\n /**\n * Set the time to endOf time unit, otherwise to startOf time unit.\n */\n roundUp?: boolean;\n /**\n * Only string 'utc' is acceptable here, for anything else, local timezone is used.\n */\n timezone?: TimeZone;\n /**\n * Setting for which month is the first month of the fiscal year.\n */\n fiscalYearStartMonth?: number;\n /**\n * DateTimeInput to use as now. Useful when parsing multiple values and now needs to be the same. Without this, comparing results from subsequent parses is not guaranteed to be deterministic.\n */\n now?: DateTimeInput;\n}\n\n/**\n * @param dateTimeRep A DateTime object, a Date object or a string representation of a specific time.\n * @param options Options for converting to DateTime\n * @returns A DateTime object if possible, undefined if not.\n */\nexport function toDateTime(dateTimeRep: string | DateTime | Date, options: ConversionOptions): DateTime | undefined {\n if (typeof dateTimeRep !== 'string') {\n if (isDateTime(dateTimeRep)) {\n return dateTimeRep;\n }\n\n if (isDate(dateTimeRep)) {\n return dateTime(dateTimeRep);\n }\n\n // We got some non string which is not a moment nor Date. TS should be able to check for that but not always.\n return undefined;\n } else {\n let time: DateTime;\n let mathString = '';\n let index = -1;\n let parseString = '';\n\n if (dateTimeRep.substring(0, 3) === 'now') {\n time = dateTimeForTimeZone(options.timezone, options.now);\n mathString = dateTimeRep.substring('now'.length);\n } else {\n index = dateTimeRep.indexOf('||');\n if (index === -1) {\n parseString = dateTimeRep;\n mathString = ''; // nothing else\n } else {\n parseString = dateTimeRep.substring(0, index);\n mathString = dateTimeRep.substring(index + 2);\n }\n // We're going to just require ISO8601 timestamps, k?\n time = dateTime(parseString, ISO_8601);\n }\n\n if (!mathString.length) {\n return time;\n }\n\n return parseDateMath(mathString, time, options.roundUp, options.fiscalYearStartMonth);\n }\n}\n\n/**\n * Checks if text is a valid date which in this context means that it is either a Moment instance or it can be parsed\n * by parse function. See parse function to see what is considered acceptable.\n * @param text\n */\nexport function isValid(text: string | DateTime): boolean {\n const date = parse(text);\n if (!date) {\n return false;\n }\n\n if (isDateTime(date)) {\n return date.isValid();\n }\n\n return false;\n}\n\n/**\n * Parses math part of the time string and shifts supplied time according to that math. See unit tests for examples.\n * @param mathString\n * @param time\n * @param roundUp If true it will round the time to endOf time unit, otherwise to startOf time unit.\n */\nexport function parseDateMath(\n mathString: string,\n time: DateTime,\n roundUp?: boolean,\n fiscalYearStartMonth = 0\n): DateTime | undefined {\n const strippedMathString = mathString.replace(/\\s/g, '');\n const result = dateTime(time);\n let i = 0;\n const len = strippedMathString.length;\n\n while (i < len) {\n const c = strippedMathString.charAt(i++);\n let type;\n let num;\n let unitString: string;\n let isFiscal = false;\n\n if (c === '/') {\n type = 0;\n } else if (c === '+') {\n type = 1;\n } else if (c === '-') {\n type = 2;\n } else {\n return undefined;\n }\n\n if (isNaN(parseInt(strippedMathString.charAt(i), 10))) {\n num = 1;\n } else if (strippedMathString.length === 2) {\n num = parseInt(strippedMathString.charAt(i), 10);\n } else {\n const numFrom = i;\n while (!isNaN(parseInt(strippedMathString.charAt(i), 10))) {\n i++;\n if (i > 10) {\n return undefined;\n }\n }\n num = parseInt(strippedMathString.substring(numFrom, i), 10);\n }\n\n if (type === 0) {\n // rounding is only allowed on whole, single, units (eg M or 1M, not 0.5M or 2M)\n if (num !== 1) {\n return undefined;\n }\n }\n\n unitString = strippedMathString.charAt(i++);\n\n if (unitString === 'f') {\n unitString = strippedMathString.charAt(i++);\n isFiscal = true;\n }\n\n const unit = unitString;\n\n if (isDurationUnit(unit)) {\n if (type === 0) {\n if (isFiscal) {\n roundToFiscal(fiscalYearStartMonth, result, unit, roundUp);\n } else {\n if (roundUp) {\n result.endOf(unit);\n } else {\n result.startOf(unit);\n }\n }\n } else if (type === 1) {\n result.add(num, unit);\n } else if (type === 2) {\n result.subtract(num, unit);\n }\n } else {\n return undefined;\n }\n }\n return result;\n}\n\nexport function roundToFiscal(fyStartMonth: number, dateTime: DateTime, unit: string, roundUp: boolean | undefined) {\n switch (unit) {\n case 'y':\n if (roundUp) {\n roundToFiscal(fyStartMonth, dateTime, unit, false)?.add(11, 'M').endOf('M');\n } else {\n dateTime.subtract((dateTimeAsMoment(dateTime).month() - fyStartMonth + 12) % 12, 'M').startOf('M');\n }\n return dateTime;\n case 'Q':\n if (roundUp) {\n roundToFiscal(fyStartMonth, dateTime, unit, false)?.add(2, 'M').endOf('M');\n } else {\n // why + 12? to ensure this number is always a positive offset from fyStartMonth\n dateTime.subtract((dateTimeAsMoment(dateTime).month() - fyStartMonth + 12) % 3, 'M').startOf('M');\n }\n return dateTime;\n default:\n return undefined;\n }\n}\n","export interface SystemDateFormatSettings {\n fullDate: string;\n interval: {\n millisecond: string;\n second: string;\n minute: string;\n hour: string;\n day: string;\n month: string;\n year: string;\n };\n useBrowserLocale: boolean;\n}\n\nconst DEFAULT_SYSTEM_DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss';\nconst DEFAULT_SYSTEM_DATE_MS_FORMAT = 'YYYY-MM-DD HH:mm:ss.SSS';\n\nexport class SystemDateFormatsState {\n fullDate = DEFAULT_SYSTEM_DATE_FORMAT;\n fullDateMS = DEFAULT_SYSTEM_DATE_MS_FORMAT;\n interval = {\n millisecond: 'HH:mm:ss.SSS',\n second: 'HH:mm:ss',\n minute: 'HH:mm',\n hour: 'MM/DD HH:mm',\n day: 'MM/DD',\n month: 'YYYY-MM',\n year: 'YYYY',\n };\n\n update(settings: SystemDateFormatSettings) {\n this.fullDate = settings.fullDate;\n this.interval = settings.interval;\n\n if (settings.useBrowserLocale) {\n this.useBrowserLocale();\n }\n }\n\n useBrowserLocale() {\n this.fullDate = localTimeFormat({\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n });\n\n // ES5 doesn't support `DateTimeFormatOptions.fractionalSecondDigits` so we have to use\n // a hack with string replacement.\n this.fullDateMS = this.fullDate.replace('ss', 'ss.SSS');\n\n this.interval.millisecond = localTimeFormat(\n { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false },\n null,\n this.interval.second\n ).replace('ss', 'ss.SSS');\n this.interval.second = localTimeFormat(\n { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false },\n null,\n this.interval.second\n );\n this.interval.minute = localTimeFormat(\n { hour: '2-digit', minute: '2-digit', hour12: false },\n null,\n this.interval.minute\n );\n this.interval.hour = localTimeFormat(\n { month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', hour12: false },\n null,\n this.interval.hour\n );\n this.interval.day = localTimeFormat({ month: '2-digit', day: '2-digit', hour12: false }, null, this.interval.day);\n this.interval.month = localTimeFormat(\n { year: 'numeric', month: '2-digit', hour12: false },\n null,\n this.interval.month\n );\n }\n\n getTimeFieldUnit(useMsResolution?: boolean) {\n return `time:${useMsResolution ? this.fullDateMS : this.fullDate}`;\n }\n}\n\n/**\n * localTimeFormat helps to generate date formats for momentjs based on browser's locale\n *\n * @param locale browser locale, or default\n * @param options DateTimeFormatOptions to format date\n * @param fallback default format if Intl API is not present\n */\nexport function localTimeFormat(\n options: Intl.DateTimeFormatOptions,\n locale?: string | string[] | null,\n fallback?: string\n): string {\n if (missingIntlDateTimeFormatSupport()) {\n return fallback ?? DEFAULT_SYSTEM_DATE_FORMAT;\n }\n\n if (!locale && navigator) {\n locale = [...navigator.languages];\n }\n\n // https://momentjs.com/docs/#/displaying/format/\n const dateTimeFormat = new Intl.DateTimeFormat(locale || undefined, options);\n const parts = dateTimeFormat.formatToParts(new Date());\n const hour12 = dateTimeFormat.resolvedOptions().hour12;\n\n const mapping: { [key: string]: string } = {\n year: 'YYYY',\n month: 'MM',\n day: 'DD',\n hour: hour12 ? 'hh' : 'HH',\n minute: 'mm',\n second: 'ss',\n weekday: 'ddd',\n era: 'N',\n dayPeriod: 'A',\n timeZoneName: 'Z',\n };\n\n return parts.map((part) => mapping[part.type] || part.value).join('');\n}\n\nexport const systemDateFormats = new SystemDateFormatsState();\n\nconst missingIntlDateTimeFormatSupport = (): boolean => {\n return !('DateTimeFormat' in Intl) || !('formatToParts' in Intl.DateTimeFormat.prototype);\n};\n","/* eslint-disable id-blacklist, no-restricted-imports */\nimport moment, { Moment } from 'moment-timezone';\n\nimport { TimeZone } from '../types/time';\n\nimport { DateTimeOptions, getTimeZone } from './common';\nimport { systemDateFormats } from './formats';\nimport { DateTimeInput, toUtc, dateTimeAsMoment } from './moment_wrapper';\n\n/**\n * The type describing the options that can be passed to the {@link dateTimeFormat}\n * helper function to control how the date and time value passed to the function is\n * formatted.\n *\n * @public\n */\nexport interface DateTimeOptionsWithFormat extends DateTimeOptions {\n /**\n * Set this value to `true` if you want to include milliseconds when formatting date and time\n */\n defaultWithMS?: boolean;\n}\n\ntype DateTimeFormatter<T extends DateTimeOptions = DateTimeOptions> = (dateInUtc: DateTimeInput, options?: T) => string;\n\n/**\n * Helper function to format date and time according to the specified options. If no options\n * are supplied, then default values are used. For more details, see {@link DateTimeOptionsWithFormat}.\n *\n * @param dateInUtc - date in UTC format, e.g. string formatted with UTC offset, UNIX epoch in seconds etc.\n * @param options\n *\n * @public\n */\nexport const dateTimeFormat: DateTimeFormatter<DateTimeOptionsWithFormat> = (dateInUtc, options?) =>\n toTz(dateInUtc, getTimeZone(options)).format(getFormat(options));\n\n/**\n * Helper function to format date and time according to the standard ISO format e.g. 2013-02-04T22:44:30.652Z.\n * If no options are supplied, then default values are used. For more details, see {@link DateTimeOptionsWithFormat}.\n *\n * @param dateInUtc - date in UTC format, e.g. string formatted with UTC offset, UNIX epoch in seconds etc.\n * @param options\n *\n * @public\n */\nexport const dateTimeFormatISO: DateTimeFormatter = (dateInUtc, options?) =>\n toTz(dateInUtc, getTimeZone(options)).format();\n\n/**\n * Helper function to return elapsed time since passed date. The returned value will be formatted\n * in a human readable format e.g. 4 years ago. If no options are supplied, then default values are used.\n * For more details, see {@link DateTimeOptions}.\n *\n * @param dateInUtc - date in UTC format, e.g. string formatted with UTC offset, UNIX epoch in seconds etc.\n * @param options\n *\n * @public\n */\nexport const dateTimeFormatTimeAgo: DateTimeFormatter = (dateInUtc, options?) =>\n toTz(dateInUtc, getTimeZone(options)).fromNow();\n\n/**\n * Helper function to format date and time according to the Grafana default formatting, but it\n * also appends the time zone abbreviation at the end e.g. 2020-05-20 13:37:00 CET. If no options\n * are supplied, then default values are used. For more details please see {@link DateTimeOptions}.\n *\n * @param dateInUtc - date in UTC format, e.g. string formatted with UTC offset, UNIX epoch in seconds etc.\n * @param options\n *\n * @public\n */\nexport const dateTimeFormatWithAbbrevation: DateTimeFormatter = (dateInUtc, options?) =>\n toTz(dateInUtc, getTimeZone(options)).format(`${systemDateFormats.fullDate} z`);\n\n/**\n * Helper function to return only the time zone abbreviation for a given date and time value. If no options\n * are supplied, then default values are used. For more details please see {@link DateTimeOptions}.\n *\n * @param dateInUtc - date in UTC format, e.g. string formatted with UTC offset, UNIX epoch in seconds etc.\n * @param options\n *\n * @public\n */\nexport const timeZoneAbbrevation: DateTimeFormatter = (dateInUtc, options?) =>\n toTz(dateInUtc, getTimeZone(options)).format('z');\n\nconst getFormat = <T extends DateTimeOptionsWithFormat>(options?: T): string => {\n if (options?.defaultWithMS) {\n return options?.format ?? systemDateFormats.fullDateMS;\n }\n return options?.format ?? systemDateFormats.fullDate;\n};\n\nconst toTz = (dateInUtc: DateTimeInput, timeZone: TimeZone): Moment => {\n const date = dateInUtc;\n const zone = moment.tz.zone(timeZone);\n\n if (zone && zone.name) {\n return dateTimeAsMoment(toUtc(date)).tz(zone.name);\n }\n\n switch (timeZone) {\n case 'utc':\n return dateTimeAsMoment(toUtc(date));\n default:\n return dateTimeAsMoment(toUtc(date)).local();\n }\n};\n","import moment, { Moment, MomentInput, DurationInputArg1, DurationInputArg2 } from 'moment';\n\nimport { TimeZone } from '../types/time';\n/* eslint-disable id-blacklist, no-restricted-imports */\nexport interface DateTimeBuiltinFormat {\n __momentBuiltinFormatBrand: any;\n}\nexport const ISO_8601: DateTimeBuiltinFormat = moment.ISO_8601;\nexport type DateTimeInput = Date | string | number | Array<string | number> | DateTime | null; // | undefined;\nexport type FormatInput = string | DateTimeBuiltinFormat | undefined;\nexport type DurationInput = string | number | DateTimeDuration;\nexport type DurationUnit =\n | 'year'\n | 'years'\n | 'y'\n | 'month'\n | 'months'\n | 'M'\n | 'week'\n | 'weeks'\n | 'isoWeek'\n | 'w'\n | 'day'\n | 'days'\n | 'd'\n | 'hour'\n | 'hours'\n | 'h'\n | 'minute'\n | 'minutes'\n | 'm'\n | 'second'\n | 'seconds'\n | 's'\n | 'millisecond'\n | 'milliseconds'\n | 'ms'\n | 'quarter'\n | 'quarters'\n | 'Q';\n\nexport interface DateTimeLocale {\n firstDayOfWeek: () => number;\n}\n\nexport interface DateTimeDuration {\n asHours: () => number;\n hours: () => number;\n minutes: () => number;\n seconds: () => number;\n asSeconds: () => number;\n}\n\nexport interface DateTime extends Object {\n add: (amount?: DateTimeInput, unit?: DurationUnit) => DateTime;\n set: (unit: DurationUnit | 'date', amount: DateTimeInput) => void;\n diff: (amount: DateTimeInput, unit?: DurationUnit, truncate?: boolean) => number;\n endOf: (unitOfTime: DurationUnit) => DateTime;\n format: (formatInput?: FormatInput) => string;\n fromNow: (withoutSuffix?: boolean) => string;\n from: (formaInput: DateTimeInput) => string;\n isSame: (input?: DateTimeInput, granularity?: DurationUnit) => boolean;\n isBefore: (input?: DateTimeInput) => boolean;\n isValid: () => boolean;\n local: () => DateTime;\n locale: (locale: string) => DateTime;\n startOf: (unitOfTime: DurationUnit) => DateTime;\n subtract: (amount?: DateTimeInput, unit?: DurationUnit) => DateTime;\n toDate: () => Date;\n toISOString: (keepOffset?: boolean) => string;\n isoWeekday: (day?: number | string) => number | string;\n valueOf: () => number;\n unix: () => number;\n utc: () => DateTime;\n utcOffset: () => number;\n hour?: () => number;\n minute?: () => number;\n}\n\nexport const setLocale = (language: string) => {\n moment.locale(language);\n};\n\nexport const getLocale = () => {\n return moment.locale();\n};\n\nexport const getLocaleData = (): DateTimeLocale => {\n return moment.localeData();\n};\n\nexport const isDateTimeInput = (value: unknown): value is DateTimeInput => {\n return (\n value === null ||\n typeof value === 'string' ||\n typeof value === 'number' ||\n value instanceof Date ||\n (Array.isArray(value) && value.every((v) => typeof v === 'string' || typeof v === 'number')) ||\n isDateTime(value)\n );\n};\n\nexport const isDateTime = (value: unknown): value is DateTime => {\n return moment.isMoment(value);\n};\n\nexport const toUtc = (input?: DateTimeInput, formatInput?: FormatInput): DateTime => {\n return moment.utc(input as MomentInput, formatInput) as DateTime;\n};\n\nexport const toDuration = (input?: DurationInput, unit?: DurationUnit): DateTimeDuration => {\n // moment built-in types are a bit flaky, for example `isoWeek` is not in the type definition but it's present in the js source.\n return moment.duration(input as DurationInputArg1, unit as DurationInputArg2) as DateTimeDuration;\n};\n\nexport const dateTime = (input?: DateTimeInput, formatInput?: FormatInput): DateTime => {\n return moment(input as MomentInput, formatInput) as DateTime;\n};\n\nexport const dateTimeAsMoment = (input?: DateTimeInput) => {\n return dateTime(input) as Moment;\n};\n\nexport const dateTimeForTimeZone = (\n timezone?: TimeZone,\n input?: DateTimeInput,\n formatInput?: FormatInput\n): DateTime => {\n if (timezone && timezone !== 'browser') {\n let result: moment.Moment;\n\n if (typeof input === 'string' && formatInput) {\n result = moment.tz(input, formatInput, timezone);\n } else {\n result = moment.tz(input, timezone);\n }\n\n if (isDateTime(result)) {\n return result;\n }\n }\n\n return dateTime(input, formatInput);\n};\n\nexport const getWeekdayIndex = (day: string) => {\n return moment.weekdays().findIndex((wd) => wd.toLowerCase() === day.toLowerCase());\n};\n\nexport const getWeekdayIndexByEnglishName = (day: string) =>\n ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'].findIndex(\n (wd) => wd.toLowerCase() === day.toLowerCase()\n );\n\nexport const setWeekStart = (weekStart?: string) => {\n const suffix = '-weekStart';\n const language = getLocale().replace(suffix, '');\n const dow = weekStart ? getWeekdayIndexByEnglishName(weekStart) : -1;\n if (dow !== -1) {\n moment.updateLocale(language + suffix, {\n parentLocale: language,\n week: {\n dow,\n },\n });\n } else {\n setLocale(language);\n }\n};\n","/* eslint-disable id-blacklist, no-restricted-imports */\nimport { lowerCase } from 'lodash';\nimport moment from 'moment-timezone';\n\nimport { DateTimeOptions, getTimeZone } from './common';\nimport { parse, isValid } from './datemath';\nimport { systemDateFormats } from './formats';\nimport { DateTimeInput, DateTime, isDateTime, dateTime, toUtc, dateTimeForTimeZone } from './moment_wrapper';\n\n/**\n * The type that describes options that can be passed when parsing a date and time value.\n * @public\n */\nexport interface DateTimeOptionsWhenParsing extends DateTimeOptions {\n /**\n * If the input is a Grafana quick date, e.g. now-6h, then you can specify this to control\n * whether the last part of the date and time value is included or excluded.\n *\n * Example: now-6h and the current time is 12:20:00 if roundUp is set to true\n * the returned DateTime value will be 06:00:00.\n */\n roundUp?: boolean;\n fiscalYearStartMonth?: number;\n}\n\ntype DateTimeParser<T extends DateTimeOptions = DateTimeOptions> = (value: DateTimeInput, options?: T) => DateTime;\n\n/**\n * Helper function to parse a number, text or Date to a DateTime value. If a timeZone is supplied the incoming value\n * is parsed with that timeZone as a base. The only exception to this is if the passed value is in a UTC-based\n * format. Then it will use UTC as the base. If no format is specified the current system format will be assumed.\n *\n * It can also parse the Grafana quick date and time format, e.g. now-6h will be parsed as Date.now() - 6 hours and\n * returned as a valid DateTime value.\n *\n * If no options are supplied, then default values are used. For more details please see {@link DateTimeOptions}.\n *\n * @param value - should be a parsable date and time value\n * @param options\n *\n * @public\n */\nexport const dateTimeParse: DateTimeParser<DateTimeOptionsWhenParsing> = (value, options?): DateTime => {\n if (isDateTime(value)) {\n return value;\n }\n\n if (typeof value === 'string') {\n return parseString(value, options);\n }\n\n return parseOthers(value, options);\n};\n\nconst parseString = (value: string, options?: DateTimeOptionsWhenParsing): DateTime => {\n const parsed = parse(value, options?.roundUp, options?.timeZone, options?.fiscalYearStartMonth);\n if (value.indexOf('now') !== -1) {\n if (!isValid(value)) {\n return dateTime();\n }\n\n return parsed || dateTime();\n }\n\n const timeZone = getTimeZone(options);\n const zone = moment.tz.zone(timeZone);\n const format = options?.format ?? systemDateFormats.fullDate;\n\n if (zone && zone.name) {\n return dateTimeForTimeZone(zone.name, value, format);\n }\n\n if (format === systemDateFormats.fullDate) {\n // We use parsed here to handle case when `use_browser_locale` is true\n // We need to pass the parsed value to handle case when value is an ISO 8601 date string\n return dateTime(parsed, format);\n }\n\n switch (lowerCase(timeZone)) {\n case 'utc':\n return toUtc(value, format);\n default:\n return dateTime(value, format);\n }\n};\n\nconst parseOthers = (value: DateTimeInput, options?: DateTimeOptionsWhenParsing): DateTime => {\n const date = value;\n const timeZone = getTimeZone(options);\n const zone = moment.tz.zone(timeZone);\n\n if (zone && zone.name) {\n return dateTimeForTimeZone(zone.name, date);\n }\n\n switch (lowerCase(timeZone)) {\n case 'utc':\n return toUtc(date);\n default:\n return dateTime(date);\n }\n};\n","import { RawTimeRange, TimeRange, TimeZone, IntervalValues, RelativeTimeRange, TimeOption } from '../types/time';\n\nimport * as dateMath from './datemath';\nimport { timeZoneAbbrevation, dateTimeFormat, dateTimeFormatTimeAgo } from './formatter';\nimport { isDateTime, DateTime, dateTime } from './moment_wrapper';\nimport { dateTimeParse } from './parser';\n\nconst spans: { [key: string]: { display: string; section?: number } } = {\n s: { display: 'second' },\n m: { display: 'minute' },\n h: { display: 'hour' },\n d: { display: 'day' },\n w: { display: 'week' },\n M: { display: 'month' },\n y: { display: 'year' },\n};\n\nconst BASE_RANGE_OPTIONS: TimeOption[] = [\n { from: 'now/d', to: 'now/d', display: 'Today' },\n { from: 'now/d', to: 'now', display: 'Today so far' },\n { from: 'now/w', to: 'now/w', display: 'This week' },\n { from: 'now/w', to: 'now', display: 'This week so far' },\n { from: 'now/M', to: 'now/M', display: 'This month' },\n { from: 'now/M', to: 'now', display: 'This month so far' },\n { from: 'now/y', to: 'now/y', display: 'This year' },\n { from: 'now/y', to: 'now', display: 'This year so far' },\n\n { from: 'now-1d/d', to: 'now-1d/d', display: 'Yesterday' },\n {\n from: 'now-2d/d',\n to: 'now-2d/d',\n display: 'Day before yesterday',\n },\n {\n from: 'now-7d/d',\n to: 'now-7d/d',\n display: 'This day last week',\n },\n { from: 'now-1w/w', to: 'now-1w/w', display: 'Previous week' },\n { from: 'now-1M/M', to: 'now-1M/M', display: 'Previous month' },\n { from: 'now-1Q/fQ', to: 'now-1Q/fQ', display: 'Previous fiscal quarter' },\n { from: 'now-1y/y', to: 'now-1y/y', display: 'Previous year' },\n { from: 'now-1y/fy', to: 'now-1y/fy', display: 'Previous fiscal year' },\n\n { from: 'now-5m', to: 'now', display: 'Last 5 minutes' },\n { from: 'now-15m', to: 'now', display: 'Last 15 minutes' },\n { from: 'now-30m', to: 'now', display: 'Last 30 minutes' },\n { from: 'now-1h', to: 'now', display: 'Last 1 hour' },\n { from: 'now-3h', to: 'now', display: 'Last 3 hours' },\n { from: 'now-6h', to: 'now', display: 'Last 6 hours' },\n { from: 'now-12h', to: 'now', display: 'Last 12 hours' },\n { from: 'now-24h', to: 'now', display: 'Last 24 hours' },\n { from: 'now-2d', to: 'now', display: 'Last 2 days' },\n { from: 'now-7d', to: 'now', display: 'Last 7 days' },\n { from: 'now-30d', to: 'now', display: 'Last 30 days' },\n { from: 'now-90d', to: 'now', display: 'Last 90 days' },\n { from: 'now-6M', to: 'now', display: 'Last 6 months' },\n { from: 'now-1y', to: 'now', display: 'Last 1 year' },\n { from: 'now-2y', to: 'now', display: 'Last 2 years' },\n { from: 'now-5y', to: 'now', display: 'Last 5 years' },\n { from: 'now/fQ', to: 'now', display: 'This fiscal quarter so far' },\n { from: 'now/fQ', to: 'now/fQ', display: 'This fiscal quarter' },\n { from: 'now/fy', to: 'now', display: 'This fiscal year so far' },\n { from: 'now/fy', to: 'now/fy', display: 'This fiscal year' },\n];\n\nconst HIDDEN_RANGE_OPTIONS: TimeOption[] = [\n { from: 'now', to: 'now+1m', display: 'Next minute' },\n { from: 'now', to: 'now+5m', display: 'Next 5 minutes' },\n { from: 'now', to: 'now+15m', display: 'Next 15 minutes' },\n { from: 'now', to: 'now+30m', display: 'Next 30 minutes' },\n { from: 'now', to: 'now+1h', display: 'Next hour' },\n { from: 'now', to: 'now+3h', display: 'Next 3 hours' },\n { from: 'now', to: 'now+6h', display: 'Next 6 hours' },\n { from: 'now', to: 'now+12h', display: 'Next 12 hours' },\n { from: 'now', to: 'now+24h', display: 'Next 24 hours' },\n { from: 'now', to: 'now+2d', display: 'Next 2 days' },\n { from: 'now', to: 'now+7d', display: 'Next 7 days' },\n { from: 'now', to: 'now+30d', display: 'Next 30 days' },\n { from: 'now', to: 'now+90d', display: 'Next 90 days' },\n { from: 'now', to: 'now+6M', display: 'Next 6 months' },\n { from: 'now', to: 'now+1y', display: 'Next year' },\n { from: 'now', to: 'now+2y', display: 'Next 2 years' },\n { from: 'now', to: 'now+5y', display: 'Next 5 years' },\n];\n\nconst STANDARD_RANGE_OPTIONS = BASE_RANGE_OPTIONS.concat(HIDDEN_RANGE_OPTIONS);\n\nfunction findRangeInOptions(range: RawTimeRange, options: TimeOption[]) {\n return options.find((option) => option.from === range.from && option.to === range.to);\n}\n\n// handles expressions like\n// 5m\n// 5m to now/d\n// now/d to now\n// now/d\n// if no to <expr> then to now is assumed\nexport function describeTextRange(expr: string): TimeOption {\n const isLast = expr.indexOf('+') !== 0;\n if (expr.indexOf('now') === -1) {\n expr = (isLast ? 'now-' : 'now') + expr;\n }\n\n let opt = findRangeInOptions({ from: expr, to: 'now' }, STANDARD_RANGE_OPTIONS);\n if (opt) {\n return opt;\n }\n\n if (isLast) {\n opt = { from: expr, to: 'now', display: '' };\n } else {\n opt = { from: 'now', to: expr, display: '' };\n }\n\n const parts = /^now([-+])(\\d+)(\\w)/.exec(expr);\n if (parts) {\n const unit = parts[3];\n const amount = parseInt(parts[2], 10);\n const span = spans[unit];\n if (span) {\n opt.display = isLast ? 'Last ' : 'Next ';\n opt.display += amount + ' ' + span.display;\n opt.section = span.section;\n if (amount > 1) {\n opt.display += 's';\n }\n }\n } else {\n opt.display = opt.from + ' to ' + opt.to;\n opt.invalid = true;\n }\n\n return opt;\n}\n\n/**\n * Use this function to get a properly formatted string representation of a {@link @grafana/data:RawTimeRange | range}.\n *\n * @category TimeUtils\n * @param range - a time range (usually specified by the TimePicker)\n * @param timeZone - optional time zone.\n * @param quickRanges - optional dashboard's custom quick ranges to pick range names from.\n * @alpha\n */\nexport function describeTimeRange(range: RawTimeRange, timeZone?: TimeZone, quickRanges?: TimeOption[]): string {\n const rangeOptions = quickRanges ? quickRanges.concat(STANDARD_RANGE_OPTIONS) : STANDARD_RANGE_OPTIONS;\n const option = findRangeInOptions(range, rangeOptions);\n\n if (option) {\n return option.display;\n }\n\n const options = { timeZone };\n\n if (isDateTime(range.from) && isDateTime(range.to)) {\n return dateTimeFormat(range.from, options) + ' to ' + dateTimeFormat(range.to, options);\n }\n\n if (isDateTime(range.from)) {\n const parsed = dateMath.parse(range.to, true, 'utc');\n return parsed ? dateTimeFormat(range.from, options) + ' to ' + dateTimeFormatTimeAgo(parsed, options) : '';\n }\n\n if (isDateTime(range.to)) {\n const parsed = dateMath.parse(range.from, false, 'utc');\n return parsed ? dateTimeFormatTimeAgo(parsed, options) + ' to ' + dateTimeFormat(range.to, options) : '';\n }\n\n if (range.to.toString() === 'now') {\n const res = describeTextRange(range.from);\n return res.display;\n }\n\n return range.from.toString() + ' to ' + range.to.toString();\n}\n\nexport const isValidTimeSpan = (value: string) => {\n if (value.indexOf('$') === 0 || value.indexOf('+$') === 0) {\n return true;\n }\n\n const info = describeTextRange(value);\n return info.invalid !== true;\n};\n\nexport const describeTimeRangeAbbreviation = (range: TimeRange, timeZone?: TimeZone) => {\n if (isDateTime(range.from)) {\n return timeZoneAbbrevation(range.from, { timeZone });\n }\n const parsed = dateMath.parse(range.from, true);\n return parsed ? timeZoneAbbrevation(parsed, { timeZone }) : '';\n};\n\nexport const convertRawToRange = (\n raw: RawTimeRange,\n timeZone?: TimeZone,\n fiscalYearStartMonth?: number,\n format?: string\n): TimeRange => {\n const from = dateTimeParse(raw.from, { roundUp: false, timeZone, fiscalYearStartMonth, format });\n const to = dateTimeParse(raw.to, { roundUp: true, timeZone, fiscalYearStartMonth, format });\n\n return {\n from,\n to,\n raw: {\n from: dateMath.isMathString(raw.from) ? raw.from : from,\n to: dateMath.isMathString(raw.to) ? raw.to : to,\n },\n };\n};\n\nexport function isRelativeTime(v: DateTime | string) {\n if (typeof v === 'string') {\n return v.indexOf('now') >= 0;\n }\n return false;\n}\n\nexport function isFiscal(timeRange: TimeRange) {\n if (typeof timeRange.raw.from === 'string' && timeRange.raw.from.indexOf('f') > 0) {\n return true;\n } else if (typeof timeRange.raw.to === 'string' && timeRange.raw.to.indexOf('f') > 0) {\n return true;\n }\n return false;\n}\n\nexport function isRelativeTimeRange(raw: RawTimeRange): boolean {\n return isRelativeTime(raw.from) || isRelativeTime(raw.to);\n}\n\nexport function secondsToHms(seconds: number): string {\n const numYears = Math.floor(seconds / 31536000);\n if (numYears) {\n return numYears + 'y';\n }\n const numDays = Math.floor((seconds % 31536000) / 86400);\n if (numDays) {\n return numDays + 'd';\n }\n const numHours = Math.floor(((seconds % 31536000) % 86400) / 3600);\n if (numHours) {\n return numHours + 'h';\n }\n const numMinutes = Math.floor((((seconds % 31536000) % 86400) % 3600) / 60);\n if (numMinutes) {\n return numMinutes + 'm';\n }\n const numSeconds = Math.floor((((seconds % 31536000) % 86400) % 3600) % 60);\n if (numSeconds) {\n return numSeconds + 's';\n }\n const numMilliseconds = Math.floor(seconds * 1000.0);\n if (numMilliseconds) {\n return numMilliseconds + 'ms';\n }\n\n return 'less than a millisecond'; //'just now' //or other string you like;\n}\n\n// Format timeSpan (in sec) to string used in log's meta info\nexport function msRangeToTimeString(rangeMs: number): string {\n const rangeSec = Number((rangeMs / 1000).toFixed());\n\n const h = Math.floor(rangeSec / 60 / 60);\n const m = Math.floor(rangeSec / 60) - h * 60;\n const s = Number((rangeSec % 60).toFixed());\n let formattedH = h ? h + 'h' : '';\n let formattedM = m ? m + 'min' : '';\n let formattedS = s ? s + 'sec' : '';\n\n formattedH && formattedM ? (formattedH = formattedH + ' ') : (formattedH = formattedH);\n (formattedM || formattedH) && formattedS ? (formattedM = formattedM + ' ') : (formattedM = formattedM);\n\n return formattedH + formattedM + formattedS || 'less than 1sec';\n}\n\nexport function calculateInterval(range: TimeRange, resolution: number, lowLimitInterval?: string): IntervalValues {\n let lowLimitMs = 1; // 1 millisecond default low limit\n if (lowLimitInterval) {\n lowLimitMs = intervalToMs(lowLimitInterval);\n }\n\n let intervalMs = roundInterval((range.to.valueOf() - range.from.valueOf()) / resolution);\n if (lowLimitMs > intervalMs) {\n intervalMs = lowLimitMs;\n }\n return {\n intervalMs: intervalMs,\n interval: secondsToHms(intervalMs / 1000),\n };\n}\n\nconst interval_regex = /(-?\\d+(?:\\.\\d+)?)(ms|[Mwdhmsy])/;\n// histogram & trends\nconst intervals_in_seconds: Record<string, number> = {\n y: 31536000,\n M: 2592000,\n w: 604800,\n d: 86400,\n h: 3600,\n m: 60,\n s: 1,\n ms: 0.001,\n};\n\nexport function describeInterval(str: string) {\n // Default to seconds if no unit is provided\n if (Number(str)) {\n return {\n sec: intervals_in_seconds.s,\n type: 's',\n count: parseInt(str, 10),\n };\n }\n\n const matches = str.match(interval_regex);\n if (!matches) {\n throw new Error(\n `Invalid interval string, has to be either unit-less or end with one of the following units: \"${Object.keys(\n intervals_in_seconds\n ).join(', ')}\"`\n );\n }\n\n const sec = intervals_in_seconds[matches[2]];\n if (sec === undefined) {\n // this can never happen, because above we\n // already made sure the key is correct,\n // but we handle it to be safe.\n throw new Error('describeInterval failed: invalid interval string');\n }\n\n return {\n sec,\n type: matches[2],\n count: parseInt(matches[1], 10),\n };\n}\n\nexport function intervalToSeconds(str: string): number {\n const info = describeInterval(str);\n return info.sec * info.count;\n}\n\nexport function intervalToMs(str: string): number {\n const info = describeInterval(str);\n return info.sec * 1000 * info.count;\n}\n\nexport function roundInterval(interval: number) {\n switch (true) {\n // 0.01s\n case interval < 10:\n return 1; // 0.001s\n // 0.015s\n case interval < 15:\n return 10; // 0.01s\n // 0.035s\n case interval < 35:\n return 20; // 0.02s\n // 0.075s\n case interval < 75:\n return 50; // 0.05s\n // 0.15s\n case interval < 150:\n return 100; // 0.1s\n // 0.35s\n case interval < 350:\n return 200; // 0.2s\n // 0.75s\n case interval < 750:\n return 500; // 0.5s\n // 1.5s\n case interval < 1500:\n return 1000; // 1s\n // 3.5s\n case interval < 3500:\n return 2000; // 2s\n // 7.5s\n case interval < 7500:\n return 5000; // 5s\n // 12.5s\n case interval < 12500:\n return 10000; // 10s\n // 17.5s\n case interval < 17500:\n return 15000; // 15s\n // 25s\n case interval < 25000:\n return 20000; // 20s\n // 45s\n case interval < 45000:\n return 30000; // 30s\n // 1.5m\n case interval < 90000:\n return 60000; // 1m\n // 3.5m\n case interval < 210000:\n return 120000; // 2m\n // 7.5m\n case interval < 450000:\n return 300000; // 5m\n // 12.5m\n case interval < 750000:\n return 600000; // 10m\n // 17.5m\n case interval < 1050000:\n return 900000; // 15m\n // 25m\n case interval < 1500000:\n return 1200000; // 20m\n // 45m\n case interval < 2700000:\n return 1800000; // 30m\n // 1.5h\n case interval < 5400000:\n return 3600000; // 1h\n // 2.5h\n case interval < 9000000:\n return 7200000; // 2h\n // 4.5h\n case interval < 16200000:\n return 10800000; // 3h\n // 9h\n case interval < 32400000:\n return 21600000; // 6h\n // 1d\n case interval < 86400000:\n return 43200000; // 12h\n // 1w\n case interval < 604800000:\n return 86400000; // 1d\n // 3w\n case interval < 1814400000:\n return 604800000; // 1w\n // 6w\n case interval < 3628800000:\n return 2592000000; // 30d\n default:\n return 31536000000; // 1y\n }\n}\n\n/**\n * Converts a TimeRange to a RelativeTimeRange that can be used in\n * e.g. alerting queries/rules.\n *\n * @internal\n */\nexport function timeRangeToRelative(timeRange: TimeRange, now: DateTime = dateTime()): RelativeTimeRange {\n const from = now.unix() - timeRange.from.unix();\n const to = now.unix() - timeRange.to.unix();\n\n return {\n from,\n to,\n };\n}\n\n/**\n * Converts a RelativeTimeRange to a TimeRange\n *\n * @internal\n */\nexport function relativeToTimeRange(relativeTimeRange: RelativeTimeRange, now: DateTime = dateTime()): TimeRange {\n const from = dateTime(now).subtract(relativeTimeRange.from, 's');\n const to = relativeTimeRange.to === 0 ? dateTime(now) : dateTime(now).subtract(relativeTimeRange.to, 's');\n\n return {\n from,\n to,\n raw: { from, to },\n };\n}\n","import { IScope } from 'angular';\nimport EventEmitter from 'eventemitter3';\nimport { Unsubscribable, Observable, Subscriber } from 'rxjs';\nimport { filter } from 'rxjs/operators';\n\nimport {\n EventBus,\n LegacyEmitter,\n BusEventHandler,\n BusEventType,\n LegacyEventHandler,\n BusEvent,\n AppEvent,\n EventFilterOptions,\n} from './types';\n\n/**\n * @alpha\n */\nexport class EventBusSrv implements EventBus, LegacyEmitter {\n private emitter: EventEmitter;\n private subscribers = new Map<Function, Subscriber<BusEvent>>();\n\n constructor() {\n this.emitter = new EventEmitter();\n }\n\n publish<T extends BusEvent>(event: T): void {\n this.emitter.emit(event.type, event);\n }\n\n subscribe<T extends BusEvent>(typeFilter: BusEventType<T>, handler: BusEventHandler<T>): Unsubscribable {\n return this.getStream(typeFilter).subscribe({ next: handler });\n }\n\n getStream<T extends BusEvent = BusEvent>(eventType: BusEventType<T>): Observable<T> {\n return new Observable<T>((observer) => {\n const handler = (event: T) => {\n observer.next(event);\n };\n\n this.emitter.on(eventType.type, handler);\n this.subscribers.set(handler, observer);\n\n return () => {\n this.emitter.off(eventType.type, handler);\n this.subscribers.delete(handler);\n };\n });\n }\n\n newScopedBus(key: string, filter?: EventFilterOptions): ScopedEventBus {\n return new ScopedEventBus([key], this, filter);\n }\n\n /**\n * Legacy functions\n */\n emit<T>(event: AppEvent<T> | string, payload?: T): void {\n // console.log(`Deprecated emitter function used (emit), use $emit`);\n\n if (typeof event === 'string') {\n this.emitter.emit(event, { type: event, payload });\n } else {\n this.emitter.emit(event.name, { type: event.name, payload });\n }\n }\n\n on<T>(event: AppEvent<T> | string, handler: LegacyEventHandler<T>, scope?: IScope) {\n // console.log(`Deprecated emitter function used (on), use $on`);\n\n // need this wrapper to make old events compatible with old handlers\n handler.wrapper = (emittedEvent: BusEvent) => {\n handler(emittedEvent.payload);\n };\n\n if (typeof event === 'string') {\n this.emitter.on(event, handler.wrapper);\n } else {\n this.emitter.on(event.name, handler.wrapper);\n }\n\n if (scope) {\n const unbind = scope.$on('$destroy', () => {\n this.off(event, handler);\n unbind();\n });\n }\n }\n\n off<T>(event: AppEvent<T> | string, handler: LegacyEventHandler<T>) {\n if (typeof event === 'string') {\n this.emitter.off(event, handler.wrapper);\n return;\n }\n\n this.emitter.off(event.name, handler.wrapper);\n }\n\n removeAllListeners() {\n this.emitter.removeAllListeners();\n for (const [key, sub] of this.subscribers) {\n sub.complete();\n this.subscribers.delete(key);\n }\n }\n}\n\n/**\n * Wraps EventBus and adds a source to help with identifying if a subscriber should react to the event or not.\n */\nclass ScopedEventBus implements EventBus {\n // will be mutated by panel runners\n filterConfig: EventFilterOptions;\n\n // The path is not yet exposed, but can be used to indicate nested groups and support faster filtering\n constructor(\n public path: string[],\n private eventBus: EventBus,\n filter?: EventFilterOptions\n ) {\n this.filterConfig = filter ?? { onlyLocal: false };\n }\n\n publish<T extends BusEvent>(event: T): void {\n if (!event.origin) {\n event.origin = this;\n }\n this.eventBus.publish(event);\n }\n\n filter<T extends BusEvent>(event: T) {\n if (this.filterConfig.onlyLocal) {\n return event.origin === this;\n }\n return true;\n }\n\n getStream<T extends BusEvent>(eventType: BusEventType<T>): Observable<T> {\n return this.eventBus.getStream(eventType).pipe(filter(this.filter.bind(this)));\n }\n\n // syntax sugar\n subscribe<T extends BusEvent>(typeFilter: BusEventType<T>, handler: BusEventHandler<T>): Unsubscribable {\n return this.getStream(typeFilter).subscribe({ next: handler });\n }\n\n removeAllListeners(): void {\n this.eventBus.removeAllListeners();\n }\n\n /**\n * Creates a nested event bus structure\n */\n newScopedBus(key: string, filter: EventFilterOptions): EventBus {\n return new ScopedEventBus([...this.path, key], this, filter);\n }\n}\n","import { AppEvent } from './types';\n\nconst typeList: Set<string> = new Set();\n\nexport function eventFactory<T = undefined>(name: string): AppEvent<T> {\n if (typeList.has(name)) {\n throw new Error(`There is already an event defined with type '${name}'`);\n }\n\n typeList.add(name);\n return { name };\n}\n","import { IScope } from 'angular';\nimport { Unsubscribable, Observable } from 'rxjs';\n\n/**\n * @alpha\n * internal interface\n */\nexport interface BusEvent {\n readonly type: string;\n readonly payload?: any;\n origin?: EventBus;\n}\n\n/**\n * @alpha\n * Base event type\n */\nexport abstract class BusEventBase implements BusEvent {\n readonly type: string;\n readonly payload?: any;\n readonly origin?: EventBus;\n\n /** @internal */\n tags?: Set<string>;\n\n constructor() {\n //@ts-ignore\n this.type = this.__proto__.constructor.type;\n }\n\n /**\n * @internal\n * Tag event for finer-grained filtering in subscribers\n */\n setTags(tags: string[]) {\n this.tags = new Set(tags);\n return this;\n }\n}\n\n/**\n * @alpha\n * Base event type with payload\n */\nexport abstract class BusEventWithPayload<T> extends BusEventBase {\n readonly payload: T;\n\n constructor(payload: T) {\n super();\n this.payload = payload;\n }\n}\n\n/*\n * Interface for an event type constructor\n */\nexport interface BusEventType<T extends BusEvent> {\n type: string;\n new (...args: any[]): T;\n}\n\n/**\n * @alpha\n * Event callback/handler type\n */\nexport interface BusEventHandler<T extends BusEvent> {\n (event: T): void;\n}\n\n/**\n * @alpha\n * Main minimal interface\n */\nexport interface EventFilterOptions {\n onlyLocal: boolean;\n}\n\n/**\n * @alpha\n * Main minimal interface\n */\nexport interface EventBus {\n /**\n * Publish single event\n */\n publish<T extends BusEvent>(event: T): void;\n\n /**\n * Get observable of events\n */\n getStream<T extends BusEvent>(eventType: BusEventType<T>): Observable<T>;\n\n /**\n * Subscribe to an event stream\n *\n * This function is a wrapper around the `getStream(...)` function\n */\n subscribe<T extends BusEvent>(eventType: BusEventType<T>, handler: BusEventHandler<T>): Unsubscribable;\n\n /**\n * Remove all event subscriptions\n */\n removeAllListeners(): void;\n\n /**\n * Returns a new bus scoped that knows where it exists in a heiarchy\n *\n * @internal -- This is included for internal use only should not be used directly\n */\n newScopedBus(key: string, filter: EventFilterOptions): EventBus;\n}\n\n/**\n * @public\n * @deprecated event type\n */\nexport interface AppEvent<T> {\n readonly name: string;\n payload?: T;\n}\n\n/** @public */\nexport interface LegacyEmitter {\n /**\n * @deprecated use $emit\n */\n emit<T>(event: AppEvent<T> | string, payload?: T): void;\n\n /**\n * @deprecated use $on\n */\n on<T>(event: AppEvent<T> | string, handler: LegacyEventHandler<T>, scope?: IScope): void;\n\n /**\n * @deprecated use $on\n */\n off<T>(event: AppEvent<T> | string, handler: (payload?: T) => void): void;\n}\n\n/** @public */\nexport interface LegacyEventHandler<T> {\n (payload: T): void;\n wrapper?: (event: BusEvent) => void;\n}\n\n/** @alpha */\nexport interface EventBusExtended extends EventBus, LegacyEmitter {}\n","import { Registry, RegistryItem } from '../utils/Registry';\n\n/**\n * @alpha\n */\nexport interface MonacoLanguageRegistryItem extends RegistryItem {\n init: () => Worker;\n}\n\n/**\n * @alpha\n */\nexport const monacoLanguageRegistry = new Registry<MonacoLanguageRegistryItem>();\n","import { WithAccessControlMetadata } from '../types/accesscontrol';\nimport { CurrentUserDTO } from '../types/config';\n\nexport interface CurrentUser extends Omit<CurrentUserDTO, 'lightTheme'> {}\n\nexport function userHasPermission(action: string, user: CurrentUser): boolean {\n return !!user.permissions?.[action];\n}\n\nexport function userHasPermissionInMetadata(action: string, object: WithAccessControlMetadata): boolean {\n return !!object.accessControl?.[action];\n}\n\nexport function userHasAllPermissions(actions: string[], user: CurrentUser) {\n return actions.every((action) => userHasPermission(action, user));\n}\n\nexport function userHasAnyPermission(actions: string[], user: CurrentUser) {\n return actions.some((action) => userHasPermission(action, user));\n}\n","import { sanitizeUrl as braintreeSanitizeUrl } from '@braintree/sanitize-url';\nimport DOMPurify from 'dompurify';\nimport * as xss from 'xss';\n\nconst XSSWL = Object.keys(xss.whiteList).reduce<xss.IWhiteList>((acc, element) => {\n acc[element] = xss.whiteList[element]?.concat(['class', 'style']);\n return acc;\n}, {});\n\n// Add iframe tags to XSSWL.\n// We don't allow the sandbox attribute, since it can be overridden, instead we add it below.\nXSSWL.iframe = ['src', 'width', 'height'];\n\nconst sanitizeTextPanelWhitelist = new xss.FilterXSS({\n // Add sandbox attribute to iframe tags if an attribute is allowed.\n onTagAttr: function (tag, name, value, isWhiteAttr) {\n if (tag === 'iframe') {\n return isWhiteAttr\n ? ` ${name}=\"${xss.escapeAttrValue(sanitizeUrl(value))}\" sandbox credentialless referrerpolicy=no-referrer`\n : '';\n }\n return;\n },\n whiteList: XSSWL,\n css: {\n whiteList: {\n ...xss.getDefaultCSSWhiteList(),\n 'flex-direction': true,\n 'flex-wrap': true,\n 'flex-basis': true,\n 'flex-grow': true,\n 'flex-shrink': true,\n 'flex-flow': true,\n gap: true,\n order: true,\n 'justify-content': true,\n 'justify-items': true,\n 'justify-self': true,\n 'align-items': true,\n 'align-content': true,\n 'align-self': true,\n },\n },\n});\n\n/**\n * Return a sanitized string that is going to be rendered in the browser to prevent XSS attacks.\n * Note that sanitized tags will be removed, such as \"<script>\".\n * We don't allow form or input elements.\n */\nexport function sanitize(unsanitizedString: string): string {\n try {\n return DOMPurify.sanitize(unsanitizedString, {\n USE_PROFILES: { html: true },\n FORBID_TAGS: ['form', 'input'],\n });\n } catch (error) {\n console.error('String could not be sanitized', unsanitizedString);\n return escapeHtml(unsanitizedString);\n }\n}\n\nexport function sanitizeTrustedTypesRSS(unsanitizedString: string): TrustedHTML {\n return DOMPurify.sanitize(unsanitizedString, {\n RETURN_TRUSTED_TYPE: true,\n ADD_ATTR: ['xmlns:atom', 'version', 'property', 'content'],\n ADD_TAGS: ['rss', 'meta', 'channel', 'title', 'link', 'description', 'atom:link', 'item', 'pubDate', 'guid'],\n PARSER_MEDIA_TYPE: 'application/xhtml+xml',\n });\n}\n\nexport function sanitizeTrustedTypes(unsanitizedString: string): TrustedHTML {\n return DOMPurify.sanitize(unsanitizedString, { RETURN_TRUSTED_TYPE: true });\n}\n\n/**\n * Returns string safe from XSS attacks to be used in the Text panel plugin.\n *\n * Even though we allow the style-attribute, there's still default filtering applied to it\n * Info: https://github.com/leizongmin/js-xss#customize-css-filter\n * Whitelist: https://github.com/leizongmin/js-css-filter/blob/master/lib/default.js\n */\nexport function sanitizeTextPanelContent(unsanitizedString: string): string {\n try {\n return sanitizeTextPanelWhitelist.process(unsanitizedString);\n } catch (error) {\n console.error('String could not be sanitized', unsanitizedString);\n return 'Text string could not be sanitized';\n }\n}\n\n// Returns sanitized SVG, free from XSS attacks to be used when rendering SVG content.\nexport function sanitizeSVGContent(unsanitizedString: string): string {\n return DOMPurify.sanitize(unsanitizedString, { USE_PROFILES: { svg: true, svgFilters: true } });\n}\n\n// Return a sanitized URL, free from XSS attacks, such as javascript:alert(1)\nexport function sanitizeUrl(url: string): string {\n return braintreeSanitizeUrl(url);\n}\n\n// Returns true if the string contains ANSI color codes.\nexport function hasAnsiCodes(input: string): boolean {\n return /\\u001b\\[\\d{1,2}m/.test(input);\n}\n\n// Returns a string with HTML entities escaped.\nexport function escapeHtml(str: string): string {\n return String(str)\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/'/g, ''')\n .replace(/\"/g, '"');\n}\n\nexport const textUtil = {\n escapeHtml,\n hasAnsiCodes,\n sanitize,\n sanitizeTextPanelContent,\n sanitizeUrl,\n sanitizeSVGContent,\n sanitizeTrustedTypes,\n sanitizeTrustedTypesRSS,\n};\n","import { camelCase } from 'lodash';\n\nconst specialChars = ['(', '[', '{', '}', ']', ')', '\\\\', '|', '*', '+', '-', '.', '?', '<', '>', '#', '&', '^', '$'];\nconst specialMatcher = '([\\\\' + specialChars.join('\\\\') + '])';\nconst specialCharEscape = new RegExp(specialMatcher, 'g');\nconst specialCharUnescape = new RegExp('(\\\\\\\\)' + specialMatcher, 'g');\n\nexport function escapeStringForRegex(value: string) {\n if (!value) {\n return value;\n }\n\n return value.replace(specialCharEscape, '\\\\$1');\n}\n\nexport function unEscapeStringFromRegex(value: string) {\n if (!value) {\n return value;\n }\n\n return value.replace(specialCharUnescape, '$2');\n}\n\nexport function stringStartsAsRegEx(str: string): boolean {\n if (!str) {\n return false;\n }\n\n return str[0] === '/';\n}\n\nexport function stringToJsRegex(str: string): RegExp {\n if (!stringStartsAsRegEx(str)) {\n return new RegExp(`^${str}$`);\n }\n\n const match = str.match(new RegExp('^/(.*?)/(g?i?m?y?s?)$'));\n\n if (!match) {\n throw new Error(`'${str}' is not a valid regular expression.`);\n }\n\n return new RegExp(match[1], match[2]);\n}\n\nexport function stringToMs(str: string): number {\n if (!str) {\n return 0;\n }\n\n const nr = parseInt(str, 10);\n const unit = str.slice(String(nr).length);\n const s = 1000;\n const m = s * 60;\n const h = m * 60;\n const d = h * 24;\n\n switch (unit) {\n case 's':\n return nr * s;\n case 'm':\n return nr * m;\n case 'h':\n return nr * h;\n case 'd':\n return nr * d;\n default:\n if (!unit) {\n return isNaN(nr) ? 0 : nr;\n }\n throw new Error('Not supported unit: ' + unit);\n }\n}\n\nexport function toNumberString(value: number | undefined | null): string {\n if (value !== null && value !== undefined && Number.isFinite(value)) {\n return value.toString();\n }\n return '';\n}\n\nexport function toIntegerOrUndefined(value: string): number | undefined {\n if (!value) {\n return undefined;\n }\n const v = parseInt(value, 10);\n return isNaN(v) ? undefined : v;\n}\n\nexport function toFloatOrUndefined(value: string): number | undefined {\n if (!value) {\n return undefined;\n }\n const v = parseFloat(value);\n return isNaN(v) ? undefined : v;\n}\n\nexport function toPascalCase(string: string) {\n const str = camelCase(string);\n return str.charAt(0).toUpperCase() + str.substring(1);\n}\n\nexport function escapeRegex(value: string): string {\n return value.replace(/[\\\\^$*+?.()|[\\]{}\\/]/g, '\\\\$&');\n}\n","// Code based on Material-UI\n// https://github.com/mui-org/material-ui/blob/1b096070faf102281f8e3c4f9b2bf50acf91f412/packages/material-ui/src/styles/colorManipulator.js#L97\n// MIT License Copyright (c) 2014 Call-Em-All\n\nimport tinycolor from 'tinycolor2';\n\n/**\n * Returns a number whose value is limited to the given range.\n * @param value The value to be clamped\n * @param min The lower boundary of the output range\n * @param max The upper boundary of the output range\n * @returns A number in the range [min, max]\n * @beta\n */\nfunction clamp(value: number, min = 0, max = 1) {\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(`The value provided ${value} is out of range [${min}, ${max}].`);\n }\n }\n\n return Math.min(Math.max(min, value), max);\n}\n\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n * @param color - Hex color, i.e. #nnn or #nnnnnn\n * @returns A CSS rgb color string\n * @beta\n */\nexport function hexToRgb(color: string) {\n color = color.slice(1);\n\n const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');\n let result = color.match(re);\n\n if (!result) {\n return '';\n }\n\n let colors = Array.from(result);\n\n if (colors[0].length === 1) {\n colors = colors.map((n) => n + n);\n }\n\n return colors\n ? `rgb${colors.length === 4 ? 'a' : ''}(${colors\n .map((n, index) => {\n return index < 3 ? parseInt(n, 16) : Math.round((parseInt(n, 16) / 255) * 1000) / 1000;\n })\n .join(', ')})`\n : '';\n}\n\nfunction intToHex(int: number) {\n const hex = int.toString(16);\n return hex.length === 1 ? `0${hex}` : hex;\n}\n\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n * @param color - RGB color, i.e. rgb(n, n, n)\n * @returns A CSS rgb color string, i.e. #nnnnnn\n * @beta\n */\nexport function rgbToHex(color: string) {\n // Idempotent\n if (color.indexOf('#') === 0) {\n return color;\n }\n\n const { values } = decomposeColor(color);\n return `#${values.map((n: number) => intToHex(n)).join('')}`;\n}\n\n/**\n * Converts a color to hex6 format if there is no alpha, hex8 if there is.\n * @param color - Hex, RGB, HSL color\n * @returns A hex color string, i.e. #ff0000 or #ff0000ff\n */\nexport function asHexString(color: string): string {\n if (color[0] === '#') {\n return color;\n }\n const tColor = tinycolor(color);\n return tColor.getAlpha() === 1 ? tColor.toHexString() : tColor.toHex8String();\n}\n\n/**\n * Converts a color to rgb string\n */\nexport function asRgbString(color: string) {\n if (color.startsWith('rgb')) {\n return color;\n }\n\n return tinycolor(color).toRgbString();\n}\n\n/**\n * Converts a color from hsl format to rgb format.\n * @param color - HSL color values\n * @returns rgb color values\n * @beta\n */\nexport function hslToRgb(color: string | DecomposeColor) {\n const parts = decomposeColor(color);\n const { values } = parts;\n const h = values[0];\n const s = values[1] / 100;\n const l = values[2] / 100;\n const a = s * Math.min(l, 1 - l);\n const f = (n: number, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n\n let type = 'rgb';\n const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n\n if (parts.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n\n return recomposeColor({ type, values: rgb });\n}\n\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n * @param color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n * @beta\n */\nexport function decomposeColor(color: string | DecomposeColor): DecomposeColor {\n // Idempotent\n if (typeof color !== 'string') {\n return color;\n }\n\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n\n const marker = color.indexOf('(');\n const type = color.substring(0, marker);\n\n if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {\n throw new Error(\n `Unsupported '${color}' color. The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()`\n );\n }\n\n let values: any = color.substring(marker + 1, color.length - 1);\n let colorSpace;\n\n if (type === 'color') {\n values = values.split(' ');\n colorSpace = values.shift();\n if (values.length === 4 && values[3].charAt(0) === '/') {\n values[3] = values[3].slice(1);\n }\n if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {\n throw new Error(\n `Unsupported ${colorSpace} color space. The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`\n );\n }\n } else {\n values = values.split(',');\n }\n\n values = values.map((value: string) => parseFloat(value));\n return { type, values, colorSpace };\n}\n\n/**\n * Converts a color object with type and values to a string.\n * @param {object} color - Decomposed color\n * @param color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns A CSS color string\n * @beta\n */\nexport function recomposeColor(color: DecomposeColor) {\n const { type, colorSpace } = color;\n let values = color.values;\n\n if (type.indexOf('rgb') !== -1) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map((n: string, i: number) => (i < 3 ? parseInt(n, 10) : n));\n } else if (type.indexOf('hsl') !== -1) {\n values[1] = `${values[1]}%`;\n values[2] = `${values[2]}%`;\n }\n if (type.indexOf('color') !== -1) {\n values = `${colorSpace} ${values.join(' ')}`;\n } else {\n values = `${values.join(', ')}`;\n }\n\n return `${type}(${values})`;\n}\n\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param canvas - A CSS color that alpha based backgrounds blends into\n * @returns A contrast ratio value in the range 0 - 21.\n * @beta\n */\nexport function getContrastRatio(foreground: string, background: string, canvas?: string) {\n const lumA = getLuminance(foreground);\n const lumB = getLuminance(background, canvas);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param background - CSS color that needs to be take in to account to calculate luminance for colors with opacity\n * @returns The relative brightness of the color in the range 0 - 1\n * @beta\n */\nexport function getLuminance(color: string, background?: string) {\n const parts = decomposeColor(color);\n\n let rgb = parts.type === 'hsl' ? decomposeColor(hslToRgb(color)).values : parts.values;\n\n if (background && parts.type === 'rgba') {\n const backgroundParts = decomposeColor(background);\n const alpha = rgb[3];\n rgb[0] = rgb[0] * alpha + backgroundParts.values[0] * (1 - alpha);\n rgb[1] = rgb[1] * alpha + backgroundParts.values[1] * (1 - alpha);\n rgb[2] = rgb[2] * alpha + backgroundParts.values[2] * (1 - alpha);\n }\n\n const rgbNumbers = rgb.map((val: any) => {\n if (parts.type !== 'color') {\n val /= 255; // normalized\n }\n return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;\n });\n\n // Truncate at 3 digits\n return Number((0.2126 * rgbNumbers[0] + 0.7152 * rgbNumbers[1] + 0.0722 * rgbNumbers[2]).toFixed(3));\n}\n\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n * @param color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param coefficient=0.15 - multiplier in the range 0 - 1\n * @returns A CSS color string. Hex input values are returned as rgb\n * @beta\n */\nexport function emphasize(color: string, coefficient = 0.15) {\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\n\n/**\n * Set the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n * @param color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param value - value to set the alpha channel to in the range 0 - 1\n * @returns A CSS color string. Hex input values are returned as rgb\n * @beta\n */\nexport function alpha(color: string, value: number) {\n if (color === '') {\n return '#000000';\n }\n\n value = clamp(value);\n\n // hex 3, hex 4 (w/alpha), hex 6, hex 8 (w/alpha)\n if (color[0] === '#') {\n if (color.length === 9) {\n color = color.substring(0, 7);\n } else if (color.length <= 5) {\n let c = '#';\n for (let i = 1; i < 4; i++) {\n c += color[i] + color[i];\n }\n color = c;\n }\n\n return (\n color +\n Math.round(value * 255)\n .toString(16)\n .padStart(2, '0')\n );\n }\n // rgb(, hsl(\n else if (color[3] === '(') {\n // rgb() and hsl() do not require the \"a\" suffix to accept alpha values in modern browsers:\n // https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb()#accepts_alpha_value\n return color.replace(')', `, ${value})`);\n }\n // rgba(, hsla(\n else if (color[4] === '(') {\n return color.substring(0, color.lastIndexOf(',')) + `, ${value})`;\n }\n\n const parts = decomposeColor(color);\n\n if (parts.type === 'color') {\n parts.values[3] = `/${value}`;\n } else {\n parts.values[3] = value;\n }\n\n return recomposeColor(parts);\n}\n\n/**\n * Darkens a color.\n * @param color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param coefficient - multiplier in the range 0 - 1\n * @returns A CSS color string. Hex input values are returned as rgb\n * @beta\n */\nexport function darken(color: string, coefficient: number) {\n const parts = decomposeColor(color);\n coefficient = clamp(coefficient);\n\n if (parts.type.indexOf('hsl') !== -1) {\n parts.values[2] *= 1 - coefficient;\n } else if (parts.type.indexOf('rgb') !== -1 || parts.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n parts.values[i] *= 1 - coefficient;\n }\n }\n return recomposeColor(parts);\n}\n\n/**\n * Lightens a color.\n * @param color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param coefficient - multiplier in the range 0 - 1\n * @returns A CSS color string. Hex input values are returned as rgb\n * @beta\n */\nexport function lighten(color: string, coefficient: number) {\n const parts = decomposeColor(color);\n coefficient = clamp(coefficient);\n\n if (parts.type.indexOf('hsl') !== -1) {\n parts.values[2] += (100 - parts.values[2]) * coefficient;\n } else if (parts.type.indexOf('rgb') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n parts.values[i] += (255 - parts.values[i]) * coefficient;\n }\n } else if (parts.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n parts.values[i] += (1 - parts.values[i]) * coefficient;\n }\n }\n\n return recomposeColor(parts);\n}\n\ninterface DecomposeColor {\n type: string;\n values: any;\n colorSpace?: string;\n}\n\nexport const colorManipulator = {\n clamp,\n hexToRgb,\n rgbToHex,\n asHexString,\n asRgbString,\n hslToRgb,\n decomposeColor,\n recomposeColor,\n getContrastRatio,\n getLuminance,\n emphasize,\n alpha,\n darken,\n lighten,\n};\n","import { createContext } from 'react';\n\nimport { createTheme } from './createTheme';\n\n/** @public */\nexport const ThemeContext = createContext(createTheme());\n\nThemeContext.displayName = 'ThemeContext';\n","/** @beta */\nexport interface ThemeBreakpointValues {\n xs: number;\n sm: number;\n md: number;\n lg: number;\n xl: number;\n xxl: number;\n}\n\n/** @beta */\nexport type ThemeBreakpointsKey = keyof ThemeBreakpointValues;\n\n/** @beta */\nexport interface ThemeBreakpoints {\n values: ThemeBreakpointValues;\n keys: string[];\n unit: string;\n up: (key: ThemeBreakpointsKey | number) => string;\n down: (key: ThemeBreakpointsKey | number) => string;\n}\n\n/** @internal */\nexport function createBreakpoints(): ThemeBreakpoints {\n const step = 5;\n const keys = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];\n const unit = 'px';\n const values: ThemeBreakpointValues = {\n xs: 0,\n sm: 544,\n md: 769, // 1 more than regular ipad in portrait\n lg: 992,\n xl: 1200,\n xxl: 1440,\n };\n\n function up(key: ThemeBreakpointsKey | number) {\n const value = typeof key === 'number' ? key : values[key];\n return `@media (min-width:${value}${unit})`;\n }\n\n function down(key: ThemeBreakpointsKey | number) {\n const value = typeof key === 'number' ? key : values[key];\n return `@media (max-width:${value - step / 100}${unit})`;\n }\n\n // TODO add functions for between and only\n\n return {\n values,\n up,\n down,\n keys,\n unit,\n };\n}\n","export const palette = {\n white: '#ffffff',\n black: '#000000',\n\n gray25: '#2c3235',\n gray15: '#22252b', //'#202226',\n gray10: '#181b1f', // old '#141619',\n gray05: '#111217', // old '#0b0c0e',\n\n // new from figma,\n darkLayer0: '#18181a',\n darkLayer1: '#212124',\n darkLayer2: '#2a2a2f', // figma used #34343B but a bit too bright\n\n darkBorder1: '#34343b',\n darkBorder2: '#64646b',\n\n // Dashboard bg / layer 0 (light theme)\n gray90: '#f4f5f5',\n // Card bg / layer 1\n gray100: '#f4f5f5',\n // divider line\n gray80: '#d0d1d3',\n // from figma\n lightBorder1: '#e4e7e7',\n\n blueDarkMain: '#3d71d9', // '#4165F5',\n blueDarkText: '#6e9fff', // '#58a6ff', //'#33a2e5', // '#5790FF',\n redDarkMain: '#d10e5c',\n redDarkText: '#ff5286',\n greenDarkMain: '#1a7f4b',\n greenDarkText: '#6ccf8e',\n orangeDarkMain: '#ff9900',\n orangeDarkText: '#fbad37',\n\n blueLightMain: '#3871dc',\n blueLightText: '#1f62e0',\n redLightMain: '#e0226e',\n redLightText: '#cf0e5B',\n greenLightMain: '#1b855e',\n greenLightText: '#0a764e',\n orangeLightMain: '#ff9900',\n orangeLightText: '#b5510d',\n};\n","import { merge } from 'lodash';\n\nimport { alpha, darken, emphasize, getContrastRatio, lighten } from './colorManipulator';\nimport { palette } from './palette';\nimport { DeepPartial, ThemeRichColor } from './types';\n\n/** @internal */\nexport type ThemeColorsMode = 'light' | 'dark';\n\n/** @internal */\nexport interface ThemeColorsBase<TColor> {\n mode: ThemeColorsMode;\n\n primary: TColor;\n secondary: TColor;\n info: TColor;\n error: TColor;\n success: TColor;\n warning: TColor;\n\n text: {\n primary: string;\n secondary: string;\n disabled: string;\n link: string;\n /** Used for auto white or dark text on colored backgrounds */\n maxContrast: string;\n };\n\n background: {\n /** Dashboard and body background */\n canvas: string;\n /** Primary content pane background (panels etc) */\n primary: string;\n /** Cards and elements that need to stand out on the primary background */\n secondary: string;\n /**\n * For popovers and menu backgrounds. This is the same color as primary in most light themes but in dark\n * themes it has a brighter shade to help give it contrast against the primary background.\n **/\n elevated: string;\n };\n\n border: {\n weak: string;\n medium: string;\n strong: string;\n };\n\n gradients: {\n brandVertical: string;\n brandHorizontal: string;\n };\n\n action: {\n /** Used for selected menu item / select option */\n selected: string;\n /**\n * @alpha (Do not use from plugins)\n * Used for selected items when background only change is not enough (Currently only used for FilterPill)\n **/\n selectedBorder: string;\n /** Used for hovered menu item / select option */\n hover: string;\n /** Used for button/colored background hover opacity */\n hoverOpacity: number;\n /** Used focused menu item / select option */\n focus: string;\n /** Used for disabled buttons and inputs */\n disabledBackground: string;\n /** Disabled text */\n disabledText: string;\n /** Disablerd opacity */\n disabledOpacity: number;\n };\n\n hoverFactor: number;\n contrastThreshold: number;\n tonalOffset: number;\n}\n\nexport interface ThemeHoverStrengh {}\n\n/** @beta */\nexport interface ThemeColors extends ThemeColorsBase<ThemeRichColor> {\n /** Returns a text color for the background */\n getContrastText(background: string, threshold?: number): string;\n /* Brighten or darken a color by specified factor (0-1) */\n emphasize(color: string, amount?: number): string;\n}\n\n/** @internal */\nexport type ThemeColorsInput = DeepPartial<ThemeColorsBase<ThemeRichColor>>;\n\nclass DarkColors implements ThemeColorsBase<Partial<ThemeRichColor>> {\n mode: ThemeColorsMode = 'dark';\n\n // Used to get more white opacity colors\n whiteBase = '204, 204, 220';\n\n border = {\n weak: `rgba(${this.whiteBase}, 0.12)`,\n medium: `rgba(${this.whiteBase}, 0.2)`,\n strong: `rgba(${this.whiteBase}, 0.30)`,\n };\n\n text = {\n primary: `rgb(${this.whiteBase})`,\n secondary: `rgba(${this.whiteBase}, 0.65)`,\n disabled: `rgba(${this.whiteBase}, 0.6)`,\n link: palette.blueDarkText,\n maxContrast: palette.white,\n };\n\n primary = {\n main: palette.blueDarkMain,\n text: palette.blueDarkText,\n border: palette.blueDarkText,\n };\n\n secondary = {\n main: `rgba(${this.whiteBase}, 0.10)`,\n shade: `rgba(${this.whiteBase}, 0.14)`,\n transparent: `rgba(${this.whiteBase}, 0.08)`,\n text: this.text.primary,\n contrastText: `rgb(${this.whiteBase})`,\n border: `rgba(${this.whiteBase}, 0.08)`,\n };\n\n info = this.primary;\n\n error = {\n main: palette.redDarkMain,\n text: palette.redDarkText,\n };\n\n success = {\n main: palette.greenDarkMain,\n text: palette.greenDarkText,\n };\n\n warning = {\n main: palette.orangeDarkMain,\n text: palette.orangeDarkText,\n };\n\n background = {\n canvas: palette.gray05,\n primary: palette.gray10,\n secondary: palette.gray15,\n elevated: palette.gray15,\n };\n\n action = {\n hover: `rgba(${this.whiteBase}, 0.16)`,\n selected: `rgba(${this.whiteBase}, 0.12)`,\n selectedBorder: palette.orangeDarkMain,\n focus: `rgba(${this.whiteBase}, 0.16)`,\n hoverOpacity: 0.08,\n disabledText: this.text.disabled,\n disabledBackground: `rgba(${this.whiteBase}, 0.04)`,\n disabledOpacity: 0.38,\n };\n\n gradients = {\n brandHorizontal: 'linear-gradient(270deg, #F55F3E 0%, #FF8833 100%)',\n brandVertical: 'linear-gradient(0.01deg, #F55F3E 0.01%, #FF8833 99.99%)',\n };\n\n contrastThreshold = 3;\n hoverFactor = 0.03;\n tonalOffset = 0.15;\n}\n\nclass LightColors implements ThemeColorsBase<Partial<ThemeRichColor>> {\n mode: ThemeColorsMode = 'light';\n\n blackBase = '36, 41, 46';\n\n primary = {\n main: palette.blueLightMain,\n border: palette.blueLightText,\n text: palette.blueLightText,\n };\n\n text = {\n primary: `rgba(${this.blackBase}, 1)`,\n secondary: `rgba(${this.blackBase}, 0.75)`,\n disabled: `rgba(${this.blackBase}, 0.64)`,\n link: this.primary.text,\n maxContrast: palette.black,\n };\n\n border = {\n weak: `rgba(${this.blackBase}, 0.12)`,\n medium: `rgba(${this.blackBase}, 0.3)`,\n strong: `rgba(${this.blackBase}, 0.4)`,\n };\n\n secondary = {\n main: `rgba(${this.blackBase}, 0.08)`,\n shade: `rgba(${this.blackBase}, 0.15)`,\n transparent: `rgba(${this.blackBase}, 0.08)`,\n contrastText: `rgba(${this.blackBase}, 1)`,\n text: this.text.primary,\n border: this.border.weak,\n };\n\n info = {\n main: palette.blueLightMain,\n text: palette.blueLightText,\n };\n\n error = {\n main: palette.redLightMain,\n text: palette.redLightText,\n border: palette.redLightText,\n };\n\n success = {\n main: palette.greenLightMain,\n text: palette.greenLightText,\n };\n\n warning = {\n main: palette.orangeLightMain,\n text: palette.orangeLightText,\n };\n\n background = {\n canvas: palette.gray90,\n primary: palette.white,\n secondary: palette.gray100,\n elevated: palette.white,\n };\n\n action = {\n hover: `rgba(${this.blackBase}, 0.12)`,\n selected: `rgba(${this.blackBase}, 0.08)`,\n selectedBorder: palette.orangeLightMain,\n hoverOpacity: 0.08,\n focus: `rgba(${this.blackBase}, 0.12)`,\n disabledBackground: `rgba(${this.blackBase}, 0.04)`,\n disabledText: this.text.disabled,\n disabledOpacity: 0.38,\n };\n\n gradients = {\n brandHorizontal: 'linear-gradient(90deg, #FF8833 0%, #F53E4C 100%)',\n brandVertical: 'linear-gradient(0.01deg, #F53E4C -31.2%, #FF8833 113.07%)',\n };\n\n contrastThreshold = 3;\n hoverFactor = 0.03;\n tonalOffset = 0.2;\n}\n\nexport function createColors(colors: ThemeColorsInput): ThemeColors {\n const dark = new DarkColors();\n const light = new LightColors();\n const base = (colors.mode ?? 'dark') === 'dark' ? dark : light;\n const {\n primary = base.primary,\n secondary = base.secondary,\n info = base.info,\n warning = base.warning,\n success = base.success,\n error = base.error,\n tonalOffset = base.tonalOffset,\n hoverFactor = base.hoverFactor,\n contrastThreshold = base.contrastThreshold,\n ...other\n } = colors;\n\n function getContrastText(background: string, threshold: number = contrastThreshold) {\n const contrastText =\n getContrastRatio(dark.text.maxContrast, background, base.background.primary) >= threshold\n ? dark.text.maxContrast\n : light.text.maxContrast;\n // todo, need color framework\n return contrastText;\n }\n\n const getRichColor = ({ color, name }: GetRichColorProps): ThemeRichColor => {\n color = { ...color, name };\n if (!color.main) {\n color.main = base[name].main;\n }\n if (!color.text) {\n color.text = color.main;\n }\n if (!color.border) {\n color.border = color.text;\n }\n if (!color.shade) {\n color.shade = base.mode === 'light' ? darken(color.main, tonalOffset) : lighten(color.main, tonalOffset);\n }\n if (!color.transparent) {\n color.transparent = alpha(color.main, 0.15);\n }\n if (!color.contrastText) {\n color.contrastText = getContrastText(color.main);\n }\n if (!color.borderTransparent) {\n color.borderTransparent = alpha(color.border, 0.25);\n }\n return color as ThemeRichColor;\n };\n\n return merge(\n {\n ...base,\n primary: getRichColor({ color: primary, name: 'primary' }),\n secondary: getRichColor({ color: secondary, name: 'secondary' }),\n info: getRichColor({ color: info, name: 'info' }),\n error: getRichColor({ color: error, name: 'error' }),\n success: getRichColor({ color: success, name: 'success' }),\n warning: getRichColor({ color: warning, name: 'warning' }),\n getContrastText,\n emphasize: (color: string, factor?: number) => {\n return emphasize(color, factor ?? hoverFactor);\n },\n },\n other\n );\n}\n\ntype RichColorNames = 'primary' | 'secondary' | 'info' | 'error' | 'success' | 'warning';\n\ninterface GetRichColorProps {\n color: Partial<ThemeRichColor>;\n name: RichColorNames;\n}\n","import { ThemeColors } from './createColors';\nimport { ThemeShadows } from './createShadows';\n\n/** @beta */\nexport interface ThemeComponents {\n /** Applies to normal buttons, inputs, radio buttons, etc */\n height: {\n sm: number;\n md: number;\n lg: number;\n };\n input: {\n background: string;\n borderColor: string;\n borderHover: string;\n text: string;\n };\n tooltip: {\n text: string;\n background: string;\n };\n panel: {\n padding: number;\n headerHeight: number;\n borderColor: string;\n boxShadow: string;\n background: string;\n };\n dropdown: {\n background: string;\n };\n overlay: {\n background: string;\n };\n dashboard: {\n background: string;\n padding: number;\n };\n textHighlight: {\n background: string;\n text: string;\n };\n sidemenu: {\n width: number;\n };\n menuTabs: {\n height: number;\n };\n horizontalDrawer: {\n defaultHeight: number;\n };\n table: {\n rowHoverBackground: string;\n rowSelected: string;\n };\n}\n\nexport function createComponents(colors: ThemeColors, shadows: ThemeShadows): ThemeComponents {\n const panel = {\n padding: 1,\n headerHeight: 4,\n background: colors.background.primary,\n borderColor: colors.border.weak,\n boxShadow: 'none',\n };\n\n const input = {\n borderColor: colors.border.medium,\n borderHover: colors.border.strong,\n text: colors.text.primary,\n background: colors.mode === 'dark' ? colors.background.canvas : colors.background.primary,\n };\n\n return {\n height: {\n sm: 3,\n md: 4,\n lg: 6,\n },\n input,\n panel,\n dropdown: {\n background: colors.background.elevated,\n },\n tooltip: {\n background: colors.background.elevated,\n text: colors.text.primary,\n },\n dashboard: {\n background: colors.background.canvas,\n padding: 1,\n },\n overlay: {\n background: colors.mode === 'dark' ? 'rgba(63, 62, 62, 0.45)' : 'rgba(208, 209, 211, 0.24)',\n },\n sidemenu: {\n width: 57,\n },\n menuTabs: {\n height: 5,\n },\n textHighlight: {\n text: colors.warning.contrastText,\n background: colors.warning.main,\n },\n horizontalDrawer: {\n defaultHeight: 400,\n },\n table: {\n rowHoverBackground: colors.action.hover,\n rowSelected: colors.action.selected,\n },\n };\n}\n","import { ThemeColors } from './createColors';\n\n/** @beta */\nexport interface ThemeShadows {\n z1: string;\n z2: string;\n z3: string;\n}\n\n/** @alpha */\nexport function createShadows(colors: ThemeColors): ThemeShadows {\n if (colors.mode === 'dark') {\n return {\n z1: '0px 1px 2px rgba(1, 4, 9, 0.75)',\n z2: '0px 4px 8px rgba(1, 4, 9, 0.75)',\n z3: '0px 8px 24px rgb(1, 4, 9)',\n };\n }\n\n return {\n z1: '0px 1px 2px rgba(24, 26, 27, 0.2)',\n z2: '0px 4px 8px rgba(24, 26, 27, 0.2)',\n z3: '0px 13px 20px 1px rgba(24, 26, 27, 0.18)',\n };\n}\n","/** @beta */\nexport interface ThemeShape {\n /**\n * @deprecated Use `theme.shape.radius.default`, `theme.shape.radius.pill` or `theme.shape.radius.circle` instead\n */\n borderRadius: (amount?: number) => string;\n radius: Radii;\n}\n\ninterface Radii {\n default: string;\n pill: string;\n circle: string;\n}\n\n/** @internal */\nexport interface ThemeShapeInput {\n borderRadius?: number;\n}\n\nexport function createShape(options: ThemeShapeInput): ThemeShape {\n const baseBorderRadius = options.borderRadius ?? 2;\n\n const radius = {\n default: `${baseBorderRadius}px`,\n pill: '9999px',\n circle: '100%',\n };\n\n /**\n * @deprecated Use `theme.shape.radius.default`, `theme.shape.radius.pill` or `theme.shape.radius.circle`instead\n * @param amount\n */\n const borderRadius = (amount?: number) => {\n const value = (amount ?? 1) * baseBorderRadius;\n return `${value}px`;\n };\n\n return {\n radius,\n borderRadius,\n };\n}\n","// Code based on Material UI\n// The MIT License (MIT)\n// Copyright (c) 2014 Call-Em-All\n\n/** @internal */\nexport type ThemeSpacingOptions = {\n gridSize?: number;\n};\n\n/** @internal */\nexport type ThemeSpacingArgument = number | string;\n\n/**\n * @beta\n * The different signatures imply different meaning for their arguments that can't be expressed structurally.\n * We express the difference with variable names.\n * tslint:disable:unified-signatures */\nexport interface ThemeSpacing extends SpacingTokens {\n (): string;\n (value: ThemeSpacingArgument): string;\n (topBottom: ThemeSpacingArgument, rightLeft: ThemeSpacingArgument): string;\n (top: ThemeSpacingArgument, rightLeft: ThemeSpacingArgument, bottom: ThemeSpacingArgument): string;\n (\n top: ThemeSpacingArgument,\n right: ThemeSpacingArgument,\n bottom: ThemeSpacingArgument,\n left: ThemeSpacingArgument\n ): string;\n gridSize: number;\n}\n\n// Possible spacing token options\nexport type ThemeSpacingTokens = 0 | 0.25 | 0.5 | 1 | 1.5 | 2 | 2.5 | 3 | 4 | 5 | 6 | 8 | 10;\n\n// Spacing tokens as represented in the theme\ntype SpacingTokens = {\n [key in `x${Exclude<ThemeSpacingTokens, 0.25 | 0.5 | 1.5 | 2.5> | '0_25' | '0_5' | '1_5' | '2_5'}`]: string;\n};\n\n/** @internal */\nexport function createSpacing(options: ThemeSpacingOptions = {}): ThemeSpacing {\n const { gridSize = 8 } = options;\n\n const transform = (value: ThemeSpacingArgument) => {\n if (typeof value === 'string') {\n return value;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof value !== 'number') {\n console.error(`Expected spacing argument to be a number or a string, got ${value}.`);\n }\n }\n return value * gridSize;\n };\n\n const spacing = (...args: Array<number | string>): string => {\n if (process.env.NODE_ENV !== 'production') {\n if (!(args.length <= 4)) {\n console.error(`Too many arguments provided, expected between 0 and 4, got ${args.length}`);\n }\n }\n\n if (args.length === 0) {\n args[0] = 1;\n }\n\n return args\n .map((argument) => {\n const output = transform(argument);\n return typeof output === 'number' ? `${output}px` : output;\n })\n .join(' ');\n };\n\n spacing.gridSize = gridSize;\n\n // Design system spacing tokens\n // Added in v10.2 of Grafana, if using spacing in a plugin that needs compatibility with older versions\n // use the spacing function instead.\n spacing.x0 = '0px';\n spacing.x0_25 = '2px';\n spacing.x0_5 = '4px';\n spacing.x1 = '8px';\n spacing.x1_5 = '12px';\n spacing.x2 = '16px';\n spacing.x2_5 = '20px';\n spacing.x3 = '24px';\n spacing.x4 = '32px';\n spacing.x5 = '40px';\n spacing.x6 = '48px';\n spacing.x8 = '64px';\n spacing.x10 = '80px';\n\n return spacing;\n}\n","// Code based on Material UI\n// The MIT License (MIT)\n// Copyright (c) 2014 Call-Em-All\n\n// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves\n// to learn the context in which each easing should be used.\nconst easing = {\n // This is the most common easing curve.\n easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',\n // Objects enter the screen at full velocity from off-screen and\n // slowly decelerate to a resting point.\n easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',\n // Objects leave the screen at full velocity. They do not decelerate when off-screen.\n easeIn: 'cubic-bezier(0.4, 0, 1, 1)',\n // The sharp curve is used by objects that may return to the screen at any time.\n sharp: 'cubic-bezier(0.4, 0, 0.6, 1)',\n};\n\n// Follow https://material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations\n// to learn when use what timing\nconst duration = {\n shortest: 150,\n shorter: 200,\n short: 250,\n // most basic recommended timing\n standard: 300,\n // this is to be used in complex animations\n complex: 375,\n // recommended when something is entering screen\n enteringScreen: 225,\n // recommended when something is leaving screen\n leavingScreen: 195,\n};\n\n/** @alpha */\nexport interface CreateTransitionOptions {\n duration?: number | string;\n easing?: string;\n delay?: number | string;\n}\n\n/** @alpha */\nexport function create(props: string | string[] = ['all'], options: CreateTransitionOptions = {}) {\n const { duration: durationOption = duration.standard, easing: easingOption = easing.easeInOut, delay = 0 } = options;\n\n return (Array.isArray(props) ? props : [props])\n .map(\n (animatedProp) =>\n `${animatedProp} ${\n typeof durationOption === 'string' ? durationOption : formatMs(durationOption)\n } ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`\n )\n .join(',');\n}\n\ntype ReducedMotionProps = 'no-preference' | 'reduce';\n\nexport function handleMotion(...props: ReducedMotionProps[]) {\n return `@media ${props.map((prop) => `(prefers-reduced-motion: ${prop})`).join(',')}`;\n}\n\nexport function getAutoHeightDuration(height: number) {\n if (!height) {\n return 0;\n }\n\n const constant = height / 36;\n\n // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10\n return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);\n}\n\nfunction formatMs(milliseconds: number) {\n return `${Math.round(milliseconds)}ms`;\n}\n\n/** @alpha */\nexport interface ThemeTransitions {\n create: typeof create;\n duration: typeof duration;\n easing: typeof easing;\n getAutoHeightDuration: typeof getAutoHeightDuration;\n handleMotion: typeof handleMotion;\n}\n\n/** @internal */\nexport function createTransitions(): ThemeTransitions {\n return {\n create,\n duration,\n easing,\n getAutoHeightDuration,\n handleMotion,\n };\n}\n","// Code based on Material UI\n// The MIT License (MIT)\n// Copyright (c) 2014 Call-Em-All\n\nimport { ThemeColors } from './createColors';\n\n/** @beta */\nexport interface ThemeTypography extends ThemeTypographyVariantTypes {\n fontFamily: string;\n fontFamilyMonospace: string;\n fontSize: number;\n fontWeightLight: number;\n fontWeightRegular: number;\n fontWeightMedium: number;\n fontWeightBold: number;\n\n // The font-size on the html element.\n htmlFontSize?: number;\n\n /**\n * @deprecated\n * from legacy old theme\n * */\n size: {\n base: string;\n xs: string;\n sm: string;\n md: string;\n lg: string;\n };\n\n pxToRem: (px: number) => string;\n}\n\nexport interface ThemeTypographyVariant {\n fontSize: string;\n fontWeight: number;\n lineHeight: number;\n fontFamily: string;\n letterSpacing?: string;\n}\n\nexport interface ThemeTypographyInput {\n fontFamily?: string;\n fontFamilyMonospace?: string;\n fontSize?: number;\n fontWeightLight?: number;\n fontWeightRegular?: number;\n fontWeightMedium?: number;\n fontWeightBold?: number;\n // hat's the font-size on the html element.\n // 16px is the default font-size used by browsers.\n htmlFontSize?: number;\n}\n\nconst defaultFontFamily = \"'Inter', 'Helvetica', 'Arial', sans-serif\";\nconst defaultFontFamilyMonospace = \"'Roboto Mono', monospace\";\n\nexport function createTypography(colors: ThemeColors, typographyInput: ThemeTypographyInput = {}): ThemeTypography {\n const {\n fontFamily = defaultFontFamily,\n fontFamilyMonospace = defaultFontFamilyMonospace,\n // The default font size of the Material Specification.\n fontSize = 14, // px\n fontWeightLight = 300,\n fontWeightRegular = 400,\n fontWeightMedium = 500,\n fontWeightBold = 500,\n // Tell Grafana-UI what's the font-size on the html element.\n // 16px is the default font-size used by browsers.\n htmlFontSize = 14,\n } = typographyInput;\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof fontSize !== 'number') {\n console.error('Grafana-UI: `fontSize` is required to be a number.');\n }\n\n if (typeof htmlFontSize !== 'number') {\n console.error('Grafana-UI: `htmlFontSize` is required to be a number.');\n }\n }\n\n const coef = fontSize / 14;\n const pxToRem = (size: number) => `${(size / htmlFontSize) * coef}rem`;\n const buildVariant = (\n fontWeight: number,\n size: number,\n lineHeight: number,\n letterSpacing: number,\n casing?: object\n ): ThemeTypographyVariant => {\n if (lineHeight % 2 !== 0 || size % 2 !== 0) {\n throw new Error('Font size and line height should be integer multiples of 2 to prevent issues with alignment');\n }\n\n return {\n fontFamily,\n fontWeight,\n fontSize: pxToRem(size),\n lineHeight: lineHeight / size,\n ...(fontFamily === defaultFontFamily ? { letterSpacing: `${round(letterSpacing / size)}em` } : {}),\n ...casing,\n };\n };\n\n // All our fonts/line heights should be integer multiples of 2 to prevent issues with alignment\n const variants = {\n h1: buildVariant(fontWeightRegular, 28, 32, -0.25),\n h2: buildVariant(fontWeightRegular, 24, 28, 0),\n h3: buildVariant(fontWeightRegular, 22, 24, 0),\n h4: buildVariant(fontWeightRegular, 18, 22, 0.25),\n h5: buildVariant(fontWeightRegular, 16, 22, 0),\n h6: buildVariant(fontWeightMedium, 14, 22, 0.15),\n body: buildVariant(fontWeightRegular, fontSize, 22, 0.15),\n bodySmall: buildVariant(fontWeightRegular, 12, 18, 0.15),\n code: { ...buildVariant(fontWeightRegular, 14, 16, 0.15), fontFamily: fontFamilyMonospace },\n };\n\n const size = {\n base: '14px',\n xs: '10px',\n sm: '12px',\n md: '14px',\n lg: '18px',\n };\n\n return {\n htmlFontSize,\n pxToRem,\n fontFamily,\n fontFamilyMonospace,\n fontSize,\n fontWeightLight,\n fontWeightRegular,\n fontWeightMedium,\n fontWeightBold,\n size,\n ...variants,\n };\n}\n\nfunction round(value: number) {\n return Math.round(value * 1e5) / 1e5;\n}\n\nexport interface ThemeTypographyVariantTypes {\n h1: ThemeTypographyVariant;\n h2: ThemeTypographyVariant;\n h3: ThemeTypographyVariant;\n h4: ThemeTypographyVariant;\n h5: ThemeTypographyVariant;\n h6: ThemeTypographyVariant;\n body: ThemeTypographyVariant;\n bodySmall: ThemeTypographyVariant;\n code: ThemeTypographyVariant;\n}\n","import { GrafanaTheme, GrafanaThemeCommons, GrafanaThemeType } from '../types/theme';\n\nimport { GrafanaTheme2 } from './types';\n\nexport function createV1Theme(theme: Omit<GrafanaTheme2, 'v1'>): GrafanaTheme {\n const oldCommon: GrafanaThemeCommons = {\n name: 'Grafana Default',\n typography: {\n fontFamily: {\n sansSerif: theme.typography.fontFamily,\n monospace: theme.typography.fontFamilyMonospace,\n },\n size: {\n base: `${theme.typography.fontSize}px`,\n xs: theme.typography.size.xs,\n sm: theme.typography.size.sm,\n md: theme.typography.size.md,\n lg: theme.typography.size.lg,\n },\n heading: {\n h1: theme.typography.h1.fontSize,\n h2: theme.typography.h2.fontSize,\n h3: theme.typography.h3.fontSize,\n h4: theme.typography.h4.fontSize,\n h5: theme.typography.h5.fontSize,\n h6: theme.typography.h6.fontSize,\n },\n weight: {\n light: theme.typography.fontWeightLight,\n regular: theme.typography.fontWeightRegular,\n semibold: theme.typography.fontWeightMedium,\n bold: theme.typography.fontWeightBold,\n },\n lineHeight: {\n xs: theme.typography.bodySmall.lineHeight,\n sm: theme.typography.bodySmall.lineHeight,\n md: theme.typography.body.lineHeight,\n lg: theme.typography.h2.lineHeight,\n },\n link: {\n decoration: 'none',\n hoverDecoration: 'none',\n },\n },\n breakpoints: {\n xs: `${theme.breakpoints.values.xs}px`,\n sm: `${theme.breakpoints.values.sm}px`,\n md: `${theme.breakpoints.values.md}px`,\n lg: `${theme.breakpoints.values.lg}px`,\n xl: `${theme.breakpoints.values.xl}px`,\n xxl: `${theme.breakpoints.values.xxl}px`,\n },\n spacing: {\n base: theme.spacing.gridSize,\n insetSquishMd: theme.spacing(0.5, 1),\n d: theme.spacing(2),\n xxs: theme.spacing(0.25),\n xs: theme.spacing(0.5),\n sm: theme.spacing(1),\n md: theme.spacing(2),\n lg: theme.spacing(3),\n xl: theme.spacing(4),\n gutter: theme.spacing(4),\n\n // Next-gen forms spacing variables\n // TODO: Move variables definition to respective components when implementing\n formSpacingBase: theme.spacing.gridSize,\n formMargin: `${theme.spacing.gridSize * 4}px`,\n formFieldsetMargin: `${theme.spacing.gridSize * 2}px`,\n formInputHeight: theme.spacing.gridSize * 4,\n formButtonHeight: theme.spacing.gridSize * 4,\n formInputPaddingHorizontal: `${theme.spacing.gridSize}px`,\n\n // Used for icons do define spacing between icon and input field\n // Applied on the right(prefix) or left(suffix)\n formInputAffixPaddingHorizontal: `${theme.spacing.gridSize / 2}px`,\n\n formInputMargin: `${theme.spacing.gridSize * 2}px`,\n formLabelPadding: '0 0 0 2px',\n formLabelMargin: `0 0 ${theme.spacing.gridSize / 2 + 'px'} 0`,\n formValidationMessagePadding: '4px 8px',\n formValidationMessageMargin: '4px 0 0 0',\n inlineFormMargin: '4px',\n },\n border: {\n radius: {\n sm: theme.shape.borderRadius(1),\n md: theme.shape.borderRadius(2),\n lg: theme.shape.borderRadius(3),\n },\n width: {\n sm: '1px',\n },\n },\n height: {\n sm: theme.spacing.gridSize * theme.components.height.sm,\n md: theme.spacing.gridSize * theme.components.height.md,\n lg: theme.spacing.gridSize * theme.components.height.lg,\n },\n panelPadding: theme.components.panel.padding * theme.spacing.gridSize,\n panelHeaderHeight: theme.spacing.gridSize * theme.components.panel.headerHeight,\n zIndex: theme.zIndex,\n };\n\n const basicColors = {\n ...commonColorsPalette,\n black: '#000000',\n white: '#ffffff',\n dark1: '#141414',\n dark2: '#161719',\n dark3: '#1f1f20',\n dark4: '#212124',\n dark5: '#222426',\n dark6: '#262628',\n dark7: '#292a2d',\n dark8: '#2f2f32',\n dark9: '#343436',\n dark10: '#424345',\n gray1: '#555555',\n gray2: '#8e8e8e',\n gray3: '#b3b3b3',\n gray4: '#d8d9da',\n gray5: '#ececec',\n gray6: '#f4f5f8', // not used in dark theme\n gray7: '#fbfbfb', // not used in dark theme\n redBase: '#e02f44',\n redShade: '#c4162a',\n greenBase: '#299c46',\n greenShade: '#23843b',\n red: '#d44a3a',\n yellow: '#ecbb13',\n purple: '#9933cc',\n variable: '#32d1df',\n orange: '#eb7b18',\n orangeDark: '#ff780a',\n };\n\n const backgrounds = {\n bg1: theme.colors.background.primary,\n bg2: theme.colors.background.secondary,\n bg3: theme.colors.action.hover,\n dashboardBg: theme.colors.background.canvas,\n bgBlue1: theme.colors.primary.main,\n bgBlue2: theme.colors.primary.shade,\n };\n\n const borders = {\n border1: theme.colors.border.weak,\n border2: theme.colors.border.medium,\n border3: theme.colors.border.strong,\n };\n\n const textColors = {\n textStrong: theme.colors.text.maxContrast,\n textHeading: theme.colors.text.primary,\n text: theme.colors.text.primary,\n textSemiWeak: theme.colors.text.secondary,\n textWeak: theme.colors.text.secondary,\n textFaint: theme.colors.text.disabled,\n textBlue: theme.colors.primary.text,\n };\n\n const form = {\n // Next-gen forms functional colors\n formLabel: theme.colors.text.primary,\n formDescription: theme.colors.text.secondary,\n formInputBg: theme.components.input.background,\n formInputBgDisabled: theme.colors.action.disabledBackground,\n formInputBorder: theme.components.input.borderColor,\n formInputBorderHover: theme.components.input.borderHover,\n formInputBorderActive: theme.colors.primary.border,\n formInputBorderInvalid: theme.colors.error.border,\n formInputPlaceholderText: theme.colors.text.disabled,\n formInputText: theme.components.input.text,\n formInputDisabledText: theme.colors.action.disabledText,\n formFocusOutline: theme.colors.primary.main,\n formValidationMessageText: theme.colors.error.contrastText,\n formValidationMessageBg: theme.colors.error.main,\n };\n\n return {\n ...oldCommon,\n type: theme.colors.mode === 'dark' ? GrafanaThemeType.Dark : GrafanaThemeType.Light,\n isDark: theme.isDark,\n isLight: theme.isLight,\n name: theme.name,\n palette: {\n ...basicColors,\n brandPrimary: basicColors.orange,\n brandSuccess: theme.colors.success.main,\n brandWarning: theme.colors.warning.main,\n brandDanger: theme.colors.error.main,\n queryRed: theme.colors.error.text,\n queryGreen: theme.colors.success.text,\n queryPurple: '#fe85fc',\n queryOrange: basicColors.orange,\n online: theme.colors.success.main,\n warn: theme.colors.success.main,\n critical: theme.colors.success.main,\n },\n colors: {\n ...backgrounds,\n ...borders,\n ...form,\n ...textColors,\n\n bodyBg: theme.colors.background.canvas,\n panelBg: theme.components.panel.background,\n panelBorder: theme.components.panel.borderColor,\n pageHeaderBg: theme.colors.background.canvas,\n pageHeaderBorder: theme.colors.background.canvas,\n\n dropdownBg: form.formInputBg,\n dropdownShadow: basicColors.black,\n dropdownOptionHoverBg: backgrounds.bg2,\n\n link: theme.colors.text.primary,\n linkDisabled: theme.colors.text.disabled,\n linkHover: theme.colors.text.maxContrast,\n linkExternal: theme.colors.text.link,\n },\n shadows: {\n listItem: 'none',\n },\n visualization: theme.visualization,\n };\n}\n\nconst commonColorsPalette = {\n // New greys palette used by next-gen form elements\n gray98: '#f7f8fa',\n gray97: '#f1f5f9',\n gray95: '#e9edf2',\n gray90: '#dce1e6',\n gray85: '#c7d0d9',\n gray70: '#9fa7b3',\n gray60: '#7b8087',\n gray33: '#464c54',\n gray25: '#2c3235',\n gray15: '#202226',\n gray10: '#141619',\n gray05: '#0b0c0e',\n\n // New blues palette used by next-gen form elements\n blue95: '#5794f2', // blue95\n blue85: '#33a2e5', // blueText\n blue80: '#3274d9', // blue80\n blue77: '#1f60c4', // blue77\n\n // New reds palette used by next-gen form elements\n red88: '#e02f44',\n};\n","import { FALLBACK_COLOR } from '../types/fieldColor';\n\nimport { ThemeColors } from './createColors';\n\n/**\n * @alpha\n */\nexport interface ThemeVisualizationColors {\n /** Only for internal use by color schemes */\n palette: string[];\n /** Lookup the real color given the name */\n getColorByName: (color: string) => string;\n /** Colors organized by hue */\n hues: ThemeVizHue[];\n}\n\n/**\n * @alpha\n */\nexport interface ThemeVizColor {\n color: string;\n name: string;\n aliases?: string[];\n primary?: boolean;\n}\n\n/**\n * @alpha\n */\nexport interface ThemeVizHue {\n name: string;\n shades: ThemeVizColor[];\n}\n\n/**\n * @internal\n */\nexport function createVisualizationColors(colors: ThemeColors): ThemeVisualizationColors {\n const hues = colors.mode === 'light' ? getLightHues() : getDarkHues();\n\n const byNameIndex: Record<string, string> = {};\n\n for (const hue of hues) {\n for (const shade of hue.shades) {\n byNameIndex[shade.name] = shade.color;\n if (shade.aliases) {\n for (const alias of shade.aliases) {\n byNameIndex[alias] = shade.color;\n }\n }\n }\n }\n\n // special colors\n byNameIndex['transparent'] = colors.mode === 'light' ? 'rgba(255, 255, 255, 0)' : 'rgba(0,0,0,0)';\n byNameIndex['panel-bg'] = colors.background.primary;\n byNameIndex['text'] = colors.text.primary;\n\n const getColorByName = (colorName: string) => {\n if (!colorName) {\n return FALLBACK_COLOR;\n }\n\n const realColor = byNameIndex[colorName];\n if (realColor) {\n return realColor;\n }\n\n if (colorName[0] === '#') {\n return colorName;\n }\n\n if (colorName.indexOf('rgb') > -1) {\n return colorName;\n }\n\n const nativeColor = nativeColorNames[colorName.toLowerCase()];\n if (nativeColor) {\n byNameIndex[colorName] = nativeColor;\n return nativeColor;\n }\n\n return colorName;\n };\n\n const palette = getClassicPalette();\n\n return {\n hues,\n palette,\n getColorByName,\n };\n}\n\nfunction getDarkHues(): ThemeVizHue[] {\n return [\n {\n name: 'red',\n shades: [\n { color: '#FFA6B0', name: 'super-light-red' },\n { color: '#FF7383', name: 'light-red' },\n { color: '#F2495C', name: 'red', primary: true },\n { color: '#E02F44', name: 'semi-dark-red' },\n { color: '#C4162A', name: 'dark-red' },\n ],\n },\n {\n name: 'orange',\n shades: [\n { color: '#FFCB7D', name: 'super-light-orange', aliases: [] },\n { color: '#FFB357', name: 'light-orange', aliases: [] },\n { color: '#FF9830', name: 'orange', aliases: [], primary: true },\n { color: '#FF780A', name: 'semi-dark-orange', aliases: [] },\n { color: '#FA6400', name: 'dark-orange', aliases: [] },\n ],\n },\n {\n name: 'yellow',\n shades: [\n { color: '#FFF899', name: 'super-light-yellow', aliases: [] },\n { color: '#FFEE52', name: 'light-yellow', aliases: [] },\n { color: '#FADE2A', name: 'yellow', aliases: [], primary: true },\n { color: '#F2CC0C', name: 'semi-dark-yellow', aliases: [] },\n { color: '#E0B400', name: 'dark-yellow', aliases: [] },\n ],\n },\n {\n name: 'green',\n shades: [\n { color: '#C8F2C2', name: 'super-light-green', aliases: [] },\n { color: '#96D98D', name: 'light-green', aliases: [] },\n { color: '#73BF69', name: 'green', aliases: [], primary: true },\n { color: '#56A64B', name: 'semi-dark-green', aliases: [] },\n { color: '#37872D', name: 'dark-green', aliases: [] },\n ],\n },\n {\n name: 'blue',\n shades: [\n { color: '#C0D8FF', name: 'super-light-blue', aliases: [] },\n { color: '#8AB8FF', name: 'light-blue', aliases: [] },\n { color: '#5794F2', name: 'blue', aliases: [], primary: true },\n { color: '#3274D9', name: 'semi-dark-blue', aliases: [] },\n { color: '#1F60C4', name: 'dark-blue', aliases: [] },\n ],\n },\n {\n name: 'purple',\n shades: [\n { color: '#DEB6F2', name: 'super-light-purple', aliases: [] },\n { color: '#CA95E5', name: 'light-purple', aliases: [] },\n { color: '#B877D9', name: 'purple', aliases: [], primary: true },\n { color: '#A352CC', name: 'semi-dark-purple', aliases: [] },\n { color: '#8F3BB8', name: 'dark-purple', aliases: [] },\n ],\n },\n ];\n}\n\nfunction getLightHues(): ThemeVizHue[] {\n return [\n {\n name: 'red',\n shades: [\n { color: '#FF7383', name: 'super-light-red' },\n { color: '#F2495C', name: 'light-red' },\n { color: '#E02F44', name: 'red', primary: true },\n { color: '#C4162A', name: 'semi-dark-red' },\n { color: '#AD0317', name: 'dark-red' },\n ],\n },\n {\n name: 'orange',\n shades: [\n { color: '#FFB357', name: 'super-light-orange', aliases: [] },\n { color: '#FF9830', name: 'light-orange', aliases: [] },\n { color: '#FF780A', name: 'orange', aliases: [], primary: true },\n { color: '#FA6400', name: 'semi-dark-orange', aliases: [] },\n { color: '#E55400', name: 'dark-orange', aliases: [] },\n ],\n },\n {\n name: 'yellow',\n shades: [\n { color: '#FFEE52', name: 'super-light-yellow', aliases: [] },\n { color: '#FADE2A', name: 'light-yellow', aliases: [] },\n { color: '#F2CC0C', name: 'yellow', aliases: [], primary: true },\n { color: '#E0B400', name: 'semi-dark-yellow', aliases: [] },\n { color: '#CC9D00', name: 'dark-yellow', aliases: [] },\n ],\n },\n {\n name: 'green',\n shades: [\n { color: '#96D98D', name: 'super-light-green', aliases: [] },\n { color: '#73BF69', name: 'light-green', aliases: [] },\n { color: '#56A64B', name: 'green', aliases: [], primary: true },\n { color: '#37872D', name: 'semi-dark-green', aliases: [] },\n { color: '#19730E', name: 'dark-green', aliases: [] },\n ],\n },\n {\n name: 'blue',\n shades: [\n { color: '#8AB8FF', name: 'super-light-blue', aliases: [] },\n { color: '#5794F2', name: 'light-blue', aliases: [] },\n { color: '#3274D9', name: 'blue', aliases: [], primary: true },\n { color: '#1F60C4', name: 'semi-dark-blue', aliases: [] },\n { color: '#1250B0', name: 'dark-blue', aliases: [] },\n ],\n },\n {\n name: 'purple',\n shades: [\n { color: '#CA95E5', name: 'super-light-purple', aliases: [] },\n { color: '#B877D9', name: 'light-purple', aliases: [] },\n { color: '#A352CC', name: 'purple', aliases: [], primary: true },\n { color: '#8F3BB8', name: 'semi-dark-purple', aliases: [] },\n { color: '#7C2EA3', name: 'dark-purple', aliases: [] },\n ],\n },\n ];\n}\n\nfunction getClassicPalette() {\n // Todo replace these with named colors (as many as possible)\n\n return [\n 'green', // '#7EB26D', // 0: pale green\n 'semi-dark-yellow', // '#EAB839', // 1: mustard\n 'light-blue', // #6ED0E0', // 2: light blue\n 'semi-dark-orange', // '#EF843C', // 3: orange\n 'red', // '#E24D42', // 4: red\n 'blue', // #1F78C1', // 5: ocean\n 'purple', // '#BA43A9', // 6: purple\n '#705DA0', // 7: violet\n 'dark-green', // '#508642', // 8: dark green\n 'yellow', //'#CCA300', // 9: dark sand\n '#447EBC',\n '#C15C17',\n '#890F02',\n '#0A437C',\n '#6D1F62',\n '#584477',\n '#B7DBAB',\n '#F4D598',\n '#70DBED',\n '#F9BA8F',\n '#F29191',\n '#82B5D8',\n '#E5A8E2',\n '#AEA2E0',\n '#629E51',\n '#E5AC0E',\n '#64B0C8',\n '#E0752D',\n '#BF1B00',\n '#0A50A1',\n '#962D82',\n '#614D93',\n '#9AC48A',\n '#F2C96D',\n '#65C5DB',\n '#F9934E',\n '#EA6460',\n '#5195CE',\n '#D683CE',\n '#806EB7',\n '#3F6833',\n '#967302',\n '#2F575E',\n '#99440A',\n '#58140C',\n '#052B51',\n '#511749',\n '#3F2B5B',\n '#E0F9D7',\n '#FCEACA',\n '#CFFAFF',\n '#F9E2D2',\n '#FCE2DE',\n '#BADFF4',\n '#F9D9F9',\n '#DEDAF7',\n ];\n}\n\n// Old hues\n// function getDarkHues(): ThemeVizHue[] {\n// return [\n// {\n// name: 'red',\n// shades: [\n// { name: 'red1', color: '#FFC2D4', aliases: ['super-light-red'] },\n// { name: 'red2', color: '#FFA8C2', aliases: ['light-red'] },\n// { name: 'red3', color: '#FF85A9', aliases: ['red'], primary: true },\n// { name: 'red4', color: '#FF5286', aliases: ['semi-dark-red'] },\n// { name: 'red5', color: '#E0226E', aliases: ['dark-red'] },\n// ],\n// },\n// {\n// name: 'orange',\n// shades: [\n// { name: 'orange1', color: '#FFC0AD', aliases: ['super-light-orange'] },\n// { name: 'orange2', color: '#FFA98F', aliases: ['light-orange'] },\n// { name: 'orange3', color: '#FF825C', aliases: ['orange'], primary: true },\n// { name: 'orange4', color: '#FF5F2E', aliases: ['semi-dark-orange'] },\n// { name: 'orange5', color: '#E73903', aliases: ['dark-orange'] },\n// ],\n// },\n// {\n// name: 'yellow',\n// shades: [\n// { name: 'yellow1', color: '#FFE68F', aliases: ['super-light-yellow'] },\n// { name: 'yellow2', color: '#FAD34A', aliases: ['light-yellow'] },\n// { name: 'yellow3', color: '#ECBB09', aliases: ['yellow'], primary: true },\n// { name: 'yellow4', color: '#CFA302', aliases: ['semi-dark-yellow'] },\n// { name: 'yellow5', color: '#AD8800', aliases: ['dark-yellow'] },\n// ],\n// },\n// {\n// name: 'green',\n// shades: [\n// { name: 'green1', color: '#93ECCB', aliases: ['super-light-green'] },\n// { name: 'green2', color: '#65DCB1', aliases: ['light-green'] },\n// { name: 'green3', color: '#2DC88F', aliases: ['green'], primary: true },\n// { name: 'green4', color: '#25A777', aliases: ['semi-dark-green'] },\n// { name: 'green5', color: '#1B855E', aliases: ['dark-green'] },\n// ],\n// },\n// {\n// name: 'teal',\n// shades: [\n// { name: 'teal1', color: '#73E7F7' },\n// { name: 'teal2', color: '#2BD6EE' },\n// { name: 'teal3', color: '#11BDD4', primary: true },\n// { name: 'teal4', color: '#0EA0B4' },\n// { name: 'teal5', color: '#077D8D' },\n// ],\n// },\n// {\n// name: 'blue',\n// shades: [\n// { name: 'blue1', color: '#C2D7FF', aliases: ['super-light-blue'] },\n// { name: 'blue2', color: '#A3C2FF', aliases: ['light-blue'] },\n// { name: 'blue3', color: '#83ACFC', aliases: ['blue'], primary: true },\n// { name: 'blue4', color: '#5D8FEF', aliases: ['semi-dark-blue'] },\n// { name: 'blue5', color: '#3871DC', aliases: ['dark-blue'] },\n// ],\n// },\n// {\n// name: 'violet',\n// shades: [\n// { name: 'violet1', color: '#DACCFF' },\n// { name: 'violet2', color: '#C7B2FF' },\n// { name: 'violet3', color: '#B094FF', primary: true },\n// { name: 'violet4', color: '#9271EF' },\n// { name: 'violet5', color: '#7E63CA' },\n// ],\n// },\n// {\n// name: 'purple',\n// shades: [\n// { name: 'purple1', color: '#FFBDFF', aliases: ['super-light-purple'] },\n// { name: 'purple2', color: '#F5A3F5', aliases: ['light-purple'] },\n// { name: 'purple3', color: '#E48BE4', aliases: ['purple'], primary: true },\n// { name: 'purple4', color: '#CA68CA', aliases: ['semi-dark-purple'] },\n// { name: 'purple5', color: '#B545B5', aliases: ['dark-purple'] },\n// ],\n// },\n// ];\n// }\n\nconst nativeColorNames: Record<string, string> = {\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 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 darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n 'indianred ': '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgrey: '#d3d3d3',\n lightgreen: '#90ee90',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#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: '#9370d8',\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: '#d87093',\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 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","// We need to centralize the zIndex definitions as they work\n// like global values in the browser.\nexport const zIndex = {\n activePanel: 999,\n navbarFixed: 1000,\n sidemenu: 1020,\n dropdown: 1030,\n typeahead: 1030,\n tooltip: 1040,\n modalBackdrop: 1050,\n modal: 1060,\n portal: 1061,\n};\n\n/** @beta */\nexport type ThemeZIndices = typeof zIndex;\n","import { createBreakpoints } from './breakpoints';\nimport { createColors, ThemeColorsInput } from './createColors';\nimport { createComponents } from './createComponents';\nimport { createShadows } from './createShadows';\nimport { createShape, ThemeShapeInput } from './createShape';\nimport { createSpacing, ThemeSpacingOptions } from './createSpacing';\nimport { createTransitions } from './createTransitions';\nimport { createTypography, ThemeTypographyInput } from './createTypography';\nimport { createV1Theme } from './createV1Theme';\nimport { createVisualizationColors } from './createVisualizationColors';\nimport { GrafanaTheme2 } from './types';\nimport { zIndex } from './zIndex';\n\n/** @internal */\nexport interface NewThemeOptions {\n name?: string;\n colors?: ThemeColorsInput;\n spacing?: ThemeSpacingOptions;\n shape?: ThemeShapeInput;\n typography?: ThemeTypographyInput;\n}\n\n/** @internal */\nexport function createTheme(options: NewThemeOptions = {}): GrafanaTheme2 {\n const {\n name,\n colors: colorsInput = {},\n spacing: spacingInput = {},\n shape: shapeInput = {},\n typography: typographyInput = {},\n } = options;\n\n const colors = createColors(colorsInput);\n const breakpoints = createBreakpoints();\n const spacing = createSpacing(spacingInput);\n const shape = createShape(shapeInput);\n const typography = createTypography(colors, typographyInput);\n const shadows = createShadows(colors);\n const transitions = createTransitions();\n const components = createComponents(colors, shadows);\n const visualization = createVisualizationColors(colors);\n\n const theme = {\n name: name ?? (colors.mode === 'dark' ? 'Dark' : 'Light'),\n isDark: colors.mode === 'dark',\n isLight: colors.mode === 'light',\n colors,\n breakpoints,\n spacing,\n shape,\n components,\n typography,\n shadows,\n transitions,\n visualization,\n zIndex: {\n ...zIndex,\n },\n flags: {},\n };\n\n return {\n ...theme,\n v1: createV1Theme(theme),\n };\n}\n","import { NewThemeOptions } from '../createTheme';\n\nconst aubergineTheme: NewThemeOptions = {\n name: 'Aubergine',\n colors: {\n mode: 'dark',\n border: {\n weak: '#4F2A3D',\n medium: '#6A3C4B',\n strong: '#8C5A69',\n },\n text: {\n primary: '#E5D0D6',\n secondary: '#D1A8C4',\n disabled: '#B7A0A6',\n link: '#A56BB6',\n maxContrast: '#FFFFFF',\n },\n primary: {\n main: '#8C5A69',\n },\n secondary: {\n main: '#6A3C4B',\n text: '#D1A8C4',\n border: '#8C5A69',\n },\n background: {\n canvas: '#2E1F2D',\n primary: '#3C2136',\n secondary: '#4A2D47',\n elevated: '#4A2D47',\n },\n action: {\n hover: '#6A3C4B',\n selected: '#8C5A69',\n selectedBorder: '#FFB300',\n focus: '#A56BB6',\n hoverOpacity: 0.1,\n disabledText: '#B7A0A6',\n disabledBackground: '#4A2D47',\n disabledOpacity: 0.38,\n },\n gradients: {\n brandHorizontal: 'linear-gradient(270deg, #6A3C4B 0%, #A56BB6 100%)',\n brandVertical: 'linear-gradient(0deg, #6A3C4B 0%, #A56BB6 100%)',\n },\n contrastThreshold: 4,\n hoverFactor: 0.07,\n tonalOffset: 0.15,\n },\n shape: {\n borderRadius: 6,\n },\n};\n\nexport default aubergineTheme;\n","import { NewThemeOptions } from '../createTheme';\n\n/**\n * a very ugly theme that is useful for debugging and checking if the theme is applied correctly\n * borders are red,\n * backgrounds are blue,\n * text is yellow,\n * and grafana loves you <3\n * (also corners are rounded, action states (hover, focus, selected) are purple)\n */\nconst debugTheme: NewThemeOptions = {\n name: 'Debug',\n colors: {\n mode: 'dark',\n background: {\n canvas: '#000033',\n primary: '#000044',\n secondary: '#000055',\n elevated: '#000055',\n },\n text: {\n primary: '#bbbb00',\n secondary: '#888800',\n disabled: '#444400',\n link: '#dddd00',\n maxContrast: '#ffff00',\n },\n border: {\n weak: '#ff000044',\n medium: '#ff000088',\n strong: '#ff0000ff',\n },\n primary: {\n border: '#ff000088',\n text: '#cccc00',\n contrastText: '#ffff00',\n shade: '#9900dd',\n },\n secondary: {\n border: '#ff000088',\n text: '#cccc00',\n contrastText: '#ffff00',\n shade: '#9900dd',\n },\n info: {\n shade: '#9900dd',\n },\n warning: {\n shade: '#9900dd',\n },\n success: {\n shade: '#9900dd',\n },\n error: {\n shade: '#9900dd',\n },\n action: {\n hover: '#9900dd',\n focus: '#6600aa',\n selected: '#440088',\n },\n },\n shape: {\n borderRadius: 8,\n },\n spacing: {\n gridSize: 10,\n },\n};\n\nexport default debugTheme;\n","import { NewThemeOptions } from '../createTheme';\n\nconst desertBloomTheme: NewThemeOptions = {\n name: 'Desert bloom',\n colors: {\n mode: 'light',\n border: {\n weak: 'rgba(0, 0, 0, 0.12)',\n medium: 'rgba(0, 0, 0, 0.20)',\n strong: 'rgba(0, 0, 0, 0.30)',\n },\n text: {\n primary: '#333333',\n secondary: '#555555',\n disabled: 'rgba(0, 0, 0, 0.5)',\n link: '#1A82E2',\n maxContrast: '#000000',\n },\n primary: {\n main: '#FF6F61',\n text: '#FE6F61',\n border: '#E55B4D',\n name: 'primary',\n shade: '#E55B4D',\n transparent: '#FF6F6126',\n contrastText: '#FFFFFF',\n borderTransparent: '#FF6F6140',\n },\n secondary: {\n main: '#FFFFFF',\n text: '#695f53',\n border: '#d9cec0',\n name: 'secondary',\n shade: '#d9cec0',\n transparent: '#FFFFFF26',\n contrastText: '#4c4339',\n borderTransparent: '#FFFFFF40',\n },\n info: {\n main: '#1A82E2',\n },\n success: {\n main: '#4CAF50',\n },\n warning: {\n main: '#FFC107',\n },\n background: {\n canvas: '#FFF8F0',\n primary: '#FFFFFF',\n secondary: '#f9f3e8',\n elevated: '#FFFFFF',\n },\n action: {\n hover: 'rgba(168, 156, 134, 0.12)',\n selected: 'rgba(168, 156, 134, 0.36)',\n selectedBorder: '#FF6F61',\n focus: 'rgba(168, 156, 134, 0.50)',\n hoverOpacity: 0.08,\n disabledText: 'rgba(168, 156, 134, 0.5)',\n disabledBackground: 'rgba(168, 156, 134, 0.06)',\n disabledOpacity: 0.38,\n },\n gradients: {\n brandHorizontal: 'linear-gradient(270deg, #FF6F61 0%, #ece0d1 100%)',\n brandVertical: 'linear-gradient(0.01deg, #FF6F61 0.01%, #ece0d1 99.99%)',\n },\n contrastThreshold: 3,\n hoverFactor: 0.03,\n tonalOffset: 0.15,\n },\n shape: {\n borderRadius: 6,\n },\n};\n\nexport default desertBloomTheme;\n","import { NewThemeOptions } from '../createTheme';\n\nconst gildedGroveTheme: NewThemeOptions = {\n name: 'Gilded grove',\n colors: {\n mode: 'dark',\n border: {\n weak: 'rgba(200, 200, 180, 0.12)',\n medium: 'rgba(200, 200, 180, 0.20)',\n strong: 'rgba(200, 200, 180, 0.30)',\n },\n text: {\n primary: 'rgb(250, 250, 239)',\n secondary: 'rgba(200, 200, 180, 0.85)',\n disabled: 'rgba(200, 200, 180, 0.6)',\n link: '#FEAC34',\n maxContrast: '#FFFFFF',\n },\n primary: {\n main: '#FEAC34',\n text: '#FFD783',\n border: '#FFD783',\n name: 'primary',\n shade: 'rgb(255, 173, 80)',\n transparent: '#FEAC3426',\n contrastText: '#111614',\n borderTransparent: '#FFD78340',\n },\n secondary: {\n main: 'rgba(200, 200, 180, 0.10)',\n shade: 'rgba(200, 200, 180, 0.14)',\n transparent: 'rgba(200, 200, 180, 0.08)',\n text: 'rgb(200, 200, 180)',\n contrastText: 'rgb(200, 200, 180)',\n border: 'rgba(200, 200, 180, 0.08)',\n name: 'secondary',\n borderTransparent: 'rgba(200, 200, 180, 0.25)',\n },\n background: {\n canvas: '#111614',\n primary: '#1d2220',\n secondary: '#27312E',\n elevated: '#27312E',\n },\n action: {\n hover: 'rgba(200, 200, 180, 0.16)',\n selected: 'rgba(200, 200, 180, 0.12)',\n selectedBorder: '#FEAC34',\n focus: 'rgba(200, 200, 180, 0.16)',\n hoverOpacity: 0.08,\n disabledText: 'rgba(200, 200, 180, 0.6)',\n disabledBackground: 'rgba(200, 200, 180, 0.04)',\n disabledOpacity: 0.38,\n },\n gradients: {\n brandHorizontal: 'linear-gradient(270deg, #FEAC34 0%, #FFD783 100%)',\n brandVertical: 'linear-gradient(0.01deg, #FEAC34 0.01%, #FFD783 99.99%)',\n },\n contrastThreshold: 3,\n hoverFactor: 0.03,\n tonalOffset: 0.15,\n },\n shape: {\n borderRadius: 5,\n },\n};\n\nexport default gildedGroveTheme;\n","import { NewThemeOptions } from '../createTheme';\n\nconst marsTheme: NewThemeOptions = {\n name: 'Mars',\n colors: {\n mode: 'dark',\n border: {\n weak: 'rgba(210, 90, 60, 0.2)',\n medium: 'rgba(210, 90, 60, 0.35)',\n strong: 'rgba(210, 90, 60, 0.5)',\n },\n text: {\n primary: '#DDDDDD',\n secondary: '#BBBBBB',\n disabled: 'rgba(221, 221, 221, 0.5)',\n link: '#FF6F61',\n maxContrast: '#FFFFFF',\n },\n primary: {\n main: '#FF6F61',\n },\n secondary: {\n main: '#6a2f2f',\n text: '#BBBBBB',\n border: 'rgba(210, 90, 60, 0.2)',\n },\n background: {\n canvas: '#3C1E1E',\n primary: '#522626',\n secondary: '#6A2F2F',\n elevated: '#6A2F2F',\n },\n action: {\n hover: 'rgba(210, 90, 60, 0.16)',\n selected: 'rgba(210, 90, 60, 0.12)',\n selectedBorder: '#FF6F61',\n focus: 'rgba(210, 90, 60, 0.16)',\n hoverOpacity: 0.08,\n disabledText: 'rgba(221, 221, 221, 0.5)',\n disabledBackground: 'rgba(210, 90, 60, 0.08)',\n disabledOpacity: 0.38,\n },\n gradients: {\n brandHorizontal: 'linear-gradient(270deg, #FF6F61 0%, #D25A3C 100%)',\n brandVertical: 'linear-gradient(0.01deg, #FF6F61 0.01%, #D25A3C 99.99%)',\n },\n contrastThreshold: 3,\n hoverFactor: 0.05,\n tonalOffset: 0.2,\n },\n shape: {\n borderRadius: 4,\n },\n};\n\nexport default marsTheme;\n","import { NewThemeOptions } from '../createTheme';\n\nconst matrixTheme: NewThemeOptions = {\n name: 'Matrix',\n colors: {\n mode: 'dark',\n background: {\n canvas: '#000000',\n primary: '#020202',\n secondary: '#080808',\n elevated: '#080808',\n },\n text: {\n primary: '#00c017',\n secondary: '#008910',\n disabled: '#006a0c',\n link: '#00ff41',\n maxContrast: '#00ff41',\n },\n border: {\n weak: '#008f1144',\n medium: '#008f1188',\n strong: '#008910',\n },\n primary: {\n main: '#008910',\n },\n secondary: {\n text: '#008910',\n },\n gradients: {\n brandVertical: 'linear-gradient(0deg, #008910 0%, #00ff41 100%)',\n brandHorizontal: 'linear-gradient(90deg, #008910 0%, #00ff41 100%)',\n },\n },\n shape: {\n borderRadius: 0,\n },\n typography: {\n fontFamily: 'monospace',\n },\n};\n\nexport default matrixTheme;\n","import { NewThemeOptions } from '../createTheme';\n\nconst sapphireDuskTheme: NewThemeOptions = {\n name: 'Sapphire dusk',\n colors: {\n mode: 'dark',\n border: {\n weak: '#232e47',\n medium: '#2c3853',\n strong: '#404d6b',\n },\n text: {\n primary: '#FFFFFF',\n secondary: '#bcccdd',\n disabled: '#838da5',\n link: '#93EBF0',\n maxContrast: '#FFFFFF',\n },\n primary: {\n main: '#93EBF0',\n text: '#a8e9ed',\n border: '#93ebf0',\n name: 'primary',\n shade: '#c0f5d9',\n transparent: '#93EBF029',\n contrastText: '#111614',\n borderTransparent: '#93ebf040',\n },\n secondary: {\n main: '#2c364f',\n shade: '#36415e',\n transparent: 'rgba(200, 200, 180, 0.08)',\n text: '#d1dfff',\n contrastText: '#acfeff',\n border: 'rgba(200, 200, 180, 0.08)',\n name: 'secondary',\n borderTransparent: 'rgba(200, 200, 180, 0.25)',\n },\n info: {\n main: '#4d4593',\n text: '#a8e9ed',\n border: '#5d54a7',\n },\n error: {\n main: '#c63370',\n },\n success: {\n main: '#1A7F4B',\n },\n warning: {\n main: '#D448EA',\n },\n background: {\n canvas: '#1e273d',\n primary: '#12192e',\n secondary: '#212c47',\n elevated: '#212c47',\n },\n action: {\n hover: '#364057',\n selected: '#364260',\n selectedBorder: '#D448EA',\n focus: '#364057',\n hoverOpacity: 0.08,\n disabledText: '#838da5',\n disabledBackground: 'rgba(54, 64, 87, 0.2)',\n disabledOpacity: 0.38,\n },\n gradients: {\n brandHorizontal: 'linear-gradient(270deg, #D346EF 0%, #2C83FE 100%)',\n brandVertical: 'linear-gradient(0deg, #D346EF 0%, #2C83FE 100%)',\n },\n contrastThreshold: 3,\n hoverFactor: 0.03,\n tonalOffset: 0.15,\n },\n shape: {\n borderRadius: 5,\n },\n};\n\nexport default sapphireDuskTheme;\n","import { NewThemeOptions } from '../createTheme';\n\nconst synthwaveTheme: NewThemeOptions = {\n name: 'Synthwave',\n colors: {\n mode: 'dark',\n border: {\n weak: 'rgba(255, 20, 147, 0.12)',\n medium: 'rgba(255, 20, 147, 0.20)',\n strong: 'rgba(255, 20, 147, 0.30)',\n },\n text: {\n primary: '#E0E0E0',\n secondary: 'rgba(224, 224, 224, 0.75)',\n disabled: 'rgba(224, 224, 224, 0.5)',\n link: '#FF69B4',\n maxContrast: '#FFFFFF',\n },\n primary: {\n main: '#FF1493',\n },\n secondary: {\n main: '#37183a',\n text: 'rgba(224, 224, 224, 0.75)',\n border: 'rgba(255, 20, 147, 0.10)',\n },\n background: {\n canvas: '#1A1A2E',\n primary: '#16213E',\n secondary: '#0F3460',\n elevated: '#0F3460',\n },\n action: {\n hover: 'rgba(255, 20, 147, 0.16)',\n selected: 'rgba(255, 20, 147, 0.12)',\n selectedBorder: '#FF1493',\n focus: 'rgba(255, 20, 147, 0.16)',\n hoverOpacity: 0.08,\n disabledText: 'rgba(224, 224, 224, 0.5)',\n disabledBackground: 'rgba(255, 20, 147, 0.08)',\n disabledOpacity: 0.38,\n },\n gradients: {\n brandHorizontal: 'linear-gradient(270deg, #FF1493 0%, #1E90FF 100%)',\n brandVertical: 'linear-gradient(0.01deg, #FF1493 0.01%, #1E90FF 99.99%)',\n },\n contrastThreshold: 3,\n hoverFactor: 0.03,\n tonalOffset: 0.15,\n },\n shape: {\n borderRadius: 6,\n },\n};\n\nexport default synthwaveTheme;\n","import { NewThemeOptions } from '../createTheme';\n\nconst tronTheme: NewThemeOptions = {\n name: 'Tron',\n colors: {\n mode: 'dark',\n border: {\n weak: 'rgba(0, 255, 255, 0.12)',\n medium: 'rgba(0, 255, 255, 0.20)',\n strong: 'rgba(0, 255, 255, 0.30)',\n },\n text: {\n primary: '#E0E0E0',\n secondary: 'rgba(224, 224, 224, 0.75)',\n disabled: 'rgba(224, 224, 224, 0.5)',\n link: '#00FFFF',\n maxContrast: '#FFFFFF',\n },\n primary: {\n main: '#00FFFF',\n },\n secondary: {\n main: '#0b2e36',\n text: 'rgba(224, 224, 224, 0.75)',\n border: 'rgba(0, 255, 255, 0.10)',\n },\n background: {\n canvas: '#0A0F18',\n primary: '#0F1B2A',\n secondary: '#152234',\n elevated: '#152234',\n },\n action: {\n hover: 'rgba(0, 255, 255, 0.16)',\n selected: 'rgba(0, 255, 255, 0.12)',\n selectedBorder: '#00FFFF',\n focus: 'rgba(0, 255, 255, 0.16)',\n hoverOpacity: 0.08,\n disabledText: 'rgba(224, 224, 224, 0.5)',\n disabledBackground: 'rgba(0, 255, 255, 0.08)',\n disabledOpacity: 0.38,\n },\n gradients: {\n brandHorizontal: 'linear-gradient(270deg, #00FFFF 0%, #29ABE2 100%)',\n brandVertical: 'linear-gradient(0.01deg, #00FFFF 0.01%, #29ABE2 99.99%)',\n },\n contrastThreshold: 3,\n hoverFactor: 0.05,\n tonalOffset: 0.2,\n },\n shape: {\n borderRadius: 6,\n },\n};\n\nexport default tronTheme;\n","import { NewThemeOptions } from '../createTheme';\n\nconst victorianTheme: NewThemeOptions = {\n name: 'Victorian',\n colors: {\n mode: 'dark',\n border: {\n weak: '#3A2C22',\n medium: '#3A2C22',\n strong: '#4B3D32',\n },\n text: {\n primary: '#D9D0A2',\n secondary: '#C4B89B',\n disabled: '#A89F91',\n link: '#C28A4D',\n maxContrast: '#FFFFFF',\n },\n primary: {\n main: '#C28A4D',\n },\n secondary: {\n main: '#3A2C22',\n text: '#C4B89B',\n border: '#4B3D32',\n },\n background: {\n canvas: '#1F1510',\n primary: '#2C1A13',\n secondary: '#402A21',\n elevated: '#402A21',\n },\n action: {\n hover: '#3A2C22',\n selected: '#4B3D32',\n selectedBorder: '#C28A4D',\n focus: '#C28A4D',\n hoverOpacity: 0.1,\n disabledText: '#A89F91',\n disabledBackground: '#402A21',\n disabledOpacity: 0.38,\n },\n gradients: {\n brandHorizontal: 'linear-gradient(270deg, #D9D0a1 0%, #C28A4D 100%)',\n brandVertical: 'linear-gradient(0.01deg, #D9D0a1 0.01%, #C28A4D 99.99%)',\n },\n contrastThreshold: 4,\n hoverFactor: 0.07,\n tonalOffset: 0.15,\n },\n shape: {\n borderRadius: 6,\n },\n typography: {\n fontFamily: '\"Georgia\", \"Times New Roman\", serif',\n fontFamilyMonospace: \"'Courier New', monospace\",\n },\n};\n\nexport default victorianTheme;\n","import { NewThemeOptions } from '../createTheme';\n\nconst zenTheme: NewThemeOptions = {\n name: 'Zen',\n colors: {\n mode: 'light',\n text: {\n primary: '#333333',\n secondary: '#666666',\n disabled: '#B8B8B8',\n link: '#4F9F6E',\n maxContrast: '#000000',\n },\n border: {\n weak: '#B1B7B3',\n medium: '#A2A8A2',\n strong: '#7C7F7A',\n },\n primary: {\n main: '#6D8E6D',\n },\n secondary: {\n main: '#E0E0E0',\n text: '#666666',\n border: '#A2A8A2',\n },\n background: {\n canvas: '#F4F4F4',\n primary: '#E9E9E9',\n secondary: '#D8D8D8',\n elevated: '#E9E9E9',\n },\n action: {\n hover: '#D1D1D1',\n selected: '#B8B8B8',\n selectedBorder: '#88B88B',\n hoverOpacity: 0.1,\n focus: '#D1D1D1',\n disabledBackground: '#E0E0E0',\n disabledText: '#B8B8B8',\n disabledOpacity: 0.5,\n },\n gradients: {\n brandHorizontal: 'linear-gradient(270deg, #88B88B 0%, #6D8E6D 100%)',\n brandVertical: 'linear-gradient(0.01deg, #88B88B 0.01%, #6D8E6D 99.99%)',\n },\n contrastThreshold: 3,\n hoverFactor: 0.03,\n tonalOffset: 0.2,\n },\n shape: {\n borderRadius: 8,\n },\n};\n\nexport default zenTheme;\n","import { NewThemeOptions } from '../createTheme';\n\n/**\n * Torkel's GrafanaCon theme\n * very WIP state\n */\n\nconst whiteBase = `210, 210, 220`;\nconst secondaryBase = `210, 210, 220`;\n//const brandMain = '#3d71d9';\n//const brandText = '#6e9fff';\nconst brandMain = '#ff934d';\nconst brandText = '#f99a5c';\n\nconst disabledText = `rgba(${whiteBase}, 0.6)`;\n\nconst gloomTheme: NewThemeOptions = {\n name: 'Gloom',\n colors: {\n mode: 'dark',\n border: {\n weak: `rgba(${whiteBase}, 0.08)`,\n medium: `rgba(${whiteBase}, 0.15)`,\n strong: `rgba(${whiteBase}, 0.30)`,\n },\n\n text: {\n primary: `rgb(${whiteBase})`,\n secondary: `rgba(${whiteBase}, 0.65)`,\n disabled: disabledText,\n link: brandText,\n maxContrast: '#FFF',\n },\n\n primary: {\n main: brandMain,\n text: brandText,\n border: brandMain,\n name: 'primary',\n },\n\n secondary: {\n main: `rgba(${secondaryBase}, 0.10)`,\n shade: `rgba(${secondaryBase}, 0.14)`,\n transparent: `rgba(${secondaryBase}, 0.08)`,\n text: `rgba(${secondaryBase})`,\n contrastText: `rgb(${secondaryBase})`,\n border: `rgba(${secondaryBase}, 0.08)`,\n },\n\n background: {\n canvas: '#000',\n primary: '#0d0b14',\n secondary: '#19171f',\n elevated: '#19171f',\n },\n\n action: {\n hover: `rgba(${secondaryBase}, 0.10)`,\n selected: `rgba(${secondaryBase}, 0.12)`,\n selectedBorder: brandMain,\n focus: `rgba(${secondaryBase}, 0.10)`,\n hoverOpacity: 0.05,\n disabledText: disabledText,\n disabledBackground: `rgba(${whiteBase}, 0.04)`,\n disabledOpacity: 0.38,\n },\n\n // gradients: {\n // brandHorizontal: 'linear-gradient(270deg, #ff934d 0%, #FEAC34 100%)',\n // brandVertical: 'linear-gradient(0.01deg, #ff934d 0.01%, #FEAC34 99.99%)',\n // },\n\n contrastThreshold: 3,\n hoverFactor: 0.03,\n tonalOffset: 0.15,\n },\n shape: {\n borderRadius: 5,\n },\n};\n\nexport default gloomTheme;\n","import { Registry, RegistryItem } from '../utils/Registry';\n\nimport { createTheme } from './createTheme';\nimport * as extraThemes from './themeDefinitions';\nimport { GrafanaTheme2 } from './types';\n\nexport interface ThemeRegistryItem extends RegistryItem {\n isExtra?: boolean;\n build: () => GrafanaTheme2;\n}\n\n/**\n * @internal\n * Only for internal use, never use this from a plugin\n **/\nexport function getThemeById(id: string): GrafanaTheme2 {\n const theme = themeRegistry.getIfExists(id) ?? themeRegistry.get('dark');\n return theme.build();\n}\n\n/**\n * @internal\n * For internal use only\n */\nexport function getBuiltInThemes(allowedExtras: string[]) {\n const themes = themeRegistry.list().filter((item) => {\n if (item.isExtra) {\n return allowedExtras.includes(item.id);\n }\n return true;\n });\n // sort themes alphabetically, but put built-in themes (default, dark, light, system) first\n const sortedThemes = themes.sort((a, b) => {\n if (a.isExtra && !b.isExtra) {\n return 1;\n } else if (!a.isExtra && b.isExtra) {\n return -1;\n } else {\n return a.name.localeCompare(b.name);\n }\n });\n return sortedThemes;\n}\n\n/**\n * There is also a backend list at pkg/services/preference/themes.go\n */\nconst themeRegistry = new Registry<ThemeRegistryItem>(() => {\n return [\n { id: 'system', name: 'System preference', build: getSystemPreferenceTheme },\n { id: 'dark', name: 'Dark', build: () => createTheme({ colors: { mode: 'dark' } }) },\n { id: 'light', name: 'Light', build: () => createTheme({ colors: { mode: 'light' } }) },\n ];\n});\n\nfor (const [id, theme] of Object.entries(extraThemes)) {\n themeRegistry.register({\n id,\n name: theme.name ?? '',\n build: () => createTheme(theme),\n isExtra: true,\n });\n}\n\nfunction getSystemPreferenceTheme() {\n const mediaResult = window.matchMedia('(prefers-color-scheme: dark)');\n const id = mediaResult.matches ? 'dark' : 'light';\n return getThemeById(id);\n}\n","import { HideSeriesConfig } from '@grafana/schema';\n\nimport { ScopedVars } from './ScopedVars';\nimport { Action } from './action';\nimport { QueryResultBase, Labels, NullValueMode } from './data';\nimport { DataLink, LinkModel } from './dataLink';\nimport { DecimalCount, DisplayProcessor, DisplayValue, DisplayValueAlignmentFactors } from './displayValue';\nimport { FieldColor } from './fieldColor';\nimport { ThresholdsConfig } from './thresholds';\nimport { ValueMapping } from './valueMapping';\n\n/** @public */\nexport enum FieldType {\n time = 'time', // or date\n number = 'number',\n string = 'string',\n boolean = 'boolean',\n\n // Used to detect that the value is some kind of trace data to help with the visualisation and processing.\n trace = 'trace',\n geo = 'geo',\n enum = 'enum',\n other = 'other', // Object, Array, etc\n frame = 'frame', // DataFrame\n\n // @alpha Nested DataFrames. This is for example used with tables where expanding a row will show a nested table.\n // The value should be DataFrame[] even if it is a single frame.\n nestedFrames = 'nestedFrames',\n}\n\n/**\n * @public\n * Every property is optional\n *\n * Plugins may extend this with additional properties. Something like series overrides\n */\nexport interface FieldConfig<TOptions = any> {\n /**\n * The display value for this field. This supports template variables blank is auto.\n * If you are a datasource plugin, do not set this. Use `field.value` and if that\n * is not enough, use `field.config.displayNameFromDS`.\n */\n displayName?: string;\n\n /**\n * This can be used by data sources that need to customize how values are named.\n * When this property is configured, this value is used rather than the default naming strategy.\n */\n displayNameFromDS?: string;\n\n /**\n * Human readable field metadata\n */\n description?: string;\n\n /**\n * An explict path to the field in the datasource. When the frame meta includes a path,\n * This will default to `${frame.meta.path}/${field.name}\n *\n * When defined, this value can be used as an identifier within the datasource scope, and\n * may be used to update the results\n */\n path?: string;\n\n /**\n * True if data source can write a value to the path. Auth/authz are supported separately\n */\n writeable?: boolean;\n\n /**\n * True if data source field supports ad-hoc filters\n */\n filterable?: boolean;\n\n // Numeric Options\n unit?: string;\n decimals?: DecimalCount; // Significant digits (for display)\n min?: number | null;\n max?: number | null;\n\n // Interval indicates the expected regular step between values in the series.\n // When an interval exists, consumers can identify \"missing\" values when the expected value is not present.\n // The grafana timeseries visualization will render disconnected values when missing values are found it the time field.\n // The interval uses the same units as the values. For time.Time, this is defined in milliseconds.\n interval?: number | null;\n\n // Convert input values into a display string\n mappings?: ValueMapping[];\n\n // Map numeric values to states\n thresholds?: ThresholdsConfig;\n\n // Map values to a display color\n color?: FieldColor;\n\n // Used when reducing field values\n nullValueMode?: NullValueMode;\n\n // The behavior when clicking on a result\n links?: DataLink[];\n\n actions?: Action[];\n\n // Alternative to empty string\n noValue?: string;\n\n // The field type may map to specific config\n type?: FieldTypeConfig;\n\n // Panel Specific Values\n custom?: TOptions;\n\n // Calculate min max per field\n fieldMinMax?: boolean;\n}\n\nexport interface FieldTypeConfig {\n enum?: EnumFieldConfig;\n}\n\nexport interface EnumFieldConfig {\n text?: string[];\n color?: string[];\n icon?: string[];\n description?: string[];\n}\n\n/** @public */\nexport interface ValueLinkConfig {\n /**\n * Result of field reduction\n */\n calculatedValue?: DisplayValue;\n /**\n * Index of the value row within Field. Should be provided only when value is not a result of a reduction\n */\n valueRowIndex?: number;\n}\n\nexport interface Field<T = any> {\n /**\n * Name of the field (column)\n */\n name: string;\n /**\n * Field value type (string, number, etc)\n */\n type: FieldType;\n /**\n * Meta info about how field and how to display it\n */\n config: FieldConfig;\n\n /**\n * The raw field values\n */\n values: T[];\n\n /**\n * When type === FieldType.Time, this can optionally store\n * the nanosecond-precison fractions as integers between\n * 0 and 999999.\n */\n nanos?: number[];\n\n labels?: Labels;\n\n /**\n * Cached values with appropriate display and id values\n */\n state?: FieldState | null;\n\n /**\n * Convert a value for display\n */\n display?: DisplayProcessor;\n\n /**\n * Get value data links with variables interpolated\n */\n getLinks?: (config: ValueLinkConfig) => Array<LinkModel<Field>>;\n}\n\n/** @alpha */\nexport interface FieldState {\n /**\n * An appropriate name for the field (does not include frame info)\n */\n displayName?: string | null;\n\n /**\n * Cache of reduced values\n */\n calcs?: FieldCalcs;\n\n /**\n * The numeric range for values in this field. This value will respect the min/max\n * set in field config, or when set to `auto` this will have the min/max for all data\n * in the response\n */\n range?: NumericRange;\n\n /**\n * Appropriate values for templating\n */\n scopedVars?: ScopedVars;\n\n /**\n * Series index is index for this field in a larger data set that can span multiple DataFrames\n * Useful for assigning color to series by looking up a color in a palette using this index\n */\n seriesIndex?: number;\n\n /**\n * Location of this field within the context frames results\n *\n * @internal -- we will try to make this unnecessary\n */\n origin?: DataFrameFieldIndex;\n\n /**\n * Boolean value is true if field is in a larger data set with multiple frames.\n * This is only related to the cached displayName property above.\n */\n multipleFrames?: boolean;\n\n /**\n * Boolean value is true if a null filling threshold has been applied\n * against the frame of the field. This is used to avoid cases in which\n * this would applied more than one time.\n */\n nullThresholdApplied?: boolean;\n\n /**\n * Can be used by visualizations to cache max display value lengths to aid alignment.\n * It's up to each visualization to calculate and set this.\n */\n alignmentFactors?: DisplayValueAlignmentFactors;\n\n /**\n * This is the current ad-hoc state of whether this series is hidden in viz, tooltip, and legend.\n *\n * Currently this will match field.config.custom.hideFrom because fieldOverrides applies the special __system\n * override to the actual config during toggle via legend. This should go away once we have a unified system\n * for layering ad hoc field overrides and options but still being able to get the stateless fieldConfig and panel options\n */\n hideFrom?: HideSeriesConfig;\n}\n\n/** @public */\nexport interface NumericRange {\n min?: number | null;\n max?: number | null;\n delta: number;\n}\n\nexport interface DataFrame extends QueryResultBase {\n name?: string;\n fields: Field[]; // All fields of equal length\n\n // The number of rows\n length: number;\n}\n\n// Data frame that include aggregate value, for use by timeSeriesTableTransformer / chart cell type\nexport interface DataFrameWithValue extends DataFrame {\n value: number | null;\n}\n\n/**\n * @public\n * Like a field, but properties are optional and values may be a simple array\n */\nexport interface FieldDTO<T = any> {\n name: string; // The column name\n type?: FieldType;\n config?: FieldConfig;\n values?: T[];\n labels?: Labels;\n}\n\n/**\n * @public\n * Like a DataFrame, but fields may be a FieldDTO\n */\nexport interface DataFrameDTO extends QueryResultBase {\n name?: string;\n fields: Array<FieldDTO | Field>;\n}\n\nexport interface FieldCalcs extends Record<string, any> {}\n\n/** @deprecated check data plane docs: https://grafana.com/developers/dataplane/heatmap **/\nexport const TIME_SERIES_VALUE_FIELD_NAME = 'Value';\nexport const TIME_SERIES_TIME_FIELD_NAME = 'Time';\nexport const TIME_SERIES_METRIC_FIELD_NAME = 'Metric';\n\n/**\n * Describes where a specific data frame field is located within a\n * dataset of type DataFrame[]\n *\n * @internal -- we will try to make this unnecessary\n */\nexport interface DataFrameFieldIndex {\n frameIndex: number;\n fieldIndex: number;\n}\n","/**\n * @public\n */\nexport enum FieldColorModeId {\n Thresholds = 'thresholds',\n PaletteClassic = 'palette-classic',\n PaletteClassicByName = 'palette-classic-by-name',\n PaletteSaturated = 'palette-saturated',\n ContinuousGrYlRd = 'continuous-GrYlRd',\n ContinuousRdYlGr = 'continuous-RdYlGr',\n ContinuousBlYlRd = 'continuous-BlYlRd',\n ContinuousYlRd = 'continuous-YlRd',\n ContinuousBlPu = 'continuous-BlPu',\n ContinuousYlBl = 'continuous-YlBl',\n ContinuousBlues = 'continuous-blues',\n ContinuousReds = 'continuous-reds',\n ContinuousGreens = 'continuous-greens',\n ContinuousPurples = 'continuous-purples',\n Fixed = 'fixed',\n Shades = 'shades',\n}\n\n/**\n * @public\n */\nexport interface FieldColor {\n /** The main color scheme mode */\n mode: FieldColorModeId | string;\n /** Stores the fixed color value if mode is fixed */\n fixedColor?: string;\n /** Some visualizations need to know how to assign a series color from by value color schemes */\n seriesBy?: FieldColorSeriesByMode;\n}\n\n/**\n * @beta\n */\nexport type FieldColorSeriesByMode = 'min' | 'max' | 'last';\n\nexport const FALLBACK_COLOR = '#808080';\n","export const availableIconsIndex = {\n google: true,\n microsoft: true,\n github: true,\n gitlab: true,\n okta: true,\n discord: true,\n hipchat: true,\n amazon: true,\n 'google-hangouts-alt': true,\n pagerduty: true,\n line: true,\n anchor: true,\n 'adjust-circle': true,\n 'angle-double-down': true,\n 'angle-double-right': true,\n 'angle-double-left': true,\n 'angle-double-up': true,\n 'angle-down': true,\n 'angle-left': true,\n 'angle-right': true,\n 'angle-up': true,\n 'align-left': true,\n 'align-right': true,\n 'api-endpoint': true,\n 'application-observability': true,\n apps: true,\n 'archive-alt': true,\n arrow: true,\n 'arrow-down': true,\n 'arrow-from-right': true,\n 'arrow-left': true,\n 'arrow-random': true,\n 'arrow-right': true,\n 'arrow-to-right': true,\n 'arrow-up': true,\n 'arrows-h': true,\n 'arrows-v': true,\n asserts: true,\n 'expand-arrows': true,\n 'expand-arrows-alt': true,\n at: true,\n ai: true,\n backward: true,\n bars: true,\n bell: true,\n 'bell-slash': true,\n bolt: true,\n book: true,\n bookmark: true,\n 'book-open': true,\n 'brackets-curly': true,\n 'browser-alt': true,\n bug: true,\n building: true,\n 'calculator-alt': true,\n 'calendar-alt': true,\n 'calendar-slash': true,\n camera: true,\n capture: true,\n 'channel-add': true,\n 'chart-line': true,\n check: true,\n 'check-circle': true,\n 'check-square': true,\n circle: true,\n 'circle-mono': true,\n 'clipboard-alt': true,\n 'clock-nine': true,\n cloud: true,\n 'cloud-download': true,\n 'cloud-upload': true,\n 'code-branch': true,\n cog: true,\n columns: true,\n 'comment-alt': true,\n 'comment-alt-message': true,\n 'comment-alt-share': true,\n 'comments-alt': true,\n compass: true,\n 'compress-arrows': true,\n copy: true,\n 'corner-down-right-alt': true,\n 'create-dashboard': true,\n 'credit-card': true,\n crosshair: true,\n cube: true,\n dashboard: true,\n database: true,\n 'dice-three': true,\n docker: true,\n 'document-info': true,\n 'document-layout-left': true,\n 'download-alt': true,\n draggabledots: true,\n drilldown: true,\n edit: true,\n 'ellipsis-v': true,\n enter: true,\n envelope: true,\n 'exchange-alt': true,\n 'exclamation-triangle': true,\n 'exclamation-circle': true,\n exclamation: true,\n 'external-link-alt': true,\n eye: true,\n 'eye-slash': true,\n 'ellipsis-h': true,\n /* @deprecated, use 'spinner' instead */\n 'fa fa-spinner': true,\n favorite: true,\n 'file-alt': true,\n 'file-blank': true,\n 'file-copy-alt': true,\n 'file-download': true,\n 'file-edit-alt': true,\n 'file-landscape-alt': true,\n filter: true,\n flip: true,\n folder: true,\n font: true,\n fire: true,\n 'folder-open': true,\n 'folder-plus': true,\n 'folder-upload': true,\n forward: true,\n 'frontend-observability': true,\n 'gf-bar-alignment-after': true,\n 'gf-bar-alignment-before': true,\n 'gf-bar-alignment-center': true,\n 'gf-glue': true,\n 'gf-grid': true,\n 'gf-interpolation-linear': true,\n 'gf-interpolation-smooth': true,\n 'gf-interpolation-step-after': true,\n 'gf-interpolation-step-before': true,\n 'gf-landscape': true,\n 'gf-layout-simple': true,\n 'gf-logs': true,\n 'gf-ml': true,\n 'gf-movepane-left': true,\n 'gf-movepane-right': true,\n 'gf-portrait': true,\n 'gf-service-account': true,\n 'gf-show-context': true,\n 'gf-pin': true,\n 'gf-prometheus': true,\n 'gf-traces': true,\n globe: true,\n grafana: true,\n 'graph-bar': true,\n heart: true,\n 'heart-rate': true,\n 'heart-break': true,\n history: true,\n 'history-alt': true,\n home: true,\n 'home-alt': true,\n 'horizontal-align-center': true,\n 'horizontal-align-left': true,\n 'horizontal-align-right': true,\n hourglass: true,\n import: true,\n info: true,\n 'info-circle': true,\n k6: true,\n 'k6-rounded': true,\n 'key-skeleton-alt': true,\n keyboard: true,\n kubernetes: true,\n 'layer-group': true,\n 'layers-alt': true,\n 'legend-hide': true,\n 'legend-show': true,\n 'library-panel': true,\n 'line-alt': true,\n link: true,\n 'link-broken': true,\n 'list-ui-alt': true,\n 'list-ul': true,\n 'list-ol': true,\n lock: true,\n 'map-marker': true,\n 'map-marker-plus': true,\n 'map-marker-minus': true,\n message: true,\n minus: true,\n 'minus-circle': true,\n 'mobile-android': true,\n monitor: true,\n 'multi-step': true,\n palette: true,\n 'panel-add': true,\n paragraph: true,\n 'pathfinder-unite': true,\n pause: true,\n 'pause-circle': true,\n pen: true,\n percentage: true,\n play: true,\n plug: true,\n plus: true,\n 'plus-circle': true,\n 'plus-square': true,\n power: true,\n 'presentation-play': true,\n process: true,\n 'question-circle': true,\n 'record-audio': true,\n repeat: true,\n rocket: true,\n 'ruler-combined': true,\n save: true,\n search: true,\n 'search-minus': true,\n 'search-plus': true,\n 'share-alt': true,\n shield: true,\n 'shield-exclamation': true,\n signal: true,\n signin: true,\n signout: true,\n sitemap: true,\n slack: true,\n 'sliders-v-alt': true,\n spinner: true,\n 'sort-amount-down': true,\n 'sort-amount-up': true,\n 'square-shape': true,\n star: true,\n 'step-backward': true,\n stopwatch: true,\n 'stopwatch-slash': true,\n sync: true,\n 'sync-slash': true,\n table: true,\n 'table-collapse-all': true,\n 'table-expand-all': true,\n 'tag-alt': true,\n 'telegram-alt': true,\n 'text-fields': true,\n 'thumbs-up': true,\n times: true,\n 'times-circle': true,\n 'toggle-on': true,\n 'toggle-off': true,\n 'trash-alt': true,\n unarchive: true,\n unlock: true,\n upload: true,\n user: true,\n 'users-alt': true,\n 'user-arrows': true,\n 'vertical-align-bottom': true,\n 'vertical-align-center': true,\n 'vertical-align-top': true,\n 'web-section-alt': true,\n 'wrap-text': true,\n wrench: true,\n rss: true,\n x: true,\n 'add-user': true,\n attach: true,\n};\n\nexport type IconName = keyof typeof availableIconsIndex;\n\nexport function isIconName(iconName: unknown): iconName is IconName {\n if (!iconName || typeof iconName !== 'string') {\n return false;\n }\n\n return iconName in availableIconsIndex;\n}\n\nexport function toIconName(iconName: string): IconName | undefined {\n if (isIconName(iconName)) {\n return iconName;\n }\n\n return undefined;\n}\n","export interface UserOrgDTO {\n orgId: number;\n name: string;\n role: OrgRole;\n}\n\nexport enum OrgRole {\n None = 'None',\n Viewer = 'Viewer',\n Editor = 'Editor',\n Admin = 'Admin',\n}\n","import { ComponentType } from 'react';\n\nimport { KeyValue } from './data';\nimport { IconName } from './icon';\n\n/** Describes plugins life cycle status */\nexport enum PluginState {\n alpha = 'alpha', // Only included if `enable_alpha` config option is true\n beta = 'beta', // Will show a warning banner\n stable = 'stable', // Will not show anything\n deprecated = 'deprecated', // Will continue to work -- but not show up in the options to add\n}\n\n/** Describes {@link https://grafana.com/docs/grafana/latest/plugins | type of plugin} */\nexport enum PluginType {\n panel = 'panel',\n datasource = 'datasource',\n app = 'app',\n renderer = 'renderer',\n secretsmanager = 'secretsmanager',\n}\n\n/** Describes status of {@link https://grafana.com/docs/grafana/latest/plugins/plugin-signatures/ | plugin signature} */\nexport enum PluginSignatureStatus {\n internal = 'internal', // core plugin, no signature\n valid = 'valid', // signed and accurate MANIFEST\n invalid = 'invalid', // invalid signature\n modified = 'modified', // valid signature, but content mismatch\n missing = 'missing', // missing signature file\n}\n\n/** Describes level of {@link https://grafana.com/docs/grafana/latest/plugins/plugin-signatures/#plugin-signature-levels/ | plugin signature level} */\nexport enum PluginSignatureType {\n grafana = 'grafana',\n commercial = 'commercial',\n community = 'community',\n private = 'private',\n core = 'core',\n}\n\n/** Describes error code returned from Grafana plugins API call */\nexport enum PluginErrorCode {\n missingSignature = 'signatureMissing',\n invalidSignature = 'signatureInvalid',\n modifiedSignature = 'signatureModified',\n failedBackendStart = 'failedBackendStart',\n angular = 'angular',\n}\n\n/** Describes error returned from Grafana plugins API call */\nexport interface PluginError {\n errorCode: PluginErrorCode;\n pluginId: string;\n pluginType?: PluginType;\n}\n\nexport interface AngularMeta {\n detected: boolean;\n hideDeprecation: boolean;\n}\n\n// Signals to SystemJS how to load frontend js assets.\nexport enum PluginLoadingStrategy {\n fetch = 'fetch',\n script = 'script',\n}\n\nexport interface PluginMeta<T extends KeyValue = {}> {\n id: string;\n name: string;\n type: PluginType;\n info: PluginMetaInfo;\n includes?: PluginInclude[];\n state?: PluginState;\n aliasIDs?: string[];\n\n // System.load & relative URLS\n module: string;\n baseUrl: string;\n\n // Define plugin requirements\n dependencies?: PluginDependencies;\n\n // Filled in by the backend\n jsonData?: T;\n secureJsonData?: KeyValue;\n secureJsonFields?: KeyValue<boolean>;\n enabled?: boolean;\n autoEnabled?: boolean;\n defaultNavUrl?: string;\n hasUpdate?: boolean;\n enterprise?: boolean;\n latestVersion?: string;\n pinned?: boolean;\n signature?: PluginSignatureStatus;\n signatureType?: PluginSignatureType;\n signatureOrg?: string;\n live?: boolean;\n angular?: AngularMeta;\n angularDetected?: boolean;\n loadingStrategy?: PluginLoadingStrategy;\n extensions?: PluginExtensions;\n moduleHash?: string;\n}\n\ninterface PluginDependencyInfo {\n id: string;\n name: string;\n version: string;\n type: PluginType;\n}\n\nexport interface PluginDependencies {\n grafanaDependency?: string;\n grafanaVersion: string;\n plugins: PluginDependencyInfo[];\n extensions: {\n // A list of exposed component IDs\n exposedComponents: string[];\n };\n}\n\nexport type ExtensionInfo = {\n targets: string | string[];\n title: string;\n description?: string;\n};\n\nexport interface PluginExtensions {\n // The component extensions that the plugin registers\n addedComponents: ExtensionInfo[];\n\n addedFunctions: ExtensionInfo[];\n\n // The link extensions that the plugin registers\n addedLinks: ExtensionInfo[];\n\n // The React components that the plugin exposes\n exposedComponents: Array<{\n id: string;\n title: string;\n description?: string;\n }>;\n\n // The extension points that the plugin provides\n extensionPoints: Array<{\n id: string;\n title: string;\n description?: string;\n }>;\n}\n\nexport enum PluginIncludeType {\n dashboard = 'dashboard',\n page = 'page',\n\n // Only valid for apps\n panel = 'panel',\n datasource = 'datasource',\n}\n\nexport interface PluginInclude {\n type: PluginIncludeType;\n name: string;\n path?: string;\n icon?: string;\n\n // \"Admin\", \"Editor\" or \"Viewer\". If set then the include will only show up in the navigation if the user has the required roles.\n role?: string;\n\n // if action is set then the include will only show up in the navigation if the user has the required permission.\n // The action will take precedence over the role.\n action?: string;\n\n // Adds the \"page\" or \"dashboard\" type includes to the navigation if set to `true`.\n addToNav?: boolean;\n\n // Angular app pages\n component?: string;\n}\n\ninterface PluginMetaInfoLink {\n name: string;\n url: string;\n target?: '_blank' | '_self' | '_parent' | '_top';\n}\n\nexport interface PluginBuildInfo {\n time?: number;\n repo?: string;\n branch?: string;\n hash?: string;\n number?: number;\n pr?: number;\n}\n\nexport interface ScreenshotInfo {\n name: string;\n path: string;\n}\n\nexport interface PluginMetaInfo {\n author: {\n name: string;\n url?: string;\n };\n description: string;\n links: PluginMetaInfoLink[];\n logos: {\n large: string;\n small: string;\n };\n build?: PluginBuildInfo;\n screenshots: ScreenshotInfo[];\n updated: string;\n version: string;\n}\n\nexport interface PluginConfigPageProps<T extends PluginMeta> {\n plugin: GrafanaPlugin<T>;\n query: KeyValue; // The URL query parameters\n}\n\nexport interface PluginConfigPage<T extends PluginMeta> {\n title: string; // Display\n icon?: IconName;\n id: string; // Unique, in URL\n\n body: ComponentType<PluginConfigPageProps<T>>;\n}\n\nexport class GrafanaPlugin<T extends PluginMeta = PluginMeta> {\n // Meta is filled in by the plugin loading system\n meta: T;\n\n // This is set if the plugin system had errors loading the plugin\n loadError?: boolean;\n\n // Config control (app/datasource)\n angularConfigCtrl?: any;\n\n // Show configuration tabs on the plugin page\n configPages?: Array<PluginConfigPage<T>>;\n\n // Tabs on the plugin page\n addConfigPage(tab: PluginConfigPage<T>) {\n if (!this.configPages) {\n this.configPages = [];\n }\n this.configPages.push(tab);\n return this;\n }\n\n /**\n * @deprecated -- this is no longer necessary and will be removed\n */\n setChannelSupport() {\n console.warn('[deprecation] plugin is using ignored option: setChannelSupport', this.meta);\n return this;\n }\n\n constructor() {\n this.meta = {} as T;\n }\n}\n","import { ThemeVisualizationColors } from '../themes/createVisualizationColors';\n\nexport enum GrafanaThemeType {\n Light = 'light',\n Dark = 'dark',\n}\n\nexport interface GrafanaThemeCommons {\n name: string;\n // TODO: not sure if should be a part of theme\n breakpoints: {\n xs: string;\n sm: string;\n md: string;\n lg: string;\n xl: string;\n xxl: string;\n };\n typography: {\n fontFamily: {\n sansSerif: string;\n monospace: string;\n };\n size: {\n base: string;\n xs: string;\n sm: string;\n md: string;\n lg: string;\n };\n weight: {\n light: number;\n regular: number;\n semibold: number;\n bold: number;\n };\n lineHeight: {\n xs: number; //1\n sm: number; //1.1\n md: number; // 4/3\n lg: number; // 1.5\n };\n // TODO: Refactor to use size instead of custom defs\n heading: {\n h1: string;\n h2: string;\n h3: string;\n h4: string;\n h5: string;\n h6: string;\n };\n link: {\n decoration: string;\n hoverDecoration: string;\n };\n };\n spacing: {\n base: number;\n insetSquishMd: string;\n d: string;\n xxs: string;\n xs: string;\n sm: string;\n md: string;\n lg: string;\n xl: string;\n gutter: string;\n\n // Next-gen forms spacing variables\n // TODO: Move variables definition to respective components when implementing\n formSpacingBase: number;\n formMargin: string;\n formFieldsetMargin: string;\n formInputHeight: number;\n formButtonHeight: number;\n formInputPaddingHorizontal: string;\n // Used for icons do define spacing between icon and input field\n // Applied on the right(prefix) or left(suffix)\n formInputAffixPaddingHorizontal: string;\n formInputMargin: string;\n formLabelPadding: string;\n formLabelMargin: string;\n formValidationMessagePadding: string;\n formValidationMessageMargin: string;\n inlineFormMargin: string;\n };\n border: {\n radius: {\n sm: string;\n md: string;\n lg: string;\n };\n width: {\n sm: string;\n };\n };\n height: {\n sm: number;\n md: number;\n lg: number;\n };\n panelPadding: number;\n panelHeaderHeight: number;\n zIndex: {\n dropdown: number;\n navbarFixed: number;\n sidemenu: number;\n tooltip: number;\n modalBackdrop: number;\n modal: number;\n portal: number;\n typeahead: number;\n };\n}\n\nexport interface GrafanaTheme extends GrafanaThemeCommons {\n type: GrafanaThemeType;\n isDark: boolean;\n isLight: boolean;\n palette: {\n black: string;\n white: string;\n dark1: string;\n dark2: string;\n dark3: string;\n dark4: string;\n dark5: string;\n dark6: string;\n dark7: string;\n dark8: string;\n dark9: string;\n dark10: string;\n gray1: string;\n gray2: string;\n gray3: string;\n gray4: string;\n gray5: string;\n gray6: string;\n gray7: string;\n\n // New greys palette used by next-gen form elements\n gray98: string;\n gray97: string;\n gray95: string;\n gray90: string;\n gray85: string;\n gray70: string;\n gray60: string;\n gray33: string;\n gray25: string;\n gray15: string;\n gray10: string;\n gray05: string;\n\n // New blues palette used by next-gen form elements\n blue95: string;\n blue85: string;\n blue80: string;\n blue77: string;\n\n // New reds palette used by next-gen form elements\n red88: string;\n\n // Accent colors\n redBase: string;\n redShade: string;\n greenBase: string;\n greenShade: string;\n red: string;\n yellow: string;\n purple: string;\n orange: string;\n orangeDark: string;\n queryRed: string;\n queryGreen: string;\n queryPurple: string;\n queryOrange: string;\n brandPrimary: string;\n brandSuccess: string;\n brandWarning: string;\n brandDanger: string;\n\n // Status colors\n online: string;\n warn: string;\n critical: string;\n };\n colors: {\n bg1: string;\n bg2: string;\n bg3: string;\n border1: string;\n border2: string;\n border3: string;\n\n bgBlue1: string;\n bgBlue2: string;\n\n dashboardBg: string;\n bodyBg: string;\n panelBg: string;\n panelBorder: string;\n pageHeaderBg: string;\n pageHeaderBorder: string;\n\n dropdownBg: string;\n dropdownShadow: string;\n dropdownOptionHoverBg: string;\n\n // Link colors\n link: string;\n linkDisabled: string;\n linkHover: string;\n linkExternal: string;\n\n // Text colors\n textStrong: string;\n textHeading: string;\n text: string;\n textSemiWeak: string;\n textWeak: string;\n textFaint: string;\n textBlue: string;\n\n // Next-gen forms functional colors\n formLabel: string;\n formDescription: string;\n formInputBg: string;\n formInputBgDisabled: string;\n formInputBorder: string;\n formInputBorderHover: string;\n formInputBorderActive: string;\n formInputBorderInvalid: string;\n formFocusOutline: string;\n formInputText: string;\n formInputDisabledText: string;\n formInputPlaceholderText: string;\n formValidationMessageText: string;\n formValidationMessageBg: string;\n };\n shadows: {\n listItem: string;\n };\n visualization: ThemeVisualizationColors;\n}\n","import {\n TimeZone as SchemaTimeZone,\n TimeZoneBrowser as SchemaTimeZoneBrowser,\n TimeZoneUtc as SchemaTimeZoneUtc,\n defaultTimeZone,\n} from '@grafana/schema';\n\nimport { dateTime, DateTime } from '../datetime/moment_wrapper';\n\nexport interface RawTimeRange {\n from: DateTime | string;\n to: DateTime | string;\n}\n\nexport interface TimeRange {\n from: DateTime;\n to: DateTime;\n raw: RawTimeRange;\n}\n\n/**\n * Type to describe relative time to now in seconds.\n * @internal\n */\nexport interface RelativeTimeRange {\n from: number;\n to: number;\n}\n\nexport interface AbsoluteTimeRange {\n from: number;\n to: number;\n}\n\nexport interface IntervalValues {\n interval: string; // 10s,5m\n intervalMs: number;\n}\n\nexport interface TimeOption {\n from: string;\n to: string;\n display: string;\n invalid?: boolean;\n section?: number;\n}\n\n/** @deprecated use TimeZone from schema */\nexport type TimeZone = SchemaTimeZone;\n\n/** @deprecated use TimeZoneBrowser from schema */\nexport type TimeZoneBrowser = SchemaTimeZoneBrowser;\n\n/** @deprecated use TimeZoneUtc from schema */\nexport type TimeZoneUtc = SchemaTimeZoneUtc;\n\n/** @deprecated use defaultTimeZone from schema */\nexport const DefaultTimeZone = defaultTimeZone;\n\nexport interface TimeOptions {\n [key: string]: TimeOption[];\n}\n\nexport type TimeFragment = string | DateTime;\n\nexport const TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss';\n\nexport function getDefaultTimeRange(): TimeRange {\n const now = dateTime();\n\n return {\n from: dateTime(now).subtract(6, 'hour'),\n to: now,\n raw: { from: 'now-6h', to: 'now' },\n };\n}\n\n/**\n * Returns the default relative time range.\n *\n * @public\n */\nexport function getDefaultRelativeTimeRange(): RelativeTimeRange {\n return {\n from: 600,\n to: 0,\n };\n}\n\n/**\n * Simple helper to quickly create a TimeRange object either from string representations of a dateTime or directly\n * DateTime objects.\n */\nexport function makeTimeRange(from: DateTime | string, to: DateTime | string): TimeRange {\n const fromDateTime = typeof from === 'string' ? dateTime(from) : from;\n const toDateTime = typeof to === 'string' ? dateTime(to) : to;\n return {\n from: fromDateTime,\n to: toDateTime,\n raw: {\n from: fromDateTime,\n to: toDateTime,\n },\n };\n}\n","import { PluginState } from '../types/plugin';\nimport { SelectableValue } from '../types/select';\n\nexport interface RegistryItem {\n id: string; // Unique Key -- saved in configs\n name: string; // Display Name, can change without breaking configs\n description?: string;\n aliasIds?: string[]; // when the ID changes, we may want backwards compatibility ('current' => 'last')\n\n /**\n * Some extensions should not be user selectable\n * like: 'all' and 'any' matchers;\n */\n excludeFromPicker?: boolean;\n\n /**\n * Optional feature state\n */\n state?: PluginState;\n}\n\nexport interface RegistryItemWithOptions<TOptions = any> extends RegistryItem {\n /**\n * Convert the options to a string\n */\n getOptionsDisplayText?: (options: TOptions) => string;\n\n /**\n * Default options used if nothing else is specified\n */\n defaultOptions?: TOptions;\n}\n\ninterface RegistrySelectInfo {\n options: Array<SelectableValue<string>>;\n current: Array<SelectableValue<string>>;\n}\n\nexport class Registry<T extends RegistryItem> {\n private ordered: T[] = [];\n private byId = new Map<string, T>();\n private initialized = false;\n\n constructor(private init?: () => T[]) {\n this.init = init;\n }\n\n setInit = (init: () => T[]) => {\n if (this.initialized) {\n throw new Error('Registry already initialized');\n }\n this.init = init;\n };\n\n getIfExists(id: string | undefined): T | undefined {\n if (!this.initialized) {\n this.initialize();\n }\n\n if (id) {\n return this.byId.get(id);\n }\n\n return undefined;\n }\n\n private initialize() {\n if (this.init) {\n for (const ext of this.init()) {\n this.register(ext);\n }\n }\n this.sort();\n this.initialized = true;\n }\n\n get(id: string): T {\n const v = this.getIfExists(id);\n if (!v) {\n throw new Error(`\"${id}\" not found in: ${this.list().map((v) => v.id)}`);\n }\n return v;\n }\n\n selectOptions(current?: string[], filter?: (ext: T) => boolean): RegistrySelectInfo {\n if (!this.initialized) {\n this.initialize();\n }\n\n const select: RegistrySelectInfo = {\n options: [],\n current: [],\n };\n\n const currentOptions: Record<string, SelectableValue<string>> = {};\n if (current) {\n for (const id of current) {\n currentOptions[id] = {};\n }\n }\n\n for (const ext of this.ordered) {\n if (ext.excludeFromPicker) {\n continue;\n }\n if (filter && !filter(ext)) {\n continue;\n }\n\n const option = {\n value: ext.id,\n label: ext.name,\n description: ext.description,\n };\n\n if (ext.state === PluginState.alpha) {\n option.label += ' (alpha)';\n }\n\n select.options.push(option);\n if (currentOptions[ext.id]) {\n currentOptions[ext.id] = option;\n }\n }\n\n if (current) {\n // this makes sure we preserve the order of ids\n select.current = Object.values(currentOptions);\n }\n\n return select;\n }\n\n /**\n * Return a list of values by ID, or all values if not specified\n */\n list(ids?: string[]): T[] {\n if (!this.initialized) {\n this.initialize();\n }\n\n if (ids) {\n const found: T[] = [];\n for (const id of ids) {\n const v = this.getIfExists(id);\n if (v) {\n found.push(v);\n }\n }\n return found;\n }\n\n return this.ordered;\n }\n\n isEmpty(): boolean {\n if (!this.initialized) {\n this.initialize();\n }\n\n return this.ordered.length === 0;\n }\n\n register(ext: T) {\n if (this.byId.has(ext.id)) {\n throw new Error('Duplicate Key:' + ext.id);\n }\n\n this.byId.set(ext.id, ext);\n this.ordered.push(ext);\n\n if (ext.aliasIds) {\n for (const alias of ext.aliasIds) {\n if (!this.byId.has(alias)) {\n this.byId.set(alias, ext);\n }\n }\n }\n\n if (this.initialized) {\n this.sort();\n }\n }\n\n private sort() {\n // TODO sort the list\n }\n}\n","import { KeyValue } from '../types/data';\n\n// Avoid writing the warning message more than once every 10s\nconst history: KeyValue<number> = {};\n\nexport const deprecationWarning = (file: string, oldName: string, newName?: string) => {\n let message = `[Deprecation warning] ${file}: ${oldName} is deprecated`;\n if (newName) {\n message += `. Use ${newName} instead`;\n }\n const now = Date.now();\n const last = history[message];\n if (!last || now - last > 10000) {\n console.warn(message);\n history[message] = now;\n }\n};\n","import { SelectableValue } from '../types/select';\n\nexport const toOption = (value: string): SelectableValue<string> => ({ label: value, value });\n","import { DecimalCount } from '../types/displayValue';\n\nimport { scaledUnits, ValueFormatter } from './valueFormats';\n\nexport function currency(symbol: string, asSuffix?: boolean): ValueFormatter {\n const units = ['', 'K', 'M', 'B', 'T'];\n const scaler = scaledUnits(1000, units);\n return (value: number, decimals?: DecimalCount, scaledDecimals?: DecimalCount) => {\n if (value == null) {\n return { text: '' };\n }\n const isNegative = value < 0;\n if (isNegative) {\n value = Math.abs(value);\n }\n const scaled = scaler(value, decimals, scaledDecimals);\n if (asSuffix) {\n scaled.suffix = scaled.suffix !== undefined ? `${scaled.suffix}${symbol}` : undefined;\n } else {\n scaled.prefix = symbol;\n }\n if (isNegative) {\n scaled.prefix = `-${scaled.prefix?.length ? scaled.prefix : ''}`;\n }\n return scaled;\n };\n}\n\nconst SI_PREFIXES = ['f', 'p', 'n', 'µ', 'm', '', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];\nconst SI_BASE_INDEX = SI_PREFIXES.indexOf('');\n\nexport function getOffsetFromSIPrefix(c: string): number {\n const charIndex = SI_PREFIXES.findIndex((prefix) => prefix.normalize('NFKD') === c.normalize('NFKD'));\n return charIndex < 0 ? 0 : charIndex - SI_BASE_INDEX;\n}\n\nconst BIN_PREFIXES = ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi', 'Yi'];\n\nexport function binaryPrefix(unit: string, offset = 0): ValueFormatter {\n const units = BIN_PREFIXES.map((p) => ' ' + p + unit);\n return scaledUnits(1024, units, offset);\n}\n\nexport function SIPrefix(unit: string, offset = 0): ValueFormatter {\n const units = SI_PREFIXES.map((p) => ' ' + p + unit);\n return scaledUnits(1000, units, SI_BASE_INDEX + offset);\n}\n","import { DecimalCount } from '../types/displayValue';\n\nimport { toFixed, FormattedValue } from './valueFormats';\n\nexport function toPercent(size: number | null, decimals: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n return { text: toFixed(size, decimals), suffix: '%' };\n}\n\nexport function toPercentUnit(size: number | null, decimals: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n return { text: toFixed(100 * size, decimals), suffix: '%' };\n}\n\nexport function toHex0x(value: number | null, decimals: DecimalCount): FormattedValue {\n if (value == null) {\n return { text: '' };\n }\n const asHex = toHex(value, decimals);\n if (asHex.text.substring(0, 1) === '-') {\n asHex.text = '-0x' + asHex.text.substring(1);\n } else {\n asHex.text = '0x' + asHex.text;\n }\n return asHex;\n}\n\nexport function toHex(value: number | null, decimals: DecimalCount): FormattedValue {\n if (value == null) {\n return { text: '' };\n }\n return {\n text: parseFloat(toFixed(value, decimals)).toString(16).toUpperCase(),\n };\n}\n\nexport function sci(value: number | null, decimals: DecimalCount): FormattedValue {\n if (value == null) {\n return { text: '' };\n }\n return { text: value.toExponential(decimals ?? undefined) };\n}\n","import { localTimeFormat, systemDateFormats } from '../datetime/formats';\nimport { dateTimeFormat, dateTimeFormatTimeAgo } from '../datetime/formatter';\nimport { toDuration as duration, toUtc, dateTime } from '../datetime/moment_wrapper';\nimport { DecimalCount } from '../types/displayValue';\nimport { TimeZone } from '../types/time';\n\nimport { toFixed, toFixedScaled, FormattedValue, ValueFormatter } from './valueFormats';\n\ninterface IntervalsInSeconds {\n [interval: string]: number;\n}\n\nexport enum Interval {\n Year = 'year',\n Month = 'month',\n Week = 'week',\n Day = 'day',\n Hour = 'hour',\n Minute = 'minute',\n Second = 'second',\n Millisecond = 'millisecond',\n}\n\nconst UNITS = [\n Interval.Year,\n Interval.Month,\n Interval.Week,\n Interval.Day,\n Interval.Hour,\n Interval.Minute,\n Interval.Second,\n Interval.Millisecond,\n];\n\nconst INTERVALS_IN_SECONDS: IntervalsInSeconds = {\n [Interval.Year]: 31536000,\n [Interval.Month]: 2592000,\n [Interval.Week]: 604800,\n [Interval.Day]: 86400,\n [Interval.Hour]: 3600,\n [Interval.Minute]: 60,\n [Interval.Second]: 1,\n [Interval.Millisecond]: 0.001,\n};\n\nexport function toNanoSeconds(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n if (Math.abs(size) < 1000) {\n return { text: toFixed(size, decimals), suffix: ' ns' };\n } else if (Math.abs(size) < 1000000) {\n return toFixedScaled(size / 1000, decimals, ' µs');\n } else if (Math.abs(size) < 1000000000) {\n return toFixedScaled(size / 1000000, decimals, ' ms');\n } else if (Math.abs(size) < 60000000000) {\n return toFixedScaled(size / 1000000000, decimals, ' s');\n } else if (Math.abs(size) < 3600000000000) {\n return toFixedScaled(size / 60000000000, decimals, ' min');\n } else if (Math.abs(size) < 86400000000000) {\n return toFixedScaled(size / 3600000000000, decimals, ' hour');\n } else {\n return toFixedScaled(size / 86400000000000, decimals, ' day');\n }\n}\n\nexport function toMicroSeconds(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n if (Math.abs(size) < 1000) {\n return { text: toFixed(size, decimals), suffix: ' µs' };\n } else if (Math.abs(size) < 1000000) {\n return toFixedScaled(size / 1000, decimals, ' ms');\n } else {\n return toFixedScaled(size / 1000000, decimals, ' s');\n }\n}\n\nexport function toMilliSeconds(size: number, decimals?: DecimalCount, scaledDecimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n if (Math.abs(size) < 1000) {\n return { text: toFixed(size, decimals), suffix: ' ms' };\n } else if (Math.abs(size) < 60000) {\n // Less than 1 min\n return toFixedScaled(size / 1000, decimals, ' s');\n } else if (Math.abs(size) < 3600000) {\n // Less than 1 hour, divide in minutes\n return toFixedScaled(size / 60000, decimals, ' min');\n } else if (Math.abs(size) < 86400000) {\n // Less than one day, divide in hours\n return toFixedScaled(size / 3600000, decimals, ' hour');\n } else if (Math.abs(size) < 31536000000) {\n // Less than one year, divide in days\n return toFixedScaled(size / 86400000, decimals, ' day');\n }\n\n return toFixedScaled(size / 31536000000, decimals, ' year');\n}\n\nexport function toSeconds(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n // If 0, use s unit instead of ns\n if (size === 0) {\n return { text: '0', suffix: ' s' };\n }\n\n // Less than 1 µs, divide in ns\n if (Math.abs(size) < 0.000001) {\n return toFixedScaled(size * 1e9, decimals, ' ns');\n }\n // Less than 1 ms, divide in µs\n if (Math.abs(size) < 0.001) {\n return toFixedScaled(size * 1e6, decimals, ' µs');\n }\n // Less than 1 second, divide in ms\n if (Math.abs(size) < 1) {\n return toFixedScaled(size * 1e3, decimals, ' ms');\n }\n\n if (Math.abs(size) < 60) {\n return { text: toFixed(size, decimals), suffix: ' s' };\n } else if (Math.abs(size) < 3600) {\n // Less than 1 hour, divide in minutes\n return toFixedScaled(size / 60, decimals, ' min');\n } else if (Math.abs(size) < 86400) {\n // Less than one day, divide in hours\n return toFixedScaled(size / 3600, decimals, ' hour');\n } else if (Math.abs(size) < 604800) {\n // Less than one week, divide in days\n return toFixedScaled(size / 86400, decimals, ' day');\n } else if (Math.abs(size) < 31536000) {\n // Less than one year, divide in week\n return toFixedScaled(size / 604800, decimals, ' week');\n }\n\n return toFixedScaled(size / 3.15569e7, decimals, ' year');\n}\n\nexport function toMinutes(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n if (Math.abs(size) < 60) {\n return { text: toFixed(size, decimals), suffix: ' min' };\n } else if (Math.abs(size) < 1440) {\n return toFixedScaled(size / 60, decimals, ' hour');\n } else if (Math.abs(size) < 10080) {\n return toFixedScaled(size / 1440, decimals, ' day');\n } else if (Math.abs(size) < 604800) {\n return toFixedScaled(size / 10080, decimals, ' week');\n } else {\n return toFixedScaled(size / 5.25948e5, decimals, ' year');\n }\n}\n\nexport function toHours(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n if (Math.abs(size) < 24) {\n return { text: toFixed(size, decimals), suffix: ' hour' };\n } else if (Math.abs(size) < 168) {\n return toFixedScaled(size / 24, decimals, ' day');\n } else if (Math.abs(size) < 8760) {\n return toFixedScaled(size / 168, decimals, ' week');\n } else {\n return toFixedScaled(size / 8760, decimals, ' year');\n }\n}\n\nexport function toDays(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n if (Math.abs(size) < 7) {\n return toFixedScaled(size, decimals, ' day');\n } else if (Math.abs(size) < 365) {\n return toFixedScaled(size / 7, decimals, ' week');\n } else {\n return toFixedScaled(size / 365, decimals, ' year');\n }\n}\n\nexport function toDuration(size: number, decimals: DecimalCount, timeScale: Interval): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n if (size === 0) {\n return { text: '0', suffix: ' ' + timeScale + 's' };\n }\n\n if (size < 0) {\n const v = toDuration(-size, decimals, timeScale);\n if (!v.suffix) {\n v.suffix = '';\n }\n v.suffix += ' ago';\n return v;\n }\n\n // convert $size to milliseconds\n // intervals_in_seconds uses seconds (duh), convert them to milliseconds here to minimize floating point errors\n size *= INTERVALS_IN_SECONDS[timeScale] * 1000;\n\n const strings = [];\n\n // after first value >= 1 print only $decimals more\n let decrementDecimals = false;\n let decimalsCount = 0;\n\n if (decimals !== null && decimals !== undefined) {\n decimalsCount = decimals;\n }\n\n for (let i = 0; i < UNITS.length && decimalsCount >= 0; i++) {\n const interval = INTERVALS_IN_SECONDS[UNITS[i]] * 1000;\n const value = size / interval;\n if (value >= 1 || decrementDecimals) {\n decrementDecimals = true;\n const floor = Math.floor(value);\n const unit = UNITS[i] + (floor !== 1 ? 's' : '');\n strings.push(floor + ' ' + unit);\n size = size % interval;\n decimalsCount--;\n }\n }\n\n return { text: strings.join(', ') };\n}\n\nexport function toClock(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n // < 1 second\n if (size < 1000) {\n return {\n text: toUtc(size).format('SSS\\\\m\\\\s'),\n };\n }\n\n // < 1 minute\n if (size < 60000) {\n let format = 'ss\\\\s:SSS\\\\m\\\\s';\n if (decimals === 0) {\n format = 'ss\\\\s';\n }\n return { text: toUtc(size).format(format) };\n }\n\n // < 1 hour\n if (size < 3600000) {\n let format = 'mm\\\\m:ss\\\\s:SSS\\\\m\\\\s';\n if (decimals === 0) {\n format = 'mm\\\\m';\n } else if (decimals === 1) {\n format = 'mm\\\\m:ss\\\\s';\n }\n return { text: toUtc(size).format(format) };\n }\n\n let format = 'mm\\\\m:ss\\\\s:SSS\\\\m\\\\s';\n\n const hours = `${Math.floor(duration(size, 'milliseconds').asHours())}h`;\n\n if (decimals === 0) {\n format = '';\n } else if (decimals === 1) {\n format = 'mm\\\\m';\n } else if (decimals === 2) {\n format = 'mm\\\\m:ss\\\\s';\n }\n\n const text = format ? `${hours}:${toUtc(size).format(format)}` : hours;\n return { text };\n}\n\nexport function toDurationInMilliseconds(size: number, decimals: DecimalCount): FormattedValue {\n return toDuration(size, decimals, Interval.Millisecond);\n}\n\nexport function toDurationInSeconds(size: number, decimals: DecimalCount): FormattedValue {\n return toDuration(size, decimals, Interval.Second);\n}\n\nexport function toDurationInHoursMinutesSeconds(size: number): FormattedValue {\n if (size < 0) {\n const v = toDurationInHoursMinutesSeconds(-size);\n if (!v.suffix) {\n v.suffix = '';\n }\n v.suffix += ' ago';\n return v;\n }\n const strings = [];\n const numHours = Math.floor(size / 3600);\n const numMinutes = Math.floor((size % 3600) / 60);\n const numSeconds = Math.floor((size % 3600) % 60);\n numHours > 9 ? strings.push('' + numHours) : strings.push('0' + numHours);\n numMinutes > 9 ? strings.push('' + numMinutes) : strings.push('0' + numMinutes);\n numSeconds > 9 ? strings.push('' + numSeconds) : strings.push('0' + numSeconds);\n return { text: strings.join(':') };\n}\n\nexport function toDurationInDaysHoursMinutesSeconds(size: number): FormattedValue {\n if (size < 0) {\n const v = toDurationInDaysHoursMinutesSeconds(-size);\n if (!v.suffix) {\n v.suffix = '';\n }\n v.suffix += ' ago';\n return v;\n }\n let dayString = '';\n const numDays = Math.floor(size / (24 * 3600));\n if (numDays > 0) {\n dayString = numDays + ' d ';\n }\n const hmsString = toDurationInHoursMinutesSeconds(size - numDays * 24 * 3600);\n return { text: dayString + hmsString.text };\n}\n\nexport function toTimeTicks(size: number, decimals: DecimalCount): FormattedValue {\n return toSeconds(size / 100, decimals);\n}\n\nexport function toClockMilliseconds(size: number, decimals: DecimalCount): FormattedValue {\n return toClock(size, decimals);\n}\n\nexport function toClockSeconds(size: number, decimals: DecimalCount): FormattedValue {\n return toClock(size * 1000, decimals);\n}\n\nexport function toDateTimeValueFormatter(pattern: string, todayPattern?: string): ValueFormatter {\n return (value: number, decimals: DecimalCount, scaledDecimals: DecimalCount, timeZone?: TimeZone): FormattedValue => {\n if (todayPattern) {\n if (dateTime().isSame(value, 'day')) {\n return {\n text: dateTimeFormat(value, { format: todayPattern, timeZone }),\n };\n }\n }\n return { text: dateTimeFormat(value, { format: pattern, timeZone }) };\n };\n}\n\nexport const dateTimeAsIso = toDateTimeValueFormatter('YYYY-MM-DD HH:mm:ss');\nexport const dateTimeAsIsoNoDateIfToday = toDateTimeValueFormatter('YYYY-MM-DD HH:mm:ss', 'HH:mm:ss');\nexport const dateTimeAsUS = toDateTimeValueFormatter('MM/DD/YYYY h:mm:ss a');\nexport const dateTimeAsUSNoDateIfToday = toDateTimeValueFormatter('MM/DD/YYYY h:mm:ss a', 'h:mm:ss a');\n\nexport function getDateTimeAsLocalFormat() {\n return toDateTimeValueFormatter(\n localTimeFormat({\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n })\n );\n}\n\nexport function getDateTimeAsLocalFormatNoDateIfToday() {\n return toDateTimeValueFormatter(\n localTimeFormat({\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n }),\n localTimeFormat({\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n })\n );\n}\n\nexport function dateTimeSystemFormatter(\n value: number,\n decimals: DecimalCount,\n scaledDecimals: DecimalCount,\n timeZone?: TimeZone,\n showMs?: boolean\n): FormattedValue {\n return {\n text: dateTimeFormat(value, {\n format: showMs ? systemDateFormats.fullDateMS : systemDateFormats.fullDate,\n timeZone,\n }),\n };\n}\n\nexport function dateTimeFromNow(\n value: number,\n decimals: DecimalCount,\n scaledDecimals: DecimalCount,\n timeZone?: TimeZone\n): FormattedValue {\n return { text: dateTimeFormatTimeAgo(value, { timeZone }) };\n}\n","import { toHex, sci, toHex0x, toPercent, toPercentUnit } from './arithmeticFormatters';\nimport {\n dateTimeAsIso,\n dateTimeAsIsoNoDateIfToday,\n dateTimeAsUS,\n dateTimeAsUSNoDateIfToday,\n getDateTimeAsLocalFormat,\n getDateTimeAsLocalFormatNoDateIfToday,\n dateTimeFromNow,\n toClockMilliseconds,\n toClockSeconds,\n toDays,\n toDurationInDaysHoursMinutesSeconds,\n toDurationInHoursMinutesSeconds,\n toDurationInMilliseconds,\n toDurationInSeconds,\n toHours,\n toMicroSeconds,\n toMilliSeconds,\n toMinutes,\n toNanoSeconds,\n toSeconds,\n toTimeTicks,\n dateTimeSystemFormatter,\n} from './dateTimeFormatters';\nimport { binaryPrefix, currency, SIPrefix } from './symbolFormatters';\nimport {\n locale,\n scaledUnits,\n simpleCountUnit,\n toFixedUnit,\n ValueFormatCategory,\n stringFormater,\n booleanValueFormatter,\n} from './valueFormats';\n\nexport const getCategories = (): ValueFormatCategory[] => [\n {\n name: 'Misc',\n formats: [\n { name: 'Number', id: 'none', fn: toFixedUnit('') },\n { name: 'String', id: 'string', fn: stringFormater },\n {\n name: 'short',\n id: 'short',\n fn: scaledUnits(1000, ['', ' K', ' Mil', ' Bil', ' Tri', ' Quadr', ' Quint', ' Sext', ' Sept']),\n },\n { name: 'SI short', id: 'sishort', fn: SIPrefix('') },\n { name: 'Percent (0-100)', id: 'percent', fn: toPercent },\n { name: 'Percent (0.0-1.0)', id: 'percentunit', fn: toPercentUnit },\n { name: 'Humidity (%H)', id: 'humidity', fn: toFixedUnit('%H') },\n { name: 'Decibel', id: 'dB', fn: toFixedUnit('dB') },\n { name: 'Candela (cd)', id: 'candela', fn: SIPrefix('cd') },\n { name: 'Hexadecimal (0x)', id: 'hex0x', fn: toHex0x },\n { name: 'Hexadecimal', id: 'hex', fn: toHex },\n { name: 'Scientific notation', id: 'sci', fn: sci },\n { name: 'Locale format', id: 'locale', fn: locale },\n { name: 'Pixels', id: 'pixel', fn: toFixedUnit('px') },\n ],\n },\n {\n name: 'Acceleration',\n formats: [\n { name: 'Meters/sec²', id: 'accMS2', fn: toFixedUnit('m/sec²') },\n { name: 'Feet/sec²', id: 'accFS2', fn: toFixedUnit('f/sec²') },\n { name: 'G unit', id: 'accG', fn: toFixedUnit('g') },\n ],\n },\n {\n name: 'Angle',\n formats: [\n { name: 'Degrees (°)', id: 'degree', fn: toFixedUnit('°') },\n { name: 'Radians', id: 'radian', fn: toFixedUnit('rad') },\n { name: 'Gradian', id: 'grad', fn: toFixedUnit('grad') },\n { name: 'Arc Minutes', id: 'arcmin', fn: toFixedUnit('arcmin') },\n { name: 'Arc Seconds', id: 'arcsec', fn: toFixedUnit('arcsec') },\n ],\n },\n {\n name: 'Area',\n formats: [\n { name: 'Square Meters (m²)', id: 'areaM2', fn: toFixedUnit('m²') },\n { name: 'Square Feet (ft²)', id: 'areaF2', fn: toFixedUnit('ft²') },\n { name: 'Square Miles (mi²)', id: 'areaMI2', fn: toFixedUnit('mi²') },\n { name: 'Acres (ac)', id: 'acres', fn: toFixedUnit('ac') },\n { name: 'Hectares (ha)', id: 'hectares', fn: toFixedUnit('ha') },\n ],\n },\n {\n name: 'Computation',\n formats: [\n { name: 'FLOP/s', id: 'flops', fn: SIPrefix('FLOPS') },\n { name: 'MFLOP/s', id: 'mflops', fn: SIPrefix('FLOPS', 2) },\n { name: 'GFLOP/s', id: 'gflops', fn: SIPrefix('FLOPS', 3) },\n { name: 'TFLOP/s', id: 'tflops', fn: SIPrefix('FLOPS', 4) },\n { name: 'PFLOP/s', id: 'pflops', fn: SIPrefix('FLOPS', 5) },\n { name: 'EFLOP/s', id: 'eflops', fn: SIPrefix('FLOPS', 6) },\n { name: 'ZFLOP/s', id: 'zflops', fn: SIPrefix('FLOPS', 7) },\n { name: 'YFLOP/s', id: 'yflops', fn: SIPrefix('FLOPS', 8) },\n ],\n },\n {\n name: 'Concentration',\n formats: [\n { name: 'parts-per-million (ppm)', id: 'ppm', fn: toFixedUnit('ppm') },\n { name: 'parts-per-billion (ppb)', id: 'conppb', fn: toFixedUnit('ppb') },\n { name: 'nanogram per cubic meter (ng/m³)', id: 'conngm3', fn: toFixedUnit('ng/m³') },\n { name: 'nanogram per normal cubic meter (ng/Nm³)', id: 'conngNm3', fn: toFixedUnit('ng/Nm³') },\n { name: 'microgram per cubic meter (μg/m³)', id: 'conμgm3', fn: toFixedUnit('μg/m³') },\n { name: 'microgram per normal cubic meter (μg/Nm³)', id: 'conμgNm3', fn: toFixedUnit('μg/Nm³') },\n { name: 'milligram per cubic meter (mg/m³)', id: 'conmgm3', fn: toFixedUnit('mg/m³') },\n { name: 'milligram per normal cubic meter (mg/Nm³)', id: 'conmgNm3', fn: toFixedUnit('mg/Nm³') },\n { name: 'gram per cubic meter (g/m³)', id: 'congm3', fn: toFixedUnit('g/m³') },\n { name: 'gram per normal cubic meter (g/Nm³)', id: 'congNm3', fn: toFixedUnit('g/Nm³') },\n { name: 'milligrams per decilitre (mg/dL)', id: 'conmgdL', fn: toFixedUnit('mg/dL') },\n { name: 'millimoles per litre (mmol/L)', id: 'conmmolL', fn: toFixedUnit('mmol/L') },\n ],\n },\n {\n name: 'Currency',\n formats: [\n { name: 'Dollars ($)', id: 'currencyUSD', fn: currency('$') },\n { name: 'Pounds (£)', id: 'currencyGBP', fn: currency('£') },\n { name: 'Euro (€)', id: 'currencyEUR', fn: currency('€') },\n { name: 'Yen (¥)', id: 'currencyJPY', fn: currency('¥') },\n { name: 'Rubles (₽)', id: 'currencyRUB', fn: currency('₽') },\n { name: 'Hryvnias (₴)', id: 'currencyUAH', fn: currency('₴') },\n { name: 'Real (R$)', id: 'currencyBRL', fn: currency('R$') },\n { name: 'Danish Krone (kr)', id: 'currencyDKK', fn: currency('kr', true) },\n { name: 'Icelandic Króna (kr)', id: 'currencyISK', fn: currency('kr', true) },\n { name: 'Norwegian Krone (kr)', id: 'currencyNOK', fn: currency('kr', true) },\n { name: 'Swedish Krona (kr)', id: 'currencySEK', fn: currency('kr', true) },\n { name: 'Czech koruna (czk)', id: 'currencyCZK', fn: currency('czk') },\n { name: 'Swiss franc (CHF)', id: 'currencyCHF', fn: currency('CHF') },\n { name: 'Polish Złoty (PLN)', id: 'currencyPLN', fn: currency('PLN') },\n { name: 'Bitcoin (฿)', id: 'currencyBTC', fn: currency('฿') },\n { name: 'Milli Bitcoin (฿)', id: 'currencymBTC', fn: currency('mBTC') },\n { name: 'Micro Bitcoin (฿)', id: 'currencyμBTC', fn: currency('μBTC') },\n { name: 'South African Rand (R)', id: 'currencyZAR', fn: currency('R') },\n { name: 'Indian Rupee (₹)', id: 'currencyINR', fn: currency('₹') },\n { name: 'South Korean Won (₩)', id: 'currencyKRW', fn: currency('₩') },\n { name: 'Indonesian Rupiah (Rp)', id: 'currencyIDR', fn: currency('Rp') },\n { name: 'Philippine Peso (PHP)', id: 'currencyPHP', fn: currency('PHP') },\n { name: 'Vietnamese Dong (VND)', id: 'currencyVND', fn: currency('đ', true) },\n { name: 'Turkish Lira (₺)', id: 'currencyTRY', fn: currency('₺', true) },\n { name: 'Malaysian Ringgit (RM)', id: 'currencyMYR', fn: currency('RM') },\n { name: 'CFP franc (XPF)', id: 'currencyXPF', fn: currency('XPF') },\n { name: 'Bulgarian Lev (BGN)', id: 'currencyBGN', fn: currency('BGN') },\n { name: 'Guaranà (₲)', id: 'currencyPYG', fn: currency('₲') },\n { name: 'Uruguay Peso (UYU)', id: 'currencyUYU', fn: currency('UYU') },\n { name: 'Israeli New Shekels (₪)', id: 'currencyILS', fn: currency('₪') },\n ],\n },\n {\n name: 'Data',\n formats: [\n { name: 'bytes(IEC)', id: 'bytes', fn: binaryPrefix('B') },\n { name: 'bytes(SI)', id: 'decbytes', fn: SIPrefix('B') },\n { name: 'bits(IEC)', id: 'bits', fn: binaryPrefix('b') },\n { name: 'bits(SI)', id: 'decbits', fn: SIPrefix('b') },\n { name: 'kibibytes', id: 'kbytes', fn: binaryPrefix('B', 1) },\n { name: 'kilobytes', id: 'deckbytes', fn: SIPrefix('B', 1) },\n { name: 'mebibytes', id: 'mbytes', fn: binaryPrefix('B', 2) },\n { name: 'megabytes', id: 'decmbytes', fn: SIPrefix('B', 2) },\n { name: 'gibibytes', id: 'gbytes', fn: binaryPrefix('B', 3) },\n { name: 'gigabytes', id: 'decgbytes', fn: SIPrefix('B', 3) },\n { name: 'tebibytes', id: 'tbytes', fn: binaryPrefix('B', 4) },\n { name: 'terabytes', id: 'dectbytes', fn: SIPrefix('B', 4) },\n { name: 'pebibytes', id: 'pbytes', fn: binaryPrefix('B', 5) },\n { name: 'petabytes', id: 'decpbytes', fn: SIPrefix('B', 5) },\n ],\n },\n {\n name: 'Data rate',\n formats: [\n { name: 'packets/sec', id: 'pps', fn: SIPrefix('p/s') },\n { name: 'bytes/sec(IEC)', id: 'binBps', fn: binaryPrefix('B/s') },\n { name: 'bytes/sec(SI)', id: 'Bps', fn: SIPrefix('B/s') },\n { name: 'bits/sec(IEC)', id: 'binbps', fn: binaryPrefix('b/s') },\n { name: 'bits/sec(SI)', id: 'bps', fn: SIPrefix('b/s') },\n { name: 'kibibytes/sec', id: 'KiBs', fn: binaryPrefix('B/s', 1) },\n { name: 'kibibits/sec', id: 'Kibits', fn: binaryPrefix('b/s', 1) },\n { name: 'kilobytes/sec', id: 'KBs', fn: SIPrefix('B/s', 1) },\n { name: 'kilobits/sec', id: 'Kbits', fn: SIPrefix('b/s', 1) },\n { name: 'mebibytes/sec', id: 'MiBs', fn: binaryPrefix('B/s', 2) },\n { name: 'mebibits/sec', id: 'Mibits', fn: binaryPrefix('b/s', 2) },\n { name: 'megabytes/sec', id: 'MBs', fn: SIPrefix('B/s', 2) },\n { name: 'megabits/sec', id: 'Mbits', fn: SIPrefix('b/s', 2) },\n { name: 'gibibytes/sec', id: 'GiBs', fn: binaryPrefix('B/s', 3) },\n { name: 'gibibits/sec', id: 'Gibits', fn: binaryPrefix('b/s', 3) },\n { name: 'gigabytes/sec', id: 'GBs', fn: SIPrefix('B/s', 3) },\n { name: 'gigabits/sec', id: 'Gbits', fn: SIPrefix('b/s', 3) },\n { name: 'tebibytes/sec', id: 'TiBs', fn: binaryPrefix('B/s', 4) },\n { name: 'tebibits/sec', id: 'Tibits', fn: binaryPrefix('b/s', 4) },\n { name: 'terabytes/sec', id: 'TBs', fn: SIPrefix('B/s', 4) },\n { name: 'terabits/sec', id: 'Tbits', fn: SIPrefix('b/s', 4) },\n { name: 'pebibytes/sec', id: 'PiBs', fn: binaryPrefix('B/s', 5) },\n { name: 'pebibits/sec', id: 'Pibits', fn: binaryPrefix('b/s', 5) },\n { name: 'petabytes/sec', id: 'PBs', fn: SIPrefix('B/s', 5) },\n { name: 'petabits/sec', id: 'Pbits', fn: SIPrefix('b/s', 5) },\n ],\n },\n {\n name: 'Date & time',\n formats: [\n { name: 'Datetime ISO', id: 'dateTimeAsIso', fn: dateTimeAsIso },\n { name: 'Datetime ISO (No date if today)', id: 'dateTimeAsIsoNoDateIfToday', fn: dateTimeAsIsoNoDateIfToday },\n { name: 'Datetime US', id: 'dateTimeAsUS', fn: dateTimeAsUS },\n { name: 'Datetime US (No date if today)', id: 'dateTimeAsUSNoDateIfToday', fn: dateTimeAsUSNoDateIfToday },\n { name: 'Datetime local', id: 'dateTimeAsLocal', fn: getDateTimeAsLocalFormat() },\n {\n name: 'Datetime local (No date if today)',\n id: 'dateTimeAsLocalNoDateIfToday',\n fn: getDateTimeAsLocalFormatNoDateIfToday(),\n },\n { name: 'Datetime default', id: 'dateTimeAsSystem', fn: dateTimeSystemFormatter },\n { name: 'From Now', id: 'dateTimeFromNow', fn: dateTimeFromNow },\n ],\n },\n {\n name: 'Energy',\n formats: [\n { name: 'Watt (W)', id: 'watt', fn: SIPrefix('W') },\n { name: 'Kilowatt (kW)', id: 'kwatt', fn: SIPrefix('W', 1) },\n { name: 'Megawatt (MW)', id: 'megwatt', fn: SIPrefix('W', 2) },\n { name: 'Gigawatt (GW)', id: 'gwatt', fn: SIPrefix('W', 3) },\n { name: 'Milliwatt (mW)', id: 'mwatt', fn: SIPrefix('W', -1) },\n { name: 'Watt per square meter (W/m²)', id: 'Wm2', fn: SIPrefix('W/m²') },\n { name: 'Volt-Ampere (VA)', id: 'voltamp', fn: SIPrefix('VA') },\n { name: 'Kilovolt-Ampere (kVA)', id: 'kvoltamp', fn: SIPrefix('VA', 1) },\n { name: 'Volt-Ampere reactive (VAr)', id: 'voltampreact', fn: SIPrefix('VAr') },\n { name: 'Kilovolt-Ampere reactive (kVAr)', id: 'kvoltampreact', fn: SIPrefix('VAr', 1) },\n { name: 'Watt-hour (Wh)', id: 'watth', fn: SIPrefix('Wh') },\n { name: 'Watt-hour per Kilogram (Wh/kg)', id: 'watthperkg', fn: SIPrefix('Wh/kg') },\n { name: 'Kilowatt-hour (kWh)', id: 'kwatth', fn: SIPrefix('Wh', 1) },\n { name: 'Kilowatt-min (kWm)', id: 'kwattm', fn: SIPrefix('W-Min', 1) },\n { name: 'Megawatt-hour (MWh)', id: 'mwatth', fn: SIPrefix('Wh', 2) },\n { name: 'Ampere-hour (Ah)', id: 'amph', fn: SIPrefix('Ah') },\n { name: 'Kiloampere-hour (kAh)', id: 'kamph', fn: SIPrefix('Ah', 1) },\n { name: 'Milliampere-hour (mAh)', id: 'mamph', fn: SIPrefix('Ah', -1) },\n { name: 'Joule (J)', id: 'joule', fn: SIPrefix('J') },\n { name: 'Electron volt (eV)', id: 'ev', fn: SIPrefix('eV') },\n { name: 'Ampere (A)', id: 'amp', fn: SIPrefix('A') },\n { name: 'Kiloampere (kA)', id: 'kamp', fn: SIPrefix('A', 1) },\n { name: 'Milliampere (mA)', id: 'mamp', fn: SIPrefix('A', -1) },\n { name: 'Volt (V)', id: 'volt', fn: SIPrefix('V') },\n { name: 'Kilovolt (kV)', id: 'kvolt', fn: SIPrefix('V', 1) },\n { name: 'Millivolt (mV)', id: 'mvolt', fn: SIPrefix('V', -1) },\n { name: 'Decibel-milliwatt (dBm)', id: 'dBm', fn: SIPrefix('dBm') },\n { name: 'Milliohm (mΩ)', id: 'mohm', fn: SIPrefix('Ω', -1) },\n { name: 'Ohm (Ω)', id: 'ohm', fn: SIPrefix('Ω') },\n { name: 'Kiloohm (kΩ)', id: 'kohm', fn: SIPrefix('Ω', 1) },\n { name: 'Megaohm (MΩ)', id: 'Mohm', fn: SIPrefix('Ω', 2) },\n { name: 'Farad (F)', id: 'farad', fn: SIPrefix('F') },\n { name: 'Microfarad (µF)', id: 'µfarad', fn: SIPrefix('F', -2) },\n { name: 'Nanofarad (nF)', id: 'nfarad', fn: SIPrefix('F', -3) },\n { name: 'Picofarad (pF)', id: 'pfarad', fn: SIPrefix('F', -4) },\n { name: 'Femtofarad (fF)', id: 'ffarad', fn: SIPrefix('F', -5) },\n { name: 'Henry (H)', id: 'henry', fn: SIPrefix('H') },\n { name: 'Millihenry (mH)', id: 'mhenry', fn: SIPrefix('H', -1) },\n { name: 'Microhenry (µH)', id: 'µhenry', fn: SIPrefix('H', -2) },\n { name: 'Lumens (Lm)', id: 'lumens', fn: SIPrefix('Lm') },\n ],\n },\n {\n name: 'Flow',\n formats: [\n { name: 'Gallons/min (gpm)', id: 'flowgpm', fn: toFixedUnit('gpm') },\n { name: 'Cubic meters/sec (cms)', id: 'flowcms', fn: toFixedUnit('cms') },\n { name: 'Cubic feet/sec (cfs)', id: 'flowcfs', fn: toFixedUnit('cfs') },\n { name: 'Cubic feet/min (cfm)', id: 'flowcfm', fn: toFixedUnit('cfm') },\n { name: 'Litre/hour', id: 'litreh', fn: toFixedUnit('L/h') },\n { name: 'Litre/min (L/min)', id: 'flowlpm', fn: toFixedUnit('L/min') },\n { name: 'milliLitre/min (mL/min)', id: 'flowmlpm', fn: toFixedUnit('mL/min') },\n { name: 'Lux (lx)', id: 'lux', fn: toFixedUnit('lux') },\n ],\n },\n {\n name: 'Force',\n formats: [\n { name: 'Newton-meters (Nm)', id: 'forceNm', fn: SIPrefix('Nm') },\n { name: 'Kilonewton-meters (kNm)', id: 'forcekNm', fn: SIPrefix('Nm', 1) },\n { name: 'Newtons (N)', id: 'forceN', fn: SIPrefix('N') },\n { name: 'Kilonewtons (kN)', id: 'forcekN', fn: SIPrefix('N', 1) },\n ],\n },\n {\n name: 'Hash rate',\n formats: [\n { name: 'hashes/sec', id: 'Hs', fn: SIPrefix('H/s') },\n { name: 'kilohashes/sec', id: 'KHs', fn: SIPrefix('H/s', 1) },\n { name: 'megahashes/sec', id: 'MHs', fn: SIPrefix('H/s', 2) },\n { name: 'gigahashes/sec', id: 'GHs', fn: SIPrefix('H/s', 3) },\n { name: 'terahashes/sec', id: 'THs', fn: SIPrefix('H/s', 4) },\n { name: 'petahashes/sec', id: 'PHs', fn: SIPrefix('H/s', 5) },\n { name: 'exahashes/sec', id: 'EHs', fn: SIPrefix('H/s', 6) },\n ],\n },\n {\n name: 'Mass',\n formats: [\n { name: 'milligram (mg)', id: 'massmg', fn: SIPrefix('g', -1) },\n { name: 'gram (g)', id: 'massg', fn: SIPrefix('g') },\n { name: 'pound (lb)', id: 'masslb', fn: toFixedUnit('lb') },\n { name: 'kilogram (kg)', id: 'masskg', fn: SIPrefix('g', 1) },\n { name: 'metric ton (t)', id: 'masst', fn: toFixedUnit('t') },\n ],\n },\n {\n name: 'Length',\n formats: [\n { name: 'millimeter (mm)', id: 'lengthmm', fn: SIPrefix('m', -1) },\n { name: 'inch (in)', id: 'lengthin', fn: toFixedUnit('in') },\n { name: 'feet (ft)', id: 'lengthft', fn: toFixedUnit('ft') },\n { name: 'meter (m)', id: 'lengthm', fn: SIPrefix('m') },\n { name: 'kilometer (km)', id: 'lengthkm', fn: SIPrefix('m', 1) },\n { name: 'mile (mi)', id: 'lengthmi', fn: toFixedUnit('mi') },\n ],\n },\n {\n name: 'Pressure',\n formats: [\n { name: 'Millibars', id: 'pressurembar', fn: SIPrefix('bar', -1) },\n { name: 'Bars', id: 'pressurebar', fn: SIPrefix('bar') },\n { name: 'Kilobars', id: 'pressurekbar', fn: SIPrefix('bar', 1) },\n { name: 'Pascals', id: 'pressurepa', fn: SIPrefix('Pa') },\n { name: 'Hectopascals', id: 'pressurehpa', fn: toFixedUnit('hPa') },\n { name: 'Kilopascals', id: 'pressurekpa', fn: toFixedUnit('kPa') },\n { name: 'Inches of mercury', id: 'pressurehg', fn: toFixedUnit('\"Hg') },\n { name: 'PSI', id: 'pressurepsi', fn: scaledUnits(1000, ['psi', 'ksi', 'Mpsi']) },\n ],\n },\n {\n name: 'Radiation',\n formats: [\n { name: 'Becquerel (Bq)', id: 'radbq', fn: SIPrefix('Bq') },\n { name: 'curie (Ci)', id: 'radci', fn: SIPrefix('Ci') },\n { name: 'Gray (Gy)', id: 'radgy', fn: SIPrefix('Gy') },\n { name: 'rad', id: 'radrad', fn: SIPrefix('rad') },\n { name: 'Sievert (Sv)', id: 'radsv', fn: SIPrefix('Sv') },\n { name: 'milliSievert (mSv)', id: 'radmsv', fn: SIPrefix('Sv', -1) },\n { name: 'microSievert (µSv)', id: 'radusv', fn: SIPrefix('Sv', -2) },\n { name: 'rem', id: 'radrem', fn: SIPrefix('rem') },\n { name: 'Exposure (C/kg)', id: 'radexpckg', fn: SIPrefix('C/kg') },\n { name: 'roentgen (R)', id: 'radr', fn: SIPrefix('R') },\n { name: 'Sievert/hour (Sv/h)', id: 'radsvh', fn: SIPrefix('Sv/h') },\n { name: 'milliSievert/hour (mSv/h)', id: 'radmsvh', fn: SIPrefix('Sv/h', -1) },\n { name: 'microSievert/hour (µSv/h)', id: 'radusvh', fn: SIPrefix('Sv/h', -2) },\n ],\n },\n {\n name: 'Rotational Speed',\n formats: [\n { name: 'Revolutions per minute (rpm)', id: 'rotrpm', fn: toFixedUnit('rpm') },\n { name: 'Hertz (Hz)', id: 'rothz', fn: SIPrefix('Hz') },\n { name: 'Kilohertz (kHz)', id: 'rotkhz', fn: SIPrefix('Hz', 1) },\n { name: 'Megahertz (MHz)', id: 'rotmhz', fn: SIPrefix('Hz', 2) },\n { name: 'Gigahertz (GHz)', id: 'rotghz', fn: SIPrefix('Hz', 3) },\n { name: 'Radians per second (rad/s)', id: 'rotrads', fn: toFixedUnit('rad/s') },\n { name: 'Degrees per second (°/s)', id: 'rotdegs', fn: toFixedUnit('°/s') },\n ],\n },\n {\n name: 'Temperature',\n formats: [\n { name: 'Celsius (°C)', id: 'celsius', fn: toFixedUnit('°C') },\n { name: 'Fahrenheit (°F)', id: 'fahrenheit', fn: toFixedUnit('°F') },\n { name: 'Kelvin (K)', id: 'kelvin', fn: toFixedUnit('K') },\n ],\n },\n {\n name: 'Time',\n formats: [\n { name: 'Hertz (1/s)', id: 'hertz', fn: SIPrefix('Hz') },\n { name: 'nanoseconds (ns)', id: 'ns', fn: toNanoSeconds },\n { name: 'microseconds (µs)', id: 'µs', fn: toMicroSeconds },\n { name: 'milliseconds (ms)', id: 'ms', fn: toMilliSeconds },\n { name: 'seconds (s)', id: 's', fn: toSeconds },\n { name: 'minutes (m)', id: 'm', fn: toMinutes },\n { name: 'hours (h)', id: 'h', fn: toHours },\n { name: 'days (d)', id: 'd', fn: toDays },\n { name: 'duration (ms)', id: 'dtdurationms', fn: toDurationInMilliseconds },\n { name: 'duration (s)', id: 'dtdurations', fn: toDurationInSeconds },\n { name: 'duration (hh:mm:ss)', id: 'dthms', fn: toDurationInHoursMinutesSeconds },\n { name: 'duration (d hh:mm:ss)', id: 'dtdhms', fn: toDurationInDaysHoursMinutesSeconds },\n { name: 'Timeticks (s/100)', id: 'timeticks', fn: toTimeTicks },\n { name: 'clock (ms)', id: 'clockms', fn: toClockMilliseconds },\n { name: 'clock (s)', id: 'clocks', fn: toClockSeconds },\n ],\n },\n {\n name: 'Throughput',\n formats: [\n { name: 'counts/sec (cps)', id: 'cps', fn: simpleCountUnit('c/s') },\n { name: 'ops/sec (ops)', id: 'ops', fn: simpleCountUnit('ops/s') },\n { name: 'requests/sec (rps)', id: 'reqps', fn: simpleCountUnit('req/s') },\n { name: 'reads/sec (rps)', id: 'rps', fn: simpleCountUnit('rd/s') },\n { name: 'writes/sec (wps)', id: 'wps', fn: simpleCountUnit('wr/s') },\n { name: 'I/O ops/sec (iops)', id: 'iops', fn: simpleCountUnit('io/s') },\n { name: 'events/sec (eps)', id: 'eps', fn: simpleCountUnit('evt/s') },\n { name: 'messages/sec (mps)', id: 'mps', fn: simpleCountUnit('msg/s') },\n { name: 'records/sec (rps)', id: 'recps', fn: simpleCountUnit('rec/s') },\n { name: 'rows/sec (rps)', id: 'rowsps', fn: simpleCountUnit('rows/s') },\n { name: 'counts/min (cpm)', id: 'cpm', fn: simpleCountUnit('c/m') },\n { name: 'ops/min (opm)', id: 'opm', fn: simpleCountUnit('ops/m') },\n { name: 'requests/min (rpm)', id: 'reqpm', fn: simpleCountUnit('req/m') },\n { name: 'reads/min (rpm)', id: 'rpm', fn: simpleCountUnit('rd/m') },\n { name: 'writes/min (wpm)', id: 'wpm', fn: simpleCountUnit('wr/m') },\n { name: 'events/min (epm)', id: 'epm', fn: simpleCountUnit('evts/m') },\n { name: 'messages/min (mpm)', id: 'mpm', fn: simpleCountUnit('msgs/m') },\n { name: 'records/min (rpm)', id: 'recpm', fn: simpleCountUnit('rec/m') },\n { name: 'rows/min (rpm)', id: 'rowspm', fn: simpleCountUnit('rows/m') },\n ],\n },\n {\n name: 'Velocity',\n formats: [\n { name: 'meters/second (m/s)', id: 'velocityms', fn: toFixedUnit('m/s') },\n { name: 'kilometers/hour (km/h)', id: 'velocitykmh', fn: toFixedUnit('km/h') },\n { name: 'miles/hour (mph)', id: 'velocitymph', fn: toFixedUnit('mph') },\n { name: 'knot (kn)', id: 'velocityknot', fn: toFixedUnit('kn') },\n ],\n },\n {\n name: 'Volume',\n formats: [\n { name: 'millilitre (mL)', id: 'mlitre', fn: SIPrefix('L', -1) },\n { name: 'litre (L)', id: 'litre', fn: SIPrefix('L') },\n { name: 'cubic meter', id: 'm3', fn: toFixedUnit('m³') },\n { name: 'Normal cubic meter', id: 'Nm3', fn: toFixedUnit('Nm³') },\n { name: 'cubic decimeter', id: 'dm3', fn: toFixedUnit('dm³') },\n { name: 'gallons', id: 'gallons', fn: toFixedUnit('gal') },\n ],\n },\n {\n name: 'Boolean',\n formats: [\n { name: 'True / False', id: 'bool', fn: booleanValueFormatter('True', 'False') },\n { name: 'Yes / No', id: 'bool_yes_no', fn: booleanValueFormatter('Yes', 'No') },\n { name: 'On / Off', id: 'bool_on_off', fn: booleanValueFormatter('On', 'Off') },\n ],\n },\n];\n","import { clamp } from 'lodash';\n\nimport { DecimalCount } from '../types/displayValue';\nimport { TimeZone } from '../types/time';\n\nimport { getCategories } from './categories';\nimport { toDateTimeValueFormatter } from './dateTimeFormatters';\nimport { getOffsetFromSIPrefix, SIPrefix, currency } from './symbolFormatters';\n\nexport interface FormattedValue {\n text: string;\n prefix?: string;\n suffix?: string;\n}\n\nexport function formattedValueToString(val: FormattedValue): string {\n return `${val.prefix ?? ''}${val.text}${val.suffix ?? ''}`;\n}\n\nexport type ValueFormatter = (\n value: number,\n decimals?: DecimalCount,\n scaledDecimals?: DecimalCount,\n timeZone?: TimeZone,\n showMs?: boolean\n) => FormattedValue;\n\nexport interface ValueFormat {\n name: string;\n id: string;\n fn: ValueFormatter;\n}\n\nexport interface ValueFormatCategory {\n name: string;\n formats: ValueFormat[];\n}\n\nexport interface ValueFormatterIndex {\n [id: string]: ValueFormatter;\n}\n\n// Globals & formats cache\nlet categories: ValueFormatCategory[] = [];\nconst index: ValueFormatterIndex = {};\nlet hasBuiltIndex = false;\n\nexport function toFixed(value: number, decimals?: DecimalCount): string {\n if (value === null) {\n return '';\n }\n\n if (value === Number.NEGATIVE_INFINITY || value === Number.POSITIVE_INFINITY) {\n return value.toLocaleString();\n }\n\n if (decimals === null || decimals === undefined) {\n decimals = getDecimalsForValue(value);\n }\n\n if (value === 0) {\n return value.toFixed(decimals);\n }\n\n const factor = decimals ? Math.pow(10, Math.max(0, decimals)) : 1;\n const formatted = String(Math.round(value * factor) / factor);\n\n // if exponent return directly\n if (formatted.indexOf('e') !== -1 || value === 0) {\n return formatted;\n }\n\n const decimalPos = formatted.indexOf('.');\n const precision = decimalPos === -1 ? 0 : formatted.length - decimalPos - 1;\n if (precision < decimals) {\n return (precision ? formatted : formatted + '.') + String(factor).slice(1, decimals - precision + 1);\n }\n\n return formatted;\n}\n\nfunction getDecimalsForValue(value: number): number {\n const absValue = Math.abs(value);\n const log10 = Math.floor(Math.log(absValue) / Math.LN10);\n let dec = -log10 + 1;\n const magn = Math.pow(10, -dec);\n const norm = absValue / magn; // norm is between 1.0 and 10.0\n\n // special case for 2.5, requires an extra decimal\n if (norm > 2.25) {\n ++dec;\n }\n\n if (value % 1 === 0) {\n dec = 0;\n }\n\n const decimals = Math.max(0, dec);\n return decimals;\n}\n\nexport function toFixedScaled(value: number, decimals: DecimalCount, ext?: string): FormattedValue {\n return {\n text: toFixed(value, decimals),\n suffix: appendPluralIf(ext, Math.abs(value) > 1),\n };\n}\n\nfunction appendPluralIf(ext: string | undefined, condition: boolean): string | undefined {\n if (!condition) {\n return ext;\n }\n\n switch (ext) {\n case ' min':\n case ' hour':\n case ' day':\n case ' week':\n case ' year':\n return `${ext}s`;\n default:\n return ext;\n }\n}\n\nexport function toFixedUnit(unit: string, asPrefix?: boolean): ValueFormatter {\n return (size: number, decimals?: DecimalCount) => {\n if (size === null) {\n return { text: '' };\n }\n const text = toFixed(size, decimals);\n if (unit) {\n if (asPrefix) {\n return { text, prefix: unit };\n }\n return { text, suffix: ' ' + unit };\n }\n return { text };\n };\n}\n\nexport function isBooleanUnit(unit?: string) {\n return unit && unit.startsWith('bool');\n}\n\nexport function booleanValueFormatter(t: string, f: string): ValueFormatter {\n return (value) => {\n return { text: value ? t : f };\n };\n}\n\nconst logb = (b: number, x: number) => Math.log10(x) / Math.log10(b);\n\nexport function scaledUnits(factor: number, extArray: string[], offset = 0): ValueFormatter {\n return (size: number, decimals?: DecimalCount) => {\n if (size === null || size === undefined) {\n return { text: '' };\n }\n\n if (size === Number.NEGATIVE_INFINITY || size === Number.POSITIVE_INFINITY || isNaN(size)) {\n return { text: size.toLocaleString() };\n }\n\n const siIndex = size === 0 ? 0 : Math.floor(logb(factor, Math.abs(size)));\n const suffix = extArray[clamp(offset + siIndex, 0, extArray.length - 1)];\n\n return {\n text: toFixed(size / factor ** clamp(siIndex, -offset, extArray.length - offset - 1), decimals),\n suffix,\n };\n };\n}\n\nexport function locale(value: number, decimals: DecimalCount): FormattedValue {\n if (value == null) {\n return { text: '' };\n }\n return {\n text: value.toLocaleString(undefined, { maximumFractionDigits: decimals ?? undefined }),\n };\n}\n\nexport function simpleCountUnit(symbol: string): ValueFormatter {\n const units = ['', 'K', 'M', 'B', 'T'];\n const scaler = scaledUnits(1000, units);\n return (size: number, decimals?: DecimalCount, scaledDecimals?: DecimalCount) => {\n if (size === null) {\n return { text: '' };\n }\n const v = scaler(size, decimals, scaledDecimals);\n v.suffix += ' ' + symbol;\n return v;\n };\n}\n\nexport function stringFormater(value: number): FormattedValue {\n return { text: `${value}` };\n}\n\nfunction buildFormats() {\n categories = getCategories();\n\n for (const cat of categories) {\n for (const format of cat.formats) {\n index[format.id] = format.fn;\n }\n }\n\n // Resolve units pointing to old IDs\n [{ from: 'farenheit', to: 'fahrenheit' }].forEach((alias) => {\n const f = index[alias.to];\n if (f) {\n index[alias.from] = f;\n }\n });\n\n hasBuiltIndex = true;\n}\n\nexport function getValueFormat(id?: string | null): ValueFormatter {\n if (!id) {\n return toFixedUnit('');\n }\n\n if (!hasBuiltIndex) {\n buildFormats();\n }\n\n const fmt = index[id];\n\n if (!fmt && id) {\n let idx = id.indexOf(':');\n\n if (idx > 0) {\n const key = id.substring(0, idx);\n const sub = id.substring(idx + 1);\n\n if (key === 'prefix') {\n return toFixedUnit(sub, true);\n }\n\n if (key === 'suffix') {\n return toFixedUnit(sub, false);\n }\n\n if (key === 'time') {\n return toDateTimeValueFormatter(sub);\n }\n\n if (key === 'si') {\n const offset = getOffsetFromSIPrefix(sub.charAt(0));\n const unit = offset === 0 ? sub : sub.substring(1);\n return SIPrefix(unit, offset);\n }\n\n if (key === 'count') {\n return simpleCountUnit(sub);\n }\n\n if (key === 'currency') {\n return currency(sub);\n }\n\n if (key === 'bool') {\n idx = sub.indexOf('/');\n if (idx >= 0) {\n const t = sub.substring(0, idx);\n const f = sub.substring(idx + 1);\n return booleanValueFormatter(t, f);\n }\n return booleanValueFormatter(sub, '-');\n }\n }\n\n return toFixedUnit(id);\n }\n\n return fmt;\n}\n\nexport function getValueFormatterIndex(): ValueFormatterIndex {\n if (!hasBuiltIndex) {\n buildFormats();\n }\n\n return index;\n}\n\nexport function getValueFormats() {\n if (!hasBuiltIndex) {\n buildFormats();\n }\n\n return categories.map((cat) => {\n return {\n text: cat.name,\n submenu: cat.formats.map((format) => {\n return {\n text: format.name,\n value: format.id,\n };\n }),\n };\n });\n}\n","import { gte, compare, valid } from 'semver';\n\nimport {\n FunctionSelector,\n Selectors,\n SelectorsOf,\n StringSelector,\n VersionedSelectorGroup,\n VersionedSelectors,\n CssSelector,\n UrlSelector,\n FunctionSelectorTwoArgs,\n} from './types';\n\n/**\n * Resolves selectors based on the Grafana version\n */\nexport function resolveSelectors<T extends VersionedSelectorGroup>(\n versionedSelectors: T,\n grafanaVersion = 'latest'\n): SelectorsOf<T> {\n const version = grafanaVersion.replace(/\\-.*/, '');\n\n return resolveSelectorGroup(versionedSelectors, version);\n}\n\nfunction resolveSelectorGroup<T extends VersionedSelectorGroup>(group: T, grafanaVersion: string): SelectorsOf<T> {\n const result: Selectors = {};\n\n for (const [key, value] of Object.entries(group)) {\n if (isVersionedSelectorGroup(value)) {\n result[key] = resolveSelectorGroup(value, grafanaVersion);\n } else {\n assertIsSemverValid(value, key);\n result[key] = resolveSelector(value, grafanaVersion);\n }\n }\n\n return result as SelectorsOf<T>;\n}\n\nfunction isVersionedSelectorGroup(\n target: VersionedSelectors | VersionedSelectorGroup\n): target is VersionedSelectorGroup {\n if (typeof target === 'object') {\n const [first] = Object.keys(target);\n return !valid(first);\n }\n\n return false;\n}\n\nfunction resolveSelector(\n versionedSelector: VersionedSelectors,\n grafanaVersion: string\n): StringSelector | FunctionSelector | FunctionSelectorTwoArgs | CssSelector | UrlSelector {\n let versionToUse;\n let versions = Object.keys(versionedSelector).sort(compare);\n\n if (grafanaVersion === 'latest') {\n return versionedSelector[versions[versions.length - 1]];\n }\n\n for (const version of versions) {\n if (gte(grafanaVersion, version)) {\n versionToUse = version;\n }\n }\n\n if (!versionToUse) {\n versionToUse = versions[versions.length - 1];\n }\n\n return versionedSelector[versionToUse];\n}\n\nfunction assertIsSemverValid(versionedSelector: VersionedSelectors, selectorName: string) {\n if (!Object.keys(versionedSelector).every((version) => valid(version))) {\n throw new Error(`Invalid semver version: '${selectorName}'`);\n }\n}\n","export const MIN_GRAFANA_VERSION = '8.5.0';\n","// NOTE: by default Component string selectors are set up to be aria-labels,\n// however there are many cases where your component may not need an aria-label\n// (a <button> with clear text, for example, does not need an aria-label as it's already labeled)\n// but you still might need to select it for testing,\n// in that case please add the attribute data-testid={selector} in the component and\n// prefix your selector string with 'data-testid' so that when create the selectors we know to search for it on the right attribute\n\nimport { VersionedSelectorGroup } from '../types';\n\nimport { MIN_GRAFANA_VERSION } from './constants';\n\n/**\n * Selectors grouped/defined in Components\n */\nexport const versionedComponents = {\n RadioButton: {\n container: {\n '10.2.3': 'data-testid radio-button',\n },\n },\n Breadcrumbs: {\n breadcrumb: {\n '9.4.0': (title: string) => `data-testid ${title} breadcrumb`,\n },\n },\n TimePicker: {\n openButton: {\n [MIN_GRAFANA_VERSION]: 'data-testid TimePicker Open Button',\n },\n overlayContent: {\n '10.2.3': 'data-testid TimePicker Overlay Content',\n },\n fromField: {\n '10.2.3': 'data-testid Time Range from field',\n [MIN_GRAFANA_VERSION]: 'Time Range from field',\n },\n toField: {\n '10.2.3': 'data-testid Time Range to field',\n [MIN_GRAFANA_VERSION]: 'Time Range to field',\n },\n applyTimeRange: {\n [MIN_GRAFANA_VERSION]: 'data-testid TimePicker submit button',\n },\n copyTimeRange: {\n '10.4.0': 'data-testid TimePicker copy button',\n },\n pasteTimeRange: {\n '10.4.0': 'data-testid TimePicker paste button',\n },\n calendar: {\n label: {\n '10.2.3': 'data-testid Time Range calendar',\n [MIN_GRAFANA_VERSION]: 'Time Range calendar',\n },\n openButton: {\n '10.2.3': 'data-testid Open time range calendar',\n [MIN_GRAFANA_VERSION]: 'Open time range calendar',\n },\n closeButton: {\n '10.2.3': 'data-testid Close time range Calendar',\n [MIN_GRAFANA_VERSION]: 'Close time range Calendar',\n },\n },\n absoluteTimeRangeTitle: {\n [MIN_GRAFANA_VERSION]: 'data-testid-absolute-time-range-narrow',\n },\n },\n DataSourcePermissions: {\n form: { '9.5.0': () => 'form[name=\"addPermission\"]' },\n roleType: {\n '9.5.0': 'Role to add new permission to',\n },\n rolePicker: {\n '9.5.0': 'Built-in role picker',\n },\n permissionLevel: {\n '9.5.0': 'Permission Level',\n },\n },\n DateTimePicker: {\n input: {\n '10.2.3': 'data-testid date-time-input',\n },\n },\n DataSource: {\n TestData: {\n QueryTab: {\n scenarioSelectContainer: {\n [MIN_GRAFANA_VERSION]: 'Test Data Query scenario select container',\n },\n scenarioSelect: {\n [MIN_GRAFANA_VERSION]: 'Test Data Query scenario select',\n },\n max: {\n [MIN_GRAFANA_VERSION]: 'TestData max',\n },\n min: {\n [MIN_GRAFANA_VERSION]: 'TestData min',\n },\n noise: {\n [MIN_GRAFANA_VERSION]: 'TestData noise',\n },\n seriesCount: {\n [MIN_GRAFANA_VERSION]: 'TestData series count',\n },\n spread: {\n [MIN_GRAFANA_VERSION]: 'TestData spread',\n },\n startValue: {\n [MIN_GRAFANA_VERSION]: 'TestData start value',\n },\n drop: {\n [MIN_GRAFANA_VERSION]: 'TestData drop values',\n },\n },\n },\n DataSourceHttpSettings: {\n urlInput: {\n '10.4.0': 'data-testid Datasource HTTP settings url',\n [MIN_GRAFANA_VERSION]: 'Datasource HTTP settings url',\n },\n },\n Jaeger: {\n traceIDInput: {\n [MIN_GRAFANA_VERSION]: 'Trace ID',\n },\n },\n Prometheus: {\n configPage: {\n connectionSettings: {\n [MIN_GRAFANA_VERSION]: 'Data source connection URL', // aria-label in grafana experimental\n },\n manageAlerts: {\n '10.4.0': 'prometheus-alerts-manager', // id for switch component\n },\n scrapeInterval: {\n '10.4.0': 'data-testid scrape interval',\n },\n queryTimeout: {\n '10.4.0': 'data-testid query timeout',\n },\n defaultEditor: {\n '10.4.0': 'data-testid default editor',\n },\n disableMetricLookup: {\n '10.4.0': 'disable-metric-lookup', // id for switch component\n },\n prometheusType: {\n '10.4.0': 'data-testid prometheus type',\n },\n prometheusVersion: {\n '10.4.0': 'data-testid prometheus version',\n },\n cacheLevel: {\n '10.4.0': 'data-testid cache level',\n },\n incrementalQuerying: {\n '10.4.0': 'prometheus-incremental-querying', // id for switch component\n },\n queryOverlapWindow: {\n '10.4.0': 'data-testid query overlap window',\n },\n disableRecordingRules: {\n '10.4.0': 'disable-recording-rules', // id for switch component\n },\n customQueryParameters: {\n '10.4.0': 'data-testid custom query parameters',\n },\n httpMethod: {\n '10.4.0': 'data-testid http method',\n },\n exemplarsAddButton: {\n '10.3.0': 'data-testid Add exemplar config button',\n [MIN_GRAFANA_VERSION]: 'Add exemplar config button',\n },\n internalLinkSwitch: {\n '10.3.0': 'data-testid Internal link switch',\n [MIN_GRAFANA_VERSION]: 'Internal link switch',\n },\n codeModeMetricNamesSuggestionLimit: {\n '11.1.0': 'data-testid code mode metric names suggestion limit',\n },\n },\n queryEditor: {\n explain: {\n '10.4.0': 'data-testid prometheus explain switch wrapper',\n },\n editorToggle: {\n '10.4.0': 'data-testid QueryEditorModeToggle', // wrapper for toggle\n },\n options: {\n '10.4.0': 'data-testid prometheus options', // wrapper for options group\n },\n legend: {\n '10.4.0': 'data-testid prometheus legend wrapper', // wrapper for multiple compomnents\n },\n format: {\n '10.4.0': 'data-testid prometheus format',\n },\n step: {\n '10.4.0': 'prometheus-step', // id for autosize component\n },\n type: {\n '10.4.0': 'data-testid prometheus type', //wrapper for radio button group\n },\n exemplars: {\n '10.4.0': 'prometheus-exemplars', // id for editor switch component\n },\n builder: {\n // see QueryBuilder below for commented selectors\n metricSelect: {\n '10.4.0': 'data-testid metric select',\n },\n hints: {\n '10.4.0': 'data-testid prometheus hints', // wrapper for hints component\n },\n metricsExplorer: {\n '10.4.0': 'data-testid metrics explorer',\n },\n queryAdvisor: {\n '10.4.0': 'data-testid query advisor',\n },\n },\n code: {\n queryField: {\n '10.4.0': 'data-testid prometheus query field',\n },\n metricsCountInfo: {\n '11.1.0': 'data-testid metrics count disclaimer',\n },\n metricsBrowser: {\n openButton: {\n '10.4.0': 'data-testid open metrics browser',\n },\n selectMetric: {\n '10.4.0': 'data-testid select a metric',\n },\n seriesLimit: {\n '10.3.1': 'data-testid series limit',\n },\n metricList: {\n '10.4.0': 'data-testid metric list',\n },\n labelNamesFilter: {\n '10.4.0': 'data-testid label names filter',\n },\n labelValuesFilter: {\n '10.4.0': 'data-testid label values filter',\n },\n useQuery: {\n '10.4.0': 'data-testid use query',\n },\n useAsRateQuery: {\n '10.4.0': 'data-testid use as rate query',\n },\n validateSelector: {\n '10.4.0': 'data-testid validate selector',\n },\n clear: {\n '10.4.0': 'data-testid clear',\n },\n },\n },\n },\n exemplarMarker: {\n '10.3.0': 'data-testid Exemplar marker',\n [MIN_GRAFANA_VERSION]: 'Exemplar marker',\n },\n variableQueryEditor: {\n queryType: {\n '10.4.0': 'data-testid query type',\n },\n labelnames: {\n metricRegex: {\n '10.4.0': 'data-testid label names metric regex',\n },\n },\n labelValues: {\n labelSelect: {\n '10.4.0': 'data-testid label values label select',\n },\n },\n metricNames: {\n metricRegex: {\n '10.4.0': 'data-testid metric names metric regex',\n },\n },\n varQueryResult: {\n '10.4.0': 'data-testid variable query result',\n },\n seriesQuery: {\n '10.4.0': 'data-testid prometheus series query',\n },\n classicQuery: {\n '10.4.0': 'data-testid prometheus classic query',\n },\n },\n annotations: {\n minStep: {\n '10.4.0': 'prometheus-annotation-min-step', // id for autosize input\n },\n title: {\n '10.4.0': 'data-testid prometheus annotation title',\n },\n tags: {\n '10.4.0': 'data-testid prometheus annotation tags',\n },\n text: {\n '10.4.0': 'data-testid prometheus annotation text',\n },\n seriesValueAsTimestamp: {\n '10.4.0': 'data-testid prometheus annotation series value as timestamp',\n },\n },\n },\n },\n Menu: {\n MenuComponent: {\n [MIN_GRAFANA_VERSION]: (title: string) => `${title} menu`,\n },\n MenuGroup: {\n [MIN_GRAFANA_VERSION]: (title: string) => `${title} menu group`,\n },\n MenuItem: {\n [MIN_GRAFANA_VERSION]: (title: string) => `${title} menu item`,\n },\n SubMenu: {\n container: {\n '10.3.0': 'data-testid SubMenu container',\n [MIN_GRAFANA_VERSION]: 'SubMenu container',\n },\n icon: {\n '10.3.0': 'data-testid SubMenu icon',\n [MIN_GRAFANA_VERSION]: 'SubMenu icon',\n },\n },\n },\n Panels: {\n Panel: {\n title: {\n [MIN_GRAFANA_VERSION]: (title: string) => `data-testid Panel header ${title}`,\n },\n content: {\n '11.1.0': 'data-testid panel content',\n },\n headerItems: {\n '10.2.0': (item: string) => `data-testid Panel header item ${item}`,\n },\n menuItems: {\n '9.5.0': (item: string) => `data-testid Panel menu item ${item}`,\n },\n menu: {\n '9.5.0': (title: string) => `data-testid Panel menu ${title}`,\n },\n containerByTitle: {\n [MIN_GRAFANA_VERSION]: (title: string) => `${title} panel`,\n },\n headerCornerInfo: {\n [MIN_GRAFANA_VERSION]: (mode: string) => `Panel header ${mode}`,\n },\n status: {\n '10.2.0': (status: string) => `data-testid Panel status ${status}`,\n [MIN_GRAFANA_VERSION]: (_: string) => 'Panel status',\n },\n loadingBar: {\n '10.0.0': () => `Panel loading bar`,\n },\n HoverWidget: {\n container: {\n '10.1.0': 'data-testid hover-header-container',\n [MIN_GRAFANA_VERSION]: 'hover-header-container',\n },\n dragIcon: {\n '10.0.0': 'data-testid drag-icon',\n },\n },\n PanelDataErrorMessage: {\n '10.4.0': 'data-testid Panel data error message',\n },\n },\n Visualization: {\n Graph: {\n container: {\n '9.5.0': 'Graph container',\n },\n VisualizationTab: {\n legendSection: {\n [MIN_GRAFANA_VERSION]: 'Legend section',\n },\n },\n Legend: {\n legendItemAlias: {\n [MIN_GRAFANA_VERSION]: (name: string) => `gpl alias ${name}`,\n },\n showLegendSwitch: {\n [MIN_GRAFANA_VERSION]: 'gpl show legend',\n },\n },\n xAxis: {\n labels: {\n [MIN_GRAFANA_VERSION]: () => 'div.flot-x-axis > div.flot-tick-label',\n },\n },\n },\n BarGauge: {\n valueV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Bar gauge value',\n },\n },\n PieChart: {\n svgSlice: {\n '10.3.0': 'data testid Pie Chart Slice',\n },\n },\n Text: {\n container: { [MIN_GRAFANA_VERSION]: () => '.markdown-html' },\n },\n Table: {\n header: {\n [MIN_GRAFANA_VERSION]: 'table header',\n },\n footer: {\n [MIN_GRAFANA_VERSION]: 'table-footer',\n },\n body: {\n '10.2.0': 'data-testid table body',\n },\n },\n },\n },\n VizLegend: {\n seriesName: {\n '10.3.0': (name: string) => `data-testid VizLegend series ${name}`,\n },\n },\n Drawer: {\n General: {\n title: {\n [MIN_GRAFANA_VERSION]: (title: string) => `Drawer title ${title}`,\n },\n expand: {\n [MIN_GRAFANA_VERSION]: 'Drawer expand',\n },\n contract: {\n [MIN_GRAFANA_VERSION]: 'Drawer contract',\n },\n close: {\n '10.3.0': 'data-testid Drawer close',\n [MIN_GRAFANA_VERSION]: 'Drawer close',\n },\n rcContentWrapper: { '9.4.0': () => '.rc-drawer-content-wrapper' },\n subtitle: {\n '10.4.0': 'data-testid drawer subtitle',\n },\n },\n DashboardSaveDrawer: {\n saveButton: {\n '11.1.0': 'data-testid Save dashboard drawer button',\n },\n saveAsButton: {\n '11.1.0': 'data-testid Save as dashboard drawer button',\n },\n saveAsTitleInput: {\n '11.1.0': 'Save dashboard title field',\n },\n },\n },\n PanelEditor: {\n General: {\n content: {\n '11.1.0': 'data-testid Panel editor content',\n '8.0.0': 'Panel editor content',\n },\n },\n OptionsPane: {\n content: {\n '11.1.0': 'data-testid Panel editor option pane content',\n [MIN_GRAFANA_VERSION]: 'Panel editor option pane content',\n },\n select: {\n [MIN_GRAFANA_VERSION]: 'Panel editor option pane select',\n },\n fieldLabel: {\n [MIN_GRAFANA_VERSION]: (type: string) => `${type} field property editor`,\n },\n fieldInput: {\n '11.0.0': (title: string) => `data-testid Panel editor option pane field input ${title}`,\n },\n },\n DataPane: {\n content: {\n '11.1.0': 'data-testid Panel editor data pane content',\n [MIN_GRAFANA_VERSION]: 'Panel editor data pane content',\n },\n },\n applyButton: {\n '9.2.0': 'data-testid Apply changes and go back to dashboard',\n '9.1.0': 'Apply changes and go back to dashboard',\n '8.0.0': 'panel editor apply',\n },\n toggleVizPicker: {\n '10.0.0': 'data-testid toggle-viz-picker',\n '8.0.0': 'toggle-viz-picker',\n },\n toggleVizOptions: {\n '10.1.0': 'data-testid toggle-viz-options',\n [MIN_GRAFANA_VERSION]: 'toggle-viz-options',\n },\n toggleTableView: {\n '11.1.0': 'data-testid toggle-table-view',\n [MIN_GRAFANA_VERSION]: 'toggle-table-view',\n },\n\n // [Geomap] Map controls\n showZoomField: {\n '10.2.0': 'Map controls Show zoom control field property editor',\n },\n showAttributionField: {\n '10.2.0': 'Map controls Show attribution field property editor',\n },\n showScaleField: {\n '10.2.0': 'Map controls Show scale field property editor',\n },\n showMeasureField: {\n '10.2.0': 'Map controls Show measure tools field property editor',\n },\n showDebugField: {\n '10.2.0': 'Map controls Show debug field property editor',\n },\n\n measureButton: {\n '9.2.0': 'show measure tools',\n },\n },\n PanelInspector: {\n Data: {\n content: {\n [MIN_GRAFANA_VERSION]: 'Panel inspector Data content',\n },\n },\n Stats: {\n content: {\n [MIN_GRAFANA_VERSION]: 'Panel inspector Stats content',\n },\n },\n Json: {\n content: {\n '11.1.0': 'data-testid Panel inspector Json content',\n [MIN_GRAFANA_VERSION]: 'Panel inspector Json content',\n },\n },\n Query: {\n content: {\n [MIN_GRAFANA_VERSION]: 'Panel inspector Query content',\n },\n refreshButton: {\n [MIN_GRAFANA_VERSION]: 'Panel inspector Query refresh button',\n },\n jsonObjectKeys: {\n [MIN_GRAFANA_VERSION]: () => '.json-formatter-key',\n },\n },\n },\n Tab: {\n title: {\n '11.2.0': (title: string) => `data-testid Tab ${title}`,\n },\n active: { [MIN_GRAFANA_VERSION]: () => '[class*=\"-activeTabStyle\"]' },\n },\n RefreshPicker: {\n runButtonV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid RefreshPicker run button',\n },\n intervalButtonV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid RefreshPicker interval button',\n },\n },\n QueryTab: {\n content: {\n [MIN_GRAFANA_VERSION]: 'Query editor tab content',\n },\n queryInspectorButton: {\n [MIN_GRAFANA_VERSION]: 'Query inspector button',\n },\n queryHistoryButton: {\n '10.2.0': 'data-testid query-history-button',\n [MIN_GRAFANA_VERSION]: 'query-history-button',\n },\n addQuery: {\n '10.2.0': 'data-testid query-tab-add-query',\n [MIN_GRAFANA_VERSION]: 'Query editor add query button',\n },\n queryGroupTopSection: {\n '11.2.0': 'data-testid query group top section',\n },\n addExpression: {\n '11.2.0': 'data-testid query-tab-add-expression',\n },\n },\n QueryHistory: {\n queryText: {\n '9.0.0': 'Query text',\n },\n },\n QueryEditorRows: {\n rows: {\n [MIN_GRAFANA_VERSION]: 'Query editor row',\n },\n },\n QueryEditorRow: {\n actionButton: {\n '10.4.0': (title: string) => `data-testid ${title}`,\n },\n title: {\n [MIN_GRAFANA_VERSION]: (refId: string) => `Query editor row title ${refId}`,\n },\n container: {\n [MIN_GRAFANA_VERSION]: (refId: string) => `Query editor row ${refId}`,\n },\n },\n AlertTab: {\n content: {\n '10.2.3': 'data-testid Alert editor tab content',\n [MIN_GRAFANA_VERSION]: 'Alert editor tab content',\n },\n },\n AlertRules: {\n groupToggle: {\n '11.0.0': 'data-testid group-collapse-toggle',\n },\n toggle: {\n '11.0.0': 'data-testid collapse-toggle',\n },\n expandedContent: {\n '11.0.0': 'data-testid expanded-content',\n },\n previewButton: {\n '11.1.0': 'data-testid alert-rule preview-button',\n },\n ruleNameField: {\n '11.1.0': 'data-testid alert-rule name-field',\n },\n newFolderButton: {\n '11.1.0': 'data-testid alert-rule new-folder-button',\n },\n newFolderNameField: {\n '11.1.0': 'data-testid alert-rule name-folder-name-field',\n },\n newFolderNameCreateButton: {\n '11.1.0': 'data-testid alert-rule name-folder-name-create-button',\n },\n newEvaluationGroupButton: {\n '11.1.0': 'data-testid alert-rule new-evaluation-group-button',\n },\n newEvaluationGroupName: {\n '11.1.0': 'data-testid alert-rule new-evaluation-group-name',\n },\n newEvaluationGroupInterval: {\n '11.1.0': 'data-testid alert-rule new-evaluation-group-interval',\n },\n newEvaluationGroupCreate: {\n '11.1.0': 'data-testid alert-rule new-evaluation-group-create-button',\n },\n step: {\n '11.5.0': (stepNo: string) => `data-testid alert-rule step-${stepNo}`,\n },\n stepAdvancedModeSwitch: {\n '11.5.0': (stepNo: string) => `data-testid advanced-mode-switch step-${stepNo}`,\n },\n },\n Alert: {\n alertV2: {\n [MIN_GRAFANA_VERSION]: (severity: string) => `data-testid Alert ${severity}`,\n },\n },\n TransformTab: {\n content: {\n '10.1.0': 'data-testid Transform editor tab content',\n [MIN_GRAFANA_VERSION]: 'Transform editor tab content',\n },\n newTransform: {\n '10.1.0': (name: string) => `data-testid New transform ${name}`,\n },\n transformationEditor: {\n '10.1.0': (name: string) => `data-testid Transformation editor ${name}`,\n },\n transformationEditorDebugger: {\n '10.1.0': (name: string) => `data-testid Transformation editor debugger ${name}`,\n },\n },\n Transforms: {\n card: {\n '10.1.0': (name: string) => `data-testid New transform ${name}`,\n },\n disableTransformationButton: {\n '10.4.0': 'data-testid Disable transformation button',\n },\n Reduce: {\n modeLabel: {\n '10.2.3': 'data-testid Transform mode label',\n [MIN_GRAFANA_VERSION]: 'Transform mode label',\n },\n calculationsLabel: {\n '10.2.3': 'data-testid Transform calculations label',\n [MIN_GRAFANA_VERSION]: 'Transform calculations label',\n },\n },\n SpatialOperations: {\n actionLabel: {\n '9.1.2': 'root Action field property editor',\n },\n locationLabel: {\n '10.2.0': 'root Location Mode field property editor',\n },\n location: {\n autoOption: {\n '9.1.2': 'Auto location option',\n },\n coords: {\n option: {\n '9.1.2': 'Coords location option',\n },\n latitudeFieldLabel: {\n '9.1.2': 'root Latitude field field property editor',\n },\n longitudeFieldLabel: {\n '9.1.2': 'root Longitude field field property editor',\n },\n },\n geohash: {\n option: {\n '9.1.2': 'Geohash location option',\n },\n geohashFieldLabel: {\n '9.1.2': 'root Geohash field field property editor',\n },\n },\n lookup: {\n option: {\n '9.1.2': 'Lookup location option',\n },\n lookupFieldLabel: {\n '9.1.2': 'root Lookup field field property editor',\n },\n gazetteerFieldLabel: {\n '9.1.2': 'root Gazetteer field property editor',\n },\n },\n },\n },\n searchInput: {\n '10.2.3': 'data-testid search transformations',\n [MIN_GRAFANA_VERSION]: 'search transformations',\n },\n noTransformationsMessage: {\n '10.2.3': 'data-testid no transformations message',\n },\n addTransformationButton: {\n '10.1.0': 'data-testid add transformation button',\n [MIN_GRAFANA_VERSION]: 'add transformation button',\n },\n removeAllTransformationsButton: {\n '10.4.0': 'data-testid remove all transformations button',\n },\n },\n NavBar: {\n Configuration: {\n button: {\n '9.5.0': 'Configuration',\n },\n },\n Toggle: {\n button: {\n '10.2.3': 'data-testid Toggle menu',\n [MIN_GRAFANA_VERSION]: 'Toggle menu',\n },\n },\n Reporting: {\n button: {\n '9.5.0': 'Reporting',\n },\n },\n },\n NavMenu: {\n Menu: {\n '10.2.3': 'data-testid navigation mega-menu',\n },\n item: {\n '9.5.0': 'data-testid Nav menu item',\n },\n },\n NavToolbar: {\n container: {\n '9.4.0': 'data-testid Nav toolbar',\n },\n commandPaletteTrigger: {\n '11.5.0': 'data-testid Command palette trigger',\n },\n shareDashboard: {\n '11.1.0': 'data-testid Share dashboard',\n },\n markAsFavorite: {\n '11.1.0': 'data-testid Mark as favorite',\n },\n editDashboard: {\n editButton: {\n '11.1.0': 'data-testid Edit dashboard button',\n },\n saveButton: {\n '11.1.0': 'data-testid Save dashboard button',\n },\n exitButton: {\n '11.1.0': 'data-testid Exit edit mode button',\n },\n settingsButton: {\n '11.1.0': 'data-testid Dashboard settings',\n },\n addRowButton: {\n '11.1.0': 'data-testid Add row button',\n },\n addLibraryPanelButton: {\n '11.1.0': 'data-testid Add a panel from the panel library button',\n },\n addVisualizationButton: {\n '11.1.0': 'data-testid Add new visualization menu item',\n },\n pastePanelButton: {\n '11.1.0': 'data-testid Paste panel button',\n },\n discardChangesButton: {\n '11.1.0': 'data-testid Discard changes button',\n },\n discardLibraryPanelButton: {\n '11.1.0': 'data-testid Discard library panel button',\n },\n unlinkLibraryPanelButton: {\n '11.1.0': 'data-testid Unlink library panel button',\n },\n saveLibraryPanelButton: {\n '11.1.0': 'data-testid Save library panel button',\n },\n backToDashboardButton: {\n '11.1.0': 'data-testid Back to dashboard button',\n },\n },\n },\n\n PageToolbar: {\n container: { [MIN_GRAFANA_VERSION]: () => '.page-toolbar' },\n item: {\n [MIN_GRAFANA_VERSION]: (tooltip: string) => `${tooltip}`,\n },\n itemButton: {\n '9.5.0': (title: string) => `data-testid ${title}`,\n },\n },\n QueryEditorToolbarItem: {\n button: {\n [MIN_GRAFANA_VERSION]: (title: string) => `QueryEditor toolbar item button ${title}`,\n },\n },\n BackButton: {\n backArrow: {\n '10.3.0': 'data-testid Go Back',\n [MIN_GRAFANA_VERSION]: 'Go Back',\n },\n },\n OptionsGroup: {\n group: {\n '11.1.0': (title?: string) => (title ? `data-testid Options group ${title}` : 'data-testid Options group'),\n [MIN_GRAFANA_VERSION]: (title?: string) => (title ? `Options group ${title}` : 'Options group'),\n },\n toggle: {\n '11.1.0': (title?: string) =>\n title ? `data-testid Options group ${title} toggle` : 'data-testid Options group toggle',\n [MIN_GRAFANA_VERSION]: (title?: string) => (title ? `Options group ${title} toggle` : 'Options group toggle'),\n },\n },\n PluginVisualization: {\n item: {\n [MIN_GRAFANA_VERSION]: (title: string) => `Plugin visualization item ${title}`,\n },\n current: {\n [MIN_GRAFANA_VERSION]: () => '[class*=\"-currentVisualizationItem\"]',\n },\n },\n Select: {\n menu: {\n '11.5.0': 'data-testid Select menu',\n [MIN_GRAFANA_VERSION]: 'Select options menu',\n },\n option: {\n '11.1.0': 'data-testid Select option',\n [MIN_GRAFANA_VERSION]: 'Select option',\n },\n toggleAllOptions: {\n '11.3.0': 'data-testid toggle all options',\n },\n input: {\n [MIN_GRAFANA_VERSION]: () => 'input[id*=\"time-options-input\"]',\n },\n singleValue: {\n [MIN_GRAFANA_VERSION]: () => 'div[class*=\"-singleValue\"]',\n },\n },\n FieldConfigEditor: {\n content: {\n [MIN_GRAFANA_VERSION]: 'Field config editor content',\n },\n },\n OverridesConfigEditor: {\n content: {\n [MIN_GRAFANA_VERSION]: 'Field overrides editor content',\n },\n },\n FolderPicker: {\n containerV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Folder picker select container',\n },\n input: {\n '10.4.0': 'data-testid folder-picker-input',\n },\n },\n ReadonlyFolderPicker: {\n container: {\n [MIN_GRAFANA_VERSION]: 'data-testid Readonly folder picker select container',\n },\n },\n DataSourcePicker: {\n container: {\n '10.0.0': 'data-testid Data source picker select container',\n '8.0.0': 'Data source picker select container',\n },\n inputV2: {\n '10.1.0': 'data-testid Select a data source',\n [MIN_GRAFANA_VERSION]: 'Select a data source',\n },\n dataSourceList: {\n '10.4.0': 'data-testid Data source list dropdown',\n },\n advancedModal: {\n dataSourceList: {\n '10.4.0': 'data-testid Data source list',\n },\n builtInDataSourceList: {\n '10.4.0': 'data-testid Built in data source list',\n },\n },\n },\n TimeZonePicker: {\n containerV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Time zone picker select container',\n },\n changeTimeSettingsButton: {\n '11.0.0': 'data-testid Time zone picker Change time settings button',\n },\n },\n WeekStartPicker: {\n containerV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Choose starting day of the week',\n },\n placeholder: {\n [MIN_GRAFANA_VERSION]: 'Choose starting day of the week',\n },\n },\n TraceViewer: {\n spanBar: {\n '9.0.0': 'data-testid SpanBar--wrapper',\n },\n },\n QueryField: {\n container: {\n '10.3.0': 'data-testid Query field',\n [MIN_GRAFANA_VERSION]: 'Query field',\n },\n },\n QueryBuilder: {\n queryPatterns: {\n '10.3.0': 'data-testid Query patterns',\n [MIN_GRAFANA_VERSION]: 'Query patterns',\n },\n labelSelect: {\n '10.3.0': 'data-testid Select label',\n [MIN_GRAFANA_VERSION]: 'Select label',\n },\n inputSelect: {\n '11.1.0': 'data-testid Select label-input',\n },\n valueSelect: {\n '10.3.0': 'data-testid Select value',\n [MIN_GRAFANA_VERSION]: 'Select value',\n },\n matchOperatorSelect: {\n '10.3.0': 'data-testid Select match operator',\n [MIN_GRAFANA_VERSION]: 'Select match operator',\n },\n },\n ValuePicker: {\n button: {\n '10.3.0': (name: string) => `data-testid Value picker button ${name}`,\n },\n select: {\n '10.3.0': (name: string) => `data-testid Value picker select ${name}`,\n },\n },\n Search: {\n sectionV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Search section',\n },\n itemsV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Search items',\n },\n cards: {\n [MIN_GRAFANA_VERSION]: 'data-testid Search cards',\n },\n collapseFolder: {\n [MIN_GRAFANA_VERSION]: (sectionId: string) => `data-testid Collapse folder ${sectionId}`,\n },\n expandFolder: {\n [MIN_GRAFANA_VERSION]: (sectionId: string) => `data-testid Expand folder ${sectionId}`,\n },\n dashboardItem: {\n [MIN_GRAFANA_VERSION]: (item: string) => `data-testid Dashboard search item ${item}`,\n },\n dashboardCard: {\n [MIN_GRAFANA_VERSION]: (item: string) => `data-testid Search card ${item}`,\n },\n folderHeader: {\n '9.3.0': (folderName: string) => `data-testid Folder header ${folderName}`,\n },\n folderContent: {\n '9.3.0': (folderName: string) => `data-testid Folder content ${folderName}`,\n },\n dashboardItems: {\n [MIN_GRAFANA_VERSION]: 'data-testid Dashboard search item',\n },\n },\n DashboardLinks: {\n container: {\n [MIN_GRAFANA_VERSION]: 'data-testid Dashboard link container',\n },\n dropDown: {\n [MIN_GRAFANA_VERSION]: 'data-testid Dashboard link dropdown',\n },\n link: {\n [MIN_GRAFANA_VERSION]: 'data-testid Dashboard link',\n },\n },\n LoadingIndicator: {\n icon: {\n '10.4.0': 'data-testid Loading indicator',\n [MIN_GRAFANA_VERSION]: 'Loading indicator',\n },\n },\n CallToActionCard: {\n buttonV2: {\n [MIN_GRAFANA_VERSION]: (name: string) => `data-testid Call to action button ${name}`,\n },\n },\n DataLinksContextMenu: {\n singleLink: {\n '10.3.0': 'data-testid Data link',\n [MIN_GRAFANA_VERSION]: 'Data link',\n },\n },\n CodeEditor: {\n container: {\n '10.2.3': 'data-testid Code editor container',\n [MIN_GRAFANA_VERSION]: 'Code editor container',\n },\n },\n ReactMonacoEditor: {\n editorLazy: {\n '11.1.0': 'data-testid ReactMonacoEditor editorLazy',\n },\n },\n DashboardImportPage: {\n textarea: {\n [MIN_GRAFANA_VERSION]: 'data-testid-import-dashboard-textarea',\n },\n submit: {\n [MIN_GRAFANA_VERSION]: 'data-testid-load-dashboard',\n },\n },\n ImportDashboardForm: {\n name: {\n [MIN_GRAFANA_VERSION]: 'data-testid-import-dashboard-title',\n },\n submit: {\n [MIN_GRAFANA_VERSION]: 'data-testid-import-dashboard-submit',\n },\n },\n PanelAlertTabContent: {\n content: {\n '10.2.3': 'data-testid Unified alert editor tab content',\n [MIN_GRAFANA_VERSION]: 'Unified alert editor tab content',\n },\n },\n VisualizationPreview: {\n card: {\n [MIN_GRAFANA_VERSION]: (name: string) => `data-testid suggestion-${name}`,\n },\n },\n ColorSwatch: {\n name: {\n [MIN_GRAFANA_VERSION]: 'data-testid-colorswatch',\n },\n },\n DashboardRow: {\n title: {\n [MIN_GRAFANA_VERSION]: (title: string) => `data-testid dashboard-row-title-${title}`,\n },\n },\n UserProfile: {\n profileSaveButton: {\n [MIN_GRAFANA_VERSION]: 'data-testid-user-profile-save',\n },\n preferencesSaveButton: {\n [MIN_GRAFANA_VERSION]: 'data-testid-shared-prefs-save',\n },\n orgsTable: {\n [MIN_GRAFANA_VERSION]: 'data-testid-user-orgs-table',\n },\n sessionsTable: {\n [MIN_GRAFANA_VERSION]: 'data-testid-user-sessions-table',\n },\n extensionPointTabs: {\n '10.2.3': 'data-testid-extension-point-tabs',\n },\n extensionPointTab: {\n '10.2.3': (tabId: string) => `data-testid-extension-point-tab-${tabId}`,\n },\n },\n FileUpload: {\n inputField: {\n '9.0.0': 'data-testid-file-upload-input-field',\n },\n fileNameSpan: {\n '9.0.0': 'data-testid-file-upload-file-name',\n },\n },\n DebugOverlay: {\n wrapper: {\n '9.2.0': 'debug-overlay',\n },\n },\n OrgRolePicker: {\n input: {\n '9.5.0': 'Role',\n },\n },\n AnalyticsToolbarButton: {\n button: {\n '9.5.0': 'Dashboard insights',\n },\n },\n Variables: {\n variableOption: {\n '9.5.0': 'data-testid variable-option',\n },\n variableLinkWrapper: {\n '11.1.1': 'data-testid variable-link-wrapper',\n },\n },\n Annotations: {\n annotationsTypeInput: {\n '11.1.0': 'data-testid annotations-type-input',\n [MIN_GRAFANA_VERSION]: 'annotations-type-input',\n },\n annotationsChoosePanelInput: {\n '11.1.0': 'data-testid choose-panels-input',\n [MIN_GRAFANA_VERSION]: 'choose-panels-input',\n },\n editor: {\n testButton: {\n '11.0.0': 'data-testid annotations-test-button',\n },\n resultContainer: {\n '11.0.0': 'data-testid annotations-query-result-container',\n },\n },\n },\n Tooltip: {\n container: {\n '10.2.0': 'data-testid tooltip',\n },\n },\n ReturnToPrevious: {\n buttonGroup: {\n '11.0.0': 'data-testid dismissable button group',\n },\n backButton: {\n '11.0.0': 'data-testid back',\n },\n dismissButton: {\n '11.0.0': 'data-testid dismiss',\n },\n },\n SQLQueryEditor: {\n selectColumn: {\n '11.0.0': 'data-testid select-column',\n },\n selectColumnInput: { '11.0.0': 'data-testid select-column-input' },\n selectFunctionParameter: { '11.0.0': (name: string) => `data-testid select-function-parameter-${name}` },\n selectAggregation: {\n '11.0.0': 'data-testid select-aggregation',\n },\n selectAggregationInput: { '11.0.0': 'data-testid select-aggregation-input' },\n selectAlias: {\n '11.0.0': 'data-testid select-alias',\n },\n selectAliasInput: { '11.0.0': 'data-testid select-alias-input' },\n selectInputParameter: { '11.0.0': 'data-testid select-input-parameter' },\n filterConjunction: {\n '11.0.0': 'data-testid filter-conjunction',\n },\n filterField: {\n '11.0.0': 'data-testid filter-field',\n },\n filterOperator: {\n '11.0.0': 'data-testid filter-operator',\n },\n headerTableSelector: {\n '11.0.0': 'data-testid header-table-selector',\n },\n headerFilterSwitch: {\n '11.0.0': 'data-testid header-filter-switch',\n },\n headerGroupSwitch: {\n '11.0.0': 'data-testid header-group-switch',\n },\n headerOrderSwitch: {\n '11.0.0': 'data-testid header-order-switch',\n },\n headerPreviewSwitch: {\n '11.0.0': 'data-testid header-preview-switch',\n },\n },\n EntityNotFound: {\n container: {\n '11.2.0': 'data-testid entity-not-found',\n },\n },\n Portal: {\n container: {\n '11.5.0': 'data-testid portal-container',\n },\n },\n} satisfies VersionedSelectorGroup;\n\nexport type VersionedComponents = typeof versionedComponents;\n","import { VersionedSelectorGroup } from '../types';\n\nimport { MIN_GRAFANA_VERSION } from './constants';\n\n/**\n * Selectors grouped/defined in Pages\n */\nexport const versionedPages = {\n Alerting: {\n AddAlertRule: {\n url: {\n '10.1.0': '/alerting/new/alerting',\n [MIN_GRAFANA_VERSION]: '/alerting/new',\n },\n },\n EditAlertRule: {\n url: {\n [MIN_GRAFANA_VERSION]: (alertRuleUid: string) => `alerting/${alertRuleUid}/edit`,\n },\n },\n },\n Login: {\n url: {\n [MIN_GRAFANA_VERSION]: '/login',\n },\n username: {\n '10.2.3': 'data-testid Username input field',\n [MIN_GRAFANA_VERSION]: 'Username input field',\n },\n password: {\n '10.2.3': 'data-testid Password input field',\n [MIN_GRAFANA_VERSION]: 'Password input field',\n },\n submit: {\n '10.2.3': 'data-testid Login button',\n [MIN_GRAFANA_VERSION]: 'Login button',\n },\n skip: {\n '10.2.3': 'data-testid Skip change password button',\n },\n },\n PasswordlessLogin: {\n url: {\n [MIN_GRAFANA_VERSION]: '/login/passwordless/authenticate',\n },\n email: {\n '10.2.3': 'data-testid Email input field',\n [MIN_GRAFANA_VERSION]: 'Email input field',\n },\n submit: {\n '10.2.3': 'data-testid PasswordlessLogin button',\n [MIN_GRAFANA_VERSION]: 'PasswordlessLogin button',\n },\n },\n Home: {\n url: {\n [MIN_GRAFANA_VERSION]: '/',\n },\n },\n DataSource: {\n name: {\n '10.3.0': 'data-testid Data source settings page name input field',\n [MIN_GRAFANA_VERSION]: 'Data source settings page name input field',\n },\n delete: {\n [MIN_GRAFANA_VERSION]: 'Data source settings page Delete button',\n },\n readOnly: {\n '10.3.0': 'data-testid Data source settings page read only message',\n [MIN_GRAFANA_VERSION]: 'Data source settings page read only message',\n },\n saveAndTest: {\n '10.0.0': 'data-testid Data source settings page Save and Test button',\n [MIN_GRAFANA_VERSION]: 'Data source settings page Save and Test button',\n },\n alert: {\n '10.3.0': 'data-testid Data source settings page Alert',\n [MIN_GRAFANA_VERSION]: 'Data source settings page Alert',\n },\n },\n DataSources: {\n url: {\n [MIN_GRAFANA_VERSION]: '/datasources',\n },\n dataSources: {\n [MIN_GRAFANA_VERSION]: (dataSourceName: string) => `Data source list item ${dataSourceName}`,\n },\n },\n EditDataSource: {\n url: {\n '9.5.0': (dataSourceUid: string) => `/datasources/edit/${dataSourceUid}`,\n },\n settings: {\n '9.5.0': 'Datasource settings page basic settings',\n },\n },\n AddDataSource: {\n url: {\n [MIN_GRAFANA_VERSION]: '/datasources/new',\n },\n dataSourcePluginsV2: {\n '9.3.1': (pluginName: string) => `Add new data source ${pluginName}`,\n [MIN_GRAFANA_VERSION]: (pluginName: string) => `Data source plugin item ${pluginName}`,\n },\n },\n ConfirmModal: {\n delete: {\n '10.0.0': 'data-testid Confirm Modal Danger Button',\n [MIN_GRAFANA_VERSION]: 'Confirm Modal Danger Button',\n },\n },\n AddDashboard: {\n url: {\n [MIN_GRAFANA_VERSION]: '/dashboard/new',\n },\n itemButton: {\n '9.5.0': (title: string) => `data-testid ${title}`,\n },\n addNewPanel: {\n '11.1.0': 'data-testid Add new panel',\n '8.0.0': 'Add new panel',\n [MIN_GRAFANA_VERSION]: 'Add new panel',\n },\n itemButtonAddViz: {\n [MIN_GRAFANA_VERSION]: 'Add new visualization menu item',\n },\n addNewRow: {\n '11.1.0': 'data-testid Add new row',\n [MIN_GRAFANA_VERSION]: 'Add new row',\n },\n addNewPanelLibrary: {\n '11.1.0': 'data-testid Add new panel from panel library',\n [MIN_GRAFANA_VERSION]: 'Add new panel from panel library',\n },\n Settings: {\n Annotations: {\n List: {\n url: {\n [MIN_GRAFANA_VERSION]: '/dashboard/new?orgId=1&editview=annotations',\n },\n },\n Edit: {\n url: {\n [MIN_GRAFANA_VERSION]: (annotationIndex: string) =>\n `/dashboard/new?editview=annotations&editIndex=${annotationIndex}`,\n },\n },\n },\n Variables: {\n List: {\n url: {\n '11.3.0': '/dashboard/new?orgId=1&editview=variables',\n [MIN_GRAFANA_VERSION]: '/dashboard/new?orgId=1&editview=templating',\n },\n },\n Edit: {\n url: {\n '11.3.0': (editIndex: string) => `/dashboard/new?orgId=1&editview=variables&editIndex=${editIndex}`,\n [MIN_GRAFANA_VERSION]: (editIndex: string) =>\n `/dashboard/new?orgId=1&editview=templating&editIndex=${editIndex}`,\n },\n },\n },\n },\n },\n Dashboard: {\n url: {\n [MIN_GRAFANA_VERSION]: (uid: string) => `/d/${uid}`,\n },\n DashNav: {\n nav: {\n [MIN_GRAFANA_VERSION]: 'Dashboard navigation',\n },\n navV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Dashboard navigation',\n },\n publicDashboardTag: {\n '9.1.0': 'data-testid public dashboard tag',\n },\n shareButton: {\n '10.4.0': 'data-testid share-button',\n },\n scrollContainer: {\n '11.1.0': 'data-testid Dashboard canvas scroll container',\n },\n newShareButton: {\n container: {\n '11.1.0': 'data-testid new share button',\n },\n shareLink: {\n '11.1.0': 'data-testid new share link-button',\n },\n arrowMenu: {\n '11.1.0': 'data-testid new share button arrow menu',\n },\n menu: {\n container: {\n '11.1.0': 'data-testid new share button menu',\n },\n shareInternally: {\n '11.1.0': 'data-testid new share button share internally',\n },\n shareExternally: {\n '11.1.1': 'data-testid new share button share externally',\n },\n shareSnapshot: {\n '11.2.0': 'data-testid new share button share snapshot',\n },\n },\n },\n NewExportButton: {\n container: {\n '11.2.0': 'data-testid new export button',\n },\n arrowMenu: {\n '11.2.0': 'data-testid new export button arrow menu',\n },\n Menu: {\n container: {\n '11.2.0': 'data-testid new export button menu',\n },\n exportAsJson: {\n '11.2.0': 'data-testid new export button export as json',\n },\n },\n },\n playlistControls: {\n prev: {\n '11.0.0': 'data-testid playlist previous dashboard button',\n },\n stop: {\n '11.0.0': 'data-testid playlist stop dashboard button',\n },\n next: {\n '11.0.0': 'data-testid playlist next dashboard button',\n },\n },\n },\n Controls: {\n '11.1.0': 'data-testid dashboard controls',\n },\n SubMenu: {\n submenu: {\n [MIN_GRAFANA_VERSION]: 'Dashboard submenu',\n },\n submenuItem: {\n [MIN_GRAFANA_VERSION]: 'data-testid template variable',\n },\n submenuItemLabels: {\n [MIN_GRAFANA_VERSION]: (item: string) => `data-testid Dashboard template variables submenu Label ${item}`,\n },\n submenuItemValueDropDownValueLinkTexts: {\n [MIN_GRAFANA_VERSION]: (item: string) =>\n `data-testid Dashboard template variables Variable Value DropDown value link text ${item}`,\n },\n submenuItemValueDropDownDropDown: {\n [MIN_GRAFANA_VERSION]: 'Variable options',\n },\n submenuItemValueDropDownOptionTexts: {\n [MIN_GRAFANA_VERSION]: (item: string) =>\n `data-testid Dashboard template variables Variable Value DropDown option text ${item}`,\n },\n Annotations: {\n annotationsWrapper: {\n '10.0.0': 'data-testid annotation-wrapper',\n },\n annotationLabel: {\n '10.0.0': (label: string) => `data-testid Dashboard annotations submenu Label ${label}`,\n },\n annotationToggle: {\n '10.0.0': (label: string) => `data-testid Dashboard annotations submenu Toggle ${label}`,\n },\n },\n },\n Settings: {\n Actions: {\n close: {\n '9.5.0': 'data-testid dashboard-settings-close',\n },\n },\n General: {\n deleteDashBoard: {\n '11.1.0': 'data-testid Dashboard settings page delete dashboard button',\n },\n sectionItems: {\n [MIN_GRAFANA_VERSION]: (item: string) => `Dashboard settings section item ${item}`,\n },\n saveDashBoard: {\n [MIN_GRAFANA_VERSION]: 'Dashboard settings aside actions Save button',\n },\n saveAsDashBoard: {\n [MIN_GRAFANA_VERSION]: 'Dashboard settings aside actions Save As button',\n },\n title: {\n '11.2.0': 'General',\n },\n },\n Annotations: {\n Edit: {\n urlParams: {\n [MIN_GRAFANA_VERSION]: (annotationIndex: string) => `editview=annotations&editIndex=${annotationIndex}`,\n },\n },\n List: {\n url: {\n [MIN_GRAFANA_VERSION]: (dashboardUid: string) => `/d/${dashboardUid}?editview=annotations`,\n },\n addAnnotationCTAV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Call to action button Add annotation query',\n },\n annotations: {\n '10.4.0': 'data-testid list-annotations',\n },\n },\n Settings: {\n name: {\n '11.1.0': 'data-testid Annotations settings name input',\n [MIN_GRAFANA_VERSION]: 'Annotations settings name input',\n },\n },\n NewAnnotation: {\n panelFilterSelect: {\n '10.0.0': 'data-testid annotations-panel-filter',\n },\n showInLabel: {\n '11.1.0': 'data-testid show-in-label',\n },\n previewInDashboard: {\n '10.0.0': 'data-testid annotations-preview',\n },\n delete: {\n '10.4.0': 'data-testid annotations-delete',\n },\n apply: {\n '10.4.0': 'data-testid annotations-apply',\n },\n enable: {\n '10.4.0': 'data-testid annotation-enable',\n },\n hide: {\n '10.4.0': 'data-testid annotation-hide',\n },\n },\n },\n Variables: {\n List: {\n url: {\n '11.3.0': (dashboardUid: string) => `/d/${dashboardUid}?editview=variables`,\n [MIN_GRAFANA_VERSION]: (dashboardUid: string) => `/d/${dashboardUid}?editview=templating`,\n },\n addVariableCTAV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Call to action button Add variable',\n },\n newButton: {\n [MIN_GRAFANA_VERSION]: 'Variable editor New variable button',\n },\n table: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Table',\n },\n tableRowNameFields: {\n [MIN_GRAFANA_VERSION]: (variableName: string) => `Variable editor Table Name field ${variableName}`,\n },\n tableRowDefinitionFields: {\n '10.1.0': (variableName: string) => `Variable editor Table Definition field ${variableName}`,\n },\n tableRowArrowUpButtons: {\n [MIN_GRAFANA_VERSION]: (variableName: string) => `Variable editor Table ArrowUp button ${variableName}`,\n },\n tableRowArrowDownButtons: {\n [MIN_GRAFANA_VERSION]: (variableName: string) => `Variable editor Table ArrowDown button ${variableName}`,\n },\n tableRowDuplicateButtons: {\n [MIN_GRAFANA_VERSION]: (variableName: string) => `Variable editor Table Duplicate button ${variableName}`,\n },\n tableRowRemoveButtons: {\n [MIN_GRAFANA_VERSION]: (variableName: string) => `Variable editor Table Remove button ${variableName}`,\n },\n },\n Edit: {\n urlParams: {\n '11.3.0': (editIndex: string) => `editview=variables&editIndex=${editIndex}`,\n [MIN_GRAFANA_VERSION]: (editIndex: string) => `editview=templating&editIndex=${editIndex}`,\n },\n General: {\n headerLink: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Header link',\n },\n modeLabelNew: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Header mode New',\n },\n /**\n * @deprecated\n */\n modeLabelEdit: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Header mode Edit',\n },\n generalNameInput: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Form Name field',\n },\n generalNameInputV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Variable editor Form Name field',\n },\n generalTypeSelect: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Form Type select',\n },\n generalTypeSelectV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Variable editor Form Type select',\n },\n generalLabelInput: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Form Label field',\n },\n generalLabelInputV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Variable editor Form Label field',\n },\n generalHideSelect: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Form Hide select',\n },\n generalHideSelectV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Variable editor Form Hide select',\n },\n selectionOptionsAllowCustomValueSwitch: {\n [MIN_GRAFANA_VERSION]: 'data-testid Variable editor Form Allow Custom Value switch',\n },\n selectionOptionsMultiSwitch: {\n '10.4.0': 'data-testid Variable editor Form Multi switch',\n [MIN_GRAFANA_VERSION]: 'Variable editor Form Multi switch',\n },\n selectionOptionsIncludeAllSwitch: {\n '10.4.0': 'data-testid Variable editor Form IncludeAll switch',\n [MIN_GRAFANA_VERSION]: 'Variable editor Form IncludeAll switch',\n },\n selectionOptionsCustomAllInput: {\n '10.4.0': 'data-testid Variable editor Form IncludeAll field',\n [MIN_GRAFANA_VERSION]: 'Variable editor Form IncludeAll field',\n },\n previewOfValuesOption: {\n '10.4.0': 'data-testid Variable editor Preview of Values option',\n [MIN_GRAFANA_VERSION]: 'Variable editor Preview of Values option',\n },\n submitButton: {\n '10.4.0': 'data-testid Variable editor Run Query button',\n [MIN_GRAFANA_VERSION]: 'Variable editor Submit button',\n },\n applyButton: {\n '9.3.0': 'data-testid Variable editor Apply button',\n },\n },\n QueryVariable: {\n queryOptionsDataSourceSelect: {\n '10.4.0': 'data-testid Select a data source',\n '10.0.0': 'data-testid Data source picker select container',\n [MIN_GRAFANA_VERSION]: 'Data source picker select container',\n },\n queryOptionsRefreshSelect: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Form Query Refresh select',\n },\n queryOptionsRefreshSelectV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Variable editor Form Query Refresh select',\n },\n queryOptionsRegExInput: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Form Query RegEx field',\n },\n queryOptionsRegExInputV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Variable editor Form Query RegEx field',\n },\n queryOptionsSortSelect: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Form Query Sort select',\n },\n queryOptionsSortSelectV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Variable editor Form Query Sort select',\n },\n queryOptionsQueryInput: {\n '10.4.0': 'data-testid Variable editor Form Default Variable Query Editor textarea',\n },\n valueGroupsTagsEnabledSwitch: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Form Query UseTags switch',\n },\n valueGroupsTagsTagsQueryInput: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Form Query TagsQuery field',\n },\n valueGroupsTagsTagsValuesQueryInput: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Form Query TagsValuesQuery field',\n },\n },\n ConstantVariable: {\n constantOptionsQueryInput: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Form Constant Query field',\n },\n constantOptionsQueryInputV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Variable editor Form Constant Query field',\n },\n },\n DatasourceVariable: {\n datasourceSelect: {\n [MIN_GRAFANA_VERSION]: 'data-testid datasource variable datasource type',\n },\n },\n TextBoxVariable: {\n textBoxOptionsQueryInput: {\n [MIN_GRAFANA_VERSION]: 'Variable editor Form TextBox Query field',\n },\n textBoxOptionsQueryInputV2: {\n [MIN_GRAFANA_VERSION]: 'data-testid Variable editor Form TextBox Query field',\n },\n },\n CustomVariable: {\n customValueInput: {\n [MIN_GRAFANA_VERSION]: 'data-testid custom-variable-input',\n },\n },\n IntervalVariable: {\n intervalsValueInput: {\n [MIN_GRAFANA_VERSION]: 'data-testid interval variable intervals input',\n },\n autoEnabledCheckbox: {\n '10.4.0': 'data-testid interval variable auto value checkbox',\n },\n stepCountIntervalSelect: {\n '10.4.0': 'data-testid interval variable step count input',\n },\n minIntervalInput: {\n '10.4.0': 'data-testid interval variable mininum interval input',\n },\n },\n GroupByVariable: {\n dataSourceSelect: {\n '10.4.0': 'data-testid Select a data source',\n },\n infoText: {\n '10.4.0': 'data-testid group by variable info text',\n },\n modeToggle: {\n '10.4.0': 'data-testid group by variable mode toggle',\n },\n },\n AdHocFiltersVariable: {\n datasourceSelect: {\n '10.4.0': 'data-testid Select a data source',\n },\n infoText: {\n '10.4.0': 'data-testid ad-hoc filters variable info text',\n },\n modeToggle: {\n '11.0.0': 'data-testid ad-hoc filters variable mode toggle',\n },\n },\n },\n },\n },\n Annotations: {\n marker: {\n '10.0.0': 'data-testid annotation-marker',\n },\n },\n Rows: {\n Repeated: {\n ConfigSection: {\n warningMessage: {\n '10.2.0': 'data-testid Repeated rows warning message',\n },\n },\n },\n },\n },\n Dashboards: {\n url: {\n [MIN_GRAFANA_VERSION]: '/dashboards',\n },\n dashboards: {\n '10.2.0': (title: string) => `Dashboard search item ${title}`,\n },\n },\n SaveDashboardAsModal: {\n newName: {\n '10.2.0': 'Save dashboard title field',\n },\n save: {\n '10.2.0': 'Save dashboard button',\n },\n },\n SaveDashboardModal: {\n save: {\n '10.2.0': 'Dashboard settings Save Dashboard Modal Save button',\n },\n saveVariables: {\n '10.2.0': 'Dashboard settings Save Dashboard Modal Save variables checkbox',\n },\n saveTimerange: {\n '10.2.0': 'Dashboard settings Save Dashboard Modal Save timerange checkbox',\n },\n saveRefresh: {\n '11.1.0': 'Dashboard settings Save Dashboard Modal Save refresh checkbox',\n },\n },\n SharePanelModal: {\n linkToRenderedImage: {\n [MIN_GRAFANA_VERSION]: 'Link to rendered image',\n },\n },\n ShareDashboardModal: {\n PublicDashboard: {\n WillBePublicCheckbox: {\n '9.1.0': 'data-testid public dashboard will be public checkbox',\n },\n LimitedDSCheckbox: {\n '9.1.0': 'data-testid public dashboard limited datasources checkbox',\n },\n CostIncreaseCheckbox: {\n '9.1.0': 'data-testid public dashboard cost may increase checkbox',\n },\n PauseSwitch: {\n '9.5.0': 'data-testid public dashboard pause switch',\n },\n EnableAnnotationsSwitch: {\n '9.3.0': 'data-testid public dashboard on off switch for annotations',\n },\n CreateButton: {\n '9.5.0': 'data-testid public dashboard create button',\n },\n DeleteButton: {\n '9.3.0': 'data-testid public dashboard delete button',\n },\n CopyUrlInput: {\n '9.1.0': 'data-testid public dashboard copy url input',\n },\n CopyUrlButton: {\n '9.1.0': 'data-testid public dashboard copy url button',\n },\n SettingsDropdown: {\n '10.1.0': 'data-testid public dashboard settings dropdown',\n },\n TemplateVariablesWarningAlert: {\n '9.1.0': 'data-testid public dashboard disabled template variables alert',\n },\n UnsupportedDataSourcesWarningAlert: {\n '9.5.0': 'data-testid public dashboard unsupported data sources alert',\n },\n NoUpsertPermissionsWarningAlert: {\n '9.5.0': 'data-testid public dashboard no upsert permissions alert',\n },\n EnableTimeRangeSwitch: {\n '9.4.0': 'data-testid public dashboard on off switch for time range',\n },\n EmailSharingConfiguration: {\n Container: {\n '9.5.0': 'data-testid email sharing config container',\n },\n ShareType: {\n '9.5.0': 'data-testid public dashboard share type',\n },\n EmailSharingInput: {\n '9.5.0': 'data-testid public dashboard email sharing input',\n },\n EmailSharingInviteButton: {\n '9.5.0': 'data-testid public dashboard email sharing invite button',\n },\n EmailSharingList: {\n '9.5.0': 'data-testid public dashboard email sharing list',\n },\n DeleteEmail: {\n '9.5.0': 'data-testid public dashboard delete email button',\n },\n ReshareLink: {\n '9.5.0': 'data-testid public dashboard reshare link button',\n },\n },\n },\n SnapshotScene: {\n url: {\n '11.1.0': (key: string) => `/dashboard/snapshot/${key}`,\n },\n PublishSnapshot: {\n '11.1.0': 'data-testid publish snapshot button',\n },\n CopyUrlButton: {\n '11.1.0': 'data-testid snapshot copy url button',\n },\n CopyUrlInput: {\n '11.1.0': 'data-testid snapshot copy url input',\n },\n },\n },\n ShareDashboardDrawer: {\n ShareInternally: {\n container: {\n '11.3.0': 'data-testid share internally drawer container',\n },\n lockTimeRangeSwitch: {\n '11.3.0': 'data-testid share internally lock time range switch',\n },\n shortenUrlSwitch: {\n '11.3.0': 'data-testid share internally shorten url switch',\n },\n copyUrlButton: {\n '11.3.0': 'data-testid share internally copy url button',\n },\n SharePanel: {\n preview: {\n '11.5.0': 'data-testid share panel internally image generation preview',\n },\n widthInput: {\n '11.5.0': 'data-testid share panel internally width input',\n },\n heightInput: {\n '11.5.0': 'data-testid share panel internally height input',\n },\n scaleFactorInput: {\n '11.5.0': 'data-testid share panel internally scale factor input',\n },\n generateImageButton: {\n '11.5.0': 'data-testid share panel internally generate image button',\n },\n downloadImageButton: {\n '11.5.0': 'data-testid share panel internally download image button',\n },\n },\n },\n ShareExternally: {\n container: {\n '11.3.0': 'data-testid share externally drawer container',\n },\n publicAlert: {\n '11.3.0': 'data-testid public share alert',\n },\n emailSharingAlert: {\n '11.3.0': 'data-testid email share alert',\n },\n shareTypeSelect: {\n '11.3.0': 'data-testid share externally share type select',\n },\n Creation: {\n PublicShare: {\n createButton: {\n '11.3.0': 'data-testid public share dashboard create button',\n },\n cancelButton: {\n '11.3.0': 'data-testid public share dashboard cancel button',\n },\n },\n EmailShare: {\n createButton: {\n '11.3.0': 'data-testid email share dashboard create button',\n },\n cancelButton: {\n '11.3.0': 'data-testid email share dashboard cancel button',\n },\n },\n willBePublicCheckbox: {\n '11.3.0': 'data-testid share dashboard will be public checkbox',\n },\n },\n Configuration: {\n enableTimeRangeSwitch: {\n '11.3.0': 'data-testid share externally enable time range switch',\n },\n enableAnnotationsSwitch: {\n '11.3.0': 'data-testid share externally enable annotations switch',\n },\n copyUrlButton: {\n '11.3.0': 'data-testid share externally copy url button',\n },\n revokeAccessButton: {\n '11.3.0': 'data-testid share externally revoke access button',\n },\n toggleAccessButton: {\n '11.3.0': 'data-testid share externally pause or resume access button',\n },\n },\n },\n ShareSnapshot: {\n url: {\n '11.3.0': (key: string) => `/dashboard/snapshot/${key}`,\n },\n container: {\n '11.3.0': 'data-testid share snapshot drawer container',\n },\n publishSnapshot: {\n '11.3.0': 'data-testid share snapshot publish button',\n },\n copyUrlButton: {\n '11.3.0': 'data-testid share snapshot copy url button',\n },\n },\n },\n ExportDashboardDrawer: {\n ExportAsJson: {\n container: {\n '11.3.0': 'data-testid export as json drawer container',\n },\n codeEditor: {\n '11.3.0': 'data-testid export as json code editor',\n },\n exportExternallyToggle: {\n '11.3.0': 'data-testid export as json externally switch',\n },\n saveToFileButton: {\n '11.3.0': 'data-testid export as json save to file button',\n },\n copyToClipboardButton: {\n '11.3.0': 'data-testid export as json copy to clipboard button',\n },\n cancelButton: {\n '11.3.0': 'data-testid export as json cancel button',\n },\n },\n },\n PublicDashboard: {\n page: {\n '9.5.0': 'public-dashboard-page',\n },\n NotAvailable: {\n container: {\n '9.5.0': 'public-dashboard-not-available',\n },\n title: {\n '9.5.0': 'public-dashboard-title',\n },\n pausedDescription: {\n '9.5.0': 'public-dashboard-paused-description',\n },\n },\n footer: {\n '11.0.0': 'public-dashboard-footer',\n },\n },\n PublicDashboardScene: {\n loadingPage: {\n '11.0.0': 'public-dashboard-scene-loading-page',\n },\n page: {\n '11.0.0': 'public-dashboard-scene-page',\n },\n controls: {\n '11.0.0': 'public-dashboard-controls',\n },\n },\n RequestViewAccess: {\n form: {\n '9.5.0': 'request-view-access-form',\n },\n recipientInput: {\n '9.5.0': 'request-view-access-recipient-input',\n },\n submitButton: {\n '9.5.0': 'request-view-access-submit-button',\n },\n },\n PublicDashboardConfirmAccess: {\n submitButton: {\n '10.2.0': 'data-testid confirm-access-submit-button',\n },\n },\n Explore: {\n url: {\n [MIN_GRAFANA_VERSION]: '/explore',\n },\n General: {\n container: {\n [MIN_GRAFANA_VERSION]: 'data-testid Explore',\n },\n graph: {\n [MIN_GRAFANA_VERSION]: 'Explore Graph',\n },\n table: {\n [MIN_GRAFANA_VERSION]: 'Explore Table',\n },\n scrollView: {\n '9.0.0': 'data-testid explorer scroll view',\n },\n },\n QueryHistory: {\n container: {\n '11.1.0': 'data-testid QueryHistory',\n },\n },\n },\n SoloPanel: {\n url: {\n [MIN_GRAFANA_VERSION]: (page: string) => `/d-solo/${page}`,\n },\n },\n PluginsList: {\n page: {\n [MIN_GRAFANA_VERSION]: 'Plugins list page',\n },\n list: {\n [MIN_GRAFANA_VERSION]: 'Plugins list',\n },\n listItem: {\n [MIN_GRAFANA_VERSION]: 'Plugins list item',\n },\n signatureErrorNotice: {\n '10.3.0': 'data-testid Unsigned plugins notice',\n [MIN_GRAFANA_VERSION]: 'Unsigned plugins notice',\n },\n },\n PluginPage: {\n page: {\n [MIN_GRAFANA_VERSION]: 'Plugin page',\n },\n signatureInfo: {\n '10.3.0': 'data-testid Plugin signature info',\n [MIN_GRAFANA_VERSION]: 'Plugin signature info',\n },\n disabledInfo: {\n '10.3.0': 'data-testid Plugin disabled info',\n [MIN_GRAFANA_VERSION]: 'Plugin disabled info',\n },\n },\n PlaylistForm: {\n name: {\n [MIN_GRAFANA_VERSION]: 'Playlist name',\n },\n interval: {\n [MIN_GRAFANA_VERSION]: 'Playlist interval',\n },\n itemDelete: {\n '10.2.0': 'data-testid playlist-form-delete-item',\n },\n },\n BrowseDashboards: {\n table: {\n body: {\n '10.2.0': 'data-testid browse-dashboards-table',\n },\n row: {\n '10.2.0': (name: string) => `data-testid browse dashboards row ${name}`,\n },\n checkbox: {\n '10.0.0': (uid: string) => `data-testid ${uid} checkbox`,\n },\n },\n NewFolderForm: {\n form: {\n '10.2.0': 'data-testid new folder form',\n },\n nameInput: {\n '10.2.0': 'data-testid new-folder-name-input',\n },\n createButton: {\n '10.2.0': 'data-testid new-folder-create-button',\n },\n },\n },\n Search: {\n url: {\n '9.3.0': '/?search=openn',\n },\n FolderView: {\n url: {\n '9.3.0': '/?search=open&layout=folders',\n },\n },\n },\n PublicDashboards: {\n ListItem: {\n linkButton: {\n '9.3.0': 'public-dashboard-link-button',\n },\n configButton: {\n '9.3.0': 'public-dashboard-configuration-button',\n },\n trashcanButton: {\n '9.3.0': 'public-dashboard-remove-button',\n },\n pauseSwitch: {\n '10.1.0': 'data-testid public dashboard pause switch',\n },\n },\n },\n UserListPage: {\n tabs: {\n allUsers: {\n '10.0.0': 'data-testid all-users-tab',\n },\n orgUsers: {\n '10.0.0': 'data-testid org-users-tab',\n },\n anonUserDevices: {\n '10.2.3': 'data-testid anon-user-devices-tab',\n },\n publicDashboardsUsers: {\n '10.0.0': 'data-testid public-dashboards-users-tab',\n },\n users: {\n '10.0.0': 'data-testid users-tab',\n },\n },\n org: {\n url: {\n '10.2.0': '/admin/users',\n '9.5.0': '/org/users',\n },\n },\n admin: {\n url: {\n '9.5.0': '/admin/users',\n },\n },\n publicDashboards: {\n container: {\n '11.1.0': 'data-testid public-dashboards-users-list',\n },\n },\n UserListAdminPage: {\n container: {\n '10.0.0': 'data-testid user-list-admin-page',\n },\n },\n UsersListPage: {\n container: {\n '10.0.0': 'data-testid users-list-page',\n },\n },\n UserAnonListPage: {\n container: {\n '10.4.0': 'data-testid user-anon-list-page',\n },\n },\n UsersListPublicDashboardsPage: {\n container: {\n '10.0.0': 'data-testid users-list-public-dashboards-page',\n },\n DashboardsListModal: {\n listItem: {\n '10.0.0': (uid: string) => `data-testid dashboards-list-item-${uid}`,\n },\n },\n },\n },\n ProfilePage: {\n url: {\n '10.2.0': '/profile',\n },\n },\n Plugin: {\n url: {\n [MIN_GRAFANA_VERSION]: (pluginId: string) => `/plugins/${pluginId}`,\n },\n },\n} satisfies VersionedSelectorGroup;\n\nexport type VersionedPages = typeof versionedPages;\n","import { resolveSelectors } from '../resolver';\nimport { E2ESelectors } from '../types';\n\nimport { versionedComponents, VersionedComponents } from './components';\nimport { versionedPages, VersionedPages } from './pages';\n\nconst Pages = resolveSelectors(versionedPages);\nconst Components = resolveSelectors(versionedComponents);\nconst selectors = { pages: Pages, components: Components };\n\n/**\n * Exposes Pages, Component selectors and E2ESelectors type in package for easy use in e2e tests and in production code\n */\nexport {\n Pages,\n Components,\n selectors,\n versionedComponents,\n versionedPages,\n resolveSelectors,\n type VersionedPages,\n type VersionedComponents,\n type E2ESelectors,\n};\n","import { merge } from 'lodash';\n\nimport {\n AuthSettings,\n BootData,\n BuildInfo,\n DataSourceInstanceSettings,\n FeatureToggles,\n GrafanaConfig,\n GrafanaTheme,\n GrafanaTheme2,\n LicenseInfo,\n MapLayerOptions,\n OAuthSettings,\n PanelPluginMeta,\n systemDateFormats,\n SystemDateFormatSettings,\n getThemeById,\n AngularMeta,\n PluginLoadingStrategy,\n PluginDependencies,\n PluginExtensions,\n} from '@grafana/data';\n\nexport interface AzureSettings {\n cloud?: string;\n clouds?: AzureCloudInfo[];\n managedIdentityEnabled: boolean;\n workloadIdentityEnabled: boolean;\n userIdentityEnabled: boolean;\n userIdentityFallbackCredentialsEnabled: boolean;\n azureEntraPasswordCredentialsEnabled: boolean;\n}\n\nexport interface AzureCloudInfo {\n name: string;\n displayName: string;\n}\n\nexport type AppPluginConfig = {\n id: string;\n path: string;\n version: string;\n preload: boolean;\n angular: AngularMeta;\n loadingStrategy: PluginLoadingStrategy;\n dependencies: PluginDependencies;\n extensions: PluginExtensions;\n moduleHash?: string;\n};\n\nexport type PreinstalledPlugin = {\n id: string;\n version: string;\n};\n\nexport class GrafanaBootConfig implements GrafanaConfig {\n publicDashboardAccessToken?: string;\n publicDashboardsEnabled = true;\n snapshotEnabled = true;\n datasources: { [str: string]: DataSourceInstanceSettings } = {};\n panels: { [key: string]: PanelPluginMeta } = {};\n apps: Record<string, AppPluginConfig> = {};\n auth: AuthSettings = {};\n minRefreshInterval = '';\n appUrl = '';\n appSubUrl = '';\n namespace = 'default';\n windowTitlePrefix = '';\n buildInfo: BuildInfo;\n newPanelTitle = '';\n bootData: BootData;\n externalUserMngLinkUrl = '';\n externalUserMngLinkName = '';\n externalUserMngInfo = '';\n externalUserMngAnalytics = false;\n externalUserMngAnalyticsParams = '';\n allowOrgCreate = false;\n feedbackLinksEnabled = true;\n disableLoginForm = false;\n defaultDatasource = ''; // UID\n angularSupportEnabled = false;\n authProxyEnabled = false;\n exploreEnabled = false;\n queryHistoryEnabled = false;\n helpEnabled = false;\n profileEnabled = false;\n newsFeedEnabled = true;\n ldapEnabled = false;\n jwtHeaderName = '';\n jwtUrlLogin = false;\n sigV4AuthEnabled = false;\n azureAuthEnabled = false;\n secureSocksDSProxyEnabled = false;\n samlEnabled = false;\n samlName = '';\n autoAssignOrg = true;\n verifyEmailEnabled = false;\n oauth: OAuthSettings = {};\n rbacEnabled = true;\n disableUserSignUp = false;\n loginHint = '';\n passwordHint = '';\n loginError: string | undefined = undefined;\n viewersCanEdit = false;\n editorsCanAdmin = false;\n disableSanitizeHtml = false;\n trustedTypesDefaultPolicyEnabled = false;\n cspReportOnlyEnabled = false;\n liveEnabled = true;\n /** @deprecated Use `theme2` instead. */\n theme: GrafanaTheme;\n theme2: GrafanaTheme2;\n featureToggles: FeatureToggles = {};\n anonymousEnabled = false;\n anonymousDeviceLimit: number | undefined = undefined;\n licenseInfo: LicenseInfo = {} as LicenseInfo;\n rendererAvailable = false;\n rendererVersion = '';\n rendererDefaultImageWidth = 1000;\n rendererDefaultImageHeight = 500;\n rendererDefaultImageScale = 1;\n secretsManagerPluginEnabled = false;\n supportBundlesEnabled = false;\n http2Enabled = false;\n dateFormats?: SystemDateFormatSettings;\n grafanaJavascriptAgent = {\n enabled: false,\n customEndpoint: '',\n apiKey: '',\n allInstrumentationsEnabled: false,\n errorInstrumentalizationEnabled: true,\n consoleInstrumentalizationEnabled: false,\n webVitalsInstrumentalizationEnabled: false,\n tracingInstrumentalizationEnabled: false,\n };\n pluginCatalogURL = 'https://grafana.com/grafana/plugins/';\n pluginAdminEnabled = true;\n pluginAdminExternalManageEnabled = false;\n pluginCatalogHiddenPlugins: string[] = [];\n pluginCatalogManagedPlugins: string[] = [];\n pluginCatalogPreinstalledPlugins: PreinstalledPlugin[] = [];\n pluginsCDNBaseURL = '';\n expressionsEnabled = false;\n awsAllowedAuthProviders: string[] = [];\n awsAssumeRoleEnabled = false;\n azure: AzureSettings = {\n managedIdentityEnabled: false,\n workloadIdentityEnabled: false,\n userIdentityEnabled: false,\n userIdentityFallbackCredentialsEnabled: false,\n azureEntraPasswordCredentialsEnabled: false,\n };\n caching = {\n enabled: false,\n };\n geomapDefaultBaseLayerConfig?: MapLayerOptions;\n geomapDisableCustomBaseLayer?: boolean;\n unifiedAlertingEnabled = false;\n unifiedAlerting = {\n minInterval: '',\n alertStateHistoryBackend: undefined,\n alertStateHistoryPrimary: undefined,\n };\n applicationInsightsConnectionString?: string;\n applicationInsightsEndpointUrl?: string;\n recordedQueries = {\n enabled: true,\n };\n featureHighlights = {\n enabled: false,\n };\n reporting = {\n enabled: true,\n };\n analytics = {\n enabled: true,\n };\n googleAnalyticsId: undefined;\n googleAnalytics4Id: undefined;\n googleAnalytics4SendManualPageViews = false;\n rudderstackWriteKey: undefined;\n rudderstackDataPlaneUrl: undefined;\n rudderstackSdkUrl: undefined;\n rudderstackConfigUrl: undefined;\n rudderstackIntegrationsUrl: undefined;\n analyticsConsoleReporting = false;\n dashboardPerformanceMetrics: string[] = [];\n sqlConnectionLimits = {\n maxOpenConns: 100,\n maxIdleConns: 100,\n connMaxLifetime: 14400,\n };\n defaultDatasourceManageAlertsUiToggle = true;\n\n tokenExpirationDayLimit: undefined;\n enableFrontendSandboxForPlugins: string[] = [];\n sharedWithMeFolderUID: string | undefined;\n rootFolderUID: string | undefined;\n localFileSystemAvailable: boolean | undefined;\n cloudMigrationIsTarget: boolean | undefined;\n cloudMigrationFeedbackURL = '';\n cloudMigrationPollIntervalMs = 2000;\n reportingStaticContext?: Record<string, string>;\n exploreDefaultTimeOffset = '1h';\n exploreHideLogsDownload: boolean | undefined;\n\n /**\n * Language used in Grafana's UI. This is after the user's preference (or deteceted locale) is resolved to one of\n * Grafana's supported language.\n */\n language: string | undefined;\n\n constructor(options: GrafanaBootConfig) {\n this.bootData = options.bootData;\n\n const defaults = {\n datasources: {},\n windowTitlePrefix: 'Grafana - ',\n panels: {},\n newPanelTitle: 'Panel Title',\n playlist_timespan: '1m',\n unsaved_changes_warning: true,\n appUrl: '',\n appSubUrl: '',\n buildInfo: {\n version: '1.0',\n commit: '1',\n env: 'production',\n },\n viewersCanEdit: false,\n editorsCanAdmin: false,\n disableSanitizeHtml: false,\n };\n\n merge(this, defaults, options);\n\n this.buildInfo = options.buildInfo || defaults.buildInfo;\n\n if (this.dateFormats) {\n systemDateFormats.update(this.dateFormats);\n }\n\n overrideFeatureTogglesFromUrl(this);\n overrideFeatureTogglesFromLocalStorage(this);\n\n if (this.featureToggles.disableAngular) {\n this.angularSupportEnabled = false;\n }\n\n // Creating theme after applying feature toggle overrides in case we need to toggle anything\n this.theme2 = getThemeById(this.bootData.user.theme);\n this.bootData.user.lightTheme = this.theme2.isLight;\n this.theme = this.theme2.v1;\n }\n}\n\n// localstorage key: grafana.featureToggles\n// example value: panelEditor=1,panelInspector=1\nfunction overrideFeatureTogglesFromLocalStorage(config: GrafanaBootConfig) {\n const featureToggles = config.featureToggles;\n const localStorageKey = 'grafana.featureToggles';\n const localStorageValue = window.localStorage.getItem(localStorageKey);\n if (localStorageValue) {\n const features = localStorageValue.split(',');\n for (const feature of features) {\n const [featureName, featureValue] = feature.split('=');\n const toggleState = featureValue === 'true' || featureValue === '1';\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n featureToggles[featureName as keyof FeatureToggles] = toggleState;\n console.log(`Setting feature toggle ${featureName} = ${toggleState} via localstorage`);\n }\n }\n}\n\nfunction overrideFeatureTogglesFromUrl(config: GrafanaBootConfig) {\n if (window.location.href.indexOf('__feature') === -1) {\n return;\n }\n\n const isDevelopment = config.buildInfo.env === 'development';\n\n // Although most flags can not be changed from the URL in production,\n // some of them are safe (and useful!) to change dynamically from the browser URL\n const safeRuntimeFeatureFlags = new Set(['queryServiceFromUI', 'dashboardSceneSolo']);\n\n const params = new URLSearchParams(window.location.search);\n params.forEach((value, key) => {\n if (key.startsWith('__feature.')) {\n const featureToggles = config.featureToggles as Record<string, boolean>;\n const featureName = key.substring(10);\n\n const toggleState = value === 'true' || value === ''; // browser rewrites true as ''\n if (toggleState !== featureToggles[key]) {\n if (isDevelopment || safeRuntimeFeatureFlags.has(featureName)) {\n featureToggles[featureName] = toggleState;\n console.log(`Setting feature toggle ${featureName} = ${toggleState} via url`);\n } else {\n console.log(`Unable to change feature toggle ${featureName} via url in production.`);\n }\n }\n }\n });\n}\n\nconst bootData = (window as any).grafanaBootData || {\n settings: {},\n user: {},\n navTree: [],\n};\n\nconst options = bootData.settings;\noptions.bootData = bootData;\n\n/**\n * Use this to access the {@link GrafanaBootConfig} for the current running Grafana instance.\n *\n * @public\n */\nexport const config = new GrafanaBootConfig(options);\n","import { BusEventBase, BusEventWithPayload, EventBus, GrafanaTheme2, PanelModel, TimeRange } from '@grafana/data';\n\n/**\n * Called when a dashboard is refreshed\n *\n * @public\n */\nexport class RefreshEvent extends BusEventBase {\n static type = 'refresh';\n}\n\n/**\n * Called when the theme settings change\n *\n * @public\n */\nexport class ThemeChangedEvent extends BusEventWithPayload<GrafanaTheme2> {\n static type = 'theme-changed';\n}\n\n/**\n * Called when time range is updated\n *\n * @public\n */\nexport class TimeRangeUpdatedEvent extends BusEventWithPayload<TimeRange> {\n static type = 'time-range-updated';\n}\n\n/**\n * Called to copy a panel JSON into local storage\n *\n * @public\n */\nexport class CopyPanelEvent extends BusEventWithPayload<PanelModel> {\n static type = 'copy-panel';\n}\n\n// Internal singleton instance\nlet singletonInstance: EventBus;\n\n/**\n * Used during startup by Grafana to set the setAppEvents so it is available\n * via the {@link setAppEvents} to the rest of the application.\n *\n * @internal\n */\nexport function setAppEvents(instance: EventBus) {\n singletonInstance = instance;\n}\n\n/**\n * Used to retrieve an event bus that manages application level events\n *\n * @public\n */\nexport function getAppEvents(): EventBus {\n return singletonInstance;\n}\n","import { Observable } from 'rxjs';\n\n/**\n * Used to initiate a remote call via the {@link BackendSrv}\n *\n * @public\n */\nexport type BackendSrvRequest = {\n /**\n * Request URL\n */\n url: string;\n\n /**\n * Number of times to retry the remote call if it fails.\n */\n retry?: number;\n\n /**\n * HTTP headers that should be passed along with the remote call.\n * Please have a look at {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API | Fetch API}\n * for supported headers.\n */\n headers?: Record<string, any>;\n\n /**\n * HTTP verb to perform in the remote call GET, POST, PUT etc.\n */\n method?: string;\n\n /**\n * Set to false an success application alert box will not be shown for successful PUT, DELETE, POST requests\n */\n showSuccessAlert?: boolean;\n\n /**\n * Set to false to not show an application alert box for request errors\n */\n showErrorAlert?: boolean;\n\n /**\n * Provided by the initiator to identify a particular remote call. An example\n * of this is when a datasource plugin triggers a query. If the request id already\n * exist the backendSrv will try to cancel and replace the previous call with the\n * new one.\n */\n requestId?: string;\n\n /**\n * Set to to true to not include call in query inspector\n */\n hideFromInspector?: boolean;\n\n /**\n * The data to send\n */\n data?: any;\n\n /**\n * Query params\n */\n params?: Record<string, any>;\n\n /**\n * Define how the response object should be parsed. See:\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data\n *\n * By default values are json parsed from text\n */\n responseType?: 'json' | 'text' | 'arraybuffer' | 'blob';\n\n /**\n * Used to cancel an open connection\n * https://developer.mozilla.org/en-US/docs/Web/API/AbortController\n */\n abortSignal?: AbortSignal;\n\n /**\n * The credentials read-only property of the Request interface indicates whether the user agent should send cookies from the other domain in the case of cross-origin requests.\n */\n credentials?: RequestCredentials;\n\n /**\n * @deprecated withCredentials is deprecated in favor of credentials\n */\n withCredentials?: boolean;\n};\n\n/**\n * Response for fetch function in {@link BackendSrv}\n *\n * @public\n */\nexport interface FetchResponse<T = any> {\n data: T;\n readonly status: number;\n readonly statusText: string;\n readonly ok: boolean;\n readonly headers: Headers;\n readonly redirected: boolean;\n readonly type: ResponseType;\n readonly url: string;\n readonly config: BackendSrvRequest;\n readonly traceId?: string;\n}\n\n/**\n * Error type for fetch function in {@link BackendSrv}\n *\n * @public\n */\nexport interface FetchErrorDataProps {\n message?: string;\n status?: string;\n error?: string | any;\n}\n\n/**\n * Error type for fetch function in {@link BackendSrv}\n *\n * @public\n */\nexport interface FetchError<T = any> {\n status: number;\n statusText?: string;\n data: T;\n message?: string;\n cancelled?: boolean;\n isHandled?: boolean;\n config: BackendSrvRequest;\n traceId?: string;\n}\n\nexport function isFetchError<T = any>(e: unknown): e is FetchError<T> {\n return typeof e === 'object' && e !== null && 'status' in e && 'data' in e;\n}\n\n/**\n * Used to communicate via http(s) to a remote backend such as the Grafana backend,\n * a datasource etc. The BackendSrv is using the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API | Fetch API}\n * under the hood to handle all the communication.\n *\n * The request function can be used to perform a remote call by specifying a {@link BackendSrvRequest}.\n * To make the BackendSrv a bit easier to use we have added a couple of shorthand functions that will\n * use default values executing the request.\n *\n * @remarks\n * By default, Grafana displays an error message alert if the remote call fails. To prevent this from\n * happening `showErrorAlert = true` on the options object.\n *\n * @public\n */\nexport interface BackendSrv {\n get<T = any>(url: string, params?: any, requestId?: string, options?: Partial<BackendSrvRequest>): Promise<T>;\n delete<T = unknown>(url: string, data?: unknown, options?: Partial<BackendSrvRequest>): Promise<T>;\n post<T = any>(url: string, data?: unknown, options?: Partial<BackendSrvRequest>): Promise<T>;\n patch<T = any>(url: string, data?: unknown, options?: Partial<BackendSrvRequest>): Promise<T>;\n put<T = any>(url: string, data?: unknown, options?: Partial<BackendSrvRequest>): Promise<T>;\n\n /**\n * @deprecated Use the `.fetch()` function instead. If you prefer to work with a promise\n * wrap the Observable returned by fetch with the lastValueFrom function, or use the get|delete|post|patch|put methods.\n * This method is going to be private from Grafana 10.\n */\n request<T = unknown>(options: BackendSrvRequest): Promise<T>;\n\n /**\n * Special function used to communicate with datasources that will emit core\n * events that the Grafana QueryInspector and QueryEditor is listening for to be able\n * to display datasource query information. Can be skipped by adding `option.silent`\n * when initializing the request.\n *\n * @deprecated Use the fetch function instead\n */\n datasourceRequest<T = unknown>(options: BackendSrvRequest): Promise<FetchResponse<T>>;\n\n /**\n * Observable http request interface\n */\n fetch<T>(options: BackendSrvRequest): Observable<FetchResponse<T>>;\n\n /**\n * Observe each raw chunk in the response. This is useful when reading values from\n * a long living HTTP connection like the kubernetes WATCH command.\n *\n * Each chunk includes the full response headers and the `data` property is filled with the chunk.\n */\n chunked(options: BackendSrvRequest): Observable<FetchResponse<Uint8Array | undefined>>;\n}\n\nlet singletonInstance: BackendSrv;\n\n/**\n * Used during startup by Grafana to set the BackendSrv so it is available\n * via the {@link getBackendSrv} to the rest of the application.\n *\n * @internal\n */\nexport const setBackendSrv = (instance: BackendSrv) => {\n singletonInstance = instance;\n};\n\n/**\n * Used to retrieve the {@link BackendSrv} that can be used to communicate\n * via http(s) to a remote backend such as the Grafana backend, a datasource etc.\n *\n * @public\n */\nexport const getBackendSrv = (): BackendSrv => singletonInstance;\n","import { config } from '../config';\n\nexport const featureEnabled = (feature: string): boolean => {\n const { enabledFeatures } = config.licenseInfo;\n return enabledFeatures && enabledFeatures[feature];\n};\n","// Code generated - EDITING IS FUTILE. DO NOT EDIT.\n//\n// Generated by:\n// kinds/gen.go\n// Using jennies:\n// CommonSchemaJenny\n//\n// Run 'make gen-cue' from repository root to regenerate.\n\n\n/**\n * A topic is attached to DataFrame metadata in query results.\n * This specifies where the data should be used.\n */\nexport enum DataTopic {\n AlertStates = 'alertStates',\n Annotations = 'annotations',\n Series = 'series',\n}\n\n/**\n * TODO docs\n */\nexport interface DataSourceJsonData {\n alertmanagerUid?: string;\n authType?: string;\n defaultRegion?: string;\n manageAlerts?: boolean;\n profile?: string;\n}\n\n/**\n * These are the common properties available to all queries in all datasources.\n * Specific implementations will *extend* this interface, adding the required\n * properties for the given context.\n */\nexport interface DataQuery {\n /**\n * For mixed data sources the selected datasource is on the query level.\n * For non mixed scenarios this is undefined.\n * TODO find a better way to do this ^ that's friendly to schema\n * TODO this shouldn't be unknown but DataSourceRef | null\n */\n datasource?: unknown;\n /**\n * If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel.\n */\n hide?: boolean;\n /**\n * Specify the query flavor\n * TODO make this required and give it a default\n */\n queryType?: string;\n /**\n * A unique identifier for the query within the list of targets.\n * In server side expressions, the refId is used as a variable name to identify results.\n * By default, the UI will assign A->Z; however setting meaningful names may be useful.\n */\n refId: string;\n}\n\nexport interface BaseDimensionConfig {\n /**\n * fixed: T -- will be added by each element\n */\n field?: string;\n}\n\nexport enum ScaleDimensionMode {\n Linear = 'linear',\n Quad = 'quad',\n}\n\nexport interface ScaleDimensionConfig extends BaseDimensionConfig {\n fixed?: number;\n max: number;\n min: number;\n mode?: ScaleDimensionMode; // | *\"linear\"\n}\n\nexport interface ColorDimensionConfig extends BaseDimensionConfig {\n fixed?: string; // color value\n}\n\nexport enum ScalarDimensionMode {\n Clamped = 'clamped',\n Mod = 'mod',\n}\n\nexport interface ScalarDimensionConfig extends BaseDimensionConfig {\n fixed?: number;\n max: number;\n min: number;\n mode?: ScalarDimensionMode;\n}\n\nexport enum TextDimensionMode {\n Field = 'field',\n Fixed = 'fixed',\n Template = 'template',\n}\n\nexport interface TextDimensionConfig extends BaseDimensionConfig {\n fixed?: string;\n mode: TextDimensionMode;\n}\n\nexport enum ResourceDimensionMode {\n Field = 'field',\n Fixed = 'fixed',\n Mapping = 'mapping',\n}\n\nexport interface MapLayerOptions {\n /**\n * Custom options depending on the type\n */\n config?: unknown;\n /**\n * Defines a frame MatcherConfig that may filter data for the given layer\n */\n filterData?: unknown;\n /**\n * Common method to define geometry fields\n */\n location?: FrameGeometrySource;\n /**\n * configured unique display name\n */\n name: string;\n /**\n * Common properties:\n * https://openlayers.org/en/latest/apidoc/module-ol_layer_Base-BaseLayer.html\n * Layer opacity (0-1)\n */\n opacity?: number;\n /**\n * Check tooltip (defaults to true)\n */\n tooltip?: boolean;\n type: string;\n}\n\nexport enum FrameGeometrySourceMode {\n Auto = 'auto',\n Coords = 'coords',\n Geohash = 'geohash',\n Lookup = 'lookup',\n}\n\nexport enum HeatmapCalculationMode {\n Count = 'count',\n Size = 'size',\n}\n\nexport enum HeatmapCellLayout {\n auto = 'auto',\n ge = 'ge',\n le = 'le',\n unknown = 'unknown',\n}\n\nexport interface HeatmapCalculationBucketConfig {\n /**\n * Sets the bucket calculation mode\n */\n mode?: HeatmapCalculationMode;\n /**\n * Controls the scale of the buckets\n */\n scale?: ScaleDistributionConfig;\n /**\n * The number of buckets to use for the axis in the heatmap\n */\n value?: string;\n}\n\nexport enum LogsSortOrder {\n Ascending = 'Ascending',\n Descending = 'Descending',\n}\n\n/**\n * TODO docs\n */\nexport enum AxisPlacement {\n Auto = 'auto',\n Bottom = 'bottom',\n Hidden = 'hidden',\n Left = 'left',\n Right = 'right',\n Top = 'top',\n}\n\n/**\n * TODO docs\n */\nexport enum AxisColorMode {\n Series = 'series',\n Text = 'text',\n}\n\n/**\n * TODO docs\n */\nexport enum VisibilityMode {\n Always = 'always',\n Auto = 'auto',\n Never = 'never',\n}\n\n/**\n * TODO docs\n */\nexport enum GraphDrawStyle {\n Bars = 'bars',\n Line = 'line',\n Points = 'points',\n}\n\n/**\n * TODO docs\n */\nexport enum GraphTransform {\n Constant = 'constant',\n NegativeY = 'negative-Y',\n}\n\n/**\n * TODO docs\n */\nexport enum LineInterpolation {\n Linear = 'linear',\n Smooth = 'smooth',\n StepAfter = 'stepAfter',\n StepBefore = 'stepBefore',\n}\n\n/**\n * TODO docs\n */\nexport enum ScaleDistribution {\n Linear = 'linear',\n Log = 'log',\n Ordinal = 'ordinal',\n Symlog = 'symlog',\n}\n\n/**\n * TODO docs\n */\nexport enum GraphGradientMode {\n Hue = 'hue',\n None = 'none',\n Opacity = 'opacity',\n Scheme = 'scheme',\n}\n\n/**\n * TODO docs\n */\nexport enum StackingMode {\n None = 'none',\n Normal = 'normal',\n Percent = 'percent',\n}\n\n/**\n * TODO docs\n */\nexport enum BarAlignment {\n After = 1,\n Before = -1,\n Center = 0,\n}\n\n/**\n * TODO docs\n */\nexport enum ScaleOrientation {\n Horizontal = 0,\n Vertical = 1,\n}\n\n/**\n * TODO docs\n */\nexport enum ScaleDirection {\n Down = -1,\n Left = -1,\n Right = 1,\n Up = 1,\n}\n\n/**\n * TODO docs\n */\nexport interface LineStyle {\n dash?: Array<number>;\n fill?: ('solid' | 'dash' | 'dot' | 'square');\n}\n\nexport const defaultLineStyle: Partial<LineStyle> = {\n dash: [],\n};\n\n/**\n * TODO docs\n */\nexport interface LineConfig {\n lineColor?: string;\n lineInterpolation?: LineInterpolation;\n lineStyle?: LineStyle;\n lineWidth?: number;\n /**\n * Indicate if null values should be treated as gaps or connected.\n * When the value is a number, it represents the maximum delta in the\n * X axis that should be considered connected. For timeseries, this is milliseconds\n */\n spanNulls?: (boolean | number);\n}\n\n/**\n * TODO docs\n */\nexport interface BarConfig {\n barAlignment?: BarAlignment;\n barMaxWidth?: number;\n barWidthFactor?: number;\n}\n\n/**\n * TODO docs\n */\nexport interface FillConfig {\n fillBelowTo?: string;\n fillColor?: string;\n fillOpacity?: number;\n}\n\n/**\n * TODO docs\n */\nexport interface PointsConfig {\n pointColor?: string;\n pointSize?: number;\n pointSymbol?: string;\n showPoints?: VisibilityMode;\n}\n\n/**\n * TODO docs\n */\nexport interface ScaleDistributionConfig {\n linearThreshold?: number;\n log?: number;\n type: ScaleDistribution;\n}\n\n/**\n * TODO docs\n */\nexport interface AxisConfig {\n axisBorderShow?: boolean;\n axisCenteredZero?: boolean;\n axisColorMode?: AxisColorMode;\n axisGridShow?: boolean;\n axisLabel?: string;\n axisPlacement?: AxisPlacement;\n axisSoftMax?: number;\n axisSoftMin?: number;\n axisWidth?: number;\n scaleDistribution?: ScaleDistributionConfig;\n}\n\n/**\n * TODO docs\n */\nexport interface HideSeriesConfig {\n legend: boolean;\n tooltip: boolean;\n viz: boolean;\n}\n\n/**\n * TODO docs\n */\nexport interface StackingConfig {\n group?: string;\n mode?: StackingMode;\n}\n\n/**\n * TODO docs\n */\nexport interface StackableFieldConfig {\n stacking?: StackingConfig;\n}\n\n/**\n * TODO docs\n */\nexport interface HideableFieldConfig {\n hideFrom?: HideSeriesConfig;\n}\n\n/**\n * TODO docs\n */\nexport enum GraphThresholdsStyleMode {\n Area = 'area',\n Dashed = 'dashed',\n DashedAndArea = 'dashed+area',\n Line = 'line',\n LineAndArea = 'line+area',\n Off = 'off',\n Series = 'series',\n}\n\n/**\n * TODO docs\n */\nexport interface GraphThresholdsStyleConfig {\n mode: GraphThresholdsStyleMode;\n}\n\n/**\n * TODO docs\n */\nexport type LegendPlacement = ('bottom' | 'right');\n\n/**\n * TODO docs\n * Note: \"hidden\" needs to remain as an option for plugins compatibility\n */\nexport enum LegendDisplayMode {\n Hidden = 'hidden',\n List = 'list',\n Table = 'table',\n}\n\n/**\n * TODO docs\n */\nexport interface SingleStatBaseOptions extends OptionsWithTextFormatting {\n orientation: VizOrientation;\n reduceOptions: ReduceDataOptions;\n}\n\n/**\n * TODO docs\n */\nexport interface ReduceDataOptions {\n /**\n * When !values, pick one value for the whole field\n */\n calcs: Array<string>;\n /**\n * Which fields to show. By default this is only numeric fields\n */\n fields?: string;\n /**\n * if showing all values limit\n */\n limit?: number;\n /**\n * If true show each row value\n */\n values?: boolean;\n}\n\nexport const defaultReduceDataOptions: Partial<ReduceDataOptions> = {\n calcs: [],\n};\n\n/**\n * TODO docs\n */\nexport enum VizOrientation {\n Auto = 'auto',\n Horizontal = 'horizontal',\n Vertical = 'vertical',\n}\n\n/**\n * TODO docs\n */\nexport interface OptionsWithTooltip {\n tooltip: VizTooltipOptions;\n}\n\n/**\n * TODO docs\n */\nexport interface OptionsWithLegend {\n legend: VizLegendOptions;\n}\n\n/**\n * TODO docs\n */\nexport interface OptionsWithTimezones {\n timezone?: Array<TimeZone>;\n}\n\nexport const defaultOptionsWithTimezones: Partial<OptionsWithTimezones> = {\n timezone: [],\n};\n\n/**\n * TODO docs\n */\nexport interface OptionsWithTextFormatting {\n text?: VizTextDisplayOptions;\n}\n\n/**\n * TODO docs\n */\nexport enum BigValueColorMode {\n Background = 'background',\n BackgroundSolid = 'background_solid',\n None = 'none',\n Value = 'value',\n}\n\n/**\n * TODO docs\n */\nexport enum BigValueGraphMode {\n Area = 'area',\n Line = 'line',\n None = 'none',\n}\n\n/**\n * TODO docs\n */\nexport enum BigValueJustifyMode {\n Auto = 'auto',\n Center = 'center',\n}\n\n/**\n * TODO docs\n */\nexport enum BigValueTextMode {\n Auto = 'auto',\n Name = 'name',\n None = 'none',\n Value = 'value',\n ValueAndName = 'value_and_name',\n}\n\n/**\n * TODO docs\n */\nexport enum PercentChangeColorMode {\n Inverted = 'inverted',\n SameAsValue = 'same_as_value',\n Standard = 'standard',\n}\n\n/**\n * TODO -- should not be table specific!\n * TODO docs\n */\nexport type FieldTextAlignment = ('auto' | 'left' | 'right' | 'center');\n\n/**\n * Controls the value alignment in the TimelineChart component\n */\nexport type TimelineValueAlignment = ('center' | 'left' | 'right');\n\n/**\n * TODO docs\n */\nexport interface VizTextDisplayOptions {\n /**\n * Explicit percent text size\n */\n percentSize?: number;\n /**\n * Explicit title text size\n */\n titleSize?: number;\n /**\n * Explicit value text size\n */\n valueSize?: number;\n}\n\n/**\n * TODO docs\n */\nexport enum TooltipDisplayMode {\n Multi = 'multi',\n None = 'none',\n Single = 'single',\n}\n\n/**\n * TODO docs\n */\nexport enum SortOrder {\n Ascending = 'asc',\n Descending = 'desc',\n None = 'none',\n}\n\n/**\n * TODO docs\n */\nexport interface GraphFieldConfig extends LineConfig, FillConfig, PointsConfig, AxisConfig, BarConfig, StackableFieldConfig, HideableFieldConfig {\n drawStyle?: GraphDrawStyle;\n gradientMode?: GraphGradientMode;\n insertNulls?: (boolean | number);\n thresholdsStyle?: GraphThresholdsStyleConfig;\n transform?: GraphTransform;\n}\n\n/**\n * TODO docs\n */\nexport interface VizLegendOptions {\n asTable?: boolean;\n calcs: Array<string>;\n displayMode: LegendDisplayMode;\n isVisible?: boolean;\n placement: LegendPlacement;\n showLegend: boolean;\n sortBy?: string;\n sortDesc?: boolean;\n width?: number;\n}\n\nexport const defaultVizLegendOptions: Partial<VizLegendOptions> = {\n calcs: [],\n};\n\n/**\n * Enum expressing the possible display modes\n * for the bar gauge component of Grafana UI\n */\nexport enum BarGaugeDisplayMode {\n Basic = 'basic',\n Gradient = 'gradient',\n Lcd = 'lcd',\n}\n\n/**\n * Allows for the table cell gauge display type to set the gauge mode.\n */\nexport enum BarGaugeValueMode {\n Color = 'color',\n Hidden = 'hidden',\n Text = 'text',\n}\n\n/**\n * Allows for the bar gauge name to be placed explicitly\n */\nexport enum BarGaugeNamePlacement {\n Auto = 'auto',\n Hidden = 'hidden',\n Left = 'left',\n Top = 'top',\n}\n\n/**\n * Allows for the bar gauge size to be set explicitly\n */\nexport enum BarGaugeSizing {\n Auto = 'auto',\n Manual = 'manual',\n}\n\n/**\n * TODO docs\n */\nexport interface VizTooltipOptions {\n hideZeros?: boolean;\n maxHeight?: number;\n maxWidth?: number;\n mode: TooltipDisplayMode;\n sort: SortOrder;\n}\n\nexport interface Labels {}\n\n/**\n * Internally, this is the \"type\" of cell that's being displayed\n * in the table such as colored text, JSON, gauge, etc.\n * The color-background-solid, gradient-gauge, and lcd-gauge\n * modes are deprecated in favor of new cell subOptions\n */\nexport enum TableCellDisplayMode {\n Actions = 'actions',\n Auto = 'auto',\n BasicGauge = 'basic',\n ColorBackground = 'color-background',\n ColorBackgroundSolid = 'color-background-solid',\n ColorText = 'color-text',\n Custom = 'custom',\n DataLinks = 'data-links',\n Gauge = 'gauge',\n GradientGauge = 'gradient-gauge',\n Image = 'image',\n JSONView = 'json-view',\n LcdGauge = 'lcd-gauge',\n Sparkline = 'sparkline',\n}\n\n/**\n * Display mode to the \"Colored Background\" display\n * mode for table cells. Either displays a solid color (basic mode)\n * or a gradient.\n */\nexport enum TableCellBackgroundDisplayMode {\n Basic = 'basic',\n Gradient = 'gradient',\n}\n\n/**\n * Sort by field state\n */\nexport interface TableSortByFieldState {\n /**\n * Flag used to indicate descending sort order\n */\n desc?: boolean;\n /**\n * Sets the display name of the field to sort by\n */\n displayName: string;\n}\n\n/**\n * Footer options\n */\nexport interface TableFooterOptions {\n countRows?: boolean;\n enablePagination?: boolean;\n fields?: Array<string>;\n reducer: Array<string>; // actually 1 value\n show: boolean;\n}\n\nexport const defaultTableFooterOptions: Partial<TableFooterOptions> = {\n fields: [],\n reducer: [],\n};\n\n/**\n * Auto mode table cell options\n */\nexport interface TableAutoCellOptions {\n type: TableCellDisplayMode.Auto;\n wrapText?: boolean;\n}\n\n/**\n * Colored text cell options\n */\nexport interface TableColorTextCellOptions {\n type: TableCellDisplayMode.ColorText;\n wrapText?: boolean;\n}\n\n/**\n * Json view cell options\n */\nexport interface TableJsonViewCellOptions {\n type: TableCellDisplayMode.JSONView;\n}\n\n/**\n * Json view cell options\n */\nexport interface TableImageCellOptions {\n alt?: string;\n title?: string;\n type: TableCellDisplayMode.Image;\n}\n\n/**\n * Show data links in the cell\n */\nexport interface TableDataLinksCellOptions {\n type: TableCellDisplayMode.DataLinks;\n}\n\n/**\n * Show actions in the cell\n */\nexport interface TableActionsCellOptions {\n type: TableCellDisplayMode.Actions;\n}\n\n/**\n * Gauge cell options\n */\nexport interface TableBarGaugeCellOptions {\n mode?: BarGaugeDisplayMode;\n type: TableCellDisplayMode.Gauge;\n valueDisplayMode?: BarGaugeValueMode;\n}\n\n/**\n * Sparkline cell options\n */\nexport interface TableSparklineCellOptions extends GraphFieldConfig {\n hideValue?: boolean;\n type: TableCellDisplayMode.Sparkline;\n}\n\n/**\n * Colored background cell options\n */\nexport interface TableColoredBackgroundCellOptions {\n applyToRow?: boolean;\n mode?: TableCellBackgroundDisplayMode;\n type: TableCellDisplayMode.ColorBackground;\n wrapText?: boolean;\n}\n\n/**\n * Height of a table cell\n */\nexport enum TableCellHeight {\n Auto = 'auto',\n Lg = 'lg',\n Md = 'md',\n Sm = 'sm',\n}\n\n/**\n * Table cell options. Each cell has a display mode\n * and other potential options for that display.\n */\nexport type TableCellOptions = (TableAutoCellOptions | TableSparklineCellOptions | TableBarGaugeCellOptions | TableColoredBackgroundCellOptions | TableColorTextCellOptions | TableImageCellOptions | TableDataLinksCellOptions | TableActionsCellOptions | TableJsonViewCellOptions);\n\n/**\n * Use UTC/GMT timezone\n */\nexport type TimeZoneUtc = 'utc';\n\n/**\n * Use the timezone defined by end user web browser\n */\nexport type TimeZoneBrowser = 'browser';\n\n/**\n * Optional formats for the template variable replace functions\n * See also https://grafana.com/docs/grafana/latest/dashboards/variables/variable-syntax/#advanced-variable-format-options\n */\nexport enum VariableFormatID {\n CSV = 'csv',\n Date = 'date',\n Distributed = 'distributed',\n DoubleQuote = 'doublequote',\n Glob = 'glob',\n HTML = 'html',\n JSON = 'json',\n Lucene = 'lucene',\n PercentEncode = 'percentencode',\n Pipe = 'pipe',\n QueryParam = 'queryparam',\n Raw = 'raw',\n Regex = 'regex',\n SQLString = 'sqlstring',\n SingleQuote = 'singlequote',\n Text = 'text',\n UriEncode = 'uriencode',\n}\n\nexport interface DataSourceRef {\n /**\n * Datasource API version\n */\n apiVersion?: string;\n /**\n * The plugin type-id\n */\n type?: string;\n /**\n * Specific datasource instance\n */\n uid?: string;\n}\n\n/**\n * Links to a resource (image/svg path)\n */\nexport interface ResourceDimensionConfig extends BaseDimensionConfig {\n fixed?: string;\n mode: ResourceDimensionMode;\n}\n\nexport interface FrameGeometrySource {\n /**\n * Path to Gazetteer\n */\n gazetteer?: string;\n /**\n * Field mappings\n */\n geohash?: string;\n latitude?: string;\n longitude?: string;\n lookup?: string;\n mode: FrameGeometrySourceMode;\n wkt?: string;\n}\n\nexport interface HeatmapCalculationOptions {\n /**\n * The number of buckets to use for the xAxis in the heatmap\n */\n xBuckets?: HeatmapCalculationBucketConfig;\n /**\n * The number of buckets to use for the yAxis in the heatmap\n */\n yBuckets?: HeatmapCalculationBucketConfig;\n}\n\nexport enum LogsDedupStrategy {\n exact = 'exact',\n none = 'none',\n numbers = 'numbers',\n signature = 'signature',\n}\n\n/**\n * Compare two values\n */\nexport enum ComparisonOperation {\n EQ = 'eq',\n GT = 'gt',\n GTE = 'gte',\n LT = 'lt',\n LTE = 'lte',\n NEQ = 'neq',\n}\n\n/**\n * Field options for each field within a table (e.g 10, \"The String\", 64.20, etc.)\n * Generally defines alignment, filtering capabilties, display options, etc.\n */\nexport interface TableFieldOptions {\n align: FieldTextAlignment;\n cellOptions: TableCellOptions;\n /**\n * This field is deprecated in favor of using cellOptions\n */\n displayMode?: TableCellDisplayMode;\n filterable?: boolean;\n hidden?: boolean; // ?? default is missing or false ??\n /**\n * Hides any header for a column, useful for columns that show some static content or buttons.\n */\n hideHeader?: boolean;\n inspect: boolean;\n minWidth?: number;\n width?: number;\n}\n\nexport const defaultTableFieldOptions: Partial<TableFieldOptions> = {\n align: 'auto',\n inspect: false,\n};\n\n/**\n * A specific timezone from https://en.wikipedia.org/wiki/Tz_database\n */\nexport type TimeZone = (TimeZoneUtc | TimeZoneBrowser | string);\n\nexport const defaultTimeZone: TimeZone = 'browser';\n","import { css, cx } from '@emotion/css';\nimport { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react';\nimport * as React from 'react';\n\nimport { GrafanaTheme2, ThemeRichColor } from '@grafana/data';\n\nimport { useTheme2 } from '../../themes';\nimport { getFocusStyles, getMouseFocusStyles } from '../../themes/mixins';\nimport { ComponentSize, IconSize, IconType } from '../../types';\nimport { IconName } from '../../types/icon';\nimport { getPropertiesForButtonSize } from '../Forms/commonStyles';\nimport { Icon } from '../Icon/Icon';\nimport { PopoverContent, Tooltip, TooltipPlacement } from '../Tooltip';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'success';\nexport const allButtonVariants: ButtonVariant[] = ['primary', 'secondary', 'destructive'];\nexport type ButtonFill = 'solid' | 'outline' | 'text';\nexport const allButtonFills: ButtonFill[] = ['solid', 'outline', 'text'];\n\ntype CommonProps = {\n size?: ComponentSize;\n variant?: ButtonVariant;\n fill?: ButtonFill;\n icon?: IconName | React.ReactElement;\n className?: string;\n children?: React.ReactNode;\n fullWidth?: boolean;\n type?: string;\n /** Tooltip content to display on hover */\n tooltip?: PopoverContent;\n /** Position of the tooltip */\n tooltipPlacement?: TooltipPlacement;\n};\n\nexport type ButtonProps = CommonProps & ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n variant = 'primary',\n size = 'md',\n fill = 'solid',\n icon,\n fullWidth,\n children,\n className,\n type = 'button',\n tooltip,\n disabled,\n tooltipPlacement,\n onClick,\n ...otherProps\n },\n ref\n ) => {\n const theme = useTheme2();\n const styles = getButtonStyles({\n theme,\n size,\n variant,\n fill,\n fullWidth,\n iconOnly: !children,\n });\n\n const buttonStyles = cx(\n styles.button,\n {\n [styles.disabled]: disabled,\n },\n className\n );\n\n const hasTooltip = Boolean(tooltip);\n\n // In order to standardise Button please always consider using IconButton when you need a button with an icon only\n // When using tooltip, ref is forwarded to Tooltip component instead for https://github.com/grafana/grafana/issues/65632\n const button = (\n <button\n className={buttonStyles}\n type={type}\n onClick={disabled ? undefined : onClick}\n {...otherProps}\n // In order for the tooltip to be accessible when disabled,\n // we need to set aria-disabled instead of the native disabled attribute\n aria-disabled={hasTooltip && disabled}\n disabled={!hasTooltip && disabled}\n ref={tooltip ? undefined : ref}\n >\n <IconRenderer icon={icon} size={size} className={styles.icon} />\n {children && <span className={styles.content}>{children}</span>}\n </button>\n );\n\n if (tooltip) {\n return (\n <Tooltip ref={ref} content={tooltip} placement={tooltipPlacement}>\n {button}\n </Tooltip>\n );\n }\n\n return button;\n }\n);\n\nButton.displayName = 'Button';\n\nexport type ButtonLinkProps = CommonProps &\n ButtonHTMLAttributes<HTMLButtonElement> &\n AnchorHTMLAttributes<HTMLAnchorElement>;\n\nexport const LinkButton = React.forwardRef<HTMLAnchorElement, ButtonLinkProps>(\n (\n {\n variant = 'primary',\n size = 'md',\n fill = 'solid',\n icon,\n fullWidth,\n children,\n className,\n onBlur,\n onFocus,\n disabled,\n tooltip,\n tooltipPlacement,\n ...otherProps\n },\n ref\n ) => {\n const theme = useTheme2();\n const styles = getButtonStyles({\n theme,\n fullWidth,\n size,\n variant,\n fill,\n iconOnly: !children,\n });\n\n const linkButtonStyles = cx(\n styles.button,\n {\n [css(styles.disabled, {\n pointerEvents: 'none',\n })]: disabled,\n },\n className\n );\n\n // When using tooltip, ref is forwarded to Tooltip component instead for https://github.com/grafana/grafana/issues/65632\n const button = (\n <a\n className={linkButtonStyles}\n {...otherProps}\n tabIndex={disabled ? -1 : 0}\n aria-disabled={disabled}\n ref={tooltip ? undefined : ref}\n >\n <IconRenderer icon={icon} size={size} className={styles.icon} />\n {children && <span className={styles.content}>{children}</span>}\n </a>\n );\n\n if (tooltip) {\n return (\n <Tooltip ref={ref} content={tooltip} placement={tooltipPlacement}>\n {button}\n </Tooltip>\n );\n }\n\n return button;\n }\n);\n\nLinkButton.displayName = 'LinkButton';\n\ninterface IconRendererProps {\n icon?: IconName | React.ReactElement<{ className?: string; size?: IconSize }>;\n size?: IconSize;\n className?: string;\n iconType?: IconType;\n}\nexport const IconRenderer = ({ icon, size, className, iconType }: IconRendererProps) => {\n if (!icon) {\n return null;\n }\n if (React.isValidElement(icon)) {\n return React.cloneElement(icon, {\n className,\n size,\n });\n }\n return <Icon name={icon} size={size} className={className} type={iconType} />;\n};\n\nexport interface StyleProps {\n size: ComponentSize;\n variant: ButtonVariant;\n fill?: ButtonFill;\n iconOnly?: boolean;\n theme: GrafanaTheme2;\n fullWidth?: boolean;\n narrow?: boolean;\n}\n\nexport const getButtonStyles = (props: StyleProps) => {\n const { theme, variant, fill = 'solid', size, iconOnly, fullWidth } = props;\n const { height, padding, fontSize } = getPropertiesForButtonSize(size, theme);\n const variantStyles = getPropertiesForVariant(theme, variant, fill);\n const disabledStyles = getPropertiesForDisabled(theme, variant, fill);\n const focusStyle = getFocusStyles(theme);\n const paddingMinusBorder = theme.spacing.gridSize * padding - 1;\n\n return {\n button: css({\n label: 'button',\n display: 'inline-flex',\n alignItems: 'center',\n fontSize: fontSize,\n fontWeight: theme.typography.fontWeightMedium,\n fontFamily: theme.typography.fontFamily,\n padding: `0 ${paddingMinusBorder}px`,\n height: theme.spacing(height),\n // Deduct border from line-height for perfect vertical centering on windows and linux\n lineHeight: `${theme.spacing.gridSize * height - 2}px`,\n verticalAlign: 'middle',\n cursor: 'pointer',\n borderRadius: theme.shape.radius.default,\n '&:focus': focusStyle,\n '&:focus-visible': focusStyle,\n '&:focus:not(:focus-visible)': getMouseFocusStyles(theme),\n ...(fullWidth && {\n flexGrow: 1,\n justifyContent: 'center',\n }),\n ...variantStyles,\n ':disabled': disabledStyles,\n '&[disabled]': disabledStyles,\n }),\n disabled: css(disabledStyles, {\n '&:hover': css(disabledStyles),\n }),\n img: css({\n width: '16px',\n height: '16px',\n margin: theme.spacing(0, 1, 0, 0.5),\n }),\n icon: iconOnly\n ? css({\n // Important not to set margin bottom here as it would override internal icon bottom margin\n marginRight: theme.spacing(-padding / 2),\n marginLeft: theme.spacing(-padding / 2),\n })\n : css({\n marginRight: theme.spacing(padding / 2),\n }),\n content: css({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n height: '100%',\n }),\n };\n};\n\nfunction getButtonVariantStyles(theme: GrafanaTheme2, color: ThemeRichColor, fill: ButtonFill) {\n let outlineBorderColor = color.border;\n let borderColor = 'transparent';\n let hoverBorderColor = 'transparent';\n\n // Secondary button has some special rules as we lack theem color token to\n // specify border color for normal button vs border color for outline button\n if (color.name === 'secondary') {\n borderColor = color.border;\n hoverBorderColor = theme.colors.emphasize(color.border, 0.25);\n outlineBorderColor = theme.colors.border.strong;\n }\n\n if (fill === 'outline') {\n return {\n background: 'transparent',\n color: color.text,\n border: `1px solid ${outlineBorderColor}`,\n transition: theme.transitions.create(['background-color', 'border-color', 'color'], {\n duration: theme.transitions.duration.short,\n }),\n\n '&:hover': {\n background: color.transparent,\n borderColor: theme.colors.emphasize(outlineBorderColor, 0.25),\n color: color.text,\n },\n };\n }\n\n if (fill === 'text') {\n return {\n background: 'transparent',\n color: color.text,\n border: '1px solid transparent',\n transition: theme.transitions.create(['background-color', 'color'], {\n duration: theme.transitions.duration.short,\n }),\n\n '&:focus': {\n outline: 'none',\n textDecoration: 'none',\n },\n\n '&:hover': {\n background: color.transparent,\n textDecoration: 'none',\n },\n };\n }\n\n return {\n background: color.main,\n color: color.contrastText,\n border: `1px solid ${borderColor}`,\n transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color', 'color'], {\n duration: theme.transitions.duration.short,\n }),\n\n '&:hover': {\n background: color.shade,\n color: color.contrastText,\n boxShadow: theme.shadows.z1,\n borderColor: hoverBorderColor,\n },\n };\n}\n\nfunction getPropertiesForDisabled(theme: GrafanaTheme2, variant: ButtonVariant, fill: ButtonFill) {\n const disabledStyles = {\n cursor: 'not-allowed',\n boxShadow: 'none',\n color: theme.colors.text.disabled,\n transition: 'none',\n };\n\n if (fill === 'text') {\n return {\n ...disabledStyles,\n background: 'transparent',\n border: `1px solid transparent`,\n };\n }\n\n if (fill === 'outline') {\n return {\n ...disabledStyles,\n background: 'transparent',\n border: `1px solid ${theme.colors.border.weak}`,\n };\n }\n\n return {\n ...disabledStyles,\n background: theme.colors.action.disabledBackground,\n border: `1px solid transparent`,\n };\n}\n\nexport function getPropertiesForVariant(theme: GrafanaTheme2, variant: ButtonVariant, fill: ButtonFill) {\n switch (variant) {\n case 'secondary':\n // The seconday button has some special handling as it's outline border is it's default color border\n return getButtonVariantStyles(theme, theme.colors.secondary, fill);\n\n case 'destructive':\n return getButtonVariantStyles(theme, theme.colors.error, fill);\n\n case 'success':\n return getButtonVariantStyles(theme, theme.colors.success, fill);\n\n case 'primary':\n default:\n return getButtonVariantStyles(theme, theme.colors.primary, fill);\n }\n}\n\nexport const clearButtonStyles = (theme: GrafanaTheme2) => {\n return css({\n background: 'transparent',\n color: theme.colors.text.primary,\n border: 'none',\n padding: 0,\n });\n};\n\nexport const clearLinkButtonStyles = (theme: GrafanaTheme2) => {\n return css({\n background: 'transparent',\n border: 'none',\n padding: 0,\n fontFamily: 'inherit',\n color: 'inherit',\n height: '100%',\n cursor: 'context-menu',\n '&:hover': {\n background: 'transparent',\n color: 'inherit',\n },\n });\n};\n","import { css } from '@emotion/css';\n\nimport { useStyles2 } from '../../themes';\n\nimport { ErrorBoundaryApi } from './ErrorBoundary';\n\nexport interface Props extends ErrorBoundaryApi {\n title: string;\n}\n\nexport const ErrorWithStack = ({ error, errorInfo, title }: Props) => {\n const style = useStyles2(getStyles);\n\n return (\n <div className={style}>\n <h2>{title}</h2>\n <details style={{ whiteSpace: 'pre-wrap' }}>\n {error && error.toString()}\n <br />\n {errorInfo && errorInfo.componentStack}\n </details>\n </div>\n );\n};\n\nErrorWithStack.displayName = 'ErrorWithStack';\n\nconst getStyles = () => {\n return css({\n width: '500px',\n margin: '64px auto',\n });\n};\n","import { css, cx } from '@emotion/css';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { getFocusStyles } from '../../themes/mixins';\nimport { ComponentSize } from '../../types/size';\n\nexport const getFocusStyle = (theme: GrafanaTheme2) =>\n css({\n '&:focus': getFocusStyles(theme),\n });\n\nexport const sharedInputStyle = (theme: GrafanaTheme2, invalid = false) => {\n const borderColor = invalid ? theme.colors.error.border : theme.components.input.borderColor;\n const borderColorHover = invalid ? theme.colors.error.shade : theme.components.input.borderHover;\n const background = theme.components.input.background;\n const textColor = theme.components.input.text;\n\n // Cannot use our normal borders for this color for some reason due the alpha values in them.\n // Need to colors without alpha channel\n const autoFillBorder = theme.isDark ? '#2e2f35' : '#bab4ca';\n\n return cx(\n inputPadding(theme),\n css({\n background,\n lineHeight: theme.typography.body.lineHeight,\n fontSize: theme.typography.size.md,\n color: textColor,\n border: `1px solid ${borderColor}`,\n\n '&:-webkit-autofill, &:-webkit-autofill:hover': {\n /* Welcome to 2005. This is a HACK to get rid od Chromes default autofill styling */\n boxShadow: `inset 0 0 0 1px rgba(255, 255, 255, 0), inset 0 0 0 100px ${background}!important`,\n WebkitTextFillColor: `${textColor} !important`,\n borderColor: autoFillBorder,\n },\n\n '&:-webkit-autofill:focus': {\n /* Welcome to 2005. This is a HACK to get rid od Chromes default autofill styling */\n boxShadow: `0 0 0 2px ${theme.colors.background.primary}, 0 0 0px 4px ${theme.colors.primary.main}, inset 0 0 0 1px rgba(255, 255, 255, 0), inset 0 0 0 100px ${background}!important`,\n WebkitTextFillColor: `${textColor} !important`,\n },\n\n '&:hover': {\n borderColor: borderColorHover,\n },\n\n '&:focus': {\n outline: 'none',\n },\n\n '&:disabled': {\n backgroundColor: theme.colors.action.disabledBackground,\n color: theme.colors.action.disabledText,\n border: `1px solid ${theme.colors.action.disabledBackground}`,\n\n '&:hover': {\n borderColor,\n },\n },\n\n '&::placeholder': {\n color: theme.colors.text.disabled,\n opacity: 1,\n },\n })\n );\n};\n\nexport const inputPadding = (theme: GrafanaTheme2) => {\n return css({\n padding: theme.spacing(0, 1, 0, 1),\n });\n};\n\nexport const inputSizes = () => {\n return {\n sm: css({\n width: inputSizesPixels('sm'),\n }),\n md: css({\n width: inputSizesPixels('md'),\n }),\n lg: css({\n width: inputSizesPixels('lg'),\n }),\n auto: css({\n width: inputSizesPixels('auto'),\n }),\n };\n};\n\nexport const inputSizesPixels = (size: string) => {\n switch (size) {\n case 'sm':\n return '200px';\n case 'md':\n return '320px';\n case 'lg':\n return '580px';\n case 'auto':\n default:\n return 'auto';\n }\n};\n\nexport function getPropertiesForButtonSize(size: ComponentSize, theme: GrafanaTheme2) {\n switch (size) {\n case 'sm':\n return {\n padding: 1,\n fontSize: theme.typography.size.sm,\n height: theme.components.height.sm,\n };\n\n case 'lg':\n return {\n padding: 3,\n fontSize: theme.typography.size.lg,\n height: theme.components.height.lg,\n };\n case 'md':\n default:\n return {\n padding: 2,\n fontSize: theme.typography.size.md,\n height: theme.components.height.md,\n };\n }\n}\n","import { css, cx } from '@emotion/css';\nimport * as React from 'react';\nimport SVG from 'react-inlinesvg';\n\nimport { GrafanaTheme2, isIconName } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes/ThemeContext';\nimport { IconName, IconType, IconSize } from '../../types/icon';\nimport { spin } from '../../utils/keyframes';\n\nimport { getIconRoot, getIconSubDir, getSvgSize } from './utils';\n\nexport interface IconProps extends Omit<React.SVGProps<SVGElement>, 'onLoad' | 'onError' | 'ref'> {\n name: IconName;\n size?: IconSize;\n type?: IconType;\n /**\n * Give your icon a semantic meaning. The icon will be hidden from screen readers, unless this prop or an aria-label is provided.\n */\n title?: string;\n}\n\nconst getIconStyles = (theme: GrafanaTheme2) => {\n return {\n icon: css({\n display: 'inline-block',\n fill: 'currentColor',\n flexShrink: 0,\n label: 'Icon',\n // line-height: 0; is needed for correct icon alignment in Safari\n lineHeight: 0,\n verticalAlign: 'middle',\n }),\n orange: css({\n fill: theme.v1.palette.orange,\n }),\n spin: css({\n [theme.transitions.handleMotion('no-preference', 'reduce')]: {\n animation: `${spin} 2s infinite linear`,\n },\n }),\n };\n};\n\nexport const Icon = React.forwardRef<SVGElement, IconProps>(\n ({ size = 'md', type = 'default', name, className, style, title = '', ...rest }, ref) => {\n const styles = useStyles2(getIconStyles);\n\n if (!isIconName(name)) {\n console.warn('Icon component passed an invalid icon name', name);\n }\n\n // handle the deprecated 'fa fa-spinner'\n const iconName: IconName = name === 'fa fa-spinner' ? 'spinner' : name;\n\n const iconRoot = getIconRoot();\n const svgSize = getSvgSize(size);\n const svgHgt = svgSize;\n const svgWid = name.startsWith('gf-bar-align') ? 16 : name.startsWith('gf-interp') ? 30 : svgSize;\n const subDir = getIconSubDir(iconName, type);\n const svgPath = `${iconRoot}${subDir}/${iconName}.svg`;\n\n const composedClassName = cx(\n styles.icon,\n className,\n type === 'mono' ? { [styles.orange]: name === 'favorite' } : '',\n {\n [styles.spin]: iconName === 'spinner',\n }\n );\n\n return (\n <SVG\n aria-hidden={\n rest.tabIndex === undefined &&\n !title &&\n !rest['aria-label'] &&\n !rest['aria-labelledby'] &&\n !rest['aria-describedby']\n }\n innerRef={ref}\n src={svgPath}\n width={svgWid}\n height={svgHgt}\n title={title}\n className={composedClassName}\n style={style}\n // render an empty div with the correct dimensions while loading\n // this prevents content layout shift whilst the icon asynchronously loads\n // which happens even if the icon is in the cache(!)\n loader={\n <div\n className={cx(\n css({\n width: svgWid,\n height: svgHgt,\n }),\n composedClassName\n )}\n />\n }\n {...rest}\n />\n );\n }\n);\n\nIcon.displayName = 'Icon';\n","import { IconName, IconSize, IconType } from '../../types/icon';\n\nconst alwaysMonoIcons: IconName[] = [\n 'grafana',\n 'favorite',\n 'heart-break',\n 'heart',\n 'panel-add',\n 'library-panel',\n 'circle-mono',\n];\n\nexport function getIconSubDir(name: IconName, type: IconType): string {\n if (name?.startsWith('gf-')) {\n return 'custom';\n } else if (alwaysMonoIcons.includes(name)) {\n return 'mono';\n } else if (type === 'default') {\n return 'unicons';\n } else if (type === 'solid') {\n return 'solid';\n } else {\n return 'mono';\n }\n}\n\n/* Transform string with px to number and add 2 pxs as path in svg is 2px smaller */\nexport function getSvgSize(size: IconSize) {\n switch (size) {\n case 'xs':\n return 12;\n case 'sm':\n return 14;\n case 'md':\n return 16;\n case 'lg':\n return 18;\n case 'xl':\n return 24;\n case 'xxl':\n return 36;\n case 'xxxl':\n return 48;\n }\n}\n\nlet iconRoot: string | undefined;\n\nexport function getIconRoot(): string {\n if (iconRoot) {\n return iconRoot;\n }\n\n const grafanaPublicPath = typeof window !== 'undefined' && window.__grafana_public_path__;\n if (grafanaPublicPath) {\n iconRoot = grafanaPublicPath + 'img/icons/';\n } else {\n iconRoot = 'public/img/icons/';\n }\n\n return iconRoot;\n}\n","import { css, cx } from '@emotion/css';\nimport * as React from 'react';\n\nimport { GrafanaTheme2, colorManipulator, deprecationWarning } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes';\nimport { getFocusStyles, getMouseFocusStyles } from '../../themes/mixins';\nimport { ComponentSize } from '../../types';\nimport { IconName, IconSize, IconType } from '../../types/icon';\nimport { IconRenderer } from '../Button';\nimport { getSvgSize } from '../Icon/utils';\nimport { TooltipPlacement, PopoverContent, Tooltip } from '../Tooltip';\n\nexport type IconButtonVariant = 'primary' | 'secondary' | 'destructive';\n\ntype LimitedIconSize = ComponentSize | 'xl';\n\ninterface BaseProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'aria-label'> {\n /** Name of the icon **/\n name: IconName;\n /** Icon size - sizes xxl and xxxl are deprecated and when used being decreased to xl*/\n size?: IconSize;\n /** Type of the icon - mono or default */\n iconType?: IconType;\n /** Variant to change the color of the Icon */\n variant?: IconButtonVariant;\n}\n\nexport interface BasePropsWithTooltip extends BaseProps {\n /** Tooltip content to display on hover and as the aria-label */\n tooltip: PopoverContent;\n /** Position of the tooltip */\n tooltipPlacement?: TooltipPlacement;\n}\n\ninterface BasePropsWithAriaLabel extends BaseProps {\n /** @deprecated use aria-label instead*/\n ariaLabel?: string;\n /** Text available only for screen readers. No tooltip will be set in this case. */\n ['aria-label']: string;\n}\n\nexport type Props = BasePropsWithTooltip | BasePropsWithAriaLabel;\n\nexport const IconButton = React.forwardRef<HTMLButtonElement, Props>((props, ref) => {\n const { size = 'md', variant = 'secondary' } = props;\n let limitedIconSize: LimitedIconSize;\n\n // very large icons (xl to xxxl) are unified to size xl\n if (size === 'xxl' || size === 'xxxl') {\n deprecationWarning('IconButton', 'size=\"xxl\" and size=\"xxxl\"', 'size=\"xl\"');\n limitedIconSize = 'xl';\n } else {\n limitedIconSize = size;\n }\n\n const styles = useStyles2(getStyles, limitedIconSize, variant);\n\n let ariaLabel: string | undefined;\n let buttonRef: typeof ref | undefined;\n\n if ('tooltip' in props) {\n const { tooltip } = props;\n ariaLabel = typeof tooltip === 'string' ? tooltip : undefined;\n } else if ('ariaLabel' in props || 'aria-label' in props) {\n const { ariaLabel: deprecatedAriaLabel, ['aria-label']: ariaLabelProp } = props;\n ariaLabel = ariaLabelProp || deprecatedAriaLabel;\n buttonRef = ref;\n }\n\n // When using tooltip, ref is forwarded to Tooltip component instead for https://github.com/grafana/grafana/issues/65632\n if ('tooltip' in props) {\n const { name, iconType, className, tooltip, tooltipPlacement, ...restProps } = props;\n return (\n <Tooltip ref={ref} content={tooltip} placement={tooltipPlacement}>\n <button\n {...restProps}\n ref={buttonRef}\n aria-label={ariaLabel}\n className={cx(styles.button, className)}\n type=\"button\"\n >\n <IconRenderer icon={name} size={limitedIconSize} className={styles.icon} iconType={iconType} />\n </button>\n </Tooltip>\n );\n } else {\n const { name, iconType, className, ...restProps } = props;\n return (\n <button\n {...restProps}\n ref={buttonRef}\n aria-label={ariaLabel}\n className={cx(styles.button, className)}\n type=\"button\"\n >\n <IconRenderer icon={name} size={limitedIconSize} className={styles.icon} iconType={iconType} />\n </button>\n );\n }\n});\n\nIconButton.displayName = 'IconButton';\n\nconst getStyles = (theme: GrafanaTheme2, size: IconSize, variant: IconButtonVariant) => {\n // overall size of the IconButton on hover\n // theme.spacing.gridSize originates from 2*4px for padding and letting the IconSize generally decide on the hoverSize\n const hoverSize = getSvgSize(size) + theme.spacing.gridSize;\n\n let iconColor = theme.colors.text.primary;\n\n if (variant === 'primary') {\n iconColor = theme.colors.primary.text;\n } else if (variant === 'destructive') {\n iconColor = theme.colors.error.text;\n }\n\n return {\n button: css({\n zIndex: 0,\n position: 'relative',\n margin: `0 ${theme.spacing.x0_5} 0 0`,\n boxShadow: 'none',\n border: 'none',\n display: 'inline-flex',\n background: 'transparent',\n justifyContent: 'center',\n alignItems: 'center',\n padding: 0,\n color: iconColor,\n\n '&[disabled], &:disabled': {\n cursor: 'not-allowed',\n color: theme.colors.action.disabledText,\n opacity: 0.65,\n },\n\n '&:before': {\n zIndex: -1,\n position: 'absolute',\n opacity: 0,\n width: `${hoverSize}px`,\n height: `${hoverSize}px`,\n borderRadius: theme.shape.radius.default,\n content: '\"\"',\n [theme.transitions.handleMotion('no-preference', 'reduce')]: {\n transitionDuration: '0.2s',\n transitionTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)',\n transitionProperty: 'opacity',\n },\n },\n\n '&:focus, &:focus-visible': getFocusStyles(theme),\n\n '&:focus:not(:focus-visible)': getMouseFocusStyles(theme),\n\n '&:hover': {\n '&:before': {\n backgroundColor:\n variant === 'secondary' ? theme.colors.action.hover : colorManipulator.alpha(iconColor, 0.12),\n opacity: 1,\n },\n },\n }),\n icon: css({\n verticalAlign: 'baseline',\n }),\n };\n};\n","import React from 'react';\n\n// Used to tell Input to increase the width properly of the input to fit the text.\n// See comment in Input.tsx for more details\nexport const AutoSizeInputContext = React.createContext(false);\nAutoSizeInputContext.displayName = 'AutoSizeInputContext';\n","import { css, cx } from '@emotion/css';\nimport { forwardRef, HTMLProps, ReactNode, useContext } from 'react';\nimport useMeasure from 'react-use/lib/useMeasure';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { stylesFactory, useTheme2 } from '../../themes';\nimport { getFocusStyle, sharedInputStyle } from '../Forms/commonStyles';\nimport { Spinner } from '../Spinner/Spinner';\n\nimport { AutoSizeInputContext } from './AutoSizeInputContext';\n\nexport interface Props extends Omit<HTMLProps<HTMLInputElement>, 'prefix' | 'size'> {\n /** Sets the width to a multiple of 8px. Should only be used with inline forms. Setting width of the container is preferred in other cases.*/\n width?: number;\n /** Show an invalid state around the input */\n invalid?: boolean;\n /** Show an icon as a prefix in the input */\n prefix?: ReactNode;\n /** Show an icon as a suffix in the input */\n suffix?: ReactNode;\n /** Show a loading indicator as a suffix in the input */\n loading?: boolean;\n /** Add a component as an addon before the input */\n addonBefore?: ReactNode;\n /** Add a component as an addon after the input */\n addonAfter?: ReactNode;\n}\n\ninterface StyleDeps {\n theme: GrafanaTheme2;\n invalid?: boolean;\n width?: number;\n}\n\nexport const Input = forwardRef<HTMLInputElement, Props>((props, ref) => {\n const {\n className,\n addonAfter,\n addonBefore,\n prefix,\n suffix: suffixProp,\n invalid,\n loading,\n width = 0,\n ...restProps\n } = props;\n /**\n * Prefix & suffix are positioned absolutely within inputWrapper. We use client rects below to apply correct padding to the input\n * when prefix/suffix is larger than default (28px = 16px(icon) + 12px(left/right paddings)).\n * Thanks to that prefix/suffix do not overflow the input element itself.\n */\n const [prefixRef, prefixRect] = useMeasure<HTMLDivElement>();\n const [suffixRef, suffixRect] = useMeasure<HTMLDivElement>();\n\n // Yes, this is gross - When Input is being wrapped by AutoSizeInput, add the suffix/prefix width to the overall width\n // so the text content is not clipped. The intention is to make all the input's text appear without overflow/clipping,\n // which isn't normally how width is used in this component.\n // This behaviour is not controlled via a prop so we can limit API surface, and remove this as a 'breaking change' later\n // if a better solution is found.\n const isInAutoSizeInput = useContext(AutoSizeInputContext);\n const accessoriesWidth = (prefixRect.width || 0) + (suffixRect.width || 0);\n const autoSizeWidth = isInAutoSizeInput && width ? width + accessoriesWidth / 8 : undefined;\n\n const theme = useTheme2();\n\n // Don't pass the width prop, as this causes an unnecessary amount of Emotion calls when auto sizing\n const styles = getInputStyles({ theme, invalid: !!invalid, width: autoSizeWidth ? undefined : width });\n\n const suffix = suffixProp || (loading && <Spinner inline={true} />);\n\n return (\n <div\n className={cx(styles.wrapper, className)}\n // If the component is in an AutoSizeInput, set the width here to prevent emotion doing stuff\n // on every keypress\n style={autoSizeWidth ? { width: theme.spacing(autoSizeWidth) } : undefined}\n data-testid=\"input-wrapper\"\n >\n {!!addonBefore && <div className={styles.addon}>{addonBefore}</div>}\n <div className={styles.inputWrapper}>\n {prefix && (\n <div className={styles.prefix} ref={prefixRef}>\n {prefix}\n </div>\n )}\n\n <input\n ref={ref}\n className={styles.input}\n {...restProps}\n style={{\n paddingLeft: prefix ? prefixRect.width + 12 : undefined,\n paddingRight: suffix || loading ? suffixRect.width + 12 : undefined,\n }}\n />\n\n {suffix && (\n <div className={styles.suffix} ref={suffixRef}>\n {suffix}\n </div>\n )}\n </div>\n {!!addonAfter && <div className={styles.addon}>{addonAfter}</div>}\n </div>\n );\n});\n\nInput.displayName = 'Input';\n\nexport const getInputStyles = stylesFactory(({ theme, invalid = false, width }: StyleDeps) => {\n const prefixSuffixStaticWidth = '28px';\n const prefixSuffix = css({\n position: 'absolute',\n top: 0,\n zIndex: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexGrow: 0,\n flexShrink: 0,\n fontSize: theme.typography.size.md,\n height: '100%',\n /* Min width specified for prefix/suffix classes used outside React component*/\n minWidth: prefixSuffixStaticWidth,\n color: theme.colors.text.secondary,\n });\n\n return {\n // Wraps inputWrapper and addons\n wrapper: cx(\n css({\n label: 'input-wrapper',\n display: 'flex',\n width: width ? theme.spacing(width) : '100%',\n height: theme.spacing(theme.components.height.md),\n borderRadius: theme.shape.radius.default,\n '&:hover': {\n '> .prefix, .suffix, .input': {\n borderColor: invalid ? theme.colors.error.border : theme.colors.primary.border,\n },\n\n // only show number buttons on hover\n \"input[type='number']\": {\n appearance: 'textfield',\n },\n\n \"input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button\": {\n // Need type assertion here due to the use of !important\n // see https://github.com/frenic/csstype/issues/114#issuecomment-697201978\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n WebkitAppearance: 'inner-spin-button !important' as 'inner-spin-button',\n opacity: 1,\n },\n },\n })\n ),\n // Wraps input and prefix/suffix\n inputWrapper: css({\n label: 'input-inputWrapper',\n position: 'relative',\n flexGrow: 1,\n /* we want input to be above addons, especially for focused state */\n zIndex: 1,\n\n /* when input rendered with addon before only*/\n '&:not(:first-child):last-child': {\n '> input': {\n borderLeft: 'none',\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n },\n\n /* when input rendered with addon after only*/\n '&:first-child:not(:last-child)': {\n '> input': {\n borderRight: 'none',\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n },\n\n /* when rendered with addon before and after */\n '&:not(:first-child):not(:last-child)': {\n '> input': {\n borderRight: 'none',\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n },\n\n input: {\n /* paddings specified for classes used outside React component */\n '&:not(:first-child)': {\n paddingLeft: prefixSuffixStaticWidth,\n },\n '&:not(:last-child)': {\n paddingRight: prefixSuffixStaticWidth,\n },\n '&[readonly]': {\n cursor: 'default',\n },\n },\n }),\n\n input: cx(\n getFocusStyle(theme),\n sharedInputStyle(theme, invalid),\n css({\n label: 'input-input',\n position: 'relative',\n zIndex: 0,\n flexGrow: 1,\n borderRadius: theme.shape.radius.default,\n height: '100%',\n width: '100%',\n })\n ),\n inputDisabled: css({\n backgroundColor: theme.colors.action.disabledBackground,\n color: theme.colors.action.disabledText,\n border: `1px solid ${theme.colors.action.disabledBackground}`,\n '&:focus': {\n boxShadow: 'none',\n },\n }),\n addon: css({\n label: 'input-addon',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n flexGrow: 0,\n flexShrink: 0,\n position: 'relative',\n\n '&:first-child': {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n '> :last-child': {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n },\n\n '&:last-child': {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n '> :first-child': {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n },\n '> *:focus': {\n /* we want anything that has focus and is an addon to be above input */\n zIndex: 2,\n },\n }),\n prefix: cx(\n prefixSuffix,\n css({\n label: 'input-prefix',\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(0.5),\n borderRight: 'none',\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n })\n ),\n suffix: cx(\n prefixSuffix,\n css({\n label: 'input-suffix',\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(1),\n marginBottom: '-2px',\n borderLeft: 'none',\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n right: 0,\n })\n ),\n loadingIndicator: css({\n '& + *': {\n marginLeft: theme.spacing(0.5),\n },\n }),\n };\n});\n","import { css, cx } from '@emotion/css';\nimport { Property } from 'csstype';\nimport { ElementType, forwardRef, PropsWithChildren } from 'react';\nimport * as React from 'react';\n\nimport { GrafanaTheme2, ThemeSpacingTokens, ThemeShape, ThemeShadows } from '@grafana/data';\n\nimport { useStyles2 } from '../../../themes';\nimport { AlignItems, Direction, FlexProps, JustifyContent } from '../types';\nimport { ResponsiveProp, getResponsiveStyle } from '../utils/responsiveness';\nimport { getSizeStyles, SizeProps } from '../utils/styles';\n\ntype Display = 'flex' | 'block' | 'inline' | 'inline-block' | 'none';\nexport type BackgroundColor = keyof GrafanaTheme2['colors']['background'] | 'error' | 'success' | 'warning' | 'info';\nexport type BorderStyle = 'solid' | 'dashed';\nexport type BorderColor = keyof GrafanaTheme2['colors']['border'] | 'error' | 'success' | 'warning' | 'info';\nexport type BorderRadius = keyof ThemeShape['radius'];\nexport type BoxShadow = keyof ThemeShadows;\n\nexport interface BoxProps extends FlexProps, SizeProps, Omit<React.HTMLAttributes<HTMLElement>, 'className' | 'style'> {\n // Margin props\n /** Sets the property `margin` */\n margin?: ResponsiveProp<ThemeSpacingTokens>;\n /** Sets the properties `margin-top` and `margin-bottom`. Higher priority than margin. */\n marginX?: ResponsiveProp<ThemeSpacingTokens>;\n /** Sets the properties `margin-left` and `margin-right`. Higher priority than margin. */\n marginY?: ResponsiveProp<ThemeSpacingTokens>;\n /** Sets the property `margin-top`. Higher priority than margin and marginY. */\n marginTop?: ResponsiveProp<ThemeSpacingTokens>;\n /** Sets the property `margin-bottom`. Higher priority than margin and marginXY */\n marginBottom?: ResponsiveProp<ThemeSpacingTokens>;\n /** Sets the property `margin-left`. Higher priority than margin and marginX. */\n marginLeft?: ResponsiveProp<ThemeSpacingTokens>;\n /** Sets the property `margin-right`. Higher priority than margin and marginX. */\n marginRight?: ResponsiveProp<ThemeSpacingTokens>;\n\n // Padding props\n /** Sets the property `padding` */\n padding?: ResponsiveProp<ThemeSpacingTokens>;\n /** Sets the properties `padding-top` and `padding-bottom`. Higher priority than padding. */\n paddingX?: ResponsiveProp<ThemeSpacingTokens>;\n /** Sets the properties `padding-left` and `padding-right`. Higher priority than padding. */\n paddingY?: ResponsiveProp<ThemeSpacingTokens>;\n /** Sets the property `padding-top`. Higher priority than padding and paddingY. */\n paddingTop?: ResponsiveProp<ThemeSpacingTokens>;\n /** Sets the property `padding-bottom`. Higher priority than padding and paddingY. */\n paddingBottom?: ResponsiveProp<ThemeSpacingTokens>;\n /** Sets the property `padding-left`. Higher priority than padding and paddingX. */\n paddingLeft?: ResponsiveProp<ThemeSpacingTokens>;\n /** Sets the property `padding-right`. Higher priority than padding and paddingX. */\n paddingRight?: ResponsiveProp<ThemeSpacingTokens>;\n\n // Border Props\n borderStyle?: ResponsiveProp<BorderStyle>;\n borderColor?: ResponsiveProp<BorderColor>;\n borderRadius?: ResponsiveProp<BorderRadius>;\n\n // Flex Props\n alignItems?: ResponsiveProp<AlignItems>;\n direction?: ResponsiveProp<Direction>;\n justifyContent?: ResponsiveProp<JustifyContent>;\n gap?: ResponsiveProp<ThemeSpacingTokens>;\n\n // Other props\n backgroundColor?: ResponsiveProp<BackgroundColor>;\n display?: ResponsiveProp<Display>;\n boxShadow?: ResponsiveProp<BoxShadow>;\n /** Sets the HTML element that will be rendered as a Box. Defaults to 'div' */\n element?: ElementType;\n position?: ResponsiveProp<Property.Position>;\n}\n\nexport const Box = forwardRef<HTMLElement, PropsWithChildren<BoxProps>>((props, ref) => {\n const {\n children,\n margin,\n marginX,\n marginY,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n padding,\n paddingX,\n paddingY,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n display,\n backgroundColor,\n grow,\n shrink,\n basis,\n flex,\n borderColor,\n borderStyle,\n borderRadius,\n direction,\n justifyContent,\n alignItems,\n boxShadow,\n element,\n gap,\n width,\n minWidth,\n maxWidth,\n height,\n minHeight,\n maxHeight,\n position,\n ...rest\n } = props;\n const styles = useStyles2(\n getStyles,\n margin,\n marginX,\n marginY,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n padding,\n paddingX,\n paddingY,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n display,\n backgroundColor,\n grow,\n shrink,\n basis,\n flex,\n borderColor,\n borderStyle,\n borderRadius,\n direction,\n justifyContent,\n alignItems,\n boxShadow,\n gap,\n position\n );\n const sizeStyles = useStyles2(getSizeStyles, width, minWidth, maxWidth, height, minHeight, maxHeight);\n const Element = element ?? 'div';\n\n return (\n <Element ref={ref} className={cx(styles.root, sizeStyles)} {...rest}>\n {children}\n </Element>\n );\n});\n\nBox.displayName = 'Box';\n\nconst customBorderColor = (color: BorderColor, theme: GrafanaTheme2) => {\n switch (color) {\n case 'error':\n case 'success':\n case 'info':\n case 'warning':\n return theme.colors[color].borderTransparent;\n default:\n return color ? theme.colors.border[color] : undefined;\n }\n};\n\nconst customBackgroundColor = (color: BackgroundColor, theme: GrafanaTheme2) => {\n switch (color) {\n case 'error':\n case 'success':\n case 'info':\n case 'warning':\n return theme.colors[color].transparent;\n default:\n return color ? theme.colors.background[color] : undefined;\n }\n};\n\nconst getStyles = (\n theme: GrafanaTheme2,\n margin: BoxProps['margin'],\n marginX: BoxProps['marginX'],\n marginY: BoxProps['marginY'],\n marginTop: BoxProps['marginTop'],\n marginBottom: BoxProps['marginBottom'],\n marginLeft: BoxProps['marginLeft'],\n marginRight: BoxProps['marginRight'],\n padding: BoxProps['padding'],\n paddingX: BoxProps['paddingX'],\n paddingY: BoxProps['paddingY'],\n paddingTop: BoxProps['paddingTop'],\n paddingBottom: BoxProps['paddingBottom'],\n paddingLeft: BoxProps['paddingLeft'],\n paddingRight: BoxProps['paddingRight'],\n display: BoxProps['display'],\n backgroundColor: BoxProps['backgroundColor'],\n grow: BoxProps['grow'],\n shrink: BoxProps['shrink'],\n basis: BoxProps['basis'],\n flex: BoxProps['flex'],\n borderColor: BoxProps['borderColor'],\n borderStyle: BoxProps['borderStyle'],\n borderRadius: BoxProps['borderRadius'],\n direction: BoxProps['direction'],\n justifyContent: BoxProps['justifyContent'],\n alignItems: BoxProps['alignItems'],\n boxShadow: BoxProps['boxShadow'],\n gap: BoxProps['gap'],\n position: BoxProps['position']\n) => {\n return {\n root: css([\n getResponsiveStyle(theme, margin, (val) => ({\n margin: theme.spacing(val),\n })),\n getResponsiveStyle(theme, marginX, (val) => ({\n marginLeft: theme.spacing(val),\n marginRight: theme.spacing(val),\n })),\n getResponsiveStyle(theme, marginY, (val) => ({\n marginTop: theme.spacing(val),\n marginBottom: theme.spacing(val),\n })),\n getResponsiveStyle(theme, marginTop, (val) => ({\n marginTop: theme.spacing(val),\n })),\n getResponsiveStyle(theme, marginBottom, (val) => ({\n marginBottom: theme.spacing(val),\n })),\n getResponsiveStyle(theme, marginLeft, (val) => ({\n marginLeft: theme.spacing(val),\n })),\n getResponsiveStyle(theme, marginRight, (val) => ({\n marginRight: theme.spacing(val),\n })),\n getResponsiveStyle(theme, padding, (val) => ({\n padding: theme.spacing(val),\n })),\n getResponsiveStyle(theme, paddingX, (val) => ({\n paddingLeft: theme.spacing(val),\n paddingRight: theme.spacing(val),\n })),\n getResponsiveStyle(theme, paddingY, (val) => ({\n paddingTop: theme.spacing(val),\n paddingBottom: theme.spacing(val),\n })),\n getResponsiveStyle(theme, paddingTop, (val) => ({\n paddingTop: theme.spacing(val),\n })),\n getResponsiveStyle(theme, paddingBottom, (val) => ({\n paddingBottom: theme.spacing(val),\n })),\n getResponsiveStyle(theme, paddingLeft, (val) => ({\n paddingLeft: theme.spacing(val),\n })),\n getResponsiveStyle(theme, paddingRight, (val) => ({\n paddingRight: theme.spacing(val),\n })),\n getResponsiveStyle(theme, display, (val) => ({\n display: val,\n })),\n getResponsiveStyle(theme, backgroundColor, (val) => ({\n backgroundColor: customBackgroundColor(val, theme),\n })),\n getResponsiveStyle(theme, direction, (val) => ({\n flexDirection: val,\n })),\n getResponsiveStyle(theme, grow, (val) => ({\n flexGrow: val,\n })),\n getResponsiveStyle(theme, shrink, (val) => ({\n flexShrink: val,\n })),\n getResponsiveStyle(theme, basis, (val) => ({\n flexBasis: val,\n })),\n getResponsiveStyle(theme, flex, (val) => ({\n flex: val,\n })),\n getResponsiveStyle(theme, borderStyle, (val) => ({\n borderStyle: val,\n })),\n getResponsiveStyle(theme, borderColor, (val) => ({\n borderColor: customBorderColor(val, theme),\n })),\n (borderStyle || borderColor) && {\n borderWidth: '1px',\n },\n getResponsiveStyle(theme, justifyContent, (val) => ({\n justifyContent: val,\n })),\n getResponsiveStyle(theme, alignItems, (val) => ({\n alignItems: val,\n })),\n getResponsiveStyle(theme, borderRadius, (val) => ({\n borderRadius: theme.shape.radius[val],\n })),\n getResponsiveStyle(theme, boxShadow, (val) => ({\n boxShadow: theme.shadows[val],\n })),\n getResponsiveStyle(theme, gap, (val) => ({\n gap: theme.spacing(val),\n })),\n getResponsiveStyle(theme, position, (val) => ({\n position: val,\n })),\n ]),\n };\n};\n","import { css, cx } from '@emotion/css';\nimport * as React from 'react';\n\nimport { GrafanaTheme2, ThemeSpacingTokens } from '@grafana/data';\n\nimport { useStyles2 } from '../../../themes';\nimport { AlignItems, Direction, FlexProps, JustifyContent, Wrap } from '../types';\nimport { ResponsiveProp, getResponsiveStyle } from '../utils/responsiveness';\nimport { getSizeStyles, SizeProps } from '../utils/styles';\n\ninterface StackProps extends FlexProps, SizeProps, Omit<React.HTMLAttributes<HTMLElement>, 'className' | 'style'> {\n gap?: ResponsiveProp<ThemeSpacingTokens>;\n alignItems?: ResponsiveProp<AlignItems>;\n justifyContent?: ResponsiveProp<JustifyContent>;\n direction?: ResponsiveProp<Direction>;\n wrap?: ResponsiveProp<Wrap>;\n children?: React.ReactNode;\n}\n\nexport const Stack = React.forwardRef<HTMLDivElement, StackProps>((props, ref) => {\n const {\n gap = 1,\n alignItems,\n justifyContent,\n direction,\n wrap,\n children,\n grow,\n shrink,\n basis,\n flex,\n width,\n minWidth,\n maxWidth,\n height,\n minHeight,\n maxHeight,\n ...rest\n } = props;\n const styles = useStyles2(getStyles, gap, alignItems, justifyContent, direction, wrap, grow, shrink, basis, flex);\n const sizeStyles = useStyles2(getSizeStyles, width, minWidth, maxWidth, height, minHeight, maxHeight);\n return (\n <div ref={ref} className={cx(styles.flex, sizeStyles)} {...rest}>\n {children}\n </div>\n );\n});\n\nStack.displayName = 'Stack';\n\nconst getStyles = (\n theme: GrafanaTheme2,\n gap: StackProps['gap'],\n alignItems: StackProps['alignItems'],\n justifyContent: StackProps['justifyContent'],\n direction: StackProps['direction'],\n wrap: StackProps['wrap'],\n grow: StackProps['grow'],\n shrink: StackProps['shrink'],\n basis: StackProps['basis'],\n flex: StackProps['flex']\n) => {\n return {\n flex: css([\n {\n display: 'flex',\n },\n getResponsiveStyle(theme, direction, (val) => ({\n flexDirection: val,\n })),\n getResponsiveStyle(theme, wrap, (val) => ({\n flexWrap: typeof val === 'boolean' ? (val ? 'wrap' : 'nowrap') : val,\n })),\n getResponsiveStyle(theme, alignItems, (val) => ({\n alignItems: val,\n })),\n getResponsiveStyle(theme, justifyContent, (val) => ({\n justifyContent: val,\n })),\n getResponsiveStyle(theme, gap, (val) => ({\n gap: theme.spacing(val),\n })),\n getResponsiveStyle(theme, grow, (val) => ({\n flexGrow: val,\n })),\n getResponsiveStyle(theme, shrink, (val) => ({\n flexShrink: val,\n })),\n getResponsiveStyle(theme, basis, (val) => ({\n flexBasis: val,\n })),\n getResponsiveStyle(theme, flex, (val) => ({\n flex: val,\n })),\n ]),\n };\n};\n","import { CSSInterpolation } from '@emotion/serialize';\n\nimport { GrafanaTheme2, ThemeBreakpointsKey } from '@grafana/data';\n\n/**\n * Type that represents a prop that can be responsive.\n *\n * @example To turn a prop like `margin: number` responsive, change it to `margin: ResponsiveProp<number>`.\n */\nexport type ResponsiveProp<T> = T | Responsive<T>;\n\ntype Responsive<T> = {\n xs: T;\n sm?: T;\n md?: T;\n lg?: T;\n xl?: T;\n xxl?: T;\n};\n\nfunction breakpointCSS<T>(\n theme: GrafanaTheme2,\n prop: Responsive<T>,\n getCSS: (val: T) => CSSInterpolation,\n key: ThemeBreakpointsKey\n) {\n const value = prop[key];\n if (value !== undefined && value !== null) {\n return {\n [theme.breakpoints.up(key)]: getCSS(value),\n };\n }\n return;\n}\n/**\n * Function that converts a ResponsiveProp object into CSS\n *\n * @param theme Grafana theme object\n * @param prop Prop as it is passed to the component\n * @param getCSS Function that returns the css block for the prop\n * @returns The CSS block repeated for each breakpoint\n *\n * @example To get the responsive css equivalent of `margin && { margin }`, you can write `getResponsiveStyle(theme, margin, (val) => { margin: val })`\n */\nexport function getResponsiveStyle<T>(\n theme: GrafanaTheme2,\n prop: ResponsiveProp<T> | undefined,\n getCSS: (val: T) => CSSInterpolation\n): CSSInterpolation {\n if (prop === undefined || prop === null) {\n return null;\n }\n if (typeof prop !== 'object' || !('xs' in prop)) {\n return getCSS(prop);\n }\n\n return [\n breakpointCSS(theme, prop, getCSS, 'xs'),\n breakpointCSS(theme, prop, getCSS, 'sm'),\n breakpointCSS(theme, prop, getCSS, 'md'),\n breakpointCSS(theme, prop, getCSS, 'lg'),\n breakpointCSS(theme, prop, getCSS, 'xl'),\n breakpointCSS(theme, prop, getCSS, 'xxl'),\n ];\n}\n","import { css } from '@emotion/css';\nimport { Property } from 'csstype';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { getResponsiveStyle, ResponsiveProp } from './responsiveness';\n\nexport interface SizeProps {\n minWidth?: ResponsiveProp<Property.MinWidth<number>>;\n maxWidth?: ResponsiveProp<Property.MaxWidth<number>>;\n width?: ResponsiveProp<Property.Width<number>>;\n\n minHeight?: ResponsiveProp<Property.MinHeight<number>>;\n maxHeight?: ResponsiveProp<Property.MaxHeight<number>>;\n height?: ResponsiveProp<Property.Height<number>>;\n}\nexport const getSizeStyles = (\n theme: GrafanaTheme2,\n width: SizeProps['width'],\n minWidth: SizeProps['minWidth'],\n maxWidth: SizeProps['maxWidth'],\n height: SizeProps['height'],\n minHeight: SizeProps['minHeight'],\n maxHeight: SizeProps['maxHeight']\n) => {\n return css([\n getResponsiveStyle(theme, width, (val) => ({\n width: theme.spacing(val),\n })),\n getResponsiveStyle(theme, minWidth, (val) => ({\n minWidth: theme.spacing(val),\n })),\n getResponsiveStyle(theme, maxWidth, (val) => ({\n maxWidth: theme.spacing(val),\n })),\n getResponsiveStyle(theme, height, (val) => ({\n height: theme.spacing(val),\n })),\n getResponsiveStyle(theme, minHeight, (val) => ({\n minHeight: theme.spacing(val),\n })),\n getResponsiveStyle(theme, maxHeight, (val) => ({\n maxHeight: theme.spacing(val),\n })),\n ]);\n};\n","import { css, cx } from '@emotion/css';\nimport { HTMLAttributes } from 'react';\nimport * as React from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes';\nimport { Spinner } from '../Spinner/Spinner';\n\n/**\n * @public\n */\nexport interface LoadingPlaceholderProps extends HTMLAttributes<HTMLDivElement> {\n text: React.ReactNode;\n}\n\n/**\n * @public\n */\nexport const LoadingPlaceholder = ({ text, className, ...rest }: LoadingPlaceholderProps) => {\n const styles = useStyles2(getStyles);\n return (\n <div className={cx(styles.container, className)} {...rest}>\n {text} <Spinner inline={true} />\n </div>\n );\n};\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n container: css({\n marginBottom: theme.spacing(4),\n }),\n };\n};\n","import type * as monacoType from 'monaco-editor/esm/vs/editor/editor.api';\n\nimport { CodeEditorSuggestionItem, CodeEditorSuggestionItemKind, CodeEditorSuggestionProvider, Monaco } from './types';\n\n/**\n * @internal -- only exported for tests\n */\nexport function findInsertIndex(line: string): { index: number; prefix: string } {\n for (let i = line.length - 1; i > 0; i--) {\n const ch = line.charAt(i);\n if (ch === '$') {\n return {\n index: i,\n prefix: line.substring(i),\n };\n }\n\n // Keep these seperators\n if (ch === ' ' || ch === '\\t' || ch === '\"' || ch === \"'\") {\n return {\n index: i + 1,\n prefix: line.substring(i + 1),\n };\n }\n }\n return {\n index: 0,\n prefix: line,\n };\n}\n\nfunction getCompletionItems(\n monaco: Monaco,\n prefix: string,\n suggestions: CodeEditorSuggestionItem[],\n range: monacoType.IRange\n): monacoType.languages.CompletionItem[] {\n const items: monacoType.languages.CompletionItem[] = [];\n for (const suggestion of suggestions) {\n if (prefix && !suggestion.label.startsWith(prefix)) {\n continue; // skip non-matching suggestions\n }\n\n items.push({\n ...suggestion,\n kind: mapKinds(monaco, suggestion.kind),\n range,\n insertText: suggestion.insertText ?? suggestion.label,\n });\n }\n return items;\n}\n\nfunction mapKinds(monaco: Monaco, sug?: CodeEditorSuggestionItemKind): monacoType.languages.CompletionItemKind {\n switch (sug) {\n case CodeEditorSuggestionItemKind.Method:\n return monaco.languages.CompletionItemKind.Method;\n case CodeEditorSuggestionItemKind.Field:\n return monaco.languages.CompletionItemKind.Field;\n case CodeEditorSuggestionItemKind.Property:\n return monaco.languages.CompletionItemKind.Property;\n case CodeEditorSuggestionItemKind.Constant:\n return monaco.languages.CompletionItemKind.Constant;\n case CodeEditorSuggestionItemKind.Text:\n return monaco.languages.CompletionItemKind.Text;\n }\n return monaco.languages.CompletionItemKind.Text;\n}\n\n/**\n * @alpha\n */\nexport function registerSuggestions(\n monaco: Monaco,\n language: string,\n getSuggestions: CodeEditorSuggestionProvider,\n modelId: string\n): monacoType.IDisposable | undefined {\n if (!language || !getSuggestions) {\n return undefined;\n }\n return monaco.languages.registerCompletionItemProvider(language, {\n triggerCharacters: ['$'],\n\n provideCompletionItems: (model, position, context) => {\n // only return these suggestions for the specified modelId\n // prevents duplicate suggestions when multiple editors are open\n if (model.id !== modelId) {\n return undefined;\n }\n const range = {\n startLineNumber: position.lineNumber,\n endLineNumber: position.lineNumber,\n startColumn: position.column,\n endColumn: position.column,\n };\n\n // Simple check if this was triggered by pressing `$`\n if (context.triggerCharacter === '$') {\n range.startColumn = position.column - 1;\n return {\n suggestions: getCompletionItems(monaco, '$', getSuggestions(), range),\n };\n }\n\n // Find the replacement region\n const currentLine = model.getValueInRange({\n startLineNumber: position.lineNumber,\n startColumn: 1,\n endLineNumber: position.lineNumber,\n endColumn: position.column,\n });\n\n const { index, prefix } = findInsertIndex(currentLine);\n range.startColumn = index + 1;\n\n const suggestions = getCompletionItems(monaco, prefix, getSuggestions(), range);\n if (suggestions.length) {\n // NOTE, this will replace any language provided suggestions\n return { suggestions };\n }\n\n // Default language suggestions\n return undefined;\n },\n });\n}\n","import { css } from '@emotion/css';\nimport type * as monacoType from 'monaco-editor/esm/vs/editor/editor.api';\nimport { PureComponent } from 'react';\n\nimport { GrafanaTheme2, monacoLanguageRegistry } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\n\nimport { withTheme2 } from '../../themes';\nimport { Themeable2 } from '../../types';\n\nimport { ReactMonacoEditorLazy } from './ReactMonacoEditorLazy';\nimport { registerSuggestions } from './suggestions';\nimport { CodeEditorProps, Monaco, MonacoEditor as MonacoEditorType, MonacoOptions } from './types';\n\ntype Props = CodeEditorProps & Themeable2;\n\nclass UnthemedCodeEditor extends PureComponent<Props> {\n completionCancel?: monacoType.IDisposable;\n monaco?: Monaco;\n modelId?: string;\n\n constructor(props: Props) {\n super(props);\n }\n\n componentWillUnmount() {\n if (this.completionCancel) {\n this.completionCancel.dispose();\n }\n\n this.props.onEditorWillUnmount?.();\n }\n\n componentDidUpdate(oldProps: Props) {\n const { getSuggestions, language } = this.props;\n\n const newLanguage = oldProps.language !== language;\n const newGetSuggestions = oldProps.getSuggestions !== getSuggestions;\n\n if (newGetSuggestions || newLanguage) {\n if (this.completionCancel) {\n this.completionCancel.dispose();\n }\n\n if (!this.monaco) {\n console.warn('Monaco instance not loaded yet');\n return;\n }\n\n if (getSuggestions && this.modelId) {\n this.completionCancel = registerSuggestions(this.monaco, language, getSuggestions, this.modelId);\n }\n }\n\n if (newLanguage) {\n this.loadCustomLanguage();\n }\n }\n\n loadCustomLanguage = () => {\n const { language } = this.props;\n\n const customLanguage = monacoLanguageRegistry.getIfExists(language);\n\n if (customLanguage) {\n return customLanguage.init();\n }\n\n return Promise.resolve();\n };\n\n // This is replaced with a real function when the actual editor mounts\n getEditorValue = () => '';\n\n onBlur = () => {\n const { onBlur } = this.props;\n if (onBlur) {\n onBlur(this.getEditorValue());\n }\n };\n\n onFocus = () => {\n const { onFocus } = this.props;\n if (onFocus) {\n onFocus(this.getEditorValue());\n }\n };\n\n onSave = () => {\n const { onSave } = this.props;\n if (onSave) {\n onSave(this.getEditorValue());\n }\n };\n\n handleBeforeMount = (monaco: Monaco) => {\n this.monaco = monaco;\n\n const { onBeforeEditorMount } = this.props;\n\n onBeforeEditorMount?.(monaco);\n };\n\n handleOnMount = (editor: MonacoEditorType, monaco: Monaco) => {\n const { getSuggestions, language, onChange, onEditorDidMount } = this.props;\n\n this.modelId = editor.getModel()?.id;\n this.getEditorValue = () => editor.getValue();\n\n if (getSuggestions && this.modelId) {\n this.completionCancel = registerSuggestions(monaco, language, getSuggestions, this.modelId);\n }\n\n // Save when pressing Ctrl+S or Cmd+S\n editor.onKeyDown((e: monacoType.IKeyboardEvent) => {\n if (e.keyCode === monaco.KeyCode.KeyS && (e.ctrlKey || e.metaKey)) {\n e.preventDefault();\n this.onSave();\n }\n });\n\n if (onChange) {\n editor.getModel()?.onDidChangeContent(() => onChange(editor.getValue()));\n }\n\n if (onEditorDidMount) {\n onEditorDidMount(editor, monaco);\n }\n };\n\n render() {\n const { theme, language, width, height, showMiniMap, showLineNumbers, readOnly, wordWrap, monacoOptions } =\n this.props;\n const { alwaysConsumeMouseWheel, ...restMonacoOptions } = monacoOptions ?? {};\n\n const value = this.props.value ?? '';\n const longText = value.length > 100;\n\n const containerStyles = this.props.containerStyles ?? getStyles(theme).container;\n\n const options: MonacoOptions = {\n wordWrap: wordWrap ? 'on' : 'off',\n tabSize: 2,\n codeLens: false,\n contextmenu: false,\n minimap: {\n enabled: longText && showMiniMap,\n renderCharacters: false,\n },\n\n readOnly,\n lineNumbersMinChars: 4,\n lineDecorationsWidth: 1 * theme.spacing.gridSize,\n overviewRulerBorder: false,\n automaticLayout: true,\n padding: {\n top: 0.5 * theme.spacing.gridSize,\n bottom: 0.5 * theme.spacing.gridSize,\n },\n fixedOverflowWidgets: true, // Ensures suggestions menu is drawn on top\n\n scrollbar: {\n alwaysConsumeMouseWheel: alwaysConsumeMouseWheel ?? false,\n },\n };\n\n if (!showLineNumbers) {\n options.glyphMargin = false;\n options.folding = false;\n options.lineNumbers = 'off';\n options.lineNumbersMinChars = 0;\n }\n\n return (\n <div\n className={containerStyles}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n data-testid={selectors.components.CodeEditor.container}\n >\n <ReactMonacoEditorLazy\n width={width}\n height={height}\n language={language}\n value={value}\n options={{\n ...options,\n ...(restMonacoOptions ?? {}),\n }}\n beforeMount={this.handleBeforeMount}\n onMount={this.handleOnMount}\n keepCurrentModel={true}\n />\n </div>\n );\n }\n}\n\nexport const CodeEditor = withTheme2(UnthemedCodeEditor);\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n container: css({\n borderRadius: theme.shape.radius.default,\n border: `1px solid ${theme.components.input.borderColor}`,\n }),\n };\n};\n","import { useAsync } from 'react-use';\n\n// Allows simple dynamic imports in the components\nexport const useAsyncDependency = (importStatement: Promise<any>) => {\n const state = useAsync(async () => {\n return await importStatement;\n });\n\n return {\n ...state,\n dependency: state.value,\n };\n};\n","import { css } from '@emotion/css';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\n\nimport { useStyles2 } from '../../themes';\nimport { useAsyncDependency } from '../../utils/useAsyncDependency';\nimport { ErrorWithStack } from '../ErrorBoundary/ErrorWithStack';\nimport { LoadingPlaceholder } from '../LoadingPlaceholder/LoadingPlaceholder';\n\n// we only use import type so it will not be included in the bundle\nimport type { ReactMonacoEditorProps } from './types';\n\n/**\n * @internal\n * Experimental export\n **/\nexport const ReactMonacoEditorLazy = (props: ReactMonacoEditorProps) => {\n const styles = useStyles2(getStyles);\n const { loading, error, dependency } = useAsyncDependency(\n import(/* webpackChunkName: \"react-monaco-editor\" */ './ReactMonacoEditor')\n );\n\n if (loading) {\n return <LoadingPlaceholder text={'Loading editor'} className={styles.container} />;\n }\n\n if (error) {\n return (\n <ErrorWithStack\n title=\"React Monaco Editor failed to load\"\n error={error}\n errorInfo={{ componentStack: error?.stack ?? '' }}\n />\n );\n }\n\n const ReactMonacoEditor = dependency.ReactMonacoEditor;\n return (\n <ReactMonacoEditor\n {...props}\n loading={props.loading ?? null}\n wrapperProps={{\n 'data-testid': selectors.components.ReactMonacoEditor.editorLazy,\n }}\n />\n );\n};\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n container: css({\n marginBottom: 'unset',\n marginLeft: theme.spacing(1),\n }),\n };\n};\n","// We use `import type` to guarantee it'll be erased from the JS and it doesnt accidently bundle monaco\nimport type { EditorProps } from '@monaco-editor/react';\nimport type * as monacoType from 'monaco-editor/esm/vs/editor/editor.api';\n\n// we do not allow customizing the theme.\n// (theme is complicated in Monaco, right now there is\n// a limitation where all monaco editors must have\n// the same theme, see\n// https://github.com/microsoft/monaco-editor/issues/338#issuecomment-274837186\n// )\nexport type ReactMonacoEditorProps = Omit<EditorProps, 'theme'>;\n\nexport type CodeEditorChangeHandler = (value: string) => void;\nexport type CodeEditorSuggestionProvider = () => CodeEditorSuggestionItem[];\n\nexport type { monacoType as monacoTypes };\nexport type Monaco = typeof monacoType;\nexport type MonacoEditor = monacoType.editor.IStandaloneCodeEditor;\nexport type MonacoOptions = MonacoOptionsWithGrafanaDefaults;\n\nexport interface CodeEditorProps {\n value: string;\n language: string;\n width?: number | string;\n height?: number | string;\n\n readOnly?: boolean;\n showMiniMap?: boolean;\n showLineNumbers?: boolean;\n wordWrap?: boolean;\n monacoOptions?: MonacoOptions;\n\n /**\n * Callback before the editor has mounted that gives you raw access to monaco\n */\n onBeforeEditorMount?: (monaco: Monaco) => void;\n\n /**\n * Callback after the editor has mounted that gives you raw access to monaco\n */\n onEditorDidMount?: (editor: MonacoEditor, monaco: Monaco) => void;\n\n /** Callback before the edior has unmounted */\n onEditorWillUnmount?: () => void;\n\n /** Handler to be performed when editor is blurred */\n onBlur?: CodeEditorChangeHandler;\n\n /** Handler to be performed when editor is focused */\n onFocus?: CodeEditorChangeHandler;\n\n /** Handler to be performed whenever the text inside the editor changes */\n onChange?: CodeEditorChangeHandler;\n\n /** Handler to be performed when Cmd/Ctrl+S is pressed */\n onSave?: CodeEditorChangeHandler;\n\n /**\n * Language agnostic suggestion completions -- typically for template variables\n */\n getSuggestions?: CodeEditorSuggestionProvider;\n\n containerStyles?: string;\n}\n\n/**\n * @alpha\n */\nexport enum CodeEditorSuggestionItemKind {\n Method = 'method',\n Field = 'field',\n Property = 'property',\n Constant = 'constant',\n Text = 'text',\n}\n\n/**\n * @alpha\n */\nexport interface CodeEditorSuggestionItem {\n /**\n * The label of this completion item. By default\n * this is also the text that is inserted when selecting\n * this completion.\n */\n label: string;\n\n /**\n * The kind of this completion item. An icon is chosen\n * by the editor based on the kind.\n */\n kind?: CodeEditorSuggestionItemKind;\n\n /**\n * A human-readable string with additional information\n * about this item, like type or symbol information.\n */\n detail?: string;\n\n /**\n * A human-readable string that represents a doc-comment.\n */\n documentation?: string; // | IMarkdownString;\n\n /**\n * A string or snippet that should be inserted in a document when selecting\n * this completion. When `falsy` the `label` is used.\n */\n insertText?: string;\n}\n\n/**\n * This interface will extend the original Monaco editor options interface\n * but changing the code comments to contain the proper default values to\n * prevent the consumer of the CodeEditor to get incorrect documentation in editor.\n */\nexport interface MonacoOptionsWithGrafanaDefaults extends monacoType.editor.IStandaloneEditorConstructionOptions {\n /**\n * Enable custom contextmenu.\n * Defaults to false.\n */\n contextmenu?: boolean;\n /**\n * The number of spaces a tab is equal to.\n * This setting is overridden based on the file contents when `detectIndentation` is on.\n * Defaults to 4.\n */\n tabSize?: number;\n /**\n * Show code lens\n * Defaults to false.\n */\n codeLens?: boolean;\n /**\n * Control the width of line numbers, by reserving horizontal space for rendering at least an amount of digits.\n * Defaults to 4.\n */\n lineNumbersMinChars?: number;\n /**\n * The width reserved for line decorations (in px).\n * Line decorations are placed between line numbers and the editor content.\n * You can pass in a string in the format floating point followed by \"ch\". e.g. 1.3ch.\n * Defaults to 1 * theme.spacing.gridSize.\n */\n lineDecorationsWidth?: number | string;\n /**\n * Controls if a border should be drawn around the overview ruler.\n * Defaults to `false`.\n */\n overviewRulerBorder?: boolean;\n /**\n * Enable that the editor will install an interval to check if its container dom node size has changed.\n * Enabling this might have a severe performance impact.\n * Defaults to true.\n */\n automaticLayout?: boolean;\n\n /**\n * Always consume mouse wheel events (always call preventDefault() and stopPropagation() on the browser events).\n * Always consuming mouse wheel events will prevent the page from scrolling if the cursor is over the editor.\n * Defaults to `false`.\n */\n alwaysConsumeMouseWheel?: boolean;\n}\n","import { css } from '@emotion/css';\nimport { PropsWithChildren, useLayoutEffect, useRef } from 'react';\nimport * as React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\n\nimport { useStyles2, useTheme2 } from '../../themes';\n\ninterface Props {\n className?: string;\n root?: HTMLElement;\n forwardedRef?: React.ForwardedRef<HTMLDivElement>;\n}\n\nexport function Portal(props: PropsWithChildren<Props>) {\n const { children, className, root, forwardedRef } = props;\n const theme = useTheme2();\n const node = useRef<HTMLDivElement | null>(null);\n const portalRoot = root ?? getPortalContainer();\n\n if (!node.current) {\n node.current = document.createElement('div');\n if (className) {\n node.current.className = className;\n }\n node.current.style.position = 'relative';\n node.current.style.zIndex = `${theme.zIndex.portal}`;\n }\n\n useLayoutEffect(() => {\n if (node.current) {\n portalRoot.appendChild(node.current);\n }\n\n return () => {\n if (node.current) {\n portalRoot.removeChild(node.current);\n }\n };\n }, [portalRoot]);\n\n return ReactDOM.createPortal(<div ref={forwardedRef}>{children}</div>, node.current);\n}\n\n/** @internal */\nexport function getPortalContainer() {\n return window.document.getElementById('grafana-portal-container') ?? document.body;\n}\n\n/** @internal */\nexport function PortalContainer() {\n const styles = useStyles2(getStyles);\n return (\n <div\n id=\"grafana-portal-container\"\n data-testid={selectors.components.Portal.container}\n className={styles.grafanaPortalContainer}\n />\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n grafanaPortalContainer: css({\n position: 'fixed',\n top: 0,\n width: '100%',\n zIndex: theme.zIndex.portal,\n }),\n };\n};\n\nexport const RefForwardingPortal = React.forwardRef<HTMLDivElement, Props>((props, ref) => {\n return <Portal {...props} forwardedRef={ref} />;\n});\n\nRefForwardingPortal.displayName = 'RefForwardingPortal';\n","import { css, cx } from '@emotion/css';\nimport { useEffect, useRef, useState } from 'react';\nimport * as React from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes';\n\nexport const ScrollIndicators = ({ children }: React.PropsWithChildren<{}>) => {\n const [showScrollTopIndicator, setShowTopScrollIndicator] = useState(false);\n const [showScrollBottomIndicator, setShowBottomScrollIndicator] = useState(false);\n const scrollTopMarker = useRef<HTMLDivElement>(null);\n const scrollBottomMarker = useRef<HTMLDivElement>(null);\n const styles = useStyles2(getStyles);\n\n // Here we observe the top and bottom markers to determine if we should show the scroll indicators\n useEffect(() => {\n const intersectionObserver = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n if (entry.target === scrollTopMarker.current) {\n setShowTopScrollIndicator(!entry.isIntersecting);\n } else if (entry.target === scrollBottomMarker.current) {\n setShowBottomScrollIndicator(!entry.isIntersecting);\n }\n });\n });\n [scrollTopMarker, scrollBottomMarker].forEach((ref) => {\n if (ref.current) {\n intersectionObserver.observe(ref.current);\n }\n });\n return () => intersectionObserver.disconnect();\n }, []);\n\n return (\n <>\n <div\n className={cx(styles.scrollIndicator, styles.scrollTopIndicator, {\n [styles.scrollIndicatorVisible]: showScrollTopIndicator,\n })}\n />\n <div className={styles.scrollContent}>\n <div ref={scrollTopMarker} className={cx(styles.scrollMarker, styles.scrollTopMarker)} />\n {children}\n <div ref={scrollBottomMarker} className={cx(styles.scrollMarker, styles.scrollBottomMarker)} />\n </div>\n <div\n className={cx(styles.scrollIndicator, styles.scrollBottomIndicator, {\n [styles.scrollIndicatorVisible]: showScrollBottomIndicator,\n })}\n />\n </>\n );\n};\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n scrollContent: css({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n position: 'relative',\n }),\n scrollIndicator: css({\n height: theme.spacing(6),\n left: 0,\n opacity: 0,\n pointerEvents: 'none',\n position: 'absolute',\n right: 0,\n [theme.transitions.handleMotion('no-preference', 'reduce')]: {\n transition: theme.transitions.create('opacity'),\n },\n zIndex: 1,\n }),\n scrollTopIndicator: css({\n background: `linear-gradient(0deg, transparent, ${theme.colors.background.canvas})`,\n top: 0,\n }),\n scrollBottomIndicator: css({\n background: `linear-gradient(180deg, transparent, ${theme.colors.background.canvas})`,\n bottom: 0,\n }),\n scrollIndicatorVisible: css({\n opacity: 1,\n }),\n scrollMarker: css({\n height: '1px',\n left: 0,\n pointerEvents: 'none',\n position: 'absolute',\n right: 0,\n }),\n scrollTopMarker: css({\n top: 0,\n }),\n scrollBottomMarker: css({\n bottom: 0,\n }),\n };\n};\n","import { css } from '@emotion/css';\nimport { Property } from 'csstype';\nimport { forwardRef, PropsWithChildren, UIEventHandler } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes';\nimport { Box, BoxProps } from '../Layout/Box/Box';\n\nimport { ScrollIndicators } from './ScrollIndicators';\n\ninterface Props extends Omit<BoxProps, 'display' | 'direction' | 'element' | 'flex' | 'position'> {\n showScrollIndicators?: boolean;\n onScroll?: UIEventHandler<HTMLDivElement>;\n overflowX?: Property.OverflowX;\n overflowY?: Property.OverflowY;\n scrollbarWidth?: Property.ScrollbarWidth;\n}\n\nexport const ScrollContainer = forwardRef<HTMLDivElement, PropsWithChildren<Props>>(\n (\n {\n children,\n showScrollIndicators = false,\n onScroll,\n overflowX = 'auto',\n overflowY = 'auto',\n scrollbarWidth = 'thin',\n ...rest\n },\n ref\n ) => {\n const styles = useStyles2(getStyles, scrollbarWidth, overflowY, overflowX);\n const defaults: Partial<BoxProps> = {\n maxHeight: '100%',\n minHeight: 0,\n minWidth: 0,\n };\n const boxProps = { ...defaults, ...rest };\n\n return (\n <Box {...boxProps} display=\"flex\" direction=\"column\" flex={1} position=\"relative\">\n <div onScroll={onScroll} className={styles.scroller} ref={ref}>\n {showScrollIndicators ? <ScrollIndicators>{children}</ScrollIndicators> : children}\n </div>\n </Box>\n );\n }\n);\nScrollContainer.displayName = 'ScrollContainer';\n\nconst getStyles = (\n theme: GrafanaTheme2,\n scrollbarWidth: Props['scrollbarWidth'],\n overflowY: Props['overflowY'],\n overflowX: Props['overflowX']\n) => ({\n scroller: css({\n display: 'flex',\n flex: 1,\n flexDirection: 'column',\n overflowX,\n overflowY,\n scrollbarWidth,\n }),\n});\n","import * as React from 'react';\n\nimport { useTheme2 } from '../../themes';\nimport { IconButton, Props as IconButtonProps } from '../IconButton/IconButton';\n\nimport { getSelectStyles } from './getSelectStyles';\n\ninterface MultiValueContainerProps {\n innerProps: JSX.IntrinsicElements['div'];\n}\n\nexport const MultiValueContainer = ({ innerProps, children }: React.PropsWithChildren<MultiValueContainerProps>) => {\n const theme = useTheme2();\n const styles = getSelectStyles(theme);\n\n return (\n <div {...innerProps} className={styles.multiValueContainer}>\n {children}\n </div>\n );\n};\n\nexport type MultiValueRemoveProps = {\n innerProps: IconButtonProps;\n};\n\nexport const MultiValueRemove = ({ children, innerProps }: React.PropsWithChildren<MultiValueRemoveProps>) => {\n const theme = useTheme2();\n const styles = getSelectStyles(theme);\n return <IconButton {...innerProps} name=\"times\" size=\"sm\" className={styles.multiValueRemove} tooltip=\"Remove\" />;\n};\n","import { components, InputProps } from 'react-select';\n\n/**\n * Custom input component for react-select to add data-testid attribute\n */\nexport const CustomInput = (props: InputProps) => {\n let testId;\n\n if ('data-testid' in props.selectProps && props.selectProps['data-testid']) {\n testId = props.selectProps['data-testid'] + '-input';\n }\n\n return <components.Input {...props} data-testid={testId} />;\n};\n","import { DropdownIndicatorProps } from 'react-select';\n\nimport { Icon } from '../Icon/Icon';\n\nexport function DropdownIndicator({ selectProps }: DropdownIndicatorProps) {\n const isOpen = selectProps.menuIsOpen;\n const icon = isOpen ? 'search' : 'angle-down';\n const size = isOpen ? 'sm' : 'md';\n return <Icon name={icon} size={size} />;\n}\n","import { cx, css } from '@emotion/css';\nimport { forwardRef } from 'react';\n\nimport { useTheme2 } from '../../themes/ThemeContext';\nimport { getInputStyles } from '../Input/Input';\n\nexport const IndicatorsContainer = forwardRef<HTMLDivElement, React.PropsWithChildren>((props, ref) => {\n const { children } = props;\n const theme = useTheme2();\n const styles = getInputStyles({ theme, invalid: false });\n\n return (\n <div\n className={cx(\n styles.suffix,\n css({\n position: 'relative',\n })\n )}\n ref={ref}\n >\n {children}\n </div>\n );\n});\n\nIndicatorsContainer.displayName = 'IndicatorsContainer';\n","import { css, cx } from '@emotion/css';\nimport { forwardRef } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes/ThemeContext';\nimport { inputPadding } from '../Forms/commonStyles';\nimport { getInputStyles } from '../Input/Input';\n\ninterface InputControlProps {\n /** Show an icon as a prefix in the input */\n prefix?: JSX.Element | string | null;\n focused: boolean;\n invalid: boolean;\n disabled: boolean;\n innerProps: JSX.IntrinsicElements['div'];\n}\n\nexport const InputControl = forwardRef<HTMLDivElement, React.PropsWithChildren<InputControlProps>>(\n function InputControl({ focused, invalid, disabled, children, innerProps, prefix, ...otherProps }, ref) {\n const styles = useStyles2(getInputControlStyles, invalid, !!prefix);\n\n return (\n <div className={styles.input} {...innerProps} ref={ref}>\n {prefix && <div className={cx(styles.prefix)}>{prefix}</div>}\n {children}\n </div>\n );\n }\n);\n\nconst getInputControlStyles = (theme: GrafanaTheme2, invalid: boolean, withPrefix: boolean) => {\n const styles = getInputStyles({ theme, invalid });\n\n return {\n input: cx(\n inputPadding(theme),\n css({\n width: '100%',\n maxWidth: '100%',\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n flexWrap: 'wrap',\n justifyContent: 'space-between',\n paddingRight: 0,\n position: 'relative',\n boxSizing: 'border-box',\n }),\n withPrefix &&\n css({\n paddingLeft: 0,\n })\n ),\n prefix: cx(\n styles.prefix,\n css({\n position: 'relative',\n })\n ),\n };\n};\n","import { GroupProps } from 'react-select';\n\nimport { useStyles2 } from '../../themes/ThemeContext';\n\nimport { getSelectStyles } from './getSelectStyles';\n\nexport const SelectOptionGroup = ({\n children,\n cx,\n getClassNames,\n getStyles,\n Heading,\n headingProps,\n label,\n selectProps,\n theme,\n}: GroupProps) => {\n const styles = useStyles2(getSelectStyles);\n return (\n <div className={styles.group}>\n <Heading\n cx={cx}\n getClassNames={getClassNames}\n getStyles={getStyles}\n selectProps={selectProps}\n theme={theme}\n {...headingProps}\n >\n {label}\n </Heading>\n {children}\n </div>\n );\n};\n","import { GroupHeadingProps } from 'react-select';\n\nimport { useStyles2 } from '../../themes/ThemeContext';\nimport { Text } from '../Text/Text';\n\nimport { getSelectStyles } from './getSelectStyles';\n\nexport const SelectOptionGroupHeader = (props: GroupHeadingProps) => {\n const styles = useStyles2(getSelectStyles);\n\n return (\n <div className={styles.groupHeader}>\n <Text weight=\"bold\" variant=\"bodySmall\" color=\"secondary\">\n {props.children ?? ''}\n </Text>\n </div>\n );\n};\n","import { cx } from '@emotion/css';\nimport { Component, ReactNode } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { withTheme2 } from '../../themes/ThemeContext';\n\nimport { getSelectStyles } from './getSelectStyles';\n\nclass UnthemedValueContainer extends Component<any & { theme: GrafanaTheme2 }> {\n render() {\n const { children } = this.props;\n const { selectProps } = this.props;\n\n if (\n selectProps &&\n Array.isArray(children) &&\n Array.isArray(children[0]) &&\n selectProps.maxVisibleValues !== undefined &&\n !(selectProps.showAllSelectedWhenOpen && selectProps.menuIsOpen)\n ) {\n const [valueChildren, ...otherChildren] = children;\n const truncatedValues = valueChildren.slice(0, selectProps.maxVisibleValues);\n\n return this.renderContainer([truncatedValues, ...otherChildren]);\n }\n\n return this.renderContainer(children);\n }\n\n renderContainer(children?: ReactNode) {\n const { isMulti, theme, selectProps } = this.props;\n const noWrap = this.props.selectProps?.noMultiValueWrap && !this.props.selectProps?.menuIsOpen;\n const styles = getSelectStyles(theme);\n const dataTestid = selectProps['data-testid'];\n const className = cx(styles.valueContainer, {\n [styles.valueContainerMulti]: isMulti && !noWrap,\n [styles.valueContainerMultiNoWrap]: isMulti && noWrap,\n });\n\n return (\n <div data-testid={dataTestid} className={className}>\n {children}\n </div>\n );\n }\n}\n\nexport const ValueContainer = withTheme2(UnthemedValueContainer);\n","import { SelectableValue } from '@grafana/data';\n\nimport { SelectableOptGroup } from './types';\n\n/**\n * Normalize the value format to SelectableValue[] | []. Only used for single select\n */\nexport const cleanValue = (\n value: unknown,\n options: Array<SelectableValue | SelectableOptGroup | SelectableOptGroup[]>\n) => {\n if (Array.isArray(value)) {\n const filtered = value.filter(Boolean);\n return filtered?.length ? filtered : undefined;\n }\n if (typeof value === 'object') {\n // we want to allow null through into here, so the Select value can be unset\n return [value];\n }\n if (typeof value === 'string' || typeof value === 'number') {\n const selectedValue = findSelectedValue(value, options);\n if (selectedValue) {\n return [selectedValue];\n }\n }\n return undefined;\n};\n\n/**\n * Find the label for a string|number value inside array of options or optgroups\n */\nexport const findSelectedValue = (\n value: string | number,\n options: Array<SelectableValue | SelectableOptGroup | SelectableOptGroup[]>\n): SelectableValue | null => {\n for (const option of options) {\n if ('options' in option) {\n let found = findSelectedValue(value, option.options);\n if (found) {\n return found;\n }\n } else if ('value' in option && option.value === value) {\n return option;\n }\n }\n\n return null;\n};\n\n/**\n * Omit descriptions from an array of options\n */\nexport const omitDescriptions = (options: SelectableValue[]): SelectableValue[] => {\n return options.map(({ description, ...rest }) => rest);\n};\n","import { t } from 'i18next';\nimport { isArray, negate } from 'lodash';\nimport { ComponentProps, useCallback, useEffect, useRef, useState } from 'react';\nimport * as React from 'react';\nimport {\n default as ReactSelect,\n IndicatorsContainerProps,\n Props as ReactSelectProps,\n ClearIndicatorProps,\n} from 'react-select';\nimport { default as ReactAsyncSelect } from 'react-select/async';\nimport { default as AsyncCreatable } from 'react-select/async-creatable';\nimport Creatable from 'react-select/creatable';\n\nimport { SelectableValue, toOption } from '@grafana/data';\n\nimport { useTheme2 } from '../../themes';\nimport { Trans } from '../../utils/i18n';\nimport { Icon } from '../Icon/Icon';\nimport { Spinner } from '../Spinner/Spinner';\n\nimport { CustomInput } from './CustomInput';\nimport { DropdownIndicator } from './DropdownIndicator';\nimport { IndicatorsContainer } from './IndicatorsContainer';\nimport { InputControl } from './InputControl';\nimport { MultiValueContainer, MultiValueRemove } from './MultiValue';\nimport { SelectContainer } from './SelectContainer';\nimport { SelectMenu, SelectMenuOptions, VirtualizedSelectMenu } from './SelectMenu';\nimport { SelectOptionGroup } from './SelectOptionGroup';\nimport { SelectOptionGroupHeader } from './SelectOptionGroupHeader';\nimport { Props, SingleValue } from './SingleValue';\nimport { ValueContainer } from './ValueContainer';\nimport { getSelectStyles } from './getSelectStyles';\nimport { useCustomSelectStyles } from './resetSelectStyles';\nimport { ActionMeta, InputActionMeta, SelectBaseProps, ToggleAllState } from './types';\nimport { cleanValue, findSelectedValue, omitDescriptions } from './utils';\n\nconst CustomControl = (props: any) => {\n const {\n children,\n innerProps,\n selectProps: { menuIsOpen, onMenuClose, onMenuOpen },\n isFocused,\n isMulti,\n getValue,\n innerRef,\n } = props;\n const selectProps = props.selectProps as SelectBaseProps<any>;\n\n if (selectProps.renderControl) {\n return React.createElement(selectProps.renderControl, {\n isOpen: menuIsOpen,\n value: isMulti ? getValue() : getValue()[0],\n ref: innerRef,\n onClick: menuIsOpen ? onMenuClose : onMenuOpen,\n onBlur: onMenuClose,\n disabled: !!selectProps.disabled,\n invalid: !!selectProps.invalid,\n });\n }\n\n return (\n <InputControl\n ref={innerRef}\n innerProps={innerProps}\n prefix={selectProps.prefix}\n focused={isFocused}\n invalid={!!selectProps.invalid}\n disabled={!!selectProps.disabled}\n >\n {children}\n </InputControl>\n );\n};\n\ninterface SelectPropsWithExtras extends ReactSelectProps {\n maxVisibleValues?: number | undefined;\n showAllSelectedWhenOpen: boolean;\n noMultiValueWrap?: boolean;\n}\n\nfunction determineToggleAllState(selectedValue: SelectableValue[], options: SelectableValue[]) {\n if (options.length === selectedValue.length) {\n return ToggleAllState.allSelected;\n } else if (selectedValue.length === 0) {\n return ToggleAllState.noneSelected;\n } else {\n return ToggleAllState.indeterminate;\n }\n}\n\nexport function SelectBase<T, Rest = {}>({\n allowCustomValue = false,\n allowCreateWhileLoading = false,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestid,\n autoFocus = false,\n backspaceRemovesValue = true,\n blurInputOnSelect,\n cacheOptions,\n className,\n closeMenuOnSelect = true,\n components,\n createOptionPosition = 'last',\n defaultOptions,\n defaultValue,\n disabled = false,\n filterOption,\n formatCreateLabel,\n getOptionLabel,\n getOptionValue,\n inputValue,\n invalid,\n isClearable = false,\n id,\n isLoading = false,\n isMulti = false,\n inputId,\n isOpen,\n isOptionDisabled,\n isSearchable = true,\n loadOptions,\n loadingMessage = 'Loading options...',\n maxMenuHeight = 300,\n minMenuHeight,\n maxVisibleValues,\n menuPlacement = 'auto',\n menuPosition,\n menuShouldPortal = true,\n noOptionsMessage = t('grafana-ui.select.no-options-label', 'No options found'),\n onBlur,\n onChange,\n onCloseMenu,\n onCreateOption,\n onInputChange,\n onKeyDown,\n onMenuScrollToBottom,\n onMenuScrollToTop,\n onOpenMenu,\n onFocus,\n toggleAllOptions,\n openMenuOnFocus = false,\n options = [],\n placeholder = t('grafana-ui.select.placeholder', 'Choose'),\n prefix,\n renderControl,\n showAllSelectedWhenOpen = true,\n tabSelectsValue = true,\n value,\n virtualized = false,\n noMultiValueWrap,\n width,\n isValidNewOption,\n formatOptionLabel,\n hideSelectedOptions,\n ...rest\n}: SelectBaseProps<T> & Rest) {\n const theme = useTheme2();\n const styles = getSelectStyles(theme);\n\n const reactSelectRef = useRef<{ controlRef: HTMLElement }>(null);\n const [closeToBottom, setCloseToBottom] = useState<boolean>(false);\n const selectStyles = useCustomSelectStyles(theme, width);\n const [hasInputValue, setHasInputValue] = useState<boolean>(!!inputValue);\n\n // Infer the menu position for asynchronously loaded options. menuPlacement=\"auto\" doesn't work when the menu is\n // automatically opened when the component is created (it happens in SegmentSelect by setting menuIsOpen={true}).\n // We can remove this workaround when the bug in react-select is fixed: https://github.com/JedWatson/react-select/issues/4936\n // Note: we use useEffect instead of hooking into onMenuOpen due to another bug: https://github.com/JedWatson/react-select/issues/3375\n useEffect(() => {\n if (\n loadOptions &&\n isOpen &&\n reactSelectRef.current &&\n reactSelectRef.current.controlRef &&\n menuPlacement === 'auto'\n ) {\n const distance = window.innerHeight - reactSelectRef.current.controlRef.getBoundingClientRect().bottom;\n setCloseToBottom(distance < maxMenuHeight);\n }\n }, [maxMenuHeight, menuPlacement, loadOptions, isOpen]);\n\n const onChangeWithEmpty = useCallback(\n (value: SelectableValue<T>, action: ActionMeta) => {\n if (isMulti && (value === undefined || value === null)) {\n return onChange([], action);\n }\n onChange(value, action);\n },\n [isMulti, onChange]\n );\n\n let ReactSelectComponent = ReactSelect;\n\n const creatableProps: ComponentProps<typeof Creatable<SelectableValue<T>>> = {};\n let asyncSelectProps: any = {};\n let selectedValue;\n if (isMulti && loadOptions) {\n selectedValue = value as any;\n } else {\n // If option is passed as a plain value (value property from SelectableValue property)\n // we are selecting the corresponding value from the options\n if (isMulti && value && Array.isArray(value) && !loadOptions) {\n selectedValue = value.map((v) => {\n // @ts-ignore\n const selectableValue = findSelectedValue(v.value ?? v, options);\n // If the select allows custom values there likely won't be a selectableValue in options\n // so we must return a new selectableValue\n if (selectableValue) {\n return selectableValue;\n }\n return typeof v === 'string' ? toOption(v) : v;\n });\n } else if (loadOptions) {\n const hasValue = defaultValue || value;\n selectedValue = hasValue ? [hasValue] : [];\n } else {\n selectedValue = cleanValue(value, options);\n }\n }\n\n const commonSelectProps = {\n 'aria-label': ariaLabel,\n 'data-testid': dataTestid,\n autoFocus,\n backspaceRemovesValue,\n blurInputOnSelect,\n captureMenuScroll: onMenuScrollToBottom || onMenuScrollToTop,\n closeMenuOnSelect,\n // We don't want to close if we're actually scrolling the menu\n // So only close if none of the parents are the select menu itself\n defaultValue,\n // Also passing disabled, as this is the new Select API, and I want to use this prop instead of react-select's one\n disabled,\n // react-select always tries to filter the options even at first menu open, which is a problem for performance\n // in large lists. So we set it to not try to filter the options if there is no input value.\n filterOption: hasInputValue ? filterOption : null,\n getOptionLabel,\n getOptionValue,\n hideSelectedOptions,\n inputValue,\n invalid,\n isClearable,\n id,\n // Passing isDisabled as react-select accepts this prop\n isDisabled: disabled,\n isLoading,\n isMulti,\n inputId,\n isOptionDisabled,\n isSearchable,\n maxMenuHeight,\n minMenuHeight,\n maxVisibleValues,\n menuIsOpen: isOpen,\n menuPlacement: menuPlacement === 'auto' && closeToBottom ? 'top' : menuPlacement,\n menuPosition,\n menuShouldBlockScroll: true,\n menuPortalTarget: menuShouldPortal && typeof document !== 'undefined' ? document.body : undefined,\n menuShouldScrollIntoView: false,\n onBlur,\n onChange: onChangeWithEmpty,\n onInputChange: (val: string, actionMeta: InputActionMeta) => {\n const newValue = onInputChange?.(val, actionMeta) ?? val;\n const newHasValue = !!newValue;\n if (newHasValue !== hasInputValue) {\n setHasInputValue(newHasValue);\n }\n\n return newValue;\n },\n onKeyDown,\n onMenuClose: onCloseMenu,\n onMenuOpen: onOpenMenu,\n onMenuScrollToBottom: onMenuScrollToBottom,\n onMenuScrollToTop: onMenuScrollToTop,\n onFocus,\n formatOptionLabel,\n openMenuOnFocus,\n options: virtualized ? omitDescriptions(options) : options,\n placeholder,\n prefix,\n renderControl,\n showAllSelectedWhenOpen,\n tabSelectsValue,\n value: isMulti ? selectedValue : selectedValue?.[0],\n noMultiValueWrap,\n };\n\n if (allowCustomValue) {\n ReactSelectComponent = Creatable;\n creatableProps.allowCreateWhileLoading = allowCreateWhileLoading;\n creatableProps.formatCreateLabel = formatCreateLabel ?? defaultFormatCreateLabel;\n creatableProps.onCreateOption = onCreateOption;\n creatableProps.createOptionPosition = createOptionPosition;\n creatableProps.isValidNewOption = isValidNewOption;\n }\n\n // Instead of having AsyncSelect, as a separate component we render ReactAsyncSelect\n if (loadOptions) {\n ReactSelectComponent = allowCustomValue ? AsyncCreatable : ReactAsyncSelect;\n asyncSelectProps = {\n loadOptions,\n cacheOptions,\n defaultOptions,\n };\n }\n\n const SelectMenuComponent = virtualized ? VirtualizedSelectMenu : SelectMenu;\n\n let toggleAllState = ToggleAllState.noneSelected;\n if (toggleAllOptions?.enabled && isArray(selectedValue)) {\n if (toggleAllOptions?.determineToggleAllState) {\n toggleAllState = toggleAllOptions.determineToggleAllState(selectedValue, options);\n } else {\n toggleAllState = determineToggleAllState(selectedValue, options);\n }\n }\n\n const toggleAll = useCallback(() => {\n let toSelect = toggleAllState === ToggleAllState.noneSelected ? options : [];\n if (toggleAllOptions?.optionsFilter) {\n toSelect =\n toggleAllState === ToggleAllState.noneSelected\n ? options.filter(toggleAllOptions.optionsFilter)\n : options.filter(negate(toggleAllOptions.optionsFilter));\n }\n\n onChange(toSelect, {\n action: 'select-option',\n option: {},\n });\n }, [options, toggleAllOptions, onChange, toggleAllState]);\n\n return (\n <>\n <ReactSelectComponent\n ref={reactSelectRef}\n components={{\n MenuList: SelectMenuComponent,\n Group: SelectOptionGroup,\n GroupHeading: SelectOptionGroupHeader,\n ValueContainer,\n IndicatorsContainer: CustomIndicatorsContainer,\n IndicatorSeparator: IndicatorSeparator,\n Control: CustomControl,\n Option: SelectMenuOptions,\n ClearIndicator(props: ClearIndicatorProps) {\n const { clearValue } = props;\n return (\n <Icon\n name=\"times\"\n role=\"button\"\n aria-label=\"select-clear-value\"\n className={styles.singleValueRemove}\n onMouseDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n clearValue();\n }}\n />\n );\n },\n LoadingIndicator() {\n return <Spinner inline />;\n },\n LoadingMessage() {\n return <div className={styles.loadingMessage}>{loadingMessage}</div>;\n },\n NoOptionsMessage() {\n return (\n <div className={styles.loadingMessage} aria-label=\"No options provided\">\n {noOptionsMessage}\n </div>\n );\n },\n DropdownIndicator: DropdownIndicator,\n SingleValue(props: Props<T>) {\n return <SingleValue {...props} isDisabled={disabled} />;\n },\n SelectContainer,\n MultiValueContainer: MultiValueContainer,\n MultiValueRemove: !disabled ? MultiValueRemove : () => null,\n Input: CustomInput,\n ...components,\n }}\n toggleAllOptions={\n toggleAllOptions?.enabled && {\n state: toggleAllState,\n selectAllClicked: toggleAll,\n selectedCount: isArray(selectedValue) ? selectedValue.length : undefined,\n }\n }\n styles={selectStyles}\n className={className}\n {...commonSelectProps}\n {...creatableProps}\n {...asyncSelectProps}\n {...rest}\n />\n </>\n );\n}\n\nfunction defaultFormatCreateLabel(input: string) {\n return (\n <div style={{ display: 'flex', gap: '8px', alignItems: 'center' }}>\n <div>{input}</div>\n <div style={{ flexGrow: 1 }} />\n <div className=\"muted small\" style={{ display: 'flex', gap: '8px', alignItems: 'center' }}>\n <Trans i18nKey=\"grafana-ui.select.default-create-label\">Hit enter to add</Trans>\n </div>\n </div>\n );\n}\n\ntype CustomIndicatorsContainerProps = IndicatorsContainerProps & {\n selectProps: SelectPropsWithExtras;\n children: React.ReactNode;\n};\n\nfunction CustomIndicatorsContainer(props: CustomIndicatorsContainerProps) {\n const { showAllSelectedWhenOpen, maxVisibleValues, menuIsOpen } = props.selectProps;\n\n const value = props.getValue();\n\n if (maxVisibleValues !== undefined && Array.isArray(props.children)) {\n const selectedValuesCount = value.length;\n\n if (selectedValuesCount > maxVisibleValues && !(showAllSelectedWhenOpen && menuIsOpen)) {\n const indicatorChildren = [...props.children];\n indicatorChildren.splice(\n -1,\n 0,\n <span key=\"excess-values\" id=\"excess-values\">\n {`(+${selectedValuesCount - maxVisibleValues})`}\n </span>\n );\n\n return <IndicatorsContainer {...props}>{indicatorChildren}</IndicatorsContainer>;\n }\n }\n\n return <IndicatorsContainer {...props} />;\n}\n\nfunction IndicatorSeparator() {\n return <></>;\n}\n","import { SelectableValue } from '@grafana/data';\n\nimport { SelectBase } from './SelectBase';\nimport { SelectContainer, SelectContainerProps } from './SelectContainer';\nimport {\n SelectCommonProps,\n MultiSelectCommonProps,\n SelectAsyncProps,\n VirtualizedSelectProps,\n VirtualizedSelectAsyncProps,\n} from './types';\n\n/** @deprecated Use Combobox component instead */\nexport function Select<T, Rest = {}>(props: SelectCommonProps<T> & Rest) {\n return <SelectBase {...props} />;\n}\n\nexport function MultiSelect<T, Rest = {}>(props: MultiSelectCommonProps<T> & Rest) {\n // @ts-ignore\n return <SelectBase {...props} isMulti />;\n}\n\nexport interface AsyncSelectProps<T> extends Omit<SelectCommonProps<T>, 'options'>, SelectAsyncProps<T> {\n // AsyncSelect has options stored internally. We cannot enable plain values as we don't have access to the fetched options\n value?: T | SelectableValue<T> | null;\n}\n\n/** @deprecated Use Combobox component instead */\nexport function AsyncSelect<T, Rest = {}>(props: AsyncSelectProps<T> & Rest) {\n return <SelectBase {...props} />;\n}\n\n/** @deprecated Use Combobox component instead - it's virtualised by default! */\nexport function VirtualizedSelect<T, Rest = {}>(props: VirtualizedSelectProps<T> & Rest) {\n return <SelectBase virtualized {...props} />;\n}\n\n/** @deprecated Use Combobox component instead - it's virtualised by default! */\nexport function AsyncVirtualizedSelect<T, Rest = {}>(props: VirtualizedSelectAsyncProps<T> & Rest) {\n return <SelectBase virtualized {...props} />;\n}\n\ninterface AsyncMultiSelectProps<T> extends Omit<MultiSelectCommonProps<T>, 'options'>, SelectAsyncProps<T> {\n // AsyncSelect has options stored internally. We cannot enable plain values as we don't have access to the fetched options\n value?: Array<SelectableValue<T>>;\n}\n\nexport function AsyncMultiSelect<T, Rest = {}>(props: AsyncMultiSelectProps<T> & Rest) {\n // @ts-ignore\n return <SelectBase {...props} isMulti />;\n}\n\nexport { SelectContainer, type SelectContainerProps };\n","import { css, cx } from '@emotion/css';\nimport { components, ContainerProps as BaseContainerProps, GroupBase } from 'react-select';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes/ThemeContext';\nimport { getFocusStyles } from '../../themes/mixins';\nimport { sharedInputStyle } from '../Forms/commonStyles';\nimport { getInputStyles } from '../Input/Input';\n\nimport { CustomComponentProps } from './types';\n\n// prettier-ignore\nexport type SelectContainerProps<Option, isMulti extends boolean, Group extends GroupBase<Option>> =\n BaseContainerProps<Option, isMulti, Group> & CustomComponentProps<Option, isMulti, Group>;\n\nexport const SelectContainer = <Option, isMulti extends boolean, Group extends GroupBase<Option>>(\n props: SelectContainerProps<Option, isMulti, Group>\n) => {\n const {\n isDisabled,\n isFocused,\n children,\n selectProps: { invalid = false },\n } = props;\n\n const styles = useStyles2(getSelectContainerStyles, isFocused, isDisabled, invalid);\n\n return (\n <components.SelectContainer {...props} className={cx(styles.wrapper, props.className)}>\n {children}\n </components.SelectContainer>\n );\n};\n\nconst getSelectContainerStyles = (theme: GrafanaTheme2, focused: boolean, disabled: boolean, invalid: boolean) => {\n const styles = getInputStyles({ theme, invalid });\n\n return {\n wrapper: cx(\n styles.wrapper,\n sharedInputStyle(theme, invalid),\n focused && css(getFocusStyles(theme)),\n disabled && styles.inputDisabled,\n css({\n position: 'relative',\n boxSizing: 'border-box',\n /* The display property is set by the styles prop in SelectBase because it's dependant on the width prop */\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'stretch',\n justifyContent: 'space-between',\n minHeight: theme.spacing(theme.components.height.md),\n height: 'auto',\n maxWidth: '100%',\n\n /* Input padding is applied to the InputControl so the menu is aligned correctly */\n padding: 0,\n cursor: disabled ? 'not-allowed' : 'pointer',\n })\n ),\n };\n};\n","import { css, cx } from '@emotion/css';\nimport { max } from 'lodash';\nimport { RefCallback, useLayoutEffect, useMemo, useRef } from 'react';\nimport * as React from 'react';\nimport { FixedSizeList as List } from 'react-window';\n\nimport { SelectableValue, toIconName } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\n\nimport { useTheme2 } from '../../themes/ThemeContext';\nimport { Trans } from '../../utils/i18n';\nimport { clearButtonStyles } from '../Button';\nimport { Icon } from '../Icon/Icon';\nimport { ScrollContainer } from '../ScrollContainer/ScrollContainer';\n\nimport { getSelectStyles } from './getSelectStyles';\nimport { ToggleAllState } from './types';\n\nexport interface ToggleAllOptions {\n state: ToggleAllState;\n selectAllClicked: () => void;\n selectedCount?: number;\n}\n\ninterface SelectMenuProps {\n maxHeight: number;\n innerRef: RefCallback<HTMLDivElement>;\n innerProps: {};\n selectProps: {\n toggleAllOptions?: ToggleAllOptions;\n components?: { Option?: (props: React.PropsWithChildren<SelectMenuOptionProps<unknown>>) => JSX.Element };\n };\n}\n\nexport const SelectMenu = ({\n children,\n maxHeight,\n innerRef,\n innerProps,\n selectProps,\n}: React.PropsWithChildren<SelectMenuProps>) => {\n const theme = useTheme2();\n const styles = getSelectStyles(theme);\n\n const { toggleAllOptions, components } = selectProps;\n\n const optionsElement = components?.Option ?? SelectMenuOptions;\n\n return (\n <div\n {...innerProps}\n data-testid={selectors.components.Select.menu}\n className={styles.menu}\n style={{ maxHeight }}\n aria-label=\"Select options menu\"\n >\n <ScrollContainer ref={innerRef} maxHeight=\"inherit\" overflowX=\"hidden\" showScrollIndicators padding={0.5}>\n {toggleAllOptions && (\n <ToggleAllOption\n state={toggleAllOptions.state}\n optionComponent={optionsElement}\n selectedCount={toggleAllOptions.selectedCount}\n onClick={toggleAllOptions.selectAllClicked}\n ></ToggleAllOption>\n )}\n {children}\n </ScrollContainer>\n </div>\n );\n};\n\nSelectMenu.displayName = 'SelectMenu';\n\nconst VIRTUAL_LIST_ITEM_HEIGHT = 37;\nconst VIRTUAL_LIST_WIDTH_ESTIMATE_MULTIPLIER = 8;\nconst VIRTUAL_LIST_PADDING = 8;\n// Some list items have icons or checkboxes so we need some extra width\nconst VIRTUAL_LIST_WIDTH_EXTRA = 58;\n\n// A virtualized version of the SelectMenu, descriptions for SelectableValue options not supported since those are of a variable height.\n//\n// To support the virtualized list we have to \"guess\" the width of the menu container based on the longest available option.\n// the reason for this is because all of the options will be positioned absolute, this takes them out of the document and no space\n// is created for them, thus the container can't grow to accomodate.\n//\n// VIRTUAL_LIST_ITEM_HEIGHT and WIDTH_ESTIMATE_MULTIPLIER are both magic numbers.\n// Some characters (such as emojis and other unicode characters) may consist of multiple code points in which case the width would be inaccurate (but larger than needed).\ninterface VirtualSelectMenuProps<T> {\n children: React.ReactNode;\n innerRef: React.Ref<HTMLDivElement>;\n focusedOption: T;\n innerProps: JSX.IntrinsicElements['div'];\n options: T[];\n maxHeight: number;\n selectProps: {\n toggleAllOptions?: ToggleAllOptions;\n components?: { Option?: (props: React.PropsWithChildren<SelectMenuOptionProps<unknown>>) => JSX.Element };\n };\n}\n\nexport const VirtualizedSelectMenu = ({\n children,\n maxHeight,\n innerRef: scrollRef,\n options,\n selectProps,\n focusedOption,\n}: VirtualSelectMenuProps<SelectableValue>) => {\n const theme = useTheme2();\n const styles = getSelectStyles(theme);\n const listRef = useRef<List>(null);\n const { toggleAllOptions, components } = selectProps;\n\n const optionComponent = components?.Option ?? SelectMenuOptions;\n\n // we need to check for option groups (categories)\n // these are top level options with child options\n // if they exist, flatten the list of options\n const flattenedOptions = useMemo(\n () => options.flatMap((option) => (option.options ? [option, ...option.options] : [option])),\n [options]\n );\n\n // scroll the focused option into view when navigating with keyboard\n const focusedIndex = flattenedOptions.findIndex(\n (option: SelectableValue<unknown>) => option.value === focusedOption?.value\n );\n useLayoutEffect(() => {\n listRef.current?.scrollToItem(focusedIndex);\n }, [focusedIndex]);\n\n if (!Array.isArray(children)) {\n return null;\n }\n\n // flatten the children to account for any categories\n // these will have array children that are the individual options\n const flattenedChildren = children.flatMap((child, index) => {\n if (hasArrayChildren(child)) {\n // need to remove the children from the category else they end up in the DOM twice\n const childWithoutChildren = React.cloneElement(child, {\n children: null,\n });\n return [\n childWithoutChildren,\n ...child.props.children.slice(0, -1),\n // add a bottom divider to the last item in the category\n React.cloneElement(child.props.children.at(-1), {\n innerProps: {\n ...child.props.children.at(-1).props.innerProps,\n style: {\n borderBottom: `1px solid ${theme.colors.border.weak}`,\n height: VIRTUAL_LIST_ITEM_HEIGHT,\n },\n },\n }),\n ];\n }\n return [child];\n });\n\n if (toggleAllOptions) {\n flattenedChildren.unshift(\n <ToggleAllOption\n optionComponent={optionComponent}\n state={toggleAllOptions.state}\n selectedCount={toggleAllOptions.selectedCount}\n onClick={toggleAllOptions.selectAllClicked}\n ></ToggleAllOption>\n );\n }\n\n let longestOption = max(flattenedOptions.map((option) => option.label?.length)) ?? 0;\n if (toggleAllOptions && longestOption < 12) {\n longestOption = 12;\n }\n const widthEstimate =\n longestOption * VIRTUAL_LIST_WIDTH_ESTIMATE_MULTIPLIER + VIRTUAL_LIST_PADDING * 2 + VIRTUAL_LIST_WIDTH_EXTRA;\n const heightEstimate = Math.min(flattenedChildren.length * VIRTUAL_LIST_ITEM_HEIGHT, maxHeight);\n\n return (\n <List\n outerRef={scrollRef}\n ref={listRef}\n className={styles.menu}\n height={heightEstimate}\n width={widthEstimate}\n aria-label=\"Select options menu\"\n itemCount={flattenedChildren.length}\n itemSize={VIRTUAL_LIST_ITEM_HEIGHT}\n >\n {({ index, style }) => <div style={{ ...style, overflow: 'hidden' }}>{flattenedChildren[index]}</div>}\n </List>\n );\n};\n\n// check if a child has array children (and is therefore a react-select group)\n// we need to flatten these so the correct count and elements are passed to the virtualized list\nconst hasArrayChildren = (child: React.ReactNode) => {\n return React.isValidElement(child) && Array.isArray(child.props.children);\n};\n\nVirtualizedSelectMenu.displayName = 'VirtualizedSelectMenu';\n\ninterface SelectMenuOptionProps<T> {\n isDisabled: boolean;\n isFocused: boolean;\n isSelected: boolean;\n indeterminate?: boolean;\n innerProps: JSX.IntrinsicElements['div'];\n innerRef: RefCallback<HTMLDivElement>;\n renderOptionLabel?: (value: SelectableValue<T>) => JSX.Element;\n data: SelectableValue<T>;\n}\n\nconst ToggleAllOption = ({\n state,\n onClick,\n selectedCount,\n optionComponent,\n}: {\n state: ToggleAllState;\n onClick: () => void;\n selectedCount?: number;\n optionComponent: (props: React.PropsWithChildren<SelectMenuOptionProps<unknown>>) => JSX.Element;\n}) => {\n const theme = useTheme2();\n const styles = getSelectStyles(theme);\n\n return (\n <button\n data-testid={selectors.components.Select.toggleAllOptions}\n className={css(clearButtonStyles(theme), styles.toggleAllButton, {\n height: VIRTUAL_LIST_ITEM_HEIGHT,\n })}\n onClick={onClick}\n >\n {optionComponent({\n isDisabled: false,\n isSelected: state === ToggleAllState.allSelected,\n isFocused: false,\n data: {},\n indeterminate: state === ToggleAllState.indeterminate,\n innerRef: () => {},\n innerProps: {},\n children: (\n <>\n <Trans i18nKey=\"select.select-menu.selected-count\">Selected </Trans>\n {`(${selectedCount ?? 0})`}\n </>\n ),\n })}\n </button>\n );\n};\n\nexport const SelectMenuOptions = ({\n children,\n data,\n innerProps,\n innerRef,\n isFocused,\n isSelected,\n renderOptionLabel,\n}: React.PropsWithChildren<SelectMenuOptionProps<unknown>>) => {\n const theme = useTheme2();\n const styles = getSelectStyles(theme);\n const icon = data.icon ? toIconName(data.icon) : undefined;\n // We are removing onMouseMove and onMouseOver from innerProps because they cause the whole\n // list to re-render everytime the user hovers over an option. This is a performance issue.\n // See https://github.com/JedWatson/react-select/issues/3128#issuecomment-451936743\n const { onMouseMove, onMouseOver, ...rest } = innerProps;\n\n return (\n <div\n ref={innerRef}\n className={cx(\n styles.option,\n isFocused && styles.optionFocused,\n isSelected && styles.optionSelected,\n data.isDisabled && styles.optionDisabled\n )}\n {...rest}\n data-testid={selectors.components.Select.option}\n title={data.title}\n >\n {icon && <Icon name={icon} className={styles.optionIcon} />}\n {data.imgUrl && <img className={styles.optionImage} src={data.imgUrl} alt={data.label || String(data.value)} />}\n <div className={styles.optionBody}>\n <span>{renderOptionLabel ? renderOptionLabel(data) : children}</span>\n {data.description && <div className={styles.optionDescription}>{data.description}</div>}\n {data.component && <data.component />}\n </div>\n </div>\n );\n};\n\nSelectMenuOptions.displayName = 'SelectMenuOptions';\n","import { useEffect, useRef, useState } from 'react';\n\ntype DelayOptions = {\n // Minimal amount of time the switch will be on.\n duration?: number;\n // Delay after which switch will turn on.\n delay?: number;\n};\n\n/**\n * Hook that delays changing of boolean switch to prevent too much time spent in \"on\" state. It is kind of a throttle\n * but you can specify different time for on and off throttling so this only allows a boolean values and also prefers\n * to stay \"off\" so turning \"on\" is always delayed while turning \"off\" is throttled.\n *\n * This is useful for showing loading elements to prevent it flashing too much in case of quick loading time or\n * prevent it flash if loaded state comes right after switch to loading.\n */\nexport function useDelayedSwitch(value: boolean, options: DelayOptions = {}): boolean {\n const { duration = 250, delay = 250 } = options;\n\n const [delayedValue, setDelayedValue] = useState(value);\n const onStartTime = useRef<Date | undefined>();\n\n useEffect(() => {\n let timeout: ReturnType<typeof setTimeout> | undefined;\n if (value) {\n // If toggling to \"on\" state we always setTimeout no matter how long we have been \"off\".\n timeout = setTimeout(() => {\n onStartTime.current = new Date();\n setDelayedValue(value);\n }, delay);\n } else {\n // If toggling to \"off\" state we check how much time we were already \"on\".\n const timeSpent = onStartTime.current ? Date.now() - onStartTime.current.valueOf() : 0;\n const turnOff = () => {\n onStartTime.current = undefined;\n setDelayedValue(value);\n };\n if (timeSpent >= duration) {\n // We already spent enough time \"on\" so change right away.\n turnOff();\n } else {\n timeout = setTimeout(turnOff, duration - timeSpent);\n }\n }\n return () => {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n };\n }, [value, duration, delay]);\n\n return delayedValue;\n}\n","import { css, cx } from '@emotion/css';\nimport { components, GroupBase, SingleValueProps } from 'react-select';\n\nimport { GrafanaTheme2, SelectableValue, toIconName } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes';\nimport { useDelayedSwitch } from '../../utils/useDelayedSwitch';\nimport { Icon } from '../Icon/Icon';\nimport { Spinner } from '../Spinner/Spinner';\nimport { FadeTransition } from '../transitions/FadeTransition';\nimport { SlideOutTransition } from '../transitions/SlideOutTransition';\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n singleValue: css({\n label: 'singleValue',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n boxSizing: 'border-box',\n maxWidth: '100%',\n gridArea: '1 / 1 / 2 / 3',\n }),\n spinnerWrapper: css({\n width: '16px',\n height: '16px',\n display: 'inline-block',\n marginRight: '10px',\n position: 'relative',\n verticalAlign: 'middle',\n overflow: 'hidden',\n }),\n spinnerIcon: css({\n width: '100%',\n height: '100%',\n position: 'absolute',\n }),\n optionIcon: css({\n marginRight: theme.spacing(1),\n color: theme.colors.text.secondary,\n }),\n disabled: css({\n color: theme.colors.text.disabled,\n }),\n isOpen: css({\n color: theme.colors.text.disabled,\n }),\n };\n};\n\ntype StylesType = ReturnType<typeof getStyles>;\n\nexport type Props<T> = SingleValueProps<SelectableValue<T>, boolean, GroupBase<SelectableValue<T>>>;\n\nexport const SingleValue = <T extends unknown>(props: Props<T>) => {\n const { children, data, isDisabled } = props;\n const styles = useStyles2(getStyles);\n const loading = useDelayedSwitch(data.loading || false, { delay: 250, duration: 750 });\n const icon = data.icon ? toIconName(data.icon) : undefined;\n\n return (\n <components.SingleValue\n {...props}\n className={cx(styles.singleValue, isDisabled && styles.disabled, props.selectProps.menuIsOpen && styles.isOpen)}\n >\n {data.imgUrl ? (\n <FadeWithImage loading={loading} imgUrl={data.imgUrl} styles={styles} alt={String(data.label ?? data.value)} />\n ) : (\n <>\n <SlideOutTransition horizontal size={16} visible={loading} duration={150}>\n <div className={styles.spinnerWrapper}>\n <Spinner className={styles.spinnerIcon} inline />\n </div>\n </SlideOutTransition>\n {icon && <Icon name={icon} role=\"img\" className={styles.optionIcon} />}\n </>\n )}\n\n {!data.hideText && children}\n </components.SingleValue>\n );\n};\n\nconst FadeWithImage = (props: { loading: boolean; imgUrl: string; styles: StylesType; alt?: string }) => {\n return (\n <div className={props.styles.spinnerWrapper}>\n <FadeTransition duration={150} visible={props.loading}>\n <Spinner className={props.styles.spinnerIcon} inline />\n </FadeTransition>\n <FadeTransition duration={150} visible={!props.loading}>\n <img className={props.styles.spinnerIcon} src={props.imgUrl} alt={props.alt} />\n </FadeTransition>\n </div>\n );\n};\n","import { css } from '@emotion/css';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { stylesFactory } from '../../themes/stylesFactory';\n\nexport const getSelectStyles = stylesFactory((theme: GrafanaTheme2) => {\n return {\n menu: css({\n label: 'grafana-select-menu',\n background: theme.components.dropdown.background,\n borderRadius: theme.shape.radius.default,\n boxShadow: theme.shadows.z3,\n position: 'relative',\n minWidth: '100%',\n overflow: 'hidden',\n zIndex: 1,\n }),\n option: css({\n label: 'grafana-select-option',\n padding: '8px',\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n whiteSpace: 'nowrap',\n cursor: 'pointer',\n borderLeft: '2px solid transparent',\n borderRadius: theme.shape.radius.default,\n\n '&:hover': {\n background: theme.colors.action.hover,\n '@media (forced-colors: active), (prefers-contrast: more)': {\n border: `1px solid ${theme.colors.primary.border}`,\n },\n },\n }),\n optionIcon: css({\n marginRight: theme.spacing(1),\n }),\n optionImage: css({\n label: 'grafana-select-option-image',\n width: '16px',\n marginRight: '10px',\n }),\n optionDescription: css({\n label: 'grafana-select-option-description',\n fontWeight: 'normal',\n fontSize: theme.typography.size.sm,\n color: theme.colors.text.secondary,\n whiteSpace: 'normal',\n lineHeight: theme.typography.body.lineHeight,\n }),\n optionBody: css({\n label: 'grafana-select-option-body',\n display: 'flex',\n fontWeight: theme.typography.fontWeightMedium,\n flexDirection: 'column',\n flexGrow: 1,\n }),\n optionFocused: css({\n label: 'grafana-select-option-focused',\n background: theme.colors.action.focus,\n '@media (forced-colors: active), (prefers-contrast: more)': {\n border: `1px solid ${theme.colors.primary.border}`,\n },\n }),\n optionSelected: css({\n background: theme.colors.action.selected,\n '&::before': {\n backgroundImage: theme.colors.gradients.brandVertical,\n borderRadius: theme.shape.radius.default,\n content: '\" \"',\n display: 'block',\n height: '100%',\n position: 'absolute',\n transform: 'translateX(-50%)',\n width: theme.spacing(0.5),\n left: 0,\n },\n }),\n optionDisabled: css({\n label: 'grafana-select-option-disabled',\n backgroundColor: theme.colors.action.disabledBackground,\n color: theme.colors.action.disabledText,\n cursor: 'not-allowed',\n }),\n singleValue: css({\n label: 'grafana-select-single-value',\n color: theme.components.input.text,\n gridArea: '1 / 1 / 2 / 3',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n boxSizing: 'border-box',\n maxWidth: '100%',\n }),\n valueContainer: css({\n label: 'grafana-select-value-container',\n alignItems: 'center',\n display: 'grid',\n position: 'relative',\n boxSizing: 'border-box',\n flex: '1 1 0%',\n outline: 'none',\n overflow: 'hidden',\n }),\n valueContainerMulti: css({\n label: 'grafana-select-value-container-multi',\n flexWrap: 'wrap',\n display: 'flex',\n }),\n valueContainerMultiNoWrap: css({\n display: 'grid',\n gridAutoFlow: 'column',\n }),\n loadingMessage: css({\n label: 'grafana-select-loading-message',\n padding: theme.spacing(1),\n textAlign: 'center',\n width: '100%',\n }),\n multiValueContainer: css({\n label: 'grafana-select-multi-value-container',\n display: 'flex',\n alignItems: 'center',\n lineHeight: 1,\n background: theme.colors.background.secondary,\n borderRadius: theme.shape.radius.default,\n margin: theme.spacing(0.25, 1, 0.25, 0),\n padding: theme.spacing(0.25, 0, 0.25, 1),\n color: theme.colors.text.primary,\n fontSize: theme.typography.size.sm,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n\n '&:hover': {\n background: theme.colors.emphasize(theme.colors.background.secondary),\n },\n }),\n multiValueRemove: css({\n label: 'grafana-select-multi-value-remove',\n margin: theme.spacing(0, 0.5),\n cursor: 'pointer',\n svg: {\n marginBottom: 0,\n },\n }),\n singleValueRemove: css({\n cursor: 'pointer',\n '&:hover': {\n color: theme.colors.text.primary,\n },\n }),\n groupHeader: css({\n padding: theme.spacing(1, 1, 1, 0.75),\n borderLeft: '2px solid transparent',\n }),\n group: css({\n '&:not(:first-child)': {\n borderTop: `1px solid ${theme.colors.border.weak}`,\n },\n // ensure there's a bottom border if there are options following the group\n ':has(+ [role=\"option\"])': {\n borderBottom: `1px solid ${theme.colors.border.weak}`,\n },\n }),\n toggleAllButton: css({\n width: '100%',\n border: 0,\n padding: 0,\n textAlign: 'left',\n }),\n };\n});\n","import { useMemo } from 'react';\nimport { CSSObjectWithLabel } from 'react-select';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nexport default function resetSelectStyles(theme: GrafanaTheme2) {\n return {\n clearIndicator: () => ({}),\n container: () => ({}),\n control: () => ({}),\n dropdownIndicator: () => ({}),\n group: () => ({}),\n groupHeading: () => ({}),\n indicatorsContainer: () => ({}),\n indicatorSeparator: () => ({}),\n input: function (originalStyles: CSSObjectWithLabel) {\n return {\n ...originalStyles,\n color: 'inherit',\n margin: 0,\n padding: 0,\n // Set an explicit z-index here to ensure this element always overlays the singleValue\n zIndex: 1,\n overflow: 'hidden',\n };\n },\n loadingIndicator: () => ({}),\n loadingMessage: () => ({}),\n menu: () => ({}),\n menuList: ({ maxHeight }: { maxHeight: number }) => ({\n maxHeight,\n }),\n multiValue: () => ({}),\n multiValueLabel: () => ({\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }),\n multiValueRemove: () => ({}),\n noOptionsMessage: () => ({}),\n option: () => ({}),\n placeholder: (originalStyles: CSSObjectWithLabel) => ({\n ...originalStyles,\n color: theme.colors.text.secondary,\n }),\n singleValue: () => ({}),\n valueContainer: () => ({}),\n };\n}\n\nexport function useCustomSelectStyles(theme: GrafanaTheme2, width: number | string | undefined) {\n return useMemo(() => {\n return {\n ...resetSelectStyles(theme),\n menuPortal: (base: any) => {\n // Would like to correct top position when menu is placed bottom, but have props are not sent to this style function.\n // Only state is. https://github.com/JedWatson/react-select/blob/master/packages/react-select/src/components/Menu.tsx#L605\n return {\n ...base,\n zIndex: theme.zIndex.portal,\n };\n },\n //These are required for the menu positioning to function\n menu: ({ top, bottom, position }: any) => {\n return {\n top,\n bottom,\n position,\n minWidth: '100%',\n zIndex: theme.zIndex.dropdown,\n };\n },\n container: () => ({\n width: width ? theme.spacing(width) : '100%',\n display: width === 'auto' ? 'inline-flex' : 'flex',\n }),\n option: (provided: any, state: any) => ({\n ...provided,\n opacity: state.isDisabled ? 0.5 : 1,\n }),\n };\n }, [theme, width]);\n}\n","import * as React from 'react';\nimport {\n ActionMeta as SelectActionMeta,\n CommonProps as ReactSelectCommonProps,\n GroupBase,\n OptionsOrGroups,\n} from 'react-select';\n\nimport { SelectableValue } from '@grafana/data';\n\nexport type SelectValue<T> = T | SelectableValue<T> | T[] | Array<SelectableValue<T>>;\nexport type ActionMeta = SelectActionMeta<{}>;\nexport type InputActionMeta = {\n action: 'set-value' | 'input-change' | 'input-blur' | 'menu-close';\n};\nexport type LoadOptionsCallback<T> = (options: Array<SelectableValue<T>>) => void;\n\nexport enum ToggleAllState {\n allSelected = 'allSelected',\n indeterminate = 'indeterminate',\n noneSelected = 'noneSelected',\n}\n\nexport interface SelectCommonProps<T> {\n /** Aria label applied to the input field */\n ['aria-label']?: string;\n ['data-testid']?: string;\n allowCreateWhileLoading?: boolean;\n allowCustomValue?: boolean;\n /** Focus is set to the Select when rendered*/\n autoFocus?: boolean;\n backspaceRemovesValue?: boolean;\n blurInputOnSelect?: boolean;\n captureMenuScroll?: boolean;\n className?: string;\n closeMenuOnSelect?: boolean;\n /** Used for custom components. For more information, see `react-select` */\n components?: any;\n /** Sets the position of the createOption element in your options list. Defaults to 'last' */\n createOptionPosition?: 'first' | 'last';\n defaultValue?: any;\n disabled?: boolean;\n filterOption?: (option: SelectableValue<T>, searchQuery: string) => boolean;\n formatOptionLabel?: (item: SelectableValue<T>, formatOptionMeta: FormatOptionLabelMeta<T>) => React.ReactNode;\n /** Function for formatting the text that is displayed when creating a new value*/\n formatCreateLabel?: (input: string) => React.ReactNode;\n getOptionLabel?: (item: SelectableValue<T>) => React.ReactNode;\n getOptionValue?: (item: SelectableValue<T>) => T | undefined;\n hideSelectedOptions?: boolean;\n inputValue?: string;\n invalid?: boolean;\n isClearable?: boolean;\n /** The id to set on the SelectContainer component. To set the id for a label (with htmlFor), @see inputId instead */\n id?: string;\n isLoading?: boolean;\n isMulti?: boolean;\n /** The id of the search input. Use this to set a matching label with htmlFor */\n inputId?: string;\n isOpen?: boolean;\n /** Disables the possibility to type into the input*/\n isSearchable?: boolean;\n showAllSelectedWhenOpen?: boolean;\n maxMenuHeight?: number;\n minMenuHeight?: number;\n maxVisibleValues?: number;\n menuPlacement?: 'auto' | 'bottom' | 'top';\n menuPosition?: 'fixed' | 'absolute';\n /**\n * Setting to false will prevent the menu from portalling to the body.\n */\n menuShouldPortal?: boolean;\n /** The message to display when no options could be found */\n noOptionsMessage?: string;\n onBlur?: () => void;\n onChange: (value: SelectableValue<T>, actionMeta: ActionMeta) => {} | void;\n onCloseMenu?: () => void;\n /** allowCustomValue must be enabled. Function decides what to do with that custom value. */\n onCreateOption?: (value: string) => void;\n onInputChange?: (value: string, actionMeta: InputActionMeta) => void;\n onKeyDown?: (event: React.KeyboardEvent) => void;\n /** Callback which fires when the user scrolls to the bottom of the menu */\n onMenuScrollToBottom?: (event: WheelEvent | TouchEvent) => void;\n /** Callback which fires when the user scrolls to the top of the menu */\n onMenuScrollToTop?: (event: WheelEvent | TouchEvent) => void;\n onOpenMenu?: () => void;\n onFocus?: () => void;\n toggleAllOptions?: {\n enabled: boolean;\n optionsFilter?: (v: SelectableValue<T>) => boolean;\n determineToggleAllState?: (\n selectedValues: Array<SelectableValue<T>>,\n options: Array<SelectableValue<T>>\n ) => ToggleAllState;\n };\n openMenuOnFocus?: boolean;\n options?: Array<SelectableValue<T>>;\n placeholder?: string;\n /** item to be rendered in front of the input */\n prefix?: JSX.Element | string | null;\n /** Use a custom element to control Select. A proper ref to the renderControl is needed if 'portal' isn't set to null*/\n renderControl?: ControlComponent<T>;\n tabSelectsValue?: boolean;\n value?: T | SelectValue<T> | null;\n /** Will wrap the MenuList in a react-window FixedSizeVirtualList for improved performance, does not support options with \"description\" properties */\n virtualized?: boolean;\n /** Sets the width to a multiple of 8px. Should only be used with inline forms. Setting width of the container is preferred in other cases.*/\n width?: number | 'auto';\n isOptionDisabled?: (option: SelectableValue<T>) => boolean;\n /** allowCustomValue must be enabled. Determines whether the \"create new\" option should be displayed based on the current input value, select value and options array. */\n isValidNewOption?: (\n inputValue: string,\n value: SelectableValue<T> | null,\n options: OptionsOrGroups<SelectableValue<T>, GroupBase<SelectableValue<T>>>\n ) => boolean;\n /** Message to display isLoading=true*/\n loadingMessage?: string;\n /** Disables wrapping of multi value values when closed */\n noMultiValueWrap?: boolean;\n}\n\nexport interface SelectAsyncProps<T> {\n /** When specified as boolean the loadOptions will execute when component is mounted */\n defaultOptions?: boolean | Array<SelectableValue<T>>;\n\n /** Asynchronously load select options */\n loadOptions?: (query: string, cb?: LoadOptionsCallback<T>) => Promise<Array<SelectableValue<T>>> | void;\n\n /** If cacheOptions is true, then the loaded data will be cached. The cache will remain until cacheOptions changes value. */\n cacheOptions?: boolean;\n /** Message to display when options are loading */\n loadingMessage?: string;\n}\n\n/** The VirtualizedSelect component uses a slightly different SelectableValue, description and other props are not supported */\nexport interface VirtualizedSelectProps<T> extends Omit<SelectCommonProps<T>, 'virtualized'> {\n options?: Array<Pick<SelectableValue<T>, 'label' | 'value'>>;\n}\n\n/** The AsyncVirtualizedSelect component uses a slightly different SelectableValue, description and other props are not supported */\nexport interface VirtualizedSelectAsyncProps<T>\n extends Omit<SelectCommonProps<T>, 'virtualized'>,\n SelectAsyncProps<T> {}\n\nexport interface MultiSelectCommonProps<T> extends Omit<SelectCommonProps<T>, 'onChange' | 'isMulti' | 'value'> {\n value?: Array<SelectableValue<T>> | T[];\n onChange: (item: Array<SelectableValue<T>>, actionMeta: ActionMeta) => {} | void;\n}\n\n// This is the type of *our* SelectBase component, not ReactSelect's prop, although\n// they should be mostly compatible.\nexport interface SelectBaseProps<T> extends SelectCommonProps<T>, SelectAsyncProps<T> {\n invalid?: boolean;\n}\n\n// This is used for the `renderControl` prop on *our* SelectBase component\nexport interface CustomControlProps<T> {\n ref: React.Ref<any>;\n isOpen: boolean;\n /** Currently selected value */\n value?: SelectableValue<T>;\n /** onClick will be automatically passed to custom control allowing menu toggle */\n onClick: () => void;\n /** onBlur will be automatically passed to custom control closing the menu on element blur */\n onBlur: () => void;\n disabled: boolean;\n invalid: boolean;\n}\n\nexport type ControlComponent<T> = React.ComponentType<CustomControlProps<T>>;\n\nexport interface SelectableOptGroup<T = any> {\n label: string;\n options: Array<SelectableValue<T>>;\n\n [key: string]: any;\n}\n\nexport type SelectOptions<T = any> =\n | SelectableValue<T>\n | Array<SelectableValue<T> | SelectableOptGroup<T> | Array<SelectableOptGroup<T>>>;\n\nexport type FormatOptionLabelMeta<T> = { context: string; inputValue: string; selectValue: Array<SelectableValue<T>> };\n\n// This is the type of `selectProps` our custom components (like SelectContainer, etc) recieve\n// It's slightly different to the base react select props because we pass in additional props directly to\n// react select\nexport type ReactSelectProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = ReactSelectCommonProps<\n Option,\n IsMulti,\n Group\n>['selectProps'] & {\n invalid: boolean;\n};\n\n// Use this type when implementing custom components for react select.\n// See SelectContainerProps in SelectContainer.tsx\nexport interface CustomComponentProps<Option, isMulti extends boolean, Group extends GroupBase<Option>> {\n selectProps: ReactSelectProps<Option, isMulti, Group>;\n}\n","import { cx, css } from '@emotion/css';\nimport * as React from 'react';\nimport SVG from 'react-inlinesvg';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes';\nimport { IconSize, isIconSize } from '../../types';\nimport { t } from '../../utils/i18n';\nimport { spin } from '../../utils/keyframes';\nimport { Icon } from '../Icon/Icon';\nimport { getIconRoot, getIconSubDir } from '../Icon/utils';\n\nexport interface Props {\n className?: string;\n style?: React.CSSProperties;\n iconClassName?: string;\n inline?: boolean;\n size?: IconSize;\n}\n\n/**\n * @deprecated\n * use a predefined size, e.g. 'md' or 'lg' instead\n */\ninterface PropsWithDeprecatedSize extends Omit<Props, 'size'> {\n size?: number | string;\n}\n\n/**\n * @public\n */\nexport const Spinner = ({\n className,\n inline = false,\n iconClassName,\n style,\n size = 'md',\n}: Props | PropsWithDeprecatedSize) => {\n const styles = useStyles2(getStyles);\n\n const deprecatedStyles = useStyles2(getDeprecatedStyles, size);\n const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n const iconName = prefersReducedMotion ? 'hourglass' : 'spinner';\n\n // this entire if statement is handling the deprecated size prop\n // TODO remove once we fully remove the deprecated type\n if (typeof size !== 'string' || !isIconSize(size)) {\n const iconRoot = getIconRoot();\n const subDir = getIconSubDir(iconName, 'default');\n const svgPath = `${iconRoot}${subDir}/${iconName}.svg`;\n return (\n <div\n data-testid=\"Spinner\"\n style={style}\n className={cx(\n {\n [styles.inline]: inline,\n },\n deprecatedStyles.wrapper,\n className\n )}\n >\n <SVG\n src={svgPath}\n width={size}\n height={size}\n className={cx(styles.spin, deprecatedStyles.icon, className)}\n style={style}\n />\n </div>\n );\n }\n\n return (\n <div\n data-testid=\"Spinner\"\n style={style}\n className={cx(\n {\n [styles.inline]: inline,\n },\n className\n )}\n >\n <Icon\n className={cx(styles.spin, iconClassName)}\n name={iconName}\n size={size}\n aria-label={t('grafana-ui.spinner.aria-label', 'Loading')}\n />\n </div>\n );\n};\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n inline: css({\n display: 'inline-block',\n }),\n spin: css({\n [theme.transitions.handleMotion('no-preference')]: {\n animation: `${spin} 2s infinite linear`,\n },\n }),\n});\n\n// TODO remove once we fully remove the deprecated type\nconst getDeprecatedStyles = (theme: GrafanaTheme2, size: number | string) => ({\n wrapper: css({\n fontSize: typeof size === 'string' ? size : `${size}px`,\n }),\n icon: css({\n display: 'inline-block',\n fill: 'currentColor',\n flexShrink: 0,\n label: 'Icon',\n // line-height: 0; is needed for correct icon alignment in Safari\n lineHeight: 0,\n verticalAlign: 'middle',\n }),\n});\n","import { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';\nimport * as React from 'react';\nimport ReactDOMServer from 'react-dom/server';\n\nimport { Tooltip } from '../Tooltip/Tooltip';\n\ninterface TruncatedTextProps {\n childElement: (ref: React.ForwardedRef<HTMLElement> | undefined) => React.ReactElement;\n children: NonNullable<React.ReactNode>;\n}\n\nexport const TruncatedText = React.forwardRef<HTMLElement, TruncatedTextProps>(({ childElement, children }, ref) => {\n const [isOverflowing, setIsOverflowing] = useState(false);\n const internalRef = useRef<HTMLElement>(null);\n\n // Wire up the forwarded ref to the internal ref\n useImperativeHandle<HTMLElement | null, HTMLElement | null>(ref, () => internalRef.current);\n\n const resizeObserver = useMemo(\n () =>\n new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (entry.target.clientWidth && entry.target.scrollWidth) {\n if (entry.target.scrollWidth > entry.target.clientWidth) {\n setIsOverflowing(true);\n }\n if (entry.target.scrollWidth <= entry.target.clientWidth) {\n setIsOverflowing(false);\n }\n }\n }\n }),\n []\n );\n\n useEffect(() => {\n const { current } = internalRef;\n if (current) {\n resizeObserver.observe(current);\n }\n return () => {\n resizeObserver.disconnect();\n };\n }, [setIsOverflowing, resizeObserver]);\n\n const getTooltipText = (children: NonNullable<React.ReactNode>) => {\n if (typeof children === 'string') {\n return children;\n }\n const html = ReactDOMServer.renderToStaticMarkup(<>{children}</>);\n return html.replace(/(<([^>]+)>)/gi, '');\n };\n\n if (isOverflowing) {\n return (\n <Tooltip ref={internalRef} content={getTooltipText(children)}>\n {childElement(undefined)}\n </Tooltip>\n );\n } else {\n return childElement(internalRef);\n }\n});\n\nTruncatedText.displayName = 'TruncatedText';\n","import { css } from '@emotion/css';\nimport { createElement, CSSProperties } from 'react';\nimport * as React from 'react';\n\nimport { GrafanaTheme2, ThemeTypographyVariantTypes } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes';\n\nimport { TruncatedText } from './TruncatedText';\nimport { customWeight, customColor, customVariant } from './utils';\n\nexport interface TextProps extends Omit<React.HTMLAttributes<HTMLElement>, 'className' | 'style'> {\n /** Defines what HTML element is defined underneath. \"span\" by default */\n element?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'p';\n /** What typograpy variant should be used for the component. Only use if default variant for the defined element is not what is needed */\n variant?: keyof ThemeTypographyVariantTypes;\n /** Override the default weight for the used variant */\n weight?: 'light' | 'regular' | 'medium' | 'bold';\n /** Color to use for text */\n color?: keyof GrafanaTheme2['colors']['text'] | 'error' | 'success' | 'warning' | 'info';\n /** Use to cut the text off with ellipsis if there isn't space to show all of it. On hover shows the rest of the text */\n truncate?: boolean;\n /** If true, show the text as italic. False by default */\n italic?: boolean;\n /** If true, numbers will have fixed width, useful for displaying tabular data. False by default */\n tabular?: boolean;\n /** Whether to align the text to left, center or right */\n textAlignment?: CSSProperties['textAlign'];\n children: NonNullable<React.ReactNode>;\n}\n\nexport const Text = React.forwardRef<HTMLElement, TextProps>(\n (\n { element = 'span', variant, weight, color, truncate, italic, textAlignment, children, tabular, ...restProps },\n ref\n ) => {\n const styles = useStyles2(getTextStyles, element, variant, color, weight, truncate, italic, textAlignment, tabular);\n\n const childElement = (ref: React.ForwardedRef<HTMLElement> | undefined) => {\n return createElement(\n element,\n {\n ...restProps,\n style: undefined, // Remove the style prop to avoid overriding the styles\n className: styles,\n // When overflowing, the internalRef is passed to the tooltip, which forwards it to the child element\n ref,\n },\n children\n );\n };\n\n // A 'span' is an inline element, so it can't be truncated\n // and it should be wrapped in a parent element that will show the tooltip\n if (!truncate || element === 'span') {\n return childElement(undefined);\n }\n\n return (\n <TruncatedText\n childElement={childElement}\n // eslint-disable-next-line react/no-children-prop\n children={children}\n ref={ref}\n />\n );\n }\n);\n\nText.displayName = 'Text';\n\nconst getTextStyles = (\n theme: GrafanaTheme2,\n element?: TextProps['element'],\n variant?: keyof ThemeTypographyVariantTypes,\n color?: TextProps['color'],\n weight?: TextProps['weight'],\n truncate?: TextProps['truncate'],\n italic?: TextProps['italic'],\n textAlignment?: TextProps['textAlignment'],\n tabular?: TextProps['tabular']\n) => {\n return css([\n {\n margin: 0,\n padding: 0,\n ...customVariant(theme, element, variant),\n },\n variant && {\n ...theme.typography[variant],\n },\n color && {\n color: customColor(color, theme),\n },\n weight && {\n fontWeight: customWeight(weight, theme),\n },\n truncate && {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n italic && {\n fontStyle: 'italic',\n },\n textAlignment && {\n textAlign: textAlignment,\n },\n tabular && {\n fontFeatureSettings: '\"tnum\"',\n },\n ]);\n};\n","import { GrafanaTheme2, ThemeTypographyVariantTypes } from '@grafana/data';\n\nimport { TextProps } from './Text';\n\nexport const customWeight = (weight: TextProps['weight'], theme: GrafanaTheme2): number => {\n switch (weight) {\n case 'bold':\n return theme.typography.fontWeightBold;\n case 'medium':\n return theme.typography.fontWeightMedium;\n case 'light':\n return theme.typography.fontWeightLight;\n case 'regular':\n case undefined:\n return theme.typography.fontWeightRegular;\n }\n};\n\nexport const customColor = (color: TextProps['color'], theme: GrafanaTheme2): string | undefined => {\n switch (color) {\n case 'error':\n return theme.colors.error.text;\n case 'success':\n return theme.colors.success.text;\n case 'info':\n return theme.colors.info.text;\n case 'warning':\n return theme.colors.warning.text;\n default:\n return color ? theme.colors.text[color] : undefined;\n }\n};\n\nexport const customVariant = (\n theme: GrafanaTheme2,\n element: TextProps['element'],\n variant?: keyof ThemeTypographyVariantTypes\n) => {\n if (variant) {\n return theme.typography[variant];\n }\n switch (element) {\n //Span elements does not have a default variant to be able to take the parents style\n case 'span':\n return;\n case 'h1':\n return theme.typography.h1;\n case 'h2':\n return theme.typography.h2;\n case 'h3':\n return theme.typography.h3;\n case 'h4':\n return theme.typography.h4;\n case 'h5':\n return theme.typography.h5;\n case 'h6':\n return theme.typography.h6;\n default:\n return theme.typography.body;\n }\n};\n","import {\n arrow,\n autoUpdate,\n flip,\n FloatingArrow,\n offset,\n shift,\n useDismiss,\n useFloating,\n useFocus,\n useHover,\n useInteractions,\n} from '@floating-ui/react';\nimport { forwardRef, cloneElement, isValidElement, useCallback, useId, useRef, useState } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\n\nimport { useStyles2 } from '../../themes/ThemeContext';\nimport { buildTooltipTheme, getPlacement } from '../../utils/tooltipUtils';\nimport { Portal } from '../Portal/Portal';\n\nimport { PopoverContent, TooltipPlacement } from './types';\n\nexport interface TooltipProps {\n theme?: 'info' | 'error' | 'info-alt';\n show?: boolean;\n placement?: TooltipPlacement;\n content: PopoverContent;\n children: JSX.Element;\n /**\n * Set to true if you want the tooltip to stay long enough so the user can move mouse over content to select text or click a link\n */\n interactive?: boolean;\n}\n\nexport const Tooltip = forwardRef<HTMLElement, TooltipProps>(\n ({ children, theme, interactive, show, placement, content }, forwardedRef) => {\n const arrowRef = useRef(null);\n const [controlledVisible, setControlledVisible] = useState(show);\n const isOpen = show ?? controlledVisible;\n\n // the order of middleware is important!\n // `arrow` should almost always be at the end\n // see https://floating-ui.com/docs/arrow#order\n const middleware = [\n offset(8),\n flip({\n fallbackAxisSideDirection: 'end',\n // see https://floating-ui.com/docs/flip#combining-with-shift\n crossAxis: false,\n boundary: document.body,\n }),\n shift(),\n arrow({\n element: arrowRef,\n }),\n ];\n\n const { context, refs, floatingStyles } = useFloating({\n open: isOpen,\n placement: getPlacement(placement),\n onOpenChange: setControlledVisible,\n middleware,\n whileElementsMounted: autoUpdate,\n });\n const tooltipId = useId();\n\n const hover = useHover(context, {\n delay: {\n close: interactive ? 100 : 0,\n },\n move: false,\n });\n const focus = useFocus(context);\n const dismiss = useDismiss(context);\n\n const { getReferenceProps, getFloatingProps } = useInteractions([dismiss, hover, focus]);\n\n const contentIsFunction = typeof content === 'function';\n\n const styles = useStyles2(getStyles);\n const style = styles[theme ?? 'info'];\n\n const handleRef = useCallback(\n (ref: HTMLElement | null) => {\n refs.setReference(ref);\n\n if (typeof forwardedRef === 'function') {\n forwardedRef(ref);\n } else if (forwardedRef) {\n forwardedRef.current = ref;\n }\n },\n [forwardedRef, refs]\n );\n\n // if the child has a matching aria-label, this should take precedence over the tooltip content\n // otherwise we end up double announcing things in e.g. IconButton\n const childHasMatchingAriaLabel = 'aria-label' in children.props && children.props['aria-label'] === content;\n\n return (\n <>\n {cloneElement(children, {\n ref: handleRef,\n tabIndex: 0, // tooltip trigger should be keyboard focusable\n 'aria-describedby': !childHasMatchingAriaLabel && isOpen ? tooltipId : undefined,\n ...getReferenceProps(),\n })}\n {isOpen && (\n <Portal>\n <div ref={refs.setFloating} style={floatingStyles} {...getFloatingProps()}>\n <FloatingArrow className={style.arrow} ref={arrowRef} context={context} />\n <div\n data-testid={selectors.components.Tooltip.container}\n id={tooltipId}\n role=\"tooltip\"\n className={style.container}\n >\n {typeof content === 'string' && content}\n {isValidElement(content) && cloneElement(content)}\n {contentIsFunction && content({})}\n </div>\n </div>\n </Portal>\n )}\n </>\n );\n }\n);\n\nTooltip.displayName = 'Tooltip';\n\nexport const getStyles = (theme: GrafanaTheme2) => {\n const info = buildTooltipTheme(\n theme,\n theme.components.tooltip.background,\n theme.components.tooltip.background,\n theme.components.tooltip.text,\n { topBottom: 0.5, rightLeft: 1 }\n );\n const error = buildTooltipTheme(\n theme,\n theme.colors.error.main,\n theme.colors.error.main,\n theme.colors.error.contrastText,\n { topBottom: 0.5, rightLeft: 1 }\n );\n\n return {\n info,\n ['info-alt']: info,\n error,\n };\n};\n","import { css, cx } from '@emotion/css';\nimport { useMemo, PropsWithChildren } from 'react';\n\nimport { dateTime, DateTimeInput, GrafanaTheme2 } from '@grafana/data';\n\nimport { useTheme2 } from '../../themes';\nimport { Trans } from '../../utils/i18n';\nimport { Tooltip } from '../Tooltip';\n\nimport { UserView } from './types';\n\nexport interface UserIconProps {\n /** An object that contains the user's details and 'lastActiveAt' status */\n userView: UserView;\n /** A boolean value that determines whether the tooltip should be shown or not */\n showTooltip?: boolean;\n /** An optional class name to be added to the icon element */\n className?: string;\n /** onClick handler to be called when the icon is clicked */\n onClick?: () => void;\n}\n\n/**\n * A helper function that takes in a dateString parameter\n * and returns the user's last viewed date in a specific format.\n */\nconst formatViewed = (dateString: DateTimeInput): string => {\n const date = dateTime(dateString);\n const diffHours = date.diff(dateTime(), 'hours', false);\n return `Active last ${(Math.floor(-diffHours / 24) + 1) * 24}h`;\n};\n\n/**\n * Output the initials of the first and last name (if given), capitalized and concatenated together.\n * If name is not provided, an empty string is returned.\n * @param {string} [name] The name to extract initials from.\n * @returns {string} The uppercase initials of the first and last name.\n * @example\n * // Returns 'JD'\n * getUserInitials('John Doe');\n * // Returns 'A'\n * getUserInitials('Alice');\n * // Returns ''\n * getUserInitials();\n */\nconst getUserInitials = (name?: string) => {\n if (!name) {\n return '';\n }\n const [first, last] = name.split(' ');\n return `${first?.[0] ?? ''}${last?.[0] ?? ''}`.toUpperCase();\n};\n\nexport const UserIcon = ({\n userView,\n className,\n children,\n onClick,\n showTooltip = true,\n}: PropsWithChildren<UserIconProps>) => {\n const { user, lastActiveAt } = userView;\n const isActive = dateTime(lastActiveAt).diff(dateTime(), 'minutes', true) >= -15;\n const theme = useTheme2();\n const styles = useMemo(() => getStyles(theme, isActive), [theme, isActive]);\n const content = (\n <button\n type={'button'}\n onClick={onClick}\n className={cx(styles.container, onClick && styles.pointer, className)}\n aria-label={`${user.name} icon`}\n >\n {children ? (\n <div className={cx(styles.content, styles.textContent)}>{children}</div>\n ) : user.avatarUrl ? (\n <img className={styles.content} src={user.avatarUrl} alt={`${user.name} avatar`} />\n ) : (\n <div className={cx(styles.content, styles.textContent)}>{getUserInitials(user.name)}</div>\n )}\n </button>\n );\n\n if (showTooltip) {\n const tooltip = (\n <div className={styles.tooltipContainer}>\n <div className={styles.tooltipName}>{user.name}</div>\n <div className={styles.tooltipDate}>\n {isActive ? (\n <div className={styles.dotContainer}>\n <span>\n <Trans i18nKey=\"grafana-ui.user-icon.active-text\">Active last 15m</Trans>\n </span>\n <span className={styles.dot}></span>\n </div>\n ) : (\n formatViewed(lastActiveAt)\n )}\n </div>\n </div>\n );\n\n return <Tooltip content={tooltip}>{content}</Tooltip>;\n } else {\n return content;\n }\n};\n\nconst getIconBorder = (color: string): string => {\n return `0 0 0 1px ${color}`;\n};\n\nexport const getStyles = (theme: GrafanaTheme2, isActive: boolean) => {\n const shadowColor = isActive ? theme.colors.primary.main : theme.colors.border.medium;\n const shadowHoverColor = isActive ? theme.colors.primary.text : theme.colors.border.strong;\n\n return {\n container: css({\n padding: 0,\n width: '30px',\n height: '30px',\n background: 'none',\n border: 'none',\n borderRadius: theme.shape.radius.circle,\n '& > *': {\n borderRadius: theme.shape.radius.circle,\n },\n }),\n content: css({\n lineHeight: '24px',\n maxWidth: '100%',\n border: `3px ${theme.colors.background.primary} solid`,\n boxShadow: getIconBorder(shadowColor),\n backgroundClip: 'padding-box',\n '&:hover': {\n boxShadow: getIconBorder(shadowHoverColor),\n },\n }),\n textContent: css({\n background: theme.colors.background.primary,\n padding: 0,\n color: theme.colors.text.secondary,\n textAlign: 'center',\n fontSize: theme.typography.size.sm,\n '&:focus': {\n boxShadow: getIconBorder(shadowColor),\n },\n }),\n tooltipContainer: css({\n textAlign: 'center',\n padding: theme.spacing(0, 1),\n }),\n tooltipName: css({\n fontWeight: theme.typography.fontWeightBold,\n }),\n tooltipDate: css({\n fontWeight: theme.typography.fontWeightRegular,\n }),\n dotContainer: css({\n display: 'flex',\n alignItems: 'center',\n }),\n dot: css({\n height: '6px',\n width: '6px',\n backgroundColor: theme.colors.primary.main,\n borderRadius: theme.shape.radius.circle,\n display: 'inline-block',\n marginLeft: theme.spacing(1),\n }),\n pointer: css({\n cursor: 'pointer',\n }),\n };\n};\n","import { css } from '@emotion/css';\nimport { useRef } from 'react';\nimport * as React from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes';\n\ntype Props = {\n children: React.ReactElement;\n visible: boolean;\n duration?: number;\n};\n\nexport function FadeTransition(props: Props) {\n const { visible, children, duration = 250 } = props;\n const styles = useStyles2(getStyles, duration);\n const transitionRef = useRef(null);\n\n return (\n <CSSTransition\n in={visible}\n mountOnEnter={true}\n unmountOnExit={true}\n timeout={duration}\n classNames={styles}\n nodeRef={transitionRef}\n >\n {React.cloneElement(children, { ref: transitionRef })}\n </CSSTransition>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2, duration: number) => ({\n enter: css({\n label: 'enter',\n opacity: 0,\n }),\n enterActive: css({\n label: 'enterActive',\n opacity: 1,\n [theme.transitions.handleMotion('no-preference', 'reduce')]: {\n transition: `opacity ${duration}ms ease-out`,\n },\n }),\n exit: css({\n label: 'exit',\n opacity: 1,\n }),\n exitActive: css({\n label: 'exitActive',\n opacity: 0,\n [theme.transitions.handleMotion('no-preference', 'reduce')]: {\n transition: `opacity ${duration}ms ease-out`,\n },\n }),\n});\n","import { css } from '@emotion/css';\nimport { useRef } from 'react';\nimport * as React from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes';\n\ntype Props = {\n children: React.ReactElement;\n visible: boolean;\n size: number;\n\n duration?: number;\n horizontal?: boolean;\n};\n\nexport function SlideOutTransition(props: Props) {\n const { visible, children, duration = 250, horizontal, size } = props;\n const styles = useStyles2(getStyles, duration, horizontal ? 'width' : 'height', size);\n const transitionRef = useRef(null);\n\n return (\n <CSSTransition\n in={visible}\n mountOnEnter={true}\n unmountOnExit={true}\n timeout={duration}\n classNames={styles}\n nodeRef={transitionRef}\n >\n {React.cloneElement(children, { ref: transitionRef })}\n </CSSTransition>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2, duration: number, measurement: 'width' | 'height', size: number) => ({\n enter: css({\n label: 'enter',\n [`${measurement}`]: 0,\n opacity: 0,\n }),\n enterActive: css({\n label: 'enterActive',\n [`${measurement}`]: `${size}px`,\n opacity: 1,\n [theme.transitions.handleMotion('no-preference')]: {\n transition: `opacity ${duration}ms ease-out, ${measurement} ${duration}ms ease-out`,\n },\n [theme.transitions.handleMotion('reduce')]: {\n transition: `opacity ${duration}ms ease-out`,\n },\n }),\n exit: css({\n label: 'exit',\n [`${measurement}`]: `${size}px`,\n opacity: 1,\n }),\n exitActive: css({\n label: 'exitActive',\n opacity: 0,\n [`${measurement}`]: 0,\n [theme.transitions.handleMotion('no-preference')]: {\n transition: `opacity ${duration}ms ease-out, ${measurement} ${duration}ms ease-out`,\n },\n [theme.transitions.handleMotion('reduce')]: {\n transition: `opacity ${duration}ms ease-out`,\n },\n }),\n});\n","import hoistNonReactStatics from 'hoist-non-react-statics';\nimport memoize from 'micro-memoize';\nimport { useContext } from 'react';\nimport * as React from 'react';\n\nimport { GrafanaTheme, GrafanaTheme2, ThemeContext } from '@grafana/data';\n\nimport { Themeable, Themeable2 } from '../types/theme';\n\nimport { stylesFactory } from './stylesFactory';\n\ntype Omit<T, K> = Pick<T, Exclude<keyof T, K>>;\ntype Subtract<T, K> = Omit<T, keyof K>;\n\n/**\n * Mock used in tests\n */\nlet ThemeContextMock: React.Context<GrafanaTheme2> | null = null;\n\n// Used by useStyles()\nexport const memoizedStyleCreators = new WeakMap();\n\n/** @deprecated use withTheme2 */\n/** @public */\nexport const withTheme = <P extends Themeable, S extends {} = {}>(Component: React.ComponentType<P>) => {\n const WithTheme: React.FunctionComponent<Subtract<P, Themeable>> = (props) => {\n /**\n * If theme context is mocked, let's use it instead of the original context\n * This is used in tests when mocking theme using mockThemeContext function defined below\n */\n const ContextComponent = ThemeContextMock || ThemeContext;\n return (\n // @ts-ignore\n <ContextComponent.Consumer>{(theme) => <Component {...props} theme={theme.v1} />}</ContextComponent.Consumer>\n );\n };\n\n WithTheme.displayName = `WithTheme(${Component.displayName})`;\n hoistNonReactStatics(WithTheme, Component);\n type Hoisted = typeof WithTheme & S;\n return WithTheme as Hoisted;\n};\n\n/** @alpha */\nexport const withTheme2 = <P extends Themeable2, S extends {} = {}>(Component: React.ComponentType<P>) => {\n const WithTheme: React.FunctionComponent<Subtract<P, Themeable2>> = (props) => {\n /**\n * If theme context is mocked, let's use it instead of the original context\n * This is used in tests when mocking theme using mockThemeContext function defined below\n */\n const ContextComponent = ThemeContextMock || ThemeContext;\n return (\n // @ts-ignore\n <ContextComponent.Consumer>{(theme) => <Component {...props} theme={theme} />}</ContextComponent.Consumer>\n );\n };\n\n WithTheme.displayName = `WithTheme(${Component.displayName})`;\n hoistNonReactStatics(WithTheme, Component);\n type Hoisted = typeof WithTheme & S;\n return WithTheme as Hoisted;\n};\n\n/** @deprecated use useTheme2 */\n/** @public */\nexport function useTheme(): GrafanaTheme {\n return useContext(ThemeContextMock || ThemeContext).v1;\n}\n\n/** @public */\nexport function useTheme2(): GrafanaTheme2 {\n return useContext(ThemeContextMock || ThemeContext);\n}\n\n/**\n * Hook for using memoized styles with access to the theme.\n *\n * NOTE: For memoization to work, you need to ensure that the function\n * you pass in doesn't change, or only if it needs to. (i.e. declare\n * your style creator outside of a function component or use `useCallback()`.)\n * */\n/** @deprecated use useStyles2 */\n/** @public */\nexport function useStyles<T>(getStyles: (theme: GrafanaTheme) => T) {\n const theme = useTheme();\n\n let memoizedStyleCreator: typeof getStyles = memoizedStyleCreators.get(getStyles);\n\n if (!memoizedStyleCreator) {\n memoizedStyleCreator = stylesFactory(getStyles);\n memoizedStyleCreators.set(getStyles, memoizedStyleCreator);\n }\n\n return memoizedStyleCreator(theme);\n}\n\n/**\n * Hook for using memoized styles with access to the theme. Pass additional\n * arguments to the getStyles function as additional arguments to this hook.\n *\n * Prefer using primitive values (boolean, number, string, etc) for\n * additional arguments for better performance\n *\n * ```\n * const getStyles = (theme, isDisabled, isOdd) => {css(...)}\n * [...]\n * const styles = useStyles2(getStyles, true, Boolean(index % 2))\n * ```\n *\n * NOTE: For memoization to work, ensure that all arguments don't change\n * across renders (or only change if they need to)\n *\n * @public\n * */\nexport function useStyles2<T extends unknown[], CSSReturnValue>(\n getStyles: (theme: GrafanaTheme2, ...args: T) => CSSReturnValue,\n ...additionalArguments: T\n): CSSReturnValue {\n const theme = useTheme2();\n\n // Grafana ui can be bundled and used in older versions of Grafana where the theme doesn't have elevated background\n // This can be removed post G12\n if (!theme.colors.background.elevated) {\n theme.colors.background.elevated =\n theme.colors.mode === 'light' ? theme.colors.background.primary : theme.colors.background.secondary;\n }\n\n let memoizedStyleCreator: typeof getStyles = memoizedStyleCreators.get(getStyles);\n\n if (!memoizedStyleCreator) {\n memoizedStyleCreator = memoize(getStyles, { maxSize: 10 }); // each getStyles function will memoize 10 different sets of props\n memoizedStyleCreators.set(getStyles, memoizedStyleCreator);\n }\n\n return memoizedStyleCreator(theme, ...additionalArguments);\n}\n\n/**\n * Enables theme context mocking\n */\n/** @public */\nexport const mockThemeContext = (theme: Partial<GrafanaTheme2>) => {\n ThemeContextMock = React.createContext(theme as GrafanaTheme2);\n\n return () => {\n ThemeContextMock = null;\n };\n};\n","import tinycolor from 'tinycolor2';\n\nimport { GrafanaTheme, GrafanaTheme2 } from '@grafana/data';\n\nexport function cardChrome(theme: GrafanaTheme2): string {\n return `\n background: ${theme.colors.background.secondary};\n &:hover {\n background: ${hoverColor(theme.colors.background.secondary, theme)};\n }\n box-shadow: ${theme.components.panel.boxShadow};\n border-radius: ${theme.shape.radius.default};\n`;\n}\n\nexport function hoverColor(color: string, theme: GrafanaTheme2): string {\n return theme.isDark ? tinycolor(color).brighten(2).toString() : tinycolor(color).darken(2).toString();\n}\n\nexport function listItem(theme: GrafanaTheme2): string {\n return `\n background: ${theme.colors.background.secondary};\n &:hover {\n background: ${hoverColor(theme.colors.background.secondary, theme)};\n }\n box-shadow: ${theme.components.panel.boxShadow};\n border-radius: ${theme.shape.radius.default};\n`;\n}\n\nexport function listItemSelected(theme: GrafanaTheme2): string {\n return `\n background: ${hoverColor(theme.colors.background.secondary, theme)};\n color: ${theme.colors.text.maxContrast};\n`;\n}\n\nexport function mediaUp(breakpoint: string) {\n return `only screen and (min-width: ${breakpoint})`;\n}\n\nconst isGrafanaTheme2 = (theme: GrafanaTheme | GrafanaTheme2): theme is GrafanaTheme2 => theme.hasOwnProperty('v1');\nexport const focusCss = (theme: GrafanaTheme | GrafanaTheme2) => {\n const isTheme2 = isGrafanaTheme2(theme);\n const firstColor = isTheme2 ? theme.colors.background.canvas : theme.colors.bodyBg;\n const secondColor = isTheme2 ? theme.colors.primary.main : theme.colors.formFocusOutline;\n\n return `\n outline: 2px dotted transparent;\n outline-offset: 2px;\n box-shadow: 0 0 0 2px ${firstColor}, 0 0 0px 4px ${secondColor};\n transition-property: outline, outline-offset, box-shadow;\n transition-duration: 0.2s;\n transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);`;\n};\n\nexport function getMouseFocusStyles(theme: GrafanaTheme | GrafanaTheme2) {\n return {\n outline: 'none',\n boxShadow: `none`,\n };\n}\n\nexport function getFocusStyles(theme: GrafanaTheme2) {\n return {\n outline: '2px dotted transparent',\n outlineOffset: '2px',\n boxShadow: `0 0 0 2px ${theme.colors.background.canvas}, 0 0 0px 4px ${theme.colors.primary.main}`,\n transitionTimingFunction: `cubic-bezier(0.19, 1, 0.22, 1)`,\n transitionDuration: '0.2s',\n transitionProperty: 'outline, outline-offset, box-shadow',\n };\n}\n\n// max-width is set up based on .grafana-tooltip class that's used in dashboard\nexport const getTooltipContainerStyles = (theme: GrafanaTheme2) => ({\n overflow: 'hidden',\n background: theme.colors.background.elevated,\n boxShadow: theme.shadows.z2,\n maxWidth: '800px',\n padding: theme.spacing(1),\n borderRadius: theme.shape.radius.default,\n zIndex: theme.zIndex.tooltip,\n});\n","import memoize from 'micro-memoize';\n\n/**\n * @public\n * @deprecated use useStyles hook\n * Creates memoized version of styles creator\n * @param stylesCreator function accepting dependencies based on which styles are created\n */\nexport function stylesFactory<ResultFn extends (this: any, ...newArgs: any[]) => ReturnType<ResultFn>>(\n stylesCreator: ResultFn\n) {\n return memoize(stylesCreator);\n}\n","import { availableIconsIndex, Field, FieldType, IconName } from '@grafana/data';\n\nimport { ComponentSize } from './size';\n\n// Exported from here for backwards compatibility\nexport type { IconName } from '@grafana/data';\nexport { toIconName } from '@grafana/data';\n\nexport type IconType = 'mono' | 'default' | 'solid';\nexport type IconSize = ComponentSize | 'xl' | 'xxl' | 'xxxl';\nexport const isIconSize = (value: string): value is IconSize => {\n return ['xs', 'sm', 'md', 'lg', 'xl', 'xxl', 'xxxl'].includes(value);\n};\n\n// function remains for backwards compatibility\nexport const getAvailableIcons = () => Object.keys(availableIconsIndex);\n\n/**\n * Get the icon for a given field\n */\nexport function getFieldTypeIcon(field?: Field): IconName {\n return getFieldTypeIconName(field?.type);\n}\n\n/** Get an icon for a given field type */\nexport function getFieldTypeIconName(type?: FieldType): IconName {\n if (type) {\n switch (type) {\n case FieldType.time:\n return 'clock-nine';\n case FieldType.string:\n return 'font';\n case FieldType.number:\n return 'calculator-alt';\n case FieldType.boolean:\n return 'toggle-on';\n case FieldType.trace:\n return 'info-circle';\n case FieldType.enum:\n return 'list-ol';\n case FieldType.geo:\n return 'map-marker';\n case FieldType.other:\n return 'brackets-curly';\n }\n }\n return 'question-circle';\n}\n","import i18next from 'i18next';\nimport { ReactElement } from 'react';\nimport { Trans as I18NextTrans, initReactI18next } from 'react-i18next'; // eslint-disable-line no-restricted-imports\n\n// We want to translate grafana-ui without introducing any breaking changes for consumers\n// who use grafana-ui outside of grafana (such as grafana.com self serve). The other struggle\n// is that grafana-ui does not require a top-level provider component, so we don't get the\n// chance to do the mandatory i18next setup that <Trans /> and t() requires\n//\n// We wrap <Trans /> and t() and do a simple check if it hasn't already been set up\n// (Grafana will init i18next in app.ts), and just set it up with a minimal config\n// to use the default phrases in the source jsx.\n\n// Creates a default, english i18next instance when running outside of grafana.\n// we don't support changing the locale of grafana ui when outside of Grafana\nfunction initI18n() {\n // resources is undefined by default and set either by grafana app.ts or here\n if (typeof i18next.options.resources !== 'object') {\n i18next.use(initReactI18next).init({\n resources: {},\n returnEmptyString: false,\n lng: 'en-US', // this should be the locale of the phrases in our source JSX\n });\n }\n}\n\ntype I18NextTransType = typeof I18NextTrans;\ntype I18NextTransProps = Parameters<I18NextTransType>[0];\n\ninterface TransProps extends I18NextTransProps {\n i18nKey: string;\n}\n\nexport const Trans = (props: TransProps): ReactElement => {\n initI18n();\n return <I18NextTrans {...props} />;\n};\n\n// Reassign t() so i18next-parser doesn't warn on dynamic key, and we can have 'failOnWarnings' enabled\nconst tFunc = i18next.t;\n\nexport const t = (id: string, defaultMessage: string, values?: Record<string, unknown>) => {\n initI18n();\n\n return tFunc(id, defaultMessage, values);\n};\n","import { keyframes } from '@emotion/css';\n\nexport const spin = keyframes({\n '0%': {\n transform: 'rotate(0deg)',\n },\n '100%': {\n transform: 'rotate(359deg)',\n },\n});\n","import { css } from '@emotion/css';\nimport { Placement } from '@floating-ui/react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { TooltipPlacement } from '../components/Tooltip';\n\nexport function getPlacement(placement?: TooltipPlacement): Placement {\n switch (placement) {\n case 'auto':\n return 'bottom';\n case 'auto-start':\n return 'bottom-start';\n case 'auto-end':\n return 'bottom-end';\n default:\n return placement ?? 'bottom';\n }\n}\n\nexport function buildTooltipTheme(\n theme: GrafanaTheme2,\n tooltipBg: string,\n toggletipBorder: string,\n tooltipText: string,\n tooltipPadding: { topBottom: number; rightLeft: number }\n) {\n return {\n arrow: css({\n fill: tooltipBg,\n }),\n container: css({\n backgroundColor: tooltipBg,\n borderRadius: theme.shape.radius.default,\n border: `1px solid ${toggletipBorder}`,\n boxShadow: theme.shadows.z2,\n color: tooltipText,\n fontSize: theme.typography.bodySmall.fontSize,\n padding: theme.spacing(tooltipPadding.topBottom, tooltipPadding.rightLeft),\n [theme.transitions.handleMotion('no-preference', 'reduce')]: {\n transition: 'opacity 0.3s',\n },\n zIndex: theme.zIndex.tooltip,\n maxWidth: '400px',\n overflowWrap: 'break-word',\n\n \"&[data-popper-interactive='false']\": {\n pointerEvents: 'none',\n },\n }),\n headerClose: css({\n color: theme.colors.text.secondary,\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1.5),\n backgroundColor: 'transparent',\n border: 0,\n }),\n header: css({\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(2),\n }),\n body: css({\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n }),\n footer: css({\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(1),\n }),\n };\n}\n","import { EventBusSrv, EventBusExtended } from '@grafana/data';\n\nexport const appEvents: EventBusExtended = new EventBusSrv();\n\nexport default appEvents;\n","import { PluginState } from '@grafana/data';\nimport { config, GrafanaBootConfig } from '@grafana/runtime';\nexport { config, GrafanaBootConfig as Settings };\n\nlet grafanaConfig: GrafanaBootConfig = config;\n\nexport default grafanaConfig;\n\nexport const getConfig = () => {\n return grafanaConfig;\n};\n\nexport const updateConfig = (update: Partial<GrafanaBootConfig>) => {\n grafanaConfig = {\n ...grafanaConfig,\n ...update,\n };\n};\n\n// The `enable_alpha` flag is not exposed directly, this is equivalent\nexport const hasAlphaPanels = Boolean(config.panels?.debug?.state === PluginState.alpha);\n","import { monacoLanguageRegistry } from '@grafana/data';\nimport { CorsWorker as Worker } from 'app/core/utils/CorsWorker';\n\nexport function setMonacoEnv() {\n self.MonacoEnvironment = {\n getWorker(_moduleId, label) {\n const language = monacoLanguageRegistry.getIfExists(label);\n\n if (language) {\n return language.init();\n }\n\n if (label === 'json') {\n return new Worker(new URL('monaco-editor/esm/vs/language/json/json.worker', import.meta.url));\n }\n\n if (label === 'css' || label === 'scss' || label === 'less') {\n return new Worker(new URL('monaco-editor/esm/vs/language/css/css.worker', import.meta.url));\n }\n\n if (label === 'html' || label === 'handlebars' || label === 'razor') {\n return new Worker(new URL('monaco-editor/esm/vs/language/html/html.worker', import.meta.url));\n }\n\n if (label === 'typescript' || label === 'javascript') {\n return new Worker(new URL('monaco-editor/esm/vs/language/typescript/ts.worker', import.meta.url));\n }\n\n return new Worker(new URL('monaco-editor/esm/vs/editor/editor.worker', import.meta.url));\n },\n };\n}\n","declare global {\n interface Window {\n panelsRendered?: number;\n }\n}\n\nexport class Profiler {\n panelsRendered = 0;\n enabled?: boolean = undefined;\n\n renderingCompleted() {\n // add render counter to root scope\n // used by image renderer to know when panel has rendered\n this.panelsRendered += 1;\n\n // this window variable is used by backend rendering tools to know\n // all panels have completed rendering\n window.panelsRendered = this.panelsRendered;\n }\n}\n\nconst profiler = new Profiler();\nexport { profiler };\n","import { extend } from 'lodash';\n\nimport {\n AnalyticsSettings,\n OrgRole,\n rangeUtil,\n WithAccessControlMetadata,\n userHasPermission,\n userHasPermissionInMetadata,\n userHasAnyPermission,\n} from '@grafana/data';\nimport { featureEnabled, getBackendSrv } from '@grafana/runtime';\nimport { getSessionExpiry } from 'app/core/utils/auth';\nimport { AccessControlAction, UserPermission } from 'app/types';\nimport { CurrentUserInternal } from 'app/types/config';\n\nimport config from '../../core/config';\n\n// When set to auto, the interval will be based on the query range\n// NOTE: this is defined here rather than TimeSrv so we avoid circular dependencies\nexport const AutoRefreshInterval = 'auto';\nexport const RedirectToUrlKey = 'redirectTo';\n\nexport class User implements Omit<CurrentUserInternal, 'lightTheme'> {\n isSignedIn: boolean;\n id: number;\n uid: string;\n login: string;\n email: string;\n name: string;\n externalUserId: string;\n theme: string;\n orgCount: number;\n orgId: number;\n orgName: string;\n orgRole: OrgRole | '';\n isGrafanaAdmin: boolean;\n gravatarUrl: string;\n timezone: string;\n weekStart: string;\n locale: string;\n language: string;\n helpFlags1: number;\n hasEditPermissionInFolders: boolean;\n permissions?: UserPermission;\n analytics: AnalyticsSettings;\n fiscalYearStartMonth: number;\n authenticatedBy: string;\n\n constructor() {\n this.id = 0;\n this.uid = '';\n this.isGrafanaAdmin = false;\n this.isSignedIn = false;\n this.orgRole = '';\n this.orgId = 0;\n this.orgName = '';\n this.login = '';\n this.externalUserId = '';\n this.orgCount = 0;\n this.timezone = '';\n this.fiscalYearStartMonth = 0;\n this.helpFlags1 = 0;\n this.theme = 'dark';\n this.hasEditPermissionInFolders = false;\n this.email = '';\n this.name = '';\n this.locale = '';\n this.language = '';\n this.weekStart = '';\n this.gravatarUrl = '';\n this.analytics = {\n identifier: '',\n };\n this.authenticatedBy = '';\n\n if (config.bootData.user) {\n extend(this, config.bootData.user);\n }\n }\n}\n\nexport class ContextSrv {\n user: User;\n isSignedIn: boolean;\n isGrafanaAdmin: boolean;\n isEditor: boolean;\n sidemenuSmallBreakpoint = false;\n hasEditPermissionInFolders: boolean;\n minRefreshInterval: string;\n\n private tokenRotationJobId = 0;\n\n constructor() {\n if (!config.bootData) {\n config.bootData = { user: {}, settings: {}, navTree: [] } as any;\n }\n\n this.user = new User();\n this.isSignedIn = this.user.isSignedIn;\n this.isGrafanaAdmin = this.user.isGrafanaAdmin;\n this.isEditor = this.hasRole('Editor') || this.hasRole('Admin');\n this.hasEditPermissionInFolders = this.user.hasEditPermissionInFolders;\n this.minRefreshInterval = config.minRefreshInterval;\n\n this.scheduleTokenRotationJob();\n }\n\n async fetchUserPermissions() {\n try {\n this.user.permissions = await getBackendSrv().get('/api/access-control/user/actions', {\n reloadcache: true,\n });\n } catch (e) {\n console.error(e);\n }\n }\n\n /**\n * Indicate the user has been logged out\n */\n setLoggedOut() {\n this.setRedirectToUrl();\n this.cancelTokenRotationJob();\n this.user.isSignedIn = false;\n this.isSignedIn = false;\n window.location.reload();\n }\n\n setRedirectToUrl() {\n if (config.featureToggles.useSessionStorageForRedirection) {\n window.sessionStorage.setItem(\n RedirectToUrlKey,\n encodeURIComponent(window.location.href.substring(window.location.origin.length))\n );\n }\n }\n\n hasRole(role: string) {\n if (role === 'ServerAdmin') {\n return this.isGrafanaAdmin;\n } else {\n return this.user.orgRole === role;\n }\n }\n\n licensedAccessControlEnabled(): boolean {\n return featureEnabled('accesscontrol');\n }\n\n // Checks whether user has required permission\n hasPermissionInMetadata(action: AccessControlAction | string, object: WithAccessControlMetadata): boolean {\n return userHasPermissionInMetadata(action, object);\n }\n\n // Checks whether user has required permission\n hasPermission(action: AccessControlAction | string): boolean {\n return userHasPermission(action, this.user);\n }\n\n isGrafanaVisible() {\n return document.visibilityState === undefined || document.visibilityState === 'visible';\n }\n\n // checks whether the passed interval is longer than the configured minimum refresh rate\n isAllowedInterval(interval: string) {\n if (!config.minRefreshInterval || interval === AutoRefreshInterval) {\n return true;\n }\n return rangeUtil.intervalToMs(interval) >= rangeUtil.intervalToMs(config.minRefreshInterval);\n }\n\n getValidInterval(interval: string) {\n if (!this.isAllowedInterval(interval)) {\n return config.minRefreshInterval;\n }\n return interval;\n }\n\n getValidIntervals(intervals: string[]): string[] {\n if (this.minRefreshInterval) {\n return intervals.filter((str) => str !== '').filter(this.isAllowedInterval);\n }\n return intervals;\n }\n\n hasAccessToExplore() {\n return this.hasPermission(AccessControlAction.DataSourcesExplore) && config.exploreEnabled;\n }\n\n // evaluates access control permissions, granting access if the user has any of them\n evaluatePermission(actions: string[]) {\n if (userHasAnyPermission(actions, this.user)) {\n return [];\n }\n // Hack to reject when user does not have permission\n return ['Reject'];\n }\n\n // schedules a job to perform token ration in the background\n private scheduleTokenRotationJob() {\n // check if we can schedula the token rotation job\n if (this.canScheduleRotation()) {\n // get the time token is going to expire\n let expires = getSessionExpiry();\n\n // because this job is scheduled for every tab we have open that shares a session we try\n // to distribute the scheduling of the job. For now this can be between 1 and 20 seconds\n const expiresWithDistribution = expires - Math.floor(Math.random() * (20 - 1) + 1);\n\n // nextRun is when the job should be scheduled for in ms. setTimeout ms has a max value of 2147483647.\n let nextRun = Math.min(expiresWithDistribution * 1000 - Date.now(), 2147483647);\n // @ts-ignore\n this.tokenRotationJobId = setTimeout(() => {\n // if we have a new expiry time from the expiry cookie another tab have already performed the rotation\n // so the only thing we need to do is reschedule the job and exit\n if (getSessionExpiry() > expires) {\n this.scheduleTokenRotationJob();\n return;\n }\n this.rotateToken().then();\n }, nextRun);\n }\n }\n\n private canScheduleRotation() {\n // skip if user is not signed in, this happens on login page or when using anonymous auth\n if (!this.isSignedIn) {\n return false;\n }\n\n // skip if there is no session to rotate\n // if a user has a session but not yet a session expiry cookie, can happen during upgrade\n // from an older version of grafana, we never schedule the job and the fallback logic\n // in backend_srv will take care of rotations until first rotation has been made and\n // page has been reloaded.\n if (getSessionExpiry() === 0) {\n return false;\n }\n\n return true;\n }\n\n private cancelTokenRotationJob() {\n if (this.tokenRotationJobId > 0) {\n clearTimeout(this.tokenRotationJobId);\n }\n }\n\n private rotateToken() {\n // We directly use fetch here to bypass the request queue from backendSvc\n return fetch(config.appSubUrl + '/api/user/auth-tokens/rotate', { method: 'POST' })\n .then((res) => {\n if (res.status === 200) {\n this.scheduleTokenRotationJob();\n return;\n }\n\n if (res.status === 401) {\n this.setLoggedOut();\n return;\n }\n })\n .catch((e) => {\n console.error(e);\n });\n }\n}\n\nlet contextSrv = new ContextSrv();\nexport { contextSrv };\n\nexport const setContextSrv = (override: ContextSrv) => {\n if (process.env.NODE_ENV !== 'test') {\n throw new Error('contextSrv can be only overridden in test environment');\n }\n contextSrv = override;\n};\n","import { isNumber, isFinite, escape } from 'lodash';\n\nimport { DecimalCount, formattedValueToString, getValueFormat, stringToJsRegex, ValueFormatter } from '@grafana/data';\n\nfunction matchSeriesOverride(aliasOrRegex: string, seriesAlias: string) {\n if (!aliasOrRegex) {\n return false;\n }\n\n if (aliasOrRegex[0] === '/') {\n const regex = stringToJsRegex(aliasOrRegex);\n return seriesAlias.match(regex) != null;\n }\n\n return aliasOrRegex === seriesAlias;\n}\n\nfunction translateFillOption(fill: number) {\n return fill === 0 ? 0.001 : fill / 10;\n}\n\nfunction getFillGradient(amount: number) {\n if (!amount) {\n return null;\n }\n\n return {\n colors: [{ opacity: 0.0 }, { opacity: amount / 10 }],\n };\n}\n\n/**\n * Calculate decimals for legend and update values for each series.\n * @param data series data\n * @param panel\n * @param height\n */\nexport function updateLegendValues(data: TimeSeries[], panel: any, height: number) {\n for (let i = 0; i < data.length; i++) {\n const series = data[i];\n const yaxes = panel.yaxes;\n const seriesYAxis = series.yaxis || 1;\n const axis = yaxes[seriesYAxis - 1];\n const formatter = getValueFormat(axis.format);\n\n // decimal override\n if (isNumber(panel.decimals)) {\n series.updateLegendValues(formatter, panel.decimals);\n } else if (isNumber(axis.decimals)) {\n series.updateLegendValues(formatter, axis.decimals + 1);\n } else {\n series.updateLegendValues(formatter, null);\n }\n }\n}\n\n/**\n * @deprecated: This class should not be used in new panels\n *\n * Use DataFrame and helpers instead\n */\nexport default class TimeSeries {\n datapoints: any;\n id: string;\n // Represents index of original data frame in the quey response\n dataFrameIndex: number;\n // Represents index of field in the data frame\n fieldIndex: number;\n label: string;\n alias: string;\n aliasEscaped: string;\n color?: string;\n valueFormater: any;\n stats: any;\n legend: boolean;\n hideTooltip?: boolean;\n allIsNull?: boolean;\n allIsZero?: boolean;\n decimals: DecimalCount;\n hasMsResolution: boolean;\n isOutsideRange?: boolean;\n\n lines: any;\n hiddenSeries?: boolean;\n dashes: any;\n bars: any;\n points: any;\n yaxis: any;\n zindex: any;\n stack: any;\n nullPointMode: any;\n fillBelowTo: any;\n transform: any;\n flotpairs: any;\n unit: any;\n\n constructor(opts: any) {\n this.datapoints = opts.datapoints;\n this.label = opts.alias;\n this.id = opts.alias;\n this.alias = opts.alias;\n this.aliasEscaped = escape(opts.alias);\n this.color = opts.color;\n this.bars = { fillColor: opts.color };\n this.valueFormater = getValueFormat('none');\n this.stats = {};\n this.legend = true;\n this.unit = opts.unit;\n this.dataFrameIndex = opts.dataFrameIndex;\n this.fieldIndex = opts.fieldIndex;\n this.hasMsResolution = this.isMsResolutionNeeded();\n }\n\n applySeriesOverrides(overrides: any[]) {\n this.lines = {};\n this.dashes = {\n dashLength: [],\n };\n this.points = {};\n this.yaxis = 1;\n this.zindex = 0;\n this.nullPointMode = null;\n delete this.stack;\n delete this.bars.show;\n\n for (let i = 0; i < overrides.length; i++) {\n const override = overrides[i];\n if (!matchSeriesOverride(override.alias, this.alias)) {\n continue;\n }\n if (override.lines !== void 0) {\n this.lines.show = override.lines;\n }\n if (override.dashes !== void 0) {\n this.dashes.show = override.dashes;\n this.lines.lineWidth = 0;\n }\n if (override.points !== void 0) {\n this.points.show = override.points;\n }\n if (override.bars !== void 0) {\n this.bars.show = override.bars;\n }\n if (override.fill !== void 0) {\n this.lines.fill = translateFillOption(override.fill);\n }\n if (override.fillGradient !== void 0) {\n this.lines.fillColor = getFillGradient(override.fillGradient);\n }\n if (override.stack !== void 0) {\n this.stack = override.stack;\n }\n if (override.linewidth !== void 0) {\n this.lines.lineWidth = this.dashes.show ? 0 : override.linewidth;\n this.dashes.lineWidth = override.linewidth;\n }\n if (override.dashLength !== void 0) {\n this.dashes.dashLength[0] = override.dashLength;\n }\n if (override.spaceLength !== void 0) {\n this.dashes.dashLength[1] = override.spaceLength;\n }\n if (override.nullPointMode !== void 0) {\n this.nullPointMode = override.nullPointMode;\n }\n if (override.pointradius !== void 0) {\n this.points.radius = override.pointradius;\n }\n if (override.steppedLine !== void 0) {\n this.lines.steps = override.steppedLine;\n }\n if (override.zindex !== void 0) {\n this.zindex = override.zindex;\n }\n if (override.fillBelowTo !== void 0) {\n this.fillBelowTo = override.fillBelowTo;\n }\n if (override.color !== void 0) {\n this.setColor(override.color);\n }\n if (override.transform !== void 0) {\n this.transform = override.transform;\n }\n if (override.legend !== void 0) {\n this.legend = override.legend;\n }\n if (override.hideTooltip !== void 0) {\n this.hideTooltip = override.hideTooltip;\n }\n\n if (override.yaxis !== void 0) {\n this.yaxis = override.yaxis;\n }\n if (override.hiddenSeries !== void 0) {\n this.hiddenSeries = override.hiddenSeries;\n }\n }\n }\n\n getFlotPairs(fillStyle: string) {\n const result = [];\n\n this.stats.total = 0;\n this.stats.max = -Number.MAX_VALUE;\n this.stats.min = Number.MAX_VALUE;\n this.stats.logmin = Number.MAX_VALUE;\n this.stats.avg = null;\n this.stats.current = null;\n this.stats.first = null;\n this.stats.delta = 0;\n this.stats.diff = null;\n this.stats.diffperc = 0;\n this.stats.range = null;\n this.stats.timeStep = Number.MAX_VALUE;\n this.allIsNull = true;\n this.allIsZero = true;\n\n const ignoreNulls = fillStyle === 'connected';\n const nullAsZero = fillStyle === 'null as zero';\n let currentTime;\n let currentValue;\n let nonNulls = 0;\n let previousTime;\n let previousValue = 0;\n let previousDeltaUp = true;\n\n for (let i = 0; i < this.datapoints.length; i++) {\n currentValue = this.datapoints[i][0];\n currentTime = this.datapoints[i][1];\n\n // Due to missing values we could have different timeStep all along the series\n // so we have to find the minimum one (could occur with aggregators such as ZimSum)\n if (previousTime !== undefined) {\n const timeStep = currentTime - previousTime;\n if (timeStep < this.stats.timeStep) {\n this.stats.timeStep = timeStep;\n }\n }\n previousTime = currentTime;\n\n if (currentValue === null) {\n if (ignoreNulls) {\n continue;\n }\n if (nullAsZero) {\n currentValue = 0;\n }\n }\n\n if (currentValue !== null) {\n if (isNumber(currentValue)) {\n this.stats.total += currentValue;\n this.allIsNull = false;\n nonNulls++;\n }\n\n if (currentValue > this.stats.max) {\n this.stats.max = currentValue;\n }\n\n if (currentValue < this.stats.min) {\n this.stats.min = currentValue;\n }\n\n if (this.stats.first === null) {\n this.stats.first = currentValue;\n } else {\n if (previousValue > currentValue) {\n // counter reset\n previousDeltaUp = false;\n if (i === this.datapoints.length - 1) {\n // reset on last\n this.stats.delta += currentValue;\n }\n } else {\n if (previousDeltaUp) {\n this.stats.delta += currentValue - previousValue; // normal increment\n } else {\n this.stats.delta += currentValue; // account for counter reset\n }\n previousDeltaUp = true;\n }\n }\n previousValue = currentValue;\n\n if (currentValue < this.stats.logmin && currentValue > 0) {\n this.stats.logmin = currentValue;\n }\n\n if (currentValue !== 0) {\n this.allIsZero = false;\n }\n }\n\n result.push([currentTime, currentValue]);\n }\n\n if (this.stats.max === -Number.MAX_VALUE) {\n this.stats.max = null;\n }\n if (this.stats.min === Number.MAX_VALUE) {\n this.stats.min = null;\n }\n\n if (result.length && !this.allIsNull) {\n this.stats.avg = this.stats.total / nonNulls;\n this.stats.current = result[result.length - 1][1];\n if (this.stats.current === null && result.length > 1) {\n this.stats.current = result[result.length - 2][1];\n }\n }\n if (this.stats.max !== null && this.stats.min !== null) {\n this.stats.range = this.stats.max - this.stats.min;\n }\n if (this.stats.current !== null && this.stats.first !== null) {\n this.stats.diff = this.stats.current - this.stats.first;\n this.stats.diffperc = this.stats.diff / this.stats.first;\n }\n\n this.stats.count = result.length;\n return result;\n }\n\n updateLegendValues(formater: ValueFormatter, decimals: DecimalCount) {\n this.valueFormater = formater;\n this.decimals = decimals;\n }\n\n formatValue(value: number | null) {\n if (!isFinite(value)) {\n value = null; // Prevent NaN formatting\n }\n return formattedValueToString(this.valueFormater(value, this.decimals));\n }\n\n isMsResolutionNeeded() {\n for (let i = 0; i < this.datapoints.length; i++) {\n if (this.datapoints[i][1] !== null && this.datapoints[i][1] !== undefined) {\n const timestamp = this.datapoints[i][1].toString();\n if (timestamp.length === 13 && timestamp % 1000 !== 0) {\n return true;\n }\n }\n }\n return false;\n }\n\n hideFromLegend(options: any) {\n if (options.hideEmpty && this.allIsNull) {\n return true;\n }\n // ignore series excluded via override\n if (!this.legend) {\n return true;\n }\n\n // ignore zero series\n if (options.hideZero && this.allIsZero) {\n return true;\n }\n\n return false;\n }\n\n setColor(color: string) {\n this.color = color;\n this.bars.fillColor = color;\n }\n}\n","import { textUtil } from '@grafana/data';\nimport { config } from '@grafana/runtime';\n\nconst CSP_REPORT_ONLY_ENABLED = config.bootData.settings.cspReportOnlyEnabled;\n\nexport const defaultTrustedTypesPolicy = {\n createHTML: (string: string, source: string, sink: string) => {\n if (!CSP_REPORT_ONLY_ENABLED) {\n return string.replace(/<script/gi, '<script');\n }\n console.error('[HTML not sanitized with Trusted Types]', string, source, sink);\n return string;\n },\n createScript: (string: string) => string,\n createScriptURL: (string: string, source: string, sink: string) => {\n if (!CSP_REPORT_ONLY_ENABLED) {\n return textUtil.sanitizeUrl(string);\n }\n console.error('[ScriptURL not sanitized with Trusted Types]', string, source, sink);\n return string;\n },\n};\n\nif (\n config.bootData.settings.trustedTypesDefaultPolicyEnabled &&\n window.trustedTypes &&\n window.trustedTypes.createPolicy\n) {\n // check if browser supports Trusted Types\n window.trustedTypes.createPolicy('default', defaultTrustedTypesPolicy);\n}\n","import { useEffect, useState } from 'react';\nimport * as React from 'react';\nimport { SkeletonTheme } from 'react-loading-skeleton';\n\nimport { GrafanaTheme2, ThemeContext } from '@grafana/data';\nimport { ThemeChangedEvent, config } from '@grafana/runtime';\n\nimport { appEvents } from '../core';\n\nimport 'react-loading-skeleton/dist/skeleton.css';\n\nexport const ThemeProvider = ({ children, value }: { children: React.ReactNode; value: GrafanaTheme2 }) => {\n const [theme, setTheme] = useState(value);\n\n useEffect(() => {\n const sub = appEvents.subscribe(ThemeChangedEvent, (event) => {\n config.theme2 = event.payload;\n setTheme(event.payload);\n });\n\n return () => sub.unsubscribe();\n }, []);\n\n return (\n <ThemeContext.Provider value={theme}>\n <SkeletonTheme\n baseColor={theme.colors.emphasize(theme.colors.background.secondary)}\n highlightColor={theme.colors.emphasize(theme.colors.background.secondary, 0.1)}\n borderRadius={theme.shape.radius.default}\n >\n {children}\n </SkeletonTheme>\n </ThemeContext.Provider>\n );\n};\n\nexport const provideTheme = <P extends {}>(component: React.ComponentType<P>, theme: GrafanaTheme2) => {\n return function ThemeProviderWrapper(props: P) {\n return <ThemeProvider value={theme}>{React.createElement(component, { ...props })}</ThemeProvider>;\n };\n};\n","// works with webpack plugin: scripts/webpack/plugins/CorsWorkerPlugin.js\nexport class CorsWorker extends window.Worker {\n constructor(url: URL, options?: WorkerOptions) {\n // by default, worker inherits HTML document's location and pathname which leads to wrong public path value\n // the CorsWorkerPlugin will override it with the value based on the initial worker chunk, ie.\n // initial worker chunk: http://host.com/cdn/scripts/worker-123.js\n // resulting public path: http://host.com/cdn/scripts\n\n const scriptUrl = url.toString();\n const scriptsBasePathUrl = new URL('.', url).toString();\n\n const importScripts = `importScripts('${scriptUrl}');`;\n const objectURL = URL.createObjectURL(\n new Blob([`__webpack_worker_public_path__ = '${scriptsBasePathUrl}'; ${importScripts}`], {\n type: 'application/javascript',\n })\n );\n super(objectURL, options);\n URL.revokeObjectURL(objectURL);\n }\n}\n","export function getSessionExpiry() {\n const expiryCookie = document.cookie.split('; ').find((row) => row.startsWith('grafana_session_expiry='));\n if (!expiryCookie) {\n return 0;\n }\n\n let expiresStr = expiryCookie.split('=').at(1);\n if (!expiresStr) {\n return 0;\n }\n\n return parseInt(expiresStr, 10);\n}\n\nexport function hasSessionExpiry() {\n return document.cookie.split('; ').findIndex((row) => row.startsWith('grafana_session_expiry=')) > -1;\n}\n","/**\n * UserPermission is a map storing permissions in a form of\n * {\n * action: true;\n * }\n */\nexport type UserPermission = Record<string, boolean>;\n\n// Permission actions\nexport enum AccessControlAction {\n UsersRead = 'users:read',\n UsersWrite = 'users:write',\n UsersAuthTokenList = 'users.authtoken:read',\n UsersAuthTokenUpdate = 'users.authtoken:write',\n UsersPasswordUpdate = 'users.password:write',\n UsersDelete = 'users:delete',\n UsersCreate = 'users:create',\n UsersEnable = 'users:enable',\n UsersDisable = 'users:disable',\n UsersPermissionsUpdate = 'users.permissions:write',\n UsersLogout = 'users:logout',\n UsersQuotasList = 'users.quotas:read',\n UsersQuotasUpdate = 'users.quotas:write',\n\n ServiceAccountsRead = 'serviceaccounts:read',\n ServiceAccountsCreate = 'serviceaccounts:create',\n ServiceAccountsWrite = 'serviceaccounts:write',\n ServiceAccountsDelete = 'serviceaccounts:delete',\n ServiceAccountsPermissionsRead = 'serviceaccounts.permissions:read',\n ServiceAccountsPermissionsWrite = 'serviceaccounts.permissions:write',\n\n OrgsRead = 'orgs:read',\n OrgsPreferencesRead = 'orgs.preferences:read',\n OrgsWrite = 'orgs:write',\n OrgsPreferencesWrite = 'orgs.preferences:write',\n OrgsCreate = 'orgs:create',\n OrgsDelete = 'orgs:delete',\n OrgUsersRead = 'org.users:read',\n OrgUsersAdd = 'org.users:add',\n OrgUsersRemove = 'org.users:remove',\n OrgUsersWrite = 'org.users:write',\n\n LDAPUsersRead = 'ldap.user:read',\n LDAPUsersSync = 'ldap.user:sync',\n LDAPStatusRead = 'ldap.status:read',\n\n DataSourcesExplore = 'datasources:explore',\n DataSourcesRead = 'datasources:read',\n DataSourcesCreate = 'datasources:create',\n DataSourcesWrite = 'datasources:write',\n DataSourcesDelete = 'datasources:delete',\n DataSourcesPermissionsRead = 'datasources.permissions:read',\n DataSourcesCachingRead = 'datasources.caching:read',\n DataSourcesInsightsRead = 'datasources.insights:read',\n\n ActionServerStatsRead = 'server.stats:read',\n\n ActionTeamsCreate = 'teams:create',\n ActionTeamsDelete = 'teams:delete',\n ActionTeamsRead = 'teams:read',\n ActionTeamsWrite = 'teams:write',\n ActionTeamsPermissionsRead = 'teams.permissions:read',\n ActionTeamsPermissionsWrite = 'teams.permissions:write',\n\n ActionRolesList = 'roles:read',\n ActionTeamsRolesList = 'teams.roles:read',\n ActionTeamsRolesAdd = 'teams.roles:add',\n ActionTeamsRolesRemove = 'teams.roles:remove',\n ActionUserRolesList = 'users.roles:read',\n ActionUserRolesAdd = 'users.roles:add',\n ActionUserRolesRemove = 'users.roles:remove',\n\n DashboardsRead = 'dashboards:read',\n DashboardsWrite = 'dashboards:write',\n DashboardsDelete = 'dashboards:delete',\n DashboardsCreate = 'dashboards:create',\n DashboardsPermissionsRead = 'dashboards.permissions:read',\n DashboardsPermissionsWrite = 'dashboards.permissions:write',\n DashboardsPublicWrite = 'dashboards.public:write',\n SnapshotsCreate = 'snapshots:create',\n SnapshotsDelete = 'snapshots:delete',\n SnapshotsRead = 'snapshots:read',\n\n FoldersRead = 'folders:read',\n FoldersWrite = 'folders:write',\n FoldersDelete = 'folders:delete',\n FoldersCreate = 'folders:create',\n FoldersPermissionsRead = 'folders.permissions:read',\n FoldersPermissionsWrite = 'folders.permissions:write',\n\n // Support bundle actions\n ActionSupportBundlesCreate = 'support.bundles:create',\n ActionSupportBundlesRead = 'support.bundles:read',\n ActionSupportBundlesDelete = 'support.bundles:delete',\n\n // Alerting rules\n AlertingRuleCreate = 'alert.rules:create',\n AlertingRuleRead = 'alert.rules:read',\n AlertingRuleUpdate = 'alert.rules:write',\n AlertingRuleDelete = 'alert.rules:delete',\n\n // Alerting instances (+silences)\n AlertingInstanceCreate = 'alert.instances:create',\n AlertingInstanceUpdate = 'alert.instances:write',\n AlertingInstanceRead = 'alert.instances:read',\n\n // Alerting silences\n AlertingSilenceCreate = 'alert.silences:create',\n AlertingSilenceUpdate = 'alert.silences:write',\n AlertingSilenceRead = 'alert.silences:read',\n\n // Alerting Notification policies\n AlertingNotificationsRead = 'alert.notifications:read',\n AlertingNotificationsWrite = 'alert.notifications:write',\n\n // External alerting rule actions.\n AlertingRuleExternalWrite = 'alert.rules.external:write',\n AlertingRuleExternalRead = 'alert.rules.external:read',\n\n // External alerting instances actions.\n AlertingInstancesExternalWrite = 'alert.instances.external:write',\n AlertingInstancesExternalRead = 'alert.instances.external:read',\n\n // External alerting notifications actions.\n AlertingNotificationsExternalWrite = 'alert.notifications.external:write',\n AlertingNotificationsExternalRead = 'alert.notifications.external:read',\n\n // Alerting provisioning actions\n AlertingProvisioningReadSecrets = 'alert.provisioning.secrets:read',\n AlertingProvisioningRead = 'alert.provisioning:read',\n AlertingProvisioningWrite = 'alert.provisioning:write',\n\n // Alerting receivers actions\n AlertingReceiversPermissionsRead = 'receivers.permissions:read',\n AlertingReceiversPermissionsWrite = 'receivers.permissions:write',\n AlertingReceiversCreate = 'alert.notifications.receivers:create',\n AlertingReceiversWrite = 'alert.notifications.receivers:write',\n AlertingReceiversRead = 'alert.notifications.receivers:read',\n\n // Alerting routes actions\n AlertingRoutesRead = 'alert.notifications.routes:read',\n AlertingRoutesWrite = 'alert.notifications.routes:write',\n\n // Alerting time intervals actions\n AlertingTimeIntervalsRead = 'alert.notifications.time-intervals:read',\n AlertingTimeIntervalsWrite = 'alert.notifications.time-intervals:write',\n\n // Alerting templates actions\n AlertingTemplatesRead = 'alert.notifications.templates:read',\n AlertingTemplatesWrite = 'alert.notifications.templates:write',\n AlertingTemplatesDelete = 'alert.notifications.templates:delete',\n\n ActionAPIKeysRead = 'apikeys:read',\n ActionAPIKeysCreate = 'apikeys:create',\n ActionAPIKeysDelete = 'apikeys:delete',\n\n PluginsInstall = 'plugins:install',\n PluginsWrite = 'plugins:write',\n\n // Settings\n SettingsRead = 'settings:read',\n SettingsWrite = 'settings:write',\n\n // GroupSync\n GroupSyncMappingsRead = 'groupsync.mappings:read',\n GroupSyncMappingsWrite = 'groupsync.mappings:write',\n\n // Migration Assistant\n MigrationAssistantMigrate = 'migrationassistant:migrate',\n}\n\nexport interface Role {\n uid: string;\n name: string;\n displayName: string;\n description: string;\n group: string;\n global: boolean;\n delegatable?: boolean;\n mapped?: boolean;\n version: number;\n created: string;\n updated: string;\n}\n","import { OrgRole } from '@grafana/data';\n\nexport enum TeamPermissionLevel {\n Admin = 4,\n Member = 0,\n}\n\nexport { OrgRole as OrgRole };\n\nexport type PermissionLevel = 'view' | 'edit' | 'admin';\n\n/** @deprecated Use PermissionLevel instead */\nexport enum PermissionLevelString {\n View = 'View',\n Edit = 'Edit',\n Admin = 'Admin',\n}\n\nexport enum SearchQueryType {\n Folder = 'dash-folder',\n Dashboard = 'dash-db',\n}\n","import { DataQuery } from '@grafana/data';\nimport { Dashboard, DataSourceRef } from '@grafana/schema';\nimport { ObjectMeta } from 'app/features/apiserver/types';\nimport { DashboardModel } from 'app/features/dashboard/state/DashboardModel';\n\nexport interface HomeDashboardRedirectDTO {\n redirectUri: string;\n}\n\nexport interface DashboardDTO {\n dashboard: DashboardDataDTO;\n meta: DashboardMeta;\n}\n\nexport interface ImportDashboardResponseDTO {\n uid: string;\n pluginId: string;\n title: string;\n imported: boolean;\n importedRevision?: number;\n importedUri: string;\n importedUrl: string;\n slug: string;\n dashboardId: number;\n folderId: number;\n folderUid: string;\n description: string;\n path: string;\n removed: boolean;\n}\n\nexport interface SaveDashboardResponseDTO {\n id: number;\n slug: string;\n status: string;\n uid: string;\n url: string;\n version: number;\n}\n\nexport interface DashboardMeta {\n slug?: string;\n uid?: string;\n canSave?: boolean;\n canEdit?: boolean;\n canDelete?: boolean;\n canShare?: boolean;\n canStar?: boolean;\n canAdmin?: boolean;\n url?: string;\n folderUid?: string;\n canMakeEditable?: boolean;\n provisioned?: boolean;\n provisionedExternalId?: string;\n isStarred?: boolean;\n showSettings?: boolean;\n expires?: string;\n isFolder?: boolean;\n isSnapshot?: boolean;\n folderTitle?: string;\n folderUrl?: string;\n folderId?: number;\n created?: string;\n createdBy?: string;\n updated?: string;\n updatedBy?: string;\n fromScript?: boolean;\n fromFile?: boolean;\n hasUnsavedFolderChange?: boolean;\n annotationsPermissions?: AnnotationsPermissions;\n publicDashboardEnabled?: boolean;\n isEmbedded?: boolean;\n isNew?: boolean;\n version?: number;\n\n // When loaded from kubernetes, we stick the raw metadata here\n // yes weird, but this means all the editor structures can exist unchanged\n // until we use the resource as the main container\n k8s?: Partial<ObjectMeta>;\n\n // This is a property added specifically for edge cases where dashboards should be reloaded on scopes, time range or variables changes\n // This property is not persisted in the DB but its existence is controlled by the API\n reloadOnParamsChange?: boolean;\n}\n\nexport interface AnnotationActions {\n canAdd: boolean;\n canEdit: boolean;\n canDelete: boolean;\n}\n\nexport interface AnnotationsPermissions {\n dashboard: AnnotationActions;\n organization: AnnotationActions;\n}\n\n// FIXME: This should not override Dashboard types\nexport interface DashboardDataDTO extends Dashboard {\n title: string;\n uid: string;\n panels?: any[];\n}\n\nexport enum DashboardRoutes {\n Home = 'home-dashboard',\n New = 'new-dashboard',\n Normal = 'normal-dashboard',\n Scripted = 'scripted-dashboard',\n Public = 'public-dashboard',\n Embedded = 'embedded-dashboard',\n Report = 'report-dashboard',\n}\n\nexport enum DashboardInitPhase {\n NotStarted = 'Not started',\n Fetching = 'Fetching',\n Services = 'Services',\n Failed = 'Failed',\n Completed = 'Completed',\n}\n\nexport interface DashboardInitError {\n message: string;\n error: unknown;\n}\n\nexport enum KioskMode {\n Full = 'full',\n}\n\nexport type GetMutableDashboardModelFn = () => DashboardModel | null;\n\nexport interface QueriesToUpdateOnDashboardLoad {\n panelId: number;\n queries: DataQuery[];\n}\n\nexport interface DashboardState {\n getModel: GetMutableDashboardModelFn;\n initPhase: DashboardInitPhase;\n initialDatasource?: DataSourceRef['uid'];\n initError: DashboardInitError | null;\n}\n\nexport const DASHBOARD_FROM_LS_KEY = 'DASHBOARD_FROM_LS_KEY';\n\nexport function isRedirectResponse(dto: DashboardDTO | HomeDashboardRedirectDTO): dto is HomeDashboardRedirectDTO {\n return 'redirectUri' in dto;\n}\n","import { AnnotationQuery, BusEventBase, BusEventWithPayload, eventFactory } from '@grafana/data';\nimport { IconName, ButtonVariant } from '@grafana/ui';\nimport { HistoryEntryView } from 'app/core/components/AppChrome/types';\n\n/**\n * Event Payloads\n */\n\nexport interface ShowDashSearchPayload {\n query?: string;\n}\n\nexport interface LocationChangePayload {\n href: string;\n}\n\nexport interface ShowModalPayload {\n model?: any;\n modalClass?: string;\n src?: string;\n templateHtml?: string;\n backdrop?: any;\n scope?: any;\n}\n\nexport interface ShowModalReactPayload {\n component: React.ComponentType<any>;\n props?: any;\n}\n\nexport interface ShowConfirmModalPayload {\n title?: string;\n text?: string;\n text2?: string;\n text2htmlBind?: boolean;\n confirmText?: string;\n altActionText?: string;\n yesText?: string;\n noText?: string;\n icon?: IconName;\n yesButtonVariant?: ButtonVariant;\n\n onDismiss?: () => void;\n onConfirm?: () => void;\n onAltAction?: () => void;\n}\n\nexport interface ToggleKioskModePayload {\n exit?: boolean;\n}\n\nexport interface GraphClickedPayload {\n pos: any;\n panel: any;\n item: any;\n}\n\nexport interface ThresholdChangedPayload {\n threshold: any;\n handleIndex: number;\n}\n\nexport interface DashScrollPayload {\n restore?: boolean;\n animate?: boolean;\n pos?: number;\n}\n\nexport interface PanelChangeViewPayload {}\n\n/**\n * Events\n */\n\nexport const templateVariableValueUpdated = eventFactory('template-variable-value-updated');\nexport const graphClicked = eventFactory<GraphClickedPayload>('graph-click');\n\n/**\n * @internal\n */\nexport const thresholdChanged = eventFactory<ThresholdChangedPayload>('threshold-changed');\n\n/**\n * Used for syncing queries badge count in panel edit queries tab\n * Think we can get rid of this soon\n */\nexport class PanelQueriesChangedEvent extends BusEventBase {\n static type = 'panel-queries-changed';\n}\n\n/**\n * Used for syncing transformations badge count in panel edit transform tab\n * Think we can get rid of this soon\n */\nexport class PanelTransformationsChangedEvent extends BusEventBase {\n static type = 'panel-transformations-changed';\n}\n\n/**\n * Used by panel editor to know when panel plugin itself trigger option updates\n */\nexport class PanelOptionsChangedEvent extends BusEventBase {\n static type = 'panels-options-changed';\n}\n\n/**\n * Used internally by DashboardModel to communicate with DashboardGrid that it needs to re-render\n */\nexport class DashboardPanelsChangedEvent extends BusEventBase {\n static type = 'dashboard-panels-changed';\n}\n\nexport class DashboardMetaChangedEvent extends BusEventBase {\n static type = 'dashboard-meta-changed';\n}\n\nexport class PanelDirectiveReadyEvent extends BusEventBase {\n static type = 'panel-directive-ready';\n}\n\nexport class RenderEvent extends BusEventBase {\n static type = 'render';\n}\n\ninterface ZoomOutEventPayload {\n scale: number;\n updateUrl?: boolean;\n}\n\nexport class ZoomOutEvent extends BusEventWithPayload<ZoomOutEventPayload> {\n static type = 'zoom-out';\n}\n\nexport enum ShiftTimeEventDirection {\n Left = -1,\n Right = 1,\n}\n\ninterface ShiftTimeEventPayload {\n direction: ShiftTimeEventDirection;\n updateUrl?: boolean;\n}\n\nexport class ShiftTimeEvent extends BusEventWithPayload<ShiftTimeEventPayload> {\n static type = 'shift-time';\n}\n\nexport class CopyTimeEvent extends BusEventBase {\n static type = 'copy-time';\n}\n\ninterface PasteTimeEventPayload {\n updateUrl?: boolean;\n}\n\nexport class PasteTimeEvent extends BusEventWithPayload<PasteTimeEventPayload> {\n static type = 'paste-time';\n}\n\ninterface AbsoluteTimeEventPayload {\n updateUrl: boolean;\n}\n\nexport class AbsoluteTimeEvent extends BusEventWithPayload<AbsoluteTimeEventPayload> {\n static type = 'absolute-time';\n}\n\nexport class RemovePanelEvent extends BusEventWithPayload<number> {\n static type = 'remove-panel';\n}\n\n/**\n * @deprecated use ShowModalReactEvent instead that has this capability built in\n */\nexport class ShowModalEvent extends BusEventWithPayload<ShowModalPayload> {\n static type = 'show-modal';\n}\n\nexport class ShowConfirmModalEvent extends BusEventWithPayload<ShowConfirmModalPayload> {\n static type = 'show-confirm-modal';\n}\n\nexport class ShowModalReactEvent extends BusEventWithPayload<ShowModalReactPayload> {\n static type = 'show-react-modal';\n}\n\n/**\n * @deprecated use ShowModalReactEvent instead that has this capability built in\n */\nexport class HideModalEvent extends BusEventBase {\n static type = 'hide-modal';\n}\n\nexport class DashboardSavedEvent extends BusEventBase {\n static type = 'dashboard-saved';\n}\n\nexport class AnnotationQueryStarted extends BusEventWithPayload<AnnotationQuery> {\n static type = 'annotation-query-started';\n}\n\nexport class AnnotationQueryFinished extends BusEventWithPayload<AnnotationQuery> {\n static type = 'annotation-query-finished';\n}\n\nexport class PanelEditEnteredEvent extends BusEventWithPayload<number> {\n static type = 'panel-edit-started';\n}\n\nexport class PanelEditExitedEvent extends BusEventWithPayload<number> {\n static type = 'panel-edit-finished';\n}\n\nexport class RecordHistoryEntryEvent extends BusEventWithPayload<HistoryEntryView> {\n static type = 'record-history-entry';\n}\n","import { Observable, SubscriptionLike, Unsubscribable } from 'rxjs';\n\nimport {\n AbsoluteTimeRange,\n DataFrame,\n DataQuery,\n DataQueryRequest,\n DataSourceApi,\n HistoryItem,\n LogsModel,\n PanelData,\n RawTimeRange,\n TimeRange,\n EventBusExtended,\n DataQueryResponse,\n ExplorePanelsState,\n SupplementaryQueryType,\n UrlQueryMap,\n ExploreCorrelationHelperData,\n DataLinkTransformationConfig,\n} from '@grafana/data';\nimport { CorrelationData } from '@grafana/runtime';\nimport { RichHistorySearchFilters, RichHistorySettings } from 'app/core/utils/richHistoryTypes';\n\nexport type ExploreQueryParams = UrlQueryMap;\n\nexport enum CORRELATION_EDITOR_POST_CONFIRM_ACTION {\n CLOSE_PANE,\n CHANGE_DATASOURCE,\n CLOSE_EDITOR,\n}\n\nexport interface CorrelationEditorDetails {\n editorMode: boolean;\n correlationDirty: boolean;\n queryEditorDirty: boolean;\n isExiting: boolean;\n postConfirmAction?: {\n // perform an action after a confirmation modal instead of exiting editor mode\n exploreId: string;\n action: CORRELATION_EDITOR_POST_CONFIRM_ACTION;\n changeDatasourceUid?: string;\n isActionLeft: boolean;\n };\n canSave?: boolean;\n label?: string;\n description?: string;\n transformations?: DataLinkTransformationConfig[];\n}\n\n// updates can have any properties\nexport interface CorrelationEditorDetailsUpdate extends Partial<CorrelationEditorDetails> {}\n\n/**\n * Global Explore state\n */\nexport interface ExploreState {\n /**\n * True if time interval for panels are synced. Only possible with split mode.\n */\n syncedTimes: boolean;\n\n panes: Record<string, ExploreItemState | undefined>;\n\n /**\n * History of all queries\n */\n richHistory: RichHistoryQuery[];\n richHistorySearchFilters?: RichHistorySearchFilters;\n richHistoryTotal?: number;\n\n /**\n * Settings for rich history (note: filters are stored per each pane separately)\n */\n richHistorySettings?: RichHistorySettings;\n\n /**\n * True if local storage quota was exceeded when a rich history item was added. This is to prevent showing\n * multiple errors when local storage is full.\n */\n richHistoryStorageFull: boolean;\n\n /**\n * True if a warning message of hitting the exceeded number of items has been shown already.\n */\n richHistoryLimitExceededWarningShown: boolean;\n\n /**\n * Details on a correlation being created from explore\n */\n correlationEditorDetails?: CorrelationEditorDetails;\n\n /**\n * On a split manual resize, we calculate which pane is larger, or if they are roughly the same size. If undefined, it is not split or they are roughly the same size\n */\n largerExploreId?: keyof ExploreState['panes'];\n\n /**\n * If a maximize pane button is pressed, this indicates which side was maximized. Will be undefined if not split or if it is manually resized\n */\n maxedExploreId?: keyof ExploreState['panes'];\n\n /**\n * If a minimize pane button is pressed, it will do an even split of panes. Will be undefined if split or on a manual resize\n */\n evenSplitPanes?: boolean;\n}\n\nexport const EXPLORE_GRAPH_STYLES = ['lines', 'bars', 'points', 'stacked_lines', 'stacked_bars'] as const;\nexport type ExploreGraphStyle = (typeof EXPLORE_GRAPH_STYLES)[number];\n\nexport interface ExploreItemState {\n /**\n * Width used for calculating the graph interval (can't have more datapoints than pixels)\n */\n containerWidth: number;\n /**\n * Datasource instance that has been selected. Datasource-specific logic can be run on this object.\n */\n datasourceInstance?: DataSourceApi | null;\n /**\n * Emitter to send events to the rest of Grafana.\n */\n eventBridge: EventBusExtended;\n /**\n * List of timeseries to be shown in the Explore graph result viewer.\n */\n graphResult: DataFrame[] | null;\n /**\n * History of recent queries. Datasource-specific and initialized via localStorage.\n */\n history: HistoryItem[];\n /**\n * Queries for this Explore, e.g., set via URL. Each query will be\n * converted to a query row.\n */\n queries: DataQuery[];\n /**\n * True if this Explore area has been initialized.\n * Used to distinguish URL state injection versus split view state injection.\n */\n initialized: boolean;\n /**\n * Log query result to be displayed in the logs result viewer.\n */\n logsResult: LogsModel | null;\n\n /**\n * Time range for this Explore. Managed by the time picker and used by all query runs.\n */\n range: TimeRange;\n\n absoluteRange: AbsoluteTimeRange;\n /**\n * True if scanning for more results is active.\n */\n scanning: boolean;\n /**\n * Current scanning range to be shown to the user while scanning is active.\n */\n scanRange?: RawTimeRange;\n\n /**\n * Table model that combines all query table results into a single table.\n */\n tableResult: DataFrame[] | null;\n\n /**\n * Simple UI that emulates native prometheus UI\n */\n rawPrometheusResult: DataFrame | null;\n\n /**\n * React keys for rendering of QueryRows\n */\n queryKeys: string[];\n\n /**\n * How often query should be refreshed\n */\n refreshInterval?: string;\n\n /**\n * If true, the view is in live tailing mode.\n */\n isLive: boolean;\n\n /**\n * If true, the live tailing view is paused.\n */\n isPaused: boolean;\n\n /**\n * Index of the last item in the list of logs\n * when the live tailing views gets cleared.\n */\n clearedAtIndex: number | null;\n\n querySubscription?: Unsubscribable;\n\n queryResponse: ExplorePanelData;\n\n showLogs?: boolean;\n showMetrics?: boolean;\n showTable?: boolean;\n /**\n * If true, the default \"raw\" prometheus instant query UI will be displayed in addition to table view\n */\n showRawPrometheus?: boolean;\n showTrace?: boolean;\n showNodeGraph?: boolean;\n showFlameGraph?: boolean;\n showCustom?: boolean;\n\n /**\n * We are using caching to store query responses of queries run from logs navigation.\n * In logs navigation, we do pagination and we don't want our users to unnecessarily run the same queries that they've run just moments before.\n * We are currently caching last 5 query responses.\n */\n cache: Array<{ key: string; value: ExplorePanelData }>;\n\n /**\n * Supplementary queries are additional queries used in Explore, e.g. for logs volume\n */\n supplementaryQueries: SupplementaryQueries;\n\n panelsState: ExplorePanelsState;\n\n correlationEditorHelperData?: ExploreCorrelationHelperData;\n\n correlations?: CorrelationData[];\n}\n\nexport interface ExploreUpdateState {\n datasource: boolean;\n queries: boolean;\n range: boolean;\n mode: boolean;\n}\n\nexport interface QueryOptions {\n minInterval?: string;\n maxDataPoints?: number;\n liveStreaming?: boolean;\n}\n\nexport interface QueryTransaction {\n id: string;\n done: boolean;\n request: DataQueryRequest;\n queries: DataQuery[];\n scanning?: boolean;\n}\n\nexport type RichHistoryQuery<T extends DataQuery = DataQuery> = {\n id: string;\n createdAt: number;\n datasourceUid: string;\n datasourceName: string;\n starred: boolean;\n comment: string;\n queries: T[];\n};\n\nexport interface ExplorePanelData extends PanelData {\n graphFrames: DataFrame[];\n tableFrames: DataFrame[];\n logsFrames: DataFrame[];\n traceFrames: DataFrame[];\n customFrames: DataFrame[];\n nodeGraphFrames: DataFrame[];\n rawPrometheusFrames: DataFrame[];\n flameGraphFrames: DataFrame[];\n graphResult: DataFrame[] | null;\n tableResult: DataFrame[] | null;\n logsResult: LogsModel | null;\n rawPrometheusResult: DataFrame | null;\n}\n\nexport enum TABLE_RESULTS_STYLE {\n table = 'table',\n raw = 'raw',\n}\nexport const TABLE_RESULTS_STYLES = [TABLE_RESULTS_STYLE.table, TABLE_RESULTS_STYLE.raw];\nexport type TableResultsStyle = (typeof TABLE_RESULTS_STYLES)[number];\n\nexport interface SupplementaryQuery {\n enabled: boolean;\n dataProvider?: Observable<DataQueryResponse>;\n dataSubscription?: SubscriptionLike;\n data?: DataQueryResponse;\n}\n\nexport type SupplementaryQueries = {\n [key in SupplementaryQueryType]: SupplementaryQuery;\n};\n","import { WithAccessControlMetadata } from '@grafana/data';\n\nimport { ApiKey, OrgRole, Role } from '.';\n\nexport interface OrgServiceAccount extends WithAccessControlMetadata {\n serviceAccountId: number;\n avatarUrl: string;\n email: string;\n login: string;\n name: string;\n displayName: string;\n orgId: number;\n role: OrgRole;\n tokens: number[];\n}\n\nexport interface ServiceAccount {\n id: number;\n label: string;\n avatarUrl: string;\n login: string;\n email: string;\n name: string;\n displayName: string;\n orgId?: number;\n}\n\nexport interface ServiceAccountDTO extends WithAccessControlMetadata {\n id: number;\n uid: string;\n orgId: number;\n tokens: number;\n name: string;\n login: string;\n avatarUrl?: string;\n createdAt: string;\n isDisabled: boolean;\n isExternal?: boolean;\n requiredBy?: string;\n teams: string[];\n role: OrgRole;\n roles?: Role[];\n}\n\nexport interface ServiceAccountCreateApiResponse {\n avatarUrl?: string;\n id: number;\n uid: string;\n isDisabled: boolean;\n login: string;\n name: string;\n orgId: number;\n role: OrgRole;\n tokens: number;\n}\n\nexport interface ServiceAccountProfileState {\n serviceAccount: ServiceAccountDTO;\n isLoading: boolean;\n rolesLoading?: boolean;\n tokens: ApiKey[];\n}\n\nexport enum ServiceAccountStateFilter {\n All = 'All',\n WithExpiredTokens = 'WithExpiredTokens',\n External = 'External',\n Disabled = 'Disabled',\n}\n\nexport interface ServiceAccountsState {\n serviceAccounts: ServiceAccountDTO[];\n isLoading: boolean;\n roleOptions: Role[];\n\n // search / filtering\n query: string;\n perPage: number;\n page: number;\n totalPages: number;\n showPaging: boolean;\n serviceAccountStateFilter: ServiceAccountStateFilter;\n}\n\nexport interface ServiceAccountsUpgradeStatus {\n upgraded: boolean;\n}\n","export interface AppNotification {\n id: string;\n severity: AppNotificationSeverity;\n icon: string;\n title: string;\n text: string;\n traceId?: string;\n component?: React.ReactElement;\n showing: boolean;\n timestamp: number;\n}\n\nexport enum AppNotificationSeverity {\n Success = 'success',\n Warning = 'warning',\n Error = 'error',\n Info = 'info',\n}\n\nexport enum AppNotificationTimeout {\n Success = 3000,\n Warning = 5000,\n Error = 7000,\n}\n\nexport const timeoutMap = {\n [AppNotificationSeverity.Success]: AppNotificationTimeout.Success,\n [AppNotificationSeverity.Warning]: AppNotificationTimeout.Warning,\n [AppNotificationSeverity.Error]: AppNotificationTimeout.Error,\n [AppNotificationSeverity.Info]: AppNotificationTimeout.Success,\n};\n\nexport interface AppNotificationsState {\n byId: Record<string, AppNotification>;\n lastRead: number;\n}\n","/* eslint-disable no-restricted-imports */\nimport {\n Action,\n addListener as addListenerUntyped,\n AsyncThunk,\n AsyncThunkOptions,\n AsyncThunkPayloadCreator,\n createAsyncThunk as createAsyncThunkUntyped,\n PayloadAction,\n TypedAddListener,\n} from '@reduxjs/toolkit';\nimport {\n useSelector as useSelectorUntyped,\n TypedUseSelectorHook,\n useDispatch as useDispatchUntyped,\n} from 'react-redux';\nimport { ThunkAction, ThunkDispatch as GenericThunkDispatch } from 'redux-thunk';\n\nimport type { createRootReducer } from 'app/core/reducers/root';\nimport { AppDispatch, RootState } from 'app/store/configureStore';\n\nexport type StoreState = ReturnType<ReturnType<typeof createRootReducer>>;\n\n/*\n * Utility type to get strongly types thunks\n */\nexport type ThunkResult<R> = ThunkAction<R, StoreState, undefined, PayloadAction<any>>;\n\nexport type ThunkDispatch = GenericThunkDispatch<StoreState, undefined, Action>;\n\n// Typed useDispatch & useSelector hooks\nexport const useDispatch: () => AppDispatch = useDispatchUntyped;\nexport const useSelector: TypedUseSelectorHook<RootState> = useSelectorUntyped;\n\ntype DefaultThunkApiConfig = { dispatch: AppDispatch; state: StoreState };\nexport const createAsyncThunk = <Returned, ThunkArg = void, ThunkApiConfig extends {} = DefaultThunkApiConfig>(\n typePrefix: string,\n payloadCreator: AsyncThunkPayloadCreator<Returned, ThunkArg, ThunkApiConfig>,\n options?: AsyncThunkOptions<ThunkArg, ThunkApiConfig>\n): AsyncThunk<Returned, ThunkArg, ThunkApiConfig> =>\n createAsyncThunkUntyped<Returned, ThunkArg, ThunkApiConfig>(typePrefix, payloadCreator, options);\n\nexport const addListener = addListenerUntyped as TypedAddListener<RootState, AppDispatch>;\n","import { CorsWorker as Worker } from 'app/core/utils/CorsWorker';\n\nexport default function loadKusto() {\n return new Worker(new URL('@kusto/monaco-kusto/release/esm/kusto.worker', import.meta.url));\n}\n","import loadKusto from './kusto';\n\nexport default function getDefaultMonacoLanguages() {\n const kusto = { id: 'kusto', name: 'kusto', init: loadKusto };\n return [kusto];\n}\n"],"names":["defaultTimeZoneResolver","setTimeZoneResolver","resolver","getTimeZone","options","units","isDurationUnit","value","isMathString","text","parse","roundUp","timezone","fiscalYearStartMonth","toDateTime","dateTimeRep","time","mathString","index","parseString","parseDateMath","isValid","date","strippedMathString","result","len","c","type","num","unitString","isFiscal","numFrom","unit","roundToFiscal","fyStartMonth","dateTime","DEFAULT_SYSTEM_DATE_FORMAT","DEFAULT_SYSTEM_DATE_MS_FORMAT","SystemDateFormatsState","settings","localTimeFormat","useMsResolution","locale","fallback","missingIntlDateTimeFormatSupport","dateTimeFormat","parts","mapping","part","systemDateFormats","dateInUtc","toTz","getFormat","dateTimeFormatISO","dateTimeFormatTimeAgo","dateTimeFormatWithAbbrevation","timeZoneAbbrevation","timeZone","zone","ISO_8601","setLocale","language","getLocale","getLocaleData","isDateTimeInput","v","isDateTime","toUtc","input","formatInput","toDuration","dateTimeAsMoment","dateTimeForTimeZone","getWeekdayIndex","day","wd","getWeekdayIndexByEnglishName","setWeekStart","weekStart","suffix","dow","dateTimeParse","parseOthers","parsed","format","spans","BASE_RANGE_OPTIONS","HIDDEN_RANGE_OPTIONS","STANDARD_RANGE_OPTIONS","findRangeInOptions","range","option","describeTextRange","expr","isLast","opt","amount","span","describeTimeRange","quickRanges","rangeOptions","isValidTimeSpan","describeTimeRangeAbbreviation","convertRawToRange","raw","from","to","isRelativeTime","timeRange","isRelativeTimeRange","secondsToHms","seconds","numYears","numDays","numHours","numMinutes","numSeconds","numMilliseconds","msRangeToTimeString","rangeMs","rangeSec","h","m","s","formattedH","formattedM","formattedS","calculateInterval","resolution","lowLimitInterval","lowLimitMs","intervalToMs","intervalMs","roundInterval","interval_regex","intervals_in_seconds","describeInterval","str","matches","sec","intervalToSeconds","info","interval","timeRangeToRelative","now","relativeToTimeRange","relativeTimeRange","EventBusSrv","event","typeFilter","handler","eventType","observer","key","filter","ScopedEventBus","payload","scope","emittedEvent","unbind","sub","path","eventBus","typeList","eventFactory","name","BusEventBase","tags","BusEventWithPayload","monacoLanguageRegistry","userHasPermission","action","user","userHasPermissionInMetadata","object","userHasAllPermissions","actions","userHasAnyPermission","XSSWL","acc","element","sanitizeTextPanelWhitelist","tag","isWhiteAttr","sanitizeUrl","sanitize","unsanitizedString","escapeHtml","sanitizeTrustedTypesRSS","sanitizeTrustedTypes","sanitizeTextPanelContent","sanitizeSVGContent","url","hasAnsiCodes","textUtil","specialMatcher","specialCharEscape","specialCharUnescape","escapeStringForRegex","unEscapeStringFromRegex","stringStartsAsRegEx","stringToJsRegex","match","stringToMs","nr","d","toNumberString","toIntegerOrUndefined","toFloatOrUndefined","toPascalCase","string","escapeRegex","clamp","min","max","hexToRgb","color","re","colors","n","intToHex","int","hex","rgbToHex","values","decomposeColor","asHexString","tColor","asRgbString","hslToRgb","l","a","f","k","rgb","recomposeColor","marker","colorSpace","i","getContrastRatio","foreground","background","canvas","lumA","getLuminance","lumB","backgroundParts","alpha","rgbNumbers","val","emphasize","coefficient","darken","lighten","colorManipulator","ThemeContext","createBreakpoints","keys","up","down","palette","DarkColors","LightColors","createColors","dark","light","base","primary","secondary","warning","success","error","tonalOffset","hoverFactor","contrastThreshold","other","getContrastText","threshold","getRichColor","factor","createComponents","shadows","panel","createShadows","createShape","baseBorderRadius","createSpacing","gridSize","transform","spacing","args","argument","output","easing","duration","create","props","durationOption","easingOption","delay","animatedProp","formatMs","handleMotion","prop","getAutoHeightDuration","height","constant","milliseconds","createTransitions","defaultFontFamily","defaultFontFamilyMonospace","createTypography","typographyInput","fontFamily","fontFamilyMonospace","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","coef","pxToRem","size","buildVariant","fontWeight","lineHeight","letterSpacing","casing","round","variants","createV1Theme","theme","oldCommon","basicColors","commonColorsPalette","backgrounds","borders","textColors","form","createVisualizationColors","hues","getLightHues","getDarkHues","byNameIndex","hue","shade","alias","getColorByName","colorName","realColor","nativeColor","nativeColorNames","getClassicPalette","zIndex","createTheme","colorsInput","spacingInput","shapeInput","breakpoints","shape","typography","transitions","components","visualization","whiteBase","secondaryBase","brandMain","brandText","disabledText","getThemeById","id","themeRegistry","getBuiltInThemes","allowedExtras","item","b","Registry","getSystemPreferenceTheme","FieldType","TIME_SERIES_VALUE_FIELD_NAME","TIME_SERIES_TIME_FIELD_NAME","TIME_SERIES_METRIC_FIELD_NAME","FieldColorModeId","FALLBACK_COLOR","availableIconsIndex","isIconName","iconName","toIconName","OrgRole","PluginState","PluginType","PluginSignatureStatus","PluginSignatureType","PluginErrorCode","PluginLoadingStrategy","PluginIncludeType","GrafanaPlugin","tab","GrafanaThemeType","DefaultTimeZone","TIME_FORMAT","getDefaultTimeRange","getDefaultRelativeTimeRange","makeTimeRange","fromDateTime","init","ext","current","select","currentOptions","ids","found","history","deprecationWarning","file","oldName","newName","message","last","toOption","currency","symbol","asSuffix","scaler","decimals","scaledDecimals","isNegative","scaled","SI_PREFIXES","SI_BASE_INDEX","getOffsetFromSIPrefix","charIndex","prefix","BIN_PREFIXES","binaryPrefix","offset","p","SIPrefix","toPercent","toFixed","toPercentUnit","toHex0x","asHex","toHex","sci","Interval","UNITS","INTERVALS_IN_SECONDS","toNanoSeconds","toFixedScaled","toMicroSeconds","toMilliSeconds","toSeconds","toMinutes","toHours","toDays","timeScale","strings","decrementDecimals","decimalsCount","floor","toClock","hours","toDurationInMilliseconds","toDurationInSeconds","toDurationInHoursMinutesSeconds","toDurationInDaysHoursMinutesSeconds","dayString","hmsString","toTimeTicks","toClockMilliseconds","toClockSeconds","toDateTimeValueFormatter","pattern","todayPattern","dateTimeAsIso","dateTimeAsIsoNoDateIfToday","dateTimeAsUS","dateTimeAsUSNoDateIfToday","getDateTimeAsLocalFormat","getDateTimeAsLocalFormatNoDateIfToday","dateTimeSystemFormatter","showMs","dateTimeFromNow","getCategories","toFixedUnit","stringFormater","scaledUnits","simpleCountUnit","booleanValueFormatter","formattedValueToString","categories","hasBuiltIndex","getDecimalsForValue","formatted","decimalPos","precision","absValue","dec","magn","appendPluralIf","condition","asPrefix","isBooleanUnit","t","logb","x","extArray","siIndex","buildFormats","cat","getValueFormat","fmt","idx","getValueFormatterIndex","getValueFormats","resolveSelectors","versionedSelectors","grafanaVersion","version","resolveSelectorGroup","group","isVersionedSelectorGroup","assertIsSemverValid","resolveSelector","target","first","versionedSelector","versionToUse","versions","selectorName","MIN_GRAFANA_VERSION","versionedComponents","title","mode","status","_","refId","stepNo","severity","tooltip","sectionId","folderName","tabId","versionedPages","alertRuleUid","dataSourceName","dataSourceUid","pluginName","annotationIndex","editIndex","uid","label","dashboardUid","variableName","page","pluginId","Pages","Components","selectors","GrafanaBootConfig","defaults","overrideFeatureTogglesFromUrl","overrideFeatureTogglesFromLocalStorage","config","featureToggles","localStorageValue","features","feature","featureName","featureValue","toggleState","isDevelopment","safeRuntimeFeatureFlags","bootData","RefreshEvent","ThemeChangedEvent","TimeRangeUpdatedEvent","CopyPanelEvent","singletonInstance","setAppEvents","instance","getAppEvents","isFetchError","e","setBackendSrv","getBackendSrv","featureEnabled","enabledFeatures","DataTopic","ScaleDimensionMode","ScalarDimensionMode","TextDimensionMode","ResourceDimensionMode","FrameGeometrySourceMode","HeatmapCalculationMode","HeatmapCellLayout","LogsSortOrder","AxisPlacement","AxisColorMode","VisibilityMode","GraphDrawStyle","GraphTransform","LineInterpolation","ScaleDistribution","GraphGradientMode","StackingMode","BarAlignment","ScaleOrientation","ScaleDirection","defaultLineStyle","GraphThresholdsStyleMode","LegendDisplayMode","defaultReduceDataOptions","VizOrientation","defaultOptionsWithTimezones","BigValueColorMode","BigValueGraphMode","BigValueJustifyMode","BigValueTextMode","PercentChangeColorMode","TooltipDisplayMode","SortOrder","defaultVizLegendOptions","BarGaugeDisplayMode","BarGaugeValueMode","BarGaugeNamePlacement","BarGaugeSizing","TableCellDisplayMode","TableCellBackgroundDisplayMode","defaultTableFooterOptions","TableCellHeight","VariableFormatID","LogsDedupStrategy","ComparisonOperation","defaultTableFieldOptions","defaultTimeZone","allButtonVariants","allButtonFills","Button","variant","fill","icon","fullWidth","children","className","disabled","tooltipPlacement","onClick","otherProps","ref","styles","getButtonStyles","buttonStyles","hasTooltip","button","IconRenderer","LinkButton","onBlur","onFocus","linkButtonStyles","iconType","iconOnly","padding","variantStyles","getPropertiesForVariant","disabledStyles","getPropertiesForDisabled","focusStyle","paddingMinusBorder","getButtonVariantStyles","outlineBorderColor","borderColor","hoverBorderColor","clearButtonStyles","clearLinkButtonStyles","ErrorWithStack","errorInfo","style","getStyles","getFocusStyle","sharedInputStyle","invalid","borderColorHover","textColor","autoFillBorder","inputPadding","inputSizes","inputSizesPixels","getPropertiesForButtonSize","getIconStyles","Icon","rest","iconRoot","svgSize","svgHgt","svgWid","subDir","svgPath","composedClassName","alwaysMonoIcons","getIconSubDir","getSvgSize","getIconRoot","grafanaPublicPath","IconButton","limitedIconSize","ariaLabel","buttonRef","deprecatedAriaLabel","ariaLabelProp","restProps","hoverSize","iconColor","AutoSizeInputContext","Input","addonAfter","addonBefore","suffixProp","loading","width","prefixRef","prefixRect","suffixRef","suffixRect","isInAutoSizeInput","accessoriesWidth","autoSizeWidth","getInputStyles","prefixSuffixStaticWidth","prefixSuffix","Box","margin","marginX","marginY","marginTop","marginBottom","marginLeft","marginRight","paddingX","paddingY","paddingTop","paddingBottom","paddingLeft","paddingRight","display","backgroundColor","grow","shrink","basis","flex","borderStyle","borderRadius","direction","justifyContent","alignItems","boxShadow","gap","minWidth","maxWidth","minHeight","maxHeight","position","sizeStyles","Element","customBorderColor","customBackgroundColor","Stack","wrap","breakpointCSS","getCSS","getResponsiveStyle","getSizeStyles","LoadingPlaceholder","findInsertIndex","line","ch","getCompletionItems","monaco","suggestions","items","suggestion","mapKinds","sug","registerSuggestions","getSuggestions","modelId","model","context","currentLine","UnthemedCodeEditor","customLanguage","onSave","onBeforeEditorMount","editor","onChange","onEditorDidMount","oldProps","newLanguage","showMiniMap","showLineNumbers","readOnly","wordWrap","monacoOptions","alwaysConsumeMouseWheel","restMonacoOptions","longText","containerStyles","ReactMonacoEditorLazy","CodeEditor","useAsyncDependency","importStatement","state","useAsync","dependency","ReactMonacoEditor","CodeEditorSuggestionItemKind","Portal","root","forwardedRef","node","portalRoot","getPortalContainer","PortalContainer","RefForwardingPortal","ScrollIndicators","showScrollTopIndicator","setShowTopScrollIndicator","showScrollBottomIndicator","setShowBottomScrollIndicator","scrollTopMarker","scrollBottomMarker","intersectionObserver","entries","entry","ScrollContainer","showScrollIndicators","onScroll","overflowX","overflowY","scrollbarWidth","boxProps","MultiValueContainer","innerProps","MultiValueRemove","CustomInput","testId","DropdownIndicator","selectProps","isOpen","IndicatorsContainer","InputControl","focused","getInputControlStyles","withPrefix","SelectOptionGroup","cx","getClassNames","Heading","headingProps","getSelectStyles","SelectOptionGroupHeader","Text","UnthemedValueContainer","valueChildren","otherChildren","truncatedValues","isMulti","noWrap","dataTestid","ValueContainer","cleanValue","filtered","selectedValue","findSelectedValue","omitDescriptions","description","CustomControl","menuIsOpen","onMenuClose","onMenuOpen","isFocused","getValue","innerRef","determineToggleAllState","SelectBase","allowCustomValue","allowCreateWhileLoading","autoFocus","backspaceRemovesValue","blurInputOnSelect","cacheOptions","closeMenuOnSelect","createOptionPosition","defaultOptions","defaultValue","filterOption","formatCreateLabel","getOptionLabel","getOptionValue","inputValue","isClearable","isLoading","inputId","isOptionDisabled","isSearchable","loadOptions","loadingMessage","maxMenuHeight","minMenuHeight","maxVisibleValues","menuPlacement","menuPosition","menuShouldPortal","noOptionsMessage","onCloseMenu","onCreateOption","onInputChange","onKeyDown","onMenuScrollToBottom","onMenuScrollToTop","onOpenMenu","toggleAllOptions","openMenuOnFocus","placeholder","renderControl","showAllSelectedWhenOpen","tabSelectsValue","virtualized","noMultiValueWrap","isValidNewOption","formatOptionLabel","hideSelectedOptions","reactSelectRef","closeToBottom","setCloseToBottom","selectStyles","hasInputValue","setHasInputValue","distance","onChangeWithEmpty","ReactSelectComponent","creatableProps","asyncSelectProps","selectableValue","hasValue","commonSelectProps","actionMeta","newValue","newHasValue","defaultFormatCreateLabel","SelectMenuComponent","SelectMenu","toggleAllState","toggleAll","toSelect","CustomIndicatorsContainer","IndicatorSeparator","clearValue","Spinner","SingleValue","MultiValue","selectedValuesCount","indicatorChildren","Select","MultiSelect","AsyncSelect","VirtualizedSelect","AsyncVirtualizedSelect","AsyncMultiSelect","SelectContainer","isDisabled","getSelectContainerStyles","optionsElement","SelectMenuOptions","ToggleAllOption","VIRTUAL_LIST_ITEM_HEIGHT","VIRTUAL_LIST_WIDTH_ESTIMATE_MULTIPLIER","VIRTUAL_LIST_PADDING","VIRTUAL_LIST_WIDTH_EXTRA","VirtualizedSelectMenu","scrollRef","focusedOption","listRef","optionComponent","flattenedOptions","focusedIndex","flattenedChildren","child","hasArrayChildren","longestOption","widthEstimate","heightEstimate","selectedCount","data","isSelected","renderOptionLabel","onMouseMove","onMouseOver","useDelayedSwitch","delayedValue","setDelayedValue","onStartTime","timeout","timeSpent","turnOff","FadeWithImage","SlideOutTransition","FadeTransition","resetSelectStyles","originalStyles","useCustomSelectStyles","top","bottom","provided","ToggleAllState","inline","iconClassName","deprecatedStyles","getDeprecatedStyles","TruncatedText","childElement","isOverflowing","setIsOverflowing","internalRef","resizeObserver","getTooltipText","Tooltip","weight","truncate","italic","textAlignment","tabular","getTextStyles","customWeight","customColor","customVariant","interactive","show","placement","content","arrowRef","controlledVisible","setControlledVisible","middleware","refs","floatingStyles","tooltipId","hover","focus","dismiss","getReferenceProps","getFloatingProps","contentIsFunction","handleRef","childHasMatchingAriaLabel","formatViewed","dateString","diffHours","getUserInitials","UserIcon","userView","showTooltip","lastActiveAt","isActive","getIconBorder","shadowColor","shadowHoverColor","visible","transitionRef","horizontal","measurement","ThemeContextMock","memoizedStyleCreators","withTheme","Component","WithTheme","ContextComponent","withTheme2","useTheme","useTheme2","useStyles","memoizedStyleCreator","useStyles2","additionalArguments","mockThemeContext","cardChrome","hoverColor","listItem","listItemSelected","mediaUp","breakpoint","isGrafanaTheme2","focusCss","isTheme2","firstColor","secondColor","getMouseFocusStyles","getFocusStyles","getTooltipContainerStyles","stylesFactory","stylesCreator","isIconSize","getAvailableIcons","getFieldTypeIcon","field","getFieldTypeIconName","initI18n","Trans","tFunc","defaultMessage","spin","getPlacement","buildTooltipTheme","tooltipBg","toggletipBorder","tooltipText","tooltipPadding","appEvents","grafanaConfig","getConfig","updateConfig","update","hasAlphaPanels","setMonacoEnv","_moduleId","Profiler","profiler","AutoRefreshInterval","RedirectToUrlKey","User","ContextSrv","role","intervals","expires","expiresWithDistribution","nextRun","res","contextSrv","setContextSrv","override","matchSeriesOverride","aliasOrRegex","seriesAlias","regex","translateFillOption","getFillGradient","updateLegendValues","series","yaxes","seriesYAxis","axis","formatter","TimeSeries","opts","overrides","fillStyle","ignoreNulls","nullAsZero","currentTime","currentValue","nonNulls","previousTime","previousValue","previousDeltaUp","timeStep","formater","timestamp","CSP_REPORT_ONLY_ENABLED","defaultTrustedTypesPolicy","source","sink","ThemeProvider","setTheme","provideTheme","component","CorsWorker","scriptUrl","scriptsBasePathUrl","importScripts","objectURL","getSessionExpiry","expiryCookie","row","expiresStr","hasSessionExpiry","AccessControlAction","TeamPermissionLevel","PermissionLevelString","SearchQueryType","DashboardRoutes","DashboardInitPhase","KioskMode","DASHBOARD_FROM_LS_KEY","isRedirectResponse","dto","templateVariableValueUpdated","graphClicked","thresholdChanged","PanelQueriesChangedEvent","PanelTransformationsChangedEvent","PanelOptionsChangedEvent","DashboardPanelsChangedEvent","DashboardMetaChangedEvent","PanelDirectiveReadyEvent","RenderEvent","ZoomOutEvent","ShiftTimeEventDirection","ShiftTimeEvent","CopyTimeEvent","PasteTimeEvent","AbsoluteTimeEvent","RemovePanelEvent","ShowModalEvent","ShowConfirmModalEvent","ShowModalReactEvent","HideModalEvent","DashboardSavedEvent","AnnotationQueryStarted","AnnotationQueryFinished","PanelEditEnteredEvent","PanelEditExitedEvent","RecordHistoryEntryEvent","CORRELATION_EDITOR_POST_CONFIRM_ACTION","EXPLORE_GRAPH_STYLES","TABLE_RESULTS_STYLE","TABLE_RESULTS_STYLES","ServiceAccountStateFilter","AppNotificationSeverity","AppNotificationTimeout","timeoutMap","useDispatch","useSelector","createAsyncThunk","typePrefix","payloadCreator","addListener","loadKusto","getDefaultMonacoLanguages"],"sourceRoot":""}