/*! 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. */
(window.exploratoryView_bundle_jsonpfunction=window.exploratoryView_bundle_jsonpfunction||[]).push([[9],{79:function(e,t,i){"use strict";i.r(t),i.d(t,"buildFilterLabel",(function(){return s})),i.d(t,"FilterValueLabel",(function(){return o}));var a=i(1),n=i.n(a),l=i(42),r=i(41),u=i(48),d=i(18);function s({field:e,value:t,label:i,dataView:a,negate:n}){const l=a.getFieldByName(e),u=Array.isArray(t)&&t.length>1,d=u?Object(r.buildPhrasesFilter)(l,t,a):Object(r.buildPhraseFilter)(l,Array.isArray(t)?t[0]:t,a);return d.meta.type=u?"phrases":"phrase",d.meta.value=Array.isArray(t)?u?void 0:`${t[0]}`:t,d.meta.key=i,d.meta.alias=null,d.meta.negate=n,d.meta.disabled=!1,d}function o({label:e,field:t,value:i,negate:a,dataView:r,invertFilter:o,removeFilter:c,allowExclusion:b=!0}){const f=Object(l.injectI18n)(u.FilterItem),m=s({field:t,value:i,label:e,dataView:r,negate:a}),{services:{uiSettings:F,docLinks:g}}=Object(d.useKibana)();return r?n.a.createElement(f,{indexPatterns:[r],id:`${t}-${i}-${a}`,filter:m,onRemove:()=>{c(t,i,!1)},onUpdate:e=>{e.meta.negate!==a&&o({field:t,value:i,negate:a})},uiSettings:F,docLinks:g,hiddenPanelOptions:[...b?[]:["negateFilter"],"pinFilter","editFilter","disableFilter"]}):null}t.default=o}}]);