!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=__kbnSharedDeps__.KbnI18n},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/presentationUtil/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t){e.exports=__kbnSharedDeps__.ReactDom},function(e,t){e.exports=__kbnSharedDeps__.EmotionReact},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/kibanaReact/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){n(6),__kbnBundles__.define("plugin/expressionImage/public",n,8)},function(e,t,n){n.p=window.__kbnPublicPath__.expressionImage},function(e,t){e.exports=__kbnSharedDeps__.React},function(e,t,n){"use strict";n.r(t),n.d(t,"plugin",(function(){return m})),n.d(t,"imageRendererFactory",(function(){return l})),n.d(t,"getImageRenderer",(function(){return u})),n(7);var r=n(2),a=n(0),o=n(4),s=n(1),i=n(3);const u=(e=s.defaultTheme$)=>()=>({name:"image",displayName:a.i18n.translate("expressionImage.renderer.image.displayName",{defaultMessage:"Image"}),help:a.i18n.translate("expressionImage.renderer.image.helpDescription",{defaultMessage:"Render an image"}),reuseDomNode:!0,render:async(t,n,a)=>{var u;const{elasticLogo:l}=await Object(s.getElasticLogo)(),c={height:"100%",backgroundImage:`url(${Object(s.isValidUrl)(null!==(u=n.dataurl)&&void 0!==u?u:"")?n.dataurl:l})`,backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:n.mode};a.onDestroy((()=>{Object(r.unmountComponentAtNode)(t)})),Object(r.render)(Object(i.jsx)(o.KibanaThemeProvider,{theme$:e},Object(i.jsx)("div",{style:c})),t,(()=>a.done()))}}),l=e=>u(e.theme.theme$),c="`base64`";let d;!function(e){e.CONTAIN="contain",e.COVER="cover",e.STRETCH="stretch"}(d||(d={}));const p={help:a.i18n.translate("expressionImage.functions.imageHelpText",{defaultMessage:"Displays an image. Provide an image asset as a {BASE64} data {URL}, or pass in a sub-expression.",values:{BASE64:c,URL:"URL"}}),args:{dataurl:a.i18n.translate("expressionImage.functions.image.args.dataurlHelpText",{defaultMessage:"The {https} {URL} or {BASE64} data {URL} of an image.",values:{BASE64:c,https:"HTTP(S)",URL:"URL"}}),mode:a.i18n.translate("expressionImage.functions.image.args.modeHelpText",{defaultMessage:"{contain} shows the entire image, scaled to fit. {cover} fills the container with the image, cropping from the sides or bottom as needed. {stretch} resizes the height and width of the image to 100% of the container.",values:{contain:`\`"${d.CONTAIN}"\``,cover:`\`"${d.COVER}"\``,stretch:`\`"${d.STRETCH}"\``}})}},g=()=>{const{help:e,args:t}=p;return{name:"image",aliases:[],type:"image",inputTypes:["null"],help:e,args:{dataurl:{types:["string","null"],help:t.dataurl,aliases:["_","url"],default:null},mode:{types:["string"],help:t.mode,default:"contain",options:Object.values(d)}},fn:async(e,{dataurl:t,mode:n})=>{if(!n||!Object.values(d).includes(n))throw new Error(a.i18n.translate("expressionImage.functions.image.invalidImageModeErrorMessage",{defaultMessage:'"mode" must be "{contain}", "{cover}", or "{stretch}"',values:{contain:d.CONTAIN,cover:d.COVER,stretch:d.STRETCH}}));const r="stretch"===n?"100% 100%":n,{elasticLogo:o}=await Object(s.getElasticLogo)();return{type:"image",mode:r,dataurl:Object(s.resolveWithMissingImage)(t,o)}}}};class plugin_ExpressionImagePlugin{setup(e,{expressions:t}){t.registerFunction(g),t.registerRenderer(l(e))}start(e){}stop(){}}function m(){return new plugin_ExpressionImagePlugin}}]);