(window.dashboard_bundle_jsonpfunction=window.dashboard_bundle_jsonpfunction||[]).push([[6],{228:function(e,t,a){"use strict";a.r(t),a.d(t,"buildAllDashboardActions",(function(){return X}));var i=a(6),n=a(62),o=a(3),s=a.n(o),r=a(50),l=a(63),d=a(68),c=a(66);const b="ACTION_EXPORT_CSV";class export_csv_action_ExportCSVAction{constructor(){s()(this,"id",b),s()(this,"type",b),s()(this,"order",5),s()(this,"fieldFormats",void 0),s()(this,"uiSettings",void 0),s()(this,"getDisplayName",(e=>d.e.getDisplayName())),s()(this,"hasDatatableContent",(e=>Object.keys((null==e?void 0:e.tables)||{}).length>0&&e.tables.allowCsvExport)),s()(this,"getFormatter",(()=>{if(this.fieldFormats)return this.fieldFormats.deserialize})),s()(this,"getDataTableContent",(e=>{if(this.hasDatatableContent(e))return null==e?void 0:e.tables.tables})),s()(this,"exportCSV",(async e=>{var t;const a=this.getFormatter();if(!a)return;const i=this.getDataTableContent(null==e||null===(t=e.embeddable)||void 0===t?void 0:t.getInspectorAdapters());if(i){const t=Object.values(i),n=t.reduce(((i,n,o)=>{if(n){const s=t.length>1?`-${o+1}`:"",l=d.e.getUntitledFilename();i[`${e.embeddable.getTitle()||l}${s}.csv`]={content:r.exporters.datatableToCSV(n,{csvSeparator:this.uiSettings.get("csv:separator",","),quoteValues:this.uiSettings.get("csv:quoteValues",!0),formatFactory:a,escapeFormulaValues:!1}),type:r.exporters.CSV_MIME_TYPE}}return i}),{});if(e.asString)return n;if(n)return Object(l.downloadMultipleAs)(n)}})),({data:{fieldFormats:this.fieldFormats},settings:{uiSettings:this.uiSettings}}=c.pluginServices.getServices())}getIconType(){return"exportAction"}async isCompatible(e){var t,a;return!!this.hasDatatableContent(null===(t=e.embeddable)||void 0===t||null===(a=t.getInspectorAdapters)||void 0===a?void 0:a.call(t))}async execute(e){return await this.exportCSV(e)}}var p=a(11),u=a.n(p),g=a(23),h=a(49),m=a(89),y=a(7);const f="clonePanel";class clone_panel_action_ClonePanelAction{constructor(e){s()(this,"type",f),s()(this,"id",f),s()(this,"order",45),s()(this,"toastsService",void 0),this.savedObjects=e,({notifications:{toasts:this.toastsService}}=c.pluginServices.getServices())}getDisplayName({embeddable:e}){if(!e.getRoot()||!e.getRoot().isContainer)throw new h.IncompatibleActionError;return d.b.getDisplayName()}getIconType({embeddable:e}){if(!e.getRoot()||!e.getRoot().isContainer)throw new h.IncompatibleActionError;return"copy"}async isCompatible({embeddable:e}){var t;return Boolean(!Object(i.isErrorEmbeddable)(e)&&(null===(t=e.getInput())||void 0===t?void 0:t.viewMode)!==i.ViewMode.VIEW&&e.getRoot()&&e.getRoot().isContainer&&e.getRoot().type===y.a&&e.getOutput().editable)}async execute({embeddable:e}){if(!e.getRoot()||!e.getRoot().isContainer)throw new h.IncompatibleActionError;const t=e.getRoot(),a=t.getInput().panels[e.id];if(!a)throw new i.PanelNotFoundError;t.showPlaceholderUntil(this.cloneEmbeddable(a,e),m.b,{width:a.gridData.w,height:a.gridData.h,currentPanels:t.getInput().panels,placeBesideId:a.explicitInput.id,scrollToPanel:!0})}async getCloneTitle(e,t){if(""===t)return"";const a=d.b.getClonedTag(),n=new RegExp(`\\(${a}\\)`,"g"),o=new RegExp(`\\(${a} [0-9]+\\)`,"g"),s=t.replace(o,"").replace(n,"").trim();let r;if(Object(i.isReferenceOrValueEmbeddable)(e)||!u.a.has(e.getExplicitInput(),"savedObjectId")){const t=e.getRoot();r=u.a.filter(await t.getPanelTitles(),(e=>e.startsWith(s)))}else{const t=10,i=await this.savedObjects.client.find({type:e.type,perPage:t,fields:["title"],searchFields:["title"],search:`"${s}"`});r=i.total<=t?i.savedObjects.map((e=>e.get("title"))):[s+` (${a} ${i.total-1})`]}const l=u.a.map(r,(e=>{if(e.match(n))return 0;const t=e.match(o);return t?parseInt(t[0].replace(/[^0-9.]/g,""),10):-1})),c=u.a.max(l)||0;return c<0?s+` (${a})`:s+` (${a} ${c+1})`}async addCloneToLibrary(e,t){const a=await this.savedObjects.client.get(e.type,t),i=await this.getCloneTitle(e,a.attributes.title);return(await this.savedObjects.client.create(e.type,{...u.a.cloneDeep(a.attributes),title:i},{references:u.a.cloneDeep(a.references)})).id}async cloneEmbeddable(e,t){let a;if(Object(i.isReferenceOrValueEmbeddable)(t)){const i=await this.getCloneTitle(t,t.getTitle()||"");a={type:t.type,explicitInput:{...await t.getInputAsValueType(),id:Object(g.v4)(),title:i,hidePanelTitles:e.explicitInput.hidePanelTitles},version:e.version}}else if(a={type:t.type,explicitInput:{...e.explicitInput,id:Object(g.v4)()},version:e.version},e.explicitInput.savedObjectId){const i=await this.addCloneToLibrary(t,e.explicitInput.savedObjectId);a.explicitInput.savedObjectId=i}return this.toastsService.addSuccess({title:d.b.getSuccessMessage(),"data-test-subj":"addObjectToContainerSuccess"}),a}}const j="togglePanel";function v(e){return e.type===y.a}function x(e){if(!e.parent||!v(e.parent))throw new h.IncompatibleActionError;return e.id===e.parent.getExpandedPanelId()}class expand_panel_action_ExpandPanelAction{constructor(){s()(this,"type",j),s()(this,"id",j),s()(this,"order",7)}getDisplayName({embeddable:e}){if(!e.parent||!v(e.parent))throw new h.IncompatibleActionError;return x(e)?d.d.getMinimizeTitle():d.d.getMaximizeTitle()}getIconType({embeddable:e}){if(!e.parent||!v(e.parent))throw new h.IncompatibleActionError;return x(e)?"minimize":"expand"}async isCompatible({embeddable:e}){return Boolean(e.parent&&v(e.parent))}async execute({embeddable:e}){if(!e.parent||!v(e.parent))throw new h.IncompatibleActionError;const t=x(e)?void 0:e.id;e.parent.setExpandedPanelId(t),t||e.parent.setScrollToPanelId(e.id)}}var O=a(0),w=a.n(O),T=a(48),E=a(5),I=a(1);class replace_panel_flyout_ReplacePanelFlyout extends w.a.Component{constructor(e){super(e),s()(this,"lastToast",{id:"panelReplaceToast"}),s()(this,"showToast",(e=>{const{notifications:{toasts:t}}=c.pluginServices.getServices();this.lastToast&&t.remove(this.lastToast),this.lastToast=t.addSuccess({title:d.h.getSuccessMessage(e),"data-test-subj":"addObjectToContainerSuccess"})})),s()(this,"onReplacePanel",(async(e,t,a)=>{const{panelToRemove:i,container:n}=this.props,{w:o,h:s,x:r,y:l}=n.getInput().panels[i.id].gridData,{id:d}=await n.addNewEmbeddable(t,{savedObjectId:e}),{[i.id]:c,...b}=n.getInput().panels;n.updateInput({panels:{...b,[d]:{...b[d],gridData:{...b[d].gridData,w:o,h:s,x:r,y:l}}}}),n.setHighlightPanelId(d),this.showToast(a),this.props.onClose()}))}render(){const{embeddable:{getEmbeddableFactories:e}}=c.pluginServices.getServices(),t=this.props.savedObjectsFinder,a=Object(I.jsx)(t,{noItemsMessage:d.h.getNoMatchingObjectsMessage(),savedObjectMetaData:[...e()].filter((e=>Boolean(e.savedObjectMetaData)&&!e.isContainerType)).map((({savedObjectMetaData:e})=>e)),showFilter:!0,onChoose:this.onReplacePanel}),i="Replace panel "+this.props.panelToRemove.getTitle()+" with:";return Object(I.jsx)(w.a.Fragment,null,Object(I.jsx)(E.EuiFlyoutHeader,{hasBorder:!0},Object(I.jsx)(E.EuiTitle,{size:"m"},Object(I.jsx)("h2",null,Object(I.jsx)("span",null,i)))),Object(I.jsx)(E.EuiFlyoutBody,null,a))}}const C="replacePanel";function M(e){return e.type===y.a}class replace_panel_action_ReplacePanelAction{constructor(e){s()(this,"type",C),s()(this,"id",C),s()(this,"order",3),this.savedobjectfinder=e}getDisplayName({embeddable:e}){if(!e.parent||!M(e.parent))throw new h.IncompatibleActionError;return d.h.getDisplayName()}getIconType({embeddable:e}){if(!e.parent||!M(e.parent))throw new h.IncompatibleActionError;return"kqlOperand"}async isCompatible({embeddable:e}){return(!e.getInput().viewMode||e.getInput().viewMode!==i.ViewMode.VIEW)&&Boolean(e.parent&&M(e.parent))}async execute({embeddable:e}){if(!e.parent||!M(e.parent))throw new h.IncompatibleActionError;const t=e;!async function(e){const{embeddable:t,panelToRemove:a,savedObjectFinder:n}=e,{settings:{theme:{theme$:o}},overlays:{openFlyout:s}}=c.pluginServices.getServices(),r=t.getRoot(),l=Object(i.tracksOverlays)(r)?r:void 0,d=s(Object(T.toMountPoint)(Object(I.jsx)(replace_panel_flyout_ReplacePanelFlyout,{container:t,onClose:()=>{d&&(l&&l.clearOverlays(),d.close())},panelToRemove:a,savedObjectsFinder:n}),{theme$:o}),{"data-test-subj":"dashboardReplacePanel",ownFocus:!0,onClose:e=>{l&&l.clearOverlays(),e.close()}});null==l||l.openOverlay(d)}({embeddable:e.parent,savedObjectFinder:this.savedobjectfinder,panelToRemove:t})}}const A="saveToLibrary";class add_to_library_action_AddToLibraryAction{constructor(){s()(this,"type",A),s()(this,"id",A),s()(this,"order",15),s()(this,"applicationCapabilities",void 0),s()(this,"toastsService",void 0),({application:{capabilities:this.applicationCapabilities},notifications:{toasts:this.toastsService}}=c.pluginServices.getServices())}getDisplayName({embeddable:e}){if(!e.getRoot()||!e.getRoot().isContainer)throw new h.IncompatibleActionError;return d.a.getDisplayName()}getIconType({embeddable:e}){if(!e.getRoot()||!e.getRoot().isContainer)throw new h.IncompatibleActionError;return"folderCheck"}async isCompatible({embeddable:e}){var t;const{maps:a,visualize:n}=this.applicationCapabilities,o="map"===e.type?a.save:n.save;return Boolean(o&&!Object(i.isErrorEmbeddable)(e)&&(null===(t=e.getInput())||void 0===t?void 0:t.viewMode)!==i.ViewMode.VIEW&&e.getRoot()&&e.getRoot().isContainer&&e.getRoot().type===y.a&&Object(i.isReferenceOrValueEmbeddable)(e)&&!e.inputIsRefType(e.getInput()))}async execute({embeddable:e}){if(!Object(i.isReferenceOrValueEmbeddable)(e))throw new h.IncompatibleActionError;const t=await e.getInputAsRefType();e.updateInput(t);const a=e.getRoot(),n=a.getInput().panels[e.id];if(!n)throw new i.PanelNotFoundError;const o={type:e.type,explicitInput:{...t}},s=await a.replacePanel(n,o,!0),r=d.a.getSuccessMessage(e.getTitle()?`'${e.getTitle()}'`:"");void 0!==a.getExpandedPanelId()&&a.setExpandedPanelId(s),this.toastsService.addSuccess({title:r,"data-test-subj":"addPanelToLibrarySuccess"})}}var _=a(51),P=a(2);const S=Object(_.withSuspense)(_.LazyDashboardPicker);function N({PresentationUtilContext:e,dashboardId:t,embeddable:a,closeModal:n}){const{embeddable:{getStateTransfer:o},dashboardCapabilities:{createNew:s,showWriteControls:r}}=c.pluginServices.getServices(),l=o(),[b,u]=Object(O.useState)("existing"),[g,h]=Object(O.useState)(null),m=Object(O.useCallback)((()=>{const e=a.getRoot().getInput().panels[a.id];if(!e)throw new i.PanelNotFoundError;const t={type:a.type,input:{...Object(p.omit)(e.explicitInput,"id")}},o="existing"===b&&g?`#${Object(P.v)(g.id,!0)}`:`#${P.b}`;n(),l.navigateToWithEmbeddablePackage("dashboards",{state:t,path:o})}),[b,a,g,l,n]),y="copyToDashboardTitle",f="copyToDashboardDescription";return Object(I.jsx)(E.EuiFocusTrap,{clickOutsideDisables:!0},Object(I.jsx)(E.EuiOutsideClickDetector,{onOutsideClick:n},Object(I.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":y,"aria-describedby":f},Object(I.jsx)(e,null,Object(I.jsx)(E.EuiModalHeader,null,Object(I.jsx)(E.EuiModalHeaderTitle,{id:y,component:"h2"},d.c.getDisplayName())),Object(I.jsx)(E.EuiModalBody,null,Object(I.jsx)(w.a.Fragment,null,Object(I.jsx)(E.EuiText,null,Object(I.jsx)("p",{id:f},d.c.getDescription())),Object(I.jsx)(E.EuiSpacer,null),Object(I.jsx)(E.EuiFormRow,{hasChildLabel:!1},Object(I.jsx)(E.EuiPanel,{color:"subdued",hasShadow:!1,"data-test-subj":"add-to-dashboard-options"},Object(I.jsx)("div",null,r&&Object(I.jsx)(w.a.Fragment,null,Object(I.jsx)(E.EuiRadio,{checked:"existing"===b,"data-test-subj":"add-to-existing-dashboard-option",id:"existing-dashboard-option",name:"dashboard-option",label:d.c.getExistingDashboardOption(),onChange:()=>u("existing")}),Object(I.jsx)("div",{className:"savAddDashboard__searchDashboards"},Object(I.jsx)(S,{isDisabled:"existing"!==b,idsToOmit:t?[t]:void 0,onChange:e=>h(e)})),Object(I.jsx)(E.EuiSpacer,{size:"s"})),s&&Object(I.jsx)(w.a.Fragment,null,Object(I.jsx)(E.EuiRadio,{checked:"new"===b,"data-test-subj":"add-to-new-dashboard-option",id:"new-dashboard-option",name:"dashboard-option",disabled:!t,label:d.c.getNewDashboardOption(),onChange:()=>u("new")}),Object(I.jsx)(E.EuiSpacer,{size:"s"}))))))),Object(I.jsx)(E.EuiModalFooter,null,Object(I.jsx)(E.EuiButtonEmpty,{"data-test-subj":"cancelCopyToButton",onClick:()=>n()},d.c.getCancelButtonName()),Object(I.jsx)(E.EuiButton,{fill:!0,"data-test-subj":"confirmCopyToButton",onClick:m,disabled:"existing"===b&&!g},d.c.getAcceptButtonName()))))))}const D="copyToDashboard";function R(e){return e.type===y.a}class copy_to_dashboard_action_CopyToDashboardAction{constructor(e){s()(this,"type",D),s()(this,"id",D),s()(this,"order",1),s()(this,"dashboardCapabilities",void 0),s()(this,"theme$",void 0),s()(this,"openModal",void 0),this.PresentationUtilContext=e,({dashboardCapabilities:this.dashboardCapabilities,overlays:{openModal:this.openModal},settings:{theme:{theme$:this.theme$}}}=c.pluginServices.getServices())}getDisplayName({embeddable:e}){if(!e.parent||!R(e.parent))throw new h.IncompatibleActionError;return d.c.getDisplayName()}getIconType({embeddable:e}){if(!e.parent||!R(e.parent))throw new h.IncompatibleActionError;return"exit"}async isCompatible({embeddable:e}){const{createNew:t,showWriteControls:a}=this.dashboardCapabilities;return Boolean(e.parent&&R(e.parent)&&(t||a))}async execute({embeddable:e}){if(!e.parent||!R(e.parent))throw new h.IncompatibleActionError;const t=this.openModal(Object(T.toMountPoint)(Object(I.jsx)(N,{PresentationUtilContext:this.PresentationUtilContext,closeModal:()=>t.close(),dashboardId:e.parent.getDashboardSavedObjectId(),embeddable:e}),{theme$:this.theme$}),{maxWidth:400,"data-test-subj":"copyToDashboardPanel"})}}const F="unlinkFromLibrary";class unlink_from_library_action_UnlinkFromLibraryAction{constructor(){s()(this,"type",F),s()(this,"id",F),s()(this,"order",15),s()(this,"toastsService",void 0),({notifications:{toasts:this.toastsService}}=c.pluginServices.getServices())}getDisplayName({embeddable:e}){if(!e.getRoot()||!e.getRoot().isContainer)throw new h.IncompatibleActionError;return d.i.getDisplayName()}getIconType({embeddable:e}){if(!e.getRoot()||!e.getRoot().isContainer)throw new h.IncompatibleActionError;return"folderExclamation"}async isCompatible({embeddable:e}){var t;return Boolean(!Object(i.isErrorEmbeddable)(e)&&(null===(t=e.getInput())||void 0===t?void 0:t.viewMode)!==i.ViewMode.VIEW&&e.getRoot()&&e.getRoot().isContainer&&e.getRoot().type===y.a&&Object(i.isReferenceOrValueEmbeddable)(e)&&e.inputIsRefType(e.getInput()))}async execute({embeddable:e}){if(!Object(i.isReferenceOrValueEmbeddable)(e))throw new h.IncompatibleActionError;const t=await e.getInputAsValueType();e.updateInput(t);const a=e.getRoot(),n=a.getInput().panels[e.id];if(!n)throw new i.PanelNotFoundError;const o={type:e.type,explicitInput:{...t,title:e.getTitle()}},s=await a.replacePanel(n,o,!0),r=d.i.getSuccessMessage(e.getTitle()?`'${e.getTitle()}'`:"");void 0!==a.getExpandedPanelId()&&a.setExpandedPanelId(s),this.toastsService.addSuccess({title:r,"data-test-subj":"unlinkPanelSuccess"})}}var k=a(88),B=a.n(k),V=a(64),L=a(32),$={name:"1v0pok0",styles:"min-width:300px"};function G({context:e,setDisableEditButton:t}){const{embeddable:a}=e,[i,n]=Object(O.useState)(!0),[o,s]=Object(O.useState)([]),[r,l]=Object(O.useState)(""),[c,b]=Object(O.useState)(),p=Object(O.useMemo)((()=>{var e;return null===(e=a.getRoot())||void 0===e?void 0:e.getAllDataViews()}),[a]);return B()((()=>{Promise.all([a.getFilters(),a.getQuery()]).then((([e,a])=>{if(s(e),a)if(Object(L.isOfQueryType)(a))l(a.query);else{const e=Object(L.getAggregateQueryMode)(a);b(e),l(a[e]),t(!0)}n(!1)}))})),Object(I.jsx)(E.EuiForm,{component:"div",css:$},Object(I.jsx)(E.EuiSkeletonText,{isLoading:i,lines:3},""!==r&&Object(I.jsx)(E.EuiFormRow,{label:d.f.getQueryTitle(),display:"rowCompressed"},Object(I.jsx)(E.EuiCodeBlock,{language:c,paddingSize:"none",transparentBackground:!0,"aria-labelledby":`${d.f.getQueryTitle()}: ${r}`,tabIndex:0},r)),o&&o.length>0&&Object(I.jsx)(E.EuiFormRow,{label:d.f.getFiltersTitle()},Object(I.jsx)(E.EuiFlexGroup,{wrap:!0,gutterSize:"xs"},Object(I.jsx)(V.FilterItems,{filters:o,indexPatterns:p,readOnly:!0})))))}function U({editPanelAction:e,displayName:t,context:a,icon:i,id:n}){const{embeddable:o}=a,[s,r]=Object(O.useState)(!1),[l,c]=Object(O.useState)(!1);return Object(I.jsx)(E.EuiPopover,{button:Object(I.jsx)(E.EuiButtonIcon,{color:"text",iconType:i,onClick:()=>r(!s),"data-test-subj":`embeddablePanelNotification-${n}`,"aria-label":t}),isOpen:s,closePopover:()=>r(!1),anchorPosition:"upCenter"},Object(I.jsx)(E.EuiPopoverTitle,null,t),Object(I.jsx)(G,{context:a,setDisableEditButton:c}),Object(I.jsx)(E.EuiPopoverFooter,null,!l&&Object(I.jsx)(E.EuiFlexGroup,{gutterSize:"s",alignItems:"center",justifyContent:"flexEnd",responsive:!1,wrap:!0},Object(I.jsx)(E.EuiFlexItem,{grow:!1},Object(I.jsx)(E.EuiButton,{"data-test-subj":"filtersNotificationModal__editButton",size:"s",fill:!0,onClick:()=>e.execute({embeddable:o})},d.f.getEditButtonTitle())))))}const z="ACTION_FILTERS_NOTIFICATION";class filters_notification_action_FiltersNotificationAction{constructor(){s()(this,"id",z),s()(this,"type",z),s()(this,"order",2),s()(this,"displayName",d.f.getDisplayName()),s()(this,"icon","filter"),s()(this,"applicationService",void 0),s()(this,"embeddableService",void 0),s()(this,"settingsService",void 0),s()(this,"MenuItem",(({context:e})=>{const{embeddable:t}=e,a=new i.EditPanelAction(this.embeddableService.getEmbeddableFactory,this.applicationService,this.embeddableService.getStateTransfer()),{Provider:n}=Object(T.createKibanaReactContext)({uiSettings:this.settingsService.uiSettings});return Object(I.jsx)(n,null,Object(I.jsx)(U,{editPanelAction:a,displayName:this.displayName,context:e,icon:this.getIconType({embeddable:t}),id:this.id}))})),s()(this,"isCompatible",(async({embeddable:e})=>{var t;if(Object(i.isErrorEmbeddable)(e)||!e.getRoot().isContainer||(null===(t=e.getInput())||void 0===t?void 0:t.viewMode)!==i.ViewMode.EDIT||!Object(i.isFilterableEmbeddable)(e))return!1;if((await e.getFilters()).length>0)return!0;const{isOfQueryType:n,isOfAggregateQueryType:o}=await Promise.resolve().then(a.t.bind(null,32,7)),s=await e.getQuery();return n(s)&&""!==s.query||o(s)})),s()(this,"execute",(async()=>{})),({application:this.applicationService,embeddable:this.embeddableService,settings:this.settingsService}=c.pluginServices.getServices())}getDisplayName({embeddable:e}){if(!e.getRoot()||!e.getRoot().isContainer)throw new h.IncompatibleActionError;return this.displayName}getIconType({embeddable:e}){if(!e.getRoot()||!e.getRoot().isContainer)throw new h.IncompatibleActionError;return this.icon}}function Q({unlinkAction:e,displayName:t,context:a,icon:i,id:n}){const[o,s]=Object(O.useState)(!1),{embeddable:r}=a;return Object(I.jsx)(E.EuiPopover,{button:Object(I.jsx)(E.EuiButtonIcon,{color:"text",iconType:i,onClick:()=>s(!o),"data-test-subj":`embeddablePanelNotification-${n}`,"aria-label":d.g.getPopoverAriaLabel()}),isOpen:o,closePopover:()=>s(!1),anchorPosition:"upCenter"},Object(I.jsx)(E.EuiPopoverTitle,null,t),Object(I.jsx)("div",{style:{width:"300px"}},Object(I.jsx)(E.EuiText,null,Object(I.jsx)("p",null,d.g.getTooltip()))),Object(I.jsx)(E.EuiPopoverFooter,null,Object(I.jsx)(E.EuiFlexGroup,{gutterSize:"s",alignItems:"center",justifyContent:"flexEnd",responsive:!1,wrap:!0},Object(I.jsx)(E.EuiFlexItem,{grow:!1},Object(I.jsx)(E.EuiButton,{"data-test-subj":"libraryNotificationUnlinkButton",size:"s",fill:!0,onClick:()=>e.execute({embeddable:r})},e.getDisplayName({embeddable:r}))))))}const W="ACTION_LIBRARY_NOTIFICATION";class library_notification_action_LibraryNotificationAction{constructor(e){s()(this,"id",W),s()(this,"type",W),s()(this,"order",1),s()(this,"displayName",d.g.getDisplayName()),s()(this,"icon","folderCheck"),s()(this,"MenuItem",(({context:e})=>{const{embeddable:t}=e;return Object(I.jsx)(Q,{unlinkAction:this.unlinkAction,displayName:this.displayName,context:e,icon:this.getIconType({embeddable:t}),id:this.id})})),s()(this,"isCompatible",(async({embeddable:e})=>{var t;return!Object(i.isErrorEmbeddable)(e)&&e.getRoot().isContainer&&(null===(t=e.getInput())||void 0===t?void 0:t.viewMode)!==i.ViewMode.VIEW&&Object(i.isReferenceOrValueEmbeddable)(e)&&e.inputIsRefType(e.getInput())})),s()(this,"execute",(async()=>{})),this.unlinkAction=e}getDisplayName({embeddable:e}){if(!e.getRoot()||!e.getRoot().isContainer)throw new h.IncompatibleActionError;return this.displayName}getIconType({embeddable:e}){if(!e.getRoot()||!e.getRoot().isContainer)throw new h.IncompatibleActionError;return this.icon}}const X=async({core:e,plugins:t,allowByValueEmbeddables:a})=>{const{uiActions:o,share:s,presentationUtil:r,savedObjectsTaggingOss:l,contentManagement:d}=t,c=new clone_panel_action_ClonePanelAction(e.savedObjects);o.registerAction(c),o.attachAction(i.CONTEXT_MENU_TRIGGER,c.id);const b=Object(n.getSavedObjectFinder)(d.client,e.uiSettings,null==l?void 0:l.getTaggingApi()),p=new replace_panel_action_ReplacePanelAction(b);o.registerAction(p),o.attachAction(i.CONTEXT_MENU_TRIGGER,p.id);const u=new expand_panel_action_ExpandPanelAction;o.registerAction(u),o.attachAction(i.CONTEXT_MENU_TRIGGER,u.id);const g=new filters_notification_action_FiltersNotificationAction;if(o.registerAction(g),o.attachAction(i.PANEL_NOTIFICATION_TRIGGER,g.id),s){const e=new export_csv_action_ExportCSVAction;o.addTriggerAction(i.CONTEXT_MENU_TRIGGER,e)}if(a){const e=new add_to_library_action_AddToLibraryAction;o.registerAction(e),o.attachAction(i.CONTEXT_MENU_TRIGGER,e.id);const t=new unlink_from_library_action_UnlinkFromLibraryAction;o.registerAction(t),o.attachAction(i.CONTEXT_MENU_TRIGGER,t.id);const a=new library_notification_action_LibraryNotificationAction(t);o.registerAction(a),o.attachAction(i.PANEL_NOTIFICATION_TRIGGER,a.id);const n=new copy_to_dashboard_action_CopyToDashboardAction(r.ContextProvider);o.registerAction(n),o.attachAction(i.CONTEXT_MENU_TRIGGER,n.id)}}},68:function(e,t,a){"use strict";a.d(t,"c",(function(){return n})),a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return s})),a.d(t,"d",(function(){return r})),a.d(t,"e",(function(){return l})),a.d(t,"i",(function(){return d})),a.d(t,"g",(function(){return c})),a.d(t,"h",(function(){return b})),a.d(t,"f",(function(){return p}));var i=a(4);const n={getDisplayName:()=>i.i18n.translate("dashboard.panel.copyToDashboard.title",{defaultMessage:"Copy to dashboard"}),getCancelButtonName:()=>i.i18n.translate("dashboard.panel.copyToDashboard.cancel",{defaultMessage:"Cancel"}),getAcceptButtonName:()=>i.i18n.translate("dashboard.panel.copyToDashboard.goToDashboard",{defaultMessage:"Copy and go to dashboard"}),getNewDashboardOption:()=>i.i18n.translate("dashboard.panel.copyToDashboard.newDashboardOptionLabel",{defaultMessage:"New dashboard"}),getExistingDashboardOption:()=>i.i18n.translate("dashboard.panel.copyToDashboard.existingDashboardOptionLabel",{defaultMessage:"Existing dashboard"}),getDescription:()=>i.i18n.translate("dashboard.panel.copyToDashboard.description",{defaultMessage:"Choose the destination dashboard."})},o={getDisplayName:()=>i.i18n.translate("dashboard.panel.AddToLibrary",{defaultMessage:"Save to library"}),getSuccessMessage:e=>i.i18n.translate("dashboard.panel.addToLibrary.successMessage",{defaultMessage:"Panel {panelTitle} was added to the library",values:{panelTitle:e}})},s={getDisplayName:()=>i.i18n.translate("dashboard.panel.clonePanel",{defaultMessage:"Clone panel"}),getClonedTag:()=>i.i18n.translate("dashboard.panel.title.clonedTag",{defaultMessage:"copy"}),getSuccessMessage:()=>i.i18n.translate("dashboard.panel.clonedToast",{defaultMessage:"Cloned panel"})},r={getMinimizeTitle:()=>i.i18n.translate("dashboard.actions.toggleExpandPanelMenuItem.expandedDisplayName",{defaultMessage:"Minimize"}),getMaximizeTitle:()=>i.i18n.translate("dashboard.actions.toggleExpandPanelMenuItem.notExpandedDisplayName",{defaultMessage:"Maximize panel"})},l={getDisplayName:()=>i.i18n.translate("dashboard.actions.DownloadCreateDrilldownAction.displayName",{defaultMessage:"Download as CSV"}),getUntitledFilename:()=>i.i18n.translate("dashboard.actions.downloadOptionsUnsavedFilename",{defaultMessage:"untitled"})},d={getDisplayName:()=>i.i18n.translate("dashboard.panel.unlinkFromLibrary",{defaultMessage:"Unlink from library"}),getSuccessMessage:e=>i.i18n.translate("dashboard.panel.unlinkFromLibrary.successMessage",{defaultMessage:"Panel {panelTitle} is no longer connected to the library",values:{panelTitle:e}})},c={getDisplayName:()=>i.i18n.translate("dashboard.panel.LibraryNotification",{defaultMessage:"Library Notification"}),getTooltip:()=>i.i18n.translate("dashboard.panel.libraryNotification.toolTip",{defaultMessage:"Editing this panel might affect other dashboards. To change this panel only, unlink it from the library."}),getPopoverAriaLabel:()=>i.i18n.translate("dashboard.panel.libraryNotification.ariaLabel",{defaultMessage:"View library information and unlink this panel"})},b={getDisplayName:()=>i.i18n.translate("dashboard.panel.removePanel.replacePanel",{defaultMessage:"Replace panel"}),getSuccessMessage:e=>e?i.i18n.translate("dashboard.addPanel.savedObjectAddedToContainerSuccessMessageTitle",{defaultMessage:"{savedObjectName} was added",values:{savedObjectName:`'${e}'`}}):i.i18n.translate("dashboard.addPanel.panelAddedToContainerSuccessMessageTitle",{defaultMessage:"A panel was added"}),getNoMatchingObjectsMessage:()=>i.i18n.translate("dashboard.addPanel.noMatchingObjectsMessage",{defaultMessage:"No matching objects found."})},p={getDisplayName:()=>i.i18n.translate("dashboard.panel.filters",{defaultMessage:"Panel filters"}),getEditButtonTitle:()=>i.i18n.translate("dashboard.panel.filters.modal.editButton",{defaultMessage:"Edit filters"}),getCloseButtonTitle:()=>i.i18n.translate("dashboard.panel.filters.modal.closeButton",{defaultMessage:"Close"}),getQueryTitle:()=>i.i18n.translate("dashboard.panel.filters.modal.queryTitle",{defaultMessage:"Query"}),getFiltersTitle:()=>i.i18n.translate("dashboard.panel.filters.modal.filtersTitle",{defaultMessage:"Filters"})}},88:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a(30).__importDefault(a(33));t.default=function(e){i.default((function(){e()}))}},89:function(e,t,a){"use strict";a.d(t,"a",(function(){return r})),a.d(t,"b",(function(){return d}));var i=a(11),n=a.n(i),o=a(6),s=a(2);function r({width:e,height:t,currentPanels:a}){let i=-1;const n=Object.values(a);if(n.forEach((e=>{i=Math.max(e.gridData.y+e.gridData.h,i)})),i<0)return{newPanelPlacement:{x:0,y:0,w:e,h:t},otherPanels:a};const o=new Array(i);for(let e=0;e{for(let t=e.gridData.x;tt.y+t.h?1:e.x+e.w<=t.x+t.w?-1:1}function d({width:e,height:t,currentPanels:a,placeBesideId:i}){const r=a[i];if(!r)throw new o.PanelNotFoundError;const d=r.gridData,c=[];n.a.forOwn(a,((e,t)=>{c.push(e.gridData)}));const b=[{grid:{x:d.x+d.w,y:d.y,w:e,h:t},fits:!0},{grid:{x:0,y:d.y+d.h,w:e,h:t},fits:!0},{grid:{x:d.x,y:d.y+d.h,w:e,h:t},fits:!0}];for(const e of b)if(e.grid.x>=0&&e.grid.x+e.grid.w<=s.e&&e.grid.y>=0){if(!c.some((t=>e.grid.x+e.grid.w>t.x&&e.grid.xt.y)))return{newPanelPlacement:e.grid,otherPanels:a}}else e.fits=!1;const p={...a},u=c.sort(l);let g=0;for(;g