(window.dataViewFieldEditor_bundle_jsonpfunction=window.dataViewFieldEditor_bundle_jsonpfunction||[]).push([[6],{53:function(e,t,n){"use strict";var a,r=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function o(e){for(var t=-1,n=0;n"object"==typeof e?JSON.stringify(e):e},{field:"output",name:s.i18n.translate("indexPatternFieldEditor.samples.outputHeader",{defaultMessage:"Output"}),render:e=>"html"===t?Object(l.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}):Object(l.jsx)("div",null,e)}];return e.length?Object(l.jsx)(o.EuiFormRow,{label:Object(l.jsx)(u.FormattedMessage,{id:"indexPatternFieldEditor.samplesHeader",defaultMessage:"Samples"})},Object(l.jsx)(o.EuiBasicTable,{className:"kbnFieldFormatEditor__samples",compressed:!0,items:e,columns:n})):null}}r()(samples_FormatEditorSamples,"defaultProps",{sampleType:"text"})},93:function(e,t,n){"use strict";n.r(t),n.d(t,"DurationFormatEditor",(function(){return DurationFormatEditor}));var a=n(4),r=n.n(a),i=n(1),o=n.n(i),s=n(2),u=n(14),l=n(3),d=n(7),c=n(60),f=n(31),m=n(0);class DurationFormatEditor extends d.DefaultFormatEditor{constructor(...e){super(...e),r()(this,"state",{...d.defaultState,sampleInputs:[-123,1,12,123,658,1988,3857,123292,923528271],hasDecimalError:!1})}static getDerivedStateFromProps(e,t){const n=super.getDerivedStateFromProps(e,t);let a=null;const{outputPrecision:r}=e.formatParams;return!e.format.isHuman()&&null!=r&&r>20?(a=l.i18n.translate("indexPatternFieldEditor.durationErrorMessage",{defaultMessage:"Decimal places must be between 0 and 20"}),e.onError(a),{...n,error:a,hasDecimalError:!0}):{...n,hasDecimalError:!1}}render(){var e;const{format:t}=this.props,{error:n,samples:a,hasDecimalError:r}=this.state,l={includeSpaceWithSuffix:t.getParamDefaults().includeSpaceWithSuffix,...this.props.formatParams};return Object(m.jsx)(i.Fragment,null,Object(m.jsx)(s.EuiFormRow,{label:Object(m.jsx)(u.FormattedMessage,{id:"indexPatternFieldEditor.duration.inputFormatLabel",defaultMessage:"Input format"}),isInvalid:!!n,error:r?null:n},Object(m.jsx)(s.EuiSelect,{"data-test-subj":"durationEditorInputFormat",value:l.inputFormat,options:t.type.inputFormats.map((e=>({value:e.kind,text:e.text}))),onChange:e=>{this.onChange({inputFormat:e.target.value})},isInvalid:!!n})),Object(m.jsx)(s.EuiFormRow,{label:Object(m.jsx)(u.FormattedMessage,{id:"indexPatternFieldEditor.duration.outputFormatLabel",defaultMessage:"Output format"}),isInvalid:!!n},Object(m.jsx)(s.EuiSelect,{"data-test-subj":"durationEditorOutputFormat",value:l.outputFormat,options:t.type.outputFormats.map((e=>({value:e.method,text:e.text}))),onChange:e=>{this.onChange({outputFormat:e.target.value})},isInvalid:!!n})),t.isHuman()?null:Object(m.jsx)(o.a.Fragment,null,Object(m.jsx)(s.EuiFormRow,{label:Object(m.jsx)(u.FormattedMessage,{id:"indexPatternFieldEditor.duration.decimalPlacesLabel",defaultMessage:"Decimal places"}),isInvalid:!!n,error:r?n:null},Object(m.jsx)(s.EuiFieldNumber,{value:null!==(e=l.outputPrecision)&&void 0!==e?e:void 0,min:0,max:20,onChange:e=>{this.onChange({outputPrecision:e.target.value?Number(e.target.value):null})},isInvalid:!!n})),!t.isHumanPrecise()&&Object(m.jsx)(s.EuiFormRow,null,Object(m.jsx)(s.EuiSwitch,{label:Object(m.jsx)(u.FormattedMessage,{id:"indexPatternFieldEditor.duration.showSuffixLabel",defaultMessage:"Show suffix"}),checked:Boolean(l.showSuffix),onChange:e=>{this.onChange({showSuffix:!l.showSuffix})}})),Object(m.jsx)(s.EuiFormRow,null,Object(m.jsx)(s.EuiSwitch,{disabled:!Boolean(l.showSuffix)&&!t.isHumanPrecise(),label:Object(m.jsx)(u.FormattedMessage,{id:"indexPatternFieldEditor.duration.showSuffixLabel.short",defaultMessage:"Use short suffix"}),checked:Boolean(l.useShortSuffix),onChange:e=>{this.onChange({useShortSuffix:!l.useShortSuffix})}})),Object(m.jsx)(s.EuiFormRow,null,Object(m.jsx)(s.EuiSwitch,{disabled:!Boolean(l.showSuffix)&&!t.isHumanPrecise(),label:Object(m.jsx)(u.FormattedMessage,{id:"indexPatternFieldEditor.duration.includeSpace",defaultMessage:"Include space between suffix and value"}),checked:Boolean(l.includeSpaceWithSuffix),onChange:e=>{this.onChange({includeSpaceWithSuffix:!l.includeSpaceWithSuffix})}}))),Object(m.jsx)(c.a,{samples:a}))}}r()(DurationFormatEditor,"formatId",f.a)}}]);