@infinilabs/discover 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/dist/{components-BmTCvhGp.js → components-DSRtWY6B.js} +453 -358
  2. package/dist/{components-CGMQn0Mj.cjs → components-DU1i9Sqo.cjs} +12 -11
  3. package/dist/index.cjs +2 -2
  4. package/dist/index.js +4 -4
  5. package/dist/{public-Cdno3IKX.cjs → public-DCX8wskE.cjs} +2 -2
  6. package/dist/{public-vmbkVRQr.js → public-fqndEQhV.js} +5 -5
  7. package/dist/{query_bar_top_row-D3_tlWZ5.cjs → query_bar_top_row-5bYOsA5A.cjs} +1 -1
  8. package/dist/{query_bar_top_row-B3hFhCfq.js → query_bar_top_row-CRzBdGrJ.js} +5 -5
  9. package/dist/{query_bar_top_row-DuN1WQwc.js → query_bar_top_row-Cxo6eiiB.js} +21 -22
  10. package/dist/{query_bar_top_row-BP096mR-.cjs → query_bar_top_row-Drb6cAPD.cjs} +1 -1
  11. package/dist/{query_string_input-D5pS8zXB.js → query_string_input-BCsWs2Nw.js} +13 -13
  12. package/dist/{query_string_input-oS6LSIhN.js → query_string_input-BciZ5jdF.js} +3 -3
  13. package/dist/{query_string_input-BZyOdRtw.cjs → query_string_input-Bx2AC6z3.cjs} +1 -1
  14. package/dist/query_string_input-CdnNWOlD.cjs +1 -0
  15. package/dist/{search_bar-CdVb0ff9.cjs → search_bar-Dd8JSROc.cjs} +1 -1
  16. package/dist/{search_bar-Dh5o3kq4.js → search_bar-vwintw9g.js} +36 -48
  17. package/dist/{shard_failure_open_modal_button-B1bDjIGP.cjs → shard_failure_open_modal_button-Dm6xzoJU.cjs} +1 -1
  18. package/dist/{shard_failure_open_modal_button-3Fgne-kW.js → shard_failure_open_modal_button-ziUHpSxf.js} +1 -1
  19. package/dist/src/components/ResultHeader/index.d.ts +3 -0
  20. package/dist/src/components/index.d.ts +8 -1
  21. package/package.json +1 -1
  22. package/dist/query_string_input-DjGCjx3D.cjs +0 -1
  23. /package/dist/{services-Hp7HR5A8.js → services-C8UxrSbr.js} +0 -0
  24. /package/dist/{services-CDXxluYi.cjs → services-CODauXxU.cjs} +0 -0
@@ -1,15 +1,14 @@
1
1
  import { o as __toESM, r as __export, t as __commonJSMin } from "./chunk-D-4zIDrl.js";
2
- import { a as createHashHistory, c as require_object_assign, d as FieldIcon, i as setIndexPatterns$1, l as require_url, o as _extends, t as getIndexPatterns, u as FieldButton } from "./services-Hp7HR5A8.js";
3
- import { C as BehaviorSubject, T as operate, _ as onRedirectNoIndexPattern, b as FilterManager, d as baseFormattersPublic, f as getTimezone, g as onUnsupportedTimePattern, h as IndexPatternsApiClient, l as generateFilters, m as SavedObjectsClientPublicToCommon, n as search, p as deserializeFieldFormat, u as createSearchBar, v as TimeHistory, w as createOperatorSubscriber, x as AutocompleteService, y as Timefilter } from "./public-vmbkVRQr.js";
2
+ import { C as BehaviorSubject, E as Subscription, T as operate, _ as onRedirectNoIndexPattern, b as FilterManager, d as baseFormattersPublic, f as getTimezone, g as onUnsupportedTimePattern, h as IndexPatternsApiClient, l as generateFilters, m as SavedObjectsClientPublicToCommon, n as search, p as deserializeFieldFormat, u as createSearchBar, v as TimeHistory, w as createOperatorSubscriber, x as AutocompleteService, y as Timefilter } from "./public-fqndEQhV.js";
3
+ import { a as createHashHistory, c as require_object_assign, d as FieldIcon, i as setIndexPatterns$1, l as require_url, o as _extends, t as getIndexPatterns, u as FieldButton } from "./services-C8UxrSbr.js";
4
4
  import { t as require_classnames } from "./classnames-BCXlvRQ0.js";
5
5
  import { t as require_lodash } from "./lodash-Gv_ptthU.js";
6
6
  import { n as createGetterSetter } from "./common-1_7zA8Zc.js";
7
7
  import { C as intervalOptions$1, K as FilterStateStore, P as FieldFormatsRegistry, S as TimeBuckets, bt as init_moment, k as IndexPatternsService, xt as moment_default, yt as require_moment_timezone, z as buildEsQuery } from "./common-DdqCJH2k.js";
8
8
  import { $ as DEFAULT_FONT_FAMILY, $a as IEnvironmentService, $c as isLowerAsciiLetter, $i as listHighlightForeground, $l as illegalArgument, $n as mapObservableArrayCached, $o as registerEditorCommand, $r as LineTokens, $s as getDomNodePagePosition, $t as FindInput, A as observableCodeEditor, Aa as editorWarningBorder, Ac as disposableTimeout, Ai as renderLabelWithIcons, Al as URI, An as ActionBar, Ao as LRUCache, Ar as WORKSPACE_EXTENSION, As as ICodeEditorService, At as IStandaloneThemeService, Au as isObject, B as diffDeleteDecorationEmpty, Ba as foreground, Bc as commonSuffixLength, Bi as Widget, Bl as PauseableEmitter, Bn as IStorageService, Bo as ILanguageService, Br as EditOperation, Bs as ModifierKeyEmitter, Bt as HighlightedLabel, Bu as groupBy, C as EditorState, Ca as editorInlayHintForeground, Cc as AsyncIterableObject, Ci as fuzzyScoreGracefulAggressive, Cl as TokenizationRegistry, Cn as IMarkerDecorationsService, Co as UnicodeTextModelHighlighter, Cr as GoToLineNLS, Cs as ThemeIcon, Ct as RenderLineInput, Cu as deepClone, D as bindContextKey, Da as editorInlayHintTypeForeground, Dc as TimeoutTimer, Di as matchesWords, Dl as Selection, Dn as IMarkerService, Do as OverviewRulerLane, Dr as QuickOutlineNLS, Ds as toAction, Dt as AccessibilitySignal, Du as isDefined, E as DiffEditorWidget, Ea as editorInlayHintTypeBackground, Ec as RunOnceScheduler, Ei as matchesSubString, El as Codicon, En as IMarkerData, Eo as InjectedTextCursorStops, Er as QuickHelpNLS, Es as SubmenuAction, Et as registerEditorFeature, Eu as assertType, F as isHotReloadEnabled, Fa as overviewRulerSelectionHighlightForeground, Fc as StandardKeyboardEvent, Fi as HoverWidget, Fl as CancellationToken, Fn as defaultCountBadgeStyles, Fo as ILanguageConfigurationService, Fr as TernarySearchTree, Fs as PixelRatio, Ft as registerIcon, Fu as binarySearch, G as DisposableCancellationTokenSource, Ga as transparent, Gc as escapeRegExpCharacters, Gi as IContextMenuService, Gl as RefCountedDisposable, Gn as getBaseLayerHoverDelegate, Go as createTrustedTypesPolicy, Gr as status, Gs as append, Gt as WorkbenchTreeElementCanExpand, Gu as reverseOrder, H as diffLineDeleteDecorationBackgroundWithIndicator, Ha as asCssVariable, Hc as compareIgnoreCase, Hi as Gesture, Hl as Disposable, Hn as isLocalizedString, Ho as StringBuilder, Hr as IBulkEditService, Hs as addDisposableListener, Ht as WorkbenchAsyncDataTree, Hu as isNonEmptyArray, I as IDiffProviderFactoryService, Ia as widgetBorder, Ic as KeyCodeChord, Ii as KeyDownAction, Il as CancellationTokenSource, In as defaultInputBoxStyles, Io as PLAINTEXT_LANGUAGE_ID, Ir as IEditorProgressService, Is as $, It as widgetClose, Iu as coalesce, J as StableEditorScrollState, Ja as ISemanticTokensStylingService, Jc as getLeadingWhitespace, Ji as WorkbenchHoverDelegate, Jl as isDisposable, Jn as DataTransfers, Jo as EditorCommand, Jr as MarkdownRenderer, Js as createStyleSheet2, Jt as IsWindowsContext, K as appendRemoveOnDispose, Ka as score, Kc as firstNonWhitespaceIndex, Ki as IContextViewService, Kl as combinedDisposable, Kn as createInstantHoverDelegate, Ko as EditorAction, Kr as CONTEXT_ACCESSIBILITY_MODE_ENABLED, Ks as clearNode, Kt as InputFocusedContext, L as diffAddDecoration, La as widgetShadow, Lc as isFirefox, Li as getHoverAccessibleViewHint, Ll as cancelOnDispose, Ln as defaultListStyles, Lo as Extensions$1, Lr as IProgressService, Ls as Dimension, Lt as KeybindingLabel, Lu as compareBy, M as reactToChangeWithStore, Ma as editorWidgetBackground, Mc as raceCancellation, Mi as IOpenerService, Ml as dirname$1, Mn as TextOnlyMenuEntryActionViewItem, Mo as SetMap, Mr as isSingleFolderWorkspaceIdentifier, Ms as createDecorator, Mt as HC_LIGHT_THEME_NAME, Mu as isUndefined, N as WorkbenchToolBar, Na as editorWidgetBorder, Nc as timeout, Ni as ClickAction, Nl as sep, Nn as createActionViewItem, No as CharacterSet, Nr as isStandaloneEditorWorkspace, Ns as EditorZoom, Nt as VS_DARK_THEME_NAME, Nu as Permutation, O as observableConfigValue, Oa as editorSelectionBackground, Oc as createCancelableAsyncIterable, Oi as or, Ol as Range, On as MarkerSeverity, Oo as shouldSynchronizeModel, Or as ToggleHighContrastNLS, Os as ITextModelService, Ot as IAccessibilitySignalService, Ou as isFunction, P as readHotReloadableExport, Pa as overviewRulerFindMatchForeground, Pc as StandardMouseEvent, Pi as HoverAction, Pl as KeyChord, Pn as createAndFillInActionBarActions, Po as LcsDiff, Pr as toWorkspaceIdentifier, Ps as applyFontInfo, Pt as VS_LIGHT_THEME_NAME, Pu as asArray, Q as isModelDecorationVisible, Qa as ILanguageFeatureDebounceService, Qc as isLowSurrogate, Qi as listFocusHighlightForeground, Ql as CancellationError, Qn as derivedObservableWithCache, Qo as registerEditorAction, Qr as nullTokenizeEncoded, Qs as getComputedStyle, Qt as Sash, R as diffAddDecorationEmpty, Ra as activeContrastBorder, Rc as InvisibleCharacters, Ri as DomScrollableElement, Rl as Emitter, Rn as defaultToggleStyles, Ro as Mimes, Rr as Progress$1, Rs as EventHelper, Rt as unthemedKeybindingLabelOptions, Ru as distinct, S as isDiffEditor, Sa as editorInlayHintBackground, Sc as matchesSomeScheme, Si as fuzzyScore, Sl as SymbolKinds, Sn as CursorColumns, So as mapFindFirst, Sr as IWorkspaceTrustManagementService, Ss as ICommandService, St as TabFocus, Su as localize2, T as TextModelCancellationTokenSource, Ta as editorInlayHintParameterForeground, Tc as Delayer, Ti as matchesPrefix, Tl as isLocationLink, Tn as overviewRulerRangeHighlight, To as GlyphMarginLane, Tr as QuickCommandNLS, Ts as Separator, Tt as LineDecoration, Tu as assertIsDefined, U as diffWholeLineAddDecoration, Ua as oneOf, Uc as containsRTL, Ui as GlobalPointerMoveMonitor, Ul as DisposableStore, Un as ActionViewItem, Uo as VSBuffer, Ur as ResourceTextEdit, Us as addStandardDisposableGenericMouseDownListener, Ut as WorkbenchListFocusContextKey, Uu as numberComparator, V as diffLineAddDecorationBackgroundWithIndicator, Va as iconForeground, Vc as compare, Vi as EventType, Vl as StopWatch, Vn as WillSaveStateReason, Vo as IConfigurationService, Vr as editorConfigurationBaseNode, Vs as WindowIdleValue, Vt as IListService, Vu as isFalsyOrEmpty, W as diffWholeLineDeleteDecoration, Wa as registerColor, Wc as containsUppercaseCharacter, Wi as IKeybindingService, Wl as MutableDisposable, Wn as List, Wo as IndentAction, Wr as alert, Ws as addStandardDisposableListener, Wt as WorkbenchTreeElementCanCollapse, Wu as quickSelect, X as isModelDecorationInComment, Xa as countEOL, Xc as isFalsyOrWhitespace, Xi as quickInputListFocusForeground, Xl as createSingleCallFunction, Xn as waitForState, Xo as MultiCommand, Xr as NullState, Xs as getActiveElement, Xt as SplitView, Y as CodeEditorWidget, Ya as toMultilineTokens2, Yc as isBasicASCII, Yi as quickInputListFocusBackground, Yl as toDisposable, Yn as ObservablePromise, Yo as EditorExtensionsRegistry, Yr as openLinkFromMarkdown, Ys as getActiveDocument, Yt as Sizing, Z as isModelDecorationInString, Za as TokenMetadata, Zc as isHighSurrogate, Zi as quickInputListFocusIconForeground, Zl as BugIndicatingError, Zn as constObservable, Zo as MultiEditorAction, Zr as nullTokenize, Zs as getClientArea, Zt as OrthogonalEdge, _ as formatDocumentWithSelectedProvider, _a as editorForeground, _c as svgElem, _i as stripIcons, _l as InlineEditTriggerKind, _n as DenseKeyProvider, _o as TextLength, _r as transaction, _s as ContextKeyEqualsExpr, _t as ClipboardEventUtils, _u as isNative, a as MarkerSeverity$1, aa as inputForeground, ac as h, ai as isEmptyMarkdownString, al as stripWildcards, an as Button$1, ao as IThemeService, ar as autorunOpts, as as ITelemetryService, at as getIndentMetadata, au as EditorOptions, b as getCodeEditor, ba as editorInfoBorder, bc as Schemas, bi as anyScore, bl as SelectedSuggestionInfo, bn as lengthZero, bo as findFirstMax, br as itemsEquals, bs as RawContextKey, bt as getColumnOfNodeOffset, bu as language, c as Range$1, ca as editorActiveLinkForeground, cc as isAncestor, ci as basename, cl as mainWindow, cn as ItemActivation, co as isDark, cr as derivedDisposable, cs as MenuId, ct as ProcessedIndentRulesSupport, cu as unicodeHighlightConfigKeys, d as Token$1, da as editorErrorForeground, dc as reset, di as extUri, dl as DocumentHighlightKind, dn as ModelDecorationOptions, do as ITextResourceConfigurationService, dr as derivedWithSetter, ds as SubmenuItemAction, dt as WordPartOperations, du as Iterable, ea as inputActiveOptionBackground, ec as getShadowRoot, ei as getStandardTokenTypeAtPosition, el as isUpperAsciiLetter, en as HistoryInputBox, eo as clamp, er as observableFromEvent, es as registerEditorContribution, et as CoreEditingCommands, eu as isCancellationError, f as Uri, fa as editorFindMatchForeground, fc as runAtThisOrScheduleAtNextAnimationFrame, fi as extname, fl as DocumentPasteTriggerKind, fn as TextModel, fo as Color, fr as derivedWithStore, fs as isIMenuItem, ft as MoveOperations, fu as OS, g as formatDocumentRangesWithSelectedProvider, ga as editorFindRangeHighlightBorder, gc as size, gi as relativePath, gl as InlineCompletionTriggerKind, gn as TextBufferTokenizer, go as TextEdit, gr as subtransaction, gs as assertNever, gt as CursorState, gu as isMacintosh, h as languages, ha as editorFindMatchHighlightForeground, hc as show, hi as originalFSPath, hl as InlayHintKind, hn as LanguageAgnosticBracketTokens, ho as SingleTextEdit, hr as observableValue, hs as Registry, ht as ReplaceCommandThatSelectsText, hu as isLittleEndian, i as KeyMod, ia as inputBorder, ic as getWindow, ii as MarkdownString, il as splitLinesIncludeSeparators, in as CountBadge, io as severity_default, ir as autorun, is as ILogService, it as getGoodIndentForLine, iu as EditorFontLigatures, j as reactToChange, ja as editorWarningForeground, jc as first, ji as DomEmitter, jl as basename$1, jn as MenuEntryActionViewItem, jo as ResourceMap, jr as isEmptyWorkspaceIdentifier, js as IInstantiationService, jt as HC_BLACK_THEME_NAME, ju as isString, k as HideUnchangedRegionsFeature, ka as editorSelectionHighlight, kc as createCancelablePromise, ki as renderIcon, kl as Position$1, kn as IEditorWorkerService, ko as getMapForWordSeparators, kr as IWorkspaceContextService, ks as IModelService, kt as IClipboardService, ku as isNumber, l as Selection$1, la as editorBackground, lc as isHTMLElement, li as basenameOrAuthority, ll as Command, ln as Extensions, lo as isHighContrast, lr as derivedHandleChanges, ls as MenuItemAction, lt as CursorMoveCommands, lu as USUAL_WORD_SEPARATORS, m as editor_api_exports, ma as editorFindMatchHighlightBorder, mc as setVisibility, mi as joinPath, ml as HoverVerbosityAction, mn as parseDocument, mo as RGBA, mr as disposableObservableValue, ms as KeybindingsRegistry, mt as ReplaceCommandThatPreservesSelection, mu as isLinux, n as Emitter$1, na as inputActiveOptionForeground, nc as getTotalHeight, ni as IdGenerator, nl as noBreakWhitespace, nn as RegexToggle, no as Severity, nr as observableSignalFromEvent, ns as registerModelAndPositionCommand, nt as TypeOperations, nu as onUnexpectedExternalError, o as MarkerTag, oa as minimapFindMatch, oc as hide, oi as isMarkdownString, ol as trim, on as Toggle, oo as registerThemingParticipant, or as autorunWithStore, os as Action2, ot as ShiftCommand, ou as ShowLightbulbIconMode, p as editor, pa as editorFindMatchHighlight, pc as runWhenWindowIdle, pi as isEqual, pl as FoldingRangeKind, pn as computeIndentLevel, po as HSVA, pr as asyncTransaction, ps as registerAction2, pt as ReplaceCommand, pu as isIOS, q as applyStyle, qa as hasDriveLetter, qc as format, qi as IHoverService, ql as dispose, qn as getDefaultHoverDelegate, qo as EditorAction2, qr as IAccessibilityService, qs as createCSSRule, qt as IsWebContext, r as KeyCode, ra as inputBackground, rc as getTotalWidth, ri as defaultGenerator, rl as splitLines, rn as WholeWordsToggle, ro as IDialogService, rr as recomputeInitiallyAndOnChange, rs as registerMultiEditorAction, rt as EnterOperation, ru as EDITOR_FONT_DEFAULTS, s as Position$2, sa as minimapSelectionOccurrenceHighlight, sc as isActiveElement, si as DataUri, sl as Lazy, sn as IQuickInputService, so as themeColorFromId, sr as derived, ss as IMenuService, st as getEnterAction, su as inUntrustedWorkspace, t as CancellationTokenSource$1, ta as inputActiveOptionBorder, tc as getTopLeftOffset, ti as renderMarkdown, tl as lastNonWhitespaceIndex, tn as CaseSensitiveToggle, to as INotificationService, tr as observableSignal, ts as registerInstantiatedEditorAction, tt as EditorContextKeys, tu as onUnexpectedError, u as SelectionDirection, ua as editorErrorBorder, uc as removeCSSRulesContainingSelector, ui as dirname, ul as CompletionItemKinds, un as ModelDecorationInjectedTextOptions, uo as ILanguageFeaturesService, ur as derivedOpts, us as MenuRegistry, ut as WordOperations, uu as LinkedList, v as getOnTypeFormattingEdits, va as editorHoverBackground, vc as trackFocus, vi as FuzzyScore, vl as NewSymbolNameTag, vn as lengthAdd, vo as LineRange, vr as equalsIfDefined, vs as ContextKeyExpr, vt as CopyOptions, vu as isWeb, w as EditorStateCancellationTokenSource, wa as editorInlayHintParameterBackground, wc as DeferredPromise, wi as matchesContiguousSubString, wl as getAriaLabelForSymbol, wn as ghostTextForeground, wo as SearchParams, wr as InspectTokensNLS, ws as Action, wt as renderViewLine, wu as mixin, x as isCodeEditor, xa as editorInfoForeground, xc as matchesScheme, xi as createMatches, xl as SignatureHelpTriggerKind, xn as normalizeIndentation, xo as findLast, xr as structuralEquals, xs as CommandsRegistry, xt as DynamicCssRules, xu as localize, y as FormattingEdit, ya as editorHoverBorder, yc as hash, yi as FuzzyScoreOptions, yl as NewSymbolNameTriggerKind, yn as lengthGetColumnCountIfZeroLineCount, yo as findFirstIdxMonotonousOrArrLen, yr as itemEquals, ys as IContextKeyService, yt as InMemoryClipboardMetadataManager, yu as isWindows, z as diffDeleteDecoration, za as contrastBorder, zc as commonPrefixLength, zi as ScrollableElement, zl as Event, zn as getListStyles, zo as registerSingleton, zr as ILabelService, zs as EventType$1, zt as IconLabel, zu as equals } from "./editor.api-B3Kwz8AU.js";
9
- import * as React$1 from "react";
10
9
  import React, { Component, Fragment, createElement, forwardRef, memo, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
11
10
  import "@elastic/eui/dist/eui_theme_light.min.css";
12
- import { Badge, Button, Card, Empty, Form, Input, Menu, Popover, Progress, Radio, Select, Space, Spin, Switch, Tabs, Tooltip, Tree, Typography } from "antd";
11
+ import { Badge, Button, Card, Empty, Form, Input, InputNumber, Menu, Modal, Popover, Progress, Radio, Select, Space, Spin, Switch, Tabs, Tooltip, Tree, Typography } from "antd";
13
12
  import { EuiCallOut, EuiCodeBlock, EuiFlexGroup, EuiFlexItem, EuiHideFor, EuiIcon, EuiSpacer, EuiTitle, EuiToolTip } from "@elastic/eui";
14
13
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
15
14
  import { CarryOutOutlined } from "@ant-design/icons";
@@ -49,6 +48,19 @@ import { icon as icon$28 } from "@elastic/eui/es/components/icon/assets/tableOfC
49
48
  import { icon as icon$29 } from "@elastic/eui/es/components/icon/assets/tokenNumber";
50
49
  import { icon as icon$30 } from "@elastic/eui/es/components/icon/assets/tokenBoolean";
51
50
  import { icon as icon$31 } from "@elastic/eui/es/components/icon/assets/sortRight";
51
+ function filter(e, t) {
52
+ return operate(function(n, i) {
53
+ var a = 0;
54
+ n.subscribe(createOperatorSubscriber(i, function(n) {
55
+ return e.call(t, n, a++) && i.next(n);
56
+ }));
57
+ });
58
+ }
59
+ function skip(e) {
60
+ return filter(function(t, n) {
61
+ return e <= n;
62
+ });
63
+ }
52
64
  function buildColumns(e, t) {
53
65
  return e.length > 1 && e.indexOf("_source") !== -1 ? e.filter((e) => e !== "_source") : e.length === 0 ? t ? [] : ["_source"] : e;
54
66
  }
@@ -199,6 +211,19 @@ var mergeClasses = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.i
199
211
  d: "M15 3v18",
200
212
  key: "14nvp0"
201
213
  }]
214
+ ]), Download = createLucideIcon("download", [
215
+ ["path", {
216
+ d: "M12 15V3",
217
+ key: "m9g1x1"
218
+ }],
219
+ ["path", {
220
+ d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",
221
+ key: "ih7n3h"
222
+ }],
223
+ ["path", {
224
+ d: "m7 10 5 5 5-5",
225
+ key: "brsn70"
226
+ }]
202
227
  ]), FilePlusCorner = createLucideIcon("file-plus-corner", [
203
228
  ["path", {
204
229
  d: "M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",
@@ -471,19 +496,6 @@ function DiscoverFieldDetails({ field: e, indexPattern: t, details: n, onAddFilt
471
496
  }, `bucket${n}`)), /* @__PURE__ */ jsx(Typography.Text, { children: `${o.top_result_prefix || "Calculated from"} ${n.total} ${o.top_result_suffix || "sample records"}` })] })]
472
497
  }) });
473
498
  }
474
- function filter(e, t) {
475
- return operate(function(n, i) {
476
- var a = 0;
477
- n.subscribe(createOperatorSubscriber(i, function(n) {
478
- return e.call(t, n, a++) && i.next(n);
479
- }));
480
- });
481
- }
482
- function skip(e) {
483
- return filter(function(t, n) {
484
- return e <= n;
485
- });
486
- }
487
499
  var DOT_PREFIX_RE = /(.).+?\./g;
488
500
  const shortenDottedString = (e) => e.replace(DOT_PREFIX_RE, "");
489
501
  function getFieldTypeName$1(e) {
@@ -502,16 +514,16 @@ function getFieldTypeName$1(e) {
502
514
  default: return "Unknown field";
503
515
  }
504
516
  }
505
- function DiscoverField({ field: e, indexPattern: t, onAddField: n, onRemoveField: i, onAddFilter: a, getDetails: s, selected: u, useShortDots: f, setLastPopoverField: p, lastPopoverField: g, onFieldAgg: y, columns: b, whetherToSample: x, sampleSize: S, topNumber: C }) {
517
+ function DiscoverField({ field: e, indexPattern: t, onAddField: n, onRemoveField: i, onAddFilter: a, getDetails: o, selected: s, useShortDots: u, setLastPopoverField: f, lastPopoverField: p, onFieldAgg: m, columns: g, whetherToSample: y, sampleSize: b, topNumber: x }) {
506
518
  `${e.name}`, `${e.name}`;
507
- let { i18n: w } = useContext(GlobalConfigContext), T = w?.field || {}, [E, O] = useState(!1), [A, M] = useState({
519
+ let { i18n: S } = useContext(GlobalConfigContext), C = S?.field || {}, [w, T] = useState(!1), [E, O] = useState({
508
520
  buckets: [],
509
- columns: b
510
- }), [N, P] = useState(!1), [F, I] = useState(!0), L = useCallback((e) => {
511
- u ? i(e.name) : n(e.name);
512
- }, [u]);
513
- function R() {
514
- O((e) => !e);
521
+ columns: g
522
+ }), [A, M] = useState(!1), [P, F] = useState(!0), I = useCallback((e) => {
523
+ s ? i(e.name) : n(e.name);
524
+ }, [s]);
525
+ function L() {
526
+ T((e) => !e);
515
527
  }
516
528
  function z(e) {
517
529
  return e ? e.replace(/\./g, ".​") : "";
@@ -524,23 +536,23 @@ function DiscoverField({ field: e, indexPattern: t, onAddField: n, onRemoveField
524
536
  "data-test-subj": `field-${e.name}`,
525
537
  title: e.name,
526
538
  className: "dscSidebarField__name",
527
- children: z(f ? shortenDottedString(e.name) : e.displayName)
539
+ children: z(u ? shortenDottedString(e.name) : e.displayName)
528
540
  }), U;
529
- if (e.name !== "_source" && !u ? U = /* @__PURE__ */ jsx(Tooltip, {
530
- title: T.add_field_to_column || "Add field as column",
541
+ if (e.name !== "_source" && !s ? U = /* @__PURE__ */ jsx(Tooltip, {
542
+ title: C.add_field_to_column || "Add field as column",
531
543
  children: /* @__PURE__ */ jsx(Button, {
532
544
  size: "small",
533
545
  className: "dscSidebarItem__action !flex !items-center !justify-center",
534
546
  classNames: { icon: "!h-14px !leading-14px" },
535
547
  icon: /* @__PURE__ */ jsx(CirclePlus, { className: "w-14px h-14px" }),
536
548
  onClick: (t) => {
537
- t.preventDefault(), t.stopPropagation(), L(e);
549
+ t.preventDefault(), t.stopPropagation(), I(e);
538
550
  },
539
551
  color: "primary",
540
552
  variant: "text"
541
553
  })
542
- }) : e.name !== "_source" && u && (U = /* @__PURE__ */ jsx(Tooltip, {
543
- title: T.remove_field_from_column || "Remove field from table",
554
+ }) : e.name !== "_source" && s && (U = /* @__PURE__ */ jsx(Tooltip, {
555
+ title: C.remove_field_from_column || "Remove field from table",
544
556
  children: /* @__PURE__ */ jsx(Button, {
545
557
  color: "danger",
546
558
  variant: "text",
@@ -549,7 +561,7 @@ function DiscoverField({ field: e, indexPattern: t, onAddField: n, onRemoveField
549
561
  classNames: { icon: "!h-14px !leading-14px" },
550
562
  icon: /* @__PURE__ */ jsx(CircleX, { className: "w-14px h-14px" }),
551
563
  onClick: (t) => {
552
- t.preventDefault(), t.stopPropagation(), L(e);
564
+ t.preventDefault(), t.stopPropagation(), I(e);
553
565
  }
554
566
  })
555
567
  })), e.type === "_source") return /* @__PURE__ */ jsx(FieldButton, {
@@ -562,19 +574,19 @@ function DiscoverField({ field: e, indexPattern: t, onAddField: n, onRemoveField
562
574
  });
563
575
  let W = (e, n) => {
564
576
  if (e) {
565
- let e = s(n);
566
- M({
567
- ...A,
577
+ let e = o(n);
578
+ O({
579
+ ...E,
568
580
  buckets: e.buckets,
569
581
  exists: e.exists,
570
582
  total: e.total,
571
583
  columns: e.columns
572
584
  });
573
- } else y(n, () => {
574
- P(!0);
585
+ } else m(n, () => {
586
+ M(!0);
575
587
  }, (e, i) => {
576
- M({
577
- ...A,
588
+ O({
589
+ ...E,
578
590
  buckets: (e || []).map((e) => ({
579
591
  display: t.getFormatterForField(n).convert(e.key),
580
592
  value: e.key,
@@ -583,8 +595,8 @@ function DiscoverField({ field: e, indexPattern: t, onAddField: n, onRemoveField
583
595
  })),
584
596
  exists: (e || []).map((e) => e.doc_count).reduce((e, t) => e + t),
585
597
  total: i,
586
- columns: b
587
- }), P(!1);
598
+ columns: g
599
+ }), M(!1);
588
600
  });
589
601
  };
590
602
  return /* @__PURE__ */ jsx(Popover, {
@@ -598,44 +610,44 @@ function DiscoverField({ field: e, indexPattern: t, onAddField: n, onRemoveField
598
610
  className: "!flex !items-center !justify-between",
599
611
  children: [/* @__PURE__ */ jsx("div", {
600
612
  className: "!uppercase",
601
- children: `${T.top || "Top"} ${A?.buckets?.length || 5} ${T.top_values || "values"}`
602
- }), x || x === void 0 ? /* @__PURE__ */ jsx(Tooltip, {
603
- title: F ? T.top_remote || "Toggle remote top values" : T.top_local || "Toggle local top values",
613
+ children: `${C.top || "Top"} ${E?.buckets?.length || 5} ${C.top_values || "values"}`
614
+ }), y || y === void 0 ? /* @__PURE__ */ jsx(Tooltip, {
615
+ title: P ? C.top_remote || "Toggle remote top values" : C.top_local || "Toggle local top values",
604
616
  children: /* @__PURE__ */ jsx(Button, {
605
617
  size: "small",
606
618
  className: "!flex !items-center !justify-center",
607
619
  classNames: { icon: "!h-14px !leading-14px" },
608
620
  icon: /* @__PURE__ */ jsx(Zap, { className: "w-14px h-14px" }),
609
621
  onClick: () => {
610
- I((t) => (W(!t, e), !t));
622
+ F((t) => (W(!t, e), !t));
611
623
  },
612
624
  variant: "text",
613
625
  color: "default"
614
626
  })
615
627
  }) : null]
616
628
  }),
617
- open: E,
629
+ open: w,
618
630
  onOpenChange: (e) => {
619
- e || O(!1);
631
+ e || T(!1);
620
632
  },
621
633
  content: /* @__PURE__ */ jsx(Spin, {
622
- spinning: N,
634
+ spinning: A,
623
635
  children: e.isMulti || e.spec?.aggregatable === !0 ? /* @__PURE__ */ jsx(DiscoverFieldDetails, {
624
636
  indexPattern: t,
625
637
  field: e,
626
- details: A,
638
+ details: E,
627
639
  onAddFilter: a
628
640
  }) : /* @__PURE__ */ jsx(Empty, { image: Empty.PRESENTED_IMAGE_SIMPLE })
629
641
  }),
630
642
  destroyOnHidden: !0,
631
643
  children: /* @__PURE__ */ jsx("div", {
632
644
  onClick: () => {
633
- p(e.name), R(), !E && W(F, e);
645
+ f(e.name), L(), !w && W(P, e);
634
646
  },
635
647
  children: /* @__PURE__ */ jsx(FieldButton, {
636
648
  size: "s",
637
649
  className: "dscSidebarItem",
638
- isActive: E && g == e.name,
650
+ isActive: w && p == e.name,
639
651
  dataTestSubj: `field-${e.name}-showDetails`,
640
652
  fieldIcon: B,
641
653
  fieldAction: U,
@@ -1246,45 +1258,45 @@ var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((e) => {
1246
1258
  }
1247
1259
  var M = p, N = m, P = f, F = u, I = n, L = g, R = a, z = S, B = x, V = i, U = s, W = o, G = y, K = !1;
1248
1260
  function J(e) {
1249
- return K || (K = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), JZ(e) || A(e) === p;
1261
+ return K || (K = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), Z(e) || A(e) === p;
1250
1262
  }
1251
- function JZ(e) {
1263
+ function Z(e) {
1252
1264
  return A(e) === m;
1253
1265
  }
1254
- function Z(e) {
1266
+ function KZ(e) {
1255
1267
  return A(e) === f;
1256
1268
  }
1257
- function YZ(e) {
1269
+ function Q(e) {
1258
1270
  return A(e) === u;
1259
1271
  }
1260
- function XZ(e) {
1272
+ function qZ(e) {
1261
1273
  return typeof e == "object" && !!e && e.$$typeof === n;
1262
1274
  }
1263
- function ZZ(e) {
1275
+ function JZ(e) {
1264
1276
  return A(e) === g;
1265
1277
  }
1266
- function QZ(e) {
1278
+ function YZ(e) {
1267
1279
  return A(e) === a;
1268
1280
  }
1269
- function $Z(e) {
1281
+ function XZ(e) {
1270
1282
  return A(e) === S;
1271
1283
  }
1272
- function eQ(e) {
1284
+ function ZZ(e) {
1273
1285
  return A(e) === x;
1274
1286
  }
1275
- function Q(e) {
1287
+ function QZ(e) {
1276
1288
  return A(e) === i;
1277
1289
  }
1278
- function tQ(e) {
1290
+ function $Z(e) {
1279
1291
  return A(e) === s;
1280
1292
  }
1281
- function nQ(e) {
1293
+ function eQ(e) {
1282
1294
  return A(e) === o;
1283
1295
  }
1284
- function rQ(e) {
1296
+ function tQ(e) {
1285
1297
  return A(e) === y;
1286
1298
  }
1287
- e.AsyncMode = M, e.ConcurrentMode = N, e.ContextConsumer = P, e.ContextProvider = F, e.Element = I, e.ForwardRef = L, e.Fragment = R, e.Lazy = z, e.Memo = B, e.Portal = V, e.Profiler = U, e.StrictMode = W, e.Suspense = G, e.isAsyncMode = J, e.isConcurrentMode = JZ, e.isContextConsumer = Z, e.isContextProvider = YZ, e.isElement = XZ, e.isForwardRef = ZZ, e.isFragment = QZ, e.isLazy = $Z, e.isMemo = eQ, e.isPortal = Q, e.isProfiler = tQ, e.isStrictMode = nQ, e.isSuspense = rQ, e.isValidElementType = O, e.typeOf = A;
1299
+ e.AsyncMode = M, e.ConcurrentMode = N, e.ContextConsumer = P, e.ContextProvider = F, e.Element = I, e.ForwardRef = L, e.Fragment = R, e.Lazy = z, e.Memo = B, e.Portal = V, e.Profiler = U, e.StrictMode = W, e.Suspense = G, e.isAsyncMode = J, e.isConcurrentMode = Z, e.isContextConsumer = KZ, e.isContextProvider = Q, e.isElement = qZ, e.isForwardRef = JZ, e.isFragment = YZ, e.isLazy = XZ, e.isMemo = ZZ, e.isPortal = QZ, e.isProfiler = $Z, e.isStrictMode = eQ, e.isSuspense = tQ, e.isValidElementType = O, e.typeOf = A;
1288
1300
  })();
1289
1301
  })), require_react_is = /* @__PURE__ */ __commonJSMin(((e, t) => {
1290
1302
  process.env.NODE_ENV === "production" ? t.exports = require_react_is_production_min() : t.exports = require_react_is_development();
@@ -1329,21 +1341,21 @@ var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((e) => {
1329
1341
  process.env.NODE_ENV !== "production" && (a = {});
1330
1342
  }, t.exports = s;
1331
1343
  })), require_factoryWithTypeCheckers = /* @__PURE__ */ __commonJSMin(((e, t) => {
1332
- var n = require_react_is(), i = require_object_assign(), o = require_ReactPropTypesSecret(), s = require_has(), u = require_checkPropTypes(), f = function() {};
1333
- process.env.NODE_ENV !== "production" && (f = function(e) {
1344
+ var n = require_react_is(), i = require_object_assign(), a = require_ReactPropTypesSecret(), o = require_has(), s = require_checkPropTypes(), u = function() {};
1345
+ process.env.NODE_ENV !== "production" && (u = function(e) {
1334
1346
  var t = "Warning: " + e;
1335
1347
  typeof console < "u" && console.error(t);
1336
1348
  try {
1337
1349
  throw Error(t);
1338
1350
  } catch {}
1339
1351
  });
1340
- function p() {
1352
+ function f() {
1341
1353
  return null;
1342
1354
  }
1343
1355
  t.exports = function(e, t) {
1344
- var a = typeof Symbol == "function" && Symbol.iterator, m = "@@iterator";
1356
+ var p = typeof Symbol == "function" && Symbol.iterator, m = "@@iterator";
1345
1357
  function g(e) {
1346
- var t = e && (a && e[a] || e[m]);
1358
+ var t = e && (p && e[p] || e[m]);
1347
1359
  if (typeof t == "function") return t;
1348
1360
  }
1349
1361
  var y = "<<anonymous>>", b = {
@@ -1376,20 +1388,20 @@ var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((e) => {
1376
1388
  S.prototype = Error.prototype;
1377
1389
  function C(e) {
1378
1390
  if (process.env.NODE_ENV !== "production") var n = {}, i = 0;
1379
- function a(a, s, u, p, m, g, b) {
1380
- if (p ||= y, g ||= u, b !== o) {
1391
+ function o(o, s, f, p, m, g, b) {
1392
+ if (p ||= y, g ||= f, b !== a) {
1381
1393
  if (t) {
1382
1394
  var x = /* @__PURE__ */ Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");
1383
1395
  throw x.name = "Invariant Violation", x;
1384
1396
  } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
1385
- var C = p + ":" + u;
1386
- !n[C] && i < 3 && (f("You are manually calling a React.PropTypes validation function for the `" + g + "` prop on `" + p + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."), n[C] = !0, i++);
1397
+ var C = p + ":" + f;
1398
+ !n[C] && i < 3 && (u("You are manually calling a React.PropTypes validation function for the `" + g + "` prop on `" + p + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."), n[C] = !0, i++);
1387
1399
  }
1388
1400
  }
1389
- return s[u] == null ? a ? s[u] === null ? new S("The " + m + " `" + g + "` is marked as required " + ("in `" + p + "`, but its value is `null`.")) : new S("The " + m + " `" + g + "` is marked as required in " + ("`" + p + "`, but its value is `undefined`.")) : null : e(s, u, p, m, g);
1401
+ return s[f] == null ? o ? s[f] === null ? new S("The " + m + " `" + g + "` is marked as required " + ("in `" + p + "`, but its value is `null`.")) : new S("The " + m + " `" + g + "` is marked as required in " + ("`" + p + "`, but its value is `undefined`.")) : null : e(s, f, p, m, g);
1390
1402
  }
1391
- var s = a.bind(null, !1);
1392
- return s.isRequired = a.bind(null, !0), s;
1403
+ var s = o.bind(null, !1);
1404
+ return s.isRequired = o.bind(null, !0), s;
1393
1405
  }
1394
1406
  function w(e) {
1395
1407
  function t(t, n, i, a, o, s) {
@@ -1403,18 +1415,18 @@ var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((e) => {
1403
1415
  return C(t);
1404
1416
  }
1405
1417
  function T() {
1406
- return C(p);
1418
+ return C(f);
1407
1419
  }
1408
1420
  function E(e) {
1409
- function t(t, n, i, a, s) {
1421
+ function t(t, n, i, o, s) {
1410
1422
  if (typeof e != "function") return new S("Property `" + s + "` of component `" + i + "` has invalid PropType notation inside arrayOf.");
1411
1423
  var u = t[n];
1412
1424
  if (!Array.isArray(u)) {
1413
1425
  var f = U(u);
1414
- return new S("Invalid " + a + " `" + s + "` of type " + ("`" + f + "` supplied to `" + i + "`, expected an array."));
1426
+ return new S("Invalid " + o + " `" + s + "` of type " + ("`" + f + "` supplied to `" + i + "`, expected an array."));
1415
1427
  }
1416
1428
  for (var p = 0; p < u.length; p++) {
1417
- var m = e(u, p, i, a, s + "[" + p + "]", o);
1429
+ var m = e(u, p, i, o, s + "[" + p + "]", a);
1418
1430
  if (m instanceof Error) return m;
1419
1431
  }
1420
1432
  return null;
@@ -1454,7 +1466,7 @@ var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((e) => {
1454
1466
  return C(t);
1455
1467
  }
1456
1468
  function N(e) {
1457
- if (!Array.isArray(e)) return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? f("Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).") : f("Invalid argument supplied to oneOf, expected an array.")), p;
1469
+ if (!Array.isArray(e)) return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? u("Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).") : u("Invalid argument supplied to oneOf, expected an array.")), f;
1458
1470
  function t(t, n, i, a, o) {
1459
1471
  for (var s = t[n], u = 0; u < e.length; u++) if (x(s, e[u])) return null;
1460
1472
  var f = JSON.stringify(e, function(e, t) {
@@ -1465,12 +1477,12 @@ var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((e) => {
1465
1477
  return C(t);
1466
1478
  }
1467
1479
  function P(e) {
1468
- function t(t, n, i, a, u) {
1480
+ function t(t, n, i, s, u) {
1469
1481
  if (typeof e != "function") return new S("Property `" + u + "` of component `" + i + "` has invalid PropType notation inside objectOf.");
1470
1482
  var f = t[n], p = U(f);
1471
- if (p !== "object") return new S("Invalid " + a + " `" + u + "` of type " + ("`" + p + "` supplied to `" + i + "`, expected an object."));
1472
- for (var m in f) if (s(f, m)) {
1473
- var g = e(f, m, i, a, u + "." + m, o);
1483
+ if (p !== "object") return new S("Invalid " + s + " `" + u + "` of type " + ("`" + p + "` supplied to `" + i + "`, expected an object."));
1484
+ for (var m in f) if (o(f, m)) {
1485
+ var g = e(f, m, i, s, u + "." + m, a);
1474
1486
  if (g instanceof Error) return g;
1475
1487
  }
1476
1488
  return null;
@@ -1478,19 +1490,19 @@ var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((e) => {
1478
1490
  return C(t);
1479
1491
  }
1480
1492
  function F(e) {
1481
- if (!Array.isArray(e)) return process.env.NODE_ENV !== "production" && f("Invalid argument supplied to oneOfType, expected an instance of array."), p;
1493
+ if (!Array.isArray(e)) return process.env.NODE_ENV !== "production" && u("Invalid argument supplied to oneOfType, expected an instance of array."), f;
1482
1494
  for (var t = 0; t < e.length; t++) {
1483
1495
  var n = e[t];
1484
- if (typeof n != "function") return f("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + G(n) + " at index " + t + "."), p;
1496
+ if (typeof n != "function") return u("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + G(n) + " at index " + t + "."), f;
1485
1497
  }
1486
- function i(t, n, i, a, u) {
1498
+ function i(t, n, i, s, u) {
1487
1499
  for (var f = [], p = 0; p < e.length; p++) {
1488
- var m = e[p], g = m(t, n, i, a, u, o);
1500
+ var m = e[p], g = m(t, n, i, s, u, a);
1489
1501
  if (g == null) return null;
1490
- g.data && s(g.data, "expectedType") && f.push(g.data.expectedType);
1502
+ g.data && o(g.data, "expectedType") && f.push(g.data.expectedType);
1491
1503
  }
1492
1504
  var y = f.length > 0 ? ", expected one of type [" + f.join(", ") + "]" : "";
1493
- return new S("Invalid " + a + " `" + u + "` supplied to " + ("`" + i + "`" + y + "."));
1505
+ return new S("Invalid " + s + " `" + u + "` supplied to " + ("`" + i + "`" + y + "."));
1494
1506
  }
1495
1507
  return C(i);
1496
1508
  }
@@ -1504,13 +1516,13 @@ var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((e) => {
1504
1516
  return new S((e || "React class") + ": " + t + " type `" + n + "." + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + a + "`.");
1505
1517
  }
1506
1518
  function R(e) {
1507
- function t(t, n, i, a, s) {
1519
+ function t(t, n, i, o, s) {
1508
1520
  var u = t[n], f = U(u);
1509
- if (f !== "object") return new S("Invalid " + a + " `" + s + "` of type `" + f + "` " + ("supplied to `" + i + "`, expected `object`."));
1521
+ if (f !== "object") return new S("Invalid " + o + " `" + s + "` of type `" + f + "` " + ("supplied to `" + i + "`, expected `object`."));
1510
1522
  for (var p in e) {
1511
1523
  var m = e[p];
1512
- if (typeof m != "function") return L(i, a, s, p, W(m));
1513
- var g = m(u, p, i, a, s + "." + p, o);
1524
+ if (typeof m != "function") return L(i, o, s, p, W(m));
1525
+ var g = m(u, p, i, o, s + "." + p, a);
1514
1526
  if (g) return g;
1515
1527
  }
1516
1528
  return null;
@@ -1518,14 +1530,14 @@ var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((e) => {
1518
1530
  return C(t);
1519
1531
  }
1520
1532
  function z(e) {
1521
- function t(t, n, a, u, f) {
1533
+ function t(t, n, s, u, f) {
1522
1534
  var p = t[n], m = U(p);
1523
- if (m !== "object") return new S("Invalid " + u + " `" + f + "` of type `" + m + "` " + ("supplied to `" + a + "`, expected `object`."));
1535
+ if (m !== "object") return new S("Invalid " + u + " `" + f + "` of type `" + m + "` " + ("supplied to `" + s + "`, expected `object`."));
1524
1536
  for (var g in i({}, t[n], e)) {
1525
1537
  var y = e[g];
1526
- if (s(e, g) && typeof y != "function") return L(a, u, f, g, W(y));
1527
- if (!y) return new S("Invalid " + u + " `" + f + "` key `" + g + "` supplied to `" + a + "`.\nBad object: " + JSON.stringify(t[n], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(e), null, " "));
1528
- var b = y(p, g, a, u, f + "." + g, o);
1538
+ if (o(e, g) && typeof y != "function") return L(s, u, f, g, W(y));
1539
+ if (!y) return new S("Invalid " + u + " `" + f + "` key `" + g + "` supplied to `" + s + "`.\nBad object: " + JSON.stringify(t[n], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(e), null, " "));
1540
+ var b = y(p, g, s, u, f + "." + g, a);
1529
1541
  if (b) return b;
1530
1542
  }
1531
1543
  return null;
@@ -1585,7 +1597,7 @@ var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((e) => {
1585
1597
  function K(e) {
1586
1598
  return !e.constructor || !e.constructor.name ? y : e.constructor.name;
1587
1599
  }
1588
- return b.checkPropTypes = u, b.resetWarningCache = u.resetWarningCache, b.PropTypes = b, b;
1600
+ return b.checkPropTypes = s, b.resetWarningCache = s.resetWarningCache, b.PropTypes = b, b;
1589
1601
  };
1590
1602
  })), require_factoryWithThrowingShims = /* @__PURE__ */ __commonJSMin(((e, t) => {
1591
1603
  var n = require_ReactPropTypesSecret();
@@ -2799,26 +2811,26 @@ function createChildren(e, t) {
2799
2811
  };
2800
2812
  }
2801
2813
  function createElement$1(e) {
2802
- var t = e.node, n = e.stylesheet, i = e.style, a = i === void 0 ? {} : i, o = e.useInlineStyles, s = e.key, u = t.properties, p = t.type, m = t.tagName, g = t.value;
2803
- if (p === "text") return g;
2804
- if (m) {
2805
- var y = createChildren(n, o), b;
2806
- if (!o) b = _objectSpread$1(_objectSpread$1({}, u), {}, { className: createClassNameString(u.className) });
2814
+ var t = e.node, n = e.stylesheet, i = e.style, a = i === void 0 ? {} : i, o = e.useInlineStyles, s = e.key, u = t.properties, f = t.type, p = t.tagName, m = t.value;
2815
+ if (f === "text") return m;
2816
+ if (p) {
2817
+ var g = createChildren(n, o), y;
2818
+ if (!o) y = _objectSpread$1(_objectSpread$1({}, u), {}, { className: createClassNameString(u.className) });
2807
2819
  else {
2808
- var x = Object.keys(n).reduce(function(e, t) {
2820
+ var b = Object.keys(n).reduce(function(e, t) {
2809
2821
  return t.split(".").forEach(function(t) {
2810
2822
  e.includes(t) || e.push(t);
2811
2823
  }), e;
2812
- }, []), S = u.className && u.className.includes("token") ? ["token"] : [], C = u.className && S.concat(u.className.filter(function(e) {
2813
- return !x.includes(e);
2824
+ }, []), x = u.className && u.className.includes("token") ? ["token"] : [], S = u.className && x.concat(u.className.filter(function(e) {
2825
+ return !b.includes(e);
2814
2826
  }));
2815
- b = _objectSpread$1(_objectSpread$1({}, u), {}, {
2816
- className: createClassNameString(C) || void 0,
2827
+ y = _objectSpread$1(_objectSpread$1({}, u), {}, {
2828
+ className: createClassNameString(S) || void 0,
2817
2829
  style: createStyleObject(u.className, Object.assign({}, u.style, a), n)
2818
2830
  });
2819
2831
  }
2820
- var w = y(t.children);
2821
- return /* @__PURE__ */ React.createElement(m, _extends({ key: s }, b), w);
2832
+ var C = g(t.children);
2833
+ return /* @__PURE__ */ React.createElement(p, _extends({ key: s }, y), C);
2822
2834
  }
2823
2835
  }
2824
2836
  var checkForListedLanguage_default = (function(e, t) {
@@ -3072,25 +3084,25 @@ function highlight_default(e, t) {
3072
3084
  numberStyle: A,
3073
3085
  startingLineNumber: T,
3074
3086
  codeString: W
3075
- }) : null, JZ = s.hljs || s["pre[class*=\"language-\"]"] || { backgroundColor: "#fff" }, Z = isHighlightJs(G) ? "hljs" : "prismjs", YZ = y ? Object.assign({}, K, { style: Object.assign({}, JZ, f) }) : Object.assign({}, K, {
3076
- className: K.className ? `${Z} ${K.className}` : Z,
3087
+ }) : null, Z = s.hljs || s["pre[class*=\"language-\"]"] || { backgroundColor: "#fff" }, KZ = isHighlightJs(G) ? "hljs" : "prismjs", Q = y ? Object.assign({}, K, { style: Object.assign({}, Z, f) }) : Object.assign({}, K, {
3088
+ className: K.className ? `${KZ} ${K.className}` : KZ,
3077
3089
  style: Object.assign({}, f)
3078
3090
  });
3079
- if (P ? m.style = _objectSpread({ whiteSpace: "pre-wrap" }, m.style) : m.style = _objectSpread({ whiteSpace: "pre" }, m.style), !G) return /* @__PURE__ */ React.createElement(z, YZ, J, /* @__PURE__ */ React.createElement(V, m, W));
3091
+ if (P ? m.style = _objectSpread({ whiteSpace: "pre-wrap" }, m.style) : m.style = _objectSpread({ whiteSpace: "pre" }, m.style), !G) return /* @__PURE__ */ React.createElement(z, Q, J, /* @__PURE__ */ React.createElement(V, m, W));
3080
3092
  (M === void 0 && L || P) && (M = !0), L ||= defaultRenderer;
3081
- var XZ = [{
3093
+ var qZ = [{
3082
3094
  type: "text",
3083
3095
  value: W
3084
- }], ZZ = getCodeTree({
3096
+ }], JZ = getCodeTree({
3085
3097
  astGenerator: G,
3086
3098
  language: i,
3087
3099
  code: W,
3088
- defaultCodeValue: XZ
3100
+ defaultCodeValue: qZ
3089
3101
  });
3090
- ZZ.language === null && (ZZ.value = XZ);
3091
- var QZ = T + (W.match(/\n/g)?.length ?? 0), $Z = processLines(ZZ, M, I, x, C, T, QZ, A, P);
3092
- return /* @__PURE__ */ React.createElement(z, YZ, /* @__PURE__ */ React.createElement(V, m, !C && J, L({
3093
- rows: $Z,
3102
+ JZ.language === null && (JZ.value = qZ);
3103
+ var YZ = T + (W.match(/\n/g)?.length ?? 0), XZ = processLines(JZ, M, I, x, C, T, YZ, A, P);
3104
+ return /* @__PURE__ */ React.createElement(z, Q, /* @__PURE__ */ React.createElement(V, m, !C && J, L({
3105
+ rows: XZ,
3094
3106
  stylesheet: s,
3095
3107
  useInlineStyles: y
3096
3108
  })));
@@ -20610,7 +20622,7 @@ var computeDotIndexes = (e, t) => {
20610
20622
  n[i] = e.length - t[m];
20611
20623
  };
20612
20624
  function FieldName({ fieldName: e, fieldType: t, useShortDots: n, fieldIconProps: i, scripted: a = !1 }) {
20613
- let s = getFieldTypeName(t), u = n ? abbreviate(e, 38) : e;
20625
+ let o = getFieldTypeName(t), s = n ? abbreviate(e, 38) : e;
20614
20626
  return /* @__PURE__ */ jsxs(EuiFlexGroup, {
20615
20627
  alignItems: "center",
20616
20628
  gutterSize: "s",
@@ -20619,7 +20631,7 @@ function FieldName({ fieldName: e, fieldType: t, useShortDots: n, fieldIconProps
20619
20631
  grow: !1,
20620
20632
  children: /* @__PURE__ */ jsx(FieldIcon, {
20621
20633
  type: t,
20622
- label: s,
20634
+ label: o,
20623
20635
  scripted: a,
20624
20636
  ...i
20625
20637
  })
@@ -20632,7 +20644,7 @@ function FieldName({ fieldName: e, fieldType: t, useShortDots: n, fieldIconProps
20632
20644
  anchorClassName: "eui-textTruncate",
20633
20645
  children: /* @__PURE__ */ jsx("span", {
20634
20646
  className: "",
20635
- children: u
20647
+ children: s
20636
20648
  })
20637
20649
  })
20638
20650
  })]
@@ -21027,7 +21039,7 @@ var index_es_default = function(e) {
21027
21039
  top: -1 * this.maxPullDownDistance
21028
21040
  } }, this.state.pullToRefreshThresholdBreached ? this.props.releaseToRefreshContent : this.props.pullDownToRefreshContent)), this.props.children, !this.state.showLoader && !n && this.props.hasMore && this.props.loader, this.state.showLoader && this.props.hasMore && this.props.loader, !this.props.hasMore && this.props.endMessage));
21029
21041
  }, t;
21030
- }(Component), table_context_default = React$1.createContext({ tableRef: null }), { Text: Text$1 } = Typography;
21042
+ }(Component), { Text: Text$1 } = Typography;
21031
21043
  function LoadingSpinner() {
21032
21044
  return /* @__PURE__ */ jsx("div", {
21033
21045
  style: { textAlign: "center" },
@@ -21035,13 +21047,13 @@ function LoadingSpinner() {
21035
21047
  });
21036
21048
  }
21037
21049
  var pageCount = 20, table_default = React.memo(({ columns: e, hits: t, sortOrder: n, indexPattern: i, onFilter: a, onMoveColumn: o, onAddColumn: s, onRemoveColumn: u, onChangeSortOrder: f, document: p, hitsTotal: m, queryFrom: g, setQueryFrom: y, formatDisplayName: b, formatHit: x, pageSize: S = pageCount, scrollableTarget: C, scrollThreshold: w, hasMore: T = !0, filterIconRender: E, theme: O }) => {
21038
- let A = React.useRef(null);
21050
+ let A = useRef(null);
21039
21051
  return useEffect(() => {
21040
- let e = C ? window.document.getElementById(C) : window.document.documentElement;
21052
+ let e = A.current ? A.current : window.document.documentElement;
21041
21053
  if (!e) return;
21042
21054
  let n = () => {
21043
21055
  let n = T && t.length < m, i = e.scrollHeight <= e.clientHeight;
21044
- n && i && y((e) => e + S);
21056
+ n && i && y(g + S);
21045
21057
  }, i = new ResizeObserver(() => {
21046
21058
  n();
21047
21059
  });
@@ -21052,29 +21064,29 @@ var pageCount = 20, table_default = React.memo(({ columns: e, hits: t, sortOrder
21052
21064
  t.length,
21053
21065
  m,
21054
21066
  T,
21055
- C,
21067
+ g,
21056
21068
  S,
21057
21069
  y
21058
- ]), /* @__PURE__ */ jsx(index_es_default, {
21070
+ ]), /* @__PURE__ */ jsx("div", {
21059
21071
  ref: A,
21060
- dataLength: t.length,
21061
- next: () => {
21062
- y(g + S);
21063
- },
21064
- hasMore: T && t.length < m,
21065
- loader: /* @__PURE__ */ jsx("h4", {
21066
- style: {
21067
- textAlign: "center",
21068
- margin: "10px auto"
21069
- },
21070
- children: /* @__PURE__ */ jsx(LoadingSpinner, {})
21071
- }),
21072
- endMessage: null,
21073
- scrollableTarget: C,
21074
- scrollThreshold: w,
21075
- children: t.length ? /* @__PURE__ */ jsx(table_context_default.Provider, {
21076
- value: { tableRef: A.current },
21077
- children: /* @__PURE__ */ jsxs("table", {
21072
+ className: "infini-discover-table flex-1 overflow-auto",
21073
+ children: A.current && /* @__PURE__ */ jsx(index_es_default, {
21074
+ dataLength: t.length,
21075
+ next: () => {
21076
+ y(g + S);
21077
+ },
21078
+ hasMore: T && t.length < m,
21079
+ loader: /* @__PURE__ */ jsx("h4", {
21080
+ style: {
21081
+ textAlign: "center",
21082
+ margin: "10px auto"
21083
+ },
21084
+ children: /* @__PURE__ */ jsx(LoadingSpinner, {})
21085
+ }),
21086
+ endMessage: null,
21087
+ scrollableTarget: A.current,
21088
+ scrollThreshold: w,
21089
+ children: t.length ? /* @__PURE__ */ jsxs("table", {
21078
21090
  className: "kbn-table table",
21079
21091
  children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx(TableHeader, {
21080
21092
  columns: e,
@@ -21101,8 +21113,8 @@ var pageCount = 20, table_default = React.memo(({ columns: e, hits: t, sortOrder
21101
21113
  filterIconRender: E,
21102
21114
  theme: O
21103
21115
  }, "discover-table-row" + t._id)) })]
21104
- })
21105
- }) : null
21116
+ }) : null
21117
+ })
21106
21118
  });
21107
21119
  });
21108
21120
  init_moment();
@@ -21142,36 +21154,101 @@ var Info_default = ({ bucketInterval: e, dateFormat: t = "YYYY-MM-DD H:mm", time
21142
21154
  });
21143
21155
  };
21144
21156
  function ResultHeader(e) {
21145
- let { showCollapse: t, collapseState: n, setCollapseState: i, took: a, total: o, timeChartProps: s } = e, u = t.sideBar && n.sideBar, f = t.histogram;
21157
+ let { showCollapse: t, collapseState: n, setCollapseState: i, took: a, total: o, timeChartProps: s, onDownloadQuery: u, downloading: f = !1, exportMaxSize: p = 1e4 } = e, m = t.sideBar && n.sideBar, g = t.histogram, [y, b] = useState(!1), [x] = Form.useForm(), { i18n: S } = useContext(GlobalConfigContext), C = S?.download || {}, w = useRef(!1), T = async (e, t, n) => {
21158
+ if (w.current) return;
21159
+ let i = [...t];
21160
+ n && (i = [n, ...i.filter((e) => e !== n)]);
21161
+ let a = e.map((e) => {
21162
+ let t = e._source || {};
21163
+ return i.map((e) => {
21164
+ let n = "";
21165
+ return n = e === "_source" ? t : e in t ? t[e] : e.split(".").reduce((e, t) => e ? e[t] : void 0, t), typeof n == "object" && n && (n = JSON.stringify(n)), `"${String(n ?? "").replace(/"/g, "\"\"")}"`;
21166
+ }).join(",");
21167
+ }), o = [i.join(","), ...a].join("\n"), s = new Blob(["" + o], { type: "text/csv;charset=utf-8;" }), u = window.document.createElement("a"), f = URL.createObjectURL(s);
21168
+ u.setAttribute("href", f), u.setAttribute("download", `${(/* @__PURE__ */ new Date()).getTime()}.csv`), u.style.visibility = "hidden", window.document.body.appendChild(u), u.click(), window.document.body.removeChild(u), b(!1), x.resetFields();
21169
+ }, E = () => {
21170
+ w.current = !1, b(!0);
21171
+ }, O = async () => {
21172
+ let { from: e, size: t } = await x.validateFields();
21173
+ u?.(e - 1, t, T);
21174
+ }, A = () => {
21175
+ b(!1), x.resetFields(), w.current = !0;
21176
+ };
21146
21177
  return /* @__PURE__ */ jsxs("div", {
21147
21178
  className: "flex items-center justify-between p-8px",
21148
- children: [/* @__PURE__ */ jsxs(Space.Compact, { children: [
21149
- !u && !f && /* @__PURE__ */ jsx("div", {}),
21150
- u && /* @__PURE__ */ jsx(Button, {
21151
- className: "flex-shrink-0",
21152
- icon: /* @__PURE__ */ jsx(PanelLeftOpen, { className: "w-14px h-14px" }),
21153
- onClick: () => {
21154
- i({
21155
- ...n,
21156
- sideBar: !1
21157
- });
21158
- }
21179
+ children: [
21180
+ /* @__PURE__ */ jsxs(Space.Compact, { children: [
21181
+ m && /* @__PURE__ */ jsx(Button, {
21182
+ className: "flex-shrink-0",
21183
+ icon: /* @__PURE__ */ jsx(PanelLeftOpen, { className: "w-14px h-14px" }),
21184
+ onClick: () => {
21185
+ i({
21186
+ ...n,
21187
+ sideBar: !1
21188
+ });
21189
+ }
21190
+ }),
21191
+ g && /* @__PURE__ */ jsx(Button, {
21192
+ className: "flex-shrink-0",
21193
+ icon: n.histogram ? /* @__PURE__ */ jsx(PanelTopOpen, { className: "w-14px h-14px" }) : /* @__PURE__ */ jsx(PanelTopClose, { className: "w-14px h-14px" }),
21194
+ onClick: () => {
21195
+ i({
21196
+ ...n,
21197
+ histogram: !n.histogram
21198
+ });
21199
+ }
21200
+ }),
21201
+ /* @__PURE__ */ jsx(Button, {
21202
+ className: "flex-shrink-0",
21203
+ icon: /* @__PURE__ */ jsx(Download, { className: "w-14px h-14px" }),
21204
+ onClick: () => {
21205
+ E();
21206
+ }
21207
+ })
21208
+ ] }),
21209
+ /* @__PURE__ */ jsx(Info_default, {
21210
+ took: a,
21211
+ total: o,
21212
+ ...s || {}
21159
21213
  }),
21160
- t.histogram && /* @__PURE__ */ jsx(Button, {
21161
- className: "flex-shrink-0",
21162
- icon: n.histogram ? /* @__PURE__ */ jsx(PanelTopOpen, { className: "w-14px h-14px" }) : /* @__PURE__ */ jsx(PanelTopClose, { className: "w-14px h-14px" }),
21163
- onClick: () => {
21164
- i({
21165
- ...n,
21166
- histogram: !n.histogram
21167
- });
21168
- }
21214
+ /* @__PURE__ */ jsx(Modal, {
21215
+ title: C.title || "Export search as CSV",
21216
+ closable: !0,
21217
+ open: y,
21218
+ onOk: O,
21219
+ onCancel: A,
21220
+ destroyOnHidden: !0,
21221
+ okButtonProps: { loading: f },
21222
+ children: /* @__PURE__ */ jsxs(Form, {
21223
+ form: x,
21224
+ layout: "vertical",
21225
+ className: "mt-24px",
21226
+ initialValues: {
21227
+ from: 1,
21228
+ size: 20
21229
+ },
21230
+ children: [/* @__PURE__ */ jsx(Form.Item, {
21231
+ label: C.from || "From",
21232
+ name: "from",
21233
+ required: !0,
21234
+ children: /* @__PURE__ */ jsx(InputNumber, {
21235
+ className: "w-full",
21236
+ min: 1,
21237
+ max: o
21238
+ })
21239
+ }), /* @__PURE__ */ jsx(Form.Item, {
21240
+ label: `${C.size || "Size"} (<=${p})`,
21241
+ name: "size",
21242
+ required: !0,
21243
+ children: /* @__PURE__ */ jsx(InputNumber, {
21244
+ className: "w-full",
21245
+ min: 1,
21246
+ max: p
21247
+ })
21248
+ })]
21249
+ })
21169
21250
  })
21170
- ] }), /* @__PURE__ */ jsx(Info_default, {
21171
- took: a,
21172
- total: o,
21173
- ...s || {}
21174
- })]
21251
+ ]
21175
21252
  });
21176
21253
  }
21177
21254
  function _arrayLikeToArray(e, t) {
@@ -51583,10 +51660,10 @@ appendIconComponentCache({
51583
51660
  var import_lodash = require_lodash();
51584
51661
  loader.config({ monaco: editor_main_exports });
51585
51662
  var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringManager, timefilter, storage, getEsQuery, getSearchParams, intervalOptions, getTimeBuckets, fetchESRequest, services, setIndexPatterns } = getContext(), SearchBar = createSearchBar(), isFrist = !0, Discover = (e) => {
51586
- let { indexPattern: t, setIndexPattern: n, onIndexPatternChange: i, onSearch: a, scrollableTarget: o, queryParams: s = {}, setQueryParams: u, locale: f, theme: p } = e, [m, g] = useState({
51663
+ let { indexPattern: t, setIndexPattern: n, onIndexPatternChange: i, onSearch: o, scrollableTarget: s, queryParams: u = {}, setQueryParams: f, locale: m, theme: g, exportMaxSize: b = 1e4 } = e, [x, S] = useState({
51587
51664
  sideBar: !1,
51588
51665
  histogram: !1
51589
- }), [y, b] = useState(() => getTimezone()), [x, S] = useState({
51666
+ }), [C, w] = useState(() => getTimezone()), [T, E] = useState({
51590
51667
  took: 11,
51591
51668
  timed_out: !1,
51592
51669
  _shards: {
@@ -51601,53 +51678,58 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51601
51678
  hits: []
51602
51679
  },
51603
51680
  aggregations: { counts: { buckets: [] } }
51604
- }), w = useRef();
51681
+ }), O = useRef();
51605
51682
  useEffect(() => {
51606
- s.range && s.range[0] && s.range[1] && timefilter.setTime({
51607
- from: s.range[0],
51608
- to: s.range[1]
51609
- }), Array.isArray(s.filters) && s.filters.length > 0 && filterManager.setFilters(s.filters.filter((e) => !!e.meta).map((e) => ({
51683
+ u.range && u.range[0] && u.range[1] && timefilter.setTime({
51684
+ from: u.range[0],
51685
+ to: u.range[1]
51686
+ }), Array.isArray(u.filters) && u.filters.length > 0 && filterManager.setFilters(u.filters.filter((e) => !!e.meta).map((e) => ({
51610
51687
  ...e,
51611
51688
  store: FilterStateStore.APP_STATE
51612
51689
  })));
51613
51690
  }, []);
51614
- let [T, O] = useState({
51615
- columns: s.columns || ["_source"],
51691
+ let [A, M] = useState({
51692
+ columns: u.columns || ["_source"],
51616
51693
  interval: "15s",
51617
- sort: s.sort || []
51618
- }), A = {
51694
+ sort: u.sort || []
51695
+ }), N = {
51619
51696
  type: "string",
51620
51697
  field: "",
51621
51698
  enabled: !1
51622
- }, [M, N] = React.useState(A), P = (e) => {
51623
- N({
51624
- ...M,
51699
+ }, [P, F] = React.useState(N), I = (e) => {
51700
+ F({
51701
+ ...P,
51625
51702
  ...e
51626
51703
  });
51627
- }, F = () => {
51628
- N({
51629
- ...M,
51630
- type: A.type,
51631
- field: A.field
51704
+ }, L = () => {
51705
+ F({
51706
+ ...P,
51707
+ type: N.type,
51708
+ field: N.field
51632
51709
  });
51633
51710
  };
51634
51711
  useMemo(() => {
51635
- F();
51712
+ L();
51636
51713
  }, [t]);
51637
- let [I, L] = React.useState(0), R = T.columns, z = useCallback(async (e) => {
51638
- if (!t || !a) return;
51639
- W("loading"), e?.isScrollLoad || L(0);
51640
- let n = e?.sort || T.sort, i = getSearchParams(t, e?.interval || T.interval, e?.sort || T.sort, e?.aggs || null, M || {}, e?.isScrollLoad ? I : 0, !1), o = (0, import_lodash.cloneDeep)(i?.body?.query?.bool?.filter || []);
51641
- if (o.length > 0) {
51642
- let t = o[o.length - 1];
51643
- t?.hasOwnProperty("range") && (e?.rangeFilter ? (o[o.length - 1] = (0, import_lodash.cloneDeep)(e?.rangeFilter), i.body.query.bool.filter = o) : w.current = t);
51644
- }
51645
- let { index: f, body: p } = i, m = await a(f, p);
51646
- (!m || !m.hits) && (m.hits = { hits: [] }), S(m);
51714
+ let R = useMemo(() => {
51715
+ let e = new Subscription();
51716
+ return e.add(timefilter.getAutoRefreshFetch$().subscribe({ next: () => {
51717
+ U();
51718
+ } })), e;
51719
+ }, [t]), [z, B] = React.useState(0), V = A.columns, U = useCallback(async (e) => {
51720
+ if (!t || !o) return;
51721
+ J("loading"), e?.isScrollLoad || B(0);
51722
+ let n = e?.sort || A.sort, i = getSearchParams(t, e?.interval || A.interval, e?.sort || A.sort, e?.aggs || null, P || {}, e?.isScrollLoad ? z : 0, !1), a = (0, import_lodash.cloneDeep)(i?.body?.query?.bool?.filter || []);
51723
+ if (a.length > 0) {
51724
+ let t = a[a.length - 1];
51725
+ t?.hasOwnProperty("range") && (e?.rangeFilter ? (a[a.length - 1] = (0, import_lodash.cloneDeep)(e?.rangeFilter), i.body.query.bool.filter = a) : O.current = t);
51726
+ }
51727
+ let { index: s, body: p } = i, m = await o(s, p);
51728
+ (!m || !m.hits) && (m.hits = { hits: [] }), E(m);
51647
51729
  let { query: g } = queryStringManager.getQuery(), y = filterManager.getFilters();
51648
- u((e) => ({
51730
+ f((e) => ({
51649
51731
  ...e,
51650
- query: g == s.query ? s.query : g,
51732
+ query: g == u.query ? u.query : g,
51651
51733
  range: [timefilter._time?.from, timefilter._time?.to],
51652
51734
  sort: n,
51653
51735
  timeField: t.timeFieldName,
@@ -51660,34 +51742,34 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51660
51742
  })
51661
51743
  }));
51662
51744
  }, [
51663
- T.interval,
51664
- T.sort,
51745
+ A.interval,
51746
+ A.sort,
51665
51747
  t,
51666
- M,
51667
- I,
51748
+ P,
51749
+ z,
51668
51750
  t?.timeFieldName,
51669
- s
51751
+ u
51670
51752
  ]);
51671
51753
  useEffect(() => {
51672
- I > 0 && z({
51754
+ z > 0 && U({
51673
51755
  isScrollLoad: !0,
51674
- rangeFilter: w.current
51756
+ rangeFilter: O.current
51675
51757
  });
51676
- }, [I]), useEffect(() => {
51677
- isFrist ? isFrist = !isFrist : z();
51758
+ }, [z]), useEffect(() => {
51759
+ isFrist ? isFrist = !isFrist : U();
51678
51760
  }, [e.indices]);
51679
- let B = useCallback((e) => {
51680
- e && O({
51681
- ...T,
51761
+ let G = useCallback((e) => {
51762
+ e && M({
51763
+ ...A,
51682
51764
  interval: e
51683
51765
  });
51684
- }, [O, t]), [V, W] = useState("loading"), { histogramData: G, timeChartProps: K } = useMemo(() => {
51685
- if (!x.hits.hits || x.hits.hits.length == 0) return W("none"), {};
51686
- if (!t?.timeFieldName || !x.aggregations || !x.aggregations.counts) return W("ready"), {
51766
+ }, [M, t]), [K, J] = useState("loading"), { histogramData: Z, timeChartProps: Q } = useMemo(() => {
51767
+ if (!T.hits.hits || T.hits.hits.length == 0) return J("none"), {};
51768
+ if (!t?.timeFieldName || !T.aggregations || !T.aggregations.counts) return J("ready"), {
51687
51769
  histogramData: null,
51688
51770
  timeChartProps: null
51689
51771
  };
51690
- let e = getTimeBuckets(T.interval), n = e.getInterval(!0), i = {
51772
+ let e = getTimeBuckets(A.interval), n = e.getInterval(!0), i = {
51691
51773
  columns: [{
51692
51774
  id: "key",
51693
51775
  name: `${t?.getTimeField().displayName} per ${n.description}`
@@ -51697,7 +51779,7 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51697
51779
  }],
51698
51780
  rows: []
51699
51781
  };
51700
- x.aggregations.counts.buckets.forEach((e) => {
51782
+ T.aggregations.counts.buckets.forEach((e) => {
51701
51783
  i.rows.push(e);
51702
51784
  });
51703
51785
  let a = {
@@ -51721,15 +51803,15 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51721
51803
  label: "Count"
51722
51804
  }
51723
51805
  };
51724
- W("ready");
51806
+ J("ready");
51725
51807
  let o = {
51726
51808
  timeRange: {
51727
51809
  from: timefilter.getBounds().min,
51728
51810
  to: timefilter.getBounds().max
51729
51811
  },
51730
- stateInterval: T.interval || "15s",
51812
+ stateInterval: A.interval || "15s",
51731
51813
  options: intervalOptions,
51732
- onIntervalChange: B,
51814
+ onIntervalChange: G,
51733
51815
  bucketInterval: {
51734
51816
  ...n,
51735
51817
  timeFieldName: t?.timeFieldName
@@ -51740,114 +51822,119 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51740
51822
  timeChartProps: o
51741
51823
  };
51742
51824
  }, [
51743
- x,
51825
+ T,
51744
51826
  t,
51745
51827
  t?.timeFieldName,
51746
- T.interval
51828
+ A.interval
51747
51829
  ]);
51748
51830
  useEffect(() => {
51749
- u((e) => ({
51831
+ f((e) => ({
51750
51832
  ...e,
51751
- columns: T.columns
51833
+ columns: A.columns
51752
51834
  }));
51753
- }, [T.columns]), useEffect(() => {
51835
+ }, [A.columns]), useEffect(() => {
51754
51836
  if (t) if (t?.timeFieldName) {
51755
51837
  let e = [[t?.timeFieldName, "desc"]];
51756
- O({
51757
- ...T,
51838
+ M({
51839
+ ...A,
51758
51840
  sort: e
51759
- }), z({ sort: e });
51760
- } else O({
51761
- ...T,
51841
+ }), U({ sort: e });
51842
+ } else M({
51843
+ ...A,
51762
51844
  sort: []
51763
- }), z({ sort: [] });
51845
+ }), U({ sort: [] });
51764
51846
  }, [t]);
51765
- let { onAddColumn: J, onRemoveColumn: Z, onMoveColumn: YZ, onSetColumns: XZ } = useMemo(() => getStateColumnActions({
51847
+ let { onAddColumn: qZ, onRemoveColumn: JZ, onMoveColumn: YZ, onSetColumns: XZ } = useMemo(() => getStateColumnActions({
51766
51848
  indexPattern: t,
51767
- setAppState: O,
51768
- state: T,
51849
+ setAppState: M,
51850
+ state: A,
51769
51851
  useNewFieldsApi: !1
51770
- }), [t, T]), ZZ = useCallback((e) => {
51771
- O({
51772
- ...T,
51852
+ }), [t, A]), ZZ = useCallback((e) => {
51853
+ M({
51854
+ ...A,
51773
51855
  sort: e
51774
- }), z({ sort: e.reverse() });
51775
- }, [T, t]), QZ = useCallback((e, n, i) => {
51856
+ }), U({ sort: e.reverse() });
51857
+ }, [A, t]), QZ = useCallback((e, n, i) => {
51776
51858
  typeof e == "string" || e.name;
51777
51859
  let a = generateFilters(filterManager, e, n, i, String(t.id));
51778
- filterManager.addFilters(a), z();
51779
- }, [t, z]), $Z = useCallback((e) => {
51860
+ filterManager.addFilters(a), U();
51861
+ }, [t, U]), $Z = useCallback((e) => {
51780
51862
  timefilter.setTime({
51781
51863
  from: moment_default(e.from).toISOString(),
51782
51864
  to: moment_default(e.to).toISOString(),
51783
51865
  mode: "absolute"
51784
- }), z();
51785
- }, [timefilter]), eQ = x.hits.hits || [], [Q, tQ] = useState([]);
51866
+ }), U();
51867
+ }, [timefilter]), eQ = T.hits.hits || [], [tQ, nQ] = useState([]);
51786
51868
  useMemo(() => {
51787
- eQ.length > 0 ? tQ(I > 0 ? [...Q, ...eQ] : eQ) : I === 0 && tQ([]);
51869
+ eQ.length > 0 ? nQ(z > 0 ? (e) => [...e, ...eQ] : eQ) : z === 0 && nQ([]);
51788
51870
  }, [eQ]);
51789
- let nQ = {
51871
+ let rQ = {
51790
51872
  savedSearch: {},
51791
51873
  timefield: t?.getTimeField()?.displayName,
51792
51874
  chartAggConfigs: {}
51793
- }, rQ = {};
51794
- for (let e of Q) for (let n of Object.keys(t.flattenHit(e, !0))) rQ[n] = (rQ[n] || 0) + 1;
51795
- let iQ = Number.isInteger(x.hits.total?.value) ? x.hits.total?.value : 0, aQ = t?.timeFieldName != "", oQ = useCallback(async ({ _index: e, _id: t, _type: n, _source: i, is_new: a }) => !1, [z]), sQ = useCallback(async ({ _index: e, _id: t, _type: n }) => !1, [z]), cQ = useMemo(() => ({
51796
- saveDocument: oQ,
51797
- deleteDocument: sQ
51798
- }), [oQ, sQ]), lQ = async (e, n, i) => {
51799
- let o = e?.spec?.name || e?.name;
51800
- if (!o || !a) return;
51801
- if (e.isMulti) o = `${o}.keyword`;
51875
+ }, iQ = {};
51876
+ for (let e of tQ) for (let n of Object.keys(t.flattenHit(e, !0))) iQ[n] = (iQ[n] || 0) + 1;
51877
+ let aQ = Number.isInteger(T.hits.total?.value) ? T.hits.total?.value : 0, oQ = t?.timeFieldName != "", sQ = useCallback(async ({ _index: e, _id: t, _type: n, _source: i, is_new: a }) => !1, [U]), cQ = useCallback(async ({ _index: e, _id: t, _type: n }) => !1, [U]), lQ = useMemo(() => ({
51878
+ saveDocument: sQ,
51879
+ deleteDocument: cQ
51880
+ }), [sQ, cQ]), uQ = async (e, n, i) => {
51881
+ let a = e?.spec?.name || e?.name;
51882
+ if (!a || !o) return;
51883
+ if (e.isMulti) a = `${a}.keyword`;
51802
51884
  else if (e?.spec?.aggregatable !== !0) return;
51803
51885
  n && n();
51804
- let u = s.sampleRecords === "all" ? { top5: { terms: {
51805
- field: o,
51806
- size: s.topNumber || 5
51886
+ let s = u.sampleRecords === "all" ? { top5: { terms: {
51887
+ field: a,
51888
+ size: u.topNumber || 5
51807
51889
  } } } : {
51808
51890
  sample: {
51809
- sampler: { shard_size: s.sampleSize || 5e3 },
51891
+ sampler: { shard_size: u.sampleSize || 5e3 },
51810
51892
  aggs: {
51811
- sample_count: { value_count: { field: o } },
51893
+ sample_count: { value_count: { field: a } },
51812
51894
  top5: { terms: {
51813
- field: o,
51814
- size: s.topNumber || 5,
51895
+ field: a,
51896
+ size: u.topNumber || 5,
51815
51897
  shard_size: 25
51816
51898
  } }
51817
51899
  }
51818
51900
  },
51819
51901
  top5: { terms: {
51820
- field: o,
51821
- size: s.topNumber || 5,
51902
+ field: a,
51903
+ size: u.topNumber || 5,
51822
51904
  shard_size: 25
51823
51905
  } }
51824
- }, f = getSearchParams(t, T.interval, T.sort, u, M || {}, 0, !0, 0), p = f?.body?.query?.bool?.filter || [];
51825
- if (p.length > 0 && w.current) {
51826
- let e = p[p.length - 1], t = (0, import_lodash.cloneDeep)(w.current);
51906
+ }, f = getSearchParams(t, A.interval, A.sort, s, P || {}, 0, !0, 0), p = f?.body?.query?.bool?.filter || [];
51907
+ if (p.length > 0 && O.current) {
51908
+ let e = p[p.length - 1], t = (0, import_lodash.cloneDeep)(O.current);
51827
51909
  e?.hasOwnProperty("range") ? (p[p.length - 1] = t, f.body.query.bool.filter = p) : p.push(t), f.body.query.bool.filter = p;
51828
51910
  }
51829
- let { index: m, body: g } = f, y = await a(m, g);
51911
+ let { index: m, body: g } = f, y = await o(m, g);
51830
51912
  if (i) {
51831
- let e = s.sampleRecords === "all" ? y?.aggregations?.top5?.buckets : y?.aggregations?.sample?.top5?.buckets, t = s.sampleRecords === "all" ? y?.aggregations?.top5?.sum_other_doc_count : y?.aggregations?.sample?.sample_count?.value;
51913
+ let e = u.sampleRecords === "all" ? y?.aggregations?.top5?.buckets : y?.aggregations?.sample?.top5?.buckets, t = u.sampleRecords === "all" ? y?.aggregations?.top5?.sum_other_doc_count : y?.aggregations?.sample?.sample_count?.value;
51832
51914
  i(e || [], t || 0);
51833
51915
  }
51834
- }, uQ = async (e) => {
51835
- t.timeFieldName = e, n(t);
51916
+ }, dQ = async (e) => {
51917
+ R.unsubscribe(), t.timeFieldName = e, n(t);
51836
51918
  let i = [[e, "desc"]];
51837
- O({
51838
- ...T,
51919
+ M({
51920
+ ...A,
51839
51921
  columns: ["_source"],
51840
51922
  sort: i
51841
- }), z({ sort: i });
51923
+ }), U({ sort: i });
51924
+ }, fQ = async (e, n, i) => {
51925
+ if (!o) return;
51926
+ J("downloading");
51927
+ let { index: a, body: s } = getSearchParams(t, A.interval, A.sort, null, P || {}, e, !1, n), u = await o(a, s), f = Array.isArray(u?.hits?.hits) ? u?.hits?.hits : [], p = t.timeFieldName;
51928
+ i?.(f, V, p), J("none");
51842
51929
  };
51843
51930
  return /* @__PURE__ */ jsxs(Card, {
51844
- className: "min-h-full h-auto flex flex-col infini_discover",
51845
- classNames: { body: "!p-0 flex-1 flex flex-col" },
51931
+ className: "h-full flex flex-col",
51932
+ classNames: { body: "!p-0 h-full flex-1 flex flex-col" },
51846
51933
  children: [/* @__PURE__ */ jsx(SearchBar, {
51847
51934
  showSearchBar: !1,
51848
51935
  showQueryBar: !0,
51849
51936
  showQueryInput: !0,
51850
- showDatePicker: aQ,
51937
+ showDatePicker: oQ,
51851
51938
  showFilterBar: !0,
51852
51939
  useDefaultBehaviors: !0,
51853
51940
  screenTitle: "",
@@ -51858,83 +51945,85 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51858
51945
  filterManager,
51859
51946
  query: {
51860
51947
  language: "kuery",
51861
- query: s.query || ""
51948
+ query: u.query || ""
51862
51949
  },
51863
51950
  queryStringManager,
51864
51951
  queryString: queryStringManager,
51865
51952
  timefilter,
51866
51953
  storage,
51867
- onQuerySubmit: z,
51954
+ onQuerySubmit: U,
51868
51955
  services,
51869
- dateRangeFrom: s.range && s.range[0],
51870
- dateRangeTo: s.range && s.range[1],
51956
+ dateRangeFrom: u.range && u.range[0],
51957
+ dateRangeTo: u.range && u.range[1],
51871
51958
  selectedIndexPattern: t,
51872
- setIndexPattern: i,
51959
+ setIndexPattern: (e) => {
51960
+ R.unsubscribe(), i(e);
51961
+ },
51873
51962
  indices: e.indices,
51874
- histogramData: G,
51963
+ histogramData: Z,
51875
51964
  timefilterUpdateHandler: $Z,
51876
- histogramOpts: nQ,
51965
+ histogramOpts: rQ,
51877
51966
  timeSetting: {
51878
- ...K || {},
51967
+ ...Q || {},
51879
51968
  showTimeSetting: !0,
51880
51969
  showTimeField: !0,
51881
51970
  timeField: t.timeFieldName,
51882
51971
  timeFields: t.fields.filter((e) => e.spec.type === "date").map((e) => e.displayName),
51883
51972
  showTimeInterval: !1,
51884
- timeInterval: K?.stateInterval,
51973
+ timeInterval: Q?.stateInterval,
51885
51974
  timeIntervals: intervalOptions?.map(({ display: e, val: t }) => ({
51886
51975
  label: e,
51887
51976
  value: t
51888
51977
  })),
51889
51978
  onTimeSettingChange: ({ timeField: e, timeInterval: n }) => {
51890
- t.timeFieldName !== e && uQ(e), K?.stateInterval !== n && B(n);
51979
+ t.timeFieldName !== e && dQ(e), Q?.stateInterval !== n && G(n);
51891
51980
  },
51892
- timeZone: y,
51893
- onTimeZoneChange: b,
51981
+ timeZone: C,
51982
+ onTimeZoneChange: w,
51894
51983
  recentlyUsedRanges: []
51895
51984
  },
51896
- locale: f,
51897
- theme: p
51985
+ locale: m,
51986
+ theme: g
51898
51987
  }), /* @__PURE__ */ jsx("div", {
51899
51988
  className: "flex flex-1 min-h-0 border-t border-t-solid border-[var(--ant-color-border)]",
51900
- children: V === "none" && I === 0 ? /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(DiscoverNoResults, {
51901
- timeFieldName: nQ.timefield,
51902
- queryLanguage: T.query?.language || "",
51903
- range: s.range
51904
- }) }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [!m.sideBar && /* @__PURE__ */ jsx("div", {
51989
+ children: K === "none" && z === 0 ? /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(DiscoverNoResults, {
51990
+ timeFieldName: rQ.timefield,
51991
+ queryLanguage: A.query?.language || "",
51992
+ range: u.range
51993
+ }) }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [!x.sideBar && /* @__PURE__ */ jsx("div", {
51905
51994
  className: "min-h-0 w-300px p-8px border-r border-r-solid border-[var(--ant-color-border)]",
51906
51995
  children: /* @__PURE__ */ jsx(SidebarMemoized, {
51907
51996
  config: {},
51908
- columns: R,
51909
- fieldCounts: rQ,
51910
- hits: Q,
51997
+ columns: V,
51998
+ fieldCounts: iQ,
51999
+ hits: tQ,
51911
52000
  indexPatterns: [t],
51912
- onAddField: J,
52001
+ onAddField: qZ,
51913
52002
  onAddFilter: QZ,
51914
- onRemoveField: Z,
52003
+ onRemoveField: JZ,
51915
52004
  selectedIndexPattern: t,
51916
52005
  setIndexPattern: () => {},
51917
- setAppState: O,
51918
- state: T,
51919
- distinctParams: M,
51920
- onDistinctParamsChange: P,
51921
- total: iQ,
51922
- onFieldAgg: lQ,
51923
- whetherToSample: s.whetherToSample,
51924
- sampleSize: s.sampleSize,
51925
- topNumber: s.topNumber,
52006
+ setAppState: M,
52007
+ state: A,
52008
+ distinctParams: P,
52009
+ onDistinctParamsChange: I,
52010
+ total: aQ,
52011
+ onFieldAgg: uQ,
52012
+ whetherToSample: u.whetherToSample,
52013
+ sampleSize: u.sampleSize,
52014
+ topNumber: u.topNumber,
51926
52015
  onCollapseToggle: () => {
51927
- g((e) => ({
52016
+ S((e) => ({
51928
52017
  ...e,
51929
52018
  sideBar: !e.sideBar
51930
52019
  }));
51931
52020
  }
51932
52021
  })
51933
52022
  }), /* @__PURE__ */ jsxs("div", {
51934
- className: "flex-1 min-h-0 overflow-x-auto relative",
52023
+ className: "flex-1 flex flex-col min-h-0 overflow-hidden relative",
51935
52024
  children: [
51936
52025
  /* @__PURE__ */ jsx("div", {
51937
- style: { display: V === "loading" ? "" : "none" },
52026
+ style: { display: K !== "loading" && K !== "downloading" ? "none" : "" },
51938
52027
  children: /* @__PURE__ */ jsx("div", {
51939
52028
  className: "dscOverlay",
51940
52029
  children: /* @__PURE__ */ jsx(LoadingSpinner, {})
@@ -51943,41 +52032,44 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51943
52032
  /* @__PURE__ */ jsx(ResultHeader, {
51944
52033
  showCollapse: {
51945
52034
  sideBar: !0,
51946
- histogram: !!G
52035
+ histogram: !!Z
51947
52036
  },
51948
- collapseState: m,
51949
- setCollapseState: g,
51950
- took: x.took || 1,
51951
- total: iQ,
51952
- timeChartProps: K
52037
+ collapseState: x,
52038
+ setCollapseState: S,
52039
+ took: T.took || 1,
52040
+ total: aQ,
52041
+ timeChartProps: Q,
52042
+ onDownloadQuery: fQ,
52043
+ downloading: K === "downloading",
52044
+ exportMaxSize: b
51953
52045
  }),
51954
- !m.histogram && nQ.chartAggConfigs && G && Q.length !== 0 && /* @__PURE__ */ jsx("div", {
52046
+ !x.histogram && rQ.chartAggConfigs && Z && tQ.length !== 0 && /* @__PURE__ */ jsx("div", {
51955
52047
  className: "dscTimechart",
51956
52048
  children: /* @__PURE__ */ jsx("div", {
51957
52049
  className: "h-100px dscHistogramGrid",
51958
52050
  children: /* @__PURE__ */ jsx(DiscoverHistogram, {
51959
- chartData: G,
52051
+ chartData: Z,
51960
52052
  timefilterUpdateHandler: $Z,
51961
- theme: p
52053
+ theme: g
51962
52054
  })
51963
52055
  })
51964
52056
  }),
51965
- Q && Q.length > 0 ? /* @__PURE__ */ jsx(table_default, {
51966
- columns: R,
51967
- sortOrder: T.sort || [],
52057
+ tQ && tQ.length > 0 ? /* @__PURE__ */ jsx(table_default, {
52058
+ columns: V,
52059
+ sortOrder: A.sort || [],
51968
52060
  indexPattern: t,
51969
52061
  onFilter: QZ,
51970
- onRemoveColumn: Z,
52062
+ onRemoveColumn: JZ,
51971
52063
  onMoveColumn: YZ,
51972
- onAddColumn: J,
52064
+ onAddColumn: qZ,
51973
52065
  onChangeSortOrder: ZZ,
51974
- document: cQ,
51975
- hits: Q,
51976
- hitsTotal: iQ,
51977
- queryFrom: I,
51978
- setQueryFrom: L,
51979
- scrollableTarget: o,
51980
- theme: p
52066
+ document: lQ,
52067
+ hits: tQ,
52068
+ hitsTotal: aQ,
52069
+ queryFrom: z,
52070
+ setQueryFrom: B,
52071
+ scrollableTarget: s,
52072
+ theme: g
51981
52073
  }) : null
51982
52074
  ]
51983
52075
  })] })
@@ -51990,12 +52082,12 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
51990
52082
  });
51991
52083
  const GlobalConfigContext = React.createContext({});
51992
52084
  var components_default = (e) => {
51993
- let { loading: t = !1, indices: n = [], getIndexPattern: i, onSearch: a, onSuggestions: o, scrollableTarget: s, queryParams: u, setQueryParams: f, locale: p, theme: m = "light", i18n: g = {} } = e, [y, b] = useState(), x = useRef({
52085
+ let { loading: t = !1, indices: n = [], getIndexPattern: i, onSearch: a, onSuggestions: o, scrollableTarget: s, queryParams: u, setQueryParams: f, locale: p, theme: m = "light", i18n: g = {}, exportMaxSize: y = 1e4 } = e, [b, x] = useState(), S = useRef({
51994
52086
  pendingIndex: null,
51995
52087
  loadedIndex: null
51996
- }), S = async (e, t) => {
51997
- if (!e || x.current.pendingIndex === e || x.current.loadedIndex === e) return;
51998
- x.current.pendingIndex = e;
52088
+ }), C = async (e, t) => {
52089
+ if (!e || S.current.pendingIndex === e || S.current.loadedIndex === e) return;
52090
+ S.current.pendingIndex = e;
51999
52091
  let n = await services.indexPatternService.get(e, "index");
52000
52092
  if (!n) return;
52001
52093
  let i = [];
@@ -52004,37 +52096,40 @@ var components_default = (e) => {
52004
52096
  }), i && i.length >= 1 && (t && i.includes(t) ? n.timeFieldName = t : n.timeFieldName === "" && (n.timeFieldName = i[0])), n.id !== u?.index && f((e) => ({
52005
52097
  ...e,
52006
52098
  index: n.id
52007
- })), b(n);
52099
+ })), x(n);
52008
52100
  let a = [n];
52009
- a.get = (e) => Promise.resolve(a.find((t) => t.id == e)), setIndexPatterns(a), x.current.loadedIndex = e, x.current.pendingIndex = null;
52101
+ a.get = (e) => Promise.resolve(a.find((t) => t.id == e)), setIndexPatterns(a), S.current.loadedIndex = e, S.current.pendingIndex = null;
52010
52102
  };
52011
52103
  return useEffect(() => {
52012
52104
  o && services.data.autocomplete.setup({ onSuggestions: o }), i && services.indexPatternService.setup({ getIndexPattern: i });
52013
52105
  }, []), useEffect(() => {
52014
- !Array.isArray(n) || n.length === 0 || S(n.find((e) => e.name === u?.index)?.name || n[0].name, u?.timeField);
52106
+ if (!Array.isArray(n) || n.length === 0) return;
52107
+ let e = n.find((e) => e.name === u?.index);
52108
+ (!e || e.disabled) && (e = n.find((e) => !e.disabled)), e && C(e.name, u?.timeField);
52015
52109
  }, [
52016
52110
  n,
52017
52111
  u?.index,
52018
52112
  u?.timeField
52019
52113
  ]), useEffect(() => {
52020
- x.current = {
52114
+ S.current = {
52021
52115
  pendingIndex: null,
52022
52116
  loadedIndex: null
52023
52117
  };
52024
- }, [n]), t ? /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(Spin, { spinning: t }) }) : !n || n.length === 0 ? /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(Empty, { image: Empty.PRESENTED_IMAGE_SIMPLE }) }) : y ? /* @__PURE__ */ jsx(GlobalConfigContext.Provider, {
52118
+ }, [n]), t ? /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(Spin, { spinning: t }) }) : !n || n.length === 0 || !b ? /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(Empty, { image: Empty.PRESENTED_IMAGE_SIMPLE }) }) : /* @__PURE__ */ jsx(GlobalConfigContext.Provider, {
52025
52119
  value: { i18n: g },
52026
52120
  children: /* @__PURE__ */ jsx(Discover, {
52027
52121
  indices: n,
52028
- indexPattern: y,
52029
- setIndexPattern: b,
52030
- onIndexPatternChange: S,
52122
+ indexPattern: b,
52123
+ setIndexPattern: x,
52124
+ onIndexPatternChange: C,
52031
52125
  onSearch: a,
52032
52126
  scrollableTarget: s,
52033
52127
  queryParams: u,
52034
52128
  setQueryParams: f,
52035
52129
  locale: p,
52036
- theme: m
52130
+ theme: m,
52131
+ exportMaxSize: y
52037
52132
  })
52038
- }) : null;
52133
+ });
52039
52134
  };
52040
52135
  export { CirclePlus as a, ListFilter as i, components_default as n, CircleMinus as o, Ft as r, createLucideIcon as s, GlobalConfigContext as t };