/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */!function(e){function n(n){for(var t,o,i=n[0],s=n[1],a=0,u=[];a{},removeEventListener:()=>{}},o=()=>"undefined"==typeof window?r:window},function(e,n,t){"use strict";t.d(n,"a",(function(){return c})),t.d(n,"b",(function(){return u}));var r=t(11),o=t(6);let i;!function(e){e.Local="localStorage",e.Session="sessionStorage"}(i||(i={}));const s={[i.Local]:null,[i.Session]:null},a=e=>{const n=s[e]||new r.Storage(Object(o.a)()[e]);return s[e]=n,n},c=()=>a(i.Local),u=()=>a(i.Session)},function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return a}));var r=t(2);let o=!1;const i=new r.BehaviorSubject(0),s=e=>e(i),a={show:()=>{o||(o=!0,i.next(1))},hide:()=>{o&&(o=!1,i.next(0))}}},function(e,n,t){t.r(n);var r=__kbnBundles__.get("entry/core/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n){e.exports={LIBRARY_NAME:"KbnCanvas",SHAREABLE_RUNTIME_NAME:"kbn_canvas"}},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/kibanaUtils/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n){e.exports=__kbnSharedDeps_npm__},function(e,n,t){t(14),__kbnBundles__.define("plugin/canvas/public",t,15)},function(e,n,t){t.p=window.__kbnPublicPath__.canvas},function(e,n,t){"use strict";t.r(n),t.d(n,"plugin",(function(){return b}));var r=t(1),o=t.n(r),i=t(2),s=t(9),a=t(3);const c={id:"canvas",title:"Canvas",subtitle:a.i18n.translate("xpack.canvas.featureCatalogue.canvasSubtitle",{defaultMessage:"Design pixel-perfect presentations."}),description:a.i18n.translate("xpack.canvas.appDescription",{defaultMessage:"Showcase your data in a pixel-perfect way."}),icon:"canvasApp",path:"/app/canvas",showOnHomePage:!1,category:"data",solutionId:"kibana",order:300};var u=t(5),p=t(0),d=t(7),l=t(8),_=t(4);let f=null;class plugin_CanvasPlugin{constructor(e){o()(this,"appUpdater",new i.BehaviorSubject((()=>({})))),o()(this,"initContext",void 0),this.initContext=e}setup(e,n){const{api:r,registries:o}=function(e){const n={elements:[],transformUIs:[],datasourceUIs:[],modelUIs:[],viewUIs:[],argumentUIs:[],tagUIs:[],transitions:[]},t=e=>n=>{Array.isArray(n)?e.push(...n):e.push(n)};return{api:{addFunctions:n=>{n.forEach((n=>{e.registerFunction(n)}))},addTypes:n=>{n.forEach((n=>{e.registerType(n)}))},addRenderers:n=>{n.forEach((n=>{e.registerRenderer(n)}))},addElements:t(n.elements),addTransformUIs:t(n.transformUIs),addDatasourceUIs:t(n.datasourceUIs),addModelUIs:t(n.modelUIs),addViewUIs:t(n.viewUIs),addArgumentUIs:t(n.argumentUIs),addTagUIs:t(n.tagUIs),addTransitions:t(n.transitions)},registries:n}}(n.expressions),i=Object(d.b)().get(`${p.B}:${e.http.basePath.get()}`);return i&&this.appUpdater.next((()=>({defaultPath:`#${i}`}))),e.application.register({category:s.DEFAULT_APP_CATEGORIES.kibana,id:p.k,title:"Canvas",euiIconType:"logoKibana",order:3e3,updater$:this.appUpdater,mount:async i=>{const{CanvasSrcPlugin:s}=await Promise.all([t.e(2),t.e(4),t.e(3),t.e(6),t.e(10)]).then(t.bind(null,444)),a=new s;a.setup(e,{canvas:r}),(async({coreSetup:e,setupPlugins:n})=>{const{expressions:t,bfetch:r}=n;await(async()=>(f||(f=(async()=>{const n=await e.http.get(p.b,{version:"1"}),o=r.batchedFunction({url:p.b}),{serialize:i}=Object(_.serializeProvider)(t.getTypes());Object.keys(n).forEach((e=>{t.getFunction(e)||t.registerFunction((()=>({...n[e],fn:(n,t)=>o({functionName:e,args:t,context:i(n)})})))}))})()),f))()})({coreSetup:e,setupPlugins:n});const[c,u]=await e.getStartServices();a.start(c,u);const{pluginServices:d}=await t.e(17).then(t.bind(null,63)),{pluginServiceRegistry:l}=await Promise.all([t.e(2),t.e(4),t.e(5),t.e(13)]).then(t.bind(null,446));d.setRegistry(l.start({coreStart:c,startPlugins:u,appUpdater:this.appUpdater,initContext:this.initContext}));const{expressions:b,presentationUtil:g}=u;await g.registerExpressionsLanguage(Object.values(b.getFunctions()));const{renderApp:v,initializeCanvas:h,teardownCanvas:O}=await Promise.all([t.e(2),t.e(4),t.e(3),t.e(5),t.e(6),t.e(7),t.e(9)]).then(t.bind(null,442)),m=await h(e,c,n,u,o,this.appUpdater),P=v({coreStart:c,startPlugins:u,params:i,canvasStore:m,pluginServices:d});return()=>{P(),O(c)}}}),n.home&&n.home.featureCatalogue.register(c),n.share&&n.share.url.locators.create(new u.b),r.addArgumentUIs((async()=>{const{argTypeSpecs:e}=await Promise.all([t.e(2),t.e(3),t.e(7),t.e(12)]).then(t.bind(null,445));return e})),r.addTransitions((async()=>{const{transitions:e}=await Promise.all([t.e(2),t.e(18)]).then(t.bind(null,448));return e})),{...r}}start(e,n){Object(l.a)(e.http.addLoadingCountSource)}}const b=e=>new plugin_CanvasPlugin(e)},function(e,n){e.exports=__kbnSharedDeps__.React},function(e,n){e.exports=__kbnSharedDeps__.EmotionReact},function(e,n){e.exports=__kbnSharedDeps__.ElasticEui},function(e,n){e.exports=__kbnSharedDeps__.Lodash},function(e,n){e.exports=__kbnSharedDeps__.ReactRouterDom},function(e,n){e.exports=__kbnSharedDeps__.ReactDom},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/presentationUtil/common");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n){e.exports=__kbnSharedDeps__.KbnI18nReact},function(e,n){e.exports=__kbnSharedDeps__.Moment},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/presentationUtil/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n){e.exports=__kbnSharedDeps__.Classnames},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/kibanaReact/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n){e.exports=__kbnSharedDeps__.SaferLodashSet},function(e,n){e.exports=__kbnSharedDeps__.RxjsOperators},function(e,n){e.exports=__kbnSharedDeps__.KbnDatemath},function(e,n){e.exports=__kbnSharedDeps__.TsLib},function(e,n){e.exports=__kbnSharedDeps__.EmotionCache},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/expressionError/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/expressionShape/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n){e.exports=__kbnSharedDeps__.Jquery},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/fieldFormats/common");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n){e.exports=__kbnSharedDeps__.KbnEsQuery},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/expressions/common/fonts");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/expressionImage/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/expressionMetric/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/expressionRevealImage/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/expressionRepeatImage/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n){e.exports=__kbnSharedDeps__.ReactRouterDomV5Compat},function(e,n){e.exports=__kbnSharedDeps__.KbnMonaco},function(e,n){e.exports=__kbnSharedDeps__.KbnAnalytics},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/expressionShape/common");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n){e.exports=__kbnSharedDeps__.ElasticNumeral},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/data/common");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/maps/common");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/visualizations/common/constants");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/lens/common/constants");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/embeddable/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/data/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n){e.exports=__kbnSharedDeps__.Uuid},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/visualizations/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n,t){t.r(n);var r=__kbnBundles__.get("plugin/savedObjectsFinder/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(r))},function(e,n){e.exports=__kbnSharedDeps__.History},function(e,n){e.exports=__kbnSharedDeps__.MomentTimezone}]);