(window.charts_bundle_jsonpfunction=window.charts_bundle_jsonpfunction||[]).push([[1],{33:function(e,t,a){e.exports=a(18)(68)},34:function(e,t,a){"use strict";a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return l}));const n=e=>Boolean(e&&["below","all"].includes(e)),l=e=>Boolean(e&&["above","all"].includes(e))},38:function(e,t,a){"use strict";a.r(t),a.d(t,"buildPalettes",(function(){return b}));var n=a(33),l=a.n(n),o=a(5),r=a(4),s=a(2),i=a(24),c=a(17),u=a(22),p=a(34);const g=({stops:e,colors:t,rangeMax:a},n,[l,o])=>n?Number.POSITIVE_INFINITY:e.length?a:o-(o-l)/t.length,m=({stops:e,rangeMin:t},a,n)=>a?Number.NEGATIVE_INFINITY:e.length?t:n;function h(){const e=Object(r.euiPaletteColorBlind)({rotations:2}),t=Object(r.euiPaletteColorBlindBehindText)({rotations:2}),a=Object.fromEntries(Object(s.zip)(e,t)),n=new u.a(void 0,(t=>Object(s.flatten)(new Array(Math.ceil(t/10)).fill(e)).map((e=>e.toLowerCase()))));return{id:"default",getCategoricalColor:function(l,o={behindText:!1}){let r;if(o.syncColors){const e=l[0].name;n.mapKeys([e]);const t=n.get(e);r=o.behindText?a[t]:t}else r=o.behindText?t[l[0].rankAtDepth%t.length]:e[l[0].rankAtDepth%e.length];return o.maxDepth&&1!==o.maxDepth?Object(c.a)(r,l.length,o.maxDepth):r},getCategoricalColors:()=>Object(r.euiPaletteColorBlind)(),toExpression:()=>({type:"expression",chain:[{type:"function",function:"system_palette",arguments:{name:["default"]}}]})}}function d(e,t){return{id:e,getCategoricalColor:function(e,a={behindText:!1}){const n=e[0].totalSeriesAtDepth,l=e[0].rankAtDepth,o=t(n)[l];return a.maxDepth&&1!==a.maxDepth?Object(c.a)(o,e.length,a.maxDepth):o},getCategoricalColors:t,canDynamicColoring:!0,toExpression:()=>({type:"expression",chain:[{type:"function",function:"system_palette",arguments:{name:[e]}}]})}}function f(e){const t=Object(i.createColorPalette)(20);return{id:"kibana_palette",getCategoricalColor:function(a,n={}){let l;return n.syncColors?(e.mappedColors.mapKeys([a[0].name]),l=e.mappedColors.get(a[0].name)):l=e.mappedColors.getColorFromConfig(a[0].name)||t[a[0].rankAtDepth%t.length],n.maxDepth&&1!==n.maxDepth?Object(c.a)(l,a.length,n.maxDepth):l},getCategoricalColors:()=>e.seedColors.slice(0,10),toExpression:()=>({type:"expression",chain:[{type:"function",function:"system_palette",arguments:{name:["kibana_palette"]}}]})}}const b=e=>({default:{title:o.i18n.translate("charts.palettes.defaultPaletteLabel",{defaultMessage:"Default"}),...h()},status:{title:o.i18n.translate("charts.palettes.statusLabel",{defaultMessage:"Status"}),...d("status",r.euiPaletteForStatus)},temperature:{title:o.i18n.translate("charts.palettes.temperatureLabel",{defaultMessage:"Temperature"}),...d("temperature",r.euiPaletteForTemperature)},complimentary:{title:o.i18n.translate("charts.palettes.complimentaryLabel",{defaultMessage:"Complimentary"}),...d("complimentary",r.euiPaletteComplementary)},negative:{title:o.i18n.translate("charts.palettes.negativeLabel",{defaultMessage:"Negative"}),...d("negative",r.euiPaletteNegative)},positive:{title:o.i18n.translate("charts.palettes.positiveLabel",{defaultMessage:"Positive"}),...d("positive",r.euiPalettePositive)},cool:{title:o.i18n.translate("charts.palettes.coolLabel",{defaultMessage:"Cool"}),...d("cool",r.euiPaletteCool)},warm:{title:o.i18n.translate("charts.palettes.warmLabel",{defaultMessage:"Warm"}),...d("warm",r.euiPaletteWarm)},gray:{title:o.i18n.translate("charts.palettes.grayLabel",{defaultMessage:"Gray"}),...d("gray",r.euiPaletteGray)},kibana_palette:{title:o.i18n.translate("charts.palettes.kibanaPaletteLabel",{defaultMessage:"Compatibility"}),...f(e)},custom:{id:"custom",getColorForValue:(e,t,a)=>function(e,t,a){if(null==e)return;const{colors:n,stops:l,range:o="percent",continuity:r="above",rangeMax:s,rangeMin:i}=t,c=Object(p.b)(r),u=Object(p.a)(r),h=function(e,{range:t,rangeMin:a},n){let l=e;return"percent"!==t||(l=100*(e-n.min)/(n.max-n.min),Number.isFinite(l))?l:a}(e,t,a),[d,f]="percent"===o?[0,100]:[a.min,a.max],b=m({stops:l,rangeMin:i},c,d),C=g({stops:l,colors:n,rangeMax:s},u,[d,f]),x=(e,t)=>e-t;return x(h,b)<0?c?n[0]:void 0:x(h,C)>0?u?n[n.length-1]:void 0:l.length?function(e,t,a,n){var l;return null!==(l=a[n.findIndex((a=>t(e,a)<0))])&&void 0!==l?l:e>=n[n.length-1]?a[a.length-1]:a[0]}(h,x,n,l):function(e,t,a,n,l){var o;const r=(l-n)/a.length,s=a.findIndex(((a,l)=>t(e,n+(1+l)*r)<=0));return null!==(o=a[s])&&void 0!==o?o:e>=n+a.length*r?a[a.length-1]:a[0]}(h,x,n,d,f)}(e,t,a),getCategoricalColor:(e,t={behindText:!1},{colors:a,gradient:n})=>{const o=n?l.a.scale(a).colors(e[0].totalSeriesAtDepth):a,r=o[e[0].rankAtDepth%o.length];return t.maxDepth&&1!==t.maxDepth?Object(c.a)(r,e.length,t.maxDepth):r},internal:!0,title:o.i18n.translate("charts.palettes.customLabel",{defaultMessage:"Custom"}),getCategoricalColors:(e,{colors:t,gradient:a,stepped:n,stops:o}={colors:[],gradient:!1,stepped:!1,stops:[]})=>{if(n){const a=o[o.length-1]-o[0],n=o[0],r=[...o.map((e=>(e-n)/a))];return l.a.scale(t).domain(r).colors(e)}return a?l.a.scale(t).colors(e):t},canDynamicColoring:!1,toExpression:({colors:e,gradient:t,stops:a=[],rangeMax:n,rangeMin:l,rangeType:o="percent",continuity:r="above",reverse:s=!1})=>({type:"expression",chain:[{type:"function",function:"palette",arguments:{color:e,gradient:[t],reverse:[s],continuity:[r],stop:a,range:[o],rangeMax:null==n?[]:[n],rangeMin:null==l?[]:[l]}}]})}})}}]);