/*!
 * Copyright © 2018 Splunk Inc.
 * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
 * in part without a valid written license from Splunk Inc. is PROHIBITED.
 */(()=>{"use strict";var e={1027:(e,t,o)=>{o.d(t,{getOptions:()=>r});o(6195),o(4793);require("@splunk/visualizations-shared/schemaUtils");const r=(e,t)=>{if(Array.isArray(t))return t;if(e&&Array.isArray(e.enum))return e.enum.map((e=>({value:e})));throw Error(`No valid values provided to editor: ${JSON.stringify(e)}`)}},2166:(e,t,o)=>{o.d(t,{hasTokens:()=>n});const r=new RegExp(/\$/.source+/(\w+:)?/.source+/([^$|:]+?)(\|[|\w]+)?/.source+/\$/.source),n=e=>"string"==typeof e&&r.test(e)},4008:function(e,t,o){var r=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AdvancedConfigButton=void 0;const a=l(o(9497)),s=l(o(23)),u=i(o(232)),d=o(6649),c=i(o(6643)),p=o(3563),f=i(o(6379)),b=i(o(7020)),v=i(o(9250)),m=(0,u.default)(v.default)`
    margin-top: 0;
    padding: 0;
    // adjust bottom margin according to theme
    margin-bottom: ${p.variables.spacingMedium};
    width: 100%;

    // remove top margin of the first component in control group
    &:first-child {
        margin-top: 0;
    }

    // remove bottom margin of the last component in control group
    &:last-child {
        margin-bottom: 0;
    }
    // remove top padding on label of the first control group
    [data-test='label']:first-of-type {
        padding-top: 0;
    }
`,g=(0,u.default)(f.default)`
    display: flex;
    > span {
        display: flex;
        width: 35px;
    }
`,h=(0,u.default)(b.default)`
    color: ${p.variables.contentColorActive} !important;
    &:hover {
        background-color: ${p.variables.interactiveColorOverlayDrag} !important;
    }
`;t.AdvancedConfigButton=({label:e="",onClick:t})=>a.default.createElement(g,{"data-test":`${e}-advanced-config-button-tooltip`,content:(0,d._)("Advanced configurations")},a.default.createElement(h,{"data-test":`${e}-advanced-config-button`,icon:a.default.createElement(c.default,{"data-test":`${e}-advanced-config-button-icon`}),appearance:"subtle",onClick:t}));const y=({"data-test":e,children:o,isAdvanced:r=!1,label:n,hideLabel:l,labelPosition:i,labelWidth:s,tooltip:u,help:d,style:c,error:p,controlsLayout:f,onClick:b,onAdvancedConfigButtonClick:v})=>a.default.createElement(m,{"data-test":null!=e?e:"control-group",label:n,hideLabel:l,labelPosition:i,labelWidth:s,tooltip:u,help:d,error:p,style:c,onClick:b,controlsLayout:f},r?a.Children.toArray(o).filter(Boolean).map((e=>(0,a.cloneElement)(e,{style:{flex:1}}))):o,r?a.default.createElement(t.AdvancedConfigButton,{label:n,onClick:v}):null);y.propTypes={style:s.object,isAdvanced:s.bool,onClick:s.func,onAdvancedConfigButtonClick:s.func},t.default=y},5862:(e,t)=>{t.editorStyle=void 0,t.editorStyle={width:"100%"}},6195:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6643:e=>{e.exports=require("@splunk/react-icons/SlidersDoubleHorizontal")},7020:e=>{e.exports=require("@splunk/react-ui/Button")},9250:e=>{e.exports=require("@splunk/react-ui/ControlGroup")},2373:e=>{e.exports=require("@splunk/react-ui/Select")},6379:e=>{e.exports=require("@splunk/react-ui/Tooltip")},3563:e=>{e.exports=require("@splunk/themes")},6649:e=>{e.exports=require("@splunk/ui-utils/i18n")},4793:e=>{e.exports=require("lodash")},23:e=>{e.exports=require("prop-types")},9497:e=>{e.exports=require("react")},232:e=>{e.exports=require("styled-components")}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var l=t[r]={exports:{}};return e[r].call(l.exports,l,l.exports,o),l.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{o.r(r),o.d(r,{default:()=>b});var e=o(9497),t=o.n(e),n=o(23),l=o.n(n),i=o(2373),a=o.n(i),s=o(2166),u=o(1027),d=o(5862),c=o(4008),p=o.n(c);const f=({onChange:o,name:r,itemSchema:n,values:l,value:i,labelPosition:c="top",labelWidth:f,label:b,tooltip:v,isDisabled:m=!1,isAdvanced:g,hideLabel:h,help:y})=>{const x=(0,u.getOptions)(n,l),O=(0,s.hasTokens)(i)||m,k=(0,e.useCallback)(((e,{value:t})=>o(e,r,t)),[o,r]);return t().createElement(p(),{label:b,labelPosition:c,labelWidth:f,tooltip:v,help:y,isAdvanced:g,hideLabel:h},t().createElement(a(),{"data-test":r,onChange:k,value:i,disabled:O,style:d.editorStyle},x.map((e=>t().createElement(a().Option,{key:e.value,value:e.value,label:e.label||e.value,icon:e.icon?t().createElement(e.icon,null):null,description:e.description})))))};f.propTypes={onChange:l().func.isRequired,name:l().string.isRequired,itemSchema:l().object,values:l().arrayOf(l().shape({label:l().string,value:l().oneOfType([l().string,l().number]).isRequired,description:l().string})),value:l().oneOfType([l().string,l().number]),label:l().string.isRequired,labelPosition:l().oneOf(["left","top"]),labelWidth:l().number,tooltip:l().string,isDisabled:l().bool,isAdvanced:l().bool,hideLabel:l().bool,help:l().string};const b=f})(),module.exports=r})();
//# sourceMappingURL=SelectEditor.js.map