id
stringlengths 1
6
| tokens
sequence | labels
sequence |
---|---|---|
661600 | [
"import",
"{",
"useEffect",
",",
"useCallback",
",",
"useMemo",
"}",
"from",
"'react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"IAggConfig",
"}",
"from",
"'src/plugins/data/public'",
";",
"type",
"AggFilter",
"=",
"string",
"[",
"]",
";",
"const",
"DEFAULT_METRIC",
"=",
"'custom'",
";",
"const",
"CUSTOM_METRIC",
"=",
"{",
"text",
":",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.customMetricLabel'",
",",
"{",
"defaultMessage",
":",
"'Custom metric'",
",",
"}",
")",
",",
"value",
":",
"DEFAULT_METRIC",
",",
"}",
";",
"function",
"useCompatibleAggCallback",
"(",
"aggFilter",
")",
"{",
"return",
"useCallback",
"(",
"isCompatibleAggregation",
"(",
"aggFilter",
")",
",",
"[",
"aggFilter",
"]",
")",
";",
"}",
"/**\n * the effect is used to set up a default metric aggregation in case,\n * when previously selected metric has been removed\n */",
"function",
"useFallbackMetric",
"(",
"setValue",
",",
"aggFilter",
",",
"metricAggs",
"?",
",",
"value",
"?",
",",
"fallbackValue",
"?",
")",
"{",
"const",
"isCompatibleAgg",
"=",
"useCompatibleAggCallback",
"(",
"aggFilter",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"metricAggs",
"&&",
"value",
"&&",
"value",
"!==",
"DEFAULT_METRIC",
")",
"{",
"const",
"respAgg",
"=",
"metricAggs",
".",
"filter",
"(",
"isCompatibleAgg",
")",
".",
"find",
"(",
"(",
"aggregation",
")",
"=>",
"aggregation",
".",
"id",
"===",
"value",
")",
";",
"if",
"(",
"!",
"respAgg",
"&&",
"value",
"!==",
"fallbackValue",
")",
"{",
"setValue",
"(",
"fallbackValue",
")",
";",
"}",
"}",
"}",
",",
"[",
"setValue",
",",
"isCompatibleAgg",
",",
"metricAggs",
",",
"value",
",",
"fallbackValue",
"]",
")",
";",
"}",
"/**\n * this makes an array of available options in appropriate format for EuiSelect,\n * calculates if an option is disabled\n */",
"function",
"useAvailableOptions",
"(",
"aggFilter",
",",
"metricAggs",
"=",
"[",
"]",
",",
"defaultOptions",
"=",
"[",
"]",
")",
"{",
"const",
"isCompatibleAgg",
"=",
"useCompatibleAggCallback",
"(",
"aggFilter",
")",
";",
"const",
"options",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"[",
"...",
"metricAggs",
".",
"map",
"(",
"(",
"respAgg",
")",
"=>",
"(",
"{",
"text",
":",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.definiteMetricLabel'",
",",
"{",
"defaultMessage",
":",
"'Metric: {metric}'",
",",
"values",
":",
"{",
"metric",
":",
"safeMakeLabel",
"(",
"respAgg",
")",
",",
"}",
",",
"}",
")",
",",
"value",
":",
"respAgg",
".",
"id",
",",
"disabled",
":",
"!",
"isCompatibleAgg",
"(",
"respAgg",
")",
",",
"}",
")",
")",
",",
"CUSTOM_METRIC",
",",
"...",
"defaultOptions",
",",
"]",
",",
"[",
"metricAggs",
",",
"defaultOptions",
",",
"isCompatibleAgg",
"]",
")",
";",
"return",
"options",
";",
"}",
"/**\n * the effect is used to set up the editor form validity\n * and reset it if a param has been removed\n */",
"function",
"useValidation",
"(",
"setValidity",
",",
"isValid",
")",
"{",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"setValidity",
"(",
"isValid",
")",
";",
"return",
"(",
")",
"=>",
"setValidity",
"(",
"true",
")",
";",
"}",
",",
"[",
"isValid",
",",
"setValidity",
"]",
")",
";",
"}",
"function",
"safeMakeLabel",
"(",
"agg",
")",
"{",
"try",
"{",
"return",
"agg",
".",
"makeLabel",
"(",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"return",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.aggNotValidLabel'",
",",
"{",
"defaultMessage",
":",
"'- agg not valid -'",
",",
"}",
")",
";",
"}",
"}",
"function",
"isCompatibleAggregation",
"(",
"aggFilter",
")",
"{",
"return",
"(",
"agg",
")",
"=>",
"{",
"return",
"!",
"aggFilter",
".",
"includes",
"(",
"`!${",
"agg",
".",
"type",
".",
"name",
"}`",
")",
";",
"}",
";",
"}",
"export",
"{",
"CUSTOM_METRIC",
",",
"safeMakeLabel",
",",
"isCompatibleAggregation",
",",
"useAvailableOptions",
",",
"useFallbackMetric",
",",
"useValidation",
",",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8585,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
4,
null,
8585,
null,
5,
null,
null,
2,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
530,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
530,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8585,
null,
5,
null,
null,
null,
null,
13,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
530,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
4,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
941,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
5,
null,
null,
null,
null,
941,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661601 | [
"import",
"React",
",",
"{",
"ChangeEvent",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiFieldNumber",
",",
"EuiFlexGroup",
",",
"EuiFlexItem",
",",
"EuiFormRow",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"isUndefined",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"useValidation",
"}",
"from",
"'./utils'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"export",
"interface",
"Bounds",
"{",
"min",
":",
"number",
"|",
"''",
";",
"max",
":",
"number",
"|",
"''",
";",
"}",
"function",
"areBoundsValid",
"(",
"{",
"min",
",",
"max",
"}",
")",
"{",
"if",
"(",
"min",
"===",
"''",
"||",
"max",
"===",
"''",
")",
"{",
"return",
"false",
";",
"}",
"return",
"max",
">=",
"min",
";",
"}",
"function",
"ExtendedBoundsParamEditor",
"(",
"{",
"value",
"=",
"{",
"}",
"as",
"Bounds",
",",
"setValue",
",",
"setValidity",
",",
"showValidation",
",",
"setTouched",
",",
"}",
")",
"{",
"const",
"minLabel",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.extendedBounds.minLabel'",
",",
"{",
"defaultMessage",
":",
"'Min'",
",",
"}",
")",
";",
"const",
"maxLabel",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.extendedBounds.maxLabel'",
",",
"{",
"defaultMessage",
":",
"'Max'",
",",
"}",
")",
";",
"const",
"isValid",
"=",
"areBoundsValid",
"(",
"value",
")",
";",
"let",
"error",
";",
"if",
"(",
"!",
"isValid",
")",
"{",
"error",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.extendedBounds.errorMessage'",
",",
"{",
"defaultMessage",
":",
"'Min should be less than or equal to Max.'",
",",
"}",
")",
";",
"}",
"useValidation",
"(",
"setValidity",
",",
"isValid",
")",
";",
"const",
"handleChange",
"=",
"(",
"ev",
",",
"name",
")",
"=>",
"{",
"setValue",
"(",
"{",
"...",
"value",
",",
"[",
"name",
"]",
":",
"ev",
".",
"target",
".",
"value",
"===",
"''",
"?",
"''",
":",
"parseFloat",
"(",
"ev",
".",
"target",
".",
"value",
")",
",",
"}",
")",
";",
"}",
";",
"return",
"(",
"<",
"EuiFormRow",
"fullWidth",
"=",
"{",
"true",
"}",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"!",
"isValid",
":",
"false",
"}",
"error",
"=",
"{",
"error",
"}",
">",
"<",
"EuiFlexGroup",
"gutterSize",
"=",
"\"s\"",
"responsive",
"=",
"{",
"false",
"}",
">",
"<",
"EuiFlexItem",
">",
"<",
"EuiFieldNumber",
"value",
"=",
"{",
"isUndefined",
"(",
"value",
".",
"min",
")",
"?",
"''",
":",
"value",
".",
"min",
"}",
"onChange",
"=",
"{",
"(",
"ev",
")",
"=>",
"handleChange",
"(",
"ev",
",",
"'min'",
")",
"}",
"onBlur",
"=",
"{",
"setTouched",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"!",
"isValid",
":",
"false",
"}",
"aria",
"-",
"label",
"=",
"{",
"minLabel",
"}",
"prepend",
"=",
"{",
"minLabel",
"}",
"compressed",
"/",
">",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
">",
"<",
"EuiFieldNumber",
"value",
"=",
"{",
"isUndefined",
"(",
"value",
".",
"max",
")",
"?",
"''",
":",
"value",
".",
"max",
"}",
"onChange",
"=",
"{",
"(",
"ev",
")",
"=>",
"handleChange",
"(",
"ev",
",",
"'max'",
")",
"}",
"onBlur",
"=",
"{",
"setTouched",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"!",
"isValid",
":",
"false",
"}",
"aria",
"-",
"label",
"=",
"{",
"maxLabel",
"}",
"prepend",
"=",
"{",
"maxLabel",
"}",
"compressed",
"/",
">",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>",
"<",
"/EuiFormRow>);",
"}",
"export",
"{",
"ExtendedBoundsParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661602 | [
"import",
"{",
"get",
"}",
"from",
"'lodash'",
";",
"import",
"React",
",",
"{",
"useState",
",",
"useCallback",
"}",
"from",
"'react'",
";",
"import",
"{",
"useMount",
"}",
"from",
"'react-use'",
";",
"import",
"{",
"EuiComboBox",
",",
"EuiComboBoxOptionOption",
",",
"EuiFormRow",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"AggParam",
",",
"IAggConfig",
",",
"IFieldParamType",
",",
"IndexPatternField",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"formatListAsProse",
",",
"parseCommaSeparatedList",
",",
"useValidation",
"}",
"from",
"'./utils'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"import",
"{",
"ComboBoxGroupedOptions",
"}",
"from",
"'../../utils'",
";",
"const",
"label",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.field.fieldLabel'",
",",
"{",
"defaultMessage",
":",
"'Field'",
",",
"}",
")",
";",
"export",
"interface",
"FieldParamEditorProps",
"extends",
"AggParamEditorProps",
"<",
"IndexPatternField",
">",
"{",
"customError",
"?",
":",
"string",
";",
"customLabel",
"?",
":",
"string",
";",
"}",
"function",
"FieldParamEditor",
"(",
"{",
"agg",
",",
"aggParam",
",",
"customError",
",",
"customLabel",
",",
"indexedFields",
"=",
"[",
"]",
",",
"showValidation",
",",
"value",
",",
"setTouched",
",",
"setValidity",
",",
"setValue",
",",
"}",
")",
"{",
"const",
"[",
"isDirty",
",",
"setIsDirty",
"]",
"=",
"useState",
"(",
"false",
")",
";",
"const",
"selectedOptions",
"=",
"value",
"?",
"[",
"{",
"label",
":",
"value",
".",
"displayName",
"||",
"value",
".",
"name",
",",
"target",
":",
"value",
"}",
"]",
":",
"[",
"]",
";",
"const",
"onChange",
"=",
"(",
"options",
")",
"=>",
"{",
"const",
"selectedOption",
"=",
"get",
"(",
"options",
",",
"'0.target'",
")",
";",
"if",
"(",
"!",
"(",
"aggParam",
".",
"required",
"&&",
"!",
"selectedOption",
")",
")",
"{",
"setValue",
"(",
"selectedOption",
")",
";",
"}",
"if",
"(",
"aggParam",
".",
"onChange",
")",
"{",
"aggParam",
".",
"onChange",
"(",
"agg",
")",
";",
"}",
"}",
";",
"const",
"errors",
"=",
"customError",
"?",
"[",
"customError",
"]",
":",
"[",
"]",
";",
"if",
"(",
"!",
"indexedFields",
".",
"length",
")",
"{",
"errors",
".",
"push",
"(",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.field.noCompatibleFieldsDescription'",
",",
"{",
"defaultMessage",
":",
"'The index pattern {indexPatternTitle} does not contain any of the following compatible field types: {fieldTypes}'",
",",
"values",
":",
"{",
"indexPatternTitle",
":",
"agg",
".",
"getIndexPattern",
"&&",
"agg",
".",
"getIndexPattern",
"(",
")",
".",
"title",
",",
"fieldTypes",
":",
"getFieldTypesString",
"(",
"agg",
")",
",",
"}",
",",
"}",
")",
")",
";",
"}",
"const",
"isValid",
"=",
"!",
"!",
"value",
"&&",
"!",
"errors",
".",
"length",
"&&",
"!",
"isDirty",
";",
"const",
"showErrorMessage",
"=",
"(",
"showValidation",
"||",
"!",
"indexedFields",
".",
"length",
")",
"&&",
"!",
"isValid",
";",
"useValidation",
"(",
"setValidity",
",",
"isValid",
")",
";",
"useMount",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"indexedFields",
".",
"length",
"!==",
"1",
")",
"{",
"return",
";",
"}",
"const",
"indexedField",
"=",
"indexedFields",
"[",
"0",
"]",
";",
"if",
"(",
"!",
"(",
"'options'",
"in",
"indexedField",
")",
")",
"{",
"setValue",
"(",
"indexedField",
".",
"target",
")",
";",
"}",
"else",
"if",
"(",
"indexedField",
".",
"options",
".",
"length",
"===",
"1",
")",
"{",
"setValue",
"(",
"indexedField",
".",
"options",
"[",
"0",
"]",
".",
"target",
")",
";",
"}",
"}",
")",
";",
"const",
"onSearchChange",
"=",
"useCallback",
"(",
"(",
"searchValue",
")",
"=>",
"setIsDirty",
"(",
"Boolean",
"(",
"searchValue",
")",
")",
",",
"[",
"]",
")",
";",
"return",
"(",
"<",
"EuiFormRow",
"label",
"=",
"{",
"customLabel",
"||",
"label",
"}",
"isInvalid",
"=",
"{",
"showErrorMessage",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
"error",
"=",
"{",
"errors",
"}",
"compressed",
">",
"<",
"EuiComboBox",
"compressed",
"placeholder",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.field.selectFieldPlaceholder'",
",",
"{",
"defaultMessage",
":",
"'Select a field'",
",",
"}",
")",
"}",
"options",
"=",
"{",
"indexedFields",
"}",
"isDisabled",
"=",
"{",
"!",
"indexedFields",
".",
"length",
"}",
"selectedOptions",
"=",
"{",
"selectedOptions",
"}",
"singleSelection",
"=",
"{",
"{",
"asPlainText",
":",
"true",
"}",
"}",
"isClearable",
"=",
"{",
"false",
"}",
"isInvalid",
"=",
"{",
"showErrorMessage",
"}",
"onChange",
"=",
"{",
"onChange",
"}",
"onBlur",
"=",
"{",
"setTouched",
"}",
"onSearchChange",
"=",
"{",
"onSearchChange",
"}",
"sortMatchesBy",
"=",
"\"startsWith\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"visDefaultEditorField\"",
"fullWidth",
"=",
"{",
"true",
"}",
"/",
">",
"<",
"/EuiFormRow>);",
"}",
"function",
"getFieldTypesString",
"(",
"agg",
")",
"{",
"const",
"param",
"=",
"get",
"(",
"agg",
",",
"'type.params'",
",",
"[",
"]",
")",
".",
"find",
"(",
"(",
"p",
")",
"=>",
"p",
".",
"name",
"===",
"'field'",
")",
"||",
"(",
"{",
"}",
"as",
"IFieldParamType",
")",
";",
"return",
"formatListAsProse",
"(",
"parseCommaSeparatedList",
"(",
"param",
".",
"filterFieldTypes",
")",
",",
"{",
"inclusive",
":",
"false",
"}",
")",
";",
"}",
"export",
"{",
"FieldParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661603 | [
"import",
"React",
",",
"{",
"useEffect",
",",
"useRef",
"}",
"from",
"'react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"search",
"}",
"from",
"'../../../../data/public'",
";",
"import",
"{",
"SwitchParamEditor",
"}",
"from",
"'./switch'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"const",
"{",
"isType",
"}",
"=",
"search",
".",
"aggs",
";",
"function",
"HasExtendedBoundsParamEditor",
"(",
"props",
")",
"{",
"const",
"{",
"agg",
",",
"setValue",
",",
"value",
"}",
"=",
"props",
";",
"const",
"minDocCount",
"=",
"useRef",
"(",
"agg",
".",
"params",
".",
"min_doc_count",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"minDocCount",
".",
"current",
"!==",
"agg",
".",
"params",
".",
"min_doc_count",
")",
"{",
"minDocCount",
".",
"current",
"=",
"agg",
".",
"params",
".",
"min_doc_count",
";",
"setValue",
"(",
"value",
"&&",
"agg",
".",
"params",
".",
"min_doc_count",
")",
";",
"}",
"}",
",",
"[",
"agg",
".",
"params",
".",
"min_doc_count",
",",
"setValue",
",",
"value",
"]",
")",
";",
"return",
"(",
"<",
"SwitchParamEditor",
"{",
"...",
"props",
"}",
"displayLabel",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.extendedBoundsLabel'",
",",
"{",
"defaultMessage",
":",
"'Extend bounds'",
",",
"}",
")",
"}",
"displayToolTip",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.extendedBoundsTooltip'",
",",
"{",
"defaultMessage",
":",
"'Min and Max do not filter the results, but rather extend the bounds of the result set.'",
",",
"}",
")",
"}",
"disabled",
"=",
"{",
"!",
"props",
".",
"agg",
".",
"params",
".",
"min_doc_count",
"||",
"!",
"(",
"isType",
"(",
"'number'",
")",
"(",
"props",
".",
"agg",
")",
"||",
"isType",
"(",
"'date'",
")",
"(",
"props",
".",
"agg",
")",
")",
"}",
"/>);",
"}",
"export",
"{",
"HasExtendedBoundsParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1358,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661604 | [
"import",
"React",
",",
"{",
"useEffect",
",",
"useCallback",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiFieldText",
",",
"EuiFormRow",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"function",
"StringParamEditor",
"(",
"{",
"agg",
",",
"aggParam",
",",
"showValidation",
",",
"value",
",",
"setValidity",
",",
"setValue",
",",
"setTouched",
",",
"}",
")",
"{",
"const",
"isValid",
"=",
"aggParam",
".",
"required",
"?",
"!",
"!",
"value",
":",
"true",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"setValidity",
"(",
"isValid",
")",
";",
"}",
",",
"[",
"isValid",
",",
"setValidity",
"]",
")",
";",
"const",
"onChange",
"=",
"useCallback",
"(",
"(",
"ev",
")",
"=>",
"setValue",
"(",
"ev",
".",
"target",
".",
"value",
")",
",",
"[",
"setValue",
"]",
")",
";",
"return",
"(",
"<",
"EuiFormRow",
"className",
"=",
"\"visEditorAggParam__string\"",
"label",
"=",
"{",
"aggParam",
".",
"displayName",
"||",
"aggParam",
".",
"name",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
"compressed",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"!",
"isValid",
":",
"false",
"}",
">",
"<",
"EuiFieldText",
"value",
"=",
"{",
"value",
"||",
"''",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`visEditorStringInput${",
"agg",
".",
"id",
"}${",
"aggParam",
".",
"name",
"}`",
"}",
"onChange",
"=",
"{",
"onChange",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
"compressed",
"onBlur",
"=",
"{",
"setTouched",
"}",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"!",
"isValid",
":",
"false",
"}",
"/",
">",
"<",
"/EuiFormRow>);",
"}",
"export",
"{",
"StringParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661605 | [
"import",
"{",
"last",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"htmlIdGenerator",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"parseRange",
",",
"NumberListRange",
"}",
"from",
"'./range'",
";",
"import",
"{",
"NumberRowModel",
"}",
"from",
"'./number_row'",
";",
"const",
"EMPTY_STRING",
"=",
"''",
";",
"const",
"defaultRange",
"=",
"parseRange",
"(",
"'[0,Infinity)'",
")",
";",
"const",
"generateId",
"=",
"htmlIdGenerator",
"(",
")",
";",
"const",
"defaultModel",
"=",
"{",
"value",
":",
"0",
",",
"id",
":",
"generateId",
"(",
")",
",",
"isInvalid",
":",
"false",
"}",
";",
"function",
"parse",
"(",
"value",
")",
"{",
"const",
"parsedValue",
"=",
"parseFloat",
"(",
"value",
")",
";",
"return",
"isNaN",
"(",
"parsedValue",
")",
"?",
"EMPTY_STRING",
":",
"parsedValue",
";",
"}",
"function",
"getRange",
"(",
"range",
"?",
")",
"{",
"try",
"{",
"return",
"range",
"?",
"parseRange",
"(",
"range",
")",
":",
"defaultRange",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"'Unable to parse range: '",
"+",
"e",
".",
"message",
")",
";",
"}",
"}",
"function",
"validateValue",
"(",
"value",
",",
"numberRange",
")",
"{",
"const",
"result",
"=",
"{",
"isInvalid",
":",
"false",
",",
"}",
";",
"if",
"(",
"value",
"===",
"EMPTY_STRING",
")",
"{",
"result",
".",
"isInvalid",
"=",
"true",
";",
"result",
".",
"error",
"=",
"EMPTY_STRING",
";",
"}",
"else",
"if",
"(",
"!",
"numberRange",
".",
"within",
"(",
"value",
")",
")",
"{",
"result",
".",
"isInvalid",
"=",
"true",
";",
"result",
".",
"error",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.numberList.invalidRangeErrorMessage'",
",",
"{",
"defaultMessage",
":",
"'The value should be in the range of {min} to {max}.'",
",",
"values",
":",
"{",
"min",
":",
"numberRange",
".",
"min",
",",
"max",
":",
"numberRange",
".",
"max",
"}",
",",
"}",
")",
";",
"}",
"return",
"result",
";",
"}",
"function",
"validateValueAscending",
"(",
"inputValue",
",",
"index",
",",
"list",
")",
"{",
"const",
"result",
"=",
"{",
"isInvalidOrder",
":",
"false",
",",
"}",
";",
"const",
"previousModel",
"=",
"list",
"[",
"index",
"-",
"1",
"]",
";",
"if",
"(",
"previousModel",
"!==",
"undefined",
"&&",
"inputValue",
"!==",
"undefined",
"&&",
"inputValue",
"<=",
"previousModel",
")",
"{",
"result",
".",
"isInvalidOrder",
"=",
"true",
";",
"result",
".",
"error",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.numberList.invalidAscOrderErrorMessage'",
",",
"{",
"defaultMessage",
":",
"'Value is not in ascending order.'",
",",
"}",
")",
";",
"}",
"return",
"result",
";",
"}",
"function",
"validateValueUnique",
"(",
"inputValue",
",",
"index",
",",
"list",
")",
"{",
"const",
"result",
"=",
"{",
"isDuplicate",
":",
"false",
",",
"}",
";",
"if",
"(",
"inputValue",
"!==",
"EMPTY_STRING",
"&&",
"list",
".",
"indexOf",
"(",
"inputValue",
")",
"!==",
"index",
")",
"{",
"result",
".",
"isDuplicate",
"=",
"true",
";",
"result",
".",
"error",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.numberList.duplicateValueErrorMessage'",
",",
"{",
"defaultMessage",
":",
"'Duplicate value.'",
",",
"}",
")",
";",
"}",
"return",
"result",
";",
"}",
"function",
"getNextModel",
"(",
"list",
",",
"range",
")",
"{",
"const",
"lastValue",
"=",
"(",
"last",
"(",
"list",
")",
"as",
"NumberRowModel",
")",
".",
"value",
";",
"let",
"next",
"=",
"Number",
"(",
"lastValue",
")",
"?",
"Number",
"(",
"lastValue",
")",
"+",
"1",
":",
"1",
";",
"if",
"(",
"next",
">=",
"range",
".",
"max",
")",
"{",
"next",
"=",
"range",
".",
"max",
"-",
"1",
";",
"}",
"return",
"{",
"id",
":",
"generateId",
"(",
")",
",",
"value",
":",
"next",
",",
"isInvalid",
":",
"false",
",",
"}",
";",
"}",
"function",
"getInitModelList",
"(",
"list",
")",
"{",
"return",
"list",
".",
"length",
"?",
"list",
".",
"map",
"(",
"(",
"num",
")",
"=>",
"(",
"{",
"value",
":",
"(",
"num",
"===",
"undefined",
"?",
"EMPTY_STRING",
":",
"num",
")",
"as",
"NumberRowModel",
"[",
"'value'",
"]",
",",
"id",
":",
"generateId",
"(",
")",
",",
"isInvalid",
":",
"false",
",",
"}",
")",
")",
":",
"[",
"defaultModel",
"]",
";",
"}",
"function",
"getValidatedModels",
"(",
"numberList",
",",
"modelList",
",",
"numberRange",
",",
"validateAscendingOrder",
"=",
"false",
",",
"disallowDuplicates",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"numberList",
".",
"length",
")",
"{",
"return",
"[",
"defaultModel",
"]",
";",
"}",
"return",
"numberList",
".",
"map",
"(",
"(",
"number",
",",
"index",
")",
"=>",
"{",
"const",
"model",
"=",
"modelList",
"[",
"index",
"]",
"||",
"{",
"id",
":",
"generateId",
"(",
")",
"}",
";",
"const",
"newValue",
"=",
"number",
"===",
"undefined",
"?",
"EMPTY_STRING",
":",
"number",
";",
"const",
"valueResult",
"=",
"numberRange",
"?",
"validateValue",
"(",
"newValue",
",",
"numberRange",
")",
":",
"{",
"isInvalid",
":",
"false",
"}",
";",
"const",
"ascendingResult",
"=",
"validateAscendingOrder",
"?",
"validateValueAscending",
"(",
"newValue",
",",
"index",
",",
"numberList",
")",
":",
"{",
"isInvalidOrder",
":",
"false",
"}",
";",
"const",
"duplicationResult",
"=",
"disallowDuplicates",
"?",
"validateValueUnique",
"(",
"newValue",
",",
"index",
",",
"numberList",
")",
":",
"{",
"isDuplicate",
":",
"false",
"}",
";",
"const",
"allErrors",
"=",
"[",
"valueResult",
".",
"error",
",",
"ascendingResult",
".",
"error",
",",
"duplicationResult",
".",
"error",
"]",
".",
"filter",
"(",
"Boolean",
")",
".",
"join",
"(",
"' '",
")",
";",
"return",
"{",
"...",
"model",
",",
"value",
":",
"newValue",
",",
"isInvalid",
":",
"valueResult",
".",
"isInvalid",
"||",
"ascendingResult",
".",
"isInvalidOrder",
"||",
"duplicationResult",
".",
"isDuplicate",
",",
"error",
":",
"allErrors",
"===",
"EMPTY_STRING",
"?",
"undefined",
":",
"allErrors",
",",
"}",
";",
"}",
")",
";",
"}",
"function",
"hasInvalidValues",
"(",
"modelList",
")",
"{",
"return",
"!",
"!",
"modelList",
".",
"find",
"(",
"(",
"{",
"isInvalid",
"}",
")",
"=>",
"isInvalid",
")",
";",
"}",
"export",
"{",
"EMPTY_STRING",
",",
"parse",
",",
"getRange",
",",
"validateValue",
",",
"getNextModel",
",",
"getInitModelList",
",",
"getValidatedModels",
",",
"hasInvalidValues",
",",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
5102,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5102,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
5102,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
3,
null,
13,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
3,
null,
13,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
24386,
null,
5,
null,
5102,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
13,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
13,
null,
5,
null,
5102,
null,
8,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661606 | [
"import",
"React",
",",
"{",
"useEffect",
"}",
"from",
"'react'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"import",
"{",
"StringParamEditor",
"}",
"from",
"'./string'",
";",
"import",
"{",
"search",
"}",
"from",
"'../../../../data/public'",
";",
"import",
"{",
"SimpleNumberList",
"}",
"from",
"'./components/simple_number_list'",
";",
"const",
"{",
"isNumberType",
"}",
"=",
"search",
".",
"aggs",
";",
"export",
"function",
"IncludeExcludeParamEditor",
"(",
"props",
")",
"{",
"const",
"{",
"agg",
",",
"value",
",",
"setValue",
"}",
"=",
"props",
";",
"const",
"isAggOfNumberType",
"=",
"isNumberType",
"(",
"agg",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"isAggOfNumberType",
"&&",
"!",
"Array",
".",
"isArray",
"(",
"value",
")",
"&&",
"value",
"!==",
"undefined",
")",
"{",
"const",
"numberArray",
"=",
"value",
".",
"split",
"(",
"'|'",
")",
".",
"map",
"(",
"(",
"item",
")",
"=>",
"parseFloat",
"(",
"item",
")",
")",
".",
"filter",
"(",
"(",
"number",
")",
"=>",
"Number",
".",
"isFinite",
"(",
"number",
")",
")",
";",
"setValue",
"(",
"numberArray",
".",
"length",
"?",
"numberArray",
":",
"[",
"''",
"]",
")",
";",
"}",
"else",
"if",
"(",
"!",
"isAggOfNumberType",
"&&",
"Array",
".",
"isArray",
"(",
"value",
")",
"&&",
"value",
"!==",
"undefined",
")",
"{",
"setValue",
"(",
"value",
".",
"filter",
"(",
"(",
"item",
")",
"=>",
"item",
"!==",
"''",
")",
".",
"join",
"(",
"'|'",
")",
")",
";",
"}",
"}",
",",
"[",
"isAggOfNumberType",
",",
"setValue",
",",
"value",
"]",
")",
";",
"return",
"isAggOfNumberType",
"?",
"(",
"<",
"SimpleNumberList",
"{",
"...",
"props",
"}",
"value",
"=",
"{",
"value",
"as",
"Array",
"<",
"number",
"|",
"''",
">",
"}",
"/>) : (<StringParamEditor {...props} value={value as string}/",
">",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1358,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661607 | [
"import",
"React",
",",
"{",
"useState",
",",
"useEffect",
",",
"Fragment",
",",
"useCallback",
"}",
"from",
"'react'",
";",
"import",
"{",
"isEmpty",
",",
"isEqual",
",",
"mapValues",
",",
"omitBy",
",",
"pick",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"EuiButtonIcon",
",",
"EuiFlexGroup",
",",
"EuiFlexItem",
",",
"EuiSpacer",
",",
"htmlIdGenerator",
",",
"EuiButtonEmpty",
",",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"export",
"interface",
"InputListConfig",
"{",
"defaultValue",
":",
"InputItemModel",
";",
"validateClass",
":",
"new",
"(",
"value",
")",
"=>",
"{",
"toString",
"(",
")",
":",
"string",
";",
"}",
";",
"getModelValue",
"(",
"item",
"?",
")",
":",
"InputItemModel",
";",
"getRemoveBtnAriaLabel",
"(",
"model",
")",
":",
"string",
";",
"onChangeFn",
"(",
"model",
")",
":",
"InputObject",
";",
"hasInvalidValuesFn",
"(",
"model",
")",
":",
"boolean",
";",
"renderInputRow",
"(",
"model",
",",
"index",
",",
"onChangeFn",
")",
":",
"React",
".",
"ReactNode",
";",
"modelNames",
":",
"string",
"|",
"string",
"[",
"]",
";",
"}",
"interface",
"InputModelBase",
"{",
"id",
":",
"string",
";",
"}",
"export",
"type",
"InputObject",
"=",
"object",
";",
"export",
"interface",
"InputItem",
"{",
"model",
":",
"string",
";",
"value",
":",
"string",
";",
"isInvalid",
":",
"boolean",
";",
"}",
"interface",
"InputItemModel",
"{",
"[",
"model",
"]",
":",
"InputItem",
";",
"}",
"export",
"type",
"InputModel",
"=",
"InputModelBase",
"&",
"InputItemModel",
";",
"interface",
"InputListProps",
"{",
"config",
":",
"InputListConfig",
";",
"list",
":",
"InputObject",
"[",
"]",
";",
"onChange",
"(",
"list",
")",
":",
"void",
";",
"setValidity",
"(",
"isValid",
")",
":",
"void",
";",
"}",
"const",
"generateId",
"=",
"htmlIdGenerator",
"(",
")",
";",
"const",
"validateValue",
"=",
"(",
"inputValue",
",",
"InputObject",
")",
"=>",
"{",
"const",
"result",
"=",
"{",
"model",
":",
"inputValue",
"||",
"''",
",",
"isInvalid",
":",
"false",
",",
"}",
";",
"if",
"(",
"!",
"inputValue",
")",
"{",
"result",
".",
"isInvalid",
"=",
"false",
";",
"return",
"result",
";",
"}",
"try",
"{",
"result",
".",
"model",
"=",
"new",
"InputObject",
"(",
"inputValue",
")",
".",
"toString",
"(",
")",
";",
"result",
".",
"isInvalid",
"=",
"false",
";",
"return",
"result",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"result",
".",
"isInvalid",
"=",
"true",
";",
"return",
"result",
";",
"}",
"}",
";",
"function",
"InputList",
"(",
"{",
"config",
",",
"list",
",",
"onChange",
",",
"setValidity",
"}",
")",
"{",
"const",
"{",
"defaultValue",
",",
"getModelValue",
",",
"modelNames",
",",
"onChangeFn",
",",
"validateClass",
"}",
"=",
"config",
";",
"const",
"[",
"models",
",",
"setModels",
"]",
"=",
"useState",
"(",
"(",
")",
"=>",
"list",
".",
"map",
"(",
"(",
"item",
")",
"=>",
"(",
"{",
"id",
":",
"generateId",
"(",
")",
",",
"...",
"getModelValue",
"(",
"item",
")",
",",
"}",
"as",
"InputModel",
")",
")",
")",
";",
"const",
"hasInvalidValues",
"=",
"models",
".",
"some",
"(",
"config",
".",
"hasInvalidValuesFn",
")",
";",
"const",
"updateValues",
"=",
"useCallback",
"(",
"(",
"modelList",
")",
"=>",
"{",
"setModels",
"(",
"modelList",
")",
";",
"onChange",
"(",
"modelList",
".",
"map",
"(",
"onChangeFn",
")",
")",
";",
"}",
",",
"[",
"onChangeFn",
",",
"onChange",
"]",
")",
";",
"const",
"onChangeValue",
"=",
"useCallback",
"(",
"(",
"index",
",",
"value",
",",
"modelName",
")",
"=>",
"{",
"const",
"{",
"model",
",",
"isInvalid",
"}",
"=",
"validateValue",
"(",
"value",
",",
"validateClass",
")",
";",
"updateValues",
"(",
"models",
".",
"map",
"(",
"(",
"range",
",",
"arrayIndex",
")",
"=>",
"arrayIndex",
"===",
"index",
"?",
"{",
"...",
"range",
",",
"[",
"modelName",
"]",
":",
"{",
"value",
",",
"model",
",",
"isInvalid",
",",
"}",
",",
"}",
":",
"range",
")",
")",
";",
"}",
",",
"[",
"models",
",",
"updateValues",
",",
"validateClass",
"]",
")",
";",
"const",
"onDelete",
"=",
"useCallback",
"(",
"(",
"id",
")",
"=>",
"updateValues",
"(",
"models",
".",
"filter",
"(",
"(",
"model",
")",
"=>",
"model",
".",
"id",
"!==",
"id",
")",
")",
",",
"[",
"models",
",",
"updateValues",
"]",
")",
";",
"const",
"onAdd",
"=",
"useCallback",
"(",
"(",
")",
"=>",
"updateValues",
"(",
"[",
"...",
"models",
",",
"{",
"id",
":",
"generateId",
"(",
")",
",",
"...",
"getModelValue",
"(",
")",
",",
"}",
"as",
"InputModel",
",",
"]",
")",
",",
"[",
"getModelValue",
",",
"models",
",",
"updateValues",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"list",
".",
"length",
")",
"{",
"updateValues",
"(",
"[",
"{",
"id",
":",
"generateId",
"(",
")",
",",
"...",
"defaultValue",
",",
"}",
"as",
"InputModel",
",",
"]",
")",
";",
"}",
"}",
",",
"[",
"defaultValue",
",",
"list",
".",
"length",
",",
"updateValues",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"setValidity",
"(",
"!",
"hasInvalidValues",
")",
";",
"}",
",",
"[",
"hasInvalidValues",
",",
"setValidity",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"list",
".",
"length",
"!==",
"models",
".",
"length",
"||",
"list",
".",
"some",
"(",
"(",
"item",
",",
"index",
")",
"=>",
"{",
"const",
"model",
"=",
"mapValues",
"(",
"pick",
"(",
"models",
"[",
"index",
"]",
",",
"modelNames",
")",
",",
"'model'",
")",
";",
"return",
"!",
"isEqual",
"(",
"item",
",",
"omitBy",
"(",
"model",
",",
"isEmpty",
")",
")",
";",
"}",
")",
")",
"{",
"setModels",
"(",
"list",
".",
"map",
"(",
"(",
"item",
")",
"=>",
"(",
"{",
"id",
":",
"generateId",
"(",
")",
",",
"...",
"getModelValue",
"(",
"item",
")",
",",
"}",
"as",
"InputModel",
")",
")",
")",
";",
"}",
"}",
",",
"[",
"getModelValue",
",",
"list",
",",
"modelNames",
",",
"models",
"]",
")",
";",
"return",
"(",
"<",
">",
"{",
"models",
".",
"map",
"(",
"(",
"item",
",",
"index",
")",
"=>",
"(",
"<",
"Fragment",
"key",
"=",
"{",
"item",
".",
"id",
"}",
">",
"<",
"EuiFlexGroup",
"gutterSize",
"=",
"\"xs\"",
"alignItems",
"=",
"\"center\"",
"responsive",
"=",
"{",
"false",
"}",
">",
"{",
"config",
".",
"renderInputRow",
"(",
"item",
",",
"index",
",",
"onChangeValue",
")",
"}",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiButtonIcon",
"aria",
"-",
"label",
"=",
"{",
"config",
".",
"getRemoveBtnAriaLabel",
"(",
"item",
")",
"}",
"title",
"=",
"{",
"config",
".",
"getRemoveBtnAriaLabel",
"(",
"item",
")",
"}",
"disabled",
"=",
"{",
"models",
".",
"length",
"===",
"1",
"}",
"color",
"=",
"\"danger\"",
"iconType",
"=",
"\"trash\"",
"onClick",
"=",
"{",
"(",
")",
"=>",
"onDelete",
"(",
"item",
".",
"id",
")",
"}",
"/",
">",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>",
"<",
"EuiSpacer",
"size",
"=",
"\"xs\"",
"/",
">",
"<",
"/Fragment>))}",
"<",
"EuiSpacer",
"size",
"=",
"\"s\"",
"/",
">",
"<",
"EuiFlexItem",
">",
"<",
"EuiButtonEmpty",
"iconType",
"=",
"\"plusInCircleFilled\"",
"onClick",
"=",
"{",
"onAdd",
"}",
"size",
"=",
"\"xs\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.controls.ipRanges.addRangeButtonLabel\"",
"defaultMessage",
"=",
"\"Add range\"",
"/",
">",
"<",
"/EuiButtonEmpty>",
"<",
"/EuiFlexItem>",
"<",
"/>);",
"}",
"export",
"{",
"InputList",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8968,
null,
null,
null,
null,
null,
null,
null,
6203,
null,
null,
null,
null,
null,
null,
6203,
null,
null,
null,
null,
null,
null,
6203,
null,
null,
null,
null,
null,
null,
6203,
null,
3,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
2,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661608 | [
"import",
"React",
",",
"{",
"useCallback",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiFieldText",
",",
"EuiFlexItem",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"InputList",
",",
"InputListConfig",
",",
"InputObject",
",",
"InputModel",
",",
"InputItem",
"}",
"from",
"'./input_list'",
";",
"import",
"{",
"search",
"}",
"from",
"'../../../../../data/public'",
";",
"const",
"EMPTY_STRING",
"=",
"''",
";",
"export",
"interface",
"MaskObject",
"extends",
"InputObject",
"{",
"mask",
"?",
":",
"string",
";",
"}",
"type",
"MaskModel",
"=",
"InputModel",
"&",
"{",
"mask",
":",
"InputItem",
";",
"}",
";",
"interface",
"MaskListProps",
"{",
"list",
":",
"MaskObject",
"[",
"]",
";",
"showValidation",
":",
"boolean",
";",
"onBlur",
"(",
")",
":",
"void",
";",
"onChange",
"(",
"list",
")",
":",
"void",
";",
"setValidity",
"(",
"isValid",
")",
":",
"void",
";",
"}",
"const",
"defaultConfig",
"=",
"{",
"defaultValue",
":",
"{",
"mask",
":",
"{",
"model",
":",
"'0.0.0.0/1'",
",",
"value",
":",
"'0.0.0.0/1'",
",",
"isInvalid",
":",
"false",
"}",
",",
"}",
",",
"validateClass",
":",
"search",
".",
"aggs",
".",
"CidrMask",
",",
"getModelValue",
":",
"(",
"item",
"=",
"{",
"}",
")",
"=>",
"(",
"{",
"mask",
":",
"{",
"model",
":",
"item",
".",
"mask",
"||",
"EMPTY_STRING",
",",
"value",
":",
"item",
".",
"mask",
"||",
"EMPTY_STRING",
",",
"isInvalid",
":",
"false",
",",
"}",
",",
"}",
")",
",",
"getRemoveBtnAriaLabel",
":",
"(",
"item",
")",
"=>",
"item",
".",
"mask",
".",
"value",
"?",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.ipRanges.removeCidrMaskButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Remove the CIDR mask value of {mask}'",
",",
"values",
":",
"{",
"mask",
":",
"item",
".",
"mask",
".",
"value",
"}",
",",
"}",
")",
":",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.ipRanges.removeEmptyCidrMaskButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Remove the CIDR mask default value'",
",",
"}",
")",
",",
"onChangeFn",
":",
"(",
"{",
"mask",
"}",
")",
"=>",
"{",
"if",
"(",
"mask",
".",
"model",
")",
"{",
"return",
"{",
"mask",
":",
"mask",
".",
"model",
"}",
";",
"}",
"return",
"{",
"}",
";",
"}",
",",
"hasInvalidValuesFn",
":",
"(",
"{",
"mask",
"}",
")",
"=>",
"mask",
".",
"isInvalid",
",",
"modelNames",
":",
"'mask'",
",",
"}",
";",
"function",
"MaskList",
"(",
"{",
"showValidation",
",",
"onBlur",
",",
"...",
"rest",
"}",
")",
"{",
"const",
"renderInputRow",
"=",
"useCallback",
"(",
"(",
"{",
"mask",
"}",
",",
"index",
",",
"onChangeValue",
")",
"=>",
"(",
"<",
"EuiFlexItem",
">",
"<",
"EuiFieldText",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.ipRanges.cidrMaskAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'CIDR mask: {mask}'",
",",
"values",
":",
"{",
"mask",
":",
"mask",
".",
"value",
"||",
"'*'",
"}",
",",
"}",
")",
"}",
"compressed",
"fullWidth",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"mask",
".",
"isInvalid",
":",
"false",
"}",
"placeholder",
"=",
"\"*\"",
"onChange",
"=",
"{",
"(",
"ev",
")",
"=>",
"{",
"onChangeValue",
"(",
"index",
",",
"ev",
".",
"target",
".",
"value",
",",
"'mask'",
")",
";",
"}",
"}",
"value",
"=",
"{",
"mask",
".",
"value",
"}",
"onBlur",
"=",
"{",
"onBlur",
"}",
"/",
">",
"<",
"/EuiFlexItem>), [onBlur, showValidation]);",
"const",
"maskListConfig",
"=",
"{",
"...",
"defaultConfig",
",",
"renderInputRow",
",",
"}",
";",
"return",
"<",
"InputList",
"config",
"=",
"{",
"maskListConfig",
"}",
"{",
"...",
"rest",
"}",
"/>;",
"}",
"export",
"{",
"MaskList",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26171,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6655,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661609 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiButtonGroup",
",",
"EuiSpacer",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"enum",
"IpRangeTypes",
"{",
"MASK",
"=",
"'mask'",
",",
"FROM_TO",
"=",
"'fromTo'",
"}",
"function",
"IpRangeTypeParamEditor",
"(",
"{",
"agg",
",",
"value",
",",
"setValue",
"}",
")",
"{",
"const",
"options",
"=",
"[",
"{",
"id",
":",
"`visEditorIpRangeFromToLabel${",
"agg",
".",
"id",
"}`",
",",
"label",
":",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.ipRanges.fromToButtonLabel'",
",",
"{",
"defaultMessage",
":",
"'From/to'",
",",
"}",
")",
",",
"}",
",",
"{",
"id",
":",
"`visEditorIpRangeCidrLabel${",
"agg",
".",
"id",
"}`",
",",
"label",
":",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.ipRanges.cidrMasksButtonLabel'",
",",
"{",
"defaultMessage",
":",
"'CIDR masks'",
",",
"}",
")",
",",
"}",
",",
"]",
";",
"const",
"onClick",
"=",
"(",
"optionId",
")",
"=>",
"{",
"setValue",
"(",
"optionId",
"===",
"options",
"[",
"0",
"]",
".",
"id",
"?",
"IpRangeTypes",
".",
"FROM_TO",
":",
"IpRangeTypes",
".",
"MASK",
")",
";",
"}",
";",
"return",
"(",
"<",
">",
"<",
"EuiSpacer",
"size",
"=",
"\"m\"",
"/",
">",
"<",
"EuiButtonGroup",
"isFullWidth",
"=",
"{",
"true",
"}",
"onChange",
"=",
"{",
"onClick",
"}",
"idSelected",
"=",
"{",
"value",
"===",
"IpRangeTypes",
".",
"FROM_TO",
"?",
"options",
"[",
"0",
"]",
".",
"id",
":",
"options",
"[",
"1",
"]",
".",
"id",
"}",
"options",
"=",
"{",
"options",
"}",
"legend",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.ipRangesAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'IP ranges'",
",",
"}",
")",
"}",
"/",
">",
"<",
"EuiSpacer",
"size",
"=",
"\"s\"",
"/",
">",
"<",
"/>);",
"}",
"export",
"{",
"IpRangeTypeParamEditor",
",",
"IpRangeTypes",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661610 | [
"import",
"React",
",",
"{",
"useCallback",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiFormRow",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"FromToList",
",",
"FromToObject",
"}",
"from",
"'./components/from_to_list'",
";",
"import",
"{",
"MaskList",
",",
"MaskObject",
"}",
"from",
"'./components/mask_list'",
";",
"import",
"{",
"IpRangeTypes",
"}",
"from",
"'./ip_range_type'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"interface",
"IpRange",
"{",
"fromTo",
":",
"FromToObject",
"[",
"]",
";",
"mask",
":",
"MaskObject",
"[",
"]",
";",
"}",
"function",
"IpRangesParamEditor",
"(",
"{",
"agg",
",",
"value",
"=",
"{",
"fromTo",
":",
"[",
"]",
"as",
"FromToObject",
"[",
"]",
",",
"mask",
":",
"[",
"]",
"as",
"MaskObject",
"[",
"]",
"}",
",",
"setTouched",
",",
"setValue",
",",
"setValidity",
",",
"showValidation",
",",
"}",
")",
"{",
"const",
"handleMaskListChange",
"=",
"useCallback",
"(",
"(",
"items",
")",
"=>",
"setValue",
"(",
"{",
"...",
"value",
",",
"[",
"IpRangeTypes",
".",
"MASK",
"]",
":",
"items",
",",
"}",
")",
",",
"[",
"setValue",
",",
"value",
"]",
")",
";",
"const",
"handleFromToListChange",
"=",
"useCallback",
"(",
"(",
"items",
")",
"=>",
"setValue",
"(",
"{",
"...",
"value",
",",
"[",
"IpRangeTypes",
".",
"FROM_TO",
"]",
":",
"items",
",",
"}",
")",
",",
"[",
"setValue",
",",
"value",
"]",
")",
";",
"return",
"(",
"<",
"EuiFormRow",
"fullWidth",
"=",
"{",
"true",
"}",
"id",
"=",
"{",
"`visEditorIpRange${",
"agg",
".",
"id",
"}`",
"}",
"compressed",
">",
"{",
"agg",
".",
"params",
".",
"ipRangeType",
"===",
"IpRangeTypes",
".",
"MASK",
"?",
"(",
"<",
"MaskList",
"list",
"=",
"{",
"value",
".",
"mask",
"}",
"showValidation",
"=",
"{",
"showValidation",
"}",
"onBlur",
"=",
"{",
"setTouched",
"}",
"onChange",
"=",
"{",
"handleMaskListChange",
"}",
"setValidity",
"=",
"{",
"setValidity",
"}",
"/",
">",
")",
":",
"(",
"<",
"FromToList",
"list",
"=",
"{",
"value",
".",
"fromTo",
"}",
"showValidation",
"=",
"{",
"showValidation",
"}",
"onBlur",
"=",
"{",
"setTouched",
"}",
"onChange",
"=",
"{",
"handleFromToListChange",
"}",
"setValidity",
"=",
"{",
"setValidity",
"}",
"/",
">",
")",
"}",
"<",
"/EuiFormRow>);",
"}",
"export",
"{",
"IpRangesParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661611 | [
"import",
"React",
",",
"{",
"useMemo",
",",
"useCallback",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiFormRow",
",",
"EuiSelect",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"useAvailableOptions",
",",
"useFallbackMetric",
",",
"useValidation",
"}",
"from",
"'./utils'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"const",
"aggFilter",
"=",
"[",
"'!top_hits'",
",",
"'!percentiles'",
",",
"'!percentile_ranks'",
",",
"'!median'",
",",
"'!std_dev'",
"]",
";",
"const",
"EMPTY_VALUE",
"=",
"'EMPTY_VALUE'",
";",
"const",
"DEFAULT_OPTIONS",
"=",
"[",
"{",
"text",
":",
"''",
",",
"value",
":",
"EMPTY_VALUE",
",",
"hidden",
":",
"true",
"}",
"]",
";",
"function",
"MetricAggParamEditor",
"(",
"{",
"agg",
",",
"value",
",",
"showValidation",
",",
"setValue",
",",
"setValidity",
",",
"setTouched",
",",
"metricAggs",
"=",
"[",
"]",
",",
"}",
")",
"{",
"const",
"label",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.metricLabel'",
",",
"{",
"defaultMessage",
":",
"'Metric'",
",",
"}",
")",
";",
"const",
"isValid",
"=",
"!",
"!",
"value",
";",
"useValidation",
"(",
"setValidity",
",",
"isValid",
")",
";",
"useFallbackMetric",
"(",
"setValue",
",",
"aggFilter",
",",
"metricAggs",
",",
"value",
")",
";",
"const",
"filteredMetrics",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"metricAggs",
".",
"filter",
"(",
"(",
"respAgg",
")",
"=>",
"respAgg",
".",
"type",
".",
"name",
"!==",
"agg",
".",
"type",
".",
"name",
")",
",",
"[",
"metricAggs",
",",
"agg",
".",
"type",
".",
"name",
"]",
")",
";",
"const",
"options",
"=",
"useAvailableOptions",
"(",
"aggFilter",
",",
"filteredMetrics",
",",
"DEFAULT_OPTIONS",
")",
";",
"const",
"onChange",
"=",
"useCallback",
"(",
"(",
"ev",
")",
"=>",
"setValue",
"(",
"ev",
".",
"target",
".",
"value",
")",
",",
"[",
"setValue",
"]",
")",
";",
"return",
"(",
"<",
"EuiFormRow",
"label",
"=",
"{",
"label",
"}",
"fullWidth",
"isInvalid",
"=",
"{",
"showValidation",
"&&",
"!",
"isValid",
"}",
"compressed",
">",
"<",
"EuiSelect",
"compressed",
"fullWidth",
"options",
"=",
"{",
"options",
"}",
"value",
"=",
"{",
"value",
"||",
"EMPTY_VALUE",
"}",
"onChange",
"=",
"{",
"onChange",
"}",
"isInvalid",
"=",
"{",
"showValidation",
"&&",
"!",
"isValid",
"}",
"onBlur",
"=",
"{",
"setTouched",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`visEditorSubAggMetric${",
"agg",
".",
"id",
"}`",
"}",
"/>",
"<",
"/EuiFormRow>);",
"}",
"export",
"{",
"DEFAULT_OPTIONS",
",",
"aggFilter",
",",
"MetricAggParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661612 | [
"import",
"React",
",",
"{",
"useEffect",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiSpacer",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"AggParamType",
",",
"IAggConfig",
",",
"AggGroupNames",
"}",
"from",
"'../../../../data/public'",
";",
"import",
"{",
"useSubAggParamsHandlers",
"}",
"from",
"'./utils'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"import",
"{",
"DefaultEditorAggParams",
"}",
"from",
"'../agg_params'",
";",
"function",
"OrderAggParamEditor",
"(",
"{",
"agg",
",",
"aggParam",
",",
"formIsTouched",
",",
"value",
",",
"metricAggs",
",",
"state",
",",
"setValue",
",",
"setValidity",
",",
"setTouched",
",",
"schemas",
",",
"}",
")",
"{",
"const",
"orderBy",
"=",
"agg",
".",
"params",
".",
"orderBy",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"orderBy",
"===",
"'custom'",
"&&",
"!",
"value",
")",
"{",
"setValue",
"(",
"aggParam",
".",
"makeAgg",
"(",
"agg",
")",
")",
";",
"}",
"if",
"(",
"orderBy",
"!==",
"'custom'",
"&&",
"value",
")",
"{",
"setValue",
"(",
"undefined",
")",
";",
"}",
"}",
",",
"[",
"agg",
",",
"aggParam",
",",
"orderBy",
",",
"setValue",
",",
"value",
"]",
")",
";",
"const",
"{",
"onAggTypeChange",
",",
"setAggParamValue",
"}",
"=",
"useSubAggParamsHandlers",
"(",
"agg",
",",
"aggParam",
",",
"value",
"as",
"IAggConfig",
",",
"setValue",
")",
";",
"if",
"(",
"!",
"agg",
".",
"params",
".",
"orderAgg",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"<",
">",
"<",
"EuiSpacer",
"size",
"=",
"\"m\"",
"/",
">",
"<",
"DefaultEditorAggParams",
"agg",
"=",
"{",
"value",
"as",
"IAggConfig",
"}",
"allowedAggs",
"=",
"{",
"aggParam",
".",
"allowedAggs",
"}",
"hideCustomLabel",
"=",
"{",
"true",
"}",
"groupName",
"=",
"{",
"AggGroupNames",
".",
"Metrics",
"}",
"className",
"=",
"\"visEditorAgg__subAgg\"",
"formIsTouched",
"=",
"{",
"formIsTouched",
"}",
"indexPattern",
"=",
"{",
"agg",
".",
"getIndexPattern",
"(",
")",
"}",
"metricAggs",
"=",
"{",
"metricAggs",
"}",
"state",
"=",
"{",
"state",
"}",
"setAggParamValue",
"=",
"{",
"setAggParamValue",
"}",
"onAggTypeChange",
"=",
"{",
"onAggTypeChange",
"}",
"setValidity",
"=",
"{",
"setValidity",
"}",
"setTouched",
"=",
"{",
"setTouched",
"}",
"schemas",
"=",
"{",
"schemas",
"}",
"/",
">",
"<",
"/>);",
"}",
"export",
"{",
"OrderAggParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661613 | [
"import",
"React",
",",
"{",
"Fragment",
",",
"useState",
",",
"useEffect",
",",
"useMemo",
",",
"useCallback",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiSpacer",
",",
"EuiButtonEmpty",
",",
"EuiFlexItem",
",",
"EuiFormErrorText",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"NumberRow",
",",
"NumberRowModel",
"}",
"from",
"'./number_row'",
";",
"import",
"{",
"parse",
",",
"EMPTY_STRING",
",",
"getRange",
",",
"getNextModel",
",",
"getInitModelList",
",",
"getValidatedModels",
",",
"hasInvalidValues",
",",
"}",
"from",
"'./utils'",
";",
"import",
"{",
"useValidation",
"}",
"from",
"'../../utils'",
";",
"export",
"interface",
"NumberListProps",
"{",
"labelledbyId",
":",
"string",
";",
"numberArray",
":",
"Array",
"<",
"number",
"|",
"undefined",
">",
";",
"range",
"?",
":",
"string",
";",
"showValidation",
":",
"boolean",
";",
"disallowDuplicates",
"?",
":",
"boolean",
";",
"unitName",
":",
"string",
";",
"validateAscendingOrder",
"?",
":",
"boolean",
";",
"onChange",
"(",
"list",
")",
":",
"void",
";",
"setTouched",
"(",
")",
":",
"void",
";",
"setValidity",
"(",
"isValid",
")",
":",
"void",
";",
"}",
"function",
"NumberList",
"(",
"{",
"labelledbyId",
",",
"numberArray",
",",
"range",
",",
"showValidation",
",",
"unitName",
",",
"validateAscendingOrder",
"=",
"false",
",",
"disallowDuplicates",
"=",
"false",
",",
"onChange",
",",
"setTouched",
",",
"setValidity",
",",
"}",
")",
"{",
"const",
"numberRange",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"getRange",
"(",
"range",
")",
",",
"[",
"range",
"]",
")",
";",
"const",
"[",
"models",
",",
"setModels",
"]",
"=",
"useState",
"(",
"getInitModelList",
"(",
"numberArray",
")",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"setModels",
"(",
"(",
"state",
")",
"=>",
"getValidatedModels",
"(",
"numberArray",
",",
"state",
",",
"numberRange",
",",
"validateAscendingOrder",
",",
"disallowDuplicates",
")",
")",
";",
"}",
",",
"[",
"numberArray",
",",
"numberRange",
",",
"validateAscendingOrder",
",",
"disallowDuplicates",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"numberArray",
".",
"length",
")",
"{",
"onChange",
"(",
"[",
"models",
"[",
"0",
"]",
".",
"value",
"as",
"number",
"]",
")",
";",
"}",
"}",
",",
"[",
"models",
",",
"numberArray",
".",
"length",
",",
"onChange",
"]",
")",
";",
"const",
"isValid",
"=",
"!",
"hasInvalidValues",
"(",
"models",
")",
";",
"useValidation",
"(",
"setValidity",
",",
"isValid",
")",
";",
"const",
"onUpdate",
"=",
"useCallback",
"(",
"(",
"modelList",
")",
"=>",
"{",
"setModels",
"(",
"modelList",
")",
";",
"onChange",
"(",
"modelList",
".",
"map",
"(",
"(",
"{",
"value",
"}",
")",
"=>",
"(",
"value",
"===",
"EMPTY_STRING",
"?",
"undefined",
":",
"value",
")",
")",
")",
";",
"}",
",",
"[",
"onChange",
"]",
")",
";",
"const",
"onChangeValue",
"=",
"useCallback",
"(",
"(",
"{",
"id",
",",
"value",
"}",
")",
"=>",
"{",
"const",
"parsedValue",
"=",
"parse",
"(",
"value",
")",
";",
"onUpdate",
"(",
"models",
".",
"map",
"(",
"(",
"model",
")",
"=>",
"{",
"if",
"(",
"model",
".",
"id",
"===",
"id",
")",
"{",
"return",
"{",
"id",
",",
"value",
":",
"parsedValue",
",",
"isInvalid",
":",
"false",
",",
"}",
";",
"}",
"return",
"model",
";",
"}",
")",
")",
";",
"}",
",",
"[",
"models",
",",
"onUpdate",
"]",
")",
";",
"const",
"onAdd",
"=",
"useCallback",
"(",
"(",
")",
"=>",
"{",
"const",
"newArray",
"=",
"[",
"...",
"models",
",",
"getNextModel",
"(",
"models",
",",
"numberRange",
")",
"]",
";",
"onUpdate",
"(",
"newArray",
")",
";",
"}",
",",
"[",
"models",
",",
"numberRange",
",",
"onUpdate",
"]",
")",
";",
"const",
"onDelete",
"=",
"useCallback",
"(",
"(",
"id",
")",
"=>",
"{",
"const",
"newArray",
"=",
"models",
".",
"filter",
"(",
"(",
"model",
")",
"=>",
"model",
".",
"id",
"!==",
"id",
")",
";",
"onUpdate",
"(",
"newArray",
")",
";",
"}",
",",
"[",
"models",
",",
"onUpdate",
"]",
")",
";",
"return",
"(",
"<",
">",
"{",
"models",
".",
"map",
"(",
"(",
"model",
",",
"arrayIndex",
")",
"=>",
"(",
"<",
"Fragment",
"key",
"=",
"{",
"model",
".",
"id",
"}",
">",
"<",
"NumberRow",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"model",
".",
"isInvalid",
":",
"false",
"}",
"disableDelete",
"=",
"{",
"models",
".",
"length",
"===",
"1",
"}",
"model",
"=",
"{",
"model",
"}",
"labelledbyId",
"=",
"{",
"labelledbyId",
"}",
"range",
"=",
"{",
"numberRange",
"}",
"onDelete",
"=",
"{",
"onDelete",
"}",
"onChange",
"=",
"{",
"onChangeValue",
"}",
"onBlur",
"=",
"{",
"setTouched",
"}",
"autoFocus",
"=",
"{",
"models",
".",
"length",
"!==",
"1",
"&&",
"arrayIndex",
"===",
"models",
".",
"length",
"-",
"1",
"}",
"/",
">",
"{",
"showValidation",
"&&",
"model",
".",
"isInvalid",
"&&",
"model",
".",
"error",
"&&",
"(",
"<",
"EuiFormErrorText",
">",
"{",
"model",
".",
"error",
"}",
"<",
"/EuiFormErrorText>)}",
"{",
"models",
".",
"length",
"-",
"1",
"!==",
"arrayIndex",
"&&",
"<",
"EuiSpacer",
"size",
"=",
"\"s\"",
"/>}",
"<",
"/Fragment>))}",
"<",
"EuiSpacer",
"size",
"=",
"\"s\"",
"/",
">",
"<",
"EuiFlexItem",
">",
"<",
"EuiButtonEmpty",
"iconType",
"=",
"\"plusInCircleFilled\"",
"onClick",
"=",
"{",
"onAdd",
"}",
"size",
"=",
"\"xs\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.controls.numberList.addUnitButtonLabel\"",
"defaultMessage",
"=",
"\"Add {unitName}\"",
"values",
"=",
"{",
"{",
"unitName",
"}",
"}",
"/",
">",
"<",
"/EuiButtonEmpty>",
"<",
"/EuiFlexItem>",
"<",
"/>);",
"}",
"export",
"{",
"NumberList",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661614 | [
"import",
"React",
",",
"{",
"useState",
",",
"useCallback",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiFormRow",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"NumberList",
"}",
"from",
"'./components/number_list'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"function",
"PercentilesEditor",
"(",
"{",
"agg",
",",
"showValidation",
",",
"value",
"=",
"[",
"]",
",",
"setTouched",
",",
"setValidity",
",",
"setValue",
",",
"}",
")",
"{",
"const",
"label",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.percentiles.percentsLabel'",
",",
"{",
"defaultMessage",
":",
"'Percents'",
",",
"}",
")",
";",
"const",
"[",
"isValid",
",",
"setIsValid",
"]",
"=",
"useState",
"(",
"true",
")",
";",
"const",
"setModelValidity",
"=",
"useCallback",
"(",
"(",
"isListValid",
")",
"=>",
"{",
"setIsValid",
"(",
"isListValid",
")",
";",
"setValidity",
"(",
"isListValid",
")",
";",
"}",
",",
"[",
"setValidity",
"]",
")",
";",
"return",
"(",
"<",
"EuiFormRow",
"label",
"=",
"{",
"label",
"}",
"labelType",
"=",
"\"legend\"",
"fullWidth",
"=",
"{",
"true",
"}",
"id",
"=",
"{",
"`visEditorPercentileLabel${",
"agg",
".",
"id",
"}`",
"}",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"!",
"isValid",
":",
"false",
"}",
"compressed",
">",
"<",
"NumberList",
"labelledbyId",
"=",
"{",
"`visEditorPercentileLabel${",
"agg",
".",
"id",
"}-legend`",
"}",
"numberArray",
"=",
"{",
"value",
"}",
"range",
"=",
"\"[0,100]\"",
"disallowDuplicates",
"=",
"{",
"true",
"}",
"unitName",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.percentileRanks.percentUnitNameText'",
",",
"{",
"defaultMessage",
":",
"'percent'",
",",
"}",
")",
"}",
"showValidation",
"=",
"{",
"showValidation",
"}",
"onChange",
"=",
"{",
"setValue",
"}",
"setTouched",
"=",
"{",
"setTouched",
"}",
"setValidity",
"=",
"{",
"setModelValidity",
"}",
"/",
">",
"<",
"/EuiFormRow>);",
"}",
"export",
"{",
"PercentilesEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661615 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiRange",
",",
"EuiFormRow",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"IUiSettingsClient",
"}",
"from",
"'../../../../../core/public'",
";",
"import",
"{",
"useOpenSearchDashboards",
"}",
"from",
"'../../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"function",
"PrecisionParamEditor",
"(",
"{",
"agg",
",",
"value",
",",
"setValue",
"}",
")",
"{",
"const",
"{",
"services",
"}",
"=",
"useOpenSearchDashboards",
"<",
"{",
"uiSettings",
":",
"IUiSettingsClient",
";",
"}",
">",
"(",
")",
";",
"const",
"label",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.precisionLabel'",
",",
"{",
"defaultMessage",
":",
"'Precision'",
",",
"}",
")",
";",
"if",
"(",
"agg",
".",
"params",
".",
"autoPrecision",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"<",
"EuiFormRow",
"label",
"=",
"{",
"label",
"}",
"compressed",
">",
"<",
"EuiRange",
"min",
"=",
"{",
"1",
"}",
"max",
"=",
"{",
"services",
".",
"uiSettings",
".",
"get",
"(",
"'visualization:tileMap:maxPrecision'",
")",
"}",
"value",
"=",
"{",
"value",
"||",
"''",
"}",
"onChange",
"=",
"{",
"(",
"ev",
")",
"=>",
"setValue",
"(",
"Number",
"(",
"ev",
".",
"currentTarget",
".",
"value",
")",
")",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`visEditorMapPrecision${",
"agg",
".",
"id",
"}`",
"}",
"showValue",
"compressed",
"/",
">",
"<",
"/EuiFormRow>);",
"}",
"export",
"{",
"PrecisionParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661616 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"import",
"{",
"RangesParamEditor",
"}",
"from",
"'./ranges'",
";",
"export",
"const",
"RangesControl",
"=",
"(",
"props",
")",
"=>",
"(",
"<",
"RangesParamEditor",
"value",
"=",
"{",
"props",
".",
"value",
"}",
"setValue",
"=",
"{",
"props",
".",
"setValue",
"}",
"/",
">",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1358,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661617 | [
"import",
"'brace/mode/json'",
";",
"import",
"React",
",",
"{",
"useState",
",",
"useMemo",
",",
"useCallback",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiFormRow",
",",
"EuiIconTip",
",",
"EuiCodeEditor",
",",
"EuiScreenReaderOnly",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"import",
"'brace/theme/github'",
";",
"function",
"RawJsonParamEditor",
"(",
"{",
"showValidation",
",",
"value",
"=",
"''",
",",
"setValidity",
",",
"setValue",
",",
"setTouched",
",",
"}",
")",
"{",
"const",
"[",
"isFieldValid",
",",
"setFieldValidity",
"]",
"=",
"useState",
"(",
"true",
")",
";",
"const",
"[",
"editorReady",
",",
"setEditorReady",
"]",
"=",
"useState",
"(",
"false",
")",
";",
"const",
"editorTooltipText",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.jsonInputTooltip'",
",",
"{",
"defaultMessage",
":",
"\"Any JSON formatted properties you add here will be merged with the opensearch aggregation definition for this section. For example 'shard_size' on a terms aggregation.\"",
",",
"}",
")",
",",
"[",
"]",
")",
";",
"const",
"jsonEditorLabelText",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.jsonInputLabel'",
",",
"{",
"defaultMessage",
":",
"'JSON input'",
",",
"}",
")",
",",
"[",
"]",
")",
";",
"const",
"label",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"(",
"<",
">",
"{",
"jsonEditorLabelText",
"}",
"{",
"' '",
"}",
"<",
"EuiIconTip",
"position",
"=",
"\"right\"",
"content",
"=",
"{",
"editorTooltipText",
"}",
"type",
"=",
"\"questionInCircle\"",
"/",
">",
"<",
"/>), [jsonEditorLabelText, editorTooltipText]);",
"const",
"onEditorValidate",
"=",
"useCallback",
"(",
"(",
"annotations",
")",
"=>",
"{",
"if",
"(",
"editorReady",
")",
"{",
"const",
"validity",
"=",
"annotations",
".",
"length",
"===",
"0",
";",
"setFieldValidity",
"(",
"validity",
")",
";",
"setValidity",
"(",
"validity",
")",
";",
"}",
"else",
"{",
"setEditorReady",
"(",
"true",
")",
";",
"}",
"}",
",",
"[",
"setValidity",
",",
"editorReady",
"]",
")",
";",
"return",
"(",
"<",
"EuiFormRow",
"label",
"=",
"{",
"label",
"}",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"!",
"isFieldValid",
":",
"false",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
"compressed",
">",
"<",
">",
"<",
"EuiCodeEditor",
"mode",
"=",
"\"json\"",
"theme",
"=",
"\"github\"",
"width",
"=",
"\"100%\"",
"height",
"=",
"\"250px\"",
"value",
"=",
"{",
"value",
"}",
"onValidate",
"=",
"{",
"onEditorValidate",
"}",
"setOptions",
"=",
"{",
"{",
"fontSize",
":",
"'14px'",
",",
"}",
"}",
"onChange",
"=",
"{",
"setValue",
"}",
"onBlur",
"=",
"{",
"setTouched",
"}",
"aria",
"-",
"label",
"=",
"{",
"jsonEditorLabelText",
"}",
"aria",
"-",
"describedby",
"=",
"\"jsonEditorDescription\"",
"/",
">",
"<",
"EuiScreenReaderOnly",
">",
"<",
"p",
"id",
"=",
"\"jsonEditorDescription\"",
">",
"{",
"editorTooltipText",
"}",
"<",
"/p>",
"<",
"/EuiScreenReaderOnly>",
"<",
"/>",
"<",
"/EuiFormRow>);",
"}",
"export",
"{",
"RawJsonParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661618 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiFormLabel",
",",
"EuiSpacer",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"useMount",
"}",
"from",
"'react-use'",
";",
"import",
"{",
"AggParamType",
",",
"IAggConfig",
",",
"AggGroupNames",
"}",
"from",
"'../../../../data/public'",
";",
"import",
"{",
"useSubAggParamsHandlers",
"}",
"from",
"'./utils'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"import",
"{",
"DefaultEditorAggParams",
"}",
"from",
"'../agg_params'",
";",
"function",
"SubMetricParamEditor",
"(",
"{",
"agg",
",",
"aggParam",
",",
"formIsTouched",
",",
"metricAggs",
",",
"state",
",",
"setValue",
",",
"setValidity",
",",
"setTouched",
",",
"schemas",
",",
"}",
")",
"{",
"const",
"metricTitle",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.metrics.metricTitle'",
",",
"{",
"defaultMessage",
":",
"'Metric'",
",",
"}",
")",
";",
"const",
"bucketTitle",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.metrics.bucketTitle'",
",",
"{",
"defaultMessage",
":",
"'Bucket'",
",",
"}",
")",
";",
"const",
"type",
"=",
"aggParam",
".",
"name",
";",
"const",
"isCustomMetric",
"=",
"type",
"===",
"'customMetric'",
";",
"const",
"aggTitle",
"=",
"isCustomMetric",
"?",
"metricTitle",
":",
"bucketTitle",
";",
"const",
"aggGroup",
"=",
"isCustomMetric",
"?",
"AggGroupNames",
".",
"Metrics",
":",
"AggGroupNames",
".",
"Buckets",
";",
"useMount",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"agg",
".",
"params",
"[",
"type",
"]",
")",
"{",
"setValue",
"(",
"agg",
".",
"params",
"[",
"type",
"]",
")",
";",
"}",
"else",
"{",
"setValue",
"(",
"aggParam",
".",
"makeAgg",
"(",
"agg",
")",
")",
";",
"}",
"}",
")",
";",
"const",
"{",
"onAggTypeChange",
",",
"setAggParamValue",
"}",
"=",
"useSubAggParamsHandlers",
"(",
"agg",
",",
"aggParam",
",",
"agg",
".",
"params",
"[",
"type",
"]",
",",
"setValue",
")",
";",
"if",
"(",
"!",
"agg",
".",
"params",
"[",
"type",
"]",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"<",
">",
"<",
"EuiSpacer",
"size",
"=",
"\"m\"",
"/",
">",
"<",
"EuiFormLabel",
">",
"{",
"aggTitle",
"}",
"<",
"/EuiFormLabel>",
"<",
"EuiSpacer",
"size",
"=",
"\"s\"",
"/",
">",
"<",
"DefaultEditorAggParams",
"agg",
"=",
"{",
"agg",
".",
"params",
"[",
"type",
"]",
"}",
"allowedAggs",
"=",
"{",
"aggParam",
".",
"allowedAggs",
"}",
"groupName",
"=",
"{",
"aggGroup",
"}",
"className",
"=",
"\"visEditorAgg__subAgg\"",
"formIsTouched",
"=",
"{",
"formIsTouched",
"}",
"indexPattern",
"=",
"{",
"agg",
".",
"getIndexPattern",
"(",
")",
"}",
"metricAggs",
"=",
"{",
"metricAggs",
"}",
"state",
"=",
"{",
"state",
"}",
"setAggParamValue",
"=",
"{",
"setAggParamValue",
"}",
"onAggTypeChange",
"=",
"{",
"onAggTypeChange",
"}",
"setValidity",
"=",
"{",
"setValidity",
"}",
"setTouched",
"=",
"{",
"setTouched",
"}",
"schemas",
"=",
"{",
"schemas",
"}",
"hideCustomLabel",
"=",
"{",
"!",
"isCustomMetric",
"}",
"/>",
"<",
"/>);",
"}",
"export",
"{",
"SubMetricParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661619 | [
"import",
"React",
",",
"{",
"useEffect",
",",
"useRef",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiFormRow",
",",
"EuiIconTip",
",",
"EuiSelect",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"IAggConfig",
",",
"AggParam",
",",
"OptionedValueProp",
",",
"OptionedParamType",
",",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"AggParamEditorProps",
",",
"OptionedParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"export",
"interface",
"AggregateValueProp",
"extends",
"OptionedValueProp",
"{",
"isCompatible",
"(",
"aggConfig",
")",
":",
"boolean",
";",
"}",
"export",
"type",
"TopAggregateParamEditorProps",
"=",
"AggParamEditorProps",
"<",
"AggregateValueProp",
">",
"&",
"OptionedParamEditorProps",
"<",
"AggregateValueProp",
">",
";",
"export",
"function",
"getCompatibleAggs",
"(",
"agg",
")",
"{",
"const",
"{",
"options",
"=",
"[",
"]",
"}",
"=",
"agg",
".",
"getAggParams",
"(",
")",
".",
"find",
"(",
"(",
"{",
"name",
"}",
")",
"=>",
"name",
"===",
"'aggregate'",
")",
"as",
"OptionedParamType",
";",
"return",
"options",
".",
"filter",
"(",
"(",
"option",
")",
"=>",
"option",
".",
"isCompatible",
"(",
"agg",
")",
")",
";",
"}",
"export",
"function",
"TopAggregateParamEditor",
"(",
"{",
"agg",
",",
"aggParam",
",",
"value",
",",
"showValidation",
",",
"setValue",
",",
"setValidity",
",",
"setTouched",
",",
"}",
")",
"{",
"const",
"isFirstRun",
"=",
"useRef",
"(",
"true",
")",
";",
"const",
"fieldType",
"=",
"agg",
".",
"params",
".",
"field",
"&&",
"agg",
".",
"params",
".",
"field",
".",
"type",
";",
"const",
"emptyValue",
"=",
"{",
"text",
":",
"''",
",",
"value",
":",
"'EMPTY_VALUE'",
",",
"disabled",
":",
"true",
",",
"hidden",
":",
"true",
"}",
";",
"const",
"filteredOptions",
"=",
"getCompatibleAggs",
"(",
"agg",
")",
".",
"map",
"(",
"(",
"{",
"text",
",",
"value",
":",
"val",
"}",
")",
"=>",
"(",
"{",
"text",
",",
"value",
":",
"val",
"}",
")",
")",
".",
"sort",
"(",
"(",
"a",
",",
"b",
")",
"=>",
"a",
".",
"text",
".",
"toLowerCase",
"(",
")",
".",
"localeCompare",
"(",
"b",
".",
"text",
".",
"toLowerCase",
"(",
")",
")",
")",
";",
"const",
"options",
"=",
"[",
"emptyValue",
",",
"...",
"filteredOptions",
"]",
";",
"const",
"disabled",
"=",
"fieldType",
"&&",
"!",
"filteredOptions",
".",
"length",
";",
"const",
"isValid",
"=",
"disabled",
"||",
"!",
"!",
"value",
";",
"const",
"label",
"=",
"(",
"<",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.controls.aggregateWithLabel\"",
"defaultMessage",
"=",
"\"Aggregate with\"",
"/",
">",
"{",
"' '",
"}",
"<",
"EuiIconTip",
"position",
"=",
"\"right\"",
"type",
"=",
"\"questionInCircle\"",
"content",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.aggregateWithTooltip'",
",",
"{",
"defaultMessage",
":",
"'Choose a strategy for combining multiple hits or a multi-valued field into a single metric.'",
",",
"}",
")",
"}",
"/",
">",
"<",
"/>);",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"setValidity",
"(",
"isValid",
")",
";",
"}",
",",
"[",
"isValid",
",",
"setValidity",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"isFirstRun",
".",
"current",
")",
"{",
"isFirstRun",
".",
"current",
"=",
"false",
";",
"return",
";",
"}",
"if",
"(",
"value",
")",
"{",
"if",
"(",
"aggParam",
".",
"options",
".",
"find",
"(",
"(",
"opt",
")",
"=>",
"opt",
".",
"value",
"===",
"value",
".",
"value",
")",
")",
"{",
"return",
";",
"}",
"setValue",
"(",
")",
";",
"}",
"if",
"(",
"filteredOptions",
".",
"length",
"===",
"1",
")",
"{",
"setValue",
"(",
"aggParam",
".",
"options",
".",
"find",
"(",
"(",
"opt",
")",
"=>",
"opt",
".",
"value",
"===",
"filteredOptions",
"[",
"0",
"]",
".",
"value",
")",
")",
";",
"}",
"}",
",",
"[",
"aggParam",
".",
"options",
",",
"fieldType",
",",
"filteredOptions",
",",
"setValue",
",",
"value",
"]",
")",
";",
"const",
"handleChange",
"=",
"(",
"event",
")",
"=>",
"{",
"if",
"(",
"event",
".",
"target",
".",
"value",
"===",
"emptyValue",
".",
"value",
")",
"{",
"setValue",
"(",
")",
";",
"}",
"else",
"{",
"setValue",
"(",
"aggParam",
".",
"options",
".",
"find",
"(",
"(",
"opt",
")",
"=>",
"opt",
".",
"value",
"===",
"event",
".",
"target",
".",
"value",
")",
")",
";",
"}",
"}",
";",
"return",
"(",
"<",
"EuiFormRow",
"label",
"=",
"{",
"label",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"!",
"isValid",
":",
"false",
"}",
"compressed",
">",
"<",
"EuiSelect",
"options",
"=",
"{",
"options",
"}",
"value",
"=",
"{",
"value",
"?",
"value",
".",
"value",
":",
"emptyValue",
".",
"value",
"}",
"onChange",
"=",
"{",
"handleChange",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
"compressed",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"!",
"isValid",
":",
"false",
"}",
"disabled",
"=",
"{",
"disabled",
"}",
"onBlur",
"=",
"{",
"setTouched",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"visDefaultEditorAggregateWith\"",
"/",
">",
"<",
"/EuiFormRow>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
941,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
941,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661620 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"IndexPatternField",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"FieldParamEditor",
"}",
"from",
"'./field'",
";",
"import",
"{",
"getCompatibleAggs",
"}",
"from",
"'./top_aggregate'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"function",
"TopFieldParamEditor",
"(",
"props",
")",
"{",
"const",
"compatibleAggs",
"=",
"getCompatibleAggs",
"(",
"props",
".",
"agg",
")",
";",
"let",
"customError",
";",
"if",
"(",
"props",
".",
"value",
"&&",
"!",
"compatibleAggs",
".",
"length",
")",
"{",
"customError",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.aggregateWith.noAggsErrorTooltip'",
",",
"{",
"defaultMessage",
":",
"'The chosen field has no compatible aggregations.'",
",",
"}",
")",
";",
"}",
"return",
"<",
"FieldParamEditor",
"{",
"...",
"props",
"}",
"customError",
"=",
"{",
"customError",
"}",
"/",
">",
";",
"}",
"export",
"{",
"TopFieldParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1358,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661621 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiIconTip",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"SizeParamEditor",
"}",
"from",
"'./size'",
";",
"import",
"{",
"getCompatibleAggs",
"}",
"from",
"'./top_aggregate'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"function",
"TopSizeParamEditor",
"(",
"props",
")",
"{",
"const",
"iconTip",
"=",
"(",
"<",
">",
"{",
"' '",
"}",
"<",
"EuiIconTip",
"position",
"=",
"\"right\"",
"content",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.sizeTooltip'",
",",
"{",
"defaultMessage",
":",
"\"Request top-K hits. Multiple hits will be combined via 'aggregate with'.\"",
",",
"}",
")",
"}",
"type",
"=",
"\"questionInCircle\"",
"/",
">",
"<",
"/>);",
"const",
"fieldType",
"=",
"props",
".",
"agg",
".",
"params",
".",
"field",
"&&",
"props",
".",
"agg",
".",
"params",
".",
"field",
".",
"type",
";",
"const",
"disabled",
"=",
"fieldType",
"&&",
"!",
"getCompatibleAggs",
"(",
"props",
".",
"agg",
")",
".",
"length",
";",
"return",
"<",
"SizeParamEditor",
"{",
"...",
"props",
"}",
"iconTip",
"=",
"{",
"iconTip",
"}",
"disabled",
"=",
"{",
"disabled",
"}",
"/",
">",
";",
"}",
"export",
"{",
"TopSizeParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1358,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661622 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"IndexPatternField",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"FieldParamEditor",
"}",
"from",
"'./field'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"function",
"TopSortFieldParamEditor",
"(",
"props",
")",
"{",
"const",
"customLabel",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.sortOnLabel'",
",",
"{",
"defaultMessage",
":",
"'Sort on'",
",",
"}",
")",
";",
"return",
"<",
"FieldParamEditor",
"{",
"...",
"props",
"}",
"customLabel",
"=",
"{",
"customLabel",
"}",
"/",
">",
";",
"}",
"export",
"{",
"TopSortFieldParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1358,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661623 | [
"import",
"React",
",",
"{",
"useEffect",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiFormRow",
",",
"EuiSelect",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"OptionedValueProp",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"AggParamEditorProps",
",",
"OptionedParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"function",
"OrderParamEditor",
"(",
"{",
"aggParam",
",",
"value",
",",
"showValidation",
",",
"setValue",
",",
"setValidity",
",",
"setTouched",
",",
"}",
")",
"{",
"const",
"label",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.orderLabel'",
",",
"{",
"defaultMessage",
":",
"'Order'",
",",
"}",
")",
";",
"const",
"isValid",
"=",
"!",
"!",
"value",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"setValidity",
"(",
"isValid",
")",
";",
"}",
",",
"[",
"isValid",
",",
"setValidity",
"]",
")",
";",
"return",
"(",
"<",
"EuiFormRow",
"label",
"=",
"{",
"label",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"!",
"isValid",
":",
"false",
"}",
"compressed",
">",
"<",
"EuiSelect",
"options",
"=",
"{",
"aggParam",
".",
"options",
"}",
"value",
"=",
"{",
"value",
"&&",
"value",
".",
"value",
"}",
"onChange",
"=",
"{",
"(",
"ev",
")",
"=>",
"setValue",
"(",
"aggParam",
".",
"options",
".",
"find",
"(",
"(",
"opt",
")",
"=>",
"opt",
".",
"value",
"===",
"ev",
".",
"target",
".",
"value",
")",
")",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
"compressed",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"!",
"isValid",
":",
"false",
"}",
"onBlur",
"=",
"{",
"setTouched",
"}",
"/",
">",
"<",
"/EuiFormRow>);",
"}",
"export",
"{",
"OrderParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661624 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiSwitch",
",",
"EuiFormRow",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"function",
"UseGeocentroidParamEditor",
"(",
"{",
"value",
"=",
"false",
",",
"setValue",
"}",
")",
"{",
"const",
"label",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.placeMarkersOffGridLabel'",
",",
"{",
"defaultMessage",
":",
"'Place markers off grid (use geocentroid)'",
",",
"}",
")",
";",
"return",
"(",
"<",
"EuiFormRow",
"compressed",
">",
"<",
"EuiSwitch",
"compressed",
"=",
"{",
"true",
"}",
"label",
"=",
"{",
"label",
"}",
"checked",
"=",
"{",
"value",
"}",
"onChange",
"=",
"{",
"(",
"ev",
")",
"=>",
"setValue",
"(",
"ev",
".",
"target",
".",
"checked",
")",
"}",
"/>",
"<",
"/EuiFormRow>);",
"}",
"export",
"{",
"UseGeocentroidParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661625 | [
"import",
"*",
"as",
"controls",
"from",
"'./controls'",
";",
"import",
"{",
"AggGroupNames",
",",
"BUCKET_TYPES",
",",
"METRIC_TYPES",
",",
"search",
"}",
"from",
"'../../../data/public'",
";",
"import",
"{",
"wrapWithInlineComp",
"}",
"from",
"'./controls/utils'",
";",
"const",
"{",
"siblingPipelineType",
",",
"parentPipelineType",
"}",
"=",
"search",
".",
"aggs",
";",
"const",
"buckets",
"=",
"{",
"[",
"BUCKET_TYPES",
".",
"DATE_HISTOGRAM",
"]",
":",
"{",
"scaleMetricValues",
":",
"controls",
".",
"ScaleMetricsParamEditor",
",",
"interval",
":",
"controls",
".",
"TimeIntervalParamEditor",
",",
"drop_partials",
":",
"controls",
".",
"DropPartialsParamEditor",
",",
"}",
",",
"[",
"BUCKET_TYPES",
".",
"DATE_RANGE",
"]",
":",
"{",
"ranges",
":",
"controls",
".",
"DateRangesParamEditor",
",",
"}",
",",
"[",
"BUCKET_TYPES",
".",
"FILTERS",
"]",
":",
"{",
"filters",
":",
"controls",
".",
"FiltersParamEditor",
",",
"}",
",",
"[",
"BUCKET_TYPES",
".",
"GEOHASH_GRID",
"]",
":",
"{",
"autoPrecision",
":",
"controls",
".",
"AutoPrecisionParamEditor",
",",
"precision",
":",
"controls",
".",
"PrecisionParamEditor",
",",
"useGeocentroid",
":",
"controls",
".",
"UseGeocentroidParamEditor",
",",
"isFilteredByCollar",
":",
"controls",
".",
"IsFilteredByCollarParamEditor",
",",
"}",
",",
"[",
"BUCKET_TYPES",
".",
"HISTOGRAM",
"]",
":",
"{",
"interval",
":",
"controls",
".",
"NumberIntervalParamEditor",
",",
"maxBars",
":",
"controls",
".",
"MaxBarsParamEditor",
",",
"min_doc_count",
":",
"controls",
".",
"MinDocCountParamEditor",
",",
"has_extended_bounds",
":",
"controls",
".",
"HasExtendedBoundsParamEditor",
",",
"extended_bounds",
":",
"controls",
".",
"ExtendedBoundsParamEditor",
",",
"}",
",",
"[",
"BUCKET_TYPES",
".",
"IP_RANGE",
"]",
":",
"{",
"ipRangeType",
":",
"controls",
".",
"IpRangeTypeParamEditor",
",",
"ranges",
":",
"controls",
".",
"IpRangesParamEditor",
",",
"}",
",",
"[",
"BUCKET_TYPES",
".",
"RANGE",
"]",
":",
"{",
"ranges",
":",
"controls",
".",
"RangesControl",
",",
"}",
",",
"[",
"BUCKET_TYPES",
".",
"SIGNIFICANT_TERMS",
"]",
":",
"{",
"size",
":",
"controls",
".",
"SizeParamEditor",
",",
"}",
",",
"[",
"BUCKET_TYPES",
".",
"TERMS",
"]",
":",
"{",
"include",
":",
"controls",
".",
"IncludeExcludeParamEditor",
",",
"exclude",
":",
"controls",
".",
"IncludeExcludeParamEditor",
",",
"orderBy",
":",
"controls",
".",
"OrderByParamEditor",
",",
"orderAgg",
":",
"controls",
".",
"OrderAggParamEditor",
",",
"order",
":",
"wrapWithInlineComp",
"(",
"controls",
".",
"OrderParamEditor",
")",
",",
"size",
":",
"wrapWithInlineComp",
"(",
"controls",
".",
"SizeParamEditor",
")",
",",
"otherBucket",
":",
"controls",
".",
"OtherBucketParamEditor",
",",
"missingBucket",
":",
"controls",
".",
"MissingBucketParamEditor",
",",
"}",
",",
"}",
";",
"const",
"metrics",
"=",
"{",
"[",
"METRIC_TYPES",
".",
"TOP_HITS",
"]",
":",
"{",
"field",
":",
"controls",
".",
"TopFieldParamEditor",
",",
"aggregate",
":",
"wrapWithInlineComp",
"(",
"controls",
".",
"TopAggregateParamEditor",
")",
",",
"size",
":",
"wrapWithInlineComp",
"(",
"controls",
".",
"TopSizeParamEditor",
")",
",",
"sortField",
":",
"controls",
".",
"TopSortFieldParamEditor",
",",
"sortOrder",
":",
"controls",
".",
"OrderParamEditor",
",",
"}",
",",
"[",
"METRIC_TYPES",
".",
"PERCENTILES",
"]",
":",
"{",
"percents",
":",
"controls",
".",
"PercentilesEditor",
",",
"}",
",",
"[",
"METRIC_TYPES",
".",
"PERCENTILE_RANKS",
"]",
":",
"{",
"values",
":",
"controls",
".",
"PercentileRanksEditor",
",",
"}",
",",
"}",
";",
"export",
"const",
"aggParamsMap",
"=",
"{",
"common",
":",
"{",
"string",
":",
"controls",
".",
"StringParamEditor",
",",
"json",
":",
"controls",
".",
"RawJsonParamEditor",
",",
"field",
":",
"controls",
".",
"FieldParamEditor",
",",
"}",
",",
"[",
"siblingPipelineType",
"]",
":",
"{",
"customBucket",
":",
"controls",
".",
"SubMetricParamEditor",
",",
"customMetric",
":",
"controls",
".",
"SubMetricParamEditor",
",",
"}",
",",
"[",
"parentPipelineType",
"]",
":",
"{",
"metricAgg",
":",
"controls",
".",
"MetricAggParamEditor",
",",
"customMetric",
":",
"controls",
".",
"SubAggParamEditor",
",",
"}",
",",
"[",
"AggGroupNames",
".",
"Buckets",
"]",
":",
"buckets",
",",
"[",
"AggGroupNames",
".",
"Metrics",
"]",
":",
"metrics",
",",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661626 | [
"import",
"{",
"ParamInstance",
"}",
"from",
"'./agg_params_helper'",
";",
"export",
"enum",
"AGG_TYPE_ACTION_KEYS",
"{",
"TOUCHED",
"=",
"'aggTypeTouched'",
",",
"VALID",
"=",
"'aggTypeValid'",
"}",
"export",
"interface",
"AggTypeState",
"{",
"touched",
":",
"boolean",
";",
"valid",
":",
"boolean",
";",
"}",
"export",
"interface",
"AggTypeAction",
"{",
"type",
":",
"AGG_TYPE_ACTION_KEYS",
";",
"payload",
":",
"boolean",
";",
"}",
"function",
"aggTypeReducer",
"(",
"state",
",",
"action",
")",
"{",
"switch",
"(",
"action",
".",
"type",
")",
"{",
"case",
"AGG_TYPE_ACTION_KEYS",
".",
"TOUCHED",
":",
"return",
"{",
"...",
"state",
",",
"touched",
":",
"action",
".",
"payload",
"}",
";",
"case",
"AGG_TYPE_ACTION_KEYS",
".",
"VALID",
":",
"return",
"{",
"...",
"state",
",",
"valid",
":",
"action",
".",
"payload",
"}",
";",
"default",
":",
"throw",
"new",
"Error",
"(",
")",
";",
"}",
"}",
"export",
"enum",
"AGG_PARAMS_ACTION_KEYS",
"{",
"TOUCHED",
"=",
"'aggParamsTouched'",
",",
"VALID",
"=",
"'aggParamsValid'",
",",
"RESET",
"=",
"'aggParamsReset'",
"}",
"export",
"interface",
"AggParamsItem",
"{",
"touched",
":",
"boolean",
";",
"valid",
":",
"boolean",
";",
"}",
"export",
"interface",
"AggParamsAction",
"{",
"type",
":",
"AGG_PARAMS_ACTION_KEYS",
";",
"payload",
"?",
":",
"boolean",
";",
"paramName",
"?",
":",
"string",
";",
"}",
"export",
"interface",
"AggParamsState",
"{",
"[",
"key",
"]",
":",
"AggParamsItem",
";",
"}",
"function",
"aggParamsReducer",
"(",
"state",
",",
"{",
"type",
",",
"paramName",
"=",
"''",
",",
"payload",
"}",
")",
"{",
"const",
"targetParam",
"=",
"state",
"[",
"paramName",
"]",
"||",
"{",
"valid",
":",
"true",
",",
"touched",
":",
"false",
",",
"}",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"AGG_PARAMS_ACTION_KEYS",
".",
"TOUCHED",
":",
"return",
"{",
"...",
"state",
",",
"[",
"paramName",
"]",
":",
"{",
"...",
"targetParam",
",",
"touched",
":",
"payload",
",",
"}",
",",
"}",
"as",
"AggParamsState",
";",
"case",
"AGG_PARAMS_ACTION_KEYS",
".",
"VALID",
":",
"return",
"{",
"...",
"state",
",",
"[",
"paramName",
"]",
":",
"{",
"...",
"targetParam",
",",
"valid",
":",
"payload",
",",
"}",
",",
"}",
"as",
"AggParamsState",
";",
"case",
"AGG_PARAMS_ACTION_KEYS",
".",
"RESET",
":",
"return",
"{",
"}",
";",
"default",
":",
"throw",
"new",
"Error",
"(",
")",
";",
"}",
"}",
"function",
"initAggParamsState",
"(",
"params",
")",
"{",
"const",
"state",
"=",
"params",
".",
"reduce",
"(",
"(",
"stateObj",
",",
"param",
")",
"=>",
"{",
"stateObj",
"[",
"param",
".",
"aggParam",
".",
"name",
"]",
"=",
"{",
"valid",
":",
"true",
",",
"touched",
":",
"false",
",",
"}",
";",
"return",
"stateObj",
";",
"}",
",",
"{",
"}",
")",
";",
"return",
"state",
";",
"}",
"export",
"{",
"aggTypeReducer",
",",
"aggParamsReducer",
",",
"initAggParamsState",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13051,
null,
13051,
null,
26173,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5335,
null,
5335,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661627 | [
"import",
"{",
"get",
",",
"has",
"}",
"from",
"'lodash'",
";",
"import",
"React",
",",
"{",
"useEffect",
",",
"useCallback",
",",
"useState",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiComboBox",
",",
"EuiComboBoxOptionOption",
",",
"EuiFormRow",
",",
"EuiLink",
",",
"EuiText",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"IAggType",
",",
"IndexPattern",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"DocLinksStart",
"}",
"from",
"'../../../../core/public'",
";",
"import",
"{",
"useOpenSearchDashboards",
"}",
"from",
"'../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"ComboBoxGroupedOptions",
"}",
"from",
"'../utils'",
";",
"import",
"{",
"AGG_TYPE_ACTION_KEYS",
",",
"AggTypeAction",
"}",
"from",
"'./agg_params_state'",
";",
"interface",
"DefaultEditorAggSelectProps",
"{",
"aggError",
"?",
":",
"string",
";",
"aggTypeOptions",
":",
"ComboBoxGroupedOptions",
"<",
"IAggType",
">",
";",
"id",
":",
"string",
";",
"indexPattern",
":",
"IndexPattern",
";",
"showValidation",
":",
"boolean",
";",
"isSubAggregation",
":",
"boolean",
";",
"value",
":",
"IAggType",
";",
"onChangeAggType",
":",
"React",
".",
"Dispatch",
"<",
"AggTypeAction",
">",
";",
"setValue",
":",
"(",
"aggType",
":",
"IAggType",
")",
"=>",
"void",
";",
"}",
"function",
"DefaultEditorAggSelect",
"(",
"{",
"aggError",
",",
"id",
",",
"indexPattern",
",",
"value",
",",
"setValue",
",",
"aggTypeOptions",
",",
"showValidation",
",",
"isSubAggregation",
",",
"onChangeAggType",
",",
"}",
")",
"{",
"const",
"[",
"isDirty",
",",
"setIsDirty",
"]",
"=",
"useState",
"(",
"false",
")",
";",
"const",
"{",
"services",
"}",
"=",
"useOpenSearchDashboards",
"<",
"{",
"docLinks",
":",
"DocLinksStart",
";",
"}",
">",
"(",
")",
";",
"const",
"selectedOptions",
"=",
"value",
"?",
"[",
"{",
"label",
":",
"value",
".",
"title",
",",
"target",
":",
"value",
"}",
"]",
":",
"[",
"]",
";",
"const",
"label",
"=",
"isSubAggregation",
"?",
"(",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.aggSelect.subAggregationLabel\"",
"defaultMessage",
"=",
"\"Sub aggregation\"",
"/",
">",
")",
":",
"(",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.aggSelect.aggregationLabel\"",
"defaultMessage",
"=",
"\"Aggregation\"",
"/",
">",
")",
";",
"let",
"aggHelpLink",
";",
"if",
"(",
"has",
"(",
"value",
",",
"'name'",
")",
")",
"{",
"aggHelpLink",
"=",
"services",
".",
"docLinks",
".",
"links",
".",
"opensearch",
".",
"aggregations",
".",
"base",
";",
"}",
"const",
"helpLink",
"=",
"value",
"&&",
"aggHelpLink",
"&&",
"(",
"<",
"EuiLink",
"href",
"=",
"{",
"aggHelpLink",
"}",
"target",
"=",
"\"_blank\"",
"rel",
"=",
"\"noopener\"",
">",
"<",
"EuiText",
"size",
"=",
"\"xs\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.aggSelect.helpLinkLabel\"",
"defaultMessage",
"=",
"\"{aggTitle} help\"",
"values",
"=",
"{",
"{",
"aggTitle",
":",
"value",
"?",
"value",
".",
"title",
":",
"''",
"}",
"}",
"/>",
"<",
"/EuiText>",
"<",
"/EuiLink>);",
"const",
"errors",
"=",
"aggError",
"?",
"[",
"aggError",
"]",
":",
"[",
"]",
";",
"if",
"(",
"!",
"aggTypeOptions",
".",
"length",
")",
"{",
"errors",
".",
"push",
"(",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.aggSelect.noCompatibleAggsDescription'",
",",
"{",
"defaultMessage",
":",
"'The index pattern {indexPatternTitle} does not have any aggregatable fields.'",
",",
"values",
":",
"{",
"indexPatternTitle",
":",
"indexPattern",
"&&",
"indexPattern",
".",
"title",
",",
"}",
",",
"}",
")",
")",
";",
"}",
"const",
"isValid",
"=",
"!",
"!",
"value",
"&&",
"!",
"errors",
".",
"length",
"&&",
"!",
"isDirty",
";",
"const",
"onChange",
"=",
"useCallback",
"(",
"(",
"options",
")",
"=>",
"{",
"const",
"selectedOption",
"=",
"get",
"(",
"options",
",",
"'0.target'",
")",
";",
"if",
"(",
"selectedOption",
")",
"{",
"setValue",
"(",
"selectedOption",
"as",
"IAggType",
")",
";",
"}",
"}",
",",
"[",
"setValue",
"]",
")",
";",
"const",
"onSearchChange",
"=",
"useCallback",
"(",
"(",
"searchValue",
")",
"=>",
"setIsDirty",
"(",
"Boolean",
"(",
"searchValue",
")",
")",
",",
"[",
"]",
")",
";",
"const",
"setTouched",
"=",
"useCallback",
"(",
"(",
")",
"=>",
"onChangeAggType",
"(",
"{",
"type",
":",
"AGG_TYPE_ACTION_KEYS",
".",
"TOUCHED",
",",
"payload",
":",
"true",
"}",
")",
",",
"[",
"onChangeAggType",
"]",
")",
";",
"const",
"setValidity",
"=",
"useCallback",
"(",
"(",
"valid",
")",
"=>",
"onChangeAggType",
"(",
"{",
"type",
":",
"AGG_TYPE_ACTION_KEYS",
".",
"VALID",
",",
"payload",
":",
"valid",
"}",
")",
",",
"[",
"onChangeAggType",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"setValidity",
"(",
"isValid",
")",
";",
"}",
",",
"[",
"isValid",
",",
"setValidity",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"errors",
".",
"length",
")",
"{",
"setTouched",
"(",
")",
";",
"}",
"}",
",",
"[",
"errors",
".",
"length",
",",
"setTouched",
"]",
")",
";",
"return",
"(",
"<",
"EuiFormRow",
"label",
"=",
"{",
"label",
"}",
"labelAppend",
"=",
"{",
"helpLink",
"}",
"error",
"=",
"{",
"errors",
"}",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"!",
"isValid",
":",
"false",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
"compressed",
">",
"<",
"EuiComboBox",
"placeholder",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.aggSelect.selectAggPlaceholder'",
",",
"{",
"defaultMessage",
":",
"'Select an aggregation'",
",",
"}",
")",
"}",
"id",
"=",
"{",
"`visDefaultEditorAggSelect${",
"id",
"}`",
"}",
"isDisabled",
"=",
"{",
"!",
"aggTypeOptions",
".",
"length",
"}",
"options",
"=",
"{",
"aggTypeOptions",
"}",
"selectedOptions",
"=",
"{",
"selectedOptions",
"}",
"singleSelection",
"=",
"{",
"{",
"asPlainText",
":",
"true",
"}",
"}",
"onBlur",
"=",
"{",
"setTouched",
"}",
"onChange",
"=",
"{",
"onChange",
"}",
"onSearchChange",
"=",
"{",
"onSearchChange",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"defaultEditorAggSelect\"",
"isClearable",
"=",
"{",
"false",
"}",
"isInvalid",
"=",
"{",
"showValidation",
"?",
"!",
"isValid",
":",
"false",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
"sortMatchesBy",
"=",
"\"startsWith\"",
"compressed",
"/",
">",
"<",
"/EuiFormRow>);",
"}",
"export",
"{",
"DefaultEditorAggSelect",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661628 | [
"import",
"React",
",",
"{",
"useCallback",
",",
"useEffect",
"}",
"from",
"'react'",
";",
"import",
"{",
"AggParamEditorProps",
",",
"AggParamCommonProps",
"}",
"from",
"'./agg_param_props'",
";",
"import",
"{",
"DefaultEditorAggCommonProps",
"}",
"from",
"'./agg_common_props'",
";",
"import",
"{",
"AGG_PARAMS_ACTION_KEYS",
",",
"AggParamsAction",
"}",
"from",
"'./agg_params_state'",
";",
"interface",
"DefaultEditorAggParamProps",
"<",
"T",
">",
"extends",
"AggParamCommonProps",
"<",
"T",
">",
"{",
"paramEditor",
":",
"React",
".",
"ComponentType",
"<",
"AggParamEditorProps",
"<",
"T",
">",
">",
";",
"setAggParamValue",
":",
"DefaultEditorAggCommonProps",
"[",
"'setAggParamValue'",
"]",
";",
"onChangeParamsState",
":",
"React",
".",
"Dispatch",
"<",
"AggParamsAction",
">",
";",
"}",
"function",
"DefaultEditorAggParam",
"<",
"T",
">",
"(",
"props",
")",
"{",
"const",
"{",
"agg",
",",
"aggParam",
",",
"paramEditor",
":",
"ParamEditor",
",",
"setAggParamValue",
",",
"onChangeParamsState",
",",
"...",
"rest",
"}",
"=",
"props",
";",
"const",
"setValidity",
"=",
"useCallback",
"(",
"(",
"valid",
")",
"=>",
"{",
"onChangeParamsState",
"(",
"{",
"type",
":",
"AGG_PARAMS_ACTION_KEYS",
".",
"VALID",
",",
"paramName",
":",
"aggParam",
".",
"name",
",",
"payload",
":",
"valid",
",",
"}",
")",
";",
"}",
",",
"[",
"onChangeParamsState",
",",
"aggParam",
".",
"name",
"]",
")",
";",
"const",
"setTouched",
"=",
"useCallback",
"(",
"(",
"isTouched",
"=",
"true",
")",
"=>",
"{",
"onChangeParamsState",
"(",
"{",
"type",
":",
"AGG_PARAMS_ACTION_KEYS",
".",
"TOUCHED",
",",
"paramName",
":",
"aggParam",
".",
"name",
",",
"payload",
":",
"isTouched",
",",
"}",
")",
";",
"}",
",",
"[",
"onChangeParamsState",
",",
"aggParam",
".",
"name",
"]",
")",
";",
"const",
"setValue",
"=",
"useCallback",
"(",
"(",
"value",
")",
"=>",
"{",
"if",
"(",
"props",
".",
"value",
"!==",
"value",
")",
"{",
"setAggParamValue",
"(",
"agg",
".",
"id",
",",
"aggParam",
".",
"name",
",",
"value",
")",
";",
"}",
"}",
",",
"[",
"setAggParamValue",
",",
"agg",
".",
"id",
",",
"aggParam",
".",
"name",
",",
"props",
".",
"value",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"aggParam",
".",
"shouldShow",
"&&",
"!",
"aggParam",
".",
"shouldShow",
"(",
"agg",
")",
")",
"{",
"setValidity",
"(",
"true",
")",
";",
"}",
"}",
",",
"[",
"agg",
",",
"agg",
".",
"params",
".",
"field",
",",
"aggParam",
",",
"setValidity",
"]",
")",
";",
"if",
"(",
"aggParam",
".",
"shouldShow",
"&&",
"!",
"aggParam",
".",
"shouldShow",
"(",
"agg",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"<",
"ParamEditor",
"agg",
"=",
"{",
"agg",
"}",
"aggParam",
"=",
"{",
"aggParam",
"}",
"setValidity",
"=",
"{",
"setValidity",
"}",
"setTouched",
"=",
"{",
"setTouched",
"}",
"setValue",
"=",
"{",
"setValue",
"}",
"{",
"...",
"rest",
"}",
"/>);",
"}",
"export",
"{",
"DefaultEditorAggParam",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26177,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
11,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661629 | [
"import",
"React",
",",
"{",
"useState",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiButtonEmpty",
",",
"EuiContextMenuItem",
",",
"EuiContextMenuPanel",
",",
"EuiFlexGroup",
",",
"EuiFlexItem",
",",
"EuiPopover",
",",
"EuiPopoverTitle",
",",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"IAggConfig",
",",
"AggGroupNames",
"}",
"from",
"'../../../data/public'",
";",
"import",
"{",
"Schema",
"}",
"from",
"'../schemas'",
";",
"interface",
"DefaultEditorAggAddProps",
"{",
"group",
"?",
":",
"IAggConfig",
"[",
"]",
";",
"groupName",
":",
"string",
";",
"schemas",
":",
"Schema",
"[",
"]",
";",
"stats",
":",
"{",
"max",
":",
"number",
";",
"count",
":",
"number",
";",
"}",
";",
"addSchema",
"(",
"schema",
")",
":",
"void",
";",
"}",
"function",
"DefaultEditorAggAdd",
"(",
"{",
"group",
"=",
"[",
"]",
",",
"groupName",
",",
"schemas",
",",
"addSchema",
",",
"stats",
",",
"}",
")",
"{",
"const",
"[",
"isPopoverOpen",
",",
"setIsPopoverOpen",
"]",
"=",
"useState",
"(",
"false",
")",
";",
"const",
"onSelectSchema",
"=",
"(",
"schema",
")",
"=>",
"{",
"setIsPopoverOpen",
"(",
"false",
")",
";",
"addSchema",
"(",
"schema",
")",
";",
"}",
";",
"const",
"addButton",
"=",
"(",
"<",
"EuiButtonEmpty",
"size",
"=",
"\"xs\"",
"iconType",
"=",
"\"plusInCircleFilled\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`visEditorAdd_${",
"groupName",
"}`",
"}",
"onClick",
"=",
"{",
"(",
")",
"=>",
"setIsPopoverOpen",
"(",
"!",
"isPopoverOpen",
")",
"}",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.aggAdd.addButtonLabel\"",
"defaultMessage",
"=",
"\"Add\"",
"/",
">",
"<",
"/EuiButtonEmpty>);",
"const",
"groupNameLabel",
"=",
"groupName",
"===",
"AggGroupNames",
".",
"Buckets",
"?",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.aggAdd.bucketLabel'",
",",
"{",
"defaultMessage",
":",
"'bucket'",
"}",
")",
":",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.aggAdd.metricLabel'",
",",
"{",
"defaultMessage",
":",
"'metric'",
"}",
")",
";",
"const",
"isSchemaDisabled",
"=",
"(",
"schema",
")",
":",
"boolean",
"=>",
"{",
"const",
"count",
"=",
"group",
".",
"filter",
"(",
"(",
"agg",
")",
"=>",
"agg",
".",
"schema",
"===",
"schema",
".",
"name",
")",
".",
"length",
";",
"return",
"count",
">=",
"schema",
".",
"max",
";",
"}",
";",
"return",
"(",
"<",
"EuiFlexGroup",
"justifyContent",
"=",
"\"center\"",
"responsive",
"=",
"{",
"false",
"}",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiPopover",
"id",
"=",
"{",
"`addGroupButtonPopover_${",
"groupName",
"}`",
"}",
"button",
"=",
"{",
"addButton",
"}",
"isOpen",
"=",
"{",
"isPopoverOpen",
"}",
"panelPaddingSize",
"=",
"\"none\"",
"repositionOnScroll",
"=",
"{",
"true",
"}",
"closePopover",
"=",
"{",
"(",
")",
"=>",
"setIsPopoverOpen",
"(",
"false",
")",
"}",
">",
"<",
"EuiPopoverTitle",
">",
"{",
"(",
"groupName",
"!==",
"AggGroupNames",
".",
"Buckets",
"||",
"!",
"stats",
".",
"count",
")",
"&&",
"(",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.aggAdd.addGroupButtonLabel\"",
"defaultMessage",
"=",
"\"Add {groupNameLabel}\"",
"values",
"=",
"{",
"{",
"groupNameLabel",
"}",
"}",
"/>)}",
"{",
"groupName",
"===",
"AggGroupNames",
".",
"Buckets",
"&&",
"stats",
".",
"count",
">",
"0",
"&&",
"(",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.aggAdd.addSubGroupButtonLabel\"",
"defaultMessage",
"=",
"\"Add sub-{groupNameLabel}\"",
"values",
"=",
"{",
"{",
"groupNameLabel",
"}",
"}",
"/>)}",
"<",
"/EuiPopoverTitle>",
"<",
"EuiContextMenuPanel",
"items",
"=",
"{",
"schemas",
".",
"map",
"(",
"(",
"schema",
")",
"=>",
"(",
"<",
"EuiContextMenuItem",
"key",
"=",
"{",
"`${",
"schema",
".",
"name",
"}_${",
"schema",
".",
"title",
"}`",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`visEditorAdd_${",
"groupName",
"}_${",
"schema",
".",
"title",
"}`",
"}",
"disabled",
"=",
"{",
"isPopoverOpen",
"&&",
"isSchemaDisabled",
"(",
"schema",
")",
"}",
"onClick",
"=",
"{",
"(",
")",
"=>",
"onSelectSchema",
"(",
"schema",
")",
"}",
">",
"{",
"schema",
".",
"title",
"}",
"<",
"/EuiContextMenuItem>))}/",
">",
"<",
"/EuiPopover>",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>);",
"}",
"export",
"{",
"DefaultEditorAggAdd",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
151,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661630 | [
"import",
"React",
",",
"{",
"useMemo",
",",
"useCallback",
"}",
"from",
"'react'",
";",
"import",
"{",
"findLast",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"EuiSpacer",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"AggGroupNames",
",",
"IAggConfig",
",",
"IMetricAggType",
",",
"search",
",",
"TimeRange",
",",
"}",
"from",
"'../../../../data/public'",
";",
"import",
"{",
"DefaultEditorAggGroup",
"}",
"from",
"'../agg_group'",
";",
"import",
"{",
"EditorAction",
",",
"addNewAgg",
",",
"removeAgg",
",",
"reorderAggs",
",",
"setAggParamValue",
",",
"changeAggType",
",",
"toggleEnabledAgg",
",",
"}",
"from",
"'./state'",
";",
"import",
"{",
"AddSchema",
",",
"ReorderAggs",
",",
"DefaultEditorAggCommonProps",
"}",
"from",
"'../agg_common_props'",
";",
"import",
"{",
"ISchemas",
"}",
"from",
"'../../schemas'",
";",
"import",
"{",
"EditorVisState",
"}",
"from",
"'./state/reducers'",
";",
"export",
"interface",
"DefaultEditorDataTabProps",
"{",
"dispatch",
":",
"React",
".",
"Dispatch",
"<",
"EditorAction",
">",
";",
"formIsTouched",
":",
"boolean",
";",
"isTabSelected",
":",
"boolean",
";",
"metricAggs",
":",
"IAggConfig",
"[",
"]",
";",
"schemas",
":",
"ISchemas",
";",
"state",
":",
"EditorVisState",
";",
"setTouched",
"(",
"isTouched",
")",
":",
"void",
";",
"setValidity",
"(",
"modelName",
",",
"value",
")",
":",
"void",
";",
"setStateValue",
":",
"DefaultEditorAggCommonProps",
"[",
"'setStateParamValue'",
"]",
";",
"timeRange",
":",
"TimeRange",
";",
"}",
"function",
"DefaultEditorDataTab",
"(",
"{",
"dispatch",
",",
"formIsTouched",
",",
"metricAggs",
",",
"schemas",
",",
"state",
",",
"setTouched",
",",
"setValidity",
",",
"setStateValue",
",",
"timeRange",
",",
"}",
")",
"{",
"const",
"lastParentPipelineAgg",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"findLast",
"(",
"metricAggs",
",",
"(",
"{",
"type",
"}",
")",
"=>",
"type",
".",
"subtype",
"===",
"search",
".",
"aggs",
".",
"parentPipelineType",
")",
",",
"[",
"metricAggs",
"]",
")",
";",
"const",
"lastParentPipelineAggTitle",
"=",
"lastParentPipelineAgg",
"&&",
"(",
"lastParentPipelineAgg",
"as",
"IAggConfig",
")",
".",
"type",
".",
"title",
";",
"const",
"addSchema",
"=",
"useCallback",
"(",
"(",
"schema",
")",
"=>",
"dispatch",
"(",
"addNewAgg",
"(",
"schema",
")",
")",
",",
"[",
"dispatch",
"]",
")",
";",
"const",
"onAggRemove",
"=",
"useCallback",
"(",
"(",
"aggId",
")",
"=>",
"dispatch",
"(",
"removeAgg",
"(",
"aggId",
",",
"schemas",
".",
"all",
"||",
"[",
"]",
")",
")",
",",
"[",
"dispatch",
",",
"schemas",
"]",
")",
";",
"const",
"onReorderAggs",
"=",
"useCallback",
"(",
"(",
"...",
"props",
")",
"=>",
"dispatch",
"(",
"reorderAggs",
"(",
"...",
"props",
")",
")",
",",
"[",
"dispatch",
",",
"]",
")",
";",
"const",
"onAggParamValueChange",
"=",
"useCallback",
"(",
"(",
"...",
"props",
")",
"=>",
"dispatch",
"(",
"setAggParamValue",
"(",
"...",
"props",
")",
")",
",",
"[",
"dispatch",
"]",
")",
";",
"const",
"onAggTypeChange",
"=",
"useCallback",
"(",
"(",
"...",
"props",
")",
"=>",
"dispatch",
"(",
"changeAggType",
"(",
"...",
"props",
")",
")",
",",
"[",
"dispatch",
"]",
")",
";",
"const",
"onToggleEnableAgg",
"=",
"useCallback",
"(",
"(",
"...",
"props",
")",
"=>",
"dispatch",
"(",
"toggleEnabledAgg",
"(",
"...",
"props",
")",
")",
",",
"[",
"dispatch",
"]",
")",
";",
"const",
"commonProps",
"=",
"{",
"addSchema",
",",
"formIsTouched",
",",
"lastParentPipelineAggTitle",
",",
"metricAggs",
",",
"state",
",",
"reorderAggs",
":",
"onReorderAggs",
",",
"setAggParamValue",
":",
"onAggParamValueChange",
",",
"setStateParamValue",
":",
"setStateValue",
",",
"onAggTypeChange",
",",
"onToggleEnableAgg",
",",
"setValidity",
",",
"setTouched",
",",
"removeAgg",
":",
"onAggRemove",
",",
"}",
"as",
"any",
";",
"return",
"(",
"<",
">",
"<",
"DefaultEditorAggGroup",
"groupName",
"=",
"{",
"AggGroupNames",
".",
"Metrics",
"}",
"schemas",
"=",
"{",
"schemas",
".",
"metrics",
"}",
"{",
"...",
"commonProps",
"}",
"/>",
"<",
"EuiSpacer",
"size",
"=",
"\"s\"",
"/",
">",
"<",
"DefaultEditorAggGroup",
"groupName",
"=",
"{",
"AggGroupNames",
".",
"Buckets",
"}",
"schemas",
"=",
"{",
"schemas",
".",
"buckets",
"}",
"timeRange",
"=",
"{",
"timeRange",
"}",
"{",
"...",
"commonProps",
"}",
"/>",
"<",
"/>);",
"}",
"export",
"{",
"DefaultEditorDataTab",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
2,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661631 | [
"import",
"{",
"Vis",
",",
"PersistedState",
"}",
"from",
"'src/plugins/visualizations/public'",
";",
"import",
"{",
"IAggConfigs",
"}",
"from",
"'src/plugins/data/public'",
";",
"export",
"interface",
"VisOptionsProps",
"<",
"VisParamType",
"=",
"unknown",
">",
"{",
"aggs",
":",
"IAggConfigs",
";",
"hasHistogramAgg",
":",
"boolean",
";",
"isTabSelected",
":",
"boolean",
";",
"stateParams",
":",
"VisParamType",
";",
"vis",
":",
"Vis",
";",
"uiState",
":",
"PersistedState",
";",
"setValue",
"<",
"T",
"extends",
"keyof",
"VisParamType",
">",
"(",
"paramName",
",",
"value",
")",
":",
"void",
";",
"setValidity",
"(",
"isValid",
")",
":",
"void",
";",
"setTouched",
"(",
"isTouched",
")",
":",
"void",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
11,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null
] |
661632 | [
"import",
"React",
",",
"{",
"useCallback",
",",
"useState",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiFlexGroup",
",",
"EuiFlexItem",
",",
"EuiButton",
",",
"EuiButtonEmpty",
",",
"EuiButtonToggle",
",",
"EuiToolTip",
",",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"useDebounce",
"}",
"from",
"'react-use'",
";",
"import",
"{",
"Vis",
"}",
"from",
"'src/plugins/visualizations/public'",
";",
"import",
"{",
"discardChanges",
",",
"EditorAction",
"}",
"from",
"'./state'",
";",
"interface",
"DefaultEditorControlsProps",
"{",
"applyChanges",
"(",
")",
":",
"void",
";",
"isDirty",
":",
"boolean",
";",
"isInvalid",
":",
"boolean",
";",
"isTouched",
":",
"boolean",
";",
"dispatch",
":",
"React",
".",
"Dispatch",
"<",
"EditorAction",
">",
";",
"vis",
":",
"Vis",
";",
"}",
"function",
"DefaultEditorControls",
"(",
"{",
"applyChanges",
",",
"isDirty",
",",
"isInvalid",
",",
"isTouched",
",",
"dispatch",
",",
"vis",
",",
"}",
")",
"{",
"const",
"{",
"enableAutoApply",
"}",
"=",
"vis",
".",
"type",
".",
"editorConfig",
";",
"const",
"[",
"autoApplyEnabled",
",",
"setAutoApplyEnabled",
"]",
"=",
"useState",
"(",
"false",
")",
";",
"const",
"toggleAutoApply",
"=",
"useCallback",
"(",
"(",
"e",
")",
"=>",
"setAutoApplyEnabled",
"(",
"e",
".",
"target",
".",
"checked",
")",
",",
"[",
"]",
")",
";",
"const",
"onClickDiscard",
"=",
"useCallback",
"(",
"(",
")",
"=>",
"dispatch",
"(",
"discardChanges",
"(",
"vis",
")",
")",
",",
"[",
"dispatch",
",",
"vis",
"]",
")",
";",
"useDebounce",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"autoApplyEnabled",
"&&",
"isDirty",
")",
"{",
"applyChanges",
"(",
")",
";",
"}",
"}",
",",
"300",
",",
"[",
"isDirty",
",",
"autoApplyEnabled",
",",
"applyChanges",
"]",
")",
";",
"return",
"(",
"<",
"div",
"className",
"=",
"\"visEditorSidebar__controls\"",
">",
"{",
"!",
"autoApplyEnabled",
"&&",
"(",
"<",
"EuiFlexGroup",
"justifyContent",
"=",
"\"spaceBetween\"",
"gutterSize",
"=",
"\"none\"",
"responsive",
"=",
"{",
"false",
"}",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiButtonEmpty",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"visualizeEditorResetButton\"",
"disabled",
"=",
"{",
"!",
"isDirty",
"}",
"iconType",
"=",
"\"cross\"",
"onClick",
"=",
"{",
"onClickDiscard",
"}",
"size",
"=",
"\"s\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.sidebar.discardChangesButtonLabel\"",
"defaultMessage",
"=",
"\"Discard\"",
"/",
">",
"<",
"/EuiButtonEmpty>",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"{",
"isInvalid",
"&&",
"isTouched",
"?",
"(",
"<",
"EuiToolTip",
"content",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.sidebar.errorButtonTooltip'",
",",
"{",
"defaultMessage",
":",
"'Errors in the highlighted fields need to be resolved.'",
",",
"}",
")",
"}",
">",
"<",
"EuiButton",
"color",
"=",
"\"danger\"",
"iconType",
"=",
"\"alert\"",
"size",
"=",
"\"s\"",
"disabled",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.sidebar.updateChartButtonLabel\"",
"defaultMessage",
"=",
"\"Update\"",
"/",
">",
"<",
"/EuiButton>",
"<",
"/EuiToolTip>) : (<EuiButton data-test-subj=\"visualizeEditorRenderButton\" disabled={!isDirty} fill iconType=\"play\" onClick={applyChanges} size=\"s\">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.sidebar.updateChartButtonLabel\"",
"defaultMessage",
"=",
"\"Update\"",
"/",
">",
"<",
"/EuiButton>)}",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>)}",
"{",
"enableAutoApply",
"&&",
"(",
"<",
"EuiToolTip",
"title",
"=",
"{",
"autoApplyEnabled",
"?",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.sidebar.autoApplyChangesOnLabel'",
",",
"{",
"defaultMessage",
":",
"'Auto apply is on'",
",",
"}",
")",
":",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.sidebar.autoApplyChangesOffLabel'",
",",
"{",
"defaultMessage",
":",
"'Auto apply is off'",
",",
"}",
")",
"}",
"content",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.sidebar.autoApplyChangesTooltip'",
",",
"{",
"defaultMessage",
":",
"'Auto updates the visualization on every change.'",
",",
"}",
")",
"}",
">",
"<",
"EuiButtonToggle",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.sidebar.autoApplyChangesAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Auto apply editor changes'",
",",
"}",
")",
"}",
"className",
"=",
"\"visEditorSidebar__autoApplyButton\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"visualizeEditorAutoButton\"",
"fill",
"=",
"{",
"autoApplyEnabled",
"}",
"iconType",
"=",
"\"refresh\"",
"isSelected",
"=",
"{",
"autoApplyEnabled",
"}",
"onChange",
"=",
"{",
"toggleAutoApply",
"}",
"size",
"=",
"\"s\"",
"isIconOnly",
"/",
">",
"<",
"/EuiToolTip>)}",
"<",
"/div>);",
"}",
"export",
"{",
"DefaultEditorControls",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661633 | [
"import",
"React",
",",
"{",
"useCallback",
",",
"useState",
"}",
"from",
"'react'",
";",
"import",
"{",
"EventEmitter",
"}",
"from",
"'events'",
";",
"import",
"{",
"EuiButton",
",",
"EuiButtonEmpty",
",",
"EuiButtonIcon",
",",
"EuiFlexGroup",
",",
"EuiFlexItem",
",",
"EuiIcon",
",",
"EuiPopover",
",",
"EuiPopoverTitle",
",",
"EuiText",
",",
"EuiTitle",
",",
"EuiToolTip",
",",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"Vis",
"}",
"from",
"'src/plugins/visualizations/public'",
";",
"import",
"{",
"SavedObject",
"}",
"from",
"'src/plugins/saved_objects/public'",
";",
"import",
"{",
"ApplicationStart",
"}",
"from",
"'../../../../../core/public'",
";",
"import",
"{",
"useOpenSearchDashboards",
"}",
"from",
"'../../../../opensearch_dashboards_react/public'",
";",
"interface",
"LinkedSearchProps",
"{",
"savedSearch",
":",
"SavedObject",
";",
"eventEmitter",
":",
"EventEmitter",
";",
"}",
"interface",
"SidebarTitleProps",
"{",
"isLinkedSearch",
":",
"boolean",
";",
"savedSearch",
"?",
":",
"SavedObject",
";",
"vis",
":",
"Vis",
";",
"eventEmitter",
":",
"EventEmitter",
";",
"}",
"export",
"function",
"LinkedSearch",
"(",
"{",
"savedSearch",
",",
"eventEmitter",
"}",
")",
"{",
"const",
"[",
"showPopover",
",",
"setShowPopover",
"]",
"=",
"useState",
"(",
"false",
")",
";",
"const",
"{",
"services",
":",
"{",
"application",
"}",
",",
"}",
"=",
"useOpenSearchDashboards",
"<",
"{",
"application",
":",
"ApplicationStart",
";",
"}",
">",
"(",
")",
";",
"const",
"closePopover",
"=",
"useCallback",
"(",
"(",
")",
"=>",
"setShowPopover",
"(",
"false",
")",
",",
"[",
"]",
")",
";",
"const",
"onClickButtonLink",
"=",
"useCallback",
"(",
"(",
")",
"=>",
"setShowPopover",
"(",
"(",
"v",
")",
"=>",
"!",
"v",
")",
",",
"[",
"]",
")",
";",
"const",
"onClickUnlikFromSavedSearch",
"=",
"useCallback",
"(",
"(",
")",
"=>",
"{",
"setShowPopover",
"(",
"false",
")",
";",
"eventEmitter",
".",
"emit",
"(",
"'unlinkFromSavedSearch'",
")",
";",
"}",
",",
"[",
"eventEmitter",
"]",
")",
";",
"const",
"onClickViewInDiscover",
"=",
"useCallback",
"(",
"(",
")",
"=>",
"{",
"application",
".",
"navigateToApp",
"(",
"'discover'",
",",
"{",
"path",
":",
"`#/view/${",
"savedSearch",
".",
"id",
"}`",
",",
"}",
")",
";",
"}",
",",
"[",
"application",
",",
"savedSearch",
".",
"id",
"]",
")",
";",
"const",
"linkButtonAriaLabel",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.sidebar.savedSearch.linkButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Link to saved search. Click to learn more or break link.'",
",",
"}",
")",
";",
"return",
"(",
"<",
"EuiFlexGroup",
"alignItems",
"=",
"\"center\"",
"className",
"=",
"\"visEditorSidebar__titleContainer visEditorSidebar__linkedSearch\"",
"gutterSize",
"=",
"\"xs\"",
"responsive",
"=",
"{",
"false",
"}",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiIcon",
"type",
"=",
"\"search\"",
"/",
">",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
"className",
"=",
"\"eui-textTruncate\"",
">",
"<",
"EuiTitle",
"size",
"=",
"\"xs\"",
"className",
"=",
"\"eui-textTruncate\"",
">",
"<",
"h2",
"title",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.sidebar.savedSearch.titleAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Saved search: {title}'",
",",
"values",
":",
"{",
"title",
":",
"savedSearch",
".",
"title",
",",
"}",
",",
"}",
")",
"}",
">",
"{",
"savedSearch",
".",
"title",
"}",
"<",
"/h2>",
"<",
"/EuiTitle>",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiPopover",
"anchorPosition",
"=",
"\"downRight\"",
"button",
"=",
"{",
"<",
"EuiToolTip",
"content",
"=",
"{",
"linkButtonAriaLabel",
"}",
">",
"<",
"EuiButtonIcon",
"aria",
"-",
"label",
"=",
"{",
"linkButtonAriaLabel",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"showUnlinkSavedSearchPopover\"",
"iconType",
"=",
"\"link\"",
"onClick",
"=",
"{",
"onClickButtonLink",
"}",
"/",
">",
"<",
"/EuiToolTip>} isOpen={showPopover} closePopover={closePopover} panelPaddingSize=\"s\">",
"<",
"EuiPopoverTitle",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.sidebar.savedSearch.popoverTitle\"",
"defaultMessage",
"=",
"\"Linked to saved search\"",
"/",
">",
"<",
"/EuiPopoverTitle>",
"<",
"div",
"style",
"=",
"{",
"{",
"width",
":",
"260",
"}",
"}",
">",
"<",
"EuiText",
"size",
"=",
"\"s\"",
">",
"<",
"p",
">",
"<",
"EuiButtonEmpty",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"viewSavedSearch\"",
"flush",
"=",
"\"left\"",
"onClick",
"=",
"{",
"onClickViewInDiscover",
"}",
"size",
"=",
"\"xs\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.sidebar.savedSearch.goToDiscoverButtonText\"",
"defaultMessage",
"=",
"\"View this search in Discover\"",
"/",
">",
"<",
"/EuiButtonEmpty>",
"<",
"/p>",
"<",
"p",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.sidebar.savedSearch.popoverHelpText\"",
"defaultMessage",
"=",
"\"Subsequent modifications to this saved search are reflected in the visualization. To disable automatic updates, remove the link.\"",
"/",
">",
"<",
"/p>",
"<",
"p",
">",
"<",
"EuiButton",
"color",
"=",
"\"danger\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"unlinkSavedSearch\"",
"fullWidth",
"onClick",
"=",
"{",
"onClickUnlikFromSavedSearch",
"}",
"size",
"=",
"\"s\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.sidebar.savedSearch.unlinkSavedSearchButtonText\"",
"defaultMessage",
"=",
"\"Remove link to saved search\"",
"/",
">",
"<",
"/EuiButton>",
"<",
"/p>",
"<",
"/EuiText>",
"<",
"/div>",
"<",
"/EuiPopover>",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>);",
"}",
"function",
"SidebarTitle",
"(",
"{",
"savedSearch",
",",
"vis",
",",
"isLinkedSearch",
",",
"eventEmitter",
"}",
")",
"{",
"return",
"isLinkedSearch",
"&&",
"savedSearch",
"?",
"(",
"<",
"LinkedSearch",
"savedSearch",
"=",
"{",
"savedSearch",
"}",
"eventEmitter",
"=",
"{",
"eventEmitter",
"}",
"/",
">",
")",
":",
"vis",
".",
"type",
".",
"options",
".",
"showIndexSelection",
"?",
"(",
"<",
"EuiTitle",
"size",
"=",
"\"xs\"",
"className",
"=",
"\"visEditorSidebar__titleContainer eui-textTruncate\"",
">",
"<",
"h2",
"title",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.sidebar.indexPatternAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Index pattern: {title}'",
",",
"values",
":",
"{",
"title",
":",
"vis",
".",
"data",
".",
"indexPattern",
"!",
".",
"title",
",",
"}",
",",
"}",
")",
"}",
">",
"{",
"vis",
".",
"data",
".",
"indexPattern",
"!",
".",
"title",
"}",
"<",
"/h2>",
"<",
"/EuiTitle>) : (<div className=\"visEditorSidebar__indexPatternPlaceholder\"/",
">",
")",
";",
"}",
"export",
"{",
"SidebarTitle",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661634 | [
"import",
"React",
",",
"{",
"useMemo",
",",
"useState",
",",
"useCallback",
",",
"KeyboardEventHandler",
",",
"useEffect",
"}",
"from",
"'react'",
";",
"import",
"{",
"isEqual",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"keys",
",",
"EuiButtonIcon",
",",
"EuiFlexGroup",
",",
"EuiFlexItem",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"EventEmitter",
"}",
"from",
"'events'",
";",
"import",
"{",
"Vis",
",",
"PersistedState",
",",
"VisualizeEmbeddableContract",
",",
"}",
"from",
"'src/plugins/visualizations/public'",
";",
"import",
"{",
"TimeRange",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"SavedObject",
"}",
"from",
"'src/plugins/saved_objects/public'",
";",
"import",
"{",
"DefaultEditorNavBar",
"}",
"from",
"'./navbar'",
";",
"import",
"{",
"DefaultEditorControls",
"}",
"from",
"'./controls'",
";",
"import",
"{",
"setStateParamValue",
",",
"useEditorReducer",
",",
"useEditorFormState",
",",
"discardChanges",
"}",
"from",
"'./state'",
";",
"import",
"{",
"DefaultEditorAggCommonProps",
"}",
"from",
"'../agg_common_props'",
";",
"import",
"{",
"SidebarTitle",
"}",
"from",
"'./sidebar_title'",
";",
"import",
"{",
"Schema",
"}",
"from",
"'../../schemas'",
";",
"import",
"{",
"useOptionTabs",
"}",
"from",
"'./use_option_tabs'",
";",
"interface",
"DefaultEditorSideBarProps",
"{",
"embeddableHandler",
":",
"VisualizeEmbeddableContract",
";",
"isCollapsed",
":",
"boolean",
";",
"onClickCollapse",
":",
"(",
")",
"=>",
"void",
";",
"uiState",
":",
"PersistedState",
";",
"vis",
":",
"Vis",
";",
"isLinkedSearch",
":",
"boolean",
";",
"eventEmitter",
":",
"EventEmitter",
";",
"savedSearch",
"?",
":",
"SavedObject",
";",
"timeRange",
":",
"TimeRange",
";",
"}",
"function",
"DefaultEditorSideBar",
"(",
"{",
"embeddableHandler",
",",
"isCollapsed",
",",
"onClickCollapse",
",",
"uiState",
",",
"vis",
",",
"isLinkedSearch",
",",
"eventEmitter",
",",
"savedSearch",
",",
"timeRange",
",",
"}",
")",
"{",
"const",
"[",
"isDirty",
",",
"setDirty",
"]",
"=",
"useState",
"(",
"false",
")",
";",
"const",
"[",
"state",
",",
"dispatch",
"]",
"=",
"useEditorReducer",
"(",
"vis",
",",
"eventEmitter",
")",
";",
"const",
"{",
"formState",
",",
"setTouched",
",",
"setValidity",
",",
"resetValidity",
"}",
"=",
"useEditorFormState",
"(",
")",
";",
"const",
"[",
"optionTabs",
",",
"setSelectedTab",
"]",
"=",
"useOptionTabs",
"(",
"vis",
")",
";",
"const",
"responseAggs",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"(",
"state",
".",
"data",
".",
"aggs",
"?",
"state",
".",
"data",
".",
"aggs",
".",
"getResponseAggs",
"(",
")",
":",
"[",
"]",
")",
",",
"[",
"state",
".",
"data",
".",
"aggs",
",",
"]",
")",
";",
"const",
"metricSchemas",
"=",
"(",
"vis",
".",
"type",
".",
"schemas",
".",
"metrics",
"||",
"[",
"]",
")",
".",
"map",
"(",
"(",
"s",
")",
"=>",
"s",
".",
"name",
")",
";",
"const",
"metricAggs",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"responseAggs",
".",
"filter",
"(",
"(",
"agg",
")",
"=>",
"agg",
".",
"schema",
"&&",
"metricSchemas",
".",
"includes",
"(",
"agg",
".",
"schema",
")",
")",
",",
"[",
"responseAggs",
",",
"metricSchemas",
"]",
")",
";",
"const",
"hasHistogramAgg",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"responseAggs",
".",
"some",
"(",
"(",
"agg",
")",
"=>",
"agg",
".",
"type",
".",
"name",
"===",
"'histogram'",
")",
",",
"[",
"responseAggs",
",",
"]",
")",
";",
"const",
"setStateValidity",
"=",
"useCallback",
"(",
"(",
"value",
")",
"=>",
"{",
"setValidity",
"(",
"'visOptions'",
",",
"value",
")",
";",
"}",
",",
"[",
"setValidity",
"]",
")",
";",
"const",
"setStateValue",
"=",
"useCallback",
"(",
"(",
"paramName",
",",
"value",
")",
"=>",
"{",
"const",
"shouldUpdate",
"=",
"!",
"isEqual",
"(",
"state",
".",
"params",
"[",
"paramName",
"]",
",",
"value",
")",
";",
"if",
"(",
"shouldUpdate",
")",
"{",
"dispatch",
"(",
"setStateParamValue",
"(",
"paramName",
",",
"value",
")",
")",
";",
"}",
"}",
",",
"[",
"dispatch",
",",
"state",
".",
"params",
"]",
")",
";",
"const",
"applyChanges",
"=",
"useCallback",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"formState",
".",
"invalid",
"||",
"!",
"isDirty",
")",
"{",
"setTouched",
"(",
"true",
")",
";",
"return",
";",
"}",
"vis",
".",
"setState",
"(",
"{",
"...",
"vis",
".",
"serialize",
"(",
")",
",",
"params",
":",
"state",
".",
"params",
",",
"data",
":",
"{",
"aggs",
":",
"state",
".",
"data",
".",
"aggs",
"?",
"(",
"state",
".",
"data",
".",
"aggs",
".",
"aggs",
".",
"map",
"(",
"(",
"agg",
")",
"=>",
"agg",
".",
"toJSON",
"(",
")",
")",
"as",
"any",
")",
":",
"[",
"]",
",",
"}",
",",
"}",
")",
";",
"embeddableHandler",
".",
"reload",
"(",
")",
";",
"eventEmitter",
".",
"emit",
"(",
"'dirtyStateChange'",
",",
"{",
"isDirty",
":",
"false",
",",
"}",
")",
";",
"setTouched",
"(",
"false",
")",
";",
"}",
",",
"[",
"vis",
",",
"state",
",",
"formState",
".",
"invalid",
",",
"setTouched",
",",
"isDirty",
",",
"eventEmitter",
",",
"embeddableHandler",
"]",
")",
";",
"const",
"onSubmit",
"=",
"useCallback",
"(",
"(",
"event",
")",
"=>",
"{",
"if",
"(",
"event",
".",
"ctrlKey",
"&&",
"event",
".",
"key",
"===",
"keys",
".",
"ENTER",
")",
"{",
"event",
".",
"preventDefault",
"(",
")",
";",
"event",
".",
"stopPropagation",
"(",
")",
";",
"applyChanges",
"(",
")",
";",
"}",
"}",
",",
"[",
"applyChanges",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"const",
"changeHandler",
"=",
"(",
"{",
"isDirty",
":",
"dirty",
"}",
")",
"=>",
"{",
"setDirty",
"(",
"dirty",
")",
";",
"if",
"(",
"!",
"dirty",
")",
"{",
"resetValidity",
"(",
")",
";",
"}",
"}",
";",
"eventEmitter",
".",
"on",
"(",
"'dirtyStateChange'",
",",
"changeHandler",
")",
";",
"return",
"(",
")",
"=>",
"{",
"eventEmitter",
".",
"off",
"(",
"'dirtyStateChange'",
",",
"changeHandler",
")",
";",
"}",
";",
"}",
",",
"[",
"resetValidity",
",",
"eventEmitter",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"const",
"resetHandler",
"=",
"(",
")",
"=>",
"dispatch",
"(",
"discardChanges",
"(",
"vis",
")",
")",
";",
"eventEmitter",
".",
"on",
"(",
"'updateEditor'",
",",
"resetHandler",
")",
";",
"return",
"(",
")",
"=>",
"{",
"eventEmitter",
".",
"off",
"(",
"'updateEditor'",
",",
"resetHandler",
")",
";",
"}",
";",
"}",
",",
"[",
"dispatch",
",",
"vis",
",",
"eventEmitter",
"]",
")",
";",
"const",
"dataTabProps",
"=",
"{",
"dispatch",
",",
"formIsTouched",
":",
"formState",
".",
"touched",
",",
"metricAggs",
",",
"state",
",",
"schemas",
":",
"vis",
".",
"type",
".",
"schemas",
",",
"setValidity",
",",
"setTouched",
",",
"setStateValue",
",",
"}",
";",
"const",
"optionTabProps",
"=",
"{",
"aggs",
":",
"state",
".",
"data",
".",
"aggs",
"!",
",",
"hasHistogramAgg",
",",
"stateParams",
":",
"state",
".",
"params",
",",
"vis",
",",
"uiState",
",",
"setValue",
":",
"setStateValue",
",",
"setValidity",
":",
"setStateValidity",
",",
"setTouched",
",",
"}",
";",
"return",
"(",
"<",
">",
"<",
"EuiFlexGroup",
"className",
"=",
"\"visEditorSidebar\"",
"direction",
"=",
"\"column\"",
"justifyContent",
"=",
"\"spaceBetween\"",
"gutterSize",
"=",
"\"none\"",
"responsive",
"=",
"{",
"false",
"}",
">",
"<",
"EuiFlexItem",
"className",
"=",
"\"visEditorSidebar__formWrapper\"",
">",
"<",
"form",
"className",
"=",
"\"visEditorSidebar__form\"",
"name",
"=",
"\"visualizeEditor\"",
"onKeyDownCapture",
"=",
"{",
"onSubmit",
"}",
">",
"{",
"vis",
".",
"type",
".",
"requiresSearch",
"&&",
"(",
"<",
"SidebarTitle",
"isLinkedSearch",
"=",
"{",
"isLinkedSearch",
"}",
"savedSearch",
"=",
"{",
"savedSearch",
"}",
"vis",
"=",
"{",
"vis",
"}",
"eventEmitter",
"=",
"{",
"eventEmitter",
"}",
"/",
">",
")",
"}",
"{",
"optionTabs",
".",
"length",
">",
"1",
"&&",
"(",
"<",
"DefaultEditorNavBar",
"optionTabs",
"=",
"{",
"optionTabs",
"}",
"setSelectedTab",
"=",
"{",
"setSelectedTab",
"}",
"/",
">",
")",
"}",
"{",
"optionTabs",
".",
"map",
"(",
"(",
"{",
"editor",
":",
"Editor",
",",
"name",
",",
"isSelected",
"=",
"false",
"}",
")",
"=>",
"(",
"<",
"div",
"key",
"=",
"{",
"name",
"}",
"className",
"=",
"{",
"`visEditorSidebar__config ${",
"isSelected",
"?",
"''",
":",
"'visEditorSidebar__config-isHidden'",
"}`",
"}",
">",
"<",
"Editor",
"isTabSelected",
"=",
"{",
"isSelected",
"}",
"{",
"...",
"(",
"name",
"===",
"'data'",
"?",
"dataTabProps",
":",
"optionTabProps",
")",
"}",
"timeRange",
"=",
"{",
"timeRange",
"}",
"/",
">",
"<",
"/div>))}",
"<",
"/form>",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"DefaultEditorControls",
"applyChanges",
"=",
"{",
"applyChanges",
"}",
"dispatch",
"=",
"{",
"dispatch",
"}",
"isDirty",
"=",
"{",
"isDirty",
"}",
"isTouched",
"=",
"{",
"formState",
".",
"touched",
"}",
"isInvalid",
"=",
"{",
"formState",
".",
"invalid",
"}",
"vis",
"=",
"{",
"vis",
"}",
"/",
">",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>",
"<",
"EuiButtonIcon",
"aria",
"-",
"expanded",
"=",
"{",
"!",
"isCollapsed",
"}",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.sidebar.collapseButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Toggle sidebar'",
",",
"}",
")",
"}",
"className",
"=",
"\"visEditor__collapsibleSidebarButton\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"collapseSideBarButton\"",
"color",
"=",
"\"text\"",
"iconType",
"=",
"{",
"isCollapsed",
"?",
"'menuLeft'",
":",
"'menuRight'",
"}",
"onClick",
"=",
"{",
"onClickCollapse",
"}",
"/",
">",
"<",
"/>);",
"}",
"export",
"{",
"DefaultEditorSideBar",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661635 | [
"export",
"enum",
"DefaultEditorSize",
"{",
"SMALL",
"=",
"'small'",
",",
"MEDIUM",
"=",
"'medium'",
",",
"LARGE",
"=",
"'large'",
"}",
"export",
"const",
"getInitialWidth",
"=",
"(",
"size",
")",
"=>",
"{",
"switch",
"(",
"size",
")",
"{",
"case",
"DefaultEditorSize",
".",
"SMALL",
":",
"return",
"15",
";",
"case",
"DefaultEditorSize",
".",
"LARGE",
":",
"return",
"50",
";",
"case",
"DefaultEditorSize",
".",
"MEDIUM",
":",
"default",
":",
"return",
"30",
";",
"}",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
26185,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661636 | [
"import",
"'./index.scss'",
";",
"import",
"'brace/mode/json'",
";",
"import",
"React",
",",
"{",
"useEffect",
",",
"useRef",
",",
"useState",
",",
"useCallback",
"}",
"from",
"'react'",
";",
"import",
"{",
"EventEmitter",
"}",
"from",
"'events'",
";",
"import",
"{",
"EditorRenderProps",
"}",
"from",
"'src/plugins/visualize/public'",
";",
"import",
"{",
"Vis",
",",
"VisualizeEmbeddableContract",
"}",
"from",
"'src/plugins/visualizations/public'",
";",
"import",
"{",
"OpenSearchDashboardsContextProvider",
",",
"PanelsContainer",
",",
"Panel",
",",
"}",
"from",
"'../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"Storage",
"}",
"from",
"'../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"DefaultEditorSideBar",
"}",
"from",
"'./components/sidebar'",
";",
"import",
"{",
"getInitialWidth",
"}",
"from",
"'./editor_size'",
";",
"const",
"localStorage",
"=",
"new",
"Storage",
"(",
"window",
".",
"localStorage",
")",
";",
"function",
"DefaultEditor",
"(",
"{",
"core",
",",
"data",
",",
"vis",
",",
"uiState",
",",
"timeRange",
",",
"filters",
",",
"query",
",",
"embeddableHandler",
",",
"eventEmitter",
",",
"linked",
",",
"savedSearch",
",",
"}",
")",
"{",
"const",
"visRef",
"=",
"useRef",
"<",
"HTMLDivElement",
">",
"(",
"null",
")",
";",
"const",
"[",
"isCollapsed",
",",
"setIsCollapsed",
"]",
"=",
"useState",
"(",
"false",
")",
";",
"const",
"onClickCollapse",
"=",
"useCallback",
"(",
"(",
")",
"=>",
"{",
"setIsCollapsed",
"(",
"(",
"value",
")",
"=>",
"!",
"value",
")",
";",
"}",
",",
"[",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"visRef",
".",
"current",
")",
"{",
"return",
";",
"}",
"embeddableHandler",
".",
"render",
"(",
"visRef",
".",
"current",
")",
";",
"setTimeout",
"(",
"(",
")",
"=>",
"{",
"eventEmitter",
".",
"emit",
"(",
"'embeddableRendered'",
")",
";",
"}",
")",
";",
"return",
"(",
")",
"=>",
"embeddableHandler",
".",
"destroy",
"(",
")",
";",
"}",
",",
"[",
"embeddableHandler",
",",
"eventEmitter",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"embeddableHandler",
".",
"updateInput",
"(",
"{",
"timeRange",
",",
"filters",
",",
"query",
",",
"}",
")",
";",
"}",
",",
"[",
"embeddableHandler",
",",
"timeRange",
",",
"filters",
",",
"query",
"]",
")",
";",
"const",
"editorInitialWidth",
"=",
"getInitialWidth",
"(",
"vis",
".",
"type",
".",
"editorConfig",
".",
"defaultSize",
")",
";",
"return",
"(",
"<",
"core",
".",
"i18n",
".",
"Context",
">",
"<",
"OpenSearchDashboardsContextProvider",
"services",
"=",
"{",
"{",
"appName",
":",
"'vis_default_editor'",
",",
"storage",
":",
"localStorage",
",",
"data",
",",
"...",
"core",
",",
"}",
"}",
">",
"<",
"PanelsContainer",
"className",
"=",
"\"visEditor--default\"",
"resizerClassName",
"=",
"{",
"`visEditor__resizer ${",
"isCollapsed",
"?",
"'visEditor__resizer-isHidden'",
":",
"''",
"}`",
"}",
">",
"<",
"Panel",
"className",
"=",
"\"visEditor__visualization\"",
"initialWidth",
"=",
"{",
"100",
"-",
"editorInitialWidth",
"}",
">",
"<",
"div",
"className",
"=",
"\"visEditor__canvas\"",
"ref",
"=",
"{",
"visRef",
"}",
"data",
"-",
"shared",
"-",
"items",
"-",
"container",
"/",
">",
"<",
"/Panel>",
"<",
"Panel",
"className",
"=",
"{",
"`visEditor__collapsibleSidebar ${",
"isCollapsed",
"?",
"'visEditor__collapsibleSidebar-isClosed'",
":",
"''",
"}`",
"}",
"initialWidth",
"=",
"{",
"editorInitialWidth",
"}",
">",
"<",
"DefaultEditorSideBar",
"embeddableHandler",
"=",
"{",
"embeddableHandler",
"}",
"isCollapsed",
"=",
"{",
"isCollapsed",
"}",
"onClickCollapse",
"=",
"{",
"onClickCollapse",
"}",
"vis",
"=",
"{",
"vis",
"}",
"uiState",
"=",
"{",
"uiState",
"}",
"isLinkedSearch",
"=",
"{",
"linked",
"}",
"savedSearch",
"=",
"{",
"savedSearch",
"}",
"timeRange",
"=",
"{",
"timeRange",
"}",
"eventEmitter",
"=",
"{",
"eventEmitter",
"}",
"/",
">",
"<",
"/Panel>",
"<",
"/PanelsContainer>",
"<",
"/OpenSearchDashboardsContextProvider>",
"<",
"/core.i18n.Context>);",
"}",
"export",
"{",
"DefaultEditor",
"as",
"default",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
470,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661637 | [
"import",
"React",
",",
"{",
"Suspense",
",",
"lazy",
"}",
"from",
"'react'",
";",
"import",
"{",
"render",
",",
"unmountComponentAtNode",
"}",
"from",
"'react-dom'",
";",
"import",
"{",
"EventEmitter",
"}",
"from",
"'events'",
";",
"import",
"{",
"EuiErrorBoundary",
",",
"EuiLoadingChart",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"EditorRenderProps",
"}",
"from",
"'src/plugins/visualize/public'",
";",
"import",
"{",
"Vis",
",",
"VisualizeEmbeddableContract",
"}",
"from",
"'src/plugins/visualizations/public'",
";",
"const",
"DefaultEditor",
"=",
"lazy",
"(",
"(",
")",
"=>",
"import",
"(",
"'./default_editor'",
")",
")",
";",
"class",
"DefaultEditorController",
"{",
"constructor",
"(",
"private",
"el",
",",
"private",
"vis",
",",
"private",
"eventEmitter",
",",
"private",
"embeddableHandler",
")",
"{",
"}",
"render",
"(",
"props",
")",
"{",
"render",
"(",
"<",
"EuiErrorBoundary",
">",
"<",
"Suspense",
"fallback",
"=",
"{",
"<",
"div",
"style",
"=",
"{",
"{",
"display",
":",
"'flex'",
",",
"flex",
":",
"'1 1 auto'",
",",
"justifyContent",
":",
"'center'",
",",
"alignItems",
":",
"'center'",
",",
"}",
"}",
">",
"<",
"EuiLoadingChart",
"size",
"=",
"\"xl\"",
"mono",
"/",
">",
"<",
"/div>}>",
"<",
"DefaultEditor",
"eventEmitter",
"=",
"{",
"this",
".",
"eventEmitter",
"}",
"embeddableHandler",
"=",
"{",
"this",
".",
"embeddableHandler",
"}",
"vis",
"=",
"{",
"this",
".",
"vis",
"}",
"{",
"...",
"props",
"}",
"/>",
"<",
"/Suspense>",
"<",
"/EuiErrorBoundary>, this.el);",
"}",
"destroy",
"(",
")",
"{",
"unmountComponentAtNode",
"(",
"this",
".",
"el",
")",
";",
"}",
"}",
"export",
"{",
"DefaultEditorController",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
15,
null,
null,
1742,
null,
null,
400,
null,
null,
21811,
null,
null,
null,
4,
null,
12652,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661638 | [
"export",
"{",
"DefaultEditorController",
"}",
"from",
"'./default_editor_controller'",
";",
"export",
"{",
"useValidation",
"}",
"from",
"'./components/controls/utils'",
";",
"export",
"{",
"RangesParamEditor",
",",
"RangeValues",
"}",
"from",
"'./components/controls/ranges'",
";",
"export",
"*",
"from",
"'./editor_size'",
";",
"export",
"*",
"from",
"'./vis_options_props'",
";",
"export",
"*",
"from",
"'./utils'",
";",
"export",
"{",
"ISchemas",
",",
"Schemas",
",",
"Schema",
"}",
"from",
"'./schemas'",
";",
"/** dummy plugin, we just want visDefaultEditor to have its own bundle */",
"export",
"function",
"plugin",
"(",
")",
"{",
"return",
"new",
"(",
"class",
"VisDefaultEditor",
"{",
"setup",
"(",
")",
"{",
"}",
"start",
"(",
")",
"{",
"}",
"}",
")",
"(",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26186,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661639 | [
"import",
"{",
"EventEmitter",
"}",
"from",
"'events'",
";",
"import",
"{",
"set",
"}",
"from",
"'@elastic/safer-lodash-set'",
";",
"import",
"{",
"isPlainObject",
",",
"cloneDeep",
",",
"get",
",",
"isEqual",
",",
"isString",
",",
"merge",
",",
"mergeWith",
",",
"toPath",
"}",
"from",
"'lodash'",
";",
"function",
"prepSetParams",
"(",
"key",
",",
"value",
",",
"path",
")",
"{",
"if",
"(",
"value",
"===",
"undefined",
"&&",
"(",
"isPlainObject",
"(",
"key",
")",
"||",
"path",
".",
"length",
">",
"0",
")",
")",
"{",
"value",
"=",
"key",
";",
"key",
"=",
"undefined",
";",
"}",
"return",
"{",
"value",
":",
"cloneDeep",
"(",
"value",
")",
",",
"key",
",",
"}",
";",
"}",
"type",
"PersistedStateKey",
"=",
"string",
"|",
"string",
"[",
"]",
"|",
"undefined",
";",
"type",
"PersistedStatePath",
"=",
"string",
"|",
"string",
"[",
"]",
";",
"export",
"class",
"PersistedState",
"extends",
"EventEmitter",
"{",
"private",
"readonly",
"_path",
":",
"PersistedStatePath",
";",
"private",
"readonly",
"_initialized",
":",
"boolean",
";",
"private",
"_changedState",
":",
"any",
";",
"private",
"_defaultState",
":",
"any",
";",
"private",
"_mergedState",
":",
"any",
";",
"constructor",
"(",
"value",
"?",
",",
"path",
"?",
")",
"{",
"super",
"(",
")",
";",
"this",
".",
"_path",
"=",
"this",
".",
"setPath",
"(",
"path",
")",
";",
"if",
"(",
"!",
"this",
".",
"_path",
".",
"length",
"&&",
"value",
"&&",
"!",
"isPlainObject",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"'State value must be a plain object'",
")",
";",
"}",
"value",
"=",
"value",
"||",
"this",
".",
"getDefault",
"(",
")",
";",
"this",
".",
"set",
"(",
"value",
")",
";",
"this",
".",
"_initialized",
"=",
"true",
";",
"}",
"get",
"(",
"key",
"?",
",",
"defaultValue",
"?",
")",
"{",
"if",
"(",
"!",
"this",
".",
"hasPath",
"(",
")",
"&&",
"key",
"===",
"undefined",
")",
"{",
"return",
"this",
".",
"_mergedState",
";",
"}",
"return",
"cloneDeep",
"(",
"get",
"(",
"this",
".",
"_mergedState",
",",
"this",
".",
"getIndex",
"(",
"key",
"||",
"''",
")",
",",
"defaultValue",
")",
")",
";",
"}",
"set",
"(",
"key",
",",
"value",
"?",
")",
"{",
"const",
"params",
"=",
"prepSetParams",
"(",
"key",
",",
"value",
",",
"this",
".",
"_path",
")",
";",
"const",
"val",
"=",
"this",
".",
"setValue",
"(",
"params",
".",
"key",
",",
"params",
".",
"value",
")",
";",
"this",
".",
"emit",
"(",
"'set'",
")",
";",
"return",
"val",
";",
"}",
"setSilent",
"(",
"key",
",",
"value",
"?",
")",
"{",
"const",
"params",
"=",
"prepSetParams",
"(",
"key",
",",
"value",
",",
"this",
".",
"_path",
")",
";",
"if",
"(",
"params",
".",
"key",
"||",
"params",
".",
"value",
")",
"{",
"return",
"this",
".",
"setValue",
"(",
"params",
".",
"key",
",",
"params",
".",
"value",
",",
"true",
")",
";",
"}",
"}",
"clearAllKeys",
"(",
")",
"{",
"Object",
".",
"getOwnPropertyNames",
"(",
"this",
".",
"_changedState",
")",
".",
"forEach",
"(",
"(",
"key",
")",
"=>",
"{",
"this",
".",
"set",
"(",
"key",
",",
"null",
")",
";",
"}",
")",
";",
"}",
"reset",
"(",
"path",
")",
"{",
"const",
"keyPath",
"=",
"this",
".",
"getIndex",
"(",
"path",
")",
";",
"const",
"origValue",
"=",
"get",
"(",
"this",
".",
"_defaultState",
",",
"keyPath",
")",
";",
"const",
"currentValue",
"=",
"get",
"(",
"this",
".",
"_mergedState",
",",
"keyPath",
")",
";",
"if",
"(",
"origValue",
"===",
"undefined",
")",
"{",
"this",
".",
"cleanPath",
"(",
"path",
",",
"this",
".",
"_mergedState",
")",
";",
"}",
"else",
"{",
"set",
"(",
"this",
".",
"_mergedState",
",",
"keyPath",
",",
"origValue",
")",
";",
"}",
"this",
".",
"cleanPath",
"(",
"path",
",",
"this",
".",
"_changedState",
")",
";",
"if",
"(",
"!",
"isEqual",
"(",
"currentValue",
",",
"origValue",
")",
")",
"this",
".",
"emit",
"(",
"'change'",
")",
";",
"}",
"getChanges",
"(",
")",
"{",
"return",
"cloneDeep",
"(",
"this",
".",
"_changedState",
")",
";",
"}",
"toJSON",
"(",
")",
"{",
"return",
"this",
".",
"get",
"(",
")",
";",
"}",
"toString",
"(",
")",
"{",
"return",
"JSON",
".",
"stringify",
"(",
"this",
".",
"toJSON",
"(",
")",
")",
";",
"}",
"fromString",
"(",
"input",
")",
"{",
"return",
"this",
".",
"set",
"(",
"JSON",
".",
"parse",
"(",
"input",
")",
")",
";",
"}",
"private",
"getIndex",
"(",
"key",
")",
"{",
"if",
"(",
"key",
"===",
"undefined",
")",
"return",
"this",
".",
"_path",
";",
"return",
"[",
"...",
"(",
"this",
".",
"_path",
"||",
"[",
"]",
")",
",",
"...",
"toPath",
"(",
"key",
")",
"]",
";",
"}",
"private",
"getPartialIndex",
"(",
"key",
")",
"{",
"const",
"keyPath",
"=",
"this",
".",
"getIndex",
"(",
"key",
")",
";",
"return",
"keyPath",
".",
"slice",
"(",
"this",
".",
"_path",
".",
"length",
")",
";",
"}",
"private",
"cleanPath",
"(",
"path",
",",
"stateTree",
")",
"{",
"const",
"partialPath",
"=",
"this",
".",
"getPartialIndex",
"(",
"path",
")",
";",
"let",
"remove",
"=",
"true",
";",
"if",
"(",
"Array",
".",
"isArray",
"(",
"partialPath",
")",
")",
"{",
"while",
"(",
"partialPath",
".",
"length",
">",
"0",
")",
"{",
"const",
"lastKey",
"=",
"partialPath",
".",
"splice",
"(",
"partialPath",
".",
"length",
"-",
"1",
",",
"1",
")",
"[",
"0",
"]",
";",
"const",
"statePath",
"=",
"[",
"...",
"this",
".",
"_path",
",",
"partialPath",
"]",
";",
"const",
"stateVal",
"=",
"statePath",
".",
"length",
">",
"0",
"?",
"get",
"(",
"stateTree",
",",
"statePath",
"as",
"string",
"[",
"]",
")",
":",
"stateTree",
";",
"if",
"(",
"!",
"isPlainObject",
"(",
"stateVal",
")",
")",
"return",
";",
"if",
"(",
"remove",
")",
"delete",
"stateVal",
"[",
"lastKey",
"]",
";",
"if",
"(",
"Object",
".",
"keys",
"(",
"stateVal",
")",
".",
"length",
">",
"0",
")",
"remove",
"=",
"false",
";",
"}",
"}",
"}",
"private",
"getDefault",
"(",
")",
"{",
"return",
"this",
".",
"hasPath",
"(",
")",
"?",
"undefined",
":",
"{",
"}",
";",
"}",
"private",
"setPath",
"(",
"path",
"?",
")",
"{",
"if",
"(",
"Array",
".",
"isArray",
"(",
"path",
")",
")",
"{",
"return",
"path",
";",
"}",
"if",
"(",
"isString",
"(",
"path",
")",
")",
"{",
"return",
"[",
"...",
"this",
".",
"getIndex",
"(",
"path",
")",
"]",
";",
"}",
"return",
"[",
"]",
";",
"}",
"private",
"hasPath",
"(",
")",
"{",
"return",
"this",
".",
"_path",
".",
"length",
">",
"0",
";",
"}",
"private",
"setValue",
"(",
"key",
",",
"value",
",",
"silent",
"=",
"false",
")",
"{",
"const",
"self",
"=",
"this",
";",
"let",
"stateChanged",
"=",
"false",
";",
"const",
"initialState",
"=",
"!",
"this",
".",
"_initialized",
";",
"const",
"keyPath",
"=",
"this",
".",
"getIndex",
"(",
"key",
")",
";",
"const",
"hasKeyPath",
"=",
"keyPath",
".",
"length",
">",
"0",
";",
"if",
"(",
"initialState",
")",
"{",
"this",
".",
"_changedState",
"=",
"{",
"}",
";",
"if",
"(",
"!",
"this",
".",
"hasPath",
"(",
")",
"&&",
"key",
"===",
"undefined",
")",
"this",
".",
"_defaultState",
"=",
"value",
";",
"else",
"this",
".",
"_defaultState",
"=",
"set",
"(",
"{",
"}",
",",
"keyPath",
",",
"value",
")",
";",
"}",
"if",
"(",
"!",
"initialState",
")",
"{",
"if",
"(",
"!",
"this",
".",
"hasPath",
"(",
")",
"&&",
"key",
"===",
"undefined",
")",
"{",
"stateChanged",
"=",
"!",
"isEqual",
"(",
"this",
".",
"_changedState",
",",
"value",
")",
";",
"this",
".",
"_changedState",
"=",
"value",
";",
"this",
".",
"_mergedState",
"=",
"cloneDeep",
"(",
"value",
")",
";",
"}",
"else",
"{",
"const",
"curVal",
"=",
"hasKeyPath",
"?",
"this",
".",
"get",
"(",
"keyPath",
")",
":",
"this",
".",
"_mergedState",
";",
"stateChanged",
"=",
"!",
"isEqual",
"(",
"curVal",
",",
"value",
")",
";",
"if",
"(",
"Array",
".",
"isArray",
"(",
"get",
"(",
"this",
".",
"_mergedState",
",",
"keyPath",
")",
")",
")",
"{",
"if",
"(",
"hasKeyPath",
")",
"{",
"set",
"(",
"this",
".",
"_mergedState",
",",
"keyPath",
",",
"undefined",
")",
";",
"}",
"else",
"{",
"this",
".",
"_mergedState",
"=",
"undefined",
";",
"}",
"}",
"if",
"(",
"hasKeyPath",
")",
"{",
"set",
"(",
"this",
".",
"_changedState",
",",
"keyPath",
",",
"value",
")",
";",
"}",
"else",
"{",
"this",
".",
"_changedState",
"=",
"isPlainObject",
"(",
"value",
")",
"?",
"value",
":",
"{",
"}",
";",
"}",
"}",
"}",
"const",
"targetObj",
"=",
"this",
".",
"_mergedState",
"||",
"cloneDeep",
"(",
"this",
".",
"_defaultState",
")",
";",
"const",
"sourceObj",
"=",
"merge",
"(",
"{",
"}",
",",
"this",
".",
"_changedState",
")",
";",
"const",
"mergeMethod",
"=",
"function",
"(",
"targetValue",
",",
"sourceValue",
",",
"mergeKey",
")",
"{",
"if",
"(",
"!",
"initialState",
"&&",
"isEqual",
"(",
"keyPath",
",",
"self",
".",
"getIndex",
"(",
"mergeKey",
")",
")",
")",
"{",
"return",
"sourceValue",
"===",
"undefined",
"?",
"targetValue",
":",
"sourceValue",
";",
"}",
"}",
";",
"this",
".",
"_mergedState",
"=",
"mergeWith",
"(",
"targetObj",
",",
"sourceObj",
",",
"mergeMethod",
")",
";",
"if",
"(",
"isEqual",
"(",
"this",
".",
"_mergedState",
",",
"this",
".",
"_defaultState",
")",
")",
"this",
".",
"_changedState",
"=",
"{",
"}",
";",
"if",
"(",
"!",
"silent",
"&&",
"stateChanged",
")",
"this",
".",
"emit",
"(",
"'change'",
",",
"key",
")",
";",
"return",
"this",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
3514,
null,
null,
null,
5044,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5044,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3514,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3514,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3514,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
5044,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3514,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3514,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
5044,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
5044,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3514,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661640 | [
"import",
"_",
"from",
"'lodash'",
";",
"import",
"{",
"SavedObjectAttributes",
",",
"SavedObjectsClientContract",
"}",
"from",
"'../../../../core/public'",
";",
"import",
"{",
"SavedObjectLoader",
"}",
"from",
"'../../../saved_objects/public'",
";",
"import",
"{",
"VisTypeAlias",
"}",
"from",
"'../vis_types'",
";",
"import",
"{",
"VisualizationsAppExtension",
"}",
"from",
"'../vis_types/vis_type_alias_registry'",
";",
"/**\n * Search for visualizations and convert them into a list display-friendly format.\n */",
"export",
"async",
"function",
"findListItems",
"(",
"{",
"visTypes",
",",
"search",
",",
"size",
",",
"savedObjectsClient",
",",
"mapSavedObjectApiHits",
",",
"}",
")",
"{",
"const",
"extensions",
"=",
"visTypes",
".",
"map",
"(",
"(",
"v",
")",
"=>",
"v",
".",
"appExtensions",
"?.",
"visualizations",
")",
".",
"filter",
"(",
"Boolean",
")",
"as",
"VisualizationsAppExtension",
"[",
"]",
";",
"const",
"extensionByType",
"=",
"extensions",
".",
"reduce",
"(",
"(",
"acc",
",",
"m",
")",
"=>",
"{",
"return",
"m",
"!",
".",
"docTypes",
".",
"reduce",
"(",
"(",
"_acc",
",",
"type",
")",
"=>",
"{",
"acc",
"[",
"type",
"]",
"=",
"m",
";",
"return",
"acc",
";",
"}",
",",
"acc",
")",
";",
"}",
",",
"{",
"}",
"as",
"{",
"[",
"visType",
"]",
":",
"VisualizationsAppExtension",
";",
"}",
")",
";",
"const",
"searchOption",
"=",
"(",
"field",
",",
"...",
"defaults",
")",
"=>",
"_",
"(",
"extensions",
")",
".",
"map",
"(",
"field",
")",
".",
"concat",
"(",
"defaults",
")",
".",
"compact",
"(",
")",
".",
"flatten",
"(",
")",
".",
"uniq",
"(",
")",
".",
"value",
"(",
")",
"as",
"string",
"[",
"]",
";",
"const",
"searchOptions",
"=",
"{",
"type",
":",
"searchOption",
"(",
"'docTypes'",
",",
"'visualization'",
")",
",",
"searchFields",
":",
"searchOption",
"(",
"'searchFields'",
",",
"'title^3'",
",",
"'description'",
")",
",",
"search",
":",
"search",
"?",
"`${",
"search",
"}*`",
":",
"undefined",
",",
"perPage",
":",
"size",
",",
"page",
":",
"1",
",",
"defaultSearchOperator",
":",
"'AND'",
"as",
"'AND'",
",",
"}",
";",
"const",
"{",
"total",
",",
"savedObjects",
"}",
"=",
"await",
"savedObjectsClient",
".",
"find",
"<",
"SavedObjectAttributes",
">",
"(",
"searchOptions",
")",
";",
"return",
"{",
"total",
",",
"hits",
":",
"savedObjects",
".",
"map",
"(",
"(",
"savedObject",
")",
"=>",
"{",
"const",
"config",
"=",
"extensionByType",
"[",
"savedObject",
".",
"type",
"]",
";",
"if",
"(",
"config",
")",
"{",
"return",
"config",
".",
"toListItem",
"(",
"savedObject",
")",
";",
"}",
"else",
"{",
"return",
"mapSavedObjectApiHits",
"(",
"savedObject",
")",
";",
"}",
"}",
")",
",",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661641 | [
"import",
"{",
"SavedObjectAttribute",
",",
"SavedObjectAttributes",
",",
"SavedObjectReference",
",",
"}",
"from",
"'../../../../core/public'",
";",
"import",
"{",
"VisSavedObject",
"}",
"from",
"'../types'",
";",
"import",
"{",
"extractSearchSourceReferences",
",",
"injectSearchSourceReferences",
",",
"SearchSourceFields",
",",
"}",
"from",
"'../../../data/public'",
";",
"export",
"function",
"extractReferences",
"(",
"{",
"attributes",
",",
"references",
"=",
"[",
"]",
",",
"}",
")",
"{",
"const",
"updatedAttributes",
"=",
"{",
"...",
"attributes",
"}",
";",
"const",
"updatedReferences",
"=",
"[",
"...",
"references",
"]",
";",
"if",
"(",
"updatedAttributes",
".",
"searchSourceFields",
")",
"{",
"const",
"[",
"searchSource",
",",
"searchSourceReferences",
"]",
"=",
"extractSearchSourceReferences",
"(",
"updatedAttributes",
".",
"searchSourceFields",
"as",
"SearchSourceFields",
")",
";",
"updatedAttributes",
".",
"searchSourceFields",
"=",
"searchSource",
"as",
"SavedObjectAttribute",
";",
"searchSourceReferences",
".",
"forEach",
"(",
"(",
"r",
")",
"=>",
"updatedReferences",
".",
"push",
"(",
"r",
")",
")",
";",
"}",
"if",
"(",
"updatedAttributes",
".",
"savedSearchId",
")",
"{",
"updatedReferences",
".",
"push",
"(",
"{",
"name",
":",
"'search_0'",
",",
"type",
":",
"'search'",
",",
"id",
":",
"String",
"(",
"updatedAttributes",
".",
"savedSearchId",
")",
",",
"}",
")",
";",
"delete",
"updatedAttributes",
".",
"savedSearchId",
";",
"updatedAttributes",
".",
"savedSearchRefName",
"=",
"'search_0'",
";",
"}",
"if",
"(",
"updatedAttributes",
".",
"visState",
")",
"{",
"const",
"visState",
"=",
"JSON",
".",
"parse",
"(",
"String",
"(",
"updatedAttributes",
".",
"visState",
")",
")",
";",
"const",
"controls",
"=",
"(",
"visState",
".",
"params",
"&&",
"visState",
".",
"params",
".",
"controls",
")",
"||",
"[",
"]",
";",
"controls",
".",
"forEach",
"(",
"(",
"control",
",",
"i",
")",
"=>",
"{",
"if",
"(",
"!",
"control",
".",
"indexPattern",
")",
"{",
"return",
";",
"}",
"control",
".",
"indexPatternRefName",
"=",
"`control_${",
"i",
"}_index_pattern`",
";",
"updatedReferences",
".",
"push",
"(",
"{",
"name",
":",
"control",
".",
"indexPatternRefName",
",",
"type",
":",
"'index-pattern'",
",",
"id",
":",
"control",
".",
"indexPattern",
",",
"}",
")",
";",
"delete",
"control",
".",
"indexPattern",
";",
"}",
")",
";",
"updatedAttributes",
".",
"visState",
"=",
"JSON",
".",
"stringify",
"(",
"visState",
")",
";",
"}",
"return",
"{",
"references",
":",
"updatedReferences",
",",
"attributes",
":",
"updatedAttributes",
",",
"}",
";",
"}",
"export",
"function",
"injectReferences",
"(",
"savedObject",
",",
"references",
")",
"{",
"if",
"(",
"savedObject",
".",
"searchSourceFields",
")",
"{",
"savedObject",
".",
"searchSourceFields",
"=",
"injectSearchSourceReferences",
"(",
"savedObject",
".",
"searchSourceFields",
"as",
"any",
",",
"references",
")",
";",
"}",
"if",
"(",
"savedObject",
".",
"savedSearchRefName",
")",
"{",
"const",
"savedSearchReference",
"=",
"references",
".",
"find",
"(",
"(",
"reference",
")",
"=>",
"reference",
".",
"name",
"===",
"savedObject",
".",
"savedSearchRefName",
")",
";",
"if",
"(",
"!",
"savedSearchReference",
")",
"{",
"throw",
"new",
"Error",
"(",
"`Could not find saved search reference \"${",
"savedObject",
".",
"savedSearchRefName",
"}\"`",
")",
";",
"}",
"savedObject",
".",
"savedSearchId",
"=",
"savedSearchReference",
".",
"id",
";",
"delete",
"savedObject",
".",
"savedSearchRefName",
";",
"}",
"if",
"(",
"savedObject",
".",
"visState",
")",
"{",
"const",
"controls",
"=",
"(",
"savedObject",
".",
"visState",
".",
"params",
"&&",
"savedObject",
".",
"visState",
".",
"params",
".",
"controls",
")",
"||",
"[",
"]",
";",
"controls",
".",
"forEach",
"(",
"(",
"control",
")",
"=>",
"{",
"if",
"(",
"!",
"control",
".",
"indexPatternRefName",
")",
"{",
"return",
";",
"}",
"const",
"reference",
"=",
"references",
".",
"find",
"(",
"(",
"ref",
")",
"=>",
"ref",
".",
"name",
"===",
"control",
".",
"indexPatternRefName",
")",
";",
"if",
"(",
"!",
"reference",
")",
"{",
"throw",
"new",
"Error",
"(",
"`Could not find index pattern reference \"${",
"control",
".",
"indexPatternRefName",
"}\"`",
")",
";",
"}",
"control",
".",
"indexPattern",
"=",
"reference",
".",
"id",
";",
"delete",
"control",
".",
"indexPatternRefName",
";",
"}",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661642 | [
"name",
"extends",
"SavedObject",
".",
"import",
"{",
"createSavedObjectClass",
",",
"SavedObject",
",",
"SavedObjectOpenSearchDashboardsServices",
",",
"}",
"from",
"'../../../saved_objects/public'",
";",
"import",
"{",
"updateOldState",
"}",
"from",
"'../legacy/vis_update_state'",
";",
"import",
"{",
"extractReferences",
",",
"injectReferences",
"}",
"from",
"'./saved_visualization_references'",
";",
"import",
"{",
"IIndexPattern",
"}",
"from",
"'../../../../plugins/data/public'",
";",
"import",
"{",
"ISavedVis",
",",
"SerializedVis",
"}",
"from",
"'../types'",
";",
"import",
"{",
"createSavedSearchesLoader",
"}",
"from",
"'../../../discover/public'",
";",
"export",
"const",
"convertToSerializedVis",
"=",
"(",
"savedVis",
")",
":",
"SerializedVis",
"=>",
"{",
"const",
"{",
"id",
",",
"title",
",",
"description",
",",
"visState",
",",
"uiStateJSON",
",",
"searchSourceFields",
"}",
"=",
"savedVis",
";",
"const",
"aggs",
"=",
"searchSourceFields",
"&&",
"searchSourceFields",
".",
"index",
"?",
"visState",
".",
"aggs",
"||",
"[",
"]",
":",
"visState",
".",
"aggs",
";",
"return",
"{",
"id",
",",
"title",
",",
"type",
":",
"visState",
".",
"type",
",",
"description",
",",
"params",
":",
"visState",
".",
"params",
",",
"uiState",
":",
"JSON",
".",
"parse",
"(",
"uiStateJSON",
"||",
"'{}'",
")",
",",
"data",
":",
"{",
"aggs",
",",
"searchSource",
":",
"searchSourceFields",
"!",
",",
"savedSearchId",
":",
"savedVis",
".",
"savedSearchId",
",",
"}",
",",
"}",
";",
"}",
";",
"export",
"const",
"convertFromSerializedVis",
"=",
"(",
"vis",
")",
":",
"ISavedVis",
"=>",
"{",
"return",
"{",
"id",
":",
"vis",
".",
"id",
",",
"title",
":",
"vis",
".",
"title",
",",
"description",
":",
"vis",
".",
"description",
",",
"visState",
":",
"{",
"title",
":",
"vis",
".",
"title",
",",
"type",
":",
"vis",
".",
"type",
",",
"aggs",
":",
"vis",
".",
"data",
".",
"aggs",
",",
"params",
":",
"vis",
".",
"params",
",",
"}",
",",
"uiStateJSON",
":",
"JSON",
".",
"stringify",
"(",
"vis",
".",
"uiState",
")",
",",
"searchSourceFields",
":",
"vis",
".",
"data",
".",
"searchSource",
",",
"savedSearchId",
":",
"vis",
".",
"data",
".",
"savedSearchId",
",",
"}",
";",
"}",
";",
"export",
"function",
"createSavedVisClass",
"(",
"services",
")",
"{",
"const",
"SavedObjectClass",
"=",
"createSavedObjectClass",
"(",
"services",
")",
";",
"const",
"savedSearch",
"=",
"createSavedSearchesLoader",
"(",
"services",
")",
";",
"class",
"SavedVis",
"extends",
"SavedObjectClass",
"{",
"public",
"static",
"type",
":",
"string",
"=",
"'visualization'",
";",
"public",
"static",
"mapping",
":",
"Record",
"<",
"string",
",",
"string",
">",
"=",
"{",
"title",
":",
"'text'",
",",
"visState",
":",
"'json'",
",",
"uiStateJSON",
":",
"'text'",
",",
"description",
":",
"'text'",
",",
"savedSearchId",
":",
"'keyword'",
",",
"version",
":",
"'integer'",
",",
"}",
";",
"public",
"static",
"fieldOrder",
"=",
"[",
"'title'",
",",
"'description'",
"]",
";",
"constructor",
"(",
"opts",
"=",
"{",
"}",
")",
"{",
"if",
"(",
"typeof",
"opts",
"!==",
"'object'",
")",
"{",
"opts",
"=",
"{",
"id",
":",
"opts",
"}",
";",
"}",
"const",
"visState",
"=",
"!",
"opts",
".",
"type",
"?",
"null",
":",
"{",
"type",
":",
"opts",
".",
"type",
"}",
";",
"super",
"(",
"{",
"type",
":",
"SavedVis",
".",
"type",
",",
"mapping",
":",
"SavedVis",
".",
"mapping",
",",
"extractReferences",
",",
"injectReferences",
",",
"id",
":",
"(",
"opts",
".",
"id",
"as",
"string",
")",
"||",
"''",
",",
"indexPattern",
":",
"opts",
".",
"indexPattern",
"as",
"IIndexPattern",
",",
"defaults",
":",
"{",
"title",
":",
"''",
",",
"visState",
",",
"uiStateJSON",
":",
"'{}'",
",",
"description",
":",
"''",
",",
"savedSearchId",
":",
"opts",
".",
"savedSearchId",
",",
"version",
":",
"1",
",",
"}",
",",
"afterOpenSearchResp",
":",
"async",
"(",
"savedObject",
")",
"=>",
"{",
"const",
"savedVis",
"=",
"(",
"savedObject",
"as",
"any",
")",
"as",
"ISavedVis",
";",
"savedVis",
".",
"visState",
"=",
"await",
"updateOldState",
"(",
"savedVis",
".",
"visState",
")",
";",
"if",
"(",
"savedVis",
".",
"searchSourceFields",
"?.",
"index",
")",
"{",
"await",
"services",
".",
"indexPatterns",
".",
"get",
"(",
"savedVis",
".",
"searchSourceFields",
".",
"index",
"as",
"any",
")",
";",
"}",
"if",
"(",
"savedVis",
".",
"savedSearchId",
")",
"{",
"await",
"savedSearch",
".",
"get",
"(",
"savedVis",
".",
"savedSearchId",
")",
";",
"}",
"return",
"(",
"savedVis",
"as",
"any",
")",
"as",
"SavedObject",
";",
"}",
",",
"}",
")",
";",
"this",
".",
"showInRecentlyAccessed",
"=",
"true",
";",
"this",
".",
"getFullPath",
"=",
"(",
")",
"=>",
"{",
"return",
"`/app/visualize#/edit/${",
"this",
".",
"id",
"}`",
";",
"}",
";",
"}",
"}",
"return",
"SavedVis",
"as",
"new",
"(",
"opts",
")",
"=>",
"SavedObject",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2528,
null,
null,
6416,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6416,
null,
null,
2528,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
620,
null,
4420,
null,
null,
null,
620,
null,
null,
null,
null,
null,
null,
null,
3773,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
620,
null,
null,
null,
null,
6416,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661643 | [
"import",
"{",
"SavedObjectLoader",
",",
"SavedObjectOpenSearchDashboardsServices",
",",
"}",
"from",
"'../../../saved_objects/public'",
";",
"import",
"{",
"findListItems",
"}",
"from",
"'./find_list_items'",
";",
"import",
"{",
"createSavedVisClass",
"}",
"from",
"'./_saved_vis'",
";",
"import",
"{",
"TypesStart",
"}",
"from",
"'../vis_types'",
";",
"export",
"interface",
"SavedObjectOpenSearchDashboardsServicesWithVisualizations",
"extends",
"SavedObjectOpenSearchDashboardsServices",
"{",
"visualizationTypes",
":",
"TypesStart",
";",
"}",
"export",
"type",
"SavedVisualizationsLoader",
"=",
"ReturnType",
"<",
"typeof",
"createSavedVisLoader",
">",
";",
"export",
"function",
"createSavedVisLoader",
"(",
"services",
")",
"{",
"const",
"{",
"savedObjectsClient",
",",
"visualizationTypes",
"}",
"=",
"services",
";",
"class",
"SavedObjectLoaderVisualize",
"extends",
"SavedObjectLoader",
"{",
"mapHitSource",
"=",
"(",
"source",
",",
"id",
")",
"=>",
"{",
"const",
"visTypes",
"=",
"visualizationTypes",
";",
"source",
".",
"id",
"=",
"id",
";",
"source",
".",
"url",
"=",
"this",
".",
"urlFor",
"(",
"id",
")",
";",
"let",
"typeName",
"=",
"source",
".",
"typeName",
";",
"if",
"(",
"source",
".",
"visState",
")",
"{",
"try",
"{",
"typeName",
"=",
"JSON",
".",
"parse",
"(",
"String",
"(",
"source",
".",
"visState",
")",
")",
".",
"type",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"}",
"}",
"if",
"(",
"!",
"typeName",
"||",
"!",
"visTypes",
".",
"get",
"(",
"typeName",
")",
")",
"{",
"source",
".",
"error",
"=",
"'Unknown visualization type'",
";",
"return",
"source",
";",
"}",
"source",
".",
"type",
"=",
"visTypes",
".",
"get",
"(",
"typeName",
")",
";",
"source",
".",
"savedObjectType",
"=",
"'visualization'",
";",
"source",
".",
"icon",
"=",
"source",
".",
"type",
".",
"icon",
";",
"source",
".",
"image",
"=",
"source",
".",
"type",
".",
"image",
";",
"source",
".",
"typeTitle",
"=",
"source",
".",
"type",
".",
"title",
";",
"source",
".",
"editUrl",
"=",
"`/edit/${",
"id",
"}`",
";",
"return",
"source",
";",
"}",
";",
"urlFor",
"(",
"id",
")",
"{",
"return",
"`#/edit/${",
"encodeURIComponent",
"(",
"id",
")",
"}`",
";",
"}",
"findListItems",
"(",
"search",
"=",
"''",
",",
"size",
"=",
"100",
")",
"{",
"return",
"findListItems",
"(",
"{",
"search",
",",
"size",
",",
"mapSavedObjectApiHits",
":",
"this",
".",
"mapSavedObjectApiHits",
".",
"bind",
"(",
"this",
")",
",",
"savedObjectsClient",
",",
"visTypes",
":",
"visualizationTypes",
".",
"getAliases",
"(",
")",
",",
"}",
")",
";",
"}",
"}",
"const",
"SavedVis",
"=",
"createSavedVisClass",
"(",
"services",
")",
";",
"return",
"new",
"SavedObjectLoaderVisualize",
"(",
"SavedVis",
",",
"savedObjectsClient",
")",
"as",
"SavedObjectLoader",
"&",
"{",
"findListItems",
":",
"(",
"search",
":",
"string",
",",
"size",
":",
"number",
")",
"=>",
"any",
";",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26187,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
17,
null,
2,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
2,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
620,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661644 | [
"name",
"description",
"import",
"{",
"isFunction",
",",
"defaults",
",",
"cloneDeep",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"Assign",
"}",
"from",
"'@osd/utility-types'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"PersistedState",
"}",
"from",
"'./persisted_state'",
";",
"import",
"{",
"getTypes",
",",
"getAggs",
",",
"getSearch",
",",
"getSavedSearchLoader",
"}",
"from",
"'./services'",
";",
"import",
"{",
"VisType",
"}",
"from",
"'./vis_types'",
";",
"import",
"{",
"IAggConfigs",
",",
"IndexPattern",
",",
"ISearchSource",
",",
"AggConfigOptions",
",",
"SearchSourceFields",
",",
"}",
"from",
"'../../../plugins/data/public'",
";",
"export",
"interface",
"SerializedVisData",
"{",
"expression",
"?",
":",
"string",
";",
"aggs",
":",
"AggConfigOptions",
"[",
"]",
";",
"searchSource",
":",
"SearchSourceFields",
";",
"savedSearchId",
"?",
":",
"string",
";",
"}",
"export",
"interface",
"SerializedVis",
"{",
"id",
"?",
":",
"string",
";",
"title",
":",
"string",
";",
"description",
"?",
":",
"string",
";",
"type",
":",
"string",
";",
"params",
":",
"VisParams",
";",
"uiState",
"?",
":",
"any",
";",
"data",
":",
"SerializedVisData",
";",
"}",
"export",
"interface",
"VisData",
"{",
"ast",
"?",
":",
"string",
";",
"aggs",
"?",
":",
"IAggConfigs",
";",
"indexPattern",
"?",
":",
"IndexPattern",
";",
"searchSource",
"?",
":",
"ISearchSource",
";",
"savedSearchId",
"?",
":",
"string",
";",
"}",
"export",
"interface",
"VisParams",
"{",
"[",
"key",
"]",
":",
"any",
";",
"}",
"const",
"getSearchSource",
"=",
"async",
"(",
"inputSearchSource",
",",
"savedSearchId",
"?",
")",
"=>",
"{",
"const",
"searchSource",
"=",
"inputSearchSource",
".",
"createCopy",
"(",
")",
";",
"if",
"(",
"savedSearchId",
")",
"{",
"const",
"savedSearch",
"=",
"await",
"getSavedSearchLoader",
"(",
")",
".",
"get",
"(",
"savedSearchId",
")",
";",
"searchSource",
".",
"setParent",
"(",
"savedSearch",
".",
"searchSource",
")",
";",
"}",
"searchSource",
".",
"setField",
"(",
"'size'",
",",
"0",
")",
";",
"return",
"searchSource",
";",
"}",
";",
"type",
"PartialVisState",
"=",
"Assign",
"<",
"SerializedVis",
",",
"{",
"data",
":",
"Partial",
"<",
"SerializedVisData",
">",
";",
"}",
">",
";",
"export",
"class",
"Vis",
"<",
"TVisParams",
"=",
"VisParams",
">",
"{",
"public",
"readonly",
"type",
":",
"VisType",
"<",
"TVisParams",
">",
";",
"public",
"readonly",
"id",
"?",
":",
"string",
";",
"public",
"title",
":",
"string",
"=",
"''",
";",
"public",
"description",
":",
"string",
"=",
"''",
";",
"public",
"params",
":",
"TVisParams",
";",
"public",
"sessionState",
":",
"Record",
"<",
"string",
",",
"any",
">",
"=",
"{",
"}",
";",
"public",
"data",
":",
"VisData",
"=",
"{",
"}",
";",
"public",
"readonly",
"uiState",
":",
"PersistedState",
";",
"constructor",
"(",
"visType",
",",
"visState",
"=",
"{",
"}",
"as",
"any",
")",
"{",
"this",
".",
"type",
"=",
"this",
".",
"getType",
"<",
"TVisParams",
">",
"(",
"visType",
")",
";",
"this",
".",
"params",
"=",
"this",
".",
"getParams",
"(",
"visState",
".",
"params",
")",
";",
"this",
".",
"uiState",
"=",
"new",
"PersistedState",
"(",
"visState",
".",
"uiState",
")",
";",
"this",
".",
"id",
"=",
"visState",
".",
"id",
";",
"}",
"private",
"getType",
"<",
"TVisParams",
">",
"(",
"visType",
")",
"{",
"const",
"type",
"=",
"getTypes",
"(",
")",
".",
"get",
"<",
"TVisParams",
">",
"(",
"visType",
")",
";",
"if",
"(",
"!",
"type",
")",
"{",
"const",
"errorMessage",
"=",
"i18n",
".",
"translate",
"(",
"'visualizations.visualizationTypeInvalidMessage'",
",",
"{",
"defaultMessage",
":",
"'Invalid visualization type \"{visType}\"'",
",",
"values",
":",
"{",
"visType",
",",
"}",
",",
"}",
")",
";",
"throw",
"new",
"Error",
"(",
"errorMessage",
")",
";",
"}",
"return",
"type",
";",
"}",
"private",
"getParams",
"(",
"params",
")",
"{",
"return",
"defaults",
"(",
"{",
"}",
",",
"cloneDeep",
"(",
"params",
"??",
"{",
"}",
")",
",",
"cloneDeep",
"(",
"this",
".",
"type",
".",
"visConfig",
"?.",
"defaults",
"??",
"{",
"}",
")",
")",
";",
"}",
"async",
"setState",
"(",
"state",
")",
"{",
"let",
"typeChanged",
"=",
"false",
";",
"if",
"(",
"state",
".",
"type",
"&&",
"this",
".",
"type",
".",
"name",
"!==",
"state",
".",
"type",
")",
"{",
"this",
".",
"type",
"=",
"this",
".",
"getType",
"(",
"state",
".",
"type",
")",
";",
"typeChanged",
"=",
"true",
";",
"}",
"if",
"(",
"state",
".",
"title",
"!==",
"undefined",
")",
"{",
"this",
".",
"title",
"=",
"state",
".",
"title",
";",
"}",
"if",
"(",
"state",
".",
"description",
"!==",
"undefined",
")",
"{",
"this",
".",
"description",
"=",
"state",
".",
"description",
";",
"}",
"if",
"(",
"state",
".",
"params",
"||",
"typeChanged",
")",
"{",
"this",
".",
"params",
"=",
"this",
".",
"getParams",
"(",
"state",
".",
"params",
")",
";",
"}",
"if",
"(",
"state",
".",
"data",
"&&",
"state",
".",
"data",
".",
"searchSource",
")",
"{",
"this",
".",
"data",
".",
"searchSource",
"=",
"await",
"getSearch",
"(",
")",
".",
"searchSource",
".",
"create",
"(",
"state",
".",
"data",
".",
"searchSource",
"!",
")",
";",
"this",
".",
"data",
".",
"indexPattern",
"=",
"this",
".",
"data",
".",
"searchSource",
".",
"getField",
"(",
"'index'",
")",
";",
"}",
"if",
"(",
"state",
".",
"data",
"&&",
"state",
".",
"data",
".",
"savedSearchId",
")",
"{",
"this",
".",
"data",
".",
"savedSearchId",
"=",
"state",
".",
"data",
".",
"savedSearchId",
";",
"if",
"(",
"this",
".",
"data",
".",
"searchSource",
")",
"{",
"this",
".",
"data",
".",
"searchSource",
"=",
"await",
"getSearchSource",
"(",
"this",
".",
"data",
".",
"searchSource",
",",
"this",
".",
"data",
".",
"savedSearchId",
")",
";",
"this",
".",
"data",
".",
"indexPattern",
"=",
"this",
".",
"data",
".",
"searchSource",
".",
"getField",
"(",
"'index'",
")",
";",
"}",
"}",
"if",
"(",
"state",
".",
"data",
"&&",
"(",
"state",
".",
"data",
".",
"aggs",
"||",
"!",
"this",
".",
"data",
".",
"aggs",
")",
")",
"{",
"const",
"aggs",
"=",
"state",
".",
"data",
".",
"aggs",
"?",
"cloneDeep",
"(",
"state",
".",
"data",
".",
"aggs",
")",
":",
"[",
"]",
";",
"const",
"configStates",
"=",
"this",
".",
"initializeDefaultsFromSchemas",
"(",
"aggs",
",",
"this",
".",
"type",
".",
"schemas",
".",
"all",
"||",
"[",
"]",
")",
";",
"if",
"(",
"!",
"this",
".",
"data",
".",
"indexPattern",
")",
"{",
"if",
"(",
"aggs",
".",
"length",
")",
"{",
"const",
"errorMessage",
"=",
"i18n",
".",
"translate",
"(",
"'visualizations.initializeWithoutIndexPatternErrorMessage'",
",",
"{",
"defaultMessage",
":",
"'Trying to initialize aggs without index pattern'",
",",
"}",
")",
";",
"throw",
"new",
"Error",
"(",
"errorMessage",
")",
";",
"}",
"return",
";",
"}",
"this",
".",
"data",
".",
"aggs",
"=",
"getAggs",
"(",
")",
".",
"createAggConfigs",
"(",
"this",
".",
"data",
".",
"indexPattern",
",",
"configStates",
")",
";",
"}",
"}",
"clone",
"(",
")",
"{",
"const",
"{",
"data",
",",
"...",
"restOfSerialized",
"}",
"=",
"this",
".",
"serialize",
"(",
")",
";",
"const",
"vis",
"=",
"new",
"Vis",
"(",
"this",
".",
"type",
".",
"name",
",",
"restOfSerialized",
"as",
"any",
")",
";",
"vis",
".",
"setState",
"(",
"{",
"...",
"restOfSerialized",
",",
"data",
":",
"{",
"}",
"}",
")",
";",
"const",
"aggs",
"=",
"this",
".",
"data",
".",
"indexPattern",
"?",
"getAggs",
"(",
")",
".",
"createAggConfigs",
"(",
"this",
".",
"data",
".",
"indexPattern",
",",
"data",
".",
"aggs",
")",
":",
"undefined",
";",
"vis",
".",
"data",
"=",
"{",
"...",
"this",
".",
"data",
",",
"aggs",
",",
"}",
";",
"return",
"vis",
";",
"}",
"serialize",
"(",
")",
"{",
"const",
"aggs",
"=",
"this",
".",
"data",
".",
"aggs",
"?",
"this",
".",
"data",
".",
"aggs",
".",
"aggs",
".",
"map",
"(",
"(",
"agg",
")",
"=>",
"agg",
".",
"toJSON",
"(",
")",
")",
":",
"[",
"]",
";",
"return",
"{",
"id",
":",
"this",
".",
"id",
",",
"title",
":",
"this",
".",
"title",
",",
"description",
":",
"this",
".",
"description",
",",
"type",
":",
"this",
".",
"type",
".",
"name",
",",
"params",
":",
"cloneDeep",
"(",
"this",
".",
"params",
")",
"as",
"any",
",",
"uiState",
":",
"this",
".",
"uiState",
".",
"toJSON",
"(",
")",
",",
"data",
":",
"{",
"aggs",
":",
"aggs",
"as",
"any",
",",
"searchSource",
":",
"this",
".",
"data",
".",
"searchSource",
"?",
"this",
".",
"data",
".",
"searchSource",
".",
"getSerializedFields",
"(",
")",
":",
"{",
"}",
",",
"savedSearchId",
":",
"this",
".",
"data",
".",
"savedSearchId",
",",
"}",
",",
"}",
";",
"}",
"isHierarchical",
"(",
")",
"{",
"if",
"(",
"isFunction",
"(",
"this",
".",
"type",
".",
"hierarchicalData",
")",
")",
"{",
"return",
"!",
"!",
"this",
".",
"type",
".",
"hierarchicalData",
"(",
"this",
")",
";",
"}",
"else",
"{",
"return",
"!",
"!",
"this",
".",
"type",
".",
"hierarchicalData",
";",
"}",
"}",
"private",
"initializeDefaultsFromSchemas",
"(",
"configStates",
",",
"schemas",
")",
"{",
"const",
"newConfigs",
"=",
"[",
"...",
"configStates",
"]",
";",
"schemas",
".",
"filter",
"(",
"(",
"schema",
")",
"=>",
"Array",
".",
"isArray",
"(",
"schema",
".",
"defaults",
")",
"&&",
"schema",
".",
"defaults",
".",
"length",
">",
"0",
")",
".",
"filter",
"(",
"(",
"schema",
")",
"=>",
"!",
"configStates",
".",
"find",
"(",
"(",
"agg",
")",
"=>",
"agg",
".",
"schema",
"&&",
"agg",
".",
"schema",
"===",
"schema",
".",
"name",
")",
")",
".",
"forEach",
"(",
"(",
"schema",
")",
"=>",
"{",
"const",
"defaultSchemaConfig",
"=",
"schema",
".",
"defaults",
".",
"slice",
"(",
"0",
",",
"schema",
".",
"max",
")",
";",
"defaultSchemaConfig",
".",
"forEach",
"(",
"(",
"d",
")",
"=>",
"newConfigs",
".",
"push",
"(",
"d",
")",
")",
";",
"}",
")",
";",
"return",
"newConfigs",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
3208,
null,
2,
null,
null,
null,
null,
null,
1901,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
2528,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5837,
null,
null,
null,
null,
2,
null,
null,
null,
5837,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2661,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
26188,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1742,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1742,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2528,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
530,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
5,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661645 | [
"name",
"description",
"import",
"{",
"EventEmitter",
"}",
"from",
"'events'",
";",
"import",
"_",
"from",
"'lodash'",
";",
"import",
"{",
"VisParams",
",",
"PersistedState",
"}",
"from",
"'../../../../plugins/visualizations/public'",
";",
"import",
"{",
"getTypes",
"}",
"from",
"'../services'",
";",
"import",
"{",
"VisType",
"}",
"from",
"'../vis_types'",
";",
"export",
"interface",
"ExprVisState",
"{",
"title",
"?",
":",
"string",
";",
"type",
":",
"VisType",
"<",
"unknown",
">",
"|",
"string",
";",
"params",
"?",
":",
"VisParams",
";",
"}",
"export",
"interface",
"ExprVisAPIEvents",
"{",
"filter",
":",
"(",
"data",
":",
"any",
")",
"=>",
"void",
";",
"brush",
":",
"(",
"data",
":",
"any",
")",
"=>",
"void",
";",
"applyFilter",
":",
"(",
"data",
":",
"any",
")",
"=>",
"void",
";",
"}",
"export",
"interface",
"ExprVisAPI",
"{",
"events",
":",
"ExprVisAPIEvents",
";",
"}",
"export",
"class",
"ExprVis",
"extends",
"EventEmitter",
"{",
"public",
"title",
":",
"string",
"=",
"''",
";",
"public",
"type",
":",
"VisType",
"<",
"unknown",
">",
";",
"public",
"params",
":",
"VisParams",
"=",
"{",
"}",
";",
"public",
"sessionState",
":",
"Record",
"<",
"string",
",",
"any",
">",
"=",
"{",
"}",
";",
"public",
"API",
":",
"ExprVisAPI",
";",
"public",
"eventsSubject",
":",
"any",
";",
"private",
"uiState",
":",
"PersistedState",
";",
"constructor",
"(",
"visState",
"=",
"{",
"type",
":",
"'histogram'",
"}",
")",
"{",
"super",
"(",
")",
";",
"this",
".",
"type",
"=",
"this",
".",
"getType",
"(",
"visState",
".",
"type",
")",
";",
"this",
".",
"uiState",
"=",
"new",
"PersistedState",
"(",
")",
";",
"this",
".",
"setState",
"(",
"visState",
")",
";",
"this",
".",
"API",
"=",
"{",
"events",
":",
"{",
"filter",
":",
"(",
"data",
")",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"eventsSubject",
")",
"return",
";",
"this",
".",
"eventsSubject",
".",
"next",
"(",
"{",
"name",
":",
"'filterBucket'",
",",
"data",
":",
"data",
".",
"data",
"?",
"{",
"data",
":",
"data",
".",
"data",
",",
"negate",
":",
"data",
".",
"negate",
",",
"}",
":",
"{",
"data",
":",
"[",
"data",
"]",
"}",
",",
"}",
")",
";",
"}",
",",
"brush",
":",
"(",
"data",
")",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"eventsSubject",
")",
"return",
";",
"this",
".",
"eventsSubject",
".",
"next",
"(",
"{",
"name",
":",
"'brush'",
",",
"data",
"}",
")",
";",
"}",
",",
"applyFilter",
":",
"(",
"data",
")",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"eventsSubject",
")",
"return",
";",
"this",
".",
"eventsSubject",
".",
"next",
"(",
"{",
"name",
":",
"'applyFilter'",
",",
"data",
"}",
")",
";",
"}",
",",
"}",
",",
"}",
";",
"}",
"private",
"getType",
"(",
"type",
")",
"{",
"if",
"(",
"_",
".",
"isString",
"(",
"type",
")",
")",
"{",
"const",
"newType",
"=",
"getTypes",
"(",
")",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"!",
"newType",
")",
"{",
"throw",
"new",
"Error",
"(",
"`Invalid type \"${",
"type",
"}\"`",
")",
";",
"}",
"return",
"newType",
";",
"}",
"else",
"{",
"return",
"type",
";",
"}",
"}",
"setState",
"(",
"state",
")",
"{",
"this",
".",
"title",
"=",
"state",
".",
"title",
"||",
"''",
";",
"if",
"(",
"state",
".",
"type",
")",
"{",
"this",
".",
"type",
"=",
"this",
".",
"getType",
"(",
"state",
".",
"type",
")",
";",
"}",
"this",
".",
"params",
"=",
"_",
".",
"defaultsDeep",
"(",
"{",
"}",
",",
"_",
".",
"cloneDeep",
"(",
"state",
".",
"params",
"||",
"{",
"}",
")",
",",
"_",
".",
"cloneDeep",
"(",
"this",
".",
"type",
".",
"visConfig",
".",
"defaults",
"||",
"{",
"}",
")",
")",
";",
"}",
"getState",
"(",
")",
"{",
"return",
"{",
"title",
":",
"this",
".",
"title",
",",
"type",
":",
"this",
".",
"type",
".",
"name",
",",
"params",
":",
"_",
".",
"cloneDeep",
"(",
"this",
".",
"params",
")",
",",
"}",
";",
"}",
"updateState",
"(",
")",
"{",
"this",
".",
"emit",
"(",
"'update'",
")",
";",
"}",
"forceReload",
"(",
")",
"{",
"this",
".",
"emit",
"(",
"'reload'",
")",
";",
"}",
"isHierarchical",
"(",
")",
"{",
"if",
"(",
"_",
".",
"isFunction",
"(",
"this",
".",
"type",
".",
"hierarchicalData",
")",
")",
"{",
"return",
"!",
"!",
"this",
".",
"type",
".",
"hierarchicalData",
"(",
"this",
")",
";",
"}",
"else",
"{",
"return",
"!",
"!",
"this",
".",
"type",
".",
"hierarchicalData",
";",
"}",
"}",
"hasUiState",
"(",
")",
"{",
"return",
"!",
"!",
"this",
".",
"uiState",
";",
"}",
"getUiState",
"(",
")",
"{",
"return",
"this",
".",
"uiState",
";",
"}",
"setUiState",
"(",
"state",
")",
"{",
"this",
".",
"uiState",
"=",
"state",
";",
"}",
"/**\n * Currently this is only used to extract map-specific information\n * (e.g. mapZoom, mapCenter).\n */",
"uiStateVal",
"(",
"key",
",",
"val",
")",
"{",
"if",
"(",
"this",
".",
"hasUiState",
"(",
")",
")",
"{",
"if",
"(",
"_",
".",
"isUndefined",
"(",
"val",
")",
")",
"{",
"return",
"this",
".",
"uiState",
".",
"get",
"(",
"key",
")",
";",
"}",
"return",
"this",
".",
"uiState",
".",
"set",
"(",
"key",
",",
"val",
")",
";",
"}",
"return",
"val",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13415,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5837,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
13415,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3584,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
3584,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661646 | [
"import",
"{",
"ExpressionAstExpression",
"}",
"from",
"'src/plugins/expressions'",
";",
"import",
"{",
"SavedObject",
"}",
"from",
"'../../saved_objects/public'",
";",
"import",
"{",
"AggConfigOptions",
",",
"SearchSourceFields",
",",
"TimefilterContract",
",",
"}",
"from",
"'../../../plugins/data/public'",
";",
"import",
"{",
"SerializedVis",
",",
"Vis",
",",
"VisParams",
"}",
"from",
"'./vis'",
";",
"import",
"{",
"ExprVis",
"}",
"from",
"'./expressions/vis'",
";",
"export",
"{",
"Vis",
",",
"SerializedVis",
",",
"VisParams",
"}",
";",
"export",
"interface",
"VisualizationController",
"{",
"render",
"(",
"visData",
",",
"visParams",
")",
":",
"Promise",
"<",
"void",
">",
";",
"destroy",
"(",
")",
":",
"void",
";",
"isLoaded",
"?",
"(",
")",
":",
"Promise",
"<",
"void",
">",
"|",
"void",
";",
"}",
"export",
"type",
"VisualizationControllerConstructor",
"=",
"new",
"(",
"el",
",",
"vis",
")",
"=>",
"VisualizationController",
";",
"export",
"interface",
"SavedVisState",
"{",
"title",
":",
"string",
";",
"type",
":",
"string",
";",
"params",
":",
"VisParams",
";",
"aggs",
":",
"AggConfigOptions",
"[",
"]",
";",
"}",
"export",
"interface",
"ISavedVis",
"{",
"id",
"?",
":",
"string",
";",
"title",
":",
"string",
";",
"description",
"?",
":",
"string",
";",
"visState",
":",
"SavedVisState",
";",
"searchSourceFields",
"?",
":",
"SearchSourceFields",
";",
"uiStateJSON",
"?",
":",
"string",
";",
"savedSearchRefName",
"?",
":",
"string",
";",
"savedSearchId",
"?",
":",
"string",
";",
"}",
"export",
"interface",
"VisSavedObject",
"extends",
"SavedObject",
",",
"ISavedVis",
"{",
"}",
"export",
"interface",
"VisResponseValue",
"{",
"visType",
":",
"string",
";",
"visData",
":",
"object",
";",
"visConfig",
":",
"object",
";",
"params",
"?",
":",
"object",
";",
"}",
"export",
"interface",
"VisToExpressionAstParams",
"{",
"timefilter",
":",
"TimefilterContract",
";",
"timeRange",
"?",
":",
"any",
";",
"abortSignal",
"?",
":",
"AbortSignal",
";",
"}",
"export",
"type",
"VisToExpressionAst",
"<",
"TVisParams",
"=",
"VisParams",
">",
"=",
"(",
"vis",
":",
"Vis",
"<",
"TVisParams",
">",
",",
"params",
":",
"VisToExpressionAstParams",
")",
"=>",
"ExpressionAstExpression",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
15,
null,
6656,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661647 | [
"import",
"{",
"defaultsDeep",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"ISchemas",
"}",
"from",
"'src/plugins/vis_default_editor/public'",
";",
"import",
"{",
"VisParams",
"}",
"from",
"'../types'",
";",
"import",
"{",
"VisType",
",",
"VisTypeOptions",
"}",
"from",
"'./types'",
";",
"interface",
"CommonBaseVisTypeOptions",
"<",
"TVisParams",
">",
"extends",
"Pick",
"<",
"VisType",
"<",
"TVisParams",
">",
",",
"'description'",
"|",
"'editor'",
"|",
"'getInfoMessage'",
"|",
"'getSupportedTriggers'",
"|",
"'hierarchicalData'",
"|",
"'icon'",
"|",
"'image'",
"|",
"'inspectorAdapters'",
"|",
"'getUsedIndexPattern'",
"|",
"'name'",
"|",
"'requestHandler'",
"|",
"'responseHandler'",
"|",
"'setup'",
"|",
"'title'",
">",
",",
"Pick",
"<",
"Partial",
"<",
"VisType",
"<",
"TVisParams",
">",
">",
",",
"'editorConfig'",
"|",
"'hidden'",
"|",
"'stage'",
"|",
"'useCustomNoDataScreen'",
"|",
"'visConfig'",
">",
"{",
"options",
"?",
":",
"Partial",
"<",
"VisType",
"<",
"TVisParams",
">",
"[",
"'options'",
"]",
">",
";",
"}",
"interface",
"ExpressionBaseVisTypeOptions",
"<",
"TVisParams",
">",
"extends",
"CommonBaseVisTypeOptions",
"<",
"TVisParams",
">",
"{",
"toExpressionAst",
":",
"VisType",
"<",
"TVisParams",
">",
"[",
"'toExpressionAst'",
"]",
";",
"visualization",
"?",
":",
"undefined",
";",
"}",
"interface",
"VisualizationBaseVisTypeOptions",
"<",
"TVisParams",
">",
"extends",
"CommonBaseVisTypeOptions",
"<",
"TVisParams",
">",
"{",
"toExpressionAst",
"?",
":",
"undefined",
";",
"visualization",
":",
"VisType",
"<",
"TVisParams",
">",
"[",
"'visualization'",
"]",
";",
"}",
"export",
"type",
"BaseVisTypeOptions",
"<",
"TVisParams",
"=",
"VisParams",
">",
"=",
"ExpressionBaseVisTypeOptions",
"<",
"TVisParams",
">",
"|",
"VisualizationBaseVisTypeOptions",
"<",
"TVisParams",
">",
";",
"const",
"defaultOptions",
"=",
"{",
"showTimePicker",
":",
"true",
",",
"showQueryBar",
":",
"true",
",",
"showFilterBar",
":",
"true",
",",
"showIndexSelection",
":",
"true",
",",
"hierarchicalData",
":",
"false",
",",
"}",
";",
"export",
"class",
"BaseVisType",
"<",
"TVisParams",
"=",
"VisParams",
">",
"implements",
"VisType",
"<",
"TVisParams",
">",
"{",
"public",
"readonly",
"name",
";",
"public",
"readonly",
"title",
";",
"public",
"readonly",
"description",
";",
"public",
"readonly",
"getSupportedTriggers",
";",
"public",
"readonly",
"icon",
";",
"public",
"readonly",
"image",
";",
"public",
"readonly",
"stage",
";",
"public",
"readonly",
"options",
";",
"public",
"readonly",
"visualization",
";",
"public",
"readonly",
"visConfig",
";",
"public",
"readonly",
"editor",
";",
"public",
"readonly",
"editorConfig",
";",
"public",
"hidden",
";",
"public",
"readonly",
"requestHandler",
";",
"public",
"readonly",
"responseHandler",
";",
"public",
"readonly",
"hierarchicalData",
";",
"public",
"readonly",
"setup",
";",
"public",
"readonly",
"getUsedIndexPattern",
";",
"public",
"readonly",
"useCustomNoDataScreen",
";",
"public",
"readonly",
"inspectorAdapters",
";",
"public",
"readonly",
"toExpressionAst",
";",
"public",
"readonly",
"getInfoMessage",
";",
"constructor",
"(",
"opts",
")",
"{",
"if",
"(",
"!",
"opts",
".",
"icon",
"&&",
"!",
"opts",
".",
"image",
")",
"{",
"throw",
"new",
"Error",
"(",
"'vis_type must define its icon or image'",
")",
";",
"}",
"this",
".",
"name",
"=",
"opts",
".",
"name",
";",
"this",
".",
"description",
"=",
"opts",
".",
"description",
"??",
"''",
";",
"this",
".",
"getSupportedTriggers",
"=",
"opts",
".",
"getSupportedTriggers",
";",
"this",
".",
"title",
"=",
"opts",
".",
"title",
";",
"this",
".",
"icon",
"=",
"opts",
".",
"icon",
";",
"this",
".",
"image",
"=",
"opts",
".",
"image",
";",
"this",
".",
"visualization",
"=",
"opts",
".",
"visualization",
";",
"this",
".",
"visConfig",
"=",
"defaultsDeep",
"(",
"{",
"}",
",",
"opts",
".",
"visConfig",
",",
"{",
"defaults",
":",
"{",
"}",
"}",
")",
";",
"this",
".",
"editor",
"=",
"opts",
".",
"editor",
";",
"this",
".",
"editorConfig",
"=",
"defaultsDeep",
"(",
"{",
"}",
",",
"opts",
".",
"editorConfig",
",",
"{",
"collections",
":",
"{",
"}",
"}",
")",
";",
"this",
".",
"options",
"=",
"defaultsDeep",
"(",
"{",
"}",
",",
"opts",
".",
"options",
",",
"defaultOptions",
")",
";",
"this",
".",
"stage",
"=",
"opts",
".",
"stage",
"??",
"'production'",
";",
"this",
".",
"hidden",
"=",
"opts",
".",
"hidden",
"??",
"false",
";",
"this",
".",
"requestHandler",
"=",
"opts",
".",
"requestHandler",
"??",
"'courier'",
";",
"this",
".",
"responseHandler",
"=",
"opts",
".",
"responseHandler",
"??",
"'none'",
";",
"this",
".",
"setup",
"=",
"opts",
".",
"setup",
";",
"this",
".",
"hierarchicalData",
"=",
"opts",
".",
"hierarchicalData",
"??",
"false",
";",
"this",
".",
"getUsedIndexPattern",
"=",
"opts",
".",
"getUsedIndexPattern",
";",
"this",
".",
"useCustomNoDataScreen",
"=",
"opts",
".",
"useCustomNoDataScreen",
"??",
"false",
";",
"this",
".",
"inspectorAdapters",
"=",
"opts",
".",
"inspectorAdapters",
";",
"this",
".",
"toExpressionAst",
"=",
"opts",
".",
"toExpressionAst",
";",
"this",
".",
"getInfoMessage",
"=",
"opts",
".",
"getInfoMessage",
";",
"}",
"public",
"get",
"schemas",
"(",
")",
":",
"ISchemas",
"{",
"return",
"this",
".",
"editorConfig",
"?.",
"schemas",
"??",
"[",
"]",
";",
"}",
"public",
"get",
"requiresSearch",
"(",
")",
":",
"boolean",
"{",
"return",
"this",
".",
"requestHandler",
"!==",
"'none'",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
24392,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26189,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661648 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"render",
",",
"unmountComponentAtNode",
"}",
"from",
"'react-dom'",
";",
"import",
"{",
"VisualizationController",
"}",
"from",
"'../types'",
";",
"import",
"{",
"getI18n",
",",
"getUISettings",
"}",
"from",
"'../services'",
";",
"import",
"{",
"ExprVis",
"}",
"from",
"'../expressions/vis'",
";",
"export",
"class",
"ReactVisController",
"implements",
"VisualizationController",
"{",
"constructor",
"(",
"private",
"element",
",",
"private",
"vis",
")",
"{",
"}",
"public",
"render",
"(",
"visData",
",",
"visParams",
")",
"{",
"const",
"I18nContext",
"=",
"getI18n",
"(",
")",
".",
"Context",
";",
"return",
"new",
"Promise",
"(",
"(",
"resolve",
",",
"reject",
")",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"vis",
".",
"type",
"||",
"!",
"this",
".",
"vis",
".",
"type",
".",
"visConfig",
"||",
"!",
"this",
".",
"vis",
".",
"type",
".",
"visConfig",
".",
"component",
")",
"{",
"reject",
"(",
"'Missing component for ReactVisType'",
")",
";",
"}",
"const",
"Component",
"=",
"this",
".",
"vis",
".",
"type",
".",
"visConfig",
".",
"component",
";",
"const",
"config",
"=",
"getUISettings",
"(",
")",
";",
"render",
"(",
"<",
"I18nContext",
">",
"<",
"Component",
"config",
"=",
"{",
"config",
"}",
"vis",
"=",
"{",
"this",
".",
"vis",
"}",
"visData",
"=",
"{",
"visData",
"}",
"visParams",
"=",
"{",
"visParams",
"}",
"renderComplete",
"=",
"{",
"resolve",
"}",
"/",
">",
"<",
"/I18nContext>, this.element);",
"}",
")",
";",
"}",
"public",
"destroy",
"(",
")",
"{",
"unmountComponentAtNode",
"(",
"this",
".",
"element",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
15,
null,
null,
6656,
null,
null,
null,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661649 | [
"import",
"{",
"BaseVisType",
",",
"BaseVisTypeOptions",
"}",
"from",
"'./base_vis_type'",
";",
"import",
"{",
"ReactVisController",
"}",
"from",
"'./react_vis_controller'",
";",
"import",
"{",
"VisType",
"}",
"from",
"'./types'",
";",
"export",
"type",
"ReactVisTypeOptions",
"<",
"TVisParams",
">",
"=",
"Omit",
"<",
"BaseVisTypeOptions",
"<",
"TVisParams",
">",
",",
"'visualization'",
"|",
"'toExpressionAst'",
">",
";",
"/**\n * This class should only be used for visualizations not using the `toExpressionAst` with a custom renderer.\n * If you implement a custom renderer you should just mount a react component inside this.\n */",
"export",
"class",
"ReactVisType",
"<",
"TVisParams",
">",
"extends",
"BaseVisType",
"<",
"TVisParams",
">",
"implements",
"VisType",
"<",
"TVisParams",
">",
"{",
"constructor",
"(",
"opts",
")",
"{",
"super",
"(",
"{",
"...",
"opts",
",",
"visualization",
":",
"ReactVisController",
",",
"}",
")",
";",
"if",
"(",
"!",
"this",
".",
"visConfig",
".",
"component",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Missing component for ReactVisType'",
")",
";",
"}",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26190,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661650 | [
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"React",
"from",
"'react'",
";",
"export",
"function",
"DisabledLabVisualization",
"(",
"{",
"title",
"}",
")",
"{",
"return",
"(",
"<",
"div",
"className",
"=",
"\"visDisabledLabVisualization\"",
">",
"<",
"div",
"className",
"=",
"\"kuiVerticalRhythm visDisabledLabVisualization__icon kuiIcon fa-flask\"",
"aria",
"-",
"hidden",
"=",
"\"true\"",
"/",
">",
"<",
"div",
"className",
"=",
"\"kuiVerticalRhythm\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visualizations.disabledLabVisualizationTitle\"",
"defaultMessage",
"=",
"\"{title} is a lab visualization.\"",
"values",
"=",
"{",
"{",
"title",
":",
"<",
"em",
"className",
"=",
"\"visDisabledLabVisualization__title\"",
">",
"{",
"title",
"}",
"<",
"/em> }}/",
">",
"<",
"/div>",
"<",
"div",
"className",
"=",
"\"kuiVerticalRhythm\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visualizations.disabledLabVisualizationMessage\"",
"defaultMessage",
"=",
"\"Please turn on lab-mode in the advanced settings to see lab visualizations.\"",
"/",
">",
"<",
"/div>",
"<",
"/div>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661651 | [
"export",
"const",
"VISUALIZE_EMBEDDABLE_TYPE",
"=",
"'visualization'",
";"
] | [
null,
null,
2,
null,
null,
null
] |
661652 | [
"import",
"{",
"get",
"}",
"from",
"'lodash'",
";",
"import",
"moment",
"from",
"'moment'",
";",
"import",
"{",
"formatExpression",
",",
"SerializedFieldFormat",
"}",
"from",
"'../../../../plugins/expressions/public'",
";",
"import",
"{",
"IAggConfig",
",",
"search",
",",
"TimefilterContract",
"}",
"from",
"'../../../../plugins/data/public'",
";",
"import",
"{",
"Vis",
",",
"VisParams",
"}",
"from",
"'../types'",
";",
"const",
"{",
"isDateHistogramBucketAggConfig",
"}",
"=",
"search",
".",
"aggs",
";",
"interface",
"SchemaConfigParams",
"{",
"precision",
"?",
":",
"number",
";",
"useGeocentroid",
"?",
":",
"boolean",
";",
"}",
"export",
"interface",
"SchemaConfig",
"{",
"accessor",
":",
"number",
";",
"label",
":",
"string",
";",
"format",
":",
"SerializedFieldFormat",
";",
"params",
":",
"SchemaConfigParams",
";",
"aggType",
":",
"string",
";",
"}",
"export",
"interface",
"Schemas",
"{",
"metric",
":",
"SchemaConfig",
"[",
"]",
";",
"bucket",
"?",
":",
"any",
"[",
"]",
";",
"geo_centroid",
"?",
":",
"any",
"[",
"]",
";",
"group",
"?",
":",
"any",
"[",
"]",
";",
"params",
"?",
":",
"any",
"[",
"]",
";",
"radius",
"?",
":",
"any",
"[",
"]",
";",
"segment",
"?",
":",
"any",
"[",
"]",
";",
"split_column",
"?",
":",
"any",
"[",
"]",
";",
"split_row",
"?",
":",
"any",
"[",
"]",
";",
"width",
"?",
":",
"any",
"[",
"]",
";",
"[",
"key",
"]",
":",
"any",
"[",
"]",
"|",
"undefined",
";",
"}",
"type",
"BuildVisFunction",
"=",
"(",
"params",
":",
"VisParams",
",",
"schemas",
":",
"Schemas",
",",
"uiState",
":",
"any",
",",
"meta",
"?",
":",
"{",
"savedObjectId",
"?",
":",
"string",
";",
"}",
")",
"=>",
"string",
";",
"type",
"buildVisConfigFunction",
"=",
"(",
"schemas",
":",
"Schemas",
",",
"visParams",
"?",
":",
"VisParams",
")",
"=>",
"VisParams",
";",
"interface",
"BuildPipelineVisFunction",
"{",
"[",
"key",
"]",
":",
"BuildVisFunction",
";",
"}",
"interface",
"BuildVisConfigFunction",
"{",
"[",
"key",
"]",
":",
"buildVisConfigFunction",
";",
"}",
"export",
"interface",
"BuildPipelineParams",
"{",
"timefilter",
":",
"TimefilterContract",
";",
"timeRange",
"?",
":",
"any",
";",
"abortSignal",
"?",
":",
"AbortSignal",
";",
"}",
"const",
"vislibCharts",
"=",
"[",
"'area'",
",",
"'gauge'",
",",
"'goal'",
",",
"'heatmap'",
",",
"'histogram'",
",",
"'horizontal_bar'",
",",
"'line'",
",",
"]",
";",
"export",
"const",
"getSchemas",
"=",
"<",
"TVisParams",
">",
"(",
"vis",
",",
"{",
"timeRange",
",",
"timefilter",
"}",
")",
":",
"Schemas",
"=>",
"{",
"const",
"createSchemaConfig",
"=",
"(",
"accessor",
",",
"agg",
")",
":",
"SchemaConfig",
"=>",
"{",
"if",
"(",
"isDateHistogramBucketAggConfig",
"(",
"agg",
")",
")",
"{",
"agg",
".",
"params",
".",
"timeRange",
"=",
"timeRange",
";",
"const",
"bounds",
"=",
"agg",
".",
"params",
".",
"timeRange",
"&&",
"agg",
".",
"fieldIsTimeField",
"(",
")",
"?",
"timefilter",
".",
"calculateBounds",
"(",
"agg",
".",
"params",
".",
"timeRange",
")",
":",
"undefined",
";",
"agg",
".",
"buckets",
".",
"setBounds",
"(",
"bounds",
")",
";",
"agg",
".",
"buckets",
".",
"setInterval",
"(",
"agg",
".",
"params",
".",
"interval",
")",
";",
"}",
"const",
"hasSubAgg",
"=",
"[",
"'derivative'",
",",
"'moving_avg'",
",",
"'serial_diff'",
",",
"'cumulative_sum'",
",",
"'sum_bucket'",
",",
"'avg_bucket'",
",",
"'min_bucket'",
",",
"'max_bucket'",
",",
"]",
".",
"includes",
"(",
"agg",
".",
"type",
".",
"name",
")",
";",
"const",
"formatAgg",
"=",
"hasSubAgg",
"?",
"agg",
".",
"params",
".",
"customMetric",
"||",
"agg",
".",
"aggConfigs",
".",
"getRequestAggById",
"(",
"agg",
".",
"params",
".",
"metricAgg",
")",
":",
"agg",
";",
"const",
"params",
"=",
"{",
"}",
";",
"if",
"(",
"agg",
".",
"type",
".",
"name",
"===",
"'geohash_grid'",
")",
"{",
"params",
".",
"precision",
"=",
"agg",
".",
"params",
".",
"precision",
";",
"params",
".",
"useGeocentroid",
"=",
"agg",
".",
"params",
".",
"useGeocentroid",
";",
"}",
"const",
"label",
"=",
"agg",
".",
"makeLabel",
"&&",
"agg",
".",
"makeLabel",
"(",
")",
";",
"return",
"{",
"accessor",
",",
"format",
":",
"formatAgg",
".",
"toSerializedFieldFormat",
"(",
")",
",",
"params",
",",
"label",
",",
"aggType",
":",
"agg",
".",
"type",
".",
"name",
",",
"}",
";",
"}",
";",
"let",
"cnt",
"=",
"0",
";",
"const",
"schemas",
"=",
"{",
"metric",
":",
"[",
"]",
",",
"}",
";",
"if",
"(",
"!",
"vis",
".",
"data",
".",
"aggs",
")",
"{",
"return",
"schemas",
";",
"}",
"const",
"responseAggs",
"=",
"vis",
".",
"data",
".",
"aggs",
".",
"getResponseAggs",
"(",
")",
".",
"filter",
"(",
"(",
"agg",
")",
"=>",
"agg",
".",
"enabled",
")",
";",
"const",
"isHierarchical",
"=",
"vis",
".",
"isHierarchical",
"(",
")",
";",
"const",
"metrics",
"=",
"responseAggs",
".",
"filter",
"(",
"(",
"agg",
")",
"=>",
"agg",
".",
"type",
".",
"type",
"===",
"'metrics'",
")",
";",
"responseAggs",
".",
"forEach",
"(",
"(",
"agg",
")",
"=>",
"{",
"let",
"skipMetrics",
"=",
"false",
";",
"let",
"schemaName",
"=",
"agg",
".",
"schema",
";",
"if",
"(",
"!",
"schemaName",
")",
"{",
"if",
"(",
"agg",
".",
"type",
".",
"name",
"===",
"'geo_centroid'",
")",
"{",
"schemaName",
"=",
"'geo_centroid'",
";",
"}",
"else",
"{",
"cnt",
"++",
";",
"return",
";",
"}",
"}",
"if",
"(",
"schemaName",
"===",
"'split'",
")",
"{",
"schemaName",
"=",
"`split_${",
"(",
"vis",
".",
"params",
"as",
"any",
")",
".",
"row",
"?",
"'row'",
":",
"'column'",
"}`",
";",
"skipMetrics",
"=",
"responseAggs",
".",
"length",
"-",
"metrics",
".",
"length",
">",
"1",
";",
"}",
"if",
"(",
"!",
"schemas",
"[",
"schemaName",
"]",
")",
"{",
"schemas",
"[",
"schemaName",
"]",
"=",
"[",
"]",
";",
"}",
"if",
"(",
"!",
"isHierarchical",
"||",
"agg",
".",
"type",
".",
"type",
"!==",
"'metrics'",
")",
"{",
"schemas",
"[",
"schemaName",
"]",
"!",
".",
"push",
"(",
"createSchemaConfig",
"(",
"cnt",
"++",
",",
"agg",
")",
")",
";",
"}",
"if",
"(",
"isHierarchical",
"&&",
"(",
"agg",
".",
"type",
".",
"type",
"!==",
"'metrics'",
"||",
"metrics",
".",
"length",
"===",
"responseAggs",
".",
"length",
")",
")",
"{",
"metrics",
".",
"forEach",
"(",
"(",
"metric",
")",
"=>",
"{",
"const",
"schemaConfig",
"=",
"createSchemaConfig",
"(",
"cnt",
"++",
",",
"metric",
")",
";",
"if",
"(",
"!",
"skipMetrics",
")",
"{",
"schemas",
".",
"metric",
".",
"push",
"(",
"schemaConfig",
")",
";",
"}",
"}",
")",
";",
"}",
"}",
")",
";",
"return",
"schemas",
";",
"}",
";",
"export",
"const",
"prepareJson",
"=",
"(",
"variable",
",",
"data",
"?",
")",
":",
"string",
"=>",
"{",
"if",
"(",
"data",
"===",
"undefined",
")",
"{",
"return",
"''",
";",
"}",
"return",
"`${",
"variable",
"}='${",
"JSON",
".",
"stringify",
"(",
"data",
")",
".",
"replace",
"(",
"/\\\\/g",
",",
"`\\\\\\\\`",
")",
".",
"replace",
"(",
"/'/g",
",",
"`\\\\'`",
")",
"}' `",
";",
"}",
";",
"export",
"const",
"escapeString",
"=",
"(",
"data",
")",
":",
"string",
"=>",
"{",
"return",
"data",
".",
"replace",
"(",
"/\\\\/g",
",",
"`\\\\\\\\`",
")",
".",
"replace",
"(",
"/'/g",
",",
"`\\\\'`",
")",
";",
"}",
";",
"export",
"const",
"prepareString",
"=",
"(",
"variable",
",",
"data",
"?",
")",
":",
"string",
"=>",
"{",
"if",
"(",
"data",
"===",
"undefined",
")",
"{",
"return",
"''",
";",
"}",
"return",
"`${",
"variable",
"}='${",
"escapeString",
"(",
"data",
")",
"}' `",
";",
"}",
";",
"export",
"const",
"prepareValue",
"=",
"(",
"variable",
",",
"data",
",",
"raw",
"=",
"false",
")",
"=>",
"{",
"if",
"(",
"data",
"===",
"undefined",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"raw",
")",
"{",
"return",
"`${",
"variable",
"}=${",
"data",
"} `",
";",
"}",
"switch",
"(",
"typeof",
"data",
")",
"{",
"case",
"'string'",
":",
"return",
"prepareString",
"(",
"variable",
",",
"data",
")",
";",
"case",
"'object'",
":",
"return",
"prepareJson",
"(",
"variable",
",",
"data",
")",
";",
"default",
":",
"return",
"`${",
"variable",
"}=${",
"data",
"} `",
";",
"}",
"}",
";",
"export",
"const",
"prepareDimension",
"=",
"(",
"variable",
",",
"data",
")",
"=>",
"{",
"if",
"(",
"data",
"===",
"undefined",
")",
"{",
"return",
"''",
";",
"}",
"let",
"expr",
"=",
"`${",
"variable",
"}={visdimension ${",
"data",
".",
"accessor",
"} `",
";",
"if",
"(",
"data",
".",
"format",
")",
"{",
"expr",
"+=",
"prepareValue",
"(",
"'format'",
",",
"data",
".",
"format",
".",
"id",
")",
";",
"expr",
"+=",
"prepareJson",
"(",
"'formatParams'",
",",
"data",
".",
"format",
".",
"params",
")",
";",
"}",
"expr",
"+=",
"'} '",
";",
"return",
"expr",
";",
"}",
";",
"const",
"adjustVislibDimensionFormmaters",
"=",
"(",
"vis",
",",
"dimensions",
")",
":",
"void",
"=>",
"{",
"const",
"visConfig",
"=",
"vis",
".",
"params",
";",
"const",
"responseAggs",
"=",
"vis",
".",
"data",
".",
"aggs",
"!",
".",
"getResponseAggs",
"(",
")",
".",
"filter",
"(",
"(",
"agg",
")",
"=>",
"agg",
".",
"enabled",
")",
";",
"(",
"dimensions",
".",
"y",
"||",
"[",
"]",
")",
".",
"forEach",
"(",
"(",
"yDimension",
")",
"=>",
"{",
"const",
"yAgg",
"=",
"responseAggs",
"[",
"yDimension",
".",
"accessor",
"]",
";",
"const",
"seriesParam",
"=",
"(",
"visConfig",
".",
"seriesParams",
"||",
"[",
"]",
")",
".",
"find",
"(",
"(",
"param",
")",
"=>",
"param",
".",
"data",
".",
"id",
"===",
"yAgg",
".",
"id",
")",
";",
"if",
"(",
"seriesParam",
")",
"{",
"const",
"usedValueAxis",
"=",
"(",
"visConfig",
".",
"valueAxes",
"||",
"[",
"]",
")",
".",
"find",
"(",
"(",
"valueAxis",
")",
"=>",
"valueAxis",
".",
"id",
"===",
"seriesParam",
".",
"valueAxis",
")",
";",
"if",
"(",
"get",
"(",
"usedValueAxis",
",",
"'scale.mode'",
")",
"===",
"'percentage'",
")",
"{",
"yDimension",
".",
"format",
"=",
"{",
"id",
":",
"'percent'",
"}",
";",
"}",
"}",
"if",
"(",
"get",
"(",
"visConfig",
",",
"'gauge.percentageMode'",
")",
"===",
"true",
")",
"{",
"yDimension",
".",
"format",
"=",
"{",
"id",
":",
"'percent'",
"}",
";",
"}",
"}",
")",
";",
"}",
";",
"export",
"const",
"buildPipelineVisFunction",
"=",
"{",
"vega",
":",
"(",
"params",
")",
"=>",
"{",
"return",
"`vega ${",
"prepareString",
"(",
"'spec'",
",",
"params",
".",
"spec",
")",
"}`",
";",
"}",
",",
"input_control_vis",
":",
"(",
"params",
")",
"=>",
"{",
"return",
"`input_control_vis ${",
"prepareJson",
"(",
"'visConfig'",
",",
"params",
")",
"}`",
";",
"}",
",",
"metrics",
":",
"(",
"{",
"title",
",",
"...",
"params",
"}",
",",
"schemas",
",",
"uiState",
"=",
"{",
"}",
")",
"=>",
"{",
"const",
"paramsJson",
"=",
"prepareJson",
"(",
"'params'",
",",
"params",
")",
";",
"const",
"uiStateJson",
"=",
"prepareJson",
"(",
"'uiState'",
",",
"uiState",
")",
";",
"const",
"paramsArray",
"=",
"[",
"paramsJson",
",",
"uiStateJson",
"]",
".",
"filter",
"(",
"(",
"param",
")",
"=>",
"Boolean",
"(",
"param",
")",
")",
";",
"return",
"`tsvb ${",
"paramsArray",
".",
"join",
"(",
"' '",
")",
"}`",
";",
"}",
",",
"table",
":",
"(",
"params",
",",
"schemas",
")",
"=>",
"{",
"const",
"visConfig",
"=",
"{",
"...",
"params",
",",
"...",
"buildVisConfig",
".",
"table",
"(",
"schemas",
",",
"params",
")",
",",
"}",
";",
"return",
"`opensearch_dashboards_table ${",
"prepareJson",
"(",
"'visConfig'",
",",
"visConfig",
")",
"}`",
";",
"}",
",",
"region_map",
":",
"(",
"params",
",",
"schemas",
")",
"=>",
"{",
"const",
"visConfig",
"=",
"{",
"...",
"params",
",",
"...",
"buildVisConfig",
".",
"region_map",
"(",
"schemas",
")",
",",
"}",
";",
"return",
"`regionmap ${",
"prepareJson",
"(",
"'visConfig'",
",",
"visConfig",
")",
"}`",
";",
"}",
",",
"tile_map",
":",
"(",
"params",
",",
"schemas",
")",
"=>",
"{",
"const",
"visConfig",
"=",
"{",
"...",
"params",
",",
"...",
"buildVisConfig",
".",
"tile_map",
"(",
"schemas",
")",
",",
"}",
";",
"return",
"`tilemap ${",
"prepareJson",
"(",
"'visConfig'",
",",
"visConfig",
")",
"}`",
";",
"}",
",",
"pie",
":",
"(",
"params",
",",
"schemas",
")",
"=>",
"{",
"const",
"visConfig",
"=",
"{",
"...",
"params",
",",
"...",
"buildVisConfig",
".",
"pie",
"(",
"schemas",
")",
",",
"}",
";",
"return",
"`opensearch_dashboards_pie ${",
"prepareJson",
"(",
"'visConfig'",
",",
"visConfig",
")",
"}`",
";",
"}",
",",
"}",
";",
"const",
"buildVisConfig",
"=",
"{",
"table",
":",
"(",
"schemas",
",",
"visParams",
"=",
"{",
"}",
")",
"=>",
"{",
"const",
"visConfig",
"=",
"{",
"}",
"as",
"any",
";",
"const",
"metrics",
"=",
"schemas",
".",
"metric",
";",
"const",
"buckets",
"=",
"schemas",
".",
"bucket",
"||",
"[",
"]",
";",
"visConfig",
".",
"dimensions",
"=",
"{",
"metrics",
",",
"buckets",
",",
"splitRow",
":",
"schemas",
".",
"split_row",
",",
"splitColumn",
":",
"schemas",
".",
"split_column",
",",
"}",
";",
"if",
"(",
"visParams",
".",
"showMetricsAtAllLevels",
"===",
"false",
"&&",
"visParams",
".",
"showPartialRows",
"===",
"true",
")",
"{",
"const",
"metricsPerBucket",
"=",
"metrics",
".",
"length",
"/",
"buckets",
".",
"length",
";",
"visConfig",
".",
"dimensions",
".",
"metrics",
".",
"splice",
"(",
"0",
",",
"metricsPerBucket",
"*",
"buckets",
".",
"length",
"-",
"metricsPerBucket",
")",
";",
"}",
"return",
"visConfig",
";",
"}",
",",
"region_map",
":",
"(",
"schemas",
")",
"=>",
"{",
"const",
"visConfig",
"=",
"{",
"}",
"as",
"any",
";",
"visConfig",
".",
"metric",
"=",
"schemas",
".",
"metric",
"[",
"0",
"]",
";",
"if",
"(",
"schemas",
".",
"segment",
")",
"{",
"visConfig",
".",
"bucket",
"=",
"schemas",
".",
"segment",
"[",
"0",
"]",
";",
"}",
"return",
"visConfig",
";",
"}",
",",
"tile_map",
":",
"(",
"schemas",
")",
"=>",
"{",
"const",
"visConfig",
"=",
"{",
"}",
"as",
"any",
";",
"visConfig",
".",
"dimensions",
"=",
"{",
"metric",
":",
"schemas",
".",
"metric",
"[",
"0",
"]",
",",
"geohash",
":",
"schemas",
".",
"segment",
"?",
"schemas",
".",
"segment",
"[",
"0",
"]",
":",
"null",
",",
"geocentroid",
":",
"schemas",
".",
"geo_centroid",
"?",
"schemas",
".",
"geo_centroid",
"[",
"0",
"]",
":",
"null",
",",
"}",
";",
"return",
"visConfig",
";",
"}",
",",
"pie",
":",
"(",
"schemas",
")",
"=>",
"{",
"const",
"visConfig",
"=",
"{",
"}",
"as",
"any",
";",
"visConfig",
".",
"dimensions",
"=",
"{",
"metric",
":",
"schemas",
".",
"metric",
"[",
"0",
"]",
",",
"buckets",
":",
"schemas",
".",
"segment",
",",
"splitRow",
":",
"schemas",
".",
"split_row",
",",
"splitColumn",
":",
"schemas",
".",
"split_column",
",",
"}",
";",
"return",
"visConfig",
";",
"}",
",",
"}",
";",
"export",
"const",
"buildVislibDimensions",
"=",
"async",
"(",
"vis",
",",
"params",
")",
"=>",
"{",
"const",
"schemas",
"=",
"getSchemas",
"(",
"vis",
",",
"{",
"timeRange",
":",
"params",
".",
"timeRange",
",",
"timefilter",
":",
"params",
".",
"timefilter",
",",
"}",
")",
";",
"const",
"dimensions",
"=",
"{",
"x",
":",
"schemas",
".",
"segment",
"?",
"schemas",
".",
"segment",
"[",
"0",
"]",
":",
"null",
",",
"y",
":",
"schemas",
".",
"metric",
",",
"z",
":",
"schemas",
".",
"radius",
",",
"width",
":",
"schemas",
".",
"width",
",",
"series",
":",
"schemas",
".",
"group",
",",
"splitRow",
":",
"schemas",
".",
"split_row",
",",
"splitColumn",
":",
"schemas",
".",
"split_column",
",",
"}",
";",
"if",
"(",
"schemas",
".",
"segment",
")",
"{",
"const",
"xAgg",
"=",
"vis",
".",
"data",
".",
"aggs",
".",
"getResponseAggs",
"(",
")",
"[",
"dimensions",
".",
"x",
".",
"accessor",
"]",
";",
"if",
"(",
"xAgg",
".",
"type",
".",
"name",
"===",
"'date_histogram'",
")",
"{",
"dimensions",
".",
"x",
".",
"params",
".",
"date",
"=",
"true",
";",
"const",
"{",
"opensearchUnit",
",",
"opensearchValue",
"}",
"=",
"xAgg",
".",
"buckets",
".",
"getInterval",
"(",
")",
";",
"dimensions",
".",
"x",
".",
"params",
".",
"interval",
"=",
"moment",
".",
"duration",
"(",
"opensearchValue",
",",
"opensearchUnit",
")",
";",
"dimensions",
".",
"x",
".",
"params",
".",
"intervalESValue",
"=",
"opensearchValue",
";",
"dimensions",
".",
"x",
".",
"params",
".",
"intervalESUnit",
"=",
"opensearchUnit",
";",
"dimensions",
".",
"x",
".",
"params",
".",
"format",
"=",
"xAgg",
".",
"buckets",
".",
"getScaledDateFormat",
"(",
")",
";",
"dimensions",
".",
"x",
".",
"params",
".",
"bounds",
"=",
"xAgg",
".",
"buckets",
".",
"getBounds",
"(",
")",
";",
"}",
"else",
"if",
"(",
"xAgg",
".",
"type",
".",
"name",
"===",
"'histogram'",
")",
"{",
"const",
"intervalParam",
"=",
"xAgg",
".",
"type",
".",
"paramByName",
"(",
"'interval'",
")",
";",
"const",
"output",
"=",
"{",
"params",
":",
"{",
"}",
"as",
"any",
"}",
";",
"await",
"intervalParam",
".",
"modifyAggConfigOnSearchRequestStart",
"(",
"xAgg",
",",
"vis",
".",
"data",
".",
"searchSource",
",",
"{",
"abortSignal",
":",
"params",
".",
"abortSignal",
",",
"}",
")",
";",
"intervalParam",
".",
"write",
"(",
"xAgg",
",",
"output",
")",
";",
"dimensions",
".",
"x",
".",
"params",
".",
"interval",
"=",
"output",
".",
"params",
".",
"interval",
";",
"}",
"}",
"adjustVislibDimensionFormmaters",
"(",
"vis",
",",
"dimensions",
")",
";",
"return",
"dimensions",
";",
"}",
";",
"export",
"const",
"buildPipeline",
"=",
"async",
"(",
"vis",
",",
"params",
")",
"=>",
"{",
"const",
"{",
"indexPattern",
",",
"searchSource",
"}",
"=",
"vis",
".",
"data",
";",
"const",
"query",
"=",
"searchSource",
"!",
".",
"getField",
"(",
"'query'",
")",
";",
"const",
"filters",
"=",
"searchSource",
"!",
".",
"getField",
"(",
"'filter'",
")",
";",
"const",
"{",
"uiState",
",",
"title",
"}",
"=",
"vis",
";",
"let",
"pipeline",
"=",
"`opensearchDashboards | opensearch_dashboards_context `",
";",
"if",
"(",
"query",
")",
"{",
"pipeline",
"+=",
"prepareJson",
"(",
"'query'",
",",
"query",
")",
";",
"}",
"if",
"(",
"filters",
")",
"{",
"pipeline",
"+=",
"prepareJson",
"(",
"'filters'",
",",
"filters",
")",
";",
"}",
"if",
"(",
"vis",
".",
"data",
".",
"savedSearchId",
")",
"{",
"pipeline",
"+=",
"prepareString",
"(",
"'savedSearchId'",
",",
"vis",
".",
"data",
".",
"savedSearchId",
")",
";",
"}",
"pipeline",
"+=",
"'| '",
";",
"if",
"(",
"vis",
".",
"type",
".",
"toExpressionAst",
")",
"{",
"const",
"visAst",
"=",
"await",
"vis",
".",
"type",
".",
"toExpressionAst",
"(",
"vis",
",",
"params",
")",
";",
"pipeline",
"+=",
"formatExpression",
"(",
"visAst",
")",
";",
"}",
"else",
"{",
"if",
"(",
"vis",
".",
"type",
".",
"requestHandler",
"===",
"'courier'",
")",
"{",
"pipeline",
"+=",
"`opensearchaggs\n ${",
"prepareString",
"(",
"'index'",
",",
"indexPattern",
"!",
".",
"id",
")",
"}\n metricsAtAllLevels=${",
"vis",
".",
"isHierarchical",
"(",
")",
"}\n partialRows=${",
"vis",
".",
"params",
".",
"showPartialRows",
"||",
"false",
"}\n ${",
"prepareJson",
"(",
"'aggConfigs'",
",",
"vis",
".",
"data",
".",
"aggs",
"!",
".",
"aggs",
")",
"} | `",
";",
"}",
"const",
"schemas",
"=",
"getSchemas",
"(",
"vis",
",",
"params",
")",
";",
"if",
"(",
"buildPipelineVisFunction",
"[",
"vis",
".",
"type",
".",
"name",
"]",
")",
"{",
"pipeline",
"+=",
"buildPipelineVisFunction",
"[",
"vis",
".",
"type",
".",
"name",
"]",
"(",
"{",
"title",
",",
"...",
"vis",
".",
"params",
"}",
",",
"schemas",
",",
"uiState",
")",
";",
"}",
"else",
"if",
"(",
"vislibCharts",
".",
"includes",
"(",
"vis",
".",
"type",
".",
"name",
")",
")",
"{",
"const",
"visConfig",
"=",
"{",
"...",
"vis",
".",
"params",
"}",
";",
"visConfig",
".",
"dimensions",
"=",
"await",
"buildVislibDimensions",
"(",
"vis",
",",
"params",
")",
";",
"pipeline",
"+=",
"`vislib type='${",
"vis",
".",
"type",
".",
"name",
"}' ${",
"prepareJson",
"(",
"'visConfig'",
",",
"visConfig",
")",
"}`",
";",
"}",
"else",
"{",
"const",
"visConfig",
"=",
"{",
"...",
"vis",
".",
"params",
"}",
";",
"visConfig",
".",
"dimensions",
"=",
"schemas",
";",
"pipeline",
"+=",
"`visualization type='${",
"vis",
".",
"type",
".",
"name",
"}'\n ${",
"prepareJson",
"(",
"'visConfig'",
",",
"visConfig",
")",
"}\n metricsAtAllLevels=${",
"vis",
".",
"isHierarchical",
"(",
")",
"}\n partialRows=${",
"vis",
".",
"params",
".",
"showPartialRows",
"||",
"false",
"} `",
";",
"if",
"(",
"indexPattern",
")",
"{",
"pipeline",
"+=",
"`${",
"prepareString",
"(",
"'index'",
",",
"indexPattern",
".",
"id",
")",
"} `",
";",
"if",
"(",
"vis",
".",
"data",
".",
"aggs",
")",
"{",
"pipeline",
"+=",
"`${",
"prepareJson",
"(",
"'aggConfigs'",
",",
"vis",
".",
"data",
".",
"aggs",
"!",
".",
"aggs",
")",
"}`",
";",
"}",
"}",
"}",
"}",
"return",
"pipeline",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1673,
null,
null,
null,
null,
null,
1742,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661653 | [
"import",
"{",
"APPLY_FILTER_TRIGGER",
",",
"SELECT_RANGE_TRIGGER",
",",
"VALUE_CLICK_TRIGGER",
",",
"}",
"from",
"'../../../ui_actions/public'",
";",
"export",
"interface",
"VisEventToTrigger",
"{",
"[",
"'applyFilter'",
"]",
":",
"typeof",
"APPLY_FILTER_TRIGGER",
";",
"[",
"'brush'",
"]",
":",
"typeof",
"SELECT_RANGE_TRIGGER",
";",
"[",
"'filter'",
"]",
":",
"typeof",
"VALUE_CLICK_TRIGGER",
";",
"}",
"export",
"const",
"VIS_EVENT_TO_TRIGGER",
"=",
"{",
"applyFilter",
":",
"APPLY_FILTER_TRIGGER",
",",
"brush",
":",
"SELECT_RANGE_TRIGGER",
",",
"filter",
":",
"VALUE_CLICK_TRIGGER",
",",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26193,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661654 | [
"interface",
"MemoizedCall",
"{",
"args",
":",
"any",
"[",
"]",
";",
"returnValue",
":",
"any",
";",
"this",
":",
"any",
";",
"}",
"const",
"neverCalled",
"=",
"Symbol",
"(",
")",
";",
"type",
"NeverCalled",
"=",
"typeof",
"neverCalled",
";",
"/**\n * A simple memoize function, that only stores the last returned value\n * and uses the identity of all passed parameters as a cache key.\n */",
"function",
"memoizeLast",
"<",
"T",
"extends",
"(",
"...",
"args",
":",
"any",
"[",
"]",
")",
"=>",
"any",
">",
"(",
"func",
")",
"{",
"let",
"prevCall",
"=",
"neverCalled",
";",
"const",
"memoizedFunction",
"=",
"function",
"(",
"this",
",",
"...",
"args",
")",
"{",
"if",
"(",
"prevCall",
"!==",
"neverCalled",
"&&",
"prevCall",
".",
"this",
"===",
"this",
"&&",
"prevCall",
".",
"args",
".",
"length",
"===",
"args",
".",
"length",
"&&",
"prevCall",
".",
"args",
".",
"every",
"(",
"(",
"arg",
",",
"index",
")",
"=>",
"arg",
"===",
"args",
"[",
"index",
"]",
")",
")",
"{",
"return",
"prevCall",
".",
"returnValue",
";",
"}",
"prevCall",
"=",
"{",
"args",
",",
"this",
":",
"this",
",",
"returnValue",
":",
"func",
".",
"apply",
"(",
"this",
",",
"args",
")",
",",
"}",
";",
"return",
"prevCall",
".",
"returnValue",
";",
"}",
"as",
"T",
";",
"return",
"memoizedFunction",
";",
"}",
"export",
"{",
"memoizeLast",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
11,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
11,
null,
null,
null,
null,
null,
null,
null,
null,
11,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661655 | [
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"React",
",",
"{",
"Fragment",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiText",
",",
"EuiButton",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"VisTypeAlias",
"}",
"from",
"'../../vis_types'",
";",
"interface",
"Props",
"{",
"promotedTypes",
":",
"VisTypeAlias",
"[",
"]",
";",
"onPromotionClicked",
":",
"(",
"visType",
":",
"VisTypeAlias",
")",
"=>",
"void",
";",
"}",
"export",
"function",
"NewVisHelp",
"(",
"props",
")",
"{",
"return",
"(",
"<",
"EuiText",
">",
"<",
"p",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visualizations.newVisWizard.helpText\"",
"defaultMessage",
"=",
"\"Start creating your visualization by selecting a type for that visualization.\"",
"/",
">",
"<",
"/p>",
"{",
"props",
".",
"promotedTypes",
".",
"map",
"(",
"(",
"t",
")",
"=>",
"(",
"<",
"Fragment",
"key",
"=",
"{",
"t",
".",
"name",
"}",
">",
"<",
"p",
">",
"<",
"strong",
">",
"{",
"t",
".",
"promotion",
"!",
".",
"description",
"}",
"<",
"/strong>",
"<",
"/p>",
"<",
"EuiButton",
"onClick",
"=",
"{",
"(",
")",
"=>",
"props",
".",
"onPromotionClicked",
"(",
"t",
")",
"}",
"fill",
"size",
"=",
"\"s\"",
"iconType",
"=",
"\"popout\"",
"iconSide",
"=",
"\"right\"",
">",
"{",
"t",
".",
"promotion",
"!",
".",
"buttonText",
"}",
"<",
"/EuiButton>",
"<",
"/Fragment>))}",
"<",
"/EuiText>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
32,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6002,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661656 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiSpacer",
",",
"EuiText",
",",
"EuiTitle",
"}",
"from",
"'@elastic/eui'",
";",
"interface",
"VisHelpTextProps",
"{",
"name",
":",
"string",
";",
"title",
":",
"string",
";",
"description",
"?",
":",
"string",
";",
"highlightMsg",
"?",
":",
"string",
";",
"}",
"export",
"const",
"VisHelpText",
"=",
"(",
"{",
"name",
",",
"title",
",",
"description",
",",
"highlightMsg",
"}",
")",
"=>",
"{",
"return",
"(",
"<",
"React",
".",
"Fragment",
">",
"<",
"EuiTitle",
"size",
"=",
"\"s\"",
">",
"<",
"h2",
">",
"{",
"title",
"}",
"<",
"/h2>",
"<",
"/EuiTitle>",
"<",
"EuiSpacer",
"size",
"=",
"\"s\"",
"/",
">",
"<",
"div",
"id",
"=",
"{",
"`visTypeDescription-${",
"name",
"}`",
"}",
">",
"<",
"EuiText",
">",
"{",
"highlightMsg",
"&&",
"(",
"<",
"p",
">",
"<",
"em",
">",
"{",
"highlightMsg",
"}",
"<",
"/em>",
"<",
"/p>)}",
"<",
"p",
">",
"{",
"description",
"}",
"<",
"/p>",
"<",
"/EuiText>",
"<",
"/div>",
"<",
"/React.Fragment>);",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661657 | [
"import",
"{",
"EuiIcon",
",",
"IconType",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"React",
"from",
"'react'",
";",
"interface",
"VisTypeIconProps",
"{",
"icon",
"?",
":",
"IconType",
";",
"image",
"?",
":",
"string",
";",
"}",
"/**\n * This renders the icon for a specific visualization type.\n * This currently checks the following:\n * - If image is set, use that as the `src` of an image\n * - Otherwise use the icon as an EuiIcon or the 'empty' icon if that's not set\n */",
"export",
"const",
"VisTypeIcon",
"=",
"(",
"{",
"icon",
",",
"image",
"}",
")",
"=>",
"{",
"return",
"(",
"<",
"React",
".",
"Fragment",
">",
"{",
"image",
"&&",
"<",
"img",
"src",
"=",
"{",
"image",
"}",
"alt",
"=",
"\"\"",
"className",
"=",
"\"visNewVisDialog__typeImage\"",
"/",
">",
"}",
"{",
"!",
"image",
"&&",
"<",
"EuiIcon",
"type",
"=",
"{",
"icon",
"||",
"'empty'",
"}",
"size",
"=",
"\"l\"",
"color",
"=",
"\"secondary\"",
"/",
">",
"}",
"<",
"/React.Fragment>);",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661658 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"orderBy",
"}",
"from",
"'lodash'",
";",
"import",
"React",
",",
"{",
"ChangeEvent",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiFieldSearch",
",",
"EuiFlexGroup",
",",
"EuiFlexItem",
",",
"EuiKeyPadMenu",
",",
"EuiKeyPadMenuItem",
",",
"EuiModalHeader",
",",
"EuiModalHeaderTitle",
",",
"EuiScreenReaderOnly",
",",
"EuiSpacer",
",",
"EuiTitle",
",",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"memoizeLast",
"}",
"from",
"'../../legacy/memoize'",
";",
"import",
"{",
"VisTypeAlias",
"}",
"from",
"'../../vis_types/vis_type_alias_registry'",
";",
"import",
"{",
"NewVisHelp",
"}",
"from",
"'./new_vis_help'",
";",
"import",
"{",
"VisHelpText",
"}",
"from",
"'./vis_help_text'",
";",
"import",
"{",
"VisTypeIcon",
"}",
"from",
"'./vis_type_icon'",
";",
"import",
"{",
"VisType",
",",
"TypesStart",
"}",
"from",
"'../../vis_types'",
";",
"interface",
"VisTypeListEntry",
"{",
"type",
":",
"VisType",
"|",
"VisTypeAlias",
";",
"highlighted",
":",
"boolean",
";",
"}",
"interface",
"TypeSelectionProps",
"{",
"addBasePath",
":",
"(",
"path",
":",
"string",
")",
"=>",
"string",
";",
"onVisTypeSelected",
":",
"(",
"visType",
":",
"VisType",
"|",
"VisTypeAlias",
")",
"=>",
"void",
";",
"visTypesRegistry",
":",
"TypesStart",
";",
"showExperimental",
":",
"boolean",
";",
"}",
"interface",
"HighlightedType",
"{",
"name",
":",
"string",
";",
"title",
":",
"string",
";",
"description",
"?",
":",
"string",
";",
"highlightMsg",
"?",
":",
"string",
";",
"}",
"interface",
"TypeSelectionState",
"{",
"highlightedType",
":",
"HighlightedType",
"|",
"null",
";",
"query",
":",
"string",
";",
"}",
"function",
"isVisTypeAlias",
"(",
"type",
")",
"{",
"return",
"'aliasPath'",
"in",
"type",
";",
"}",
"class",
"TypeSelection",
"extends",
"React",
".",
"Component",
"<",
"TypeSelectionProps",
",",
"TypeSelectionState",
">",
"{",
"public",
"state",
":",
"TypeSelectionState",
"=",
"{",
"highlightedType",
":",
"null",
",",
"query",
":",
"''",
",",
"}",
";",
"private",
"readonly",
"getFilteredVisTypes",
"=",
"memoizeLast",
"(",
"this",
".",
"filteredVisTypes",
")",
";",
"public",
"render",
"(",
")",
"{",
"const",
"{",
"query",
",",
"highlightedType",
"}",
"=",
"this",
".",
"state",
";",
"const",
"visTypes",
"=",
"this",
".",
"getFilteredVisTypes",
"(",
"this",
".",
"props",
".",
"visTypesRegistry",
",",
"query",
")",
";",
"return",
"(",
"<",
"React",
".",
"Fragment",
">",
"<",
"EuiModalHeader",
">",
"<",
"EuiModalHeaderTitle",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visualizations.newVisWizard.title\"",
"defaultMessage",
"=",
"\"New Visualization\"",
"/",
">",
"<",
"/EuiModalHeaderTitle>",
"<",
"/EuiModalHeader>",
"<",
"div",
"className",
"=",
"\"visNewVisDialog__body\"",
">",
"<",
"EuiFlexGroup",
"gutterSize",
"=",
"\"xl\"",
">",
"<",
"EuiFlexItem",
">",
"<",
"EuiFlexGroup",
"className",
"=",
"\"visNewVisDialog__list\"",
"direction",
"=",
"\"column\"",
"gutterSize",
"=",
"\"none\"",
"responsive",
"=",
"{",
"false",
"}",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
"className",
"=",
"\"visNewVisDialog__searchWrapper\"",
">",
"<",
"EuiFieldSearch",
"placeholder",
"=",
"\"Filter\"",
"value",
"=",
"{",
"query",
"}",
"onChange",
"=",
"{",
"this",
".",
"onQueryChange",
"}",
"fullWidth",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"filterVisType\"",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visualizations.newVisWizard.filterVisTypeAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Filter for a visualization type'",
",",
"}",
")",
"}",
"/>",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"1",
"}",
"className",
"=",
"\"visNewVisDialog__typesWrapper\"",
">",
"<",
"EuiScreenReaderOnly",
">",
"<",
"span",
"aria",
"-",
"live",
"=",
"\"polite\"",
">",
"{",
"query",
"&&",
"(",
"<",
"FormattedMessage",
"id",
"=",
"\"visualizations.newVisWizard.resultsFound\"",
"defaultMessage",
"=",
"\"{resultCount} {resultCount, plural,",
"one",
"{",
"type",
"}",
"other",
"{",
"types",
"}",
"}",
"found",
"\" values={{",
"resultCount",
":",
"visTypes",
".",
"filter",
"(",
"(",
"type",
")",
"=>",
"type",
".",
"highlighted",
")",
".",
"length",
",",
"}",
"}",
"/>)}",
"<",
"/span>",
"<",
"/EuiScreenReaderOnly>",
"<",
"EuiKeyPadMenu",
"className",
"=",
"\"visNewVisDialog__types\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"visNewDialogTypes\"",
">",
"{",
"visTypes",
".",
"map",
"(",
"this",
".",
"renderVisType",
")",
"}",
"<",
"/EuiKeyPadMenu>",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"className",
"=",
"\"visNewVisDialog__description\"",
"grow",
"=",
"{",
"false",
"}",
">",
"{",
"highlightedType",
"?",
"(",
"<",
"VisHelpText",
"{",
"...",
"highlightedType",
"}",
"/",
">",
")",
":",
"(",
"<",
"React",
".",
"Fragment",
">",
"<",
"EuiTitle",
"size",
"=",
"\"s\"",
">",
"<",
"h2",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visualizations.newVisWizard.selectVisType\"",
"defaultMessage",
"=",
"\"Select a visualization type\"",
"/",
">",
"<",
"/h2>",
"<",
"/EuiTitle>",
"<",
"EuiSpacer",
"size",
"=",
"\"m\"",
"/",
">",
"<",
"NewVisHelp",
"promotedTypes",
"=",
"{",
"visTypes",
".",
"map",
"(",
"(",
"t",
")",
"=>",
"t",
".",
"type",
")",
".",
"filter",
"(",
"(",
"t",
")",
":",
"t",
"is",
"VisTypeAlias",
"=>",
"isVisTypeAlias",
"(",
"t",
")",
"&&",
"Boolean",
"(",
"t",
".",
"promotion",
")",
")",
"}",
"onPromotionClicked",
"=",
"{",
"this",
".",
"props",
".",
"onVisTypeSelected",
"}",
"/",
">",
"<",
"/React.Fragment>)}",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>",
"<",
"/div>",
"<",
"/React.Fragment>);",
"}",
"private",
"filteredVisTypes",
"(",
"visTypes",
",",
"query",
")",
"{",
"const",
"types",
"=",
"visTypes",
".",
"all",
"(",
")",
".",
"filter",
"(",
"(",
"type",
")",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"props",
".",
"showExperimental",
"&&",
"type",
".",
"stage",
"===",
"'experimental'",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"type",
".",
"hidden",
")",
"{",
"return",
"false",
";",
"}",
"return",
"true",
";",
"}",
")",
";",
"const",
"allTypes",
"=",
"[",
"...",
"types",
",",
"...",
"visTypes",
".",
"getAliases",
"(",
")",
"]",
";",
"let",
"entries",
";",
"if",
"(",
"!",
"query",
")",
"{",
"entries",
"=",
"allTypes",
".",
"map",
"(",
"(",
"type",
")",
"=>",
"(",
"{",
"type",
",",
"highlighted",
":",
"false",
"}",
")",
")",
";",
"}",
"else",
"{",
"const",
"q",
"=",
"query",
".",
"toLowerCase",
"(",
")",
";",
"entries",
"=",
"allTypes",
".",
"map",
"(",
"(",
"type",
")",
"=>",
"{",
"const",
"matchesQuery",
"=",
"type",
".",
"name",
".",
"toLowerCase",
"(",
")",
".",
"includes",
"(",
"q",
")",
"||",
"type",
".",
"title",
".",
"toLowerCase",
"(",
")",
".",
"includes",
"(",
"q",
")",
"||",
"(",
"typeof",
"type",
".",
"description",
"===",
"'string'",
"&&",
"type",
".",
"description",
".",
"toLowerCase",
"(",
")",
".",
"includes",
"(",
"q",
")",
")",
";",
"return",
"{",
"type",
",",
"highlighted",
":",
"matchesQuery",
"}",
";",
"}",
")",
";",
"}",
"return",
"orderBy",
"(",
"entries",
",",
"[",
"'highlighted'",
",",
"'type.promotion'",
",",
"'type.title'",
"]",
",",
"[",
"'desc'",
",",
"'asc'",
",",
"'asc'",
"]",
")",
";",
"}",
"private",
"renderVisType",
"=",
"(",
"visType",
")",
"=>",
"{",
"let",
"stage",
"=",
"{",
"}",
";",
"let",
"highlightMsg",
";",
"if",
"(",
"!",
"isVisTypeAlias",
"(",
"visType",
".",
"type",
")",
"&&",
"visType",
".",
"type",
".",
"stage",
"===",
"'experimental'",
")",
"{",
"stage",
"=",
"{",
"betaBadgeLabel",
":",
"i18n",
".",
"translate",
"(",
"'visualizations.newVisWizard.experimentalTitle'",
",",
"{",
"defaultMessage",
":",
"'Experimental'",
",",
"}",
")",
",",
"betaBadgeTooltipContent",
":",
"i18n",
".",
"translate",
"(",
"'visualizations.newVisWizard.experimentalTooltip'",
",",
"{",
"defaultMessage",
":",
"'This visualization might be changed or removed in a future release and is not subject to the support SLA.'",
",",
"}",
")",
",",
"}",
";",
"highlightMsg",
"=",
"i18n",
".",
"translate",
"(",
"'visualizations.newVisWizard.experimentalDescription'",
",",
"{",
"defaultMessage",
":",
"'This visualization is experimental. The design and implementation are less mature than stable visualizations and might be subject to change.'",
",",
"}",
")",
";",
"}",
"else",
"if",
"(",
"isVisTypeAlias",
"(",
"visType",
".",
"type",
")",
"&&",
"visType",
".",
"type",
".",
"stage",
"===",
"'beta'",
")",
"{",
"const",
"aliasDescription",
"=",
"i18n",
".",
"translate",
"(",
"'visualizations.newVisWizard.betaDescription'",
",",
"{",
"defaultMessage",
":",
"'This visualization is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features'",
",",
"}",
")",
";",
"stage",
"=",
"{",
"betaBadgeLabel",
":",
"i18n",
".",
"translate",
"(",
"'visualizations.newVisWizard.betaTitle'",
",",
"{",
"defaultMessage",
":",
"'Beta'",
",",
"}",
")",
",",
"betaBadgeTooltipContent",
":",
"aliasDescription",
",",
"}",
";",
"highlightMsg",
"=",
"aliasDescription",
";",
"}",
"const",
"isDisabled",
"=",
"this",
".",
"state",
".",
"query",
"!==",
"''",
"&&",
"!",
"visType",
".",
"highlighted",
";",
"const",
"onClick",
"=",
"(",
")",
"=>",
"this",
".",
"props",
".",
"onVisTypeSelected",
"(",
"visType",
".",
"type",
")",
";",
"const",
"highlightedType",
"=",
"{",
"title",
":",
"visType",
".",
"type",
".",
"title",
",",
"name",
":",
"visType",
".",
"type",
".",
"name",
",",
"description",
":",
"visType",
".",
"type",
".",
"description",
",",
"highlightMsg",
",",
"}",
";",
"return",
"(",
"<",
"EuiKeyPadMenuItem",
"key",
"=",
"{",
"visType",
".",
"type",
".",
"name",
"}",
"label",
"=",
"{",
"<",
"span",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"visTypeTitle\"",
">",
"{",
"visType",
".",
"type",
".",
"title",
"}",
"<",
"/span>} onClick={onClick} onFocus={() => this.setHighlightType(highlightedType)} onMouseEnter={() => this.setHighlightType(highlightedType)} onMouseLeave={() => this.setHighlightType(null)} onBlur={() => this.setHighlightType(null)} className=\"visNewVisDialog__type\" data-test-subj={`visType-${visType.type.name}`} data-vis-stage={!isVisTypeAlias(visType.type) ? visType.type.stage : 'alias'} disabled={isDisabled} aria-describedby={`visTypeDescription-${visType.type.name}`} {...stage}>",
"<",
"VisTypeIcon",
"icon",
"=",
"{",
"visType",
".",
"type",
".",
"icon",
"===",
"'visTimeline'",
"?",
"'visTimelion'",
":",
"visType",
".",
"type",
".",
"icon",
"}",
"image",
"=",
"{",
"'image'",
"in",
"visType",
".",
"type",
"?",
"visType",
".",
"type",
".",
"image",
":",
"'visTimelion'",
"}",
"/",
">",
"<",
"/EuiKeyPadMenuItem>);",
"}",
";",
"private",
"setHighlightType",
"(",
"highlightedType",
")",
"{",
"this",
".",
"setState",
"(",
"{",
"highlightedType",
",",
"}",
")",
";",
"}",
"private",
"onQueryChange",
"=",
"(",
"ev",
")",
"=>",
"{",
"this",
".",
"setState",
"(",
"{",
"query",
":",
"ev",
".",
"target",
".",
"value",
",",
"}",
")",
";",
"}",
";",
"}",
"export",
"{",
"TypeSelection",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661659 | [
"export",
"const",
"VISUALIZE_ENABLE_LABS_SETTING",
"=",
"'visualize:enableLabs'",
";"
] | [
null,
null,
2,
null,
null,
null
] |
661660 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiModal",
",",
"EuiOverlayMask",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"METRIC_TYPE",
",",
"UiStatsMetricType",
"}",
"from",
"'@osd/analytics'",
";",
"import",
"{",
"ApplicationStart",
",",
"IUiSettingsClient",
",",
"SavedObjectsStart",
"}",
"from",
"'../../../../core/public'",
";",
"import",
"{",
"SearchSelection",
"}",
"from",
"'./search_selection'",
";",
"import",
"{",
"TypeSelection",
"}",
"from",
"'./type_selection'",
";",
"import",
"{",
"TypesStart",
",",
"VisType",
",",
"VisTypeAlias",
"}",
"from",
"'../vis_types'",
";",
"import",
"{",
"UsageCollectionSetup",
"}",
"from",
"'../../../usage_collection/public'",
";",
"import",
"{",
"EmbeddableStateTransfer",
"}",
"from",
"'../../../embeddable/public'",
";",
"import",
"{",
"VISUALIZE_ENABLE_LABS_SETTING",
"}",
"from",
"'../../common/constants'",
";",
"interface",
"TypeSelectionProps",
"{",
"isOpen",
":",
"boolean",
";",
"onClose",
":",
"(",
")",
"=>",
"void",
";",
"visTypesRegistry",
":",
"TypesStart",
";",
"editorParams",
"?",
":",
"string",
"[",
"]",
";",
"addBasePath",
":",
"(",
"path",
":",
"string",
")",
"=>",
"string",
";",
"uiSettings",
":",
"IUiSettingsClient",
";",
"savedObjects",
":",
"SavedObjectsStart",
";",
"usageCollection",
"?",
":",
"UsageCollectionSetup",
";",
"application",
":",
"ApplicationStart",
";",
"outsideVisualizeApp",
"?",
":",
"boolean",
";",
"stateTransfer",
"?",
":",
"EmbeddableStateTransfer",
";",
"originatingApp",
"?",
":",
"string",
";",
"}",
"interface",
"TypeSelectionState",
"{",
"showSearchVisModal",
":",
"boolean",
";",
"visType",
"?",
":",
"VisType",
";",
"}",
"const",
"basePath",
"=",
"`/create?`",
";",
"const",
"baseUrl",
"=",
"`/app/visualize#${",
"basePath",
"}`",
";",
"class",
"NewVisModal",
"extends",
"React",
".",
"Component",
"<",
"TypeSelectionProps",
",",
"TypeSelectionState",
">",
"{",
"public",
"static",
"defaultProps",
"=",
"{",
"editorParams",
":",
"[",
"]",
",",
"}",
";",
"private",
"readonly",
"isLabsEnabled",
":",
"boolean",
";",
"private",
"readonly",
"trackUiMetric",
":",
"(",
"(",
"type",
":",
"UiStatsMetricType",
",",
"eventNames",
":",
"string",
"|",
"string",
"[",
"]",
",",
"count",
"?",
":",
"number",
")",
"=>",
"void",
")",
"|",
"undefined",
";",
"constructor",
"(",
"props",
")",
"{",
"super",
"(",
"props",
")",
";",
"this",
".",
"isLabsEnabled",
"=",
"props",
".",
"uiSettings",
".",
"get",
"(",
"VISUALIZE_ENABLE_LABS_SETTING",
")",
";",
"this",
".",
"state",
"=",
"{",
"showSearchVisModal",
":",
"false",
",",
"}",
";",
"this",
".",
"trackUiMetric",
"=",
"this",
".",
"props",
".",
"usageCollection",
"?.",
"reportUiStats",
".",
"bind",
"(",
"this",
".",
"props",
".",
"usageCollection",
",",
"'visualize'",
")",
";",
"}",
"public",
"render",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"props",
".",
"isOpen",
")",
"{",
"return",
"null",
";",
"}",
"const",
"visNewVisDialogAriaLabel",
"=",
"i18n",
".",
"translate",
"(",
"'visualizations.newVisWizard.helpTextAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Start creating your visualization by selecting a type for that visualization. Hit escape to close this modal. Hit Tab key to go further.'",
",",
"}",
")",
";",
"const",
"selectionModal",
"=",
"this",
".",
"state",
".",
"showSearchVisModal",
"&&",
"this",
".",
"state",
".",
"visType",
"?",
"(",
"<",
"EuiModal",
"onClose",
"=",
"{",
"this",
".",
"onCloseModal",
"}",
"className",
"=",
"\"visNewVisSearchDialog\"",
">",
"<",
"SearchSelection",
"onSearchSelected",
"=",
"{",
"this",
".",
"onSearchSelected",
"}",
"visType",
"=",
"{",
"this",
".",
"state",
".",
"visType",
"}",
"uiSettings",
"=",
"{",
"this",
".",
"props",
".",
"uiSettings",
"}",
"savedObjects",
"=",
"{",
"this",
".",
"props",
".",
"savedObjects",
"}",
"/",
">",
"<",
"/EuiModal>) : (<EuiModal onClose={this.onCloseModal} className=\"visNewVisDialog\" aria-label={visNewVisDialogAriaLabel}>",
"<",
"TypeSelection",
"showExperimental",
"=",
"{",
"this",
".",
"isLabsEnabled",
"}",
"onVisTypeSelected",
"=",
"{",
"this",
".",
"onVisTypeSelected",
"}",
"visTypesRegistry",
"=",
"{",
"this",
".",
"props",
".",
"visTypesRegistry",
"}",
"addBasePath",
"=",
"{",
"this",
".",
"props",
".",
"addBasePath",
"}",
"/",
">",
"<",
"/EuiModal>);",
"return",
"<",
"EuiOverlayMask",
">",
"{",
"selectionModal",
"}",
"<",
"/EuiOverlayMask>;",
"}",
"private",
"onCloseModal",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"setState",
"(",
"{",
"showSearchVisModal",
":",
"false",
"}",
")",
";",
"this",
".",
"props",
".",
"onClose",
"(",
")",
";",
"}",
";",
"private",
"onVisTypeSelected",
"=",
"(",
"visType",
")",
"=>",
"{",
"if",
"(",
"!",
"(",
"'aliasPath'",
"in",
"visType",
")",
"&&",
"visType",
".",
"requiresSearch",
"&&",
"visType",
".",
"options",
".",
"showIndexSelection",
")",
"{",
"this",
".",
"setState",
"(",
"{",
"showSearchVisModal",
":",
"true",
",",
"visType",
",",
"}",
")",
";",
"}",
"else",
"{",
"this",
".",
"redirectToVis",
"(",
"visType",
")",
";",
"}",
"}",
";",
"private",
"onSearchSelected",
"=",
"(",
"searchId",
",",
"searchType",
")",
"=>",
"{",
"this",
".",
"redirectToVis",
"(",
"this",
".",
"state",
".",
"visType",
"!",
",",
"searchType",
",",
"searchId",
")",
";",
"}",
";",
"private",
"redirectToVis",
"(",
"visType",
",",
"searchType",
"?",
",",
"searchId",
"?",
")",
"{",
"if",
"(",
"this",
".",
"trackUiMetric",
")",
"{",
"this",
".",
"trackUiMetric",
"(",
"METRIC_TYPE",
".",
"CLICK",
",",
"visType",
".",
"name",
")",
";",
"}",
"let",
"params",
";",
"if",
"(",
"'aliasPath'",
"in",
"visType",
")",
"{",
"params",
"=",
"visType",
".",
"aliasPath",
";",
"this",
".",
"props",
".",
"onClose",
"(",
")",
";",
"this",
".",
"navigate",
"(",
"visType",
".",
"aliasApp",
",",
"visType",
".",
"aliasPath",
")",
";",
"return",
";",
"}",
"params",
"=",
"[",
"`type=${",
"encodeURIComponent",
"(",
"visType",
".",
"name",
")",
"}`",
"]",
";",
"if",
"(",
"searchType",
")",
"{",
"params",
".",
"push",
"(",
"`${",
"searchType",
"===",
"'search'",
"?",
"'savedSearchId'",
":",
"'indexPattern'",
"}=${",
"searchId",
"}`",
")",
";",
"}",
"params",
"=",
"params",
".",
"concat",
"(",
"this",
".",
"props",
".",
"editorParams",
"!",
")",
";",
"this",
".",
"props",
".",
"onClose",
"(",
")",
";",
"if",
"(",
"this",
".",
"props",
".",
"outsideVisualizeApp",
")",
"{",
"this",
".",
"navigate",
"(",
"'visualize'",
",",
"`#${",
"basePath",
"}${",
"params",
".",
"join",
"(",
"'&'",
")",
"}`",
")",
";",
"}",
"else",
"{",
"location",
".",
"assign",
"(",
"this",
".",
"props",
".",
"addBasePath",
"(",
"`${",
"baseUrl",
"}${",
"params",
".",
"join",
"(",
"'&'",
")",
"}`",
")",
")",
";",
"}",
"}",
"private",
"navigate",
"(",
"appId",
",",
"params",
")",
"{",
"if",
"(",
"this",
".",
"props",
".",
"stateTransfer",
"&&",
"this",
".",
"props",
".",
"originatingApp",
")",
"{",
"this",
".",
"props",
".",
"stateTransfer",
".",
"navigateToEditor",
"(",
"appId",
",",
"{",
"path",
":",
"params",
",",
"state",
":",
"{",
"originatingApp",
":",
"this",
".",
"props",
".",
"originatingApp",
",",
"}",
",",
"}",
")",
";",
"}",
"else",
"{",
"this",
".",
"props",
".",
"application",
".",
"navigateToApp",
"(",
"appId",
",",
"{",
"path",
":",
"params",
",",
"}",
")",
";",
"}",
"}",
"}",
"export",
"{",
"NewVisModal",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
24395,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661661 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"ReactDOM",
"from",
"'react-dom'",
";",
"import",
"{",
"I18nProvider",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"NewVisModal",
"}",
"from",
"'./new_vis_modal'",
";",
"import",
"{",
"getHttp",
",",
"getSavedObjects",
",",
"getTypes",
",",
"getUISettings",
",",
"getUsageCollector",
",",
"getApplication",
",",
"getEmbeddable",
",",
"}",
"from",
"'../services'",
";",
"export",
"interface",
"ShowNewVisModalParams",
"{",
"editorParams",
"?",
":",
"string",
"[",
"]",
";",
"onClose",
"?",
":",
"(",
")",
"=>",
"void",
";",
"originatingApp",
"?",
":",
"string",
";",
"outsideVisualizeApp",
"?",
":",
"boolean",
";",
"createByValue",
"?",
":",
"boolean",
";",
"}",
"param",
"{",
"string",
"[",
"]",
"}",
"editorParams",
"param",
"{",
"function",
"}",
"onClose",
"export",
"function",
"showNewVisModal",
"(",
"{",
"editorParams",
"=",
"[",
"]",
",",
"onClose",
",",
"originatingApp",
",",
"outsideVisualizeApp",
",",
"}",
"=",
"{",
"}",
")",
"{",
"const",
"container",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"let",
"isClosed",
"=",
"false",
";",
"const",
"handleClose",
"=",
"(",
")",
"=>",
"{",
"if",
"(",
"isClosed",
")",
"return",
";",
"ReactDOM",
".",
"unmountComponentAtNode",
"(",
"container",
")",
";",
"document",
".",
"body",
".",
"removeChild",
"(",
"container",
")",
";",
"if",
"(",
"onClose",
")",
"{",
"onClose",
"(",
")",
";",
"}",
"isClosed",
"=",
"true",
";",
"}",
";",
"document",
".",
"body",
".",
"appendChild",
"(",
"container",
")",
";",
"const",
"element",
"=",
"(",
"<",
"I18nProvider",
">",
"<",
"NewVisModal",
"isOpen",
"=",
"{",
"true",
"}",
"onClose",
"=",
"{",
"handleClose",
"}",
"originatingApp",
"=",
"{",
"originatingApp",
"}",
"stateTransfer",
"=",
"{",
"getEmbeddable",
"(",
")",
".",
"getStateTransfer",
"(",
")",
"}",
"outsideVisualizeApp",
"=",
"{",
"outsideVisualizeApp",
"}",
"editorParams",
"=",
"{",
"editorParams",
"}",
"visTypesRegistry",
"=",
"{",
"getTypes",
"(",
")",
"}",
"addBasePath",
"=",
"{",
"getHttp",
"(",
")",
".",
"basePath",
".",
"prepend",
"}",
"uiSettings",
"=",
"{",
"getUISettings",
"(",
")",
"}",
"savedObjects",
"=",
"{",
"getSavedObjects",
"(",
")",
"}",
"usageCollection",
"=",
"{",
"getUsageCollector",
"(",
")",
"}",
"application",
"=",
"{",
"getApplication",
"(",
")",
"}",
"/",
">",
"<",
"/I18nProvider>);",
"ReactDOM",
".",
"render",
"(",
"element",
",",
"container",
")",
";",
"return",
"(",
")",
"=>",
"handleClose",
"(",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661662 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"SavedObjectMetaData",
",",
"OnSaveProps",
"}",
"from",
"'src/plugins/saved_objects/public'",
";",
"import",
"{",
"first",
"}",
"from",
"'rxjs/operators'",
";",
"import",
"{",
"SavedObjectAttributes",
"}",
"from",
"'../../../../core/public'",
";",
"import",
"{",
"EmbeddableFactoryDefinition",
",",
"EmbeddableOutput",
",",
"ErrorEmbeddable",
",",
"IContainer",
",",
"}",
"from",
"'../../../embeddable/public'",
";",
"import",
"{",
"DisabledLabEmbeddable",
"}",
"from",
"'./disabled_lab_embeddable'",
";",
"import",
"{",
"VisualizeByReferenceInput",
",",
"VisualizeByValueInput",
",",
"VisualizeEmbeddable",
",",
"VisualizeInput",
",",
"VisualizeOutput",
",",
"VisualizeSavedObjectAttributes",
",",
"}",
"from",
"'./visualize_embeddable'",
";",
"import",
"{",
"VISUALIZE_EMBEDDABLE_TYPE",
"}",
"from",
"'./constants'",
";",
"import",
"{",
"SerializedVis",
",",
"Vis",
"}",
"from",
"'../vis'",
";",
"import",
"{",
"getCapabilities",
",",
"getTypes",
",",
"getUISettings",
",",
"getSavedVisualizationsLoader",
",",
"}",
"from",
"'../services'",
";",
"import",
"{",
"showNewVisModal",
"}",
"from",
"'../wizard'",
";",
"import",
"{",
"convertToSerializedVis",
"}",
"from",
"'../saved_visualizations/_saved_vis'",
";",
"import",
"{",
"createVisEmbeddableFromObject",
"}",
"from",
"'./create_vis_embeddable_from_object'",
";",
"import",
"{",
"StartServicesGetter",
"}",
"from",
"'../../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"VisualizationsStartDeps",
"}",
"from",
"'../plugin'",
";",
"import",
"{",
"VISUALIZE_ENABLE_LABS_SETTING",
"}",
"from",
"'../../common/constants'",
";",
"import",
"{",
"AttributeService",
"}",
"from",
"'../../../dashboard/public'",
";",
"import",
"{",
"checkForDuplicateTitle",
"}",
"from",
"'../../../saved_objects/public'",
";",
"interface",
"VisualizationAttributes",
"extends",
"SavedObjectAttributes",
"{",
"visState",
":",
"string",
";",
"}",
"export",
"interface",
"VisualizeEmbeddableFactoryDeps",
"{",
"start",
":",
"StartServicesGetter",
"<",
"Pick",
"<",
"VisualizationsStartDeps",
",",
"'inspector'",
"|",
"'embeddable'",
"|",
"'dashboard'",
"|",
"'savedObjectsClient'",
">",
">",
";",
"}",
"export",
"class",
"VisualizeEmbeddableFactory",
"implements",
"EmbeddableFactoryDefinition",
"<",
"VisualizeInput",
",",
"VisualizeOutput",
"|",
"EmbeddableOutput",
",",
"VisualizeEmbeddable",
"|",
"DisabledLabEmbeddable",
",",
"VisualizationAttributes",
">",
"{",
"public",
"readonly",
"type",
"=",
"VISUALIZE_EMBEDDABLE_TYPE",
";",
"private",
"attributeService",
"?",
":",
"AttributeService",
"<",
"VisualizeSavedObjectAttributes",
",",
"VisualizeByValueInput",
",",
"VisualizeByReferenceInput",
">",
";",
"public",
"readonly",
"savedObjectMetaData",
":",
"SavedObjectMetaData",
"<",
"VisualizationAttributes",
">",
"=",
"{",
"name",
":",
"i18n",
".",
"translate",
"(",
"'visualizations.savedObjectName'",
",",
"{",
"defaultMessage",
":",
"'Visualization'",
"}",
")",
",",
"includeFields",
":",
"[",
"'visState'",
"]",
",",
"type",
":",
"'visualization'",
",",
"getIconForSavedObject",
":",
"(",
"savedObject",
")",
"=>",
"{",
"return",
"(",
"getTypes",
"(",
")",
".",
"get",
"(",
"JSON",
".",
"parse",
"(",
"savedObject",
".",
"attributes",
".",
"visState",
")",
".",
"type",
")",
".",
"icon",
"||",
"'visualizeApp'",
")",
";",
"}",
",",
"getTooltipForSavedObject",
":",
"(",
"savedObject",
")",
"=>",
"{",
"return",
"`${",
"savedObject",
".",
"attributes",
".",
"title",
"} (${",
"getTypes",
"(",
")",
".",
"get",
"(",
"JSON",
".",
"parse",
"(",
"savedObject",
".",
"attributes",
".",
"visState",
")",
".",
"type",
")",
".",
"title",
"})`",
";",
"}",
",",
"showSavedObject",
":",
"(",
"savedObject",
")",
"=>",
"{",
"const",
"typeName",
"=",
"JSON",
".",
"parse",
"(",
"savedObject",
".",
"attributes",
".",
"visState",
")",
".",
"type",
";",
"const",
"visType",
"=",
"getTypes",
"(",
")",
".",
"get",
"(",
"typeName",
")",
";",
"if",
"(",
"!",
"visType",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"getUISettings",
"(",
")",
".",
"get",
"(",
"VISUALIZE_ENABLE_LABS_SETTING",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"visType",
".",
"stage",
"!==",
"'experimental'",
";",
"}",
",",
"}",
";",
"constructor",
"(",
"private",
"readonly",
"deps",
")",
"{",
"}",
"public",
"async",
"isEditable",
"(",
")",
"{",
"return",
"getCapabilities",
"(",
")",
".",
"visualize",
".",
"save",
"as",
"boolean",
";",
"}",
"public",
"getDisplayName",
"(",
")",
"{",
"return",
"i18n",
".",
"translate",
"(",
"'visualizations.displayName'",
",",
"{",
"defaultMessage",
":",
"'visualization'",
",",
"}",
")",
";",
"}",
"public",
"async",
"getCurrentAppId",
"(",
")",
"{",
"return",
"await",
"this",
".",
"deps",
".",
"start",
"(",
")",
".",
"core",
".",
"application",
".",
"currentAppId$",
".",
"pipe",
"(",
"first",
"(",
")",
")",
".",
"toPromise",
"(",
")",
";",
"}",
"private",
"async",
"getAttributeService",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"attributeService",
")",
"{",
"this",
".",
"attributeService",
"=",
"await",
"this",
".",
"deps",
".",
"start",
"(",
")",
".",
"plugins",
".",
"dashboard",
".",
"getAttributeService",
"<",
"VisualizeSavedObjectAttributes",
",",
"VisualizeByValueInput",
",",
"VisualizeByReferenceInput",
">",
"(",
"this",
".",
"type",
",",
"{",
"saveMethod",
":",
"this",
".",
"saveMethod",
".",
"bind",
"(",
"this",
")",
",",
"checkForDuplicateTitle",
":",
"this",
".",
"checkTitle",
".",
"bind",
"(",
"this",
")",
",",
"}",
")",
";",
"}",
"return",
"this",
".",
"attributeService",
"!",
";",
"}",
"public",
"async",
"createFromSavedObject",
"(",
"savedObjectId",
",",
"input",
",",
"parent",
"?",
")",
"{",
"const",
"savedVisualizations",
"=",
"getSavedVisualizationsLoader",
"(",
")",
";",
"try",
"{",
"const",
"savedObject",
"=",
"await",
"savedVisualizations",
".",
"get",
"(",
"savedObjectId",
")",
";",
"const",
"visState",
"=",
"convertToSerializedVis",
"(",
"savedObject",
")",
";",
"const",
"vis",
"=",
"new",
"Vis",
"(",
"savedObject",
".",
"visState",
".",
"type",
",",
"visState",
")",
";",
"await",
"vis",
".",
"setState",
"(",
"visState",
")",
";",
"return",
"createVisEmbeddableFromObject",
"(",
"this",
".",
"deps",
")",
"(",
"vis",
",",
"input",
",",
"savedVisualizations",
",",
"await",
"this",
".",
"getAttributeService",
"(",
")",
",",
"parent",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"console",
".",
"error",
"(",
"e",
")",
";",
"return",
"new",
"ErrorEmbeddable",
"(",
"e",
",",
"input",
",",
"parent",
")",
";",
"}",
"}",
"public",
"async",
"create",
"(",
"input",
",",
"parent",
"?",
")",
"{",
"if",
"(",
"input",
".",
"savedVis",
")",
"{",
"const",
"visState",
"=",
"input",
".",
"savedVis",
";",
"const",
"vis",
"=",
"new",
"Vis",
"(",
"visState",
".",
"type",
",",
"visState",
")",
";",
"await",
"vis",
".",
"setState",
"(",
"visState",
")",
";",
"const",
"savedVisualizations",
"=",
"getSavedVisualizationsLoader",
"(",
")",
";",
"return",
"createVisEmbeddableFromObject",
"(",
"this",
".",
"deps",
")",
"(",
"vis",
",",
"input",
",",
"savedVisualizations",
",",
"await",
"this",
".",
"getAttributeService",
"(",
")",
",",
"parent",
")",
";",
"}",
"else",
"{",
"showNewVisModal",
"(",
"{",
"originatingApp",
":",
"await",
"this",
".",
"getCurrentAppId",
"(",
")",
",",
"outsideVisualizeApp",
":",
"true",
",",
"}",
")",
";",
"return",
"undefined",
";",
"}",
"}",
"private",
"async",
"saveMethod",
"(",
"attributes",
")",
"{",
"try",
"{",
"const",
"{",
"title",
",",
"savedVis",
"}",
"=",
"attributes",
";",
"const",
"visObj",
"=",
"attributes",
".",
"vis",
";",
"if",
"(",
"!",
"savedVis",
")",
"{",
"throw",
"new",
"Error",
"(",
"'No Saved Vis'",
")",
";",
"}",
"const",
"saveOptions",
"=",
"{",
"confirmOverwrite",
":",
"false",
",",
"returnToOrigin",
":",
"true",
",",
"}",
";",
"savedVis",
".",
"title",
"=",
"title",
";",
"savedVis",
".",
"copyOnSave",
"=",
"false",
";",
"savedVis",
".",
"description",
"=",
"''",
";",
"savedVis",
".",
"searchSourceFields",
"=",
"visObj",
"?.",
"data",
".",
"searchSource",
"?.",
"getSerializedFields",
"(",
")",
";",
"const",
"serializedVis",
"=",
"(",
"(",
"visObj",
"as",
"unknown",
")",
"as",
"Vis",
")",
".",
"serialize",
"(",
")",
";",
"const",
"{",
"params",
",",
"data",
"}",
"=",
"serializedVis",
";",
"savedVis",
".",
"visState",
"=",
"{",
"title",
",",
"type",
":",
"serializedVis",
".",
"type",
",",
"params",
",",
"aggs",
":",
"data",
".",
"aggs",
",",
"}",
";",
"if",
"(",
"visObj",
")",
"{",
"savedVis",
".",
"uiStateJSON",
"=",
"visObj",
"?.",
"uiState",
".",
"toString",
"(",
")",
";",
"}",
"const",
"id",
"=",
"await",
"savedVis",
".",
"save",
"(",
"saveOptions",
")",
";",
"if",
"(",
"!",
"id",
"||",
"id",
"===",
"''",
")",
"{",
"throw",
"new",
"Error",
"(",
"i18n",
".",
"translate",
"(",
"'visualizations.savingVisualizationFailed.errorMsg'",
",",
"{",
"defaultMessage",
":",
"'Saving a visualization failed'",
",",
"}",
")",
")",
";",
"}",
"return",
"{",
"id",
"}",
";",
"}",
"catch",
"(",
"error",
")",
"{",
"throw",
"error",
";",
"}",
"}",
"public",
"async",
"checkTitle",
"(",
"props",
")",
"{",
"const",
"savedObjectsClient",
"=",
"await",
"this",
".",
"deps",
".",
"start",
"(",
")",
".",
"core",
".",
"savedObjects",
".",
"client",
";",
"const",
"overlays",
"=",
"await",
"this",
".",
"deps",
".",
"start",
"(",
")",
".",
"core",
".",
"overlays",
";",
"return",
"checkForDuplicateTitle",
"(",
"{",
"title",
":",
"props",
".",
"newTitle",
",",
"copyOnSave",
":",
"false",
",",
"lastSavedTitle",
":",
"''",
",",
"getOpenSearchType",
":",
"(",
")",
"=>",
"this",
".",
"type",
",",
"getDisplayName",
":",
"this",
".",
"getDisplayName",
"||",
"(",
"(",
")",
"=>",
"this",
".",
"type",
")",
",",
"}",
",",
"props",
".",
"isTitleDuplicateConfirmed",
",",
"props",
".",
"onTitleDuplicate",
",",
"{",
"savedObjectsClient",
",",
"overlays",
",",
"}",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5837,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
23201,
null,
null,
null,
null,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
2,
null,
null,
null,
1210,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2528,
null,
null,
null,
null,
null,
null,
null,
1742,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
1210,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2528,
null,
null,
null,
null,
null,
null,
1742,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
12656,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2528,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
9637,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661663 | [
"import",
"_",
",",
"{",
"get",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"Subscription",
"}",
"from",
"'rxjs'",
";",
"import",
"*",
"as",
"Rx",
"from",
"'rxjs'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"VISUALIZE_EMBEDDABLE_TYPE",
"}",
"from",
"'./constants'",
";",
"import",
"{",
"IIndexPattern",
",",
"TimeRange",
",",
"Query",
",",
"opensearchFilters",
",",
"Filter",
",",
"TimefilterContract",
",",
"}",
"from",
"'../../../../plugins/data/public'",
";",
"import",
"{",
"EmbeddableInput",
",",
"EmbeddableOutput",
",",
"Embeddable",
",",
"IContainer",
",",
"Adapters",
",",
"SavedObjectEmbeddableInput",
",",
"ReferenceOrValueEmbeddable",
",",
"}",
"from",
"'../../../../plugins/embeddable/public'",
";",
"import",
"{",
"IExpressionLoaderParams",
",",
"ExpressionsStart",
",",
"ExpressionRenderError",
",",
"}",
"from",
"'../../../expressions/public'",
";",
"import",
"{",
"buildPipeline",
"}",
"from",
"'../legacy/build_pipeline'",
";",
"import",
"{",
"Vis",
",",
"SerializedVis",
"}",
"from",
"'../vis'",
";",
"import",
"{",
"getExpressions",
",",
"getUiActions",
"}",
"from",
"'../services'",
";",
"import",
"{",
"VIS_EVENT_TO_TRIGGER",
"}",
"from",
"'./events'",
";",
"import",
"{",
"VisualizeEmbeddableFactoryDeps",
"}",
"from",
"'./visualize_embeddable_factory'",
";",
"import",
"{",
"TriggerId",
"}",
"from",
"'../../../ui_actions/public'",
";",
"import",
"{",
"SavedObjectAttributes",
"}",
"from",
"'../../../../core/types'",
";",
"import",
"{",
"AttributeService",
"}",
"from",
"'../../../dashboard/public'",
";",
"import",
"{",
"SavedVisualizationsLoader",
"}",
"from",
"'../saved_visualizations'",
";",
"import",
"{",
"VisSavedObject",
"}",
"from",
"'../types'",
";",
"const",
"getKeys",
"=",
"<",
"T",
"extends",
"{",
"}",
">",
"(",
"o",
")",
":",
"Array",
"<",
"keyof",
"T",
">",
"=>",
"Object",
".",
"keys",
"(",
"o",
")",
"as",
"Array",
"<",
"keyof",
"T",
">",
";",
"export",
"interface",
"VisualizeEmbeddableConfiguration",
"{",
"vis",
":",
"Vis",
";",
"indexPatterns",
"?",
":",
"IIndexPattern",
"[",
"]",
";",
"editPath",
":",
"string",
";",
"editUrl",
":",
"string",
";",
"editable",
":",
"boolean",
";",
"deps",
":",
"VisualizeEmbeddableFactoryDeps",
";",
"}",
"export",
"interface",
"VisualizeInput",
"extends",
"EmbeddableInput",
"{",
"vis",
"?",
":",
"{",
"colors",
"?",
":",
"{",
"[",
"key",
"]",
":",
"string",
";",
"}",
";",
"}",
";",
"savedVis",
"?",
":",
"SerializedVis",
";",
"table",
"?",
":",
"unknown",
";",
"}",
"export",
"interface",
"VisualizeOutput",
"extends",
"EmbeddableOutput",
"{",
"editPath",
":",
"string",
";",
"editApp",
":",
"string",
";",
"editUrl",
":",
"string",
";",
"indexPatterns",
"?",
":",
"IIndexPattern",
"[",
"]",
";",
"visTypeName",
":",
"string",
";",
"}",
"export",
"type",
"VisualizeSavedObjectAttributes",
"=",
"SavedObjectAttributes",
"&",
"{",
"title",
":",
"string",
";",
"vis",
"?",
":",
"Vis",
";",
"savedVis",
"?",
":",
"VisSavedObject",
";",
"}",
";",
"export",
"type",
"VisualizeByValueInput",
"=",
"{",
"attributes",
":",
"VisualizeSavedObjectAttributes",
";",
"}",
"&",
"VisualizeInput",
";",
"export",
"type",
"VisualizeByReferenceInput",
"=",
"SavedObjectEmbeddableInput",
"&",
"VisualizeInput",
";",
"type",
"ExpressionLoader",
"=",
"InstanceType",
"<",
"ExpressionsStart",
"[",
"'ExpressionLoader'",
"]",
">",
";",
"export",
"class",
"VisualizeEmbeddable",
"extends",
"Embeddable",
"<",
"VisualizeInput",
",",
"VisualizeOutput",
">",
"implements",
"ReferenceOrValueEmbeddable",
"<",
"VisualizeByValueInput",
",",
"VisualizeByReferenceInput",
">",
"{",
"private",
"handler",
"?",
":",
"ExpressionLoader",
";",
"private",
"timefilter",
":",
"TimefilterContract",
";",
"private",
"timeRange",
"?",
":",
"TimeRange",
";",
"private",
"query",
"?",
":",
"Query",
";",
"private",
"filters",
"?",
":",
"Filter",
"[",
"]",
";",
"private",
"visCustomizations",
"?",
":",
"Pick",
"<",
"VisualizeInput",
",",
"'vis'",
"|",
"'table'",
">",
";",
"private",
"subscriptions",
":",
"Subscription",
"[",
"]",
"=",
"[",
"]",
";",
"private",
"expression",
":",
"string",
"=",
"''",
";",
"private",
"vis",
":",
"Vis",
";",
"private",
"domNode",
":",
"any",
";",
"public",
"readonly",
"type",
"=",
"VISUALIZE_EMBEDDABLE_TYPE",
";",
"private",
"autoRefreshFetchSubscription",
":",
"Subscription",
";",
"private",
"abortController",
"?",
":",
"AbortController",
";",
"private",
"readonly",
"deps",
":",
"VisualizeEmbeddableFactoryDeps",
";",
"private",
"readonly",
"inspectorAdapters",
"?",
":",
"Adapters",
";",
"private",
"attributeService",
"?",
":",
"AttributeService",
"<",
"VisualizeSavedObjectAttributes",
",",
"VisualizeByValueInput",
",",
"VisualizeByReferenceInput",
">",
";",
"private",
"savedVisualizationsLoader",
"?",
":",
"SavedVisualizationsLoader",
";",
"constructor",
"(",
"timefilter",
",",
"{",
"vis",
",",
"editPath",
",",
"editUrl",
",",
"indexPatterns",
",",
"editable",
",",
"deps",
"}",
",",
"initialInput",
",",
"attributeService",
"?",
",",
"savedVisualizationsLoader",
"?",
",",
"parent",
"?",
")",
"{",
"super",
"(",
"initialInput",
",",
"{",
"defaultTitle",
":",
"vis",
".",
"title",
",",
"editPath",
",",
"editApp",
":",
"'visualize'",
",",
"editUrl",
",",
"indexPatterns",
",",
"editable",
",",
"visTypeName",
":",
"vis",
".",
"type",
".",
"name",
",",
"}",
",",
"parent",
")",
";",
"this",
".",
"deps",
"=",
"deps",
";",
"this",
".",
"timefilter",
"=",
"timefilter",
";",
"this",
".",
"vis",
"=",
"vis",
";",
"this",
".",
"vis",
".",
"uiState",
".",
"on",
"(",
"'change'",
",",
"this",
".",
"uiStateChangeHandler",
")",
";",
"this",
".",
"vis",
".",
"uiState",
".",
"on",
"(",
"'reload'",
",",
"this",
".",
"reload",
")",
";",
"this",
".",
"attributeService",
"=",
"attributeService",
";",
"this",
".",
"savedVisualizationsLoader",
"=",
"savedVisualizationsLoader",
";",
"this",
".",
"autoRefreshFetchSubscription",
"=",
"timefilter",
".",
"getAutoRefreshFetch$",
"(",
")",
".",
"subscribe",
"(",
"this",
".",
"updateHandler",
".",
"bind",
"(",
"this",
")",
")",
";",
"this",
".",
"subscriptions",
".",
"push",
"(",
"Rx",
".",
"merge",
"(",
"this",
".",
"getOutput$",
"(",
")",
",",
"this",
".",
"getInput$",
"(",
")",
")",
".",
"subscribe",
"(",
"(",
")",
"=>",
"{",
"this",
".",
"handleChanges",
"(",
")",
";",
"}",
")",
")",
";",
"const",
"inspectorAdapters",
"=",
"this",
".",
"vis",
".",
"type",
".",
"inspectorAdapters",
";",
"if",
"(",
"inspectorAdapters",
")",
"{",
"this",
".",
"inspectorAdapters",
"=",
"typeof",
"inspectorAdapters",
"===",
"'function'",
"?",
"inspectorAdapters",
"(",
")",
":",
"inspectorAdapters",
";",
"}",
"}",
"public",
"getDescription",
"(",
")",
"{",
"return",
"this",
".",
"vis",
".",
"description",
";",
"}",
"public",
"getInspectorAdapters",
"=",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"handler",
"||",
"(",
"this",
".",
"inspectorAdapters",
"&&",
"!",
"Object",
".",
"keys",
"(",
"this",
".",
"inspectorAdapters",
")",
".",
"length",
")",
")",
"{",
"return",
"undefined",
";",
"}",
"return",
"this",
".",
"handler",
".",
"inspect",
"(",
")",
";",
"}",
";",
"public",
"openInspector",
"=",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"handler",
")",
"return",
";",
"const",
"adapters",
"=",
"this",
".",
"handler",
".",
"inspect",
"(",
")",
";",
"if",
"(",
"!",
"adapters",
")",
"return",
";",
"return",
"this",
".",
"deps",
".",
"start",
"(",
")",
".",
"plugins",
".",
"inspector",
".",
"open",
"(",
"adapters",
",",
"{",
"title",
":",
"this",
".",
"getTitle",
"(",
")",
",",
"}",
")",
";",
"}",
";",
"/**\n * Transfers all changes in the containerState.customization into\n * the uiState of this visualization.\n */",
"public",
"transferCustomizationsToUiState",
"(",
")",
"{",
"const",
"visCustomizations",
"=",
"{",
"vis",
":",
"this",
".",
"input",
".",
"vis",
",",
"table",
":",
"this",
".",
"input",
".",
"table",
"}",
";",
"if",
"(",
"visCustomizations",
".",
"vis",
"||",
"visCustomizations",
".",
"table",
")",
"{",
"if",
"(",
"!",
"_",
".",
"isEqual",
"(",
"visCustomizations",
",",
"this",
".",
"visCustomizations",
")",
")",
"{",
"this",
".",
"visCustomizations",
"=",
"visCustomizations",
";",
"this",
".",
"vis",
".",
"uiState",
".",
"off",
"(",
"'change'",
",",
"this",
".",
"uiStateChangeHandler",
")",
";",
"this",
".",
"vis",
".",
"uiState",
".",
"clearAllKeys",
"(",
")",
";",
"if",
"(",
"visCustomizations",
".",
"vis",
")",
"{",
"this",
".",
"vis",
".",
"uiState",
".",
"set",
"(",
"'vis'",
",",
"visCustomizations",
".",
"vis",
")",
";",
"getKeys",
"(",
"visCustomizations",
")",
".",
"forEach",
"(",
"(",
"key",
")",
"=>",
"{",
"this",
".",
"vis",
".",
"uiState",
".",
"set",
"(",
"key",
",",
"visCustomizations",
"[",
"key",
"]",
")",
";",
"}",
")",
";",
"}",
"if",
"(",
"visCustomizations",
".",
"table",
")",
"{",
"this",
".",
"vis",
".",
"uiState",
".",
"set",
"(",
"'table'",
",",
"visCustomizations",
".",
"table",
")",
";",
"}",
"this",
".",
"vis",
".",
"uiState",
".",
"on",
"(",
"'change'",
",",
"this",
".",
"uiStateChangeHandler",
")",
";",
"}",
"}",
"else",
"if",
"(",
"this",
".",
"parent",
")",
"{",
"this",
".",
"vis",
".",
"uiState",
".",
"clearAllKeys",
"(",
")",
";",
"}",
"}",
"public",
"async",
"handleChanges",
"(",
")",
"{",
"this",
".",
"transferCustomizationsToUiState",
"(",
")",
";",
"let",
"dirty",
"=",
"false",
";",
"if",
"(",
"!",
"_",
".",
"isEqual",
"(",
"this",
".",
"input",
".",
"timeRange",
",",
"this",
".",
"timeRange",
")",
")",
"{",
"this",
".",
"timeRange",
"=",
"_",
".",
"cloneDeep",
"(",
"this",
".",
"input",
".",
"timeRange",
")",
";",
"dirty",
"=",
"true",
";",
"}",
"if",
"(",
"!",
"opensearchFilters",
".",
"onlyDisabledFiltersChanged",
"(",
"this",
".",
"input",
".",
"filters",
",",
"this",
".",
"filters",
")",
")",
"{",
"this",
".",
"filters",
"=",
"this",
".",
"input",
".",
"filters",
";",
"dirty",
"=",
"true",
";",
"}",
"if",
"(",
"!",
"_",
".",
"isEqual",
"(",
"this",
".",
"input",
".",
"query",
",",
"this",
".",
"query",
")",
")",
"{",
"this",
".",
"query",
"=",
"this",
".",
"input",
".",
"query",
";",
"dirty",
"=",
"true",
";",
"}",
"if",
"(",
"this",
".",
"vis",
".",
"description",
"&&",
"this",
".",
"domNode",
")",
"{",
"this",
".",
"domNode",
".",
"setAttribute",
"(",
"'data-description'",
",",
"this",
".",
"vis",
".",
"description",
")",
";",
"}",
"if",
"(",
"this",
".",
"handler",
"&&",
"dirty",
")",
"{",
"this",
".",
"updateHandler",
"(",
")",
";",
"}",
"}",
"hasInspector",
"=",
"(",
")",
"=>",
"Boolean",
"(",
"this",
".",
"getInspectorAdapters",
"(",
")",
")",
";",
"onContainerLoading",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"renderComplete",
".",
"dispatchInProgress",
"(",
")",
";",
"this",
".",
"updateOutput",
"(",
"{",
"loading",
":",
"true",
",",
"error",
":",
"undefined",
"}",
")",
";",
"}",
";",
"onContainerRender",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"renderComplete",
".",
"dispatchComplete",
"(",
")",
";",
"this",
".",
"updateOutput",
"(",
"{",
"loading",
":",
"false",
",",
"error",
":",
"undefined",
"}",
")",
";",
"}",
";",
"onContainerError",
"=",
"(",
"error",
")",
"=>",
"{",
"if",
"(",
"this",
".",
"abortController",
")",
"{",
"this",
".",
"abortController",
".",
"abort",
"(",
")",
";",
"}",
"this",
".",
"renderComplete",
".",
"dispatchError",
"(",
")",
";",
"this",
".",
"updateOutput",
"(",
"{",
"loading",
":",
"false",
",",
"error",
"}",
")",
";",
"}",
";",
"param",
"{",
"Element",
"}",
"domNode",
"public",
"async",
"render",
"(",
"domNode",
")",
"{",
"this",
".",
"timeRange",
"=",
"_",
".",
"cloneDeep",
"(",
"this",
".",
"input",
".",
"timeRange",
")",
";",
"this",
".",
"transferCustomizationsToUiState",
"(",
")",
";",
"const",
"div",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"div",
".",
"className",
"=",
"`visualize panel-content panel-content--fullWidth`",
";",
"domNode",
".",
"appendChild",
"(",
"div",
")",
";",
"this",
".",
"domNode",
"=",
"div",
";",
"super",
".",
"render",
"(",
"this",
".",
"domNode",
")",
";",
"const",
"expressions",
"=",
"getExpressions",
"(",
")",
";",
"this",
".",
"handler",
"=",
"new",
"expressions",
".",
"ExpressionLoader",
"(",
"this",
".",
"domNode",
",",
"undefined",
",",
"{",
"onRenderError",
":",
"(",
"element",
",",
"error",
")",
"=>",
"{",
"this",
".",
"onContainerError",
"(",
"error",
")",
";",
"}",
",",
"}",
")",
";",
"this",
".",
"subscriptions",
".",
"push",
"(",
"this",
".",
"handler",
".",
"events$",
".",
"subscribe",
"(",
"async",
"(",
"event",
")",
"=>",
"{",
"if",
"(",
"event",
".",
"name",
"===",
"'bounds'",
")",
"{",
"const",
"agg",
"=",
"this",
".",
"vis",
".",
"data",
".",
"aggs",
"!",
".",
"aggs",
".",
"find",
"(",
"(",
"a",
")",
"=>",
"{",
"return",
"get",
"(",
"a",
",",
"'type.dslName'",
")",
"===",
"'geohash_grid'",
";",
"}",
")",
";",
"if",
"(",
"(",
"agg",
"&&",
"agg",
".",
"params",
".",
"precision",
"!==",
"event",
".",
"data",
".",
"precision",
")",
"||",
"(",
"agg",
"&&",
"!",
"_",
".",
"isEqual",
"(",
"agg",
".",
"params",
".",
"boundingBox",
",",
"event",
".",
"data",
".",
"boundingBox",
")",
")",
")",
"{",
"agg",
".",
"params",
".",
"boundingBox",
"=",
"event",
".",
"data",
".",
"boundingBox",
";",
"agg",
".",
"params",
".",
"precision",
"=",
"event",
".",
"data",
".",
"precision",
";",
"this",
".",
"reload",
"(",
")",
";",
"}",
"return",
";",
"}",
"if",
"(",
"!",
"this",
".",
"input",
".",
"disableTriggers",
")",
"{",
"const",
"triggerId",
"=",
"get",
"(",
"VIS_EVENT_TO_TRIGGER",
",",
"event",
".",
"name",
",",
"VIS_EVENT_TO_TRIGGER",
".",
"filter",
")",
";",
"let",
"context",
";",
"if",
"(",
"triggerId",
"===",
"VIS_EVENT_TO_TRIGGER",
".",
"applyFilter",
")",
"{",
"context",
"=",
"{",
"embeddable",
":",
"this",
",",
"timeFieldName",
":",
"this",
".",
"vis",
".",
"data",
".",
"indexPattern",
"?.",
"timeFieldName",
"!",
",",
"...",
"event",
".",
"data",
",",
"}",
";",
"}",
"else",
"{",
"context",
"=",
"{",
"embeddable",
":",
"this",
",",
"data",
":",
"{",
"timeFieldName",
":",
"this",
".",
"vis",
".",
"data",
".",
"indexPattern",
"?.",
"timeFieldName",
"!",
",",
"...",
"event",
".",
"data",
"}",
",",
"}",
";",
"}",
"getUiActions",
"(",
")",
".",
"getTrigger",
"(",
"triggerId",
")",
".",
"exec",
"(",
"context",
")",
";",
"}",
"}",
")",
")",
";",
"if",
"(",
"this",
".",
"vis",
".",
"description",
")",
"{",
"div",
".",
"setAttribute",
"(",
"'data-description'",
",",
"this",
".",
"vis",
".",
"description",
")",
";",
"}",
"div",
".",
"setAttribute",
"(",
"'data-test-subj'",
",",
"'visualizationLoader'",
")",
";",
"div",
".",
"setAttribute",
"(",
"'data-shared-item'",
",",
"''",
")",
";",
"this",
".",
"subscriptions",
".",
"push",
"(",
"this",
".",
"handler",
".",
"loading$",
".",
"subscribe",
"(",
"this",
".",
"onContainerLoading",
")",
")",
";",
"this",
".",
"subscriptions",
".",
"push",
"(",
"this",
".",
"handler",
".",
"render$",
".",
"subscribe",
"(",
"this",
".",
"onContainerRender",
")",
")",
";",
"this",
".",
"updateHandler",
"(",
")",
";",
"}",
"public",
"destroy",
"(",
")",
"{",
"super",
".",
"destroy",
"(",
")",
";",
"this",
".",
"subscriptions",
".",
"forEach",
"(",
"(",
"s",
")",
"=>",
"s",
".",
"unsubscribe",
"(",
")",
")",
";",
"this",
".",
"vis",
".",
"uiState",
".",
"off",
"(",
"'change'",
",",
"this",
".",
"uiStateChangeHandler",
")",
";",
"this",
".",
"vis",
".",
"uiState",
".",
"off",
"(",
"'reload'",
",",
"this",
".",
"reload",
")",
";",
"if",
"(",
"this",
".",
"handler",
")",
"{",
"this",
".",
"handler",
".",
"destroy",
"(",
")",
";",
"this",
".",
"handler",
".",
"getElement",
"(",
")",
".",
"remove",
"(",
")",
";",
"}",
"this",
".",
"autoRefreshFetchSubscription",
".",
"unsubscribe",
"(",
")",
";",
"}",
"public",
"reload",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"handleVisUpdate",
"(",
")",
";",
"}",
";",
"private",
"async",
"updateHandler",
"(",
")",
"{",
"const",
"expressionParams",
"=",
"{",
"searchContext",
":",
"{",
"timeRange",
":",
"this",
".",
"timeRange",
",",
"query",
":",
"this",
".",
"input",
".",
"query",
",",
"filters",
":",
"this",
".",
"input",
".",
"filters",
",",
"}",
",",
"uiState",
":",
"this",
".",
"vis",
".",
"uiState",
",",
"inspectorAdapters",
":",
"this",
".",
"inspectorAdapters",
",",
"}",
";",
"if",
"(",
"this",
".",
"abortController",
")",
"{",
"this",
".",
"abortController",
".",
"abort",
"(",
")",
";",
"}",
"this",
".",
"abortController",
"=",
"new",
"AbortController",
"(",
")",
";",
"const",
"abortController",
"=",
"this",
".",
"abortController",
";",
"this",
".",
"expression",
"=",
"await",
"buildPipeline",
"(",
"this",
".",
"vis",
",",
"{",
"timefilter",
":",
"this",
".",
"timefilter",
",",
"timeRange",
":",
"this",
".",
"timeRange",
",",
"abortSignal",
":",
"this",
".",
"abortController",
"!",
".",
"signal",
",",
"}",
")",
";",
"if",
"(",
"this",
".",
"handler",
"&&",
"!",
"abortController",
".",
"signal",
".",
"aborted",
")",
"{",
"this",
".",
"handler",
".",
"update",
"(",
"this",
".",
"expression",
",",
"expressionParams",
")",
";",
"}",
"}",
"private",
"handleVisUpdate",
"=",
"async",
"(",
")",
"=>",
"{",
"this",
".",
"updateHandler",
"(",
")",
";",
"}",
";",
"private",
"uiStateChangeHandler",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"updateInput",
"(",
"{",
"...",
"this",
".",
"vis",
".",
"uiState",
".",
"toJSON",
"(",
")",
",",
"}",
")",
";",
"}",
";",
"public",
"supportedTriggers",
"(",
")",
"{",
"return",
"this",
".",
"vis",
".",
"type",
".",
"getSupportedTriggers",
"?.",
"(",
")",
"??",
"[",
"]",
";",
"}",
"inputIsRefType",
"=",
"(",
"input",
")",
":",
"input",
"is",
"VisualizeByReferenceInput",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"attributeService",
")",
"{",
"throw",
"new",
"Error",
"(",
"'AttributeService must be defined for getInputAsRefType'",
")",
";",
"}",
"return",
"this",
".",
"attributeService",
".",
"inputIsRefType",
"(",
"input",
"as",
"VisualizeByReferenceInput",
")",
";",
"}",
";",
"getInputAsValueType",
"=",
"async",
"(",
")",
":",
"Promise",
"<",
"VisualizeByValueInput",
">",
"=>",
"{",
"const",
"input",
"=",
"{",
"savedVis",
":",
"this",
".",
"vis",
".",
"serialize",
"(",
")",
",",
"}",
";",
"if",
"(",
"this",
".",
"getTitle",
"(",
")",
")",
"{",
"input",
".",
"savedVis",
".",
"title",
"=",
"this",
".",
"getTitle",
"(",
")",
";",
"}",
"delete",
"input",
".",
"savedVis",
".",
"id",
";",
"return",
"new",
"Promise",
"<",
"VisualizeByValueInput",
">",
"(",
"(",
"resolve",
")",
"=>",
"{",
"resolve",
"(",
"{",
"...",
"(",
"input",
"as",
"VisualizeByValueInput",
")",
"}",
")",
";",
"}",
")",
";",
"}",
";",
"getInputAsRefType",
"=",
"async",
"(",
")",
":",
"Promise",
"<",
"VisualizeByReferenceInput",
">",
"=>",
"{",
"const",
"savedVis",
"=",
"await",
"this",
".",
"savedVisualizationsLoader",
"?.",
"get",
"(",
"{",
"}",
")",
";",
"if",
"(",
"!",
"savedVis",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Error creating a saved vis object'",
")",
";",
"}",
"if",
"(",
"!",
"this",
".",
"attributeService",
")",
"{",
"throw",
"new",
"Error",
"(",
"'AttributeService must be defined for getInputAsRefType'",
")",
";",
"}",
"const",
"saveModalTitle",
"=",
"this",
".",
"getTitle",
"(",
")",
"?",
"this",
".",
"getTitle",
"(",
")",
":",
"i18n",
".",
"translate",
"(",
"'visualizations.embeddable.placeholderTitle'",
",",
"{",
"defaultMessage",
":",
"'Placeholder Title'",
",",
"}",
")",
";",
"const",
"attributes",
"=",
"{",
"savedVis",
",",
"vis",
":",
"this",
".",
"vis",
",",
"title",
":",
"this",
".",
"vis",
".",
"title",
",",
"}",
";",
"return",
"this",
".",
"attributeService",
".",
"getInputAsRefType",
"(",
"{",
"id",
":",
"this",
".",
"id",
",",
"attributes",
",",
"}",
",",
"{",
"showSaveModal",
":",
"true",
",",
"saveModalTitle",
"}",
")",
";",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
11,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6901,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661664 | [
"import",
"{",
"get",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"VisResponseValue",
",",
"PersistedState",
"}",
"from",
"'../../../../plugins/visualizations/public'",
";",
"import",
"{",
"ExpressionFunctionDefinition",
",",
"Render",
"}",
"from",
"'../../../../plugins/expressions/public'",
";",
"import",
"{",
"getTypes",
",",
"getIndexPatterns",
",",
"getFilterManager",
",",
"getSearch",
"}",
"from",
"'../services'",
";",
"interface",
"Arguments",
"{",
"index",
"?",
":",
"string",
"|",
"null",
";",
"metricsAtAllLevels",
"?",
":",
"boolean",
";",
"partialRows",
"?",
":",
"boolean",
";",
"type",
"?",
":",
"string",
";",
"schemas",
"?",
":",
"string",
";",
"visConfig",
"?",
":",
"string",
";",
"uiState",
"?",
":",
"string",
";",
"aggConfigs",
"?",
":",
"string",
";",
"}",
"export",
"type",
"ExpressionFunctionVisualization",
"=",
"ExpressionFunctionDefinition",
"<",
"'visualization'",
",",
"any",
",",
"Arguments",
",",
"Promise",
"<",
"Render",
"<",
"VisResponseValue",
">",
">",
">",
";",
"export",
"const",
"visualization",
"=",
"(",
")",
":",
"ExpressionFunctionVisualization",
"=>",
"(",
"{",
"name",
":",
"'visualization'",
",",
"type",
":",
"'render'",
",",
"help",
":",
"i18n",
".",
"translate",
"(",
"'visualizations.functions.visualization.help'",
",",
"{",
"defaultMessage",
":",
"'A simple visualization'",
",",
"}",
")",
",",
"args",
":",
"{",
"index",
":",
"{",
"types",
":",
"[",
"'string'",
",",
"'null'",
"]",
",",
"default",
":",
"null",
",",
"help",
":",
"'Index'",
",",
"}",
",",
"metricsAtAllLevels",
":",
"{",
"types",
":",
"[",
"'boolean'",
"]",
",",
"default",
":",
"false",
",",
"help",
":",
"'Metrics levels'",
",",
"}",
",",
"partialRows",
":",
"{",
"types",
":",
"[",
"'boolean'",
"]",
",",
"default",
":",
"false",
",",
"help",
":",
"'Partial rows'",
",",
"}",
",",
"type",
":",
"{",
"types",
":",
"[",
"'string'",
"]",
",",
"default",
":",
"''",
",",
"help",
":",
"'Type'",
",",
"}",
",",
"schemas",
":",
"{",
"types",
":",
"[",
"'string'",
"]",
",",
"default",
":",
"'\"{}\"'",
",",
"help",
":",
"'Schemas'",
",",
"}",
",",
"visConfig",
":",
"{",
"types",
":",
"[",
"'string'",
"]",
",",
"default",
":",
"'\"{}\"'",
",",
"help",
":",
"'Visualization configuration'",
",",
"}",
",",
"uiState",
":",
"{",
"types",
":",
"[",
"'string'",
"]",
",",
"default",
":",
"'\"{}\"'",
",",
"help",
":",
"'User interface state'",
",",
"}",
",",
"aggConfigs",
":",
"{",
"types",
":",
"[",
"'string'",
"]",
",",
"default",
":",
"'\"{}\"'",
",",
"help",
":",
"'Aggregation configurations'",
",",
"}",
",",
"}",
",",
"async",
"fn",
"(",
"input",
",",
"args",
",",
"{",
"inspectorAdapters",
"}",
")",
"{",
"const",
"visConfigParams",
"=",
"args",
".",
"visConfig",
"?",
"JSON",
".",
"parse",
"(",
"args",
".",
"visConfig",
")",
":",
"{",
"}",
";",
"const",
"schemas",
"=",
"args",
".",
"schemas",
"?",
"JSON",
".",
"parse",
"(",
"args",
".",
"schemas",
")",
":",
"{",
"}",
";",
"const",
"visType",
"=",
"getTypes",
"(",
")",
".",
"get",
"(",
"args",
".",
"type",
"||",
"'histogram'",
")",
"as",
"any",
";",
"const",
"indexPattern",
"=",
"args",
".",
"index",
"?",
"await",
"getIndexPatterns",
"(",
")",
".",
"get",
"(",
"args",
".",
"index",
")",
":",
"null",
";",
"const",
"uiStateParams",
"=",
"args",
".",
"uiState",
"?",
"JSON",
".",
"parse",
"(",
"args",
".",
"uiState",
")",
":",
"{",
"}",
";",
"const",
"uiState",
"=",
"new",
"PersistedState",
"(",
"uiStateParams",
")",
";",
"const",
"aggConfigsState",
"=",
"args",
".",
"aggConfigs",
"?",
"JSON",
".",
"parse",
"(",
"args",
".",
"aggConfigs",
")",
":",
"[",
"]",
";",
"const",
"aggs",
"=",
"indexPattern",
"?",
"getSearch",
"(",
")",
".",
"aggs",
".",
"createAggConfigs",
"(",
"indexPattern",
",",
"aggConfigsState",
")",
":",
"undefined",
";",
"if",
"(",
"typeof",
"visType",
".",
"requestHandler",
"===",
"'function'",
")",
"{",
"input",
"=",
"await",
"visType",
".",
"requestHandler",
"(",
"{",
"partialRows",
":",
"args",
".",
"partialRows",
",",
"metricsAtAllLevels",
":",
"args",
".",
"metricsAtAllLevels",
",",
"index",
":",
"indexPattern",
",",
"visParams",
":",
"visConfigParams",
",",
"timeRange",
":",
"get",
"(",
"input",
",",
"'timeRange'",
",",
"null",
")",
",",
"query",
":",
"get",
"(",
"input",
",",
"'query'",
",",
"null",
")",
",",
"filters",
":",
"get",
"(",
"input",
",",
"'filters'",
",",
"null",
")",
",",
"uiState",
",",
"inspectorAdapters",
",",
"queryFilter",
":",
"getFilterManager",
"(",
")",
",",
"aggs",
",",
"}",
")",
";",
"}",
"if",
"(",
"typeof",
"visType",
".",
"responseHandler",
"===",
"'function'",
")",
"{",
"if",
"(",
"input",
".",
"columns",
")",
"{",
"input",
".",
"columns",
".",
"forEach",
"(",
"(",
"column",
")",
"=>",
"{",
"if",
"(",
"column",
".",
"aggConfig",
")",
"{",
"column",
".",
"aggConfig",
".",
"aggConfigs",
".",
"schemas",
"=",
"visType",
".",
"schemas",
".",
"all",
";",
"}",
"}",
")",
";",
"Object",
".",
"keys",
"(",
"schemas",
")",
".",
"forEach",
"(",
"(",
"key",
")",
"=>",
"{",
"schemas",
"[",
"key",
"]",
".",
"forEach",
"(",
"(",
"i",
")",
"=>",
"{",
"if",
"(",
"input",
".",
"columns",
"[",
"i",
"]",
"&&",
"input",
".",
"columns",
"[",
"i",
"]",
".",
"aggConfig",
")",
"{",
"input",
".",
"columns",
"[",
"i",
"]",
".",
"aggConfig",
".",
"schema",
"=",
"key",
";",
"}",
"}",
")",
";",
"}",
")",
";",
"}",
"input",
"=",
"await",
"visType",
".",
"responseHandler",
"(",
"input",
",",
"visConfigParams",
".",
"dimensions",
")",
";",
"}",
"return",
"{",
"type",
":",
"'render'",
",",
"as",
":",
"'visualization'",
",",
"value",
":",
"{",
"visData",
":",
"input",
",",
"visType",
":",
"args",
".",
"type",
"||",
"''",
",",
"visConfig",
":",
"visConfigParams",
",",
"}",
",",
"}",
";",
"}",
",",
"}",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26197,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
575,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
584,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3584,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661665 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"*",
"as",
"Rx",
"from",
"'rxjs'",
";",
"import",
"{",
"debounceTime",
",",
"filter",
",",
"share",
",",
"switchMap",
"}",
"from",
"'rxjs/operators'",
";",
"import",
"{",
"PersistedState",
"}",
"from",
"'../../../../plugins/visualizations/public'",
";",
"import",
"{",
"VisualizationController",
"}",
"from",
"'../types'",
";",
"import",
"{",
"ResizeChecker",
"}",
"from",
"'../../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"ExprVis",
"}",
"from",
"'../expressions/vis'",
";",
"interface",
"VisualizationChartProps",
"{",
"onInit",
"?",
":",
"(",
")",
"=>",
"void",
";",
"uiState",
":",
"PersistedState",
";",
"vis",
":",
"ExprVis",
";",
"visData",
":",
"any",
";",
"visParams",
":",
"any",
";",
"listenOnChange",
":",
"boolean",
";",
"}",
"class",
"VisualizationChart",
"extends",
"React",
".",
"Component",
"<",
"VisualizationChartProps",
">",
"{",
"private",
"resizeChecker",
"?",
":",
"ResizeChecker",
";",
"private",
"visualization",
"?",
":",
"VisualizationController",
";",
"private",
"chartDiv",
"=",
"React",
".",
"createRef",
"<",
"HTMLDivElement",
">",
"(",
")",
";",
"private",
"containerDiv",
"=",
"React",
".",
"createRef",
"<",
"HTMLDivElement",
">",
"(",
")",
";",
"private",
"renderSubject",
":",
"Rx",
".",
"Subject",
"<",
"{",
"vis",
":",
"ExprVis",
";",
"visParams",
":",
"any",
";",
"visData",
":",
"any",
";",
"}",
">",
";",
"private",
"renderSubscription",
":",
"Rx",
".",
"Subscription",
";",
"constructor",
"(",
"props",
")",
"{",
"super",
"(",
"props",
")",
";",
"this",
".",
"renderSubject",
"=",
"new",
"Rx",
".",
"Subject",
"(",
")",
";",
"const",
"render$",
"=",
"this",
".",
"renderSubject",
".",
"asObservable",
"(",
")",
".",
"pipe",
"(",
"share",
"(",
")",
")",
";",
"const",
"success$",
"=",
"render$",
".",
"pipe",
"(",
"filter",
"(",
"(",
"{",
"vis",
",",
"visData",
"}",
")",
"=>",
"vis",
"&&",
"(",
"!",
"vis",
".",
"type",
".",
"requiresSearch",
"||",
"visData",
")",
")",
",",
"debounceTime",
"(",
"100",
")",
",",
"switchMap",
"(",
"async",
"(",
"{",
"vis",
",",
"visData",
",",
"visParams",
"}",
")",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"visualization",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Visualization implementation was not initialized on first render.'",
")",
";",
"}",
"return",
"this",
".",
"visualization",
".",
"render",
"(",
"visData",
",",
"visParams",
")",
";",
"}",
")",
")",
";",
"this",
".",
"renderSubscription",
"=",
"success$",
".",
"subscribe",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"this",
".",
"props",
".",
"onInit",
")",
"{",
"this",
".",
"props",
".",
"onInit",
"(",
")",
";",
"}",
"}",
")",
";",
"}",
"public",
"render",
"(",
")",
"{",
"return",
"(",
"<",
"div",
"className",
"=",
"\"visChart__container osd-resetFocusState\"",
"tabIndex",
"=",
"{",
"0",
"}",
"ref",
"=",
"{",
"this",
".",
"containerDiv",
"}",
">",
"<",
"div",
"className",
"=",
"\"visChart\"",
"ref",
"=",
"{",
"this",
".",
"chartDiv",
"}",
"/",
">",
"<",
"/div>);",
"}",
"public",
"componentDidMount",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"chartDiv",
".",
"current",
"||",
"!",
"this",
".",
"containerDiv",
".",
"current",
")",
"{",
"throw",
"new",
"Error",
"(",
"'chartDiv and currentDiv reference should always be present.'",
")",
";",
"}",
"const",
"{",
"vis",
"}",
"=",
"this",
".",
"props",
";",
"const",
"Visualization",
"=",
"vis",
".",
"type",
".",
"visualization",
";",
"if",
"(",
"!",
"Visualization",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Tried to use VisualizationChart component with a vis without visualization property.'",
")",
";",
"}",
"this",
".",
"visualization",
"=",
"new",
"Visualization",
"(",
"this",
".",
"chartDiv",
".",
"current",
",",
"vis",
")",
";",
"this",
".",
"resizeChecker",
"=",
"new",
"ResizeChecker",
"(",
"this",
".",
"containerDiv",
".",
"current",
")",
";",
"this",
".",
"resizeChecker",
".",
"on",
"(",
"'resize'",
",",
"(",
")",
"=>",
"this",
".",
"startRenderVisualization",
"(",
")",
")",
";",
"if",
"(",
"this",
".",
"props",
".",
"listenOnChange",
")",
"{",
"this",
".",
"props",
".",
"uiState",
".",
"on",
"(",
"'change'",
",",
"this",
".",
"onUiStateChanged",
")",
";",
"}",
"this",
".",
"startRenderVisualization",
"(",
")",
";",
"}",
"public",
"componentDidUpdate",
"(",
")",
"{",
"this",
".",
"startRenderVisualization",
"(",
")",
";",
"}",
"public",
"componentWillUnmount",
"(",
")",
"{",
"if",
"(",
"this",
".",
"renderSubscription",
")",
"{",
"this",
".",
"renderSubscription",
".",
"unsubscribe",
"(",
")",
";",
"}",
"if",
"(",
"this",
".",
"resizeChecker",
")",
"{",
"this",
".",
"resizeChecker",
".",
"destroy",
"(",
")",
";",
"}",
"if",
"(",
"this",
".",
"visualization",
")",
"{",
"this",
".",
"visualization",
".",
"destroy",
"(",
")",
";",
"}",
"}",
"private",
"onUiStateChanged",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"startRenderVisualization",
"(",
")",
";",
"}",
";",
"private",
"startRenderVisualization",
"(",
")",
"{",
"if",
"(",
"this",
".",
"containerDiv",
".",
"current",
"&&",
"this",
".",
"chartDiv",
".",
"current",
")",
"{",
"this",
".",
"renderSubject",
".",
"next",
"(",
"{",
"vis",
":",
"this",
".",
"props",
".",
"vis",
",",
"visData",
":",
"this",
".",
"props",
".",
"visData",
",",
"visParams",
":",
"this",
".",
"props",
".",
"visParams",
",",
"}",
")",
";",
"}",
"}",
"}",
"export",
"{",
"VisualizationChart",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26198,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661666 | [
"import",
"{",
"EuiIcon",
",",
"EuiSpacer",
",",
"EuiText",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"React",
"from",
"'react'",
";",
"interface",
"VisualizationNoResultsProps",
"{",
"onInit",
"?",
":",
"(",
")",
"=>",
"void",
";",
"}",
"export",
"class",
"VisualizationNoResults",
"extends",
"React",
".",
"Component",
"<",
"VisualizationNoResultsProps",
">",
"{",
"private",
"containerDiv",
"=",
"React",
".",
"createRef",
"<",
"HTMLDivElement",
">",
"(",
")",
";",
"public",
"render",
"(",
")",
"{",
"return",
"(",
"<",
"div",
"className",
"=",
"\"visError\"",
"ref",
"=",
"{",
"this",
".",
"containerDiv",
"}",
">",
"<",
"div",
"className",
"=",
"\"item top\"",
"/",
">",
"<",
"div",
"className",
"=",
"\"item\"",
">",
"<",
"EuiText",
"size",
"=",
"\"xs\"",
"color",
"=",
"\"subdued\"",
">",
"<",
"EuiIcon",
"type",
"=",
"\"visualizeApp\"",
"size",
"=",
"\"m\"",
"color",
"=",
"\"subdued\"",
"/",
">",
"<",
"EuiSpacer",
"size",
"=",
"\"s\"",
"/",
">",
"<",
"p",
">",
"{",
"i18n",
".",
"translate",
"(",
"'visualizations.noResultsFoundTitle'",
",",
"{",
"defaultMessage",
":",
"'No results found'",
",",
"}",
")",
"}",
"<",
"/p>",
"<",
"/EuiText>",
"<",
"/div>",
"<",
"div",
"className",
"=",
"\"item bottom\"",
"/",
">",
"<",
"/div>);",
"}",
"public",
"componentDidMount",
"(",
")",
"{",
"this",
".",
"afterRender",
"(",
")",
";",
"}",
"public",
"componentDidUpdate",
"(",
")",
"{",
"this",
".",
"afterRender",
"(",
")",
";",
"}",
"private",
"afterRender",
"(",
")",
"{",
"if",
"(",
"this",
".",
"props",
".",
"onInit",
")",
"{",
"this",
".",
"props",
".",
"onInit",
"(",
")",
";",
"}",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661667 | [
"import",
"{",
"get",
"}",
"from",
"'lodash'",
";",
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"PersistedState",
"}",
"from",
"'../../../../plugins/visualizations/public'",
";",
"import",
"{",
"memoizeLast",
"}",
"from",
"'../legacy/memoize'",
";",
"import",
"{",
"VisualizationChart",
"}",
"from",
"'./visualization_chart'",
";",
"import",
"{",
"VisualizationNoResults",
"}",
"from",
"'./visualization_noresults'",
";",
"import",
"{",
"ExprVis",
"}",
"from",
"'../expressions/vis'",
";",
"function",
"shouldShowNoResultsMessage",
"(",
"vis",
",",
"visData",
")",
"{",
"const",
"requiresSearch",
"=",
"get",
"(",
"vis",
",",
"'type.requiresSearch'",
")",
";",
"const",
"rows",
"=",
"get",
"(",
"visData",
",",
"'rows'",
")",
";",
"const",
"isZeroHits",
"=",
"get",
"(",
"visData",
",",
"'hits'",
")",
"===",
"0",
"||",
"(",
"rows",
"&&",
"!",
"rows",
".",
"length",
")",
";",
"const",
"shouldShowMessage",
"=",
"!",
"get",
"(",
"vis",
",",
"'type.useCustomNoDataScreen'",
")",
";",
"return",
"Boolean",
"(",
"requiresSearch",
"&&",
"isZeroHits",
"&&",
"shouldShowMessage",
")",
";",
"}",
"interface",
"VisualizationProps",
"{",
"listenOnChange",
":",
"boolean",
";",
"onInit",
"?",
":",
"(",
")",
"=>",
"void",
";",
"uiState",
":",
"PersistedState",
";",
"vis",
":",
"ExprVis",
";",
"visData",
":",
"any",
";",
"visParams",
":",
"any",
";",
"}",
"export",
"class",
"Visualization",
"extends",
"React",
".",
"Component",
"<",
"VisualizationProps",
">",
"{",
"private",
"showNoResultsMessage",
"=",
"memoizeLast",
"(",
"shouldShowNoResultsMessage",
")",
";",
"constructor",
"(",
"props",
")",
"{",
"super",
"(",
"props",
")",
";",
"props",
".",
"vis",
".",
"setUiState",
"(",
"props",
".",
"uiState",
")",
";",
"}",
"public",
"render",
"(",
")",
"{",
"const",
"{",
"vis",
",",
"visData",
",",
"visParams",
",",
"onInit",
",",
"uiState",
",",
"listenOnChange",
"}",
"=",
"this",
".",
"props",
";",
"const",
"noResults",
"=",
"this",
".",
"showNoResultsMessage",
"(",
"vis",
",",
"visData",
")",
";",
"return",
"(",
"<",
"div",
"className",
"=",
"\"visualization\"",
">",
"{",
"noResults",
"?",
"(",
"<",
"VisualizationNoResults",
"onInit",
"=",
"{",
"onInit",
"}",
"/",
">",
")",
":",
"(",
"<",
"VisualizationChart",
"vis",
"=",
"{",
"vis",
"}",
"visData",
"=",
"{",
"visData",
"}",
"visParams",
"=",
"{",
"visParams",
"}",
"onInit",
"=",
"{",
"onInit",
"}",
"uiState",
"=",
"{",
"uiState",
"}",
"listenOnChange",
"=",
"{",
"listenOnChange",
"}",
"/",
">",
")",
"}",
"<",
"/div>);",
"}",
"public",
"shouldComponentUpdate",
"(",
"nextProps",
")",
"{",
"if",
"(",
"nextProps",
".",
"uiState",
"!==",
"this",
".",
"props",
".",
"uiState",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Changing uiState on <Visualization/> is not supported!'",
")",
";",
"}",
"return",
"true",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
6656,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13417,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661668 | [
"import",
"React",
",",
"{",
"ReactNode",
",",
"Suspense",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiLoadingChart",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"classNames",
"from",
"'classnames'",
";",
"import",
"{",
"VisualizationNoResults",
"}",
"from",
"'./visualization_noresults'",
";",
"interface",
"VisualizationContainerProps",
"{",
"className",
"?",
":",
"string",
";",
"children",
":",
"ReactNode",
";",
"showNoResult",
"?",
":",
"boolean",
";",
"}",
"export",
"const",
"VisualizationContainer",
"=",
"(",
"{",
"className",
",",
"children",
",",
"showNoResult",
"=",
"false",
",",
"}",
")",
"=>",
"{",
"const",
"classes",
"=",
"classNames",
"(",
"'visualization'",
",",
"className",
")",
";",
"const",
"fallBack",
"=",
"(",
"<",
"div",
"className",
"=",
"\"visChart__spinner\"",
">",
"<",
"EuiLoadingChart",
"mono",
"size",
"=",
"\"l\"",
"/",
">",
"<",
"/div>);",
"return",
"(",
"<",
"div",
"className",
"=",
"{",
"classes",
"}",
">",
"<",
"Suspense",
"fallback",
"=",
"{",
"fallBack",
"}",
">",
"{",
"showNoResult",
"?",
"<",
"VisualizationNoResults",
"/",
">",
":",
"children",
"}",
"<",
"/Suspense>",
"<",
"/div>);",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661669 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"render",
",",
"unmountComponentAtNode",
"}",
"from",
"'react-dom'",
";",
"import",
"{",
"ExprVis",
"}",
"from",
"'./vis'",
";",
"import",
"{",
"Visualization",
"}",
"from",
"'../components'",
";",
"import",
"{",
"VisParams",
"}",
"from",
"'../types'",
";",
"export",
"const",
"visualization",
"=",
"(",
")",
"=>",
"(",
"{",
"name",
":",
"'visualization'",
",",
"displayName",
":",
"'visualization'",
",",
"reuseDomNode",
":",
"true",
",",
"render",
":",
"async",
"(",
"domNode",
",",
"config",
",",
"handlers",
")",
"=>",
"{",
"const",
"{",
"visData",
",",
"visConfig",
",",
"params",
"}",
"=",
"config",
";",
"const",
"visType",
"=",
"config",
".",
"visType",
"||",
"visConfig",
".",
"type",
";",
"const",
"vis",
"=",
"new",
"ExprVis",
"(",
"{",
"title",
":",
"config",
".",
"title",
",",
"type",
":",
"visType",
"as",
"string",
",",
"params",
":",
"visConfig",
"as",
"VisParams",
",",
"}",
")",
";",
"vis",
".",
"eventsSubject",
"=",
"{",
"next",
":",
"handlers",
".",
"event",
"}",
";",
"const",
"uiState",
"=",
"handlers",
".",
"uiState",
"||",
"vis",
".",
"getUiState",
"(",
")",
";",
"handlers",
".",
"onDestroy",
"(",
"(",
")",
"=>",
"{",
"unmountComponentAtNode",
"(",
"domNode",
")",
";",
"}",
")",
";",
"const",
"listenOnChange",
"=",
"params",
"?",
"params",
".",
"listenOnChange",
":",
"false",
";",
"render",
"(",
"<",
"Visualization",
"vis",
"=",
"{",
"vis",
"}",
"visData",
"=",
"{",
"visData",
"}",
"visParams",
"=",
"{",
"vis",
".",
"params",
"}",
"uiState",
"=",
"{",
"uiState",
"}",
"listenOnChange",
"=",
"{",
"listenOnChange",
"}",
"onInit",
"=",
"{",
"handlers",
".",
"done",
"}",
"/",
">",
",",
"domNode",
")",
";",
"}",
",",
"}",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
15,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6656,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661670 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"ExpressionFunctionDefinition",
",",
"OpenSearchDashboardsDatatable",
",",
"Range",
",",
"}",
"from",
"'../../../expressions/public'",
";",
"interface",
"Arguments",
"{",
"from",
":",
"number",
";",
"to",
":",
"number",
";",
"}",
"export",
"const",
"range",
"=",
"(",
")",
":",
"ExpressionFunctionDefinition",
"<",
"'range'",
",",
"OpenSearchDashboardsDatatable",
"|",
"null",
",",
"Arguments",
",",
"Range",
">",
"=>",
"(",
"{",
"name",
":",
"'range'",
",",
"help",
":",
"i18n",
".",
"translate",
"(",
"'visualizations.function.range.help'",
",",
"{",
"defaultMessage",
":",
"'Generates range object'",
",",
"}",
")",
",",
"type",
":",
"'range'",
",",
"args",
":",
"{",
"from",
":",
"{",
"types",
":",
"[",
"'number'",
"]",
",",
"help",
":",
"i18n",
".",
"translate",
"(",
"'visualizations.function.range.from.help'",
",",
"{",
"defaultMessage",
":",
"'Start of range'",
",",
"}",
")",
",",
"required",
":",
"true",
",",
"}",
",",
"to",
":",
"{",
"types",
":",
"[",
"'number'",
"]",
",",
"help",
":",
"i18n",
".",
"translate",
"(",
"'visualizations.function.range.to.help'",
",",
"{",
"defaultMessage",
":",
"'End of range'",
",",
"}",
")",
",",
"required",
":",
"true",
",",
"}",
",",
"}",
",",
"fn",
":",
"(",
"context",
",",
"args",
")",
"=>",
"{",
"return",
"{",
"type",
":",
"'range'",
",",
"from",
":",
"args",
".",
"from",
",",
"to",
":",
"args",
".",
"to",
",",
"}",
";",
"}",
",",
"}",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4847,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8970,
null,
575,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661671 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"ExpressionFunctionDefinition",
",",
"ExpressionValueBoxed",
",",
"OpenSearchDashboardsDatatable",
",",
"OpenSearchDashboardsDatatableColumn",
",",
"}",
"from",
"'../../../expressions/public'",
";",
"interface",
"Arguments",
"{",
"accessor",
":",
"string",
"|",
"number",
";",
"format",
"?",
":",
"string",
";",
"formatParams",
"?",
":",
"string",
";",
"}",
"type",
"ExpressionValueVisDimension",
"=",
"ExpressionValueBoxed",
"<",
"'vis_dimension'",
",",
"{",
"accessor",
":",
"number",
"|",
"OpenSearchDashboardsDatatableColumn",
";",
"format",
":",
"{",
"id",
"?",
":",
"string",
";",
"params",
":",
"unknown",
";",
"}",
";",
"}",
">",
";",
"export",
"const",
"visDimension",
"=",
"(",
")",
":",
"ExpressionFunctionDefinition",
"<",
"'visdimension'",
",",
"OpenSearchDashboardsDatatable",
",",
"Arguments",
",",
"ExpressionValueVisDimension",
">",
"=>",
"(",
"{",
"name",
":",
"'visdimension'",
",",
"help",
":",
"i18n",
".",
"translate",
"(",
"'visualizations.function.visDimension.help'",
",",
"{",
"defaultMessage",
":",
"'Generates visConfig dimension object'",
",",
"}",
")",
",",
"type",
":",
"'vis_dimension'",
",",
"inputTypes",
":",
"[",
"'opensearch_dashboards_datatable'",
"]",
",",
"args",
":",
"{",
"accessor",
":",
"{",
"types",
":",
"[",
"'string'",
",",
"'number'",
"]",
",",
"aliases",
":",
"[",
"'_'",
"]",
",",
"help",
":",
"i18n",
".",
"translate",
"(",
"'visualizations.function.visDimension.accessor.help'",
",",
"{",
"defaultMessage",
":",
"'Column in your dataset to use (either column index or column name)'",
",",
"}",
")",
",",
"}",
",",
"format",
":",
"{",
"types",
":",
"[",
"'string'",
"]",
",",
"default",
":",
"'string'",
",",
"help",
":",
"i18n",
".",
"translate",
"(",
"'visualizations.function.visDimension.format.help'",
",",
"{",
"defaultMessage",
":",
"'Format'",
",",
"}",
")",
",",
"}",
",",
"formatParams",
":",
"{",
"types",
":",
"[",
"'string'",
"]",
",",
"default",
":",
"'\"{}\"'",
",",
"help",
":",
"i18n",
".",
"translate",
"(",
"'visualizations.function.visDimension.formatParams.help'",
",",
"{",
"defaultMessage",
":",
"'Format params'",
",",
"}",
")",
",",
"}",
",",
"}",
",",
"fn",
":",
"(",
"input",
",",
"args",
")",
"=>",
"{",
"const",
"accessor",
"=",
"typeof",
"args",
".",
"accessor",
"===",
"'number'",
"?",
"args",
".",
"accessor",
":",
"input",
".",
"columns",
".",
"find",
"(",
"(",
"c",
")",
"=>",
"c",
".",
"id",
"===",
"args",
".",
"accessor",
")",
";",
"if",
"(",
"accessor",
"===",
"undefined",
")",
"{",
"throw",
"new",
"Error",
"(",
"i18n",
".",
"translate",
"(",
"'visualizations.function.visDimension.error.accessor'",
",",
"{",
"defaultMessage",
":",
"'Column name provided is invalid'",
",",
"}",
")",
")",
";",
"}",
"return",
"{",
"type",
":",
"'vis_dimension'",
",",
"accessor",
",",
"format",
":",
"{",
"id",
":",
"args",
".",
"format",
",",
"params",
":",
"JSON",
".",
"parse",
"(",
"args",
".",
"formatParams",
"!",
")",
",",
"}",
",",
"}",
";",
"}",
",",
"}",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4847,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8970,
null,
575,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7017,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661672 | [
"import",
"'./index.scss'",
";",
"import",
"{",
"PluginInitializerContext",
",",
"CoreSetup",
",",
"CoreStart",
",",
"Plugin",
",",
"ApplicationStart",
",",
"SavedObjectsClientContract",
",",
"}",
"from",
"'../../../core/public'",
";",
"import",
"{",
"TypesService",
",",
"TypesSetup",
",",
"TypesStart",
"}",
"from",
"'./vis_types'",
";",
"import",
"{",
"setUISettings",
",",
"setTypes",
",",
"setI18n",
",",
"setApplication",
",",
"setCapabilities",
",",
"setHttp",
",",
"setIndexPatterns",
",",
"setSearch",
",",
"setSavedObjects",
",",
"setUsageCollector",
",",
"setFilterManager",
",",
"setExpressions",
",",
"setUiActions",
",",
"setSavedVisualizationsLoader",
",",
"setTimeFilter",
",",
"setAggs",
",",
"setChrome",
",",
"setOverlays",
",",
"setSavedSearchLoader",
",",
"setEmbeddable",
",",
"}",
"from",
"'./services'",
";",
"import",
"{",
"VISUALIZE_EMBEDDABLE_TYPE",
",",
"VisualizeEmbeddableFactory",
",",
"createVisEmbeddableFromObject",
",",
"}",
"from",
"'./embeddable'",
";",
"import",
"{",
"ExpressionsSetup",
",",
"ExpressionsStart",
"}",
"from",
"'../../expressions/public'",
";",
"import",
"{",
"EmbeddableSetup",
",",
"EmbeddableStart",
"}",
"from",
"'../../embeddable/public'",
";",
"import",
"{",
"visualization",
"as",
"visualizationFunction",
"}",
"from",
"'./expressions/visualization_function'",
";",
"import",
"{",
"visualization",
"as",
"visualizationRenderer",
"}",
"from",
"'./expressions/visualization_renderer'",
";",
"import",
"{",
"range",
"as",
"rangeExpressionFunction",
"}",
"from",
"'./expression_functions/range'",
";",
"import",
"{",
"visDimension",
"as",
"visDimensionExpressionFunction",
"}",
"from",
"'./expression_functions/vis_dimension'",
";",
"import",
"{",
"DataPublicPluginSetup",
",",
"DataPublicPluginStart",
"}",
"from",
"'../../data/public'",
";",
"import",
"{",
"Setup",
"as",
"InspectorSetup",
",",
"Start",
"as",
"InspectorStart",
",",
"}",
"from",
"'../../../plugins/inspector/public'",
";",
"import",
"{",
"UsageCollectionSetup",
"}",
"from",
"'../../usage_collection/public'",
";",
"import",
"{",
"createStartServicesGetter",
",",
"StartServicesGetter",
",",
"}",
"from",
"'../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"createSavedVisLoader",
",",
"SavedVisualizationsLoader",
"}",
"from",
"'./saved_visualizations'",
";",
"import",
"{",
"SerializedVis",
",",
"Vis",
"}",
"from",
"'./vis'",
";",
"import",
"{",
"showNewVisModal",
"}",
"from",
"'./wizard'",
";",
"import",
"{",
"UiActionsStart",
"}",
"from",
"'../../ui_actions/public'",
";",
"import",
"{",
"convertFromSerializedVis",
",",
"convertToSerializedVis",
",",
"}",
"from",
"'./saved_visualizations/_saved_vis'",
";",
"import",
"{",
"createSavedSearchesLoader",
"}",
"from",
"'../../discover/public'",
";",
"import",
"{",
"DashboardStart",
"}",
"from",
"'../../dashboard/public'",
";",
"public",
"export",
"type",
"VisualizationsSetup",
"=",
"TypesSetup",
";",
"export",
"interface",
"VisualizationsStart",
"extends",
"TypesStart",
"{",
"savedVisualizationsLoader",
":",
"SavedVisualizationsLoader",
";",
"createVis",
":",
"(",
"visType",
":",
"string",
",",
"visState",
":",
"SerializedVis",
")",
"=>",
"Promise",
"<",
"Vis",
">",
";",
"convertToSerializedVis",
":",
"typeof",
"convertToSerializedVis",
";",
"convertFromSerializedVis",
":",
"typeof",
"convertFromSerializedVis",
";",
"showNewVisModal",
":",
"typeof",
"showNewVisModal",
";",
"__LEGACY",
":",
"{",
"createVisEmbeddableFromObject",
":",
"ReturnType",
"<",
"typeof",
"createVisEmbeddableFromObject",
">",
";",
"}",
";",
"}",
"export",
"interface",
"VisualizationsSetupDeps",
"{",
"data",
":",
"DataPublicPluginSetup",
";",
"embeddable",
":",
"EmbeddableSetup",
";",
"expressions",
":",
"ExpressionsSetup",
";",
"inspector",
":",
"InspectorSetup",
";",
"usageCollection",
":",
"UsageCollectionSetup",
";",
"}",
"export",
"interface",
"VisualizationsStartDeps",
"{",
"data",
":",
"DataPublicPluginStart",
";",
"expressions",
":",
"ExpressionsStart",
";",
"embeddable",
":",
"EmbeddableStart",
";",
"inspector",
":",
"InspectorStart",
";",
"uiActions",
":",
"UiActionsStart",
";",
"application",
":",
"ApplicationStart",
";",
"dashboard",
":",
"DashboardStart",
";",
"getAttributeService",
":",
"DashboardStart",
"[",
"'getAttributeService'",
"]",
";",
"savedObjectsClient",
":",
"SavedObjectsClientContract",
";",
"}",
"internal",
"export",
"class",
"VisualizationsPlugin",
"implements",
"Plugin",
"<",
"VisualizationsSetup",
",",
"VisualizationsStart",
",",
"VisualizationsSetupDeps",
",",
"VisualizationsStartDeps",
">",
"{",
"private",
"readonly",
"types",
":",
"TypesService",
"=",
"new",
"TypesService",
"(",
")",
";",
"private",
"getStartServicesOrDie",
"?",
":",
"StartServicesGetter",
"<",
"VisualizationsStartDeps",
",",
"VisualizationsStart",
">",
";",
"constructor",
"(",
"initializerContext",
")",
"{",
"}",
"public",
"setup",
"(",
"core",
",",
"{",
"expressions",
",",
"embeddable",
",",
"usageCollection",
",",
"data",
"}",
")",
"{",
"const",
"start",
"=",
"(",
"this",
".",
"getStartServicesOrDie",
"=",
"createStartServicesGetter",
"(",
"core",
".",
"getStartServices",
")",
")",
";",
"setUISettings",
"(",
"core",
".",
"uiSettings",
")",
";",
"setUsageCollector",
"(",
"usageCollection",
")",
";",
"expressions",
".",
"registerFunction",
"(",
"visualizationFunction",
")",
";",
"expressions",
".",
"registerRenderer",
"(",
"visualizationRenderer",
")",
";",
"expressions",
".",
"registerFunction",
"(",
"rangeExpressionFunction",
")",
";",
"expressions",
".",
"registerFunction",
"(",
"visDimensionExpressionFunction",
")",
";",
"const",
"embeddableFactory",
"=",
"new",
"VisualizeEmbeddableFactory",
"(",
"{",
"start",
"}",
")",
";",
"embeddable",
".",
"registerEmbeddableFactory",
"(",
"VISUALIZE_EMBEDDABLE_TYPE",
",",
"embeddableFactory",
")",
";",
"return",
"{",
"...",
"this",
".",
"types",
".",
"setup",
"(",
")",
",",
"}",
";",
"}",
"public",
"start",
"(",
"core",
",",
"{",
"data",
",",
"expressions",
",",
"uiActions",
",",
"embeddable",
",",
"dashboard",
"}",
")",
"{",
"const",
"types",
"=",
"this",
".",
"types",
".",
"start",
"(",
")",
";",
"setI18n",
"(",
"core",
".",
"i18n",
")",
";",
"setTypes",
"(",
"types",
")",
";",
"setEmbeddable",
"(",
"embeddable",
")",
";",
"setApplication",
"(",
"core",
".",
"application",
")",
";",
"setCapabilities",
"(",
"core",
".",
"application",
".",
"capabilities",
")",
";",
"setHttp",
"(",
"core",
".",
"http",
")",
";",
"setSavedObjects",
"(",
"core",
".",
"savedObjects",
")",
";",
"setIndexPatterns",
"(",
"data",
".",
"indexPatterns",
")",
";",
"setSearch",
"(",
"data",
".",
"search",
")",
";",
"setFilterManager",
"(",
"data",
".",
"query",
".",
"filterManager",
")",
";",
"setExpressions",
"(",
"expressions",
")",
";",
"setUiActions",
"(",
"uiActions",
")",
";",
"setTimeFilter",
"(",
"data",
".",
"query",
".",
"timefilter",
".",
"timefilter",
")",
";",
"setAggs",
"(",
"data",
".",
"search",
".",
"aggs",
")",
";",
"setOverlays",
"(",
"core",
".",
"overlays",
")",
";",
"setChrome",
"(",
"core",
".",
"chrome",
")",
";",
"const",
"savedVisualizationsLoader",
"=",
"createSavedVisLoader",
"(",
"{",
"savedObjectsClient",
":",
"core",
".",
"savedObjects",
".",
"client",
",",
"indexPatterns",
":",
"data",
".",
"indexPatterns",
",",
"search",
":",
"data",
".",
"search",
",",
"chrome",
":",
"core",
".",
"chrome",
",",
"overlays",
":",
"core",
".",
"overlays",
",",
"visualizationTypes",
":",
"types",
",",
"}",
")",
";",
"setSavedVisualizationsLoader",
"(",
"savedVisualizationsLoader",
")",
";",
"const",
"savedSearchLoader",
"=",
"createSavedSearchesLoader",
"(",
"{",
"savedObjectsClient",
":",
"core",
".",
"savedObjects",
".",
"client",
",",
"indexPatterns",
":",
"data",
".",
"indexPatterns",
",",
"search",
":",
"data",
".",
"search",
",",
"chrome",
":",
"core",
".",
"chrome",
",",
"overlays",
":",
"core",
".",
"overlays",
",",
"}",
")",
";",
"setSavedSearchLoader",
"(",
"savedSearchLoader",
")",
";",
"return",
"{",
"...",
"types",
",",
"showNewVisModal",
",",
"param",
"{",
"IIndexPattern",
"}",
"indexPattern",
"param",
"{",
"VisState",
"}",
"visState",
"createVis",
":",
"async",
"(",
"visType",
",",
"visState",
")",
"=>",
"{",
"const",
"vis",
"=",
"new",
"Vis",
"(",
"visType",
")",
";",
"await",
"vis",
".",
"setState",
"(",
"visState",
")",
";",
"return",
"vis",
";",
"}",
",",
"convertToSerializedVis",
",",
"convertFromSerializedVis",
",",
"savedVisualizationsLoader",
",",
"__LEGACY",
":",
"{",
"createVisEmbeddableFromObject",
":",
"createVisEmbeddableFromObject",
"(",
"{",
"start",
":",
"this",
".",
"getStartServicesOrDie",
"!",
",",
"}",
")",
",",
"}",
",",
"}",
";",
"}",
"public",
"stop",
"(",
")",
"{",
"this",
".",
"types",
".",
"stop",
"(",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
615,
null,
null,
null,
null,
21813,
null,
501,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661673 | [
"import",
"{",
"PublicContract",
"}",
"from",
"'@osd/utility-types'",
";",
"import",
"{",
"PluginInitializerContext",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"VisualizationsPlugin",
",",
"VisualizationsSetup",
",",
"VisualizationsStart",
"}",
"from",
"'./plugin'",
";",
"import",
"{",
"VisualizeEmbeddableFactory",
",",
"VisualizeEmbeddable",
"}",
"from",
"'./embeddable'",
";",
"import",
"{",
"ExprVis",
"as",
"ExprVisClass",
"}",
"from",
"'./expressions/vis'",
";",
"export",
"function",
"plugin",
"(",
"initializerContext",
")",
"{",
"return",
"new",
"VisualizationsPlugin",
"(",
"initializerContext",
")",
";",
"}",
"public",
"export",
"{",
"Vis",
"}",
"from",
"'./vis'",
";",
"export",
"{",
"TypesService",
"}",
"from",
"'./vis_types/types_service'",
";",
"export",
"{",
"VISUALIZE_EMBEDDABLE_TYPE",
",",
"VIS_EVENT_TO_TRIGGER",
"}",
"from",
"'./embeddable'",
";",
"export",
"{",
"VisualizationContainer",
",",
"VisualizationNoResults",
"}",
"from",
"'./components'",
";",
"export",
"{",
"getSchemas",
"as",
"getVisSchemas",
"}",
"from",
"'./legacy/build_pipeline'",
";",
"public",
"export",
"{",
"VisualizationsSetup",
",",
"VisualizationsStart",
"}",
";",
"export",
"{",
"VisTypeAlias",
",",
"VisType",
",",
"BaseVisTypeOptions",
",",
"ReactVisTypeOptions",
"}",
"from",
"'./vis_types'",
";",
"export",
"{",
"VisParams",
",",
"SerializedVis",
",",
"SerializedVisData",
",",
"VisData",
"}",
"from",
"'./vis'",
";",
"export",
"type",
"VisualizeEmbeddableFactoryContract",
"=",
"PublicContract",
"<",
"VisualizeEmbeddableFactory",
">",
";",
"export",
"type",
"VisualizeEmbeddableContract",
"=",
"PublicContract",
"<",
"VisualizeEmbeddable",
">",
";",
"export",
"{",
"VisualizeInput",
"}",
"from",
"'./embeddable'",
";",
"export",
"type",
"ExprVis",
"=",
"ExprVisClass",
";",
"export",
"{",
"SchemaConfig",
",",
"BuildPipelineParams",
"}",
"from",
"'./legacy/build_pipeline'",
";",
"export",
"{",
"updateOldState",
"}",
"from",
"'./legacy/vis_update_state'",
";",
"export",
"{",
"PersistedState",
"}",
"from",
"'./persisted_state'",
";",
"export",
"{",
"VisualizationController",
",",
"SavedVisState",
",",
"ISavedVis",
",",
"VisSavedObject",
",",
"VisResponseValue",
",",
"}",
"from",
"'./types'",
";",
"export",
"{",
"ExprVisAPIEvents",
"}",
"from",
"'./expressions/vis'",
";",
"export",
"{",
"VisualizationListItem",
"}",
"from",
"'./vis_types/vis_type_alias_registry'",
";",
"export",
"{",
"VISUALIZE_ENABLE_LABS_SETTING",
"}",
"from",
"'../common/constants'",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
21814,
null,
615,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661674 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiFieldNumber",
",",
"EuiFormRow",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"VisOptionsProps",
"}",
"from",
"'src/plugins/vis_default_editor/public/vis_options_props'",
";",
"interface",
"CounterParams",
"{",
"counter",
":",
"number",
";",
"}",
"export",
"class",
"SelfChangingEditor",
"extends",
"React",
".",
"Component",
"<",
"VisOptionsProps",
"<",
"CounterParams",
">",
">",
"{",
"onCounterChange",
"=",
"(",
"ev",
")",
"=>",
"{",
"this",
".",
"props",
".",
"setValue",
"(",
"'counter'",
",",
"parseInt",
"(",
"ev",
".",
"target",
".",
"value",
",",
"10",
")",
")",
";",
"}",
";",
"render",
"(",
")",
"{",
"return",
"(",
"<",
"EuiFormRow",
"label",
"=",
"\"Counter\"",
">",
"<",
"EuiFieldNumber",
"value",
"=",
"{",
"this",
".",
"props",
".",
"stateParams",
".",
"counter",
"}",
"onChange",
"=",
"{",
"this",
".",
"onCounterChange",
"}",
"step",
"=",
"{",
"1",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"counterEditor\"",
"/",
">",
"<",
"/EuiFormRow>);",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661675 | [
"import",
"{",
"CoreSetup",
",",
"Plugin",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"VisualizationsSetup",
"}",
"from",
"'../../../../../src/plugins/visualizations/public'",
";",
"import",
"{",
"SelfChangingEditor",
"}",
"from",
"'./self_changing_vis/self_changing_editor'",
";",
"import",
"{",
"SelfChangingComponent",
"}",
"from",
"'./self_changing_vis/self_changing_components'",
";",
"export",
"interface",
"SetupDependencies",
"{",
"visualizations",
":",
"VisualizationsSetup",
";",
"}",
"export",
"class",
"CustomVisualizationsPublicPlugin",
"implements",
"Plugin",
"<",
"CustomVisualizationsSetup",
",",
"CustomVisualizationsStart",
">",
"{",
"public",
"setup",
"(",
"core",
",",
"setupDeps",
")",
"{",
"setupDeps",
".",
"visualizations",
".",
"createReactVisualization",
"(",
"{",
"name",
":",
"'self_changing_vis'",
",",
"title",
":",
"'Self Changing Vis'",
",",
"icon",
":",
"'controlsHorizontal'",
",",
"description",
":",
"'This visualization is able to change its own settings, that you could also set in the editor.'",
",",
"visConfig",
":",
"{",
"component",
":",
"SelfChangingComponent",
",",
"defaults",
":",
"{",
"counter",
":",
"0",
",",
"}",
",",
"}",
",",
"editorConfig",
":",
"{",
"optionTabs",
":",
"[",
"{",
"name",
":",
"'options'",
",",
"title",
":",
"'Options'",
",",
"editor",
":",
"SelfChangingEditor",
",",
"}",
",",
"]",
",",
"}",
",",
"requestHandler",
":",
"'none'",
",",
"}",
")",
";",
"}",
"public",
"start",
"(",
")",
"{",
"}",
"public",
"stop",
"(",
")",
"{",
"}",
"}",
"export",
"type",
"CustomVisualizationsSetup",
"=",
"ReturnType",
"<",
"CustomVisualizationsPublicPlugin",
"[",
"'setup'",
"]",
">",
";",
"export",
"type",
"CustomVisualizationsStart",
"=",
"ReturnType",
"<",
"CustomVisualizationsPublicPlugin",
"[",
"'start'",
"]",
">",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
501,
null,
9639,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661676 | [
"import",
"{",
"PluginInitializer",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"CustomVisualizationsPublicPlugin",
",",
"CustomVisualizationsSetup",
",",
"CustomVisualizationsStart",
",",
"}",
"from",
"'./plugin'",
";",
"export",
"{",
"CustomVisualizationsPublicPlugin",
"as",
"Plugin",
"}",
";",
"export",
"const",
"plugin",
"=",
"(",
")",
"=>",
"new",
"CustomVisualizationsPublicPlugin",
"(",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
9181,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661677 | [
"import",
"{",
"EditorConfiguration",
"}",
"from",
"\"codemirror\"",
";",
"type",
"FullEditorConfiguration",
"=",
"EditorConfiguration",
"&",
"{",
"showHint",
"?",
":",
"boolean",
";",
"hintOptions",
"?",
":",
"any",
";",
"matchBrackets",
"?",
":",
"boolean",
";",
"autoCloseBrackets",
"?",
":",
"boolean",
";",
"}",
";",
"export",
"{",
"FullEditorConfiguration",
"}",
";",
"export",
"const",
"configurableCodeMirrorOptions",
"=",
"{",
"value",
":",
"false",
",",
"mode",
":",
"true",
",",
"autoCloseBrackets",
":",
"true",
",",
"matchBrackets",
":",
"true",
",",
"theme",
":",
"false",
",",
"indentUnit",
":",
"true",
",",
"smartIndent",
":",
"true",
",",
"tabSize",
":",
"true",
",",
"indentWithTabs",
":",
"true",
",",
"electricChars",
":",
"true",
",",
"rtlMoveVisually",
":",
"true",
",",
"keyMap",
":",
"true",
",",
"extraKeys",
":",
"false",
",",
"lineWrapping",
":",
"true",
",",
"lineNumbers",
":",
"true",
",",
"firstLineNumber",
":",
"true",
",",
"lineNumberFormatter",
":",
"true",
",",
"gutters",
":",
"true",
",",
"fixedGutter",
":",
"true",
",",
"readOnly",
":",
"true",
",",
"showCursorWhenSelecting",
":",
"true",
",",
"undoDepth",
":",
"true",
",",
"historyEventDelay",
":",
"true",
",",
"tabindex",
":",
"true",
",",
"autofocus",
":",
"true",
",",
"dragDrop",
":",
"true",
",",
"onDragEvent",
":",
"true",
",",
"onKeyEvent",
":",
"true",
",",
"cursorBlinkRate",
":",
"true",
",",
"cursorHeight",
":",
"true",
",",
"workTime",
":",
"true",
",",
"workDelay",
":",
"true",
",",
"pollInterval",
":",
"true",
",",
"flattenSpans",
":",
"true",
",",
"maxHighlightLength",
":",
"true",
",",
"viewportMargin",
":",
"true",
",",
"lint",
":",
"true",
",",
"showHint",
":",
"true",
",",
"hintOptions",
":",
"false",
"}",
";",
"export",
"function",
"isConfigurable",
"(",
"option",
")",
"{",
"return",
"!",
"!",
"(",
"configurableCodeMirrorOptions",
"as",
"{",
"[",
"s",
"]",
":",
"boolean",
";",
"}",
")",
"[",
"option",
"]",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661678 | [
"import",
"*",
"as",
"React",
"from",
"\"react\"",
";",
"import",
"styled",
",",
"{",
"StyledComponent",
"}",
"from",
"\"styled-components\"",
";",
"interface",
"TypeIconProps",
"{",
"type",
"?",
":",
"\"module\"",
"|",
"\"keyword\"",
"|",
"\"statement\"",
"|",
"\"function\"",
"|",
"\"instance\"",
"|",
"\"null\"",
"|",
"\"class\"",
"|",
"string",
";",
"}",
"interface",
"HintProps",
"{",
"text",
":",
"string",
";",
"type",
"?",
":",
"TypeIconProps",
"[",
"\"type\"",
"]",
";",
"displayText",
"?",
":",
"string",
";",
"[",
"other",
"]",
":",
"any",
";",
"}",
"export",
"function",
"Hint",
"(",
"props",
")",
"{",
"return",
"(",
"<",
"React",
".",
"Fragment",
">",
"{",
"props",
".",
"type",
"?",
"<",
"TypeIcon",
"type",
"=",
"{",
"props",
".",
"type",
"}",
"/> : null}",
"{",
"props",
".",
"displayText",
"||",
"props",
".",
"text",
"}",
"<",
"/React.Fragment>);",
"}",
"/**\n * An Icon to show before a code hint to show the type\n * (e.g. Module, Keyword, etc.)\n */",
"export",
"const",
"TypeIcon",
"=",
"styled",
".",
"span",
".",
"attrs",
"<",
"TypeIconProps",
">",
"(",
"props",
"=>",
"(",
"{",
"className",
":",
"`completion-type-${",
"props",
".",
"type",
"}`",
",",
"title",
":",
"props",
".",
"type",
"}",
")",
")",
"`\n & {\n background: transparent;\n border: transparent 1px solid;\n width: 17px;\n height: 17px;\n margin: 0;\n padding: 0;\n display: inline-block;\n margin-right: 5px;\n top: 18px;\n }\n\n &:before {\n /* When experimental type completion isn't available render the left side as \"nothing\" */\n content: \" \";\n bottom: 1px;\n left: 4px;\n position: relative;\n color: white;\n }\n /* color and content for each type of completion */\n &.completion-type-keyword:before {\n content: \"K\";\n }\n &.completion-type-keyword {\n background-color: darkred;\n }\n &.completion-type-class:before {\n content: \"C\";\n }\n &.completion-type-class {\n background-color: blueviolet;\n }\n &.completion-type-module:before {\n content: \"M\";\n }\n &.completion-type-module {\n background-color: chocolate;\n }\n &.completion-type-statement:before {\n content: \"S\";\n }\n &.completion-type-statement {\n background-color: forestgreen;\n }\n &.completion-type-function:before {\n content: \"ƒ\";\n }\n &.completion-type-function {\n background-color: yellowgreen;\n }\n &.completion-type-instance:before {\n content: \"I\";\n }\n &.completion-type-instance {\n background-color: teal;\n }\n &.completion-type-null:before {\n content: \"ø\";\n }\n &.completion-type-null {\n background-color: black;\n }\n`",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
61,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
14,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661679 | [
"let",
"js_idx_to_char_idx",
"=",
"(",
"js_idx",
",",
"text",
")",
":",
"number",
"=>",
"{",
"let",
"char_idx",
"=",
"js_idx",
";",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"+",
"1",
"<",
"text",
".",
"length",
"&&",
"i",
"<",
"js_idx",
";",
"i",
"++",
")",
"{",
"const",
"char_code",
"=",
"text",
".",
"charCodeAt",
"(",
"i",
")",
";",
"if",
"(",
"char_code",
">=",
"0xd800",
"&&",
"char_code",
"<=",
"0xdbff",
")",
"{",
"const",
"next_char_code",
"=",
"text",
".",
"charCodeAt",
"(",
"i",
"+",
"1",
")",
";",
"if",
"(",
"next_char_code",
">=",
"0xdc00",
"&&",
"next_char_code",
"<=",
"0xdfff",
")",
"{",
"char_idx",
"--",
";",
"i",
"++",
";",
"}",
"}",
"}",
"return",
"char_idx",
";",
"}",
";",
"let",
"char_idx_to_js_idx",
"=",
"(",
"char_idx",
",",
"text",
")",
":",
"number",
"=>",
"{",
"let",
"js_idx",
"=",
"char_idx",
";",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"+",
"1",
"<",
"text",
".",
"length",
"&&",
"i",
"<",
"js_idx",
";",
"i",
"++",
")",
"{",
"const",
"char_code",
"=",
"text",
".",
"charCodeAt",
"(",
"i",
")",
";",
"if",
"(",
"char_code",
">=",
"0xd800",
"&&",
"char_code",
"<=",
"0xdbff",
")",
"{",
"const",
"next_char_code",
"=",
"text",
".",
"charCodeAt",
"(",
"i",
"+",
"1",
")",
";",
"if",
"(",
"next_char_code",
">=",
"0xdc00",
"&&",
"next_char_code",
"<=",
"0xdfff",
")",
"{",
"js_idx",
"++",
";",
"i",
"++",
";",
"}",
"}",
"}",
"return",
"js_idx",
";",
"}",
";",
"if",
"(",
"\"𝐚\"",
".",
"length",
"===",
"1",
")",
"{",
"char_idx_to_js_idx",
"=",
"js_idx_to_char_idx",
"=",
"(",
"idx",
",",
"_text",
")",
"=>",
"{",
"return",
"idx",
";",
"}",
";",
"}",
"export",
"{",
"char_idx_to_js_idx",
",",
"js_idx_to_char_idx",
"}",
";"
] | [
null,
3,
null,
null,
3,
null,
2,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
3,
null,
2,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661680 | [
"import",
"*",
"as",
"React",
"from",
"\"react\"",
";",
"import",
"ReactDOM",
"from",
"\"react-dom\"",
";",
"import",
"{",
"childOf",
",",
"createMessage",
",",
"JupyterMessage",
",",
"ofMessageType",
"}",
"from",
"\"@nteract/messaging\"",
";",
"import",
"{",
"Channels",
"}",
"from",
"\"@nteract/messaging\"",
";",
"import",
"{",
"Doc",
",",
"Editor",
",",
"Position",
"}",
"from",
"\"codemirror\"",
";",
"import",
"{",
"Observable",
",",
"Observer",
"}",
"from",
"\"rxjs\"",
";",
"import",
"{",
"first",
",",
"map",
",",
"timeout",
"}",
"from",
"\"rxjs/operators\"",
";",
"import",
"{",
"Hint",
"}",
"from",
"\"../components/hint\"",
";",
"import",
"{",
"char_idx_to_js_idx",
",",
"js_idx_to_char_idx",
"}",
"from",
"\"./surrogate\"",
";",
"export",
"function",
"pick",
"(",
"_cm",
",",
"handle",
")",
"{",
"handle",
".",
"pick",
"(",
")",
";",
"}",
"export",
"function",
"formChangeObject",
"<",
"T",
",",
"U",
">",
"(",
"cm",
",",
"change",
")",
"{",
"return",
"{",
"cm",
",",
"change",
"}",
";",
"}",
"interface",
"CompletionResult",
"{",
"end",
":",
"number",
";",
"start",
":",
"number",
";",
"type",
":",
"string",
";",
"text",
":",
"string",
";",
"displayText",
"?",
":",
"string",
";",
"}",
"type",
"CompletionMatch",
"=",
"string",
"|",
"CompletionResult",
";",
"interface",
"CompletionResults",
"{",
"cursor_start",
":",
"number",
";",
"cursor_end",
":",
"number",
";",
"matches",
":",
"CompletionMatch",
"[",
"]",
";",
"metadata",
"?",
":",
"{",
"_jupyter_types_experimental",
"?",
":",
"any",
";",
"}",
";",
"}",
"export",
"const",
"expand_completions",
"=",
"(",
"editor",
")",
"=>",
"(",
"results",
")",
"=>",
"{",
"let",
"start",
"=",
"results",
".",
"cursor_start",
";",
"let",
"end",
"=",
"results",
".",
"cursor_end",
";",
"if",
"(",
"end",
"===",
"null",
")",
"{",
"end",
"=",
"editor",
".",
"indexFromPos",
"(",
"editor",
".",
"getCursor",
"(",
")",
")",
";",
"if",
"(",
"start",
"===",
"null",
")",
"{",
"start",
"=",
"end",
";",
"}",
"else",
"if",
"(",
"start",
"<",
"0",
")",
"{",
"start",
"=",
"end",
"+",
"start",
";",
"}",
"}",
"else",
"{",
"const",
"text",
"=",
"editor",
".",
"getValue",
"(",
")",
";",
"end",
"=",
"char_idx_to_js_idx",
"(",
"end",
",",
"text",
")",
";",
"start",
"=",
"char_idx_to_js_idx",
"(",
"start",
",",
"text",
")",
";",
"}",
"const",
"from",
"=",
"editor",
".",
"posFromIndex",
"(",
"start",
")",
";",
"const",
"to",
"=",
"editor",
".",
"posFromIndex",
"(",
"end",
")",
";",
"let",
"matches",
"=",
"results",
".",
"matches",
";",
"if",
"(",
"results",
".",
"metadata",
"&&",
"results",
".",
"metadata",
".",
"_jupyter_types_experimental",
")",
"{",
"matches",
"=",
"results",
".",
"metadata",
".",
"_jupyter_types_experimental",
";",
"}",
"function",
"render",
"(",
"elt",
",",
"data",
",",
"completion",
")",
"{",
"ReactDOM",
".",
"render",
"(",
"<",
"Hint",
"{",
"...",
"completion",
"}",
"/",
">",
",",
"elt",
")",
";",
"}",
"return",
"{",
"list",
":",
"matches",
".",
"map",
"(",
"(",
"match",
")",
"=>",
"{",
"if",
"(",
"typeof",
"match",
"===",
"\"string\"",
")",
"{",
"return",
"{",
"to",
",",
"from",
",",
"text",
":",
"match",
",",
"render",
"}",
";",
"}",
"return",
"{",
"to",
",",
"from",
",",
"render",
",",
"...",
"match",
"}",
";",
"}",
")",
",",
"from",
",",
"to",
"}",
";",
"}",
";",
"export",
"function",
"codeCompleteObservable",
"(",
"channels",
",",
"editor",
",",
"message",
")",
"{",
"const",
"completion$",
"=",
"channels",
".",
"pipe",
"(",
"childOf",
"(",
"message",
")",
",",
"ofMessageType",
"(",
"\"complete_reply\"",
")",
",",
"map",
"(",
"entry",
"=>",
"entry",
".",
"content",
")",
",",
"first",
"(",
")",
",",
"map",
"(",
"expand_completions",
"(",
"editor",
")",
")",
",",
"timeout",
"(",
"15000",
")",
")",
";",
"return",
"Observable",
".",
"create",
"(",
"(",
"observer",
")",
"=>",
"{",
"const",
"subscription",
"=",
"completion$",
".",
"subscribe",
"(",
"observer",
")",
";",
"channels",
".",
"next",
"(",
"message",
")",
";",
"return",
"subscription",
";",
"}",
")",
";",
"}",
"export",
"const",
"completionRequest",
"=",
"(",
"code",
",",
"cursorPos",
")",
"=>",
"createMessage",
"(",
"\"complete_request\"",
",",
"{",
"content",
":",
"{",
"code",
",",
"cursor_pos",
":",
"cursorPos",
"}",
"}",
")",
";",
"export",
"function",
"codeComplete",
"(",
"channels",
",",
"editor",
")",
"{",
"const",
"cursor",
"=",
"editor",
".",
"getCursor",
"(",
")",
";",
"let",
"cursorPos",
"=",
"editor",
".",
"indexFromPos",
"(",
"cursor",
")",
";",
"const",
"code",
"=",
"editor",
".",
"getValue",
"(",
")",
";",
"cursorPos",
"=",
"js_idx_to_char_idx",
"(",
"cursorPos",
",",
"code",
")",
";",
"const",
"message",
"=",
"completionRequest",
"(",
"code",
",",
"cursorPos",
")",
";",
"return",
"codeCompleteObservable",
"(",
"channels",
",",
"editor",
",",
"message",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
11,
null,
89,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
856,
null,
null,
null,
4056,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
65,
null,
null,
null,
null,
null,
null,
null,
null,
null,
65,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
15,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4220,
null,
856,
null,
17612,
null,
null,
null,
18,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
17612,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
708,
null,
null,
null,
null,
157,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
17612,
null,
null,
2,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4220,
null,
856,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
17612,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661681 | [
"import",
"{",
"Channels",
",",
"childOf",
",",
"createMessage",
",",
"JupyterMessage",
",",
"ofMessageType",
"}",
"from",
"\"@nteract/messaging\"",
";",
"import",
"{",
"Doc",
",",
"Editor",
",",
"Position",
"}",
"from",
"\"codemirror\"",
";",
"import",
"{",
"Observable",
",",
"Observer",
"}",
"from",
"\"rxjs\"",
";",
"import",
"{",
"first",
",",
"map",
"}",
"from",
"\"rxjs/operators\"",
";",
"import",
"{",
"js_idx_to_char_idx",
"}",
"from",
"\"./surrogate\"",
";",
"export",
"function",
"tooltipObservable",
"(",
"channels",
",",
"_editor",
",",
"message",
")",
"{",
"const",
"tip$",
"=",
"channels",
".",
"pipe",
"(",
"childOf",
"(",
"message",
")",
",",
"ofMessageType",
"(",
"\"inspect_reply\"",
")",
",",
"map",
"(",
"(",
"entry",
")",
"=>",
"entry",
".",
"content",
")",
",",
"first",
"(",
")",
",",
"map",
"(",
"results",
"=>",
"(",
"{",
"dict",
":",
"results",
".",
"data",
"}",
")",
")",
")",
";",
"return",
"Observable",
".",
"create",
"(",
"(",
"observer",
")",
"=>",
"{",
"const",
"subscription",
"=",
"tip$",
".",
"subscribe",
"(",
"observer",
")",
";",
"channels",
".",
"next",
"(",
"message",
")",
";",
"return",
"subscription",
";",
"}",
")",
";",
"}",
"export",
"function",
"tooltipRequest",
"(",
"code",
",",
"cursorPos",
")",
"{",
"return",
"createMessage",
"(",
"\"inspect_request\"",
",",
"{",
"content",
":",
"{",
"code",
",",
"cursor_pos",
":",
"cursorPos",
",",
"detail_level",
":",
"0",
"}",
"}",
")",
";",
"}",
"export",
"function",
"tool",
"(",
"channels",
",",
"editor",
")",
"{",
"const",
"cursor",
"=",
"editor",
".",
"getCursor",
"(",
")",
";",
"const",
"cursorPos",
"=",
"js_idx_to_char_idx",
"(",
"editor",
".",
"indexFromPos",
"(",
"cursor",
")",
",",
"editor",
".",
"getValue",
"(",
")",
")",
";",
"const",
"code",
"=",
"editor",
".",
"getValue",
"(",
")",
";",
"const",
"message",
"=",
"tooltipRequest",
"(",
"code",
",",
"cursorPos",
")",
";",
"return",
"tooltipObservable",
"(",
"channels",
",",
"editor",
",",
"message",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4220,
null,
null,
null,
17612,
null,
null,
null,
18,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
17612,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
708,
null,
null,
null,
null,
157,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
17612,
null,
2,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4220,
null,
null,
null,
null,
null,
65,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
17612,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661682 | [
"import",
"styled",
",",
"{",
"StyledComponent",
"}",
"from",
"\"styled-components\"",
";",
"/**\n * This is the <textarea /> we let CodeMirror hijack.\n *\n * This also provides a decent server-side renderable <textarea /> that matches\n * the style of our CodeMirror editor.\n */",
"export",
"const",
"TextArea",
"=",
"styled",
".",
"textarea",
".",
"attrs",
"(",
"{",
"autoComplete",
":",
"\"off\"",
",",
"ariaLabel",
":",
"\"codemirror-textarea\"",
"}",
")",
"`\n font-family: \"Dank Mono\", dm, \"Source Code Pro\", \"Monaco\", monospace;\n font-size: 14px;\n line-height: 20px;\n\n height: inherit;\n\n background: none;\n\n border: none;\n overflow: hidden;\n\n -webkit-scrollbar: none;\n -webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none;\n width: 100%;\n resize: none;\n padding: 10px 0 5px 10px;\n letter-spacing: 0.3px;\n word-spacing: 0px;\n\n &:focus {\n outline: none;\n border: none;\n }\n`",
";",
"export",
"{",
"TextArea",
"as",
"InitialTextArea",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
14,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661683 | [
"import",
"{",
"MediaBundle",
"}",
"from",
"\"@nteract/commutable\"",
";",
"import",
"{",
"Media",
",",
"RichMedia",
"}",
"from",
"\"@nteract/outputs\"",
";",
"import",
"*",
"as",
"React",
"from",
"\"react\"",
";",
"import",
"styled",
",",
"{",
"StyledComponent",
"}",
"from",
"\"styled-components\"",
";",
"const",
"TipButton",
"=",
"styled",
".",
"button",
"`\n float: right;\n font-size: 11.5px;\n position: absolute;\n right: 0px;\n top: 0px;\n`",
";",
"interface",
"CursorCoords",
"{",
"top",
":",
"number",
";",
"left",
":",
"number",
";",
"bottom",
"?",
":",
"number",
";",
"}",
"interface",
"TipProps",
"{",
"cursorCoords",
":",
"CursorCoords",
";",
"}",
"export",
"const",
"Tip",
"=",
"styled",
".",
"div",
"`\n background-color: var(--theme-app-bg, #2b2b2b);\n box-shadow: 2px 2px 50px rgba(0, 0, 0, 0.2);\n float: right;\n height: 50vh;\n left: ${",
"(",
"props",
")",
"=>",
"props",
".",
"cursorCoords",
".",
"left",
"}px;\n margin: 30px 20px 50px 20px;\n overflow-y: auto;\n padding: 20px 20px 50px 20px;\n position: absolute;\n top: ${",
"(",
"props",
")",
"=>",
"props",
".",
"cursorCoords",
".",
"top",
"}px;\n white-space: pre-wrap;\n width: 100vh;\n overflow-wrap: break-word;\n z-index: 9999999;\n`",
";",
"interface",
"Props",
"{",
"bundle",
":",
"MediaBundle",
"|",
"null",
";",
"cursorCoords",
":",
"CursorCoords",
"|",
"null",
";",
"deleteTip",
"(",
")",
":",
"void",
";",
"}",
"export",
"function",
"Tooltip",
"(",
"{",
"bundle",
",",
"cursorCoords",
",",
"deleteTip",
"}",
")",
"{",
"return",
"bundle",
"&&",
"cursorCoords",
"?",
"(",
"<",
"Tip",
"className",
"=",
"\"CodeMirror-hint\"",
"tabIndex",
"=",
"{",
"0",
"}",
"onKeyDown",
"=",
"{",
"e",
"=>",
"{",
"e",
".",
"key",
"===",
"\"Escape\"",
"?",
"deleteTip",
"(",
")",
":",
"null",
";",
"}",
"}",
"cursorCoords",
"=",
"{",
"cursorCoords",
"}",
">",
"<",
"RichMedia",
"data",
"=",
"{",
"bundle",
"}",
"metadata",
"=",
"{",
"{",
"expanded",
":",
"true",
"}",
"}",
">",
"<",
"Media",
".",
"Markdown",
"/>",
"<",
"Media",
".",
"Plain",
"/",
">",
"<",
"/RichMedia>",
"<",
"TipButton",
"onClick",
"=",
"{",
"deleteTip",
"}",
">",
"{",
"\"\\u2715\"",
"}",
"<",
"/TipButton>",
"<",
"/Tip>) : null;",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
14,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
14,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661684 | [
"import",
"{",
"MediaBundle",
"}",
"from",
"\"@nteract/commutable\"",
";",
"import",
"{",
"Channels",
"}",
"from",
"\"@nteract/messaging\"",
";",
"import",
"CodeMirror",
",",
"{",
"Doc",
",",
"Editor",
",",
"EditorChangeLinkedList",
",",
"EditorFromTextArea",
",",
"Position",
"}",
"from",
"\"codemirror\"",
";",
"import",
"{",
"FullEditorConfiguration",
",",
"isConfigurable",
"}",
"from",
"\"./configurable\"",
";",
"import",
"*",
"as",
"React",
"from",
"\"react\"",
";",
"import",
"ReactDOM",
"from",
"\"react-dom\"",
";",
"import",
"{",
"empty",
",",
"merge",
",",
"Observable",
",",
"Subject",
",",
"Subscription",
"}",
"from",
"\"rxjs\"",
";",
"import",
"{",
"catchError",
",",
"debounceTime",
",",
"map",
",",
"partition",
",",
"repeat",
",",
"switchMap",
",",
"takeUntil",
"}",
"from",
"\"rxjs/operators\"",
";",
"import",
"{",
"codeComplete",
",",
"pick",
"}",
"from",
"\"./jupyter/complete\"",
";",
"import",
"{",
"tool",
"}",
"from",
"\"./jupyter/tooltip\"",
";",
"import",
"{",
"InitialTextArea",
"}",
"from",
"\"./components/initial-text-area\"",
";",
"import",
"{",
"Tooltip",
"}",
"from",
"\"./components/tooltip\"",
";",
"import",
"CodeMirrorCSS",
"from",
"\"./vendored/codemirror\"",
";",
"import",
"ShowHintCSS",
"from",
"\"./vendored/show-hint\"",
";",
"import",
"isEqual",
"from",
"\"lodash.isequal\"",
";",
"export",
"{",
"CodeMirrorCSS",
",",
"ShowHintCSS",
"}",
";",
"function",
"normalizeLineEndings",
"(",
"str",
")",
"{",
"if",
"(",
"!",
"str",
")",
"{",
"return",
"str",
";",
"}",
"return",
"str",
".",
"replace",
"(",
"/\\r\\n|\\r/g",
",",
"\"\\n\"",
")",
";",
"}",
"export",
"interface",
"EditorKeyEvent",
"{",
"editor",
":",
"Editor",
";",
"ev",
":",
"KeyboardEvent",
";",
"}",
"export",
"type",
"CodeMirrorEditorProps",
"=",
"{",
"autofocus",
":",
"boolean",
";",
"preserveScrollPosition",
":",
"boolean",
";",
"editorFocused",
":",
"boolean",
";",
"completion",
":",
"boolean",
";",
"tip",
"?",
":",
"boolean",
";",
"focusAbove",
"?",
":",
"(",
"instance",
":",
"Editor",
")",
"=>",
"void",
";",
"focusBelow",
"?",
":",
"(",
"instance",
":",
"Editor",
")",
"=>",
"void",
";",
"channels",
"?",
":",
"Channels",
"|",
"null",
";",
"/**\n * We use the kernelStatus to check to see if the kernel is currently\n * idle. If the kernel is idle, then we can send over a completion_request\n * to the kernel.\n */",
"kernelStatus",
":",
"string",
";",
"onChange",
"?",
":",
"(",
"value",
":",
"string",
",",
"change",
":",
"EditorChangeLinkedList",
")",
"=>",
"void",
";",
"onFocusChange",
"?",
":",
"(",
"focused",
":",
"boolean",
")",
"=>",
"void",
";",
"value",
":",
"string",
";",
"editorType",
":",
"\"codemirror\"",
";",
"codeMirror",
":",
"FullEditorConfiguration",
";",
"}",
";",
"interface",
"CodeMirrorEditorState",
"{",
"bundle",
":",
"MediaBundle",
"|",
"null",
";",
"cursorCoords",
":",
"{",
"top",
":",
"number",
";",
"left",
":",
"number",
";",
"bottom",
":",
"number",
";",
"}",
"|",
"null",
";",
"}",
"interface",
"CodeCompletionEvent",
"{",
"editor",
":",
"Editor",
"&",
"Doc",
";",
"callback",
":",
"(",
"completionResult",
":",
"any",
")",
"=>",
"{",
"}",
";",
"debounce",
":",
"boolean",
";",
"}",
"type",
"Mode",
"=",
"{",
"name",
":",
"string",
";",
"}",
";",
"export",
"default",
"class",
"CodeMirrorEditor",
"extends",
"React",
".",
"Component",
"<",
"CodeMirrorEditorProps",
",",
"CodeMirrorEditorState",
">",
"{",
"static",
"defaultProps",
":",
"Partial",
"<",
"CodeMirrorEditorProps",
">",
"=",
"{",
"value",
":",
"\"\"",
",",
"channels",
":",
"null",
",",
"completion",
":",
"false",
",",
"editorFocused",
":",
"false",
",",
"kernelStatus",
":",
"\"not connected\"",
",",
"tip",
":",
"false",
",",
"autofocus",
":",
"false",
",",
"editorType",
":",
"\"codemirror\"",
",",
"codeMirror",
":",
"{",
"matchBrackets",
":",
"true",
",",
"autoCloseBrackets",
":",
"false",
",",
"indentUnit",
":",
"4",
",",
"tabSize",
":",
"4",
",",
"lineNumbers",
":",
"false",
",",
"smartIndent",
":",
"true",
",",
"cursorBlinkRate",
":",
"530",
",",
"showCursorWhenSelecting",
":",
"true",
"}",
"}",
";",
"textarea",
"?",
":",
"HTMLTextAreaElement",
"|",
"null",
";",
"cm",
"!",
":",
"EditorFromTextArea",
";",
"defaultOptions",
":",
"FullEditorConfiguration",
";",
"completionSubject",
"!",
":",
"Subject",
"<",
"CodeCompletionEvent",
">",
";",
"completionEventsSubscriber",
"!",
":",
"Subscription",
";",
"debounceNextCompletionRequest",
":",
"boolean",
";",
"textareaRef",
":",
"React",
".",
"RefObject",
"<",
"HTMLTextAreaElement",
">",
"=",
"React",
".",
"createRef",
"<",
"HTMLTextAreaElement",
">",
"(",
")",
";",
"tooltipNode",
":",
"HTMLDivElement",
"|",
"null",
"=",
"null",
";",
"constructor",
"(",
"props",
")",
"{",
"super",
"(",
"props",
")",
";",
"this",
".",
"hint",
"=",
"this",
".",
"hint",
".",
"bind",
"(",
"this",
")",
";",
"(",
"this",
".",
"hint",
"as",
"any",
")",
".",
"async",
"=",
"true",
";",
"this",
".",
"tips",
"=",
"this",
".",
"tips",
".",
"bind",
"(",
"this",
")",
";",
"this",
".",
"deleteTip",
"=",
"this",
".",
"deleteTip",
".",
"bind",
"(",
"this",
")",
";",
"this",
".",
"debounceNextCompletionRequest",
"=",
"true",
";",
"this",
".",
"state",
"=",
"{",
"bundle",
":",
"null",
",",
"cursorCoords",
":",
"null",
"}",
";",
"this",
".",
"fullOptions",
"=",
"this",
".",
"fullOptions",
".",
"bind",
"(",
"this",
")",
";",
"this",
".",
"cleanMode",
"=",
"this",
".",
"cleanMode",
".",
"bind",
"(",
"this",
")",
";",
"this",
".",
"loadMode",
"=",
"this",
".",
"loadMode",
".",
"bind",
"(",
"this",
")",
";",
"const",
"extraKeys",
"=",
"{",
"\"Cmd-.\"",
":",
"this",
".",
"tips",
",",
"\"Cmd-/\"",
":",
"\"toggleComment\"",
",",
"\"Ctrl-.\"",
":",
"this",
".",
"tips",
",",
"\"Ctrl-/\"",
":",
"\"toggleComment\"",
",",
"\"Ctrl-Space\"",
":",
"(",
"editor",
")",
"=>",
"{",
"this",
".",
"debounceNextCompletionRequest",
"=",
"false",
";",
"return",
"editor",
".",
"execCommand",
"(",
"\"autocomplete\"",
")",
";",
"}",
",",
"Down",
":",
"this",
".",
"goLineDownOrEmit",
",",
"\"Shift-Tab\"",
":",
"(",
"editor",
")",
"=>",
"editor",
".",
"execCommand",
"(",
"\"indentLess\"",
")",
",",
"Tab",
":",
"this",
".",
"executeTab",
",",
"Up",
":",
"this",
".",
"goLineUpOrEmit",
",",
"Esc",
":",
"this",
".",
"deleteTip",
"}",
";",
"const",
"hintOptions",
"=",
"{",
"completeSingle",
":",
"false",
",",
"extraKeys",
":",
"{",
"Right",
":",
"pick",
"}",
",",
"hint",
":",
"this",
".",
"hint",
"}",
";",
"this",
".",
"defaultOptions",
"=",
"Object",
".",
"assign",
"(",
"{",
"extraKeys",
",",
"hintOptions",
",",
"theme",
":",
"\"composition\"",
",",
"lineWrapping",
":",
"true",
"}",
")",
";",
"}",
"fullOptions",
"(",
"defaults",
"=",
"{",
"}",
")",
"{",
"return",
"Object",
".",
"keys",
"(",
"this",
".",
"props",
".",
"codeMirror",
")",
".",
"filter",
"(",
"isConfigurable",
")",
".",
"reduce",
"(",
"(",
"obj",
",",
"key",
")",
"=>",
"{",
"obj",
"[",
"key",
"]",
"=",
"this",
".",
"props",
".",
"codeMirror",
"[",
"key",
"]",
";",
"return",
"obj",
";",
"}",
",",
"defaults",
")",
";",
"}",
"cleanMode",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"props",
".",
"codeMirror",
".",
"mode",
")",
"{",
"return",
"\"text/plain\"",
";",
"}",
"if",
"(",
"typeof",
"this",
".",
"props",
".",
"codeMirror",
".",
"mode",
"===",
"\"string\"",
")",
"{",
"return",
"this",
".",
"props",
".",
"codeMirror",
".",
"mode",
";",
"}",
"if",
"(",
"typeof",
"this",
".",
"props",
".",
"codeMirror",
".",
"mode",
"===",
"\"object\"",
"&&",
"\"toJS\"",
"in",
"this",
".",
"props",
".",
"codeMirror",
".",
"mode",
")",
"{",
"return",
"this",
".",
"props",
".",
"codeMirror",
".",
"mode",
".",
"toJS",
"(",
")",
";",
"}",
"return",
"this",
".",
"props",
".",
"codeMirror",
".",
"mode",
";",
"}",
"async",
"loadMode",
"(",
")",
"{",
"let",
"mode",
"=",
"this",
".",
"cleanMode",
"(",
")",
";",
"mode",
"=",
"typeof",
"mode",
"===",
"\"string\"",
"?",
"mode",
":",
"mode",
".",
"name",
";",
"if",
"(",
"CodeMirror",
".",
"modes",
".",
"hasOwnProperty",
"(",
"mode",
")",
")",
"{",
"return",
"mode",
";",
"}",
"try",
"{",
"await",
"import",
"(",
"`codemirror/mode/${",
"mode",
"}/${",
"mode",
"}.js`",
")",
";",
"}",
"catch",
"(",
"error",
")",
"{",
"console",
".",
"warn",
"(",
"`Unable to load ${",
"mode",
"} due to ${",
"error",
".",
"message",
"}`",
")",
";",
"}",
"return",
"mode",
";",
"}",
"componentDidMount",
"(",
")",
"{",
"require",
"(",
"\"codemirror/addon/hint/show-hint\"",
")",
";",
"require",
"(",
"\"codemirror/addon/hint/anyword-hint\"",
")",
";",
"require",
"(",
"\"codemirror/addon/edit/matchbrackets\"",
")",
";",
"require",
"(",
"\"codemirror/addon/edit/closebrackets\"",
")",
";",
"require",
"(",
"\"codemirror/addon/comment/comment\"",
")",
";",
"require",
"(",
"\"codemirror/mode/python/python\"",
")",
";",
"require",
"(",
"\"codemirror/mode/ruby/ruby\"",
")",
";",
"require",
"(",
"\"codemirror/mode/javascript/javascript\"",
")",
";",
"require",
"(",
"\"codemirror/mode/elm/elm\"",
")",
";",
"require",
"(",
"\"codemirror/mode/css/css\"",
")",
";",
"require",
"(",
"\"codemirror/mode/julia/julia\"",
")",
";",
"require",
"(",
"\"codemirror/mode/r/r\"",
")",
";",
"require",
"(",
"\"codemirror/mode/clike/clike\"",
")",
";",
"require",
"(",
"\"codemirror/mode/shell/shell\"",
")",
";",
"require",
"(",
"\"codemirror/mode/sql/sql\"",
")",
";",
"require",
"(",
"\"codemirror/mode/markdown/markdown\"",
")",
";",
"require",
"(",
"\"codemirror/mode/gfm/gfm\"",
")",
";",
"require",
"(",
"\"codemirror/mode/go/go\"",
")",
";",
"require",
"(",
"\"codemirror/mode/powershell/powershell\"",
")",
";",
"require",
"(",
"\"codemirror/mode/mllike/mllike\"",
")",
";",
"require",
"(",
"\"codemirror/mode/rust/rust\"",
")",
";",
"require",
"(",
"\"./mode/ipython\"",
")",
";",
"const",
"{",
"editorFocused",
",",
"focusAbove",
",",
"focusBelow",
"}",
"=",
"this",
".",
"props",
";",
"const",
"tipHolder",
"=",
"document",
".",
"getElementsByClassName",
"(",
"\"tip-holder\"",
")",
"[",
"0",
"]",
"as",
"HTMLDivElement",
";",
"if",
"(",
"!",
"tipHolder",
")",
"{",
"this",
".",
"tooltipNode",
"=",
"document",
".",
"createElement",
"(",
"\"div\"",
")",
";",
"this",
".",
"tooltipNode",
".",
"classList",
".",
"add",
"(",
"\"tip-holder\"",
")",
";",
"document",
".",
"body",
".",
"appendChild",
"(",
"this",
".",
"tooltipNode",
")",
";",
"}",
"else",
"{",
"this",
".",
"tooltipNode",
"=",
"tipHolder",
";",
"}",
"const",
"options",
"=",
"{",
"...",
"this",
".",
"fullOptions",
"(",
")",
",",
"...",
"this",
".",
"defaultOptions",
",",
"mode",
":",
"this",
".",
"cleanMode",
"(",
")",
"}",
";",
"this",
".",
"cm",
"=",
"CodeMirror",
".",
"fromTextArea",
"(",
"this",
".",
"textareaRef",
".",
"current",
"!",
",",
"options",
")",
";",
"this",
".",
"loadMode",
"(",
")",
".",
"then",
"(",
"mode",
"=>",
"this",
".",
"cm",
".",
"setOption",
"(",
"\"mode\"",
",",
"mode",
")",
")",
".",
"catch",
"(",
"error",
"=>",
"console",
".",
"error",
"(",
"\"Unable to load mode\"",
",",
"error",
")",
")",
";",
"this",
".",
"cm",
".",
"setValue",
"(",
"this",
".",
"props",
".",
"value",
"||",
"\"\"",
")",
";",
"if",
"(",
"editorFocused",
")",
"{",
"this",
".",
"cm",
".",
"focus",
"(",
")",
";",
"}",
"this",
".",
"cm",
".",
"on",
"(",
"\"topBoundary\"",
",",
"(",
"editor",
")",
"=>",
"{",
"this",
".",
"deleteTip",
"(",
")",
";",
"focusAbove",
"&&",
"focusAbove",
"(",
"editor",
")",
";",
"}",
")",
";",
"this",
".",
"cm",
".",
"on",
"(",
"\"bottomBoundary\"",
",",
"(",
"editor",
")",
"=>",
"{",
"this",
".",
"deleteTip",
"(",
")",
";",
"focusBelow",
"&&",
"focusBelow",
"(",
"editor",
")",
";",
"}",
")",
";",
"this",
".",
"cm",
".",
"on",
"(",
"\"cursorActivity\"",
",",
"this",
".",
"handleCursorChange",
")",
";",
"this",
".",
"cm",
".",
"on",
"(",
"\"focus\"",
",",
"this",
".",
"focusChanged",
".",
"bind",
"(",
"this",
",",
"true",
")",
")",
";",
"this",
".",
"cm",
".",
"on",
"(",
"\"blur\"",
",",
"this",
".",
"focusChanged",
".",
"bind",
"(",
"this",
",",
"false",
")",
")",
";",
"this",
".",
"cm",
".",
"on",
"(",
"\"change\"",
",",
"this",
".",
"codemirrorValueChanged",
".",
"bind",
"(",
"this",
")",
")",
";",
"this",
".",
"completionSubject",
"=",
"new",
"Subject",
"<",
"CodeCompletionEvent",
">",
"(",
")",
";",
"const",
"[",
"debounce",
",",
"immediate",
"]",
"=",
"partition",
"<",
"CodeCompletionEvent",
">",
"(",
"ev",
"=>",
"ev",
".",
"debounce",
"===",
"true",
")",
"(",
"this",
".",
"completionSubject",
")",
";",
"const",
"mergedCompletionEvents",
"=",
"merge",
"(",
"immediate",
",",
"debounce",
".",
"pipe",
"(",
"debounceTime",
"(",
"150",
")",
",",
"takeUntil",
"(",
"immediate",
")",
",",
"repeat",
"(",
")",
")",
")",
";",
"const",
"completionResults",
"=",
"mergedCompletionEvents",
".",
"pipe",
"(",
"switchMap",
"(",
"ev",
"=>",
"{",
"const",
"{",
"channels",
"}",
"=",
"this",
".",
"props",
";",
"if",
"(",
"!",
"channels",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Unexpectedly received a completion event when channels were unset\"",
")",
";",
"}",
"return",
"codeComplete",
"(",
"channels",
",",
"ev",
".",
"editor",
")",
".",
"pipe",
"(",
"map",
"(",
"completionResult",
"=>",
"(",
")",
"=>",
"ev",
".",
"callback",
"(",
"completionResult",
")",
")",
",",
"takeUntil",
"(",
"this",
".",
"completionSubject",
")",
",",
"catchError",
"(",
"(",
"error",
")",
"=>",
"{",
"console",
".",
"log",
"(",
"`Code completion error: ${",
"error",
".",
"message",
"}`",
")",
";",
"return",
"empty",
"(",
")",
";",
"}",
")",
")",
";",
"}",
")",
")",
"as",
"Observable",
"<",
"(",
")",
"=>",
"void",
">",
";",
"this",
".",
"completionEventsSubscriber",
"=",
"completionResults",
".",
"subscribe",
"(",
"callback",
"=>",
"callback",
"(",
")",
")",
";",
"}",
"nteract",
"shouldComponentUpdate",
"(",
"nextProps",
",",
"nextState",
")",
"{",
"const",
"valueChanged",
"=",
"this",
".",
"props",
".",
"value",
"!==",
"nextProps",
".",
"value",
";",
"const",
"editorFocusedChanged",
"=",
"this",
".",
"props",
".",
"editorFocused",
"!==",
"nextProps",
".",
"editorFocused",
";",
"const",
"codeMirrorConfigChanged",
"=",
"!",
"isEqual",
"(",
"this",
".",
"props",
".",
"codeMirror",
",",
"nextProps",
".",
"codeMirror",
")",
";",
"const",
"bundleChanged",
"=",
"!",
"isEqual",
"(",
"this",
".",
"state",
".",
"bundle",
",",
"nextState",
".",
"bundle",
")",
";",
"return",
"valueChanged",
"||",
"editorFocusedChanged",
"||",
"codeMirrorConfigChanged",
"||",
"bundleChanged",
";",
"}",
"componentDidUpdate",
"(",
"prevProps",
")",
"{",
"if",
"(",
"!",
"this",
".",
"cm",
")",
"{",
"return",
";",
"}",
"for",
"(",
"const",
"optionName",
"in",
"this",
".",
"props",
".",
"codeMirror",
")",
"{",
"if",
"(",
"!",
"isConfigurable",
"(",
"optionName",
")",
")",
"{",
"continue",
";",
"}",
"if",
"(",
"this",
".",
"props",
".",
"codeMirror",
"[",
"optionName",
"]",
"!==",
"prevProps",
".",
"codeMirror",
"[",
"optionName",
"]",
")",
"{",
"if",
"(",
"optionName",
"===",
"\"mode\"",
")",
"{",
"this",
".",
"loadMode",
"(",
")",
".",
"then",
"(",
"mode",
"=>",
"this",
".",
"cm",
".",
"setOption",
"(",
"\"mode\"",
",",
"mode",
")",
")",
".",
"catch",
"(",
"error",
"=>",
"console",
".",
"error",
"(",
"\"Unable to load mode\"",
",",
"error",
")",
")",
";",
"}",
"else",
"{",
"this",
".",
"cm",
".",
"setOption",
"(",
"optionName",
",",
"this",
".",
"props",
".",
"codeMirror",
"[",
"optionName",
"]",
")",
";",
"}",
"}",
"}",
"const",
"{",
"editorFocused",
"}",
"=",
"this",
".",
"props",
";",
"if",
"(",
"prevProps",
".",
"editorFocused",
"!==",
"editorFocused",
")",
"{",
"editorFocused",
"?",
"this",
".",
"cm",
".",
"focus",
"(",
")",
":",
"this",
".",
"cm",
".",
"getInputField",
"(",
")",
".",
"blur",
"(",
")",
";",
"}",
"if",
"(",
"prevProps",
".",
"codeMirror",
".",
"cursorBlinkRate",
"!==",
"this",
".",
"props",
".",
"codeMirror",
".",
"cursorBlinkRate",
")",
"{",
"if",
"(",
"editorFocused",
")",
"{",
"this",
".",
"cm",
".",
"getInputField",
"(",
")",
".",
"blur",
"(",
")",
";",
"this",
".",
"cm",
".",
"focus",
"(",
")",
";",
"}",
"}",
"if",
"(",
"this",
".",
"cm",
"&&",
"this",
".",
"props",
".",
"value",
"!==",
"undefined",
"&&",
"normalizeLineEndings",
"(",
"this",
".",
"cm",
".",
"getValue",
"(",
")",
")",
"!==",
"normalizeLineEndings",
"(",
"this",
".",
"props",
".",
"value",
")",
")",
"{",
"if",
"(",
"this",
".",
"props",
".",
"preserveScrollPosition",
")",
"{",
"const",
"prevScrollPosition",
"=",
"this",
".",
"cm",
".",
"getScrollInfo",
"(",
")",
";",
"this",
".",
"cm",
".",
"setValue",
"(",
"this",
".",
"props",
".",
"value",
")",
";",
"this",
".",
"cm",
".",
"scrollTo",
"(",
"prevScrollPosition",
".",
"left",
",",
"prevScrollPosition",
".",
"top",
")",
";",
"}",
"else",
"{",
"this",
".",
"cm",
".",
"setValue",
"(",
"this",
".",
"props",
".",
"value",
")",
";",
"}",
"}",
"}",
"componentWillUnmount",
"(",
")",
"{",
"if",
"(",
"this",
".",
"cm",
")",
"{",
"this",
".",
"cm",
".",
"toTextArea",
"(",
")",
";",
"}",
"this",
".",
"completionEventsSubscriber",
".",
"unsubscribe",
"(",
")",
";",
"}",
"focusChanged",
"(",
"focused",
")",
"{",
"if",
"(",
"this",
".",
"props",
".",
"onFocusChange",
")",
"{",
"this",
".",
"props",
".",
"onFocusChange",
"(",
"focused",
")",
";",
"}",
"}",
"hint",
"(",
"editor",
",",
"callback",
")",
"{",
"const",
"{",
"completion",
",",
"channels",
"}",
"=",
"this",
".",
"props",
";",
"const",
"debounceThisCompletionRequest",
"=",
"this",
".",
"debounceNextCompletionRequest",
";",
"this",
".",
"debounceNextCompletionRequest",
"=",
"true",
";",
"if",
"(",
"completion",
"&&",
"channels",
")",
"{",
"const",
"el",
"=",
"{",
"editor",
",",
"callback",
",",
"debounce",
":",
"debounceThisCompletionRequest",
"}",
";",
"this",
".",
"completionSubject",
".",
"next",
"(",
"el",
")",
";",
"}",
"}",
"deleteTip",
"(",
")",
"{",
"this",
".",
"setState",
"(",
"{",
"bundle",
":",
"null",
"}",
")",
";",
"}",
"handleCursorChange",
"=",
"(",
"editor",
")",
"=>",
"{",
"const",
"cursorCoords",
"=",
"editor",
".",
"cursorCoords",
"(",
")",
";",
"this",
".",
"setState",
"(",
"{",
"cursorCoords",
"}",
")",
";",
"}",
";",
"tips",
"(",
"editor",
")",
"{",
"const",
"{",
"tip",
",",
"channels",
"}",
"=",
"this",
".",
"props",
";",
"if",
"(",
"this",
".",
"state",
".",
"bundle",
")",
"{",
"return",
"this",
".",
"deleteTip",
"(",
")",
";",
"}",
"if",
"(",
"tip",
")",
"{",
"tool",
"(",
"channels",
"!",
",",
"editor",
")",
".",
"subscribe",
"(",
"(",
"resp",
")",
"=>",
"{",
"const",
"bundle",
"=",
"Object",
".",
"keys",
"(",
"resp",
".",
"dict",
")",
".",
"length",
">",
"0",
"?",
"resp",
".",
"dict",
":",
"null",
";",
"this",
".",
"setState",
"(",
"{",
"bundle",
"}",
")",
";",
"}",
")",
";",
"}",
"}",
"goLineDownOrEmit",
"(",
"editor",
")",
"{",
"const",
"cursor",
"=",
"editor",
".",
"getCursor",
"(",
")",
";",
"const",
"lastLineNumber",
"=",
"editor",
".",
"lastLine",
"(",
")",
";",
"if",
"(",
"cursor",
".",
"line",
"===",
"lastLineNumber",
"&&",
"!",
"editor",
".",
"somethingSelected",
"(",
")",
")",
"{",
"CodeMirror",
".",
"signal",
"(",
"editor",
",",
"\"bottomBoundary\"",
")",
";",
"}",
"else",
"{",
"editor",
".",
"execCommand",
"(",
"\"goLineDown\"",
")",
";",
"}",
"}",
"goLineUpOrEmit",
"(",
"editor",
")",
"{",
"const",
"cursor",
"=",
"editor",
".",
"getCursor",
"(",
")",
";",
"if",
"(",
"cursor",
".",
"line",
"===",
"0",
"&&",
"cursor",
".",
"ch",
"===",
"0",
"&&",
"!",
"editor",
".",
"somethingSelected",
"(",
")",
")",
"{",
"CodeMirror",
".",
"signal",
"(",
"editor",
",",
"\"topBoundary\"",
")",
";",
"}",
"else",
"{",
"editor",
".",
"execCommand",
"(",
"\"goLineUp\"",
")",
";",
"}",
"}",
"executeTab",
"(",
"editor",
")",
"{",
"const",
"{",
"line",
",",
"ch",
"}",
"=",
"editor",
".",
"getCursor",
"(",
")",
";",
"if",
"(",
"editor",
".",
"somethingSelected",
"(",
")",
")",
"{",
"editor",
".",
"execCommand",
"(",
"\"indentMore\"",
")",
";",
"}",
"else",
"if",
"(",
"line",
"&&",
"ch",
"!==",
"0",
")",
"{",
"editor",
".",
"execCommand",
"(",
"\"autocomplete\"",
")",
";",
"}",
"else",
"{",
"editor",
".",
"execCommand",
"(",
"\"insertSoftTab\"",
")",
";",
"}",
"}",
"codemirrorValueChanged",
"(",
"doc",
",",
"change",
")",
"{",
"if",
"(",
"this",
".",
"props",
".",
"onChange",
"&&",
"change",
".",
"origin",
"!==",
"\"setValue\"",
")",
"{",
"this",
".",
"props",
".",
"onChange",
"(",
"doc",
".",
"getValue",
"(",
")",
",",
"change",
")",
";",
"}",
"}",
"render",
"(",
")",
"{",
"const",
"{",
"bundle",
",",
"cursorCoords",
"}",
"=",
"this",
".",
"state",
";",
"const",
"tooltipNode",
"=",
"this",
".",
"tooltipNode",
";",
"return",
"(",
"<",
"React",
".",
"Fragment",
">",
"{",
"}",
"<",
"InitialTextArea",
"ref",
"=",
"{",
"this",
".",
"textareaRef",
"}",
"defaultValue",
"=",
"{",
"this",
".",
"props",
".",
"value",
"}",
"/",
">",
"{",
"tooltipNode",
"?",
"ReactDOM",
".",
"createPortal",
"(",
"<",
"Tooltip",
"bundle",
"=",
"{",
"bundle",
"}",
"cursorCoords",
"=",
"{",
"cursorCoords",
"}",
"deleteTip",
"=",
"{",
"this",
".",
"deleteTip",
"}",
"/",
">",
",",
"tooltipNode",
")",
":",
"null",
"}",
"<",
"/React.Fragment>);",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
331,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
331,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
39,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
331,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
331,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
18,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
18,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
25,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
0,
null,
0,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
331,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
65,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
65,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
331,
null,
48593,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
61,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
39,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661685 | [
"import",
"CodeMirror",
"from",
"\"codemirror\"",
";",
"import",
"\"codemirror/mode/meta\"",
";",
"import",
"\"codemirror/mode/python/python\"",
";",
"CodeMirror",
".",
"defineMode",
"(",
"\"ipython\"",
",",
"(",
"conf",
",",
"parserConf",
")",
"=>",
"{",
"const",
"ipythonConf",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"parserConf",
",",
"{",
"name",
":",
"\"python\"",
",",
"singleOperators",
":",
"new",
"RegExp",
"(",
"\"^[+\\\\-*/%&|@^~<>!?]\"",
")",
",",
"identifiers",
":",
"new",
"RegExp",
"(",
"\"^[_A-Za-z\\u00A1-\\uFFFF][_A-Za-z0-9\\u00A1-\\uFFFF]*\"",
")",
"}",
")",
";",
"return",
"CodeMirror",
".",
"getMode",
"(",
"conf",
",",
"ipythonConf",
")",
";",
"}",
")",
";",
"CodeMirror",
".",
"defineMIME",
"(",
"\"text/x-ipython\"",
",",
"\"ipython\"",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661686 | [
"export",
"const",
"environment",
"=",
"{",
"production",
":",
"false",
"}",
";"
] | [
null,
null,
6,
null,
null,
null,
null,
null,
null,
null
] |
661687 | [
"import",
"{",
"Component",
"}",
"from",
"'@angular/core'",
";",
"import",
"{",
"Operation",
"}",
"from",
"\"./common/operation.model\"",
";",
"import",
"{",
"State",
",",
"Store",
"}",
"from",
"\"@ngrx/store\"",
";",
"import",
"{",
"ADD_OPERATION",
",",
"REMOVE_OPERATION",
",",
"INCREMENT_OPERATION",
",",
"DECREMENT_OPERATION",
"}",
"from",
"\"./common/operations\"",
";",
"@",
"Component",
"(",
"{",
"selector",
":",
"'app-root'",
",",
"template",
":",
"`<div class=\"container\">\n <new-operation (addOperation)=\"addOperation($event)\"></new-operation>\n <operations-list [operations]=\"operations | async\" \n (deleteOperation)=\"deleteOperation($event)\"\n (incrementOperation)=\"incrementOperation($event)\"\n (decrementOperation)=\"decrementOperation($event)\"></operations-list>\n</div>\n\n`",
"}",
")",
"export",
"class",
"AppComponent",
"{",
"public",
"id",
":",
"number",
"=",
"0",
";",
"public",
"operations",
":",
"Array",
"<",
"Operation",
">",
";",
"constructor",
"(",
"private",
"_store",
")",
"{",
"this",
".",
"operations",
"=",
"_store",
".",
"select",
"(",
"'operations'",
")",
";",
"}",
"addOperation",
"(",
"operation",
")",
"{",
"this",
".",
"_store",
".",
"dispatch",
"(",
"{",
"type",
":",
"ADD_OPERATION",
",",
"payload",
":",
"{",
"id",
":",
"++",
"this",
".",
"id",
",",
"reason",
":",
"operation",
".",
"reason",
",",
"amount",
":",
"operation",
".",
"amount",
"}",
"}",
")",
";",
"}",
"incrementOperation",
"(",
"operation",
")",
"{",
"this",
".",
"_store",
".",
"dispatch",
"(",
"{",
"type",
":",
"INCREMENT_OPERATION",
",",
"payload",
":",
"operation",
"}",
")",
";",
"}",
"decrementOperation",
"(",
"operation",
")",
"{",
"this",
".",
"_store",
".",
"dispatch",
"(",
"{",
"type",
":",
"DECREMENT_OPERATION",
",",
"payload",
":",
"operation",
"}",
")",
";",
"}",
"deleteOperation",
"(",
"operation",
")",
"{",
"this",
".",
"_store",
".",
"dispatch",
"(",
"{",
"type",
":",
"REMOVE_OPERATION",
",",
"payload",
":",
"operation",
"}",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
46,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661688 | [
"export",
"const",
"environment",
"=",
"{",
"production",
":",
"true",
"}",
";"
] | [
null,
null,
6,
null,
null,
null,
null,
null,
null,
null
] |
661689 | [
"import",
"{",
"HttpClient",
",",
"HttpEventType",
",",
"HttpRequest",
"}",
"from",
"'@angular/common/http'",
";",
"import",
"{",
"Component",
"}",
"from",
"\"@angular/core\"",
";",
"@",
"Component",
"(",
"{",
"selector",
":",
"'app-root'",
",",
"template",
":",
"`<h1>Reading a file: {{percentDone}}% done</h1>\n `",
"}",
")",
"export",
"class",
"AppComponent",
"{",
"mydata",
":",
"any",
";",
"percentDone",
":",
"number",
";",
"constructor",
"(",
"private",
"httpClient",
")",
"{",
"const",
"req",
"=",
"new",
"HttpRequest",
"(",
"'GET'",
",",
"'./data/48MB_DATA.json'",
",",
"{",
"reportProgress",
":",
"true",
"}",
")",
";",
"httpClient",
".",
"request",
"(",
"req",
")",
".",
"subscribe",
"(",
"data",
"=>",
"{",
"if",
"(",
"data",
".",
"type",
"===",
"HttpEventType",
".",
"DownloadProgress",
")",
"{",
"this",
".",
"percentDone",
"=",
"Math",
".",
"round",
"(",
"100",
"*",
"data",
".",
"loaded",
"/",
"data",
".",
"total",
")",
";",
"console",
".",
"log",
"(",
"`Read ${",
"this",
".",
"percentDone",
"}% of ${",
"data",
".",
"total",
"} bytes`",
")",
";",
"}",
"else",
"{",
"this",
".",
"mydata",
"=",
"data",
";",
"}",
"}",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
160,
null,
null,
null,
211,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3769,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661690 | [
"import",
"{",
"HttpClient",
",",
"HttpHeaders",
",",
"HttpParams",
"}",
"from",
"'@angular/common/http'",
";",
"import",
"{",
"Observable",
"}",
"from",
"'rxjs/Observable'",
";",
"import",
"{",
"Component",
"}",
"from",
"\"@angular/core\"",
";",
"interface",
"Product",
"{",
"id",
":",
"string",
";",
"title",
":",
"string",
";",
"price",
":",
"number",
";",
"}",
"@",
"Component",
"(",
"{",
"selector",
":",
"'app-root'",
",",
"template",
":",
"`<h1>Products</h1>\n <ul>\n <li *ngFor=\"let product of products$ | async\">\n {{product.title }}: {{product.price | currency}}\n </li>\n </ul>\n `",
"}",
")",
"export",
"class",
"AppComponent",
"{",
"products$",
":",
"Observable",
"<",
"Product",
"[",
"]",
">",
";",
"constructor",
"(",
"private",
"httpClient",
")",
"{",
"let",
"httpHeaders",
"=",
"new",
"HttpHeaders",
"(",
")",
".",
"set",
"(",
"'Content-Type'",
",",
"'application/json'",
")",
".",
"set",
"(",
"'Authorization'",
",",
"'Basic QWxhZGRpb'",
")",
";",
"let",
"httpParams",
"=",
"new",
"HttpParams",
"(",
")",
".",
"set",
"(",
"'title'",
",",
"\"First\"",
")",
";",
"this",
".",
"products$",
"=",
"this",
".",
"httpClient",
".",
"get",
"<",
"Product",
"[",
"]",
">",
"(",
"'/data/products.json'",
",",
"{",
"headers",
":",
"httpHeaders",
",",
"params",
":",
"httpParams",
"}",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
160,
null,
null,
null,
753,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
667,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661691 | [
"export",
"const",
"environment",
"=",
"{",
"production",
":",
"true",
"}",
";"
] | [
null,
null,
6,
null,
null,
null,
null,
null,
null,
null
] |
661692 | [
"export",
"const",
"environment",
"=",
"{",
"production",
":",
"false",
"}",
";"
] | [
null,
null,
6,
null,
null,
null,
null,
null,
null,
null
] |
661693 | [
"import",
"{",
"WalletAdapterNetwork",
"}",
"from",
"'@solana/wallet-adapter-base'",
";",
"import",
"{",
"ConnectionProvider",
",",
"WalletProvider",
"}",
"from",
"'@solana/wallet-adapter-react'",
";",
"import",
"{",
"WalletModalProvider",
",",
"WalletMultiButton",
"}",
"from",
"'@solana/wallet-adapter-react-ui'",
";",
"import",
"{",
"LedgerWalletAdapter",
",",
"PhantomWalletAdapter",
",",
"SlopeWalletAdapter",
",",
"SolflareWalletAdapter",
",",
"SolletExtensionWalletAdapter",
",",
"SolletWalletAdapter",
",",
"TorusWalletAdapter",
",",
"}",
"from",
"'@solana/wallet-adapter-wallets'",
";",
"import",
"{",
"clusterApiUrl",
"}",
"from",
"'@solana/web3.js'",
";",
"import",
"React",
",",
"{",
"FC",
",",
"ReactNode",
",",
"useMemo",
"}",
"from",
"'react'",
";",
"require",
"(",
"'@solana/wallet-adapter-react-ui/styles.css'",
")",
";",
"export",
"const",
"App",
"=",
"(",
")",
"=>",
"{",
"return",
"(",
"<",
"Context",
">",
"<",
"Content",
"/>",
"<",
"/Context>);",
"}",
";",
"const",
"Context",
"=",
"(",
"{",
"children",
"}",
")",
"=>",
"{",
"const",
"network",
"=",
"WalletAdapterNetwork",
".",
"Devnet",
";",
"const",
"endpoint",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"clusterApiUrl",
"(",
"network",
")",
",",
"[",
"network",
"]",
")",
";",
"const",
"wallets",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"[",
"new",
"PhantomWalletAdapter",
"(",
")",
",",
"new",
"SlopeWalletAdapter",
"(",
")",
",",
"new",
"SolflareWalletAdapter",
"(",
")",
",",
"new",
"TorusWalletAdapter",
"(",
")",
",",
"new",
"LedgerWalletAdapter",
"(",
")",
",",
"new",
"SolletWalletAdapter",
"(",
"{",
"network",
"}",
")",
",",
"new",
"SolletExtensionWalletAdapter",
"(",
"{",
"network",
"}",
")",
",",
"]",
",",
"[",
"network",
"]",
")",
";",
"return",
"(",
"<",
"ConnectionProvider",
"endpoint",
"=",
"{",
"endpoint",
"}",
">",
"<",
"WalletProvider",
"wallets",
"=",
"{",
"wallets",
"}",
"autoConnect",
">",
"<",
"WalletModalProvider",
">",
"{",
"children",
"}",
"<",
"/WalletModalProvider>",
"<",
"/WalletProvider>",
"<",
"/ConnectionProvider>);",
"}",
";",
"const",
"Content",
"=",
"(",
")",
"=>",
"{",
"return",
"<",
"WalletMultiButton",
"/>;",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
45,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
45,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
45,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661694 | [
"import",
"{",
"ApplicationNameValidator",
"}",
"from",
"'@spinnaker/core'",
";",
"class",
"CloudFoundryApplicationNameValidator",
"{",
"private",
"static",
"MAX_RESOURCE_NAME_LENGTH",
"=",
"63",
";",
"private",
"static",
"validateSpecialCharacters",
"(",
"name",
",",
"_warnings",
",",
"errors",
")",
"{",
"const",
"alphanumPattern",
"=",
"/^([a-zA-Z][a-zA-Z0-9]*)?$/",
";",
"if",
"(",
"!",
"alphanumPattern",
".",
"test",
"(",
"name",
")",
")",
"{",
"const",
"alphanumWithDashPattern",
"=",
"/^([a-zA-Z][a-zA-Z0-9-]*)?$/",
";",
"if",
"(",
"!",
"alphanumWithDashPattern",
".",
"test",
"(",
"name",
")",
")",
"{",
"errors",
".",
"push",
"(",
"'The application name must begin with a letter and must contain only letters, digits or dashes. '",
"+",
"'No special characters are allowed.'",
")",
";",
"}",
"}",
"}",
"private",
"static",
"validateLength",
"(",
"name",
",",
"errors",
")",
"{",
"if",
"(",
"name",
".",
"length",
">",
"CloudFoundryApplicationNameValidator",
".",
"MAX_RESOURCE_NAME_LENGTH",
")",
"{",
"errors",
".",
"push",
"(",
"`The maximum length for an application in Cloud Foundry is ${",
"CloudFoundryApplicationNameValidator",
".",
"MAX_RESOURCE_NAME_LENGTH",
"} characters.`",
")",
";",
"}",
"}",
"public",
"validate",
"(",
"name",
"=",
"''",
")",
"{",
"const",
"warnings",
"=",
"[",
"]",
";",
"const",
"errors",
"=",
"[",
"]",
";",
"if",
"(",
"name",
"&&",
"name",
".",
"length",
")",
"{",
"CloudFoundryApplicationNameValidator",
".",
"validateSpecialCharacters",
"(",
"name",
",",
"warnings",
",",
"errors",
")",
";",
"CloudFoundryApplicationNameValidator",
".",
"validateLength",
"(",
"name",
",",
"errors",
")",
";",
"}",
"return",
"{",
"warnings",
",",
"errors",
",",
"}",
";",
"}",
"}",
"ApplicationNameValidator",
".",
"registerValidator",
"(",
"'cloudfoundry'",
",",
"new",
"CloudFoundryApplicationNameValidator",
"(",
")",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
2,
null,
5,
null,
5,
null,
null,
null,
27,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
27,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
2,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
2,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661695 | [
"import",
"{",
"HelpContentsRegistry",
"}",
"from",
"'@spinnaker/core'",
";",
"const",
"helpContents",
"=",
"{",
"'cf.service.deploy.timeout'",
":",
"'(Optional) <b>Override Deploy Timeout</b> is the maximum amount of time allowed for service deployment before Spinnaker reports a timeout error (default: 450 seconds). If a timeout error is reported by Spinnaker, the request may still be processed and a service may still be created.'",
",",
"'cf.service.destroy.timeout'",
":",
"'(Optional) <b>Override Destroy Timeout</b> is the maximum amount of time allowed for service destruction before Spinnaker reports a timeout error (default: 450 seconds). If a timeout error is reported by Spinnaker, the request may still be processed and the service may be deleted.'",
",",
"'cf.serverGroup.stack'",
":",
"'(Optional) <b>Stack</b> is one of the core naming components of a cluster, used to create vertical stacks of dependent services for integration testing.'",
",",
"'cf.serverGroup.detail'",
":",
"'(Optional) <b>Detail</b> is a string of free-form alphanumeric characters and hyphens to describe any other variables.'",
",",
"'cf.serverGroup.startApplication'",
":",
"'<b>Start on creation</b> is a boolean value that determines if the server group is started upon creation. Default value is <code>true</code>.'",
",",
"'cf.serverGroup.requiredRoutes'",
":",
"'<b>Route</b> is a URI in the form of <code>some.host.some.domain[:9999][/some/path]</code> (port and path are optional). The domain has to be a valid domain in the CloudFoundry Org (Region) that this server group runs in.'",
",",
"'cf.serverGroup.routes'",
":",
"'(Optional) <b>Route</b> is a URI in the form of <code>some.host.some.domain[:9999][/some/path]</code> (port and path are optional). The domain has to be a valid domain in the CloudFoundry Org (Region) that this server group runs in.'",
",",
"'cf.artifact.package'",
":",
"`<p>This option allows you to create a new server group from an existing Droplet. You can use this to relocate an existing Cloud Foundry application from one space to another or to launch a clone of an application with different root filesystem or resource settings.</p>`",
",",
"'cf.artifact.trigger.account'",
":",
"`<p>Specify an artifact account if the trigger source produces an artifact that requires authentication credentials to retrieve. Otherwise, leave blank.</p>`",
",",
"'cf.runJob.logsUrl'",
":",
"'<p>(Optional) A templated URL to an external logging system. The URL is used in the pipeline execution stage task details.</p>'",
"+",
"'<p><a href=\"http://spinnaker.github.io/guides/user/pipeline-expressions\" target=\"_blank\">Pipeline expressions</a> can be used to interpolate values from the stage context, for example:'",
"+",
"'<ul>'",
"+",
"'<li><code>${appGuid}</code> the selected cluster CF app GUID.</li>'",
"+",
"'<li><code>${name}</code> the task name.</li>'",
"+",
"'</ul>'",
"+",
"'</p>'",
",",
"'cf.runJob.jobName'",
":",
"'(Optional) If left empty, a random string will be generated.'",
",",
"}",
";",
"Object",
".",
"keys",
"(",
"helpContents",
")",
".",
"forEach",
"(",
"(",
"key",
")",
"=>",
"HelpContentsRegistry",
".",
"register",
"(",
"key",
",",
"helpContents",
"[",
"key",
"]",
")",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661696 | [
"import",
"{",
"cloneDeep",
"}",
"from",
"'lodash'",
";",
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"Dropdown",
"}",
"from",
"'react-bootstrap'",
";",
"import",
"type",
"{",
"Application",
"}",
"from",
"'@spinnaker/core'",
";",
"import",
"{",
"ConfirmationModalService",
",",
"InstanceWriter",
",",
"ReactInjector",
"}",
"from",
"'@spinnaker/core'",
";",
"import",
"type",
"{",
"ICloudFoundryInstance",
"}",
"from",
"'../../domain'",
";",
"export",
"interface",
"ICloudFoundryInstanceActionsProps",
"{",
"application",
":",
"Application",
";",
"instance",
":",
"ICloudFoundryInstance",
";",
"}",
"export",
"class",
"CloudFoundryInstanceActions",
"extends",
"React",
".",
"Component",
"<",
"ICloudFoundryInstanceActionsProps",
">",
"{",
"private",
"terminateInstance",
"=",
"(",
")",
"=>",
"{",
"const",
"{",
"application",
",",
"instance",
"}",
"=",
"this",
".",
"props",
";",
"const",
"instanceClone",
"=",
"cloneDeep",
"(",
"instance",
")",
"as",
"any",
";",
"instanceClone",
".",
"placement",
"=",
"{",
"}",
";",
"instanceClone",
".",
"id",
"=",
"instance",
".",
"name",
";",
"const",
"taskMonitor",
"=",
"{",
"application",
":",
"application",
",",
"title",
":",
"'Terminating '",
"+",
"instance",
".",
"name",
",",
"onTaskComplete",
"(",
")",
"{",
"if",
"(",
"ReactInjector",
".",
"$state",
".",
"includes",
"(",
"'**.serverGroup'",
",",
"{",
"instanceId",
":",
"instance",
".",
"name",
"}",
")",
")",
"{",
"ReactInjector",
".",
"$state",
".",
"go",
"(",
"'^'",
")",
";",
"}",
"}",
",",
"}",
";",
"const",
"submitMethod",
"=",
"(",
")",
"=>",
"{",
"return",
"InstanceWriter",
".",
"terminateInstance",
"(",
"instance",
",",
"application",
",",
"{",
"cloudProvider",
":",
"'cloudfoundry'",
"}",
")",
";",
"}",
";",
"ConfirmationModalService",
".",
"confirm",
"(",
"{",
"header",
":",
"'Really terminate '",
"+",
"instance",
".",
"name",
"+",
"'?'",
",",
"buttonText",
":",
"'Terminate'",
",",
"account",
":",
"instance",
".",
"account",
",",
"taskMonitorConfig",
":",
"taskMonitor",
",",
"submitMethod",
",",
"}",
")",
";",
"}",
";",
"public",
"render",
"(",
")",
"{",
"return",
"(",
"<",
"div",
"className",
"=",
"\"actions\"",
">",
"<",
"Dropdown",
"className",
"=",
"\"dropdown\"",
"id",
"=",
"\"instance-actions-dropdown\"",
">",
"<",
"Dropdown",
".",
"Toggle",
"className",
"=",
"\"btn btn-sm btn-primary dropdown-toggle\"",
">",
"Instance",
"Actions",
"<",
"/Dropdown.Toggle>",
"<",
"Dropdown",
".",
"Menu",
"className",
"=",
"\"dropdown-menu\"",
">",
"<",
"li",
">",
"<",
"a",
"className",
"=",
"\"clickable\"",
"onClick",
"=",
"{",
"this",
".",
"terminateInstance",
"}",
">",
"Terminate",
"<",
"/a>",
"<",
"/li>",
"<",
"/Dropdown.Menu>",
"<",
"/Dropdown>",
"<",
"/div>);",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
580,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
61,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661697 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"AccountTag",
",",
"CollapsibleSection",
",",
"timestamp",
"}",
"from",
"'@spinnaker/core'",
";",
"import",
"type",
"{",
"ICloudFoundryInstance",
"}",
"from",
"'../../../domain'",
";",
"export",
"interface",
"ICloudFoundryInstanceDetailsSectionProps",
"{",
"instance",
":",
"ICloudFoundryInstance",
";",
"}",
"export",
"class",
"CloudFoundryInstanceDetailsSection",
"extends",
"React",
".",
"Component",
"<",
"ICloudFoundryInstanceDetailsSectionProps",
">",
"{",
"constructor",
"(",
"props",
")",
"{",
"super",
"(",
"props",
")",
";",
"}",
"public",
"render",
"(",
")",
"{",
"const",
"{",
"instance",
"}",
"=",
"this",
".",
"props",
";",
"return",
"(",
"<",
"div",
">",
"<",
"CollapsibleSection",
"heading",
"=",
"\"Instance Information\"",
"defaultExpanded",
"=",
"{",
"true",
"}",
">",
"<",
"dl",
"className",
"=",
"\"dl-horizontal dl-narrow\"",
">",
"<",
"dt",
">",
"Launched",
"<",
"/dt>",
"<",
"dd",
">",
"{",
"timestamp",
"(",
"instance",
".",
"launchTime",
")",
"}",
"<",
"/dd>",
"<",
"dt",
">",
"In",
"<",
"/dt>",
"<",
"dd",
">",
"<",
"AccountTag",
"account",
"=",
"{",
"instance",
".",
"account",
"}",
"/>",
"<",
"/dd>",
"<",
"dt",
">",
"Region",
"<",
"/dt>",
"<",
"dd",
">",
"{",
"instance",
".",
"region",
"}",
"<",
"/dd>",
"<",
"/dl>",
"<",
"/CollapsibleSection>",
"<",
"CollapsibleSection",
"heading",
"=",
"\"Status\"",
"defaultExpanded",
"=",
"{",
"true",
"}",
">",
"<",
"dl",
"className",
"=",
"\"dl-horizontal dl-narrow\"",
">",
"<",
"dt",
">",
"<",
"span",
"className",
"=",
"{",
"'glyphicon glyphicon-'",
"+",
"instance",
".",
"healthState",
"+",
"'-triangle'",
"}",
"/>",
"<",
"/dt>",
"<",
"dd",
">",
"{",
"instance",
".",
"healthState",
"}",
"<",
"/dd>",
"{",
"instance",
".",
"details",
"&&",
"(",
"<",
"div",
">",
"<",
"dt",
">",
"Details",
"<",
"/dt>",
"<",
"dd",
">",
"{",
"instance",
".",
"details",
"}",
"<",
"/dd>",
"<",
"/div>)}",
"<",
"/dl>",
"<",
"/CollapsibleSection>",
"<",
"/div>);",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
61,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661698 | [
"import",
"{",
"UISref",
"}",
"from",
"'@uirouter/react'",
";",
"import",
"{",
"UIRouterContext",
"}",
"from",
"'@uirouter/react-hybrid'",
";",
"import",
"{",
"flattenDeep",
"}",
"from",
"'lodash'",
";",
"import",
"React",
"from",
"'react'",
";",
"import",
"type",
"{",
"Application",
",",
"ILoadBalancer",
"}",
"from",
"'@spinnaker/core'",
";",
"import",
"{",
"InstanceReader",
",",
"RecentHistoryService",
",",
"Spinner",
"}",
"from",
"'@spinnaker/core'",
";",
"import",
"{",
"CloudFoundryInstanceActions",
"}",
"from",
"'./CloudFoundryInstanceActions'",
";",
"import",
"type",
"{",
"ICloudFoundryInstance",
"}",
"from",
"'../../domain'",
";",
"import",
"{",
"CloudFoundryInstanceDetailsSection",
"}",
"from",
"'./sections'",
";",
"interface",
"InstanceFromStateParams",
"{",
"instanceId",
":",
"string",
";",
"}",
"interface",
"InstanceManager",
"{",
"account",
":",
"string",
";",
"region",
":",
"string",
";",
"category",
":",
"string",
";",
"name",
":",
"string",
";",
"instances",
":",
"ICloudFoundryInstance",
"[",
"]",
";",
"}",
"interface",
"ICloudFoundryInstanceDetailsState",
"{",
"instance",
"?",
":",
"ICloudFoundryInstance",
";",
"instanceIdNotFound",
":",
"string",
";",
"loading",
":",
"boolean",
";",
"}",
"interface",
"ICloudFoundryInstanceDetailsProps",
"{",
"app",
":",
"Application",
";",
"instance",
":",
"InstanceFromStateParams",
";",
"loading",
":",
"boolean",
";",
"}",
"@",
"UIRouterContext",
"export",
"class",
"CloudFoundryInstanceDetails",
"extends",
"React",
".",
"Component",
"<",
"ICloudFoundryInstanceDetailsProps",
",",
"ICloudFoundryInstanceDetailsState",
">",
"{",
"constructor",
"(",
"props",
")",
"{",
"super",
"(",
"props",
")",
";",
"this",
".",
"state",
"=",
"{",
"loading",
":",
"true",
",",
"instanceIdNotFound",
":",
"props",
".",
"instance",
".",
"instanceId",
",",
"}",
";",
"}",
"public",
"componentDidMount",
"(",
")",
"{",
"this",
".",
"props",
".",
"app",
".",
"ready",
"(",
")",
".",
"then",
"(",
"(",
")",
"=>",
"this",
".",
"retrieveInstance",
"(",
"this",
".",
"props",
".",
"instance",
")",
")",
";",
"}",
"private",
"retrieveInstance",
"(",
"instanceFromParams",
")",
"{",
"const",
"instanceLocatorPredicate",
"=",
"(",
"dataSource",
")",
"=>",
"{",
"return",
"dataSource",
".",
"instances",
".",
"some",
"(",
"(",
"possibleMatch",
")",
"=>",
"possibleMatch",
".",
"id",
"===",
"instanceFromParams",
".",
"instanceId",
")",
";",
"}",
";",
"const",
"dataSources",
"=",
"flattenDeep",
"(",
"[",
"this",
".",
"props",
".",
"app",
".",
"getDataSource",
"(",
"'serverGroups'",
")",
".",
"data",
",",
"this",
".",
"props",
".",
"app",
".",
"getDataSource",
"(",
"'loadBalancers'",
")",
".",
"data",
",",
"this",
".",
"props",
".",
"app",
".",
"getDataSource",
"(",
"'loadBalancers'",
")",
".",
"data",
".",
"map",
"(",
"(",
"loadBalancer",
")",
"=>",
"loadBalancer",
".",
"serverGroups",
")",
",",
"]",
")",
";",
"const",
"instanceManager",
"=",
"dataSources",
".",
"find",
"(",
"instanceLocatorPredicate",
")",
";",
"if",
"(",
"instanceManager",
")",
"{",
"const",
"recentHistoryExtraData",
"=",
"{",
"region",
":",
"instanceManager",
".",
"region",
",",
"account",
":",
"instanceManager",
".",
"account",
",",
"}",
";",
"if",
"(",
"instanceManager",
".",
"category",
"===",
"'serverGroup'",
")",
"{",
"recentHistoryExtraData",
".",
"serverGroup",
"=",
"instanceManager",
".",
"name",
";",
"}",
"RecentHistoryService",
".",
"addExtraDataToLatest",
"(",
"'instances'",
",",
"recentHistoryExtraData",
")",
";",
"InstanceReader",
".",
"getInstanceDetails",
"(",
"instanceManager",
".",
"account",
",",
"instanceManager",
".",
"region",
",",
"instanceFromParams",
".",
"instanceId",
")",
".",
"then",
"(",
"(",
"instanceDetails",
")",
"=>",
"{",
"instanceDetails",
".",
"account",
"=",
"instanceManager",
".",
"account",
";",
"instanceDetails",
".",
"region",
"=",
"instanceManager",
".",
"region",
";",
"return",
"instanceDetails",
";",
"}",
")",
".",
"then",
"(",
"(",
"instance",
")",
"=>",
"{",
"this",
".",
"setState",
"(",
"{",
"instance",
",",
"loading",
":",
"false",
",",
"}",
")",
";",
"}",
")",
";",
"}",
"}",
"public",
"render",
"(",
")",
"{",
"const",
"{",
"app",
"}",
"=",
"this",
".",
"props",
";",
"const",
"{",
"instance",
",",
"instanceIdNotFound",
",",
"loading",
"}",
"=",
"this",
".",
"state",
";",
"const",
"CloseButton",
"=",
"(",
"<",
"div",
"className",
"=",
"\"close-button\"",
">",
"<",
"UISref",
"to",
"=",
"\"^\"",
">",
"<",
"span",
"className",
"=",
"\"glyphicon glyphicon-remove\"",
"/",
">",
"<",
"/UISref>",
"<",
"/div>);",
"const",
"loadingHeader",
"=",
"(",
")",
"=>",
"(",
"<",
"div",
"className",
"=",
"\"header\"",
">",
"{",
"CloseButton",
"}",
"<",
"div",
"className",
"=",
"\"horizontal center middle\"",
">",
"<",
"Spinner",
"size",
"=",
"\"small\"",
"/",
">",
"<",
"/div>",
"<",
"/div>);",
"const",
"notFoundHeader",
"=",
"(",
")",
"=>",
"(",
"<",
"div",
"className",
"=",
"\"header\"",
">",
"{",
"CloseButton",
"}",
"<",
"div",
"className",
"=",
"\"header-text horizontal middle\"",
">",
"<",
"h3",
"className",
"=",
"\"horizontal middle space-between flex-1\"",
">",
"{",
"instanceIdNotFound",
"}",
"<",
"/h3>",
"<",
"/div>",
"<",
"/div>);",
"const",
"instanceHeader",
"=",
"(",
")",
"=>",
"(",
"<",
"div",
"className",
"=",
"\"header\"",
">",
"{",
"CloseButton",
"}",
"<",
"div",
"className",
"=",
"\"header-text horizontal middle\"",
">",
"<",
"span",
"className",
"=",
"{",
"'glyphicon glyphicon-hdd '",
"+",
"instance",
".",
"healthState",
"}",
"/>",
"<",
"h3",
"className",
"=",
"\"horizontal middle space-between flex-1\"",
">",
"{",
"instance",
".",
"name",
"}",
"<",
"/h3>",
"<",
"/div>",
"<",
"CloudFoundryInstanceActions",
"application",
"=",
"{",
"app",
"}",
"instance",
"=",
"{",
"instance",
"}",
"/",
">",
"<",
"/div>);",
"const",
"notFoundContent",
"=",
"(",
")",
"=>",
"(",
"<",
"div",
"className",
"=",
"\"content\"",
">",
"<",
"div",
"className",
"=",
"\"content-section\"",
">",
"<",
"div",
"className",
"=",
"\"content-body text-center\"",
">",
"<",
"h3",
">",
"Instance",
"not",
"found",
".",
"<",
"/h3>",
"<",
"/div>",
"<",
"/div>",
"<",
"/div>);",
"const",
"instanceContent",
"=",
"(",
")",
"=>",
"(",
"<",
"div",
"className",
"=",
"\"content\"",
">",
"<",
"CloudFoundryInstanceDetailsSection",
"instance",
"=",
"{",
"instance",
"}",
"/>",
"<",
"/div>);",
"return",
"(",
"<",
"div",
"className",
"=",
"\"details-panel\"",
">",
"{",
"loading",
"&&",
"loadingHeader",
"(",
")",
"}",
"{",
"!",
"loading",
"&&",
"instance",
"&&",
"instanceHeader",
"(",
")",
"}",
"{",
"!",
"loading",
"&&",
"instance",
"&&",
"instanceContent",
"(",
")",
"}",
"{",
"!",
"loading",
"&&",
"!",
"instance",
"&&",
"notFoundHeader",
"(",
")",
"}",
"{",
"!",
"loading",
"&&",
"!",
"instance",
"&&",
"notFoundContent",
"(",
")",
"}",
"<",
"/div>);",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
0,
null,
null,
null,
8,
null,
null,
17594,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
28643,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
17594,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
61,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
9,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
9,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661699 | [
"import",
"{",
"camelCase",
",",
"chain",
",",
"cloneDeep",
",",
"has",
"}",
"from",
"'lodash'",
";",
"import",
"type",
"{",
"Application",
",",
"IInstance",
",",
"IInstanceCounts",
",",
"ILoadBalancer",
",",
"ILoadBalancerUpsertCommand",
",",
"IServerGroup",
",",
"}",
"from",
"'@spinnaker/core'",
";",
"import",
"type",
"{",
"ICloudFoundryLoadBalancer",
",",
"ICloudFoundryLoadBalancerUpsertCommand",
",",
"ICloudFoundryServerGroup",
",",
"ICloudFoundrySpace",
",",
"}",
"from",
"'../domain'",
";",
"export",
"class",
"CloudFoundryLoadBalancerUpsertDescription",
"implements",
"ILoadBalancerUpsertCommand",
",",
"ICloudFoundryLoadBalancer",
"{",
"public",
"id",
":",
"string",
";",
"public",
"credentials",
":",
"string",
";",
"public",
"account",
":",
"string",
";",
"public",
"loadBalancerName",
":",
"string",
";",
"public",
"name",
":",
"string",
";",
"public",
"region",
":",
"string",
";",
"public",
"cloudProvider",
":",
"string",
";",
"public",
"serverGroups",
":",
"ICloudFoundryServerGroup",
"[",
"]",
";",
"public",
"space",
":",
"ICloudFoundrySpace",
";",
"constructor",
"(",
"loadBalancer",
")",
"{",
"this",
".",
"id",
"=",
"loadBalancer",
".",
"id",
";",
"this",
".",
"credentials",
"=",
"loadBalancer",
".",
"account",
";",
"this",
".",
"account",
"=",
"this",
".",
"credentials",
";",
"this",
".",
"cloudProvider",
"=",
"loadBalancer",
".",
"cloudProvider",
";",
"this",
".",
"loadBalancerName",
"=",
"loadBalancer",
".",
"name",
";",
"this",
".",
"name",
"=",
"loadBalancer",
".",
"name",
";",
"this",
".",
"region",
"=",
"loadBalancer",
".",
"region",
";",
"this",
".",
"serverGroups",
"=",
"loadBalancer",
".",
"serverGroups",
";",
"this",
".",
"space",
"=",
"loadBalancer",
".",
"space",
";",
"}",
"}",
"export",
"class",
"CloudFoundryLoadBalancerTransformer",
"{",
"public",
"static",
"$inject",
"=",
"[",
"'$q'",
"]",
";",
"constructor",
"(",
"private",
"$q",
")",
"{",
"}",
"public",
"normalizeLoadBalancer",
"(",
"loadBalancer",
")",
"{",
"loadBalancer",
".",
"provider",
"=",
"loadBalancer",
".",
"type",
";",
"loadBalancer",
".",
"instanceCounts",
"=",
"this",
".",
"buildInstanceCounts",
"(",
"loadBalancer",
".",
"serverGroups",
")",
";",
"loadBalancer",
".",
"instances",
"=",
"[",
"]",
";",
"loadBalancer",
".",
"serverGroups",
".",
"forEach",
"(",
"(",
"serverGroup",
")",
"=>",
"{",
"serverGroup",
".",
"account",
"=",
"loadBalancer",
".",
"account",
";",
"serverGroup",
".",
"region",
"=",
"loadBalancer",
".",
"region",
";",
"serverGroup",
".",
"cloudProvider",
"=",
"loadBalancer",
".",
"provider",
";",
"if",
"(",
"serverGroup",
".",
"detachedInstances",
")",
"{",
"serverGroup",
".",
"detachedInstances",
"=",
"(",
"serverGroup",
".",
"detachedInstances",
"as",
"any",
")",
".",
"map",
"(",
"(",
"id",
")",
"=>",
"(",
"{",
"id",
"}",
")",
")",
";",
"}",
"serverGroup",
".",
"instances",
"=",
"serverGroup",
".",
"instances",
".",
"concat",
"(",
"serverGroup",
".",
"detachedInstances",
"||",
"[",
"]",
")",
".",
"map",
"(",
"(",
"instance",
")",
"=>",
"this",
".",
"transformInstance",
"(",
"instance",
",",
"loadBalancer",
")",
")",
";",
"}",
")",
";",
"const",
"activeServerGroups",
"=",
"loadBalancer",
".",
"serverGroups",
".",
"filter",
"(",
"(",
"sg",
")",
"=>",
"!",
"sg",
".",
"isDisabled",
")",
";",
"loadBalancer",
".",
"instances",
"=",
"chain",
"(",
"activeServerGroups",
")",
".",
"map",
"(",
"'instances'",
")",
".",
"flatten",
"(",
")",
".",
"value",
"(",
")",
"as",
"IInstance",
"[",
"]",
";",
"return",
"this",
".",
"$q",
".",
"resolve",
"(",
"loadBalancer",
")",
";",
"}",
"public",
"constructNewCloudFoundryLoadBalancerTemplate",
"(",
"application",
")",
"{",
"return",
"{",
"cloudProvider",
":",
"'cloudfoundry'",
",",
"credentials",
":",
"undefined",
",",
"name",
":",
"application",
".",
"name",
",",
"id",
":",
"undefined",
",",
"host",
":",
"''",
",",
"path",
":",
"''",
",",
"port",
":",
"''",
",",
"region",
":",
"''",
",",
"domain",
":",
"''",
",",
"serverGroups",
":",
"[",
"]",
",",
"routes",
":",
"[",
"]",
",",
"}",
";",
"}",
"public",
"convertLoadBalancerForEditing",
"(",
"loadBalancer",
",",
"application",
")",
"{",
"return",
"application",
".",
"getDataSource",
"(",
"'loadBalancers'",
")",
".",
"ready",
"(",
")",
".",
"then",
"(",
"(",
")",
"=>",
"{",
"const",
"upToDateLoadBalancer",
"=",
"application",
".",
"getDataSource",
"(",
"'loadBalancers'",
")",
".",
"data",
".",
"find",
"(",
"(",
"candidate",
")",
"=>",
"{",
"return",
"candidate",
".",
"name",
"===",
"loadBalancer",
".",
"name",
"&&",
"candidate",
".",
"account",
"===",
"loadBalancer",
".",
"account",
";",
"}",
")",
";",
"if",
"(",
"upToDateLoadBalancer",
")",
"{",
"loadBalancer",
".",
"serverGroups",
"=",
"cloneDeep",
"(",
"upToDateLoadBalancer",
".",
"serverGroups",
")",
";",
"}",
"return",
"loadBalancer",
";",
"}",
")",
";",
"}",
"public",
"convertLoadBalancerToUpsertDescription",
"(",
"loadBalancer",
")",
"{",
"return",
"new",
"CloudFoundryLoadBalancerUpsertDescription",
"(",
"loadBalancer",
")",
";",
"}",
"private",
"buildInstanceCounts",
"(",
"serverGroups",
")",
"{",
"const",
"instanceCounts",
"=",
"chain",
"(",
"serverGroups",
")",
".",
"map",
"(",
"'instances'",
")",
".",
"flatten",
"(",
")",
".",
"reduce",
"(",
"(",
"acc",
",",
"instance",
")",
"=>",
"{",
"if",
"(",
"has",
"(",
"instance",
",",
"'health.state'",
")",
")",
"{",
"acc",
"[",
"camelCase",
"(",
"instance",
".",
"health",
".",
"state",
")",
"]",
"++",
";",
"}",
"return",
"acc",
";",
"}",
",",
"{",
"up",
":",
"0",
",",
"down",
":",
"0",
",",
"outOfService",
":",
"0",
",",
"succeeded",
":",
"0",
",",
"failed",
":",
"0",
",",
"starting",
":",
"0",
",",
"unknown",
":",
"0",
"}",
")",
".",
"value",
"(",
")",
";",
"instanceCounts",
".",
"outOfService",
"+=",
"chain",
"(",
"serverGroups",
")",
".",
"map",
"(",
"'detachedInstances'",
")",
".",
"flatten",
"(",
")",
".",
"value",
"(",
")",
".",
"length",
";",
"return",
"instanceCounts",
";",
"}",
"private",
"transformInstance",
"(",
"instance",
",",
"loadBalancer",
")",
"{",
"instance",
".",
"provider",
"=",
"loadBalancer",
".",
"type",
";",
"instance",
".",
"account",
"=",
"loadBalancer",
".",
"account",
";",
"instance",
".",
"region",
"=",
"loadBalancer",
".",
"region",
";",
"instance",
".",
"loadBalancers",
"=",
"[",
"loadBalancer",
".",
"name",
"]",
";",
"const",
"health",
"=",
"instance",
".",
"health",
"||",
"{",
"}",
";",
"instance",
".",
"healthState",
"=",
"health",
".",
"state",
"??",
"'OutOfService'",
";",
"instance",
".",
"health",
"=",
"[",
"health",
"]",
";",
"return",
"instance",
"as",
"IInstance",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4289,
null,
null,
null,
null,
580,
null,
28643,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
9812,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
9812,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
261,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
580,
null,
0,
null,
261,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
28643,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
5,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
12007,
null,
null,
null,
28643,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |